aboutsummaryrefslogtreecommitdiffstats
path: root/signaling-server/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/benchmark.html
diff options
context:
space:
mode:
Diffstat (limited to 'signaling-server/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/benchmark.html')
-rwxr-xr-xsignaling-server/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/benchmark.html111608
1 files changed, 111608 insertions, 0 deletions
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/benchmark.html b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/benchmark.html
new file mode 100755
index 0000000..1a88d9c
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/benchmark.html
@@ -0,0 +1,111608 @@
+<!doctype html>
+<html>
+ <head>
+ <title>ZeParser benchmark</title>
+ <style>
+ </style>
+ </head>
+ <body>
+ <h1>ZeParser benchmark</h1>
+ <p>ES5 parser by Peter van der Zee, (c) qfox.nl</p>
+ <p>This page demonstrates parsing various scripts. It does this 10x per script, this gives the browser enough time to warm up optimization engines. The avg drops the min and max result. Tokens can be white (-space..) or black. Units: kb = 1024 chars, k-tok = 1000 tokens, k-b-tok = 1000 black tokens.</p>
+
+ <pre id="dbg"></pre>
+
+<script id="legacy" type="x"> // this is a combination of the minified versions of Ext.js (710k), mootools (90k), jquery (90k), prototype (160k, normal) and dojo (90k)
+/*
+ * Ext JS Library 3.3.1
+ * Copyright(c) 2006-2010 Sencha Inc.
+ * licensing@sencha.com
+ * http://www.sencha.com/license
+ */
+(function(){var h=Ext.util,k=Ext.each,g=true,i=false;h.Observable=function(){var l=this,m=l.events;if(l.listeners){l.on(l.listeners);delete l.listeners}l.events=m||{}};h.Observable.prototype={filterOptRe:/^(?:scope|delay|buffer|single)$/,fireEvent:function(){var l=Array.prototype.slice.call(arguments,0),n=l[0].toLowerCase(),o=this,m=g,r=o.events[n],t,p,s;if(o.eventsSuspended===g){if(p=o.eventQueue){p.push(l)}}else{if(typeof r=="object"){if(r.bubble){if(r.fire.apply(r,l.slice(1))===i){return i}s=o.getBubbleTarget&&o.getBubbleTarget();if(s&&s.enableBubble){t=s.events[n];if(!t||typeof t!="object"||!t.bubble){s.enableBubble(n)}return s.fireEvent.apply(s,l)}}else{l.shift();m=r.fire.apply(r,l)}}}return m},addListener:function(l,n,m,s){var p=this,r,t,q;if(typeof l=="object"){s=l;for(r in s){t=s[r];if(!p.filterOptRe.test(r)){p.addListener(r,t.fn||t,t.scope||s.scope,t.fn?t:s)}}}else{l=l.toLowerCase();q=p.events[l]||g;if(typeof q=="boolean"){p.events[l]=q=new h.Event(p,l)}q.addListener(n,m,typeof s=="object"?s:{})}},removeListener:function(l,n,m){var o=this.events[l.toLowerCase()];if(typeof o=="object"){o.removeListener(n,m)}},purgeListeners:function(){var n=this.events,l,m;for(m in n){l=n[m];if(typeof l=="object"){l.clearListeners()}}},addEvents:function(p){var n=this;n.events=n.events||{};if(typeof p=="string"){var l=arguments,m=l.length;while(m--){n.events[l[m]]=n.events[l[m]]||g}}else{Ext.applyIf(n.events,p)}},hasListener:function(l){var m=this.events[l.toLowerCase()];return typeof m=="object"&&m.listeners.length>0},suspendEvents:function(l){this.eventsSuspended=g;if(l&&!this.eventQueue){this.eventQueue=[]}},resumeEvents:function(){var l=this,m=l.eventQueue||[];l.eventsSuspended=i;delete l.eventQueue;k(m,function(n){l.fireEvent.apply(l,n)})}};var d=h.Observable.prototype;d.on=d.addListener;d.un=d.removeListener;h.Observable.releaseCapture=function(l){l.fireEvent=d.fireEvent};function e(m,n,l){return function(){if(n.target==arguments[0]){m.apply(l,Array.prototype.slice.call(arguments,0))}}}function b(p,q,m,n){m.task=new h.DelayedTask();return function(){m.task.delay(q.buffer,p,n,Array.prototype.slice.call(arguments,0))}}function c(n,o,m,l){return function(){o.removeListener(m,l);return n.apply(l,arguments)}}function a(p,q,m,n){return function(){var l=new h.DelayedTask(),o=Array.prototype.slice.call(arguments,0);if(!m.tasks){m.tasks=[]}m.tasks.push(l);l.delay(q.delay||10,function(){m.tasks.remove(l);p.apply(n,o)},n)}}h.Event=function(m,l){this.name=l;this.obj=m;this.listeners=[]};h.Event.prototype={addListener:function(p,o,n){var q=this,m;o=o||q.obj;if(!q.isListening(p,o)){m=q.createListener(p,o,n);if(q.firing){q.listeners=q.listeners.slice(0)}q.listeners.push(m)}},createListener:function(q,p,r){r=r||{};p=p||this.obj;var m={fn:q,scope:p,options:r},n=q;if(r.target){n=e(n,r,p)}if(r.delay){n=a(n,r,m,p)}if(r.single){n=c(n,this,q,p)}if(r.buffer){n=b(n,r,m,p)}m.fireFn=n;return m},findListener:function(p,o){var q=this.listeners,n=q.length,m;o=o||this.obj;while(n--){m=q[n];if(m){if(m.fn==p&&m.scope==o){return n}}}return -1},isListening:function(m,l){return this.findListener(m,l)!=-1},removeListener:function(r,q){var p,m,n,s=this,o=i;if((p=s.findListener(r,q))!=-1){if(s.firing){s.listeners=s.listeners.slice(0)}m=s.listeners[p];if(m.task){m.task.cancel();delete m.task}n=m.tasks&&m.tasks.length;if(n){while(n--){m.tasks[n].cancel()}delete m.tasks}s.listeners.splice(p,1);o=g}return o},clearListeners:function(){var o=this,m=o.listeners,n=m.length;while(n--){o.removeListener(m[n].fn,m[n].scope)}},fire:function(){var r=this,q=r.listeners,m=q.length,p=0,n;if(m>0){r.firing=g;var o=Array.prototype.slice.call(arguments,0);for(;p<m;p++){n=q[p];if(n&&n.fireFn.apply(n.scope||r.obj||window,o)===i){return(r.firing=i)}}}r.firing=i;return g}}})();Ext.DomHelper=function(){var x=null,l=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,n=/^table|tbody|tr|td$/i,d=/tag|children|cn|html$/i,t=/td|tr|tbody/i,p=/([a-z0-9-]+)\s*:\s*([^;\s]+(?:\s*[^;\s]+)*);?/gi,v=/end/i,s,o="afterbegin",q="afterend",c="beforebegin",r="beforeend",a="<table>",i="</table>",b=a+"<tbody>",k="</tbody>"+i,m=b+"<tr>",w="</tr>"+k;function h(B,D,C,E,A,y){var z=s.insertHtml(E,Ext.getDom(B),u(D));return C?Ext.get(z,true):z}function u(D){var z="",y,C,B,E;if(typeof D=="string"){z=D}else{if(Ext.isArray(D)){for(var A=0;A<D.length;A++){if(D[A]){z+=u(D[A])}}}else{z+="<"+(D.tag=D.tag||"div");for(y in D){C=D[y];if(!d.test(y)){if(typeof C=="object"){z+=" "+y+'="';for(B in C){z+=B+":"+C[B]+";"}z+='"'}else{z+=" "+({cls:"class",htmlFor:"for"}[y]||y)+'="'+C+'"'}}}if(l.test(D.tag)){z+="/>"}else{z+=">";if((E=D.children||D.cn)){z+=u(E)}else{if(D.html){z+=D.html}}z+="</"+D.tag+">"}}}return z}function g(F,C,B,D){x.innerHTML=[C,B,D].join("");var y=-1,A=x,z;while(++y<F){A=A.firstChild}if(z=A.nextSibling){var E=document.createDocumentFragment();while(A){z=A.nextSibling;E.appendChild(A);A=z}A=E}return A}function e(y,z,B,A){var C,D;x=x||document.createElement("div");if(y=="td"&&(z==o||z==r)||!t.test(y)&&(z==c||z==q)){return}D=z==c?B:z==q?B.nextSibling:z==o?B.firstChild:null;if(z==c||z==q){B=B.parentNode}if(y=="td"||(y=="tr"&&(z==r||z==o))){C=g(4,m,A,w)}else{if((y=="tbody"&&(z==r||z==o))||(y=="tr"&&(z==c||z==q))){C=g(3,b,A,k)}else{C=g(2,a,A,i)}}B.insertBefore(C,D);return C}s={markup:function(y){return u(y)},applyStyles:function(y,z){if(z){var A;y=Ext.fly(y);if(typeof z=="function"){z=z.call()}if(typeof z=="string"){p.lastIndex=0;while((A=p.exec(z))){y.setStyle(A[1],A[2])}}else{if(typeof z=="object"){y.setStyle(z)}}}},insertHtml:function(D,y,E){var C={},A,G,F,H,B,z;D=D.toLowerCase();C[c]=["BeforeBegin","previousSibling"];C[q]=["AfterEnd","nextSibling"];if(y.insertAdjacentHTML){if(n.test(y.tagName)&&(z=e(y.tagName.toLowerCase(),D,y,E))){return z}C[o]=["AfterBegin","firstChild"];C[r]=["BeforeEnd","lastChild"];if((A=C[D])){y.insertAdjacentHTML(A[0],E);return y[A[1]]}}else{F=y.ownerDocument.createRange();G="setStart"+(v.test(D)?"After":"Before");if(C[D]){F[G](y);H=F.createContextualFragment(E);y.parentNode.insertBefore(H,D==c?y:y.nextSibling);return y[(D==c?"previous":"next")+"Sibling"]}else{B=(D==o?"first":"last")+"Child";if(y.firstChild){F[G](y[B]);H=F.createContextualFragment(E);if(D==o){y.insertBefore(H,y.firstChild)}else{y.appendChild(H)}}else{y.innerHTML=E}return y[B]}}throw'Illegal insertion point -> "'+D+'"'},insertBefore:function(y,A,z){return h(y,A,z,c)},insertAfter:function(y,A,z){return h(y,A,z,q,"nextSibling")},insertFirst:function(y,A,z){return h(y,A,z,o,"firstChild")},append:function(y,A,z){return h(y,A,z,r,"",true)},overwrite:function(y,A,z){y=Ext.getDom(y);y.innerHTML=u(A);return z?Ext.get(y.firstChild):y.firstChild},createHtml:u};return s}();Ext.Template=function(h){var k=this,c=arguments,e=[],d;if(Ext.isArray(h)){h=h.join("")}else{if(c.length>1){for(var g=0,b=c.length;g<b;g++){d=c[g];if(typeof d=="object"){Ext.apply(k,d)}else{e.push(d)}}h=e.join("")}}k.html=h;if(k.compiled){k.compile()}};Ext.Template.prototype={re:/\{([\w-]+)\}/g,applyTemplate:function(a){var b=this;return b.compiled?b.compiled(a):b.html.replace(b.re,function(c,d){return a[d]!==undefined?a[d]:""})},set:function(a,c){var b=this;b.html=a;b.compiled=null;return c?b.compile():b},compile:function(){var me=this,sep=Ext.isGecko?"+":",";function fn(m,name){name="values['"+name+"']";return"'"+sep+"("+name+" == undefined ? '' : "+name+")"+sep+"'"}eval("this.compiled = function(values){ return "+(Ext.isGecko?"'":"['")+me.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn)+(Ext.isGecko?"';};":"'].join('');};"));return me},insertFirst:function(b,a,c){return this.doInsert("afterBegin",b,a,c)},insertBefore:function(b,a,c){return this.doInsert("beforeBegin",b,a,c)},insertAfter:function(b,a,c){return this.doInsert("afterEnd",b,a,c)},append:function(b,a,c){return this.doInsert("beforeEnd",b,a,c)},doInsert:function(c,e,b,a){e=Ext.getDom(e);var d=Ext.DomHelper.insertHtml(c,e,this.applyTemplate(b));return a?Ext.get(d,true):d},overwrite:function(b,a,c){b=Ext.getDom(b);b.innerHTML=this.applyTemplate(a);return c?Ext.get(b.firstChild,true):b.firstChild}};Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;Ext.Template.from=function(b,a){b=Ext.getDom(b);return new Ext.Template(b.value||b.innerHTML,a||"")};Ext.DomQuery=function(){var cache={},simpleCache={},valueCache={},nonSpace=/\S/,trimRe=/^\s+|\s+$/g,tplRe=/\{(\d+)\}/g,modeRe=/^(\s?[\/>+~]\s?|\s|$)/,tagTokenRe=/^(#)?([\w-\*]+)/,nthRe=/(\d*)n\+?(\d*)/,nthRe2=/\D/,isIE=window.ActiveXObject?true:false,key=30803;eval("var batch = 30803;");function child(parent,index){var i=0,n=parent.firstChild;while(n){if(n.nodeType==1){if(++i==index){return n}}n=n.nextSibling}return null}function next(n){while((n=n.nextSibling)&&n.nodeType!=1){}return n}function prev(n){while((n=n.previousSibling)&&n.nodeType!=1){}return n}function children(parent){var n=parent.firstChild,nodeIndex=-1,nextNode;while(n){nextNode=n.nextSibling;if(n.nodeType==3&&!nonSpace.test(n.nodeValue)){parent.removeChild(n)}else{n.nodeIndex=++nodeIndex}n=nextNode}return this}function byClassName(nodeSet,cls){if(!cls){return nodeSet}var result=[],ri=-1;for(var i=0,ci;ci=nodeSet[i];i++){if((" "+ci.className+" ").indexOf(cls)!=-1){result[++ri]=ci}}return result}function attrValue(n,attr){if(!n.tagName&&typeof n.length!="undefined"){n=n[0]}if(!n){return null}if(attr=="for"){return n.htmlFor}if(attr=="class"||attr=="className"){return n.className}return n.getAttribute(attr)||n[attr]}function getNodes(ns,mode,tagName){var result=[],ri=-1,cs;if(!ns){return result}tagName=tagName||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns]}if(!mode){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(tagName);for(var j=0,ci;ci=cs[j];j++){result[++ri]=ci}}}else{if(mode=="/"||mode==">"){var utag=tagName.toUpperCase();for(var i=0,ni,cn;ni=ns[i];i++){cn=ni.childNodes;for(var j=0,cj;cj=cn[j];j++){if(cj.nodeName==utag||cj.nodeName==tagName||tagName=="*"){result[++ri]=cj}}}}else{if(mode=="+"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(n&&(n.nodeName==utag||n.nodeName==tagName||tagName=="*")){result[++ri]=n}}}else{if(mode=="~"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)){if(n.nodeName==utag||n.nodeName==tagName||tagName=="*"){result[++ri]=n}}}}}}}return result}function concat(a,b){if(b.slice){return a.concat(b)}for(var i=0,l=b.length;i<l;i++){a[a.length]=b[i]}return a}function byTag(cs,tagName){if(cs.tagName||cs==document){cs=[cs]}if(!tagName){return cs}var result=[],ri=-1;tagName=tagName.toLowerCase();for(var i=0,ci;ci=cs[i];i++){if(ci.nodeType==1&&ci.tagName.toLowerCase()==tagName){result[++ri]=ci}}return result}function byId(cs,id){if(cs.tagName||cs==document){cs=[cs]}if(!id){return cs}var result=[],ri=-1;for(var i=0,ci;ci=cs[i];i++){if(ci&&ci.id==id){result[++ri]=ci;return result}}return result}function byAttribute(cs,attr,value,op,custom){var result=[],ri=-1,useGetStyle=custom=="{",fn=Ext.DomQuery.operators[op],a,xml,hasXml;for(var i=0,ci;ci=cs[i];i++){if(ci.nodeType!=1){continue}if(!hasXml){xml=Ext.DomQuery.isXml(ci);hasXml=true}if(!xml){if(useGetStyle){a=Ext.DomQuery.getStyle(ci,attr)}else{if(attr=="class"||attr=="className"){a=ci.className}else{if(attr=="for"){a=ci.htmlFor}else{if(attr=="href"){a=ci.getAttribute("href",2)}else{a=ci.getAttribute(attr)}}}}}else{a=ci.getAttribute(attr)}if((fn&&fn(a,value))||(!fn&&a)){result[++ri]=ci}}return result}function byPseudo(cs,name,value){return Ext.DomQuery.pseudos[name](cs,value)}function nodupIEXml(cs){var d=++key,r;cs[0].setAttribute("_nodup",d);r=[cs[0]];for(var i=1,len=cs.length;i<len;i++){var c=cs[i];if(!c.getAttribute("_nodup")!=d){c.setAttribute("_nodup",d);r[r.length]=c}}for(var i=0,len=cs.length;i<len;i++){cs[i].removeAttribute("_nodup")}return r}function nodup(cs){if(!cs){return[]}var len=cs.length,c,i,r=cs,cj,ri=-1;if(!len||typeof cs.nodeType!="undefined"||len==1){return cs}if(isIE&&typeof cs[0].selectSingleNode!="undefined"){return nodupIEXml(cs)}var d=++key;cs[0]._nodup=d;for(i=1;c=cs[i];i++){if(c._nodup!=d){c._nodup=d}else{r=[];for(var j=0;j<i;j++){r[++ri]=cs[j]}for(j=i+1;cj=cs[j];j++){if(cj._nodup!=d){cj._nodup=d;r[++ri]=cj}}return r}}return r}function quickDiffIEXml(c1,c2){var d=++key,r=[];for(var i=0,len=c1.length;i<len;i++){c1[i].setAttribute("_qdiff",d)}for(var i=0,len=c2.length;i<len;i++){if(c2[i].getAttribute("_qdiff")!=d){r[r.length]=c2[i]}}for(var i=0,len=c1.length;i<len;i++){c1[i].removeAttribute("_qdiff")}return r}function quickDiff(c1,c2){var len1=c1.length,d=++key,r=[];if(!len1){return c2}if(isIE&&typeof c1[0].selectSingleNode!="undefined"){return quickDiffIEXml(c1,c2)}for(var i=0;i<len1;i++){c1[i]._qdiff=d}for(var i=0,len=c2.length;i<len;i++){if(c2[i]._qdiff!=d){r[r.length]=c2[i]}}return r}function quickId(ns,mode,root,id){if(ns==root){var d=root.ownerDocument||root;return d.getElementById(id)}ns=getNodes(ns,mode,"*");return byId(ns,id)}return{getStyle:function(el,name){return Ext.fly(el).getStyle(name)},compile:function(path,type){type=type||"select";var fn=["var f = function(root){\n var mode; ++batch; var n = root || document;\n"],mode,lastPath,matchers=Ext.DomQuery.matchers,matchersLn=matchers.length,modeMatch,lmode=path.match(modeRe);if(lmode&&lmode[1]){fn[fn.length]='mode="'+lmode[1].replace(trimRe,"")+'";';path=path.replace(lmode[1],"")}while(path.substr(0,1)=="/"){path=path.substr(1)}while(path&&lastPath!=path){lastPath=path;var tokenMatch=path.match(tagTokenRe);if(type=="select"){if(tokenMatch){if(tokenMatch[1]=="#"){fn[fn.length]='n = quickId(n, mode, root, "'+tokenMatch[2]+'");'}else{fn[fn.length]='n = getNodes(n, mode, "'+tokenMatch[2]+'");'}path=path.replace(tokenMatch[0],"")}else{if(path.substr(0,1)!="@"){fn[fn.length]='n = getNodes(n, mode, "*");'}}}else{if(tokenMatch){if(tokenMatch[1]=="#"){fn[fn.length]='n = byId(n, "'+tokenMatch[2]+'");'}else{fn[fn.length]='n = byTag(n, "'+tokenMatch[2]+'");'}path=path.replace(tokenMatch[0],"")}}while(!(modeMatch=path.match(modeRe))){var matched=false;for(var j=0;j<matchersLn;j++){var t=matchers[j];var m=path.match(t.re);if(m){fn[fn.length]=t.select.replace(tplRe,function(x,i){return m[i]});path=path.replace(m[0],"");matched=true;break}}if(!matched){throw'Error parsing selector, parsing failed at "'+path+'"'}}if(modeMatch[1]){fn[fn.length]='mode="'+modeMatch[1].replace(trimRe,"")+'";';path=path.replace(modeMatch[1],"")}}fn[fn.length]="return nodup(n);\n}";eval(fn.join(""));return f},jsSelect:function(path,root,type){root=root||document;if(typeof root=="string"){root=document.getElementById(root)}var paths=path.split(","),results=[];for(var i=0,len=paths.length;i<len;i++){var subPath=paths[i].replace(trimRe,"");if(!cache[subPath]){cache[subPath]=Ext.DomQuery.compile(subPath);if(!cache[subPath]){throw subPath+" is not a valid selector"}}var result=cache[subPath](root);if(result&&result!=document){results=results.concat(result)}}if(paths.length>1){return nodup(results)}return results},isXml:function(el){var docEl=(el?el.ownerDocument||el:0).documentElement;return docEl?docEl.nodeName!=="HTML":false},select:document.querySelectorAll?function(path,root,type){root=root||document;if(!Ext.DomQuery.isXml(root)){try{var cs=root.querySelectorAll(path);return Ext.toArray(cs)}catch(ex){}}return Ext.DomQuery.jsSelect.call(this,path,root,type)}:function(path,root,type){return Ext.DomQuery.jsSelect.call(this,path,root,type)},selectNode:function(path,root){return Ext.DomQuery.select(path,root)[0]},selectValue:function(path,root,defaultValue){path=path.replace(trimRe,"");if(!valueCache[path]){valueCache[path]=Ext.DomQuery.compile(path,"select")}var n=valueCache[path](root),v;n=n[0]?n[0]:n;if(typeof n.normalize=="function"){n.normalize()}v=(n&&n.firstChild?n.firstChild.nodeValue:null);return((v===null||v===undefined||v==="")?defaultValue:v)},selectNumber:function(path,root,defaultValue){var v=Ext.DomQuery.selectValue(path,root,defaultValue||0);return parseFloat(v)},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el)}var isArray=Ext.isArray(el),result=Ext.DomQuery.filter(isArray?el:[el],ss);return isArray?(result.length==el.length):(result.length>0)},filter:function(els,ss,nonMatches){ss=ss.replace(trimRe,"");if(!simpleCache[ss]){simpleCache[ss]=Ext.DomQuery.compile(ss,"simple")}var result=simpleCache[ss](els);return nonMatches?quickDiff(result,els):result},matchers:[{re:/^\.([\w-]+)/,select:'n = byClassName(n, " {1} ");'},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'},{re:/^#([\w-]+)/,select:'n = byId(n, "{1}");'},{re:/^@([\w-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],operators:{"=":function(a,v){return a==v},"!=":function(a,v){return a!=v},"^=":function(a,v){return a&&a.substr(0,v.length)==v},"$=":function(a,v){return a&&a.substr(a.length-v.length)==v},"*=":function(a,v){return a&&a.indexOf(v)!==-1},"%=":function(a,v){return(a%v)==0},"|=":function(a,v){return a&&(a==v||a.substr(0,v.length+1)==v+"-")},"~=":function(a,v){return a&&(" "+a+" ").indexOf(" "+v+" ")!=-1}},pseudos:{"first-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.previousSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"last-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"nth-child":function(c,a){var r=[],ri=-1,m=nthRe.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!nthRe2.test(a)&&"n+"+a||a),f=(m[1]||1)-0,l=m[2]-0;for(var i=0,n;n=c[i];i++){var pn=n.parentNode;if(batch!=pn._batch){var j=0;for(var cn=pn.firstChild;cn;cn=cn.nextSibling){if(cn.nodeType==1){cn.nodeIndex=++j}}pn._batch=batch}if(f==1){if(l==0||n.nodeIndex==l){r[++ri]=n}}else{if((n.nodeIndex+l)%f==0){r[++ri]=n}}}return r},"only-child":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(!prev(ci)&&!next(ci)){r[++ri]=ci}}return r},empty:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var cns=ci.childNodes,j=0,cn,empty=true;while(cn=cns[j]){++j;if(cn.nodeType==1||cn.nodeType==3){empty=false;break}}if(empty){r[++ri]=ci}}return r},contains:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if((ci.textContent||ci.innerText||"").indexOf(v)!=-1){r[++ri]=ci}}return r},nodeValue:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[++ri]=ci}}return r},checked:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[++ri]=ci}}return r},not:function(c,ss){return Ext.DomQuery.filter(c,ss,true)},any:function(c,selectors){var ss=selectors.split("|"),r=[],ri=-1,s;for(var i=0,ci;ci=c[i];i++){for(var j=0;s=ss[j];j++){if(Ext.DomQuery.is(ci,s)){r[++ri]=ci;break}}}return r},odd:function(c){return this["nth-child"](c,"odd")},even:function(c){return this["nth-child"](c,"even")},nth:function(c,a){return c[a-1]||[]},first:function(c){return c[0]||[]},last:function(c){return c[c.length-1]||[]},has:function(c,ss){var s=Ext.DomQuery.select,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[++ri]=ci}}return r},next:function(c,ss){var is=Ext.DomQuery.is,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=next(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r},prev:function(c,ss){var is=Ext.DomQuery.is,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=prev(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r}}}}();Ext.query=Ext.DomQuery.select;Ext.util.DelayedTask=function(d,c,a){var e=this,g,b=function(){clearInterval(g);g=null;d.apply(c,a||[])};e.delay=function(i,l,k,h){e.cancel();d=l||d;c=k||c;a=h||a;g=setInterval(b,i)};e.cancel=function(){if(g){clearInterval(g);g=null}}};(function(){var h=document;Ext.Element=function(m,n){var o=typeof m=="string"?h.getElementById(m):m,p;if(!o){return null}p=o.id;if(!n&&p&&Ext.elCache[p]){return Ext.elCache[p].el}this.dom=o;this.id=p||Ext.id(o)};var d=Ext.DomHelper,e=Ext.Element,a=Ext.elCache;e.prototype={set:function(r,n){var p=this.dom,m,q,n=(n!==false)&&!!p.setAttribute;for(m in r){if(r.hasOwnProperty(m)){q=r[m];if(m=="style"){d.applyStyles(p,q)}else{if(m=="cls"){p.className=q}else{if(n){p.setAttribute(m,q)}else{p[m]=q}}}}}return this},defaultUnit:"px",is:function(m){return Ext.DomQuery.is(this.dom,m)},focus:function(p,o){var m=this,o=o||m.dom;try{if(Number(p)){m.focus.defer(p,null,[null,o])}else{o.focus()}}catch(n){}return m},blur:function(){try{this.dom.blur()}catch(m){}return this},getValue:function(m){var n=this.dom.value;return m?parseInt(n,10):n},addListener:function(m,p,o,n){Ext.EventManager.on(this.dom,m,p,o||this,n);return this},removeListener:function(m,o,n){Ext.EventManager.removeListener(this.dom,m,o,n||this);return this},removeAllListeners:function(){Ext.EventManager.removeAll(this.dom);return this},purgeAllListeners:function(){Ext.EventManager.purgeElement(this,true);return this},addUnits:function(m){if(m===""||m=="auto"||m===undefined){m=m||""}else{if(!isNaN(m)||!i.test(m)){m=m+(this.defaultUnit||"px")}}return m},load:function(n,o,m){Ext.Ajax.request(Ext.apply({params:o,url:n.url||n,callback:m,el:this.dom,indicatorText:n.indicatorText||""},Ext.isObject(n)?n:{}));return this},isBorderBox:function(){return Ext.isBorderBox||Ext.isForcedBorderBox||g[(this.dom.tagName||"").toLowerCase()]},remove:function(){var m=this,n=m.dom;if(n){delete m.dom;Ext.removeNode(n)}},hover:function(n,m,p,o){var q=this;q.on("mouseenter",n,p||q.dom,o);q.on("mouseleave",m,p||q.dom,o);return q},contains:function(m){return !m?false:Ext.lib.Dom.isAncestor(this.dom,m.dom?m.dom:m)},getAttributeNS:function(n,m){return this.getAttribute(m,n)},getAttribute:Ext.isIE?function(m,o){var p=this.dom,n=typeof p[o+":"+m];if(["undefined","unknown"].indexOf(n)==-1){return p[o+":"+m]}return p[m]}:function(m,n){var o=this.dom;return o.getAttributeNS(n,m)||o.getAttribute(n+":"+m)||o.getAttribute(m)||o[m]},update:function(m){if(this.dom){this.dom.innerHTML=m}return this}};var l=e.prototype;e.addMethods=function(m){Ext.apply(l,m)};l.on=l.addListener;l.un=l.removeListener;l.autoBoxAdjust=true;var i=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i,c;e.get=function(n){var m,q,p;if(!n){return null}if(typeof n=="string"){if(!(q=h.getElementById(n))){return null}if(a[n]&&a[n].el){m=a[n].el;m.dom=q}else{m=e.addToCache(new e(q))}return m}else{if(n.tagName){if(!(p=n.id)){p=Ext.id(n)}if(a[p]&&a[p].el){m=a[p].el;m.dom=n}else{m=e.addToCache(new e(n))}return m}else{if(n instanceof e){if(n!=c){if(Ext.isIE&&(n.id==undefined||n.id=="")){n.dom=n.dom}else{n.dom=h.getElementById(n.id)||n.dom}}return n}else{if(n.isComposite){return n}else{if(Ext.isArray(n)){return e.select(n)}else{if(n==h){if(!c){var o=function(){};o.prototype=e.prototype;c=new o();c.dom=h}return c}}}}}}return null};e.addToCache=function(m,n){n=n||m.id;a[n]={el:m,data:{},events:{}};return m};e.data=function(n,m,o){n=e.get(n);if(!n){return null}var p=a[n.id].data;if(arguments.length==2){return p[m]}else{return(p[m]=o)}};function k(){if(!Ext.enableGarbageCollector){clearInterval(e.collectorThreadId)}else{var m,p,r,q;for(m in a){q=a[m];if(q.skipGC){continue}p=q.el;r=p.dom;if(!r||!r.parentNode||(!r.offsetParent&&!h.getElementById(m))){if(Ext.enableListenerCollection){Ext.EventManager.removeAll(r)}delete a[m]}}if(Ext.isIE){var n={};for(m in a){n[m]=a[m]}a=Ext.elCache=n}}}e.collectorThreadId=setInterval(k,30000);var b=function(){};b.prototype=e.prototype;e.Flyweight=function(m){this.dom=m};e.Flyweight.prototype=new b();e.Flyweight.prototype.isFlyweight=true;e._flyweights={};e.fly=function(o,m){var n=null;m=m||"_global";if(o=Ext.getDom(o)){(e._flyweights[m]=e._flyweights[m]||new e.Flyweight()).dom=o;n=e._flyweights[m]}return n};Ext.get=e.get;Ext.fly=e.fly;var g=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko){g.button=1}})();Ext.Element.addMethods(function(){var d="parentNode",b="nextSibling",c="previousSibling",e=Ext.DomQuery,a=Ext.get;return{findParent:function(n,m,h){var k=this.dom,g=document.body,l=0,i;if(Ext.isGecko&&Object.prototype.toString.call(k)=="[object XULElement]"){return null}m=m||50;if(isNaN(m)){i=Ext.getDom(m);m=Number.MAX_VALUE}while(k&&k.nodeType==1&&l<m&&k!=g&&k!=i){if(e.is(k,n)){return h?a(k):k}l++;k=k.parentNode}return null},findParentNode:function(k,i,g){var h=Ext.fly(this.dom.parentNode,"_internal");return h?h.findParent(k,i,g):null},up:function(h,g){return this.findParentNode(h,g,true)},select:function(g){return Ext.Element.select(g,this.dom)},query:function(g){return e.select(g,this.dom)},child:function(g,h){var i=e.selectNode(g,this.dom);return h?i:a(i)},down:function(g,h){var i=e.selectNode(" > "+g,this.dom);return h?i:a(i)},parent:function(g,h){return this.matchNode(d,d,g,h)},next:function(g,h){return this.matchNode(b,b,g,h)},prev:function(g,h){return this.matchNode(c,c,g,h)},first:function(g,h){return this.matchNode(b,"firstChild",g,h)},last:function(g,h){return this.matchNode(c,"lastChild",g,h)},matchNode:function(h,l,g,i){var k=this.dom[l];while(k){if(k.nodeType==1&&(!g||e.is(k,g))){return !i?a(k):k}k=k[h]}return null}}}());Ext.Element.addMethods(function(){var c=Ext.getDom,a=Ext.get,b=Ext.DomHelper;return{appendChild:function(d){return a(d).appendTo(this)},appendTo:function(d){c(d).appendChild(this.dom);return this},insertBefore:function(d){(d=c(d)).parentNode.insertBefore(this.dom,d);return this},insertAfter:function(d){(d=c(d)).parentNode.insertBefore(this.dom,d.nextSibling);return this},insertFirst:function(e,d){e=e||{};if(e.nodeType||e.dom||typeof e=="string"){e=c(e);this.dom.insertBefore(e,this.dom.firstChild);return !d?a(e):e}else{return this.createChild(e,this.dom.firstChild,d)}},replace:function(d){d=a(d);this.insertBefore(d);d.remove();return this},replaceWith:function(d){var e=this;if(d.nodeType||d.dom||typeof d=="string"){d=c(d);e.dom.parentNode.insertBefore(d,e.dom)}else{d=b.insertBefore(e.dom,d)}delete Ext.elCache[e.id];Ext.removeNode(e.dom);e.id=Ext.id(e.dom=d);Ext.Element.addToCache(e.isFlyweight?new Ext.Element(e.dom):e);return e},createChild:function(e,d,g){e=e||{tag:"div"};return d?b.insertBefore(d,e,g!==true):b[!this.dom.firstChild?"overwrite":"append"](this.dom,e,g!==true)},wrap:function(d,e){var g=b.insertBefore(this.dom,d||{tag:"div"},!e);g.dom?g.dom.appendChild(this.dom):g.appendChild(this.dom);return g},insertHtml:function(e,g,d){var h=b.insertHtml(e,this.dom,g);return d?Ext.get(h):h}}}());Ext.Element.addMethods(function(){var B=Ext.supports,h={},y=/(-[a-z])/gi,t=document.defaultView,E=/alpha\(opacity=(.*)\)/i,m=/^\s+|\s+$/g,C=Ext.Element,v=/\s+/,b=/\w/g,d="padding",c="margin",z="border",u="-left",r="-right",x="-top",p="-bottom",k="-width",s=Math,A="hidden",e="isClipped",l="overflow",o="overflow-x",n="overflow-y",D="originalClip",i={l:z+u+k,r:z+r+k,t:z+x+k,b:z+p+k},g={l:d+u,r:d+r,t:d+x,b:d+p},a={l:c+u,r:c+r,t:c+x,b:c+p},F=Ext.Element.data;function q(G,H){return H.charAt(1).toUpperCase()}function w(G){return h[G]||(h[G]=G=="float"?(B.cssFloat?"cssFloat":"styleFloat"):G.replace(y,q))}return{adjustWidth:function(G){var H=this;var I=(typeof G=="number");if(I&&H.autoBoxAdjust&&!H.isBorderBox()){G-=(H.getBorderWidth("lr")+H.getPadding("lr"))}return(I&&G<0)?0:G},adjustHeight:function(G){var H=this;var I=(typeof G=="number");if(I&&H.autoBoxAdjust&&!H.isBorderBox()){G-=(H.getBorderWidth("tb")+H.getPadding("tb"))}return(I&&G<0)?0:G},addClass:function(K){var L=this,J,G,I,H=[];if(!Ext.isArray(K)){if(typeof K=="string"&&!this.hasClass(K)){L.dom.className+=" "+K}}else{for(J=0,G=K.length;J<G;J++){I=K[J];if(typeof I=="string"&&(" "+L.dom.className+" ").indexOf(" "+I+" ")==-1){H.push(I)}}if(H.length){L.dom.className+=" "+H.join(" ")}}return L},removeClass:function(L){var M=this,K,H,G,J,I;if(!Ext.isArray(L)){L=[L]}if(M.dom&&M.dom.className){I=M.dom.className.replace(m,"").split(v);for(K=0,G=L.length;K<G;K++){J=L[K];if(typeof J=="string"){J=J.replace(m,"");H=I.indexOf(J);if(H!=-1){I.splice(H,1)}}}M.dom.className=I.join(" ")}return M},radioClass:function(J){var K=this.dom.parentNode.childNodes,H,I,G;J=Ext.isArray(J)?J:[J];for(I=0,G=K.length;I<G;I++){H=K[I];if(H&&H.nodeType==1){Ext.fly(H,"_internal").removeClass(J)}}return this.addClass(J)},toggleClass:function(G){return this.hasClass(G)?this.removeClass(G):this.addClass(G)},hasClass:function(G){return G&&(" "+this.dom.className+" ").indexOf(" "+G+" ")!=-1},replaceClass:function(H,G){return this.removeClass(H).addClass(G)},isStyle:function(G,H){return this.getStyle(G)==H},getStyle:function(){return t&&t.getComputedStyle?function(L){var J=this.dom,G,I,H,K;if(J==document){return null}L=w(L);H=(G=J.style[L])?G:(I=t.getComputedStyle(J,""))?I[L]:null;if(L=="marginRight"&&H!="0px"&&!B.correctRightMargin){K=J.style.display;J.style.display="inline-block";H=t.getComputedStyle(J,"").marginRight;J.style.display=K}if(L=="backgroundColor"&&H=="rgba(0, 0, 0, 0)"&&!B.correctTransparentColor){H="transparent"}return H}:function(K){var I=this.dom,G,H;if(I==document){return null}if(K=="opacity"){if(I.style.filter.match){if(G=I.style.filter.match(E)){var J=parseFloat(G[1]);if(!isNaN(J)){return J?J/100:0}}}return 1}K=w(K);return I.style[K]||((H=I.currentStyle)?H[K]:null)}}(),getColor:function(G,H,L){var J=this.getStyle(G),I=(typeof L!="undefined")?L:"#",K;if(!J||(/transparent|inherit/.test(J))){return H}if(/^r/.test(J)){Ext.each(J.slice(4,J.length-1).split(","),function(M){K=parseInt(M,10);I+=(K<16?"0":"")+K.toString(16)})}else{J=J.replace("#","");I+=J.length==3?J.replace(/^(\w)(\w)(\w)$/,"$1$1$2$2$3$3"):J}return(I.length>5?I.toLowerCase():H)},setStyle:function(J,I){var G,H;if(typeof J!="object"){G={};G[J]=I;J=G}for(H in J){I=J[H];H=="opacity"?this.setOpacity(I):this.dom.style[w(H)]=I}return this},setOpacity:function(H,G){var K=this,I=K.dom.style;if(!G||!K.anim){if(Ext.isIE){var J=H<1?"alpha(opacity="+H*100+")":"",L=I.filter.replace(E,"").replace(m,"");I.zoom=1;I.filter=L+(L.length>0?" ":"")+J}else{I.opacity=H}}else{K.anim({opacity:{to:H}},K.preanim(arguments,1),null,0.35,"easeIn")}return K},clearOpacity:function(){var G=this.dom.style;if(Ext.isIE){if(!Ext.isEmpty(G.filter)){G.filter=G.filter.replace(E,"").replace(m,"")}}else{G.opacity=G["-moz-opacity"]=G["-khtml-opacity"]=""}return this},getHeight:function(I){var H=this,K=H.dom,J=Ext.isIE&&H.isStyle("display","none"),G=s.max(K.offsetHeight,J?0:K.clientHeight)||0;G=!I?G:G-H.getBorderWidth("tb")-H.getPadding("tb");return G<0?0:G},getWidth:function(H){var I=this,K=I.dom,J=Ext.isIE&&I.isStyle("display","none"),G=s.max(K.offsetWidth,J?0:K.clientWidth)||0;G=!H?G:G-I.getBorderWidth("lr")-I.getPadding("lr");return G<0?0:G},setWidth:function(H,G){var I=this;H=I.adjustWidth(H);!G||!I.anim?I.dom.style.width=I.addUnits(H):I.anim({width:{to:H}},I.preanim(arguments,1));return I},setHeight:function(G,H){var I=this;G=I.adjustHeight(G);!H||!I.anim?I.dom.style.height=I.addUnits(G):I.anim({height:{to:G}},I.preanim(arguments,1));return I},getBorderWidth:function(G){return this.addStyles(G,i)},getPadding:function(G){return this.addStyles(G,g)},clip:function(){var G=this,H=G.dom;if(!F(H,e)){F(H,e,true);F(H,D,{o:G.getStyle(l),x:G.getStyle(o),y:G.getStyle(n)});G.setStyle(l,A);G.setStyle(o,A);G.setStyle(n,A)}return G},unclip:function(){var G=this,I=G.dom;if(F(I,e)){F(I,e,false);var H=F(I,D);if(H.o){G.setStyle(l,H.o)}if(H.x){G.setStyle(o,H.x)}if(H.y){G.setStyle(n,H.y)}}return G},addStyles:function(N,M){var K=0,L=N.match(b),J,I,H,G=L.length;for(H=0;H<G;H++){J=L[H];I=J&&parseInt(this.getStyle(M[J]),10);if(I){K+=s.abs(I)}}return K},margins:a}}());(function(){var a=Ext.lib.Dom,b="left",g="right",d="top",i="bottom",h="position",c="static",e="relative",k="auto",l="z-index";Ext.Element.addMethods({getX:function(){return a.getX(this.dom)},getY:function(){return a.getY(this.dom)},getXY:function(){return a.getXY(this.dom)},getOffsetsTo:function(m){var p=this.getXY(),n=Ext.fly(m,"_internal").getXY();return[p[0]-n[0],p[1]-n[1]]},setX:function(m,n){return this.setXY([m,this.getY()],this.animTest(arguments,n,1))},setY:function(n,m){return this.setXY([this.getX(),n],this.animTest(arguments,m,1))},setLeft:function(m){this.setStyle(b,this.addUnits(m));return this},setTop:function(m){this.setStyle(d,this.addUnits(m));return this},setRight:function(m){this.setStyle(g,this.addUnits(m));return this},setBottom:function(m){this.setStyle(i,this.addUnits(m));return this},setXY:function(o,m){var n=this;if(!m||!n.anim){a.setXY(n.dom,o)}else{n.anim({points:{to:o}},n.preanim(arguments,1),"motion")}return n},setLocation:function(m,o,n){return this.setXY([m,o],this.animTest(arguments,n,2))},moveTo:function(m,o,n){return this.setXY([m,o],this.animTest(arguments,n,2))},getLeft:function(m){return !m?this.getX():parseInt(this.getStyle(b),10)||0},getRight:function(m){var n=this;return !m?n.getX()+n.getWidth():(n.getLeft(true)+n.getWidth())||0},getTop:function(m){return !m?this.getY():parseInt(this.getStyle(d),10)||0},getBottom:function(m){var n=this;return !m?n.getY()+n.getHeight():(n.getTop(true)+n.getHeight())||0},position:function(q,p,m,o){var n=this;if(!q&&n.isStyle(h,c)){n.setStyle(h,e)}else{if(q){n.setStyle(h,q)}}if(p){n.setStyle(l,p)}if(m||o){n.setXY([m||false,o||false])}},clearPositioning:function(m){m=m||"";this.setStyle({left:m,right:m,top:m,bottom:m,"z-index":"",position:c});return this},getPositioning:function(){var m=this.getStyle(b);var n=this.getStyle(d);return{position:this.getStyle(h),left:m,right:m?"":this.getStyle(g),top:n,bottom:n?"":this.getStyle(i),"z-index":this.getStyle(l)}},setPositioning:function(m){var o=this,n=o.dom.style;o.setStyle(m);if(m.right==k){n.right=""}if(m.bottom==k){n.bottom=""}return o},translatePoints:function(m,u){u=isNaN(m[1])?u:m[1];m=isNaN(m[0])?m:m[0];var q=this,r=q.isStyle(h,e),s=q.getXY(),n=parseInt(q.getStyle(b),10),p=parseInt(q.getStyle(d),10);n=!isNaN(n)?n:(r?0:q.dom.offsetLeft);p=!isNaN(p)?p:(r?0:q.dom.offsetTop);return{left:(m-s[0]+n),top:(u-s[1]+p)}},animTest:function(n,m,o){return !!m&&this.preanim?this.preanim(n,o):false}})})();Ext.Element.addMethods({isScrollable:function(){var a=this.dom;return a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth},scrollTo:function(a,b){this.dom["scroll"+(/top/i.test(a)?"Top":"Left")]=b;return this},getScroll:function(){var i=this.dom,h=document,a=h.body,c=h.documentElement,b,g,e;if(i==h||i==a){if(Ext.isIE&&Ext.isStrict){b=c.scrollLeft;g=c.scrollTop}else{b=window.pageXOffset;g=window.pageYOffset}e={left:b||(a?a.scrollLeft:0),top:g||(a?a.scrollTop:0)}}else{e={left:i.scrollLeft,top:i.scrollTop}}return e}});Ext.Element.VISIBILITY=1;Ext.Element.DISPLAY=2;Ext.Element.OFFSETS=3;Ext.Element.ASCLASS=4;Ext.Element.visibilityCls="x-hide-nosize";Ext.Element.addMethods(function(){var e=Ext.Element,q="opacity",k="visibility",g="display",d="hidden",o="offsets",l="asclass",n="none",a="nosize",b="originalDisplay",c="visibilityMode",h="isVisible",i=e.data,m=function(s){var r=i(s,b);if(r===undefined){i(s,b,r="")}return r},p=function(s){var r=i(s,c);if(r===undefined){i(s,c,r=1)}return r};return{originalDisplay:"",visibilityMode:1,setVisibilityMode:function(r){i(this.dom,c,r);return this},animate:function(s,u,t,v,r){this.anim(s,{duration:u,callback:t,easing:v},r);return this},anim:function(u,v,s,x,t,r){s=s||"run";v=v||{};var w=this,y=Ext.lib.Anim[s](w.dom,u,(v.duration||x)||0.35,(v.easing||t)||"easeOut",function(){if(r){r.call(w)}if(v.callback){v.callback.call(v.scope||w,w,v)}},w);v.anim=y;return y},preanim:function(r,s){return !r[s]?false:(typeof r[s]=="object"?r[s]:{duration:r[s+1],callback:r[s+2],easing:r[s+3]})},isVisible:function(){var r=this,t=r.dom,s=i(t,h);if(typeof s=="boolean"){return s}s=!r.isStyle(k,d)&&!r.isStyle(g,n)&&!((p(t)==e.ASCLASS)&&r.hasClass(r.visibilityCls||e.visibilityCls));i(t,h,s);return s},setVisible:function(u,r){var x=this,s,z,y,w,v=x.dom,t=p(v);if(typeof r=="string"){switch(r){case g:t=e.DISPLAY;break;case k:t=e.VISIBILITY;break;case o:t=e.OFFSETS;break;case a:case l:t=e.ASCLASS;break}x.setVisibilityMode(t);r=false}if(!r||!x.anim){if(t==e.ASCLASS){x[u?"removeClass":"addClass"](x.visibilityCls||e.visibilityCls)}else{if(t==e.DISPLAY){return x.setDisplayed(u)}else{if(t==e.OFFSETS){if(!u){x.hideModeStyles={position:x.getStyle("position"),top:x.getStyle("top"),left:x.getStyle("left")};x.applyStyles({position:"absolute",top:"-10000px",left:"-10000px"})}else{x.applyStyles(x.hideModeStyles||{position:"",top:"",left:""});delete x.hideModeStyles}}else{x.fixDisplay();v.style.visibility=u?"visible":d}}}}else{if(u){x.setOpacity(0.01);x.setVisible(true)}x.anim({opacity:{to:(u?1:0)}},x.preanim(arguments,1),null,0.35,"easeIn",function(){u||x.setVisible(false).setOpacity(1)})}i(v,h,u);return x},hasMetrics:function(){var r=this.dom;return this.isVisible()||(p(r)==e.VISIBILITY)},toggle:function(r){var s=this;s.setVisible(!s.isVisible(),s.preanim(arguments,0));return s},setDisplayed:function(r){if(typeof r=="boolean"){r=r?m(this.dom):n}this.setStyle(g,r);return this},fixDisplay:function(){var r=this;if(r.isStyle(g,n)){r.setStyle(k,d);r.setStyle(g,m(this.dom));if(r.isStyle(g,n)){r.setStyle(g,"block")}}},hide:function(r){if(typeof r=="string"){this.setVisible(false,r);return this}this.setVisible(false,this.preanim(arguments,0));return this},show:function(r){if(typeof r=="string"){this.setVisible(true,r);return this}this.setVisible(true,this.preanim(arguments,0));return this}}}());(function(){var z=null,B=undefined,l=true,u=false,k="setX",h="setY",a="setXY",o="left",m="bottom",t="top",n="right",r="height",g="width",i="points",x="hidden",A="absolute",v="visible",e="motion",p="position",s="easeOut",d=new Ext.Element.Flyweight(),w={},y=function(C){return C||{}},q=function(C){d.dom=C;d.id=Ext.id(C);return d},c=function(C){if(!w[C]){w[C]=[]}return w[C]},b=function(D,C){w[D]=C};Ext.enableFx=l;Ext.Fx={switchStatements:function(D,E,C){return E.apply(this,C[D])},slideIn:function(I,F){F=y(F);var K=this,H=K.dom,N=H.style,P,C,M,E,D,N,J,O,L,G;I=I||"t";K.queueFx(F,function(){P=q(H).getXY();q(H).fixDisplay();C=q(H).getFxRestore();M={x:P[0],y:P[1],0:P[0],1:P[1],width:H.offsetWidth,height:H.offsetHeight};M.right=M.x+M.width;M.bottom=M.y+M.height;q(H).setWidth(M.width).setHeight(M.height);E=q(H).fxWrap(C.pos,F,x);N.visibility=v;N.position=A;function Q(){q(H).fxUnwrap(E,C.pos,F);N.width=C.width;N.height=C.height;q(H).afterFx(F)}O={to:[M.x,M.y]};L={to:M.width};G={to:M.height};function R(V,S,W,T,Y,aa,ad,ac,ab,X,U){var Z={};q(V).setWidth(W).setHeight(T);if(q(V)[Y]){q(V)[Y](aa)}S[ad]=S[ac]="0";if(ab){Z.width=ab}if(X){Z.height=X}if(U){Z.points=U}return Z}J=q(H).switchStatements(I.toLowerCase(),R,{t:[E,N,M.width,0,z,z,o,m,z,G,z],l:[E,N,0,M.height,z,z,n,t,L,z,z],r:[E,N,M.width,M.height,k,M.right,o,t,z,z,O],b:[E,N,M.width,M.height,h,M.bottom,o,t,z,G,O],tl:[E,N,0,0,z,z,n,m,L,G,O],bl:[E,N,0,0,h,M.y+M.height,n,t,L,G,O],br:[E,N,0,0,a,[M.right,M.bottom],o,t,L,G,O],tr:[E,N,0,0,k,M.x+M.width,o,m,L,G,O]});N.visibility=v;q(E).show();arguments.callee.anim=q(E).fxanim(J,F,e,0.5,s,Q)});return K},slideOut:function(G,E){E=y(E);var I=this,F=I.dom,L=F.style,M=I.getXY(),D,C,J,K,H={to:0};G=G||"t";I.queueFx(E,function(){C=q(F).getFxRestore();J={x:M[0],y:M[1],0:M[0],1:M[1],width:F.offsetWidth,height:F.offsetHeight};J.right=J.x+J.width;J.bottom=J.y+J.height;q(F).setWidth(J.width).setHeight(J.height);D=q(F).fxWrap(C.pos,E,v);L.visibility=v;L.position=A;q(D).setWidth(J.width).setHeight(J.height);function N(){E.useDisplay?q(F).setDisplayed(u):q(F).hide();q(F).fxUnwrap(D,C.pos,E);L.width=C.width;L.height=C.height;q(F).afterFx(E)}function O(P,X,V,Y,T,W,S,U,R){var Q={};P[X]=P[V]="0";Q[Y]=T;if(W){Q[W]=S}if(U){Q[U]=R}return Q}K=q(F).switchStatements(G.toLowerCase(),O,{t:[L,o,m,r,H],l:[L,n,t,g,H],r:[L,o,t,g,H,i,{to:[J.right,J.y]}],b:[L,o,t,r,H,i,{to:[J.x,J.bottom]}],tl:[L,n,m,g,H,r,H],bl:[L,n,t,g,H,r,H,i,{to:[J.x,J.bottom]}],br:[L,o,t,g,H,r,H,i,{to:[J.x+J.width,J.bottom]}],tr:[L,o,m,g,H,r,H,i,{to:[J.right,J.y]}]});arguments.callee.anim=q(D).fxanim(K,E,e,0.5,s,N)});return I},puff:function(I){I=y(I);var G=this,H=G.dom,D=H.style,E,C,F;G.queueFx(I,function(){E=q(H).getWidth();C=q(H).getHeight();q(H).clearOpacity();q(H).show();F=q(H).getFxRestore();function J(){I.useDisplay?q(H).setDisplayed(u):q(H).hide();q(H).clearOpacity();q(H).setPositioning(F.pos);D.width=F.width;D.height=F.height;D.fontSize="";q(H).afterFx(I)}arguments.callee.anim=q(H).fxanim({width:{to:q(H).adjustWidth(E*2)},height:{to:q(H).adjustHeight(C*2)},points:{by:[-E*0.5,-C*0.5]},opacity:{to:0},fontSize:{to:200,unit:"%"}},I,e,0.5,s,J)});return G},switchOff:function(G){G=y(G);var E=this,F=E.dom,C=F.style,D;E.queueFx(G,function(){q(F).clearOpacity();q(F).clip();D=q(F).getFxRestore();function H(){G.useDisplay?q(F).setDisplayed(u):q(F).hide();q(F).clearOpacity();q(F).setPositioning(D.pos);C.width=D.width;C.height=D.height;q(F).afterFx(G)}q(F).fxanim({opacity:{to:0.3}},z,z,0.1,z,function(){q(F).clearOpacity();(function(){q(F).fxanim({height:{to:1},points:{by:[0,q(F).getHeight()*0.5]}},G,e,0.3,"easeIn",H)}).defer(100)})});return E},highlight:function(E,I){I=y(I);var G=this,H=G.dom,C=I.attr||"backgroundColor",D={},F;G.queueFx(I,function(){q(H).clearOpacity();q(H).show();function J(){H.style[C]=F;q(H).afterFx(I)}F=H.style[C];D[C]={from:E||"ffff9c",to:I.endColor||q(H).getColor(C)||"ffffff"};arguments.callee.anim=q(H).fxanim(D,I,"color",1,"easeIn",J)});return G},frame:function(C,F,I){I=y(I);var E=this,H=E.dom,D,G;E.queueFx(I,function(){C=C||"#C3DAF9";if(C.length==6){C="#"+C}F=F||1;q(H).show();var M=q(H).getXY(),K={x:M[0],y:M[1],0:M[0],1:M[1],width:H.offsetWidth,height:H.offsetHeight},J=function(){D=q(document.body||document.documentElement).createChild({style:{position:A,"z-index":35000,border:"0px solid "+C}});return D.queueFx({},L)};arguments.callee.anim={isAnimated:true,stop:function(){F=0;D.stopFx()}};function L(){var N=Ext.isBorderBox?2:1;G=D.anim({top:{from:K.y,to:K.y-20},left:{from:K.x,to:K.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:K.height,to:K.height+20*N},width:{from:K.width,to:K.width+20*N}},{duration:I.duration||1,callback:function(){D.remove();--F>0?J():q(H).afterFx(I)}});arguments.callee.anim={isAnimated:true,stop:function(){G.stop()}}}J()});return E},pause:function(E){var D=this.dom,C;this.queueFx({},function(){C=setTimeout(function(){q(D).afterFx({})},E*1000);arguments.callee.anim={isAnimated:true,stop:function(){clearTimeout(C);q(D).afterFx({})}}});return this},fadeIn:function(E){E=y(E);var C=this,D=C.dom,F=E.endOpacity||1;C.queueFx(E,function(){q(D).setOpacity(0);q(D).fixDisplay();D.style.visibility=v;arguments.callee.anim=q(D).fxanim({opacity:{to:F}},E,z,0.5,s,function(){if(F==1){q(D).clearOpacity()}q(D).afterFx(E)})});return C},fadeOut:function(F){F=y(F);var D=this,E=D.dom,C=E.style,G=F.endOpacity||0;D.queueFx(F,function(){arguments.callee.anim=q(E).fxanim({opacity:{to:G}},F,z,0.5,s,function(){if(G==0){Ext.Element.data(E,"visibilityMode")==Ext.Element.DISPLAY||F.useDisplay?C.display="none":C.visibility=x;q(E).clearOpacity()}q(E).afterFx(F)})});return D},scale:function(C,D,E){this.shift(Ext.apply({},E,{width:C,height:D}));return this},shift:function(E){E=y(E);var D=this.dom,C={};this.queueFx(E,function(){for(var F in E){if(E[F]!=B){C[F]={to:E[F]}}}C.width?C.width.to=q(D).adjustWidth(E.width):C;C.height?C.height.to=q(D).adjustWidth(E.height):C;if(C.x||C.y||C.xy){C.points=C.xy||{to:[C.x?C.x.to:q(D).getX(),C.y?C.y.to:q(D).getY()]}}arguments.callee.anim=q(D).fxanim(C,E,e,0.35,s,function(){q(D).afterFx(E)})});return this},ghost:function(F,D){D=y(D);var H=this,E=H.dom,K=E.style,I={opacity:{to:0},points:{}},L=I.points,C,J,G;F=F||"b";H.queueFx(D,function(){C=q(E).getFxRestore();J=q(E).getWidth();G=q(E).getHeight();function M(){D.useDisplay?q(E).setDisplayed(u):q(E).hide();q(E).clearOpacity();q(E).setPositioning(C.pos);K.width=C.width;K.height=C.height;q(E).afterFx(D)}L.by=q(E).switchStatements(F.toLowerCase(),function(O,N){return[O,N]},{t:[0,-G],l:[-J,0],r:[J,0],b:[0,G],tl:[-J,-G],bl:[-J,G],br:[J,G],tr:[J,-G]});arguments.callee.anim=q(E).fxanim(I,D,e,0.5,s,M)});return H},syncFx:function(){var C=this;C.fxDefaults=Ext.apply(C.fxDefaults||{},{block:u,concurrent:l,stopFx:u});return C},sequenceFx:function(){var C=this;C.fxDefaults=Ext.apply(C.fxDefaults||{},{block:u,concurrent:u,stopFx:u});return C},nextFx:function(){var C=c(this.dom.id)[0];if(C){C.call(this)}},hasActiveFx:function(){return c(this.dom.id)[0]},stopFx:function(C){var D=this,F=D.dom.id;if(D.hasActiveFx()){var E=c(F)[0];if(E&&E.anim){if(E.anim.isAnimated){b(F,[E]);E.anim.stop(C!==undefined?C:l)}else{b(F,[])}}}return D},beforeFx:function(C){if(this.hasActiveFx()&&!C.concurrent){if(C.stopFx){this.stopFx();return l}return u}return l},hasFxBlock:function(){var C=c(this.dom.id);return C&&C[0]&&C[0].block},queueFx:function(F,C){var D=q(this.dom);if(!D.hasFxBlock()){Ext.applyIf(F,D.fxDefaults);if(!F.concurrent){var E=D.beforeFx(F);C.block=F.block;c(D.dom.id).push(C);if(E){D.nextFx()}}else{C.call(D)}}return D},fxWrap:function(I,G,E){var F=this.dom,D,C;if(!G.wrap||!(D=Ext.getDom(G.wrap))){if(G.fixPosition){C=q(F).getXY()}var H=document.createElement("div");H.style.visibility=E;D=F.parentNode.insertBefore(H,F);q(D).setPositioning(I);if(q(D).isStyle(p,"static")){q(D).position("relative")}q(F).clearPositioning("auto");q(D).clip();D.appendChild(F);if(C){q(D).setXY(C)}}return D},fxUnwrap:function(D,G,F){var E=this.dom;q(E).clearPositioning();q(E).setPositioning(G);if(!F.wrap){var C=q(D).dom.parentNode;C.insertBefore(E,D);q(D).remove()}},getFxRestore:function(){var C=this.dom.style;return{pos:this.getPositioning(),width:C.width,height:C.height}},afterFx:function(D){var C=this.dom,E=C.id;if(D.afterStyle){q(C).setStyle(D.afterStyle)}if(D.afterCls){q(C).addClass(D.afterCls)}if(D.remove==l){q(C).remove()}if(D.callback){D.callback.call(D.scope,q(C))}if(!D.concurrent){c(E).shift();q(C).nextFx()}},fxanim:function(F,G,D,H,E,C){D=D||"run";G=G||{};var I=Ext.lib.Anim[D](this.dom,F,(G.duration||H)||0.35,(G.easing||E)||s,C,this);G.anim=I;return I}};Ext.Fx.resize=Ext.Fx.scale;Ext.Element.addMethods(Ext.Fx)})();Ext.CompositeElementLite=function(b,a){this.elements=[];this.add(b,a);this.el=new Ext.Element.Flyweight()};Ext.CompositeElementLite.prototype={isComposite:true,getElement:function(a){var b=this.el;b.dom=a;b.id=a.id;return b},transformElement:function(a){return Ext.getDom(a)},getCount:function(){return this.elements.length},add:function(d,b){var e=this,g=e.elements;if(!d){return this}if(typeof d=="string"){d=Ext.Element.selectorFunction(d,b)}else{if(d.isComposite){d=d.elements}else{if(!Ext.isIterable(d)){d=[d]}}}for(var c=0,a=d.length;c<a;++c){g.push(e.transformElement(d[c]))}return e},invoke:function(g,b){var h=this,d=h.elements,a=d.length,k,c;for(c=0;c<a;c++){k=d[c];if(k){Ext.Element.prototype[g].apply(h.getElement(k),b)}}return h},item:function(b){var d=this,c=d.elements[b],a=null;if(c){a=d.getElement(c)}return a},addListener:function(b,k,h,g){var d=this.elements,a=d.length,c,l;for(c=0;c<a;c++){l=d[c];if(l){Ext.EventManager.on(l,b,k,h||l,g)}}return this},each:function(g,d){var h=this,c=h.elements,a=c.length,b,k;for(b=0;b<a;b++){k=c[b];if(k){k=this.getElement(k);if(g.call(d||k,k,h,b)===false){break}}}return h},fill:function(a){var b=this;b.elements=[];b.add(a);return b},filter:function(a){var b=[],d=this,c=Ext.isFunction(a)?a:function(e){return e.is(a)};d.each(function(h,e,g){if(c(h,g)!==false){b[b.length]=d.transformElement(h)}});d.elements=b;return d},indexOf:function(a){return this.elements.indexOf(this.transformElement(a))},replaceElement:function(e,c,a){var b=!isNaN(e)?e:this.indexOf(e),g;if(b>-1){c=Ext.getDom(c);if(a){g=this.elements[b];g.parentNode.insertBefore(c,g);Ext.removeNode(g)}this.elements.splice(b,1,c)}return this},clear:function(){this.elements=[]}};Ext.CompositeElementLite.prototype.on=Ext.CompositeElementLite.prototype.addListener;Ext.CompositeElementLite.importElementMethods=function(){var c,b=Ext.Element.prototype,a=Ext.CompositeElementLite.prototype;for(c in b){if(typeof b[c]=="function"){(function(d){a[d]=a[d]||function(){return this.invoke(d,arguments)}}).call(a,c)}}};Ext.CompositeElementLite.importElementMethods();if(Ext.DomQuery){Ext.Element.selectorFunction=Ext.DomQuery.select}Ext.Element.select=function(a,b){var c;if(typeof a=="string"){c=Ext.Element.selectorFunction(a,b)}else{if(a.length!==undefined){c=a}else{throw"Invalid selector"}}return new Ext.CompositeElementLite(c)};Ext.select=Ext.Element.select;(function(){var b="beforerequest",e="requestcomplete",d="requestexception",h=undefined,c="load",i="POST",a="GET",g=window;Ext.data.Connection=function(k){Ext.apply(this,k);this.addEvents(b,e,d);Ext.data.Connection.superclass.constructor.call(this)};Ext.extend(Ext.data.Connection,Ext.util.Observable,{timeout:30000,autoAbort:false,disableCaching:true,disableCachingParam:"_dc",request:function(q){var t=this;if(t.fireEvent(b,t,q)){if(q.el){if(!Ext.isEmpty(q.indicatorText)){t.indicatorText='<div class="loading-indicator">'+q.indicatorText+"</div>"}if(t.indicatorText){Ext.getDom(q.el).innerHTML=t.indicatorText}q.success=(Ext.isFunction(q.success)?q.success:function(){}).createInterceptor(function(o){Ext.getDom(q.el).innerHTML=o.responseText})}var m=q.params,l=q.url||t.url,k,r={success:t.handleResponse,failure:t.handleFailure,scope:t,argument:{options:q},timeout:Ext.num(q.timeout,t.timeout)},n,u;if(Ext.isFunction(m)){m=m.call(q.scope||g,q)}m=Ext.urlEncode(t.extraParams,Ext.isObject(m)?Ext.urlEncode(m):m);if(Ext.isFunction(l)){l=l.call(q.scope||g,q)}if((n=Ext.getDom(q.form))){l=l||n.action;if(q.isUpload||(/multipart\/form-data/i.test(n.getAttribute("enctype")))){return t.doFormUpload.call(t,q,m,l)}u=Ext.lib.Ajax.serializeForm(n);m=m?(m+"&"+u):u}k=q.method||t.method||((m||q.xmlData||q.jsonData)?i:a);if(k===a&&(t.disableCaching&&q.disableCaching!==false)||q.disableCaching===true){var s=q.disableCachingParam||t.disableCachingParam;l=Ext.urlAppend(l,s+"="+(new Date().getTime()))}q.headers=Ext.apply(q.headers||{},t.defaultHeaders||{});if(q.autoAbort===true||t.autoAbort){t.abort()}if((k==a||q.xmlData||q.jsonData)&&m){l=Ext.urlAppend(l,m);m=""}return(t.transId=Ext.lib.Ajax.request(k,l,r,m,q))}else{return q.callback?q.callback.apply(q.scope,[q,h,h]):null}},isLoading:function(k){return k?Ext.lib.Ajax.isCallInProgress(k):!!this.transId},abort:function(k){if(k||this.isLoading()){Ext.lib.Ajax.abort(k||this.transId)}},handleResponse:function(k){this.transId=false;var l=k.argument.options;k.argument=l?l.argument:null;this.fireEvent(e,this,k,l);if(l.success){l.success.call(l.scope,k,l)}if(l.callback){l.callback.call(l.scope,l,true,k)}},handleFailure:function(k,m){this.transId=false;var l=k.argument.options;k.argument=l?l.argument:null;this.fireEvent(d,this,k,l,m);if(l.failure){l.failure.call(l.scope,k,l)}if(l.callback){l.callback.call(l.scope,l,false,k)}},doFormUpload:function(r,k,l){var m=Ext.id(),w=document,s=w.createElement("iframe"),n=Ext.getDom(r.form),v=[],u,q="multipart/form-data",p={target:n.target,method:n.method,encoding:n.encoding,enctype:n.enctype,action:n.action};Ext.fly(s).set({id:m,name:m,cls:"x-hidden",src:Ext.SSL_SECURE_URL});w.body.appendChild(s);if(Ext.isIE){document.frames[m].name=m}Ext.fly(n).set({target:m,method:i,enctype:q,encoding:q,action:l||p.action});Ext.iterate(Ext.urlDecode(k,false),function(x,o){u=w.createElement("input");Ext.fly(u).set({type:"hidden",value:o,name:x});n.appendChild(u);v.push(u)});function t(){var y=this,x={responseText:"",responseXML:null,argument:r.argument},B,A;try{B=s.contentWindow.document||s.contentDocument||g.frames[m].document;if(B){if(B.body){if(/textarea/i.test((A=B.body.firstChild||{}).tagName)){x.responseText=A.value}else{x.responseText=B.body.innerHTML}}x.responseXML=B.XMLDocument||B}}catch(z){}Ext.EventManager.removeListener(s,c,t,y);y.fireEvent(e,y,x,r);function o(E,D,C){if(Ext.isFunction(E)){E.apply(D,C)}}o(r.success,r.scope,[x,r]);o(r.callback,r.scope,[r,true,x]);if(!y.debugUploads){setTimeout(function(){Ext.removeNode(s)},100)}}Ext.EventManager.on(s,c,t,this);n.submit();Ext.fly(n).set(p);Ext.each(v,function(o){Ext.removeNode(o)})}})})();Ext.Ajax=new Ext.data.Connection({autoAbort:false,serializeForm:function(a){return Ext.lib.Ajax.serializeForm(a)}});Ext.util.JSON=new (function(){var useHasOwn=!!{}.hasOwnProperty,isNative=function(){var useNative=null;return function(){if(useNative===null){useNative=Ext.USE_NATIVE_JSON&&window.JSON&&JSON.toString()=="[object JSON]"}return useNative}}(),pad=function(n){return n<10?"0"+n:n},doDecode=function(json){return eval("("+json+")")},doEncode=function(o){if(!Ext.isDefined(o)||o===null){return"null"}else{if(Ext.isArray(o)){return encodeArray(o)}else{if(Ext.isDate(o)){return Ext.util.JSON.encodeDate(o)}else{if(Ext.isString(o)){return encodeString(o)}else{if(typeof o=="number"){return isFinite(o)?String(o):"null"}else{if(Ext.isBoolean(o)){return String(o)}else{var a=["{"],b,i,v;for(i in o){if(!o.getElementsByTagName){if(!useHasOwn||o.hasOwnProperty(i)){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(doEncode(i),":",v===null?"null":doEncode(v));b=true}}}}a.push("}");return a.join("")}}}}}}},m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},encodeString=function(s){if(/["\\\x00-\x1f]/.test(s)){return'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+s+'"'},encodeArray=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i<l;i+=1){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(v===null?"null":Ext.util.JSON.encode(v));b=true}}a.push("]");return a.join("")};this.encodeDate=function(o){return'"'+o.getFullYear()+"-"+pad(o.getMonth()+1)+"-"+pad(o.getDate())+"T"+pad(o.getHours())+":"+pad(o.getMinutes())+":"+pad(o.getSeconds())+'"'};this.encode=function(){var ec;return function(o){if(!ec){ec=isNative()?JSON.stringify:doEncode}return ec(o)}}();this.decode=function(){var dc;return function(json){if(!dc){dc=isNative()?JSON.parse:doDecode}return dc(json)}}()})();Ext.encode=Ext.util.JSON.encode;Ext.decode=Ext.util.JSON.decode;Ext.EventManager=function(){var A,q,k=false,m=Ext.isGecko||Ext.isWebKit||Ext.isSafari,p=Ext.lib.Event,r=Ext.lib.Dom,c=document,B=window,s="DOMContentLoaded",u="complete",g=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,v=[];function o(F){var I=false,E=0,D=v.length,G=false,H;if(F){if(F.getElementById||F.navigator){for(;E<D;++E){H=v[E];if(H.el===F){I=H.id;break}}if(!I){I=Ext.id(F);v.push({id:I,el:F});G=true}}else{I=Ext.id(F)}if(!Ext.elCache[I]){Ext.Element.addToCache(new Ext.Element(F),I);if(G){Ext.elCache[I].skipGC=true}}}return I}function n(F,H,K,G,E,M){F=Ext.getDom(F);var D=o(F),L=Ext.elCache[D].events,I;I=p.on(F,H,E);L[H]=L[H]||[];L[H].push([K,E,M,I,G]);if(F.addEventListener&&H=="mousewheel"){var J=["DOMMouseScroll",E,false];F.addEventListener.apply(F,J);Ext.EventManager.addListener(B,"unload",function(){F.removeEventListener.apply(F,J)})}if(F==c&&H=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.addListener(E)}}function d(){if(window!=top){return false}try{c.documentElement.doScroll("left")}catch(D){return false}b();return true}function C(D){if(Ext.isIE&&d()){return true}if(c.readyState==u){b();return true}k||(q=setTimeout(arguments.callee,2));return false}var l;function i(D){l||(l=Ext.query("style, link[rel=stylesheet]"));if(l.length==c.styleSheets.length){b();return true}k||(q=setTimeout(arguments.callee,2));return false}function z(D){c.removeEventListener(s,arguments.callee,false);i()}function b(D){if(!k){k=true;if(q){clearTimeout(q)}if(m){c.removeEventListener(s,b,false)}if(Ext.isIE&&C.bindIE){c.detachEvent("onreadystatechange",C)}p.un(B,"load",arguments.callee)}if(A&&!Ext.isReady){Ext.isReady=true;A.fire();A.listeners=[]}}function a(){A||(A=new Ext.util.Event());if(m){c.addEventListener(s,b,false)}if(Ext.isIE){if(!C()){C.bindIE=true;c.attachEvent("onreadystatechange",C)}}else{if(Ext.isOpera){(c.readyState==u&&i())||c.addEventListener(s,z,false)}else{if(Ext.isWebKit){C()}}}p.on(B,"load",b)}function y(D,E){return function(){var F=Ext.toArray(arguments);if(E.target==Ext.EventObject.setEvent(F[0]).target){D.apply(this,F)}}}function x(E,F,D){return function(G){D.delay(F.buffer,E,null,[new Ext.EventObjectImpl(G)])}}function t(H,G,D,F,E){return function(I){Ext.EventManager.removeListener(G,D,F,E);H(I)}}function e(E,F,D){return function(H){var G=new Ext.util.DelayedTask(E);if(!D.tasks){D.tasks=[]}D.tasks.push(G);G.delay(F.delay||10,E,null,[new Ext.EventObjectImpl(H)])}}function h(I,H,D,K,L){var E=(!D||typeof D=="boolean")?{}:D,F=Ext.getDom(I),G;K=K||E.fn;L=L||E.scope;if(!F){throw'Error listening for "'+H+'". Element "'+I+"\" doesn't exist."}function J(N){if(!Ext){return}N=Ext.EventObject.setEvent(N);var M;if(E.delegate){if(!(M=N.getTarget(E.delegate,F))){return}}else{M=N.target}if(E.stopEvent){N.stopEvent()}if(E.preventDefault){N.preventDefault()}if(E.stopPropagation){N.stopPropagation()}if(E.normalized===false){N=N.browserEvent}K.call(L||F,N,M,E)}if(E.target){J=y(J,E)}if(E.delay){J=e(J,E,K)}if(E.single){J=t(J,F,H,K,L)}if(E.buffer){G=new Ext.util.DelayedTask(J);J=x(J,E,G)}n(F,H,K,G,J,L);return J}var w={addListener:function(F,D,H,G,E){if(typeof D=="object"){var K=D,I,J;for(I in K){J=K[I];if(!g.test(I)){if(Ext.isFunction(J)){h(F,I,K,J,K.scope)}else{h(F,I,J)}}}}else{h(F,D,E,H,G)}},removeListener:function(F,J,N,O){F=Ext.getDom(F);var D=o(F),L=F&&(Ext.elCache[D].events)[J]||[],E,I,G,H,K,M;for(I=0,K=L.length;I<K;I++){if(Ext.isArray(M=L[I])&&M[0]==N&&(!O||M[2]==O)){if(M[4]){M[4].cancel()}H=N.tasks&&N.tasks.length;if(H){while(H--){N.tasks[H].cancel()}delete N.tasks}E=M[1];p.un(F,J,p.extAdapter?M[3]:E);if(E&&F.addEventListener&&J=="mousewheel"){F.removeEventListener("DOMMouseScroll",E,false)}if(E&&F==c&&J=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.removeListener(E)}L.splice(I,1);if(L.length===0){delete Ext.elCache[D].events[J]}for(H in Ext.elCache[D].events){return false}Ext.elCache[D].events={};return false}}},removeAll:function(F){F=Ext.getDom(F);var E=o(F),K=Ext.elCache[E]||{},N=K.events||{},J,I,L,G,M,H,D;for(G in N){if(N.hasOwnProperty(G)){J=N[G];for(I=0,L=J.length;I<L;I++){M=J[I];if(M[4]){M[4].cancel()}if(M[0].tasks&&(H=M[0].tasks.length)){while(H--){M[0].tasks[H].cancel()}delete M.tasks}D=M[1];p.un(F,G,p.extAdapter?M[3]:D);if(F.addEventListener&&D&&G=="mousewheel"){F.removeEventListener("DOMMouseScroll",D,false)}if(D&&F==c&&G=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.removeListener(D)}}}}if(Ext.elCache[E]){Ext.elCache[E].events={}}},getListeners:function(G,D){G=Ext.getDom(G);var I=o(G),E=Ext.elCache[I]||{},H=E.events||{},F=[];if(H&&H[D]){return H[D]}else{return null}},purgeElement:function(F,D,H){F=Ext.getDom(F);var E=o(F),K=Ext.elCache[E]||{},L=K.events||{},G,J,I;if(H){if(L&&L.hasOwnProperty(H)){J=L[H];for(G=0,I=J.length;G<I;G++){Ext.EventManager.removeListener(F,H,J[G][0])}}}else{Ext.EventManager.removeAll(F)}if(D&&F&&F.childNodes){for(G=0,I=F.childNodes.length;G<I;G++){Ext.EventManager.purgeElement(F.childNodes[G],D,H)}}},_unload:function(){var D;for(D in Ext.elCache){Ext.EventManager.removeAll(D)}delete Ext.elCache;delete Ext.Element._flyweights;var H,E,G,F=Ext.lib.Ajax;(typeof F.conn=="object")?E=F.conn:E={};for(G in E){H=E[G];if(H){F.abort({conn:H,tId:G})}}},onDocumentReady:function(F,E,D){if(Ext.isReady){A||(A=new Ext.util.Event());A.addListener(F,E,D);A.fire();A.listeners=[]}else{if(!A){a()}D=D||{};D.delay=D.delay||1;A.addListener(F,E,D)}},fireDocReady:b};w.on=w.addListener;w.un=w.removeListener;w.stoppedMouseDownEvent=new Ext.util.Event();return w}();Ext.onReady=Ext.EventManager.onDocumentReady;(function(){var a=function(){var c=document.body||document.getElementsByTagName("body")[0];if(!c){return false}var b=[" ",Ext.isIE?"ext-ie "+(Ext.isIE6?"ext-ie6":(Ext.isIE7?"ext-ie7":"ext-ie8")):Ext.isGecko?"ext-gecko "+(Ext.isGecko2?"ext-gecko2":"ext-gecko3"):Ext.isOpera?"ext-opera":Ext.isWebKit?"ext-webkit":""];if(Ext.isSafari){b.push("ext-safari "+(Ext.isSafari2?"ext-safari2":(Ext.isSafari3?"ext-safari3":"ext-safari4")))}else{if(Ext.isChrome){b.push("ext-chrome")}}if(Ext.isMac){b.push("ext-mac")}if(Ext.isLinux){b.push("ext-linux")}if(Ext.isStrict||Ext.isBorderBox){var d=c.parentNode;if(d){Ext.fly(d,"_internal").addClass(((Ext.isStrict&&Ext.isIE)||(!Ext.enableForcedBoxModel&&!Ext.isIE))?" ext-strict":" ext-border-box")}}if(Ext.enableForcedBoxModel&&!Ext.isIE){Ext.isForcedBorderBox=true;b.push("ext-forced-border-box")}Ext.fly(c,"_internal").addClass(b);return true};if(!a()){Ext.onReady(a)}})();(function(){var b=Ext.apply(Ext.supports,{correctRightMargin:true,correctTransparentColor:true,cssFloat:true});var a=function(){var g=document.createElement("div"),e=document,c,d;g.innerHTML='<div style="height:30px;width:50px;"><div style="height:20px;width:20px;"></div></div><div style="float:left;background-color:transparent;">';e.body.appendChild(g);d=g.lastChild;if((c=e.defaultView)){if(c.getComputedStyle(g.firstChild.firstChild,null).marginRight!="0px"){b.correctRightMargin=false}if(c.getComputedStyle(d,null).backgroundColor!="transparent"){b.correctTransparentColor=false}}b.cssFloat=!!d.style.cssFloat;e.body.removeChild(g)};if(Ext.isReady){a()}else{Ext.onReady(a)}})();Ext.EventObject=function(){var b=Ext.lib.Event,c=/(dbl)?click/,a={3:13,63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35},d=Ext.isIE?{1:0,4:1,2:2}:{0:0,1:1,2:2};Ext.EventObjectImpl=function(g){if(g){this.setEvent(g.browserEvent||g)}};Ext.EventObjectImpl.prototype={setEvent:function(h){var g=this;if(h==g||(h&&h.browserEvent)){return h}g.browserEvent=h;if(h){g.button=h.button?d[h.button]:(h.which?h.which-1:-1);if(c.test(h.type)&&g.button==-1){g.button=0}g.type=h.type;g.shiftKey=h.shiftKey;g.ctrlKey=h.ctrlKey||h.metaKey||false;g.altKey=h.altKey;g.keyCode=h.keyCode;g.charCode=h.charCode;g.target=b.getTarget(h);g.xy=b.getXY(h)}else{g.button=-1;g.shiftKey=false;g.ctrlKey=false;g.altKey=false;g.keyCode=0;g.charCode=0;g.target=null;g.xy=[0,0]}return g},stopEvent:function(){var e=this;if(e.browserEvent){if(e.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(e)}b.stopEvent(e.browserEvent)}},preventDefault:function(){if(this.browserEvent){b.preventDefault(this.browserEvent)}},stopPropagation:function(){var e=this;if(e.browserEvent){if(e.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(e)}b.stopPropagation(e.browserEvent)}},getCharCode:function(){return this.charCode||this.keyCode},getKey:function(){return this.normalizeKey(this.keyCode||this.charCode)},normalizeKey:function(e){return Ext.isSafari?(a[e]||e):e},getPageX:function(){return this.xy[0]},getPageY:function(){return this.xy[1]},getXY:function(){return this.xy},getTarget:function(g,h,e){return g?Ext.fly(this.target).findParent(g,h,e):(e?Ext.get(this.target):this.target)},getRelatedTarget:function(){return this.browserEvent?b.getRelatedTarget(this.browserEvent):null},getWheelDelta:function(){var g=this.browserEvent;var h=0;if(g.wheelDelta){h=g.wheelDelta/120}else{if(g.detail){h=-g.detail/3}}return h},within:function(h,i,e){if(h){var g=this[i?"getRelatedTarget":"getTarget"]();return g&&((e?(g==Ext.getDom(h)):false)||Ext.fly(h).contains(g))}return false}};return new Ext.EventObjectImpl()}();Ext.Loader=Ext.apply({},{load:function(k,i,l,c){var l=l||this,g=document.getElementsByTagName("head")[0],b=document.createDocumentFragment(),a=k.length,h=0,e=this;var m=function(n){g.appendChild(e.buildScriptTag(k[n],d))};var d=function(){h++;if(a==h&&typeof i=="function"){i.call(l)}else{if(c===true){m(h)}}};if(c===true){m.call(this,0)}else{Ext.each(k,function(o,n){b.appendChild(this.buildScriptTag(o,d))},this);g.appendChild(b)}},buildScriptTag:function(b,c){var a=document.createElement("script");a.type="text/javascript";a.src=b;if(a.readyState){a.onreadystatechange=function(){if(a.readyState=="loaded"||a.readyState=="complete"){a.onreadystatechange=null;c()}}}else{a.onload=c}return a}});Ext.ns("Ext.grid","Ext.list","Ext.dd","Ext.tree","Ext.form","Ext.menu","Ext.state","Ext.layout","Ext.app","Ext.ux","Ext.chart","Ext.direct");Ext.apply(Ext,function(){var c=Ext,a=0,b=null;return{emptyFn:function(){},BLANK_IMAGE_URL:Ext.isIE6||Ext.isIE7||Ext.isAir?"http://www.extjs.com/s.gif":"data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",extendX:function(d,e){return Ext.extend(d,e(d.prototype))},getDoc:function(){return Ext.get(document)},num:function(e,d){e=Number(Ext.isEmpty(e)||Ext.isArray(e)||typeof e=="boolean"||(typeof e=="string"&&e.trim().length==0)?NaN:e);return isNaN(e)?d:e},value:function(g,d,e){return Ext.isEmpty(g,e)?d:g},escapeRe:function(d){return d.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},sequence:function(h,d,g,e){h[d]=h[d].createSequence(g,e)},addBehaviors:function(i){if(!Ext.isReady){Ext.onReady(function(){Ext.addBehaviors(i)})}else{var e={},h,d,g;for(d in i){if((h=d.split("@"))[1]){g=h[0];if(!e[g]){e[g]=Ext.select(g)}e[g].on(h[1],i[d])}}e=null}},getScrollBarWidth:function(g){if(!Ext.isReady){return 0}if(g===true||b===null){var i=Ext.getBody().createChild('<div class="x-hide-offsets" style="width:100px;height:50px;overflow:hidden;"><div style="height:200px;"></div></div>'),h=i.child("div",true);var e=h.offsetWidth;i.setStyle("overflow",(Ext.isWebKit||Ext.isGecko)?"auto":"scroll");var d=h.offsetWidth;i.remove();b=e-d+2}return b},combine:function(){var g=arguments,e=g.length,k=[];for(var h=0;h<e;h++){var d=g[h];if(Ext.isArray(d)){k=k.concat(d)}else{if(d.length!==undefined&&!d.substr){k=k.concat(Array.prototype.slice.call(d,0))}else{k.push(d)}}}return k},copyTo:function(d,e,g){if(typeof g=="string"){g=g.split(/[,;\s]/)}Ext.each(g,function(h){if(e.hasOwnProperty(h)){d[h]=e[h]}},this);return d},destroy:function(){Ext.each(arguments,function(d){if(d){if(Ext.isArray(d)){this.destroy.apply(this,d)}else{if(typeof d.destroy=="function"){d.destroy()}else{if(d.dom){d.remove()}}}}},this)},destroyMembers:function(m,k,g,h){for(var l=1,e=arguments,d=e.length;l<d;l++){Ext.destroy(m[e[l]]);delete m[e[l]]}},clean:function(d){var e=[];Ext.each(d,function(g){if(!!g){e.push(g)}});return e},unique:function(d){var e=[],g={};Ext.each(d,function(h){if(!g[h]){e.push(h)}g[h]=true});return e},flatten:function(d){var g=[];function e(h){Ext.each(h,function(i){if(Ext.isArray(i)){e(i)}else{g.push(i)}});return g}return e(d)},min:function(d,e){var g=d[0];e=e||function(i,h){return i<h?-1:1};Ext.each(d,function(h){g=e(g,h)==-1?g:h});return g},max:function(d,e){var g=d[0];e=e||function(i,h){return i>h?1:-1};Ext.each(d,function(h){g=e(g,h)==1?g:h});return g},mean:function(d){return d.length>0?Ext.sum(d)/d.length:undefined},sum:function(d){var e=0;Ext.each(d,function(g){e+=g});return e},partition:function(d,e){var g=[[],[]];Ext.each(d,function(k,l,h){g[(e&&e(k,l,h))||(!e&&k)?0:1].push(k)});return g},invoke:function(d,e){var h=[],g=Array.prototype.slice.call(arguments,2);Ext.each(d,function(k,l){if(k&&typeof k[e]=="function"){h.push(k[e].apply(k,g))}else{h.push(undefined)}});return h},pluck:function(d,g){var e=[];Ext.each(d,function(h){e.push(h[g])});return e},zip:function(){var n=Ext.partition(arguments,function(i){return typeof i!="function"}),k=n[0],m=n[1][0],d=Ext.max(Ext.pluck(k,"length")),h=[];for(var l=0;l<d;l++){h[l]=[];if(m){h[l]=m.apply(m,Ext.pluck(k,l))}else{for(var g=0,e=k.length;g<e;g++){h[l].push(k[g][l])}}}return h},getCmp:function(d){return Ext.ComponentMgr.get(d)},useShims:c.isIE6||(c.isMac&&c.isGecko2),type:function(e){if(e===undefined||e===null){return false}if(e.htmlElement){return"element"}var d=typeof e;if(d=="object"&&e.nodeName){switch(e.nodeType){case 1:return"element";case 3:return(/\S/).test(e.nodeValue)?"textnode":"whitespace"}}if(d=="object"||d=="function"){switch(e.constructor){case Array:return"array";case RegExp:return"regexp";case Date:return"date"}if(typeof e.length=="number"&&typeof e.item=="function"){return"nodelist"}}return d},intercept:function(h,d,g,e){h[d]=h[d].createInterceptor(g,e)},callback:function(d,h,g,e){if(typeof d=="function"){if(e){d.defer(e,h,g||[])}else{d.apply(h,g||[])}}}}}());Ext.apply(Function.prototype,{createSequence:function(b,a){var c=this;return(typeof b!="function")?this:function(){var d=c.apply(this||window,arguments);b.apply(a||this||window,arguments);return d}}});Ext.applyIf(String,{escape:function(a){return a.replace(/('|\\)/g,"\\$1")},leftPad:function(d,b,c){var a=String(d);if(!c){c=" "}while(a.length<b){a=c+a}return a}});String.prototype.toggle=function(b,a){return this==b?a:b};String.prototype.trim=function(){var a=/^\s+|\s+$/g;return function(){return this.replace(a,"")}}();Date.prototype.getElapsed=function(a){return Math.abs((a||new Date()).getTime()-this.getTime())};Ext.applyIf(Number.prototype,{constrain:function(b,a){return Math.min(Math.max(this,b),a)}});Ext.lib.Dom.getRegion=function(a){return Ext.lib.Region.getRegion(a)};Ext.lib.Region=function(d,g,a,c){var e=this;e.top=d;e[1]=d;e.right=g;e.bottom=a;e.left=c;e[0]=c};Ext.lib.Region.prototype={contains:function(b){var a=this;return(b.left>=a.left&&b.right<=a.right&&b.top>=a.top&&b.bottom<=a.bottom)},getArea:function(){var a=this;return((a.bottom-a.top)*(a.right-a.left))},intersect:function(h){var g=this,d=Math.max(g.top,h.top),e=Math.min(g.right,h.right),a=Math.min(g.bottom,h.bottom),c=Math.max(g.left,h.left);if(a>=d&&e>=c){return new Ext.lib.Region(d,e,a,c)}},union:function(h){var g=this,d=Math.min(g.top,h.top),e=Math.max(g.right,h.right),a=Math.max(g.bottom,h.bottom),c=Math.min(g.left,h.left);return new Ext.lib.Region(d,e,a,c)},constrainTo:function(b){var a=this;a.top=a.top.constrain(b.top,b.bottom);a.bottom=a.bottom.constrain(b.top,b.bottom);a.left=a.left.constrain(b.left,b.right);a.right=a.right.constrain(b.left,b.right);return a},adjust:function(d,c,a,g){var e=this;e.top+=d;e.left+=c;e.right+=g;e.bottom+=a;return e}};Ext.lib.Region.getRegion=function(e){var h=Ext.lib.Dom.getXY(e),d=h[1],g=h[0]+e.offsetWidth,a=h[1]+e.offsetHeight,c=h[0];return new Ext.lib.Region(d,g,a,c)};Ext.lib.Point=function(a,c){if(Ext.isArray(a)){c=a[1];a=a[0]}var b=this;b.x=b.right=b.left=b[0]=a;b.y=b.top=b.bottom=b[1]=c};Ext.lib.Point.prototype=new Ext.lib.Region();Ext.apply(Ext.DomHelper,function(){var e,a="afterbegin",h="afterend",i="beforebegin",d="beforeend",b=/tag|children|cn|html$/i;function g(n,q,p,r,m,k){n=Ext.getDom(n);var l;if(e.useDom){l=c(q,null);if(k){n.appendChild(l)}else{(m=="firstChild"?n:n.parentNode).insertBefore(l,n[m]||n)}}else{l=Ext.DomHelper.insertHtml(r,n,Ext.DomHelper.createHtml(q))}return p?Ext.get(l,true):l}function c(k,s){var m,v=document,q,t,n,u;if(Ext.isArray(k)){m=v.createDocumentFragment();for(var r=0,p=k.length;r<p;r++){c(k[r],m)}}else{if(typeof k=="string"){m=v.createTextNode(k)}else{m=v.createElement(k.tag||"div");q=!!m.setAttribute;for(var t in k){if(!b.test(t)){n=k[t];if(t=="cls"){m.className=n}else{if(q){m.setAttribute(t,n)}else{m[t]=n}}}}Ext.DomHelper.applyStyles(m,k.style);if((u=k.children||k.cn)){c(u,m)}else{if(k.html){m.innerHTML=k.html}}}}if(s){s.appendChild(m)}return m}e={createTemplate:function(l){var k=Ext.DomHelper.createHtml(l);return new Ext.Template(k)},useDom:false,insertBefore:function(k,m,l){return g(k,m,l,i)},insertAfter:function(k,m,l){return g(k,m,l,h,"nextSibling")},insertFirst:function(k,m,l){return g(k,m,l,a,"firstChild")},append:function(k,m,l){return g(k,m,l,d,"",true)},createDom:c};return e}());Ext.apply(Ext.Template.prototype,{disableFormats:false,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,argsRe:/^\s*['"](.*)["']\s*$/,compileARe:/\\/g,compileBRe:/(\r\n|\n)/g,compileCRe:/'/g,applyTemplate:function(b){var g=this,a=g.disableFormats!==true,e=Ext.util.Format,c=g;if(g.compiled){return g.compiled(b)}function d(k,n,q,l){if(q&&a){if(q.substr(0,5)=="this."){return c.call(q.substr(5),b[n],b)}else{if(l){var p=g.argsRe;l=l.split(",");for(var o=0,h=l.length;o<h;o++){l[o]=l[o].replace(p,"$1")}l=[b[n]].concat(l)}else{l=[b[n]]}return e[q].apply(e,l)}}else{return b[n]!==undefined?b[n]:""}}return g.html.replace(g.re,d)},compile:function(){var me=this,fm=Ext.util.Format,useF=me.disableFormats!==true,sep=Ext.isGecko?"+":",",body;function fn(m,name,format,args){if(format&&useF){args=args?","+args:"";if(format.substr(0,5)!="this."){format="fm."+format+"("}else{format='this.call("'+format.substr(5)+'", ';args=", values"}}else{args="";format="(values['"+name+"'] == undefined ? '' : "}return"'"+sep+format+"values['"+name+"']"+args+")"+sep+"'"}if(Ext.isGecko){body="this.compiled = function(values){ return '"+me.html.replace(me.compileARe,"\\\\").replace(me.compileBRe,"\\n").replace(me.compileCRe,"\\'").replace(me.re,fn)+"';};"}else{body=["this.compiled = function(values){ return ['"];body.push(me.html.replace(me.compileARe,"\\\\").replace(me.compileBRe,"\\n").replace(me.compileCRe,"\\'").replace(me.re,fn));body.push("'].join('');};");body=body.join("")}eval(body);return me},call:function(c,b,a){return this[c](b,a)}});Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;Ext.util.Functions={createInterceptor:function(c,b,a){var d=c;if(!Ext.isFunction(b)){return c}else{return function(){var g=this,e=arguments;b.target=g;b.method=c;return(b.apply(a||g||window,e)!==false)?c.apply(g||window,e):null}}},createDelegate:function(c,d,b,a){if(!Ext.isFunction(c)){return c}return function(){var g=b||arguments;if(a===true){g=Array.prototype.slice.call(arguments,0);g=g.concat(b)}else{if(Ext.isNumber(a)){g=Array.prototype.slice.call(arguments,0);var e=[a,0].concat(b);Array.prototype.splice.apply(g,e)}}return c.apply(d||window,g)}},defer:function(d,c,e,b,a){d=Ext.util.Functions.createDelegate(d,e,b,a);if(c>0){return setTimeout(d,c)}d();return 0},createSequence:function(c,b,a){if(!Ext.isFunction(b)){return c}else{return function(){var d=c.apply(this||window,arguments);b.apply(a||this||window,arguments);return d}}}};Ext.defer=Ext.util.Functions.defer;Ext.createInterceptor=Ext.util.Functions.createInterceptor;Ext.createSequence=Ext.util.Functions.createSequence;Ext.createDelegate=Ext.util.Functions.createDelegate;Ext.apply(Ext.util.Observable.prototype,function(){function a(k){var i=(this.methodEvents=this.methodEvents||{})[k],d,c,g,h=this;if(!i){this.methodEvents[k]=i={};i.originalFn=this[k];i.methodName=k;i.before=[];i.after=[];var b=function(m,l,e){if((c=m.apply(l||h,e))!==undefined){if(typeof c=="object"){if(c.returnValue!==undefined){d=c.returnValue}else{d=c}g=!!c.cancel}else{if(c===false){g=true}else{d=c}}}};this[k]=function(){var m=Array.prototype.slice.call(arguments,0),l;d=c=undefined;g=false;for(var n=0,e=i.before.length;n<e;n++){l=i.before[n];b(l.fn,l.scope,m);if(g){return d}}if((c=i.originalFn.apply(h,m))!==undefined){d=c}for(var n=0,e=i.after.length;n<e;n++){l=i.after[n];b(l.fn,l.scope,m);if(g){return d}}return d}}return i}return{beforeMethod:function(d,c,b){a.call(this,d).before.push({fn:c,scope:b})},afterMethod:function(d,c,b){a.call(this,d).after.push({fn:c,scope:b})},removeMethodListener:function(k,g,d){var h=this.getMethodEvent(k);for(var c=0,b=h.before.length;c<b;c++){if(h.before[c].fn==g&&h.before[c].scope==d){h.before.splice(c,1);return}}for(var c=0,b=h.after.length;c<b;c++){if(h.after[c].fn==g&&h.after[c].scope==d){h.after.splice(c,1);return}}},relayEvents:function(k,e){var h=this;function g(i){return function(){return h.fireEvent.apply(h,[i].concat(Array.prototype.slice.call(arguments,0)))}}for(var d=0,b=e.length;d<b;d++){var c=e[d];h.events[c]=h.events[c]||true;k.on(c,g(c),h)}},enableBubble:function(e){var g=this;if(!Ext.isEmpty(e)){e=Ext.isArray(e)?e:Array.prototype.slice.call(arguments,0);for(var d=0,b=e.length;d<b;d++){var c=e[d];c=c.toLowerCase();var h=g.events[c]||true;if(typeof h=="boolean"){h=new Ext.util.Event(g,c);g.events[c]=h}h.bubble=true}}}}}());Ext.util.Observable.capture=function(c,b,a){c.fireEvent=c.fireEvent.createInterceptor(b,a)};Ext.util.Observable.observeClass=function(b,a){if(b){if(!b.fireEvent){Ext.apply(b,new Ext.util.Observable());Ext.util.Observable.capture(b.prototype,b.fireEvent,b)}if(typeof a=="object"){b.on(a)}return b}};Ext.apply(Ext.EventManager,function(){var c,k,e,b,a=Ext.lib.Dom,i=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,h=0,g=0,d=Ext.isWebKit?Ext.num(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1])>=525:!((Ext.isGecko&&!Ext.isWindows)||Ext.isOpera);return{doResizeEvent:function(){var m=a.getViewHeight(),l=a.getViewWidth();if(g!=m||h!=l){c.fire(h=l,g=m)}},onWindowResize:function(n,m,l){if(!c){c=new Ext.util.Event();k=new Ext.util.DelayedTask(this.doResizeEvent);Ext.EventManager.on(window,"resize",this.fireWindowResize,this)}c.addListener(n,m,l)},fireWindowResize:function(){if(c){k.delay(100)}},onTextResize:function(o,n,l){if(!e){e=new Ext.util.Event();var m=new Ext.Element(document.createElement("div"));m.dom.className="x-text-resize";m.dom.innerHTML="X";m.appendTo(document.body);b=m.dom.offsetHeight;setInterval(function(){if(m.dom.offsetHeight!=b){e.fire(b,b=m.dom.offsetHeight)}},this.textResizeInterval)}e.addListener(o,n,l)},removeResizeListener:function(m,l){if(c){c.removeListener(m,l)}},fireResize:function(){if(c){c.fire(a.getViewWidth(),a.getViewHeight())}},textResizeInterval:50,ieDeferSrc:false,getKeyEvent:function(){return d?"keydown":"keypress"},useKeydown:d}}());Ext.EventManager.on=Ext.EventManager.addListener;Ext.apply(Ext.EventObjectImpl.prototype,{BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,RETURN:13,SHIFT:16,CTRL:17,CONTROL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGEUP:33,PAGE_DOWN:34,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,isNavKeyPress:function(){var b=this,a=this.normalizeKey(b.keyCode);return(a>=33&&a<=40)||a==b.RETURN||a==b.TAB||a==b.ESC},isSpecialKey:function(){var a=this.normalizeKey(this.keyCode);return(this.type=="keypress"&&this.ctrlKey)||this.isNavKeyPress()||(a==this.BACKSPACE)||(a>=16&&a<=20)||(a>=44&&a<=46)},getPoint:function(){return new Ext.lib.Point(this.xy[0],this.xy[1])},hasModifier:function(){return((this.ctrlKey||this.altKey)||this.shiftKey)}});Ext.Element.addMethods({swallowEvent:function(a,b){var d=this;function c(g){g.stopPropagation();if(b){g.preventDefault()}}if(Ext.isArray(a)){Ext.each(a,function(g){d.on(g,c)});return d}d.on(a,c);return d},relayEvent:function(a,b){this.on(a,function(c){b.fireEvent(a,c)})},clean:function(b){var d=this,e=d.dom,g=e.firstChild,c=-1;if(Ext.Element.data(e,"isCleaned")&&b!==true){return d}while(g){var a=g.nextSibling;if(g.nodeType==3&&!(/\S/.test(g.nodeValue))){e.removeChild(g)}else{g.nodeIndex=++c}g=a}Ext.Element.data(e,"isCleaned",true);return d},load:function(){var a=this.getUpdater();a.update.apply(a,arguments);return this},getUpdater:function(){return this.updateManager||(this.updateManager=new Ext.Updater(this))},update:function(html,loadScripts,callback){if(!this.dom){return this}html=html||"";if(loadScripts!==true){this.dom.innerHTML=html;if(typeof callback=="function"){callback()}return this}var id=Ext.id(),dom=this.dom;html+='<span id="'+id+'"></span>';Ext.lib.Event.onAvailable(id,function(){var DOC=document,hd=DOC.getElementsByTagName("head")[0],re=/(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,srcRe=/\ssrc=([\'\"])(.*?)\1/i,typeRe=/\stype=([\'\"])(.*?)\1/i,match,attrs,srcMatch,typeMatch,el,s;while((match=re.exec(html))){attrs=match[1];srcMatch=attrs?attrs.match(srcRe):false;if(srcMatch&&srcMatch[2]){s=DOC.createElement("script");s.src=srcMatch[2];typeMatch=attrs.match(typeRe);if(typeMatch&&typeMatch[2]){s.type=typeMatch[2]}hd.appendChild(s)}else{if(match[2]&&match[2].length>0){if(window.execScript){window.execScript(match[2])}else{window.eval(match[2])}}}}el=DOC.getElementById(id);if(el){Ext.removeNode(el)}if(typeof callback=="function"){callback()}});dom.innerHTML=html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,"");return this},removeAllListeners:function(){this.removeAnchor();Ext.EventManager.removeAll(this.dom);return this},createProxy:function(a,e,d){a=(typeof a=="object")?a:{tag:"div",cls:a};var c=this,b=e?Ext.DomHelper.append(e,a,true):Ext.DomHelper.insertBefore(c.dom,a,true);if(d&&c.setBox&&c.getBox){b.setBox(c.getBox())}return b}});Ext.Element.prototype.getUpdateManager=Ext.Element.prototype.getUpdater;Ext.Element.addMethods({getAnchorXY:function(e,m,t){e=(e||"tl").toLowerCase();t=t||{};var l=this,b=l.dom==document.body||l.dom==document,p=t.width||b?Ext.lib.Dom.getViewWidth():l.getWidth(),i=t.height||b?Ext.lib.Dom.getViewHeight():l.getHeight(),q,a=Math.round,c=l.getXY(),n=l.getScroll(),k=b?n.left:!m?c[0]:0,g=b?n.top:!m?c[1]:0,d={c:[a(p*0.5),a(i*0.5)],t:[a(p*0.5),0],l:[0,a(i*0.5)],r:[p,a(i*0.5)],b:[a(p*0.5),i],tl:[0,0],bl:[0,i],br:[p,i],tr:[p,0]};q=d[e];return[q[0]+k,q[1]+g]},anchorTo:function(b,h,c,a,l,m){var i=this,e=i.dom,k=!Ext.isEmpty(l),d=function(){Ext.fly(e).alignTo(b,h,c,a);Ext.callback(m,Ext.fly(e))},g=this.getAnchor();this.removeAnchor();Ext.apply(g,{fn:d,scroll:k});Ext.EventManager.onWindowResize(d,null);if(k){Ext.EventManager.on(window,"scroll",d,null,{buffer:!isNaN(l)?l:50})}d.call(i);return i},removeAnchor:function(){var b=this,a=this.getAnchor();if(a&&a.fn){Ext.EventManager.removeResizeListener(a.fn);if(a.scroll){Ext.EventManager.un(window,"scroll",a.fn)}delete a.fn}return b},getAnchor:function(){var b=Ext.Element.data,c=this.dom;if(!c){return}var a=b(c,"_anchor");if(!a){a=b(c,"_anchor",{})}return a},getAlignToXY:function(g,B,C){g=Ext.get(g);if(!g||!g.dom){throw"Element.alignToXY with an element that doesn't exist"}C=C||[0,0];B=(!B||B=="?"?"tl-bl?":(!(/-/).test(B)&&B!==""?"tl-"+B:B||"tl-bl")).toLowerCase();var L=this,I=L.dom,N,M,q,n,t,G,z,u=Ext.lib.Dom.getViewWidth()-10,H=Ext.lib.Dom.getViewHeight()-10,b,i,k,l,v,A,O=document,K=O.documentElement,s=O.body,F=(K.scrollLeft||s.scrollLeft||0)+5,E=(K.scrollTop||s.scrollTop||0)+5,J=false,e="",a="",D=B.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!D){throw"Element.alignTo with an invalid alignment "+B}e=D[1];a=D[2];J=!!D[3];N=L.getAnchorXY(e,true);M=g.getAnchorXY(a,false);q=M[0]-N[0]+C[0];n=M[1]-N[1]+C[1];if(J){t=L.getWidth();G=L.getHeight();z=g.getRegion();b=e.charAt(0);i=e.charAt(e.length-1);k=a.charAt(0);l=a.charAt(a.length-1);v=((b=="t"&&k=="b")||(b=="b"&&k=="t"));A=((i=="r"&&l=="l")||(i=="l"&&l=="r"));if(q+t>u+F){q=A?z.left-t:u+F-t}if(q<F){q=A?z.right:F}if(n+G>H+E){n=v?z.top-G:H+E-G}if(n<E){n=v?z.bottom:E}}return[q,n]},alignTo:function(c,a,e,b){var d=this;return d.setXY(d.getAlignToXY(c,a,e),d.preanim&&!!b?d.preanim(arguments,3):false)},adjustForConstraints:function(c,a,b){return this.getConstrainToXY(a||document,false,b,c)||c},getConstrainToXY:function(b,a,c,e){var d={top:0,left:0,bottom:0,right:0};return function(i,B,m,o){i=Ext.get(i);m=m?Ext.applyIf(m,d):d;var A,E,z=0,v=0;if(i.dom==document.body||i.dom==document){A=Ext.lib.Dom.getViewWidth();E=Ext.lib.Dom.getViewHeight()}else{A=i.dom.clientWidth;E=i.dom.clientHeight;if(!B){var u=i.getXY();z=u[0];v=u[1]}}var t=i.getScroll();z+=m.left+t.left;v+=m.top+t.top;A-=m.right;E-=m.bottom;var C=z+A,g=v+E,k=o||(!B?this.getXY():[this.getLeft(true),this.getTop(true)]),q=k[0],p=k[1],l=this.getConstrainOffset(),r=this.dom.offsetWidth+l,D=this.dom.offsetHeight+l;var n=false;if((q+r)>C){q=C-r;n=true}if((p+D)>g){p=g-D;n=true}if(q<z){q=z;n=true}if(p<v){p=v;n=true}return n?[q,p]:false}}(),getConstrainOffset:function(){return 0},getCenterXY:function(){return this.getAlignToXY(document,"c-c")},center:function(a){return this.alignTo(a||document,"c-c")}});Ext.Element.addMethods({select:function(a,b){return Ext.Element.select(a,b,this.dom)}});Ext.apply(Ext.Element.prototype,function(){var c=Ext.getDom,a=Ext.get,b=Ext.DomHelper;return{insertSibling:function(i,g,h){var k=this,e,d=(g||"before").toLowerCase()=="after",l;if(Ext.isArray(i)){l=k;Ext.each(i,function(m){e=Ext.fly(l,"_internal").insertSibling(m,g,h);if(d){l=e}});return e}i=i||{};if(i.nodeType||i.dom){e=k.dom.parentNode.insertBefore(c(i),d?k.dom.nextSibling:k.dom);if(!h){e=a(e)}}else{if(d&&!k.dom.nextSibling){e=b.append(k.dom.parentNode,i,!h)}else{e=b[d?"insertAfter":"insertBefore"](k.dom,i,!h)}}return e}}}());Ext.Element.boxMarkup='<div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div><div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div><div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>';Ext.Element.addMethods(function(){var a="_internal",b=/(\d+\.?\d+)px/;return{applyStyles:function(c){Ext.DomHelper.applyStyles(this.dom,c);return this},getStyles:function(){var c={};Ext.each(arguments,function(d){c[d]=this.getStyle(d)},this);return c},setOverflow:function(c){var d=this.dom;if(c=="auto"&&Ext.isMac&&Ext.isGecko2){d.style.overflow="hidden";(function(){d.style.overflow="auto"}).defer(1)}else{d.style.overflow=c}},boxWrap:function(c){c=c||"x-box";var d=Ext.get(this.insertHtml("beforeBegin","<div class='"+c+"'>"+String.format(Ext.Element.boxMarkup,c)+"</div>"));Ext.DomQuery.selectNode("."+c+"-mc",d.dom).appendChild(this.dom);return d},setSize:function(e,c,d){var g=this;if(typeof e=="object"){c=e.height;e=e.width}e=g.adjustWidth(e);c=g.adjustHeight(c);if(!d||!g.anim){g.dom.style.width=g.addUnits(e);g.dom.style.height=g.addUnits(c)}else{g.anim({width:{to:e},height:{to:c}},g.preanim(arguments,2))}return g},getComputedHeight:function(){var d=this,c=Math.max(d.dom.offsetHeight,d.dom.clientHeight);if(!c){c=parseFloat(d.getStyle("height"))||0;if(!d.isBorderBox()){c+=d.getFrameWidth("tb")}}return c},getComputedWidth:function(){var c=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!c){c=parseFloat(this.getStyle("width"))||0;if(!this.isBorderBox()){c+=this.getFrameWidth("lr")}}return c},getFrameWidth:function(d,c){return c&&this.isBorderBox()?0:(this.getPadding(d)+this.getBorderWidth(d))},addClassOnOver:function(c){this.hover(function(){Ext.fly(this,a).addClass(c)},function(){Ext.fly(this,a).removeClass(c)});return this},addClassOnFocus:function(c){this.on("focus",function(){Ext.fly(this,a).addClass(c)},this.dom);this.on("blur",function(){Ext.fly(this,a).removeClass(c)},this.dom);return this},addClassOnClick:function(c){var d=this.dom;this.on("mousedown",function(){Ext.fly(d,a).addClass(c);var g=Ext.getDoc(),e=function(){Ext.fly(d,a).removeClass(c);g.removeListener("mouseup",e)};g.on("mouseup",e)});return this},getViewSize:function(){var g=document,h=this.dom,c=(h==g||h==g.body);if(c){var e=Ext.lib.Dom;return{width:e.getViewWidth(),height:e.getViewHeight()}}else{return{width:h.clientWidth,height:h.clientHeight}}},getStyleSize:function(){var k=this,c,i,m=document,n=this.dom,e=(n==m||n==m.body),g=n.style;if(e){var l=Ext.lib.Dom;return{width:l.getViewWidth(),height:l.getViewHeight()}}if(g.width&&g.width!="auto"){c=parseFloat(g.width);if(k.isBorderBox()){c-=k.getFrameWidth("lr")}}if(g.height&&g.height!="auto"){i=parseFloat(g.height);if(k.isBorderBox()){i-=k.getFrameWidth("tb")}}return{width:c||k.getWidth(true),height:i||k.getHeight(true)}},getSize:function(c){return{width:this.getWidth(c),height:this.getHeight(c)}},repaint:function(){var c=this.dom;this.addClass("x-repaint");setTimeout(function(){Ext.fly(c).removeClass("x-repaint")},1);return this},unselectable:function(){this.dom.unselectable="on";return this.swallowEvent("selectstart",true).applyStyles("-moz-user-select:none;-khtml-user-select:none;").addClass("x-unselectable")},getMargins:function(d){var e=this,c,g={t:"top",l:"left",r:"right",b:"bottom"},h={};if(!d){for(c in e.margins){h[g[c]]=parseFloat(e.getStyle(e.margins[c]))||0}return h}else{return e.addStyles.call(e,d,e.margins)}}}}());Ext.Element.addMethods({setBox:function(e,g,b){var d=this,a=e.width,c=e.height;if((g&&!d.autoBoxAdjust)&&!d.isBorderBox()){a-=(d.getBorderWidth("lr")+d.getPadding("lr"));c-=(d.getBorderWidth("tb")+d.getPadding("tb"))}d.setBounds(e.x,e.y,a,c,d.animTest.call(d,arguments,b,2));return d},getBox:function(k,q){var n=this,x,e,p,d=n.getBorderWidth,s=n.getPadding,g,a,v,o;if(!q){x=n.getXY()}else{e=parseInt(n.getStyle("left"),10)||0;p=parseInt(n.getStyle("top"),10)||0;x=[e,p]}var c=n.dom,u=c.offsetWidth,i=c.offsetHeight,m;if(!k){m={x:x[0],y:x[1],0:x[0],1:x[1],width:u,height:i}}else{g=d.call(n,"l")+s.call(n,"l");a=d.call(n,"r")+s.call(n,"r");v=d.call(n,"t")+s.call(n,"t");o=d.call(n,"b")+s.call(n,"b");m={x:x[0]+g,y:x[1]+v,0:x[0]+g,1:x[1]+v,width:u-(g+a),height:i-(v+o)}}m.right=m.x+m.width;m.bottom=m.y+m.height;return m},move:function(k,b,c){var g=this,n=g.getXY(),l=n[0],i=n[1],d=[l-b,i],m=[l+b,i],h=[l,i-b],a=[l,i+b],e={l:d,left:d,r:m,right:m,t:h,top:h,up:h,b:a,bottom:a,down:a};k=k.toLowerCase();g.moveTo(e[k][0],e[k][1],g.animTest.call(g,arguments,c,2))},setLeftTop:function(d,c){var b=this,a=b.dom.style;a.left=b.addUnits(d);a.top=b.addUnits(c);return b},getRegion:function(){return Ext.lib.Dom.getRegion(this.dom)},setBounds:function(b,g,d,a,c){var e=this;if(!c||!e.anim){e.setSize(d,a);e.setLocation(b,g)}else{e.anim({points:{to:[b,g]},width:{to:e.adjustWidth(d)},height:{to:e.adjustHeight(a)}},e.preanim(arguments,4),"motion")}return e},setRegion:function(b,a){return this.setBounds(b.left,b.top,b.right-b.left,b.bottom-b.top,this.animTest.call(this,arguments,a,1))}});Ext.Element.addMethods({scrollTo:function(b,d,a){var e=/top/i.test(b),c=this,g=c.dom,h;if(!a||!c.anim){h="scroll"+(e?"Top":"Left");g[h]=d}else{h="scroll"+(e?"Left":"Top");c.anim({scroll:{to:e?[g[h],d]:[d,g[h]]}},c.preanim(arguments,2),"scroll")}return c},scrollIntoView:function(e,i){var q=Ext.getDom(e)||Ext.getBody().dom,h=this.dom,g=this.getOffsetsTo(q),m=g[0]+q.scrollLeft,v=g[1]+q.scrollTop,s=v+h.offsetHeight,d=m+h.offsetWidth,a=q.clientHeight,n=parseInt(q.scrollTop,10),u=parseInt(q.scrollLeft,10),k=n+a,p=u+q.clientWidth;if(h.offsetHeight>a||v<n){q.scrollTop=v}else{if(s>k){q.scrollTop=s-a}}q.scrollTop=q.scrollTop;if(i!==false){if(h.offsetWidth>q.clientWidth||m<u){q.scrollLeft=m}else{if(d>p){q.scrollLeft=d-q.clientWidth}}q.scrollLeft=q.scrollLeft}return this},scrollChildIntoView:function(b,a){Ext.fly(b,"_scrollChildIntoView").scrollIntoView(this,a)},scroll:function(n,b,d){if(!this.isScrollable()){return false}var e=this.dom,g=e.scrollLeft,q=e.scrollTop,o=e.scrollWidth,m=e.scrollHeight,i=e.clientWidth,a=e.clientHeight,c=false,p,k={l:Math.min(g+b,o-i),r:p=Math.max(g-b,0),t:Math.max(q-b,0),b:Math.min(q+b,m-a)};k.d=k.b;k.u=k.t;n=n.substr(0,1);if((p=k[n])>-1){c=true;this.scrollTo(n=="l"||n=="r"?"left":"top",p,this.preanim(arguments,2))}return c}});Ext.Element.addMethods(function(){var d="visibility",b="display",a="hidden",h="none",c="x-masked",g="x-masked-relative",e=Ext.Element.data;return{isVisible:function(i){var k=!this.isStyle(d,a)&&!this.isStyle(b,h),l=this.dom.parentNode;if(i!==true||!k){return k}while(l&&!(/^body/i.test(l.tagName))){if(!Ext.fly(l,"_isVisible").isVisible()){return false}l=l.parentNode}return true},isDisplayed:function(){return !this.isStyle(b,h)},enableDisplayMode:function(i){this.setVisibilityMode(Ext.Element.DISPLAY);if(!Ext.isEmpty(i)){e(this.dom,"originalDisplay",i)}return this},mask:function(k,o){var q=this,m=q.dom,p=Ext.DomHelper,n="ext-el-mask-msg",i,r;if(!(/^body/i.test(m.tagName)&&q.getStyle("position")=="static")){q.addClass(g)}if(i=e(m,"maskMsg")){i.remove()}if(i=e(m,"mask")){i.remove()}r=p.append(m,{cls:"ext-el-mask"},true);e(m,"mask",r);q.addClass(c);r.setDisplayed(true);if(typeof k=="string"){var l=p.append(m,{cls:n,cn:{tag:"div"}},true);e(m,"maskMsg",l);l.dom.className=o?n+" "+o:n;l.dom.firstChild.innerHTML=k;l.setDisplayed(true);l.center(q)}if(Ext.isIE&&!(Ext.isIE7&&Ext.isStrict)&&q.getStyle("height")=="auto"){r.setSize(undefined,q.getHeight())}return r},unmask:function(){var l=this,m=l.dom,i=e(m,"mask"),k=e(m,"maskMsg");if(i){if(k){k.remove();e(m,"maskMsg",undefined)}i.remove();e(m,"mask",undefined);l.removeClass([c,g])}},isMasked:function(){var i=e(this.dom,"mask");return i&&i.isVisible()},createShim:function(){var i=document.createElement("iframe"),k;i.frameBorder="0";i.className="ext-shim";i.src=Ext.SSL_SECURE_URL;k=Ext.get(this.dom.parentNode.insertBefore(i,this.dom));k.autoBoxAdjust=false;return k}}}());Ext.Element.addMethods({addKeyListener:function(b,d,c){var a;if(typeof b!="object"||Ext.isArray(b)){a={key:b,fn:d,scope:c}}else{a={key:b.key,shift:b.shift,ctrl:b.ctrl,alt:b.alt,fn:d,scope:c}}return new Ext.KeyMap(this,a)},addKeyMap:function(a){return new Ext.KeyMap(this,a)}});Ext.CompositeElementLite.importElementMethods();Ext.apply(Ext.CompositeElementLite.prototype,{addElements:function(c,a){if(!c){return this}if(typeof c=="string"){c=Ext.Element.selectorFunction(c,a)}var b=this.elements;Ext.each(c,function(d){b.push(Ext.get(d))});return this},first:function(){return this.item(0)},last:function(){return this.item(this.getCount()-1)},contains:function(a){return this.indexOf(a)!=-1},removeElement:function(d,e){var c=this,a=this.elements,b;Ext.each(d,function(g){if((b=(a[g]||a[g=c.indexOf(g)]))){if(e){if(b.dom){b.remove()}else{Ext.removeNode(b)}}a.splice(g,1)}});return this}});Ext.CompositeElement=Ext.extend(Ext.CompositeElementLite,{constructor:function(b,a){this.elements=[];this.add(b,a)},getElement:function(a){return a},transformElement:function(a){return Ext.get(a)}});Ext.Element.select=function(a,d,b){var c;if(typeof a=="string"){c=Ext.Element.selectorFunction(a,b)}else{if(a.length!==undefined){c=a}else{throw"Invalid selector"}}return(d===true)?new Ext.CompositeElement(c):new Ext.CompositeElementLite(c)};Ext.select=Ext.Element.select;Ext.UpdateManager=Ext.Updater=Ext.extend(Ext.util.Observable,function(){var b="beforeupdate",d="update",c="failure";function a(h){var i=this;i.transaction=null;if(h.argument.form&&h.argument.reset){try{h.argument.form.reset()}catch(k){}}if(i.loadScripts){i.renderer.render(i.el,h,i,g.createDelegate(i,[h]))}else{i.renderer.render(i.el,h,i);g.call(i,h)}}function g(h,i,k){this.fireEvent(i||d,this.el,h);if(Ext.isFunction(h.argument.callback)){h.argument.callback.call(h.argument.scope,this.el,Ext.isEmpty(k)?true:false,h,h.argument.options)}}function e(h){g.call(this,h,c,!!(this.transaction=null))}return{constructor:function(i,h){var k=this;i=Ext.get(i);if(!h&&i.updateManager){return i.updateManager}k.el=i;k.defaultUrl=null;k.addEvents(b,d,c);Ext.apply(k,Ext.Updater.defaults);k.transaction=null;k.refreshDelegate=k.refresh.createDelegate(k);k.updateDelegate=k.update.createDelegate(k);k.formUpdateDelegate=(k.formUpdate||function(){}).createDelegate(k);k.renderer=k.renderer||k.getDefaultRenderer();Ext.Updater.superclass.constructor.call(k)},setRenderer:function(h){this.renderer=h},getRenderer:function(){return this.renderer},getDefaultRenderer:function(){return new Ext.Updater.BasicRenderer()},setDefaultUrl:function(h){this.defaultUrl=h},getEl:function(){return this.el},update:function(i,p,q,m){var l=this,h,k;if(l.fireEvent(b,l.el,i,p)!==false){if(Ext.isObject(i)){h=i;i=h.url;p=p||h.params;q=q||h.callback;m=m||h.discardUrl;k=h.scope;if(!Ext.isEmpty(h.nocache)){l.disableCaching=h.nocache}if(!Ext.isEmpty(h.text)){l.indicatorText='<div class="loading-indicator">'+h.text+"</div>"}if(!Ext.isEmpty(h.scripts)){l.loadScripts=h.scripts}if(!Ext.isEmpty(h.timeout)){l.timeout=h.timeout}}l.showLoading();if(!m){l.defaultUrl=i}if(Ext.isFunction(i)){i=i.call(l)}var n=Ext.apply({},{url:i,params:(Ext.isFunction(p)&&k)?p.createDelegate(k):p,success:a,failure:e,scope:l,callback:undefined,timeout:(l.timeout*1000),disableCaching:l.disableCaching,argument:{options:h,url:i,form:null,callback:q,scope:k||window,params:p}},h);l.transaction=Ext.Ajax.request(n)}},formUpdate:function(l,h,k,m){var i=this;if(i.fireEvent(b,i.el,l,h)!==false){if(Ext.isFunction(h)){h=h.call(i)}l=Ext.getDom(l);i.transaction=Ext.Ajax.request({form:l,url:h,success:a,failure:e,scope:i,timeout:(i.timeout*1000),argument:{url:h,form:l,callback:m,reset:k}});i.showLoading.defer(1,i)}},startAutoRefresh:function(i,k,m,n,h){var l=this;if(h){l.update(k||l.defaultUrl,m,n,true)}if(l.autoRefreshProcId){clearInterval(l.autoRefreshProcId)}l.autoRefreshProcId=setInterval(l.update.createDelegate(l,[k||l.defaultUrl,m,n,true]),i*1000)},stopAutoRefresh:function(){if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);delete this.autoRefreshProcId}},isAutoRefreshing:function(){return !!this.autoRefreshProcId},showLoading:function(){if(this.showLoadIndicator){this.el.dom.innerHTML=this.indicatorText}},abort:function(){if(this.transaction){Ext.Ajax.abort(this.transaction)}},isUpdating:function(){return this.transaction?Ext.Ajax.isLoading(this.transaction):false},refresh:function(h){if(this.defaultUrl){this.update(this.defaultUrl,null,h,true)}}}}());Ext.Updater.defaults={timeout:30,disableCaching:false,showLoadIndicator:true,indicatorText:'<div class="loading-indicator">Loading...</div>',loadScripts:false,sslBlankUrl:Ext.SSL_SECURE_URL};Ext.Updater.updateElement=function(d,c,e,b){var a=Ext.get(d).getUpdater();Ext.apply(a,b);a.update(c,e,b?b.callback:null)};Ext.Updater.BasicRenderer=function(){};Ext.Updater.BasicRenderer.prototype={render:function(c,a,b,d){c.update(a.responseText,b.loadScripts,d)}};(function(){Date.useStrict=false;function b(d){var c=Array.prototype.slice.call(arguments,1);return d.replace(/\{(\d+)\}/g,function(e,g){return c[g]})}Date.formatCodeToRegex=function(d,c){var e=Date.parseCodes[d];if(e){e=typeof e=="function"?e():e;Date.parseCodes[d]=e}return e?Ext.applyIf({c:e.c?b(e.c,c||"{0}"):e.c},e):{g:0,c:null,s:Ext.escapeRe(d)}};var a=Date.formatCodeToRegex;Ext.apply(Date,{parseFunctions:{"M$":function(d,c){var e=new RegExp("\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/");var g=(d||"").match(e);return g?new Date(((g[1]||"")+g[2])*1):null}},parseRegexes:[],formatFunctions:{"M$":function(){return"\\/Date("+this.getTime()+")\\/"}},y2kYear:50,MILLI:"ms",SECOND:"s",MINUTE:"mi",HOUR:"h",DAY:"d",MONTH:"mo",YEAR:"y",defaults:{},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNumbers:{Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},getShortMonthName:function(c){return Date.monthNames[c].substring(0,3)},getShortDayName:function(c){return Date.dayNames[c].substring(0,3)},getMonthNumber:function(c){return Date.monthNumbers[c.substring(0,1).toUpperCase()+c.substring(1,3).toLowerCase()]},formatCodes:{d:"String.leftPad(this.getDate(), 2, '0')",D:"Date.getShortDayName(this.getDay())",j:"this.getDate()",l:"Date.dayNames[this.getDay()]",N:"(this.getDay() ? this.getDay() : 7)",S:"this.getSuffix()",w:"this.getDay()",z:"this.getDayOfYear()",W:"String.leftPad(this.getWeekOfYear(), 2, '0')",F:"Date.monthNames[this.getMonth()]",m:"String.leftPad(this.getMonth() + 1, 2, '0')",M:"Date.getShortMonthName(this.getMonth())",n:"(this.getMonth() + 1)",t:"this.getDaysInMonth()",L:"(this.isLeapYear() ? 1 : 0)",o:"(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0)))",Y:"String.leftPad(this.getFullYear(), 4, '0')",y:"('' + this.getFullYear()).substring(2, 4)",a:"(this.getHours() < 12 ? 'am' : 'pm')",A:"(this.getHours() < 12 ? 'AM' : 'PM')",g:"((this.getHours() % 12) ? this.getHours() % 12 : 12)",G:"this.getHours()",h:"String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')",H:"String.leftPad(this.getHours(), 2, '0')",i:"String.leftPad(this.getMinutes(), 2, '0')",s:"String.leftPad(this.getSeconds(), 2, '0')",u:"String.leftPad(this.getMilliseconds(), 3, '0')",O:"this.getGMTOffset()",P:"this.getGMTOffset(true)",T:"this.getTimezone()",Z:"(this.getTimezoneOffset() * -60)",c:function(){for(var m="Y-m-dTH:i:sP",h=[],g=0,d=m.length;g<d;++g){var k=m.charAt(g);h.push(k=="T"?"'T'":Date.getFormatCode(k))}return h.join(" + ")},U:"Math.round(this.getTime() / 1000)"},isValid:function(p,c,o,l,g,k,e){l=l||0;g=g||0;k=k||0;e=e||0;var n=new Date(p<100?100:p,c-1,o,l,g,k,e).add(Date.YEAR,p<100?p-100:0);return p==n.getFullYear()&&c==n.getMonth()+1&&o==n.getDate()&&l==n.getHours()&&g==n.getMinutes()&&k==n.getSeconds()&&e==n.getMilliseconds()},parseDate:function(d,g,c){var e=Date.parseFunctions;if(e[g]==null){Date.createParser(g)}return e[g](d,Ext.isDefined(c)?c:Date.useStrict)},getFormatCode:function(d){var c=Date.formatCodes[d];if(c){c=typeof c=="function"?c():c;Date.formatCodes[d]=c}return c||("'"+String.escape(d)+"'")},createFormat:function(h){var g=[],c=false,e="";for(var d=0;d<h.length;++d){e=h.charAt(d);if(!c&&e=="\\"){c=true}else{if(c){c=false;g.push("'"+String.escape(e)+"'")}else{g.push(Date.getFormatCode(e))}}}Date.formatFunctions[h]=new Function("return "+g.join("+"))},createParser:function(){var c=["var dt, y, m, d, h, i, s, ms, o, z, zz, u, v,","def = Date.defaults,","results = String(input).match(Date.parseRegexes[{0}]);","if(results){","{1}","if(u != null){","v = new Date(u * 1000);","}else{","dt = (new Date()).clearTime();","y = Ext.num(y, Ext.num(def.y, dt.getFullYear()));","m = Ext.num(m, Ext.num(def.m - 1, dt.getMonth()));","d = Ext.num(d, Ext.num(def.d, dt.getDate()));","h = Ext.num(h, Ext.num(def.h, dt.getHours()));","i = Ext.num(i, Ext.num(def.i, dt.getMinutes()));","s = Ext.num(s, Ext.num(def.s, dt.getSeconds()));","ms = Ext.num(ms, Ext.num(def.ms, dt.getMilliseconds()));","if(z >= 0 && y >= 0){","v = new Date(y < 100 ? 100 : y, 0, 1, h, i, s, ms).add(Date.YEAR, y < 100 ? y - 100 : 0);","v = !strict? v : (strict === true && (z <= 364 || (v.isLeapYear() && z <= 365))? v.add(Date.DAY, z) : null);","}else if(strict === true && !Date.isValid(y, m + 1, d, h, i, s, ms)){","v = null;","}else{","v = new Date(y < 100 ? 100 : y, m, d, h, i, s, ms).add(Date.YEAR, y < 100 ? y - 100 : 0);","}","}","}","if(v){","if(zz != null){","v = v.add(Date.SECOND, -v.getTimezoneOffset() * 60 - zz);","}else if(o){","v = v.add(Date.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));","}","}","return v;"].join("\n");return function(n){var e=Date.parseRegexes.length,p=1,g=[],m=[],l=false,d="",k=0,h,o;for(;k<n.length;++k){d=n.charAt(k);if(!l&&d=="\\"){l=true}else{if(l){l=false;m.push(String.escape(d))}else{h=a(d,p);p+=h.g;m.push(h.s);if(h.g&&h.c){if(h.calcLast){o=h.c}else{g.push(h.c)}}}}}if(o){g.push(o)}Date.parseRegexes[e]=new RegExp("^"+m.join("")+"$","i");Date.parseFunctions[n]=new Function("input","strict",b(c,e,g.join("")))}}(),parseCodes:{d:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},j:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},D:function(){for(var c=[],d=0;d<7;c.push(Date.getShortDayName(d)),++d){}return{g:0,c:null,s:"(?:"+c.join("|")+")"}},l:function(){return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"}},N:{g:0,c:null,s:"[1-7]"},S:{g:0,c:null,s:"(?:st|nd|rd|th)"},w:{g:0,c:null,s:"[0-6]"},z:{g:1,c:"z = parseInt(results[{0}], 10);\n",s:"(\\d{1,3})"},W:{g:0,c:null,s:"(?:\\d{2})"},F:function(){return{g:1,c:"m = parseInt(Date.getMonthNumber(results[{0}]), 10);\n",s:"("+Date.monthNames.join("|")+")"}},M:function(){for(var c=[],d=0;d<12;c.push(Date.getShortMonthName(d)),++d){}return Ext.applyIf({s:"("+c.join("|")+")"},a("F"))},m:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{2})"},n:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{1,2})"},t:{g:0,c:null,s:"(?:\\d{2})"},L:{g:0,c:null,s:"(?:1|0)"},o:function(){return a("Y")},Y:{g:1,c:"y = parseInt(results[{0}], 10);\n",s:"(\\d{4})"},y:{g:1,c:"var ty = parseInt(results[{0}], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"},a:function(){return a("A")},A:{calcLast:true,g:1,c:"if (/(am)/i.test(results[{0}])) {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(AM|PM|am|pm)"},g:function(){return a("G")},G:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},h:function(){return a("H")},H:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},i:{g:1,c:"i = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},s:{g:1,c:"s = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},u:{g:1,c:"ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",s:"(\\d+)"},O:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),","mn = o.substring(3,5) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{4})"},P:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),","mn = o.substring(4,6) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{2}:\\d{2})"},T:{g:0,c:null,s:"[A-Z]{1,4}"},Z:{g:1,c:"zz = results[{0}] * 1;\nzz = (-43200 <= zz && zz <= 50400)? zz : null;\n",s:"([+-]?\\d{1,5})"},c:function(){var e=[],c=[a("Y",1),a("m",2),a("d",3),a("h",4),a("i",5),a("s",6),{c:"ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"},{c:["if(results[8]) {","if(results[8] == 'Z'){","zz = 0;","}else if (results[8].indexOf(':') > -1){",a("P",8).c,"}else{",a("O",8).c,"}","}"].join("\n")}];for(var g=0,d=c.length;g<d;++g){e.push(c[g].c)}return{g:1,c:e.join(""),s:[c[0].s,"(?:","-",c[1].s,"(?:","-",c[2].s,"(?:","(?:T| )?",c[3].s,":",c[4].s,"(?::",c[5].s,")?","(?:(?:\\.|,)(\\d+))?","(Z|(?:[-+]\\d{2}(?::)?\\d{2}))?",")?",")?",")?"].join("")}},U:{g:1,c:"u = parseInt(results[{0}], 10);\n",s:"(-?\\d+)"}}})}());Ext.apply(Date.prototype,{dateFormat:function(a){if(Date.formatFunctions[a]==null){Date.createFormat(a)}return Date.formatFunctions[a].call(this)},getTimezone:function(){return this.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/,"$1$2").replace(/[^A-Z]/g,"")},getGMTOffset:function(a){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+(a?":":"")+String.leftPad(Math.abs(this.getTimezoneOffset()%60),2,"0")},getDayOfYear:function(){var b=0,e=this.clone(),a=this.getMonth(),c;for(c=0,e.setDate(1),e.setMonth(0);c<a;e.setMonth(++c)){b+=e.getDaysInMonth()}return b+this.getDate()-1},getWeekOfYear:function(){var a=86400000,b=7*a;return function(){var d=Date.UTC(this.getFullYear(),this.getMonth(),this.getDate()+3)/a,c=Math.floor(d/7),e=new Date(c*b).getUTCFullYear();return c-Math.floor(Date.UTC(e,0,7)/b)+1}}(),isLeapYear:function(){var a=this.getFullYear();return !!((a&3)==0&&(a%100||(a%400==0&&a)))},getFirstDayOfMonth:function(){var a=(this.getDay()-(this.getDate()-1))%7;return(a<0)?(a+7):a},getLastDayOfMonth:function(){return this.getLastDateOfMonth().getDay()},getFirstDateOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),1)},getLastDateOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),this.getDaysInMonth())},getDaysInMonth:function(){var a=[31,28,31,30,31,30,31,31,30,31,30,31];return function(){var b=this.getMonth();return b==1&&this.isLeapYear()?29:a[b]}}(),getSuffix:function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}},clone:function(){return new Date(this.getTime())},isDST:function(){return new Date(this.getFullYear(),0,1).getTimezoneOffset()!=this.getTimezoneOffset()},clearTime:function(g){if(g){return this.clone().clearTime()}var b=this.getDate();this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);if(this.getDate()!=b){for(var a=1,e=this.add(Date.HOUR,a);e.getDate()!=b;a++,e=this.add(Date.HOUR,a)){}this.setDate(b);this.setHours(e.getHours())}return this},add:function(b,c){var e=this.clone();if(!b||c===0){return e}switch(b.toLowerCase()){case Date.MILLI:e.setMilliseconds(this.getMilliseconds()+c);break;case Date.SECOND:e.setSeconds(this.getSeconds()+c);break;case Date.MINUTE:e.setMinutes(this.getMinutes()+c);break;case Date.HOUR:e.setHours(this.getHours()+c);break;case Date.DAY:e.setDate(this.getDate()+c);break;case Date.MONTH:var a=this.getDate();if(a>28){a=Math.min(a,this.getFirstDateOfMonth().add("mo",c).getLastDateOfMonth().getDate())}e.setDate(a);e.setMonth(this.getMonth()+c);break;case Date.YEAR:e.setFullYear(this.getFullYear()+c);break}return e},between:function(c,a){var b=this.getTime();return c.getTime()<=b&&b<=a.getTime()}});Date.prototype.format=Date.prototype.dateFormat;if(Ext.isSafari&&(navigator.userAgent.match(/WebKit\/(\d+)/)[1]||NaN)<420){Ext.apply(Date.prototype,{_xMonth:Date.prototype.setMonth,_xDate:Date.prototype.setDate,setMonth:function(a){if(a<=-1){var d=Math.ceil(-a),c=Math.ceil(d/12),b=(d%12)?12-d%12:0;this.setFullYear(this.getFullYear()-c);return this._xMonth(b)}else{return this._xMonth(a)}},setDate:function(a){return this.setTime(this.getTime()-(this.getDate()-a)*86400000)}})}Ext.util.MixedCollection=function(b,a){this.items=[];this.map={};this.keys=[];this.length=0;this.addEvents("clear","add","replace","remove","sort");this.allowFunctions=b===true;if(a){this.getKey=a}Ext.util.MixedCollection.superclass.constructor.call(this)};Ext.extend(Ext.util.MixedCollection,Ext.util.Observable,{allowFunctions:false,add:function(b,c){if(arguments.length==1){c=arguments[0];b=this.getKey(c)}if(typeof b!="undefined"&&b!==null){var a=this.map[b];if(typeof a!="undefined"){return this.replace(b,c)}this.map[b]=c}this.length++;this.items.push(c);this.keys.push(b);this.fireEvent("add",this.length-1,c,b);return c},getKey:function(a){return a.id},replace:function(c,d){if(arguments.length==1){d=arguments[0];c=this.getKey(d)}var a=this.map[c];if(typeof c=="undefined"||c===null||typeof a=="undefined"){return this.add(c,d)}var b=this.indexOfKey(c);this.items[b]=d;this.map[c]=d;this.fireEvent("replace",c,a,d);return d},addAll:function(e){if(arguments.length>1||Ext.isArray(e)){var b=arguments.length>1?arguments:e;for(var d=0,a=b.length;d<a;d++){this.add(b[d])}}else{for(var c in e){if(this.allowFunctions||typeof e[c]!="function"){this.add(c,e[c])}}}},each:function(e,d){var b=[].concat(this.items);for(var c=0,a=b.length;c<a;c++){if(e.call(d||b[c],b[c],c,a)===false){break}}},eachKey:function(d,c){for(var b=0,a=this.keys.length;b<a;b++){d.call(c||window,this.keys[b],this.items[b],b,a)}},find:function(d,c){for(var b=0,a=this.items.length;b<a;b++){if(d.call(c||window,this.items[b],this.keys[b])){return this.items[b]}}return null},insert:function(a,b,c){if(arguments.length==2){c=arguments[1];b=this.getKey(c)}if(this.containsKey(b)){this.suspendEvents();this.removeKey(b);this.resumeEvents()}if(a>=this.length){return this.add(b,c)}this.length++;this.items.splice(a,0,c);if(typeof b!="undefined"&&b!==null){this.map[b]=c}this.keys.splice(a,0,b);this.fireEvent("add",a,c,b);return c},remove:function(a){return this.removeAt(this.indexOf(a))},removeAt:function(a){if(a<this.length&&a>=0){this.length--;var c=this.items[a];this.items.splice(a,1);var b=this.keys[a];if(typeof b!="undefined"){delete this.map[b]}this.keys.splice(a,1);this.fireEvent("remove",c,b);return c}return false},removeKey:function(a){return this.removeAt(this.indexOfKey(a))},getCount:function(){return this.length},indexOf:function(a){return this.items.indexOf(a)},indexOfKey:function(a){return this.keys.indexOf(a)},item:function(b){var a=this.map[b],c=a!==undefined?a:(typeof b=="number")?this.items[b]:undefined;return typeof c!="function"||this.allowFunctions?c:null},itemAt:function(a){return this.items[a]},key:function(a){return this.map[a]},contains:function(a){return this.indexOf(a)!=-1},containsKey:function(a){return typeof this.map[a]!="undefined"},clear:function(){this.length=0;this.items=[];this.keys=[];this.map={};this.fireEvent("clear")},first:function(){return this.items[0]},last:function(){return this.items[this.length-1]},_sort:function(l,a,k){var d,e,b=String(a).toUpperCase()=="DESC"?-1:1,h=[],m=this.keys,g=this.items;k=k||function(i,c){return i-c};for(d=0,e=g.length;d<e;d++){h[h.length]={key:m[d],value:g[d],index:d}}h.sort(function(i,c){var n=k(i[l],c[l])*b;if(n===0){n=(i.index<c.index?-1:1)}return n});for(d=0,e=h.length;d<e;d++){g[d]=h[d].value;m[d]=h[d].key}this.fireEvent("sort",this)},sort:function(a,b){this._sort("value",a,b)},reorder:function(d){this.suspendEvents();var b=this.items,c=0,g=b.length,a=[],e=[],h;for(h in d){a[d[h]]=b[h]}for(c=0;c<g;c++){if(d[c]==undefined){e.push(b[c])}}for(c=0;c<g;c++){if(a[c]==undefined){a[c]=e.shift()}}this.clear();this.addAll(a);this.resumeEvents();this.fireEvent("sort",this)},keySort:function(a,b){this._sort("key",a,b||function(d,c){var g=String(d).toUpperCase(),e=String(c).toUpperCase();return g>e?1:(g<e?-1:0)})},getRange:function(e,a){var b=this.items;if(b.length<1){return[]}e=e||0;a=Math.min(typeof a=="undefined"?this.length-1:a,this.length-1);var c,d=[];if(e<=a){for(c=e;c<=a;c++){d[d.length]=b[c]}}else{for(c=e;c>=a;c--){d[d.length]=b[c]}}return d},filter:function(c,b,d,a){if(Ext.isEmpty(b,false)){return this.clone()}b=this.createValueMatcher(b,d,a);return this.filterBy(function(e){return e&&b.test(e[c])})},filterBy:function(g,e){var h=new Ext.util.MixedCollection();h.getKey=this.getKey;var b=this.keys,d=this.items;for(var c=0,a=d.length;c<a;c++){if(g.call(e||this,d[c],b[c])){h.add(b[c],d[c])}}return h},findIndex:function(c,b,e,d,a){if(Ext.isEmpty(b,false)){return -1}b=this.createValueMatcher(b,d,a);return this.findIndexBy(function(g){return g&&b.test(g[c])},null,e)},findIndexBy:function(g,e,h){var b=this.keys,d=this.items;for(var c=(h||0),a=d.length;c<a;c++){if(g.call(e||this,d[c],b[c])){return c}}return -1},createValueMatcher:function(c,e,a,b){if(!c.exec){var d=Ext.escapeRe;c=String(c);if(e===true){c=d(c)}else{c="^"+d(c);if(b===true){c+="$"}}c=new RegExp(c,a?"":"i")}return c},clone:function(){var e=new Ext.util.MixedCollection();var b=this.keys,d=this.items;for(var c=0,a=d.length;c<a;c++){e.add(b[c],d[c])}e.getKey=this.getKey;return e}});Ext.util.MixedCollection.prototype.get=Ext.util.MixedCollection.prototype.item;Ext.AbstractManager=Ext.extend(Object,{typeName:"type",constructor:function(a){Ext.apply(this,a||{});this.all=new Ext.util.MixedCollection();this.types={}},get:function(a){return this.all.get(a)},register:function(a){this.all.add(a)},unregister:function(a){this.all.remove(a)},registerType:function(b,a){this.types[b]=a;a[this.typeName]=b},isRegistered:function(a){return this.types[a]!==undefined},create:function(a,d){var b=a[this.typeName]||a.type||d,c=this.types[b];if(c==undefined){throw new Error(String.format("The '{0}' type has not been registered with this manager",b))}return new c(a)},onAvailable:function(d,c,b){var a=this.all;a.on("add",function(e,g){if(g.id==d){c.call(b||g,g);a.un("add",c,b)}})}});Ext.util.Format=function(){var trimRe=/^\s+|\s+$/g,stripTagsRE=/<\/?[^>]+>/gi,stripScriptsRe=/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,nl2brRe=/\r?\n/g;return{ellipsis:function(value,len,word){if(value&&value.length>len){if(word){var vs=value.substr(0,len-2),index=Math.max(vs.lastIndexOf(" "),vs.lastIndexOf("."),vs.lastIndexOf("!"),vs.lastIndexOf("?"));if(index==-1||index<(len-15)){return value.substr(0,len-3)+"..."}else{return vs.substr(0,index)+"..."}}else{return value.substr(0,len-3)+"..."}}return value},undef:function(value){return value!==undefined?value:""},defaultValue:function(value,defaultValue){return value!==undefined&&value!==""?value:defaultValue},htmlEncode:function(value){return !value?value:String(value).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")},htmlDecode:function(value){return !value?value:String(value).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&")},trim:function(value){return String(value).replace(trimRe,"")},substr:function(value,start,length){return String(value).substr(start,length)},lowercase:function(value){return String(value).toLowerCase()},uppercase:function(value){return String(value).toUpperCase()},capitalize:function(value){return !value?value:value.charAt(0).toUpperCase()+value.substr(1).toLowerCase()},call:function(value,fn){if(arguments.length>2){var args=Array.prototype.slice.call(arguments,2);args.unshift(value);return eval(fn).apply(window,args)}else{return eval(fn).call(window,value)}},usMoney:function(v){v=(Math.round((v-0)*100))/100;v=(v==Math.floor(v))?v+".00":((v*10==Math.floor(v*10))?v+"0":v);v=String(v);var ps=v.split("."),whole=ps[0],sub=ps[1]?"."+ps[1]:".00",r=/(\d+)(\d{3})/;while(r.test(whole)){whole=whole.replace(r,"$1,$2")}v=whole+sub;if(v.charAt(0)=="-"){return"-$"+v.substr(1)}return"$"+v},date:function(v,format){if(!v){return""}if(!Ext.isDate(v)){v=new Date(Date.parse(v))}return v.dateFormat(format||"m/d/Y")},dateRenderer:function(format){return function(v){return Ext.util.Format.date(v,format)}},stripTags:function(v){return !v?v:String(v).replace(stripTagsRE,"")},stripScripts:function(v){return !v?v:String(v).replace(stripScriptsRe,"")},fileSize:function(size){if(size<1024){return size+" bytes"}else{if(size<1048576){return(Math.round(((size*10)/1024))/10)+" KB"}else{return(Math.round(((size*10)/1048576))/10)+" MB"}}},math:function(){var fns={};return function(v,a){if(!fns[a]){fns[a]=new Function("v","return v "+a+";")}return fns[a](v)}}(),round:function(value,precision){var result=Number(value);if(typeof precision=="number"){precision=Math.pow(10,precision);result=Math.round(value*precision)/precision}return result},number:function(v,format){if(!format){return v}v=Ext.num(v,NaN);if(isNaN(v)){return""}var comma=",",dec=".",i18n=false,neg=v<0;v=Math.abs(v);if(format.substr(format.length-2)=="/i"){format=format.substr(0,format.length-2);i18n=true;comma=".";dec=","}var hasComma=format.indexOf(comma)!=-1,psplit=(i18n?format.replace(/[^\d\,]/g,""):format.replace(/[^\d\.]/g,"")).split(dec);if(1<psplit.length){v=v.toFixed(psplit[1].length)}else{if(2<psplit.length){throw ("NumberFormatException: invalid format, formats should have no more than 1 period: "+format)}else{v=v.toFixed(0)}}var fnum=v.toString();psplit=fnum.split(".");if(hasComma){var cnum=psplit[0],parr=[],j=cnum.length,m=Math.floor(j/3),n=cnum.length%3||3,i;for(i=0;i<j;i+=n){if(i!=0){n=3}parr[parr.length]=cnum.substr(i,n);m-=1}fnum=parr.join(comma);if(psplit[1]){fnum+=dec+psplit[1]}}else{if(psplit[1]){fnum=psplit[0]+dec+psplit[1]}}return(neg?"-":"")+format.replace(/[\d,?\.?]+/,fnum)},numberRenderer:function(format){return function(v){return Ext.util.Format.number(v,format)}},plural:function(v,s,p){return v+" "+(v==1?s:(p?p:s+"s"))},nl2br:function(v){return Ext.isEmpty(v)?"":v.replace(nl2brRe,"<br/>")}}}();Ext.XTemplate=function(){Ext.XTemplate.superclass.constructor.apply(this,arguments);var z=this,k=z.html,r=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,d=/^<tpl\b[^>]*?for="(.*?)"/,w=/^<tpl\b[^>]*?if="(.*?)"/,y=/^<tpl\b[^>]*?exec="(.*?)"/,t,q=0,l=[],p="values",x="parent",n="xindex",o="xcount",e="return ",c="with(values){ ";k=["<tpl>",k,"</tpl>"].join("");while((t=k.match(r))){var b=t[0].match(d),a=t[0].match(w),B=t[0].match(y),g=null,h=null,u=null,A=b&&b[1]?b[1]:"";if(a){g=a&&a[1]?a[1]:null;if(g){h=new Function(p,x,n,o,c+e+(Ext.util.Format.htmlDecode(g))+"; }")}}if(B){g=B&&B[1]?B[1]:null;if(g){u=new Function(p,x,n,o,c+(Ext.util.Format.htmlDecode(g))+"; }")}}if(A){switch(A){case".":A=new Function(p,x,c+e+p+"; }");break;case"..":A=new Function(p,x,c+e+x+"; }");break;default:A=new Function(p,x,c+e+A+"; }")}}l.push({id:q,target:A,exec:u,test:h,body:t[1]||""});k=k.replace(t[0],"{xtpl"+q+"}");++q}for(var v=l.length-1;v>=0;--v){z.compileTpl(l[v])}z.master=l[l.length-1];z.tpls=l};Ext.extend(Ext.XTemplate,Ext.Template,{re:/\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,codeRe:/\{\[((?:\\\]|.|\n)*?)\]\}/g,applySubTemplate:function(a,l,k,d,c){var h=this,g,n=h.tpls[a],m,b=[];if((n.test&&!n.test.call(h,l,k,d,c))||(n.exec&&n.exec.call(h,l,k,d,c))){return""}m=n.target?n.target.call(h,l,k):l;g=m.length;k=n.target?l:k;if(n.target&&Ext.isArray(m)){for(var e=0,g=m.length;e<g;e++){b[b.length]=n.compiled.call(h,m[e],k,e+1,g)}return b.join("")}return n.compiled.call(h,m,k,d,c)},compileTpl:function(tpl){var fm=Ext.util.Format,useF=this.disableFormats!==true,sep=Ext.isGecko?"+":",",body;function fn(m,name,format,args,math){if(name.substr(0,4)=="xtpl"){return"'"+sep+"this.applySubTemplate("+name.substr(4)+", values, parent, xindex, xcount)"+sep+"'"}var v;if(name==="."){v="values"}else{if(name==="#"){v="xindex"}else{if(name.indexOf(".")!=-1){v=name}else{v="values['"+name+"']"}}}if(math){v="("+v+math+")"}if(format&&useF){args=args?","+args:"";if(format.substr(0,5)!="this."){format="fm."+format+"("}else{format='this.call("'+format.substr(5)+'", ';args=", values"}}else{args="";format="("+v+" === undefined ? '' : "}return"'"+sep+format+v+args+")"+sep+"'"}function codeFn(m,code){return"'"+sep+"("+code.replace(/\\'/g,"'")+")"+sep+"'"}if(Ext.isGecko){body="tpl.compiled = function(values, parent, xindex, xcount){ return '"+tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn)+"';};"}else{body=["tpl.compiled = function(values, parent, xindex, xcount){ return ['"];body.push(tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn));body.push("'].join('');};");body=body.join("")}eval(body);return this},applyTemplate:function(a){return this.master.compiled.call(this,a,{},1,1)},compile:function(){return this}});Ext.XTemplate.prototype.apply=Ext.XTemplate.prototype.applyTemplate;Ext.XTemplate.from=function(a){a=Ext.getDom(a);return new Ext.XTemplate(a.value||a.innerHTML)};Ext.util.CSS=function(){var d=null;var c=document;var b=/(-[a-z])/gi;var a=function(e,g){return g.charAt(1).toUpperCase()};return{createStyleSheet:function(i,m){var h;var g=c.getElementsByTagName("head")[0];var l=c.createElement("style");l.setAttribute("type","text/css");if(m){l.setAttribute("id",m)}if(Ext.isIE){g.appendChild(l);h=l.styleSheet;h.cssText=i}else{try{l.appendChild(c.createTextNode(i))}catch(k){l.cssText=i}g.appendChild(l);h=l.styleSheet?l.styleSheet:(l.sheet||c.styleSheets[c.styleSheets.length-1])}this.cacheStyleSheet(h);return h},removeStyleSheet:function(g){var e=c.getElementById(g);if(e){e.parentNode.removeChild(e)}},swapStyleSheet:function(h,e){this.removeStyleSheet(h);var g=c.createElement("link");g.setAttribute("rel","stylesheet");g.setAttribute("type","text/css");g.setAttribute("id",h);g.setAttribute("href",e);c.getElementsByTagName("head")[0].appendChild(g)},refreshCache:function(){return this.getRules(true)},cacheStyleSheet:function(h){if(!d){d={}}try{var k=h.cssRules||h.rules;for(var g=k.length-1;g>=0;--g){d[k[g].selectorText.toLowerCase()]=k[g]}}catch(i){}},getRules:function(h){if(d===null||h){d={};var l=c.styleSheets;for(var k=0,g=l.length;k<g;k++){try{this.cacheStyleSheet(l[k])}catch(m){}}}return d},getRule:function(e,h){var g=this.getRules(h);if(!Ext.isArray(e)){return g[e.toLowerCase()]}for(var k=0;k<e.length;k++){if(g[e[k]]){return g[e[k].toLowerCase()]}}return null},updateRule:function(e,k,h){if(!Ext.isArray(e)){var l=this.getRule(e);if(l){l.style[k.replace(b,a)]=h;return true}}else{for(var g=0;g<e.length;g++){if(this.updateRule(e[g],k,h)){return true}}}return false}}}();Ext.util.ClickRepeater=Ext.extend(Ext.util.Observable,{constructor:function(b,a){this.el=Ext.get(b);this.el.unselectable();Ext.apply(this,a);this.addEvents("mousedown","click","mouseup");if(!this.disabled){this.disabled=true;this.enable()}if(this.handler){this.on("click",this.handler,this.scope||this)}Ext.util.ClickRepeater.superclass.constructor.call(this)},interval:20,delay:250,preventDefault:true,stopDefault:false,timer:0,enable:function(){if(this.disabled){this.el.on("mousedown",this.handleMouseDown,this);if(Ext.isIE){this.el.on("dblclick",this.handleDblClick,this)}if(this.preventDefault||this.stopDefault){this.el.on("click",this.eventOptions,this)}}this.disabled=false},disable:function(a){if(a||!this.disabled){clearTimeout(this.timer);if(this.pressClass){this.el.removeClass(this.pressClass)}Ext.getDoc().un("mouseup",this.handleMouseUp,this);this.el.removeAllListeners()}this.disabled=true},setDisabled:function(a){this[a?"disable":"enable"]()},eventOptions:function(a){if(this.preventDefault){a.preventDefault()}if(this.stopDefault){a.stopEvent()}},destroy:function(){this.disable(true);Ext.destroy(this.el);this.purgeListeners()},handleDblClick:function(a){clearTimeout(this.timer);this.el.blur();this.fireEvent("mousedown",this,a);this.fireEvent("click",this,a)},handleMouseDown:function(a){clearTimeout(this.timer);this.el.blur();if(this.pressClass){this.el.addClass(this.pressClass)}this.mousedownTime=new Date();Ext.getDoc().on("mouseup",this.handleMouseUp,this);this.el.on("mouseout",this.handleMouseOut,this);this.fireEvent("mousedown",this,a);this.fireEvent("click",this,a);if(this.accelerate){this.delay=400}this.timer=this.click.defer(this.delay||this.interval,this,[a])},click:function(a){this.fireEvent("click",this,a);this.timer=this.click.defer(this.accelerate?this.easeOutExpo(this.mousedownTime.getElapsed(),400,-390,12000):this.interval,this,[a])},easeOutExpo:function(e,a,h,g){return(e==g)?a+h:h*(-Math.pow(2,-10*e/g)+1)+a},handleMouseOut:function(){clearTimeout(this.timer);if(this.pressClass){this.el.removeClass(this.pressClass)}this.el.on("mouseover",this.handleMouseReturn,this)},handleMouseReturn:function(){this.el.un("mouseover",this.handleMouseReturn,this);if(this.pressClass){this.el.addClass(this.pressClass)}this.click()},handleMouseUp:function(a){clearTimeout(this.timer);this.el.un("mouseover",this.handleMouseReturn,this);this.el.un("mouseout",this.handleMouseOut,this);Ext.getDoc().un("mouseup",this.handleMouseUp,this);this.el.removeClass(this.pressClass);this.fireEvent("mouseup",this,a)}});Ext.KeyNav=function(b,a){this.el=Ext.get(b);Ext.apply(this,a);if(!this.disabled){this.disabled=true;this.enable()}};Ext.KeyNav.prototype={disabled:false,defaultEventAction:"stopEvent",forceKeyDown:false,relay:function(c){var a=c.getKey(),b=this.keyToHandler[a];if(b&&this[b]){if(this.doRelay(c,this[b],b)!==true){c[this.defaultEventAction]()}}},doRelay:function(c,b,a){return b.call(this.scope||this,c,a)},enter:false,left:false,right:false,up:false,down:false,tab:false,esc:false,pageUp:false,pageDown:false,del:false,home:false,end:false,keyToHandler:{37:"left",39:"right",38:"up",40:"down",33:"pageUp",34:"pageDown",46:"del",36:"home",35:"end",13:"enter",27:"esc",9:"tab"},stopKeyUp:function(b){var a=b.getKey();if(a>=37&&a<=40){b.stopEvent()}},destroy:function(){this.disable()},enable:function(){if(this.disabled){if(Ext.isSafari2){this.el.on("keyup",this.stopKeyUp,this)}this.el.on(this.isKeydown()?"keydown":"keypress",this.relay,this);this.disabled=false}},disable:function(){if(!this.disabled){if(Ext.isSafari2){this.el.un("keyup",this.stopKeyUp,this)}this.el.un(this.isKeydown()?"keydown":"keypress",this.relay,this);this.disabled=true}},setDisabled:function(a){this[a?"disable":"enable"]()},isKeydown:function(){return this.forceKeyDown||Ext.EventManager.useKeydown}};Ext.KeyMap=function(c,b,a){this.el=Ext.get(c);this.eventName=a||"keydown";this.bindings=[];if(b){this.addBinding(b)}this.enable()};Ext.KeyMap.prototype={stopEvent:false,addBinding:function(b){if(Ext.isArray(b)){Ext.each(b,function(m){this.addBinding(m)},this);return}var k=b.key,g=b.fn||b.handler,l=b.scope;if(b.stopEvent){this.stopEvent=b.stopEvent}if(typeof k=="string"){var h=[];var e=k.toUpperCase();for(var c=0,d=e.length;c<d;c++){h.push(e.charCodeAt(c))}k=h}var a=Ext.isArray(k);var i=function(p){if(this.checkModifiers(b,p)){var n=p.getKey();if(a){for(var o=0,m=k.length;o<m;o++){if(k[o]==n){if(this.stopEvent){p.stopEvent()}g.call(l||window,n,p);return}}}else{if(n==k){if(this.stopEvent){p.stopEvent()}g.call(l||window,n,p)}}}};this.bindings.push(i)},checkModifiers:function(b,h){var k,d,g=["shift","ctrl","alt"];for(var c=0,a=g.length;c<a;++c){d=g[c];k=b[d];if(!(k===undefined||(k===h[d+"Key"]))){return false}}return true},on:function(b,d,c){var h,a,e,g;if(typeof b=="object"&&!Ext.isArray(b)){h=b.key;a=b.shift;e=b.ctrl;g=b.alt}else{h=b}this.addBinding({key:h,shift:a,ctrl:e,alt:g,fn:d,scope:c})},handleKeyDown:function(g){if(this.enabled){var c=this.bindings;for(var d=0,a=c.length;d<a;d++){c[d].call(this,g)}}},isEnabled:function(){return this.enabled},enable:function(){if(!this.enabled){this.el.on(this.eventName,this.handleKeyDown,this);this.enabled=true}},disable:function(){if(this.enabled){this.el.removeListener(this.eventName,this.handleKeyDown,this);this.enabled=false}},setDisabled:function(a){this[a?"disable":"enable"]()}};Ext.util.TextMetrics=function(){var a;return{measure:function(b,c,d){if(!a){a=Ext.util.TextMetrics.Instance(b,d)}a.bind(b);a.setFixedWidth(d||"auto");return a.getSize(c)},createInstance:function(b,c){return Ext.util.TextMetrics.Instance(b,c)}}}();Ext.util.TextMetrics.Instance=function(b,d){var c=new Ext.Element(document.createElement("div"));document.body.appendChild(c.dom);c.position("absolute");c.setLeftTop(-1000,-1000);c.hide();if(d){c.setWidth(d)}var a={getSize:function(g){c.update(g);var e=c.getSize();c.update("");return e},bind:function(e){c.setStyle(Ext.fly(e).getStyles("font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"))},setFixedWidth:function(e){c.setWidth(e)},getWidth:function(e){c.dom.style.width="auto";return this.getSize(e).width},getHeight:function(e){return this.getSize(e).height}};a.bind(b);return a};Ext.Element.addMethods({getTextWidth:function(c,b,a){return(Ext.util.TextMetrics.measure(this.dom,Ext.value(c,this.dom.innerHTML,true)).width).constrain(b||0,a||1000000)}});Ext.util.Cookies={set:function(c,e){var a=arguments;var i=arguments.length;var b=(i>2)?a[2]:null;var h=(i>3)?a[3]:"/";var d=(i>4)?a[4]:null;var g=(i>5)?a[5]:false;document.cookie=c+"="+escape(e)+((b===null)?"":("; expires="+b.toGMTString()))+((h===null)?"":("; path="+h))+((d===null)?"":("; domain="+d))+((g===true)?"; secure":"")},get:function(d){var b=d+"=";var g=b.length;var a=document.cookie.length;var e=0;var c=0;while(e<a){c=e+g;if(document.cookie.substring(e,c)==b){return Ext.util.Cookies.getCookieVal(c)}e=document.cookie.indexOf(" ",e)+1;if(e===0){break}}return null},clear:function(a){if(Ext.util.Cookies.get(a)){document.cookie=a+"=; expires=Thu, 01-Jan-70 00:00:01 GMT"}},getCookieVal:function(b){var a=document.cookie.indexOf(";",b);if(a==-1){a=document.cookie.length}return unescape(document.cookie.substring(b,a))}};Ext.handleError=function(a){throw a};Ext.Error=function(a){this.message=(this.lang[a])?this.lang[a]:a};Ext.Error.prototype=new Error();Ext.apply(Ext.Error.prototype,{lang:{},name:"Ext.Error",getName:function(){return this.name},getMessage:function(){return this.message},toJson:function(){return Ext.encode(this)}});Ext.ComponentMgr=function(){var c=new Ext.util.MixedCollection();var b={};var a={};return{register:function(d){c.add(d)},unregister:function(d){c.remove(d)},get:function(d){return c.get(d)},onAvailable:function(g,e,d){c.on("add",function(h,i){if(i.id==g){e.call(d||i,i);c.un("add",e,d)}})},all:c,types:b,ptypes:a,isRegistered:function(d){return b[d]!==undefined},isPluginRegistered:function(d){return a[d]!==undefined},registerType:function(e,d){b[e]=d;d.xtype=e},create:function(d,e){return d.render?d:new b[d.xtype||e](d)},registerPlugin:function(e,d){a[e]=d;d.ptype=e},createPlugin:function(e,g){var d=a[e.ptype||g];if(d.init){return d}else{return new d(e)}}}}();Ext.reg=Ext.ComponentMgr.registerType;Ext.preg=Ext.ComponentMgr.registerPlugin;Ext.create=Ext.ComponentMgr.create;Ext.Component=function(b){b=b||{};if(b.initialConfig){if(b.isAction){this.baseAction=b}b=b.initialConfig}else{if(b.tagName||b.dom||Ext.isString(b)){b={applyTo:b,id:b.id||b}}}this.initialConfig=b;Ext.apply(this,b);this.addEvents("added","disable","enable","beforeshow","show","beforehide","hide","removed","beforerender","render","afterrender","beforedestroy","destroy","beforestaterestore","staterestore","beforestatesave","statesave");this.getId();Ext.ComponentMgr.register(this);Ext.Component.superclass.constructor.call(this);if(this.baseAction){this.baseAction.addComponent(this)}this.initComponent();if(this.plugins){if(Ext.isArray(this.plugins)){for(var c=0,a=this.plugins.length;c<a;c++){this.plugins[c]=this.initPlugin(this.plugins[c])}}else{this.plugins=this.initPlugin(this.plugins)}}if(this.stateful!==false){this.initState()}if(this.applyTo){this.applyToMarkup(this.applyTo);delete this.applyTo}else{if(this.renderTo){this.render(this.renderTo);delete this.renderTo}}};Ext.Component.AUTO_ID=1000;Ext.extend(Ext.Component,Ext.util.Observable,{disabled:false,hidden:false,autoEl:"div",disabledClass:"x-item-disabled",allowDomMove:true,autoShow:false,hideMode:"display",hideParent:false,rendered:false,tplWriteMode:"overwrite",bubbleEvents:[],ctype:"Ext.Component",actionMode:"el",getActionEl:function(){return this[this.actionMode]},initPlugin:function(a){if(a.ptype&&!Ext.isFunction(a.init)){a=Ext.ComponentMgr.createPlugin(a)}else{if(Ext.isString(a)){a=Ext.ComponentMgr.createPlugin({ptype:a})}}a.init(this);return a},initComponent:function(){if(this.listeners){this.on(this.listeners);delete this.listeners}this.enableBubble(this.bubbleEvents)},render:function(b,a){if(!this.rendered&&this.fireEvent("beforerender",this)!==false){if(!b&&this.el){this.el=Ext.get(this.el);b=this.el.dom.parentNode;this.allowDomMove=false}this.container=Ext.get(b);if(this.ctCls){this.container.addClass(this.ctCls)}this.rendered=true;if(a!==undefined){if(Ext.isNumber(a)){a=this.container.dom.childNodes[a]}else{a=Ext.getDom(a)}}this.onRender(this.container,a||null);if(this.autoShow){this.el.removeClass(["x-hidden","x-hide-"+this.hideMode])}if(this.cls){this.el.addClass(this.cls);delete this.cls}if(this.style){this.el.applyStyles(this.style);delete this.style}if(this.overCls){this.el.addClassOnOver(this.overCls)}this.fireEvent("render",this);var c=this.getContentTarget();if(this.html){c.update(Ext.DomHelper.markup(this.html));delete this.html}if(this.contentEl){var d=Ext.getDom(this.contentEl);Ext.fly(d).removeClass(["x-hidden","x-hide-display"]);c.appendChild(d)}if(this.tpl){if(!this.tpl.compile){this.tpl=new Ext.XTemplate(this.tpl)}if(this.data){this.tpl[this.tplWriteMode](c,this.data);delete this.data}}this.afterRender(this.container);if(this.hidden){this.doHide()}if(this.disabled){this.disable(true)}if(this.stateful!==false){this.initStateEvents()}this.fireEvent("afterrender",this)}return this},update:function(b,d,a){var c=this.getContentTarget();if(this.tpl&&typeof b!=="string"){this.tpl[this.tplWriteMode](c,b||{})}else{var e=Ext.isObject(b)?Ext.DomHelper.markup(b):b;c.update(e,d,a)}},onAdded:function(a,b){this.ownerCt=a;this.initRef();this.fireEvent("added",this,a,b)},onRemoved:function(){this.removeRef();this.fireEvent("removed",this,this.ownerCt);delete this.ownerCt},initRef:function(){if(this.ref&&!this.refOwner){var d=this.ref.split("/"),c=d.length,b=0,a=this;while(a&&b<c){a=a.ownerCt;++b}if(a){a[this.refName=d[--b]]=this;this.refOwner=a}}},removeRef:function(){if(this.refOwner&&this.refName){delete this.refOwner[this.refName];delete this.refOwner}},initState:function(){if(Ext.state.Manager){var b=this.getStateId();if(b){var a=Ext.state.Manager.get(b);if(a){if(this.fireEvent("beforestaterestore",this,a)!==false){this.applyState(Ext.apply({},a));this.fireEvent("staterestore",this,a)}}}}},getStateId:function(){return this.stateId||((/^(ext-comp-|ext-gen)/).test(String(this.id))?null:this.id)},initStateEvents:function(){if(this.stateEvents){for(var a=0,b;b=this.stateEvents[a];a++){this.on(b,this.saveState,this,{delay:100})}}},applyState:function(a){if(a){Ext.apply(this,a)}},getState:function(){return null},saveState:function(){if(Ext.state.Manager&&this.stateful!==false){var b=this.getStateId();if(b){var a=this.getState();if(this.fireEvent("beforestatesave",this,a)!==false){Ext.state.Manager.set(b,a);this.fireEvent("statesave",this,a)}}}},applyToMarkup:function(a){this.allowDomMove=false;this.el=Ext.get(a);this.render(this.el.dom.parentNode)},addClass:function(a){if(this.el){this.el.addClass(a)}else{this.cls=this.cls?this.cls+" "+a:a}return this},removeClass:function(a){if(this.el){this.el.removeClass(a)}else{if(this.cls){this.cls=this.cls.split(" ").remove(a).join(" ")}}return this},onRender:function(b,a){if(!this.el&&this.autoEl){if(Ext.isString(this.autoEl)){this.el=document.createElement(this.autoEl)}else{var c=document.createElement("div");Ext.DomHelper.overwrite(c,this.autoEl);this.el=c.firstChild}if(!this.el.id){this.el.id=this.getId()}}if(this.el){this.el=Ext.get(this.el);if(this.allowDomMove!==false){b.dom.insertBefore(this.el.dom,a);if(c){Ext.removeNode(c);c=null}}}},getAutoCreate:function(){var a=Ext.isObject(this.autoCreate)?this.autoCreate:Ext.apply({},this.defaultAutoCreate);if(this.id&&!a.id){a.id=this.id}return a},afterRender:Ext.emptyFn,destroy:function(){if(!this.isDestroyed){if(this.fireEvent("beforedestroy",this)!==false){this.destroying=true;this.beforeDestroy();if(this.ownerCt&&this.ownerCt.remove){this.ownerCt.remove(this,false)}if(this.rendered){this.el.remove();if(this.actionMode=="container"||this.removeMode=="container"){this.container.remove()}}if(this.focusTask&&this.focusTask.cancel){this.focusTask.cancel()}this.onDestroy();Ext.ComponentMgr.unregister(this);this.fireEvent("destroy",this);this.purgeListeners();this.destroying=false;this.isDestroyed=true}}},deleteMembers:function(){var b=arguments;for(var c=0,a=b.length;c<a;++c){delete this[b[c]]}},beforeDestroy:Ext.emptyFn,onDestroy:Ext.emptyFn,getEl:function(){return this.el},getContentTarget:function(){return this.el},getId:function(){return this.id||(this.id="ext-comp-"+(++Ext.Component.AUTO_ID))},getItemId:function(){return this.itemId||this.getId()},focus:function(b,a){if(a){this.focusTask=new Ext.util.DelayedTask(this.focus,this,[b,false]);this.focusTask.delay(Ext.isNumber(a)?a:10);return this}if(this.rendered&&!this.isDestroyed){this.el.focus();if(b===true){this.el.dom.select()}}return this},blur:function(){if(this.rendered){this.el.blur()}return this},disable:function(a){if(this.rendered){this.onDisable()}this.disabled=true;if(a!==true){this.fireEvent("disable",this)}return this},onDisable:function(){this.getActionEl().addClass(this.disabledClass);this.el.dom.disabled=true},enable:function(){if(this.rendered){this.onEnable()}this.disabled=false;this.fireEvent("enable",this);return this},onEnable:function(){this.getActionEl().removeClass(this.disabledClass);this.el.dom.disabled=false},setDisabled:function(a){return this[a?"disable":"enable"]()},show:function(){if(this.fireEvent("beforeshow",this)!==false){this.hidden=false;if(this.autoRender){this.render(Ext.isBoolean(this.autoRender)?Ext.getBody():this.autoRender)}if(this.rendered){this.onShow()}this.fireEvent("show",this)}return this},onShow:function(){this.getVisibilityEl().removeClass("x-hide-"+this.hideMode)},hide:function(){if(this.fireEvent("beforehide",this)!==false){this.doHide();this.fireEvent("hide",this)}return this},doHide:function(){this.hidden=true;if(this.rendered){this.onHide()}},onHide:function(){this.getVisibilityEl().addClass("x-hide-"+this.hideMode)},getVisibilityEl:function(){return this.hideParent?this.container:this.getActionEl()},setVisible:function(a){return this[a?"show":"hide"]()},isVisible:function(){return this.rendered&&this.getVisibilityEl().isVisible()},cloneConfig:function(b){b=b||{};var c=b.id||Ext.id();var a=Ext.applyIf(b,this.initialConfig);a.id=c;return new this.constructor(a)},getXType:function(){return this.constructor.xtype},isXType:function(b,a){if(Ext.isFunction(b)){b=b.xtype}else{if(Ext.isObject(b)){b=b.constructor.xtype}}return !a?("/"+this.getXTypes()+"/").indexOf("/"+b+"/")!=-1:this.constructor.xtype==b},getXTypes:function(){var a=this.constructor;if(!a.xtypes){var d=[],b=this;while(b&&b.constructor.xtype){d.unshift(b.constructor.xtype);b=b.constructor.superclass}a.xtypeChain=d;a.xtypes=d.join("/")}return a.xtypes},findParentBy:function(a){for(var b=this.ownerCt;(b!=null)&&!a(b,this);b=b.ownerCt){}return b||null},findParentByType:function(b,a){return this.findParentBy(function(d){return d.isXType(b,a)})},bubble:function(c,b,a){var d=this;while(d){if(c.apply(b||d,a||[d])===false){break}d=d.ownerCt}return this},getPositionEl:function(){return this.positionEl||this.el},purgeListeners:function(){Ext.Component.superclass.purgeListeners.call(this);if(this.mons){this.on("beforedestroy",this.clearMons,this,{single:true})}},clearMons:function(){Ext.each(this.mons,function(a){a.item.un(a.ename,a.fn,a.scope)},this);this.mons=[]},createMons:function(){if(!this.mons){this.mons=[];this.on("beforedestroy",this.clearMons,this,{single:true})}},mon:function(g,b,d,c,a){this.createMons();if(Ext.isObject(b)){var k=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;var i=b;for(var h in i){if(k.test(h)){continue}if(Ext.isFunction(i[h])){this.mons.push({item:g,ename:h,fn:i[h],scope:i.scope});g.on(h,i[h],i.scope,i)}else{this.mons.push({item:g,ename:h,fn:i[h],scope:i.scope});g.on(h,i[h])}}return}this.mons.push({item:g,ename:b,fn:d,scope:c});g.on(b,d,c,a)},mun:function(h,c,g,e){var k,d;this.createMons();for(var b=0,a=this.mons.length;b<a;++b){d=this.mons[b];if(h===d.item&&c==d.ename&&g===d.fn&&e===d.scope){this.mons.splice(b,1);h.un(c,g,e);k=true;break}}return k},nextSibling:function(){if(this.ownerCt){var a=this.ownerCt.items.indexOf(this);if(a!=-1&&a+1<this.ownerCt.items.getCount()){return this.ownerCt.items.itemAt(a+1)}}return null},previousSibling:function(){if(this.ownerCt){var a=this.ownerCt.items.indexOf(this);if(a>0){return this.ownerCt.items.itemAt(a-1)}}return null},getBubbleTarget:function(){return this.ownerCt}});Ext.reg("component",Ext.Component);Ext.Action=Ext.extend(Object,{constructor:function(a){this.initialConfig=a;this.itemId=a.itemId=(a.itemId||a.id||Ext.id());this.items=[]},isAction:true,setText:function(a){this.initialConfig.text=a;this.callEach("setText",[a])},getText:function(){return this.initialConfig.text},setIconClass:function(a){this.initialConfig.iconCls=a;this.callEach("setIconClass",[a])},getIconClass:function(){return this.initialConfig.iconCls},setDisabled:function(a){this.initialConfig.disabled=a;this.callEach("setDisabled",[a])},enable:function(){this.setDisabled(false)},disable:function(){this.setDisabled(true)},isDisabled:function(){return this.initialConfig.disabled},setHidden:function(a){this.initialConfig.hidden=a;this.callEach("setVisible",[!a])},show:function(){this.setHidden(false)},hide:function(){this.setHidden(true)},isHidden:function(){return this.initialConfig.hidden},setHandler:function(b,a){this.initialConfig.handler=b;this.initialConfig.scope=a;this.callEach("setHandler",[b,a])},each:function(b,a){Ext.each(this.items,b,a)},callEach:function(e,b){var d=this.items;for(var c=0,a=d.length;c<a;c++){d[c][e].apply(d[c],b)}},addComponent:function(a){this.items.push(a);a.on("destroy",this.removeComponent,this)},removeComponent:function(a){this.items.remove(a)},execute:function(){this.initialConfig.handler.apply(this.initialConfig.scope||window,arguments)}});(function(){Ext.Layer=function(d,c){d=d||{};var e=Ext.DomHelper,h=d.parentEl,g=h?Ext.getDom(h):document.body;if(c){this.dom=Ext.getDom(c)}if(!this.dom){var i=d.dh||{tag:"div",cls:"x-layer"};this.dom=e.append(g,i)}if(d.cls){this.addClass(d.cls)}this.constrain=d.constrain!==false;this.setVisibilityMode(Ext.Element.VISIBILITY);if(d.id){this.id=this.dom.id=d.id}else{this.id=Ext.id(this.dom)}this.zindex=d.zindex||this.getZIndex();this.position("absolute",this.zindex);if(d.shadow){this.shadowOffset=d.shadowOffset||4;this.shadow=new Ext.Shadow({offset:this.shadowOffset,mode:d.shadow})}else{this.shadowOffset=0}this.useShim=d.shim!==false&&Ext.useShims;this.useDisplay=d.useDisplay;this.hide()};var a=Ext.Element.prototype;var b=[];Ext.extend(Ext.Layer,Ext.Element,{getZIndex:function(){return this.zindex||parseInt((this.getShim()||this).getStyle("z-index"),10)||11000},getShim:function(){if(!this.useShim){return null}if(this.shim){return this.shim}var d=b.shift();if(!d){d=this.createShim();d.enableDisplayMode("block");d.dom.style.display="none";d.dom.style.visibility="visible"}var c=this.dom.parentNode;if(d.dom.parentNode!=c){c.insertBefore(d.dom,this.dom)}d.setStyle("z-index",this.getZIndex()-2);this.shim=d;return d},hideShim:function(){if(this.shim){this.shim.setDisplayed(false);b.push(this.shim);delete this.shim}},disableShadow:function(){if(this.shadow){this.shadowDisabled=true;this.shadow.hide();this.lastShadowOffset=this.shadowOffset;this.shadowOffset=0}},enableShadow:function(c){if(this.shadow){this.shadowDisabled=false;this.shadowOffset=this.lastShadowOffset;delete this.lastShadowOffset;if(c){this.sync(true)}}},sync:function(d){var o=this.shadow;if(!this.updating&&this.isVisible()&&(o||this.useShim)){var i=this.getShim(),n=this.getWidth(),k=this.getHeight(),e=this.getLeft(true),p=this.getTop(true);if(o&&!this.shadowDisabled){if(d&&!o.isVisible()){o.show(this)}else{o.realign(e,p,n,k)}if(i){if(d){i.show()}var m=o.el.getXY(),g=i.dom.style,c=o.el.getSize();g.left=(m[0])+"px";g.top=(m[1])+"px";g.width=(c.width)+"px";g.height=(c.height)+"px"}}else{if(i){if(d){i.show()}i.setSize(n,k);i.setLeftTop(e,p)}}}},destroy:function(){this.hideShim();if(this.shadow){this.shadow.hide()}this.removeAllListeners();Ext.removeNode(this.dom);delete this.dom},remove:function(){this.destroy()},beginUpdate:function(){this.updating=true},endUpdate:function(){this.updating=false;this.sync(true)},hideUnders:function(c){if(this.shadow){this.shadow.hide()}this.hideShim()},constrainXY:function(){if(this.constrain){var k=Ext.lib.Dom.getViewWidth(),d=Ext.lib.Dom.getViewHeight();var p=Ext.getDoc().getScroll();var o=this.getXY();var l=o[0],i=o[1];var c=this.shadowOffset;var m=this.dom.offsetWidth+c,e=this.dom.offsetHeight+c;var g=false;if((l+m)>k+p.left){l=k-m-c;g=true}if((i+e)>d+p.top){i=d-e-c;g=true}if(l<p.left){l=p.left;g=true}if(i<p.top){i=p.top;g=true}if(g){if(this.avoidY){var n=this.avoidY;if(i<=n&&(i+e)>=n){i=n-e-5}}o=[l,i];this.storeXY(o);a.setXY.call(this,o);this.sync()}}return this},getConstrainOffset:function(){return this.shadowOffset},isVisible:function(){return this.visible},showAction:function(){this.visible=true;if(this.useDisplay===true){this.setDisplayed("")}else{if(this.lastXY){a.setXY.call(this,this.lastXY)}else{if(this.lastLT){a.setLeftTop.call(this,this.lastLT[0],this.lastLT[1])}}}},hideAction:function(){this.visible=false;if(this.useDisplay===true){this.setDisplayed(false)}else{this.setLeftTop(-10000,-10000)}},setVisible:function(i,h,l,m,k){if(i){this.showAction()}if(h&&i){var g=function(){this.sync(true);if(m){m()}}.createDelegate(this);a.setVisible.call(this,true,true,l,g,k)}else{if(!i){this.hideUnders(true)}var g=m;if(h){g=function(){this.hideAction();if(m){m()}}.createDelegate(this)}a.setVisible.call(this,i,h,l,g,k);if(i){this.sync(true)}else{if(!h){this.hideAction()}}}return this},storeXY:function(c){delete this.lastLT;this.lastXY=c},storeLeftTop:function(d,c){delete this.lastXY;this.lastLT=[d,c]},beforeFx:function(){this.beforeAction();return Ext.Layer.superclass.beforeFx.apply(this,arguments)},afterFx:function(){Ext.Layer.superclass.afterFx.apply(this,arguments);this.sync(this.isVisible())},beforeAction:function(){if(!this.updating&&this.shadow){this.shadow.hide()}},setLeft:function(c){this.storeLeftTop(c,this.getTop(true));a.setLeft.apply(this,arguments);this.sync();return this},setTop:function(c){this.storeLeftTop(this.getLeft(true),c);a.setTop.apply(this,arguments);this.sync();return this},setLeftTop:function(d,c){this.storeLeftTop(d,c);a.setLeftTop.apply(this,arguments);this.sync();return this},setXY:function(k,h,l,m,i){this.fixDisplay();this.beforeAction();this.storeXY(k);var g=this.createCB(m);a.setXY.call(this,k,h,l,g,i);if(!h){g()}return this},createCB:function(e){var d=this;return function(){d.constrainXY();d.sync(true);if(e){e()}}},setX:function(g,h,k,l,i){this.setXY([g,this.getY()],h,k,l,i);return this},setY:function(l,g,i,k,h){this.setXY([this.getX(),l],g,i,k,h);return this},setSize:function(k,l,i,n,o,m){this.beforeAction();var g=this.createCB(o);a.setSize.call(this,k,l,i,n,g,m);if(!i){g()}return this},setWidth:function(i,h,l,m,k){this.beforeAction();var g=this.createCB(m);a.setWidth.call(this,i,h,l,g,k);if(!h){g()}return this},setHeight:function(k,i,m,n,l){this.beforeAction();var g=this.createCB(n);a.setHeight.call(this,k,i,m,g,l);if(!i){g()}return this},setBounds:function(p,n,q,i,o,l,m,k){this.beforeAction();var g=this.createCB(m);if(!o){this.storeXY([p,n]);a.setXY.call(this,[p,n]);a.setSize.call(this,q,i,o,l,g,k);g()}else{a.setBounds.call(this,p,n,q,i,o,l,g,k)}return this},setZIndex:function(c){this.zindex=c;this.setStyle("z-index",c+2);if(this.shadow){this.shadow.setZIndex(c+1)}if(this.shim){this.shim.setStyle("z-index",c)}return this}})})();Ext.Shadow=function(d){Ext.apply(this,d);if(typeof this.mode!="string"){this.mode=this.defaultMode}var e=this.offset,c={h:0},b=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case"drop":c.w=0;c.l=c.t=e;c.t-=1;if(Ext.isIE){c.l-=this.offset+b;c.t-=this.offset+b;c.w-=b;c.h-=b;c.t+=1}break;case"sides":c.w=(e*2);c.l=-e;c.t=e-1;if(Ext.isIE){c.l-=(this.offset-b);c.t-=this.offset+b;c.l+=1;c.w-=(this.offset-b)*2;c.w-=b+1;c.h-=1}break;case"frame":c.w=c.h=(e*2);c.l=c.t=-e;c.t+=1;c.h-=2;if(Ext.isIE){c.l-=(this.offset-b);c.t-=(this.offset-b);c.l+=1;c.w-=(this.offset+b+1);c.h-=(this.offset+b);c.h+=1}break}this.adjusts=c};Ext.Shadow.prototype={offset:4,defaultMode:"drop",show:function(a){a=Ext.get(a);if(!this.el){this.el=Ext.Shadow.Pool.pull();if(this.el.dom.nextSibling!=a.dom){this.el.insertBefore(a)}}this.el.setStyle("z-index",this.zIndex||parseInt(a.getStyle("z-index"),10)-1);if(Ext.isIE){this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")"}this.realign(a.getLeft(true),a.getTop(true),a.getWidth(),a.getHeight());this.el.dom.style.display="block"},isVisible:function(){return this.el?true:false},realign:function(b,u,r,g){if(!this.el){return}var o=this.adjusts,m=this.el.dom,v=m.style,i=0,q=(r+o.w),e=(g+o.h),k=q+"px",p=e+"px",n,c;v.left=(b+o.l)+"px";v.top=(u+o.t)+"px";if(v.width!=k||v.height!=p){v.width=k;v.height=p;if(!Ext.isIE){n=m.childNodes;c=Math.max(0,(q-12))+"px";n[0].childNodes[1].style.width=c;n[1].childNodes[1].style.width=c;n[2].childNodes[1].style.width=c;n[1].style.height=Math.max(0,(e-12))+"px"}}},hide:function(){if(this.el){this.el.dom.style.display="none";Ext.Shadow.Pool.push(this.el);delete this.el}},setZIndex:function(a){this.zIndex=a;if(this.el){this.el.setStyle("z-index",a)}}};Ext.Shadow.Pool=function(){var b=[],a=Ext.isIE?'<div class="x-ie-shadow"></div>':'<div class="x-shadow"><div class="xst"><div class="xstl"></div><div class="xstc"></div><div class="xstr"></div></div><div class="xsc"><div class="xsml"></div><div class="xsmc"></div><div class="xsmr"></div></div><div class="xsb"><div class="xsbl"></div><div class="xsbc"></div><div class="xsbr"></div></div></div>';return{pull:function(){var c=b.shift();if(!c){c=Ext.get(Ext.DomHelper.insertHtml("beforeBegin",document.body.firstChild,a));c.autoBoxAdjust=false}return c},push:function(c){b.push(c)}}}();Ext.BoxComponent=Ext.extend(Ext.Component,{initComponent:function(){Ext.BoxComponent.superclass.initComponent.call(this);this.addEvents("resize","move")},boxReady:false,deferHeight:false,setSize:function(b,d){if(typeof b=="object"){d=b.height;b=b.width}if(Ext.isDefined(b)&&Ext.isDefined(this.boxMinWidth)&&(b<this.boxMinWidth)){b=this.boxMinWidth}if(Ext.isDefined(d)&&Ext.isDefined(this.boxMinHeight)&&(d<this.boxMinHeight)){d=this.boxMinHeight}if(Ext.isDefined(b)&&Ext.isDefined(this.boxMaxWidth)&&(b>this.boxMaxWidth)){b=this.boxMaxWidth}if(Ext.isDefined(d)&&Ext.isDefined(this.boxMaxHeight)&&(d>this.boxMaxHeight)){d=this.boxMaxHeight}if(!this.boxReady){this.width=b;this.height=d;return this}if(this.cacheSizes!==false&&this.lastSize&&this.lastSize.width==b&&this.lastSize.height==d){return this}this.lastSize={width:b,height:d};var c=this.adjustSize(b,d),g=c.width,a=c.height,e;if(g!==undefined||a!==undefined){e=this.getResizeEl();if(!this.deferHeight&&g!==undefined&&a!==undefined){e.setSize(g,a)}else{if(!this.deferHeight&&a!==undefined){e.setHeight(a)}else{if(g!==undefined){e.setWidth(g)}}}this.onResize(g,a,b,d);this.fireEvent("resize",this,g,a,b,d)}return this},setWidth:function(a){return this.setSize(a)},setHeight:function(a){return this.setSize(undefined,a)},getSize:function(){return this.getResizeEl().getSize()},getWidth:function(){return this.getResizeEl().getWidth()},getHeight:function(){return this.getResizeEl().getHeight()},getOuterSize:function(){var a=this.getResizeEl();return{width:a.getWidth()+a.getMargins("lr"),height:a.getHeight()+a.getMargins("tb")}},getPosition:function(a){var b=this.getPositionEl();if(a===true){return[b.getLeft(true),b.getTop(true)]}return this.xy||b.getXY()},getBox:function(a){var c=this.getPosition(a);var b=this.getSize();b.x=c[0];b.y=c[1];return b},updateBox:function(a){this.setSize(a.width,a.height);this.setPagePosition(a.x,a.y);return this},getResizeEl:function(){return this.resizeEl||this.el},setAutoScroll:function(a){if(this.rendered){this.getContentTarget().setOverflow(a?"auto":"")}this.autoScroll=a;return this},setPosition:function(a,g){if(a&&typeof a[1]=="number"){g=a[1];a=a[0]}this.x=a;this.y=g;if(!this.boxReady){return this}var b=this.adjustPosition(a,g);var e=b.x,d=b.y;var c=this.getPositionEl();if(e!==undefined||d!==undefined){if(e!==undefined&&d!==undefined){c.setLeftTop(e,d)}else{if(e!==undefined){c.setLeft(e)}else{if(d!==undefined){c.setTop(d)}}}this.onPosition(e,d);this.fireEvent("move",this,e,d)}return this},setPagePosition:function(a,c){if(a&&typeof a[1]=="number"){c=a[1];a=a[0]}this.pageX=a;this.pageY=c;if(!this.boxReady){return}if(a===undefined||c===undefined){return}var b=this.getPositionEl().translatePoints(a,c);this.setPosition(b.left,b.top);return this},afterRender:function(){Ext.BoxComponent.superclass.afterRender.call(this);if(this.resizeEl){this.resizeEl=Ext.get(this.resizeEl)}if(this.positionEl){this.positionEl=Ext.get(this.positionEl)}this.boxReady=true;Ext.isDefined(this.autoScroll)&&this.setAutoScroll(this.autoScroll);this.setSize(this.width,this.height);if(this.x||this.y){this.setPosition(this.x,this.y)}else{if(this.pageX||this.pageY){this.setPagePosition(this.pageX,this.pageY)}}},syncSize:function(){delete this.lastSize;this.setSize(this.autoWidth?undefined:this.getResizeEl().getWidth(),this.autoHeight?undefined:this.getResizeEl().getHeight());return this},onResize:function(d,b,a,c){},onPosition:function(a,b){},adjustSize:function(a,b){if(this.autoWidth){a="auto"}if(this.autoHeight){b="auto"}return{width:a,height:b}},adjustPosition:function(a,b){return{x:a,y:b}}});Ext.reg("box",Ext.BoxComponent);Ext.Spacer=Ext.extend(Ext.BoxComponent,{autoEl:"div"});Ext.reg("spacer",Ext.Spacer);Ext.SplitBar=function(c,e,b,d,a){this.el=Ext.get(c,true);this.el.dom.unselectable="on";this.resizingEl=Ext.get(e,true);this.orientation=b||Ext.SplitBar.HORIZONTAL;this.minSize=0;this.maxSize=2000;this.animate=false;this.useShim=false;this.shim=null;if(!a){this.proxy=Ext.SplitBar.createProxy(this.orientation)}else{this.proxy=Ext.get(a).dom}this.dd=new Ext.dd.DDProxy(this.el.dom.id,"XSplitBars",{dragElId:this.proxy.id});this.dd.b4StartDrag=this.onStartProxyDrag.createDelegate(this);this.dd.endDrag=this.onEndProxyDrag.createDelegate(this);this.dragSpecs={};this.adapter=new Ext.SplitBar.BasicLayoutAdapter();this.adapter.init(this);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.placement=d||(this.el.getX()>this.resizingEl.getX()?Ext.SplitBar.LEFT:Ext.SplitBar.RIGHT);this.el.addClass("x-splitbar-h")}else{this.placement=d||(this.el.getY()>this.resizingEl.getY()?Ext.SplitBar.TOP:Ext.SplitBar.BOTTOM);this.el.addClass("x-splitbar-v")}this.addEvents("resize","moved","beforeresize","beforeapply");Ext.SplitBar.superclass.constructor.call(this)};Ext.extend(Ext.SplitBar,Ext.util.Observable,{onStartProxyDrag:function(a,e){this.fireEvent("beforeresize",this);this.overlay=Ext.DomHelper.append(document.body,{cls:"x-drag-overlay",html:"&#160;"},true);this.overlay.unselectable();this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();Ext.get(this.proxy).setDisplayed("block");var c=this.adapter.getElementSize(this);this.activeMinSize=this.getMinimumSize();this.activeMaxSize=this.getMaximumSize();var d=c-this.activeMinSize;var b=Math.max(this.activeMaxSize-c,0);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.dd.resetConstraints();this.dd.setXConstraint(this.placement==Ext.SplitBar.LEFT?d:b,this.placement==Ext.SplitBar.LEFT?b:d,this.tickSize);this.dd.setYConstraint(0,0)}else{this.dd.resetConstraints();this.dd.setXConstraint(0,0);this.dd.setYConstraint(this.placement==Ext.SplitBar.TOP?d:b,this.placement==Ext.SplitBar.TOP?b:d,this.tickSize)}this.dragSpecs.startSize=c;this.dragSpecs.startPoint=[a,e];Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd,a,e)},onEndProxyDrag:function(c){Ext.get(this.proxy).setDisplayed(false);var b=Ext.lib.Event.getXY(c);if(this.overlay){Ext.destroy(this.overlay);delete this.overlay}var a;if(this.orientation==Ext.SplitBar.HORIZONTAL){a=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.LEFT?b[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-b[0])}else{a=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.TOP?b[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-b[1])}a=Math.min(Math.max(a,this.activeMinSize),this.activeMaxSize);if(a!=this.dragSpecs.startSize){if(this.fireEvent("beforeapply",this,a)!==false){this.adapter.setElementSize(this,a);this.fireEvent("moved",this,a);this.fireEvent("resize",this,a)}}},getAdapter:function(){return this.adapter},setAdapter:function(a){this.adapter=a;this.adapter.init(this)},getMinimumSize:function(){return this.minSize},setMinimumSize:function(a){this.minSize=a},getMaximumSize:function(){return this.maxSize},setMaximumSize:function(a){this.maxSize=a},setCurrentSize:function(b){var a=this.animate;this.animate=false;this.adapter.setElementSize(this,b);this.animate=a},destroy:function(a){Ext.destroy(this.shim,Ext.get(this.proxy));this.dd.unreg();if(a){this.el.remove()}this.purgeListeners()}});Ext.SplitBar.createProxy=function(b){var c=new Ext.Element(document.createElement("div"));document.body.appendChild(c.dom);c.unselectable();var a="x-splitbar-proxy";c.addClass(a+" "+(b==Ext.SplitBar.HORIZONTAL?a+"-h":a+"-v"));return c.dom};Ext.SplitBar.BasicLayoutAdapter=function(){};Ext.SplitBar.BasicLayoutAdapter.prototype={init:function(a){},getElementSize:function(a){if(a.orientation==Ext.SplitBar.HORIZONTAL){return a.resizingEl.getWidth()}else{return a.resizingEl.getHeight()}},setElementSize:function(b,a,c){if(b.orientation==Ext.SplitBar.HORIZONTAL){if(!b.animate){b.resizingEl.setWidth(a);if(c){c(b,a)}}else{b.resizingEl.setWidth(a,true,0.1,c,"easeOut")}}else{if(!b.animate){b.resizingEl.setHeight(a);if(c){c(b,a)}}else{b.resizingEl.setHeight(a,true,0.1,c,"easeOut")}}}};Ext.SplitBar.AbsoluteLayoutAdapter=function(a){this.basic=new Ext.SplitBar.BasicLayoutAdapter();this.container=Ext.get(a)};Ext.SplitBar.AbsoluteLayoutAdapter.prototype={init:function(a){this.basic.init(a)},getElementSize:function(a){return this.basic.getElementSize(a)},setElementSize:function(b,a,c){this.basic.setElementSize(b,a,this.moveSplitter.createDelegate(this,[b]))},moveSplitter:function(a){var b=Ext.SplitBar;switch(a.placement){case b.LEFT:a.el.setX(a.resizingEl.getRight());break;case b.RIGHT:a.el.setStyle("right",(this.container.getWidth()-a.resizingEl.getLeft())+"px");break;case b.TOP:a.el.setY(a.resizingEl.getBottom());break;case b.BOTTOM:a.el.setY(a.resizingEl.getTop()-a.el.getHeight());break}}};Ext.SplitBar.VERTICAL=1;Ext.SplitBar.HORIZONTAL=2;Ext.SplitBar.LEFT=1;Ext.SplitBar.RIGHT=2;Ext.SplitBar.TOP=3;Ext.SplitBar.BOTTOM=4;Ext.Container=Ext.extend(Ext.BoxComponent,{bufferResize:50,autoDestroy:true,forceLayout:false,defaultType:"panel",resizeEvent:"resize",bubbleEvents:["add","remove"],initComponent:function(){Ext.Container.superclass.initComponent.call(this);this.addEvents("afterlayout","beforeadd","beforeremove","add","remove");var a=this.items;if(a){delete this.items;this.add(a)}},initItems:function(){if(!this.items){this.items=new Ext.util.MixedCollection(false,this.getComponentId);this.getLayout()}},setLayout:function(a){if(this.layout&&this.layout!=a){this.layout.setContainer(null)}this.layout=a;this.initItems();a.setContainer(this)},afterRender:function(){Ext.Container.superclass.afterRender.call(this);if(!this.layout){this.layout="auto"}if(Ext.isObject(this.layout)&&!this.layout.layout){this.layoutConfig=this.layout;this.layout=this.layoutConfig.type}if(Ext.isString(this.layout)){this.layout=new Ext.Container.LAYOUTS[this.layout.toLowerCase()](this.layoutConfig)}this.setLayout(this.layout);if(this.activeItem!==undefined&&this.layout.setActiveItem){var a=this.activeItem;delete this.activeItem;this.layout.setActiveItem(a)}if(!this.ownerCt){this.doLayout(false,true)}if(this.monitorResize===true){Ext.EventManager.onWindowResize(this.doLayout,this,[false])}},getLayoutTarget:function(){return this.el},getComponentId:function(a){return a.getItemId()},add:function(b){this.initItems();var e=arguments.length>1;if(e||Ext.isArray(b)){var a=[];Ext.each(e?arguments:b,function(h){a.push(this.add(h))},this);return a}var g=this.lookupComponent(this.applyDefaults(b));var d=this.items.length;if(this.fireEvent("beforeadd",this,g,d)!==false&&this.onBeforeAdd(g)!==false){this.items.add(g);g.onAdded(this,d);this.onAdd(g);this.fireEvent("add",this,g,d)}return g},onAdd:function(a){},onAdded:function(a,b){this.ownerCt=a;this.initRef();this.cascade(function(d){d.initRef()});this.fireEvent("added",this,a,b)},insert:function(e,b){var d=arguments,h=d.length,a=[],g,k;this.initItems();if(h>2){for(g=h-1;g>=1;--g){a.push(this.insert(e,d[g]))}return a}k=this.lookupComponent(this.applyDefaults(b));e=Math.min(e,this.items.length);if(this.fireEvent("beforeadd",this,k,e)!==false&&this.onBeforeAdd(k)!==false){if(k.ownerCt==this){this.items.remove(k)}this.items.insert(e,k);k.onAdded(this,e);this.onAdd(k);this.fireEvent("add",this,k,e)}return k},applyDefaults:function(b){var a=this.defaults;if(a){if(Ext.isFunction(a)){a=a.call(this,b)}if(Ext.isString(b)){b=Ext.ComponentMgr.get(b);Ext.apply(b,a)}else{if(!b.events){Ext.applyIf(b.isAction?b.initialConfig:b,a)}else{Ext.apply(b,a)}}}return b},onBeforeAdd:function(a){if(a.ownerCt){a.ownerCt.remove(a,false)}if(this.hideBorders===true){a.border=(a.border===true)}},remove:function(a,b){this.initItems();var d=this.getComponent(a);if(d&&this.fireEvent("beforeremove",this,d)!==false){this.doRemove(d,b);this.fireEvent("remove",this,d)}return d},onRemove:function(a){},doRemove:function(e,d){var b=this.layout,a=b&&this.rendered;if(a){b.onRemove(e)}this.items.remove(e);e.onRemoved();this.onRemove(e);if(d===true||(d!==false&&this.autoDestroy)){e.destroy()}if(a){b.afterRemove(e)}},removeAll:function(c){this.initItems();var e,g=[],b=[];this.items.each(function(h){g.push(h)});for(var d=0,a=g.length;d<a;++d){e=g[d];this.remove(e,c);if(e.ownerCt!==this){b.push(e)}}return b},getComponent:function(a){if(Ext.isObject(a)){a=a.getItemId()}return this.items.get(a)},lookupComponent:function(a){if(Ext.isString(a)){return Ext.ComponentMgr.get(a)}else{if(!a.events){return this.createComponent(a)}}return a},createComponent:function(a,d){if(a.render){return a}var b=Ext.create(Ext.apply({ownerCt:this},a),d||this.defaultType);delete b.initialConfig.ownerCt;delete b.ownerCt;return b},canLayout:function(){var a=this.getVisibilityEl();return a&&a.dom&&!a.isStyle("display","none")},doLayout:function(g,e){var l=this.rendered,k=e||this.forceLayout;if(this.collapsed||!this.canLayout()){this.deferLayout=this.deferLayout||!g;if(!k){return}g=g&&!this.deferLayout}else{delete this.deferLayout}if(l&&this.layout){this.layout.layout()}if(g!==true&&this.items){var d=this.items.items;for(var b=0,a=d.length;b<a;b++){var h=d[b];if(h.doLayout){h.doLayout(false,k)}}}if(l){this.onLayout(g,k)}this.hasLayout=true;delete this.forceLayout},onLayout:Ext.emptyFn,shouldBufferLayout:function(){var a=this.hasLayout;if(this.ownerCt){return a?!this.hasLayoutPending():false}return a},hasLayoutPending:function(){var a=false;this.ownerCt.bubble(function(b){if(b.layoutPending){a=true;return false}});return a},onShow:function(){Ext.Container.superclass.onShow.call(this);if(Ext.isDefined(this.deferLayout)){delete this.deferLayout;this.doLayout(true)}},getLayout:function(){if(!this.layout){var a=new Ext.layout.AutoLayout(this.layoutConfig);this.setLayout(a)}return this.layout},beforeDestroy:function(){var a;if(this.items){while(a=this.items.first()){this.doRemove(a,true)}}if(this.monitorResize){Ext.EventManager.removeResizeListener(this.doLayout,this)}Ext.destroy(this.layout);Ext.Container.superclass.beforeDestroy.call(this)},cascade:function(g,e,b){if(g.apply(e||this,b||[this])!==false){if(this.items){var d=this.items.items;for(var c=0,a=d.length;c<a;c++){if(d[c].cascade){d[c].cascade(g,e,b)}else{g.apply(e||d[c],b||[d[c]])}}}}return this},findById:function(c){var a=null,b=this;this.cascade(function(d){if(b!=d&&d.id===c){a=d;return false}});return a},findByType:function(b,a){return this.findBy(function(d){return d.isXType(b,a)})},find:function(b,a){return this.findBy(function(d){return d[b]===a})},findBy:function(d,c){var a=[],b=this;this.cascade(function(e){if(b!=e&&d.call(c||e,e,b)===true){a.push(e)}});return a},get:function(a){return this.getComponent(a)}});Ext.Container.LAYOUTS={};Ext.reg("container",Ext.Container);Ext.layout.ContainerLayout=Ext.extend(Object,{monitorResize:false,activeItem:null,constructor:function(a){this.id=Ext.id(null,"ext-layout-");Ext.apply(this,a)},type:"container",IEMeasureHack:function(l,g){var a=l.dom.childNodes,b=a.length,o,n=[],m,h,k;for(h=0;h<b;h++){o=a[h];m=Ext.get(o);if(m){n[h]=m.getStyle("display");m.setStyle({display:"none"})}}k=l?l.getViewSize(g):{};for(h=0;h<b;h++){o=a[h];m=Ext.get(o);if(m){m.setStyle({display:n[h]})}}return k},getLayoutTargetSize:Ext.EmptyFn,layout:function(){var a=this.container,b=a.getLayoutTarget();if(!(this.hasLayout||Ext.isEmpty(this.targetCls))){b.addClass(this.targetCls)}this.onLayout(a,b);a.fireEvent("afterlayout",a,this)},onLayout:function(a,b){this.renderAll(a,b)},isValidParent:function(b,a){return a&&b.getPositionEl().dom.parentNode==(a.dom||a)},renderAll:function(e,g){var b=e.items.items,d,h,a=b.length;for(d=0;d<a;d++){h=b[d];if(h&&(!h.rendered||!this.isValidParent(h,g))){this.renderItem(h,d,g)}}},renderItem:function(d,a,b){if(d){if(!d.rendered){d.render(b,a);this.configureItem(d)}else{if(!this.isValidParent(d,b)){if(Ext.isNumber(a)){a=b.dom.childNodes[a]}b.dom.insertBefore(d.getPositionEl().dom,a||null);d.container=b;this.configureItem(d)}}}},getRenderedItems:function(g){var e=g.getLayoutTarget(),h=g.items.items,a=h.length,d,k,b=[];for(d=0;d<a;d++){if((k=h[d]).rendered&&this.isValidParent(k,e)&&k.shouldLayout!==false){b.push(k)}}return b},configureItem:function(b){if(this.extraCls){var a=b.getPositionEl?b.getPositionEl():b;a.addClass(this.extraCls)}if(b.doLayout&&this.forceLayout){b.doLayout()}if(this.renderHidden&&b!=this.activeItem){b.hide()}},onRemove:function(b){if(this.activeItem==b){delete this.activeItem}if(b.rendered&&this.extraCls){var a=b.getPositionEl?b.getPositionEl():b;a.removeClass(this.extraCls)}},afterRemove:function(a){if(a.removeRestore){a.removeMode="container";delete a.removeRestore}},onResize:function(){var c=this.container,a;if(c.collapsed){return}if(a=c.bufferResize&&c.shouldBufferLayout()){if(!this.resizeTask){this.resizeTask=new Ext.util.DelayedTask(this.runLayout,this);this.resizeBuffer=Ext.isNumber(a)?a:50}c.layoutPending=true;this.resizeTask.delay(this.resizeBuffer)}else{this.runLayout()}},runLayout:function(){var a=this.container;this.layout();a.onLayout();delete a.layoutPending},setContainer:function(b){if(this.monitorResize&&b!=this.container){var a=this.container;if(a){a.un(a.resizeEvent,this.onResize,this)}if(b){b.on(b.resizeEvent,this.onResize,this)}}this.container=b},parseMargins:function(b){if(Ext.isNumber(b)){b=b.toString()}var c=b.split(" "),a=c.length;if(a==1){c[1]=c[2]=c[3]=c[0]}else{if(a==2){c[2]=c[0];c[3]=c[1]}else{if(a==3){c[3]=c[1]}}}return{top:parseInt(c[0],10)||0,right:parseInt(c[1],10)||0,bottom:parseInt(c[2],10)||0,left:parseInt(c[3],10)||0}},fieldTpl:(function(){var a=new Ext.Template('<div class="x-form-item {itemCls}" tabIndex="-1">','<label for="{id}" style="{labelStyle}" class="x-form-item-label">{label}{labelSeparator}</label>','<div class="x-form-element" id="x-form-el-{id}" style="{elementStyle}">','</div><div class="{clearCls}"></div>',"</div>");a.disableFormats=true;return a.compile()})(),destroy:function(){if(this.resizeTask&&this.resizeTask.cancel){this.resizeTask.cancel()}if(this.container){this.container.un(this.container.resizeEvent,this.onResize,this)}if(!Ext.isEmpty(this.targetCls)){var a=this.container.getLayoutTarget();if(a){a.removeClass(this.targetCls)}}}});Ext.layout.AutoLayout=Ext.extend(Ext.layout.ContainerLayout,{type:"auto",monitorResize:true,onLayout:function(d,g){Ext.layout.AutoLayout.superclass.onLayout.call(this,d,g);var e=this.getRenderedItems(d),a=e.length,b,h;for(b=0;b<a;b++){h=e[b];if(h.doLayout){h.doLayout(true)}}}});Ext.Container.LAYOUTS.auto=Ext.layout.AutoLayout;Ext.layout.FitLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"fit",getLayoutTargetSize:function(){var a=this.container.getLayoutTarget();if(!a){return{}}return a.getStyleSize()},onLayout:function(a,b){Ext.layout.FitLayout.superclass.onLayout.call(this,a,b);if(!a.collapsed){this.setItemSize(this.activeItem||a.items.itemAt(0),this.getLayoutTargetSize())}},setItemSize:function(b,a){if(b&&a.height>0){b.setSize(a)}}});Ext.Container.LAYOUTS.fit=Ext.layout.FitLayout;Ext.layout.CardLayout=Ext.extend(Ext.layout.FitLayout,{deferredRender:false,layoutOnCardChange:false,renderHidden:true,type:"card",setActiveItem:function(d){var a=this.activeItem,b=this.container;d=b.getComponent(d);if(d&&a!=d){if(a){a.hide();if(a.hidden!==true){return false}a.fireEvent("deactivate",a)}var c=d.doLayout&&(this.layoutOnCardChange||!d.rendered);this.activeItem=d;delete d.deferLayout;d.show();this.layout();if(c){d.doLayout()}d.fireEvent("activate",d)}},renderAll:function(a,b){if(this.deferredRender){this.renderItem(this.activeItem,undefined,b)}else{Ext.layout.CardLayout.superclass.renderAll.call(this,a,b)}}});Ext.Container.LAYOUTS.card=Ext.layout.CardLayout;Ext.layout.AnchorLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"anchor",defaultAnchor:"100%",parseAnchorRE:/^(r|right|b|bottom)$/i,getLayoutTargetSize:function(){var b=this.container.getLayoutTarget(),a={};if(b){a=b.getViewSize();if(Ext.isIE&&Ext.isStrict&&a.width==0){a=b.getStyleSize()}a.width-=b.getPadding("lr");a.height-=b.getPadding("tb")}return a},onLayout:function(n,x){Ext.layout.AnchorLayout.superclass.onLayout.call(this,n,x);var q=this.getLayoutTargetSize(),l=q.width,p=q.height,r=x.getStyle("overflow"),o=this.getRenderedItems(n),u=o.length,g=[],k,a,w,m,h,c,e,d,v=0,t,b;if(l<20&&p<20){return}if(n.anchorSize){if(typeof n.anchorSize=="number"){a=n.anchorSize}else{a=n.anchorSize.width;w=n.anchorSize.height}}else{a=n.initialConfig.width;w=n.initialConfig.height}for(t=0;t<u;t++){m=o[t];b=m.getPositionEl();if(!m.anchor&&m.items&&!Ext.isNumber(m.width)&&!(Ext.isIE6&&Ext.isStrict)){m.anchor=this.defaultAnchor}if(m.anchor){h=m.anchorSpec;if(!h){d=m.anchor.split(" ");m.anchorSpec=h={right:this.parseAnchor(d[0],m.initialConfig.width,a),bottom:this.parseAnchor(d[1],m.initialConfig.height,w)}}c=h.right?this.adjustWidthAnchor(h.right(l)-b.getMargins("lr"),m):undefined;e=h.bottom?this.adjustHeightAnchor(h.bottom(p)-b.getMargins("tb"),m):undefined;if(c||e){g.push({component:m,width:c||undefined,height:e||undefined})}}}for(t=0,u=g.length;t<u;t++){k=g[t];k.component.setSize(k.width,k.height)}if(r&&r!="hidden"&&!this.adjustmentPass){var s=this.getLayoutTargetSize();if(s.width!=q.width||s.height!=q.height){this.adjustmentPass=true;this.onLayout(n,x)}}delete this.adjustmentPass},parseAnchor:function(c,h,b){if(c&&c!="none"){var e;if(this.parseAnchorRE.test(c)){var g=b-h;return function(a){if(a!==e){e=a;return a-g}}}else{if(c.indexOf("%")!=-1){var d=parseFloat(c.replace("%",""))*0.01;return function(a){if(a!==e){e=a;return Math.floor(a*d)}}}else{c=parseInt(c,10);if(!isNaN(c)){return function(a){if(a!==e){e=a;return a+c}}}}}}return false},adjustWidthAnchor:function(b,a){return b},adjustHeightAnchor:function(b,a){return b}});Ext.Container.LAYOUTS.anchor=Ext.layout.AnchorLayout;Ext.layout.ColumnLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"column",extraCls:"x-column",scrollOffset:0,targetCls:"x-column-layout-ct",isValidParent:function(b,a){return this.innerCt&&b.getPositionEl().dom.parentNode==this.innerCt.dom},getLayoutTargetSize:function(){var b=this.container.getLayoutTarget(),a;if(b){a=b.getViewSize();if(Ext.isIE&&Ext.isStrict&&a.width==0){a=b.getStyleSize()}a.width-=b.getPadding("lr");a.height-=b.getPadding("tb")}return a},renderAll:function(a,b){if(!this.innerCt){this.innerCt=b.createChild({cls:"x-column-inner"});this.innerCt.createChild({cls:"x-clear"})}Ext.layout.ColumnLayout.superclass.renderAll.call(this,a,this.innerCt)},onLayout:function(e,l){var g=e.items.items,k=g.length,o,b,a,p=[];this.renderAll(e,l);var s=this.getLayoutTargetSize();if(s.width<1&&s.height<1){return}var q=s.width-this.scrollOffset,d=s.height,r=q;this.innerCt.setWidth(q);for(b=0;b<k;b++){o=g[b];a=o.getPositionEl().getMargins("lr");p[b]=a;if(!o.columnWidth){r-=(o.getWidth()+a)}}r=r<0?0:r;for(b=0;b<k;b++){o=g[b];a=p[b];if(o.columnWidth){o.setSize(Math.floor(o.columnWidth*r)-a)}}if(Ext.isIE){if(b=l.getStyle("overflow")&&b!="hidden"&&!this.adjustmentPass){var n=this.getLayoutTargetSize();if(n.width!=s.width){this.adjustmentPass=true;this.onLayout(e,l)}}}delete this.adjustmentPass}});Ext.Container.LAYOUTS.column=Ext.layout.ColumnLayout;Ext.layout.BorderLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,rendered:false,type:"border",targetCls:"x-border-layout-ct",getLayoutTargetSize:function(){var a=this.container.getLayoutTarget();return a?a.getViewSize():{}},onLayout:function(g,J){var k,C,G,p,y=g.items.items,D=y.length;if(!this.rendered){k=[];for(C=0;C<D;C++){G=y[C];p=G.region;if(G.collapsed){k.push(G)}G.collapsed=false;if(!G.rendered){G.render(J,C);G.getPositionEl().addClass("x-border-panel")}this[p]=p!="center"&&G.split?new Ext.layout.BorderLayout.SplitRegion(this,G.initialConfig,p):new Ext.layout.BorderLayout.Region(this,G.initialConfig,p);this[p].render(J,G)}this.rendered=true}var x=this.getLayoutTargetSize();if(x.width<20||x.height<20){if(k){this.restoreCollapsed=k}return}else{if(this.restoreCollapsed){k=this.restoreCollapsed;delete this.restoreCollapsed}}var u=x.width,E=x.height,t=u,B=E,q=0,r=0,z=this.north,v=this.south,o=this.west,F=this.east,G=this.center,I,A,d,H;if(!G&&Ext.layout.BorderLayout.WARN!==false){throw"No center region defined in BorderLayout "+g.id}if(z&&z.isVisible()){I=z.getSize();A=z.getMargins();I.width=u-(A.left+A.right);I.x=A.left;I.y=A.top;q=I.height+I.y+A.bottom;B-=q;z.applyLayout(I)}if(v&&v.isVisible()){I=v.getSize();A=v.getMargins();I.width=u-(A.left+A.right);I.x=A.left;H=(I.height+A.top+A.bottom);I.y=E-H+A.top;B-=H;v.applyLayout(I)}if(o&&o.isVisible()){I=o.getSize();A=o.getMargins();I.height=B-(A.top+A.bottom);I.x=A.left;I.y=q+A.top;d=(I.width+A.left+A.right);r+=d;t-=d;o.applyLayout(I)}if(F&&F.isVisible()){I=F.getSize();A=F.getMargins();I.height=B-(A.top+A.bottom);d=(I.width+A.left+A.right);I.x=u-d+A.left;I.y=q+A.top;t-=d;F.applyLayout(I)}if(G){A=G.getMargins();var l={x:r+A.left,y:q+A.top,width:t-(A.left+A.right),height:B-(A.top+A.bottom)};G.applyLayout(l)}if(k){for(C=0,D=k.length;C<D;C++){k[C].collapse(false)}}if(Ext.isIE&&Ext.isStrict){J.repaint()}if(C=J.getStyle("overflow")&&C!="hidden"&&!this.adjustmentPass){var a=this.getLayoutTargetSize();if(a.width!=x.width||a.height!=x.height){this.adjustmentPass=true;this.onLayout(g,J)}}delete this.adjustmentPass},destroy:function(){var b=["north","south","east","west"],a,c;for(a=0;a<b.length;a++){c=this[b[a]];if(c){if(c.destroy){c.destroy()}else{if(c.split){c.split.destroy(true)}}}}Ext.layout.BorderLayout.superclass.destroy.call(this)}});Ext.layout.BorderLayout.Region=function(b,a,c){Ext.apply(this,a);this.layout=b;this.position=c;this.state={};if(typeof this.margins=="string"){this.margins=this.layout.parseMargins(this.margins)}this.margins=Ext.applyIf(this.margins||{},this.defaultMargins);if(this.collapsible){if(typeof this.cmargins=="string"){this.cmargins=this.layout.parseMargins(this.cmargins)}if(this.collapseMode=="mini"&&!this.cmargins){this.cmargins={left:0,top:0,right:0,bottom:0}}else{this.cmargins=Ext.applyIf(this.cmargins||{},c=="north"||c=="south"?this.defaultNSCMargins:this.defaultEWCMargins)}}};Ext.layout.BorderLayout.Region.prototype={collapsible:false,split:false,floatable:true,minWidth:50,minHeight:50,defaultMargins:{left:0,top:0,right:0,bottom:0},defaultNSCMargins:{left:5,top:5,right:5,bottom:5},defaultEWCMargins:{left:5,top:0,right:5,bottom:0},floatingZIndex:100,isCollapsed:false,render:function(b,c){this.panel=c;c.el.enableDisplayMode();this.targetEl=b;this.el=c.el;var a=c.getState,d=this.position;c.getState=function(){return Ext.apply(a.call(c)||{},this.state)}.createDelegate(this);if(d!="center"){c.allowQueuedExpand=false;c.on({beforecollapse:this.beforeCollapse,collapse:this.onCollapse,beforeexpand:this.beforeExpand,expand:this.onExpand,hide:this.onHide,show:this.onShow,scope:this});if(this.collapsible||this.floatable){c.collapseEl="el";c.slideAnchor=this.getSlideAnchor()}if(c.tools&&c.tools.toggle){c.tools.toggle.addClass("x-tool-collapse-"+d);c.tools.toggle.addClassOnOver("x-tool-collapse-"+d+"-over")}}},getCollapsedEl:function(){if(!this.collapsedEl){if(!this.toolTemplate){var b=new Ext.Template('<div class="x-tool x-tool-{id}">&#160;</div>');b.disableFormats=true;b.compile();Ext.layout.BorderLayout.Region.prototype.toolTemplate=b}this.collapsedEl=this.targetEl.createChild({cls:"x-layout-collapsed x-layout-collapsed-"+this.position,id:this.panel.id+"-xcollapsed"});this.collapsedEl.enableDisplayMode("block");if(this.collapseMode=="mini"){this.collapsedEl.addClass("x-layout-cmini-"+this.position);this.miniCollapsedEl=this.collapsedEl.createChild({cls:"x-layout-mini x-layout-mini-"+this.position,html:"&#160;"});this.miniCollapsedEl.addClassOnOver("x-layout-mini-over");this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this.onExpandClick,this,{stopEvent:true})}else{if(this.collapsible!==false&&!this.hideCollapseTool){var a=this.expandToolEl=this.toolTemplate.append(this.collapsedEl.dom,{id:"expand-"+this.position},true);a.addClassOnOver("x-tool-expand-"+this.position+"-over");a.on("click",this.onExpandClick,this,{stopEvent:true})}if(this.floatable!==false||this.titleCollapse){this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this[this.floatable?"collapseClick":"onExpandClick"],this)}}}return this.collapsedEl},onExpandClick:function(a){if(this.isSlid){this.panel.expand(false)}else{this.panel.expand()}},onCollapseClick:function(a){this.panel.collapse()},beforeCollapse:function(c,a){this.lastAnim=a;if(this.splitEl){this.splitEl.hide()}this.getCollapsedEl().show();var b=this.panel.getEl();this.originalZIndex=b.getStyle("z-index");b.setStyle("z-index",100);this.isCollapsed=true;this.layout.layout()},onCollapse:function(a){this.panel.el.setStyle("z-index",1);if(this.lastAnim===false||this.panel.animCollapse===false){this.getCollapsedEl().dom.style.visibility="visible"}else{this.getCollapsedEl().slideIn(this.panel.slideAnchor,{duration:0.2})}this.state.collapsed=true;this.panel.saveState()},beforeExpand:function(a){if(this.isSlid){this.afterSlideIn()}var b=this.getCollapsedEl();this.el.show();if(this.position=="east"||this.position=="west"){this.panel.setSize(undefined,b.getHeight())}else{this.panel.setSize(b.getWidth(),undefined)}b.hide();b.dom.style.visibility="hidden";this.panel.el.setStyle("z-index",this.floatingZIndex)},onExpand:function(){this.isCollapsed=false;if(this.splitEl){this.splitEl.show()}this.layout.layout();this.panel.el.setStyle("z-index",this.originalZIndex);this.state.collapsed=false;this.panel.saveState()},collapseClick:function(a){if(this.isSlid){a.stopPropagation();this.slideIn()}else{a.stopPropagation();this.slideOut()}},onHide:function(){if(this.isCollapsed){this.getCollapsedEl().hide()}else{if(this.splitEl){this.splitEl.hide()}}},onShow:function(){if(this.isCollapsed){this.getCollapsedEl().show()}else{if(this.splitEl){this.splitEl.show()}}},isVisible:function(){return !this.panel.hidden},getMargins:function(){return this.isCollapsed&&this.cmargins?this.cmargins:this.margins},getSize:function(){return this.isCollapsed?this.getCollapsedEl().getSize():this.panel.getSize()},setPanel:function(a){this.panel=a},getMinWidth:function(){return this.minWidth},getMinHeight:function(){return this.minHeight},applyLayoutCollapsed:function(a){var b=this.getCollapsedEl();b.setLeftTop(a.x,a.y);b.setSize(a.width,a.height)},applyLayout:function(a){if(this.isCollapsed){this.applyLayoutCollapsed(a)}else{this.panel.setPosition(a.x,a.y);this.panel.setSize(a.width,a.height)}},beforeSlide:function(){this.panel.beforeEffect()},afterSlide:function(){this.panel.afterEffect()},initAutoHide:function(){if(this.autoHide!==false){if(!this.autoHideHd){this.autoHideSlideTask=new Ext.util.DelayedTask(this.slideIn,this);this.autoHideHd={mouseout:function(a){if(!a.within(this.el,true)){this.autoHideSlideTask.delay(500)}},mouseover:function(a){this.autoHideSlideTask.cancel()},scope:this}}this.el.on(this.autoHideHd);this.collapsedEl.on(this.autoHideHd)}},clearAutoHide:function(){if(this.autoHide!==false){this.el.un("mouseout",this.autoHideHd.mouseout);this.el.un("mouseover",this.autoHideHd.mouseover);this.collapsedEl.un("mouseout",this.autoHideHd.mouseout);this.collapsedEl.un("mouseover",this.autoHideHd.mouseover)}},clearMonitor:function(){Ext.getDoc().un("click",this.slideInIf,this)},slideOut:function(){if(this.isSlid||this.el.hasActiveFx()){return}this.isSlid=true;var b=this.panel.tools,c,a;if(b&&b.toggle){b.toggle.hide()}this.el.show();a=this.panel.collapsed;this.panel.collapsed=false;if(this.position=="east"||this.position=="west"){c=this.panel.deferHeight;this.panel.deferHeight=false;this.panel.setSize(undefined,this.collapsedEl.getHeight());this.panel.deferHeight=c}else{this.panel.setSize(this.collapsedEl.getWidth(),undefined)}this.panel.collapsed=a;this.restoreLT=[this.el.dom.style.left,this.el.dom.style.top];this.el.alignTo(this.collapsedEl,this.getCollapseAnchor());this.el.setStyle("z-index",this.floatingZIndex+2);this.panel.el.replaceClass("x-panel-collapsed","x-panel-floating");if(this.animFloat!==false){this.beforeSlide();this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.afterSlide();this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)},scope:this,block:true})}else{this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)}},afterSlideIn:function(){this.clearAutoHide();this.isSlid=false;this.clearMonitor();this.el.setStyle("z-index","");this.panel.el.replaceClass("x-panel-floating","x-panel-collapsed");this.el.dom.style.left=this.restoreLT[0];this.el.dom.style.top=this.restoreLT[1];var a=this.panel.tools;if(a&&a.toggle){a.toggle.show()}},slideIn:function(a){if(!this.isSlid||this.el.hasActiveFx()){Ext.callback(a);return}this.isSlid=false;if(this.animFloat!==false){this.beforeSlide();this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.hide();this.afterSlide();this.afterSlideIn();Ext.callback(a)},scope:this,block:true})}else{this.el.hide();this.afterSlideIn()}},slideInIf:function(a){if(!a.within(this.el)){this.slideIn()}},anchors:{west:"left",east:"right",north:"top",south:"bottom"},sanchors:{west:"l",east:"r",north:"t",south:"b"},canchors:{west:"tl-tr",east:"tr-tl",north:"tl-bl",south:"bl-tl"},getAnchor:function(){return this.anchors[this.position]},getCollapseAnchor:function(){return this.canchors[this.position]},getSlideAnchor:function(){return this.sanchors[this.position]},getAlignAdj:function(){var a=this.cmargins;switch(this.position){case"west":return[0,0];break;case"east":return[0,0];break;case"north":return[0,0];break;case"south":return[0,0];break}},getExpandAdj:function(){var b=this.collapsedEl,a=this.cmargins;switch(this.position){case"west":return[-(a.right+b.getWidth()+a.left),0];break;case"east":return[a.right+b.getWidth()+a.left,0];break;case"north":return[0,-(a.top+a.bottom+b.getHeight())];break;case"south":return[0,a.top+a.bottom+b.getHeight()];break}},destroy:function(){if(this.autoHideSlideTask&&this.autoHideSlideTask.cancel){this.autoHideSlideTask.cancel()}Ext.destroyMembers(this,"miniCollapsedEl","collapsedEl","expandToolEl")}};Ext.layout.BorderLayout.SplitRegion=function(b,a,c){Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this,b,a,c);this.applyLayout=this.applyFns[c]};Ext.extend(Ext.layout.BorderLayout.SplitRegion,Ext.layout.BorderLayout.Region,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:false,splitSettings:{north:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.TOP,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},south:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.BOTTOM,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},east:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.RIGHT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"},west:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.LEFT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"}},applyFns:{west:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;this.panel.setPosition(c.x,c.y);var a=d.offsetWidth;b.left=(c.x+c.width-a)+"px";b.top=(c.y)+"px";b.height=Math.max(0,c.height)+"px";this.panel.setSize(c.width-a,c.height)},east:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetWidth;this.panel.setPosition(c.x+a,c.y);b.left=(c.x)+"px";b.top=(c.y)+"px";b.height=Math.max(0,c.height)+"px";this.panel.setSize(c.width-a,c.height)},north:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetHeight;this.panel.setPosition(c.x,c.y);b.left=(c.x)+"px";b.top=(c.y+c.height-a)+"px";b.width=Math.max(0,c.width)+"px";this.panel.setSize(c.width,c.height-a)},south:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetHeight;this.panel.setPosition(c.x,c.y+a);b.left=(c.x)+"px";b.top=(c.y)+"px";b.width=Math.max(0,c.width)+"px";this.panel.setSize(c.width,c.height-a)}},render:function(a,c){Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this,a,c);var d=this.position;this.splitEl=a.createChild({cls:"x-layout-split x-layout-split-"+d,html:"&#160;",id:this.panel.id+"-xsplit"});if(this.collapseMode=="mini"){this.miniSplitEl=this.splitEl.createChild({cls:"x-layout-mini x-layout-mini-"+d,html:"&#160;"});this.miniSplitEl.addClassOnOver("x-layout-mini-over");this.miniSplitEl.on("click",this.onCollapseClick,this,{stopEvent:true})}var b=this.splitSettings[d];this.split=new Ext.SplitBar(this.splitEl.dom,c.el,b.orientation);this.split.tickSize=this.tickSize;this.split.placement=b.placement;this.split.getMaximumSize=this[b.maxFn].createDelegate(this);this.split.minSize=this.minSize||this[b.minProp];this.split.on("beforeapply",this.onSplitMove,this);this.split.useShim=this.useShim===true;this.maxSize=this.maxSize||this[b.maxProp];if(c.hidden){this.splitEl.hide()}if(this.useSplitTips){this.splitEl.dom.title=this.collapsible?this.collapsibleSplitTip:this.splitTip}if(this.collapsible){this.splitEl.on("dblclick",this.onCollapseClick,this)}},getSize:function(){if(this.isCollapsed){return this.collapsedEl.getSize()}var a=this.panel.getSize();if(this.position=="north"||this.position=="south"){a.height+=this.splitEl.dom.offsetHeight}else{a.width+=this.splitEl.dom.offsetWidth}return a},getHMaxSize:function(){var b=this.maxSize||10000;var a=this.layout.center;return Math.min(b,(this.el.getWidth()+a.el.getWidth())-a.getMinWidth())},getVMaxSize:function(){var b=this.maxSize||10000;var a=this.layout.center;return Math.min(b,(this.el.getHeight()+a.el.getHeight())-a.getMinHeight())},onSplitMove:function(b,a){var c=this.panel.getSize();this.lastSplitSize=a;if(this.position=="north"||this.position=="south"){this.panel.setSize(c.width,a);this.state.height=a}else{this.panel.setSize(a,c.height);this.state.width=a}this.layout.layout();this.panel.saveState();return false},getSplitBar:function(){return this.split},destroy:function(){Ext.destroy(this.miniSplitEl,this.split,this.splitEl);Ext.layout.BorderLayout.SplitRegion.superclass.destroy.call(this)}});Ext.Container.LAYOUTS.border=Ext.layout.BorderLayout;Ext.layout.FormLayout=Ext.extend(Ext.layout.AnchorLayout,{labelSeparator:":",trackLabels:true,type:"form",onRemove:function(d){Ext.layout.FormLayout.superclass.onRemove.call(this,d);if(this.trackLabels){d.un("show",this.onFieldShow,this);d.un("hide",this.onFieldHide,this)}var b=d.getPositionEl(),a=d.getItemCt&&d.getItemCt();if(d.rendered&&a){if(b&&b.dom){b.insertAfter(a)}Ext.destroy(a);Ext.destroyMembers(d,"label","itemCt");if(d.customItemCt){Ext.destroyMembers(d,"getItemCt","customItemCt")}}},setContainer:function(a){Ext.layout.FormLayout.superclass.setContainer.call(this,a);if(a.labelAlign){a.addClass("x-form-label-"+a.labelAlign)}if(a.hideLabels){Ext.apply(this,{labelStyle:"display:none",elementStyle:"padding-left:0;",labelAdjust:0})}else{this.labelSeparator=Ext.isDefined(a.labelSeparator)?a.labelSeparator:this.labelSeparator;a.labelWidth=a.labelWidth||100;if(Ext.isNumber(a.labelWidth)){var b=Ext.isNumber(a.labelPad)?a.labelPad:5;Ext.apply(this,{labelAdjust:a.labelWidth+b,labelStyle:"width:"+a.labelWidth+"px;",elementStyle:"padding-left:"+(a.labelWidth+b)+"px"})}if(a.labelAlign=="top"){Ext.apply(this,{labelStyle:"width:auto;",labelAdjust:0,elementStyle:"padding-left:0;"})}}},isHide:function(a){return a.hideLabel||this.container.hideLabels},onFieldShow:function(a){a.getItemCt().removeClass("x-hide-"+a.hideMode);if(a.isComposite){a.doLayout()}},onFieldHide:function(a){a.getItemCt().addClass("x-hide-"+a.hideMode)},getLabelStyle:function(e){var b="",c=[this.labelStyle,e];for(var d=0,a=c.length;d<a;++d){if(c[d]){b+=c[d];if(b.substr(-1,1)!=";"){b+=";"}}}return b},renderItem:function(e,a,d){if(e&&(e.isFormField||e.fieldLabel)&&e.inputType!="hidden"){var b=this.getTemplateArgs(e);if(Ext.isNumber(a)){a=d.dom.childNodes[a]||null}if(a){e.itemCt=this.fieldTpl.insertBefore(a,b,true)}else{e.itemCt=this.fieldTpl.append(d,b,true)}if(!e.getItemCt){Ext.apply(e,{getItemCt:function(){return e.itemCt},customItemCt:true})}e.label=e.getItemCt().child("label.x-form-item-label");if(!e.rendered){e.render("x-form-el-"+e.id)}else{if(!this.isValidParent(e,d)){Ext.fly("x-form-el-"+e.id).appendChild(e.getPositionEl())}}if(this.trackLabels){if(e.hidden){this.onFieldHide(e)}e.on({scope:this,show:this.onFieldShow,hide:this.onFieldHide})}this.configureItem(e)}else{Ext.layout.FormLayout.superclass.renderItem.apply(this,arguments)}},getTemplateArgs:function(b){var a=!b.fieldLabel||b.hideLabel;return{id:b.id,label:b.fieldLabel,itemCls:(b.itemCls||this.container.itemCls||"")+(b.hideLabel?" x-hide-label":""),clearCls:b.clearCls||"x-form-clear-left",labelStyle:this.getLabelStyle(b.labelStyle),elementStyle:this.elementStyle||"",labelSeparator:a?"":(Ext.isDefined(b.labelSeparator)?b.labelSeparator:this.labelSeparator)}},adjustWidthAnchor:function(a,d){if(d.label&&!this.isHide(d)&&(this.container.labelAlign!="top")){var b=Ext.isIE6||(Ext.isIE&&!Ext.isStrict);return a-this.labelAdjust+(b?-3:0)}return a},adjustHeightAnchor:function(a,b){if(b.label&&!this.isHide(b)&&(this.container.labelAlign=="top")){return a-b.label.getHeight()}return a},isValidParent:function(b,a){return a&&this.container.getEl().contains(b.getPositionEl())}});Ext.Container.LAYOUTS.form=Ext.layout.FormLayout;Ext.layout.AccordionLayout=Ext.extend(Ext.layout.FitLayout,{fill:true,autoWidth:true,titleCollapse:true,hideCollapseTool:false,collapseFirst:false,animate:false,sequence:false,activeOnTop:false,type:"accordion",renderItem:function(a){if(this.animate===false){a.animCollapse=false}a.collapsible=true;if(this.autoWidth){a.autoWidth=true}if(this.titleCollapse){a.titleCollapse=true}if(this.hideCollapseTool){a.hideCollapseTool=true}if(this.collapseFirst!==undefined){a.collapseFirst=this.collapseFirst}if(!this.activeItem&&!a.collapsed){this.setActiveItem(a,true)}else{if(this.activeItem&&this.activeItem!=a){a.collapsed=true}}Ext.layout.AccordionLayout.superclass.renderItem.apply(this,arguments);a.header.addClass("x-accordion-hd");a.on("beforeexpand",this.beforeExpand,this)},onRemove:function(a){Ext.layout.AccordionLayout.superclass.onRemove.call(this,a);if(a.rendered){a.header.removeClass("x-accordion-hd")}a.un("beforeexpand",this.beforeExpand,this)},beforeExpand:function(c,b){var a=this.activeItem;if(a){if(this.sequence){delete this.activeItem;if(!a.collapsed){a.collapse({callback:function(){c.expand(b||true)},scope:this});return false}}else{a.collapse(this.animate)}}this.setActive(c);if(this.activeOnTop){c.el.dom.parentNode.insertBefore(c.el.dom,c.el.dom.parentNode.firstChild)}this.layout()},setItemSize:function(g,e){if(this.fill&&g){var d=0,c,b=this.getRenderedItems(this.container),a=b.length,h;for(c=0;c<a;c++){if((h=b[c])!=g&&!h.hidden){d+=h.header.getHeight()}}e.height-=d;g.setSize(e)}},setActiveItem:function(a){this.setActive(a,true)},setActive:function(c,b){var a=this.activeItem;c=this.container.getComponent(c);if(a!=c){if(c.rendered&&c.collapsed&&b){c.expand()}else{if(a){a.fireEvent("deactivate",a)}this.activeItem=c;c.fireEvent("activate",c)}}}});Ext.Container.LAYOUTS.accordion=Ext.layout.AccordionLayout;Ext.layout.Accordion=Ext.layout.AccordionLayout;Ext.layout.TableLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:false,type:"table",targetCls:"x-table-layout-ct",tableAttrs:null,setContainer:function(a){Ext.layout.TableLayout.superclass.setContainer.call(this,a);this.currentRow=0;this.currentColumn=0;this.cells=[]},onLayout:function(d,g){var e=d.items.items,a=e.length,h,b;if(!this.table){g.addClass("x-table-layout-ct");this.table=g.createChild(Ext.apply({tag:"table",cls:"x-table-layout",cellspacing:0,cn:{tag:"tbody"}},this.tableAttrs),null,true)}this.renderAll(d,g)},getRow:function(a){var b=this.table.tBodies[0].childNodes[a];if(!b){b=document.createElement("tr");this.table.tBodies[0].appendChild(b)}return b},getNextCell:function(k){var a=this.getNextNonSpan(this.currentColumn,this.currentRow);var g=this.currentColumn=a[0],e=this.currentRow=a[1];for(var i=e;i<e+(k.rowspan||1);i++){if(!this.cells[i]){this.cells[i]=[]}for(var d=g;d<g+(k.colspan||1);d++){this.cells[i][d]=true}}var h=document.createElement("td");if(k.cellId){h.id=k.cellId}var b="x-table-layout-cell";if(k.cellCls){b+=" "+k.cellCls}h.className=b;if(k.colspan){h.colSpan=k.colspan}if(k.rowspan){h.rowSpan=k.rowspan}this.getRow(e).appendChild(h);return h},getNextNonSpan:function(a,c){var b=this.columns;while((b&&a>=b)||(this.cells[c]&&this.cells[c][a])){if(b&&a>=b){c++;a=0}else{a++}}return[a,c]},renderItem:function(e,a,d){if(!this.table){this.table=d.createChild(Ext.apply({tag:"table",cls:"x-table-layout",cellspacing:0,cn:{tag:"tbody"}},this.tableAttrs),null,true)}if(e&&!e.rendered){e.render(this.getNextCell(e));this.configureItem(e)}else{if(e&&!this.isValidParent(e,d)){var b=this.getNextCell(e);b.insertBefore(e.getPositionEl().dom,null);e.container=Ext.get(b);this.configureItem(e)}}},isValidParent:function(b,a){return b.getPositionEl().up("table",5).dom.parentNode===(a.dom||a)},destroy:function(){delete this.table;Ext.layout.TableLayout.superclass.destroy.call(this)}});Ext.Container.LAYOUTS.table=Ext.layout.TableLayout;Ext.layout.AbsoluteLayout=Ext.extend(Ext.layout.AnchorLayout,{extraCls:"x-abs-layout-item",type:"absolute",onLayout:function(a,b){b.position();this.paddingLeft=b.getPadding("l");this.paddingTop=b.getPadding("t");Ext.layout.AbsoluteLayout.superclass.onLayout.call(this,a,b)},adjustWidthAnchor:function(b,a){return b?b-a.getPosition(true)[0]+this.paddingLeft:b},adjustHeightAnchor:function(b,a){return b?b-a.getPosition(true)[1]+this.paddingTop:b}});Ext.Container.LAYOUTS.absolute=Ext.layout.AbsoluteLayout;Ext.layout.BoxLayout=Ext.extend(Ext.layout.ContainerLayout,{defaultMargins:{left:0,top:0,right:0,bottom:0},padding:"0",pack:"start",monitorResize:true,type:"box",scrollOffset:0,extraCls:"x-box-item",targetCls:"x-box-layout-ct",innerCls:"x-box-inner",constructor:function(a){Ext.layout.BoxLayout.superclass.constructor.call(this,a);if(Ext.isString(this.defaultMargins)){this.defaultMargins=this.parseMargins(this.defaultMargins)}var d=this.overflowHandler;if(typeof d=="string"){d={type:d}}var c="none";if(d&&d.type!=undefined){c=d.type}var b=Ext.layout.boxOverflow[c];if(b[this.type]){b=b[this.type]}this.overflowHandler=new b(this,d)},onLayout:function(b,h){Ext.layout.BoxLayout.superclass.onLayout.call(this,b,h);var d=this.getLayoutTargetSize(),i=this.getVisibleItems(b),c=this.calculateChildBoxes(i,d),g=c.boxes,k=c.meta;if(d.width>0){var l=this.overflowHandler,a=k.tooNarrow?"handleOverflow":"clearOverflow";var e=l[a](c,d);if(e){if(e.targetSize){d=e.targetSize}if(e.recalculate){i=this.getVisibleItems(b);c=this.calculateChildBoxes(i,d);g=c.boxes}}}this.layoutTargetLastSize=d;this.childBoxCache=c;this.updateInnerCtSize(d,c);this.updateChildBoxes(g);this.handleTargetOverflow(d,b,h)},updateChildBoxes:function(c){for(var b=0,e=c.length;b<e;b++){var d=c[b],a=d.component;if(d.dirtySize){a.setSize(d.width,d.height)}if(isNaN(d.left)||isNaN(d.top)){continue}a.setPosition(d.left,d.top)}},updateInnerCtSize:function(c,h){var i=this.align,g=this.padding,e=c.width,a=c.height;if(this.type=="hbox"){var b=e,d=h.meta.maxHeight+g.top+g.bottom;if(i=="stretch"){d=a}else{if(i=="middle"){d=Math.max(a,d)}}}else{var d=a,b=h.meta.maxWidth+g.left+g.right;if(i=="stretch"){b=e}else{if(i=="center"){b=Math.max(e,b)}}}this.innerCt.setSize(b||undefined,d||undefined)},handleTargetOverflow:function(d,a,c){var e=c.getStyle("overflow");if(e&&e!="hidden"&&!this.adjustmentPass){var b=this.getLayoutTargetSize();if(b.width!=d.width||b.height!=d.height){this.adjustmentPass=true;this.onLayout(a,c)}}delete this.adjustmentPass},isValidParent:function(b,a){return this.innerCt&&b.getPositionEl().dom.parentNode==this.innerCt.dom},getVisibleItems:function(g){var g=g||this.container,e=g.getLayoutTarget(),h=g.items.items,a=h.length,d,k,b=[];for(d=0;d<a;d++){if((k=h[d]).rendered&&this.isValidParent(k,e)&&k.hidden!==true&&k.collapsed!==true&&k.shouldLayout!==false){b.push(k)}}return b},renderAll:function(a,b){if(!this.innerCt){this.innerCt=b.createChild({cls:this.innerCls});this.padding=this.parseMargins(this.padding)}Ext.layout.BoxLayout.superclass.renderAll.call(this,a,this.innerCt)},getLayoutTargetSize:function(){var b=this.container.getLayoutTarget(),a;if(b){a=b.getViewSize();if(Ext.isIE&&Ext.isStrict&&a.width==0){a=b.getStyleSize()}a.width-=b.getPadding("lr");a.height-=b.getPadding("tb")}return a},renderItem:function(a){if(Ext.isString(a.margins)){a.margins=this.parseMargins(a.margins)}else{if(!a.margins){a.margins=this.defaultMargins}}Ext.layout.BoxLayout.superclass.renderItem.apply(this,arguments)},destroy:function(){Ext.destroy(this.overflowHandler);Ext.layout.BoxLayout.superclass.destroy.apply(this,arguments)}});Ext.ns("Ext.layout.boxOverflow");Ext.layout.boxOverflow.None=Ext.extend(Object,{constructor:function(b,a){this.layout=b;Ext.apply(this,a||{})},handleOverflow:Ext.emptyFn,clearOverflow:Ext.emptyFn});Ext.layout.boxOverflow.none=Ext.layout.boxOverflow.None;Ext.layout.boxOverflow.Menu=Ext.extend(Ext.layout.boxOverflow.None,{afterCls:"x-strip-right",noItemsMenuText:'<div class="x-toolbar-no-items">(None)</div>',constructor:function(a){Ext.layout.boxOverflow.Menu.superclass.constructor.apply(this,arguments);this.menuItems=[]},createInnerElements:function(){if(!this.afterCt){this.afterCt=this.layout.innerCt.insertSibling({cls:this.afterCls},"before")}},clearOverflow:function(a,g){var e=g.width+(this.afterCt?this.afterCt.getWidth():0),b=this.menuItems;this.hideTrigger();for(var c=0,d=b.length;c<d;c++){b.pop().component.show()}return{targetSize:{height:g.height,width:e}}},showTrigger:function(){this.createMenu();this.menuTrigger.show()},hideTrigger:function(){if(this.menuTrigger!=undefined){this.menuTrigger.hide()}},beforeMenuShow:function(h){var b=this.menuItems,a=b.length,g,e;var c=function(k,i){return k.isXType("buttongroup")&&!(i instanceof Ext.Toolbar.Separator)};this.clearMenu();h.removeAll();for(var d=0;d<a;d++){g=b[d].component;if(e&&(c(g,e)||c(e,g))){h.add("-")}this.addComponentToMenu(h,g);e=g}if(h.items.length<1){h.add(this.noItemsMenuText)}},createMenuConfig:function(c,a){var b=Ext.apply({},c.initialConfig),d=c.toggleGroup;Ext.copyTo(b,c,["iconCls","icon","itemId","disabled","handler","scope","menu"]);Ext.apply(b,{text:c.overflowText||c.text,hideOnClick:a});if(d||c.enableToggle){Ext.apply(b,{group:d,checked:c.pressed,listeners:{checkchange:function(g,e){c.toggle(e)}}})}delete b.ownerCt;delete b.xtype;delete b.id;return b},addComponentToMenu:function(b,a){if(a instanceof Ext.Toolbar.Separator){b.add("-")}else{if(Ext.isFunction(a.isXType)){if(a.isXType("splitbutton")){b.add(this.createMenuConfig(a,true))}else{if(a.isXType("button")){b.add(this.createMenuConfig(a,!a.menu))}else{if(a.isXType("buttongroup")){a.items.each(function(c){this.addComponentToMenu(b,c)},this)}}}}}},clearMenu:function(){var a=this.moreMenu;if(a&&a.items){a.items.each(function(b){delete b.menu})}},createMenu:function(){if(!this.menuTrigger){this.createInnerElements();this.menu=new Ext.menu.Menu({ownerCt:this.layout.container,listeners:{scope:this,beforeshow:this.beforeMenuShow}});this.menuTrigger=new Ext.Button({iconCls:"x-toolbar-more-icon",cls:"x-toolbar-more",menu:this.menu,renderTo:this.afterCt})}},destroy:function(){Ext.destroy(this.menu,this.menuTrigger)}});Ext.layout.boxOverflow.menu=Ext.layout.boxOverflow.Menu;Ext.layout.boxOverflow.HorizontalMenu=Ext.extend(Ext.layout.boxOverflow.Menu,{constructor:function(){Ext.layout.boxOverflow.HorizontalMenu.superclass.constructor.apply(this,arguments);var c=this,b=c.layout,a=b.calculateChildBoxes;b.calculateChildBoxes=function(d,i){var m=a.apply(b,arguments),l=m.meta,e=c.menuItems;var k=0;for(var g=0,h=e.length;g<h;g++){k+=e[g].width}l.minimumWidth+=k;l.tooNarrow=l.minimumWidth>i.width;return m}},handleOverflow:function(d,h){this.showTrigger();var l=h.width-this.afterCt.getWidth(),m=d.boxes,e=0,s=false;for(var p=0,c=m.length;p<c;p++){e+=m[p].width}var a=l-e,g=0;for(var p=0,c=this.menuItems.length;p<c;p++){var o=this.menuItems[p],n=o.component,b=o.width;if(b<a){n.show();a-=b;g++;s=true}else{break}}if(s){this.menuItems=this.menuItems.slice(g)}else{for(var k=m.length-1;k>=0;k--){var r=m[k].component,q=m[k].left+m[k].width;if(q>=l){this.menuItems.unshift({component:r,width:m[k].width});r.hide()}else{break}}}if(this.menuItems.length==0){this.hideTrigger()}return{targetSize:{height:h.height,width:l},recalculate:s}}});Ext.layout.boxOverflow.menu.hbox=Ext.layout.boxOverflow.HorizontalMenu;Ext.layout.boxOverflow.Scroller=Ext.extend(Ext.layout.boxOverflow.None,{animateScroll:true,scrollIncrement:100,wheelIncrement:3,scrollRepeatInterval:400,scrollDuration:0.4,beforeCls:"x-strip-left",afterCls:"x-strip-right",scrollerCls:"x-strip-scroller",beforeScrollerCls:"x-strip-scroller-left",afterScrollerCls:"x-strip-scroller-right",createWheelListener:function(){this.layout.innerCt.on({scope:this,mousewheel:function(a){a.stopEvent();this.scrollBy(a.getWheelDelta()*this.wheelIncrement*-1,false)}})},handleOverflow:function(a,b){this.createInnerElements();this.showScrollers()},clearOverflow:function(){this.hideScrollers()},showScrollers:function(){this.createScrollers();this.beforeScroller.show();this.afterScroller.show();this.updateScrollButtons()},hideScrollers:function(){if(this.beforeScroller!=undefined){this.beforeScroller.hide();this.afterScroller.hide()}},createScrollers:function(){if(!this.beforeScroller&&!this.afterScroller){var a=this.beforeCt.createChild({cls:String.format("{0} {1} ",this.scrollerCls,this.beforeScrollerCls)});var b=this.afterCt.createChild({cls:String.format("{0} {1}",this.scrollerCls,this.afterScrollerCls)});a.addClassOnOver(this.beforeScrollerCls+"-hover");b.addClassOnOver(this.afterScrollerCls+"-hover");a.setVisibilityMode(Ext.Element.DISPLAY);b.setVisibilityMode(Ext.Element.DISPLAY);this.beforeRepeater=new Ext.util.ClickRepeater(a,{interval:this.scrollRepeatInterval,handler:this.scrollLeft,scope:this});this.afterRepeater=new Ext.util.ClickRepeater(b,{interval:this.scrollRepeatInterval,handler:this.scrollRight,scope:this});this.beforeScroller=a;this.afterScroller=b}},destroy:function(){Ext.destroy(this.beforeScroller,this.afterScroller,this.beforeRepeater,this.afterRepeater,this.beforeCt,this.afterCt)},scrollBy:function(b,a){this.scrollTo(this.getScrollPosition()+b,a)},getItem:function(a){if(Ext.isString(a)){a=Ext.getCmp(a)}else{if(Ext.isNumber(a)){a=this.items[a]}}return a},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},updateScrollButtons:function(){if(this.beforeScroller==undefined||this.afterScroller==undefined){return}var d=this.atExtremeBefore()?"addClass":"removeClass",c=this.atExtremeAfter()?"addClass":"removeClass",a=this.beforeScrollerCls+"-disabled",b=this.afterScrollerCls+"-disabled";this.beforeScroller[d](a);this.afterScroller[c](b);this.scrolling=false},atExtremeBefore:function(){return this.getScrollPosition()===0},scrollLeft:function(a){this.scrollBy(-this.scrollIncrement,a)},scrollRight:function(a){this.scrollBy(this.scrollIncrement,a)},scrollToItem:function(d,b){d=this.getItem(d);if(d!=undefined){var a=this.getItemVisibility(d);if(!a.fullyVisible){var c=d.getBox(true,true),e=c.x;if(a.hiddenRight){e-=(this.layout.innerCt.getWidth()-c.width)}this.scrollTo(e,b)}}},getItemVisibility:function(e){var d=this.getItem(e).getBox(true,true),a=d.x,c=d.x+d.width,g=this.getScrollPosition(),b=this.layout.innerCt.getWidth()+g;return{hiddenLeft:a<g,hiddenRight:c>b,fullyVisible:a>g&&c<b}}});Ext.layout.boxOverflow.scroller=Ext.layout.boxOverflow.Scroller;Ext.layout.boxOverflow.VerticalScroller=Ext.extend(Ext.layout.boxOverflow.Scroller,{scrollIncrement:75,wheelIncrement:2,handleOverflow:function(a,b){Ext.layout.boxOverflow.VerticalScroller.superclass.handleOverflow.apply(this,arguments);return{targetSize:{height:b.height-(this.beforeCt.getHeight()+this.afterCt.getHeight()),width:b.width}}},createInnerElements:function(){var a=this.layout.innerCt;if(!this.beforeCt){this.beforeCt=a.insertSibling({cls:this.beforeCls},"before");this.afterCt=a.insertSibling({cls:this.afterCls},"after");this.createWheelListener()}},scrollTo:function(a,b){var d=this.getScrollPosition(),c=a.constrain(0,this.getMaxScrollBottom());if(c!=d&&!this.scrolling){if(b==undefined){b=this.animateScroll}this.layout.innerCt.scrollTo("top",c,b?this.getScrollAnim():false);if(b){this.scrolling=true}else{this.scrolling=false;this.updateScrollButtons()}}},getScrollPosition:function(){return parseInt(this.layout.innerCt.dom.scrollTop,10)||0},getMaxScrollBottom:function(){return this.layout.innerCt.dom.scrollHeight-this.layout.innerCt.getHeight()},atExtremeAfter:function(){return this.getScrollPosition()>=this.getMaxScrollBottom()}});Ext.layout.boxOverflow.scroller.vbox=Ext.layout.boxOverflow.VerticalScroller;Ext.layout.boxOverflow.HorizontalScroller=Ext.extend(Ext.layout.boxOverflow.Scroller,{handleOverflow:function(a,b){Ext.layout.boxOverflow.HorizontalScroller.superclass.handleOverflow.apply(this,arguments);return{targetSize:{height:b.height,width:b.width-(this.beforeCt.getWidth()+this.afterCt.getWidth())}}},createInnerElements:function(){var a=this.layout.innerCt;if(!this.beforeCt){this.afterCt=a.insertSibling({cls:this.afterCls},"before");this.beforeCt=a.insertSibling({cls:this.beforeCls},"before");this.createWheelListener()}},scrollTo:function(a,b){var d=this.getScrollPosition(),c=a.constrain(0,this.getMaxScrollRight());if(c!=d&&!this.scrolling){if(b==undefined){b=this.animateScroll}this.layout.innerCt.scrollTo("left",c,b?this.getScrollAnim():false);if(b){this.scrolling=true}else{this.scrolling=false;this.updateScrollButtons()}}},getScrollPosition:function(){return parseInt(this.layout.innerCt.dom.scrollLeft,10)||0},getMaxScrollRight:function(){return this.layout.innerCt.dom.scrollWidth-this.layout.innerCt.getWidth()},atExtremeAfter:function(){return this.getScrollPosition()>=this.getMaxScrollRight()}});Ext.layout.boxOverflow.scroller.hbox=Ext.layout.boxOverflow.HorizontalScroller;Ext.layout.HBoxLayout=Ext.extend(Ext.layout.BoxLayout,{align:"top",type:"hbox",calculateChildBoxes:function(s,b){var G=s.length,S=this.padding,E=S.top,V=S.left,z=E+S.bottom,P=V+S.right,a=b.width-this.scrollOffset,e=b.height,p=Math.max(0,e-z),Q=this.pack=="start",X=this.pack=="center",B=this.pack=="end",M=0,R=0,U=0,m=0,Y=0,I=[],l,K,N,W,x,k,T,J,c,y,r,O;for(T=0;T<G;T++){l=s[T];N=l.height;K=l.width;k=!l.hasLayout&&typeof l.doLayout=="function";if(typeof K!="number"){if(l.flex&&!K){U+=l.flex}else{if(!K&&k){l.doLayout()}W=l.getSize();K=W.width;N=W.height}}x=l.margins;y=x.left+x.right;M+=y+(K||0);m+=y+(l.flex?l.minWidth||0:K);Y+=y+(l.minWidth||K||0);if(typeof N!="number"){if(k){l.doLayout()}N=l.getHeight()}R=Math.max(R,N+x.top+x.bottom);I.push({component:l,height:N||undefined,width:K||undefined})}var L=m-a,q=Y>a;var o=Math.max(0,a-M-P);if(q){for(T=0;T<G;T++){I[T].width=s[T].minWidth||s[T].width||I[T].width}}else{if(L>0){var D=[];for(var F=0,w=G;F<w;F++){var C=s[F],u=C.minWidth||0;if(C.flex){I[F].width=u}else{D.push({minWidth:u,available:I[F].width-u,index:F})}}D.sort(function(Z,i){return Z.available>i.available?1:-1});for(var T=0,w=D.length;T<w;T++){var H=D[T].index;if(H==undefined){continue}var C=s[H],n=I[H],v=n.width,u=C.minWidth,d=Math.max(u,v-Math.ceil(L/(w-T))),g=v-d;I[H].width=d;L-=g}}else{var h=o,t=U;for(T=0;T<G;T++){l=s[T];J=I[T];x=l.margins;r=x.top+x.bottom;if(Q&&l.flex&&!l.width){c=Math.ceil((l.flex/t)*h);h-=c;t-=l.flex;J.width=c;J.dirtySize=true}}}}if(X){V+=o/2}else{if(B){V+=o}}for(T=0;T<G;T++){l=s[T];J=I[T];x=l.margins;V+=x.left;r=x.top+x.bottom;J.left=V;J.top=E+x.top;switch(this.align){case"stretch":O=p-r;J.height=O.constrain(l.minHeight||0,l.maxHeight||1000000);J.dirtySize=true;break;case"stretchmax":O=R-r;J.height=O.constrain(l.minHeight||0,l.maxHeight||1000000);J.dirtySize=true;break;case"middle":var A=p-J.height-r;if(A>0){J.top=E+r+(A/2)}}V+=J.width+x.right}return{boxes:I,meta:{maxHeight:R,nonFlexWidth:M,desiredWidth:m,minimumWidth:Y,shortfall:m-a,tooNarrow:q}}}});Ext.Container.LAYOUTS.hbox=Ext.layout.HBoxLayout;Ext.layout.VBoxLayout=Ext.extend(Ext.layout.BoxLayout,{align:"left",type:"vbox",calculateChildBoxes:function(q,b){var G=q.length,T=this.padding,E=T.top,W=T.left,z=E+T.bottom,Q=W+T.right,a=b.width-this.scrollOffset,d=b.height,M=Math.max(0,a-Q),R=this.pack=="start",Y=this.pack=="center",B=this.pack=="end",m=0,w=0,V=0,N=0,o=0,I=[],k,K,P,X,v,h,U,J,c,y,p,e;for(U=0;U<G;U++){k=q[U];P=k.height;K=k.width;h=!k.hasLayout&&typeof k.doLayout=="function";if(typeof P!="number"){if(k.flex&&!P){V+=k.flex}else{if(!P&&h){k.doLayout()}X=k.getSize();K=X.width;P=X.height}}v=k.margins;p=v.top+v.bottom;m+=p+(P||0);N+=p+(k.flex?k.minHeight||0:P);o+=p+(k.minHeight||P||0);if(typeof K!="number"){if(h){k.doLayout()}K=k.getWidth()}w=Math.max(w,K+v.left+v.right);I.push({component:k,height:P||undefined,width:K||undefined})}var O=N-d,n=o>d;var s=Math.max(0,(d-m-z));if(n){for(U=0,t=G;U<t;U++){I[U].height=q[U].minHeight||q[U].height||I[U].height}}else{if(O>0){var L=[];for(var F=0,t=G;F<t;F++){var C=q[F],u=C.minHeight||0;if(C.flex){I[F].height=u}else{L.push({minHeight:u,available:I[F].height-u,index:F})}}L.sort(function(Z,i){return Z.available>i.available?1:-1});for(var U=0,t=L.length;U<t;U++){var H=L[U].index;if(H==undefined){continue}var C=q[H],l=I[H],x=l.height,u=C.minHeight,D=Math.max(u,x-Math.ceil(O/(t-U))),g=x-D;I[H].height=D;O-=g}}else{var S=s,r=V;for(U=0;U<G;U++){k=q[U];J=I[U];v=k.margins;y=v.left+v.right;if(R&&k.flex&&!k.height){flexedHeight=Math.ceil((k.flex/r)*S);S-=flexedHeight;r-=k.flex;J.height=flexedHeight;J.dirtySize=true}}}}if(Y){E+=s/2}else{if(B){E+=s}}for(U=0;U<G;U++){k=q[U];J=I[U];v=k.margins;E+=v.top;y=v.left+v.right;J.left=W+v.left;J.top=E;switch(this.align){case"stretch":e=M-y;J.width=e.constrain(k.minWidth||0,k.maxWidth||1000000);J.dirtySize=true;break;case"stretchmax":e=w-y;J.width=e.constrain(k.minWidth||0,k.maxWidth||1000000);J.dirtySize=true;break;case"center":var A=M-J.width-y;if(A>0){J.left=W+y+(A/2)}}E+=J.height+v.bottom}return{boxes:I,meta:{maxWidth:w,nonFlexHeight:m,desiredHeight:N,minimumHeight:o,shortfall:N-d,tooNarrow:n}}}});Ext.Container.LAYOUTS.vbox=Ext.layout.VBoxLayout;Ext.layout.ToolbarLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"toolbar",triggerWidth:18,noItemsMenuText:'<div class="x-toolbar-no-items">(None)</div>',lastOverflow:false,tableHTML:['<table cellspacing="0" class="x-toolbar-ct">',"<tbody>","<tr>",'<td class="x-toolbar-left" align="{0}">','<table cellspacing="0">',"<tbody>",'<tr class="x-toolbar-left-row"></tr>',"</tbody>","</table>","</td>",'<td class="x-toolbar-right" align="right">','<table cellspacing="0" class="x-toolbar-right-ct">',"<tbody>","<tr>","<td>",'<table cellspacing="0">',"<tbody>",'<tr class="x-toolbar-right-row"></tr>',"</tbody>","</table>","</td>","<td>",'<table cellspacing="0">',"<tbody>",'<tr class="x-toolbar-extras-row"></tr>',"</tbody>","</table>","</td>","</tr>","</tbody>","</table>","</td>","</tr>","</tbody>","</table>"].join(""),onLayout:function(e,k){if(!this.leftTr){var h=e.buttonAlign=="center"?"center":"left";k.addClass("x-toolbar-layout-ct");k.insertHtml("beforeEnd",String.format(this.tableHTML,h));this.leftTr=k.child("tr.x-toolbar-left-row",true);this.rightTr=k.child("tr.x-toolbar-right-row",true);this.extrasTr=k.child("tr.x-toolbar-extras-row",true);if(this.hiddenItem==undefined){this.hiddenItems=[]}}var l=e.buttonAlign=="right"?this.rightTr:this.leftTr,m=e.items.items,d=0;for(var b=0,g=m.length,n;b<g;b++,d++){n=m[b];if(n.isFill){l=this.rightTr;d=-1}else{if(!n.rendered){n.render(this.insertCell(n,l,d));this.configureItem(n)}else{if(!n.xtbHidden&&!this.isValidParent(n,l.childNodes[d])){var a=this.insertCell(n,l,d);a.appendChild(n.getPositionEl().dom);n.container=Ext.get(a)}}}}this.cleanup(this.leftTr);this.cleanup(this.rightTr);this.cleanup(this.extrasTr);this.fitToSize(k)},cleanup:function(b){var e=b.childNodes,a,d;for(a=e.length-1;a>=0&&(d=e[a]);a--){if(!d.firstChild){b.removeChild(d)}}},insertCell:function(e,b,a){var d=document.createElement("td");d.className="x-toolbar-cell";b.insertBefore(d,b.childNodes[a]||null);return d},hideItem:function(a){this.hiddenItems.push(a);a.xtbHidden=true;a.xtbWidth=a.getPositionEl().dom.parentNode.offsetWidth;a.hide()},unhideItem:function(a){a.show();a.xtbHidden=false;this.hiddenItems.remove(a)},getItemWidth:function(a){return a.hidden?(a.xtbWidth||0):a.getPositionEl().dom.parentNode.offsetWidth},fitToSize:function(l){if(this.container.enableOverflow===false){return}var b=l.dom.clientWidth,k=l.dom.firstChild.offsetWidth,n=b-this.triggerWidth,a=this.lastWidth||0,c=this.hiddenItems,e=c.length!=0,o=b>=a;this.lastWidth=b;if(k>b||(e&&o)){var m=this.container.items.items,h=m.length,d=0,p;for(var g=0;g<h;g++){p=m[g];if(!p.isFill){d+=this.getItemWidth(p);if(d>n){if(!(p.hidden||p.xtbHidden)){this.hideItem(p)}}else{if(p.xtbHidden){this.unhideItem(p)}}}}}e=c.length!=0;if(e){this.initMore();if(!this.lastOverflow){this.container.fireEvent("overflowchange",this.container,true);this.lastOverflow=true}}else{if(this.more){this.clearMenu();this.more.destroy();delete this.more;if(this.lastOverflow){this.container.fireEvent("overflowchange",this.container,false);this.lastOverflow=false}}}},createMenuConfig:function(c,a){var b=Ext.apply({},c.initialConfig),d=c.toggleGroup;Ext.copyTo(b,c,["iconCls","icon","itemId","disabled","handler","scope","menu"]);Ext.apply(b,{text:c.overflowText||c.text,hideOnClick:a});if(d||c.enableToggle){Ext.apply(b,{group:d,checked:c.pressed,listeners:{checkchange:function(g,e){c.toggle(e)}}})}delete b.ownerCt;delete b.xtype;delete b.id;return b},addComponentToMenu:function(b,a){if(a instanceof Ext.Toolbar.Separator){b.add("-")}else{if(Ext.isFunction(a.isXType)){if(a.isXType("splitbutton")){b.add(this.createMenuConfig(a,true))}else{if(a.isXType("button")){b.add(this.createMenuConfig(a,!a.menu))}else{if(a.isXType("buttongroup")){a.items.each(function(c){this.addComponentToMenu(b,c)},this)}}}}}},clearMenu:function(){var a=this.moreMenu;if(a&&a.items){a.items.each(function(b){delete b.menu})}},beforeMoreShow:function(h){var b=this.container.items.items,a=b.length,g,e;var c=function(k,i){return k.isXType("buttongroup")&&!(i instanceof Ext.Toolbar.Separator)};this.clearMenu();h.removeAll();for(var d=0;d<a;d++){g=b[d];if(g.xtbHidden){if(e&&(c(g,e)||c(e,g))){h.add("-")}this.addComponentToMenu(h,g);e=g}}if(h.items.length<1){h.add(this.noItemsMenuText)}},initMore:function(){if(!this.more){this.moreMenu=new Ext.menu.Menu({ownerCt:this.container,listeners:{beforeshow:this.beforeMoreShow,scope:this}});this.more=new Ext.Button({iconCls:"x-toolbar-more-icon",cls:"x-toolbar-more",menu:this.moreMenu,ownerCt:this.container});var a=this.insertCell(this.more,this.extrasTr,100);this.more.render(a)}},destroy:function(){Ext.destroy(this.more,this.moreMenu);delete this.leftTr;delete this.rightTr;delete this.extrasTr;Ext.layout.ToolbarLayout.superclass.destroy.call(this)}});Ext.Container.LAYOUTS.toolbar=Ext.layout.ToolbarLayout;Ext.layout.MenuLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"menu",setContainer:function(a){this.monitorResize=!a.floating;a.on("autosize",this.doAutoSize,this);Ext.layout.MenuLayout.superclass.setContainer.call(this,a)},renderItem:function(g,b,e){if(!this.itemTpl){this.itemTpl=Ext.layout.MenuLayout.prototype.itemTpl=new Ext.XTemplate('<li id="{itemId}" class="{itemCls}">','<tpl if="needsIcon">','<img alt="{altText}" src="{icon}" class="{iconCls}"/>',"</tpl>","</li>")}if(g&&!g.rendered){if(Ext.isNumber(b)){b=e.dom.childNodes[b]}var d=this.getItemArgs(g);g.render(g.positionEl=b?this.itemTpl.insertBefore(b,d,true):this.itemTpl.append(e,d,true));g.positionEl.menuItemId=g.getItemId();if(!d.isMenuItem&&d.needsIcon){g.positionEl.addClass("x-menu-list-item-indent")}this.configureItem(g)}else{if(g&&!this.isValidParent(g,e)){if(Ext.isNumber(b)){b=e.dom.childNodes[b]}e.dom.insertBefore(g.getActionEl().dom,b||null)}}},getItemArgs:function(d){var a=d instanceof Ext.menu.Item,b=!(a||d instanceof Ext.menu.Separator);return{isMenuItem:a,needsIcon:b&&(d.icon||d.iconCls),icon:d.icon||Ext.BLANK_IMAGE_URL,iconCls:"x-menu-item-icon "+(d.iconCls||""),itemId:"x-menu-el-"+d.id,itemCls:"x-menu-list-item ",altText:d.altText||""}},isValidParent:function(b,a){return b.el.up("li.x-menu-list-item",5).dom.parentNode===(a.dom||a)},onLayout:function(a,b){Ext.layout.MenuLayout.superclass.onLayout.call(this,a,b);this.doAutoSize()},doAutoSize:function(){var c=this.container,a=c.width;if(c.floating){if(a){c.setWidth(a)}else{if(Ext.isIE){c.setWidth(Ext.isStrict&&(Ext.isIE7||Ext.isIE8)?"auto":c.minWidth);var d=c.getEl(),b=d.dom.offsetWidth;c.setWidth(c.getLayoutTarget().getWidth()+d.getFrameWidth("lr"))}}}}});Ext.Container.LAYOUTS.menu=Ext.layout.MenuLayout;Ext.Viewport=Ext.extend(Ext.Container,{initComponent:function(){Ext.Viewport.superclass.initComponent.call(this);document.getElementsByTagName("html")[0].className+=" x-viewport";this.el=Ext.getBody();this.el.setHeight=Ext.emptyFn;this.el.setWidth=Ext.emptyFn;this.el.setSize=Ext.emptyFn;this.el.dom.scroll="no";this.allowDomMove=false;this.autoWidth=true;this.autoHeight=true;Ext.EventManager.onWindowResize(this.fireResize,this);this.renderTo=this.el},fireResize:function(a,b){this.fireEvent("resize",this,a,b,a,b)}});Ext.reg("viewport",Ext.Viewport);Ext.Panel=Ext.extend(Ext.Container,{baseCls:"x-panel",collapsedCls:"x-panel-collapsed",maskDisabled:true,animCollapse:Ext.enableFx,headerAsText:true,buttonAlign:"right",collapsed:false,collapseFirst:true,minButtonWidth:75,elements:"body",preventBodyReset:false,padding:undefined,resizeEvent:"bodyresize",toolTarget:"header",collapseEl:"bwrap",slideAnchor:"t",disabledClass:"",deferHeight:true,expandDefaults:{duration:0.25},collapseDefaults:{duration:0.25},initComponent:function(){Ext.Panel.superclass.initComponent.call(this);this.addEvents("bodyresize","titlechange","iconchange","collapse","expand","beforecollapse","beforeexpand","beforeclose","close","activate","deactivate");if(this.unstyled){this.baseCls="x-plain"}this.toolbars=[];if(this.tbar){this.elements+=",tbar";this.topToolbar=this.createToolbar(this.tbar);this.tbar=null}if(this.bbar){this.elements+=",bbar";this.bottomToolbar=this.createToolbar(this.bbar);this.bbar=null}if(this.header===true){this.elements+=",header";this.header=null}else{if(this.headerCfg||(this.title&&this.header!==false)){this.elements+=",header"}}if(this.footerCfg||this.footer===true){this.elements+=",footer";this.footer=null}if(this.buttons){this.fbar=this.buttons;this.buttons=null}if(this.fbar){this.createFbar(this.fbar)}if(this.autoLoad){this.on("render",this.doAutoLoad,this,{delay:10})}},createFbar:function(b){var a=this.minButtonWidth;this.elements+=",footer";this.fbar=this.createToolbar(b,{buttonAlign:this.buttonAlign,toolbarCls:"x-panel-fbar",enableOverflow:false,defaults:function(d){return{minWidth:d.minWidth||a}}});this.fbar.items.each(function(d){d.minWidth=d.minWidth||this.minButtonWidth},this);this.buttons=this.fbar.items.items},createToolbar:function(b,c){var a;if(Ext.isArray(b)){b={items:b}}a=b.events?Ext.apply(b,c):this.createComponent(Ext.apply({},b,c),"toolbar");this.toolbars.push(a);return a},createElement:function(a,c){if(this[a]){c.appendChild(this[a].dom);return}if(a==="bwrap"||this.elements.indexOf(a)!=-1){if(this[a+"Cfg"]){this[a]=Ext.fly(c).createChild(this[a+"Cfg"])}else{var b=document.createElement("div");b.className=this[a+"Cls"];this[a]=Ext.get(c.appendChild(b))}if(this[a+"CssClass"]){this[a].addClass(this[a+"CssClass"])}if(this[a+"Style"]){this[a].applyStyles(this[a+"Style"])}}},onRender:function(g,e){Ext.Panel.superclass.onRender.call(this,g,e);this.createClasses();var a=this.el,h=a.dom,l,i;if(this.collapsible&&!this.hideCollapseTool){this.tools=this.tools?this.tools.slice(0):[];this.tools[this.collapseFirst?"unshift":"push"]({id:"toggle",handler:this.toggleCollapse,scope:this})}if(this.tools){i=this.tools;this.elements+=(this.header!==false)?",header":""}this.tools={};a.addClass(this.baseCls);if(h.firstChild){this.header=a.down("."+this.headerCls);this.bwrap=a.down("."+this.bwrapCls);var k=this.bwrap?this.bwrap:a;this.tbar=k.down("."+this.tbarCls);this.body=k.down("."+this.bodyCls);this.bbar=k.down("."+this.bbarCls);this.footer=k.down("."+this.footerCls);this.fromMarkup=true}if(this.preventBodyReset===true){a.addClass("x-panel-reset")}if(this.cls){a.addClass(this.cls)}if(this.buttons){this.elements+=",footer"}if(this.frame){a.insertHtml("afterBegin",String.format(Ext.Element.boxMarkup,this.baseCls));this.createElement("header",h.firstChild.firstChild.firstChild);this.createElement("bwrap",h);l=this.bwrap.dom;var c=h.childNodes[1],b=h.childNodes[2];l.appendChild(c);l.appendChild(b);var m=l.firstChild.firstChild.firstChild;this.createElement("tbar",m);this.createElement("body",m);this.createElement("bbar",m);this.createElement("footer",l.lastChild.firstChild.firstChild);if(!this.footer){this.bwrap.dom.lastChild.className+=" x-panel-nofooter"}this.ft=Ext.get(this.bwrap.dom.lastChild);this.mc=Ext.get(m)}else{this.createElement("header",h);this.createElement("bwrap",h);l=this.bwrap.dom;this.createElement("tbar",l);this.createElement("body",l);this.createElement("bbar",l);this.createElement("footer",l);if(!this.header){this.body.addClass(this.bodyCls+"-noheader");if(this.tbar){this.tbar.addClass(this.tbarCls+"-noheader")}}}if(Ext.isDefined(this.padding)){this.body.setStyle("padding",this.body.addUnits(this.padding))}if(this.border===false){this.el.addClass(this.baseCls+"-noborder");this.body.addClass(this.bodyCls+"-noborder");if(this.header){this.header.addClass(this.headerCls+"-noborder")}if(this.footer){this.footer.addClass(this.footerCls+"-noborder")}if(this.tbar){this.tbar.addClass(this.tbarCls+"-noborder")}if(this.bbar){this.bbar.addClass(this.bbarCls+"-noborder")}}if(this.bodyBorder===false){this.body.addClass(this.bodyCls+"-noborder")}this.bwrap.enableDisplayMode("block");if(this.header){this.header.unselectable();if(this.headerAsText){this.header.dom.innerHTML='<span class="'+this.headerTextCls+'">'+this.header.dom.innerHTML+"</span>";if(this.iconCls){this.setIconClass(this.iconCls)}}}if(this.floating){this.makeFloating(this.floating)}if(this.collapsible&&this.titleCollapse&&this.header){this.mon(this.header,"click",this.toggleCollapse,this);this.header.setStyle("cursor","pointer")}if(i){this.addTool.apply(this,i)}if(this.fbar){this.footer.addClass("x-panel-btns");this.fbar.ownerCt=this;this.fbar.render(this.footer);this.footer.createChild({cls:"x-clear"})}if(this.tbar&&this.topToolbar){this.topToolbar.ownerCt=this;this.topToolbar.render(this.tbar)}if(this.bbar&&this.bottomToolbar){this.bottomToolbar.ownerCt=this;this.bottomToolbar.render(this.bbar)}},setIconClass:function(b){var a=this.iconCls;this.iconCls=b;if(this.rendered&&this.header){if(this.frame){this.header.addClass("x-panel-icon");this.header.replaceClass(a,this.iconCls)}else{var e=this.header,c=e.child("img.x-panel-inline-icon");if(c){Ext.fly(c).replaceClass(a,this.iconCls)}else{var d=e.child("span."+this.headerTextCls);if(d){Ext.DomHelper.insertBefore(d.dom,{tag:"img",alt:"",src:Ext.BLANK_IMAGE_URL,cls:"x-panel-inline-icon "+this.iconCls})}}}}this.fireEvent("iconchange",this,b,a)},makeFloating:function(a){this.floating=true;this.el=new Ext.Layer(Ext.apply({},a,{shadow:Ext.isDefined(this.shadow)?this.shadow:"sides",shadowOffset:this.shadowOffset,constrain:false,shim:this.shim===false?false:undefined}),this.el)},getTopToolbar:function(){return this.topToolbar},getBottomToolbar:function(){return this.bottomToolbar},getFooterToolbar:function(){return this.fbar},addButton:function(a,c,b){if(!this.fbar){this.createFbar([])}if(c){if(Ext.isString(a)){a={text:a}}a=Ext.apply({handler:c,scope:b},a)}return this.fbar.add(a)},addTool:function(){if(!this.rendered){if(!this.tools){this.tools=[]}Ext.each(arguments,function(a){this.tools.push(a)},this);return}if(!this[this.toolTarget]){return}if(!this.toolTemplate){var h=new Ext.Template('<div class="x-tool x-tool-{id}">&#160;</div>');h.disableFormats=true;h.compile();Ext.Panel.prototype.toolTemplate=h}for(var g=0,d=arguments,c=d.length;g<c;g++){var b=d[g];if(!this.tools[b.id]){var k="x-tool-"+b.id+"-over";var e=this.toolTemplate.insertFirst(this[this.toolTarget],b,true);this.tools[b.id]=e;e.enableDisplayMode("block");this.mon(e,"click",this.createToolHandler(e,b,k,this));if(b.on){this.mon(e,b.on)}if(b.hidden){e.hide()}if(b.qtip){if(Ext.isObject(b.qtip)){Ext.QuickTips.register(Ext.apply({target:e.id},b.qtip))}else{e.dom.qtip=b.qtip}}e.addClassOnOver(k)}}},onLayout:function(b,a){Ext.Panel.superclass.onLayout.apply(this,arguments);if(this.hasLayout&&this.toolbars.length>0){Ext.each(this.toolbars,function(c){c.doLayout(undefined,a)});this.syncHeight()}},syncHeight:function(){var b=this.toolbarHeight,c=this.body,a=this.lastSize.height,d;if(this.autoHeight||!Ext.isDefined(a)||a=="auto"){return}if(b!=this.getToolbarHeight()){b=Math.max(0,a-this.getFrameHeight());c.setHeight(b);d=c.getSize();this.toolbarHeight=this.getToolbarHeight();this.onBodyResize(d.width,d.height)}},onShow:function(){if(this.floating){return this.el.show()}Ext.Panel.superclass.onShow.call(this)},onHide:function(){if(this.floating){return this.el.hide()}Ext.Panel.superclass.onHide.call(this)},createToolHandler:function(c,a,d,b){return function(g){c.removeClass(d);if(a.stopEvent!==false){g.stopEvent()}if(a.handler){a.handler.call(a.scope||c,g,c,b,a)}}},afterRender:function(){if(this.floating&&!this.hidden){this.el.show()}if(this.title){this.setTitle(this.title)}Ext.Panel.superclass.afterRender.call(this);if(this.collapsed){this.collapsed=false;this.collapse(false)}this.initEvents()},getKeyMap:function(){if(!this.keyMap){this.keyMap=new Ext.KeyMap(this.el,this.keys)}return this.keyMap},initEvents:function(){if(this.keys){this.getKeyMap()}if(this.draggable){this.initDraggable()}if(this.toolbars.length>0){Ext.each(this.toolbars,function(a){a.doLayout();a.on({scope:this,afterlayout:this.syncHeight,remove:this.syncHeight})},this);this.syncHeight()}},initDraggable:function(){this.dd=new Ext.Panel.DD(this,Ext.isBoolean(this.draggable)?null:this.draggable)},beforeEffect:function(a){if(this.floating){this.el.beforeAction()}if(a!==false){this.el.addClass("x-panel-animated")}},afterEffect:function(a){this.syncShadow();this.el.removeClass("x-panel-animated")},createEffect:function(c,b,d){var e={scope:d,block:true};if(c===true){e.callback=b;return e}else{if(!c.callback){e.callback=b}else{e.callback=function(){b.call(d);Ext.callback(c.callback,c.scope)}}}return Ext.applyIf(e,c)},collapse:function(b){if(this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforecollapse",this,b)===false){return}var a=b===true||(b!==false&&this.animCollapse);this.beforeEffect(a);this.onCollapse(a,b);return this},onCollapse:function(a,b){if(a){this[this.collapseEl].slideOut(this.slideAnchor,Ext.apply(this.createEffect(b||true,this.afterCollapse,this),this.collapseDefaults))}else{this[this.collapseEl].hide(this.hideMode);this.afterCollapse(false)}},afterCollapse:function(a){this.collapsed=true;this.el.addClass(this.collapsedCls);if(a!==false){this[this.collapseEl].hide(this.hideMode)}this.afterEffect(a);this.cascade(function(b){if(b.lastSize){b.lastSize={width:undefined,height:undefined}}});this.fireEvent("collapse",this)},expand:function(b){if(!this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforeexpand",this,b)===false){return}var a=b===true||(b!==false&&this.animCollapse);this.el.removeClass(this.collapsedCls);this.beforeEffect(a);this.onExpand(a,b);return this},onExpand:function(a,b){if(a){this[this.collapseEl].slideIn(this.slideAnchor,Ext.apply(this.createEffect(b||true,this.afterExpand,this),this.expandDefaults))}else{this[this.collapseEl].show(this.hideMode);this.afterExpand(false)}},afterExpand:function(a){this.collapsed=false;if(a!==false){this[this.collapseEl].show(this.hideMode)}this.afterEffect(a);if(this.deferLayout){delete this.deferLayout;this.doLayout(true)}this.fireEvent("expand",this)},toggleCollapse:function(a){this[this.collapsed?"expand":"collapse"](a);return this},onDisable:function(){if(this.rendered&&this.maskDisabled){this.el.mask()}Ext.Panel.superclass.onDisable.call(this)},onEnable:function(){if(this.rendered&&this.maskDisabled){this.el.unmask()}Ext.Panel.superclass.onEnable.call(this)},onResize:function(g,d,c,e){var a=g,b=d;if(Ext.isDefined(a)||Ext.isDefined(b)){if(!this.collapsed){if(Ext.isNumber(a)){this.body.setWidth(a=this.adjustBodyWidth(a-this.getFrameWidth()))}else{if(a=="auto"){a=this.body.setWidth("auto").dom.offsetWidth}else{a=this.body.dom.offsetWidth}}if(this.tbar){this.tbar.setWidth(a);if(this.topToolbar){this.topToolbar.setSize(a)}}if(this.bbar){this.bbar.setWidth(a);if(this.bottomToolbar){this.bottomToolbar.setSize(a);if(Ext.isIE){this.bbar.setStyle("position","static");this.bbar.setStyle("position","")}}}if(this.footer){this.footer.setWidth(a);if(this.fbar){this.fbar.setSize(Ext.isIE?(a-this.footer.getFrameWidth("lr")):"auto")}}if(Ext.isNumber(b)){b=Math.max(0,b-this.getFrameHeight());this.body.setHeight(b)}else{if(b=="auto"){this.body.setHeight(b)}}if(this.disabled&&this.el._mask){this.el._mask.setSize(this.el.dom.clientWidth,this.el.getHeight())}}else{this.queuedBodySize={width:a,height:b};if(!this.queuedExpand&&this.allowQueuedExpand!==false){this.queuedExpand=true;this.on("expand",function(){delete this.queuedExpand;this.onResize(this.queuedBodySize.width,this.queuedBodySize.height)},this,{single:true})}}this.onBodyResize(a,b)}this.syncShadow();Ext.Panel.superclass.onResize.call(this,g,d,c,e)},onBodyResize:function(a,b){this.fireEvent("bodyresize",this,a,b)},getToolbarHeight:function(){var a=0;if(this.rendered){Ext.each(this.toolbars,function(b){a+=b.getHeight()},this)}return a},adjustBodyHeight:function(a){return a},adjustBodyWidth:function(a){return a},onPosition:function(){this.syncShadow()},getFrameWidth:function(){var b=this.el.getFrameWidth("lr")+this.bwrap.getFrameWidth("lr");if(this.frame){var a=this.bwrap.dom.firstChild;b+=(Ext.fly(a).getFrameWidth("l")+Ext.fly(a.firstChild).getFrameWidth("r"));b+=this.mc.getFrameWidth("lr")}return b},getFrameHeight:function(){var a=this.el.getFrameWidth("tb")+this.bwrap.getFrameWidth("tb");a+=(this.tbar?this.tbar.getHeight():0)+(this.bbar?this.bbar.getHeight():0);if(this.frame){a+=this.el.dom.firstChild.offsetHeight+this.ft.dom.offsetHeight+this.mc.getFrameWidth("tb")}else{a+=(this.header?this.header.getHeight():0)+(this.footer?this.footer.getHeight():0)}return a},getInnerWidth:function(){return this.getSize().width-this.getFrameWidth()},getInnerHeight:function(){return this.body.getHeight()},syncShadow:function(){if(this.floating){this.el.sync(true)}},getLayoutTarget:function(){return this.body},getContentTarget:function(){return this.body},setTitle:function(b,a){this.title=b;if(this.header&&this.headerAsText){this.header.child("span").update(b)}if(a){this.setIconClass(a)}this.fireEvent("titlechange",this,b);return this},getUpdater:function(){return this.body.getUpdater()},load:function(){var a=this.body.getUpdater();a.update.apply(a,arguments);return this},beforeDestroy:function(){Ext.Panel.superclass.beforeDestroy.call(this);if(this.header){this.header.removeAllListeners()}if(this.tools){for(var a in this.tools){Ext.destroy(this.tools[a])}}if(this.toolbars.length>0){Ext.each(this.toolbars,function(b){b.un("afterlayout",this.syncHeight,this);b.un("remove",this.syncHeight,this)},this)}if(Ext.isArray(this.buttons)){while(this.buttons.length){Ext.destroy(this.buttons[0])}}if(this.rendered){Ext.destroy(this.ft,this.header,this.footer,this.tbar,this.bbar,this.body,this.mc,this.bwrap,this.dd);if(this.fbar){Ext.destroy(this.fbar,this.fbar.el)}}Ext.destroy(this.toolbars)},createClasses:function(){this.headerCls=this.baseCls+"-header";this.headerTextCls=this.baseCls+"-header-text";this.bwrapCls=this.baseCls+"-bwrap";this.tbarCls=this.baseCls+"-tbar";this.bodyCls=this.baseCls+"-body";this.bbarCls=this.baseCls+"-bbar";this.footerCls=this.baseCls+"-footer"},createGhost:function(a,e,b){var d=document.createElement("div");d.className="x-panel-ghost "+(a?a:"");if(this.header){d.appendChild(this.el.dom.firstChild.cloneNode(true))}Ext.fly(d.appendChild(document.createElement("ul"))).setHeight(this.bwrap.getHeight());d.style.width=this.el.dom.offsetWidth+"px";if(!b){this.container.dom.appendChild(d)}else{Ext.getDom(b).appendChild(d)}if(e!==false&&this.el.useShim!==false){var c=new Ext.Layer({shadow:false,useDisplay:true,constrain:false},d);c.show();return c}else{return new Ext.Element(d)}},doAutoLoad:function(){var a=this.body.getUpdater();if(this.renderer){a.setRenderer(this.renderer)}a.update(Ext.isObject(this.autoLoad)?this.autoLoad:{url:this.autoLoad})},getTool:function(a){return this.tools[a]}});Ext.reg("panel",Ext.Panel);Ext.Editor=function(b,a){if(b.field){this.field=Ext.create(b.field,"textfield");a=Ext.apply({},b);delete a.field}else{this.field=b}Ext.Editor.superclass.constructor.call(this,a)};Ext.extend(Ext.Editor,Ext.Component,{allowBlur:true,value:"",alignment:"c-c?",offsets:[0,0],shadow:"frame",constrain:false,swallowKeys:true,completeOnEnter:true,cancelOnEsc:true,updateEl:false,initComponent:function(){Ext.Editor.superclass.initComponent.call(this);this.addEvents("beforestartedit","startedit","beforecomplete","complete","canceledit","specialkey")},onRender:function(b,a){this.el=new Ext.Layer({shadow:this.shadow,cls:"x-editor",parentEl:b,shim:this.shim,shadowOffset:this.shadowOffset||4,id:this.id,constrain:this.constrain});if(this.zIndex){this.el.setZIndex(this.zIndex)}this.el.setStyle("overflow",Ext.isGecko?"auto":"hidden");if(this.field.msgTarget!="title"){this.field.msgTarget="qtip"}this.field.inEditor=true;this.mon(this.field,{scope:this,blur:this.onBlur,specialkey:this.onSpecialKey});if(this.field.grow){this.mon(this.field,"autosize",this.el.sync,this.el,{delay:1})}this.field.render(this.el).show();this.field.getEl().dom.name="";if(this.swallowKeys){this.field.el.swallowEvent(["keypress","keydown"])}},onSpecialKey:function(g,d){var b=d.getKey(),a=this.completeOnEnter&&b==d.ENTER,c=this.cancelOnEsc&&b==d.ESC;if(a||c){d.stopEvent();if(a){this.completeEdit()}else{this.cancelEdit()}if(g.triggerBlur){g.triggerBlur()}}this.fireEvent("specialkey",g,d)},startEdit:function(b,c){if(this.editing){this.completeEdit()}this.boundEl=Ext.get(b);var a=c!==undefined?c:this.boundEl.dom.innerHTML;if(!this.rendered){this.render(this.parentEl||document.body)}if(this.fireEvent("beforestartedit",this,this.boundEl,a)!==false){this.startValue=a;this.field.reset();this.field.setValue(a);this.realign(true);this.editing=true;this.show()}},doAutoSize:function(){if(this.autoSize){var b=this.boundEl.getSize(),a=this.field.getSize();switch(this.autoSize){case"width":this.setSize(b.width,a.height);break;case"height":this.setSize(a.width,b.height);break;case"none":this.setSize(a.width,a.height);break;default:this.setSize(b.width,b.height)}}},setSize:function(a,b){delete this.field.lastSize;this.field.setSize(a,b);if(this.el){if(Ext.isGecko2||Ext.isOpera||(Ext.isIE7&&Ext.isStrict)){this.el.setSize(a,b)}this.el.sync()}},realign:function(a){if(a===true){this.doAutoSize()}this.el.alignTo(this.boundEl,this.alignment,this.offsets)},completeEdit:function(a){if(!this.editing){return}if(this.field.assertValue){this.field.assertValue()}var b=this.getValue();if(!this.field.isValid()){if(this.revertInvalid!==false){this.cancelEdit(a)}return}if(String(b)===String(this.startValue)&&this.ignoreNoChange){this.hideEdit(a);return}if(this.fireEvent("beforecomplete",this,b,this.startValue)!==false){b=this.getValue();if(this.updateEl&&this.boundEl){this.boundEl.update(b)}this.hideEdit(a);this.fireEvent("complete",this,b,this.startValue)}},onShow:function(){this.el.show();if(this.hideEl!==false){this.boundEl.hide()}this.field.show().focus(false,true);this.fireEvent("startedit",this.boundEl,this.startValue)},cancelEdit:function(a){if(this.editing){var b=this.getValue();this.setValue(this.startValue);this.hideEdit(a);this.fireEvent("canceledit",this,b,this.startValue)}},hideEdit:function(a){if(a!==true){this.editing=false;this.hide()}},onBlur:function(){if(this.allowBlur===true&&this.editing&&this.selectSameEditor!==true){this.completeEdit()}},onHide:function(){if(this.editing){this.completeEdit();return}this.field.blur();if(this.field.collapse){this.field.collapse()}this.el.hide();if(this.hideEl!==false){this.boundEl.show()}},setValue:function(a){this.field.setValue(a)},getValue:function(){return this.field.getValue()},beforeDestroy:function(){Ext.destroyMembers(this,"field");delete this.parentEl;delete this.boundEl}});Ext.reg("editor",Ext.Editor);Ext.ColorPalette=Ext.extend(Ext.Component,{itemCls:"x-color-palette",value:null,clickEvent:"click",ctype:"Ext.ColorPalette",allowReselect:false,colors:["000000","993300","333300","003300","003366","000080","333399","333333","800000","FF6600","808000","008000","008080","0000FF","666699","808080","FF0000","FF9900","99CC00","339966","33CCCC","3366FF","800080","969696","FF00FF","FFCC00","FFFF00","00FF00","00FFFF","00CCFF","993366","C0C0C0","FF99CC","FFCC99","FFFF99","CCFFCC","CCFFFF","99CCFF","CC99FF","FFFFFF"],initComponent:function(){Ext.ColorPalette.superclass.initComponent.call(this);this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope,true)}},onRender:function(b,a){this.autoEl={tag:"div",cls:this.itemCls};Ext.ColorPalette.superclass.onRender.call(this,b,a);var c=this.tpl||new Ext.XTemplate('<tpl for="."><a href="#" class="color-{.}" hidefocus="on"><em><span style="background:#{.}" unselectable="on">&#160;</span></em></a></tpl>');c.overwrite(this.el,this.colors);this.mon(this.el,this.clickEvent,this.handleClick,this,{delegate:"a"});if(this.clickEvent!="click"){this.mon(this.el,"click",Ext.emptyFn,this,{delegate:"a",preventDefault:true})}},afterRender:function(){Ext.ColorPalette.superclass.afterRender.call(this);if(this.value){var a=this.value;this.value=null;this.select(a,true)}},handleClick:function(b,a){b.preventDefault();if(!this.disabled){var d=a.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];this.select(d.toUpperCase())}},select:function(b,a){b=b.replace("#","");if(b!=this.value||this.allowReselect){var c=this.el;if(this.value){c.child("a.color-"+this.value).removeClass("x-color-palette-sel")}c.child("a.color-"+b).addClass("x-color-palette-sel");this.value=b;if(a!==true){this.fireEvent("select",this,b)}}}});Ext.reg("colorpalette",Ext.ColorPalette);Ext.DatePicker=Ext.extend(Ext.BoxComponent,{todayText:"Today",okText:"&#160;OK&#160;",cancelText:"Cancel",todayTip:"{0} (Spacebar)",minText:"This date is before the minimum date",maxText:"This date is after the maximum date",format:"m/d/y",disabledDaysText:"Disabled",disabledDatesText:"Disabled",monthNames:Date.monthNames,dayNames:Date.dayNames,nextText:"Next Month (Control+Right)",prevText:"Previous Month (Control+Left)",monthYearText:"Choose a month (Control+Up/Down to move years)",startDay:0,showToday:true,focusOnSelect:true,initHour:12,initComponent:function(){Ext.DatePicker.superclass.initComponent.call(this);this.value=this.value?this.value.clearTime(true):new Date().clearTime();this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope||this)}this.initDisabledDays()},initDisabledDays:function(){if(!this.disabledDatesRE&&this.disabledDates){var b=this.disabledDates,a=b.length-1,c="(?:";Ext.each(b,function(g,e){c+=Ext.isDate(g)?"^"+Ext.escapeRe(g.dateFormat(this.format))+"$":b[e];if(e!=a){c+="|"}},this);this.disabledDatesRE=new RegExp(c+")")}},setDisabledDates:function(a){if(Ext.isArray(a)){this.disabledDates=a;this.disabledDatesRE=null}else{this.disabledDatesRE=a}this.initDisabledDays();this.update(this.value,true)},setDisabledDays:function(a){this.disabledDays=a;this.update(this.value,true)},setMinDate:function(a){this.minDate=a;this.update(this.value,true)},setMaxDate:function(a){this.maxDate=a;this.update(this.value,true)},setValue:function(a){this.value=a.clearTime(true);this.update(this.value)},getValue:function(){return this.value},focus:function(){this.update(this.activeDate)},onEnable:function(a){Ext.DatePicker.superclass.onEnable.call(this);this.doDisabled(false);this.update(a?this.value:this.activeDate);if(Ext.isIE){this.el.repaint()}},onDisable:function(){Ext.DatePicker.superclass.onDisable.call(this);this.doDisabled(true);if(Ext.isIE&&!Ext.isIE8){Ext.each([].concat(this.textNodes,this.el.query("th span")),function(a){Ext.fly(a).repaint()})}},doDisabled:function(a){this.keyNav.setDisabled(a);this.prevRepeater.setDisabled(a);this.nextRepeater.setDisabled(a);if(this.showToday){this.todayKeyListener.setDisabled(a);this.todayBtn.setDisabled(a)}},onRender:function(e,b){var a=['<table cellspacing="0">','<tr><td class="x-date-left"><a href="#" title="',this.prevText,'">&#160;</a></td><td class="x-date-middle" align="center"></td><td class="x-date-right"><a href="#" title="',this.nextText,'">&#160;</a></td></tr>','<tr><td colspan="3"><table class="x-date-inner" cellspacing="0"><thead><tr>'],c=this.dayNames,h;for(h=0;h<7;h++){var l=this.startDay+h;if(l>6){l=l-7}a.push("<th><span>",c[l].substr(0,1),"</span></th>")}a[a.length]="</tr></thead><tbody><tr>";for(h=0;h<42;h++){if(h%7===0&&h!==0){a[a.length]="</tr><tr>"}a[a.length]='<td><a href="#" hidefocus="on" class="x-date-date" tabIndex="1"><em><span></span></em></a></td>'}a.push("</tr></tbody></table></td></tr>",this.showToday?'<tr><td colspan="3" class="x-date-bottom" align="center"></td></tr>':"",'</table><div class="x-date-mp"></div>');var k=document.createElement("div");k.className="x-date-picker";k.innerHTML=a.join("");e.dom.insertBefore(k,b);this.el=Ext.get(k);this.eventEl=Ext.get(k.firstChild);this.prevRepeater=new Ext.util.ClickRepeater(this.el.child("td.x-date-left a"),{handler:this.showPrevMonth,scope:this,preventDefault:true,stopDefault:true});this.nextRepeater=new Ext.util.ClickRepeater(this.el.child("td.x-date-right a"),{handler:this.showNextMonth,scope:this,preventDefault:true,stopDefault:true});this.monthPicker=this.el.down("div.x-date-mp");this.monthPicker.enableDisplayMode("block");this.keyNav=new Ext.KeyNav(this.eventEl,{left:function(d){if(d.ctrlKey){this.showPrevMonth()}else{this.update(this.activeDate.add("d",-1))}},right:function(d){if(d.ctrlKey){this.showNextMonth()}else{this.update(this.activeDate.add("d",1))}},up:function(d){if(d.ctrlKey){this.showNextYear()}else{this.update(this.activeDate.add("d",-7))}},down:function(d){if(d.ctrlKey){this.showPrevYear()}else{this.update(this.activeDate.add("d",7))}},pageUp:function(d){this.showNextMonth()},pageDown:function(d){this.showPrevMonth()},enter:function(d){d.stopPropagation();return true},scope:this});this.el.unselectable();this.cells=this.el.select("table.x-date-inner tbody td");this.textNodes=this.el.query("table.x-date-inner tbody span");this.mbtn=new Ext.Button({text:"&#160;",tooltip:this.monthYearText,renderTo:this.el.child("td.x-date-middle",true)});this.mbtn.el.child("em").addClass("x-btn-arrow");if(this.showToday){this.todayKeyListener=this.eventEl.addKeyListener(Ext.EventObject.SPACE,this.selectToday,this);var g=(new Date()).dateFormat(this.format);this.todayBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom",true),text:String.format(this.todayText,g),tooltip:String.format(this.todayTip,g),handler:this.selectToday,scope:this})}this.mon(this.eventEl,"mousewheel",this.handleMouseWheel,this);this.mon(this.eventEl,"click",this.handleDateClick,this,{delegate:"a.x-date-date"});this.mon(this.mbtn,"click",this.showMonthPicker,this);this.onEnable(true)},createMonthPicker:function(){if(!this.monthPicker.dom.firstChild){var a=['<table border="0" cellspacing="0">'];for(var b=0;b<6;b++){a.push('<tr><td class="x-date-mp-month"><a href="#">',Date.getShortMonthName(b),"</a></td>",'<td class="x-date-mp-month x-date-mp-sep"><a href="#">',Date.getShortMonthName(b+6),"</a></td>",b===0?'<td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-prev"></a></td><td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-next"></a></td></tr>':'<td class="x-date-mp-year"><a href="#"></a></td><td class="x-date-mp-year"><a href="#"></a></td></tr>')}a.push('<tr class="x-date-mp-btns"><td colspan="4"><button type="button" class="x-date-mp-ok">',this.okText,'</button><button type="button" class="x-date-mp-cancel">',this.cancelText,"</button></td></tr>","</table>");this.monthPicker.update(a.join(""));this.mon(this.monthPicker,"click",this.onMonthClick,this);this.mon(this.monthPicker,"dblclick",this.onMonthDblClick,this);this.mpMonths=this.monthPicker.select("td.x-date-mp-month");this.mpYears=this.monthPicker.select("td.x-date-mp-year");this.mpMonths.each(function(c,d,e){e+=1;if((e%2)===0){c.dom.xmonth=5+Math.round(e*0.5)}else{c.dom.xmonth=Math.round((e-1)*0.5)}})}},showMonthPicker:function(){if(!this.disabled){this.createMonthPicker();var a=this.el.getSize();this.monthPicker.setSize(a);this.monthPicker.child("table").setSize(a);this.mpSelMonth=(this.activeDate||this.value).getMonth();this.updateMPMonth(this.mpSelMonth);this.mpSelYear=(this.activeDate||this.value).getFullYear();this.updateMPYear(this.mpSelYear);this.monthPicker.slideIn("t",{duration:0.2})}},updateMPYear:function(e){this.mpyear=e;var c=this.mpYears.elements;for(var b=1;b<=10;b++){var d=c[b-1],a;if((b%2)===0){a=e+Math.round(b*0.5);d.firstChild.innerHTML=a;d.xyear=a}else{a=e-(5-Math.round(b*0.5));d.firstChild.innerHTML=a;d.xyear=a}this.mpYears.item(b-1)[a==this.mpSelYear?"addClass":"removeClass"]("x-date-mp-sel")}},updateMPMonth:function(a){this.mpMonths.each(function(b,c,d){b[b.dom.xmonth==a?"addClass":"removeClass"]("x-date-mp-sel")})},selectMPMonth:function(a){},onMonthClick:function(g,b){g.stopEvent();var c=new Ext.Element(b),a;if(c.is("button.x-date-mp-cancel")){this.hideMonthPicker()}else{if(c.is("button.x-date-mp-ok")){var h=new Date(this.mpSelYear,this.mpSelMonth,(this.activeDate||this.value).getDate());if(h.getMonth()!=this.mpSelMonth){h=new Date(this.mpSelYear,this.mpSelMonth,1).getLastDateOfMonth()}this.update(h);this.hideMonthPicker()}else{if((a=c.up("td.x-date-mp-month",2))){this.mpMonths.removeClass("x-date-mp-sel");a.addClass("x-date-mp-sel");this.mpSelMonth=a.dom.xmonth}else{if((a=c.up("td.x-date-mp-year",2))){this.mpYears.removeClass("x-date-mp-sel");a.addClass("x-date-mp-sel");this.mpSelYear=a.dom.xyear}else{if(c.is("a.x-date-mp-prev")){this.updateMPYear(this.mpyear-10)}else{if(c.is("a.x-date-mp-next")){this.updateMPYear(this.mpyear+10)}}}}}}},onMonthDblClick:function(d,b){d.stopEvent();var c=new Ext.Element(b),a;if((a=c.up("td.x-date-mp-month",2))){this.update(new Date(this.mpSelYear,a.dom.xmonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}else{if((a=c.up("td.x-date-mp-year",2))){this.update(new Date(a.dom.xyear,this.mpSelMonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}}},hideMonthPicker:function(a){if(this.monthPicker){if(a===true){this.monthPicker.hide()}else{this.monthPicker.slideOut("t",{duration:0.2})}}},showPrevMonth:function(a){this.update(this.activeDate.add("mo",-1))},showNextMonth:function(a){this.update(this.activeDate.add("mo",1))},showPrevYear:function(){this.update(this.activeDate.add("y",-1))},showNextYear:function(){this.update(this.activeDate.add("y",1))},handleMouseWheel:function(a){a.stopEvent();if(!this.disabled){var b=a.getWheelDelta();if(b>0){this.showPrevMonth()}else{if(b<0){this.showNextMonth()}}}},handleDateClick:function(b,a){b.stopEvent();if(!this.disabled&&a.dateValue&&!Ext.fly(a.parentNode).hasClass("x-date-disabled")){this.cancelFocus=this.focusOnSelect===false;this.setValue(new Date(a.dateValue));delete this.cancelFocus;this.fireEvent("select",this,this.value)}},selectToday:function(){if(this.todayBtn&&!this.todayBtn.disabled){this.setValue(new Date().clearTime());this.fireEvent("select",this,this.value)}},update:function(H,B){if(this.rendered){var a=this.activeDate,q=this.isVisible();this.activeDate=H;if(!B&&a&&this.el){var p=H.getTime();if(a.getMonth()==H.getMonth()&&a.getFullYear()==H.getFullYear()){this.cells.removeClass("x-date-selected");this.cells.each(function(d){if(d.dom.firstChild.dateValue==p){d.addClass("x-date-selected");if(q&&!this.cancelFocus){Ext.fly(d.dom.firstChild).focus(50)}return false}},this);return}}var l=H.getDaysInMonth(),r=H.getFirstDateOfMonth(),g=r.getDay()-this.startDay;if(g<0){g+=7}l+=g;var C=H.add("mo",-1),h=C.getDaysInMonth()-g,e=this.cells.elements,s=this.textNodes,E=(new Date(C.getFullYear(),C.getMonth(),h,this.initHour)),D=new Date().clearTime().getTime(),x=H.clearTime(true).getTime(),v=this.minDate?this.minDate.clearTime(true):Number.NEGATIVE_INFINITY,z=this.maxDate?this.maxDate.clearTime(true):Number.POSITIVE_INFINITY,G=this.disabledDatesRE,u=this.disabledDatesText,J=this.disabledDays?this.disabledDays.join(""):false,F=this.disabledDaysText,A=this.format;if(this.showToday){var n=new Date().clearTime(),c=(n<v||n>z||(G&&A&&G.test(n.dateFormat(A)))||(J&&J.indexOf(n.getDay())!=-1));if(!this.disabled){this.todayBtn.setDisabled(c);this.todayKeyListener[c?"disable":"enable"]()}}var m=function(K,d){d.title="";var i=E.clearTime(true).getTime();d.firstChild.dateValue=i;if(i==D){d.className+=" x-date-today";d.title=K.todayText}if(i==x){d.className+=" x-date-selected";if(q){Ext.fly(d.firstChild).focus(50)}}if(i<v){d.className=" x-date-disabled";d.title=K.minText;return}if(i>z){d.className=" x-date-disabled";d.title=K.maxText;return}if(J){if(J.indexOf(E.getDay())!=-1){d.title=F;d.className=" x-date-disabled"}}if(G&&A){var w=E.dateFormat(A);if(G.test(w)){d.title=u.replace("%0",w);d.className=" x-date-disabled"}}};var y=0;for(;y<g;y++){s[y].innerHTML=(++h);E.setDate(E.getDate()+1);e[y].className="x-date-prevday";m(this,e[y])}for(;y<l;y++){var b=y-g+1;s[y].innerHTML=(b);E.setDate(E.getDate()+1);e[y].className="x-date-active";m(this,e[y])}var I=0;for(;y<42;y++){s[y].innerHTML=(++I);E.setDate(E.getDate()+1);e[y].className="x-date-nextday";m(this,e[y])}this.mbtn.setText(this.monthNames[H.getMonth()]+" "+H.getFullYear());if(!this.internalRender){var k=this.el.dom.firstChild,o=k.offsetWidth;this.el.setWidth(o+this.el.getBorderWidth("lr"));Ext.fly(k).setWidth(o);this.internalRender=true;if(Ext.isOpera&&!this.secondPass){k.rows[0].cells[1].style.width=(o-(k.rows[0].cells[0].offsetWidth+k.rows[0].cells[2].offsetWidth))+"px";this.secondPass=true;this.update.defer(10,this,[H])}}}},beforeDestroy:function(){if(this.rendered){Ext.destroy(this.keyNav,this.monthPicker,this.eventEl,this.mbtn,this.nextRepeater,this.prevRepeater,this.cells.el,this.todayBtn);delete this.textNodes;delete this.cells.elements}}});Ext.reg("datepicker",Ext.DatePicker);Ext.LoadMask=function(c,b){this.el=Ext.get(c);Ext.apply(this,b);if(this.store){this.store.on({scope:this,beforeload:this.onBeforeLoad,load:this.onLoad,exception:this.onLoad});this.removeMask=Ext.value(this.removeMask,false)}else{var a=this.el.getUpdater();a.showLoadIndicator=false;a.on({scope:this,beforeupdate:this.onBeforeLoad,update:this.onLoad,failure:this.onLoad});this.removeMask=Ext.value(this.removeMask,true)}};Ext.LoadMask.prototype={msg:"Loading...",msgCls:"x-mask-loading",disabled:false,disable:function(){this.disabled=true},enable:function(){this.disabled=false},onLoad:function(){this.el.unmask(this.removeMask)},onBeforeLoad:function(){if(!this.disabled){this.el.mask(this.msg,this.msgCls)}},show:function(){this.onBeforeLoad()},hide:function(){this.onLoad()},destroy:function(){if(this.store){this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.onLoad,this)}else{var a=this.el.getUpdater();a.un("beforeupdate",this.onBeforeLoad,this);a.un("update",this.onLoad,this);a.un("failure",this.onLoad,this)}}};Ext.ns("Ext.slider");Ext.slider.Thumb=Ext.extend(Object,{dragging:false,constructor:function(a){Ext.apply(this,a||{},{cls:"x-slider-thumb",constrain:false});Ext.slider.Thumb.superclass.constructor.call(this,a);if(this.slider.vertical){Ext.apply(this,Ext.slider.Thumb.Vertical)}},render:function(){this.el=this.slider.innerEl.insertFirst({cls:this.cls});this.initEvents()},enable:function(){this.disabled=false;this.el.removeClass(this.slider.disabledClass)},disable:function(){this.disabled=true;this.el.addClass(this.slider.disabledClass)},initEvents:function(){var a=this.el;a.addClassOnOver("x-slider-thumb-over");this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeDragStart.createDelegate(this),onStart:this.onDragStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onDragEnd.createDelegate(this),tolerance:3,autoStart:300});this.tracker.initEl(a)},onBeforeDragStart:function(a){if(this.disabled){return false}else{this.slider.promoteThumb(this);return true}},onDragStart:function(a){this.el.addClass("x-slider-thumb-drag");this.dragging=true;this.dragStartValue=this.value;this.slider.fireEvent("dragstart",this.slider,a,this)},onDrag:function(g){var c=this.slider,b=this.index,d=this.getNewValue();if(this.constrain){var a=c.thumbs[b+1],h=c.thumbs[b-1];if(h!=undefined&&d<=h.value){d=h.value}if(a!=undefined&&d>=a.value){d=a.value}}c.setValue(b,d,false);c.fireEvent("drag",c,g,this)},getNewValue:function(){var a=this.slider,b=a.innerEl.translatePoints(this.tracker.getXY());return Ext.util.Format.round(a.reverseValue(b.left),a.decimalPrecision)},onDragEnd:function(c){var a=this.slider,b=this.value;this.el.removeClass("x-slider-thumb-drag");this.dragging=false;a.fireEvent("dragend",a,c);if(this.dragStartValue!=b){a.fireEvent("changecomplete",a,b,this)}},destroy:function(){Ext.destroyMembers(this,"tracker","el")}});Ext.slider.MultiSlider=Ext.extend(Ext.BoxComponent,{vertical:false,minValue:0,maxValue:100,decimalPrecision:0,keyIncrement:1,increment:0,clickRange:[5,15],clickToChange:true,animate:true,constrainThumbs:true,topThumbZIndex:10000,initComponent:function(){if(!Ext.isDefined(this.value)){this.value=this.minValue}this.thumbs=[];Ext.slider.MultiSlider.superclass.initComponent.call(this);this.keyIncrement=Math.max(this.increment,this.keyIncrement);this.addEvents("beforechange","change","changecomplete","dragstart","drag","dragend");if(this.values==undefined||Ext.isEmpty(this.values)){this.values=[0]}var a=this.values;for(var b=0;b<a.length;b++){this.addThumb(a[b])}if(this.vertical){Ext.apply(this,Ext.slider.Vertical)}},addThumb:function(b){var a=new Ext.slider.Thumb({value:b,slider:this,index:this.thumbs.length,constrain:this.constrainThumbs});this.thumbs.push(a);if(this.rendered){a.render()}},promoteThumb:function(d){var a=this.thumbs,g,b;for(var e=0,c=a.length;e<c;e++){b=a[e];if(b==d){g=this.topThumbZIndex}else{g=""}b.el.setStyle("zIndex",g)}},onRender:function(){this.autoEl={cls:"x-slider "+(this.vertical?"x-slider-vert":"x-slider-horz"),cn:{cls:"x-slider-end",cn:{cls:"x-slider-inner",cn:[{tag:"a",cls:"x-slider-focus",href:"#",tabIndex:"-1",hidefocus:"on"}]}}};Ext.slider.MultiSlider.superclass.onRender.apply(this,arguments);this.endEl=this.el.first();this.innerEl=this.endEl.first();this.focusEl=this.innerEl.child(".x-slider-focus");for(var b=0;b<this.thumbs.length;b++){this.thumbs[b].render()}var a=this.innerEl.child(".x-slider-thumb");this.halfThumb=(this.vertical?a.getHeight():a.getWidth())/2;this.initEvents()},initEvents:function(){this.mon(this.el,{scope:this,mousedown:this.onMouseDown,keydown:this.onKeyDown});this.focusEl.swallowEvent("click",true)},onMouseDown:function(d){if(this.disabled){return}var c=false;for(var b=0;b<this.thumbs.length;b++){c=c||d.target==this.thumbs[b].el.dom}if(this.clickToChange&&!c){var a=this.innerEl.translatePoints(d.getXY());this.onClickChange(a)}this.focus()},onClickChange:function(c){if(c.top>this.clickRange[0]&&c.top<this.clickRange[1]){var a=this.getNearest(c,"left"),b=a.index;this.setValue(b,Ext.util.Format.round(this.reverseValue(c.left),this.decimalPrecision),undefined,true)}},getNearest:function(l,b){var n=b=="top"?this.innerEl.getHeight()-l[b]:l[b],g=this.reverseValue(n),k=(this.maxValue-this.minValue)+5,e=0,c=null;for(var d=0;d<this.thumbs.length;d++){var a=this.thumbs[d],m=a.value,h=Math.abs(m-g);if(Math.abs(h<=k)){c=a;e=d;k=h}}return c},onKeyDown:function(b){if(this.disabled||this.thumbs.length!==1){b.preventDefault();return}var a=b.getKey(),c;switch(a){case b.UP:case b.RIGHT:b.stopEvent();c=b.ctrlKey?this.maxValue:this.getValue(0)+this.keyIncrement;this.setValue(0,c,undefined,true);break;case b.DOWN:case b.LEFT:b.stopEvent();c=b.ctrlKey?this.minValue:this.getValue(0)-this.keyIncrement;this.setValue(0,c,undefined,true);break;default:b.preventDefault()}},doSnap:function(b){if(!(this.increment&&b)){return b}var d=b,c=this.increment,a=b%c;if(a!=0){d-=a;if(a*2>=c){d+=c}else{if(a*2<-c){d-=c}}}return d.constrain(this.minValue,this.maxValue)},afterRender:function(){Ext.slider.MultiSlider.superclass.afterRender.apply(this,arguments);for(var c=0;c<this.thumbs.length;c++){var b=this.thumbs[c];if(b.value!==undefined){var a=this.normalizeValue(b.value);if(a!==b.value){this.setValue(c,a,false)}else{this.moveThumb(c,this.translateValue(a),false)}}}},getRatio:function(){var a=this.innerEl.getWidth(),b=this.maxValue-this.minValue;return b==0?a:(a/b)},normalizeValue:function(a){a=this.doSnap(a);a=Ext.util.Format.round(a,this.decimalPrecision);a=a.constrain(this.minValue,this.maxValue);return a},setMinValue:function(e){this.minValue=e;var d=0,b=this.thumbs,a=b.length,c;for(;d<a;++d){c=b[d];c.value=c.value<e?e:c.value}this.syncThumb()},setMaxValue:function(e){this.maxValue=e;var d=0,b=this.thumbs,a=b.length,c;for(;d<a;++d){c=b[d];c.value=c.value>e?e:c.value}this.syncThumb()},setValue:function(d,c,b,g){var a=this.thumbs[d],e=a.el;c=this.normalizeValue(c);if(c!==a.value&&this.fireEvent("beforechange",this,c,a.value,a)!==false){a.value=c;if(this.rendered){this.moveThumb(d,this.translateValue(c),b!==false);this.fireEvent("change",this,c,a);if(g){this.fireEvent("changecomplete",this,c,a)}}}},translateValue:function(a){var b=this.getRatio();return(a*b)-(this.minValue*b)-this.halfThumb},reverseValue:function(b){var a=this.getRatio();return(b+(this.minValue*a))/a},moveThumb:function(d,c,b){var a=this.thumbs[d].el;if(!b||this.animate===false){a.setLeft(c)}else{a.shift({left:c,stopFx:true,duration:0.35})}},focus:function(){this.focusEl.focus(10)},onResize:function(c,e){var b=this.thumbs,a=b.length,d=0;for(;d<a;++d){b[d].el.stopFx()}if(Ext.isNumber(c)){this.innerEl.setWidth(c-(this.el.getPadding("l")+this.endEl.getPadding("r")))}this.syncThumb();Ext.slider.MultiSlider.superclass.onResize.apply(this,arguments)},onDisable:function(){Ext.slider.MultiSlider.superclass.onDisable.call(this);for(var b=0;b<this.thumbs.length;b++){var a=this.thumbs[b],c=a.el;a.disable();if(Ext.isIE){var d=c.getXY();c.hide();this.innerEl.addClass(this.disabledClass).dom.disabled=true;if(!this.thumbHolder){this.thumbHolder=this.endEl.createChild({cls:"x-slider-thumb "+this.disabledClass})}this.thumbHolder.show().setXY(d)}}},onEnable:function(){Ext.slider.MultiSlider.superclass.onEnable.call(this);for(var b=0;b<this.thumbs.length;b++){var a=this.thumbs[b],c=a.el;a.enable();if(Ext.isIE){this.innerEl.removeClass(this.disabledClass).dom.disabled=false;if(this.thumbHolder){this.thumbHolder.hide()}c.show();this.syncThumb()}}},syncThumb:function(){if(this.rendered){for(var a=0;a<this.thumbs.length;a++){this.moveThumb(a,this.translateValue(this.thumbs[a].value))}}},getValue:function(a){return this.thumbs[a].value},getValues:function(){var a=[];for(var b=0;b<this.thumbs.length;b++){a.push(this.thumbs[b].value)}return a},beforeDestroy:function(){var b=this.thumbs;for(var c=0,a=b.length;c<a;++c){b[c].destroy();b[c]=null}Ext.destroyMembers(this,"endEl","innerEl","focusEl","thumbHolder");Ext.slider.MultiSlider.superclass.beforeDestroy.call(this)}});Ext.reg("multislider",Ext.slider.MultiSlider);Ext.slider.SingleSlider=Ext.extend(Ext.slider.MultiSlider,{constructor:function(a){a=a||{};Ext.applyIf(a,{values:[a.value||0]});Ext.slider.SingleSlider.superclass.constructor.call(this,a)},getValue:function(){return Ext.slider.SingleSlider.superclass.getValue.call(this,0)},setValue:function(d,b){var c=Ext.toArray(arguments),a=c.length;if(a==1||(a<=3&&typeof arguments[1]!="number")){c.unshift(0)}return Ext.slider.SingleSlider.superclass.setValue.apply(this,c)},syncThumb:function(){return Ext.slider.SingleSlider.superclass.syncThumb.apply(this,[0].concat(arguments))},getNearest:function(){return this.thumbs[0]}});Ext.Slider=Ext.slider.SingleSlider;Ext.reg("slider",Ext.slider.SingleSlider);Ext.slider.Vertical={onResize:function(a,b){this.innerEl.setHeight(b-(this.el.getPadding("t")+this.endEl.getPadding("b")));this.syncThumb()},getRatio:function(){var b=this.innerEl.getHeight(),a=this.maxValue-this.minValue;return b/a},moveThumb:function(d,c,b){var a=this.thumbs[d],e=a.el;if(!b||this.animate===false){e.setBottom(c)}else{e.shift({bottom:c,stopFx:true,duration:0.35})}},onClickChange:function(c){if(c.left>this.clickRange[0]&&c.left<this.clickRange[1]){var a=this.getNearest(c,"top"),b=a.index,d=this.minValue+this.reverseValue(this.innerEl.getHeight()-c.top);this.setValue(b,Ext.util.Format.round(d,this.decimalPrecision),undefined,true)}}};Ext.slider.Thumb.Vertical={getNewValue:function(){var b=this.slider,c=b.innerEl,d=c.translatePoints(this.tracker.getXY()),a=c.getHeight()-d.top;return b.minValue+Ext.util.Format.round(a/b.getRatio(),b.decimalPrecision)}};Ext.ProgressBar=Ext.extend(Ext.BoxComponent,{baseCls:"x-progress",animate:false,waitTimer:null,initComponent:function(){Ext.ProgressBar.superclass.initComponent.call(this);this.addEvents("update")},onRender:function(d,a){var c=new Ext.Template('<div class="{cls}-wrap">','<div class="{cls}-inner">','<div class="{cls}-bar">','<div class="{cls}-text">',"<div>&#160;</div>","</div>","</div>",'<div class="{cls}-text {cls}-text-back">',"<div>&#160;</div>","</div>","</div>","</div>");this.el=a?c.insertBefore(a,{cls:this.baseCls},true):c.append(d,{cls:this.baseCls},true);if(this.id){this.el.dom.id=this.id}var b=this.el.dom.firstChild;this.progressBar=Ext.get(b.firstChild);if(this.textEl){this.textEl=Ext.get(this.textEl);delete this.textTopEl}else{this.textTopEl=Ext.get(this.progressBar.dom.firstChild);var e=Ext.get(b.childNodes[1]);this.textTopEl.setStyle("z-index",99).addClass("x-hidden");this.textEl=new Ext.CompositeElement([this.textTopEl.dom.firstChild,e.dom.firstChild]);this.textEl.setWidth(b.offsetWidth)}this.progressBar.setHeight(b.offsetHeight)},afterRender:function(){Ext.ProgressBar.superclass.afterRender.call(this);if(this.value){this.updateProgress(this.value,this.text)}else{this.updateText(this.text)}},updateProgress:function(c,d,b){this.value=c||0;if(d){this.updateText(d)}if(this.rendered&&!this.isDestroyed){var a=Math.floor(c*this.el.dom.firstChild.offsetWidth);this.progressBar.setWidth(a,b===true||(b!==false&&this.animate));if(this.textTopEl){this.textTopEl.removeClass("x-hidden").setWidth(a)}}this.fireEvent("update",this,c,d);return this},wait:function(b){if(!this.waitTimer){var a=this;b=b||{};this.updateText(b.text);this.waitTimer=Ext.TaskMgr.start({run:function(c){var d=b.increment||10;c-=1;this.updateProgress(((((c+d)%d)+1)*(100/d))*0.01,null,b.animate)},interval:b.interval||1000,duration:b.duration,onStop:function(){if(b.fn){b.fn.apply(b.scope||this)}this.reset()},scope:a})}return this},isWaiting:function(){return this.waitTimer!==null},updateText:function(a){this.text=a||"&#160;";if(this.rendered){this.textEl.update(this.text)}return this},syncProgressBar:function(){if(this.value){this.updateProgress(this.value,this.text)}return this},setSize:function(a,c){Ext.ProgressBar.superclass.setSize.call(this,a,c);if(this.textTopEl){var b=this.el.dom.firstChild;this.textEl.setSize(b.offsetWidth,b.offsetHeight)}this.syncProgressBar();return this},reset:function(a){this.updateProgress(0);if(this.textTopEl){this.textTopEl.addClass("x-hidden")}this.clearTimer();if(a===true){this.hide()}return this},clearTimer:function(){if(this.waitTimer){this.waitTimer.onStop=null;Ext.TaskMgr.stop(this.waitTimer);this.waitTimer=null}},onDestroy:function(){this.clearTimer();if(this.rendered){if(this.textEl.isComposite){this.textEl.clear()}Ext.destroyMembers(this,"textEl","progressBar","textTopEl")}Ext.ProgressBar.superclass.onDestroy.call(this)}});Ext.reg("progress",Ext.ProgressBar);(function(){var a=Ext.EventManager;var b=Ext.lib.Dom;Ext.dd.DragDrop=function(e,c,d){if(e){this.init(e,c,d)}};Ext.dd.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true},moveOnly:false,unlock:function(){this.locked=false},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(c,d){},startDrag:function(c,d){},b4Drag:function(c){},onDrag:function(c){},onDragEnter:function(c,d){},b4DragOver:function(c){},onDragOver:function(c,d){},b4DragOut:function(c){},onDragOut:function(c,d){},b4DragDrop:function(c){},onDragDrop:function(c,d){},onInvalidDrop:function(c){},b4EndDrag:function(c){},endDrag:function(c){},b4MouseDown:function(c){},onMouseDown:function(c){},onMouseUp:function(c){},onAvailable:function(){},defaultPadding:{left:0,right:0,top:0,bottom:0},constrainTo:function(k,h,p){if(Ext.isNumber(h)){h={left:h,right:h,top:h,bottom:h}}h=h||this.defaultPadding;var m=Ext.get(this.getEl()).getBox(),d=Ext.get(k),o=d.getScroll(),l,e=d.dom;if(e==document.body){l={x:o.left,y:o.top,width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()}}else{var n=d.getXY();l={x:n[0],y:n[1],width:e.clientWidth,height:e.clientHeight}}var i=m.y-l.y,g=m.x-l.x;this.resetConstraints();this.setXConstraint(g-(h.left||0),l.width-g-m.width-(h.right||0),this.xTickSize);this.setYConstraint(i-(h.top||0),l.height-i-m.height-(h.bottom||0),this.yTickSize)},getEl:function(){if(!this._domRef){this._domRef=Ext.getDom(this.id)}return this._domRef},getDragEl:function(){return Ext.getDom(this.dragElId)},init:function(e,c,d){this.initTarget(e,c,d);a.on(this.id,"mousedown",this.handleMouseDown,this)},initTarget:function(e,c,d){this.config=d||{};this.DDM=Ext.dd.DDM;this.groups={};if(typeof e!=="string"){e=Ext.id(e)}this.id=e;this.addToGroup((c)?c:"default");this.handleElId=e;this.setDragElId(e);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();this.handleOnAvailable()},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false)},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable()},setPadding:function(e,c,g,d){if(!c&&0!==c){this.padding=[e,e,e,e]}else{if(!g&&0!==g){this.padding=[e,c,e,c]}else{this.padding=[e,c,g,d]}}},setInitPosition:function(g,e){var h=this.getEl();if(!this.DDM.verifyEl(h)){return}var d=g||0;var c=e||0;var i=b.getXY(h);this.initPageX=i[0]-d;this.initPageY=i[1]-c;this.lastPageX=i[0];this.lastPageY=i[1];this.setStartPosition(i)},setStartPosition:function(d){var c=d||b.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=c[0];this.startPageY=c[1]},addToGroup:function(c){this.groups[c]=true;this.DDM.regDragDrop(this,c)},removeFromGroup:function(c){if(this.groups[c]){delete this.groups[c]}this.DDM.removeDDFromGroup(this,c)},setDragElId:function(c){this.dragElId=c},setHandleElId:function(c){if(typeof c!=="string"){c=Ext.id(c)}this.handleElId=c;this.DDM.regHandle(this.id,c)},setOuterHandleElId:function(c){if(typeof c!=="string"){c=Ext.id(c)}a.on(c,"mousedown",this.handleMouseDown,this);this.setHandleElId(c);this.hasOuterHandles=true},unreg:function(){a.un(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this)},destroy:function(){this.unreg()},isLocked:function(){return(this.DDM.isLocked()||this.locked)},handleMouseDown:function(g,d){if(this.primaryButtonOnly&&g.button!=0){return}if(this.isLocked()){return}this.DDM.refreshCache(this.groups);var c=new Ext.lib.Point(Ext.lib.Event.getPageX(g),Ext.lib.Event.getPageY(g));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(c,this)){}else{if(this.clickValidator(g)){this.setStartPosition();this.b4MouseDown(g);this.onMouseDown(g);this.DDM.handleMouseDown(g,this);this.DDM.stopEvent(g)}else{}}},clickValidator:function(d){var c=d.getTarget();return(this.isValidHandleChild(c)&&(this.id==this.handleElId||this.DDM.handleWasClicked(c,this.id)))},addInvalidHandleType:function(c){var d=c.toUpperCase();this.invalidHandleTypes[d]=d},addInvalidHandleId:function(c){if(typeof c!=="string"){c=Ext.id(c)}this.invalidHandleIds[c]=c},addInvalidHandleClass:function(c){this.invalidHandleClasses.push(c)},removeInvalidHandleType:function(c){var d=c.toUpperCase();delete this.invalidHandleTypes[d]},removeInvalidHandleId:function(c){if(typeof c!=="string"){c=Ext.id(c)}delete this.invalidHandleIds[c]},removeInvalidHandleClass:function(d){for(var e=0,c=this.invalidHandleClasses.length;e<c;++e){if(this.invalidHandleClasses[e]==d){delete this.invalidHandleClasses[e]}}},isValidHandleChild:function(h){var g=true;var l;try{l=h.nodeName.toUpperCase()}catch(k){l=h.nodeName}g=g&&!this.invalidHandleTypes[l];g=g&&!this.invalidHandleIds[h.id];for(var d=0,c=this.invalidHandleClasses.length;g&&d<c;++d){g=!Ext.fly(h).hasClass(this.invalidHandleClasses[d])}return g},setXTicks:function(g,c){this.xTicks=[];this.xTickSize=c;var e={};for(var d=this.initPageX;d>=this.minX;d=d-c){if(!e[d]){this.xTicks[this.xTicks.length]=d;e[d]=true}}for(d=this.initPageX;d<=this.maxX;d=d+c){if(!e[d]){this.xTicks[this.xTicks.length]=d;e[d]=true}}this.xTicks.sort(this.DDM.numericSort)},setYTicks:function(g,c){this.yTicks=[];this.yTickSize=c;var e={};for(var d=this.initPageY;d>=this.minY;d=d-c){if(!e[d]){this.yTicks[this.yTicks.length]=d;e[d]=true}}for(d=this.initPageY;d<=this.maxY;d=d+c){if(!e[d]){this.yTicks[this.yTicks.length]=d;e[d]=true}}this.yTicks.sort(this.DDM.numericSort)},setXConstraint:function(e,d,c){this.leftConstraint=e;this.rightConstraint=d;this.minX=this.initPageX-e;this.maxX=this.initPageX+d;if(c){this.setXTicks(this.initPageX,c)}this.constrainX=true},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks()},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0},setYConstraint:function(c,e,d){this.topConstraint=c;this.bottomConstraint=e;this.minY=this.initPageY-c;this.maxY=this.initPageY+e;if(d){this.setYTicks(this.initPageY,d)}this.constrainY=true},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var d=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var c=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(d,c)}else{this.setInitPosition()}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize)}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize)}},getTick:function(l,g){if(!g){return l}else{if(g[0]>=l){return g[0]}else{for(var d=0,c=g.length;d<c;++d){var e=d+1;if(g[e]&&g[e]>=l){var k=l-g[d];var h=g[e]-l;return(h>k)?g[d]:g[e]}}return g[g.length-1]}}},toString:function(){return("DragDrop "+this.id)}}})();if(!Ext.dd.DragDropMgr){Ext.dd.DragDropMgr=function(){var a=Ext.EventManager;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,init:function(){this.initialized=true},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(d,c){for(var e in this.ids){for(var b in this.ids[e]){var g=this.ids[e][b];if(!this.isTypeOfDD(g)){continue}g[d].apply(g,c)}}},_onLoad:function(){this.init();a.on(document,"mouseup",this.handleMouseUp,this,true);a.on(document,"mousemove",this.handleMouseMove,this,true);a.on(window,"unload",this._onUnload,this,true);a.on(window,"resize",this._onResize,this,true)},_onResize:function(b){this._execOnAll("resetConstraints",[])},lock:function(){this.locked=true},unlock:function(){this.locked=false},isLocked:function(){return this.locked},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:350,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(c,b){if(!this.initialized){this.init()}if(!this.ids[b]){this.ids[b]={}}this.ids[b][c.id]=c},removeDDFromGroup:function(d,b){if(!this.ids[b]){this.ids[b]={}}var c=this.ids[b];if(c&&c[d.id]){delete c[d.id]}},_remove:function(c){for(var b in c.groups){if(b&&this.ids[b]&&this.ids[b][c.id]){delete this.ids[b][c.id]}}delete this.handleIds[c.id]},regHandle:function(c,b){if(!this.handleIds[c]){this.handleIds[c]={}}this.handleIds[c][b]=b},isDragDrop:function(b){return(this.getDDById(b))?true:false},getRelated:function(h,c){var g=[];for(var e in h.groups){for(var d in this.ids[e]){var b=this.ids[e][d];if(!this.isTypeOfDD(b)){continue}if(!c||b.isTarget){g[g.length]=b}}}return g},isLegalTarget:function(g,e){var c=this.getRelated(g,true);for(var d=0,b=c.length;d<b;++d){if(c[d].id==e.id){return true}}return false},isTypeOfDD:function(b){return(b&&b.__ygDragDrop)},isHandle:function(c,b){return(this.handleIds[c]&&this.handleIds[c][b])},getDDById:function(c){for(var b in this.ids){if(this.ids[b][c]){return this.ids[b][c]}}return null},handleMouseDown:function(d,c){if(Ext.QuickTips){Ext.QuickTips.ddDisable()}if(this.dragCurrent){this.handleMouseUp(d)}this.currentTarget=d.getTarget();this.dragCurrent=c;var b=c.getEl();this.startX=d.getPageX();this.startY=d.getPageY();this.deltaX=this.startX-b.offsetLeft;this.deltaY=this.startY-b.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var e=Ext.dd.DDM;e.startDrag(e.startX,e.startY)},this.clickTimeThresh)},startDrag:function(b,c){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(b,c);this.dragCurrent.startDrag(b,c)}this.dragThreshMet=true},handleMouseUp:function(b){if(Ext.QuickTips){Ext.QuickTips.ddEnable()}if(!this.dragCurrent){return}clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(b,true)}else{}this.stopDrag(b);this.stopEvent(b)},stopEvent:function(b){if(this.stopPropagation){b.stopPropagation()}if(this.preventDefault){b.preventDefault()}},stopDrag:function(b){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(b);this.dragCurrent.endDrag(b)}this.dragCurrent.onMouseUp(b)}this.dragCurrent=null;this.dragOvers={}},handleMouseMove:function(d){if(!this.dragCurrent){return true}if(Ext.isIE&&(d.button!==0&&d.button!==1&&d.button!==2)){this.stopEvent(d);return this.handleMouseUp(d)}if(!this.dragThreshMet){var c=Math.abs(this.startX-d.getPageX());var b=Math.abs(this.startY-d.getPageY());if(c>this.clickPixelThresh||b>this.clickPixelThresh){this.startDrag(this.startX,this.startY)}}if(this.dragThreshMet){this.dragCurrent.b4Drag(d);this.dragCurrent.onDrag(d);if(!this.dragCurrent.moveOnly){this.fireEvents(d,false)}}this.stopEvent(d);return true},fireEvents:function(o,p){var r=this.dragCurrent;if(!r||r.isLocked()){return}var s=o.getPoint();var b=[];var g=[];var m=[];var k=[];var d=[];for(var h in this.dragOvers){var c=this.dragOvers[h];if(!this.isTypeOfDD(c)){continue}if(!this.isOverTarget(s,c,this.mode)){g.push(c)}b[h]=true;delete this.dragOvers[h]}for(var q in r.groups){if("string"!=typeof q){continue}for(h in this.ids[q]){var l=this.ids[q][h];if(!this.isTypeOfDD(l)){continue}if(l.isTarget&&!l.isLocked()&&((l!=r)||(r.ignoreSelf===false))){if(this.isOverTarget(s,l,this.mode)){if(p){k.push(l)}else{if(!b[l.id]){d.push(l)}else{m.push(l)}this.dragOvers[l.id]=l}}}}}if(this.mode){if(g.length){r.b4DragOut(o,g);r.onDragOut(o,g)}if(d.length){r.onDragEnter(o,d)}if(m.length){r.b4DragOver(o,m);r.onDragOver(o,m)}if(k.length){r.b4DragDrop(o,k);r.onDragDrop(o,k)}}else{var n=0;for(h=0,n=g.length;h<n;++h){r.b4DragOut(o,g[h].id);r.onDragOut(o,g[h].id)}for(h=0,n=d.length;h<n;++h){r.onDragEnter(o,d[h].id)}for(h=0,n=m.length;h<n;++h){r.b4DragOver(o,m[h].id);r.onDragOver(o,m[h].id)}for(h=0,n=k.length;h<n;++h){r.b4DragDrop(o,k[h].id);r.onDragDrop(o,k[h].id)}}if(p&&!k.length){r.onInvalidDrop(o)}},getBestMatch:function(d){var g=null;var c=d.length;if(c==1){g=d[0]}else{for(var e=0;e<c;++e){var b=d[e];if(b.cursorIsOver){g=b;break}else{if(!g||g.overlap.getArea()<b.overlap.getArea()){g=b}}}}return g},refreshCache:function(c){for(var b in c){if("string"!=typeof b){continue}for(var d in this.ids[b]){var e=this.ids[b][d];if(this.isTypeOfDD(e)){var g=this.getLocation(e);if(g){this.locationCache[e.id]=g}else{delete this.locationCache[e.id]}}}}},verifyEl:function(c){if(c){var b;if(Ext.isIE){try{b=c.offsetParent}catch(d){}}else{b=c.offsetParent}if(b){return true}}return false},getLocation:function(k){if(!this.isTypeOfDD(k)){return null}var h=k.getEl(),o,g,d,q,p,s,c,n,i;try{o=Ext.lib.Dom.getXY(h)}catch(m){}if(!o){return null}g=o[0];d=g+h.offsetWidth;q=o[1];p=q+h.offsetHeight;s=q-k.padding[0];c=d+k.padding[1];n=p+k.padding[2];i=g-k.padding[3];return new Ext.lib.Region(s,c,n,i)},isOverTarget:function(l,b,d){var g=this.locationCache[b.id];if(!g||!this.useCache){g=this.getLocation(b);this.locationCache[b.id]=g}if(!g){return false}b.cursorIsOver=g.contains(l);var k=this.dragCurrent;if(!k||!k.getTargetCoord||(!d&&!k.constrainX&&!k.constrainY)){return b.cursorIsOver}b.overlap=null;var h=k.getTargetCoord(l.x,l.y);var c=k.getDragEl();var e=new Ext.lib.Region(h.y,h.x+c.offsetWidth,h.y+c.offsetHeight,h.x);var i=e.intersect(g);if(i){b.overlap=i;return(d)?true:b.cursorIsOver}else{return false}},_onUnload:function(c,b){Ext.dd.DragDropMgr.unregAll()},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null}this._execOnAll("unreg",[]);for(var b in this.elementCache){delete this.elementCache[b]}this.elementCache={};this.ids={}},elementCache:{},getElWrapper:function(c){var b=this.elementCache[c];if(!b||!b.el){b=this.elementCache[c]=new this.ElementWrapper(Ext.getDom(c))}return b},getElement:function(b){return Ext.getDom(b)},getCss:function(c){var b=Ext.getDom(c);return(b)?b.style:null},ElementWrapper:function(b){this.el=b||null;this.id=this.el&&b.id;this.css=this.el&&b.style},getPosX:function(b){return Ext.lib.Dom.getX(b)},getPosY:function(b){return Ext.lib.Dom.getY(b)},swapNode:function(d,b){if(d.swapNode){d.swapNode(b)}else{var e=b.parentNode;var c=b.nextSibling;if(c==d){e.insertBefore(d,b)}else{if(b==d.nextSibling){e.insertBefore(b,d)}else{d.parentNode.replaceChild(b,d);e.insertBefore(d,c)}}}},getScroll:function(){var d,b,e=document.documentElement,c=document.body;if(e&&(e.scrollTop||e.scrollLeft)){d=e.scrollTop;b=e.scrollLeft}else{if(c){d=c.scrollTop;b=c.scrollLeft}else{}}return{top:d,left:b}},getStyle:function(c,b){return Ext.fly(c).getStyle(b)},getScrollTop:function(){return this.getScroll().top},getScrollLeft:function(){return this.getScroll().left},moveToEl:function(b,d){var c=Ext.lib.Dom.getXY(d);Ext.lib.Dom.setXY(b,c)},numericSort:function(d,c){return(d-c)},_timeoutCount:0,_addListeners:function(){var b=Ext.dd.DDM;if(Ext.lib.Event&&document){b._onLoad()}else{if(b._timeoutCount>2000){}else{setTimeout(b._addListeners,10);if(document&&document.body){b._timeoutCount+=1}}}},handleWasClicked:function(b,d){if(this.isHandle(d,b.id)){return true}else{var c=b.parentNode;while(c){if(this.isHandle(d,c.id)){return true}else{c=c.parentNode}}}return false}}}();Ext.dd.DDM=Ext.dd.DragDropMgr;Ext.dd.DDM._addListeners()}Ext.dd.DD=function(c,a,b){if(c){this.init(c,a,b)}};Ext.extend(Ext.dd.DD,Ext.dd.DragDrop,{scroll:true,autoOffset:function(c,b){var a=c-this.startPageX;var d=b-this.startPageY;this.setDelta(a,d)},setDelta:function(b,a){this.deltaX=b;this.deltaY=a},setDragElPos:function(c,b){var a=this.getDragEl();this.alignElWithMouse(a,c,b)},alignElWithMouse:function(c,h,g){var e=this.getTargetCoord(h,g);var b=c.dom?c:Ext.fly(c,"_dd");if(!this.deltaSetXY){var i=[e.x,e.y];b.setXY(i);var d=b.getLeft(true);var a=b.getTop(true);this.deltaSetXY=[d-e.x,a-e.y]}else{b.setLeftTop(e.x+this.deltaSetXY[0],e.y+this.deltaSetXY[1])}this.cachePosition(e.x,e.y);this.autoScroll(e.x,e.y,c.offsetHeight,c.offsetWidth);return e},cachePosition:function(b,a){if(b){this.lastPageX=b;this.lastPageY=a}else{var c=Ext.lib.Dom.getXY(this.getEl());this.lastPageX=c[0];this.lastPageY=c[1]}},autoScroll:function(m,l,e,n){if(this.scroll){var o=Ext.lib.Dom.getViewHeight();var b=Ext.lib.Dom.getViewWidth();var q=this.DDM.getScrollTop();var d=this.DDM.getScrollLeft();var k=e+l;var p=n+m;var i=(o+q-l-this.deltaY);var g=(b+d-m-this.deltaX);var c=40;var a=(document.all)?80:30;if(k>o&&i<c){window.scrollTo(d,q+a)}if(l<q&&q>0&&l-q<c){window.scrollTo(d,q-a)}if(p>b&&g<c){window.scrollTo(d+a,q)}if(m<d&&d>0&&m-d<c){window.scrollTo(d-a,q)}}},getTargetCoord:function(c,b){var a=c-this.deltaX;var d=b-this.deltaY;if(this.constrainX){if(a<this.minX){a=this.minX}if(a>this.maxX){a=this.maxX}}if(this.constrainY){if(d<this.minY){d=this.minY}if(d>this.maxY){d=this.maxY}}a=this.getTick(a,this.xTicks);d=this.getTick(d,this.yTicks);return{x:a,y:d}},applyConfig:function(){Ext.dd.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false)},b4MouseDown:function(a){this.autoOffset(a.getPageX(),a.getPageY())},b4Drag:function(a){this.setDragElPos(a.getPageX(),a.getPageY())},toString:function(){return("DD "+this.id)}});Ext.dd.DDProxy=function(c,a,b){if(c){this.init(c,a,b);this.initFrame()}};Ext.dd.DDProxy.dragElId="ygddfdiv";Ext.extend(Ext.dd.DDProxy,Ext.dd.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var b=this;var a=document.body;if(!a||!a.firstChild){setTimeout(function(){b.createFrame()},50);return}var d=this.getDragEl();if(!d){d=document.createElement("div");d.id=this.dragElId;var c=d.style;c.position="absolute";c.visibility="hidden";c.cursor="move";c.border="2px solid #aaa";c.zIndex=999;a.insertBefore(d,a.firstChild)}},initFrame:function(){this.createFrame()},applyConfig:function(){Ext.dd.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||Ext.dd.DDProxy.dragElId)},showFrame:function(e,d){var c=this.getEl();var a=this.getDragEl();var b=a.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(b.width,10)/2),Math.round(parseInt(b.height,10)/2))}this.setDragElPos(e,d);Ext.fly(a).show()},_resizeProxy:function(){if(this.resizeFrame){var a=this.getEl();Ext.fly(this.getDragEl()).setSize(a.offsetWidth,a.offsetHeight)}},b4MouseDown:function(b){var a=b.getPageX();var c=b.getPageY();this.autoOffset(a,c);this.setDragElPos(a,c)},b4StartDrag:function(a,b){this.showFrame(a,b)},b4EndDrag:function(a){Ext.fly(this.getDragEl()).hide()},endDrag:function(c){var b=this.getEl();var a=this.getDragEl();a.style.visibility="";this.beforeMove();b.style.visibility="hidden";Ext.dd.DDM.moveToEl(b,a);a.style.visibility="hidden";b.style.visibility="";this.afterDrag()},beforeMove:function(){},afterDrag:function(){},toString:function(){return("DDProxy "+this.id)}});Ext.dd.DDTarget=function(c,a,b){if(c){this.initTarget(c,a,b)}};Ext.extend(Ext.dd.DDTarget,Ext.dd.DragDrop,{getDragEl:Ext.emptyFn,isValidHandleChild:Ext.emptyFn,startDrag:Ext.emptyFn,endDrag:Ext.emptyFn,onDrag:Ext.emptyFn,onDragDrop:Ext.emptyFn,onDragEnter:Ext.emptyFn,onDragOut:Ext.emptyFn,onDragOver:Ext.emptyFn,onInvalidDrop:Ext.emptyFn,onMouseDown:Ext.emptyFn,onMouseUp:Ext.emptyFn,setXConstraint:Ext.emptyFn,setYConstraint:Ext.emptyFn,resetConstraints:Ext.emptyFn,clearConstraints:Ext.emptyFn,clearTicks:Ext.emptyFn,setInitPosition:Ext.emptyFn,setDragElId:Ext.emptyFn,setHandleElId:Ext.emptyFn,setOuterHandleElId:Ext.emptyFn,addInvalidHandleClass:Ext.emptyFn,addInvalidHandleId:Ext.emptyFn,addInvalidHandleType:Ext.emptyFn,removeInvalidHandleClass:Ext.emptyFn,removeInvalidHandleId:Ext.emptyFn,removeInvalidHandleType:Ext.emptyFn,toString:function(){return("DDTarget "+this.id)}});Ext.dd.DragTracker=Ext.extend(Ext.util.Observable,{active:false,tolerance:5,autoStart:false,constructor:function(a){Ext.apply(this,a);this.addEvents("mousedown","mouseup","mousemove","dragstart","dragend","drag");this.dragRegion=new Ext.lib.Region(0,0,0,0);if(this.el){this.initEl(this.el)}Ext.dd.DragTracker.superclass.constructor.call(this,a)},initEl:function(a){this.el=Ext.get(a);a.on("mousedown",this.onMouseDown,this,this.delegate?{delegate:this.delegate}:undefined)},destroy:function(){this.el.un("mousedown",this.onMouseDown,this);delete this.el},onMouseDown:function(b,a){if(this.fireEvent("mousedown",this,b)!==false&&this.onBeforeStart(b)!==false){this.startXY=this.lastXY=b.getXY();this.dragTarget=this.delegate?a:this.el.dom;if(this.preventDefault!==false){b.preventDefault()}Ext.getDoc().on({scope:this,mouseup:this.onMouseUp,mousemove:this.onMouseMove,selectstart:this.stopSelect});if(this.autoStart){this.timer=this.triggerStart.defer(this.autoStart===true?1000:this.autoStart,this,[b])}}},onMouseMove:function(d,c){if(this.active&&Ext.isIE&&!d.browserEvent.button){d.preventDefault();this.onMouseUp(d);return}d.preventDefault();var b=d.getXY(),a=this.startXY;this.lastXY=b;if(!this.active){if(Math.abs(a[0]-b[0])>this.tolerance||Math.abs(a[1]-b[1])>this.tolerance){this.triggerStart(d)}else{return}}this.fireEvent("mousemove",this,d);this.onDrag(d);this.fireEvent("drag",this,d)},onMouseUp:function(c){var b=Ext.getDoc(),a=this.active;b.un("mousemove",this.onMouseMove,this);b.un("mouseup",this.onMouseUp,this);b.un("selectstart",this.stopSelect,this);c.preventDefault();this.clearStart();this.active=false;delete this.elRegion;this.fireEvent("mouseup",this,c);if(a){this.onEnd(c);this.fireEvent("dragend",this,c)}},triggerStart:function(a){this.clearStart();this.active=true;this.onStart(a);this.fireEvent("dragstart",this,a)},clearStart:function(){if(this.timer){clearTimeout(this.timer);delete this.timer}},stopSelect:function(a){a.stopEvent();return false},onBeforeStart:function(a){},onStart:function(a){},onDrag:function(a){},onEnd:function(a){},getDragTarget:function(){return this.dragTarget},getDragCt:function(){return this.el},getXY:function(a){return a?this.constrainModes[a].call(this,this.lastXY):this.lastXY},getOffset:function(c){var b=this.getXY(c),a=this.startXY;return[a[0]-b[0],a[1]-b[1]]},constrainModes:{point:function(b){if(!this.elRegion){this.elRegion=this.getDragCt().getRegion()}var a=this.dragRegion;a.left=b[0];a.top=b[1];a.right=b[0];a.bottom=b[1];a.constrainTo(this.elRegion);return[a.left,a.top]}}});Ext.dd.ScrollManager=function(){var c=Ext.dd.DragDropMgr;var e={};var b=null;var i={};var h=function(m){b=null;a()};var k=function(){if(c.dragCurrent){c.refreshCache(c.dragCurrent.groups)}};var d=function(){if(c.dragCurrent){var m=Ext.dd.ScrollManager;var n=i.el.ddScrollConfig?i.el.ddScrollConfig.increment:m.increment;if(!m.animate){if(i.el.scroll(i.dir,n)){k()}}else{i.el.scroll(i.dir,n,true,m.animDuration,k)}}};var a=function(){if(i.id){clearInterval(i.id)}i.id=0;i.el=null;i.dir=""};var g=function(n,m){a();i.el=n;i.dir=m;var p=n.ddScrollConfig?n.ddScrollConfig.ddGroup:undefined,o=(n.ddScrollConfig&&n.ddScrollConfig.frequency)?n.ddScrollConfig.frequency:Ext.dd.ScrollManager.frequency;if(p===undefined||c.dragCurrent.ddGroup==p){i.id=setInterval(d,o)}};var l=function(p,s){if(s||!c.dragCurrent){return}var t=Ext.dd.ScrollManager;if(!b||b!=c.dragCurrent){b=c.dragCurrent;t.refreshCache()}var u=Ext.lib.Event.getXY(p);var v=new Ext.lib.Point(u[0],u[1]);for(var n in e){var o=e[n],m=o._region;var q=o.ddScrollConfig?o.ddScrollConfig:t;if(m&&m.contains(v)&&o.isScrollable()){if(m.bottom-v.y<=q.vthresh){if(i.el!=o){g(o,"down")}return}else{if(m.right-v.x<=q.hthresh){if(i.el!=o){g(o,"left")}return}else{if(v.y-m.top<=q.vthresh){if(i.el!=o){g(o,"up")}return}else{if(v.x-m.left<=q.hthresh){if(i.el!=o){g(o,"right")}return}}}}}}a()};c.fireEvents=c.fireEvents.createSequence(l,c);c.stopDrag=c.stopDrag.createSequence(h,c);return{register:function(o){if(Ext.isArray(o)){for(var n=0,m=o.length;n<m;n++){this.register(o[n])}}else{o=Ext.get(o);e[o.id]=o}},unregister:function(o){if(Ext.isArray(o)){for(var n=0,m=o.length;n<m;n++){this.unregister(o[n])}}else{o=Ext.get(o);delete e[o.id]}},vthresh:25,hthresh:25,increment:100,frequency:500,animate:true,animDuration:0.4,ddGroup:undefined,refreshCache:function(){for(var m in e){if(typeof e[m]=="object"){e[m]._region=e[m].getRegion()}}}}}();Ext.dd.Registry=function(){var d={};var b={};var a=0;var c=function(g,e){if(typeof g=="string"){return g}var h=g.id;if(!h&&e!==false){h="extdd-"+(++a);g.id=h}return h};return{register:function(k,l){l=l||{};if(typeof k=="string"){k=document.getElementById(k)}l.ddel=k;d[c(k)]=l;if(l.isHandle!==false){b[l.ddel.id]=l}if(l.handles){var h=l.handles;for(var g=0,e=h.length;g<e;g++){b[c(h[g])]=l}}},unregister:function(k){var m=c(k,false);var l=d[m];if(l){delete d[m];if(l.handles){var h=l.handles;for(var g=0,e=h.length;g<e;g++){delete b[c(h[g],false)]}}}},getHandle:function(e){if(typeof e!="string"){e=e.id}return b[e]},getHandleFromEvent:function(h){var g=Ext.lib.Event.getTarget(h);return g?b[g.id]:null},getTarget:function(e){if(typeof e!="string"){e=e.id}return d[e]},getTargetFromEvent:function(h){var g=Ext.lib.Event.getTarget(h);return g?d[g.id]||b[g.id]:null}}}();Ext.dd.StatusProxy=function(a){Ext.apply(this,a);this.id=this.id||Ext.id();this.el=new Ext.Layer({dh:{id:this.id,tag:"div",cls:"x-dd-drag-proxy "+this.dropNotAllowed,children:[{tag:"div",cls:"x-dd-drop-icon"},{tag:"div",cls:"x-dd-drag-ghost"}]},shadow:!a||a.shadow!==false});this.ghost=Ext.get(this.el.dom.childNodes[1]);this.dropStatus=this.dropNotAllowed};Ext.dd.StatusProxy.prototype={dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",setStatus:function(a){a=a||this.dropNotAllowed;if(this.dropStatus!=a){this.el.replaceClass(this.dropStatus,a);this.dropStatus=a}},reset:function(a){this.el.dom.className="x-dd-drag-proxy "+this.dropNotAllowed;this.dropStatus=this.dropNotAllowed;if(a){this.ghost.update("")}},update:function(a){if(typeof a=="string"){this.ghost.update(a)}else{this.ghost.update("");a.style.margin="0";this.ghost.dom.appendChild(a)}var b=this.ghost.dom.firstChild;if(b){Ext.fly(b).setStyle("float","none")}},getEl:function(){return this.el},getGhost:function(){return this.ghost},hide:function(a){this.el.hide();if(a){this.reset(true)}},stop:function(){if(this.anim&&this.anim.isAnimated&&this.anim.isAnimated()){this.anim.stop()}},show:function(){this.el.show()},sync:function(){this.el.sync()},repair:function(b,c,a){this.callback=c;this.scope=a;if(b&&this.animRepair!==false){this.el.addClass("x-dd-drag-repair");this.el.hideUnders(true);this.anim=this.el.shift({duration:this.repairDuration||0.5,easing:"easeOut",xy:b,stopFx:true,callback:this.afterRepair,scope:this})}else{this.afterRepair()}},afterRepair:function(){this.hide(true);if(typeof this.callback=="function"){this.callback.call(this.scope||this)}this.callback=null;this.scope=null},destroy:function(){Ext.destroy(this.ghost,this.el)}};Ext.dd.DragSource=function(b,a){this.el=Ext.get(b);if(!this.dragData){this.dragData={}}Ext.apply(this,a);if(!this.proxy){this.proxy=new Ext.dd.StatusProxy()}Ext.dd.DragSource.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{dragElId:this.proxy.id,resizeFrame:false,isTarget:false,scroll:this.scroll===true});this.dragging=false};Ext.extend(Ext.dd.DragSource,Ext.dd.DDProxy,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",getDragData:function(a){return this.dragData},onDragEnter:function(c,d){var b=Ext.dd.DragDropMgr.getDDById(d);this.cachedTarget=b;if(this.beforeDragEnter(b,c,d)!==false){if(b.isNotifyTarget){var a=b.notifyEnter(this,c,this.dragData);this.proxy.setStatus(a)}else{this.proxy.setStatus(this.dropAllowed)}if(this.afterDragEnter){this.afterDragEnter(b,c,d)}}},beforeDragEnter:function(b,a,c){return true},alignElWithMouse:function(){Ext.dd.DragSource.superclass.alignElWithMouse.apply(this,arguments);this.proxy.sync()},onDragOver:function(c,d){var b=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(d);if(this.beforeDragOver(b,c,d)!==false){if(b.isNotifyTarget){var a=b.notifyOver(this,c,this.dragData);this.proxy.setStatus(a)}if(this.afterDragOver){this.afterDragOver(b,c,d)}}},beforeDragOver:function(b,a,c){return true},onDragOut:function(b,c){var a=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(c);if(this.beforeDragOut(a,b,c)!==false){if(a.isNotifyTarget){a.notifyOut(this,b,this.dragData)}this.proxy.reset();if(this.afterDragOut){this.afterDragOut(a,b,c)}}this.cachedTarget=null},beforeDragOut:function(b,a,c){return true},onDragDrop:function(b,c){var a=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(c);if(this.beforeDragDrop(a,b,c)!==false){if(a.isNotifyTarget){if(a.notifyDrop(this,b,this.dragData)){this.onValidDrop(a,b,c)}else{this.onInvalidDrop(a,b,c)}}else{this.onValidDrop(a,b,c)}if(this.afterDragDrop){this.afterDragDrop(a,b,c)}}delete this.cachedTarget},beforeDragDrop:function(b,a,c){return true},onValidDrop:function(b,a,c){this.hideProxy();if(this.afterValidDrop){this.afterValidDrop(b,a,c)}},getRepairXY:function(b,a){return this.el.getXY()},onInvalidDrop:function(b,a,c){this.beforeInvalidDrop(b,a,c);if(this.cachedTarget){if(this.cachedTarget.isNotifyTarget){this.cachedTarget.notifyOut(this,a,this.dragData)}this.cacheTarget=null}this.proxy.repair(this.getRepairXY(a,this.dragData),this.afterRepair,this);if(this.afterInvalidDrop){this.afterInvalidDrop(a,c)}},afterRepair:function(){if(Ext.enableFx){this.el.highlight(this.hlColor||"c3daf9")}this.dragging=false},beforeInvalidDrop:function(b,a,c){return true},handleMouseDown:function(b){if(this.dragging){return}var a=this.getDragData(b);if(a&&this.onBeforeDrag(a,b)!==false){this.dragData=a;this.proxy.stop();Ext.dd.DragSource.superclass.handleMouseDown.apply(this,arguments)}},onBeforeDrag:function(a,b){return true},onStartDrag:Ext.emptyFn,startDrag:function(a,b){this.proxy.reset();this.dragging=true;this.proxy.update("");this.onInitDrag(a,b);this.proxy.show()},onInitDrag:function(a,c){var b=this.el.dom.cloneNode(true);b.id=Ext.id();this.proxy.update(b);this.onStartDrag(a,c);return true},getProxy:function(){return this.proxy},hideProxy:function(){this.proxy.hide();this.proxy.reset(true);this.dragging=false},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)},b4EndDrag:function(a){},endDrag:function(a){this.onEndDrag(this.dragData,a)},onEndDrag:function(a,b){},autoOffset:function(a,b){this.setDelta(-12,-20)},destroy:function(){Ext.dd.DragSource.superclass.destroy.call(this);Ext.destroy(this.proxy)}});Ext.dd.DropTarget=Ext.extend(Ext.dd.DDTarget,{constructor:function(b,a){this.el=Ext.get(b);Ext.apply(this,a);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el)}Ext.dd.DropTarget.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{isTarget:true})},dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",isTarget:true,isNotifyTarget:true,notifyEnter:function(a,c,b){if(this.overClass){this.el.addClass(this.overClass)}return this.dropAllowed},notifyOver:function(a,c,b){return this.dropAllowed},notifyOut:function(a,c,b){if(this.overClass){this.el.removeClass(this.overClass)}},notifyDrop:function(a,c,b){return false},destroy:function(){Ext.dd.DropTarget.superclass.destroy.call(this);if(this.containerScroll){Ext.dd.ScrollManager.unregister(this.el)}}});Ext.dd.DragZone=Ext.extend(Ext.dd.DragSource,{constructor:function(b,a){Ext.dd.DragZone.superclass.constructor.call(this,b,a);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el)}},getDragData:function(a){return Ext.dd.Registry.getHandleFromEvent(a)},onInitDrag:function(a,b){this.proxy.update(this.dragData.ddel.cloneNode(true));this.onStartDrag(a,b);return true},afterRepair:function(){if(Ext.enableFx){Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9")}this.dragging=false},getRepairXY:function(a){return Ext.Element.fly(this.dragData.ddel).getXY()},destroy:function(){Ext.dd.DragZone.superclass.destroy.call(this);if(this.containerScroll){Ext.dd.ScrollManager.unregister(this.el)}}});Ext.dd.DropZone=function(b,a){Ext.dd.DropZone.superclass.constructor.call(this,b,a)};Ext.extend(Ext.dd.DropZone,Ext.dd.DropTarget,{getTargetFromEvent:function(a){return Ext.dd.Registry.getTargetFromEvent(a)},onNodeEnter:function(d,a,c,b){},onNodeOver:function(d,a,c,b){return this.dropAllowed},onNodeOut:function(d,a,c,b){},onNodeDrop:function(d,a,c,b){return false},onContainerOver:function(a,c,b){return this.dropNotAllowed},onContainerDrop:function(a,c,b){return false},notifyEnter:function(a,c,b){return this.dropNotAllowed},notifyOver:function(a,c,b){var d=this.getTargetFromEvent(c);if(!d){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,a,c,b);this.lastOverNode=null}return this.onContainerOver(a,c,b)}if(this.lastOverNode!=d){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,a,c,b)}this.onNodeEnter(d,a,c,b);this.lastOverNode=d}return this.onNodeOver(d,a,c,b)},notifyOut:function(a,c,b){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,a,c,b);this.lastOverNode=null}},notifyDrop:function(a,c,b){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,a,c,b);this.lastOverNode=null}var d=this.getTargetFromEvent(c);return d?this.onNodeDrop(d,a,c,b):this.onContainerDrop(a,c,b)},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)}});Ext.Element.addMethods({initDD:function(c,b,d){var a=new Ext.dd.DD(Ext.id(this.dom),c,b);return Ext.apply(a,d)},initDDProxy:function(c,b,d){var a=new Ext.dd.DDProxy(Ext.id(this.dom),c,b);return Ext.apply(a,d)},initDDTarget:function(c,b,d){var a=new Ext.dd.DDTarget(Ext.id(this.dom),c,b);return Ext.apply(a,d)}});Ext.data.Api=(function(){var a={};return{actions:{create:"create",read:"read",update:"update",destroy:"destroy"},restActions:{create:"POST",read:"GET",update:"PUT",destroy:"DELETE"},isAction:function(b){return(Ext.data.Api.actions[b])?true:false},getVerb:function(b){if(a[b]){return a[b]}for(var c in this.actions){if(this.actions[c]===b){a[b]=c;break}}return(a[b]!==undefined)?a[b]:null},isValid:function(b){var e=[];var d=this.actions;for(var c in b){if(!(c in d)){e.push(c)}}return(!e.length)?true:e},hasUniqueUrl:function(c,g){var b=(c.api[g])?c.api[g].url:null;var e=true;for(var d in c.api){if((e=(d===g)?true:(c.api[d].url!=b)?true:false)===false){break}}return e},prepare:function(b){if(!b.api){b.api={}}for(var d in this.actions){var c=this.actions[d];b.api[c]=b.api[c]||b.url||b.directFn;if(typeof(b.api[c])=="string"){b.api[c]={url:b.api[c],method:(b.restful===true)?Ext.data.Api.restActions[c]:undefined}}}},restify:function(b){b.restful=true;for(var c in this.restActions){b.api[this.actions[c]].method||(b.api[this.actions[c]].method=this.restActions[c])}b.onWrite=b.onWrite.createInterceptor(function(i,k,g,e){var d=k.reader;var h=new Ext.data.Response({action:i,raw:g});switch(g.status){case 200:return true;break;case 201:if(Ext.isEmpty(h.raw.responseText)){h.success=true}else{return true}break;case 204:h.success=true;h.data=null;break;default:return true;break}if(h.success===true){this.fireEvent("write",this,i,h.data,h,e,k.request.arg)}else{this.fireEvent("exception",this,"remote",i,k,h,e)}k.request.callback.call(k.request.scope,h.data,h,h.success);return false},b)}}})();Ext.data.Response=function(b,a){Ext.apply(this,b,{raw:a})};Ext.data.Response.prototype={message:null,success:false,status:null,root:null,raw:null,getMessage:function(){return this.message},getSuccess:function(){return this.success},getStatus:function(){return this.status},getRoot:function(){return this.root},getRawResponse:function(){return this.raw}};Ext.data.Api.Error=Ext.extend(Ext.Error,{constructor:function(b,a){this.arg=a;Ext.Error.call(this,b)},name:"Ext.data.Api"});Ext.apply(Ext.data.Api.Error.prototype,{lang:{"action-url-undefined":"No fallback url defined for this action. When defining a DataProxy api, please be sure to define an url for each CRUD action in Ext.data.Api.actions or define a default url in addition to your api-configuration.",invalid:"received an invalid API-configuration. Please ensure your proxy API-configuration contains only the actions defined in Ext.data.Api.actions","invalid-url":"Invalid url. Please review your proxy configuration.",execute:'Attempted to execute an unknown action. Valid API actions are defined in Ext.data.Api.actions"'}});Ext.data.SortTypes={none:function(a){return a},stripTagsRE:/<\/?[^>]+>/gi,asText:function(a){return String(a).replace(this.stripTagsRE,"")},asUCText:function(a){return String(a).toUpperCase().replace(this.stripTagsRE,"")},asUCString:function(a){return String(a).toUpperCase()},asDate:function(a){if(!a){return 0}if(Ext.isDate(a)){return a.getTime()}return Date.parse(String(a))},asFloat:function(a){var b=parseFloat(String(a).replace(/,/g,""));return isNaN(b)?0:b},asInt:function(a){var b=parseInt(String(a).replace(/,/g,""),10);return isNaN(b)?0:b}};Ext.data.Record=function(a,b){this.id=(b||b===0)?b:Ext.data.Record.id(this);this.data=a||{}};Ext.data.Record.create=function(e){var c=Ext.extend(Ext.data.Record,{});var d=c.prototype;d.fields=new Ext.util.MixedCollection(false,function(g){return g.name});for(var b=0,a=e.length;b<a;b++){d.fields.add(new Ext.data.Field(e[b]))}c.getField=function(g){return d.fields.get(g)};return c};Ext.data.Record.PREFIX="ext-record";Ext.data.Record.AUTO_ID=1;Ext.data.Record.EDIT="edit";Ext.data.Record.REJECT="reject";Ext.data.Record.COMMIT="commit";Ext.data.Record.id=function(a){a.phantom=true;return[Ext.data.Record.PREFIX,"-",Ext.data.Record.AUTO_ID++].join("")};Ext.data.Record.prototype={dirty:false,editing:false,error:null,modified:null,phantom:false,join:function(a){this.store=a},set:function(a,c){var b=Ext.isPrimitive(c)?String:Ext.encode;if(b(this.data[a])==b(c)){return}this.dirty=true;if(!this.modified){this.modified={}}if(this.modified[a]===undefined){this.modified[a]=this.data[a]}this.data[a]=c;if(!this.editing){this.afterEdit()}},afterEdit:function(){if(this.store!=undefined&&typeof this.store.afterEdit=="function"){this.store.afterEdit(this)}},afterReject:function(){if(this.store){this.store.afterReject(this)}},afterCommit:function(){if(this.store){this.store.afterCommit(this)}},get:function(a){return this.data[a]},beginEdit:function(){this.editing=true;this.modified=this.modified||{}},cancelEdit:function(){this.editing=false;delete this.modified},endEdit:function(){this.editing=false;if(this.dirty){this.afterEdit()}},reject:function(b){var a=this.modified;for(var c in a){if(typeof a[c]!="function"){this.data[c]=a[c]}}this.dirty=false;delete this.modified;this.editing=false;if(b!==true){this.afterReject()}},commit:function(a){this.dirty=false;delete this.modified;this.editing=false;if(a!==true){this.afterCommit()}},getChanges:function(){var a=this.modified,b={};for(var c in a){if(a.hasOwnProperty(c)){b[c]=this.data[c]}}return b},hasError:function(){return this.error!==null},clearError:function(){this.error=null},copy:function(a){return new this.constructor(Ext.apply({},this.data),a||this.id)},isModified:function(a){return !!(this.modified&&this.modified.hasOwnProperty(a))},isValid:function(){return this.fields.find(function(a){return(a.allowBlank===false&&Ext.isEmpty(this.data[a.name]))?true:false},this)?false:true},markDirty:function(){this.dirty=true;if(!this.modified){this.modified={}}this.fields.each(function(a){this.modified[a.name]=this.data[a.name]},this)}};Ext.StoreMgr=Ext.apply(new Ext.util.MixedCollection(),{register:function(){for(var a=0,b;(b=arguments[a]);a++){this.add(b)}},unregister:function(){for(var a=0,b;(b=arguments[a]);a++){this.remove(this.lookup(b))}},lookup:function(e){if(Ext.isArray(e)){var b=["field1"],d=!Ext.isArray(e[0]);if(!d){for(var c=2,a=e[0].length;c<=a;++c){b.push("field"+c)}}return new Ext.data.ArrayStore({fields:b,data:e,expandData:d,autoDestroy:true,autoCreated:true})}return Ext.isObject(e)?(e.events?e:Ext.create(e,"store")):this.get(e)},getKey:function(a){return a.storeId}});Ext.data.Store=Ext.extend(Ext.util.Observable,{writer:undefined,remoteSort:false,autoDestroy:false,pruneModifiedRecords:false,lastOptions:null,autoSave:true,batch:true,restful:false,paramNames:undefined,defaultParamNames:{start:"start",limit:"limit",sort:"sort",dir:"dir"},isDestroyed:false,hasMultiSort:false,batchKey:"_ext_batch_",constructor:function(a){this.data=new Ext.util.MixedCollection(false);this.data.getKey=function(b){return b.id};this.removed=[];if(a&&a.data){this.inlineData=a.data;delete a.data}Ext.apply(this,a);this.baseParams=Ext.isObject(this.baseParams)?this.baseParams:{};this.paramNames=Ext.applyIf(this.paramNames||{},this.defaultParamNames);if((this.url||this.api)&&!this.proxy){this.proxy=new Ext.data.HttpProxy({url:this.url,api:this.api})}if(this.restful===true&&this.proxy){this.batch=false;Ext.data.Api.restify(this.proxy)}if(this.reader){if(!this.recordType){this.recordType=this.reader.recordType}if(this.reader.onMetaChange){this.reader.onMetaChange=this.reader.onMetaChange.createSequence(this.onMetaChange,this)}if(this.writer){if(this.writer instanceof (Ext.data.DataWriter)===false){this.writer=this.buildWriter(this.writer)}this.writer.meta=this.reader.meta;this.pruneModifiedRecords=true}}if(this.recordType){this.fields=this.recordType.prototype.fields}this.modified=[];this.addEvents("datachanged","metachange","add","remove","update","clear","exception","beforeload","load","loadexception","beforewrite","write","beforesave","save");if(this.proxy){this.relayEvents(this.proxy,["loadexception","exception"])}if(this.writer){this.on({scope:this,add:this.createRecords,remove:this.destroyRecord,update:this.updateRecord,clear:this.onClear})}this.sortToggle={};if(this.sortField){this.setDefaultSort(this.sortField,this.sortDir)}else{if(this.sortInfo){this.setDefaultSort(this.sortInfo.field,this.sortInfo.direction)}}Ext.data.Store.superclass.constructor.call(this);if(this.id){this.storeId=this.id;delete this.id}if(this.storeId){Ext.StoreMgr.register(this)}if(this.inlineData){this.loadData(this.inlineData);delete this.inlineData}else{if(this.autoLoad){this.load.defer(10,this,[typeof this.autoLoad=="object"?this.autoLoad:undefined])}}this.batchCounter=0;this.batches={}},buildWriter:function(b){var a=undefined,c=(b.format||"json").toLowerCase();switch(c){case"json":a=Ext.data.JsonWriter;break;case"xml":a=Ext.data.XmlWriter;break;default:a=Ext.data.JsonWriter}return new a(b)},destroy:function(){if(!this.isDestroyed){if(this.storeId){Ext.StoreMgr.unregister(this)}this.clearData();this.data=null;Ext.destroy(this.proxy);this.reader=this.writer=null;this.purgeListeners();this.isDestroyed=true}},add:function(c){var e,a,b,d;c=[].concat(c);if(c.length<1){return}for(e=0,a=c.length;e<a;e++){b=c[e];b.join(this);if(b.dirty||b.phantom){this.modified.push(b)}}d=this.data.length;this.data.addAll(c);if(this.snapshot){this.snapshot.addAll(c)}this.fireEvent("add",this,c,d)},addSorted:function(a){var b=this.findInsertIndex(a);this.insert(b,a)},doUpdate:function(a){this.data.replace(a.id,a);if(this.snapshot){this.snapshot.replace(a.id,a)}this.fireEvent("update",this,a,Ext.data.Record.COMMIT)},remove:function(a){if(Ext.isArray(a)){Ext.each(a,function(c){this.remove(c)},this);return}var b=this.data.indexOf(a);if(b>-1){a.join(null);this.data.removeAt(b)}if(this.pruneModifiedRecords){this.modified.remove(a)}if(this.snapshot){this.snapshot.remove(a)}if(b>-1){this.fireEvent("remove",this,a,b)}},removeAt:function(a){this.remove(this.getAt(a))},removeAll:function(b){var a=[];this.each(function(c){a.push(c)});this.clearData();if(this.snapshot){this.snapshot.clear()}if(this.pruneModifiedRecords){this.modified=[]}if(b!==true){this.fireEvent("clear",this,a)}},onClear:function(b,a){Ext.each(a,function(d,c){this.destroyRecord(this,d,c)},this)},insert:function(d,c){var e,a,b;c=[].concat(c);for(e=0,a=c.length;e<a;e++){b=c[e];this.data.insert(d+e,b);b.join(this);if(b.dirty||b.phantom){this.modified.push(b)}}if(this.snapshot){this.snapshot.addAll(c)}this.fireEvent("add",this,c,d)},indexOf:function(a){return this.data.indexOf(a)},indexOfId:function(a){return this.data.indexOfKey(a)},getById:function(a){return(this.snapshot||this.data).key(a)},getAt:function(a){return this.data.itemAt(a)},getRange:function(b,a){return this.data.getRange(b,a)},storeOptions:function(a){a=Ext.apply({},a);delete a.callback;delete a.scope;this.lastOptions=a},clearData:function(){this.data.each(function(a){a.join(null)});this.data.clear()},load:function(b){b=Ext.apply({},b);this.storeOptions(b);if(this.sortInfo&&this.remoteSort){var a=this.paramNames;b.params=Ext.apply({},b.params);b.params[a.sort]=this.sortInfo.field;b.params[a.dir]=this.sortInfo.direction}try{return this.execute("read",null,b)}catch(c){this.handleException(c);return false}},updateRecord:function(b,a,c){if(c==Ext.data.Record.EDIT&&this.autoSave===true&&(!a.phantom||(a.phantom&&a.isValid()))){this.save()}},createRecords:function(c,b,e){var d=this.modified,h=b.length,a,g;for(g=0;g<h;g++){a=b[g];if(a.phantom&&a.isValid()){a.markDirty();if(d.indexOf(a)==-1){d.push(a)}}}if(this.autoSave===true){this.save()}},destroyRecord:function(b,a,c){if(this.modified.indexOf(a)!=-1){this.modified.remove(a)}if(!a.phantom){this.removed.push(a);a.lastIndex=c;if(this.autoSave===true){this.save()}}},execute:function(e,a,c,b){if(!Ext.data.Api.isAction(e)){throw new Ext.data.Api.Error("execute",e)}c=Ext.applyIf(c||{},{params:{}});if(b!==undefined){this.addToBatch(b)}var d=true;if(e==="read"){d=this.fireEvent("beforeload",this,c);Ext.applyIf(c.params,this.baseParams)}else{if(this.writer.listful===true&&this.restful!==true){a=(Ext.isArray(a))?a:[a]}else{if(Ext.isArray(a)&&a.length==1){a=a.shift()}}if((d=this.fireEvent("beforewrite",this,e,a,c))!==false){this.writer.apply(c.params,this.baseParams,e,a)}}if(d!==false){if(this.writer&&this.proxy.url&&!this.proxy.restful&&!Ext.data.Api.hasUniqueUrl(this.proxy,e)){c.params.xaction=e}this.proxy.request(Ext.data.Api.actions[e],a,c.params,this.reader,this.createCallback(e,a,b),this,c)}return d},save:function(){if(!this.writer){throw new Ext.data.Store.Error("writer-undefined")}var h=[],k,l,e,c={},d;if(this.removed.length){h.push(["destroy",this.removed])}var b=[].concat(this.getModifiedRecords());if(b.length){var g=[];for(d=b.length-1;d>=0;d--){if(b[d].phantom===true){var a=b.splice(d,1).shift();if(a.isValid()){g.push(a)}}else{if(!b[d].isValid()){b.splice(d,1)}}}if(g.length){h.push(["create",g])}if(b.length){h.push(["update",b])}}k=h.length;if(k){e=++this.batchCounter;for(d=0;d<k;++d){l=h[d];c[l[0]]=l[1]}if(this.fireEvent("beforesave",this,c)!==false){for(d=0;d<k;++d){l=h[d];this.doTransaction(l[0],l[1],e)}return e}}return -1},doTransaction:function(e,b,c){function g(h){try{this.execute(e,h,undefined,c)}catch(i){this.handleException(i)}}if(this.batch===false){for(var d=0,a=b.length;d<a;d++){g.call(this,b[d])}}else{g.call(this,b)}},addToBatch:function(c){var a=this.batches,d=this.batchKey+c,e=a[d];if(!e){a[d]=e={id:c,count:0,data:{}}}++e.count},removeFromBatch:function(d,h,g){var c=this.batches,e=this.batchKey+d,i=c[e],a;if(i){a=i.data[h]||[];i.data[h]=a.concat(g);if(i.count===1){g=i.data;delete c[e];this.fireEvent("save",this,d,g)}else{--i.count}}},createCallback:function(c,a,b){var d=Ext.data.Api.actions;return(c=="read")?this.loadRecords:function(g,e,h){this["on"+Ext.util.Format.capitalize(c)+"Records"](h,a,[].concat(g));if(h===true){this.fireEvent("write",this,c,g,e,a)}this.removeFromBatch(b,c,g)}},clearModified:function(a){if(Ext.isArray(a)){for(var b=a.length-1;b>=0;b--){this.modified.splice(this.modified.indexOf(a[b]),1)}}else{this.modified.splice(this.modified.indexOf(a),1)}},reMap:function(b){if(Ext.isArray(b)){for(var d=0,a=b.length;d<a;d++){this.reMap(b[d])}}else{delete this.data.map[b._phid];this.data.map[b.id]=b;var c=this.data.keys.indexOf(b._phid);this.data.keys.splice(c,1,b.id);delete b._phid}},onCreateRecords:function(d,a,b){if(d===true){try{this.reader.realize(a,b);this.reMap(a)}catch(c){this.handleException(c);if(Ext.isArray(a)){this.onCreateRecords(d,a,b)}}}},onUpdateRecords:function(d,a,b){if(d===true){try{this.reader.update(a,b)}catch(c){this.handleException(c);if(Ext.isArray(a)){this.onUpdateRecords(d,a,b)}}}},onDestroyRecords:function(e,b,d){b=(b instanceof Ext.data.Record)?[b]:[].concat(b);for(var c=0,a=b.length;c<a;c++){this.removed.splice(this.removed.indexOf(b[c]),1)}if(e===false){for(c=b.length-1;c>=0;c--){this.insert(b[c].lastIndex,b[c])}}},handleException:function(a){Ext.handleError(a)},reload:function(a){this.load(Ext.applyIf(a||{},this.lastOptions))},loadRecords:function(b,m,h){var e,g;if(this.isDestroyed===true){return}if(!b||h===false){if(h!==false){this.fireEvent("load",this,[],m)}if(m.callback){m.callback.call(m.scope||this,[],m,false,b)}return}var a=b.records,k=b.totalRecords||a.length;if(!m||m.add!==true){if(this.pruneModifiedRecords){this.modified=[]}for(e=0,g=a.length;e<g;e++){a[e].join(this)}if(this.snapshot){this.data=this.snapshot;delete this.snapshot}this.clearData();this.data.addAll(a);this.totalLength=k;this.applySort();this.fireEvent("datachanged",this)}else{var l=[],d,c=0;for(e=0,g=a.length;e<g;++e){d=a[e];if(this.indexOfId(d.id)>-1){this.doUpdate(d)}else{l.push(d);++c}}this.totalLength=Math.max(k,this.data.length+c);this.add(l)}this.fireEvent("load",this,a,m);if(m.callback){m.callback.call(m.scope||this,a,m,true)}},loadData:function(c,a){var b=this.reader.readRecords(c);this.loadRecords(b,{add:a},true)},getCount:function(){return this.data.length||0},getTotalCount:function(){return this.totalLength||0},getSortState:function(){return this.sortInfo},applySort:function(){if((this.sortInfo||this.multiSortInfo)&&!this.remoteSort){this.sortData()}},sortData:function(){var a=this.hasMultiSort?this.multiSortInfo:this.sortInfo,k=a.direction||"ASC",h=a.sorters,c=[];if(!this.hasMultiSort){h=[{direction:k,field:a.field}]}for(var d=0,b=h.length;d<b;d++){c.push(this.createSortFunction(h[d].field,h[d].direction))}if(c.length==0){return}var g=k.toUpperCase()=="DESC"?-1:1;var e=function(n,m){var l=c[0].call(this,n,m);if(c.length>1){for(var p=1,o=c.length;p<o;p++){l=l||c[p].call(this,n,m)}}return g*l};this.data.sort(k,e);if(this.snapshot&&this.snapshot!=this.data){this.snapshot.sort(k,e)}},createSortFunction:function(c,b){b=b||"ASC";var a=b.toUpperCase()=="DESC"?-1:1;var d=this.fields.get(c).sortType;return function(g,e){var i=d(g.data[c]),h=d(e.data[c]);return a*(i>h?1:(i<h?-1:0))}},setDefaultSort:function(b,a){a=a?a.toUpperCase():"ASC";this.sortInfo={field:b,direction:a};this.sortToggle[b]=a},sort:function(b,a){if(Ext.isArray(arguments[0])){return this.multiSort.call(this,b,a)}else{return this.singleSort(b,a)}},singleSort:function(g,c){var e=this.fields.get(g);if(!e){return false}var b=e.name,a=this.sortInfo||null,d=this.sortToggle?this.sortToggle[b]:null;if(!c){if(a&&a.field==b){c=(this.sortToggle[b]||"ASC").toggle("ASC","DESC")}else{c=e.sortDir}}this.sortToggle[b]=c;this.sortInfo={field:b,direction:c};this.hasMultiSort=false;if(this.remoteSort){if(!this.load(this.lastOptions)){if(d){this.sortToggle[b]=d}if(a){this.sortInfo=a}}}else{this.applySort();this.fireEvent("datachanged",this)}return true},multiSort:function(b,a){this.hasMultiSort=true;a=a||"ASC";if(this.multiSortInfo&&a==this.multiSortInfo.direction){a=a.toggle("ASC","DESC")}this.multiSortInfo={sorters:b,direction:a};if(this.remoteSort){this.singleSort(b[0].field,b[0].direction)}else{this.applySort();this.fireEvent("datachanged",this)}},each:function(b,a){this.data.each(b,a)},getModifiedRecords:function(){return this.modified},sum:function(e,g,a){var c=this.data.items,b=0;g=g||0;a=(a||a===0)?a:c.length-1;for(var d=g;d<=a;d++){b+=(c[d].data[e]||0)}return b},createFilterFn:function(d,c,e,a,b){if(Ext.isEmpty(c,false)){return false}c=this.data.createValueMatcher(c,e,a,b);return function(g){return c.test(g.data[d])}},createMultipleFilterFn:function(a){return function(b){var k=true;for(var d=0,c=a.length;d<c;d++){var h=a[d],g=h.fn,e=h.scope;k=k&&g.call(e,b)}return k}},filter:function(n,m,h,k,e){var l;if(Ext.isObject(n)){n=[n]}if(Ext.isArray(n)){var b=[];for(var g=0,d=n.length;g<d;g++){var a=n[g],c=a.fn,o=a.scope||this;if(!Ext.isFunction(c)){c=this.createFilterFn(a.property,a.value,a.anyMatch,a.caseSensitive,a.exactMatch)}b.push({fn:c,scope:o})}l=this.createMultipleFilterFn(b)}else{l=this.createFilterFn(n,m,h,k,e)}return l?this.filterBy(l):this.clearFilter()},filterBy:function(b,a){this.snapshot=this.snapshot||this.data;this.data=this.queryBy(b,a||this);this.fireEvent("datachanged",this)},clearFilter:function(a){if(this.isFiltered()){this.data=this.snapshot;delete this.snapshot;if(a!==true){this.fireEvent("datachanged",this)}}},isFiltered:function(){return !!this.snapshot&&this.snapshot!=this.data},query:function(d,c,e,a){var b=this.createFilterFn(d,c,e,a);return b?this.queryBy(b):this.data.clone()},queryBy:function(b,a){var c=this.snapshot||this.data;return c.filterBy(b,a||this)},find:function(d,c,g,e,a){var b=this.createFilterFn(d,c,e,a);return b?this.data.findIndexBy(b,null,g):-1},findExact:function(b,a,c){return this.data.findIndexBy(function(d){return d.get(b)===a},this,c)},findBy:function(b,a,c){return this.data.findIndexBy(b,a,c)},collect:function(k,m,b){var h=(b===true&&this.snapshot)?this.snapshot.items:this.data.items;var n,o,a=[],c={};for(var e=0,g=h.length;e<g;e++){n=h[e].data[k];o=String(n);if((m||!Ext.isEmpty(n))&&!c[o]){c[o]=true;a[a.length]=n}}return a},afterEdit:function(a){if(this.modified.indexOf(a)==-1){this.modified.push(a)}this.fireEvent("update",this,a,Ext.data.Record.EDIT)},afterReject:function(a){this.modified.remove(a);this.fireEvent("update",this,a,Ext.data.Record.REJECT)},afterCommit:function(a){this.modified.remove(a);this.fireEvent("update",this,a,Ext.data.Record.COMMIT)},commitChanges:function(){var a=this.modified.slice(0),c=a.length,b;for(b=0;b<c;b++){a[b].commit()}this.modified=[];this.removed=[]},rejectChanges:function(){var a=this.modified.slice(0),e=this.removed.slice(0).reverse(),c=a.length,d=e.length,b;for(b=0;b<c;b++){a[b].reject()}for(b=0;b<d;b++){this.insert(e[b].lastIndex||0,e[b]);e[b].reject()}this.modified=[];this.removed=[]},onMetaChange:function(a){this.recordType=this.reader.recordType;this.fields=this.recordType.prototype.fields;delete this.snapshot;if(this.reader.meta.sortInfo){this.sortInfo=this.reader.meta.sortInfo}else{if(this.sortInfo&&!this.fields.get(this.sortInfo.field)){delete this.sortInfo}}if(this.writer){this.writer.meta=this.reader.meta}this.modified=[];this.fireEvent("metachange",this,this.reader.meta)},findInsertIndex:function(a){this.suspendEvents();var c=this.data.clone();this.data.add(a);this.applySort();var b=this.data.indexOf(a);this.data=c;this.resumeEvents();return b},setBaseParam:function(a,b){this.baseParams=this.baseParams||{};this.baseParams[a]=b}});Ext.reg("store",Ext.data.Store);Ext.data.Store.Error=Ext.extend(Ext.Error,{name:"Ext.data.Store"});Ext.apply(Ext.data.Store.Error.prototype,{lang:{"writer-undefined":"Attempted to execute a write-action without a DataWriter installed."}});Ext.data.Field=Ext.extend(Object,{constructor:function(b){if(Ext.isString(b)){b={name:b}}Ext.apply(this,b);var d=Ext.data.Types,a=this.sortType,c;if(this.type){if(Ext.isString(this.type)){this.type=Ext.data.Types[this.type.toUpperCase()]||d.AUTO}}else{this.type=d.AUTO}if(Ext.isString(a)){this.sortType=Ext.data.SortTypes[a]}else{if(Ext.isEmpty(a)){this.sortType=this.type.sortType}}if(!this.convert){this.convert=this.type.convert}},dateFormat:null,useNull:false,defaultValue:"",mapping:null,sortType:null,sortDir:"ASC",allowBlank:true});Ext.data.DataReader=function(a,b){this.meta=a;this.recordType=Ext.isArray(b)?Ext.data.Record.create(b):b;if(this.recordType){this.buildExtractors()}};Ext.data.DataReader.prototype={getTotal:Ext.emptyFn,getRoot:Ext.emptyFn,getMessage:Ext.emptyFn,getSuccess:Ext.emptyFn,getId:Ext.emptyFn,buildExtractors:Ext.emptyFn,extractValues:Ext.emptyFn,realize:function(a,c){if(Ext.isArray(a)){for(var b=a.length-1;b>=0;b--){if(Ext.isArray(c)){this.realize(a.splice(b,1).shift(),c.splice(b,1).shift())}else{this.realize(a.splice(b,1).shift(),c)}}}else{if(Ext.isArray(c)&&c.length==1){c=c.shift()}if(!this.isData(c)){throw new Ext.data.DataReader.Error("realize",a)}a.phantom=false;a._phid=a.id;a.id=this.getId(c);a.data=c;a.commit()}},update:function(a,c){if(Ext.isArray(a)){for(var b=a.length-1;b>=0;b--){if(Ext.isArray(c)){this.update(a.splice(b,1).shift(),c.splice(b,1).shift())}else{this.update(a.splice(b,1).shift(),c)}}}else{if(Ext.isArray(c)&&c.length==1){c=c.shift()}if(this.isData(c)){a.data=Ext.apply(a.data,c)}a.commit()}},extractData:function(l,a){var k=(this instanceof Ext.data.JsonReader)?"json":"node";var c=[];if(this.isData(l)&&!(this instanceof Ext.data.XmlReader)){l=[l]}var h=this.recordType.prototype.fields,p=h.items,o=h.length,c=[];if(a===true){var m=this.recordType;for(var e=0;e<l.length;e++){var b=l[e];var g=new m(this.extractValues(b,p,o),this.getId(b));g[k]=b;c.push(g)}}else{for(var e=0;e<l.length;e++){var d=this.extractValues(l[e],p,o);d[this.meta.idProperty]=this.getId(l[e]);c.push(d)}}return c},isData:function(a){return(a&&Ext.isObject(a)&&!Ext.isEmpty(this.getId(a)))?true:false},onMetaChange:function(a){delete this.ef;this.meta=a;this.recordType=Ext.data.Record.create(a.fields);this.buildExtractors()}};Ext.data.DataReader.Error=Ext.extend(Ext.Error,{constructor:function(b,a){this.arg=a;Ext.Error.call(this,b)},name:"Ext.data.DataReader"});Ext.apply(Ext.data.DataReader.Error.prototype,{lang:{update:"#update received invalid data from server. Please see docs for DataReader#update and review your DataReader configuration.",realize:"#realize was called with invalid remote-data. Please see the docs for DataReader#realize and review your DataReader configuration.","invalid-response":"#readResponse received an invalid response from the server."}});Ext.data.DataWriter=function(a){Ext.apply(this,a)};Ext.data.DataWriter.prototype={writeAllFields:false,listful:false,apply:function(e,g,d,a){var c=[],b=d+"Record";if(Ext.isArray(a)){Ext.each(a,function(h){c.push(this[b](h))},this)}else{if(a instanceof Ext.data.Record){c=this[b](a)}}this.render(e,g,c)},render:Ext.emptyFn,updateRecord:Ext.emptyFn,createRecord:Ext.emptyFn,destroyRecord:Ext.emptyFn,toHash:function(g,c){var e=g.fields.map,d={},b=(this.writeAllFields===false&&g.phantom===false)?g.getChanges():g.data,a;Ext.iterate(b,function(i,h){if((a=e[i])){d[a.mapping?a.mapping:a.name]=h}});if(g.phantom){if(g.fields.containsKey(this.meta.idProperty)&&Ext.isEmpty(g.data[this.meta.idProperty])){delete d[this.meta.idProperty]}}else{d[this.meta.idProperty]=g.id}return d},toArray:function(b){var a=[];Ext.iterate(b,function(d,c){a.push({name:d,value:c})},this);return a}};Ext.data.DataProxy=function(a){a=a||{};this.api=a.api;this.url=a.url;this.restful=a.restful;this.listeners=a.listeners;this.prettyUrls=a.prettyUrls;this.addEvents("exception","beforeload","load","loadexception","beforewrite","write");Ext.data.DataProxy.superclass.constructor.call(this);try{Ext.data.Api.prepare(this)}catch(b){if(b instanceof Ext.data.Api.Error){b.toConsole()}}Ext.data.DataProxy.relayEvents(this,["beforewrite","write","exception"])};Ext.extend(Ext.data.DataProxy,Ext.util.Observable,{restful:false,setApi:function(){if(arguments.length==1){var a=Ext.data.Api.isValid(arguments[0]);if(a===true){this.api=arguments[0]}else{throw new Ext.data.Api.Error("invalid",a)}}else{if(arguments.length==2){if(!Ext.data.Api.isAction(arguments[0])){throw new Ext.data.Api.Error("invalid",arguments[0])}this.api[arguments[0]]=arguments[1]}}Ext.data.Api.prepare(this)},isApiAction:function(a){return(this.api[a])?true:false},request:function(e,b,g,a,h,d,c){if(!this.api[e]&&!this.load){throw new Ext.data.DataProxy.Error("action-undefined",e)}g=g||{};if((e===Ext.data.Api.actions.read)?this.fireEvent("beforeload",this,g):this.fireEvent("beforewrite",this,e,b,g)!==false){this.doRequest.apply(this,arguments)}else{h.call(d||this,null,c,false)}},load:null,doRequest:function(e,b,g,a,h,d,c){this.load(g,a,h,d,c)},onRead:Ext.emptyFn,onWrite:Ext.emptyFn,buildUrl:function(d,b){b=b||null;var c=(this.conn&&this.conn.url)?this.conn.url:(this.api[d])?this.api[d].url:this.url;if(!c){throw new Ext.data.Api.Error("invalid-url",d)}var e=null;var a=c.match(/(.*)(\.json|\.xml|\.html)$/);if(a){e=a[2];c=a[1]}if((this.restful===true||this.prettyUrls===true)&&b instanceof Ext.data.Record&&!b.phantom){c+="/"+b.id}return(e===null)?c:c+e},destroy:function(){this.purgeListeners()}});Ext.apply(Ext.data.DataProxy,Ext.util.Observable.prototype);Ext.util.Observable.call(Ext.data.DataProxy);Ext.data.DataProxy.Error=Ext.extend(Ext.Error,{constructor:function(b,a){this.arg=a;Ext.Error.call(this,b)},name:"Ext.data.DataProxy"});Ext.apply(Ext.data.DataProxy.Error.prototype,{lang:{"action-undefined":"DataProxy attempted to execute an API-action but found an undefined url / function. Please review your Proxy url/api-configuration.","api-invalid":"Recieved an invalid API-configuration. Please ensure your proxy API-configuration contains only the actions from Ext.data.Api.actions."}});Ext.data.Request=function(a){Ext.apply(this,a)};Ext.data.Request.prototype={action:undefined,rs:undefined,params:undefined,callback:Ext.emptyFn,scope:undefined,reader:undefined};Ext.data.Response=function(a){Ext.apply(this,a)};Ext.data.Response.prototype={action:undefined,success:undefined,message:undefined,data:undefined,raw:undefined,records:undefined};Ext.data.ScriptTagProxy=function(a){Ext.apply(this,a);Ext.data.ScriptTagProxy.superclass.constructor.call(this,a);this.head=document.getElementsByTagName("head")[0]};Ext.data.ScriptTagProxy.TRANS_ID=1000;Ext.extend(Ext.data.ScriptTagProxy,Ext.data.DataProxy,{timeout:30000,callbackParam:"callback",nocache:true,doRequest:function(e,g,d,h,k,l,m){var c=Ext.urlEncode(Ext.apply(d,this.extraParams));var b=this.buildUrl(e,g);if(!b){throw new Ext.data.Api.Error("invalid-url",b)}b=Ext.urlAppend(b,c);if(this.nocache){b=Ext.urlAppend(b,"_dc="+(new Date().getTime()))}var a=++Ext.data.ScriptTagProxy.TRANS_ID;var n={id:a,action:e,cb:"stcCallback"+a,scriptId:"stcScript"+a,params:d,arg:m,url:b,callback:k,scope:l,reader:h};window[n.cb]=this.createCallback(e,g,n);b+=String.format("&{0}={1}",this.callbackParam,n.cb);if(this.autoAbort!==false){this.abort()}n.timeoutId=this.handleFailure.defer(this.timeout,this,[n]);var i=document.createElement("script");i.setAttribute("src",b);i.setAttribute("type","text/javascript");i.setAttribute("id",n.scriptId);this.head.appendChild(i);this.trans=n},createCallback:function(d,b,c){var a=this;return function(e){a.trans=false;a.destroyTrans(c,true);if(d===Ext.data.Api.actions.read){a.onRead.call(a,d,c,e)}else{a.onWrite.call(a,d,c,e,b)}}},onRead:function(d,c,b){var a;try{a=c.reader.readRecords(b)}catch(g){this.fireEvent("loadexception",this,c,b,g);this.fireEvent("exception",this,"response",d,c,b,g);c.callback.call(c.scope||window,null,c.arg,false);return}if(a.success===false){this.fireEvent("loadexception",this,c,b);this.fireEvent("exception",this,"remote",d,c,b,null)}else{this.fireEvent("load",this,b,c.arg)}c.callback.call(c.scope||window,a,c.arg,a.success)},onWrite:function(h,g,c,b){var a=g.reader;try{var d=a.readResponse(h,c)}catch(i){this.fireEvent("exception",this,"response",h,g,d,i);g.callback.call(g.scope||window,null,d,false);return}if(!d.success===true){this.fireEvent("exception",this,"remote",h,g,d,b);g.callback.call(g.scope||window,null,d,false);return}this.fireEvent("write",this,h,d.data,d,b,g.arg);g.callback.call(g.scope||window,d.data,d,true)},isLoading:function(){return this.trans?true:false},abort:function(){if(this.isLoading()){this.destroyTrans(this.trans)}},destroyTrans:function(b,a){this.head.removeChild(document.getElementById(b.scriptId));clearTimeout(b.timeoutId);if(a){window[b.cb]=undefined;try{delete window[b.cb]}catch(c){}}else{window[b.cb]=function(){window[b.cb]=undefined;try{delete window[b.cb]}catch(d){}}}},handleFailure:function(a){this.trans=false;this.destroyTrans(a,false);if(a.action===Ext.data.Api.actions.read){this.fireEvent("loadexception",this,null,a.arg)}this.fireEvent("exception",this,"response",a.action,{response:null,options:a.arg});a.callback.call(a.scope||window,null,a.arg,false)},destroy:function(){this.abort();Ext.data.ScriptTagProxy.superclass.destroy.call(this)}});Ext.data.HttpProxy=function(a){Ext.data.HttpProxy.superclass.constructor.call(this,a);this.conn=a;this.conn.url=null;this.useAjax=!a||!a.events;var c=Ext.data.Api.actions;this.activeRequest={};for(var b in c){this.activeRequest[c[b]]=undefined}};Ext.extend(Ext.data.HttpProxy,Ext.data.DataProxy,{getConnection:function(){return this.useAjax?Ext.Ajax:this.conn},setUrl:function(a,b){this.conn.url=a;if(b===true){this.url=a;this.api=null;Ext.data.Api.prepare(this)}},doRequest:function(g,d,i,c,b,e,a){var h={method:(this.api[g])?this.api[g]["method"]:undefined,request:{callback:b,scope:e,arg:a},reader:c,callback:this.createCallback(g,d),scope:this};if(i.jsonData){h.jsonData=i.jsonData}else{if(i.xmlData){h.xmlData=i.xmlData}else{h.params=i||{}}}this.conn.url=this.buildUrl(g,d);if(this.useAjax){Ext.applyIf(h,this.conn);if(this.activeRequest[g]){}this.activeRequest[g]=Ext.Ajax.request(h)}else{this.conn.request(h)}this.conn.url=null},createCallback:function(b,a){return function(e,d,c){this.activeRequest[b]=undefined;if(!d){if(b===Ext.data.Api.actions.read){this.fireEvent("loadexception",this,e,c)}this.fireEvent("exception",this,"response",b,e,c);e.request.callback.call(e.request.scope,null,e.request.arg,false);return}if(b===Ext.data.Api.actions.read){this.onRead(b,e,c)}else{this.onWrite(b,e,c,a)}}},onRead:function(d,h,b){var a;try{a=h.reader.read(b)}catch(g){this.fireEvent("loadexception",this,h,b,g);this.fireEvent("exception",this,"response",d,h,b,g);h.request.callback.call(h.request.scope,null,h.request.arg,false);return}if(a.success===false){this.fireEvent("loadexception",this,h,b);var c=h.reader.readResponse(d,b);this.fireEvent("exception",this,"remote",d,h,c,null)}else{this.fireEvent("load",this,h,h.request.arg)}h.request.callback.call(h.request.scope,a,h.request.arg,a.success)},onWrite:function(g,i,c,b){var a=i.reader;var d;try{d=a.readResponse(g,c)}catch(h){this.fireEvent("exception",this,"response",g,i,c,h);i.request.callback.call(i.request.scope,null,i.request.arg,false);return}if(d.success===true){this.fireEvent("write",this,g,d.data,d,b,i.request.arg)}else{this.fireEvent("exception",this,"remote",g,i,d,b)}i.request.callback.call(i.request.scope,d.data,d,d.success)},destroy:function(){if(!this.useAjax){this.conn.abort()}else{if(this.activeRequest){var b=Ext.data.Api.actions;for(var a in b){if(this.activeRequest[b[a]]){Ext.Ajax.abort(this.activeRequest[b[a]])}}}}Ext.data.HttpProxy.superclass.destroy.call(this)}});Ext.data.MemoryProxy=function(b){var a={};a[Ext.data.Api.actions.read]=true;Ext.data.MemoryProxy.superclass.constructor.call(this,{api:a});this.data=b};Ext.extend(Ext.data.MemoryProxy,Ext.data.DataProxy,{doRequest:function(b,c,a,d,h,i,k){a=a||{};var l;try{l=d.readRecords(this.data)}catch(g){this.fireEvent("loadexception",this,null,k,g);this.fireEvent("exception",this,"response",b,k,null,g);h.call(i,null,k,false);return}h.call(i,l,k,true)}});Ext.data.Types=new function(){var a=Ext.data.SortTypes;Ext.apply(this,{stripRe:/[\$,%]/g,AUTO:{convert:function(b){return b},sortType:a.none,type:"auto"},STRING:{convert:function(b){return(b===undefined||b===null)?"":String(b)},sortType:a.asUCString,type:"string"},INT:{convert:function(b){return b!==undefined&&b!==null&&b!==""?parseInt(String(b).replace(Ext.data.Types.stripRe,""),10):(this.useNull?null:0)},sortType:a.none,type:"int"},FLOAT:{convert:function(b){return b!==undefined&&b!==null&&b!==""?parseFloat(String(b).replace(Ext.data.Types.stripRe,""),10):(this.useNull?null:0)},sortType:a.none,type:"float"},BOOL:{convert:function(b){return b===true||b==="true"||b==1},sortType:a.none,type:"bool"},DATE:{convert:function(c){var d=this.dateFormat;if(!c){return null}if(Ext.isDate(c)){return c}if(d){if(d=="timestamp"){return new Date(c*1000)}if(d=="time"){return new Date(parseInt(c,10))}return Date.parseDate(c,d)}var b=Date.parse(c);return b?new Date(b):null},sortType:a.asDate,type:"date"}});Ext.apply(this,{BOOLEAN:this.BOOL,INTEGER:this.INT,NUMBER:this.FLOAT})};Ext.data.JsonWriter=Ext.extend(Ext.data.DataWriter,{encode:true,encodeDelete:false,constructor:function(a){Ext.data.JsonWriter.superclass.constructor.call(this,a)},render:function(c,d,b){if(this.encode===true){Ext.apply(c,d);c[this.meta.root]=Ext.encode(b)}else{var a=Ext.apply({},d);a[this.meta.root]=b;c.jsonData=a}},createRecord:function(a){return this.toHash(a)},updateRecord:function(a){return this.toHash(a)},destroyRecord:function(b){if(this.encodeDelete){var a={};a[this.meta.idProperty]=b.id;return a}else{return b.id}}});Ext.data.JsonReader=function(a,b){a=a||{};Ext.applyIf(a,{idProperty:"id",successProperty:"success",totalProperty:"total"});Ext.data.JsonReader.superclass.constructor.call(this,a,b||a.fields)};Ext.extend(Ext.data.JsonReader,Ext.data.DataReader,{read:function(a){var b=a.responseText;var c=Ext.decode(b);if(!c){throw {message:"JsonReader.read: Json object not found"}}return this.readRecords(c)},readResponse:function(e,b){var g=(b.responseText!==undefined)?Ext.decode(b.responseText):b;if(!g){throw new Ext.data.JsonReader.Error("response")}var a=this.getRoot(g);if(e===Ext.data.Api.actions.create){var d=Ext.isDefined(a);if(d&&Ext.isEmpty(a)){throw new Ext.data.JsonReader.Error("root-empty",this.meta.root)}else{if(!d){throw new Ext.data.JsonReader.Error("root-undefined-response",this.meta.root)}}}var c=new Ext.data.Response({action:e,success:this.getSuccess(g),data:(a)?this.extractData(a,false):[],message:this.getMessage(g),raw:g});if(Ext.isEmpty(c.success)){throw new Ext.data.JsonReader.Error("successProperty-response",this.meta.successProperty)}return c},readRecords:function(a){this.jsonData=a;if(a.metaData){this.onMetaChange(a.metaData)}var n=this.meta,h=this.recordType,b=h.prototype.fields,m=b.items,i=b.length,k;var g=this.getRoot(a),e=g.length,d=e,l=true;if(n.totalProperty){k=parseInt(this.getTotal(a),10);if(!isNaN(k)){d=k}}if(n.successProperty){k=this.getSuccess(a);if(k===false||k==="false"){l=false}}return{success:l,records:this.extractData(g,true),totalRecords:d}},buildExtractors:function(){if(this.ef){return}var m=this.meta,h=this.recordType,e=h.prototype.fields,l=e.items,k=e.length;if(m.totalProperty){this.getTotal=this.createAccessor(m.totalProperty)}if(m.successProperty){this.getSuccess=this.createAccessor(m.successProperty)}if(m.messageProperty){this.getMessage=this.createAccessor(m.messageProperty)}this.getRoot=m.root?this.createAccessor(m.root):function(g){return g};if(m.id||m.idProperty){var d=this.createAccessor(m.id||m.idProperty);this.getId=function(i){var g=d(i);return(g===undefined||g==="")?null:g}}else{this.getId=function(){return null}}var c=[];for(var b=0;b<k;b++){e=l[b];var a=(e.mapping!==undefined&&e.mapping!==null)?e.mapping:e.name;c.push(this.createAccessor(a))}this.ef=c},simpleAccess:function(b,a){return b[a]},createAccessor:function(){var a=/[\[\.]/;return function(c){if(Ext.isEmpty(c)){return Ext.emptyFn}if(Ext.isFunction(c)){return c}var b=String(c).search(a);if(b>=0){return new Function("obj","return obj"+(b>0?".":"")+c)}return function(d){return d[c]}}}(),extractValues:function(h,d,a){var g,c={};for(var e=0;e<a;e++){g=d[e];var b=this.ef[e](h);c[g.name]=g.convert((b!==undefined)?b:g.defaultValue,h)}return c}});Ext.data.JsonReader.Error=Ext.extend(Ext.Error,{constructor:function(b,a){this.arg=a;Ext.Error.call(this,b)},name:"Ext.data.JsonReader"});Ext.apply(Ext.data.JsonReader.Error.prototype,{lang:{response:"An error occurred while json-decoding your server response","successProperty-response":'Could not locate your "successProperty" in your server response. Please review your JsonReader config to ensure the config-property "successProperty" matches the property in your server-response. See the JsonReader docs.',"root-undefined-config":'Your JsonReader was configured without a "root" property. Please review your JsonReader config and make sure to define the root property. See the JsonReader docs.',"idProperty-undefined":'Your JsonReader was configured without an "idProperty" Please review your JsonReader configuration and ensure the "idProperty" is set (e.g.: "id"). See the JsonReader docs.',"root-empty":'Data was expected to be returned by the server in the "root" property of the response. Please review your JsonReader configuration to ensure the "root" property matches that returned in the server-response. See JsonReader docs.'}});Ext.data.ArrayReader=Ext.extend(Ext.data.JsonReader,{readRecords:function(r){this.arrayData=r;var l=this.meta,d=l?Ext.num(l.idIndex,l.id):null,b=this.recordType,q=b.prototype.fields,z=[],e=true,g;var u=this.getRoot(r);for(var y=0,A=u.length;y<A;y++){var t=u[y],a={},p=((d||d===0)&&t[d]!==undefined&&t[d]!==""?t[d]:null);for(var x=0,m=q.length;x<m;x++){var B=q.items[x],w=B.mapping!==undefined&&B.mapping!==null?B.mapping:x;g=t[w]!==undefined?t[w]:B.defaultValue;g=B.convert(g,t);a[B.name]=g}var c=new b(a,p);c.json=t;z[z.length]=c}var h=z.length;if(l.totalProperty){g=parseInt(this.getTotal(r),10);if(!isNaN(g)){h=g}}if(l.successProperty){g=this.getSuccess(r);if(g===false||g==="false"){e=false}}return{success:e,records:z,totalRecords:h}}});Ext.data.ArrayStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.ArrayStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.ArrayReader(a)}))},loadData:function(e,b){if(this.expandData===true){var d=[];for(var c=0,a=e.length;c<a;c++){d[d.length]=[e[c]]}e=d}Ext.data.ArrayStore.superclass.loadData.call(this,e,b)}});Ext.reg("arraystore",Ext.data.ArrayStore);Ext.data.SimpleStore=Ext.data.ArrayStore;Ext.reg("simplestore",Ext.data.SimpleStore);Ext.data.JsonStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.JsonStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.JsonReader(a)}))}});Ext.reg("jsonstore",Ext.data.JsonStore);Ext.data.XmlWriter=function(a){Ext.data.XmlWriter.superclass.constructor.apply(this,arguments);this.tpl=(typeof(this.tpl)==="string")?new Ext.XTemplate(this.tpl).compile():this.tpl.compile()};Ext.extend(Ext.data.XmlWriter,Ext.data.DataWriter,{documentRoot:"xrequest",forceDocumentRoot:false,root:"records",xmlVersion:"1.0",xmlEncoding:"ISO-8859-15",tpl:'<tpl for="."><\u003fxml version="{version}" encoding="{encoding}"\u003f><tpl if="documentRoot"><{documentRoot}><tpl for="baseParams"><tpl for="."><{name}>{value}</{name}></tpl></tpl></tpl><tpl if="records.length&gt;1"><{root}></tpl><tpl for="records"><{parent.record}><tpl for="."><{name}>{value}</{name}></tpl></{parent.record}></tpl><tpl if="records.length&gt;1"></{root}></tpl><tpl if="documentRoot"></{documentRoot}></tpl></tpl>',render:function(b,c,a){c=this.toArray(c);b.xmlData=this.tpl.applyTemplate({version:this.xmlVersion,encoding:this.xmlEncoding,documentRoot:(c.length>0||this.forceDocumentRoot===true)?this.documentRoot:false,record:this.meta.record,root:this.root,baseParams:c,records:(Ext.isArray(a[0]))?a:[a]})},createRecord:function(a){return this.toArray(this.toHash(a))},updateRecord:function(a){return this.toArray(this.toHash(a))},destroyRecord:function(b){var a={};a[this.meta.idProperty]=b.id;return this.toArray(a)}});Ext.data.XmlReader=function(a,b){a=a||{};Ext.applyIf(a,{idProperty:a.idProperty||a.idPath||a.id,successProperty:a.successProperty||a.success});Ext.data.XmlReader.superclass.constructor.call(this,a,b||a.fields)};Ext.extend(Ext.data.XmlReader,Ext.data.DataReader,{read:function(a){var b=a.responseXML;if(!b){throw {message:"XmlReader.read: XML Document not available"}}return this.readRecords(b)},readRecords:function(d){this.xmlData=d;var a=d.documentElement||d,c=Ext.DomQuery,g=0,e=true;if(this.meta.totalProperty){g=this.getTotal(a,0)}if(this.meta.successProperty){e=this.getSuccess(a)}var b=this.extractData(c.select(this.meta.record,a),true);return{success:e,records:b,totalRecords:g||b.length}},readResponse:function(g,b){var e=Ext.DomQuery,h=b.responseXML,a=h.documentElement||h;var c=new Ext.data.Response({action:g,success:this.getSuccess(a),message:this.getMessage(a),data:this.extractData(e.select(this.meta.record,a)||e.select(this.meta.root,a),false),raw:h});if(Ext.isEmpty(c.success)){throw new Ext.data.DataReader.Error("successProperty-response",this.meta.successProperty)}if(g===Ext.data.Api.actions.create){var d=Ext.isDefined(c.data);if(d&&Ext.isEmpty(c.data)){throw new Ext.data.JsonReader.Error("root-empty",this.meta.root)}else{if(!d){throw new Ext.data.JsonReader.Error("root-undefined-response",this.meta.root)}}}return c},getSuccess:function(){return true},buildExtractors:function(){if(this.ef){return}var m=this.meta,h=this.recordType,e=h.prototype.fields,l=e.items,k=e.length;if(m.totalProperty){this.getTotal=this.createAccessor(m.totalProperty)}if(m.successProperty){this.getSuccess=this.createAccessor(m.successProperty)}if(m.messageProperty){this.getMessage=this.createAccessor(m.messageProperty)}this.getRoot=function(g){return(!Ext.isEmpty(g[this.meta.record]))?g[this.meta.record]:g[this.meta.root]};if(m.idPath||m.idProperty){var d=this.createAccessor(m.idPath||m.idProperty);this.getId=function(g){var i=d(g)||g.id;return(i===undefined||i==="")?null:i}}else{this.getId=function(){return null}}var c=[];for(var b=0;b<k;b++){e=l[b];var a=(e.mapping!==undefined&&e.mapping!==null)?e.mapping:e.name;c.push(this.createAccessor(a))}this.ef=c},createAccessor:function(){var a=Ext.DomQuery;return function(b){if(Ext.isFunction(b)){return b}switch(b){case this.meta.totalProperty:return function(c,d){return a.selectNumber(b,c,d)};break;case this.meta.successProperty:return function(d,e){var c=a.selectValue(b,d,true);var g=c!==false&&c!=="false";return g};break;default:return function(c,d){return a.selectValue(b,c,d)};break}}}(),extractValues:function(h,d,a){var g,c={};for(var e=0;e<a;e++){g=d[e];var b=this.ef[e](h);c[g.name]=g.convert((b!==undefined)?b:g.defaultValue,h)}return c}});Ext.data.XmlStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.XmlStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.XmlReader(a)}))}});Ext.reg("xmlstore",Ext.data.XmlStore);Ext.data.GroupingStore=Ext.extend(Ext.data.Store,{constructor:function(d){d=d||{};this.hasMultiSort=true;this.multiSortInfo=this.multiSortInfo||{sorters:[]};var e=this.multiSortInfo.sorters,c=d.groupField||this.groupField,b=d.sortInfo||this.sortInfo,a=d.groupDir||this.groupDir;if(c){e.push({field:c,direction:a})}if(b){e.push(b)}Ext.data.GroupingStore.superclass.constructor.call(this,d);this.addEvents("groupchange");this.applyGroupField()},remoteGroup:false,groupOnSort:false,groupDir:"ASC",clearGrouping:function(){this.groupField=false;if(this.remoteGroup){if(this.baseParams){delete this.baseParams.groupBy;delete this.baseParams.groupDir}var a=this.lastOptions;if(a&&a.params){delete a.params.groupBy;delete a.params.groupDir}this.reload()}else{this.sort();this.fireEvent("datachanged",this)}},groupBy:function(e,a,d){d=d?(String(d).toUpperCase()=="DESC"?"DESC":"ASC"):this.groupDir;if(this.groupField==e&&this.groupDir==d&&!a){return}var c=this.multiSortInfo.sorters;if(c.length>0&&c[0].field==this.groupField){c.shift()}this.groupField=e;this.groupDir=d;this.applyGroupField();var b=function(){this.fireEvent("groupchange",this,this.getGroupState())};if(this.groupOnSort){this.sort(e,d);b.call(this);return}if(this.remoteGroup){this.on("load",b,this,{single:true});this.reload()}else{this.sort(c);b.call(this)}},sort:function(h,c){if(this.remoteSort){return Ext.data.GroupingStore.superclass.sort.call(this,h,c)}var g=[];if(Ext.isArray(arguments[0])){g=arguments[0]}else{if(h==undefined){g=this.sortInfo?[this.sortInfo]:[]}else{var e=this.fields.get(h);if(!e){return false}var b=e.name,a=this.sortInfo||null,d=this.sortToggle?this.sortToggle[b]:null;if(!c){if(a&&a.field==b){c=(this.sortToggle[b]||"ASC").toggle("ASC","DESC")}else{c=e.sortDir}}this.sortToggle[b]=c;this.sortInfo={field:b,direction:c};g=[this.sortInfo]}}if(this.groupField){g.unshift({direction:this.groupDir,field:this.groupField})}return this.multiSort.call(this,g,c)},applyGroupField:function(){if(this.remoteGroup){if(!this.baseParams){this.baseParams={}}Ext.apply(this.baseParams,{groupBy:this.groupField,groupDir:this.groupDir});var a=this.lastOptions;if(a&&a.params){a.params.groupDir=this.groupDir;delete a.params.groupBy}}},applyGrouping:function(a){if(this.groupField!==false){this.groupBy(this.groupField,true,this.groupDir);return true}else{if(a===true){this.fireEvent("datachanged",this)}return false}},getGroupState:function(){return this.groupOnSort&&this.groupField!==false?(this.sortInfo?this.sortInfo.field:undefined):this.groupField}});Ext.reg("groupingstore",Ext.data.GroupingStore);Ext.data.DirectProxy=function(a){Ext.apply(this,a);if(typeof this.paramOrder=="string"){this.paramOrder=this.paramOrder.split(/[\s,|]/)}Ext.data.DirectProxy.superclass.constructor.call(this,a)};Ext.extend(Ext.data.DirectProxy,Ext.data.DataProxy,{paramOrder:undefined,paramsAsHash:true,directFn:undefined,doRequest:function(b,c,a,e,l,m,o){var k=[],h=this.api[b]||this.directFn;switch(b){case Ext.data.Api.actions.create:k.push(a.jsonData);break;case Ext.data.Api.actions.read:if(h.directCfg.method.len>0){if(this.paramOrder){for(var d=0,g=this.paramOrder.length;d<g;d++){k.push(a[this.paramOrder[d]])}}else{if(this.paramsAsHash){k.push(a)}}}break;case Ext.data.Api.actions.update:k.push(a.jsonData);break;case Ext.data.Api.actions.destroy:k.push(a.jsonData);break}var n={params:a||{},request:{callback:l,scope:m,arg:o},reader:e};k.push(this.createCallback(b,c,n),this);h.apply(window,k)},createCallback:function(d,a,b){var c=this;return function(e,g){if(!g.status){if(d===Ext.data.Api.actions.read){c.fireEvent("loadexception",c,b,g,null)}c.fireEvent("exception",c,"remote",d,b,g,null);b.request.callback.call(b.request.scope,null,b.request.arg,false);return}if(d===Ext.data.Api.actions.read){c.onRead(d,b,e,g)}else{c.onWrite(d,b,e,g,a)}}},onRead:function(g,e,a,d){var b;try{b=e.reader.readRecords(a)}catch(c){this.fireEvent("loadexception",this,e,d,c);this.fireEvent("exception",this,"response",g,e,d,c);e.request.callback.call(e.request.scope,null,e.request.arg,false);return}this.fireEvent("load",this,d,e.request.arg);e.request.callback.call(e.request.scope,b,e.request.arg,true)},onWrite:function(g,d,a,c,b){var e=d.reader.extractData(d.reader.getRoot(a),false);var h=d.reader.getSuccess(a);h=(h!==false);if(h){this.fireEvent("write",this,g,e,c,b,d.request.arg)}else{this.fireEvent("exception",this,"remote",g,d,a,b)}d.request.callback.call(d.request.scope,e,c,h)}});Ext.data.DirectStore=Ext.extend(Ext.data.Store,{constructor:function(a){var b=Ext.apply({},{batchTransactions:false},a);Ext.data.DirectStore.superclass.constructor.call(this,Ext.apply(b,{proxy:Ext.isDefined(b.proxy)?b.proxy:new Ext.data.DirectProxy(Ext.copyTo({},b,"paramOrder,paramsAsHash,directFn,api")),reader:(!Ext.isDefined(b.reader)&&b.fields)?new Ext.data.JsonReader(Ext.copyTo({},b,"totalProperty,root,idProperty"),b.fields):b.reader}))}});Ext.reg("directstore",Ext.data.DirectStore);Ext.Direct=Ext.extend(Ext.util.Observable,{exceptions:{TRANSPORT:"xhr",PARSE:"parse",LOGIN:"login",SERVER:"exception"},constructor:function(){this.addEvents("event","exception");this.transactions={};this.providers={}},addProvider:function(e){var c=arguments;if(c.length>1){for(var d=0,b=c.length;d<b;d++){this.addProvider(c[d])}return}if(!e.events){e=new Ext.Direct.PROVIDERS[e.type](e)}e.id=e.id||Ext.id();this.providers[e.id]=e;e.on("data",this.onProviderData,this);e.on("exception",this.onProviderException,this);if(!e.isConnected()){e.connect()}return e},getProvider:function(a){return this.providers[a]},removeProvider:function(b){var a=b.id?b:this.providers[b];a.un("data",this.onProviderData,this);a.un("exception",this.onProviderException,this);delete this.providers[a.id];return a},addTransaction:function(a){this.transactions[a.tid]=a;return a},removeTransaction:function(a){delete this.transactions[a.tid||a];return a},getTransaction:function(a){return this.transactions[a.tid||a]},onProviderData:function(d,c){if(Ext.isArray(c)){for(var b=0,a=c.length;b<a;b++){this.onProviderData(d,c[b])}return}if(c.name&&c.name!="event"&&c.name!="exception"){this.fireEvent(c.name,c)}else{if(c.type=="exception"){this.fireEvent("exception",c)}}this.fireEvent("event",c,d)},createEvent:function(a,b){return new Ext.Direct.eventTypes[a.type](Ext.apply(a,b))}});Ext.Direct=new Ext.Direct();Ext.Direct.TID=1;Ext.Direct.PROVIDERS={};Ext.Direct.Transaction=function(a){Ext.apply(this,a);this.tid=++Ext.Direct.TID;this.retryCount=0};Ext.Direct.Transaction.prototype={send:function(){this.provider.queueTransaction(this)},retry:function(){this.retryCount++;this.send()},getProvider:function(){return this.provider}};Ext.Direct.Event=function(a){Ext.apply(this,a)};Ext.Direct.Event.prototype={status:true,getData:function(){return this.data}};Ext.Direct.RemotingEvent=Ext.extend(Ext.Direct.Event,{type:"rpc",getTransaction:function(){return this.transaction||Ext.Direct.getTransaction(this.tid)}});Ext.Direct.ExceptionEvent=Ext.extend(Ext.Direct.RemotingEvent,{status:false,type:"exception"});Ext.Direct.eventTypes={rpc:Ext.Direct.RemotingEvent,event:Ext.Direct.Event,exception:Ext.Direct.ExceptionEvent};Ext.direct.Provider=Ext.extend(Ext.util.Observable,{priority:1,constructor:function(a){Ext.apply(this,a);this.addEvents("connect","disconnect","data","exception");Ext.direct.Provider.superclass.constructor.call(this,a)},isConnected:function(){return false},connect:Ext.emptyFn,disconnect:Ext.emptyFn});Ext.direct.JsonProvider=Ext.extend(Ext.direct.Provider,{parseResponse:function(a){if(!Ext.isEmpty(a.responseText)){if(typeof a.responseText=="object"){return a.responseText}return Ext.decode(a.responseText)}return null},getEvents:function(k){var g=null;try{g=this.parseResponse(k)}catch(h){var d=new Ext.Direct.ExceptionEvent({data:h,xhr:k,code:Ext.Direct.exceptions.PARSE,message:"Error parsing json response: \n\n "+g});return[d]}var c=[];if(Ext.isArray(g)){for(var b=0,a=g.length;b<a;b++){c.push(Ext.Direct.createEvent(g[b]))}}else{c.push(Ext.Direct.createEvent(g))}return c}});Ext.direct.PollingProvider=Ext.extend(Ext.direct.JsonProvider,{priority:3,interval:3000,constructor:function(a){Ext.direct.PollingProvider.superclass.constructor.call(this,a);this.addEvents("beforepoll","poll")},isConnected:function(){return !!this.pollTask},connect:function(){if(this.url&&!this.pollTask){this.pollTask=Ext.TaskMgr.start({run:function(){if(this.fireEvent("beforepoll",this)!==false){if(typeof this.url=="function"){this.url(this.baseParams)}else{Ext.Ajax.request({url:this.url,callback:this.onData,scope:this,params:this.baseParams})}}},interval:this.interval,scope:this});this.fireEvent("connect",this)}else{if(!this.url){throw"Error initializing PollingProvider, no url configured."}}},disconnect:function(){if(this.pollTask){Ext.TaskMgr.stop(this.pollTask);delete this.pollTask;this.fireEvent("disconnect",this)}},onData:function(d,k,h){if(k){var c=this.getEvents(h);for(var b=0,a=c.length;b<a;b++){var g=c[b];this.fireEvent("data",this,g)}}else{var g=new Ext.Direct.ExceptionEvent({data:g,code:Ext.Direct.exceptions.TRANSPORT,message:"Unable to connect to the server.",xhr:h});this.fireEvent("data",this,g)}}});Ext.Direct.PROVIDERS.polling=Ext.direct.PollingProvider;Ext.direct.RemotingProvider=Ext.extend(Ext.direct.JsonProvider,{enableBuffer:10,maxRetries:1,timeout:undefined,constructor:function(a){Ext.direct.RemotingProvider.superclass.constructor.call(this,a);this.addEvents("beforecall","call");this.namespace=(Ext.isString(this.namespace))?Ext.ns(this.namespace):this.namespace||window;this.transactions={};this.callBuffer=[]},initAPI:function(){var h=this.actions;for(var k in h){var d=this.namespace[k]||(this.namespace[k]={}),e=h[k];for(var g=0,b=e.length;g<b;g++){var a=e[g];d[a.name]=this.createMethod(k,a)}}},isConnected:function(){return !!this.connected},connect:function(){if(this.url){this.initAPI();this.connected=true;this.fireEvent("connect",this)}else{if(!this.url){throw"Error initializing RemotingProvider, no url configured."}}},disconnect:function(){if(this.connected){this.connected=false;this.fireEvent("disconnect",this)}},onData:function(a,h,k){if(h){var l=this.getEvents(k);for(var b=0,c=l.length;b<c;b++){var d=l[b],m=this.getTransaction(d);this.fireEvent("data",this,d);if(m){this.doCallback(m,d,true);Ext.Direct.removeTransaction(m)}}}else{var g=[].concat(a.ts);for(var b=0,c=g.length;b<c;b++){var m=this.getTransaction(g[b]);if(m&&m.retryCount<this.maxRetries){m.retry()}else{var d=new Ext.Direct.ExceptionEvent({data:d,transaction:m,code:Ext.Direct.exceptions.TRANSPORT,message:"Unable to connect to the server.",xhr:k});this.fireEvent("data",this,d);if(m){this.doCallback(m,d,false);Ext.Direct.removeTransaction(m)}}}}},getCallData:function(a){return{action:a.action,method:a.method,data:a.data,type:"rpc",tid:a.tid}},doSend:function(d){var g={url:this.url,callback:this.onData,scope:this,ts:d,timeout:this.timeout},b;if(Ext.isArray(d)){b=[];for(var c=0,a=d.length;c<a;c++){b.push(this.getCallData(d[c]))}}else{b=this.getCallData(d)}if(this.enableUrlEncode){var e={};e[Ext.isString(this.enableUrlEncode)?this.enableUrlEncode:"data"]=Ext.encode(b);g.params=e}else{g.jsonData=b}Ext.Ajax.request(g)},combineAndSend:function(){var a=this.callBuffer.length;if(a>0){this.doSend(a==1?this.callBuffer[0]:this.callBuffer);this.callBuffer=[]}},queueTransaction:function(a){if(a.form){this.processForm(a);return}this.callBuffer.push(a);if(this.enableBuffer){if(!this.callTask){this.callTask=new Ext.util.DelayedTask(this.combineAndSend,this)}this.callTask.delay(Ext.isNumber(this.enableBuffer)?this.enableBuffer:10)}else{this.combineAndSend()}},doCall:function(i,a,b){var h=null,e=b[a.len],g=b[a.len+1];if(a.len!==0){h=b.slice(0,a.len)}var d=new Ext.Direct.Transaction({provider:this,args:b,action:i,method:a.name,data:h,cb:g&&Ext.isFunction(e)?e.createDelegate(g):e});if(this.fireEvent("beforecall",this,d,a)!==false){Ext.Direct.addTransaction(d);this.queueTransaction(d);this.fireEvent("call",this,d,a)}},doForm:function(k,b,g,i,e){var d=new Ext.Direct.Transaction({provider:this,action:k,method:b.name,args:[g,i,e],cb:e&&Ext.isFunction(i)?i.createDelegate(e):i,isForm:true});if(this.fireEvent("beforecall",this,d,b)!==false){Ext.Direct.addTransaction(d);var a=String(g.getAttribute("enctype")).toLowerCase()=="multipart/form-data",h={extTID:d.tid,extAction:k,extMethod:b.name,extType:"rpc",extUpload:String(a)};Ext.apply(d,{form:Ext.getDom(g),isUpload:a,params:i&&Ext.isObject(i.params)?Ext.apply(h,i.params):h});this.fireEvent("call",this,d,b);this.processForm(d)}},processForm:function(a){Ext.Ajax.request({url:this.url,params:a.params,callback:this.onData,scope:this,form:a.form,isUpload:a.isUpload,ts:a})},createMethod:function(d,a){var b;if(!a.formHandler){b=function(){this.doCall(d,a,Array.prototype.slice.call(arguments,0))}.createDelegate(this)}else{b=function(e,g,c){this.doForm(d,a,e,g,c)}.createDelegate(this)}b.directCfg={action:d,method:a};return b},getTransaction:function(a){return a&&a.tid?Ext.Direct.getTransaction(a.tid):null},doCallback:function(c,g){var d=g.status?"success":"failure";if(c&&c.cb){var b=c.cb,a=Ext.isDefined(g.result)?g.result:g.data;if(Ext.isFunction(b)){b(a,g)}else{Ext.callback(b[d],b.scope,[a,g]);Ext.callback(b.callback,b.scope,[a,g])}}}});Ext.Direct.PROVIDERS.remoting=Ext.direct.RemotingProvider;Ext.Resizable=Ext.extend(Ext.util.Observable,{constructor:function(d,e){this.el=Ext.get(d);if(e&&e.wrap){e.resizeChild=this.el;this.el=this.el.wrap(typeof e.wrap=="object"?e.wrap:{cls:"xresizable-wrap"});this.el.id=this.el.dom.id=e.resizeChild.id+"-rzwrap";this.el.setStyle("overflow","hidden");this.el.setPositioning(e.resizeChild.getPositioning());e.resizeChild.clearPositioning();if(!e.width||!e.height){var g=e.resizeChild.getSize();this.el.setSize(g.width,g.height)}if(e.pinned&&!e.adjustments){e.adjustments="auto"}}this.proxy=this.el.createProxy({tag:"div",cls:"x-resizable-proxy",id:this.el.id+"-rzproxy"},Ext.getBody());this.proxy.unselectable();this.proxy.enableDisplayMode("block");Ext.apply(this,e);if(this.pinned){this.disableTrackOver=true;this.el.addClass("x-resizable-pinned")}var l=this.el.getStyle("position");if(l!="absolute"&&l!="fixed"){this.el.setStyle("position","relative")}if(!this.handles){this.handles="s,e,se";if(this.multiDirectional){this.handles+=",n,w"}}if(this.handles=="all"){this.handles="n s e w ne nw se sw"}var p=this.handles.split(/\s*?[,;]\s*?| /);var c=Ext.Resizable.positions;for(var k=0,m=p.length;k<m;k++){if(p[k]&&c[p[k]]){var o=c[p[k]];this[o]=new Ext.Resizable.Handle(this,o,this.disableTrackOver,this.transparent,this.handleCls)}}this.corner=this.southeast;if(this.handles.indexOf("n")!=-1||this.handles.indexOf("w")!=-1){this.updateBox=true}this.activeHandle=null;if(this.resizeChild){if(typeof this.resizeChild=="boolean"){this.resizeChild=Ext.get(this.el.dom.firstChild,true)}else{this.resizeChild=Ext.get(this.resizeChild,true)}}if(this.adjustments=="auto"){var b=this.resizeChild;var n=this.west,h=this.east,a=this.north,p=this.south;if(b&&(n||a)){b.position("relative");b.setLeft(n?n.el.getWidth():0);b.setTop(a?a.el.getHeight():0)}this.adjustments=[(h?-h.el.getWidth():0)+(n?-n.el.getWidth():0),(a?-a.el.getHeight():0)+(p?-p.el.getHeight():0)-1]}if(this.draggable){this.dd=this.dynamic?this.el.initDD(null):this.el.initDDProxy(null,{dragElId:this.proxy.id});this.dd.setHandleElId(this.resizeChild?this.resizeChild.id:this.el.id);if(this.constrainTo){this.dd.constrainTo(this.constrainTo)}}this.addEvents("beforeresize","resize");if(this.width!==null&&this.height!==null){this.resizeTo(this.width,this.height)}else{this.updateChildSize()}if(Ext.isIE){this.el.dom.style.zoom=1}Ext.Resizable.superclass.constructor.call(this)},adjustments:[0,0],animate:false,disableTrackOver:false,draggable:false,duration:0.35,dynamic:false,easing:"easeOutStrong",enabled:true,handles:false,multiDirectional:false,height:null,width:null,heightIncrement:0,widthIncrement:0,minHeight:5,minWidth:5,maxHeight:10000,maxWidth:10000,minX:0,minY:0,pinned:false,preserveRatio:false,resizeChild:false,transparent:false,resizeTo:function(b,a){this.el.setSize(b,a);this.updateChildSize();this.fireEvent("resize",this,b,a,null)},startSizing:function(c,b){this.fireEvent("beforeresize",this,c);if(this.enabled){if(!this.overlay){this.overlay=this.el.createProxy({tag:"div",cls:"x-resizable-overlay",html:"&#160;"},Ext.getBody());this.overlay.unselectable();this.overlay.enableDisplayMode("block");this.overlay.on({scope:this,mousemove:this.onMouseMove,mouseup:this.onMouseUp})}this.overlay.setStyle("cursor",b.el.getStyle("cursor"));this.resizing=true;this.startBox=this.el.getBox();this.startPoint=c.getXY();this.offsets=[(this.startBox.x+this.startBox.width)-this.startPoint[0],(this.startBox.y+this.startBox.height)-this.startPoint[1]];this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();if(this.constrainTo){var a=Ext.get(this.constrainTo);this.resizeRegion=a.getRegion().adjust(a.getFrameWidth("t"),a.getFrameWidth("l"),-a.getFrameWidth("b"),-a.getFrameWidth("r"))}this.proxy.setStyle("visibility","hidden");this.proxy.show();this.proxy.setBox(this.startBox);if(!this.dynamic){this.proxy.setStyle("visibility","visible")}}},onMouseDown:function(a,b){if(this.enabled){b.stopEvent();this.activeHandle=a;this.startSizing(b,a)}},onMouseUp:function(b){this.activeHandle=null;var a=this.resizeElement();this.resizing=false;this.handleOut();this.overlay.hide();this.proxy.hide();this.fireEvent("resize",this,a.width,a.height,b)},updateChildSize:function(){if(this.resizeChild){var d=this.el;var e=this.resizeChild;var c=this.adjustments;if(d.dom.offsetWidth){var a=d.getSize(true);e.setSize(a.width+c[0],a.height+c[1])}if(Ext.isIE){setTimeout(function(){if(d.dom.offsetWidth){var g=d.getSize(true);e.setSize(g.width+c[0],g.height+c[1])}},10)}}},snap:function(c,e,b){if(!e||!c){return c}var d=c;var a=c%e;if(a>0){if(a>(e/2)){d=c+(e-a)}else{d=c-a}}return Math.max(b,d)},resizeElement:function(){var a=this.proxy.getBox();if(this.updateBox){this.el.setBox(a,false,this.animate,this.duration,null,this.easing)}else{this.el.setSize(a.width,a.height,this.animate,this.duration,null,this.easing)}this.updateChildSize();if(!this.dynamic){this.proxy.hide()}if(this.draggable&&this.constrainTo){this.dd.resetConstraints();this.dd.constrainTo(this.constrainTo)}return a},constrain:function(b,c,a,d){if(b-c<a){c=b-a}else{if(b-c>d){c=b-d}}return c},onMouseMove:function(A){if(this.enabled&&this.activeHandle){try{if(this.resizeRegion&&!this.resizeRegion.contains(A.getPoint())){return}var u=this.curSize||this.startBox,m=this.startBox.x,l=this.startBox.y,c=m,b=l,n=u.width,v=u.height,d=n,p=v,o=this.minWidth,B=this.minHeight,t=this.maxWidth,E=this.maxHeight,i=this.widthIncrement,a=this.heightIncrement,C=A.getXY(),s=-(this.startPoint[0]-Math.max(this.minX,C[0])),q=-(this.startPoint[1]-Math.max(this.minY,C[1])),k=this.activeHandle.position,F,g;switch(k){case"east":n+=s;n=Math.min(Math.max(o,n),t);break;case"south":v+=q;v=Math.min(Math.max(B,v),E);break;case"southeast":n+=s;v+=q;n=Math.min(Math.max(o,n),t);v=Math.min(Math.max(B,v),E);break;case"north":q=this.constrain(v,q,B,E);l+=q;v-=q;break;case"west":s=this.constrain(n,s,o,t);m+=s;n-=s;break;case"northeast":n+=s;n=Math.min(Math.max(o,n),t);q=this.constrain(v,q,B,E);l+=q;v-=q;break;case"northwest":s=this.constrain(n,s,o,t);q=this.constrain(v,q,B,E);l+=q;v-=q;m+=s;n-=s;break;case"southwest":s=this.constrain(n,s,o,t);v+=q;v=Math.min(Math.max(B,v),E);m+=s;n-=s;break}var r=this.snap(n,i,o);var D=this.snap(v,a,B);if(r!=n||D!=v){switch(k){case"northeast":l-=D-v;break;case"north":l-=D-v;break;case"southwest":m-=r-n;break;case"west":m-=r-n;break;case"northwest":m-=r-n;l-=D-v;break}n=r;v=D}if(this.preserveRatio){switch(k){case"southeast":case"east":v=p*(n/d);v=Math.min(Math.max(B,v),E);n=d*(v/p);break;case"south":n=d*(v/p);n=Math.min(Math.max(o,n),t);v=p*(n/d);break;case"northeast":n=d*(v/p);n=Math.min(Math.max(o,n),t);v=p*(n/d);break;case"north":F=n;n=d*(v/p);n=Math.min(Math.max(o,n),t);v=p*(n/d);m+=(F-n)/2;break;case"southwest":v=p*(n/d);v=Math.min(Math.max(B,v),E);F=n;n=d*(v/p);m+=F-n;break;case"west":g=v;v=p*(n/d);v=Math.min(Math.max(B,v),E);l+=(g-v)/2;F=n;n=d*(v/p);m+=F-n;break;case"northwest":F=n;g=v;v=p*(n/d);v=Math.min(Math.max(B,v),E);n=d*(v/p);l+=g-v;m+=F-n;break}}this.proxy.setBounds(m,l,n,v);if(this.dynamic){this.resizeElement()}}catch(z){}}},handleOver:function(){if(this.enabled){this.el.addClass("x-resizable-over")}},handleOut:function(){if(!this.resizing){this.el.removeClass("x-resizable-over")}},getEl:function(){return this.el},getResizeChild:function(){return this.resizeChild},destroy:function(b){Ext.destroy(this.dd,this.overlay,this.proxy);this.overlay=null;this.proxy=null;var c=Ext.Resizable.positions;for(var a in c){if(typeof c[a]!="function"&&this[c[a]]){this[c[a]].destroy()}}if(b){this.el.update("");Ext.destroy(this.el);this.el=null}this.purgeListeners()},syncHandleHeight:function(){var a=this.el.getHeight(true);if(this.west){this.west.el.setHeight(a)}if(this.east){this.east.el.setHeight(a)}}});Ext.Resizable.positions={n:"north",s:"south",e:"east",w:"west",se:"southeast",sw:"southwest",nw:"northwest",ne:"northeast"};Ext.Resizable.Handle=Ext.extend(Object,{constructor:function(d,g,c,e,a){if(!this.tpl){var b=Ext.DomHelper.createTemplate({tag:"div",cls:"x-resizable-handle x-resizable-handle-{0}"});b.compile();Ext.Resizable.Handle.prototype.tpl=b}this.position=g;this.rz=d;this.el=this.tpl.append(d.el.dom,[this.position],true);this.el.unselectable();if(e){this.el.setOpacity(0)}if(!Ext.isEmpty(a)){this.el.addClass(a)}this.el.on("mousedown",this.onMouseDown,this);if(!c){this.el.on({scope:this,mouseover:this.onMouseOver,mouseout:this.onMouseOut})}},afterResize:function(a){},onMouseDown:function(a){this.rz.onMouseDown(this,a)},onMouseOver:function(a){this.rz.handleOver(this,a)},onMouseOut:function(a){this.rz.handleOut(this,a)},destroy:function(){Ext.destroy(this.el);this.el=null}});Ext.Window=Ext.extend(Ext.Panel,{baseCls:"x-window",resizable:true,draggable:true,closable:true,closeAction:"close",constrain:false,constrainHeader:false,plain:false,minimizable:false,maximizable:false,minHeight:100,minWidth:200,expandOnShow:true,showAnimDuration:0.25,hideAnimDuration:0.25,collapsible:false,initHidden:undefined,hidden:true,elements:"header,body",frame:true,floating:true,initComponent:function(){this.initTools();Ext.Window.superclass.initComponent.call(this);this.addEvents("resize","maximize","minimize","restore");if(Ext.isDefined(this.initHidden)){this.hidden=this.initHidden}if(this.hidden===false){this.hidden=true;this.show()}},getState:function(){return Ext.apply(Ext.Window.superclass.getState.call(this)||{},this.getBox(true))},onRender:function(b,a){Ext.Window.superclass.onRender.call(this,b,a);if(this.plain){this.el.addClass("x-window-plain")}this.focusEl=this.el.createChild({tag:"a",href:"#",cls:"x-dlg-focus",tabIndex:"-1",html:"&#160;"});this.focusEl.swallowEvent("click",true);this.proxy=this.el.createProxy("x-window-proxy");this.proxy.enableDisplayMode("block");if(this.modal){this.mask=this.container.createChild({cls:"ext-el-mask"},this.el.dom);this.mask.enableDisplayMode("block");this.mask.hide();this.mon(this.mask,"click",this.focus,this)}if(this.maximizable){this.mon(this.header,"dblclick",this.toggleMaximize,this)}},initEvents:function(){Ext.Window.superclass.initEvents.call(this);if(this.animateTarget){this.setAnimateTarget(this.animateTarget)}if(this.resizable){this.resizer=new Ext.Resizable(this.el,{minWidth:this.minWidth,minHeight:this.minHeight,handles:this.resizeHandles||"all",pinned:true,resizeElement:this.resizerAction,handleCls:"x-window-handle"});this.resizer.window=this;this.mon(this.resizer,"beforeresize",this.beforeResize,this)}if(this.draggable){this.header.addClass("x-window-draggable")}this.mon(this.el,"mousedown",this.toFront,this);this.manager=this.manager||Ext.WindowMgr;this.manager.register(this);if(this.maximized){this.maximized=false;this.maximize()}if(this.closable){var a=this.getKeyMap();a.on(27,this.onEsc,this);a.disable()}},initDraggable:function(){this.dd=new Ext.Window.DD(this)},onEsc:function(a,b){b.stopEvent();this[this.closeAction]()},beforeDestroy:function(){if(this.rendered){this.hide();this.clearAnchor();Ext.destroy(this.focusEl,this.resizer,this.dd,this.proxy,this.mask)}Ext.Window.superclass.beforeDestroy.call(this)},onDestroy:function(){if(this.manager){this.manager.unregister(this)}Ext.Window.superclass.onDestroy.call(this)},initTools:function(){if(this.minimizable){this.addTool({id:"minimize",handler:this.minimize.createDelegate(this,[])})}if(this.maximizable){this.addTool({id:"maximize",handler:this.maximize.createDelegate(this,[])});this.addTool({id:"restore",handler:this.restore.createDelegate(this,[]),hidden:true})}if(this.closable){this.addTool({id:"close",handler:this[this.closeAction].createDelegate(this,[])})}},resizerAction:function(){var a=this.proxy.getBox();this.proxy.hide();this.window.handleResize(a);return a},beforeResize:function(){this.resizer.minHeight=Math.max(this.minHeight,this.getFrameHeight()+40);this.resizer.minWidth=Math.max(this.minWidth,this.getFrameWidth()+40);this.resizeBox=this.el.getBox()},updateHandles:function(){if(Ext.isIE&&this.resizer){this.resizer.syncHandleHeight();this.el.repaint()}},handleResize:function(b){var a=this.resizeBox;if(a.x!=b.x||a.y!=b.y){this.updateBox(b)}else{this.setSize(b);if(Ext.isIE6&&Ext.isStrict){this.doLayout()}}this.focus();this.updateHandles();this.saveState()},focus:function(){var e=this.focusEl,a=this.defaultButton,c=typeof a,d,b;if(Ext.isDefined(a)){if(Ext.isNumber(a)&&this.fbar){e=this.fbar.items.get(a)}else{if(Ext.isString(a)){e=Ext.getCmp(a)}else{e=a}}d=e.getEl();b=Ext.getDom(this.container);if(d&&b){if(b!=document.body&&!Ext.lib.Region.getRegion(b).contains(Ext.lib.Region.getRegion(d.dom))){return}}}e=e||this.focusEl;e.focus.defer(10,e)},setAnimateTarget:function(a){a=Ext.get(a);this.animateTarget=a},beforeShow:function(){delete this.el.lastXY;delete this.el.lastLT;if(this.x===undefined||this.y===undefined){var a=this.el.getAlignToXY(this.container,"c-c");var b=this.el.translatePoints(a[0],a[1]);this.x=this.x===undefined?b.left:this.x;this.y=this.y===undefined?b.top:this.y}this.el.setLeftTop(this.x,this.y);if(this.expandOnShow){this.expand(false)}if(this.modal){Ext.getBody().addClass("x-body-masked");this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.mask.show()}},show:function(c,a,b){if(!this.rendered){this.render(Ext.getBody())}if(this.hidden===false){this.toFront();return this}if(this.fireEvent("beforeshow",this)===false){return this}if(a){this.on("show",a,b,{single:true})}this.hidden=false;if(Ext.isDefined(c)){this.setAnimateTarget(c)}this.beforeShow();if(this.animateTarget){this.animShow()}else{this.afterShow()}return this},afterShow:function(b){if(this.isDestroyed){return false}this.proxy.hide();this.el.setStyle("display","block");this.el.show();if(this.maximized){this.fitContainer()}if(Ext.isMac&&Ext.isGecko2){this.cascade(this.setAutoScroll)}if(this.monitorResize||this.modal||this.constrain||this.constrainHeader){Ext.EventManager.onWindowResize(this.onWindowResize,this)}this.doConstrain();this.doLayout();if(this.keyMap){this.keyMap.enable()}this.toFront();this.updateHandles();if(b&&(Ext.isIE||Ext.isWebKit)){var a=this.getSize();this.onResize(a.width,a.height)}this.onShow();this.fireEvent("show",this)},animShow:function(){this.proxy.show();this.proxy.setBox(this.animateTarget.getBox());this.proxy.setOpacity(0);var a=this.getBox();this.el.setStyle("display","none");this.proxy.shift(Ext.apply(a,{callback:this.afterShow.createDelegate(this,[true],false),scope:this,easing:"easeNone",duration:this.showAnimDuration,opacity:0.5}))},hide:function(c,a,b){if(this.hidden||this.fireEvent("beforehide",this)===false){return this}if(a){this.on("hide",a,b,{single:true})}this.hidden=true;if(c!==undefined){this.setAnimateTarget(c)}if(this.modal){this.mask.hide();Ext.getBody().removeClass("x-body-masked")}if(this.animateTarget){this.animHide()}else{this.el.hide();this.afterHide()}return this},afterHide:function(){this.proxy.hide();if(this.monitorResize||this.modal||this.constrain||this.constrainHeader){Ext.EventManager.removeResizeListener(this.onWindowResize,this)}if(this.keyMap){this.keyMap.disable()}this.onHide();this.fireEvent("hide",this)},animHide:function(){this.proxy.setOpacity(0.5);this.proxy.show();var a=this.getBox(false);this.proxy.setBox(a);this.el.hide();this.proxy.shift(Ext.apply(this.animateTarget.getBox(),{callback:this.afterHide,scope:this,duration:this.hideAnimDuration,easing:"easeNone",opacity:0}))},onShow:Ext.emptyFn,onHide:Ext.emptyFn,onWindowResize:function(){if(this.maximized){this.fitContainer()}if(this.modal){this.mask.setSize("100%","100%");var a=this.mask.dom.offsetHeight;this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true))}this.doConstrain()},doConstrain:function(){if(this.constrain||this.constrainHeader){var b;if(this.constrain){b={right:this.el.shadowOffset,left:this.el.shadowOffset,bottom:this.el.shadowOffset}}else{var a=this.getSize();b={right:-(a.width-100),bottom:-(a.height-25)}}var c=this.el.getConstrainToXY(this.container,true,b);if(c){this.setPosition(c[0],c[1])}}},ghost:function(a){var c=this.createGhost(a);var b=this.getBox(true);c.setLeftTop(b.x,b.y);c.setWidth(b.width);this.el.hide();this.activeGhost=c;return c},unghost:function(b,a){if(!this.activeGhost){return}if(b!==false){this.el.show();this.focus.defer(10,this);if(Ext.isMac&&Ext.isGecko2){this.cascade(this.setAutoScroll)}}if(a!==false){this.setPosition(this.activeGhost.getLeft(true),this.activeGhost.getTop(true))}this.activeGhost.hide();this.activeGhost.remove();delete this.activeGhost},minimize:function(){this.fireEvent("minimize",this);return this},close:function(){if(this.fireEvent("beforeclose",this)!==false){if(this.hidden){this.doClose()}else{this.hide(null,this.doClose,this)}}},doClose:function(){this.fireEvent("close",this);this.destroy()},maximize:function(){if(!this.maximized){this.expand(false);this.restoreSize=this.getSize();this.restorePos=this.getPosition(true);if(this.maximizable){this.tools.maximize.hide();this.tools.restore.show()}this.maximized=true;this.el.disableShadow();if(this.dd){this.dd.lock()}if(this.collapsible){this.tools.toggle.hide()}this.el.addClass("x-window-maximized");this.container.addClass("x-window-maximized-ct");this.setPosition(0,0);this.fitContainer();this.fireEvent("maximize",this)}return this},restore:function(){if(this.maximized){var a=this.tools;this.el.removeClass("x-window-maximized");if(a.restore){a.restore.hide()}if(a.maximize){a.maximize.show()}this.setPosition(this.restorePos[0],this.restorePos[1]);this.setSize(this.restoreSize.width,this.restoreSize.height);delete this.restorePos;delete this.restoreSize;this.maximized=false;this.el.enableShadow(true);if(this.dd){this.dd.unlock()}if(this.collapsible&&a.toggle){a.toggle.show()}this.container.removeClass("x-window-maximized-ct");this.doConstrain();this.fireEvent("restore",this)}return this},toggleMaximize:function(){return this[this.maximized?"restore":"maximize"]()},fitContainer:function(){var a=this.container.getViewSize(false);this.setSize(a.width,a.height)},setZIndex:function(a){if(this.modal){this.mask.setStyle("z-index",a)}this.el.setZIndex(++a);a+=5;if(this.resizer){this.resizer.proxy.setStyle("z-index",++a)}this.lastZIndex=a},alignTo:function(b,a,c){var d=this.el.getAlignToXY(b,a,c);this.setPagePosition(d[0],d[1]);return this},anchorTo:function(c,e,d,b){this.clearAnchor();this.anchorTarget={el:c,alignment:e,offsets:d};Ext.EventManager.onWindowResize(this.doAnchor,this);var a=typeof b;if(a!="undefined"){Ext.EventManager.on(window,"scroll",this.doAnchor,this,{buffer:a=="number"?b:50})}return this.doAnchor()},doAnchor:function(){var a=this.anchorTarget;this.alignTo(a.el,a.alignment,a.offsets);return this},clearAnchor:function(){if(this.anchorTarget){Ext.EventManager.removeResizeListener(this.doAnchor,this);Ext.EventManager.un(window,"scroll",this.doAnchor,this);delete this.anchorTarget}return this},toFront:function(a){if(this.manager.bringToFront(this)){if(!a||!a.getTarget().focus){this.focus()}}return this},setActive:function(a){if(a){if(!this.maximized){this.el.enableShadow(true)}this.fireEvent("activate",this)}else{this.el.disableShadow();this.fireEvent("deactivate",this)}},toBack:function(){this.manager.sendToBack(this);return this},center:function(){var a=this.el.getAlignToXY(this.container,"c-c");this.setPagePosition(a[0],a[1]);return this}});Ext.reg("window",Ext.Window);Ext.Window.DD=Ext.extend(Ext.dd.DD,{constructor:function(a){this.win=a;Ext.Window.DD.superclass.constructor.call(this,a.el.id,"WindowDD-"+a.id);this.setHandleElId(a.header.id);this.scroll=false},moveOnly:true,headerOffsets:[100,25],startDrag:function(){var a=this.win;this.proxy=a.ghost(a.initialConfig.cls);if(a.constrain!==false){var c=a.el.shadowOffset;this.constrainTo(a.container,{right:c,left:c,bottom:c})}else{if(a.constrainHeader!==false){var b=this.proxy.getSize();this.constrainTo(a.container,{right:-(b.width-this.headerOffsets[0]),bottom:-(b.height-this.headerOffsets[1])})}}},b4Drag:Ext.emptyFn,onDrag:function(a){this.alignElWithMouse(this.proxy,a.getPageX(),a.getPageY())},endDrag:function(a){this.win.unghost();this.win.saveState()}});Ext.WindowGroup=function(){var g={};var d=[];var e=null;var c=function(k,i){return(!k._lastAccess||k._lastAccess<i._lastAccess)?-1:1};var h=function(){var m=d,k=m.length;if(k>0){m.sort(c);var l=m[0].manager.zseed;for(var n=0;n<k;n++){var o=m[n];if(o&&!o.hidden){o.setZIndex(l+(n*10))}}}a()};var b=function(i){if(i!=e){if(e){e.setActive(false)}e=i;if(i){i.setActive(true)}}};var a=function(){for(var k=d.length-1;k>=0;--k){if(!d[k].hidden){b(d[k]);return}}b(null)};return{zseed:9000,register:function(i){if(i.manager){i.manager.unregister(i)}i.manager=this;g[i.id]=i;d.push(i);i.on("hide",a)},unregister:function(i){delete i.manager;delete g[i.id];i.un("hide",a);d.remove(i)},get:function(i){return typeof i=="object"?i:g[i]},bringToFront:function(i){i=this.get(i);if(i!=e){i._lastAccess=new Date().getTime();h();return true}return false},sendToBack:function(i){i=this.get(i);i._lastAccess=-(new Date().getTime());h();return i},hideAll:function(){for(var i in g){if(g[i]&&typeof g[i]!="function"&&g[i].isVisible()){g[i].hide()}}},getActive:function(){return e},getBy:function(m,l){var n=[];for(var k=d.length-1;k>=0;--k){var o=d[k];if(m.call(l||o,o)!==false){n.push(o)}}return n},each:function(k,i){for(var l in g){if(g[l]&&typeof g[l]!="function"){if(k.call(i||g[l],g[l])===false){return}}}}}};Ext.WindowMgr=new Ext.WindowGroup();Ext.MessageBox=function(){var v,b,r,u,h,m,t,a,o,q,k,g,s,w,p,i="",d="",n=["ok","yes","no","cancel"];var c=function(y){s[y].blur();if(v.isVisible()){v.hide();x();Ext.callback(b.fn,b.scope||window,[y,w.dom.value,b],1)}};var x=function(){if(b&&b.cls){v.el.removeClass(b.cls)}o.reset()};var e=function(A,y,z){if(b&&b.closable!==false){v.hide();x()}if(z){z.stopEvent()}};var l=function(y){var A=0,z;if(!y){Ext.each(n,function(B){s[B].hide()});return A}v.footer.dom.style.display="";Ext.iterate(s,function(B,C){z=y[B];if(z){C.show();C.setText(Ext.isString(z)?z:Ext.MessageBox.buttonText[B]);A+=C.getEl().getWidth()+15}else{C.hide()}});return A};return{getDialog:function(y){if(!v){var A=[];s={};Ext.each(n,function(B){A.push(s[B]=new Ext.Button({text:this.buttonText[B],handler:c.createCallback(B),hideMode:"offsets"}))},this);v=new Ext.Window({autoCreate:true,title:y,resizable:false,constrain:true,constrainHeader:true,minimizable:false,maximizable:false,stateful:false,modal:true,shim:true,buttonAlign:"center",width:400,height:100,minHeight:80,plain:true,footer:true,closable:true,close:function(){if(b&&b.buttons&&b.buttons.no&&!b.buttons.cancel){c("no")}else{c("cancel")}},fbar:new Ext.Toolbar({items:A,enableOverflow:false})});v.render(document.body);v.getEl().addClass("x-window-dlg");r=v.mask;h=v.body.createChild({html:'<div class="ext-mb-icon"></div><div class="ext-mb-content"><span class="ext-mb-text"></span><br /><div class="ext-mb-fix-cursor"><input type="text" class="ext-mb-input" /><textarea class="ext-mb-textarea"></textarea></div></div>'});k=Ext.get(h.dom.firstChild);var z=h.dom.childNodes[1];m=Ext.get(z.firstChild);t=Ext.get(z.childNodes[2].firstChild);t.enableDisplayMode();t.addKeyListener([10,13],function(){if(v.isVisible()&&b&&b.buttons){if(b.buttons.ok){c("ok")}else{if(b.buttons.yes){c("yes")}}}});a=Ext.get(z.childNodes[2].childNodes[1]);a.enableDisplayMode();o=new Ext.ProgressBar({renderTo:h});h.createChild({cls:"x-clear"})}return v},updateText:function(B){if(!v.isVisible()&&!b.width){v.setSize(this.maxWidth,100)}m.update(B?B+" ":"&#160;");var z=d!=""?(k.getWidth()+k.getMargins("lr")):0,D=m.getWidth()+m.getMargins("lr"),A=v.getFrameWidth("lr"),C=v.body.getFrameWidth("lr"),y;y=Math.max(Math.min(b.width||z+D+A+C,b.maxWidth||this.maxWidth),Math.max(b.minWidth||this.minWidth,p||0));if(b.prompt===true){w.setWidth(y-z-A-C)}if(b.progress===true||b.wait===true){o.setSize(y-z-A-C)}if(Ext.isIE&&y==p){y+=4}m.update(B||"&#160;");v.setSize(y,"auto").center();return this},updateProgress:function(z,y,A){o.updateProgress(z,y);if(A){this.updateText(A)}return this},isVisible:function(){return v&&v.isVisible()},hide:function(){var y=v?v.activeGhost:null;if(this.isVisible()||y){v.hide();x();if(y){v.unghost(false,false)}}return this},show:function(B){if(this.isVisible()){this.hide()}b=B;var C=this.getDialog(b.title||"&#160;");C.setTitle(b.title||"&#160;");var y=(b.closable!==false&&b.progress!==true&&b.wait!==true);C.tools.close.setDisplayed(y);w=t;b.prompt=b.prompt||(b.multiline?true:false);if(b.prompt){if(b.multiline){t.hide();a.show();a.setHeight(Ext.isNumber(b.multiline)?b.multiline:this.defaultTextHeight);w=a}else{t.show();a.hide()}}else{t.hide();a.hide()}w.dom.value=b.value||"";if(b.prompt){C.focusEl=w}else{var A=b.buttons;var z=null;if(A&&A.ok){z=s.ok}else{if(A&&A.yes){z=s.yes}}if(z){C.focusEl=z}}if(Ext.isDefined(b.iconCls)){C.setIconClass(b.iconCls)}this.setIcon(Ext.isDefined(b.icon)?b.icon:i);p=l(b.buttons);o.setVisible(b.progress===true||b.wait===true);this.updateProgress(0,b.progressText);this.updateText(b.msg);if(b.cls){C.el.addClass(b.cls)}C.proxyDrag=b.proxyDrag===true;C.modal=b.modal!==false;C.mask=b.modal!==false?r:false;if(!C.isVisible()){document.body.appendChild(v.el.dom);C.setAnimateTarget(b.animEl);C.on("show",function(){if(y===true){C.keyMap.enable()}else{C.keyMap.disable()}},this,{single:true});C.show(b.animEl)}if(b.wait===true){o.wait(b.waitConfig)}return this},setIcon:function(y){if(!v){i=y;return}i=undefined;if(y&&y!=""){k.removeClass("x-hidden");k.replaceClass(d,y);h.addClass("x-dlg-icon");d=y}else{k.replaceClass(d,"x-hidden");h.removeClass("x-dlg-icon");d=""}return this},progress:function(A,z,y){this.show({title:A,msg:z,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth,progressText:y});return this},wait:function(A,z,y){this.show({title:z,msg:A,buttons:false,closable:false,wait:true,modal:true,minWidth:this.minProgressWidth,waitConfig:y});return this},alert:function(B,A,z,y){this.show({title:B,msg:A,buttons:this.OK,fn:z,scope:y,minWidth:this.minWidth});return this},confirm:function(B,A,z,y){this.show({title:B,msg:A,buttons:this.YESNO,fn:z,scope:y,icon:this.QUESTION,minWidth:this.minWidth});return this},prompt:function(D,C,A,z,y,B){this.show({title:D,msg:C,buttons:this.OKCANCEL,fn:A,minWidth:this.minPromptWidth,scope:z,prompt:true,multiline:y,value:B});return this},OK:{ok:true},CANCEL:{cancel:true},OKCANCEL:{ok:true,cancel:true},YESNO:{yes:true,no:true},YESNOCANCEL:{yes:true,no:true,cancel:true},INFO:"ext-mb-info",WARNING:"ext-mb-warning",QUESTION:"ext-mb-question",ERROR:"ext-mb-error",defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,minPromptWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}}}();Ext.Msg=Ext.MessageBox;Ext.dd.PanelProxy=Ext.extend(Object,{constructor:function(a,b){this.panel=a;this.id=this.panel.id+"-ddproxy";Ext.apply(this,b)},insertProxy:true,setStatus:Ext.emptyFn,reset:Ext.emptyFn,update:Ext.emptyFn,stop:Ext.emptyFn,sync:Ext.emptyFn,getEl:function(){return this.ghost},getGhost:function(){return this.ghost},getProxy:function(){return this.proxy},hide:function(){if(this.ghost){if(this.proxy){this.proxy.remove();delete this.proxy}this.panel.el.dom.style.display="";this.ghost.remove();delete this.ghost}},show:function(){if(!this.ghost){this.ghost=this.panel.createGhost(this.panel.initialConfig.cls,undefined,Ext.getBody());this.ghost.setXY(this.panel.el.getXY());if(this.insertProxy){this.proxy=this.panel.el.insertSibling({cls:"x-panel-dd-spacer"});this.proxy.setSize(this.panel.getSize())}this.panel.el.dom.style.display="none"}},repair:function(b,c,a){this.hide();if(typeof c=="function"){c.call(a||this)}},moveProxy:function(a,b){if(this.proxy){a.insertBefore(this.proxy.dom,b)}}});Ext.Panel.DD=Ext.extend(Ext.dd.DragSource,{constructor:function(b,a){this.panel=b;this.dragData={panel:b};this.proxy=new Ext.dd.PanelProxy(b,a);Ext.Panel.DD.superclass.constructor.call(this,b.el,a);var d=b.header,c=b.body;if(d){this.setHandleElId(d.id);c=b.header}c.setStyle("cursor","move");this.scroll=false},showFrame:Ext.emptyFn,startDrag:Ext.emptyFn,b4StartDrag:function(a,b){this.proxy.show()},b4MouseDown:function(b){var a=b.getPageX(),c=b.getPageY();this.autoOffset(a,c)},onInitDrag:function(a,b){this.onStartDrag(a,b);return true},createFrame:Ext.emptyFn,getDragEl:function(a){return this.proxy.ghost.dom},endDrag:function(a){this.proxy.hide();this.panel.saveState()},autoOffset:function(a,b){a-=this.startPageX;b-=this.startPageY;this.setDelta(a,b)}});Ext.state.Provider=Ext.extend(Ext.util.Observable,{constructor:function(){this.addEvents("statechange");this.state={};Ext.state.Provider.superclass.constructor.call(this)},get:function(b,a){return typeof this.state[b]=="undefined"?a:this.state[b]},clear:function(a){delete this.state[a];this.fireEvent("statechange",this,a,null)},set:function(a,b){this.state[a]=b;this.fireEvent("statechange",this,a,b)},decodeValue:function(b){var e=/^(a|n|d|b|s|o|e)\:(.*)$/,h=e.exec(unescape(b)),d,c,a,g;if(!h||!h[1]){return}c=h[1];a=h[2];switch(c){case"e":return null;case"n":return parseFloat(a);case"d":return new Date(Date.parse(a));case"b":return(a=="1");case"a":d=[];if(a!=""){Ext.each(a.split("^"),function(i){d.push(this.decodeValue(i))},this)}return d;case"o":d={};if(a!=""){Ext.each(a.split("^"),function(i){g=i.split("=");d[g[0]]=this.decodeValue(g[1])},this)}return d;default:return a}},encodeValue:function(c){var b,g="",e=0,a,d;if(c==null){return"e:1"}else{if(typeof c=="number"){b="n:"+c}else{if(typeof c=="boolean"){b="b:"+(c?"1":"0")}else{if(Ext.isDate(c)){b="d:"+c.toGMTString()}else{if(Ext.isArray(c)){for(a=c.length;e<a;e++){g+=this.encodeValue(c[e]);if(e!=a-1){g+="^"}}b="a:"+g}else{if(typeof c=="object"){for(d in c){if(typeof c[d]!="function"&&c[d]!==undefined){g+=d+"="+this.encodeValue(c[d])+"^"}}b="o:"+g.substring(0,g.length-1)}else{b="s:"+c}}}}}}return escape(b)}});Ext.state.Manager=function(){var a=new Ext.state.Provider();return{setProvider:function(b){a=b},get:function(c,b){return a.get(c,b)},set:function(b,c){a.set(b,c)},clear:function(b){a.clear(b)},getProvider:function(){return a}}}();Ext.state.CookieProvider=Ext.extend(Ext.state.Provider,{constructor:function(a){Ext.state.CookieProvider.superclass.constructor.call(this);this.path="/";this.expires=new Date(new Date().getTime()+(1000*60*60*24*7));this.domain=null;this.secure=false;Ext.apply(this,a);this.state=this.readCookies()},set:function(a,b){if(typeof b=="undefined"||b===null){this.clear(a);return}this.setCookie(a,b);Ext.state.CookieProvider.superclass.set.call(this,a,b)},clear:function(a){this.clearCookie(a);Ext.state.CookieProvider.superclass.clear.call(this,a)},readCookies:function(){var d={},h=document.cookie+";",b=/\s?(.*?)=(.*?);/g,g,a,e;while((g=b.exec(h))!=null){a=g[1];e=g[2];if(a&&a.substring(0,3)=="ys-"){d[a.substr(3)]=this.decodeValue(e)}}return d},setCookie:function(a,b){document.cookie="ys-"+a+"="+this.encodeValue(b)+((this.expires==null)?"":("; expires="+this.expires.toGMTString()))+((this.path==null)?"":("; path="+this.path))+((this.domain==null)?"":("; domain="+this.domain))+((this.secure==true)?"; secure":"")},clearCookie:function(a){document.cookie="ys-"+a+"=null; expires=Thu, 01-Jan-70 00:00:01 GMT"+((this.path==null)?"":("; path="+this.path))+((this.domain==null)?"":("; domain="+this.domain))+((this.secure==true)?"; secure":"")}});Ext.DataView=Ext.extend(Ext.BoxComponent,{selectedClass:"x-view-selected",emptyText:"",deferEmptyText:true,trackOver:false,blockRefresh:false,last:false,initComponent:function(){Ext.DataView.superclass.initComponent.call(this);if(Ext.isString(this.tpl)||Ext.isArray(this.tpl)){this.tpl=new Ext.XTemplate(this.tpl)}this.addEvents("beforeclick","click","mouseenter","mouseleave","containerclick","dblclick","contextmenu","containercontextmenu","selectionchange","beforeselect");this.store=Ext.StoreMgr.lookup(this.store);this.all=new Ext.CompositeElementLite();this.selected=new Ext.CompositeElementLite()},afterRender:function(){Ext.DataView.superclass.afterRender.call(this);this.mon(this.getTemplateTarget(),{click:this.onClick,dblclick:this.onDblClick,contextmenu:this.onContextMenu,scope:this});if(this.overClass||this.trackOver){this.mon(this.getTemplateTarget(),{mouseover:this.onMouseOver,mouseout:this.onMouseOut,scope:this})}if(this.store){this.bindStore(this.store,true)}},refresh:function(){this.clearSelections(false,true);var b=this.getTemplateTarget(),a=this.store.getRange();b.update("");if(a.length<1){if(!this.deferEmptyText||this.hasSkippedEmptyText){b.update(this.emptyText)}this.all.clear()}else{this.tpl.overwrite(b,this.collectData(a,0));this.all.fill(Ext.query(this.itemSelector,b.dom));this.updateIndexes(0)}this.hasSkippedEmptyText=true},getTemplateTarget:function(){return this.el},prepareData:function(a){return a},collectData:function(b,e){var d=[],c=0,a=b.length;for(;c<a;c++){d[d.length]=this.prepareData(b[c].data,e+c,b[c])}return d},bufferRender:function(a,b){var c=document.createElement("div");this.tpl.overwrite(c,this.collectData(a,b));return Ext.query(this.itemSelector,c)},onUpdate:function(g,a){var b=this.store.indexOf(a);if(b>-1){var e=this.isSelected(b),c=this.all.elements[b],d=this.bufferRender([a],b)[0];this.all.replaceElement(b,d,true);if(e){this.selected.replaceElement(c,d);this.all.item(b).addClass(this.selectedClass)}this.updateIndexes(b,b)}},onAdd:function(g,d,e){if(this.all.getCount()===0){this.refresh();return}var c=this.bufferRender(d,e),h,b=this.all.elements;if(e<this.all.getCount()){h=this.all.item(e).insertSibling(c,"before",true);b.splice.apply(b,[e,0].concat(c))}else{h=this.all.last().insertSibling(c,"after",true);b.push.apply(b,c)}this.updateIndexes(e)},onRemove:function(c,a,b){this.deselect(b);this.all.removeElement(b,true);this.updateIndexes(b);if(this.store.getCount()===0){this.refresh()}},refreshNode:function(a){this.onUpdate(this.store,this.store.getAt(a))},updateIndexes:function(d,c){var b=this.all.elements;d=d||0;c=c||((c===0)?0:(b.length-1));for(var a=d;a<=c;a++){b[a].viewIndex=a}},getStore:function(){return this.store},bindStore:function(a,b){if(!b&&this.store){if(a!==this.store&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("datachanged",this.onDataChanged,this);this.store.un("add",this.onAdd,this);this.store.un("remove",this.onRemove,this);this.store.un("update",this.onUpdate,this);this.store.un("clear",this.refresh,this)}if(!a){this.store=null}}if(a){a=Ext.StoreMgr.lookup(a);a.on({scope:this,beforeload:this.onBeforeLoad,datachanged:this.onDataChanged,add:this.onAdd,remove:this.onRemove,update:this.onUpdate,clear:this.refresh})}this.store=a;if(a){this.refresh()}},onDataChanged:function(){if(this.blockRefresh!==true){this.refresh.apply(this,arguments)}},findItemFromChild:function(a){return Ext.fly(a).findParent(this.itemSelector,this.getTemplateTarget())},onClick:function(c){var b=c.getTarget(this.itemSelector,this.getTemplateTarget()),a;if(b){a=this.indexOf(b);if(this.onItemClick(b,a,c)!==false){this.fireEvent("click",this,a,b,c)}}else{if(this.fireEvent("containerclick",this,c)!==false){this.onContainerClick(c)}}},onContainerClick:function(a){this.clearSelections()},onContextMenu:function(b){var a=b.getTarget(this.itemSelector,this.getTemplateTarget());if(a){this.fireEvent("contextmenu",this,this.indexOf(a),a,b)}else{this.fireEvent("containercontextmenu",this,b)}},onDblClick:function(b){var a=b.getTarget(this.itemSelector,this.getTemplateTarget());if(a){this.fireEvent("dblclick",this,this.indexOf(a),a,b)}},onMouseOver:function(b){var a=b.getTarget(this.itemSelector,this.getTemplateTarget());if(a&&a!==this.lastItem){this.lastItem=a;Ext.fly(a).addClass(this.overClass);this.fireEvent("mouseenter",this,this.indexOf(a),a,b)}},onMouseOut:function(a){if(this.lastItem){if(!a.within(this.lastItem,true,true)){Ext.fly(this.lastItem).removeClass(this.overClass);this.fireEvent("mouseleave",this,this.indexOf(this.lastItem),this.lastItem,a);delete this.lastItem}}},onItemClick:function(b,a,c){if(this.fireEvent("beforeclick",this,a,b,c)===false){return false}if(this.multiSelect){this.doMultiSelection(b,a,c);c.preventDefault()}else{if(this.singleSelect){this.doSingleSelection(b,a,c);c.preventDefault()}}return true},doSingleSelection:function(b,a,c){if(c.ctrlKey&&this.isSelected(a)){this.deselect(a)}else{this.select(a,false)}},doMultiSelection:function(c,a,d){if(d.shiftKey&&this.last!==false){var b=this.last;this.selectRange(b,a,d.ctrlKey);this.last=b}else{if((d.ctrlKey||this.simpleSelect)&&this.isSelected(a)){this.deselect(a)}else{this.select(a,d.ctrlKey||d.shiftKey||this.simpleSelect)}}},getSelectionCount:function(){return this.selected.getCount()},getSelectedNodes:function(){return this.selected.elements},getSelectedIndexes:function(){var b=[],d=this.selected.elements,c=0,a=d.length;for(;c<a;c++){b.push(d[c].viewIndex)}return b},getSelectedRecords:function(){return this.getRecords(this.selected.elements)},getRecords:function(c){var b=[],d=0,a=c.length;for(;d<a;d++){b[b.length]=this.store.getAt(c[d].viewIndex)}return b},getRecord:function(a){return this.store.getAt(a.viewIndex)},clearSelections:function(a,b){if((this.multiSelect||this.singleSelect)&&this.selected.getCount()>0){if(!b){this.selected.removeClass(this.selectedClass)}this.selected.clear();this.last=false;if(!a){this.fireEvent("selectionchange",this,this.selected.elements)}}},isSelected:function(a){return this.selected.contains(this.getNode(a))},deselect:function(a){if(this.isSelected(a)){a=this.getNode(a);this.selected.removeElement(a);if(this.last==a.viewIndex){this.last=false}Ext.fly(a).removeClass(this.selectedClass);this.fireEvent("selectionchange",this,this.selected.elements)}},select:function(d,g,b){if(Ext.isArray(d)){if(!g){this.clearSelections(true)}for(var c=0,a=d.length;c<a;c++){this.select(d[c],true,true)}if(!b){this.fireEvent("selectionchange",this,this.selected.elements)}}else{var e=this.getNode(d);if(!g){this.clearSelections(true)}if(e&&!this.isSelected(e)){if(this.fireEvent("beforeselect",this,e,this.selected.elements)!==false){Ext.fly(e).addClass(this.selectedClass);this.selected.add(e);this.last=e.viewIndex;if(!b){this.fireEvent("selectionchange",this,this.selected.elements)}}}}},selectRange:function(c,a,b){if(!b){this.clearSelections(true)}this.select(this.getNodes(c,a),true)},getNode:function(b){if(Ext.isString(b)){return document.getElementById(b)}else{if(Ext.isNumber(b)){return this.all.elements[b]}else{if(b instanceof Ext.data.Record){var a=this.store.indexOf(b);return this.all.elements[a]}}}return b},getNodes:function(e,a){var d=this.all.elements,b=[],c;e=e||0;a=!Ext.isDefined(a)?Math.max(d.length-1,0):a;if(e<=a){for(c=e;c<=a&&d[c];c++){b.push(d[c])}}else{for(c=e;c>=a&&d[c];c--){b.push(d[c])}}return b},indexOf:function(a){a=this.getNode(a);if(Ext.isNumber(a.viewIndex)){return a.viewIndex}return this.all.indexOf(a)},onBeforeLoad:function(){if(this.loadingText){this.clearSelections(false,true);this.getTemplateTarget().update('<div class="loading-indicator">'+this.loadingText+"</div>");this.all.clear()}},onDestroy:function(){this.all.clear();this.selected.clear();Ext.DataView.superclass.onDestroy.call(this);this.bindStore(null)}});Ext.DataView.prototype.setStore=Ext.DataView.prototype.bindStore;Ext.reg("dataview",Ext.DataView);Ext.list.ListView=Ext.extend(Ext.DataView,{itemSelector:"dl",selectedClass:"x-list-selected",overClass:"x-list-over",scrollOffset:undefined,columnResize:true,columnSort:true,maxColumnWidth:Ext.isIE?99:100,initComponent:function(){if(this.columnResize){this.colResizer=new Ext.list.ColumnResizer(this.colResizer);this.colResizer.init(this)}if(this.columnSort){this.colSorter=new Ext.list.Sorter(this.columnSort);this.colSorter.init(this)}if(!this.internalTpl){this.internalTpl=new Ext.XTemplate('<div class="x-list-header"><div class="x-list-header-inner">','<tpl for="columns">','<div style="width:{[values.width*100]}%;text-align:{align};"><em unselectable="on" id="',this.id,'-xlhd-{#}">',"{header}","</em></div>","</tpl>",'<div class="x-clear"></div>',"</div></div>",'<div class="x-list-body"><div class="x-list-body-inner">',"</div></div>")}if(!this.tpl){this.tpl=new Ext.XTemplate('<tpl for="rows">',"<dl>",'<tpl for="parent.columns">','<dt style="width:{[values.width*100]}%;text-align:{align};">','<em unselectable="on"<tpl if="cls"> class="{cls}</tpl>">',"{[values.tpl.apply(parent)]}","</em></dt>","</tpl>",'<div class="x-clear"></div>',"</dl>","</tpl>")}var l=this.columns,h=0,k=0,m=l.length,b=[];for(var g=0;g<m;g++){var n=l[g];if(!n.isColumn){n.xtype=n.xtype?(/^lv/.test(n.xtype)?n.xtype:"lv"+n.xtype):"lvcolumn";n=Ext.create(n)}if(n.width){h+=n.width*100;if(h>this.maxColumnWidth){n.width-=(h-this.maxColumnWidth)/100}k++}b.push(n)}l=this.columns=b;if(k<m){var d=m-k;if(h<this.maxColumnWidth){var a=((this.maxColumnWidth-h)/d)/100;for(var e=0;e<m;e++){var n=l[e];if(!n.width){n.width=a}}}}Ext.list.ListView.superclass.initComponent.call(this)},onRender:function(){this.autoEl={cls:"x-list-wrap"};Ext.list.ListView.superclass.onRender.apply(this,arguments);this.internalTpl.overwrite(this.el,{columns:this.columns});this.innerBody=Ext.get(this.el.dom.childNodes[1].firstChild);this.innerHd=Ext.get(this.el.dom.firstChild.firstChild);if(this.hideHeaders){this.el.dom.firstChild.style.display="none"}},getTemplateTarget:function(){return this.innerBody},collectData:function(){var a=Ext.list.ListView.superclass.collectData.apply(this,arguments);return{columns:this.columns,rows:a}},verifyInternalSize:function(){if(this.lastSize){this.onResize(this.lastSize.width,this.lastSize.height)}},onResize:function(c,e){var b=this.innerBody.dom,g=this.innerHd.dom,d=c-Ext.num(this.scrollOffset,Ext.getScrollBarWidth())+"px",a;if(!b){return}a=b.parentNode;if(Ext.isNumber(c)){if(this.reserveScrollOffset||((a.offsetWidth-a.clientWidth)>10)){b.style.width=d;g.style.width=d}else{b.style.width=c+"px";g.style.width=c+"px";setTimeout(function(){if((a.offsetWidth-a.clientWidth)>10){b.style.width=d;g.style.width=d}},10)}}if(Ext.isNumber(e)){a.style.height=Math.max(0,e-g.parentNode.offsetHeight)+"px"}},updateIndexes:function(){Ext.list.ListView.superclass.updateIndexes.apply(this,arguments);this.verifyInternalSize()},findHeaderIndex:function(g){g=g.dom||g;var a=g.parentNode,d=a.parentNode.childNodes,b=0,e;for(;e=d[b];b++){if(e==a){return b}}return -1},setHdWidths:function(){var d=this.innerHd.dom.getElementsByTagName("div"),c=0,b=this.columns,a=b.length;for(;c<a;c++){d[c].style.width=(b[c].width*100)+"%"}}});Ext.reg("listview",Ext.list.ListView);Ext.ListView=Ext.list.ListView;Ext.list.Column=Ext.extend(Object,{isColumn:true,align:"left",header:"",width:null,cls:"",constructor:function(a){if(!a.tpl){a.tpl=new Ext.XTemplate("{"+a.dataIndex+"}")}else{if(Ext.isString(a.tpl)){a.tpl=new Ext.XTemplate(a.tpl)}}Ext.apply(this,a)}});Ext.reg("lvcolumn",Ext.list.Column);Ext.list.NumberColumn=Ext.extend(Ext.list.Column,{format:"0,000.00",constructor:function(a){a.tpl=a.tpl||new Ext.XTemplate("{"+a.dataIndex+':number("'+(a.format||this.format)+'")}');Ext.list.NumberColumn.superclass.constructor.call(this,a)}});Ext.reg("lvnumbercolumn",Ext.list.NumberColumn);Ext.list.DateColumn=Ext.extend(Ext.list.Column,{format:"m/d/Y",constructor:function(a){a.tpl=a.tpl||new Ext.XTemplate("{"+a.dataIndex+':date("'+(a.format||this.format)+'")}');Ext.list.DateColumn.superclass.constructor.call(this,a)}});Ext.reg("lvdatecolumn",Ext.list.DateColumn);Ext.list.BooleanColumn=Ext.extend(Ext.list.Column,{trueText:"true",falseText:"false",undefinedText:"&#160;",constructor:function(e){e.tpl=e.tpl||new Ext.XTemplate("{"+e.dataIndex+":this.format}");var b=this.trueText,d=this.falseText,a=this.undefinedText;e.tpl.format=function(c){if(c===undefined){return a}if(!c||c==="false"){return d}return b};Ext.list.DateColumn.superclass.constructor.call(this,e)}});Ext.reg("lvbooleancolumn",Ext.list.BooleanColumn);Ext.list.ColumnResizer=Ext.extend(Ext.util.Observable,{minPct:0.05,constructor:function(a){Ext.apply(this,a);Ext.list.ColumnResizer.superclass.constructor.call(this)},init:function(a){this.view=a;a.on("render",this.initEvents,this)},initEvents:function(a){a.mon(a.innerHd,"mousemove",this.handleHdMove,this);this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeStart.createDelegate(this),onStart:this.onStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onEnd.createDelegate(this),tolerance:3,autoStart:300});this.tracker.initEl(a.innerHd);a.on("beforedestroy",this.tracker.destroy,this.tracker)},handleHdMove:function(i,d){var c=5,b=i.getPageX(),k=i.getTarget("em",3,true);if(k){var h=k.getRegion(),g=k.dom.style,a=k.dom.parentNode;if(b-h.left<=c&&a!=a.parentNode.firstChild){this.activeHd=Ext.get(a.previousSibling.firstChild);g.cursor=Ext.isWebKit?"e-resize":"col-resize"}else{if(h.right-b<=c&&a!=a.parentNode.lastChild.previousSibling){this.activeHd=k;g.cursor=Ext.isWebKit?"w-resize":"col-resize"}else{delete this.activeHd;g.cursor=""}}}},onBeforeStart:function(a){this.dragHd=this.activeHd;return !!this.dragHd},onStart:function(g){var d=this,b=d.view,c=d.dragHd,a=d.tracker.getXY()[0];d.proxy=b.el.createChild({cls:"x-list-resizer"});d.dragX=c.getX();d.headerIndex=b.findHeaderIndex(c);d.headersDisabled=b.disableHeaders;b.disableHeaders=true;d.proxy.setHeight(b.el.getHeight());d.proxy.setX(d.dragX);d.proxy.setWidth(a-d.dragX);this.setBoundaries()},setBoundaries:function(k){var l=this.view,h=this.headerIndex,c=l.innerHd.getWidth(),k=l.innerHd.getX(),b=Math.ceil(c*this.minPct),m=c-b,e=l.columns.length,d=l.innerHd.select("em",true),g=b+k,a=m+k,i;if(e==2){this.minX=g;this.maxX=a}else{i=d.item(h+2);this.minX=d.item(h).getX()+b;this.maxX=i?i.getX()-b:a;if(h==0){this.minX=g}else{if(h==e-2){this.maxX=a}}}},onDrag:function(c){var b=this,a=b.tracker.getXY()[0].constrain(b.minX,b.maxX);b.proxy.setWidth(a-this.dragX)},onEnd:function(i){var g=this.proxy.getWidth(),h=this.headerIndex,m=this.view,c=m.columns,b=m.innerHd.getWidth(),l=Math.ceil(g*m.maxColumnWidth/b)/100,d=this.headersDisabled,n=c[h],k=c[h+1],a=n.width+k.width;this.proxy.remove();n.width=l;k.width=a-l;delete this.dragHd;m.setHdWidths();m.refresh();setTimeout(function(){m.disableHeaders=d},100)}});Ext.ListView.ColumnResizer=Ext.list.ColumnResizer;Ext.list.Sorter=Ext.extend(Ext.util.Observable,{sortClasses:["sort-asc","sort-desc"],constructor:function(a){Ext.apply(this,a);Ext.list.Sorter.superclass.constructor.call(this)},init:function(a){this.view=a;a.on("render",this.initEvents,this)},initEvents:function(a){a.mon(a.innerHd,"click",this.onHdClick,this);a.innerHd.setStyle("cursor","pointer");a.mon(a.store,"datachanged",this.updateSortState,this);this.updateSortState.defer(10,this,[a.store])},updateSortState:function(c){var g=c.getSortState();if(!g){return}this.sortState=g;var e=this.view.columns,h=-1;for(var d=0,a=e.length;d<a;d++){if(e[d].dataIndex==g.field){h=d;break}}if(h!=-1){var b=g.direction;this.updateSortIcon(h,b)}},updateSortIcon:function(b,a){var d=this.sortClasses;var c=this.view.innerHd.select("em").removeClass(d);c.item(b).addClass(d[a=="DESC"?1:0])},onHdClick:function(c){var b=c.getTarget("em",3);if(b&&!this.view.disableHeaders){var a=this.view.findHeaderIndex(b);this.view.store.sort(this.view.columns[a].dataIndex)}}});Ext.ListView.Sorter=Ext.list.Sorter;Ext.TabPanel=Ext.extend(Ext.Panel,{deferredRender:true,tabWidth:120,minTabWidth:30,resizeTabs:false,enableTabScroll:false,scrollIncrement:0,scrollRepeatInterval:400,scrollDuration:0.35,animScroll:true,tabPosition:"top",baseCls:"x-tab-panel",autoTabs:false,autoTabSelector:"div.x-tab",activeTab:undefined,tabMargin:2,plain:false,wheelIncrement:20,idDelimiter:"__",itemCls:"x-tab-item",elements:"body",headerAsText:false,frame:false,hideBorders:true,initComponent:function(){this.frame=false;Ext.TabPanel.superclass.initComponent.call(this);this.addEvents("beforetabchange","tabchange","contextmenu");this.setLayout(new Ext.layout.CardLayout(Ext.apply({layoutOnCardChange:this.layoutOnTabChange,deferredRender:this.deferredRender},this.layoutConfig)));if(this.tabPosition=="top"){this.elements+=",header";this.stripTarget="header"}else{this.elements+=",footer";this.stripTarget="footer"}if(!this.stack){this.stack=Ext.TabPanel.AccessStack()}this.initItems()},onRender:function(c,a){Ext.TabPanel.superclass.onRender.call(this,c,a);if(this.plain){var g=this.tabPosition=="top"?"header":"footer";this[g].addClass("x-tab-panel-"+g+"-plain")}var b=this[this.stripTarget];this.stripWrap=b.createChild({cls:"x-tab-strip-wrap",cn:{tag:"ul",cls:"x-tab-strip x-tab-strip-"+this.tabPosition}});var e=(this.tabPosition=="bottom"?this.stripWrap:null);b.createChild({cls:"x-tab-strip-spacer"},e);this.strip=new Ext.Element(this.stripWrap.dom.firstChild);this.edge=this.strip.createChild({tag:"li",cls:"x-tab-edge",cn:[{tag:"span",cls:"x-tab-strip-text",cn:"&#160;"}]});this.strip.createChild({cls:"x-clear"});this.body.addClass("x-tab-panel-body-"+this.tabPosition);if(!this.itemTpl){var d=new Ext.Template('<li class="{cls}" id="{id}"><a class="x-tab-strip-close"></a>','<a class="x-tab-right" href="#"><em class="x-tab-left">','<span class="x-tab-strip-inner"><span class="x-tab-strip-text {iconCls}">{text}</span></span>',"</em></a></li>");d.disableFormats=true;d.compile();Ext.TabPanel.prototype.itemTpl=d}this.items.each(this.initTab,this)},afterRender:function(){Ext.TabPanel.superclass.afterRender.call(this);if(this.autoTabs){this.readTabs(false)}if(this.activeTab!==undefined){var a=Ext.isObject(this.activeTab)?this.activeTab:this.items.get(this.activeTab);delete this.activeTab;this.setActiveTab(a)}},initEvents:function(){Ext.TabPanel.superclass.initEvents.call(this);this.mon(this.strip,{scope:this,mousedown:this.onStripMouseDown,contextmenu:this.onStripContextMenu});if(this.enableTabScroll){this.mon(this.strip,"mousewheel",this.onWheel,this)}},findTargets:function(c){var b=null,a=c.getTarget("li:not(.x-tab-edge)",this.strip);if(a){b=this.getComponent(a.id.split(this.idDelimiter)[1]);if(b.disabled){return{close:null,item:null,el:null}}}return{close:c.getTarget(".x-tab-strip-close",this.strip),item:b,el:a}},onStripMouseDown:function(b){if(b.button!==0){return}b.preventDefault();var a=this.findTargets(b);if(a.close){if(a.item.fireEvent("beforeclose",a.item)!==false){a.item.fireEvent("close",a.item);this.remove(a.item)}return}if(a.item&&a.item!=this.activeTab){this.setActiveTab(a.item)}},onStripContextMenu:function(b){b.preventDefault();var a=this.findTargets(b);if(a.item){this.fireEvent("contextmenu",this,a.item,b)}},readTabs:function(d){if(d===true){this.items.each(function(h){this.remove(h)},this)}var c=this.el.query(this.autoTabSelector);for(var b=0,a=c.length;b<a;b++){var e=c[b],g=e.getAttribute("title");e.removeAttribute("title");this.add({title:g,contentEl:e})}},initTab:function(d,b){var e=this.strip.dom.childNodes[b],g=this.getTemplateArgs(d),c=e?this.itemTpl.insertBefore(e,g):this.itemTpl.append(this.strip,g),a="x-tab-strip-over",h=Ext.get(c);h.hover(function(){if(!d.disabled){h.addClass(a)}},function(){h.removeClass(a)});if(d.tabTip){h.child("span.x-tab-strip-text",true).qtip=d.tabTip}d.tabEl=c;h.select("a").on("click",function(i){if(!i.getPageX()){this.onStripMouseDown(i)}},this,{preventDefault:true});d.on({scope:this,disable:this.onItemDisabled,enable:this.onItemEnabled,titlechange:this.onItemTitleChanged,iconchange:this.onItemIconChanged,beforeshow:this.onBeforeShowItem})},getTemplateArgs:function(b){var a=b.closable?"x-tab-strip-closable":"";if(b.disabled){a+=" x-item-disabled"}if(b.iconCls){a+=" x-tab-with-icon"}if(b.tabCls){a+=" "+b.tabCls}return{id:this.id+this.idDelimiter+b.getItemId(),text:b.title,cls:a,iconCls:b.iconCls||""}},onAdd:function(b){Ext.TabPanel.superclass.onAdd.call(this,b);if(this.rendered){var a=this.items;this.initTab(b,a.indexOf(b));this.delegateUpdates()}},onBeforeAdd:function(b){var a=b.events?(this.items.containsKey(b.getItemId())?b:null):this.items.get(b);if(a){this.setActiveTab(b);return false}Ext.TabPanel.superclass.onBeforeAdd.apply(this,arguments);var c=b.elements;b.elements=c?c.replace(",header",""):c;b.border=(b.border===true)},onRemove:function(d){var b=Ext.get(d.tabEl);if(b){b.select("a").removeAllListeners();Ext.destroy(b)}Ext.TabPanel.superclass.onRemove.call(this,d);this.stack.remove(d);delete d.tabEl;d.un("disable",this.onItemDisabled,this);d.un("enable",this.onItemEnabled,this);d.un("titlechange",this.onItemTitleChanged,this);d.un("iconchange",this.onItemIconChanged,this);d.un("beforeshow",this.onBeforeShowItem,this);if(d==this.activeTab){var a=this.stack.next();if(a){this.setActiveTab(a)}else{if(this.items.getCount()>0){this.setActiveTab(0)}else{this.setActiveTab(null)}}}if(!this.destroying){this.delegateUpdates()}},onBeforeShowItem:function(a){if(a!=this.activeTab){this.setActiveTab(a);return false}},onItemDisabled:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).addClass("x-item-disabled")}this.stack.remove(b)},onItemEnabled:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).removeClass("x-item-disabled")}},onItemTitleChanged:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).child("span.x-tab-strip-text",true).innerHTML=b.title}},onItemIconChanged:function(d,a,c){var b=this.getTabEl(d);if(b){b=Ext.get(b);b.child("span.x-tab-strip-text").replaceClass(c,a);b[Ext.isEmpty(a)?"removeClass":"addClass"]("x-tab-with-icon")}},getTabEl:function(a){var b=this.getComponent(a);return b?b.tabEl:null},onResize:function(){Ext.TabPanel.superclass.onResize.apply(this,arguments);this.delegateUpdates()},beginUpdate:function(){this.suspendUpdates=true},endUpdate:function(){this.suspendUpdates=false;this.delegateUpdates()},hideTabStripItem:function(b){b=this.getComponent(b);var a=this.getTabEl(b);if(a){a.style.display="none";this.delegateUpdates()}this.stack.remove(b)},unhideTabStripItem:function(b){b=this.getComponent(b);var a=this.getTabEl(b);if(a){a.style.display="";this.delegateUpdates()}},delegateUpdates:function(){var a=this.rendered;if(this.suspendUpdates){return}if(this.resizeTabs&&a){this.autoSizeTabs()}if(this.enableTabScroll&&a){this.autoScrollTabs()}},autoSizeTabs:function(){var h=this.items.length,b=this.tabPosition!="bottom"?"header":"footer",c=this[b].dom.offsetWidth,a=this[b].dom.clientWidth;if(!this.resizeTabs||h<1||!a){return}var l=Math.max(Math.min(Math.floor((a-4)/h)-this.tabMargin,this.tabWidth),this.minTabWidth);this.lastTabWidth=l;var n=this.strip.query("li:not(.x-tab-edge)");for(var e=0,k=n.length;e<k;e++){var m=n[e],o=Ext.fly(m).child(".x-tab-strip-inner",true),g=m.offsetWidth,d=o.offsetWidth;o.style.width=(l-(g-d))+"px"}},adjustBodyWidth:function(a){if(this.header){this.header.setWidth(a)}if(this.footer){this.footer.setWidth(a)}return a},setActiveTab:function(c){c=this.getComponent(c);if(this.fireEvent("beforetabchange",this,c,this.activeTab)===false){return}if(!this.rendered){this.activeTab=c;return}if(this.activeTab!=c){if(this.activeTab){var a=this.getTabEl(this.activeTab);if(a){Ext.fly(a).removeClass("x-tab-strip-active")}}this.activeTab=c;if(c){var b=this.getTabEl(c);Ext.fly(b).addClass("x-tab-strip-active");this.stack.add(c);this.layout.setActiveItem(c);this.delegateUpdates();if(this.scrolling){this.scrollToTab(c,this.animScroll)}}this.fireEvent("tabchange",this,c)}},getActiveTab:function(){return this.activeTab||null},getItem:function(a){return this.getComponent(a)},autoScrollTabs:function(){this.pos=this.tabPosition=="bottom"?this.footer:this.header;var h=this.items.length,d=this.pos.dom.offsetWidth,c=this.pos.dom.clientWidth,g=this.stripWrap,e=g.dom,b=e.offsetWidth,i=this.getScrollPos(),a=this.edge.getOffsetsTo(this.stripWrap)[0]+i;if(!this.enableTabScroll||b<20){return}if(h==0||a<=c){e.scrollLeft=0;g.setWidth(c);if(this.scrolling){this.scrolling=false;this.pos.removeClass("x-tab-scrolling");this.scrollLeft.hide();this.scrollRight.hide();if(Ext.isAir||Ext.isWebKit){e.style.marginLeft="";e.style.marginRight=""}}}else{if(!this.scrolling){this.pos.addClass("x-tab-scrolling");if(Ext.isAir||Ext.isWebKit){e.style.marginLeft="18px";e.style.marginRight="18px"}}c-=g.getMargins("lr");g.setWidth(c>20?c:20);if(!this.scrolling){if(!this.scrollLeft){this.createScrollers()}else{this.scrollLeft.show();this.scrollRight.show()}}this.scrolling=true;if(i>(a-c)){e.scrollLeft=a-c}else{this.scrollToTab(this.activeTab,false)}this.updateScrollButtons()}},createScrollers:function(){this.pos.addClass("x-tab-scrolling-"+this.tabPosition);var c=this.stripWrap.dom.offsetHeight;var a=this.pos.insertFirst({cls:"x-tab-scroller-left"});a.setHeight(c);a.addClassOnOver("x-tab-scroller-left-over");this.leftRepeater=new Ext.util.ClickRepeater(a,{interval:this.scrollRepeatInterval,handler:this.onScrollLeft,scope:this});this.scrollLeft=a;var b=this.pos.insertFirst({cls:"x-tab-scroller-right"});b.setHeight(c);b.addClassOnOver("x-tab-scroller-right-over");this.rightRepeater=new Ext.util.ClickRepeater(b,{interval:this.scrollRepeatInterval,handler:this.onScrollRight,scope:this});this.scrollRight=b},getScrollWidth:function(){return this.edge.getOffsetsTo(this.stripWrap)[0]+this.getScrollPos()},getScrollPos:function(){return parseInt(this.stripWrap.dom.scrollLeft,10)||0},getScrollArea:function(){return parseInt(this.stripWrap.dom.clientWidth,10)||0},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},getScrollIncrement:function(){return this.scrollIncrement||(this.resizeTabs?this.lastTabWidth+2:100)},scrollToTab:function(e,a){if(!e){return}var c=this.getTabEl(e),h=this.getScrollPos(),d=this.getScrollArea(),g=Ext.fly(c).getOffsetsTo(this.stripWrap)[0]+h,b=g+c.offsetWidth;if(g<h){this.scrollTo(g,a)}else{if(b>(h+d)){this.scrollTo(b-d,a)}}},scrollTo:function(b,a){this.stripWrap.scrollTo("left",b,a?this.getScrollAnim():false);if(!a){this.updateScrollButtons()}},onWheel:function(g){var h=g.getWheelDelta()*this.wheelIncrement*-1;g.stopEvent();var i=this.getScrollPos(),c=i+h,a=this.getScrollWidth()-this.getScrollArea();var b=Math.max(0,Math.min(a,c));if(b!=i){this.scrollTo(b,false)}},onScrollRight:function(){var a=this.getScrollWidth()-this.getScrollArea(),c=this.getScrollPos(),b=Math.min(a,c+this.getScrollIncrement());if(b!=c){this.scrollTo(b,this.animScroll)}},onScrollLeft:function(){var b=this.getScrollPos(),a=Math.max(0,b-this.getScrollIncrement());if(a!=b){this.scrollTo(a,this.animScroll)}},updateScrollButtons:function(){var a=this.getScrollPos();this.scrollLeft[a===0?"addClass":"removeClass"]("x-tab-scroller-left-disabled");this.scrollRight[a>=(this.getScrollWidth()-this.getScrollArea())?"addClass":"removeClass"]("x-tab-scroller-right-disabled")},beforeDestroy:function(){Ext.destroy(this.leftRepeater,this.rightRepeater);this.deleteMembers("strip","edge","scrollLeft","scrollRight","stripWrap");this.activeTab=null;Ext.TabPanel.superclass.beforeDestroy.apply(this)}});Ext.reg("tabpanel",Ext.TabPanel);Ext.TabPanel.prototype.activate=Ext.TabPanel.prototype.setActiveTab;Ext.TabPanel.AccessStack=function(){var a=[];return{add:function(b){a.push(b);if(a.length>10){a.shift()}},remove:function(e){var d=[];for(var c=0,b=a.length;c<b;c++){if(a[c]!=e){d.push(a[c])}}a=d},next:function(){return a.pop()}}};Ext.Button=Ext.extend(Ext.BoxComponent,{hidden:false,disabled:false,pressed:false,enableToggle:false,menuAlign:"tl-bl?",type:"button",menuClassTarget:"tr:nth(2)",clickEvent:"click",handleMouseEvents:true,tooltipType:"qtip",buttonSelector:"button:first-child",scale:"small",iconAlign:"left",arrowAlign:"right",initComponent:function(){if(this.menu){this.menu=Ext.menu.MenuMgr.get(this.menu);this.menu.ownerCt=this}Ext.Button.superclass.initComponent.call(this);this.addEvents("click","toggle","mouseover","mouseout","menushow","menuhide","menutriggerover","menutriggerout");if(this.menu){this.menu.ownerCt=undefined}if(Ext.isString(this.toggleGroup)){this.enableToggle=true}},getTemplateArgs:function(){return[this.type,"x-btn-"+this.scale+" x-btn-icon-"+this.scale+"-"+this.iconAlign,this.getMenuClass(),this.cls,this.id]},setButtonClass:function(){if(this.useSetClass){if(!Ext.isEmpty(this.oldCls)){this.el.removeClass([this.oldCls,"x-btn-pressed"])}this.oldCls=(this.iconCls||this.icon)?(this.text?"x-btn-text-icon":"x-btn-icon"):"x-btn-noicon";this.el.addClass([this.oldCls,this.pressed?"x-btn-pressed":null])}},getMenuClass:function(){return this.menu?(this.arrowAlign!="bottom"?"x-btn-arrow":"x-btn-arrow-bottom"):""},onRender:function(c,a){if(!this.template){if(!Ext.Button.buttonTemplate){Ext.Button.buttonTemplate=new Ext.Template('<table id="{4}" cellspacing="0" class="x-btn {3}"><tbody class="{1}">','<tr><td class="x-btn-tl"><i>&#160;</i></td><td class="x-btn-tc"></td><td class="x-btn-tr"><i>&#160;</i></td></tr>','<tr><td class="x-btn-ml"><i>&#160;</i></td><td class="x-btn-mc"><em class="{2}" unselectable="on"><button type="{0}"></button></em></td><td class="x-btn-mr"><i>&#160;</i></td></tr>','<tr><td class="x-btn-bl"><i>&#160;</i></td><td class="x-btn-bc"></td><td class="x-btn-br"><i>&#160;</i></td></tr>',"</tbody></table>");Ext.Button.buttonTemplate.compile()}this.template=Ext.Button.buttonTemplate}var b,d=this.getTemplateArgs();if(a){b=this.template.insertBefore(a,d,true)}else{b=this.template.append(c,d,true)}this.btnEl=b.child(this.buttonSelector);this.mon(this.btnEl,{scope:this,focus:this.onFocus,blur:this.onBlur});this.initButtonEl(b,this.btnEl);Ext.ButtonToggleMgr.register(this)},initButtonEl:function(b,c){this.el=b;this.setIcon(this.icon);this.setText(this.text);this.setIconClass(this.iconCls);if(Ext.isDefined(this.tabIndex)){c.dom.tabIndex=this.tabIndex}if(this.tooltip){this.setTooltip(this.tooltip,true)}if(this.handleMouseEvents){this.mon(b,{scope:this,mouseover:this.onMouseOver,mousedown:this.onMouseDown})}if(this.menu){this.mon(this.menu,{scope:this,show:this.onMenuShow,hide:this.onMenuHide})}if(this.repeat){var a=new Ext.util.ClickRepeater(b,Ext.isObject(this.repeat)?this.repeat:{});this.mon(a,"click",this.onRepeatClick,this)}else{this.mon(b,this.clickEvent,this.onClick,this)}},afterRender:function(){Ext.Button.superclass.afterRender.call(this);this.useSetClass=true;this.setButtonClass();this.doc=Ext.getDoc();this.doAutoWidth()},setIconClass:function(a){this.iconCls=a;if(this.el){this.btnEl.dom.className="";this.btnEl.addClass(["x-btn-text",a||""]);this.setButtonClass()}return this},setTooltip:function(b,a){if(this.rendered){if(!a){this.clearTip()}if(Ext.isObject(b)){Ext.QuickTips.register(Ext.apply({target:this.btnEl.id},b));this.tooltip=b}else{this.btnEl.dom[this.tooltipType]=b}}else{this.tooltip=b}return this},clearTip:function(){if(Ext.isObject(this.tooltip)){Ext.QuickTips.unregister(this.btnEl)}},beforeDestroy:function(){if(this.rendered){this.clearTip()}if(this.menu&&this.destroyMenu!==false){Ext.destroy(this.btnEl,this.menu)}Ext.destroy(this.repeater)},onDestroy:function(){if(this.rendered){this.doc.un("mouseover",this.monitorMouseOver,this);this.doc.un("mouseup",this.onMouseUp,this);delete this.doc;delete this.btnEl;Ext.ButtonToggleMgr.unregister(this)}Ext.Button.superclass.onDestroy.call(this)},doAutoWidth:function(){if(this.autoWidth!==false&&this.el&&this.text&&this.width===undefined){this.el.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var a=this.btnEl;if(a&&a.getWidth()>20){a.clip();a.setWidth(Ext.util.TextMetrics.measure(a,this.text).width+a.getFrameWidth("lr"))}}if(this.minWidth){if(this.el.getWidth()<this.minWidth){this.el.setWidth(this.minWidth)}}}},setHandler:function(b,a){this.handler=b;this.scope=a;return this},setText:function(a){this.text=a;if(this.el){this.btnEl.update(a||"&#160;");this.setButtonClass()}this.doAutoWidth();return this},setIcon:function(a){this.icon=a;if(this.el){this.btnEl.setStyle("background-image",a?"url("+a+")":"");this.setButtonClass()}return this},getText:function(){return this.text},toggle:function(b,a){b=b===undefined?!this.pressed:!!b;if(b!=this.pressed){if(this.rendered){this.el[b?"addClass":"removeClass"]("x-btn-pressed")}this.pressed=b;if(!a){this.fireEvent("toggle",this,b);if(this.toggleHandler){this.toggleHandler.call(this.scope||this,this,b)}}}return this},onDisable:function(){this.onDisableChange(true)},onEnable:function(){this.onDisableChange(false)},onDisableChange:function(a){if(this.el){if(!Ext.isIE6||!this.text){this.el[a?"addClass":"removeClass"](this.disabledClass)}this.el.dom.disabled=a}this.disabled=a},showMenu:function(){if(this.rendered&&this.menu){if(this.tooltip){Ext.QuickTips.getQuickTip().cancelShow(this.btnEl)}if(this.menu.isVisible()){this.menu.hide()}this.menu.ownerCt=this;this.menu.show(this.el,this.menuAlign)}return this},hideMenu:function(){if(this.hasVisibleMenu()){this.menu.hide()}return this},hasVisibleMenu:function(){return this.menu&&this.menu.ownerCt==this&&this.menu.isVisible()},onRepeatClick:function(a,b){this.onClick(b)},onClick:function(a){if(a){a.preventDefault()}if(a.button!==0){return}if(!this.disabled){this.doToggle();if(this.menu&&!this.hasVisibleMenu()&&!this.ignoreNextClick){this.showMenu()}this.fireEvent("click",this,a);if(this.handler){this.handler.call(this.scope||this,this,a)}}},doToggle:function(){if(this.enableToggle&&(this.allowDepress!==false||!this.pressed)){this.toggle()}},isMenuTriggerOver:function(b,a){return this.menu&&!a},isMenuTriggerOut:function(b,a){return this.menu&&!a},onMouseOver:function(b){if(!this.disabled){var a=b.within(this.el,true);if(!a){this.el.addClass("x-btn-over");if(!this.monitoringMouseOver){this.doc.on("mouseover",this.monitorMouseOver,this);this.monitoringMouseOver=true}this.fireEvent("mouseover",this,b)}if(this.isMenuTriggerOver(b,a)){this.fireEvent("menutriggerover",this,this.menu,b)}}},monitorMouseOver:function(a){if(a.target!=this.el.dom&&!a.within(this.el)){if(this.monitoringMouseOver){this.doc.un("mouseover",this.monitorMouseOver,this);this.monitoringMouseOver=false}this.onMouseOut(a)}},onMouseOut:function(b){var a=b.within(this.el)&&b.target!=this.el.dom;this.el.removeClass("x-btn-over");this.fireEvent("mouseout",this,b);if(this.isMenuTriggerOut(b,a)){this.fireEvent("menutriggerout",this,this.menu,b)}},focus:function(){this.btnEl.focus()},blur:function(){this.btnEl.blur()},onFocus:function(a){if(!this.disabled){this.el.addClass("x-btn-focus")}},onBlur:function(a){this.el.removeClass("x-btn-focus")},getClickEl:function(b,a){return this.el},onMouseDown:function(a){if(!this.disabled&&a.button===0){this.getClickEl(a).addClass("x-btn-click");this.doc.on("mouseup",this.onMouseUp,this)}},onMouseUp:function(a){if(a.button===0){this.getClickEl(a,true).removeClass("x-btn-click");this.doc.un("mouseup",this.onMouseUp,this)}},onMenuShow:function(a){if(this.menu.ownerCt==this){this.menu.ownerCt=this;this.ignoreNextClick=0;this.el.addClass("x-btn-menu-active");this.fireEvent("menushow",this,this.menu)}},onMenuHide:function(a){if(this.menu.ownerCt==this){this.el.removeClass("x-btn-menu-active");this.ignoreNextClick=this.restoreClick.defer(250,this);this.fireEvent("menuhide",this,this.menu);delete this.menu.ownerCt}},restoreClick:function(){this.ignoreNextClick=0}});Ext.reg("button",Ext.Button);Ext.ButtonToggleMgr=function(){var a={};function b(e,k){if(k){var h=a[e.toggleGroup];for(var d=0,c=h.length;d<c;d++){if(h[d]!=e){h[d].toggle(false)}}}}return{register:function(c){if(!c.toggleGroup){return}var d=a[c.toggleGroup];if(!d){d=a[c.toggleGroup]=[]}d.push(c);c.on("toggle",b)},unregister:function(c){if(!c.toggleGroup){return}var d=a[c.toggleGroup];if(d){d.remove(c);c.un("toggle",b)}},getPressed:function(h){var e=a[h];if(e){for(var d=0,c=e.length;d<c;d++){if(e[d].pressed===true){return e[d]}}}return null}}}();Ext.SplitButton=Ext.extend(Ext.Button,{arrowSelector:"em",split:true,initComponent:function(){Ext.SplitButton.superclass.initComponent.call(this);this.addEvents("arrowclick")},onRender:function(){Ext.SplitButton.superclass.onRender.apply(this,arguments);if(this.arrowTooltip){this.el.child(this.arrowSelector).dom[this.tooltipType]=this.arrowTooltip}},setArrowHandler:function(b,a){this.arrowHandler=b;this.scope=a},getMenuClass:function(){return"x-btn-split"+(this.arrowAlign=="bottom"?"-bottom":"")},isClickOnArrow:function(c){if(this.arrowAlign!="bottom"){var b=this.el.child("em.x-btn-split");var a=b.getRegion().right-b.getPadding("r");return c.getPageX()>a}else{return c.getPageY()>this.btnEl.getRegion().bottom}},onClick:function(b,a){b.preventDefault();if(!this.disabled){if(this.isClickOnArrow(b)){if(this.menu&&!this.menu.isVisible()&&!this.ignoreNextClick){this.showMenu()}this.fireEvent("arrowclick",this,b);if(this.arrowHandler){this.arrowHandler.call(this.scope||this,this,b)}}else{this.doToggle();this.fireEvent("click",this,b);if(this.handler){this.handler.call(this.scope||this,this,b)}}}},isMenuTriggerOver:function(a){return this.menu&&a.target.tagName==this.arrowSelector},isMenuTriggerOut:function(b,a){return this.menu&&b.target.tagName!=this.arrowSelector}});Ext.reg("splitbutton",Ext.SplitButton);Ext.CycleButton=Ext.extend(Ext.SplitButton,{getItemText:function(a){if(a&&this.showText===true){var b="";if(this.prependText){b+=this.prependText}b+=a.text;return b}return undefined},setActiveItem:function(c,a){if(!Ext.isObject(c)){c=this.menu.getComponent(c)}if(c){if(!this.rendered){this.text=this.getItemText(c);this.iconCls=c.iconCls}else{var b=this.getItemText(c);if(b){this.setText(b)}this.setIconClass(c.iconCls)}this.activeItem=c;if(!c.checked){c.setChecked(true,false)}if(this.forceIcon){this.setIconClass(this.forceIcon)}if(!a){this.fireEvent("change",this,c)}}},getActiveItem:function(){return this.activeItem},initComponent:function(){this.addEvents("change");if(this.changeHandler){this.on("change",this.changeHandler,this.scope||this);delete this.changeHandler}this.itemCount=this.items.length;this.menu={cls:"x-cycle-menu",items:[]};var a=0;Ext.each(this.items,function(c,b){Ext.apply(c,{group:c.group||this.id,itemIndex:b,checkHandler:this.checkHandler,scope:this,checked:c.checked||false});this.menu.items.push(c);if(c.checked){a=b}},this);Ext.CycleButton.superclass.initComponent.call(this);this.on("click",this.toggleSelected,this);this.setActiveItem(a,true)},checkHandler:function(a,b){if(b){this.setActiveItem(a)}},toggleSelected:function(){var a=this.menu;a.render();if(!a.hasLayout){a.doLayout()}var d,b;for(var c=1;c<this.itemCount;c++){d=(this.activeItem.itemIndex+c)%this.itemCount;b=a.items.itemAt(d);if(!b.disabled){b.setChecked(true);break}}}});Ext.reg("cycle",Ext.CycleButton);Ext.Toolbar=function(a){if(Ext.isArray(a)){a={items:a,layout:"toolbar"}}else{a=Ext.apply({layout:"toolbar"},a);if(a.buttons){a.items=a.buttons}}Ext.Toolbar.superclass.constructor.call(this,a)};(function(){var a=Ext.Toolbar;Ext.extend(a,Ext.Container,{defaultType:"button",enableOverflow:false,trackMenus:true,internalDefaults:{removeMode:"container",hideParent:true},toolbarCls:"x-toolbar",initComponent:function(){a.superclass.initComponent.call(this);this.addEvents("overflowchange")},onRender:function(c,b){if(!this.el){if(!this.autoCreate){this.autoCreate={cls:this.toolbarCls+" x-small-editor"}}this.el=c.createChild(Ext.apply({id:this.id},this.autoCreate),b);Ext.Toolbar.superclass.onRender.apply(this,arguments)}},lookupComponent:function(b){if(Ext.isString(b)){if(b=="-"){b=new a.Separator()}else{if(b==" "){b=new a.Spacer()}else{if(b=="->"){b=new a.Fill()}else{b=new a.TextItem(b)}}}this.applyDefaults(b)}else{if(b.isFormField||b.render){b=this.createComponent(b)}else{if(b.tag){b=new a.Item({autoEl:b})}else{if(b.tagName){b=new a.Item({el:b})}else{if(Ext.isObject(b)){b=b.xtype?this.createComponent(b):this.constructButton(b)}}}}}return b},applyDefaults:function(e){if(!Ext.isString(e)){e=Ext.Toolbar.superclass.applyDefaults.call(this,e);var b=this.internalDefaults;if(e.events){Ext.applyIf(e.initialConfig,b);Ext.apply(e,b)}else{Ext.applyIf(e,b)}}return e},addSeparator:function(){return this.add(new a.Separator())},addSpacer:function(){return this.add(new a.Spacer())},addFill:function(){this.add(new a.Fill())},addElement:function(b){return this.addItem(new a.Item({el:b}))},addItem:function(b){return this.add.apply(this,arguments)},addButton:function(c){if(Ext.isArray(c)){var e=[];for(var d=0,b=c.length;d<b;d++){e.push(this.addButton(c[d]))}return e}return this.add(this.constructButton(c))},addText:function(b){return this.addItem(new a.TextItem(b))},addDom:function(b){return this.add(new a.Item({autoEl:b}))},addField:function(b){return this.add(b)},insertButton:function(c,g){if(Ext.isArray(g)){var e=[];for(var d=0,b=g.length;d<b;d++){e.push(this.insertButton(c+d,g[d]))}return e}return Ext.Toolbar.superclass.insert.call(this,c,g)},trackMenu:function(c,b){if(this.trackMenus&&c.menu){var d=b?"mun":"mon";this[d](c,"menutriggerover",this.onButtonTriggerOver,this);this[d](c,"menushow",this.onButtonMenuShow,this);this[d](c,"menuhide",this.onButtonMenuHide,this)}},constructButton:function(d){var c=d.events?d:this.createComponent(d,d.split?"splitbutton":this.defaultType);return c},onAdd:function(b){Ext.Toolbar.superclass.onAdd.call(this);this.trackMenu(b);if(this.disabled){b.disable()}},onRemove:function(b){Ext.Toolbar.superclass.onRemove.call(this);if(b==this.activeMenuBtn){delete this.activeMenuBtn}this.trackMenu(b,true)},onDisable:function(){this.items.each(function(b){if(b.disable){b.disable()}})},onEnable:function(){this.items.each(function(b){if(b.enable){b.enable()}})},onButtonTriggerOver:function(b){if(this.activeMenuBtn&&this.activeMenuBtn!=b){this.activeMenuBtn.hideMenu();b.showMenu();this.activeMenuBtn=b}},onButtonMenuShow:function(b){this.activeMenuBtn=b},onButtonMenuHide:function(b){delete this.activeMenuBtn}});Ext.reg("toolbar",Ext.Toolbar);a.Item=Ext.extend(Ext.BoxComponent,{hideParent:true,enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.reg("tbitem",a.Item);a.Separator=Ext.extend(a.Item,{onRender:function(c,b){this.el=c.createChild({tag:"span",cls:"xtb-sep"},b)}});Ext.reg("tbseparator",a.Separator);a.Spacer=Ext.extend(a.Item,{onRender:function(c,b){this.el=c.createChild({tag:"div",cls:"xtb-spacer",style:this.width?"width:"+this.width+"px":""},b)}});Ext.reg("tbspacer",a.Spacer);a.Fill=Ext.extend(a.Item,{render:Ext.emptyFn,isFill:true});Ext.reg("tbfill",a.Fill);a.TextItem=Ext.extend(a.Item,{constructor:function(b){a.TextItem.superclass.constructor.call(this,Ext.isString(b)?{text:b}:b)},onRender:function(c,b){this.autoEl={cls:"xtb-text",html:this.text||""};a.TextItem.superclass.onRender.call(this,c,b)},setText:function(b){if(this.rendered){this.el.update(b)}else{this.text=b}}});Ext.reg("tbtext",a.TextItem);a.Button=Ext.extend(Ext.Button,{});a.SplitButton=Ext.extend(Ext.SplitButton,{});Ext.reg("tbbutton",a.Button);Ext.reg("tbsplit",a.SplitButton)})();Ext.ButtonGroup=Ext.extend(Ext.Panel,{baseCls:"x-btn-group",layout:"table",defaultType:"button",frame:true,internalDefaults:{removeMode:"container",hideParent:true},initComponent:function(){this.layoutConfig=this.layoutConfig||{};Ext.applyIf(this.layoutConfig,{columns:this.columns});if(!this.title){this.addClass("x-btn-group-notitle")}this.on("afterlayout",this.onAfterLayout,this);Ext.ButtonGroup.superclass.initComponent.call(this)},applyDefaults:function(b){b=Ext.ButtonGroup.superclass.applyDefaults.call(this,b);var a=this.internalDefaults;if(b.events){Ext.applyIf(b.initialConfig,a);Ext.apply(b,a)}else{Ext.applyIf(b,a)}return b},onAfterLayout:function(){var a=this.body.getFrameWidth("lr")+this.body.dom.firstChild.offsetWidth;this.body.setWidth(a);this.el.setWidth(a+this.getFrameWidth())}});Ext.reg("buttongroup",Ext.ButtonGroup);(function(){var a=Ext.Toolbar;Ext.PagingToolbar=Ext.extend(Ext.Toolbar,{pageSize:20,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No data to display",beforePageText:"Page",afterPageText:"of {0}",firstText:"First Page",prevText:"Previous Page",nextText:"Next Page",lastText:"Last Page",refreshText:"Refresh",initComponent:function(){var c=[this.first=new a.Button({tooltip:this.firstText,overflowText:this.firstText,iconCls:"x-tbar-page-first",disabled:true,handler:this.moveFirst,scope:this}),this.prev=new a.Button({tooltip:this.prevText,overflowText:this.prevText,iconCls:"x-tbar-page-prev",disabled:true,handler:this.movePrevious,scope:this}),"-",this.beforePageText,this.inputItem=new Ext.form.NumberField({cls:"x-tbar-page-number",allowDecimals:false,allowNegative:false,enableKeyEvents:true,selectOnFocus:true,submitValue:false,listeners:{scope:this,keydown:this.onPagingKeyDown,blur:this.onPagingBlur}}),this.afterTextItem=new a.TextItem({text:String.format(this.afterPageText,1)}),"-",this.next=new a.Button({tooltip:this.nextText,overflowText:this.nextText,iconCls:"x-tbar-page-next",disabled:true,handler:this.moveNext,scope:this}),this.last=new a.Button({tooltip:this.lastText,overflowText:this.lastText,iconCls:"x-tbar-page-last",disabled:true,handler:this.moveLast,scope:this}),"-",this.refresh=new a.Button({tooltip:this.refreshText,overflowText:this.refreshText,iconCls:"x-tbar-loading",handler:this.doRefresh,scope:this})];var b=this.items||this.buttons||[];if(this.prependButtons){this.items=b.concat(c)}else{this.items=c.concat(b)}delete this.buttons;if(this.displayInfo){this.items.push("->");this.items.push(this.displayItem=new a.TextItem({}))}Ext.PagingToolbar.superclass.initComponent.call(this);this.addEvents("change","beforechange");this.on("afterlayout",this.onFirstLayout,this,{single:true});this.cursor=0;this.bindStore(this.store,true)},onFirstLayout:function(){if(this.dsLoaded){this.onLoad.apply(this,this.dsLoaded)}},updateInfo:function(){if(this.displayItem){var b=this.store.getCount();var c=b==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+b,this.store.getTotalCount());this.displayItem.setText(c)}},onLoad:function(b,e,k){if(!this.rendered){this.dsLoaded=[b,e,k];return}var g=this.getParams();this.cursor=(k.params&&k.params[g.start])?k.params[g.start]:0;var i=this.getPageData(),c=i.activePage,h=i.pages;this.afterTextItem.setText(String.format(this.afterPageText,i.pages));this.inputItem.setValue(c);this.first.setDisabled(c==1);this.prev.setDisabled(c==1);this.next.setDisabled(c==h);this.last.setDisabled(c==h);this.refresh.enable();this.updateInfo();this.fireEvent("change",this,i)},getPageData:function(){var b=this.store.getTotalCount();return{total:b,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:b<this.pageSize?1:Math.ceil(b/this.pageSize)}},changePage:function(b){this.doLoad(((b-1)*this.pageSize).constrain(0,this.store.getTotalCount()))},onLoadError:function(){if(!this.rendered){return}this.refresh.enable()},readPage:function(e){var b=this.inputItem.getValue(),c;if(!b||isNaN(c=parseInt(b,10))){this.inputItem.setValue(e.activePage);return false}return c},onPagingFocus:function(){this.inputItem.select()},onPagingBlur:function(b){this.inputItem.setValue(this.getPageData().activePage)},onPagingKeyDown:function(i,h){var c=h.getKey(),l=this.getPageData(),g;if(c==h.RETURN){h.stopEvent();g=this.readPage(l);if(g!==false){g=Math.min(Math.max(1,g),l.pages)-1;this.doLoad(g*this.pageSize)}}else{if(c==h.HOME||c==h.END){h.stopEvent();g=c==h.HOME?1:l.pages;i.setValue(g)}else{if(c==h.UP||c==h.PAGEUP||c==h.DOWN||c==h.PAGEDOWN){h.stopEvent();if((g=this.readPage(l))){var b=h.shiftKey?10:1;if(c==h.DOWN||c==h.PAGEDOWN){b*=-1}g+=b;if(g>=1&g<=l.pages){i.setValue(g)}}}}}},getParams:function(){return this.paramNames||this.store.paramNames},beforeLoad:function(){if(this.rendered&&this.refresh){this.refresh.disable()}},doLoad:function(d){var c={},b=this.getParams();c[b.start]=d;c[b.limit]=this.pageSize;if(this.fireEvent("beforechange",this,c)!==false){this.store.load({params:c})}},moveFirst:function(){this.doLoad(0)},movePrevious:function(){this.doLoad(Math.max(0,this.cursor-this.pageSize))},moveNext:function(){this.doLoad(this.cursor+this.pageSize)},moveLast:function(){var c=this.store.getTotalCount(),b=c%this.pageSize;this.doLoad(b?(c-b):c-this.pageSize)},doRefresh:function(){this.doLoad(this.cursor)},bindStore:function(c,d){var b;if(!d&&this.store){if(c!==this.store&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("beforeload",this.beforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.onLoadError,this)}if(!c){this.store=null}}if(c){c=Ext.StoreMgr.lookup(c);c.on({scope:this,beforeload:this.beforeLoad,load:this.onLoad,exception:this.onLoadError});b=true}this.store=c;if(b){this.onLoad(c,null,{})}},unbind:function(b){this.bindStore(null)},bind:function(b){this.bindStore(b)},onDestroy:function(){this.bindStore(null);Ext.PagingToolbar.superclass.onDestroy.call(this)}})})();Ext.reg("paging",Ext.PagingToolbar);Ext.History=(function(){var e,c;var l=false;var d;function g(){var m=location.href,n=m.indexOf("#");return n>=0?m.substr(n+1):null}function a(){c.value=d}function h(m){d=m;Ext.History.fireEvent("change",m)}function i(n){var m=['<html><body><div id="state">',Ext.util.Format.htmlEncode(n),"</div></body></html>"].join("");try{var p=e.contentWindow.document;p.open();p.write(m);p.close();return true}catch(o){return false}}function b(){if(!e.contentWindow||!e.contentWindow.document){setTimeout(b,10);return}var p=e.contentWindow.document;var n=p.getElementById("state");var m=n?n.innerText:null;var o=g();setInterval(function(){p=e.contentWindow.document;n=p.getElementById("state");var r=n?n.innerText:null;var q=g();if(r!==m){m=r;h(m);top.location.hash=m;o=m;a()}else{if(q!==o){o=q;i(q)}}},50);l=true;Ext.History.fireEvent("ready",Ext.History)}function k(){d=c.value?c.value:g();if(Ext.isIE){b()}else{var m=g();setInterval(function(){var n=g();if(n!==m){m=n;h(m);a()}},50);l=true;Ext.History.fireEvent("ready",Ext.History)}}return{fieldId:"x-history-field",iframeId:"x-history-frame",events:{},init:function(n,m){if(l){Ext.callback(n,m,[this]);return}if(!Ext.isReady){Ext.onReady(function(){Ext.History.init(n,m)});return}c=Ext.getDom(Ext.History.fieldId);if(Ext.isIE){e=Ext.getDom(Ext.History.iframeId)}this.addEvents("ready","change");if(n){this.on("ready",n,m,{single:true})}k()},add:function(m,n){if(n!==false){if(this.getToken()==m){return true}}if(Ext.isIE){return i(m)}else{top.location.hash=m;return true}},back:function(){history.go(-1)},forward:function(){history.go(1)},getToken:function(){return l?d:g()}}})();Ext.apply(Ext.History,new Ext.util.Observable());Ext.Tip=Ext.extend(Ext.Panel,{minWidth:40,maxWidth:300,shadow:"sides",defaultAlign:"tl-bl?",autoRender:true,quickShowInterval:250,frame:true,hidden:true,baseCls:"x-tip",floating:{shadow:true,shim:true,useDisplay:true,constrain:false},autoHeight:true,closeAction:"hide",initComponent:function(){Ext.Tip.superclass.initComponent.call(this);if(this.closable&&!this.title){this.elements+=",header"}},afterRender:function(){Ext.Tip.superclass.afterRender.call(this);if(this.closable){this.addTool({id:"close",handler:this[this.closeAction],scope:this})}},showAt:function(a){Ext.Tip.superclass.show.call(this);if(this.measureWidth!==false&&(!this.initialConfig||typeof this.initialConfig.width!="number")){this.doAutoWidth()}if(this.constrainPosition){a=this.el.adjustForConstraints(a)}this.setPagePosition(a[0],a[1])},doAutoWidth:function(a){a=a||0;var b=this.body.getTextWidth();if(this.title){b=Math.max(b,this.header.child("span").getTextWidth(this.title))}b+=this.getFrameWidth()+(this.closable?20:0)+this.body.getPadding("lr")+a;this.setWidth(b.constrain(this.minWidth,this.maxWidth));if(Ext.isIE7&&!this.repainted){this.el.repaint();this.repainted=true}},showBy:function(a,b){if(!this.rendered){this.render(Ext.getBody())}this.showAt(this.el.getAlignToXY(a,b||this.defaultAlign))},initDraggable:function(){this.dd=new Ext.Tip.DD(this,typeof this.draggable=="boolean"?null:this.draggable);this.header.addClass("x-tip-draggable")}});Ext.reg("tip",Ext.Tip);Ext.Tip.DD=function(b,a){Ext.apply(this,a);this.tip=b;Ext.Tip.DD.superclass.constructor.call(this,b.el.id,"WindowDD-"+b.id);this.setHandleElId(b.header.id);this.scroll=false};Ext.extend(Ext.Tip.DD,Ext.dd.DD,{moveOnly:true,scroll:false,headerOffsets:[100,25],startDrag:function(){this.tip.el.disableShadow()},endDrag:function(a){this.tip.el.enableShadow(true)}});Ext.ToolTip=Ext.extend(Ext.Tip,{showDelay:500,hideDelay:200,dismissDelay:5000,trackMouse:false,anchorToTarget:true,anchorOffset:0,targetCounter:0,constrainPosition:false,initComponent:function(){Ext.ToolTip.superclass.initComponent.call(this);this.lastActive=new Date();this.initTarget(this.target);this.origAnchor=this.anchor},onRender:function(b,a){Ext.ToolTip.superclass.onRender.call(this,b,a);this.anchorCls="x-tip-anchor-"+this.getAnchorPosition();this.anchorEl=this.el.createChild({cls:"x-tip-anchor "+this.anchorCls})},afterRender:function(){Ext.ToolTip.superclass.afterRender.call(this);this.anchorEl.setStyle("z-index",this.el.getZIndex()+1).setVisibilityMode(Ext.Element.DISPLAY)},initTarget:function(c){var a;if((a=Ext.get(c))){if(this.target){var b=Ext.get(this.target);this.mun(b,"mouseover",this.onTargetOver,this);this.mun(b,"mouseout",this.onTargetOut,this);this.mun(b,"mousemove",this.onMouseMove,this)}this.mon(a,{mouseover:this.onTargetOver,mouseout:this.onTargetOut,mousemove:this.onMouseMove,scope:this});this.target=a}if(this.anchor){this.anchorTarget=this.target}},onMouseMove:function(b){var a=this.delegate?b.getTarget(this.delegate):this.triggerElement=true;if(a){this.targetXY=b.getXY();if(a===this.triggerElement){if(!this.hidden&&this.trackMouse){this.setPagePosition(this.getTargetXY())}}else{this.hide();this.lastActive=new Date(0);this.onTargetOver(b)}}else{if(!this.closable&&this.isVisible()){this.hide()}}},getTargetXY:function(){if(this.delegate){this.anchorTarget=this.triggerElement}if(this.anchor){this.targetCounter++;var c=this.getOffsets(),m=(this.anchorToTarget&&!this.trackMouse)?this.el.getAlignToXY(this.anchorTarget,this.getAnchorAlign()):this.targetXY,a=Ext.lib.Dom.getViewWidth()-5,h=Ext.lib.Dom.getViewHeight()-5,i=document.documentElement,e=document.body,l=(i.scrollLeft||e.scrollLeft||0)+5,k=(i.scrollTop||e.scrollTop||0)+5,b=[m[0]+c[0],m[1]+c[1]],g=this.getSize();this.anchorEl.removeClass(this.anchorCls);if(this.targetCounter<2){if(b[0]<l){if(this.anchorToTarget){this.defaultAlign="l-r";if(this.mouseOffset){this.mouseOffset[0]*=-1}}this.anchor="left";return this.getTargetXY()}if(b[0]+g.width>a){if(this.anchorToTarget){this.defaultAlign="r-l";if(this.mouseOffset){this.mouseOffset[0]*=-1}}this.anchor="right";return this.getTargetXY()}if(b[1]<k){if(this.anchorToTarget){this.defaultAlign="t-b";if(this.mouseOffset){this.mouseOffset[1]*=-1}}this.anchor="top";return this.getTargetXY()}if(b[1]+g.height>h){if(this.anchorToTarget){this.defaultAlign="b-t";if(this.mouseOffset){this.mouseOffset[1]*=-1}}this.anchor="bottom";return this.getTargetXY()}}this.anchorCls="x-tip-anchor-"+this.getAnchorPosition();this.anchorEl.addClass(this.anchorCls);this.targetCounter=0;return b}else{var d=this.getMouseOffset();return[this.targetXY[0]+d[0],this.targetXY[1]+d[1]]}},getMouseOffset:function(){var a=this.anchor?[0,0]:[15,18];if(this.mouseOffset){a[0]+=this.mouseOffset[0];a[1]+=this.mouseOffset[1]}return a},getAnchorPosition:function(){if(this.anchor){this.tipAnchor=this.anchor.charAt(0)}else{var a=this.defaultAlign.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!a){throw"AnchorTip.defaultAlign is invalid"}this.tipAnchor=a[1].charAt(0)}switch(this.tipAnchor){case"t":return"top";case"b":return"bottom";case"r":return"right"}return"left"},getAnchorAlign:function(){switch(this.anchor){case"top":return"tl-bl";case"left":return"tl-tr";case"right":return"tr-tl";default:return"bl-tl"}},getOffsets:function(){var b,a=this.getAnchorPosition().charAt(0);if(this.anchorToTarget&&!this.trackMouse){switch(a){case"t":b=[0,9];break;case"b":b=[0,-13];break;case"r":b=[-13,0];break;default:b=[9,0];break}}else{switch(a){case"t":b=[-15-this.anchorOffset,30];break;case"b":b=[-19-this.anchorOffset,-13-this.el.dom.offsetHeight];break;case"r":b=[-15-this.el.dom.offsetWidth,-13-this.anchorOffset];break;default:b=[25,-13-this.anchorOffset];break}}var c=this.getMouseOffset();b[0]+=c[0];b[1]+=c[1];return b},onTargetOver:function(b){if(this.disabled||b.within(this.target.dom,true)){return}var a=b.getTarget(this.delegate);if(a){this.triggerElement=a;this.clearTimer("hide");this.targetXY=b.getXY();this.delayShow()}},delayShow:function(){if(this.hidden&&!this.showTimer){if(this.lastActive.getElapsed()<this.quickShowInterval){this.show()}else{this.showTimer=this.show.defer(this.showDelay,this)}}else{if(!this.hidden&&this.autoHide!==false){this.show()}}},onTargetOut:function(a){if(this.disabled||a.within(this.target.dom,true)){return}this.clearTimer("show");if(this.autoHide!==false){this.delayHide()}},delayHide:function(){if(!this.hidden&&!this.hideTimer){this.hideTimer=this.hide.defer(this.hideDelay,this)}},hide:function(){this.clearTimer("dismiss");this.lastActive=new Date();if(this.anchorEl){this.anchorEl.hide()}Ext.ToolTip.superclass.hide.call(this);delete this.triggerElement},show:function(){if(this.anchor){this.showAt([-1000,-1000]);this.origConstrainPosition=this.constrainPosition;this.constrainPosition=false;this.anchor=this.origAnchor}this.showAt(this.getTargetXY());if(this.anchor){this.anchorEl.show();this.syncAnchor();this.constrainPosition=this.origConstrainPosition}else{this.anchorEl.hide()}},showAt:function(a){this.lastActive=new Date();this.clearTimers();Ext.ToolTip.superclass.showAt.call(this,a);if(this.dismissDelay&&this.autoHide!==false){this.dismissTimer=this.hide.defer(this.dismissDelay,this)}if(this.anchor&&!this.anchorEl.isVisible()){this.syncAnchor();this.anchorEl.show()}else{this.anchorEl.hide()}},syncAnchor:function(){var a,b,c;switch(this.tipAnchor.charAt(0)){case"t":a="b";b="tl";c=[20+this.anchorOffset,2];break;case"r":a="l";b="tr";c=[-2,11+this.anchorOffset];break;case"b":a="t";b="bl";c=[20+this.anchorOffset,-2];break;default:a="r";b="tl";c=[2,11+this.anchorOffset];break}this.anchorEl.alignTo(this.el,a+"-"+b,c)},setPagePosition:function(a,b){Ext.ToolTip.superclass.setPagePosition.call(this,a,b);if(this.anchor){this.syncAnchor()}},clearTimer:function(a){a=a+"Timer";clearTimeout(this[a]);delete this[a]},clearTimers:function(){this.clearTimer("show");this.clearTimer("dismiss");this.clearTimer("hide")},onShow:function(){Ext.ToolTip.superclass.onShow.call(this);Ext.getDoc().on("mousedown",this.onDocMouseDown,this)},onHide:function(){Ext.ToolTip.superclass.onHide.call(this);Ext.getDoc().un("mousedown",this.onDocMouseDown,this)},onDocMouseDown:function(a){if(this.autoHide!==true&&!this.closable&&!a.within(this.el.dom)){this.disable();this.doEnable.defer(100,this)}},doEnable:function(){if(!this.isDestroyed){this.enable()}},onDisable:function(){this.clearTimers();this.hide()},adjustPosition:function(a,d){if(this.contstrainPosition){var c=this.targetXY[1],b=this.getSize().height;if(d<=c&&(d+b)>=c){d=c-b-5}}return{x:a,y:d}},beforeDestroy:function(){this.clearTimers();Ext.destroy(this.anchorEl);delete this.anchorEl;delete this.target;delete this.anchorTarget;delete this.triggerElement;Ext.ToolTip.superclass.beforeDestroy.call(this)},onDestroy:function(){Ext.getDoc().un("mousedown",this.onDocMouseDown,this);Ext.ToolTip.superclass.onDestroy.call(this)}});Ext.reg("tooltip",Ext.ToolTip);Ext.QuickTip=Ext.extend(Ext.ToolTip,{interceptTitles:false,tagConfig:{namespace:"ext",attribute:"qtip",width:"qwidth",target:"target",title:"qtitle",hide:"hide",cls:"qclass",align:"qalign",anchor:"anchor"},initComponent:function(){this.target=this.target||Ext.getDoc();this.targets=this.targets||{};Ext.QuickTip.superclass.initComponent.call(this)},register:function(e){var h=Ext.isArray(e)?e:arguments;for(var g=0,a=h.length;g<a;g++){var l=h[g];var k=l.target;if(k){if(Ext.isArray(k)){for(var d=0,b=k.length;d<b;d++){this.targets[Ext.id(k[d])]=l}}else{this.targets[Ext.id(k)]=l}}}},unregister:function(a){delete this.targets[Ext.id(a)]},cancelShow:function(b){var a=this.activeTarget;b=Ext.get(b).dom;if(this.isVisible()){if(a&&a.el==b){this.hide()}}else{if(a&&a.el==b){this.clearTimer("show")}}},getTipCfg:function(d){var b=d.getTarget(),c,a;if(this.interceptTitles&&b.title&&Ext.isString(b.title)){c=b.title;b.qtip=c;b.removeAttribute("title");d.preventDefault()}else{a=this.tagConfig;c=b.qtip||Ext.fly(b).getAttribute(a.attribute,a.namespace)}return c},onTargetOver:function(i){if(this.disabled){return}this.targetXY=i.getXY();var c=i.getTarget();if(!c||c.nodeType!==1||c==document||c==document.body){return}if(this.activeTarget&&((c==this.activeTarget.el)||Ext.fly(this.activeTarget.el).contains(c))){this.clearTimer("hide");this.show();return}if(c&&this.targets[c.id]){this.activeTarget=this.targets[c.id];this.activeTarget.el=c;this.anchor=this.activeTarget.anchor;if(this.anchor){this.anchorTarget=c}this.delayShow();return}var g,h=Ext.fly(c),b=this.tagConfig,d=b.namespace;if(g=this.getTipCfg(i)){var a=h.getAttribute(b.hide,d);this.activeTarget={el:c,text:g,width:h.getAttribute(b.width,d),autoHide:a!="user"&&a!=="false",title:h.getAttribute(b.title,d),cls:h.getAttribute(b.cls,d),align:h.getAttribute(b.align,d)};this.anchor=h.getAttribute(b.anchor,d);if(this.anchor){this.anchorTarget=c}this.delayShow()}},onTargetOut:function(a){if(this.activeTarget&&a.within(this.activeTarget.el)&&!this.getTipCfg(a)){return}this.clearTimer("show");if(this.autoHide!==false){this.delayHide()}},showAt:function(b){var a=this.activeTarget;if(a){if(!this.rendered){this.render(Ext.getBody());this.activeTarget=a}if(a.width){this.setWidth(a.width);this.body.setWidth(this.adjustBodyWidth(a.width-this.getFrameWidth()));this.measureWidth=false}else{this.measureWidth=true}this.setTitle(a.title||"");this.body.update(a.text);this.autoHide=a.autoHide;this.dismissDelay=a.dismissDelay||this.dismissDelay;if(this.lastCls){this.el.removeClass(this.lastCls);delete this.lastCls}if(a.cls){this.el.addClass(a.cls);this.lastCls=a.cls}if(this.anchor){this.constrainPosition=false}else{if(a.align){b=this.el.getAlignToXY(a.el,a.align);this.constrainPosition=false}else{this.constrainPosition=true}}}Ext.QuickTip.superclass.showAt.call(this,b)},hide:function(){delete this.activeTarget;Ext.QuickTip.superclass.hide.call(this)}});Ext.reg("quicktip",Ext.QuickTip);Ext.QuickTips=function(){var b,a=false;return{init:function(c){if(!b){if(!Ext.isReady){Ext.onReady(function(){Ext.QuickTips.init(c)});return}b=new Ext.QuickTip({elements:"header,body",disabled:a});if(c!==false){b.render(Ext.getBody())}}},ddDisable:function(){if(b&&!a){b.disable()}},ddEnable:function(){if(b&&!a){b.enable()}},enable:function(){if(b){b.enable()}a=false},disable:function(){if(b){b.disable()}a=true},isEnabled:function(){return b!==undefined&&!b.disabled},getQuickTip:function(){return b},register:function(){b.register.apply(b,arguments)},unregister:function(){b.unregister.apply(b,arguments)},tips:function(){b.register.apply(b,arguments)}}}();Ext.slider.Tip=Ext.extend(Ext.Tip,{minWidth:10,offsets:[0,-10],init:function(a){a.on({scope:this,dragstart:this.onSlide,drag:this.onSlide,dragend:this.hide,destroy:this.destroy})},onSlide:function(b,c,a){this.show();this.body.update(this.getText(a));this.doAutoWidth();this.el.alignTo(a.el,"b-t?",this.offsets)},getText:function(a){return String(a.value)}});Ext.ux.SliderTip=Ext.slider.Tip;Ext.tree.TreePanel=Ext.extend(Ext.Panel,{rootVisible:true,animate:Ext.enableFx,lines:true,enableDD:false,hlDrop:Ext.enableFx,pathSeparator:"/",bubbleEvents:[],initComponent:function(){Ext.tree.TreePanel.superclass.initComponent.call(this);if(!this.eventModel){this.eventModel=new Ext.tree.TreeEventModel(this)}var a=this.loader;if(!a){a=new Ext.tree.TreeLoader({dataUrl:this.dataUrl,requestMethod:this.requestMethod})}else{if(Ext.isObject(a)&&!a.load){a=new Ext.tree.TreeLoader(a)}}this.loader=a;this.nodeHash={};if(this.root){var b=this.root;delete this.root;this.setRootNode(b)}this.addEvents("append","remove","movenode","insert","beforeappend","beforeremove","beforemovenode","beforeinsert","beforeload","load","textchange","beforeexpandnode","beforecollapsenode","expandnode","disabledchange","collapsenode","beforeclick","click","containerclick","checkchange","beforedblclick","dblclick","containerdblclick","contextmenu","containercontextmenu","beforechildrenrendered","startdrag","enddrag","dragdrop","beforenodedrop","nodedrop","nodedragover");if(this.singleExpand){this.on("beforeexpandnode",this.restrictExpand,this)}},proxyNodeEvent:function(c,b,a,h,g,e,d){if(c=="collapse"||c=="expand"||c=="beforecollapse"||c=="beforeexpand"||c=="move"||c=="beforemove"){c=c+"node"}return this.fireEvent(c,b,a,h,g,e,d)},getRootNode:function(){return this.root},setRootNode:function(b){this.destroyRoot();if(!b.render){b=this.loader.createNode(b)}this.root=b;b.ownerTree=this;b.isRoot=true;this.registerNode(b);if(!this.rootVisible){var a=b.attributes.uiProvider;b.ui=a?new a(b):new Ext.tree.RootTreeNodeUI(b)}if(this.innerCt){this.clearInnerCt();this.renderRoot()}return b},clearInnerCt:function(){this.innerCt.update("")},renderRoot:function(){this.root.render();if(!this.rootVisible){this.root.renderChildren()}},getNodeById:function(a){return this.nodeHash[a]},registerNode:function(a){this.nodeHash[a.id]=a},unregisterNode:function(a){delete this.nodeHash[a.id]},toString:function(){return"[Tree"+(this.id?" "+this.id:"")+"]"},restrictExpand:function(a){var b=a.parentNode;if(b){if(b.expandedChild&&b.expandedChild.parentNode==b){b.expandedChild.collapse()}b.expandedChild=a}},getChecked:function(b,c){c=c||this.root;var d=[];var e=function(){if(this.attributes.checked){d.push(!b?this:(b=="id"?this.id:this.attributes[b]))}};c.cascade(e);return d},getLoader:function(){return this.loader},expandAll:function(){this.root.expand(true)},collapseAll:function(){this.root.collapse(true)},getSelectionModel:function(){if(!this.selModel){this.selModel=new Ext.tree.DefaultSelectionModel()}return this.selModel},expandPath:function(g,a,h){if(Ext.isEmpty(g)){if(h){h(false,undefined)}return}a=a||"id";var d=g.split(this.pathSeparator);var c=this.root;if(c.attributes[a]!=d[1]){if(h){h(false,null)}return}var b=1;var e=function(){if(++b==d.length){if(h){h(true,c)}return}var i=c.findChild(a,d[b]);if(!i){if(h){h(false,c)}return}c=i;i.expand(false,false,e)};c.expand(false,false,e)},selectPath:function(e,a,g){if(Ext.isEmpty(e)){if(g){g(false,undefined)}return}a=a||"id";var c=e.split(this.pathSeparator),b=c.pop();if(c.length>1){var d=function(i,h){if(i&&h){var k=h.findChild(a,b);if(k){k.select();if(g){g(true,k)}}else{if(g){g(false,k)}}}else{if(g){g(false,k)}}};this.expandPath(c.join(this.pathSeparator),a,d)}else{this.root.select();if(g){g(true,this.root)}}},getTreeEl:function(){return this.body},onRender:function(b,a){Ext.tree.TreePanel.superclass.onRender.call(this,b,a);this.el.addClass("x-tree");this.innerCt=this.body.createChild({tag:"ul",cls:"x-tree-root-ct "+(this.useArrows?"x-tree-arrows":this.lines?"x-tree-lines":"x-tree-no-lines")})},initEvents:function(){Ext.tree.TreePanel.superclass.initEvents.call(this);if(this.containerScroll){Ext.dd.ScrollManager.register(this.body)}if((this.enableDD||this.enableDrop)&&!this.dropZone){this.dropZone=new Ext.tree.TreeDropZone(this,this.dropConfig||{ddGroup:this.ddGroup||"TreeDD",appendOnly:this.ddAppendOnly===true})}if((this.enableDD||this.enableDrag)&&!this.dragZone){this.dragZone=new Ext.tree.TreeDragZone(this,this.dragConfig||{ddGroup:this.ddGroup||"TreeDD",scroll:this.ddScroll})}this.getSelectionModel().init(this)},afterRender:function(){Ext.tree.TreePanel.superclass.afterRender.call(this);this.renderRoot()},beforeDestroy:function(){if(this.rendered){Ext.dd.ScrollManager.unregister(this.body);Ext.destroy(this.dropZone,this.dragZone)}this.destroyRoot();Ext.destroy(this.loader);this.nodeHash=this.root=this.loader=null;Ext.tree.TreePanel.superclass.beforeDestroy.call(this)},destroyRoot:function(){if(this.root&&this.root.destroy){this.root.destroy(true)}}});Ext.tree.TreePanel.nodeTypes={};Ext.reg("treepanel",Ext.tree.TreePanel);Ext.tree.TreeEventModel=function(a){this.tree=a;this.tree.on("render",this.initEvents,this)};Ext.tree.TreeEventModel.prototype={initEvents:function(){var a=this.tree;if(a.trackMouseOver!==false){a.mon(a.innerCt,{scope:this,mouseover:this.delegateOver,mouseout:this.delegateOut})}a.mon(a.getTreeEl(),{scope:this,click:this.delegateClick,dblclick:this.delegateDblClick,contextmenu:this.delegateContextMenu})},getNode:function(b){var a;if(a=b.getTarget(".x-tree-node-el",10)){var c=Ext.fly(a,"_treeEvents").getAttribute("tree-node-id","ext");if(c){return this.tree.getNodeById(c)}}return null},getNodeTarget:function(b){var a=b.getTarget(".x-tree-node-icon",1);if(!a){a=b.getTarget(".x-tree-node-el",6)}return a},delegateOut:function(b,a){if(!this.beforeEvent(b)){return}if(b.getTarget(".x-tree-ec-icon",1)){var c=this.getNode(b);this.onIconOut(b,c);if(c==this.lastEcOver){delete this.lastEcOver}}if((a=this.getNodeTarget(b))&&!b.within(a,true)){this.onNodeOut(b,this.getNode(b))}},delegateOver:function(b,a){if(!this.beforeEvent(b)){return}if(Ext.isGecko&&!this.trackingDoc){Ext.getBody().on("mouseover",this.trackExit,this);this.trackingDoc=true}if(this.lastEcOver){this.onIconOut(b,this.lastEcOver);delete this.lastEcOver}if(b.getTarget(".x-tree-ec-icon",1)){this.lastEcOver=this.getNode(b);this.onIconOver(b,this.lastEcOver)}if(a=this.getNodeTarget(b)){this.onNodeOver(b,this.getNode(b))}},trackExit:function(a){if(this.lastOverNode){if(this.lastOverNode.ui&&!a.within(this.lastOverNode.ui.getEl())){this.onNodeOut(a,this.lastOverNode)}delete this.lastOverNode;Ext.getBody().un("mouseover",this.trackExit,this);this.trackingDoc=false}},delegateClick:function(b,a){if(this.beforeEvent(b)){if(b.getTarget("input[type=checkbox]",1)){this.onCheckboxClick(b,this.getNode(b))}else{if(b.getTarget(".x-tree-ec-icon",1)){this.onIconClick(b,this.getNode(b))}else{if(this.getNodeTarget(b)){this.onNodeClick(b,this.getNode(b))}}}}else{this.checkContainerEvent(b,"click")}},delegateDblClick:function(b,a){if(this.beforeEvent(b)){if(this.getNodeTarget(b)){this.onNodeDblClick(b,this.getNode(b))}}else{this.checkContainerEvent(b,"dblclick")}},delegateContextMenu:function(b,a){if(this.beforeEvent(b)){if(this.getNodeTarget(b)){this.onNodeContextMenu(b,this.getNode(b))}}else{this.checkContainerEvent(b,"contextmenu")}},checkContainerEvent:function(b,a){if(this.disabled){b.stopEvent();return false}this.onContainerEvent(b,a)},onContainerEvent:function(b,a){this.tree.fireEvent("container"+a,this.tree,b)},onNodeClick:function(b,a){a.ui.onClick(b)},onNodeOver:function(b,a){this.lastOverNode=a;a.ui.onOver(b)},onNodeOut:function(b,a){a.ui.onOut(b)},onIconOver:function(b,a){a.ui.addClass("x-tree-ec-over")},onIconOut:function(b,a){a.ui.removeClass("x-tree-ec-over")},onIconClick:function(b,a){a.ui.ecClick(b)},onCheckboxClick:function(b,a){a.ui.onCheckChange(b)},onNodeDblClick:function(b,a){a.ui.onDblClick(b)},onNodeContextMenu:function(b,a){a.ui.onContextMenu(b)},beforeEvent:function(b){var a=this.getNode(b);if(this.disabled||!a||!a.ui){b.stopEvent();return false}return true},disable:function(){this.disabled=true},enable:function(){this.disabled=false}};Ext.tree.DefaultSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(a){this.selNode=null;this.addEvents("selectionchange","beforeselect");Ext.apply(this,a);Ext.tree.DefaultSelectionModel.superclass.constructor.call(this)},init:function(a){this.tree=a;a.mon(a.getTreeEl(),"keydown",this.onKeyDown,this);a.on("click",this.onNodeClick,this)},onNodeClick:function(a,b){this.select(a)},select:function(c,a){if(!Ext.fly(c.ui.wrap).isVisible()&&a){return a.call(this,c)}var b=this.selNode;if(c==b){c.ui.onSelectedChange(true)}else{if(this.fireEvent("beforeselect",this,c,b)!==false){if(b&&b.ui){b.ui.onSelectedChange(false)}this.selNode=c;c.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,c,b)}}return c},unselect:function(b,a){if(this.selNode==b){this.clearSelections(a)}},clearSelections:function(a){var b=this.selNode;if(b){b.ui.onSelectedChange(false);this.selNode=null;if(a!==true){this.fireEvent("selectionchange",this,null)}}return b},getSelectedNode:function(){return this.selNode},isSelected:function(a){return this.selNode==a},selectPrevious:function(a){if(!(a=a||this.selNode||this.lastSelNode)){return null}var c=a.previousSibling;if(c){if(!c.isExpanded()||c.childNodes.length<1){return this.select(c,this.selectPrevious)}else{var b=c.lastChild;while(b&&b.isExpanded()&&Ext.fly(b.ui.wrap).isVisible()&&b.childNodes.length>0){b=b.lastChild}return this.select(b,this.selectPrevious)}}else{if(a.parentNode&&(this.tree.rootVisible||!a.parentNode.isRoot)){return this.select(a.parentNode,this.selectPrevious)}}return null},selectNext:function(b){if(!(b=b||this.selNode||this.lastSelNode)){return null}if(b.firstChild&&b.isExpanded()&&Ext.fly(b.ui.wrap).isVisible()){return this.select(b.firstChild,this.selectNext)}else{if(b.nextSibling){return this.select(b.nextSibling,this.selectNext)}else{if(b.parentNode){var a=null;b.parentNode.bubble(function(){if(this.nextSibling){a=this.getOwnerTree().selModel.select(this.nextSibling,this.selectNext);return false}});return a}}}return null},onKeyDown:function(c){var b=this.selNode||this.lastSelNode;var d=this;if(!b){return}var a=c.getKey();switch(a){case c.DOWN:c.stopEvent();this.selectNext();break;case c.UP:c.stopEvent();this.selectPrevious();break;case c.RIGHT:c.preventDefault();if(b.hasChildNodes()){if(!b.isExpanded()){b.expand()}else{if(b.firstChild){this.select(b.firstChild,c)}}}break;case c.LEFT:c.preventDefault();if(b.hasChildNodes()&&b.isExpanded()){b.collapse()}else{if(b.parentNode&&(this.tree.rootVisible||b.parentNode!=this.tree.getRootNode())){this.select(b.parentNode,c)}}break}}});Ext.tree.MultiSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(a){this.selNodes=[];this.selMap={};this.addEvents("selectionchange");Ext.apply(this,a);Ext.tree.MultiSelectionModel.superclass.constructor.call(this)},init:function(a){this.tree=a;a.mon(a.getTreeEl(),"keydown",this.onKeyDown,this);a.on("click",this.onNodeClick,this)},onNodeClick:function(a,b){if(b.ctrlKey&&this.isSelected(a)){this.unselect(a)}else{this.select(a,b,b.ctrlKey)}},select:function(a,c,b){if(b!==true){this.clearSelections(true)}if(this.isSelected(a)){this.lastSelNode=a;return a}this.selNodes.push(a);this.selMap[a.id]=a;this.lastSelNode=a;a.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,this.selNodes);return a},unselect:function(b){if(this.selMap[b.id]){b.ui.onSelectedChange(false);var c=this.selNodes;var a=c.indexOf(b);if(a!=-1){this.selNodes.splice(a,1)}delete this.selMap[b.id];this.fireEvent("selectionchange",this,this.selNodes)}},clearSelections:function(b){var d=this.selNodes;if(d.length>0){for(var c=0,a=d.length;c<a;c++){d[c].ui.onSelectedChange(false)}this.selNodes=[];this.selMap={};if(b!==true){this.fireEvent("selectionchange",this,this.selNodes)}}},isSelected:function(a){return this.selMap[a.id]?true:false},getSelectedNodes:function(){return this.selNodes.concat([])},onKeyDown:Ext.tree.DefaultSelectionModel.prototype.onKeyDown,selectNext:Ext.tree.DefaultSelectionModel.prototype.selectNext,selectPrevious:Ext.tree.DefaultSelectionModel.prototype.selectPrevious});Ext.data.Tree=Ext.extend(Ext.util.Observable,{constructor:function(a){this.nodeHash={};this.root=null;if(a){this.setRootNode(a)}this.addEvents("append","remove","move","insert","beforeappend","beforeremove","beforemove","beforeinsert");Ext.data.Tree.superclass.constructor.call(this)},pathSeparator:"/",proxyNodeEvent:function(){return this.fireEvent.apply(this,arguments)},getRootNode:function(){return this.root},setRootNode:function(a){this.root=a;a.ownerTree=this;a.isRoot=true;this.registerNode(a);return a},getNodeById:function(a){return this.nodeHash[a]},registerNode:function(a){this.nodeHash[a.id]=a},unregisterNode:function(a){delete this.nodeHash[a.id]},toString:function(){return"[Tree"+(this.id?" "+this.id:"")+"]"}});Ext.data.Node=Ext.extend(Ext.util.Observable,{constructor:function(a){this.attributes=a||{};this.leaf=this.attributes.leaf;this.id=this.attributes.id;if(!this.id){this.id=Ext.id(null,"xnode-");this.attributes.id=this.id}this.childNodes=[];this.parentNode=null;this.firstChild=null;this.lastChild=null;this.previousSibling=null;this.nextSibling=null;this.addEvents({append:true,remove:true,move:true,insert:true,beforeappend:true,beforeremove:true,beforemove:true,beforeinsert:true});this.listeners=this.attributes.listeners;Ext.data.Node.superclass.constructor.call(this)},fireEvent:function(b){if(Ext.data.Node.superclass.fireEvent.apply(this,arguments)===false){return false}var a=this.getOwnerTree();if(a){if(a.proxyNodeEvent.apply(a,arguments)===false){return false}}return true},isLeaf:function(){return this.leaf===true},setFirstChild:function(a){this.firstChild=a},setLastChild:function(a){this.lastChild=a},isLast:function(){return(!this.parentNode?true:this.parentNode.lastChild==this)},isFirst:function(){return(!this.parentNode?true:this.parentNode.firstChild==this)},hasChildNodes:function(){return !this.isLeaf()&&this.childNodes.length>0},isExpandable:function(){return this.attributes.expandable||this.hasChildNodes()},appendChild:function(e){var g=false;if(Ext.isArray(e)){g=e}else{if(arguments.length>1){g=arguments}}if(g){for(var d=0,a=g.length;d<a;d++){this.appendChild(g[d])}}else{if(this.fireEvent("beforeappend",this.ownerTree,this,e)===false){return false}var b=this.childNodes.length;var c=e.parentNode;if(c){if(e.fireEvent("beforemove",e.getOwnerTree(),e,c,this,b)===false){return false}c.removeChild(e)}b=this.childNodes.length;if(b===0){this.setFirstChild(e)}this.childNodes.push(e);e.parentNode=this;var h=this.childNodes[b-1];if(h){e.previousSibling=h;h.nextSibling=e}else{e.previousSibling=null}e.nextSibling=null;this.setLastChild(e);e.setOwnerTree(this.getOwnerTree());this.fireEvent("append",this.ownerTree,this,e,b);if(c){e.fireEvent("move",this.ownerTree,e,c,this,b)}return e}},removeChild:function(c,b){var a=this.childNodes.indexOf(c);if(a==-1){return false}if(this.fireEvent("beforeremove",this.ownerTree,this,c)===false){return false}this.childNodes.splice(a,1);if(c.previousSibling){c.previousSibling.nextSibling=c.nextSibling}if(c.nextSibling){c.nextSibling.previousSibling=c.previousSibling}if(this.firstChild==c){this.setFirstChild(c.nextSibling)}if(this.lastChild==c){this.setLastChild(c.previousSibling)}this.fireEvent("remove",this.ownerTree,this,c);if(b){c.destroy(true)}else{c.clear()}return c},clear:function(a){this.setOwnerTree(null,a);this.parentNode=this.previousSibling=this.nextSibling=null;if(a){this.firstChild=this.lastChild=null}},destroy:function(a){if(a===true){this.purgeListeners();this.clear(true);Ext.each(this.childNodes,function(b){b.destroy(true)});this.childNodes=null}else{this.remove(true)}},insertBefore:function(d,a){if(!a){return this.appendChild(d)}if(d==a){return false}if(this.fireEvent("beforeinsert",this.ownerTree,this,d,a)===false){return false}var b=this.childNodes.indexOf(a);var c=d.parentNode;var e=b;if(c==this&&this.childNodes.indexOf(d)<b){e--}if(c){if(d.fireEvent("beforemove",d.getOwnerTree(),d,c,this,b,a)===false){return false}c.removeChild(d)}if(e===0){this.setFirstChild(d)}this.childNodes.splice(e,0,d);d.parentNode=this;var g=this.childNodes[e-1];if(g){d.previousSibling=g;g.nextSibling=d}else{d.previousSibling=null}d.nextSibling=a;a.previousSibling=d;d.setOwnerTree(this.getOwnerTree());this.fireEvent("insert",this.ownerTree,this,d,a);if(c){d.fireEvent("move",this.ownerTree,d,c,this,e,a)}return d},remove:function(a){if(this.parentNode){this.parentNode.removeChild(this,a)}return this},removeAll:function(a){var c=this.childNodes,b;while((b=c[0])){this.removeChild(b,a)}return this},item:function(a){return this.childNodes[a]},replaceChild:function(a,c){var b=c?c.nextSibling:null;this.removeChild(c);this.insertBefore(a,b);return c},indexOf:function(a){return this.childNodes.indexOf(a)},getOwnerTree:function(){if(!this.ownerTree){var a=this;while(a){if(a.ownerTree){this.ownerTree=a.ownerTree;break}a=a.parentNode}}return this.ownerTree},getDepth:function(){var b=0;var a=this;while(a.parentNode){++b;a=a.parentNode}return b},setOwnerTree:function(a,b){if(a!=this.ownerTree){if(this.ownerTree){this.ownerTree.unregisterNode(this)}this.ownerTree=a;if(b!==true){Ext.each(this.childNodes,function(c){c.setOwnerTree(a)})}if(a){a.registerNode(this)}}},setId:function(b){if(b!==this.id){var a=this.ownerTree;if(a){a.unregisterNode(this)}this.id=this.attributes.id=b;if(a){a.registerNode(this)}this.onIdChange(b)}},onIdChange:Ext.emptyFn,getPath:function(c){c=c||"id";var e=this.parentNode;var a=[this.attributes[c]];while(e){a.unshift(e.attributes[c]);e=e.parentNode}var d=this.getOwnerTree().pathSeparator;return d+a.join(d)},bubble:function(c,b,a){var d=this;while(d){if(c.apply(b||d,a||[d])===false){break}d=d.parentNode}},cascade:function(g,e,b){if(g.apply(e||this,b||[this])!==false){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].cascade(g,e,b)}}},eachChild:function(g,e,b){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){if(g.apply(e||d[c],b||[d[c]])===false){break}}},findChild:function(b,c,a){return this.findChildBy(function(){return this.attributes[b]==c},null,a)},findChildBy:function(h,g,b){var e=this.childNodes,a=e.length,d=0,k,c;for(;d<a;d++){k=e[d];if(h.call(g||k,k)===true){return k}else{if(b){c=k.findChildBy(h,g,b);if(c!=null){return c}}}}return null},sort:function(e,d){var c=this.childNodes;var a=c.length;if(a>0){var g=d?function(){e.apply(d,arguments)}:e;c.sort(g);for(var b=0;b<a;b++){var h=c[b];h.previousSibling=c[b-1];h.nextSibling=c[b+1];if(b===0){this.setFirstChild(h)}if(b==a-1){this.setLastChild(h)}}}},contains:function(a){return a.isAncestor(this)},isAncestor:function(a){var b=this.parentNode;while(b){if(b==a){return true}b=b.parentNode}return false},toString:function(){return"[Node"+(this.id?" "+this.id:"")+"]"}});Ext.tree.TreeNode=Ext.extend(Ext.data.Node,{constructor:function(a){a=a||{};if(Ext.isString(a)){a={text:a}}this.childrenRendered=false;this.rendered=false;Ext.tree.TreeNode.superclass.constructor.call(this,a);this.expanded=a.expanded===true;this.isTarget=a.isTarget!==false;this.draggable=a.draggable!==false&&a.allowDrag!==false;this.allowChildren=a.allowChildren!==false&&a.allowDrop!==false;this.text=a.text;this.disabled=a.disabled===true;this.hidden=a.hidden===true;this.addEvents("textchange","beforeexpand","beforecollapse","expand","disabledchange","collapse","beforeclick","click","checkchange","beforedblclick","dblclick","contextmenu","beforechildrenrendered");var b=this.attributes.uiProvider||this.defaultUI||Ext.tree.TreeNodeUI;this.ui=new b(this)},preventHScroll:true,isExpanded:function(){return this.expanded},getUI:function(){return this.ui},getLoader:function(){var a;return this.loader||((a=this.getOwnerTree())&&a.loader?a.loader:(this.loader=new Ext.tree.TreeLoader()))},setFirstChild:function(a){var b=this.firstChild;Ext.tree.TreeNode.superclass.setFirstChild.call(this,a);if(this.childrenRendered&&b&&a!=b){b.renderIndent(true,true)}if(this.rendered){this.renderIndent(true,true)}},setLastChild:function(b){var a=this.lastChild;Ext.tree.TreeNode.superclass.setLastChild.call(this,b);if(this.childrenRendered&&a&&b!=a){a.renderIndent(true,true)}if(this.rendered){this.renderIndent(true,true)}},appendChild:function(b){if(!b.render&&!Ext.isArray(b)){b=this.getLoader().createNode(b)}var a=Ext.tree.TreeNode.superclass.appendChild.call(this,b);if(a&&this.childrenRendered){a.render()}this.ui.updateExpandIcon();return a},removeChild:function(b,a){this.ownerTree.getSelectionModel().unselect(b);Ext.tree.TreeNode.superclass.removeChild.apply(this,arguments);if(!a){var c=b.ui.rendered;if(c){b.ui.remove()}if(c&&this.childNodes.length<1){this.collapse(false,false)}else{this.ui.updateExpandIcon()}if(!this.firstChild&&!this.isHiddenRoot()){this.childrenRendered=false}}return b},insertBefore:function(c,a){if(!c.render){c=this.getLoader().createNode(c)}var b=Ext.tree.TreeNode.superclass.insertBefore.call(this,c,a);if(b&&a&&this.childrenRendered){c.render()}this.ui.updateExpandIcon();return b},setText:function(b){var a=this.text;this.text=this.attributes.text=b;if(this.rendered){this.ui.onTextChange(this,b,a)}this.fireEvent("textchange",this,b,a)},setIconCls:function(b){var a=this.attributes.iconCls;this.attributes.iconCls=b;if(this.rendered){this.ui.onIconClsChange(this,b,a)}},setTooltip:function(a,b){this.attributes.qtip=a;this.attributes.qtipTitle=b;if(this.rendered){this.ui.onTipChange(this,a,b)}},setIcon:function(a){this.attributes.icon=a;if(this.rendered){this.ui.onIconChange(this,a)}},setHref:function(a,b){this.attributes.href=a;this.attributes.hrefTarget=b;if(this.rendered){this.ui.onHrefChange(this,a,b)}},setCls:function(b){var a=this.attributes.cls;this.attributes.cls=b;if(this.rendered){this.ui.onClsChange(this,b,a)}},select:function(){var a=this.getOwnerTree();if(a){a.getSelectionModel().select(this)}},unselect:function(a){var b=this.getOwnerTree();if(b){b.getSelectionModel().unselect(this,a)}},isSelected:function(){var a=this.getOwnerTree();return a?a.getSelectionModel().isSelected(this):false},expand:function(a,c,d,b){if(!this.expanded){if(this.fireEvent("beforeexpand",this,a,c)===false){return}if(!this.childrenRendered){this.renderChildren()}this.expanded=true;if(!this.isHiddenRoot()&&(this.getOwnerTree().animate&&c!==false)||c){this.ui.animExpand(function(){this.fireEvent("expand",this);this.runCallback(d,b||this,[this]);if(a===true){this.expandChildNodes(true,true)}}.createDelegate(this));return}else{this.ui.expand();this.fireEvent("expand",this);this.runCallback(d,b||this,[this])}}else{this.runCallback(d,b||this,[this])}if(a===true){this.expandChildNodes(true)}},runCallback:function(a,c,b){if(Ext.isFunction(a)){a.apply(c,b)}},isHiddenRoot:function(){return this.isRoot&&!this.getOwnerTree().rootVisible},collapse:function(b,g,h,e){if(this.expanded&&!this.isHiddenRoot()){if(this.fireEvent("beforecollapse",this,b,g)===false){return}this.expanded=false;if((this.getOwnerTree().animate&&g!==false)||g){this.ui.animCollapse(function(){this.fireEvent("collapse",this);this.runCallback(h,e||this,[this]);if(b===true){this.collapseChildNodes(true)}}.createDelegate(this));return}else{this.ui.collapse();this.fireEvent("collapse",this);this.runCallback(h,e||this,[this])}}else{if(!this.expanded){this.runCallback(h,e||this,[this])}}if(b===true){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].collapse(true,false)}}},delayedExpand:function(a){if(!this.expandProcId){this.expandProcId=this.expand.defer(a,this)}},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId)}this.expandProcId=false},toggle:function(){if(this.expanded){this.collapse()}else{this.expand()}},ensureVisible:function(c,b){var a=this.getOwnerTree();a.expandPath(this.parentNode?this.parentNode.getPath():this.getPath(),false,function(){var d=a.getNodeById(this.id);a.getTreeEl().scrollChildIntoView(d.ui.anchor);this.runCallback(c,b||this,[this])}.createDelegate(this))},expandChildNodes:function(b,e){var d=this.childNodes,c,a=d.length;for(c=0;c<a;c++){d[c].expand(b,e)}},collapseChildNodes:function(b){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].collapse(b)}},disable:function(){this.disabled=true;this.unselect();if(this.rendered&&this.ui.onDisableChange){this.ui.onDisableChange(this,true)}this.fireEvent("disabledchange",this,true)},enable:function(){this.disabled=false;if(this.rendered&&this.ui.onDisableChange){this.ui.onDisableChange(this,false)}this.fireEvent("disabledchange",this,false)},renderChildren:function(b){if(b!==false){this.fireEvent("beforechildrenrendered",this)}var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].render(true)}this.childrenRendered=true},sort:function(e,d){Ext.tree.TreeNode.superclass.sort.apply(this,arguments);if(this.childrenRendered){var c=this.childNodes;for(var b=0,a=c.length;b<a;b++){c[b].render(true)}}},render:function(a){this.ui.render(a);if(!this.rendered){this.getOwnerTree().registerNode(this);this.rendered=true;if(this.expanded){this.expanded=false;this.expand(false,false)}}},renderIndent:function(b,e){if(e){this.ui.childIndent=null}this.ui.renderIndent();if(b===true&&this.childrenRendered){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].renderIndent(true,e)}}},beginUpdate:function(){this.childrenRendered=false},endUpdate:function(){if(this.expanded&&this.rendered){this.renderChildren()}},destroy:function(a){if(a===true){this.unselect(true)}Ext.tree.TreeNode.superclass.destroy.call(this,a);Ext.destroy(this.ui,this.loader);this.ui=this.loader=null},onIdChange:function(a){this.ui.onIdChange(a)}});Ext.tree.TreePanel.nodeTypes.node=Ext.tree.TreeNode;Ext.tree.AsyncTreeNode=function(a){this.loaded=a&&a.loaded===true;this.loading=false;Ext.tree.AsyncTreeNode.superclass.constructor.apply(this,arguments);this.addEvents("beforeload","load")};Ext.extend(Ext.tree.AsyncTreeNode,Ext.tree.TreeNode,{expand:function(b,e,h,c){if(this.loading){var g;var d=function(){if(!this.loading){clearInterval(g);this.expand(b,e,h,c)}}.createDelegate(this);g=setInterval(d,200);return}if(!this.loaded){if(this.fireEvent("beforeload",this)===false){return}this.loading=true;this.ui.beforeLoad(this);var a=this.loader||this.attributes.loader||this.getOwnerTree().getLoader();if(a){a.load(this,this.loadComplete.createDelegate(this,[b,e,h,c]),this);return}}Ext.tree.AsyncTreeNode.superclass.expand.call(this,b,e,h,c)},isLoading:function(){return this.loading},loadComplete:function(a,c,d,b){this.loading=false;this.loaded=true;this.ui.afterLoad(this);this.fireEvent("load",this);this.expand(a,c,d,b)},isLoaded:function(){return this.loaded},hasChildNodes:function(){if(!this.isLeaf()&&!this.loaded){return true}else{return Ext.tree.AsyncTreeNode.superclass.hasChildNodes.call(this)}},reload:function(b,a){this.collapse(false,false);while(this.firstChild){this.removeChild(this.firstChild).destroy()}this.childrenRendered=false;this.loaded=false;if(this.isHiddenRoot()){this.expanded=false}this.expand(false,false,b,a)}});Ext.tree.TreePanel.nodeTypes.async=Ext.tree.AsyncTreeNode;Ext.tree.TreeNodeUI=Ext.extend(Object,{constructor:function(a){Ext.apply(this,{node:a,rendered:false,animating:false,wasLeaf:true,ecc:"x-tree-ec-icon x-tree-elbow",emptyIcon:Ext.BLANK_IMAGE_URL})},removeChild:function(a){if(this.rendered){this.ctNode.removeChild(a.ui.getEl())}},beforeLoad:function(){this.addClass("x-tree-node-loading")},afterLoad:function(){this.removeClass("x-tree-node-loading")},onTextChange:function(b,c,a){if(this.rendered){this.textNode.innerHTML=c}},onIconClsChange:function(c,a,b){if(this.rendered){Ext.fly(this.iconNode).replaceClass(b,a)}},onIconChange:function(b,a){if(this.rendered){var c=Ext.isEmpty(a);this.iconNode.src=c?this.emptyIcon:a;Ext.fly(this.iconNode)[c?"removeClass":"addClass"]("x-tree-node-inline-icon")}},onTipChange:function(b,c,d){if(this.rendered){var a=Ext.isDefined(d);if(this.textNode.setAttributeNS){this.textNode.setAttributeNS("ext","qtip",c);if(a){this.textNode.setAttributeNS("ext","qtitle",d)}}else{this.textNode.setAttribute("ext:qtip",c);if(a){this.textNode.setAttribute("ext:qtitle",d)}}}},onHrefChange:function(b,a,c){if(this.rendered){this.anchor.href=this.getHref(a);if(Ext.isDefined(c)){this.anchor.target=c}}},onClsChange:function(c,a,b){if(this.rendered){Ext.fly(this.elNode).replaceClass(b,a)}},onDisableChange:function(a,b){this.disabled=b;if(this.checkbox){this.checkbox.disabled=b}this[b?"addClass":"removeClass"]("x-tree-node-disabled")},onSelectedChange:function(a){if(a){this.focus();this.addClass("x-tree-selected")}else{this.removeClass("x-tree-selected")}},onMove:function(a,h,e,g,d,b){this.childIndent=null;if(this.rendered){var i=g.ui.getContainer();if(!i){this.holder=document.createElement("div");this.holder.appendChild(this.wrap);return}var c=b?b.ui.getEl():null;if(c){i.insertBefore(this.wrap,c)}else{i.appendChild(this.wrap)}this.node.renderIndent(true,e!=g)}},addClass:function(a){if(this.elNode){Ext.fly(this.elNode).addClass(a)}},removeClass:function(a){if(this.elNode){Ext.fly(this.elNode).removeClass(a)}},remove:function(){if(this.rendered){this.holder=document.createElement("div");this.holder.appendChild(this.wrap)}},fireEvent:function(){return this.node.fireEvent.apply(this.node,arguments)},initEvents:function(){this.node.on("move",this.onMove,this);if(this.node.disabled){this.onDisableChange(this.node,true)}if(this.node.hidden){this.hide()}var b=this.node.getOwnerTree();var a=b.enableDD||b.enableDrag||b.enableDrop;if(a&&(!this.node.isRoot||b.rootVisible)){Ext.dd.Registry.register(this.elNode,{node:this.node,handles:this.getDDHandles(),isHandle:false})}},getDDHandles:function(){return[this.iconNode,this.textNode,this.elNode]},hide:function(){this.node.hidden=true;if(this.wrap){this.wrap.style.display="none"}},show:function(){this.node.hidden=false;if(this.wrap){this.wrap.style.display=""}},onContextMenu:function(a){if(this.node.hasListener("contextmenu")||this.node.getOwnerTree().hasListener("contextmenu")){a.preventDefault();this.focus();this.fireEvent("contextmenu",this.node,a)}},onClick:function(c){if(this.dropping){c.stopEvent();return}if(this.fireEvent("beforeclick",this.node,c)!==false){var b=c.getTarget("a");if(!this.disabled&&this.node.attributes.href&&b){this.fireEvent("click",this.node,c);return}else{if(b&&c.ctrlKey){c.stopEvent()}}c.preventDefault();if(this.disabled){return}if(this.node.attributes.singleClickExpand&&!this.animating&&this.node.isExpandable()){this.node.toggle()}this.fireEvent("click",this.node,c)}else{c.stopEvent()}},onDblClick:function(a){a.preventDefault();if(this.disabled){return}if(this.fireEvent("beforedblclick",this.node,a)!==false){if(this.checkbox){this.toggleCheck()}if(!this.animating&&this.node.isExpandable()){this.node.toggle()}this.fireEvent("dblclick",this.node,a)}},onOver:function(a){this.addClass("x-tree-node-over")},onOut:function(a){this.removeClass("x-tree-node-over")},onCheckChange:function(){var a=this.checkbox.checked;this.checkbox.defaultChecked=a;this.node.attributes.checked=a;this.fireEvent("checkchange",this.node,a)},ecClick:function(a){if(!this.animating&&this.node.isExpandable()){this.node.toggle()}},startDrop:function(){this.dropping=true},endDrop:function(){setTimeout(function(){this.dropping=false}.createDelegate(this),50)},expand:function(){this.updateExpandIcon();this.ctNode.style.display=""},focus:function(){if(!this.node.preventHScroll){try{this.anchor.focus()}catch(c){}}else{try{var b=this.node.getOwnerTree().getTreeEl().dom;var a=b.scrollLeft;this.anchor.focus();b.scrollLeft=a}catch(c){}}},toggleCheck:function(b){var a=this.checkbox;if(a){a.checked=(b===undefined?!a.checked:b);this.onCheckChange()}},blur:function(){try{this.anchor.blur()}catch(a){}},animExpand:function(b){var a=Ext.get(this.ctNode);a.stopFx();if(!this.node.isExpandable()){this.updateExpandIcon();this.ctNode.style.display="";Ext.callback(b);return}this.animating=true;this.updateExpandIcon();a.slideIn("t",{callback:function(){this.animating=false;Ext.callback(b)},scope:this,duration:this.node.ownerTree.duration||0.25})},highlight:function(){var a=this.node.getOwnerTree();Ext.fly(this.wrap).highlight(a.hlColor||"C3DAF9",{endColor:a.hlBaseColor})},collapse:function(){this.updateExpandIcon();this.ctNode.style.display="none"},animCollapse:function(b){var a=Ext.get(this.ctNode);a.enableDisplayMode("block");a.stopFx();this.animating=true;this.updateExpandIcon();a.slideOut("t",{callback:function(){this.animating=false;Ext.callback(b)},scope:this,duration:this.node.ownerTree.duration||0.25})},getContainer:function(){return this.ctNode},getEl:function(){return this.wrap},appendDDGhost:function(a){a.appendChild(this.elNode.cloneNode(true))},getDDRepairXY:function(){return Ext.lib.Dom.getXY(this.iconNode)},onRender:function(){this.render()},render:function(c){var e=this.node,b=e.attributes;var d=e.parentNode?e.parentNode.ui.getContainer():e.ownerTree.innerCt.dom;if(!this.rendered){this.rendered=true;this.renderElements(e,b,d,c);if(b.qtip){this.onTipChange(e,b.qtip,b.qtipTitle)}else{if(b.qtipCfg){b.qtipCfg.target=Ext.id(this.textNode);Ext.QuickTips.register(b.qtipCfg)}}this.initEvents();if(!this.node.expanded){this.updateExpandIcon(true)}}else{if(c===true){d.appendChild(this.wrap)}}},renderElements:function(e,l,k,m){this.indentMarkup=e.parentNode?e.parentNode.ui.getChildIndent():"";var g=Ext.isBoolean(l.checked),b,c=this.getHref(l.href),d=['<li class="x-tree-node"><div ext:tree-node-id="',e.id,'" class="x-tree-node-el x-tree-node-leaf x-unselectable ',l.cls,'" unselectable="on">','<span class="x-tree-node-indent">',this.indentMarkup,"</span>",'<img alt="" src="',this.emptyIcon,'" class="x-tree-ec-icon x-tree-elbow" />','<img alt="" src="',l.icon||this.emptyIcon,'" class="x-tree-node-icon',(l.icon?" x-tree-node-inline-icon":""),(l.iconCls?" "+l.iconCls:""),'" unselectable="on" />',g?('<input class="x-tree-node-cb" type="checkbox" '+(l.checked?'checked="checked" />':"/>")):"",'<a hidefocus="on" class="x-tree-node-anchor" href="',c,'" tabIndex="1" ',l.hrefTarget?' target="'+l.hrefTarget+'"':"",'><span unselectable="on">',e.text,"</span></a></div>",'<ul class="x-tree-node-ct" style="display:none;"></ul>',"</li>"].join("");if(m!==true&&e.nextSibling&&(b=e.nextSibling.ui.getEl())){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",b,d)}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",k,d)}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var i=this.elNode.childNodes;this.indentNode=i[0];this.ecNode=i[1];this.iconNode=i[2];var h=3;if(g){this.checkbox=i[3];this.checkbox.defaultChecked=this.checkbox.checked;h++}this.anchor=i[h];this.textNode=i[h].firstChild},getHref:function(a){return Ext.isEmpty(a)?(Ext.isGecko?"":"#"):a},getAnchor:function(){return this.anchor},getTextEl:function(){return this.textNode},getIconEl:function(){return this.iconNode},isChecked:function(){return this.checkbox?this.checkbox.checked:false},updateExpandIcon:function(){if(this.rendered){var g=this.node,d,c,a=g.isLast()?"x-tree-elbow-end":"x-tree-elbow",e=g.hasChildNodes();if(e||g.attributes.expandable){if(g.expanded){a+="-minus";d="x-tree-node-collapsed";c="x-tree-node-expanded"}else{a+="-plus";d="x-tree-node-expanded";c="x-tree-node-collapsed"}if(this.wasLeaf){this.removeClass("x-tree-node-leaf");this.wasLeaf=false}if(this.c1!=d||this.c2!=c){Ext.fly(this.elNode).replaceClass(d,c);this.c1=d;this.c2=c}}else{if(!this.wasLeaf){Ext.fly(this.elNode).replaceClass("x-tree-node-expanded","x-tree-node-collapsed");delete this.c1;delete this.c2;this.wasLeaf=true}}var b="x-tree-ec-icon "+a;if(this.ecc!=b){this.ecNode.className=b;this.ecc=b}}},onIdChange:function(a){if(this.rendered){this.elNode.setAttribute("ext:tree-node-id",a)}},getChildIndent:function(){if(!this.childIndent){var a=[],b=this.node;while(b){if(!b.isRoot||(b.isRoot&&b.ownerTree.rootVisible)){if(!b.isLast()){a.unshift('<img alt="" src="'+this.emptyIcon+'" class="x-tree-elbow-line" />')}else{a.unshift('<img alt="" src="'+this.emptyIcon+'" class="x-tree-icon" />')}}b=b.parentNode}this.childIndent=a.join("")}return this.childIndent},renderIndent:function(){if(this.rendered){var a="",b=this.node.parentNode;if(b){a=b.ui.getChildIndent()}if(this.indentMarkup!=a){this.indentNode.innerHTML=a;this.indentMarkup=a}this.updateExpandIcon()}},destroy:function(){if(this.elNode){Ext.dd.Registry.unregister(this.elNode.id)}Ext.each(["textnode","anchor","checkbox","indentNode","ecNode","iconNode","elNode","ctNode","wrap","holder"],function(a){if(this[a]){Ext.fly(this[a]).remove();delete this[a]}},this);delete this.node}});Ext.tree.RootTreeNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{render:function(){if(!this.rendered){var a=this.node.ownerTree.innerCt.dom;this.node.expanded=true;a.innerHTML='<div class="x-tree-root-node"></div>';this.wrap=this.ctNode=a.firstChild}},collapse:Ext.emptyFn,expand:Ext.emptyFn});Ext.tree.TreeLoader=function(a){this.baseParams={};Ext.apply(this,a);this.addEvents("beforeload","load","loadexception");Ext.tree.TreeLoader.superclass.constructor.call(this);if(Ext.isString(this.paramOrder)){this.paramOrder=this.paramOrder.split(/[\s,|]/)}};Ext.extend(Ext.tree.TreeLoader,Ext.util.Observable,{uiProviders:{},clearOnLoad:true,paramOrder:undefined,paramsAsHash:false,nodeParameter:"node",directFn:undefined,load:function(b,c,a){if(this.clearOnLoad){while(b.firstChild){b.removeChild(b.firstChild)}}if(this.doPreload(b)){this.runCallback(c,a||b,[b])}else{if(this.directFn||this.dataUrl||this.url){this.requestData(b,c,a||b)}}},doPreload:function(d){if(d.attributes.children){if(d.childNodes.length<1){var c=d.attributes.children;d.beginUpdate();for(var b=0,a=c.length;b<a;b++){var e=d.appendChild(this.createNode(c[b]));if(this.preloadChildren){this.doPreload(e)}}d.endUpdate()}return true}return false},getParams:function(g){var e=Ext.apply({},this.baseParams),h=this.nodeParameter,b=this.paramOrder;h&&(e[h]=g.id);if(this.directFn){var c=[g.id];if(b){if(h&&b.indexOf(h)>-1){c=[]}for(var d=0,a=b.length;d<a;d++){c.push(e[b[d]])}}else{if(this.paramsAsHash){c=[e]}}return c}else{return e}},requestData:function(c,d,b){if(this.fireEvent("beforeload",this,c,d)!==false){if(this.directFn){var a=this.getParams(c);a.push(this.processDirectResponse.createDelegate(this,[{callback:d,node:c,scope:b}],true));this.directFn.apply(window,a)}else{this.transId=Ext.Ajax.request({method:this.requestMethod,url:this.dataUrl||this.url,success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{callback:d,node:c,scope:b},params:this.getParams(c)})}}else{this.runCallback(d,b||c,[])}},processDirectResponse:function(a,b,c){if(b.status){this.handleResponse({responseData:Ext.isArray(a)?a:null,responseText:a,argument:c})}else{this.handleFailure({argument:c})}},runCallback:function(a,c,b){if(Ext.isFunction(a)){a.apply(c,b)}},isLoading:function(){return !!this.transId},abort:function(){if(this.isLoading()){Ext.Ajax.abort(this.transId)}},createNode:function(attr){if(this.baseAttrs){Ext.applyIf(attr,this.baseAttrs)}if(this.applyLoader!==false&&!attr.loader){attr.loader=this}if(Ext.isString(attr.uiProvider)){attr.uiProvider=this.uiProviders[attr.uiProvider]||eval(attr.uiProvider)}if(attr.nodeType){return new Ext.tree.TreePanel.nodeTypes[attr.nodeType](attr)}else{return attr.leaf?new Ext.tree.TreeNode(attr):new Ext.tree.AsyncTreeNode(attr)}},processResponse:function(d,c,l,m){var p=d.responseText;try{var a=d.responseData||Ext.decode(p);c.beginUpdate();for(var g=0,h=a.length;g<h;g++){var b=this.createNode(a[g]);if(b){c.appendChild(b)}}c.endUpdate();this.runCallback(l,m||c,[c])}catch(k){this.handleFailure(d)}},handleResponse:function(c){this.transId=false;var b=c.argument;this.processResponse(c,b.node,b.callback,b.scope);this.fireEvent("load",this,b.node,c)},handleFailure:function(c){this.transId=false;var b=c.argument;this.fireEvent("loadexception",this,b.node,c);this.runCallback(b.callback,b.scope||b.node,[b.node])},destroy:function(){this.abort();this.purgeListeners()}});Ext.tree.TreeFilter=function(a,b){this.tree=a;this.filtered={};Ext.apply(this,b)};Ext.tree.TreeFilter.prototype={clearBlank:false,reverse:false,autoClear:false,remove:false,filter:function(d,a,b){a=a||"text";var c;if(typeof d=="string"){var e=d.length;if(e==0&&this.clearBlank){this.clear();return}d=d.toLowerCase();c=function(g){return g.attributes[a].substr(0,e).toLowerCase()==d}}else{if(d.exec){c=function(g){return d.test(g.attributes[a])}}else{throw"Illegal filter type, must be string or regex"}}this.filterBy(c,null,b)},filterBy:function(d,c,b){b=b||this.tree.root;if(this.autoClear){this.clear()}var a=this.filtered,i=this.reverse;var e=function(l){if(l==b){return true}if(a[l.id]){return false}var k=d.call(c||l,l);if(!k||i){a[l.id]=l;l.ui.hide();return false}return true};b.cascade(e);if(this.remove){for(var h in a){if(typeof h!="function"){var g=a[h];if(g&&g.parentNode){g.parentNode.removeChild(g)}}}}},clear:function(){var b=this.tree;var a=this.filtered;for(var d in a){if(typeof d!="function"){var c=a[d];if(c){c.ui.show()}}}this.filtered={}}};Ext.tree.TreeSorter=Ext.extend(Object,{constructor:function(a,b){Ext.apply(this,b);a.on({scope:this,beforechildrenrendered:this.doSort,append:this.updateSort,insert:this.updateSort,textchange:this.updateSortParent});var c=this.dir&&this.dir.toLowerCase()=="desc",d=this.property||"text";sortType=this.sortType;folderSort=this.folderSort;caseSensitive=this.caseSensitive===true;leafAttr=this.leafAttr||"leaf";if(Ext.isString(sortType)){sortType=Ext.data.SortTypes[sortType]}this.sortFn=function(l,i){var g=l.attributes,e=i.attributes;if(folderSort){if(g[leafAttr]&&!e[leafAttr]){return 1}if(!g[leafAttr]&&e[leafAttr]){return -1}}var k=g[d],h=e[d],m=sortType?sortType(k):(caseSensitive?k:k.toUpperCase());v2=sortType?sortType(h):(caseSensitive?h:h.toUpperCase());if(m<v2){return c?1:-1}else{if(m>v2){return c?-1:1}}return 0}},doSort:function(a){a.sort(this.sortFn)},updateSort:function(a,b){if(b.childrenRendered){this.doSort.defer(1,this,[b])}},updateSortParent:function(a){var b=a.parentNode;if(b&&b.childrenRendered){this.doSort.defer(1,this,[b])}}});if(Ext.dd.DropZone){Ext.tree.TreeDropZone=function(a,b){this.allowParentInsert=b.allowParentInsert||false;this.allowContainerDrop=b.allowContainerDrop||false;this.appendOnly=b.appendOnly||false;Ext.tree.TreeDropZone.superclass.constructor.call(this,a.getTreeEl(),b);this.tree=a;this.dragOverData={};this.lastInsertClass="x-tree-no-status"};Ext.extend(Ext.tree.TreeDropZone,Ext.dd.DropZone,{ddGroup:"TreeDD",expandDelay:1000,expandNode:function(a){if(a.hasChildNodes()&&!a.isExpanded()){a.expand(false,null,this.triggerCacheRefresh.createDelegate(this))}},queueExpand:function(a){this.expandProcId=this.expandNode.defer(this.expandDelay,this,[a])},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId);this.expandProcId=false}},isValidDropPoint:function(a,l,i,d,c){if(!a||!c){return false}var g=a.node;var h=c.node;if(!(g&&g.isTarget&&l)){return false}if(l=="append"&&g.allowChildren===false){return false}if((l=="above"||l=="below")&&(g.parentNode&&g.parentNode.allowChildren===false)){return false}if(h&&(g==h||h.contains(g))){return false}var b=this.dragOverData;b.tree=this.tree;b.target=g;b.data=c;b.point=l;b.source=i;b.rawEvent=d;b.dropNode=h;b.cancel=false;var k=this.tree.fireEvent("nodedragover",b);return b.cancel===false&&k!==false},getDropPoint:function(h,g,m){var o=g.node;if(o.isRoot){return o.allowChildren!==false?"append":false}var c=g.ddel;var p=Ext.lib.Dom.getY(c),k=p+c.offsetHeight;var i=Ext.lib.Event.getPageY(h);var l=o.allowChildren===false||o.isLeaf();if(this.appendOnly||o.parentNode.allowChildren===false){return l?false:"append"}var d=false;if(!this.allowParentInsert){d=o.hasChildNodes()&&o.isExpanded()}var a=(k-p)/(l?2:3);if(i>=p&&i<(p+a)){return"above"}else{if(!d&&(l||i>=k-a&&i<=k)){return"below"}else{return"append"}}},onNodeEnter:function(d,a,c,b){this.cancelExpand()},onContainerOver:function(a,c,b){if(this.allowContainerDrop&&this.isValidDropPoint({ddel:this.tree.getRootNode().ui.elNode,node:this.tree.getRootNode()},"append",a,c,b)){return this.dropAllowed}return this.dropNotAllowed},onNodeOver:function(b,i,h,g){var l=this.getDropPoint(h,b,i);var c=b.node;if(!this.expandProcId&&l=="append"&&c.hasChildNodes()&&!b.node.isExpanded()){this.queueExpand(c)}else{if(l!="append"){this.cancelExpand()}}var d=this.dropNotAllowed;if(this.isValidDropPoint(b,l,i,h,g)){if(l){var a=b.ddel;var k;if(l=="above"){d=b.node.isFirst()?"x-tree-drop-ok-above":"x-tree-drop-ok-between";k="x-tree-drag-insert-above"}else{if(l=="below"){d=b.node.isLast()?"x-tree-drop-ok-below":"x-tree-drop-ok-between";k="x-tree-drag-insert-below"}else{d="x-tree-drop-ok-append";k="x-tree-drag-append"}}if(this.lastInsertClass!=k){Ext.fly(a).replaceClass(this.lastInsertClass,k);this.lastInsertClass=k}}}return d},onNodeOut:function(d,a,c,b){this.cancelExpand();this.removeDropIndicators(d)},onNodeDrop:function(i,b,h,d){var a=this.getDropPoint(h,i,b);var g=i.node;g.ui.startDrop();if(!this.isValidDropPoint(i,a,b,h,d)){g.ui.endDrop();return false}var c=d.node||(b.getTreeNode?b.getTreeNode(d,g,a,h):null);return this.processDrop(g,d,a,b,h,c)},onContainerDrop:function(a,g,c){if(this.allowContainerDrop&&this.isValidDropPoint({ddel:this.tree.getRootNode().ui.elNode,node:this.tree.getRootNode()},"append",a,g,c)){var d=this.tree.getRootNode();d.ui.startDrop();var b=c.node||(a.getTreeNode?a.getTreeNode(c,d,"append",g):null);return this.processDrop(d,c,"append",a,g,b)}return false},processDrop:function(k,h,b,a,i,d){var g={tree:this.tree,target:k,data:h,point:b,source:a,rawEvent:i,dropNode:d,cancel:!d,dropStatus:false};var c=this.tree.fireEvent("beforenodedrop",g);if(c===false||g.cancel===true||!g.dropNode){k.ui.endDrop();return g.dropStatus}k=g.target;if(b=="append"&&!k.isExpanded()){k.expand(false,null,function(){this.completeDrop(g)}.createDelegate(this))}else{this.completeDrop(g)}return true},completeDrop:function(h){var d=h.dropNode,e=h.point,c=h.target;if(!Ext.isArray(d)){d=[d]}var g;for(var b=0,a=d.length;b<a;b++){g=d[b];if(e=="above"){c.parentNode.insertBefore(g,c)}else{if(e=="below"){c.parentNode.insertBefore(g,c.nextSibling)}else{c.appendChild(g)}}}g.ui.focus();if(Ext.enableFx&&this.tree.hlDrop){g.ui.highlight()}c.ui.endDrop();this.tree.fireEvent("nodedrop",h)},afterNodeMoved:function(a,c,g,d,b){if(Ext.enableFx&&this.tree.hlDrop){b.ui.focus();b.ui.highlight()}this.tree.fireEvent("nodedrop",this.tree,d,c,a,g)},getTree:function(){return this.tree},removeDropIndicators:function(b){if(b&&b.ddel){var a=b.ddel;Ext.fly(a).removeClass(["x-tree-drag-insert-above","x-tree-drag-insert-below","x-tree-drag-append"]);this.lastInsertClass="_noclass"}},beforeDragDrop:function(b,a,c){this.cancelExpand();return true},afterRepair:function(a){if(a&&Ext.enableFx){a.node.ui.highlight()}this.hideProxy()}})}if(Ext.dd.DragZone){Ext.tree.TreeDragZone=function(a,b){Ext.tree.TreeDragZone.superclass.constructor.call(this,a.innerCt,b);this.tree=a};Ext.extend(Ext.tree.TreeDragZone,Ext.dd.DragZone,{ddGroup:"TreeDD",onBeforeDrag:function(a,b){var c=a.node;return c&&c.draggable&&!c.disabled},onInitDrag:function(b){var a=this.dragData;this.tree.getSelectionModel().select(a.node);this.tree.eventModel.disable();this.proxy.update("");a.node.ui.appendDDGhost(this.proxy.ghost.dom);this.tree.fireEvent("startdrag",this.tree,a.node,b)},getRepairXY:function(b,a){return a.node.ui.getDDRepairXY()},onEndDrag:function(a,b){this.tree.eventModel.enable.defer(100,this.tree.eventModel);this.tree.fireEvent("enddrag",this.tree,a.node,b)},onValidDrop:function(a,b,c){this.tree.fireEvent("dragdrop",this.tree,this.dragData.node,a,b);this.hideProxy()},beforeInvalidDrop:function(a,c){var b=this.tree.getSelectionModel();b.clearSelections();b.select(this.dragData.node)},afterRepair:function(){if(Ext.enableFx&&this.tree.hlDrop){Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9")}this.dragging=false}})}Ext.tree.TreeEditor=function(a,c,b){c=c||{};var d=c.events?c:new Ext.form.TextField(c);Ext.tree.TreeEditor.superclass.constructor.call(this,d,b);this.tree=a;if(!a.rendered){a.on("render",this.initEditor,this)}else{this.initEditor(a)}};Ext.extend(Ext.tree.TreeEditor,Ext.Editor,{alignment:"l-l",autoSize:false,hideEl:false,cls:"x-small-editor x-tree-editor",shim:false,shadow:"frame",maxWidth:250,editDelay:350,initEditor:function(a){a.on({scope:this,beforeclick:this.beforeNodeClick,dblclick:this.onNodeDblClick});this.on({scope:this,complete:this.updateNode,beforestartedit:this.fitToTree,specialkey:this.onSpecialKey});this.on("startedit",this.bindScroll,this,{delay:10})},fitToTree:function(b,c){var e=this.tree.getTreeEl().dom,d=c.dom;if(e.scrollLeft>d.offsetLeft){e.scrollLeft=d.offsetLeft}var a=Math.min(this.maxWidth,(e.clientWidth>20?e.clientWidth:e.offsetWidth)-Math.max(0,d.offsetLeft-e.scrollLeft)-5);this.setSize(a,"")},triggerEdit:function(a,c){this.completeEdit();if(a.attributes.editable!==false){this.editNode=a;if(this.tree.autoScroll){Ext.fly(a.ui.getEl()).scrollIntoView(this.tree.body)}var b=a.text||"";if(!Ext.isGecko&&Ext.isEmpty(a.text)){a.setText("&#160;")}this.autoEditTimer=this.startEdit.defer(this.editDelay,this,[a.ui.textNode,b]);return false}},bindScroll:function(){this.tree.getTreeEl().on("scroll",this.cancelEdit,this)},beforeNodeClick:function(a,b){clearTimeout(this.autoEditTimer);if(this.tree.getSelectionModel().isSelected(a)){b.stopEvent();return this.triggerEdit(a)}},onNodeDblClick:function(a,b){clearTimeout(this.autoEditTimer)},updateNode:function(a,b){this.tree.getTreeEl().un("scroll",this.cancelEdit,this);this.editNode.setText(b)},onHide:function(){Ext.tree.TreeEditor.superclass.onHide.call(this);if(this.editNode){this.editNode.ui.focus.defer(50,this.editNode.ui)}},onSpecialKey:function(c,b){var a=b.getKey();if(a==b.ESC){b.stopEvent();this.cancelEdit()}else{if(a==b.ENTER&&!b.hasModifier()){b.stopEvent();this.completeEdit()}}},onDestroy:function(){clearTimeout(this.autoEditTimer);Ext.tree.TreeEditor.superclass.onDestroy.call(this);var a=this.tree;a.un("beforeclick",this.beforeNodeClick,this);a.un("dblclick",this.onNodeDblClick,this)}});
+/* SWFObject v2.2 <http://code.google.com/p/swfobject/>
+ is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
+*/
+var swfobject=function(){var F="undefined",t="object",U="Shockwave Flash",Y="ShockwaveFlash.ShockwaveFlash",s="application/x-shockwave-flash",T="SWFObjectExprInst",z="onreadystatechange",Q=window,l=document,v=navigator,V=false,W=[i],q=[],P=[],K=[],n,S,G,D,L=false,a=false,p,I,o=true,O=function(){var ac=typeof l.getElementById!=F&&typeof l.getElementsByTagName!=F&&typeof l.createElement!=F,aj=v.userAgent.toLowerCase(),aa=v.platform.toLowerCase(),ag=aa?(/win/).test(aa):/win/.test(aj),ae=aa?(/mac/).test(aa):/mac/.test(aj),ah=/webkit/.test(aj)?parseFloat(aj.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,Z=!+"\v1",ai=[0,0,0],ad=null;if(typeof v.plugins!=F&&typeof v.plugins[U]==t){ad=v.plugins[U].description;if(ad&&!(typeof v.mimeTypes!=F&&v.mimeTypes[s]&&!v.mimeTypes[s].enabledPlugin)){V=true;Z=false;ad=ad.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ai[0]=parseInt(ad.replace(/^(.*)\..*$/,"$1"),10);ai[1]=parseInt(ad.replace(/^.*\.(.*)\s.*$/,"$1"),10);ai[2]=/[a-zA-Z]/.test(ad)?parseInt(ad.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof Q.ActiveXObject!=F){try{var af=new ActiveXObject(Y);if(af){ad=af.GetVariable("$version");if(ad){Z=true;ad=ad.split(" ")[1].split(",");ai=[parseInt(ad[0],10),parseInt(ad[1],10),parseInt(ad[2],10)]}}}catch(ab){}}}return{w3:ac,pv:ai,wk:ah,ie:Z,win:ag,mac:ae}}(),m=function(){if(!O.w3){return}if((typeof l.readyState!=F&&l.readyState=="complete")||(typeof l.readyState==F&&(l.getElementsByTagName("body")[0]||l.body))){g()}if(!L){if(typeof l.addEventListener!=F){l.addEventListener("DOMContentLoaded",g,false)}if(O.ie&&O.win){l.attachEvent(z,function(){if(l.readyState=="complete"){l.detachEvent(z,arguments.callee);g()}});if(Q==top){(function(){if(L){return}try{l.documentElement.doScroll("left")}catch(Z){setTimeout(arguments.callee,0);return}g()})()}}if(O.wk){(function(){if(L){return}if(!(/loaded|complete/).test(l.readyState)){setTimeout(arguments.callee,0);return}g()})()}u(g)}}();function g(){if(L){return}try{var ab=l.getElementsByTagName("body")[0].appendChild(E("span"));ab.parentNode.removeChild(ab)}catch(ac){return}L=true;var Z=W.length;for(var aa=0;aa<Z;aa++){W[aa]()}}function M(Z){if(L){Z()}else{W[W.length]=Z}}function u(aa){if(typeof Q.addEventListener!=F){Q.addEventListener("load",aa,false)}else{if(typeof l.addEventListener!=F){l.addEventListener("load",aa,false)}else{if(typeof Q.attachEvent!=F){k(Q,"onload",aa)}else{if(typeof Q.onload=="function"){var Z=Q.onload;Q.onload=function(){Z();aa()}}else{Q.onload=aa}}}}}function i(){if(V){X()}else{J()}}function X(){var Z=l.getElementsByTagName("body")[0];var ac=E(t);ac.setAttribute("type",s);var ab=Z.appendChild(ac);if(ab){var aa=0;(function(){if(typeof ab.GetVariable!=F){var ad=ab.GetVariable("$version");if(ad){ad=ad.split(" ")[1].split(",");O.pv=[parseInt(ad[0],10),parseInt(ad[1],10),parseInt(ad[2],10)]}}else{if(aa<10){aa++;setTimeout(arguments.callee,10);return}}Z.removeChild(ac);ab=null;J()})()}else{J()}}function J(){var ai=q.length;if(ai>0){for(var ah=0;ah<ai;ah++){var aa=q[ah].id;var ad=q[ah].callbackFn;var ac={success:false,id:aa};if(O.pv[0]>0){var ag=c(aa);if(ag){if(H(q[ah].swfVersion)&&!(O.wk&&O.wk<312)){y(aa,true);if(ad){ac.success=true;ac.ref=B(aa);ad(ac)}}else{if(q[ah].expressInstall&&C()){var ak={};ak.data=q[ah].expressInstall;ak.width=ag.getAttribute("width")||"0";ak.height=ag.getAttribute("height")||"0";if(ag.getAttribute("class")){ak.styleclass=ag.getAttribute("class")}if(ag.getAttribute("align")){ak.align=ag.getAttribute("align")}var aj={};var Z=ag.getElementsByTagName("param");var ae=Z.length;for(var af=0;af<ae;af++){if(Z[af].getAttribute("name").toLowerCase()!="movie"){aj[Z[af].getAttribute("name")]=Z[af].getAttribute("value")}}R(ak,aj,aa,ad)}else{r(ag);if(ad){ad(ac)}}}}}else{y(aa,true);if(ad){var ab=B(aa);if(ab&&typeof ab.SetVariable!=F){ac.success=true;ac.ref=ab}ad(ac)}}}}}function B(ac){var Z=null;var aa=c(ac);if(aa&&aa.nodeName=="OBJECT"){if(typeof aa.SetVariable!=F){Z=aa}else{var ab=aa.getElementsByTagName(t)[0];if(ab){Z=ab}}}return Z}function C(){return !a&&H("6.0.65")&&(O.win||O.mac)&&!(O.wk&&O.wk<312)}function R(ac,ad,Z,ab){a=true;G=ab||null;D={success:false,id:Z};var ag=c(Z);if(ag){if(ag.nodeName=="OBJECT"){n=h(ag);S=null}else{n=ag;S=Z}ac.id=T;if(typeof ac.width==F||(!(/%$/).test(ac.width)&&parseInt(ac.width,10)<310)){ac.width="310"}if(typeof ac.height==F||(!(/%$/).test(ac.height)&&parseInt(ac.height,10)<137)){ac.height="137"}l.title=l.title.slice(0,47)+" - Flash Player Installation";var af=O.ie&&O.win?"ActiveX":"PlugIn",ae="MMredirectURL="+Q.location.toString().replace(/&/g,"%26")+"&MMplayerType="+af+"&MMdoctitle="+l.title;if(typeof ad.flashvars!=F){ad.flashvars+="&"+ae}else{ad.flashvars=ae}if(O.ie&&O.win&&ag.readyState!=4){var aa=E("div");Z+="SWFObjectNew";aa.setAttribute("id",Z);ag.parentNode.insertBefore(aa,ag);ag.style.display="none";(function(){if(ag.readyState==4){ag.parentNode.removeChild(ag)}else{setTimeout(arguments.callee,10)}})()}w(ac,ad,Z)}}function r(aa){if(O.ie&&O.win&&aa.readyState!=4){var Z=E("div");aa.parentNode.insertBefore(Z,aa);Z.parentNode.replaceChild(h(aa),Z);aa.style.display="none";(function(){if(aa.readyState==4){aa.parentNode.removeChild(aa)}else{setTimeout(arguments.callee,10)}})()}else{aa.parentNode.replaceChild(h(aa),aa)}}function h(ae){var ad=E("div");if(O.win&&O.ie){ad.innerHTML=ae.innerHTML}else{var aa=ae.getElementsByTagName(t)[0];if(aa){var af=aa.childNodes;if(af){var Z=af.length;for(var ab=0;ab<Z;ab++){if(!(af[ab].nodeType==1&&af[ab].nodeName=="PARAM")&&!(af[ab].nodeType==8)){ad.appendChild(af[ab].cloneNode(true))}}}}}return ad}function w(ak,ai,aa){var Z,ac=c(aa);if(O.wk&&O.wk<312){return Z}if(ac){if(typeof ak.id==F){ak.id=aa}if(O.ie&&O.win){var aj="";for(var ag in ak){if(ak[ag]!=Object.prototype[ag]){if(ag.toLowerCase()=="data"){ai.movie=ak[ag]}else{if(ag.toLowerCase()=="styleclass"){aj+=' class="'+ak[ag]+'"'}else{if(ag.toLowerCase()!="classid"){aj+=" "+ag+'="'+ak[ag]+'"'}}}}}var ah="";for(var af in ai){if(ai[af]!=Object.prototype[af]){ah+='<param name="'+af+'" value="'+ai[af]+'" />'}}ac.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+aj+">"+ah+"</object>";P[P.length]=ak.id;Z=c(ak.id)}else{var ab=E(t);ab.setAttribute("type",s);for(var ae in ak){if(ak[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="styleclass"){ab.setAttribute("class",ak[ae])}else{if(ae.toLowerCase()!="classid"){ab.setAttribute(ae,ak[ae])}}}}for(var ad in ai){if(ai[ad]!=Object.prototype[ad]&&ad.toLowerCase()!="movie"){e(ab,ad,ai[ad])}}ac.parentNode.replaceChild(ab,ac);Z=ab}}return Z}function e(ab,Z,aa){var ac=E("param");ac.setAttribute("name",Z);ac.setAttribute("value",aa);ab.appendChild(ac)}function A(aa){var Z=c(aa);if(Z&&Z.nodeName=="OBJECT"){if(O.ie&&O.win){Z.style.display="none";(function(){if(Z.readyState==4){b(aa)}else{setTimeout(arguments.callee,10)}})()}else{Z.parentNode.removeChild(Z)}}}function b(ab){var aa=c(ab);if(aa){for(var Z in aa){if(typeof aa[Z]=="function"){aa[Z]=null}}aa.parentNode.removeChild(aa)}}function c(ab){var Z=null;try{Z=l.getElementById(ab)}catch(aa){}return Z}function E(Z){return l.createElement(Z)}function k(ab,Z,aa){ab.attachEvent(Z,aa);K[K.length]=[ab,Z,aa]}function H(ab){var aa=O.pv,Z=ab.split(".");Z[0]=parseInt(Z[0],10);Z[1]=parseInt(Z[1],10)||0;Z[2]=parseInt(Z[2],10)||0;return(aa[0]>Z[0]||(aa[0]==Z[0]&&aa[1]>Z[1])||(aa[0]==Z[0]&&aa[1]==Z[1]&&aa[2]>=Z[2]))?true:false}function x(ae,aa,af,ad){if(O.ie&&O.mac){return}var ac=l.getElementsByTagName("head")[0];if(!ac){return}var Z=(af&&typeof af=="string")?af:"screen";if(ad){p=null;I=null}if(!p||I!=Z){var ab=E("style");ab.setAttribute("type","text/css");ab.setAttribute("media",Z);p=ac.appendChild(ab);if(O.ie&&O.win&&typeof l.styleSheets!=F&&l.styleSheets.length>0){p=l.styleSheets[l.styleSheets.length-1]}I=Z}if(O.ie&&O.win){if(p&&typeof p.addRule==t){p.addRule(ae,aa)}}else{if(p&&typeof l.createTextNode!=F){p.appendChild(l.createTextNode(ae+" {"+aa+"}"))}}}function y(ab,Z){if(!o){return}var aa=Z?"visible":"hidden";if(L&&c(ab)){c(ab).style.visibility=aa}else{x("#"+ab,"visibility:"+aa)}}function N(aa){var ab=/[\\\"<>\.;]/;var Z=ab.exec(aa)!=null;return Z&&typeof encodeURIComponent!=F?encodeURIComponent(aa):aa}var d=function(){if(O.ie&&O.win){window.attachEvent("onunload",function(){var ae=K.length;for(var ad=0;ad<ae;ad++){K[ad][0].detachEvent(K[ad][1],K[ad][2])}var ab=P.length;for(var ac=0;ac<ab;ac++){A(P[ac])}for(var aa in O){O[aa]=null}O=null;for(var Z in swfobject){swfobject[Z]=null}swfobject=null})}}();return{registerObject:function(ad,Z,ac,ab){if(O.w3&&ad&&Z){var aa={};aa.id=ad;aa.swfVersion=Z;aa.expressInstall=ac;aa.callbackFn=ab;q[q.length]=aa;y(ad,false)}else{if(ab){ab({success:false,id:ad})}}},getObjectById:function(Z){if(O.w3){return B(Z)}},embedSWF:function(ad,aj,ag,ai,aa,ac,ab,af,ah,ae){var Z={success:false,id:aj};if(O.w3&&!(O.wk&&O.wk<312)&&ad&&aj&&ag&&ai&&aa){y(aj,false);M(function(){ag+="";ai+="";var al={};if(ah&&typeof ah===t){for(var an in ah){al[an]=ah[an]}}al.data=ad;al.width=ag;al.height=ai;var ao={};if(af&&typeof af===t){for(var am in af){ao[am]=af[am]}}if(ab&&typeof ab===t){for(var ak in ab){if(typeof ao.flashvars!=F){ao.flashvars+="&"+ak+"="+ab[ak]}else{ao.flashvars=ak+"="+ab[ak]}}}if(H(aa)){var ap=w(al,ao,aj);if(al.id==aj){y(aj,true)}Z.success=true;Z.ref=ap}else{if(ac&&C()){al.data=ac;R(al,ao,aj,ae);return}else{y(aj,true)}}if(ae){ae(Z)}})}else{if(ae){ae(Z)}}},switchOffAutoHideShow:function(){o=false},ua:O,getFlashPlayerVersion:function(){return{major:O.pv[0],minor:O.pv[1],release:O.pv[2]}},hasFlashPlayerVersion:H,createSWF:function(ab,aa,Z){if(O.w3){return w(ab,aa,Z)}else{return undefined}},showExpressInstall:function(ab,ac,Z,aa){if(O.w3&&C()){R(ab,ac,Z,aa)}},removeSWF:function(Z){if(O.w3){A(Z)}},createCSS:function(ac,ab,aa,Z){if(O.w3){x(ac,ab,aa,Z)}},addDomLoadEvent:M,addLoadEvent:u,getQueryParamValue:function(ac){var ab=l.location.search||l.location.hash;if(ab){if(/\?/.test(ab)){ab=ab.split("?")[1]}if(ac==null){return N(ab)}var aa=ab.split("&");for(var Z=0;Z<aa.length;Z++){if(aa[Z].substring(0,aa[Z].indexOf("="))==ac){return N(aa[Z].substring((aa[Z].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var Z=c(T);if(Z&&n){Z.parentNode.replaceChild(n,Z);if(S){y(S,true);if(O.ie&&O.win){n.style.display="block"}}if(G){G(D)}}a=false}}}}();Ext.FlashComponent=Ext.extend(Ext.BoxComponent,{flashVersion:"9.0.115",backgroundColor:"#ffffff",wmode:"opaque",flashVars:undefined,flashParams:undefined,url:undefined,swfId:undefined,swfWidth:"100%",swfHeight:"100%",expressInstall:false,initComponent:function(){Ext.FlashComponent.superclass.initComponent.call(this);this.addEvents("initialize")},onRender:function(){Ext.FlashComponent.superclass.onRender.apply(this,arguments);var b=Ext.apply({allowScriptAccess:"always",bgcolor:this.backgroundColor,wmode:this.wmode},this.flashParams),a=Ext.apply({allowedDomain:document.location.hostname,YUISwfId:this.getId(),YUIBridgeCallback:"Ext.FlashEventProxy.onEvent"},this.flashVars);new swfobject.embedSWF(this.url,this.id,this.swfWidth,this.swfHeight,this.flashVersion,this.expressInstall?Ext.FlashComponent.EXPRESS_INSTALL_URL:undefined,a,b);this.swf=Ext.getDom(this.id);this.el=Ext.get(this.swf)},getSwfId:function(){return this.swfId||(this.swfId="extswf"+(++Ext.Component.AUTO_ID))},getId:function(){return this.id||(this.id="extflashcmp"+(++Ext.Component.AUTO_ID))},onFlashEvent:function(a){switch(a.type){case"swfReady":this.initSwf();return;case"log":return}a.component=this;this.fireEvent(a.type.toLowerCase().replace(/event$/,""),a)},initSwf:function(){this.onSwfReady(!!this.isInitialized);this.isInitialized=true;this.fireEvent("initialize",this)},beforeDestroy:function(){if(this.rendered){swfobject.removeSWF(this.swf.id)}Ext.FlashComponent.superclass.beforeDestroy.call(this)},onSwfReady:Ext.emptyFn});Ext.FlashComponent.EXPRESS_INSTALL_URL="http://swfobject.googlecode.com/svn/trunk/swfobject/expressInstall.swf";Ext.reg("flash",Ext.FlashComponent);Ext.FlashEventProxy={onEvent:function(c,b){var a=Ext.getCmp(c);if(a){a.onFlashEvent(b)}else{arguments.callee.defer(10,this,[c,b])}}};Ext.chart.Chart=Ext.extend(Ext.FlashComponent,{refreshBuffer:100,chartStyle:{padding:10,animationEnabled:true,font:{name:"Tahoma",color:4473924,size:11},dataTip:{padding:5,border:{color:10075112,size:1},background:{color:14346230,alpha:0.9},font:{name:"Tahoma",color:1393291,size:10,bold:true}}},extraStyle:null,seriesStyles:null,disableCaching:Ext.isIE||Ext.isOpera,disableCacheParam:"_dc",initComponent:function(){Ext.chart.Chart.superclass.initComponent.call(this);if(!this.url){this.url=Ext.chart.Chart.CHART_URL}if(this.disableCaching){this.url=Ext.urlAppend(this.url,String.format("{0}={1}",this.disableCacheParam,new Date().getTime()))}this.addEvents("itemmouseover","itemmouseout","itemclick","itemdoubleclick","itemdragstart","itemdrag","itemdragend","beforerefresh","refresh");this.store=Ext.StoreMgr.lookup(this.store)},setStyle:function(a,b){this.swf.setStyle(a,Ext.encode(b))},setStyles:function(a){this.swf.setStyles(Ext.encode(a))},setSeriesStyles:function(b){this.seriesStyles=b;var a=[];Ext.each(b,function(c){a.push(Ext.encode(c))});this.swf.setSeriesStyles(a)},setCategoryNames:function(a){this.swf.setCategoryNames(a)},setLegendRenderer:function(c,b){var a=this;b=b||a;a.removeFnProxy(a.legendFnName);a.legendFnName=a.createFnProxy(function(d){return c.call(b,d)});a.swf.setLegendLabelFunction(a.legendFnName)},setTipRenderer:function(c,b){var a=this;b=b||a;a.removeFnProxy(a.tipFnName);a.tipFnName=a.createFnProxy(function(h,e,g){var d=a.store.getAt(e);return c.call(b,a,d,e,g)});a.swf.setDataTipFunction(a.tipFnName)},setSeries:function(a){this.series=a;this.refresh()},bindStore:function(a,b){if(!b&&this.store){if(a!==this.store&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("datachanged",this.refresh,this);this.store.un("add",this.delayRefresh,this);this.store.un("remove",this.delayRefresh,this);this.store.un("update",this.delayRefresh,this);this.store.un("clear",this.refresh,this)}}if(a){a=Ext.StoreMgr.lookup(a);a.on({scope:this,datachanged:this.refresh,add:this.delayRefresh,remove:this.delayRefresh,update:this.delayRefresh,clear:this.refresh})}this.store=a;if(a&&!b){this.refresh()}},onSwfReady:function(b){Ext.chart.Chart.superclass.onSwfReady.call(this,b);var a;this.swf.setType(this.type);if(this.chartStyle){this.setStyles(Ext.apply({},this.extraStyle,this.chartStyle))}if(this.categoryNames){this.setCategoryNames(this.categoryNames)}if(this.tipRenderer){a=this.getFunctionRef(this.tipRenderer);this.setTipRenderer(a.fn,a.scope)}if(this.legendRenderer){a=this.getFunctionRef(this.legendRenderer);this.setLegendRenderer(a.fn,a.scope)}if(!b){this.bindStore(this.store,true)}this.refresh.defer(10,this)},delayRefresh:function(){if(!this.refreshTask){this.refreshTask=new Ext.util.DelayedTask(this.refresh,this)}this.refreshTask.delay(this.refreshBuffer)},refresh:function(){if(this.fireEvent("beforerefresh",this)!==false){var m=false;var k=[],c=this.store.data.items;for(var g=0,l=c.length;g<l;g++){k[g]=c[g].data}var e=[];var d=0;var n=null;var h=0;if(this.series){d=this.series.length;for(h=0;h<d;h++){n=this.series[h];var b={};for(var a in n){if(a=="style"&&n.style!==null){b.style=Ext.encode(n.style);m=true}else{b[a]=n[a]}}e.push(b)}}if(d>0){for(h=0;h<d;h++){n=e[h];if(!n.type){n.type=this.type}n.dataProvider=k}}else{e.push({type:this.type,dataProvider:k})}this.swf.setDataProvider(e);if(this.seriesStyles){this.setSeriesStyles(this.seriesStyles)}this.fireEvent("refresh",this)}},createFnProxy:function(a){var b="extFnProxy"+(++Ext.chart.Chart.PROXY_FN_ID);Ext.chart.Chart.proxyFunction[b]=a;return"Ext.chart.Chart.proxyFunction."+b},removeFnProxy:function(a){if(!Ext.isEmpty(a)){a=a.replace("Ext.chart.Chart.proxyFunction.","");delete Ext.chart.Chart.proxyFunction[a]}},getFunctionRef:function(a){if(Ext.isFunction(a)){return{fn:a,scope:this}}else{return{fn:a.fn,scope:a.scope||this}}},onDestroy:function(){if(this.refreshTask&&this.refreshTask.cancel){this.refreshTask.cancel()}Ext.chart.Chart.superclass.onDestroy.call(this);this.bindStore(null);this.removeFnProxy(this.tipFnName);this.removeFnProxy(this.legendFnName)}});Ext.reg("chart",Ext.chart.Chart);Ext.chart.Chart.PROXY_FN_ID=0;Ext.chart.Chart.proxyFunction={};Ext.chart.Chart.CHART_URL="http://yui.yahooapis.com/2.8.2/build/charts/assets/charts.swf";Ext.chart.PieChart=Ext.extend(Ext.chart.Chart,{type:"pie",onSwfReady:function(a){Ext.chart.PieChart.superclass.onSwfReady.call(this,a);this.setDataField(this.dataField);this.setCategoryField(this.categoryField)},setDataField:function(a){this.dataField=a;this.swf.setDataField(a)},setCategoryField:function(a){this.categoryField=a;this.swf.setCategoryField(a)}});Ext.reg("piechart",Ext.chart.PieChart);Ext.chart.CartesianChart=Ext.extend(Ext.chart.Chart,{onSwfReady:function(a){Ext.chart.CartesianChart.superclass.onSwfReady.call(this,a);this.labelFn=[];if(this.xField){this.setXField(this.xField)}if(this.yField){this.setYField(this.yField)}if(this.xAxis){this.setXAxis(this.xAxis)}if(this.xAxes){this.setXAxes(this.xAxes)}if(this.yAxis){this.setYAxis(this.yAxis)}if(this.yAxes){this.setYAxes(this.yAxes)}if(Ext.isDefined(this.constrainViewport)){this.swf.setConstrainViewport(this.constrainViewport)}},setXField:function(a){this.xField=a;this.swf.setHorizontalField(a)},setYField:function(a){this.yField=a;this.swf.setVerticalField(a)},setXAxis:function(a){this.xAxis=this.createAxis("xAxis",a);this.swf.setHorizontalAxis(this.xAxis)},setXAxes:function(c){var b;for(var a=0;a<c.length;a++){b=this.createAxis("xAxis"+a,c[a]);this.swf.setHorizontalAxis(b)}},setYAxis:function(a){this.yAxis=this.createAxis("yAxis",a);this.swf.setVerticalAxis(this.yAxis)},setYAxes:function(c){var b;for(var a=0;a<c.length;a++){b=this.createAxis("yAxis"+a,c[a]);this.swf.setVerticalAxis(b)}},createAxis:function(b,d){var e=Ext.apply({},d),c,a;if(this[b]){a=this[b].labelFunction;this.removeFnProxy(a);this.labelFn.remove(a)}if(e.labelRenderer){c=this.getFunctionRef(e.labelRenderer);e.labelFunction=this.createFnProxy(function(g){return c.fn.call(c.scope,g)});delete e.labelRenderer;this.labelFn.push(e.labelFunction)}if(b.indexOf("xAxis")>-1&&e.position=="left"){e.position="bottom"}return e},onDestroy:function(){Ext.chart.CartesianChart.superclass.onDestroy.call(this);Ext.each(this.labelFn,function(a){this.removeFnProxy(a)},this)}});Ext.reg("cartesianchart",Ext.chart.CartesianChart);Ext.chart.LineChart=Ext.extend(Ext.chart.CartesianChart,{type:"line"});Ext.reg("linechart",Ext.chart.LineChart);Ext.chart.ColumnChart=Ext.extend(Ext.chart.CartesianChart,{type:"column"});Ext.reg("columnchart",Ext.chart.ColumnChart);Ext.chart.StackedColumnChart=Ext.extend(Ext.chart.CartesianChart,{type:"stackcolumn"});Ext.reg("stackedcolumnchart",Ext.chart.StackedColumnChart);Ext.chart.BarChart=Ext.extend(Ext.chart.CartesianChart,{type:"bar"});Ext.reg("barchart",Ext.chart.BarChart);Ext.chart.StackedBarChart=Ext.extend(Ext.chart.CartesianChart,{type:"stackbar"});Ext.reg("stackedbarchart",Ext.chart.StackedBarChart);Ext.chart.Axis=function(a){Ext.apply(this,a)};Ext.chart.Axis.prototype={type:null,orientation:"horizontal",reverse:false,labelFunction:null,hideOverlappingLabels:true,labelSpacing:2};Ext.chart.NumericAxis=Ext.extend(Ext.chart.Axis,{type:"numeric",minimum:NaN,maximum:NaN,majorUnit:NaN,minorUnit:NaN,snapToUnits:true,alwaysShowZero:true,scale:"linear",roundMajorUnit:true,calculateByLabelSize:true,position:"left",adjustMaximumByMajorUnit:true,adjustMinimumByMajorUnit:true});Ext.chart.TimeAxis=Ext.extend(Ext.chart.Axis,{type:"time",minimum:null,maximum:null,majorUnit:NaN,majorTimeUnit:null,minorUnit:NaN,minorTimeUnit:null,snapToUnits:true,stackingEnabled:false,calculateByLabelSize:true});Ext.chart.CategoryAxis=Ext.extend(Ext.chart.Axis,{type:"category",categoryNames:null,calculateCategoryCount:false});Ext.chart.Series=function(a){Ext.apply(this,a)};Ext.chart.Series.prototype={type:null,displayName:null};Ext.chart.CartesianSeries=Ext.extend(Ext.chart.Series,{xField:null,yField:null,showInLegend:true,axis:"primary"});Ext.chart.ColumnSeries=Ext.extend(Ext.chart.CartesianSeries,{type:"column"});Ext.chart.LineSeries=Ext.extend(Ext.chart.CartesianSeries,{type:"line"});Ext.chart.BarSeries=Ext.extend(Ext.chart.CartesianSeries,{type:"bar"});Ext.chart.PieSeries=Ext.extend(Ext.chart.Series,{type:"pie",dataField:null,categoryField:null});Ext.menu.Menu=Ext.extend(Ext.Container,{minWidth:120,shadow:"sides",subMenuAlign:"tl-tr?",defaultAlign:"tl-bl?",allowOtherMenus:false,ignoreParentClicks:false,enableScrolling:true,maxHeight:null,scrollIncrement:24,showSeparator:true,defaultOffsets:[0,0],plain:false,floating:true,zIndex:15000,hidden:true,layout:"menu",hideMode:"offsets",scrollerHeight:8,autoLayout:true,defaultType:"menuitem",bufferResize:false,initComponent:function(){if(Ext.isArray(this.initialConfig)){Ext.apply(this,{items:this.initialConfig})}this.addEvents("click","mouseover","mouseout","itemclick");Ext.menu.MenuMgr.register(this);if(this.floating){Ext.EventManager.onWindowResize(this.hide,this)}else{if(this.initialConfig.hidden!==false){this.hidden=false}this.internalDefaults={hideOnClick:false}}Ext.menu.Menu.superclass.initComponent.call(this);if(this.autoLayout){var a=this.doLayout.createDelegate(this,[]);this.on({add:a,remove:a})}},getLayoutTarget:function(){return this.ul},onRender:function(b,a){if(!b){b=Ext.getBody()}var c={id:this.getId(),cls:"x-menu "+((this.floating)?"x-menu-floating x-layer ":"")+(this.cls||"")+(this.plain?" x-menu-plain":"")+(this.showSeparator?"":" x-menu-nosep"),style:this.style,cn:[{tag:"a",cls:"x-menu-focus",href:"#",onclick:"return false;",tabIndex:"-1"},{tag:"ul",cls:"x-menu-list"}]};if(this.floating){this.el=new Ext.Layer({shadow:this.shadow,dh:c,constrain:false,parentEl:b,zindex:this.zIndex})}else{this.el=b.createChild(c)}Ext.menu.Menu.superclass.onRender.call(this,b,a);if(!this.keyNav){this.keyNav=new Ext.menu.MenuNav(this)}this.focusEl=this.el.child("a.x-menu-focus");this.ul=this.el.child("ul.x-menu-list");this.mon(this.ul,{scope:this,click:this.onClick,mouseover:this.onMouseOver,mouseout:this.onMouseOut});if(this.enableScrolling){this.mon(this.el,{scope:this,delegate:".x-menu-scroller",click:this.onScroll,mouseover:this.deactivateActive})}},findTargetItem:function(b){var a=b.getTarget(".x-menu-list-item",this.ul,true);if(a&&a.menuItemId){return this.items.get(a.menuItemId)}},onClick:function(b){var a=this.findTargetItem(b);if(a){if(a.isFormField){this.setActiveItem(a)}else{if(a instanceof Ext.menu.BaseItem){if(a.menu&&this.ignoreParentClicks){a.expandMenu();b.preventDefault()}else{if(a.onClick){a.onClick(b);this.fireEvent("click",this,a,b)}}}}}},setActiveItem:function(a,b){if(a!=this.activeItem){this.deactivateActive();if((this.activeItem=a).isFormField){a.focus()}else{a.activate(b)}}else{if(b){a.expandMenu()}}},deactivateActive:function(){var b=this.activeItem;if(b){if(b.isFormField){if(b.collapse){b.collapse()}}else{b.deactivate()}delete this.activeItem}},tryActivate:function(g,e){var b=this.items;for(var c=g,a=b.length;c>=0&&c<a;c+=e){var d=b.get(c);if(d.isVisible()&&!d.disabled&&(d.canActivate||d.isFormField)){this.setActiveItem(d,false);return d}}return false},onMouseOver:function(b){var a=this.findTargetItem(b);if(a){if(a.canActivate&&!a.disabled){this.setActiveItem(a,true)}}this.over=true;this.fireEvent("mouseover",this,b,a)},onMouseOut:function(b){var a=this.findTargetItem(b);if(a){if(a==this.activeItem&&a.shouldDeactivate&&a.shouldDeactivate(b)){this.activeItem.deactivate();delete this.activeItem}}this.over=false;this.fireEvent("mouseout",this,b,a)},onScroll:function(d,b){if(d){d.stopEvent()}var a=this.ul.dom,c=Ext.fly(b).is(".x-menu-scroller-top");a.scrollTop+=this.scrollIncrement*(c?-1:1);if(c?a.scrollTop<=0:a.scrollTop+this.activeMax>=a.scrollHeight){this.onScrollerOut(null,b)}},onScrollerIn:function(d,b){var a=this.ul.dom,c=Ext.fly(b).is(".x-menu-scroller-top");if(c?a.scrollTop>0:a.scrollTop+this.activeMax<a.scrollHeight){Ext.fly(b).addClass(["x-menu-item-active","x-menu-scroller-active"])}},onScrollerOut:function(b,a){Ext.fly(a).removeClass(["x-menu-item-active","x-menu-scroller-active"])},show:function(b,c,a){if(this.floating){this.parentMenu=a;if(!this.el){this.render();this.doLayout(false,true)}this.showAt(this.el.getAlignToXY(b,c||this.defaultAlign,this.defaultOffsets),a)}else{Ext.menu.Menu.superclass.show.call(this)}},showAt:function(b,a){if(this.fireEvent("beforeshow",this)!==false){this.parentMenu=a;if(!this.el){this.render()}if(this.enableScrolling){this.el.setXY(b);b[1]=this.constrainScroll(b[1]);b=[this.el.adjustForConstraints(b)[0],b[1]]}else{b=this.el.adjustForConstraints(b)}this.el.setXY(b);this.el.show();Ext.menu.Menu.superclass.onShow.call(this);if(Ext.isIE){this.fireEvent("autosize",this);if(!Ext.isIE8){this.el.repaint()}}this.hidden=false;this.focus();this.fireEvent("show",this)}},constrainScroll:function(i){var b,d=this.ul.setHeight("auto").getHeight(),a=i,h,e,g,c;if(this.floating){e=Ext.fly(this.el.dom.parentNode);g=e.getScroll().top;c=e.getViewSize().height;h=i-g;b=this.maxHeight?this.maxHeight:c-h;if(d>c){b=c;a=i-h}else{if(b<d){a=i-(d-b);b=d}}}else{b=this.getHeight()}if(this.maxHeight){b=Math.min(this.maxHeight,b)}if(d>b&&b>0){this.activeMax=b-this.scrollerHeight*2-this.el.getFrameWidth("tb")-Ext.num(this.el.shadowOffset,0);this.ul.setHeight(this.activeMax);this.createScrollers();this.el.select(".x-menu-scroller").setDisplayed("")}else{this.ul.setHeight(d);this.el.select(".x-menu-scroller").setDisplayed("none")}this.ul.dom.scrollTop=0;return a},createScrollers:function(){if(!this.scroller){this.scroller={pos:0,top:this.el.insertFirst({tag:"div",cls:"x-menu-scroller x-menu-scroller-top",html:"&#160;"}),bottom:this.el.createChild({tag:"div",cls:"x-menu-scroller x-menu-scroller-bottom",html:"&#160;"})};this.scroller.top.hover(this.onScrollerIn,this.onScrollerOut,this);this.scroller.topRepeater=new Ext.util.ClickRepeater(this.scroller.top,{listeners:{click:this.onScroll.createDelegate(this,[null,this.scroller.top],false)}});this.scroller.bottom.hover(this.onScrollerIn,this.onScrollerOut,this);this.scroller.bottomRepeater=new Ext.util.ClickRepeater(this.scroller.bottom,{listeners:{click:this.onScroll.createDelegate(this,[null,this.scroller.bottom],false)}})}},onLayout:function(){if(this.isVisible()){if(this.enableScrolling){this.constrainScroll(this.el.getTop())}if(this.floating){this.el.sync()}}},focus:function(){if(!this.hidden){this.doFocus.defer(50,this)}},doFocus:function(){if(!this.hidden){this.focusEl.focus()}},hide:function(a){if(!this.isDestroyed){this.deepHide=a;Ext.menu.Menu.superclass.hide.call(this);delete this.deepHide}},onHide:function(){Ext.menu.Menu.superclass.onHide.call(this);this.deactivateActive();if(this.el&&this.floating){this.el.hide()}var a=this.parentMenu;if(this.deepHide===true&&a){if(a.floating){a.hide(true)}else{a.deactivateActive()}}},lookupComponent:function(a){if(Ext.isString(a)){a=(a=="separator"||a=="-")?new Ext.menu.Separator():new Ext.menu.TextItem(a);this.applyDefaults(a)}else{if(Ext.isObject(a)){a=this.getMenuItem(a)}else{if(a.tagName||a.el){a=new Ext.BoxComponent({el:a})}}}return a},applyDefaults:function(b){if(!Ext.isString(b)){b=Ext.menu.Menu.superclass.applyDefaults.call(this,b);var a=this.internalDefaults;if(a){if(b.events){Ext.applyIf(b.initialConfig,a);Ext.apply(b,a)}else{Ext.applyIf(b,a)}}}return b},getMenuItem:function(a){if(!a.isXType){if(!a.xtype&&Ext.isBoolean(a.checked)){return new Ext.menu.CheckItem(a)}return Ext.create(a,this.defaultType)}return a},addSeparator:function(){return this.add(new Ext.menu.Separator())},addElement:function(a){return this.add(new Ext.menu.BaseItem({el:a}))},addItem:function(a){return this.add(a)},addMenuItem:function(a){return this.add(this.getMenuItem(a))},addText:function(a){return this.add(new Ext.menu.TextItem(a))},onDestroy:function(){Ext.EventManager.removeResizeListener(this.hide,this);var a=this.parentMenu;if(a&&a.activeChild==this){delete a.activeChild}delete this.parentMenu;Ext.menu.Menu.superclass.onDestroy.call(this);Ext.menu.MenuMgr.unregister(this);if(this.keyNav){this.keyNav.disable()}var b=this.scroller;if(b){Ext.destroy(b.topRepeater,b.bottomRepeater,b.top,b.bottom)}Ext.destroy(this.el,this.focusEl,this.ul)}});Ext.reg("menu",Ext.menu.Menu);Ext.menu.MenuNav=Ext.extend(Ext.KeyNav,function(){function a(d,c){if(!c.tryActivate(c.items.indexOf(c.activeItem)-1,-1)){c.tryActivate(c.items.length-1,-1)}}function b(d,c){if(!c.tryActivate(c.items.indexOf(c.activeItem)+1,1)){c.tryActivate(0,1)}}return{constructor:function(c){Ext.menu.MenuNav.superclass.constructor.call(this,c.el);this.scope=this.menu=c},doRelay:function(g,d){var c=g.getKey();if(this.menu.activeItem&&this.menu.activeItem.isFormField&&c!=g.TAB){return false}if(!this.menu.activeItem&&g.isNavKeyPress()&&c!=g.SPACE&&c!=g.RETURN){this.menu.tryActivate(0,1);return false}return d.call(this.scope||this,g,this.menu)},tab:function(d,c){d.stopEvent();if(d.shiftKey){a(d,c)}else{b(d,c)}},up:a,down:b,right:function(d,c){if(c.activeItem){c.activeItem.expandMenu(true)}},left:function(d,c){c.hide();if(c.parentMenu&&c.parentMenu.activeItem){c.parentMenu.activeItem.activate()}},enter:function(d,c){if(c.activeItem){d.stopPropagation();c.activeItem.onClick(d);c.fireEvent("click",this,c.activeItem);return true}}}}());Ext.menu.MenuMgr=function(){var g,d,c={},a=false,l=new Date();function n(){g={};d=new Ext.util.MixedCollection();Ext.getDoc().addKeyListener(27,function(){if(d.length>0){i()}})}function i(){if(d&&d.length>0){var o=d.clone();o.each(function(p){p.hide()});return true}return false}function e(o){d.remove(o);if(d.length<1){Ext.getDoc().un("mousedown",m);a=false}}function k(o){var p=d.last();l=new Date();d.add(o);if(!a){Ext.getDoc().on("mousedown",m);a=true}if(o.parentMenu){o.getEl().setZIndex(parseInt(o.parentMenu.getEl().getStyle("z-index"),10)+3);o.parentMenu.activeChild=o}else{if(p&&!p.isDestroyed&&p.isVisible()){o.getEl().setZIndex(parseInt(p.getEl().getStyle("z-index"),10)+3)}}}function b(o){if(o.activeChild){o.activeChild.hide()}if(o.autoHideTimer){clearTimeout(o.autoHideTimer);delete o.autoHideTimer}}function h(o){var p=o.parentMenu;if(!p&&!o.allowOtherMenus){i()}else{if(p&&p.activeChild){p.activeChild.hide()}}}function m(o){if(l.getElapsed()>50&&d.length>0&&!o.getTarget(".x-menu")){i()}}return{hideAll:function(){return i()},register:function(o){if(!g){n()}g[o.id]=o;o.on({beforehide:b,hide:e,beforeshow:h,show:k})},get:function(o){if(typeof o=="string"){if(!g){return null}return g[o]}else{if(o.events){return o}else{if(typeof o.length=="number"){return new Ext.menu.Menu({items:o})}else{return Ext.create(o,"menu")}}}},unregister:function(o){delete g[o.id];o.un("beforehide",b);o.un("hide",e);o.un("beforeshow",h);o.un("show",k)},registerCheckable:function(o){var p=o.group;if(p){if(!c[p]){c[p]=[]}c[p].push(o)}},unregisterCheckable:function(o){var p=o.group;if(p){c[p].remove(o)}},onCheckChange:function(q,r){if(q.group&&r){var t=c[q.group],p=0,o=t.length,s;for(;p<o;p++){s=t[p];if(s!=q){s.setChecked(false)}}}},getCheckedItem:function(q){var r=c[q];if(r){for(var p=0,o=r.length;p<o;p++){if(r[p].checked){return r[p]}}}return null},setCheckedItem:function(q,s){var r=c[q];if(r){for(var p=0,o=r.length;p<o;p++){if(r[p].id==s){r[p].setChecked(true)}}}return null}}}();Ext.menu.BaseItem=Ext.extend(Ext.Component,{canActivate:false,activeClass:"x-menu-item-active",hideOnClick:true,clickHideDelay:1,ctype:"Ext.menu.BaseItem",actionMode:"container",initComponent:function(){Ext.menu.BaseItem.superclass.initComponent.call(this);this.addEvents("click","activate","deactivate");if(this.handler){this.on("click",this.handler,this.scope)}},onRender:function(b,a){Ext.menu.BaseItem.superclass.onRender.apply(this,arguments);if(this.ownerCt&&this.ownerCt instanceof Ext.menu.Menu){this.parentMenu=this.ownerCt}else{this.container.addClass("x-menu-list-item");this.mon(this.el,{scope:this,click:this.onClick,mouseenter:this.activate,mouseleave:this.deactivate})}},setHandler:function(b,a){if(this.handler){this.un("click",this.handler,this.scope)}this.on("click",this.handler=b,this.scope=a)},onClick:function(a){if(!this.disabled&&this.fireEvent("click",this,a)!==false&&(this.parentMenu&&this.parentMenu.fireEvent("itemclick",this,a)!==false)){this.handleClick(a)}else{a.stopEvent()}},activate:function(){if(this.disabled){return false}var a=this.container;a.addClass(this.activeClass);this.region=a.getRegion().adjust(2,2,-2,-2);this.fireEvent("activate",this);return true},deactivate:function(){this.container.removeClass(this.activeClass);this.fireEvent("deactivate",this)},shouldDeactivate:function(a){return !this.region||!this.region.contains(a.getPoint())},handleClick:function(b){var a=this.parentMenu;if(this.hideOnClick){if(a.floating){a.hide.defer(this.clickHideDelay,a,[true])}else{a.deactivateActive()}}},expandMenu:Ext.emptyFn,hideMenu:Ext.emptyFn});Ext.reg("menubaseitem",Ext.menu.BaseItem);Ext.menu.TextItem=Ext.extend(Ext.menu.BaseItem,{hideOnClick:false,itemCls:"x-menu-text",constructor:function(a){if(typeof a=="string"){a={text:a}}Ext.menu.TextItem.superclass.constructor.call(this,a)},onRender:function(){var a=document.createElement("span");a.className=this.itemCls;a.innerHTML=this.text;this.el=a;Ext.menu.TextItem.superclass.onRender.apply(this,arguments)}});Ext.reg("menutextitem",Ext.menu.TextItem);Ext.menu.Separator=Ext.extend(Ext.menu.BaseItem,{itemCls:"x-menu-sep",hideOnClick:false,activeClass:"",onRender:function(a){var b=document.createElement("span");b.className=this.itemCls;b.innerHTML="&#160;";this.el=b;a.addClass("x-menu-sep-li");Ext.menu.Separator.superclass.onRender.apply(this,arguments)}});Ext.reg("menuseparator",Ext.menu.Separator);Ext.menu.Item=Ext.extend(Ext.menu.BaseItem,{itemCls:"x-menu-item",canActivate:true,showDelay:200,altText:"",hideDelay:200,ctype:"Ext.menu.Item",initComponent:function(){Ext.menu.Item.superclass.initComponent.call(this);if(this.menu){this.menu=Ext.menu.MenuMgr.get(this.menu);this.menu.ownerCt=this}},onRender:function(d,b){if(!this.itemTpl){this.itemTpl=Ext.menu.Item.prototype.itemTpl=new Ext.XTemplate('<a id="{id}" class="{cls}" hidefocus="true" unselectable="on" href="{href}"','<tpl if="hrefTarget">',' target="{hrefTarget}"',"</tpl>",">",'<img alt="{altText}" src="{icon}" class="x-menu-item-icon {iconCls}"/>','<span class="x-menu-item-text">{text}</span>',"</a>")}var c=this.getTemplateArgs();this.el=b?this.itemTpl.insertBefore(b,c,true):this.itemTpl.append(d,c,true);this.iconEl=this.el.child("img.x-menu-item-icon");this.textEl=this.el.child(".x-menu-item-text");if(!this.href){this.mon(this.el,"click",Ext.emptyFn,null,{preventDefault:true})}Ext.menu.Item.superclass.onRender.call(this,d,b)},getTemplateArgs:function(){return{id:this.id,cls:this.itemCls+(this.menu?" x-menu-item-arrow":"")+(this.cls?" "+this.cls:""),href:this.href||"#",hrefTarget:this.hrefTarget,icon:this.icon||Ext.BLANK_IMAGE_URL,iconCls:this.iconCls||"",text:this.itemText||this.text||"&#160;",altText:this.altText||""}},setText:function(a){this.text=a||"&#160;";if(this.rendered){this.textEl.update(this.text);this.parentMenu.layout.doAutoSize()}},setIconClass:function(a){var b=this.iconCls;this.iconCls=a;if(this.rendered){this.iconEl.replaceClass(b,this.iconCls)}},beforeDestroy:function(){if(this.menu){delete this.menu.ownerCt;this.menu.destroy()}Ext.menu.Item.superclass.beforeDestroy.call(this)},handleClick:function(a){if(!this.href){a.stopEvent()}Ext.menu.Item.superclass.handleClick.apply(this,arguments)},activate:function(a){if(Ext.menu.Item.superclass.activate.apply(this,arguments)){this.focus();if(a){this.expandMenu()}}return true},shouldDeactivate:function(a){if(Ext.menu.Item.superclass.shouldDeactivate.call(this,a)){if(this.menu&&this.menu.isVisible()){return !this.menu.getEl().getRegion().contains(a.getPoint())}return true}return false},deactivate:function(){Ext.menu.Item.superclass.deactivate.apply(this,arguments);this.hideMenu()},expandMenu:function(a){if(!this.disabled&&this.menu){clearTimeout(this.hideTimer);delete this.hideTimer;if(!this.menu.isVisible()&&!this.showTimer){this.showTimer=this.deferExpand.defer(this.showDelay,this,[a])}else{if(this.menu.isVisible()&&a){this.menu.tryActivate(0,1)}}}},deferExpand:function(a){delete this.showTimer;this.menu.show(this.container,this.parentMenu.subMenuAlign||"tl-tr?",this.parentMenu);if(a){this.menu.tryActivate(0,1)}},hideMenu:function(){clearTimeout(this.showTimer);delete this.showTimer;if(!this.hideTimer&&this.menu&&this.menu.isVisible()){this.hideTimer=this.deferHide.defer(this.hideDelay,this)}},deferHide:function(){delete this.hideTimer;if(this.menu.over){this.parentMenu.setActiveItem(this,false)}else{this.menu.hide()}}});Ext.reg("menuitem",Ext.menu.Item);Ext.menu.CheckItem=Ext.extend(Ext.menu.Item,{itemCls:"x-menu-item x-menu-check-item",groupClass:"x-menu-group-item",checked:false,ctype:"Ext.menu.CheckItem",initComponent:function(){Ext.menu.CheckItem.superclass.initComponent.call(this);this.addEvents("beforecheckchange","checkchange");if(this.checkHandler){this.on("checkchange",this.checkHandler,this.scope)}Ext.menu.MenuMgr.registerCheckable(this)},onRender:function(a){Ext.menu.CheckItem.superclass.onRender.apply(this,arguments);if(this.group){this.el.addClass(this.groupClass)}if(this.checked){this.checked=false;this.setChecked(true,true)}},destroy:function(){Ext.menu.MenuMgr.unregisterCheckable(this);Ext.menu.CheckItem.superclass.destroy.apply(this,arguments)},setChecked:function(b,a){var c=a===true;if(this.checked!=b&&(c||this.fireEvent("beforecheckchange",this,b)!==false)){Ext.menu.MenuMgr.onCheckChange(this,b);if(this.container){this.container[b?"addClass":"removeClass"]("x-menu-item-checked")}this.checked=b;if(!c){this.fireEvent("checkchange",this,b)}}},handleClick:function(a){if(!this.disabled&&!(this.checked&&this.group)){this.setChecked(!this.checked)}Ext.menu.CheckItem.superclass.handleClick.apply(this,arguments)}});Ext.reg("menucheckitem",Ext.menu.CheckItem);Ext.menu.DateMenu=Ext.extend(Ext.menu.Menu,{enableScrolling:false,hideOnClick:true,pickerId:null,cls:"x-date-menu",initComponent:function(){this.on("beforeshow",this.onBeforeShow,this);if(this.strict=(Ext.isIE7&&Ext.isStrict)){this.on("show",this.onShow,this,{single:true,delay:20})}Ext.apply(this,{plain:true,showSeparator:false,items:this.picker=new Ext.DatePicker(Ext.applyIf({internalRender:this.strict||!Ext.isIE,ctCls:"x-menu-date-item",id:this.pickerId},this.initialConfig))});this.picker.purgeListeners();Ext.menu.DateMenu.superclass.initComponent.call(this);this.relayEvents(this.picker,["select"]);this.on("show",this.picker.focus,this.picker);this.on("select",this.menuHide,this);if(this.handler){this.on("select",this.handler,this.scope||this)}},menuHide:function(){if(this.hideOnClick){this.hide(true)}},onBeforeShow:function(){if(this.picker){this.picker.hideMonthPicker(true)}},onShow:function(){var a=this.picker.getEl();a.setWidth(a.getWidth())}});Ext.reg("datemenu",Ext.menu.DateMenu);Ext.menu.ColorMenu=Ext.extend(Ext.menu.Menu,{enableScrolling:false,hideOnClick:true,cls:"x-color-menu",paletteId:null,initComponent:function(){Ext.apply(this,{plain:true,showSeparator:false,items:this.palette=new Ext.ColorPalette(Ext.applyIf({id:this.paletteId},this.initialConfig))});this.palette.purgeListeners();Ext.menu.ColorMenu.superclass.initComponent.call(this);this.relayEvents(this.palette,["select"]);this.on("select",this.menuHide,this);if(this.handler){this.on("select",this.handler,this.scope||this)}},menuHide:function(){if(this.hideOnClick){this.hide(true)}}});Ext.reg("colormenu",Ext.menu.ColorMenu);Ext.form.Field=Ext.extend(Ext.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"off"},fieldClass:"x-form-field",msgTarget:"qtip",msgFx:"normal",readOnly:false,disabled:false,submitValue:true,isFormField:true,msgDisplay:"",hasFocus:false,initComponent:function(){Ext.form.Field.superclass.initComponent.call(this);this.addEvents("focus","blur","specialkey","change","invalid","valid")},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:this.name||this.id||""},onRender:function(c,a){if(!this.el){var b=this.getAutoCreate();if(!b.name){b.name=this.name||this.id}if(this.inputType){b.type=this.inputType}this.autoEl=b}Ext.form.Field.superclass.onRender.call(this,c,a);if(this.submitValue===false){this.el.dom.removeAttribute("name")}var d=this.el.dom.type;if(d){if(d=="password"){d="text"}this.el.addClass("x-form-"+d)}if(this.readOnly){this.setReadOnly(true)}if(this.tabIndex!==undefined){this.el.dom.setAttribute("tabIndex",this.tabIndex)}this.el.addClass([this.fieldClass,this.cls])},getItemCt:function(){return this.itemCt},initValue:function(){if(this.value!==undefined){this.setValue(this.value)}else{if(!Ext.isEmpty(this.el.dom.value)&&this.el.dom.value!=this.emptyText){this.setValue(this.el.dom.value)}}this.originalValue=this.getValue()},isDirty:function(){if(this.disabled||!this.rendered){return false}return String(this.getValue())!==String(this.originalValue)},setReadOnly:function(a){if(this.rendered){this.el.dom.readOnly=a}this.readOnly=a},afterRender:function(){Ext.form.Field.superclass.afterRender.call(this);this.initEvents();this.initValue()},fireKey:function(a){if(a.isSpecialKey()){this.fireEvent("specialkey",this,a)}},reset:function(){this.setValue(this.originalValue);this.clearInvalid()},initEvents:function(){this.mon(this.el,Ext.EventManager.getKeyEvent(),this.fireKey,this);this.mon(this.el,"focus",this.onFocus,this);this.mon(this.el,"blur",this.onBlur,this,this.inEditor?{buffer:10}:null)},preFocus:Ext.emptyFn,onFocus:function(){this.preFocus();if(this.focusClass){this.el.addClass(this.focusClass)}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this)}},beforeBlur:Ext.emptyFn,onBlur:function(){this.beforeBlur();if(this.focusClass){this.el.removeClass(this.focusClass)}this.hasFocus=false;if(this.validationEvent!==false&&(this.validateOnBlur||this.validationEvent=="blur")){this.validate()}var a=this.getValue();if(String(a)!==String(this.startValue)){this.fireEvent("change",this,a,this.startValue)}this.fireEvent("blur",this);this.postBlur()},postBlur:Ext.emptyFn,isValid:function(a){if(this.disabled){return true}var c=this.preventMark;this.preventMark=a===true;var b=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=c;return b},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true}return false},processValue:function(a){return a},validateValue:function(b){var a=this.getErrors(b)[0];if(a==undefined){return true}else{this.markInvalid(a);return false}},getErrors:function(){return[]},getActiveError:function(){return this.activeError||""},markInvalid:function(c){if(this.rendered&&!this.preventMark){c=c||this.invalidText;var a=this.getMessageHandler();if(a){a.mark(this,c)}else{if(this.msgTarget){this.el.addClass(this.invalidClass);var b=Ext.getDom(this.msgTarget);if(b){b.innerHTML=c;b.style.display=this.msgDisplay}}}}this.setActiveError(c)},clearInvalid:function(){if(this.rendered&&!this.preventMark){this.el.removeClass(this.invalidClass);var a=this.getMessageHandler();if(a){a.clear(this)}else{if(this.msgTarget){this.el.removeClass(this.invalidClass);var b=Ext.getDom(this.msgTarget);if(b){b.innerHTML="";b.style.display="none"}}}}this.unsetActiveError()},setActiveError:function(b,a){this.activeError=b;if(a!==true){this.fireEvent("invalid",this,b)}},unsetActiveError:function(a){delete this.activeError;if(a!==true){this.fireEvent("valid",this)}},getMessageHandler:function(){return Ext.form.MessageTargets[this.msgTarget]},getErrorCt:function(){return this.el.findParent(".x-form-element",5,true)||this.el.findParent(".x-form-field-wrap",5,true)},alignErrorEl:function(){this.errorEl.setWidth(this.getErrorCt().getWidth(true)-20)},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,"tl-tr",[2,0])},getRawValue:function(){var a=this.rendered?this.el.getValue():Ext.value(this.value,"");if(a===this.emptyText){a=""}return a},getValue:function(){if(!this.rendered){return this.value}var a=this.el.getValue();if(a===this.emptyText||a===undefined){a=""}return a},setRawValue:function(a){return this.rendered?(this.el.dom.value=(Ext.isEmpty(a)?"":a)):""},setValue:function(a){this.value=a;if(this.rendered){this.el.dom.value=(Ext.isEmpty(a)?"":a);this.validate()}return this},append:function(a){this.setValue([this.getValue(),a].join(""))}});Ext.form.MessageTargets={qtip:{mark:function(a,b){a.el.addClass(a.invalidClass);a.el.dom.qtip=b;a.el.dom.qclass="x-form-invalid-tip";if(Ext.QuickTips){Ext.QuickTips.enable()}},clear:function(a){a.el.removeClass(a.invalidClass);a.el.dom.qtip=""}},title:{mark:function(a,b){a.el.addClass(a.invalidClass);a.el.dom.title=b},clear:function(a){a.el.dom.title=""}},under:{mark:function(b,c){b.el.addClass(b.invalidClass);if(!b.errorEl){var a=b.getErrorCt();if(!a){b.el.dom.title=c;return}b.errorEl=a.createChild({cls:"x-form-invalid-msg"});b.on("resize",b.alignErrorEl,b);b.on("destroy",function(){Ext.destroy(this.errorEl)},b)}b.alignErrorEl();b.errorEl.update(c);Ext.form.Field.msgFx[b.msgFx].show(b.errorEl,b)},clear:function(a){a.el.removeClass(a.invalidClass);if(a.errorEl){Ext.form.Field.msgFx[a.msgFx].hide(a.errorEl,a)}else{a.el.dom.title=""}}},side:{mark:function(b,c){b.el.addClass(b.invalidClass);if(!b.errorIcon){var a=b.getErrorCt();if(!a){b.el.dom.title=c;return}b.errorIcon=a.createChild({cls:"x-form-invalid-icon"});if(b.ownerCt){b.ownerCt.on("afterlayout",b.alignErrorIcon,b);b.ownerCt.on("expand",b.alignErrorIcon,b)}b.on("resize",b.alignErrorIcon,b);b.on("destroy",function(){Ext.destroy(this.errorIcon)},b)}b.alignErrorIcon();b.errorIcon.dom.qtip=c;b.errorIcon.dom.qclass="x-form-invalid-tip";b.errorIcon.show()},clear:function(a){a.el.removeClass(a.invalidClass);if(a.errorIcon){a.errorIcon.dom.qtip="";a.errorIcon.hide()}else{a.el.dom.title=""}}}};Ext.form.Field.msgFx={normal:{show:function(a,b){a.setDisplayed("block")},hide:function(a,b){a.setDisplayed(false).update("")}},slide:{show:function(a,b){a.slideIn("t",{stopFx:true})},hide:function(a,b){a.slideOut("t",{stopFx:true,useDisplay:true})}},slideRight:{show:function(a,b){a.fixDisplay();a.alignTo(b.el,"tl-tr");a.slideIn("l",{stopFx:true})},hide:function(a,b){a.slideOut("l",{stopFx:true,useDisplay:true})}}};Ext.reg("field",Ext.form.Field);Ext.form.TextField=Ext.extend(Ext.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,emptyClass:"x-form-empty-field",initComponent:function(){Ext.form.TextField.superclass.initComponent.call(this);this.addEvents("autosize","keydown","keyup","keypress")},initEvents:function(){Ext.form.TextField.superclass.initEvents.call(this);if(this.validationEvent=="keyup"){this.validationTask=new Ext.util.DelayedTask(this.validate,this);this.mon(this.el,"keyup",this.filterValidation,this)}else{if(this.validationEvent!==false&&this.validationEvent!="blur"){this.mon(this.el,this.validationEvent,this.validate,this,{buffer:this.validationDelay})}}if(this.selectOnFocus||this.emptyText){this.mon(this.el,"mousedown",this.onMouseDown,this);if(this.emptyText){this.applyEmptyText()}}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Ext.form.VTypes[this.vtype+"Mask"]))){this.mon(this.el,"keypress",this.filterKeys,this)}if(this.grow){this.mon(this.el,"keyup",this.onKeyUpBuffered,this,{buffer:50});this.mon(this.el,"click",this.autoSize,this)}if(this.enableKeyEvents){this.mon(this.el,{scope:this,keyup:this.onKeyUp,keydown:this.onKeyDown,keypress:this.onKeyPress})}},onMouseDown:function(a){if(!this.hasFocus){this.mon(this.el,"mouseup",Ext.emptyFn,this,{single:true,preventDefault:true})}},processValue:function(a){if(this.stripCharsRe){var b=a.replace(this.stripCharsRe,"");if(b!==a){this.setRawValue(b);return b}}return a},filterValidation:function(a){if(!a.isNavKeyPress()){this.validationTask.delay(this.validationDelay)}},onDisable:function(){Ext.form.TextField.superclass.onDisable.call(this);if(Ext.isIE){this.el.dom.unselectable="on"}},onEnable:function(){Ext.form.TextField.superclass.onEnable.call(this);if(Ext.isIE){this.el.dom.unselectable=""}},onKeyUpBuffered:function(a){if(this.doAutoSize(a)){this.autoSize()}},doAutoSize:function(a){return !a.isNavKeyPress()},onKeyUp:function(a){this.fireEvent("keyup",this,a)},onKeyDown:function(a){this.fireEvent("keydown",this,a)},onKeyPress:function(a){this.fireEvent("keypress",this,a)},reset:function(){Ext.form.TextField.superclass.reset.call(this);this.applyEmptyText()},applyEmptyText:function(){if(this.rendered&&this.emptyText&&this.getRawValue().length<1&&!this.hasFocus){this.setRawValue(this.emptyText);this.el.addClass(this.emptyClass)}},preFocus:function(){var a=this.el,b;if(this.emptyText){if(a.dom.value==this.emptyText){this.setRawValue("");b=true}a.removeClass(this.emptyClass)}if(this.selectOnFocus||b){a.dom.select()}},postBlur:function(){this.applyEmptyText()},filterKeys:function(b){if(b.ctrlKey){return}var a=b.getKey();if(Ext.isGecko&&(b.isNavKeyPress()||a==b.BACKSPACE||(a==b.DELETE&&b.button==-1))){return}var c=String.fromCharCode(b.getCharCode());if(!Ext.isGecko&&b.isSpecialKey()&&!c){return}if(!this.maskRe.test(c)){b.stopEvent()}},setValue:function(a){if(this.emptyText&&this.el&&!Ext.isEmpty(a)){this.el.removeClass(this.emptyClass)}Ext.form.TextField.superclass.setValue.apply(this,arguments);this.applyEmptyText();this.autoSize();return this},getErrors:function(a){var d=Ext.form.TextField.superclass.getErrors.apply(this,arguments);a=Ext.isDefined(a)?a:this.processValue(this.getRawValue());if(Ext.isFunction(this.validator)){var c=this.validator(a);if(c!==true){d.push(c)}}if(a.length<1||a===this.emptyText){if(this.allowBlank){return d}else{d.push(this.blankText)}}if(!this.allowBlank&&(a.length<1||a===this.emptyText)){d.push(this.blankText)}if(a.length<this.minLength){d.push(String.format(this.minLengthText,this.minLength))}if(a.length>this.maxLength){d.push(String.format(this.maxLengthText,this.maxLength))}if(this.vtype){var b=Ext.form.VTypes;if(!b[this.vtype](a,this)){d.push(this.vtypeText||b[this.vtype+"Text"])}}if(this.regex&&!this.regex.test(a)){d.push(this.regexText)}return d},selectText:function(h,a){var c=this.getRawValue();var e=false;if(c.length>0){h=h===undefined?0:h;a=a===undefined?c.length:a;var g=this.el.dom;if(g.setSelectionRange){g.setSelectionRange(h,a)}else{if(g.createTextRange){var b=g.createTextRange();b.moveStart("character",h);b.moveEnd("character",a-c.length);b.select()}}e=Ext.isGecko||Ext.isOpera}else{e=true}if(e){this.focus()}},autoSize:function(){if(!this.grow||!this.rendered){return}if(!this.metrics){this.metrics=Ext.util.TextMetrics.createInstance(this.el)}var c=this.el;var b=c.dom.value;var e=document.createElement("div");e.appendChild(document.createTextNode(b));b=e.innerHTML;Ext.removeNode(e);e=null;b+="&#160;";var a=Math.min(this.growMax,Math.max(this.metrics.getWidth(b)+10,this.growMin));this.el.setWidth(a);this.fireEvent("autosize",this,a)},onDestroy:function(){if(this.validationTask){this.validationTask.cancel();this.validationTask=null}Ext.form.TextField.superclass.onDestroy.call(this)}});Ext.reg("textfield",Ext.form.TextField);Ext.form.TriggerField=Ext.extend(Ext.form.TextField,{defaultAutoCreate:{tag:"input",type:"text",size:"16",autocomplete:"off"},hideTrigger:false,editable:true,readOnly:false,wrapFocusClass:"x-trigger-wrap-focus",autoSize:Ext.emptyFn,monitorTab:true,deferHeight:true,mimicing:false,actionMode:"wrap",defaultTriggerWidth:17,onResize:function(a,c){Ext.form.TriggerField.superclass.onResize.call(this,a,c);var b=this.getTriggerWidth();if(Ext.isNumber(a)){this.el.setWidth(a-b)}this.wrap.setWidth(this.el.getWidth()+b)},getTriggerWidth:function(){var a=this.trigger.getWidth();if(!this.hideTrigger&&!this.readOnly&&a===0){a=this.defaultTriggerWidth}return a},alignErrorIcon:function(){if(this.wrap){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])}},onRender:function(b,a){this.doc=Ext.isIE?Ext.getBody():Ext.getDoc();Ext.form.TriggerField.superclass.onRender.call(this,b,a);this.wrap=this.el.wrap({cls:"x-form-field-wrap x-form-field-trigger-wrap"});this.trigger=this.wrap.createChild(this.triggerConfig||{tag:"img",src:Ext.BLANK_IMAGE_URL,alt:"",cls:"x-form-trigger "+this.triggerClass});this.initTrigger();if(!this.width){this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())}this.resizeEl=this.positionEl=this.wrap},getWidth:function(){return(this.el.getWidth()+this.trigger.getWidth())},updateEditState:function(){if(this.rendered){if(this.readOnly){this.el.dom.readOnly=true;this.el.addClass("x-trigger-noedit");this.mun(this.el,"click",this.onTriggerClick,this);this.trigger.setDisplayed(false)}else{if(!this.editable){this.el.dom.readOnly=true;this.el.addClass("x-trigger-noedit");this.mon(this.el,"click",this.onTriggerClick,this)}else{this.el.dom.readOnly=false;this.el.removeClass("x-trigger-noedit");this.mun(this.el,"click",this.onTriggerClick,this)}this.trigger.setDisplayed(!this.hideTrigger)}this.onResize(this.width||this.wrap.getWidth())}},setHideTrigger:function(a){if(a!=this.hideTrigger){this.hideTrigger=a;this.updateEditState()}},setEditable:function(a){if(a!=this.editable){this.editable=a;this.updateEditState()}},setReadOnly:function(a){if(a!=this.readOnly){this.readOnly=a;this.updateEditState()}},afterRender:function(){Ext.form.TriggerField.superclass.afterRender.call(this);this.updateEditState()},initTrigger:function(){this.mon(this.trigger,"click",this.onTriggerClick,this,{preventDefault:true});this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},onDestroy:function(){Ext.destroy(this.trigger,this.wrap);if(this.mimicing){this.doc.un("mousedown",this.mimicBlur,this)}delete this.doc;Ext.form.TriggerField.superclass.onDestroy.call(this)},onFocus:function(){Ext.form.TriggerField.superclass.onFocus.call(this);if(!this.mimicing){this.wrap.addClass(this.wrapFocusClass);this.mimicing=true;this.doc.on("mousedown",this.mimicBlur,this,{delay:10});if(this.monitorTab){this.on("specialkey",this.checkTab,this)}}},checkTab:function(a,b){if(b.getKey()==b.TAB){this.triggerBlur()}},onBlur:Ext.emptyFn,mimicBlur:function(a){if(!this.isDestroyed&&!this.wrap.contains(a.target)&&this.validateBlur(a)){this.triggerBlur()}},triggerBlur:function(){this.mimicing=false;this.doc.un("mousedown",this.mimicBlur,this);if(this.monitorTab&&this.el){this.un("specialkey",this.checkTab,this)}Ext.form.TriggerField.superclass.onBlur.call(this);if(this.wrap){this.wrap.removeClass(this.wrapFocusClass)}},beforeBlur:Ext.emptyFn,validateBlur:function(a){return true},onTriggerClick:Ext.emptyFn});Ext.form.TwinTriggerField=Ext.extend(Ext.form.TriggerField,{initComponent:function(){Ext.form.TwinTriggerField.superclass.initComponent.call(this);this.triggerConfig={tag:"span",cls:"x-form-twin-triggers",cn:[{tag:"img",src:Ext.BLANK_IMAGE_URL,alt:"",cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Ext.BLANK_IMAGE_URL,alt:"",cls:"x-form-trigger "+this.trigger2Class}]}},getTrigger:function(a){return this.triggers[a]},afterRender:function(){Ext.form.TwinTriggerField.superclass.afterRender.call(this);var c=this.triggers,b=0,a=c.length;for(;b<a;++b){if(this["hideTrigger"+(b+1)]){c[b].hide()}}},initTrigger:function(){var a=this.trigger.select(".x-form-trigger",true),b=this;a.each(function(d,g,c){var e="Trigger"+(c+1);d.hide=function(){var h=b.wrap.getWidth();this.dom.style.display="none";b.el.setWidth(h-b.trigger.getWidth());b["hidden"+e]=true};d.show=function(){var h=b.wrap.getWidth();this.dom.style.display="";b.el.setWidth(h-b.trigger.getWidth());b["hidden"+e]=false};this.mon(d,"click",this["on"+e+"Click"],this,{preventDefault:true});d.addClassOnOver("x-form-trigger-over");d.addClassOnClick("x-form-trigger-click")},this);this.triggers=a.elements},getTriggerWidth:function(){var a=0;Ext.each(this.triggers,function(d,c){var e="Trigger"+(c+1),b=d.getWidth();if(b===0&&!this["hidden"+e]){a+=this.defaultTriggerWidth}else{a+=b}},this);return a},onDestroy:function(){Ext.destroy(this.triggers);Ext.form.TwinTriggerField.superclass.onDestroy.call(this)},onTrigger1Click:Ext.emptyFn,onTrigger2Click:Ext.emptyFn});Ext.reg("trigger",Ext.form.TriggerField);Ext.form.TextArea=Ext.extend(Ext.form.TextField,{growMin:60,growMax:1000,growAppend:"&#160;\n&#160;",enterIsSpecial:false,preventScrollbars:false,onRender:function(b,a){if(!this.el){this.defaultAutoCreate={tag:"textarea",style:"width:100px;height:60px;",autocomplete:"off"}}Ext.form.TextArea.superclass.onRender.call(this,b,a);if(this.grow){this.textSizeEl=Ext.DomHelper.append(document.body,{tag:"pre",cls:"x-form-grow-sizer"});if(this.preventScrollbars){this.el.setStyle("overflow","hidden")}this.el.setHeight(this.growMin)}},onDestroy:function(){Ext.removeNode(this.textSizeEl);Ext.form.TextArea.superclass.onDestroy.call(this)},fireKey:function(a){if(a.isSpecialKey()&&(this.enterIsSpecial||(a.getKey()!=a.ENTER||a.hasModifier()))){this.fireEvent("specialkey",this,a)}},doAutoSize:function(a){return !a.isNavKeyPress()||a.getKey()==a.ENTER},filterValidation:function(a){if(!a.isNavKeyPress()||(!this.enterIsSpecial&&a.keyCode==a.ENTER)){this.validationTask.delay(this.validationDelay)}},autoSize:function(){if(!this.grow||!this.textSizeEl){return}var c=this.el,a=Ext.util.Format.htmlEncode(c.dom.value),d=this.textSizeEl,b;Ext.fly(d).setWidth(this.el.getWidth());if(a.length<1){a="&#160;&#160;"}else{a+=this.growAppend;if(Ext.isIE){a=a.replace(/\n/g,"&#160;<br />")}}d.innerHTML=a;b=Math.min(this.growMax,Math.max(d.offsetHeight,this.growMin));if(b!=this.lastHeight){this.lastHeight=b;this.el.setHeight(b);this.fireEvent("autosize",this,b)}}});Ext.reg("textarea",Ext.form.TextArea);Ext.form.NumberField=Ext.extend(Ext.form.TextField,{fieldClass:"x-form-field x-form-num-field",allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",baseChars:"0123456789",autoStripChars:false,initEvents:function(){var a=this.baseChars+"";if(this.allowDecimals){a+=this.decimalSeparator}if(this.allowNegative){a+="-"}a=Ext.escapeRe(a);this.maskRe=new RegExp("["+a+"]");if(this.autoStripChars){this.stripCharsRe=new RegExp("[^"+a+"]","gi")}Ext.form.NumberField.superclass.initEvents.call(this)},getErrors:function(b){var c=Ext.form.NumberField.superclass.getErrors.apply(this,arguments);b=Ext.isDefined(b)?b:this.processValue(this.getRawValue());if(b.length<1){return c}b=String(b).replace(this.decimalSeparator,".");if(isNaN(b)){c.push(String.format(this.nanText,b))}var a=this.parseValue(b);if(a<this.minValue){c.push(String.format(this.minText,this.minValue))}if(a>this.maxValue){c.push(String.format(this.maxText,this.maxValue))}return c},getValue:function(){return this.fixPrecision(this.parseValue(Ext.form.NumberField.superclass.getValue.call(this)))},setValue:function(a){a=this.fixPrecision(a);a=Ext.isNumber(a)?a:parseFloat(String(a).replace(this.decimalSeparator,"."));a=isNaN(a)?"":String(a).replace(".",this.decimalSeparator);return Ext.form.NumberField.superclass.setValue.call(this,a)},setMinValue:function(a){this.minValue=Ext.num(a,Number.NEGATIVE_INFINITY)},setMaxValue:function(a){this.maxValue=Ext.num(a,Number.MAX_VALUE)},parseValue:function(a){a=parseFloat(String(a).replace(this.decimalSeparator,"."));return isNaN(a)?"":a},fixPrecision:function(b){var a=isNaN(b);if(!this.allowDecimals||this.decimalPrecision==-1||a||!b){return a?"":b}return parseFloat(parseFloat(b).toFixed(this.decimalPrecision))},beforeBlur:function(){var a=this.parseValue(this.getRawValue());if(!Ext.isEmpty(a)){this.setValue(a)}}});Ext.reg("numberfield",Ext.form.NumberField);Ext.form.DateField=Ext.extend(Ext.form.TriggerField,{format:"m/d/Y",altFormats:"m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d|n-j|n/j",disabledDaysText:"Disabled",disabledDatesText:"Disabled",minText:"The date in this field must be equal to or after {0}",maxText:"The date in this field must be equal to or before {0}",invalidText:"{0} is not a valid date - it must be in the format {1}",triggerClass:"x-form-date-trigger",showToday:true,startDay:0,defaultAutoCreate:{tag:"input",type:"text",size:"10",autocomplete:"off"},initTime:"12",initTimeFormat:"H",safeParse:function(b,c){if(/[gGhH]/.test(c.replace(/(\\.)/g,""))){return Date.parseDate(b,c)}else{var a=Date.parseDate(b+" "+this.initTime,c+" "+this.initTimeFormat);if(a){return a.clearTime()}}},initComponent:function(){Ext.form.DateField.superclass.initComponent.call(this);this.addEvents("select");if(Ext.isString(this.minValue)){this.minValue=this.parseDate(this.minValue)}if(Ext.isString(this.maxValue)){this.maxValue=this.parseDate(this.maxValue)}this.disabledDatesRE=null;this.initDisabledDays()},initEvents:function(){Ext.form.DateField.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{down:function(a){this.onTriggerClick()},scope:this,forceKeyDown:true})},initDisabledDays:function(){if(this.disabledDates){var b=this.disabledDates,a=b.length-1,c="(?:";Ext.each(b,function(g,e){c+=Ext.isDate(g)?"^"+Ext.escapeRe(g.dateFormat(this.format))+"$":b[e];if(e!=a){c+="|"}},this);this.disabledDatesRE=new RegExp(c+")")}},setDisabledDates:function(a){this.disabledDates=a;this.initDisabledDays();if(this.menu){this.menu.picker.setDisabledDates(this.disabledDatesRE)}},setDisabledDays:function(a){this.disabledDays=a;if(this.menu){this.menu.picker.setDisabledDays(a)}},setMinValue:function(a){this.minValue=(Ext.isString(a)?this.parseDate(a):a);if(this.menu){this.menu.picker.setMinDate(this.minValue)}},setMaxValue:function(a){this.maxValue=(Ext.isString(a)?this.parseDate(a):a);if(this.menu){this.menu.picker.setMaxDate(this.maxValue)}},getErrors:function(e){var h=Ext.form.DateField.superclass.getErrors.apply(this,arguments);e=this.formatDate(e||this.processValue(this.getRawValue()));if(e.length<1){return h}var c=e;e=this.parseDate(e);if(!e){h.push(String.format(this.invalidText,c,this.format));return h}var g=e.getTime();if(this.minValue&&g<this.minValue.clearTime().getTime()){h.push(String.format(this.minText,this.formatDate(this.minValue)))}if(this.maxValue&&g>this.maxValue.clearTime().getTime()){h.push(String.format(this.maxText,this.formatDate(this.maxValue)))}if(this.disabledDays){var a=e.getDay();for(var b=0;b<this.disabledDays.length;b++){if(a===this.disabledDays[b]){h.push(this.disabledDaysText);break}}}var d=this.formatDate(e);if(this.disabledDatesRE&&this.disabledDatesRE.test(d)){h.push(String.format(this.disabledDatesText,d))}return h},validateBlur:function(){return !this.menu||!this.menu.isVisible()},getValue:function(){return this.parseDate(Ext.form.DateField.superclass.getValue.call(this))||""},setValue:function(a){return Ext.form.DateField.superclass.setValue.call(this,this.formatDate(this.parseDate(a)))},parseDate:function(g){if(!g||Ext.isDate(g)){return g}var b=this.safeParse(g,this.format),c=this.altFormats,e=this.altFormatsArray;if(!b&&c){e=e||c.split("|");for(var d=0,a=e.length;d<a&&!b;d++){b=this.safeParse(g,e[d])}}return b},onDestroy:function(){Ext.destroy(this.menu,this.keyNav);Ext.form.DateField.superclass.onDestroy.call(this)},formatDate:function(a){return Ext.isDate(a)?a.dateFormat(this.format):a},onTriggerClick:function(){if(this.disabled){return}if(this.menu==null){this.menu=new Ext.menu.DateMenu({hideOnClick:false,focusOnSelect:false})}this.onFocus();Ext.apply(this.menu.picker,{minDate:this.minValue,maxDate:this.maxValue,disabledDatesRE:this.disabledDatesRE,disabledDatesText:this.disabledDatesText,disabledDays:this.disabledDays,disabledDaysText:this.disabledDaysText,format:this.format,showToday:this.showToday,startDay:this.startDay,minText:String.format(this.minText,this.formatDate(this.minValue)),maxText:String.format(this.maxText,this.formatDate(this.maxValue))});this.menu.picker.setValue(this.getValue()||new Date());this.menu.show(this.el,"tl-bl?");this.menuEvents("on")},menuEvents:function(a){this.menu[a]("select",this.onSelect,this);this.menu[a]("hide",this.onMenuHide,this);this.menu[a]("show",this.onFocus,this)},onSelect:function(a,b){this.setValue(b);this.fireEvent("select",this,b);this.menu.hide()},onMenuHide:function(){this.focus(false,60);this.menuEvents("un")},beforeBlur:function(){var a=this.parseDate(this.getRawValue());if(a){this.setValue(a)}}});Ext.reg("datefield",Ext.form.DateField);Ext.form.DisplayField=Ext.extend(Ext.form.Field,{validationEvent:false,validateOnBlur:false,defaultAutoCreate:{tag:"div"},fieldClass:"x-form-display-field",htmlEncode:false,initEvents:Ext.emptyFn,isValid:function(){return true},validate:function(){return true},getRawValue:function(){var a=this.rendered?this.el.dom.innerHTML:Ext.value(this.value,"");if(a===this.emptyText){a=""}if(this.htmlEncode){a=Ext.util.Format.htmlDecode(a)}return a},getValue:function(){return this.getRawValue()},getName:function(){return this.name},setRawValue:function(a){if(this.htmlEncode){a=Ext.util.Format.htmlEncode(a)}return this.rendered?(this.el.dom.innerHTML=(Ext.isEmpty(a)?"":a)):(this.value=a)},setValue:function(a){this.setRawValue(a);return this}});Ext.reg("displayfield",Ext.form.DisplayField);Ext.form.ComboBox=Ext.extend(Ext.form.TriggerField,{defaultAutoCreate:{tag:"input",type:"text",size:"24",autocomplete:"off"},listClass:"",selectedClass:"x-combo-selected",listEmptyText:"",triggerClass:"x-form-arrow-trigger",shadow:"sides",listAlign:"tl-bl?",maxHeight:300,minHeight:90,triggerAction:"query",minChars:4,autoSelect:true,typeAhead:false,queryDelay:500,pageSize:0,selectOnFocus:false,queryParam:"query",loadingText:"Loading...",resizable:false,handleHeight:8,allQuery:"",mode:"remote",minListWidth:70,forceSelection:false,typeAheadDelay:250,lazyInit:true,clearFilterOnReset:true,submitValue:undefined,initComponent:function(){Ext.form.ComboBox.superclass.initComponent.call(this);this.addEvents("expand","collapse","beforeselect","select","beforequery");if(this.transform){var c=Ext.getDom(this.transform);if(!this.hiddenName){this.hiddenName=c.name}if(!this.store){this.mode="local";var k=[],e=c.options;for(var b=0,a=e.length;b<a;b++){var h=e[b],g=(h.hasAttribute?h.hasAttribute("value"):h.getAttributeNode("value").specified)?h.value:h.text;if(h.selected&&Ext.isEmpty(this.value,true)){this.value=g}k.push([g,h.text])}this.store=new Ext.data.ArrayStore({idIndex:0,fields:["value","text"],data:k,autoDestroy:true});this.valueField="value";this.displayField="text"}c.name=Ext.id();if(!this.lazyRender){this.target=true;this.el=Ext.DomHelper.insertBefore(c,this.autoCreate||this.defaultAutoCreate);this.render(this.el.parentNode,c)}Ext.removeNode(c)}else{if(this.store){this.store=Ext.StoreMgr.lookup(this.store);if(this.store.autoCreated){this.displayField=this.valueField="field1";if(!this.store.expandData){this.displayField="field2"}this.mode="local"}}}this.selectedIndex=-1;if(this.mode=="local"){if(!Ext.isDefined(this.initialConfig.queryDelay)){this.queryDelay=10}if(!Ext.isDefined(this.initialConfig.minChars)){this.minChars=0}}},onRender:function(b,a){if(this.hiddenName&&!Ext.isDefined(this.submitValue)){this.submitValue=false}Ext.form.ComboBox.superclass.onRender.call(this,b,a);if(this.hiddenName){this.hiddenField=this.el.insertSibling({tag:"input",type:"hidden",name:this.hiddenName,id:(this.hiddenId||Ext.id())},"before",true)}if(Ext.isGecko){this.el.dom.setAttribute("autocomplete","off")}if(!this.lazyInit){this.initList()}else{this.on("focus",this.initList,this,{single:true})}},initValue:function(){Ext.form.ComboBox.superclass.initValue.call(this);if(this.hiddenField){this.hiddenField.value=Ext.value(Ext.isDefined(this.hiddenValue)?this.hiddenValue:this.value,"")}},getParentZIndex:function(){var a;if(this.ownerCt){this.findParentBy(function(b){a=parseInt(b.getPositionEl().getStyle("z-index"),10);return !!a})}return a},getZIndex:function(b){b=b||Ext.getDom(this.getListParent()||Ext.getBody());var a=parseInt(Ext.fly(b).getStyle("z-index"),10);if(!a){a=this.getParentZIndex()}return(a||12000)+5},initList:function(){if(!this.list){var a="x-combo-list",c=Ext.getDom(this.getListParent()||Ext.getBody());this.list=new Ext.Layer({parentEl:c,shadow:this.shadow,cls:[a,this.listClass].join(" "),constrain:false,zindex:this.getZIndex(c)});var b=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setSize(b,0);this.list.swallowEvent("mousewheel");this.assetHeight=0;if(this.syncFont!==false){this.list.setStyle("font-size",this.el.getStyle("font-size"))}if(this.title){this.header=this.list.createChild({cls:a+"-hd",html:this.title});this.assetHeight+=this.header.getHeight()}this.innerList=this.list.createChild({cls:a+"-inner"});this.mon(this.innerList,"mouseover",this.onViewOver,this);this.mon(this.innerList,"mousemove",this.onViewMove,this);this.innerList.setWidth(b-this.list.getFrameWidth("lr"));if(this.pageSize){this.footer=this.list.createChild({cls:a+"-ft"});this.pageTb=new Ext.PagingToolbar({store:this.store,pageSize:this.pageSize,renderTo:this.footer});this.assetHeight+=this.footer.getHeight()}if(!this.tpl){this.tpl='<tpl for="."><div class="'+a+'-item">{'+this.displayField+"}</div></tpl>"}this.view=new Ext.DataView({applyTo:this.innerList,tpl:this.tpl,singleSelect:true,selectedClass:this.selectedClass,itemSelector:this.itemSelector||"."+a+"-item",emptyText:this.listEmptyText,deferEmptyText:false});this.mon(this.view,{containerclick:this.onViewClick,click:this.onViewClick,scope:this});this.bindStore(this.store,true);if(this.resizable){this.resizer=new Ext.Resizable(this.list,{pinned:true,handles:"se"});this.mon(this.resizer,"resize",function(g,d,e){this.maxHeight=e-this.handleHeight-this.list.getFrameWidth("tb")-this.assetHeight;this.listWidth=d;this.innerList.setWidth(d-this.list.getFrameWidth("lr"));this.restrictHeight()},this);this[this.pageSize?"footer":"innerList"].setStyle("margin-bottom",this.handleHeight+"px")}}},getListParent:function(){return document.body},getStore:function(){return this.store},bindStore:function(a,b){if(this.store&&!b){if(this.store!==a&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.collapse,this)}if(!a){this.store=null;if(this.view){this.view.bindStore(null)}if(this.pageTb){this.pageTb.bindStore(null)}}}if(a){if(!b){this.lastQuery=null;if(this.pageTb){this.pageTb.bindStore(a)}}this.store=Ext.StoreMgr.lookup(a);this.store.on({scope:this,beforeload:this.onBeforeLoad,load:this.onLoad,exception:this.collapse});if(this.view){this.view.bindStore(a)}}},reset:function(){if(this.clearFilterOnReset&&this.mode=="local"){this.store.clearFilter()}Ext.form.ComboBox.superclass.reset.call(this)},initEvents:function(){Ext.form.ComboBox.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{up:function(a){this.inKeyMode=true;this.selectPrev()},down:function(a){if(!this.isExpanded()){this.onTriggerClick()}else{this.inKeyMode=true;this.selectNext()}},enter:function(a){this.onViewClick()},esc:function(a){this.collapse()},tab:function(a){if(this.forceSelection===true){this.collapse()}else{this.onViewClick(false)}return true},scope:this,doRelay:function(c,b,a){if(a=="down"||this.scope.isExpanded()){var d=Ext.KeyNav.prototype.doRelay.apply(this,arguments);if(!Ext.isIE&&Ext.EventManager.useKeydown){this.scope.fireKey(c)}return d}return true},forceKeyDown:true,defaultEventAction:"stopEvent"});this.queryDelay=Math.max(this.queryDelay||10,this.mode=="local"?10:250);this.dqTask=new Ext.util.DelayedTask(this.initQuery,this);if(this.typeAhead){this.taTask=new Ext.util.DelayedTask(this.onTypeAhead,this)}if(!this.enableKeyEvents){this.mon(this.el,"keyup",this.onKeyUp,this)}},onDestroy:function(){if(this.dqTask){this.dqTask.cancel();this.dqTask=null}this.bindStore(null);Ext.destroy(this.resizer,this.view,this.pageTb,this.list);Ext.destroyMembers(this,"hiddenField");Ext.form.ComboBox.superclass.onDestroy.call(this)},fireKey:function(a){if(!this.isExpanded()){Ext.form.ComboBox.superclass.fireKey.call(this,a)}},onResize:function(a,b){Ext.form.ComboBox.superclass.onResize.apply(this,arguments);if(!isNaN(a)&&this.isVisible()&&this.list){this.doResize(a)}else{this.bufferSize=a}},doResize:function(a){if(!Ext.isDefined(this.listWidth)){var b=Math.max(a,this.minListWidth);this.list.setWidth(b);this.innerList.setWidth(b-this.list.getFrameWidth("lr"))}},onEnable:function(){Ext.form.ComboBox.superclass.onEnable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=false}},onDisable:function(){Ext.form.ComboBox.superclass.onDisable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=true}},onBeforeLoad:function(){if(!this.hasFocus){return}this.innerList.update(this.loadingText?'<div class="loading-indicator">'+this.loadingText+"</div>":"");this.restrictHeight();this.selectedIndex=-1},onLoad:function(){if(!this.hasFocus){return}if(this.store.getCount()>0||this.listEmptyText){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable){this.el.dom.select()}if(this.autoSelect!==false&&!this.selectByValue(this.value,true)){this.select(0,true)}}else{if(this.autoSelect!==false){this.selectNext()}if(this.typeAhead&&this.lastKey!=Ext.EventObject.BACKSPACE&&this.lastKey!=Ext.EventObject.DELETE){this.taTask.delay(this.typeAheadDelay)}}}else{this.collapse()}},onTypeAhead:function(){if(this.store.getCount()>0){var b=this.store.getAt(0);var c=b.data[this.displayField];var a=c.length;var d=this.getRawValue().length;if(d!=a){this.setRawValue(c);this.selectText(d,c.length)}}},assertValue:function(){var b=this.getRawValue(),a;if(this.valueField&&Ext.isDefined(this.value)){a=this.findRecord(this.valueField,this.value)}if(!a||a.get(this.displayField)!=b){a=this.findRecord(this.displayField,b)}if(!a&&this.forceSelection){if(b.length>0&&b!=this.emptyText){this.el.dom.value=Ext.value(this.lastSelectionText,"");this.applyEmptyText()}else{this.clearValue()}}else{if(a&&this.valueField){if(this.value==b){return}b=a.get(this.valueField||this.displayField)}this.setValue(b)}},onSelect:function(a,b){if(this.fireEvent("beforeselect",this,a,b)!==false){this.setValue(a.data[this.valueField||this.displayField]);this.collapse();this.fireEvent("select",this,a,b)}},getName:function(){var a=this.hiddenField;return a&&a.name?a.name:this.hiddenName||Ext.form.ComboBox.superclass.getName.call(this)},getValue:function(){if(this.valueField){return Ext.isDefined(this.value)?this.value:""}else{return Ext.form.ComboBox.superclass.getValue.call(this)}},clearValue:function(){if(this.hiddenField){this.hiddenField.value=""}this.setRawValue("");this.lastSelectionText="";this.applyEmptyText();this.value=""},setValue:function(a){var c=a;if(this.valueField){var b=this.findRecord(this.valueField,a);if(b){c=b.data[this.displayField]}else{if(Ext.isDefined(this.valueNotFoundText)){c=this.valueNotFoundText}}}this.lastSelectionText=c;if(this.hiddenField){this.hiddenField.value=Ext.value(a,"")}Ext.form.ComboBox.superclass.setValue.call(this,c);this.value=a;return this},findRecord:function(c,b){var a;if(this.store.getCount()>0){this.store.each(function(d){if(d.data[c]==b){a=d;return false}})}return a},onViewMove:function(b,a){this.inKeyMode=false},onViewOver:function(d,b){if(this.inKeyMode){return}var c=this.view.findItemFromChild(b);if(c){var a=this.view.indexOf(c);this.select(a,false)}},onViewClick:function(b){var a=this.view.getSelectedIndexes()[0],c=this.store,d=c.getAt(a);if(d){this.onSelect(d,a)}else{this.collapse()}if(b!==false){this.el.focus()}},restrictHeight:function(){this.innerList.dom.style.height="";var b=this.innerList.dom,e=this.list.getFrameWidth("tb")+(this.resizable?this.handleHeight:0)+this.assetHeight,c=Math.max(b.clientHeight,b.offsetHeight,b.scrollHeight),a=this.getPosition()[1]-Ext.getBody().getScroll().top,g=Ext.lib.Dom.getViewHeight()-a-this.getSize().height,d=Math.max(a,g,this.minHeight||0)-this.list.shadowOffset-e-5;c=Math.min(c,d,this.maxHeight);this.innerList.setHeight(c);this.list.beginUpdate();this.list.setHeight(c+e);this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign));this.list.endUpdate()},isExpanded:function(){return this.list&&this.list.isVisible()},selectByValue:function(a,c){if(!Ext.isEmpty(a,true)){var b=this.findRecord(this.valueField||this.displayField,a);if(b){this.select(this.store.indexOf(b),c);return true}}return false},select:function(a,c){this.selectedIndex=a;this.view.select(a);if(c!==false){var b=this.view.getNode(a);if(b){this.innerList.scrollChildIntoView(b,false)}}},selectNext:function(){var a=this.store.getCount();if(a>0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex<a-1){this.select(this.selectedIndex+1)}}}},selectPrev:function(){var a=this.store.getCount();if(a>0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex!==0){this.select(this.selectedIndex-1)}}}},onKeyUp:function(b){var a=b.getKey();if(this.editable!==false&&this.readOnly!==true&&(a==b.BACKSPACE||!b.isSpecialKey())){this.lastKey=a;this.dqTask.delay(this.queryDelay)}Ext.form.ComboBox.superclass.onKeyUp.call(this,b)},validateBlur:function(){return !this.list||!this.list.isVisible()},initQuery:function(){this.doQuery(this.getRawValue())},beforeBlur:function(){this.assertValue()},postBlur:function(){Ext.form.ComboBox.superclass.postBlur.call(this);this.collapse();this.inKeyMode=false},doQuery:function(c,b){c=Ext.isEmpty(c)?"":c;var a={query:c,forceAll:b,combo:this,cancel:false};if(this.fireEvent("beforequery",a)===false||a.cancel){return false}c=a.query;b=a.forceAll;if(b===true||(c.length>=this.minChars)){if(this.lastQuery!==c){this.lastQuery=c;if(this.mode=="local"){this.selectedIndex=-1;if(b){this.store.clearFilter()}else{this.store.filter(this.displayField,c)}this.onLoad()}else{this.store.baseParams[this.queryParam]=c;this.store.load({params:this.getParams(c)});this.expand()}}else{this.selectedIndex=-1;this.onLoad()}}},getParams:function(a){var b={},c=this.store.paramNames;if(this.pageSize){b[c.start]=0;b[c.limit]=this.pageSize}return b},collapse:function(){if(!this.isExpanded()){return}this.list.hide();Ext.getDoc().un("mousewheel",this.collapseIf,this);Ext.getDoc().un("mousedown",this.collapseIf,this);this.fireEvent("collapse",this)},collapseIf:function(a){if(!this.isDestroyed&&!a.within(this.wrap)&&!a.within(this.list)){this.collapse()}},expand:function(){if(this.isExpanded()||!this.hasFocus){return}if(this.title||this.pageSize){this.assetHeight=0;if(this.title){this.assetHeight+=this.header.getHeight()}if(this.pageSize){this.assetHeight+=this.footer.getHeight()}}if(this.bufferSize){this.doResize(this.bufferSize);delete this.bufferSize}this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign));this.list.setZIndex(this.getZIndex());this.list.show();if(Ext.isGecko2){this.innerList.setOverflow("auto")}this.mon(Ext.getDoc(),{scope:this,mousewheel:this.collapseIf,mousedown:this.collapseIf});this.fireEvent("expand",this)},onTriggerClick:function(){if(this.readOnly||this.disabled){return}if(this.isExpanded()){this.collapse();this.el.focus()}else{this.onFocus({});if(this.triggerAction=="all"){this.doQuery(this.allQuery,true)}else{this.doQuery(this.getRawValue())}this.el.focus()}}});Ext.reg("combo",Ext.form.ComboBox);Ext.form.Checkbox=Ext.extend(Ext.form.Field,{focusClass:undefined,fieldClass:"x-form-field",checked:false,boxLabel:"&#160;",defaultAutoCreate:{tag:"input",type:"checkbox",autocomplete:"off"},actionMode:"wrap",initComponent:function(){Ext.form.Checkbox.superclass.initComponent.call(this);this.addEvents("check")},onResize:function(){Ext.form.Checkbox.superclass.onResize.apply(this,arguments);if(!this.boxLabel&&!this.fieldLabel){this.el.alignTo(this.wrap,"c-c")}},initEvents:function(){Ext.form.Checkbox.superclass.initEvents.call(this);this.mon(this.el,{scope:this,click:this.onClick,change:this.onClick})},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,onRender:function(b,a){Ext.form.Checkbox.superclass.onRender.call(this,b,a);if(this.inputValue!==undefined){this.el.dom.value=this.inputValue}this.wrap=this.el.wrap({cls:"x-form-check-wrap"});if(this.boxLabel){this.wrap.createChild({tag:"label",htmlFor:this.el.id,cls:"x-form-cb-label",html:this.boxLabel})}if(this.checked){this.setValue(true)}else{this.checked=this.el.dom.checked}if(Ext.isIE&&!Ext.isStrict){this.wrap.repaint()}this.resizeEl=this.positionEl=this.wrap},onDestroy:function(){Ext.destroy(this.wrap);Ext.form.Checkbox.superclass.onDestroy.call(this)},initValue:function(){this.originalValue=this.getValue()},getValue:function(){if(this.rendered){return this.el.dom.checked}return this.checked},onClick:function(){if(this.el.dom.checked!=this.checked){this.setValue(this.el.dom.checked)}},setValue:function(a){var c=this.checked,b=this.inputValue;this.checked=(a===true||a==="true"||a=="1"||(b?a==b:String(a).toLowerCase()=="on"));if(this.rendered){this.el.dom.checked=this.checked;this.el.dom.defaultChecked=this.checked}if(c!=this.checked){this.fireEvent("check",this,this.checked);if(this.handler){this.handler.call(this.scope||this,this,this.checked)}}return this}});Ext.reg("checkbox",Ext.form.Checkbox);Ext.form.CheckboxGroup=Ext.extend(Ext.form.Field,{columns:"auto",vertical:false,allowBlank:true,blankText:"You must select at least one item in this group",defaultType:"checkbox",groupCls:"x-form-check-group",initComponent:function(){this.addEvents("change");this.on("change",this.validate,this);Ext.form.CheckboxGroup.superclass.initComponent.call(this)},onRender:function(k,g){if(!this.el){var q={autoEl:{id:this.id},cls:this.groupCls,layout:"column",renderTo:k,bufferResize:false};var a={xtype:"container",defaultType:this.defaultType,layout:"form",defaults:{hideLabel:true,anchor:"100%"}};if(this.items[0].items){Ext.apply(q,{layoutConfig:{columns:this.items.length},defaults:this.defaults,items:this.items});for(var e=0,n=this.items.length;e<n;e++){Ext.applyIf(this.items[e],a)}}else{var d,o=[];if(typeof this.columns=="string"){this.columns=this.items.length}if(!Ext.isArray(this.columns)){var m=[];for(var e=0;e<this.columns;e++){m.push((100/this.columns)*0.01)}this.columns=m}d=this.columns.length;for(var e=0;e<d;e++){var b=Ext.apply({items:[]},a);b[this.columns[e]<=1?"columnWidth":"width"]=this.columns[e];if(this.defaults){b.defaults=Ext.apply(b.defaults||{},this.defaults)}o.push(b)}if(this.vertical){var s=Math.ceil(this.items.length/d),p=0;for(var e=0,n=this.items.length;e<n;e++){if(e>0&&e%s==0){p++}if(this.items[e].fieldLabel){this.items[e].hideLabel=false}o[p].items.push(this.items[e])}}else{for(var e=0,n=this.items.length;e<n;e++){var r=e%d;if(this.items[e].fieldLabel){this.items[e].hideLabel=false}o[r].items.push(this.items[e])}}Ext.apply(q,{layoutConfig:{columns:d},items:o})}this.panel=new Ext.Container(q);this.panel.ownerCt=this;this.el=this.panel.getEl();if(this.forId&&this.itemCls){var c=this.el.up(this.itemCls).child("label",true);if(c){c.setAttribute("htmlFor",this.forId)}}var h=this.panel.findBy(function(i){return i.isFormField},this);this.items=new Ext.util.MixedCollection();this.items.addAll(h)}Ext.form.CheckboxGroup.superclass.onRender.call(this,k,g)},initValue:function(){if(this.value){this.setValue.apply(this,this.buffered?this.value:[this.value]);delete this.buffered;delete this.value}},afterRender:function(){Ext.form.CheckboxGroup.superclass.afterRender.call(this);this.eachItem(function(a){a.on("check",this.fireChecked,this);a.inGroup=true})},doLayout:function(){if(this.rendered){this.panel.forceLayout=this.ownerCt.forceLayout;this.panel.doLayout()}},fireChecked:function(){var a=[];this.eachItem(function(b){if(b.checked){a.push(b)}});this.fireEvent("change",this,a)},getErrors:function(){var b=Ext.form.CheckboxGroup.superclass.getErrors.apply(this,arguments);if(!this.allowBlank){var a=true;this.eachItem(function(c){if(c.checked){return(a=false)}});if(a){b.push(this.blankText)}}return b},isDirty:function(){if(this.disabled||!this.rendered){return false}var a=false;this.eachItem(function(b){if(b.isDirty()){a=true;return false}});return a},setReadOnly:function(a){if(this.rendered){this.eachItem(function(b){b.setReadOnly(a)})}this.readOnly=a},onDisable:function(){this.eachItem(function(a){a.disable()})},onEnable:function(){this.eachItem(function(a){a.enable()})},onResize:function(a,b){this.panel.setSize(a,b);this.panel.doLayout()},reset:function(){if(this.originalValue){this.eachItem(function(a){if(a.setValue){a.setValue(false);a.originalValue=a.getValue()}});this.resetOriginal=true;this.setValue(this.originalValue);delete this.resetOriginal}else{this.eachItem(function(a){if(a.reset){a.reset()}})}(function(){this.clearInvalid()}).defer(50,this)},setValue:function(){if(this.rendered){this.onSetValue.apply(this,arguments)}else{this.buffered=true;this.value=arguments}return this},onSetValue:function(d,c){if(arguments.length==1){if(Ext.isArray(d)){Ext.each(d,function(h,e){if(Ext.isObject(h)&&h.setValue){h.setValue(true);if(this.resetOriginal===true){h.originalValue=h.getValue()}}else{var g=this.items.itemAt(e);if(g){g.setValue(h)}}},this)}else{if(Ext.isObject(d)){for(var a in d){var b=this.getBox(a);if(b){b.setValue(d[a])}}}else{this.setValueForItem(d)}}}else{var b=this.getBox(d);if(b){b.setValue(c)}}},beforeDestroy:function(){Ext.destroy(this.panel);if(!this.rendered){Ext.destroy(this.items)}Ext.form.CheckboxGroup.superclass.beforeDestroy.call(this)},setValueForItem:function(a){a=String(a).split(",");this.eachItem(function(b){if(a.indexOf(b.inputValue)>-1){b.setValue(true)}})},getBox:function(b){var a=null;this.eachItem(function(c){if(b==c||c.dataIndex==b||c.id==b||c.getName()==b){a=c;return false}});return a},getValue:function(){var a=[];this.eachItem(function(b){if(b.checked){a.push(b)}});return a},eachItem:function(b,a){if(this.items&&this.items.each){this.items.each(b,a||this)}},getRawValue:Ext.emptyFn,setRawValue:Ext.emptyFn});Ext.reg("checkboxgroup",Ext.form.CheckboxGroup);Ext.form.CompositeField=Ext.extend(Ext.form.Field,{defaultMargins:"0 5 0 0",skipLastItemMargin:true,isComposite:true,combineErrors:true,labelConnector:", ",initComponent:function(){var g=[],b=this.items,e;for(var d=0,c=b.length;d<c;d++){e=b[d];if(!Ext.isEmpty(e.ref)){e.ref="../"+e.ref}g.push(e.fieldLabel);Ext.applyIf(e,this.defaults);if(!(d==c-1&&this.skipLastItemMargin)){Ext.applyIf(e,{margins:this.defaultMargins})}}this.fieldLabel=this.fieldLabel||this.buildLabel(g);this.fieldErrors=new Ext.util.MixedCollection(true,function(h){return h.field});this.fieldErrors.on({scope:this,add:this.updateInvalidMark,remove:this.updateInvalidMark,replace:this.updateInvalidMark});Ext.form.CompositeField.superclass.initComponent.apply(this,arguments);this.innerCt=new Ext.Container({layout:"hbox",items:this.items,cls:"x-form-composite",defaultMargins:"0 3 0 0",ownerCt:this});this.innerCt.ownerCt=undefined;var a=this.innerCt.findBy(function(h){return h.isFormField},this);this.items=new Ext.util.MixedCollection();this.items.addAll(a)},onRender:function(c,a){if(!this.el){var d=this.innerCt;d.render(c);this.el=d.getEl();if(this.combineErrors){this.eachItem(function(e){Ext.apply(e,{markInvalid:this.onFieldMarkInvalid.createDelegate(this,[e],0),clearInvalid:this.onFieldClearInvalid.createDelegate(this,[e],0)})})}var b=this.el.parent().parent().child("label",true);if(b){b.setAttribute("for",this.items.items[0].id)}}Ext.form.CompositeField.superclass.onRender.apply(this,arguments)},onFieldMarkInvalid:function(d,c){var b=d.getName(),a={field:b,errorName:d.fieldLabel||b,error:c};this.fieldErrors.replace(b,a);d.el.addClass(d.invalidClass)},onFieldClearInvalid:function(a){this.fieldErrors.removeKey(a.getName());a.el.removeClass(a.invalidClass)},updateInvalidMark:function(){var a=Ext.isIE6&&Ext.isStrict;if(this.fieldErrors.length==0){this.clearInvalid();if(a){this.clearInvalid.defer(50,this)}}else{var b=this.buildCombinedErrorMessage(this.fieldErrors.items);this.sortErrors();this.markInvalid(b);if(a){this.markInvalid(b)}}},validateValue:function(){var a=true;this.eachItem(function(b){if(!b.isValid()){a=false}});return a},buildCombinedErrorMessage:function(e){var d=[],b;for(var c=0,a=e.length;c<a;c++){b=e[c];d.push(String.format("{0}: {1}",b.errorName,b.error))}return d.join("<br />")},sortErrors:function(){var a=this.items;this.fieldErrors.sort("ASC",function(g,d){var c=function(b){return function(i){return i.getName()==b}};var h=a.findIndexBy(c(g.field)),e=a.findIndexBy(c(d.field));return h<e?-1:1})},reset:function(){this.eachItem(function(a){a.reset()});(function(){this.clearInvalid()}).defer(50,this)},clearInvalidChildren:function(){this.eachItem(function(a){a.clearInvalid()})},buildLabel:function(a){return Ext.clean(a).join(this.labelConnector)},isDirty:function(){if(this.disabled||!this.rendered){return false}var a=false;this.eachItem(function(b){if(b.isDirty()){a=true;return false}});return a},eachItem:function(b,a){if(this.items&&this.items.each){this.items.each(b,a||this)}},onResize:function(e,c,a,d){var b=this.innerCt;if(this.rendered&&b.rendered){b.setSize(e,c)}Ext.form.CompositeField.superclass.onResize.apply(this,arguments)},doLayout:function(c,b){if(this.rendered){var a=this.innerCt;a.forceLayout=this.ownerCt.forceLayout;a.doLayout(c,b)}},beforeDestroy:function(){Ext.destroy(this.innerCt);Ext.form.CompositeField.superclass.beforeDestroy.call(this)},setReadOnly:function(a){if(a==undefined){a=true}a=!!a;if(this.rendered){this.eachItem(function(b){b.setReadOnly(a)})}this.readOnly=a},onShow:function(){Ext.form.CompositeField.superclass.onShow.call(this);this.doLayout()},onDisable:function(){this.eachItem(function(a){a.disable()})},onEnable:function(){this.eachItem(function(a){a.enable()})}});Ext.reg("compositefield",Ext.form.CompositeField);Ext.form.Radio=Ext.extend(Ext.form.Checkbox,{inputType:"radio",markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,getGroupValue:function(){var a=this.el.up("form")||Ext.getBody();var b=a.child("input[name="+this.el.dom.name+"]:checked",true);return b?b.value:null},setValue:function(b){var a,d,c;if(typeof b=="boolean"){Ext.form.Radio.superclass.setValue.call(this,b)}else{if(this.rendered){a=this.getCheckEl();c=a.child("input[name="+this.el.dom.name+"][value="+b+"]",true);if(c){Ext.getCmp(c.id).setValue(true)}}}if(this.rendered&&this.checked){a=a||this.getCheckEl();d=this.getCheckEl().select("input[name="+this.el.dom.name+"]");d.each(function(e){if(e.dom.id!=this.id){Ext.getCmp(e.dom.id).setValue(false)}},this)}return this},getCheckEl:function(){if(this.inGroup){return this.el.up(".x-form-radio-group")}return this.el.up("form")||Ext.getBody()}});Ext.reg("radio",Ext.form.Radio);Ext.form.RadioGroup=Ext.extend(Ext.form.CheckboxGroup,{allowBlank:true,blankText:"You must select one item in this group",defaultType:"radio",groupCls:"x-form-radio-group",getValue:function(){var a=null;this.eachItem(function(b){if(b.checked){a=b;return false}});return a},onSetValue:function(c,b){if(arguments.length>1){var a=this.getBox(c);if(a){a.setValue(b);if(a.checked){this.eachItem(function(d){if(d!==a){d.setValue(false)}})}}}else{this.setValueForItem(c)}},setValueForItem:function(a){a=String(a).split(",")[0];this.eachItem(function(b){b.setValue(a==b.inputValue)})},fireChecked:function(){if(!this.checkTask){this.checkTask=new Ext.util.DelayedTask(this.bufferChecked,this)}this.checkTask.delay(10)},bufferChecked:function(){var a=null;this.eachItem(function(b){if(b.checked){a=b;return false}});this.fireEvent("change",this,a)},onDestroy:function(){if(this.checkTask){this.checkTask.cancel();this.checkTask=null}Ext.form.RadioGroup.superclass.onDestroy.call(this)}});Ext.reg("radiogroup",Ext.form.RadioGroup);Ext.form.Hidden=Ext.extend(Ext.form.Field,{inputType:"hidden",shouldLayout:false,onRender:function(){Ext.form.Hidden.superclass.onRender.apply(this,arguments)},initEvents:function(){this.originalValue=this.getValue()},setSize:Ext.emptyFn,setWidth:Ext.emptyFn,setHeight:Ext.emptyFn,setPosition:Ext.emptyFn,setPagePosition:Ext.emptyFn,markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn});Ext.reg("hidden",Ext.form.Hidden);Ext.form.BasicForm=Ext.extend(Ext.util.Observable,{constructor:function(b,a){Ext.apply(this,a);if(Ext.isString(this.paramOrder)){this.paramOrder=this.paramOrder.split(/[\s,|]/)}this.items=new Ext.util.MixedCollection(false,function(c){return c.getItemId()});this.addEvents("beforeaction","actionfailed","actioncomplete");if(b){this.initEl(b)}Ext.form.BasicForm.superclass.constructor.call(this)},timeout:30,paramOrder:undefined,paramsAsHash:false,waitTitle:"Please Wait...",activeAction:null,trackResetOnLoad:false,initEl:function(a){this.el=Ext.get(a);this.id=this.el.id||Ext.id();if(!this.standardSubmit){this.el.on("submit",this.onSubmit,this)}this.el.addClass("x-form")},getEl:function(){return this.el},onSubmit:function(a){a.stopEvent()},destroy:function(a){if(a!==true){this.items.each(function(b){Ext.destroy(b)});Ext.destroy(this.el)}this.items.clear();this.purgeListeners()},isValid:function(){var a=true;this.items.each(function(b){if(!b.validate()){a=false}});return a},isDirty:function(){var a=false;this.items.each(function(b){if(b.isDirty()){a=true;return false}});return a},doAction:function(b,a){if(Ext.isString(b)){b=new Ext.form.Action.ACTION_TYPES[b](this,a)}if(this.fireEvent("beforeaction",this,b)!==false){this.beforeAction(b);b.run.defer(100,b)}return this},submit:function(b){b=b||{};if(this.standardSubmit){var a=b.clientValidation===false||this.isValid();if(a){var c=this.el.dom;if(this.url&&Ext.isEmpty(c.action)){c.action=this.url}c.submit()}return a}var d=String.format("{0}submit",this.api?"direct":"");this.doAction(d,b);return this},load:function(a){var b=String.format("{0}load",this.api?"direct":"");this.doAction(b,a);return this},updateRecord:function(b){b.beginEdit();var a=b.fields,d,c;a.each(function(e){d=this.findField(e.name);if(d){c=d.getValue();if(typeof c!=undefined&&c.getGroupValue){c=c.getGroupValue()}else{if(d.eachItem){c=[];d.eachItem(function(g){c.push(g.getValue())})}}b.set(e.name,c)}},this);b.endEdit();return this},loadRecord:function(a){this.setValues(a.data);return this},beforeAction:function(a){this.items.each(function(c){if(c.isFormField&&c.syncValue){c.syncValue()}});var b=a.options;if(b.waitMsg){if(this.waitMsgTarget===true){this.el.mask(b.waitMsg,"x-mask-loading")}else{if(this.waitMsgTarget){this.waitMsgTarget=Ext.get(this.waitMsgTarget);this.waitMsgTarget.mask(b.waitMsg,"x-mask-loading")}else{Ext.MessageBox.wait(b.waitMsg,b.waitTitle||this.waitTitle)}}}},afterAction:function(a,c){this.activeAction=null;var b=a.options;if(b.waitMsg){if(this.waitMsgTarget===true){this.el.unmask()}else{if(this.waitMsgTarget){this.waitMsgTarget.unmask()}else{Ext.MessageBox.updateProgress(1);Ext.MessageBox.hide()}}}if(c){if(b.reset){this.reset()}Ext.callback(b.success,b.scope,[this,a]);this.fireEvent("actioncomplete",this,a)}else{Ext.callback(b.failure,b.scope,[this,a]);this.fireEvent("actionfailed",this,a)}},findField:function(c){var b=this.items.get(c);if(!Ext.isObject(b)){var a=function(d){if(d.isFormField){if(d.dataIndex==c||d.id==c||d.getName()==c){b=d;return false}else{if(d.isComposite){return d.items.each(a)}else{if(d instanceof Ext.form.CheckboxGroup&&d.rendered){return d.eachItem(a)}}}}};this.items.each(a)}return b||null},markInvalid:function(h){if(Ext.isArray(h)){for(var c=0,a=h.length;c<a;c++){var b=h[c];var d=this.findField(b.id);if(d){d.markInvalid(b.msg)}}}else{var e,g;for(g in h){if(!Ext.isFunction(h[g])&&(e=this.findField(g))){e.markInvalid(h[g])}}}return this},setValues:function(c){if(Ext.isArray(c)){for(var d=0,a=c.length;d<a;d++){var b=c[d];var e=this.findField(b.id);if(e){e.setValue(b.value);if(this.trackResetOnLoad){e.originalValue=e.getValue()}}}}else{var g,h;for(h in c){if(!Ext.isFunction(c[h])&&(g=this.findField(h))){g.setValue(c[h]);if(this.trackResetOnLoad){g.originalValue=g.getValue()}}}}return this},getValues:function(b){var a=Ext.lib.Ajax.serializeForm(this.el.dom);if(b===true){return a}return Ext.urlDecode(a)},getFieldValues:function(a){var d={},e,b,c;this.items.each(function(g){if(!g.disabled&&(a!==true||g.isDirty())){e=g.getName();b=d[e];c=g.getValue();if(Ext.isDefined(b)){if(Ext.isArray(b)){d[e].push(c)}else{d[e]=[b,c]}}else{d[e]=c}}});return d},clearInvalid:function(){this.items.each(function(a){a.clearInvalid()});return this},reset:function(){this.items.each(function(a){a.reset()});return this},add:function(){this.items.addAll(Array.prototype.slice.call(arguments,0));return this},remove:function(a){this.items.remove(a);return this},cleanDestroyed:function(){this.items.filterBy(function(a){return !!a.isDestroyed}).each(this.remove,this)},render:function(){this.items.each(function(a){if(a.isFormField&&!a.rendered&&document.getElementById(a.id)){a.applyToMarkup(a.id)}});return this},applyToFields:function(a){this.items.each(function(b){Ext.apply(b,a)});return this},applyIfToFields:function(a){this.items.each(function(b){Ext.applyIf(b,a)});return this},callFieldMethod:function(b,a){a=a||[];this.items.each(function(c){if(Ext.isFunction(c[b])){c[b].apply(c,a)}});return this}});Ext.BasicForm=Ext.form.BasicForm;Ext.FormPanel=Ext.extend(Ext.Panel,{minButtonWidth:75,labelAlign:"left",monitorValid:false,monitorPoll:200,layout:"form",initComponent:function(){this.form=this.createForm();Ext.FormPanel.superclass.initComponent.call(this);this.bodyCfg={tag:"form",cls:this.baseCls+"-body",method:this.method||"POST",id:this.formId||Ext.id()};if(this.fileUpload){this.bodyCfg.enctype="multipart/form-data"}this.initItems();this.addEvents("clientvalidation");this.relayEvents(this.form,["beforeaction","actionfailed","actioncomplete"])},createForm:function(){var a=Ext.applyIf({listeners:{}},this.initialConfig);return new Ext.form.BasicForm(null,a)},initFields:function(){var c=this.form;var a=this;var b=function(d){if(a.isField(d)){c.add(d)}else{if(d.findBy&&d!=a){a.applySettings(d);if(d.items&&d.items.each){d.items.each(b,this)}}}};this.items.each(b,this)},applySettings:function(b){var a=b.ownerCt;Ext.applyIf(b,{labelAlign:a.labelAlign,labelWidth:a.labelWidth,itemCls:a.itemCls})},getLayoutTarget:function(){return this.form.el},getForm:function(){return this.form},onRender:function(b,a){this.initFields();Ext.FormPanel.superclass.onRender.call(this,b,a);this.form.initEl(this.body)},beforeDestroy:function(){this.stopMonitoring();this.form.destroy(true);Ext.FormPanel.superclass.beforeDestroy.call(this)},isField:function(a){return !!a.setValue&&!!a.getValue&&!!a.markInvalid&&!!a.clearInvalid},initEvents:function(){Ext.FormPanel.superclass.initEvents.call(this);this.on({scope:this,add:this.onAddEvent,remove:this.onRemoveEvent});if(this.monitorValid){this.startMonitoring()}},onAdd:function(a){Ext.FormPanel.superclass.onAdd.call(this,a);this.processAdd(a)},onAddEvent:function(a,b){if(a!==this){this.processAdd(b)}},processAdd:function(a){if(this.isField(a)){this.form.add(a)}else{if(a.findBy){this.applySettings(a);this.form.add.apply(this.form,a.findBy(this.isField))}}},onRemove:function(a){Ext.FormPanel.superclass.onRemove.call(this,a);this.processRemove(a)},onRemoveEvent:function(a,b){if(a!==this){this.processRemove(b)}},processRemove:function(a){if(!this.destroying){if(this.isField(a)){this.form.remove(a)}else{if(a.findBy){Ext.each(a.findBy(this.isField),this.form.remove,this.form);this.form.cleanDestroyed()}}}},startMonitoring:function(){if(!this.validTask){this.validTask=new Ext.util.TaskRunner();this.validTask.start({run:this.bindHandler,interval:this.monitorPoll||200,scope:this})}},stopMonitoring:function(){if(this.validTask){this.validTask.stopAll();this.validTask=null}},load:function(){this.form.load.apply(this.form,arguments)},onDisable:function(){Ext.FormPanel.superclass.onDisable.call(this);if(this.form){this.form.items.each(function(){this.disable()})}},onEnable:function(){Ext.FormPanel.superclass.onEnable.call(this);if(this.form){this.form.items.each(function(){this.enable()})}},bindHandler:function(){var e=true;this.form.items.each(function(g){if(!g.isValid(true)){e=false;return false}});if(this.fbar){var b=this.fbar.items.items;for(var d=0,a=b.length;d<a;d++){var c=b[d];if(c.formBind===true&&c.disabled===e){c.setDisabled(!e)}}}this.fireEvent("clientvalidation",this,e)}});Ext.reg("form",Ext.FormPanel);Ext.form.FormPanel=Ext.FormPanel;Ext.form.FieldSet=Ext.extend(Ext.Panel,{baseCls:"x-fieldset",layout:"form",animCollapse:false,onRender:function(b,a){if(!this.el){this.el=document.createElement("fieldset");this.el.id=this.id;if(this.title||this.header||this.checkboxToggle){this.el.appendChild(document.createElement("legend")).className=this.baseCls+"-header"}}Ext.form.FieldSet.superclass.onRender.call(this,b,a);if(this.checkboxToggle){var c=typeof this.checkboxToggle=="object"?this.checkboxToggle:{tag:"input",type:"checkbox",name:this.checkboxName||this.id+"-checkbox"};this.checkbox=this.header.insertFirst(c);this.checkbox.dom.checked=!this.collapsed;this.mon(this.checkbox,"click",this.onCheckClick,this)}},onCollapse:function(a,b){if(this.checkbox){this.checkbox.dom.checked=false}Ext.form.FieldSet.superclass.onCollapse.call(this,a,b)},onExpand:function(a,b){if(this.checkbox){this.checkbox.dom.checked=true}Ext.form.FieldSet.superclass.onExpand.call(this,a,b)},onCheckClick:function(){this[this.checkbox.dom.checked?"expand":"collapse"]()}});Ext.reg("fieldset",Ext.form.FieldSet);Ext.form.HtmlEditor=Ext.extend(Ext.form.Field,{enableFormat:true,enableFontSize:true,enableColors:true,enableAlignments:true,enableLists:true,enableSourceEdit:true,enableLinks:true,enableFont:true,createLinkText:"Please enter the URL for the link:",defaultLinkValue:"http://",fontFamilies:["Arial","Courier New","Tahoma","Times New Roman","Verdana"],defaultFont:"tahoma",defaultValue:(Ext.isOpera||Ext.isIE6)?"&#160;":"&#8203;",actionMode:"wrap",validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Ext.emptyFn,iframePad:3,hideMode:"offsets",defaultAutoCreate:{tag:"textarea",style:"width:500px;height:300px;",autocomplete:"off"},initComponent:function(){this.addEvents("initialize","activate","beforesync","beforepush","sync","push","editmodechange");Ext.form.HtmlEditor.superclass.initComponent.call(this)},createFontOptions:function(){var d=[],b=this.fontFamilies,c,g;for(var e=0,a=b.length;e<a;e++){c=b[e];g=c.toLowerCase();d.push('<option value="',g,'" style="font-family:',c,';"',(this.defaultFont==g?' selected="true">':">"),c,"</option>")}return d.join("")},createToolbar:function(e){var c=[];var a=Ext.QuickTips&&Ext.QuickTips.isEnabled();function d(k,h,i){return{itemId:k,cls:"x-btn-icon",iconCls:"x-edit-"+k,enableToggle:h!==false,scope:e,handler:i||e.relayBtnCmd,clickEvent:"mousedown",tooltip:a?e.buttonTips[k]||undefined:undefined,overflowText:e.buttonTips[k].title||undefined,tabIndex:-1}}if(this.enableFont&&!Ext.isSafari2){var g=new Ext.Toolbar.Item({autoEl:{tag:"select",cls:"x-font-select",html:this.createFontOptions()}});c.push(g,"-")}if(this.enableFormat){c.push(d("bold"),d("italic"),d("underline"))}if(this.enableFontSize){c.push("-",d("increasefontsize",false,this.adjustFont),d("decreasefontsize",false,this.adjustFont))}if(this.enableColors){c.push("-",{itemId:"forecolor",cls:"x-btn-icon",iconCls:"x-edit-forecolor",clickEvent:"mousedown",tooltip:a?e.buttonTips.forecolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({allowReselect:true,focus:Ext.emptyFn,value:"000000",plain:true,listeners:{scope:this,select:function(i,h){this.execCmd("forecolor",Ext.isWebKit||Ext.isIE?"#"+h:h);this.deferFocus()}},clickEvent:"mousedown"})},{itemId:"backcolor",cls:"x-btn-icon",iconCls:"x-edit-backcolor",clickEvent:"mousedown",tooltip:a?e.buttonTips.backcolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({focus:Ext.emptyFn,value:"FFFFFF",plain:true,allowReselect:true,listeners:{scope:this,select:function(i,h){if(Ext.isGecko){this.execCmd("useCSS",false);this.execCmd("hilitecolor",h);this.execCmd("useCSS",true);this.deferFocus()}else{this.execCmd(Ext.isOpera?"hilitecolor":"backcolor",Ext.isWebKit||Ext.isIE?"#"+h:h);this.deferFocus()}}},clickEvent:"mousedown"})})}if(this.enableAlignments){c.push("-",d("justifyleft"),d("justifycenter"),d("justifyright"))}if(!Ext.isSafari2){if(this.enableLinks){c.push("-",d("createlink",false,this.createLink))}if(this.enableLists){c.push("-",d("insertorderedlist"),d("insertunorderedlist"))}if(this.enableSourceEdit){c.push("-",d("sourceedit",true,function(h){this.toggleSourceEdit(!this.sourceEditMode)}))}}var b=new Ext.Toolbar({renderTo:this.wrap.dom.firstChild,items:c});if(g){this.fontSelect=g.el;this.mon(this.fontSelect,"change",function(){var h=this.fontSelect.dom.value;this.relayCmd("fontname",h);this.deferFocus()},this)}this.mon(b.el,"click",function(h){h.preventDefault()});this.tb=b;this.tb.doLayout()},onDisable:function(){this.wrap.mask();Ext.form.HtmlEditor.superclass.onDisable.call(this)},onEnable:function(){this.wrap.unmask();Ext.form.HtmlEditor.superclass.onEnable.call(this)},setReadOnly:function(b){Ext.form.HtmlEditor.superclass.setReadOnly.call(this,b);if(this.initialized){if(Ext.isIE){this.getEditorBody().contentEditable=!b}else{this.setDesignMode(!b)}var a=this.getEditorBody();if(a){a.style.cursor=this.readOnly?"default":"text"}this.disableItems(b)}},getDocMarkup:function(){var a=Ext.fly(this.iframe).getHeight()-this.iframePad*2;return String.format('<html><head><style type="text/css">body{border: 0; margin: 0; padding: {0}px; height: {1}px; cursor: text}</style></head><body></body></html>',this.iframePad,a)},getEditorBody:function(){var a=this.getDoc();return a.body||a.documentElement},getDoc:function(){return Ext.isIE?this.getWin().document:(this.iframe.contentDocument||this.getWin().document)},getWin:function(){return Ext.isIE?this.iframe.contentWindow:window.frames[this.iframe.name]},onRender:function(b,a){Ext.form.HtmlEditor.superclass.onRender.call(this,b,a);this.el.dom.style.border="0 none";this.el.dom.setAttribute("tabIndex",-1);this.el.addClass("x-hidden");if(Ext.isIE){this.el.applyStyles("margin-top:-1px;margin-bottom:-1px;")}this.wrap=this.el.wrap({cls:"x-html-editor-wrap",cn:{cls:"x-html-editor-tb"}});this.createToolbar(this);this.disableItems(true);this.tb.doLayout();this.createIFrame();if(!this.width){var c=this.el.getSize();this.setSize(c.width,this.height||c.height)}this.resizeEl=this.positionEl=this.wrap},createIFrame:function(){var a=document.createElement("iframe");a.name=Ext.id();a.frameBorder="0";a.style.overflow="auto";a.src=Ext.SSL_SECURE_URL;this.wrap.dom.appendChild(a);this.iframe=a;this.monitorTask=Ext.TaskMgr.start({run:this.checkDesignMode,scope:this,interval:100})},initFrame:function(){Ext.TaskMgr.stop(this.monitorTask);var b=this.getDoc();this.win=this.getWin();b.open();b.write(this.getDocMarkup());b.close();var a={run:function(){var c=this.getDoc();if(c.body||c.readyState=="complete"){Ext.TaskMgr.stop(a);this.setDesignMode(true);this.initEditor.defer(10,this)}},interval:10,duration:10000,scope:this};Ext.TaskMgr.start(a)},checkDesignMode:function(){if(this.wrap&&this.wrap.dom.offsetWidth){var a=this.getDoc();if(!a){return}if(!a.editorInitialized||this.getDesignMode()!="on"){this.initFrame()}}},setDesignMode:function(b){var a=this.getDoc();if(a){if(this.readOnly){b=false}a.designMode=(/on|true/i).test(String(b).toLowerCase())?"on":"off"}},getDesignMode:function(){var a=this.getDoc();if(!a){return""}return String(a.designMode).toLowerCase()},disableItems:function(a){if(this.fontSelect){this.fontSelect.dom.disabled=a}this.tb.items.each(function(b){if(b.getItemId()!="sourceedit"){b.setDisabled(a)}})},onResize:function(b,c){Ext.form.HtmlEditor.superclass.onResize.apply(this,arguments);if(this.el&&this.iframe){if(Ext.isNumber(b)){var e=b-this.wrap.getFrameWidth("lr");this.el.setWidth(e);this.tb.setWidth(e);this.iframe.style.width=Math.max(e,0)+"px"}if(Ext.isNumber(c)){var a=c-this.wrap.getFrameWidth("tb")-this.tb.el.getHeight();this.el.setHeight(a);this.iframe.style.height=Math.max(a,0)+"px";var d=this.getEditorBody();if(d){d.style.height=Math.max((a-(this.iframePad*2)),0)+"px"}}}},toggleSourceEdit:function(b){var d,a;if(b===undefined){b=!this.sourceEditMode}this.sourceEditMode=b===true;var c=this.tb.getComponent("sourceedit");if(c.pressed!==this.sourceEditMode){c.toggle(this.sourceEditMode);if(!c.xtbHidden){return}}if(this.sourceEditMode){this.previousSize=this.getSize();d=Ext.get(this.iframe).getHeight();this.disableItems(true);this.syncValue();this.iframe.className="x-hidden";this.el.removeClass("x-hidden");this.el.dom.removeAttribute("tabIndex");this.el.focus();this.el.dom.style.height=d+"px"}else{a=parseInt(this.el.dom.style.height,10);if(this.initialized){this.disableItems(this.readOnly)}this.pushValue();this.iframe.className="";this.el.addClass("x-hidden");this.el.dom.setAttribute("tabIndex",-1);this.deferFocus();this.setSize(this.previousSize);delete this.previousSize;this.iframe.style.height=a+"px"}this.fireEvent("editmodechange",this,this.sourceEditMode)},createLink:function(){var a=prompt(this.createLinkText,this.defaultLinkValue);if(a&&a!="http://"){this.relayCmd("createlink",a)}},initEvents:function(){this.originalValue=this.getValue()},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,setValue:function(a){Ext.form.HtmlEditor.superclass.setValue.call(this,a);this.pushValue();return this},cleanHtml:function(a){a=String(a);if(Ext.isWebKit){a=a.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,"")}if(a.charCodeAt(0)==this.defaultValue.replace(/\D/g,"")){a=a.substring(1)}return a},syncValue:function(){if(this.initialized){var d=this.getEditorBody();var c=d.innerHTML;if(Ext.isWebKit){var b=d.getAttribute("style");var a=b.match(/text-align:(.*?);/i);if(a&&a[1]){c='<div style="'+a[0]+'">'+c+"</div>"}}c=this.cleanHtml(c);if(this.fireEvent("beforesync",this,c)!==false){this.el.dom.value=c;this.fireEvent("sync",this,c)}}},getValue:function(){this[this.sourceEditMode?"pushValue":"syncValue"]();return Ext.form.HtmlEditor.superclass.getValue.call(this)},pushValue:function(){if(this.initialized){var a=this.el.dom.value;if(!this.activated&&a.length<1){a=this.defaultValue}if(this.fireEvent("beforepush",this,a)!==false){this.getEditorBody().innerHTML=a;if(Ext.isGecko){this.setDesignMode(false);this.setDesignMode(true)}this.fireEvent("push",this,a)}}},deferFocus:function(){this.focus.defer(10,this)},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus()}else{this.el.focus()}},initEditor:function(){try{var c=this.getEditorBody(),a=this.el.getStyles("font-size","font-family","background-image","background-repeat","background-color","color"),g,b;a["background-attachment"]="fixed";c.bgProperties="fixed";Ext.DomHelper.applyStyles(c,a);g=this.getDoc();if(g){try{Ext.EventManager.removeAll(g)}catch(d){}}b=this.onEditorEvent.createDelegate(this);Ext.EventManager.on(g,{mousedown:b,dblclick:b,click:b,keyup:b,buffer:100});if(Ext.isGecko){Ext.EventManager.on(g,"keypress",this.applyCommand,this)}if(Ext.isIE||Ext.isWebKit||Ext.isOpera){Ext.EventManager.on(g,"keydown",this.fixKeys,this)}g.editorInitialized=true;this.initialized=true;this.pushValue();this.setReadOnly(this.readOnly);this.fireEvent("initialize",this)}catch(d){}},beforeDestroy:function(){if(this.monitorTask){Ext.TaskMgr.stop(this.monitorTask)}if(this.rendered){Ext.destroy(this.tb);var b=this.getDoc();if(b){try{Ext.EventManager.removeAll(b);for(var c in b){delete b[c]}}catch(a){}}if(this.wrap){this.wrap.dom.innerHTML="";this.wrap.remove()}}Ext.form.HtmlEditor.superclass.beforeDestroy.call(this)},onFirstFocus:function(){this.activated=true;this.disableItems(this.readOnly);if(Ext.isGecko){this.win.focus();var a=this.win.getSelection();if(!a.focusNode||a.focusNode.nodeType!=3){var b=a.getRangeAt(0);b.selectNodeContents(this.getEditorBody());b.collapse(true);this.deferFocus()}try{this.execCmd("useCSS",true);this.execCmd("styleWithCSS",false)}catch(c){}}this.fireEvent("activate",this)},adjustFont:function(b){var d=b.getItemId()=="increasefontsize"?1:-1,c=this.getDoc(),a=parseInt(c.queryCommandValue("FontSize")||2,10);if((Ext.isSafari&&!Ext.isSafari2)||Ext.isChrome||Ext.isAir){if(a<=10){a=1+d}else{if(a<=13){a=2+d}else{if(a<=16){a=3+d}else{if(a<=18){a=4+d}else{if(a<=24){a=5+d}else{a=6+d}}}}}a=a.constrain(1,6)}else{if(Ext.isSafari){d*=2}a=Math.max(1,a+d)+(Ext.isSafari?"px":0)}this.execCmd("FontSize",a)},onEditorEvent:function(a){this.updateToolbar()},updateToolbar:function(){if(this.readOnly){return}if(!this.activated){this.onFirstFocus();return}var b=this.tb.items.map,c=this.getDoc();if(this.enableFont&&!Ext.isSafari2){var a=(c.queryCommandValue("FontName")||this.defaultFont).toLowerCase();if(a!=this.fontSelect.dom.value){this.fontSelect.dom.value=a}}if(this.enableFormat){b.bold.toggle(c.queryCommandState("bold"));b.italic.toggle(c.queryCommandState("italic"));b.underline.toggle(c.queryCommandState("underline"))}if(this.enableAlignments){b.justifyleft.toggle(c.queryCommandState("justifyleft"));b.justifycenter.toggle(c.queryCommandState("justifycenter"));b.justifyright.toggle(c.queryCommandState("justifyright"))}if(!Ext.isSafari2&&this.enableLists){b.insertorderedlist.toggle(c.queryCommandState("insertorderedlist"));b.insertunorderedlist.toggle(c.queryCommandState("insertunorderedlist"))}Ext.menu.MenuMgr.hideAll();this.syncValue()},relayBtnCmd:function(a){this.relayCmd(a.getItemId())},relayCmd:function(b,a){(function(){this.focus();this.execCmd(b,a);this.updateToolbar()}).defer(10,this)},execCmd:function(b,a){var c=this.getDoc();c.execCommand(b,false,a===undefined?null:a);this.syncValue()},applyCommand:function(b){if(b.ctrlKey){var d=b.getCharCode(),a;if(d>0){d=String.fromCharCode(d);switch(d){case"b":a="bold";break;case"i":a="italic";break;case"u":a="underline";break}if(a){this.win.focus();this.execCmd(a);this.deferFocus();b.preventDefault()}}}},insertAtCursor:function(c){if(!this.activated){return}if(Ext.isIE){this.win.focus();var b=this.getDoc(),a=b.selection.createRange();if(a){a.pasteHTML(c);this.syncValue();this.deferFocus()}}else{this.win.focus();this.execCmd("InsertHTML",c);this.deferFocus()}},fixKeys:function(){if(Ext.isIE){return function(g){var a=g.getKey(),d=this.getDoc(),b;if(a==g.TAB){g.stopEvent();b=d.selection.createRange();if(b){b.collapse(true);b.pasteHTML("&nbsp;&nbsp;&nbsp;&nbsp;");this.deferFocus()}}else{if(a==g.ENTER){b=d.selection.createRange();if(b){var c=b.parentElement();if(!c||c.tagName.toLowerCase()!="li"){g.stopEvent();b.pasteHTML("<br />");b.collapse(false);b.select()}}}}}}else{if(Ext.isOpera){return function(b){var a=b.getKey();if(a==b.TAB){b.stopEvent();this.win.focus();this.execCmd("InsertHTML","&nbsp;&nbsp;&nbsp;&nbsp;");this.deferFocus()}}}else{if(Ext.isWebKit){return function(b){var a=b.getKey();if(a==b.TAB){b.stopEvent();this.execCmd("InsertText","\t");this.deferFocus()}else{if(a==b.ENTER){b.stopEvent();this.execCmd("InsertHtml","<br /><br />");this.deferFocus()}}}}}}}(),getToolbar:function(){return this.tb},buttonTips:{bold:{title:"Bold (Ctrl+B)",text:"Make the selected text bold.",cls:"x-html-editor-tip"},italic:{title:"Italic (Ctrl+I)",text:"Make the selected text italic.",cls:"x-html-editor-tip"},underline:{title:"Underline (Ctrl+U)",text:"Underline the selected text.",cls:"x-html-editor-tip"},increasefontsize:{title:"Grow Text",text:"Increase the font size.",cls:"x-html-editor-tip"},decreasefontsize:{title:"Shrink Text",text:"Decrease the font size.",cls:"x-html-editor-tip"},backcolor:{title:"Text Highlight Color",text:"Change the background color of the selected text.",cls:"x-html-editor-tip"},forecolor:{title:"Font Color",text:"Change the color of the selected text.",cls:"x-html-editor-tip"},justifyleft:{title:"Align Text Left",text:"Align text to the left.",cls:"x-html-editor-tip"},justifycenter:{title:"Center Text",text:"Center text in the editor.",cls:"x-html-editor-tip"},justifyright:{title:"Align Text Right",text:"Align text to the right.",cls:"x-html-editor-tip"},insertunorderedlist:{title:"Bullet List",text:"Start a bulleted list.",cls:"x-html-editor-tip"},insertorderedlist:{title:"Numbered List",text:"Start a numbered list.",cls:"x-html-editor-tip"},createlink:{title:"Hyperlink",text:"Make the selected text a hyperlink.",cls:"x-html-editor-tip"},sourceedit:{title:"Source Edit",text:"Switch to source editing mode.",cls:"x-html-editor-tip"}}});Ext.reg("htmleditor",Ext.form.HtmlEditor);Ext.form.TimeField=Ext.extend(Ext.form.ComboBox,{minValue:undefined,maxValue:undefined,minText:"The time in this field must be equal to or after {0}",maxText:"The time in this field must be equal to or before {0}",invalidText:"{0} is not a valid time",format:"g:i A",altFormats:"g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H|gi a|hi a|giA|hiA|gi A|hi A",increment:15,mode:"local",triggerAction:"all",typeAhead:false,initDate:"1/1/2008",initDateFormat:"j/n/Y",initComponent:function(){if(Ext.isDefined(this.minValue)){this.setMinValue(this.minValue,true)}if(Ext.isDefined(this.maxValue)){this.setMaxValue(this.maxValue,true)}if(!this.store){this.generateStore(true)}Ext.form.TimeField.superclass.initComponent.call(this)},setMinValue:function(b,a){this.setLimit(b,true,a);return this},setMaxValue:function(b,a){this.setLimit(b,false,a);return this},generateStore:function(b){var c=this.minValue||new Date(this.initDate).clearTime(),a=this.maxValue||new Date(this.initDate).clearTime().add("mi",(24*60)-1),d=[];while(c<=a){d.push(c.dateFormat(this.format));c=c.add("mi",this.increment)}this.bindStore(d,b)},setLimit:function(b,g,a){var e;if(Ext.isString(b)){e=this.parseDate(b)}else{if(Ext.isDate(b)){e=b}}if(e){var c=new Date(this.initDate).clearTime();c.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());this[g?"minValue":"maxValue"]=c;if(!a){this.generateStore()}}},getValue:function(){var a=Ext.form.TimeField.superclass.getValue.call(this);return this.formatDate(this.parseDate(a))||""},setValue:function(a){return Ext.form.TimeField.superclass.setValue.call(this,this.formatDate(this.parseDate(a)))},validateValue:Ext.form.DateField.prototype.validateValue,formatDate:Ext.form.DateField.prototype.formatDate,parseDate:function(h){if(!h||Ext.isDate(h)){return h}var k=this.initDate+" ",g=this.initDateFormat+" ",b=Date.parseDate(k+h,g+this.format),c=this.altFormats;if(!b&&c){if(!this.altFormatsArray){this.altFormatsArray=c.split("|")}for(var e=0,d=this.altFormatsArray,a=d.length;e<a&&!b;e++){b=Date.parseDate(k+h,g+d[e])}}return b}});Ext.reg("timefield",Ext.form.TimeField);Ext.form.SliderField=Ext.extend(Ext.form.Field,{useTips:true,tipText:null,actionMode:"wrap",initComponent:function(){var b=Ext.copyTo({id:this.id+"-slider"},this.initialConfig,["vertical","minValue","maxValue","decimalPrecision","keyIncrement","increment","clickToChange","animate"]);if(this.useTips){var a=this.tipText?{getText:this.tipText}:{};b.plugins=[new Ext.slider.Tip(a)]}this.slider=new Ext.Slider(b);Ext.form.SliderField.superclass.initComponent.call(this)},onRender:function(b,a){this.autoCreate={id:this.id,name:this.name,type:"hidden",tag:"input"};Ext.form.SliderField.superclass.onRender.call(this,b,a);this.wrap=this.el.wrap({cls:"x-form-field-wrap"});this.resizeEl=this.positionEl=this.wrap;this.slider.render(this.wrap)},onResize:function(b,c,d,a){Ext.form.SliderField.superclass.onResize.call(this,b,c,d,a);this.slider.setSize(b,c)},initEvents:function(){Ext.form.SliderField.superclass.initEvents.call(this);this.slider.on("change",this.onChange,this)},onChange:function(b,a){this.setValue(a,undefined,true)},onEnable:function(){Ext.form.SliderField.superclass.onEnable.call(this);this.slider.enable()},onDisable:function(){Ext.form.SliderField.superclass.onDisable.call(this);this.slider.disable()},beforeDestroy:function(){Ext.destroy(this.slider);Ext.form.SliderField.superclass.beforeDestroy.call(this)},alignErrorIcon:function(){this.errorIcon.alignTo(this.slider.el,"tl-tr",[2,0])},setMinValue:function(a){this.slider.setMinValue(a);return this},setMaxValue:function(a){this.slider.setMaxValue(a);return this},setValue:function(c,b,a){if(!a){this.slider.setValue(c,b)}return Ext.form.SliderField.superclass.setValue.call(this,this.slider.getValue())},getValue:function(){return this.slider.getValue()}});Ext.reg("sliderfield",Ext.form.SliderField);Ext.form.Label=Ext.extend(Ext.BoxComponent,{onRender:function(b,a){if(!this.el){this.el=document.createElement("label");this.el.id=this.getId();this.el.innerHTML=this.text?Ext.util.Format.htmlEncode(this.text):(this.html||"");if(this.forId){this.el.setAttribute("for",this.forId)}}Ext.form.Label.superclass.onRender.call(this,b,a)},setText:function(a,b){var c=b===false;this[!c?"text":"html"]=a;delete this[c?"text":"html"];if(this.rendered){this.el.dom.innerHTML=b!==false?Ext.util.Format.htmlEncode(a):a}return this}});Ext.reg("label",Ext.form.Label);Ext.form.Action=function(b,a){this.form=b;this.options=a||{}};Ext.form.Action.CLIENT_INVALID="client";Ext.form.Action.SERVER_INVALID="server";Ext.form.Action.CONNECT_FAILURE="connect";Ext.form.Action.LOAD_FAILURE="load";Ext.form.Action.prototype={type:"default",run:function(a){},success:function(a){},handleResponse:function(a){},failure:function(a){this.response=a;this.failureType=Ext.form.Action.CONNECT_FAILURE;this.form.afterAction(this,false)},processResponse:function(a){this.response=a;if(!a.responseText&&!a.responseXML){return true}this.result=this.handleResponse(a);return this.result},getUrl:function(c){var a=this.options.url||this.form.url||this.form.el.dom.action;if(c){var b=this.getParams();if(b){a=Ext.urlAppend(a,b)}}return a},getMethod:function(){return(this.options.method||this.form.method||this.form.el.dom.method||"POST").toUpperCase()},getParams:function(){var a=this.form.baseParams;var b=this.options.params;if(b){if(typeof b=="object"){b=Ext.urlEncode(Ext.applyIf(b,a))}else{if(typeof b=="string"&&a){b+="&"+Ext.urlEncode(a)}}}else{if(a){b=Ext.urlEncode(a)}}return b},createCallback:function(a){var a=a||{};return{success:this.success,failure:this.failure,scope:this,timeout:(a.timeout*1000)||(this.form.timeout*1000),upload:this.form.fileUpload?this.success:undefined}}};Ext.form.Action.Submit=function(b,a){Ext.form.Action.Submit.superclass.constructor.call(this,b,a)};Ext.extend(Ext.form.Action.Submit,Ext.form.Action,{type:"submit",run:function(){var e=this.options,g=this.getMethod(),d=g=="GET";if(e.clientValidation===false||this.form.isValid()){if(e.submitEmptyText===false){var a=this.form.items,c=[],b=function(h){if(h.el.getValue()==h.emptyText){c.push(h);h.el.dom.value=""}if(h.isComposite&&h.rendered){h.items.each(b)}};a.each(b)}Ext.Ajax.request(Ext.apply(this.createCallback(e),{form:this.form.el.dom,url:this.getUrl(d),method:g,headers:e.headers,params:!d?this.getParams():null,isUpload:this.form.fileUpload}));if(e.submitEmptyText===false){Ext.each(c,function(h){if(h.applyEmptyText){h.applyEmptyText()}})}}else{if(e.clientValidation!==false){this.failureType=Ext.form.Action.CLIENT_INVALID;this.form.afterAction(this,false)}}},success:function(b){var a=this.processResponse(b);if(a===true||a.success){this.form.afterAction(this,true);return}if(a.errors){this.form.markInvalid(a.errors)}this.failureType=Ext.form.Action.SERVER_INVALID;this.form.afterAction(this,false)},handleResponse:function(c){if(this.form.errorReader){var b=this.form.errorReader.read(c);var g=[];if(b.records){for(var d=0,a=b.records.length;d<a;d++){var e=b.records[d];g[d]=e.data}}if(g.length<1){g=null}return{success:b.success,errors:g}}return Ext.decode(c.responseText)}});Ext.form.Action.Load=function(b,a){Ext.form.Action.Load.superclass.constructor.call(this,b,a);this.reader=this.form.reader};Ext.extend(Ext.form.Action.Load,Ext.form.Action,{type:"load",run:function(){Ext.Ajax.request(Ext.apply(this.createCallback(this.options),{method:this.getMethod(),url:this.getUrl(false),headers:this.options.headers,params:this.getParams()}))},success:function(b){var a=this.processResponse(b);if(a===true||!a.success||!a.data){this.failureType=Ext.form.Action.LOAD_FAILURE;this.form.afterAction(this,false);return}this.form.clearInvalid();this.form.setValues(a.data);this.form.afterAction(this,true)},handleResponse:function(b){if(this.form.reader){var a=this.form.reader.read(b);var c=a.records&&a.records[0]?a.records[0].data:null;return{success:a.success,data:c}}return Ext.decode(b.responseText)}});Ext.form.Action.DirectLoad=Ext.extend(Ext.form.Action.Load,{constructor:function(b,a){Ext.form.Action.DirectLoad.superclass.constructor.call(this,b,a)},type:"directload",run:function(){var a=this.getParams();a.push(this.success,this);this.form.api.load.apply(window,a)},getParams:function(){var c=[],h={};var e=this.form.baseParams;var g=this.options.params;Ext.apply(h,g,e);var b=this.form.paramOrder;if(b){for(var d=0,a=b.length;d<a;d++){c.push(h[b[d]])}}else{if(this.form.paramsAsHash){c.push(h)}}return c},processResponse:function(a){this.result=a;return a},success:function(a,b){if(b.type==Ext.Direct.exceptions.SERVER){a={}}Ext.form.Action.DirectLoad.superclass.success.call(this,a)}});Ext.form.Action.DirectSubmit=Ext.extend(Ext.form.Action.Submit,{constructor:function(b,a){Ext.form.Action.DirectSubmit.superclass.constructor.call(this,b,a)},type:"directsubmit",run:function(){var a=this.options;if(a.clientValidation===false||this.form.isValid()){this.success.params=this.getParams();this.form.api.submit(this.form.el.dom,this.success,this)}else{if(a.clientValidation!==false){this.failureType=Ext.form.Action.CLIENT_INVALID;this.form.afterAction(this,false)}}},getParams:function(){var c={};var a=this.form.baseParams;var b=this.options.params;Ext.apply(c,b,a);return c},processResponse:function(a){this.result=a;return a},success:function(a,b){if(b.type==Ext.Direct.exceptions.SERVER){a={}}Ext.form.Action.DirectSubmit.superclass.success.call(this,a)}});Ext.form.Action.ACTION_TYPES={load:Ext.form.Action.Load,submit:Ext.form.Action.Submit,directload:Ext.form.Action.DirectLoad,directsubmit:Ext.form.Action.DirectSubmit};Ext.form.VTypes=function(){var c=/^[a-zA-Z_]+$/,d=/^[a-zA-Z0-9_]+$/,b=/^(\w+)([\-+.][\w]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/,a=/(((^https?)|(^ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;return{email:function(e){return b.test(e)},emailText:'This field should be an e-mail address in the format "user@example.com"',emailMask:/[a-z0-9_\.\-@\+]/i,url:function(e){return a.test(e)},urlText:'This field should be a URL in the format "http://www.example.com"',alpha:function(e){return c.test(e)},alphaText:"This field should only contain letters and _",alphaMask:/[a-z_]/i,alphanum:function(e){return d.test(e)},alphanumText:"This field should only contain letters, numbers and _",alphanumMask:/[a-z0-9_]/i}}();Ext.grid.GridPanel=Ext.extend(Ext.Panel,{autoExpandColumn:false,autoExpandMax:1000,autoExpandMin:50,columnLines:false,ddText:"{0} selected row{1}",deferRowRender:true,enableColumnHide:true,enableColumnMove:true,enableDragDrop:false,enableHdMenu:true,loadMask:false,minColumnWidth:25,stripeRows:false,trackMouseOver:true,stateEvents:["columnmove","columnresize","sortchange","groupchange"],view:null,bubbleEvents:[],rendered:false,viewReady:false,initComponent:function(){Ext.grid.GridPanel.superclass.initComponent.call(this);if(this.columnLines){this.cls=(this.cls||"")+" x-grid-with-col-lines"}this.autoScroll=false;this.autoWidth=false;if(Ext.isArray(this.columns)){this.colModel=new Ext.grid.ColumnModel(this.columns);delete this.columns}if(this.ds){this.store=this.ds;delete this.ds}if(this.cm){this.colModel=this.cm;delete this.cm}if(this.sm){this.selModel=this.sm;delete this.sm}this.store=Ext.StoreMgr.lookup(this.store);this.addEvents("click","dblclick","contextmenu","mousedown","mouseup","mouseover","mouseout","keypress","keydown","cellmousedown","rowmousedown","headermousedown","groupmousedown","rowbodymousedown","containermousedown","cellclick","celldblclick","rowclick","rowdblclick","headerclick","headerdblclick","groupclick","groupdblclick","containerclick","containerdblclick","rowbodyclick","rowbodydblclick","rowcontextmenu","cellcontextmenu","headercontextmenu","groupcontextmenu","containercontextmenu","rowbodycontextmenu","bodyscroll","columnresize","columnmove","sortchange","groupchange","reconfigure","viewready")},onRender:function(d,a){Ext.grid.GridPanel.superclass.onRender.apply(this,arguments);var e=this.getGridEl();this.el.addClass("x-grid-panel");this.mon(e,{scope:this,mousedown:this.onMouseDown,click:this.onClick,dblclick:this.onDblClick,contextmenu:this.onContextMenu});this.relayEvents(e,["mousedown","mouseup","mouseover","mouseout","keypress","keydown"]);var b=this.getView();b.init(this);b.render();this.getSelectionModel().init(this)},initEvents:function(){Ext.grid.GridPanel.superclass.initEvents.call(this);if(this.loadMask){this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({store:this.store},this.loadMask))}},initStateEvents:function(){Ext.grid.GridPanel.superclass.initStateEvents.call(this);this.mon(this.colModel,"hiddenchange",this.saveState,this,{delay:100})},applyState:function(a){var l=this.colModel,g=a.columns,k=this.store,n,h,m;if(g){for(var d=0,e=g.length;d<e;d++){n=g[d];h=l.getColumnById(n.id);if(h){m=l.getIndexById(n.id);l.setState(m,{hidden:n.hidden,width:n.width,sortable:n.sortable});if(m!=d){l.moveColumn(m,d)}}}}if(k){n=a.sort;if(n){k[k.remoteSort?"setDefaultSort":"sort"](n.field,n.direction)}n=a.group;if(k.groupBy){if(n){k.groupBy(n)}else{k.clearGrouping()}}}var b=Ext.apply({},a);delete b.columns;delete b.sort;Ext.grid.GridPanel.superclass.applyState.call(this,b)},getState:function(){var g={columns:[]},b=this.store,e,a;for(var d=0,h;(h=this.colModel.config[d]);d++){g.columns[d]={id:h.id,width:h.width};if(h.hidden){g.columns[d].hidden=true}if(h.sortable){g.columns[d].sortable=true}}if(b){e=b.getSortState();if(e){g.sort=e}if(b.getGroupState){a=b.getGroupState();if(a){g.group=a}}}return g},afterRender:function(){Ext.grid.GridPanel.superclass.afterRender.call(this);var a=this.view;this.on("bodyresize",a.layout,a);a.layout(true);if(this.deferRowRender){if(!this.deferRowRenderTask){this.deferRowRenderTask=new Ext.util.DelayedTask(a.afterRender,this.view)}this.deferRowRenderTask.delay(10)}else{a.afterRender()}this.viewReady=true},reconfigure:function(a,b){var c=this.rendered;if(c){if(this.loadMask){this.loadMask.destroy();this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({},{store:a},this.initialConfig.loadMask))}}if(this.view){this.view.initData(a,b)}this.store=a;this.colModel=b;if(c){this.view.refresh(true)}this.fireEvent("reconfigure",this,a,b)},onDestroy:function(){if(this.deferRowRenderTask&&this.deferRowRenderTask.cancel){this.deferRowRenderTask.cancel()}if(this.rendered){Ext.destroy(this.view,this.loadMask)}else{if(this.store&&this.store.autoDestroy){this.store.destroy()}}Ext.destroy(this.colModel,this.selModel);this.store=this.selModel=this.colModel=this.view=this.loadMask=null;Ext.grid.GridPanel.superclass.onDestroy.call(this)},processEvent:function(a,b){this.view.processEvent(a,b)},onClick:function(a){this.processEvent("click",a)},onMouseDown:function(a){this.processEvent("mousedown",a)},onContextMenu:function(b,a){this.processEvent("contextmenu",b)},onDblClick:function(a){this.processEvent("dblclick",a)},walkCells:function(l,c,b,e,k){var i=this.colModel,g=i.getColumnCount(),a=this.store,h=a.getCount(),d=true;if(b<0){if(c<0){l--;d=false}while(l>=0){if(!d){c=g-1}d=false;while(c>=0){if(e.call(k||this,l,c,i)===true){return[l,c]}c--}l--}}else{if(c>=g){l++;d=false}while(l<h){if(!d){c=0}d=false;while(c<g){if(e.call(k||this,l,c,i)===true){return[l,c]}c++}l++}}return null},getGridEl:function(){return this.body},stopEditing:Ext.emptyFn,getSelectionModel:function(){if(!this.selModel){this.selModel=new Ext.grid.RowSelectionModel(this.disableSelection?{selectRow:Ext.emptyFn}:null)}return this.selModel},getStore:function(){return this.store},getColumnModel:function(){return this.colModel},getView:function(){if(!this.view){this.view=new Ext.grid.GridView(this.viewConfig)}return this.view},getDragDropText:function(){var a=this.selModel.getCount();return String.format(this.ddText,a,a==1?"":"s")}});Ext.reg("grid",Ext.grid.GridPanel);Ext.grid.PivotGrid=Ext.extend(Ext.grid.GridPanel,{aggregator:"sum",renderer:undefined,initComponent:function(){Ext.grid.PivotGrid.superclass.initComponent.apply(this,arguments);this.initAxes();this.enableColumnResize=false;this.viewConfig=Ext.apply(this.viewConfig||{},{forceFit:true});this.colModel=new Ext.grid.ColumnModel({})},getAggregator:function(){if(typeof this.aggregator=="string"){return Ext.grid.PivotAggregatorMgr.types[this.aggregator]}else{return this.aggregator}},setAggregator:function(a){this.aggregator=a},setMeasure:function(a){this.measure=a},setLeftAxis:function(b,a){this.leftAxis=b;if(a){this.view.refresh()}},setTopAxis:function(b,a){this.topAxis=b;if(a){this.view.refresh()}},initAxes:function(){var a=Ext.grid.PivotAxis;if(!(this.leftAxis instanceof a)){this.setLeftAxis(new a({orientation:"vertical",dimensions:this.leftAxis||[],store:this.store}))}if(!(this.topAxis instanceof a)){this.setTopAxis(new a({orientation:"horizontal",dimensions:this.topAxis||[],store:this.store}))}},extractData:function(){var c=this.store.data.items,s=c.length,q=[],h,g,e,d;if(s==0){return[]}var l=this.leftAxis.getTuples(),o=l.length,m=this.topAxis.getTuples(),a=m.length,b=this.getAggregator();for(g=0;g<s;g++){h=c[g];for(e=0;e<o;e++){q[e]=q[e]||[];if(l[e].matcher(h)===true){for(d=0;d<a;d++){q[e][d]=q[e][d]||[];if(m[d].matcher(h)){q[e][d].push(h)}}}}}var n=q.length,p,r;for(g=0;g<n;g++){r=q[g];p=r.length;for(e=0;e<p;e++){q[g][e]=b(q[g][e],this.measure)}}return q},getView:function(){if(!this.view){this.view=new Ext.grid.PivotGridView(this.viewConfig)}return this.view}});Ext.reg("pivotgrid",Ext.grid.PivotGrid);Ext.grid.PivotAggregatorMgr=new Ext.AbstractManager();Ext.grid.PivotAggregatorMgr.registerType("sum",function(a,c){var e=a.length,d=0,b;for(b=0;b<e;b++){d+=a[b].get(c)}return d});Ext.grid.PivotAggregatorMgr.registerType("avg",function(a,c){var e=a.length,d=0,b;for(b=0;b<e;b++){d+=a[b].get(c)}return(d/e)||"n/a"});Ext.grid.PivotAggregatorMgr.registerType("min",function(a,c){var e=[],d=a.length,b;for(b=0;b<d;b++){e.push(a[b].get(c))}return Math.min.apply(this,e)||"n/a"});Ext.grid.PivotAggregatorMgr.registerType("max",function(a,c){var e=[],d=a.length,b;for(b=0;b<d;b++){e.push(a[b].get(c))}return Math.max.apply(this,e)||"n/a"});Ext.grid.PivotAggregatorMgr.registerType("count",function(a,b){return a.length});Ext.grid.GridView=Ext.extend(Ext.util.Observable,{deferEmptyText:true,scrollOffset:undefined,autoFill:false,forceFit:false,sortClasses:["sort-asc","sort-desc"],sortAscText:"Sort Ascending",sortDescText:"Sort Descending",columnsText:"Columns",selectedRowClass:"x-grid3-row-selected",borderWidth:2,tdClass:"x-grid3-cell",hdCls:"x-grid3-hd",markDirty:true,cellSelectorDepth:4,rowSelectorDepth:10,rowBodySelectorDepth:10,cellSelector:"td.x-grid3-cell",rowSelector:"div.x-grid3-row",rowBodySelector:"div.x-grid3-row-body",firstRowCls:"x-grid3-row-first",lastRowCls:"x-grid3-row-last",rowClsRe:/(?:^|\s+)x-grid3-row-(first|last|alt)(?:\s+|$)/g,headerMenuOpenCls:"x-grid3-hd-menu-open",rowOverCls:"x-grid3-row-over",constructor:function(a){Ext.apply(this,a);this.addEvents("beforerowremoved","beforerowsinserted","beforerefresh","rowremoved","rowsinserted","rowupdated","refresh");Ext.grid.GridView.superclass.constructor.call(this)},masterTpl:new Ext.Template('<div class="x-grid3" hidefocus="true">','<div class="x-grid3-viewport">','<div class="x-grid3-header">','<div class="x-grid3-header-inner">','<div class="x-grid3-header-offset" style="{ostyle}">{header}</div>',"</div>",'<div class="x-clear"></div>',"</div>",'<div class="x-grid3-scroller">','<div class="x-grid3-body" style="{bstyle}">{body}</div>','<a href="#" class="x-grid3-focus" tabIndex="-1"></a>',"</div>","</div>",'<div class="x-grid3-resize-marker">&#160;</div>','<div class="x-grid3-resize-proxy">&#160;</div>',"</div>"),headerTpl:new Ext.Template('<table border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',"<thead>",'<tr class="x-grid3-hd-row">{cells}</tr>',"</thead>","</table>"),bodyTpl:new Ext.Template("{rows}"),cellTpl:new Ext.Template('<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} {css}" style="{style}" tabIndex="0" {cellAttr}>','<div class="x-grid3-cell-inner x-grid3-col-{id}" unselectable="on" {attr}>{value}</div>',"</td>"),initTemplates:function(){var c=this.templates||{},d,b,g=new Ext.Template('<td class="x-grid3-hd x-grid3-cell x-grid3-td-{id} {css}" style="{style}">','<div {tooltip} {attr} class="x-grid3-hd-inner x-grid3-hd-{id}" unselectable="on" style="{istyle}">',this.grid.enableHdMenu?'<a class="x-grid3-hd-btn" href="#"></a>':"","{value}",'<img alt="" class="x-grid3-sort-icon" src="',Ext.BLANK_IMAGE_URL,'" />',"</div>","</td>"),a=['<tr class="x-grid3-row-body-tr" style="{bodyStyle}">','<td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on">','<div class="x-grid3-row-body">{body}</div>',"</td>","</tr>"].join(""),e=['<table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',"<tbody>","<tr>{cells}</tr>",this.enableRowBody?a:"","</tbody>","</table>"].join("");Ext.applyIf(c,{hcell:g,cell:this.cellTpl,body:this.bodyTpl,header:this.headerTpl,master:this.masterTpl,row:new Ext.Template('<div class="x-grid3-row {alt}" style="{tstyle}">'+e+"</div>"),rowInner:new Ext.Template(e)});for(b in c){d=c[b];if(d&&Ext.isFunction(d.compile)&&!d.compiled){d.disableFormats=true;d.compile()}}this.templates=c;this.colRe=new RegExp("x-grid3-td-([^\\s]+)","")},fly:function(a){if(!this._flyweight){this._flyweight=new Ext.Element.Flyweight(document.body)}this._flyweight.dom=a;return this._flyweight},getEditorParent:function(){return this.scroller.dom},initElements:function(){var b=Ext.Element,d=Ext.get(this.grid.getGridEl().dom.firstChild),e=new b(d.child("div.x-grid3-viewport")),c=new b(e.child("div.x-grid3-header")),a=new b(e.child("div.x-grid3-scroller"));if(this.grid.hideHeaders){c.setDisplayed(false)}if(this.forceFit){a.setStyle("overflow-x","hidden")}Ext.apply(this,{el:d,mainWrap:e,scroller:a,mainHd:c,innerHd:c.child("div.x-grid3-header-inner").dom,mainBody:new b(b.fly(a).child("div.x-grid3-body")),focusEl:new b(b.fly(a).child("a")),resizeMarker:new b(d.child("div.x-grid3-resize-marker")),resizeProxy:new b(d.child("div.x-grid3-resize-proxy"))});this.focusEl.swallowEvent("click",true)},getRows:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},findCell:function(a){if(!a){return false}return this.fly(a).findParent(this.cellSelector,this.cellSelectorDepth)},findCellIndex:function(d,c){var b=this.findCell(d),a;if(b){a=this.fly(b).hasClass(c);if(!c||a){return this.getCellIndex(b)}}return false},getCellIndex:function(b){if(b){var a=b.className.match(this.colRe);if(a&&a[1]){return this.cm.getIndexById(a[1])}}return false},findHeaderCell:function(b){var a=this.findCell(b);return a&&this.fly(a).hasClass(this.hdCls)?a:null},findHeaderIndex:function(a){return this.findCellIndex(a,this.hdCls)},findRow:function(a){if(!a){return false}return this.fly(a).findParent(this.rowSelector,this.rowSelectorDepth)},findRowIndex:function(a){var b=this.findRow(a);return b?b.rowIndex:false},findRowBody:function(a){if(!a){return false}return this.fly(a).findParent(this.rowBodySelector,this.rowBodySelectorDepth)},getRow:function(a){return this.getRows()[a]},getCell:function(b,a){return Ext.fly(this.getRow(b)).query(this.cellSelector)[a]},getHeaderCell:function(a){return this.mainHd.dom.getElementsByTagName("td")[a]},addRowClass:function(b,a){var c=this.getRow(b);if(c){this.fly(c).addClass(a)}},removeRowClass:function(c,a){var b=this.getRow(c);if(b){this.fly(b).removeClass(a)}},removeRow:function(a){Ext.removeNode(this.getRow(a));this.syncFocusEl(a)},removeRows:function(c,a){var b=this.mainBody.dom,d;for(d=c;d<=a;d++){Ext.removeNode(b.childNodes[c])}this.syncFocusEl(c)},getScrollState:function(){var a=this.scroller.dom;return{left:a.scrollLeft,top:a.scrollTop}},restoreScroll:function(a){var b=this.scroller.dom;b.scrollLeft=a.left;b.scrollTop=a.top},scrollToTop:function(){var a=this.scroller.dom;a.scrollTop=0;a.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var a=this.scroller.dom;this.grid.fireEvent("bodyscroll",a.scrollLeft,a.scrollTop)},syncHeaderScroll:function(){var a=this.innerHd,b=this.scroller.dom.scrollLeft;a.scrollLeft=b;a.scrollLeft=b},updateSortIcon:function(d,c){var a=this.sortClasses,b=a[c=="DESC"?1:0],e=this.mainHd.select("td").removeClass(a);e.item(d).addClass(b)},updateAllColumnWidths:function(){var e=this.getTotalWidth(),k=this.cm.getColumnCount(),m=this.getRows(),g=m.length,b=[],l,a,h,d,c;for(d=0;d<k;d++){b[d]=this.getColumnWidth(d);this.getHeaderCell(d).style.width=b[d]}this.updateHeaderWidth();for(d=0;d<g;d++){l=m[d];l.style.width=e;a=l.firstChild;if(a){a.style.width=e;h=a.rows[0];for(c=0;c<k;c++){h.childNodes[c].style.width=b[c]}}}this.onAllColumnWidthsUpdated(b,e)},updateColumnWidth:function(d,b){var c=this.getColumnWidth(d),k=this.getTotalWidth(),h=this.getHeaderCell(d),a=this.getRows(),e=a.length,m,g,l;this.updateHeaderWidth();h.style.width=c;for(g=0;g<e;g++){m=a[g];l=m.firstChild;m.style.width=k;if(l){l.style.width=k;l.rows[0].childNodes[d].style.width=c}}this.onColumnWidthUpdated(d,c,k)},updateColumnHidden:function(b,k){var h=this.getTotalWidth(),l=k?"none":"",g=this.getHeaderCell(b),a=this.getRows(),d=a.length,m,c,e;this.updateHeaderWidth();g.style.display=l;for(e=0;e<d;e++){m=a[e];m.style.width=h;c=m.firstChild;if(c){c.style.width=h;c.rows[0].childNodes[b].style.display=l}}this.onColumnHiddenUpdated(b,k,h);delete this.lastViewWidth;this.layout()},doRender:function(d,v,m,a,r,t){var h=this.templates,c=h.cell,y=h.row,o=r-1,b="width:"+this.getTotalWidth()+";",k=[],l=[],n={tstyle:b},q={},w=v.length,x,g,e,u,s,p;for(s=0;s<w;s++){e=v[s];l=[];p=s+a;for(u=0;u<r;u++){g=d[u];q.id=g.id;q.css=u===0?"x-grid3-cell-first ":(u==o?"x-grid3-cell-last ":"");q.attr=q.cellAttr="";q.style=g.style;q.value=g.renderer.call(g.scope,e.data[g.name],q,e,p,u,m);if(Ext.isEmpty(q.value)){q.value="&#160;"}if(this.markDirty&&e.dirty&&typeof e.modified[g.name]!="undefined"){q.css+=" x-grid3-dirty-cell"}l[l.length]=c.apply(q)}x=[];if(t&&((p+1)%2===0)){x[0]="x-grid3-row-alt"}if(e.dirty){x[1]=" x-grid3-dirty-row"}n.cols=r;if(this.getRowClass){x[2]=this.getRowClass(e,p,n,m)}n.alt=x.join(" ");n.cells=l.join("");k[k.length]=y.apply(n)}return k.join("")},processRows:function(a,g){if(!this.ds||this.ds.getCount()<1){return}var d=this.getRows(),c=d.length,e,b;g=g||!this.grid.stripeRows;a=a||0;for(b=0;b<c;b++){e=d[b];if(e){e.rowIndex=b;if(!g){e.className=e.className.replace(this.rowClsRe," ");if((b+1)%2===0){e.className+=" x-grid3-row-alt"}}}}if(a===0){Ext.fly(d[0]).addClass(this.firstRowCls)}Ext.fly(d[c-1]).addClass(this.lastRowCls)},afterRender:function(){if(!this.ds||!this.cm){return}this.mainBody.dom.innerHTML=this.renderBody()||"&#160;";this.processRows(0,true);if(this.deferEmptyText!==true){this.applyEmptyText()}this.grid.fireEvent("viewready",this.grid)},afterRenderUI:function(){var a=this.grid;this.initElements();Ext.fly(this.innerHd).on("click",this.handleHdDown,this);this.mainHd.on({scope:this,mouseover:this.handleHdOver,mouseout:this.handleHdOut,mousemove:this.handleHdMove});this.scroller.on("scroll",this.syncScroll,this);if(a.enableColumnResize!==false){this.splitZone=new Ext.grid.GridView.SplitDragZone(a,this.mainHd.dom)}if(a.enableColumnMove){this.columnDrag=new Ext.grid.GridView.ColumnDragZone(a,this.innerHd);this.columnDrop=new Ext.grid.HeaderDropZone(a,this.mainHd.dom)}if(a.enableHdMenu!==false){this.hmenu=new Ext.menu.Menu({id:a.id+"-hctx"});this.hmenu.add({itemId:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"},{itemId:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"});if(a.enableColumnHide!==false){this.colMenu=new Ext.menu.Menu({id:a.id+"-hcols-menu"});this.colMenu.on({scope:this,beforeshow:this.beforeColMenuShow,itemclick:this.handleHdMenuClick});this.hmenu.add("-",{itemId:"columns",hideOnClick:false,text:this.columnsText,menu:this.colMenu,iconCls:"x-cols-icon"})}this.hmenu.on("itemclick",this.handleHdMenuClick,this)}if(a.trackMouseOver){this.mainBody.on({scope:this,mouseover:this.onRowOver,mouseout:this.onRowOut})}if(a.enableDragDrop||a.enableDrag){this.dragZone=new Ext.grid.GridDragZone(a,{ddGroup:a.ddGroup||"GridDD"})}this.updateHeaderSortState()},renderUI:function(){var a=this.templates;return a.master.apply({body:a.body.apply({rows:"&#160;"}),header:this.renderHeaders(),ostyle:"width:"+this.getOffsetWidth()+";",bstyle:"width:"+this.getTotalWidth()+";"})},processEvent:function(b,h){var i=h.getTarget(),a=this.grid,d=this.findHeaderIndex(i),l,k,c,g;a.fireEvent(b,h);if(d!==false){a.fireEvent("header"+b,a,d,h)}else{l=this.findRowIndex(i);if(l!==false){k=this.findCellIndex(i);if(k!==false){c=a.colModel.getColumnAt(k);if(a.fireEvent("cell"+b,a,l,k,h)!==false){if(!c||(c.processEvent&&(c.processEvent(b,h,a,l,k)!==false))){a.fireEvent("row"+b,a,l,h)}}}else{if(a.fireEvent("row"+b,a,l,h)!==false){(g=this.findRowBody(i))&&a.fireEvent("rowbody"+b,a,l,h)}}}else{a.fireEvent("container"+b,a,h)}}},layout:function(k){if(!this.mainBody){return}var a=this.grid,d=a.getGridEl(),c=d.getSize(true),i=c.width,b=c.height,h=this.scroller,g,e,l;if(i<20||b<20){return}if(a.autoHeight){g=h.dom.style;g.overflow="visible";if(Ext.isWebKit){g.position="static"}}else{this.el.setSize(i,b);e=this.mainHd.getHeight();l=b-e;h.setSize(i,l);if(this.innerHd){this.innerHd.style.width=(i)+"px"}}if(this.forceFit||(k===true&&this.autoFill)){if(this.lastViewWidth!=i){this.fitColumns(false,false);this.lastViewWidth=i}}else{this.autoExpand();this.syncHeaderScroll()}this.onLayout(i,l)},onLayout:function(a,b){},onColumnWidthUpdated:function(c,a,b){},onAllColumnWidthsUpdated:function(a,b){},onColumnHiddenUpdated:function(b,c,a){},updateColumnText:function(a,b){},afterMove:function(a){},init:function(a){this.grid=a;this.initTemplates();this.initData(a.store,a.colModel);this.initUI(a)},getColumnId:function(a){return this.cm.getColumnId(a)},getOffsetWidth:function(){return(this.cm.getTotalWidth()+this.getScrollOffset())+"px"},getScrollOffset:function(){return Ext.num(this.scrollOffset,Ext.getScrollBarWidth())},renderHeaders:function(){var e=this.cm,g=this.templates,a=g.hcell,d={},h=e.getColumnCount(),k=h-1,l=[],c,b;for(c=0;c<h;c++){if(c==0){b="x-grid3-cell-first "}else{b=c==k?"x-grid3-cell-last ":""}d={id:e.getColumnId(c),value:e.getColumnHeader(c)||"",style:this.getColumnStyle(c,true),css:b,tooltip:this.getColumnTooltip(c)};if(e.config[c].align=="right"){d.istyle="padding-right: 16px;"}else{delete d.istyle}l[c]=a.apply(d)}return g.header.apply({cells:l.join(""),tstyle:String.format("width: {0};",this.getTotalWidth())})},getColumnTooltip:function(a){var b=this.cm.getColumnTooltip(a);if(b){if(Ext.QuickTips.isEnabled()){return'ext:qtip="'+b+'"'}else{return'title="'+b+'"'}}return""},beforeUpdate:function(){this.grid.stopEditing(true)},updateHeaders:function(){this.innerHd.firstChild.innerHTML=this.renderHeaders();this.updateHeaderWidth(false)},updateHeaderWidth:function(c){var b=this.innerHd.firstChild,a=this.getTotalWidth();b.style.width=this.getOffsetWidth();b.firstChild.style.width=a;if(c!==false){this.mainBody.dom.style.width=a}},focusRow:function(a){this.focusCell(a,0,false)},focusCell:function(d,b,c){this.syncFocusEl(this.ensureVisible(d,b,c));var a=this.focusEl;if(Ext.isGecko){a.focus()}else{a.focus.defer(1,a)}},resolveCell:function(h,d,g){if(!Ext.isNumber(h)){h=h.rowIndex}if(!this.ds){return null}if(h<0||h>=this.ds.getCount()){return null}d=(d!==undefined?d:0);var c=this.getRow(h),b=this.cm,e=b.getColumnCount(),a;if(!(g===false&&d===0)){while(d<e&&b.isHidden(d)){d++}a=this.getCell(h,d)}return{row:c,cell:a}},getResolvedXY:function(b){if(!b){return null}var a=b.cell,c=b.row;if(a){return Ext.fly(a).getXY()}else{return[this.el.getX(),Ext.fly(c).getY()]}},syncFocusEl:function(d,a,c){var b=d;if(!Ext.isArray(b)){d=Math.min(d,Math.max(0,this.getRows().length-1));if(isNaN(d)){return}b=this.getResolvedXY(this.resolveCell(d,a,c))}this.focusEl.setXY(b||this.scroller.getXY())},ensureVisible:function(u,g,e){var s=this.resolveCell(u,g,e);if(!s||!s.row){return null}var l=s.row,h=s.cell,o=this.scroller.dom,d=l,t=0,q=this.el.dom;while(d&&d!=q){t+=d.offsetTop;d=d.offsetParent}t-=this.mainHd.dom.offsetHeight;q=parseInt(o.scrollTop,10);var r=t+l.offsetHeight,a=o.clientHeight,n=q+a;if(t<q){o.scrollTop=t}else{if(r>n){o.scrollTop=r-a}}if(e!==false){var m=parseInt(h.offsetLeft,10),k=m+h.offsetWidth,i=parseInt(o.scrollLeft,10),b=i+o.clientWidth;if(m<i){o.scrollLeft=m}else{if(k>b){o.scrollLeft=k-o.clientWidth}}}return this.getResolvedXY(s)},insertRows:function(a,i,e,h){var d=a.getCount()-1;if(!h&&i===0&&e>=d){this.fireEvent("beforerowsinserted",this,i,e);this.refresh();this.fireEvent("rowsinserted",this,i,e)}else{if(!h){this.fireEvent("beforerowsinserted",this,i,e)}var b=this.renderRows(i,e),g=this.getRow(i);if(g){if(i===0){Ext.fly(this.getRow(0)).removeClass(this.firstRowCls)}Ext.DomHelper.insertHtml("beforeBegin",g,b)}else{var c=this.getRow(d-1);if(c){Ext.fly(c).removeClass(this.lastRowCls)}Ext.DomHelper.insertHtml("beforeEnd",this.mainBody.dom,b)}if(!h){this.processRows(i);this.fireEvent("rowsinserted",this,i,e)}else{if(i===0||i>=d){Ext.fly(this.getRow(i)).addClass(i===0?this.firstRowCls:this.lastRowCls)}}}this.syncFocusEl(i)},deleteRows:function(a,c,b){if(a.getRowCount()<1){this.refresh()}else{this.fireEvent("beforerowsdeleted",this,c,b);this.removeRows(c,b);this.processRows(c);this.fireEvent("rowsdeleted",this,c,b)}},getColumnStyle:function(b,d){var a=this.cm,g=a.config,c=d?"":g[b].css||"",e=g[b].align;c+=String.format("width: {0};",this.getColumnWidth(b));if(a.isHidden(b)){c+="display: none; "}if(e){c+=String.format("text-align: {0};",e)}return c},getColumnWidth:function(b){var c=this.cm.getColumnWidth(b),a=this.borderWidth;if(Ext.isNumber(c)){if(Ext.isBorderBox||(Ext.isWebKit&&!Ext.isSafari2)){return c+"px"}else{return Math.max(c-a,0)+"px"}}else{return c}},getTotalWidth:function(){return this.cm.getTotalWidth()+"px"},fitColumns:function(g,k,h){var a=this.grid,m=this.cm,t=m.getTotalWidth(false),r=this.getGridInnerWidth(),s=r-t,c=[],p=0,o=0,v,d,q;if(r<20||s===0){return false}var e=m.getColumnCount(true),n=m.getColumnCount(false),b=e-(Ext.isNumber(h)?1:0);if(b===0){b=1;h=undefined}for(q=0;q<n;q++){if(!m.isFixed(q)&&q!==h){v=m.getColumnWidth(q);c.push(q,v);if(!m.isHidden(q)){p=q;o+=v}}}d=(r-m.getTotalWidth())/o;while(c.length){v=c.pop();q=c.pop();m.setColumnWidth(q,Math.max(a.minColumnWidth,Math.floor(v+v*d)),true)}t=m.getTotalWidth(false);if(t>r){var u=(b==e)?p:h,l=Math.max(1,m.getColumnWidth(u)-(t-r));m.setColumnWidth(u,l,true)}if(g!==true){this.updateAllColumnWidths()}return true},autoExpand:function(l){var a=this.grid,i=this.cm,e=this.getGridInnerWidth(),c=i.getTotalWidth(false),g=a.autoExpandColumn;if(!this.userResized&&g){if(e!=c){var k=i.getIndexById(g),b=i.getColumnWidth(k),h=e-c+b,d=Math.min(Math.max(h,a.autoExpandMin),a.autoExpandMax);if(b!=d){i.setColumnWidth(k,d,true);if(l!==true){this.updateColumnWidth(k,d)}}}}},getGridInnerWidth:function(){return this.grid.getGridEl().getWidth(true)-this.getScrollOffset()},getColumnData:function(){var e=[],c=this.cm,g=c.getColumnCount(),a=this.ds.fields,d,b;for(d=0;d<g;d++){b=c.getDataIndex(d);e[d]={name:Ext.isDefined(b)?b:(a.get(d)?a.get(d).name:undefined),renderer:c.getRenderer(d),scope:c.getRendererScope(d),id:c.getColumnId(d),style:this.getColumnStyle(d)}}return e},renderRows:function(i,c){var a=this.grid,g=a.store,k=a.stripeRows,e=a.colModel,h=e.getColumnCount(),d=g.getCount(),b;if(d<1){return""}i=i||0;c=Ext.isDefined(c)?c:d-1;b=g.getRange(i,c);return this.doRender(this.getColumnData(),b,g,i,h,k)},renderBody:function(){var a=this.renderRows()||"&#160;";return this.templates.body.apply({rows:a})},refreshRow:function(g){var m=this.ds,n=this.cm.getColumnCount(),c=this.getColumnData(),o=n-1,q=["x-grid3-row"],e={tstyle:String.format("width: {0};",this.getTotalWidth())},a=[],l=this.templates.cell,k,r,b,p,h,d;if(Ext.isNumber(g)){k=g;g=m.getAt(k)}else{k=m.indexOf(g)}if(!g||k<0){return}for(d=0;d<n;d++){b=c[d];if(d==0){h="x-grid3-cell-first"}else{h=(d==o)?"x-grid3-cell-last ":""}p={id:b.id,style:b.style,css:h,attr:"",cellAttr:""};p.value=b.renderer.call(b.scope,g.data[b.name],p,g,k,d,m);if(Ext.isEmpty(p.value)){p.value="&#160;"}if(this.markDirty&&g.dirty&&typeof g.modified[b.name]!="undefined"){p.css+=" x-grid3-dirty-cell"}a[d]=l.apply(p)}r=this.getRow(k);r.className="";if(this.grid.stripeRows&&((k+1)%2===0)){q.push("x-grid3-row-alt")}if(this.getRowClass){e.cols=n;q.push(this.getRowClass(g,k,e,m))}this.fly(r).addClass(q).setStyle(e.tstyle);e.cells=a.join("");r.innerHTML=this.templates.rowInner.apply(e);this.fireEvent("rowupdated",this,k,g)},refresh:function(b){this.fireEvent("beforerefresh",this);this.grid.stopEditing(true);var a=this.renderBody();this.mainBody.update(a).setWidth(this.getTotalWidth());if(b===true){this.updateHeaders();this.updateHeaderSortState()}this.processRows(0,true);this.layout();this.applyEmptyText();this.fireEvent("refresh",this)},applyEmptyText:function(){if(this.emptyText&&!this.hasRows()){this.mainBody.update('<div class="x-grid-empty">'+this.emptyText+"</div>")}},updateHeaderSortState:function(){var b=this.ds.getSortState();if(!b){return}if(!this.sortState||(this.sortState.field!=b.field||this.sortState.direction!=b.direction)){this.grid.fireEvent("sortchange",this.grid,b)}this.sortState=b;var c=this.cm.findColumnIndex(b.field);if(c!=-1){var a=b.direction;this.updateSortIcon(c,a)}},clearHeaderSortState:function(){if(!this.sortState){return}this.grid.fireEvent("sortchange",this.grid,null);this.mainHd.select("td").removeClass(this.sortClasses);delete this.sortState},destroy:function(){var k=this,a=k.grid,d=a.getGridEl(),i=k.dragZone,g=k.splitZone,h=k.columnDrag,e=k.columnDrop,l=k.scrollToTopTask,c,b;if(l&&l.cancel){l.cancel()}Ext.destroyMembers(k,"colMenu","hmenu");k.initData(null,null);k.purgeListeners();Ext.fly(k.innerHd).un("click",k.handleHdDown,k);if(a.enableColumnMove){c=h.dragData;b=h.proxy;Ext.destroy(h.el,b.ghost,b.el,e.el,e.proxyTop,e.proxyBottom,c.ddel,c.header);if(b.anim){Ext.destroy(b.anim)}delete b.ghost;delete c.ddel;delete c.header;h.destroy();delete Ext.dd.DDM.locationCache[h.id];delete h._domRef;delete e.proxyTop;delete e.proxyBottom;e.destroy();delete Ext.dd.DDM.locationCache["gridHeader"+d.id];delete e._domRef;delete Ext.dd.DDM.ids[e.ddGroup]}if(g){g.destroy();delete g._domRef;delete Ext.dd.DDM.ids["gridSplitters"+d.id]}Ext.fly(k.innerHd).removeAllListeners();Ext.removeNode(k.innerHd);delete k.innerHd;Ext.destroy(k.el,k.mainWrap,k.mainHd,k.scroller,k.mainBody,k.focusEl,k.resizeMarker,k.resizeProxy,k.activeHdBtn,k._flyweight,i,g);delete a.container;if(i){i.destroy()}Ext.dd.DDM.currentTarget=null;delete Ext.dd.DDM.locationCache[d.id];Ext.EventManager.removeResizeListener(k.onWindowResize,k)},onDenyColumnHide:function(){},render:function(){if(this.autoFill){var a=this.grid.ownerCt;if(a&&a.getLayout()){a.on("afterlayout",function(){this.fitColumns(true,true);this.updateHeaders();this.updateHeaderSortState()},this,{single:true})}}else{if(this.forceFit){this.fitColumns(true,false)}else{if(this.grid.autoExpandColumn){this.autoExpand(true)}}}this.grid.getGridEl().dom.innerHTML=this.renderUI();this.afterRenderUI()},initData:function(a,e){var b=this;if(b.ds){var d=b.ds;d.un("add",b.onAdd,b);d.un("load",b.onLoad,b);d.un("clear",b.onClear,b);d.un("remove",b.onRemove,b);d.un("update",b.onUpdate,b);d.un("datachanged",b.onDataChange,b);if(d!==a&&d.autoDestroy){d.destroy()}}if(a){a.on({scope:b,load:b.onLoad,add:b.onAdd,remove:b.onRemove,update:b.onUpdate,clear:b.onClear,datachanged:b.onDataChange})}if(b.cm){var c=b.cm;c.un("configchange",b.onColConfigChange,b);c.un("widthchange",b.onColWidthChange,b);c.un("headerchange",b.onHeaderChange,b);c.un("hiddenchange",b.onHiddenChange,b);c.un("columnmoved",b.onColumnMove,b)}if(e){delete b.lastViewWidth;e.on({scope:b,configchange:b.onColConfigChange,widthchange:b.onColWidthChange,headerchange:b.onHeaderChange,hiddenchange:b.onHiddenChange,columnmoved:b.onColumnMove})}b.ds=a;b.cm=e},onDataChange:function(){this.refresh(true);this.updateHeaderSortState();this.syncFocusEl(0)},onClear:function(){this.refresh();this.syncFocusEl(0)},onUpdate:function(b,a){this.refreshRow(a)},onAdd:function(b,a,c){this.insertRows(b,c,c+(a.length-1))},onRemove:function(b,a,c,d){if(d!==true){this.fireEvent("beforerowremoved",this,c,a)}this.removeRow(c);if(d!==true){this.processRows(c);this.applyEmptyText();this.fireEvent("rowremoved",this,c,a)}},onLoad:function(){if(Ext.isGecko){if(!this.scrollToTopTask){this.scrollToTopTask=new Ext.util.DelayedTask(this.scrollToTop,this)}this.scrollToTopTask.delay(1)}else{this.scrollToTop()}},onColWidthChange:function(a,b,c){this.updateColumnWidth(b,c)},onHeaderChange:function(a,b,c){this.updateHeaders()},onHiddenChange:function(a,b,c){this.updateColumnHidden(b,c)},onColumnMove:function(a,c,b){this.indexMap=null;this.refresh(true);this.restoreScroll(this.getScrollState());this.afterMove(b);this.grid.fireEvent("columnmove",c,b)},onColConfigChange:function(){delete this.lastViewWidth;this.indexMap=null;this.refresh(true)},initUI:function(a){a.on("headerclick",this.onHeaderClick,this)},initEvents:Ext.emptyFn,onHeaderClick:function(b,a){if(this.headersDisabled||!this.cm.isSortable(a)){return}b.stopEditing(true);b.store.sort(this.cm.getDataIndex(a))},onRowOver:function(b,a){var c=this.findRowIndex(a);if(c!==false){this.addRowClass(c,this.rowOverCls)}},onRowOut:function(b,a){var c=this.findRowIndex(a);if(c!==false&&!b.within(this.getRow(c),true)){this.removeRowClass(c,this.rowOverCls)}},onRowSelect:function(a){this.addRowClass(a,this.selectedRowClass)},onRowDeselect:function(a){this.removeRowClass(a,this.selectedRowClass)},onCellSelect:function(c,b){var a=this.getCell(c,b);if(a){this.fly(a).addClass("x-grid3-cell-selected")}},onCellDeselect:function(c,b){var a=this.getCell(c,b);if(a){this.fly(a).removeClass("x-grid3-cell-selected")}},handleWheel:function(a){a.stopPropagation()},onColumnSplitterMoved:function(a,b){this.userResized=true;this.grid.colModel.setColumnWidth(a,b,true);if(this.forceFit){this.fitColumns(true,false,a);this.updateAllColumnWidths()}else{this.updateColumnWidth(a,b);this.syncHeaderScroll()}this.grid.fireEvent("columnresize",a,b)},beforeColMenuShow:function(){var b=this.cm,d=b.getColumnCount(),a=this.colMenu,c;a.removeAll();for(c=0;c<d;c++){if(b.config[c].hideable!==false){a.add(new Ext.menu.CheckItem({text:b.getColumnHeader(c),itemId:"col-"+b.getColumnId(c),checked:!b.isHidden(c),disabled:b.config[c].hideable===false,hideOnClick:false}))}}},handleHdMenuClick:function(c){var a=this.ds,b=this.cm.getDataIndex(this.hdCtxIndex);switch(c.getItemId()){case"asc":a.sort(b,"ASC");break;case"desc":a.sort(b,"DESC");break;default:this.handleHdMenuClickDefault(c)}return true},handleHdMenuClickDefault:function(c){var b=this.cm,d=c.getItemId(),a=b.getIndexById(d.substr(4));if(a!=-1){if(c.checked&&b.getColumnsBy(this.isHideableColumn,this).length<=1){this.onDenyColumnHide();return}b.setHidden(a,c.checked)}},handleHdDown:function(i,k){if(Ext.fly(k).hasClass("x-grid3-hd-btn")){i.stopEvent();var l=this.cm,g=this.findHeaderCell(k),h=this.getCellIndex(g),d=l.isSortable(h),c=this.hmenu,b=c.items,a=this.headerMenuOpenCls;this.hdCtxIndex=h;Ext.fly(g).addClass(a);b.get("asc").setDisabled(!d);b.get("desc").setDisabled(!d);c.on("hide",function(){Ext.fly(g).removeClass(a)},this,{single:true});c.show(k,"tl-bl?")}},handleHdMove:function(l){var i=this.findHeaderCell(this.activeHdRef);if(i&&!this.headersDisabled){var m=this.splitHandleWidth||5,k=this.activeHdRegion,q=i.style,n=this.cm,p="",g=l.getPageX();if(this.grid.enableColumnResize!==false){var a=this.activeHdIndex,b=this.getPreviousVisible(a),o=n.isResizable(a),c=b&&n.isResizable(b),d=g-k.left<=m,h=k.right-g<=(!this.activeHdBtn?m:2);if(d&&c){p=Ext.isAir?"move":Ext.isWebKit?"e-resize":"col-resize"}else{if(h&&o){p=Ext.isAir?"move":Ext.isWebKit?"w-resize":"col-resize"}}}q.cursor=p}},getPreviousVisible:function(a){while(a>0){if(!this.cm.isHidden(a-1)){return a}a--}return undefined},handleHdOver:function(c,b){var d=this.findHeaderCell(b);if(d&&!this.headersDisabled){var a=this.fly(d);this.activeHdRef=b;this.activeHdIndex=this.getCellIndex(d);this.activeHdRegion=a.getRegion();if(!this.isMenuDisabled(this.activeHdIndex,a)){a.addClass("x-grid3-hd-over");this.activeHdBtn=a.child(".x-grid3-hd-btn");if(this.activeHdBtn){this.activeHdBtn.dom.style.height=(d.firstChild.offsetHeight-1)+"px"}}}},handleHdOut:function(b,a){var c=this.findHeaderCell(a);if(c&&(!Ext.isIE||!b.within(c,true))){this.activeHdRef=null;this.fly(c).removeClass("x-grid3-hd-over");c.style.cursor=""}},isMenuDisabled:function(a,b){return this.cm.isMenuDisabled(a)},hasRows:function(){var a=this.mainBody.dom.firstChild;return a&&a.nodeType==1&&a.className!="x-grid-empty"},isHideableColumn:function(a){return !a.hidden},bind:function(a,b){this.initData(a,b)}});Ext.grid.GridView.SplitDragZone=Ext.extend(Ext.dd.DDProxy,{constructor:function(a,b){this.grid=a;this.view=a.getView();this.marker=this.view.resizeMarker;this.proxy=this.view.resizeProxy;Ext.grid.GridView.SplitDragZone.superclass.constructor.call(this,b,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});this.scroll=false;this.hw=this.view.splitHandleWidth||5},b4StartDrag:function(a,e){this.dragHeadersDisabled=this.view.headersDisabled;this.view.headersDisabled=true;var d=this.view.mainWrap.getHeight();this.marker.setHeight(d);this.marker.show();this.marker.alignTo(this.view.getHeaderCell(this.cellIndex),"tl-tl",[-2,0]);this.proxy.setHeight(d);var b=this.cm.getColumnWidth(this.cellIndex),c=Math.max(b-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(c,1000);this.setYConstraint(0,0);this.minX=a-c;this.maxX=a+1000;this.startPos=a;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,a,e)},allowHeaderDrag:function(a){return true},handleMouseDown:function(a){var h=this.view.findHeaderCell(a.getTarget());if(h&&this.allowHeaderDrag(a)){var l=this.view.fly(h).getXY(),c=l[0],i=a.getXY(),b=i[0],g=h.offsetWidth,d=false;if((b-c)<=this.hw){d=-1}else{if((c+g)-b<=this.hw){d=0}}if(d!==false){this.cm=this.grid.colModel;var k=this.view.getCellIndex(h);if(d==-1){if(k+d<0){return}while(this.cm.isHidden(k+d)){--d;if(k+d<0){return}}}this.cellIndex=k+d;this.split=h.dom;if(this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)){Ext.grid.GridView.SplitDragZone.superclass.handleMouseDown.apply(this,arguments)}}else{if(this.view.columnDrag){this.view.columnDrag.callHandleMouseDown(a)}}}},endDrag:function(g){this.marker.hide();var a=this.view,c=Math.max(this.minX,g.getPageX()),d=c-this.startPos,b=this.dragHeadersDisabled;a.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+d);setTimeout(function(){a.headersDisabled=b},50)},autoOffset:function(){this.setDelta(0,0)}});Ext.grid.PivotGridView=Ext.extend(Ext.grid.GridView,{colHeaderCellCls:"grid-hd-group-cell",title:"",getColumnHeaders:function(){return this.grid.topAxis.buildHeaders()},getRowHeaders:function(){return this.grid.leftAxis.buildHeaders()},renderRows:function(a,r){var b=this.grid,n=b.extractData(),o=n.length,e=this.templates,q=b.renderer,h=typeof q=="function",t=this.getCellCls,m=typeof t=="function",d=e.cell,u=e.row,k=[],p={},c="width:"+this.getGridInnerWidth()+"px;",l,g,s;a=a||0;r=Ext.isDefined(r)?r:o-1;for(s=0;s<o;s++){row=n[s];colCount=row.length;l=[];rowIndex=a+s;for(j=0;j<colCount;j++){cell=row[j];p.css=j===0?"x-grid3-cell-first ":(j==(colCount-1)?"x-grid3-cell-last ":"");p.attr=p.cellAttr="";p.value=cell;if(Ext.isEmpty(p.value)){p.value="&#160;"}if(h){p.value=q(p.value)}if(m){p.css+=t(p.value)+" "}l[l.length]=d.apply(p)}k[k.length]=u.apply({tstyle:c,cols:colCount,cells:l.join(""),alt:""})}return k.join("")},masterTpl:new Ext.Template('<div class="x-grid3 x-pivotgrid" hidefocus="true">','<div class="x-grid3-viewport">','<div class="x-grid3-header">','<div class="x-grid3-header-title"><span>{title}</span></div>','<div class="x-grid3-header-inner">','<div class="x-grid3-header-offset" style="{ostyle}"></div>',"</div>",'<div class="x-clear"></div>',"</div>",'<div class="x-grid3-scroller">','<div class="x-grid3-row-headers"></div>','<div class="x-grid3-body" style="{bstyle}">{body}</div>','<a href="#" class="x-grid3-focus" tabIndex="-1"></a>',"</div>","</div>",'<div class="x-grid3-resize-marker">&#160;</div>','<div class="x-grid3-resize-proxy">&#160;</div>',"</div>"),initTemplates:function(){Ext.grid.PivotGridView.superclass.initTemplates.apply(this,arguments);var a=this.templates||{};if(!a.gcell){a.gcell=new Ext.XTemplate('<td class="x-grid3-hd x-grid3-gcell x-grid3-td-{id} ux-grid-hd-group-row-{row} '+this.colHeaderCellCls+'" style="{style}">','<div {tooltip} class="x-grid3-hd-inner x-grid3-hd-{id}" unselectable="on" style="{istyle}">',this.grid.enableHdMenu?'<a class="x-grid3-hd-btn" href="#"></a>':"","{value}","</div>","</td>")}this.templates=a;this.hrowRe=new RegExp("ux-grid-hd-group-row-(\\d+)","")},initElements:function(){Ext.grid.PivotGridView.superclass.initElements.apply(this,arguments);this.rowHeadersEl=new Ext.Element(this.scroller.child("div.x-grid3-row-headers"));this.headerTitleEl=new Ext.Element(this.mainHd.child("div.x-grid3-header-title"))},getGridInnerWidth:function(){var a=Ext.grid.PivotGridView.superclass.getGridInnerWidth.apply(this,arguments);return a-this.getTotalRowHeaderWidth()},getTotalRowHeaderWidth:function(){var d=this.getRowHeaders(),c=d.length,b=0,a;for(a=0;a<c;a++){b+=d[a].width}return b},getTotalColumnHeaderHeight:function(){return this.getColumnHeaders().length*21},renderUI:function(){var b=this.templates,a=this.getGridInnerWidth();return b.master.apply({body:b.body.apply({rows:"&#160;"}),ostyle:"width:"+a+"px",bstyle:"width:"+a+"px"})},onLayout:function(b,a){Ext.grid.PivotGridView.superclass.onLayout.apply(this,arguments);var b=this.getGridInnerWidth();this.resizeColumnHeaders(b);this.resizeAllRows(b)},refresh:function(b){this.fireEvent("beforerefresh",this);this.grid.stopEditing(true);var a=this.renderBody();this.mainBody.update(a).setWidth(this.getGridInnerWidth());if(b===true){this.updateHeaders();this.updateHeaderSortState()}this.processRows(0,true);this.layout();this.applyEmptyText();this.fireEvent("refresh",this)},renderHeaders:Ext.emptyFn,fitColumns:Ext.emptyFn,resizeColumnHeaders:function(b){var a=this.grid.topAxis;if(a.rendered){a.el.setWidth(b)}},resizeRowHeaders:function(){var a=this.getTotalRowHeaderWidth(),b=String.format("margin-left: {0}px;",a);this.rowHeadersEl.setWidth(a);this.mainBody.applyStyles(b);Ext.fly(this.innerHd).applyStyles(b);this.headerTitleEl.setWidth(a);this.headerTitleEl.setHeight(this.getTotalColumnHeaderHeight())},resizeAllRows:function(b){var d=this.getRows(),c=d.length,a;for(a=0;a<c;a++){Ext.fly(d[a]).setWidth(b);Ext.fly(d[a]).child("table").setWidth(b)}},updateHeaders:function(){this.renderGroupRowHeaders();this.renderGroupColumnHeaders()},renderGroupRowHeaders:function(){var a=this.grid.leftAxis;this.resizeRowHeaders();a.rendered=false;a.render(this.rowHeadersEl);this.setTitle(this.title)},setTitle:function(a){this.headerTitleEl.child("span").dom.innerHTML=a},renderGroupColumnHeaders:function(){var a=this.grid.topAxis;a.rendered=false;a.render(this.innerHd.firstChild)},isMenuDisabled:function(a,b){return true}});Ext.grid.PivotAxis=Ext.extend(Ext.Component,{orientation:"horizontal",defaultHeaderWidth:80,paddingWidth:7,setDimensions:function(a){this.dimensions=a},onRender:function(b,a){var c=this.orientation=="horizontal"?this.renderHorizontalRows():this.renderVerticalRows();this.el=Ext.DomHelper.overwrite(b.dom,{tag:"table",cn:c},true)},renderHorizontalRows:function(){var k=this.buildHeaders(),a=k.length,g=[],c,h,e,d,b;for(d=0;d<a;d++){c=[];h=k[d].items;e=h.length;for(b=0;b<e;b++){c.push({tag:"td",html:h[b].header,colspan:h[b].span})}g[d]={tag:"tr",cn:c}}return g},renderVerticalRows:function(){var b=this.buildHeaders(),k=b.length,a=[],m=[],h,c,l,g,e,d;for(e=0;e<k;e++){c=b[e];g=c.width||80;h=c.items.length;for(d=0;d<h;d++){l=c.items[d];a[l.start]=a[l.start]||[];a[l.start].push({tag:"td",html:l.header,rowspan:l.span,width:Ext.isBorderBox?g:g-this.paddingWidth})}}h=a.length;for(e=0;e<h;e++){m[e]={tag:"tr",cn:a[e]}}return m},getTuples:function(){var b=new Ext.data.Store({});b.data=this.store.data.clone();b.fields=this.store.fields;var m=[],a=this.dimensions,c=a.length,k;for(k=0;k<c;k++){m.push({field:a[k].dataIndex,direction:a[k].direction||"ASC"})}b.sort(m);var e=b.data.items,o=[],l=[],p,h,d,g,n;c=e.length;for(k=0;k<c;k++){d=this.getRecordInfo(e[k]);g=d.data;h="";for(n in g){h+=g[n]+"---"}if(o.indexOf(h)==-1){o.push(h);l.push(d)}}b.destroy();return l},getRecordInfo:function(a){var e=this.dimensions,d=e.length,h={},k,c,b;for(b=0;b<d;b++){k=e[b];c=k.dataIndex;h[c]=a.get(c)}var g=function(i){return function(l){for(var m in i){if(l.get(m)!=i[m]){return false}}return true}};return{data:h,matcher:g(h)}},buildHeaders:function(){var k=this.getTuples(),l=k.length,a=this.dimensions,q=a.length,c=[],n,r,m,p,o,b,h,g,e,d;for(e=0;e<q;e++){dimension=a[e];r=[];o=0;b=0;for(d=0;d<l;d++){n=k[d];h=d==(l-1);m=n.data[dimension.dataIndex];g=p!=undefined&&p!=m;if(e>0&&d>0){g=g||n.data[a[e-1].dataIndex]!=k[d-1].data[a[e-1].dataIndex]}if(g){r.push({header:p,span:o,start:b});b+=o;o=0}if(h){r.push({header:m,span:o+1,start:b});b+=o;o=0}p=m;o++}c.push({items:r,width:dimension.width||this.defaultHeaderWidth});p=undefined}return c}});Ext.grid.HeaderDragZone=Ext.extend(Ext.dd.DragZone,{maxDragWidth:120,constructor:function(a,c,b){this.grid=a;this.view=a.getView();this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDragZone.superclass.constructor.call(this,c);if(b){this.setHandleElId(Ext.id(c));this.setOuterHandleElId(Ext.id(b))}this.scroll=false},getDragData:function(c){var a=Ext.lib.Event.getTarget(c),b=this.view.findHeaderCell(a);if(b){return{ddel:b.firstChild,header:b}}return false},onInitDrag:function(a){this.dragHeadersDisabled=this.view.headersDisabled;this.view.headersDisabled=true;var b=this.dragData.ddel.cloneNode(true);b.id=Ext.id();b.style.width=Math.min(this.dragData.header.offsetWidth,this.maxDragWidth)+"px";this.proxy.update(b);return true},afterValidDrop:function(){this.completeDrop()},afterInvalidDrop:function(){this.completeDrop()},completeDrop:function(){var a=this.view,b=this.dragHeadersDisabled;setTimeout(function(){a.headersDisabled=b},50)}});Ext.grid.HeaderDropZone=Ext.extend(Ext.dd.DropZone,{proxyOffsets:[-4,-9],fly:Ext.Element.fly,constructor:function(a,c,b){this.grid=a;this.view=a.getView();this.proxyTop=Ext.DomHelper.append(document.body,{cls:"col-move-top",html:"&#160;"},true);this.proxyBottom=Ext.DomHelper.append(document.body,{cls:"col-move-bottom",html:"&#160;"},true);this.proxyTop.hide=this.proxyBottom.hide=function(){this.setLeftTop(-100,-100);this.setStyle("visibility","hidden")};this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDropZone.superclass.constructor.call(this,a.getGridEl().dom)},getTargetFromEvent:function(c){var a=Ext.lib.Event.getTarget(c),b=this.view.findCellIndex(a);if(b!==false){return this.view.getHeaderCell(b)}},nextVisible:function(c){var b=this.view,a=this.grid.colModel;c=c.nextSibling;while(c){if(!a.isHidden(b.getCellIndex(c))){return c}c=c.nextSibling}return null},prevVisible:function(c){var b=this.view,a=this.grid.colModel;c=c.prevSibling;while(c){if(!a.isHidden(b.getCellIndex(c))){return c}c=c.prevSibling}return null},positionIndicator:function(d,l,k){var a=Ext.lib.Event.getPageX(k),g=Ext.lib.Dom.getRegion(l.firstChild),c,i,b=g.top+this.proxyOffsets[1];if((g.right-a)<=(g.right-g.left)/2){c=g.right+this.view.borderWidth;i="after"}else{c=g.left;i="before"}if(this.grid.colModel.isFixed(this.view.getCellIndex(l))){return false}c+=this.proxyOffsets[0];this.proxyTop.setLeftTop(c,b);this.proxyTop.show();if(!this.bottomOffset){this.bottomOffset=this.view.mainHd.getHeight()}this.proxyBottom.setLeftTop(c,b+this.proxyTop.dom.offsetHeight+this.bottomOffset);this.proxyBottom.show();return i},onNodeEnter:function(d,a,c,b){if(b.header!=d){this.positionIndicator(b.header,d,c)}},onNodeOver:function(g,b,d,c){var a=false;if(c.header!=g){a=this.positionIndicator(c.header,g,d)}if(!a){this.proxyTop.hide();this.proxyBottom.hide()}return a?this.dropAllowed:this.dropNotAllowed},onNodeOut:function(d,a,c,b){this.proxyTop.hide();this.proxyBottom.hide()},onNodeDrop:function(b,o,g,c){var d=c.header;if(d!=b){var l=this.grid.colModel,k=Ext.lib.Event.getPageX(g),a=Ext.lib.Dom.getRegion(b.firstChild),p=(a.right-k)<=((a.right-a.left)/2)?"after":"before",i=this.view.getCellIndex(d),m=this.view.getCellIndex(b);if(p=="after"){m++}if(i<m){m--}l.moveColumn(i,m);return true}return false}});Ext.grid.GridView.ColumnDragZone=Ext.extend(Ext.grid.HeaderDragZone,{constructor:function(a,b){Ext.grid.GridView.ColumnDragZone.superclass.constructor.call(this,a,b,null);this.proxy.el.addClass("x-grid3-col-dd")},handleMouseDown:function(a){},callHandleMouseDown:function(a){Ext.grid.GridView.ColumnDragZone.superclass.handleMouseDown.call(this,a)}});Ext.grid.SplitDragZone=Ext.extend(Ext.dd.DDProxy,{fly:Ext.Element.fly,constructor:function(a,c,b){this.grid=a;this.view=a.getView();this.proxy=this.view.resizeProxy;Ext.grid.SplitDragZone.superclass.constructor.call(this,c,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});this.setHandleElId(Ext.id(c));this.setOuterHandleElId(Ext.id(b));this.scroll=false},b4StartDrag:function(a,d){this.view.headersDisabled=true;this.proxy.setHeight(this.view.mainWrap.getHeight());var b=this.cm.getColumnWidth(this.cellIndex);var c=Math.max(b-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(c,1000);this.setYConstraint(0,0);this.minX=a-c;this.maxX=a+1000;this.startPos=a;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,a,d)},handleMouseDown:function(c){var b=Ext.EventObject.setEvent(c);var a=this.fly(b.getTarget());if(a.hasClass("x-grid-split")){this.cellIndex=this.view.getCellIndex(a.dom);this.split=a.dom;this.cm=this.grid.colModel;if(this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)){Ext.grid.SplitDragZone.superclass.handleMouseDown.apply(this,arguments)}}},endDrag:function(c){this.view.headersDisabled=false;var a=Math.max(this.minX,Ext.lib.Event.getPageX(c));var b=a-this.startPos;this.view.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+b)},autoOffset:function(){this.setDelta(0,0)}});Ext.grid.GridDragZone=function(b,a){this.view=b.getView();Ext.grid.GridDragZone.superclass.constructor.call(this,this.view.mainBody.dom,a);this.scroll=false;this.grid=b;this.ddel=document.createElement("div");this.ddel.className="x-grid-dd-wrap"};Ext.extend(Ext.grid.GridDragZone,Ext.dd.DragZone,{ddGroup:"GridDD",getDragData:function(b){var a=Ext.lib.Event.getTarget(b);var d=this.view.findRowIndex(a);if(d!==false){var c=this.grid.selModel;if(!c.isSelected(d)||b.hasModifier()){c.handleMouseDown(this.grid,d,b)}return{grid:this.grid,ddel:this.ddel,rowIndex:d,selections:c.getSelections()}}return false},onInitDrag:function(b){var a=this.dragData;this.ddel.innerHTML=this.grid.getDragDropText();this.proxy.update(this.ddel)},afterRepair:function(){this.dragging=false},getRepairXY:function(b,a){return false},onEndDrag:function(a,b){},onValidDrop:function(a,b,c){this.hideProxy()},beforeInvalidDrop:function(a,b){}});Ext.grid.ColumnModel=Ext.extend(Ext.util.Observable,{defaultWidth:100,defaultSortable:false,constructor:function(a){if(a.columns){Ext.apply(this,a);this.setConfig(a.columns,true)}else{this.setConfig(a,true)}this.addEvents("widthchange","headerchange","hiddenchange","columnmoved","configchange");Ext.grid.ColumnModel.superclass.constructor.call(this)},getColumnId:function(a){return this.config[a].id},getColumnAt:function(a){return this.config[a]},setConfig:function(d,b){var e,h,a;if(!b){delete this.totalWidth;for(e=0,a=this.config.length;e<a;e++){h=this.config[e];if(h.setEditor){h.setEditor(null)}}}this.defaults=Ext.apply({width:this.defaultWidth,sortable:this.defaultSortable},this.defaults);this.config=d;this.lookup={};for(e=0,a=d.length;e<a;e++){h=Ext.applyIf(d[e],this.defaults);if(Ext.isEmpty(h.id)){h.id=e}if(!h.isColumn){var g=Ext.grid.Column.types[h.xtype||"gridcolumn"];h=new g(h);d[e]=h}this.lookup[h.id]=h}if(!b){this.fireEvent("configchange",this)}},getColumnById:function(a){return this.lookup[a]},getIndexById:function(c){for(var b=0,a=this.config.length;b<a;b++){if(this.config[b].id==c){return b}}return -1},moveColumn:function(e,b){var a=this.config,d=a[e];a.splice(e,1);a.splice(b,0,d);this.dataMap=null;this.fireEvent("columnmoved",this,e,b)},getColumnCount:function(b){var d=this.config.length,e=0,a;if(b===true){for(a=0;a<d;a++){if(!this.isHidden(a)){e++}}return e}return d},getColumnsBy:function(g,e){var b=this.config,h=b.length,a=[],d,k;for(d=0;d<h;d++){k=b[d];if(g.call(e||this,k,d)===true){a[a.length]=k}}return a},isSortable:function(a){return !!this.config[a].sortable},isMenuDisabled:function(a){return !!this.config[a].menuDisabled},getRenderer:function(a){return this.config[a].renderer||Ext.grid.ColumnModel.defaultRenderer},getRendererScope:function(a){return this.config[a].scope},setRenderer:function(a,b){this.config[a].renderer=b},getColumnWidth:function(a){var b=this.config[a].width;if(typeof b!="number"){b=this.defaultWidth}return b},setColumnWidth:function(b,c,a){this.config[b].width=c;this.totalWidth=null;if(!a){this.fireEvent("widthchange",this,b,c)}},getTotalWidth:function(b){if(!this.totalWidth){this.totalWidth=0;for(var c=0,a=this.config.length;c<a;c++){if(b||!this.isHidden(c)){this.totalWidth+=this.getColumnWidth(c)}}}return this.totalWidth},getColumnHeader:function(a){return this.config[a].header},setColumnHeader:function(a,b){this.config[a].header=b;this.fireEvent("headerchange",this,a,b)},getColumnTooltip:function(a){return this.config[a].tooltip},setColumnTooltip:function(a,b){this.config[a].tooltip=b},getDataIndex:function(a){return this.config[a].dataIndex},setDataIndex:function(a,b){this.config[a].dataIndex=b},findColumnIndex:function(d){var e=this.config;for(var b=0,a=e.length;b<a;b++){if(e[b].dataIndex==d){return b}}return -1},isCellEditable:function(b,e){var d=this.config[b],a=d.editable;return !!(a||(!Ext.isDefined(a)&&d.editor))},getCellEditor:function(a,b){return this.config[a].getCellEditor(b)},setEditable:function(a,b){this.config[a].editable=b},isHidden:function(a){return !!this.config[a].hidden},isFixed:function(a){return !!this.config[a].fixed},isResizable:function(a){return a>=0&&this.config[a].resizable!==false&&this.config[a].fixed!==true},setHidden:function(a,b){var d=this.config[a];if(d.hidden!==b){d.hidden=b;this.totalWidth=null;this.fireEvent("hiddenchange",this,a,b)}},setEditor:function(a,b){this.config[a].setEditor(b)},destroy:function(){var b=this.config.length,a=0;for(;a<b;a++){this.config[a].destroy()}delete this.config;delete this.lookup;this.purgeListeners()},setState:function(a,b){b=Ext.applyIf(b,this.defaults);Ext.apply(this.config[a],b)}});Ext.grid.ColumnModel.defaultRenderer=function(a){if(typeof a=="string"&&a.length<1){return"&#160;"}return a};Ext.grid.AbstractSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(){this.locked=false;Ext.grid.AbstractSelectionModel.superclass.constructor.call(this)},init:function(a){this.grid=a;if(this.lockOnInit){delete this.lockOnInit;this.locked=false;this.lock()}this.initEvents()},lock:function(){if(!this.locked){this.locked=true;var a=this.grid;if(a){a.getView().on({scope:this,beforerefresh:this.sortUnLock,refresh:this.sortLock})}else{this.lockOnInit=true}}},sortLock:function(){this.locked=true},sortUnLock:function(){this.locked=false},unlock:function(){if(this.locked){this.locked=false;var a=this.grid,b;if(a){b=a.getView();b.un("beforerefresh",this.sortUnLock,this);b.un("refresh",this.sortLock,this)}else{delete this.lockOnInit}}},isLocked:function(){return this.locked},destroy:function(){this.unlock();this.purgeListeners()}});Ext.grid.RowSelectionModel=Ext.extend(Ext.grid.AbstractSelectionModel,{singleSelect:false,constructor:function(a){Ext.apply(this,a);this.selections=new Ext.util.MixedCollection(false,function(b){return b.id});this.last=false;this.lastActive=false;this.addEvents("selectionchange","beforerowselect","rowselect","rowdeselect");Ext.grid.RowSelectionModel.superclass.constructor.call(this)},initEvents:function(){if(!this.grid.enableDragDrop&&!this.grid.enableDrag){this.grid.on("rowmousedown",this.handleMouseDown,this)}this.rowNav=new Ext.KeyNav(this.grid.getGridEl(),{up:this.onKeyPress,down:this.onKeyPress,scope:this});this.grid.getView().on({scope:this,refresh:this.onRefresh,rowupdated:this.onRowUpdated,rowremoved:this.onRemove})},onKeyPress:function(g,b){var a=b=="up",h=a?"selectPrevious":"selectNext",d=a?-1:1,c;if(!g.shiftKey||this.singleSelect){this[h](false)}else{if(this.last!==false&&this.lastActive!==false){c=this.last;this.selectRange(this.last,this.lastActive+d);this.grid.getView().focusRow(this.lastActive);if(c!==false){this.last=c}}else{this.selectFirstRow()}}},onRefresh:function(){var g=this.grid.store,d=this.getSelections(),c=0,a=d.length,b,e;this.silent=true;this.clearSelections(true);for(;c<a;c++){e=d[c];if((b=g.indexOfId(e.id))!=-1){this.selectRow(b,true)}}if(d.length!=this.selections.getCount()){this.fireEvent("selectionchange",this)}this.silent=false},onRemove:function(a,b,c){if(this.selections.remove(c)!==false){this.fireEvent("selectionchange",this)}},onRowUpdated:function(a,b,c){if(this.isSelected(c)){a.onRowSelect(b)}},selectRecords:function(b,e){if(!e){this.clearSelections()}var d=this.grid.store,c=0,a=b.length;for(;c<a;c++){this.selectRow(d.indexOf(b[c]),true)}},getCount:function(){return this.selections.length},selectFirstRow:function(){this.selectRow(0)},selectLastRow:function(a){this.selectRow(this.grid.store.getCount()-1,a)},selectNext:function(a){if(this.hasNext()){this.selectRow(this.last+1,a);this.grid.getView().focusRow(this.last);return true}return false},selectPrevious:function(a){if(this.hasPrevious()){this.selectRow(this.last-1,a);this.grid.getView().focusRow(this.last);return true}return false},hasNext:function(){return this.last!==false&&(this.last+1)<this.grid.store.getCount()},hasPrevious:function(){return !!this.last},getSelections:function(){return[].concat(this.selections.items)},getSelected:function(){return this.selections.itemAt(0)},each:function(e,d){var c=this.getSelections(),b=0,a=c.length;for(;b<a;b++){if(e.call(d||this,c[b],b)===false){return false}}return true},clearSelections:function(a){if(this.isLocked()){return}if(a!==true){var c=this.grid.store,b=this.selections;b.each(function(d){this.deselectRow(c.indexOfId(d.id))},this);b.clear()}else{this.selections.clear()}this.last=false},selectAll:function(){if(this.isLocked()){return}this.selections.clear();for(var b=0,a=this.grid.store.getCount();b<a;b++){this.selectRow(b,true)}},hasSelection:function(){return this.selections.length>0},isSelected:function(a){var b=Ext.isNumber(a)?this.grid.store.getAt(a):a;return(b&&this.selections.key(b.id)?true:false)},isIdSelected:function(a){return(this.selections.key(a)?true:false)},handleMouseDown:function(d,i,h){if(h.button!==0||this.isLocked()){return}var a=this.grid.getView();if(h.shiftKey&&!this.singleSelect&&this.last!==false){var c=this.last;this.selectRange(c,i,h.ctrlKey);this.last=c;a.focusRow(i)}else{var b=this.isSelected(i);if(h.ctrlKey&&b){this.deselectRow(i)}else{if(!b||this.getCount()>1){this.selectRow(i,h.ctrlKey||h.shiftKey);a.focusRow(i)}}}},selectRows:function(c,d){if(!d){this.clearSelections()}for(var b=0,a=c.length;b<a;b++){this.selectRow(c[b],true)}},selectRange:function(b,a,d){var c;if(this.isLocked()){return}if(!d){this.clearSelections()}if(b<=a){for(c=b;c<=a;c++){this.selectRow(c,true)}}else{for(c=b;c>=a;c--){this.selectRow(c,true)}}},deselectRange:function(c,b,a){if(this.isLocked()){return}for(var d=c;d<=b;d++){this.deselectRow(d,a)}},selectRow:function(b,d,a){if(this.isLocked()||(b<0||b>=this.grid.store.getCount())||(d&&this.isSelected(b))){return}var c=this.grid.store.getAt(b);if(c&&this.fireEvent("beforerowselect",this,b,d,c)!==false){if(!d||this.singleSelect){this.clearSelections()}this.selections.add(c);this.last=this.lastActive=b;if(!a){this.grid.getView().onRowSelect(b)}if(!this.silent){this.fireEvent("rowselect",this,b,c);this.fireEvent("selectionchange",this)}}},deselectRow:function(b,a){if(this.isLocked()){return}if(this.last==b){this.last=false}if(this.lastActive==b){this.lastActive=false}var c=this.grid.store.getAt(b);if(c){this.selections.remove(c);if(!a){this.grid.getView().onRowDeselect(b)}this.fireEvent("rowdeselect",this,b,c);this.fireEvent("selectionchange",this)}},acceptsNav:function(c,b,a){return !a.isHidden(b)&&a.isCellEditable(b,c)},onEditorKey:function(o,m){var d=m.getKey(),h,i=this.grid,q=i.lastEdit,l=i.activeEditor,b=m.shiftKey,p,q,a,n;if(d==m.TAB){m.stopEvent();l.completeEdit();if(b){h=i.walkCells(l.row,l.col-1,-1,this.acceptsNav,this)}else{h=i.walkCells(l.row,l.col+1,1,this.acceptsNav,this)}}else{if(d==m.ENTER){if(this.moveEditorOnEnter!==false){if(b){h=i.walkCells(q.row-1,q.col,-1,this.acceptsNav,this)}else{h=i.walkCells(q.row+1,q.col,1,this.acceptsNav,this)}}}}if(h){a=h[0];n=h[1];this.onEditorSelect(a,q.row);if(i.isEditor&&i.editing){p=i.activeEditor;if(p&&p.field.triggerBlur){p.field.triggerBlur()}}i.startEditing(a,n)}},onEditorSelect:function(b,a){if(a!=b){this.selectRow(b)}},destroy:function(){Ext.destroy(this.rowNav);this.rowNav=null;Ext.grid.RowSelectionModel.superclass.destroy.call(this)}});Ext.grid.Column=Ext.extend(Ext.util.Observable,{isColumn:true,constructor:function(b){Ext.apply(this,b);if(Ext.isString(this.renderer)){this.renderer=Ext.util.Format[this.renderer]}else{if(Ext.isObject(this.renderer)){this.scope=this.renderer.scope;this.renderer=this.renderer.fn}}if(!this.scope){this.scope=this}var a=this.editor;delete this.editor;this.setEditor(a);this.addEvents("click","contextmenu","dblclick","mousedown");Ext.grid.Column.superclass.constructor.call(this)},processEvent:function(b,d,c,g,a){return this.fireEvent(b,this,c,g,d)},destroy:function(){if(this.setEditor){this.setEditor(null)}this.purgeListeners()},renderer:function(a){return a},getEditor:function(a){return this.editable!==false?this.editor:null},setEditor:function(b){var a=this.editor;if(a){if(a.gridEditor){a.gridEditor.destroy();delete a.gridEditor}else{a.destroy()}}this.editor=null;if(b){if(!b.isXType){b=Ext.create(b,"textfield")}this.editor=b}},getCellEditor:function(b){var a=this.getEditor(b);if(a){if(!a.startEdit){if(!a.gridEditor){a.gridEditor=new Ext.grid.GridEditor(a)}a=a.gridEditor}}return a}});Ext.grid.BooleanColumn=Ext.extend(Ext.grid.Column,{trueText:"true",falseText:"false",undefinedText:"&#160;",constructor:function(a){Ext.grid.BooleanColumn.superclass.constructor.call(this,a);var c=this.trueText,d=this.falseText,b=this.undefinedText;this.renderer=function(e){if(e===undefined){return b}if(!e||e==="false"){return d}return c}}});Ext.grid.NumberColumn=Ext.extend(Ext.grid.Column,{format:"0,000.00",constructor:function(a){Ext.grid.NumberColumn.superclass.constructor.call(this,a);this.renderer=Ext.util.Format.numberRenderer(this.format)}});Ext.grid.DateColumn=Ext.extend(Ext.grid.Column,{format:"m/d/Y",constructor:function(a){Ext.grid.DateColumn.superclass.constructor.call(this,a);this.renderer=Ext.util.Format.dateRenderer(this.format)}});Ext.grid.TemplateColumn=Ext.extend(Ext.grid.Column,{constructor:function(a){Ext.grid.TemplateColumn.superclass.constructor.call(this,a);var b=(!Ext.isPrimitive(this.tpl)&&this.tpl.compile)?this.tpl:new Ext.XTemplate(this.tpl);this.renderer=function(d,e,c){return b.apply(c.data)};this.tpl=b}});Ext.grid.ActionColumn=Ext.extend(Ext.grid.Column,{header:"&#160;",actionIdRe:/x-action-col-(\d+)/,altText:"",constructor:function(b){var g=this,c=b.items||(g.items=[g]),a=c.length,d,e;Ext.grid.ActionColumn.superclass.constructor.call(g,b);g.renderer=function(h,i){h=Ext.isFunction(b.renderer)?b.renderer.apply(this,arguments)||"":"";i.css+=" x-action-col-cell";for(d=0;d<a;d++){e=c[d];h+='<img alt="'+g.altText+'" src="'+(e.icon||Ext.BLANK_IMAGE_URL)+'" class="x-action-col-icon x-action-col-'+String(d)+" "+(e.iconCls||"")+" "+(Ext.isFunction(e.getClass)?e.getClass.apply(e.scope||this.scope||this,arguments):"")+'"'+((e.tooltip)?' ext:qtip="'+e.tooltip+'"':"")+" />"}return h}},destroy:function(){delete this.items;delete this.renderer;return Ext.grid.ActionColumn.superclass.destroy.apply(this,arguments)},processEvent:function(c,i,d,k,b){var a=i.getTarget().className.match(this.actionIdRe),h,g;if(a&&(h=this.items[parseInt(a[1],10)])){if(c=="click"){(g=h.handler||this.handler)&&g.call(h.scope||this.scope||this,d,k,b,h,i)}else{if((c=="mousedown")&&(h.stopSelection!==false)){return false}}}return Ext.grid.ActionColumn.superclass.processEvent.apply(this,arguments)}});Ext.grid.Column.types={gridcolumn:Ext.grid.Column,booleancolumn:Ext.grid.BooleanColumn,numbercolumn:Ext.grid.NumberColumn,datecolumn:Ext.grid.DateColumn,templatecolumn:Ext.grid.TemplateColumn,actioncolumn:Ext.grid.ActionColumn};Ext.grid.RowNumberer=Ext.extend(Object,{header:"",width:23,sortable:false,constructor:function(a){Ext.apply(this,a);if(this.rowspan){this.renderer=this.renderer.createDelegate(this)}},fixed:true,hideable:false,menuDisabled:true,dataIndex:"",id:"numberer",rowspan:undefined,renderer:function(b,c,a,d){if(this.rowspan){c.cellAttr='rowspan="'+this.rowspan+'"'}return d+1}});Ext.grid.CheckboxSelectionModel=Ext.extend(Ext.grid.RowSelectionModel,{header:'<div class="x-grid3-hd-checker">&#160;</div>',width:20,sortable:false,menuDisabled:true,fixed:true,hideable:false,dataIndex:"",id:"checker",isColumn:true,constructor:function(){Ext.grid.CheckboxSelectionModel.superclass.constructor.apply(this,arguments);if(this.checkOnly){this.handleMouseDown=Ext.emptyFn}},initEvents:function(){Ext.grid.CheckboxSelectionModel.superclass.initEvents.call(this);this.grid.on("render",function(){Ext.fly(this.grid.getView().innerHd).on("mousedown",this.onHdMouseDown,this)},this)},processEvent:function(b,d,c,g,a){if(b=="mousedown"){this.onMouseDown(d,d.getTarget());return false}else{return Ext.grid.Column.prototype.processEvent.apply(this,arguments)}},onMouseDown:function(c,b){if(c.button===0&&b.className=="x-grid3-row-checker"){c.stopEvent();var d=c.getTarget(".x-grid3-row");if(d){var a=d.rowIndex;if(this.isSelected(a)){this.deselectRow(a)}else{this.selectRow(a,true);this.grid.getView().focusRow(a)}}}},onHdMouseDown:function(c,a){if(a.className=="x-grid3-hd-checker"){c.stopEvent();var b=Ext.fly(a.parentNode);var d=b.hasClass("x-grid3-hd-checker-on");if(d){b.removeClass("x-grid3-hd-checker-on");this.clearSelections()}else{b.addClass("x-grid3-hd-checker-on");this.selectAll()}}},renderer:function(b,c,a){return'<div class="x-grid3-row-checker">&#160;</div>'},onEditorSelect:function(b,a){if(a!=b&&!this.checkOnly){this.selectRow(b)}}});Ext.grid.CellSelectionModel=Ext.extend(Ext.grid.AbstractSelectionModel,{constructor:function(a){Ext.apply(this,a);this.selection=null;this.addEvents("beforecellselect","cellselect","selectionchange");Ext.grid.CellSelectionModel.superclass.constructor.call(this)},initEvents:function(){this.grid.on("cellmousedown",this.handleMouseDown,this);this.grid.on(Ext.EventManager.getKeyEvent(),this.handleKeyDown,this);this.grid.getView().on({scope:this,refresh:this.onViewChange,rowupdated:this.onRowUpdated,beforerowremoved:this.clearSelections,beforerowsinserted:this.clearSelections});if(this.grid.isEditor){this.grid.on("beforeedit",this.beforeEdit,this)}},beforeEdit:function(a){this.select(a.row,a.column,false,true,a.record)},onRowUpdated:function(a,b,c){if(this.selection&&this.selection.record==c){a.onCellSelect(b,this.selection.cell[1])}},onViewChange:function(){this.clearSelections(true)},getSelectedCell:function(){return this.selection?this.selection.cell:null},clearSelections:function(b){var a=this.selection;if(a){if(b!==true){this.grid.view.onCellDeselect(a.cell[0],a.cell[1])}this.selection=null;this.fireEvent("selectionchange",this,null)}},hasSelection:function(){return this.selection?true:false},handleMouseDown:function(b,d,a,c){if(c.button!==0||this.isLocked()){return}this.select(d,a)},select:function(g,c,b,e,d){if(this.fireEvent("beforecellselect",this,g,c)!==false){this.clearSelections();d=d||this.grid.store.getAt(g);this.selection={record:d,cell:[g,c]};if(!b){var a=this.grid.getView();a.onCellSelect(g,c);if(e!==true){a.focusCell(g,c)}}this.fireEvent("cellselect",this,g,c);this.fireEvent("selectionchange",this,this.selection)}},isSelectable:function(c,b,a){return !a.isHidden(b)},onEditorKey:function(b,a){if(a.getKey()==a.TAB){this.handleKeyDown(a)}},handleKeyDown:function(l){if(!l.isNavKeyPress()){return}var d=l.getKey(),i=this.grid,q=this.selection,b=this,n=function(g,c,e){return i.walkCells(g,c,e,i.isEditor&&i.editing?b.acceptsNav:b.isSelectable,b)},p,h,a,m,o;switch(d){case l.ESC:case l.PAGE_UP:case l.PAGE_DOWN:break;default:l.stopEvent();break}if(!q){p=n(0,0,1);if(p){this.select(p[0],p[1])}return}p=q.cell;a=p[0];m=p[1];switch(d){case l.TAB:if(l.shiftKey){h=n(a,m-1,-1)}else{h=n(a,m+1,1)}break;case l.DOWN:h=n(a+1,m,1);break;case l.UP:h=n(a-1,m,-1);break;case l.RIGHT:h=n(a,m+1,1);break;case l.LEFT:h=n(a,m-1,-1);break;case l.ENTER:if(i.isEditor&&!i.editing){i.startEditing(a,m);return}break}if(h){a=h[0];m=h[1];this.select(a,m);if(i.isEditor&&i.editing){o=i.activeEditor;if(o&&o.field.triggerBlur){o.field.triggerBlur()}i.startEditing(a,m)}}},acceptsNav:function(c,b,a){return !a.isHidden(b)&&a.isCellEditable(b,c)}});Ext.grid.EditorGridPanel=Ext.extend(Ext.grid.GridPanel,{clicksToEdit:2,forceValidation:false,isEditor:true,detectEdit:false,autoEncode:false,trackMouseOver:false,initComponent:function(){Ext.grid.EditorGridPanel.superclass.initComponent.call(this);if(!this.selModel){this.selModel=new Ext.grid.CellSelectionModel()}this.activeEditor=null;this.addEvents("beforeedit","afteredit","validateedit")},initEvents:function(){Ext.grid.EditorGridPanel.superclass.initEvents.call(this);this.getGridEl().on("mousewheel",this.stopEditing.createDelegate(this,[true]),this);this.on("columnresize",this.stopEditing,this,[true]);if(this.clicksToEdit==1){this.on("cellclick",this.onCellDblClick,this)}else{var a=this.getView();if(this.clicksToEdit=="auto"&&a.mainBody){a.mainBody.on("mousedown",this.onAutoEditClick,this)}this.on("celldblclick",this.onCellDblClick,this)}},onResize:function(){Ext.grid.EditorGridPanel.superclass.onResize.apply(this,arguments);var a=this.activeEditor;if(this.editing&&a){a.realign(true)}},onCellDblClick:function(b,c,a){this.startEditing(c,a)},onAutoEditClick:function(c,b){if(c.button!==0){return}var g=this.view.findRowIndex(b),a=this.view.findCellIndex(b);if(g!==false&&a!==false){this.stopEditing();if(this.selModel.getSelectedCell){var d=this.selModel.getSelectedCell();if(d&&d[0]===g&&d[1]===a){this.startEditing(g,a)}}else{if(this.selModel.isSelected(g)){this.startEditing(g,a)}}}},onEditComplete:function(b,d,a){this.editing=false;this.lastActiveEditor=this.activeEditor;this.activeEditor=null;var c=b.record,h=this.colModel.getDataIndex(b.col);d=this.postEditValue(d,a,c,h);if(this.forceValidation===true||String(d)!==String(a)){var g={grid:this,record:c,field:h,originalValue:a,value:d,row:b.row,column:b.col,cancel:false};if(this.fireEvent("validateedit",g)!==false&&!g.cancel&&String(d)!==String(a)){c.set(h,g.value);delete g.cancel;this.fireEvent("afteredit",g)}}this.view.focusCell(b.row,b.col)},startEditing:function(i,c){this.stopEditing();if(this.colModel.isCellEditable(c,i)){this.view.ensureVisible(i,c,true);var d=this.store.getAt(i),h=this.colModel.getDataIndex(c),g={grid:this,record:d,field:h,value:d.data[h],row:i,column:c,cancel:false};if(this.fireEvent("beforeedit",g)!==false&&!g.cancel){this.editing=true;var b=this.colModel.getCellEditor(c,i);if(!b){return}if(!b.rendered){b.parentEl=this.view.getEditorParent(b);b.on({scope:this,render:{fn:function(e){e.field.focus(false,true)},single:true,scope:this},specialkey:function(l,k){this.getSelectionModel().onEditorKey(l,k)},complete:this.onEditComplete,canceledit:this.stopEditing.createDelegate(this,[true])})}Ext.apply(b,{row:i,col:c,record:d});this.lastEdit={row:i,col:c};this.activeEditor=b;b.selectSameEditor=(this.activeEditor==this.lastActiveEditor);var a=this.preEditValue(d,h);b.startEdit(this.view.getCell(i,c).firstChild,Ext.isDefined(a)?a:"");(function(){delete b.selectSameEditor}).defer(50)}}},preEditValue:function(a,c){var b=a.data[c];return this.autoEncode&&Ext.isString(b)?Ext.util.Format.htmlDecode(b):b},postEditValue:function(c,a,b,d){return this.autoEncode&&Ext.isString(c)?Ext.util.Format.htmlEncode(c):c},stopEditing:function(b){if(this.editing){var a=this.lastActiveEditor=this.activeEditor;if(a){a[b===true?"cancelEdit":"completeEdit"]();this.view.focusCell(a.row,a.col)}this.activeEditor=null}this.editing=false}});Ext.reg("editorgrid",Ext.grid.EditorGridPanel);Ext.grid.GridEditor=function(b,a){Ext.grid.GridEditor.superclass.constructor.call(this,b,a);b.monitorTab=false};Ext.extend(Ext.grid.GridEditor,Ext.Editor,{alignment:"tl-tl",autoSize:"width",hideEl:false,cls:"x-small-editor x-grid-editor",shim:false,shadow:false});Ext.grid.PropertyRecord=Ext.data.Record.create([{name:"name",type:"string"},"value"]);Ext.grid.PropertyStore=Ext.extend(Ext.util.Observable,{constructor:function(a,b){this.grid=a;this.store=new Ext.data.Store({recordType:Ext.grid.PropertyRecord});this.store.on("update",this.onUpdate,this);if(b){this.setSource(b)}Ext.grid.PropertyStore.superclass.constructor.call(this)},setSource:function(c){this.source=c;this.store.removeAll();var b=[];for(var a in c){if(this.isEditableValue(c[a])){b.push(new Ext.grid.PropertyRecord({name:a,value:c[a]},a))}}this.store.loadRecords({records:b},{},true)},onUpdate:function(e,a,d){if(d==Ext.data.Record.EDIT){var b=a.data.value;var c=a.modified.value;if(this.grid.fireEvent("beforepropertychange",this.source,a.id,b,c)!==false){this.source[a.id]=b;a.commit();this.grid.fireEvent("propertychange",this.source,a.id,b,c)}else{a.reject()}}},getProperty:function(a){return this.store.getAt(a)},isEditableValue:function(a){return Ext.isPrimitive(a)||Ext.isDate(a)},setValue:function(d,c,a){var b=this.getRec(d);if(b){b.set("value",c);this.source[d]=c}else{if(a){this.source[d]=c;b=new Ext.grid.PropertyRecord({name:d,value:c},d);this.store.add(b)}}},remove:function(b){var a=this.getRec(b);if(a){this.store.remove(a);delete this.source[b]}},getRec:function(a){return this.store.getById(a)},getSource:function(){return this.source}});Ext.grid.PropertyColumnModel=Ext.extend(Ext.grid.ColumnModel,{nameText:"Name",valueText:"Value",dateFormat:"m/j/Y",trueText:"true",falseText:"false",constructor:function(c,b){var d=Ext.grid,e=Ext.form;this.grid=c;d.PropertyColumnModel.superclass.constructor.call(this,[{header:this.nameText,width:50,sortable:true,dataIndex:"name",id:"name",menuDisabled:true},{header:this.valueText,width:50,resizable:false,dataIndex:"value",id:"value",menuDisabled:true}]);this.store=b;var a=new e.Field({autoCreate:{tag:"select",children:[{tag:"option",value:"true",html:this.trueText},{tag:"option",value:"false",html:this.falseText}]},getValue:function(){return this.el.dom.value=="true"}});this.editors={date:new d.GridEditor(new e.DateField({selectOnFocus:true})),string:new d.GridEditor(new e.TextField({selectOnFocus:true})),number:new d.GridEditor(new e.NumberField({selectOnFocus:true,style:"text-align:left;"})),"boolean":new d.GridEditor(a,{autoSize:"both"})};this.renderCellDelegate=this.renderCell.createDelegate(this);this.renderPropDelegate=this.renderProp.createDelegate(this)},renderDate:function(a){return a.dateFormat(this.dateFormat)},renderBool:function(a){return this[a?"trueText":"falseText"]},isCellEditable:function(a,b){return a==1},getRenderer:function(a){return a==1?this.renderCellDelegate:this.renderPropDelegate},renderProp:function(a){return this.getPropertyName(a)},renderCell:function(d,b,c){var a=this.grid.customRenderers[c.get("name")];if(a){return a.apply(this,arguments)}var e=d;if(Ext.isDate(d)){e=this.renderDate(d)}else{if(typeof d=="boolean"){e=this.renderBool(d)}}return Ext.util.Format.htmlEncode(e)},getPropertyName:function(b){var a=this.grid.propertyNames;return a&&a[b]?a[b]:b},getCellEditor:function(a,e){var b=this.store.getProperty(e),d=b.data.name,c=b.data.value;if(this.grid.customEditors[d]){return this.grid.customEditors[d]}if(Ext.isDate(c)){return this.editors.date}else{if(typeof c=="number"){return this.editors.number}else{if(typeof c=="boolean"){return this.editors["boolean"]}else{return this.editors.string}}}},destroy:function(){Ext.grid.PropertyColumnModel.superclass.destroy.call(this);this.destroyEditors(this.editors);this.destroyEditors(this.grid.customEditors)},destroyEditors:function(b){for(var a in b){Ext.destroy(b[a])}}});Ext.grid.PropertyGrid=Ext.extend(Ext.grid.EditorGridPanel,{enableColumnMove:false,stripeRows:false,trackMouseOver:false,clicksToEdit:1,enableHdMenu:false,viewConfig:{forceFit:true},initComponent:function(){this.customRenderers=this.customRenderers||{};this.customEditors=this.customEditors||{};this.lastEditRow=null;var b=new Ext.grid.PropertyStore(this);this.propStore=b;var a=new Ext.grid.PropertyColumnModel(this,b);b.store.sort("name","ASC");this.addEvents("beforepropertychange","propertychange");this.cm=a;this.ds=b.store;Ext.grid.PropertyGrid.superclass.initComponent.call(this);this.mon(this.selModel,"beforecellselect",function(e,d,c){if(c===0){this.startEditing.defer(200,this,[d,1]);return false}},this)},onRender:function(){Ext.grid.PropertyGrid.superclass.onRender.apply(this,arguments);this.getGridEl().addClass("x-props-grid")},afterRender:function(){Ext.grid.PropertyGrid.superclass.afterRender.apply(this,arguments);if(this.source){this.setSource(this.source)}},setSource:function(a){this.propStore.setSource(a)},getSource:function(){return this.propStore.getSource()},setProperty:function(c,b,a){this.propStore.setValue(c,b,a)},removeProperty:function(a){this.propStore.remove(a)}});Ext.reg("propertygrid",Ext.grid.PropertyGrid);Ext.grid.GroupingView=Ext.extend(Ext.grid.GridView,{groupByText:"Group By This Field",showGroupsText:"Show in Groups",hideGroupedColumn:false,showGroupName:true,startCollapsed:false,enableGrouping:true,enableGroupingMenu:true,enableNoGroups:true,emptyGroupText:"(None)",ignoreAdd:false,groupTextTpl:"{text}",groupMode:"value",cancelEditOnToggle:true,initTemplates:function(){Ext.grid.GroupingView.superclass.initTemplates.call(this);this.state={};var a=this.grid.getSelectionModel();a.on(a.selectRow?"beforerowselect":"beforecellselect",this.onBeforeRowSelect,this);if(!this.startGroup){this.startGroup=new Ext.XTemplate('<div id="{groupId}" class="x-grid-group {cls}">','<div id="{groupId}-hd" class="x-grid-group-hd" style="{style}"><div class="x-grid-group-title">',this.groupTextTpl,"</div></div>",'<div id="{groupId}-bd" class="x-grid-group-body">')}this.startGroup.compile();if(!this.endGroup){this.endGroup="</div></div>"}},findGroup:function(a){return Ext.fly(a).up(".x-grid-group",this.mainBody.dom)},getGroups:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},onAdd:function(d,a,b){if(this.canGroup()&&!this.ignoreAdd){var c=this.getScrollState();this.fireEvent("beforerowsinserted",d,b,b+(a.length-1));this.refresh();this.restoreScroll(c);this.fireEvent("rowsinserted",d,b,b+(a.length-1))}else{if(!this.canGroup()){Ext.grid.GroupingView.superclass.onAdd.apply(this,arguments)}}},onRemove:function(e,a,b,d){Ext.grid.GroupingView.superclass.onRemove.apply(this,arguments);var c=document.getElementById(a._groupId);if(c&&c.childNodes[1].childNodes.length<1){Ext.removeNode(c)}this.applyEmptyText()},refreshRow:function(a){if(this.ds.getCount()==1){this.refresh()}else{this.isUpdating=true;Ext.grid.GroupingView.superclass.refreshRow.apply(this,arguments);this.isUpdating=false}},beforeMenuShow:function(){var c,a=this.hmenu.items,b=this.cm.config[this.hdCtxIndex].groupable===false;if((c=a.get("groupBy"))){c.setDisabled(b)}if((c=a.get("showGroups"))){c.setDisabled(b);c.setChecked(this.canGroup(),true)}},renderUI:function(){var a=Ext.grid.GroupingView.superclass.renderUI.call(this);if(this.enableGroupingMenu&&this.hmenu){this.hmenu.add("-",{itemId:"groupBy",text:this.groupByText,handler:this.onGroupByClick,scope:this,iconCls:"x-group-by-icon"});if(this.enableNoGroups){this.hmenu.add({itemId:"showGroups",text:this.showGroupsText,checked:true,checkHandler:this.onShowGroupsClick,scope:this})}this.hmenu.on("beforeshow",this.beforeMenuShow,this)}return a},processEvent:function(b,i){Ext.grid.GroupingView.superclass.processEvent.call(this,b,i);var h=i.getTarget(".x-grid-group-hd",this.mainBody);if(h){var g=this.getGroupField(),d=this.getPrefix(g),a=h.id.substring(d.length),c=new RegExp("gp-"+Ext.escapeRe(g)+"--hd");a=a.substr(0,a.length-3);if(a||c.test(h.id)){this.grid.fireEvent("group"+b,this.grid,g,a,i)}if(b=="mousedown"&&i.button==0){this.toggleGroup(h.parentNode)}}},onGroupByClick:function(){var a=this.grid;this.enableGrouping=true;a.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));a.fireEvent("groupchange",a,a.store.getGroupState());this.beforeMenuShow();this.refresh()},onShowGroupsClick:function(a,b){this.enableGrouping=b;if(b){this.onGroupByClick()}else{this.grid.store.clearGrouping();this.grid.fireEvent("groupchange",this,null)}},toggleRowIndex:function(c,a){if(!this.canGroup()){return}var b=this.getRow(c);if(b){this.toggleGroup(this.findGroup(b),a)}},toggleGroup:function(c,b){var a=Ext.get(c);b=Ext.isDefined(b)?b:a.hasClass("x-grid-group-collapsed");if(this.state[a.id]!==b){if(this.cancelEditOnToggle!==false){this.grid.stopEditing(true)}this.state[a.id]=b;a[b?"removeClass":"addClass"]("x-grid-group-collapsed")}},toggleAllGroups:function(c){var b=this.getGroups();for(var d=0,a=b.length;d<a;d++){this.toggleGroup(b[d],c)}},expandAllGroups:function(){this.toggleAllGroups(true)},collapseAllGroups:function(){this.toggleAllGroups(false)},getGroup:function(a,e,i,k,b,h){var c=this.cm.config[b],d=i?i.call(c.scope,a,{},e,k,b,h):String(a);if(d===""||d==="&#160;"){d=c.emptyGroupText||this.emptyGroupText}return d},getGroupField:function(){return this.grid.store.getGroupState()},afterRender:function(){if(!this.ds||!this.cm){return}Ext.grid.GroupingView.superclass.afterRender.call(this);if(this.grid.deferRowRender){this.updateGroupWidths()}},afterRenderUI:function(){Ext.grid.GroupingView.superclass.afterRenderUI.call(this);if(this.enableGroupingMenu&&this.hmenu){this.hmenu.add("-",{itemId:"groupBy",text:this.groupByText,handler:this.onGroupByClick,scope:this,iconCls:"x-group-by-icon"});if(this.enableNoGroups){this.hmenu.add({itemId:"showGroups",text:this.showGroupsText,checked:true,checkHandler:this.onShowGroupsClick,scope:this})}this.hmenu.on("beforeshow",this.beforeMenuShow,this)}},renderRows:function(){var a=this.getGroupField();var e=!!a;if(this.hideGroupedColumn){var b=this.cm.findColumnIndex(a),d=Ext.isDefined(this.lastGroupField);if(!e&&d){this.mainBody.update("");this.cm.setHidden(this.cm.findColumnIndex(this.lastGroupField),false);delete this.lastGroupField}else{if(e&&!d){this.lastGroupField=a;this.cm.setHidden(b,true)}else{if(e&&d&&a!==this.lastGroupField){this.mainBody.update("");var c=this.cm.findColumnIndex(this.lastGroupField);this.cm.setHidden(c,false);this.lastGroupField=a;this.cm.setHidden(b,true)}}}}return Ext.grid.GroupingView.superclass.renderRows.apply(this,arguments)},doRender:function(c,h,s,a,q,t){if(h.length<1){return""}if(!this.canGroup()||this.isUpdating){return Ext.grid.GroupingView.superclass.doRender.apply(this,arguments)}var A=this.getGroupField(),p=this.cm.findColumnIndex(A),x,k="width:"+this.getTotalWidth()+";",e=this.cm.config[p],b=e.groupRenderer||e.renderer,u=this.showGroupName?(e.groupName||e.header)+": ":"",z=[],m,v,w,o;for(v=0,w=h.length;v<w;v++){var l=a+v,n=h[v],d=n.data[A];x=this.getGroup(d,n,b,l,p,s);if(!m||m.group!=x){o=this.constructId(d,A,p);this.state[o]=!(Ext.isDefined(this.state[o])?!this.state[o]:this.startCollapsed);m={group:x,gvalue:d,text:u+x,groupId:o,startRow:l,rs:[n],cls:this.state[o]?"":"x-grid-group-collapsed",style:k};z.push(m)}else{m.rs.push(n)}n._groupId=o}var y=[];for(v=0,w=z.length;v<w;v++){x=z[v];this.doGroupStart(y,x,c,s,q);y[y.length]=Ext.grid.GroupingView.superclass.doRender.call(this,c,x.rs,s,x.startRow,q,t);this.doGroupEnd(y,x,c,s,q)}return y.join("")},getGroupId:function(a){var b=this.getGroupField();return this.constructId(a,b,this.cm.findColumnIndex(b))},constructId:function(c,e,a){var b=this.cm.config[a],d=b.groupRenderer||b.renderer,g=(this.groupMode=="value")?c:this.getGroup(c,{data:{}},d,0,a,this.ds);return this.getPrefix(e)+Ext.util.Format.htmlEncode(g)},canGroup:function(){return this.enableGrouping&&!!this.getGroupField()},getPrefix:function(a){return this.grid.getGridEl().id+"-gp-"+a+"-"},doGroupStart:function(a,d,b,e,c){a[a.length]=this.startGroup.apply(d)},doGroupEnd:function(a,d,b,e,c){a[a.length]=this.endGroup},getRows:function(){if(!this.canGroup()){return Ext.grid.GroupingView.superclass.getRows.call(this)}var k=[],c=this.getGroups(),h,e=0,a=c.length,d,b;for(;e<a;++e){h=c[e].childNodes[1];if(h){h=h.childNodes;for(d=0,b=h.length;d<b;++d){k[k.length]=h[d]}}}return k},updateGroupWidths:function(){if(!this.canGroup()||!this.hasRows()){return}var c=Math.max(this.cm.getTotalWidth(),this.el.dom.offsetWidth-this.getScrollOffset())+"px";var b=this.getGroups();for(var d=0,a=b.length;d<a;d++){b[d].firstChild.style.width=c}},onColumnWidthUpdated:function(c,a,b){Ext.grid.GroupingView.superclass.onColumnWidthUpdated.call(this,c,a,b);this.updateGroupWidths()},onAllColumnWidthsUpdated:function(a,b){Ext.grid.GroupingView.superclass.onAllColumnWidthsUpdated.call(this,a,b);this.updateGroupWidths()},onColumnHiddenUpdated:function(b,c,a){Ext.grid.GroupingView.superclass.onColumnHiddenUpdated.call(this,b,c,a);this.updateGroupWidths()},onLayout:function(){this.updateGroupWidths()},onBeforeRowSelect:function(b,a){this.toggleRowIndex(a,true)}});Ext.grid.GroupingView.GROUP_ID=1000;
+/*
+---
+MooTools: the javascript framework
+
+web build:
+ - http://mootools.net/core/7c56cfef9dddcf170a5d68e3fb61cfd7
+
+packager build:
+ - packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class Core/Class.Extras Core/Slick.Parser Core/Slick.Finder Core/Element Core/Element.Style Core/Element.Event Core/Element.Dimensions Core/Fx Core/Fx.CSS Core/Fx.Tween Core/Fx.Morph Core/Fx.Transitions Core/Request Core/Request.HTML Core/Request.JSON Core/Cookie Core/JSON Core/DOMReady Core/Swiff
+
+copyrights:
+ - [MooTools](http://mootools.net)
+
+licenses:
+ - [MIT License](http://mootools.net/license.txt)
+...
+*/
+(function(){this.MooTools={version:"1.3.2",build:"c9f1ff10e9e7facb65e9481049ed1b450959d587"};var e=this.typeOf=function(i){if(i==null){return"null";}if(i.$family){return i.$family();
+}if(i.nodeName){if(i.nodeType==1){return"element";}if(i.nodeType==3){return(/\S/).test(i.nodeValue)?"textnode":"whitespace";}}else{if(typeof i.length=="number"){if(i.callee){return"arguments";
+}if("item" in i){return"collection";}}}return typeof i;};var u=this.instanceOf=function(w,i){if(w==null){return false;}var v=w.$constructor||w.constructor;
+while(v){if(v===i){return true;}v=v.parent;}return w instanceof i;};var f=this.Function;var r=true;for(var q in {toString:1}){r=null;}if(r){r=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];
+}f.prototype.overloadSetter=function(v){var i=this;return function(x,w){if(x==null){return this;}if(v||typeof x!="string"){for(var y in x){i.call(this,y,x[y]);
+}if(r){for(var z=r.length;z--;){y=r[z];if(x.hasOwnProperty(y)){i.call(this,y,x[y]);}}}}else{i.call(this,x,w);}return this;};};f.prototype.overloadGetter=function(v){var i=this;
+return function(x){var y,w;if(v||typeof x!="string"){y=x;}else{if(arguments.length>1){y=arguments;}}if(y){w={};for(var z=0;z<y.length;z++){w[y[z]]=i.call(this,y[z]);
+}}else{w=i.call(this,x);}return w;};};f.prototype.extend=function(i,v){this[i]=v;}.overloadSetter();f.prototype.implement=function(i,v){this.prototype[i]=v;
+}.overloadSetter();var o=Array.prototype.slice;f.from=function(i){return(e(i)=="function")?i:function(){return i;};};Array.from=function(i){if(i==null){return[];
+}return(k.isEnumerable(i)&&typeof i!="string")?(e(i)=="array")?i:o.call(i):[i];};Number.from=function(v){var i=parseFloat(v);return isFinite(i)?i:null;
+};String.from=function(i){return i+"";};f.implement({hide:function(){this.$hidden=true;return this;},protect:function(){this.$protected=true;return this;
+}});var k=this.Type=function(x,w){if(x){var v=x.toLowerCase();var i=function(y){return(e(y)==v);};k["is"+x]=i;if(w!=null){w.prototype.$family=(function(){return v;
+}).hide();w.type=i;}}if(w==null){return null;}w.extend(this);w.$constructor=k;w.prototype.$constructor=w;return w;};var p=Object.prototype.toString;k.isEnumerable=function(i){return(i!=null&&typeof i.length=="number"&&p.call(i)!="[object Function]");
+};var b={};var d=function(i){var v=e(i.prototype);return b[v]||(b[v]=[]);};var h=function(w,A){if(A&&A.$hidden){return;}var v=d(this);for(var x=0;x<v.length;
+x++){var z=v[x];if(e(z)=="type"){h.call(z,w,A);}else{z.call(this,w,A);}}var y=this.prototype[w];if(y==null||!y.$protected){this.prototype[w]=A;}if(this[w]==null&&e(A)=="function"){t.call(this,w,function(i){return A.apply(i,o.call(arguments,1));
+});}};var t=function(i,w){if(w&&w.$hidden){return;}var v=this[i];if(v==null||!v.$protected){this[i]=w;}};k.implement({implement:h.overloadSetter(),extend:t.overloadSetter(),alias:function(i,v){h.call(this,i,this.prototype[v]);
+}.overloadSetter(),mirror:function(i){d(this).push(i);return this;}});new k("Type",k);var c=function(v,z,x){var w=(z!=Object),D=z.prototype;if(w){z=new k(v,z);
+}for(var A=0,y=x.length;A<y;A++){var E=x[A],C=z[E],B=D[E];if(C){C.protect();}if(w&&B){delete D[E];D[E]=B.protect();}}if(w){z.implement(D);}return c;};c("String",String,["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","quote","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase"])("Array",Array,["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice","indexOf","lastIndexOf","filter","forEach","every","map","some","reduce","reduceRight"])("Number",Number,["toExponential","toFixed","toLocaleString","toPrecision"])("Function",f,["apply","call","bind"])("RegExp",RegExp,["exec","test"])("Object",Object,["create","defineProperty","defineProperties","keys","getPrototypeOf","getOwnPropertyDescriptor","getOwnPropertyNames","preventExtensions","isExtensible","seal","isSealed","freeze","isFrozen"])("Date",Date,["now"]);
+Object.extend=t.overloadSetter();Date.extend("now",function(){return +(new Date);});new k("Boolean",Boolean);Number.prototype.$family=function(){return isFinite(this)?"number":"null";
+}.hide();Number.extend("random",function(v,i){return Math.floor(Math.random()*(i-v+1)+v);});var l=Object.prototype.hasOwnProperty;Object.extend("forEach",function(i,w,x){for(var v in i){if(l.call(i,v)){w.call(x,i[v],v,i);
+}}});Object.each=Object.forEach;Array.implement({forEach:function(x,y){for(var w=0,v=this.length;w<v;w++){if(w in this){x.call(y,this[w],w,this);}}},each:function(i,v){Array.forEach(this,i,v);
+return this;}});var s=function(i){switch(e(i)){case"array":return i.clone();case"object":return Object.clone(i);default:return i;}};Array.implement("clone",function(){var v=this.length,w=new Array(v);
+while(v--){w[v]=s(this[v]);}return w;});var a=function(v,i,w){switch(e(w)){case"object":if(e(v[i])=="object"){Object.merge(v[i],w);}else{v[i]=Object.clone(w);
+}break;case"array":v[i]=w.clone();break;default:v[i]=w;}return v;};Object.extend({merge:function(C,y,x){if(e(y)=="string"){return a(C,y,x);}for(var B=1,w=arguments.length;
+B<w;B++){var z=arguments[B];for(var A in z){a(C,A,z[A]);}}return C;},clone:function(i){var w={};for(var v in i){w[v]=s(i[v]);}return w;},append:function(z){for(var y=1,w=arguments.length;
+y<w;y++){var v=arguments[y]||{};for(var x in v){z[x]=v[x];}}return z;}});["Object","WhiteSpace","TextNode","Collection","Arguments"].each(function(i){new k(i);
+});var j=Date.now();String.extend("uniqueID",function(){return(j++).toString(36);});var g=this.Hash=new k("Hash",function(i){if(e(i)=="hash"){i=Object.clone(i.getClean());
+}for(var v in i){this[v]=i[v];}return this;});g.implement({forEach:function(i,v){Object.forEach(this,i,v);},getClean:function(){var v={};for(var i in this){if(this.hasOwnProperty(i)){v[i]=this[i];
+}}return v;},getLength:function(){var v=0;for(var i in this){if(this.hasOwnProperty(i)){v++;}}return v;}});g.alias("each","forEach");Object.type=k.isObject;
+var n=this.Native=function(i){return new k(i.name,i.initialize);};n.type=k.type;n.implement=function(x,v){for(var w=0;w<x.length;w++){x[w].implement(v);
+}return n;};var m=Array.type;Array.type=function(i){return u(i,Array)||m(i);};this.$A=function(i){return Array.from(i).slice();};this.$arguments=function(v){return function(){return arguments[v];
+};};this.$chk=function(i){return !!(i||i===0);};this.$clear=function(i){clearTimeout(i);clearInterval(i);return null;};this.$defined=function(i){return(i!=null);
+};this.$each=function(w,v,x){var i=e(w);((i=="arguments"||i=="collection"||i=="array"||i=="elements")?Array:Object).each(w,v,x);};this.$empty=function(){};
+this.$extend=function(v,i){return Object.append(v,i);};this.$H=function(i){return new g(i);};this.$merge=function(){var i=Array.slice(arguments);i.unshift({});
+return Object.merge.apply(null,i);};this.$lambda=f.from;this.$mixin=Object.merge;this.$random=Number.random;this.$splat=Array.from;this.$time=Date.now;
+this.$type=function(i){var v=e(i);if(v=="elements"){return"array";}return(v=="null")?false:v;};this.$unlink=function(i){switch(e(i)){case"object":return Object.clone(i);
+case"array":return Array.clone(i);case"hash":return new g(i);default:return i;}};})();Array.implement({every:function(c,d){for(var b=0,a=this.length;b<a;
+b++){if((b in this)&&!c.call(d,this[b],b,this)){return false;}}return true;},filter:function(d,e){var c=[];for(var b=0,a=this.length;b<a;b++){if((b in this)&&d.call(e,this[b],b,this)){c.push(this[b]);
+}}return c;},indexOf:function(c,d){var a=this.length;for(var b=(d<0)?Math.max(0,a+d):d||0;b<a;b++){if(this[b]===c){return b;}}return -1;},map:function(d,e){var c=[];
+for(var b=0,a=this.length;b<a;b++){if(b in this){c[b]=d.call(e,this[b],b,this);}}return c;},some:function(c,d){for(var b=0,a=this.length;b<a;b++){if((b in this)&&c.call(d,this[b],b,this)){return true;
+}}return false;},clean:function(){return this.filter(function(a){return a!=null;});},invoke:function(a){var b=Array.slice(arguments,1);return this.map(function(c){return c[a].apply(c,b);
+});},associate:function(c){var d={},b=Math.min(this.length,c.length);for(var a=0;a<b;a++){d[c[a]]=this[a];}return d;},link:function(c){var a={};for(var e=0,b=this.length;
+e<b;e++){for(var d in c){if(c[d](this[e])){a[d]=this[e];delete c[d];break;}}}return a;},contains:function(a,b){return this.indexOf(a,b)!=-1;},append:function(a){this.push.apply(this,a);
+return this;},getLast:function(){return(this.length)?this[this.length-1]:null;},getRandom:function(){return(this.length)?this[Number.random(0,this.length-1)]:null;
+},include:function(a){if(!this.contains(a)){this.push(a);}return this;},combine:function(c){for(var b=0,a=c.length;b<a;b++){this.include(c[b]);}return this;
+},erase:function(b){for(var a=this.length;a--;){if(this[a]===b){this.splice(a,1);}}return this;},empty:function(){this.length=0;return this;},flatten:function(){var d=[];
+for(var b=0,a=this.length;b<a;b++){var c=typeOf(this[b]);if(c=="null"){continue;}d=d.concat((c=="array"||c=="collection"||c=="arguments"||instanceOf(this[b],Array))?Array.flatten(this[b]):this[b]);
+}return d;},pick:function(){for(var b=0,a=this.length;b<a;b++){if(this[b]!=null){return this[b];}}return null;},hexToRgb:function(b){if(this.length!=3){return null;
+}var a=this.map(function(c){if(c.length==1){c+=c;}return c.toInt(16);});return(b)?a:"rgb("+a+")";},rgbToHex:function(d){if(this.length<3){return null;}if(this.length==4&&this[3]==0&&!d){return"transparent";
+}var b=[];for(var a=0;a<3;a++){var c=(this[a]-0).toString(16);b.push((c.length==1)?"0"+c:c);}return(d)?b:"#"+b.join("");}});Array.alias("extend","append");
+var $pick=function(){return Array.from(arguments).pick();};String.implement({test:function(a,b){return((typeOf(a)=="regexp")?a:new RegExp(""+a,b)).test(this);
+},contains:function(a,b){return(b)?(b+this+b).indexOf(b+a+b)>-1:this.indexOf(a)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim();
+},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase());
+});},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1");
+},toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);
+return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null;},substitute:function(a,b){return this.replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1);
+}return(a[c]!=null)?a[c]:"";});}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this));},round:function(a){a=Math.pow(10,a||0).toFixed(a<0?-a:0);
+return Math.round(this*a)/a;},times:function(b,c){for(var a=0;a<this;a++){b.call(c,a,this);}},toFloat:function(){return parseFloat(this);},toInt:function(a){return parseInt(this,a||10);
+}});Number.alias("each","times");(function(b){var a={};b.each(function(c){if(!Number[c]){a[c]=function(){return Math[c].apply(null,[this].concat(Array.from(arguments)));
+};}});Number.implement(a);})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);Function.extend({attempt:function(){for(var b=0,a=arguments.length;
+b<a;b++){try{return arguments[b]();}catch(c){}}return null;}});Function.implement({attempt:function(a,c){try{return this.apply(c,Array.from(a));}catch(b){}return null;
+},bind:function(c){var a=this,b=(arguments.length>1)?Array.slice(arguments,1):null;return function(){if(!b&&!arguments.length){return a.call(c);}if(b&&arguments.length){return a.apply(c,b.concat(Array.from(arguments)));
+}return a.apply(c,b||arguments);};},pass:function(b,c){var a=this;if(b!=null){b=Array.from(b);}return function(){return a.apply(c,b||arguments);};},delay:function(b,c,a){return setTimeout(this.pass((a==null?[]:a),c),b);
+},periodical:function(c,b,a){return setInterval(this.pass((a==null?[]:a),b),c);}});delete Function.prototype.bind;Function.implement({create:function(b){var a=this;
+b=b||{};return function(d){var c=b.arguments;c=(c!=null)?Array.from(c):Array.slice(arguments,(b.event)?1:0);if(b.event){c=[d||window.event].extend(c);}var e=function(){return a.apply(b.bind||null,c);
+};if(b.delay){return setTimeout(e,b.delay);}if(b.periodical){return setInterval(e,b.periodical);}if(b.attempt){return Function.attempt(e);}return e();};
+},bind:function(c,b){var a=this;if(b!=null){b=Array.from(b);}return function(){return a.apply(c,b||arguments);};},bindWithEvent:function(c,b){var a=this;
+if(b!=null){b=Array.from(b);}return function(d){return a.apply(c,(b==null)?arguments:[d].concat(b));};},run:function(a,b){return this.apply(b,Array.from(a));
+}});var $try=Function.attempt;(function(){var a=Object.prototype.hasOwnProperty;Object.extend({subset:function(d,g){var f={};for(var e=0,b=g.length;e<b;
+e++){var c=g[e];if(c in d){f[c]=d[c];}}return f;},map:function(b,e,f){var d={};for(var c in b){if(a.call(b,c)){d[c]=e.call(f,b[c],c,b);}}return d;},filter:function(b,e,g){var d={};
+for(var c in b){var f=b[c];if(a.call(b,c)&&e.call(g,f,c,b)){d[c]=f;}}return d;},every:function(b,d,e){for(var c in b){if(a.call(b,c)&&!d.call(e,b[c],c)){return false;
+}}return true;},some:function(b,d,e){for(var c in b){if(a.call(b,c)&&d.call(e,b[c],c)){return true;}}return false;},keys:function(b){var d=[];for(var c in b){if(a.call(b,c)){d.push(c);
+}}return d;},values:function(c){var b=[];for(var d in c){if(a.call(c,d)){b.push(c[d]);}}return b;},getLength:function(b){return Object.keys(b).length;},keyOf:function(b,d){for(var c in b){if(a.call(b,c)&&b[c]===d){return c;
+}}return null;},contains:function(b,c){return Object.keyOf(b,c)!=null;},toQueryString:function(b,c){var d=[];Object.each(b,function(h,g){if(c){g=c+"["+g+"]";
+}var f;switch(typeOf(h)){case"object":f=Object.toQueryString(h,g);break;case"array":var e={};h.each(function(k,j){e[j]=k;});f=Object.toQueryString(e,g);
+break;default:f=g+"="+encodeURIComponent(h);}if(h!=null){d.push(f);}});return d.join("&");}});})();Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(a){return Object.keyOf(this,a);
+},hasValue:function(a){return Object.contains(this,a);},extend:function(a){Hash.each(a||{},function(c,b){Hash.set(this,b,c);},this);return this;},combine:function(a){Hash.each(a||{},function(c,b){Hash.include(this,b,c);
+},this);return this;},erase:function(a){if(this.hasOwnProperty(a)){delete this[a];}return this;},get:function(a){return(this.hasOwnProperty(a))?this[a]:null;
+},set:function(a,b){if(!this[a]||this.hasOwnProperty(a)){this[a]=b;}return this;},empty:function(){Hash.each(this,function(b,a){delete this[a];},this);
+return this;},include:function(a,b){if(this[a]==null){this[a]=b;}return this;},map:function(a,b){return new Hash(Object.map(this,a,b));},filter:function(a,b){return new Hash(Object.filter(this,a,b));
+},every:function(a,b){return Object.every(this,a,b);},some:function(a,b){return Object.some(this,a,b);},getKeys:function(){return Object.keys(this);},getValues:function(){return Object.values(this);
+},toQueryString:function(a){return Object.toQueryString(this,a);}});Hash.extend=Object.append;Hash.alias({indexOf:"keyOf",contains:"hasValue"});(function(){var l=this.document;
+var j=l.window=this;var b=1;this.$uid=(j.ActiveXObject)?function(e){return(e.uid||(e.uid=[b++]))[0];}:function(e){return e.uid||(e.uid=b++);};$uid(j);$uid(l);
+var a=navigator.userAgent.toLowerCase(),c=navigator.platform.toLowerCase(),k=a.match(/(opera|ie|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|$)/)||[null,"unknown",0],g=k[1]=="ie"&&l.documentMode;
+var p=this.Browser={extend:Function.prototype.extend,name:(k[1]=="version")?k[3]:k[1],version:g||parseFloat((k[1]=="opera"&&k[4])?k[4]:k[2]),Platform:{name:a.match(/ip(?:ad|od|hone)/)?"ios":(a.match(/(?:webos|android)/)||c.match(/mac|win|linux/)||["other"])[0]},Features:{xpath:!!(l.evaluate),air:!!(j.runtime),query:!!(l.querySelector),json:!!(j.JSON)},Plugins:{}};
+p[p.name]=true;p[p.name+parseInt(p.version,10)]=true;p.Platform[p.Platform.name]=true;p.Request=(function(){var r=function(){return new XMLHttpRequest();
+};var q=function(){return new ActiveXObject("MSXML2.XMLHTTP");};var e=function(){return new ActiveXObject("Microsoft.XMLHTTP");};return Function.attempt(function(){r();
+return r;},function(){q();return q;},function(){e();return e;});})();p.Features.xhr=!!(p.Request);var i=(Function.attempt(function(){return navigator.plugins["Shockwave Flash"].description;
+},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version");})||"0 r0").match(/\d+/g);p.Plugins.Flash={version:Number(i[0]||"0."+i[1])||0,build:Number(i[2])||0};
+p.exec=function(q){if(!q){return q;}if(j.execScript){j.execScript(q);}else{var e=l.createElement("script");e.setAttribute("type","text/javascript");e.text=q;
+l.head.appendChild(e);l.head.removeChild(e);}return q;};String.implement("stripScripts",function(q){var e="";var r=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(s,t){e+=t+"\n";
+return"";});if(q===true){p.exec(e);}else{if(typeOf(q)=="function"){q(e,r);}}return r;});p.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event});
+this.Window=this.$constructor=new Type("Window",function(){});this.$family=Function.from("window").hide();Window.mirror(function(e,q){j[e]=q;});this.Document=l.$constructor=new Type("Document",function(){});
+l.$family=Function.from("document").hide();Document.mirror(function(e,q){l[e]=q;});l.html=l.documentElement;if(!l.head){l.head=l.getElementsByTagName("head")[0];
+}if(l.execCommand){try{l.execCommand("BackgroundImageCache",false,true);}catch(h){}}if(this.attachEvent&&!this.addEventListener){var d=function(){this.detachEvent("onunload",d);
+l.head=l.html=l.window=null;};this.attachEvent("onunload",d);}var n=Array.from;try{n(l.html.childNodes);}catch(h){Array.from=function(q){if(typeof q!="string"&&Type.isEnumerable(q)&&typeOf(q)!="array"){var e=q.length,r=new Array(e);
+while(e--){r[e]=q[e];}return r;}return n(q);};var m=Array.prototype,o=m.slice;["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice"].each(function(e){var q=m[e];
+Array[e]=function(r){return q.apply(Array.from(r),o.call(arguments,1));};});}if(p.Platform.ios){p.Platform.ipod=true;}p.Engine={};var f=function(q,e){p.Engine.name=q;
+p.Engine[q+e]=true;p.Engine.version=e;};if(p.ie){p.Engine.trident=true;switch(p.version){case 6:f("trident",4);break;case 7:f("trident",5);break;case 8:f("trident",6);
+}}if(p.firefox){p.Engine.gecko=true;if(p.version>=3){f("gecko",19);}else{f("gecko",18);}}if(p.safari||p.chrome){p.Engine.webkit=true;switch(p.version){case 2:f("webkit",419);
+break;case 3:f("webkit",420);break;case 4:f("webkit",525);}}if(p.opera){p.Engine.presto=true;if(p.version>=9.6){f("presto",960);}else{if(p.version>=9.5){f("presto",950);
+}else{f("presto",925);}}}if(p.name=="unknown"){switch((a.match(/(?:webkit|khtml|gecko)/)||[])[0]){case"webkit":case"khtml":p.Engine.webkit=true;break;case"gecko":p.Engine.gecko=true;
+}}this.$exec=p.exec;})();var Event=new Type("Event",function(a,i){if(!i){i=window;}var o=i.document;a=a||i.event;if(a.$extended){return a;}this.$extended=true;
+var n=a.type,k=a.target||a.srcElement,m={},c={},q=null,h,l,b,p;while(k&&k.nodeType==3){k=k.parentNode;}if(n.indexOf("key")!=-1){b=a.which||a.keyCode;p=Object.keyOf(Event.Keys,b);
+if(n=="keydown"){var d=b-111;if(d>0&&d<13){p="f"+d;}}if(!p){p=String.fromCharCode(b).toLowerCase();}}else{if((/click|mouse|menu/i).test(n)){o=(!o.compatMode||o.compatMode=="CSS1Compat")?o.html:o.body;
+m={x:(a.pageX!=null)?a.pageX:a.clientX+o.scrollLeft,y:(a.pageY!=null)?a.pageY:a.clientY+o.scrollTop};c={x:(a.pageX!=null)?a.pageX-i.pageXOffset:a.clientX,y:(a.pageY!=null)?a.pageY-i.pageYOffset:a.clientY};
+if((/DOMMouseScroll|mousewheel/).test(n)){l=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3;}h=(a.which==3)||(a.button==2);if((/over|out/).test(n)){q=a.relatedTarget||a[(n=="mouseover"?"from":"to")+"Element"];
+var j=function(){while(q&&q.nodeType==3){q=q.parentNode;}return true;};var g=(Browser.firefox2)?j.attempt():j();q=(g)?q:null;}}else{if((/gesture|touch/i).test(n)){this.rotation=a.rotation;
+this.scale=a.scale;this.targetTouches=a.targetTouches;this.changedTouches=a.changedTouches;var f=this.touches=a.touches;if(f&&f[0]){var e=f[0];m={x:e.pageX,y:e.pageY};
+c={x:e.clientX,y:e.clientY};}}}}return Object.append(this,{event:a,type:n,page:m,client:c,rightClick:h,wheel:l,relatedTarget:document.id(q),target:document.id(k),code:b,key:p,shift:a.shiftKey,control:a.ctrlKey,alt:a.altKey,meta:a.metaKey});
+});Event.Keys={enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46};Event.Keys=new Hash(Event.Keys);Event.implement({stop:function(){return this.stopPropagation().preventDefault();
+},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault();
+}else{this.event.returnValue=false;}return this;}});(function(){var a=this.Class=new Type("Class",function(h){if(instanceOf(h,Function)){h={initialize:h};
+}var g=function(){e(this);if(g.$prototyping){return this;}this.$caller=null;var i=(this.initialize)?this.initialize.apply(this,arguments):this;this.$caller=this.caller=null;
+return i;}.extend(this).implement(h);g.$constructor=a;g.prototype.$constructor=g;g.prototype.parent=c;return g;});var c=function(){if(!this.$caller){throw new Error('The method "parent" cannot be called.');
+}var g=this.$caller.$name,h=this.$caller.$owner.parent,i=(h)?h.prototype[g]:null;if(!i){throw new Error('The method "'+g+'" has no parent.');}return i.apply(this,arguments);
+};var e=function(g){for(var h in g){var j=g[h];switch(typeOf(j)){case"object":var i=function(){};i.prototype=j;g[h]=e(new i);break;case"array":g[h]=j.clone();
+break;}}return g;};var b=function(g,h,j){if(j.$origin){j=j.$origin;}var i=function(){if(j.$protected&&this.$caller==null){throw new Error('The method "'+h+'" cannot be called.');
+}var l=this.caller,m=this.$caller;this.caller=m;this.$caller=i;var k=j.apply(this,arguments);this.$caller=m;this.caller=l;return k;}.extend({$owner:g,$origin:j,$name:h});
+return i;};var f=function(h,i,g){if(a.Mutators.hasOwnProperty(h)){i=a.Mutators[h].call(this,i);if(i==null){return this;}}if(typeOf(i)=="function"){if(i.$hidden){return this;
+}this.prototype[h]=(g)?i:b(this,h,i);}else{Object.merge(this.prototype,h,i);}return this;};var d=function(g){g.$prototyping=true;var h=new g;delete g.$prototyping;
+return h;};a.implement("implement",f.overloadSetter());a.Mutators={Extends:function(g){this.parent=g;this.prototype=d(g);},Implements:function(g){Array.from(g).each(function(j){var h=new j;
+for(var i in h){f.call(this,i,h[i],true);}},this);}};})();(function(){this.Chain=new Class({$chain:[],chain:function(){this.$chain.append(Array.flatten(arguments));
+return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false;},clearChain:function(){this.$chain.empty();
+return this;}});var a=function(b){return b.replace(/^on([A-Z])/,function(c,d){return d.toLowerCase();});};this.Events=new Class({$events:{},addEvent:function(d,c,b){d=a(d);
+if(c==$empty){return this;}this.$events[d]=(this.$events[d]||[]).include(c);if(b){c.internal=true;}return this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]);
+}return this;},fireEvent:function(e,c,b){e=a(e);var d=this.$events[e];if(!d){return this;}c=Array.from(c);d.each(function(f){if(b){f.delay(b,this,c);}else{f.apply(this,c);
+}},this);return this;},removeEvent:function(e,d){e=a(e);var c=this.$events[e];if(c&&!d.internal){var b=c.indexOf(d);if(b!=-1){delete c[b];}}return this;
+},removeEvents:function(d){var e;if(typeOf(d)=="object"){for(e in d){this.removeEvent(e,d[e]);}return this;}if(d){d=a(d);}for(e in this.$events){if(d&&d!=e){continue;
+}var c=this.$events[e];for(var b=c.length;b--;){if(b in c){this.removeEvent(e,c[b]);}}}return this;}});this.Options=new Class({setOptions:function(){var b=this.options=Object.merge.apply(null,[{},this.options].append(arguments));
+if(this.addEvent){for(var c in b){if(typeOf(b[c])!="function"||!(/^on[A-Z]/).test(c)){continue;}this.addEvent(c,b[c]);delete b[c];}}return this;}});})();
+(function(){var k,n,l,g,a={},c={},m=/\\/g;var e=function(q,p){if(q==null){return null;}if(q.Slick===true){return q;}q=(""+q).replace(/^\s+|\s+$/g,"");g=!!p;
+var o=(g)?c:a;if(o[q]){return o[q];}k={Slick:true,expressions:[],raw:q,reverse:function(){return e(this.raw,true);}};n=-1;while(q!=(q=q.replace(j,b))){}k.length=k.expressions.length;
+return o[k.raw]=(g)?h(k):k;};var i=function(o){if(o==="!"){return" ";}else{if(o===" "){return"!";}else{if((/^!/).test(o)){return o.replace(/^!/,"");}else{return"!"+o;
+}}}};var h=function(u){var r=u.expressions;for(var p=0;p<r.length;p++){var t=r[p];var q={parts:[],tag:"*",combinator:i(t[0].combinator)};for(var o=0;o<t.length;
+o++){var s=t[o];if(!s.reverseCombinator){s.reverseCombinator=" ";}s.combinator=s.reverseCombinator;delete s.reverseCombinator;}t.reverse().push(q);}return u;
+};var f=function(o){return o.replace(/[-[\]{}()*+?.\\^$|,#\s]/g,function(p){return"\\"+p;});};var j=new RegExp("^(?:\\s*(,)\\s*|\\s*(<combinator>+)\\s*|(\\s+)|(<unicode>+|\\*)|\\#(<unicode>+)|\\.(<unicode>+)|\\[\\s*(<unicode1>+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(<unicode>+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(/<combinator>/,"["+f(">+~`!@$%^&={}\\;</")+"]").replace(/<unicode>/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(/<unicode1>/g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])"));
+function b(x,s,D,z,r,C,q,B,A,y,u,F,G,v,p,w){if(s||n===-1){k.expressions[++n]=[];l=-1;if(s){return"";}}if(D||z||l===-1){D=D||" ";var t=k.expressions[n];
+if(g&&t[l]){t[l].reverseCombinator=i(D);}t[++l]={combinator:D,tag:"*"};}var o=k.expressions[n][l];if(r){o.tag=r.replace(m,"");}else{if(C){o.id=C.replace(m,"");
+}else{if(q){q=q.replace(m,"");if(!o.classList){o.classList=[];}if(!o.classes){o.classes=[];}o.classList.push(q);o.classes.push({value:q,regexp:new RegExp("(^|\\s)"+f(q)+"(\\s|$)")});
+}else{if(G){w=w||p;w=w?w.replace(m,""):null;if(!o.pseudos){o.pseudos=[];}o.pseudos.push({key:G.replace(m,""),value:w,type:F.length==1?"class":"element"});
+}else{if(B){B=B.replace(m,"");u=(u||"").replace(m,"");var E,H;switch(A){case"^=":H=new RegExp("^"+f(u));break;case"$=":H=new RegExp(f(u)+"$");break;case"~=":H=new RegExp("(^|\\s)"+f(u)+"(\\s|$)");
+break;case"|=":H=new RegExp("^"+f(u)+"(-|$)");break;case"=":E=function(I){return u==I;};break;case"*=":E=function(I){return I&&I.indexOf(u)>-1;};break;
+case"!=":E=function(I){return u!=I;};break;default:E=function(I){return !!I;};}if(u==""&&(/^[*$^]=$/).test(A)){E=function(){return false;};}if(!E){E=function(I){return I&&H.test(I);
+};}if(!o.attributes){o.attributes=[];}o.attributes.push({key:B,operator:A,value:u,test:E});}}}}}return"";}var d=(this.Slick||{});d.parse=function(o){return e(o);
+};d.escapeRegExp=f;if(!this.Slick){this.Slick=d;}}).apply((typeof exports!="undefined")?exports:this);(function(){var j={},l={},b=Object.prototype.toString;
+j.isNativeCode=function(c){return(/\{\s*\[native code\]\s*\}/).test(""+c);};j.isXML=function(c){return(!!c.xmlVersion)||(!!c.xml)||(b.call(c)=="[object XMLDocument]")||(c.nodeType==9&&c.documentElement.nodeName!="HTML");
+};j.setDocument=function(w){var t=w.nodeType;if(t==9){}else{if(t){w=w.ownerDocument;}else{if(w.navigator){w=w.document;}else{return;}}}if(this.document===w){return;
+}this.document=w;var y=w.documentElement,u=this.getUIDXML(y),o=l[u],A;if(o){for(A in o){this[A]=o[A];}return;}o=l[u]={};o.root=y;o.isXMLDocument=this.isXML(w);
+o.brokenStarGEBTN=o.starSelectsClosedQSA=o.idGetsName=o.brokenMixedCaseQSA=o.brokenGEBCN=o.brokenCheckedQSA=o.brokenEmptyAttributeQSA=o.isHTMLDocument=o.nativeMatchesSelector=false;
+var m,n,x,q,r;var s,c="slick_uniqueid";var z=w.createElement("div");var p=w.body||w.getElementsByTagName("body")[0]||y;p.appendChild(z);try{z.innerHTML='<a id="'+c+'"></a>';
+o.isHTMLDocument=!!w.getElementById(c);}catch(v){}if(o.isHTMLDocument){z.style.display="none";z.appendChild(w.createComment(""));n=(z.getElementsByTagName("*").length>1);
+try{z.innerHTML="foo</foo>";s=z.getElementsByTagName("*");m=(s&&!!s.length&&s[0].nodeName.charAt(0)=="/");}catch(v){}o.brokenStarGEBTN=n||m;try{z.innerHTML='<a name="'+c+'"></a><b id="'+c+'"></b>';
+o.idGetsName=w.getElementById(c)===z.firstChild;}catch(v){}if(z.getElementsByClassName){try{z.innerHTML='<a class="f"></a><a class="b"></a>';z.getElementsByClassName("b").length;
+z.firstChild.className="b";q=(z.getElementsByClassName("b").length!=2);}catch(v){}try{z.innerHTML='<a class="a"></a><a class="f b a"></a>';x=(z.getElementsByClassName("a").length!=2);
+}catch(v){}o.brokenGEBCN=q||x;}if(z.querySelectorAll){try{z.innerHTML="foo</foo>";s=z.querySelectorAll("*");o.starSelectsClosedQSA=(s&&!!s.length&&s[0].nodeName.charAt(0)=="/");
+}catch(v){}try{z.innerHTML='<a class="MiX"></a>';o.brokenMixedCaseQSA=!z.querySelectorAll(".MiX").length;}catch(v){}try{z.innerHTML='<select><option selected="selected">a</option></select>';
+o.brokenCheckedQSA=(z.querySelectorAll(":checked").length==0);}catch(v){}try{z.innerHTML='<a class=""></a>';o.brokenEmptyAttributeQSA=(z.querySelectorAll('[class*=""]').length!=0);
+}catch(v){}}try{z.innerHTML='<form action="s"><input id="action"/></form>';r=(z.firstChild.getAttribute("action")!="s");}catch(v){}o.nativeMatchesSelector=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector;
+if(o.nativeMatchesSelector){try{o.nativeMatchesSelector.call(y,":slick");o.nativeMatchesSelector=null;}catch(v){}}}try{y.slick_expando=1;delete y.slick_expando;
+o.getUID=this.getUIDHTML;}catch(v){o.getUID=this.getUIDXML;}p.removeChild(z);z=s=p=null;o.getAttribute=(o.isHTMLDocument&&r)?function(D,B){var E=this.attributeGetters[B];
+if(E){return E.call(D);}var C=D.getAttributeNode(B);return(C)?C.nodeValue:null;}:function(C,B){var D=this.attributeGetters[B];return(D)?D.call(C):C.getAttribute(B);
+};o.hasAttribute=(y&&this.isNativeCode(y.hasAttribute))?function(C,B){return C.hasAttribute(B);}:function(C,B){C=C.getAttributeNode(B);return !!(C&&(C.specified||C.nodeValue));
+};o.contains=(y&&this.isNativeCode(y.contains))?function(B,C){return B.contains(C);}:(y&&y.compareDocumentPosition)?function(B,C){return B===C||!!(B.compareDocumentPosition(C)&16);
+}:function(B,C){if(C){do{if(C===B){return true;}}while((C=C.parentNode));}return false;};o.documentSorter=(y.compareDocumentPosition)?function(C,B){if(!C.compareDocumentPosition||!B.compareDocumentPosition){return 0;
+}return C.compareDocumentPosition(B)&4?-1:C===B?0:1;}:("sourceIndex" in y)?function(C,B){if(!C.sourceIndex||!B.sourceIndex){return 0;}return C.sourceIndex-B.sourceIndex;
+}:(w.createRange)?function(E,C){if(!E.ownerDocument||!C.ownerDocument){return 0;}var D=E.ownerDocument.createRange(),B=C.ownerDocument.createRange();D.setStart(E,0);
+D.setEnd(E,0);B.setStart(C,0);B.setEnd(C,0);return D.compareBoundaryPoints(Range.START_TO_END,B);}:null;y=null;for(A in o){this[A]=o[A];}};var e=/^([#.]?)((?:[\w-]+|\*))$/,g=/\[.+[*$^]=(?:""|'')?\]/,f={};
+j.search=function(U,z,H,s){var p=this.found=(s)?null:(H||[]);if(!U){return p;}else{if(U.navigator){U=U.document;}else{if(!U.nodeType){return p;}}}var F,O,V=this.uniques={},I=!!(H&&H.length),y=(U.nodeType==9);
+if(this.document!==(y?U:U.ownerDocument)){this.setDocument(U);}if(I){for(O=p.length;O--;){V[this.getUID(p[O])]=true;}}if(typeof z=="string"){var r=z.match(e);
+simpleSelectors:if(r){var u=r[1],v=r[2],A,E;if(!u){if(v=="*"&&this.brokenStarGEBTN){break simpleSelectors;}E=U.getElementsByTagName(v);if(s){return E[0]||null;
+}for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}else{if(u=="#"){if(!this.isHTMLDocument||!y){break simpleSelectors;}A=U.getElementById(v);
+if(!A){return p;}if(this.idGetsName&&A.getAttributeNode("id").nodeValue!=v){break simpleSelectors;}if(s){return A||null;}if(!(I&&V[this.getUID(A)])){p.push(A);
+}}else{if(u=="."){if(!this.isHTMLDocument||((!U.getElementsByClassName||this.brokenGEBCN)&&U.querySelectorAll)){break simpleSelectors;}if(U.getElementsByClassName&&!this.brokenGEBCN){E=U.getElementsByClassName(v);
+if(s){return E[0]||null;}for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}else{var T=new RegExp("(^|\\s)"+d.escapeRegExp(v)+"(\\s|$)");E=U.getElementsByTagName("*");
+for(O=0;A=E[O++];){className=A.className;if(!(className&&T.test(className))){continue;}if(s){return A;}if(!(I&&V[this.getUID(A)])){p.push(A);}}}}}}if(I){this.sort(p);
+}return(s)?null:p;}querySelector:if(U.querySelectorAll){if(!this.isHTMLDocument||f[z]||this.brokenMixedCaseQSA||(this.brokenCheckedQSA&&z.indexOf(":checked")>-1)||(this.brokenEmptyAttributeQSA&&g.test(z))||(!y&&z.indexOf(",")>-1)||d.disableQSA){break querySelector;
+}var S=z,x=U;if(!y){var C=x.getAttribute("id"),t="slickid__";x.setAttribute("id",t);S="#"+t+" "+S;U=x.parentNode;}try{if(s){return U.querySelector(S)||null;
+}else{E=U.querySelectorAll(S);}}catch(Q){f[z]=1;break querySelector;}finally{if(!y){if(C){x.setAttribute("id",C);}else{x.removeAttribute("id");}U=x;}}if(this.starSelectsClosedQSA){for(O=0;
+A=E[O++];){if(A.nodeName>"@"&&!(I&&V[this.getUID(A)])){p.push(A);}}}else{for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}if(I){this.sort(p);
+}return p;}F=this.Slick.parse(z);if(!F.length){return p;}}else{if(z==null){return p;}else{if(z.Slick){F=z;}else{if(this.contains(U.documentElement||U,z)){(p)?p.push(z):p=z;
+return p;}else{return p;}}}}this.posNTH={};this.posNTHLast={};this.posNTHType={};this.posNTHTypeLast={};this.push=(!I&&(s||(F.length==1&&F.expressions[0].length==1)))?this.pushArray:this.pushUID;
+if(p==null){p=[];}var M,L,K;var B,J,D,c,q,G,W;var N,P,o,w,R=F.expressions;search:for(O=0;(P=R[O]);O++){for(M=0;(o=P[M]);M++){B="combinator:"+o.combinator;
+if(!this[B]){continue search;}J=(this.isXMLDocument)?o.tag:o.tag.toUpperCase();D=o.id;c=o.classList;q=o.classes;G=o.attributes;W=o.pseudos;w=(M===(P.length-1));
+this.bitUniques={};if(w){this.uniques=V;this.found=p;}else{this.uniques={};this.found=[];}if(M===0){this[B](U,J,D,q,G,W,c);if(s&&w&&p.length){break search;
+}}else{if(s&&w){for(L=0,K=N.length;L<K;L++){this[B](N[L],J,D,q,G,W,c);if(p.length){break search;}}}else{for(L=0,K=N.length;L<K;L++){this[B](N[L],J,D,q,G,W,c);
+}}}N=this.found;}}if(I||(F.expressions.length>1)){this.sort(p);}return(s)?(p[0]||null):p;};j.uidx=1;j.uidk="slick-uniqueid";j.getUIDXML=function(m){var c=m.getAttribute(this.uidk);
+if(!c){c=this.uidx++;m.setAttribute(this.uidk,c);}return c;};j.getUIDHTML=function(c){return c.uniqueNumber||(c.uniqueNumber=this.uidx++);};j.sort=function(c){if(!this.documentSorter){return c;
+}c.sort(this.documentSorter);return c;};j.cacheNTH={};j.matchNTH=/^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/;j.parseNTHArgument=function(p){var n=p.match(this.matchNTH);
+if(!n){return false;}var o=n[2]||false;var m=n[1]||1;if(m=="-"){m=-1;}var c=+n[3]||0;n=(o=="n")?{a:m,b:c}:(o=="odd")?{a:2,b:1}:(o=="even")?{a:2,b:0}:{a:0,b:m};
+return(this.cacheNTH[p]=n);};j.createNTHPseudo=function(o,m,c,n){return function(r,p){var t=this.getUID(r);if(!this[c][t]){var z=r.parentNode;if(!z){return false;
+}var q=z[o],s=1;if(n){var y=r.nodeName;do{if(q.nodeName!=y){continue;}this[c][this.getUID(q)]=s++;}while((q=q[m]));}else{do{if(q.nodeType!=1){continue;
+}this[c][this.getUID(q)]=s++;}while((q=q[m]));}}p=p||"n";var u=this.cacheNTH[p]||this.parseNTHArgument(p);if(!u){return false;}var x=u.a,w=u.b,v=this[c][t];
+if(x==0){return w==v;}if(x>0){if(v<w){return false;}}else{if(w<v){return false;}}return((v-w)%x)==0;};};j.pushArray=function(o,c,q,n,m,p){if(this.matchSelector(o,c,q,n,m,p)){this.found.push(o);
+}};j.pushUID=function(p,c,r,o,m,q){var n=this.getUID(p);if(!this.uniques[n]&&this.matchSelector(p,c,r,o,m,q)){this.uniques[n]=true;this.found.push(p);}};
+j.matchNode=function(m,n){if(this.isHTMLDocument&&this.nativeMatchesSelector){try{return this.nativeMatchesSelector.call(m,n.replace(/\[([^=]+)=\s*([^'"\]]+?)\s*\]/g,'[$1="$2"]'));
+}catch(u){}}var t=this.Slick.parse(n);if(!t){return true;}var r=t.expressions,p,s=0,q;for(q=0;(currentExpression=r[q]);q++){if(currentExpression.length==1){var o=currentExpression[0];
+if(this.matchSelector(m,(this.isXMLDocument)?o.tag:o.tag.toUpperCase(),o.id,o.classes,o.attributes,o.pseudos)){return true;}s++;}}if(s==t.length){return false;
+}var c=this.search(this.document,t),v;for(q=0;v=c[q++];){if(v===m){return true;}}return false;};j.matchPseudo=function(p,c,o){var m="pseudo:"+c;if(this[m]){return this[m](p,o);
+}var n=this.getAttribute(p,c);return(o)?o==n:!!n;};j.matchSelector=function(n,u,c,o,p,r){if(u){var s=(this.isXMLDocument)?n.nodeName:n.nodeName.toUpperCase();
+if(u=="*"){if(s<"@"){return false;}}else{if(s!=u){return false;}}}if(c&&n.getAttribute("id")!=c){return false;}var q,m,t;if(o){for(q=o.length;q--;){t=n.getAttribute("class")||n.className;
+if(!(t&&o[q].regexp.test(t))){return false;}}}if(p){for(q=p.length;q--;){m=p[q];if(m.operator?!m.test(this.getAttribute(n,m.key)):!this.hasAttribute(n,m.key)){return false;
+}}}if(r){for(q=r.length;q--;){m=r[q];if(!this.matchPseudo(n,m.key,m.value)){return false;}}}return true;};var i={" ":function(p,v,m,q,r,t,o){var s,u,n;
+if(this.isHTMLDocument){getById:if(m){u=this.document.getElementById(m);if((!u&&p.all)||(this.idGetsName&&u&&u.getAttributeNode("id").nodeValue!=m)){n=p.all[m];
+if(!n){return;}if(!n[0]){n=[n];}for(s=0;u=n[s++];){var c=u.getAttributeNode("id");if(c&&c.nodeValue==m){this.push(u,v,null,q,r,t);break;}}return;}if(!u){if(this.contains(this.root,p)){return;
+}else{break getById;}}else{if(this.document!==p&&!this.contains(p,u)){return;}}this.push(u,v,null,q,r,t);return;}getByClass:if(q&&p.getElementsByClassName&&!this.brokenGEBCN){n=p.getElementsByClassName(o.join(" "));
+if(!(n&&n.length)){break getByClass;}for(s=0;u=n[s++];){this.push(u,v,m,null,r,t);}return;}}getByTag:{n=p.getElementsByTagName(v);if(!(n&&n.length)){break getByTag;
+}if(!this.brokenStarGEBTN){v=null;}for(s=0;u=n[s++];){this.push(u,v,m,q,r,t);}}},">":function(o,c,q,n,m,p){if((o=o.firstChild)){do{if(o.nodeType==1){this.push(o,c,q,n,m,p);
+}}while((o=o.nextSibling));}},"+":function(o,c,q,n,m,p){while((o=o.nextSibling)){if(o.nodeType==1){this.push(o,c,q,n,m,p);break;}}},"^":function(o,c,q,n,m,p){o=o.firstChild;
+if(o){if(o.nodeType==1){this.push(o,c,q,n,m,p);}else{this["combinator:+"](o,c,q,n,m,p);}}},"~":function(p,c,r,o,m,q){while((p=p.nextSibling)){if(p.nodeType!=1){continue;
+}var n=this.getUID(p);if(this.bitUniques[n]){break;}this.bitUniques[n]=true;this.push(p,c,r,o,m,q);}},"++":function(o,c,q,n,m,p){this["combinator:+"](o,c,q,n,m,p);
+this["combinator:!+"](o,c,q,n,m,p);},"~~":function(o,c,q,n,m,p){this["combinator:~"](o,c,q,n,m,p);this["combinator:!~"](o,c,q,n,m,p);},"!":function(o,c,q,n,m,p){while((o=o.parentNode)){if(o!==this.document){this.push(o,c,q,n,m,p);
+}}},"!>":function(o,c,q,n,m,p){o=o.parentNode;if(o!==this.document){this.push(o,c,q,n,m,p);}},"!+":function(o,c,q,n,m,p){while((o=o.previousSibling)){if(o.nodeType==1){this.push(o,c,q,n,m,p);
+break;}}},"!^":function(o,c,q,n,m,p){o=o.lastChild;if(o){if(o.nodeType==1){this.push(o,c,q,n,m,p);}else{this["combinator:!+"](o,c,q,n,m,p);}}},"!~":function(p,c,r,o,m,q){while((p=p.previousSibling)){if(p.nodeType!=1){continue;
+}var n=this.getUID(p);if(this.bitUniques[n]){break;}this.bitUniques[n]=true;this.push(p,c,r,o,m,q);}}};for(var h in i){j["combinator:"+h]=i[h];}var k={empty:function(c){var m=c.firstChild;
+return !(m&&m.nodeType==1)&&!(c.innerText||c.textContent||"").length;},not:function(c,m){return !this.matchNode(c,m);},contains:function(c,m){return(c.innerText||c.textContent||"").indexOf(m)>-1;
+},"first-child":function(c){while((c=c.previousSibling)){if(c.nodeType==1){return false;}}return true;},"last-child":function(c){while((c=c.nextSibling)){if(c.nodeType==1){return false;
+}}return true;},"only-child":function(n){var m=n;while((m=m.previousSibling)){if(m.nodeType==1){return false;}}var c=n;while((c=c.nextSibling)){if(c.nodeType==1){return false;
+}}return true;},"nth-child":j.createNTHPseudo("firstChild","nextSibling","posNTH"),"nth-last-child":j.createNTHPseudo("lastChild","previousSibling","posNTHLast"),"nth-of-type":j.createNTHPseudo("firstChild","nextSibling","posNTHType",true),"nth-last-of-type":j.createNTHPseudo("lastChild","previousSibling","posNTHTypeLast",true),index:function(m,c){return this["pseudo:nth-child"](m,""+c+1);
+},even:function(c){return this["pseudo:nth-child"](c,"2n");},odd:function(c){return this["pseudo:nth-child"](c,"2n+1");},"first-of-type":function(c){var m=c.nodeName;
+while((c=c.previousSibling)){if(c.nodeName==m){return false;}}return true;},"last-of-type":function(c){var m=c.nodeName;while((c=c.nextSibling)){if(c.nodeName==m){return false;
+}}return true;},"only-of-type":function(n){var m=n,o=n.nodeName;while((m=m.previousSibling)){if(m.nodeName==o){return false;}}var c=n;while((c=c.nextSibling)){if(c.nodeName==o){return false;
+}}return true;},enabled:function(c){return !c.disabled;},disabled:function(c){return c.disabled;},checked:function(c){return c.checked||c.selected;},focus:function(c){return this.isHTMLDocument&&this.document.activeElement===c&&(c.href||c.type||this.hasAttribute(c,"tabindex"));
+},root:function(c){return(c===this.root);},selected:function(c){return c.selected;}};for(var a in k){j["pseudo:"+a]=k[a];}j.attributeGetters={"class":function(){return this.getAttribute("class")||this.className;
+},"for":function(){return("htmlFor" in this)?this.htmlFor:this.getAttribute("for");},href:function(){return("href" in this)?this.getAttribute("href",2):this.getAttribute("href");
+},style:function(){return(this.style)?this.style.cssText:this.getAttribute("style");},tabindex:function(){var c=this.getAttributeNode("tabindex");return(c&&c.specified)?c.nodeValue:null;
+},type:function(){return this.getAttribute("type");}};var d=j.Slick=(this.Slick||{});d.version="1.1.5";d.search=function(m,n,c){return j.search(m,n,c);
+};d.find=function(c,m){return j.search(c,m,null,true);};d.contains=function(c,m){j.setDocument(c);return j.contains(c,m);};d.getAttribute=function(m,c){return j.getAttribute(m,c);
+};d.match=function(m,c){if(!(m&&c)){return false;}if(!c||c===m){return true;}j.setDocument(m);return j.matchNode(m,c);};d.defineAttributeGetter=function(c,m){j.attributeGetters[c]=m;
+return this;};d.lookupAttributeGetter=function(c){return j.attributeGetters[c];};d.definePseudo=function(c,m){j["pseudo:"+c]=function(o,n){return m.call(o,n);
+};return this;};d.lookupPseudo=function(c){var m=j["pseudo:"+c];if(m){return function(n){return m.call(this,n);};}return null;};d.override=function(m,c){j.override(m,c);
+return this;};d.isXML=j.isXML;d.uidOf=function(c){return j.getUIDHTML(c);};if(!this.Slick){this.Slick=d;}}).apply((typeof exports!="undefined")?exports:this);
+var Element=function(b,g){var h=Element.Constructors[b];if(h){return h(g);}if(typeof b!="string"){return document.id(b).set(g);}if(!g){g={};}if(!(/^[\w-]+$/).test(b)){var e=Slick.parse(b).expressions[0][0];
+b=(e.tag=="*")?"div":e.tag;if(e.id&&g.id==null){g.id=e.id;}var d=e.attributes;if(d){for(var f=0,c=d.length;f<c;f++){var a=d[f];if(g[a.key]!=null){continue;
+}if(a.value!=null&&a.operator=="="){g[a.key]=a.value;}else{if(!a.value&&!a.operator){g[a.key]=true;}}}}if(e.classList&&g["class"]==null){g["class"]=e.classList.join(" ");
+}}return document.newElement(b,g);};if(Browser.Element){Element.prototype=Browser.Element.prototype;}new Type("Element",Element).mirror(function(a){if(Array.prototype[a]){return;
+}var b={};b[a]=function(){var h=[],e=arguments,j=true;for(var g=0,d=this.length;g<d;g++){var f=this[g],c=h[g]=f[a].apply(f,e);j=(j&&typeOf(c)=="element");
+}return(j)?new Elements(h):h;};Elements.implement(b);});if(!Browser.Element){Element.parent=Object;Element.Prototype={"$family":Function.from("element").hide()};
+Element.mirror(function(a,b){Element.Prototype[a]=b;});}Element.Constructors={};Element.Constructors=new Hash;var IFrame=new Type("IFrame",function(){var e=Array.link(arguments,{properties:Type.isObject,iframe:function(f){return(f!=null);
+}});var c=e.properties||{},b;if(e.iframe){b=document.id(e.iframe);}var d=c.onload||function(){};delete c.onload;c.id=c.name=[c.id,c.name,b?(b.id||b.name):"IFrame_"+String.uniqueID()].pick();
+b=new Element(b||"iframe",c);var a=function(){d.call(b.contentWindow);};if(window.frames[c.id]){a();}else{b.addListener("load",a);}return b;});var Elements=this.Elements=function(a){if(a&&a.length){var e={},d;
+for(var c=0;d=a[c++];){var b=Slick.uidOf(d);if(!e[b]){e[b]=true;this.push(d);}}}};Elements.prototype={length:0};Elements.parent=Array;new Type("Elements",Elements).implement({filter:function(a,b){if(!a){return this;
+}return new Elements(Array.filter(this,(typeOf(a)=="string")?function(c){return c.match(a);}:a,b));}.protect(),push:function(){var d=this.length;for(var b=0,a=arguments.length;
+b<a;b++){var c=document.id(arguments[b]);if(c){this[d++]=c;}}return(this.length=d);}.protect(),unshift:function(){var b=[];for(var c=0,a=arguments.length;
+c<a;c++){var d=document.id(arguments[c]);if(d){b.push(d);}}return Array.prototype.unshift.apply(this,b);}.protect(),concat:function(){var b=new Elements(this);
+for(var c=0,a=arguments.length;c<a;c++){var d=arguments[c];if(Type.isEnumerable(d)){b.append(d);}else{b.push(d);}}return b;}.protect(),append:function(c){for(var b=0,a=c.length;
+b<a;b++){this.push(c[b]);}return this;}.protect(),empty:function(){while(this.length){delete this[--this.length];}return this;}.protect()});Elements.alias("extend","append");
+(function(){var g=Array.prototype.splice,b={"0":0,"1":1,length:2};g.call(b,1,1);if(b[1]==1){Elements.implement("splice",function(){var e=this.length;g.apply(this,arguments);
+while(e>=this.length){delete this[e--];}return this;}.protect());}Elements.implement(Array.prototype);Array.mirror(Elements);var f;try{var a=document.createElement("<input name=x>");
+f=(a.name=="x");}catch(c){}var d=function(e){return(""+e).replace(/&/g,"&amp;").replace(/"/g,"&quot;");};Document.implement({newElement:function(e,h){if(h&&h.checked!=null){h.defaultChecked=h.checked;
+}if(f&&h){e="<"+e;if(h.name){e+=' name="'+d(h.name)+'"';}if(h.type){e+=' type="'+d(h.type)+'"';}e+=">";delete h.name;delete h.type;}return this.id(this.createElement(e)).set(h);
+}});})();Document.implement({newTextNode:function(a){return this.createTextNode(a);},getDocument:function(){return this;},getWindow:function(){return this.window;
+},id:(function(){var a={string:function(d,c,b){d=Slick.find(b,"#"+d.replace(/(\W)/g,"\\$1"));return(d)?a.element(d,c):null;},element:function(b,c){$uid(b);
+if(!c&&!b.$family&&!(/^(?:object|embed)$/i).test(b.tagName)){Object.append(b,Element.Prototype);}return b;},object:function(c,d,b){if(c.toElement){return a.element(c.toElement(b),d);
+}return null;}};a.textnode=a.whitespace=a.window=a.document=function(b){return b;};return function(c,e,d){if(c&&c.$family&&c.uid){return c;}var b=typeOf(c);
+return(a[b])?a[b](c,e,d||document):null;};})()});if(window.$==null){Window.implement("$",function(a,b){return document.id(a,b,this.document);});}Window.implement({getDocument:function(){return this.document;
+},getWindow:function(){return this;}});[Document,Element].invoke("implement",{getElements:function(a){return Slick.search(this,a,new Elements);},getElement:function(a){return document.id(Slick.find(this,a));
+}});(function(b,d,a){this.Selectors={};var e=this.Selectors.Pseudo=new Hash();var c=function(){for(var f in e){if(e.hasOwnProperty(f)){Slick.definePseudo(f,e[f]);
+delete e[f];}}};Slick.search=function(g,h,f){c();return b.call(this,g,h,f);};Slick.find=function(f,g){c();return d.call(this,f,g);};Slick.match=function(g,f){c();
+return a.call(this,g,f);};})(Slick.search,Slick.find,Slick.match);if(window.$$==null){Window.implement("$$",function(a){var f=new Elements;if(arguments.length==1&&typeof a=="string"){return Slick.search(this.document,a,f);
+}var c=Array.flatten(arguments);for(var d=0,b=c.length;d<b;d++){var e=c[d];switch(typeOf(e)){case"element":f.push(e);break;case"string":Slick.search(this.document,e,f);
+}}return f;});}if(window.$$==null){Window.implement("$$",function(a){if(arguments.length==1){if(typeof a=="string"){return Slick.search(this.document,a,new Elements);
+}else{if(Type.isEnumerable(a)){return new Elements(a);}}}return new Elements(arguments);});}(function(){var k={},i={};var n={input:"checked",option:"selected",textarea:"value"};
+var e=function(p){return(i[p]||(i[p]={}));};var j=function(q){var p=q.uid;if(q.removeEvents){q.removeEvents();}if(q.clearAttributes){q.clearAttributes();
+}if(p!=null){delete k[p];delete i[p];}return q;};var o=["defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"];
+var d=["compact","nowrap","ismap","declare","noshade","checked","disabled","readOnly","multiple","selected","noresize","defer","defaultChecked"];var g={html:"innerHTML","class":"className","for":"htmlFor",text:(function(){var p=document.createElement("div");
+return(p.textContent==null)?"innerText":"textContent";})()};var m=["type"];var h=["value","defaultValue"];var l=/^(?:href|src|usemap)$/i;d=d.associate(d);
+o=o.associate(o.map(String.toLowerCase));m=m.associate(m);Object.append(g,h.associate(h));var c={before:function(q,p){var r=p.parentNode;if(r){r.insertBefore(q,p);
+}},after:function(q,p){var r=p.parentNode;if(r){r.insertBefore(q,p.nextSibling);}},bottom:function(q,p){p.appendChild(q);},top:function(q,p){p.insertBefore(q,p.firstChild);
+}};c.inside=c.bottom;Object.each(c,function(q,r){r=r.capitalize();var p={};p["inject"+r]=function(s){q(this,document.id(s,true));return this;};p["grab"+r]=function(s){q(document.id(s,true),this);
+return this;};Element.implement(p);});var b=function(s,r){if(!s){return r;}s=Object.clone(Slick.parse(s));var q=s.expressions;for(var p=q.length;p--;){q[p][0].combinator=r;
+}return s;};Element.implement({set:function(r,q){var p=Element.Properties[r];(p&&p.set)?p.set.call(this,q):this.setProperty(r,q);}.overloadSetter(),get:function(q){var p=Element.Properties[q];
+return(p&&p.get)?p.get.apply(this):this.getProperty(q);}.overloadGetter(),erase:function(q){var p=Element.Properties[q];(p&&p.erase)?p.erase.apply(this):this.removeProperty(q);
+return this;},setProperty:function(q,r){q=o[q]||q;if(r==null){return this.removeProperty(q);}var p=g[q];(p)?this[p]=r:(d[q])?this[q]=!!r:this.setAttribute(q,""+r);
+return this;},setProperties:function(p){for(var q in p){this.setProperty(q,p[q]);}return this;},getProperty:function(q){q=o[q]||q;var p=g[q]||m[q];return(p)?this[p]:(d[q])?!!this[q]:(l.test(q)?this.getAttribute(q,2):(p=this.getAttributeNode(q))?p.nodeValue:null)||null;
+},getProperties:function(){var p=Array.from(arguments);return p.map(this.getProperty,this).associate(p);},removeProperty:function(q){q=o[q]||q;var p=g[q];
+(p)?this[p]="":(d[q])?this[q]=false:this.removeAttribute(q);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this;
+},hasClass:function(p){return this.className.clean().contains(p," ");},addClass:function(p){if(!this.hasClass(p)){this.className=(this.className+" "+p).clean();
+}return this;},removeClass:function(p){this.className=this.className.replace(new RegExp("(^|\\s)"+p+"(?:\\s|$)"),"$1");return this;},toggleClass:function(p,q){if(q==null){q=!this.hasClass(p);
+}return(q)?this.addClass(p):this.removeClass(p);},adopt:function(){var s=this,p,u=Array.flatten(arguments),t=u.length;if(t>1){s=p=document.createDocumentFragment();
+}for(var r=0;r<t;r++){var q=document.id(u[r],true);if(q){s.appendChild(q);}}if(p){this.appendChild(p);}return this;},appendText:function(q,p){return this.grab(this.getDocument().newTextNode(q),p);
+},grab:function(q,p){c[p||"bottom"](document.id(q,true),this);return this;},inject:function(q,p){c[p||"bottom"](this,document.id(q,true));return this;},replaces:function(p){p=document.id(p,true);
+p.parentNode.replaceChild(this,p);return this;},wraps:function(q,p){q=document.id(q,true);return this.replaces(q).grab(q,p);},getPrevious:function(p){return document.id(Slick.find(this,b(p,"!~")));
+},getAllPrevious:function(p){return Slick.search(this,b(p,"!~"),new Elements);},getNext:function(p){return document.id(Slick.find(this,b(p,"~")));},getAllNext:function(p){return Slick.search(this,b(p,"~"),new Elements);
+},getFirst:function(p){return document.id(Slick.search(this,b(p,">"))[0]);},getLast:function(p){return document.id(Slick.search(this,b(p,">")).getLast());
+},getParent:function(p){return document.id(Slick.find(this,b(p,"!")));},getParents:function(p){return Slick.search(this,b(p,"!"),new Elements);},getSiblings:function(p){return Slick.search(this,b(p,"~~"),new Elements);
+},getChildren:function(p){return Slick.search(this,b(p,">"),new Elements);},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument;
+},getElementById:function(p){return document.id(Slick.find(this,"#"+(""+p).replace(/(\W)/g,"\\$1")));},getSelected:function(){this.selectedIndex;return new Elements(Array.from(this.options).filter(function(p){return p.selected;
+}));},toQueryString:function(){var p=[];this.getElements("input, select, textarea").each(function(r){var q=r.type;if(!r.name||r.disabled||q=="submit"||q=="reset"||q=="file"||q=="image"){return;
+}var s=(r.get("tag")=="select")?r.getSelected().map(function(t){return document.id(t).get("value");}):((q=="radio"||q=="checkbox")&&!r.checked)?null:r.get("value");
+Array.from(s).each(function(t){if(typeof t!="undefined"){p.push(encodeURIComponent(r.name)+"="+encodeURIComponent(t));}});});return p.join("&");},destroy:function(){var p=j(this).getElementsByTagName("*");
+Array.each(p,j);Element.dispose(this);return null;},empty:function(){Array.from(this.childNodes).each(Element.dispose);return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this;
+},match:function(p){return !p||Slick.match(this,p);}});var a=function(t,s,q){if(!q){t.setAttributeNode(document.createAttribute("id"));}if(t.clearAttributes){t.clearAttributes();
+t.mergeAttributes(s);t.removeAttribute("uid");if(t.options){var u=t.options,p=s.options;for(var r=u.length;r--;){u[r].selected=p[r].selected;}}}var v=n[s.tagName.toLowerCase()];
+if(v&&s[v]){t[v]=s[v];}};Element.implement("clone",function(r,p){r=r!==false;var w=this.cloneNode(r),q;if(r){var s=w.getElementsByTagName("*"),u=this.getElementsByTagName("*");
+for(q=s.length;q--;){a(s[q],u[q],p);}}a(w,this,p);if(Browser.ie){var t=w.getElementsByTagName("object"),v=this.getElementsByTagName("object");for(q=t.length;
+q--;){t[q].outerHTML=v[q].outerHTML;}}return document.id(w);});var f={contains:function(p){return Slick.contains(this,p);}};if(!document.contains){Document.implement(f);
+}if(!document.createElement("div").contains){Element.implement(f);}Element.implement("hasChild",function(p){return this!==p&&this.contains(p);});[Element,Window,Document].invoke("implement",{addListener:function(s,r){if(s=="unload"){var p=r,q=this;
+r=function(){q.removeListener("unload",r);p();};}else{k[$uid(this)]=this;}if(this.addEventListener){this.addEventListener(s,r,!!arguments[2]);}else{this.attachEvent("on"+s,r);
+}return this;},removeListener:function(q,p){if(this.removeEventListener){this.removeEventListener(q,p,!!arguments[2]);}else{this.detachEvent("on"+q,p);
+}return this;},retrieve:function(q,p){var s=e($uid(this)),r=s[q];if(p!=null&&r==null){r=s[q]=p;}return r!=null?r:null;},store:function(q,p){var r=e($uid(this));
+r[q]=p;return this;},eliminate:function(p){var q=e($uid(this));delete q[p];return this;}});if(window.attachEvent&&!window.addEventListener){window.addListener("unload",function(){Object.each(k,j);
+if(window.CollectGarbage){CollectGarbage();}});}})();Element.Properties={};Element.Properties=new Hash;Element.Properties.style={set:function(a){this.style.cssText=a;
+},get:function(){return this.style.cssText;},erase:function(){this.style.cssText="";}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase();
+}};(function(a){if(a!=null){Element.Properties.maxlength=Element.Properties.maxLength={get:function(){var b=this.getAttribute("maxLength");return b==a?null:b;
+}};}})(document.createElement("input").getAttribute("maxLength"));Element.Properties.html=(function(){var c=Function.attempt(function(){var e=document.createElement("table");
+e.innerHTML="<tr><td></td></tr>";});var d=document.createElement("div");var a={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]};
+a.thead=a.tfoot=a.tbody;var b={set:function(){var f=Array.flatten(arguments).join("");var g=(!c&&a[this.get("tag")]);if(g){var h=d;h.innerHTML=g[1]+f+g[2];
+for(var e=g[0];e--;){h=h.firstChild;}this.empty().adopt(h.childNodes);}else{this.innerHTML=f;}}};b.erase=b.set;return b;})();(function(){var c=document.html;
+Element.Properties.styles={set:function(f){this.setStyles(f);}};var e=(c.style.opacity!=null);var d=/alpha\(opacity=([\d.]+)\)/i;var b=function(g,f){if(!g.currentStyle||!g.currentStyle.hasLayout){g.style.zoom=1;
+}if(e){g.style.opacity=f;}else{f=(f*100).limit(0,100).round();f=(f==100)?"":"alpha(opacity="+f+")";var h=g.style.filter||g.getComputedStyle("filter")||"";
+g.style.filter=d.test(h)?h.replace(d,f):h+f;}};Element.Properties.opacity={set:function(g){var f=this.style.visibility;if(g==0&&f!="hidden"){this.style.visibility="hidden";
+}else{if(g!=0&&f!="visible"){this.style.visibility="visible";}}b(this,g);},get:(e)?function(){var f=this.style.opacity||this.getComputedStyle("opacity");
+return(f=="")?1:f;}:function(){var f,g=(this.style.filter||this.getComputedStyle("filter"));if(g){f=g.match(d);}return(f==null||g==null)?1:(f[1]/100);}};
+var a=(c.style.cssFloat==null)?"styleFloat":"cssFloat";Element.implement({getComputedStyle:function(h){if(this.currentStyle){return this.currentStyle[h.camelCase()];
+}var g=Element.getDocument(this).defaultView,f=g?g.getComputedStyle(this,null):null;return(f)?f.getPropertyValue((h==a)?"float":h.hyphenate()):null;},setOpacity:function(f){b(this,f);
+return this;},getOpacity:function(){return this.get("opacity");},setStyle:function(g,f){switch(g){case"opacity":return this.set("opacity",parseFloat(f));
+case"float":g=a;}g=g.camelCase();if(typeOf(f)!="string"){var h=(Element.Styles[g]||"@").split(" ");f=Array.from(f).map(function(k,j){if(!h[j]){return"";
+}return(typeOf(k)=="number")?h[j].replace("@",Math.round(k)):k;}).join(" ");}else{if(f==String(Number(f))){f=Math.round(f);}}this.style[g]=f;return this;
+},getStyle:function(l){switch(l){case"opacity":return this.get("opacity");case"float":l=a;}l=l.camelCase();var f=this.style[l];if(!f||l=="zIndex"){f=[];
+for(var k in Element.ShortStyles){if(l!=k){continue;}for(var j in Element.ShortStyles[k]){f.push(this.getStyle(j));}return f.join(" ");}f=this.getComputedStyle(l);
+}if(f){f=String(f);var h=f.match(/rgba?\([\d\s,]+\)/);if(h){f=f.replace(h[0],h[0].rgbToHex());}}if(Browser.opera||(Browser.ie&&isNaN(parseFloat(f)))){if((/^(height|width)$/).test(l)){var g=(l=="width")?["left","right"]:["top","bottom"],i=0;
+g.each(function(m){i+=this.getStyle("border-"+m+"-width").toInt()+this.getStyle("padding-"+m).toInt();},this);return this["offset"+l.capitalize()]-i+"px";
+}if(Browser.opera&&String(f).indexOf("px")!=-1){return f;}if((/^border(.+)Width|margin|padding/).test(l)){return"0px";}}return f;},setStyles:function(g){for(var f in g){this.setStyle(f,g[f]);
+}return this;},getStyles:function(){var f={};Array.flatten(arguments).each(function(g){f[g]=this.getStyle(g);},this);return f;}});Element.Styles={left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"};
+Element.Styles=new Hash(Element.Styles);Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(l){var k=Element.ShortStyles;
+var g=Element.Styles;["margin","padding"].each(function(m){var n=m+l;k[m][n]=g[n]="@px";});var j="border"+l;k.border[j]=g[j]="@px @ rgb(@, @, @)";var i=j+"Width",f=j+"Style",h=j+"Color";
+k[j]={};k.borderWidth[i]=k[j][i]=g[i]="@px";k.borderStyle[f]=k[j][f]=g[f]="@";k.borderColor[h]=k[j][h]=g[h]="rgb(@, @, @)";});})();(function(){Element.Properties.events={set:function(b){this.addEvents(b);
+}};[Element,Window,Document].invoke("implement",{addEvent:function(f,h){var i=this.retrieve("events",{});if(!i[f]){i[f]={keys:[],values:[]};}if(i[f].keys.contains(h)){return this;
+}i[f].keys.push(h);var g=f,b=Element.Events[f],d=h,j=this;if(b){if(b.onAdd){b.onAdd.call(this,h);}if(b.condition){d=function(k){if(b.condition.call(this,k)){return h.call(this,k);
+}return true;};}g=b.base||g;}var e=function(){return h.call(j);};var c=Element.NativeEvents[g];if(c){if(c==2){e=function(k){k=new Event(k,j.getWindow());
+if(d.call(j,k)===false){k.stop();}};}this.addListener(g,e,arguments[2]);}i[f].values.push(e);return this;},removeEvent:function(e,d){var c=this.retrieve("events");
+if(!c||!c[e]){return this;}var h=c[e];var b=h.keys.indexOf(d);if(b==-1){return this;}var g=h.values[b];delete h.keys[b];delete h.values[b];var f=Element.Events[e];
+if(f){if(f.onRemove){f.onRemove.call(this,d);}e=f.base||e;}return(Element.NativeEvents[e])?this.removeListener(e,g,arguments[2]):this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]);
+}return this;},removeEvents:function(b){var d;if(typeOf(b)=="object"){for(d in b){this.removeEvent(d,b[d]);}return this;}var c=this.retrieve("events");
+if(!c){return this;}if(!b){for(d in c){this.removeEvents(d);}this.eliminate("events");}else{if(c[b]){c[b].keys.each(function(e){this.removeEvent(b,e);},this);
+delete c[b];}}return this;},fireEvent:function(e,c,b){var d=this.retrieve("events");if(!d||!d[e]){return this;}c=Array.from(c);d[e].keys.each(function(f){if(b){f.delay(b,this,c);
+}else{f.apply(this,c);}},this);return this;},cloneEvents:function(e,d){e=document.id(e);var c=e.retrieve("events");if(!c){return this;}if(!d){for(var b in c){this.cloneEvents(e,b);
+}}else{if(c[d]){c[d].keys.each(function(f){this.addEvent(d,f);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,orientationchange:2,touchstart:2,touchmove:2,touchend:2,touchcancel:2,gesturestart:2,gesturechange:2,gestureend:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:2,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};
+var a=function(b){var c=b.relatedTarget;if(c==null){return true;}if(!c){return false;}return(c!=this&&c.prefix!="xul"&&typeOf(this)!="document"&&!this.contains(c));
+};Element.Events={mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.firefox)?"DOMMouseScroll":"mousewheel"}};
+Element.Events=new Hash(Element.Events);})();(function(){var h=document.createElement("div"),e=document.createElement("div");h.style.height="0";h.appendChild(e);
+var d=(e.offsetParent===h);h=e=null;var l=function(m){return k(m,"position")!="static"||a(m);};var i=function(m){return l(m)||(/^(?:table|td|th)$/i).test(m.tagName);
+};Element.implement({scrollTo:function(m,n){if(a(this)){this.getWindow().scrollTo(m,n);}else{this.scrollLeft=m;this.scrollTop=n;}return this;},getSize:function(){if(a(this)){return this.getWindow().getSize();
+}return{x:this.offsetWidth,y:this.offsetHeight};},getScrollSize:function(){if(a(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};
+},getScroll:function(){if(a(this)){return this.getWindow().getScroll();}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var n=this.parentNode,m={x:0,y:0};
+while(n&&!a(n)){m.x+=n.scrollLeft;m.y+=n.scrollTop;n=n.parentNode;}return m;},getOffsetParent:d?function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null;
+}var n=(k(m,"position")=="static")?i:l;while((m=m.parentNode)){if(n(m)){return m;}}return null;}:function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null;
+}try{return m.offsetParent;}catch(n){}return null;},getOffsets:function(){if(this.getBoundingClientRect&&!Browser.Platform.ios){var r=this.getBoundingClientRect(),o=document.id(this.getDocument().documentElement),q=o.getScroll(),t=this.getScrolls(),s=(k(this,"position")=="fixed");
+return{x:r.left.toInt()+t.x+((s)?0:q.x)-o.clientLeft,y:r.top.toInt()+t.y+((s)?0:q.y)-o.clientTop};}var n=this,m={x:0,y:0};if(a(this)){return m;}while(n&&!a(n)){m.x+=n.offsetLeft;
+m.y+=n.offsetTop;if(Browser.firefox){if(!c(n)){m.x+=b(n);m.y+=g(n);}var p=n.parentNode;if(p&&k(p,"overflow")!="visible"){m.x+=b(p);m.y+=g(p);}}else{if(n!=this&&Browser.safari){m.x+=b(n);
+m.y+=g(n);}}n=n.offsetParent;}if(Browser.firefox&&!c(this)){m.x-=b(this);m.y-=g(this);}return m;},getPosition:function(p){if(a(this)){return{x:0,y:0};}var q=this.getOffsets(),n=this.getScrolls();
+var m={x:q.x-n.x,y:q.y-n.y};if(p&&(p=document.id(p))){var o=p.getPosition();return{x:m.x-o.x-b(p),y:m.y-o.y-g(p)};}return m;},getCoordinates:function(o){if(a(this)){return this.getWindow().getCoordinates();
+}var m=this.getPosition(o),n=this.getSize();var p={left:m.x,top:m.y,width:n.x,height:n.y};p.right=p.left+p.width;p.bottom=p.top+p.height;return p;},computePosition:function(m){return{left:m.x-j(this,"margin-left"),top:m.y-j(this,"margin-top")};
+},setPosition:function(m){return this.setStyles(this.computePosition(m));}});[Document,Window].invoke("implement",{getSize:function(){var m=f(this);return{x:m.clientWidth,y:m.clientHeight};
+},getScroll:function(){var n=this.getWindow(),m=f(this);return{x:n.pageXOffset||m.scrollLeft,y:n.pageYOffset||m.scrollTop};},getScrollSize:function(){var o=f(this),n=this.getSize(),m=this.getDocument().body;
+return{x:Math.max(o.scrollWidth,m.scrollWidth,n.x),y:Math.max(o.scrollHeight,m.scrollHeight,n.y)};},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var m=this.getSize();
+return{top:0,left:0,bottom:m.y,right:m.x,height:m.y,width:m.x};}});var k=Element.getComputedStyle;function j(m,n){return k(m,n).toInt()||0;}function c(m){return k(m,"-moz-box-sizing")=="border-box";
+}function g(m){return j(m,"border-top-width");}function b(m){return j(m,"border-left-width");}function a(m){return(/^(?:body|html)$/i).test(m.tagName);
+}function f(m){var n=m.getDocument();return(!n.compatMode||n.compatMode=="CSS1Compat")?n.html:n.body;}})();Element.alias({position:"setPosition"});[Window,Document,Element].invoke("implement",{getHeight:function(){return this.getSize().y;
+},getWidth:function(){return this.getSize().x;},getScrollTop:function(){return this.getScroll().y;},getScrollLeft:function(){return this.getScroll().x;
+},getScrollHeight:function(){return this.getScrollSize().y;},getScrollWidth:function(){return this.getScrollSize().x;},getTop:function(){return this.getPosition().y;
+},getLeft:function(){return this.getPosition().x;}});(function(){var f=this.Fx=new Class({Implements:[Chain,Events,Options],options:{fps:60,unit:false,duration:500,frames:null,frameSkip:true,link:"ignore"},initialize:function(g){this.subject=this.subject||this;
+this.setOptions(g);},getTransition:function(){return function(g){return -(Math.cos(Math.PI*g)-1)/2;};},step:function(g){if(this.options.frameSkip){var h=(this.time!=null)?(g-this.time):0,i=h/this.frameInterval;
+this.time=g;this.frame+=i;}else{this.frame++;}if(this.frame<this.frames){var j=this.transition(this.frame/this.frames);this.set(this.compute(this.from,this.to,j));
+}else{this.frame=this.frames;this.set(this.compute(this.from,this.to,1));this.stop();}},set:function(g){return g;},compute:function(i,h,g){return f.compute(i,h,g);
+},check:function(){if(!this.isRunning()){return true;}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.pass(arguments,this));
+return false;}return false;},start:function(k,j){if(!this.check(k,j)){return this;}this.from=k;this.to=j;this.frame=(this.options.frameSkip)?0:-1;this.time=null;
+this.transition=this.getTransition();var i=this.options.frames,h=this.options.fps,g=this.options.duration;this.duration=f.Durations[g]||g.toInt();this.frameInterval=1000/h;
+this.frames=i||Math.round(this.duration/this.frameInterval);this.fireEvent("start",this.subject);b.call(this,h);return this;},stop:function(){if(this.isRunning()){this.time=null;
+d.call(this,this.options.fps);if(this.frames==this.frame){this.fireEvent("complete",this.subject);if(!this.callChain()){this.fireEvent("chainComplete",this.subject);
+}}else{this.fireEvent("stop",this.subject);}}return this;},cancel:function(){if(this.isRunning()){this.time=null;d.call(this,this.options.fps);this.frame=this.frames;
+this.fireEvent("cancel",this.subject).clearChain();}return this;},pause:function(){if(this.isRunning()){this.time=null;d.call(this,this.options.fps);}return this;
+},resume:function(){if((this.frame<this.frames)&&!this.isRunning()){b.call(this,this.options.fps);}return this;},isRunning:function(){var g=e[this.options.fps];
+return g&&g.contains(this);}});f.compute=function(i,h,g){return(h-i)*g+i;};f.Durations={"short":250,normal:500,"long":1000};var e={},c={};var a=function(){var h=Date.now();
+for(var j=this.length;j--;){var g=this[j];if(g){g.step(h);}}};var b=function(h){var g=e[h]||(e[h]=[]);g.push(this);if(!c[h]){c[h]=a.periodical(Math.round(1000/h),g);
+}};var d=function(h){var g=e[h];if(g){g.erase(this);if(!g.length&&c[h]){delete e[h];c[h]=clearInterval(c[h]);}}};})();Fx.CSS=new Class({Extends:Fx,prepare:function(c,d,b){b=Array.from(b);
+if(b[1]==null){b[1]=b[0];b[0]=c.getStyle(d);}var a=b.map(this.parse);return{from:a[0],to:a[1]};},parse:function(a){a=Function.from(a)();a=(typeof a=="string")?a.split(" "):Array.from(a);
+return a.map(function(c){c=String(c);var b=false;Object.each(Fx.CSS.Parsers,function(f,e){if(b){return;}var d=f.parse(c);if(d||d===0){b={value:d,parser:f};
+}});b=b||{value:c,parser:Fx.CSS.Parsers.String};return b;});},compute:function(d,c,b){var a=[];(Math.min(d.length,c.length)).times(function(e){a.push({value:d[e].parser.compute(d[e].value,c[e].value,b),parser:d[e].parser});
+});a.$family=Function.from("fx:css:value");return a;},serve:function(c,b){if(typeOf(c)!="fx:css:value"){c=this.parse(c);}var a=[];c.each(function(d){a=a.concat(d.parser.serve(d.value,b));
+});return a;},render:function(a,d,c,b){a.setStyle(d,this.serve(c,b));},search:function(a){if(Fx.CSS.Cache[a]){return Fx.CSS.Cache[a];}var c={},b=new RegExp("^"+a.escapeRegExp()+"$");
+Array.each(document.styleSheets,function(f,e){var d=f.href;if(d&&d.contains("://")&&!d.contains(document.domain)){return;}var g=f.rules||f.cssRules;Array.each(g,function(k,h){if(!k.style){return;
+}var j=(k.selectorText)?k.selectorText.replace(/^\w+/,function(i){return i.toLowerCase();}):null;if(!j||!b.test(j)){return;}Object.each(Element.Styles,function(l,i){if(!k.style[i]||Element.ShortStyles[i]){return;
+}l=String(k.style[i]);c[i]=((/^rgb/).test(l))?l.rgbToHex():l;});});});return Fx.CSS.Cache[a]=c;}});Fx.CSS.Cache={};Fx.CSS.Parsers={Color:{parse:function(a){if(a.match(/^#[0-9a-f]{3,6}$/i)){return a.hexToRgb(true);
+}return((a=a.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[a[1],a[2],a[3]]:false;},compute:function(c,b,a){return c.map(function(e,d){return Math.round(Fx.compute(c[d],b[d],a));
+});},serve:function(a){return a.map(Number);}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(b,a){return(a)?b+a:b;}},String:{parse:Function.from(false),compute:function(b,a){return a;
+},serve:function(a){return a;}}};Fx.CSS.Parsers=new Hash(Fx.CSS.Parsers);Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);
+this.parent(a);},set:function(b,a){if(arguments.length==1){a=b;b=this.property||this.options.property;}this.render(this.element,b,a,this.options.unit);
+return this;},start:function(c,e,d){if(!this.check(c,e,d)){return this;}var b=Array.flatten(arguments);this.property=this.options.property||b.shift();var a=this.prepare(this.element,this.property,b);
+return this.parent(a.from,a.to);}});Element.Properties.tween={set:function(a){this.get("tween").cancel().setOptions(a);return this;},get:function(){var a=this.retrieve("tween");
+if(!a){a=new Fx.Tween(this,{link:"cancel"});this.store("tween",a);}return a;}};Element.implement({tween:function(a,c,b){this.get("tween").start(arguments);
+return this;},fade:function(c){var e=this.get("tween"),d="opacity",a;c=[c,"toggle"].pick();switch(c){case"in":e.start(d,1);break;case"out":e.start(d,0);
+break;case"show":e.set(d,1);break;case"hide":e.set(d,0);break;case"toggle":var b=this.retrieve("fade:flag",this.get("opacity")==1);e.start(d,(b)?0:1);this.store("fade:flag",!b);
+a=true;break;default:e.start(d,arguments);}if(!a){this.eliminate("fade:flag");}return this;},highlight:function(c,a){if(!a){a=this.retrieve("highlight:original",this.getStyle("background-color"));
+a=(a=="transparent")?"#fff":a;}var b=this.get("tween");b.start("background-color",c||"#ffff88",a).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original"));
+b.callChain();}.bind(this));return this;}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a);
+},set:function(a){if(typeof a=="string"){a=this.search(a);}for(var b in a){this.render(this.element,b,a[b],this.options.unit);}return this;},compute:function(e,d,c){var a={};
+for(var b in e){a[b]=this.parent(e[b],d[b],c);}return a;},start:function(b){if(!this.check(b)){return this;}if(typeof b=="string"){b=this.search(b);}var e={},d={};
+for(var c in b){var a=this.prepare(this.element,c,b[c]);e[c]=a.from;d[c]=a.to;}return this.parent(e,d);}});Element.Properties.morph={set:function(a){this.get("morph").cancel().setOptions(a);
+return this;},get:function(){var a=this.retrieve("morph");if(!a){a=new Fx.Morph(this,{link:"cancel"});this.store("morph",a);}return a;}};Element.implement({morph:function(a){this.get("morph").start(a);
+return this;}});Fx.implement({getTransition:function(){var a=this.options.transition||Fx.Transitions.Sine.easeInOut;if(typeof a=="string"){var b=a.split(":");
+a=Fx.Transitions;a=a[b[0]]||a[b[0].capitalize()];if(b[1]){a=a["ease"+b[1].capitalize()+(b[2]?b[2].capitalize():"")];}}return a;}});Fx.Transition=function(c,b){b=Array.from(b);
+var a=function(d){return c(d,b);};return Object.append(a,{easeIn:a,easeOut:function(d){return 1-c(1-d,b);},easeInOut:function(d){return(d<=0.5?c(2*d,b):(2-c(2*(1-d),b)))/2;
+}});};Fx.Transitions={linear:function(a){return a;}};Fx.Transitions=new Hash(Fx.Transitions);Fx.Transitions.extend=function(a){for(var b in a){Fx.Transitions[b]=new Fx.Transition(a[b]);
+}};Fx.Transitions.extend({Pow:function(b,a){return Math.pow(b,a&&a[0]||6);},Expo:function(a){return Math.pow(2,8*(a-1));},Circ:function(a){return 1-Math.sin(Math.acos(a));
+},Sine:function(a){return 1-Math.cos(a*Math.PI/2);},Back:function(b,a){a=a&&a[0]||1.618;return Math.pow(b,2)*((a+1)*b-a);},Bounce:function(f){var e;for(var d=0,c=1;
+1;d+=c,c/=2){if(f>=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2);break;}}return e;},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a&&a[0]||1)/3);
+}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,a+2);});});(function(){var d=function(){},a=("onprogress" in new Browser.Request);
+var c=this.Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,timeout:0,noCache:false},initialize:function(e){this.xhr=new Browser.Request();
+this.setOptions(e);this.headers=this.options.headers;},onStateChange:function(){var e=this.xhr;if(e.readyState!=4||!this.running){return;}this.running=false;
+this.status=0;Function.attempt(function(){var f=e.status;this.status=(f==1223)?204:f;}.bind(this));e.onreadystatechange=d;if(a){e.onprogress=e.onloadstart=d;
+}clearTimeout(this.timer);this.response={text:this.xhr.responseText||"",xml:this.xhr.responseXML};if(this.options.isSuccess.call(this,this.status)){this.success(this.response.text,this.response.xml);
+}else{this.failure();}},isSuccess:function(){var e=this.status;return(e>=200&&e<300);},isRunning:function(){return !!this.running;},processScripts:function(e){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return Browser.exec(e);
+}return e.stripScripts(this.options.evalScripts);},success:function(f,e){this.onSuccess(this.processScripts(f),e);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain();
+},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},loadstart:function(e){this.fireEvent("loadstart",[e,this.xhr]);
+},progress:function(e){this.fireEvent("progress",[e,this.xhr]);},timeout:function(){this.fireEvent("timeout",this.xhr);},setHeader:function(e,f){this.headers[e]=f;
+return this;},getHeader:function(e){return Function.attempt(function(){return this.xhr.getResponseHeader(e);}.bind(this));},check:function(){if(!this.running){return true;
+}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.pass(arguments,this));return false;}return false;},send:function(o){if(!this.check(o)){return this;
+}this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.running=true;var l=typeOf(o);if(l=="string"||l=="element"){o={data:o};}var h=this.options;
+o=Object.append({data:h.data,url:h.url,method:h.method},o);var j=o.data,f=String(o.url),e=o.method.toLowerCase();switch(typeOf(j)){case"element":j=document.id(j).toQueryString();
+break;case"object":case"hash":j=Object.toQueryString(j);}if(this.options.format){var m="format="+this.options.format;j=(j)?m+"&"+j:m;}if(this.options.emulation&&!["get","post"].contains(e)){var k="_method="+e;
+j=(j)?k+"&"+j:k;e="post";}if(this.options.urlEncoded&&["post","put"].contains(e)){var g=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers["Content-type"]="application/x-www-form-urlencoded"+g;
+}if(!f){f=document.location.pathname;}var i=f.lastIndexOf("/");if(i>-1&&(i=f.indexOf("#"))>-1){f=f.substr(0,i);}if(this.options.noCache){f+=(f.contains("?")?"&":"?")+String.uniqueID();
+}if(j&&e=="get"){f+=(f.contains("?")?"&":"?")+j;j=null;}var n=this.xhr;if(a){n.onloadstart=this.loadstart.bind(this);n.onprogress=this.progress.bind(this);
+}n.open(e.toUpperCase(),f,this.options.async,this.options.user,this.options.password);if(this.options.user&&"withCredentials" in n){n.withCredentials=true;
+}n.onreadystatechange=this.onStateChange.bind(this);Object.each(this.headers,function(q,p){try{n.setRequestHeader(p,q);}catch(r){this.fireEvent("exception",[p,q]);
+}},this);this.fireEvent("request");n.send(j);if(!this.options.async){this.onStateChange();}if(this.options.timeout){this.timer=this.timeout.delay(this.options.timeout,this);
+}return this;},cancel:function(){if(!this.running){return this;}this.running=false;var e=this.xhr;e.abort();clearTimeout(this.timer);e.onreadystatechange=d;
+if(a){e.onprogress=e.onloadstart=d;}this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});var b={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(e){b[e]=function(g){var f={method:e};
+if(g!=null){f.data=g;}return this.send(f);};});c.implement(b);Element.Properties.send={set:function(e){var f=this.get("send").cancel();f.setOptions(e);
+return this;},get:function(){var e=this.retrieve("send");if(!e){e=new c({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")});
+this.store("send",e);}return e;}};Element.implement({send:function(e){var f=this.get("send");f.send({data:this,url:e||f.options.url});return this;}});})();
+Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false,headers:{Accept:"text/html, application/xml, text/xml, */*"}},success:function(e){var d=this.options,b=this.response;
+b.html=e.stripScripts(function(f){b.javascript=f;});var c=b.html.match(/<body[^>]*>([\s\S]*?)<\/body>/i);if(c){b.html=c[1];}var a=new Element("div").set("html",b.html);
+b.tree=a.childNodes;b.elements=a.getElements("*");if(d.filter){b.tree=b.elements.filter(d.filter);}if(d.update){document.id(d.update).empty().set("html",b.html);
+}else{if(d.append){document.id(d.append).adopt(a.getChildren());}}if(d.evalScripts){Browser.exec(b.javascript);}this.onSuccess(b.tree,b.elements,b.html,b.javascript);
+}});Element.Properties.load={set:function(a){var b=this.get("load").cancel();b.setOptions(a);return this;},get:function(){var a=this.retrieve("load");if(!a){a=new Request.HTML({data:this,link:"cancel",update:this,method:"get"});
+this.store("load",a);}return a;}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Type.isObject,url:Type.isString}));
+return this;}});if(typeof JSON=="undefined"){this.JSON={};}JSON=new Hash({stringify:JSON.stringify,parse:JSON.parse});(function(){var special={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};
+var escape=function(chr){return special[chr]||"\\u"+("0000"+chr.charCodeAt(0).toString(16)).slice(-4);};JSON.validate=function(string){string=string.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"");
+return(/^[\],:{}\s]*$/).test(string);};JSON.encode=JSON.stringify?function(obj){return JSON.stringify(obj);}:function(obj){if(obj&&obj.toJSON){obj=obj.toJSON();
+}switch(typeOf(obj)){case"string":return'"'+obj.replace(/[\x00-\x1f\\"]/g,escape)+'"';case"array":return"["+obj.map(JSON.encode).clean()+"]";case"object":case"hash":var string=[];
+Object.each(obj,function(value,key){var json=JSON.encode(value);if(json){string.push(JSON.encode(key)+":"+json);}});return"{"+string+"}";case"number":case"boolean":return""+obj;
+case"null":return"null";}return null;};JSON.decode=function(string,secure){if(!string||typeOf(string)!="string"){return null;}if(secure||JSON.secure){if(JSON.parse){return JSON.parse(string);
+}if(!JSON.validate(string)){throw new Error("JSON could not decode the input; security is enabled and the value is not secure.");}}return eval("("+string+")");
+};})();Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a);Object.append(this.headers,{Accept:"application/json","X-Request":"JSON"});
+},success:function(c){var b;try{b=this.response.json=JSON.decode(c,this.options.secure);}catch(a){this.fireEvent("error",[c,a]);return;}if(b==null){this.onFailure();
+}else{this.onSuccess(b,c);}}});var Cookie=new Class({Implements:Options,options:{path:"/",domain:false,duration:false,secure:false,document:document,encode:true},initialize:function(b,a){this.key=b;
+this.setOptions(a);},write:function(b){if(this.options.encode){b=encodeURIComponent(b);}if(this.options.domain){b+="; domain="+this.options.domain;}if(this.options.path){b+="; path="+this.options.path;
+}if(this.options.duration){var a=new Date();a.setTime(a.getTime()+this.options.duration*24*60*60*1000);b+="; expires="+a.toGMTString();}if(this.options.secure){b+="; secure";
+}this.options.document.cookie=this.key+"="+b;return this;},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");
+return(a)?decodeURIComponent(a[1]):null;},dispose:function(){new Cookie(this.key,Object.merge({},this.options,{duration:-1})).write("");return this;}});
+Cookie.write=function(b,c,a){return new Cookie(b,a).write(c);};Cookie.read=function(a){return new Cookie(a).read();};Cookie.dispose=function(b,a){return new Cookie(b,a).dispose();
+};(function(i,k){var l,f,e=[],c,b,d=k.createElement("div");var g=function(){clearTimeout(b);if(l){return;}Browser.loaded=l=true;k.removeListener("DOMContentLoaded",g).removeListener("readystatechange",a);
+k.fireEvent("domready");i.fireEvent("domready");};var a=function(){for(var m=e.length;m--;){if(e[m]()){g();return true;}}return false;};var j=function(){clearTimeout(b);
+if(!a()){b=setTimeout(j,10);}};k.addListener("DOMContentLoaded",g);var h=function(){try{d.doScroll();return true;}catch(m){}return false;};if(d.doScroll&&!h()){e.push(h);
+c=true;}if(k.readyState){e.push(function(){var m=k.readyState;return(m=="loaded"||m=="complete");});}if("onreadystatechange" in k){k.addListener("readystatechange",a);
+}else{c=true;}if(c){j();}Element.Events.domready={onAdd:function(m){if(l){m.call(this);}}};Element.Events.load={base:"load",onAdd:function(m){if(f&&this==i){m.call(this);
+}},condition:function(){if(this==i){g();delete Element.Events.load;}return true;}};i.addEvent("load",function(){f=true;});})(window,document);(function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"window",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object;
+},initialize:function(path,options){this.instance="Swiff_"+String.uniqueID();this.setOptions(options);options=this.options;var id=this.id=options.id||this.instance;
+var container=document.id(options.container);Swiff.CallBacks[this.instance]={};var params=options.params,vars=options.vars,callBacks=options.callBacks;
+var properties=Object.append({height:options.height,width:options.width},options.properties);var self=this;for(var callBack in callBacks){Swiff.CallBacks[this.instance][callBack]=(function(option){return function(){return option.apply(self.object,arguments);
+};})(callBacks[callBack]);vars[callBack]="Swiff.CallBacks."+this.instance+"."+callBack;}params.flashVars=Object.toQueryString(vars);if(Browser.ie){properties.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
+params.movie=path;}else{properties.type="application/x-shockwave-flash";}properties.data=path;var build='<object id="'+id+'"';for(var property in properties){build+=" "+property+'="'+properties[property]+'"';
+}build+=">";for(var param in params){if(params[param]){build+='<param name="'+param+'" value="'+params[param]+'" />';}}build+="</object>";this.object=((container)?container.empty():new Element("div")).set("html",build).firstChild;
+},replaces:function(element){element=document.id(element,true);element.parentNode.replaceChild(this.toElement(),element);return this;},inject:function(element){document.id(element,true).appendChild(this.toElement());
+return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments));}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction('<invoke name="'+fn+'" returntype="javascript">'+__flash__argumentsToXML(arguments,2)+"</invoke>");
+return eval(rs);};})();
+
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is an optimized version of Dojo, built for deployment and not for
+ development. To get sources and documentation, please visit:
+
+ http://dojotoolkit.org
+*/
+
+(function(){var _1=null;if((_1||(typeof djConfig!="undefined"&&djConfig.scopeMap))&&(typeof window!="undefined")){var _2="",_3="",_4="",_5={},_6={};_1=_1||djConfig.scopeMap;for(var i=0;i<_1.length;i++){var _7=_1[i];_2+="var "+_7[0]+" = {}; "+_7[1]+" = "+_7[0]+";"+_7[1]+"._scopeName = '"+_7[1]+"';";_3+=(i==0?"":",")+_7[0];_4+=(i==0?"":",")+_7[1];_5[_7[0]]=_7[1];_6[_7[1]]=_7[0];}eval(_2+"dojo._scopeArgs = ["+_4+"];");dojo._scopePrefixArgs=_3;dojo._scopePrefix="(function("+_3+"){";dojo._scopeSuffix="})("+_4+")";dojo._scopeMap=_5;dojo._scopeMapRev=_6;}(function(){if(typeof this["loadFirebugConsole"]=="function"){this["loadFirebugConsole"]();}else{this.console=this.console||{};var cn=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"];var i=0,tn;while((tn=cn[i++])){if(!console[tn]){(function(){var _8=tn+"";console[_8]=("log" in console)?function(){var a=Array.apply({},arguments);a.unshift(_8+":");console["log"](a.join(" "));}:function(){};console[_8]._fake=true;})();}}}if(typeof dojo=="undefined"){dojo={_scopeName:"dojo",_scopePrefix:"",_scopePrefixArgs:"",_scopeSuffix:"",_scopeMap:{},_scopeMapRev:{}};}var d=dojo;if(typeof dijit=="undefined"){dijit={_scopeName:"dijit"};}if(typeof dojox=="undefined"){dojox={_scopeName:"dojox"};}if(!d._scopeArgs){d._scopeArgs=[dojo,dijit,dojox];}d.global=this;d.config={isDebug:false,debugAtAllCosts:false};var _9=typeof djConfig!="undefined"?djConfig:typeof dojoConfig!="undefined"?dojoConfig:null;if(_9){for(var c in _9){d.config[c]=_9[c];}}dojo.locale=d.config.locale;var _a="$Rev: 24595 $".match(/\d+/);dojo.version={major:1,minor:6,patch:1,flag:"",revision:_a?+_a[0]:NaN,toString:function(){with(d.version){return major+"."+minor+"."+patch+flag+" ("+revision+")";}}};if(typeof OpenAjax!="undefined"){OpenAjax.hub.registerLibrary(dojo._scopeName,"http://dojotoolkit.org",d.version.toString());}var _b,_c,_d={};for(var i in {toString:1}){_b=[];break;}dojo._extraNames=_b=_b||["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];_c=_b.length;dojo._mixin=function(_e,_f){var _10,s,i;for(_10 in _f){s=_f[_10];if(!(_10 in _e)||(_e[_10]!==s&&(!(_10 in _d)||_d[_10]!==s))){_e[_10]=s;}}if(_c&&_f){for(i=0;i<_c;++i){_10=_b[i];s=_f[_10];if(!(_10 in _e)||(_e[_10]!==s&&(!(_10 in _d)||_d[_10]!==s))){_e[_10]=s;}}}return _e;};dojo.mixin=function(obj,_11){if(!obj){obj={};}for(var i=1,l=arguments.length;i<l;i++){d._mixin(obj,arguments[i]);}return obj;};dojo._getProp=function(_12,_13,_14){var obj=_14||d.global;for(var i=0,p;obj&&(p=_12[i]);i++){if(i==0&&d._scopeMap[p]){p=d._scopeMap[p];}obj=(p in obj?obj[p]:(_13?obj[p]={}:undefined));}return obj;};dojo.setObject=function(_15,_16,_17){var _18=_15.split("."),p=_18.pop(),obj=d._getProp(_18,true,_17);return obj&&p?(obj[p]=_16):undefined;};dojo.getObject=function(_19,_1a,_1b){return d._getProp(_19.split("."),_1a,_1b);};dojo.exists=function(_1c,obj){return d.getObject(_1c,false,obj)!==undefined;};dojo["eval"]=function(_1d){return d.global.eval?d.global.eval(_1d):eval(_1d);};d.deprecated=d.experimental=function(){};})();(function(){var d=dojo,_1e;d.mixin(d,{_loadedModules:{},_inFlightCount:0,_hasResource:{},_modulePrefixes:{dojo:{name:"dojo",value:"."},doh:{name:"doh",value:"../util/doh"},tests:{name:"tests",value:"tests"}},_moduleHasPrefix:function(_1f){var mp=d._modulePrefixes;return !!(mp[_1f]&&mp[_1f].value);},_getModulePrefix:function(_20){var mp=d._modulePrefixes;if(d._moduleHasPrefix(_20)){return mp[_20].value;}return _20;},_loadedUrls:[],_postLoad:false,_loaders:[],_unloaders:[],_loadNotifying:false});dojo._loadPath=function(_21,_22,cb){var uri=((_21.charAt(0)=="/"||_21.match(/^\w+:/))?"":d.baseUrl)+_21;try{_1e=_22;return !_22?d._loadUri(uri,cb):d._loadUriAndCheck(uri,_22,cb);}catch(e){console.error(e);return false;}finally{_1e=null;}};dojo._loadUri=function(uri,cb){if(d._loadedUrls[uri]){return true;}d._inFlightCount++;var _23=d._getText(uri,true);if(_23){d._loadedUrls[uri]=true;d._loadedUrls.push(uri);if(cb){_23=/^define\(/.test(_23)?_23:"("+_23+")";}else{_23=d._scopePrefix+_23+d._scopeSuffix;}if(!d.isIE){_23+="\r\n//@ sourceURL="+uri;}var _24=d["eval"](_23);if(cb){cb(_24);}}if(--d._inFlightCount==0&&d._postLoad&&d._loaders.length){setTimeout(function(){if(d._inFlightCount==0){d._callLoaded();}},0);}return !!_23;};dojo._loadUriAndCheck=function(uri,_25,cb){var ok=false;try{ok=d._loadUri(uri,cb);}catch(e){console.error("failed loading "+uri+" with error: "+e);}return !!(ok&&d._loadedModules[_25]);};dojo.loaded=function(){d._loadNotifying=true;d._postLoad=true;var mll=d._loaders;d._loaders=[];for(var x=0;x<mll.length;x++){mll[x]();}d._loadNotifying=false;if(d._postLoad&&d._inFlightCount==0&&mll.length){d._callLoaded();}};dojo.unloaded=function(){var mll=d._unloaders;while(mll.length){(mll.pop())();}};d._onto=function(arr,obj,fn){if(!fn){arr.push(obj);}else{if(fn){var _26=(typeof fn=="string")?obj[fn]:fn;arr.push(function(){_26.call(obj);});}}};dojo.ready=dojo.addOnLoad=function(obj,_27){d._onto(d._loaders,obj,_27);if(d._postLoad&&d._inFlightCount==0&&!d._loadNotifying){d._callLoaded();}};var dca=d.config.addOnLoad;if(dca){d.addOnLoad[(dca instanceof Array?"apply":"call")](d,dca);}dojo._modulesLoaded=function(){if(d._postLoad){return;}if(d._inFlightCount>0){console.warn("files still in flight!");return;}d._callLoaded();};dojo._callLoaded=function(){if(typeof setTimeout=="object"||(d.config.useXDomain&&d.isOpera)){setTimeout(d.isAIR?function(){d.loaded();}:d._scopeName+".loaded();",0);}else{d.loaded();}};dojo._getModuleSymbols=function(_28){var _29=_28.split(".");for(var i=_29.length;i>0;i--){var _2a=_29.slice(0,i).join(".");if(i==1&&!d._moduleHasPrefix(_2a)){_29[0]="../"+_29[0];}else{var _2b=d._getModulePrefix(_2a);if(_2b!=_2a){_29.splice(0,i,_2b);break;}}}return _29;};dojo._global_omit_module_check=false;dojo.loadInit=function(_2c){_2c();};dojo._loadModule=dojo.require=function(_2d,_2e){_2e=d._global_omit_module_check||_2e;var _2f=d._loadedModules[_2d];if(_2f){return _2f;}var _30=d._getModuleSymbols(_2d).join("/")+".js";var _31=!_2e?_2d:null;var ok=d._loadPath(_30,_31);if(!ok&&!_2e){throw new Error("Could not load '"+_2d+"'; last tried '"+_30+"'");}if(!_2e&&!d._isXDomain){_2f=d._loadedModules[_2d];if(!_2f){throw new Error("symbol '"+_2d+"' is not defined after loading '"+_30+"'");}}return _2f;};dojo.provide=function(_32){_32=_32+"";return (d._loadedModules[_32]=d.getObject(_32,true));};dojo.platformRequire=function(_33){var _34=_33.common||[];var _35=_34.concat(_33[d._name]||_33["default"]||[]);for(var x=0;x<_35.length;x++){var _36=_35[x];if(_36.constructor==Array){d._loadModule.apply(d,_36);}else{d._loadModule(_36);}}};dojo.requireIf=function(_37,_38){if(_37===true){var _39=[];for(var i=1;i<arguments.length;i++){_39.push(arguments[i]);}d.require.apply(d,_39);}};dojo.requireAfterIf=d.requireIf;dojo.registerModulePath=function(_3a,_3b){d._modulePrefixes[_3a]={name:_3a,value:_3b};};dojo.requireLocalization=function(_3c,_3d,_3e,_3f){d.require("dojo.i18n");d.i18n._requireLocalization.apply(d.hostenv,arguments);};var ore=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),ire=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");dojo._Url=function(){var n=null,_40=arguments,uri=[_40[0]];for(var i=1;i<_40.length;i++){if(!_40[i]){continue;}var _41=new d._Url(_40[i]+""),_42=new d._Url(uri[0]+"");if(_41.path==""&&!_41.scheme&&!_41.authority&&!_41.query){if(_41.fragment!=n){_42.fragment=_41.fragment;}_41=_42;}else{if(!_41.scheme){_41.scheme=_42.scheme;if(!_41.authority){_41.authority=_42.authority;if(_41.path.charAt(0)!="/"){var _43=_42.path.substring(0,_42.path.lastIndexOf("/")+1)+_41.path;var _44=_43.split("/");for(var j=0;j<_44.length;j++){if(_44[j]=="."){if(j==_44.length-1){_44[j]="";}else{_44.splice(j,1);j--;}}else{if(j>0&&!(j==1&&_44[0]=="")&&_44[j]==".."&&_44[j-1]!=".."){if(j==(_44.length-1)){_44.splice(j,1);_44[j-1]="";}else{_44.splice(j-1,2);j-=2;}}}}_41.path=_44.join("/");}}}}uri=[];if(_41.scheme){uri.push(_41.scheme,":");}if(_41.authority){uri.push("//",_41.authority);}uri.push(_41.path);if(_41.query){uri.push("?",_41.query);}if(_41.fragment){uri.push("#",_41.fragment);}}this.uri=uri.join("");var r=this.uri.match(ore);this.scheme=r[2]||(r[1]?"":n);this.authority=r[4]||(r[3]?"":n);this.path=r[5];this.query=r[7]||(r[6]?"":n);this.fragment=r[9]||(r[8]?"":n);if(this.authority!=n){r=this.authority.match(ire);this.user=r[3]||n;this.password=r[4]||n;this.host=r[6]||r[7];this.port=r[9]||n;}};dojo._Url.prototype.toString=function(){return this.uri;};dojo.moduleUrl=function(_45,url){var loc=d._getModuleSymbols(_45).join("/");if(!loc){return null;}if(loc.lastIndexOf("/")!=loc.length-1){loc+="/";}var _46=loc.indexOf(":");if(loc.charAt(0)!="/"&&(_46==-1||_46>loc.indexOf("/"))){loc=d.baseUrl+loc;}return new d._Url(loc,url);};})();if(typeof window!="undefined"){dojo.isBrowser=true;dojo._name="browser";(function(){var d=dojo;if(document&&document.getElementsByTagName){var _47=document.getElementsByTagName("script");var _48=/dojo(\.xd)?\.js(\W|$)/i;for(var i=0;i<_47.length;i++){var src=_47[i].getAttribute("src");if(!src){continue;}var m=src.match(_48);if(m){if(!d.config.baseUrl){d.config.baseUrl=src.substring(0,m.index);}var cfg=(_47[i].getAttribute("djConfig")||_47[i].getAttribute("data-dojo-config"));if(cfg){var _49=eval("({ "+cfg+" })");for(var x in _49){dojo.config[x]=_49[x];}}break;}}}d.baseUrl=d.config.baseUrl;var n=navigator;var dua=n.userAgent,dav=n.appVersion,tv=parseFloat(dav);if(dua.indexOf("Opera")>=0){d.isOpera=tv;}if(dua.indexOf("AdobeAIR")>=0){d.isAIR=1;}d.isKhtml=(dav.indexOf("Konqueror")>=0)?tv:0;d.isWebKit=parseFloat(dua.split("WebKit/")[1])||undefined;d.isChrome=parseFloat(dua.split("Chrome/")[1])||undefined;d.isMac=dav.indexOf("Macintosh")>=0;var _4a=Math.max(dav.indexOf("WebKit"),dav.indexOf("Safari"),0);if(_4a&&!dojo.isChrome){d.isSafari=parseFloat(dav.split("Version/")[1]);if(!d.isSafari||parseFloat(dav.substr(_4a+7))<=419.3){d.isSafari=2;}}if(dua.indexOf("Gecko")>=0&&!d.isKhtml&&!d.isWebKit){d.isMozilla=d.isMoz=tv;}if(d.isMoz){d.isFF=parseFloat(dua.split("Firefox/")[1]||dua.split("Minefield/")[1])||undefined;}if(document.all&&!d.isOpera){d.isIE=parseFloat(dav.split("MSIE ")[1])||undefined;var _4b=document.documentMode;if(_4b&&_4b!=5&&Math.floor(d.isIE)!=_4b){d.isIE=_4b;}}if(dojo.isIE&&window.location.protocol==="file:"){dojo.config.ieForceActiveXXhr=true;}d.isQuirks=document.compatMode=="BackCompat";d.locale=dojo.config.locale||(d.isIE?n.userLanguage:n.language).toLowerCase();d._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];d._xhrObj=function(){var _4c,_4d;if(!dojo.isIE||!dojo.config.ieForceActiveXXhr){try{_4c=new XMLHttpRequest();}catch(e){}}if(!_4c){for(var i=0;i<3;++i){var _4e=d._XMLHTTP_PROGIDS[i];try{_4c=new ActiveXObject(_4e);}catch(e){_4d=e;}if(_4c){d._XMLHTTP_PROGIDS=[_4e];break;}}}if(!_4c){throw new Error("XMLHTTP not available: "+_4d);}return _4c;};d._isDocumentOk=function(_4f){var _50=_4f.status||0,lp=location.protocol;return (_50>=200&&_50<300)||_50==304||_50==1223||(!_50&&(lp=="file:"||lp=="chrome:"||lp=="chrome-extension:"||lp=="app:"));};var _51=window.location+"";var _52=document.getElementsByTagName("base");var _53=(_52&&_52.length>0);d._getText=function(uri,_54){var _55=d._xhrObj();if(!_53&&dojo._Url){uri=(new dojo._Url(_51,uri)).toString();}if(d.config.cacheBust){uri+="";uri+=(uri.indexOf("?")==-1?"?":"&")+String(d.config.cacheBust).replace(/\W+/g,"");}_55.open("GET",uri,false);try{_55.send(null);if(!d._isDocumentOk(_55)){var err=Error("Unable to load "+uri+" status:"+_55.status);err.status=_55.status;err.responseText=_55.responseText;throw err;}}catch(e){if(_54){return null;}throw e;}return _55.responseText;};var _56=window;var _57=function(_58,fp){var _59=_56.attachEvent||_56.addEventListener;_58=_56.attachEvent?_58:_58.substring(2);_59(_58,function(){fp.apply(_56,arguments);},false);};d._windowUnloaders=[];d.windowUnloaded=function(){var mll=d._windowUnloaders;while(mll.length){(mll.pop())();}d=null;};var _5a=0;d.addOnWindowUnload=function(obj,_5b){d._onto(d._windowUnloaders,obj,_5b);if(!_5a){_5a=1;_57("onunload",d.windowUnloaded);}};var _5c=0;d.addOnUnload=function(obj,_5d){d._onto(d._unloaders,obj,_5d);if(!_5c){_5c=1;_57("onbeforeunload",dojo.unloaded);}};})();dojo._initFired=false;dojo._loadInit=function(e){if(dojo._scrollIntervalId){clearInterval(dojo._scrollIntervalId);dojo._scrollIntervalId=0;}if(!dojo._initFired){dojo._initFired=true;if(!dojo.config.afterOnLoad&&window.detachEvent){window.detachEvent("onload",dojo._loadInit);}if(dojo._inFlightCount==0){dojo._modulesLoaded();}}};if(!dojo.config.afterOnLoad){if(document.addEventListener){document.addEventListener("DOMContentLoaded",dojo._loadInit,false);window.addEventListener("load",dojo._loadInit,false);}else{if(window.attachEvent){window.attachEvent("onload",dojo._loadInit);if(!dojo.config.skipIeDomLoaded&&self===self.top){dojo._scrollIntervalId=setInterval(function(){try{if(document.body){document.documentElement.doScroll("left");dojo._loadInit();}}catch(e){}},30);}}}}if(dojo.isIE){try{(function(){document.namespaces.add("v","urn:schemas-microsoft-com:vml");var _5e=["*","group","roundrect","oval","shape","rect","imagedata","path","textpath","text"],i=0,l=1,s=document.createStyleSheet();if(dojo.isIE>=8){i=1;l=_5e.length;}for(;i<l;++i){s.addRule("v\\:"+_5e[i],"behavior:url(#default#VML); display:inline-block");}})();}catch(e){}}}(function(){var mp=dojo.config["modulePaths"];if(mp){for(var _5f in mp){dojo.registerModulePath(_5f,mp[_5f]);}}})();if(dojo.config.isDebug){dojo.require("dojo._firebug.firebug");}if(dojo.config.debugAtAllCosts){dojo.require("dojo._base._loader.loader_debug");dojo.require("dojo.i18n");}if(!dojo._hasResource["dojo._base.lang"]){dojo._hasResource["dojo._base.lang"]=true;dojo.provide("dojo._base.lang");(function(){var d=dojo,_60=Object.prototype.toString;dojo.isString=function(it){return (typeof it=="string"||it instanceof String);};dojo.isArray=function(it){return it&&(it instanceof Array||typeof it=="array");};dojo.isFunction=function(it){return _60.call(it)==="[object Function]";};dojo.isObject=function(it){return it!==undefined&&(it===null||typeof it=="object"||d.isArray(it)||d.isFunction(it));};dojo.isArrayLike=function(it){return it&&it!==undefined&&!d.isString(it)&&!d.isFunction(it)&&!(it.tagName&&it.tagName.toLowerCase()=="form")&&(d.isArray(it)||isFinite(it.length));};dojo.isAlien=function(it){return it&&!d.isFunction(it)&&/\{\s*\[native code\]\s*\}/.test(String(it));};dojo.extend=function(_61,_62){for(var i=1,l=arguments.length;i<l;i++){d._mixin(_61.prototype,arguments[i]);}return _61;};dojo._hitchArgs=function(_63,_64){var pre=d._toArray(arguments,2);var _65=d.isString(_64);return function(){var _66=d._toArray(arguments);var f=_65?(_63||d.global)[_64]:_64;return f&&f.apply(_63||this,pre.concat(_66));};};dojo.hitch=function(_67,_68){if(arguments.length>2){return d._hitchArgs.apply(d,arguments);}if(!_68){_68=_67;_67=null;}if(d.isString(_68)){_67=_67||d.global;if(!_67[_68]){throw (["dojo.hitch: scope[\"",_68,"\"] is null (scope=\"",_67,"\")"].join(""));}return function(){return _67[_68].apply(_67,arguments||[]);};}return !_67?_68:function(){return _68.apply(_67,arguments||[]);};};dojo.delegate=dojo._delegate=(function(){function TMP(){};return function(obj,_69){TMP.prototype=obj;var tmp=new TMP();TMP.prototype=null;if(_69){d._mixin(tmp,_69);}return tmp;};})();var _6a=function(obj,_6b,_6c){return (_6c||[]).concat(Array.prototype.slice.call(obj,_6b||0));};var _6d=function(obj,_6e,_6f){var arr=_6f||[];for(var x=_6e||0;x<obj.length;x++){arr.push(obj[x]);}return arr;};dojo._toArray=d.isIE?function(obj){return ((obj.item)?_6d:_6a).apply(this,arguments);}:_6a;dojo.partial=function(_70){var arr=[null];return d.hitch.apply(d,arr.concat(d._toArray(arguments)));};var _71=d._extraNames,_72=_71.length,_73={};dojo.clone=function(o){if(!o||typeof o!="object"||d.isFunction(o)){return o;}if(o.nodeType&&"cloneNode" in o){return o.cloneNode(true);}if(o instanceof Date){return new Date(o.getTime());}if(o instanceof RegExp){return new RegExp(o);}var r,i,l,s,_74;if(d.isArray(o)){r=[];for(i=0,l=o.length;i<l;++i){if(i in o){r.push(d.clone(o[i]));}}}else{r=o.constructor?new o.constructor():{};}for(_74 in o){s=o[_74];if(!(_74 in r)||(r[_74]!==s&&(!(_74 in _73)||_73[_74]!==s))){r[_74]=d.clone(s);}}if(_72){for(i=0;i<_72;++i){_74=_71[i];s=o[_74];if(!(_74 in r)||(r[_74]!==s&&(!(_74 in _73)||_73[_74]!==s))){r[_74]=s;}}}return r;};dojo.trim=String.prototype.trim?function(str){return str.trim();}:function(str){return str.replace(/^\s\s*/,"").replace(/\s\s*$/,"");};var _75=/\{([^\}]+)\}/g;dojo.replace=function(_76,map,_77){return _76.replace(_77||_75,d.isFunction(map)?map:function(_78,k){return d.getObject(k,false,map);});};})();}if(!dojo._hasResource["dojo._base.array"]){dojo._hasResource["dojo._base.array"]=true;dojo.provide("dojo._base.array");(function(){var _79=function(arr,obj,cb){return [(typeof arr=="string")?arr.split(""):arr,obj||dojo.global,(typeof cb=="string")?new Function("item","index","array",cb):cb];};var _7a=function(_7b,arr,_7c,_7d){var _7e=_79(arr,_7d,_7c);arr=_7e[0];for(var i=0,l=arr.length;i<l;++i){var _7f=!!_7e[2].call(_7e[1],arr[i],i,arr);if(_7b^_7f){return _7f;}}return _7b;};dojo.mixin(dojo,{indexOf:function(_80,_81,_82,_83){var _84=1,end=_80.length||0,i=0;if(_83){i=end-1;_84=end=-1;}if(_82!=undefined){i=_82;}if((_83&&i>end)||i<end){for(;i!=end;i+=_84){if(_80[i]==_81){return i;}}}return -1;},lastIndexOf:function(_85,_86,_87){return dojo.indexOf(_85,_86,_87,true);},forEach:function(arr,_88,_89){if(!arr||!arr.length){return;}var _8a=_79(arr,_89,_88);arr=_8a[0];for(var i=0,l=arr.length;i<l;++i){_8a[2].call(_8a[1],arr[i],i,arr);}},every:function(arr,_8b,_8c){return _7a(true,arr,_8b,_8c);},some:function(arr,_8d,_8e){return _7a(false,arr,_8d,_8e);},map:function(arr,_8f,_90){var _91=_79(arr,_90,_8f);arr=_91[0];var _92=(arguments[3]?(new arguments[3]()):[]);for(var i=0,l=arr.length;i<l;++i){_92.push(_91[2].call(_91[1],arr[i],i,arr));}return _92;},filter:function(arr,_93,_94){var _95=_79(arr,_94,_93);arr=_95[0];var _96=[];for(var i=0,l=arr.length;i<l;++i){if(_95[2].call(_95[1],arr[i],i,arr)){_96.push(arr[i]);}}return _96;}});})();}if(!dojo._hasResource["dojo._base.declare"]){dojo._hasResource["dojo._base.declare"]=true;dojo.provide("dojo._base.declare");(function(){var d=dojo,mix=d._mixin,op=Object.prototype,_97=op.toString,_98=new Function,_99=0,_9a="constructor";function err(msg,cls){throw new Error("declare"+(cls?" "+cls:"")+": "+msg);};function _9b(_9c,_9d){var _9e=[],_9f=[{cls:0,refs:[]}],_a0={},_a1=1,l=_9c.length,i=0,j,lin,_a2,top,_a3,rec,_a4,_a5;for(;i<l;++i){_a2=_9c[i];if(!_a2){err("mixin #"+i+" is unknown. Did you use dojo.require to pull it in?",_9d);}else{if(_97.call(_a2)!="[object Function]"){err("mixin #"+i+" is not a callable constructor.",_9d);}}lin=_a2._meta?_a2._meta.bases:[_a2];top=0;for(j=lin.length-1;j>=0;--j){_a3=lin[j].prototype;if(!_a3.hasOwnProperty("declaredClass")){_a3.declaredClass="uniqName_"+(_99++);}_a4=_a3.declaredClass;if(!_a0.hasOwnProperty(_a4)){_a0[_a4]={count:0,refs:[],cls:lin[j]};++_a1;}rec=_a0[_a4];if(top&&top!==rec){rec.refs.push(top);++top.count;}top=rec;}++top.count;_9f[0].refs.push(top);}while(_9f.length){top=_9f.pop();_9e.push(top.cls);--_a1;while(_a5=top.refs,_a5.length==1){top=_a5[0];if(!top||--top.count){top=0;break;}_9e.push(top.cls);--_a1;}if(top){for(i=0,l=_a5.length;i<l;++i){top=_a5[i];if(!--top.count){_9f.push(top);}}}}if(_a1){err("can't build consistent linearization",_9d);}_a2=_9c[0];_9e[0]=_a2?_a2._meta&&_a2===_9e[_9e.length-_a2._meta.bases.length]?_a2._meta.bases.length:1:0;return _9e;};function _a6(_a7,a,f){var _a8,_a9,_aa,_ab,_ac,_ad,_ae,opf,pos,_af=this._inherited=this._inherited||{};if(typeof _a7=="string"){_a8=_a7;_a7=a;a=f;}f=0;_ab=_a7.callee;_a8=_a8||_ab.nom;if(!_a8){err("can't deduce a name to call inherited()",this.declaredClass);}_ac=this.constructor._meta;_aa=_ac.bases;pos=_af.p;if(_a8!=_9a){if(_af.c!==_ab){pos=0;_ad=_aa[0];_ac=_ad._meta;if(_ac.hidden[_a8]!==_ab){_a9=_ac.chains;if(_a9&&typeof _a9[_a8]=="string"){err("calling chained method with inherited: "+_a8,this.declaredClass);}do{_ac=_ad._meta;_ae=_ad.prototype;if(_ac&&(_ae[_a8]===_ab&&_ae.hasOwnProperty(_a8)||_ac.hidden[_a8]===_ab)){break;}}while(_ad=_aa[++pos]);pos=_ad?pos:-1;}}_ad=_aa[++pos];if(_ad){_ae=_ad.prototype;if(_ad._meta&&_ae.hasOwnProperty(_a8)){f=_ae[_a8];}else{opf=op[_a8];do{_ae=_ad.prototype;f=_ae[_a8];if(f&&(_ad._meta?_ae.hasOwnProperty(_a8):f!==opf)){break;}}while(_ad=_aa[++pos]);}}f=_ad&&f||op[_a8];}else{if(_af.c!==_ab){pos=0;_ac=_aa[0]._meta;if(_ac&&_ac.ctor!==_ab){_a9=_ac.chains;if(!_a9||_a9.constructor!=="manual"){err("calling chained constructor with inherited",this.declaredClass);}while(_ad=_aa[++pos]){_ac=_ad._meta;if(_ac&&_ac.ctor===_ab){break;}}pos=_ad?pos:-1;}}while(_ad=_aa[++pos]){_ac=_ad._meta;f=_ac?_ac.ctor:_ad;if(f){break;}}f=_ad&&f;}_af.c=f;_af.p=pos;if(f){return a===true?f:f.apply(this,a||_a7);}};function _b0(_b1,_b2){if(typeof _b1=="string"){return this.inherited(_b1,_b2,true);}return this.inherited(_b1,true);};function _b3(cls){var _b4=this.constructor._meta.bases;for(var i=0,l=_b4.length;i<l;++i){if(_b4[i]===cls){return true;}}return this instanceof cls;};function _b5(_b6,_b7){var _b8,i=0,l=d._extraNames.length;for(_b8 in _b7){if(_b8!=_9a&&_b7.hasOwnProperty(_b8)){_b6[_b8]=_b7[_b8];}}for(;i<l;++i){_b8=d._extraNames[i];if(_b8!=_9a&&_b7.hasOwnProperty(_b8)){_b6[_b8]=_b7[_b8];}}};function _b9(_ba,_bb){var _bc,t,i=0,l=d._extraNames.length;for(_bc in _bb){t=_bb[_bc];if((t!==op[_bc]||!(_bc in op))&&_bc!=_9a){if(_97.call(t)=="[object Function]"){t.nom=_bc;}_ba[_bc]=t;}}for(;i<l;++i){_bc=d._extraNames[i];t=_bb[_bc];if((t!==op[_bc]||!(_bc in op))&&_bc!=_9a){if(_97.call(t)=="[object Function]"){t.nom=_bc;}_ba[_bc]=t;}}return _ba;};function _bd(_be){_b9(this.prototype,_be);return this;};function _bf(_c0,_c1){return function(){var a=arguments,_c2=a,a0=a[0],f,i,m,l=_c0.length,_c3;if(!(this instanceof a.callee)){return _c4(a);}if(_c1&&(a0&&a0.preamble||this.preamble)){_c3=new Array(_c0.length);_c3[0]=a;for(i=0;;){a0=a[0];if(a0){f=a0.preamble;if(f){a=f.apply(this,a)||a;}}f=_c0[i].prototype;f=f.hasOwnProperty("preamble")&&f.preamble;if(f){a=f.apply(this,a)||a;}if(++i==l){break;}_c3[i]=a;}}for(i=l-1;i>=0;--i){f=_c0[i];m=f._meta;f=m?m.ctor:f;if(f){f.apply(this,_c3?_c3[i]:a);}}f=this.postscript;if(f){f.apply(this,_c2);}};};function _c5(_c6,_c7){return function(){var a=arguments,t=a,a0=a[0],f;if(!(this instanceof a.callee)){return _c4(a);}if(_c7){if(a0){f=a0.preamble;if(f){t=f.apply(this,t)||t;}}f=this.preamble;if(f){f.apply(this,t);}}if(_c6){_c6.apply(this,a);}f=this.postscript;if(f){f.apply(this,a);}};};function _c8(_c9){return function(){var a=arguments,i=0,f,m;if(!(this instanceof a.callee)){return _c4(a);}for(;f=_c9[i];++i){m=f._meta;f=m?m.ctor:f;if(f){f.apply(this,a);break;}}f=this.postscript;if(f){f.apply(this,a);}};};function _ca(_cb,_cc,_cd){return function(){var b,m,f,i=0,_ce=1;if(_cd){i=_cc.length-1;_ce=-1;}for(;b=_cc[i];i+=_ce){m=b._meta;f=(m?m.hidden:b.prototype)[_cb];if(f){f.apply(this,arguments);}}};};function _cf(_d0){_98.prototype=_d0.prototype;var t=new _98;_98.prototype=null;return t;};function _c4(_d1){var _d2=_d1.callee,t=_cf(_d2);_d2.apply(t,_d1);return t;};d.declare=function(_d3,_d4,_d5){if(typeof _d3!="string"){_d5=_d4;_d4=_d3;_d3="";}_d5=_d5||{};var _d6,i,t,_d7,_d8,_d9,_da,_db=1,_dc=_d4;if(_97.call(_d4)=="[object Array]"){_d9=_9b(_d4,_d3);t=_d9[0];_db=_d9.length-t;_d4=_d9[_db];}else{_d9=[0];if(_d4){if(_97.call(_d4)=="[object Function]"){t=_d4._meta;_d9=_d9.concat(t?t.bases:_d4);}else{err("base class is not a callable constructor.",_d3);}}else{if(_d4!==null){err("unknown base class. Did you use dojo.require to pull it in?",_d3);}}}if(_d4){for(i=_db-1;;--i){_d6=_cf(_d4);if(!i){break;}t=_d9[i];(t._meta?_b5:mix)(_d6,t.prototype);_d7=new Function;_d7.superclass=_d4;_d7.prototype=_d6;_d4=_d6.constructor=_d7;}}else{_d6={};}_b9(_d6,_d5);t=_d5.constructor;if(t!==op.constructor){t.nom=_9a;_d6.constructor=t;}for(i=_db-1;i;--i){t=_d9[i]._meta;if(t&&t.chains){_da=mix(_da||{},t.chains);}}if(_d6["-chains-"]){_da=mix(_da||{},_d6["-chains-"]);}t=!_da||!_da.hasOwnProperty(_9a);_d9[0]=_d7=(_da&&_da.constructor==="manual")?_c8(_d9):(_d9.length==1?_c5(_d5.constructor,t):_bf(_d9,t));_d7._meta={bases:_d9,hidden:_d5,chains:_da,parents:_dc,ctor:_d5.constructor};_d7.superclass=_d4&&_d4.prototype;_d7.extend=_bd;_d7.prototype=_d6;_d6.constructor=_d7;_d6.getInherited=_b0;_d6.inherited=_a6;_d6.isInstanceOf=_b3;if(_d3){_d6.declaredClass=_d3;d.setObject(_d3,_d7);}if(_da){for(_d8 in _da){if(_d6[_d8]&&typeof _da[_d8]=="string"&&_d8!=_9a){t=_d6[_d8]=_ca(_d8,_d9,_da[_d8]==="after");t.nom=_d8;}}}return _d7;};d.safeMixin=_b9;})();}if(!dojo._hasResource["dojo._base.connect"]){dojo._hasResource["dojo._base.connect"]=true;dojo.provide("dojo._base.connect");dojo._listener={getDispatcher:function(){return function(){var ap=Array.prototype,c=arguments.callee,ls=c._listeners,t=c.target,r=t&&t.apply(this,arguments),i,lls=[].concat(ls);for(i in lls){if(!(i in ap)){lls[i].apply(this,arguments);}}return r;};},add:function(_dd,_de,_df){_dd=_dd||dojo.global;var f=_dd[_de];if(!f||!f._listeners){var d=dojo._listener.getDispatcher();d.target=f;d._listeners=[];f=_dd[_de]=d;}return f._listeners.push(_df);},remove:function(_e0,_e1,_e2){var f=(_e0||dojo.global)[_e1];if(f&&f._listeners&&_e2--){delete f._listeners[_e2];}}};dojo.connect=function(obj,_e3,_e4,_e5,_e6){var a=arguments,_e7=[],i=0;_e7.push(dojo.isString(a[0])?null:a[i++],a[i++]);var a1=a[i+1];_e7.push(dojo.isString(a1)||dojo.isFunction(a1)?a[i++]:null,a[i++]);for(var l=a.length;i<l;i++){_e7.push(a[i]);}return dojo._connect.apply(this,_e7);};dojo._connect=function(obj,_e8,_e9,_ea){var l=dojo._listener,h=l.add(obj,_e8,dojo.hitch(_e9,_ea));return [obj,_e8,h,l];};dojo.disconnect=function(_eb){if(_eb&&_eb[0]!==undefined){dojo._disconnect.apply(this,_eb);delete _eb[0];}};dojo._disconnect=function(obj,_ec,_ed,_ee){_ee.remove(obj,_ec,_ed);};dojo._topics={};dojo.subscribe=function(_ef,_f0,_f1){return [_ef,dojo._listener.add(dojo._topics,_ef,dojo.hitch(_f0,_f1))];};dojo.unsubscribe=function(_f2){if(_f2){dojo._listener.remove(dojo._topics,_f2[0],_f2[1]);}};dojo.publish=function(_f3,_f4){var f=dojo._topics[_f3];if(f){f.apply(this,_f4||[]);}};dojo.connectPublisher=function(_f5,obj,_f6){var pf=function(){dojo.publish(_f5,arguments);};return _f6?dojo.connect(obj,_f6,pf):dojo.connect(obj,pf);};}if(!dojo._hasResource["dojo._base.Deferred"]){dojo._hasResource["dojo._base.Deferred"]=true;dojo.provide("dojo._base.Deferred");(function(){var _f7=function(){};var _f8=Object.freeze||function(){};dojo.Deferred=function(_f9){var _fa,_fb,_fc,_fd,_fe;var _ff=(this.promise={});function _100(_101){if(_fb){throw new Error("This deferred has already been resolved");}_fa=_101;_fb=true;_102();};function _102(){var _103;while(!_103&&_fe){var _104=_fe;_fe=_fe.next;if((_103=(_104.progress==_f7))){_fb=false;}var func=(_fc?_104.error:_104.resolved);if(func){try{var _105=func(_fa);if(_105&&typeof _105.then==="function"){_105.then(dojo.hitch(_104.deferred,"resolve"),dojo.hitch(_104.deferred,"reject"));continue;}var _106=_103&&_105===undefined;if(_103&&!_106){_fc=_105 instanceof Error;}_104.deferred[_106&&_fc?"reject":"resolve"](_106?_fa:_105);}catch(e){_104.deferred.reject(e);}}else{if(_fc){_104.deferred.reject(_fa);}else{_104.deferred.resolve(_fa);}}}};this.resolve=this.callback=function(_107){this.fired=0;this.results=[_107,null];_100(_107);};this.reject=this.errback=function(_108){_fc=true;this.fired=1;_100(_108);this.results=[null,_108];if(!_108||_108.log!==false){(dojo.config.deferredOnError||function(x){console.error(x);})(_108);}};this.progress=function(_109){var _10a=_fe;while(_10a){var _10b=_10a.progress;_10b&&_10b(_109);_10a=_10a.next;}};this.addCallbacks=function(_10c,_10d){this.then(_10c,_10d,_f7);return this;};this.then=_ff.then=function(_10e,_10f,_110){var _111=_110==_f7?this:new dojo.Deferred(_ff.cancel);var _112={resolved:_10e,error:_10f,progress:_110,deferred:_111};if(_fe){_fd=_fd.next=_112;}else{_fe=_fd=_112;}if(_fb){_102();}return _111.promise;};var _113=this;this.cancel=_ff.cancel=function(){if(!_fb){var _114=_f9&&_f9(_113);if(!_fb){if(!(_114 instanceof Error)){_114=new Error(_114);}_114.log=false;_113.reject(_114);}}};_f8(_ff);};dojo.extend(dojo.Deferred,{addCallback:function(_115){return this.addCallbacks(dojo.hitch.apply(dojo,arguments));},addErrback:function(_116){return this.addCallbacks(null,dojo.hitch.apply(dojo,arguments));},addBoth:function(_117){var _118=dojo.hitch.apply(dojo,arguments);return this.addCallbacks(_118,_118);},fired:-1});})();dojo.when=function(_119,_11a,_11b,_11c){if(_119&&typeof _119.then==="function"){return _119.then(_11a,_11b,_11c);}return _11a(_119);};}if(!dojo._hasResource["dojo._base.json"]){dojo._hasResource["dojo._base.json"]=true;dojo.provide("dojo._base.json");dojo.fromJson=function(json){return eval("("+json+")");};dojo._escapeString=function(str){return ("\""+str.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r");};dojo.toJsonIndentStr="\t";dojo.toJson=function(it,_11d,_11e){if(it===undefined){return "undefined";}var _11f=typeof it;if(_11f=="number"||_11f=="boolean"){return it+"";}if(it===null){return "null";}if(dojo.isString(it)){return dojo._escapeString(it);}var _120=arguments.callee;var _121;_11e=_11e||"";var _122=_11d?_11e+dojo.toJsonIndentStr:"";var tf=it.__json__||it.json;if(dojo.isFunction(tf)){_121=tf.call(it);if(it!==_121){return _120(_121,_11d,_122);}}if(it.nodeType&&it.cloneNode){throw new Error("Can't serialize DOM nodes");}var sep=_11d?" ":"";var _123=_11d?"\n":"";if(dojo.isArray(it)){var res=dojo.map(it,function(obj){var val=_120(obj,_11d,_122);if(typeof val!="string"){val="undefined";}return _123+_122+val;});return "["+res.join(","+sep)+_123+_11e+"]";}if(_11f=="function"){return null;}var _124=[],key;for(key in it){var _125,val;if(typeof key=="number"){_125="\""+key+"\"";}else{if(typeof key=="string"){_125=dojo._escapeString(key);}else{continue;}}val=_120(it[key],_11d,_122);if(typeof val!="string"){continue;}_124.push(_123+_122+_125+":"+sep+val);}return "{"+_124.join(","+sep)+_123+_11e+"}";};}if(!dojo._hasResource["dojo._base.Color"]){dojo._hasResource["dojo._base.Color"]=true;dojo.provide("dojo._base.Color");(function(){var d=dojo;dojo.Color=function(_126){if(_126){this.setColor(_126);}};dojo.Color.named={black:[0,0,0],silver:[192,192,192],gray:[128,128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255],transparent:d.config.transparentColor||[255,255,255]};dojo.extend(dojo.Color,{r:255,g:255,b:255,a:1,_set:function(r,g,b,a){var t=this;t.r=r;t.g=g;t.b=b;t.a=a;},setColor:function(_127){if(d.isString(_127)){d.colorFromString(_127,this);}else{if(d.isArray(_127)){d.colorFromArray(_127,this);}else{this._set(_127.r,_127.g,_127.b,_127.a);if(!(_127 instanceof d.Color)){this.sanitize();}}}return this;},sanitize:function(){return this;},toRgb:function(){var t=this;return [t.r,t.g,t.b];},toRgba:function(){var t=this;return [t.r,t.g,t.b,t.a];},toHex:function(){var arr=d.map(["r","g","b"],function(x){var s=this[x].toString(16);return s.length<2?"0"+s:s;},this);return "#"+arr.join("");},toCss:function(_128){var t=this,rgb=t.r+", "+t.g+", "+t.b;return (_128?"rgba("+rgb+", "+t.a:"rgb("+rgb)+")";},toString:function(){return this.toCss(true);}});dojo.blendColors=function(_129,end,_12a,obj){var t=obj||new d.Color();d.forEach(["r","g","b","a"],function(x){t[x]=_129[x]+(end[x]-_129[x])*_12a;if(x!="a"){t[x]=Math.round(t[x]);}});return t.sanitize();};dojo.colorFromRgb=function(_12b,obj){var m=_12b.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/);return m&&dojo.colorFromArray(m[1].split(/\s*,\s*/),obj);};dojo.colorFromHex=function(_12c,obj){var t=obj||new d.Color(),bits=(_12c.length==4)?4:8,mask=(1<<bits)-1;_12c=Number("0x"+_12c.substr(1));if(isNaN(_12c)){return null;}d.forEach(["b","g","r"],function(x){var c=_12c&mask;_12c>>=bits;t[x]=bits==4?17*c:c;});t.a=1;return t;};dojo.colorFromArray=function(a,obj){var t=obj||new d.Color();t._set(Number(a[0]),Number(a[1]),Number(a[2]),Number(a[3]));if(isNaN(t.a)){t.a=1;}return t.sanitize();};dojo.colorFromString=function(str,obj){var a=d.Color.named[str];return a&&d.colorFromArray(a,obj)||d.colorFromRgb(str,obj)||d.colorFromHex(str,obj);};})();}if(!dojo._hasResource["dojo._base.window"]){dojo._hasResource["dojo._base.window"]=true;dojo.provide("dojo._base.window");dojo.doc=window["document"]||null;dojo.body=function(){return dojo.doc.body||dojo.doc.getElementsByTagName("body")[0];};dojo.setContext=function(_12d,_12e){dojo.global=_12d;dojo.doc=_12e;};dojo.withGlobal=function(_12f,_130,_131,_132){var _133=dojo.global;try{dojo.global=_12f;return dojo.withDoc.call(null,_12f.document,_130,_131,_132);}finally{dojo.global=_133;}};dojo.withDoc=function(_134,_135,_136,_137){var _138=dojo.doc,_139=dojo._bodyLtr,oldQ=dojo.isQuirks;try{dojo.doc=_134;delete dojo._bodyLtr;dojo.isQuirks=dojo.doc.compatMode=="BackCompat";if(_136&&typeof _135=="string"){_135=_136[_135];}return _135.apply(_136,_137||[]);}finally{dojo.doc=_138;delete dojo._bodyLtr;if(_139!==undefined){dojo._bodyLtr=_139;}dojo.isQuirks=oldQ;}};}if(!dojo._hasResource["dojo._base.event"]){dojo._hasResource["dojo._base.event"]=true;dojo.provide("dojo._base.event");(function(){var del=(dojo._event_listener={add:function(node,name,fp){if(!node){return;}name=del._normalizeEventName(name);fp=del._fixCallback(name,fp);if(!dojo.isIE&&(name=="mouseenter"||name=="mouseleave")){var ofp=fp;name=(name=="mouseenter")?"mouseover":"mouseout";fp=function(e){if(!dojo.isDescendant(e.relatedTarget,node)){return ofp.call(this,e);}};}node.addEventListener(name,fp,false);return fp;},remove:function(node,_13a,_13b){if(node){_13a=del._normalizeEventName(_13a);if(!dojo.isIE&&(_13a=="mouseenter"||_13a=="mouseleave")){_13a=(_13a=="mouseenter")?"mouseover":"mouseout";}node.removeEventListener(_13a,_13b,false);}},_normalizeEventName:function(name){return name.slice(0,2)=="on"?name.slice(2):name;},_fixCallback:function(name,fp){return name!="keypress"?fp:function(e){return fp.call(this,del._fixEvent(e,this));};},_fixEvent:function(evt,_13c){switch(evt.type){case "keypress":del._setKeyChar(evt);break;}return evt;},_setKeyChar:function(evt){evt.keyChar=evt.charCode>=32?String.fromCharCode(evt.charCode):"";evt.charOrCode=evt.keyChar||evt.keyCode;},_punctMap:{106:42,111:47,186:59,187:43,188:44,189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39}});dojo.fixEvent=function(evt,_13d){return del._fixEvent(evt,_13d);};dojo.stopEvent=function(evt){evt.preventDefault();evt.stopPropagation();};var _13e=dojo._listener;dojo._connect=function(obj,_13f,_140,_141,_142){var _143=obj&&(obj.nodeType||obj.attachEvent||obj.addEventListener);var lid=_143?(_142?2:1):0,l=[dojo._listener,del,_13e][lid];var h=l.add(obj,_13f,dojo.hitch(_140,_141));return [obj,_13f,h,lid];};dojo._disconnect=function(obj,_144,_145,_146){([dojo._listener,del,_13e][_146]).remove(obj,_144,_145);};dojo.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:dojo.isSafari?91:224,PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108,NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,NUM_LOCK:144,SCROLL_LOCK:145,copyKey:dojo.isMac&&!dojo.isAIR?(dojo.isSafari?91:224):17};var _147=dojo.isMac?"metaKey":"ctrlKey";dojo.isCopyKey=function(e){return e[_147];};if(dojo.isIE<9||(dojo.isIE&&dojo.isQuirks)){dojo.mouseButtons={LEFT:1,MIDDLE:4,RIGHT:2,isButton:function(e,_148){return e.button&_148;},isLeft:function(e){return e.button&1;},isMiddle:function(e){return e.button&4;},isRight:function(e){return e.button&2;}};}else{dojo.mouseButtons={LEFT:0,MIDDLE:1,RIGHT:2,isButton:function(e,_149){return e.button==_149;},isLeft:function(e){return e.button==0;},isMiddle:function(e){return e.button==1;},isRight:function(e){return e.button==2;}};}if(dojo.isIE){var _14a=function(e,code){try{return (e.keyCode=code);}catch(e){return 0;}};var iel=dojo._listener;var _14b=(dojo._ieListenersName="_"+dojo._scopeName+"_listeners");if(!dojo.config._allow_leaks){_13e=iel=dojo._ie_listener={handlers:[],add:function(_14c,_14d,_14e){_14c=_14c||dojo.global;var f=_14c[_14d];if(!f||!f[_14b]){var d=dojo._getIeDispatcher();d.target=f&&(ieh.push(f)-1);d[_14b]=[];f=_14c[_14d]=d;}return f[_14b].push(ieh.push(_14e)-1);},remove:function(_14f,_150,_151){var f=(_14f||dojo.global)[_150],l=f&&f[_14b];if(f&&l&&_151--){delete ieh[l[_151]];delete l[_151];}}};var ieh=iel.handlers;}dojo.mixin(del,{add:function(node,_152,fp){if(!node){return;}_152=del._normalizeEventName(_152);if(_152=="onkeypress"){var kd=node.onkeydown;if(!kd||!kd[_14b]||!kd._stealthKeydownHandle){var h=del.add(node,"onkeydown",del._stealthKeyDown);kd=node.onkeydown;kd._stealthKeydownHandle=h;kd._stealthKeydownRefs=1;}else{kd._stealthKeydownRefs++;}}return iel.add(node,_152,del._fixCallback(fp));},remove:function(node,_153,_154){_153=del._normalizeEventName(_153);iel.remove(node,_153,_154);if(_153=="onkeypress"){var kd=node.onkeydown;if(--kd._stealthKeydownRefs<=0){iel.remove(node,"onkeydown",kd._stealthKeydownHandle);delete kd._stealthKeydownHandle;}}},_normalizeEventName:function(_155){return _155.slice(0,2)!="on"?"on"+_155:_155;},_nop:function(){},_fixEvent:function(evt,_156){if(!evt){var w=_156&&(_156.ownerDocument||_156.document||_156).parentWindow||window;evt=w.event;}if(!evt){return (evt);}evt.target=evt.srcElement;evt.currentTarget=(_156||evt.srcElement);evt.layerX=evt.offsetX;evt.layerY=evt.offsetY;var se=evt.srcElement,doc=(se&&se.ownerDocument)||document;var _157=((dojo.isIE<6)||(doc["compatMode"]=="BackCompat"))?doc.body:doc.documentElement;var _158=dojo._getIeDocumentElementOffset();evt.pageX=evt.clientX+dojo._fixIeBiDiScrollLeft(_157.scrollLeft||0)-_158.x;evt.pageY=evt.clientY+(_157.scrollTop||0)-_158.y;if(evt.type=="mouseover"){evt.relatedTarget=evt.fromElement;}if(evt.type=="mouseout"){evt.relatedTarget=evt.toElement;}if(dojo.isIE<9||dojo.isQuirks){evt.stopPropagation=del._stopPropagation;evt.preventDefault=del._preventDefault;}return del._fixKeys(evt);},_fixKeys:function(evt){switch(evt.type){case "keypress":var c=("charCode" in evt?evt.charCode:evt.keyCode);if(c==10){c=0;evt.keyCode=13;}else{if(c==13||c==27){c=0;}else{if(c==3){c=99;}}}evt.charCode=c;del._setKeyChar(evt);break;}return evt;},_stealthKeyDown:function(evt){var kp=evt.currentTarget.onkeypress;if(!kp||!kp[_14b]){return;}var k=evt.keyCode;var _159=(k!=13||(dojo.isIE>=9&&!dojo.isQuirks))&&k!=32&&k!=27&&(k<48||k>90)&&(k<96||k>111)&&(k<186||k>192)&&(k<219||k>222);if(_159||evt.ctrlKey){var c=_159?0:k;if(evt.ctrlKey){if(k==3||k==13){return;}else{if(c>95&&c<106){c-=48;}else{if((!evt.shiftKey)&&(c>=65&&c<=90)){c+=32;}else{c=del._punctMap[c]||c;}}}}var faux=del._synthesizeEvent(evt,{type:"keypress",faux:true,charCode:c});kp.call(evt.currentTarget,faux);if(dojo.isIE<9||(dojo.isIE&&dojo.isQuirks)){evt.cancelBubble=faux.cancelBubble;}evt.returnValue=faux.returnValue;_14a(evt,faux.keyCode);}},_stopPropagation:function(){this.cancelBubble=true;},_preventDefault:function(){this.bubbledKeyCode=this.keyCode;if(this.ctrlKey){_14a(this,0);}this.returnValue=false;}});dojo.stopEvent=(dojo.isIE<9||dojo.isQuirks)?function(evt){evt=evt||window.event;del._stopPropagation.call(evt);del._preventDefault.call(evt);}:dojo.stopEvent;}del._synthesizeEvent=function(evt,_15a){var faux=dojo.mixin({},evt,_15a);del._setKeyChar(faux);faux.preventDefault=function(){evt.preventDefault();};faux.stopPropagation=function(){evt.stopPropagation();};return faux;};if(dojo.isOpera){dojo.mixin(del,{_fixEvent:function(evt,_15b){switch(evt.type){case "keypress":var c=evt.which;if(c==3){c=99;}c=c<41&&!evt.shiftKey?0:c;if(evt.ctrlKey&&!evt.shiftKey&&c>=65&&c<=90){c+=32;}return del._synthesizeEvent(evt,{charCode:c});}return evt;}});}if(dojo.isWebKit){del._add=del.add;del._remove=del.remove;dojo.mixin(del,{add:function(node,_15c,fp){if(!node){return;}var _15d=del._add(node,_15c,fp);if(del._normalizeEventName(_15c)=="keypress"){_15d._stealthKeyDownHandle=del._add(node,"keydown",function(evt){var k=evt.keyCode;var _15e=k!=13&&k!=32&&(k<48||k>90)&&(k<96||k>111)&&(k<186||k>192)&&(k<219||k>222);if(_15e||evt.ctrlKey){var c=_15e?0:k;if(evt.ctrlKey){if(k==3||k==13){return;}else{if(c>95&&c<106){c-=48;}else{if(!evt.shiftKey&&c>=65&&c<=90){c+=32;}else{c=del._punctMap[c]||c;}}}}var faux=del._synthesizeEvent(evt,{type:"keypress",faux:true,charCode:c});fp.call(evt.currentTarget,faux);}});}return _15d;},remove:function(node,_15f,_160){if(node){if(_160._stealthKeyDownHandle){del._remove(node,"keydown",_160._stealthKeyDownHandle);}del._remove(node,_15f,_160);}},_fixEvent:function(evt,_161){switch(evt.type){case "keypress":if(evt.faux){return evt;}var c=evt.charCode;c=c>=32?c:0;return del._synthesizeEvent(evt,{charCode:c,faux:true});}return evt;}});}})();if(dojo.isIE){dojo._ieDispatcher=function(args,_162){var ap=Array.prototype,h=dojo._ie_listener.handlers,c=args.callee,ls=c[dojo._ieListenersName],t=h[c.target];var r=t&&t.apply(_162,args);var lls=[].concat(ls);for(var i in lls){var f=h[lls[i]];if(!(i in ap)&&f){f.apply(_162,args);}}return r;};dojo._getIeDispatcher=function(){return new Function(dojo._scopeName+"._ieDispatcher(arguments, this)");};dojo._event_listener._fixCallback=function(fp){var f=dojo._event_listener._fixEvent;return function(e){return fp.call(this,f(e,this));};};}}if(!dojo._hasResource["dojo._base.html"]){dojo._hasResource["dojo._base.html"]=true;dojo.provide("dojo._base.html");try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}if(dojo.isIE){dojo.byId=function(id,doc){if(typeof id!="string"){return id;}var _163=doc||dojo.doc,te=_163.getElementById(id);if(te&&(te.attributes.id.value==id||te.id==id)){return te;}else{var eles=_163.all[id];if(!eles||eles.nodeName){eles=[eles];}var i=0;while((te=eles[i++])){if((te.attributes&&te.attributes.id&&te.attributes.id.value==id)||te.id==id){return te;}}}};}else{dojo.byId=function(id,doc){return ((typeof id=="string")?(doc||dojo.doc).getElementById(id):id)||null;};}(function(){var d=dojo;var byId=d.byId;var _164=null,_165;d.addOnWindowUnload(function(){_164=null;});dojo._destroyElement=dojo.destroy=function(node){node=byId(node);try{var doc=node.ownerDocument;if(!_164||_165!=doc){_164=doc.createElement("div");_165=doc;}_164.appendChild(node.parentNode?node.parentNode.removeChild(node):node);_164.innerHTML="";}catch(e){}};dojo.isDescendant=function(node,_166){try{node=byId(node);_166=byId(_166);while(node){if(node==_166){return true;}node=node.parentNode;}}catch(e){}return false;};dojo.setSelectable=function(node,_167){node=byId(node);if(d.isMozilla){node.style.MozUserSelect=_167?"":"none";}else{if(d.isKhtml||d.isWebKit){node.style.KhtmlUserSelect=_167?"auto":"none";}else{if(d.isIE){var v=(node.unselectable=_167?"":"on");d.query("*",node).forEach("item.unselectable = '"+v+"'");}}}};var _168=function(node,ref){var _169=ref.parentNode;if(_169){_169.insertBefore(node,ref);}};var _16a=function(node,ref){var _16b=ref.parentNode;if(_16b){if(_16b.lastChild==ref){_16b.appendChild(node);}else{_16b.insertBefore(node,ref.nextSibling);}}};dojo.place=function(node,_16c,_16d){_16c=byId(_16c);if(typeof node=="string"){node=/^\s*</.test(node)?d._toDom(node,_16c.ownerDocument):byId(node);}if(typeof _16d=="number"){var cn=_16c.childNodes;if(!cn.length||cn.length<=_16d){_16c.appendChild(node);}else{_168(node,cn[_16d<0?0:_16d]);}}else{switch(_16d){case "before":_168(node,_16c);break;case "after":_16a(node,_16c);break;case "replace":_16c.parentNode.replaceChild(node,_16c);break;case "only":d.empty(_16c);_16c.appendChild(node);break;case "first":if(_16c.firstChild){_168(node,_16c.firstChild);break;}default:_16c.appendChild(node);}}return node;};dojo.boxModel="content-box";if(d.isIE){d.boxModel=document.compatMode=="BackCompat"?"border-box":"content-box";}var gcs;if(d.isWebKit){gcs=function(node){var s;if(node.nodeType==1){var dv=node.ownerDocument.defaultView;s=dv.getComputedStyle(node,null);if(!s&&node.style){node.style.display="";s=dv.getComputedStyle(node,null);}}return s||{};};}else{if(d.isIE){gcs=function(node){return node.nodeType==1?node.currentStyle:{};};}else{gcs=function(node){return node.nodeType==1?node.ownerDocument.defaultView.getComputedStyle(node,null):{};};}}dojo.getComputedStyle=gcs;if(!d.isIE){d._toPixelValue=function(_16e,_16f){return parseFloat(_16f)||0;};}else{d._toPixelValue=function(_170,_171){if(!_171){return 0;}if(_171=="medium"){return 4;}if(_171.slice&&_171.slice(-2)=="px"){return parseFloat(_171);}with(_170){var _172=style.left;var _173=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=_171;_171=style.pixelLeft;}catch(e){_171=0;}style.left=_172;runtimeStyle.left=_173;}return _171;};}var px=d._toPixelValue;var astr="DXImageTransform.Microsoft.Alpha";var af=function(n,f){try{return n.filters.item(astr);}catch(e){return f?{}:null;}};dojo._getOpacity=d.isIE<9?function(node){try{return af(node).Opacity/100;}catch(e){return 1;}}:function(node){return gcs(node).opacity;};dojo._setOpacity=d.isIE<9?function(node,_174){var ov=_174*100,_175=_174==1;node.style.zoom=_175?"":1;if(!af(node)){if(_175){return _174;}node.style.filter+=" progid:"+astr+"(Opacity="+ov+")";}else{af(node,1).Opacity=ov;}af(node,1).Enabled=!_175;if(node.nodeName.toLowerCase()=="tr"){d.query("> td",node).forEach(function(i){d._setOpacity(i,_174);});}return _174;}:function(node,_176){return node.style.opacity=_176;};var _177={left:true,top:true};var _178=/margin|padding|width|height|max|min|offset/;var _179=function(node,type,_17a){type=type.toLowerCase();if(d.isIE){if(_17a=="auto"){if(type=="height"){return node.offsetHeight;}if(type=="width"){return node.offsetWidth;}}if(type=="fontweight"){switch(_17a){case 700:return "bold";case 400:default:return "normal";}}}if(!(type in _177)){_177[type]=_178.test(type);}return _177[type]?px(node,_17a):_17a;};var _17b=d.isIE?"styleFloat":"cssFloat",_17c={"cssFloat":_17b,"styleFloat":_17b,"float":_17b};dojo.style=function(node,_17d,_17e){var n=byId(node),args=arguments.length,op=(_17d=="opacity");_17d=_17c[_17d]||_17d;if(args==3){return op?d._setOpacity(n,_17e):n.style[_17d]=_17e;}if(args==2&&op){return d._getOpacity(n);}var s=gcs(n);if(args==2&&typeof _17d!="string"){for(var x in _17d){d.style(node,x,_17d[x]);}return s;}return (args==1)?s:_179(n,_17d,s[_17d]||n.style[_17d]);};dojo._getPadExtents=function(n,_17f){var s=_17f||gcs(n),l=px(n,s.paddingLeft),t=px(n,s.paddingTop);return {l:l,t:t,w:l+px(n,s.paddingRight),h:t+px(n,s.paddingBottom)};};dojo._getBorderExtents=function(n,_180){var ne="none",s=_180||gcs(n),bl=(s.borderLeftStyle!=ne?px(n,s.borderLeftWidth):0),bt=(s.borderTopStyle!=ne?px(n,s.borderTopWidth):0);return {l:bl,t:bt,w:bl+(s.borderRightStyle!=ne?px(n,s.borderRightWidth):0),h:bt+(s.borderBottomStyle!=ne?px(n,s.borderBottomWidth):0)};};dojo._getPadBorderExtents=function(n,_181){var s=_181||gcs(n),p=d._getPadExtents(n,s),b=d._getBorderExtents(n,s);return {l:p.l+b.l,t:p.t+b.t,w:p.w+b.w,h:p.h+b.h};};dojo._getMarginExtents=function(n,_182){var s=_182||gcs(n),l=px(n,s.marginLeft),t=px(n,s.marginTop),r=px(n,s.marginRight),b=px(n,s.marginBottom);if(d.isWebKit&&(s.position!="absolute")){r=l;}return {l:l,t:t,w:l+r,h:t+b};};dojo._getMarginBox=function(node,_183){var s=_183||gcs(node),me=d._getMarginExtents(node,s);var l=node.offsetLeft-me.l,t=node.offsetTop-me.t,p=node.parentNode;if(d.isMoz){var sl=parseFloat(s.left),st=parseFloat(s.top);if(!isNaN(sl)&&!isNaN(st)){l=sl,t=st;}else{if(p&&p.style){var pcs=gcs(p);if(pcs.overflow!="visible"){var be=d._getBorderExtents(p,pcs);l+=be.l,t+=be.t;}}}}else{if(d.isOpera||(d.isIE>7&&!d.isQuirks)){if(p){be=d._getBorderExtents(p);l-=be.l;t-=be.t;}}}return {l:l,t:t,w:node.offsetWidth+me.w,h:node.offsetHeight+me.h};};dojo._getMarginSize=function(node,_184){node=byId(node);var me=d._getMarginExtents(node,_184||gcs(node));var size=node.getBoundingClientRect();return {w:(size.right-size.left)+me.w,h:(size.bottom-size.top)+me.h};};dojo._getContentBox=function(node,_185){var s=_185||gcs(node),pe=d._getPadExtents(node,s),be=d._getBorderExtents(node,s),w=node.clientWidth,h;if(!w){w=node.offsetWidth,h=node.offsetHeight;}else{h=node.clientHeight,be.w=be.h=0;}if(d.isOpera){pe.l+=be.l;pe.t+=be.t;}return {l:pe.l,t:pe.t,w:w-pe.w-be.w,h:h-pe.h-be.h};};dojo._getBorderBox=function(node,_186){var s=_186||gcs(node),pe=d._getPadExtents(node,s),cb=d._getContentBox(node,s);return {l:cb.l-pe.l,t:cb.t-pe.t,w:cb.w+pe.w,h:cb.h+pe.h};};dojo._setBox=function(node,l,t,w,h,u){u=u||"px";var s=node.style;if(!isNaN(l)){s.left=l+u;}if(!isNaN(t)){s.top=t+u;}if(w>=0){s.width=w+u;}if(h>=0){s.height=h+u;}};dojo._isButtonTag=function(node){return node.tagName=="BUTTON"||node.tagName=="INPUT"&&(node.getAttribute("type")||"").toUpperCase()=="BUTTON";};dojo._usesBorderBox=function(node){var n=node.tagName;return d.boxModel=="border-box"||n=="TABLE"||d._isButtonTag(node);};dojo._setContentSize=function(node,_187,_188,_189){if(d._usesBorderBox(node)){var pb=d._getPadBorderExtents(node,_189);if(_187>=0){_187+=pb.w;}if(_188>=0){_188+=pb.h;}}d._setBox(node,NaN,NaN,_187,_188);};dojo._setMarginBox=function(node,_18a,_18b,_18c,_18d,_18e){var s=_18e||gcs(node),bb=d._usesBorderBox(node),pb=bb?_18f:d._getPadBorderExtents(node,s);if(d.isWebKit){if(d._isButtonTag(node)){var ns=node.style;if(_18c>=0&&!ns.width){ns.width="4px";}if(_18d>=0&&!ns.height){ns.height="4px";}}}var mb=d._getMarginExtents(node,s);if(_18c>=0){_18c=Math.max(_18c-pb.w-mb.w,0);}if(_18d>=0){_18d=Math.max(_18d-pb.h-mb.h,0);}d._setBox(node,_18a,_18b,_18c,_18d);};var _18f={l:0,t:0,w:0,h:0};dojo.marginBox=function(node,box){var n=byId(node),s=gcs(n),b=box;return !b?d._getMarginBox(n,s):d._setMarginBox(n,b.l,b.t,b.w,b.h,s);};dojo.contentBox=function(node,box){var n=byId(node),s=gcs(n),b=box;return !b?d._getContentBox(n,s):d._setContentSize(n,b.w,b.h,s);};var _190=function(node,prop){if(!(node=(node||0).parentNode)){return 0;}var val,_191=0,_192=d.body();while(node&&node.style){if(gcs(node).position=="fixed"){return 0;}val=node[prop];if(val){_191+=val-0;if(node==_192){break;}}node=node.parentNode;}return _191;};dojo._docScroll=function(){var n=d.global;return "pageXOffset" in n?{x:n.pageXOffset,y:n.pageYOffset}:(n=d.isQuirks?d.doc.body:d.doc.documentElement,{x:d._fixIeBiDiScrollLeft(n.scrollLeft||0),y:n.scrollTop||0});};dojo._isBodyLtr=function(){return "_bodyLtr" in d?d._bodyLtr:d._bodyLtr=(d.body().dir||d.doc.documentElement.dir||"ltr").toLowerCase()=="ltr";};dojo._getIeDocumentElementOffset=function(){var de=d.doc.documentElement;if(d.isIE<8){var r=de.getBoundingClientRect();var l=r.left,t=r.top;if(d.isIE<7){l+=de.clientLeft;t+=de.clientTop;}return {x:l<0?0:l,y:t<0?0:t};}else{return {x:0,y:0};}};dojo._fixIeBiDiScrollLeft=function(_193){var ie=d.isIE;if(ie&&!d._isBodyLtr()){var qk=d.isQuirks,de=qk?d.doc.body:d.doc.documentElement;if(ie==6&&!qk&&d.global.frameElement&&de.scrollHeight>de.clientHeight){_193+=de.clientLeft;}return (ie<8||qk)?(_193+de.clientWidth-de.scrollWidth):-_193;}return _193;};dojo._abs=dojo.position=function(node,_194){node=byId(node);var db=d.body(),dh=db.parentNode,ret=node.getBoundingClientRect();ret={x:ret.left,y:ret.top,w:ret.right-ret.left,h:ret.bottom-ret.top};if(d.isIE){var _195=d._getIeDocumentElementOffset();ret.x-=_195.x+(d.isQuirks?db.clientLeft+db.offsetLeft:0);ret.y-=_195.y+(d.isQuirks?db.clientTop+db.offsetTop:0);}else{if(d.isFF==3){var cs=gcs(dh);ret.x-=px(dh,cs.marginLeft)+px(dh,cs.borderLeftWidth);ret.y-=px(dh,cs.marginTop)+px(dh,cs.borderTopWidth);}}if(_194){var _196=d._docScroll();ret.x+=_196.x;ret.y+=_196.y;}return ret;};dojo.coords=function(node,_197){var n=byId(node),s=gcs(n),mb=d._getMarginBox(n,s);var abs=d.position(n,_197);mb.x=abs.x;mb.y=abs.y;return mb;};var _198={"class":"className","for":"htmlFor",tabindex:"tabIndex",readonly:"readOnly",colspan:"colSpan",frameborder:"frameBorder",rowspan:"rowSpan",valuetype:"valueType"},_199={classname:"class",htmlfor:"for",tabindex:"tabIndex",readonly:"readOnly"},_19a={innerHTML:1,className:1,htmlFor:d.isIE,value:1};var _19b=function(name){return _199[name.toLowerCase()]||name;};var _19c=function(node,name){var attr=node.getAttributeNode&&node.getAttributeNode(name);return attr&&attr.specified;};dojo.hasAttr=function(node,name){var lc=name.toLowerCase();return _19a[_198[lc]||name]||_19c(byId(node),_199[lc]||name);};var _19d={},_19e=0,_19f=dojo._scopeName+"attrid",_1a0={col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1};dojo.attr=function(node,name,_1a1){node=byId(node);var args=arguments.length,prop;if(args==2&&typeof name!="string"){for(var x in name){d.attr(node,x,name[x]);}return node;}var lc=name.toLowerCase(),_1a2=_198[lc]||name,_1a3=_19a[_1a2],_1a4=_199[lc]||name;if(args==3){do{if(_1a2=="style"&&typeof _1a1!="string"){d.style(node,_1a1);break;}if(_1a2=="innerHTML"){if(d.isIE&&node.tagName.toLowerCase() in _1a0){d.empty(node);node.appendChild(d._toDom(_1a1,node.ownerDocument));}else{node[_1a2]=_1a1;}break;}if(d.isFunction(_1a1)){var _1a5=d.attr(node,_19f);if(!_1a5){_1a5=_19e++;d.attr(node,_19f,_1a5);}if(!_19d[_1a5]){_19d[_1a5]={};}var h=_19d[_1a5][_1a2];if(h){d.disconnect(h);}else{try{delete node[_1a2];}catch(e){}}_19d[_1a5][_1a2]=d.connect(node,_1a2,_1a1);break;}if(_1a3||typeof _1a1=="boolean"){node[_1a2]=_1a1;break;}node.setAttribute(_1a4,_1a1);}while(false);return node;}_1a1=node[_1a2];if(_1a3&&typeof _1a1!="undefined"){return _1a1;}if(_1a2!="href"&&(typeof _1a1=="boolean"||d.isFunction(_1a1))){return _1a1;}return _19c(node,_1a4)?node.getAttribute(_1a4):null;};dojo.removeAttr=function(node,name){byId(node).removeAttribute(_19b(name));};dojo.getNodeProp=function(node,name){node=byId(node);var lc=name.toLowerCase(),_1a6=_198[lc]||name;if((_1a6 in node)&&_1a6!="href"){return node[_1a6];}var _1a7=_199[lc]||name;return _19c(node,_1a7)?node.getAttribute(_1a7):null;};dojo.create=function(tag,_1a8,_1a9,pos){var doc=d.doc;if(_1a9){_1a9=byId(_1a9);doc=_1a9.ownerDocument;}if(typeof tag=="string"){tag=doc.createElement(tag);}if(_1a8){d.attr(tag,_1a8);}if(_1a9){d.place(tag,_1a9,pos);}return tag;};d.empty=d.isIE?function(node){node=byId(node);for(var c;c=node.lastChild;){d.destroy(c);}}:function(node){byId(node).innerHTML="";};var _1aa={option:["select"],tbody:["table"],thead:["table"],tfoot:["table"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","thead","tr"],legend:["fieldset"],caption:["table"],colgroup:["table"],col:["table","colgroup"],li:["ul"]},_1ab=/<\s*([\w\:]+)/,_1ac={},_1ad=0,_1ae="__"+d._scopeName+"ToDomId";for(var _1af in _1aa){if(_1aa.hasOwnProperty(_1af)){var tw=_1aa[_1af];tw.pre=_1af=="option"?"<select multiple=\"multiple\">":"<"+tw.join("><")+">";tw.post="</"+tw.reverse().join("></")+">";}}d._toDom=function(frag,doc){doc=doc||d.doc;var _1b0=doc[_1ae];if(!_1b0){doc[_1ae]=_1b0=++_1ad+"";_1ac[_1b0]=doc.createElement("div");}frag+="";var _1b1=frag.match(_1ab),tag=_1b1?_1b1[1].toLowerCase():"",_1b2=_1ac[_1b0],wrap,i,fc,df;if(_1b1&&_1aa[tag]){wrap=_1aa[tag];_1b2.innerHTML=wrap.pre+frag+wrap.post;for(i=wrap.length;i;--i){_1b2=_1b2.firstChild;}}else{_1b2.innerHTML=frag;}if(_1b2.childNodes.length==1){return _1b2.removeChild(_1b2.firstChild);}df=doc.createDocumentFragment();while(fc=_1b2.firstChild){df.appendChild(fc);}return df;};var _1b3="className";dojo.hasClass=function(node,_1b4){return ((" "+byId(node)[_1b3]+" ").indexOf(" "+_1b4+" ")>=0);};var _1b5=/\s+/,a1=[""],_1b6={},_1b7=function(s){if(typeof s=="string"||s instanceof String){if(s.indexOf(" ")<0){a1[0]=s;return a1;}else{return s.split(_1b5);}}return s||"";};dojo.addClass=function(node,_1b8){node=byId(node);_1b8=_1b7(_1b8);var cls=node[_1b3],_1b9;cls=cls?" "+cls+" ":" ";_1b9=cls.length;for(var i=0,len=_1b8.length,c;i<len;++i){c=_1b8[i];if(c&&cls.indexOf(" "+c+" ")<0){cls+=c+" ";}}if(_1b9<cls.length){node[_1b3]=cls.substr(1,cls.length-2);}};dojo.removeClass=function(node,_1ba){node=byId(node);var cls;if(_1ba!==undefined){_1ba=_1b7(_1ba);cls=" "+node[_1b3]+" ";for(var i=0,len=_1ba.length;i<len;++i){cls=cls.replace(" "+_1ba[i]+" "," ");}cls=d.trim(cls);}else{cls="";}if(node[_1b3]!=cls){node[_1b3]=cls;}};dojo.replaceClass=function(node,_1bb,_1bc){node=byId(node);_1b6.className=node.className;dojo.removeClass(_1b6,_1bc);dojo.addClass(_1b6,_1bb);if(node.className!==_1b6.className){node.className=_1b6.className;}};dojo.toggleClass=function(node,_1bd,_1be){if(_1be===undefined){_1be=!d.hasClass(node,_1bd);}d[_1be?"addClass":"removeClass"](node,_1bd);};})();}if(!dojo._hasResource["dojo._base.NodeList"]){dojo._hasResource["dojo._base.NodeList"]=true;dojo.provide("dojo._base.NodeList");(function(){var d=dojo;var ap=Array.prototype,aps=ap.slice,apc=ap.concat;var tnl=function(a,_1bf,_1c0){if(!a.sort){a=aps.call(a,0);}var ctor=_1c0||this._NodeListCtor||d._NodeListCtor;a.constructor=ctor;dojo._mixin(a,ctor.prototype);a._NodeListCtor=ctor;return _1bf?a._stash(_1bf):a;};var _1c1=function(f,a,o){a=[0].concat(aps.call(a,0));o=o||d.global;return function(node){a[0]=node;return f.apply(o,a);};};var _1c2=function(f,o){return function(){this.forEach(_1c1(f,arguments,o));return this;};};var _1c3=function(f,o){return function(){return this.map(_1c1(f,arguments,o));};};var _1c4=function(f,o){return function(){return this.filter(_1c1(f,arguments,o));};};var _1c5=function(f,g,o){return function(){var a=arguments,body=_1c1(f,a,o);if(g.call(o||d.global,a)){return this.map(body);}this.forEach(body);return this;};};var _1c6=function(a){return a.length==1&&(typeof a[0]=="string");};var _1c7=function(node){var p=node.parentNode;if(p){p.removeChild(node);}};dojo.NodeList=function(){return tnl(Array.apply(null,arguments));};d._NodeListCtor=d.NodeList;var nl=d.NodeList,nlp=nl.prototype;nl._wrap=nlp._wrap=tnl;nl._adaptAsMap=_1c3;nl._adaptAsForEach=_1c2;nl._adaptAsFilter=_1c4;nl._adaptWithCondition=_1c5;d.forEach(["slice","splice"],function(name){var f=ap[name];nlp[name]=function(){return this._wrap(f.apply(this,arguments),name=="slice"?this:null);};});d.forEach(["indexOf","lastIndexOf","every","some"],function(name){var f=d[name];nlp[name]=function(){return f.apply(d,[this].concat(aps.call(arguments,0)));};});d.forEach(["attr","style"],function(name){nlp[name]=_1c5(d[name],_1c6);});d.forEach(["connect","addClass","removeClass","replaceClass","toggleClass","empty","removeAttr"],function(name){nlp[name]=_1c2(d[name]);});dojo.extend(dojo.NodeList,{_normalize:function(_1c8,_1c9){var _1ca=_1c8.parse===true?true:false;if(typeof _1c8.template=="string"){var _1cb=_1c8.templateFunc||(dojo.string&&dojo.string.substitute);_1c8=_1cb?_1cb(_1c8.template,_1c8):_1c8;}var type=(typeof _1c8);if(type=="string"||type=="number"){_1c8=dojo._toDom(_1c8,(_1c9&&_1c9.ownerDocument));if(_1c8.nodeType==11){_1c8=dojo._toArray(_1c8.childNodes);}else{_1c8=[_1c8];}}else{if(!dojo.isArrayLike(_1c8)){_1c8=[_1c8];}else{if(!dojo.isArray(_1c8)){_1c8=dojo._toArray(_1c8);}}}if(_1ca){_1c8._runParse=true;}return _1c8;},_cloneNode:function(node){return node.cloneNode(true);},_place:function(ary,_1cc,_1cd,_1ce){if(_1cc.nodeType!=1&&_1cd=="only"){return;}var _1cf=_1cc,_1d0;var _1d1=ary.length;for(var i=_1d1-1;i>=0;i--){var node=(_1ce?this._cloneNode(ary[i]):ary[i]);if(ary._runParse&&dojo.parser&&dojo.parser.parse){if(!_1d0){_1d0=_1cf.ownerDocument.createElement("div");}_1d0.appendChild(node);dojo.parser.parse(_1d0);node=_1d0.firstChild;while(_1d0.firstChild){_1d0.removeChild(_1d0.firstChild);}}if(i==_1d1-1){dojo.place(node,_1cf,_1cd);}else{_1cf.parentNode.insertBefore(node,_1cf);}_1cf=node;}},_stash:function(_1d2){this._parent=_1d2;return this;},end:function(){if(this._parent){return this._parent;}else{return new this._NodeListCtor();}},concat:function(item){var t=d.isArray(this)?this:aps.call(this,0),m=d.map(arguments,function(a){return a&&!d.isArray(a)&&(typeof NodeList!="undefined"&&a.constructor===NodeList||a.constructor===this._NodeListCtor)?aps.call(a,0):a;});return this._wrap(apc.apply(t,m),this);},map:function(func,obj){return this._wrap(d.map(this,func,obj),this);},forEach:function(_1d3,_1d4){d.forEach(this,_1d3,_1d4);return this;},coords:_1c3(d.coords),position:_1c3(d.position),place:function(_1d5,_1d6){var item=d.query(_1d5)[0];return this.forEach(function(node){d.place(node,item,_1d6);});},orphan:function(_1d7){return (_1d7?d._filterQueryResult(this,_1d7):this).forEach(_1c7);},adopt:function(_1d8,_1d9){return d.query(_1d8).place(this[0],_1d9)._stash(this);},query:function(_1da){if(!_1da){return this;}var ret=this.map(function(node){return d.query(_1da,node).filter(function(_1db){return _1db!==undefined;});});return this._wrap(apc.apply([],ret),this);},filter:function(_1dc){var a=arguments,_1dd=this,_1de=0;if(typeof _1dc=="string"){_1dd=d._filterQueryResult(this,a[0]);if(a.length==1){return _1dd._stash(this);}_1de=1;}return this._wrap(d.filter(_1dd,a[_1de],a[_1de+1]),this);},addContent:function(_1df,_1e0){_1df=this._normalize(_1df,this[0]);for(var i=0,node;(node=this[i]);i++){this._place(_1df,node,_1e0,i>0);}return this;},instantiate:function(_1e1,_1e2){var c=d.isFunction(_1e1)?_1e1:d.getObject(_1e1);_1e2=_1e2||{};return this.forEach(function(node){new c(_1e2,node);});},at:function(){var t=new this._NodeListCtor();d.forEach(arguments,function(i){if(i<0){i=this.length+i;}if(this[i]){t.push(this[i]);}},this);return t._stash(this);}});nl.events=["blur","focus","change","click","error","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","submit"];d.forEach(nl.events,function(evt){var _1e3="on"+evt;nlp[_1e3]=function(a,b){return this.connect(_1e3,a,b);};});})();}if(!dojo._hasResource["dojo._base.query"]){dojo._hasResource["dojo._base.query"]=true;(function(){var _1e4=function(d){var trim=d.trim;var each=d.forEach;var qlc=(d._NodeListCtor=d.NodeList);var _1e5=function(){return d.doc;};var _1e6=((d.isWebKit||d.isMozilla)&&((_1e5().compatMode)=="BackCompat"));var _1e7=!!_1e5().firstChild["children"]?"children":"childNodes";var _1e8=">~+";var _1e9=false;var _1ea=function(){return true;};var _1eb=function(_1ec){if(_1e8.indexOf(_1ec.slice(-1))>=0){_1ec+=" * ";}else{_1ec+=" ";}var ts=function(s,e){return trim(_1ec.slice(s,e));};var _1ed=[];var _1ee=-1,_1ef=-1,_1f0=-1,_1f1=-1,_1f2=-1,inId=-1,_1f3=-1,lc="",cc="",_1f4;var x=0,ql=_1ec.length,_1f5=null,_1f6=null;var _1f7=function(){if(_1f3>=0){var tv=(_1f3==x)?null:ts(_1f3,x);_1f5[(_1e8.indexOf(tv)<0)?"tag":"oper"]=tv;_1f3=-1;}};var _1f8=function(){if(inId>=0){_1f5.id=ts(inId,x).replace(/\\/g,"");inId=-1;}};var _1f9=function(){if(_1f2>=0){_1f5.classes.push(ts(_1f2+1,x).replace(/\\/g,""));_1f2=-1;}};var _1fa=function(){_1f8();_1f7();_1f9();};var _1fb=function(){_1fa();if(_1f1>=0){_1f5.pseudos.push({name:ts(_1f1+1,x)});}_1f5.loops=(_1f5.pseudos.length||_1f5.attrs.length||_1f5.classes.length);_1f5.oquery=_1f5.query=ts(_1f4,x);_1f5.otag=_1f5.tag=(_1f5["oper"])?null:(_1f5.tag||"*");if(_1f5.tag){_1f5.tag=_1f5.tag.toUpperCase();}if(_1ed.length&&(_1ed[_1ed.length-1].oper)){_1f5.infixOper=_1ed.pop();_1f5.query=_1f5.infixOper.query+" "+_1f5.query;}_1ed.push(_1f5);_1f5=null;};for(;lc=cc,cc=_1ec.charAt(x),x<ql;x++){if(lc=="\\"){continue;}if(!_1f5){_1f4=x;_1f5={query:null,pseudos:[],attrs:[],classes:[],tag:null,oper:null,id:null,getTag:function(){return (_1e9)?this.otag:this.tag;}};_1f3=x;}if(_1ee>=0){if(cc=="]"){if(!_1f6.attr){_1f6.attr=ts(_1ee+1,x);}else{_1f6.matchFor=ts((_1f0||_1ee+1),x);}var cmf=_1f6.matchFor;if(cmf){if((cmf.charAt(0)=="\"")||(cmf.charAt(0)=="'")){_1f6.matchFor=cmf.slice(1,-1);}}_1f5.attrs.push(_1f6);_1f6=null;_1ee=_1f0=-1;}else{if(cc=="="){var _1fc=("|~^$*".indexOf(lc)>=0)?lc:"";_1f6.type=_1fc+cc;_1f6.attr=ts(_1ee+1,x-_1fc.length);_1f0=x+1;}}}else{if(_1ef>=0){if(cc==")"){if(_1f1>=0){_1f6.value=ts(_1ef+1,x);}_1f1=_1ef=-1;}}else{if(cc=="#"){_1fa();inId=x+1;}else{if(cc=="."){_1fa();_1f2=x;}else{if(cc==":"){_1fa();_1f1=x;}else{if(cc=="["){_1fa();_1ee=x;_1f6={};}else{if(cc=="("){if(_1f1>=0){_1f6={name:ts(_1f1+1,x),value:null};_1f5.pseudos.push(_1f6);}_1ef=x;}else{if((cc==" ")&&(lc!=cc)){_1fb();}}}}}}}}}return _1ed;};var _1fd=function(_1fe,_1ff){if(!_1fe){return _1ff;}if(!_1ff){return _1fe;}return function(){return _1fe.apply(window,arguments)&&_1ff.apply(window,arguments);};};var _200=function(i,arr){var r=arr||[];if(i){r.push(i);}return r;};var _201=function(n){return (1==n.nodeType);};var _202="";var _203=function(elem,attr){if(!elem){return _202;}if(attr=="class"){return elem.className||_202;}if(attr=="for"){return elem.htmlFor||_202;}if(attr=="style"){return elem.style.cssText||_202;}return (_1e9?elem.getAttribute(attr):elem.getAttribute(attr,2))||_202;};var _204={"*=":function(attr,_205){return function(elem){return (_203(elem,attr).indexOf(_205)>=0);};},"^=":function(attr,_206){return function(elem){return (_203(elem,attr).indexOf(_206)==0);};},"$=":function(attr,_207){var tval=" "+_207;return function(elem){var ea=" "+_203(elem,attr);return (ea.lastIndexOf(_207)==(ea.length-_207.length));};},"~=":function(attr,_208){var tval=" "+_208+" ";return function(elem){var ea=" "+_203(elem,attr)+" ";return (ea.indexOf(tval)>=0);};},"|=":function(attr,_209){var _20a=" "+_209+"-";return function(elem){var ea=" "+_203(elem,attr);return ((ea==_209)||(ea.indexOf(_20a)==0));};},"=":function(attr,_20b){return function(elem){return (_203(elem,attr)==_20b);};}};var _20c=(typeof _1e5().firstChild.nextElementSibling=="undefined");var _20d=!_20c?"nextElementSibling":"nextSibling";var _20e=!_20c?"previousElementSibling":"previousSibling";var _20f=(_20c?_201:_1ea);var _210=function(node){while(node=node[_20e]){if(_20f(node)){return false;}}return true;};var _211=function(node){while(node=node[_20d]){if(_20f(node)){return false;}}return true;};var _212=function(node){var root=node.parentNode;var i=0,tret=root[_1e7],ci=(node["_i"]||-1),cl=(root["_l"]||-1);if(!tret){return -1;}var l=tret.length;if(cl==l&&ci>=0&&cl>=0){return ci;}root["_l"]=l;ci=-1;for(var te=root["firstElementChild"]||root["firstChild"];te;te=te[_20d]){if(_20f(te)){te["_i"]=++i;if(node===te){ci=i;}}}return ci;};var _213=function(elem){return !((_212(elem))%2);};var _214=function(elem){return ((_212(elem))%2);};var _215={"checked":function(name,_216){return function(elem){return !!("checked" in elem?elem.checked:elem.selected);};},"first-child":function(){return _210;},"last-child":function(){return _211;},"only-child":function(name,_217){return function(node){if(!_210(node)){return false;}if(!_211(node)){return false;}return true;};},"empty":function(name,_218){return function(elem){var cn=elem.childNodes;var cnl=elem.childNodes.length;for(var x=cnl-1;x>=0;x--){var nt=cn[x].nodeType;if((nt===1)||(nt==3)){return false;}}return true;};},"contains":function(name,_219){var cz=_219.charAt(0);if(cz=="\""||cz=="'"){_219=_219.slice(1,-1);}return function(elem){return (elem.innerHTML.indexOf(_219)>=0);};},"not":function(name,_21a){var p=_1eb(_21a)[0];var _21b={el:1};if(p.tag!="*"){_21b.tag=1;}if(!p.classes.length){_21b.classes=1;}var ntf=_21c(p,_21b);return function(elem){return (!ntf(elem));};},"nth-child":function(name,_21d){var pi=parseInt;if(_21d=="odd"){return _214;}else{if(_21d=="even"){return _213;}}if(_21d.indexOf("n")!=-1){var _21e=_21d.split("n",2);var pred=_21e[0]?((_21e[0]=="-")?-1:pi(_21e[0])):1;var idx=_21e[1]?pi(_21e[1]):0;var lb=0,ub=-1;if(pred>0){if(idx<0){idx=(idx%pred)&&(pred+(idx%pred));}else{if(idx>0){if(idx>=pred){lb=idx-idx%pred;}idx=idx%pred;}}}else{if(pred<0){pred*=-1;if(idx>0){ub=idx;idx=idx%pred;}}}if(pred>0){return function(elem){var i=_212(elem);return (i>=lb)&&(ub<0||i<=ub)&&((i%pred)==idx);};}else{_21d=idx;}}var _21f=pi(_21d);return function(elem){return (_212(elem)==_21f);};}};var _220=(d.isIE<9||(dojo.isIE&&dojo.isQuirks))?function(cond){var clc=cond.toLowerCase();if(clc=="class"){cond="className";}return function(elem){return (_1e9?elem.getAttribute(cond):elem[cond]||elem[clc]);};}:function(cond){return function(elem){return (elem&&elem.getAttribute&&elem.hasAttribute(cond));};};var _21c=function(_221,_222){if(!_221){return _1ea;}_222=_222||{};var ff=null;if(!("el" in _222)){ff=_1fd(ff,_201);}if(!("tag" in _222)){if(_221.tag!="*"){ff=_1fd(ff,function(elem){return (elem&&(elem.tagName==_221.getTag()));});}}if(!("classes" in _222)){each(_221.classes,function(_223,idx,arr){var re=new RegExp("(?:^|\\s)"+_223+"(?:\\s|$)");ff=_1fd(ff,function(elem){return re.test(elem.className);});ff.count=idx;});}if(!("pseudos" in _222)){each(_221.pseudos,function(_224){var pn=_224.name;if(_215[pn]){ff=_1fd(ff,_215[pn](pn,_224.value));}});}if(!("attrs" in _222)){each(_221.attrs,function(attr){var _225;var a=attr.attr;if(attr.type&&_204[attr.type]){_225=_204[attr.type](a,attr.matchFor);}else{if(a.length){_225=_220(a);}}if(_225){ff=_1fd(ff,_225);}});}if(!("id" in _222)){if(_221.id){ff=_1fd(ff,function(elem){return (!!elem&&(elem.id==_221.id));});}}if(!ff){if(!("default" in _222)){ff=_1ea;}}return ff;};var _226=function(_227){return function(node,ret,bag){while(node=node[_20d]){if(_20c&&(!_201(node))){continue;}if((!bag||_228(node,bag))&&_227(node)){ret.push(node);}break;}return ret;};};var _229=function(_22a){return function(root,ret,bag){var te=root[_20d];while(te){if(_20f(te)){if(bag&&!_228(te,bag)){break;}if(_22a(te)){ret.push(te);}}te=te[_20d];}return ret;};};var _22b=function(_22c){_22c=_22c||_1ea;return function(root,ret,bag){var te,x=0,tret=root[_1e7];while(te=tret[x++]){if(_20f(te)&&(!bag||_228(te,bag))&&(_22c(te,x))){ret.push(te);}}return ret;};};var _22d=function(node,root){var pn=node.parentNode;while(pn){if(pn==root){break;}pn=pn.parentNode;}return !!pn;};var _22e={};var _22f=function(_230){var _231=_22e[_230.query];if(_231){return _231;}var io=_230.infixOper;var oper=(io?io.oper:"");var _232=_21c(_230,{el:1});var qt=_230.tag;var _233=("*"==qt);var ecs=_1e5()["getElementsByClassName"];if(!oper){if(_230.id){_232=(!_230.loops&&_233)?_1ea:_21c(_230,{el:1,id:1});_231=function(root,arr){var te=d.byId(_230.id,(root.ownerDocument||root));if(!te||!_232(te)){return;}if(9==root.nodeType){return _200(te,arr);}else{if(_22d(te,root)){return _200(te,arr);}}};}else{if(ecs&&/\{\s*\[native code\]\s*\}/.test(String(ecs))&&_230.classes.length&&!_1e6){_232=_21c(_230,{el:1,classes:1,id:1});var _234=_230.classes.join(" ");_231=function(root,arr,bag){var ret=_200(0,arr),te,x=0;var tret=root.getElementsByClassName(_234);while((te=tret[x++])){if(_232(te,root)&&_228(te,bag)){ret.push(te);}}return ret;};}else{if(!_233&&!_230.loops){_231=function(root,arr,bag){var ret=_200(0,arr),te,x=0;var tret=root.getElementsByTagName(_230.getTag());while((te=tret[x++])){if(_228(te,bag)){ret.push(te);}}return ret;};}else{_232=_21c(_230,{el:1,tag:1,id:1});_231=function(root,arr,bag){var ret=_200(0,arr),te,x=0;var tret=root.getElementsByTagName(_230.getTag());while((te=tret[x++])){if(_232(te,root)&&_228(te,bag)){ret.push(te);}}return ret;};}}}}else{var _235={el:1};if(_233){_235.tag=1;}_232=_21c(_230,_235);if("+"==oper){_231=_226(_232);}else{if("~"==oper){_231=_229(_232);}else{if(">"==oper){_231=_22b(_232);}}}}return _22e[_230.query]=_231;};var _236=function(root,_237){var _238=_200(root),qp,x,te,qpl=_237.length,bag,ret;for(var i=0;i<qpl;i++){ret=[];qp=_237[i];x=_238.length-1;if(x>0){bag={};ret.nozip=true;}var gef=_22f(qp);for(var j=0;(te=_238[j]);j++){gef(te,ret,bag);}if(!ret.length){break;}_238=ret;}return ret;};var _239={},_23a={};var _23b=function(_23c){var _23d=_1eb(trim(_23c));if(_23d.length==1){var tef=_22f(_23d[0]);return function(root){var r=tef(root,new qlc());if(r){r.nozip=true;}return r;};}return function(root){return _236(root,_23d);};};var nua=navigator.userAgent;var wk="WebKit/";var _23e=(d.isWebKit&&(nua.indexOf(wk)>0)&&(parseFloat(nua.split(wk)[1])>528));var _23f=d.isIE?"commentStrip":"nozip";var qsa="querySelectorAll";var _240=(!!_1e5()[qsa]&&(!d.isSafari||(d.isSafari>3.1)||_23e));var _241=/n\+\d|([^ ])?([>~+])([^ =])?/g;var _242=function(_243,pre,ch,post){return ch?(pre?pre+" ":"")+ch+(post?" "+post:""):_243;};var _244=function(_245,_246){_245=_245.replace(_241,_242);if(_240){var _247=_23a[_245];if(_247&&!_246){return _247;}}var _248=_239[_245];if(_248){return _248;}var qcz=_245.charAt(0);var _249=(-1==_245.indexOf(" "));if((_245.indexOf("#")>=0)&&(_249)){_246=true;}var _24a=(_240&&(!_246)&&(_1e8.indexOf(qcz)==-1)&&(!d.isIE||(_245.indexOf(":")==-1))&&(!(_1e6&&(_245.indexOf(".")>=0)))&&(_245.indexOf(":contains")==-1)&&(_245.indexOf(":checked")==-1)&&(_245.indexOf("|=")==-1));if(_24a){var tq=(_1e8.indexOf(_245.charAt(_245.length-1))>=0)?(_245+" *"):_245;return _23a[_245]=function(root){try{if(!((9==root.nodeType)||_249)){throw "";}var r=root[qsa](tq);r[_23f]=true;return r;}catch(e){return _244(_245,true)(root);}};}else{var _24b=_245.split(/\s*,\s*/);return _239[_245]=((_24b.length<2)?_23b(_245):function(root){var _24c=0,ret=[],tp;while((tp=_24b[_24c++])){ret=ret.concat(_23b(tp)(root));}return ret;});}};var _24d=0;var _24e=d.isIE?function(node){if(_1e9){return (node.getAttribute("_uid")||node.setAttribute("_uid",++_24d)||_24d);}else{return node.uniqueID;}}:function(node){return (node._uid||(node._uid=++_24d));};var _228=function(node,bag){if(!bag){return 1;}var id=_24e(node);if(!bag[id]){return bag[id]=1;}return 0;};var _24f="_zipIdx";var _250=function(arr){if(arr&&arr.nozip){return (qlc._wrap)?qlc._wrap(arr):arr;}var ret=new qlc();if(!arr||!arr.length){return ret;}if(arr[0]){ret.push(arr[0]);}if(arr.length<2){return ret;}_24d++;if(d.isIE&&_1e9){var _251=_24d+"";arr[0].setAttribute(_24f,_251);for(var x=1,te;te=arr[x];x++){if(arr[x].getAttribute(_24f)!=_251){ret.push(te);}te.setAttribute(_24f,_251);}}else{if(d.isIE&&arr.commentStrip){try{for(var x=1,te;te=arr[x];x++){if(_201(te)){ret.push(te);}}}catch(e){}}else{if(arr[0]){arr[0][_24f]=_24d;}for(var x=1,te;te=arr[x];x++){if(arr[x][_24f]!=_24d){ret.push(te);}te[_24f]=_24d;}}}return ret;};d.query=function(_252,root){qlc=d._NodeListCtor;if(!_252){return new qlc();}if(_252.constructor==qlc){return _252;}if(typeof _252!="string"){return new qlc(_252);}if(typeof root=="string"){root=d.byId(root);if(!root){return new qlc();}}root=root||_1e5();var od=root.ownerDocument||root.documentElement;_1e9=(root.contentType&&root.contentType=="application/xml")||(d.isOpera&&(root.doctype||od.toString()=="[object XMLDocument]"))||(!!od)&&(d.isIE?od.xml:(root.xmlVersion||od.xmlVersion));var r=_244(_252)(root);if(r&&r.nozip&&!qlc._wrap){return r;}return _250(r);};d.query.pseudos=_215;d._filterQueryResult=function(_253,_254,root){var _255=new d._NodeListCtor(),_256=_1eb(_254),_257=(_256.length==1&&!/[^\w#\.]/.test(_254))?_21c(_256[0]):function(node){return dojo.query(_254,root).indexOf(node)!=-1;};for(var x=0,te;te=_253[x];x++){if(_257(te)){_255.push(te);}}return _255;};};var _258=function(){acme={trim:function(str){str=str.replace(/^\s+/,"");for(var i=str.length-1;i>=0;i--){if(/\S/.test(str.charAt(i))){str=str.substring(0,i+1);break;}}return str;},forEach:function(arr,_259,_25a){if(!arr||!arr.length){return;}for(var i=0,l=arr.length;i<l;++i){_259.call(_25a||window,arr[i],i,arr);}},byId:function(id,doc){if(typeof id=="string"){return (doc||document).getElementById(id);}else{return id;}},doc:document,NodeList:Array};var n=navigator;var dua=n.userAgent;var dav=n.appVersion;var tv=parseFloat(dav);acme.isOpera=(dua.indexOf("Opera")>=0)?tv:undefined;acme.isKhtml=(dav.indexOf("Konqueror")>=0)?tv:undefined;acme.isWebKit=parseFloat(dua.split("WebKit/")[1])||undefined;acme.isChrome=parseFloat(dua.split("Chrome/")[1])||undefined;var _25b=Math.max(dav.indexOf("WebKit"),dav.indexOf("Safari"),0);if(_25b&&!acme.isChrome){acme.isSafari=parseFloat(dav.split("Version/")[1]);if(!acme.isSafari||parseFloat(dav.substr(_25b+7))<=419.3){acme.isSafari=2;}}if(document.all&&!acme.isOpera){acme.isIE=parseFloat(dav.split("MSIE ")[1])||undefined;}Array._wrap=function(arr){return arr;};return acme;};if(this["dojo"]){dojo.provide("dojo._base.query");_1e4(this["queryPortability"]||this["acme"]||dojo);}else{_1e4(this["queryPortability"]||this["acme"]||_258());}})();}if(!dojo._hasResource["dojo._base.xhr"]){dojo._hasResource["dojo._base.xhr"]=true;dojo.provide("dojo._base.xhr");(function(){var _25c=dojo,cfg=_25c.config;function _25d(obj,name,_25e){if(_25e===null){return;}var val=obj[name];if(typeof val=="string"){obj[name]=[val,_25e];}else{if(_25c.isArray(val)){val.push(_25e);}else{obj[name]=_25e;}}};dojo.fieldToObject=function(_25f){var ret=null;var item=_25c.byId(_25f);if(item){var _260=item.name;var type=(item.type||"").toLowerCase();if(_260&&type&&!item.disabled){if(type=="radio"||type=="checkbox"){if(item.checked){ret=item.value;}}else{if(item.multiple){ret=[];_25c.query("option",item).forEach(function(opt){if(opt.selected){ret.push(opt.value);}});}else{ret=item.value;}}}}return ret;};dojo.formToObject=function(_261){var ret={};var _262="file|submit|image|reset|button|";_25c.forEach(dojo.byId(_261).elements,function(item){var _263=item.name;var type=(item.type||"").toLowerCase();if(_263&&type&&_262.indexOf(type)==-1&&!item.disabled){_25d(ret,_263,_25c.fieldToObject(item));if(type=="image"){ret[_263+".x"]=ret[_263+".y"]=ret[_263].x=ret[_263].y=0;}}});return ret;};dojo.objectToQuery=function(map){var enc=encodeURIComponent;var _264=[];var _265={};for(var name in map){var _266=map[name];if(_266!=_265[name]){var _267=enc(name)+"=";if(_25c.isArray(_266)){for(var i=0;i<_266.length;i++){_264.push(_267+enc(_266[i]));}}else{_264.push(_267+enc(_266));}}}return _264.join("&");};dojo.formToQuery=function(_268){return _25c.objectToQuery(_25c.formToObject(_268));};dojo.formToJson=function(_269,_26a){return _25c.toJson(_25c.formToObject(_269),_26a);};dojo.queryToObject=function(str){var ret={};var qp=str.split("&");var dec=decodeURIComponent;_25c.forEach(qp,function(item){if(item.length){var _26b=item.split("=");var name=dec(_26b.shift());var val=dec(_26b.join("="));if(typeof ret[name]=="string"){ret[name]=[ret[name]];}if(_25c.isArray(ret[name])){ret[name].push(val);}else{ret[name]=val;}}});return ret;};dojo._blockAsync=false;var _26c=_25c._contentHandlers=dojo.contentHandlers={text:function(xhr){return xhr.responseText;},json:function(xhr){return _25c.fromJson(xhr.responseText||null);},"json-comment-filtered":function(xhr){if(!dojo.config.useCommentedJson){console.warn("Consider using the standard mimetype:application/json."+" json-commenting can introduce security issues. To"+" decrease the chances of hijacking, use the standard the 'json' handler and"+" prefix your json with: {}&&\n"+"Use djConfig.useCommentedJson=true to turn off this message.");}var _26d=xhr.responseText;var _26e=_26d.indexOf("/*");var _26f=_26d.lastIndexOf("*/");if(_26e==-1||_26f==-1){throw new Error("JSON was not comment filtered");}return _25c.fromJson(_26d.substring(_26e+2,_26f));},javascript:function(xhr){return _25c.eval(xhr.responseText);},xml:function(xhr){var _270=xhr.responseXML;if(_25c.isIE&&(!_270||!_270.documentElement)){var ms=function(n){return "MSXML"+n+".DOMDocument";};var dp=["Microsoft.XMLDOM",ms(6),ms(4),ms(3),ms(2)];_25c.some(dp,function(p){try{var dom=new ActiveXObject(p);dom.async=false;dom.loadXML(xhr.responseText);_270=dom;}catch(e){return false;}return true;});}return _270;},"json-comment-optional":function(xhr){if(xhr.responseText&&/^[^{\[]*\/\*/.test(xhr.responseText)){return _26c["json-comment-filtered"](xhr);}else{return _26c["json"](xhr);}}};dojo._ioSetArgs=function(args,_271,_272,_273){var _274={args:args,url:args.url};var _275=null;if(args.form){var form=_25c.byId(args.form);var _276=form.getAttributeNode("action");_274.url=_274.url||(_276?_276.value:null);_275=_25c.formToObject(form);}var _277=[{}];if(_275){_277.push(_275);}if(args.content){_277.push(args.content);}if(args.preventCache){_277.push({"dojo.preventCache":new Date().valueOf()});}_274.query=_25c.objectToQuery(_25c.mixin.apply(null,_277));_274.handleAs=args.handleAs||"text";var d=new _25c.Deferred(_271);d.addCallbacks(_272,function(_278){return _273(_278,d);});var ld=args.load;if(ld&&_25c.isFunction(ld)){d.addCallback(function(_279){return ld.call(args,_279,_274);});}var err=args.error;if(err&&_25c.isFunction(err)){d.addErrback(function(_27a){return err.call(args,_27a,_274);});}var _27b=args.handle;if(_27b&&_25c.isFunction(_27b)){d.addBoth(function(_27c){return _27b.call(args,_27c,_274);});}if(cfg.ioPublish&&_25c.publish&&_274.args.ioPublish!==false){d.addCallbacks(function(res){_25c.publish("/dojo/io/load",[d,res]);return res;},function(res){_25c.publish("/dojo/io/error",[d,res]);return res;});d.addBoth(function(res){_25c.publish("/dojo/io/done",[d,res]);return res;});}d.ioArgs=_274;return d;};var _27d=function(dfd){dfd.canceled=true;var xhr=dfd.ioArgs.xhr;var _27e=typeof xhr.abort;if(_27e=="function"||_27e=="object"||_27e=="unknown"){xhr.abort();}var err=dfd.ioArgs.error;if(!err){err=new Error("xhr cancelled");err.dojoType="cancel";}return err;};var _27f=function(dfd){var ret=_26c[dfd.ioArgs.handleAs](dfd.ioArgs.xhr);return ret===undefined?null:ret;};var _280=function(_281,dfd){if(!dfd.ioArgs.args.failOk){console.error(_281);}return _281;};var _282=null;var _283=[];var _284=0;var _285=function(dfd){if(_284<=0){_284=0;if(cfg.ioPublish&&_25c.publish&&(!dfd||dfd&&dfd.ioArgs.args.ioPublish!==false)){_25c.publish("/dojo/io/stop");}}};var _286=function(){var now=(new Date()).getTime();if(!_25c._blockAsync){for(var i=0,tif;i<_283.length&&(tif=_283[i]);i++){var dfd=tif.dfd;var func=function(){if(!dfd||dfd.canceled||!tif.validCheck(dfd)){_283.splice(i--,1);_284-=1;}else{if(tif.ioCheck(dfd)){_283.splice(i--,1);tif.resHandle(dfd);_284-=1;}else{if(dfd.startTime){if(dfd.startTime+(dfd.ioArgs.args.timeout||0)<now){_283.splice(i--,1);var err=new Error("timeout exceeded");err.dojoType="timeout";dfd.errback(err);dfd.cancel();_284-=1;}}}}};if(dojo.config.debugAtAllCosts){func.call(this);}else{try{func.call(this);}catch(e){dfd.errback(e);}}}}_285(dfd);if(!_283.length){clearInterval(_282);_282=null;return;}};dojo._ioCancelAll=function(){try{_25c.forEach(_283,function(i){try{i.dfd.cancel();}catch(e){}});}catch(e){}};if(_25c.isIE){_25c.addOnWindowUnload(_25c._ioCancelAll);}_25c._ioNotifyStart=function(dfd){if(cfg.ioPublish&&_25c.publish&&dfd.ioArgs.args.ioPublish!==false){if(!_284){_25c.publish("/dojo/io/start");}_284+=1;_25c.publish("/dojo/io/send",[dfd]);}};_25c._ioWatch=function(dfd,_287,_288,_289){var args=dfd.ioArgs.args;if(args.timeout){dfd.startTime=(new Date()).getTime();}_283.push({dfd:dfd,validCheck:_287,ioCheck:_288,resHandle:_289});if(!_282){_282=setInterval(_286,50);}if(args.sync){_286();}};var _28a="application/x-www-form-urlencoded";var _28b=function(dfd){return dfd.ioArgs.xhr.readyState;};var _28c=function(dfd){return 4==dfd.ioArgs.xhr.readyState;};var _28d=function(dfd){var xhr=dfd.ioArgs.xhr;if(_25c._isDocumentOk(xhr)){dfd.callback(dfd);}else{var err=new Error("Unable to load "+dfd.ioArgs.url+" status:"+xhr.status);err.status=xhr.status;err.responseText=xhr.responseText;dfd.errback(err);}};dojo._ioAddQueryToUrl=function(_28e){if(_28e.query.length){_28e.url+=(_28e.url.indexOf("?")==-1?"?":"&")+_28e.query;_28e.query=null;}};dojo.xhr=function(_28f,args,_290){var dfd=_25c._ioSetArgs(args,_27d,_27f,_280);var _291=dfd.ioArgs;var xhr=_291.xhr=_25c._xhrObj(_291.args);if(!xhr){dfd.cancel();return dfd;}if("postData" in args){_291.query=args.postData;}else{if("putData" in args){_291.query=args.putData;}else{if("rawBody" in args){_291.query=args.rawBody;}else{if((arguments.length>2&&!_290)||"POST|PUT".indexOf(_28f.toUpperCase())==-1){_25c._ioAddQueryToUrl(_291);}}}}xhr.open(_28f,_291.url,args.sync!==true,args.user||undefined,args.password||undefined);if(args.headers){for(var hdr in args.headers){if(hdr.toLowerCase()==="content-type"&&!args.contentType){args.contentType=args.headers[hdr];}else{if(args.headers[hdr]){xhr.setRequestHeader(hdr,args.headers[hdr]);}}}}xhr.setRequestHeader("Content-Type",args.contentType||_28a);if(!args.headers||!("X-Requested-With" in args.headers)){xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");}_25c._ioNotifyStart(dfd);if(dojo.config.debugAtAllCosts){xhr.send(_291.query);}else{try{xhr.send(_291.query);}catch(e){_291.error=e;dfd.cancel();}}_25c._ioWatch(dfd,_28b,_28c,_28d);xhr=null;return dfd;};dojo.xhrGet=function(args){return _25c.xhr("GET",args);};dojo.rawXhrPost=dojo.xhrPost=function(args){return _25c.xhr("POST",args,true);};dojo.rawXhrPut=dojo.xhrPut=function(args){return _25c.xhr("PUT",args,true);};dojo.xhrDelete=function(args){return _25c.xhr("DELETE",args);};})();}if(!dojo._hasResource["dojo._base.fx"]){dojo._hasResource["dojo._base.fx"]=true;dojo.provide("dojo._base.fx");(function(){var d=dojo;var _292=d._mixin;dojo._Line=function(_293,end){this.start=_293;this.end=end;};dojo._Line.prototype.getValue=function(n){return ((this.end-this.start)*n)+this.start;};dojo.Animation=function(args){_292(this,args);if(d.isArray(this.curve)){this.curve=new d._Line(this.curve[0],this.curve[1]);}};d._Animation=d.Animation;d.extend(dojo.Animation,{duration:350,repeat:0,rate:20,_percent:0,_startRepeatCount:0,_getStep:function(){var _294=this._percent,_295=this.easing;return _295?_295(_294):_294;},_fire:function(evt,args){var a=args||[];if(this[evt]){if(d.config.debugAtAllCosts){this[evt].apply(this,a);}else{try{this[evt].apply(this,a);}catch(e){console.error("exception in animation handler for:",evt);console.error(e);}}}return this;},play:function(_296,_297){var _298=this;if(_298._delayTimer){_298._clearTimer();}if(_297){_298._stopTimer();_298._active=_298._paused=false;_298._percent=0;}else{if(_298._active&&!_298._paused){return _298;}}_298._fire("beforeBegin",[_298.node]);var de=_296||_298.delay,_299=dojo.hitch(_298,"_play",_297);if(de>0){_298._delayTimer=setTimeout(_299,de);return _298;}_299();return _298;},_play:function(_29a){var _29b=this;if(_29b._delayTimer){_29b._clearTimer();}_29b._startTime=new Date().valueOf();if(_29b._paused){_29b._startTime-=_29b.duration*_29b._percent;}_29b._active=true;_29b._paused=false;var _29c=_29b.curve.getValue(_29b._getStep());if(!_29b._percent){if(!_29b._startRepeatCount){_29b._startRepeatCount=_29b.repeat;}_29b._fire("onBegin",[_29c]);}_29b._fire("onPlay",[_29c]);_29b._cycle();return _29b;},pause:function(){var _29d=this;if(_29d._delayTimer){_29d._clearTimer();}_29d._stopTimer();if(!_29d._active){return _29d;}_29d._paused=true;_29d._fire("onPause",[_29d.curve.getValue(_29d._getStep())]);return _29d;},gotoPercent:function(_29e,_29f){var _2a0=this;_2a0._stopTimer();_2a0._active=_2a0._paused=true;_2a0._percent=_29e;if(_29f){_2a0.play();}return _2a0;},stop:function(_2a1){var _2a2=this;if(_2a2._delayTimer){_2a2._clearTimer();}if(!_2a2._timer){return _2a2;}_2a2._stopTimer();if(_2a1){_2a2._percent=1;}_2a2._fire("onStop",[_2a2.curve.getValue(_2a2._getStep())]);_2a2._active=_2a2._paused=false;return _2a2;},status:function(){if(this._active){return this._paused?"paused":"playing";}return "stopped";},_cycle:function(){var _2a3=this;if(_2a3._active){var curr=new Date().valueOf();var step=(curr-_2a3._startTime)/(_2a3.duration);if(step>=1){step=1;}_2a3._percent=step;if(_2a3.easing){step=_2a3.easing(step);}_2a3._fire("onAnimate",[_2a3.curve.getValue(step)]);if(_2a3._percent<1){_2a3._startTimer();}else{_2a3._active=false;if(_2a3.repeat>0){_2a3.repeat--;_2a3.play(null,true);}else{if(_2a3.repeat==-1){_2a3.play(null,true);}else{if(_2a3._startRepeatCount){_2a3.repeat=_2a3._startRepeatCount;_2a3._startRepeatCount=0;}}}_2a3._percent=0;_2a3._fire("onEnd",[_2a3.node]);!_2a3.repeat&&_2a3._stopTimer();}}return _2a3;},_clearTimer:function(){clearTimeout(this._delayTimer);delete this._delayTimer;}});var ctr=0,_2a4=null,_2a5={run:function(){}};d.extend(d.Animation,{_startTimer:function(){if(!this._timer){this._timer=d.connect(_2a5,"run",this,"_cycle");ctr++;}if(!_2a4){_2a4=setInterval(d.hitch(_2a5,"run"),this.rate);}},_stopTimer:function(){if(this._timer){d.disconnect(this._timer);this._timer=null;ctr--;}if(ctr<=0){clearInterval(_2a4);_2a4=null;ctr=0;}}});var _2a6=d.isIE?function(node){var ns=node.style;if(!ns.width.length&&d.style(node,"width")=="auto"){ns.width="auto";}}:function(){};dojo._fade=function(args){args.node=d.byId(args.node);var _2a7=_292({properties:{}},args),_2a8=(_2a7.properties.opacity={});_2a8.start=!("start" in _2a7)?function(){return +d.style(_2a7.node,"opacity")||0;}:_2a7.start;_2a8.end=_2a7.end;var anim=d.animateProperty(_2a7);d.connect(anim,"beforeBegin",d.partial(_2a6,_2a7.node));return anim;};dojo.fadeIn=function(args){return d._fade(_292({end:1},args));};dojo.fadeOut=function(args){return d._fade(_292({end:0},args));};dojo._defaultEasing=function(n){return 0.5+((Math.sin((n+1.5)*Math.PI))/2);};var _2a9=function(_2aa){this._properties=_2aa;for(var p in _2aa){var prop=_2aa[p];if(prop.start instanceof d.Color){prop.tempColor=new d.Color();}}};_2a9.prototype.getValue=function(r){var ret={};for(var p in this._properties){var prop=this._properties[p],_2ab=prop.start;if(_2ab instanceof d.Color){ret[p]=d.blendColors(_2ab,prop.end,r,prop.tempColor).toCss();}else{if(!d.isArray(_2ab)){ret[p]=((prop.end-_2ab)*r)+_2ab+(p!="opacity"?prop.units||"px":0);}}}return ret;};dojo.animateProperty=function(args){var n=args.node=d.byId(args.node);if(!args.easing){args.easing=d._defaultEasing;}var anim=new d.Animation(args);d.connect(anim,"beforeBegin",anim,function(){var pm={};for(var p in this.properties){if(p=="width"||p=="height"){this.node.display="block";}var prop=this.properties[p];if(d.isFunction(prop)){prop=prop(n);}prop=pm[p]=_292({},(d.isObject(prop)?prop:{end:prop}));if(d.isFunction(prop.start)){prop.start=prop.start(n);}if(d.isFunction(prop.end)){prop.end=prop.end(n);}var _2ac=(p.toLowerCase().indexOf("color")>=0);function _2ad(node,p){var v={height:node.offsetHeight,width:node.offsetWidth}[p];if(v!==undefined){return v;}v=d.style(node,p);return (p=="opacity")?+v:(_2ac?v:parseFloat(v));};if(!("end" in prop)){prop.end=_2ad(n,p);}else{if(!("start" in prop)){prop.start=_2ad(n,p);}}if(_2ac){prop.start=new d.Color(prop.start);prop.end=new d.Color(prop.end);}else{prop.start=(p=="opacity")?+prop.start:parseFloat(prop.start);}}this.curve=new _2a9(pm);});d.connect(anim,"onAnimate",d.hitch(d,"style",anim.node));return anim;};dojo.anim=function(node,_2ae,_2af,_2b0,_2b1,_2b2){return d.animateProperty({node:node,duration:_2af||d.Animation.prototype.duration,properties:_2ae,easing:_2b0,onEnd:_2b1}).play(_2b2||0);};})();}if(!dojo._hasResource["dojo._base.browser"]){dojo._hasResource["dojo._base.browser"]=true;dojo.provide("dojo._base.browser");dojo.forEach(dojo.config.require,function(i){dojo["require"](i);});}if(!dojo._hasResource["dojo._base"]){dojo._hasResource["dojo._base"]=true;dojo.provide("dojo._base");}if(dojo.isBrowser&&(document.readyState==="complete"||dojo.config.afterOnLoad)){window.setTimeout(dojo._loadInit,100);}})();
+
+
+/* Prototype JavaScript framework, version 1.7
+ * (c) 2005-2010 Sam Stephenson
+ *
+ * Prototype is freely distributable under the terms of an MIT-style license.
+ * For details, see the Prototype web site: http://www.prototypejs.org/
+ *
+ *--------------------------------------------------------------------------*/
+
+var Prototype = {
+
+ Version: '1.7',
+
+ Browser: (function(){
+ var ua = navigator.userAgent;
+ var isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]';
+ return {
+ IE: !!window.attachEvent && !isOpera,
+ Opera: isOpera,
+ WebKit: ua.indexOf('AppleWebKit/') > -1,
+ Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1,
+ MobileSafari: /Apple.*Mobile/.test(ua)
+ }
+ })(),
+
+ BrowserFeatures: {
+ XPath: !!document.evaluate,
+
+ SelectorsAPI: !!document.querySelector,
+
+ ElementExtensions: (function() {
+ var constructor = window.Element || window.HTMLElement;
+ return !!(constructor && constructor.prototype);
+ })(),
+ SpecificElementExtensions: (function() {
+ if (typeof window.HTMLDivElement !== 'undefined')
+ return true;
+
+ var div = document.createElement('div'),
+ form = document.createElement('form'),
+ isSupported = false;
+
+ if (div['__proto__'] && (div['__proto__'] !== form['__proto__'])) {
+ isSupported = true;
+ }
+
+ div = form = null;
+
+ return isSupported;
+ })()
+ },
+
+ ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
+ JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,
+
+ emptyFunction: function() { },
+
+ K: function(x) { return x }
+};
+
+if (Prototype.Browser.MobileSafari)
+ Prototype.BrowserFeatures.SpecificElementExtensions = false;
+/* Based on Alex Arnell's inheritance implementation. */
+
+var Class = (function() {
+
+ var IS_DONTENUM_BUGGY = (function(){
+ for (var p in { toString: 1 }) {
+ if (p === 'toString') return false;
+ }
+ return true;
+ })();
+
+ function subclass() {};
+ function create() {
+ var parent = null, properties = $A(arguments);
+ if (Object.isFunction(properties[0]))
+ parent = properties.shift();
+
+ function klass() {
+ this.initialize.apply(this, arguments);
+ }
+
+ Object.extend(klass, Class.Methods);
+ klass.superclass = parent;
+ klass.subclasses = [];
+
+ if (parent) {
+ subclass.prototype = parent.prototype;
+ klass.prototype = new subclass;
+ parent.subclasses.push(klass);
+ }
+
+ for (var i = 0, length = properties.length; i < length; i++)
+ klass.addMethods(properties[i]);
+
+ if (!klass.prototype.initialize)
+ klass.prototype.initialize = Prototype.emptyFunction;
+
+ klass.prototype.constructor = klass;
+ return klass;
+ }
+
+ function addMethods(source) {
+ var ancestor = this.superclass && this.superclass.prototype,
+ properties = Object.keys(source);
+
+ if (IS_DONTENUM_BUGGY) {
+ if (source.toString != Object.prototype.toString)
+ properties.push("toString");
+ if (source.valueOf != Object.prototype.valueOf)
+ properties.push("valueOf");
+ }
+
+ for (var i = 0, length = properties.length; i < length; i++) {
+ var property = properties[i], value = source[property];
+ if (ancestor && Object.isFunction(value) &&
+ value.argumentNames()[0] == "$super") {
+ var method = value;
+ value = (function(m) {
+ return function() { return ancestor[m].apply(this, arguments); };
+ })(property).wrap(method);
+
+ value.valueOf = method.valueOf.bind(method);
+ value.toString = method.toString.bind(method);
+ }
+ this.prototype[property] = value;
+ }
+
+ return this;
+ }
+
+ return {
+ create: create,
+ Methods: {
+ addMethods: addMethods
+ }
+ };
+})();
+(function() {
+
+ var _toString = Object.prototype.toString,
+ NULL_TYPE = 'Null',
+ UNDEFINED_TYPE = 'Undefined',
+ BOOLEAN_TYPE = 'Boolean',
+ NUMBER_TYPE = 'Number',
+ STRING_TYPE = 'String',
+ OBJECT_TYPE = 'Object',
+ FUNCTION_CLASS = '[object Function]',
+ BOOLEAN_CLASS = '[object Boolean]',
+ NUMBER_CLASS = '[object Number]',
+ STRING_CLASS = '[object String]',
+ ARRAY_CLASS = '[object Array]',
+ DATE_CLASS = '[object Date]',
+ NATIVE_JSON_STRINGIFY_SUPPORT = window.JSON &&
+ typeof JSON.stringify === 'function' &&
+ JSON.stringify(0) === '0' &&
+ typeof JSON.stringify(Prototype.K) === 'undefined';
+
+ function Type(o) {
+ switch(o) {
+ case null: return NULL_TYPE;
+ case (void 0): return UNDEFINED_TYPE;
+ }
+ var type = typeof o;
+ switch(type) {
+ case 'boolean': return BOOLEAN_TYPE;
+ case 'number': return NUMBER_TYPE;
+ case 'string': return STRING_TYPE;
+ }
+ return OBJECT_TYPE;
+ }
+
+ function extend(destination, source) {
+ for (var property in source)
+ destination[property] = source[property];
+ return destination;
+ }
+
+ function inspect(object) {
+ try {
+ if (isUndefined(object)) return 'undefined';
+ if (object === null) return 'null';
+ return object.inspect ? object.inspect() : String(object);
+ } catch (e) {
+ if (e instanceof RangeError) return '...';
+ throw e;
+ }
+ }
+
+ function toJSON(value) {
+ return Str('', { '': value }, []);
+ }
+
+ function Str(key, holder, stack) {
+ var value = holder[key],
+ type = typeof value;
+
+ if (Type(value) === OBJECT_TYPE && typeof value.toJSON === 'function') {
+ value = value.toJSON(key);
+ }
+
+ var _class = _toString.call(value);
+
+ switch (_class) {
+ case NUMBER_CLASS:
+ case BOOLEAN_CLASS:
+ case STRING_CLASS:
+ value = value.valueOf();
+ }
+
+ switch (value) {
+ case null: return 'null';
+ case true: return 'true';
+ case false: return 'false';
+ }
+
+ type = typeof value;
+ switch (type) {
+ case 'string':
+ return value.inspect(true);
+ case 'number':
+ return isFinite(value) ? String(value) : 'null';
+ case 'object':
+
+ for (var i = 0, length = stack.length; i < length; i++) {
+ if (stack[i] === value) { throw new TypeError(); }
+ }
+ stack.push(value);
+
+ var partial = [];
+ if (_class === ARRAY_CLASS) {
+ for (var i = 0, length = value.length; i < length; i++) {
+ var str = Str(i, value, stack);
+ partial.push(typeof str === 'undefined' ? 'null' : str);
+ }
+ partial = '[' + partial.join(',') + ']';
+ } else {
+ var keys = Object.keys(value);
+ for (var i = 0, length = keys.length; i < length; i++) {
+ var key = keys[i], str = Str(key, value, stack);
+ if (typeof str !== "undefined") {
+ partial.push(key.inspect(true)+ ':' + str);
+ }
+ }
+ partial = '{' + partial.join(',') + '}';
+ }
+ stack.pop();
+ return partial;
+ }
+ }
+
+ function stringify(object) {
+ return JSON.stringify(object);
+ }
+
+ function toQueryString(object) {
+ return $H(object).toQueryString();
+ }
+
+ function toHTML(object) {
+ return object && object.toHTML ? object.toHTML() : String.interpret(object);
+ }
+
+ function keys(object) {
+ if (Type(object) !== OBJECT_TYPE) { throw new TypeError(); }
+ var results = [];
+ for (var property in object) {
+ if (object.hasOwnProperty(property)) {
+ results.push(property);
+ }
+ }
+ return results;
+ }
+
+ function values(object) {
+ var results = [];
+ for (var property in object)
+ results.push(object[property]);
+ return results;
+ }
+
+ function clone(object) {
+ return extend({ }, object);
+ }
+
+ function isElement(object) {
+ return !!(object && object.nodeType == 1);
+ }
+
+ function isArray(object) {
+ return _toString.call(object) === ARRAY_CLASS;
+ }
+
+ var hasNativeIsArray = (typeof Array.isArray == 'function')
+ && Array.isArray([]) && !Array.isArray({});
+
+ if (hasNativeIsArray) {
+ isArray = Array.isArray;
+ }
+
+ function isHash(object) {
+ return object instanceof Hash;
+ }
+
+ function isFunction(object) {
+ return _toString.call(object) === FUNCTION_CLASS;
+ }
+
+ function isString(object) {
+ return _toString.call(object) === STRING_CLASS;
+ }
+
+ function isNumber(object) {
+ return _toString.call(object) === NUMBER_CLASS;
+ }
+
+ function isDate(object) {
+ return _toString.call(object) === DATE_CLASS;
+ }
+
+ function isUndefined(object) {
+ return typeof object === "undefined";
+ }
+
+ extend(Object, {
+ extend: extend,
+ inspect: inspect,
+ toJSON: NATIVE_JSON_STRINGIFY_SUPPORT ? stringify : toJSON,
+ toQueryString: toQueryString,
+ toHTML: toHTML,
+ keys: Object.keys || keys,
+ values: values,
+ clone: clone,
+ isElement: isElement,
+ isArray: isArray,
+ isHash: isHash,
+ isFunction: isFunction,
+ isString: isString,
+ isNumber: isNumber,
+ isDate: isDate,
+ isUndefined: isUndefined
+ });
+})();
+Object.extend(Function.prototype, (function() {
+ var slice = Array.prototype.slice;
+
+ function update(array, args) {
+ var arrayLength = array.length, length = args.length;
+ while (length--) array[arrayLength + length] = args[length];
+ return array;
+ }
+
+ function merge(array, args) {
+ array = slice.call(array, 0);
+ return update(array, args);
+ }
+
+ function argumentNames() {
+ var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1]
+ .replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '')
+ .replace(/\s+/g, '').split(',');
+ return names.length == 1 && !names[0] ? [] : names;
+ }
+
+ function bind(context) {
+ if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this;
+ var __method = this, args = slice.call(arguments, 1);
+ return function() {
+ var a = merge(args, arguments);
+ return __method.apply(context, a);
+ }
+ }
+
+ function bindAsEventListener(context) {
+ var __method = this, args = slice.call(arguments, 1);
+ return function(event) {
+ var a = update([event || window.event], args);
+ return __method.apply(context, a);
+ }
+ }
+
+ function curry() {
+ if (!arguments.length) return this;
+ var __method = this, args = slice.call(arguments, 0);
+ return function() {
+ var a = merge(args, arguments);
+ return __method.apply(this, a);
+ }
+ }
+
+ function delay(timeout) {
+ var __method = this, args = slice.call(arguments, 1);
+ timeout = timeout * 1000;
+ return window.setTimeout(function() {
+ return __method.apply(__method, args);
+ }, timeout);
+ }
+
+ function defer() {
+ var args = update([0.01], arguments);
+ return this.delay.apply(this, args);
+ }
+
+ function wrap(wrapper) {
+ var __method = this;
+ return function() {
+ var a = update([__method.bind(this)], arguments);
+ return wrapper.apply(this, a);
+ }
+ }
+
+ function methodize() {
+ if (this._methodized) return this._methodized;
+ var __method = this;
+ return this._methodized = function() {
+ var a = update([this], arguments);
+ return __method.apply(null, a);
+ };
+ }
+
+ return {
+ argumentNames: argumentNames,
+ bind: bind,
+ bindAsEventListener: bindAsEventListener,
+ curry: curry,
+ delay: delay,
+ defer: defer,
+ wrap: wrap,
+ methodize: methodize
+ }
+})());
+
+
+
+(function(proto) {
+
+
+ function toISOString() {
+ return this.getUTCFullYear() + '-' +
+ (this.getUTCMonth() + 1).toPaddedString(2) + '-' +
+ this.getUTCDate().toPaddedString(2) + 'T' +
+ this.getUTCHours().toPaddedString(2) + ':' +
+ this.getUTCMinutes().toPaddedString(2) + ':' +
+ this.getUTCSeconds().toPaddedString(2) + 'Z';
+ }
+
+
+ function toJSON() {
+ return this.toISOString();
+ }
+
+ if (!proto.toISOString) proto.toISOString = toISOString;
+ if (!proto.toJSON) proto.toJSON = toJSON;
+
+})(Date.prototype);
+
+
+RegExp.prototype.match = RegExp.prototype.test;
+
+RegExp.escape = function(str) {
+ return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
+};
+var PeriodicalExecuter = Class.create({
+ initialize: function(callback, frequency) {
+ this.callback = callback;
+ this.frequency = frequency;
+ this.currentlyExecuting = false;
+
+ this.registerCallback();
+ },
+
+ registerCallback: function() {
+ this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+ },
+
+ execute: function() {
+ this.callback(this);
+ },
+
+ stop: function() {
+ if (!this.timer) return;
+ clearInterval(this.timer);
+ this.timer = null;
+ },
+
+ onTimerEvent: function() {
+ if (!this.currentlyExecuting) {
+ try {
+ this.currentlyExecuting = true;
+ this.execute();
+ this.currentlyExecuting = false;
+ } catch(e) {
+ this.currentlyExecuting = false;
+ throw e;
+ }
+ }
+ }
+});
+Object.extend(String, {
+ interpret: function(value) {
+ return value == null ? '' : String(value);
+ },
+ specialChar: {
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '\\': '\\\\'
+ }
+});
+
+Object.extend(String.prototype, (function() {
+ var NATIVE_JSON_PARSE_SUPPORT = window.JSON &&
+ typeof JSON.parse === 'function' &&
+ JSON.parse('{"test": true}').test;
+
+ function prepareReplacement(replacement) {
+ if (Object.isFunction(replacement)) return replacement;
+ var template = new Template(replacement);
+ return function(match) { return template.evaluate(match) };
+ }
+
+ function gsub(pattern, replacement) {
+ var result = '', source = this, match;
+ replacement = prepareReplacement(replacement);
+
+ if (Object.isString(pattern))
+ pattern = RegExp.escape(pattern);
+
+ if (!(pattern.length || pattern.source)) {
+ replacement = replacement('');
+ return replacement + source.split('').join(replacement) + replacement;
+ }
+
+ while (source.length > 0) {
+ if (match = source.match(pattern)) {
+ result += source.slice(0, match.index);
+ result += String.interpret(replacement(match));
+ source = source.slice(match.index + match[0].length);
+ } else {
+ result += source, source = '';
+ }
+ }
+ return result;
+ }
+
+ function sub(pattern, replacement, count) {
+ replacement = prepareReplacement(replacement);
+ count = Object.isUndefined(count) ? 1 : count;
+
+ return this.gsub(pattern, function(match) {
+ if (--count < 0) return match[0];
+ return replacement(match);
+ });
+ }
+
+ function scan(pattern, iterator) {
+ this.gsub(pattern, iterator);
+ return String(this);
+ }
+
+ function truncate(length, truncation) {
+ length = length || 30;
+ truncation = Object.isUndefined(truncation) ? '...' : truncation;
+ return this.length > length ?
+ this.slice(0, length - truncation.length) + truncation : String(this);
+ }
+
+ function strip() {
+ return this.replace(/^\s+/, '').replace(/\s+$/, '');
+ }
+
+ function stripTags() {
+ return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, '');
+ }
+
+ function stripScripts() {
+ return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
+ }
+
+ function extractScripts() {
+ var matchAll = new RegExp(Prototype.ScriptFragment, 'img'),
+ matchOne = new RegExp(Prototype.ScriptFragment, 'im');
+ return (this.match(matchAll) || []).map(function(scriptTag) {
+ return (scriptTag.match(matchOne) || ['', ''])[1];
+ });
+ }
+
+ function evalScripts() {
+ return this.extractScripts().map(function(script) { return eval(script) });
+ }
+
+ function escapeHTML() {
+ return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
+ }
+
+ function unescapeHTML() {
+ return this.stripTags().replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/g,'&');
+ }
+
+
+ function toQueryParams(separator) {
+ var match = this.strip().match(/([^?#]*)(#.*)?$/);
+ if (!match) return { };
+
+ return match[1].split(separator || '&').inject({ }, function(hash, pair) {
+ if ((pair = pair.split('='))[0]) {
+ var key = decodeURIComponent(pair.shift()),
+ value = pair.length > 1 ? pair.join('=') : pair[0];
+
+ if (value != undefined) value = decodeURIComponent(value);
+
+ if (key in hash) {
+ if (!Object.isArray(hash[key])) hash[key] = [hash[key]];
+ hash[key].push(value);
+ }
+ else hash[key] = value;
+ }
+ return hash;
+ });
+ }
+
+ function toArray() {
+ return this.split('');
+ }
+
+ function succ() {
+ return this.slice(0, this.length - 1) +
+ String.fromCharCode(this.charCodeAt(this.length - 1) + 1);
+ }
+
+ function times(count) {
+ return count < 1 ? '' : new Array(count + 1).join(this);
+ }
+
+ function camelize() {
+ return this.replace(/-+(.)?/g, function(match, chr) {
+ return chr ? chr.toUpperCase() : '';
+ });
+ }
+
+ function capitalize() {
+ return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
+ }
+
+ function underscore() {
+ return this.replace(/::/g, '/')
+ .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
+ .replace(/([a-z\d])([A-Z])/g, '$1_$2')
+ .replace(/-/g, '_')
+ .toLowerCase();
+ }
+
+ function dasherize() {
+ return this.replace(/_/g, '-');
+ }
+
+ function inspect(useDoubleQuotes) {
+ var escapedString = this.replace(/[\x00-\x1f\\]/g, function(character) {
+ if (character in String.specialChar) {
+ return String.specialChar[character];
+ }
+ return '\\u00' + character.charCodeAt().toPaddedString(2, 16);
+ });
+ if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
+ return "'" + escapedString.replace(/'/g, '\\\'') + "'";
+ }
+
+ function unfilterJSON(filter) {
+ return this.replace(filter || Prototype.JSONFilter, '$1');
+ }
+
+ function isJSON() {
+ var str = this;
+ if (str.blank()) return false;
+ str = str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@');
+ str = str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']');
+ str = str.replace(/(?:^|:|,)(?:\s*\[)+/g, '');
+ return (/^[\],:{}\s]*$/).test(str);
+ }
+
+ function evalJSON(sanitize) {
+ var json = this.unfilterJSON(),
+ cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
+ if (cx.test(json)) {
+ json = json.replace(cx, function (a) {
+ return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ });
+ }
+ try {
+ if (!sanitize || json.isJSON()) return eval('(' + json + ')');
+ } catch (e) { }
+ throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
+ }
+
+ function parseJSON() {
+ var json = this.unfilterJSON();
+ return JSON.parse(json);
+ }
+
+ function include(pattern) {
+ return this.indexOf(pattern) > -1;
+ }
+
+ function startsWith(pattern) {
+ return this.lastIndexOf(pattern, 0) === 0;
+ }
+
+ function endsWith(pattern) {
+ var d = this.length - pattern.length;
+ return d >= 0 && this.indexOf(pattern, d) === d;
+ }
+
+ function empty() {
+ return this == '';
+ }
+
+ function blank() {
+ return /^\s*$/.test(this);
+ }
+
+ function interpolate(object, pattern) {
+ return new Template(this, pattern).evaluate(object);
+ }
+
+ return {
+ gsub: gsub,
+ sub: sub,
+ scan: scan,
+ truncate: truncate,
+ strip: String.prototype.trim || strip,
+ stripTags: stripTags,
+ stripScripts: stripScripts,
+ extractScripts: extractScripts,
+ evalScripts: evalScripts,
+ escapeHTML: escapeHTML,
+ unescapeHTML: unescapeHTML,
+ toQueryParams: toQueryParams,
+ parseQuery: toQueryParams,
+ toArray: toArray,
+ succ: succ,
+ times: times,
+ camelize: camelize,
+ capitalize: capitalize,
+ underscore: underscore,
+ dasherize: dasherize,
+ inspect: inspect,
+ unfilterJSON: unfilterJSON,
+ isJSON: isJSON,
+ evalJSON: NATIVE_JSON_PARSE_SUPPORT ? parseJSON : evalJSON,
+ include: include,
+ startsWith: startsWith,
+ endsWith: endsWith,
+ empty: empty,
+ blank: blank,
+ interpolate: interpolate
+ };
+})());
+
+var Template = Class.create({
+ initialize: function(template, pattern) {
+ this.template = template.toString();
+ this.pattern = pattern || Template.Pattern;
+ },
+
+ evaluate: function(object) {
+ if (object && Object.isFunction(object.toTemplateReplacements))
+ object = object.toTemplateReplacements();
+
+ return this.template.gsub(this.pattern, function(match) {
+ if (object == null) return (match[1] + '');
+
+ var before = match[1] || '';
+ if (before == '\\') return match[2];
+
+ var ctx = object, expr = match[3],
+ pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;
+
+ match = pattern.exec(expr);
+ if (match == null) return before;
+
+ while (match != null) {
+ var comp = match[1].startsWith('[') ? match[2].replace(/\\\\]/g, ']') : match[1];
+ ctx = ctx[comp];
+ if (null == ctx || '' == match[3]) break;
+ expr = expr.substring('[' == match[3] ? match[1].length : match[0].length);
+ match = pattern.exec(expr);
+ }
+
+ return before + String.interpret(ctx);
+ });
+ }
+});
+Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
+
+var $break = { };
+
+var Enumerable = (function() {
+ function each(iterator, context) {
+ var index = 0;
+ try {
+ this._each(function(value) {
+ iterator.call(context, value, index++);
+ });
+ } catch (e) {
+ if (e != $break) throw e;
+ }
+ return this;
+ }
+
+ function eachSlice(number, iterator, context) {
+ var index = -number, slices = [], array = this.toArray();
+ if (number < 1) return array;
+ while ((index += number) < array.length)
+ slices.push(array.slice(index, index+number));
+ return slices.collect(iterator, context);
+ }
+
+ function all(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result = true;
+ this.each(function(value, index) {
+ result = result && !!iterator.call(context, value, index);
+ if (!result) throw $break;
+ });
+ return result;
+ }
+
+ function any(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result = false;
+ this.each(function(value, index) {
+ if (result = !!iterator.call(context, value, index))
+ throw $break;
+ });
+ return result;
+ }
+
+ function collect(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var results = [];
+ this.each(function(value, index) {
+ results.push(iterator.call(context, value, index));
+ });
+ return results;
+ }
+
+ function detect(iterator, context) {
+ var result;
+ this.each(function(value, index) {
+ if (iterator.call(context, value, index)) {
+ result = value;
+ throw $break;
+ }
+ });
+ return result;
+ }
+
+ function findAll(iterator, context) {
+ var results = [];
+ this.each(function(value, index) {
+ if (iterator.call(context, value, index))
+ results.push(value);
+ });
+ return results;
+ }
+
+ function grep(filter, iterator, context) {
+ iterator = iterator || Prototype.K;
+ var results = [];
+
+ if (Object.isString(filter))
+ filter = new RegExp(RegExp.escape(filter));
+
+ this.each(function(value, index) {
+ if (filter.match(value))
+ results.push(iterator.call(context, value, index));
+ });
+ return results;
+ }
+
+ function include(object) {
+ if (Object.isFunction(this.indexOf))
+ if (this.indexOf(object) != -1) return true;
+
+ var found = false;
+ this.each(function(value) {
+ if (value == object) {
+ found = true;
+ throw $break;
+ }
+ });
+ return found;
+ }
+
+ function inGroupsOf(number, fillWith) {
+ fillWith = Object.isUndefined(fillWith) ? null : fillWith;
+ return this.eachSlice(number, function(slice) {
+ while(slice.length < number) slice.push(fillWith);
+ return slice;
+ });
+ }
+
+ function inject(memo, iterator, context) {
+ this.each(function(value, index) {
+ memo = iterator.call(context, memo, value, index);
+ });
+ return memo;
+ }
+
+ function invoke(method) {
+ var args = $A(arguments).slice(1);
+ return this.map(function(value) {
+ return value[method].apply(value, args);
+ });
+ }
+
+ function max(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result;
+ this.each(function(value, index) {
+ value = iterator.call(context, value, index);
+ if (result == null || value >= result)
+ result = value;
+ });
+ return result;
+ }
+
+ function min(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result;
+ this.each(function(value, index) {
+ value = iterator.call(context, value, index);
+ if (result == null || value < result)
+ result = value;
+ });
+ return result;
+ }
+
+ function partition(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var trues = [], falses = [];
+ this.each(function(value, index) {
+ (iterator.call(context, value, index) ?
+ trues : falses).push(value);
+ });
+ return [trues, falses];
+ }
+
+ function pluck(property) {
+ var results = [];
+ this.each(function(value) {
+ results.push(value[property]);
+ });
+ return results;
+ }
+
+ function reject(iterator, context) {
+ var results = [];
+ this.each(function(value, index) {
+ if (!iterator.call(context, value, index))
+ results.push(value);
+ });
+ return results;
+ }
+
+ function sortBy(iterator, context) {
+ return this.map(function(value, index) {
+ return {
+ value: value,
+ criteria: iterator.call(context, value, index)
+ };
+ }).sort(function(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }).pluck('value');
+ }
+
+ function toArray() {
+ return this.map();
+ }
+
+ function zip() {
+ var iterator = Prototype.K, args = $A(arguments);
+ if (Object.isFunction(args.last()))
+ iterator = args.pop();
+
+ var collections = [this].concat(args).map($A);
+ return this.map(function(value, index) {
+ return iterator(collections.pluck(index));
+ });
+ }
+
+ function size() {
+ return this.toArray().length;
+ }
+
+ function inspect() {
+ return '#<Enumerable:' + this.toArray().inspect() + '>';
+ }
+
+
+
+
+
+
+
+
+
+ return {
+ each: each,
+ eachSlice: eachSlice,
+ all: all,
+ every: all,
+ any: any,
+ some: any,
+ collect: collect,
+ map: collect,
+ detect: detect,
+ findAll: findAll,
+ select: findAll,
+ filter: findAll,
+ grep: grep,
+ include: include,
+ member: include,
+ inGroupsOf: inGroupsOf,
+ inject: inject,
+ invoke: invoke,
+ max: max,
+ min: min,
+ partition: partition,
+ pluck: pluck,
+ reject: reject,
+ sortBy: sortBy,
+ toArray: toArray,
+ entries: toArray,
+ zip: zip,
+ size: size,
+ inspect: inspect,
+ find: detect
+ };
+})();
+
+function $A(iterable) {
+ if (!iterable) return [];
+ if ('toArray' in Object(iterable)) return iterable.toArray();
+ var length = iterable.length || 0, results = new Array(length);
+ while (length--) results[length] = iterable[length];
+ return results;
+}
+
+
+function $w(string) {
+ if (!Object.isString(string)) return [];
+ string = string.strip();
+ return string ? string.split(/\s+/) : [];
+}
+
+Array.from = $A;
+
+
+(function() {
+ var arrayProto = Array.prototype,
+ slice = arrayProto.slice,
+ _each = arrayProto.forEach; // use native browser JS 1.6 implementation if available
+
+ function each(iterator, context) {
+ for (var i = 0, length = this.length >>> 0; i < length; i++) {
+ if (i in this) iterator.call(context, this[i], i, this);
+ }
+ }
+ if (!_each) _each = each;
+
+ function clear() {
+ this.length = 0;
+ return this;
+ }
+
+ function first() {
+ return this[0];
+ }
+
+ function last() {
+ return this[this.length - 1];
+ }
+
+ function compact() {
+ return this.select(function(value) {
+ return value != null;
+ });
+ }
+
+ function flatten() {
+ return this.inject([], function(array, value) {
+ if (Object.isArray(value))
+ return array.concat(value.flatten());
+ array.push(value);
+ return array;
+ });
+ }
+
+ function without() {
+ var values = slice.call(arguments, 0);
+ return this.select(function(value) {
+ return !values.include(value);
+ });
+ }
+
+ function reverse(inline) {
+ return (inline === false ? this.toArray() : this)._reverse();
+ }
+
+ function uniq(sorted) {
+ return this.inject([], function(array, value, index) {
+ if (0 == index || (sorted ? array.last() != value : !array.include(value)))
+ array.push(value);
+ return array;
+ });
+ }
+
+ function intersect(array) {
+ return this.uniq().findAll(function(item) {
+ return array.detect(function(value) { return item === value });
+ });
+ }
+
+
+ function clone() {
+ return slice.call(this, 0);
+ }
+
+ function size() {
+ return this.length;
+ }
+
+ function inspect() {
+ return '[' + this.map(Object.inspect).join(', ') + ']';
+ }
+
+ function indexOf(item, i) {
+ i || (i = 0);
+ var length = this.length;
+ if (i < 0) i = length + i;
+ for (; i < length; i++)
+ if (this[i] === item) return i;
+ return -1;
+ }
+
+ function lastIndexOf(item, i) {
+ i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;
+ var n = this.slice(0, i).reverse().indexOf(item);
+ return (n < 0) ? n : i - n - 1;
+ }
+
+ function concat() {
+ var array = slice.call(this, 0), item;
+ for (var i = 0, length = arguments.length; i < length; i++) {
+ item = arguments[i];
+ if (Object.isArray(item) && !('callee' in item)) {
+ for (var j = 0, arrayLength = item.length; j < arrayLength; j++)
+ array.push(item[j]);
+ } else {
+ array.push(item);
+ }
+ }
+ return array;
+ }
+
+ Object.extend(arrayProto, Enumerable);
+
+ if (!arrayProto._reverse)
+ arrayProto._reverse = arrayProto.reverse;
+
+ Object.extend(arrayProto, {
+ _each: _each,
+ clear: clear,
+ first: first,
+ last: last,
+ compact: compact,
+ flatten: flatten,
+ without: without,
+ reverse: reverse,
+ uniq: uniq,
+ intersect: intersect,
+ clone: clone,
+ toArray: clone,
+ size: size,
+ inspect: inspect
+ });
+
+ var CONCAT_ARGUMENTS_BUGGY = (function() {
+ return [].concat(arguments)[0][0] !== 1;
+ })(1,2)
+
+ if (CONCAT_ARGUMENTS_BUGGY) arrayProto.concat = concat;
+
+ if (!arrayProto.indexOf) arrayProto.indexOf = indexOf;
+ if (!arrayProto.lastIndexOf) arrayProto.lastIndexOf = lastIndexOf;
+})();
+function $H(object) {
+ return new Hash(object);
+};
+
+var Hash = Class.create(Enumerable, (function() {
+ function initialize(object) {
+ this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
+ }
+
+
+ function _each(iterator) {
+ for (var key in this._object) {
+ var value = this._object[key], pair = [key, value];
+ pair.key = key;
+ pair.value = value;
+ iterator(pair);
+ }
+ }
+
+ function set(key, value) {
+ return this._object[key] = value;
+ }
+
+ function get(key) {
+ if (this._object[key] !== Object.prototype[key])
+ return this._object[key];
+ }
+
+ function unset(key) {
+ var value = this._object[key];
+ delete this._object[key];
+ return value;
+ }
+
+ function toObject() {
+ return Object.clone(this._object);
+ }
+
+
+
+ function keys() {
+ return this.pluck('key');
+ }
+
+ function values() {
+ return this.pluck('value');
+ }
+
+ function index(value) {
+ var match = this.detect(function(pair) {
+ return pair.value === value;
+ });
+ return match && match.key;
+ }
+
+ function merge(object) {
+ return this.clone().update(object);
+ }
+
+ function update(object) {
+ return new Hash(object).inject(this, function(result, pair) {
+ result.set(pair.key, pair.value);
+ return result;
+ });
+ }
+
+ function toQueryPair(key, value) {
+ if (Object.isUndefined(value)) return key;
+ return key + '=' + encodeURIComponent(String.interpret(value));
+ }
+
+ function toQueryString() {
+ return this.inject([], function(results, pair) {
+ var key = encodeURIComponent(pair.key), values = pair.value;
+
+ if (values && typeof values == 'object') {
+ if (Object.isArray(values)) {
+ var queryValues = [];
+ for (var i = 0, len = values.length, value; i < len; i++) {
+ value = values[i];
+ queryValues.push(toQueryPair(key, value));
+ }
+ return results.concat(queryValues);
+ }
+ } else results.push(toQueryPair(key, values));
+ return results;
+ }).join('&');
+ }
+
+ function inspect() {
+ return '#<Hash:{' + this.map(function(pair) {
+ return pair.map(Object.inspect).join(': ');
+ }).join(', ') + '}>';
+ }
+
+ function clone() {
+ return new Hash(this);
+ }
+
+ return {
+ initialize: initialize,
+ _each: _each,
+ set: set,
+ get: get,
+ unset: unset,
+ toObject: toObject,
+ toTemplateReplacements: toObject,
+ keys: keys,
+ values: values,
+ index: index,
+ merge: merge,
+ update: update,
+ toQueryString: toQueryString,
+ inspect: inspect,
+ toJSON: toObject,
+ clone: clone
+ };
+})());
+
+Hash.from = $H;
+Object.extend(Number.prototype, (function() {
+ function toColorPart() {
+ return this.toPaddedString(2, 16);
+ }
+
+ function succ() {
+ return this + 1;
+ }
+
+ function times(iterator, context) {
+ $R(0, this, true).each(iterator, context);
+ return this;
+ }
+
+ function toPaddedString(length, radix) {
+ var string = this.toString(radix || 10);
+ return '0'.times(length - string.length) + string;
+ }
+
+ function abs() {
+ return Math.abs(this);
+ }
+
+ function round() {
+ return Math.round(this);
+ }
+
+ function ceil() {
+ return Math.ceil(this);
+ }
+
+ function floor() {
+ return Math.floor(this);
+ }
+
+ return {
+ toColorPart: toColorPart,
+ succ: succ,
+ times: times,
+ toPaddedString: toPaddedString,
+ abs: abs,
+ round: round,
+ ceil: ceil,
+ floor: floor
+ };
+})());
+
+function $R(start, end, exclusive) {
+ return new ObjectRange(start, end, exclusive);
+}
+
+var ObjectRange = Class.create(Enumerable, (function() {
+ function initialize(start, end, exclusive) {
+ this.start = start;
+ this.end = end;
+ this.exclusive = exclusive;
+ }
+
+ function _each(iterator) {
+ var value = this.start;
+ while (this.include(value)) {
+ iterator(value);
+ value = value.succ();
+ }
+ }
+
+ function include(value) {
+ if (value < this.start)
+ return false;
+ if (this.exclusive)
+ return value < this.end;
+ return value <= this.end;
+ }
+
+ return {
+ initialize: initialize,
+ _each: _each,
+ include: include
+ };
+})());
+
+
+
+var Abstract = { };
+
+
+var Try = {
+ these: function() {
+ var returnValue;
+
+ for (var i = 0, length = arguments.length; i < length; i++) {
+ var lambda = arguments[i];
+ try {
+ returnValue = lambda();
+ break;
+ } catch (e) { }
+ }
+
+ return returnValue;
+ }
+};
+
+var Ajax = {
+ getTransport: function() {
+ return Try.these(
+ function() {return new XMLHttpRequest()},
+ function() {return new ActiveXObject('Msxml2.XMLHTTP')},
+ function() {return new ActiveXObject('Microsoft.XMLHTTP')}
+ ) || false;
+ },
+
+ activeRequestCount: 0
+};
+
+Ajax.Responders = {
+ responders: [],
+
+ _each: function(iterator) {
+ this.responders._each(iterator);
+ },
+
+ register: function(responder) {
+ if (!this.include(responder))
+ this.responders.push(responder);
+ },
+
+ unregister: function(responder) {
+ this.responders = this.responders.without(responder);
+ },
+
+ dispatch: function(callback, request, transport, json) {
+ this.each(function(responder) {
+ if (Object.isFunction(responder[callback])) {
+ try {
+ responder[callback].apply(responder, [request, transport, json]);
+ } catch (e) { }
+ }
+ });
+ }
+};
+
+Object.extend(Ajax.Responders, Enumerable);
+
+Ajax.Responders.register({
+ onCreate: function() { Ajax.activeRequestCount++ },
+ onComplete: function() { Ajax.activeRequestCount-- }
+});
+Ajax.Base = Class.create({
+ initialize: function(options) {
+ this.options = {
+ method: 'post',
+ asynchronous: true,
+ contentType: 'application/x-www-form-urlencoded',
+ encoding: 'UTF-8',
+ parameters: '',
+ evalJSON: true,
+ evalJS: true
+ };
+ Object.extend(this.options, options || { });
+
+ this.options.method = this.options.method.toLowerCase();
+
+ if (Object.isHash(this.options.parameters))
+ this.options.parameters = this.options.parameters.toObject();
+ }
+});
+Ajax.Request = Class.create(Ajax.Base, {
+ _complete: false,
+
+ initialize: function($super, url, options) {
+ $super(options);
+ this.transport = Ajax.getTransport();
+ this.request(url);
+ },
+
+ request: function(url) {
+ this.url = url;
+ this.method = this.options.method;
+ var params = Object.isString(this.options.parameters) ?
+ this.options.parameters :
+ Object.toQueryString(this.options.parameters);
+
+ if (!['get', 'post'].include(this.method)) {
+ params += (params ? '&' : '') + "_method=" + this.method;
+ this.method = 'post';
+ }
+
+ if (params && this.method === 'get') {
+ this.url += (this.url.include('?') ? '&' : '?') + params;
+ }
+
+ this.parameters = params.toQueryParams();
+
+ try {
+ var response = new Ajax.Response(this);
+ if (this.options.onCreate) this.options.onCreate(response);
+ Ajax.Responders.dispatch('onCreate', this, response);
+
+ this.transport.open(this.method.toUpperCase(), this.url,
+ this.options.asynchronous);
+
+ if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1);
+
+ this.transport.onreadystatechange = this.onStateChange.bind(this);
+ this.setRequestHeaders();
+
+ this.body = this.method == 'post' ? (this.options.postBody || params) : null;
+ this.transport.send(this.body);
+
+ /* Force Firefox to handle ready state 4 for synchronous requests */
+ if (!this.options.asynchronous && this.transport.overrideMimeType)
+ this.onStateChange();
+
+ }
+ catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ onStateChange: function() {
+ var readyState = this.transport.readyState;
+ if (readyState > 1 && !((readyState == 4) && this._complete))
+ this.respondToReadyState(this.transport.readyState);
+ },
+
+ setRequestHeaders: function() {
+ var headers = {
+ 'X-Requested-With': 'XMLHttpRequest',
+ 'X-Prototype-Version': Prototype.Version,
+ 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
+ };
+
+ if (this.method == 'post') {
+ headers['Content-type'] = this.options.contentType +
+ (this.options.encoding ? '; charset=' + this.options.encoding : '');
+
+ /* Force "Connection: close" for older Mozilla browsers to work
+ * around a bug where XMLHttpRequest sends an incorrect
+ * Content-length header. See Mozilla Bugzilla #246651.
+ */
+ if (this.transport.overrideMimeType &&
+ (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
+ headers['Connection'] = 'close';
+ }
+
+ if (typeof this.options.requestHeaders == 'object') {
+ var extras = this.options.requestHeaders;
+
+ if (Object.isFunction(extras.push))
+ for (var i = 0, length = extras.length; i < length; i += 2)
+ headers[extras[i]] = extras[i+1];
+ else
+ $H(extras).each(function(pair) { headers[pair.key] = pair.value });
+ }
+
+ for (var name in headers)
+ this.transport.setRequestHeader(name, headers[name]);
+ },
+
+ success: function() {
+ var status = this.getStatus();
+ return !status || (status >= 200 && status < 300) || status == 304;
+ },
+
+ getStatus: function() {
+ try {
+ if (this.transport.status === 1223) return 204;
+ return this.transport.status || 0;
+ } catch (e) { return 0 }
+ },
+
+ respondToReadyState: function(readyState) {
+ var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
+
+ if (state == 'Complete') {
+ try {
+ this._complete = true;
+ (this.options['on' + response.status]
+ || this.options['on' + (this.success() ? 'Success' : 'Failure')]
+ || Prototype.emptyFunction)(response, response.headerJSON);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ var contentType = response.getHeader('Content-type');
+ if (this.options.evalJS == 'force'
+ || (this.options.evalJS && this.isSameOrigin() && contentType
+ && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
+ this.evalResponse();
+ }
+
+ try {
+ (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON);
+ Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ if (state == 'Complete') {
+ this.transport.onreadystatechange = Prototype.emptyFunction;
+ }
+ },
+
+ isSameOrigin: function() {
+ var m = this.url.match(/^\s*https?:\/\/[^\/]*/);
+ return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({
+ protocol: location.protocol,
+ domain: document.domain,
+ port: location.port ? ':' + location.port : ''
+ }));
+ },
+
+ getHeader: function(name) {
+ try {
+ return this.transport.getResponseHeader(name) || null;
+ } catch (e) { return null; }
+ },
+
+ evalResponse: function() {
+ try {
+ return eval((this.transport.responseText || '').unfilterJSON());
+ } catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ dispatchException: function(exception) {
+ (this.options.onException || Prototype.emptyFunction)(this, exception);
+ Ajax.Responders.dispatch('onException', this, exception);
+ }
+});
+
+Ajax.Request.Events =
+ ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
+
+
+
+
+
+
+
+
+Ajax.Response = Class.create({
+ initialize: function(request){
+ this.request = request;
+ var transport = this.transport = request.transport,
+ readyState = this.readyState = transport.readyState;
+
+ if ((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) {
+ this.status = this.getStatus();
+ this.statusText = this.getStatusText();
+ this.responseText = String.interpret(transport.responseText);
+ this.headerJSON = this._getHeaderJSON();
+ }
+
+ if (readyState == 4) {
+ var xml = transport.responseXML;
+ this.responseXML = Object.isUndefined(xml) ? null : xml;
+ this.responseJSON = this._getResponseJSON();
+ }
+ },
+
+ status: 0,
+
+ statusText: '',
+
+ getStatus: Ajax.Request.prototype.getStatus,
+
+ getStatusText: function() {
+ try {
+ return this.transport.statusText || '';
+ } catch (e) { return '' }
+ },
+
+ getHeader: Ajax.Request.prototype.getHeader,
+
+ getAllHeaders: function() {
+ try {
+ return this.getAllResponseHeaders();
+ } catch (e) { return null }
+ },
+
+ getResponseHeader: function(name) {
+ return this.transport.getResponseHeader(name);
+ },
+
+ getAllResponseHeaders: function() {
+ return this.transport.getAllResponseHeaders();
+ },
+
+ _getHeaderJSON: function() {
+ var json = this.getHeader('X-JSON');
+ if (!json) return null;
+ json = decodeURIComponent(escape(json));
+ try {
+ return json.evalJSON(this.request.options.sanitizeJSON ||
+ !this.request.isSameOrigin());
+ } catch (e) {
+ this.request.dispatchException(e);
+ }
+ },
+
+ _getResponseJSON: function() {
+ var options = this.request.options;
+ if (!options.evalJSON || (options.evalJSON != 'force' &&
+ !(this.getHeader('Content-type') || '').include('application/json')) ||
+ this.responseText.blank())
+ return null;
+ try {
+ return this.responseText.evalJSON(options.sanitizeJSON ||
+ !this.request.isSameOrigin());
+ } catch (e) {
+ this.request.dispatchException(e);
+ }
+ }
+});
+
+Ajax.Updater = Class.create(Ajax.Request, {
+ initialize: function($super, container, url, options) {
+ this.container = {
+ success: (container.success || container),
+ failure: (container.failure || (container.success ? null : container))
+ };
+
+ options = Object.clone(options);
+ var onComplete = options.onComplete;
+ options.onComplete = (function(response, json) {
+ this.updateContent(response.responseText);
+ if (Object.isFunction(onComplete)) onComplete(response, json);
+ }).bind(this);
+
+ $super(url, options);
+ },
+
+ updateContent: function(responseText) {
+ var receiver = this.container[this.success() ? 'success' : 'failure'],
+ options = this.options;
+
+ if (!options.evalScripts) responseText = responseText.stripScripts();
+
+ if (receiver = $(receiver)) {
+ if (options.insertion) {
+ if (Object.isString(options.insertion)) {
+ var insertion = { }; insertion[options.insertion] = responseText;
+ receiver.insert(insertion);
+ }
+ else options.insertion(receiver, responseText);
+ }
+ else receiver.update(responseText);
+ }
+ }
+});
+
+Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
+ initialize: function($super, container, url, options) {
+ $super(options);
+ this.onComplete = this.options.onComplete;
+
+ this.frequency = (this.options.frequency || 2);
+ this.decay = (this.options.decay || 1);
+
+ this.updater = { };
+ this.container = container;
+ this.url = url;
+
+ this.start();
+ },
+
+ start: function() {
+ this.options.onComplete = this.updateComplete.bind(this);
+ this.onTimerEvent();
+ },
+
+ stop: function() {
+ this.updater.options.onComplete = undefined;
+ clearTimeout(this.timer);
+ (this.onComplete || Prototype.emptyFunction).apply(this, arguments);
+ },
+
+ updateComplete: function(response) {
+ if (this.options.decay) {
+ this.decay = (response.responseText == this.lastText ?
+ this.decay * this.options.decay : 1);
+
+ this.lastText = response.responseText;
+ }
+ this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency);
+ },
+
+ onTimerEvent: function() {
+ this.updater = new Ajax.Updater(this.container, this.url, this.options);
+ }
+});
+
+
+function $(element) {
+ if (arguments.length > 1) {
+ for (var i = 0, elements = [], length = arguments.length; i < length; i++)
+ elements.push($(arguments[i]));
+ return elements;
+ }
+ if (Object.isString(element))
+ element = document.getElementById(element);
+ return Element.extend(element);
+}
+
+if (Prototype.BrowserFeatures.XPath) {
+ document._getElementsByXPath = function(expression, parentElement) {
+ var results = [];
+ var query = document.evaluate(expression, $(parentElement) || document,
+ null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
+ for (var i = 0, length = query.snapshotLength; i < length; i++)
+ results.push(Element.extend(query.snapshotItem(i)));
+ return results;
+ };
+}
+
+/*--------------------------------------------------------------------------*/
+
+if (!Node) var Node = { };
+
+if (!Node.ELEMENT_NODE) {
+ Object.extend(Node, {
+ ELEMENT_NODE: 1,
+ ATTRIBUTE_NODE: 2,
+ TEXT_NODE: 3,
+ CDATA_SECTION_NODE: 4,
+ ENTITY_REFERENCE_NODE: 5,
+ ENTITY_NODE: 6,
+ PROCESSING_INSTRUCTION_NODE: 7,
+ COMMENT_NODE: 8,
+ DOCUMENT_NODE: 9,
+ DOCUMENT_TYPE_NODE: 10,
+ DOCUMENT_FRAGMENT_NODE: 11,
+ NOTATION_NODE: 12
+ });
+}
+
+
+
+(function(global) {
+ function shouldUseCache(tagName, attributes) {
+ if (tagName === 'select') return false;
+ if ('type' in attributes) return false;
+ return true;
+ }
+
+ var HAS_EXTENDED_CREATE_ELEMENT_SYNTAX = (function(){
+ try {
+ var el = document.createElement('<input name="x">');
+ return el.tagName.toLowerCase() === 'input' && el.name === 'x';
+ }
+ catch(err) {
+ return false;
+ }
+ })();
+
+ var element = global.Element;
+
+ global.Element = function(tagName, attributes) {
+ attributes = attributes || { };
+ tagName = tagName.toLowerCase();
+ var cache = Element.cache;
+
+ if (HAS_EXTENDED_CREATE_ELEMENT_SYNTAX && attributes.name) {
+ tagName = '<' + tagName + ' name="' + attributes.name + '">';
+ delete attributes.name;
+ return Element.writeAttribute(document.createElement(tagName), attributes);
+ }
+
+ if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName));
+
+ var node = shouldUseCache(tagName, attributes) ?
+ cache[tagName].cloneNode(false) : document.createElement(tagName);
+
+ return Element.writeAttribute(node, attributes);
+ };
+
+ Object.extend(global.Element, element || { });
+ if (element) global.Element.prototype = element.prototype;
+
+})(this);
+
+Element.idCounter = 1;
+Element.cache = { };
+
+Element._purgeElement = function(element) {
+ var uid = element._prototypeUID;
+ if (uid) {
+ Element.stopObserving(element);
+ element._prototypeUID = void 0;
+ delete Element.Storage[uid];
+ }
+}
+
+Element.Methods = {
+ visible: function(element) {
+ return $(element).style.display != 'none';
+ },
+
+ toggle: function(element) {
+ element = $(element);
+ Element[Element.visible(element) ? 'hide' : 'show'](element);
+ return element;
+ },
+
+ hide: function(element) {
+ element = $(element);
+ element.style.display = 'none';
+ return element;
+ },
+
+ show: function(element) {
+ element = $(element);
+ element.style.display = '';
+ return element;
+ },
+
+ remove: function(element) {
+ element = $(element);
+ element.parentNode.removeChild(element);
+ return element;
+ },
+
+ update: (function(){
+
+ var SELECT_ELEMENT_INNERHTML_BUGGY = (function(){
+ var el = document.createElement("select"),
+ isBuggy = true;
+ el.innerHTML = "<option value=\"test\">test</option>";
+ if (el.options && el.options[0]) {
+ isBuggy = el.options[0].nodeName.toUpperCase() !== "OPTION";
+ }
+ el = null;
+ return isBuggy;
+ })();
+
+ var TABLE_ELEMENT_INNERHTML_BUGGY = (function(){
+ try {
+ var el = document.createElement("table");
+ if (el && el.tBodies) {
+ el.innerHTML = "<tbody><tr><td>test</td></tr></tbody>";
+ var isBuggy = typeof el.tBodies[0] == "undefined";
+ el = null;
+ return isBuggy;
+ }
+ } catch (e) {
+ return true;
+ }
+ })();
+
+ var LINK_ELEMENT_INNERHTML_BUGGY = (function() {
+ try {
+ var el = document.createElement('div');
+ el.innerHTML = "<link>";
+ var isBuggy = (el.childNodes.length === 0);
+ el = null;
+ return isBuggy;
+ } catch(e) {
+ return true;
+ }
+ })();
+
+ var ANY_INNERHTML_BUGGY = SELECT_ELEMENT_INNERHTML_BUGGY ||
+ TABLE_ELEMENT_INNERHTML_BUGGY || LINK_ELEMENT_INNERHTML_BUGGY;
+
+ var SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING = (function () {
+ var s = document.createElement("script"),
+ isBuggy = false;
+ try {
+ s.appendChild(document.createTextNode(""));
+ isBuggy = !s.firstChild ||
+ s.firstChild && s.firstChild.nodeType !== 3;
+ } catch (e) {
+ isBuggy = true;
+ }
+ s = null;
+ return isBuggy;
+ })();
+
+
+ function update(element, content) {
+ element = $(element);
+ var purgeElement = Element._purgeElement;
+
+ var descendants = element.getElementsByTagName('*'),
+ i = descendants.length;
+ while (i--) purgeElement(descendants[i]);
+
+ if (content && content.toElement)
+ content = content.toElement();
+
+ if (Object.isElement(content))
+ return element.update().insert(content);
+
+ content = Object.toHTML(content);
+
+ var tagName = element.tagName.toUpperCase();
+
+ if (tagName === 'SCRIPT' && SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING) {
+ element.text = content;
+ return element;
+ }
+
+ if (ANY_INNERHTML_BUGGY) {
+ if (tagName in Element._insertionTranslations.tags) {
+ while (element.firstChild) {
+ element.removeChild(element.firstChild);
+ }
+ Element._getContentFromAnonymousElement(tagName, content.stripScripts())
+ .each(function(node) {
+ element.appendChild(node)
+ });
+ } else if (LINK_ELEMENT_INNERHTML_BUGGY && Object.isString(content) && content.indexOf('<link') > -1) {
+ while (element.firstChild) {
+ element.removeChild(element.firstChild);
+ }
+ var nodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts(), true);
+ nodes.each(function(node) { element.appendChild(node) });
+ }
+ else {
+ element.innerHTML = content.stripScripts();
+ }
+ }
+ else {
+ element.innerHTML = content.stripScripts();
+ }
+
+ content.evalScripts.bind(content).defer();
+ return element;
+ }
+
+ return update;
+ })(),
+
+ replace: function(element, content) {
+ element = $(element);
+ if (content && content.toElement) content = content.toElement();
+ else if (!Object.isElement(content)) {
+ content = Object.toHTML(content);
+ var range = element.ownerDocument.createRange();
+ range.selectNode(element);
+ content.evalScripts.bind(content).defer();
+ content = range.createContextualFragment(content.stripScripts());
+ }
+ element.parentNode.replaceChild(content, element);
+ return element;
+ },
+
+ insert: function(element, insertions) {
+ element = $(element);
+
+ if (Object.isString(insertions) || Object.isNumber(insertions) ||
+ Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
+ insertions = {bottom:insertions};
+
+ var content, insert, tagName, childNodes;
+
+ for (var position in insertions) {
+ content = insertions[position];
+ position = position.toLowerCase();
+ insert = Element._insertionTranslations[position];
+
+ if (content && content.toElement) content = content.toElement();
+ if (Object.isElement(content)) {
+ insert(element, content);
+ continue;
+ }
+
+ content = Object.toHTML(content);
+
+ tagName = ((position == 'before' || position == 'after')
+ ? element.parentNode : element).tagName.toUpperCase();
+
+ childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
+
+ if (position == 'top' || position == 'after') childNodes.reverse();
+ childNodes.each(insert.curry(element));
+
+ content.evalScripts.bind(content).defer();
+ }
+
+ return element;
+ },
+
+ wrap: function(element, wrapper, attributes) {
+ element = $(element);
+ if (Object.isElement(wrapper))
+ $(wrapper).writeAttribute(attributes || { });
+ else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes);
+ else wrapper = new Element('div', wrapper);
+ if (element.parentNode)
+ element.parentNode.replaceChild(wrapper, element);
+ wrapper.appendChild(element);
+ return wrapper;
+ },
+
+ inspect: function(element) {
+ element = $(element);
+ var result = '<' + element.tagName.toLowerCase();
+ $H({'id': 'id', 'className': 'class'}).each(function(pair) {
+ var property = pair.first(),
+ attribute = pair.last(),
+ value = (element[property] || '').toString();
+ if (value) result += ' ' + attribute + '=' + value.inspect(true);
+ });
+ return result + '>';
+ },
+
+ recursivelyCollect: function(element, property, maximumLength) {
+ element = $(element);
+ maximumLength = maximumLength || -1;
+ var elements = [];
+
+ while (element = element[property]) {
+ if (element.nodeType == 1)
+ elements.push(Element.extend(element));
+ if (elements.length == maximumLength)
+ break;
+ }
+
+ return elements;
+ },
+
+ ancestors: function(element) {
+ return Element.recursivelyCollect(element, 'parentNode');
+ },
+
+ descendants: function(element) {
+ return Element.select(element, "*");
+ },
+
+ firstDescendant: function(element) {
+ element = $(element).firstChild;
+ while (element && element.nodeType != 1) element = element.nextSibling;
+ return $(element);
+ },
+
+ immediateDescendants: function(element) {
+ var results = [], child = $(element).firstChild;
+ while (child) {
+ if (child.nodeType === 1) {
+ results.push(Element.extend(child));
+ }
+ child = child.nextSibling;
+ }
+ return results;
+ },
+
+ previousSiblings: function(element, maximumLength) {
+ return Element.recursivelyCollect(element, 'previousSibling');
+ },
+
+ nextSiblings: function(element) {
+ return Element.recursivelyCollect(element, 'nextSibling');
+ },
+
+ siblings: function(element) {
+ element = $(element);
+ return Element.previousSiblings(element).reverse()
+ .concat(Element.nextSiblings(element));
+ },
+
+ match: function(element, selector) {
+ element = $(element);
+ if (Object.isString(selector))
+ return Prototype.Selector.match(element, selector);
+ return selector.match(element);
+ },
+
+ up: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return $(element.parentNode);
+ var ancestors = Element.ancestors(element);
+ return Object.isNumber(expression) ? ancestors[expression] :
+ Prototype.Selector.find(ancestors, expression, index);
+ },
+
+ down: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return Element.firstDescendant(element);
+ return Object.isNumber(expression) ? Element.descendants(element)[expression] :
+ Element.select(element, expression)[index || 0];
+ },
+
+ previous: function(element, expression, index) {
+ element = $(element);
+ if (Object.isNumber(expression)) index = expression, expression = false;
+ if (!Object.isNumber(index)) index = 0;
+
+ if (expression) {
+ return Prototype.Selector.find(element.previousSiblings(), expression, index);
+ } else {
+ return element.recursivelyCollect("previousSibling", index + 1)[index];
+ }
+ },
+
+ next: function(element, expression, index) {
+ element = $(element);
+ if (Object.isNumber(expression)) index = expression, expression = false;
+ if (!Object.isNumber(index)) index = 0;
+
+ if (expression) {
+ return Prototype.Selector.find(element.nextSiblings(), expression, index);
+ } else {
+ var maximumLength = Object.isNumber(index) ? index + 1 : 1;
+ return element.recursivelyCollect("nextSibling", index + 1)[index];
+ }
+ },
+
+
+ select: function(element) {
+ element = $(element);
+ var expressions = Array.prototype.slice.call(arguments, 1).join(', ');
+ return Prototype.Selector.select(expressions, element);
+ },
+
+ adjacent: function(element) {
+ element = $(element);
+ var expressions = Array.prototype.slice.call(arguments, 1).join(', ');
+ return Prototype.Selector.select(expressions, element.parentNode).without(element);
+ },
+
+ identify: function(element) {
+ element = $(element);
+ var id = Element.readAttribute(element, 'id');
+ if (id) return id;
+ do { id = 'anonymous_element_' + Element.idCounter++ } while ($(id));
+ Element.writeAttribute(element, 'id', id);
+ return id;
+ },
+
+ readAttribute: function(element, name) {
+ element = $(element);
+ if (Prototype.Browser.IE) {
+ var t = Element._attributeTranslations.read;
+ if (t.values[name]) return t.values[name](element, name);
+ if (t.names[name]) name = t.names[name];
+ if (name.include(':')) {
+ return (!element.attributes || !element.attributes[name]) ? null :
+ element.attributes[name].value;
+ }
+ }
+ return element.getAttribute(name);
+ },
+
+ writeAttribute: function(element, name, value) {
+ element = $(element);
+ var attributes = { }, t = Element._attributeTranslations.write;
+
+ if (typeof name == 'object') attributes = name;
+ else attributes[name] = Object.isUndefined(value) ? true : value;
+
+ for (var attr in attributes) {
+ name = t.names[attr] || attr;
+ value = attributes[attr];
+ if (t.values[attr]) name = t.values[attr](element, value);
+ if (value === false || value === null)
+ element.removeAttribute(name);
+ else if (value === true)
+ element.setAttribute(name, name);
+ else element.setAttribute(name, value);
+ }
+ return element;
+ },
+
+ getHeight: function(element) {
+ return Element.getDimensions(element).height;
+ },
+
+ getWidth: function(element) {
+ return Element.getDimensions(element).width;
+ },
+
+ classNames: function(element) {
+ return new Element.ClassNames(element);
+ },
+
+ hasClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ var elementClassName = element.className;
+ return (elementClassName.length > 0 && (elementClassName == className ||
+ new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName)));
+ },
+
+ addClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ if (!Element.hasClassName(element, className))
+ element.className += (element.className ? ' ' : '') + className;
+ return element;
+ },
+
+ removeClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ element.className = element.className.replace(
+ new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip();
+ return element;
+ },
+
+ toggleClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ return Element[Element.hasClassName(element, className) ?
+ 'removeClassName' : 'addClassName'](element, className);
+ },
+
+ cleanWhitespace: function(element) {
+ element = $(element);
+ var node = element.firstChild;
+ while (node) {
+ var nextNode = node.nextSibling;
+ if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
+ element.removeChild(node);
+ node = nextNode;
+ }
+ return element;
+ },
+
+ empty: function(element) {
+ return $(element).innerHTML.blank();
+ },
+
+ descendantOf: function(element, ancestor) {
+ element = $(element), ancestor = $(ancestor);
+
+ if (element.compareDocumentPosition)
+ return (element.compareDocumentPosition(ancestor) & 8) === 8;
+
+ if (ancestor.contains)
+ return ancestor.contains(element) && ancestor !== element;
+
+ while (element = element.parentNode)
+ if (element == ancestor) return true;
+
+ return false;
+ },
+
+ scrollTo: function(element) {
+ element = $(element);
+ var pos = Element.cumulativeOffset(element);
+ window.scrollTo(pos[0], pos[1]);
+ return element;
+ },
+
+ getStyle: function(element, style) {
+ element = $(element);
+ style = style == 'float' ? 'cssFloat' : style.camelize();
+ var value = element.style[style];
+ if (!value || value == 'auto') {
+ var css = document.defaultView.getComputedStyle(element, null);
+ value = css ? css[style] : null;
+ }
+ if (style == 'opacity') return value ? parseFloat(value) : 1.0;
+ return value == 'auto' ? null : value;
+ },
+
+ getOpacity: function(element) {
+ return $(element).getStyle('opacity');
+ },
+
+ setStyle: function(element, styles) {
+ element = $(element);
+ var elementStyle = element.style, match;
+ if (Object.isString(styles)) {
+ element.style.cssText += ';' + styles;
+ return styles.include('opacity') ?
+ element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element;
+ }
+ for (var property in styles)
+ if (property == 'opacity') element.setOpacity(styles[property]);
+ else
+ elementStyle[(property == 'float' || property == 'cssFloat') ?
+ (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') :
+ property] = styles[property];
+
+ return element;
+ },
+
+ setOpacity: function(element, value) {
+ element = $(element);
+ element.style.opacity = (value == 1 || value === '') ? '' :
+ (value < 0.00001) ? 0 : value;
+ return element;
+ },
+
+ makePositioned: function(element) {
+ element = $(element);
+ var pos = Element.getStyle(element, 'position');
+ if (pos == 'static' || !pos) {
+ element._madePositioned = true;
+ element.style.position = 'relative';
+ if (Prototype.Browser.Opera) {
+ element.style.top = 0;
+ element.style.left = 0;
+ }
+ }
+ return element;
+ },
+
+ undoPositioned: function(element) {
+ element = $(element);
+ if (element._madePositioned) {
+ element._madePositioned = undefined;
+ element.style.position =
+ element.style.top =
+ element.style.left =
+ element.style.bottom =
+ element.style.right = '';
+ }
+ return element;
+ },
+
+ makeClipping: function(element) {
+ element = $(element);
+ if (element._overflow) return element;
+ element._overflow = Element.getStyle(element, 'overflow') || 'auto';
+ if (element._overflow !== 'hidden')
+ element.style.overflow = 'hidden';
+ return element;
+ },
+
+ undoClipping: function(element) {
+ element = $(element);
+ if (!element._overflow) return element;
+ element.style.overflow = element._overflow == 'auto' ? '' : element._overflow;
+ element._overflow = null;
+ return element;
+ },
+
+ clonePosition: function(element, source) {
+ var options = Object.extend({
+ setLeft: true,
+ setTop: true,
+ setWidth: true,
+ setHeight: true,
+ offsetTop: 0,
+ offsetLeft: 0
+ }, arguments[2] || { });
+
+ source = $(source);
+ var p = Element.viewportOffset(source), delta = [0, 0], parent = null;
+
+ element = $(element);
+
+ if (Element.getStyle(element, 'position') == 'absolute') {
+ parent = Element.getOffsetParent(element);
+ delta = Element.viewportOffset(parent);
+ }
+
+ if (parent == document.body) {
+ delta[0] -= document.body.offsetLeft;
+ delta[1] -= document.body.offsetTop;
+ }
+
+ if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px';
+ if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px';
+ if (options.setWidth) element.style.width = source.offsetWidth + 'px';
+ if (options.setHeight) element.style.height = source.offsetHeight + 'px';
+ return element;
+ }
+};
+
+Object.extend(Element.Methods, {
+ getElementsBySelector: Element.Methods.select,
+
+ childElements: Element.Methods.immediateDescendants
+});
+
+Element._attributeTranslations = {
+ write: {
+ names: {
+ className: 'class',
+ htmlFor: 'for'
+ },
+ values: { }
+ }
+};
+
+if (Prototype.Browser.Opera) {
+ Element.Methods.getStyle = Element.Methods.getStyle.wrap(
+ function(proceed, element, style) {
+ switch (style) {
+ case 'height': case 'width':
+ if (!Element.visible(element)) return null;
+
+ var dim = parseInt(proceed(element, style), 10);
+
+ if (dim !== element['offset' + style.capitalize()])
+ return dim + 'px';
+
+ var properties;
+ if (style === 'height') {
+ properties = ['border-top-width', 'padding-top',
+ 'padding-bottom', 'border-bottom-width'];
+ }
+ else {
+ properties = ['border-left-width', 'padding-left',
+ 'padding-right', 'border-right-width'];
+ }
+ return properties.inject(dim, function(memo, property) {
+ var val = proceed(element, property);
+ return val === null ? memo : memo - parseInt(val, 10);
+ }) + 'px';
+ default: return proceed(element, style);
+ }
+ }
+ );
+
+ Element.Methods.readAttribute = Element.Methods.readAttribute.wrap(
+ function(proceed, element, attribute) {
+ if (attribute === 'title') return element.title;
+ return proceed(element, attribute);
+ }
+ );
+}
+
+else if (Prototype.Browser.IE) {
+ Element.Methods.getStyle = function(element, style) {
+ element = $(element);
+ style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
+ var value = element.style[style];
+ if (!value && element.currentStyle) value = element.currentStyle[style];
+
+ if (style == 'opacity') {
+ if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))
+ if (value[1]) return parseFloat(value[1]) / 100;
+ return 1.0;
+ }
+
+ if (value == 'auto') {
+ if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none'))
+ return element['offset' + style.capitalize()] + 'px';
+ return null;
+ }
+ return value;
+ };
+
+ Element.Methods.setOpacity = function(element, value) {
+ function stripAlpha(filter){
+ return filter.replace(/alpha\([^\)]*\)/gi,'');
+ }
+ element = $(element);
+ var currentStyle = element.currentStyle;
+ if ((currentStyle && !currentStyle.hasLayout) ||
+ (!currentStyle && element.style.zoom == 'normal'))
+ element.style.zoom = 1;
+
+ var filter = element.getStyle('filter'), style = element.style;
+ if (value == 1 || value === '') {
+ (filter = stripAlpha(filter)) ?
+ style.filter = filter : style.removeAttribute('filter');
+ return element;
+ } else if (value < 0.00001) value = 0;
+ style.filter = stripAlpha(filter) +
+ 'alpha(opacity=' + (value * 100) + ')';
+ return element;
+ };
+
+ Element._attributeTranslations = (function(){
+
+ var classProp = 'className',
+ forProp = 'for',
+ el = document.createElement('div');
+
+ el.setAttribute(classProp, 'x');
+
+ if (el.className !== 'x') {
+ el.setAttribute('class', 'x');
+ if (el.className === 'x') {
+ classProp = 'class';
+ }
+ }
+ el = null;
+
+ el = document.createElement('label');
+ el.setAttribute(forProp, 'x');
+ if (el.htmlFor !== 'x') {
+ el.setAttribute('htmlFor', 'x');
+ if (el.htmlFor === 'x') {
+ forProp = 'htmlFor';
+ }
+ }
+ el = null;
+
+ return {
+ read: {
+ names: {
+ 'class': classProp,
+ 'className': classProp,
+ 'for': forProp,
+ 'htmlFor': forProp
+ },
+ values: {
+ _getAttr: function(element, attribute) {
+ return element.getAttribute(attribute);
+ },
+ _getAttr2: function(element, attribute) {
+ return element.getAttribute(attribute, 2);
+ },
+ _getAttrNode: function(element, attribute) {
+ var node = element.getAttributeNode(attribute);
+ return node ? node.value : "";
+ },
+ _getEv: (function(){
+
+ var el = document.createElement('div'), f;
+ el.onclick = Prototype.emptyFunction;
+ var value = el.getAttribute('onclick');
+
+ if (String(value).indexOf('{') > -1) {
+ f = function(element, attribute) {
+ attribute = element.getAttribute(attribute);
+ if (!attribute) return null;
+ attribute = attribute.toString();
+ attribute = attribute.split('{')[1];
+ attribute = attribute.split('}')[0];
+ return attribute.strip();
+ };
+ }
+ else if (value === '') {
+ f = function(element, attribute) {
+ attribute = element.getAttribute(attribute);
+ if (!attribute) return null;
+ return attribute.strip();
+ };
+ }
+ el = null;
+ return f;
+ })(),
+ _flag: function(element, attribute) {
+ return $(element).hasAttribute(attribute) ? attribute : null;
+ },
+ style: function(element) {
+ return element.style.cssText.toLowerCase();
+ },
+ title: function(element) {
+ return element.title;
+ }
+ }
+ }
+ }
+ })();
+
+ Element._attributeTranslations.write = {
+ names: Object.extend({
+ cellpadding: 'cellPadding',
+ cellspacing: 'cellSpacing'
+ }, Element._attributeTranslations.read.names),
+ values: {
+ checked: function(element, value) {
+ element.checked = !!value;
+ },
+
+ style: function(element, value) {
+ element.style.cssText = value ? value : '';
+ }
+ }
+ };
+
+ Element._attributeTranslations.has = {};
+
+ $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' +
+ 'encType maxLength readOnly longDesc frameBorder').each(function(attr) {
+ Element._attributeTranslations.write.names[attr.toLowerCase()] = attr;
+ Element._attributeTranslations.has[attr.toLowerCase()] = attr;
+ });
+
+ (function(v) {
+ Object.extend(v, {
+ href: v._getAttr2,
+ src: v._getAttr2,
+ type: v._getAttr,
+ action: v._getAttrNode,
+ disabled: v._flag,
+ checked: v._flag,
+ readonly: v._flag,
+ multiple: v._flag,
+ onload: v._getEv,
+ onunload: v._getEv,
+ onclick: v._getEv,
+ ondblclick: v._getEv,
+ onmousedown: v._getEv,
+ onmouseup: v._getEv,
+ onmouseover: v._getEv,
+ onmousemove: v._getEv,
+ onmouseout: v._getEv,
+ onfocus: v._getEv,
+ onblur: v._getEv,
+ onkeypress: v._getEv,
+ onkeydown: v._getEv,
+ onkeyup: v._getEv,
+ onsubmit: v._getEv,
+ onreset: v._getEv,
+ onselect: v._getEv,
+ onchange: v._getEv
+ });
+ })(Element._attributeTranslations.read.values);
+
+ if (Prototype.BrowserFeatures.ElementExtensions) {
+ (function() {
+ function _descendants(element) {
+ var nodes = element.getElementsByTagName('*'), results = [];
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (node.tagName !== "!") // Filter out comment nodes.
+ results.push(node);
+ return results;
+ }
+
+ Element.Methods.down = function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return element.firstDescendant();
+ return Object.isNumber(expression) ? _descendants(element)[expression] :
+ Element.select(element, expression)[index || 0];
+ }
+ })();
+ }
+
+}
+
+else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) {
+ Element.Methods.setOpacity = function(element, value) {
+ element = $(element);
+ element.style.opacity = (value == 1) ? 0.999999 :
+ (value === '') ? '' : (value < 0.00001) ? 0 : value;
+ return element;
+ };
+}
+
+else if (Prototype.Browser.WebKit) {
+ Element.Methods.setOpacity = function(element, value) {
+ element = $(element);
+ element.style.opacity = (value == 1 || value === '') ? '' :
+ (value < 0.00001) ? 0 : value;
+
+ if (value == 1)
+ if (element.tagName.toUpperCase() == 'IMG' && element.width) {
+ element.width++; element.width--;
+ } else try {
+ var n = document.createTextNode(' ');
+ element.appendChild(n);
+ element.removeChild(n);
+ } catch (e) { }
+
+ return element;
+ };
+}
+
+if ('outerHTML' in document.documentElement) {
+ Element.Methods.replace = function(element, content) {
+ element = $(element);
+
+ if (content && content.toElement) content = content.toElement();
+ if (Object.isElement(content)) {
+ element.parentNode.replaceChild(content, element);
+ return element;
+ }
+
+ content = Object.toHTML(content);
+ var parent = element.parentNode, tagName = parent.tagName.toUpperCase();
+
+ if (Element._insertionTranslations.tags[tagName]) {
+ var nextSibling = element.next(),
+ fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
+ parent.removeChild(element);
+ if (nextSibling)
+ fragments.each(function(node) { parent.insertBefore(node, nextSibling) });
+ else
+ fragments.each(function(node) { parent.appendChild(node) });
+ }
+ else element.outerHTML = content.stripScripts();
+
+ content.evalScripts.bind(content).defer();
+ return element;
+ };
+}
+
+Element._returnOffset = function(l, t) {
+ var result = [l, t];
+ result.left = l;
+ result.top = t;
+ return result;
+};
+
+Element._getContentFromAnonymousElement = function(tagName, html, force) {
+ var div = new Element('div'),
+ t = Element._insertionTranslations.tags[tagName];
+
+ var workaround = false;
+ if (t) workaround = true;
+ else if (force) {
+ workaround = true;
+ t = ['', '', 0];
+ }
+
+ if (workaround) {
+ div.innerHTML = '&nbsp;' + t[0] + html + t[1];
+ div.removeChild(div.firstChild);
+ for (var i = t[2]; i--; ) {
+ div = div.firstChild;
+ }
+ }
+ else {
+ div.innerHTML = html;
+ }
+ return $A(div.childNodes);
+};
+
+Element._insertionTranslations = {
+ before: function(element, node) {
+ element.parentNode.insertBefore(node, element);
+ },
+ top: function(element, node) {
+ element.insertBefore(node, element.firstChild);
+ },
+ bottom: function(element, node) {
+ element.appendChild(node);
+ },
+ after: function(element, node) {
+ element.parentNode.insertBefore(node, element.nextSibling);
+ },
+ tags: {
+ TABLE: ['<table>', '</table>', 1],
+ TBODY: ['<table><tbody>', '</tbody></table>', 2],
+ TR: ['<table><tbody><tr>', '</tr></tbody></table>', 3],
+ TD: ['<table><tbody><tr><td>', '</td></tr></tbody></table>', 4],
+ SELECT: ['<select>', '</select>', 1]
+ }
+};
+
+(function() {
+ var tags = Element._insertionTranslations.tags;
+ Object.extend(tags, {
+ THEAD: tags.TBODY,
+ TFOOT: tags.TBODY,
+ TH: tags.TD
+ });
+})();
+
+Element.Methods.Simulated = {
+ hasAttribute: function(element, attribute) {
+ attribute = Element._attributeTranslations.has[attribute] || attribute;
+ var node = $(element).getAttributeNode(attribute);
+ return !!(node && node.specified);
+ }
+};
+
+Element.Methods.ByTag = { };
+
+Object.extend(Element, Element.Methods);
+
+(function(div) {
+
+ if (!Prototype.BrowserFeatures.ElementExtensions && div['__proto__']) {
+ window.HTMLElement = { };
+ window.HTMLElement.prototype = div['__proto__'];
+ Prototype.BrowserFeatures.ElementExtensions = true;
+ }
+
+ div = null;
+
+})(document.createElement('div'));
+
+Element.extend = (function() {
+
+ function checkDeficiency(tagName) {
+ if (typeof window.Element != 'undefined') {
+ var proto = window.Element.prototype;
+ if (proto) {
+ var id = '_' + (Math.random()+'').slice(2),
+ el = document.createElement(tagName);
+ proto[id] = 'x';
+ var isBuggy = (el[id] !== 'x');
+ delete proto[id];
+ el = null;
+ return isBuggy;
+ }
+ }
+ return false;
+ }
+
+ function extendElementWith(element, methods) {
+ for (var property in methods) {
+ var value = methods[property];
+ if (Object.isFunction(value) && !(property in element))
+ element[property] = value.methodize();
+ }
+ }
+
+ var HTMLOBJECTELEMENT_PROTOTYPE_BUGGY = checkDeficiency('object');
+
+ if (Prototype.BrowserFeatures.SpecificElementExtensions) {
+ if (HTMLOBJECTELEMENT_PROTOTYPE_BUGGY) {
+ return function(element) {
+ if (element && typeof element._extendedByPrototype == 'undefined') {
+ var t = element.tagName;
+ if (t && (/^(?:object|applet|embed)$/i.test(t))) {
+ extendElementWith(element, Element.Methods);
+ extendElementWith(element, Element.Methods.Simulated);
+ extendElementWith(element, Element.Methods.ByTag[t.toUpperCase()]);
+ }
+ }
+ return element;
+ }
+ }
+ return Prototype.K;
+ }
+
+ var Methods = { }, ByTag = Element.Methods.ByTag;
+
+ var extend = Object.extend(function(element) {
+ if (!element || typeof element._extendedByPrototype != 'undefined' ||
+ element.nodeType != 1 || element == window) return element;
+
+ var methods = Object.clone(Methods),
+ tagName = element.tagName.toUpperCase();
+
+ if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]);
+
+ extendElementWith(element, methods);
+
+ element._extendedByPrototype = Prototype.emptyFunction;
+ return element;
+
+ }, {
+ refresh: function() {
+ if (!Prototype.BrowserFeatures.ElementExtensions) {
+ Object.extend(Methods, Element.Methods);
+ Object.extend(Methods, Element.Methods.Simulated);
+ }
+ }
+ });
+
+ extend.refresh();
+ return extend;
+})();
+
+if (document.documentElement.hasAttribute) {
+ Element.hasAttribute = function(element, attribute) {
+ return element.hasAttribute(attribute);
+ };
+}
+else {
+ Element.hasAttribute = Element.Methods.Simulated.hasAttribute;
+}
+
+Element.addMethods = function(methods) {
+ var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
+
+ if (!methods) {
+ Object.extend(Form, Form.Methods);
+ Object.extend(Form.Element, Form.Element.Methods);
+ Object.extend(Element.Methods.ByTag, {
+ "FORM": Object.clone(Form.Methods),
+ "INPUT": Object.clone(Form.Element.Methods),
+ "SELECT": Object.clone(Form.Element.Methods),
+ "TEXTAREA": Object.clone(Form.Element.Methods),
+ "BUTTON": Object.clone(Form.Element.Methods)
+ });
+ }
+
+ if (arguments.length == 2) {
+ var tagName = methods;
+ methods = arguments[1];
+ }
+
+ if (!tagName) Object.extend(Element.Methods, methods || { });
+ else {
+ if (Object.isArray(tagName)) tagName.each(extend);
+ else extend(tagName);
+ }
+
+ function extend(tagName) {
+ tagName = tagName.toUpperCase();
+ if (!Element.Methods.ByTag[tagName])
+ Element.Methods.ByTag[tagName] = { };
+ Object.extend(Element.Methods.ByTag[tagName], methods);
+ }
+
+ function copy(methods, destination, onlyIfAbsent) {
+ onlyIfAbsent = onlyIfAbsent || false;
+ for (var property in methods) {
+ var value = methods[property];
+ if (!Object.isFunction(value)) continue;
+ if (!onlyIfAbsent || !(property in destination))
+ destination[property] = value.methodize();
+ }
+ }
+
+ function findDOMClass(tagName) {
+ var klass;
+ var trans = {
+ "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph",
+ "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList",
+ "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading",
+ "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote",
+ "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION":
+ "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD":
+ "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR":
+ "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET":
+ "FrameSet", "IFRAME": "IFrame"
+ };
+ if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element';
+ if (window[klass]) return window[klass];
+ klass = 'HTML' + tagName + 'Element';
+ if (window[klass]) return window[klass];
+ klass = 'HTML' + tagName.capitalize() + 'Element';
+ if (window[klass]) return window[klass];
+
+ var element = document.createElement(tagName),
+ proto = element['__proto__'] || element.constructor.prototype;
+
+ element = null;
+ return proto;
+ }
+
+ var elementPrototype = window.HTMLElement ? HTMLElement.prototype :
+ Element.prototype;
+
+ if (F.ElementExtensions) {
+ copy(Element.Methods, elementPrototype);
+ copy(Element.Methods.Simulated, elementPrototype, true);
+ }
+
+ if (F.SpecificElementExtensions) {
+ for (var tag in Element.Methods.ByTag) {
+ var klass = findDOMClass(tag);
+ if (Object.isUndefined(klass)) continue;
+ copy(T[tag], klass.prototype);
+ }
+ }
+
+ Object.extend(Element, Element.Methods);
+ delete Element.ByTag;
+
+ if (Element.extend.refresh) Element.extend.refresh();
+ Element.cache = { };
+};
+
+
+document.viewport = {
+
+ getDimensions: function() {
+ return { width: this.getWidth(), height: this.getHeight() };
+ },
+
+ getScrollOffsets: function() {
+ return Element._returnOffset(
+ window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,
+ window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop);
+ }
+};
+
+(function(viewport) {
+ var B = Prototype.Browser, doc = document, element, property = {};
+
+ function getRootElement() {
+ if (B.WebKit && !doc.evaluate)
+ return document;
+
+ if (B.Opera && window.parseFloat(window.opera.version()) < 9.5)
+ return document.body;
+
+ return document.documentElement;
+ }
+
+ function define(D) {
+ if (!element) element = getRootElement();
+
+ property[D] = 'client' + D;
+
+ viewport['get' + D] = function() { return element[property[D]] };
+ return viewport['get' + D]();
+ }
+
+ viewport.getWidth = define.curry('Width');
+
+ viewport.getHeight = define.curry('Height');
+})(document.viewport);
+
+
+Element.Storage = {
+ UID: 1
+};
+
+Element.addMethods({
+ getStorage: function(element) {
+ if (!(element = $(element))) return;
+
+ var uid;
+ if (element === window) {
+ uid = 0;
+ } else {
+ if (typeof element._prototypeUID === "undefined")
+ element._prototypeUID = Element.Storage.UID++;
+ uid = element._prototypeUID;
+ }
+
+ if (!Element.Storage[uid])
+ Element.Storage[uid] = $H();
+
+ return Element.Storage[uid];
+ },
+
+ store: function(element, key, value) {
+ if (!(element = $(element))) return;
+
+ if (arguments.length === 2) {
+ Element.getStorage(element).update(key);
+ } else {
+ Element.getStorage(element).set(key, value);
+ }
+
+ return element;
+ },
+
+ retrieve: function(element, key, defaultValue) {
+ if (!(element = $(element))) return;
+ var hash = Element.getStorage(element), value = hash.get(key);
+
+ if (Object.isUndefined(value)) {
+ hash.set(key, defaultValue);
+ value = defaultValue;
+ }
+
+ return value;
+ },
+
+ clone: function(element, deep) {
+ if (!(element = $(element))) return;
+ var clone = element.cloneNode(deep);
+ clone._prototypeUID = void 0;
+ if (deep) {
+ var descendants = Element.select(clone, '*'),
+ i = descendants.length;
+ while (i--) {
+ descendants[i]._prototypeUID = void 0;
+ }
+ }
+ return Element.extend(clone);
+ },
+
+ purge: function(element) {
+ if (!(element = $(element))) return;
+ var purgeElement = Element._purgeElement;
+
+ purgeElement(element);
+
+ var descendants = element.getElementsByTagName('*'),
+ i = descendants.length;
+
+ while (i--) purgeElement(descendants[i]);
+
+ return null;
+ }
+});
+
+(function() {
+
+ function toDecimal(pctString) {
+ var match = pctString.match(/^(\d+)%?$/i);
+ if (!match) return null;
+ return (Number(match[1]) / 100);
+ }
+
+ function getPixelValue(value, property, context) {
+ var element = null;
+ if (Object.isElement(value)) {
+ element = value;
+ value = element.getStyle(property);
+ }
+
+ if (value === null) {
+ return null;
+ }
+
+ if ((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(value)) {
+ return window.parseFloat(value);
+ }
+
+ var isPercentage = value.include('%'), isViewport = (context === document.viewport);
+
+ if (/\d/.test(value) && element && element.runtimeStyle && !(isPercentage && isViewport)) {
+ var style = element.style.left, rStyle = element.runtimeStyle.left;
+ element.runtimeStyle.left = element.currentStyle.left;
+ element.style.left = value || 0;
+ value = element.style.pixelLeft;
+ element.style.left = style;
+ element.runtimeStyle.left = rStyle;
+
+ return value;
+ }
+
+ if (element && isPercentage) {
+ context = context || element.parentNode;
+ var decimal = toDecimal(value);
+ var whole = null;
+ var position = element.getStyle('position');
+
+ var isHorizontal = property.include('left') || property.include('right') ||
+ property.include('width');
+
+ var isVertical = property.include('top') || property.include('bottom') ||
+ property.include('height');
+
+ if (context === document.viewport) {
+ if (isHorizontal) {
+ whole = document.viewport.getWidth();
+ } else if (isVertical) {
+ whole = document.viewport.getHeight();
+ }
+ } else {
+ if (isHorizontal) {
+ whole = $(context).measure('width');
+ } else if (isVertical) {
+ whole = $(context).measure('height');
+ }
+ }
+
+ return (whole === null) ? 0 : whole * decimal;
+ }
+
+ return 0;
+ }
+
+ function toCSSPixels(number) {
+ if (Object.isString(number) && number.endsWith('px')) {
+ return number;
+ }
+ return number + 'px';
+ }
+
+ function isDisplayed(element) {
+ var originalElement = element;
+ while (element && element.parentNode) {
+ var display = element.getStyle('display');
+ if (display === 'none') {
+ return false;
+ }
+ element = $(element.parentNode);
+ }
+ return true;
+ }
+
+ var hasLayout = Prototype.K;
+ if ('currentStyle' in document.documentElement) {
+ hasLayout = function(element) {
+ if (!element.currentStyle.hasLayout) {
+ element.style.zoom = 1;
+ }
+ return element;
+ };
+ }
+
+ function cssNameFor(key) {
+ if (key.include('border')) key = key + '-width';
+ return key.camelize();
+ }
+
+ Element.Layout = Class.create(Hash, {
+ initialize: function($super, element, preCompute) {
+ $super();
+ this.element = $(element);
+
+ Element.Layout.PROPERTIES.each( function(property) {
+ this._set(property, null);
+ }, this);
+
+ if (preCompute) {
+ this._preComputing = true;
+ this._begin();
+ Element.Layout.PROPERTIES.each( this._compute, this );
+ this._end();
+ this._preComputing = false;
+ }
+ },
+
+ _set: function(property, value) {
+ return Hash.prototype.set.call(this, property, value);
+ },
+
+ set: function(property, value) {
+ throw "Properties of Element.Layout are read-only.";
+ },
+
+ get: function($super, property) {
+ var value = $super(property);
+ return value === null ? this._compute(property) : value;
+ },
+
+ _begin: function() {
+ if (this._prepared) return;
+
+ var element = this.element;
+ if (isDisplayed(element)) {
+ this._prepared = true;
+ return;
+ }
+
+ var originalStyles = {
+ position: element.style.position || '',
+ width: element.style.width || '',
+ visibility: element.style.visibility || '',
+ display: element.style.display || ''
+ };
+
+ element.store('prototype_original_styles', originalStyles);
+
+ var position = element.getStyle('position'),
+ width = element.getStyle('width');
+
+ if (width === "0px" || width === null) {
+ element.style.display = 'block';
+ width = element.getStyle('width');
+ }
+
+ var context = (position === 'fixed') ? document.viewport :
+ element.parentNode;
+
+ element.setStyle({
+ position: 'absolute',
+ visibility: 'hidden',
+ display: 'block'
+ });
+
+ var positionedWidth = element.getStyle('width');
+
+ var newWidth;
+ if (width && (positionedWidth === width)) {
+ newWidth = getPixelValue(element, 'width', context);
+ } else if (position === 'absolute' || position === 'fixed') {
+ newWidth = getPixelValue(element, 'width', context);
+ } else {
+ var parent = element.parentNode, pLayout = $(parent).getLayout();
+
+ newWidth = pLayout.get('width') -
+ this.get('margin-left') -
+ this.get('border-left') -
+ this.get('padding-left') -
+ this.get('padding-right') -
+ this.get('border-right') -
+ this.get('margin-right');
+ }
+
+ element.setStyle({ width: newWidth + 'px' });
+
+ this._prepared = true;
+ },
+
+ _end: function() {
+ var element = this.element;
+ var originalStyles = element.retrieve('prototype_original_styles');
+ element.store('prototype_original_styles', null);
+ element.setStyle(originalStyles);
+ this._prepared = false;
+ },
+
+ _compute: function(property) {
+ var COMPUTATIONS = Element.Layout.COMPUTATIONS;
+ if (!(property in COMPUTATIONS)) {
+ throw "Property not found.";
+ }
+
+ return this._set(property, COMPUTATIONS[property].call(this, this.element));
+ },
+
+ toObject: function() {
+ var args = $A(arguments);
+ var keys = (args.length === 0) ? Element.Layout.PROPERTIES :
+ args.join(' ').split(' ');
+ var obj = {};
+ keys.each( function(key) {
+ if (!Element.Layout.PROPERTIES.include(key)) return;
+ var value = this.get(key);
+ if (value != null) obj[key] = value;
+ }, this);
+ return obj;
+ },
+
+ toHash: function() {
+ var obj = this.toObject.apply(this, arguments);
+ return new Hash(obj);
+ },
+
+ toCSS: function() {
+ var args = $A(arguments);
+ var keys = (args.length === 0) ? Element.Layout.PROPERTIES :
+ args.join(' ').split(' ');
+ var css = {};
+
+ keys.each( function(key) {
+ if (!Element.Layout.PROPERTIES.include(key)) return;
+ if (Element.Layout.COMPOSITE_PROPERTIES.include(key)) return;
+
+ var value = this.get(key);
+ if (value != null) css[cssNameFor(key)] = value + 'px';
+ }, this);
+ return css;
+ },
+
+ inspect: function() {
+ return "#<Element.Layout>";
+ }
+ });
+
+ Object.extend(Element.Layout, {
+ PROPERTIES: $w('height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height'),
+
+ COMPOSITE_PROPERTIES: $w('padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height'),
+
+ COMPUTATIONS: {
+ 'height': function(element) {
+ if (!this._preComputing) this._begin();
+
+ var bHeight = this.get('border-box-height');
+ if (bHeight <= 0) {
+ if (!this._preComputing) this._end();
+ return 0;
+ }
+
+ var bTop = this.get('border-top'),
+ bBottom = this.get('border-bottom');
+
+ var pTop = this.get('padding-top'),
+ pBottom = this.get('padding-bottom');
+
+ if (!this._preComputing) this._end();
+
+ return bHeight - bTop - bBottom - pTop - pBottom;
+ },
+
+ 'width': function(element) {
+ if (!this._preComputing) this._begin();
+
+ var bWidth = this.get('border-box-width');
+ if (bWidth <= 0) {
+ if (!this._preComputing) this._end();
+ return 0;
+ }
+
+ var bLeft = this.get('border-left'),
+ bRight = this.get('border-right');
+
+ var pLeft = this.get('padding-left'),
+ pRight = this.get('padding-right');
+
+ if (!this._preComputing) this._end();
+
+ return bWidth - bLeft - bRight - pLeft - pRight;
+ },
+
+ 'padding-box-height': function(element) {
+ var height = this.get('height'),
+ pTop = this.get('padding-top'),
+ pBottom = this.get('padding-bottom');
+
+ return height + pTop + pBottom;
+ },
+
+ 'padding-box-width': function(element) {
+ var width = this.get('width'),
+ pLeft = this.get('padding-left'),
+ pRight = this.get('padding-right');
+
+ return width + pLeft + pRight;
+ },
+
+ 'border-box-height': function(element) {
+ if (!this._preComputing) this._begin();
+ var height = element.offsetHeight;
+ if (!this._preComputing) this._end();
+ return height;
+ },
+
+ 'border-box-width': function(element) {
+ if (!this._preComputing) this._begin();
+ var width = element.offsetWidth;
+ if (!this._preComputing) this._end();
+ return width;
+ },
+
+ 'margin-box-height': function(element) {
+ var bHeight = this.get('border-box-height'),
+ mTop = this.get('margin-top'),
+ mBottom = this.get('margin-bottom');
+
+ if (bHeight <= 0) return 0;
+
+ return bHeight + mTop + mBottom;
+ },
+
+ 'margin-box-width': function(element) {
+ var bWidth = this.get('border-box-width'),
+ mLeft = this.get('margin-left'),
+ mRight = this.get('margin-right');
+
+ if (bWidth <= 0) return 0;
+
+ return bWidth + mLeft + mRight;
+ },
+
+ 'top': function(element) {
+ var offset = element.positionedOffset();
+ return offset.top;
+ },
+
+ 'bottom': function(element) {
+ var offset = element.positionedOffset(),
+ parent = element.getOffsetParent(),
+ pHeight = parent.measure('height');
+
+ var mHeight = this.get('border-box-height');
+
+ return pHeight - mHeight - offset.top;
+ },
+
+ 'left': function(element) {
+ var offset = element.positionedOffset();
+ return offset.left;
+ },
+
+ 'right': function(element) {
+ var offset = element.positionedOffset(),
+ parent = element.getOffsetParent(),
+ pWidth = parent.measure('width');
+
+ var mWidth = this.get('border-box-width');
+
+ return pWidth - mWidth - offset.left;
+ },
+
+ 'padding-top': function(element) {
+ return getPixelValue(element, 'paddingTop');
+ },
+
+ 'padding-bottom': function(element) {
+ return getPixelValue(element, 'paddingBottom');
+ },
+
+ 'padding-left': function(element) {
+ return getPixelValue(element, 'paddingLeft');
+ },
+
+ 'padding-right': function(element) {
+ return getPixelValue(element, 'paddingRight');
+ },
+
+ 'border-top': function(element) {
+ return getPixelValue(element, 'borderTopWidth');
+ },
+
+ 'border-bottom': function(element) {
+ return getPixelValue(element, 'borderBottomWidth');
+ },
+
+ 'border-left': function(element) {
+ return getPixelValue(element, 'borderLeftWidth');
+ },
+
+ 'border-right': function(element) {
+ return getPixelValue(element, 'borderRightWidth');
+ },
+
+ 'margin-top': function(element) {
+ return getPixelValue(element, 'marginTop');
+ },
+
+ 'margin-bottom': function(element) {
+ return getPixelValue(element, 'marginBottom');
+ },
+
+ 'margin-left': function(element) {
+ return getPixelValue(element, 'marginLeft');
+ },
+
+ 'margin-right': function(element) {
+ return getPixelValue(element, 'marginRight');
+ }
+ }
+ });
+
+ if ('getBoundingClientRect' in document.documentElement) {
+ Object.extend(Element.Layout.COMPUTATIONS, {
+ 'right': function(element) {
+ var parent = hasLayout(element.getOffsetParent());
+ var rect = element.getBoundingClientRect(),
+ pRect = parent.getBoundingClientRect();
+
+ return (pRect.right - rect.right).round();
+ },
+
+ 'bottom': function(element) {
+ var parent = hasLayout(element.getOffsetParent());
+ var rect = element.getBoundingClientRect(),
+ pRect = parent.getBoundingClientRect();
+
+ return (pRect.bottom - rect.bottom).round();
+ }
+ });
+ }
+
+ Element.Offset = Class.create({
+ initialize: function(left, top) {
+ this.left = left.round();
+ this.top = top.round();
+
+ this[0] = this.left;
+ this[1] = this.top;
+ },
+
+ relativeTo: function(offset) {
+ return new Element.Offset(
+ this.left - offset.left,
+ this.top - offset.top
+ );
+ },
+
+ inspect: function() {
+ return "#<Element.Offset left: #{left} top: #{top}>".interpolate(this);
+ },
+
+ toString: function() {
+ return "[#{left}, #{top}]".interpolate(this);
+ },
+
+ toArray: function() {
+ return [this.left, this.top];
+ }
+ });
+
+ function getLayout(element, preCompute) {
+ return new Element.Layout(element, preCompute);
+ }
+
+ function measure(element, property) {
+ return $(element).getLayout().get(property);
+ }
+
+ function getDimensions(element) {
+ element = $(element);
+ var display = Element.getStyle(element, 'display');
+
+ if (display && display !== 'none') {
+ return { width: element.offsetWidth, height: element.offsetHeight };
+ }
+
+ var style = element.style;
+ var originalStyles = {
+ visibility: style.visibility,
+ position: style.position,
+ display: style.display
+ };
+
+ var newStyles = {
+ visibility: 'hidden',
+ display: 'block'
+ };
+
+ if (originalStyles.position !== 'fixed')
+ newStyles.position = 'absolute';
+
+ Element.setStyle(element, newStyles);
+
+ var dimensions = {
+ width: element.offsetWidth,
+ height: element.offsetHeight
+ };
+
+ Element.setStyle(element, originalStyles);
+
+ return dimensions;
+ }
+
+ function getOffsetParent(element) {
+ element = $(element);
+
+ if (isDocument(element) || isDetached(element) || isBody(element) || isHtml(element))
+ return $(document.body);
+
+ var isInline = (Element.getStyle(element, 'display') === 'inline');
+ if (!isInline && element.offsetParent) return $(element.offsetParent);
+
+ while ((element = element.parentNode) && element !== document.body) {
+ if (Element.getStyle(element, 'position') !== 'static') {
+ return isHtml(element) ? $(document.body) : $(element);
+ }
+ }
+
+ return $(document.body);
+ }
+
+
+ function cumulativeOffset(element) {
+ element = $(element);
+ var valueT = 0, valueL = 0;
+ if (element.parentNode) {
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ element = element.offsetParent;
+ } while (element);
+ }
+ return new Element.Offset(valueL, valueT);
+ }
+
+ function positionedOffset(element) {
+ element = $(element);
+
+ var layout = element.getLayout();
+
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ element = element.offsetParent;
+ if (element) {
+ if (isBody(element)) break;
+ var p = Element.getStyle(element, 'position');
+ if (p !== 'static') break;
+ }
+ } while (element);
+
+ valueL -= layout.get('margin-top');
+ valueT -= layout.get('margin-left');
+
+ return new Element.Offset(valueL, valueT);
+ }
+
+ function cumulativeScrollOffset(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.scrollTop || 0;
+ valueL += element.scrollLeft || 0;
+ element = element.parentNode;
+ } while (element);
+ return new Element.Offset(valueL, valueT);
+ }
+
+ function viewportOffset(forElement) {
+ element = $(element);
+ var valueT = 0, valueL = 0, docBody = document.body;
+
+ var element = forElement;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ if (element.offsetParent == docBody &&
+ Element.getStyle(element, 'position') == 'absolute') break;
+ } while (element = element.offsetParent);
+
+ element = forElement;
+ do {
+ if (element != docBody) {
+ valueT -= element.scrollTop || 0;
+ valueL -= element.scrollLeft || 0;
+ }
+ } while (element = element.parentNode);
+ return new Element.Offset(valueL, valueT);
+ }
+
+ function absolutize(element) {
+ element = $(element);
+
+ if (Element.getStyle(element, 'position') === 'absolute') {
+ return element;
+ }
+
+ var offsetParent = getOffsetParent(element);
+ var eOffset = element.viewportOffset(),
+ pOffset = offsetParent.viewportOffset();
+
+ var offset = eOffset.relativeTo(pOffset);
+ var layout = element.getLayout();
+
+ element.store('prototype_absolutize_original_styles', {
+ left: element.getStyle('left'),
+ top: element.getStyle('top'),
+ width: element.getStyle('width'),
+ height: element.getStyle('height')
+ });
+
+ element.setStyle({
+ position: 'absolute',
+ top: offset.top + 'px',
+ left: offset.left + 'px',
+ width: layout.get('width') + 'px',
+ height: layout.get('height') + 'px'
+ });
+
+ return element;
+ }
+
+ function relativize(element) {
+ element = $(element);
+ if (Element.getStyle(element, 'position') === 'relative') {
+ return element;
+ }
+
+ var originalStyles =
+ element.retrieve('prototype_absolutize_original_styles');
+
+ if (originalStyles) element.setStyle(originalStyles);
+ return element;
+ }
+
+ if (Prototype.Browser.IE) {
+ getOffsetParent = getOffsetParent.wrap(
+ function(proceed, element) {
+ element = $(element);
+
+ if (isDocument(element) || isDetached(element) || isBody(element) || isHtml(element))
+ return $(document.body);
+
+ var position = element.getStyle('position');
+ if (position !== 'static') return proceed(element);
+
+ element.setStyle({ position: 'relative' });
+ var value = proceed(element);
+ element.setStyle({ position: position });
+ return value;
+ }
+ );
+
+ positionedOffset = positionedOffset.wrap(function(proceed, element) {
+ element = $(element);
+ if (!element.parentNode) return new Element.Offset(0, 0);
+ var position = element.getStyle('position');
+ if (position !== 'static') return proceed(element);
+
+ var offsetParent = element.getOffsetParent();
+ if (offsetParent && offsetParent.getStyle('position') === 'fixed')
+ hasLayout(offsetParent);
+
+ element.setStyle({ position: 'relative' });
+ var value = proceed(element);
+ element.setStyle({ position: position });
+ return value;
+ });
+ } else if (Prototype.Browser.Webkit) {
+ cumulativeOffset = function(element) {
+ element = $(element);
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ if (element.offsetParent == document.body)
+ if (Element.getStyle(element, 'position') == 'absolute') break;
+
+ element = element.offsetParent;
+ } while (element);
+
+ return new Element.Offset(valueL, valueT);
+ };
+ }
+
+
+ Element.addMethods({
+ getLayout: getLayout,
+ measure: measure,
+ getDimensions: getDimensions,
+ getOffsetParent: getOffsetParent,
+ cumulativeOffset: cumulativeOffset,
+ positionedOffset: positionedOffset,
+ cumulativeScrollOffset: cumulativeScrollOffset,
+ viewportOffset: viewportOffset,
+ absolutize: absolutize,
+ relativize: relativize
+ });
+
+ function isBody(element) {
+ return element.nodeName.toUpperCase() === 'BODY';
+ }
+
+ function isHtml(element) {
+ return element.nodeName.toUpperCase() === 'HTML';
+ }
+
+ function isDocument(element) {
+ return element.nodeType === Node.DOCUMENT_NODE;
+ }
+
+ function isDetached(element) {
+ return element !== document.body &&
+ !Element.descendantOf(element, document.body);
+ }
+
+ if ('getBoundingClientRect' in document.documentElement) {
+ Element.addMethods({
+ viewportOffset: function(element) {
+ element = $(element);
+ if (isDetached(element)) return new Element.Offset(0, 0);
+
+ var rect = element.getBoundingClientRect(),
+ docEl = document.documentElement;
+ return new Element.Offset(rect.left - docEl.clientLeft,
+ rect.top - docEl.clientTop);
+ }
+ });
+ }
+})();
+window.$$ = function() {
+ var expression = $A(arguments).join(', ');
+ return Prototype.Selector.select(expression, document);
+};
+
+Prototype.Selector = (function() {
+
+ function select() {
+ throw new Error('Method "Prototype.Selector.select" must be defined.');
+ }
+
+ function match() {
+ throw new Error('Method "Prototype.Selector.match" must be defined.');
+ }
+
+ function find(elements, expression, index) {
+ index = index || 0;
+ var match = Prototype.Selector.match, length = elements.length, matchIndex = 0, i;
+
+ for (i = 0; i < length; i++) {
+ if (match(elements[i], expression) && index == matchIndex++) {
+ return Element.extend(elements[i]);
+ }
+ }
+ }
+
+ function extendElements(elements) {
+ for (var i = 0, length = elements.length; i < length; i++) {
+ Element.extend(elements[i]);
+ }
+ return elements;
+ }
+
+
+ var K = Prototype.K;
+
+ return {
+ select: select,
+ match: match,
+ find: find,
+ extendElements: (Element.extend === K) ? K : extendElements,
+ extendElement: Element.extend
+ };
+})();
+/*!
+ * Sizzle CSS Selector Engine - v1.0
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+ done = 0,
+ toString = Object.prototype.toString,
+ hasDuplicate = false,
+ baseHasDuplicate = true;
+
+[0, 0].sort(function(){
+ baseHasDuplicate = false;
+ return 0;
+});
+
+var Sizzle = function(selector, context, results, seed) {
+ results = results || [];
+ var origContext = context = context || document;
+
+ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ var parts = [], m, set, checkSet, check, mode, extra, prune = true, contextXML = isXML(context),
+ soFar = selector;
+
+ while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
+ soFar = m[3];
+
+ parts.push( m[1] );
+
+ if ( m[2] ) {
+ extra = m[3];
+ break;
+ }
+ }
+
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+ set = posProcess( parts[0] + parts[1], context );
+ } else {
+ set = Expr.relative[ parts[0] ] ?
+ [ context ] :
+ Sizzle( parts.shift(), context );
+
+ while ( parts.length ) {
+ selector = parts.shift();
+
+ if ( Expr.relative[ selector ] )
+ selector += parts.shift();
+
+ set = posProcess( selector, set );
+ }
+ }
+ } else {
+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
+ var ret = Sizzle.find( parts.shift(), context, contextXML );
+ context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
+ }
+
+ if ( context ) {
+ var ret = seed ?
+ { expr: parts.pop(), set: makeArray(seed) } :
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
+ set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
+
+ if ( parts.length > 0 ) {
+ checkSet = makeArray(set);
+ } else {
+ prune = false;
+ }
+
+ while ( parts.length ) {
+ var cur = parts.pop(), pop = cur;
+
+ if ( !Expr.relative[ cur ] ) {
+ cur = "";
+ } else {
+ pop = parts.pop();
+ }
+
+ if ( pop == null ) {
+ pop = context;
+ }
+
+ Expr.relative[ cur ]( checkSet, pop, contextXML );
+ }
+ } else {
+ checkSet = parts = [];
+ }
+ }
+
+ if ( !checkSet ) {
+ checkSet = set;
+ }
+
+ if ( !checkSet ) {
+ throw "Syntax error, unrecognized expression: " + (cur || selector);
+ }
+
+ if ( toString.call(checkSet) === "[object Array]" ) {
+ if ( !prune ) {
+ results.push.apply( results, checkSet );
+ } else if ( context && context.nodeType === 1 ) {
+ for ( var i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
+ results.push( set[i] );
+ }
+ }
+ } else {
+ for ( var i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+ results.push( set[i] );
+ }
+ }
+ }
+ } else {
+ makeArray( checkSet, results );
+ }
+
+ if ( extra ) {
+ Sizzle( extra, origContext, results, seed );
+ Sizzle.uniqueSort( results );
+ }
+
+ return results;
+};
+
+Sizzle.uniqueSort = function(results){
+ if ( sortOrder ) {
+ hasDuplicate = baseHasDuplicate;
+ results.sort(sortOrder);
+
+ if ( hasDuplicate ) {
+ for ( var i = 1; i < results.length; i++ ) {
+ if ( results[i] === results[i-1] ) {
+ results.splice(i--, 1);
+ }
+ }
+ }
+ }
+
+ return results;
+};
+
+Sizzle.matches = function(expr, set){
+ return Sizzle(expr, null, null, set);
+};
+
+Sizzle.find = function(expr, context, isXML){
+ var set, match;
+
+ if ( !expr ) {
+ return [];
+ }
+
+ for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
+ var type = Expr.order[i], match;
+
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
+ var left = match[1];
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
+ match[1] = (match[1] || "").replace(/\\/g, "");
+ set = Expr.find[ type ]( match, context, isXML );
+ if ( set != null ) {
+ expr = expr.replace( Expr.match[ type ], "" );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !set ) {
+ set = context.getElementsByTagName("*");
+ }
+
+ return {set: set, expr: expr};
+};
+
+Sizzle.filter = function(expr, set, inplace, not){
+ var old = expr, result = [], curLoop = set, match, anyFound,
+ isXMLFilter = set && set[0] && isXML(set[0]);
+
+ while ( expr && set.length ) {
+ for ( var type in Expr.filter ) {
+ if ( (match = Expr.match[ type ].exec( expr )) != null ) {
+ var filter = Expr.filter[ type ], found, item;
+ anyFound = false;
+
+ if ( curLoop == result ) {
+ result = [];
+ }
+
+ if ( Expr.preFilter[ type ] ) {
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+ if ( !match ) {
+ anyFound = found = true;
+ } else if ( match === true ) {
+ continue;
+ }
+ }
+
+ if ( match ) {
+ for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
+ if ( item ) {
+ found = filter( item, match, i, curLoop );
+ var pass = not ^ !!found;
+
+ if ( inplace && found != null ) {
+ if ( pass ) {
+ anyFound = true;
+ } else {
+ curLoop[i] = false;
+ }
+ } else if ( pass ) {
+ result.push( item );
+ anyFound = true;
+ }
+ }
+ }
+ }
+
+ if ( found !== undefined ) {
+ if ( !inplace ) {
+ curLoop = result;
+ }
+
+ expr = expr.replace( Expr.match[ type ], "" );
+
+ if ( !anyFound ) {
+ return [];
+ }
+
+ break;
+ }
+ }
+ }
+
+ if ( expr == old ) {
+ if ( anyFound == null ) {
+ throw "Syntax error, unrecognized expression: " + expr;
+
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
+};
+
+var Expr = Sizzle.selectors = {
+ order: [ "ID", "NAME", "TAG" ],
+ match: {
+ ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
+ CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
+ NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
+ ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
+ TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
+ CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
+ POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
+ PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
+ },
+ leftMatch: {},
+ attrMap: {
+ "class": "className",
+ "for": "htmlFor"
+ },
+ attrHandle: {
+ href: function(elem){
+ return elem.getAttribute("href");
+ }
+ },
+ relative: {
+ "+": function(checkSet, part, isXML){
+ var isPartStr = typeof part === "string",
+ isTag = isPartStr && !/\W/.test(part),
+ isPartStrNotTag = isPartStr && !isTag;
+
+ if ( isTag && !isXML ) {
+ part = part.toUpperCase();
+ }
+
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+ if ( (elem = checkSet[i]) ) {
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ?
+ elem || false :
+ elem === part;
+ }
+ }
+
+ if ( isPartStrNotTag ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+ ">": function(checkSet, part, isXML){
+ var isPartStr = typeof part === "string";
+
+ if ( isPartStr && !/\W/.test(part) ) {
+ part = isXML ? part : part.toUpperCase();
+
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName === part ? parent : false;
+ }
+ }
+ } else {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ checkSet[i] = isPartStr ?
+ elem.parentNode :
+ elem.parentNode === part;
+ }
+ }
+
+ if ( isPartStr ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ }
+ },
+ "": function(checkSet, part, isXML){
+ var doneName = done++, checkFn = dirCheck;
+
+ if ( !/\W/.test(part) ) {
+ var nodeCheck = part = isXML ? part : part.toUpperCase();
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
+ },
+ "~": function(checkSet, part, isXML){
+ var doneName = done++, checkFn = dirCheck;
+
+ if ( typeof part === "string" && !/\W/.test(part) ) {
+ var nodeCheck = part = isXML ? part : part.toUpperCase();
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
+ }
+ },
+ find: {
+ ID: function(match, context, isXML){
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ return m ? [m] : [];
+ }
+ },
+ NAME: function(match, context, isXML){
+ if ( typeof context.getElementsByName !== "undefined" ) {
+ var ret = [], results = context.getElementsByName(match[1]);
+
+ for ( var i = 0, l = results.length; i < l; i++ ) {
+ if ( results[i].getAttribute("name") === match[1] ) {
+ ret.push( results[i] );
+ }
+ }
+
+ return ret.length === 0 ? null : ret;
+ }
+ },
+ TAG: function(match, context){
+ return context.getElementsByTagName(match[1]);
+ }
+ },
+ preFilter: {
+ CLASS: function(match, curLoop, inplace, result, not, isXML){
+ match = " " + match[1].replace(/\\/g, "") + " ";
+
+ if ( isXML ) {
+ return match;
+ }
+
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) {
+ if ( !inplace )
+ result.push( elem );
+ } else if ( inplace ) {
+ curLoop[i] = false;
+ }
+ }
+ }
+
+ return false;
+ },
+ ID: function(match){
+ return match[1].replace(/\\/g, "");
+ },
+ TAG: function(match, curLoop){
+ for ( var i = 0; curLoop[i] === false; i++ ){}
+ return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
+ },
+ CHILD: function(match){
+ if ( match[1] == "nth" ) {
+ var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
+ match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+
+ match[0] = done++;
+
+ return match;
+ },
+ ATTR: function(match, curLoop, inplace, result, not, isXML){
+ var name = match[1].replace(/\\/g, "");
+
+ if ( !isXML && Expr.attrMap[name] ) {
+ match[1] = Expr.attrMap[name];
+ }
+
+ if ( match[2] === "~=" ) {
+ match[4] = " " + match[4] + " ";
+ }
+
+ return match;
+ },
+ PSEUDO: function(match, curLoop, inplace, result, not){
+ if ( match[1] === "not" ) {
+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
+ match[3] = Sizzle(match[3], null, null, curLoop);
+ } else {
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+ if ( !inplace ) {
+ result.push.apply( result, ret );
+ }
+ return false;
+ }
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+ return true;
+ }
+
+ return match;
+ },
+ POS: function(match){
+ match.unshift( true );
+ return match;
+ }
+ },
+ filters: {
+ enabled: function(elem){
+ return elem.disabled === false && elem.type !== "hidden";
+ },
+ disabled: function(elem){
+ return elem.disabled === true;
+ },
+ checked: function(elem){
+ return elem.checked === true;
+ },
+ selected: function(elem){
+ elem.parentNode.selectedIndex;
+ return elem.selected === true;
+ },
+ parent: function(elem){
+ return !!elem.firstChild;
+ },
+ empty: function(elem){
+ return !elem.firstChild;
+ },
+ has: function(elem, i, match){
+ return !!Sizzle( match[3], elem ).length;
+ },
+ header: function(elem){
+ return /h\d/i.test( elem.nodeName );
+ },
+ text: function(elem){
+ return "text" === elem.type;
+ },
+ radio: function(elem){
+ return "radio" === elem.type;
+ },
+ checkbox: function(elem){
+ return "checkbox" === elem.type;
+ },
+ file: function(elem){
+ return "file" === elem.type;
+ },
+ password: function(elem){
+ return "password" === elem.type;
+ },
+ submit: function(elem){
+ return "submit" === elem.type;
+ },
+ image: function(elem){
+ return "image" === elem.type;
+ },
+ reset: function(elem){
+ return "reset" === elem.type;
+ },
+ button: function(elem){
+ return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
+ },
+ input: function(elem){
+ return /input|select|textarea|button/i.test(elem.nodeName);
+ }
+ },
+ setFilters: {
+ first: function(elem, i){
+ return i === 0;
+ },
+ last: function(elem, i, match, array){
+ return i === array.length - 1;
+ },
+ even: function(elem, i){
+ return i % 2 === 0;
+ },
+ odd: function(elem, i){
+ return i % 2 === 1;
+ },
+ lt: function(elem, i, match){
+ return i < match[3] - 0;
+ },
+ gt: function(elem, i, match){
+ return i > match[3] - 0;
+ },
+ nth: function(elem, i, match){
+ return match[3] - 0 == i;
+ },
+ eq: function(elem, i, match){
+ return match[3] - 0 == i;
+ }
+ },
+ filter: {
+ PSEUDO: function(elem, match, i, array){
+ var name = match[1], filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var i = 0, l = not.length; i < l; i++ ) {
+ if ( not[i] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+
+
+
+ }
+ },
+ CHILD: function(elem, match){
+ var type = match[1], node = elem;
+ switch (type) {
+ case 'only':
+ case 'first':
+ while ( (node = node.previousSibling) ) {
+ if ( node.nodeType === 1 ) return false;
+ }
+ if ( type == 'first') return true;
+ node = elem;
+ case 'last':
+ while ( (node = node.nextSibling) ) {
+ if ( node.nodeType === 1 ) return false;
+ }
+ return true;
+ case 'nth':
+ var first = match[2], last = match[3];
+
+ if ( first == 1 && last == 0 ) {
+ return true;
+ }
+
+ var doneName = match[0],
+ parent = elem.parentNode;
+
+ if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
+ var count = 0;
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ node.nodeIndex = ++count;
+ }
+ }
+ parent.sizcache = doneName;
+ }
+
+ var diff = elem.nodeIndex - last;
+ if ( first == 0 ) {
+ return diff == 0;
+ } else {
+ return ( diff % first == 0 && diff / first >= 0 );
+ }
+ }
+ },
+ ID: function(elem, match){
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ },
+ TAG: function(elem, match){
+ return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
+ },
+ CLASS: function(elem, match){
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
+ .indexOf( match ) > -1;
+ },
+ ATTR: function(elem, match){
+ var name = match[1],
+ result = Expr.attrHandle[ name ] ?
+ Expr.attrHandle[ name ]( elem ) :
+ elem[ name ] != null ?
+ elem[ name ] :
+ elem.getAttribute( name ),
+ value = result + "",
+ type = match[2],
+ check = match[4];
+
+ return result == null ?
+ type === "!=" :
+ type === "=" ?
+ value === check :
+ type === "*=" ?
+ value.indexOf(check) >= 0 :
+ type === "~=" ?
+ (" " + value + " ").indexOf(check) >= 0 :
+ !check ?
+ value && result !== false :
+ type === "!=" ?
+ value != check :
+ type === "^=" ?
+ value.indexOf(check) === 0 :
+ type === "$=" ?
+ value.substr(value.length - check.length) === check :
+ type === "|=" ?
+ value === check || value.substr(0, check.length + 1) === check + "-" :
+ false;
+ },
+ POS: function(elem, match, i, array){
+ var name = match[2], filter = Expr.setFilters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ }
+ }
+ }
+};
+
+var origPOS = Expr.match.POS;
+
+for ( var type in Expr.match ) {
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source );
+}
+
+var makeArray = function(array, results) {
+ array = Array.prototype.slice.call( array, 0 );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
+};
+
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 );
+
+} catch(e){
+ makeArray = function(array, results) {
+ var ret = results || [];
+
+ if ( toString.call(array) === "[object Array]" ) {
+ Array.prototype.push.apply( ret, array );
+ } else {
+ if ( typeof array.length === "number" ) {
+ for ( var i = 0, l = array.length; i < l; i++ ) {
+ ret.push( array[i] );
+ }
+ } else {
+ for ( var i = 0; array[i]; i++ ) {
+ ret.push( array[i] );
+ }
+ }
+ }
+
+ return ret;
+ };
+}
+
+var sortOrder;
+
+if ( document.documentElement.compareDocumentPosition ) {
+ sortOrder = function( a, b ) {
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return 0;
+ }
+
+ var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+} else if ( "sourceIndex" in document.documentElement ) {
+ sortOrder = function( a, b ) {
+ if ( !a.sourceIndex || !b.sourceIndex ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return 0;
+ }
+
+ var ret = a.sourceIndex - b.sourceIndex;
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+} else if ( document.createRange ) {
+ sortOrder = function( a, b ) {
+ if ( !a.ownerDocument || !b.ownerDocument ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return 0;
+ }
+
+ var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
+ aRange.setStart(a, 0);
+ aRange.setEnd(a, 0);
+ bRange.setStart(b, 0);
+ bRange.setEnd(b, 0);
+ var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+}
+
+(function(){
+ var form = document.createElement("div"),
+ id = "script" + (new Date).getTime();
+ form.innerHTML = "<a name='" + id + "'/>";
+
+ var root = document.documentElement;
+ root.insertBefore( form, root.firstChild );
+
+ if ( !!document.getElementById( id ) ) {
+ Expr.find.ID = function(match, context, isXML){
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
+ }
+ };
+
+ Expr.filter.ID = function(elem, match){
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+ return elem.nodeType === 1 && node && node.nodeValue === match;
+ };
+ }
+
+ root.removeChild( form );
+ root = form = null; // release memory in IE
+})();
+
+(function(){
+
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function(match, context){
+ var results = context.getElementsByTagName(match[1]);
+
+ if ( match[1] === "*" ) {
+ var tmp = [];
+
+ for ( var i = 0; results[i]; i++ ) {
+ if ( results[i].nodeType === 1 ) {
+ tmp.push( results[i] );
+ }
+ }
+
+ results = tmp;
+ }
+
+ return results;
+ };
+ }
+
+ div.innerHTML = "<a href='#'></a>";
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+ div.firstChild.getAttribute("href") !== "#" ) {
+ Expr.attrHandle.href = function(elem){
+ return elem.getAttribute("href", 2);
+ };
+ }
+
+ div = null; // release memory in IE
+})();
+
+if ( document.querySelectorAll ) (function(){
+ var oldSizzle = Sizzle, div = document.createElement("div");
+ div.innerHTML = "<p class='TEST'></p>";
+
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+ return;
+ }
+
+ Sizzle = function(query, context, extra, seed){
+ context = context || document;
+
+ if ( !seed && context.nodeType === 9 && !isXML(context) ) {
+ try {
+ return makeArray( context.querySelectorAll(query), extra );
+ } catch(e){}
+ }
+
+ return oldSizzle(query, context, extra, seed);
+ };
+
+ for ( var prop in oldSizzle ) {
+ Sizzle[ prop ] = oldSizzle[ prop ];
+ }
+
+ div = null; // release memory in IE
+})();
+
+if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
+ var div = document.createElement("div");
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+ if ( div.getElementsByClassName("e").length === 0 )
+ return;
+
+ div.lastChild.className = "e";
+
+ if ( div.getElementsByClassName("e").length === 1 )
+ return;
+
+ Expr.order.splice(1, 0, "CLASS");
+ Expr.find.CLASS = function(match, context, isXML) {
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+ return context.getElementsByClassName(match[1]);
+ }
+ };
+
+ div = null; // release memory in IE
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ var sibDir = dir == "previousSibling" && !isXML;
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ if ( sibDir && elem.nodeType === 1 ){
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 && !isXML ){
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( elem.nodeName === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ var sibDir = dir == "previousSibling" && !isXML;
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ if ( sibDir && elem.nodeType === 1 ) {
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 ) {
+ if ( !isXML ) {
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+ if ( typeof cur !== "string" ) {
+ if ( elem === cur ) {
+ match = true;
+ break;
+ }
+
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+ match = elem;
+ break;
+ }
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+var contains = document.compareDocumentPosition ? function(a, b){
+ return a.compareDocumentPosition(b) & 16;
+} : function(a, b){
+ return a !== b && (a.contains ? a.contains(b) : true);
+};
+
+var isXML = function(elem){
+ return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
+ !!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML";
+};
+
+var posProcess = function(selector, context){
+ var tmpSet = [], later = "", match,
+ root = context.nodeType ? [context] : context;
+
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+ later += match[0];
+ selector = selector.replace( Expr.match.PSEUDO, "" );
+ }
+
+ selector = Expr.relative[selector] ? selector + "*" : selector;
+
+ for ( var i = 0, l = root.length; i < l; i++ ) {
+ Sizzle( selector, root[i], tmpSet );
+ }
+
+ return Sizzle.filter( later, tmpSet );
+};
+
+
+window.Sizzle = Sizzle;
+
+})();
+
+Prototype._original_property = window.Sizzle;
+
+;(function(engine) {
+ var extendElements = Prototype.Selector.extendElements;
+
+ function select(selector, scope) {
+ return extendElements(engine(selector, scope || document));
+ }
+
+ function match(element, selector) {
+ return engine.matches(selector, [element]).length == 1;
+ }
+
+ Prototype.Selector.engine = engine;
+ Prototype.Selector.select = select;
+ Prototype.Selector.match = match;
+})(Sizzle);
+
+window.Sizzle = Prototype._original_property;
+delete Prototype._original_property;
+
+var Form = {
+ reset: function(form) {
+ form = $(form);
+ form.reset();
+ return form;
+ },
+
+ serializeElements: function(elements, options) {
+ if (typeof options != 'object') options = { hash: !!options };
+ else if (Object.isUndefined(options.hash)) options.hash = true;
+ var key, value, submitted = false, submit = options.submit, accumulator, initial;
+
+ if (options.hash) {
+ initial = {};
+ accumulator = function(result, key, value) {
+ if (key in result) {
+ if (!Object.isArray(result[key])) result[key] = [result[key]];
+ result[key].push(value);
+ } else result[key] = value;
+ return result;
+ };
+ } else {
+ initial = '';
+ accumulator = function(result, key, value) {
+ return result + (result ? '&' : '') + encodeURIComponent(key) + '=' + encodeURIComponent(value);
+ }
+ }
+
+ return elements.inject(initial, function(result, element) {
+ if (!element.disabled && element.name) {
+ key = element.name; value = $(element).getValue();
+ if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted &&
+ submit !== false && (!submit || key == submit) && (submitted = true)))) {
+ result = accumulator(result, key, value);
+ }
+ }
+ return result;
+ });
+ }
+};
+
+Form.Methods = {
+ serialize: function(form, options) {
+ return Form.serializeElements(Form.getElements(form), options);
+ },
+
+ getElements: function(form) {
+ var elements = $(form).getElementsByTagName('*'),
+ element,
+ arr = [ ],
+ serializers = Form.Element.Serializers;
+ for (var i = 0; element = elements[i]; i++) {
+ arr.push(element);
+ }
+ return arr.inject([], function(elements, child) {
+ if (serializers[child.tagName.toLowerCase()])
+ elements.push(Element.extend(child));
+ return elements;
+ })
+ },
+
+ getInputs: function(form, typeName, name) {
+ form = $(form);
+ var inputs = form.getElementsByTagName('input');
+
+ if (!typeName && !name) return $A(inputs).map(Element.extend);
+
+ for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) {
+ var input = inputs[i];
+ if ((typeName && input.type != typeName) || (name && input.name != name))
+ continue;
+ matchingInputs.push(Element.extend(input));
+ }
+
+ return matchingInputs;
+ },
+
+ disable: function(form) {
+ form = $(form);
+ Form.getElements(form).invoke('disable');
+ return form;
+ },
+
+ enable: function(form) {
+ form = $(form);
+ Form.getElements(form).invoke('enable');
+ return form;
+ },
+
+ findFirstElement: function(form) {
+ var elements = $(form).getElements().findAll(function(element) {
+ return 'hidden' != element.type && !element.disabled;
+ });
+ var firstByIndex = elements.findAll(function(element) {
+ return element.hasAttribute('tabIndex') && element.tabIndex >= 0;
+ }).sortBy(function(element) { return element.tabIndex }).first();
+
+ return firstByIndex ? firstByIndex : elements.find(function(element) {
+ return /^(?:input|select|textarea)$/i.test(element.tagName);
+ });
+ },
+
+ focusFirstElement: function(form) {
+ form = $(form);
+ var element = form.findFirstElement();
+ if (element) element.activate();
+ return form;
+ },
+
+ request: function(form, options) {
+ form = $(form), options = Object.clone(options || { });
+
+ var params = options.parameters, action = form.readAttribute('action') || '';
+ if (action.blank()) action = window.location.href;
+ options.parameters = form.serialize(true);
+
+ if (params) {
+ if (Object.isString(params)) params = params.toQueryParams();
+ Object.extend(options.parameters, params);
+ }
+
+ if (form.hasAttribute('method') && !options.method)
+ options.method = form.method;
+
+ return new Ajax.Request(action, options);
+ }
+};
+
+/*--------------------------------------------------------------------------*/
+
+
+Form.Element = {
+ focus: function(element) {
+ $(element).focus();
+ return element;
+ },
+
+ select: function(element) {
+ $(element).select();
+ return element;
+ }
+};
+
+Form.Element.Methods = {
+
+ serialize: function(element) {
+ element = $(element);
+ if (!element.disabled && element.name) {
+ var value = element.getValue();
+ if (value != undefined) {
+ var pair = { };
+ pair[element.name] = value;
+ return Object.toQueryString(pair);
+ }
+ }
+ return '';
+ },
+
+ getValue: function(element) {
+ element = $(element);
+ var method = element.tagName.toLowerCase();
+ return Form.Element.Serializers[method](element);
+ },
+
+ setValue: function(element, value) {
+ element = $(element);
+ var method = element.tagName.toLowerCase();
+ Form.Element.Serializers[method](element, value);
+ return element;
+ },
+
+ clear: function(element) {
+ $(element).value = '';
+ return element;
+ },
+
+ present: function(element) {
+ return $(element).value != '';
+ },
+
+ activate: function(element) {
+ element = $(element);
+ try {
+ element.focus();
+ if (element.select && (element.tagName.toLowerCase() != 'input' ||
+ !(/^(?:button|reset|submit)$/i.test(element.type))))
+ element.select();
+ } catch (e) { }
+ return element;
+ },
+
+ disable: function(element) {
+ element = $(element);
+ element.disabled = true;
+ return element;
+ },
+
+ enable: function(element) {
+ element = $(element);
+ element.disabled = false;
+ return element;
+ }
+};
+
+/*--------------------------------------------------------------------------*/
+
+var Field = Form.Element;
+
+var $F = Form.Element.Methods.getValue;
+
+/*--------------------------------------------------------------------------*/
+
+Form.Element.Serializers = (function() {
+ function input(element, value) {
+ switch (element.type.toLowerCase()) {
+ case 'checkbox':
+ case 'radio':
+ return inputSelector(element, value);
+ default:
+ return valueSelector(element, value);
+ }
+ }
+
+ function inputSelector(element, value) {
+ if (Object.isUndefined(value))
+ return element.checked ? element.value : null;
+ else element.checked = !!value;
+ }
+
+ function valueSelector(element, value) {
+ if (Object.isUndefined(value)) return element.value;
+ else element.value = value;
+ }
+
+ function select(element, value) {
+ if (Object.isUndefined(value))
+ return (element.type === 'select-one' ? selectOne : selectMany)(element);
+
+ var opt, currentValue, single = !Object.isArray(value);
+ for (var i = 0, length = element.length; i < length; i++) {
+ opt = element.options[i];
+ currentValue = this.optionValue(opt);
+ if (single) {
+ if (currentValue == value) {
+ opt.selected = true;
+ return;
+ }
+ }
+ else opt.selected = value.include(currentValue);
+ }
+ }
+
+ function selectOne(element) {
+ var index = element.selectedIndex;
+ return index >= 0 ? optionValue(element.options[index]) : null;
+ }
+
+ function selectMany(element) {
+ var values, length = element.length;
+ if (!length) return null;
+
+ for (var i = 0, values = []; i < length; i++) {
+ var opt = element.options[i];
+ if (opt.selected) values.push(optionValue(opt));
+ }
+ return values;
+ }
+
+ function optionValue(opt) {
+ return Element.hasAttribute(opt, 'value') ? opt.value : opt.text;
+ }
+
+ return {
+ input: input,
+ inputSelector: inputSelector,
+ textarea: valueSelector,
+ select: select,
+ selectOne: selectOne,
+ selectMany: selectMany,
+ optionValue: optionValue,
+ button: valueSelector
+ };
+})();
+
+/*--------------------------------------------------------------------------*/
+
+
+Abstract.TimedObserver = Class.create(PeriodicalExecuter, {
+ initialize: function($super, element, frequency, callback) {
+ $super(callback, frequency);
+ this.element = $(element);
+ this.lastValue = this.getValue();
+ },
+
+ execute: function() {
+ var value = this.getValue();
+ if (Object.isString(this.lastValue) && Object.isString(value) ?
+ this.lastValue != value : String(this.lastValue) != String(value)) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ }
+});
+
+Form.Element.Observer = Class.create(Abstract.TimedObserver, {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.Observer = Class.create(Abstract.TimedObserver, {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.EventObserver = Class.create({
+ initialize: function(element, callback) {
+ this.element = $(element);
+ this.callback = callback;
+
+ this.lastValue = this.getValue();
+ if (this.element.tagName.toLowerCase() == 'form')
+ this.registerFormCallbacks();
+ else
+ this.registerCallback(this.element);
+ },
+
+ onElementEvent: function() {
+ var value = this.getValue();
+ if (this.lastValue != value) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ },
+
+ registerFormCallbacks: function() {
+ Form.getElements(this.element).each(this.registerCallback, this);
+ },
+
+ registerCallback: function(element) {
+ if (element.type) {
+ switch (element.type.toLowerCase()) {
+ case 'checkbox':
+ case 'radio':
+ Event.observe(element, 'click', this.onElementEvent.bind(this));
+ break;
+ default:
+ Event.observe(element, 'change', this.onElementEvent.bind(this));
+ break;
+ }
+ }
+ }
+});
+
+Form.Element.EventObserver = Class.create(Abstract.EventObserver, {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.EventObserver = Class.create(Abstract.EventObserver, {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+(function() {
+
+ var Event = {
+ KEY_BACKSPACE: 8,
+ KEY_TAB: 9,
+ KEY_RETURN: 13,
+ KEY_ESC: 27,
+ KEY_LEFT: 37,
+ KEY_UP: 38,
+ KEY_RIGHT: 39,
+ KEY_DOWN: 40,
+ KEY_DELETE: 46,
+ KEY_HOME: 36,
+ KEY_END: 35,
+ KEY_PAGEUP: 33,
+ KEY_PAGEDOWN: 34,
+ KEY_INSERT: 45,
+
+ cache: {}
+ };
+
+ var docEl = document.documentElement;
+ var MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED = 'onmouseenter' in docEl
+ && 'onmouseleave' in docEl;
+
+
+
+ var isIELegacyEvent = function(event) { return false; };
+
+ if (window.attachEvent) {
+ if (window.addEventListener) {
+ isIELegacyEvent = function(event) {
+ return !(event instanceof window.Event);
+ };
+ } else {
+ isIELegacyEvent = function(event) { return true; };
+ }
+ }
+
+ var _isButton;
+
+ function _isButtonForDOMEvents(event, code) {
+ return event.which ? (event.which === code + 1) : (event.button === code);
+ }
+
+ var legacyButtonMap = { 0: 1, 1: 4, 2: 2 };
+ function _isButtonForLegacyEvents(event, code) {
+ return event.button === legacyButtonMap[code];
+ }
+
+ function _isButtonForWebKit(event, code) {
+ switch (code) {
+ case 0: return event.which == 1 && !event.metaKey;
+ case 1: return event.which == 2 || (event.which == 1 && event.metaKey);
+ case 2: return event.which == 3;
+ default: return false;
+ }
+ }
+
+ if (window.attachEvent) {
+ if (!window.addEventListener) {
+ _isButton = _isButtonForLegacyEvents;
+ } else {
+ _isButton = function(event, code) {
+ return isIELegacyEvent(event) ? _isButtonForLegacyEvents(event, code) :
+ _isButtonForDOMEvents(event, code);
+ }
+ }
+ } else if (Prototype.Browser.WebKit) {
+ _isButton = _isButtonForWebKit;
+ } else {
+ _isButton = _isButtonForDOMEvents;
+ }
+
+ function isLeftClick(event) { return _isButton(event, 0) }
+
+ function isMiddleClick(event) { return _isButton(event, 1) }
+
+ function isRightClick(event) { return _isButton(event, 2) }
+
+ function element(event) {
+ event = Event.extend(event);
+
+ var node = event.target, type = event.type,
+ currentTarget = event.currentTarget;
+
+ if (currentTarget && currentTarget.tagName) {
+ if (type === 'load' || type === 'error' ||
+ (type === 'click' && currentTarget.tagName.toLowerCase() === 'input'
+ && currentTarget.type === 'radio'))
+ node = currentTarget;
+ }
+
+ if (node.nodeType == Node.TEXT_NODE)
+ node = node.parentNode;
+
+ return Element.extend(node);
+ }
+
+ function findElement(event, expression) {
+ var element = Event.element(event);
+
+ if (!expression) return element;
+ while (element) {
+ if (Object.isElement(element) && Prototype.Selector.match(element, expression)) {
+ return Element.extend(element);
+ }
+ element = element.parentNode;
+ }
+ }
+
+ function pointer(event) {
+ return { x: pointerX(event), y: pointerY(event) };
+ }
+
+ function pointerX(event) {
+ var docElement = document.documentElement,
+ body = document.body || { scrollLeft: 0 };
+
+ return event.pageX || (event.clientX +
+ (docElement.scrollLeft || body.scrollLeft) -
+ (docElement.clientLeft || 0));
+ }
+
+ function pointerY(event) {
+ var docElement = document.documentElement,
+ body = document.body || { scrollTop: 0 };
+
+ return event.pageY || (event.clientY +
+ (docElement.scrollTop || body.scrollTop) -
+ (docElement.clientTop || 0));
+ }
+
+
+ function stop(event) {
+ Event.extend(event);
+ event.preventDefault();
+ event.stopPropagation();
+
+ event.stopped = true;
+ }
+
+
+ Event.Methods = {
+ isLeftClick: isLeftClick,
+ isMiddleClick: isMiddleClick,
+ isRightClick: isRightClick,
+
+ element: element,
+ findElement: findElement,
+
+ pointer: pointer,
+ pointerX: pointerX,
+ pointerY: pointerY,
+
+ stop: stop
+ };
+
+ var methods = Object.keys(Event.Methods).inject({ }, function(m, name) {
+ m[name] = Event.Methods[name].methodize();
+ return m;
+ });
+
+ if (window.attachEvent) {
+ var _relatedTarget = function (event) {
+ var element;
+ switch (event.type) {
+ case 'mouseover':
+ case 'mouseenter':
+ element = event.fromElement;
+ break;
+ case 'mouseout':
+ case 'mouseleave':
+ element = event.toElement;
+ break;
+ default:
+ return null;
+ }
+ return Element.extend(element);
+ }
+
+ var additionalMethods = {
+ stopPropagation: function() { this.cancelBubble = true },
+ preventDefault: function() { this.returnValue = false },
+ inspect: function() { return '[object Event]' }
+ };
+
+ Event.extend = function(event, element) {
+ if (!event) return false;
+
+ if (!isIELegacyEvent(event)) return event;
+
+ if (event._extendedByPrototype) return event;
+ event._extendedByPrototype = Prototype.emptyFunction;
+
+ var pointer = Event.pointer(event);
+
+ Object.extend(event, {
+ target: event.srcElement || element,
+ relatedTarget: _relatedTarget(event),
+ pageX: pointer.x,
+ pageY: pointer.y
+ });
+
+ Object.extend(event, methods);
+ Object.extend(event, additionalMethods);
+
+ return event;
+ };
+ } else {
+ Event.extend = Prototype.K;
+ }
+
+ if (window.addEventListener) {
+ Event.prototype = window.Event.prototype || document.createEvent('HTMLEvents').__proto__;
+ Object.extend(Event.prototype, methods);
+ }
+
+ function _createResponder(element, eventName, handler) {
+ var registry = Element.retrieve(element, 'prototype_event_registry');
+
+ if (Object.isUndefined(registry)) {
+ CACHE.push(element);
+ registry = Element.retrieve(element, 'prototype_event_registry', $H());
+ }
+
+ var respondersForEvent = registry.get(eventName);
+ if (Object.isUndefined(respondersForEvent)) {
+ respondersForEvent = [];
+ registry.set(eventName, respondersForEvent);
+ }
+
+ if (respondersForEvent.pluck('handler').include(handler)) return false;
+
+ var responder;
+ if (eventName.include(":")) {
+ responder = function(event) {
+ if (Object.isUndefined(event.eventName))
+ return false;
+
+ if (event.eventName !== eventName)
+ return false;
+
+ Event.extend(event, element);
+ handler.call(element, event);
+ };
+ } else {
+ if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED &&
+ (eventName === "mouseenter" || eventName === "mouseleave")) {
+ if (eventName === "mouseenter" || eventName === "mouseleave") {
+ responder = function(event) {
+ Event.extend(event, element);
+
+ var parent = event.relatedTarget;
+ while (parent && parent !== element) {
+ try { parent = parent.parentNode; }
+ catch(e) { parent = element; }
+ }
+
+ if (parent === element) return;
+
+ handler.call(element, event);
+ };
+ }
+ } else {
+ responder = function(event) {
+ Event.extend(event, element);
+ handler.call(element, event);
+ };
+ }
+ }
+
+ responder.handler = handler;
+ respondersForEvent.push(responder);
+ return responder;
+ }
+
+ function _destroyCache() {
+ for (var i = 0, length = CACHE.length; i < length; i++) {
+ Event.stopObserving(CACHE[i]);
+ CACHE[i] = null;
+ }
+ }
+
+ var CACHE = [];
+
+ if (Prototype.Browser.IE)
+ window.attachEvent('onunload', _destroyCache);
+
+ if (Prototype.Browser.WebKit)
+ window.addEventListener('unload', Prototype.emptyFunction, false);
+
+
+ var _getDOMEventName = Prototype.K,
+ translations = { mouseenter: "mouseover", mouseleave: "mouseout" };
+
+ if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED) {
+ _getDOMEventName = function(eventName) {
+ return (translations[eventName] || eventName);
+ };
+ }
+
+ function observe(element, eventName, handler) {
+ element = $(element);
+
+ var responder = _createResponder(element, eventName, handler);
+
+ if (!responder) return element;
+
+ if (eventName.include(':')) {
+ if (element.addEventListener)
+ element.addEventListener("dataavailable", responder, false);
+ else {
+ element.attachEvent("ondataavailable", responder);
+ element.attachEvent("onlosecapture", responder);
+ }
+ } else {
+ var actualEventName = _getDOMEventName(eventName);
+
+ if (element.addEventListener)
+ element.addEventListener(actualEventName, responder, false);
+ else
+ element.attachEvent("on" + actualEventName, responder);
+ }
+
+ return element;
+ }
+
+ function stopObserving(element, eventName, handler) {
+ element = $(element);
+
+ var registry = Element.retrieve(element, 'prototype_event_registry');
+ if (!registry) return element;
+
+ if (!eventName) {
+ registry.each( function(pair) {
+ var eventName = pair.key;
+ stopObserving(element, eventName);
+ });
+ return element;
+ }
+
+ var responders = registry.get(eventName);
+ if (!responders) return element;
+
+ if (!handler) {
+ responders.each(function(r) {
+ stopObserving(element, eventName, r.handler);
+ });
+ return element;
+ }
+
+ var i = responders.length, responder;
+ while (i--) {
+ if (responders[i].handler === handler) {
+ responder = responders[i];
+ break;
+ }
+ }
+ if (!responder) return element;
+
+ if (eventName.include(':')) {
+ if (element.removeEventListener)
+ element.removeEventListener("dataavailable", responder, false);
+ else {
+ element.detachEvent("ondataavailable", responder);
+ element.detachEvent("onlosecapture", responder);
+ }
+ } else {
+ var actualEventName = _getDOMEventName(eventName);
+ if (element.removeEventListener)
+ element.removeEventListener(actualEventName, responder, false);
+ else
+ element.detachEvent('on' + actualEventName, responder);
+ }
+
+ registry.set(eventName, responders.without(responder));
+
+ return element;
+ }
+
+ function fire(element, eventName, memo, bubble) {
+ element = $(element);
+
+ if (Object.isUndefined(bubble))
+ bubble = true;
+
+ if (element == document && document.createEvent && !element.dispatchEvent)
+ element = document.documentElement;
+
+ var event;
+ if (document.createEvent) {
+ event = document.createEvent('HTMLEvents');
+ event.initEvent('dataavailable', bubble, true);
+ } else {
+ event = document.createEventObject();
+ event.eventType = bubble ? 'ondataavailable' : 'onlosecapture';
+ }
+
+ event.eventName = eventName;
+ event.memo = memo || { };
+
+ if (document.createEvent)
+ element.dispatchEvent(event);
+ else
+ element.fireEvent(event.eventType, event);
+
+ return Event.extend(event);
+ }
+
+ Event.Handler = Class.create({
+ initialize: function(element, eventName, selector, callback) {
+ this.element = $(element);
+ this.eventName = eventName;
+ this.selector = selector;
+ this.callback = callback;
+ this.handler = this.handleEvent.bind(this);
+ },
+
+ start: function() {
+ Event.observe(this.element, this.eventName, this.handler);
+ return this;
+ },
+
+ stop: function() {
+ Event.stopObserving(this.element, this.eventName, this.handler);
+ return this;
+ },
+
+ handleEvent: function(event) {
+ var element = Event.findElement(event, this.selector);
+ if (element) this.callback.call(this.element, event, element);
+ }
+ });
+
+ function on(element, eventName, selector, callback) {
+ element = $(element);
+ if (Object.isFunction(selector) && Object.isUndefined(callback)) {
+ callback = selector, selector = null;
+ }
+
+ return new Event.Handler(element, eventName, selector, callback).start();
+ }
+
+ Object.extend(Event, Event.Methods);
+
+ Object.extend(Event, {
+ fire: fire,
+ observe: observe,
+ stopObserving: stopObserving,
+ on: on
+ });
+
+ Element.addMethods({
+ fire: fire,
+
+ observe: observe,
+
+ stopObserving: stopObserving,
+
+ on: on
+ });
+
+ Object.extend(document, {
+ fire: fire.methodize(),
+
+ observe: observe.methodize(),
+
+ stopObserving: stopObserving.methodize(),
+
+ on: on.methodize(),
+
+ loaded: false
+ });
+
+ if (window.Event) Object.extend(window.Event, Event);
+ else window.Event = Event;
+})();
+
+(function() {
+ /* Support for the DOMContentLoaded event is based on work by Dan Webb,
+ Matthias Miller, Dean Edwards, John Resig, and Diego Perini. */
+
+ var timer;
+
+ function fireContentLoadedEvent() {
+ if (document.loaded) return;
+ if (timer) window.clearTimeout(timer);
+ document.loaded = true;
+ document.fire('dom:loaded');
+ }
+
+ function checkReadyState() {
+ if (document.readyState === 'complete') {
+ document.stopObserving('readystatechange', checkReadyState);
+ fireContentLoadedEvent();
+ }
+ }
+
+ function pollDoScroll() {
+ try { document.documentElement.doScroll('left'); }
+ catch(e) {
+ timer = pollDoScroll.defer();
+ return;
+ }
+ fireContentLoadedEvent();
+ }
+
+ if (document.addEventListener) {
+ document.addEventListener('DOMContentLoaded', fireContentLoadedEvent, false);
+ } else {
+ document.observe('readystatechange', checkReadyState);
+ if (window == top)
+ timer = pollDoScroll.defer();
+ }
+
+ Event.observe(window, 'load', fireContentLoadedEvent);
+})();
+
+
+Element.addMethods();
+/*------------------------------- DEPRECATED -------------------------------*/
+
+Hash.toQueryString = Object.toQueryString;
+
+var Toggle = { display: Element.toggle };
+
+Element.Methods.childOf = Element.Methods.descendantOf;
+
+var Insertion = {
+ Before: function(element, content) {
+ return Element.insert(element, {before:content});
+ },
+
+ Top: function(element, content) {
+ return Element.insert(element, {top:content});
+ },
+
+ Bottom: function(element, content) {
+ return Element.insert(element, {bottom:content});
+ },
+
+ After: function(element, content) {
+ return Element.insert(element, {after:content});
+ }
+};
+
+var $continue = new Error('"throw $continue" is deprecated, use "return" instead');
+
+var Position = {
+ includeScrollOffsets: false,
+
+ prepare: function() {
+ this.deltaX = window.pageXOffset
+ || document.documentElement.scrollLeft
+ || document.body.scrollLeft
+ || 0;
+ this.deltaY = window.pageYOffset
+ || document.documentElement.scrollTop
+ || document.body.scrollTop
+ || 0;
+ },
+
+ within: function(element, x, y) {
+ if (this.includeScrollOffsets)
+ return this.withinIncludingScrolloffsets(element, x, y);
+ this.xcomp = x;
+ this.ycomp = y;
+ this.offset = Element.cumulativeOffset(element);
+
+ return (y >= this.offset[1] &&
+ y < this.offset[1] + element.offsetHeight &&
+ x >= this.offset[0] &&
+ x < this.offset[0] + element.offsetWidth);
+ },
+
+ withinIncludingScrolloffsets: function(element, x, y) {
+ var offsetcache = Element.cumulativeScrollOffset(element);
+
+ this.xcomp = x + offsetcache[0] - this.deltaX;
+ this.ycomp = y + offsetcache[1] - this.deltaY;
+ this.offset = Element.cumulativeOffset(element);
+
+ return (this.ycomp >= this.offset[1] &&
+ this.ycomp < this.offset[1] + element.offsetHeight &&
+ this.xcomp >= this.offset[0] &&
+ this.xcomp < this.offset[0] + element.offsetWidth);
+ },
+
+ overlap: function(mode, element) {
+ if (!mode) return 0;
+ if (mode == 'vertical')
+ return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
+ element.offsetHeight;
+ if (mode == 'horizontal')
+ return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
+ element.offsetWidth;
+ },
+
+
+ cumulativeOffset: Element.Methods.cumulativeOffset,
+
+ positionedOffset: Element.Methods.positionedOffset,
+
+ absolutize: function(element) {
+ Position.prepare();
+ return Element.absolutize(element);
+ },
+
+ relativize: function(element) {
+ Position.prepare();
+ return Element.relativize(element);
+ },
+
+ realOffset: Element.Methods.cumulativeScrollOffset,
+
+ offsetParent: Element.Methods.getOffsetParent,
+
+ page: Element.Methods.viewportOffset,
+
+ clone: function(source, target, options) {
+ options = options || { };
+ return Element.clonePosition(target, source, options);
+ }
+};
+
+/*--------------------------------------------------------------------------*/
+
+if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
+ function iter(name) {
+ return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
+ }
+
+ instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ?
+ function(element, className) {
+ className = className.toString().strip();
+ var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className);
+ return cond ? document._getElementsByXPath('.//*' + cond, element) : [];
+ } : function(element, className) {
+ className = className.toString().strip();
+ var elements = [], classNames = (/\s/.test(className) ? $w(className) : null);
+ if (!classNames && !className) return elements;
+
+ var nodes = $(element).getElementsByTagName('*');
+ className = ' ' + className + ' ';
+
+ for (var i = 0, child, cn; child = nodes[i]; i++) {
+ if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) ||
+ (classNames && classNames.all(function(name) {
+ return !name.toString().blank() && cn.include(' ' + name + ' ');
+ }))))
+ elements.push(Element.extend(child));
+ }
+ return elements;
+ };
+
+ return function(className, parentElement) {
+ return $(parentElement || document.body).getElementsByClassName(className);
+ };
+}(Element.Methods);
+
+/*--------------------------------------------------------------------------*/
+
+Element.ClassNames = Class.create();
+Element.ClassNames.prototype = {
+ initialize: function(element) {
+ this.element = $(element);
+ },
+
+ _each: function(iterator) {
+ this.element.className.split(/\s+/).select(function(name) {
+ return name.length > 0;
+ })._each(iterator);
+ },
+
+ set: function(className) {
+ this.element.className = className;
+ },
+
+ add: function(classNameToAdd) {
+ if (this.include(classNameToAdd)) return;
+ this.set($A(this).concat(classNameToAdd).join(' '));
+ },
+
+ remove: function(classNameToRemove) {
+ if (!this.include(classNameToRemove)) return;
+ this.set($A(this).without(classNameToRemove).join(' '));
+ },
+
+ toString: function() {
+ return $A(this).join(' ');
+ }
+};
+
+Object.extend(Element.ClassNames.prototype, Enumerable);
+
+/*--------------------------------------------------------------------------*/
+
+(function() {
+ window.Selector = Class.create({
+ initialize: function(expression) {
+ this.expression = expression.strip();
+ },
+
+ findElements: function(rootElement) {
+ return Prototype.Selector.select(this.expression, rootElement);
+ },
+
+ match: function(element) {
+ return Prototype.Selector.match(element, this.expression);
+ },
+
+ toString: function() {
+ return this.expression;
+ },
+
+ inspect: function() {
+ return "#<Selector: " + this.expression + ">";
+ }
+ });
+
+ Object.extend(Selector, {
+ matchElements: function(elements, expression) {
+ var match = Prototype.Selector.match,
+ results = [];
+
+ for (var i = 0, length = elements.length; i < length; i++) {
+ var element = elements[i];
+ if (match(element, expression)) {
+ results.push(Element.extend(element));
+ }
+ }
+ return results;
+ },
+
+ findElement: function(elements, expression, index) {
+ index = index || 0;
+ var matchIndex = 0, element;
+ for (var i = 0, length = elements.length; i < length; i++) {
+ element = elements[i];
+ if (Prototype.Selector.match(element, expression) && index === matchIndex++) {
+ return Element.extend(element);
+ }
+ }
+ },
+
+ findChildElements: function(element, expressions) {
+ var selector = expressions.toArray().join(', ');
+ return Prototype.Selector.select(selector, element || document);
+ }
+ });
+})();
+</script>
+
+
+
+<script id="slides280" type="x">
+ //create a new timestamp to monitor launch time
+ _LAUNCH_TIME = new Date();
+
+ var path = document.location.href;
+
+ path = path.substr(0, path.lastIndexOf('/') + 1);
+
+ document.write("<base href=\"" + path + "1224293852/" + "\"><!--[if IE]><"+"/base><![endif]-->");
+
+
+
+
+/*
+ * Objective-J.js
+ * Objective-J
+ *
+ * Created by Francisco Tolmasky.
+ * Copyright 2008, 280 North, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+var NO = false,
+ YES = true,
+ nil = null,
+ Nil = null,
+ NULL = null,
+ ABS = Math.abs,
+ ASIN = Math.asin,
+ ACOS = Math.acos,
+ ATAN = Math.atan,
+ ATAN2 = Math.atan2,
+ SIN = Math.sin,
+ COS = Math.cos,
+ TAN = Math.tan,
+ EXP = Math.exp,
+ POW = Math.pow,
+ CEIL = Math.ceil,
+ FLOOR = Math.floor,
+ ROUND = Math.round,
+ MIN = Math.min,
+ MAX = Math.max,
+ RAND = Math.random,
+ SQRT = Math.sqrt,
+ E = Math.E,
+ LN2 = Math.LN2,
+ LN10 = Math.LN10,
+ LOG2E = Math.LOG2E,
+ LOG10E = Math.LOG10E,
+ PI = Math.PI,
+ PI2 = Math.PI * 2.0,
+ PI_2 = Math.PI / 2.0,
+ SQRT1_2 = Math.SQRT1_2,
+ SQRT2 = Math.SQRT2;
+var objj_continue_alerting = NO;
+function objj_alert(aString)
+{
+ if (!objj_continue_alerting)
+ return;
+ objj_continue_alerting = confirm(aString + "\n\nClick cancel to prevent further alerts.");
+}
+function objj_fprintf(stream, string)
+{
+ stream(string);
+}
+function objj_printf(string)
+{
+ objj_fprintf(alert, string);
+}
+var CLS_CLASS = 0x1,
+ CLS_META = 0x2,
+ CLS_INITIALIZED = 0x4,
+ CLS_INITIALIZING = 0x8;
+function objj_ivar( aName, aType)
+{
+ this.name = aName;
+ this.type = aType;
+}
+function objj_method( aName, anImplementation, types)
+{
+ this.name = aName;
+ this.method_imp = anImplementation;
+ this.types = types;
+}
+function objj_class()
+{
+ this.isa = NULL;
+ this.super_class = NULL;
+ this.sub_classes = [];
+ this.name = NULL;
+ this.info = 0;
+ this.ivars = [];
+ this.method_list = [];
+ this.method_hash = {};
+ this.method_store = function() { };
+ this.method_dtable = this.method_store.prototype;
+ this.allocator = function() { };
+ this.__address = -1;
+}
+function objj_object()
+{
+ this.isa = NULL;
+ this.__address = -1;
+}
+var OBJECT_COUNT = 0;
+function _objj_generateObjectHash()
+{
+ return OBJECT_COUNT++;
+}
+function class_getName( aClass)
+{
+ if (aClass == Nil)
+ return "";
+ return aClass.name;
+}
+function class_isMetaClass( aClass)
+{
+ if (!aClass)
+ return NO;
+ return ((aClass.info & (CLS_META)));
+}
+function class_getSuperclass( aClass)
+{
+ if (aClass == Nil)
+ return Nil;
+ return aClass.super_class;
+}
+function class_setSuperclass( aClass, aSuperClass)
+{
+}
+function class_isMetaClass( aClass)
+{
+ return ((aClass.info & (CLS_META)));
+}
+function class_addIvar( aClass, aName, aType)
+{
+ var thePrototype = aClass.allocator.prototype;
+ if (typeof thePrototype[aName] != "undefined")
+ return NO;
+ aClass.ivars.push(new objj_ivar(aName, aType));
+ thePrototype[aName] = NULL;
+ return YES;
+}
+function class_addIvars( aClass, ivars)
+{
+ var index = 0,
+ count = ivars.length,
+ thePrototype = aClass.allocator.prototype;
+ for (; index < count; ++index)
+ {
+ var ivar = ivars[index],
+ name = ivar.name;
+ if (typeof thePrototype[name] == "undefined")
+ {
+ aClass.ivars.push(ivar);
+ thePrototype[name] = NULL;
+ }
+ }
+}
+function class_copyIvarList( aClass)
+{
+ return aClass.ivars.slice(0);
+}
+function class_addMethod( aClass, aName, anImplementation, aType)
+{
+ if (aClass.method_hash[aName])
+ return NO;
+ var method = new objj_method(aName, anImplementation, aType);
+ aClass.method_list.push(method);
+ aClass.method_dtable[aName] = method;
+ if (!((aClass.info & (CLS_META))) && (((aClass.info & (CLS_META))) ? aClass : aClass.isa).isa == (((aClass.info & (CLS_META))) ? aClass : aClass.isa))
+ class_addMethods((((aClass.info & (CLS_META))) ? aClass : aClass.isa), methods);
+ return YES;
+}
+function class_addMethods( aClass, methods)
+{
+ var index = 0,
+ count = methods.length,
+ method_list = aClass.method_list,
+ method_dtable = aClass.method_dtable;
+ for (; index < count; ++index)
+ {
+ var method = methods[index];
+ if (aClass.method_hash[method.name])
+ continue;
+ method_list.push(method);
+ method_dtable[method.name] = method;
+ }
+ if (!((aClass.info & (CLS_META))) && (((aClass.info & (CLS_META))) ? aClass : aClass.isa).isa == (((aClass.info & (CLS_META))) ? aClass : aClass.isa))
+ class_addMethods((((aClass.info & (CLS_META))) ? aClass : aClass.isa), methods);
+}
+function class_getInstanceMethod( aClass, aSelector)
+{
+ if (!aClass || !aSelector)
+ return NULL;
+ var method = aClass.method_dtable[aSelector];
+ return method ? method : NULL;
+}
+function class_getClassMethod( aClass, aSelector)
+{
+ if (!aClass || !aSelector)
+ return NULL;
+ var method = (((aClass.info & (CLS_META))) ? aClass : aClass.isa).method_dtable[aSelector];
+ return method ? method : NULL;
+}
+function class_copyMethodList( aClass)
+{
+ return aClass.method_list.slice(0);
+}
+var _class_initialize = function( aClass)
+{
+ var meta = (((aClass.info & (CLS_META))) ? aClass : aClass.isa);
+ if ((aClass.info & (CLS_META)))
+ aClass = objj_getClass(aClass.name);
+ if (aClass.super_class && !((((aClass.super_class.info & (CLS_META))) ? aClass.super_class : aClass.super_class.isa).info & (CLS_INITIALIZED)))
+ _class_initialize(aClass.super_class);
+ if (!(meta.info & (CLS_INITIALIZED)) && !(meta.info & (CLS_INITIALIZING)))
+ {
+ meta.info = (meta.info | (CLS_INITIALIZING)) & ~(0);
+ objj_msgSend(aClass, "initialize");
+ meta.info = (meta.info | (CLS_INITIALIZED)) & ~(CLS_INITIALIZING);
+ }
+}
+var _objj_forward = new objj_method("forward", function(self, _cmd)
+{
+ return objj_msgSend(self, "forward::", _cmd, arguments);
+});
+function class_getMethodImplementation( aClass, aSelector)
+{
+ if (!((((aClass.info & (CLS_META))) ? aClass : aClass.isa).info & (CLS_INITIALIZED))) _class_initialize(aClass); var method = aClass.method_dtable[aSelector]; if (!method) method = _objj_forward; var implementation = method.method_imp;;
+ return implementation;
+}
+var GLOBAL_NAMESPACE = this,
+ REGISTERED_CLASSES = {};
+function objj_allocateClassPair( superclass, aName)
+{
+ var classObject = new objj_class(),
+ metaClassObject = new objj_class(),
+ rootClassObject = classObject;
+ if (superclass)
+ {
+ rootClassObject = superclass;
+ while (rootClassObject.superclass)
+ rootClassObject = rootClassObject.superclass;
+ classObject.allocator.prototype = new superclass.allocator;
+ classObject.method_store.prototype = new superclass.method_store;
+ classObject.method_dtable = classObject.method_store.prototype;
+ metaClassObject.method_store.prototype = new superclass.isa.method_store;
+ metaClassObject.method_dtable = metaClassObject.method_store.prototype;
+ classObject.super_class = superclass;
+ metaClassObject.super_class = superclass.isa;
+ }
+ else
+ classObject.allocator.prototype = new objj_object();
+ classObject.isa = metaClassObject;
+ classObject.name = aName;
+ classObject.info = CLS_CLASS;
+ classObject.__address = (OBJECT_COUNT++);
+ metaClassObject.isa = rootClassObject.isa;
+ metaClassObject.name = aName;
+ metaClassObject.info = CLS_META;
+ metaClassObject.__address = (OBJECT_COUNT++);
+ return classObject;
+}
+function objj_registerClassPair( aClass)
+{
+ GLOBAL_NAMESPACE[aClass.name] = aClass;
+ REGISTERED_CLASSES[aClass.name] = aClass;
+}
+function class_createInstance( aClass)
+{
+ if (!aClass)
+ objj_exception_throw(new objj_exception(OBJJNilClassException, "*** Attempting to create object with Nil class."));
+ var object = new aClass.allocator;
+ object.__address = (OBJECT_COUNT++);
+ object.isa = aClass;
+ return object;
+}
+var prototype_bug = function() { }
+prototype_bug.prototype.member = false;
+with (new prototype_bug())
+ member = true;
+if (new prototype_bug().member)
+{
+var fast_class_createInstance = class_createInstance;
+class_createInstance = function( aClass)
+{
+ var object = fast_class_createInstance(aClass);
+ if (object)
+ {
+ var theClass = object.isa,
+ actualClass = theClass;
+ while (theClass)
+ {
+ var ivars = theClass.ivars;
+ count = ivars.length;
+ while (count--)
+ object[ivars[count].name] = NULL;
+ theClass = theClass.super_class;
+ }
+ object.isa = actualClass;
+ }
+ return object;
+}
+}
+function object_getClassName( anObject)
+{
+ if (!anObject)
+ return "";
+ var theClass = anObject.isa;
+ return theClass ? class_getName(theClass) : "";
+}
+function objj_lookUpClass( aName)
+{
+ var theClass = REGISTERED_CLASSES[aName];
+ return theClass ? theClass : Nil;
+}
+function objj_getClass( aName)
+{
+ var theClass = REGISTERED_CLASSES[aName];
+ if (!theClass)
+ {
+ }
+ return theClass ? theClass : Nil;
+}
+function objj_getMetaClass( aName)
+{
+ var theClass = objj_getClass(aName);
+ return (((theClass.info & (CLS_META))) ? theClass : theClass.isa);
+}
+function ivar_getName(anIvar)
+{
+ return anIvar.name;
+}
+function ivar_getTypeEncoding(anIvar)
+{
+ return anIvar.type;
+}
+function objj_msgSend( aReceiver, aSelector)
+{
+ if (aReceiver == nil)
+ return nil;
+ if (!((((aReceiver.isa.info & (CLS_META))) ? aReceiver.isa : aReceiver.isa.isa).info & (CLS_INITIALIZED))) _class_initialize(aReceiver.isa); var method = aReceiver.isa.method_dtable[aSelector]; if (!method) method = _objj_forward; var implementation = method.method_imp;;
+ return implementation.apply(aReceiver, arguments);
+}
+function objj_msgSendSuper( aSuper, aSelector)
+{
+ var super_class = aSuper.super_class;
+ arguments[0] = aSuper.receiver;
+ if (!((((super_class.info & (CLS_META))) ? super_class : super_class.isa).info & (CLS_INITIALIZED))) _class_initialize(super_class); var method = super_class.method_dtable[aSelector]; if (!method) method = _objj_forward; var implementation = method.method_imp;;
+ return implementation.apply(aSuper.receiver, arguments);
+}
+function method_getName( aMethod)
+{
+ return aMethod.name;
+}
+function method_getImplementation( aMethod)
+{
+ return aMethod.method_imp;
+}
+function method_setImplementation( aMethod, anImplementation)
+{
+ var oldImplementation = aMethod.method_imp;
+ aMethod.method_imp = anImplementation;
+ return oldImplementation;
+}
+function method_exchangeImplementations( lhs, rhs)
+{
+ var lhs_imp = method_getImplementation(lhs),
+ rhs_imp = method_getImplementation(rhs);
+ method_setImplementation(lhs, rhs_imp);
+ method_setImplementation(rhs, lhs_imp);
+}
+function sel_getName(aSelector)
+{
+ return aSelector ? aSelector : "<null selector>";
+}
+function sel_getUid( aName)
+{
+ return aName;
+}
+function sel_isEqual( lhs, rhs)
+{
+ return lhs == rhs;
+}
+function sel_registerName(aName)
+{
+ return aName;
+}
+function objj_dictionary()
+{
+ this._keys = [];
+ this.count = 0;
+ this._buckets = {};
+ this.__address = (OBJECT_COUNT++);
+}
+function dictionary_containsKey(aDictionary, aKey)
+{
+ return aDictionary._buckets[aKey] != NULL;
+}
+function dictionary_getCount(aDictionary)
+{
+ return aDictionary.count;
+}
+function dictionary_getValue(aDictionary, aKey)
+{
+ return aDictionary._buckets[aKey];
+}
+function dictionary_setValue(aDictionary, aKey, aValue)
+{
+ if (aDictionary._buckets[aKey] == NULL)
+ {
+ aDictionary._keys.push(aKey);
+ ++aDictionary.count;
+ }
+ if ((aDictionary._buckets[aKey] = aValue) == NULL)
+ --aDictionary.count;
+}
+function dictionary_removeValue(aDictionary, aKey)
+{
+ if (aDictionary._buckets[aKey] == NULL)
+ return;
+ --aDictionary.count;
+ if (aDictionary._keys.indexOf)
+ aDictionary._keys.splice(aDictionary._keys.indexOf(aKey), 1);
+ else
+ {
+ var keys = aDictionary._keys,
+ index = 0,
+ count = keys.length;
+ for (; index < count; ++index)
+ if (keys[index] == aKey)
+ {
+ keys.splice(index, 1);
+ break;
+ }
+ }
+ delete aDictionary._buckets[aKey];
+}
+function dictionary_replaceValue(aDictionary, aKey, aValue)
+{
+ if (aDictionary[aKey] == NULL)
+ return;
+}
+function dictionary_description(aDictionary)
+{
+ str = "{ ";
+ for ( x in aDictionary._buckets)
+ str += x + ":" + aDictionary._buckets[x] + ",";
+ str += " }";
+ return str;
+}
+kCFPropertyListOpenStepFormat = 1;
+kCFPropertyListXMLFormat_v1_0 = 100;
+kCFPropertyListBinaryFormat_v1_0 = 200;
+kCFPropertyList280NorthFormat_v1_0 = -1000;
+OBJJPlistParseException = "OBJJPlistParseException";
+var kCFPropertyList280NorthMagicNumber = "280NPLIST";
+function objj_data()
+{
+ this.string = "";
+ this._plistObject = NULL;
+ this.bytes = NULL;
+ this.base64 = NULL;
+}
+var objj_markedStream = function(aString)
+{
+ var index = aString.indexOf(';');
+ this._magicNumber = aString.substr(0, index);
+ this._location = aString.indexOf(';', ++index);
+ this._version = aString.substring(index, this._location++);
+ this._string = aString;
+}
+objj_markedStream.prototype.magicNumber = function()
+{
+ return this._magicNumber;
+}
+objj_markedStream.prototype.version = function()
+
+{
+ return this._version;
+}
+objj_markedStream.prototype.getMarker = function()
+{
+ var string = this._string,
+ location = this._location;
+ if (location >= string.length)
+ return NULL;
+ var next = string.indexOf(';', location);
+ if (next < 0)
+ return NULL;
+ var marker = string.substring(location, next);
+ this._location = next + 1;
+ return marker;
+}
+objj_markedStream.prototype.getString = function()
+{
+ var string = this._string,
+ location = this._location;
+ if (location >= string.length)
+ return NULL;
+ var next = string.indexOf(';', location);
+ if (next < 0)
+ return NULL;
+ var size = parseInt(string.substring(location, next)),
+ text = string.substr(next + 1, size);
+ this._location = next + 1 + size;
+ return text;
+}
+function CPPropertyListCreateData(aPlistObject, aFormat)
+{
+ if (aFormat == kCFPropertyListXMLFormat_v1_0)
+ return CPPropertyListCreateXMLData(aPlistObject);
+ if (aFormat == kCFPropertyList280NorthFormat_v1_0)
+ return CPPropertyListCreate280NorthData(aPlistObject);
+ return NULL;
+}
+function CPPropertyListCreateFromData(aData, aFormat)
+{
+ if (!aFormat)
+ {
+ if (aData instanceof objj_data)
+ {
+ var string = aData.string ? aData.string : objj_msgSend(aData, "string");
+ if (string.substr(0, kCFPropertyList280NorthMagicNumber.length) == kCFPropertyList280NorthMagicNumber)
+ aFormat = kCFPropertyList280NorthFormat_v1_0;
+ else
+ aFormat = kCFPropertyListXMLFormat_v1_0;
+ }
+ else
+ aFormat = kCFPropertyListXMLFormat_v1_0;
+ }
+ if (aFormat == kCFPropertyListXMLFormat_v1_0)
+ return CPPropertyListCreateFromXMLData(aData);
+ if (aFormat == kCFPropertyList280NorthFormat_v1_0)
+ return CPPropertyListCreateFrom280NorthData(aData);
+ return NULL;
+}
+var _CPPropertyListSerializeObject = function(aPlist, serializers)
+{
+ var type = typeof aPlist,
+ valueOf = aPlist.valueOf(),
+ typeValueOf = typeof valueOf;
+ if (type != typeValueOf)
+ {
+ type = typeValueOf;
+ aPlist = valueOf;
+ }
+ if (type == "string")
+ return serializers["string"](aPlist, serializers);
+ else if (aPlist === true || aPlist === false)
+ return serializers["boolean"](aPlist, serializers);
+ else if (type == "number")
+ {
+ var integer = FLOOR(aPlist);
+ if (integer == aPlist)
+ return serializers["integer"](aPlist, serializers);
+ else
+ return serializers["real"](aPlist, serializers);
+ }
+ else if (aPlist.slice)
+ return serializers["array"](aPlist, serializers);
+ else
+ return serializers["dictionary"](aPlist, serializers);
+}
+var XML_XML = "xml",
+ XML_DOCUMENT = "#document",
+ PLIST_PLIST = "plist",
+ PLIST_KEY = "key",
+ PLIST_DICTIONARY = "dict",
+ PLIST_ARRAY = "array",
+ PLIST_STRING = "string",
+ PLIST_BOOLEAN_TRUE = "true",
+ PLIST_BOOLEAN_FALSE = "false",
+ PLIST_NUMBER_REAL = "real",
+ PLIST_NUMBER_INTEGER = "integer";
+var _plist_traverseNextNode = function(anXMLNode, stayWithin, stack)
+{
+ var node = anXMLNode;
+ node = (node.firstChild); if (node != NULL && ((node.nodeType) == 8 || (node.nodeType) == 3)) while ((node = (node.nextSibling)) && ((node.nodeType) == 8 || (node.nodeType) == 3)) ;;
+ if (node)
+ return node;
+ if ((anXMLNode.nodeName) == PLIST_ARRAY || (anXMLNode.nodeName) == PLIST_DICTIONARY)
+ stack.pop();
+ else
+ {
+ if (node == stayWithin)
+ return NULL;
+ node = anXMLNode;
+ while ((node = (node.nextSibling)) && ((node.nodeType) == 8 || (node.nodeType) == 3)) ;;
+ if (node)
+ return node;
+ }
+ node = anXMLNode;
+ while (node)
+ {
+ var next = node;
+ while ((next = (next.nextSibling)) && ((next.nodeType) == 8 || (next.nodeType) == 3)) ;;
+ if (next)
+ return next;
+ var node = (node.parentNode);
+ if (stayWithin && node == stayWithin)
+ return NULL;
+ stack.pop();
+ }
+ return NULL;
+}
+function CPPropertyListCreateFromXMLData(XMLNodeOrData)
+{
+ var XMLNode = XMLNodeOrData;
+ if (XMLNode.string)
+ {
+ if (window.ActiveXObject)
+ {
+ XMLNode = new ActiveXObject("Microsoft.XMLDOM");
+ XMLNode.loadXML(XMLNodeOrData.string.substr(XMLNodeOrData.string.indexOf(".dtd\">") + 6));
+ }
+ else
+ XMLNode = (new DOMParser().parseFromString(XMLNodeOrData.string, "text/xml").documentElement);
+ }
+ while (((XMLNode.nodeName) == XML_DOCUMENT) || ((XMLNode.nodeName) == XML_XML))
+ XMLNode = (XMLNode.firstChild); if (XMLNode != NULL && ((XMLNode.nodeType) == 8 || (XMLNode.nodeType) == 3)) while ((XMLNode = (XMLNode.nextSibling)) && ((XMLNode.nodeType) == 8 || (XMLNode.nodeType) == 3)) ;;
+ if (((XMLNode.nodeType) == 10))
+ while ((XMLNode = (XMLNode.nextSibling)) && ((XMLNode.nodeType) == 8 || (XMLNode.nodeType) == 3)) ;;
+ if (!((XMLNode.nodeName) == PLIST_PLIST))
+ return NULL;
+ var key = "",
+ object = NULL,
+ plistObject = NULL,
+ plistNode = XMLNode,
+ containers = [],
+ currentContainer = NULL;
+ while (XMLNode = _plist_traverseNextNode(XMLNode, plistNode, containers))
+ {
+ var count = containers.length;
+ if (count)
+ currentContainer = containers[count - 1];
+ if ((XMLNode.nodeName) == PLIST_KEY)
+ {
+ key = (((XMLNode.firstChild).nodeValue));
+ while ((XMLNode = (XMLNode.nextSibling)) && ((XMLNode.nodeType) == 8 || (XMLNode.nodeType) == 3)) ;;
+ }
+ switch ((XMLNode.nodeName))
+ {
+ case PLIST_ARRAY: object = []
+ containers.push(object);
+ break;
+ case PLIST_DICTIONARY: object = new objj_dictionary();
+ containers.push(object);
+ break;
+ case PLIST_NUMBER_REAL: object = parseFloat((((XMLNode.firstChild).nodeValue)));
+ break;
+ case PLIST_NUMBER_INTEGER: object = parseInt((((XMLNode.firstChild).nodeValue)));
+ break;
+ case PLIST_STRING: object = decodeURIComponent((XMLNode.firstChild) ? (((XMLNode.firstChild).nodeValue)) : "");
+ break;
+ case PLIST_BOOLEAN_TRUE: object = true;
+ break;
+ case PLIST_BOOLEAN_FALSE: object = false;
+ break;
+ default: objj_exception_throw(new objj_exception(OBJJPlistParseException, "*** " + (XMLNode.nodeName) + " tag not recognized in Plist."));
+ }
+ if (!plistObject)
+ plistObject = object;
+ else if (currentContainer)
+ if (currentContainer.slice)
+ currentContainer.push(object);
+ else
+ { if ((currentContainer)._buckets[key] == NULL) { (currentContainer)._keys.push(key); ++(currentContainer).count; } if (((currentContainer)._buckets[key] = object) == NULL) --(currentContainer).count;};
+ }
+ return plistObject;
+}
+function CPPropertyListCreateXMLData(aPlist)
+{
+ var data = new objj_data();
+ data.string = "";
+ data.string += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
+ data.string += "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">";
+ data.string += "<plist version = \"1.0\">";
+ _CPPropertyListAppendXMLData(data, aPlist, "");
+ data.string += "</plist>";
+ return data;
+}
+var _CPArrayAppendXMLData = function(XMLData, anArray)
+{
+ var i = 0,
+ count = anArray.length;
+ XMLData.string += "<array>";
+ for (; i < count; ++i)
+ _CPPropertyListAppendXMLData(XMLData, anArray[i]);
+ XMLData.string += "</array>";
+}
+var _CPDictionaryAppendXMLData = function(XMLData, aDictionary)
+{
+ var keys = aDictionary._keys,
+ i = 0,
+ count = keys.length;
+ XMLData.string += "<dict>";
+ for (; i < count; ++i)
+ {
+ XMLData.string += "<key>" + keys[i] + "</key>";
+ _CPPropertyListAppendXMLData(XMLData, ((aDictionary)._buckets[keys[i]]));
+ }
+ XMLData.string += "</dict>";
+}
+var _CPPropertyListAppendXMLData = function(XMLData, aPlist)
+{
+ var type = typeof aPlist,
+ valueOf = aPlist.valueOf(),
+ typeValueOf = typeof valueOf;
+ if (type != typeValueOf)
+ {
+ type = typeValueOf;
+ aPlist = valueOf;
+ }
+ if (type == "string")
+ XMLData.string += "<string>" + encodeURIComponent(aPlist) + "</string>";
+ else if (aPlist === true)
+ XMLData.string += "<true/>";
+ else if (aPlist === false)
+ XMLData.string += "<false/>";
+ else if (type == "number")
+ {
+ var integer = FLOOR(aPlist);
+ if (integer == aPlist)
+ XMLData.string += "<integer>" + aPlist + "</integer>";
+ else
+ XMLData.string += "<real>" + aPlist + "</real>";
+ }
+ else if (aPlist.slice)
+ _CPArrayAppendXMLData(XMLData, aPlist);
+ else
+ _CPDictionaryAppendXMLData(XMLData, aPlist);
+}
+var ARRAY_MARKER = "A",
+ DICTIONARY_MARKER = "D",
+ FLOAT_MARKER = "f",
+ INTEGER_MARKER = "d",
+ STRING_MARKER = "S",
+ TRUE_MARKER = "T",
+ FALSE_MARKER = "F",
+ KEY_MARKER = "K",
+ END_MARKER = "E";
+function CPPropertyListCreateFrom280NorthData(aData)
+{
+ var stream = new objj_markedStream(aData.string),
+ marker = NULL,
+ key = "",
+ object = NULL,
+ plistObject = NULL,
+ containers = [],
+ currentContainer = NULL;
+ while (marker = stream.getMarker())
+ {
+ if (marker == END_MARKER)
+ {
+ containers.pop();
+ continue;
+ }
+ var count = containers.length;
+ if (count)
+ currentContainer = containers[count - 1];
+ if (marker == KEY_MARKER)
+ {
+ key = stream.getString();
+ marker = stream.getMarker();
+ }
+ switch (marker)
+ {
+ case ARRAY_MARKER: object = []
+ containers.push(object);
+ break;
+ case DICTIONARY_MARKER: object = new objj_dictionary();
+ containers.push(object);
+ break;
+ case FLOAT_MARKER: object = parseFloat(stream.getString());
+ break;
+ case INTEGER_MARKER: object = parseInt(stream.getString());
+ break;
+ case STRING_MARKER: object = stream.getString();
+ break;
+ case TRUE_MARKER: object = true;
+ break;
+ case FALSE_MARKER: object = false;
+ break;
+ default: objj_exception_throw(new objj_exception(OBJJPlistParseException, "*** " + marker + " marker not recognized in Plist."));
+ }
+ if (!plistObject)
+ plistObject = object;
+ else if (currentContainer)
+ if (currentContainer.slice)
+ currentContainer.push(object);
+ else
+ { if ((currentContainer)._buckets[key] == NULL) { (currentContainer)._keys.push(key); ++(currentContainer).count; } if (((currentContainer)._buckets[key] = object) == NULL) --(currentContainer).count;};
+ }
+ return plistObject;
+}
+function CPPropertyListCreate280NorthData(aPlist)
+{
+ var data = new objj_data();
+ data.string = kCFPropertyList280NorthMagicNumber + ";1.0;" + _CPPropertyListSerializeObject(aPlist, _CPPropertyList280NorthSerializers);
+ return data;
+}
+var _CPPropertyList280NorthSerializers = {};
+_CPPropertyList280NorthSerializers["string"] = function(aString)
+{
+ return STRING_MARKER + ';' + aString.length + ';' + aString;
+}
+_CPPropertyList280NorthSerializers["boolean"] = function(aBoolean)
+{
+ return (aBoolean ? TRUE_MARKER : FALSE_MARKER) + ';';
+}
+_CPPropertyList280NorthSerializers["integer"] = function(anInteger)
+{
+ var string = "" + anInteger;
+ return INTEGER_MARKER + ';' + string.length + ';' + string;
+}
+_CPPropertyList280NorthSerializers["real"] = function(aFloat)
+{
+ var string = "" + aFloat;
+ return FLOAT_MARKER + ';' + string.length + ';' + string;
+}
+_CPPropertyList280NorthSerializers["array"] = function(anArray, serializers)
+{
+ var index = 0,
+ count = anArray.length,
+ string = ARRAY_MARKER + ';';
+ for (; index < count; ++index)
+ string += _CPPropertyListSerializeObject(anArray[index], serializers);
+ return string + END_MARKER + ';';
+}
+_CPPropertyList280NorthSerializers["dictionary"] = function(aDictionary, serializers)
+{
+ var keys = aDictionary._keys,
+ index = 0,
+ count = keys.length,
+ string = DICTIONARY_MARKER +';';
+ for (; index < count; ++index)
+ {
+ var key = keys[index];
+ string += KEY_MARKER + ';' + key.length + ';' + key;
+ string += _CPPropertyListSerializeObject(((aDictionary)._buckets[key]), serializers);
+ }
+ return string + END_MARKER + ';';
+}
+OBJJFileNotFoundException = "OBJJFileNotFoundException";
+OBJJExecutableNotFoundException = "OBJJExecutableNotFoundException";
+var objj_files = { },
+ objj_bundles = { },
+ objj_bundlesForClass = { },
+ objj_searches = { };
+var OBJJ_NO_FILE = {},
+ OBJJ_INCLUDE_PATHS = ["Frameworks", "SomethingElse"];
+var OBJJ_BASE_URI = "";
+if (window.opera) {
+var DOMBaseElement = document.getElementsByTagName("base")[0];
+if (DOMBaseElement)
+ OBJJ_BASE_URI = (DOMBaseElement.getAttribute('href')).substr(0, (DOMBaseElement.getAttribute('href')).lastIndexOf('/') + 1);
+}
+function objj_file()
+{
+ this.path = NULL;
+ this.bundle = NULL;
+ this.included = NO;
+ this.contents = NULL;
+ this.fragments = NULL;
+}
+function objj_bundle()
+{
+ this.path = NULL;
+ this.info = NULL;
+ this.__address = (OBJECT_COUNT++);
+}
+function objj_getBundleWithPath(aPath)
+{
+ return objj_bundles[aPath];
+}
+function objj_bundleForClass(aClass)
+{
+ return objj_bundlesForClass[aClass.name];
+}
+function objj_addClassForBundle(aClass, aBundle)
+{
+ objj_bundlesForClass[aClass.name] = aBundle;
+}
+function objj_request_file(aFilePath, shouldSearchLocally, aCallback)
+{
+ new objj_search(aFilePath, shouldSearchLocally, aCallback).attemptNextSearchPath();
+}
+var objj_search = function(aFilePath, shouldSearchLocally, aCallback)
+{
+ this.filePath = aFilePath;
+ this.bundle = NULL;
+ this.bundleObservers = [];
+ this.searchPath = NULL;
+ this.searchedPaths = [];
+ this.includePathsIndex = shouldSearchLocally ? -1 : 0;
+ this.searchRequest = NULL;
+ this.didCompleteCallback = aCallback;
+}
+objj_search.prototype.nextSearchPath = function()
+{
+ var path = objj_standardize_path((this.includePathsIndex == -1 ? "" : OBJJ_INCLUDE_PATHS[this.includePathsIndex] + '/') + this.filePath);
+ ++this.includePathsIndex;
+ return path;
+}
+objj_search.prototype.attemptNextSearchPath = function()
+{
+ var searchPath = this.nextSearchPath(),
+ file = objj_files[searchPath];
+ objj_alert("Will attempt to find " + this.filePath + " at " + searchPath);
+ if (file)
+ {
+ objj_alert("The file request at " + this.filePath + " has already been downloaded at " + searchPath);
+ if (this.didCompleteCallback)
+ this.didCompleteCallback(file);
+ return;
+ }
+ var existingSearch = objj_searches[searchPath];
+ if (existingSearch)
+ {
+ if (this.didCompleteCallback)
+ existingSearch.didCompleteCallback = this.didCompleteCallback;
+ return;
+ }
+ this.searchedPaths.push(this.searchPath = searchPath);
+ var infoPath = objj_standardize_path((searchPath).substr(0, (searchPath).lastIndexOf('/') + 1) + "Info.plist")
+ bundle = objj_bundles[infoPath];
+ if (bundle)
+ {
+ this.bundle = bundle;
+ this.request(searchPath, this.didReceiveSearchResponse);
+ }
+ else
+ {
+ var existingBundleSearch = objj_searches[infoPath];
+ if (existingBundleSearch)
+ {
+ --this.includePathsIndex;
+ this.searchedPaths.pop();
+ if (this.searchedPaths.length)
+ this.searchPath = this.searchedPaths[this.searchedPaths.length - 1];
+ else
+ this.searchPath = NULL;
+ existingBundleSearch.bundleObservers.push(this);
+ return;
+ }
+ else
+ {
+ this.bundleObservers.push(this);
+ this.request(infoPath, this.didReceiveBundleResponse);
+ if (!this.searchReplaced)
+ this.searchRequest = this.request(searchPath, this.didReceiveSearchResponse);
+ }
+ }
+}
+if (window.ActiveXObject) {
+objj_search.responseCallbackLock = NO;
+objj_search.responseCallbackQueue = [];
+objj_search.removeResponseCallbackForFilePath = function(aFilePath)
+{
+ var queue = objj_search.responseCallbackQueue,
+ index = queue.length;
+ while (index--)
+ if (queue[index][3] == aFilePath)
+ {
+ queue.splice(index, 1);
+ return;
+ }
+}
+objj_search.serializeResponseCallback = function(aMethod, aSearch, aResponse, aFilePath)
+{
+ var queue = objj_search.responseCallbackQueue;
+ queue.push([aMethod, aSearch, aResponse, aFilePath]);
+ if (objj_search.responseCallbackLock)
+ return;
+ objj_search.responseCallbackLock = YES;
+ while (queue.length)
+ {
+ var callback = queue[0];
+ queue.splice(0, 1);
+ callback[0].apply(callback[1], [callback[2]]);
+ }
+ objj_search.responseCallbackLock = NO;
+}
+}
+objj_search.prototype.request = function(aFilePath, aMethod)
+{
+ var search = this,
+ isPlist = aFilePath.substr(aFilePath.length - 6, 6) == ".plist",
+ request = objj_request_xmlhttp(),
+ response = objj_response_xmlhttp();
+ response.filePath = aFilePath;
+ request.onreadystatechange = function()
+ {
+ if (request.readyState == 4)
+ {
+ if (response.success = (request.status != 404 && request.responseText && request.responseText.length) ? YES : NO)
+ {
+ if (window.files_total)
+ {
+ if (!window.files_loaded)
+ window.files_loaded = 0;
+ window.files_loaded += request.responseText.length;
+ if (window.update_progress)
+ window.update_progress(window.files_loaded / window.files_total);
+ }
+ if (isPlist)
+ response.xml = objj_standardize_xml(request);
+ else
+ response.text = request.responseText;
+ }
+ if (window.ActiveXObject)
+ objj_search.serializeResponseCallback(aMethod, search, response, aFilePath);
+ else
+ aMethod.apply(search, [response]);
+ }
+ }
+ objj_searches[aFilePath] = this;
+ if (request.overrideMimeType && isPlist)
+ request.overrideMimeType('text/xml');
+ if (window.opera && aFilePath.charAt(0) != '/')
+ aFilePath = OBJJ_BASE_URI + aFilePath;
+ try
+ {
+ request.open("GET", aFilePath, YES);
+ request.send("");
+ }
+ catch (anException)
+ {
+ response.success = NO;
+ if (window.ActiveXObject)
+ objj_search.serializeResponseCallback(aMethod, search, response, aFilePath);
+ else
+ aMethod.apply(search, [response]);
+ }
+ return request;
+}
+objj_search.prototype.didReceiveSearchResponse = function(aResponse)
+{
+ if (!this.bundle)
+ {
+ this.cachedSearchResponse = aResponse;
+ return;
+ }
+ if (aResponse.success)
+ {
+ file = new objj_file();
+ file.path = aResponse.filePath;
+ file.bundle = this.bundle
+ file.contents = aResponse.text;
+ this.complete(file);
+ }
+ else if (this.includePathsIndex < OBJJ_INCLUDE_PATHS.length)
+ {
+ this.bundle = NULL;
+ this.attemptNextSearchPath();
+ }
+ else
+ objj_exception_throw(new objj_exception(OBJJFileNotFoundException, "*** Could not locate file named \"" + this.filePath + "\" in search paths."));
+}
+objj_search.prototype.didReceiveBundleResponse = function(aResponse)
+{
+ var bundle = new objj_bundle();
+ bundle.path = aResponse.filePath;
+ if (aResponse.success)
+ bundle.info = CPPropertyListCreateFromXMLData(aResponse.xml);
+ else
+ bundle.info = new objj_dictionary();
+ objj_bundles[aResponse.filePath] = bundle;
+ var executablePath = ((bundle.info)._buckets["CPBundleExecutable"]);
+ if (executablePath)
+ {
+ this.request((aResponse.filePath).substr(0, (aResponse.filePath).lastIndexOf('/') + 1) + executablePath, this.didReceiveExecutableResponse);
+ var directory = (aResponse.filePath).substr(0, (aResponse.filePath).lastIndexOf('/') + 1),
+ replacedFiles = ((bundle.info)._buckets["CPBundleReplacedFiles"]),
+ index = 0,
+ count = replacedFiles.length;
+ for (; index < count; ++index)
+ {
+ objj_searches[directory + replacedFiles[index]] = this;
+ if (directory + replacedFiles[index] == this.searchPath)
+ {
+ this.searchReplaced = YES;
+ if (!this.cachedSearchResponse && this.searchRequest)
+ this.searchRequest.abort();
+ if (window.ActiveXObject)
+ objj_search.removeResponseCallbackForFilePath(this.searchPath);
+ }
+ }
+ }
+ this.bundle = bundle;
+ var observers = this.bundleObservers,
+ index = 0,
+ count = observers.length;
+ for(; index < count; ++index)
+ {
+ var observer = observers[index];
+ if (observer != this)
+ observer.attemptNextSearchPath();
+ else if (this.cachedSearchResponse && !this.searchReplaced)
+ this.didReceiveSearchResponse(this.cachedSearchResponse);
+ }
+ this.bundleObservers = [];
+}
+objj_search.prototype.didReceiveExecutableResponse = function(aResponse)
+{
+ if (!aResponse.success)
+ objj_exception_throw(new objj_exception(OBJJExecutableNotFoundException, "*** The specified executable could not be located at \"" + this.filePath + "\"."));
+ var files = objj_decompile(aResponse.text, this.bundle),
+ index = 0,
+ count = files.length,
+ length = this.filePath.length;
+ for (; index < count; ++index)
+ {
+ var file = files[index],
+ path = file.path;
+ if (this.filePath == path.substr(path.length - length))
+ this.complete(file);
+ else
+ objj_files[path] = file;
+ }
+}
+objj_search.prototype.complete = function(aFile)
+{
+ var index = 0,
+ count = this.searchedPaths.length;
+ for (; index < count; ++index)
+ {
+ objj_files[this.searchedPaths[index]] = aFile;
+ }
+ if (this.didCompleteCallback)
+ this.didCompleteCallback(aFile);
+}
+function objj_standardize_path(aPath)
+{
+ if (aPath.indexOf("/./") != -1 && aPath.indexOf("//") != -1 && aPath.indexOf("/../") != -1)
+ return aPath;
+ var index = 0,
+ components = aPath.split('/');
+ for(;index < components.length; ++index)
+ if(components[index] == "..")
+ {
+ components.splice(index - 1, 2);
+ index -= 2;
+ }
+ else if(index != 0 && !components[index].length || components[index] == '.' || components[index] == "..")
+ components.splice(index--, 1);
+ return components.join('/');
+}
+if (window.ActiveXObject) {
+objj_standardize_xml = function(aRequest)
+
+{
+ var XMLData = new ActiveXObject("Microsoft.XMLDOM");
+ XMLData.loadXML(aRequest.responseText.substr(aRequest.responseText.indexOf(".dtd\">") + 6));
+ return XMLData;
+}
+} else {
+objj_standardize_xml = function(aRequest)
+{
+ return aRequest.responseXML;
+}
+}
+function objj_response_xmlhttp()
+{
+ return new Object;
+}
+if (window.XMLHttpRequest) {
+objj_request_xmlhttp = function()
+{
+ return new XMLHttpRequest();
+}
+} else if (window.ActiveXObject) {
+var MSXML_XMLHTTP_OBJECTS = [ "Microsoft.XMLHTTP", "Msxml2.XMLHTTP", "Msxml2.XMLHTTP.3.0", "Msxml2.XMLHTTP.6.0" ],
+ index = MSXML_XMLHTTP_OBJECTS.length;
+while (index--)
+{
+ try
+ {
+ new ActiveXObject(MSXML_XMLHTTP_OBJECTS[index]);
+ break;
+ }
+ catch (anException)
+ {
+ }
+}
+var MSXML_XMLHTTP = MSXML_XMLHTTP_OBJECTS[index];
+delete index;
+delete MSXML_XMLHTTP_OBJECTS;
+objj_request_xmlhttp = function()
+{
+ return new ActiveXObject(MSXML_XMLHTTP);
+}
+}
+var OBJJ_EXCEPTION_OUTPUT_STREAM = NULL;
+function objj_exception(aName, aReason, aUserInfo)
+{
+ this.name = aName;
+ this.reason = aReason;
+ this.userInfo = aUserInfo;
+ this.__address = (OBJECT_COUNT++);
+}
+objj_exception.prototype.toString = function()
+{
+ return this.reason;
+}
+function objj_exception_throw(anException)
+{
+ throw anException;
+}
+function objj_exception_report(anException, aSourceFile)
+{
+ objj_fprintf(OBJJ_EXCEPTION_OUTPUT_STREAM, aSourceFile.path + "\n" + anException);
+ throw anException;
+}
+function objj_exception_setOutputStream(aStream)
+{
+ OBJJ_EXCEPTION_OUTPUT_STREAM = aStream;
+}
+objj_exception_setOutputStream(function(aString) { });
+OBJJParseException = "OBJJParseException";
+OBJJClassNotFoundException = "OBJJClassNotFoundException";
+var TOKEN_NEW = "new",
+ TOKEN_SUPER = "super",
+ TOKEN_CLASS = "class",
+ TOKEN_IMPORT = "import",
+ TOKEN_FUNCTION = "function",
+ TOKEN_SELECTOR = "selector",
+ TOKEN_IMPLEMENTATION = "implementation",
+ TOKEN_PLUS = '+',
+ TOKEN_MINUS = '-',
+ TOKEN_COLON = ':',
+ TOKEN_COMMA = ',',
+ TOKEN_PERIOD = '.',
+ TOKEN_ASTERISK = '*',
+ TOKEN_SEMICOLON = ';',
+ TOKEN_LESS_THAN = '<',
+ TOKEN_OPEN_BRACE = '{',
+ TOKEN_CLOSE_BRACE = '}',
+ TOKEN_GREATER_THAN = '>',
+ TOKEN_OPEN_BRACKET = '[',
+ TOKEN_DOUBLE_QUOTE = '"',
+ TOKEN_PREPROCESSOR = '@',
+ TOKEN_CLOSE_BRACKET = ']',
+ TOKEN_QUESTION_MARK = '?',
+ TOKEN_OPEN_PARENTHESIS = '(',
+ TOKEN_CLOSE_PARENTHESIS = ')';
+var SUPER_CLASSES = new objj_dictionary(),
+ CURRENT_SUPER_CLASS = NULL,
+ CURRENT_CLASS_NAME = NULL;
+var OBJJ_CURRENT_BUNDLE = NULL;
+var objj_lexer = function(aString, aSourceFile)
+{
+ this._index = 0;
+ this._tokens = (aString + '\n').match(/\/\/.*(\r|\n)?|\/\*(?:.|\n|\r)*?\*\/|\w+\b|[+-]?\d+(([.]\d+)*([eE][+-]?\d+))?|"[^"\\]*(\\.[^"\\]*)*"|'[^'\\]*(\\.[^'\\]*)*'|\s+|./g);
+ this.file = aSourceFile;
+ return this;
+}
+objj_lexer.prototype.next = function()
+{
+ return this._tokens[this._index++];
+}
+objj_lexer.prototype.previous = function()
+{
+ return this._tokens[--this._index];
+}
+objj_lexer.prototype.last = function()
+{
+ if (this._index > 1)
+ return this._tokens[this._index - 2];
+ return NULL;
+}
+objj_lexer.prototype.skip_whitespace= function()
+{
+ var token;
+ while((token = this.next()) && (!(/\S/).test(token) || token.substr(0,2) == "//" || token.substr(0,2) == "/*")) ;
+ return token;
+}
+var objj_preprocess_method = function(tokens, count, array_name)
+{
+ var token,
+ selector = "",
+ parameters = new Array();
+ while((token = tokens.skip_whitespace()) && token != TOKEN_OPEN_BRACE)
+ {
+ if (token == TOKEN_COLON)
+ {
+ selector += token;
+ token = tokens.skip_whitespace();
+ if (token == TOKEN_OPEN_PARENTHESIS)
+ {
+ while((token = tokens.skip_whitespace()) && token != TOKEN_CLOSE_PARENTHESIS) ;
+ token = tokens.skip_whitespace();
+ }
+ parameters[parameters.length] = token;
+ }
+ else if (token == TOKEN_OPEN_PARENTHESIS)
+ while((token = tokens.skip_whitespace()) && token != TOKEN_CLOSE_PARENTHESIS) ;
+ else if (token == TOKEN_COMMA)
+ {
+ if ((token = tokens.skip_whitespace()) != TOKEN_PERIOD || tokens.next() != TOKEN_PERIOD || tokens.next() != TOKEN_PERIOD)
+ objj_exception_throw(new objj_exception(OBJJParseException, "*** Argument list expected after ','."));
+ }
+ else
+ selector += token;
+ }
+ var i= 0,
+ length = parameters.length,
+ selectorDisplayName = "$"+CURRENT_CLASS_NAME+"__"+selector.replace(/:/g, "_"),
+ preprocessed = array_name + "["+count+"] = new objj_method(sel_registerName(\""+selector+"\"), function "+selectorDisplayName+"(self, _cmd";
+ for(; i < length; ++i)
+ preprocessed += ", " + parameters[i];
+ return preprocessed + ")\n{ with(self)\n{" + objj_preprocess_tokens(tokens, TOKEN_CLOSE_BRACE, TOKEN_OPEN_BRACE) + "}\n});\n";
+}
+var objj_preprocess_implementation= function(tokens)
+{
+ var token = "",
+ category = NO,
+ preprocessed = "",
+ class_name = tokens.skip_whitespace(),
+ superclass_name = "Nil",
+ class_method_count = 0,
+ instance_method_count = 0;
+ if (!(/^\w/).test(class_name))
+ objj_exception_throw(new objj_exception(OBJJParseException, "*** Expected class name, found \"" + class_name + "\"."));
+ CURRENT_SUPER_CLASS = NULL;
+ CURRENT_CLASS_NAME = class_name;
+ if((token = tokens.skip_whitespace()) == TOKEN_OPEN_PARENTHESIS)
+ {
+ token = tokens.skip_whitespace();
+ if(tokens.skip_whitespace() != TOKEN_CLOSE_PARENTHESIS)
+ objj_exception_throw(new objj_exception(OBJJParseException, "*** Improper Category Definition for class \""+class_name+"\"."));
+ preprocessed += "{\nvar the_class = objj_getClass(\"" + class_name + "\")\n";
+ preprocessed += "if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, \"*** Could not find definition for class \\\"" + class_name + "\\\"\"));\n";
+ preprocessed += "var meta_class = the_class.isa;";
+ var superclass_name = ((SUPER_CLASSES)._buckets[class_name]);
+ if (!superclass_name)
+ CURRENT_SUPER_CLASS = "objj_getClass(\"" + class_name + "\").super_class";
+ else
+ CURRENT_SUPER_CLASS = "objj_getClass(\"" + superclass_name + "\")";
+ }
+ else
+ {
+ if(token == TOKEN_COLON)
+ {
+ token = tokens.skip_whitespace();
+ if (!(/^\w/).test(token))
+ objj_exception_throw(new objj_exception(OBJJParseException, "*** Expected class name, found \"" + token + "\"."));
+ superclass_name = token;
+ CURRENT_SUPER_CLASS = "objj_getClass(\"" + superclass_name + "\")";
+ { if ((SUPER_CLASSES)._buckets[class_name] == NULL) { (SUPER_CLASSES)._keys.push(class_name); ++(SUPER_CLASSES).count; } if (((SUPER_CLASSES)._buckets[class_name] = superclass_name) == NULL) --(SUPER_CLASSES).count;};
+ token = tokens.skip_whitespace();
+ }
+ preprocessed += "{var the_class = objj_allocateClassPair(" + superclass_name + ", \"" + class_name + "\"),\nmeta_class = the_class.isa;";
+ if (token == TOKEN_OPEN_BRACE)
+ {
+ var ivar = true,
+ ivar_count = 0;
+ while((token = tokens.skip_whitespace()) && token != TOKEN_CLOSE_BRACE)
+ {
+ if (token != TOKEN_SEMICOLON && (ivar = !ivar))
+ {
+ if (ivar_count++ == 0)
+ preprocessed += "class_addIvars(the_class, [";
+ else
+ preprocessed += ", ";
+ preprocessed += "new objj_ivar(\"" + token + "\")";
+ }
+ }
+ if (ivar_count)
+ preprocessed += "]);\n";
+ if (!token)
+ objj_exception_throw(new objj_exception(OBJJParseException, "*** Expected '}'"));
+ }
+ else tokens.previous();
+ preprocessed += "objj_registerClassPair(the_class);\n";
+ preprocessed += "objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));\n";
+ }
+ while((token = tokens.skip_whitespace()))
+ {
+ if(token == TOKEN_PLUS) preprocessed += (class_method_count ? "" : "var class_methods = [];\n") + objj_preprocess_method(tokens, class_method_count++, "class_methods");
+ else if(token == TOKEN_MINUS) preprocessed += (instance_method_count ? "" : "var instance_methods = [];\n") + objj_preprocess_method(tokens, instance_method_count++, "instance_methods");
+ else if(token == TOKEN_PREPROCESSOR)
+ {
+ if((token = tokens.next()) == "end")
+ break;
+ else
+ objj_exception_throw(new objj_exception(OBJJParseException, "*** Expected \"@end\", found \"@" + token + "\"."));
+ }
+ }
+ if (instance_method_count) preprocessed += "class_addMethods(the_class, instance_methods);\n";
+ if (class_method_count) preprocessed += "class_addMethods(meta_class, class_methods);\n";
+ return preprocessed + '}';
+}
+var objj_preprocess_directive = function(tokens)
+{
+ token = tokens.next();
+ if(token.charAt(0) == TOKEN_DOUBLE_QUOTE) return token;
+ else if(token == TOKEN_CLASS) { tokens.skip_whitespace(); return ""; }
+ else if(token == TOKEN_IMPLEMENTATION) return objj_preprocess_implementation(tokens);
+ else if(token == TOKEN_SELECTOR)
+ {
+ if (tokens.skip_whitespace() != TOKEN_OPEN_PARENTHESIS)
+ objj_exception_throw(new objj_exception(OBJJParseException, "*** Expected ')'"));
+ return "sel_registerName(\"" + objj_preprocess_tokens(tokens, TOKEN_CLOSE_PARENTHESIS) +"\")";
+ }
+ return "";
+}
+var objj_preprocess_brackets = function(tokens)
+{
+ var literal = '[',
+ receiver = "",
+ selector = "",
+ marg_list = new Array(),
+ preprocessed = "objj_msgSend";
+ var token = "",
+ array = false,
+ previous = "",
+ braces = 0,
+ tertiary = 0,
+ parenthesis = 0;
+ while((token = tokens.skip_whitespace()) && token != TOKEN_CLOSE_BRACKET)
+ {
+ var preprocess = !braces && !tertiary && !parenthesis && !array;
+ if (token == TOKEN_SUPER)
+ {
+ if (!receiver.length)
+ {
+ preprocessed = "objj_msgSendSuper";
+ token = "{ receiver:self, super_class:" + CURRENT_SUPER_CLASS + " }";
+ }
+ else
+ objj_exception_throw(new objj_exception(OBJJParseException, "*** Can't use 'super' in this context."));
+ }
+ else if (token == TOKEN_OPEN_BRACE) ++braces;
+ else if (token == TOKEN_CLOSE_BRACE) --braces;
+ else if(token == TOKEN_QUESTION_MARK) ++tertiary;
+ else if(token == TOKEN_OPEN_PARENTHESIS) ++parenthesis;
+ else if(token == TOKEN_CLOSE_PARENTHESIS) --parenthesis;
+ else if(token == TOKEN_OPEN_BRACKET) token = objj_preprocess_brackets(tokens);
+ else if(token == TOKEN_PREPROCESSOR) token = objj_preprocess_directive(tokens);
+ if(preprocess)
+ {
+ if(token == TOKEN_COMMA && !selector.length)
+ array = true;
+ if(token == TOKEN_COLON)
+ {
+ var last = tokens.last();
+ if (last && (!(/\S/).test(last) || last.substr(0, 2) == "//" || last.substr(0, 2) == "/*"))
+ {
+ selector += ':';
+ marg_list[marg_list.length - 1] += previous;
+ marg_list[marg_list.length] = previous = "";
+ }
+ else
+ {
+ selector += previous + ":";
+ marg_list[marg_list.length] = previous = "";
+ }
+ }
+ else
+ {
+ if (previous == TOKEN_NEW)
+ previous = "new ";
+ if (selector.length)
+ marg_list[marg_list.length - 1] += previous;
+ else
+ receiver += previous;
+ previous = token;
+ }
+ }
+ else
+ {
+ if(token == TOKEN_COLON && !braces)
+ --tertiary;
+ previous += token;
+ }
+ if (token == TOKEN_NEW)
+ literal += "new ";
+ else
+ literal += token;
+ }
+ if (selector.length) marg_list[marg_list.length - 1] += previous;
+ else if(!array && receiver.length && !((/[\:\+\-\*\/\=\<\>\&\|\!\.\%]/).test(receiver.charAt(receiver.length - 1))) &&
+ receiver != TOKEN_NEW && !(/[\+\-\*\/\=\<\>\&\|\!\.\[\^\(]/).test(previous.charAt(0)))
+ selector = previous;
+ else return literal + ']';
+ preprocessed += '(' + receiver + ", \"" + sel_registerName(selector) + "\"";
+ var i = 0,
+ length = marg_list.length;
+ for(; i < length; ++i)
+ preprocessed += ", " + marg_list[i];
+ return preprocessed + ')';
+}
+function objj_preprocess_tokens(tokens, terminator, instigator, segment)
+{
+ var count = 0,
+ token = "",
+ fragments = [],
+ preprocessed = "";
+ while((token = tokens.next()) && ((token != terminator) || count))
+ {
+ if (instigator)
+ {
+ if (token == instigator) ++count;
+ else if (token == terminator) --count;
+ }
+ if(token == TOKEN_IMPORT)
+ {
+ if ((/[^\s]/).test(preprocessed))
+ fragments.push(fragment_create_code(preprocessed, OBJJ_CURRENT_BUNDLE, tokens.file));
+ preprocessed = "";
+ var path = "",
+ token = tokens.skip_whitespace(),
+ isLocal = token != TOKEN_LESS_THAN;
+ if(token == TOKEN_LESS_THAN)
+ {
+ while((token= tokens.next()) && token != TOKEN_GREATER_THAN) path+= token;
+ if(!token) objj_throw("Parser Error - Unterminated import statement.");
+ }
+ else if(token.charAt(0) == TOKEN_DOUBLE_QUOTE) path= token.substr(1, token.length-2);
+ else
+ objj_exception_throw(new objj_exception(OBJJParseException, "*** Expecting '<' or '\"', found \"" + token + "\"."));
+ fragments.push(fragment_create_file(path, NULL, isLocal, tokens.file));
+ }
+ else if(token == TOKEN_FUNCTION)
+ {
+ var accumulator= "";
+ while((token = tokens.next()) && token != TOKEN_OPEN_PARENTHESIS && !(/^\w/).test(token))
+ accumulator += token;
+ if(token == TOKEN_OPEN_PARENTHESIS)
+ preprocessed+= "function"+accumulator+'(';
+ else
+ {
+ preprocessed += token + "= function";
+ }
+ }
+ else if(token == TOKEN_PREPROCESSOR)
+ preprocessed+= objj_preprocess_directive(tokens);
+ else if(token == TOKEN_OPEN_BRACKET)
+ preprocessed += objj_preprocess_brackets(tokens);
+ else
+ preprocessed += token;
+ }
+ if (preprocessed.length && (/[^\s]/).test(preprocessed))
+ fragments.push(fragment_create_code(preprocessed, OBJJ_CURRENT_BUNDLE, tokens.file));
+ if (!segment)
+ return fragments.length ? fragments[0].info : "";
+ return fragments;
+}
+function objj_preprocess(aString, aBundle, aSourceFile)
+{
+ try
+ {
+ OBJJ_CURRENT_BUNDLE = aBundle;
+ return objj_preprocess_tokens(new objj_lexer(aString, aSourceFile), nil, nil, YES);
+ }
+ catch (anException)
+ {
+ objj_exception_report(anException, aSourceFile);
+ }
+ return [];
+}
+var objj_included_files = { };
+var FRAGMENT_CODE = 1,
+ FRAGMENT_FILE = 1 << 2,
+ FRAGMENT_LOCAL = 1 << 3;
+function objj_fragment()
+{
+ this.info = NULL;
+ this.type = 0;
+ this.context = NULL;
+ this.bundle = NULL;
+ this.file = NULL;
+}
+function objj_context()
+{
+ this.fragments = [];
+ this.scheduled = NO;
+ this.blocked = NO;
+}
+function fragment_create_code(aCode, aBundle, aFile)
+{
+ var fragment = new objj_fragment();
+ fragment.type = (FRAGMENT_CODE);
+ fragment.info = (aCode);
+ fragment.bundle = aBundle;
+ fragment.file = aFile;
+ return fragment;
+}
+function fragment_create_file(aPath, aBundle, isLocal, aFile)
+{
+ var fragment = new objj_fragment();
+ fragment.type = (FRAGMENT_FILE | (FRAGMENT_LOCAL * isLocal));
+ fragment.info = aPath;
+ fragment.bundle = aBundle;
+ fragment.file = aFile;
+ return fragment;
+}
+objj_context.prototype.evaluate = function()
+{
+ this.scheduled = NO;
+ if (this.blocked)
+ return this.schedule();
+ var sleep = NO,
+ start = new Date(),
+ fragments = this.fragments;
+ while (!sleep && fragments.length)
+ {
+ var fragment = fragments.pop();
+ if ((fragment.type & FRAGMENT_FILE))
+ sleep = fragment_evaluate_file(fragment);
+ else
+ sleep = fragment_evaluate_code(fragment);
+ sleep = sleep || ((new Date() - start) > 3000);
+ }
+ if (sleep)
+ this.schedule();
+ else if (this.didCompleteCallback)
+ this.didCompleteCallback(this);
+}
+objj_context.prototype.schedule = function()
+{
+ if (this.scheduled)
+ return;
+ this.scheduled = YES;
+ var context = this;
+ window.setTimeout(function () { context.evaluate(); }, 0);
+}
+objj_context.prototype.pushFragment = function(aFragment)
+{
+ aFragment.context = this;
+ this.fragments.push(aFragment);
+}
+function fragment_evaluate_code(aFragment)
+{
+ var compiled;
+ OBJJ_CURRENT_BUNDLE = aFragment.bundle;
+ try
+ {
+ compiled = new Function(aFragment.info);
+ }
+ catch(anException)
+ {
+ objj_exception_report(anException, aFragment.file);
+ }
+ try
+ {
+ compiled();
+ }
+ catch(anException)
+ {
+ objj_exception_report(anException, aFragment.file);
+ }
+ return NO;
+}
+function fragment_evaluate_file(aFragment)
+{
+ var context = aFragment.context,
+ requiresSleep = YES;
+ context.blocked = YES;
+ objj_request_file(aFragment.info, (aFragment.type & FRAGMENT_LOCAL), function(aFile)
+ {
+ requiresSleep = NO;
+ context.blocked = NO;
+ if (aFile == OBJJ_NO_FILE)
+ objj_alert("uh oh!");
+ if (objj_included_files[aFile.path])
+ return;
+ objj_included_files[aFile.path] = YES;
+ if (!aFile.fragments)
+ aFile.fragments = objj_preprocess(aFile.contents, aFile.bundle, aFile);
+ var fragments = aFile.fragments,
+ count = fragments.length,
+ directory = aFile.path.substr(0, aFile.path.lastIndexOf('/') + 1);
+ while (count--)
+ {
+ var fragment = fragments[count];
+ if ((fragment.type & FRAGMENT_FILE))
+ {
+ if ((fragment.type & FRAGMENT_LOCAL))
+ fragment.info = directory + fragment.info;
+ objj_request_file(fragment.info, (fragment.type & FRAGMENT_LOCAL), NULL);
+ }
+ context.pushFragment(fragment);
+ }
+ });
+ return requiresSleep;
+}
+function objj_import(aPath, isLocal, didCompleteCallback)
+{
+ var context = new objj_context();
+ context.didCompleteCallback = didCompleteCallback;
+ context.pushFragment(fragment_create_file(aPath, new objj_bundle(""), isLocal, NULL));
+ context.evaluate();
+}
+OBJJUnrecognizedFormatException = "OBJJUnrecognizedFormatException";
+var STATIC_MAGIC_NUMBER = "@STATIC",
+ MARKER_PATH = "p",
+ MARKER_CODE = "c",
+ MARKER_IMPORT_STD = 'I',
+ MARKER_IMPORT_LOCAL = 'i';
+var STATIC_EXTENSION = "sj";
+function objj_preprocess_file(aFilePath, fileContents)
+{
+ var fragments = objj_preprocess(fileContents, { path:"/x" }, { path:aFilePath}),
+ index = 0,
+ count = fragments.length,
+ preprocessed = MARKER_PATH + ';' + aFilePath.length() + ';' + aFilePath;
+ for (; index < count; ++index)
+ {
+ var fragment = fragments[index];
+ if ((fragment.type & FRAGMENT_FILE))
+ preprocessed += ((fragment.type & FRAGMENT_LOCAL) ? MARKER_IMPORT_LOCAL : MARKER_IMPORT_STD) + ';' + fragment.info.length + ';' + fragment.info;
+ else
+ preprocessed += MARKER_CODE + ';' + fragment.info.length + ';' + fragment.info;
+ }
+ return preprocessed;
+}
+function objj_decompile(aString, bundle)
+{
+ var stream = new objj_markedStream(aString);
+ if (stream.magicNumber() != STATIC_MAGIC_NUMBER)
+ objj_exception_throw(new objj_exception(OBJJUnrecognizedFormatException, "*** Could not recognize executable code format."));
+ if (stream.version() != 1.0)
+ objj_exception_throw(new objj_exception(OBJJUnrecognizedFormatException, "*** Could not recognize executable code format."));
+ var file = NULL,
+ files = [];
+ while (marker = stream.getMarker())
+ {
+ var text = stream.getString();
+ switch (marker)
+ {
+ case MARKER_PATH: file = new objj_file();
+ file.path = (bundle.path).substr(0, (bundle.path).lastIndexOf('/') + 1) + text;
+ file.bundle = bundle;
+ file.fragments = [];
+ files.push(file);
+ break;
+ case MARKER_CODE: file.fragments.push(fragment_create_code(text, bundle, file));
+ break;
+ case MARKER_IMPORT_STD: file.fragments.push(fragment_create_file(text, bundle, NO, file));
+ break;
+ case MARKER_IMPORT_LOCAL: file.fragments.push(fragment_create_file(text, bundle, YES, file));
+ break;
+ }
+ }
+ return files;
+}
+function objj_msgSend_Backtrace( aReceiver, aSelector)
+{
+ if (aReceiver == nil)
+ return nil;
+ objj_debug_backtrace.push("[" + (((aReceiver.info & (CLS_META))) ? aReceiver : aReceiver.isa).name + " " + aSelector + "]");
+ try
+ {
+ var result = class_getMethodImplementation(aReceiver.isa, aSelector).apply(aReceiver, arguments);
+ }
+ catch (anException)
+ {
+ CPLog.error("Exception " + anException + " in [" + (((aReceiver.info & (CLS_META))) ? aReceiver : aReceiver.isa).name + " " + aSelector + "]");
+ objj_debug_print_backtrace();
+ }
+ objj_debug_backtrace.pop();
+ return result;
+}
+function objj_msgSendSuper_Backtrace( aSuper, aSelector)
+{
+ objj_debug_backtrace.push("[" + (((aSuper.receiver.info & (CLS_META))) ? aSuper.receiver : aSuper.receiver.isa).name + " " + aSelector + "]");
+ var super_class = aSuper.super_class;
+ arguments[0] = aSuper.receiver;
+ try
+ {
+ var result = class_getMethodImplementation(super_class, aSelector).apply(aSuper.receiver, arguments);
+ }
+ catch (anException)
+ {
+ CPLog.error("Exception " + anException + " in [" + (((aSuper.receiver.info & (CLS_META))) ? aSuper.receiver : aSuper.receiver.isa).name + " " + aSelector + "]");
+ objj_debug_print_backtrace();
+ }
+ objj_debug_backtrace.pop();
+ return result;
+}
+function objj_msgSend_Profile( aReceiver, aSelector)
+{
+ if (aReceiver == nil)
+ return nil;
+ var profileRecord = {
+ parent : objj_debug_profile,
+ receiver : (((aReceiver.info & (CLS_META))) ? aReceiver : aReceiver.isa).name,
+ selector : aSelector,
+ calls : []
+ }
+ objj_debug_profile.calls.push(profileRecord);
+ objj_debug_profile = profileRecord;
+ profileRecord.start = new Date();
+ var result = class_getMethodImplementation(aReceiver.isa, aSelector).apply(aReceiver, arguments);
+ profileRecord.end = new Date();
+ objj_debug_profile = profileRecord.parent;
+ return result;
+}
+function objj_msgSendSuper_Profile( aSuper, aSelector)
+{
+ var profileRecord = {
+ parent : objj_debug_profile,
+ receiver : (((aReceiver.info & (CLS_META))) ? aReceiver : aReceiver.isa).name,
+ selector : aSelector,
+ calls : []
+ }
+ objj_debug_profile.calls.push(profileRecord);
+ objj_debug_profile = profileRecord;
+ profileRecord.start = new Date();
+ var super_class = aSuper.super_class;
+ arguments[0] = aSuper.receiver;
+ var result = class_getMethodImplementation(super_class, aSelector).apply(aSuper.receiver, arguments);
+ profileRecord.end = new Date();
+ objj_debug_profile = profileRecord.parent;
+ return result;
+}
+var objj_msgSend_Standard = objj_msgSend,
+ objj_msgSendSuper_Standard = objj_msgSendSuper;
+var objj_debug_backtrace;
+function objj_backtrace_set_enable(enabled)
+{
+ if (enabled)
+ {
+ objj_debug_backtrace = [];
+ objj_msgSend = objj_msgSend_Backtrace;
+ objj_msgSendSuper = objj_msgSendSuper_Backtrace;
+ }
+ else
+ {
+ objj_msgSend = objj_msgSend_Standard;
+ objj_msgSendSuper = objj_msgSendSuper_Standard;
+ }
+}
+function objj_debug_print_backtrace()
+{
+ CPLog.trace(objj_debug_backtrace_string());
+}
+function objj_debug_backtrace_string()
+{
+ return objj_debug_backtrace.join("\n");
+}
+var objj_debug_profile = null,
+ objj_currently_profiling = false,
+ objj_profile_cleanup;
+function objj_profile(title)
+{
+ if (objj_currently_profiling)
+ return;
+ var objj_msgSend_profile_saved = objj_msgSend,
+ objj_msgSendSuper_profile_saved = objj_msgSendSuper;
+ objj_msgSend = objj_msgSend_Profile;
+ objj_msgSendSuper = objj_msgSendSuper_Profile;
+ var root = { calls: [] };
+ objj_debug_profile = root;
+ var context = {
+ start : new Date(),
+ title : title,
+ profile : root
+ };
+ objj_profile_cleanup = function() {
+ objj_msgSend = objj_msgSend_profile_saved;
+ objj_msgSendSuper = objj_msgSendSuper_profile_saved;
+ context.end = new Date();
+ return context;
+ }
+ objj_currently_profiling = true;
+}
+function objj_profileEnd()
+{
+ if (!objj_currently_profiling)
+ return;
+ objj_debug_profile = null;
+ objj_currently_profiling = false;
+ return objj_profile_cleanup();
+}
+
+
+
+ objj_import("main.j", YES, function() { main(); });
+
+ window.files_total = 2276858;
+ window.iconHeight = 256;
+
+ window.update_progress = function(percent)
+ {
+ var value = MAX(MIN(percent-0.05, 1), 0),
+ progress = document.getElementById("progress"),
+ progressValue = document.getElementById("progressValue");
+
+ if (progress)
+ {
+ progress.style.height = FLOOR(value * window.iconHeight) + "px";
+ progress.style.top = -1 * FLOOR(value * window.iconHeight) + "px";
+ }
+
+ if (progressValue)
+ progressValue.innerHTML = "Loading: "+ROUND((value+0.05)*100)+"%";
+ }
+</script>
+
+
+<script id="ball-pool" type="x">
+/* Based on Alex Arnell's inheritance implementation. */
+var Class = {
+ create: function() {
+ var parent = null, properties = $A(arguments);
+ if (Object.isFunction(properties[0]))
+ parent = properties.shift();
+
+ function klass() {
+ this.initialize.apply(this, arguments);
+ }
+
+ Object.extend(klass, Class.Methods);
+ klass.superclass = parent;
+ klass.subclasses = [];
+
+ if (parent) {
+ var subclass = function() { };
+ subclass.prototype = parent.prototype;
+ klass.prototype = new subclass;
+ parent.subclasses.push(klass);
+ }
+
+ for (var i = 0; i < properties.length; i++)
+ klass.addMethods(properties[i]);
+
+ if (!klass.prototype.initialize)
+ klass.prototype.initialize = this.emptyFunction;
+
+ klass.prototype.constructor = klass;
+
+ return klass;
+ },
+ emptyFunction:function () {},
+
+};
+
+Class.Methods = {
+ addMethods: function(source) {
+ var ancestor = this.superclass && this.superclass.prototype;
+ var properties = Object.keys(source);
+
+ if (!Object.keys({ toString: true }).length)
+ properties.push("toString", "valueOf");
+
+ for (var i = 0, length = properties.length; i < length; i++) {
+ var property = properties[i], value = source[property];
+ if (ancestor && Object.isFunction(value) &&
+ value.argumentNames().first() == "$super") {
+ var method = value, value = Object.extend((function(m) {
+ return function() { return ancestor[m].apply(this, arguments) };
+ })(property).wrap(method), {
+ valueOf: function() { return method },
+ toString: function() { return method.toString() }
+ });
+ }
+ this.prototype[property] = value;
+ }
+
+ return this;
+ }
+};
+
+Object.extend = function(destination, source) {
+ for (var property in source)
+ destination[property] = source[property];
+ return destination;
+};
+
+Object.extend(Object, {
+ inspect: function(object) {
+ try {
+ if (Object.isUndefined(object)) return 'undefined';
+ if (object === null) return 'null';
+ return object.inspect ? object.inspect() : String(object);
+ } catch (e) {
+ if (e instanceof RangeError) return '...';
+ throw e;
+ }
+ },
+
+ toJSON: function(object) {
+ var type = typeof object;
+ switch (type) {
+ case 'undefined':
+ case 'function':
+ case 'unknown': return;
+ case 'boolean': return object.toString();
+ }
+
+ if (object === null) return 'null';
+ if (object.toJSON) return object.toJSON();
+ if (Object.isElement(object)) return;
+
+ var results = [];
+ for (var property in object) {
+ var value = Object.toJSON(object[property]);
+ if (!Object.isUndefined(value))
+ results.push(property.toJSON() + ': ' + value);
+ }
+
+ return '{' + results.join(', ') + '}';
+ },
+
+ toQueryString: function(object) {
+ return $H(object).toQueryString();
+ },
+
+ toHTML: function(object) {
+ return object && object.toHTML ? object.toHTML() : String.interpret(object);
+ },
+
+ keys: function(object) {
+ var keys = [];
+ for (var property in object)
+ keys.push(property);
+ return keys;
+ },
+
+ values: function(object) {
+ var values = [];
+ for (var property in object)
+ values.push(object[property]);
+ return values;
+ },
+
+ clone: function(object) {
+ return Object.extend({ }, object);
+ },
+
+ isElement: function(object) {
+ return object && object.nodeType == 1;
+ },
+
+ isArray: function(object) {
+ return object != null && typeof object == "object" &&
+ 'splice' in object && 'join' in object;
+ },
+
+ isHash: function(object) {
+ return object instanceof Hash;
+ },
+
+ isFunction: function(object) {
+ return typeof object == "function";
+ },
+
+ isString: function(object) {
+ return typeof object == "string";
+ },
+
+ isNumber: function(object) {
+ return typeof object == "number";
+ },
+
+ isUndefined: function(object) {
+ return typeof object == "undefined";
+ }
+});
+
+function $A(iterable) {
+ if (!iterable) return [];
+ if (iterable.toArray) return iterable.toArray();
+ var length = iterable.length || 0, results = new Array(length);
+ while (length--) results[length] = iterable[length];
+ return results;
+}
+
+if (WebKit = navigator.userAgent.indexOf('AppleWebKit/') > -1) {
+ $A = function(iterable) {
+ if (!iterable) return [];
+ if (!(Object.isFunction(iterable) && iterable == '[object NodeList]') &&
+ iterable.toArray) return iterable.toArray();
+ var length = iterable.length || 0, results = new Array(length);
+ while (length--) results[length] = iterable[length];
+ return results;
+ };
+}
+
+
+
+/*
+ * Box2Djs (port of Box2DFlash 1.4.3.1) - http://box2d-js.sourceforge.net/
+ * Single-filed and jsmined ( http://code.google.com/p/jsmin-php/ ) by Mr.doob
+ */
+
+var b2Settings=Class.create();b2Settings.prototype={initialize:function(){}}
+b2Settings.USHRT_MAX=0x0000ffff;b2Settings.b2_pi=Math.PI;b2Settings.b2_massUnitsPerKilogram=1.0;b2Settings.b2_timeUnitsPerSecond=1.0;b2Settings.b2_lengthUnitsPerMeter=30.0;b2Settings.b2_maxManifoldPoints=2;b2Settings.b2_maxShapesPerBody=64;b2Settings.b2_maxPolyVertices=8;b2Settings.b2_maxProxies=1024;b2Settings.b2_maxPairs=8*b2Settings.b2_maxProxies;b2Settings.b2_linearSlop=0.005*b2Settings.b2_lengthUnitsPerMeter;b2Settings.b2_angularSlop=2.0/180.0*b2Settings.b2_pi;b2Settings.b2_velocityThreshold=1.0*b2Settings.b2_lengthUnitsPerMeter/b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_maxLinearCorrection=0.2*b2Settings.b2_lengthUnitsPerMeter;b2Settings.b2_maxAngularCorrection=8.0/180.0*b2Settings.b2_pi;b2Settings.b2_contactBaumgarte=0.2;b2Settings.b2_timeToSleep=0.5*b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_linearSleepTolerance=0.01*b2Settings.b2_lengthUnitsPerMeter/b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_angularSleepTolerance=2.0/180.0/b2Settings.b2_timeUnitsPerSecond;b2Settings.b2Assert=function(a)
+{if(!a){var nullVec;nullVec.x++;}};
+var b2Vec2=Class.create();b2Vec2.prototype={initialize:function(x_,y_){this.x=x_;this.y=y_;},SetZero:function(){this.x=0.0;this.y=0.0;},Set:function(x_,y_){this.x=x_;this.y=y_;},SetV:function(v){this.x=v.x;this.y=v.y;},Negative:function(){return new b2Vec2(-this.x,-this.y);},Copy:function(){return new b2Vec2(this.x,this.y);},Add:function(v)
+{this.x+=v.x;this.y+=v.y;},Subtract:function(v)
+{this.x-=v.x;this.y-=v.y;},Multiply:function(a)
+{this.x*=a;this.y*=a;},MulM:function(A)
+{var tX=this.x;this.x=A.col1.x*tX+A.col2.x*this.y;this.y=A.col1.y*tX+A.col2.y*this.y;},MulTM:function(A)
+{var tX=b2Math.b2Dot(this,A.col1);this.y=b2Math.b2Dot(this,A.col2);this.x=tX;},CrossVF:function(s)
+{var tX=this.x;this.x=s*this.y;this.y=-s*tX;},CrossFV:function(s)
+{var tX=this.x;this.x=-s*this.y;this.y=s*tX;},MinV:function(b)
+{this.x=this.x<b.x?this.x:b.x;this.y=this.y<b.y?this.y:b.y;},MaxV:function(b)
+{this.x=this.x>b.x?this.x:b.x;this.y=this.y>b.y?this.y:b.y;},Abs:function()
+{this.x=Math.abs(this.x);this.y=Math.abs(this.y);},Length:function()
+{return Math.sqrt(this.x*this.x+this.y*this.y);},Normalize:function()
+{var length=this.Length();if(length<Number.MIN_VALUE)
+{return 0.0;}
+var invLength=1.0/length;this.x*=invLength;this.y*=invLength;return length;},IsValid:function()
+{return b2Math.b2IsValid(this.x)&&b2Math.b2IsValid(this.y);},x:null,y:null};b2Vec2.Make=function(x_,y_)
+{return new b2Vec2(x_,y_);};
+var b2Mat22=Class.create();b2Mat22.prototype={initialize:function(angle,c1,c2)
+{if(angle==null)angle=0;this.col1=new b2Vec2();this.col2=new b2Vec2();if(c1!=null&&c2!=null){this.col1.SetV(c1);this.col2.SetV(c2);}
+else{var c=Math.cos(angle);var s=Math.sin(angle);this.col1.x=c;this.col2.x=-s;this.col1.y=s;this.col2.y=c;}},Set:function(angle)
+{var c=Math.cos(angle);var s=Math.sin(angle);this.col1.x=c;this.col2.x=-s;this.col1.y=s;this.col2.y=c;},SetVV:function(c1,c2)
+{this.col1.SetV(c1);this.col2.SetV(c2);},Copy:function(){return new b2Mat22(0,this.col1,this.col2);},SetM:function(m)
+{this.col1.SetV(m.col1);this.col2.SetV(m.col2);},AddM:function(m)
+{this.col1.x+=m.col1.x;this.col1.y+=m.col1.y;this.col2.x+=m.col2.x;this.col2.y+=m.col2.y;},SetIdentity:function()
+{this.col1.x=1.0;this.col2.x=0.0;this.col1.y=0.0;this.col2.y=1.0;},SetZero:function()
+{this.col1.x=0.0;this.col2.x=0.0;this.col1.y=0.0;this.col2.y=0.0;},Invert:function(out)
+{var a=this.col1.x;var b=this.col2.x;var c=this.col1.y;var d=this.col2.y;var det=a*d-b*c;det=1.0/det;out.col1.x=det*d;out.col2.x=-det*b;out.col1.y=-det*c;out.col2.y=det*a;return out;},Solve:function(out,bX,bY)
+{var a11=this.col1.x;var a12=this.col2.x;var a21=this.col1.y;var a22=this.col2.y;var det=a11*a22-a12*a21;det=1.0/det;out.x=det*(a22*bX-a12*bY);out.y=det*(a11*bY-a21*bX);return out;},Abs:function()
+{this.col1.Abs();this.col2.Abs();},col1:new b2Vec2(),col2:new b2Vec2()};
+var b2Math=Class.create();b2Math.prototype={initialize:function(){}}
+b2Math.b2IsValid=function(x)
+{return isFinite(x);};b2Math.b2Dot=function(a,b)
+{return a.x*b.x+a.y*b.y;};b2Math.b2CrossVV=function(a,b)
+{return a.x*b.y-a.y*b.x;};b2Math.b2CrossVF=function(a,s)
+{var v=new b2Vec2(s*a.y,-s*a.x);return v;};b2Math.b2CrossFV=function(s,a)
+{var v=new b2Vec2(-s*a.y,s*a.x);return v;};b2Math.b2MulMV=function(A,v)
+{var u=new b2Vec2(A.col1.x*v.x+A.col2.x*v.y,A.col1.y*v.x+A.col2.y*v.y);return u;};b2Math.b2MulTMV=function(A,v)
+{var u=new b2Vec2(b2Math.b2Dot(v,A.col1),b2Math.b2Dot(v,A.col2));return u;};b2Math.AddVV=function(a,b)
+{var v=new b2Vec2(a.x+b.x,a.y+b.y);return v;};b2Math.SubtractVV=function(a,b)
+{var v=new b2Vec2(a.x-b.x,a.y-b.y);return v;};b2Math.MulFV=function(s,a)
+{var v=new b2Vec2(s*a.x,s*a.y);return v;};b2Math.AddMM=function(A,B)
+{var C=new b2Mat22(0,b2Math.AddVV(A.col1,B.col1),b2Math.AddVV(A.col2,B.col2));return C;};b2Math.b2MulMM=function(A,B)
+{var C=new b2Mat22(0,b2Math.b2MulMV(A,B.col1),b2Math.b2MulMV(A,B.col2));return C;};b2Math.b2MulTMM=function(A,B)
+{var c1=new b2Vec2(b2Math.b2Dot(A.col1,B.col1),b2Math.b2Dot(A.col2,B.col1));var c2=new b2Vec2(b2Math.b2Dot(A.col1,B.col2),b2Math.b2Dot(A.col2,B.col2));var C=new b2Mat22(0,c1,c2);return C;};b2Math.b2Abs=function(a)
+{return a>0.0?a:-a;};b2Math.b2AbsV=function(a)
+{var b=new b2Vec2(b2Math.b2Abs(a.x),b2Math.b2Abs(a.y));return b;};b2Math.b2AbsM=function(A)
+{var B=new b2Mat22(0,b2Math.b2AbsV(A.col1),b2Math.b2AbsV(A.col2));return B;};b2Math.b2Min=function(a,b)
+{return a<b?a:b;};b2Math.b2MinV=function(a,b)
+{var c=new b2Vec2(b2Math.b2Min(a.x,b.x),b2Math.b2Min(a.y,b.y));return c;};b2Math.b2Max=function(a,b)
+{return a>b?a:b;};b2Math.b2MaxV=function(a,b)
+{var c=new b2Vec2(b2Math.b2Max(a.x,b.x),b2Math.b2Max(a.y,b.y));return c;};b2Math.b2Clamp=function(a,low,high)
+{return b2Math.b2Max(low,b2Math.b2Min(a,high));};b2Math.b2ClampV=function(a,low,high)
+{return b2Math.b2MaxV(low,b2Math.b2MinV(a,high));};b2Math.b2Swap=function(a,b)
+{var tmp=a[0];a[0]=b[0];b[0]=tmp;};b2Math.b2Random=function()
+{return Math.random()*2-1;};b2Math.b2NextPowerOfTwo=function(x)
+{x|=(x>>1)&0x7FFFFFFF;x|=(x>>2)&0x3FFFFFFF;x|=(x>>4)&0x0FFFFFFF;x|=(x>>8)&0x00FFFFFF;x|=(x>>16)&0x0000FFFF;return x+1;};b2Math.b2IsPowerOfTwo=function(x)
+{var result=x>0&&(x&(x-1))==0;return result;};b2Math.tempVec2=new b2Vec2();b2Math.tempVec3=new b2Vec2();b2Math.tempVec4=new b2Vec2();b2Math.tempVec5=new b2Vec2();b2Math.tempMat=new b2Mat22();
+var b2AABB=Class.create();b2AABB.prototype={IsValid:function(){var dX=this.maxVertex.x;var dY=this.maxVertex.y;dX=this.maxVertex.x;dY=this.maxVertex.y;dX-=this.minVertex.x;dY-=this.minVertex.y;var valid=dX>=0.0&&dY>=0.0;valid=valid&&this.minVertex.IsValid()&&this.maxVertex.IsValid();return valid;},minVertex:new b2Vec2(),maxVertex:new b2Vec2(),initialize:function(){this.minVertex=new b2Vec2();this.maxVertex=new b2Vec2();}};
+var b2Bound=Class.create();b2Bound.prototype={IsLower:function(){return(this.value&1)==0;},IsUpper:function(){return(this.value&1)==1;},Swap:function(b){var tempValue=this.value;var tempProxyId=this.proxyId;var tempStabbingCount=this.stabbingCount;this.value=b.value;this.proxyId=b.proxyId;this.stabbingCount=b.stabbingCount;b.value=tempValue;b.proxyId=tempProxyId;b.stabbingCount=tempStabbingCount;},value:0,proxyId:0,stabbingCount:0,initialize:function(){}}
+
+var b2BoundValues=Class.create();b2BoundValues.prototype={lowerValues:[0,0],upperValues:[0,0],initialize:function(){this.lowerValues=[0,0];this.upperValues=[0,0];}}
+
+var b2Pair=Class.create();b2Pair.prototype={SetBuffered:function(){this.status|=b2Pair.e_pairBuffered;},ClearBuffered:function(){this.status&=~b2Pair.e_pairBuffered;},IsBuffered:function(){return(this.status&b2Pair.e_pairBuffered)==b2Pair.e_pairBuffered;},SetRemoved:function(){this.status|=b2Pair.e_pairRemoved;},ClearRemoved:function(){this.status&=~b2Pair.e_pairRemoved;},IsRemoved:function(){return(this.status&b2Pair.e_pairRemoved)==b2Pair.e_pairRemoved;},SetFinal:function(){this.status|=b2Pair.e_pairFinal;},IsFinal:function(){return(this.status&b2Pair.e_pairFinal)==b2Pair.e_pairFinal;},userData:null,proxyId1:0,proxyId2:0,next:0,status:0,initialize:function(){}};b2Pair.b2_nullPair=b2Settings.USHRT_MAX;b2Pair.b2_nullProxy=b2Settings.USHRT_MAX;b2Pair.b2_tableCapacity=b2Settings.b2_maxPairs;b2Pair.b2_tableMask=b2Pair.b2_tableCapacity-1;b2Pair.e_pairBuffered=0x0001;b2Pair.e_pairRemoved=0x0002;b2Pair.e_pairFinal=0x0004;
+var b2PairCallback=Class.create();b2PairCallback.prototype={PairAdded:function(proxyUserData1,proxyUserData2){return null},PairRemoved:function(proxyUserData1,proxyUserData2,pairUserData){},initialize:function(){}};
+var b2BufferedPair=Class.create();b2BufferedPair.prototype={proxyId1:0,proxyId2:0,initialize:function(){}}
+
+var b2PairManager=Class.create();b2PairManager.prototype={initialize:function(){var i=0;this.m_hashTable=new Array(b2Pair.b2_tableCapacity);for(i=0;i<b2Pair.b2_tableCapacity;++i)
+{this.m_hashTable[i]=b2Pair.b2_nullPair;}
+this.m_pairs=new Array(b2Settings.b2_maxPairs);for(i=0;i<b2Settings.b2_maxPairs;++i)
+{this.m_pairs[i]=new b2Pair();}
+this.m_pairBuffer=new Array(b2Settings.b2_maxPairs);for(i=0;i<b2Settings.b2_maxPairs;++i)
+{this.m_pairBuffer[i]=new b2BufferedPair();}
+for(i=0;i<b2Settings.b2_maxPairs;++i)
+{this.m_pairs[i].proxyId1=b2Pair.b2_nullProxy;this.m_pairs[i].proxyId2=b2Pair.b2_nullProxy;this.m_pairs[i].userData=null;this.m_pairs[i].status=0;this.m_pairs[i].next=(i+1);}
+this.m_pairs[b2Settings.b2_maxPairs-1].next=b2Pair.b2_nullPair;this.m_pairCount=0;},Initialize:function(broadPhase,callback){this.m_broadPhase=broadPhase;this.m_callback=callback;},AddBufferedPair:function(proxyId1,proxyId2){var pair=this.AddPair(proxyId1,proxyId2);if(pair.IsBuffered()==false)
+{pair.SetBuffered();this.m_pairBuffer[this.m_pairBufferCount].proxyId1=pair.proxyId1;this.m_pairBuffer[this.m_pairBufferCount].proxyId2=pair.proxyId2;++this.m_pairBufferCount;}
+pair.ClearRemoved();if(b2BroadPhase.s_validate)
+{this.ValidateBuffer();}},RemoveBufferedPair:function(proxyId1,proxyId2){var pair=this.Find(proxyId1,proxyId2);if(pair==null)
+{return;}
+if(pair.IsBuffered()==false)
+{pair.SetBuffered();this.m_pairBuffer[this.m_pairBufferCount].proxyId1=pair.proxyId1;this.m_pairBuffer[this.m_pairBufferCount].proxyId2=pair.proxyId2;++this.m_pairBufferCount;}
+pair.SetRemoved();if(b2BroadPhase.s_validate)
+{this.ValidateBuffer();}},Commit:function(){var i=0;var removeCount=0;var proxies=this.m_broadPhase.m_proxyPool;for(i=0;i<this.m_pairBufferCount;++i)
+{var pair=this.Find(this.m_pairBuffer[i].proxyId1,this.m_pairBuffer[i].proxyId2);pair.ClearBuffered();var proxy1=proxies[pair.proxyId1];var proxy2=proxies[pair.proxyId2];if(pair.IsRemoved())
+{if(pair.IsFinal()==true)
+{this.m_callback.PairRemoved(proxy1.userData,proxy2.userData,pair.userData);}
+this.m_pairBuffer[removeCount].proxyId1=pair.proxyId1;this.m_pairBuffer[removeCount].proxyId2=pair.proxyId2;++removeCount;}
+else
+{if(pair.IsFinal()==false)
+{pair.userData=this.m_callback.PairAdded(proxy1.userData,proxy2.userData);pair.SetFinal();}}}
+for(i=0;i<removeCount;++i)
+{this.RemovePair(this.m_pairBuffer[i].proxyId1,this.m_pairBuffer[i].proxyId2);}
+this.m_pairBufferCount=0;if(b2BroadPhase.s_validate)
+{this.ValidateTable();}},AddPair:function(proxyId1,proxyId2){if(proxyId1>proxyId2){var temp=proxyId1;proxyId1=proxyId2;proxyId2=temp;}
+var hash=b2PairManager.Hash(proxyId1,proxyId2)&b2Pair.b2_tableMask;var pair=pair=this.FindHash(proxyId1,proxyId2,hash);if(pair!=null)
+{return pair;}
+var pIndex=this.m_freePair;pair=this.m_pairs[pIndex];this.m_freePair=pair.next;pair.proxyId1=proxyId1;pair.proxyId2=proxyId2;pair.status=0;pair.userData=null;pair.next=this.m_hashTable[hash];this.m_hashTable[hash]=pIndex;++this.m_pairCount;return pair;},RemovePair:function(proxyId1,proxyId2){if(proxyId1>proxyId2){var temp=proxyId1;proxyId1=proxyId2;proxyId2=temp;}
+var hash=b2PairManager.Hash(proxyId1,proxyId2)&b2Pair.b2_tableMask;var node=this.m_hashTable[hash];var pNode=null;while(node!=b2Pair.b2_nullPair)
+{if(b2PairManager.Equals(this.m_pairs[node],proxyId1,proxyId2))
+{var index=node;if(pNode){pNode.next=this.m_pairs[node].next;}
+else{this.m_hashTable[hash]=this.m_pairs[node].next;}
+var pair=this.m_pairs[index];var userData=pair.userData;pair.next=this.m_freePair;pair.proxyId1=b2Pair.b2_nullProxy;pair.proxyId2=b2Pair.b2_nullProxy;pair.userData=null;pair.status=0;this.m_freePair=index;--this.m_pairCount;return userData;}
+else
+{pNode=this.m_pairs[node];node=pNode.next;}}
+return null;},Find:function(proxyId1,proxyId2){if(proxyId1>proxyId2){var temp=proxyId1;proxyId1=proxyId2;proxyId2=temp;}
+var hash=b2PairManager.Hash(proxyId1,proxyId2)&b2Pair.b2_tableMask;return this.FindHash(proxyId1,proxyId2,hash);},FindHash:function(proxyId1,proxyId2,hash){var index=this.m_hashTable[hash];while(index!=b2Pair.b2_nullPair&&b2PairManager.Equals(this.m_pairs[index],proxyId1,proxyId2)==false)
+{index=this.m_pairs[index].next;}
+if(index==b2Pair.b2_nullPair)
+{return null;}
+return this.m_pairs[index];},ValidateBuffer:function(){},ValidateTable:function(){},m_broadPhase:null,m_callback:null,m_pairs:null,m_freePair:0,m_pairCount:0,m_pairBuffer:null,m_pairBufferCount:0,m_hashTable:null};b2PairManager.Hash=function(proxyId1,proxyId2)
+{var key=((proxyId2<<16)&0xffff0000)|proxyId1;key=~key+((key<<15)&0xFFFF8000);key=key^((key>>12)&0x000fffff);key=key+((key<<2)&0xFFFFFFFC);key=key^((key>>4)&0x0fffffff);key=key*2057;key=key^((key>>16)&0x0000ffff);return key;};b2PairManager.Equals=function(pair,proxyId1,proxyId2)
+{return(pair.proxyId1==proxyId1&&pair.proxyId2==proxyId2);};b2PairManager.EqualsPair=function(pair1,pair2)
+{return pair1.proxyId1==pair2.proxyId1&&pair1.proxyId2==pair2.proxyId2;};
+var b2BroadPhase=Class.create();b2BroadPhase.prototype={initialize:function(worldAABB,callback){this.m_pairManager=new b2PairManager();this.m_proxyPool=new Array(b2Settings.b2_maxPairs);this.m_bounds=new Array(2*b2Settings.b2_maxProxies);this.m_queryResults=new Array(b2Settings.b2_maxProxies);this.m_quantizationFactor=new b2Vec2();var i=0;this.m_pairManager.Initialize(this,callback);this.m_worldAABB=worldAABB;this.m_proxyCount=0;for(i=0;i<b2Settings.b2_maxProxies;i++){this.m_queryResults[i]=0;}
+this.m_bounds=new Array(2);for(i=0;i<2;i++){this.m_bounds[i]=new Array(2*b2Settings.b2_maxProxies);for(var j=0;j<2*b2Settings.b2_maxProxies;j++){this.m_bounds[i][j]=new b2Bound();}}
+var dX=worldAABB.maxVertex.x;var dY=worldAABB.maxVertex.y;dX-=worldAABB.minVertex.x;dY-=worldAABB.minVertex.y;this.m_quantizationFactor.x=b2Settings.USHRT_MAX/dX;this.m_quantizationFactor.y=b2Settings.USHRT_MAX/dY;var tProxy;for(i=0;i<b2Settings.b2_maxProxies-1;++i)
+{tProxy=new b2Proxy();this.m_proxyPool[i]=tProxy;tProxy.SetNext(i+1);tProxy.timeStamp=0;tProxy.overlapCount=b2BroadPhase.b2_invalid;tProxy.userData=null;}
+tProxy=new b2Proxy();this.m_proxyPool[b2Settings.b2_maxProxies-1]=tProxy;tProxy.SetNext(b2Pair.b2_nullProxy);tProxy.timeStamp=0;tProxy.overlapCount=b2BroadPhase.b2_invalid;tProxy.userData=null;this.m_freeProxy=0;this.m_timeStamp=1;this.m_queryResultCount=0;},InRange:function(aabb){var dX;var dY;var d2X;var d2Y;dX=aabb.minVertex.x;dY=aabb.minVertex.y;dX-=this.m_worldAABB.maxVertex.x;dY-=this.m_worldAABB.maxVertex.y;d2X=this.m_worldAABB.minVertex.x;d2Y=this.m_worldAABB.minVertex.y;d2X-=aabb.maxVertex.x;d2Y-=aabb.maxVertex.y;dX=b2Math.b2Max(dX,d2X);dY=b2Math.b2Max(dY,d2Y);return b2Math.b2Max(dX,dY)<0.0;},GetProxy:function(proxyId){if(proxyId==b2Pair.b2_nullProxy||this.m_proxyPool[proxyId].IsValid()==false)
+{return null;}
+return this.m_proxyPool[proxyId];},CreateProxy:function(aabb,userData){var index=0;var proxy;var proxyId=this.m_freeProxy;proxy=this.m_proxyPool[proxyId];this.m_freeProxy=proxy.GetNext();proxy.overlapCount=0;proxy.userData=userData;var boundCount=2*this.m_proxyCount;var lowerValues=new Array();var upperValues=new Array();this.ComputeBounds(lowerValues,upperValues,aabb);for(var axis=0;axis<2;++axis)
+{var bounds=this.m_bounds[axis];var lowerIndex=0;var upperIndex=0;var lowerIndexOut=[lowerIndex];var upperIndexOut=[upperIndex];this.Query(lowerIndexOut,upperIndexOut,lowerValues[axis],upperValues[axis],bounds,boundCount,axis);lowerIndex=lowerIndexOut[0];upperIndex=upperIndexOut[0];var tArr=new Array();var j=0;var tEnd=boundCount-upperIndex
+var tBound1;var tBound2;for(j=0;j<tEnd;j++){tArr[j]=new b2Bound();tBound1=tArr[j];tBound2=bounds[upperIndex+j];tBound1.value=tBound2.value;tBound1.proxyId=tBound2.proxyId;tBound1.stabbingCount=tBound2.stabbingCount;}
+tEnd=tArr.length;var tIndex=upperIndex+2;for(j=0;j<tEnd;j++){tBound2=tArr[j];tBound1=bounds[tIndex+j]
+tBound1.value=tBound2.value;tBound1.proxyId=tBound2.proxyId;tBound1.stabbingCount=tBound2.stabbingCount;}
+tArr=new Array();tEnd=upperIndex-lowerIndex;for(j=0;j<tEnd;j++){tArr[j]=new b2Bound();tBound1=tArr[j];tBound2=bounds[lowerIndex+j];tBound1.value=tBound2.value;tBound1.proxyId=tBound2.proxyId;tBound1.stabbingCount=tBound2.stabbingCount;}
+tEnd=tArr.length;tIndex=lowerIndex+1;for(j=0;j<tEnd;j++){tBound2=tArr[j];tBound1=bounds[tIndex+j]
+tBound1.value=tBound2.value;tBound1.proxyId=tBound2.proxyId;tBound1.stabbingCount=tBound2.stabbingCount;}
+++upperIndex;bounds[lowerIndex].value=lowerValues[axis];bounds[lowerIndex].proxyId=proxyId;bounds[upperIndex].value=upperValues[axis];bounds[upperIndex].proxyId=proxyId;bounds[lowerIndex].stabbingCount=lowerIndex==0?0:bounds[lowerIndex-1].stabbingCount;bounds[upperIndex].stabbingCount=bounds[upperIndex-1].stabbingCount;for(index=lowerIndex;index<upperIndex;++index)
+{bounds[index].stabbingCount++;}
+for(index=lowerIndex;index<boundCount+2;++index)
+{var proxy2=this.m_proxyPool[bounds[index].proxyId];if(bounds[index].IsLower())
+{proxy2.lowerBounds[axis]=index;}
+else
+{proxy2.upperBounds[axis]=index;}}}
+++this.m_proxyCount;for(var i=0;i<this.m_queryResultCount;++i)
+{this.m_pairManager.AddBufferedPair(proxyId,this.m_queryResults[i]);}
+this.m_pairManager.Commit();this.m_queryResultCount=0;this.IncrementTimeStamp();return proxyId;},DestroyProxy:function(proxyId){var proxy=this.m_proxyPool[proxyId];var boundCount=2*this.m_proxyCount;for(var axis=0;axis<2;++axis)
+{var bounds=this.m_bounds[axis];var lowerIndex=proxy.lowerBounds[axis];var upperIndex=proxy.upperBounds[axis];var lowerValue=bounds[lowerIndex].value;var upperValue=bounds[upperIndex].value;var tArr=new Array();var j=0;var tEnd=upperIndex-lowerIndex-1;var tBound1;var tBound2;for(j=0;j<tEnd;j++){tArr[j]=new b2Bound();tBound1=tArr[j];tBound2=bounds[lowerIndex+1+j];tBound1.value=tBound2.value;tBound1.proxyId=tBound2.proxyId;tBound1.stabbingCount=tBound2.stabbingCount;}
+tEnd=tArr.length;var tIndex=lowerIndex;for(j=0;j<tEnd;j++){tBound2=tArr[j];tBound1=bounds[tIndex+j]
+tBound1.value=tBound2.value;tBound1.proxyId=tBound2.proxyId;tBound1.stabbingCount=tBound2.stabbingCount;}
+tArr=new Array();tEnd=boundCount-upperIndex-1;for(j=0;j<tEnd;j++){tArr[j]=new b2Bound();tBound1=tArr[j];tBound2=bounds[upperIndex+1+j];tBound1.value=tBound2.value;tBound1.proxyId=tBound2.proxyId;tBound1.stabbingCount=tBound2.stabbingCount;}
+tEnd=tArr.length;tIndex=upperIndex-1;for(j=0;j<tEnd;j++){tBound2=tArr[j];tBound1=bounds[tIndex+j]
+tBound1.value=tBound2.value;tBound1.proxyId=tBound2.proxyId;tBound1.stabbingCount=tBound2.stabbingCount;}
+tEnd=boundCount-2;for(var index=lowerIndex;index<tEnd;++index)
+{var proxy2=this.m_proxyPool[bounds[index].proxyId];if(bounds[index].IsLower())
+{proxy2.lowerBounds[axis]=index;}
+else
+{proxy2.upperBounds[axis]=index;}}
+tEnd=upperIndex-1;for(var index2=lowerIndex;index2<tEnd;++index2)
+{bounds[index2].stabbingCount--;}
+this.Query([0],[0],lowerValue,upperValue,bounds,boundCount-2,axis);}
+for(var i=0;i<this.m_queryResultCount;++i)
+{this.m_pairManager.RemoveBufferedPair(proxyId,this.m_queryResults[i]);}
+this.m_pairManager.Commit();this.m_queryResultCount=0;this.IncrementTimeStamp();proxy.userData=null;proxy.overlapCount=b2BroadPhase.b2_invalid;proxy.lowerBounds[0]=b2BroadPhase.b2_invalid;proxy.lowerBounds[1]=b2BroadPhase.b2_invalid;proxy.upperBounds[0]=b2BroadPhase.b2_invalid;proxy.upperBounds[1]=b2BroadPhase.b2_invalid;proxy.SetNext(this.m_freeProxy);this.m_freeProxy=proxyId;--this.m_proxyCount;},MoveProxy:function(proxyId,aabb){var axis=0;var index=0;var bound;var prevBound
+var nextBound
+var nextProxyId=0;var nextProxy;if(proxyId==b2Pair.b2_nullProxy||b2Settings.b2_maxProxies<=proxyId)
+{return;}
+if(aabb.IsValid()==false)
+{return;}
+var boundCount=2*this.m_proxyCount;var proxy=this.m_proxyPool[proxyId];var newValues=new b2BoundValues();this.ComputeBounds(newValues.lowerValues,newValues.upperValues,aabb);var oldValues=new b2BoundValues();for(axis=0;axis<2;++axis)
+{oldValues.lowerValues[axis]=this.m_bounds[axis][proxy.lowerBounds[axis]].value;oldValues.upperValues[axis]=this.m_bounds[axis][proxy.upperBounds[axis]].value;}
+for(axis=0;axis<2;++axis)
+{var bounds=this.m_bounds[axis];var lowerIndex=proxy.lowerBounds[axis];var upperIndex=proxy.upperBounds[axis];var lowerValue=newValues.lowerValues[axis];var upperValue=newValues.upperValues[axis];var deltaLower=lowerValue-bounds[lowerIndex].value;var deltaUpper=upperValue-bounds[upperIndex].value;bounds[lowerIndex].value=lowerValue;bounds[upperIndex].value=upperValue;if(deltaLower<0)
+{index=lowerIndex;while(index>0&&lowerValue<bounds[index-1].value)
+{bound=bounds[index];prevBound=bounds[index-1];var prevProxyId=prevBound.proxyId;var prevProxy=this.m_proxyPool[prevBound.proxyId];prevBound.stabbingCount++;if(prevBound.IsUpper()==true)
+{if(this.TestOverlap(newValues,prevProxy))
+{this.m_pairManager.AddBufferedPair(proxyId,prevProxyId);}
+prevProxy.upperBounds[axis]++;bound.stabbingCount++;}
+else
+{prevProxy.lowerBounds[axis]++;bound.stabbingCount--;}
+proxy.lowerBounds[axis]--;bound.Swap(prevBound);--index;}}
+if(deltaUpper>0)
+{index=upperIndex;while(index<boundCount-1&&bounds[index+1].value<=upperValue)
+{bound=bounds[index];nextBound=bounds[index+1];nextProxyId=nextBound.proxyId;nextProxy=this.m_proxyPool[nextProxyId];nextBound.stabbingCount++;if(nextBound.IsLower()==true)
+{if(this.TestOverlap(newValues,nextProxy))
+{this.m_pairManager.AddBufferedPair(proxyId,nextProxyId);}
+nextProxy.lowerBounds[axis]--;bound.stabbingCount++;}
+else
+{nextProxy.upperBounds[axis]--;bound.stabbingCount--;}
+proxy.upperBounds[axis]++;bound.Swap(nextBound);index++;}}
+if(deltaLower>0)
+{index=lowerIndex;while(index<boundCount-1&&bounds[index+1].value<=lowerValue)
+{bound=bounds[index];nextBound=bounds[index+1];nextProxyId=nextBound.proxyId;nextProxy=this.m_proxyPool[nextProxyId];nextBound.stabbingCount--;if(nextBound.IsUpper())
+{if(this.TestOverlap(oldValues,nextProxy))
+{this.m_pairManager.RemoveBufferedPair(proxyId,nextProxyId);}
+nextProxy.upperBounds[axis]--;bound.stabbingCount--;}
+else
+{nextProxy.lowerBounds[axis]--;bound.stabbingCount++;}
+proxy.lowerBounds[axis]++;bound.Swap(nextBound);index++;}}
+if(deltaUpper<0)
+{index=upperIndex;while(index>0&&upperValue<bounds[index-1].value)
+{bound=bounds[index];prevBound=bounds[index-1];prevProxyId=prevBound.proxyId;prevProxy=this.m_proxyPool[prevProxyId];prevBound.stabbingCount--;if(prevBound.IsLower()==true)
+{if(this.TestOverlap(oldValues,prevProxy))
+{this.m_pairManager.RemoveBufferedPair(proxyId,prevProxyId);}
+prevProxy.lowerBounds[axis]++;bound.stabbingCount--;}
+else
+{prevProxy.upperBounds[axis]++;bound.stabbingCount++;}
+proxy.upperBounds[axis]--;bound.Swap(prevBound);index--;}}}},Commit:function(){this.m_pairManager.Commit();},QueryAABB:function(aabb,userData,maxCount){var lowerValues=new Array();var upperValues=new Array();this.ComputeBounds(lowerValues,upperValues,aabb);var lowerIndex=0;var upperIndex=0;var lowerIndexOut=[lowerIndex];var upperIndexOut=[upperIndex];this.Query(lowerIndexOut,upperIndexOut,lowerValues[0],upperValues[0],this.m_bounds[0],2*this.m_proxyCount,0);this.Query(lowerIndexOut,upperIndexOut,lowerValues[1],upperValues[1],this.m_bounds[1],2*this.m_proxyCount,1);var count=0;for(var i=0;i<this.m_queryResultCount&&count<maxCount;++i,++count)
+{var proxy=this.m_proxyPool[this.m_queryResults[i]];userData[i]=proxy.userData;}
+this.m_queryResultCount=0;this.IncrementTimeStamp();return count;},Validate:function(){var pair;var proxy1;var proxy2;var overlap;for(var axis=0;axis<2;++axis)
+{var bounds=this.m_bounds[axis];var boundCount=2*this.m_proxyCount;var stabbingCount=0;for(var i=0;i<boundCount;++i)
+{var bound=bounds[i];if(bound.IsLower()==true)
+{stabbingCount++;}
+else
+{stabbingCount--;}}}},ComputeBounds:function(lowerValues,upperValues,aabb)
+{var minVertexX=aabb.minVertex.x;var minVertexY=aabb.minVertex.y;minVertexX=b2Math.b2Min(minVertexX,this.m_worldAABB.maxVertex.x);minVertexY=b2Math.b2Min(minVertexY,this.m_worldAABB.maxVertex.y);minVertexX=b2Math.b2Max(minVertexX,this.m_worldAABB.minVertex.x);minVertexY=b2Math.b2Max(minVertexY,this.m_worldAABB.minVertex.y);var maxVertexX=aabb.maxVertex.x;var maxVertexY=aabb.maxVertex.y;maxVertexX=b2Math.b2Min(maxVertexX,this.m_worldAABB.maxVertex.x);maxVertexY=b2Math.b2Min(maxVertexY,this.m_worldAABB.maxVertex.y);maxVertexX=b2Math.b2Max(maxVertexX,this.m_worldAABB.minVertex.x);maxVertexY=b2Math.b2Max(maxVertexY,this.m_worldAABB.minVertex.y);lowerValues[0]=(this.m_quantizationFactor.x*(minVertexX-this.m_worldAABB.minVertex.x))&(b2Settings.USHRT_MAX-1);upperValues[0]=((this.m_quantizationFactor.x*(maxVertexX-this.m_worldAABB.minVertex.x))&0x0000ffff)|1;lowerValues[1]=(this.m_quantizationFactor.y*(minVertexY-this.m_worldAABB.minVertex.y))&(b2Settings.USHRT_MAX-1);upperValues[1]=((this.m_quantizationFactor.y*(maxVertexY-this.m_worldAABB.minVertex.y))&0x0000ffff)|1;},TestOverlapValidate:function(p1,p2){for(var axis=0;axis<2;++axis)
+{var bounds=this.m_bounds[axis];if(bounds[p1.lowerBounds[axis]].value>bounds[p2.upperBounds[axis]].value)
+return false;if(bounds[p1.upperBounds[axis]].value<bounds[p2.lowerBounds[axis]].value)
+return false;}
+return true;},TestOverlap:function(b,p)
+{for(var axis=0;axis<2;++axis)
+{var bounds=this.m_bounds[axis];if(b.lowerValues[axis]>bounds[p.upperBounds[axis]].value)
+return false;if(b.upperValues[axis]<bounds[p.lowerBounds[axis]].value)
+return false;}
+return true;},Query:function(lowerQueryOut,upperQueryOut,lowerValue,upperValue,bounds,boundCount,axis){var lowerQuery=b2BroadPhase.BinarySearch(bounds,boundCount,lowerValue);var upperQuery=b2BroadPhase.BinarySearch(bounds,boundCount,upperValue);for(var j=lowerQuery;j<upperQuery;++j)
+{if(bounds[j].IsLower())
+{this.IncrementOverlapCount(bounds[j].proxyId);}}
+if(lowerQuery>0)
+{var i=lowerQuery-1;var s=bounds[i].stabbingCount;while(s)
+{if(bounds[i].IsLower())
+{var proxy=this.m_proxyPool[bounds[i].proxyId];if(lowerQuery<=proxy.upperBounds[axis])
+{this.IncrementOverlapCount(bounds[i].proxyId);--s;}}
+--i;}}
+lowerQueryOut[0]=lowerQuery;upperQueryOut[0]=upperQuery;},IncrementOverlapCount:function(proxyId){var proxy=this.m_proxyPool[proxyId];if(proxy.timeStamp<this.m_timeStamp)
+{proxy.timeStamp=this.m_timeStamp;proxy.overlapCount=1;}
+else
+{proxy.overlapCount=2;this.m_queryResults[this.m_queryResultCount]=proxyId;++this.m_queryResultCount;}},IncrementTimeStamp:function(){if(this.m_timeStamp==b2Settings.USHRT_MAX)
+{for(var i=0;i<b2Settings.b2_maxProxies;++i)
+{this.m_proxyPool[i].timeStamp=0;}
+this.m_timeStamp=1;}
+else
+{++this.m_timeStamp;}},m_pairManager:new b2PairManager(),m_proxyPool:new Array(b2Settings.b2_maxPairs),m_freeProxy:0,m_bounds:new Array(2*b2Settings.b2_maxProxies),m_queryResults:new Array(b2Settings.b2_maxProxies),m_queryResultCount:0,m_worldAABB:null,m_quantizationFactor:new b2Vec2(),m_proxyCount:0,m_timeStamp:0};b2BroadPhase.s_validate=false;b2BroadPhase.b2_invalid=b2Settings.USHRT_MAX;b2BroadPhase.b2_nullEdge=b2Settings.USHRT_MAX;b2BroadPhase.BinarySearch=function(bounds,count,value)
+{var low=0;var high=count-1;while(low<=high)
+{var mid=Math.floor((low+high)/2);if(bounds[mid].value>value)
+{high=mid-1;}
+else if(bounds[mid].value<value)
+{low=mid+1;}
+else
+{return(mid);}}
+return(low);};
+var b2Collision=Class.create();b2Collision.prototype={initialize:function(){}}
+b2Collision.b2_nullFeature=0x000000ff;b2Collision.ClipSegmentToLine=function(vOut,vIn,normal,offset)
+{var numOut=0;var vIn0=vIn[0].v;var vIn1=vIn[1].v;var distance0=b2Math.b2Dot(normal,vIn[0].v)-offset;var distance1=b2Math.b2Dot(normal,vIn[1].v)-offset;if(distance0<=0.0)vOut[numOut++]=vIn[0];if(distance1<=0.0)vOut[numOut++]=vIn[1];if(distance0*distance1<0.0)
+{var interp=distance0/(distance0-distance1);var tVec=vOut[numOut].v;tVec.x=vIn0.x+interp*(vIn1.x-vIn0.x);tVec.y=vIn0.y+interp*(vIn1.y-vIn0.y);if(distance0>0.0)
+{vOut[numOut].id=vIn[0].id;}
+else
+{vOut[numOut].id=vIn[1].id;}
+++numOut;}
+return numOut;};b2Collision.EdgeSeparation=function(poly1,edge1,poly2)
+{var vert1s=poly1.m_vertices;var count2=poly2.m_vertexCount;var vert2s=poly2.m_vertices;var normalX=poly1.m_normals[edge1].x;var normalY=poly1.m_normals[edge1].y;var tX=normalX;var tMat=poly1.m_R;normalX=tMat.col1.x*tX+tMat.col2.x*normalY;normalY=tMat.col1.y*tX+tMat.col2.y*normalY;var normalLocal2X=normalX;var normalLocal2Y=normalY;tMat=poly2.m_R;tX=normalLocal2X*tMat.col1.x+normalLocal2Y*tMat.col1.y;normalLocal2Y=normalLocal2X*tMat.col2.x+normalLocal2Y*tMat.col2.y;normalLocal2X=tX;var vertexIndex2=0;var minDot=Number.MAX_VALUE;for(var i=0;i<count2;++i)
+{var tVec=vert2s[i];var dot=tVec.x*normalLocal2X+tVec.y*normalLocal2Y;if(dot<minDot)
+{minDot=dot;vertexIndex2=i;}}
+tMat=poly1.m_R;var v1X=poly1.m_position.x+(tMat.col1.x*vert1s[edge1].x+tMat.col2.x*vert1s[edge1].y)
+var v1Y=poly1.m_position.y+(tMat.col1.y*vert1s[edge1].x+tMat.col2.y*vert1s[edge1].y)
+tMat=poly2.m_R;var v2X=poly2.m_position.x+(tMat.col1.x*vert2s[vertexIndex2].x+tMat.col2.x*vert2s[vertexIndex2].y)
+var v2Y=poly2.m_position.y+(tMat.col1.y*vert2s[vertexIndex2].x+tMat.col2.y*vert2s[vertexIndex2].y)
+v2X-=v1X;v2Y-=v1Y;var separation=v2X*normalX+v2Y*normalY;return separation;};b2Collision.FindMaxSeparation=function(edgeIndex,poly1,poly2,conservative)
+{var count1=poly1.m_vertexCount;var dX=poly2.m_position.x-poly1.m_position.x;var dY=poly2.m_position.y-poly1.m_position.y;var dLocal1X=(dX*poly1.m_R.col1.x+dY*poly1.m_R.col1.y);var dLocal1Y=(dX*poly1.m_R.col2.x+dY*poly1.m_R.col2.y);var edge=0;var maxDot=-Number.MAX_VALUE;for(var i=0;i<count1;++i)
+{var dot=(poly1.m_normals[i].x*dLocal1X+poly1.m_normals[i].y*dLocal1Y);if(dot>maxDot)
+{maxDot=dot;edge=i;}}
+var s=b2Collision.EdgeSeparation(poly1,edge,poly2);if(s>0.0&&conservative==false)
+{return s;}
+var prevEdge=edge-1>=0?edge-1:count1-1;var sPrev=b2Collision.EdgeSeparation(poly1,prevEdge,poly2);if(sPrev>0.0&&conservative==false)
+{return sPrev;}
+var nextEdge=edge+1<count1?edge+1:0;var sNext=b2Collision.EdgeSeparation(poly1,nextEdge,poly2);if(sNext>0.0&&conservative==false)
+{return sNext;}
+var bestEdge=0;var bestSeparation;var increment=0;if(sPrev>s&&sPrev>sNext)
+{increment=-1;bestEdge=prevEdge;bestSeparation=sPrev;}
+else if(sNext>s)
+{increment=1;bestEdge=nextEdge;bestSeparation=sNext;}
+else
+{edgeIndex[0]=edge;return s;}
+while(true)
+{if(increment==-1)
+edge=bestEdge-1>=0?bestEdge-1:count1-1;else
+edge=bestEdge+1<count1?bestEdge+1:0;s=b2Collision.EdgeSeparation(poly1,edge,poly2);if(s>0.0&&conservative==false)
+{return s;}
+if(s>bestSeparation)
+{bestEdge=edge;bestSeparation=s;}
+else
+{break;}}
+edgeIndex[0]=bestEdge;return bestSeparation;};b2Collision.FindIncidentEdge=function(c,poly1,edge1,poly2)
+{var count1=poly1.m_vertexCount;var vert1s=poly1.m_vertices;var count2=poly2.m_vertexCount;var vert2s=poly2.m_vertices;var vertex11=edge1;var vertex12=edge1+1==count1?0:edge1+1;var tVec=vert1s[vertex12];var normal1Local1X=tVec.x;var normal1Local1Y=tVec.y;tVec=vert1s[vertex11];normal1Local1X-=tVec.x;normal1Local1Y-=tVec.y;var tX=normal1Local1X;normal1Local1X=normal1Local1Y;normal1Local1Y=-tX;var invLength=1.0/Math.sqrt(normal1Local1X*normal1Local1X+normal1Local1Y*normal1Local1Y);normal1Local1X*=invLength;normal1Local1Y*=invLength;var normal1X=normal1Local1X;var normal1Y=normal1Local1Y;tX=normal1X;var tMat=poly1.m_R;normal1X=tMat.col1.x*tX+tMat.col2.x*normal1Y;normal1Y=tMat.col1.y*tX+tMat.col2.y*normal1Y;var normal1Local2X=normal1X;var normal1Local2Y=normal1Y;tMat=poly2.m_R;tX=normal1Local2X*tMat.col1.x+normal1Local2Y*tMat.col1.y;normal1Local2Y=normal1Local2X*tMat.col2.x+normal1Local2Y*tMat.col2.y;normal1Local2X=tX;var vertex21=0;var vertex22=0;var minDot=Number.MAX_VALUE;for(var i=0;i<count2;++i)
+{var i1=i;var i2=i+1<count2?i+1:0;tVec=vert2s[i2];var normal2Local2X=tVec.x;var normal2Local2Y=tVec.y;tVec=vert2s[i1];normal2Local2X-=tVec.x;normal2Local2Y-=tVec.y;tX=normal2Local2X;normal2Local2X=normal2Local2Y;normal2Local2Y=-tX;invLength=1.0/Math.sqrt(normal2Local2X*normal2Local2X+normal2Local2Y*normal2Local2Y);normal2Local2X*=invLength;normal2Local2Y*=invLength;var dot=normal2Local2X*normal1Local2X+normal2Local2Y*normal1Local2Y;if(dot<minDot)
+{minDot=dot;vertex21=i1;vertex22=i2;}}
+var tClip;tClip=c[0];tVec=tClip.v;tVec.SetV(vert2s[vertex21]);tVec.MulM(poly2.m_R);tVec.Add(poly2.m_position);tClip.id.features.referenceFace=edge1;tClip.id.features.incidentEdge=vertex21;tClip.id.features.incidentVertex=vertex21;tClip=c[1];tVec=tClip.v;tVec.SetV(vert2s[vertex22]);tVec.MulM(poly2.m_R);tVec.Add(poly2.m_position);tClip.id.features.referenceFace=edge1;tClip.id.features.incidentEdge=vertex21;tClip.id.features.incidentVertex=vertex22;};b2Collision.b2CollidePolyTempVec=new b2Vec2();b2Collision.b2CollidePoly=function(manifold,polyA,polyB,conservative)
+{manifold.pointCount=0;var edgeA=0;var edgeAOut=[edgeA];var separationA=b2Collision.FindMaxSeparation(edgeAOut,polyA,polyB,conservative);edgeA=edgeAOut[0];if(separationA>0.0&&conservative==false)
+return;var edgeB=0;var edgeBOut=[edgeB];var separationB=b2Collision.FindMaxSeparation(edgeBOut,polyB,polyA,conservative);edgeB=edgeBOut[0];if(separationB>0.0&&conservative==false)
+return;var poly1;var poly2;var edge1=0;var flip=0;var k_relativeTol=0.98;var k_absoluteTol=0.001;if(separationB>k_relativeTol*separationA+k_absoluteTol)
+{poly1=polyB;poly2=polyA;edge1=edgeB;flip=1;}
+else
+{poly1=polyA;poly2=polyB;edge1=edgeA;flip=0;}
+var incidentEdge=[new ClipVertex(),new ClipVertex()];b2Collision.FindIncidentEdge(incidentEdge,poly1,edge1,poly2);var count1=poly1.m_vertexCount;var vert1s=poly1.m_vertices;var v11=vert1s[edge1];var v12=edge1+1<count1?vert1s[edge1+1]:vert1s[0];var dvX=v12.x-v11.x;var dvY=v12.y-v11.y;var sideNormalX=v12.x-v11.x;var sideNormalY=v12.y-v11.y;var tX=sideNormalX;var tMat=poly1.m_R;sideNormalX=tMat.col1.x*tX+tMat.col2.x*sideNormalY;sideNormalY=tMat.col1.y*tX+tMat.col2.y*sideNormalY;var invLength=1.0/Math.sqrt(sideNormalX*sideNormalX+sideNormalY*sideNormalY);sideNormalX*=invLength;sideNormalY*=invLength;var frontNormalX=sideNormalX;var frontNormalY=sideNormalY;tX=frontNormalX;frontNormalX=frontNormalY;frontNormalY=-tX;var v11X=v11.x;var v11Y=v11.y;tX=v11X;tMat=poly1.m_R;v11X=tMat.col1.x*tX+tMat.col2.x*v11Y;v11Y=tMat.col1.y*tX+tMat.col2.y*v11Y;v11X+=poly1.m_position.x;v11Y+=poly1.m_position.y;var v12X=v12.x;var v12Y=v12.y;tX=v12X;tMat=poly1.m_R;v12X=tMat.col1.x*tX+tMat.col2.x*v12Y;v12Y=tMat.col1.y*tX+tMat.col2.y*v12Y;v12X+=poly1.m_position.x;v12Y+=poly1.m_position.y;var frontOffset=frontNormalX*v11X+frontNormalY*v11Y;var sideOffset1=-(sideNormalX*v11X+sideNormalY*v11Y);var sideOffset2=sideNormalX*v12X+sideNormalY*v12Y;var clipPoints1=[new ClipVertex(),new ClipVertex()];var clipPoints2=[new ClipVertex(),new ClipVertex()];var np=0;b2Collision.b2CollidePolyTempVec.Set(-sideNormalX,-sideNormalY);np=b2Collision.ClipSegmentToLine(clipPoints1,incidentEdge,b2Collision.b2CollidePolyTempVec,sideOffset1);if(np<2)
+return;b2Collision.b2CollidePolyTempVec.Set(sideNormalX,sideNormalY);np=b2Collision.ClipSegmentToLine(clipPoints2,clipPoints1,b2Collision.b2CollidePolyTempVec,sideOffset2);if(np<2)
+return;if(flip){manifold.normal.Set(-frontNormalX,-frontNormalY);}
+else{manifold.normal.Set(frontNormalX,frontNormalY);}
+var pointCount=0;for(var i=0;i<b2Settings.b2_maxManifoldPoints;++i)
+{var tVec=clipPoints2[i].v;var separation=(frontNormalX*tVec.x+frontNormalY*tVec.y)-frontOffset;if(separation<=0.0||conservative==true)
+{var cp=manifold.points[pointCount];cp.separation=separation;cp.position.SetV(clipPoints2[i].v);cp.id.Set(clipPoints2[i].id);cp.id.features.flip=flip;++pointCount;}}
+manifold.pointCount=pointCount;};b2Collision.b2CollideCircle=function(manifold,circle1,circle2,conservative)
+{manifold.pointCount=0;var dX=circle2.m_position.x-circle1.m_position.x;var dY=circle2.m_position.y-circle1.m_position.y;var distSqr=dX*dX+dY*dY;var radiusSum=circle1.m_radius+circle2.m_radius;if(distSqr>radiusSum*radiusSum&&conservative==false)
+{return;}
+var separation;if(distSqr<Number.MIN_VALUE)
+{separation=-radiusSum;manifold.normal.Set(0.0,1.0);}
+else
+{var dist=Math.sqrt(distSqr);separation=dist-radiusSum;var a=1.0/dist;manifold.normal.x=a*dX;manifold.normal.y=a*dY;}
+manifold.pointCount=1;var tPoint=manifold.points[0];tPoint.id.set_key(0);tPoint.separation=separation;tPoint.position.x=circle2.m_position.x-(circle2.m_radius*manifold.normal.x);tPoint.position.y=circle2.m_position.y-(circle2.m_radius*manifold.normal.y);};b2Collision.b2CollidePolyAndCircle=function(manifold,poly,circle,conservative)
+{manifold.pointCount=0;var tPoint;var dX;var dY;var xLocalX=circle.m_position.x-poly.m_position.x;var xLocalY=circle.m_position.y-poly.m_position.y;var tMat=poly.m_R;var tX=xLocalX*tMat.col1.x+xLocalY*tMat.col1.y;xLocalY=xLocalX*tMat.col2.x+xLocalY*tMat.col2.y;xLocalX=tX;var dist;var normalIndex=0;var separation=-Number.MAX_VALUE;var radius=circle.m_radius;for(var i=0;i<poly.m_vertexCount;++i)
+{var s=poly.m_normals[i].x*(xLocalX-poly.m_vertices[i].x)+poly.m_normals[i].y*(xLocalY-poly.m_vertices[i].y);if(s>radius)
+{return;}
+if(s>separation)
+{separation=s;normalIndex=i;}}
+if(separation<Number.MIN_VALUE)
+{manifold.pointCount=1;var tVec=poly.m_normals[normalIndex];manifold.normal.x=tMat.col1.x*tVec.x+tMat.col2.x*tVec.y;manifold.normal.y=tMat.col1.y*tVec.x+tMat.col2.y*tVec.y;tPoint=manifold.points[0];tPoint.id.features.incidentEdge=normalIndex;tPoint.id.features.incidentVertex=b2Collision.b2_nullFeature;tPoint.id.features.referenceFace=b2Collision.b2_nullFeature;tPoint.id.features.flip=0;tPoint.position.x=circle.m_position.x-radius*manifold.normal.x;tPoint.position.y=circle.m_position.y-radius*manifold.normal.y;tPoint.separation=separation-radius;return;}
+var vertIndex1=normalIndex;var vertIndex2=vertIndex1+1<poly.m_vertexCount?vertIndex1+1:0;var eX=poly.m_vertices[vertIndex2].x-poly.m_vertices[vertIndex1].x;var eY=poly.m_vertices[vertIndex2].y-poly.m_vertices[vertIndex1].y;var length=Math.sqrt(eX*eX+eY*eY);eX/=length;eY/=length;if(length<Number.MIN_VALUE)
+{dX=xLocalX-poly.m_vertices[vertIndex1].x;dY=xLocalY-poly.m_vertices[vertIndex1].y;dist=Math.sqrt(dX*dX+dY*dY);dX/=dist;dY/=dist;if(dist>radius)
+{return;}
+manifold.pointCount=1;manifold.normal.Set(tMat.col1.x*dX+tMat.col2.x*dY,tMat.col1.y*dX+tMat.col2.y*dY);tPoint=manifold.points[0];tPoint.id.features.incidentEdge=b2Collision.b2_nullFeature;tPoint.id.features.incidentVertex=vertIndex1;tPoint.id.features.referenceFace=b2Collision.b2_nullFeature;tPoint.id.features.flip=0;tPoint.position.x=circle.m_position.x-radius*manifold.normal.x;tPoint.position.y=circle.m_position.y-radius*manifold.normal.y;tPoint.separation=dist-radius;return;}
+var u=(xLocalX-poly.m_vertices[vertIndex1].x)*eX+(xLocalY-poly.m_vertices[vertIndex1].y)*eY;tPoint=manifold.points[0];tPoint.id.features.incidentEdge=b2Collision.b2_nullFeature;tPoint.id.features.incidentVertex=b2Collision.b2_nullFeature;tPoint.id.features.referenceFace=b2Collision.b2_nullFeature;tPoint.id.features.flip=0;var pX,pY;if(u<=0.0)
+{pX=poly.m_vertices[vertIndex1].x;pY=poly.m_vertices[vertIndex1].y;tPoint.id.features.incidentVertex=vertIndex1;}
+else if(u>=length)
+{pX=poly.m_vertices[vertIndex2].x;pY=poly.m_vertices[vertIndex2].y;tPoint.id.features.incidentVertex=vertIndex2;}
+else
+{pX=eX*u+poly.m_vertices[vertIndex1].x;pY=eY*u+poly.m_vertices[vertIndex1].y;tPoint.id.features.incidentEdge=vertIndex1;}
+dX=xLocalX-pX;dY=xLocalY-pY;dist=Math.sqrt(dX*dX+dY*dY);dX/=dist;dY/=dist;if(dist>radius)
+{return;}
+manifold.pointCount=1;manifold.normal.Set(tMat.col1.x*dX+tMat.col2.x*dY,tMat.col1.y*dX+tMat.col2.y*dY);tPoint.position.x=circle.m_position.x-radius*manifold.normal.x;tPoint.position.y=circle.m_position.y-radius*manifold.normal.y;tPoint.separation=dist-radius;};b2Collision.b2TestOverlap=function(a,b)
+{var t1=b.minVertex;var t2=a.maxVertex;var d1X=t1.x-t2.x;var d1Y=t1.y-t2.y;t1=a.minVertex;t2=b.maxVertex;var d2X=t1.x-t2.x;var d2Y=t1.y-t2.y;if(d1X>0.0||d1Y>0.0)
+return false;if(d2X>0.0||d2Y>0.0)
+return false;return true;};
+var Features=Class.create();Features.prototype={set_referenceFace:function(value){this._referenceFace=value;this._m_id._key=(this._m_id._key&0xffffff00)|(this._referenceFace&0x000000ff)},get_referenceFace:function(){return this._referenceFace;},_referenceFace:0,set_incidentEdge:function(value){this._incidentEdge=value;this._m_id._key=(this._m_id._key&0xffff00ff)|((this._incidentEdge<<8)&0x0000ff00)},get_incidentEdge:function(){return this._incidentEdge;},_incidentEdge:0,set_incidentVertex:function(value){this._incidentVertex=value;this._m_id._key=(this._m_id._key&0xff00ffff)|((this._incidentVertex<<16)&0x00ff0000)},get_incidentVertex:function(){return this._incidentVertex;},_incidentVertex:0,set_flip:function(value){this._flip=value;this._m_id._key=(this._m_id._key&0x00ffffff)|((this._flip<<24)&0xff000000)},get_flip:function(){return this._flip;},_flip:0,_m_id:null,initialize:function(){}};
+var b2ContactID=Class.create();b2ContactID.prototype={initialize:function(){this.features=new Features();this.features._m_id=this;},Set:function(id){this.set_key(id._key);},Copy:function(){var id=new b2ContactID();id.set_key(this._key);return id;},get_key:function(){return this._key;},set_key:function(value){this._key=value;this.features._referenceFace=this._key&0x000000ff;this.features._incidentEdge=((this._key&0x0000ff00)>>8)&0x000000ff;this.features._incidentVertex=((this._key&0x00ff0000)>>16)&0x000000ff;this.features._flip=((this._key&0xff000000)>>24)&0x000000ff;},features:new Features(),_key:0};
+var b2ContactPoint=Class.create();b2ContactPoint.prototype={position:new b2Vec2(),separation:null,normalImpulse:null,tangentImpulse:null,id:new b2ContactID(),initialize:function(){this.position=new b2Vec2();this.id=new b2ContactID();}};var b2Distance=Class.create();b2Distance.prototype={initialize:function(){}};b2Distance.ProcessTwo=function(p1Out,p2Out,p1s,p2s,points)
+{var rX=-points[1].x;var rY=-points[1].y;var dX=points[0].x-points[1].x;var dY=points[0].y-points[1].y;var length=Math.sqrt(dX*dX+dY*dY);dX/=length;dY/=length;var lambda=rX*dX+rY*dY;if(lambda<=0.0||length<Number.MIN_VALUE)
+{p1Out.SetV(p1s[1]);p2Out.SetV(p2s[1]);p1s[0].SetV(p1s[1]);p2s[0].SetV(p2s[1]);points[0].SetV(points[1]);return 1;}
+lambda/=length;p1Out.x=p1s[1].x+lambda*(p1s[0].x-p1s[1].x);p1Out.y=p1s[1].y+lambda*(p1s[0].y-p1s[1].y);p2Out.x=p2s[1].x+lambda*(p2s[0].x-p2s[1].x);p2Out.y=p2s[1].y+lambda*(p2s[0].y-p2s[1].y);return 2;};b2Distance.ProcessThree=function(p1Out,p2Out,p1s,p2s,points)
+{var aX=points[0].x;var aY=points[0].y;var bX=points[1].x;var bY=points[1].y;var cX=points[2].x;var cY=points[2].y;var abX=bX-aX;var abY=bY-aY;var acX=cX-aX;var acY=cY-aY;var bcX=cX-bX;var bcY=cY-bY;var sn=-(aX*abX+aY*abY);var sd=(bX*abX+bY*abY);var tn=-(aX*acX+aY*acY);var td=(cX*acX+cY*acY);var un=-(bX*bcX+bY*bcY);var ud=(cX*bcX+cY*bcY);if(td<=0.0&&ud<=0.0)
+{p1Out.SetV(p1s[2]);p2Out.SetV(p2s[2]);p1s[0].SetV(p1s[2]);p2s[0].SetV(p2s[2]);points[0].SetV(points[2]);return 1;}
+var n=abX*acY-abY*acX;var vc=n*(aX*bY-aY*bX);var va=n*(bX*cY-bY*cX);if(va<=0.0&&un>=0.0&&ud>=0.0)
+{var lambda=un/(un+ud);p1Out.x=p1s[1].x+lambda*(p1s[2].x-p1s[1].x);p1Out.y=p1s[1].y+lambda*(p1s[2].y-p1s[1].y);p2Out.x=p2s[1].x+lambda*(p2s[2].x-p2s[1].x);p2Out.y=p2s[1].y+lambda*(p2s[2].y-p2s[1].y);p1s[0].SetV(p1s[2]);p2s[0].SetV(p2s[2]);points[0].SetV(points[2]);return 2;}
+var vb=n*(cX*aY-cY*aX);if(vb<=0.0&&tn>=0.0&&td>=0.0)
+{var lambda=tn/(tn+td);p1Out.x=p1s[0].x+lambda*(p1s[2].x-p1s[0].x);p1Out.y=p1s[0].y+lambda*(p1s[2].y-p1s[0].y);p2Out.x=p2s[0].x+lambda*(p2s[2].x-p2s[0].x);p2Out.y=p2s[0].y+lambda*(p2s[2].y-p2s[0].y);p1s[1].SetV(p1s[2]);p2s[1].SetV(p2s[2]);points[1].SetV(points[2]);return 2;}
+var denom=va+vb+vc;denom=1.0/denom;var u=va*denom;var v=vb*denom;var w=1.0-u-v;p1Out.x=u*p1s[0].x+v*p1s[1].x+w*p1s[2].x;p1Out.y=u*p1s[0].y+v*p1s[1].y+w*p1s[2].y;p2Out.x=u*p2s[0].x+v*p2s[1].x+w*p2s[2].x;p2Out.y=u*p2s[0].y+v*p2s[1].y+w*p2s[2].y;return 3;};b2Distance.InPoinsts=function(w,points,pointCount)
+{for(var i=0;i<pointCount;++i)
+{if(w.x==points[i].x&&w.y==points[i].y)
+{return true;}}
+return false;};b2Distance.Distance=function(p1Out,p2Out,shape1,shape2)
+{var p1s=new Array(3);var p2s=new Array(3);var points=new Array(3);var pointCount=0;p1Out.SetV(shape1.m_position);p2Out.SetV(shape2.m_position);var vSqr=0.0;var maxIterations=20;for(var iter=0;iter<maxIterations;++iter)
+{var vX=p2Out.x-p1Out.x;var vY=p2Out.y-p1Out.y;var w1=shape1.Support(vX,vY);var w2=shape2.Support(-vX,-vY);vSqr=(vX*vX+vY*vY);var wX=w2.x-w1.x;var wY=w2.y-w1.y;var vw=(vX*wX+vY*wY);if(vSqr-b2Dot(vX*wX+vY*wY)<=0.01*vSqr)
+{if(pointCount==0)
+{p1Out.SetV(w1);p2Out.SetV(w2);}
+b2Distance.g_GJK_Iterations=iter;return Math.sqrt(vSqr);}
+switch(pointCount)
+{case 0:p1s[0].SetV(w1);p2s[0].SetV(w2);points[0]=w;p1Out.SetV(p1s[0]);p2Out.SetV(p2s[0]);++pointCount;break;case 1:p1s[1].SetV(w1);p2s[1].SetV(w2);points[1].x=wX;points[1].y=wY;pointCount=b2Distance.ProcessTwo(p1Out,p2Out,p1s,p2s,points);break;case 2:p1s[2].SetV(w1);p2s[2].SetV(w2);points[2].x=wX;points[2].y=wY;pointCount=b2Distance.ProcessThree(p1Out,p2Out,p1s,p2s,points);break;}
+if(pointCount==3)
+{b2Distance.g_GJK_Iterations=iter;return 0.0;}
+var maxSqr=-Number.MAX_VALUE;for(var i=0;i<pointCount;++i)
+{maxSqr=b2Math.b2Max(maxSqr,(points[i].x*points[i].x+points[i].y*points[i].y));}
+if(pointCount==3||vSqr<=100.0*Number.MIN_VALUE*maxSqr)
+{b2Distance.g_GJK_Iterations=iter;return Math.sqrt(vSqr);}}
+b2Distance.g_GJK_Iterations=maxIterations;return Math.sqrt(vSqr);};b2Distance.g_GJK_Iterations=0;
+var b2Manifold=Class.create();b2Manifold.prototype={initialize:function(){this.points=new Array(b2Settings.b2_maxManifoldPoints);for(var i=0;i<b2Settings.b2_maxManifoldPoints;i++){this.points[i]=new b2ContactPoint();}
+this.normal=new b2Vec2();},points:null,normal:null,pointCount:0};
+var b2OBB=Class.create();b2OBB.prototype={R:new b2Mat22(),center:new b2Vec2(),extents:new b2Vec2(),initialize:function(){this.R=new b2Mat22();this.center=new b2Vec2();this.extents=new b2Vec2();}};
+var b2Proxy=Class.create();b2Proxy.prototype={GetNext:function(){return this.lowerBounds[0];},SetNext:function(next){this.lowerBounds[0]=next;},IsValid:function(){return this.overlapCount!=b2BroadPhase.b2_invalid;},lowerBounds:[(0),(0)],upperBounds:[(0),(0)],overlapCount:0,timeStamp:0,userData:null,initialize:function(){this.lowerBounds=[(0),(0)];this.upperBounds=[(0),(0)];}}
+
+var ClipVertex=Class.create();ClipVertex.prototype={v:new b2Vec2(),id:new b2ContactID(),initialize:function(){this.v=new b2Vec2();this.id=new b2ContactID();}};var b2Shape=Class.create();b2Shape.prototype={TestPoint:function(p){return false},GetUserData:function(){return this.m_userData;},GetType:function(){return this.m_type;},GetBody:function(){return this.m_body;},GetPosition:function(){return this.m_position;},GetRotationMatrix:function(){return this.m_R;},ResetProxy:function(broadPhase){},GetNext:function(){return this.m_next;},initialize:function(def,body){this.m_R=new b2Mat22();this.m_position=new b2Vec2();this.m_userData=def.userData;this.m_friction=def.friction;this.m_restitution=def.restitution;this.m_body=body;this.m_proxyId=b2Pair.b2_nullProxy;this.m_maxRadius=0.0;this.m_categoryBits=def.categoryBits;this.m_maskBits=def.maskBits;this.m_groupIndex=def.groupIndex;},DestroyProxy:function()
+{if(this.m_proxyId!=b2Pair.b2_nullProxy)
+{this.m_body.m_world.m_broadPhase.DestroyProxy(this.m_proxyId);this.m_proxyId=b2Pair.b2_nullProxy;}},Synchronize:function(position1,R1,position2,R2){},QuickSync:function(position,R){},Support:function(dX,dY,out){},GetMaxRadius:function(){return this.m_maxRadius;},m_next:null,m_R:new b2Mat22(),m_position:new b2Vec2(),m_type:0,m_userData:null,m_body:null,m_friction:null,m_restitution:null,m_maxRadius:null,m_proxyId:0,m_categoryBits:0,m_maskBits:0,m_groupIndex:0};b2Shape.Create=function(def,body,center){switch(def.type)
+{case b2Shape.e_circleShape:{return new b2CircleShape(def,body,center);}
+case b2Shape.e_boxShape:case b2Shape.e_polyShape:{return new b2PolyShape(def,body,center);}}
+return null;};b2Shape.Destroy=function(shape)
+{if(shape.m_proxyId!=b2Pair.b2_nullProxy)
+shape.m_body.m_world.m_broadPhase.DestroyProxy(shape.m_proxyId);};b2Shape.e_unknownShape=-1;b2Shape.e_circleShape=0;b2Shape.e_boxShape=1;b2Shape.e_polyShape=2;b2Shape.e_meshShape=3;b2Shape.e_shapeTypeCount=4;b2Shape.PolyMass=function(massData,vs,count,rho)
+{var center=new b2Vec2();center.SetZero();var area=0.0;var I=0.0;var pRef=new b2Vec2(0.0,0.0);var inv3=1.0/3.0;for(var i=0;i<count;++i)
+{var p1=pRef;var p2=vs[i];var p3=i+1<count?vs[i+1]:vs[0];var e1=b2Math.SubtractVV(p2,p1);var e2=b2Math.SubtractVV(p3,p1);var D=b2Math.b2CrossVV(e1,e2);var triangleArea=0.5*D;area+=triangleArea;var tVec=new b2Vec2();tVec.SetV(p1);tVec.Add(p2);tVec.Add(p3);tVec.Multiply(inv3*triangleArea);center.Add(tVec);var px=p1.x;var py=p1.y;var ex1=e1.x;var ey1=e1.y;var ex2=e2.x;var ey2=e2.y;var intx2=inv3*(0.25*(ex1*ex1+ex2*ex1+ex2*ex2)+(px*ex1+px*ex2))+0.5*px*px;var inty2=inv3*(0.25*(ey1*ey1+ey2*ey1+ey2*ey2)+(py*ey1+py*ey2))+0.5*py*py;I+=D*(intx2+inty2);}
+massData.mass=rho*area;center.Multiply(1.0/area);massData.center=center;I=rho*(I-area*b2Math.b2Dot(center,center));massData.I=I;};b2Shape.PolyCentroid=function(vs,count,out)
+{var cX=0.0;var cY=0.0;var area=0.0;var pRefX=0.0;var pRefY=0.0;var inv3=1.0/3.0;for(var i=0;i<count;++i)
+{var p1X=pRefX;var p1Y=pRefY;var p2X=vs[i].x;var p2Y=vs[i].y;var p3X=i+1<count?vs[i+1].x:vs[0].x;var p3Y=i+1<count?vs[i+1].y:vs[0].y;var e1X=p2X-p1X;var e1Y=p2Y-p1Y;var e2X=p3X-p1X;var e2Y=p3Y-p1Y;var D=(e1X*e2Y-e1Y*e2X);var triangleArea=0.5*D;area+=triangleArea;cX+=triangleArea*inv3*(p1X+p2X+p3X);cY+=triangleArea*inv3*(p1Y+p2Y+p3Y);}
+cX*=1.0/area;cY*=1.0/area;out.Set(cX,cY);};
+var b2ShapeDef=Class.create();b2ShapeDef.prototype={initialize:function()
+{this.type=b2Shape.e_unknownShape;this.userData=null;this.localPosition=new b2Vec2(0.0,0.0);this.localRotation=0.0;this.friction=0.2;this.restitution=0.0;this.density=0.0;this.categoryBits=0x0001;this.maskBits=0xFFFF;this.groupIndex=0;},ComputeMass:function(massData)
+{massData.center=new b2Vec2(0.0,0.0)
+if(this.density==0.0)
+{massData.mass=0.0;massData.center.Set(0.0,0.0);massData.I=0.0;};switch(this.type)
+{case b2Shape.e_circleShape:{var circle=this;massData.mass=this.density*b2Settings.b2_pi*circle.radius*circle.radius;massData.center.Set(0.0,0.0);massData.I=0.5*(massData.mass)*circle.radius*circle.radius;}
+break;case b2Shape.e_boxShape:{var box=this;massData.mass=4.0*this.density*box.extents.x*box.extents.y;massData.center.Set(0.0,0.0);massData.I=massData.mass/3.0*b2Math.b2Dot(box.extents,box.extents);}
+break;case b2Shape.e_polyShape:{var poly=this;b2Shape.PolyMass(massData,poly.vertices,poly.vertexCount,this.density);}
+break;default:massData.mass=0.0;massData.center.Set(0.0,0.0);massData.I=0.0;break;}},type:0,userData:null,localPosition:null,localRotation:null,friction:null,restitution:null,density:null,categoryBits:0,maskBits:0,groupIndex:0};
+var b2BoxDef=Class.create();Object.extend(b2BoxDef.prototype,b2ShapeDef.prototype);Object.extend(b2BoxDef.prototype,{initialize:function()
+{this.type=b2Shape.e_unknownShape;this.userData=null;this.localPosition=new b2Vec2(0.0,0.0);this.localRotation=0.0;this.friction=0.2;this.restitution=0.0;this.density=0.0;this.categoryBits=0x0001;this.maskBits=0xFFFF;this.groupIndex=0;this.type=b2Shape.e_boxShape;this.extents=new b2Vec2(1.0,1.0);},extents:null});
+var b2CircleDef=Class.create();Object.extend(b2CircleDef.prototype,b2ShapeDef.prototype);Object.extend(b2CircleDef.prototype,{initialize:function()
+{this.type=b2Shape.e_unknownShape;this.userData=null;this.localPosition=new b2Vec2(0.0,0.0);this.localRotation=0.0;this.friction=0.2;this.restitution=0.0;this.density=0.0;this.categoryBits=0x0001;this.maskBits=0xFFFF;this.groupIndex=0;this.type=b2Shape.e_circleShape;this.radius=1.0;},radius:null});var b2CircleShape=Class.create();Object.extend(b2CircleShape.prototype,b2Shape.prototype);Object.extend(b2CircleShape.prototype,{TestPoint:function(p){var d=new b2Vec2();d.SetV(p);d.Subtract(this.m_position);return b2Math.b2Dot(d,d)<=this.m_radius*this.m_radius;},initialize:function(def,body,localCenter){this.m_R=new b2Mat22();this.m_position=new b2Vec2();this.m_userData=def.userData;this.m_friction=def.friction;this.m_restitution=def.restitution;this.m_body=body;this.m_proxyId=b2Pair.b2_nullProxy;this.m_maxRadius=0.0;this.m_categoryBits=def.categoryBits;this.m_maskBits=def.maskBits;this.m_groupIndex=def.groupIndex;this.m_localPosition=new b2Vec2();var circle=def;this.m_localPosition.Set(def.localPosition.x-localCenter.x,def.localPosition.y-localCenter.y);this.m_type=b2Shape.e_circleShape;this.m_radius=circle.radius;this.m_R.SetM(this.m_body.m_R);var rX=this.m_R.col1.x*this.m_localPosition.x+this.m_R.col2.x*this.m_localPosition.y;var rY=this.m_R.col1.y*this.m_localPosition.x+this.m_R.col2.y*this.m_localPosition.y;this.m_position.x=this.m_body.m_position.x+rX;this.m_position.y=this.m_body.m_position.y+rY;this.m_maxRadius=Math.sqrt(rX*rX+rY*rY)+this.m_radius;var aabb=new b2AABB();aabb.minVertex.Set(this.m_position.x-this.m_radius,this.m_position.y-this.m_radius);aabb.maxVertex.Set(this.m_position.x+this.m_radius,this.m_position.y+this.m_radius);var broadPhase=this.m_body.m_world.m_broadPhase;if(broadPhase.InRange(aabb))
+{this.m_proxyId=broadPhase.CreateProxy(aabb,this);}
+else
+{this.m_proxyId=b2Pair.b2_nullProxy;}
+if(this.m_proxyId==b2Pair.b2_nullProxy)
+{this.m_body.Freeze();}},Synchronize:function(position1,R1,position2,R2){this.m_R.SetM(R2);this.m_position.x=(R2.col1.x*this.m_localPosition.x+R2.col2.x*this.m_localPosition.y)+position2.x;this.m_position.y=(R2.col1.y*this.m_localPosition.x+R2.col2.y*this.m_localPosition.y)+position2.y;if(this.m_proxyId==b2Pair.b2_nullProxy)
+{return;}
+var p1X=position1.x+(R1.col1.x*this.m_localPosition.x+R1.col2.x*this.m_localPosition.y);var p1Y=position1.y+(R1.col1.y*this.m_localPosition.x+R1.col2.y*this.m_localPosition.y);var lowerX=Math.min(p1X,this.m_position.x);var lowerY=Math.min(p1Y,this.m_position.y);var upperX=Math.max(p1X,this.m_position.x);var upperY=Math.max(p1Y,this.m_position.y);var aabb=new b2AABB();aabb.minVertex.Set(lowerX-this.m_radius,lowerY-this.m_radius);aabb.maxVertex.Set(upperX+this.m_radius,upperY+this.m_radius);var broadPhase=this.m_body.m_world.m_broadPhase;if(broadPhase.InRange(aabb))
+{broadPhase.MoveProxy(this.m_proxyId,aabb);}
+else
+{this.m_body.Freeze();}},QuickSync:function(position,R){this.m_R.SetM(R);this.m_position.x=(R.col1.x*this.m_localPosition.x+R.col2.x*this.m_localPosition.y)+position.x;this.m_position.y=(R.col1.y*this.m_localPosition.x+R.col2.y*this.m_localPosition.y)+position.y;},ResetProxy:function(broadPhase)
+{if(this.m_proxyId==b2Pair.b2_nullProxy)
+{return;}
+var proxy=broadPhase.GetProxy(this.m_proxyId);broadPhase.DestroyProxy(this.m_proxyId);proxy=null;var aabb=new b2AABB();aabb.minVertex.Set(this.m_position.x-this.m_radius,this.m_position.y-this.m_radius);aabb.maxVertex.Set(this.m_position.x+this.m_radius,this.m_position.y+this.m_radius);if(broadPhase.InRange(aabb))
+{this.m_proxyId=broadPhase.CreateProxy(aabb,this);}
+else
+{this.m_proxyId=b2Pair.b2_nullProxy;}
+if(this.m_proxyId==b2Pair.b2_nullProxy)
+{this.m_body.Freeze();}},Support:function(dX,dY,out)
+{var len=Math.sqrt(dX*dX+dY*dY);dX/=len;dY/=len;out.Set(this.m_position.x+this.m_radius*dX,this.m_position.y+this.m_radius*dY);},m_localPosition:new b2Vec2(),m_radius:null});
+var b2MassData=Class.create();b2MassData.prototype={mass:0.0,center:new b2Vec2(0,0),I:0.0,initialize:function(){this.center=new b2Vec2(0,0);}}
+
+var b2PolyDef=Class.create();Object.extend(b2PolyDef.prototype,b2ShapeDef.prototype);Object.extend(b2PolyDef.prototype,{initialize:function()
+{this.type=b2Shape.e_unknownShape;this.userData=null;this.localPosition=new b2Vec2(0.0,0.0);this.localRotation=0.0;this.friction=0.2;this.restitution=0.0;this.density=0.0;this.categoryBits=0x0001;this.maskBits=0xFFFF;this.groupIndex=0;this.vertices=new Array(b2Settings.b2_maxPolyVertices);this.type=b2Shape.e_polyShape;this.vertexCount=0;for(var i=0;i<b2Settings.b2_maxPolyVertices;i++){this.vertices[i]=new b2Vec2();}},vertices:new Array(b2Settings.b2_maxPolyVertices),vertexCount:0});var b2PolyShape=Class.create();Object.extend(b2PolyShape.prototype,b2Shape.prototype);Object.extend(b2PolyShape.prototype,{TestPoint:function(p){var pLocal=new b2Vec2();pLocal.SetV(p);pLocal.Subtract(this.m_position);pLocal.MulTM(this.m_R);for(var i=0;i<this.m_vertexCount;++i)
+{var tVec=new b2Vec2();tVec.SetV(pLocal);tVec.Subtract(this.m_vertices[i]);var dot=b2Math.b2Dot(this.m_normals[i],tVec);if(dot>0.0)
+{return false;}}
+return true;},initialize:function(def,body,newOrigin){this.m_R=new b2Mat22();this.m_position=new b2Vec2();this.m_userData=def.userData;this.m_friction=def.friction;this.m_restitution=def.restitution;this.m_body=body;this.m_proxyId=b2Pair.b2_nullProxy;this.m_maxRadius=0.0;this.m_categoryBits=def.categoryBits;this.m_maskBits=def.maskBits;this.m_groupIndex=def.groupIndex;this.syncAABB=new b2AABB();this.syncMat=new b2Mat22();this.m_localCentroid=new b2Vec2();this.m_localOBB=new b2OBB();var i=0;var hX;var hY;var tVec;var aabb=new b2AABB();this.m_vertices=new Array(b2Settings.b2_maxPolyVertices);this.m_coreVertices=new Array(b2Settings.b2_maxPolyVertices);this.m_normals=new Array(b2Settings.b2_maxPolyVertices);this.m_type=b2Shape.e_polyShape;var localR=new b2Mat22(def.localRotation);if(def.type==b2Shape.e_boxShape)
+{this.m_localCentroid.x=def.localPosition.x-newOrigin.x;this.m_localCentroid.y=def.localPosition.y-newOrigin.y;var box=def;this.m_vertexCount=4;hX=box.extents.x;hY=box.extents.y;var hcX=Math.max(0.0,hX-2.0*b2Settings.b2_linearSlop);var hcY=Math.max(0.0,hY-2.0*b2Settings.b2_linearSlop);tVec=this.m_vertices[0]=new b2Vec2();tVec.x=localR.col1.x*hX+localR.col2.x*hY;tVec.y=localR.col1.y*hX+localR.col2.y*hY;tVec=this.m_vertices[1]=new b2Vec2();tVec.x=localR.col1.x*-hX+localR.col2.x*hY;tVec.y=localR.col1.y*-hX+localR.col2.y*hY;tVec=this.m_vertices[2]=new b2Vec2();tVec.x=localR.col1.x*-hX+localR.col2.x*-hY;tVec.y=localR.col1.y*-hX+localR.col2.y*-hY;tVec=this.m_vertices[3]=new b2Vec2();tVec.x=localR.col1.x*hX+localR.col2.x*-hY;tVec.y=localR.col1.y*hX+localR.col2.y*-hY;tVec=this.m_coreVertices[0]=new b2Vec2();tVec.x=localR.col1.x*hcX+localR.col2.x*hcY;tVec.y=localR.col1.y*hcX+localR.col2.y*hcY;tVec=this.m_coreVertices[1]=new b2Vec2();tVec.x=localR.col1.x*-hcX+localR.col2.x*hcY;tVec.y=localR.col1.y*-hcX+localR.col2.y*hcY;tVec=this.m_coreVertices[2]=new b2Vec2();tVec.x=localR.col1.x*-hcX+localR.col2.x*-hcY;tVec.y=localR.col1.y*-hcX+localR.col2.y*-hcY;tVec=this.m_coreVertices[3]=new b2Vec2();tVec.x=localR.col1.x*hcX+localR.col2.x*-hcY;tVec.y=localR.col1.y*hcX+localR.col2.y*-hcY;}
+else
+{var poly=def;this.m_vertexCount=poly.vertexCount;b2Shape.PolyCentroid(poly.vertices,poly.vertexCount,b2PolyShape.tempVec);var centroidX=b2PolyShape.tempVec.x;var centroidY=b2PolyShape.tempVec.y;this.m_localCentroid.x=def.localPosition.x+(localR.col1.x*centroidX+localR.col2.x*centroidY)-newOrigin.x;this.m_localCentroid.y=def.localPosition.y+(localR.col1.y*centroidX+localR.col2.y*centroidY)-newOrigin.y;for(i=0;i<this.m_vertexCount;++i)
+{this.m_vertices[i]=new b2Vec2();this.m_coreVertices[i]=new b2Vec2();hX=poly.vertices[i].x-centroidX;hY=poly.vertices[i].y-centroidY;this.m_vertices[i].x=localR.col1.x*hX+localR.col2.x*hY;this.m_vertices[i].y=localR.col1.y*hX+localR.col2.y*hY;var uX=this.m_vertices[i].x;var uY=this.m_vertices[i].y;var length=Math.sqrt(uX*uX+uY*uY);if(length>Number.MIN_VALUE)
+{uX*=1.0/length;uY*=1.0/length;}
+this.m_coreVertices[i].x=this.m_vertices[i].x-2.0*b2Settings.b2_linearSlop*uX;this.m_coreVertices[i].y=this.m_vertices[i].y-2.0*b2Settings.b2_linearSlop*uY;}}
+var minVertexX=Number.MAX_VALUE;var minVertexY=Number.MAX_VALUE;var maxVertexX=-Number.MAX_VALUE;var maxVertexY=-Number.MAX_VALUE;this.m_maxRadius=0.0;for(i=0;i<this.m_vertexCount;++i)
+{var v=this.m_vertices[i];minVertexX=Math.min(minVertexX,v.x);minVertexY=Math.min(minVertexY,v.y);maxVertexX=Math.max(maxVertexX,v.x);maxVertexY=Math.max(maxVertexY,v.y);this.m_maxRadius=Math.max(this.m_maxRadius,v.Length());}
+this.m_localOBB.R.SetIdentity();this.m_localOBB.center.Set((minVertexX+maxVertexX)*0.5,(minVertexY+maxVertexY)*0.5);this.m_localOBB.extents.Set((maxVertexX-minVertexX)*0.5,(maxVertexY-minVertexY)*0.5);var i1=0;var i2=0;for(i=0;i<this.m_vertexCount;++i)
+{this.m_normals[i]=new b2Vec2();i1=i;i2=i+1<this.m_vertexCount?i+1:0;this.m_normals[i].x=this.m_vertices[i2].y-this.m_vertices[i1].y;this.m_normals[i].y=-(this.m_vertices[i2].x-this.m_vertices[i1].x);this.m_normals[i].Normalize();}
+for(i=0;i<this.m_vertexCount;++i)
+{i1=i;i2=i+1<this.m_vertexCount?i+1:0;}
+this.m_R.SetM(this.m_body.m_R);this.m_position.x=this.m_body.m_position.x+(this.m_R.col1.x*this.m_localCentroid.x+this.m_R.col2.x*this.m_localCentroid.y);this.m_position.y=this.m_body.m_position.y+(this.m_R.col1.y*this.m_localCentroid.x+this.m_R.col2.y*this.m_localCentroid.y);b2PolyShape.tAbsR.col1.x=this.m_R.col1.x*this.m_localOBB.R.col1.x+this.m_R.col2.x*this.m_localOBB.R.col1.y;b2PolyShape.tAbsR.col1.y=this.m_R.col1.y*this.m_localOBB.R.col1.x+this.m_R.col2.y*this.m_localOBB.R.col1.y;b2PolyShape.tAbsR.col2.x=this.m_R.col1.x*this.m_localOBB.R.col2.x+this.m_R.col2.x*this.m_localOBB.R.col2.y;b2PolyShape.tAbsR.col2.y=this.m_R.col1.y*this.m_localOBB.R.col2.x+this.m_R.col2.y*this.m_localOBB.R.col2.y;b2PolyShape.tAbsR.Abs()
+hX=b2PolyShape.tAbsR.col1.x*this.m_localOBB.extents.x+b2PolyShape.tAbsR.col2.x*this.m_localOBB.extents.y;hY=b2PolyShape.tAbsR.col1.y*this.m_localOBB.extents.x+b2PolyShape.tAbsR.col2.y*this.m_localOBB.extents.y;var positionX=this.m_position.x+(this.m_R.col1.x*this.m_localOBB.center.x+this.m_R.col2.x*this.m_localOBB.center.y);var positionY=this.m_position.y+(this.m_R.col1.y*this.m_localOBB.center.x+this.m_R.col2.y*this.m_localOBB.center.y);aabb.minVertex.x=positionX-hX;aabb.minVertex.y=positionY-hY;aabb.maxVertex.x=positionX+hX;aabb.maxVertex.y=positionY+hY;var broadPhase=this.m_body.m_world.m_broadPhase;if(broadPhase.InRange(aabb))
+{this.m_proxyId=broadPhase.CreateProxy(aabb,this);}
+else
+{this.m_proxyId=b2Pair.b2_nullProxy;}
+if(this.m_proxyId==b2Pair.b2_nullProxy)
+{this.m_body.Freeze();}},syncAABB:new b2AABB(),syncMat:new b2Mat22(),Synchronize:function(position1,R1,position2,R2){this.m_R.SetM(R2);this.m_position.x=this.m_body.m_position.x+(R2.col1.x*this.m_localCentroid.x+R2.col2.x*this.m_localCentroid.y);this.m_position.y=this.m_body.m_position.y+(R2.col1.y*this.m_localCentroid.x+R2.col2.y*this.m_localCentroid.y);if(this.m_proxyId==b2Pair.b2_nullProxy)
+{return;}
+var hX;var hY;var v1=R1.col1;var v2=R1.col2;var v3=this.m_localOBB.R.col1;var v4=this.m_localOBB.R.col2;this.syncMat.col1.x=v1.x*v3.x+v2.x*v3.y;this.syncMat.col1.y=v1.y*v3.x+v2.y*v3.y;this.syncMat.col2.x=v1.x*v4.x+v2.x*v4.y;this.syncMat.col2.y=v1.y*v4.x+v2.y*v4.y;this.syncMat.Abs();hX=this.m_localCentroid.x+this.m_localOBB.center.x;hY=this.m_localCentroid.y+this.m_localOBB.center.y;var centerX=position1.x+(R1.col1.x*hX+R1.col2.x*hY);var centerY=position1.y+(R1.col1.y*hX+R1.col2.y*hY);hX=this.syncMat.col1.x*this.m_localOBB.extents.x+this.syncMat.col2.x*this.m_localOBB.extents.y;hY=this.syncMat.col1.y*this.m_localOBB.extents.x+this.syncMat.col2.y*this.m_localOBB.extents.y;this.syncAABB.minVertex.x=centerX-hX;this.syncAABB.minVertex.y=centerY-hY;this.syncAABB.maxVertex.x=centerX+hX;this.syncAABB.maxVertex.y=centerY+hY;v1=R2.col1;v2=R2.col2;v3=this.m_localOBB.R.col1;v4=this.m_localOBB.R.col2;this.syncMat.col1.x=v1.x*v3.x+v2.x*v3.y;this.syncMat.col1.y=v1.y*v3.x+v2.y*v3.y;this.syncMat.col2.x=v1.x*v4.x+v2.x*v4.y;this.syncMat.col2.y=v1.y*v4.x+v2.y*v4.y;this.syncMat.Abs();hX=this.m_localCentroid.x+this.m_localOBB.center.x;hY=this.m_localCentroid.y+this.m_localOBB.center.y;centerX=position2.x+(R2.col1.x*hX+R2.col2.x*hY);centerY=position2.y+(R2.col1.y*hX+R2.col2.y*hY);hX=this.syncMat.col1.x*this.m_localOBB.extents.x+this.syncMat.col2.x*this.m_localOBB.extents.y;hY=this.syncMat.col1.y*this.m_localOBB.extents.x+this.syncMat.col2.y*this.m_localOBB.extents.y;this.syncAABB.minVertex.x=Math.min(this.syncAABB.minVertex.x,centerX-hX);this.syncAABB.minVertex.y=Math.min(this.syncAABB.minVertex.y,centerY-hY);this.syncAABB.maxVertex.x=Math.max(this.syncAABB.maxVertex.x,centerX+hX);this.syncAABB.maxVertex.y=Math.max(this.syncAABB.maxVertex.y,centerY+hY);var broadPhase=this.m_body.m_world.m_broadPhase;if(broadPhase.InRange(this.syncAABB))
+{broadPhase.MoveProxy(this.m_proxyId,this.syncAABB);}
+else
+{this.m_body.Freeze();}},QuickSync:function(position,R){this.m_R.SetM(R);this.m_position.x=position.x+(R.col1.x*this.m_localCentroid.x+R.col2.x*this.m_localCentroid.y);this.m_position.y=position.y+(R.col1.y*this.m_localCentroid.x+R.col2.y*this.m_localCentroid.y);},ResetProxy:function(broadPhase){if(this.m_proxyId==b2Pair.b2_nullProxy)
+{return;}
+var proxy=broadPhase.GetProxy(this.m_proxyId);broadPhase.DestroyProxy(this.m_proxyId);proxy=null;var R=b2Math.b2MulMM(this.m_R,this.m_localOBB.R);var absR=b2Math.b2AbsM(R);var h=b2Math.b2MulMV(absR,this.m_localOBB.extents);var position=b2Math.b2MulMV(this.m_R,this.m_localOBB.center);position.Add(this.m_position);var aabb=new b2AABB();aabb.minVertex.SetV(position);aabb.minVertex.Subtract(h);aabb.maxVertex.SetV(position);aabb.maxVertex.Add(h);if(broadPhase.InRange(aabb))
+{this.m_proxyId=broadPhase.CreateProxy(aabb,this);}
+else
+{this.m_proxyId=b2Pair.b2_nullProxy;}
+if(this.m_proxyId==b2Pair.b2_nullProxy)
+{this.m_body.Freeze();}},Support:function(dX,dY,out)
+{var dLocalX=(dX*this.m_R.col1.x+dY*this.m_R.col1.y);var dLocalY=(dX*this.m_R.col2.x+dY*this.m_R.col2.y);var bestIndex=0;var bestValue=(this.m_coreVertices[0].x*dLocalX+this.m_coreVertices[0].y*dLocalY);for(var i=1;i<this.m_vertexCount;++i)
+{var value=(this.m_coreVertices[i].x*dLocalX+this.m_coreVertices[i].y*dLocalY);if(value>bestValue)
+{bestIndex=i;bestValue=value;}}
+out.Set(this.m_position.x+(this.m_R.col1.x*this.m_coreVertices[bestIndex].x+this.m_R.col2.x*this.m_coreVertices[bestIndex].y),this.m_position.y+(this.m_R.col1.y*this.m_coreVertices[bestIndex].x+this.m_R.col2.y*this.m_coreVertices[bestIndex].y));},m_localCentroid:new b2Vec2(),m_localOBB:new b2OBB(),m_vertices:null,m_coreVertices:null,m_vertexCount:0,m_normals:null});b2PolyShape.tempVec=new b2Vec2();b2PolyShape.tAbsR=new b2Mat22();
+var b2Body=Class.create();b2Body.prototype={SetOriginPosition:function(position,rotation){if(this.IsFrozen())
+{return;}
+this.m_rotation=rotation;this.m_R.Set(this.m_rotation);this.m_position=b2Math.AddVV(position,b2Math.b2MulMV(this.m_R,this.m_center));this.m_position0.SetV(this.m_position);this.m_rotation0=this.m_rotation;for(var s=this.m_shapeList;s!=null;s=s.m_next)
+{s.Synchronize(this.m_position,this.m_R,this.m_position,this.m_R);}
+this.m_world.m_broadPhase.Commit();},GetOriginPosition:function(){return b2Math.SubtractVV(this.m_position,b2Math.b2MulMV(this.m_R,this.m_center));},SetCenterPosition:function(position,rotation){if(this.IsFrozen())
+{return;}
+this.m_rotation=rotation;this.m_R.Set(this.m_rotation);this.m_position.SetV(position);this.m_position0.SetV(this.m_position);this.m_rotation0=this.m_rotation;for(var s=this.m_shapeList;s!=null;s=s.m_next)
+{s.Synchronize(this.m_position,this.m_R,this.m_position,this.m_R);}
+this.m_world.m_broadPhase.Commit();},GetCenterPosition:function(){return this.m_position;},GetRotation:function(){return this.m_rotation;},GetRotationMatrix:function(){return this.m_R;},SetLinearVelocity:function(v){this.m_linearVelocity.SetV(v);},GetLinearVelocity:function(){return this.m_linearVelocity;},SetAngularVelocity:function(w){this.m_angularVelocity=w;},GetAngularVelocity:function(){return this.m_angularVelocity;},ApplyForce:function(force,point)
+{if(this.IsSleeping()==false)
+{this.m_force.Add(force);this.m_torque+=b2Math.b2CrossVV(b2Math.SubtractVV(point,this.m_position),force);}},ApplyTorque:function(torque)
+{if(this.IsSleeping()==false)
+{this.m_torque+=torque;}},ApplyImpulse:function(impulse,point)
+{if(this.IsSleeping()==false)
+{this.m_linearVelocity.Add(b2Math.MulFV(this.m_invMass,impulse));this.m_angularVelocity+=(this.m_invI*b2Math.b2CrossVV(b2Math.SubtractVV(point,this.m_position),impulse));}},GetMass:function(){return this.m_mass;},GetInertia:function(){return this.m_I;},GetWorldPoint:function(localPoint){return b2Math.AddVV(this.m_position,b2Math.b2MulMV(this.m_R,localPoint));},GetWorldVector:function(localVector){return b2Math.b2MulMV(this.m_R,localVector);},GetLocalPoint:function(worldPoint){return b2Math.b2MulTMV(this.m_R,b2Math.SubtractVV(worldPoint,this.m_position));},GetLocalVector:function(worldVector){return b2Math.b2MulTMV(this.m_R,worldVector);},IsStatic:function(){return(this.m_flags&b2Body.e_staticFlag)==b2Body.e_staticFlag;},IsFrozen:function()
+{return(this.m_flags&b2Body.e_frozenFlag)==b2Body.e_frozenFlag;},IsSleeping:function(){return(this.m_flags&b2Body.e_sleepFlag)==b2Body.e_sleepFlag;},AllowSleeping:function(flag)
+{if(flag)
+{this.m_flags|=b2Body.e_allowSleepFlag;}
+else
+{this.m_flags&=~b2Body.e_allowSleepFlag;this.WakeUp();}},WakeUp:function(){this.m_flags&=~b2Body.e_sleepFlag;this.m_sleepTime=0.0;},GetShapeList:function(){return this.m_shapeList;},GetContactList:function()
+{return this.m_contactList;},GetJointList:function()
+{return this.m_jointList;},GetNext:function(){return this.m_next;},GetUserData:function(){return this.m_userData;},initialize:function(bd,world){this.sMat0=new b2Mat22();this.m_position=new b2Vec2();this.m_R=new b2Mat22(0);this.m_position0=new b2Vec2();var i=0;var sd;var massData;this.m_flags=0;this.m_position.SetV(bd.position);this.m_rotation=bd.rotation;this.m_R.Set(this.m_rotation);this.m_position0.SetV(this.m_position);this.m_rotation0=this.m_rotation;this.m_world=world;this.m_linearDamping=b2Math.b2Clamp(1.0-bd.linearDamping,0.0,1.0);this.m_angularDamping=b2Math.b2Clamp(1.0-bd.angularDamping,0.0,1.0);this.m_force=new b2Vec2(0.0,0.0);this.m_torque=0.0;this.m_mass=0.0;var massDatas=new Array(b2Settings.b2_maxShapesPerBody);for(i=0;i<b2Settings.b2_maxShapesPerBody;i++){massDatas[i]=new b2MassData();}
+this.m_shapeCount=0;this.m_center=new b2Vec2(0.0,0.0);for(i=0;i<b2Settings.b2_maxShapesPerBody;++i)
+{sd=bd.shapes[i];if(sd==null)break;massData=massDatas[i];sd.ComputeMass(massData);this.m_mass+=massData.mass;this.m_center.x+=massData.mass*(sd.localPosition.x+massData.center.x);this.m_center.y+=massData.mass*(sd.localPosition.y+massData.center.y);++this.m_shapeCount;}
+if(this.m_mass>0.0)
+{this.m_center.Multiply(1.0/this.m_mass);this.m_position.Add(b2Math.b2MulMV(this.m_R,this.m_center));}
+else
+{this.m_flags|=b2Body.e_staticFlag;}
+this.m_I=0.0;for(i=0;i<this.m_shapeCount;++i)
+{sd=bd.shapes[i];massData=massDatas[i];this.m_I+=massData.I;var r=b2Math.SubtractVV(b2Math.AddVV(sd.localPosition,massData.center),this.m_center);this.m_I+=massData.mass*b2Math.b2Dot(r,r);}
+if(this.m_mass>0.0)
+{this.m_invMass=1.0/this.m_mass;}
+else
+{this.m_invMass=0.0;}
+if(this.m_I>0.0&&bd.preventRotation==false)
+{this.m_invI=1.0/this.m_I;}
+else
+{this.m_I=0.0;this.m_invI=0.0;}
+this.m_linearVelocity=b2Math.AddVV(bd.linearVelocity,b2Math.b2CrossFV(bd.angularVelocity,this.m_center));this.m_angularVelocity=bd.angularVelocity;this.m_jointList=null;this.m_contactList=null;this.m_prev=null;this.m_next=null;this.m_shapeList=null;for(i=0;i<this.m_shapeCount;++i)
+{sd=bd.shapes[i];var shape=b2Shape.Create(sd,this,this.m_center);shape.m_next=this.m_shapeList;this.m_shapeList=shape;}
+this.m_sleepTime=0.0;if(bd.allowSleep)
+{this.m_flags|=b2Body.e_allowSleepFlag;}
+if(bd.isSleeping)
+{this.m_flags|=b2Body.e_sleepFlag;}
+if((this.m_flags&b2Body.e_sleepFlag)||this.m_invMass==0.0)
+{this.m_linearVelocity.Set(0.0,0.0);this.m_angularVelocity=0.0;}
+this.m_userData=bd.userData;},Destroy:function(){var s=this.m_shapeList;while(s)
+{var s0=s;s=s.m_next;b2Shape.Destroy(s0);}},sMat0:new b2Mat22(),SynchronizeShapes:function(){this.sMat0.Set(this.m_rotation0);for(var s=this.m_shapeList;s!=null;s=s.m_next)
+{s.Synchronize(this.m_position0,this.sMat0,this.m_position,this.m_R);}},QuickSyncShapes:function(){for(var s=this.m_shapeList;s!=null;s=s.m_next)
+{s.QuickSync(this.m_position,this.m_R);}},IsConnected:function(other){for(var jn=this.m_jointList;jn!=null;jn=jn.next)
+{if(jn.other==other)
+return jn.joint.m_collideConnected==false;}
+return false;},Freeze:function(){this.m_flags|=b2Body.e_frozenFlag;this.m_linearVelocity.SetZero();this.m_angularVelocity=0.0;for(var s=this.m_shapeList;s!=null;s=s.m_next)
+{s.DestroyProxy();}},m_flags:0,m_position:new b2Vec2(),m_rotation:null,m_R:new b2Mat22(0),m_position0:new b2Vec2(),m_rotation0:null,m_linearVelocity:null,m_angularVelocity:null,m_force:null,m_torque:null,m_center:null,m_world:null,m_prev:null,m_next:null,m_shapeList:null,m_shapeCount:0,m_jointList:null,m_contactList:null,m_mass:null,m_invMass:null,m_I:null,m_invI:null,m_linearDamping:null,m_angularDamping:null,m_sleepTime:null,m_userData:null};b2Body.e_staticFlag=0x0001;b2Body.e_frozenFlag=0x0002;b2Body.e_islandFlag=0x0004;b2Body.e_sleepFlag=0x0008;b2Body.e_allowSleepFlag=0x0010;b2Body.e_destroyFlag=0x0020;
+var b2BodyDef=Class.create();b2BodyDef.prototype={initialize:function()
+{this.shapes=new Array();this.userData=null;for(var i=0;i<b2Settings.b2_maxShapesPerBody;i++){this.shapes[i]=null;}
+this.position=new b2Vec2(0.0,0.0);this.rotation=0.0;this.linearVelocity=new b2Vec2(0.0,0.0);this.angularVelocity=0.0;this.linearDamping=0.0;this.angularDamping=0.0;this.allowSleep=true;this.isSleeping=false;this.preventRotation=false;},userData:null,shapes:new Array(),position:null,rotation:null,linearVelocity:null,angularVelocity:null,linearDamping:null,angularDamping:null,allowSleep:null,isSleeping:null,preventRotation:null,AddShape:function(shape)
+{for(var i=0;i<b2Settings.b2_maxShapesPerBody;++i)
+{if(this.shapes[i]==null)
+{this.shapes[i]=shape;break;}}}};
+var b2CollisionFilter=Class.create();b2CollisionFilter.prototype={ShouldCollide:function(shape1,shape2){if(shape1.m_groupIndex==shape2.m_groupIndex&&shape1.m_groupIndex!=0)
+{return shape1.m_groupIndex>0;}
+var collide=(shape1.m_maskBits&shape2.m_categoryBits)!=0&&(shape1.m_categoryBits&shape2.m_maskBits)!=0;return collide;},initialize:function(){}};b2CollisionFilter.b2_defaultFilter=new b2CollisionFilter;
+var b2Island=Class.create();b2Island.prototype={initialize:function(bodyCapacity,contactCapacity,jointCapacity,allocator)
+{var i=0;this.m_bodyCapacity=bodyCapacity;this.m_contactCapacity=contactCapacity;this.m_jointCapacity=jointCapacity;this.m_bodyCount=0;this.m_contactCount=0;this.m_jointCount=0;this.m_bodies=new Array(bodyCapacity);for(i=0;i<bodyCapacity;i++)
+this.m_bodies[i]=null;this.m_contacts=new Array(contactCapacity);for(i=0;i<contactCapacity;i++)
+this.m_contacts[i]=null;this.m_joints=new Array(jointCapacity);for(i=0;i<jointCapacity;i++)
+this.m_joints[i]=null;this.m_allocator=allocator;},Clear:function()
+{this.m_bodyCount=0;this.m_contactCount=0;this.m_jointCount=0;},Solve:function(step,gravity)
+{var i=0;var b;for(i=0;i<this.m_bodyCount;++i)
+{b=this.m_bodies[i];if(b.m_invMass==0.0)
+continue;b.m_linearVelocity.Add(b2Math.MulFV(step.dt,b2Math.AddVV(gravity,b2Math.MulFV(b.m_invMass,b.m_force))));b.m_angularVelocity+=step.dt*b.m_invI*b.m_torque;b.m_linearVelocity.Multiply(b.m_linearDamping);b.m_angularVelocity*=b.m_angularDamping;b.m_position0.SetV(b.m_position);b.m_rotation0=b.m_rotation;}
+var contactSolver=new b2ContactSolver(this.m_contacts,this.m_contactCount,this.m_allocator);contactSolver.PreSolve();for(i=0;i<this.m_jointCount;++i)
+{this.m_joints[i].PrepareVelocitySolver();}
+for(i=0;i<step.iterations;++i)
+{contactSolver.SolveVelocityConstraints();for(var j=0;j<this.m_jointCount;++j)
+{this.m_joints[j].SolveVelocityConstraints(step);}}
+for(i=0;i<this.m_bodyCount;++i)
+{b=this.m_bodies[i];if(b.m_invMass==0.0)
+continue;b.m_position.x+=step.dt*b.m_linearVelocity.x;b.m_position.y+=step.dt*b.m_linearVelocity.y;b.m_rotation+=step.dt*b.m_angularVelocity;b.m_R.Set(b.m_rotation);}
+for(i=0;i<this.m_jointCount;++i)
+{this.m_joints[i].PreparePositionSolver();}
+if(b2World.s_enablePositionCorrection)
+{for(b2Island.m_positionIterationCount=0;b2Island.m_positionIterationCount<step.iterations;++b2Island.m_positionIterationCount)
+{var contactsOkay=contactSolver.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);var jointsOkay=true;for(i=0;i<this.m_jointCount;++i)
+{var jointOkay=this.m_joints[i].SolvePositionConstraints();jointsOkay=jointsOkay&&jointOkay;}
+if(contactsOkay&&jointsOkay)
+{break;}}}
+contactSolver.PostSolve();for(i=0;i<this.m_bodyCount;++i)
+{b=this.m_bodies[i];if(b.m_invMass==0.0)
+continue;b.m_R.Set(b.m_rotation);b.SynchronizeShapes();b.m_force.Set(0.0,0.0);b.m_torque=0.0;}},UpdateSleep:function(dt)
+{var i=0;var b;var minSleepTime=Number.MAX_VALUE;var linTolSqr=b2Settings.b2_linearSleepTolerance*b2Settings.b2_linearSleepTolerance;var angTolSqr=b2Settings.b2_angularSleepTolerance*b2Settings.b2_angularSleepTolerance;for(i=0;i<this.m_bodyCount;++i)
+{b=this.m_bodies[i];if(b.m_invMass==0.0)
+{continue;}
+if((b.m_flags&b2Body.e_allowSleepFlag)==0)
+{b.m_sleepTime=0.0;minSleepTime=0.0;}
+if((b.m_flags&b2Body.e_allowSleepFlag)==0||b.m_angularVelocity*b.m_angularVelocity>angTolSqr||b2Math.b2Dot(b.m_linearVelocity,b.m_linearVelocity)>linTolSqr)
+{b.m_sleepTime=0.0;minSleepTime=0.0;}
+else
+{b.m_sleepTime+=dt;minSleepTime=b2Math.b2Min(minSleepTime,b.m_sleepTime);}}
+if(minSleepTime>=b2Settings.b2_timeToSleep)
+{for(i=0;i<this.m_bodyCount;++i)
+{b=this.m_bodies[i];b.m_flags|=b2Body.e_sleepFlag;}}},AddBody:function(body)
+{this.m_bodies[this.m_bodyCount++]=body;},AddContact:function(contact)
+{this.m_contacts[this.m_contactCount++]=contact;},AddJoint:function(joint)
+{this.m_joints[this.m_jointCount++]=joint;},m_allocator:null,m_bodies:null,m_contacts:null,m_joints:null,m_bodyCount:0,m_jointCount:0,m_contactCount:0,m_bodyCapacity:0,m_contactCapacity:0,m_jointCapacity:0,m_positionError:null};b2Island.m_positionIterationCount=0;
+var b2TimeStep=Class.create();b2TimeStep.prototype={dt:null,inv_dt:null,iterations:0,initialize:function(){}};
+var b2ContactNode=Class.create();b2ContactNode.prototype={other:null,contact:null,prev:null,next:null,initialize:function(){}};
+var b2Contact=Class.create();b2Contact.prototype={GetManifolds:function(){return null},GetManifoldCount:function()
+{return this.m_manifoldCount;},GetNext:function(){return this.m_next;},GetShape1:function(){return this.m_shape1;},GetShape2:function(){return this.m_shape2;},initialize:function(s1,s2)
+{this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!s1||!s2){this.m_shape1=null;this.m_shape2=null;return;}
+this.m_shape1=s1;this.m_shape2=s2;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;},Evaluate:function(){},m_flags:0,m_prev:null,m_next:null,m_node1:new b2ContactNode(),m_node2:new b2ContactNode(),m_shape1:null,m_shape2:null,m_manifoldCount:0,m_friction:null,m_restitution:null};b2Contact.e_islandFlag=0x0001;b2Contact.e_destroyFlag=0x0002;b2Contact.AddType=function(createFcn,destroyFcn,type1,type2)
+{b2Contact.s_registers[type1][type2].createFcn=createFcn;b2Contact.s_registers[type1][type2].destroyFcn=destroyFcn;b2Contact.s_registers[type1][type2].primary=true;if(type1!=type2)
+{b2Contact.s_registers[type2][type1].createFcn=createFcn;b2Contact.s_registers[type2][type1].destroyFcn=destroyFcn;b2Contact.s_registers[type2][type1].primary=false;}};b2Contact.InitializeRegisters=function(){b2Contact.s_registers=new Array(b2Shape.e_shapeTypeCount);for(var i=0;i<b2Shape.e_shapeTypeCount;i++){b2Contact.s_registers[i]=new Array(b2Shape.e_shapeTypeCount);for(var j=0;j<b2Shape.e_shapeTypeCount;j++){b2Contact.s_registers[i][j]=new b2ContactRegister();}}
+b2Contact.AddType(b2CircleContact.Create,b2CircleContact.Destroy,b2Shape.e_circleShape,b2Shape.e_circleShape);b2Contact.AddType(b2PolyAndCircleContact.Create,b2PolyAndCircleContact.Destroy,b2Shape.e_polyShape,b2Shape.e_circleShape);b2Contact.AddType(b2PolyContact.Create,b2PolyContact.Destroy,b2Shape.e_polyShape,b2Shape.e_polyShape);};b2Contact.Create=function(shape1,shape2,allocator){if(b2Contact.s_initialized==false)
+{b2Contact.InitializeRegisters();b2Contact.s_initialized=true;}
+var type1=shape1.m_type;var type2=shape2.m_type;var createFcn=b2Contact.s_registers[type1][type2].createFcn;if(createFcn)
+{if(b2Contact.s_registers[type1][type2].primary)
+{return createFcn(shape1,shape2,allocator);}
+else
+{var c=createFcn(shape2,shape1,allocator);for(var i=0;i<c.GetManifoldCount();++i)
+{var m=c.GetManifolds()[i];m.normal=m.normal.Negative();}
+return c;}}
+else
+{return null;}};b2Contact.Destroy=function(contact,allocator){if(contact.GetManifoldCount()>0)
+{contact.m_shape1.m_body.WakeUp();contact.m_shape2.m_body.WakeUp();}
+var type1=contact.m_shape1.m_type;var type2=contact.m_shape2.m_type;var destroyFcn=b2Contact.s_registers[type1][type2].destroyFcn;destroyFcn(contact,allocator);};b2Contact.s_registers=null;b2Contact.s_initialized=false;
+var b2ContactConstraint=Class.create();b2ContactConstraint.prototype={initialize:function(){this.normal=new b2Vec2();this.points=new Array(b2Settings.b2_maxManifoldPoints);for(var i=0;i<b2Settings.b2_maxManifoldPoints;i++){this.points[i]=new b2ContactConstraintPoint();}},points:null,normal:new b2Vec2(),manifold:null,body1:null,body2:null,friction:null,restitution:null,pointCount:0};
+var b2ContactConstraintPoint=Class.create();b2ContactConstraintPoint.prototype={localAnchor1:new b2Vec2(),localAnchor2:new b2Vec2(),normalImpulse:null,tangentImpulse:null,positionImpulse:null,normalMass:null,tangentMass:null,separation:null,velocityBias:null,initialize:function(){this.localAnchor1=new b2Vec2();this.localAnchor2=new b2Vec2();}};
+var b2ContactRegister=Class.create();b2ContactRegister.prototype={createFcn:null,destroyFcn:null,primary:null,initialize:function(){}};
+var b2ContactSolver=Class.create();b2ContactSolver.prototype={initialize:function(contacts,contactCount,allocator){this.m_constraints=new Array();this.m_allocator=allocator;var i=0;var tVec;var tMat;this.m_constraintCount=0;for(i=0;i<contactCount;++i)
+{this.m_constraintCount+=contacts[i].GetManifoldCount();}
+for(i=0;i<this.m_constraintCount;i++){this.m_constraints[i]=new b2ContactConstraint();}
+var count=0;for(i=0;i<contactCount;++i)
+{var contact=contacts[i];var b1=contact.m_shape1.m_body;var b2=contact.m_shape2.m_body;var manifoldCount=contact.GetManifoldCount();var manifolds=contact.GetManifolds();var friction=contact.m_friction;var restitution=contact.m_restitution;var v1X=b1.m_linearVelocity.x;var v1Y=b1.m_linearVelocity.y;var v2X=b2.m_linearVelocity.x;var v2Y=b2.m_linearVelocity.y;var w1=b1.m_angularVelocity;var w2=b2.m_angularVelocity;for(var j=0;j<manifoldCount;++j)
+{var manifold=manifolds[j];var normalX=manifold.normal.x;var normalY=manifold.normal.y;var c=this.m_constraints[count];c.body1=b1;c.body2=b2;c.manifold=manifold;c.normal.x=normalX;c.normal.y=normalY;c.pointCount=manifold.pointCount;c.friction=friction;c.restitution=restitution;for(var k=0;k<c.pointCount;++k)
+{var cp=manifold.points[k];var ccp=c.points[k];ccp.normalImpulse=cp.normalImpulse;ccp.tangentImpulse=cp.tangentImpulse;ccp.separation=cp.separation;var r1X=cp.position.x-b1.m_position.x;var r1Y=cp.position.y-b1.m_position.y;var r2X=cp.position.x-b2.m_position.x;var r2Y=cp.position.y-b2.m_position.y;tVec=ccp.localAnchor1;tMat=b1.m_R;tVec.x=r1X*tMat.col1.x+r1Y*tMat.col1.y;tVec.y=r1X*tMat.col2.x+r1Y*tMat.col2.y;tVec=ccp.localAnchor2;tMat=b2.m_R;tVec.x=r2X*tMat.col1.x+r2Y*tMat.col1.y;tVec.y=r2X*tMat.col2.x+r2Y*tMat.col2.y;var r1Sqr=r1X*r1X+r1Y*r1Y;var r2Sqr=r2X*r2X+r2Y*r2Y;var rn1=r1X*normalX+r1Y*normalY;var rn2=r2X*normalX+r2Y*normalY;var kNormal=b1.m_invMass+b2.m_invMass;kNormal+=b1.m_invI*(r1Sqr-rn1*rn1)+b2.m_invI*(r2Sqr-rn2*rn2);ccp.normalMass=1.0/kNormal;var tangentX=normalY
+var tangentY=-normalX;var rt1=r1X*tangentX+r1Y*tangentY;var rt2=r2X*tangentX+r2Y*tangentY;var kTangent=b1.m_invMass+b2.m_invMass;kTangent+=b1.m_invI*(r1Sqr-rt1*rt1)+b2.m_invI*(r2Sqr-rt2*rt2);ccp.tangentMass=1.0/kTangent;ccp.velocityBias=0.0;if(ccp.separation>0.0)
+{ccp.velocityBias=-60.0*ccp.separation;}
+var tX=v2X+(-w2*r2Y)-v1X-(-w1*r1Y);var tY=v2Y+(w2*r2X)-v1Y-(w1*r1X);var vRel=c.normal.x*tX+c.normal.y*tY;if(vRel<-b2Settings.b2_velocityThreshold)
+{ccp.velocityBias+=-c.restitution*vRel;}}
+++count;}}},PreSolve:function(){var tVec;var tVec2;var tMat;for(var i=0;i<this.m_constraintCount;++i)
+{var c=this.m_constraints[i];var b1=c.body1;var b2=c.body2;var invMass1=b1.m_invMass;var invI1=b1.m_invI;var invMass2=b2.m_invMass;var invI2=b2.m_invI;var normalX=c.normal.x;var normalY=c.normal.y;var tangentX=normalY;var tangentY=-normalX;var j=0;var tCount=0;if(b2World.s_enableWarmStarting)
+{tCount=c.pointCount;for(j=0;j<tCount;++j)
+{var ccp=c.points[j];var PX=ccp.normalImpulse*normalX+ccp.tangentImpulse*tangentX;var PY=ccp.normalImpulse*normalY+ccp.tangentImpulse*tangentY;tMat=b1.m_R;tVec=ccp.localAnchor1;var r1X=tMat.col1.x*tVec.x+tMat.col2.x*tVec.y;var r1Y=tMat.col1.y*tVec.x+tMat.col2.y*tVec.y;tMat=b2.m_R;tVec=ccp.localAnchor2;var r2X=tMat.col1.x*tVec.x+tMat.col2.x*tVec.y;var r2Y=tMat.col1.y*tVec.x+tMat.col2.y*tVec.y;b1.m_angularVelocity-=invI1*(r1X*PY-r1Y*PX);b1.m_linearVelocity.x-=invMass1*PX;b1.m_linearVelocity.y-=invMass1*PY;b2.m_angularVelocity+=invI2*(r2X*PY-r2Y*PX);b2.m_linearVelocity.x+=invMass2*PX;b2.m_linearVelocity.y+=invMass2*PY;ccp.positionImpulse=0.0;}}
+else{tCount=c.pointCount;for(j=0;j<tCount;++j)
+{var ccp2=c.points[j];ccp2.normalImpulse=0.0;ccp2.tangentImpulse=0.0;ccp2.positionImpulse=0.0;}}}},SolveVelocityConstraints:function(){var j=0;var ccp;var r1X;var r1Y;var r2X;var r2Y;var dvX;var dvY;var lambda;var newImpulse;var PX;var PY;var tMat;var tVec;for(var i=0;i<this.m_constraintCount;++i)
+{var c=this.m_constraints[i];var b1=c.body1;var b2=c.body2;var b1_angularVelocity=b1.m_angularVelocity;var b1_linearVelocity=b1.m_linearVelocity;var b2_angularVelocity=b2.m_angularVelocity;var b2_linearVelocity=b2.m_linearVelocity;var invMass1=b1.m_invMass;var invI1=b1.m_invI;var invMass2=b2.m_invMass;var invI2=b2.m_invI;var normalX=c.normal.x;var normalY=c.normal.y;var tangentX=normalY;var tangentY=-normalX;var tCount=c.pointCount;for(j=0;j<tCount;++j)
+{ccp=c.points[j];tMat=b1.m_R;tVec=ccp.localAnchor1;r1X=tMat.col1.x*tVec.x+tMat.col2.x*tVec.y
+r1Y=tMat.col1.y*tVec.x+tMat.col2.y*tVec.y
+tMat=b2.m_R;tVec=ccp.localAnchor2;r2X=tMat.col1.x*tVec.x+tMat.col2.x*tVec.y
+r2Y=tMat.col1.y*tVec.x+tMat.col2.y*tVec.y
+dvX=b2_linearVelocity.x+(-b2_angularVelocity*r2Y)-b1_linearVelocity.x-(-b1_angularVelocity*r1Y);dvY=b2_linearVelocity.y+(b2_angularVelocity*r2X)-b1_linearVelocity.y-(b1_angularVelocity*r1X);var vn=dvX*normalX+dvY*normalY;lambda=-ccp.normalMass*(vn-ccp.velocityBias);newImpulse=b2Math.b2Max(ccp.normalImpulse+lambda,0.0);lambda=newImpulse-ccp.normalImpulse;PX=lambda*normalX;PY=lambda*normalY;b1_linearVelocity.x-=invMass1*PX;b1_linearVelocity.y-=invMass1*PY;b1_angularVelocity-=invI1*(r1X*PY-r1Y*PX);b2_linearVelocity.x+=invMass2*PX;b2_linearVelocity.y+=invMass2*PY;b2_angularVelocity+=invI2*(r2X*PY-r2Y*PX);ccp.normalImpulse=newImpulse;dvX=b2_linearVelocity.x+(-b2_angularVelocity*r2Y)-b1_linearVelocity.x-(-b1_angularVelocity*r1Y);dvY=b2_linearVelocity.y+(b2_angularVelocity*r2X)-b1_linearVelocity.y-(b1_angularVelocity*r1X);var vt=dvX*tangentX+dvY*tangentY;lambda=ccp.tangentMass*(-vt);var maxFriction=c.friction*ccp.normalImpulse;newImpulse=b2Math.b2Clamp(ccp.tangentImpulse+lambda,-maxFriction,maxFriction);lambda=newImpulse-ccp.tangentImpulse;PX=lambda*tangentX;PY=lambda*tangentY;b1_linearVelocity.x-=invMass1*PX;b1_linearVelocity.y-=invMass1*PY;b1_angularVelocity-=invI1*(r1X*PY-r1Y*PX);b2_linearVelocity.x+=invMass2*PX;b2_linearVelocity.y+=invMass2*PY;b2_angularVelocity+=invI2*(r2X*PY-r2Y*PX);ccp.tangentImpulse=newImpulse;}
+b1.m_angularVelocity=b1_angularVelocity;b2.m_angularVelocity=b2_angularVelocity;}},SolvePositionConstraints:function(beta){var minSeparation=0.0;var tMat;var tVec;for(var i=0;i<this.m_constraintCount;++i)
+{var c=this.m_constraints[i];var b1=c.body1;var b2=c.body2;var b1_position=b1.m_position;var b1_rotation=b1.m_rotation;var b2_position=b2.m_position;var b2_rotation=b2.m_rotation;var invMass1=b1.m_invMass;var invI1=b1.m_invI;var invMass2=b2.m_invMass;var invI2=b2.m_invI;var normalX=c.normal.x;var normalY=c.normal.y;var tangentX=normalY;var tangentY=-normalX;var tCount=c.pointCount;for(var j=0;j<tCount;++j)
+{var ccp=c.points[j];tMat=b1.m_R;tVec=ccp.localAnchor1;var r1X=tMat.col1.x*tVec.x+tMat.col2.x*tVec.y
+var r1Y=tMat.col1.y*tVec.x+tMat.col2.y*tVec.y
+tMat=b2.m_R;tVec=ccp.localAnchor2;var r2X=tMat.col1.x*tVec.x+tMat.col2.x*tVec.y
+var r2Y=tMat.col1.y*tVec.x+tMat.col2.y*tVec.y
+var p1X=b1_position.x+r1X;var p1Y=b1_position.y+r1Y;var p2X=b2_position.x+r2X;var p2Y=b2_position.y+r2Y;var dpX=p2X-p1X;var dpY=p2Y-p1Y;var separation=(dpX*normalX+dpY*normalY)+ccp.separation;minSeparation=b2Math.b2Min(minSeparation,separation);var C=beta*b2Math.b2Clamp(separation+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0.0);var dImpulse=-ccp.normalMass*C;var impulse0=ccp.positionImpulse;ccp.positionImpulse=b2Math.b2Max(impulse0+dImpulse,0.0);dImpulse=ccp.positionImpulse-impulse0;var impulseX=dImpulse*normalX;var impulseY=dImpulse*normalY;b1_position.x-=invMass1*impulseX;b1_position.y-=invMass1*impulseY;b1_rotation-=invI1*(r1X*impulseY-r1Y*impulseX);b1.m_R.Set(b1_rotation);b2_position.x+=invMass2*impulseX;b2_position.y+=invMass2*impulseY;b2_rotation+=invI2*(r2X*impulseY-r2Y*impulseX);b2.m_R.Set(b2_rotation);}
+b1.m_rotation=b1_rotation;b2.m_rotation=b2_rotation;}
+return minSeparation>=-b2Settings.b2_linearSlop;},PostSolve:function(){for(var i=0;i<this.m_constraintCount;++i)
+{var c=this.m_constraints[i];var m=c.manifold;for(var j=0;j<c.pointCount;++j)
+{var mPoint=m.points[j];var cPoint=c.points[j];mPoint.normalImpulse=cPoint.normalImpulse;mPoint.tangentImpulse=cPoint.tangentImpulse;}}},m_allocator:null,m_constraints:new Array(),m_constraintCount:0};
+var b2CircleContact=Class.create();Object.extend(b2CircleContact.prototype,b2Contact.prototype);Object.extend(b2CircleContact.prototype,{initialize:function(s1,s2){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!s1||!s2){this.m_shape1=null;this.m_shape2=null;return;}
+this.m_shape1=s1;this.m_shape2=s2;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;this.m_manifold=[new b2Manifold()];this.m_manifold[0].pointCount=0;this.m_manifold[0].points[0].normalImpulse=0.0;this.m_manifold[0].points[0].tangentImpulse=0.0;},Evaluate:function(){b2Collision.b2CollideCircle(this.m_manifold[0],this.m_shape1,this.m_shape2,false);if(this.m_manifold[0].pointCount>0)
+{this.m_manifoldCount=1;}
+else
+{this.m_manifoldCount=0;}},GetManifolds:function()
+{return this.m_manifold;},m_manifold:[new b2Manifold()]});b2CircleContact.Create=function(shape1,shape2,allocator){return new b2CircleContact(shape1,shape2);};b2CircleContact.Destroy=function(contact,allocator){};
+var b2Conservative=Class.create();b2Conservative.prototype={initialize:function(){}}
+b2Conservative.R1=new b2Mat22();b2Conservative.R2=new b2Mat22();b2Conservative.x1=new b2Vec2();b2Conservative.x2=new b2Vec2();b2Conservative.Conservative=function(shape1,shape2){var body1=shape1.GetBody();var body2=shape2.GetBody();var v1X=body1.m_position.x-body1.m_position0.x;var v1Y=body1.m_position.y-body1.m_position0.y;var omega1=body1.m_rotation-body1.m_rotation0;var v2X=body2.m_position.x-body2.m_position0.x;var v2Y=body2.m_position.y-body2.m_position0.y;var omega2=body2.m_rotation-body2.m_rotation0;var r1=shape1.GetMaxRadius();var r2=shape2.GetMaxRadius();var p1StartX=body1.m_position0.x;var p1StartY=body1.m_position0.y;var a1Start=body1.m_rotation0;var p2StartX=body2.m_position0.x;var p2StartY=body2.m_position0.y;var a2Start=body2.m_rotation0;var p1X=p1StartX;var p1Y=p1StartY;var a1=a1Start;var p2X=p2StartX;var p2Y=p2StartY;var a2=a2Start;b2Conservative.R1.Set(a1);b2Conservative.R2.Set(a2);shape1.QuickSync(p1,b2Conservative.R1);shape2.QuickSync(p2,b2Conservative.R2);var s1=0.0;var maxIterations=10;var dX;var dY;var invRelativeVelocity=0.0;var hit=true;for(var iter=0;iter<maxIterations;++iter)
+{var distance=b2Distance.Distance(b2Conservative.x1,b2Conservative.x2,shape1,shape2);if(distance<b2Settings.b2_linearSlop)
+{if(iter==0)
+{hit=false;}
+else
+{hit=true;}
+break;}
+if(iter==0)
+{dX=b2Conservative.x2.x-b2Conservative.x1.x;dY=b2Conservative.x2.y-b2Conservative.x1.y;var dLen=Math.sqrt(dX*dX+dY*dY);var relativeVelocity=(dX*(v1X-v2X)+dY*(v1Y-v2Y))+Math.abs(omega1)*r1+Math.abs(omega2)*r2;if(Math.abs(relativeVelocity)<Number.MIN_VALUE)
+{hit=false;break;}
+invRelativeVelocity=1.0/relativeVelocity;}
+var ds=distance*invRelativeVelocity;var s2=s1+ds;if(s2<0.0||1.0<s2)
+{hit=false;break;}
+if(s2<(1.0+100.0*Number.MIN_VALUE)*s1)
+{hit=true;break;}
+s1=s2;p1X=p1StartX+s1*v1.x;p1Y=p1StartY+s1*v1.y;a1=a1Start+s1*omega1;p2X=p2StartX+s1*v2.x;p2Y=p2StartY+s1*v2.y;a2=a2Start+s1*omega2;b2Conservative.R1.Set(a1);b2Conservative.R2.Set(a2);shape1.QuickSync(p1,b2Conservative.R1);shape2.QuickSync(p2,b2Conservative.R2);}
+if(hit)
+{dX=b2Conservative.x2.x-b2Conservative.x1.x;dY=b2Conservative.x2.y-b2Conservative.x1.y;var length=Math.sqrt(dX*dX+dY*dY);if(length>FLT_EPSILON)
+{d*=b2_linearSlop/length;}
+if(body1.IsStatic())
+{body1.m_position.x=p1X;body1.m_position.y=p1Y;}
+else
+{body1.m_position.x=p1X-dX;body1.m_position.y=p1Y-dY;}
+body1.m_rotation=a1;body1.m_R.Set(a1);body1.QuickSyncShapes();if(body2.IsStatic())
+{body2.m_position.x=p2X;body2.m_position.y=p2Y;}
+else
+{body2.m_position.x=p2X+dX;body2.m_position.y=p2Y+dY;}
+body2.m_position.x=p2X+dX;body2.m_position.y=p2Y+dY;body2.m_rotation=a2;body2.m_R.Set(a2);body2.QuickSyncShapes();return true;}
+shape1.QuickSync(body1.m_position,body1.m_R);shape2.QuickSync(body2.m_position,body2.m_R);return false;};
+var b2NullContact=Class.create();Object.extend(b2NullContact.prototype,b2Contact.prototype);Object.extend(b2NullContact.prototype,{initialize:function(s1,s2){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!s1||!s2){this.m_shape1=null;this.m_shape2=null;return;}
+this.m_shape1=s1;this.m_shape2=s2;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;},Evaluate:function(){},GetManifolds:function(){return null;}});
+var b2PolyAndCircleContact=Class.create();Object.extend(b2PolyAndCircleContact.prototype,b2Contact.prototype);Object.extend(b2PolyAndCircleContact.prototype,{initialize:function(s1,s2){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!s1||!s2){this.m_shape1=null;this.m_shape2=null;return;}
+this.m_shape1=s1;this.m_shape2=s2;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;this.m_manifold=[new b2Manifold()];b2Settings.b2Assert(this.m_shape1.m_type==b2Shape.e_polyShape);b2Settings.b2Assert(this.m_shape2.m_type==b2Shape.e_circleShape);this.m_manifold[0].pointCount=0;this.m_manifold[0].points[0].normalImpulse=0.0;this.m_manifold[0].points[0].tangentImpulse=0.0;},Evaluate:function(){b2Collision.b2CollidePolyAndCircle(this.m_manifold[0],this.m_shape1,this.m_shape2,false);if(this.m_manifold[0].pointCount>0)
+{this.m_manifoldCount=1;}
+else
+{this.m_manifoldCount=0;}},GetManifolds:function()
+{return this.m_manifold;},m_manifold:[new b2Manifold()]})
+b2PolyAndCircleContact.Create=function(shape1,shape2,allocator){return new b2PolyAndCircleContact(shape1,shape2);};b2PolyAndCircleContact.Destroy=function(contact,allocator){};
+var b2PolyContact=Class.create();Object.extend(b2PolyContact.prototype,b2Contact.prototype);Object.extend(b2PolyContact.prototype,{initialize:function(s1,s2){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!s1||!s2){this.m_shape1=null;this.m_shape2=null;return;}
+this.m_shape1=s1;this.m_shape2=s2;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;this.m0=new b2Manifold();this.m_manifold=[new b2Manifold()];this.m_manifold[0].pointCount=0;},m0:new b2Manifold(),Evaluate:function(){var tMani=this.m_manifold[0];var tPoints=this.m0.points;for(var k=0;k<tMani.pointCount;k++){var tPoint=tPoints[k];var tPoint0=tMani.points[k];tPoint.normalImpulse=tPoint0.normalImpulse;tPoint.tangentImpulse=tPoint0.tangentImpulse;tPoint.id=tPoint0.id.Copy();}
+this.m0.pointCount=tMani.pointCount;b2Collision.b2CollidePoly(tMani,this.m_shape1,this.m_shape2,false);if(tMani.pointCount>0)
+{var match=[false,false];for(var i=0;i<tMani.pointCount;++i)
+{var cp=tMani.points[i];cp.normalImpulse=0.0;cp.tangentImpulse=0.0;var idKey=cp.id.key;for(var j=0;j<this.m0.pointCount;++j)
+{if(match[j]==true)
+continue;var cp0=this.m0.points[j];var id0=cp0.id;if(id0.key==idKey)
+{match[j]=true;cp.normalImpulse=cp0.normalImpulse;cp.tangentImpulse=cp0.tangentImpulse;break;}}}
+this.m_manifoldCount=1;}
+else
+{this.m_manifoldCount=0;}},GetManifolds:function()
+{return this.m_manifold;},m_manifold:[new b2Manifold()]});b2PolyContact.Create=function(shape1,shape2,allocator){return new b2PolyContact(shape1,shape2);};b2PolyContact.Destroy=function(contact,allocator){};
+var b2ContactManager=Class.create();Object.extend(b2ContactManager.prototype,b2PairCallback.prototype);Object.extend(b2ContactManager.prototype,{initialize:function(){this.m_nullContact=new b2NullContact();this.m_world=null;this.m_destroyImmediate=false;},PairAdded:function(proxyUserData1,proxyUserData2){var shape1=proxyUserData1;var shape2=proxyUserData2;var body1=shape1.m_body;var body2=shape2.m_body;if(body1.IsStatic()&&body2.IsStatic())
+{return this.m_nullContact;}
+if(shape1.m_body==shape2.m_body)
+{return this.m_nullContact;}
+if(body2.IsConnected(body1))
+{return this.m_nullContact;}
+if(this.m_world.m_filter!=null&&this.m_world.m_filter.ShouldCollide(shape1,shape2)==false)
+{return this.m_nullContact;}
+if(body2.m_invMass==0.0)
+{var tempShape=shape1;shape1=shape2;shape2=tempShape;var tempBody=body1;body1=body2;body2=tempBody;}
+var contact=b2Contact.Create(shape1,shape2,this.m_world.m_blockAllocator);if(contact==null)
+{return this.m_nullContact;}
+else
+{contact.m_prev=null;contact.m_next=this.m_world.m_contactList;if(this.m_world.m_contactList!=null)
+{this.m_world.m_contactList.m_prev=contact;}
+this.m_world.m_contactList=contact;this.m_world.m_contactCount++;}
+return contact;},PairRemoved:function(proxyUserData1,proxyUserData2,pairUserData){if(pairUserData==null)
+{return;}
+var c=pairUserData;if(c!=this.m_nullContact)
+{if(this.m_destroyImmediate==true)
+{this.DestroyContact(c);c=null;}
+else
+{c.m_flags|=b2Contact.e_destroyFlag;}}},DestroyContact:function(c)
+{if(c.m_prev)
+{c.m_prev.m_next=c.m_next;}
+if(c.m_next)
+{c.m_next.m_prev=c.m_prev;}
+if(c==this.m_world.m_contactList)
+{this.m_world.m_contactList=c.m_next;}
+if(c.GetManifoldCount()>0)
+{var body1=c.m_shape1.m_body;var body2=c.m_shape2.m_body;var node1=c.m_node1;var node2=c.m_node2;body1.WakeUp();body2.WakeUp();if(node1.prev)
+{node1.prev.next=node1.next;}
+if(node1.next)
+{node1.next.prev=node1.prev;}
+if(node1==body1.m_contactList)
+{body1.m_contactList=node1.next;}
+node1.prev=null;node1.next=null;if(node2.prev)
+{node2.prev.next=node2.next;}
+if(node2.next)
+{node2.next.prev=node2.prev;}
+if(node2==body2.m_contactList)
+{body2.m_contactList=node2.next;}
+node2.prev=null;node2.next=null;}
+b2Contact.Destroy(c,this.m_world.m_blockAllocator);--this.m_world.m_contactCount;},CleanContactList:function()
+{var c=this.m_world.m_contactList;while(c!=null)
+{var c0=c;c=c.m_next;if(c0.m_flags&b2Contact.e_destroyFlag)
+{this.DestroyContact(c0);c0=null;}}},Collide:function()
+{var body1;var body2;var node1;var node2;for(var c=this.m_world.m_contactList;c!=null;c=c.m_next)
+{if(c.m_shape1.m_body.IsSleeping()&&c.m_shape2.m_body.IsSleeping())
+{continue;}
+var oldCount=c.GetManifoldCount();c.Evaluate();var newCount=c.GetManifoldCount();if(oldCount==0&&newCount>0)
+{body1=c.m_shape1.m_body;body2=c.m_shape2.m_body;node1=c.m_node1;node2=c.m_node2;node1.contact=c;node1.other=body2;node1.prev=null;node1.next=body1.m_contactList;if(node1.next!=null)
+{node1.next.prev=c.m_node1;}
+body1.m_contactList=c.m_node1;node2.contact=c;node2.other=body1;node2.prev=null;node2.next=body2.m_contactList;if(node2.next!=null)
+{node2.next.prev=node2;}
+body2.m_contactList=node2;}
+else if(oldCount>0&&newCount==0)
+{body1=c.m_shape1.m_body;body2=c.m_shape2.m_body;node1=c.m_node1;node2=c.m_node2;if(node1.prev)
+{node1.prev.next=node1.next;}
+if(node1.next)
+{node1.next.prev=node1.prev;}
+if(node1==body1.m_contactList)
+{body1.m_contactList=node1.next;}
+node1.prev=null;node1.next=null;if(node2.prev)
+{node2.prev.next=node2.next;}
+if(node2.next)
+{node2.next.prev=node2.prev;}
+if(node2==body2.m_contactList)
+{body2.m_contactList=node2.next;}
+node2.prev=null;node2.next=null;}}},m_world:null,m_nullContact:new b2NullContact(),m_destroyImmediate:null});
+var b2World=Class.create();b2World.prototype={initialize:function(worldAABB,gravity,doSleep){this.step=new b2TimeStep();this.m_contactManager=new b2ContactManager();this.m_listener=null;this.m_filter=b2CollisionFilter.b2_defaultFilter;this.m_bodyList=null;this.m_contactList=null;this.m_jointList=null;this.m_bodyCount=0;this.m_contactCount=0;this.m_jointCount=0;this.m_bodyDestroyList=null;this.m_allowSleep=doSleep;this.m_gravity=gravity;this.m_contactManager.m_world=this;this.m_broadPhase=new b2BroadPhase(worldAABB,this.m_contactManager);var bd=new b2BodyDef();this.m_groundBody=this.CreateBody(bd);},SetListener:function(listener){this.m_listener=listener;},SetFilter:function(filter){this.m_filter=filter;},CreateBody:function(def){var b=new b2Body(def,this);b.m_prev=null;b.m_next=this.m_bodyList;if(this.m_bodyList)
+{this.m_bodyList.m_prev=b;}
+this.m_bodyList=b;++this.m_bodyCount;return b;},DestroyBody:function(b)
+{if(b.m_flags&b2Body.e_destroyFlag)
+{return;}
+if(b.m_prev)
+{b.m_prev.m_next=b.m_next;}
+if(b.m_next)
+{b.m_next.m_prev=b.m_prev;}
+if(b==this.m_bodyList)
+{this.m_bodyList=b.m_next;}
+b.m_flags|=b2Body.e_destroyFlag;--this.m_bodyCount;b.m_prev=null;b.m_next=this.m_bodyDestroyList;this.m_bodyDestroyList=b;},CleanBodyList:function()
+{this.m_contactManager.m_destroyImmediate=true;var b=this.m_bodyDestroyList;while(b)
+{var b0=b;b=b.m_next;var jn=b0.m_jointList;while(jn)
+{var jn0=jn;jn=jn.next;if(this.m_listener)
+{this.m_listener.NotifyJointDestroyed(jn0.joint);}
+this.DestroyJoint(jn0.joint);}
+b0.Destroy();}
+this.m_bodyDestroyList=null;this.m_contactManager.m_destroyImmediate=false;},CreateJoint:function(def){var j=b2Joint.Create(def,this.m_blockAllocator);j.m_prev=null;j.m_next=this.m_jointList;if(this.m_jointList)
+{this.m_jointList.m_prev=j;}
+this.m_jointList=j;++this.m_jointCount;j.m_node1.joint=j;j.m_node1.other=j.m_body2;j.m_node1.prev=null;j.m_node1.next=j.m_body1.m_jointList;if(j.m_body1.m_jointList)j.m_body1.m_jointList.prev=j.m_node1;j.m_body1.m_jointList=j.m_node1;j.m_node2.joint=j;j.m_node2.other=j.m_body1;j.m_node2.prev=null;j.m_node2.next=j.m_body2.m_jointList;if(j.m_body2.m_jointList)j.m_body2.m_jointList.prev=j.m_node2;j.m_body2.m_jointList=j.m_node2;if(def.collideConnected==false)
+{var b=def.body1.m_shapeCount<def.body2.m_shapeCount?def.body1:def.body2;for(var s=b.m_shapeList;s;s=s.m_next)
+{s.ResetProxy(this.m_broadPhase);}}
+return j;},DestroyJoint:function(j)
+{var collideConnected=j.m_collideConnected;if(j.m_prev)
+{j.m_prev.m_next=j.m_next;}
+if(j.m_next)
+{j.m_next.m_prev=j.m_prev;}
+if(j==this.m_jointList)
+{this.m_jointList=j.m_next;}
+var body1=j.m_body1;var body2=j.m_body2;body1.WakeUp();body2.WakeUp();if(j.m_node1.prev)
+{j.m_node1.prev.next=j.m_node1.next;}
+if(j.m_node1.next)
+{j.m_node1.next.prev=j.m_node1.prev;}
+if(j.m_node1==body1.m_jointList)
+{body1.m_jointList=j.m_node1.next;}
+j.m_node1.prev=null;j.m_node1.next=null;if(j.m_node2.prev)
+{j.m_node2.prev.next=j.m_node2.next;}
+if(j.m_node2.next)
+{j.m_node2.next.prev=j.m_node2.prev;}
+if(j.m_node2==body2.m_jointList)
+{body2.m_jointList=j.m_node2.next;}
+j.m_node2.prev=null;j.m_node2.next=null;b2Joint.Destroy(j,this.m_blockAllocator);--this.m_jointCount;if(collideConnected==false)
+{var b=body1.m_shapeCount<body2.m_shapeCount?body1:body2;for(var s=b.m_shapeList;s;s=s.m_next)
+{s.ResetProxy(this.m_broadPhase);}}},GetGroundBody:function(){return this.m_groundBody;},step:new b2TimeStep(),Step:function(dt,iterations){var b;var other;this.step.dt=dt;this.step.iterations=iterations;if(dt>0.0)
+{this.step.inv_dt=1.0/dt;}
+else
+{this.step.inv_dt=0.0;}
+this.m_positionIterationCount=0;this.m_contactManager.CleanContactList();this.CleanBodyList();this.m_contactManager.Collide();var island=new b2Island(this.m_bodyCount,this.m_contactCount,this.m_jointCount,this.m_stackAllocator);for(b=this.m_bodyList;b!=null;b=b.m_next)
+{b.m_flags&=~b2Body.e_islandFlag;}
+for(var c=this.m_contactList;c!=null;c=c.m_next)
+{c.m_flags&=~b2Contact.e_islandFlag;}
+for(var j=this.m_jointList;j!=null;j=j.m_next)
+{j.m_islandFlag=false;}
+var stackSize=this.m_bodyCount;var stack=new Array(this.m_bodyCount);for(var k=0;k<this.m_bodyCount;k++)
+stack[k]=null;for(var seed=this.m_bodyList;seed!=null;seed=seed.m_next)
+{if(seed.m_flags&(b2Body.e_staticFlag|b2Body.e_islandFlag|b2Body.e_sleepFlag|b2Body.e_frozenFlag))
+{continue;}
+island.Clear();var stackCount=0;stack[stackCount++]=seed;seed.m_flags|=b2Body.e_islandFlag;;while(stackCount>0)
+{b=stack[--stackCount];island.AddBody(b);b.m_flags&=~b2Body.e_sleepFlag;if(b.m_flags&b2Body.e_staticFlag)
+{continue;}
+for(var cn=b.m_contactList;cn!=null;cn=cn.next)
+{if(cn.contact.m_flags&b2Contact.e_islandFlag)
+{continue;}
+island.AddContact(cn.contact);cn.contact.m_flags|=b2Contact.e_islandFlag;other=cn.other;if(other.m_flags&b2Body.e_islandFlag)
+{continue;}
+stack[stackCount++]=other;other.m_flags|=b2Body.e_islandFlag;}
+for(var jn=b.m_jointList;jn!=null;jn=jn.next)
+{if(jn.joint.m_islandFlag==true)
+{continue;}
+island.AddJoint(jn.joint);jn.joint.m_islandFlag=true;other=jn.other;if(other.m_flags&b2Body.e_islandFlag)
+{continue;}
+stack[stackCount++]=other;other.m_flags|=b2Body.e_islandFlag;}}
+island.Solve(this.step,this.m_gravity);this.m_positionIterationCount=b2Math.b2Max(this.m_positionIterationCount,b2Island.m_positionIterationCount);if(this.m_allowSleep)
+{island.UpdateSleep(dt);}
+for(var i=0;i<island.m_bodyCount;++i)
+{b=island.m_bodies[i];if(b.m_flags&b2Body.e_staticFlag)
+{b.m_flags&=~b2Body.e_islandFlag;}
+if(b.IsFrozen()&&this.m_listener)
+{var response=this.m_listener.NotifyBoundaryViolated(b);if(response==b2WorldListener.b2_destroyBody)
+{this.DestroyBody(b);b=null;island.m_bodies[i]=null;}}}}
+this.m_broadPhase.Commit();},Query:function(aabb,shapes,maxCount){var results=new Array();var count=this.m_broadPhase.QueryAABB(aabb,results,maxCount);for(var i=0;i<count;++i)
+{shapes[i]=results[i];}
+return count;},GetBodyList:function(){return this.m_bodyList;},GetJointList:function(){return this.m_jointList;},GetContactList:function(){return this.m_contactList;},m_blockAllocator:null,m_stackAllocator:null,m_broadPhase:null,m_contactManager:new b2ContactManager(),m_bodyList:null,m_contactList:null,m_jointList:null,m_bodyCount:0,m_contactCount:0,m_jointCount:0,m_bodyDestroyList:null,m_gravity:null,m_allowSleep:null,m_groundBody:null,m_listener:null,m_filter:null,m_positionIterationCount:0};b2World.s_enablePositionCorrection=1;b2World.s_enableWarmStarting=1;
+var b2WorldListener=Class.create();b2WorldListener.prototype={NotifyJointDestroyed:function(joint){},NotifyBoundaryViolated:function(body)
+{return b2WorldListener.b2_freezeBody;},initialize:function(){}};b2WorldListener.b2_freezeBody=0;b2WorldListener.b2_destroyBody=1;
+var b2JointNode=Class.create();b2JointNode.prototype={other:null,joint:null,prev:null,next:null,initialize:function(){}}
+
+var b2Joint=Class.create();b2Joint.prototype={GetType:function(){return this.m_type;},GetAnchor1:function(){return null},GetAnchor2:function(){return null},GetReactionForce:function(invTimeStep){return null},GetReactionTorque:function(invTimeStep){return 0.0},GetBody1:function()
+{return this.m_body1;},GetBody2:function()
+{return this.m_body2;},GetNext:function(){return this.m_next;},GetUserData:function(){return this.m_userData;},initialize:function(def){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=def.type;this.m_prev=null;this.m_next=null;this.m_body1=def.body1;this.m_body2=def.body2;this.m_collideConnected=def.collideConnected;this.m_islandFlag=false;this.m_userData=def.userData;},PrepareVelocitySolver:function(){},SolveVelocityConstraints:function(step){},PreparePositionSolver:function(){},SolvePositionConstraints:function(){return false},m_type:0,m_prev:null,m_next:null,m_node1:new b2JointNode(),m_node2:new b2JointNode(),m_body1:null,m_body2:null,m_islandFlag:null,m_collideConnected:null,m_userData:null};b2Joint.Create=function(def,allocator){var joint=null;switch(def.type)
+{case b2Joint.e_distanceJoint:{joint=new b2DistanceJoint(def);}
+break;case b2Joint.e_mouseJoint:{joint=new b2MouseJoint(def);}
+break;case b2Joint.e_prismaticJoint:{joint=new b2PrismaticJoint(def);}
+break;case b2Joint.e_revoluteJoint:{joint=new b2RevoluteJoint(def);}
+break;case b2Joint.e_pulleyJoint:{joint=new b2PulleyJoint(def);}
+break;case b2Joint.e_gearJoint:{joint=new b2GearJoint(def);}
+break;default:break;}
+return joint;};b2Joint.Destroy=function(joint,allocator){};b2Joint.e_unknownJoint=0;b2Joint.e_revoluteJoint=1;b2Joint.e_prismaticJoint=2;b2Joint.e_distanceJoint=3;b2Joint.e_pulleyJoint=4;b2Joint.e_mouseJoint=5;b2Joint.e_gearJoint=6;b2Joint.e_inactiveLimit=0;b2Joint.e_atLowerLimit=1;b2Joint.e_atUpperLimit=2;b2Joint.e_equalLimits=3;
+var b2JointDef=Class.create();b2JointDef.prototype={initialize:function()
+{this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;},type:0,userData:null,body1:null,body2:null,collideConnected:null}
+
+var b2DistanceJoint=Class.create();Object.extend(b2DistanceJoint.prototype,b2Joint.prototype);Object.extend(b2DistanceJoint.prototype,{initialize:function(def){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=def.type;this.m_prev=null;this.m_next=null;this.m_body1=def.body1;this.m_body2=def.body2;this.m_collideConnected=def.collideConnected;this.m_islandFlag=false;this.m_userData=def.userData;this.m_localAnchor1=new b2Vec2();this.m_localAnchor2=new b2Vec2();this.m_u=new b2Vec2();var tMat;var tX;var tY;tMat=this.m_body1.m_R;tX=def.anchorPoint1.x-this.m_body1.m_position.x;tY=def.anchorPoint1.y-this.m_body1.m_position.y;this.m_localAnchor1.x=tX*tMat.col1.x+tY*tMat.col1.y;this.m_localAnchor1.y=tX*tMat.col2.x+tY*tMat.col2.y;tMat=this.m_body2.m_R;tX=def.anchorPoint2.x-this.m_body2.m_position.x;tY=def.anchorPoint2.y-this.m_body2.m_position.y;this.m_localAnchor2.x=tX*tMat.col1.x+tY*tMat.col1.y;this.m_localAnchor2.y=tX*tMat.col2.x+tY*tMat.col2.y;tX=def.anchorPoint2.x-def.anchorPoint1.x;tY=def.anchorPoint2.y-def.anchorPoint1.y;this.m_length=Math.sqrt(tX*tX+tY*tY);this.m_impulse=0.0;},PrepareVelocitySolver:function(){var tMat;tMat=this.m_body1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=this.m_body2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;this.m_u.x=this.m_body2.m_position.x+r2X-this.m_body1.m_position.x-r1X;this.m_u.y=this.m_body2.m_position.y+r2Y-this.m_body1.m_position.y-r1Y;var length=Math.sqrt(this.m_u.x*this.m_u.x+this.m_u.y*this.m_u.y);if(length>b2Settings.b2_linearSlop)
+{this.m_u.Multiply(1.0/length);}
+else
+{this.m_u.SetZero();}
+var cr1u=(r1X*this.m_u.y-r1Y*this.m_u.x);var cr2u=(r2X*this.m_u.y-r2Y*this.m_u.x);this.m_mass=this.m_body1.m_invMass+this.m_body1.m_invI*cr1u*cr1u+this.m_body2.m_invMass+this.m_body2.m_invI*cr2u*cr2u;this.m_mass=1.0/this.m_mass;if(b2World.s_enableWarmStarting)
+{var PX=this.m_impulse*this.m_u.x;var PY=this.m_impulse*this.m_u.y;this.m_body1.m_linearVelocity.x-=this.m_body1.m_invMass*PX;this.m_body1.m_linearVelocity.y-=this.m_body1.m_invMass*PY;this.m_body1.m_angularVelocity-=this.m_body1.m_invI*(r1X*PY-r1Y*PX);this.m_body2.m_linearVelocity.x+=this.m_body2.m_invMass*PX;this.m_body2.m_linearVelocity.y+=this.m_body2.m_invMass*PY;this.m_body2.m_angularVelocity+=this.m_body2.m_invI*(r2X*PY-r2Y*PX);}
+else
+{this.m_impulse=0.0;}},SolveVelocityConstraints:function(step){var tMat;tMat=this.m_body1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=this.m_body2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var v1X=this.m_body1.m_linearVelocity.x+(-this.m_body1.m_angularVelocity*r1Y);var v1Y=this.m_body1.m_linearVelocity.y+(this.m_body1.m_angularVelocity*r1X);var v2X=this.m_body2.m_linearVelocity.x+(-this.m_body2.m_angularVelocity*r2Y);var v2Y=this.m_body2.m_linearVelocity.y+(this.m_body2.m_angularVelocity*r2X);var Cdot=(this.m_u.x*(v2X-v1X)+this.m_u.y*(v2Y-v1Y));var impulse=-this.m_mass*Cdot;this.m_impulse+=impulse;var PX=impulse*this.m_u.x;var PY=impulse*this.m_u.y;this.m_body1.m_linearVelocity.x-=this.m_body1.m_invMass*PX;this.m_body1.m_linearVelocity.y-=this.m_body1.m_invMass*PY;this.m_body1.m_angularVelocity-=this.m_body1.m_invI*(r1X*PY-r1Y*PX);this.m_body2.m_linearVelocity.x+=this.m_body2.m_invMass*PX;this.m_body2.m_linearVelocity.y+=this.m_body2.m_invMass*PY;this.m_body2.m_angularVelocity+=this.m_body2.m_invI*(r2X*PY-r2Y*PX);},SolvePositionConstraints:function(){var tMat;tMat=this.m_body1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=this.m_body2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var dX=this.m_body2.m_position.x+r2X-this.m_body1.m_position.x-r1X;var dY=this.m_body2.m_position.y+r2Y-this.m_body1.m_position.y-r1Y;var length=Math.sqrt(dX*dX+dY*dY);dX/=length;dY/=length;var C=length-this.m_length;C=b2Math.b2Clamp(C,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);var impulse=-this.m_mass*C;this.m_u.Set(dX,dY);var PX=impulse*this.m_u.x;var PY=impulse*this.m_u.y;this.m_body1.m_position.x-=this.m_body1.m_invMass*PX;this.m_body1.m_position.y-=this.m_body1.m_invMass*PY;this.m_body1.m_rotation-=this.m_body1.m_invI*(r1X*PY-r1Y*PX);this.m_body2.m_position.x+=this.m_body2.m_invMass*PX;this.m_body2.m_position.y+=this.m_body2.m_invMass*PY;this.m_body2.m_rotation+=this.m_body2.m_invI*(r2X*PY-r2Y*PX);this.m_body1.m_R.Set(this.m_body1.m_rotation);this.m_body2.m_R.Set(this.m_body2.m_rotation);return b2Math.b2Abs(C)<b2Settings.b2_linearSlop;},GetAnchor1:function(){return b2Math.AddVV(this.m_body1.m_position,b2Math.b2MulMV(this.m_body1.m_R,this.m_localAnchor1));},GetAnchor2:function(){return b2Math.AddVV(this.m_body2.m_position,b2Math.b2MulMV(this.m_body2.m_R,this.m_localAnchor2));},GetReactionForce:function(invTimeStep)
+{var F=new b2Vec2();F.SetV(this.m_u);F.Multiply(this.m_impulse*invTimeStep);return F;},GetReactionTorque:function(invTimeStep)
+{return 0.0;},m_localAnchor1:new b2Vec2(),m_localAnchor2:new b2Vec2(),m_u:new b2Vec2(),m_impulse:null,m_mass:null,m_length:null});
+var b2DistanceJointDef=Class.create();Object.extend(b2DistanceJointDef.prototype,b2JointDef.prototype);Object.extend(b2DistanceJointDef.prototype,{initialize:function()
+{this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.anchorPoint1=new b2Vec2();this.anchorPoint2=new b2Vec2();this.type=b2Joint.e_distanceJoint;},anchorPoint1:new b2Vec2(),anchorPoint2:new b2Vec2()});
+var b2Jacobian=Class.create();b2Jacobian.prototype={linear1:new b2Vec2(),angular1:null,linear2:new b2Vec2(),angular2:null,SetZero:function(){this.linear1.SetZero();this.angular1=0.0;this.linear2.SetZero();this.angular2=0.0;},Set:function(x1,a1,x2,a2){this.linear1.SetV(x1);this.angular1=a1;this.linear2.SetV(x2);this.angular2=a2;},Compute:function(x1,a1,x2,a2){return(this.linear1.x*x1.x+this.linear1.y*x1.y)+this.angular1*a1+(this.linear2.x*x2.x+this.linear2.y*x2.y)+this.angular2*a2;},initialize:function(){this.linear1=new b2Vec2();this.linear2=new b2Vec2();}};
+var b2GearJoint=Class.create();Object.extend(b2GearJoint.prototype,b2Joint.prototype);Object.extend(b2GearJoint.prototype,{GetAnchor1:function(){var tMat=this.m_body1.m_R;return new b2Vec2(this.m_body1.m_position.x+(tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y),this.m_body1.m_position.y+(tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y));},GetAnchor2:function(){var tMat=this.m_body2.m_R;return new b2Vec2(this.m_body2.m_position.x+(tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y),this.m_body2.m_position.y+(tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y));},GetReactionForce:function(invTimeStep){return new b2Vec2();},GetReactionTorque:function(invTimeStep){return 0.0;},GetRatio:function(){return this.m_ratio;},initialize:function(def){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=def.type;this.m_prev=null;this.m_next=null;this.m_body1=def.body1;this.m_body2=def.body2;this.m_collideConnected=def.collideConnected;this.m_islandFlag=false;this.m_userData=def.userData;this.m_groundAnchor1=new b2Vec2();this.m_groundAnchor2=new b2Vec2();this.m_localAnchor1=new b2Vec2();this.m_localAnchor2=new b2Vec2();this.m_J=new b2Jacobian();this.m_revolute1=null;this.m_prismatic1=null;this.m_revolute2=null;this.m_prismatic2=null;var coordinate1;var coordinate2;this.m_ground1=def.joint1.m_body1;this.m_body1=def.joint1.m_body2;if(def.joint1.m_type==b2Joint.e_revoluteJoint)
+{this.m_revolute1=def.joint1;this.m_groundAnchor1.SetV(this.m_revolute1.m_localAnchor1);this.m_localAnchor1.SetV(this.m_revolute1.m_localAnchor2);coordinate1=this.m_revolute1.GetJointAngle();}
+else
+{this.m_prismatic1=def.joint1;this.m_groundAnchor1.SetV(this.m_prismatic1.m_localAnchor1);this.m_localAnchor1.SetV(this.m_prismatic1.m_localAnchor2);coordinate1=this.m_prismatic1.GetJointTranslation();}
+this.m_ground2=def.joint2.m_body1;this.m_body2=def.joint2.m_body2;if(def.joint2.m_type==b2Joint.e_revoluteJoint)
+{this.m_revolute2=def.joint2;this.m_groundAnchor2.SetV(this.m_revolute2.m_localAnchor1);this.m_localAnchor2.SetV(this.m_revolute2.m_localAnchor2);coordinate2=this.m_revolute2.GetJointAngle();}
+else
+{this.m_prismatic2=def.joint2;this.m_groundAnchor2.SetV(this.m_prismatic2.m_localAnchor1);this.m_localAnchor2.SetV(this.m_prismatic2.m_localAnchor2);coordinate2=this.m_prismatic2.GetJointTranslation();}
+this.m_ratio=def.ratio;this.m_constant=coordinate1+this.m_ratio*coordinate2;this.m_impulse=0.0;},PrepareVelocitySolver:function(){var g1=this.m_ground1;var g2=this.m_ground2;var b1=this.m_body1;var b2=this.m_body2;var ugX;var ugY;var rX;var rY;var tMat;var tVec;var crug;var K=0.0;this.m_J.SetZero();if(this.m_revolute1)
+{this.m_J.angular1=-1.0;K+=b1.m_invI;}
+else
+{tMat=g1.m_R;tVec=this.m_prismatic1.m_localXAxis1;ugX=tMat.col1.x*tVec.x+tMat.col2.x*tVec.y;ugY=tMat.col1.y*tVec.x+tMat.col2.y*tVec.y;tMat=b1.m_R;rX=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;rY=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;crug=rX*ugY-rY*ugX;this.m_J.linear1.Set(-ugX,-ugY);this.m_J.angular1=-crug;K+=b1.m_invMass+b1.m_invI*crug*crug;}
+if(this.m_revolute2)
+{this.m_J.angular2=-this.m_ratio;K+=this.m_ratio*this.m_ratio*b2.m_invI;}
+else
+{tMat=g2.m_R;tVec=this.m_prismatic2.m_localXAxis1;ugX=tMat.col1.x*tVec.x+tMat.col2.x*tVec.y;ugY=tMat.col1.y*tVec.x+tMat.col2.y*tVec.y;tMat=b2.m_R;rX=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;rY=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;crug=rX*ugY-rY*ugX;this.m_J.linear2.Set(-this.m_ratio*ugX,-this.m_ratio*ugY);this.m_J.angular2=-this.m_ratio*crug;K+=this.m_ratio*this.m_ratio*(b2.m_invMass+b2.m_invI*crug*crug);}
+this.m_mass=1.0/K;b1.m_linearVelocity.x+=b1.m_invMass*this.m_impulse*this.m_J.linear1.x;b1.m_linearVelocity.y+=b1.m_invMass*this.m_impulse*this.m_J.linear1.y;b1.m_angularVelocity+=b1.m_invI*this.m_impulse*this.m_J.angular1;b2.m_linearVelocity.x+=b2.m_invMass*this.m_impulse*this.m_J.linear2.x;b2.m_linearVelocity.y+=b2.m_invMass*this.m_impulse*this.m_J.linear2.y;b2.m_angularVelocity+=b2.m_invI*this.m_impulse*this.m_J.angular2;},SolveVelocityConstraints:function(step){var b1=this.m_body1;var b2=this.m_body2;var Cdot=this.m_J.Compute(b1.m_linearVelocity,b1.m_angularVelocity,b2.m_linearVelocity,b2.m_angularVelocity);var impulse=-this.m_mass*Cdot;this.m_impulse+=impulse;b1.m_linearVelocity.x+=b1.m_invMass*impulse*this.m_J.linear1.x;b1.m_linearVelocity.y+=b1.m_invMass*impulse*this.m_J.linear1.y;b1.m_angularVelocity+=b1.m_invI*impulse*this.m_J.angular1;b2.m_linearVelocity.x+=b2.m_invMass*impulse*this.m_J.linear2.x;b2.m_linearVelocity.y+=b2.m_invMass*impulse*this.m_J.linear2.y;b2.m_angularVelocity+=b2.m_invI*impulse*this.m_J.angular2;},SolvePositionConstraints:function(){var linearError=0.0;var b1=this.m_body1;var b2=this.m_body2;var coordinate1;var coordinate2;if(this.m_revolute1)
+{coordinate1=this.m_revolute1.GetJointAngle();}
+else
+{coordinate1=this.m_prismatic1.GetJointTranslation();}
+if(this.m_revolute2)
+{coordinate2=this.m_revolute2.GetJointAngle();}
+else
+{coordinate2=this.m_prismatic2.GetJointTranslation();}
+var C=this.m_constant-(coordinate1+this.m_ratio*coordinate2);var impulse=-this.m_mass*C;b1.m_position.x+=b1.m_invMass*impulse*this.m_J.linear1.x;b1.m_position.y+=b1.m_invMass*impulse*this.m_J.linear1.y;b1.m_rotation+=b1.m_invI*impulse*this.m_J.angular1;b2.m_position.x+=b2.m_invMass*impulse*this.m_J.linear2.x;b2.m_position.y+=b2.m_invMass*impulse*this.m_J.linear2.y;b2.m_rotation+=b2.m_invI*impulse*this.m_J.angular2;b1.m_R.Set(b1.m_rotation);b2.m_R.Set(b2.m_rotation);return linearError<b2Settings.b2_linearSlop;},m_ground1:null,m_ground2:null,m_revolute1:null,m_prismatic1:null,m_revolute2:null,m_prismatic2:null,m_groundAnchor1:new b2Vec2(),m_groundAnchor2:new b2Vec2(),m_localAnchor1:new b2Vec2(),m_localAnchor2:new b2Vec2(),m_J:new b2Jacobian(),m_constant:null,m_ratio:null,m_mass:null,m_impulse:null});
+var b2GearJointDef=Class.create();Object.extend(b2GearJointDef.prototype,b2JointDef.prototype);Object.extend(b2GearJointDef.prototype,{initialize:function()
+{this.type=b2Joint.e_gearJoint;this.joint1=null;this.joint2=null;this.ratio=1.0;},joint1:null,joint2:null,ratio:null});
+var b2MouseJoint=Class.create();Object.extend(b2MouseJoint.prototype,b2Joint.prototype);Object.extend(b2MouseJoint.prototype,{GetAnchor1:function(){return this.m_target;},GetAnchor2:function(){var tVec=b2Math.b2MulMV(this.m_body2.m_R,this.m_localAnchor);tVec.Add(this.m_body2.m_position);return tVec;},GetReactionForce:function(invTimeStep)
+{var F=new b2Vec2();F.SetV(this.m_impulse);F.Multiply(invTimeStep);return F;},GetReactionTorque:function(invTimeStep)
+{return 0.0;},SetTarget:function(target){this.m_body2.WakeUp();this.m_target=target;},initialize:function(def){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=def.type;this.m_prev=null;this.m_next=null;this.m_body1=def.body1;this.m_body2=def.body2;this.m_collideConnected=def.collideConnected;this.m_islandFlag=false;this.m_userData=def.userData;this.K=new b2Mat22();this.K1=new b2Mat22();this.K2=new b2Mat22();this.m_localAnchor=new b2Vec2();this.m_target=new b2Vec2();this.m_impulse=new b2Vec2();this.m_ptpMass=new b2Mat22();this.m_C=new b2Vec2();this.m_target.SetV(def.target);var tX=this.m_target.x-this.m_body2.m_position.x;var tY=this.m_target.y-this.m_body2.m_position.y;this.m_localAnchor.x=(tX*this.m_body2.m_R.col1.x+tY*this.m_body2.m_R.col1.y);this.m_localAnchor.y=(tX*this.m_body2.m_R.col2.x+tY*this.m_body2.m_R.col2.y);this.m_maxForce=def.maxForce;this.m_impulse.SetZero();var mass=this.m_body2.m_mass;var omega=2.0*b2Settings.b2_pi*def.frequencyHz;var d=2.0*mass*def.dampingRatio*omega;var k=mass*omega*omega;this.m_gamma=1.0/(d+def.timeStep*k);this.m_beta=def.timeStep*k/(d+def.timeStep*k);},K:new b2Mat22(),K1:new b2Mat22(),K2:new b2Mat22(),PrepareVelocitySolver:function(){var b=this.m_body2;var tMat;tMat=b.m_R;var rX=tMat.col1.x*this.m_localAnchor.x+tMat.col2.x*this.m_localAnchor.y;var rY=tMat.col1.y*this.m_localAnchor.x+tMat.col2.y*this.m_localAnchor.y;var invMass=b.m_invMass;var invI=b.m_invI;this.K1.col1.x=invMass;this.K1.col2.x=0.0;this.K1.col1.y=0.0;this.K1.col2.y=invMass;this.K2.col1.x=invI*rY*rY;this.K2.col2.x=-invI*rX*rY;this.K2.col1.y=-invI*rX*rY;this.K2.col2.y=invI*rX*rX;this.K.SetM(this.K1);this.K.AddM(this.K2);this.K.col1.x+=this.m_gamma;this.K.col2.y+=this.m_gamma;this.K.Invert(this.m_ptpMass);this.m_C.x=b.m_position.x+rX-this.m_target.x;this.m_C.y=b.m_position.y+rY-this.m_target.y;b.m_angularVelocity*=0.98;var PX=this.m_impulse.x;var PY=this.m_impulse.y;b.m_linearVelocity.x+=invMass*PX;b.m_linearVelocity.y+=invMass*PY;b.m_angularVelocity+=invI*(rX*PY-rY*PX);},SolveVelocityConstraints:function(step){var body=this.m_body2;var tMat;tMat=body.m_R;var rX=tMat.col1.x*this.m_localAnchor.x+tMat.col2.x*this.m_localAnchor.y;var rY=tMat.col1.y*this.m_localAnchor.x+tMat.col2.y*this.m_localAnchor.y;var CdotX=body.m_linearVelocity.x+(-body.m_angularVelocity*rY);var CdotY=body.m_linearVelocity.y+(body.m_angularVelocity*rX);tMat=this.m_ptpMass;var tX=CdotX+(this.m_beta*step.inv_dt)*this.m_C.x+this.m_gamma*this.m_impulse.x;var tY=CdotY+(this.m_beta*step.inv_dt)*this.m_C.y+this.m_gamma*this.m_impulse.y;var impulseX=-(tMat.col1.x*tX+tMat.col2.x*tY);var impulseY=-(tMat.col1.y*tX+tMat.col2.y*tY);var oldImpulseX=this.m_impulse.x;var oldImpulseY=this.m_impulse.y;this.m_impulse.x+=impulseX;this.m_impulse.y+=impulseY;var length=this.m_impulse.Length();if(length>step.dt*this.m_maxForce)
+{this.m_impulse.Multiply(step.dt*this.m_maxForce/length);}
+impulseX=this.m_impulse.x-oldImpulseX;impulseY=this.m_impulse.y-oldImpulseY;body.m_linearVelocity.x+=body.m_invMass*impulseX;body.m_linearVelocity.y+=body.m_invMass*impulseY;body.m_angularVelocity+=body.m_invI*(rX*impulseY-rY*impulseX);},SolvePositionConstraints:function(){return true;},m_localAnchor:new b2Vec2(),m_target:new b2Vec2(),m_impulse:new b2Vec2(),m_ptpMass:new b2Mat22(),m_C:new b2Vec2(),m_maxForce:null,m_beta:null,m_gamma:null});
+var b2MouseJointDef=Class.create();Object.extend(b2MouseJointDef.prototype,b2JointDef.prototype);Object.extend(b2MouseJointDef.prototype,{initialize:function()
+{this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.target=new b2Vec2();this.type=b2Joint.e_mouseJoint;this.maxForce=0.0;this.frequencyHz=5.0;this.dampingRatio=0.7;this.timeStep=1.0/60.0;},target:new b2Vec2(),maxForce:null,frequencyHz:null,dampingRatio:null,timeStep:null});
+var b2PrismaticJoint=Class.create();Object.extend(b2PrismaticJoint.prototype,b2Joint.prototype);Object.extend(b2PrismaticJoint.prototype,{GetAnchor1:function(){var b1=this.m_body1;var tVec=new b2Vec2();tVec.SetV(this.m_localAnchor1);tVec.MulM(b1.m_R);tVec.Add(b1.m_position);return tVec;},GetAnchor2:function(){var b2=this.m_body2;var tVec=new b2Vec2();tVec.SetV(this.m_localAnchor2);tVec.MulM(b2.m_R);tVec.Add(b2.m_position);return tVec;},GetJointTranslation:function(){var b1=this.m_body1;var b2=this.m_body2;var tMat;tMat=b1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var p1X=b1.m_position.x+r1X;var p1Y=b1.m_position.y+r1Y;var p2X=b2.m_position.x+r2X;var p2Y=b2.m_position.y+r2Y;var dX=p2X-p1X;var dY=p2Y-p1Y;tMat=b1.m_R;var ax1X=tMat.col1.x*this.m_localXAxis1.x+tMat.col2.x*this.m_localXAxis1.y;var ax1Y=tMat.col1.y*this.m_localXAxis1.x+tMat.col2.y*this.m_localXAxis1.y;var translation=ax1X*dX+ax1Y*dY;return translation;},GetJointSpeed:function(){var b1=this.m_body1;var b2=this.m_body2;var tMat;tMat=b1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var p1X=b1.m_position.x+r1X;var p1Y=b1.m_position.y+r1Y;var p2X=b2.m_position.x+r2X;var p2Y=b2.m_position.y+r2Y;var dX=p2X-p1X;var dY=p2Y-p1Y;tMat=b1.m_R;var ax1X=tMat.col1.x*this.m_localXAxis1.x+tMat.col2.x*this.m_localXAxis1.y;var ax1Y=tMat.col1.y*this.m_localXAxis1.x+tMat.col2.y*this.m_localXAxis1.y;var v1=b1.m_linearVelocity;var v2=b2.m_linearVelocity;var w1=b1.m_angularVelocity;var w2=b2.m_angularVelocity;var speed=(dX*(-w1*ax1Y)+dY*(w1*ax1X))+(ax1X*(((v2.x+(-w2*r2Y))-v1.x)-(-w1*r1Y))+ax1Y*(((v2.y+(w2*r2X))-v1.y)-(w1*r1X)));return speed;},GetMotorForce:function(invTimeStep){return invTimeStep*this.m_motorImpulse;},SetMotorSpeed:function(speed)
+{this.m_motorSpeed=speed;},SetMotorForce:function(force)
+{this.m_maxMotorForce=force;},GetReactionForce:function(invTimeStep)
+{var tImp=invTimeStep*this.m_limitImpulse;var tMat;tMat=this.m_body1.m_R;var ax1X=tImp*(tMat.col1.x*this.m_localXAxis1.x+tMat.col2.x*this.m_localXAxis1.y);var ax1Y=tImp*(tMat.col1.y*this.m_localXAxis1.x+tMat.col2.y*this.m_localXAxis1.y);var ay1X=tImp*(tMat.col1.x*this.m_localYAxis1.x+tMat.col2.x*this.m_localYAxis1.y);var ay1Y=tImp*(tMat.col1.y*this.m_localYAxis1.x+tMat.col2.y*this.m_localYAxis1.y);return new b2Vec2(ax1X+ay1X,ax1Y+ay1Y);},GetReactionTorque:function(invTimeStep)
+{return invTimeStep*this.m_angularImpulse;},initialize:function(def){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=def.type;this.m_prev=null;this.m_next=null;this.m_body1=def.body1;this.m_body2=def.body2;this.m_collideConnected=def.collideConnected;this.m_islandFlag=false;this.m_userData=def.userData;this.m_localAnchor1=new b2Vec2();this.m_localAnchor2=new b2Vec2();this.m_localXAxis1=new b2Vec2();this.m_localYAxis1=new b2Vec2();this.m_linearJacobian=new b2Jacobian();this.m_motorJacobian=new b2Jacobian();var tMat;var tX;var tY;tMat=this.m_body1.m_R;tX=(def.anchorPoint.x-this.m_body1.m_position.x);tY=(def.anchorPoint.y-this.m_body1.m_position.y);this.m_localAnchor1.Set((tX*tMat.col1.x+tY*tMat.col1.y),(tX*tMat.col2.x+tY*tMat.col2.y));tMat=this.m_body2.m_R;tX=(def.anchorPoint.x-this.m_body2.m_position.x);tY=(def.anchorPoint.y-this.m_body2.m_position.y);this.m_localAnchor2.Set((tX*tMat.col1.x+tY*tMat.col1.y),(tX*tMat.col2.x+tY*tMat.col2.y));tMat=this.m_body1.m_R;tX=def.axis.x;tY=def.axis.y;this.m_localXAxis1.Set((tX*tMat.col1.x+tY*tMat.col1.y),(tX*tMat.col2.x+tY*tMat.col2.y));this.m_localYAxis1.x=-this.m_localXAxis1.y;this.m_localYAxis1.y=this.m_localXAxis1.x;this.m_initialAngle=this.m_body2.m_rotation-this.m_body1.m_rotation;this.m_linearJacobian.SetZero();this.m_linearMass=0.0;this.m_linearImpulse=0.0;this.m_angularMass=0.0;this.m_angularImpulse=0.0;this.m_motorJacobian.SetZero();this.m_motorMass=0.0;this.m_motorImpulse=0.0;this.m_limitImpulse=0.0;this.m_limitPositionImpulse=0.0;this.m_lowerTranslation=def.lowerTranslation;this.m_upperTranslation=def.upperTranslation;this.m_maxMotorForce=def.motorForce;this.m_motorSpeed=def.motorSpeed;this.m_enableLimit=def.enableLimit;this.m_enableMotor=def.enableMotor;},PrepareVelocitySolver:function(){var b1=this.m_body1;var b2=this.m_body2;var tMat;tMat=b1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var invMass1=b1.m_invMass;var invMass2=b2.m_invMass;var invI1=b1.m_invI;var invI2=b2.m_invI;tMat=b1.m_R;var ay1X=tMat.col1.x*this.m_localYAxis1.x+tMat.col2.x*this.m_localYAxis1.y;var ay1Y=tMat.col1.y*this.m_localYAxis1.x+tMat.col2.y*this.m_localYAxis1.y;var eX=b2.m_position.x+r2X-b1.m_position.x;var eY=b2.m_position.y+r2Y-b1.m_position.y;this.m_linearJacobian.linear1.x=-ay1X;this.m_linearJacobian.linear1.y=-ay1Y;this.m_linearJacobian.linear2.x=ay1X;this.m_linearJacobian.linear2.y=ay1Y;this.m_linearJacobian.angular1=-(eX*ay1Y-eY*ay1X);this.m_linearJacobian.angular2=r2X*ay1Y-r2Y*ay1X;this.m_linearMass=invMass1+invI1*this.m_linearJacobian.angular1*this.m_linearJacobian.angular1+
+invMass2+invI2*this.m_linearJacobian.angular2*this.m_linearJacobian.angular2;this.m_linearMass=1.0/this.m_linearMass;this.m_angularMass=1.0/(invI1+invI2);if(this.m_enableLimit||this.m_enableMotor)
+{tMat=b1.m_R;var ax1X=tMat.col1.x*this.m_localXAxis1.x+tMat.col2.x*this.m_localXAxis1.y;var ax1Y=tMat.col1.y*this.m_localXAxis1.x+tMat.col2.y*this.m_localXAxis1.y;this.m_motorJacobian.linear1.x=-ax1X;this.m_motorJacobian.linear1.y=-ax1Y;this.m_motorJacobian.linear2.x=ax1X;this.m_motorJacobian.linear2.y=ax1Y;this.m_motorJacobian.angular1=-(eX*ax1Y-eY*ax1X);this.m_motorJacobian.angular2=r2X*ax1Y-r2Y*ax1X;this.m_motorMass=invMass1+invI1*this.m_motorJacobian.angular1*this.m_motorJacobian.angular1+
+invMass2+invI2*this.m_motorJacobian.angular2*this.m_motorJacobian.angular2;this.m_motorMass=1.0/this.m_motorMass;if(this.m_enableLimit)
+{var dX=eX-r1X;var dY=eY-r1Y;var jointTranslation=ax1X*dX+ax1Y*dY;if(b2Math.b2Abs(this.m_upperTranslation-this.m_lowerTranslation)<2.0*b2Settings.b2_linearSlop)
+{this.m_limitState=b2Joint.e_equalLimits;}
+else if(jointTranslation<=this.m_lowerTranslation)
+{if(this.m_limitState!=b2Joint.e_atLowerLimit)
+{this.m_limitImpulse=0.0;}
+this.m_limitState=b2Joint.e_atLowerLimit;}
+else if(jointTranslation>=this.m_upperTranslation)
+{if(this.m_limitState!=b2Joint.e_atUpperLimit)
+{this.m_limitImpulse=0.0;}
+this.m_limitState=b2Joint.e_atUpperLimit;}
+else
+{this.m_limitState=b2Joint.e_inactiveLimit;this.m_limitImpulse=0.0;}}}
+if(this.m_enableMotor==false)
+{this.m_motorImpulse=0.0;}
+if(this.m_enableLimit==false)
+{this.m_limitImpulse=0.0;}
+if(b2World.s_enableWarmStarting)
+{var P1X=this.m_linearImpulse*this.m_linearJacobian.linear1.x+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear1.x;var P1Y=this.m_linearImpulse*this.m_linearJacobian.linear1.y+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear1.y;var P2X=this.m_linearImpulse*this.m_linearJacobian.linear2.x+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear2.x;var P2Y=this.m_linearImpulse*this.m_linearJacobian.linear2.y+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear2.y;var L1=this.m_linearImpulse*this.m_linearJacobian.angular1-this.m_angularImpulse+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.angular1;var L2=this.m_linearImpulse*this.m_linearJacobian.angular2+this.m_angularImpulse+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.angular2;b1.m_linearVelocity.x+=invMass1*P1X;b1.m_linearVelocity.y+=invMass1*P1Y;b1.m_angularVelocity+=invI1*L1;b2.m_linearVelocity.x+=invMass2*P2X;b2.m_linearVelocity.y+=invMass2*P2Y;b2.m_angularVelocity+=invI2*L2;}
+else
+{this.m_linearImpulse=0.0;this.m_angularImpulse=0.0;this.m_limitImpulse=0.0;this.m_motorImpulse=0.0;}
+this.m_limitPositionImpulse=0.0;},SolveVelocityConstraints:function(step){var b1=this.m_body1;var b2=this.m_body2;var invMass1=b1.m_invMass;var invMass2=b2.m_invMass;var invI1=b1.m_invI;var invI2=b2.m_invI;var oldLimitImpulse;var linearCdot=this.m_linearJacobian.Compute(b1.m_linearVelocity,b1.m_angularVelocity,b2.m_linearVelocity,b2.m_angularVelocity);var linearImpulse=-this.m_linearMass*linearCdot;this.m_linearImpulse+=linearImpulse;b1.m_linearVelocity.x+=(invMass1*linearImpulse)*this.m_linearJacobian.linear1.x;b1.m_linearVelocity.y+=(invMass1*linearImpulse)*this.m_linearJacobian.linear1.y;b1.m_angularVelocity+=invI1*linearImpulse*this.m_linearJacobian.angular1;b2.m_linearVelocity.x+=(invMass2*linearImpulse)*this.m_linearJacobian.linear2.x;b2.m_linearVelocity.y+=(invMass2*linearImpulse)*this.m_linearJacobian.linear2.y;b2.m_angularVelocity+=invI2*linearImpulse*this.m_linearJacobian.angular2;var angularCdot=b2.m_angularVelocity-b1.m_angularVelocity;var angularImpulse=-this.m_angularMass*angularCdot;this.m_angularImpulse+=angularImpulse;b1.m_angularVelocity-=invI1*angularImpulse;b2.m_angularVelocity+=invI2*angularImpulse;if(this.m_enableMotor&&this.m_limitState!=b2Joint.e_equalLimits)
+{var motorCdot=this.m_motorJacobian.Compute(b1.m_linearVelocity,b1.m_angularVelocity,b2.m_linearVelocity,b2.m_angularVelocity)-this.m_motorSpeed;var motorImpulse=-this.m_motorMass*motorCdot;var oldMotorImpulse=this.m_motorImpulse;this.m_motorImpulse=b2Math.b2Clamp(this.m_motorImpulse+motorImpulse,-step.dt*this.m_maxMotorForce,step.dt*this.m_maxMotorForce);motorImpulse=this.m_motorImpulse-oldMotorImpulse;b1.m_linearVelocity.x+=(invMass1*motorImpulse)*this.m_motorJacobian.linear1.x;b1.m_linearVelocity.y+=(invMass1*motorImpulse)*this.m_motorJacobian.linear1.y;b1.m_angularVelocity+=invI1*motorImpulse*this.m_motorJacobian.angular1;b2.m_linearVelocity.x+=(invMass2*motorImpulse)*this.m_motorJacobian.linear2.x;b2.m_linearVelocity.y+=(invMass2*motorImpulse)*this.m_motorJacobian.linear2.y;b2.m_angularVelocity+=invI2*motorImpulse*this.m_motorJacobian.angular2;}
+if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit)
+{var limitCdot=this.m_motorJacobian.Compute(b1.m_linearVelocity,b1.m_angularVelocity,b2.m_linearVelocity,b2.m_angularVelocity);var limitImpulse=-this.m_motorMass*limitCdot;if(this.m_limitState==b2Joint.e_equalLimits)
+{this.m_limitImpulse+=limitImpulse;}
+else if(this.m_limitState==b2Joint.e_atLowerLimit)
+{oldLimitImpulse=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Max(this.m_limitImpulse+limitImpulse,0.0);limitImpulse=this.m_limitImpulse-oldLimitImpulse;}
+else if(this.m_limitState==b2Joint.e_atUpperLimit)
+{oldLimitImpulse=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Min(this.m_limitImpulse+limitImpulse,0.0);limitImpulse=this.m_limitImpulse-oldLimitImpulse;}
+b1.m_linearVelocity.x+=(invMass1*limitImpulse)*this.m_motorJacobian.linear1.x;b1.m_linearVelocity.y+=(invMass1*limitImpulse)*this.m_motorJacobian.linear1.y;b1.m_angularVelocity+=invI1*limitImpulse*this.m_motorJacobian.angular1;b2.m_linearVelocity.x+=(invMass2*limitImpulse)*this.m_motorJacobian.linear2.x;b2.m_linearVelocity.y+=(invMass2*limitImpulse)*this.m_motorJacobian.linear2.y;b2.m_angularVelocity+=invI2*limitImpulse*this.m_motorJacobian.angular2;}},SolvePositionConstraints:function(){var limitC;var oldLimitImpulse;var b1=this.m_body1;var b2=this.m_body2;var invMass1=b1.m_invMass;var invMass2=b2.m_invMass;var invI1=b1.m_invI;var invI2=b2.m_invI;var tMat;tMat=b1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var p1X=b1.m_position.x+r1X;var p1Y=b1.m_position.y+r1Y;var p2X=b2.m_position.x+r2X;var p2Y=b2.m_position.y+r2Y;var dX=p2X-p1X;var dY=p2Y-p1Y;tMat=b1.m_R;var ay1X=tMat.col1.x*this.m_localYAxis1.x+tMat.col2.x*this.m_localYAxis1.y;var ay1Y=tMat.col1.y*this.m_localYAxis1.x+tMat.col2.y*this.m_localYAxis1.y;var linearC=ay1X*dX+ay1Y*dY;linearC=b2Math.b2Clamp(linearC,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);var linearImpulse=-this.m_linearMass*linearC;b1.m_position.x+=(invMass1*linearImpulse)*this.m_linearJacobian.linear1.x;b1.m_position.y+=(invMass1*linearImpulse)*this.m_linearJacobian.linear1.y;b1.m_rotation+=invI1*linearImpulse*this.m_linearJacobian.angular1;b2.m_position.x+=(invMass2*linearImpulse)*this.m_linearJacobian.linear2.x;b2.m_position.y+=(invMass2*linearImpulse)*this.m_linearJacobian.linear2.y;b2.m_rotation+=invI2*linearImpulse*this.m_linearJacobian.angular2;var positionError=b2Math.b2Abs(linearC);var angularC=b2.m_rotation-b1.m_rotation-this.m_initialAngle;angularC=b2Math.b2Clamp(angularC,-b2Settings.b2_maxAngularCorrection,b2Settings.b2_maxAngularCorrection);var angularImpulse=-this.m_angularMass*angularC;b1.m_rotation-=b1.m_invI*angularImpulse;b1.m_R.Set(b1.m_rotation);b2.m_rotation+=b2.m_invI*angularImpulse;b2.m_R.Set(b2.m_rotation);var angularError=b2Math.b2Abs(angularC);if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit)
+{tMat=b1.m_R;r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;p1X=b1.m_position.x+r1X;p1Y=b1.m_position.y+r1Y;p2X=b2.m_position.x+r2X;p2Y=b2.m_position.y+r2Y;dX=p2X-p1X;dY=p2Y-p1Y;tMat=b1.m_R;var ax1X=tMat.col1.x*this.m_localXAxis1.x+tMat.col2.x*this.m_localXAxis1.y;var ax1Y=tMat.col1.y*this.m_localXAxis1.x+tMat.col2.y*this.m_localXAxis1.y;var translation=(ax1X*dX+ax1Y*dY);var limitImpulse=0.0;if(this.m_limitState==b2Joint.e_equalLimits)
+{limitC=b2Math.b2Clamp(translation,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);limitImpulse=-this.m_motorMass*limitC;positionError=b2Math.b2Max(positionError,b2Math.b2Abs(angularC));}
+else if(this.m_limitState==b2Joint.e_atLowerLimit)
+{limitC=translation-this.m_lowerTranslation;positionError=b2Math.b2Max(positionError,-limitC);limitC=b2Math.b2Clamp(limitC+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0.0);limitImpulse=-this.m_motorMass*limitC;oldLimitImpulse=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Max(this.m_limitPositionImpulse+limitImpulse,0.0);limitImpulse=this.m_limitPositionImpulse-oldLimitImpulse;}
+else if(this.m_limitState==b2Joint.e_atUpperLimit)
+{limitC=translation-this.m_upperTranslation;positionError=b2Math.b2Max(positionError,limitC);limitC=b2Math.b2Clamp(limitC-b2Settings.b2_linearSlop,0.0,b2Settings.b2_maxLinearCorrection);limitImpulse=-this.m_motorMass*limitC;oldLimitImpulse=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Min(this.m_limitPositionImpulse+limitImpulse,0.0);limitImpulse=this.m_limitPositionImpulse-oldLimitImpulse;}
+b1.m_position.x+=(invMass1*limitImpulse)*this.m_motorJacobian.linear1.x;b1.m_position.y+=(invMass1*limitImpulse)*this.m_motorJacobian.linear1.y;b1.m_rotation+=invI1*limitImpulse*this.m_motorJacobian.angular1;b1.m_R.Set(b1.m_rotation);b2.m_position.x+=(invMass2*limitImpulse)*this.m_motorJacobian.linear2.x;b2.m_position.y+=(invMass2*limitImpulse)*this.m_motorJacobian.linear2.y;b2.m_rotation+=invI2*limitImpulse*this.m_motorJacobian.angular2;b2.m_R.Set(b2.m_rotation);}
+return positionError<=b2Settings.b2_linearSlop&&angularError<=b2Settings.b2_angularSlop;},m_localAnchor1:new b2Vec2(),m_localAnchor2:new b2Vec2(),m_localXAxis1:new b2Vec2(),m_localYAxis1:new b2Vec2(),m_initialAngle:null,m_linearJacobian:new b2Jacobian(),m_linearMass:null,m_linearImpulse:null,m_angularMass:null,m_angularImpulse:null,m_motorJacobian:new b2Jacobian(),m_motorMass:null,m_motorImpulse:null,m_limitImpulse:null,m_limitPositionImpulse:null,m_lowerTranslation:null,m_upperTranslation:null,m_maxMotorForce:null,m_motorSpeed:null,m_enableLimit:null,m_enableMotor:null,m_limitState:0});
+var b2PrismaticJointDef=Class.create();Object.extend(b2PrismaticJointDef.prototype,b2JointDef.prototype);Object.extend(b2PrismaticJointDef.prototype,{initialize:function()
+{this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.type=b2Joint.e_prismaticJoint;this.anchorPoint=new b2Vec2(0.0,0.0);this.axis=new b2Vec2(0.0,0.0);this.lowerTranslation=0.0;this.upperTranslation=0.0;this.motorForce=0.0;this.motorSpeed=0.0;this.enableLimit=false;this.enableMotor=false;},anchorPoint:null,axis:null,lowerTranslation:null,upperTranslation:null,motorForce:null,motorSpeed:null,enableLimit:null,enableMotor:null});
+var b2PulleyJoint=Class.create();Object.extend(b2PulleyJoint.prototype,b2Joint.prototype);Object.extend(b2PulleyJoint.prototype,{GetAnchor1:function(){var tMat=this.m_body1.m_R;return new b2Vec2(this.m_body1.m_position.x+(tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y),this.m_body1.m_position.y+(tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y));},GetAnchor2:function(){var tMat=this.m_body2.m_R;return new b2Vec2(this.m_body2.m_position.x+(tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y),this.m_body2.m_position.y+(tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y));},GetGroundPoint1:function(){return new b2Vec2(this.m_ground.m_position.x+this.m_groundAnchor1.x,this.m_ground.m_position.y+this.m_groundAnchor1.y);},GetGroundPoint2:function(){return new b2Vec2(this.m_ground.m_position.x+this.m_groundAnchor2.x,this.m_ground.m_position.y+this.m_groundAnchor2.y);},GetReactionForce:function(invTimeStep){return new b2Vec2();},GetReactionTorque:function(invTimeStep){return 0.0;},GetLength1:function(){var tMat;tMat=this.m_body1.m_R;var pX=this.m_body1.m_position.x+(tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y);var pY=this.m_body1.m_position.y+(tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y);var dX=pX-(this.m_ground.m_position.x+this.m_groundAnchor1.x);var dY=pY-(this.m_ground.m_position.y+this.m_groundAnchor1.y);return Math.sqrt(dX*dX+dY*dY);},GetLength2:function(){var tMat;tMat=this.m_body2.m_R;var pX=this.m_body2.m_position.x+(tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y);var pY=this.m_body2.m_position.y+(tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y);var dX=pX-(this.m_ground.m_position.x+this.m_groundAnchor2.x);var dY=pY-(this.m_ground.m_position.y+this.m_groundAnchor2.y);return Math.sqrt(dX*dX+dY*dY);},GetRatio:function(){return this.m_ratio;},initialize:function(def){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=def.type;this.m_prev=null;this.m_next=null;this.m_body1=def.body1;this.m_body2=def.body2;this.m_collideConnected=def.collideConnected;this.m_islandFlag=false;this.m_userData=def.userData;this.m_groundAnchor1=new b2Vec2();this.m_groundAnchor2=new b2Vec2();this.m_localAnchor1=new b2Vec2();this.m_localAnchor2=new b2Vec2();this.m_u1=new b2Vec2();this.m_u2=new b2Vec2();var tMat;var tX;var tY;this.m_ground=this.m_body1.m_world.m_groundBody;this.m_groundAnchor1.x=def.groundPoint1.x-this.m_ground.m_position.x;this.m_groundAnchor1.y=def.groundPoint1.y-this.m_ground.m_position.y;this.m_groundAnchor2.x=def.groundPoint2.x-this.m_ground.m_position.x;this.m_groundAnchor2.y=def.groundPoint2.y-this.m_ground.m_position.y;tMat=this.m_body1.m_R;tX=def.anchorPoint1.x-this.m_body1.m_position.x;tY=def.anchorPoint1.y-this.m_body1.m_position.y;this.m_localAnchor1.x=tX*tMat.col1.x+tY*tMat.col1.y;this.m_localAnchor1.y=tX*tMat.col2.x+tY*tMat.col2.y;tMat=this.m_body2.m_R;tX=def.anchorPoint2.x-this.m_body2.m_position.x;tY=def.anchorPoint2.y-this.m_body2.m_position.y;this.m_localAnchor2.x=tX*tMat.col1.x+tY*tMat.col1.y;this.m_localAnchor2.y=tX*tMat.col2.x+tY*tMat.col2.y;this.m_ratio=def.ratio;tX=def.groundPoint1.x-def.anchorPoint1.x;tY=def.groundPoint1.y-def.anchorPoint1.y;var d1Len=Math.sqrt(tX*tX+tY*tY);tX=def.groundPoint2.x-def.anchorPoint2.x;tY=def.groundPoint2.y-def.anchorPoint2.y;var d2Len=Math.sqrt(tX*tX+tY*tY);var length1=b2Math.b2Max(0.5*b2PulleyJoint.b2_minPulleyLength,d1Len);var length2=b2Math.b2Max(0.5*b2PulleyJoint.b2_minPulleyLength,d2Len);this.m_constant=length1+this.m_ratio*length2;this.m_maxLength1=b2Math.b2Clamp(def.maxLength1,length1,this.m_constant-this.m_ratio*b2PulleyJoint.b2_minPulleyLength);this.m_maxLength2=b2Math.b2Clamp(def.maxLength2,length2,(this.m_constant-b2PulleyJoint.b2_minPulleyLength)/this.m_ratio);this.m_pulleyImpulse=0.0;this.m_limitImpulse1=0.0;this.m_limitImpulse2=0.0;},PrepareVelocitySolver:function(){var b1=this.m_body1;var b2=this.m_body2;var tMat;tMat=b1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var p1X=b1.m_position.x+r1X;var p1Y=b1.m_position.y+r1Y;var p2X=b2.m_position.x+r2X;var p2Y=b2.m_position.y+r2Y;var s1X=this.m_ground.m_position.x+this.m_groundAnchor1.x;var s1Y=this.m_ground.m_position.y+this.m_groundAnchor1.y;var s2X=this.m_ground.m_position.x+this.m_groundAnchor2.x;var s2Y=this.m_ground.m_position.y+this.m_groundAnchor2.y;this.m_u1.Set(p1X-s1X,p1Y-s1Y);this.m_u2.Set(p2X-s2X,p2Y-s2Y);var length1=this.m_u1.Length();var length2=this.m_u2.Length();if(length1>b2Settings.b2_linearSlop)
+{this.m_u1.Multiply(1.0/length1);}
+else
+{this.m_u1.SetZero();}
+if(length2>b2Settings.b2_linearSlop)
+{this.m_u2.Multiply(1.0/length2);}
+else
+{this.m_u2.SetZero();}
+if(length1<this.m_maxLength1)
+{this.m_limitState1=b2Joint.e_inactiveLimit;this.m_limitImpulse1=0.0;}
+else
+{this.m_limitState1=b2Joint.e_atUpperLimit;this.m_limitPositionImpulse1=0.0;}
+if(length2<this.m_maxLength2)
+{this.m_limitState2=b2Joint.e_inactiveLimit;this.m_limitImpulse2=0.0;}
+else
+{this.m_limitState2=b2Joint.e_atUpperLimit;this.m_limitPositionImpulse2=0.0;}
+var cr1u1=r1X*this.m_u1.y-r1Y*this.m_u1.x;var cr2u2=r2X*this.m_u2.y-r2Y*this.m_u2.x;this.m_limitMass1=b1.m_invMass+b1.m_invI*cr1u1*cr1u1;this.m_limitMass2=b2.m_invMass+b2.m_invI*cr2u2*cr2u2;this.m_pulleyMass=this.m_limitMass1+this.m_ratio*this.m_ratio*this.m_limitMass2;this.m_limitMass1=1.0/this.m_limitMass1;this.m_limitMass2=1.0/this.m_limitMass2;this.m_pulleyMass=1.0/this.m_pulleyMass;var P1X=(-this.m_pulleyImpulse-this.m_limitImpulse1)*this.m_u1.x;var P1Y=(-this.m_pulleyImpulse-this.m_limitImpulse1)*this.m_u1.y;var P2X=(-this.m_ratio*this.m_pulleyImpulse-this.m_limitImpulse2)*this.m_u2.x;var P2Y=(-this.m_ratio*this.m_pulleyImpulse-this.m_limitImpulse2)*this.m_u2.y;b1.m_linearVelocity.x+=b1.m_invMass*P1X;b1.m_linearVelocity.y+=b1.m_invMass*P1Y;b1.m_angularVelocity+=b1.m_invI*(r1X*P1Y-r1Y*P1X);b2.m_linearVelocity.x+=b2.m_invMass*P2X;b2.m_linearVelocity.y+=b2.m_invMass*P2Y;b2.m_angularVelocity+=b2.m_invI*(r2X*P2Y-r2Y*P2X);},SolveVelocityConstraints:function(step){var b1=this.m_body1;var b2=this.m_body2;var tMat;tMat=b1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var v1X;var v1Y;var v2X;var v2Y;var P1X;var P1Y;var P2X;var P2Y;var Cdot;var impulse;var oldLimitImpulse;v1X=b1.m_linearVelocity.x+(-b1.m_angularVelocity*r1Y);v1Y=b1.m_linearVelocity.y+(b1.m_angularVelocity*r1X);v2X=b2.m_linearVelocity.x+(-b2.m_angularVelocity*r2Y);v2Y=b2.m_linearVelocity.y+(b2.m_angularVelocity*r2X);Cdot=-(this.m_u1.x*v1X+this.m_u1.y*v1Y)-this.m_ratio*(this.m_u2.x*v2X+this.m_u2.y*v2Y);impulse=-this.m_pulleyMass*Cdot;this.m_pulleyImpulse+=impulse;P1X=-impulse*this.m_u1.x;P1Y=-impulse*this.m_u1.y;P2X=-this.m_ratio*impulse*this.m_u2.x;P2Y=-this.m_ratio*impulse*this.m_u2.y;b1.m_linearVelocity.x+=b1.m_invMass*P1X;b1.m_linearVelocity.y+=b1.m_invMass*P1Y;b1.m_angularVelocity+=b1.m_invI*(r1X*P1Y-r1Y*P1X);b2.m_linearVelocity.x+=b2.m_invMass*P2X;b2.m_linearVelocity.y+=b2.m_invMass*P2Y;b2.m_angularVelocity+=b2.m_invI*(r2X*P2Y-r2Y*P2X);if(this.m_limitState1==b2Joint.e_atUpperLimit)
+{v1X=b1.m_linearVelocity.x+(-b1.m_angularVelocity*r1Y);v1Y=b1.m_linearVelocity.y+(b1.m_angularVelocity*r1X);Cdot=-(this.m_u1.x*v1X+this.m_u1.y*v1Y);impulse=-this.m_limitMass1*Cdot;oldLimitImpulse=this.m_limitImpulse1;this.m_limitImpulse1=b2Math.b2Max(0.0,this.m_limitImpulse1+impulse);impulse=this.m_limitImpulse1-oldLimitImpulse;P1X=-impulse*this.m_u1.x;P1Y=-impulse*this.m_u1.y;b1.m_linearVelocity.x+=b1.m_invMass*P1X;b1.m_linearVelocity.y+=b1.m_invMass*P1Y;b1.m_angularVelocity+=b1.m_invI*(r1X*P1Y-r1Y*P1X);}
+if(this.m_limitState2==b2Joint.e_atUpperLimit)
+{v2X=b2.m_linearVelocity.x+(-b2.m_angularVelocity*r2Y);v2Y=b2.m_linearVelocity.y+(b2.m_angularVelocity*r2X);Cdot=-(this.m_u2.x*v2X+this.m_u2.y*v2Y);impulse=-this.m_limitMass2*Cdot;oldLimitImpulse=this.m_limitImpulse2;this.m_limitImpulse2=b2Math.b2Max(0.0,this.m_limitImpulse2+impulse);impulse=this.m_limitImpulse2-oldLimitImpulse;P2X=-impulse*this.m_u2.x;P2Y=-impulse*this.m_u2.y;b2.m_linearVelocity.x+=b2.m_invMass*P2X;b2.m_linearVelocity.y+=b2.m_invMass*P2Y;b2.m_angularVelocity+=b2.m_invI*(r2X*P2Y-r2Y*P2X);}},SolvePositionConstraints:function(){var b1=this.m_body1;var b2=this.m_body2;var tMat;var s1X=this.m_ground.m_position.x+this.m_groundAnchor1.x;var s1Y=this.m_ground.m_position.y+this.m_groundAnchor1.y;var s2X=this.m_ground.m_position.x+this.m_groundAnchor2.x;var s2Y=this.m_ground.m_position.y+this.m_groundAnchor2.y;var r1X;var r1Y;var r2X;var r2Y;var p1X;var p1Y;var p2X;var p2Y;var length1;var length2;var C;var impulse;var oldLimitPositionImpulse;var linearError=0.0;{tMat=b1.m_R;r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;p1X=b1.m_position.x+r1X;p1Y=b1.m_position.y+r1Y;p2X=b2.m_position.x+r2X;p2Y=b2.m_position.y+r2Y;this.m_u1.Set(p1X-s1X,p1Y-s1Y);this.m_u2.Set(p2X-s2X,p2Y-s2Y);length1=this.m_u1.Length();length2=this.m_u2.Length();if(length1>b2Settings.b2_linearSlop)
+{this.m_u1.Multiply(1.0/length1);}
+else
+{this.m_u1.SetZero();}
+if(length2>b2Settings.b2_linearSlop)
+{this.m_u2.Multiply(1.0/length2);}
+else
+{this.m_u2.SetZero();}
+C=this.m_constant-length1-this.m_ratio*length2;linearError=b2Math.b2Max(linearError,Math.abs(C));C=b2Math.b2Clamp(C,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);impulse=-this.m_pulleyMass*C;p1X=-impulse*this.m_u1.x;p1Y=-impulse*this.m_u1.y;p2X=-this.m_ratio*impulse*this.m_u2.x;p2Y=-this.m_ratio*impulse*this.m_u2.y;b1.m_position.x+=b1.m_invMass*p1X;b1.m_position.y+=b1.m_invMass*p1Y;b1.m_rotation+=b1.m_invI*(r1X*p1Y-r1Y*p1X);b2.m_position.x+=b2.m_invMass*p2X;b2.m_position.y+=b2.m_invMass*p2Y;b2.m_rotation+=b2.m_invI*(r2X*p2Y-r2Y*p2X);b1.m_R.Set(b1.m_rotation);b2.m_R.Set(b2.m_rotation);}
+if(this.m_limitState1==b2Joint.e_atUpperLimit)
+{tMat=b1.m_R;r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;p1X=b1.m_position.x+r1X;p1Y=b1.m_position.y+r1Y;this.m_u1.Set(p1X-s1X,p1Y-s1Y);length1=this.m_u1.Length();if(length1>b2Settings.b2_linearSlop)
+{this.m_u1.x*=1.0/length1;this.m_u1.y*=1.0/length1;}
+else
+{this.m_u1.SetZero();}
+C=this.m_maxLength1-length1;linearError=b2Math.b2Max(linearError,-C);C=b2Math.b2Clamp(C+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0.0);impulse=-this.m_limitMass1*C;oldLimitPositionImpulse=this.m_limitPositionImpulse1;this.m_limitPositionImpulse1=b2Math.b2Max(0.0,this.m_limitPositionImpulse1+impulse);impulse=this.m_limitPositionImpulse1-oldLimitPositionImpulse;p1X=-impulse*this.m_u1.x;p1Y=-impulse*this.m_u1.y;b1.m_position.x+=b1.m_invMass*p1X;b1.m_position.y+=b1.m_invMass*p1Y;b1.m_rotation+=b1.m_invI*(r1X*p1Y-r1Y*p1X);b1.m_R.Set(b1.m_rotation);}
+if(this.m_limitState2==b2Joint.e_atUpperLimit)
+{tMat=b2.m_R;r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;p2X=b2.m_position.x+r2X;p2Y=b2.m_position.y+r2Y;this.m_u2.Set(p2X-s2X,p2Y-s2Y);length2=this.m_u2.Length();if(length2>b2Settings.b2_linearSlop)
+{this.m_u2.x*=1.0/length2;this.m_u2.y*=1.0/length2;}
+else
+{this.m_u2.SetZero();}
+C=this.m_maxLength2-length2;linearError=b2Math.b2Max(linearError,-C);C=b2Math.b2Clamp(C+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0.0);impulse=-this.m_limitMass2*C;oldLimitPositionImpulse=this.m_limitPositionImpulse2;this.m_limitPositionImpulse2=b2Math.b2Max(0.0,this.m_limitPositionImpulse2+impulse);impulse=this.m_limitPositionImpulse2-oldLimitPositionImpulse;p2X=-impulse*this.m_u2.x;p2Y=-impulse*this.m_u2.y;b2.m_position.x+=b2.m_invMass*p2X;b2.m_position.y+=b2.m_invMass*p2Y;b2.m_rotation+=b2.m_invI*(r2X*p2Y-r2Y*p2X);b2.m_R.Set(b2.m_rotation);}
+return linearError<b2Settings.b2_linearSlop;},m_ground:null,m_groundAnchor1:new b2Vec2(),m_groundAnchor2:new b2Vec2(),m_localAnchor1:new b2Vec2(),m_localAnchor2:new b2Vec2(),m_u1:new b2Vec2(),m_u2:new b2Vec2(),m_constant:null,m_ratio:null,m_maxLength1:null,m_maxLength2:null,m_pulleyMass:null,m_limitMass1:null,m_limitMass2:null,m_pulleyImpulse:null,m_limitImpulse1:null,m_limitImpulse2:null,m_limitPositionImpulse1:null,m_limitPositionImpulse2:null,m_limitState1:0,m_limitState2:0});b2PulleyJoint.b2_minPulleyLength=b2Settings.b2_lengthUnitsPerMeter;
+var b2PulleyJointDef=Class.create();Object.extend(b2PulleyJointDef.prototype,b2JointDef.prototype);Object.extend(b2PulleyJointDef.prototype,{initialize:function()
+{this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.groundPoint1=new b2Vec2();this.groundPoint2=new b2Vec2();this.anchorPoint1=new b2Vec2();this.anchorPoint2=new b2Vec2();this.type=b2Joint.e_pulleyJoint;this.groundPoint1.Set(-1.0,1.0);this.groundPoint2.Set(1.0,1.0);this.anchorPoint1.Set(-1.0,0.0);this.anchorPoint2.Set(1.0,0.0);this.maxLength1=0.5*b2PulleyJoint.b2_minPulleyLength;this.maxLength2=0.5*b2PulleyJoint.b2_minPulleyLength;this.ratio=1.0;this.collideConnected=true;},groundPoint1:new b2Vec2(),groundPoint2:new b2Vec2(),anchorPoint1:new b2Vec2(),anchorPoint2:new b2Vec2(),maxLength1:null,maxLength2:null,ratio:null});
+var b2RevoluteJoint=Class.create();Object.extend(b2RevoluteJoint.prototype,b2Joint.prototype);Object.extend(b2RevoluteJoint.prototype,{GetAnchor1:function(){var tMat=this.m_body1.m_R;return new b2Vec2(this.m_body1.m_position.x+(tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y),this.m_body1.m_position.y+(tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y));},GetAnchor2:function(){var tMat=this.m_body2.m_R;return new b2Vec2(this.m_body2.m_position.x+(tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y),this.m_body2.m_position.y+(tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y));},GetJointAngle:function(){return this.m_body2.m_rotation-this.m_body1.m_rotation;},GetJointSpeed:function(){return this.m_body2.m_angularVelocity-this.m_body1.m_angularVelocity;},GetMotorTorque:function(invTimeStep){return invTimeStep*this.m_motorImpulse;},SetMotorSpeed:function(speed)
+{this.m_motorSpeed=speed;},SetMotorTorque:function(torque)
+{this.m_maxMotorTorque=torque;},GetReactionForce:function(invTimeStep)
+{var tVec=this.m_ptpImpulse.Copy();tVec.Multiply(invTimeStep);return tVec;},GetReactionTorque:function(invTimeStep)
+{return invTimeStep*this.m_limitImpulse;},initialize:function(def){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=def.type;this.m_prev=null;this.m_next=null;this.m_body1=def.body1;this.m_body2=def.body2;this.m_collideConnected=def.collideConnected;this.m_islandFlag=false;this.m_userData=def.userData;this.K=new b2Mat22();this.K1=new b2Mat22();this.K2=new b2Mat22();this.K3=new b2Mat22();this.m_localAnchor1=new b2Vec2();this.m_localAnchor2=new b2Vec2();this.m_ptpImpulse=new b2Vec2();this.m_ptpMass=new b2Mat22();var tMat;var tX;var tY;tMat=this.m_body1.m_R;tX=def.anchorPoint.x-this.m_body1.m_position.x;tY=def.anchorPoint.y-this.m_body1.m_position.y;this.m_localAnchor1.x=tX*tMat.col1.x+tY*tMat.col1.y;this.m_localAnchor1.y=tX*tMat.col2.x+tY*tMat.col2.y;tMat=this.m_body2.m_R;tX=def.anchorPoint.x-this.m_body2.m_position.x;tY=def.anchorPoint.y-this.m_body2.m_position.y;this.m_localAnchor2.x=tX*tMat.col1.x+tY*tMat.col1.y;this.m_localAnchor2.y=tX*tMat.col2.x+tY*tMat.col2.y;this.m_intialAngle=this.m_body2.m_rotation-this.m_body1.m_rotation;this.m_ptpImpulse.Set(0.0,0.0);this.m_motorImpulse=0.0;this.m_limitImpulse=0.0;this.m_limitPositionImpulse=0.0;this.m_lowerAngle=def.lowerAngle;this.m_upperAngle=def.upperAngle;this.m_maxMotorTorque=def.motorTorque;this.m_motorSpeed=def.motorSpeed;this.m_enableLimit=def.enableLimit;this.m_enableMotor=def.enableMotor;},K:new b2Mat22(),K1:new b2Mat22(),K2:new b2Mat22(),K3:new b2Mat22(),PrepareVelocitySolver:function(){var b1=this.m_body1;var b2=this.m_body2;var tMat;tMat=b1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var invMass1=b1.m_invMass;var invMass2=b2.m_invMass;var invI1=b1.m_invI;var invI2=b2.m_invI;this.K1.col1.x=invMass1+invMass2;this.K1.col2.x=0.0;this.K1.col1.y=0.0;this.K1.col2.y=invMass1+invMass2;this.K2.col1.x=invI1*r1Y*r1Y;this.K2.col2.x=-invI1*r1X*r1Y;this.K2.col1.y=-invI1*r1X*r1Y;this.K2.col2.y=invI1*r1X*r1X;this.K3.col1.x=invI2*r2Y*r2Y;this.K3.col2.x=-invI2*r2X*r2Y;this.K3.col1.y=-invI2*r2X*r2Y;this.K3.col2.y=invI2*r2X*r2X;this.K.SetM(this.K1);this.K.AddM(this.K2);this.K.AddM(this.K3);this.K.Invert(this.m_ptpMass);this.m_motorMass=1.0/(invI1+invI2);if(this.m_enableMotor==false)
+{this.m_motorImpulse=0.0;}
+if(this.m_enableLimit)
+{var jointAngle=b2.m_rotation-b1.m_rotation-this.m_intialAngle;if(b2Math.b2Abs(this.m_upperAngle-this.m_lowerAngle)<2.0*b2Settings.b2_angularSlop)
+{this.m_limitState=b2Joint.e_equalLimits;}
+else if(jointAngle<=this.m_lowerAngle)
+{if(this.m_limitState!=b2Joint.e_atLowerLimit)
+{this.m_limitImpulse=0.0;}
+this.m_limitState=b2Joint.e_atLowerLimit;}
+else if(jointAngle>=this.m_upperAngle)
+{if(this.m_limitState!=b2Joint.e_atUpperLimit)
+{this.m_limitImpulse=0.0;}
+this.m_limitState=b2Joint.e_atUpperLimit;}
+else
+{this.m_limitState=b2Joint.e_inactiveLimit;this.m_limitImpulse=0.0;}}
+else
+{this.m_limitImpulse=0.0;}
+if(b2World.s_enableWarmStarting)
+{b1.m_linearVelocity.x-=invMass1*this.m_ptpImpulse.x;b1.m_linearVelocity.y-=invMass1*this.m_ptpImpulse.y;b1.m_angularVelocity-=invI1*((r1X*this.m_ptpImpulse.y-r1Y*this.m_ptpImpulse.x)+this.m_motorImpulse+this.m_limitImpulse);b2.m_linearVelocity.x+=invMass2*this.m_ptpImpulse.x;b2.m_linearVelocity.y+=invMass2*this.m_ptpImpulse.y;b2.m_angularVelocity+=invI2*((r2X*this.m_ptpImpulse.y-r2Y*this.m_ptpImpulse.x)+this.m_motorImpulse+this.m_limitImpulse);}
+else{this.m_ptpImpulse.SetZero();this.m_motorImpulse=0.0;this.m_limitImpulse=0.0;}
+this.m_limitPositionImpulse=0.0;},SolveVelocityConstraints:function(step){var b1=this.m_body1;var b2=this.m_body2;var tMat;tMat=b1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var oldLimitImpulse;var ptpCdotX=b2.m_linearVelocity.x+(-b2.m_angularVelocity*r2Y)-b1.m_linearVelocity.x-(-b1.m_angularVelocity*r1Y);var ptpCdotY=b2.m_linearVelocity.y+(b2.m_angularVelocity*r2X)-b1.m_linearVelocity.y-(b1.m_angularVelocity*r1X);var ptpImpulseX=-(this.m_ptpMass.col1.x*ptpCdotX+this.m_ptpMass.col2.x*ptpCdotY);var ptpImpulseY=-(this.m_ptpMass.col1.y*ptpCdotX+this.m_ptpMass.col2.y*ptpCdotY);this.m_ptpImpulse.x+=ptpImpulseX;this.m_ptpImpulse.y+=ptpImpulseY;b1.m_linearVelocity.x-=b1.m_invMass*ptpImpulseX;b1.m_linearVelocity.y-=b1.m_invMass*ptpImpulseY;b1.m_angularVelocity-=b1.m_invI*(r1X*ptpImpulseY-r1Y*ptpImpulseX);b2.m_linearVelocity.x+=b2.m_invMass*ptpImpulseX;b2.m_linearVelocity.y+=b2.m_invMass*ptpImpulseY;b2.m_angularVelocity+=b2.m_invI*(r2X*ptpImpulseY-r2Y*ptpImpulseX);if(this.m_enableMotor&&this.m_limitState!=b2Joint.e_equalLimits)
+{var motorCdot=b2.m_angularVelocity-b1.m_angularVelocity-this.m_motorSpeed;var motorImpulse=-this.m_motorMass*motorCdot;var oldMotorImpulse=this.m_motorImpulse;this.m_motorImpulse=b2Math.b2Clamp(this.m_motorImpulse+motorImpulse,-step.dt*this.m_maxMotorTorque,step.dt*this.m_maxMotorTorque);motorImpulse=this.m_motorImpulse-oldMotorImpulse;b1.m_angularVelocity-=b1.m_invI*motorImpulse;b2.m_angularVelocity+=b2.m_invI*motorImpulse;}
+if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit)
+{var limitCdot=b2.m_angularVelocity-b1.m_angularVelocity;var limitImpulse=-this.m_motorMass*limitCdot;if(this.m_limitState==b2Joint.e_equalLimits)
+{this.m_limitImpulse+=limitImpulse;}
+else if(this.m_limitState==b2Joint.e_atLowerLimit)
+{oldLimitImpulse=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Max(this.m_limitImpulse+limitImpulse,0.0);limitImpulse=this.m_limitImpulse-oldLimitImpulse;}
+else if(this.m_limitState==b2Joint.e_atUpperLimit)
+{oldLimitImpulse=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Min(this.m_limitImpulse+limitImpulse,0.0);limitImpulse=this.m_limitImpulse-oldLimitImpulse;}
+b1.m_angularVelocity-=b1.m_invI*limitImpulse;b2.m_angularVelocity+=b2.m_invI*limitImpulse;}},SolvePositionConstraints:function(){var oldLimitImpulse;var limitC;var b1=this.m_body1;var b2=this.m_body2;var positionError=0.0;var tMat;tMat=b1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var p1X=b1.m_position.x+r1X;var p1Y=b1.m_position.y+r1Y;var p2X=b2.m_position.x+r2X;var p2Y=b2.m_position.y+r2Y;var ptpCX=p2X-p1X;var ptpCY=p2Y-p1Y;positionError=Math.sqrt(ptpCX*ptpCX+ptpCY*ptpCY);var invMass1=b1.m_invMass;var invMass2=b2.m_invMass;var invI1=b1.m_invI;var invI2=b2.m_invI;this.K1.col1.x=invMass1+invMass2;this.K1.col2.x=0.0;this.K1.col1.y=0.0;this.K1.col2.y=invMass1+invMass2;this.K2.col1.x=invI1*r1Y*r1Y;this.K2.col2.x=-invI1*r1X*r1Y;this.K2.col1.y=-invI1*r1X*r1Y;this.K2.col2.y=invI1*r1X*r1X;this.K3.col1.x=invI2*r2Y*r2Y;this.K3.col2.x=-invI2*r2X*r2Y;this.K3.col1.y=-invI2*r2X*r2Y;this.K3.col2.y=invI2*r2X*r2X;this.K.SetM(this.K1);this.K.AddM(this.K2);this.K.AddM(this.K3);this.K.Solve(b2RevoluteJoint.tImpulse,-ptpCX,-ptpCY);var impulseX=b2RevoluteJoint.tImpulse.x;var impulseY=b2RevoluteJoint.tImpulse.y;b1.m_position.x-=b1.m_invMass*impulseX;b1.m_position.y-=b1.m_invMass*impulseY;b1.m_rotation-=b1.m_invI*(r1X*impulseY-r1Y*impulseX);b1.m_R.Set(b1.m_rotation);b2.m_position.x+=b2.m_invMass*impulseX;b2.m_position.y+=b2.m_invMass*impulseY;b2.m_rotation+=b2.m_invI*(r2X*impulseY-r2Y*impulseX);b2.m_R.Set(b2.m_rotation);var angularError=0.0;if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit)
+{var angle=b2.m_rotation-b1.m_rotation-this.m_intialAngle;var limitImpulse=0.0;if(this.m_limitState==b2Joint.e_equalLimits)
+{limitC=b2Math.b2Clamp(angle,-b2Settings.b2_maxAngularCorrection,b2Settings.b2_maxAngularCorrection);limitImpulse=-this.m_motorMass*limitC;angularError=b2Math.b2Abs(limitC);}
+else if(this.m_limitState==b2Joint.e_atLowerLimit)
+{limitC=angle-this.m_lowerAngle;angularError=b2Math.b2Max(0.0,-limitC);limitC=b2Math.b2Clamp(limitC+b2Settings.b2_angularSlop,-b2Settings.b2_maxAngularCorrection,0.0);limitImpulse=-this.m_motorMass*limitC;oldLimitImpulse=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Max(this.m_limitPositionImpulse+limitImpulse,0.0);limitImpulse=this.m_limitPositionImpulse-oldLimitImpulse;}
+else if(this.m_limitState==b2Joint.e_atUpperLimit)
+{limitC=angle-this.m_upperAngle;angularError=b2Math.b2Max(0.0,limitC);limitC=b2Math.b2Clamp(limitC-b2Settings.b2_angularSlop,0.0,b2Settings.b2_maxAngularCorrection);limitImpulse=-this.m_motorMass*limitC;oldLimitImpulse=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Min(this.m_limitPositionImpulse+limitImpulse,0.0);limitImpulse=this.m_limitPositionImpulse-oldLimitImpulse;}
+b1.m_rotation-=b1.m_invI*limitImpulse;b1.m_R.Set(b1.m_rotation);b2.m_rotation+=b2.m_invI*limitImpulse;b2.m_R.Set(b2.m_rotation);}
+return positionError<=b2Settings.b2_linearSlop&&angularError<=b2Settings.b2_angularSlop;},m_localAnchor1:new b2Vec2(),m_localAnchor2:new b2Vec2(),m_ptpImpulse:new b2Vec2(),m_motorImpulse:null,m_limitImpulse:null,m_limitPositionImpulse:null,m_ptpMass:new b2Mat22(),m_motorMass:null,m_intialAngle:null,m_lowerAngle:null,m_upperAngle:null,m_maxMotorTorque:null,m_motorSpeed:null,m_enableLimit:null,m_enableMotor:null,m_limitState:0});b2RevoluteJoint.tImpulse=new b2Vec2();
+var b2RevoluteJointDef=Class.create();Object.extend(b2RevoluteJointDef.prototype,b2JointDef.prototype);Object.extend(b2RevoluteJointDef.prototype,{initialize:function()
+{this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.type=b2Joint.e_revoluteJoint;this.anchorPoint=new b2Vec2(0.0,0.0);this.lowerAngle=0.0;this.upperAngle=0.0;this.motorTorque=0.0;this.motorSpeed=0.0;this.enableLimit=false;this.enableMotor=false;},anchorPoint:null,lowerAngle:null,upperAngle:null,motorTorque:null,motorSpeed:null,enableLimit:null,enableMotor:null});
+
+
+
+var canvas;
+
+//var stats = new Stats();
+
+var delta = [0,0];
+var stage = [window.screenX,window.screenY,window.innerWidth,window.innerHeight];
+getBrowserDimensions();
+
+var theme;
+var themes = [
+ ["#10222B","#95AB63","#BDD684","#E2F0D6","#F6FFE0"],
+ ["#362C2A","#732420","#BF734C","#FAD9A0","#736859"],
+ ["#0D1114","#102C2E","#695F4C","#EBBC5E","#FFFBB8"],
+ ["#2E2F38","#FFD63E","#FFB54B","#E88638","#8A221C"],
+ ["#121212","#E6F2DA","#C9F24B","#4D7B85","#23383D"],
+ ["#343F40","#736751","#F2D7B6","#BFAC95","#8C3F3F"],
+ ["#000000","#2D2B2A","#561812","#B81111","#FFFFFF"],
+ ["#333B3A","#B4BD51","#543B38","#61594D","#B8925A"]
+ ];
+
+var worldAABB;
+var world;
+var iterations = 1;
+var timeStep = 1 / 20;
+
+var walls = new Array();
+var wall_thickness = 200;
+var wallsSetted = false;
+
+var text;
+
+var bodies;
+var elements;
+
+var createMode = false;
+var destroyMode = false;
+
+var isMouseDown = false;
+var mouseJoint;
+var mouseX = 0;
+var mouseY = 0;
+var PI2 = Math.PI * 2;
+
+init();
+play();
+
+function init()
+{
+ canvas = document.getElementById('canvas');
+
+ document.onmousedown = onDocumentMouseDown;
+ document.onmouseup = onDocumentMouseUp;
+ document.onmousemove = onDocumentMouseMove;
+ document.ondblclick = onDocumentDoubleClick;
+ //document.onselectstart = function() {return false;} // ie
+
+ // init box2d
+
+ worldAABB = new b2AABB();
+ worldAABB.minVertex.Set(-200, -200);
+ worldAABB.maxVertex.Set( screen.width + 200, screen.height + 200);
+
+ world = new b2World(worldAABB, new b2Vec2(0, 0), true);
+
+ setWalls();
+ reset();
+}
+
+
+function play()
+{
+ setInterval(loop, 25);
+}
+
+function reset()
+{
+ // color theme
+ theme = themes[ Math.random() * themes.length >> 0 ];
+ document.body.style['backgroundColor'] = theme[0];
+
+ bodies = new Array();
+ elements = new Array();
+
+ createInstructions();
+
+ for(var i = 0; i < 10; i++)
+ createBall();
+}
+
+// .. ACTIONS
+
+function onDocumentMouseDown()
+{
+ isMouseDown = true;
+ return false;
+}
+
+function onDocumentMouseUp()
+{
+ isMouseDown = false;
+ return false;
+}
+
+function onDocumentMouseMove(e)
+{
+ var ev = (!e) ? window.event : e;
+ mouseX = ev.clientX;
+ mouseY = ev.clientY;
+}
+
+function onDocumentDoubleClick()
+{
+ for (i = 0; i < bodies.length; i++)
+ {
+ var body = bodies[i]
+ canvas.removeChild( body.GetUserData().element );
+ world.DestroyBody(body);
+ body = null;
+ }
+
+ reset();
+}
+
+function onElementMouseDown()
+{
+ return false;
+}
+
+function onElementMouseUp()
+{
+ return false;
+}
+
+function onElementClick()
+{
+ return false;
+}
+
+//
+function createInstructions()
+{
+ var size = 250;
+
+ var element = document.createElement("div");
+ element.width = size;
+ element.height = size;
+ element.style['position'] = 'absolute';
+ element.style['left'] = -200 + 'px';
+ element.style['top'] = -200 + 'px';
+ element.style.cursor = "default";
+
+ canvas.appendChild(element);
+ elements.push( element );
+
+ var circle = document.createElement("canvas");
+ circle.width = size;
+ circle.height = size;
+
+ var graphics = circle.getContext("2d");
+
+ graphics.fillStyle = theme[3];
+ graphics.beginPath();
+ graphics.arc(size * .5, size * .5, size * .5, 0, PI2, true);
+ graphics.closePath();
+ graphics.fill();
+
+ element.appendChild(circle);
+
+ text = document.createElement("div");
+ text.onSelectStart = null;
+ text.innerHTML = '<span style="color:' + theme[0] + ';font-size:40px;">Hello!</span><br /><br /><span style="font-size:15px;"><strong>This is how it works:</strong><br /><br />1. Drag a ball.<br />2.&nbsp;Click&nbsp;on&nbsp;the&nbsp;background.<br />3. Shake your browser.<br />4. Double click.<br />5. Play!</span>';
+ text.style['color'] = theme[1];
+ text.style['position'] = 'absolute';
+ text.style['left'] = '0px';
+ text.style['top'] = '0px';
+ text.style['font-family'] = 'Georgia';
+ //text.style['text-align'] = 'center';
+ text.style.textAlign = 'center';
+ element.appendChild(text);
+
+ text.style['left'] = ((250 - text.clientWidth) / 2) +'px';
+ text.style['top'] = ((250 - text.clientHeight) / 2) +'px';
+
+ var b2body = new b2BodyDef();
+
+ var circle = new b2CircleDef();
+ circle.radius = size >> 1;
+ circle.density = 1;
+ circle.friction = 0.3;
+ circle.restitution = 0.3;
+ b2body.AddShape(circle);
+ b2body.userData = {element: element};
+
+ b2body.position.Set( Math.random() * stage[2], Math.random() * -200 );
+ b2body.linearVelocity.Set( Math.random() * 400 - 200, Math.random() * 400 - 200 );
+ bodies.push( world.CreateBody(b2body) );
+}
+
+function createBall(x,y)
+{
+ var x = (x != null) ? x : Math.random() * stage[2];
+ var y = (y != null) ? y : Math.random() * -200;
+
+ var size = (Math.random() * 100 >> 0) + 20;
+
+ var element = document.createElement("canvas");
+ element.width = size;
+ element.height = size;
+ element.style['position'] = 'absolute';
+ element.style['left'] = -200 + 'px';
+ element.style['top'] = -200 + 'px';
+
+ var graphics = element.getContext("2d");
+
+ var num_circles = Math.random() * 10 >> 0;
+
+ for (var i = size; i > 0; i-= (size/num_circles))
+ {
+ graphics.fillStyle = theme[ (Math.random() * 4 >> 0) + 1];
+ graphics.beginPath();
+ graphics.arc(size * .5, size * .5, i * .5, 0, PI2, true);
+ graphics.closePath();
+ graphics.fill();
+ }
+
+ canvas.appendChild(element);
+
+ elements.push( element );
+
+ var b2body = new b2BodyDef();
+
+ var circle = new b2CircleDef();
+ circle.radius = size >> 1;
+ circle.density = 1;
+ circle.friction = 0.3;
+ circle.restitution = 0.3;
+ b2body.AddShape(circle);
+ b2body.userData = {element: element};
+
+ b2body.position.Set( x, y );
+ b2body.linearVelocity.Set( Math.random() * 400 - 200, Math.random() * 400 - 200 );
+ bodies.push( world.CreateBody(b2body) );
+}
+
+//
+
+function loop()
+{
+ if (getBrowserDimensions())
+ setWalls();
+
+ delta[0] += (0 - delta[0]) * .5;
+ delta[1] += (0 - delta[1]) * .5;
+
+ world.m_gravity.x = 0 + delta[0];
+ world.m_gravity.y = 350 + delta[1];
+
+ mouseDrag();
+ world.Step(timeStep, iterations);
+
+ for (i = 0; i < bodies.length; i++)
+ {
+ var body = bodies[i];
+ var element = elements[i];
+
+ element.style['left'] = (body.m_position0.x - (element.width >> 1)) + 'px';
+ element.style['top'] = (body.m_position0.y - (element.height >> 1)) + 'px';
+
+ if (element.tagName == "DIV")
+ {
+ // webkit
+ text.style['-webkit-transform'] = 'rotate(' + (bodies[i].m_rotation0 * 57.2957795) + 'deg)';
+
+ // gecko
+ text.style['MozTransform'] = 'rotate(' + (bodies[i].m_rotation0 * 57.2957795) + 'deg)';
+
+ // opera
+ element.style['OTransform'] = 'rotate(' + (bodies[i].m_rotation0 * 57.2957795) + 'deg)';
+ }
+ }
+}
+
+
+// .. BOX2D UTILS
+
+function createBox(world, x, y, width, height, fixed)
+{
+ if (typeof(fixed) == 'undefined') fixed = true;
+ var boxSd = new b2BoxDef();
+ if (!fixed) boxSd.density = 1.0;
+ boxSd.extents.Set(width, height);
+ var boxBd = new b2BodyDef();
+ boxBd.AddShape(boxSd);
+ boxBd.position.Set(x,y);
+ return world.CreateBody(boxBd)
+}
+
+function mouseDrag()
+{
+ // mouse press
+ if (createMode)
+ {
+ createBall( mouseX, mouseY );
+ }
+ else if (isMouseDown && !mouseJoint)
+ {
+ var body = getBodyAtMouse();
+
+ if (body)
+ {
+ var md = new b2MouseJointDef();
+ md.body1 = world.m_groundBody;
+ md.body2 = body;
+ md.target.Set(mouseX, mouseY);
+ md.maxForce = 30000 * body.m_mass;
+ md.timeStep = timeStep;
+ mouseJoint = world.CreateJoint(md);
+ body.WakeUp();
+ }
+ else
+ {
+ createMode = true;
+ }
+ }
+
+ // mouse release
+ if (!isMouseDown)
+ {
+ createMode = false;
+ destroyMode = false;
+
+ if (mouseJoint)
+ {
+ world.DestroyJoint(mouseJoint);
+ mouseJoint = null;
+ }
+ }
+
+ // mouse move
+ if (mouseJoint)
+ {
+ var p2 = new b2Vec2(mouseX, mouseY);
+ mouseJoint.SetTarget(p2);
+ }
+}
+
+function getBodyAtMouse()
+{
+ // Make a small box.
+ var mousePVec = new b2Vec2();
+ mousePVec.Set(mouseX, mouseY);
+
+ var aabb = new b2AABB();
+ aabb.minVertex.Set(mouseX - 1, mouseY - 1);
+ aabb.maxVertex.Set(mouseX + 1, mouseY + 1);
+
+ // Query the world for overlapping shapes.
+ var k_maxCount = 10;
+ var shapes = new Array();
+ var count = world.Query(aabb, shapes, k_maxCount);
+ var body = null;
+
+ for (var i = 0; i < count; ++i)
+ {
+ if (shapes[i].m_body.IsStatic() == false)
+ {
+ if ( shapes[i].TestPoint(mousePVec) )
+ {
+ body = shapes[i].m_body;
+ break;
+ }
+ }
+ }
+ return body;
+}
+
+function setWalls()
+{
+ if (wallsSetted)
+ {
+ world.DestroyBody(walls[0]);
+ world.DestroyBody(walls[1]);
+ world.DestroyBody(walls[2]);
+ world.DestroyBody(walls[3]);
+
+ walls[0] = null;
+ walls[1] = null;
+ walls[2] = null;
+ walls[3] = null;
+ }
+
+ walls[0] = createBox(world, stage[2] / 2, - wall_thickness, stage[2], wall_thickness);
+ walls[1] = createBox(world, stage[2] / 2, stage[3] + wall_thickness, stage[2], wall_thickness);
+ walls[2] = createBox(world, - wall_thickness, stage[3] / 2, wall_thickness, stage[3]);
+ walls[3] = createBox(world, stage[2] + wall_thickness, stage[3] / 2, wall_thickness, stage[3]);
+
+ wallsSetted = true;
+}
+
+// BROWSER DIMENSIONS
+
+function getBrowserDimensions()
+{
+ var changed = false;
+
+ if (stage[0] != window.screenX)
+ {
+ delta[0] = (window.screenX - stage[0]) * 50;
+ stage[0] = window.screenX;
+ changed = true;
+ }
+
+ if (stage[1] != window.screenY)
+ {
+ delta[1] = (window.screenY - stage[1]) * 50;
+ stage[1] = window.screenY;
+ changed = true;
+ }
+
+ if (stage[2] != window.innerWidth)
+ {
+ stage[2] = window.innerWidth;
+ changed = true;
+ }
+
+ if (stage[3] != window.innerHeight)
+ {
+ stage[3] = window.innerHeight;
+ changed = true;
+ }
+
+ return changed;
+}
+
+
+
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+
+
+
+(function(){var aa="_gat",ba="_gaq",r=true,v=false,w=undefined,ca="4.6.5",x="length",y="cookie",A="location",B="&",C="=",D="__utma=",E="__utmb=",G="__utmc=",da="__utmk=",H="__utmv=",J="__utmz=",K="__utmx=",L="GASO=";var N=function(i){return w==i||"-"==i||""==i},ea=function(i){return i[x]>0&&" \n\r\t".indexOf(i)>-1},P=function(i,l,g){var t="-",k;if(!N(i)&&!N(l)&&!N(g)){k=i.indexOf(l);if(k>-1){g=i.indexOf(g,k);if(g<0)g=i[x];t=O(i,k+l.indexOf(C)+1,g)}}return t},Q=function(i){var l=v,g=0,t,k;if(!N(i)){l=r;for(t=0;t<i[x];t++){k=i.charAt(t);g+="."==k?1:0;l=l&&g<=1&&(0==t&&"-"==k||".0123456789".indexOf(k)>-1)}}return l},S=function(i,l){var g=encodeURIComponent;return g instanceof Function?l?encodeURI(i):g(i):escape(i)},
+T=function(i,l){var g=decodeURIComponent,t;i=i.split("+").join(" ");if(g instanceof Function)try{t=l?decodeURI(i):g(i)}catch(k){t=unescape(i)}else t=unescape(i);return t},U=function(i,l){return i.indexOf(l)>-1},V=function(i,l){i[i[x]]=l},W=function(i){return i.toLowerCase()},X=function(i,l){return i.split(l)},fa=function(i,l){return i.indexOf(l)},O=function(i,l,g){g=w==g?i[x]:g;return i.substring(l,g)},ga=function(i,l){return i.join(l)},ia=function(i){var l=1,g=0,t;if(!N(i)){l=0;for(t=i[x]-1;t>=0;t--){g=
+i.charCodeAt(t);l=(l<<6&268435455)+g+(g<<14);g=l&266338304;l=g!=0?l^g>>21:l}}return l},ja=function(){var i=window,l=w;if(i&&i.gaGlobal&&i.gaGlobal.hid)l=i.gaGlobal.hid;else{l=Y();i.gaGlobal=i.gaGlobal?i.gaGlobal:{};i.gaGlobal.hid=l}return l},Y=function(){return Math.round(Math.random()*2147483647)},Z={Ha:function(i,l){this.bb=i;this.nb=l},ib:v,_gasoDomain:w,_gasoCPath:w};Z.Gb=function(){function i(k){return new t(k[0],k[1])}function l(k){var p=[];k=k.split(",");var f;for(f=0;f<k.length;++f)p.push(i(k[f].split(":")));return p}var g=this,t=Z.Ha;g.Ia="utm_campaign";g.Ja="utm_content";g.Ka="utm_id";g.La="utm_medium";g.Ma="utm_nooverride";g.Na="utm_source";g.Oa="utm_term";g.Pa="gclid";g.ba=0;g.z=0;g.Ta=15768E6;g.sb=18E5;g.v=63072E6;g.ta=[];g.va=[];g.nc="cse";g.oc="q";g.ob=5;g.T=l("daum:q,eniro:search_word,naver:query,images.google:q,google:q,yahoo:p,msn:q,bing:q,aol:query,aol:encquery,lycos:query,ask:q,altavista:q,netscape:query,cnn:query,about:terms,mamma:query,alltheweb:q,voila:rdata,virgilio:qs,live:q,baidu:wd,alice:qs,yandex:text,najdi:q,aol:q,mama:query,seznam:q,search:q,wp:szukaj,onet:qt,szukacz:q,yam:k,pchome:q,kvasir:q,sesam:q,ozu:q,terra:query,mynet:q,ekolay:q,rambler:words");
+g.t=w;g.lb=v;g.h="/";g.U=100;g.oa="/__utm.gif";g.ga=1;g.ha=1;g.u="|";g.fa=1;g.da=1;g.Ra=1;g.b="auto";g.I=1;g.ra=1E3;g.Jc=10;g.Pb=10;g.Kc=0.2;g.o=w;g.a=document;g.e=window};Z.Hb=function(i){function l(d,a,j,c){var n="",s=0;n=P(d,"2"+a,";");if(!N(n)){d=n.indexOf("^"+j+".");if(d<0)return["",0];n=O(n,d+j[x]+2);if(n.indexOf("^")>0)n=n.split("^")[0];j=n.split(":");n=j[1];s=parseInt(j[0],10);if(!c&&s<p.r)n=""}if(N(n))n="";return[n,s]}function g(d,a){return"^"+ga([[a,d[1]].join("."),d[0]],":")}function t(d,a){f.a[y]=d+"; path="+f.h+"; "+a+p.fb()}function k(d){var a=new Date;d=new Date(a.getTime()+d);return"expires="+d.toGMTString()+"; "}var p=this,f=i;p.r=(new Date).getTime();
+var h=[D,E,G,J,H,K,L];p.k=function(){var d=f.a[y];return f.o?p.Wb(d,f.o):d};p.Wb=function(d,a){var j=[],c,n;for(c=0;c<h[x];c++){n=l(d,h[c],a)[0];N(n)||(j[j[x]]=h[c]+n+";")}return j.join("")};p.l=function(d,a,j){var c=j>0?k(j):"";if(f.o){a=p.kc(f.a[y],d,f.o,a,j);d="2"+d;c=j>0?k(f.v):""}t(d+a,c)};p.kc=function(d,a,j,c,n){var s="";n=n||f.v;c=g([c,p.r+n*1],j);s=P(d,"2"+a,";");if(!N(s)){d=g(l(d,a,j,r),j);s=ga(s.split(d),"");return s=c+s}return c};p.fb=function(){return N(f.b)?"":"domain="+f.b+";"}};Z.$=function(i){function l(b){b=b instanceof Array?b.join("."):"";return N(b)?"-":b}function g(b,e){var o=[];if(!N(b)){o=b.split(".");if(e)for(b=0;b<o[x];b++)Q(o[b])||(o[b]="-")}return o}function t(b,e,o){var m=c.M,q,u;for(q=0;q<m[x];q++){u=m[q][0];u+=N(e)?e:e+m[q][4];m[q][2](P(b,u,o))}}var k,p,f,h,d,a,j,c=this,n,s=i;c.j=new Z.Hb(i);c.kb=function(){return w==n||n==c.P()};c.k=function(){return c.j.k()};c.ma=function(){return d?d:"-"};c.vb=function(b){d=b};c.za=function(b){n=Q(b)?b*1:"-"};c.la=function(){return l(a)};
+c.Aa=function(b){a=g(b)};c.Vb=function(){c.j.l(H,"",-1)};c.lc=function(){return n?n:"-"};c.fb=function(){return N(s.b)?"":"domain="+s.b+";"};c.ja=function(){return l(k)};c.tb=function(b){k=g(b,1)};c.C=function(){return l(p)};c.ya=function(b){p=g(b,1)};c.ka=function(){return l(f)};c.ub=function(b){f=g(b,1)};c.na=function(){return l(h)};c.wb=function(b){h=g(b);for(b=0;b<h[x];b++)if(b<4&&!Q(h[b]))h[b]="-"};c.fc=function(){return j};c.Dc=function(b){j=b};c.Sb=function(){k=[];p=[];f=[];h=[];d=w;a=[];n=
+w};c.P=function(){var b="",e;for(e=0;e<c.M[x];e++)b+=c.M[e][1]();return ia(b)};c.ua=function(b){var e=c.k(),o=v;if(e){t(e,b,";");c.za(c.P());o=r}return o};c.zc=function(b){t(b,"",B);c.za(P(b,da,B))};c.Hc=function(){var b=c.M,e=[],o;for(o=0;o<b[x];o++)V(e,b[o][0]+b[o][1]());V(e,da+c.P());return e.join(B)};c.Nc=function(b,e){var o=c.M,m=s.h;c.ua(b);s.h=e;for(b=0;b<o[x];b++)N(o[b][1]())||o[b][3]();s.h=m};c.Cb=function(){c.j.l(D,c.ja(),s.v)};c.Ea=function(){c.j.l(E,c.C(),s.sb)};c.Db=function(){c.j.l(G,
+c.ka(),0)};c.Ga=function(){c.j.l(J,c.na(),s.Ta)};c.Eb=function(){c.j.l(K,c.ma(),s.v)};c.Fa=function(){c.j.l(H,c.la(),s.v)};c.Oc=function(){c.j.l(L,c.fc(),0)};c.M=[[D,c.ja,c.tb,c.Cb,"."],[E,c.C,c.ya,c.Ea,""],[G,c.ka,c.ub,c.Db,""],[K,c.ma,c.vb,c.Eb,""],[J,c.na,c.wb,c.Ga,"."],[H,c.la,c.Aa,c.Fa,"."]]};Z.Kb=function(i){var l=this,g=i,t=new Z.$(g),k=function(){},p=function(f){var h=(new Date).getTime(),d;d=(h-f[3])*(g.Kc/1E3);if(d>=1){f[2]=Math.min(Math.floor(f[2]*1+d),g.Pb);f[3]=h}return f};l.H=function(f,h,d,a,j,c){var n,s=g.I,b=g.a[A];t.ua(d);n=X(t.C(),".");if(n[1]<500||a){if(j)n=p(n);if(a||!j||n[2]>=1){if(!a&&j)n[2]=n[2]*1-1;n[1]=n[1]*1+1;f="?utmwv="+ca+"&utmn="+Y()+(N(b.hostname)?"":"&utmhn="+S(b.hostname))+(g.U==100?"":"&utmsp="+S(g.U))+f;if(0==s||2==s){a=2==s?k:c||k;l.$a(g.oa+f,a)}if(1==s||
+2==s){f=("https:"==b.protocol?"https://ssl.google-analytics.com/__utm.gif":"http://www.google-analytics.com/__utm.gif")+f+"&utmac="+h+"&utmcc="+l.ac(d);if(ka)f+="&gaq=1";l.$a(f,c)}}}t.ya(n.join("."));t.Ea()};l.$a=function(f,h){var d=new Image(1,1);d.src=f;d.onload=function(){d.onload=null;(h||k)()}};l.ac=function(f){var h=[],d=[D,J,H,K],a,j=t.k(),c;for(a=0;a<d[x];a++){c=P(j,d[a]+f,";");if(!N(c)){if(d[a]==H){c=X(c.split(f+".")[1],"|")[0];if(N(c))continue;c=f+"."+c}V(h,d[a]+c+";")}}return S(h.join("+"))}};Z.n=function(){var i=this;i.Y=[];i.hb=function(l){var g,t=i.Y,k;for(k=0;k<t.length;k++)g=l==t[k].q?t[k]:g;return g};i.Ob=function(l,g,t,k,p,f,h,d){var a=i.hb(l);if(w==a){a=new Z.n.Mb(l,g,t,k,p,f,h,d);V(i.Y,a)}else{a.Qa=g;a.Ab=t;a.zb=k;a.xb=p;a.Xa=f;a.yb=h;a.Za=d}return a}};Z.n.Lb=function(i,l,g,t,k,p){var f=this;f.Bb=i;f.Ba=l;f.D=g;f.Va=t;f.pb=k;f.qb=p;f.Ca=function(){return"&"+["utmt=item","tid="+S(f.Bb),"ipc="+S(f.Ba),"ipn="+S(f.D),"iva="+S(f.Va),"ipr="+S(f.pb),"iqt="+S(f.qb)].join("&utm")}};
+Z.n.Mb=function(i,l,g,t,k,p,f,h){var d=this;d.q=i;d.Qa=l;d.Ab=g;d.zb=t;d.xb=k;d.Xa=p;d.yb=f;d.Za=h;d.R=[];d.Nb=function(a,j,c,n,s){var b=d.gc(a),e=d.q;if(w==b)V(d.R,new Z.n.Lb(e,a,j,c,n,s));else{b.Bb=e;b.Ba=a;b.D=j;b.Va=c;b.pb=n;b.qb=s}};d.gc=function(a){var j,c=d.R,n;for(n=0;n<c.length;n++)j=a==c[n].Ba?c[n]:j;return j};d.Ca=function(){return"&"+["utmt=tran","id="+S(d.q),"st="+S(d.Qa),"to="+S(d.Ab),"tx="+S(d.zb),"sp="+S(d.xb),"ci="+S(d.Xa),"rg="+S(d.yb),"co="+S(d.Za)].join("&utmt")}};Z.Fb=function(i){function l(){var f,h,d;h="ShockwaveFlash";var a="$version",j=k.d?k.d.plugins:w;if(j&&j[x]>0)for(f=0;f<j[x]&&!d;f++){h=j[f];if(U(h.name,"Shockwave Flash"))d=h.description.split("Shockwave Flash ")[1]}else{h=h+"."+h;try{f=new ActiveXObject(h+".7");d=f.GetVariable(a)}catch(c){}if(!d)try{f=new ActiveXObject(h+".6");d="WIN 6,0,21,0";f.AllowScriptAccess="always";d=f.GetVariable(a)}catch(n){}if(!d)try{f=new ActiveXObject(h);d=f.GetVariable(a)}catch(s){}if(d){d=X(d.split(" ")[1],",");d=d[0]+
+"."+d[1]+" r"+d[2]}}return d?d:p}var g=i,t=g.e,k=this,p="-";k.V=t.screen;k.Sa=!k.V&&t.java?java.awt.Toolkit.getDefaultToolkit():w;k.d=t.navigator;k.W=p;k.xa=p;k.Wa=p;k.qa=p;k.pa=1;k.eb=p;k.bc=function(){var f;if(t.screen){k.W=k.V.width+"x"+k.V.height;k.xa=k.V.colorDepth+"-bit"}else if(k.Sa)try{f=k.Sa.getScreenSize();k.W=f.width+"x"+f.height}catch(h){}k.qa=W(k.d&&k.d.language?k.d.language:k.d&&k.d.browserLanguage?k.d.browserLanguage:p);k.pa=k.d&&k.d.javaEnabled()?1:0;k.eb=g.ha?l():p;k.Wa=S(g.a.characterSet?
+g.a.characterSet:g.a.charset?g.a.charset:p)};k.Ic=function(){return B+"utm"+["cs="+S(k.Wa),"sr="+k.W,"sc="+k.xa,"ul="+k.qa,"je="+k.pa,"fl="+S(k.eb)].join("&utm")};k.$b=function(){var f=g.a,h=t.history[x];f=k.d.appName+k.d.version+k.qa+k.d.platform+k.d.userAgent+k.pa+k.W+k.xa+(f[y]?f[y]:"")+(f.referrer?f.referrer:"");for(var d=f[x];h>0;)f+=h--^d++;return ia(f)}};Z.m=function(i,l,g,t){function k(d){var a="";d=W(d.split("://")[1]);if(U(d,"/")){d=d.split("/")[1];if(U(d,"?"))a=d.split("?")[0]}return a}function p(d){var a="";a=W(d.split("://")[1]);if(U(a,"/"))a=a.split("/")[0];return a}var f=t,h=this;h.c=i;h.rb=l;h.r=g;h.ic=function(d){var a=h.gb();return new Z.m.w(P(d,f.Ka+C,B),P(d,f.Na+C,B),P(d,f.Pa+C,B),h.Q(d,f.Ia,"(not set)"),h.Q(d,f.La,"(not set)"),h.Q(d,f.Oa,a&&!N(a.K)?T(a.K):w),h.Q(d,f.Ja,w))};h.jb=function(d){var a=p(d),j=k(d);if(U(a,"google")){d=d.split("?").join(B);
+if(U(d,B+f.oc+C))if(j==f.nc)return r}return v};h.gb=function(){var d,a=h.rb,j,c,n=f.T;if(!(N(a)||"0"==a||!U(a,"://")||h.jb(a))){d=p(a);for(j=0;j<n[x];j++){c=n[j];if(U(d,W(c.bb))){a=a.split("?").join(B);if(U(a,B+c.nb+C)){d=a.split(B+c.nb+C)[1];if(U(d,B))d=d.split(B)[0];return new Z.m.w(w,c.bb,w,"(organic)","organic",d,w)}}}}};h.Q=function(d,a,j){d=P(d,a+C,B);return j=!N(d)?T(d):!N(j)?j:"-"};h.uc=function(d){var a=f.ta,j=v,c;if(d&&"organic"==d.S){d=W(T(d.K));for(c=0;c<a[x];c++)j=j||W(a[c])==d}return j};
+h.hc=function(){var d="",a="";d=h.rb;if(!(N(d)||"0"==d||!U(d,"://")||h.jb(d))){d=d.split("://")[1];if(U(d,"/")){a=O(d,d.indexOf("/"));a=a.split("?")[0];d=W(d.split("/")[0])}if(0==d.indexOf("www."))d=O(d,4);return new Z.m.w(w,d,w,"(referral)","referral",w,a)}};h.Xb=function(d){var a="";if(f.ba){a=d&&d.hash?d.href.substring(d.href.indexOf("#")):"";a=""!=a?a+B:a}a+=d.search;return a};h.dc=function(){return new Z.m.w(w,"(direct)",w,"(direct)","(none)",w,w)};h.vc=function(d){var a=v,j,c=f.va;if(d&&"referral"==
+d.S){d=W(S(d.X));for(j=0;j<c[x];j++)a=a||U(d,W(c[j]))}return a};h.L=function(d){return w!=d&&d.mb()};h.cc=function(d,a){var j="",c="-",n,s=0,b,e,o=h.c;if(!d)return"";e=d.k();j=h.Xb(f.a[A]);if(f.z&&d.kb()){c=d.na();if(!N(c)&&!U(c,";")){d.Ga();return""}}c=P(e,J+o+".",";");n=h.ic(j);if(h.L(n)){j=P(j,f.Ma+C,B);if("1"==j&&!N(c))return""}if(!h.L(n)){n=h.gb();if(!N(c)&&h.uc(n))return""}if(!h.L(n)&&a){n=h.hc();if(!N(c)&&h.vc(n))return""}if(!h.L(n))if(N(c)&&a)n=h.dc();if(!h.L(n))return"";if(!N(c)){s=c.split(".");
+b=new Z.m.w;b.Zb(s.slice(4).join("."));b=W(b.Da())==W(n.Da());s=s[3]*1}if(!b||a){a=P(e,D+o+".",";");e=a.lastIndexOf(".");a=e>9?O(a,e+1)*1:0;s++;a=0==a?1:a;d.wb([o,h.r,a,s,n.Da()].join("."));d.Ga();return B+"utmcn=1"}else return B+"utmcr=1"}};
+Z.m.w=function(i,l,g,t,k,p,f){var h=this;h.q=i;h.X=l;h.ea=g;h.D=t;h.S=k;h.K=p;h.Ya=f;h.Da=function(){var d=[],a=[["cid",h.q],["csr",h.X],["gclid",h.ea],["ccn",h.D],["cmd",h.S],["ctr",h.K],["cct",h.Ya]],j,c;if(h.mb())for(j=0;j<a[x];j++)if(!N(a[j][1])){c=a[j][1].split("+").join("%20");c=c.split(" ").join("%20");V(d,"utm"+a[j][0]+C+c)}return d.join("|")};h.mb=function(){return!(N(h.q)&&N(h.X)&&N(h.ea))};h.Zb=function(d){var a=function(j){return T(P(d,"utm"+j+C,"|"))};h.q=a("cid");h.X=a("csr");h.ea=a("gclid");
+h.D=a("ccn");h.S=a("cmd");h.K=a("ctr");h.Ya=a("cct")}};Z.Ib=function(i,l,g,t){function k(j,c,n){var s;if(!N(n)){n=n.split(",");for(var b=0;b<n[x];b++){s=n[b];if(!N(s)){s=s.split(h);if(s[x]==4)c[s[0]]=[s[1],s[2],j]}}}}var p=this,f=l,h=C,d=i,a=t;p.O=g;p.sa="";p.p={};p.tc=function(){var j;j=X(P(p.O.k(),H+f+".",";"),f+".")[1];if(!N(j)){j=j.split("|");k(1,p.p,j[1]);p.sa=j[0];p.Z()}};p.Z=function(){p.Qb();var j=p.sa,c,n,s="";for(c in p.p)if((n=p.p[c])&&1===n[2])s+=c+h+n[0]+h+n[1]+h+1+",";N(s)||(j+="|"+s);if(N(j))p.O.Vb();else{p.O.Aa(f+"."+j);p.O.Fa()}};p.Ec=
+function(j){p.sa=j;p.Z()};p.Cc=function(j,c,n,s){if(1!=s&&2!=s&&3!=s)s=3;var b=v;if(c&&n&&j>0&&j<=d.ob){c=S(c);n=S(n);if(c[x]+n[x]<=64){p.p[j]=[c,n,s];p.Z();b=r}}return b};p.mc=function(j){if((j=p.p[j])&&1===j[2])return j[1]};p.Ub=function(j){var c=p.p;if(c[j]){delete c[j];p.Z()}};p.Qb=function(){a._clearKey(8);a._clearKey(9);a._clearKey(11);var j=p.p,c,n;for(n in j)if(c=j[n]){a._setKey(8,n,c[0]);a._setKey(9,n,c[1]);(c=c[2])&&3!=c&&a._setKey(11,n,""+c)}}};Z.N=function(){function i(m,q,u,z){if(w==f[m])f[m]={};if(w==f[m][q])f[m][q]=[];f[m][q][u]=z}function l(m,q){if(w!=f[m]&&w!=f[m][q]){f[m][q]=w;q=r;var u;for(u=0;u<a[x];u++)if(w!=f[m][a[u]]){q=v;break}if(q)f[m]=w}}function g(m){var q="",u=v,z,M;for(z=0;z<a[x];z++){M=m[a[z]];if(w!=M){if(u)q+=a[z];q+=t(M);u=v}else u=r}return q}function t(m){var q=[],u,z;for(z=0;z<m[x];z++)if(w!=m[z]){u="";if(z!=o&&w==m[z-1])u+=z.toString()+s;u+=k(m[z]);V(q,u)}return j+q.join(n)+c}function k(m){var q="",u,z,M;for(u=0;u<
+m[x];u++){z=m.charAt(u);M=e[z];q+=w!=M?M:z}return q}var p=this,f={},h="k",d="v",a=[h,d],j="(",c=")",n="*",s="!",b="'",e={};e[b]="'0";e[c]="'1";e[n]="'2";e[s]="'3";var o=1;p.qc=function(m){return w!=f[m]};p.G=function(){var m="",q;for(q in f)if(w!=f[q])m+=q.toString()+g(f[q]);return m};p.Ac=function(m){if(m==w)return p.G();var q=m.G(),u;for(u in f)if(w!=f[u]&&!m.qc(u))q+=u.toString()+g(f[u]);return q};p._setKey=function(m,q,u){if(typeof u!="string")return v;i(m,h,q,u);return r};p._setValue=function(m,
+q,u){if(typeof u!="number"&&(w==Number||!(u instanceof Number))||Math.round(u)!=u||u==NaN||u==Infinity)return v;i(m,d,q,u.toString());return r};p._getKey=function(m,q){return w!=f[m]&&w!=f[m][h]?f[m][h][q]:w};p._getValue=function(m,q){return w!=f[m]&&w!=f[m][d]?f[m][d][q]:w};p._clearKey=function(m){l(m,h)};p._clearValue=function(m){l(m,d)}};Z.Jb=function(i,l){var g=this;g.Qc=l;g.xc=i;g._trackEvent=function(t,k,p){return l._trackEvent(g.xc,t,k,p)}};Z.aa=function(i,l){function g(){if("auto"==c.b){var b=c.a.domain;if("www."==O(b,0,4))b=O(b,4);c.b=b}c.b=W(c.b)}function t(){var b=c.b,e=b.indexOf("www.google.")*b.indexOf(".google.")*b.indexOf("google.");return e||"/"!=c.h||b.indexOf("google.org")>-1}function k(b,e,o){if(N(b)||N(e)||N(o))return"-";b=P(b,D+a.c+".",e);if(!N(b)){b=b.split(".");b[5]=b[5]?b[5]*1+1:1;b[3]=b[4];b[4]=o;b=b.join(".")}return b}function p(){return"file:"!=c.a[A].protocol&&t()}function f(b){if(!b||""==b)return"";for(;ea(b.charAt(0));)b=
+O(b,1);for(;ea(b.charAt(b[x]-1));)b=O(b,0,b[x]-1);return b}function h(b,e,o,m){if(!N(b())){e(m?T(b()):b());U(b(),";")||o()}}function d(b){var e,o=""!=b&&c.a[A].host!=b;if(o)for(e=0;e<c.t[x];e++)o=o&&fa(W(b),W(c.t[e]))==-1;return o}var a=this,j=w,c=new Z.Gb,n=v,s=w;a.e=window;a.r=Math.round((new Date).getTime()/1E3);a.s=i||"UA-XXXXX-X";a.ab=c.a.referrer;a.ia=w;a.f=w;a.B=w;a.F=v;a.A=w;a.Ua="";a.g=w;a.cb=w;a.c=w;a.i=w;c.o=l?S(l):w;a.wc=function(){var b=v;if(a.B)b=a.B.match(/^[0-9a-z-_.]{10,1200}$/i);
+return b};a.jc=function(){return Y()^a.A.$b()&2147483647};a.ec=function(){if(!c.b||""==c.b||"none"==c.b){c.b="";return 1}g();return c.Ra?ia(c.b):1};a.Yb=function(b,e){if(N(b))b="-";else{e+=c.h&&"/"!=c.h?c.h:"";e=b.indexOf(e);b=e>=0&&e<=8?"0":"["==b.charAt(0)&&"]"==b.charAt(b[x]-1)?"-":b}return b};a.wa=function(b){var e="",o=c.a;e+=c.fa?a.A.Ic():"";e+=c.da?a.Ua:"";e+=c.ga&&!N(o.title)?"&utmdt="+S(o.title):"";e+="&utmhid="+ja()+"&utmr="+S(a.ia)+"&utmp="+S(a.Bc(b));return e};a.Bc=function(b){var e=c.a[A];
+return b=w!=b&&""!=b?S(b,r):S(e.pathname+e.search,r)};a.Lc=function(b){if(a.J()){var e="";if(a.g!=w&&a.g.G()[x]>0)e+="&utme="+S(a.g.G());e+=a.wa(b);j.H(e,a.s,a.c)}};a.Tb=function(){var b=new Z.$(c);return b.ua(a.c)?b.Hc():w};a._getLinkerUrl=function(b,e){var o=b.split("#"),m=b,q=a.Tb();if(q)if(e&&1>=o[x])m+="#"+q;else if(!e||1>=o[x])if(1>=o[x])m+=(U(b,"?")?B:"?")+q;else m=o[0]+(U(b,"?")?B:"?")+q+"#"+o[1];return m};a.Fc=function(){var b;if(a.wc()){a.i.Dc(a.B);a.i.Oc();Z._gasoDomain=c.b;Z._gasoCPath=
+c.h;b=c.a.createElement("script");b.type="text/javascript";b.id="_gasojs";b.src="https://www.google.com/analytics/reporting/overlay_js?gaso="+a.B+B+Y();c.a.getElementsByTagName("head")[0].appendChild(b)}};a.pc=function(){var b=a.r,e=a.i,o=e.k(),m=a.c+"",q=c.e,u=q?q.gaGlobal:w,z,M=U(o,D+m+"."),la=U(o,E+m),ma=U(o,G+m),F,I=[],R="",ha=v;o=N(o)?"":o;if(c.z){z=c.a[A]&&c.a[A].hash?c.a[A].href.substring(c.a[A].href.indexOf("#")):"";if(c.ba&&!N(z))R=z+B;R+=c.a[A].search;if(!N(R)&&U(R,D)){e.zc(R);e.kb()||e.Sb();
+F=e.ja()}h(e.ma,e.vb,e.Eb,true);h(e.la,e.Aa,e.Fa)}if(N(F))if(M)if(!la||!ma){F=k(o,";",b);a.F=r}else{F=P(o,D+m+".",";");I=X(P(o,E+m,";"),".")}else{F=ga([m,a.jc(),b,b,b,1],".");ha=a.F=r}else if(N(e.C())||N(e.ka())){F=k(R,B,b);a.F=r}else{I=X(e.C(),".");m=I[0]}F=F.split(".");if(q&&u&&u.dh==m&&!c.o){F[4]=u.sid?u.sid:F[4];if(ha){F[3]=u.sid?u.sid:F[4];if(u.vid){b=u.vid.split(".");F[1]=b[0];F[2]=b[1]}}}e.tb(F.join("."));I[0]=m;I[1]=I[1]?I[1]:0;I[2]=w!=I[2]?I[2]:c.Jc;I[3]=I[3]?I[3]:F[4];e.ya(I.join("."));
+e.ub(m);N(e.lc())||e.za(e.P());e.Cb();e.Ea();e.Db()};a.rc=function(){j=new Z.Kb(c)};a._initData=function(){var b;if(!n){if(!a.A){a.A=new Z.Fb(c);a.A.bc()}a.c=a.ec();a.i=new Z.$(c);a.g=new Z.N;s=new Z.Ib(c,a.c,a.i,a.g);a.rc()}if(p()){a.pc();s.tc()}if(!n){if(p()){a.ia=a.Yb(a.ab,c.a.domain);if(c.da){b=new Z.m(a.c,a.ia,a.r,c);a.Ua=b.cc(a.i,a.F)}}a.cb=new Z.N;n=r}Z.ib||a.sc()};a._visitCode=function(){a._initData();var b=P(a.i.k(),D+a.c+".",";");b=b.split(".");return b[x]<4?"":b[1]};a._cookiePathCopy=function(b){a._initData();
+a.i&&a.i.Nc(a.c,b)};a.sc=function(){var b=c.a[A].hash;if(b&&1==b.indexOf("gaso="))b=P(b,"gaso=",B);else b=(b=c.e.name)&&0<=b.indexOf("gaso=")?P(b,"gaso=",B):P(a.i.k(),L,";");if(b[x]>=10){a.B=b;a.Fc()}Z.ib=r};a.J=function(){return a._visitCode()%1E4<c.U*100};a.Gc=function(){var b,e,o=c.a.links;if(!c.lb){b=c.a.domain;if("www."==O(b,0,4))b=O(b,4);c.t.push("."+b)}for(b=0;b<o[x]&&(c.ra==-1||b<c.ra);b++){e=o[b];if(d(e.host))if(!e.gatcOnclick){e.gatcOnclick=e.onclick?e.onclick:a.yc;e.onclick=function(m){var q=
+!this.target||this.target=="_self"||this.target=="_top"||this.target=="_parent";q=q&&!a.Rb(m);a.Mc(m,this,q);return q?v:this.gatcOnclick?this.gatcOnclick(m):r}}}};a.yc=function(){};a._trackPageview=function(b){if(p()){a._initData();c.t&&a.Gc();a.Lc(b);a.F=v}};a._trackTrans=function(){var b=a.c,e=[],o,m,q;a._initData();if(a.f&&a.J()){for(o=0;o<a.f.Y[x];o++){m=a.f.Y[o];V(e,m.Ca());for(q=0;q<m.R[x];q++)V(e,m.R[q].Ca())}for(o=0;o<e[x];o++)j.H(e[o],a.s,b,r)}};a._setTrans=function(){var b=c.a,e,o,m;b=b.getElementById?
+b.getElementById("utmtrans"):b.utmform&&b.utmform.utmtrans?b.utmform.utmtrans:w;a._initData();if(b&&b.value){a.f=new Z.n;m=b.value.split("UTM:");c.u=!c.u||""==c.u?"|":c.u;for(b=0;b<m[x];b++){m[b]=f(m[b]);e=m[b].split(c.u);for(o=0;o<e[x];o++)e[o]=f(e[o]);if("T"==e[0])a._addTrans(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]);else"I"==e[0]&&a._addItem(e[1],e[2],e[3],e[4],e[5],e[6])}}};a._addTrans=function(b,e,o,m,q,u,z,M){a.f=a.f?a.f:new Z.n;return a.f.Ob(b,e,o,m,q,u,z,M)};a._addItem=function(b,e,o,m,q,u){var z;
+a.f=a.f?a.f:new Z.n;(z=a.f.hb(b))||(z=a._addTrans(b,"","","","","","",""));z.Nb(e,o,m,q,u)};a._setVar=function(b){if(b&&""!=b&&t()){a._initData();s.Ec(S(b));a.J()&&j.H("&utmt=var",a.s,a.c)}};a._setCustomVar=function(b,e,o,m){a._initData();return s.Cc(b,e,o,m)};a._deleteCustomVar=function(b){a._initData();s.Ub(b)};a._getVisitorCustomVar=function(b){a._initData();return s.mc(b)};a._setMaxCustomVariables=function(b){c.ob=b};a._link=function(b,e){if(c.z&&b){a._initData();c.a[A].href=a._getLinkerUrl(b,
+e)}};a._linkByPost=function(b,e){if(c.z&&b&&b.action){a._initData();b.action=a._getLinkerUrl(b.action,e)}};a._setXKey=function(b,e,o){a.g._setKey(b,e,o)};a._setXValue=function(b,e,o){a.g._setValue(b,e,o)};a._getXKey=function(b,e){return a.g._getKey(b,e)};a._getXValue=function(b,e){return a.g.getValue(b,e)};a._clearXKey=function(b){a.g._clearKey(b)};a._clearXValue=function(b){a.g._clearValue(b)};a._createXObj=function(){a._initData();return new Z.N};a._sendXEvent=function(b){var e="";a._initData();
+if(a.J()){e+="&utmt=event&utme="+S(a.g.Ac(b))+a.wa();j.H(e,a.s,a.c,v,r)}};a._createEventTracker=function(b){a._initData();return new Z.Jb(b,a)};a._trackEvent=function(b,e,o,m){var q=a.cb;if(w!=b&&w!=e&&""!=b&&""!=e){q._clearKey(5);q._clearValue(5);(b=q._setKey(5,1,b)&&q._setKey(5,2,e)&&(w==o||q._setKey(5,3,o))&&(w==m||q._setValue(5,1,m)))&&a._sendXEvent(q)}else b=v;return b};a.Mc=function(b,e,o){a._initData();if(a.J()){var m=new Z.N;m._setKey(6,1,e.href);var q=o?function(){a.db(b,e)}:w;j.H("&utmt=event&utme="+
+S(m.G())+a.wa(),a.s,a.c,v,r,q);if(o){var u=this;c.e.setTimeout(function(){u.db(b,e)},500)}}};a.db=function(b,e){if(!b)b=c.e.event;var o=r;if(e.gatcOnclick)o=e.gatcOnclick(b);if(o||typeof o=="undefined")if(!e.target||e.target=="_self")c.e[A]=e.href;else if(e.target=="_top")c.e.top.document[A]=e.href;else if(e.target=="_parent")c.e.parent.document[A]=e.href};a.Rb=function(b){if(!b)b=c.e.event;var e=b.shiftKey||b.ctrlKey||b.altKey;if(!e)if(b.modifiers&&c.e.Event)e=b.modifiers&c.e.Event.CONTROL_MASK||
+b.modifiers&c.e.Event.SHIFT_MASK||b.modifiers&c.e.Event.ALT_MASK;return e};a.Pc=function(){return c};a._setDomainName=function(b){c.b=b};a._addOrganic=function(b,e,o){c.T.splice(o?0:c.T.length,0,new Z.Ha(b,e))};a._clearOrganic=function(){c.T=[]};a._addIgnoredOrganic=function(b){V(c.ta,b)};a._clearIgnoredOrganic=function(){c.ta=[]};a._addIgnoredRef=function(b){V(c.va,b)};a._clearIgnoredRef=function(){c.va=[]};a._setAllowHash=function(b){c.Ra=b?1:0};a._setCampaignTrack=function(b){c.da=b?1:0};a._setClientInfo=
+function(b){c.fa=b?1:0};a._getClientInfo=function(){return c.fa};a._setCookiePath=function(b){c.h=b};a._setTransactionDelim=function(b){c.u=b};a._setCookieTimeout=function(b){a._setCampaignCookieTimeout(b*1E3)};a._setCampaignCookieTimeout=function(b){c.Ta=b};a._setDetectFlash=function(b){c.ha=b?1:0};a._getDetectFlash=function(){return c.ha};a._setDetectTitle=function(b){c.ga=b?1:0};a._getDetectTitle=function(){return c.ga};a._setLocalGifPath=function(b){c.oa=b};a._getLocalGifPath=function(){return c.oa};
+a._setLocalServerMode=function(){c.I=0};a._setRemoteServerMode=function(){c.I=1};a._setLocalRemoteServerMode=function(){c.I=2};a._getServiceMode=function(){return c.I};a._setSampleRate=function(b){c.U=b};a._setSessionTimeout=function(b){a._setSessionCookieTimeout(b*1E3)};a._setSessionCookieTimeout=function(b){c.sb=b};a._setAllowLinker=function(b){c.z=b?1:0};a._setAllowAnchor=function(b){c.ba=b?1:0};a._setCampNameKey=function(b){c.Ia=b};a._setCampContentKey=function(b){c.Ja=b};a._setCampIdKey=function(b){c.Ka=
+b};a._setCampMediumKey=function(b){c.La=b};a._setCampNOKey=function(b){c.Ma=b};a._setCampSourceKey=function(b){c.Na=b};a._setCampTermKey=function(b){c.Oa=b};a._setCampCIdKey=function(b){c.Pa=b};a._getAccount=function(){return a.s};a._setAccount=function(b){a.s=b};a._setNamespace=function(b){c.o=b?S(b):w};a._getVersion=function(){return ca};a._setAutoTrackOutbound=function(b){c.t=[];if(b)c.t=b};a._setTrackOutboundSubdomains=function(b){c.lb=b};a._setHrefExamineLimit=function(b){c.ra=b};a._setReferrerOverride=
+function(b){a.ab=b};a._setCookiePersistence=function(b){a._setVisitorCookieTimeout(b)};a._setVisitorCookieTimeout=function(b){c.v=b}};Z._getTracker=function(i,l){return new Z.aa(i,l)};var ka=v,$={ca:{},_createAsyncTracker:function(i,l){l=l||"";i=new Z.aa(i);$.ca[l]=i;ka=r;return i},_getAsyncTracker:function(i){i=i||"";var l=$.ca[i];if(!l){l=new Z.aa;$.ca[i]=l;ka=r}return l},push:function(){for(var i=arguments,l=0,g=0;g<i[x];g++)try{if(typeof i[g]==="function")i[g]();else{var t="",k=i[g][0],p=k.lastIndexOf(".");if(p>0){t=O(k,0,p);k=O(k,p+1)}var f=$._getAsyncTracker(t);f[k].apply(f,i[g].slice(1))}}catch(h){l++}return l}};window[aa]=Z;function na(){var i=window[ba],l=v;if(i&&typeof i.push=="function"){l=i.constructor==Array;if(!l)return}window[ba]=$;l&&$.push.apply($,i)}na();})()
+
+
+
+try {
+var pageTracker = _gat._getTracker("UA-86951-7");
+pageTracker._trackPageview();
+} catch(err) {}
+</script>
+
+
+<script id="dojo" type="x">
+/*
+ Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is a compiled version of Dojo, built for deployment and not for
+ development. To get an editable version, please visit:
+
+ http://dojotoolkit.org
+
+ for documentation and information on getting the source.
+*/
+
+(function(){var _1=null;if((_1||(typeof djConfig!="undefined"&&djConfig.scopeMap))&&(typeof window!="undefined")){var _2="",_3="",_4="",_5={},_6={};_1=_1||djConfig.scopeMap;for(var i=0;i<_1.length;i++){var _7=_1[i];_2+="var "+_7[0]+" = {}; "+_7[1]+" = "+_7[0]+";"+_7[1]+"._scopeName = '"+_7[1]+"';";_3+=(i==0?"":",")+_7[0];_4+=(i==0?"":",")+_7[1];_5[_7[0]]=_7[1];_6[_7[1]]=_7[0];}eval(_2+"dojo._scopeArgs = ["+_4+"];");dojo._scopePrefixArgs=_3;dojo._scopePrefix="(function("+_3+"){";dojo._scopeSuffix="})("+_4+")";dojo._scopeMap=_5;dojo._scopeMapRev=_6;}(function(){if(typeof this["loadFirebugConsole"]=="function"){this["loadFirebugConsole"]();}else{this.console=this.console||{};var cn=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"];var i=0,tn;while((tn=cn[i++])){if(!console[tn]){(function(){var _8=tn+"";console[_8]=("log" in console)?function(){var a=Array.apply({},arguments);a.unshift(_8+":");console["log"](a.join(" "));}:function(){};console[_8]._fake=true;})();}}}if(typeof dojo=="undefined"){dojo={_scopeName:"dojo",_scopePrefix:"",_scopePrefixArgs:"",_scopeSuffix:"",_scopeMap:{},_scopeMapRev:{}};}var d=dojo;if(typeof dijit=="undefined"){dijit={_scopeName:"dijit"};}if(typeof dojox=="undefined"){dojox={_scopeName:"dojox"};}if(!d._scopeArgs){d._scopeArgs=[dojo,dijit,dojox];}d.global=this;d.config={isDebug:false,debugAtAllCosts:false};if(typeof djConfig!="undefined"){for(var _9 in djConfig){d.config[_9]=djConfig[_9];}}dojo.locale=d.config.locale;var _a="$Rev: 21254 $".match(/\d+/);dojo.version={major:1,minor:4,patch:1,flag:"",revision:_a?+_a[0]:NaN,toString:function(){with(d.version){return major+"."+minor+"."+patch+flag+" ("+revision+")";}}};if(typeof OpenAjax!="undefined"){OpenAjax.hub.registerLibrary(dojo._scopeName,"http://dojotoolkit.org",d.version.toString());}var _b,_c,_d={};for(var i in {toString:1}){_b=[];break;}dojo._extraNames=_b=_b||["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];_c=_b.length;dojo._mixin=function(_e,_f){var _10,s,i;for(_10 in _f){s=_f[_10];if(!(_10 in _e)||(_e[_10]!==s&&(!(_10 in _d)||_d[_10]!==s))){_e[_10]=s;}}if(_c&&_f){for(i=0;i<_c;++i){_10=_b[i];s=_f[_10];if(!(_10 in _e)||(_e[_10]!==s&&(!(_10 in _d)||_d[_10]!==s))){_e[_10]=s;}}}return _e;};dojo.mixin=function(obj,_11){if(!obj){obj={};}for(var i=1,l=arguments.length;i<l;i++){d._mixin(obj,arguments[i]);}return obj;};dojo._getProp=function(_12,_13,_14){var obj=_14||d.global;for(var i=0,p;obj&&(p=_12[i]);i++){if(i==0&&d._scopeMap[p]){p=d._scopeMap[p];}obj=(p in obj?obj[p]:(_13?obj[p]={}:undefined));}return obj;};dojo.setObject=function(_15,_16,_17){var _18=_15.split("."),p=_18.pop(),obj=d._getProp(_18,true,_17);return obj&&p?(obj[p]=_16):undefined;};dojo.getObject=function(_19,_1a,_1b){return d._getProp(_19.split("."),_1a,_1b);};dojo.exists=function(_1c,obj){return !!d.getObject(_1c,false,obj);};dojo["eval"]=function(_1d){return d.global.eval?d.global.eval(_1d):eval(_1d);};d.deprecated=d.experimental=function(){};})();(function(){var d=dojo;d.mixin(d,{_loadedModules:{},_inFlightCount:0,_hasResource:{},_modulePrefixes:{dojo:{name:"dojo",value:"."},doh:{name:"doh",value:"../util/doh"},tests:{name:"tests",value:"tests"}},_moduleHasPrefix:function(_1e){var mp=d._modulePrefixes;return !!(mp[_1e]&&mp[_1e].value);},_getModulePrefix:function(_1f){var mp=d._modulePrefixes;if(d._moduleHasPrefix(_1f)){return mp[_1f].value;}return _1f;},_loadedUrls:[],_postLoad:false,_loaders:[],_unloaders:[],_loadNotifying:false});dojo._loadPath=function(_20,_21,cb){var uri=((_20.charAt(0)=="/"||_20.match(/^\w+:/))?"":d.baseUrl)+_20;try{return !_21?d._loadUri(uri,cb):d._loadUriAndCheck(uri,_21,cb);}catch(e){console.error(e);return false;}};dojo._loadUri=function(uri,cb){if(d._loadedUrls[uri]){return true;}d._inFlightCount++;var _22=d._getText(uri,true);if(_22){d._loadedUrls[uri]=true;d._loadedUrls.push(uri);if(cb){_22="("+_22+")";}else{_22=d._scopePrefix+_22+d._scopeSuffix;}if(!d.isIE){_22+="\r\n//@ sourceURL="+uri;}var _23=d["eval"](_22);if(cb){cb(_23);}}if(--d._inFlightCount==0&&d._postLoad&&d._loaders.length){setTimeout(function(){if(d._inFlightCount==0){d._callLoaded();}},0);}return !!_22;};dojo._loadUriAndCheck=function(uri,_24,cb){var ok=false;try{ok=d._loadUri(uri,cb);}catch(e){console.error("failed loading "+uri+" with error: "+e);}return !!(ok&&d._loadedModules[_24]);};dojo.loaded=function(){d._loadNotifying=true;d._postLoad=true;var mll=d._loaders;d._loaders=[];for(var x=0;x<mll.length;x++){mll[x]();}d._loadNotifying=false;if(d._postLoad&&d._inFlightCount==0&&mll.length){d._callLoaded();}};dojo.unloaded=function(){var mll=d._unloaders;while(mll.length){(mll.pop())();}};d._onto=function(arr,obj,fn){if(!fn){arr.push(obj);}else{if(fn){var _25=(typeof fn=="string")?obj[fn]:fn;arr.push(function(){_25.call(obj);});}}};dojo.ready=dojo.addOnLoad=function(obj,_26){d._onto(d._loaders,obj,_26);if(d._postLoad&&d._inFlightCount==0&&!d._loadNotifying){d._callLoaded();}};var dca=d.config.addOnLoad;if(dca){d.addOnLoad[(dca instanceof Array?"apply":"call")](d,dca);}dojo._modulesLoaded=function(){if(d._postLoad){return;}if(d._inFlightCount>0){console.warn("files still in flight!");return;}d._callLoaded();};dojo._callLoaded=function(){if(typeof setTimeout=="object"||(d.config.useXDomain&&d.isOpera)){setTimeout(d.isAIR?function(){d.loaded();}:d._scopeName+".loaded();",0);}else{d.loaded();}};dojo._getModuleSymbols=function(_27){var _28=_27.split(".");for(var i=_28.length;i>0;i--){var _29=_28.slice(0,i).join(".");if(i==1&&!d._moduleHasPrefix(_29)){_28[0]="../"+_28[0];}else{var _2a=d._getModulePrefix(_29);if(_2a!=_29){_28.splice(0,i,_2a);break;}}}return _28;};dojo._global_omit_module_check=false;dojo.loadInit=function(_2b){_2b();};dojo._loadModule=dojo.require=function(_2c,_2d){_2d=d._global_omit_module_check||_2d;var _2e=d._loadedModules[_2c];if(_2e){return _2e;}var _2f=d._getModuleSymbols(_2c).join("/")+".js";var _30=!_2d?_2c:null;var ok=d._loadPath(_2f,_30);if(!ok&&!_2d){throw new Error("Could not load '"+_2c+"'; last tried '"+_2f+"'");}if(!_2d&&!d._isXDomain){_2e=d._loadedModules[_2c];if(!_2e){throw new Error("symbol '"+_2c+"' is not defined after loading '"+_2f+"'");}}return _2e;};dojo.provide=function(_31){_31=_31+"";return (d._loadedModules[_31]=d.getObject(_31,true));};dojo.platformRequire=function(_32){var _33=_32.common||[];var _34=_33.concat(_32[d._name]||_32["default"]||[]);for(var x=0;x<_34.length;x++){var _35=_34[x];if(_35.constructor==Array){d._loadModule.apply(d,_35);}else{d._loadModule(_35);}}};dojo.requireIf=function(_36,_37){if(_36===true){var _38=[];for(var i=1;i<arguments.length;i++){_38.push(arguments[i]);}d.require.apply(d,_38);}};dojo.requireAfterIf=d.requireIf;dojo.registerModulePath=function(_39,_3a){d._modulePrefixes[_39]={name:_39,value:_3a};};dojo.requireLocalization=function(_3b,_3c,_3d,_3e){d.require("dojo.i18n");d.i18n._requireLocalization.apply(d.hostenv,arguments);};var ore=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),ire=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");dojo._Url=function(){var n=null,_3f=arguments,uri=[_3f[0]];for(var i=1;i<_3f.length;i++){if(!_3f[i]){continue;}var _40=new d._Url(_3f[i]+""),_41=new d._Url(uri[0]+"");if(_40.path==""&&!_40.scheme&&!_40.authority&&!_40.query){if(_40.fragment!=n){_41.fragment=_40.fragment;}_40=_41;}else{if(!_40.scheme){_40.scheme=_41.scheme;if(!_40.authority){_40.authority=_41.authority;if(_40.path.charAt(0)!="/"){var _42=_41.path.substring(0,_41.path.lastIndexOf("/")+1)+_40.path;var _43=_42.split("/");for(var j=0;j<_43.length;j++){if(_43[j]=="."){if(j==_43.length-1){_43[j]="";}else{_43.splice(j,1);j--;}}else{if(j>0&&!(j==1&&_43[0]=="")&&_43[j]==".."&&_43[j-1]!=".."){if(j==(_43.length-1)){_43.splice(j,1);_43[j-1]="";}else{_43.splice(j-1,2);j-=2;}}}}_40.path=_43.join("/");}}}}uri=[];if(_40.scheme){uri.push(_40.scheme,":");}if(_40.authority){uri.push("//",_40.authority);}uri.push(_40.path);if(_40.query){uri.push("?",_40.query);}if(_40.fragment){uri.push("#",_40.fragment);}}this.uri=uri.join("");var r=this.uri.match(ore);this.scheme=r[2]||(r[1]?"":n);this.authority=r[4]||(r[3]?"":n);this.path=r[5];this.query=r[7]||(r[6]?"":n);this.fragment=r[9]||(r[8]?"":n);if(this.authority!=n){r=this.authority.match(ire);this.user=r[3]||n;this.password=r[4]||n;this.host=r[6]||r[7];this.port=r[9]||n;}};dojo._Url.prototype.toString=function(){return this.uri;};dojo.moduleUrl=function(_44,url){var loc=d._getModuleSymbols(_44).join("/");if(!loc){return null;}if(loc.lastIndexOf("/")!=loc.length-1){loc+="/";}var _45=loc.indexOf(":");if(loc.charAt(0)!="/"&&(_45==-1||_45>loc.indexOf("/"))){loc=d.baseUrl+loc;}return new d._Url(loc,url);};})();if(typeof window!="undefined"){dojo.isBrowser=true;dojo._name="browser";(function(){var d=dojo;if(document&&document.getElementsByTagName){var _46=document.getElementsByTagName("script");var _47=/dojo(\.xd)?\.js(\W|$)/i;for(var i=0;i<_46.length;i++){var src=_46[i].getAttribute("src");if(!src){continue;}var m=src.match(_47);if(m){if(!d.config.baseUrl){d.config.baseUrl=src.substring(0,m.index);}var cfg=_46[i].getAttribute("djConfig");if(cfg){var _48=eval("({ "+cfg+" })");for(var x in _48){dojo.config[x]=_48[x];}}break;}}}d.baseUrl=d.config.baseUrl;var n=navigator;var dua=n.userAgent,dav=n.appVersion,tv=parseFloat(dav);if(dua.indexOf("Opera")>=0){d.isOpera=tv;}if(dua.indexOf("AdobeAIR")>=0){d.isAIR=1;}d.isKhtml=(dav.indexOf("Konqueror")>=0)?tv:0;d.isWebKit=parseFloat(dua.split("WebKit/")[1])||undefined;d.isChrome=parseFloat(dua.split("Chrome/")[1])||undefined;d.isMac=dav.indexOf("Macintosh")>=0;var _49=Math.max(dav.indexOf("WebKit"),dav.indexOf("Safari"),0);if(_49&&!dojo.isChrome){d.isSafari=parseFloat(dav.split("Version/")[1]);if(!d.isSafari||parseFloat(dav.substr(_49+7))<=419.3){d.isSafari=2;}}if(dua.indexOf("Gecko")>=0&&!d.isKhtml&&!d.isWebKit){d.isMozilla=d.isMoz=tv;}if(d.isMoz){d.isFF=parseFloat(dua.split("Firefox/")[1]||dua.split("Minefield/")[1])||undefined;}if(document.all&&!d.isOpera){d.isIE=parseFloat(dav.split("MSIE ")[1])||undefined;var _4a=document.documentMode;if(_4a&&_4a!=5&&Math.floor(d.isIE)!=_4a){d.isIE=_4a;}}if(dojo.isIE&&window.location.protocol==="file:"){dojo.config.ieForceActiveXXhr=true;}d.isQuirks=document.compatMode=="BackCompat";d.locale=dojo.config.locale||(d.isIE?n.userLanguage:n.language).toLowerCase();d._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];d._xhrObj=function(){var _4b,_4c;if(!dojo.isIE||!dojo.config.ieForceActiveXXhr){try{_4b=new XMLHttpRequest();}catch(e){}}if(!_4b){for(var i=0;i<3;++i){var _4d=d._XMLHTTP_PROGIDS[i];try{_4b=new ActiveXObject(_4d);}catch(e){_4c=e;}if(_4b){d._XMLHTTP_PROGIDS=[_4d];break;}}}if(!_4b){throw new Error("XMLHTTP not available: "+_4c);}return _4b;};d._isDocumentOk=function(_4e){var _4f=_4e.status||0,lp=location.protocol;return (_4f>=200&&_4f<300)||_4f==304||_4f==1223||(!_4f&&(lp=="file:"||lp=="chrome:"||lp=="app:"));};var _50=window.location+"";var _51=document.getElementsByTagName("base");var _52=(_51&&_51.length>0);d._getText=function(uri,_53){var _54=d._xhrObj();if(!_52&&dojo._Url){uri=(new dojo._Url(_50,uri)).toString();}if(d.config.cacheBust){uri+="";uri+=(uri.indexOf("?")==-1?"?":"&")+String(d.config.cacheBust).replace(/\W+/g,"");}_54.open("GET",uri,false);try{_54.send(null);if(!d._isDocumentOk(_54)){var err=Error("Unable to load "+uri+" status:"+_54.status);err.status=_54.status;err.responseText=_54.responseText;throw err;}}catch(e){if(_53){return null;}throw e;}return _54.responseText;};var _55=window;var _56=function(_57,fp){var _58=_55.attachEvent||_55.addEventListener;_57=_55.attachEvent?_57:_57.substring(2);_58(_57,function(){fp.apply(_55,arguments);},false);};d._windowUnloaders=[];d.windowUnloaded=function(){var mll=d._windowUnloaders;while(mll.length){(mll.pop())();}};var _59=0;d.addOnWindowUnload=function(obj,_5a){d._onto(d._windowUnloaders,obj,_5a);if(!_59){_59=1;_56("onunload",d.windowUnloaded);}};var _5b=0;d.addOnUnload=function(obj,_5c){d._onto(d._unloaders,obj,_5c);if(!_5b){_5b=1;_56("onbeforeunload",dojo.unloaded);}};})();dojo._initFired=false;dojo._loadInit=function(e){if(!dojo._initFired){dojo._initFired=true;if(!dojo.config.afterOnLoad&&window.detachEvent){window.detachEvent("onload",dojo._loadInit);}if(dojo._inFlightCount==0){dojo._modulesLoaded();}}};if(!dojo.config.afterOnLoad){if(document.addEventListener){document.addEventListener("DOMContentLoaded",dojo._loadInit,false);window.addEventListener("load",dojo._loadInit,false);}else{if(window.attachEvent){window.attachEvent("onload",dojo._loadInit);}}}if(dojo.isIE){if(!dojo.config.afterOnLoad&&!dojo.config.skipIeDomLoaded){document.write("<scr"+"ipt defer src=\"//:\" "+"onreadystatechange=\"if(this.readyState=='complete'){"+dojo._scopeName+"._loadInit();}\">"+"</scr"+"ipt>");}try{document.namespaces.add("v","urn:schemas-microsoft-com:vml");var _5d=["*","group","roundrect","oval","shape","rect","imagedata"],i=0,l=1,s=document.createStyleSheet();if(dojo.isIE>=8){i=1;l=_5d.length;}for(;i<l;++i){s.addRule("v\\:"+_5d[i],"behavior:url(#default#VML); display:inline-block");}}catch(e){}}}(function(){var mp=dojo.config["modulePaths"];if(mp){for(var _5e in mp){dojo.registerModulePath(_5e,mp[_5e]);}}})();if(dojo.config.isDebug){dojo.require("dojo._firebug.firebug");}if(dojo.config.debugAtAllCosts){dojo.config.useXDomain=true;dojo.require("dojo._base._loader.loader_xd");dojo.require("dojo._base._loader.loader_debug");dojo.require("dojo.i18n");}if(!dojo._hasResource["dojo._base.lang"]){dojo._hasResource["dojo._base.lang"]=true;dojo.provide("dojo._base.lang");(function(){var d=dojo,_5f=Object.prototype.toString;dojo.isString=function(it){return (typeof it=="string"||it instanceof String);};dojo.isArray=function(it){return it&&(it instanceof Array||typeof it=="array");};dojo.isFunction=function(it){return _5f.call(it)==="[object Function]";};dojo.isObject=function(it){return it!==undefined&&(it===null||typeof it=="object"||d.isArray(it)||d.isFunction(it));};dojo.isArrayLike=function(it){return it&&it!==undefined&&!d.isString(it)&&!d.isFunction(it)&&!(it.tagName&&it.tagName.toLowerCase()=="form")&&(d.isArray(it)||isFinite(it.length));};dojo.isAlien=function(it){return it&&!d.isFunction(it)&&/\{\s*\[native code\]\s*\}/.test(String(it));};dojo.extend=function(_60,_61){for(var i=1,l=arguments.length;i<l;i++){d._mixin(_60.prototype,arguments[i]);}return _60;};dojo._hitchArgs=function(_62,_63){var pre=d._toArray(arguments,2);var _64=d.isString(_63);return function(){var _65=d._toArray(arguments);var f=_64?(_62||d.global)[_63]:_63;return f&&f.apply(_62||this,pre.concat(_65));};};dojo.hitch=function(_66,_67){if(arguments.length>2){return d._hitchArgs.apply(d,arguments);}if(!_67){_67=_66;_66=null;}if(d.isString(_67)){_66=_66||d.global;if(!_66[_67]){throw (["dojo.hitch: scope[\"",_67,"\"] is null (scope=\"",_66,"\")"].join(""));}return function(){return _66[_67].apply(_66,arguments||[]);};}return !_66?_67:function(){return _67.apply(_66,arguments||[]);};};dojo.delegate=dojo._delegate=(function(){function TMP(){};return function(obj,_68){TMP.prototype=obj;var tmp=new TMP();TMP.prototype=null;if(_68){d._mixin(tmp,_68);}return tmp;};})();var _69=function(obj,_6a,_6b){return (_6b||[]).concat(Array.prototype.slice.call(obj,_6a||0));};var _6c=function(obj,_6d,_6e){var arr=_6e||[];for(var x=_6d||0;x<obj.length;x++){arr.push(obj[x]);}return arr;};dojo._toArray=d.isIE?function(obj){return ((obj.item)?_6c:_69).apply(this,arguments);}:_69;dojo.partial=function(_6f){var arr=[null];return d.hitch.apply(d,arr.concat(d._toArray(arguments)));};var _70=d._extraNames,_71=_70.length,_72={};dojo.clone=function(o){if(!o||typeof o!="object"||d.isFunction(o)){return o;}if(o.nodeType&&"cloneNode" in o){return o.cloneNode(true);}if(o instanceof Date){return new Date(o.getTime());}var r,i,l,s,_73;if(d.isArray(o)){r=[];for(i=0,l=o.length;i<l;++i){if(i in o){r.push(d.clone(o[i]));}}}else{r=o.constructor?new o.constructor():{};}for(_73 in o){s=o[_73];if(!(_73 in r)||(r[_73]!==s&&(!(_73 in _72)||_72[_73]!==s))){r[_73]=d.clone(s);}}if(_71){for(i=0;i<_71;++i){_73=_70[i];s=o[_73];if(!(_73 in r)||(r[_73]!==s&&(!(_73 in _72)||_72[_73]!==s))){r[_73]=s;}}}return r;};dojo.trim=String.prototype.trim?function(str){return str.trim();}:function(str){return str.replace(/^\s\s*/,"").replace(/\s\s*$/,"");};var _74=/\{([^\}]+)\}/g;dojo.replace=function(_75,map,_76){return _75.replace(_76||_74,d.isFunction(map)?map:function(_77,k){return d.getObject(k,false,map);});};})();}if(!dojo._hasResource["dojo._base.array"]){dojo._hasResource["dojo._base.array"]=true;dojo.provide("dojo._base.array");(function(){var _78=function(arr,obj,cb){return [(typeof arr=="string")?arr.split(""):arr,obj||dojo.global,(typeof cb=="string")?new Function("item","index","array",cb):cb];};var _79=function(_7a,arr,_7b,_7c){var _7d=_78(arr,_7c,_7b);arr=_7d[0];for(var i=0,l=arr.length;i<l;++i){var _7e=!!_7d[2].call(_7d[1],arr[i],i,arr);if(_7a^_7e){return _7e;}}return _7a;};dojo.mixin(dojo,{indexOf:function(_7f,_80,_81,_82){var _83=1,end=_7f.length||0,i=0;if(_82){i=end-1;_83=end=-1;}if(_81!=undefined){i=_81;}if((_82&&i>end)||i<end){for(;i!=end;i+=_83){if(_7f[i]==_80){return i;}}}return -1;},lastIndexOf:function(_84,_85,_86){return dojo.indexOf(_84,_85,_86,true);},forEach:function(arr,_87,_88){if(!arr||!arr.length){return;}var _89=_78(arr,_88,_87);arr=_89[0];for(var i=0,l=arr.length;i<l;++i){_89[2].call(_89[1],arr[i],i,arr);}},every:function(arr,_8a,_8b){return _79(true,arr,_8a,_8b);},some:function(arr,_8c,_8d){return _79(false,arr,_8c,_8d);},map:function(arr,_8e,_8f){var _90=_78(arr,_8f,_8e);arr=_90[0];var _91=(arguments[3]?(new arguments[3]()):[]);for(var i=0,l=arr.length;i<l;++i){_91.push(_90[2].call(_90[1],arr[i],i,arr));}return _91;},filter:function(arr,_92,_93){var _94=_78(arr,_93,_92);arr=_94[0];var _95=[];for(var i=0,l=arr.length;i<l;++i){if(_94[2].call(_94[1],arr[i],i,arr)){_95.push(arr[i]);}}return _95;}});})();}if(!dojo._hasResource["dojo._base.declare"]){dojo._hasResource["dojo._base.declare"]=true;dojo.provide("dojo._base.declare");(function(){var d=dojo,mix=d._mixin,op=Object.prototype,_96=op.toString,_97=new Function,_98=0,_99="constructor";function err(msg){throw new Error("declare: "+msg);};function _9a(_9b){var _9c=[],_9d=[{cls:0,refs:[]}],_9e={},_9f=1,l=_9b.length,i=0,j,lin,_a0,top,_a1,rec,_a2,_a3;for(;i<l;++i){_a0=_9b[i];if(!_a0){err("mixin #"+i+" is null");}lin=_a0._meta?_a0._meta.bases:[_a0];top=0;for(j=lin.length-1;j>=0;--j){_a1=lin[j].prototype;if(!_a1.hasOwnProperty("declaredClass")){_a1.declaredClass="uniqName_"+(_98++);}_a2=_a1.declaredClass;if(!_9e.hasOwnProperty(_a2)){_9e[_a2]={count:0,refs:[],cls:lin[j]};++_9f;}rec=_9e[_a2];if(top&&top!==rec){rec.refs.push(top);++top.count;}top=rec;}++top.count;_9d[0].refs.push(top);}while(_9d.length){top=_9d.pop();_9c.push(top.cls);--_9f;while(_a3=top.refs,_a3.length==1){top=_a3[0];if(!top||--top.count){top=0;break;}_9c.push(top.cls);--_9f;}if(top){for(i=0,l=_a3.length;i<l;++i){top=_a3[i];if(!--top.count){_9d.push(top);}}}}if(_9f){err("can't build consistent linearization");}_a0=_9b[0];_9c[0]=_a0?_a0._meta&&_a0===_9c[_9c.length-_a0._meta.bases.length]?_a0._meta.bases.length:1:0;return _9c;};function _a4(_a5,a,f){var _a6,_a7,_a8,_a9,_aa,_ab,_ac,opf,pos,_ad=this._inherited=this._inherited||{};if(typeof _a5=="string"){_a6=_a5;_a5=a;a=f;}f=0;_a9=_a5.callee;_a6=_a6||_a9.nom;if(!_a6){err("can't deduce a name to call inherited()");}_aa=this.constructor._meta;_a8=_aa.bases;pos=_ad.p;if(_a6!=_99){if(_ad.c!==_a9){pos=0;_ab=_a8[0];_aa=_ab._meta;if(_aa.hidden[_a6]!==_a9){_a7=_aa.chains;if(_a7&&typeof _a7[_a6]=="string"){err("calling chained method with inherited: "+_a6);}do{_aa=_ab._meta;_ac=_ab.prototype;if(_aa&&(_ac[_a6]===_a9&&_ac.hasOwnProperty(_a6)||_aa.hidden[_a6]===_a9)){break;}}while(_ab=_a8[++pos]);pos=_ab?pos:-1;}}_ab=_a8[++pos];if(_ab){_ac=_ab.prototype;if(_ab._meta&&_ac.hasOwnProperty(_a6)){f=_ac[_a6];}else{opf=op[_a6];do{_ac=_ab.prototype;f=_ac[_a6];if(f&&(_ab._meta?_ac.hasOwnProperty(_a6):f!==opf)){break;}}while(_ab=_a8[++pos]);}}f=_ab&&f||op[_a6];}else{if(_ad.c!==_a9){pos=0;_aa=_a8[0]._meta;if(_aa&&_aa.ctor!==_a9){_a7=_aa.chains;if(!_a7||_a7.constructor!=="manual"){err("calling chained constructor with inherited");}while(_ab=_a8[++pos]){_aa=_ab._meta;if(_aa&&_aa.ctor===_a9){break;}}pos=_ab?pos:-1;}}while(_ab=_a8[++pos]){_aa=_ab._meta;f=_aa?_aa.ctor:_ab;if(f){break;}}f=_ab&&f;}_ad.c=f;_ad.p=pos;if(f){return a===true?f:f.apply(this,a||_a5);}};function _ae(_af,_b0){if(typeof _af=="string"){return this.inherited(_af,_b0,true);}return this.inherited(_af,true);};function _b1(cls){var _b2=this.constructor._meta.bases;for(var i=0,l=_b2.length;i<l;++i){if(_b2[i]===cls){return true;}}return this instanceof cls;};function _b3(_b4,_b5){var _b6,t,i=0,l=d._extraNames.length;for(_b6 in _b5){t=_b5[_b6];if((t!==op[_b6]||!(_b6 in op))&&_b6!=_99){if(_96.call(t)=="[object Function]"){t.nom=_b6;}_b4[_b6]=t;}}for(;i<l;++i){_b6=d._extraNames[i];t=_b5[_b6];if((t!==op[_b6]||!(_b6 in op))&&_b6!=_99){if(_96.call(t)=="[object Function]"){t.nom=_b6;}_b4[_b6]=t;}}return _b4;};function _b7(_b8){_b3(this.prototype,_b8);return this;};function _b9(_ba,_bb){return function(){var a=arguments,_bc=a,a0=a[0],f,i,m,l=_ba.length,_bd;if(_bb&&(a0&&a0.preamble||this.preamble)){_bd=new Array(_ba.length);_bd[0]=a;for(i=0;;){a0=a[0];if(a0){f=a0.preamble;if(f){a=f.apply(this,a)||a;}}f=_ba[i].prototype;f=f.hasOwnProperty("preamble")&&f.preamble;if(f){a=f.apply(this,a)||a;}if(++i==l){break;}_bd[i]=a;}}for(i=l-1;i>=0;--i){f=_ba[i];m=f._meta;f=m?m.ctor:f;if(f){f.apply(this,_bd?_bd[i]:a);}}f=this.postscript;if(f){f.apply(this,_bc);}};};function _be(_bf,_c0){return function(){var a=arguments,t=a,a0=a[0],f;if(_c0){if(a0){f=a0.preamble;if(f){t=f.apply(this,t)||t;}}f=this.preamble;if(f){f.apply(this,t);}}if(_bf){_bf.apply(this,a);}f=this.postscript;if(f){f.apply(this,a);}};};function _c1(_c2){return function(){var a=arguments,i=0,f;for(;f=_c2[i];++i){m=f._meta;f=m?m.ctor:f;if(f){f.apply(this,a);break;}}f=this.postscript;if(f){f.apply(this,a);}};};function _c3(_c4,_c5,_c6){return function(){var b,m,f,i=0,_c7=1;if(_c6){i=_c5.length-1;_c7=-1;}for(;b=_c5[i];i+=_c7){m=b._meta;f=(m?m.hidden:b.prototype)[_c4];if(f){f.apply(this,arguments);}}};};d.declare=function(_c8,_c9,_ca){var _cb,i,t,_cc,_cd,_ce,_cf,_d0=1,_d1=_c9;if(typeof _c8!="string"){_ca=_c9;_c9=_c8;_c8="";}_ca=_ca||{};if(_96.call(_c9)=="[object Array]"){_ce=_9a(_c9);t=_ce[0];_d0=_ce.length-t;_c9=_ce[_d0];}else{_ce=[0];if(_c9){t=_c9._meta;_ce=_ce.concat(t?t.bases:_c9);}}if(_c9){for(i=_d0-1;;--i){_97.prototype=_c9.prototype;_cb=new _97;if(!i){break;}t=_ce[i];mix(_cb,t._meta?t._meta.hidden:t.prototype);_cc=new Function;_cc.superclass=_c9;_cc.prototype=_cb;_c9=_cb.constructor=_cc;}}else{_cb={};}_b3(_cb,_ca);t=_ca.constructor;if(t!==op.constructor){t.nom=_99;_cb.constructor=t;}_97.prototype=0;for(i=_d0-1;i;--i){t=_ce[i]._meta;if(t&&t.chains){_cf=mix(_cf||{},t.chains);}}if(_cb["-chains-"]){_cf=mix(_cf||{},_cb["-chains-"]);}t=!_cf||!_cf.hasOwnProperty(_99);_ce[0]=_cc=(_cf&&_cf.constructor==="manual")?_c1(_ce):(_ce.length==1?_be(_ca.constructor,t):_b9(_ce,t));_cc._meta={bases:_ce,hidden:_ca,chains:_cf,parents:_d1,ctor:_ca.constructor};_cc.superclass=_c9&&_c9.prototype;_cc.extend=_b7;_cc.prototype=_cb;_cb.constructor=_cc;_cb.getInherited=_ae;_cb.inherited=_a4;_cb.isInstanceOf=_b1;if(_c8){_cb.declaredClass=_c8;d.setObject(_c8,_cc);}if(_cf){for(_cd in _cf){if(_cb[_cd]&&typeof _cf[_cd]=="string"&&_cd!=_99){t=_cb[_cd]=_c3(_cd,_ce,_cf[_cd]==="after");t.nom=_cd;}}}return _cc;};d.safeMixin=_b3;})();}if(!dojo._hasResource["dojo._base.connect"]){dojo._hasResource["dojo._base.connect"]=true;dojo.provide("dojo._base.connect");dojo._listener={getDispatcher:function(){return function(){var ap=Array.prototype,c=arguments.callee,ls=c._listeners,t=c.target;var r=t&&t.apply(this,arguments);var lls;lls=[].concat(ls);for(var i in lls){if(!(i in ap)){lls[i].apply(this,arguments);}}return r;};},add:function(_d2,_d3,_d4){_d2=_d2||dojo.global;var f=_d2[_d3];if(!f||!f._listeners){var d=dojo._listener.getDispatcher();d.target=f;d._listeners=[];f=_d2[_d3]=d;}return f._listeners.push(_d4);},remove:function(_d5,_d6,_d7){var f=(_d5||dojo.global)[_d6];if(f&&f._listeners&&_d7--){delete f._listeners[_d7];}}};dojo.connect=function(obj,_d8,_d9,_da,_db){var a=arguments,_dc=[],i=0;_dc.push(dojo.isString(a[0])?null:a[i++],a[i++]);var a1=a[i+1];_dc.push(dojo.isString(a1)||dojo.isFunction(a1)?a[i++]:null,a[i++]);for(var l=a.length;i<l;i++){_dc.push(a[i]);}return dojo._connect.apply(this,_dc);};dojo._connect=function(obj,_dd,_de,_df){var l=dojo._listener,h=l.add(obj,_dd,dojo.hitch(_de,_df));return [obj,_dd,h,l];};dojo.disconnect=function(_e0){if(_e0&&_e0[0]!==undefined){dojo._disconnect.apply(this,_e0);delete _e0[0];}};dojo._disconnect=function(obj,_e1,_e2,_e3){_e3.remove(obj,_e1,_e2);};dojo._topics={};dojo.subscribe=function(_e4,_e5,_e6){return [_e4,dojo._listener.add(dojo._topics,_e4,dojo.hitch(_e5,_e6))];};dojo.unsubscribe=function(_e7){if(_e7){dojo._listener.remove(dojo._topics,_e7[0],_e7[1]);}};dojo.publish=function(_e8,_e9){var f=dojo._topics[_e8];if(f){f.apply(this,_e9||[]);}};dojo.connectPublisher=function(_ea,obj,_eb){var pf=function(){dojo.publish(_ea,arguments);};return (_eb)?dojo.connect(obj,_eb,pf):dojo.connect(obj,pf);};}if(!dojo._hasResource["dojo._base.Deferred"]){dojo._hasResource["dojo._base.Deferred"]=true;dojo.provide("dojo._base.Deferred");dojo.Deferred=function(_ec){this.chain=[];this.id=this._nextId();this.fired=-1;this.paused=0;this.results=[null,null];this.canceller=_ec;this.silentlyCancelled=false;this.isFiring=false;};dojo.extend(dojo.Deferred,{_nextId:(function(){var n=1;return function(){return n++;};})(),cancel:function(){var err;if(this.fired==-1){if(this.canceller){err=this.canceller(this);}else{this.silentlyCancelled=true;}if(this.fired==-1){if(!(err instanceof Error)){var res=err;var msg="Deferred Cancelled";if(err&&err.toString){msg+=": "+err.toString();}err=new Error(msg);err.dojoType="cancel";err.cancelResult=res;}this.errback(err);}}else{if((this.fired==0)&&(this.results[0] instanceof dojo.Deferred)){this.results[0].cancel();}}},_resback:function(res){this.fired=((res instanceof Error)?1:0);this.results[this.fired]=res;this._fire();},_check:function(){if(this.fired!=-1){if(!this.silentlyCancelled){throw new Error("already called!");}this.silentlyCancelled=false;return;}},callback:function(res){this._check();this._resback(res);},errback:function(res){this._check();if(!(res instanceof Error)){res=new Error(res);}this._resback(res);},addBoth:function(cb,_ed){var _ee=dojo.hitch.apply(dojo,arguments);return this.addCallbacks(_ee,_ee);},addCallback:function(cb,_ef){return this.addCallbacks(dojo.hitch.apply(dojo,arguments));},addErrback:function(cb,_f0){return this.addCallbacks(null,dojo.hitch.apply(dojo,arguments));},addCallbacks:function(cb,eb){this.chain.push([cb,eb]);if(this.fired>=0&&!this.isFiring){this._fire();}return this;},_fire:function(){this.isFiring=true;var _f1=this.chain;var _f2=this.fired;var res=this.results[_f2];var _f3=this;var cb=null;while((_f1.length>0)&&(this.paused==0)){var f=_f1.shift()[_f2];if(!f){continue;}var _f4=function(){var ret=f(res);if(typeof ret!="undefined"){res=ret;}_f2=((res instanceof Error)?1:0);if(res instanceof dojo.Deferred){cb=function(res){_f3._resback(res);_f3.paused--;if((_f3.paused==0)&&(_f3.fired>=0)){_f3._fire();}};this.paused++;}};if(dojo.config.debugAtAllCosts){_f4.call(this);}else{try{_f4.call(this);}catch(err){_f2=1;res=err;}}}this.fired=_f2;this.results[_f2]=res;this.isFiring=false;if((cb)&&(this.paused)){res.addBoth(cb);}}});}if(!dojo._hasResource["dojo._base.json"]){dojo._hasResource["dojo._base.json"]=true;dojo.provide("dojo._base.json");dojo.fromJson=function(_f5){return eval("("+_f5+")");};dojo._escapeString=function(str){return ("\""+str.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r");};dojo.toJsonIndentStr="\t";dojo.toJson=function(it,_f6,_f7){if(it===undefined){return "undefined";}var _f8=typeof it;if(_f8=="number"||_f8=="boolean"){return it+"";}if(it===null){return "null";}if(dojo.isString(it)){return dojo._escapeString(it);}var _f9=arguments.callee;var _fa;_f7=_f7||"";var _fb=_f6?_f7+dojo.toJsonIndentStr:"";var tf=it.__json__||it.json;if(dojo.isFunction(tf)){_fa=tf.call(it);if(it!==_fa){return _f9(_fa,_f6,_fb);}}if(it.nodeType&&it.cloneNode){throw new Error("Can't serialize DOM nodes");}var sep=_f6?" ":"";var _fc=_f6?"\n":"";if(dojo.isArray(it)){var res=dojo.map(it,function(obj){var val=_f9(obj,_f6,_fb);if(typeof val!="string"){val="undefined";}return _fc+_fb+val;});return "["+res.join(","+sep)+_fc+_f7+"]";}if(_f8=="function"){return null;}var _fd=[],key;for(key in it){var _fe,val;if(typeof key=="number"){_fe="\""+key+"\"";}else{if(typeof key=="string"){_fe=dojo._escapeString(key);}else{continue;}}val=_f9(it[key],_f6,_fb);if(typeof val!="string"){continue;}_fd.push(_fc+_fb+_fe+":"+sep+val);}return "{"+_fd.join(","+sep)+_fc+_f7+"}";};}if(!dojo._hasResource["dojo._base.Color"]){dojo._hasResource["dojo._base.Color"]=true;dojo.provide("dojo._base.Color");(function(){var d=dojo;dojo.Color=function(_ff){if(_ff){this.setColor(_ff);}};dojo.Color.named={black:[0,0,0],silver:[192,192,192],gray:[128,128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255],transparent:d.config.transparentColor||[255,255,255]};dojo.extend(dojo.Color,{r:255,g:255,b:255,a:1,_set:function(r,g,b,a){var t=this;t.r=r;t.g=g;t.b=b;t.a=a;},setColor:function(_100){if(d.isString(_100)){d.colorFromString(_100,this);}else{if(d.isArray(_100)){d.colorFromArray(_100,this);}else{this._set(_100.r,_100.g,_100.b,_100.a);if(!(_100 instanceof d.Color)){this.sanitize();}}}return this;},sanitize:function(){return this;},toRgb:function(){var t=this;return [t.r,t.g,t.b];},toRgba:function(){var t=this;return [t.r,t.g,t.b,t.a];},toHex:function(){var arr=d.map(["r","g","b"],function(x){var s=this[x].toString(16);return s.length<2?"0"+s:s;},this);return "#"+arr.join("");},toCss:function(_101){var t=this,rgb=t.r+", "+t.g+", "+t.b;return (_101?"rgba("+rgb+", "+t.a:"rgb("+rgb)+")";},toString:function(){return this.toCss(true);}});dojo.blendColors=function(_102,end,_103,obj){var t=obj||new d.Color();d.forEach(["r","g","b","a"],function(x){t[x]=_102[x]+(end[x]-_102[x])*_103;if(x!="a"){t[x]=Math.round(t[x]);}});return t.sanitize();};dojo.colorFromRgb=function(_104,obj){var m=_104.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/);return m&&dojo.colorFromArray(m[1].split(/\s*,\s*/),obj);};dojo.colorFromHex=function(_105,obj){var t=obj||new d.Color(),bits=(_105.length==4)?4:8,mask=(1<<bits)-1;_105=Number("0x"+_105.substr(1));if(isNaN(_105)){return null;}d.forEach(["b","g","r"],function(x){var c=_105&mask;_105>>=bits;t[x]=bits==4?17*c:c;});t.a=1;return t;};dojo.colorFromArray=function(a,obj){var t=obj||new d.Color();t._set(Number(a[0]),Number(a[1]),Number(a[2]),Number(a[3]));if(isNaN(t.a)){t.a=1;}return t.sanitize();};dojo.colorFromString=function(str,obj){var a=d.Color.named[str];return a&&d.colorFromArray(a,obj)||d.colorFromRgb(str,obj)||d.colorFromHex(str,obj);};})();}if(!dojo._hasResource["dojo._base"]){dojo._hasResource["dojo._base"]=true;dojo.provide("dojo._base");}if(!dojo._hasResource["dojo._base.window"]){dojo._hasResource["dojo._base.window"]=true;dojo.provide("dojo._base.window");dojo.doc=window["document"]||null;dojo.body=function(){return dojo.doc.body||dojo.doc.getElementsByTagName("body")[0];};dojo.setContext=function(_106,_107){dojo.global=_106;dojo.doc=_107;};dojo.withGlobal=function(_108,_109,_10a,_10b){var _10c=dojo.global;try{dojo.global=_108;return dojo.withDoc.call(null,_108.document,_109,_10a,_10b);}finally{dojo.global=_10c;}};dojo.withDoc=function(_10d,_10e,_10f,_110){var _111=dojo.doc,_112=dojo._bodyLtr,oldQ=dojo.isQuirks;try{dojo.doc=_10d;delete dojo._bodyLtr;dojo.isQuirks=dojo.doc.compatMode=="BackCompat";if(_10f&&typeof _10e=="string"){_10e=_10f[_10e];}return _10e.apply(_10f,_110||[]);}finally{dojo.doc=_111;delete dojo._bodyLtr;if(_112!==undefined){dojo._bodyLtr=_112;}dojo.isQuirks=oldQ;}};}if(!dojo._hasResource["dojo._base.event"]){dojo._hasResource["dojo._base.event"]=true;dojo.provide("dojo._base.event");(function(){var del=(dojo._event_listener={add:function(node,name,fp){if(!node){return;}name=del._normalizeEventName(name);fp=del._fixCallback(name,fp);var _113=name;if(!dojo.isIE&&(name=="mouseenter"||name=="mouseleave")){var ofp=fp;name=(name=="mouseenter")?"mouseover":"mouseout";fp=function(e){if(!dojo.isDescendant(e.relatedTarget,node)){return ofp.call(this,e);}};}node.addEventListener(name,fp,false);return fp;},remove:function(node,_114,_115){if(node){_114=del._normalizeEventName(_114);if(!dojo.isIE&&(_114=="mouseenter"||_114=="mouseleave")){_114=(_114=="mouseenter")?"mouseover":"mouseout";}node.removeEventListener(_114,_115,false);}},_normalizeEventName:function(name){return name.slice(0,2)=="on"?name.slice(2):name;},_fixCallback:function(name,fp){return name!="keypress"?fp:function(e){return fp.call(this,del._fixEvent(e,this));};},_fixEvent:function(evt,_116){switch(evt.type){case "keypress":del._setKeyChar(evt);break;}return evt;},_setKeyChar:function(evt){evt.keyChar=evt.charCode?String.fromCharCode(evt.charCode):"";evt.charOrCode=evt.keyChar||evt.keyCode;},_punctMap:{106:42,111:47,186:59,187:43,188:44,189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39}});dojo.fixEvent=function(evt,_117){return del._fixEvent(evt,_117);};dojo.stopEvent=function(evt){evt.preventDefault();evt.stopPropagation();};var _118=dojo._listener;dojo._connect=function(obj,_119,_11a,_11b,_11c){var _11d=obj&&(obj.nodeType||obj.attachEvent||obj.addEventListener);var lid=_11d?(_11c?2:1):0,l=[dojo._listener,del,_118][lid];var h=l.add(obj,_119,dojo.hitch(_11a,_11b));return [obj,_119,h,lid];};dojo._disconnect=function(obj,_11e,_11f,_120){([dojo._listener,del,_118][_120]).remove(obj,_11e,_11f);};dojo.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:dojo.isSafari?91:224,PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108,NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,NUM_LOCK:144,SCROLL_LOCK:145,copyKey:dojo.isMac&&!dojo.isAIR?(dojo.isSafari?91:224):17};var _121=dojo.isMac?"metaKey":"ctrlKey";dojo.isCopyKey=function(e){return e[_121];};if(dojo.isIE){dojo.mouseButtons={LEFT:1,MIDDLE:4,RIGHT:2,isButton:function(e,_122){return e.button&_122;},isLeft:function(e){return e.button&1;},isMiddle:function(e){return e.button&4;},isRight:function(e){return e.button&2;}};}else{dojo.mouseButtons={LEFT:0,MIDDLE:1,RIGHT:2,isButton:function(e,_123){return e.button==_123;},isLeft:function(e){return e.button==0;},isMiddle:function(e){return e.button==1;},isRight:function(e){return e.button==2;}};}if(dojo.isIE){var _124=function(e,code){try{return (e.keyCode=code);}catch(e){return 0;}};var iel=dojo._listener;var _125=(dojo._ieListenersName="_"+dojo._scopeName+"_listeners");if(!dojo.config._allow_leaks){_118=iel=dojo._ie_listener={handlers:[],add:function(_126,_127,_128){_126=_126||dojo.global;var f=_126[_127];if(!f||!f[_125]){var d=dojo._getIeDispatcher();d.target=f&&(ieh.push(f)-1);d[_125]=[];f=_126[_127]=d;}return f[_125].push(ieh.push(_128)-1);},remove:function(_129,_12a,_12b){var f=(_129||dojo.global)[_12a],l=f&&f[_125];if(f&&l&&_12b--){delete ieh[l[_12b]];delete l[_12b];}}};var ieh=iel.handlers;}dojo.mixin(del,{add:function(node,_12c,fp){if(!node){return;}_12c=del._normalizeEventName(_12c);if(_12c=="onkeypress"){var kd=node.onkeydown;if(!kd||!kd[_125]||!kd._stealthKeydownHandle){var h=del.add(node,"onkeydown",del._stealthKeyDown);kd=node.onkeydown;kd._stealthKeydownHandle=h;kd._stealthKeydownRefs=1;}else{kd._stealthKeydownRefs++;}}return iel.add(node,_12c,del._fixCallback(fp));},remove:function(node,_12d,_12e){_12d=del._normalizeEventName(_12d);iel.remove(node,_12d,_12e);if(_12d=="onkeypress"){var kd=node.onkeydown;if(--kd._stealthKeydownRefs<=0){iel.remove(node,"onkeydown",kd._stealthKeydownHandle);delete kd._stealthKeydownHandle;}}},_normalizeEventName:function(_12f){return _12f.slice(0,2)!="on"?"on"+_12f:_12f;},_nop:function(){},_fixEvent:function(evt,_130){if(!evt){var w=_130&&(_130.ownerDocument||_130.document||_130).parentWindow||window;evt=w.event;}if(!evt){return (evt);}evt.target=evt.srcElement;evt.currentTarget=(_130||evt.srcElement);evt.layerX=evt.offsetX;evt.layerY=evt.offsetY;var se=evt.srcElement,doc=(se&&se.ownerDocument)||document;var _131=((dojo.isIE<6)||(doc["compatMode"]=="BackCompat"))?doc.body:doc.documentElement;var _132=dojo._getIeDocumentElementOffset();evt.pageX=evt.clientX+dojo._fixIeBiDiScrollLeft(_131.scrollLeft||0)-_132.x;evt.pageY=evt.clientY+(_131.scrollTop||0)-_132.y;if(evt.type=="mouseover"){evt.relatedTarget=evt.fromElement;}if(evt.type=="mouseout"){evt.relatedTarget=evt.toElement;}evt.stopPropagation=del._stopPropagation;evt.preventDefault=del._preventDefault;return del._fixKeys(evt);},_fixKeys:function(evt){switch(evt.type){case "keypress":var c=("charCode" in evt?evt.charCode:evt.keyCode);if(c==10){c=0;evt.keyCode=13;}else{if(c==13||c==27){c=0;}else{if(c==3){c=99;}}}evt.charCode=c;del._setKeyChar(evt);break;}return evt;},_stealthKeyDown:function(evt){var kp=evt.currentTarget.onkeypress;if(!kp||!kp[_125]){return;}var k=evt.keyCode;var _133=k!=13&&k!=32&&k!=27&&(k<48||k>90)&&(k<96||k>111)&&(k<186||k>192)&&(k<219||k>222);if(_133||evt.ctrlKey){var c=_133?0:k;if(evt.ctrlKey){if(k==3||k==13){return;}else{if(c>95&&c<106){c-=48;}else{if((!evt.shiftKey)&&(c>=65&&c<=90)){c+=32;}else{c=del._punctMap[c]||c;}}}}var faux=del._synthesizeEvent(evt,{type:"keypress",faux:true,charCode:c});kp.call(evt.currentTarget,faux);evt.cancelBubble=faux.cancelBubble;evt.returnValue=faux.returnValue;_124(evt,faux.keyCode);}},_stopPropagation:function(){this.cancelBubble=true;},_preventDefault:function(){this.bubbledKeyCode=this.keyCode;if(this.ctrlKey){_124(this,0);}this.returnValue=false;}});dojo.stopEvent=function(evt){evt=evt||window.event;del._stopPropagation.call(evt);del._preventDefault.call(evt);};}del._synthesizeEvent=function(evt,_134){var faux=dojo.mixin({},evt,_134);del._setKeyChar(faux);faux.preventDefault=function(){evt.preventDefault();};faux.stopPropagation=function(){evt.stopPropagation();};return faux;};if(dojo.isOpera){dojo.mixin(del,{_fixEvent:function(evt,_135){switch(evt.type){case "keypress":var c=evt.which;if(c==3){c=99;}c=c<41&&!evt.shiftKey?0:c;if(evt.ctrlKey&&!evt.shiftKey&&c>=65&&c<=90){c+=32;}return del._synthesizeEvent(evt,{charCode:c});}return evt;}});}if(dojo.isWebKit){del._add=del.add;del._remove=del.remove;dojo.mixin(del,{add:function(node,_136,fp){if(!node){return;}var _137=del._add(node,_136,fp);if(del._normalizeEventName(_136)=="keypress"){_137._stealthKeyDownHandle=del._add(node,"keydown",function(evt){var k=evt.keyCode;var _138=k!=13&&k!=32&&(k<48||k>90)&&(k<96||k>111)&&(k<186||k>192)&&(k<219||k>222);if(_138||evt.ctrlKey){var c=_138?0:k;if(evt.ctrlKey){if(k==3||k==13){return;}else{if(c>95&&c<106){c-=48;}else{if(!evt.shiftKey&&c>=65&&c<=90){c+=32;}else{c=del._punctMap[c]||c;}}}}var faux=del._synthesizeEvent(evt,{type:"keypress",faux:true,charCode:c});fp.call(evt.currentTarget,faux);}});}return _137;},remove:function(node,_139,_13a){if(node){if(_13a._stealthKeyDownHandle){del._remove(node,"keydown",_13a._stealthKeyDownHandle);}del._remove(node,_139,_13a);}},_fixEvent:function(evt,_13b){switch(evt.type){case "keypress":if(evt.faux){return evt;}var c=evt.charCode;c=c>=32?c:0;return del._synthesizeEvent(evt,{charCode:c,faux:true});}return evt;}});}})();if(dojo.isIE){dojo._ieDispatcher=function(args,_13c){var ap=Array.prototype,h=dojo._ie_listener.handlers,c=args.callee,ls=c[dojo._ieListenersName],t=h[c.target];var r=t&&t.apply(_13c,args);var lls=[].concat(ls);for(var i in lls){var f=h[lls[i]];if(!(i in ap)&&f){f.apply(_13c,args);}}return r;};dojo._getIeDispatcher=function(){return new Function(dojo._scopeName+"._ieDispatcher(arguments, this)");};dojo._event_listener._fixCallback=function(fp){var f=dojo._event_listener._fixEvent;return function(e){return fp.call(this,f(e,this));};};}}if(!dojo._hasResource["dojo._base.html"]){dojo._hasResource["dojo._base.html"]=true;dojo.provide("dojo._base.html");try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}if(dojo.isIE||dojo.isOpera){dojo.byId=function(id,doc){if(typeof id!="string"){return id;}var _13d=doc||dojo.doc,te=_13d.getElementById(id);if(te&&(te.attributes.id.value==id||te.id==id)){return te;}else{var eles=_13d.all[id];if(!eles||eles.nodeName){eles=[eles];}var i=0;while((te=eles[i++])){if((te.attributes&&te.attributes.id&&te.attributes.id.value==id)||te.id==id){return te;}}}};}else{dojo.byId=function(id,doc){return (typeof id=="string")?(doc||dojo.doc).getElementById(id):id;};}(function(){var d=dojo;var byId=d.byId;var _13e=null,_13f;d.addOnWindowUnload(function(){_13e=null;});dojo._destroyElement=dojo.destroy=function(node){node=byId(node);try{var doc=node.ownerDocument;if(!_13e||_13f!=doc){_13e=doc.createElement("div");_13f=doc;}_13e.appendChild(node.parentNode?node.parentNode.removeChild(node):node);_13e.innerHTML="";}catch(e){}};dojo.isDescendant=function(node,_140){try{node=byId(node);_140=byId(_140);while(node){if(node==_140){return true;}node=node.parentNode;}}catch(e){}return false;};dojo.setSelectable=function(node,_141){node=byId(node);if(d.isMozilla){node.style.MozUserSelect=_141?"":"none";}else{if(d.isKhtml||d.isWebKit){node.style.KhtmlUserSelect=_141?"auto":"none";}else{if(d.isIE){var v=(node.unselectable=_141?"":"on");d.query("*",node).forEach("item.unselectable = '"+v+"'");}}}};var _142=function(node,ref){var _143=ref.parentNode;if(_143){_143.insertBefore(node,ref);}};var _144=function(node,ref){var _145=ref.parentNode;if(_145){if(_145.lastChild==ref){_145.appendChild(node);}else{_145.insertBefore(node,ref.nextSibling);}}};dojo.place=function(node,_146,_147){_146=byId(_146);if(typeof node=="string"){node=node.charAt(0)=="<"?d._toDom(node,_146.ownerDocument):byId(node);}if(typeof _147=="number"){var cn=_146.childNodes;if(!cn.length||cn.length<=_147){_146.appendChild(node);}else{_142(node,cn[_147<0?0:_147]);}}else{switch(_147){case "before":_142(node,_146);break;case "after":_144(node,_146);break;case "replace":_146.parentNode.replaceChild(node,_146);break;case "only":d.empty(_146);_146.appendChild(node);break;case "first":if(_146.firstChild){_142(node,_146.firstChild);break;}default:_146.appendChild(node);}}return node;};dojo.boxModel="content-box";if(d.isIE){d.boxModel=document.compatMode=="BackCompat"?"border-box":"content-box";}var gcs;if(d.isWebKit){gcs=function(node){var s;if(node.nodeType==1){var dv=node.ownerDocument.defaultView;s=dv.getComputedStyle(node,null);if(!s&&node.style){node.style.display="";s=dv.getComputedStyle(node,null);}}return s||{};};}else{if(d.isIE){gcs=function(node){return node.nodeType==1?node.currentStyle:{};};}else{gcs=function(node){return node.nodeType==1?node.ownerDocument.defaultView.getComputedStyle(node,null):{};};}}dojo.getComputedStyle=gcs;if(!d.isIE){d._toPixelValue=function(_148,_149){return parseFloat(_149)||0;};}else{d._toPixelValue=function(_14a,_14b){if(!_14b){return 0;}if(_14b=="medium"){return 4;}if(_14b.slice&&_14b.slice(-2)=="px"){return parseFloat(_14b);}with(_14a){var _14c=style.left;var _14d=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=_14b;_14b=style.pixelLeft;}catch(e){_14b=0;}style.left=_14c;runtimeStyle.left=_14d;}return _14b;};}var px=d._toPixelValue;var astr="DXImageTransform.Microsoft.Alpha";var af=function(n,f){try{return n.filters.item(astr);}catch(e){return f?{}:null;}};dojo._getOpacity=d.isIE?function(node){try{return af(node).Opacity/100;}catch(e){return 1;}}:function(node){return gcs(node).opacity;};dojo._setOpacity=d.isIE?function(node,_14e){var ov=_14e*100;node.style.zoom=1;af(node,1).Enabled=!(_14e==1);if(!af(node)){node.style.filter+=" progid:"+astr+"(Opacity="+ov+")";}else{af(node,1).Opacity=ov;}if(node.nodeName.toLowerCase()=="tr"){d.query("> td",node).forEach(function(i){d._setOpacity(i,_14e);});}return _14e;}:function(node,_14f){return node.style.opacity=_14f;};var _150={left:true,top:true};var _151=/margin|padding|width|height|max|min|offset/;var _152=function(node,type,_153){type=type.toLowerCase();if(d.isIE){if(_153=="auto"){if(type=="height"){return node.offsetHeight;}if(type=="width"){return node.offsetWidth;}}if(type=="fontweight"){switch(_153){case 700:return "bold";case 400:default:return "normal";}}}if(!(type in _150)){_150[type]=_151.test(type);}return _150[type]?px(node,_153):_153;};var _154=d.isIE?"styleFloat":"cssFloat",_155={"cssFloat":_154,"styleFloat":_154,"float":_154};dojo.style=function(node,_156,_157){var n=byId(node),args=arguments.length,op=(_156=="opacity");_156=_155[_156]||_156;if(args==3){return op?d._setOpacity(n,_157):n.style[_156]=_157;}if(args==2&&op){return d._getOpacity(n);}var s=gcs(n);if(args==2&&typeof _156!="string"){for(var x in _156){d.style(node,x,_156[x]);}return s;}return (args==1)?s:_152(n,_156,s[_156]||n.style[_156]);};dojo._getPadExtents=function(n,_158){var s=_158||gcs(n),l=px(n,s.paddingLeft),t=px(n,s.paddingTop);return {l:l,t:t,w:l+px(n,s.paddingRight),h:t+px(n,s.paddingBottom)};};dojo._getBorderExtents=function(n,_159){var ne="none",s=_159||gcs(n),bl=(s.borderLeftStyle!=ne?px(n,s.borderLeftWidth):0),bt=(s.borderTopStyle!=ne?px(n,s.borderTopWidth):0);return {l:bl,t:bt,w:bl+(s.borderRightStyle!=ne?px(n,s.borderRightWidth):0),h:bt+(s.borderBottomStyle!=ne?px(n,s.borderBottomWidth):0)};};dojo._getPadBorderExtents=function(n,_15a){var s=_15a||gcs(n),p=d._getPadExtents(n,s),b=d._getBorderExtents(n,s);return {l:p.l+b.l,t:p.t+b.t,w:p.w+b.w,h:p.h+b.h};};dojo._getMarginExtents=function(n,_15b){var s=_15b||gcs(n),l=px(n,s.marginLeft),t=px(n,s.marginTop),r=px(n,s.marginRight),b=px(n,s.marginBottom);if(d.isWebKit&&(s.position!="absolute")){r=l;}return {l:l,t:t,w:l+r,h:t+b};};dojo._getMarginBox=function(node,_15c){var s=_15c||gcs(node),me=d._getMarginExtents(node,s);var l=node.offsetLeft-me.l,t=node.offsetTop-me.t,p=node.parentNode;if(d.isMoz){var sl=parseFloat(s.left),st=parseFloat(s.top);if(!isNaN(sl)&&!isNaN(st)){l=sl,t=st;}else{if(p&&p.style){var pcs=gcs(p);if(pcs.overflow!="visible"){var be=d._getBorderExtents(p,pcs);l+=be.l,t+=be.t;}}}}else{if(d.isOpera||(d.isIE>7&&!d.isQuirks)){if(p){be=d._getBorderExtents(p);l-=be.l;t-=be.t;}}}return {l:l,t:t,w:node.offsetWidth+me.w,h:node.offsetHeight+me.h};};dojo._getContentBox=function(node,_15d){var s=_15d||gcs(node),pe=d._getPadExtents(node,s),be=d._getBorderExtents(node,s),w=node.clientWidth,h;if(!w){w=node.offsetWidth,h=node.offsetHeight;}else{h=node.clientHeight,be.w=be.h=0;}if(d.isOpera){pe.l+=be.l;pe.t+=be.t;}return {l:pe.l,t:pe.t,w:w-pe.w-be.w,h:h-pe.h-be.h};};dojo._getBorderBox=function(node,_15e){var s=_15e||gcs(node),pe=d._getPadExtents(node,s),cb=d._getContentBox(node,s);return {l:cb.l-pe.l,t:cb.t-pe.t,w:cb.w+pe.w,h:cb.h+pe.h};};dojo._setBox=function(node,l,t,w,h,u){u=u||"px";var s=node.style;if(!isNaN(l)){s.left=l+u;}if(!isNaN(t)){s.top=t+u;}if(w>=0){s.width=w+u;}if(h>=0){s.height=h+u;}};dojo._isButtonTag=function(node){return node.tagName=="BUTTON"||node.tagName=="INPUT"&&(node.getAttribute("type")||"").toUpperCase()=="BUTTON";};dojo._usesBorderBox=function(node){var n=node.tagName;return d.boxModel=="border-box"||n=="TABLE"||d._isButtonTag(node);};dojo._setContentSize=function(node,_15f,_160,_161){if(d._usesBorderBox(node)){var pb=d._getPadBorderExtents(node,_161);if(_15f>=0){_15f+=pb.w;}if(_160>=0){_160+=pb.h;}}d._setBox(node,NaN,NaN,_15f,_160);};dojo._setMarginBox=function(node,_162,_163,_164,_165,_166){var s=_166||gcs(node),bb=d._usesBorderBox(node),pb=bb?_167:d._getPadBorderExtents(node,s);if(d.isWebKit){if(d._isButtonTag(node)){var ns=node.style;if(_164>=0&&!ns.width){ns.width="4px";}if(_165>=0&&!ns.height){ns.height="4px";}}}var mb=d._getMarginExtents(node,s);if(_164>=0){_164=Math.max(_164-pb.w-mb.w,0);}if(_165>=0){_165=Math.max(_165-pb.h-mb.h,0);}d._setBox(node,_162,_163,_164,_165);};var _167={l:0,t:0,w:0,h:0};dojo.marginBox=function(node,box){var n=byId(node),s=gcs(n),b=box;return !b?d._getMarginBox(n,s):d._setMarginBox(n,b.l,b.t,b.w,b.h,s);};dojo.contentBox=function(node,box){var n=byId(node),s=gcs(n),b=box;return !b?d._getContentBox(n,s):d._setContentSize(n,b.w,b.h,s);};var _168=function(node,prop){if(!(node=(node||0).parentNode)){return 0;}var val,_169=0,_16a=d.body();while(node&&node.style){if(gcs(node).position=="fixed"){return 0;}val=node[prop];if(val){_169+=val-0;if(node==_16a){break;}}node=node.parentNode;}return _169;};dojo._docScroll=function(){var n=d.global;return "pageXOffset" in n?{x:n.pageXOffset,y:n.pageYOffset}:(n=d.doc.documentElement,n.clientHeight?{x:d._fixIeBiDiScrollLeft(n.scrollLeft),y:n.scrollTop}:(n=d.body(),{x:n.scrollLeft||0,y:n.scrollTop||0}));};dojo._isBodyLtr=function(){return "_bodyLtr" in d?d._bodyLtr:d._bodyLtr=(d.body().dir||d.doc.documentElement.dir||"ltr").toLowerCase()=="ltr";};dojo._getIeDocumentElementOffset=function(){var de=d.doc.documentElement;if(d.isIE<8){var r=de.getBoundingClientRect();var l=r.left,t=r.top;if(d.isIE<7){l+=de.clientLeft;t+=de.clientTop;}return {x:l<0?0:l,y:t<0?0:t};}else{return {x:0,y:0};}};dojo._fixIeBiDiScrollLeft=function(_16b){var dd=d.doc;if(d.isIE<8&&!d._isBodyLtr()){var de=d.isQuirks?dd.body:dd.documentElement;return _16b+de.clientWidth-de.scrollWidth;}return _16b;};dojo._abs=dojo.position=function(node,_16c){var db=d.body(),dh=db.parentNode,ret;node=byId(node);if(node["getBoundingClientRect"]){ret=node.getBoundingClientRect();ret={x:ret.left,y:ret.top,w:ret.right-ret.left,h:ret.bottom-ret.top};if(d.isIE){var _16d=d._getIeDocumentElementOffset();ret.x-=_16d.x+(d.isQuirks?db.clientLeft+db.offsetLeft:0);ret.y-=_16d.y+(d.isQuirks?db.clientTop+db.offsetTop:0);}else{if(d.isFF==3){var cs=gcs(dh);ret.x-=px(dh,cs.marginLeft)+px(dh,cs.borderLeftWidth);ret.y-=px(dh,cs.marginTop)+px(dh,cs.borderTopWidth);}}}else{ret={x:0,y:0,w:node.offsetWidth,h:node.offsetHeight};if(node["offsetParent"]){ret.x-=_168(node,"scrollLeft");ret.y-=_168(node,"scrollTop");var _16e=node;do{var n=_16e.offsetLeft,t=_16e.offsetTop;ret.x+=isNaN(n)?0:n;ret.y+=isNaN(t)?0:t;cs=gcs(_16e);if(_16e!=node){if(d.isMoz){ret.x+=2*px(_16e,cs.borderLeftWidth);ret.y+=2*px(_16e,cs.borderTopWidth);}else{ret.x+=px(_16e,cs.borderLeftWidth);ret.y+=px(_16e,cs.borderTopWidth);}}if(d.isMoz&&cs.position=="static"){var _16f=_16e.parentNode;while(_16f!=_16e.offsetParent){var pcs=gcs(_16f);if(pcs.position=="static"){ret.x+=px(_16e,pcs.borderLeftWidth);ret.y+=px(_16e,pcs.borderTopWidth);}_16f=_16f.parentNode;}}_16e=_16e.offsetParent;}while((_16e!=dh)&&_16e);}else{if(node.x&&node.y){ret.x+=isNaN(node.x)?0:node.x;ret.y+=isNaN(node.y)?0:node.y;}}}if(_16c){var _170=d._docScroll();ret.x+=_170.x;ret.y+=_170.y;}return ret;};dojo.coords=function(node,_171){var n=byId(node),s=gcs(n),mb=d._getMarginBox(n,s);var abs=d.position(n,_171);mb.x=abs.x;mb.y=abs.y;return mb;};var _172={"class":"className","for":"htmlFor",tabindex:"tabIndex",readonly:"readOnly",colspan:"colSpan",frameborder:"frameBorder",rowspan:"rowSpan",valuetype:"valueType"},_173={classname:"class",htmlfor:"for",tabindex:"tabIndex",readonly:"readOnly"},_174={innerHTML:1,className:1,htmlFor:d.isIE,value:1};var _175=function(name){return _173[name.toLowerCase()]||name;};var _176=function(node,name){var attr=node.getAttributeNode&&node.getAttributeNode(name);return attr&&attr.specified;};dojo.hasAttr=function(node,name){var lc=name.toLowerCase();return _174[_172[lc]||name]||_176(byId(node),_173[lc]||name);};var _177={},_178=0,_179=dojo._scopeName+"attrid",_17a={col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1};dojo.attr=function(node,name,_17b){node=byId(node);var args=arguments.length,prop;if(args==2&&typeof name!="string"){for(var x in name){d.attr(node,x,name[x]);}return node;}var lc=name.toLowerCase(),_17c=_172[lc]||name,_17d=_174[_17c],_17e=_173[lc]||name;if(args==3){do{if(_17c=="style"&&typeof _17b!="string"){d.style(node,_17b);break;}if(_17c=="innerHTML"){if(d.isIE&&node.tagName.toLowerCase() in _17a){d.empty(node);node.appendChild(d._toDom(_17b,node.ownerDocument));}else{node[_17c]=_17b;}break;}if(d.isFunction(_17b)){var _17f=d.attr(node,_179);if(!_17f){_17f=_178++;d.attr(node,_179,_17f);}if(!_177[_17f]){_177[_17f]={};}var h=_177[_17f][_17c];if(h){d.disconnect(h);}else{try{delete node[_17c];}catch(e){}}_177[_17f][_17c]=d.connect(node,_17c,_17b);break;}if(_17d||typeof _17b=="boolean"){node[_17c]=_17b;break;}node.setAttribute(_17e,_17b);}while(false);return node;}_17b=node[_17c];if(_17d&&typeof _17b!="undefined"){return _17b;}if(_17c!="href"&&(typeof _17b=="boolean"||d.isFunction(_17b))){return _17b;}return _176(node,_17e)?node.getAttribute(_17e):null;};dojo.removeAttr=function(node,name){byId(node).removeAttribute(_175(name));};dojo.getNodeProp=function(node,name){node=byId(node);var lc=name.toLowerCase(),_180=_172[lc]||name;if((_180 in node)&&_180!="href"){return node[_180];}var _181=_173[lc]||name;return _176(node,_181)?node.getAttribute(_181):null;};dojo.create=function(tag,_182,_183,pos){var doc=d.doc;if(_183){_183=byId(_183);doc=_183.ownerDocument;}if(typeof tag=="string"){tag=doc.createElement(tag);}if(_182){d.attr(tag,_182);}if(_183){d.place(tag,_183,pos);}return tag;};d.empty=d.isIE?function(node){node=byId(node);for(var c;c=node.lastChild;){d.destroy(c);}}:function(node){byId(node).innerHTML="";};var _184={option:["select"],tbody:["table"],thead:["table"],tfoot:["table"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","thead","tr"],legend:["fieldset"],caption:["table"],colgroup:["table"],col:["table","colgroup"],li:["ul"]},_185=/<\s*([\w\:]+)/,_186={},_187=0,_188="__"+d._scopeName+"ToDomId";for(var _189 in _184){var tw=_184[_189];tw.pre=_189=="option"?"<select multiple=\"multiple\">":"<"+tw.join("><")+">";tw.post="</"+tw.reverse().join("></")+">";}d._toDom=function(frag,doc){doc=doc||d.doc;var _18a=doc[_188];if(!_18a){doc[_188]=_18a=++_187+"";_186[_18a]=doc.createElement("div");}frag+="";var _18b=frag.match(_185),tag=_18b?_18b[1].toLowerCase():"",_18c=_186[_18a],wrap,i,fc,df;if(_18b&&_184[tag]){wrap=_184[tag];_18c.innerHTML=wrap.pre+frag+wrap.post;for(i=wrap.length;i;--i){_18c=_18c.firstChild;}}else{_18c.innerHTML=frag;}if(_18c.childNodes.length==1){return _18c.removeChild(_18c.firstChild);}df=doc.createDocumentFragment();while(fc=_18c.firstChild){df.appendChild(fc);}return df;};var _18d="className";dojo.hasClass=function(node,_18e){return ((" "+byId(node)[_18d]+" ").indexOf(" "+_18e+" ")>=0);};var _18f=/\s+/,a1=[""],_190=function(s){if(typeof s=="string"||s instanceof String){if(s.indexOf(" ")<0){a1[0]=s;return a1;}else{return s.split(_18f);}}return s;};dojo.addClass=function(node,_191){node=byId(node);_191=_190(_191);var cls=" "+node[_18d]+" ";for(var i=0,len=_191.length,c;i<len;++i){c=_191[i];if(c&&cls.indexOf(" "+c+" ")<0){cls+=c+" ";}}node[_18d]=d.trim(cls);};dojo.removeClass=function(node,_192){node=byId(node);var cls;if(_192!==undefined){_192=_190(_192);cls=" "+node[_18d]+" ";for(var i=0,len=_192.length;i<len;++i){cls=cls.replace(" "+_192[i]+" "," ");}cls=d.trim(cls);}else{cls="";}if(node[_18d]!=cls){node[_18d]=cls;}};dojo.toggleClass=function(node,_193,_194){if(_194===undefined){_194=!d.hasClass(node,_193);}d[_194?"addClass":"removeClass"](node,_193);};})();}if(!dojo._hasResource["dojo._base.NodeList"]){dojo._hasResource["dojo._base.NodeList"]=true;dojo.provide("dojo._base.NodeList");(function(){var d=dojo;var ap=Array.prototype,aps=ap.slice,apc=ap.concat;var tnl=function(a,_195,_196){if(!a.sort){a=aps.call(a,0);}var ctor=_196||this._NodeListCtor||d._NodeListCtor;a.constructor=ctor;dojo._mixin(a,ctor.prototype);a._NodeListCtor=ctor;return _195?a._stash(_195):a;};var _197=function(f,a,o){a=[0].concat(aps.call(a,0));o=o||d.global;return function(node){a[0]=node;return f.apply(o,a);};};var _198=function(f,o){return function(){this.forEach(_197(f,arguments,o));return this;};};var _199=function(f,o){return function(){return this.map(_197(f,arguments,o));};};var _19a=function(f,o){return function(){return this.filter(_197(f,arguments,o));};};var _19b=function(f,g,o){return function(){var a=arguments,body=_197(f,a,o);if(g.call(o||d.global,a)){return this.map(body);}this.forEach(body);return this;};};var _19c=function(a){return a.length==1&&(typeof a[0]=="string");};var _19d=function(node){var p=node.parentNode;if(p){p.removeChild(node);}};dojo.NodeList=function(){return tnl(Array.apply(null,arguments));};d._NodeListCtor=d.NodeList;var nl=d.NodeList,nlp=nl.prototype;nl._wrap=nlp._wrap=tnl;nl._adaptAsMap=_199;nl._adaptAsForEach=_198;nl._adaptAsFilter=_19a;nl._adaptWithCondition=_19b;d.forEach(["slice","splice"],function(name){var f=ap[name];nlp[name]=function(){return this._wrap(f.apply(this,arguments),name=="slice"?this:null);};});d.forEach(["indexOf","lastIndexOf","every","some"],function(name){var f=d[name];nlp[name]=function(){return f.apply(d,[this].concat(aps.call(arguments,0)));};});d.forEach(["attr","style"],function(name){nlp[name]=_19b(d[name],_19c);});d.forEach(["connect","addClass","removeClass","toggleClass","empty","removeAttr"],function(name){nlp[name]=_198(d[name]);});dojo.extend(dojo.NodeList,{_normalize:function(_19e,_19f){var _1a0=_19e.parse===true?true:false;if(typeof _19e.template=="string"){var _1a1=_19e.templateFunc||(dojo.string&&dojo.string.substitute);_19e=_1a1?_1a1(_19e.template,_19e):_19e;}var type=(typeof _19e);if(type=="string"||type=="number"){_19e=dojo._toDom(_19e,(_19f&&_19f.ownerDocument));if(_19e.nodeType==11){_19e=dojo._toArray(_19e.childNodes);}else{_19e=[_19e];}}else{if(!dojo.isArrayLike(_19e)){_19e=[_19e];}else{if(!dojo.isArray(_19e)){_19e=dojo._toArray(_19e);}}}if(_1a0){_19e._runParse=true;}return _19e;},_cloneNode:function(node){return node.cloneNode(true);},_place:function(ary,_1a2,_1a3,_1a4){if(_1a2.nodeType!=1&&_1a3=="only"){return;}var _1a5=_1a2,_1a6;var _1a7=ary.length;for(var i=_1a7-1;i>=0;i--){var node=(_1a4?this._cloneNode(ary[i]):ary[i]);if(ary._runParse&&dojo.parser&&dojo.parser.parse){if(!_1a6){_1a6=_1a5.ownerDocument.createElement("div");}_1a6.appendChild(node);dojo.parser.parse(_1a6);node=_1a6.firstChild;while(_1a6.firstChild){_1a6.removeChild(_1a6.firstChild);}}if(i==_1a7-1){dojo.place(node,_1a5,_1a3);}else{_1a5.parentNode.insertBefore(node,_1a5);}_1a5=node;}},_stash:function(_1a8){this._parent=_1a8;return this;},end:function(){if(this._parent){return this._parent;}else{return new this._NodeListCtor();}},concat:function(item){var t=d.isArray(this)?this:aps.call(this,0),m=d.map(arguments,function(a){return a&&!d.isArray(a)&&(typeof NodeList!="undefined"&&a.constructor===NodeList||a.constructor===this._NodeListCtor)?aps.call(a,0):a;});return this._wrap(apc.apply(t,m),this);},map:function(func,obj){return this._wrap(d.map(this,func,obj),this);},forEach:function(_1a9,_1aa){d.forEach(this,_1a9,_1aa);return this;},coords:_199(d.coords),position:_199(d.position),place:function(_1ab,_1ac){var item=d.query(_1ab)[0];return this.forEach(function(node){d.place(node,item,_1ac);});},orphan:function(_1ad){return (_1ad?d._filterQueryResult(this,_1ad):this).forEach(_19d);},adopt:function(_1ae,_1af){return d.query(_1ae).place(this[0],_1af)._stash(this);},query:function(_1b0){if(!_1b0){return this;}var ret=this.map(function(node){return d.query(_1b0,node).filter(function(_1b1){return _1b1!==undefined;});});return this._wrap(apc.apply([],ret),this);},filter:function(_1b2){var a=arguments,_1b3=this,_1b4=0;if(typeof _1b2=="string"){_1b3=d._filterQueryResult(this,a[0]);if(a.length==1){return _1b3._stash(this);}_1b4=1;}return this._wrap(d.filter(_1b3,a[_1b4],a[_1b4+1]),this);},addContent:function(_1b5,_1b6){_1b5=this._normalize(_1b5,this[0]);for(var i=0,node;node=this[i];i++){this._place(_1b5,node,_1b6,i>0);}return this;},instantiate:function(_1b7,_1b8){var c=d.isFunction(_1b7)?_1b7:d.getObject(_1b7);_1b8=_1b8||{};return this.forEach(function(node){new c(_1b8,node);});},at:function(){var t=new this._NodeListCtor();d.forEach(arguments,function(i){if(this[i]){t.push(this[i]);}},this);return t._stash(this);}});nl.events=["blur","focus","change","click","error","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","submit"];d.forEach(nl.events,function(evt){var _1b9="on"+evt;nlp[_1b9]=function(a,b){return this.connect(_1b9,a,b);};});})();}if(!dojo._hasResource["dojo._base.query"]){dojo._hasResource["dojo._base.query"]=true;if(typeof dojo!="undefined"){dojo.provide("dojo._base.query");}(function(d){var trim=d.trim;var each=d.forEach;var qlc=d._NodeListCtor=d.NodeList;var _1ba=function(){return d.doc;};var _1bb=((d.isWebKit||d.isMozilla)&&((_1ba().compatMode)=="BackCompat"));var _1bc=!!_1ba().firstChild["children"]?"children":"childNodes";var _1bd=">~+";var _1be=false;var _1bf=function(){return true;};var _1c0=function(_1c1){if(_1bd.indexOf(_1c1.slice(-1))>=0){_1c1+=" * ";}else{_1c1+=" ";}var ts=function(s,e){return trim(_1c1.slice(s,e));};var _1c2=[];var _1c3=-1,_1c4=-1,_1c5=-1,_1c6=-1,_1c7=-1,inId=-1,_1c8=-1,lc="",cc="",_1c9;var x=0,ql=_1c1.length,_1ca=null,_1cb=null;var _1cc=function(){if(_1c8>=0){var tv=(_1c8==x)?null:ts(_1c8,x);_1ca[(_1bd.indexOf(tv)<0)?"tag":"oper"]=tv;_1c8=-1;}};var _1cd=function(){if(inId>=0){_1ca.id=ts(inId,x).replace(/\\/g,"");inId=-1;}};var _1ce=function(){if(_1c7>=0){_1ca.classes.push(ts(_1c7+1,x).replace(/\\/g,""));_1c7=-1;}};var _1cf=function(){_1cd();_1cc();_1ce();};var _1d0=function(){_1cf();if(_1c6>=0){_1ca.pseudos.push({name:ts(_1c6+1,x)});}_1ca.loops=(_1ca.pseudos.length||_1ca.attrs.length||_1ca.classes.length);_1ca.oquery=_1ca.query=ts(_1c9,x);_1ca.otag=_1ca.tag=(_1ca["oper"])?null:(_1ca.tag||"*");if(_1ca.tag){_1ca.tag=_1ca.tag.toUpperCase();}if(_1c2.length&&(_1c2[_1c2.length-1].oper)){_1ca.infixOper=_1c2.pop();_1ca.query=_1ca.infixOper.query+" "+_1ca.query;}_1c2.push(_1ca);_1ca=null;};for(;lc=cc,cc=_1c1.charAt(x),x<ql;x++){if(lc=="\\"){continue;}if(!_1ca){_1c9=x;_1ca={query:null,pseudos:[],attrs:[],classes:[],tag:null,oper:null,id:null,getTag:function(){return (_1be)?this.otag:this.tag;}};_1c8=x;}if(_1c3>=0){if(cc=="]"){if(!_1cb.attr){_1cb.attr=ts(_1c3+1,x);}else{_1cb.matchFor=ts((_1c5||_1c3+1),x);}var cmf=_1cb.matchFor;if(cmf){if((cmf.charAt(0)=="\"")||(cmf.charAt(0)=="'")){_1cb.matchFor=cmf.slice(1,-1);}}_1ca.attrs.push(_1cb);_1cb=null;_1c3=_1c5=-1;}else{if(cc=="="){var _1d1=("|~^$*".indexOf(lc)>=0)?lc:"";_1cb.type=_1d1+cc;_1cb.attr=ts(_1c3+1,x-_1d1.length);_1c5=x+1;}}}else{if(_1c4>=0){if(cc==")"){if(_1c6>=0){_1cb.value=ts(_1c4+1,x);}_1c6=_1c4=-1;}}else{if(cc=="#"){_1cf();inId=x+1;}else{if(cc=="."){_1cf();_1c7=x;}else{if(cc==":"){_1cf();_1c6=x;}else{if(cc=="["){_1cf();_1c3=x;_1cb={};}else{if(cc=="("){if(_1c6>=0){_1cb={name:ts(_1c6+1,x),value:null};_1ca.pseudos.push(_1cb);}_1c4=x;}else{if((cc==" ")&&(lc!=cc)){_1d0();}}}}}}}}}return _1c2;};var _1d2=function(_1d3,_1d4){if(!_1d3){return _1d4;}if(!_1d4){return _1d3;}return function(){return _1d3.apply(window,arguments)&&_1d4.apply(window,arguments);};};var _1d5=function(i,arr){var r=arr||[];if(i){r.push(i);}return r;};var _1d6=function(n){return (1==n.nodeType);};var _1d7="";var _1d8=function(elem,attr){if(!elem){return _1d7;}if(attr=="class"){return elem.className||_1d7;}if(attr=="for"){return elem.htmlFor||_1d7;}if(attr=="style"){return elem.style.cssText||_1d7;}return (_1be?elem.getAttribute(attr):elem.getAttribute(attr,2))||_1d7;};var _1d9={"*=":function(attr,_1da){return function(elem){return (_1d8(elem,attr).indexOf(_1da)>=0);};},"^=":function(attr,_1db){return function(elem){return (_1d8(elem,attr).indexOf(_1db)==0);};},"$=":function(attr,_1dc){var tval=" "+_1dc;return function(elem){var ea=" "+_1d8(elem,attr);return (ea.lastIndexOf(_1dc)==(ea.length-_1dc.length));};},"~=":function(attr,_1dd){var tval=" "+_1dd+" ";return function(elem){var ea=" "+_1d8(elem,attr)+" ";return (ea.indexOf(tval)>=0);};},"|=":function(attr,_1de){var _1df=" "+_1de+"-";return function(elem){var ea=" "+_1d8(elem,attr);return ((ea==_1de)||(ea.indexOf(_1df)==0));};},"=":function(attr,_1e0){return function(elem){return (_1d8(elem,attr)==_1e0);};}};var _1e1=(typeof _1ba().firstChild.nextElementSibling=="undefined");var _1e2=!_1e1?"nextElementSibling":"nextSibling";var _1e3=!_1e1?"previousElementSibling":"previousSibling";var _1e4=(_1e1?_1d6:_1bf);var _1e5=function(node){while(node=node[_1e3]){if(_1e4(node)){return false;}}return true;};var _1e6=function(node){while(node=node[_1e2]){if(_1e4(node)){return false;}}return true;};var _1e7=function(node){var root=node.parentNode;var i=0,tret=root[_1bc],ci=(node["_i"]||-1),cl=(root["_l"]||-1);if(!tret){return -1;}var l=tret.length;if(cl==l&&ci>=0&&cl>=0){return ci;}root["_l"]=l;ci=-1;for(var te=root["firstElementChild"]||root["firstChild"];te;te=te[_1e2]){if(_1e4(te)){te["_i"]=++i;if(node===te){ci=i;}}}return ci;};var _1e8=function(elem){return !((_1e7(elem))%2);};var _1e9=function(elem){return ((_1e7(elem))%2);};var _1ea={"checked":function(name,_1eb){return function(elem){return !!("checked" in elem?elem.checked:elem.selected);};},"first-child":function(){return _1e5;},"last-child":function(){return _1e6;},"only-child":function(name,_1ec){return function(node){if(!_1e5(node)){return false;}if(!_1e6(node)){return false;}return true;};},"empty":function(name,_1ed){return function(elem){var cn=elem.childNodes;var cnl=elem.childNodes.length;for(var x=cnl-1;x>=0;x--){var nt=cn[x].nodeType;if((nt===1)||(nt==3)){return false;}}return true;};},"contains":function(name,_1ee){var cz=_1ee.charAt(0);if(cz=="\""||cz=="'"){_1ee=_1ee.slice(1,-1);}return function(elem){return (elem.innerHTML.indexOf(_1ee)>=0);};},"not":function(name,_1ef){var p=_1c0(_1ef)[0];var _1f0={el:1};if(p.tag!="*"){_1f0.tag=1;}if(!p.classes.length){_1f0.classes=1;}var ntf=_1f1(p,_1f0);return function(elem){return (!ntf(elem));};},"nth-child":function(name,_1f2){var pi=parseInt;if(_1f2=="odd"){return _1e9;}else{if(_1f2=="even"){return _1e8;}}if(_1f2.indexOf("n")!=-1){var _1f3=_1f2.split("n",2);var pred=_1f3[0]?((_1f3[0]=="-")?-1:pi(_1f3[0])):1;var idx=_1f3[1]?pi(_1f3[1]):0;var lb=0,ub=-1;if(pred>0){if(idx<0){idx=(idx%pred)&&(pred+(idx%pred));}else{if(idx>0){if(idx>=pred){lb=idx-idx%pred;}idx=idx%pred;}}}else{if(pred<0){pred*=-1;if(idx>0){ub=idx;idx=idx%pred;}}}if(pred>0){return function(elem){var i=_1e7(elem);return (i>=lb)&&(ub<0||i<=ub)&&((i%pred)==idx);};}else{_1f2=idx;}}var _1f4=pi(_1f2);return function(elem){return (_1e7(elem)==_1f4);};}};var _1f5=(d.isIE)?function(cond){var clc=cond.toLowerCase();if(clc=="class"){cond="className";}return function(elem){return (_1be?elem.getAttribute(cond):elem[cond]||elem[clc]);};}:function(cond){return function(elem){return (elem&&elem.getAttribute&&elem.hasAttribute(cond));};};var _1f1=function(_1f6,_1f7){if(!_1f6){return _1bf;}_1f7=_1f7||{};var ff=null;if(!("el" in _1f7)){ff=_1d2(ff,_1d6);}if(!("tag" in _1f7)){if(_1f6.tag!="*"){ff=_1d2(ff,function(elem){return (elem&&(elem.tagName==_1f6.getTag()));});}}if(!("classes" in _1f7)){each(_1f6.classes,function(_1f8,idx,arr){var re=new RegExp("(?:^|\\s)"+_1f8+"(?:\\s|$)");ff=_1d2(ff,function(elem){return re.test(elem.className);});ff.count=idx;});}if(!("pseudos" in _1f7)){each(_1f6.pseudos,function(_1f9){var pn=_1f9.name;if(_1ea[pn]){ff=_1d2(ff,_1ea[pn](pn,_1f9.value));}});}if(!("attrs" in _1f7)){each(_1f6.attrs,function(attr){var _1fa;var a=attr.attr;if(attr.type&&_1d9[attr.type]){_1fa=_1d9[attr.type](a,attr.matchFor);}else{if(a.length){_1fa=_1f5(a);}}if(_1fa){ff=_1d2(ff,_1fa);}});}if(!("id" in _1f7)){if(_1f6.id){ff=_1d2(ff,function(elem){return (!!elem&&(elem.id==_1f6.id));});}}if(!ff){if(!("default" in _1f7)){ff=_1bf;}}return ff;};var _1fb=function(_1fc){return function(node,ret,bag){while(node=node[_1e2]){if(_1e1&&(!_1d6(node))){continue;}if((!bag||_1fd(node,bag))&&_1fc(node)){ret.push(node);}break;}return ret;};};var _1fe=function(_1ff){return function(root,ret,bag){var te=root[_1e2];while(te){if(_1e4(te)){if(bag&&!_1fd(te,bag)){break;}if(_1ff(te)){ret.push(te);}}te=te[_1e2];}return ret;};};var _200=function(_201){_201=_201||_1bf;return function(root,ret,bag){var te,x=0,tret=root[_1bc];while(te=tret[x++]){if(_1e4(te)&&(!bag||_1fd(te,bag))&&(_201(te,x))){ret.push(te);}}return ret;};};var _202=function(node,root){var pn=node.parentNode;while(pn){if(pn==root){break;}pn=pn.parentNode;}return !!pn;};var _203={};var _204=function(_205){var _206=_203[_205.query];if(_206){return _206;}var io=_205.infixOper;var oper=(io?io.oper:"");var _207=_1f1(_205,{el:1});var qt=_205.tag;var _208=("*"==qt);var ecs=_1ba()["getElementsByClassName"];if(!oper){if(_205.id){_207=(!_205.loops&&_208)?_1bf:_1f1(_205,{el:1,id:1});_206=function(root,arr){var te=d.byId(_205.id,(root.ownerDocument||root));if(!te||!_207(te)){return;}if(9==root.nodeType){return _1d5(te,arr);}else{if(_202(te,root)){return _1d5(te,arr);}}};}else{if(ecs&&/\{\s*\[native code\]\s*\}/.test(String(ecs))&&_205.classes.length&&!_1bb){_207=_1f1(_205,{el:1,classes:1,id:1});var _209=_205.classes.join(" ");_206=function(root,arr,bag){var ret=_1d5(0,arr),te,x=0;var tret=root.getElementsByClassName(_209);while((te=tret[x++])){if(_207(te,root)&&_1fd(te,bag)){ret.push(te);}}return ret;};}else{if(!_208&&!_205.loops){_206=function(root,arr,bag){var ret=_1d5(0,arr),te,x=0;var tret=root.getElementsByTagName(_205.getTag());while((te=tret[x++])){if(_1fd(te,bag)){ret.push(te);}}return ret;};}else{_207=_1f1(_205,{el:1,tag:1,id:1});_206=function(root,arr,bag){var ret=_1d5(0,arr),te,x=0;var tret=root.getElementsByTagName(_205.getTag());while((te=tret[x++])){if(_207(te,root)&&_1fd(te,bag)){ret.push(te);}}return ret;};}}}}else{var _20a={el:1};if(_208){_20a.tag=1;}_207=_1f1(_205,_20a);if("+"==oper){_206=_1fb(_207);}else{if("~"==oper){_206=_1fe(_207);}else{if(">"==oper){_206=_200(_207);}}}}return _203[_205.query]=_206;};var _20b=function(root,_20c){var _20d=_1d5(root),qp,x,te,qpl=_20c.length,bag,ret;for(var i=0;i<qpl;i++){ret=[];qp=_20c[i];x=_20d.length-1;if(x>0){bag={};ret.nozip=true;}var gef=_204(qp);for(var j=0;(te=_20d[j]);j++){gef(te,ret,bag);}if(!ret.length){break;}_20d=ret;}return ret;};var _20e={},_20f={};var _210=function(_211){var _212=_1c0(trim(_211));if(_212.length==1){var tef=_204(_212[0]);return function(root){var r=tef(root,new qlc());if(r){r.nozip=true;}return r;};}return function(root){return _20b(root,_212);};};var nua=navigator.userAgent;var wk="WebKit/";var _213=(d.isWebKit&&(nua.indexOf(wk)>0)&&(parseFloat(nua.split(wk)[1])>528));var _214=d.isIE?"commentStrip":"nozip";var qsa="querySelectorAll";var _215=(!!_1ba()[qsa]&&(!d.isSafari||(d.isSafari>3.1)||_213));var _216=/n\+\d|([^ ])?([>~+])([^ =])?/g;var _217=function(_218,pre,ch,post){return ch?(pre?pre+" ":"")+ch+(post?" "+post:""):_218;};var _219=function(_21a,_21b){_21a=_21a.replace(_216,_217);if(_215){var _21c=_20f[_21a];if(_21c&&!_21b){return _21c;}}var _21d=_20e[_21a];if(_21d){return _21d;}var qcz=_21a.charAt(0);var _21e=(-1==_21a.indexOf(" "));if((_21a.indexOf("#")>=0)&&(_21e)){_21b=true;}var _21f=(_215&&(!_21b)&&(_1bd.indexOf(qcz)==-1)&&(!d.isIE||(_21a.indexOf(":")==-1))&&(!(_1bb&&(_21a.indexOf(".")>=0)))&&(_21a.indexOf(":contains")==-1)&&(_21a.indexOf(":checked")==-1)&&(_21a.indexOf("|=")==-1));if(_21f){var tq=(_1bd.indexOf(_21a.charAt(_21a.length-1))>=0)?(_21a+" *"):_21a;return _20f[_21a]=function(root){try{if(!((9==root.nodeType)||_21e)){throw "";}var r=root[qsa](tq);r[_214]=true;return r;}catch(e){return _219(_21a,true)(root);}};}else{var _220=_21a.split(/\s*,\s*/);return _20e[_21a]=((_220.length<2)?_210(_21a):function(root){var _221=0,ret=[],tp;while((tp=_220[_221++])){ret=ret.concat(_210(tp)(root));}return ret;});}};var _222=0;var _223=d.isIE?function(node){if(_1be){return (node.getAttribute("_uid")||node.setAttribute("_uid",++_222)||_222);}else{return node.uniqueID;}}:function(node){return (node._uid||(node._uid=++_222));};var _1fd=function(node,bag){if(!bag){return 1;}var id=_223(node);if(!bag[id]){return bag[id]=1;}return 0;};var _224="_zipIdx";var _225=function(arr){if(arr&&arr.nozip){return (qlc._wrap)?qlc._wrap(arr):arr;}var ret=new qlc();if(!arr||!arr.length){return ret;}if(arr[0]){ret.push(arr[0]);}if(arr.length<2){return ret;}_222++;if(d.isIE&&_1be){var _226=_222+"";arr[0].setAttribute(_224,_226);for(var x=1,te;te=arr[x];x++){if(arr[x].getAttribute(_224)!=_226){ret.push(te);}te.setAttribute(_224,_226);}}else{if(d.isIE&&arr.commentStrip){try{for(var x=1,te;te=arr[x];x++){if(_1d6(te)){ret.push(te);}}}catch(e){}}else{if(arr[0]){arr[0][_224]=_222;}for(var x=1,te;te=arr[x];x++){if(arr[x][_224]!=_222){ret.push(te);}te[_224]=_222;}}}return ret;};d.query=function(_227,root){qlc=d._NodeListCtor;if(!_227){return new qlc();}if(_227.constructor==qlc){return _227;}if(typeof _227!="string"){return new qlc(_227);}if(typeof root=="string"){root=d.byId(root);if(!root){return new qlc();}}root=root||_1ba();var od=root.ownerDocument||root.documentElement;_1be=(root.contentType&&root.contentType=="application/xml")||(d.isOpera&&(root.doctype||od.toString()=="[object XMLDocument]"))||(!!od)&&(d.isIE?od.xml:(root.xmlVersion||od.xmlVersion));var r=_219(_227)(root);if(r&&r.nozip&&!qlc._wrap){return r;}return _225(r);};d.query.pseudos=_1ea;d._filterQueryResult=function(_228,_229){var _22a=new d._NodeListCtor();var _22b=_1f1(_1c0(_229)[0]);for(var x=0,te;te=_228[x];x++){if(_22b(te)){_22a.push(te);}}return _22a;};})(this["queryPortability"]||this["acme"]||dojo);}if(!dojo._hasResource["dojo._base.xhr"]){dojo._hasResource["dojo._base.xhr"]=true;dojo.provide("dojo._base.xhr");(function(){var _22c=dojo,cfg=_22c.config;function _22d(obj,name,_22e){if(_22e===null){return;}var val=obj[name];if(typeof val=="string"){obj[name]=[val,_22e];}else{if(_22c.isArray(val)){val.push(_22e);}else{obj[name]=_22e;}}};dojo.fieldToObject=function(_22f){var ret=null;var item=_22c.byId(_22f);if(item){var _230=item.name;var type=(item.type||"").toLowerCase();if(_230&&type&&!item.disabled){if(type=="radio"||type=="checkbox"){if(item.checked){ret=item.value;}}else{if(item.multiple){ret=[];_22c.query("option",item).forEach(function(opt){if(opt.selected){ret.push(opt.value);}});}else{ret=item.value;}}}}return ret;};dojo.formToObject=function(_231){var ret={};var _232="file|submit|image|reset|button|";_22c.forEach(dojo.byId(_231).elements,function(item){var _233=item.name;var type=(item.type||"").toLowerCase();if(_233&&type&&_232.indexOf(type)==-1&&!item.disabled){_22d(ret,_233,_22c.fieldToObject(item));if(type=="image"){ret[_233+".x"]=ret[_233+".y"]=ret[_233].x=ret[_233].y=0;}}});return ret;};dojo.objectToQuery=function(map){var enc=encodeURIComponent;var _234=[];var _235={};for(var name in map){var _236=map[name];if(_236!=_235[name]){var _237=enc(name)+"=";if(_22c.isArray(_236)){for(var i=0;i<_236.length;i++){_234.push(_237+enc(_236[i]));}}else{_234.push(_237+enc(_236));}}}return _234.join("&");};dojo.formToQuery=function(_238){return _22c.objectToQuery(_22c.formToObject(_238));};dojo.formToJson=function(_239,_23a){return _22c.toJson(_22c.formToObject(_239),_23a);};dojo.queryToObject=function(str){var ret={};var qp=str.split("&");var dec=decodeURIComponent;_22c.forEach(qp,function(item){if(item.length){var _23b=item.split("=");var name=dec(_23b.shift());var val=dec(_23b.join("="));if(typeof ret[name]=="string"){ret[name]=[ret[name]];}if(_22c.isArray(ret[name])){ret[name].push(val);}else{ret[name]=val;}}});return ret;};dojo._blockAsync=false;var _23c=_22c._contentHandlers=dojo.contentHandlers={text:function(xhr){return xhr.responseText;},json:function(xhr){return _22c.fromJson(xhr.responseText||null);},"json-comment-filtered":function(xhr){if(!dojo.config.useCommentedJson){console.warn("Consider using the standard mimetype:application/json."+" json-commenting can introduce security issues. To"+" decrease the chances of hijacking, use the standard the 'json' handler and"+" prefix your json with: {}&&\n"+"Use djConfig.useCommentedJson=true to turn off this message.");}var _23d=xhr.responseText;var _23e=_23d.indexOf("/*");var _23f=_23d.lastIndexOf("*/");if(_23e==-1||_23f==-1){throw new Error("JSON was not comment filtered");}return _22c.fromJson(_23d.substring(_23e+2,_23f));},javascript:function(xhr){return _22c.eval(xhr.responseText);},xml:function(xhr){var _240=xhr.responseXML;if(_22c.isIE&&(!_240||!_240.documentElement)){var ms=function(n){return "MSXML"+n+".DOMDocument";};var dp=["Microsoft.XMLDOM",ms(6),ms(4),ms(3),ms(2)];_22c.some(dp,function(p){try{var dom=new ActiveXObject(p);dom.async=false;dom.loadXML(xhr.responseText);_240=dom;}catch(e){return false;}return true;});}return _240;},"json-comment-optional":function(xhr){if(xhr.responseText&&/^[^{\[]*\/\*/.test(xhr.responseText)){return _23c["json-comment-filtered"](xhr);}else{return _23c["json"](xhr);}}};dojo._ioSetArgs=function(args,_241,_242,_243){var _244={args:args,url:args.url};var _245=null;if(args.form){var form=_22c.byId(args.form);var _246=form.getAttributeNode("action");_244.url=_244.url||(_246?_246.value:null);_245=_22c.formToObject(form);}var _247=[{}];if(_245){_247.push(_245);}if(args.content){_247.push(args.content);}if(args.preventCache){_247.push({"dojo.preventCache":new Date().valueOf()});}_244.query=_22c.objectToQuery(_22c.mixin.apply(null,_247));_244.handleAs=args.handleAs||"text";var d=new _22c.Deferred(_241);d.addCallbacks(_242,function(_248){return _243(_248,d);});var ld=args.load;if(ld&&_22c.isFunction(ld)){d.addCallback(function(_249){return ld.call(args,_249,_244);});}var err=args.error;if(err&&_22c.isFunction(err)){d.addErrback(function(_24a){return err.call(args,_24a,_244);});}var _24b=args.handle;if(_24b&&_22c.isFunction(_24b)){d.addBoth(function(_24c){return _24b.call(args,_24c,_244);});}if(cfg.ioPublish&&_22c.publish&&_244.args.ioPublish!==false){d.addCallbacks(function(res){_22c.publish("/dojo/io/load",[d,res]);return res;},function(res){_22c.publish("/dojo/io/error",[d,res]);return res;});d.addBoth(function(res){_22c.publish("/dojo/io/done",[d,res]);return res;});}d.ioArgs=_244;return d;};var _24d=function(dfd){dfd.canceled=true;var xhr=dfd.ioArgs.xhr;var _24e=typeof xhr.abort;if(_24e=="function"||_24e=="object"||_24e=="unknown"){xhr.abort();}var err=dfd.ioArgs.error;if(!err){err=new Error("xhr cancelled");err.dojoType="cancel";}return err;};var _24f=function(dfd){var ret=_23c[dfd.ioArgs.handleAs](dfd.ioArgs.xhr);return ret===undefined?null:ret;};var _250=function(_251,dfd){if(!dfd.ioArgs.args.failOk){console.error(_251);}return _251;};var _252=null;var _253=[];var _254=0;var _255=function(dfd){if(_254<=0){_254=0;if(cfg.ioPublish&&_22c.publish&&(!dfd||dfd&&dfd.ioArgs.args.ioPublish!==false)){_22c.publish("/dojo/io/stop");}}};var _256=function(){var now=(new Date()).getTime();if(!_22c._blockAsync){for(var i=0,tif;i<_253.length&&(tif=_253[i]);i++){var dfd=tif.dfd;var func=function(){if(!dfd||dfd.canceled||!tif.validCheck(dfd)){_253.splice(i--,1);_254-=1;}else{if(tif.ioCheck(dfd)){_253.splice(i--,1);tif.resHandle(dfd);_254-=1;}else{if(dfd.startTime){if(dfd.startTime+(dfd.ioArgs.args.timeout||0)<now){_253.splice(i--,1);var err=new Error("timeout exceeded");err.dojoType="timeout";dfd.errback(err);dfd.cancel();_254-=1;}}}}};if(dojo.config.debugAtAllCosts){func.call(this);}else{try{func.call(this);}catch(e){dfd.errback(e);}}}}_255(dfd);if(!_253.length){clearInterval(_252);_252=null;return;}};dojo._ioCancelAll=function(){try{_22c.forEach(_253,function(i){try{i.dfd.cancel();}catch(e){}});}catch(e){}};if(_22c.isIE){_22c.addOnWindowUnload(_22c._ioCancelAll);}_22c._ioNotifyStart=function(dfd){if(cfg.ioPublish&&_22c.publish&&dfd.ioArgs.args.ioPublish!==false){if(!_254){_22c.publish("/dojo/io/start");}_254+=1;_22c.publish("/dojo/io/send",[dfd]);}};_22c._ioWatch=function(dfd,_257,_258,_259){var args=dfd.ioArgs.args;if(args.timeout){dfd.startTime=(new Date()).getTime();}_253.push({dfd:dfd,validCheck:_257,ioCheck:_258,resHandle:_259});if(!_252){_252=setInterval(_256,50);}if(args.sync){_256();}};var _25a="application/x-www-form-urlencoded";var _25b=function(dfd){return dfd.ioArgs.xhr.readyState;};var _25c=function(dfd){return 4==dfd.ioArgs.xhr.readyState;};var _25d=function(dfd){var xhr=dfd.ioArgs.xhr;if(_22c._isDocumentOk(xhr)){dfd.callback(dfd);}else{var err=new Error("Unable to load "+dfd.ioArgs.url+" status:"+xhr.status);err.status=xhr.status;err.responseText=xhr.responseText;dfd.errback(err);}};dojo._ioAddQueryToUrl=function(_25e){if(_25e.query.length){_25e.url+=(_25e.url.indexOf("?")==-1?"?":"&")+_25e.query;_25e.query=null;}};dojo.xhr=function(_25f,args,_260){var dfd=_22c._ioSetArgs(args,_24d,_24f,_250);var _261=dfd.ioArgs;var xhr=_261.xhr=_22c._xhrObj(_261.args);if(!xhr){dfd.cancel();return dfd;}if("postData" in args){_261.query=args.postData;}else{if("putData" in args){_261.query=args.putData;}else{if("rawBody" in args){_261.query=args.rawBody;}else{if((arguments.length>2&&!_260)||"POST|PUT".indexOf(_25f.toUpperCase())==-1){_22c._ioAddQueryToUrl(_261);}}}}xhr.open(_25f,_261.url,args.sync!==true,args.user||undefined,args.password||undefined);if(args.headers){for(var hdr in args.headers){if(hdr.toLowerCase()==="content-type"&&!args.contentType){args.contentType=args.headers[hdr];}else{if(args.headers[hdr]){xhr.setRequestHeader(hdr,args.headers[hdr]);}}}}xhr.setRequestHeader("Content-Type",args.contentType||_25a);if(!args.headers||!("X-Requested-With" in args.headers)){xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");}_22c._ioNotifyStart(dfd);if(dojo.config.debugAtAllCosts){xhr.send(_261.query);}else{try{xhr.send(_261.query);}catch(e){_261.error=e;dfd.cancel();}}_22c._ioWatch(dfd,_25b,_25c,_25d);xhr=null;return dfd;};dojo.xhrGet=function(args){return _22c.xhr("GET",args);};dojo.rawXhrPost=dojo.xhrPost=function(args){return _22c.xhr("POST",args,true);};dojo.rawXhrPut=dojo.xhrPut=function(args){return _22c.xhr("PUT",args,true);};dojo.xhrDelete=function(args){return _22c.xhr("DELETE",args);};})();}if(!dojo._hasResource["dojo._base.fx"]){dojo._hasResource["dojo._base.fx"]=true;dojo.provide("dojo._base.fx");(function(){var d=dojo;var _262=d._mixin;dojo._Line=function(_263,end){this.start=_263;this.end=end;};dojo._Line.prototype.getValue=function(n){return ((this.end-this.start)*n)+this.start;};dojo.Animation=function(args){_262(this,args);if(d.isArray(this.curve)){this.curve=new d._Line(this.curve[0],this.curve[1]);}};d._Animation=d.Animation;d.extend(dojo.Animation,{duration:350,repeat:0,rate:20,_percent:0,_startRepeatCount:0,_getStep:function(){var _264=this._percent,_265=this.easing;return _265?_265(_264):_264;},_fire:function(evt,args){var a=args||[];if(this[evt]){if(d.config.debugAtAllCosts){this[evt].apply(this,a);}else{try{this[evt].apply(this,a);}catch(e){console.error("exception in animation handler for:",evt);console.error(e);}}}return this;},play:function(_266,_267){var _268=this;if(_268._delayTimer){_268._clearTimer();}if(_267){_268._stopTimer();_268._active=_268._paused=false;_268._percent=0;}else{if(_268._active&&!_268._paused){return _268;}}_268._fire("beforeBegin",[_268.node]);var de=_266||_268.delay,_269=dojo.hitch(_268,"_play",_267);if(de>0){_268._delayTimer=setTimeout(_269,de);return _268;}_269();return _268;},_play:function(_26a){var _26b=this;if(_26b._delayTimer){_26b._clearTimer();}_26b._startTime=new Date().valueOf();if(_26b._paused){_26b._startTime-=_26b.duration*_26b._percent;}_26b._endTime=_26b._startTime+_26b.duration;_26b._active=true;_26b._paused=false;var _26c=_26b.curve.getValue(_26b._getStep());if(!_26b._percent){if(!_26b._startRepeatCount){_26b._startRepeatCount=_26b.repeat;}_26b._fire("onBegin",[_26c]);}_26b._fire("onPlay",[_26c]);_26b._cycle();return _26b;},pause:function(){var _26d=this;if(_26d._delayTimer){_26d._clearTimer();}_26d._stopTimer();if(!_26d._active){return _26d;}_26d._paused=true;_26d._fire("onPause",[_26d.curve.getValue(_26d._getStep())]);return _26d;},gotoPercent:function(_26e,_26f){var _270=this;_270._stopTimer();_270._active=_270._paused=true;_270._percent=_26e;if(_26f){_270.play();}return _270;},stop:function(_271){var _272=this;if(_272._delayTimer){_272._clearTimer();}if(!_272._timer){return _272;}_272._stopTimer();if(_271){_272._percent=1;}_272._fire("onStop",[_272.curve.getValue(_272._getStep())]);_272._active=_272._paused=false;return _272;},status:function(){if(this._active){return this._paused?"paused":"playing";}return "stopped";},_cycle:function(){var _273=this;if(_273._active){var curr=new Date().valueOf();var step=(curr-_273._startTime)/(_273._endTime-_273._startTime);if(step>=1){step=1;}_273._percent=step;if(_273.easing){step=_273.easing(step);}_273._fire("onAnimate",[_273.curve.getValue(step)]);if(_273._percent<1){_273._startTimer();}else{_273._active=false;if(_273.repeat>0){_273.repeat--;_273.play(null,true);}else{if(_273.repeat==-1){_273.play(null,true);}else{if(_273._startRepeatCount){_273.repeat=_273._startRepeatCount;_273._startRepeatCount=0;}}}_273._percent=0;_273._fire("onEnd",[_273.node]);!_273.repeat&&_273._stopTimer();}}return _273;},_clearTimer:function(){clearTimeout(this._delayTimer);delete this._delayTimer;}});var ctr=0,_274=[],_275=null,_276={run:function(){}};d.extend(d.Animation,{_startTimer:function(){if(!this._timer){this._timer=d.connect(_276,"run",this,"_cycle");ctr++;}if(!_275){_275=setInterval(d.hitch(_276,"run"),this.rate);}},_stopTimer:function(){if(this._timer){d.disconnect(this._timer);this._timer=null;ctr--;}if(ctr<=0){clearInterval(_275);_275=null;ctr=0;}}});var _277=d.isIE?function(node){var ns=node.style;if(!ns.width.length&&d.style(node,"width")=="auto"){ns.width="auto";}}:function(){};dojo._fade=function(args){args.node=d.byId(args.node);var _278=_262({properties:{}},args),_279=(_278.properties.opacity={});_279.start=!("start" in _278)?function(){return +d.style(_278.node,"opacity")||0;}:_278.start;_279.end=_278.end;var anim=d.animateProperty(_278);d.connect(anim,"beforeBegin",d.partial(_277,_278.node));return anim;};dojo.fadeIn=function(args){return d._fade(_262({end:1},args));};dojo.fadeOut=function(args){return d._fade(_262({end:0},args));};dojo._defaultEasing=function(n){return 0.5+((Math.sin((n+1.5)*Math.PI))/2);};var _27a=function(_27b){this._properties=_27b;for(var p in _27b){var prop=_27b[p];if(prop.start instanceof d.Color){prop.tempColor=new d.Color();}}};_27a.prototype.getValue=function(r){var ret={};for(var p in this._properties){var prop=this._properties[p],_27c=prop.start;if(_27c instanceof d.Color){ret[p]=d.blendColors(_27c,prop.end,r,prop.tempColor).toCss();}else{if(!d.isArray(_27c)){ret[p]=((prop.end-_27c)*r)+_27c+(p!="opacity"?prop.units||"px":0);}}}return ret;};dojo.animateProperty=function(args){var n=args.node=d.byId(args.node);if(!args.easing){args.easing=d._defaultEasing;}var anim=new d.Animation(args);d.connect(anim,"beforeBegin",anim,function(){var pm={};for(var p in this.properties){if(p=="width"||p=="height"){this.node.display="block";}var prop=this.properties[p];if(d.isFunction(prop)){prop=prop(n);}prop=pm[p]=_262({},(d.isObject(prop)?prop:{end:prop}));if(d.isFunction(prop.start)){prop.start=prop.start(n);}if(d.isFunction(prop.end)){prop.end=prop.end(n);}var _27d=(p.toLowerCase().indexOf("color")>=0);function _27e(node,p){var v={height:node.offsetHeight,width:node.offsetWidth}[p];if(v!==undefined){return v;}v=d.style(node,p);return (p=="opacity")?+v:(_27d?v:parseFloat(v));};if(!("end" in prop)){prop.end=_27e(n,p);}else{if(!("start" in prop)){prop.start=_27e(n,p);}}if(_27d){prop.start=new d.Color(prop.start);prop.end=new d.Color(prop.end);}else{prop.start=(p=="opacity")?+prop.start:parseFloat(prop.start);}}this.curve=new _27a(pm);});d.connect(anim,"onAnimate",d.hitch(d,"style",anim.node));return anim;};dojo.anim=function(node,_27f,_280,_281,_282,_283){return d.animateProperty({node:node,duration:_280||d.Animation.prototype.duration,properties:_27f,easing:_281,onEnd:_282}).play(_283||0);};})();}if(!dojo._hasResource["dojo._base.browser"]){dojo._hasResource["dojo._base.browser"]=true;dojo.provide("dojo._base.browser");dojo.forEach(dojo.config.require,function(i){dojo["require"](i);});}if(dojo.config.afterOnLoad&&dojo.isBrowser){window.setTimeout(dojo._loadInit,1000);}})();
+</script>
+
+
+<script id="effectgames" type="x">
+;
+var ZeroUpload = {
+clients: {},
+moviePath: 'ZeroUpload.swf',
+nextId: 1,
+$: function(thingy) {
+if (typeof(thingy) == 'string') thingy = document.getElementById(thingy);
+if (!thingy.__zeroUploadExtended) {
+thingy.__zeroUploadExtended = true;
+thingy.hide = function() { this.style.display = 'none'; };
+thingy.show = function() { this.style.display = ''; };
+thingy.addClass = function(name) { this.removeClass(name); this.className += ' ' + name; };
+thingy.removeClass = function(name) {
+this.className = this.className.replace( new RegExp("(^|\\s+)" + name + "(\\s+|$)"), "").replace(/^\s+|\s+$/g, '');
+};
+thingy.hasClass = function(name) {
+return !!this.className.match( new RegExp("\\s*" + name + "\\s*") );
+};
+}
+return thingy;
+},
+setMoviePath: function(path) {
+this.moviePath = path;
+},
+dispatch: function(id, eventName, args) {
+var client = this.clients[id];
+if (client) {
+client.receiveEvent(eventName, args);
+}
+},
+register: function(id, client) {
+this.clients[id] = client;
+},
+getDOMObjectPosition: function(obj) {
+var info = {
+left: 0,
+top: 0,
+width: obj.width ? obj.width : obj.offsetWidth,
+height: obj.height ? obj.height : obj.offsetHeight
+};
+while (obj) {
+info.left += obj.offsetLeft;
+info.top += obj.offsetTop;
+obj = obj.offsetParent;
+}
+return info;
+},
+Client: function(elem) {
+this.fileTypes = ["All Files", "*.*"];
+this.postParams = {};
+this.handlers = {};
+this.id = ZeroUpload.nextId++;
+this.containerId = 'ZeroUploadContainer_' + this.id;
+this.movieId = 'ZeroUploadMovie_' + this.id;
+ZeroUpload.register(this.id, this);
+if (elem) this.glue(elem);
+}
+};
+ZeroUpload.Client.prototype = {
+id: 0,
+ready: false,
+movie: null,
+fileTypes: null,
+postParams: null,
+targetURL: '',
+fileDataField: 'Filedata',
+handCursorEnabled: true,
+maxFileSize: 0,
+cssEffects: true,
+maxFiles: 0,
+delayBetween: 1,
+handlers: null,
+glue: function(elem) {
+this.domElement = ZeroUpload.$(elem);
+var zIndex = 9999;
+if (this.domElement.style.zIndex) {
+zIndex = parseInt(this.domElement.style.zIndex, 10) + 1;
+}
+var box = ZeroUpload.getDOMObjectPosition(this.domElement);
+this.div = document.createElement('div');
+var style = this.div.style;
+style.position = 'absolute';
+style.left = '' + box.left + 'px';
+style.top = '' + box.top + 'px';
+style.width = '' + box.width + 'px';
+style.height = '' + box.height + 'px';
+style.zIndex = zIndex;
+var body = document.getElementsByTagName('body')[0];
+body.appendChild(this.div);
+this.div.innerHTML = this.getHTML( box.width, box.height );
+},
+getHTML: function(width, height) {
+var html = '';
+var flashvars = 'id=' + this.id +
+'&width=' + width +
+'&height=' + height;
+if (navigator.userAgent.match(/MSIE/)) {
+var protocol = location.href.match(/^https/i) ? 'https://' : 'http://';
+html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroUpload.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>';
+}
+else {
+html += '<embed id="'+this.movieId+'" src="'+ZeroUpload.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />';
+}
+return html;
+},
+hide: function() {
+if (this.div) {
+this.div.style.left = '-2000px';
+}
+},
+show: function() {
+this.reposition();
+},
+destroy: function() {
+if (this.domElement && this.div) {
+this.hide();
+this.movie = null;
+try { this.div.removeChild( this.movie ); } catch(e) {;}
+var body = document.getElementsByTagName('body')[0];
+try { body.removeChild( this.div ); } catch(e) {;}
+this.domElement = null;
+this.div = null;
+}
+},
+reposition: function(elem) {
+if (elem) {
+this.domElement = ZeroUpload.$(elem);
+}
+if (this.domElement && this.div) {
+var box = ZeroUpload.getDOMObjectPosition(this.domElement);
+var style = this.div.style;
+style.left = '' + box.left + 'px';
+style.top = '' + box.top + 'px';
+}
+},
+setFileTypes: function(desc, exts) {
+this.fileTypes = [desc, exts];
+if (this.ready) this.movie.setFileTypes(desc, exts);
+},
+setPostParam: function(name, value) {
+this.postParams[name] = value;
+if (this.ready) this.movie.setPostParam(name, value);
+},
+setPostParams: function(obj) {
+for (var key in obj) this.setPostParam(key, obj[key]);
+if (this.ready) this.movie.setPostParams(obj);
+},
+setURL: function(url) {
+this.targetURL = url;
+if (this.ready) this.movie.setURL(url);
+},
+setFileDataField: function(name) {
+this.fileDataField = name;
+if (this.ready) this.movie.setFileDataField(name);
+},
+addEventListener: function(eventName, func) {
+eventName = eventName.toString().toLowerCase().replace(/^on/, '');
+if (!this.handlers[eventName]) this.handlers[eventName] = [];
+this.handlers[eventName].push(func);
+},
+cancel: function() {
+if (this.ready) this.movie.cancel();
+},
+setHandCursor: function(enabled) {
+this.handCursorEnabled = enabled;
+if (this.ready) this.movie.setHandCursor(enabled);
+},
+setMaxFileSize: function(size) {
+this.maxFileSize = size;
+if (this.ready) this.movie.setMaxFileSize(size);
+},
+setMaxFiles: function(num) {
+this.maxFiles = num;
+if (this.ready) this.movie.setMaxFiles(num);
+},
+setCSSEffects: function(enabled) {
+this.cssEffects = !!enabled;
+},
+setDelayBetween: function(ms) {
+this.delayBetween = ms;
+if (this.ready) this.movie.setDelayBetween(ms);
+},
+receiveEvent: function(eventName, args) {
+eventName = eventName.toString().toLowerCase().replace(/^on/, '');
+if (this.handlers.debug) {
+for (var idx = 0, len = this.handlers.debug.length; idx < len; idx++) {
+this.fireHandler( 'debug', eventName, args );
+}
+}
+switch (eventName) {
+case 'load':
+this.movie = document.getElementById(this.movieId);
+if (!this.movie) {
+var self = this;
+setTimeout( function() { self.receiveEvent('load', null); }, 10 );
+return;
+}
+if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) {
+var self = this;
+setTimeout( function() { self.receiveEvent('load', null); }, 100 );
+this.ready = true;
+return;
+}
+this.ready = true;
+this.movie.setFileTypes( this.fileTypes[0], this.fileTypes[1] );
+this.movie.setPostParams( this.postParams );
+this.movie.setURL( this.targetURL );
+this.movie.setFileDataField( this.fileDataField );
+this.movie.setHandCursor( this.handCursorEnabled );
+this.movie.setMaxFileSize( this.maxFileSize );
+this.movie.setMaxFiles( this.maxFiles );
+this.movie.setDelayBetween( this.delayBetween );
+break;
+case 'mouseover':
+if (this.domElement && this.cssEffects) {
+this.domElement.addClass('hover');
+if (this.recoverActive) this.domElement.addClass('active');
+}
+break;
+case 'mouseout':
+if (this.domElement && this.cssEffects) {
+this.recoverActive = false;
+if (this.domElement.hasClass('active')) {
+this.domElement.removeClass('active');
+this.recoverActive = true;
+}
+this.domElement.removeClass('hover');
+}
+break;
+case 'mousedown':
+if (this.domElement && this.cssEffects) {
+this.domElement.addClass('active');
+}
+break;
+case 'mouseup':
+if (this.domElement && this.cssEffects) {
+this.domElement.removeClass('active');
+this.recoverActive = false;
+}
+break;
+}
+this.fireHandler(eventName, args);
+},
+fireHandler: function() {
+var eventName = arguments[0];
+eventName = eventName.toString().toLowerCase().replace(/^on/, '');
+var args = [ this ];
+for (var idx = 1; idx < arguments.length; idx++) args.push( arguments[idx] );
+if (this.handlers[eventName]) {
+for (var idx = 0, len = this.handlers[eventName].length; idx < len; idx++) {
+var func = this.handlers[eventName][idx];
+if (typeof(func) == 'function') {
+func.apply(window, args);
+}
+else if ((typeof(func) == 'object') && (func.length == 2)) {
+func[0][ func[1] ].apply(func[0], args);
+}
+else if (typeof(func) == 'string') {
+window[func].apply(window, args);
+}
+}
+}
+}
+};
+var ZeroClipboard = {
+version: "1.0.5",
+clients: {},
+moviePath: 'ZeroClipboard.swf',
+nextId: 1,
+$: function(thingy) {
+if (typeof(thingy) == 'string') thingy = document.getElementById(thingy);
+if (!thingy.addClass) {
+thingy.hide = function() { this.style.display = 'none'; };
+thingy.show = function() { this.style.display = ''; };
+thingy.addClass = function(name) { this.removeClass(name); this.className += ' ' + name; };
+thingy.removeClass = function(name) {
+this.className = this.className.replace( new RegExp("(^|\\s+)" + name + "(\\s+|$)"), "").replace(/^\s+|\s+$/g, '');
+};
+thingy.hasClass = function(name) {
+return !!this.className.match( new RegExp("\\s*" + name + "\\s*") );
+};
+}
+return thingy;
+},
+setMoviePath: function(path) {
+this.moviePath = path;
+},
+dispatch: function(id, eventName, args) {
+var client = this.clients[id];
+if (client) {
+client.receiveEvent(eventName, args);
+}
+},
+register: function(id, client) {
+this.clients[id] = client;
+},
+getDOMObjectPosition: function(obj, stopObj) {
+var info = {
+left: 0,
+top: 0,
+width: obj.width ? obj.width : obj.offsetWidth,
+height: obj.height ? obj.height : obj.offsetHeight
+};
+while (obj && (obj != stopObj)) {
+info.left += obj.offsetLeft;
+info.top += obj.offsetTop;
+obj = obj.offsetParent;
+}
+return info;
+},
+Client: function(elem) {
+this.handlers = {};
+this.id = ZeroClipboard.nextId++;
+this.movieId = 'ZeroClipboardMovie_' + this.id;
+ZeroClipboard.register(this.id, this);
+if (elem) this.glue(elem);
+}
+};
+ZeroClipboard.Client.prototype = {
+id: 0,
+ready: false,
+movie: null,
+clipText: '',
+handCursorEnabled: true,
+cssEffects: true,
+handlers: null,
+glue: function(elem, appendElem, stylesToAdd) {
+this.domElement = ZeroClipboard.$(elem);
+var zIndex = 99;
+if (this.domElement.style.zIndex) {
+zIndex = parseInt(this.domElement.style.zIndex, 10) + 1;
+}
+if (typeof(appendElem) == 'string') {
+appendElem = ZeroClipboard.$(appendElem);
+}
+else if (typeof(appendElem) == 'undefined') {
+appendElem = document.getElementsByTagName('body')[0];
+}
+var box = ZeroClipboard.getDOMObjectPosition(this.domElement, appendElem);
+this.div = document.createElement('div');
+var style = this.div.style;
+style.position = 'absolute';
+style.left = '' + box.left + 'px';
+style.top = '' + box.top + 'px';
+style.width = '' + box.width + 'px';
+style.height = '' + box.height + 'px';
+style.zIndex = zIndex;
+if (typeof(stylesToAdd) == 'object') {
+for (addedStyle in stylesToAdd) {
+style[addedStyle] = stylesToAdd[addedStyle];
+}
+}
+appendElem.appendChild(this.div);
+this.div.innerHTML = this.getHTML( box.width, box.height );
+},
+getHTML: function(width, height) {
+var html = '';
+var flashvars = 'id=' + this.id +
+'&width=' + width +
+'&height=' + height;
+if (navigator.userAgent.match(/MSIE/)) {
+var protocol = location.href.match(/^https/i) ? 'https://' : 'http://';
+html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>';
+}
+else {
+html += '<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />';
+}
+return html;
+},
+hide: function() {
+if (this.div) {
+this.div.style.left = '-2000px';
+}
+},
+show: function() {
+this.reposition();
+},
+destroy: function() {
+if (this.domElement && this.div) {
+this.hide();
+this.div.innerHTML = '';
+var body = document.getElementsByTagName('body')[0];
+try { body.removeChild( this.div ); } catch(e) {;}
+this.domElement = null;
+this.div = null;
+}
+},
+reposition: function(elem) {
+if (elem) {
+this.domElement = ZeroClipboard.$(elem);
+if (!this.domElement) this.hide();
+}
+if (this.domElement && this.div) {
+var box = ZeroClipboard.getDOMObjectPosition(this.domElement);
+var style = this.div.style;
+style.left = '' + box.left + 'px';
+style.top = '' + box.top + 'px';
+}
+},
+setText: function(newText) {
+this.clipText = newText;
+if (this.ready) this.movie.setText(newText);
+},
+addEventListener: function(eventName, func) {
+eventName = eventName.toString().toLowerCase().replace(/^on/, '');
+if (!this.handlers[eventName]) this.handlers[eventName] = [];
+this.handlers[eventName].push(func);
+},
+setHandCursor: function(enabled) {
+this.handCursorEnabled = enabled;
+if (this.ready) this.movie.setHandCursor(enabled);
+},
+setCSSEffects: function(enabled) {
+this.cssEffects = !!enabled;
+},
+receiveEvent: function(eventName, args) {
+eventName = eventName.toString().toLowerCase().replace(/^on/, '');
+switch (eventName) {
+case 'load':
+this.movie = document.getElementById(this.movieId);
+if (!this.movie) {
+var self = this;
+setTimeout( function() { self.receiveEvent('load', null); }, 1 );
+return;
+}
+if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) {
+var self = this;
+setTimeout( function() { self.receiveEvent('load', null); }, 100 );
+this.ready = true;
+return;
+}
+this.ready = true;
+this.movie.setText( this.clipText );
+this.movie.setHandCursor( this.handCursorEnabled );
+break;
+case 'mouseover':
+if (this.domElement && this.cssEffects) {
+this.domElement.addClass('hover');
+if (this.recoverActive) this.domElement.addClass('active');
+}
+break;
+case 'mouseout':
+if (this.domElement && this.cssEffects) {
+this.recoverActive = false;
+if (this.domElement.hasClass('active')) {
+this.domElement.removeClass('active');
+this.recoverActive = true;
+}
+this.domElement.removeClass('hover');
+}
+break;
+case 'mousedown':
+if (this.domElement && this.cssEffects) {
+this.domElement.addClass('active');
+}
+break;
+case 'mouseup':
+if (this.domElement && this.cssEffects) {
+this.domElement.removeClass('active');
+this.recoverActive = false;
+}
+break;
+}
+if (this.handlers[eventName]) {
+for (var idx = 0, len = this.handlers[eventName].length; idx < len; idx++) {
+var func = this.handlers[eventName][idx];
+if (typeof(func) == 'function') {
+func(this, args);
+}
+else if ((typeof(func) == 'object') && (func.length == 2)) {
+func[0][ func[1] ](this, args);
+}
+else if (typeof(func) == 'string') {
+window[func](this, args);
+}
+}
+}
+}
+};
+var hexcase = 0;
+var b64pad = "";
+var chrsz = 8;
+function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
+function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
+function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
+function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
+function calcMD5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
+function md5_vm_test()
+{
+return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
+}
+function core_md5(x, len)
+{
+x[len >> 5] |= 0x80 << ((len) % 32);
+x[(((len + 64) >>> 9) << 4) + 14] = len;
+var a = 1732584193;
+var b = -271733879;
+var c = -1732584194;
+var d = 271733878;
+for(var i = 0; i < x.length; i += 16)
+{
+var olda = a;
+var oldb = b;
+var oldc = c;
+var oldd = d;
+a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
+d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
+c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
+b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
+a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
+d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
+c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
+b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
+a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
+d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
+c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
+b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
+a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
+d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
+c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
+b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
+a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
+d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
+c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
+b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
+a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
+d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
+c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
+b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
+a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
+d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
+c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
+b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
+a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
+d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
+c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
+b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
+a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
+d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
+c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
+b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
+a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
+d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
+c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
+b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
+a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
+d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
+c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
+b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
+a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
+d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
+c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
+b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
+a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
+d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
+c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
+b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
+a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
+d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
+c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
+b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
+a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
+d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
+c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
+b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
+a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
+d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
+c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
+b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
+a = safe_add(a, olda);
+b = safe_add(b, oldb);
+c = safe_add(c, oldc);
+d = safe_add(d, oldd);
+}
+return Array(a, b, c, d);
+}
+function md5_cmn(q, a, b, x, s, t)
+{
+return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
+}
+function md5_ff(a, b, c, d, x, s, t)
+{
+return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
+}
+function md5_gg(a, b, c, d, x, s, t)
+{
+return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
+}
+function md5_hh(a, b, c, d, x, s, t)
+{
+return md5_cmn(b ^ c ^ d, a, b, x, s, t);
+}
+function md5_ii(a, b, c, d, x, s, t)
+{
+return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
+}
+function core_hmac_md5(key, data)
+{
+var bkey = str2binl(key);
+if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);
+var ipad = Array(16), opad = Array(16);
+for(var i = 0; i < 16; i++)
+{
+ipad[i] = bkey[i] ^ 0x36363636;
+opad[i] = bkey[i] ^ 0x5C5C5C5C;
+}
+var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
+return core_md5(opad.concat(hash), 512 + 128);
+}
+function safe_add(x, y)
+{
+var lsw = (x & 0xFFFF) + (y & 0xFFFF);
+var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+return (msw << 16) | (lsw & 0xFFFF);
+}
+function bit_rol(num, cnt)
+{
+return (num << cnt) | (num >>> (32 - cnt));
+}
+function str2binl(str)
+{
+var bin = Array();
+var mask = (1 << chrsz) - 1;
+for(var i = 0; i < str.length * chrsz; i += chrsz)
+bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
+return bin;
+}
+function binl2hex(binarray)
+{
+var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
+var str = "";
+for(var i = 0; i < binarray.length * 4; i++)
+{
+str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
+hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);
+}
+return str;
+}
+function binl2b64(binarray)
+{
+var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+var str = "";
+for(var i = 0; i < binarray.length * 4; i += 3)
+{
+var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16)
+| (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
+| ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
+for(var j = 0; j < 4; j++)
+{
+if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
+else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
+}
+}
+return str;
+}
+var Namespace = {
+create: function(path, container) {
+if (!container) container = window;
+while (path.match(/^(\w+)\.?/)) {
+var key = RegExp.$1;
+path = path.replace(/^(\w+)\.?/, "");
+if (!container[key]) container[key] = {};
+container = container[key];
+}
+return container;
+},
+prep: function(name, container) {
+if (!container) container = window;
+if (name.match(/^(.+)\.(\w+)$/)) {
+var path = RegExp.$1;
+name = RegExp.$2;
+container = Namespace.create(path, container);
+}
+return { container: container, name: name };
+}
+};
+var Class = {
+create: function(name, members) {
+assert(name, "Must pass name to Class.create");
+if (!members) members = {};
+members.__parent = null;
+var ns = Namespace.prep(name);
+var container = ns.container;
+name = ns.name;
+members.__name = name;
+if (!members.__construct) members.__construct = function() {};
+container[name] = members.__construct;
+var static_members = members.__static;
+if (static_members) {
+for (var key in static_members) {
+container[name][key] = static_members[key];
+}
+}
+container[name].prototype = members;
+container[name].extend = container[name].subclass = function(name, members) {
+Class.subclass( this, name, members );
+};
+container[name].set = container[name].add = function(members) {
+Class.add( this, members );
+};
+},
+subclass: function(parent, name, members) {
+assert(parent, "Must pass parent class to Class.subclass");
+assert(name, "Must pass name to Class.subclass");
+if (!members) members = {};
+members.__name = name;
+members.__parent = parent.prototype;
+var ns = Namespace.prep(name);
+var container = ns.container;
+var subname = ns.name;
+if (members.__construct) {
+container[subname] = members.__construct;
+}
+else {
+var code = parent.toString();
+var args = code.substring( code.indexOf("(")+1, code.indexOf(")") );
+var inner_code = code.substring( code.indexOf("{")+1, code.lastIndexOf("}") );
+eval('members.__construct = container[subname] = function ('+args+') {'+inner_code+'};');
+}
+if (parent.prototype.__static) {
+for (var key in parent.prototype.__static) {
+container[subname][key] = parent.prototype.__static[key];
+}
+}
+var static_members = members.__static;
+if (static_members) {
+for (var key in static_members) {
+container[subname][key] = static_members[key];
+}
+}
+container[subname].prototype = new parent();
+for (var key in members) container[subname].prototype[key] = members[key];
+container[subname].extend = container[subname].subclass = function(name, members) {
+Class.subclass( this, name, members );
+};
+container[subname].set = container[subname].add = function(members) {
+Class.add( this, members );
+};
+},
+add: function(obj, members) {
+for (var key in members) obj.prototype[key] = members[key];
+},
+require: function() {
+for (var idx = 0, len = arguments.length; idx < len; idx++) {
+assert( !!eval('window.' + arguments[idx]) );
+}
+return true;
+}
+};
+Class.extend = Class.subclass;
+Class.set = Class.add;
+if (!window.assert) window.assert = function(fact, msg) {
+if (!fact) return alert("ASSERT FAILED! " + msg);
+return fact;
+};
+var images_uri = '/effect/images';
+var icons_uri = images_uri + '/icons';
+var protocol = location.protocol.match(/https/i) ? 'https' : 'http';
+var ua = navigator.userAgent;
+var safari = !!ua.match(/Safari/);
+var safari3 = safari && (!!ua.match(/Version\/[3456789]/) || window.chrome);
+var safari2 = (safari && !safari3 && !window.chrome);
+var ie = !!ua.match(/MSIE/);
+var ie7 = ie && !!ua.match(/MSIE\s+[789]/);
+var ie6 = (ie && !ie7);
+var moz = !safari && !ie;
+var op = !!window.opera;
+var mac = !!ua.match(/Mac/i);
+var ff = !!ua.match(/Firefox/i);
+var ff2 = ff && !!ua.match(/Firefox\/2/);
+var ff3 = ff && !!ua.match(/Firefox\/[3456789]/);
+var months = [
+[ 1, 'January' ], [ 2, 'February' ], [ 3, 'March' ], [ 4, 'April' ],
+[ 5, 'May' ], [ 6, 'June' ], [ 7, 'July' ], [ 8, 'August' ],
+[ 9, 'September' ], [ 10, 'October' ], [ 11, 'November' ],
+[ 12, 'December' ]
+];
+var short_month_names = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May',
+'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec' ];
+var day_names = ['Sunday', 'Monday', 'Tuesday', 'Wednesday',
+'Thursday', 'Friday', 'Saturday'];
+function $(thingy) {
+var obj = (typeof(thingy) == 'string') ? document.getElementById(thingy) : thingy;
+if (obj && !obj.setOpacity) {
+obj.hide = function() { this.style.display = 'none'; return this; };
+obj.show = function() { this.style.display = ''; return this; };
+obj.addClass = function(name) { this.removeClass(name); this.className += ' ' + name; return this; };
+obj.removeClass = function(name) {
+var classes = this.className.split(/\s+/);
+var idx = find_idx_in_array( classes, name );
+if (idx > -1) {
+classes.splice( idx, 1 );
+this.className = classes.join(' ');
+}
+return this;
+};
+obj.setOpacity = function(opacity) {
+if (opacity == 0.0) {
+this.style.opacity = 1.0;
+if (moz) this.style.MozOpacity = 1.0;
+else if (ie) this.style.filter = "";
+this.style.visibility = 'hidden';
+}
+else if (opacity == 1.0) {
+this.style.opacity = 1.0;
+if (moz) this.style.MozOpacity = 1.0;
+else if (ie) this.style.filter = "";
+this.style.visibility = 'visible';
+}
+else {
+this.style.opacity = opacity;
+if (moz) this.style.MozOpacity = opacity;
+else if (ie) this.style.filter = "alpha(opacity=" + parseInt(opacity * 100, 10) + ")";
+this.style.visibility = 'visible';
+}
+return this;
+};
+}
+return obj;
+}
+function parseQueryString(queryString) {
+var pair = null;
+var queryObject = new Object();
+queryString = queryString.replace(/^.*\?(.+)$/,'$1');
+while ((pair = queryString.match(/(\w+)=([^\&]*)\&?/)) && pair[0].length) {
+queryString = queryString.substring( pair[0].length );
+pair[2] = unescape(pair[2]);
+if (/^\-?\d+$/.test(pair[2])) pair[2] = parseInt(pair[2], 10);
+if (typeof(queryObject[pair[1]]) != 'undefined') {
+always_array( queryObject, pair[1] );
+array_push( queryObject[pair[1]], pair[2] );
+}
+else queryObject[pair[1]] = pair[2];
+}
+return queryObject;
+}
+function composeQueryString(queryObj) {
+var qs = '';
+for (var key in queryObj) {
+var values = always_array(queryObj[key]);
+for (var idx = 0, len = values.length; idx < len; idx++) {
+qs += (qs.length ? '&' : '?') + escape(key) + '=' + escape(values[idx]);
+}
+}
+return qs;
+}
+function spacer(width, height) {
+return '<img src="'+images_uri+'/spacer.gif" width="'+width+'" height="'+height+'">';
+}
+function solidify(obj) {
+obj.style.opacity = '1.0';
+if (moz) obj.style.MozOpacity = '1.0';
+else if (ie) obj.style.filter = '';
+}
+function transify(obj) {
+obj.style.opacity = '0.5';
+if (moz) obj.style.MozOpacity = '0.5';
+else if (ie) obj.style.filter = 'alpha(opacity=50)';
+}
+function trans_icon(name, code) {
+var size = 16;
+var html = '<a href="javascript:void(' + code + ')">';
+html += '<img src="'+icons_uri+'/'+name+'.gif" width='+size+' height='+size+' border=0';
+html += ' style="opacity:0.5; moz-opacity:0.5; filter:alpha(opacity=50);"';
+html += ' onMouseOver="solidify(this)"';
+html += ' onMouseOut="transify(this)"';
+html += '>';
+html += '</a>';
+return html;
+}
+function icon(name, label, code, status_text, id, hspace) {
+if (!window.icons_uri) return 'icons_uri not set!';
+var html = '';
+var ahref = '';
+var size = 16;
+if (typeof(label) == 'undefined') label = '';
+else label = '' + label;
+if (!id) id = '';
+if (!status_text) status_text = '';
+if (name.indexOf('_mini') > -1) size = 14;
+if (!name.match(/\.\w+$/)) name += '.gif';
+if (label) {
+html += '<table cellspacing=0 cellpadding=0 border=0><tr><td style="padding:0px; background:transparent;" valign=center>';
+}
+if (code) {
+if (code.toString().match(/^(\#|\/|http\:\/\/)/)) ahref = '<a href="' + code + '"';
+else ahref = '<a href="javascript:void(' + code + ')"';
+ahref += ' title="' + status_text + '">';
+html += ahref;
+}
+html += '<img id="'+id+'" class="png" src="'+png(icons_uri+'/'+name, true)+'" width='+size+' height='+size+' border=0>';
+if (code) html += '</a>';
+if (hspace) html += '&nbsp;';
+if (label) {
+html += '</td><td style="padding:0px; background:transparent;" width=4>'+spacer(4,1)+'</td><td style="padding:0px; background:transparent;" valign=center>';
+if (code) html += ahref;
+html += label;
+if (code) html += '</a>';
+html += '</td></tr></table>';
+}
+return html;
+}
+function code_link(code, html, status_text) {
+if (!status_text) status_text = html.toString().replace(/<.+?>/g, "");
+return '<a href="javascript:void(' + code + ')"' +
+' title="' + status_text + '"' +
+' style="cursor:pointer"' +
+'>' + html + '</a>';
+}
+function set_section_visibility(id, visible) {
+var div = document.getElementById(id);
+var current_state = div.style.display;
+div.style.display = visible ? 'block' : 'none';
+var sc = document.getElementById('sc_' + id);
+if (sc) {
+var new_icon_name = visible ? 'arrow-down' : 'arrow-right';
+if (sc.src.indexOf('_mini') > -1) new_icon_name += '_mini';
+sc.src = icons_uri + '/' + new_icon_name + '.png';
+}
+if (visible && !div.innerHTML.length && div.getAttribute('onExpand'))
+eval( div.getAttribute('onExpand') );
+}
+function toggle_section(id) {
+var div = document.getElementById(id);
+var current_state = div.style.display;
+div.style.display = (current_state == 'block') ? 'none' : 'block';
+var sc = document.getElementById('sc_' + id);
+if (sc) {
+var new_icon_name = (current_state == 'block') ? 'arrow-right' : 'arrow-down';
+if (sc.src.indexOf('_mini') > -1) new_icon_name += '_mini';
+sc.src = icons_uri + '/' + new_icon_name + '.png';
+}
+if (!div.innerHTML.length && div.getAttribute('onExpand'))
+eval( div.getAttribute('onExpand') );
+}
+function section_control(id, expanded) {
+return icon(
+expanded ? 'arrow-down.png' : 'arrow-right.png', '', '', 'Toggle Section View', 'sc_' + id
+);
+}
+function get_text_from_bytes(bytes) {
+if (bytes >= 1024) {
+bytes = parseInt( (bytes / 1024) * 10, 10 ) / 10;
+if (bytes >= 1024) {
+bytes = parseInt( (bytes / 1024) * 10, 10 ) / 10;
+if (bytes >= 1024) {
+bytes = parseInt( (bytes / 1024) * 10, 10 ) / 10;
+return bytes + ' GB';
+} else return bytes + ' MB';
+}
+else return bytes + ' K';
+}
+else return bytes + ' bytes';
+}
+function csv_to_hash(csv) {
+if (!csv.length) return {};
+assert( arguments.length == 1, "Wrong number of arguments sent to csv_to_hash (" + arguments.length + ")" );
+var list = csv.split(/\,\s*/);
+var hash = {};
+for (var idx = 0, len = list.length; idx < len; idx++) {
+hash[ list[idx] ] = 1;
+}
+return hash;
+}
+function num_keys(hash) {
+var count = 0;
+for (var a in hash) count++;
+return count;
+}
+function reverse_hash(a) {
+var c = {};
+for (var key in a) {
+c[ a[key] ] = key;
+}
+return c;
+}
+function progress_bar(args) {
+if (!args.counter_max) args.counter_max = 1;
+var x = parseInt( (args.counter * args.width) / args.counter_max, 10 );
+if (x < 0) x = 0;
+if (x > args.width) x = args.width;
+var html = '<table cellspacing=0 cellpadding=0 border=0><tr><td valign=center';
+if (!x) html += ' background="'+images_uri+'/b2_loop.gif"';
+html += '>';
+html += '<nobr>';
+if (x > 4) {
+var xtemp = x - 4;
+html += '<img src="'+images_uri+'/a1.gif" width=2 height='+args.height+'>';
+html += '<img src="'+images_uri+'/a2.gif" width='+xtemp+' height='+args.height+'>';
+html += '<img src="'+images_uri+'/a3.gif" width=2 height='+args.height+'>';
+}
+if (x < args.width - 4) {
+var xtemp = (args.width - x) - 4;
+var b2 = x ? "b2" : "spacer";
+html += '<img src="'+images_uri+'/b1.gif" width=2 height='+args.height+'>';
+html += '<img src="'+images_uri+'/'+b2+'.gif" width='+xtemp+' height='+args.height+'>';
+html += '<img src="'+images_uri+'/b3.gif" width=2 height='+args.height+'>';
+}
+html += '</nobr>';
+html += '</td>';
+if (args.show_percent) {
+var pct = parseInt( (args.counter * 100) / args.counter_max, 10 );
+if (pct < 0) pct = 0;
+if (pct > 100) pct = 100;
+html += '<td valign=center>&nbsp;' + pct + '%</td>';
+}
+html += '</tr></table>';
+return html;
+}
+var g_unique_id = 772;
+function get_unique_id() {
+g_unique_id++;
+return g_unique_id;
+}
+function substitute(text, args) {
+if (!text) text = "";
+if (!args) args = {};
+while (text.indexOf('[') > -1) {
+var open_bracket = text.indexOf('[');
+var close_bracket = text.indexOf(']');
+var before = text.substring(0, open_bracket);
+var after = text.substring(close_bracket + 1, text.length);
+var name = text.substring( open_bracket + 1, close_bracket );
+var value = '';
+if (name.indexOf('/') == 0) value = lookup_path(name, args);
+else if (typeof(args[name]) != 'undefined') value = args[name];
+else if (!(/^\w+$/.test(name))) value = eval(name);
+else value = '[' + name + ']';
+text = before + value + after;
+}
+return text;
+}
+function time_now() {
+var now = new Date();
+return parseInt( now.getTime() / 1000, 10 );
+}
+function ucfirst(text) {
+return text.substring(0, 1).toUpperCase() + text.substring(1, text.length).toLowerCase();
+}
+function text_to_html(text) {
+if (!text) text = "";
+return encode_entities(text).toString().replace(/\n/g, "\n<br>");
+}
+function html_to_text(html) {
+html = html.replace(/<\/(p|div|ul|ol|li|table|tr|dl|dd|dt|h\d)>/ig, "__ChBREAk__");
+html = html.replace(/<br\/?>/ig, "__ChBREAk__");
+html = html.replace(/<.+?>/g, "");
+html = html.replace(/__ChBREAk__/g, "<br/>");
+return html;
+}
+function image_rollover(img) {
+img.src = img.src.replace(/_up(\.\w+)$/, "_over$1");
+}
+function image_rollout(img) {
+img.src = img.src.replace(/_over(\.\w+)$/, "_up$1");
+}
+function commify(number) {
+if (!number) number = 0;
+number = '' + number;
+if (number.length > 3) {
+var mod = number.length % 3;
+var output = (mod > 0 ? (number.substring(0,mod)) : '');
+for (i=0 ; i < Math.floor(number.length / 3); i++) {
+if ((mod == 0) && (i == 0))
+output += number.substring(mod+ 3 * i, mod + 3 * i + 3);
+else
+output+= ',' + number.substring(mod + 3 * i, mod + 3 * i + 3);
+}
+return (output);
+}
+else return number;
+}
+function short_float(value) {
+if (!value) value = 0;
+return value.toString().replace(/^(\-?\d+\.[0]*\d{2}).*$/, '$1');
+}
+function pct(count, max) {
+var pct = (count * 100) / (max || 1);
+if (!pct.toString().match(/^\d+(\.\d+)?$/)) { pct = 0; }
+return '' + short_float( pct ) + '%';
+}
+function hash_to_query(hash) {
+var str = '';
+for (var key in hash) {
+if (str.length > 0) str += '&';
+str += key + '=' + escape(hash[key]);
+}
+return str;
+}
+function get_text_from_seconds(sec, abbrev, no_secondary) {
+var neg = '';
+sec = parseInt(sec, 10);
+if (sec<0) { sec =- sec; neg = '-'; }
+var p_text = abbrev ? "sec" : "second";
+var p_amt = sec;
+var s_text = "";
+var s_amt = 0;
+if (sec > 59) {
+var min = parseInt(sec / 60, 10);
+sec = sec % 60;
+s_text = abbrev ? "sec" : "second";
+s_amt = sec;
+p_text = abbrev ? "min" : "minute";
+p_amt = min;
+if (min > 59) {
+var hour = parseInt(min / 60, 10);
+min = min % 60;
+s_text = abbrev ? "min" : "minute";
+s_amt = min;
+p_text = abbrev ? "hr" : "hour";
+p_amt = hour;
+if (hour > 23) {
+var day = parseInt(hour / 24, 10);
+hour = hour % 24;
+s_text = abbrev ? "hr" : "hour";
+s_amt = hour;
+p_text = "day";
+p_amt = day;
+if (day > 29) {
+var month = parseInt(day / 30, 10);
+day = day % 30;
+s_text = "day";
+s_amt = day;
+p_text = abbrev ? "mon" : "month";
+p_amt = month;
+}
+}
+}
+}
+var text = p_amt + "&nbsp;" + p_text;
+if ((p_amt != 1) && !abbrev) text += "s";
+if (s_amt && !no_secondary) {
+text += ", " + s_amt + "&nbsp;" + s_text;
+if ((s_amt != 1) && !abbrev) text += "s";
+}
+return(neg + text);
+}
+function get_nice_remaining_time(epoch_start, epoch_now, counter, counter_max, abbrev) {
+if (counter == counter_max) return 'Complete';
+if (counter == 0) return 'n/a';
+var sec_remain = parseInt(((counter_max - counter) * (epoch_now - epoch_start)) / counter, 10);
+return get_text_from_seconds( sec_remain, abbrev );
+}
+function dumper(_obj, _max_levels, _indent) {
+if (typeof(_max_levels) == 'undefined') _max_levels = 0;
+var _text = '';
+if (!_indent) {
+if (typeof(_obj) == 'object' && typeof(_obj.length) != 'undefined') _text += "[\n";
+else _text += "{\n";
+_indent = 1;
+}
+var _indentStr = '';
+for (var _k=0; _k<_indent; _k++) _indentStr += "\t";
+if (typeof(_obj) == 'object' && typeof(_obj.length) != 'undefined') {
+for (var _a = 0; _a < _obj.length; _a++) {
+if (typeof(_obj[_a]) != 'function') {
+if (typeof(_obj.length) != 'undefined') _text += _indentStr;
+else _text += _indentStr + _a + ": ";
+if (typeof(_obj[_a]) == 'object') {
+if (_obj[_a] == null) {
+_text += "null,\n";
+}
+else if (typeof(_obj[_a].length) != 'undefined') {
+if (_max_levels) _text += "[\n" + dumper( _obj[_a], _max_levels - 1, _indent + 1 ) + _indentStr + "],\n";
+else _text += "[...],\n";
+}
+else {
+if (_max_levels) _text += "{\n" + dumper( _obj[_a], _max_levels - 1, _indent + 1 ) + _indentStr + "},\n";
+else _text += "{...},\n";
+}
+}
+else if (typeof(_obj[_a]) == 'number') _text += _obj[_a] + ",\n";
+else _text += '"' + _obj[_a] + '",' + "\n";
+}
+}
+}
+else {
+for (var _a in _obj) {
+if (typeof(_obj[_a]) != 'function') {
+if (typeof(_obj.length) != 'undefined') _text += _indentStr;
+else _text += _indentStr + _a + ": ";
+if (typeof(_obj[_a]) == 'object') {
+if (_obj[_a] == null) {
+_text += "null,\n";
+}
+else if (typeof(_obj[_a].length) != 'undefined') {
+if (_max_levels) _text += "[\n" + dumper( _obj[_a], _max_levels - 1, _indent + 1 ) + _indentStr + "],\n";
+else _text += "[...],\n";
+}
+else {
+if (_max_levels) _text += "{\n" + dumper( _obj[_a], _max_levels - 1, _indent + 1) + _indentStr + "},\n";
+else _text += "{...},\n";
+}
+}
+else if (typeof(_obj[_a]) == 'number') _text += _obj[_a] + ",\n";
+else _text += '"' + _obj[_a] + '",' + "\n";
+}
+}
+}
+if (_indent == 1) {
+if (typeof(_obj) == 'object' && typeof(_obj.length) != 'undefined') _text += "]\n";
+else _text += "}\n";
+}
+return _text;
+
+}
+function object_tree( title, obj, expanded ) {
+var html = '';
+var id = 's_' + get_unique_id();
+html += '<table cellspacing=0 cellpadding=0 onClick="toggle_section(\'' + id + '\')"><tr>';
+html += '<td style="padding:0px" width=16>' + section_control(id, expanded) + '</td>';
+html += '<td style="padding:0px" width=16>' + icon('folder') + '</td><td style="padding:0px" width=2>' + spacer(2,1) + '</td>';
+html += '<td style="padding:0px"><font class=section_title><nobr><font color=blue style="cursor:pointer"><b>'+title+'</b></font></nobr></font></td>';
+html += '</tr></table>';
+html += '<div id="'+id+'" style="display:' + (expanded ? 'block' : 'none') + '">';
+html += '<table cellspacing=0 cellpadding=0><tr><td style="padding:0px" width=16>&nbsp;</td><td style="padding:0px">';
+html += '<table>';
+var sorted_keys = hash_keys_to_array(obj).sort();
+for (var idx in sorted_keys) {
+var key = sorted_keys[idx];
+if (typeof(obj[key]) == 'object') {
+html += '<tr><td style="padding:0px">';
+html += object_tree( key, obj[key], 0 );
+html += '</td></tr>';
+}
+}
+for (var idx in sorted_keys) {
+var key = sorted_keys[idx];
+if (typeof(obj[key]) != 'object') {
+html += '<tr><td style="padding:0px">';
+html += '<table cellspacing=0 cellpadding=0><tr><td style="padding:0px" width=16>&nbsp;</td><td style="padding:0px">';
+html += icon( 'file', '<b>' + key.toString().replace(/^\W+/, "") + ':</b> ' + obj[key] );
+html += '</td></tr></table>';
+html += '</td></tr>';
+}
+}
+html += '</table>';
+html += '</td></tr></table>';
+html += '</div>';
+return html;
+}
+function this_hour() {
+var now = new Date();
+var then = new Date(
+now.getFullYear(),
+now.getMonth(),
+now.getDate(),
+now.getHours(),
+0, 0, 0 );
+return parseInt( then.getTime() / 1000, 10 );
+}
+function today_midnight() {
+var now = new Date();
+var then = new Date(
+now.getFullYear(),
+now.getMonth(),
+now.getDate(),
+0, 0, 0, 0 );
+return parseInt( then.getTime() / 1000, 10 );
+}
+function yesterday_midnight() {
+var midnight = today_midnight();
+var yesterday = new Date( (midnight - 1) * 1000 );
+var then = new Date(
+yesterday.getFullYear(),
+yesterday.getMonth(),
+yesterday.getDate(),
+0, 0, 0, 0 );
+return parseInt( then.getTime() / 1000, 10 );
+}
+function this_month_midnight() {
+var now = new Date();
+var then = new Date(
+now.getFullYear(),
+now.getMonth(),
+1, 0, 0, 0, 0 );
+return parseInt( then.getTime() / 1000, 10 );
+}
+function last_month_midnight() {
+var this_month = this_month_midnight();
+var last_month = new Date( (this_month - 1) * 1000 );
+var then = new Date(
+last_month.getFullYear(),
+last_month.getMonth(),
+1, 0, 0, 0, 0 );
+return parseInt( then.getTime() / 1000, 10 );
+}
+function get_date_args(epoch) {
+var date = new Date( epoch * 1000 );
+var args = {
+year: date.getFullYear(),
+mon: date.getMonth() + 1,
+mday: date.getDate(),
+hour: date.getHours(),
+min: date.getMinutes(),
+sec: date.getSeconds(),
+msec: date.getMilliseconds()
+};
+args.yyyy = args.year;
+if (args.mon < 10) args.mm = "0" + args.mon; else args.mm = args.mon;
+if (args.mday < 10) args.dd = "0" + args.mday; else args.dd = args.mday;
+if (args.hour < 10) args.hh = "0" + args.hour; else args.hh = args.hour;
+if (args.min < 10) args.mi = "0" + args.min; else args.mi = args.min;
+if (args.sec < 10) args.ss = "0" + args.sec; else args.ss = args.sec;
+if (args.hour >= 12) {
+args.ampm = 'pm';
+args.hour12 = args.hour - 12;
+if (!args.hour12) args.hour12 = 12;
+}
+else {
+args.ampm = 'am';
+args.hour12 = args.hour;
+if (!args.hour12) args.hour12 = 12;
+}
+return args;
+}
+function get_time_from_args(args) {
+var then = new Date(
+args.year,
+args.mon - 1,
+args.mday,
+args.hour,
+args.min,
+args.sec,
+0
+);
+return parseInt( then.getTime() / 1000, 10 );
+}
+function yyyy(epoch) {
+if (!epoch) epoch = time_now();
+var args = get_date_args(epoch);
+return args.year;
+}
+function yyyy_mm_dd(epoch) {
+if (!epoch) epoch = time_now();
+var args = get_date_args(epoch);
+return args.yyyy + '/' + args.mm + '/' + args.dd;
+}
+function normalize_time(epoch, zero_args) {
+var args = get_date_args(epoch);
+for (key in zero_args) args[key] = zero_args[key];
+if (!args['mday']) args['mday'] = 1;
+return get_time_from_args(args);
+}
+function find_iframe_doc(id) {
+var domObj = $(id);
+if (!domObj) return null;
+var doc = null;
+if (domObj.contentDocument) doc = domObj.contentDocument;
+else if (domObj.contentWindow) doc = domObj.contentWindow.document;
+else if (domObj.document) doc = eval(domObj.id+".document");
+return doc;
+}
+function rand_array(arr) {
+return arr[ parseInt(Math.random() * arr.length, 10) ];
+}
+function find_elem_idx(arr, elem) {
+for (var idx = 0, len = arr.length; idx < len; idx++) {
+if (arr[idx] == elem) return idx;
+}
+return -1;
+}
+function remove_from_array(arr, elem) {
+var idx = find_elem_idx(arr, elem);
+if (idx > -1) {
+array_splice( arr, idx, 1 );
+return 1;
+}
+return 0;
+}
+function remove_all_from_array(arr, elem) {
+var done = 0;
+var found = 0;
+while (!done) {
+var idx = find_elem_idx(arr, elem);
+if (idx > -1) { array_splice(arr, idx, 1); found++; }
+else { done = 1; }
+}
+return found;
+}
+function getInnerWindowSize(dom) {
+if (!dom) dom = window;
+var myWidth = 0, myHeight = 0;
+if( typeof( dom.innerWidth ) == 'number' ) {
+myWidth = dom.innerWidth;
+myHeight = dom.innerHeight;
+}
+else if( dom.document.documentElement && ( dom.document.documentElement.clientWidth || dom.document.documentElement.clientHeight ) ) {
+myWidth = dom.document.documentElement.clientWidth;
+myHeight = dom.document.documentElement.clientHeight;
+}
+else if( dom.document.body && ( dom.document.body.clientWidth || dom.document.body.clientHeight ) ) {
+myWidth = dom.document.body.clientWidth;
+myHeight = dom.document.body.clientHeight;
+}
+return { width: myWidth, height: myHeight };
+}
+function getScrollXY(dom) {
+if (!dom) dom = window;
+var scrOfX = 0, scrOfY = 0;
+if( typeof( dom.pageYOffset ) == 'number' ) {
+scrOfY = dom.pageYOffset;
+scrOfX = dom.pageXOffset;
+} else if( dom.document.body && ( dom.document.body.scrollLeft || dom.document.body.scrollTop ) ) {
+scrOfY = dom.document.body.scrollTop;
+scrOfX = dom.document.body.scrollLeft;
+} else if( dom.document.documentElement && ( dom.document.documentElement.scrollLeft || dom.document.documentElement.scrollTop ) ) {
+scrOfY = dom.document.documentElement.scrollTop;
+scrOfX = dom.document.documentElement.scrollLeft;
+}
+return { x: scrOfX, y: scrOfY };
+}
+function getScrollMax(dom) {
+if (!dom) dom = window;
+var myWidth = 0, myHeight = 0;
+if (dom.document.body.scrollHeight) {
+myWidth = dom.document.body.scrollWidth;
+myHeight = dom.document.body.scrollHeight;
+}
+else if (dom.document.documentElement.scrollHeight) {
+myWidth = dom.document.documentElement.scrollWidth;
+myHeight = dom.document.documentElement.scrollHeight;
+}
+return { width: myWidth, height: myHeight };
+}
+function safe_call(name, arg1, arg2, arg3) {
+if (window[name]) return window[name](arg1, arg2, arg3);
+else return null;
+}
+function hires_time_now() {
+var now = new Date();
+return ( now.getTime() / 1000 );
+}
+function fire_callback(callback) {
+var args = array_slice( arguments, 1 );
+if (isa_array(callback)) {
+var obj = callback[0];
+var func = callback[1];
+return obj[func].apply(obj, args);
+}
+else if (typeof(callback) == 'function') {
+return callback.apply(null, args);
+}
+else {
+return window[callback].apply(null, args);
+}
+}
+function fire_hook(name) {
+if (session.hooks[name]) {
+var args = array_slice(arguments, 1);
+array_unshift( args, session.hooks[name] );
+delete session.hooks[name];
+return fire_callback.apply(window, args);
+}
+return true;
+}
+function str_value(str) {
+if (typeof(str) == 'undefined') str = '';
+else if (str === null) str = '';
+return '' + str;
+}
+function pluralize(word, num) {
+if (num != 1) return word + 's'; else return word;
+}
+function get_menu_value(id) {
+var menu = $(id);
+if (!menu) return '';
+return menu.options[menu.selectedIndex].value;
+}
+function get_menu_text(id) {
+var menu = $(id);
+if (!menu) return '';
+return menu.options[menu.selectedIndex].text;
+}
+function set_menu_value(id, value, auto_add) {
+var menu = $(id);
+if (!menu) return false;
+for (var idx = 0, len = menu.options.length; idx < len; idx++) {
+if (menu.options[idx].value == value) {
+menu.selectedIndex = idx;
+return true;
+}
+}
+if (auto_add) {
+menu.options[menu.options.length] = new Option(value, value);
+menu.selectedIndex = menu.options.length - 1;
+return true;
+}
+return false;
+}
+function disable_menu(id) {
+var menu = $(id);
+if (!menu) return false;
+menu.disabled = true;
+menu.setAttribute( 'disabled', 'disabled' );
+}
+function enable_menu(id) {
+var menu = $(id);
+if (!menu) return false;
+menu.disabled = false;
+menu.setAttribute( 'disabled', '' );
+}
+function populate_menu(id, items, sel_value) {
+var menu = $(id);
+if (!menu) return false;
+menu.options.length = 0;
+for (var idx = 0, len = items.length; idx < len; idx++) {
+var item = items[idx];
+var item_name = isa_array(item) ? item[0] : item;
+var item_value = isa_array(item) ? item[1] : item;
+menu.options[ menu.options.length ] = new Option( item_name, item_value );
+if (item_value == sel_value) menu.selectedIndex = idx;
+}
+}
+function dirname(path) {
+return path.toString().replace(/\/$/, "").replace(/\/[^\/]+$/, "");
+}
+function basename(path) {
+return path.toString().replace(/\/$/, "").replace(/^(.*)\/([^\/]+)$/, "$2");
+}
+function strip_ext(path) {
+return path.toString().replace(/\.\w+$/, "");
+}
+function mm_dd_yyyy(epoch, ch) {
+if (!ch) ch = '/';
+var dargs = get_date_args(epoch);
+if (dargs.mon < 10) dargs.mon = '0' + dargs.mon;
+if (dargs.mday < 10) dargs.mday = '0' + dargs.mday;
+return dargs.year + ch + dargs.mon + ch + dargs.mday;
+}
+function get_nice_date(epoch, abbrev) {
+var dargs = get_date_args(epoch);
+var month = months[dargs.mon - 1][1];
+if (abbrev) month = month.substring(0, 3);
+return month + ' ' + dargs.mday + ', ' + dargs.year;
+}
+function get_nice_time(epoch, secs) {
+var dargs = get_date_args(epoch);
+if (dargs.min < 10) dargs.min = '0' + dargs.min;
+if (dargs.sec < 10) dargs.sec = '0' + dargs.sec;
+var output = dargs.hour12 + ':' + dargs.min;
+if (secs) output += ':' + dargs.sec;
+output += ' ' + dargs.ampm.toUpperCase();
+return output;
+}
+function get_nice_date_time(epoch, secs) {
+return get_nice_date(epoch) + ' ' + get_nice_time(epoch, secs);
+}
+function get_short_date_time(epoch) {
+return get_nice_date(epoch, true) + ' ' + get_nice_time(epoch, false);
+}
+function get_midnight(date) {
+var midnight = parseInt( date.getTime() / 1000, 10 );
+midnight -= (date.getHours() * 3600);
+midnight -= (date.getMinutes() * 60);
+midnight -= date.getSeconds();
+return midnight;
+}
+function get_relative_date(epoch, show_time) {
+var mydate;
+var now = new Date();
+var now_epoch = parseInt( now.getTime() / 1000, 10 );
+if (epoch) {
+mydate = new Date( epoch * 1000 );
+epoch = parseInt( epoch, 10 );
+}
+else {
+mydate = new Date();
+epoch = parseInt( mydate.getTime() / 1000, 10 );
+}
+var full_date_string = mydate.toLocaleString();
+var html = '<span title="'+full_date_string+'">';
+var mydate_midnight = get_midnight( mydate );
+var now_midnight = get_midnight( now );
+if (mydate_midnight > now_midnight) {
+var mm = mydate.getMonth() + 1;
+var dd = mydate.getDate();
+var yyyy = mydate.getFullYear();
+html += short_month_names[ mydate.getMonth() ] + ' ' + dd;
+if (yyyy != now.getFullYear()) html += ', ' + yyyy;
+}
+else if (mydate_midnight == now_midnight) {
+if (show_time) {
+if (now_epoch - epoch < 1) {
+html += 'Now';
+}
+else if (now_epoch - epoch < 60) {
+html += 'A Moment Ago';
+}
+else if (now_epoch - epoch < 3600) {
+var min = parseInt( (now_epoch - epoch) / 60, 10 );
+html += min + ' Minute';
+if (min != 1) html += 's';
+html += ' Ago';
+}
+else if (now_epoch - epoch <= 12 * 3600) {
+var hr = parseInt( (now_epoch - epoch) / 3600, 10 );
+html += hr + ' Hour';
+if (hr != 1) html += 's';
+html += ' Ago';
+}
+else {
+html += 'Earlier Today';
+if (show_time) html += ', ' + get_short_time(epoch);
+}
+}
+else html += 'Today';
+}
+else if (now_midnight - mydate_midnight == 86400) {
+html += 'Yesterday';
+if (show_time) html += ', ' + get_short_time(epoch);
+}
+else if ((now_midnight - mydate_midnight < 86400 * 7) && (mydate.getDay() < now.getDay())) {
+html += day_names[ mydate.getDay() ];
+if (show_time) html += ', ' + get_short_time(epoch);
+}
+else if ((mydate.getMonth() == now.getMonth()) && (mydate.getFullYear() == now.getFullYear())) {
+var mydate_sunday = mydate_midnight - (mydate.getDay() * 86400);
+var now_sunday = now_midnight - (now.getDay() * 86400);
+if (now_sunday - mydate_sunday == 86400 * 7) {
+html += 'Last ' + day_names[ mydate.getDay() ];
+}
+else if (now_sunday - mydate_sunday == 86400 * 14) {
+html += 'Two Weeks Ago';
+}
+else if (now_sunday - mydate_sunday == 86400 * 21) {
+html += 'Three Weeks Ago';
+}
+else {
+html += 'Four Weeks Ago';
+}
+}
+else {
+var mm = mydate.getMonth() + 1;
+var dd = mydate.getDate();
+var yyyy = mydate.getFullYear();
+html += short_month_names[ mydate.getMonth() ] + ' ' + dd;
+if (yyyy != now.getFullYear()) html += ', ' + yyyy;
+}
+html += '</span>';
+return html;
+}
+function get_short_time(epoch, show_msec) {
+var mydate;
+if (epoch) mydate = new Date( epoch * 1000 );
+else mydate = new Date();
+var ampm = 'AM';
+var hh = mydate.getHours();
+if (hh >= 12) { ampm = 'PM'; hh -=12; }
+if (hh == 0) hh = 12;
+var mi = mydate.getMinutes(); if (mi < 10) mi = "0" + mi;
+var ss = mydate.getSeconds(); if (ss < 10) ss = "0" + ss;
+var msec = mydate.getMilliseconds();
+if (msec < 10) msec = "00" + msec;
+else if (msec < 100) msec = "0" + msec;
+var str = hh+':'+mi;
+if (show_msec) str += ':'+ss+'.'+msec;
+str += '&nbsp;'+ampm;
+return str;
+}
+function load_script(url) {
+var scr = document.createElement('SCRIPT');
+scr.type = 'text/javascript';
+scr.src = url;
+document.getElementsByTagName('HEAD')[0].appendChild(scr);
+}
+function safe_query_add(url, str) {
+if (url.match(/\?/)) url += '&'; else url += '?';
+return url + str;
+}
+function trim(str) {
+return str.toString().replace(/^\s+/, "").replace(/\s+$/, "");
+}
+function compose_attribs(attribs) {
+var html = '';
+if (attribs) {
+for (var key in attribs) {
+html += " " + key + "=\"" + attribs[key] + "\"";
+}
+}
+return html;
+}
+function compose_style(attribs) {
+var html = '';
+if (attribs) {
+for (var key in attribs) {
+html += " " + key + ":" + attribs[key] + ";";
+}
+}
+return html;
+}
+function find_idx_in_array(arr, elem) {
+for (var idx = 0, len = arr.length; idx < len; idx++) {
+if (arr[idx] == elem) return idx;
+}
+return -1;
+}
+function find_in_array(arr, elem) {
+for (var idx = 0, len = arr.length; idx < len; idx++) {
+if (arr[idx] == elem) return true;
+}
+return false;
+}
+function delete_from_array(arr, elem) {
+var idx = find_idx_in_array(arr, elem);
+if (idx > -1) arr.splice(idx, 1);
+}
+function tiptext_field(id, class_name, attribs, style, value, tip) {
+var html = '';
+if (!attribs) attribs = {};
+if (!style) style = {};
+value = str_value(value);
+if (value.length == 0) {
+value = tip;
+if (class_name.length) class_name += ' ';
+class_name += 'tiptext_empty';
+}
+html += '<input type="text" class="'+class_name+'" id="'+id+'" style="'+compose_style(style)+'" value="'+escape_text_field_value(value)+'" title="'+tip+'" onBlur="tiptext_blur(this)" onFocus="tiptext_focus(this)" '+compose_attribs(attribs)+'>';
+return html;
+}
+function tiptext_focus(obj) {
+if (obj.value == obj.getAttribute('title')) obj.value = '';
+$(obj).removeClass('tiptext_empty');
+}
+function tiptext_blur(obj) {
+if (!obj.value.length) {
+obj.value = obj.getAttribute('title');
+$(obj).addClass('tiptext_empty');
+}
+else if (obj.value != obj.getAttribute('title')) {
+$(obj).removeClass('tiptext_empty');
+}
+}
+function tiptext_value(id) {
+var value = get_clean_field_value(id);
+if (value == $(id).getAttribute('title')) value = '';
+return value;
+}
+function tiptext_set(id, value) {
+var obj = $(id); if (!obj) return;
+value = str_value(value);
+if (value.length > 0) {
+tiptext_focus(obj);
+obj.value = value;
+}
+else {
+obj.value = '';
+tiptext_blur(obj);
+}
+}
+function get_clean_field_value(id) {
+return trim( $(id).value );
+}
+function validate_url(url) {
+
+return !!url.match(/^(https?\:\/\/)[\w\-\.\/]+(\?\S+)?$/);
+}
+function format_price_usd(value, show_usd) {
+var matches = value.toString().match(/^(\d+)\.(\d+)$/);
+if (matches) {
+if (matches[2].length < 2) matches[2] = '0' + matches[2];
+else if (matches[2].length > 2) matches[2] = matches[2].substring(0, 2);
+return '$' + commify(matches[1]) + '.' + matches[2] + (show_usd ? ' USD' : '');
+}
+else return '$' + commify(value) + '.00' + (show_usd ? ' USD' : '');
+}
+function pretty_print_csv(csv) {
+csv = str_value(csv);
+return csv.toString().replace(/\,(\S)/g, ", $1");
+}
+function blur_all_text_fields() {
+var fields = document.getElementsByTagName('input');
+for (var idx = 0, len = fields.length; idx < len; idx++) {
+var field = fields[idx];
+if (field.type == 'text') field.blur();
+}
+}
+function escape_text_field_value(text) {
+text = encode_attrib_entities( str_value(text) );
+if (ie && text.replace) text = text.replace(/\&apos\;/g, "'");
+return text;
+}
+function escape_textarea_value(text) {
+text = encode_entities( str_value(text) );
+if (ie && text.replace) text = text.replace(/\&apos\;/g, "'");
+return text;
+}
+function selectLine(input, lineNum) {
+lineNum--;
+var lines = input.value.split(/\n/);
+var before = '';
+for (var idx = 0, len = lines.length; idx < len; idx++) {
+if (idx == lineNum) idx = len;
+else before += lines[idx] + "\n";
+}
+setSelectionRange( input, before.length, before.length + lines[lineNum].length + 1 );
+}
+function selectAllText(input) {
+if (input.setSelectionRange) {
+input.focus();
+input.setSelectionRange(0, input.value.length);
+}
+else if (input.createTextRange) {
+var range = input.createTextRange();
+range.collapse(true);
+range.moveEnd('character', input.value.length);
+range.moveStart('character', 0);
+range.select();
+}
+return true;
+}
+function setSelectionRange(input, selectionStart, selectionEnd) {
+if (input.setSelectionRange) {
+input.focus();
+input.setSelectionRange(selectionStart, selectionEnd);
+}
+else if (input.createTextRange) {
+var range = input.createTextRange();
+range.collapse(true);
+range.moveEnd('character', selectionEnd);
+range.moveStart('character', selectionStart);
+range.select();
+}
+}
+function getSelectedText(input) {
+if (input.setSelectionRange) {
+return input.value.substring( input.selectionStart, input.selectionEnd );
+}
+else if (document.selection) {
+var range = document.selection.createRange();
+if (range.parentElement() == input) {
+return range.text;
+}
+}
+return '';
+}
+function indentSelectedText(input, direction) {
+if (input.setSelectionRange) {
+var selectionStart = input.selectionStart;
+var selectionEnd = input.selectionEnd;
+while ((selectionStart > 0) && (input.value.substring(selectionStart - 1, selectionStart) != "\n"))
+selectionStart--;
+while ((selectionEnd < input.value.length) && !input.value.substring(selectionEnd - 1, selectionEnd).match(/[\r\n]/))
+selectionEnd++;
+input.setSelectionRange( selectionStart, selectionEnd );
+input.focus();
+}
+var lines = getSelectedText(input).split(/\n/);
+var text = '';
+for (var idx = 0, len = lines.length; idx < len - 1; idx++) {
+var line = lines[idx];
+if (direction == 1) text += "\t" + line;
+else if (direction == -1) text += line.replace(/^(\t| {4})/, '');
+if (idx < len - 1) text += "\n";
+}
+replaceSelection(input, text);
+}
+function surroundSelection(input, left, right) {
+if (!right) right = left;
+var text = getSelectedText(input);
+replaceSelection(input, left + text + right);
+if (!text.length && input.setSelectionRange) {
+input.setSelectionRange(input.selectionStart - right.length, input.selectionEnd - right.length);
+}
+}
+function replaceSelection (input, replaceString) {
+var oldScroll = input.scrollTop;
+if (input.setSelectionRange) {
+var selectionStart = input.selectionStart;
+var selectionEnd = input.selectionEnd;
+input.value = input.value.substring(0, selectionStart)+ replaceString + input.value.substring(selectionEnd);
+if (selectionStart != selectionEnd){
+setSelectionRange(input, selectionStart, selectionStart + replaceString.length);
+}else{
+setSelectionRange(input, selectionStart + replaceString.length, selectionStart + replaceString.length);
+}
+}else if (document.selection) {
+var range = document.selection.createRange();
+if (range.parentElement() == input) {
+var isCollapsed = range.text == '';
+range.text = replaceString;
+if (!isCollapsed) {
+range.moveStart('character', -replaceString.length);
+range.select();
+}
+}
+}
+input.scrollTop = oldScroll;
+}
+function catchTab(item,e){
+var c = e.which ? e.which : e.keyCode;
+if (c == 9) {
+if (getSelectedText(item).length) {
+indentSelectedText(item, e.shiftKey ? -1 : 1);
+}
+else {
+replaceSelection(item, String.fromCharCode(9));
+}
+setTimeout("document.getElementById('"+item.id+"').focus();",0);
+return false;
+}
+}
+function count_chars(str, ch) {
+var count = 0;
+for (var idx = 0, len = str.length; idx < len; idx++) {
+if (str.substring(idx, idx + 1) == ch) count++;
+}
+return count;
+}
+function multiplex_str(ch, num) {
+var str = '';
+for (var idx = 0; idx < num; idx++) str += ch;
+return str;
+}
+function deep_copy_tree(obj) {
+var new_obj = null;
+if (typeof(obj.length) != 'undefined') {
+new_obj = [];
+for (var idx = 0, len = obj.length; idx < len; idx++) {
+if ((typeof(obj[idx]) == 'object') || (typeof(obj[idx]) == 'array')) new_obj[idx] = deep_copy_tree( obj[idx] );
+else new_obj[idx] = obj[idx];
+}
+}
+else {
+new_obj = {};
+for (var key in obj) {
+if ((typeof(obj[key]) == 'object') || (typeof(obj[key]) == 'array')) new_obj[key] = deep_copy_tree( obj[key] );
+else new_obj[key] = obj[key];
+}
+}
+return new_obj;
+}
+function strip_base_path(path, base) {
+if (!path || !base) return '';
+if (path.indexOf(base) == 0) path = path.substring( base.length );
+return path;
+}
+function parse_useragent(useragent) {
+if (!useragent) useragent = navigator.userAgent;
+useragent = '' + useragent;
+var os = 'Unknown';
+var browser = 'Unknown';
+useragent = useragent.replace(/\;\s+[\d\.]+\s+cache[\.\w]+(\:\d+)?\s+\(squid[^\)]+\)/, '');
+if (useragent.match(/SunOS/)) { os = 'SunOS'; }
+else if (useragent.match(/IRIX/)) { os = 'IRIX'; }
+else if (useragent.match(/Linux/)) { os = 'Linux'; }
+else if (useragent.match(/iPhone/)) { os = 'iPhone'; }
+else if (useragent.match(/Mac\s+OS\s+X\s+([\d\_]+)/)) { os = 'Mac OS X'; }
+else if (useragent.match(/(Mac\s+OS\s+X|Mac_PowerPC)/)) { os = 'Mac OS X'; }
+else if (useragent.match(/Mac/)) { os = 'Mac OS'; }
+else if (useragent.match(/Windows\s+CE/)) { os = 'Windows CE'; }
+else if (useragent.match(/(Windows\s+ME|Win\s9x)/)) { os = 'Windows Me'; }
+else if (useragent.match(/Win(95|98|NT)/)) { os = "Windows " + RegExp.RegExp.$1; }
+else if (useragent.match(/Win\D+([\d\.]+)/)) {
+var ver = RegExp.$1;
+if (ver.match(/95/)) { os = 'Windows 95'; }
+else if (ver.match(/98/)) { os = 'Windows 98'; }
+else if (ver.match(/4\.0/)) { os = 'Windows NT'; }
+else if (ver.match(/5\.0/)) { os = 'Windows 2000'; }
+else if (ver.match(/5\.[12]/)) {
+os = 'Windows XP';
+}
+else if (ver.match(/6.\d+/)) { os = 'Windows Vista'; }
+else if (ver.match(/7.\d+/)) { os = 'Windows 7'; }
+else if (useragent.match(/Windows\sNT/)) { os = 'Windows NT'; }
+}
+else if (useragent.match(/Windows\sNT/)) { os = 'Windows NT'; }
+else if (useragent.match(/PSP/)) { os = 'Sony PSP'; }
+else if (useragent.match(/WebTV/)) { os = 'Web TV'; }
+else if (useragent.match(/Palm/)) { os = 'Palm OS'; }
+else if (useragent.match(/Wii/)) { os = 'Nintendo Wii'; }
+else if (useragent.match(/Symbian/)) { os = 'Symbian OS'; }
+if (useragent.match(/Chrome\D+(\d+)/)) {
+browser = "Chrome " + RegExp.$1;
+}
+else if (useragent.match(/Safari\/((\d+)[\d\.]+)/)) {
+if (useragent.match(/Version\D+([\d]+)/)) {
+browser = "Safari " + RegExp.$1;
+}
+else {
+browser = 'Safari 2';
+}
+}
+else if (useragent.match(/iCab/)) { browser = 'iCab'; }
+else if (useragent.match(/OmniWeb/)) { browser = 'OmniWeb'; }
+else if (useragent.match(/Opera\D*(\d+)/)) { browser = "Opera " + RegExp.$1; }
+else if (useragent.match(/(Camino|Chimera)/)) { browser = 'Camino'; }
+else if (useragent.match(/Firefox\D*(\d+\.\d+)/)) { browser = "Firefox " + RegExp.$1; }
+else if (useragent.match(/Netscape\D*(\d+(\.\d+)?)/)) { browser = "Netscape " + RegExp.$1; }
+else if (useragent.match(/Gecko/)) { browser = 'Mozilla'; }
+else if (useragent.match(/America\s+Online\s+Browser\D+(\d+(\.\d+)?)/)) { browser = "AOL Explorer " + RegExp.$1; }
+else if (useragent.match(/PSP\D+(\d+(\.\d+)?)/)) { browser = "PSP " + RegExp.$1; }
+else if (useragent.match(/Lynx\D+(\d+(\.\d+)?)/)) { browser = "Lynx " + RegExp.$1; }
+else if (useragent.match(/Konqueror\D+(\d+(\.\d+)?)/)) { browser = "Konqueror " + RegExp.$1; }
+else if (useragent.match(/Blazer\D+(\d+(\.\d+)?)/)) { browser = "Blazer " + RegExp.$1; }
+else if (useragent.match(/MSIE\D+(\d+)/)) { browser = "Internet Explorer " + RegExp.$1; }
+else if (useragent.match(/Mozilla\/(4\.\d)/)) {
+var ver = RegExp.$1;
+if (ver != '4.0') { browser = "Netscape " + ver; }
+else { browser = "Mozilla"; }
+}
+else if (useragent.match(/Mozilla/)) { browser = "Mozilla"; }
+if ((os == 'Unknown') && (browser == 'Unknown') && useragent.match(/Flash\s+Player\s+([\d\.\,]+)/)) {
+os = 'Adobe';
+browser = 'Flash Player ' + RegExp.$1;
+}
+if ((os == 'Unknown') && (browser == 'Unknown')) {
+os = '';
+browser = useragent;
+}
+return { os: os, browser: browser };
+}
+function forceFloatString(value) {
+if (!value.toString().match(/^\d+\.\d+$/)) value = '' + value + '.0';
+return value;
+}
+function check_reserved_word(name) {
+return !name.toString().match(/^(break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|this|throw|try|typeof|var|void|while|with|type|interface|class)$/);
+}
+function get_next_key_seq(hash) {
+var largest = 0;
+for (var key in hash) {
+if (key.match(/^\d+$/)) {
+var num = parseInt(key, 10);
+if (num > largest) largest = num;
+}
+}
+return largest + 1;
+}
+function scroll_to_element(elem) {
+var elem = $(elem);
+if (elem) {
+var info = get_dom_object_info( $(elem) );
+if (info) window.scrollTo( 0, info.top );
+}
+}
+function get_user_client_info(str) {
+str = str.toString().replace( /\b10\.\d+\.\d+\.\d+\,\s*/, '' );
+var ip = '';
+if (str.match(/^(\d+\.\d+\.\d+\.\d+)\,\s*/)) {
+ip = RegExp.$1;
+str = str.replace( /^(\d+\.\d+\.\d+\.\d+)\,\s*/, '' );
+}
+str = str.toString().replace(/\;\s+[\d\.]+\s+cache[\.\w]+(\:\d+)?\s+\(squid[^\)]+\)/, '');
+var user_info = parse_useragent( str );
+user_info.ip = ip;
+return user_info;
+}
+window.EaseAlgos = {
+Linear: function(amount) { return amount; },
+Quadratic: function(amount) { return Math.pow(amount, 2); },
+Cubic: function(amount) { return Math.pow(amount, 3); },
+Quartetic: function(amount) { return Math.pow(amount, 4); },
+Quintic: function(amount) { return Math.pow(amount, 5); },
+Sine: function(amount) { return 1 - Math.sin((1 - amount) * Math.PI / 2); },
+Circular: function(amount) { return 1 - Math.sin(Math.acos(amount)); }
+};
+window.EaseModes = {
+EaseIn: function(amount, algo) { return window.EaseAlgos[algo](amount); },
+EaseOut: function(amount, algo) { return 1 - window.EaseAlgos[algo](1 - amount); },
+EaseInOut: function(amount, algo) {
+return (amount <= 0.5) ? window.EaseAlgos[algo](2 * amount) / 2 : (2 - window.EaseAlgos[algo](2 * (1 - amount))) / 2;
+}
+};
+function ease(amount, mode, algo) {
+return window.EaseModes[mode]( amount, algo );
+}
+function tweenFrame(start, end, amount, mode, algo) {
+return start + (ease(amount, mode, algo) * (end - start));
+}
+var indent_string = "\t";
+var xml_header = '<?xml version="1.0"?>';
+var sort_args = null;
+var re_valid_tag_name = /^\w[\w\-\:]*$/;
+function XML(args) {
+if (!args) args = '';
+if (isa_hash(args)) {
+for (var key in args) this[key] = args[key];
+}
+else this.text = args || '';
+this.tree = {};
+this.errors = [];
+this.piNodeList = [];
+this.dtdNodeList = [];
+this.documentNodeName = '';
+this.patTag.lastIndex = 0;
+if (this.text) this.parse();
+}
+XML.prototype.preserveAttributes = false;
+XML.prototype.patTag = /([^<]*?)<([^>]+)>/g;
+XML.prototype.patSpecialTag = /^\s*([\!\?])/;
+XML.prototype.patPITag = /^\s*\?/;
+XML.prototype.patCommentTag = /^\s*\!--/;
+XML.prototype.patDTDTag = /^\s*\!DOCTYPE/;
+XML.prototype.patCDATATag = /^\s*\!\s*\[\s*CDATA/;
+XML.prototype.patStandardTag = /^\s*(\/?)([\w\-\:\.]+)\s*(.*)$/;
+XML.prototype.patSelfClosing = /\/\s*$/;
+XML.prototype.patAttrib = new RegExp("([\\w\\-\\:\\.]+)\\s*=\\s*([\\\"\\'])([^\\2]*?)\\2", "g");
+XML.prototype.patPINode = /^\s*\?\s*([\w\-\:]+)\s*(.*)$/;
+XML.prototype.patEndComment = /--$/;
+XML.prototype.patNextClose = /([^>]*?)>/g;
+XML.prototype.patExternalDTDNode = new RegExp("^\\s*\\!DOCTYPE\\s+([\\w\\-\\:]+)\\s+(SYSTEM|PUBLIC)\\s+\\\"([^\\\"]+)\\\"");
+XML.prototype.patInlineDTDNode = /^\s*\!DOCTYPE\s+([\w\-\:]+)\s+\[/;
+XML.prototype.patEndDTD = /\]$/;
+XML.prototype.patDTDNode = /^\s*\!DOCTYPE\s+([\w\-\:]+)\s+\[(.*)\]/;
+XML.prototype.patEndCDATA = /\]\]$/;
+XML.prototype.patCDATANode = /^\s*\!\s*\[\s*CDATA\s*\[(.*)\]\]/;
+XML.prototype.attribsKey = '_Attribs';
+XML.prototype.dataKey = '_Data';
+XML.prototype.parse = function(branch, name) {
+if (!branch) branch = this.tree;
+if (!name) name = null;
+var foundClosing = false;
+var matches = null;
+while ( matches = this.patTag.exec(this.text) ) {
+var before = matches[1];
+var tag = matches[2];
+if (before.match(/\S/)) {
+if (typeof(branch[this.dataKey]) != 'undefined') branch[this.dataKey] += ' '; else branch[this.dataKey] = '';
+branch[this.dataKey] += trim(decode_entities(before));
+}
+if (tag.match(this.patSpecialTag)) {
+if (tag.match(this.patPITag)) tag = this.parsePINode(tag);
+else if (tag.match(this.patCommentTag)) tag = this.parseCommentNode(tag);
+else if (tag.match(this.patDTDTag)) tag = this.parseDTDNode(tag);
+else if (tag.match(this.patCDATATag)) {
+tag = this.parseCDATANode(tag);
+if (typeof(branch[this.dataKey]) != 'undefined') branch[this.dataKey] += ' '; else branch[this.dataKey] = '';
+branch[this.dataKey] += trim(decode_entities(tag));
+}
+else {
+this.throwParseError( "Malformed special tag", tag );
+break;
+}
+if (tag == null) break;
+continue;
+}
+else {
+var matches = tag.match(this.patStandardTag);
+if (!matches) {
+this.throwParseError( "Malformed tag", tag );
+break;
+}
+var closing = matches[1];
+var nodeName = matches[2];
+var attribsRaw = matches[3];
+if (closing) {
+if (nodeName == (name || '')) {
+foundClosing = 1;
+break;
+}
+else {
+this.throwParseError( "Mismatched closing tag (expected </" + name + ">)", tag );
+break;
+}
+}
+else {
+var selfClosing = !!attribsRaw.match(this.patSelfClosing);
+var leaf = {};
+var attribs = leaf;
+if (this.preserveAttributes) {
+leaf[this.attribsKey] = {};
+attribs = leaf[this.attribsKey];
+}
+this.patAttrib.lastIndex = 0;
+while ( matches = this.patAttrib.exec(attribsRaw) ) {
+attribs[ matches[1] ] = decode_entities( matches[3] );
+}
+if (this.preserveAttributes && !num_keys(attribs)) {
+delete leaf[this.attribsKey];
+}
+if (!selfClosing) {
+this.parse( leaf, nodeName );
+if (this.error()) break;
+}
+var num_leaf_keys = num_keys(leaf);
+if ((typeof(leaf[this.dataKey]) != 'undefined') && (num_leaf_keys == 1)) {
+leaf = leaf[this.dataKey];
+}
+else if (!num_leaf_keys) {
+leaf = '';
+}
+if (typeof(branch[nodeName]) != 'undefined') {
+if (isa_array(branch[nodeName])) {
+array_push( branch[nodeName], leaf );
+}
+else {
+var temp = branch[nodeName];
+branch[nodeName] = [ temp, leaf ];
+}
+}
+else {
+branch[nodeName] = leaf;
+}
+if (this.error() || (branch == this.tree)) break;
+}
+}
+}
+if (name && !foundClosing) {
+this.throwParseError( "Missing closing tag (expected </" + name + ">)", name );
+}
+if (branch == this.tree) {
+if (typeof(this.tree[this.dataKey]) != 'undefined') delete this.tree[this.dataKey];
+if (num_keys(this.tree) > 1) {
+this.throwParseError( 'Only one top-level node is allowed in document', first_key(this.tree) );
+return;
+}
+this.documentNodeName = first_key(this.tree);
+if (this.documentNodeName) {
+this.tree = this.tree[this.documentNodeName];
+}
+}
+};
+XML.prototype.throwParseError = function(key, tag) {
+var parsedSource = this.text.substring(0, this.patTag.lastIndex);
+var eolMatch = parsedSource.match(/\n/g);
+var lineNum = (eolMatch ? eolMatch.length : 0) + 1;
+lineNum -= tag.match(/\n/) ? tag.match(/\n/g).length : 0;
+array_push(this.errors, {
+type: 'Parse',
+key: key,
+text: '<' + tag + '>',
+line: lineNum
+});
+};
+XML.prototype.error = function() {
+return this.errors.length;
+};
+XML.prototype.getError = function(error) {
+var text = '';
+if (!error) return '';
+text = (error.type || 'General') + ' Error';
+if (error.code) text += ' ' + error.code;
+text += ': ' + error.key;
+if (error.line) text += ' on line ' + error.line;
+if (error.text) text += ': ' + error.text;
+return text;
+};
+XML.prototype.getLastError = function() {
+if (!this.error()) return '';
+return this.getError( this.errors[this.errors.length - 1] );
+};
+XML.prototype.parsePINode = function(tag) {
+if (!tag.match(this.patPINode)) {
+this.throwParseError( "Malformed processor instruction", tag );
+return null;
+}
+array_push( this.piNodeList, tag );
+return tag;
+};
+XML.prototype.parseCommentNode = function(tag) {
+var matches = null;
+this.patNextClose.lastIndex = this.patTag.lastIndex;
+while (!tag.match(this.patEndComment)) {
+if (matches = this.patNextClose.exec(this.text)) {
+tag += '>' + matches[1];
+}
+else {
+this.throwParseError( "Unclosed comment tag", tag );
+return null;
+}
+}
+this.patTag.lastIndex = this.patNextClose.lastIndex;
+return tag;
+};
+XML.prototype.parseDTDNode = function(tag) {
+var matches = null;
+if (tag.match(this.patExternalDTDNode)) {
+array_push( this.dtdNodeList, tag );
+}
+else if (tag.match(this.patInlineDTDNode)) {
+this.patNextClose.lastIndex = this.patTag.lastIndex;
+while (!tag.match(this.patEndDTD)) {
+if (matches = this.patNextClose.exec(this.text)) {
+tag += '>' + matches[1];
+}
+else {
+this.throwParseError( "Unclosed DTD tag", tag );
+return null;
+}
+}
+this.patTag.lastIndex = this.patNextClose.lastIndex;
+if (tag.match(this.patDTDNode)) {
+array_push( this.dtdNodeList, tag );
+}
+else {
+this.throwParseError( "Malformed DTD tag", tag );
+return null;
+}
+}
+else {
+this.throwParseError( "Malformed DTD tag", tag );
+return null;
+}
+return tag;
+};
+XML.prototype.parseCDATANode = function(tag) {
+var matches = null;
+this.patNextClose.lastIndex = this.patTag.lastIndex;
+while (!tag.match(this.patEndCDATA)) {
+if (matches = this.patNextClose.exec(this.text)) {
+tag += '>' + matches[1];
+}
+else {
+this.throwParseError( "Unclosed CDATA tag", tag );
+return null;
+}
+}
+this.patTag.lastIndex = this.patNextClose.lastIndex;
+if (matches = tag.match(this.patCDATANode)) {
+return matches[1];
+}
+else {
+this.throwParseError( "Malformed CDATA tag", tag );
+return null;
+}
+};
+XML.prototype.getTree = function() {
+return this.tree;
+};
+XML.prototype.compose = function() {
+var raw = compose_xml( this.documentNodeName, this.tree );
+var body = raw.substring( raw.indexOf("\n") + 1, raw.length );
+var xml = '';
+if (this.piNodeList.length) {
+for (var idx = 0, len = this.piNodeList.length; idx < len; idx++) {
+xml += '<' + this.piNodeList[idx] + '>' + "\n";
+}
+}
+else {
+xml += xml_header + "\n";
+}
+if (this.dtdNodeList.length) {
+for (var idx = 0, len = this.dtdNodeList.length; idx < len; idx++) {
+xml += '<' + this.dtdNodeList[idx] + '>' + "\n";
+}
+}
+xml += body;
+return xml;
+};
+function parse_xml(text) {
+var parser = new XML(text);
+return parser.error() ? parser.getLastError() : parser.getTree();
+}
+function trim(text) {
+if (text == null) return '';
+if (text && text.replace) {
+text = text.replace(/^\s+/, "");
+text = text.replace(/\s+$/, "");
+}
+return text;
+}
+function encode_entities(text) {
+if (text == null) return '';
+if (text && text.replace) {
+text = text.replace(/\&/g, "&amp;");
+text = text.replace(/</g, "&lt;");
+text = text.replace(/>/g, "&gt;");
+}
+return text;
+}
+function encode_attrib_entities(text) {
+if (text == null) return '';
+if (text && text.replace) {
+text = text.replace(/\&/g, "&amp;");
+text = text.replace(/</g, "&lt;");
+text = text.replace(/>/g, "&gt;");
+text = text.replace(/\"/g, "&quot;");
+text = text.replace(/\'/g, "&apos;");
+}
+return text;
+}
+function decode_entities(text) {
+if (text == null) return '';
+if (text && text.replace) {
+text = text.replace(/\&lt\;/g, "<");
+text = text.replace(/\&gt\;/g, ">");
+text = text.replace(/\&quot\;/g, '"');
+text = text.replace(/\&apos\;/g, "'");
+text = text.replace(/\&amp\;/g, "&");
+}
+return text;
+}
+function compose_xml(name, node, indent) {
+var xml = "";
+if (!indent) {
+indent = 0;
+xml = xml_header + "\n";
+}
+var indent_text = "";
+for (var k = 0; k < indent; k++) indent_text += indent_string;
+if ((typeof(node) == 'object') && (node != null)) {
+if (!node.length) {
+xml += indent_text + "<" + name;
+var num_keys = 0;
+var has_attribs = 0;
+for (var key in node) num_keys++;
+if (node["_Attribs"]) {
+has_attribs = 1;
+var sorted_keys = hash_keys_to_array(node["_Attribs"]).sort();
+for (var idx = 0, len = sorted_keys.length; idx < len; idx++) {
+var key = sorted_keys[idx];
+xml += " " + key + "=\"" + encode_attrib_entities(node["_Attribs"][key]) + "\"";
+}
+}
+if (num_keys > has_attribs) {
+xml += ">";
+if (node["_Data"]) {
+xml += encode_entities(node["_Data"]) + "</" + name + ">\n";
+}
+else {
+xml += "\n";
+var sorted_keys = hash_keys_to_array(node).sort();
+for (var idx = 0, len = sorted_keys.length; idx < len; idx++) {
+var key = sorted_keys[idx];
+if ((key != "_Attribs") && key.match(re_valid_tag_name)) {
+xml += compose_xml( key, node[key], indent + 1 );
+}
+}
+xml += indent_text + "</" + name + ">\n";
+}
+}
+else {
+xml += "/>\n";
+}
+}
+else {
+for (var idx = 0; idx < node.length; idx++) {
+xml += compose_xml( name, node[idx], indent );
+}
+}
+}
+else {
+xml += indent_text + "<" + name + ">" + encode_entities(node) + "</" + name + ">\n";
+}
+return xml;
+}
+function find_object(obj, criteria) {
+var criteria_length = 0;
+for (var a in criteria) criteria_length++;
+obj = always_array(obj);
+for (var a = 0; a < obj.length; a++) {
+var matches = 0;
+for (var b in criteria) {
+if (obj[a][b] && (obj[a][b] == criteria[b])) matches++;
+else if (obj[a]["_Attribs"] && obj[a]["_Attribs"][b] && (obj[a]["_Attribs"][b] == criteria[b])) matches++;
+}
+if (matches >= criteria_length) return obj[a];
+}
+return null;
+}
+function find_objects(obj, criteria) {
+var objs = new Array();
+var criteria_length = 0;
+for (var a in criteria) criteria_length++;
+obj = always_array(obj);
+for (var a = 0; a < obj.length; a++) {
+var matches = 0;
+for (var b in criteria) {
+if (obj[a][b] && obj[a][b] == criteria[b]) matches++;
+else if (obj[a]["_Attribs"] && obj[a]["_Attribs"][b] && (obj[a]["_Attribs"][b] == criteria[b])) matches++;
+}
+if (matches >= criteria_length) array_push( objs, obj[a] );
+}
+return objs;
+}
+function find_object_idx(obj, criteria) {
+var criteria_length = 0;
+for (var a in criteria) criteria_length++;
+obj = always_array(obj);
+for (var idx = 0; idx < obj.length; idx++) {
+var matches = 0;
+for (var b in criteria) {
+if (obj[idx][b] && (obj[idx][b] == criteria[b])) matches++;
+else if (obj[idx]["_Attribs"] && obj[idx]["_Attribs"][b] && (obj[idx]["_Attribs"][b] == criteria[b])) matches++;
+}
+if (matches >= criteria_length) return idx;
+}
+return -1;
+}
+function delete_object(obj, criteria) {
+var idx = find_object_idx(obj, criteria);
+if (idx > -1) {
+array_splice( obj, idx, 1 );
+return true;
+}
+return false;
+}
+function delete_objects(obj, criteria) {
+while (delete_object(obj, criteria)) ;
+}
+function insert_object_before(obj, criteria, insert) {
+var idx = find_object_idx(obj, criteria);
+if (idx > -1) {
+array_splice( obj, idx, 0, insert );
+return true;
+}
+return false;
+}
+function always_array(obj, key) {
+if (key) {
+if ((typeof(obj[key]) != 'object') || (typeof(obj[key].length) == 'undefined')) {
+var temp = obj[key];
+delete obj[key];
+obj[key] = new Array();
+obj[key][0] = temp;
+}
+return null;
+}
+else {
+if ((typeof(obj) != 'object') || (typeof(obj.length) == 'undefined')) { return [ obj ]; }
+else return obj;
+}
+}
+function hash_keys_to_array(hash) {
+var array = [];
+for (var key in hash) array_push(array, key);
+return array;
+}
+function encode_object(obj) {
+for (var idx = 1; idx < arguments.length; idx++) obj = merge_objects(obj, arguments[idx]);
+var stream = serialize(obj);
+return "decode_object('" + escape(stream) + "')";
+}
+function decode_object(stream) {
+var a;
+return eval( 'a=' + unescape(stream) );
+}
+function serialize(thingy, glue) {
+if (!glue) glue = ':';
+var stream = '';
+if (typeof(thingy) == 'number') {
+stream += thingy;
+}
+else if (typeof(thingy) == 'string') {
+stream += '"' + thingy.replace(/([\"\\])/g, '\\$1').replace(/\r/g, "\\r").replace(/\n/g, "\\n") + '"';
+}
+else if (isa_hash(thingy)) {
+var num = 0;
+var buffer = [];
+for (var key in thingy) {
+buffer[num] = (key.match(/^[A-Za-z]\w*$/) ? key : ('"'+key+'"')) + glue + serialize(thingy[key], glue);
+num++;
+}
+stream += '{' + buffer.join(',') + '}';
+}
+else if (isa_array(thingy)) {
+var buffer = [];
+for (var idx = 0, len = thingy.length; idx < len; idx++) {
+buffer[idx] = serialize(thingy[idx], glue);
+}
+stream += '[' + buffer.join(',') + ']';
+}
+else {
+stream += '0';
+}
+return stream;
+}
+function ue(str) {
+return unescape(str);
+}
+function custom_sort(a, b) {
+var value_a = a[ sort_args.sort_by ];
+if (!value_a && a["_Attribs"]) value_a = a["_Attribs"][ sort_args.sort_by ];
+var value_b = b[ sort_args.sort_by ];
+if (!value_b && b["_Attribs"]) value_b = b["_Attribs"][ sort_args.sort_by ];
+var cmp = (value_b < value_a) ? 1 : -1;
+return cmp * sort_args.sort_dir;
+}
+function sort_array(obj, args) {
+var list = always_array(obj);
+sort_args = args;
+return list.sort( custom_sort );
+}
+function merge_objects(a, b) {
+if (!a) a = {};
+if (!b) b = {};
+var c = {};
+if (typeof(a) != 'object') eval( "a = " + a );
+if (typeof(b) != 'object') eval( "b = " + b );
+for (var key in a) c[key] = a[key];
+for (var key in b) c[key] = b[key];
+return c;
+}
+function copy_object(obj) {
+var new_obj = {};
+for (var key in obj) new_obj[key] = obj[key];
+return new_obj;
+}
+function deep_copy_object(obj) {
+if (isa_hash(obj)) {
+var new_obj = {};
+for (var key in obj) {
+if (isa_hash(obj[key]) || isa_array(obj[key]))
+new_obj[key] = deep_copy_object(obj[key]);
+else
+new_obj[key] = obj[key];
+}
+return new_obj;
+}
+else if (isa_array(obj)) {
+var new_obj = [];
+for (var idx = 0, len = obj.length; idx < len; idx++) {
+if (isa_hash(obj[idx]) || isa_array(obj[idx]))
+new_obj[idx] = deep_copy_object(obj[idx]);
+else
+new_obj[idx] = obj[idx];
+}
+return new_obj;
+}
+return null;
+}
+function deep_copy_object_lc_keys(obj) {
+var new_obj = {};
+if (obj.length) new_obj = [];
+for (var key in obj) {
+var lc_key = key.toLowerCase ? key.toLowerCase() : key;
+if (typeof(obj[key]) == 'object') new_obj[lc_key] = deep_copy_object_lc_keys( obj[key] );
+else new_obj[lc_key] = obj[key];
+}
+return new_obj;
+}
+function copy_into_object(a, b) {
+for (var key in b) a[key] = b[key];
+}
+function deep_copy_into_object(a, b) {
+for (var key in b) {
+if (typeof(b[key]) == 'object') {
+if (typeof(a[key]) == 'undefined') {
+if (b[key].length) a[key] = []; else a[key] = {};
+}
+deep_copy_into_object( a[key], b[key] );
+}
+else a[key] = b[key];
+}
+}
+function num_keys(hash) {
+var count = 0;
+for (var a in hash) count++;
+return count;
+}
+function deep_diff_object(a, b) {
+if ((typeof(a) != 'object') && (typeof(a) != 'array')) {
+if (typeof(a) == 'string') {
+a = a.replace(/\r\n/g, "\n");
+a = a.replace(/\r/g, "\n");
+}
+if (typeof(b) == 'string') {
+b = b.replace(/\r\n/g, "\n");
+b = b.replace(/\r/g, "\n");
+}
+if (a != b) return 1;
+else return 0;
+}
+if (typeof(a) != typeof(b)) return 1;
+if (typeof(a.length) == 'undefined') {
+if (num_keys(a) != num_keys(b)) return 1;
+for (var akey in a) {
+if (typeof(b[akey]) == 'undefined') return 1;
+if (deep_diff_object( a[akey], b[akey] )) return 1;
+}
+for (var bkey in b) {
+if (typeof(a[bkey]) == 'undefined') return 1;
+}
+}
+else {
+if (a.length != b.length) return 1;
+for (var idx = 0; idx < a.length; idx++) {
+if (deep_diff_object( a[idx], b[idx] )) return 1;
+}
+}
+return 0;
+}
+function lookup_path(path, obj) {
+path = path.replace(/\/$/, "");
+while (/\/[^\/]+/.test(path) && (typeof(obj) == 'object')) {
+var slash = path.indexOf('/');
+path = path.substring( slash + 1 );
+slash = path.indexOf('/');
+if (slash == -1) slash = path.length;
+var name = path.substring(0, slash);
+if (typeof(obj.length) == 'undefined') {
+if (typeof(obj[name]) != 'undefined') obj = obj[name];
+else return null;
+}
+else {
+var idx = parseInt(name, 10);
+if (isNaN(idx)) return null;
+if (typeof(obj[idx]) != 'undefined') obj = obj[idx];
+else return null;
+}
+}
+return obj;
+}
+function set_path_value(path, obj, value) {
+path = path.replace(/\/$/, "");
+var final_slash = path.lastIndexOf('/');
+var final_name = path.substring( final_slash + 1, path.length );
+path = path.substring( 0, final_slash );
+while (/\/[^\/]+/.test(path)) {
+var slash = path.indexOf('/');
+path = path.substring( slash + 1 );
+slash = path.indexOf('/');
+if (slash == -1) slash = path.length;
+var name = path.substring(0, slash);
+if (typeof(obj.length) == 'undefined') {
+if (!isa_hash(obj[name])) obj[name] = {};
+obj = obj[name];
+}
+else {
+var idx = parseInt(name, 10);
+if (isNaN(idx)) return null;
+if (typeof(obj[idx]) != 'undefined') obj[idx] = {};
+obj = obj[idx];
+}
+}
+obj[final_name] = value;
+}
+function delete_path_value(path, obj) {
+path = path.replace(/\/$/, "");
+var final_slash = path.lastIndexOf('/');
+var final_name = path.substring( final_slash + 1, path.length );
+path = path.substring( 0, final_slash );
+while (/\/[^\/]+/.test(path) && (typeof(obj) == 'object')) {
+var slash = path.indexOf('/');
+path = path.substring( slash + 1 );
+slash = path.indexOf('/');
+if (slash == -1) slash = path.length;
+var name = path.substring(0, slash);
+if (typeof(obj.length) == 'undefined') {
+if (typeof(obj[name]) != 'undefined') obj = obj[name];
+else return null;
+}
+else {
+var idx = parseInt(name, 10);
+if (isNaN(idx)) return null;
+if (typeof(obj[idx]) != 'undefined') obj = obj[idx];
+else return null;
+}
+}
+delete obj[final_name];
+return true;
+}
+function set_all(obj, args) {
+for (var idx = 0; idx < obj.length; idx++) {
+for (var a in args) {
+obj[idx][a] = args[a];
+}
+}
+}
+function delete_all(obj, key) {
+for (var idx = 0; idx < obj.length; idx++) {
+if (typeof(obj[idx][key]) != 'undefined') delete obj[idx][key];
+}
+}
+function compose_attribs(attribs) {
+var html = '';
+if (attribs) {
+for (var key in attribs) {
+html += " " + key + "=\"" + attribs[key] + "\"";
+}
+}
+return html;
+}
+function compose_style(attribs) {
+var html = '';
+if (attribs) {
+for (var key in attribs) {
+html += " " + key + ":" + attribs[key] + ";";
+}
+}
+return html;
+}
+function isa_hash(arg) {
+return( !!arg && (typeof(arg) == 'object') && (typeof(arg.length) == 'undefined') );
+}
+function isa_array(arg) {
+if (typeof(arg) == 'array') return true;
+return( !!arg && (typeof(arg) == 'object') && (typeof(arg.length) != 'undefined') );
+}
+function first_key(hash) {
+for (var key in hash) return key;
+return null;
+}
+function xml_index_by( xml, element, key, recursive, compress ) {
+if (!xml || !key || !element) return 0;
+if (isa_hash(xml) && isa_hash(xml[element]) && xml[element][key])
+always_array( xml, element );
+if (isa_hash(xml) && isa_array(xml[element])) {
+var reindex = 0;
+for (var idx = xml[element].length - 1; idx >= 0; idx--) {
+var elem = xml[element][idx];
+if (elem[key]) {
+reindex = 1;
+var new_name = elem[key];
+delete elem[key];
+if (compress && (num_keys(elem) == 1) && (typeof(elem[ first_key(elem) ]) != 'object')) {
+elem = elem[ first_key(elem) ];
+}
+if (typeof(xml[new_name]) != 'undefined') {
+always_array( xml, new_name );
+array_unshift( xml[new_name], elem );
+}
+else {
+xml[new_name] = elem;
+}
+}
+}
+if (reindex) {
+delete xml[element];
+}
+}
+if (recursive) {
+if (xml && (typeof(xml) == 'object')) {
+if (typeof(xml.length) != 'undefined') {
+for (var idx = 0; idx < xml.length; idx++) {
+xml_index_by( xml[idx], element, key, recursive, compress );
+}
+}
+else {
+for (var key in xml) {
+xml_index_by( xml[key], element, key, recursive, compress );
+}
+}
+}
+}
+}
+function expand_parameter_nodes(tree) {
+xml_index_by( tree, 'ParameterGroup', 'Name', true, false );
+xml_index_by( tree, 'Parameter', 'Name', true, true );
+}
+function make_parameter_nodes(tree, max_levels) {
+var out = {};
+if (typeof(max_levels) == 'undefined') { max_levels = -1; }
+if (!max_levels) { return {}; }
+for (var key in tree) {
+if (isa_hash(tree[key])) {
+var node_group = merge_objects({ "_Attribs": { Name: key } },
+make_parameter_nodes(tree[key], max_levels - 1) );
+if (out['ParameterGroup']) {
+if (isa_array(out['ParameterGroup'])) {
+array_push( out['ParameterGroup'], node_group );
+}
+else {
+out['ParameterGroup'] = [ out['ParameterGroup'], node_group ];
+}
+}
+else {
+out['ParameterGroup'] = node_group;
+}
+}
+else if (isa_array(tree[key])) {
+for (var idx = 0; idx < tree[key].length; idx++) {
+var elem = tree[key][idx];
+if (isa_hash(elem)) {
+var node_group = merge_objects({ "_Attribs": { Name: key } },
+make_parameter_nodes(elem, max_levels - 1) );
+if (out['ParameterGroup']) {
+if (isa_array(out['ParameterGroup'])) {
+array_push( out['ParameterGroup'], node_group );
+}
+else {
+out['ParameterGroup'] = [ out['ParameterGroup'], node_group ];
+}
+}
+else {
+out['ParameterGroup'] = node_group;
+}
+}
+else {
+var node = { "_Attribs": { Name: key } };
+if (/[\n\"]/.test(elem)) {
+node['content'] = elem;
+}
+else {
+node['_Attribs']['Value'] = elem;
+}
+if (out['Parameter']) {
+if (isa_array(out['Parameter'])) {
+array_push( out['Parameter'], node );
+}
+else {
+out['Parameter'] = [ out['Parameter'], node ];
+}
+}
+else {
+out['Parameter'] = node;
+}
+}
+}
+}
+else {
+var node = { "_Attribs": { Name: key } };
+if (/[\n\"]/.test(tree[key])) {
+node['content'] = tree[key];
+}
+else {
+node['_Attribs']['Value'] = tree[key];
+}
+if (out['Parameter']) {
+if (isa_array(out['Parameter'])) {
+array_push( out['Parameter'], node );
+}
+else {
+out['Parameter'] = [ out['Parameter'], node ];
+}
+}
+else {
+out['Parameter'] = node;
+}
+}
+}
+return out;
+}
+function xpath_summary(xml, base_path) {
+if (!base_path) base_path = '/';
+var paths = {};
+if (isa_hash(xml)) {
+for (var key in xml) {
+if (typeof(xml[key]) == 'object') paths = merge_objects(paths, xpath_summary(xml[key], base_path + key + '/'));
+else paths[base_path + key] = xml[key];
+}
+}
+else if (isa_array(xml)) {
+for (var idx = 0, len = xml.length; idx < len; idx++) {
+if (typeof(xml[idx]) == 'object') paths = merge_objects(paths, xpath_summary(xml[idx], base_path.replace(/\/$/, '') + '[' + idx + ']/'));
+else paths[ base_path.replace(/\/$/, '') + '[' + idx + ']'] = xml[idx];
+}
+}
+return paths;
+}
+function array_push(array, item) {
+array[ array.length ] = item;
+}
+function array_pop(array) {
+if (array.length > 0) {
+var temp = array[ array.length - 1 ];
+delete array[ array.length - 1 ];
+array.length--;
+return temp;
+}
+else return null;
+}
+function array_unshift(array, item) {
+if (array.length > 0) {
+for (var idx = array.length - 1; idx >= 0; idx--) {
+array[idx + 1] = array[idx];
+}
+}
+array[0] = item;
+}
+function array_shift(array) {
+if (array.length > 0) {
+var temp = array[0];
+if (array.length > 1) {
+for (var idx = 0; idx < array.length - 1; idx++) {
+array[idx] = array[idx + 1];
+}
+}
+array_pop(array);
+return temp;
+}
+else return null;
+}
+function array_splice(array, pos, del_count, item) {
+var spliced = [];
+while (del_count) {
+array_push(spliced, array[pos]);
+if (array.length > pos + 1) {
+for (var idx = pos; idx < array.length - 1; idx++) {
+array[idx] = array[idx + 1];
+}
+}
+array_pop(array);
+del_count--;
+}
+if (typeof(item) != 'undefined') {
+for (var idx = array.length - 1; idx >= pos; idx--) {
+array[idx + 1] = array[idx];
+}
+array[pos] = item;
+}
+return spliced;
+}
+function array_slice(array, start, end) {
+if (!end) end = array.length;
+var slice = [];
+for (var idx = start; idx < end; idx++) {
+if (idx < array.length) array_push( slice, array[idx] );
+}
+return slice;
+}
+function array_combine(a, b) {
+var c = [];
+for (var idx = 0; idx < a.length; idx++) array_push( c, a[idx] );
+for (var idx = 0; idx < b.length; idx++) array_push( c, b[idx] );
+return c;
+}
+function array_cat(a, b) {
+for (var idx = 0; idx < b.length; idx++) array_push( a, b[idx] );
+}
+function array_join(arr, glue) {
+var str = '';
+for (var idx = 0, len = arr.length; idx < len; idx++) {
+if (idx > 0) str += glue;
+str += arr[idx];
+}
+return str;
+}
+if (!window.Ajax) window.Ajax = {};
+Ajax.Connection = function() {
+this._inUse = false;
+this._conn = null;
+this._xProgIds = [
+'MSXML2.XMLHTTP.3.0',
+'MSXML2.XMLHTTP',
+'Microsoft.XMLHTTP'
+];
+try {
+this._conn = new XMLHttpRequest();
+}
+catch (e) {
+for (var idx = 0; idx < this._xProgIds.length; idx++) {
+try {
+this._conn = new ActiveXObject( this._xProgIds[idx] );
+break;
+}
+catch (e) {}
+}
+}
+};
+Ajax.Connection.prototype._socketTimeout = 30 * 1000;
+Ajax.Connection.prototype.send = function(tx) {
+this.tx = tx;
+if (!this._conn) {
+this.tx.response.code = 500;
+this.tx.response.data = "Could not create XMLHTTP object";
+this.tx._notifyComplete();
+return;
+}
+if (this.tx.request.url.toLowerCase().match(/^(\w+)\:\/\/([\w\-\.]+)/)) {
+if ((RegExp.$1 != 'file') && (RegExp.$2.toLowerCase() != location.hostname.toLowerCase())) {
+this.tx.response.code = 501;
+this.tx.response.data = "Cannot perform cross-domain AJAX calls";
+this.tx._notifyComplete();
+return;
+}
+}
+else {
+if (this.tx.request.url.match(/^\//)) {
+var proto = location.protocol.match(/https/i) ? 'https' : 'http';
+this.tx.request.url = proto + '://' + location.hostname + this.tx.request.url;
+}
+else {
+var base_url = location.href.replace(/\?.*$/, "");
+if (!base_url.match(/\/$/)) base_url = base_url.replace(/\/[^\/]+$/, "/");
+this.tx.request.url = base_url + this.tx.request.url;
+}
+}
+try {
+this._conn.open(this.tx.request.method, this.tx.request.url, true);
+}
+catch (e) {
+this.tx.response.code = 502;
+this.tx.response.data = e.toString();
+this.tx._notifyComplete();
+return;
+}
+var me = this;
+this._conn.onreadystatechange = function() {
+me.pollConnection();
+};
+for (var key in this.tx.request.headers)
+this._conn.setRequestHeader( key, this.tx.request.headers[key] );
+try {
+this._conn.send( this.tx.request.data.length ? this.tx.request.data : null );
+}
+catch (e) {
+this.tx.response.code = 503;
+this.tx.response.data = e.toString();
+this.tx._notifyComplete();
+return;
+}
+this._inUse = true;
+this._timeout = setTimeout( function() { me.callTimeout(); }, this._socketTimeout );
+};
+Ajax.Connection.prototype.callTimeout = function() {
+this._conn.abort();
+if (this._pollTimer) { clearInterval( this._pollTimer ); this._pollTimer = null; }
+this._inUse = false;
+this.tx.response.code = 504;
+this.tx.response.data = 'Socket Timeout: ' + this.tx.request.url.replace(/\?.+$/, "?...");
+this.tx._notifyComplete();
+};
+Ajax.Connection.prototype.pollConnection = function() {
+if (this._inUse && this._conn && (this._conn.readyState == 4)) {
+if (this._pollTimer) { clearInterval( this._pollTimer ); this._pollTimer = null; }
+if (this._timeout) { clearTimeout( this._timeout ); this._timeout = null; }
+this.complete();
+}
+};
+Ajax.Connection.prototype.complete = function() {
+this._inUse = false;
+if (!this._conn.status && this._conn.responseText.length) {
+this.tx.response.code = 200;
+}
+else {
+try {
+if ((typeof(this._conn.status) != "undefined") && (this._conn.status != 0)) {
+this.tx.response.code = this._conn.status;
+}
+else {
+this.tx.response.code = 505;
+this.tx.response.data = 'Could not determine HTTP Status Code';
+}
+}
+catch(e) {
+this.tx.response.code = 506;
+this.tx.response.data = 'Could not determine HTTP Status Code';
+}
+try {
+this.tx.response.headersRaw = this._conn.getAllResponseHeaders();
+var headers = this.tx.response.headersRaw.split('\n');
+for (var idx = 0; idx < headers.length; idx++){
+var delimitPos = headers[idx].indexOf(':');
+if (delimitPos != -1) {
+this.tx.response.headers[headers[idx].substring(0, delimitPos)] =
+headers[idx].substring(delimitPos + 2);
+}
+}
+}
+catch (e) {
+}
+}
+this.tx.response.data = '' + this._conn.responseText;
+this.tx.response.xml = this._conn.responseXML ? this._conn.responseXML : null;
+this.tx.response.statusLine = this._conn.statusText ? this._conn.statusText : '';
+this.tx._notifyComplete();
+}
+Ajax.Request = function() {
+this.method = 'POST';
+this.url = '';
+this.data = '';
+this.headers = {};
+};
+Ajax.Response = function() {
+this.code = 0;
+this.data = '';
+this.headers = {};
+this.xml = null;
+this.statusLine = '';
+};
+Ajax.Transaction = function() {
+this.request = new Ajax.Request();
+this.response = new Ajax.Response();
+this.callback = null;
+this.connection = null;
+};
+Ajax.Transaction.prototype._notifyComplete = function() {
+if (typeof(this.callback) == 'function') this.callback( this );
+else if (window[this.callback]) window[this.callback]( this );
+else alert("ERROR: AJAX callback function is unknown: " + this.callback);
+}
+Ajax.ConnectionManager = function() {
+this._connections = [];
+this.ie = !!navigator.userAgent.match(/MSIE/);
+};
+Ajax.ConnectionManager.prototype._createConnection = function() {
+var obj = new Ajax.Connection();
+this._connections[ this._connections.length ] = obj;
+return obj;
+};
+Ajax.ConnectionManager.prototype._getConnection = function() {
+for (var idx = 0; idx < this._connections.length; idx++) {
+var conn = this._connections[idx];
+if (!conn._inUse) return conn;
+}
+if (this.ie && this._connections.length > 0) return null;
+return this._createConnection();
+};
+Ajax.ConnectionManager.prototype.inUse = function() {
+var num = 0;
+for (var idx = 0; idx < this._connections.length; idx++) {
+var conn = this._connections[idx];
+if (conn._inUse) num++;
+}
+if (!num && this.req_wait) num = true;
+return num;
+}
+Ajax.ConnectionManager.prototype.send = function(requestArgs, callback, userData) {
+if (!userData) userData = {};
+var tx = new Ajax.Transaction();
+for (var key in requestArgs) tx.request[key] = requestArgs[key];
+for (var key in userData) tx[key] = userData[key];
+if (!callback) return this.doError( "callback is not set" );
+if (!requestArgs.url) return this.doError( "url is not set" );
+tx.callback = callback;
+tx.connection = this._getConnection();
+var me = this;
+if (!tx.connection) {
+this.req_wait = true;
+setTimeout( function() {
+me.send( requestArgs, callback, userData );
+}, 100 );
+return false;
+}
+this.req_wait = false;
+tx.connection.send( tx );
+return true;
+};
+Ajax.ConnectionManager.prototype.get = function(url, callback, userData) {
+return this.send({
+method: 'GET',
+url: url
+}, callback, userData );
+}
+Ajax.ConnectionManager.prototype.doError = function(msg) {
+alert( "ERROR: " + msg );
+}
+Ajax.ConnectionManager.prototype.setSocketTimeout = function(sec) {
+Ajax.Connection.prototype._socketTimeout = sec * 1000;
+}
+ajax = new Ajax.ConnectionManager();
+if (!window.merge_objects || !window.serialize)
+alert("ERROR: cookie.js requires tools.js.");
+function CookieTree(args) {
+if (args) {
+for (var key in args) this[key] = args[key];
+}
+if (!this.expires) {
+var now = new Date();
+now.setFullYear( now.getFullYear() + 10 );
+this.expires = now.toGMTString();
+}
+this.parse();
+};
+CookieTree.prototype.domain = location.hostname;
+CookieTree.prototype.path = location.pathname;
+CookieTree.prototype.parse = function() {
+this.tree = {};
+var cookies = document.cookie.split(/\;\s*/);
+for (var idx = 0, len = cookies.length; idx < len; idx++) {
+var cookie_raw = cookies[idx];
+if (cookie_raw.match(/^CookieTree=(.+)$/)) {
+var cookie = null;
+var cookie_raw = unescape( RegExp.$1 );
+Debug.trace("Cookie", "Parsing cookie: " + cookie_raw);
+try {
+eval( "cookie = " + cookie_raw + ";" );
+}
+catch (e) {
+Debug.trace("Cookie", "Failed to parse cookie.");
+cookie = {};
+}
+this.tree = merge_objects( this.tree, cookie );
+idx = len;
+}
+}
+};
+CookieTree.prototype.get = function(key) {
+return this.tree[key];
+};
+CookieTree.prototype.set = function(key, value) {
+this.tree[key] = value;
+};
+CookieTree.prototype.save = function() {
+var cookie_raw = 'CookieTree=' + escape(serialize(this.tree));
+if (!this.path.match(/\/$/)) {
+this.path = this.path.replace(/\/[^\/]+$/, "") + '/';
+}
+cookie_raw += '; expires=' + this.expires;
+cookie_raw += '; domain=' + this.domain;
+cookie_raw += '; path=' + this.path;
+Debug.trace("Cookie", "Saving cookie: " + cookie_raw);
+document.cookie = cookie_raw;
+};
+CookieTree.prototype.remove = function() {
+var cookie_raw = 'CookieTree={}';
+if (!this.path.match(/\/$/)) {
+this.path = this.path.replace(/\/[^\/]+$/, "") + '/';
+}
+var now = new Date();
+now.setFullYear( now.getFullYear() - 1 );
+cookie_raw += '; expires=' + now.toGMTString();
+cookie_raw += '; domain=' + this.domain;
+cookie_raw += '; path=' + this.path;
+document.cookie = cookie_raw;
+};
+var ww_char_widths = { 32: 0.33, 33: 0.33, 34: 0.4, 35: 0.66, 36: 0.66, 37: 1.03, 38: 0, 39: 0.22, 40: 0.4, 41: 0.4, 42: 0.44, 43: 0.7, 44: 0.33, 45: 0.4, 46: 0.33, 47: 0.33, 48: 0.66, 49: 0.66, 50: 0.66, 51: 0.66, 52: 0.66, 53: 0.66, 54: 0.66, 55: 0.66, 56: 0.66, 57: 0.66, 58: 0.33, 59: 0.33, 60: 0, 61: 0.7, 62: 0.7, 63: 0.66, 64: 1.18, 65: 0.77, 66: 0.77, 67: 0.85, 68: 0.85, 69: 0.77, 70: 0.74, 71: 0.92, 72: 0.85, 73: 0.33, 74: 0.59, 75: 0.77, 76: 0.66, 77: 1, 78: 0.85, 79: 0.92, 80: 0.77, 81: 0.92, 82: 0.85, 83: 0.77, 84: 0.74, 85: 0.85, 86: 0.77, 87: 1.11, 88: 0.77, 89: 0.77, 90: 0.74, 91: 0.33, 92: 0.33, 93: 0.33, 94: 0.55, 95: 0.66, 96: 0.4, 97: 0.66, 98: 0.66, 99: 0.59, 100: 0.66, 101: 0.66, 102: 0.33, 103: 0.66, 104: 0.66, 105: 0.25, 106: 0.25, 107: 0.59, 108: 0.25, 109: 1, 110: 0.66, 111: 0.66, 112: 0.66, 113: 0.66, 114: 0.4, 115: 0.59, 116: 0.33, 117: 0.66, 118: 0.59, 119: 0.85, 120: 0.59, 121: 0.59, 122: 0.59, 123: 0.4, 124: 0.29, 125: 0.4, 126: 0.7, 127: 1.18 };
+document.write( '<span style="position:absolute; left:-1000px; top:0px; padding:0px; margin:0px;" id="ww_span"></span>' );
+function ww_precalc_font(sty, callback) {
+var css_type = !!sty.match(/:/) ? 'style' : 'class';
+document.getElementById('ww_span').innerHTML = '<font '+css_type+'="'+sty+'">M</font>';
+setTimeout( 'ww_precalc_font_finish("'+callback+'")', 1 );
+}
+function ww_precalc_font_finish(callback) {
+var span = document.getElementById('ww_span');
+window[ callback ]( span.offsetWidth, span.offsetHeight );
+}
+function ww_string_width(str, em_width) {
+var len = str.length;
+var width = 0;
+for (var idx=0; idx<len; idx++) {
+var ch = str.charCodeAt(idx);
+if (ww_char_widths[ch]) width += (em_width * ww_char_widths[ch]);
+else width += em_width;
+}
+return width;
+}
+function ww_fit_filename(filename, max_width, em_width) {
+if (ww_string_width(filename, em_width) <= max_width) return filename;
+var end = filename.lastIndexOf('.');
+if (end == -1) end = filename.length;
+if (end < 3) return filename;
+var tpos = Math.floor(end / 2);
+var a = filename.substring(0,tpos);
+var b = filename.substring(tpos + 1);
+while (ww_string_width(a + '...' + b, em_width) > max_width) {
+a = a.substring(0, a.length - 1); if (!a.length) return '...' + b;
+b = b.substring(1); if (!b.length) return a + '...';
+}
+return a + '...' + b;
+}
+function ww_fit_array(arr, max_width, em_width, ellipsis, html) {
+var output = [];
+for (var idx = 0, len = arr.length; idx < len; idx++) {
+output.push( ww_fit_string(arr[idx], max_width, em_width, ellipsis, html) );
+}
+return output;
+}
+function ww_fit_string(in_str, max_width, em_width, ellipsis, html) {
+var str = '' + in_str;
+var len = str.length;
+var width = 0;
+var state = 0;
+var last_word_end = 0;
+if (ellipsis == 1) max_width -= ww_string_width("...", em_width);
+for (var idx=0; idx<len; idx++) {
+var is_word_char = !!str.substring(idx, idx + 1).match(/\S/);
+if ((state == 1) && !is_word_char) {
+last_word_end = idx;
+}
+state = is_word_char ? 1 : 0;
+var code = str.charCodeAt(idx);
+if (ww_char_widths[code]) width += (em_width * ww_char_widths[code]);
+else width += em_width;
+if (width > max_width) {
+if (!last_word_end) {
+var final_str = str.substring(0, (ellipsis == 2) ? (idx - 3) : idx);
+if (ellipsis) final_str += '...';
+return html ? ('<nobr>'+final_str.replace(/\s/g, "&nbsp;")+'</nobr>') : final_str;
+}
+else {
+var final_str = str.substring(0, last_word_end);
+if (ellipsis == 1) final_str += '...';
+return html ? ('<nobr>'+final_str.replace(/\s/g, "&nbsp;")+'</nobr>') : final_str;
+}
+}
+}
+return html ? str.replace(/\s/g, "&nbsp;") : str;
+}
+function ww_fit_box(str, max_width, max_lines, em_width, ellipsis, html) {
+var line_idx = 0;
+var char_idx = 0;
+var final_str = '';
+while (line_idx < max_lines) {
+while (!!str.substring(char_idx, char_idx + 1).match(/\s/)) char_idx++;
+var last_line = (line_idx == (max_lines - 1));
+var temp_str = ww_fit_string( str.substring(char_idx), max_width, em_width, last_line ? ellipsis : 2, 0 );
+final_str += temp_str;
+char_idx += temp_str.length;
+if (temp_str.match(/\.\.\.$/)) char_idx -= 3;
+if (char_idx >= str.length) line_idx = max_lines;
+else if (!last_line) final_str += "\n";
+line_idx++;
+}
+return html ? final_str.replace(/\n/g, "<br>").replace(/\s/g, "&nbsp;") : final_str;
+}
+var last_section = {};
+var last_tab = '';
+var rendering_page = true;
+var years = [
+[ 2002, '2002' ], [ 2003, '2003' ], [ 2004, '2004' ], [ 2005, '2005' ],
+[ 2006, '2006' ], [ 2007, '2007' ], [ 2008, '2008' ], [ 2009, '2009' ],
+[ 2010, '2010' ]
+];
+var months = [
+[ 1, 'January' ], [ 2, 'February' ], [ 3, 'March' ], [ 4, 'April' ],
+[ 5, 'May' ], [ 6, 'June' ], [ 7, 'July' ], [ 8, 'August' ],
+[ 9, 'September' ], [ 10, 'October' ], [ 11, 'November' ],
+[ 12, 'December' ]
+];
+var days = [
+[1,1], [2,2], [3,3], [4,4], [5,5], [6,6], [7,7], [8,8], [9,9], [10,10],
+[11,11], [12,12], [13,13], [14,14], [15,15], [16,16], [17,17], [18,18],
+[19,19], [20,20], [21,21], [22,22], [23,23], [24,24], [25,25], [26,26],
+[27,27], [28,28], [29,29], [30,30], [31,31]
+];
+var hours = [
+[0, '12 AM'], [1, '1 AM'], [2, '2 AM'], [3, '3 AM'], [4, '4 AM'],
+[5, '5 AM'], [6, '6 AM'], [7, '7 AM'], [8, '8 AM'], [9, '9 AM'],
+[10, '10 AM'], [11, '11 AM'], [12, '12 PM'], [13, '1 PM'],
+[14, '2 PM'], [15, '3 PM'], [16, '4 PM'], [17, '5 PM'], [18, '6 PM'],
+[19, '7 PM'], [20, '8 PM'], [21, '9 PM'], [22, '10 PM'], [23, '11 PM']
+];
+function mouse_icon_button(type, e, pt) {
+switch (type) {
+case 'mouseDown': this.className = 'icon_button_active'; return false;
+case 'mouseUp': this.className = 'icon_button'; break;
+case 'click':
+var self = this;
+setTimeout( function() { invoke_dom_handler(self, 'onMouseClick'); }, 10 );
+break;
+}
+return true;
+}
+function icon_button(icon_name, text, code, width) {
+var html = '';
+html += '<table class="icon_button" cellspacing=0 cellpadding=0 captureMouse="mouse_icon_button"';
+if (width) html += ' width="'+width+'"';
+html += ' onMouseClick="'+code+'">';
+html += '<tr>';
+html += '<td width="16" style="padding-right:0px;">' + icon(icon_name) + '</td>';
+if (!ie) html += '<td width="3" style="padding-right:0px;">' + spacer(3,1) + '</td>';
+html += '<td align="center" width="*" onselectstart="return false" style="padding-right:0px;"><nobr>' + text + '</nobr></td>';
+html += '</tr></table>';
+return html;
+}
+function large_icon_button(icon_name, text, code, id, style, extra_classes) {
+var html = '';
+if (!icon_name) icon_name = '';
+if (!icon_name.match(/\.\w+$/)) icon_name += '.gif';
+if (!text) text = '';
+if (!code) code = '';
+if (!id) id = '';
+if (!extra_classes) extra_classes = '';
+if (code.toString().match(/^\#(.+)$/)) code = "Nav.go('"+RegExp.$1+"')";
+html += '<div class="button '+extra_classes+'" id="'+id+'" onClick="'+code+'">';
+html += '<ul>';
+html += '<li class="left"></li>';
+if (icon_name) html += '<li class="icon"><img src="'+png(icons_uri+'/'+icon_name, true)+'" class="png" width="16" height="16"/></li>';
+html += '<li class="center" style="' + (icon_name ? 'padding-left:5px;' : '') + compose_style(style) + '">' + text + '</li>';
+html += '<li class="right"></li>';
+html += '</ul>';
+html += '<div class="clear"></div>';
+html += '</div>';
+return html;
+}
+function get_icon_for(filename, id, text, code) {
+if (!id) id = '';
+if (!text) text = '';
+if (!code) code = '';
+var icon_name = '';
+var ext = filename.replace(/^.+\.(\w+)$/, '$1').toLowerCase();
+if (filename.match(/\/$/)) icon_name = 'folder.png';
+else if (ext.match(/(js|sh|pl|pm|php|asp)/)) icon_name = 'page_white_code.png';
+else if (ext.match(/(xml|xsl|dtd|txt|htm|html|css)/)) icon_name = 'page_white_text.png';
+else if (ext.match(/(jpg|jpe|jpeg|bmp|gif|pcx|png|tif|tiff|psd)/)) icon_name = 'page_white_colorwheel.png';
+else if (ext.match(/(as|swf|fla)/)) icon_name = 'page_white_flash.png';
+else if (ext.match(/(doc)/)) icon_name = 'page_white_word.png';
+else if (ext.match(/(xls)/)) icon_name = 'page_white_excel.png';
+else if (ext.match(/(pdf)/)) icon_name = 'page_white_acrobat.png';
+else if (ext.match(/(zip)/)) icon_name = 'page_white_zip.png';
+else if (ext.match(/(mp3)/)) icon_name = 'page_white_audio.png';
+else if (ext.match(/(flv|mp4|mp4v|mov|3gp|3g2)/)) icon_name = 'page_white_movie.png';
+else if (ext.match(/(ttf|otf)/)) icon_name = 'page_white_font.png';
+else icon_name = 'page_white.png';
+return icon(icon_name, text, code, filename, id);
+}
+function get_color_preview(color) {
+if (!color.match(/^\#/)) color = '#' + color;
+var html = '';
+html += '<table cellspacing="0" cellpadding="0"><tr>';
+html += '<td style="margin:0; padding:0;"><div style="width:24px; height:14px; border:1px solid #aaa; background-color:'+color+';"></div></td>';
+html += '<td style="margin:0; padding:0;">' + spacer(4,1) + '</td>';
+html += '<td style="margin:0; padding:0;">' + color + '</td>';
+html += '</tr></table>';
+return html;
+}
+function busy() {
+return '<img src="'+images_uri+'/busy.gif" width="16" height="16"/>';
+}
+function loading_image() {
+return '<center><img src="'+images_uri+'/loading.gif" width="32" height="32"/></center>';
+}
+function begin_section(type, size, ext, table_attribs) {
+if (typeof(size) == 'number') size = [size, size, size, size];
+if (!ext || ie6) ext = 'gif';
+last_section.type = type;
+last_section.size = size;
+last_section.ext = ext;
+var png = (ext.toLowerCase() == 'png') ? true : false;
+var html = '<table cellspacing=0 cellpadding=0 border=0 '+compose_attribs(table_attribs)+'><tr>';
+html += '<td width="'+size[0]+'" height="'+size[1]+'"><img '+(png ? 'class="png" ' : '')+'src="'+images_uri+'/'+type+'/top_left.'+ext+'" width="'+size[0]+'" height="'+size[1]+'"></td>';
+html += '<td width="*" height="'+size[1]+'" '+(png ? 'class="png" ' : '')+' background="'+images_uri+'/'+type+'/top.'+ext+'"><img src="'+images_uri+'/pixel.gif" width="1" height="1"></td>';
+html += '<td width="'+size[2]+'" height="'+size[1]+'"><img '+(png ? 'class="png" ' : '')+'src="'+images_uri+'/'+type+'/top_right.'+ext+'" width="'+size[2]+'" height="'+size[1]+'"></td>';
+html += '</tr><tr>';
+html += '<td width="'+size[0]+'" height="*" '+(png ? 'class="png" ' : '')+'background="'+images_uri+'/'+type+'/left.'+ext+'"><img src="'+images_uri+'/pixel.gif" width="1" height="1"></td>';
+html += '<td width="*" height="*">';
+if (rendering_page) document.write(html); else return html;
+}
+function end_section(type, size, ext) {
+if (typeof(size) == 'number') size = [size, size, size, size];
+if (!type) type = last_section.type;
+if (!size) size = last_section.size;
+if (!ext) ext = last_section.ext;
+if (ie6) ext = 'gif';
+var png = (ext.toLowerCase() == 'png') ? true : false;
+var html = '</td>';
+html += '<td width="'+size[2]+'" height="*" '+(png ? 'class="png" ' : '')+'background="'+images_uri+'/'+type+'/right.'+ext+'"><img src="'+images_uri+'/pixel.gif" width="1" height="1"></td>';
+html += '</tr><tr>';
+html += '<td width="'+size[0]+'" height="'+size[3]+'"><img '+(png ? 'class="png" ' : '')+'src="'+images_uri+'/'+type+'/bottom_left.'+ext+'" width="'+size[0]+'" height="'+size[3]+'"></td>';
+html += '<td width="*" height="'+size[3]+'" '+(png ? 'class="png" ' : '')+'background="'+images_uri+'/'+type+'/bottom.'+ext+'"><img src="'+images_uri+'/pixel.gif" width="1" height="1"></td>';
+html += '<td width="'+size[2]+'" height="'+size[3]+'"><img '+(png ? 'class="png" ' : '')+'src="'+images_uri+'/'+type+'/bottom_right.'+ext+'" width="'+size[2]+'" height="'+size[3]+'"></td>';
+html += '</tr></table>';
+if (rendering_page) document.write(html); else return html;
+}
+function img8_bkgnd(lw, th, rw, bh) {
+if (arguments.length == 1) { th = rw = bh = lw; }
+else if (arguments.length == 2) { rw = lw; bh = th; }
+return(
+'<table cellspacing="0" cellpadding="0" border="0" width="100%" height="100%"><tr>' +
+'<td width="'+lw+'" height="'+th+'" class="tl"><img src="'+images_uri+'/sp.gif" width="1" height="1"/></td>' +
+'<td width="*" height="'+th+'" class="t"><img src="'+images_uri+'/sp.gif" width="1" height="1"/></td>' +
+'<td width="'+rw+'" height="'+th+'" class="tr"><img src="'+images_uri+'/sp.gif" width="1" height="1"/></td>' +
+'</tr><tr>' +
+'<td width="'+lw+'" height="*" class="l"><img src="'+images_uri+'/sp.gif" width="1" height="1"/></td>' +
+'<td width="*" height="*" class="c"><img src="'+images_uri+'/sp.gif" width="1" height="1"/></td>' +
+'<td width="'+rw+'" height="*" class="r"><img src="'+images_uri+'/sp.gif" width="1" height="1"/></td>' +
+'</tr><tr>' +
+'<td width="'+lw+'" height="'+bh+'" class="bl"><img src="'+images_uri+'/sp.gif" width="1" height="1"/></td>' +
+'<td width="*" height="'+bh+'" class="b"><img src="'+images_uri+'/sp.gif" width="1" height="1"/></td>' +
+'<td width="'+rw+'" height="'+bh+'" class="br"><img src="'+images_uri+'/sp.gif" width="1" height="1"/></td>' +
+'</tr></table>'
+);
+}
+function tab_bar(tabs, cur_tab_name) {
+var lw = 10, th = 10, rw = 10;
+var html = '';
+html += '<div class="tab_bar">';
+for (var idx = 0, len = tabs.length; idx < len; idx++) {
+var tab = tabs[idx];
+var code = tab[0];
+if (code.toString().match(/^\#(.+)$/)) code = "Nav.go('"+RegExp.$1+"')";
+html += '<div class="tab '+((tab[1] == cur_tab_name) ? 'active' : 'inactive')+'" onClick="'+code+'">';
+html += '<div class="content ' + (tab[2] ? (' icon" style="background-image:url(images/icons/'+tab[2]+')"') : '"') + '>' + tab[1] + '</div>';
+html += '</div>';
+}
+html += '<div class="clear"></div>';
+html += '</div>';
+return html;
+}
+function select_tab(id) {
+$('tab_left_'+id).src = $('tab_left_'+id).src.replace(/_inactive_/, '_active_');
+$('tab_middle_'+id).style.backgroundImage = $('tab_middle_'+id).style.backgroundImage.replace(/_inactive_/, '_active_');
+$('tab_right_'+id).src = $('tab_right_'+id).src.replace(/_inactive_/, '_active_');
+$('tab_text_'+id).className = 'tab_active';
+$('page_'+id).show();
+}
+function deselect_tab(id) {
+$('tab_left_'+id).src = $('tab_left_'+id).src.replace(/_active_/, '_inactive_');
+$('tab_middle_'+id).style.backgroundImage = $('tab_middle_'+id).style.backgroundImage.replace(/_active_/, '_inactive_');
+$('tab_right_'+id).src = $('tab_right_'+id).src.replace(/_active_/, '_inactive_');
+$('tab_text_'+id).className = 'tab_inactive';
+$('page_'+id).hide();
+}
+function click_tab(id) {
+if (id != last_tab) {
+if (last_tab) {
+deselect_tab(last_tab);
+safe_call('deactivate_page_'+last_tab);
+}
+select_tab(id);
+last_tab = id;
+if (!$('page_'+id).innerHTML.length) safe_call('init_page_'+id);
+else safe_call('activate_page_'+id);
+}
+}
+function begin_tabs(tabs, type, size, tab_height, ext, table_attribs) {
+if (!ext) ext = 'gif';
+last_section.type = type;
+last_section.size = size;
+last_section.ext = ext;
+var png = (ext.toLowerCase() == 'png') ? true : false;
+var html = '<table cellspacing=0 cellpadding=0 border=0 '+compose_attribs(table_attribs)+'>';
+html += '<tr>';
+html += '<td width="'+size+'" height="'+tab_height+'"><img '+(png ? 'class="png" ' : '')+'src="'+images_uri+'/'+type+'/tabs/top_left.'+ext+'" width="'+size+'" height="'+tab_height+'"></td>';
+html += '<td width="*" height="'+tab_height+'">';
+html += '<table width="100%" cellspacing=0 cellpadding=0 border=0><tr>';
+for (var idx = 0, len = tabs.length; idx < len; idx++) {
+var tab = tabs[idx];
+var tab_mode = 'tab_inactive';
+var click_action = 'onMouseDown="return false" onMouseUp="click_tab(\''+tab[1]+'\')"';
+html += '<td width="'+size+'" height="'+tab_height+'" '+click_action+'>';
+html += '<img '+(png ? 'class="png" ' : '')+'src="'+images_uri+'/'+type+'/tabs/'+tab_mode+'_left.'+ext+'" width="'+size+'" height="'+tab_height+'" id="tab_left_'+tab[1]+'">';
+html += '</td>';
+html += '<td '+(png ? 'class="png" ' : '')+'width="1" height="'+tab_height+'" '+click_action+' id="tab_middle_'+tab[1]+'" style="background-image:url('+images_uri+'/'+type+'/tabs/'+tab_mode+'_middle.'+ext+');">';
+html += '<span id="tab_text_'+tab[1]+'" class="'+tab_mode+'">' + tab[0].toString().replace(/\s/g, "&nbsp;") + '</span>';
+html += '</td>';
+html += '<td width="'+size+'" height="'+tab_height+'" '+click_action+'>';
+html += '<img '+(png ? 'class="png" ' : '')+'src="'+images_uri+'/'+type+'/tabs/'+tab_mode+'_right.'+ext+'" width="'+size+'" height="'+tab_height+'" id="tab_right_'+tab[1]+'">';
+html += '</td>';
+}
+html += '<td width="*" height="'+tab_height+'" '+(png ? 'class="png" ' : '')+' background="'+images_uri+'/'+type+'/tabs/top.'+ext+'"><img src="'+images_uri+'/pixel.gif" width="1" height="1"></td>';
+html += '</tr></table>';
+html += '</td>';
+html += '<td width="'+size+'" height="'+tab_height+'"><img '+(png ? 'class="png" ' : '')+'src="'+images_uri+'/'+type+'/tabs/top_right.'+ext+'" width="'+size+'" height="'+tab_height+'"></td>';
+html += '</tr><tr>';
+html += '<td width="'+size+'" height="*" '+(png ? 'class="png" ' : '')+'background="'+images_uri+'/'+type+'/left.'+ext+'"><img src="'+images_uri+'/pixel.gif" width="1" height="1"></td>';
+html += '<td width="*" height="*" bgcolor=white>';
+if (rendering_page) document.write(html); else return html;
+}
+function popup_fade_animate() {
+if (session.popup_fade_screen_active) {
+var div_amount = (session.popup_fade_target == 0.0) ? 4 : 8;
+session.popup_fade_opacity += ((session.popup_fade_target - session.popup_fade_opacity) / div_amount);
+var div = document.getElementById('lbox_overlay');
+if (div) {
+div.style.opacity = session.popup_fade_opacity;
+if (ie) div.style.filter = 'alpha(opacity=' + parseInt(session.popup_fade_opacity * 100, 10) + ')';
+div = null;
+}
+if (Math.abs(session.popup_fade_target - session.popup_fade_opacity) < 0.01) {
+session.popup_fade_screen_active = 0;
+if (!session.popup_fade_target) {
+document.body.removeChild( $('lbox_overlay') );
+if (ie) {
+document.body.removeChild( $('lbox_msie_frame') );
+}
+if (0) {
+var html = document.getElementsByTagName('html')[0];
+html.style.height = 'auto';
+html.style.width = 'auto';
+html.style.overflow = '';
+var body = document.getElementsByTagName('body')[0];
+body.style.width = 'auto';
+body.style.height = 'auto';
+body.style.overflow = '';
+body.style.marginRight = '0px';
+}
+if (safari) {
+window.scrollBy(0, 1);
+window.scrollBy(0, -1);
+}
+}
+}
+else {
+setTimeout( 'popup_fade_animate()', 33 );
+}
+}
+}
+function popup_fade_screen() {
+if (!session.popup_dialog_active) {
+if (0) {
+var html = document.getElementsByTagName('html')[0];
+html.style.height = '100%';
+html.style.width = '100%';
+html.style.overflow = 'hidden';
+var body = document.getElementsByTagName('body')[0];
+body.style.height = '100%';
+body.style.overflow = 'hidden';
+if (getInnerWindowSize().height < getScrollMax().height) {
+body.style.marginRight = '16px';
+}
+}
+if (ie && !$('lbox_msie_frame')) {
+var ifr = document.createElement('IFRAME');
+ifr.id = 'lbox_msie_frame';
+document.body.appendChild(ifr);
+}
+if (!$('lbox_overlay')) {
+var div = document.createElement('DIV');
+div.id = 'lbox_overlay';
+document.body.appendChild(div);
+}
+session.popup_fade_target = 0.4;
+if (!session.popup_fade_screen_active) {
+session.popup_fade_opacity = 0.0;
+session.popup_fade_screen_active = 1;
+popup_fade_animate();
+}
+}
+}
+function popup_restore_screen() {
+if (session.popup_dialog_active) {
+session.popup_fade_target = 0.0;
+if (1) {
+var html = document.getElementsByTagName('html')[0];
+html.style.height = 'auto';
+html.style.width = 'auto';
+html.style.overflow = '';
+var body = document.getElementsByTagName('body')[0];
+body.style.width = 'auto';
+body.style.height = 'auto';
+body.style.overflow = '';
+body.style.marginRight = '0px';
+}
+if (safari) {
+window.scrollBy(0, 1);
+window.scrollBy(0, -1);
+}
+if (!session.popup_fade_screen_active) {
+session.popup_fade_opacity = 0.5;
+session.popup_fade_screen_active = 1;
+popup_fade_animate();
+}
+}
+}
+function show_popup_dialog(width, height, html) {
+if (session.net_error) return;
+if (window.gGameControl) {
+gGameControl.pause();
+gGameControl.setClickResume( false );
+}
+else {
+if (window.Effect && Effect.Game && Effect.Game.inGame) Effect.Game.pause();
+if (window.Effect && Effect.Game) Effect.Game.clickResume = false;
+}
+var popup = $('d_dialog_outer');
+var doc_size = getInnerWindowSize();
+var scroll = getScrollXY();
+var outer_width = width + 24 + 24;
+var outer_height = height + 24 + 24;
+var left = Math.floor( (doc_size.width / 2) - (outer_width / 2) );
+var top = Math.floor( ((doc_size.height / 2) - (outer_height / 2)) / 2 );
+top += scroll.y;
+top += 50;
+popup.style.left = left + 'px';
+popup.style.top = top + 'px';
+popup.style.width = outer_width + 'px';
+popup.style.height = outer_height + 'px';
+var content = $('d_dialog_inner');
+content.style.width = width + 'px';
+content.style.height = height + 'px';
+content.innerHTML = html;
+popup.show();
+if (!ie) popup_fade_screen();
+session.popup_dialog_active = true;
+delete session.progress;
+safe_call('hook_show_popup_dialog');
+}
+function hide_popup_dialog() {
+$('d_dialog_inner').innerHTML = '';
+var popup = $('d_dialog_outer');
+popup.left = "-4000px";
+popup.hide();
+if (!ie) popup_restore_screen();
+session.popup_dialog_active = false;
+delete session.hooks.keys[ENTER_KEY];
+delete session.hooks.keys[ESC_KEY];
+delete session.progress;
+safe_call('hook_hide_popup_dialog');
+if (window.gGameControl) {
+gGameControl.setClickResume( true );
+}
+else if (window.Effect && Effect.Game) Effect.Game.clickResume = true;
+}
+function clear_notice() {
+hide_popup_dialog();
+fire_hook('after_notice');
+}
+function do_notice(title, msg, callback) {
+hide_popup_dialog();
+delete session.progress;
+if (callback) session.hooks.after_notice = callback;
+var html = '<table cellspacing=0 cellpadding=0><tr><td width=400 height=150 valign=center align=center>';
+html += '<div class="dialog_title">'+title+'</div>';
+html += text_to_html(msg);
+html += '<br><br>';
+html += '<table><tr>';
+html += '<td>' + large_icon_button('check', 'Close', 'clear_notice()') + '</td>';
+html += '</tr></table>';
+html += '</td></tr></table>';
+session.hooks.keys[ENTER_KEY] = 'clear_notice';
+session.hooks.keys[ESC_KEY] = 'clear_notice';
+show_popup_dialog(400, 150, html);
+}
+function clear_error() {
+hide_popup_dialog();
+fire_hook('after_error');
+}
+function do_error(msg, button_args, pure) {
+hide_popup_dialog();
+delete session.progress;
+fire_hook('before_error');
+var html = '<table cellspacing=0 cellpadding=0><tr><td width=400 height=250 valign=center align=center>';
+html += '<img src="'+images_uri+'/icons/error.gif" width="33" height="32"><br>';
+html += '<span class="subtitle" style="color:#f00;">Sorry, an error occurred:</span><br><br>';
+html += '<div style="width:350px; height:150px; overflow-x:hidden; overflow-y:auto;">';
+html += pure ? msg : text_to_html(msg);
+html += '</div><br>';
+html += '<table><tr>';
+html += '<td>' + large_icon_button('check', 'Close', 'clear_error()') + '</td>';
+if (button_args) {
+html += '<td width=15>&nbsp;</td>';
+html += '<td>' + large_icon_button.apply(window, button_args) + '</td>';
+}
+html += '</tr></table>';
+html += '</td></tr></table>';
+session.hooks.keys[ENTER_KEY] = 'clear_error';
+session.hooks.keys[ESC_KEY] = 'clear_error';
+show_popup_dialog(400, 250, html);
+return null;
+}
+function show_progress_dialog(counter, title, remain_disp, button_args) {
+if (session.progress) {
+update_progress_dialog(counter, title);
+return;
+}
+if (!counter) counter = 0;
+var cx = Math.floor( counter * 196 );
+var html = '';
+html += '<center><br>';
+html += '<span id="d_progress_title" class="subtitle">' + title + '</span><br><br>';
+var opac_str = '';
+if (counter == 1.0) opac_str = 'opacity:0.5; moz-opacity:0.5; filter:alpha(opacity=50);';
+html += '<div style="position:relative; overflow:hidden; width:196px; height:20px; background-image:url('+images_uri+'/aquaprogressbar_bkgnd.gif);">';
+html += '<div id="d_progress_bar" style="position:absolute; left:0px; top:0px; width:196px; height:20px; clip:rect(0px '+cx+'px 20px 0px);'+opac_str+'">';
+html += '<img src="'+images_uri+'/aquaprogressbar.gif" width="196" height="20"/>';
+html += '</div>';
+html += '</div>';
+html += '<br><span id="d_progress_caption" class="caption"></span>';
+if (button_args) {
+html += '<br/><br/><table><tr><td>';
+html += large_icon_button.apply(window, button_args);
+html += '<br clear="all"/></td></tr></table>';
+}
+html += '</center>';
+show_popup_dialog(275, button_args ? 150 : 100, html);
+session.progress = {
+remain_disp: remain_disp,
+start_counter: counter,
+counter: counter,
+counter_max: 1,
+start_time: hires_time_now(),
+last_update: hires_time_now(),
+title: title
+};
+}
+function hide_progress_dialog() {
+hide_popup_dialog();
+session.progress = null;
+delete session.progress;
+}
+function update_progress_dialog(counter, title, caption) {
+var now = hires_time_now();
+var cx = Math.floor( counter * 196 );
+var prog_div = $('d_progress_bar');
+if (prog_div) {
+prog_div.style.clip = 'rect(0px '+cx+'px 20px 0px)';
+var opacity = (counter == 1.0) ? 0.5 : 1.0;
+if ((opacity > 0) && (opacity < 1.0)) {
+prog_div.style.opacity = opacity;
+if (moz) prog_div.style.MozOpacity = opacity;
+else if (ie) prog_div.style.filter = "alpha(opacity=" + parseInt(opacity * 100, 10) + ")";
+}
+else {
+prog_div.style.opacity = 1.0;
+if (moz) prog_div.style.MozOpacity = 1.0;
+else if (ie) prog_div.style.filter = "";
+}
+}
+if (title) session.progress.title = title;
+var title_div = $('d_progress_title');
+if (title_div) title_div.innerHTML = session.progress.title;
+if (caption) {
+var cap_div = $('d_progress_caption');
+if (cap_div) cap_div.innerHTML = caption;
+}
+else if (session.progress.remain_disp) {
+if (session.progress.start_time <= now - 5.0) {
+var caption = '';
+if ((counter > 0.0) && (counter < 1.0)) {
+caption = get_nice_remaining_time(session.progress.start_time, now, counter, 1.0, true);
+caption += ' remaining';
+}
+var cap_div = $('d_progress_caption');
+if (cap_div) cap_div.innerHTML = caption;
+}
+}
+session.progress.last_update = now;
+session.progress.counter = counter;
+}
+function safe_focus(id) {
+if ($(id)) {
+try { $(id).focus(); } catch (e) {;}
+}
+else setTimeout( "try { $('"+id+"').focus(); } catch (e) {;}", 1 );
+}
+function do_message(type, msg) {
+$GR.growl(type, msg);
+return;
+}
+function hide_message(id) {
+if (session.message_id == id) {
+if (ie) $('d_message').hide();
+else animate_div_visibility('d_message_wrapper', false);
+}
+}
+function menu( id, items, value, attribs ) {
+if (typeof(value) == 'undefined') value = null;
+var html = '<select name="'+id+'" id="'+id+'" '+compose_attribs(attribs)+'>';
+for (var idx = 0, len = items.length; idx < len; idx++) {
+var item = items[idx];
+if (typeof(item) != 'object') item = [ items[idx], items[idx] ];
+if (isa_array(item[0])) {
+var subitems = item[0];
+html += '<optgroup label="'+item[1]+'">';
+for (var idy = 0, ley = subitems.length; idy < ley; idy++) {
+var subitem = subitems[idy];
+if (typeof(subitem) != 'object') subitem = [ subitems[idy], subitems[idy] ];
+var selected = (subitem[0] == value) ? ' selected="selected"' : '';
+html += '<option value="'+subitem[0]+'"' + selected + '>' + subitem[1] + '</option>';
+}
+html += '</optgroup>';
+}
+else {
+var selected = (item[0] == value) ? ' selected="selected"' : '';
+html += '<option value="'+item[0]+'"' + selected + '>' + item[1] + '</option>';
+}
+}
+html += '</select>';
+return html;
+}
+function insert_date_selector(prefix, epoch) {
+var date = get_date_args(epoch);
+var html = '';
+html += menu( prefix + '_mon', months, date.mon );
+html += menu( prefix + '_mday', days, date.mday );
+html += menu( prefix + '_year', years, date.year );
+return html;
+}
+function set_menu_date( prefix, epoch ) {
+var date = get_date_args(epoch);
+var mon = $( prefix + '_mon' );
+if (mon) mon.selectedIndex = date.mon - 1;
+var mday = $( prefix + '_mday' );
+if (mday) mday.selectedIndex = date.mday - 1;
+var year = $( prefix + '_year' );
+if (year) year.selectedIndex = date.year - years[0][0];
+}
+function get_menu_date( prefix ) {
+var mon = get_menu_value( prefix + '_mon' );
+var mday = get_menu_value( prefix + '_mday' );
+var year = get_menu_value( prefix + '_year' );
+var date = new Date( year, mon - 1, mday, 0, 0, 0, 0 );
+return parseInt( date.getTime() / 1000, 10 );
+}
+function animate_div(id) {
+var div = $(id);
+if (!div) return alert("Cannot find div: " + id);
+div._timer = null;
+var target = div._state ? div.scrollHeight : 0;
+if (div._height != target) {
+div._height += ((target - div._height) / 4);
+if (Math.abs( target - div._height ) < 1.0) div._height = target;
+div.style.height = '' + div._height + 'px';
+if (div._mode == -1) div.scrollTop = div.scrollHeight;
+else div.scrollTop = 0;
+div._timer = setTimeout('animate_div("'+id+'");', 33);
+}
+else {
+if (div._state) {
+div.style.height = 'auto';
+}
+div.scrollTop = 0;
+}
+}
+function animate_div_visibility(id, visible) {
+var div = $(id);
+if (typeof(div._state) == 'undefined') {
+div._state = (div.style.display != 'none') ? true : false;
+div._height = div._state ? div.scrollHeight : 0;
+div.style.height = '' + (div._state ? 'auto' : '0px');
+div.style.overflow = 'hidden';
+div.scrollTop = 0;
+}
+else {
+div._height = div.offsetHeight;
+}
+div.show();
+div._state = visible;
+div._mode = -1;
+if (!div._timer) animate_div(id);
+var sc = document.getElementById('sc_' + id);
+if (sc) {
+var new_icon_name = visible ? 'arrow-down' : 'arrow-right';
+if (sc.src.indexOf('_mini') > -1) new_icon_name += '_mini';
+sc.src = images_uri + '/icons/' + new_icon_name + '.png';
+}
+if (visible && !div.innerHTML.length && div.getAttribute('onExpand'))
+eval( div.getAttribute('onExpand') );
+}
+function image_placeholder(text, width, height) {
+return '<table cellspacing="0" cellpadding="0" width="'+width+'" height="'+height+'"><tr><td bgcolor="#dddddd" align="center" valign="center"><b>'+text+'</b></td></tr></table>';
+}
+function bad_field(id, msg) {
+var field = $(id);
+field.addClass('control_bad');
+do_message("error", msg);
+try { field.focus(); } catch(e) {;}
+session.last_bad_field_id = id;
+return false;
+}
+function clear_field_error() {
+if (session.last_bad_field_id && $(session.last_bad_field_id)) $(session.last_bad_field_id).removeClass('control_bad');
+}
+function smart_sect_restore(sects, prefs) {
+if (!sects) sects = [];
+if (!prefs) prefs = {};
+for (var idx = 0, len = sects.length; idx < len; idx++) {
+var sect = sects[idx];
+if (typeof(prefs[sect]) == 'undefined') prefs[sect] = 1;
+if (prefs[sect] == 1) {
+$(sect).show();
+$(sect).style.height = '';
+$('ctl_'+sect).removeClass('closed');
+$('ctl_'+sect).addClass('open');
+}
+else {
+$(sect).hide();
+$('ctl_'+sect).removeClass('open');
+$('ctl_'+sect).addClass('closed');
+}
+}
+}
+function smart_sect_toggle(sect, prefs) {
+if (prefs[sect] == 0) {
+animate_div_visibility(sect, true);
+$('ctl_'+sect).removeClass('closed');
+$('ctl_'+sect).addClass('open');
+prefs[sect] = 1;
+}
+else {
+animate_div_visibility(sect, false);
+$('ctl_'+sect).removeClass('open');
+$('ctl_'+sect).addClass('closed');
+prefs[sect] = 0;
+}
+user_storage_mark();
+}
+function custom_fit(source_width, source_height, dest_width, dest_height) {
+var width = dest_width;
+var height = dest_height;
+if ((dest_width <= source_width) || (dest_height <= source_height)) {
+width = source_width;
+height = source_height;
+for (var idx = 0; idx < 2; idx++) {
+if (width - dest_width > height - dest_height) {
+if (width > dest_width) {
+height = Math.floor( height / (width / dest_width) );
+width = dest_width;
+}
+}
+else {
+if (height > dest_height) {
+width = Math.floor( width / (height / dest_height) );
+height = dest_height;
+}
+}
+}
+if (!width) width = 1;
+if (!height) height = 1;
+}
+return { width: width, height: height };
+}
+function fit_game_title(title) {
+return ww_fit_string(title, 550, session.em_width, 1);
+}
+function render_user_stats(stats) {
+var html = '';
+html += '<div class="article_info_floater">';
+html += '<div class="article_info_header">' + icon('chart_pie.png', 'User Stats') + '</div>';
+html += '<div class="stats_row"><b>Logins:</b>&nbsp;' + commify(stats.Logins || 0) + '</div>';
+html += '<div class="stats_row"><b>Articles:</b>&nbsp;' + commify(stats.Articles || 0) + '</div>';
+html += '<div class="stats_row"><b>Comments:</b>&nbsp;' + commify(stats.Comments || 0) + '</div>';
+html += '<div class="stats_row"><b>Games:</b>&nbsp;' + commify(stats.Games || 0) + '</div>';
+html += '</div>';
+return html;
+}
+function get_speech_bubble(color, content) {
+var bubble_uri = images_uri + '/speech_bubbles/' + color;
+var html = '';
+html += '<table cellspacing=0 cellpadding=0 border=0><tr>';
+html += '<td width="24" height="14"><img class="png" src="'+png(bubble_uri+'_tl.png', true)+'" width="24" height="14"/></td>';
+html += '<td width="*" height="14" class="png" background="'+png(bubble_uri+'_tm.png', true)+'">'+spacer(1,14)+'</td>';
+html += '<td width="24" height="14"><img class="png" src="'+png(bubble_uri+'_tr.png', true)+'" width="24" height="14"/></td>';
+html += '</tr><tr>';
+html += '<td width="24" height="*" class="png" background="'+png(bubble_uri+'_ml.png', true)+'">'+spacer(24,1)+'</td>';
+html += '<td width="*" height="*" class="png" background="'+png(bubble_uri+'_mi.png', true)+'">';
+html += '<div ';
+if (!ie6) {
+html += 'style="';
+if (!ie7) html += 'margin-left:-5px; margin-right:-5px; ';
+html += 'margin-top:-7px; margin-bottom:-7px; overflow:visible; position:relative;"';
+}
+html += '>';
+html += content;
+html += '</div></td>';
+html += '<td width="24" height="*" class="png" background="'+png(bubble_uri+'_mr.png', true)+'">'+spacer(24,1)+'</td>';
+html += '</tr><tr>';
+html += '<td width="24" height="17"><img class="png" src="'+png(bubble_uri+'_bl.png', true)+'" width="24" height="17"/></td>';
+html += '<td width="*" height="17" class="png" background="'+png(bubble_uri+'_bm.png', true)+'">'+spacer(1,17)+'</td>';
+html += '<td width="24" height="17"><img class="png" src="'+png(bubble_uri+'_br.png', true)+'" width="24" height="17"/></td>';
+html += '</tr></table>';
+return html;
+}
+function get_chat_balloon(color, username, chat_text) {
+var html = '<div class="chat_msg_bubble"><table><tr><th valign="bottom" onClick="Nav.go(\'User/'+username+'\')" style="cursor:pointer;" title="'+username+'">';
+html += get_buddy_icon_display(username, true, false);
+html += '</th>';
+var user_span = '';
+user_span += '<span class="chat_msg_text"';
+user_span += '>';
+user_span += chat_text;
+user_span += '</span>';
+html += '<td valign="bottom"';
+html += '>';
+html += get_speech_bubble( color, user_span );
+html += '</td></tr></table></div>';
+return html;
+}
+function bar(count, max, width) {
+if (!max) max = 1;
+var a_width = Math.floor( (count / max) * width );
+var b_width = Math.floor( ((max - count) / max) * width );
+var html = '';
+html += '<div style="width:'+width+'px; height:14px;">';
+html += '<div class="bar_inner" style="width:'+a_width+'px;">';
+html += '</div>';
+html += '</div>';
+return html;
+}
+function get_ticket_number_disp(num) {
+num = num.toString();
+return "#" + num;
+}
+function png(url, no_alpha_dither) {
+if (ie6 && url.match(/\.png/)) {
+if (url.match(/^images\//)) {
+url = url.replace(/^images\//, '/effect/api/image/');
+}
+else if (url.match(/^\/effect\/images\//)) {
+url = url.replace(/^\/effect\/images\//, '/effect/api/image/');
+}
+if (url.match(/\?/)) url += '&'; else url += '?';
+url += 'format=gif';
+if (no_alpha_dither) url += '&noalphadither=1';
+}
+return url;
+}
+var dblclick_threshold = 0.25;
+var SPACE_BAR = 32;
+var ENTER_KEY = 13;
+var ESC_KEY = 27;
+var DELETE_KEY = 8;
+var TAB_KEY = 9;
+var LEFT_ARROW = 37;
+var RIGHT_ARROW = 39;
+var UP_ARROW = 38;
+var DOWN_ARROW = 40;
+var mozKeyMap = {
+192: '~',
+187: '=',
+189: '-',
+111: '/',
+106: '*',
+109: '-',
+219: '[',
+221: ']',
+220: "\\",
+103: '7',
+104: '8',
+105: '9',
+107: '+',
+186: ':',
+222: '\'',
+100: '4',
+101: '5',
+102: '6',
+188: ',',
+190: '.',
+191: '/',
+97: '1',
+98: '2',
+99: '3',
+96: '0',
+110: '.'
+};
+var keyCodeTitleMap = {
+8: 'Backspace',
+9: 'Tab',
+27: 'Escape',
+32: 'Space',
+192: 'Tilde',
+187: 'Equals',
+189: 'Dash',
+45: 'Insert',
+36: 'Home',
+33: 'Page Up',
+144: 'Num Lock',
+111: 'Slash (Keypad)',
+106: 'Asterisk (Keypad)',
+109: 'Dash (Keypad)',
+219: 'Left Bracket',
+221: 'Right Bracket',
+220: "Backslash",
+46: 'Delete',
+35: 'End',
+34: 'Page Down',
+103: '7 (Keypad)',
+104: '8 (Keypad)',
+105: '9 (Keypad)',
+107: 'Plus (Keypad)',
+186: 'Semicolon',
+222: 'Quote',
+13: 'Enter',
+100: '4 (Keypad)',
+101: '5 (Keypad)',
+102: '6 (Keypad)',
+188: 'Comma',
+190: 'Period',
+191: 'Slash',
+38: 'Up Arrow',
+97: '1 (Keypad)',
+98: '2 (Keypad)',
+99: '3 (Keypad)',
+17: 'Control',
+37: 'Left Arrow',
+40: 'Down Arrow',
+39: 'Right Arrow',
+96: '0 (Keypad)',
+110: 'Period (Keypad)',
+16: 'Shift',
+18: 'Alt/Option',
+224: 'Meta/Cmd'
+};
+function get_nice_key_name(keyCode) {
+if (keyCodeTitleMap[keyCode]) return keyCodeTitleMap[keyCode];
+else {
+var ch = String.fromCharCode(keyCode);
+if ( ((keyCode >= 65) && (keyCode <= 90)) || ((keyCode >= 45) && (keyCode <= 57)) ) {
+return ch;
+}
+else {
+return 'Unknown (#' + keyCode + ')';
+}
+}
+}
+function fix_key_code(keyCode) {
+switch (keyCode) {
+case 59: keyCode = 186; break;
+case 91:
+case 93: keyCode = 224; break;
+}
+return keyCode;
+}
+function get_mouse_coords(e, obj) {
+var pt = {};
+if (document.all) {
+pt.x = e.clientX;
+pt.y = e.clientY;
+}
+else {
+pt.x = e.pageX;
+pt.y = e.pageY;
+}
+if (obj) {
+var info = get_dom_object_info(obj);
+pt.x -= info.left;
+pt.y -= info.top;
+}
+return pt;
+}
+function get_dom_object_info(obj) {
+var info = {
+left: 0,
+top: 0,
+width: obj.width ? obj.width : obj.offsetWidth,
+height: obj.height ? obj.height : obj.offsetHeight
+};
+while (obj) {
+info.left += obj.offsetLeft;
+info.top += obj.offsetTop;
+obj = obj.offsetParent;
+}
+return info;
+}
+function delay_onChange_input_text(e) {
+if (!e) e = window.event;
+var ch = 0;
+if (e.keyCode) ch = e.keyCode;
+else if (e.which) ch = e.which;
+if (ch == 13) {
+if (this.getAttribute('onEnter')) invoke_dom_handler(this, 'onEnter');
+if (e.preventDefault) {
+e.preventDefault();
+e.stopPropagation();
+}
+else {
+e.returnValue = false;
+e.cancelBubble = true;
+}
+return false;
+}
+if (this.getAttribute('onChange')) {
+var obj = this;
+setTimeout( function() { invoke_dom_handler(obj, 'onChange'); }, 1 );
+}
+return true;
+}
+function delay_onChange_textarea() {
+if (this.getAttribute('onChange')) {
+var obj = this;
+setTimeout( function() { invoke_dom_handler(obj, 'onChange'); }, 1 );
+}
+return true;
+}
+function invoke_dom_handler(target, handlerName) {
+if (typeof(target[handlerName]) == 'function') return target[handlerName]();
+var handler = target.getAttribute(handlerName);
+if (!handler) return false;
+var code = handler.toString ? handler.toString() : handler;
+if (code.match(/^function\s+\w+\(\)/)) {
+code = code.substring( code.indexOf("{") + 1, code.lastIndexOf("}") ) + "\r;";
+}
+target['__temp'] = new Function( code );
+target['__temp']();
+}
+var received_mouse_down = false;
+var received_mouse_up = false;
+function pass_event_if(state, e) {
+if (!received_mouse_down || !received_mouse_up) return true;
+if (state) return true;
+else return stop_event(e);
+}
+function stop_event(e) {
+if (e.preventDefault) {
+e.preventDefault();
+e.stopPropagation();
+}
+else {
+e.returnValue = false;
+e.cancelBubble = true;
+}
+return false;
+}
+function stop_textarea_key_event(e) {
+if (!e) e = window.event;
+if (e && !e.metaKey && !e.ctrlKey) {
+return stop_event(e);
+}
+else return true;
+}
+var mouseObj = null;
+function app_mouse_down(e) {
+received_mouse_down = true;
+if (!e) e = window.event;
+if (window.session) session.mouseIsDown = true;
+if (window.session && session.progress) {
+stop_event(e);
+return false;
+}
+if (window.session) session.last_mouse_event = e;
+var targetObj = e.target ? e.target : e.srcElement;
+while (targetObj && !targetObj.tagName.match(/^(BODY|HTML)$/) && !targetObj.getAttribute('captureMouse') && !targetObj.captureMouse) {
+targetObj = targetObj.parentNode ? targetObj.parentNode : targetObj.parentElement;
+}
+if (targetObj && targetObj.getAttribute('captureMouse')) {
+var pt = get_mouse_coords(e, targetObj);
+mouseObj = targetObj;
+targetObj['__captureMouse'] = eval( 'window.' + targetObj.getAttribute('captureMouse') );
+if (!targetObj['__captureMouse']) return alert("captureMouse handler not found: " + targetObj.getAttribute('captureMouse'));
+var result = pass_event_if( targetObj.__captureMouse('mouseDown', e, pt), e );
+if (!result) return false;
+}
+else if (targetObj && targetObj.captureMouse) {
+var pt = get_mouse_coords(e, targetObj);
+mouseObj = targetObj;
+if (mouseObj.captureMouse.onMouseDown) {
+var handlers = always_array( mouseObj.captureMouse.onMouseDown );
+for (var idx = 0, len = handlers.length; idx < len; idx++) {
+var result = pass_event_if(
+(typeof(handlers[idx]) == 'function') ?
+handlers[idx].apply( mouseObj.captureMouse, [e, pt]) :
+window[handlers[idx]].apply( mouseObj.captureMouse, [e, pt]),
+e );
+if (!result) return false;
+}
+}
+}
+var pt = get_mouse_coords(e);
+if (window.session) {
+session.mousePt = pt;
+}
+return true;
+}
+function app_mouse_move(e) {
+if (!e) e = window.event;
+var globalPt = get_mouse_coords(e);
+if ((globalPt.x < 0) || (globalPt.y < 0)) return true;
+if (mouseObj && mouseObj.__captureMouse) {
+var pt = get_mouse_coords(e, mouseObj);
+var result = pass_event_if( mouseObj.__captureMouse('mouseMove', e, pt), e );
+if (!result) return false;
+}
+else if (mouseObj && mouseObj.captureMouse && mouseObj.captureMouse.onMouseMove) {
+var pt = get_mouse_coords(e, mouseObj);
+var handlers = always_array( mouseObj.captureMouse.onMouseMove );
+for (var idx = 0, len = handlers.length; idx < len; idx++) {
+var result = pass_event_if(
+(typeof(handlers[idx]) == 'function') ?
+handlers[idx].apply( mouseObj.captureMouse, [e, pt]) :
+window[handlers[idx]].apply( mouseObj.captureMouse, [e, pt]),
+e );
+if (!result) return false;
+}
+}
+if (window.session) session.mousePt = globalPt;
+safe_call('notify_mouse_move', e);
+return true;
+}
+function app_mouse_up(e) {
+received_mouse_up = true;
+if (!e) e = window.event;
+if (window.session) session.last_mouse_event = e;
+if (window.session) session.mouseIsDown = false;
+var globalPt = get_mouse_coords(e);
+if (mouseObj && mouseObj.__captureMouse) {
+var pt = get_mouse_coords(e, mouseObj);
+var result = pass_event_if( mouseObj.__captureMouse('mouseUp', e, pt), e );
+if (1 || ((pt.x >= 0) && (pt.y >= 0) && (pt.x < mouseObj.offsetWidth) && (pt.y < mouseObj.offsetHeight))) {
+if (mouseObj.__lastClick && (mouseObj.__lastClick > hires_time_now() - dblclick_threshold))
+result = pass_event_if( mouseObj.__captureMouse('doubleClick', e, pt), e );
+else
+result = pass_event_if( mouseObj.__captureMouse('click', e, pt), e );
+mouseObj.__lastClick = hires_time_now();
+}
+mouseObj = null;
+if (!result) return false;
+}
+else if (mouseObj && mouseObj.captureMouse) {
+var pt = get_mouse_coords(e, mouseObj);
+var result = true;
+var handlers = mouseObj.captureMouse.onMouseUp ? always_array( mouseObj.captureMouse.onMouseUp ) : [];
+var capMouse = mouseObj.captureMouse;
+mouseObj = null;
+for (var idx = 0, len = handlers.length; idx < len; idx++) {
+var result = (typeof(handlers[idx]) == 'function') ?
+handlers[idx].apply( capMouse, [e, pt]) :
+window[handlers[idx]].apply( capMouse, [e, pt]);
+if (!result) return stop_event(e);
+}
+if (!result) return false;
+}
+if (window.session) session.mousePt = globalPt;
+return true;
+}
+function ie_dblclick(e) {
+if (!e) e = window.event;
+app_mouse_down(e);
+return app_mouse_up(e);
+}
+function app_key_down(e) {
+if (!e) e = window.event;
+if (window.session) session.last_key_event = e;
+var ch = fix_key_code( e.keyCode );
+if (window.session && session.hooks.keys[ch]) {
+var func = session.hooks.keys[ch];
+delete session.hooks.keys[ch];
+var result = pass_event_if( isa_array(func) ? func[0][ func[1] ](func[2]) : window[func](), e );
+return result;
+}
+var result = pass_event_if( fire_hook('key_down', e), e );
+if (!result) return false;
+safe_call('notify_key_down', e);
+return true;
+}
+function app_key_up(e) {
+if (!e) e = window.event;
+if (window.session) session.last_key_event = e;
+var ch = fix_key_code( e.keyCode );
+var result = pass_event_if( fire_hook('key_up', e), e );
+if (!result) return false;
+return true;
+}
+if (!window.no_hooky) {
+if (window.addEventListener) {
+window.addEventListener( 'mousedown', app_mouse_down, false );
+window.addEventListener( 'mousemove', app_mouse_move, false );
+window.addEventListener( 'mouseup', app_mouse_up, false );
+window.addEventListener( 'keydown', app_key_down, false );
+window.addEventListener( 'keyup', app_key_up, false );
+}
+else {
+if (document.captureEvents) {
+document.captureEvents(Event.MOUSEDOWN);
+document.captureEvents(Event.MOUSEMOVE);
+document.captureEvents(Event.MOUSEUP);
+document.captureEvents(Event.KEYDOWN);
+document.captureEvents(Event.KEYUP);
+}
+var body = document.body ? document.body : document.getElementsByTagName('body')[0];
+if (!body) body = {};
+window.onmousedown = document.onmousedown = body.onmousedown = app_mouse_down;
+window.onmousemove = document.onmousemove = body.onmousemove = app_mouse_move;
+window.onmouseup = document.onmouseup = body.onmouseup = app_mouse_up;
+parent.onkeydown = window.onkeydown = document.onkeydown = app_key_down;
+parent.onkeyup = window.onkeyup = document.onkeyup = app_key_up;
+if (ie) {
+window.ondblclick = document.ondblclick = body.ondblclick = ie_dblclick;
+}
+}
+}
+var webcam_callback = null;
+function get_webcam_html(width, height) {
+var html = '';
+if (ie) {
+html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+protocol+'://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" id="webcam" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="webcam.swf" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /> </object>';
+}
+else {
+html += '<embed id="webcam" src="webcam.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="webcam" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
+}
+return html;
+}
+function webcam_snap(url, callback) {
+if (callback) webcam_callback = callback;
+else webcam_callback = null;
+Debug.trace('webcam', 'Sending snapshot to: ' + url);
+session.webcam_in_progress = true;
+var movie = $('webcam');
+movie._snap( url );
+}
+function webcam_configure(panel) {
+if (!panel) panel = "camera";
+var movie = $('webcam');
+movie._configure(panel);
+}
+function webcam_flash_notify(type, msg) {
+Debug.trace('webcam', 'Flash Notify: ' + type);
+switch (type) {
+case 'flashLoadComplete':
+session.webcam_loaded = true;
+safe_call('notify_webcam_loaded');
+if (!session.cookie.get('wbfuse')) {
+webcam_configure();
+session.cookie.set('wbfuse', 1);
+session.cookie.save();
+}
+break;
+case 'debug':
+alert("Flash Debug: " + msg);
+break;
+case 'error':
+alert("Flash Error: " + msg);
+session.webcam_in_progress = false;
+break;
+case 'success':
+session.webcam_in_progress = false;
+if (webcam_callback) window[webcam_callback](msg);
+break;
+default:
+alert("webcam_flash_notify: " + type + ": " + msg);
+break;
+}
+}
+var zero_client;
+function uploadQueueStart(client, stats) {
+Debug.trace('upload', "Upload queue starting now");
+show_progress_dialog( 0, 'Starting Upload...', true );
+session.upload_in_progress = 1;
+}
+function uploadFileStart(client, stats) {
+Debug.trace('upload', "Upload file starting now");
+update_progress_dialog(stats.progress, "Uploading file " + stats.currentFileNum + " of " + stats.numFiles + "...");
+}
+function uploadProgress(client, stats) {
+update_progress_dialog(stats.progress);
+}
+function uploadFileComplete(client, stats) {
+Debug.trace('upload', "Upload file complete");
+update_progress_dialog(stats.progress);
+}
+function uploadQueueComplete() {
+Debug.trace('upload', "Upload queue complete");
+session.upload_in_progress = 0;
+update_progress_dialog(1.0);
+fire_callback( session.upload_callback );
+}
+function uploadError(client, msg) {
+session.upload_in_progress = 0;
+do_error("Upload Error: " + msg);
+}
+function upload_basic() {
+hide_popup_dialog();
+delete session.progress;
+var html = '';
+html += '<iframe id="i_upload_basic" src="blank.html" style="position:absolute; left:-2000px; top:0px; width:1px; height:1px;"></iframe>';
+html += '<div class="dialog_bkgnd" style="background-image:url('+png('/effect/images/big_icons/upload.png')+')">';
+html += '<table cellspacing=0 cellpadding=0><tr><td width=400 height=200 valign=center align=center>';
+html += '<div class="dialog_title">Upload File</div>';
+html += '<div class="caption">Want to upload multiple files at once? Please upgrade to the latest <a href="http://www.adobe.com/products/flashplayer/" target="_blank">Flash Player</a>, then reload this page. For some reason our Flash based uploader did not load, so you are currently using our single file uploader.</div>';
+html += spacer(1,20) + '<br/>';
+var url = zero_client.targetURL;
+if (url.indexOf('?') > -1) url += '&'; else url += '?';
+url += 'format=jshtml&onafter=' + escape('window.parent.upload_basic_finish(response);');
+Debug.trace('upload', "Prepping basic upload: " + url);
+html += '<form id="f_upload_basic" method="post" enctype="multipart/form-data" target="i_upload_basic" action="'+url+'">';
+html += '<div id="d_upload_form">';
+html += '<input type="file" name="Filedata"/><br/>';
+html += '<br><br><table><tr>';
+html += '<td>' + large_icon_button('x', 'Cancel', "hide_popup_dialog()") + '</td>';
+html += '<td width=50>&nbsp;</td>';
+html += '<td>' + large_icon_button('page_white_get.png', '<b>Upload</b>', "upload_basic_go()") + '</td>';
+html += '</tr></table>';
+html += '</div>';
+html += '<div id="d_upload_progress" style="display:none">';
+html += '<img src="'+images_uri+'/aquaprogressbar.gif" width="196" height="20"/>';
+html += '</div>';
+html += '</form>';
+html += '</div>';
+session.hooks.keys[ESC_KEY] = 'hide_popup_dialog';
+show_popup_dialog(528, 200, html);
+}
+function upload_basic_go() {
+$('f_upload_basic').submit();
+$('d_upload_form').hide();
+$('d_upload_progress').show();
+}
+function upload_basic_finish(response) {
+Debug.trace('upload', "Basic upload complete: " + dumper(response));
+setTimeout( 'upload_basic_finish_2()', 100 );
+}
+function upload_basic_finish_2() {
+$('i_upload_basic').src = 'blank.html';
+setTimeout( 'upload_basic_finish_3()', 100 );
+}
+function upload_basic_finish_3() {
+hide_popup_dialog();
+delete session.progress;
+show_progress_dialog( 0, 'Finishing Upload...', true );
+fire_callback( session.upload_callback );
+}
+function upload_destroy() {
+if (zero_client) {
+zero_client.destroy();
+delete ZeroUpload.clients[ zero_client.id ];
+zero_client = null;
+}
+}
+function prep_upload(dom_id, url, callback, types) {
+session.upload_callback = callback;
+if (url) {
+if (url.indexOf('?') > -1) url += '&'; else url += '?';
+url += 'session=' + session.cookie.get('effect_session_id');
+}
+upload_destroy();
+zero_client = new ZeroUpload.Client();
+if (url) zero_client.setURL( url );
+zero_client.setHandCursor( true );
+if (types) zero_client.setFileTypes( types[0], types[1] );
+zero_client.addEventListener( 'queueStart', uploadQueueStart );
+zero_client.addEventListener( 'fileStart', uploadFileStart );
+zero_client.addEventListener( 'progress', uploadProgress );
+zero_client.addEventListener( 'fileComplete', uploadFileComplete );
+zero_client.addEventListener( 'queueComplete', uploadQueueComplete );
+zero_client.addEventListener( 'error', uploadError );
+zero_client.addEventListener( 'debug', function(client, eventName, args) {
+Debug.trace('upload', "Caught event: " + eventName);
+} );
+if (dom_id) {
+Debug.trace('upload', "Gluing ZeroUpload to: " + dom_id);
+zero_client.glue( dom_id );
+}
+}
+Class.create( 'Debug', {
+__static: {
+enabled: false,
+categories: { all: 1 },
+buffer: [],
+max_rows: 5000,
+win: null,
+ie: !!navigator.userAgent.match(/MSIE/),
+ie6: !!navigator.userAgent.match(/MSIE\D+6/),
+init: function() {
+Debug.enabled = true;
+Debug.trace( 'debug', 'Debug log start' );
+var html = '<p align="right"><input type="button" value="Debug..." onClick="Debug.show()"/></p>';
+if (Debug.ie) {
+setTimeout( function() {
+document.body.insertAdjacentHTML('beforeEnd',
+'<div id="d_debug" style="position:absolute; z-index:101; left:0px; top:0px; width:100%;">' + html + '</div>'
+);
+}, 1000 );
+}
+else {
+var div = document.createElement('DIV');
+div.id = 'd_debug';
+div.setAttribute('id', 'd_debug');
+div.style.position = Debug.ie6 ? 'absolute' : 'fixed';
+div.style.zIndex = '101';
+div.style.left = '0px';
+div.style.top = '0px';
+div.style.width = '100%';
+div.innerHTML = html;
+document.getElementsByTagName('body')[0].appendChild(div);
+}
+},
+show: function() {
+if (!Debug.win || Debug.win.closed) {
+Debug.trace('debug', "Opening debug window");
+Debug.win = window.open( '', 'DebugWindow', 'width=600,height=500,menubar=no,resizable=yes,scrollbars=yes,location=no,status=no,toolbar=no,directories=no' );
+if (!Debug.win) return alert("Failed to open window. Popup blocker maybe?");
+var doc = Debug.win.document;
+doc.open();
+doc.writeln( '<html><head><title>Debug Log</title></head><body onLoad="window.opener.Debug.refresh_console()">' );
+doc.writeln( '<div id="d_debug_log"></div>' );
+doc.writeln( '<hr/>' );
+doc.writeln( '<form action="javascript:void(window.opener.Debug.console_execute())" style="margin:0; padding:0;"><table width="100%"><tr>' );
+doc.writeln( '<td width="*"><input type="text" id="fe_command" style="width:100%;"/></td>' );
+doc.writeln( '<td width="50"><input type=button value="Clear" onClick="document.getElementById(\'d_debug_log\').innerHTML = \'\';"/></td>' );
+doc.writeln( '</tr></table></form>' );
+doc.writeln( '</body></html>' );
+doc.close();
+}
+Debug.win.focus();
+},
+console_execute: function() {
+var cmd = Debug.win.document.getElementById('fe_command');
+if (cmd.value.length) {
+Debug.trace( 'console', cmd.value );
+try {
+Debug.trace( 'console', '' + eval(cmd.value) );
+}
+catch (e) {
+Debug.trace( 'error', 'JavaScript Interpreter Exception: ' + e.toString() );
+}
+}
+},
+get_time_stamp: function(now) {
+var date = new Date( now * 1000 );
+var hh = date.getHours(); if (hh < 10) hh = "0" + hh;
+var mi = date.getMinutes(); if (mi < 10) mi = "0" + mi;
+var ss = date.getSeconds(); if (ss < 10) ss = "0" + ss;
+var sss = '' + date.getMilliseconds(); while (sss.length < 3) sss = "0" + sss;
+return '' + hh + ':' + mi + ':' + ss + '.' + sss;
+},
+refresh_console: function() {
+if (!Debug.win || Debug.win.closed) return;
+var div = Debug.win.document.getElementById('d_debug_log');
+if (div) {
+var row = null;
+while ( row = Debug.buffer.shift() ) {
+var time_stamp = Debug.get_time_stamp(row.time);
+var msg = row.msg;
+msg = msg.replace(/\t/g, "&nbsp;&nbsp;&nbsp;&nbsp;");
+msg = msg.replace(/</g, "&lt;");
+msg = msg.replace(/>/g, "&gt;");
+msg = msg.replace(/\n/g, "<br>\n");
+var html = '';
+var sty = 'float:left; font-family: Consolas, Courier, mono; font-size: 12px; cursor:default; margin-right:10px; margin-bottom:1px; padding:2px;';
+html += '<div style="'+sty+' background-color:#eee;">' + time_stamp + '</div>';
+html += '<div style="'+sty+' background-color:#eee; width:60px; overflow:hidden;">' + row.cat + '</div>';
+html += '<div style="'+sty+' background-color:#fff; word-break:break-all;">' + msg + '</div>';
+html += '<br clear="all"/>';
+var chunk = Debug.win.document.createElement('DIV');
+chunk.style['float'] = 'none';
+chunk.innerHTML = html;
+div.appendChild(chunk);
+}
+var cmd = Debug.win.document.getElementById('fe_command');
+cmd.focus();
+}
+Debug.dirty = 0;
+Debug.win.scrollTo(0, 99999);
+},
+hires_time_now: function() {
+var now = new Date();
+return ( now.getTime() / 1000 );
+},
+trace: function(cat, msg) {
+if (arguments.length == 1) {
+msg = cat;
+cat = 'debug';
+}
+if (Debug.categories.all || Debug.categories[cat]) {
+Debug.buffer.push({ cat: cat, msg: msg, time: Debug.hires_time_now() });
+if (Debug.buffer.length > Debug.max_rows) Debug.buffer.shift();
+if (!Debug.dirty) {
+Debug.dirty = 1;
+setTimeout( 'Debug.refresh_console();', 1 );
+}
+}
+}
+}
+} );
+var session = {
+inited: false,
+api_mod_cache: {},
+query: parseQueryString( ''+location.search ),
+cookie: new CookieTree({ path: '/effect/' }),
+storage: {},
+storage_dirty: false,
+hooks: {
+keys: {}
+},
+username: '',
+em_width: 11,
+audioResourceMatch: /\.mp3$/i,
+imageResourceMatch: /\.(jpe|jpeg|jpg|png|gif)$/i,
+textResourceMatch: /\.xml$/i,
+movieResourceMatch: /\.(flv|mp4|mp4v|mov|3gp|3g2)$/i,
+imageResourceMatchString: '\.(jpe|jpeg|jpg|png|gif)$'
+};
+session.debug = session.query.debug ? true : false;
+var page_manager = null;
+var preload_icons = [];
+var preload_images = [
+'loading.gif',
+'aquaprogressbar.gif',
+'aquaprogressbar_bkgnd.gif'
+];
+function get_base_url() {
+return protocol + '://' + location.hostname + session.config.BaseURI;
+}
+function effect_init() {
+if (session.inited) return;
+session.inited = true;
+assert( window.config, "Config not loaded" );
+session.config = window.config;
+Debug.trace("Starting up");
+rendering_page = false;
+preload();
+window.$R = {};
+for (var key in config.RegExpShortcuts) {
+$R[key] = new RegExp( config.RegExpShortcuts[key] );
+}
+ww_precalc_font("body", "effect_precalc_font_finish");
+page_manager = new Effect.PageManager( config.Pages.Page );
+var session_id = session.cookie.get('effect_session_id');
+if (session_id && session_id.match(/^login/)) {
+do_session_recover();
+}
+else {
+show_default_login_status();
+Nav.init();
+}
+Blog.search({
+stag: 'sidebar_docs',
+limit: 20,
+title_only: true,
+sort_by: 'seq',
+sort_dir: -1,
+target: 'd_sidebar_documents',
+outer_div_class: 'sidebar_blog_row',
+title_class: 'sidebar_blog_title',
+after: '<div class="sidebar_see_more">&rarr; <a href="#ArticleCategory/docs">See More...</a></div>'
+});
+Blog.search({
+stag: 'sidebar_tutorials',
+limit: 5,
+title_only: true,
+sort_by: 'seq',
+sort_dir: -1,
+target: 'd_sidebar_tutorials',
+outer_div_class: 'sidebar_blog_row',
+title_class: 'sidebar_blog_title',
+after: '<div class="sidebar_see_more">&rarr; <a href="#ArticleCategory/tutorials">See More...</a></div>'
+});
+Blog.search({
+stag: 'sidebar_plugins',
+limit: 5,
+title_only: true,
+sort_by: 'seq',
+sort_dir: -1,
+target: 'd_sidebar_plugins',
+outer_div_class: 'sidebar_blog_row',
+title_class: 'sidebar_blog_title',
+after: '<div class="sidebar_see_more">&rarr; <a href="#ArticleCategory/plugins">See More...</a></div>'
+});
+$('fe_search_bar').onkeydown = delay_onChange_input_text;
+user_storage_idle();
+}
+function effect_precalc_font_finish(width, height) {
+session.em_width = width;
+}
+function preload() {
+for (var idx = 0, len = preload_icons.length; idx < len; idx++) {
+var url = images_uri + '/icons/' + preload_icons[idx] + '.gif';
+preload_icons[idx] = new Image();
+preload_icons[idx].src = url;
+}
+for (var idx = 0, len = preload_images.length; idx < len; idx++) {
+var url = images_uri + '/' + preload_images[idx];
+preload_images[idx] = new Image();
+preload_images[idx].src = url;
+}
+}
+function $P(id) {
+if (!id) id = page_manager.current_page_id;
+var page = page_manager.find(id);
+assert( !!page, "Failed to locate page: " + id );
+return page;
+}
+function get_pref(name) {
+if (!session.user || !session.user.Preferences) return alert("ASSERT FAILURE! Tried to lookup pref " + name + " and user is not yet loaded!");
+return session.user.Preferences[name];
+}
+function get_bool_pref(name) {
+return (get_pref(name) == 1);
+}
+function set_pref(name, value) {
+session.user.Preferences[name] = value;
+}
+function set_bool_pref(name, value) {
+set_pref(name, value ? '1' : '0');
+}
+function save_prefs() {
+var prefs_to_save = {};
+if (arguments.length) {
+for (var idx = 0, len = arguments.length; idx < len; idx++) {
+var key = arguments[idx];
+prefs_to_save[key] = get_pref(key);
+}
+}
+else prefs_to_save = session.user.Preferences;
+effect_api_mod_touch('user_get');
+effect_api_send('user_update', {
+Username: session.username,
+Preferences: prefs_to_save
+}, 'save_prefs_2');
+}
+function save_prefs_2(response) {
+do_message('success', 'Preferences saved.');
+}
+
+function get_full_name(username) {
+var user = session.users[username];
+if (!user) return username;
+return user.FullName;
+}
+function get_buddy_icon_url(username, size) {
+var mod = session.api_mod_cache.get_buddy_icon || 0;
+if (!size) size = 32;
+var url = '/effect/api/get_buddy_icon?username='+username + '&mod=' + mod + '&size=' + size;
+return url;
+}
+function get_buddy_icon_display(username, show_icon, show_name) {
+if ((typeof(show_icon) == 'undefined') && get_bool_pref('show_user_icons')) show_icon = 1;
+if ((typeof(show_name) == 'undefined') && get_bool_pref('show_user_names')) show_name = 1;
+var html = '';
+if (show_icon) html += '<img class="png" src="'+get_buddy_icon_url(username)+'" width="32" height="32" border="0"/>';
+if (show_icon && show_name) html += '<br/>';
+if (show_name) html += username;
+return html;
+}
+function do_session_recover() {
+session.hooks.after_error = 'do_logout';
+effect_api_send('session_recover', {}, 'do_login_2', { _from_recover: 1 } );
+}
+function require_login() {
+if (session.user) return true;
+Debug.trace('Page requires login, showing login page');
+session.nav_after_login = Nav.currentAnchor();
+setTimeout( function() {
+Nav.go( 'Login' );
+}, 1 );
+return false;
+}
+function popup_window(url, name) {
+if (!url) url = '';
+if (!name) name = '';
+var win = window.open(url, name);
+if (!win) return alert('Failed to open popup window. If you have a popup blocker, please disable it for this website and try again.');
+return win;
+}
+function do_login_prompt() {
+hide_popup_dialog();
+delete session.progress;
+if (!session.temp_password) session.temp_password = '';
+if (!session.username) session.username = '';
+var temp_username = session.open_id || session.username || '';
+var html = '';
+html += '<div class="dialog_bkgnd" style="background-image:url('+png('images/big_icons/key.png')+')">';
+html += '<table cellspacing=0 cellpadding=0><tr><td width=450 height=225 valign=center align=center>';
+html += '<div class="dialog_title">Effect Developer Login</div>';
+html += '<form method=get action="javascript:void(0)"><table cellspacing="0" cellpadding="0"><tr><td align="left">';
+html += '<div class="fe_label"><table cellspacing="0" cellpadding="0"><tr><td>Effect Username&nbsp;&nbsp;or&nbsp;&nbsp;</td><td>'+icon('openid', 'OpenID', 'popup_window(\'http://openid.net/\')', 'What is OpenID?')+'</td></tr></table></div><input type=text class="fe_big" id="fe_username" size=20 value="'+temp_username+'"><br><br>';
+html += '<input type=checkbox id="fe_auto_login" value="1"><label for="fe_auto_login"><span class="fe_label">Keep me logged in</span></label><br>';
+html += '</td></tr></table>';
+html += '<br><br><table><tr>';
+html += '<td>' + large_icon_button('x', 'Cancel', "clear_login()") + '</td>';
+html += '<td width=30>&nbsp;</td>';
+html += '<td>' + large_icon_button('check', '<b>Login</b>', 'do_login()') + '</td>';
+html += '</tr></table>';
+html += '</form>';
+html += '</div>';
+session.hooks.keys[ENTER_KEY] = 'do_login';
+session.hooks.keys[ESC_KEY] = 'clear_login';
+safe_focus( 'fe_username' );
+show_popup_dialog(450, 225, html);
+}
+function do_openid_reg(title, auto_login_button) {
+hide_popup_dialog();
+delete session.progress;
+if (!title) title = 'Register Account Using OpenID';
+if (typeof(auto_login_button) == 'undefined') auto_login_button = 1;
+var html = '';
+html += '<div class="dialog_bkgnd" style="background-image:url('+png('images/big_icons/openid.png')+')">';
+html += '<table cellspacing=0 cellpadding=0><tr><td width=450 height=225 valign=center align=center>';
+html += '<div class="dialog_title">'+title+'</div>';
+html += '<form method=get action="javascript:void(0)"><table cellspacing="0" cellpadding="0"><tr><td align="left">';
+html += '<div class="fe_label"><table cellspacing="0" cellpadding="0"><tr><td>'+icon('openid', 'Enter Your OpenID URL:')+'</td></tr></table></div><input type=text class="fe_big" id="fe_username" size=20 value="">';
+if (auto_login_button) html += '<br><br><input type=checkbox id="fe_auto_login" value="1"><label for="fe_auto_login"><span class="fe_label">Keep me logged in</span></label><br>';
+html += '</td></tr></table>';
+html += '<br><br><table><tr>';
+html += '<td>' + large_icon_button('x', 'Cancel', "hide_popup_dialog()") + '</td>';
+html += '<td width=30>&nbsp;</td>';
+html += '<td>' + large_icon_button('check', title.match(/login/i) ? '<b>Login</b>' : '<b>Register</b>', 'do_openid_login()') + '</td>';
+html += '</tr></table>';
+html += '</form>';
+html += '</div>';
+session.hooks.keys[ENTER_KEY] = 'do_openid_login';
+session.hooks.keys[ESC_KEY] = 'hide_popup_dialog';
+safe_focus( 'fe_username' );
+show_popup_dialog(450, 225, html);
+}
+function do_login_prompt_2() {
+hide_popup_dialog();
+delete session.progress;
+if (!session.temp_password) session.temp_password = '';
+if (!session.username) session.username = '';
+var html = '';
+html += '<div class="dialog_bkgnd" style="background-image:url('+png('images/big_icons/key.png')+')">';
+html += '<table cellspacing=0 cellpadding=0><tr><td width=450 height=225 valign=center align=center>';
+html += '<div class="dialog_title">Enter Your Password</div>';
+html += '<form method=get action="javascript:void(0)"><table cellspacing="0" cellpadding="0"><tr><td align="left">';
+html += '<div class="fe_label">Password:</div><input type=password class="fe_big" id="fe_lp_password" size=20 value="'+session.temp_password+'"><br><br>';
+html += '<input type=checkbox id="fe_auto_login" value="1" '+(session.auto_login ? 'checked="checked"' : '')+'><label for="fe_auto_login"><span class="fe_label">Keep me logged in</span></label><br>';
+html += '</td></tr></table>';
+html += '<br><br><table><tr>';
+html += '<td>' + large_icon_button('x', 'Cancel', "clear_login()") + '</td>';
+html += '<td width=30>&nbsp;</td>';
+html += '<td>' + large_icon_button('check', '<b>Login</b>', 'do_effect_login()') + '</td>';
+html += '</tr></table>';
+html += '</form>';
+html += '</div>';
+session.hooks.keys[ENTER_KEY] = 'do_effect_login';
+session.hooks.keys[ESC_KEY] = 'clear_login';
+safe_focus( 'fe_lp_password' );
+show_popup_dialog(450, 225, html);
+}
+function clear_login() {
+hide_popup_dialog();
+Nav.prev();
+}
+function do_login() {
+if ($('fe_username').value.match(/^\w+$/)) {
+session.username = $('fe_username').value;
+session.auto_login = $('fe_auto_login').checked;
+do_login_prompt_2();
+return;
+}
+else {
+do_openid_login();
+}
+}
+function do_openid_login() {
+if (!$('fe_username').value) return;
+session.openid_win = popup_window('');
+if (!session.openid_win) return;
+session.open_id = $('fe_username').value;
+session.auto_login = $('fe_auto_login') && $('fe_auto_login').checked;
+hide_popup_dialog();
+show_progress_dialog(1, "Logging in...");
+session.hooks.before_error = 'close_openid_window';
+session.hooks.after_error = 'do_login_prompt';
+effect_api_send('openid_login', {
+OpenID: session.open_id,
+Infinite: session.auto_login ? 1 : 0
+}, 'do_openid_login_2');
+}
+function close_openid_window() {
+if (session.openid_win) {
+session.openid_win.close();
+delete session.openid_win;
+}
+}
+function do_openid_login_2(response) {
+if (response.CheckURL) {
+Debug.trace('openid', "Redirecting popup window to OpenID Check URL: " + response.CheckURL);
+show_progress_dialog(1, "Waiting for popup window...", false, ['x', 'Cancel', 'do_login_prompt()']);
+session.openid_win.location = response.CheckURL;
+session.openid_win.focus();
+}
+}
+function receive_openid_response(iframe_response) {
+var response = deep_copy_object(iframe_response);
+Debug.trace('openid', "Received OpenID Response: " + dumper(response));
+hide_popup_dialog();
+if (response.Code) {
+close_openid_window();
+return do_error( response.Description );
+}
+delete session.hooks.before_error;
+delete session.hooks.after_error;
+if (response.SessionID) {
+session.cookie.set( 'effect_session_id', response.SessionID );
+session.cookie.save();
+}
+switch (response.Action) {
+case 'popup':
+show_progress_dialog(1, "Waiting for popup window...", false, ['x', 'Cancel', 'do_login_prompt()']);
+Debug.trace('openid', "Redirecting popup window to OpenID Setup URL: " + response.SetupURL);
+session.openid_win.location = response.SetupURL;
+session.openid_win.focus();
+break;
+case 'login':
+close_openid_window();
+do_login_2(response);
+break;
+case 'register':
+if (!response.Info) response.Info = {};
+close_openid_window();
+Debug.trace('openid', 'Original OpenID: ' + response.OpenID_Login);
+Debug.trace('openid', 'Clean OpenID: ' + response.OpenID_Unique);
+Debug.trace('openid', 'Registration Info: ' + dumper(response.Info));
+session.prereg = response.Info;
+session.prereg.open_id_login = response.OpenID_Login;
+session.prereg.open_id = response.OpenID_Unique;
+if (session.user) {
+if (!session.user.OpenIDs) session.user.OpenIDs = {};
+if (!session.user.OpenIDs.OpenID) session.user.OpenIDs.OpenID = [];
+var dupe = find_object( session.user.OpenIDs.OpenID, { Unique: session.prereg.open_id } );
+if (dupe) return do_error("That OpenID is already registered and attached to your account. No need to add it again.");
+session.user.OpenIDs.OpenID.push({
+Login: session.prereg.open_id_login,
+Unique: session.prereg.open_id
+});
+setTimeout( function() {
+Nav.go('MyAccount', true);
+do_message('success', 'Added new OpenID URL to account.');
+}, 1 );
+}
+else {
+setTimeout( function() { Nav.go('CreateAccount', true); }, 1 );
+}
+break;
+}
+}
+function do_effect_login() {
+var password = $('fe_lp_password').value;
+session.auto_login = $('fe_auto_login').checked;
+hide_popup_dialog();
+show_progress_dialog(1, "Logging in...");
+session.hooks.after_error = 'do_login_prompt';
+effect_api_send('user_login', {
+Username: session.username,
+Password: password,
+Infinite: session.auto_login ? 1 : 0
+}, 'do_login_2');
+}
+function do_logout() {
+effect_api_send('user_logout', {}, 'do_logout_2');
+}
+function do_logout_2(response) {
+hide_popup_dialog();
+show_default_login_status();
+delete session.hooks.after_error;
+delete session.cookie.tree.effect_session_id;
+session.cookie.save();
+session.storage = {};
+session.storage_dirty = false;
+delete session.user;
+delete session.first_login;
+var old_username = session.username;
+session.username = '';
+if (Nav.inited) {
+Nav.go('Main');
+if (old_username) $GR.growl('success', "Logged out of account: " + old_username);
+}
+else {
+Nav.init();
+}
+}
+function do_login_2(response, tx) {
+if (response.FirstLogin) session.first_login = 1;
+if (response.User.UserStorage) {
+Debug.trace('Recovering site storage blob: session.storage = ' + response.User.UserStorage + ';');
+try {
+eval( 'session.storage = ' + response.User.UserStorage + ';' );
+}
+catch (e) {
+Debug.trace("SITE STORAGE RECOVERY FAILED: " + e);
+session.storage = {};
+}
+delete response.User.UserStorage;
+session.storage_dirty = false;
+}
+session.user = response.User;
+session.username = session.user.Username;
+hide_popup_dialog();
+delete session.hooks.after_error;
+update_header();
+if (!tx || !tx._from_recover) $GR.growl('success', "Logged in as: " + session.username);
+if (session.nav_after_login) {
+Nav.go( session.nav_after_login );
+delete session.nav_after_login;
+}
+else if (Nav.currentAnchor().match(/^Login/)) {
+Nav.go('Home');
+}
+else {
+Nav.refresh();
+}
+Nav.init();
+}
+function user_storage_mark() {
+Debug.trace("Marking user storage as dirty");
+session.storage_dirty = true;
+}
+function user_storage_idle() {
+if (session.storage_dirty && !session.mouseIsDown) {
+user_storage_save();
+session.storage_dirty = false;
+}
+setTimeout( 'user_storage_idle()', 5000 );
+}
+function user_storage_save() {
+if (session.user) {
+Debug.trace("Committing user storage blob");
+effect_api_send('update_user_storage', { Data: serialize(session.storage) }, 'user_storage_save_finish', { _silent: 1 } );
+}
+}
+function user_storage_save_finish(response, tx) {
+}
+function show_default_login_status() {
+$('d_sidebar_wrapper_recent_games').hide();
+$('d_login_status').innerHTML = '<center><table><tr><td>' +
+large_icon_button('key', "<b>Login</b>", '#Home') + '</td>' +
+'<td>' + spacer(1,1) + '<td>' +
+'<td>' + large_icon_button('user_add.png', "<b>Signup</b>", '#CreateAccount') + '</td></tr></table>' +
+'</center>';
+$('d_tagline').innerHTML =
+'<a href="#Home">Login</a>' + ' <span class="spacer">|</span> ' +
+'<a href="#CreateAccount">Create Account</a>';
+}
+function update_header() {
+var html = '';
+html += '<table><tr><td>';
+html += '<a href="#Home">';
+html += '<img class="png" src="'+get_buddy_icon_url(session.username) + '" width="32" height="32" border="0"/>';
+html += '</a>';
+html += '</td><td>'+spacer(2,2)+'</td><td>';
+html += session.user.FullName + '<br/>';
+html += spacer(1,5) + '<br/>';
+html += '<a href="#Home"><b>My Home</b></a>&nbsp;&nbsp;|&nbsp;&nbsp;';
+html += '<a href="javascript:void(0)" onClick="do_logout()">Logout</a>';
+html += '</td></tr></table>';
+$('d_login_status').innerHTML = html;
+$('d_tagline').innerHTML =
+'Welcome '+session.user.FirstName+'' + ' <span class="spacer">|</span> ' +
+'<a href="#Home">My Home</a>' + ' <span class="spacer">|</span> ' +
+'<a href="javascript:void(0)" onClick="do_logout()">Logout</a>';
+effect_api_get( 'get_user_games', { limit:5, offset:0 }, 'receive_sidebar_recent_games', { } );
+}
+function receive_sidebar_recent_games(response, tx) {
+var html = '';
+if (response.Rows && response.Rows.Row) {
+var games = always_array( response.Rows.Row );
+for (var idx = 0, len = games.length; idx < len; idx++) {
+var game = games[idx];
+html += '<div class="sidebar_blog_row">';
+html += '<div class="sidebar_blog_title"><a href="#Game/'+game.GameID+'">'+ww_fit_string(game.Title, 170, session.em_width, 1)+'</a></div>';
+html += '</div>';
+}
+html += '<div class="sidebar_see_more">&rarr; <a href="#GameEdit">Create New Game...</a></div>';
+$('d_sidebar_recent_games').innerHTML = html;
+$('d_sidebar_wrapper_recent_games').show();
+}
+else {
+$('d_sidebar_wrapper_recent_games').hide();
+}
+}
+function check_privilege(key) {
+if (!session.user) return false;
+if (session.user.Privileges.admin == 1) return true;
+if (!key.toString().match(/^\//)) key = '/' + key;
+var value = lookup_path(key, session.user.Privileges);
+return( value && (value != 0) );
+}
+function is_admin() {
+return check_privilege('admin');
+}
+function upgrade_flash_error() {
+return alert("Sorry, file upload requires Adobe Flash Player 9 or higher.");
+}
+function cancel_user_image_manager() {
+upload_destroy();
+hide_popup_dialog();
+delete session.hooks.keys[DELETE_KEY];
+}
+function do_user_image_manager(callback) {
+if (callback) session.uim_callback = callback;
+else session.uim_callback = null;
+session.temp_last_user_img = null;
+session.temp_last_user_image_filename = '';
+var html = '<table cellspacing=0 cellpadding=0><tr><td width=500 height=300 valign=center align=center>';
+html += '<div class="dialog_title">Image Manager</div>';
+html += '<div class="vert_selector" id="d_user_image_list" style="width:480px; height:200px;">';
+html += '<img src="images/loading.gif" width="32" height="32" style="margin-left:174px; margin-top:84px"/>';
+html += '</div>';
+html += '<br><table><tr>';
+html += '<td>' + large_icon_button('x', 'Cancel', 'cancel_user_image_manager()') + '</td>';
+html += '<td width=25>&nbsp;</td>';
+html += '<td>' + large_icon_button('bullet_upload.png', 'Upload Files...', 'upload_basic()', 'b_upload_user_image') + '</td>';
+html += '<td width=25>&nbsp;</td>';
+html += '<td>' + large_icon_button('check', '<b>Choose</b>', 'do_choose_user_image()', 'btn_choose_user_image', '', 'disabled') + '</td>';
+html += '</tr></table>';
+html += '</td></tr></table>';
+session.hooks.keys[ENTER_KEY] = 'do_choose_user_image';
+session.hooks.keys[ESC_KEY] = 'cancel_user_image_manager';
+session.hooks.keys[DELETE_KEY] = 'do_delete_selected_user_image';
+show_popup_dialog(500, 300, html);
+var self = this;
+setTimeout( function() {
+prep_upload('b_upload_user_image', '/effect/api/upload_user_image', [self, 'do_upload_user_image_2'], ['Image Files', '*.jpg;*.jpe;*.jpeg;*.gif;*.png']);
+}, 1 );
+var args = {
+limit: 50,
+offset: 0,
+random: Math.random()
+};
+effect_api_get( 'user_images_get', args, 'uim_populate_images', { } );
+}
+function do_upload_user_image_2() {
+effect_api_mod_touch('user_images_get');
+effect_api_send('user_get', {
+Username: session.username
+}, [this, 'do_upload_user_image_3']);
+}
+function do_upload_user_image_3(response) {
+if (response.User.LastUploadError) return do_error( "Failed to upload image: " + response.User.LastUploadError );
+do_user_image_manager( session.uim_callback );
+}
+function uim_populate_images(response, tx) {
+var html = '';
+var base_url = '/effect/api/view/users/' + session.username + '/images';
+if (response.Rows && response.Rows.Row) {
+var imgs = always_array( response.Rows.Row );
+for (var idx = 0, len = imgs.length; idx < len; idx++) {
+var img = imgs[idx];
+var class_name = ((img.Filename == session.temp_last_user_image_filename) ? 'choose_item_selected' : 'choose_item');
+html += '<img class="'+class_name+'" src="'+base_url+'/'+img.Thumbnail+'" width="80" height="60" onClick="do_select_user_image(this,\''+img.Filename+'\')" onDblClick="do_select_user_image(this,\''+img.Filename+'\'); do_choose_user_image();">';
+}
+}
+else {
+html = '';
+}
+$('d_user_image_list').innerHTML = html;
+}
+function do_select_user_image(img, filename) {
+if (session.temp_last_user_img) session.temp_last_user_img.className = 'choose_item';
+img.className = 'choose_item_selected';
+$('btn_choose_user_image').removeClass('disabled');
+session.temp_last_user_img = img;
+session.temp_last_user_image_filename = filename;
+}
+function do_delete_selected_user_image() {
+if (session.temp_last_user_image_filename) {
+effect_api_send('user_image_delete', { Filename: session.temp_last_user_image_filename }, 'do_delete_selected_user_image_finish', {});
+}
+}
+function do_delete_selected_user_image_finish(response, tx) {
+try { $('d_user_image_list').removeChild( session.temp_last_user_img ); } catch(e) {;}
+session.temp_last_user_img = null;
+session.temp_last_user_image_filename = null;
+}
+function do_choose_user_image() {
+if (!session.temp_last_user_image_filename) return;
+if (session.uim_callback) {
+fire_callback( session.uim_callback, session.temp_last_user_image_filename );
+}
+cancel_user_image_manager();
+}
+function user_image_thumbnail(filename, width, height, attribs) {
+var username = session.username;
+if (filename.match(/^(\w+)\/(.+)$/)) {
+username = RegExp.$1;
+filename = RegExp.$2;
+}
+var url = '/effect/api/view/users/' + username + '/images/' + filename.replace(/\.(\w+)$/, '_thumb.jpg');
+return '<img src="'+url+'" width="'+width+'" height="'+height+'" '+compose_attribs(attribs)+'/>';
+}
+function get_user_display(username, full_name, base_url) {
+if (!base_url) base_url = '';
+return icon('user', full_name || username, base_url + '#User/' + username);
+}
+function get_game_tab_bar(game_id, cur_page_name) {
+return tab_bar([
+['#Game/' + game_id, 'Game', 'controller.png'],
+['#GameDisplay/' + game_id, 'Display', 'monitor.png'],
+['#GameAssets/' + game_id, 'Assets', 'folder_page_white.png'],
+['#GameObjects/' + game_id, 'Objects', 'bricks.png'],
+['#GameAudio/' + game_id, 'Audio', 'sound.gif'],
+['#GameKeys/' + game_id, 'Keyboard', 'keyboard.png'],
+['#GameLevels/' + game_id, 'Levels', 'world.png'],
+['#GamePublisher/' + game_id, 'Publish', 'cd.png']
+], cur_page_name);
+}
+function get_user_tab_bar(cur_page_name) {
+var tabs = [
+['#Home', 'My Home', 'house.png']
+];
+tabs.push( ['#MyAccount', 'Edit Account', 'user_edit.png'] );
+tabs.push( ['#ArticleEdit', 'Post Article', 'page_white_edit.png'] );
+if (config.ProEnabled) {
+tabs.push( ['#UserPayments', 'Payments', 'money.png'] );
+}
+tabs.push( ['#UserLog', 'Security Log', 'application_view_detail.png'] );
+return tab_bar(tabs, cur_page_name);
+}
+function get_admin_tab_bar(cur_page_name) {
+var tabs = [];
+tabs.push( ['#Admin', 'Admin', 'lock.png'] );
+tabs.push( ['#TicketSearch/bugs', 'Bug Tracker', 'bug.png'] );
+tabs.push( ['#TicketSearch/helpdesk', 'Help Desk', 'telephone.png'] );
+tabs.push( ['#AdminReport', 'Reports', 'chart_pie.png'] );
+return tab_bar(tabs, cur_page_name);
+}
+function get_string(path, args) {
+assert(window.config, "get_string() called before config loaded");
+if (!args) args = {};
+args.config = config;
+args.session = session;
+args.query = session.query;
+var value = lookup_path(path, config.Strings);
+return (typeof(value) == 'string') ? substitute(value, args) : value;
+}
+function normalize_dir_path(path) {
+if (!path.match(/^\//)) path = '/' + path;
+if (!path.match(/\/$/)) path += '/';
+return path;
+}
+function textedit_window_save(storage_key, filename, content, callback) {
+if (!callback) callback = null;
+effect_api_mod_touch('textedit');
+if (storage_key.match(/^\/games\/([a-z0-9][a-z0-9\-]*[a-z0-9])\/assets(.+)$/)) {
+var game_id = RegExp.$1;
+var path = RegExp.$2;
+show_progress_dialog(1, "Saving file...");
+effect_api_send('asset_save_file_contents', {
+GameID: game_id,
+Path: path,
+Filename: filename,
+Content: content
+}, 'textedit_window_save_finish', { _mode: 'asset', _game_id: game_id, _filename: filename, _callback: callback } );
+}
+else {
+show_progress_dialog(1, "Saving data...");
+effect_api_send('admin_save_file_contents', {
+Path: storage_key,
+Filename: filename,
+Content: content
+}, 'textedit_window_save_finish', { _mode: 'admin', _storage_key: storage_key, _filename: filename, _callback: callback } );
+}
+}
+function textedit_window_save_finish(response, tx) {
+hide_progress_dialog();
+if (tx._mode == 'asset') {
+do_message('success', "Saved asset: \""+tx._filename+"\"");
+show_glog_widget();
+}
+else {
+do_message('success', "Saved data: \""+tx._storage_key+'/'+tx._filename+"\"");
+}
+if (tx._callback) tx._callback();
+}
+function do_buy(args) {
+$P().hide();
+$('d_page_loading').show();
+effect_api_send('create_order', args, 'do_buy_redirect', { _buy_args: args } );
+}
+function do_buy_redirect(response, tx) {
+var args = tx._buy_args;
+$('fe_gco_title').value = args.Title || '';
+$('fe_gco_desc').value = args.Desc || '';
+$('fe_gco_price').value = args.Price || '';
+$('fe_gco_after').value = args.After || '';
+$('fe_gco_unique_id').value = response.OrderID;
+Debug.trace('payment', "Redirecting to Google Checkout");
+setTimeout( function() { $('BB_BuyButtonForm').submit(); }, 1 );
+}
+function show_glog_widget(game_id) {
+if (!game_id) game_id = session.glog_game_id;
+if (!game_id) {
+$('glog_widget').hide();
+return;
+}
+if (game_id != session.glog_game_id) {
+$('glog_widget').hide();
+session.glog_game_id = game_id;
+update_glog_widget(game_id);
+}
+else {
+$('glog_widget').show();
+setTimeout( function() { update_glog_widget(game_id); }, 500 );
+}
+}
+function update_glog_widget(game_id) {
+effect_api_get('game_get_log', {
+id: game_id,
+offset: 0,
+limit: 1,
+rand: Math.random()
+}, 'receive_glog_data', { _game_id: game_id });
+}
+function receive_glog_data(response, tx) {
+var game_id = tx._game_id;
+if (response && response.Rows && response.Rows.Row) {
+var rows = always_array( response.Rows.Row );
+var row = rows[0];
+var html = '';
+html += '<div class="h2" style="margin-bottom:5px;">';
+html += '<div class="fl">Latest Game Activity</div>';
+html += '<div class="fr"><a href="#GameLog/'+game_id+'" title="View Log" class="icon" style="margin-left:5px; background-image:url(images/icons/application_view_detail.png)">View Log</a></div>';
+html += '<div class="fr"><a href="javascript:void(show_glog_post_dialog(\''+game_id+'\'))" title="Post Message" class="icon" style="margin-left:5px; background-image:url(images/icons/comment_edit.png)">Post Message</a></div>';
+html += '<div class="clear"></div>';
+html += '</div>';
+html += '<table><tr>';
+html += '<td style="cursor:pointer" onClick="Nav.go(\'User/'+row.Username+'\')">' + get_buddy_icon_display(row.Username, 1, 0) + '</td>';
+html += '<td>';
+html += '<div>' + icon( get_icon_for_glog_type(row.Type), '<span class="fe_label">'+row.Message+'</span>' ) + '</div>';
+html += '<div class="caption" style="margin-top:2px;">' + get_relative_date(row.Date, true) + '</div>';
+html += '</td>';
+html += '</tr></table>';
+$('glog_widget').innerHTML = html;
+$('glog_widget').show();
+}
+}
+function show_glog_post_dialog(game_id) {
+hide_popup_dialog();
+delete session.progress;
+var html = '';
+html += '<div class="dialog_bkgnd" style="background-image:url('+png('/effect/images/big_icons/pencil_paper.png')+')">';
+html += '<table cellspacing=0 cellpadding=0><tr><td width=500 height=175 valign=center align=center>';
+html += '<div class="dialog_title">Post Game Log Message</div>';
+html += '<form method=get action="javascript:void(0)"><table cellspacing="0" cellpadding="0"><tr><td align="left">';
+html += '<textarea class="fe_edit" id="fe_glog_body" style="width:300px; height:50px;" wrap="virtual" onkeydown="return catchTab(this,event)"></textarea>';
+html += '<div class="caption">Enter your log message here. Plain text only please.</div>';
+html += '</td></tr></table>';
+html += '<br><br><table><tr>';
+html += '<td>' + large_icon_button('x', 'Cancel', "hide_popup_dialog()") + '</td>';
+html += '<td width=50>&nbsp;</td>';
+html += '<td>' + large_icon_button('check', '<b>Post Message</b>', "glog_post('"+game_id+"')") + '</td>';
+html += '</tr></table>';
+html += '</form>';
+html += '</div>';
+session.hooks.keys[ESC_KEY] = 'hide_popup_dialog';
+safe_focus( 'fe_glog_body' );
+show_popup_dialog(500, 175, html);
+}
+function glog_post(game_id) {
+var msg = trim( $('fe_glog_body').value );
+if (msg) {
+hide_popup_dialog();
+effect_api_send('game_post_log', {
+GameID: game_id,
+Message: msg
+}, [this, 'glog_post_finish'], { _game_id: game_id });
+}
+}
+function glog_post_finish(response, tx) {
+show_glog_widget( tx._game_id );
+}
+function hide_glog_widget() {
+$('glog_widget').hide();
+}
+function get_icon_for_glog_type(type) {
+var icon = 'page_white.png';
+switch (type) {
+case 'asset': icon = 'folder_page_white.png'; break;
+case 'game': icon = 'controller.png'; break;
+case 'member': icon = 'user'; break;
+case 'comment': icon = 'comment.png'; break;
+case 'level': icon = 'world.png'; break;
+case 'sprite': icon = 'cog.png'; break;
+case 'tile': icon = 'brick.png'; break;
+case 'tileset': icon = 'color_swatch.png'; break;
+case 'rev': icon = 'cd.png'; break;
+case 'revision': icon = 'cd.png'; break;
+case 'font': icon = 'style.png'; break;
+case 'key': icon = 'keyboard.png'; break;
+case 'audio': icon = 'sound'; break;
+case 'payment': icon = 'money.png'; break;
+case 'env': icon = 'weather.png'; break;
+case 'environment': icon = 'weather.png'; break;
+}
+return icon;
+}
+function effect_load_script(url) {
+Debug.trace('api', 'Loading script: ' + url);
+load_script(url);
+}
+function effect_api_get_ie(cmd, params, userData) {
+if (!session.api_state_ie) session.api_state_ie = {};
+var unique_id = get_unique_id();
+session.api_state_ie[unique_id] = userData;
+params.format = 'js';
+params.onafter = 'effect_api_response_ie(' + unique_id + ', response);';
+var url = '/effect/api/' + cmd + composeQueryString(params);
+Debug.trace('api', "Sending MSIE HTTP GET: " + url);
+load_script(url);
+}
+function effect_api_response_ie(unique_id, tree) {
+Debug.trace('api', "Got response from MSIE HTTP GET");
+var tx = session.api_state_ie[unique_id];
+delete session.api_state_ie[unique_id];
+if (tree.Code == 'session') {
+do_logout_2();
+return;
+}
+if (tree.Code == 'access') {
+do_notice("Access Denied", tree.Description, 'do_not_pass_go');
+return;
+}
+if (tree.Code != 0) {
+if (tx._on_error) return fire_callback( tx._on_error, tree, tx );
+return do_error( tree.Description );
+}
+if (tree.SessionID) {
+if (tree.SessionID == '_DELETE_') {
+delete session.cookie.tree.effect_session_id;
+}
+else {
+session.cookie.set( 'effect_session_id', tree.SessionID );
+}
+session.cookie.save();
+}
+if (tx._api_callback) {
+fire_callback( tx._api_callback, tree, tx );
+}
+}
+function effect_api_get(cmd, params, callback, userData) {
+if (!userData) userData = {};
+userData._api_callback = callback;
+if (!session.api_mod_cache[cmd] && session.username) session.api_mod_cache[cmd] = hires_time_now();
+if (!params.mod && session.api_mod_cache[cmd]) params.mod = session.api_mod_cache[cmd];
+if (ie) return effect_api_get_ie(cmd, params, userData);
+var url = '/effect/api/' + cmd + composeQueryString(params);
+Debug.trace('api', "Sending HTTP GET: " + url);
+ajax.get( url, 'effect_api_response', userData );
+}
+function effect_api_send(cmd, xml, callback, userData) {
+if (!userData) userData = {};
+userData._api_callback = callback;
+var data = compose_xml('EffectRequest', xml);
+Debug.trace('api', "Sending API Command: " + cmd + ": " + data);
+ajax.send({
+method: 'POST',
+url: '/effect/api/' + cmd,
+data: data,
+headers: { 'Content-Type': 'text/xml' }
+}, 'effect_api_response', userData);
+}
+function effect_api_response(tx) {
+Debug.trace('api', "HTTP " + tx.response.code + ": " + tx.response.data);
+if (tx.response.code == 999) {
+if (tx.request._auto_retry) {
+session.net_error = false;
+show_progress_dialog(1, "Trying to reestablish connection...");
+session.net_error = true;
+setTimeout( function() { ajax.send(tx.request); }, 1000 );
+return;
+}
+else return do_error( "HTTP ERROR: " + tx.response.code + ": " + tx.response.data + ' (URL: ' + tx.request.url + ')' );
+}
+if (session.net_error) {
+hide_progress_dialog();
+session.net_error = false;
+}
+if (tx.response.code != 200) {
+if (tx._silent) return;
+else return do_error( "HTTP ERROR: " + tx.response.code + ": " + tx.response.data + ' (URL: ' + tx.request.url + ')' );
+}
+var tree = null;
+if (!tx._raw) {
+var parser = new XML({
+preserveAttributes: true,
+text: tx.response.data
+});
+if (parser.getLastError()) return do_error("XML PARSE ERROR: " + parser.getLastError());
+tree = parser.getTree();
+if (tree.Code == 'session') {
+do_logout_2();
+return;
+}
+if (tree.Code == 'access') {
+do_notice("Access Denied", tree.Description, 'do_not_pass_go');
+return;
+}
+if (tree.Code != 0) {
+if (tx._on_error) return fire_callback( tx._on_error, tree, tx );
+return do_error( tree.Description );
+}
+if (tree.SessionID) {
+if (tree.SessionID == '_DELETE_') {
+delete session.cookie.tree.effect_session_id;
+}
+else {
+session.cookie.set( 'effect_session_id', tree.SessionID );
+}
+session.cookie.save();
+}
+}
+if (tx._api_callback) {
+fire_callback( tx._api_callback, tree, tx );
+}
+}
+function effect_api_mod_touch() {
+for (var idx = 0, len = arguments.length; idx < len; idx++) {
+session.api_mod_cache[ arguments[idx] ] = hires_time_now();
+}
+}
+function do_not_pass_go() {
+Nav.go('Main');
+}
+var Nav = {
+loc: '',
+old_loc: '',
+inited: false,
+nodes: [],
+init: function() {
+if (!this.inited) {
+this.inited = true;
+this.loc = 'init';
+this.monitor();
+}
+},
+monitor: function() {
+var parts = window.location.href.split(/\#/);
+var anchor = parts[1];
+if (!anchor) anchor = 'Main';
+var full_anchor = '' + anchor;
+var sub_anchor = '';
+anchor = anchor.replace(/\%7C/, '|');
+if (anchor.match(/\|(\w+)$/)) {
+sub_anchor = RegExp.$1.toLowerCase();
+anchor = anchor.replace(/\|(\w+)$/, '');
+}
+if ((anchor != this.loc) && !anchor.match(/^_/)) {
+Debug.trace('nav', "Caught navigation anchor: " + full_anchor);
+var page_name = '';
+var page_args = null;
+if (full_anchor.match(/^\w+\?.+/)) {
+parts = full_anchor.split(/\?/);
+page_name = parts[0];
+page_args = parseQueryString( parts[1] );
+}
+else if (full_anchor.match(/^(\w+)\/(.*)$/)) {
+page_name = RegExp.$1;
+page_args = RegExp.$2;
+}
+else {
+parts = full_anchor.split(/\//);
+page_name = parts[0];
+page_args = parts.slice(1);
+}
+Debug.trace('nav', "Calling page: " + page_name + ": " + serialize(page_args));
+hide_popup_dialog();
+var result = page_manager.click( page_name, page_args );
+if (result) {
+if (window.pageTracker && (this.loc != 'init')) {
+setTimeout( function() { pageTracker._trackPageview('/effect/' + anchor); }, 1000 );
+}
+this.old_loc = this.loc;
+if (this.old_loc == 'init') this.old_loc = 'Main';
+this.loc = anchor;
+}
+else {
+this.go( this.loc );
+}
+}
+else if (sub_anchor != this.sub_anchor) {
+Debug.trace('nav', "Caught sub-anchor: " + sub_anchor);
+$P().gosub( sub_anchor );
+}
+this.sub_anchor = sub_anchor;
+setTimeout( 'Nav.monitor()', 100 );
+},
+go: function(anchor, force) {
+anchor = anchor.replace(/^\#/, '');
+if (force) this.loc = 'init';
+window.location.href = '#' + anchor;
+},
+prev: function() {
+this.go( this.old_loc || 'Main' );
+},
+refresh: function() {
+this.loc = 'refresh';
+},
+bar: function() {
+var nodes = arguments;
+var html = '';
+for (var idx = 0, len = nodes.length; idx < len; idx++) {
+var node = nodes[idx];
+if (node) this.nodes[idx] = node;
+else node = this.nodes[idx];
+if (node != '_ignore_') {
+html += '<div><a href="#'+node[0]+'"><b>'+ww_fit_string(node[1], 200, session.em_width, 1)+'</b></a></div>';
+}
+}
+html += '<br clear="all"/>';
+$('d_nav_bar').innerHTML = html;
+},
+title: function(name) {
+if (name) document.title = name + ' | EffectGames.com';
+else document.title = 'EffectGames.com';
+},
+currentAnchor: function() {
+var parts = window.location.href.split(/\#/);
+var anchor = parts[1] || '';
+var sub_anchor = '';
+anchor = anchor.replace(/\%7C/, '|');
+if (anchor.match(/\|(\w+)$/)) {
+sub_anchor = RegExp.$1.toLowerCase();
+anchor = anchor.replace(/\|(\w+)$/, '');
+}
+return anchor;
+}
+};
+var Blog = {
+edit_caption: '<div class="caption" style="margin-top:5px;">*<b>Bold</b>*&nbsp;&nbsp;|<i>Italic</i>|&nbsp;&nbsp;{<span style="font-family:monaco,courier,monospace;">monospace</span>}&nbsp;&nbsp;[http://link]&nbsp;&nbsp;<a href="/effect/#Article/Formatting_Guide" target="_blank">Formatting Guide...</a></div>',
+search: function(args) {
+if (!args.mode) args.mode = 'and';
+if (!args.offset) args.offset = 0;
+if (!args.limit) args.limit = 10;
+if (!args.format) args.format = 'xml';
+var query_args = copy_object( args );
+delete query_args.callback;
+effect_api_get( 'article_search', query_args, [this, 'search_response'], { _search_args: args } );
+},
+get_article_preview: function(row, args) {
+var html = '';
+Debug.trace('blog', 'Row: ' + dumper(row));
+html += '<div class="' + (args.outer_div_class || 'blog_article_preview') + '">';
+var ext_article_url = 'http://' + location.hostname + '/effect/article.psp.html' + row.Path + '/' + row.ArticleID;
+var article_url = '#Article' + row.Path + '/' + row.ArticleID;
+html += '<div class="' + (args.title_class || 'blog_title') + '"><a href="'+article_url+'">' + row.Title + '</a></div>';
+if (!args.title_only) {
+html += '<div class="' + (args.preview_class || 'blog_preview_body') + '">';
+html += row.Preview;
+html += '&nbsp;&nbsp;<a href="'+article_url+'">' + (args.link_title || 'Read Full Story...') + '</a>';
+html += '</div>';
+html += '<nobr>';
+html += '<div class="' + (args.footer_class || 'blog_preview_footer') + '">';
+var elem_class = args.footer_element_class || 'blog_preview_footer_element';
+if ((session.username == row.Username) || is_admin()) {
+html += '<div class="' + elem_class + '">' +
+icon('page_white_edit.png', "Edit", '#ArticleEdit?path=' + row.Path + '&id=' + row.ArticleID) + '</div>';
+}
+html += '<div class="' + elem_class + '">' + get_user_display(row.Username) + '</div>';
+html += '<div class="' + elem_class + '">' + icon('calendar', get_short_date_time(row.Published)) + '</div>';
+html += '<div class="' + elem_class + '">' + icon('talk', row.Comments) + '</div>';
+if (0 && row.Tags) html += '<div class="' + elem_class + '">' + icon('note.png', make_tag_links(row.Tags, 3)) + '</div>';
+html += '<div class="' + elem_class + '">' + icon('facebook.png', 'Facebook', "window.open('http://www.facebook.com/sharer.php?u="+encodeURIComponent(ext_article_url)+'&t='+encodeURIComponent(row.Title)+"','sharer','toolbar=0,status=0,width=626,height=436')", "Share on Facebook") + '</div>';
+html += '<div class="' + elem_class + '">' + icon('twitter.png', 'Twitter', "window.open('http://twitter.com/home?status=Reading%20" + encodeURIComponent(row.Title) + "%3A%20" + encodeURIComponent(ext_article_url)+"')", "Share on Twitter") + '</div>';
+html += '</nobr>';
+html += '<br clear="both"/>';
+html += '</div>';
+}
+html += '</div>';
+return html;
+},
+search_response: function(response, tx) {
+var args = tx._search_args;
+if (args.callback) return fire_callback(args.callback, response, args);
+var div = $(args.target);
+assert(div, "Could not find target DIV: " + args.target);
+var html = '';
+if (response.Rows && response.Rows.Row) {
+var rows = always_array( response.Rows.Row );
+for (var idx = 0, len = rows.length; idx < len; idx++) {
+var row = rows[idx];
+html += this.get_article_preview( row, args );
+}
+if (args.more && (rows.length == args.limit)) {
+html += large_icon_button('page_white_put.png', 'More...', "Blog.more(this, "+encode_object(args)+")") + '<br clear="all"/>';
+html += spacer(1,15) + '<br/>';
+}
+if (args.after) html += args.after;
+}
+else if (response.Code != 0) {
+html = 'Search Error: ' . response.Code + ': ' + response.Description;
+}
+else {
+html = args.none_found_msg || 'No articles found.';
+}
+div.innerHTML = html;
+},
+more: function(div, args) {
+args.offset += args.limit;
+Debug.trace('blog', "More Args: " + dumper(args));
+div.innerHTML = '<img src="images/loading.gif" width="32" height="32"/>';
+effect_api_get( 'article_search', args, [this, 'more_response'], { _search_args: args, _div: div } );
+},
+more_response: function(response, tx) {
+var args = tx._search_args;
+var button = tx._div;
+var html = '';
+if (response.Rows && response.Rows.Row) {
+var rows = always_array( response.Rows.Row );
+for (var idx = 0, len = rows.length; idx < len; idx++) {
+var row = rows[idx];
+html += this.get_article_preview( row, args );
+}
+if (args.more && (rows.length == args.limit)) {
+html += large_icon_button('page_white_put.png', 'More...', "Blog.more(this, "+encode_object(args)+")") + '<br clear="all"/>';
+html += spacer(1,15) + '<br/>';
+}
+}
+else if (response.Code != 0) {
+html = 'Search Error: ' . response.Code + ': ' + response.Description;
+}
+else {
+html = args.none_found_msg || 'No more articles found.';
+}
+var div = document.createElement('div');
+div.innerHTML = html;
+button.parentNode.replaceChild( div, button );
+}
+};
+function make_tag_links(csv, max, base_url) {
+if (!base_url) base_url = '';
+var tags = csv.split(/\,\s*/);
+var append = '';
+if (max && (tags.length > max)) {
+tags.length = max;
+append = '...';
+}
+var html = '';
+for (var idx = 0, len = tags.length; idx < len; idx++) {
+html += '<a href="' + base_url + '#Tag/'+tags[idx]+'">'+tags[idx]+'</a>';
+if (idx < len - 1) html += ', ';
+}
+html += append;
+return html;
+}
+function get_url_friendly_title(title) {
+title = title.toString().replace(/\W+/g, '_');
+if (title.length > 40) title = title.substring(0, 40);
+title = title.replace(/^_+/, '');
+title = title.replace(/_+$/, '');
+return title;
+}
+function get_full_url(url) {
+if (url.match(/^\#/)) {
+var parts = window.location.href.split(/\#/);
+url = parts[0] + url;
+}
+return url;
+}
+var Comments = {
+comments_per_page: 10,
+get: function(page_id) {
+var html = '';
+html += '<div class="comments_container">';
+html += '<fieldset><legend>Comments</legend>';
+html += '<div class="comments" id="d_comments_' + page_id + '"></div>';
+html += '</fieldset>';
+html += '</div>';
+setTimeout( function() { Comments.search({ page_id: page_id }); }, 1 );
+return html;
+},
+search: function(args) {
+if (!args.limit) args.limit = this.comments_per_page;
+if (!args.offset) args.offset = 0;
+assert(args.page_id, "Comments.search: No page_id specified");
+args.format = 'xml';
+this.last_search = args;
+effect_api_get( 'comments_get', args, [this, 'search_response'], { _search_args: args } );
+},
+research: function(offset) {
+var args = this.last_search;
+if (!args) return;
+args.offset = offset;
+effect_api_get( 'comments_get', args, [this, 'search_response'], { _search_args: args } );
+},
+search_response: function(response, tx) {
+this.comments = [];
+var args = tx._search_args;
+if (args.callback) return fire_callback(args.callback, response, args);
+var html = '';
+html += '<div class="little_button_stack">' +
+large_icon_button( 'comment_edit.png', 'Post Comment...', "Comments.add('"+args.page_id+"')" ) + '<div class="clear"></div></div>';
+if (args.page_id.match(/^Article\//)) {
+html += '<div class="feed">' + icon('feed.png', 'RSS', '/effect/api/comment_feed/' + args.page_id + '.rss', 'Comments RSS Feed') + '</div>';
+}
+if (response.Items && response.Items.Item && response.List && response.List.length) {
+html += '<div class="pagination">';
+var total_items = response.List.length;
+var num_pages = parseInt( total_items / args.limit, 10 ) + 1;
+if (total_items % args.limit == 0) num_pages--;
+var current_page = parseInt( args.offset / args.limit, 10 ) + 1;
+if (num_pages > 1) {
+html += 'Page: ';
+if (current_page > 1) {
+html += code_link( 'Comments.research(' + ((current_page - 2) * args.limit) + ')', '&larr; Newer' );
+}
+html += '&nbsp;&nbsp;';
+var start_page = current_page - 4;
+var end_page = current_page + 5;
+if (start_page < 1) {
+end_page += (1 - start_page);
+start_page = 1;
+}
+if (end_page > num_pages) {
+start_page -= (end_page - num_pages);
+if (start_page < 1) start_page = 1;
+end_page = num_pages;
+}
+for (var idx = start_page; idx <= end_page; idx++) {
+if (idx == current_page) {
+html += '<b>' + idx + '</b>';
+}
+else {
+html += code_link( 'Comments.research(' + ((idx - 1) * args.limit) + ')', idx );
+}
+html += '&nbsp;';
+}
+html += '&nbsp;&nbsp;';
+if (current_page < num_pages) {
+html += code_link( 'Comments.research(' + ((current_page + 0) * args.limit) + ')', 'Older &rarr;' );
+}
+}
+else {
+html += 'Page 1 of 1';
+}
+html += '</div>';
+html += '<br clear="all"/>';
+var items = this.comments = always_array( response.Items.Item );
+for (var idx = 0, len = items.length; idx < len; idx++) {
+var item = items[idx];
+var extra_classes = (args.highlight && (args.highlight == item.ID)) ? ' highlight' : '';
+html += '<div class="comment_container'+extra_classes+'">';
+html += '<div class="info">';
+if (item.Username) html += '<a href="#User/'+item.Username+'">';
+html += '<b>' + item.Name.toString().toUpperCase() + '</b>';
+if (item.Username) html += '</a>';
+html += ', ' + get_short_date_time(item.Date) + '</div>';
+html += '<div class="controls" id="d_comment_controls_'+item.ID+'">';
+html += this.get_comment_controls( args.page_id, item );
+html += '</div>';
+html += '<br clear="all"/>';
+html += '<div class="comment_body">' + item.Comment + '</div>';
+html += '</div>';
+html += '<div id="d_comment_replies_'+item.ID+'" class="comment_replies_container" style="display:none"></div>';
+if (item.LastReply && ((item.LastReply >= time_now() - (86400 * 7)) || (session.username && (session.username == item.Username)))) {
+setTimeout( "Comments.show_replies('"+args.page_id+"','"+item.ID+"')", 1 );
+}
+}
+}
+else {
+}
+$( 'd_comments_' + args.page_id ).innerHTML = html;
+},
+get_control: function(icon, code, text, status_text) {
+if (!icon.match(/\.\w+$/)) icon += '.gif';
+return '<span class="comment_control" style="background-image:url(/effect/images/icons/small/'+icon+')">' + code_link(code, text, status_text) + '</span>';
+},
+get_comment_controls: function(page_id, comment) {
+var html = '';
+var spacer_txt = '&nbsp;&nbsp;|&nbsp;&nbsp;';
+if (session.user) {
+html += this.get_control('comment', "Comments.reply('"+page_id+"','"+comment.ID+"')", 'Reply') + spacer_txt;
+}
+if (comment.Replies) {
+if (comment._replies_visible) html += this.get_control('magnify_minus', "Comments.hide_replies('"+page_id+"','"+comment.ID+"')", 'Hide Replies');
+else html += this.get_control('magnify_plus', "Comments.show_replies('"+page_id+"','"+comment.ID+"')", 'Show Replies ('+comment.Replies+')');
+if (session.user) html += spacer_txt;
+}
+if (session.user) {
+html += this.get_control(
+'star',
+"Comments.like('"+page_id+"','"+comment.ID+"')",
+'Like' + (comment.Like ? (' ('+comment.Like+')') : ''),
+comment.Like ? (comment.Like + ' ' + ((comment.Like == 1) ? 'person likes this' : 'people like this')) : 'I like this comment'
+) + spacer_txt;
+if (is_admin()) html += this.get_control('trash', "Comments._delete('"+page_id+"','"+comment.ID+"')", 'Delete') + spacer_txt;
+html += this.get_control('warning', "Comments.report('"+page_id+"','"+comment.ID+"')", 'Report Abuse');
+}
+return html;
+},
+reply: function(page_id, comment_id) {
+hide_popup_dialog();
+delete session.progress;
+var comment = find_object( this.comments, { ID: comment_id } );
+var html = '';
+html += '<div class="dialog_bkgnd" style="background-image:url('+png('/effect/images/big_icons/pencil_paper.png')+')">';
+html += '<table cellspacing=0 cellpadding=0><tr><td width=600 height=300 valign=center align=center>';
+html += '<div class="dialog_title">Reply to Comment by "'+comment.Name+'"</div>';
+html += '<form method=get action="javascript:void(0)"><table cellspacing="0" cellpadding="0"><tr><td align="left">';
+var name = this.get_name();
+html += '<p align="left"><span class="fe_label">Posted by:</span>&nbsp;' + name;
+if (!session.user) html += ' &rarr; <a href="/effect/#CreateAccount">Create Account</a>';
+html += '</p><br/>';
+html += '<textarea class="fe_edit" id="fe_comment_body" style="width:400px; height:150px;" wrap="virtual" onkeydown="return catchTab(this,event)"></textarea>';
+html += Blog.edit_caption;
+html += '</td></tr></table>';
+html += '<br><br><table><tr>';
+html += '<td>' + large_icon_button('x', 'Cancel', "hide_popup_dialog()") + '</td>';
+html += '<td width=50>&nbsp;</td>';
+html += '<td>' + large_icon_button('check', '<b>Post Reply</b>', "Comments.post_reply('"+page_id+"','"+comment_id+"')") + '</td>';
+html += '</tr></table>';
+html += '</form>';
+html += '</div>';
+session.hooks.keys[ESC_KEY] = 'hide_popup_dialog';
+safe_focus( 'fe_comment_body' );
+show_popup_dialog(600, 300, html);
+},
+post_reply: function(page_id, comment_id) {
+var value = $('fe_comment_body').value;
+if (!value) return;
+hide_popup_dialog();
+show_progress_dialog(1, "Posting reply...");
+var name = this.get_name();
+effect_api_mod_touch('comment_replies_get');
+effect_api_send('comment_post_reply', {
+PageID: page_id,
+CommentID: comment_id,
+Username: session.username || '',
+Name: name,
+Comment: value,
+PageURL: location.href
+}, [this, 'post_reply_finish'], { _page_id: page_id, _comment_id: comment_id } );
+},
+post_reply_finish: function(response, tx) {
+hide_popup_dialog();
+var page_id = tx._page_id;
+var comment_id = tx._comment_id;
+var comment = find_object( this.comments, { ID: comment_id } );
+do_message('success', "Comment reply posted successfully.");
+this.show_replies(page_id, comment_id);
+if (!comment.Replies) comment.Replies = 1; else comment.Replies++;
+$('d_comment_controls_'+comment_id).innerHTML = this.get_comment_controls( page_id, comment );
+},
+show_replies: function(page_id, comment_id) {
+var comment = find_object( this.comments, { ID: comment_id } );
+if (!comment._replies_visible) {
+$('d_comment_replies_' + comment_id).show().innerHTML = '<img src="images/loading.gif" width="32" height="32"/>';
+}
+var args = { page_id: page_id, comment_id: comment_id, offset: 0, limit: 100 };
+effect_api_get( 'comment_replies_get', args, [this, 'receive_replies_response'], { _search_args: args } );
+},
+receive_replies_response: function(response, tx) {
+var page_id = tx._search_args.page_id;
+var comment_id = tx._search_args.comment_id;
+var comment = find_object( this.comments, { ID: comment_id } );
+var html = '';
+var replies = always_array( response.Items.Item );
+for (var idx = 0, len = replies.length; idx < len; idx++) {
+var reply = replies[idx];
+html += get_chat_balloon(
+(reply.Username == session.username) ? 'blue' : 'grey',
+reply.Username,
+reply.Comment.replace(/^<div[^>]*?>(.+)<\/div>$/i, '$1')
+);
+}
+$('d_comment_replies_' + comment_id).innerHTML = html;
+if (!comment._replies_visible) {
+$('d_comment_replies_' + comment_id).hide();
+animate_div_visibility( 'd_comment_replies_' + comment_id, true );
+}
+comment._replies_visible = true;
+$('d_comment_controls_'+comment_id).innerHTML = this.get_comment_controls( page_id, comment );
+},
+hide_replies: function(page_id, comment_id) {
+var comment = find_object( this.comments, { ID: comment_id } );
+if (comment._replies_visible) {
+animate_div_visibility( 'd_comment_replies_' + comment_id, false );
+comment._replies_visible = false;
+$('d_comment_controls_'+comment_id).innerHTML = this.get_comment_controls( page_id, comment );
+}
+},
+like: function(page_id, comment_id) {
+effect_api_mod_touch('comments_get');
+effect_api_send('comment_like', {
+PageID: page_id,
+CommentID: comment_id
+}, [this, 'like_finish'], { _page_id: page_id, _comment_id: comment_id, _on_error: [this, 'like_error'] } );
+},
+like_error: function(response, tx) {
+if (response.Code == 'comment_already_like') do_message('error', "You already like this comment.");
+else do_error( response.Description );
+},
+like_finish: function(resopnse, tx) {
+var page_id = tx._page_id;
+var comment_id = tx._comment_id;
+var comment = find_object( this.comments, { ID: comment_id } );
+do_message('success', "You now like this comment.");
+if (!comment.Like) comment.Like = 1; else comment.Like++;
+$('d_comment_controls_'+comment_id).innerHTML = this.get_comment_controls( page_id, comment );
+},
+add: function(page_id) {
+hide_popup_dialog();
+delete session.progress;
+var html = '';
+html += '<div class="dialog_bkgnd" style="background-image:url('+png('/effect/images/big_icons/pencil_paper.png')+')">';
+html += '<table cellspacing=0 cellpadding=0><tr><td width=600 height=300 valign=center align=center>';
+html += '<div class="dialog_title">Post New Comment</div>';
+html += '<form method=get action="javascript:void(0)"><table cellspacing="0" cellpadding="0"><tr><td align="left">';
+var name = this.get_name();
+html += '<p align="left"><span class="fe_label">Posted by:</span>&nbsp;' + name;
+if (!session.user) html += ' &rarr; <a href="/effect/#CreateAccount">Create Account</a>';
+html += '</p><br/>';
+html += '<textarea class="fe_edit" id="fe_comment_body" style="width:400px; height:150px;" wrap="virtual" onkeydown="return catchTab(this,event)"></textarea>';
+html += Blog.edit_caption;
+html += '</td></tr></table>';
+html += '<br><br><table><tr>';
+html += '<td>' + large_icon_button('x', 'Cancel', "hide_popup_dialog()") + '</td>';
+html += '<td width=50>&nbsp;</td>';
+html += '<td>' + large_icon_button('check', '<b>Post Comment</b>', "Comments.post('"+page_id+"')") + '</td>';
+html += '</tr></table>';
+html += '</form>';
+html += '</div>';
+session.hooks.keys[ESC_KEY] = 'hide_popup_dialog';
+safe_focus( 'fe_comment_body' );
+show_popup_dialog(600, 300, html);
+},
+report: function(page_id, comment_id) {
+if (confirm('Are you sure you want to report this comment to the site administrators as abusive and/or spam?')) {
+effect_api_send('comment_report_abuse', {
+PageID: page_id,
+CommentID: comment_id
+}, [this, 'report_finish'], { _page_id: page_id, _comment_id: comment_id } );
+}
+},
+report_finish: function(response, tx) {
+do_message('success', 'Your abuse report has been received, and will be evaluated by the site administrators.');
+},
+_delete: function(page_id, comment_id) {
+if (confirm('Are you sure you want to permanently delete this comment?')) {
+effect_api_mod_touch('comments_get');
+effect_api_send('comment_delete', {
+PageID: page_id,
+CommentID: comment_id
+}, [this, 'delete_finish'], { _page_id: page_id, _comment_id: comment_id } );
+}
+},
+delete_finish: function(response, tx) {
+do_message('success', 'The comment was deleted successfully.');
+var page_id = tx._page_id;
+this.search({ page_id: page_id });
+},
+get_name: function() {
+var name = '(Anonymous)';
+if (session.user) {
+if (get_bool_pref('public_profile')) name = session.user.FullName;
+else name = session.username;
+}
+return name;
+},
+post: function(page_id) {
+var value = $('fe_comment_body').value;
+if (!value) return;
+hide_popup_dialog();
+show_progress_dialog(1, "Posting comment...");
+var name = this.get_name();
+effect_api_mod_touch('comments_get');
+effect_api_send('comment_post', {
+PageID: page_id,
+Username: session.username || '',
+Name: name,
+Comment: value
+}, [this, 'post_finish'], { _page_id: page_id } );
+},
+post_finish: function(response, tx) {
+hide_popup_dialog();
+var comment_id = response.CommentID;
+var page_id = tx._page_id;
+this.search({ page_id: page_id, highlight: comment_id });
+}
+};
+Class.create( 'Menu', {
+id: '',
+menu: null,
+__construct: function(id) {
+this.id = id;
+},
+load: function() {
+if (!this.menu) {
+this.menu = $(this.id);
+assert( !!this.menu, "Could not locate DOM element: " + this.id );
+}
+},
+get_value: function() {
+this.load();
+return this.menu.options[this.menu.selectedIndex].value;
+},
+set_value: function(value, auto_add) {
+value = str_value(value);
+this.load();
+for (var idx = 0, len = this.menu.options.length; idx < len; idx++) {
+if (this.menu.options[idx].value == value) {
+this.menu.selectedIndex = idx;
+return true;
+}
+}
+if (auto_add) {
+this.menu.options[this.menu.options.length] = new Option(value, value);
+this.menu.selectedIndex = this.menu.options.length - 1;
+return true;
+}
+return false;
+},
+disable: function() {
+this.load();
+this.menu.disabled = true;
+this.menu.setAttribute( 'disabled', 'disabled' );
+},
+enable: function() {
+this.load();
+this.menu.setAttribute( 'disabled', '' );
+this.menu.disabled = false;
+},
+populate: function(items, sel_value) {
+this.load();
+this.menu.options.length = 0;
+for (var idx = 0, len = items.length; idx < len; idx++) {
+var item = items[idx];
+var item_name = '';
+var item_value = '';
+if (isa_hash(item)) {
+item_name = item.label;
+item_value = item.data;
+}
+else if (isa_array(item)) {
+item_name = item[0];
+item_value = item[1];
+}
+else {
+item_name = item_value = item;
+}
+this.menu.options[ this.menu.options.length ] = new Option( item_name, item_value );
+if (item_value == sel_value) this.menu.selectedIndex = idx;
+}
+}
+} );
+Class.subclass( Menu, 'MultiMenu', {
+__static: {
+toggle_type: function(id) {
+var menu = $(id);
+assert(menu, "Could not find menu in DOM: " + id);
+if (menu.disabled) return;
+var obj = MenuManager.find(id);
+assert(obj, "Could not find menu in MenuManager: " + id);
+var div = $( 'd_inner_' + id );
+var ic = $( 'ic_' + id );
+var is_multiple = (ic.src.indexOf('contract') > -1);
+obj.multi = !is_multiple;
+var multiple_tag = !is_multiple ?
+' multiple="multiple" size=5' : '';
+var items = [];
+for (var idx = 0; idx < menu.options.length; idx++) {
+var option = menu.options[idx];
+array_push( items, {
+value: option.value,
+text: option.text,
+selected: option.selected
+});
+}
+var html = '';
+html += '<select name="'+id+'" id="'+id+'"' + multiple_tag + ' ' + compose_attribs(obj.attribs) + '>' + "\n";
+var found_selected = 0;
+for (var idx in items) {
+var item = items[idx];
+html += '<option value="' + item.value.replace(/\"/g, "&quot;") + '"';
+if (item.selected && (!found_selected || multiple_tag)) {
+html += ' selected="selected"';
+found_selected = 1;
+}
+html += '>' + item.text + '</option>' + "\n";
+}
+html += '</select>';
+div.innerHTML = html;
+ic.src = images_uri + '/menu_' + (is_multiple ? 'expand' : 'contract') + '.gif';
+obj.menu = null;
+}
+},
+attribs: null,
+multi: false,
+toggle: true,
+__construct: function(id, attribs) {
+this.id = id;
+if (attribs) this.attribs = attribs;
+},
+get_html: function(items, selected_csv, attribs) {
+if (!items) items = [];
+if (!selected_csv) selected_csv = '';
+if (attribs) this.attribs = attribs;
+var selected = csv_to_hash(selected_csv);
+this.menu = null;
+if (num_keys(selected) > 1) this.multi = true;
+var html = '<div id="d_outer_'+this.id+'"><form>';
+html += '<table cellspacing="0" cellpadding="0"><tr>';
+html += '<td><div id="d_inner_'+this.id+'"><select id="'+this.id+'"';
+if (this.multi) html += ' multiple="multiple" size="5"';
+html += compose_attribs(this.attribs);
+html += '>';
+for (var idx = 0, len = items.length; idx < len; idx++) {
+var item = items[idx];
+var item_name = '';
+var item_value = '';
+if (isa_hash(item)) {
+item_name = item.label;
+item_value = item.data;
+}
+else if (isa_array(item)) {
+item_name = item[0];
+item_value = item[1];
+}
+else {
+item_name = item_value = item;
+}
+html += '<option value="'+item_value+'"';
+if (selected[item_value]) html += ' selected="selected"';
+html += '>' + item_name + '</option>';
+}
+html += '</select></div></td>';
+html += '<td width="1">' + spacer(1,1) + '</td>';
+if (this.toggle) html += '<td valign="bottom"><img id="ic_'+this.id+'" src="'+images_uri+'/menu_'+(this.multi ? 'contract' : 'expand')+'.gif" width="16" height="16" style="cursor:pointer" onClick="MultiMenu.toggle_type(\''+this.id+'\')"><br/>'+spacer(1,2)+'</td>';
+html += '</tr></table>';
+html += '</form></div>';
+return html;
+},
+get_value: function() {
+this.load();
+var value = '';
+for (var idx = 0; idx < this.menu.options.length; idx++) {
+var option = this.menu.options[idx];
+if (option.selected && option.value.length) {
+if (value.length > 0) value += ',';
+value += option.value;
+}
+}
+return value;
+},
+set_value: function(value, auto_add) {
+value = '' + value;
+this.load();
+if (!value) {
+value = '';
+for (var idx = 0; idx < this.menu.options.length; idx++) {
+var option = this.menu.options[idx];
+option.selected = (option.value == value);
+}
+return;
+}
+var selected = csv_to_hash(value);
+if ((num_keys(selected) > 1) && !this.multi) {
+MultiMenu.toggle_type(this.id);
+var self = this;
+setTimeout( function() {
+self.set_value(value, auto_add);
+}, 1 );
+return;
+}
+for (var idx = 0; idx < this.menu.options.length; idx++) {
+var option = this.menu.options[idx];
+option.selected = selected[option.value] ? true : false;
+}
+},
+populate: function(items, value) {
+this.load();
+this.menu.options.length = 0;
+if (!value) value = '';
+var selected = csv_to_hash(value);
+for (var idx = 0, len = items.length; idx < len; idx++) {
+var item = items[idx];
+var item_name = '';
+var item_value = '';
+if (isa_hash(item)) {
+item_name = item.label;
+item_value = item.data;
+}
+else if (isa_array(item)) {
+item_name = item[0];
+item_value = item[1];
+}
+else {
+item_name = item_value = item;
+}
+var opt = new Option( item_name, item_value );
+this.menu.options[ this.menu.options.length ] = opt;
+opt.selected = selected[item_value] ? true : false;
+}
+},
+collapse: function() {
+if (this.multi) MultiMenu.toggle_type(this.id);
+},
+expand: function() {
+if (!this.multi) MultiMenu.toggle_type(this.id);
+}
+} );
+Class.create( 'MenuManager', {
+__static: {
+menus: {},
+register: function(menu) {
+this.menus[ menu.id ] = menu;
+return menu;
+},
+find: function(id) {
+return this.menus[id];
+}
+}
+} );
+Class.create( 'GrowlManager', {
+lifetime: 10,
+marginRight: 0,
+marginTop: 0,
+__construct: function() {
+this.growls = [];
+},
+growl: function(type, msg) {
+if (find_object(this.growls, { type: type, msg: msg })) return;
+var div = $(document.createElement('div'));
+div.className = 'growl_message ' + type;
+div.setOpacity(0.0);
+div.innerHTML = '<div class="growl_message_inner">' + msg + '<br/>' + spacer(1,5) + '</div>';
+$('d_growl_wrapper').insertBefore( div, $('d_growl_top').nextSibling );
+var growl = { id:get_unique_id(), type: type, msg: msg, opacity:0.0, start:hires_time_now(), div:div };
+this.growls.push(growl);
+this.handle_resize();
+this.animate(growl);
+var self = this;
+div.onclick = function() {
+delete_object(self.growls, { id: growl.id });
+$('d_growl_wrapper').removeChild( div );
+};
+},
+animate: function(growl) {
+if (growl.deleted) return;
+var now = hires_time_now();
+var div = growl.div;
+if (now - growl.start <= 0.5) {
+div.setOpacity( tweenFrame(0.0, 1.0, (now - growl.start) * 2, 'EaseOut', 'Quadratic') );
+}
+else if (now - growl.start <= this.lifetime) {
+if (!growl._fully_opaque) {
+div.setOpacity( 1.0 );
+growl._fully_opaque = true;
+}
+}
+else if (now - growl.start <= this.lifetime + 1.0) {
+div.setOpacity( tweenFrame(1.0, 0.0, (now - growl.start) - this.lifetime, 'EaseOut', 'Quadratic') );
+}
+else {
+delete_object(this.growls, { id: growl.id });
+$('d_growl_wrapper').removeChild( div );
+return;
+}
+var self = this;
+setTimeout( function() { self.animate(growl); }, 33 );
+},
+handle_resize: function() {
+var div = $('d_growl_wrapper');
+if (this.growls.length) {
+var size = getInnerWindowSize();
+div.style.top = '' + (10 + this.marginTop) + 'px';
+div.style.left = '' + Math.floor((size.width - 310) - this.marginRight) + 'px';
+}
+else {
+div.style.left = '-2000px';
+}
+}
+} );
+window.$GR = new GrowlManager();
+if (window.addEventListener) {
+window.addEventListener( "resize", function() {
+$GR.handle_resize();
+}, false );
+}
+else if (window.attachEvent && !ie6) {
+window.attachEvent("onresize", function() {
+$GR.handle_resize();
+});
+}
+Class.create( 'Effect.Page', {
+ID: '',
+data: null,
+active: false,
+__construct: function(config) {
+if (!config) return;
+this.data = {};
+if (!config) config = {};
+for (var key in config) this[key] = config[key];
+this.div = $('page_' + this.ID);
+assert(this.div, "Cannot find page div: page_" + this.ID);
+},
+onInit: function() {
+},
+onActivate: function() {
+return true;
+},
+onDeactivate: function() {
+return true;
+},
+show: function() {
+this.div.show();
+},
+hide: function() {
+this.div.hide();
+},
+gosub: function(anchor) {
+}
+} );
+Class.require( 'Effect.Page' );
+Class.create( 'Effect.PageManager', {
+pages: null,
+current_page_id: '',
+on_demand: {},
+__construct: function(page_list) {
+this.pages = [];
+this.page_list = page_list;
+for (var idx = 0, len = page_list.length; idx < len; idx++) {
+Debug.trace( 'page', "Initializing page: " + page_list[idx].ID );
+if (Effect.Page[ page_list[idx].ID ]) {
+var page = new Effect.Page[ page_list[idx].ID ]( page_list[idx] );
+page.onInit();
+this.pages.push(page);
+}
+else {
+Debug.trace( 'page', 'Page ' + page_list[idx].ID + ' will be loaded on-demand' );
+}
+}
+},
+find: function(id) {
+var page = find_object( this.pages, { ID: id } );
+if (!page) Debug.trace('PageManager', "Could not find page: " + id);
+return page;
+},
+notify_load: function(file, id) {
+for (var idx = 0, len = this.page_list.length; idx < len; idx++) {
+var page_config = this.page_list[idx];
+if (page_config.File == file) {
+Debug.trace( 'page', "Initializing page on-demand: " + page_config.ID );
+var page = new Effect.Page[ page_config.ID ]( page_config );
+page.onInit();
+this.pages.push(page);
+}
+}
+var self = this;
+setTimeout( function() {
+var result = self.activate(id, self.temp_args);
+delete self.temp_args;
+$('d_page_loading').hide();
+if (!result) {
+$('page_'+id).hide();
+self.current_page_id = '';
+}
+}, 1 );
+},
+activate: function(id, args) {
+if (!find_object( this.pages, { ID: id } )) {
+var page_config = find_object( this.page_list, { ID: id } );
+assert(!!page_config, "Page config not found: " + id );
+Debug.trace('page', "Loading file on-demand: " + page_config.File + " for page: " + id);
+var url = '/effect/api/load_page/' + page_config.File + '?onafter=' + escape('page_manager.notify_load(\''+page_config.File+'\',\''+id+'\')');
+if (page_config.Requires) {
+var files = page_config.Requires.split(/\,\s*/);
+for (var idx = 0, len = files.length; idx < len; idx++) {
+var filename = files[idx];
+if (!this.on_demand[filename]) {
+Debug.trace('page', "Also loading file: " + filename);
+url += '&file=' + filename;
+this.on_demand[filename] = 1;
+}
+}
+}
+$('d_page_loading').show();
+this.temp_args = args;
+load_script( url );
+return true;
+}
+$('page_'+id).show();
+var page = this.find(id);
+page.active = true;
+if (!args) args = [];
+if (!isa_array(args)) args = [ args ];
+var result = page.onActivate.apply(page, args);
+if (typeof(result) == 'boolean') return result;
+else return alert("Page " + id + " onActivate did not return a boolean!");
+},
+deactivate: function(id, new_id) {
+var page = this.find(id);
+var result = page.onDeactivate(new_id);
+if (result) {
+$('page_'+id).hide();
+page.active = false;
+}
+return result;
+},
+click: function(id, args) {
+Debug.trace('page', "Switching pages to: " + id);
+var old_id = this.current_page_id;
+if (this.current_page_id) {
+var result = this.deactivate( this.current_page_id, id );
+if (!result) return false;
+}
+this.current_page_id = id;
+this.old_page_id = old_id;
+window.scrollTo( 0, 0 );
+var result = this.activate(id, args);
+if (!result) {
+$('page_'+id).hide();
+this.current_page_id = '';
+}
+return true;
+}
+} );
+Class.subclass( Effect.Page, "Effect.Page.Main", {
+inited: false,
+onActivate: function() {
+Nav.bar( ['Main', 'EffectGames.com'] );
+Nav.title('');
+$('d_blog_news').innerHTML = loading_image();
+$('d_blog_community').innerHTML = loading_image();
+$('d_blog_featured').innerHTML = loading_image();
+Blog.search({
+stag: 'featured_game',
+limit: 4,
+full: 1,
+callback: [this, 'receive_featured_games']
+});
+effect_api_get( 'get_site_info', { cat: 'pop_pub_games' }, [this, 'receive_pop_pub_games'], { } );
+Blog.search({
+stag: 'front_page',
+limit: 5,
+target: 'd_blog_news',
+more: 1
+});
+Blog.search({
+path: '/community',
+limit: 5,
+target: 'd_blog_community',
+more: 1
+});
+if (!this.inited) {
+this.inited = true;
+config.Strings.MainSlideshow.Slide = always_array( config.Strings.MainSlideshow.Slide );
+this.slide_idx = 0;
+this.num_slides = config.Strings.MainSlideshow.Slide.length;
+this.slide_div_num = 0;
+this.slide_dir = 1;
+this.bk_pos = -340;
+this.bk_pos_target = -340;
+this.slide_images = [];
+for (var idx = 0, len = this.num_slides; idx < len; idx++) {
+var url = images_uri + '/' + config.Strings.MainSlideshow.Slide[idx].Photo;
+this.slide_images[idx] = new Image();
+this.slide_images[idx].src = png(url, true);
+}
+}
+this.height_target = 470;
+this.height_start = $('d_header').offsetHeight;
+this.time_start = hires_time_now();
+this.duration = 0.75;
+if (!this.timer) this.timer = setTimeout( '$P("Main").animate_mhs()', 33 );
+if (session.user) $('d_blurb_main').hide();
+else {
+$('d_blurb_main').innerHTML = get_string('/Main/Blurb');
+$('d_blurb_main').show();
+}
+return true;
+},
+receive_pop_pub_games: function(response, tx) {
+var html = '';
+if (response.Data && response.Data.Games && response.Data.Games.Game) {
+var games = always_array( response.Data.Games.Game );
+for (var idx = 0, len = Math.min(games.length, 16); idx < len; idx++) {
+var game = games[idx];
+html += '<div class="game_thumb" onClick="Nav.go(\'Game/'+game.GameID+'\')">' +
+(game.Logo ?
+user_image_thumbnail(game.Logo, 80, 60) :
+'<img class="png" src="/effect/images/logo_80_60.png" width="80" height="60"/>'
+) + '<br/>' + ww_fit_box(game.Title, 80, 2, session.em_width, 1) + '</div>';
+}
+html += '<div class="clear"></div>';
+}
+else {
+html += 'No active public games found! Why not <a href="#GameEdit"><b>create a new one?</b></a>';
+}
+$('d_main_pop_pub_games').innerHTML = html;
+},
+receive_featured_games: function(response, tx) {
+var html = '';
+if (response.Rows && response.Rows.Row) {
+html += '<table cellspacing="0" cellpadding="0" border="0" width="100%">';
+var rows = always_array( response.Rows.Row );
+for (var idx = 0, len = rows.length; idx < len; idx++) {
+var row = rows[idx];
+var image_url = row.Params.featured_image;
+if (image_url && image_url.match(/^(\w+)\/(\w+\.\w+)$/)) {
+image_url = '/effect/api/view/users/' + RegExp.$1 + '/images/' + RegExp.$2;
+}
+if (idx % 2 == 0) html += '<tr>';
+html += '<td width="50%">';
+html += '<table cellspacing="0" cellpadding="0"><tr>';
+html += '<td width="175" height="175">';
+html += '<div class="featured_image_container" style="background-image:url('+image_url+')">';
+html += '<div class="featured_image_overlay" onClick="window.open(\''+row.Params.featured_link+'\')"></div>';
+html += '</div>';
+html += '</td>';
+html += '<td width="10">' + spacer(10,1) + '</td>';
+html += '<td width="*" valign="top">';
+html += '<div class="blog_title"><a href="'+row.Params.featured_link+'" target="_blank">' + row.Title + '</a></div>';
+html += '<div class="featured_game_content">' + row.HTML + '</div>';
+html += '</td>';
+html += '<td width="10">' + spacer(15,1) + '</td>';
+html += '</tr></table>';
+html += spacer(1,20);
+html += '</td>';
+if (idx % 2 == 1) html += '</tr>';
+}
+if (rows.length % 2 == 1) {
+html += '<td></td>';
+html += '</tr>';
+}
+html += '</table>';
+}
+$('d_blog_featured').innerHTML = html;
+},
+animate_mhs: function() {
+var now = hires_time_now();
+if (now - this.time_start >= this.duration) {
+$('d_header').style.height = '' + this.height_target + 'px';
+$('d_shadow').style.height = '' + this.height_target + 'px';
+delete this.timer;
+}
+else {
+var height = tweenFrame(this.height_start, this.height_target, (now - this.time_start) / this.duration, 'EaseOut', 'Circular');
+$('d_header').style.height = '' + height + 'px';
+$('d_shadow').style.height = '' + height + 'px';
+this.timer = setTimeout( '$P("Main").animate_mhs()', 33 );
+}
+},
+onDeactivate: function() {
+$('d_blog_news').innerHTML = '';
+$('d_blog_community').innerHTML = '';
+this.height_target = 75;
+this.height_start = $('d_header').offsetHeight;
+this.time_start = hires_time_now();
+if (!this.timer) this.timer = setTimeout( '$P("Main").animate_mhs()', 33 );
+return true;
+},
+draw_slide: function() {
+if (this.slide_timer) return;
+var slide = config.Strings.MainSlideshow.Slide[ this.slide_idx ];
+this.old_photo = $('d_header_slideshow_photo_' + this.slide_div_num);
+this.old_text = $('d_header_slideshow_text_' + this.slide_div_num);
+this.slide_div_num = 1 - this.slide_div_num;
+this.new_photo = $('d_header_slideshow_photo_' + this.slide_div_num);
+this.new_text = $('d_header_slideshow_text_' + this.slide_div_num);
+this.new_photo.style.backgroundImage = 'url('+png(images_uri+'/'+slide.Photo, true)+')';
+this.new_photo.setOpacity(0.0);
+var html = '';
+html += slide.Text;
+this.slide_width = this.new_text.offsetWidth;
+this.new_text.innerHTML = html;
+if (this.slide_dir == 1) this.new_text.style.left = '' + this.slide_width + 'px';
+else this.new_text.style.left = '-' + this.slide_width + 'px';
+this.slide_time_start = hires_time_now();
+this.slide_timer = setTimeout( '$P("Main").animate_mhs_slide()', 33 );
+},
+animate_mhs_slide: function() {
+var now = hires_time_now();
+if (now - this.slide_time_start >= this.duration) {
+this.new_text.style.left = '0px';
+this.old_text.style.left = '-' + this.slide_width + 'px';
+this.new_photo.setOpacity( 1.0 );
+this.old_photo.setOpacity( 0.0 );
+delete this.slide_timer;
+this.bk_pos = this.bk_pos_target;
+}
+else {
+var value = tweenFrame(0.0, 1.0, (now - this.slide_time_start) / this.duration, 'EaseOut', 'Circular');
+if (this.slide_dir == 1) {
+this.new_text.style.left = '' + Math.floor( this.slide_width - (this.slide_width * value) ) + 'px';
+this.old_text.style.left = '-' + Math.floor( this.slide_width * value ) + 'px';
+}
+else {
+this.new_text.style.left = '-' + Math.floor( this.slide_width - (this.slide_width * value) ) + 'px';
+this.old_text.style.left = '' + Math.floor( this.slide_width * value ) + 'px';
+}
+this.new_photo.setOpacity( value );
+this.old_photo.setOpacity( 1.0 - value );
+var bkp = Math.floor( this.bk_pos + ((this.bk_pos_target - this.bk_pos) * value) );
+$('d_header').style.backgroundPosition = '' + bkp + 'px 0px';
+this.slide_timer = setTimeout( '$P("Main").animate_mhs_slide()', 33 );
+}
+},
+prev_slide: function() {
+this.bk_pos_target += 200;
+this.slide_idx--;
+if (this.slide_idx < 0) this.slide_idx += this.num_slides;
+this.slide_dir = -1;
+this.draw_slide();
+},
+next_slide: function() {
+this.bk_pos_target -= 200;
+this.slide_idx++;
+if (this.slide_idx >= this.num_slides) this.slide_idx -= this.num_slides;
+this.slide_dir = 1;
+this.draw_slide();
+}
+} );
+Class.subclass( Effect.Page, "Effect.Page.PublicGameList", {
+onActivate: function() {
+Nav.bar(
+['Main', 'EffectGames.com'],
+['PublicGameList', "All Public Games"]
+);
+Nav.title( "List of All Public Game Projects" );
+effect_api_get( 'get_site_info', { cat: 'all_pub_games' }, [this, 'receive_all_pub_games'], { } );
+this.div.innerHTML = loading_image();
+return true;
+},
+onDeactivate: function() {
+this.div.innerHTML = '';
+return true;
+},
+receive_all_pub_games: function(response, tx) {
+var html = '';
+html += '<h1>List of All Public Game Projects</h1>';
+html += '<div class="blurb">This is the complete list of public games currently being built by our users, presented in alphabetical order. Maybe they could use some help! Check out the game project pages and see (requires user account).</div>';
+if (response.Data && response.Data.Games && response.Data.Games.Game) {
+var games = always_array( response.Data.Games.Game );
+for (var idx = 0, len = games.length; idx < len; idx++) {
+var game = games[idx];
+html += '<div class="game_thumb" onClick="Nav.go(\'Game/'+game.GameID+'\')">' +
+(game.Logo ?
+user_image_thumbnail(game.Logo, 80, 60) :
+'<img class="png" src="/effect/images/logo_80_60.png" width="80" height="60"/>'
+) + '<br/>' + ww_fit_box(game.Title, 80, 2, session.em_width, 1) + '</div>';
+}
+html += '<div class="clear"></div>';
+}
+else {
+html += 'No public games found! Why not <a href="#GameEdit"><b>create a new one?</b></a>';
+}
+this.div.innerHTML = html;
+}
+} );
+Class.subclass( Effect.Page, "Effect.Page.Search", {
+onActivate: function(args) {
+if (!args) args = {};
+var search_text = args.q;
+var start = args.s || 0;
+if (!start) start = 0;
+var title = 'Search results for "'+search_text+'"';
+Nav.bar(
+['Main', 'EffectGames.com'],
+['Search?q=' + escape(search_text), "Search Results"]
+);
+Nav.title( title );
+this.last_search_text = search_text;
+$('d_article_search').innerHTML = loading_image();
+load_script( 'http://www.google.com/uds/GwebSearch?callback=receive_google_search_results&context=0&lstkp=0&rsz=large&hl=en&source=gsc&gss=.com&sig=&q='+escape(search_text)+'%20site%3Ahttp%3A%2F%2Fwww.effectgames.com%2F&key=notsupplied&v=1.0&start='+start+'&nocache=' + (new Date()).getTime() );
+$('h_article_search').innerHTML = title;
+return true;
+},
+onDeactivate: function(new_page) {
+$('fe_search_bar').value = '';
+$('d_article_search').innerHTML = '';
+return true;
+}
+} );
+function do_search_bar() {
+var search_text = $('fe_search_bar').value;
+if (search_text.length) {
+Nav.go('Search?q=' + escape(search_text));
+}
+}
+function receive_google_search_results(context, response) {
+var html = '';
+html += '<div class="powered_by_google">Powered by</div><div class="clear"></div>';
+if (response.results.length) {
+for (var idx = 0, len = response.results.length; idx < len; idx++) {
+var row = response.results[idx];
+var url = row.unescapedUrl.replace(/^.+article\.psp\.html/, '#Article');
+html += '<div class="google_search_result_row">';
+html += '<div class="link"><a href="'+url+'"><b>'+row.title+'</b></a></div>';
+html += '<div class="preview">' + row.content + '</div>';
+html += '</div>';
+}
+}
+else {
+html += 'No results found.';
+}
+if (response.cursor.pages) {
+html += '<div class="google_pagination">Page: ';
+for (var idx = 0, len = response.cursor.pages.length; idx < len; idx++) {
+html += '<span>';
+var page = response.cursor.pages[idx];
+var url = '#Search?q=' + escape($P('Search').last_search_text) + '&s=' + page.start;
+if (response.cursor.currentPageIndex != idx) html += '<a href="'+url+'">';
+else html += '<b>';
+html += page.label;
+if (response.cursor.currentPageIndex != idx) html += '</a>';
+else html += '</b>';
+html += '</span>';
+}
+html += '</div>';
+}
+$('d_article_search').innerHTML = html;
+}
+</script>
+
+
+<script id="ext" type="x">
+/*
+ * Ext JS Library 3.4.0
+ * Copyright(c) 2006-2011 Sencha Inc.
+ * licensing@sencha.com
+ * http://www.sencha.com/license
+ */
+(function(){var h=Ext.util,j=Ext.each,g=true,i=false;h.Observable=function(){var k=this,l=k.events;if(k.listeners){k.on(k.listeners);delete k.listeners}k.events=l||{}};h.Observable.prototype={filterOptRe:/^(?:scope|delay|buffer|single)$/,fireEvent:function(){var k=Array.prototype.slice.call(arguments,0),m=k[0].toLowerCase(),n=this,l=g,p=n.events[m],s,o,r;if(n.eventsSuspended===g){if(o=n.eventQueue){o.push(k)}}else{if(typeof p=="object"){if(p.bubble){if(p.fire.apply(p,k.slice(1))===i){return i}r=n.getBubbleTarget&&n.getBubbleTarget();if(r&&r.enableBubble){s=r.events[m];if(!s||typeof s!="object"||!s.bubble){r.enableBubble(m)}return r.fireEvent.apply(r,k)}}else{k.shift();l=p.fire.apply(p,k)}}}return l},addListener:function(k,m,l,r){var n=this,q,s,p;if(typeof k=="object"){r=k;for(q in r){s=r[q];if(!n.filterOptRe.test(q)){n.addListener(q,s.fn||s,s.scope||r.scope,s.fn?s:r)}}}else{k=k.toLowerCase();p=n.events[k]||g;if(typeof p=="boolean"){n.events[k]=p=new h.Event(n,k)}p.addListener(m,l,typeof r=="object"?r:{})}},removeListener:function(k,m,l){var n=this.events[k.toLowerCase()];if(typeof n=="object"){n.removeListener(m,l)}},purgeListeners:function(){var m=this.events,k,l;for(l in m){k=m[l];if(typeof k=="object"){k.clearListeners()}}},addEvents:function(n){var m=this;m.events=m.events||{};if(typeof n=="string"){var k=arguments,l=k.length;while(l--){m.events[k[l]]=m.events[k[l]]||g}}else{Ext.applyIf(m.events,n)}},hasListener:function(k){var l=this.events[k.toLowerCase()];return typeof l=="object"&&l.listeners.length>0},suspendEvents:function(k){this.eventsSuspended=g;if(k&&!this.eventQueue){this.eventQueue=[]}},resumeEvents:function(){var k=this,l=k.eventQueue||[];k.eventsSuspended=i;delete k.eventQueue;j(l,function(m){k.fireEvent.apply(k,m)})}};var d=h.Observable.prototype;d.on=d.addListener;d.un=d.removeListener;h.Observable.releaseCapture=function(k){k.fireEvent=d.fireEvent};function e(l,m,k){return function(){if(m.target==arguments[0]){l.apply(k,Array.prototype.slice.call(arguments,0))}}}function b(n,p,k,m){k.task=new h.DelayedTask();return function(){k.task.delay(p.buffer,n,m,Array.prototype.slice.call(arguments,0))}}function c(m,n,l,k){return function(){n.removeListener(l,k);return m.apply(k,arguments)}}function a(n,p,k,m){return function(){var l=new h.DelayedTask(),o=Array.prototype.slice.call(arguments,0);if(!k.tasks){k.tasks=[]}k.tasks.push(l);l.delay(p.delay||10,function(){k.tasks.remove(l);n.apply(m,o)},m)}}h.Event=function(l,k){this.name=k;this.obj=l;this.listeners=[]};h.Event.prototype={addListener:function(o,n,m){var p=this,k;n=n||p.obj;if(!p.isListening(o,n)){k=p.createListener(o,n,m);if(p.firing){p.listeners=p.listeners.slice(0)}p.listeners.push(k)}},createListener:function(p,n,q){q=q||{};n=n||this.obj;var k={fn:p,scope:n,options:q},m=p;if(q.target){m=e(m,q,n)}if(q.delay){m=a(m,q,k,n)}if(q.single){m=c(m,this,p,n)}if(q.buffer){m=b(m,q,k,n)}k.fireFn=m;return k},findListener:function(o,n){var p=this.listeners,m=p.length,k;n=n||this.obj;while(m--){k=p[m];if(k){if(k.fn==o&&k.scope==n){return m}}}return -1},isListening:function(l,k){return this.findListener(l,k)!=-1},removeListener:function(r,q){var p,m,n,s=this,o=i;if((p=s.findListener(r,q))!=-1){if(s.firing){s.listeners=s.listeners.slice(0)}m=s.listeners[p];if(m.task){m.task.cancel();delete m.task}n=m.tasks&&m.tasks.length;if(n){while(n--){m.tasks[n].cancel()}delete m.tasks}s.listeners.splice(p,1);o=g}return o},clearListeners:function(){var n=this,k=n.listeners,m=k.length;while(m--){n.removeListener(k[m].fn,k[m].scope)}},fire:function(){var q=this,p=q.listeners,k=p.length,o=0,m;if(k>0){q.firing=g;var n=Array.prototype.slice.call(arguments,0);for(;o<k;o++){m=p[o];if(m&&m.fireFn.apply(m.scope||q.obj||window,n)===i){return(q.firing=i)}}}q.firing=i;return g}}})();Ext.DomHelper=function(){var x=null,k=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,m=/^table|tbody|tr|td$/i,d=/tag|children|cn|html$/i,t=/td|tr|tbody/i,o=/([a-z0-9-]+)\s*:\s*([^;\s]+(?:\s*[^;\s]+)*);?/gi,v=/end/i,r,n="afterbegin",p="afterend",c="beforebegin",q="beforeend",a="<table>",i="</table>",b=a+"<tbody>",j="</tbody>"+i,l=b+"<tr>",w="</tr>"+j;function h(B,D,C,E,A,y){var z=r.insertHtml(E,Ext.getDom(B),u(D));return C?Ext.get(z,true):z}function u(D){var z="",y,C,B,E;if(typeof D=="string"){z=D}else{if(Ext.isArray(D)){for(var A=0;A<D.length;A++){if(D[A]){z+=u(D[A])}}}else{z+="<"+(D.tag=D.tag||"div");for(y in D){C=D[y];if(!d.test(y)){if(typeof C=="object"){z+=" "+y+'="';for(B in C){z+=B+":"+C[B]+";"}z+='"'}else{z+=" "+({cls:"class",htmlFor:"for"}[y]||y)+'="'+C+'"'}}}if(k.test(D.tag)){z+="/>"}else{z+=">";if((E=D.children||D.cn)){z+=u(E)}else{if(D.html){z+=D.html}}z+="</"+D.tag+">"}}}return z}function g(F,C,B,D){x.innerHTML=[C,B,D].join("");var y=-1,A=x,z;while(++y<F){A=A.firstChild}if(z=A.nextSibling){var E=document.createDocumentFragment();while(A){z=A.nextSibling;E.appendChild(A);A=z}A=E}return A}function e(y,z,B,A){var C,D;x=x||document.createElement("div");if(y=="td"&&(z==n||z==q)||!t.test(y)&&(z==c||z==p)){return}D=z==c?B:z==p?B.nextSibling:z==n?B.firstChild:null;if(z==c||z==p){B=B.parentNode}if(y=="td"||(y=="tr"&&(z==q||z==n))){C=g(4,l,A,w)}else{if((y=="tbody"&&(z==q||z==n))||(y=="tr"&&(z==c||z==p))){C=g(3,b,A,j)}else{C=g(2,a,A,i)}}B.insertBefore(C,D);return C}function s(A){var D=document.createElement("div"),y=document.createDocumentFragment(),z=0,B,C;D.innerHTML=A;C=D.childNodes;B=C.length;for(;z<B;z++){y.appendChild(C[z].cloneNode(true))}return y}r={markup:function(y){return u(y)},applyStyles:function(y,z){if(z){var A;y=Ext.fly(y);if(typeof z=="function"){z=z.call()}if(typeof z=="string"){o.lastIndex=0;while((A=o.exec(z))){y.setStyle(A[1],A[2])}}else{if(typeof z=="object"){y.setStyle(z)}}}},insertHtml:function(D,y,E){var B={},A,F,C,G,H,z;D=D.toLowerCase();B[c]=["BeforeBegin","previousSibling"];B[p]=["AfterEnd","nextSibling"];if(y.insertAdjacentHTML){if(m.test(y.tagName)&&(z=e(y.tagName.toLowerCase(),D,y,E))){return z}B[n]=["AfterBegin","firstChild"];B[q]=["BeforeEnd","lastChild"];if((A=B[D])){y.insertAdjacentHTML(A[0],E);return y[A[1]]}}else{F=y.ownerDocument.createRange();G="setStart"+(v.test(D)?"After":"Before");if(B[D]){F[G](y);if(!F.createContextualFragment){H=s(E)}else{H=F.createContextualFragment(E)}y.parentNode.insertBefore(H,D==c?y:y.nextSibling);return y[(D==c?"previous":"next")+"Sibling"]}else{C=(D==n?"first":"last")+"Child";if(y.firstChild){F[G](y[C]);if(!F.createContextualFragment){H=s(E)}else{H=F.createContextualFragment(E)}if(D==n){y.insertBefore(H,y.firstChild)}else{y.appendChild(H)}}else{y.innerHTML=E}return y[C]}}throw'Illegal insertion point -> "'+D+'"'},insertBefore:function(y,A,z){return h(y,A,z,c)},insertAfter:function(y,A,z){return h(y,A,z,p,"nextSibling")},insertFirst:function(y,A,z){return h(y,A,z,n,"firstChild")},append:function(y,A,z){return h(y,A,z,q,"",true)},overwrite:function(y,A,z){y=Ext.getDom(y);y.innerHTML=u(A);return z?Ext.get(y.firstChild):y.firstChild},createHtml:u};return r}();Ext.Template=function(h){var j=this,c=arguments,e=[],d;if(Ext.isArray(h)){h=h.join("")}else{if(c.length>1){for(var g=0,b=c.length;g<b;g++){d=c[g];if(typeof d=="object"){Ext.apply(j,d)}else{e.push(d)}}h=e.join("")}}j.html=h;if(j.compiled){j.compile()}};Ext.Template.prototype={re:/\{([\w\-]+)\}/g,applyTemplate:function(a){var b=this;return b.compiled?b.compiled(a):b.html.replace(b.re,function(c,d){return a[d]!==undefined?a[d]:""})},set:function(a,c){var b=this;b.html=a;b.compiled=null;return c?b.compile():b},compile:function(){var me=this,sep=Ext.isGecko?"+":",";function fn(m,name){name="values['"+name+"']";return"'"+sep+"("+name+" == undefined ? '' : "+name+")"+sep+"'"}eval("this.compiled = function(values){ return "+(Ext.isGecko?"'":"['")+me.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn)+(Ext.isGecko?"';};":"'].join('');};"));return me},insertFirst:function(b,a,c){return this.doInsert("afterBegin",b,a,c)},insertBefore:function(b,a,c){return this.doInsert("beforeBegin",b,a,c)},insertAfter:function(b,a,c){return this.doInsert("afterEnd",b,a,c)},append:function(b,a,c){return this.doInsert("beforeEnd",b,a,c)},doInsert:function(c,e,b,a){e=Ext.getDom(e);var d=Ext.DomHelper.insertHtml(c,e,this.applyTemplate(b));return a?Ext.get(d,true):d},overwrite:function(b,a,c){b=Ext.getDom(b);b.innerHTML=this.applyTemplate(a);return c?Ext.get(b.firstChild,true):b.firstChild}};Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;Ext.Template.from=function(b,a){b=Ext.getDom(b);return new Ext.Template(b.value||b.innerHTML,a||"")};Ext.DomQuery=function(){var cache={},simpleCache={},valueCache={},nonSpace=/\S/,trimRe=/^\s+|\s+$/g,tplRe=/\{(\d+)\}/g,modeRe=/^(\s?[\/>+~]\s?|\s|$)/,tagTokenRe=/^(#)?([\w\-\*]+)/,nthRe=/(\d*)n\+?(\d*)/,nthRe2=/\D/,isIE=window.ActiveXObject?true:false,key=30803;eval("var batch = 30803;");function child(parent,index){var i=0,n=parent.firstChild;while(n){if(n.nodeType==1){if(++i==index){return n}}n=n.nextSibling}return null}function next(n){while((n=n.nextSibling)&&n.nodeType!=1){}return n}function prev(n){while((n=n.previousSibling)&&n.nodeType!=1){}return n}function children(parent){var n=parent.firstChild,nodeIndex=-1,nextNode;while(n){nextNode=n.nextSibling;if(n.nodeType==3&&!nonSpace.test(n.nodeValue)){parent.removeChild(n)}else{n.nodeIndex=++nodeIndex}n=nextNode}return this}function byClassName(nodeSet,cls){if(!cls){return nodeSet}var result=[],ri=-1;for(var i=0,ci;ci=nodeSet[i];i++){if((" "+ci.className+" ").indexOf(cls)!=-1){result[++ri]=ci}}return result}function attrValue(n,attr){if(!n.tagName&&typeof n.length!="undefined"){n=n[0]}if(!n){return null}if(attr=="for"){return n.htmlFor}if(attr=="class"||attr=="className"){return n.className}return n.getAttribute(attr)||n[attr]}function getNodes(ns,mode,tagName){var result=[],ri=-1,cs;if(!ns){return result}tagName=tagName||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns]}if(!mode){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(tagName);for(var j=0,ci;ci=cs[j];j++){result[++ri]=ci}}}else{if(mode=="/"||mode==">"){var utag=tagName.toUpperCase();for(var i=0,ni,cn;ni=ns[i];i++){cn=ni.childNodes;for(var j=0,cj;cj=cn[j];j++){if(cj.nodeName==utag||cj.nodeName==tagName||tagName=="*"){result[++ri]=cj}}}}else{if(mode=="+"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(n&&(n.nodeName==utag||n.nodeName==tagName||tagName=="*")){result[++ri]=n}}}else{if(mode=="~"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)){if(n.nodeName==utag||n.nodeName==tagName||tagName=="*"){result[++ri]=n}}}}}}}return result}function concat(a,b){if(b.slice){return a.concat(b)}for(var i=0,l=b.length;i<l;i++){a[a.length]=b[i]}return a}function byTag(cs,tagName){if(cs.tagName||cs==document){cs=[cs]}if(!tagName){return cs}var result=[],ri=-1;tagName=tagName.toLowerCase();for(var i=0,ci;ci=cs[i];i++){if(ci.nodeType==1&&ci.tagName.toLowerCase()==tagName){result[++ri]=ci}}return result}function byId(cs,id){if(cs.tagName||cs==document){cs=[cs]}if(!id){return cs}var result=[],ri=-1;for(var i=0,ci;ci=cs[i];i++){if(ci&&ci.id==id){result[++ri]=ci;return result}}return result}function byAttribute(cs,attr,value,op,custom){var result=[],ri=-1,useGetStyle=custom=="{",fn=Ext.DomQuery.operators[op],a,xml,hasXml;for(var i=0,ci;ci=cs[i];i++){if(ci.nodeType!=1){continue}if(!hasXml){xml=Ext.DomQuery.isXml(ci);hasXml=true}if(!xml){if(useGetStyle){a=Ext.DomQuery.getStyle(ci,attr)}else{if(attr=="class"||attr=="className"){a=ci.className}else{if(attr=="for"){a=ci.htmlFor}else{if(attr=="href"){a=ci.getAttribute("href",2)}else{a=ci.getAttribute(attr)}}}}}else{a=ci.getAttribute(attr)}if((fn&&fn(a,value))||(!fn&&a)){result[++ri]=ci}}return result}function byPseudo(cs,name,value){return Ext.DomQuery.pseudos[name](cs,value)}function nodupIEXml(cs){var d=++key,r;cs[0].setAttribute("_nodup",d);r=[cs[0]];for(var i=1,len=cs.length;i<len;i++){var c=cs[i];if(!c.getAttribute("_nodup")!=d){c.setAttribute("_nodup",d);r[r.length]=c}}for(var i=0,len=cs.length;i<len;i++){cs[i].removeAttribute("_nodup")}return r}function nodup(cs){if(!cs){return[]}var len=cs.length,c,i,r=cs,cj,ri=-1;if(!len||typeof cs.nodeType!="undefined"||len==1){return cs}if(isIE&&typeof cs[0].selectSingleNode!="undefined"){return nodupIEXml(cs)}var d=++key;cs[0]._nodup=d;for(i=1;c=cs[i];i++){if(c._nodup!=d){c._nodup=d}else{r=[];for(var j=0;j<i;j++){r[++ri]=cs[j]}for(j=i+1;cj=cs[j];j++){if(cj._nodup!=d){cj._nodup=d;r[++ri]=cj}}return r}}return r}function quickDiffIEXml(c1,c2){var d=++key,r=[];for(var i=0,len=c1.length;i<len;i++){c1[i].setAttribute("_qdiff",d)}for(var i=0,len=c2.length;i<len;i++){if(c2[i].getAttribute("_qdiff")!=d){r[r.length]=c2[i]}}for(var i=0,len=c1.length;i<len;i++){c1[i].removeAttribute("_qdiff")}return r}function quickDiff(c1,c2){var len1=c1.length,d=++key,r=[];if(!len1){return c2}if(isIE&&typeof c1[0].selectSingleNode!="undefined"){return quickDiffIEXml(c1,c2)}for(var i=0;i<len1;i++){c1[i]._qdiff=d}for(var i=0,len=c2.length;i<len;i++){if(c2[i]._qdiff!=d){r[r.length]=c2[i]}}return r}function quickId(ns,mode,root,id){if(ns==root){var d=root.ownerDocument||root;return d.getElementById(id)}ns=getNodes(ns,mode,"*");return byId(ns,id)}return{getStyle:function(el,name){return Ext.fly(el).getStyle(name)},compile:function(path,type){type=type||"select";var fn=["var f = function(root){\n var mode; ++batch; var n = root || document;\n"],mode,lastPath,matchers=Ext.DomQuery.matchers,matchersLn=matchers.length,modeMatch,lmode=path.match(modeRe);if(lmode&&lmode[1]){fn[fn.length]='mode="'+lmode[1].replace(trimRe,"")+'";';path=path.replace(lmode[1],"")}while(path.substr(0,1)=="/"){path=path.substr(1)}while(path&&lastPath!=path){lastPath=path;var tokenMatch=path.match(tagTokenRe);if(type=="select"){if(tokenMatch){if(tokenMatch[1]=="#"){fn[fn.length]='n = quickId(n, mode, root, "'+tokenMatch[2]+'");'}else{fn[fn.length]='n = getNodes(n, mode, "'+tokenMatch[2]+'");'}path=path.replace(tokenMatch[0],"")}else{if(path.substr(0,1)!="@"){fn[fn.length]='n = getNodes(n, mode, "*");'}}}else{if(tokenMatch){if(tokenMatch[1]=="#"){fn[fn.length]='n = byId(n, "'+tokenMatch[2]+'");'}else{fn[fn.length]='n = byTag(n, "'+tokenMatch[2]+'");'}path=path.replace(tokenMatch[0],"")}}while(!(modeMatch=path.match(modeRe))){var matched=false;for(var j=0;j<matchersLn;j++){var t=matchers[j];var m=path.match(t.re);if(m){fn[fn.length]=t.select.replace(tplRe,function(x,i){return m[i]});path=path.replace(m[0],"");matched=true;break}}if(!matched){throw'Error parsing selector, parsing failed at "'+path+'"'}}if(modeMatch[1]){fn[fn.length]='mode="'+modeMatch[1].replace(trimRe,"")+'";';path=path.replace(modeMatch[1],"")}}fn[fn.length]="return nodup(n);\n}";eval(fn.join(""));return f},jsSelect:function(path,root,type){root=root||document;if(typeof root=="string"){root=document.getElementById(root)}var paths=path.split(","),results=[];for(var i=0,len=paths.length;i<len;i++){var subPath=paths[i].replace(trimRe,"");if(!cache[subPath]){cache[subPath]=Ext.DomQuery.compile(subPath);if(!cache[subPath]){throw subPath+" is not a valid selector"}}var result=cache[subPath](root);if(result&&result!=document){results=results.concat(result)}}if(paths.length>1){return nodup(results)}return results},isXml:function(el){var docEl=(el?el.ownerDocument||el:0).documentElement;return docEl?docEl.nodeName!=="HTML":false},select:document.querySelectorAll?function(path,root,type){root=root||document;if(!Ext.DomQuery.isXml(root)){try{var cs=root.querySelectorAll(path);return Ext.toArray(cs)}catch(ex){}}return Ext.DomQuery.jsSelect.call(this,path,root,type)}:function(path,root,type){return Ext.DomQuery.jsSelect.call(this,path,root,type)},selectNode:function(path,root){return Ext.DomQuery.select(path,root)[0]},selectValue:function(path,root,defaultValue){path=path.replace(trimRe,"");if(!valueCache[path]){valueCache[path]=Ext.DomQuery.compile(path,"select")}var n=valueCache[path](root),v;n=n[0]?n[0]:n;if(typeof n.normalize=="function"){n.normalize()}v=(n&&n.firstChild?n.firstChild.nodeValue:null);return((v===null||v===undefined||v==="")?defaultValue:v)},selectNumber:function(path,root,defaultValue){var v=Ext.DomQuery.selectValue(path,root,defaultValue||0);return parseFloat(v)},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el)}var isArray=Ext.isArray(el),result=Ext.DomQuery.filter(isArray?el:[el],ss);return isArray?(result.length==el.length):(result.length>0)},filter:function(els,ss,nonMatches){ss=ss.replace(trimRe,"");if(!simpleCache[ss]){simpleCache[ss]=Ext.DomQuery.compile(ss,"simple")}var result=simpleCache[ss](els);return nonMatches?quickDiff(result,els):result},matchers:[{re:/^\.([\w\-]+)/,select:'n = byClassName(n, " {1} ");'},{re:/^\:([\w\-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w\-]+)\s?(?:(=|.=)\s?(["']?)(.*?)\4)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{5}", "{3}", "{1}");'},{re:/^#([\w\-]+)/,select:'n = byId(n, "{1}");'},{re:/^@([\w\-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],operators:{"=":function(a,v){return a==v},"!=":function(a,v){return a!=v},"^=":function(a,v){return a&&a.substr(0,v.length)==v},"$=":function(a,v){return a&&a.substr(a.length-v.length)==v},"*=":function(a,v){return a&&a.indexOf(v)!==-1},"%=":function(a,v){return(a%v)==0},"|=":function(a,v){return a&&(a==v||a.substr(0,v.length+1)==v+"-")},"~=":function(a,v){return a&&(" "+a+" ").indexOf(" "+v+" ")!=-1}},pseudos:{"first-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.previousSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"last-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"nth-child":function(c,a){var r=[],ri=-1,m=nthRe.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!nthRe2.test(a)&&"n+"+a||a),f=(m[1]||1)-0,l=m[2]-0;for(var i=0,n;n=c[i];i++){var pn=n.parentNode;if(batch!=pn._batch){var j=0;for(var cn=pn.firstChild;cn;cn=cn.nextSibling){if(cn.nodeType==1){cn.nodeIndex=++j}}pn._batch=batch}if(f==1){if(l==0||n.nodeIndex==l){r[++ri]=n}}else{if((n.nodeIndex+l)%f==0){r[++ri]=n}}}return r},"only-child":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(!prev(ci)&&!next(ci)){r[++ri]=ci}}return r},empty:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var cns=ci.childNodes,j=0,cn,empty=true;while(cn=cns[j]){++j;if(cn.nodeType==1||cn.nodeType==3){empty=false;break}}if(empty){r[++ri]=ci}}return r},contains:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if((ci.textContent||ci.innerText||"").indexOf(v)!=-1){r[++ri]=ci}}return r},nodeValue:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[++ri]=ci}}return r},checked:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[++ri]=ci}}return r},not:function(c,ss){return Ext.DomQuery.filter(c,ss,true)},any:function(c,selectors){var ss=selectors.split("|"),r=[],ri=-1,s;for(var i=0,ci;ci=c[i];i++){for(var j=0;s=ss[j];j++){if(Ext.DomQuery.is(ci,s)){r[++ri]=ci;break}}}return r},odd:function(c){return this["nth-child"](c,"odd")},even:function(c){return this["nth-child"](c,"even")},nth:function(c,a){return c[a-1]||[]},first:function(c){return c[0]||[]},last:function(c){return c[c.length-1]||[]},has:function(c,ss){var s=Ext.DomQuery.select,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[++ri]=ci}}return r},next:function(c,ss){var is=Ext.DomQuery.is,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=next(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r},prev:function(c,ss){var is=Ext.DomQuery.is,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=prev(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r}}}}();Ext.query=Ext.DomQuery.select;Ext.util.DelayedTask=function(d,c,a){var e=this,g,b=function(){clearInterval(g);g=null;d.apply(c,a||[])};e.delay=function(i,k,j,h){e.cancel();d=k||d;c=j||c;a=h||a;g=setInterval(b,i)};e.cancel=function(){if(g){clearInterval(g);g=null}}};(function(){var h=document;Ext.Element=function(l,m){var n=typeof l=="string"?h.getElementById(l):l,o;if(!n){return null}o=n.id;if(!m&&o&&Ext.elCache[o]){return Ext.elCache[o].el}this.dom=n;this.id=o||Ext.id(n)};var d=Ext.DomHelper,e=Ext.Element,a=Ext.elCache;e.prototype={set:function(q,m){var n=this.dom,l,p,m=(m!==false)&&!!n.setAttribute;for(l in q){if(q.hasOwnProperty(l)){p=q[l];if(l=="style"){d.applyStyles(n,p)}else{if(l=="cls"){n.className=p}else{if(m){n.setAttribute(l,p)}else{n[l]=p}}}}}return this},defaultUnit:"px",is:function(l){return Ext.DomQuery.is(this.dom,l)},focus:function(o,n){var l=this,n=n||l.dom;try{if(Number(o)){l.focus.defer(o,null,[null,n])}else{n.focus()}}catch(m){}return l},blur:function(){try{this.dom.blur()}catch(l){}return this},getValue:function(l){var m=this.dom.value;return l?parseInt(m,10):m},addListener:function(l,o,n,m){Ext.EventManager.on(this.dom,l,o,n||this,m);return this},removeListener:function(l,n,m){Ext.EventManager.removeListener(this.dom,l,n,m||this);return this},removeAllListeners:function(){Ext.EventManager.removeAll(this.dom);return this},purgeAllListeners:function(){Ext.EventManager.purgeElement(this,true);return this},addUnits:function(l){if(l===""||l=="auto"||l===undefined){l=l||""}else{if(!isNaN(l)||!i.test(l)){l=l+(this.defaultUnit||"px")}}return l},load:function(m,n,l){Ext.Ajax.request(Ext.apply({params:n,url:m.url||m,callback:l,el:this.dom,indicatorText:m.indicatorText||""},Ext.isObject(m)?m:{}));return this},isBorderBox:function(){return Ext.isBorderBox||Ext.isForcedBorderBox||g[(this.dom.tagName||"").toLowerCase()]},remove:function(){var l=this,m=l.dom;if(m){delete l.dom;Ext.removeNode(m)}},hover:function(m,l,o,n){var p=this;p.on("mouseenter",m,o||p.dom,n);p.on("mouseleave",l,o||p.dom,n);return p},contains:function(l){return !l?false:Ext.lib.Dom.isAncestor(this.dom,l.dom?l.dom:l)},getAttributeNS:function(m,l){return this.getAttribute(l,m)},getAttribute:(function(){var p=document.createElement("table"),o=false,m="getAttribute" in p,l=/undefined|unknown/;if(m){try{p.getAttribute("ext:qtip")}catch(n){o=true}return function(q,s){var r=this.dom,t;if(r.getAttributeNS){t=r.getAttributeNS(s,q)||null}if(t==null){if(s){if(o&&r.tagName.toUpperCase()=="TABLE"){try{t=r.getAttribute(s+":"+q)}catch(u){t=""}}else{t=r.getAttribute(s+":"+q)}}else{t=r.getAttribute(q)||r[q]}}return t||""}}else{return function(q,s){var r=this.om,u,t;if(s){t=r[s+":"+q];u=l.test(typeof t)?undefined:t}else{u=r[q]}return u||""}}p=null})(),update:function(l){if(this.dom){this.dom.innerHTML=l}return this}};var k=e.prototype;e.addMethods=function(l){Ext.apply(k,l)};k.on=k.addListener;k.un=k.removeListener;k.autoBoxAdjust=true;var i=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i,c;e.get=function(m){var l,p,o;if(!m){return null}if(typeof m=="string"){if(!(p=h.getElementById(m))){return null}if(a[m]&&a[m].el){l=a[m].el;l.dom=p}else{l=e.addToCache(new e(p))}return l}else{if(m.tagName){if(!(o=m.id)){o=Ext.id(m)}if(a[o]&&a[o].el){l=a[o].el;l.dom=m}else{l=e.addToCache(new e(m))}return l}else{if(m instanceof e){if(m!=c){if(Ext.isIE&&(m.id==undefined||m.id=="")){m.dom=m.dom}else{m.dom=h.getElementById(m.id)||m.dom}}return m}else{if(m.isComposite){return m}else{if(Ext.isArray(m)){return e.select(m)}else{if(m==h){if(!c){var n=function(){};n.prototype=e.prototype;c=new n();c.dom=h}return c}}}}}}return null};e.addToCache=function(l,m){m=m||l.id;a[m]={el:l,data:{},events:{}};return l};e.data=function(m,l,n){m=e.get(m);if(!m){return null}var o=a[m.id].data;if(arguments.length==2){return o[l]}else{return(o[l]=n)}};function j(){if(!Ext.enableGarbageCollector){clearInterval(e.collectorThreadId)}else{var l,n,q,p;for(l in a){p=a[l];if(p.skipGC){continue}n=p.el;q=n.dom;if(!q||!q.parentNode||(!q.offsetParent&&!h.getElementById(l))){if(Ext.enableListenerCollection){Ext.EventManager.removeAll(q)}delete a[l]}}if(Ext.isIE){var m={};for(l in a){m[l]=a[l]}a=Ext.elCache=m}}}e.collectorThreadId=setInterval(j,30000);var b=function(){};b.prototype=e.prototype;e.Flyweight=function(l){this.dom=l};e.Flyweight.prototype=new b();e.Flyweight.prototype.isFlyweight=true;e._flyweights={};e.fly=function(n,l){var m=null;l=l||"_global";if(n=Ext.getDom(n)){(e._flyweights[l]=e._flyweights[l]||new e.Flyweight()).dom=n;m=e._flyweights[l]}return m};Ext.get=e.get;Ext.fly=e.fly;var g=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko){g.button=1}})();Ext.Element.addMethods(function(){var d="parentNode",b="nextSibling",c="previousSibling",e=Ext.DomQuery,a=Ext.get;return{findParent:function(m,l,h){var j=this.dom,g=document.body,k=0,i;if(Ext.isGecko&&Object.prototype.toString.call(j)=="[object XULElement]"){return null}l=l||50;if(isNaN(l)){i=Ext.getDom(l);l=Number.MAX_VALUE}while(j&&j.nodeType==1&&k<l&&j!=g&&j!=i){if(e.is(j,m)){return h?a(j):j}k++;j=j.parentNode}return null},findParentNode:function(j,i,g){var h=Ext.fly(this.dom.parentNode,"_internal");return h?h.findParent(j,i,g):null},up:function(h,g){return this.findParentNode(h,g,true)},select:function(g){return Ext.Element.select(g,this.dom)},query:function(g){return e.select(g,this.dom)},child:function(g,h){var i=e.selectNode(g,this.dom);return h?i:a(i)},down:function(g,h){var i=e.selectNode(" > "+g,this.dom);return h?i:a(i)},parent:function(g,h){return this.matchNode(d,d,g,h)},next:function(g,h){return this.matchNode(b,b,g,h)},prev:function(g,h){return this.matchNode(c,c,g,h)},first:function(g,h){return this.matchNode(b,"firstChild",g,h)},last:function(g,h){return this.matchNode(c,"lastChild",g,h)},matchNode:function(h,k,g,i){var j=this.dom[k];while(j){if(j.nodeType==1&&(!g||e.is(j,g))){return !i?a(j):j}j=j[h]}return null}}}());Ext.Element.addMethods(function(){var c=Ext.getDom,a=Ext.get,b=Ext.DomHelper;return{appendChild:function(d){return a(d).appendTo(this)},appendTo:function(d){c(d).appendChild(this.dom);return this},insertBefore:function(d){(d=c(d)).parentNode.insertBefore(this.dom,d);return this},insertAfter:function(d){(d=c(d)).parentNode.insertBefore(this.dom,d.nextSibling);return this},insertFirst:function(e,d){e=e||{};if(e.nodeType||e.dom||typeof e=="string"){e=c(e);this.dom.insertBefore(e,this.dom.firstChild);return !d?a(e):e}else{return this.createChild(e,this.dom.firstChild,d)}},replace:function(d){d=a(d);this.insertBefore(d);d.remove();return this},replaceWith:function(d){var e=this;if(d.nodeType||d.dom||typeof d=="string"){d=c(d);e.dom.parentNode.insertBefore(d,e.dom)}else{d=b.insertBefore(e.dom,d)}delete Ext.elCache[e.id];Ext.removeNode(e.dom);e.id=Ext.id(e.dom=d);Ext.Element.addToCache(e.isFlyweight?new Ext.Element(e.dom):e);return e},createChild:function(e,d,g){e=e||{tag:"div"};return d?b.insertBefore(d,e,g!==true):b[!this.dom.firstChild?"overwrite":"append"](this.dom,e,g!==true)},wrap:function(d,e){var g=b.insertBefore(this.dom,d||{tag:"div"},!e);g.dom?g.dom.appendChild(this.dom):g.appendChild(this.dom);return g},insertHtml:function(e,g,d){var h=b.insertHtml(e,this.dom,g);return d?Ext.get(h):h}}}());Ext.Element.addMethods(function(){var A=Ext.supports,h={},x=/(-[a-z])/gi,s=document.defaultView,D=/alpha\(opacity=(.*)\)/i,l=/^\s+|\s+$/g,B=Ext.Element,u=/\s+/,b=/\w/g,d="padding",c="margin",y="border",t="-left",q="-right",w="-top",o="-bottom",j="-width",r=Math,z="hidden",e="isClipped",k="overflow",n="overflow-x",m="overflow-y",C="originalClip",i={l:y+t+j,r:y+q+j,t:y+w+j,b:y+o+j},g={l:d+t,r:d+q,t:d+w,b:d+o},a={l:c+t,r:c+q,t:c+w,b:c+o},E=Ext.Element.data;function p(F,G){return G.charAt(1).toUpperCase()}function v(F){return h[F]||(h[F]=F=="float"?(A.cssFloat?"cssFloat":"styleFloat"):F.replace(x,p))}return{adjustWidth:function(F){var G=this;var H=(typeof F=="number");if(H&&G.autoBoxAdjust&&!G.isBorderBox()){F-=(G.getBorderWidth("lr")+G.getPadding("lr"))}return(H&&F<0)?0:F},adjustHeight:function(F){var G=this;var H=(typeof F=="number");if(H&&G.autoBoxAdjust&&!G.isBorderBox()){F-=(G.getBorderWidth("tb")+G.getPadding("tb"))}return(H&&F<0)?0:F},addClass:function(J){var K=this,I,F,H,G=[];if(!Ext.isArray(J)){if(typeof J=="string"&&!this.hasClass(J)){K.dom.className+=" "+J}}else{for(I=0,F=J.length;I<F;I++){H=J[I];if(typeof H=="string"&&(" "+K.dom.className+" ").indexOf(" "+H+" ")==-1){G.push(H)}}if(G.length){K.dom.className+=" "+G.join(" ")}}return K},removeClass:function(K){var L=this,J,G,F,I,H;if(!Ext.isArray(K)){K=[K]}if(L.dom&&L.dom.className){H=L.dom.className.replace(l,"").split(u);for(J=0,F=K.length;J<F;J++){I=K[J];if(typeof I=="string"){I=I.replace(l,"");G=H.indexOf(I);if(G!=-1){H.splice(G,1)}}}L.dom.className=H.join(" ")}return L},radioClass:function(I){var J=this.dom.parentNode.childNodes,G,H,F;I=Ext.isArray(I)?I:[I];for(H=0,F=J.length;H<F;H++){G=J[H];if(G&&G.nodeType==1){Ext.fly(G,"_internal").removeClass(I)}}return this.addClass(I)},toggleClass:function(F){return this.hasClass(F)?this.removeClass(F):this.addClass(F)},hasClass:function(F){return F&&(" "+this.dom.className+" ").indexOf(" "+F+" ")!=-1},replaceClass:function(G,F){return this.removeClass(G).addClass(F)},isStyle:function(F,G){return this.getStyle(F)==G},getStyle:function(){return s&&s.getComputedStyle?function(K){var I=this.dom,F,H,G,J;if(I==document){return null}K=v(K);G=(F=I.style[K])?F:(H=s.getComputedStyle(I,""))?H[K]:null;if(K=="marginRight"&&G!="0px"&&!A.correctRightMargin){J=I.style.display;I.style.display="inline-block";G=s.getComputedStyle(I,"").marginRight;I.style.display=J}if(K=="backgroundColor"&&G=="rgba(0, 0, 0, 0)"&&!A.correctTransparentColor){G="transparent"}return G}:function(J){var H=this.dom,F,G;if(H==document){return null}if(J=="opacity"){if(H.style.filter.match){if(F=H.style.filter.match(D)){var I=parseFloat(F[1]);if(!isNaN(I)){return I?I/100:0}}}return 1}J=v(J);return H.style[J]||((G=H.currentStyle)?G[J]:null)}}(),getColor:function(F,G,K){var I=this.getStyle(F),H=(typeof K!="undefined")?K:"#",J;if(!I||(/transparent|inherit/.test(I))){return G}if(/^r/.test(I)){Ext.each(I.slice(4,I.length-1).split(","),function(L){J=parseInt(L,10);H+=(J<16?"0":"")+J.toString(16)})}else{I=I.replace("#","");H+=I.length==3?I.replace(/^(\w)(\w)(\w)$/,"$1$1$2$2$3$3"):I}return(H.length>5?H.toLowerCase():G)},setStyle:function(I,H){var F,G;if(typeof I!="object"){F={};F[I]=H;I=F}for(G in I){H=I[G];G=="opacity"?this.setOpacity(H):this.dom.style[v(G)]=H}return this},setOpacity:function(G,F){var J=this,H=J.dom.style;if(!F||!J.anim){if(Ext.isIE){var I=G<1?"alpha(opacity="+G*100+")":"",K=H.filter.replace(D,"").replace(l,"");H.zoom=1;H.filter=K+(K.length>0?" ":"")+I}else{H.opacity=G}}else{J.anim({opacity:{to:G}},J.preanim(arguments,1),null,0.35,"easeIn")}return J},clearOpacity:function(){var F=this.dom.style;if(Ext.isIE){if(!Ext.isEmpty(F.filter)){F.filter=F.filter.replace(D,"").replace(l,"")}}else{F.opacity=F["-moz-opacity"]=F["-khtml-opacity"]=""}return this},getHeight:function(H){var G=this,J=G.dom,I=Ext.isIE&&G.isStyle("display","none"),F=r.max(J.offsetHeight,I?0:J.clientHeight)||0;F=!H?F:F-G.getBorderWidth("tb")-G.getPadding("tb");return F<0?0:F},getWidth:function(G){var H=this,J=H.dom,I=Ext.isIE&&H.isStyle("display","none"),F=r.max(J.offsetWidth,I?0:J.clientWidth)||0;F=!G?F:F-H.getBorderWidth("lr")-H.getPadding("lr");return F<0?0:F},setWidth:function(G,F){var H=this;G=H.adjustWidth(G);!F||!H.anim?H.dom.style.width=H.addUnits(G):H.anim({width:{to:G}},H.preanim(arguments,1));return H},setHeight:function(F,G){var H=this;F=H.adjustHeight(F);!G||!H.anim?H.dom.style.height=H.addUnits(F):H.anim({height:{to:F}},H.preanim(arguments,1));return H},getBorderWidth:function(F){return this.addStyles(F,i)},getPadding:function(F){return this.addStyles(F,g)},clip:function(){var F=this,G=F.dom;if(!E(G,e)){E(G,e,true);E(G,C,{o:F.getStyle(k),x:F.getStyle(n),y:F.getStyle(m)});F.setStyle(k,z);F.setStyle(n,z);F.setStyle(m,z)}return F},unclip:function(){var F=this,H=F.dom;if(E(H,e)){E(H,e,false);var G=E(H,C);if(G.o){F.setStyle(k,G.o)}if(G.x){F.setStyle(n,G.x)}if(G.y){F.setStyle(m,G.y)}}return F},addStyles:function(M,L){var J=0,K=M.match(b),I,H,G,F=K.length;for(G=0;G<F;G++){I=K[G];H=I&&parseInt(this.getStyle(L[I]),10);if(H){J+=r.abs(H)}}return J},margins:a}}());(function(){var a=Ext.lib.Dom,b="left",g="right",d="top",i="bottom",h="position",c="static",e="relative",j="auto",k="z-index";Ext.Element.addMethods({getX:function(){return a.getX(this.dom)},getY:function(){return a.getY(this.dom)},getXY:function(){return a.getXY(this.dom)},getOffsetsTo:function(l){var n=this.getXY(),m=Ext.fly(l,"_internal").getXY();return[n[0]-m[0],n[1]-m[1]]},setX:function(l,m){return this.setXY([l,this.getY()],this.animTest(arguments,m,1))},setY:function(m,l){return this.setXY([this.getX(),m],this.animTest(arguments,l,1))},setLeft:function(l){this.setStyle(b,this.addUnits(l));return this},setTop:function(l){this.setStyle(d,this.addUnits(l));return this},setRight:function(l){this.setStyle(g,this.addUnits(l));return this},setBottom:function(l){this.setStyle(i,this.addUnits(l));return this},setXY:function(n,l){var m=this;if(!l||!m.anim){a.setXY(m.dom,n)}else{m.anim({points:{to:n}},m.preanim(arguments,1),"motion")}return m},setLocation:function(l,n,m){return this.setXY([l,n],this.animTest(arguments,m,2))},moveTo:function(l,n,m){return this.setXY([l,n],this.animTest(arguments,m,2))},getLeft:function(l){return !l?this.getX():parseInt(this.getStyle(b),10)||0},getRight:function(l){var m=this;return !l?m.getX()+m.getWidth():(m.getLeft(true)+m.getWidth())||0},getTop:function(l){return !l?this.getY():parseInt(this.getStyle(d),10)||0},getBottom:function(l){var m=this;return !l?m.getY()+m.getHeight():(m.getTop(true)+m.getHeight())||0},position:function(p,o,l,n){var m=this;if(!p&&m.isStyle(h,c)){m.setStyle(h,e)}else{if(p){m.setStyle(h,p)}}if(o){m.setStyle(k,o)}if(l||n){m.setXY([l||false,n||false])}},clearPositioning:function(l){l=l||"";this.setStyle({left:l,right:l,top:l,bottom:l,"z-index":"",position:c});return this},getPositioning:function(){var m=this.getStyle(b);var n=this.getStyle(d);return{position:this.getStyle(h),left:m,right:m?"":this.getStyle(g),top:n,bottom:n?"":this.getStyle(i),"z-index":this.getStyle(k)}},setPositioning:function(l){var n=this,m=n.dom.style;n.setStyle(l);if(l.right==j){m.right=""}if(l.bottom==j){m.bottom=""}return n},translatePoints:function(m,u){u=isNaN(m[1])?u:m[1];m=isNaN(m[0])?m:m[0];var q=this,r=q.isStyle(h,e),s=q.getXY(),n=parseInt(q.getStyle(b),10),p=parseInt(q.getStyle(d),10);n=!isNaN(n)?n:(r?0:q.dom.offsetLeft);p=!isNaN(p)?p:(r?0:q.dom.offsetTop);return{left:(m-s[0]+n),top:(u-s[1]+p)}},animTest:function(m,l,n){return !!l&&this.preanim?this.preanim(m,n):false}})})();Ext.Element.addMethods({isScrollable:function(){var a=this.dom;return a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth},scrollTo:function(a,b){this.dom["scroll"+(/top/i.test(a)?"Top":"Left")]=b;return this},getScroll:function(){var i=this.dom,h=document,a=h.body,c=h.documentElement,b,g,e;if(i==h||i==a){if(Ext.isIE&&Ext.isStrict){b=c.scrollLeft;g=c.scrollTop}else{b=window.pageXOffset;g=window.pageYOffset}e={left:b||(a?a.scrollLeft:0),top:g||(a?a.scrollTop:0)}}else{e={left:i.scrollLeft,top:i.scrollTop}}return e}});Ext.Element.VISIBILITY=1;Ext.Element.DISPLAY=2;Ext.Element.OFFSETS=3;Ext.Element.ASCLASS=4;Ext.Element.visibilityCls="x-hide-nosize";Ext.Element.addMethods(function(){var e=Ext.Element,p="opacity",j="visibility",g="display",d="hidden",n="offsets",k="asclass",m="none",a="nosize",b="originalDisplay",c="visibilityMode",h="isVisible",i=e.data,l=function(r){var q=i(r,b);if(q===undefined){i(r,b,q="")}return q},o=function(r){var q=i(r,c);if(q===undefined){i(r,c,q=1)}return q};return{originalDisplay:"",visibilityMode:1,setVisibilityMode:function(q){i(this.dom,c,q);return this},animate:function(r,t,s,u,q){this.anim(r,{duration:t,callback:s,easing:u},q);return this},anim:function(t,u,r,w,s,q){r=r||"run";u=u||{};var v=this,x=Ext.lib.Anim[r](v.dom,t,(u.duration||w)||0.35,(u.easing||s)||"easeOut",function(){if(q){q.call(v)}if(u.callback){u.callback.call(u.scope||v,v,u)}},v);u.anim=x;return x},preanim:function(q,r){return !q[r]?false:(typeof q[r]=="object"?q[r]:{duration:q[r+1],callback:q[r+2],easing:q[r+3]})},isVisible:function(){var q=this,s=q.dom,r=i(s,h);if(typeof r=="boolean"){return r}r=!q.isStyle(j,d)&&!q.isStyle(g,m)&&!((o(s)==e.ASCLASS)&&q.hasClass(q.visibilityCls||e.visibilityCls));i(s,h,r);return r},setVisible:function(t,q){var w=this,r,y,x,v,u=w.dom,s=o(u);if(typeof q=="string"){switch(q){case g:s=e.DISPLAY;break;case j:s=e.VISIBILITY;break;case n:s=e.OFFSETS;break;case a:case k:s=e.ASCLASS;break}w.setVisibilityMode(s);q=false}if(!q||!w.anim){if(s==e.ASCLASS){w[t?"removeClass":"addClass"](w.visibilityCls||e.visibilityCls)}else{if(s==e.DISPLAY){return w.setDisplayed(t)}else{if(s==e.OFFSETS){if(!t){w.hideModeStyles={position:w.getStyle("position"),top:w.getStyle("top"),left:w.getStyle("left")};w.applyStyles({position:"absolute",top:"-10000px",left:"-10000px"})}else{w.applyStyles(w.hideModeStyles||{position:"",top:"",left:""});delete w.hideModeStyles}}else{w.fixDisplay();u.style.visibility=t?"visible":d}}}}else{if(t){w.setOpacity(0.01);w.setVisible(true)}w.anim({opacity:{to:(t?1:0)}},w.preanim(arguments,1),null,0.35,"easeIn",function(){t||w.setVisible(false).setOpacity(1)})}i(u,h,t);return w},hasMetrics:function(){var q=this.dom;return this.isVisible()||(o(q)==e.VISIBILITY)},toggle:function(q){var r=this;r.setVisible(!r.isVisible(),r.preanim(arguments,0));return r},setDisplayed:function(q){if(typeof q=="boolean"){q=q?l(this.dom):m}this.setStyle(g,q);return this},fixDisplay:function(){var q=this;if(q.isStyle(g,m)){q.setStyle(j,d);q.setStyle(g,l(this.dom));if(q.isStyle(g,m)){q.setStyle(g,"block")}}},hide:function(q){if(typeof q=="string"){this.setVisible(false,q);return this}this.setVisible(false,this.preanim(arguments,0));return this},show:function(q){if(typeof q=="string"){this.setVisible(true,q);return this}this.setVisible(true,this.preanim(arguments,0));return this}}}());(function(){var y=null,A=undefined,k=true,t=false,j="setX",h="setY",a="setXY",n="left",l="bottom",s="top",m="right",q="height",g="width",i="points",w="hidden",z="absolute",u="visible",e="motion",o="position",r="easeOut",d=new Ext.Element.Flyweight(),v={},x=function(B){return B||{}},p=function(B){d.dom=B;d.id=Ext.id(B);return d},c=function(B){if(!v[B]){v[B]=[]}return v[B]},b=function(C,B){v[C]=B};Ext.enableFx=k;Ext.Fx={switchStatements:function(C,D,B){return D.apply(this,B[C])},slideIn:function(H,E){E=x(E);var J=this,G=J.dom,M=G.style,O,B,L,D,C,M,I,N,K,F;H=H||"t";J.queueFx(E,function(){O=p(G).getXY();p(G).fixDisplay();B=p(G).getFxRestore();L={x:O[0],y:O[1],0:O[0],1:O[1],width:G.offsetWidth,height:G.offsetHeight};L.right=L.x+L.width;L.bottom=L.y+L.height;p(G).setWidth(L.width).setHeight(L.height);D=p(G).fxWrap(B.pos,E,w);M.visibility=u;M.position=z;function P(){p(G).fxUnwrap(D,B.pos,E);M.width=B.width;M.height=B.height;p(G).afterFx(E)}N={to:[L.x,L.y]};K={to:L.width};F={to:L.height};function Q(U,R,V,S,X,Z,ac,ab,aa,W,T){var Y={};p(U).setWidth(V).setHeight(S);if(p(U)[X]){p(U)[X](Z)}R[ac]=R[ab]="0";if(aa){Y.width=aa}if(W){Y.height=W}if(T){Y.points=T}return Y}I=p(G).switchStatements(H.toLowerCase(),Q,{t:[D,M,L.width,0,y,y,n,l,y,F,y],l:[D,M,0,L.height,y,y,m,s,K,y,y],r:[D,M,L.width,L.height,j,L.right,n,s,y,y,N],b:[D,M,L.width,L.height,h,L.bottom,n,s,y,F,N],tl:[D,M,0,0,y,y,m,l,K,F,N],bl:[D,M,0,0,h,L.y+L.height,m,s,K,F,N],br:[D,M,0,0,a,[L.right,L.bottom],n,s,K,F,N],tr:[D,M,0,0,j,L.x+L.width,n,l,K,F,N]});M.visibility=u;p(D).show();arguments.callee.anim=p(D).fxanim(I,E,e,0.5,r,P)});return J},slideOut:function(F,D){D=x(D);var H=this,E=H.dom,K=E.style,L=H.getXY(),C,B,I,J,G={to:0};F=F||"t";H.queueFx(D,function(){B=p(E).getFxRestore();I={x:L[0],y:L[1],0:L[0],1:L[1],width:E.offsetWidth,height:E.offsetHeight};I.right=I.x+I.width;I.bottom=I.y+I.height;p(E).setWidth(I.width).setHeight(I.height);C=p(E).fxWrap(B.pos,D,u);K.visibility=u;K.position=z;p(C).setWidth(I.width).setHeight(I.height);function M(){D.useDisplay?p(E).setDisplayed(t):p(E).hide();p(E).fxUnwrap(C,B.pos,D);K.width=B.width;K.height=B.height;p(E).afterFx(D)}function N(O,W,U,X,S,V,R,T,Q){var P={};O[W]=O[U]="0";P[X]=S;if(V){P[V]=R}if(T){P[T]=Q}return P}J=p(E).switchStatements(F.toLowerCase(),N,{t:[K,n,l,q,G],l:[K,m,s,g,G],r:[K,n,s,g,G,i,{to:[I.right,I.y]}],b:[K,n,s,q,G,i,{to:[I.x,I.bottom]}],tl:[K,m,l,g,G,q,G],bl:[K,m,s,g,G,q,G,i,{to:[I.x,I.bottom]}],br:[K,n,s,g,G,q,G,i,{to:[I.x+I.width,I.bottom]}],tr:[K,n,l,g,G,q,G,i,{to:[I.right,I.y]}]});arguments.callee.anim=p(C).fxanim(J,D,e,0.5,r,M)});return H},puff:function(H){H=x(H);var F=this,G=F.dom,C=G.style,D,B,E;F.queueFx(H,function(){D=p(G).getWidth();B=p(G).getHeight();p(G).clearOpacity();p(G).show();E=p(G).getFxRestore();function I(){H.useDisplay?p(G).setDisplayed(t):p(G).hide();p(G).clearOpacity();p(G).setPositioning(E.pos);C.width=E.width;C.height=E.height;C.fontSize="";p(G).afterFx(H)}arguments.callee.anim=p(G).fxanim({width:{to:p(G).adjustWidth(D*2)},height:{to:p(G).adjustHeight(B*2)},points:{by:[-D*0.5,-B*0.5]},opacity:{to:0},fontSize:{to:200,unit:"%"}},H,e,0.5,r,I)});return F},switchOff:function(F){F=x(F);var D=this,E=D.dom,B=E.style,C;D.queueFx(F,function(){p(E).clearOpacity();p(E).clip();C=p(E).getFxRestore();function G(){F.useDisplay?p(E).setDisplayed(t):p(E).hide();p(E).clearOpacity();p(E).setPositioning(C.pos);B.width=C.width;B.height=C.height;p(E).afterFx(F)}p(E).fxanim({opacity:{to:0.3}},y,y,0.1,y,function(){p(E).clearOpacity();(function(){p(E).fxanim({height:{to:1},points:{by:[0,p(E).getHeight()*0.5]}},F,e,0.3,"easeIn",G)}).defer(100)})});return D},highlight:function(D,H){H=x(H);var F=this,G=F.dom,B=H.attr||"backgroundColor",C={},E;F.queueFx(H,function(){p(G).clearOpacity();p(G).show();function I(){G.style[B]=E;p(G).afterFx(H)}E=G.style[B];C[B]={from:D||"ffff9c",to:H.endColor||p(G).getColor(B)||"ffffff"};arguments.callee.anim=p(G).fxanim(C,H,"color",1,"easeIn",I)});return F},frame:function(B,E,H){H=x(H);var D=this,G=D.dom,C,F;D.queueFx(H,function(){B=B||"#C3DAF9";if(B.length==6){B="#"+B}E=E||1;p(G).show();var L=p(G).getXY(),J={x:L[0],y:L[1],0:L[0],1:L[1],width:G.offsetWidth,height:G.offsetHeight},I=function(){C=p(document.body||document.documentElement).createChild({style:{position:z,"z-index":35000,border:"0px solid "+B}});return C.queueFx({},K)};arguments.callee.anim={isAnimated:true,stop:function(){E=0;C.stopFx()}};function K(){var M=Ext.isBorderBox?2:1;F=C.anim({top:{from:J.y,to:J.y-20},left:{from:J.x,to:J.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:J.height,to:J.height+20*M},width:{from:J.width,to:J.width+20*M}},{duration:H.duration||1,callback:function(){C.remove();--E>0?I():p(G).afterFx(H)}});arguments.callee.anim={isAnimated:true,stop:function(){F.stop()}}}I()});return D},pause:function(D){var C=this.dom,B;this.queueFx({},function(){B=setTimeout(function(){p(C).afterFx({})},D*1000);arguments.callee.anim={isAnimated:true,stop:function(){clearTimeout(B);p(C).afterFx({})}}});return this},fadeIn:function(D){D=x(D);var B=this,C=B.dom,E=D.endOpacity||1;B.queueFx(D,function(){p(C).setOpacity(0);p(C).fixDisplay();C.style.visibility=u;arguments.callee.anim=p(C).fxanim({opacity:{to:E}},D,y,0.5,r,function(){if(E==1){p(C).clearOpacity()}p(C).afterFx(D)})});return B},fadeOut:function(E){E=x(E);var C=this,D=C.dom,B=D.style,F=E.endOpacity||0;C.queueFx(E,function(){arguments.callee.anim=p(D).fxanim({opacity:{to:F}},E,y,0.5,r,function(){if(F==0){Ext.Element.data(D,"visibilityMode")==Ext.Element.DISPLAY||E.useDisplay?B.display="none":B.visibility=w;p(D).clearOpacity()}p(D).afterFx(E)})});return C},scale:function(B,C,D){this.shift(Ext.apply({},D,{width:B,height:C}));return this},shift:function(D){D=x(D);var C=this.dom,B={};this.queueFx(D,function(){for(var E in D){if(D[E]!=A){B[E]={to:D[E]}}}B.width?B.width.to=p(C).adjustWidth(D.width):B;B.height?B.height.to=p(C).adjustWidth(D.height):B;if(B.x||B.y||B.xy){B.points=B.xy||{to:[B.x?B.x.to:p(C).getX(),B.y?B.y.to:p(C).getY()]}}arguments.callee.anim=p(C).fxanim(B,D,e,0.35,r,function(){p(C).afterFx(D)})});return this},ghost:function(E,C){C=x(C);var G=this,D=G.dom,J=D.style,H={opacity:{to:0},points:{}},K=H.points,B,I,F;E=E||"b";G.queueFx(C,function(){B=p(D).getFxRestore();I=p(D).getWidth();F=p(D).getHeight();function L(){C.useDisplay?p(D).setDisplayed(t):p(D).hide();p(D).clearOpacity();p(D).setPositioning(B.pos);J.width=B.width;J.height=B.height;p(D).afterFx(C)}K.by=p(D).switchStatements(E.toLowerCase(),function(N,M){return[N,M]},{t:[0,-F],l:[-I,0],r:[I,0],b:[0,F],tl:[-I,-F],bl:[-I,F],br:[I,F],tr:[I,-F]});arguments.callee.anim=p(D).fxanim(H,C,e,0.5,r,L)});return G},syncFx:function(){var B=this;B.fxDefaults=Ext.apply(B.fxDefaults||{},{block:t,concurrent:k,stopFx:t});return B},sequenceFx:function(){var B=this;B.fxDefaults=Ext.apply(B.fxDefaults||{},{block:t,concurrent:t,stopFx:t});return B},nextFx:function(){var B=c(this.dom.id)[0];if(B){B.call(this)}},hasActiveFx:function(){return c(this.dom.id)[0]},stopFx:function(B){var C=this,E=C.dom.id;if(C.hasActiveFx()){var D=c(E)[0];if(D&&D.anim){if(D.anim.isAnimated){b(E,[D]);D.anim.stop(B!==undefined?B:k)}else{b(E,[])}}}return C},beforeFx:function(B){if(this.hasActiveFx()&&!B.concurrent){if(B.stopFx){this.stopFx();return k}return t}return k},hasFxBlock:function(){var B=c(this.dom.id);return B&&B[0]&&B[0].block},queueFx:function(E,B){var C=p(this.dom);if(!C.hasFxBlock()){Ext.applyIf(E,C.fxDefaults);if(!E.concurrent){var D=C.beforeFx(E);B.block=E.block;c(C.dom.id).push(B);if(D){C.nextFx()}}else{B.call(C)}}return C},fxWrap:function(H,F,D){var E=this.dom,C,B;if(!F.wrap||!(C=Ext.getDom(F.wrap))){if(F.fixPosition){B=p(E).getXY()}var G=document.createElement("div");G.style.visibility=D;C=E.parentNode.insertBefore(G,E);p(C).setPositioning(H);if(p(C).isStyle(o,"static")){p(C).position("relative")}p(E).clearPositioning("auto");p(C).clip();C.appendChild(E);if(B){p(C).setXY(B)}}return C},fxUnwrap:function(C,F,E){var D=this.dom;p(D).clearPositioning();p(D).setPositioning(F);if(!E.wrap){var B=p(C).dom.parentNode;B.insertBefore(D,C);p(C).remove()}},getFxRestore:function(){var B=this.dom.style;return{pos:this.getPositioning(),width:B.width,height:B.height}},afterFx:function(C){var B=this.dom,D=B.id;if(C.afterStyle){p(B).setStyle(C.afterStyle)}if(C.afterCls){p(B).addClass(C.afterCls)}if(C.remove==k){p(B).remove()}if(C.callback){C.callback.call(C.scope,p(B))}if(!C.concurrent){c(D).shift();p(B).nextFx()}},fxanim:function(E,F,C,G,D,B){C=C||"run";F=F||{};var H=Ext.lib.Anim[C](this.dom,E,(F.duration||G)||0.35,(F.easing||D)||r,B,this);F.anim=H;return H}};Ext.Fx.resize=Ext.Fx.scale;Ext.Element.addMethods(Ext.Fx)})();Ext.CompositeElementLite=function(b,a){this.elements=[];this.add(b,a);this.el=new Ext.Element.Flyweight()};Ext.CompositeElementLite.prototype={isComposite:true,getElement:function(a){var b=this.el;b.dom=a;b.id=a.id;return b},transformElement:function(a){return Ext.getDom(a)},getCount:function(){return this.elements.length},add:function(d,b){var e=this,g=e.elements;if(!d){return this}if(typeof d=="string"){d=Ext.Element.selectorFunction(d,b)}else{if(d.isComposite){d=d.elements}else{if(!Ext.isIterable(d)){d=[d]}}}for(var c=0,a=d.length;c<a;++c){g.push(e.transformElement(d[c]))}return e},invoke:function(g,b){var h=this,d=h.elements,a=d.length,j,c;for(c=0;c<a;c++){j=d[c];if(j){Ext.Element.prototype[g].apply(h.getElement(j),b)}}return h},item:function(b){var d=this,c=d.elements[b],a=null;if(c){a=d.getElement(c)}return a},addListener:function(b,j,h,g){var d=this.elements,a=d.length,c,k;for(c=0;c<a;c++){k=d[c];if(k){Ext.EventManager.on(k,b,j,h||k,g)}}return this},each:function(g,d){var h=this,c=h.elements,a=c.length,b,j;for(b=0;b<a;b++){j=c[b];if(j){j=this.getElement(j);if(g.call(d||j,j,h,b)===false){break}}}return h},fill:function(a){var b=this;b.elements=[];b.add(a);return b},filter:function(a){var b=[],d=this,c=Ext.isFunction(a)?a:function(e){return e.is(a)};d.each(function(h,e,g){if(c(h,g)!==false){b[b.length]=d.transformElement(h)}});d.elements=b;return d},indexOf:function(a){return this.elements.indexOf(this.transformElement(a))},replaceElement:function(e,c,a){var b=!isNaN(e)?e:this.indexOf(e),g;if(b>-1){c=Ext.getDom(c);if(a){g=this.elements[b];g.parentNode.insertBefore(c,g);Ext.removeNode(g)}this.elements.splice(b,1,c)}return this},clear:function(){this.elements=[]}};Ext.CompositeElementLite.prototype.on=Ext.CompositeElementLite.prototype.addListener;Ext.CompositeElementLite.importElementMethods=function(){var c,b=Ext.Element.prototype,a=Ext.CompositeElementLite.prototype;for(c in b){if(typeof b[c]=="function"){(function(d){a[d]=a[d]||function(){return this.invoke(d,arguments)}}).call(a,c)}}};Ext.CompositeElementLite.importElementMethods();if(Ext.DomQuery){Ext.Element.selectorFunction=Ext.DomQuery.select}Ext.Element.select=function(a,b){var c;if(typeof a=="string"){c=Ext.Element.selectorFunction(a,b)}else{if(a.length!==undefined){c=a}else{throw"Invalid selector"}}return new Ext.CompositeElementLite(c)};Ext.select=Ext.Element.select;(function(){var b="beforerequest",e="requestcomplete",d="requestexception",h=undefined,c="load",i="POST",a="GET",g=window;Ext.data.Connection=function(j){Ext.apply(this,j);this.addEvents(b,e,d);Ext.data.Connection.superclass.constructor.call(this)};Ext.extend(Ext.data.Connection,Ext.util.Observable,{timeout:30000,autoAbort:false,disableCaching:true,disableCachingParam:"_dc",request:function(n){var s=this;if(s.fireEvent(b,s,n)){if(n.el){if(!Ext.isEmpty(n.indicatorText)){s.indicatorText='<div class="loading-indicator">'+n.indicatorText+"</div>"}if(s.indicatorText){Ext.getDom(n.el).innerHTML=s.indicatorText}n.success=(Ext.isFunction(n.success)?n.success:function(){}).createInterceptor(function(o){Ext.getDom(n.el).innerHTML=o.responseText})}var l=n.params,k=n.url||s.url,j,q={success:s.handleResponse,failure:s.handleFailure,scope:s,argument:{options:n},timeout:Ext.num(n.timeout,s.timeout)},m,t;if(Ext.isFunction(l)){l=l.call(n.scope||g,n)}l=Ext.urlEncode(s.extraParams,Ext.isObject(l)?Ext.urlEncode(l):l);if(Ext.isFunction(k)){k=k.call(n.scope||g,n)}if((m=Ext.getDom(n.form))){k=k||m.action;if(n.isUpload||(/multipart\/form-data/i.test(m.getAttribute("enctype")))){return s.doFormUpload.call(s,n,l,k)}t=Ext.lib.Ajax.serializeForm(m);l=l?(l+"&"+t):t}j=n.method||s.method||((l||n.xmlData||n.jsonData)?i:a);if(j===a&&(s.disableCaching&&n.disableCaching!==false)||n.disableCaching===true){var r=n.disableCachingParam||s.disableCachingParam;k=Ext.urlAppend(k,r+"="+(new Date().getTime()))}n.headers=Ext.applyIf(n.headers||{},s.defaultHeaders||{});if(n.autoAbort===true||s.autoAbort){s.abort()}if((j==a||n.xmlData||n.jsonData)&&l){k=Ext.urlAppend(k,l);l=""}return(s.transId=Ext.lib.Ajax.request(j,k,q,l,n))}else{return n.callback?n.callback.apply(n.scope,[n,h,h]):null}},isLoading:function(j){return j?Ext.lib.Ajax.isCallInProgress(j):!!this.transId},abort:function(j){if(j||this.isLoading()){Ext.lib.Ajax.abort(j||this.transId)}},handleResponse:function(j){this.transId=false;var k=j.argument.options;j.argument=k?k.argument:null;this.fireEvent(e,this,j,k);if(k.success){k.success.call(k.scope,j,k)}if(k.callback){k.callback.call(k.scope,k,true,j)}},handleFailure:function(j,l){this.transId=false;var k=j.argument.options;j.argument=k?k.argument:null;this.fireEvent(d,this,j,k,l);if(k.failure){k.failure.call(k.scope,j,k)}if(k.callback){k.callback.call(k.scope,k,false,j)}},doFormUpload:function(q,j,k){var l=Ext.id(),v=document,r=v.createElement("iframe"),m=Ext.getDom(q.form),u=[],t,p="multipart/form-data",n={target:m.target,method:m.method,encoding:m.encoding,enctype:m.enctype,action:m.action};Ext.fly(r).set({id:l,name:l,cls:"x-hidden",src:Ext.SSL_SECURE_URL});v.body.appendChild(r);if(Ext.isIE){document.frames[l].name=l}Ext.fly(m).set({target:l,method:i,enctype:p,encoding:p,action:k||n.action});Ext.iterate(Ext.urlDecode(j,false),function(w,o){t=v.createElement("input");Ext.fly(t).set({type:"hidden",value:o,name:w});m.appendChild(t);u.push(t)});function s(){var x=this,w={responseText:"",responseXML:null,argument:q.argument},A,z;try{A=r.contentWindow.document||r.contentDocument||g.frames[l].document;if(A){if(A.body){if(/textarea/i.test((z=A.body.firstChild||{}).tagName)){w.responseText=z.value}else{w.responseText=A.body.innerHTML}}w.responseXML=A.XMLDocument||A}}catch(y){}Ext.EventManager.removeListener(r,c,s,x);x.fireEvent(e,x,w,q);function o(D,C,B){if(Ext.isFunction(D)){D.apply(C,B)}}o(q.success,q.scope,[w,q]);o(q.callback,q.scope,[q,true,w]);if(!x.debugUploads){setTimeout(function(){Ext.removeNode(r)},100)}}Ext.EventManager.on(r,c,s,this);m.submit();Ext.fly(m).set(n);Ext.each(u,function(o){Ext.removeNode(o)})}})})();Ext.Ajax=new Ext.data.Connection({autoAbort:false,serializeForm:function(a){return Ext.lib.Ajax.serializeForm(a)}});Ext.util.JSON=new (function(){var useHasOwn=!!{}.hasOwnProperty,isNative=function(){var useNative=null;return function(){if(useNative===null){useNative=Ext.USE_NATIVE_JSON&&window.JSON&&JSON.toString()=="[object JSON]"}return useNative}}(),pad=function(n){return n<10?"0"+n:n},doDecode=function(json){return json?eval("("+json+")"):""},doEncode=function(o){if(!Ext.isDefined(o)||o===null){return"null"}else{if(Ext.isArray(o)){return encodeArray(o)}else{if(Ext.isDate(o)){return Ext.util.JSON.encodeDate(o)}else{if(Ext.isString(o)){return encodeString(o)}else{if(typeof o=="number"){return isFinite(o)?String(o):"null"}else{if(Ext.isBoolean(o)){return String(o)}else{var a=["{"],b,i,v;for(i in o){if(!o.getElementsByTagName){if(!useHasOwn||o.hasOwnProperty(i)){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(doEncode(i),":",v===null?"null":doEncode(v));b=true}}}}a.push("}");return a.join("")}}}}}}},m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},encodeString=function(s){if(/["\\\x00-\x1f]/.test(s)){return'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+s+'"'},encodeArray=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i<l;i+=1){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(v===null?"null":Ext.util.JSON.encode(v));b=true}}a.push("]");return a.join("")};this.encodeDate=function(o){return'"'+o.getFullYear()+"-"+pad(o.getMonth()+1)+"-"+pad(o.getDate())+"T"+pad(o.getHours())+":"+pad(o.getMinutes())+":"+pad(o.getSeconds())+'"'};this.encode=function(){var ec;return function(o){if(!ec){ec=isNative()?JSON.stringify:doEncode}return ec(o)}}();this.decode=function(){var dc;return function(json){if(!dc){dc=isNative()?JSON.parse:doDecode}return dc(json)}}()})();Ext.encode=Ext.util.JSON.encode;Ext.decode=Ext.util.JSON.decode;Ext.EventManager=function(){var z,p,j=false,l=Ext.isGecko||Ext.isWebKit||Ext.isSafari,o=Ext.lib.Event,q=Ext.lib.Dom,c=document,A=window,r="DOMContentLoaded",t="complete",g=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,u=[];function n(E){var H=false,D=0,C=u.length,F=false,G;if(E){if(E.getElementById||E.navigator){for(;D<C;++D){G=u[D];if(G.el===E){H=G.id;break}}if(!H){H=Ext.id(E);u.push({id:H,el:E});F=true}}else{H=Ext.id(E)}if(!Ext.elCache[H]){Ext.Element.addToCache(new Ext.Element(E),H);if(F){Ext.elCache[H].skipGC=true}}}return H}function m(E,G,J,F,D,L){E=Ext.getDom(E);var C=n(E),K=Ext.elCache[C].events,H;H=o.on(E,G,D);K[G]=K[G]||[];K[G].push([J,D,L,H,F]);if(E.addEventListener&&G=="mousewheel"){var I=["DOMMouseScroll",D,false];E.addEventListener.apply(E,I);Ext.EventManager.addListener(A,"unload",function(){E.removeEventListener.apply(E,I)})}if(E==c&&G=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.addListener(D)}}function d(){if(window!=top){return false}try{c.documentElement.doScroll("left")}catch(C){return false}b();return true}function B(C){if(Ext.isIE&&d()){return true}if(c.readyState==t){b();return true}j||(p=setTimeout(arguments.callee,2));return false}var k;function i(C){k||(k=Ext.query("style, link[rel=stylesheet]"));if(k.length==c.styleSheets.length){b();return true}j||(p=setTimeout(arguments.callee,2));return false}function y(C){c.removeEventListener(r,arguments.callee,false);i()}function b(C){if(!j){j=true;if(p){clearTimeout(p)}if(l){c.removeEventListener(r,b,false)}if(Ext.isIE&&B.bindIE){c.detachEvent("onreadystatechange",B)}o.un(A,"load",arguments.callee)}if(z&&!Ext.isReady){Ext.isReady=true;z.fire();z.listeners=[]}}function a(){z||(z=new Ext.util.Event());if(l){c.addEventListener(r,b,false)}if(Ext.isIE){if(!B()){B.bindIE=true;c.attachEvent("onreadystatechange",B)}}else{if(Ext.isOpera){(c.readyState==t&&i())||c.addEventListener(r,y,false)}else{if(Ext.isWebKit){B()}}}o.on(A,"load",b)}function x(C,D){return function(){var E=Ext.toArray(arguments);if(D.target==Ext.EventObject.setEvent(E[0]).target){C.apply(this,E)}}}function w(D,E,C){return function(F){C.delay(E.buffer,D,null,[new Ext.EventObjectImpl(F)])}}function s(G,F,C,E,D){return function(H){Ext.EventManager.removeListener(F,C,E,D);G(H)}}function e(D,E,C){return function(G){var F=new Ext.util.DelayedTask(D);if(!C.tasks){C.tasks=[]}C.tasks.push(F);F.delay(E.delay||10,D,null,[new Ext.EventObjectImpl(G)])}}function h(H,G,C,J,K){var D=(!C||typeof C=="boolean")?{}:C,E=Ext.getDom(H),F;J=J||D.fn;K=K||D.scope;if(!E){throw'Error listening for "'+G+'". Element "'+H+"\" doesn't exist."}function I(M){if(!Ext){return}M=Ext.EventObject.setEvent(M);var L;if(D.delegate){if(!(L=M.getTarget(D.delegate,E))){return}}else{L=M.target}if(D.stopEvent){M.stopEvent()}if(D.preventDefault){M.preventDefault()}if(D.stopPropagation){M.stopPropagation()}if(D.normalized===false){M=M.browserEvent}J.call(K||E,M,L,D)}if(D.target){I=x(I,D)}if(D.delay){I=e(I,D,J)}if(D.single){I=s(I,E,G,J,K)}if(D.buffer){F=new Ext.util.DelayedTask(I);I=w(I,D,F)}m(E,G,J,F,I,K);return I}var v={addListener:function(E,C,G,F,D){if(typeof C=="object"){var J=C,H,I;for(H in J){I=J[H];if(!g.test(H)){if(Ext.isFunction(I)){h(E,H,J,I,J.scope)}else{h(E,H,I)}}}}else{h(E,C,D,G,F)}},removeListener:function(E,I,M,N){E=Ext.getDom(E);var C=n(E),K=E&&(Ext.elCache[C].events)[I]||[],D,H,F,G,J,L;for(H=0,J=K.length;H<J;H++){if(Ext.isArray(L=K[H])&&L[0]==M&&(!N||L[2]==N)){if(L[4]){L[4].cancel()}G=M.tasks&&M.tasks.length;if(G){while(G--){M.tasks[G].cancel()}delete M.tasks}D=L[1];o.un(E,I,o.extAdapter?L[3]:D);if(D&&E.addEventListener&&I=="mousewheel"){E.removeEventListener("DOMMouseScroll",D,false)}if(D&&E==c&&I=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.removeListener(D)}K.splice(H,1);if(K.length===0){delete Ext.elCache[C].events[I]}for(G in Ext.elCache[C].events){return false}Ext.elCache[C].events={};return false}}},removeAll:function(E){E=Ext.getDom(E);var D=n(E),J=Ext.elCache[D]||{},M=J.events||{},I,H,K,F,L,G,C;for(F in M){if(M.hasOwnProperty(F)){I=M[F];for(H=0,K=I.length;H<K;H++){L=I[H];if(L[4]){L[4].cancel()}if(L[0].tasks&&(G=L[0].tasks.length)){while(G--){L[0].tasks[G].cancel()}delete L.tasks}C=L[1];o.un(E,F,o.extAdapter?L[3]:C);if(E.addEventListener&&C&&F=="mousewheel"){E.removeEventListener("DOMMouseScroll",C,false)}if(C&&E==c&&F=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.removeListener(C)}}}}if(Ext.elCache[D]){Ext.elCache[D].events={}}},getListeners:function(F,C){F=Ext.getDom(F);var H=n(F),D=Ext.elCache[H]||{},G=D.events||{},E=[];if(G&&G[C]){return G[C]}else{return null}},purgeElement:function(E,C,G){E=Ext.getDom(E);var D=n(E),J=Ext.elCache[D]||{},K=J.events||{},F,I,H;if(G){if(K&&K.hasOwnProperty(G)){I=K[G];for(F=0,H=I.length;F<H;F++){Ext.EventManager.removeListener(E,G,I[F][0])}}}else{Ext.EventManager.removeAll(E)}if(C&&E&&E.childNodes){for(F=0,H=E.childNodes.length;F<H;F++){Ext.EventManager.purgeElement(E.childNodes[F],C,G)}}},_unload:function(){var C;for(C in Ext.elCache){Ext.EventManager.removeAll(C)}delete Ext.elCache;delete Ext.Element._flyweights;var G,D,F,E=Ext.lib.Ajax;(typeof E.conn=="object")?D=E.conn:D={};for(F in D){G=D[F];if(G){E.abort({conn:G,tId:F})}}},onDocumentReady:function(E,D,C){if(Ext.isReady){z||(z=new Ext.util.Event());z.addListener(E,D,C);z.fire();z.listeners=[]}else{if(!z){a()}C=C||{};C.delay=C.delay||1;z.addListener(E,D,C)}},fireDocReady:b};v.on=v.addListener;v.un=v.removeListener;v.stoppedMouseDownEvent=new Ext.util.Event();return v}();Ext.onReady=Ext.EventManager.onDocumentReady;(function(){var a=function(){var c=document.body||document.getElementsByTagName("body")[0];if(!c){return false}var b=[" ",Ext.isIE?"ext-ie "+(Ext.isIE6?"ext-ie6":(Ext.isIE7?"ext-ie7":(Ext.isIE8?"ext-ie8":"ext-ie9"))):Ext.isGecko?"ext-gecko "+(Ext.isGecko2?"ext-gecko2":"ext-gecko3"):Ext.isOpera?"ext-opera":Ext.isWebKit?"ext-webkit":""];if(Ext.isSafari){b.push("ext-safari "+(Ext.isSafari2?"ext-safari2":(Ext.isSafari3?"ext-safari3":"ext-safari4")))}else{if(Ext.isChrome){b.push("ext-chrome")}}if(Ext.isMac){b.push("ext-mac")}if(Ext.isLinux){b.push("ext-linux")}if(Ext.isStrict||Ext.isBorderBox){var d=c.parentNode;if(d){if(!Ext.isStrict){Ext.fly(d,"_internal").addClass("x-quirks");if(Ext.isIE&&!Ext.isStrict){Ext.isIEQuirks=true}}Ext.fly(d,"_internal").addClass(((Ext.isStrict&&Ext.isIE)||(!Ext.enableForcedBoxModel&&!Ext.isIE))?" ext-strict":" ext-border-box")}}if(Ext.enableForcedBoxModel&&!Ext.isIE){Ext.isForcedBorderBox=true;b.push("ext-forced-border-box")}Ext.fly(c,"_internal").addClass(b);return true};if(!a()){Ext.onReady(a)}})();(function(){var b=Ext.apply(Ext.supports,{correctRightMargin:true,correctTransparentColor:true,cssFloat:true});var a=function(){var g=document.createElement("div"),e=document,c,d;g.innerHTML='<div style="height:30px;width:50px;"><div style="height:20px;width:20px;"></div></div><div style="float:left;background-color:transparent;">';e.body.appendChild(g);d=g.lastChild;if((c=e.defaultView)){if(c.getComputedStyle(g.firstChild.firstChild,null).marginRight!="0px"){b.correctRightMargin=false}if(c.getComputedStyle(d,null).backgroundColor!="transparent"){b.correctTransparentColor=false}}b.cssFloat=!!d.style.cssFloat;e.body.removeChild(g)};if(Ext.isReady){a()}else{Ext.onReady(a)}})();Ext.EventObject=function(){var b=Ext.lib.Event,c=/(dbl)?click/,a={3:13,63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35},d=Ext.isIE?{1:0,4:1,2:2}:{0:0,1:1,2:2};Ext.EventObjectImpl=function(g){if(g){this.setEvent(g.browserEvent||g)}};Ext.EventObjectImpl.prototype={setEvent:function(h){var g=this;if(h==g||(h&&h.browserEvent)){return h}g.browserEvent=h;if(h){g.button=h.button?d[h.button]:(h.which?h.which-1:-1);if(c.test(h.type)&&g.button==-1){g.button=0}g.type=h.type;g.shiftKey=h.shiftKey;g.ctrlKey=h.ctrlKey||h.metaKey||false;g.altKey=h.altKey;g.keyCode=h.keyCode;g.charCode=h.charCode;g.target=b.getTarget(h);g.xy=b.getXY(h)}else{g.button=-1;g.shiftKey=false;g.ctrlKey=false;g.altKey=false;g.keyCode=0;g.charCode=0;g.target=null;g.xy=[0,0]}return g},stopEvent:function(){var e=this;if(e.browserEvent){if(e.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(e)}b.stopEvent(e.browserEvent)}},preventDefault:function(){if(this.browserEvent){b.preventDefault(this.browserEvent)}},stopPropagation:function(){var e=this;if(e.browserEvent){if(e.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(e)}b.stopPropagation(e.browserEvent)}},getCharCode:function(){return this.charCode||this.keyCode},getKey:function(){return this.normalizeKey(this.keyCode||this.charCode)},normalizeKey:function(e){return Ext.isSafari?(a[e]||e):e},getPageX:function(){return this.xy[0]},getPageY:function(){return this.xy[1]},getXY:function(){return this.xy},getTarget:function(g,h,e){return g?Ext.fly(this.target).findParent(g,h,e):(e?Ext.get(this.target):this.target)},getRelatedTarget:function(){return this.browserEvent?b.getRelatedTarget(this.browserEvent):null},getWheelDelta:function(){var g=this.browserEvent;var h=0;if(g.wheelDelta){h=g.wheelDelta/120}else{if(g.detail){h=-g.detail/3}}return h},within:function(h,i,e){if(h){var g=this[i?"getRelatedTarget":"getTarget"]();return g&&((e?(g==Ext.getDom(h)):false)||Ext.fly(h).contains(g))}return false}};return new Ext.EventObjectImpl()}();Ext.Loader=Ext.apply({},{load:function(j,i,k,c){var k=k||this,g=document.getElementsByTagName("head")[0],b=document.createDocumentFragment(),a=j.length,h=0,e=this;var l=function(m){g.appendChild(e.buildScriptTag(j[m],d))};var d=function(){h++;if(a==h&&typeof i=="function"){i.call(k)}else{if(c===true){l(h)}}};if(c===true){l.call(this,0)}else{Ext.each(j,function(n,m){b.appendChild(this.buildScriptTag(n,d))},this);g.appendChild(b)}},buildScriptTag:function(b,c){var a=document.createElement("script");a.type="text/javascript";a.src=b;if(a.readyState){a.onreadystatechange=function(){if(a.readyState=="loaded"||a.readyState=="complete"){a.onreadystatechange=null;c()}}}else{a.onload=c}return a}});Ext.ns("Ext.grid","Ext.list","Ext.dd","Ext.tree","Ext.form","Ext.menu","Ext.state","Ext.layout.boxOverflow","Ext.app","Ext.ux","Ext.chart","Ext.direct","Ext.slider");Ext.apply(Ext,function(){var c=Ext,a=0,b=null;return{emptyFn:function(){},BLANK_IMAGE_URL:Ext.isIE6||Ext.isIE7||Ext.isAir?"http://www.extjs.com/s.gif":"data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",extendX:function(d,e){return Ext.extend(d,e(d.prototype))},getDoc:function(){return Ext.get(document)},num:function(e,d){e=Number(Ext.isEmpty(e)||Ext.isArray(e)||typeof e=="boolean"||(typeof e=="string"&&e.trim().length==0)?NaN:e);return isNaN(e)?d:e},value:function(g,d,e){return Ext.isEmpty(g,e)?d:g},escapeRe:function(d){return d.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},sequence:function(h,d,g,e){h[d]=h[d].createSequence(g,e)},addBehaviors:function(i){if(!Ext.isReady){Ext.onReady(function(){Ext.addBehaviors(i)})}else{var e={},h,d,g;for(d in i){if((h=d.split("@"))[1]){g=h[0];if(!e[g]){e[g]=Ext.select(g)}e[g].on(h[1],i[d])}}e=null}},getScrollBarWidth:function(g){if(!Ext.isReady){return 0}if(g===true||b===null){var i=Ext.getBody().createChild('<div class="x-hide-offsets" style="width:100px;height:50px;overflow:hidden;"><div style="height:200px;"></div></div>'),h=i.child("div",true);var e=h.offsetWidth;i.setStyle("overflow",(Ext.isWebKit||Ext.isGecko)?"auto":"scroll");var d=h.offsetWidth;i.remove();b=e-d+2}return b},combine:function(){var g=arguments,e=g.length,j=[];for(var h=0;h<e;h++){var d=g[h];if(Ext.isArray(d)){j=j.concat(d)}else{if(d.length!==undefined&&!d.substr){j=j.concat(Array.prototype.slice.call(d,0))}else{j.push(d)}}}return j},copyTo:function(d,e,g){if(typeof g=="string"){g=g.split(/[,;\s]/)}Ext.each(g,function(h){if(e.hasOwnProperty(h)){d[h]=e[h]}},this);return d},destroy:function(){Ext.each(arguments,function(d){if(d){if(Ext.isArray(d)){this.destroy.apply(this,d)}else{if(typeof d.destroy=="function"){d.destroy()}else{if(d.dom){d.remove()}}}}},this)},destroyMembers:function(l,j,g,h){for(var k=1,e=arguments,d=e.length;k<d;k++){Ext.destroy(l[e[k]]);delete l[e[k]]}},clean:function(d){var e=[];Ext.each(d,function(g){if(!!g){e.push(g)}});return e},unique:function(d){var e=[],g={};Ext.each(d,function(h){if(!g[h]){e.push(h)}g[h]=true});return e},flatten:function(d){var g=[];function e(h){Ext.each(h,function(i){if(Ext.isArray(i)){e(i)}else{g.push(i)}});return g}return e(d)},min:function(d,e){var g=d[0];e=e||function(i,h){return i<h?-1:1};Ext.each(d,function(h){g=e(g,h)==-1?g:h});return g},max:function(d,e){var g=d[0];e=e||function(i,h){return i>h?1:-1};Ext.each(d,function(h){g=e(g,h)==1?g:h});return g},mean:function(d){return d.length>0?Ext.sum(d)/d.length:undefined},sum:function(d){var e=0;Ext.each(d,function(g){e+=g});return e},partition:function(d,e){var g=[[],[]];Ext.each(d,function(j,k,h){g[(e&&e(j,k,h))||(!e&&j)?0:1].push(j)});return g},invoke:function(d,e){var h=[],g=Array.prototype.slice.call(arguments,2);Ext.each(d,function(j,k){if(j&&typeof j[e]=="function"){h.push(j[e].apply(j,g))}else{h.push(undefined)}});return h},pluck:function(d,g){var e=[];Ext.each(d,function(h){e.push(h[g])});return e},zip:function(){var n=Ext.partition(arguments,function(i){return typeof i!="function"}),k=n[0],m=n[1][0],d=Ext.max(Ext.pluck(k,"length")),h=[];for(var l=0;l<d;l++){h[l]=[];if(m){h[l]=m.apply(m,Ext.pluck(k,l))}else{for(var g=0,e=k.length;g<e;g++){h[l].push(k[g][l])}}}return h},getCmp:function(d){return Ext.ComponentMgr.get(d)},useShims:c.isIE6||(c.isMac&&c.isGecko2),type:function(e){if(e===undefined||e===null){return false}if(e.htmlElement){return"element"}var d=typeof e;if(d=="object"&&e.nodeName){switch(e.nodeType){case 1:return"element";case 3:return(/\S/).test(e.nodeValue)?"textnode":"whitespace"}}if(d=="object"||d=="function"){switch(e.constructor){case Array:return"array";case RegExp:return"regexp";case Date:return"date"}if(typeof e.length=="number"&&typeof e.item=="function"){return"nodelist"}}return d},intercept:function(h,d,g,e){h[d]=h[d].createInterceptor(g,e)},callback:function(d,h,g,e){if(typeof d=="function"){if(e){d.defer(e,h,g||[])}else{d.apply(h,g||[])}}}}}());Ext.apply(Function.prototype,{createSequence:function(b,a){var c=this;return(typeof b!="function")?this:function(){var d=c.apply(this||window,arguments);b.apply(a||this||window,arguments);return d}}});Ext.applyIf(String,{escape:function(a){return a.replace(/('|\\)/g,"\\$1")},leftPad:function(d,b,c){var a=String(d);if(!c){c=" "}while(a.length<b){a=c+a}return a}});String.prototype.toggle=function(b,a){return this==b?a:b};String.prototype.trim=function(){var a=/^\s+|\s+$/g;return function(){return this.replace(a,"")}}();Date.prototype.getElapsed=function(a){return Math.abs((a||new Date()).getTime()-this.getTime())};Ext.applyIf(Number.prototype,{constrain:function(b,a){return Math.min(Math.max(this,b),a)}});Ext.lib.Dom.getRegion=function(a){return Ext.lib.Region.getRegion(a)};Ext.lib.Region=function(d,g,a,c){var e=this;e.top=d;e[1]=d;e.right=g;e.bottom=a;e.left=c;e[0]=c};Ext.lib.Region.prototype={contains:function(b){var a=this;return(b.left>=a.left&&b.right<=a.right&&b.top>=a.top&&b.bottom<=a.bottom)},getArea:function(){var a=this;return((a.bottom-a.top)*(a.right-a.left))},intersect:function(h){var g=this,d=Math.max(g.top,h.top),e=Math.min(g.right,h.right),a=Math.min(g.bottom,h.bottom),c=Math.max(g.left,h.left);if(a>=d&&e>=c){return new Ext.lib.Region(d,e,a,c)}},union:function(h){var g=this,d=Math.min(g.top,h.top),e=Math.max(g.right,h.right),a=Math.max(g.bottom,h.bottom),c=Math.min(g.left,h.left);return new Ext.lib.Region(d,e,a,c)},constrainTo:function(b){var a=this;a.top=a.top.constrain(b.top,b.bottom);a.bottom=a.bottom.constrain(b.top,b.bottom);a.left=a.left.constrain(b.left,b.right);a.right=a.right.constrain(b.left,b.right);return a},adjust:function(d,c,a,g){var e=this;e.top+=d;e.left+=c;e.right+=g;e.bottom+=a;return e}};Ext.lib.Region.getRegion=function(e){var h=Ext.lib.Dom.getXY(e),d=h[1],g=h[0]+e.offsetWidth,a=h[1]+e.offsetHeight,c=h[0];return new Ext.lib.Region(d,g,a,c)};Ext.lib.Point=function(a,c){if(Ext.isArray(a)){c=a[1];a=a[0]}var b=this;b.x=b.right=b.left=b[0]=a;b.y=b.top=b.bottom=b[1]=c};Ext.lib.Point.prototype=new Ext.lib.Region();Ext.apply(Ext.DomHelper,function(){var e,a="afterbegin",h="afterend",i="beforebegin",d="beforeend",b=/tag|children|cn|html$/i;function g(m,p,n,q,l,j){m=Ext.getDom(m);var k;if(e.useDom){k=c(p,null);if(j){m.appendChild(k)}else{(l=="firstChild"?m:m.parentNode).insertBefore(k,m[l]||m)}}else{k=Ext.DomHelper.insertHtml(q,m,Ext.DomHelper.createHtml(p))}return n?Ext.get(k,true):k}function c(j,r){var k,u=document,p,s,m,t;if(Ext.isArray(j)){k=u.createDocumentFragment();for(var q=0,n=j.length;q<n;q++){c(j[q],k)}}else{if(typeof j=="string"){k=u.createTextNode(j)}else{k=u.createElement(j.tag||"div");p=!!k.setAttribute;for(var s in j){if(!b.test(s)){m=j[s];if(s=="cls"){k.className=m}else{if(p){k.setAttribute(s,m)}else{k[s]=m}}}}Ext.DomHelper.applyStyles(k,j.style);if((t=j.children||j.cn)){c(t,k)}else{if(j.html){k.innerHTML=j.html}}}}if(r){r.appendChild(k)}return k}e={createTemplate:function(k){var j=Ext.DomHelper.createHtml(k);return new Ext.Template(j)},useDom:false,insertBefore:function(j,l,k){return g(j,l,k,i)},insertAfter:function(j,l,k){return g(j,l,k,h,"nextSibling")},insertFirst:function(j,l,k){return g(j,l,k,a,"firstChild")},append:function(j,l,k){return g(j,l,k,d,"",true)},createDom:c};return e}());Ext.apply(Ext.Template.prototype,{disableFormats:false,re:/\{([\w\-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,argsRe:/^\s*['"](.*)["']\s*$/,compileARe:/\\/g,compileBRe:/(\r\n|\n)/g,compileCRe:/'/g,applyTemplate:function(b){var g=this,a=g.disableFormats!==true,e=Ext.util.Format,c=g;if(g.compiled){return g.compiled(b)}function d(j,l,p,k){if(p&&a){if(p.substr(0,5)=="this."){return c.call(p.substr(5),b[l],b)}else{if(k){var o=g.argsRe;k=k.split(",");for(var n=0,h=k.length;n<h;n++){k[n]=k[n].replace(o,"$1")}k=[b[l]].concat(k)}else{k=[b[l]]}return e[p].apply(e,k)}}else{return b[l]!==undefined?b[l]:""}}return g.html.replace(g.re,d)},compile:function(){var me=this,fm=Ext.util.Format,useF=me.disableFormats!==true,sep=Ext.isGecko?"+":",",body;function fn(m,name,format,args){if(format&&useF){args=args?","+args:"";if(format.substr(0,5)!="this."){format="fm."+format+"("}else{format='this.call("'+format.substr(5)+'", ';args=", values"}}else{args="";format="(values['"+name+"'] == undefined ? '' : "}return"'"+sep+format+"values['"+name+"']"+args+")"+sep+"'"}if(Ext.isGecko){body="this.compiled = function(values){ return '"+me.html.replace(me.compileARe,"\\\\").replace(me.compileBRe,"\\n").replace(me.compileCRe,"\\'").replace(me.re,fn)+"';};"}else{body=["this.compiled = function(values){ return ['"];body.push(me.html.replace(me.compileARe,"\\\\").replace(me.compileBRe,"\\n").replace(me.compileCRe,"\\'").replace(me.re,fn));body.push("'].join('');};");body=body.join("")}eval(body);return me},call:function(c,b,a){return this[c](b,a)}});Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;Ext.util.Functions={createInterceptor:function(c,b,a){var d=c;if(!Ext.isFunction(b)){return c}else{return function(){var g=this,e=arguments;b.target=g;b.method=c;return(b.apply(a||g||window,e)!==false)?c.apply(g||window,e):null}}},createDelegate:function(c,d,b,a){if(!Ext.isFunction(c)){return c}return function(){var g=b||arguments;if(a===true){g=Array.prototype.slice.call(arguments,0);g=g.concat(b)}else{if(Ext.isNumber(a)){g=Array.prototype.slice.call(arguments,0);var e=[a,0].concat(b);Array.prototype.splice.apply(g,e)}}return c.apply(d||window,g)}},defer:function(d,c,e,b,a){d=Ext.util.Functions.createDelegate(d,e,b,a);if(c>0){return setTimeout(d,c)}d();return 0},createSequence:function(c,b,a){if(!Ext.isFunction(b)){return c}else{return function(){var d=c.apply(this||window,arguments);b.apply(a||this||window,arguments);return d}}}};Ext.defer=Ext.util.Functions.defer;Ext.createInterceptor=Ext.util.Functions.createInterceptor;Ext.createSequence=Ext.util.Functions.createSequence;Ext.createDelegate=Ext.util.Functions.createDelegate;Ext.apply(Ext.util.Observable.prototype,function(){function a(j){var i=(this.methodEvents=this.methodEvents||{})[j],d,c,g,h=this;if(!i){this.methodEvents[j]=i={};i.originalFn=this[j];i.methodName=j;i.before=[];i.after=[];var b=function(l,k,e){if((c=l.apply(k||h,e))!==undefined){if(typeof c=="object"){if(c.returnValue!==undefined){d=c.returnValue}else{d=c}g=!!c.cancel}else{if(c===false){g=true}else{d=c}}}};this[j]=function(){var l=Array.prototype.slice.call(arguments,0),k;d=c=undefined;g=false;for(var m=0,e=i.before.length;m<e;m++){k=i.before[m];b(k.fn,k.scope,l);if(g){return d}}if((c=i.originalFn.apply(h,l))!==undefined){d=c}for(var m=0,e=i.after.length;m<e;m++){k=i.after[m];b(k.fn,k.scope,l);if(g){return d}}return d}}return i}return{beforeMethod:function(d,c,b){a.call(this,d).before.push({fn:c,scope:b})},afterMethod:function(d,c,b){a.call(this,d).after.push({fn:c,scope:b})},removeMethodListener:function(j,g,d){var h=this.getMethodEvent(j);for(var c=0,b=h.before.length;c<b;c++){if(h.before[c].fn==g&&h.before[c].scope==d){h.before.splice(c,1);return}}for(var c=0,b=h.after.length;c<b;c++){if(h.after[c].fn==g&&h.after[c].scope==d){h.after.splice(c,1);return}}},relayEvents:function(j,e){var h=this;function g(i){return function(){return h.fireEvent.apply(h,[i].concat(Array.prototype.slice.call(arguments,0)))}}for(var d=0,b=e.length;d<b;d++){var c=e[d];h.events[c]=h.events[c]||true;j.on(c,g(c),h)}},enableBubble:function(e){var g=this;if(!Ext.isEmpty(e)){e=Ext.isArray(e)?e:Array.prototype.slice.call(arguments,0);for(var d=0,b=e.length;d<b;d++){var c=e[d];c=c.toLowerCase();var h=g.events[c]||true;if(typeof h=="boolean"){h=new Ext.util.Event(g,c);g.events[c]=h}h.bubble=true}}}}}());Ext.util.Observable.capture=function(c,b,a){c.fireEvent=c.fireEvent.createInterceptor(b,a)};Ext.util.Observable.observeClass=function(b,a){if(b){if(!b.fireEvent){Ext.apply(b,new Ext.util.Observable());Ext.util.Observable.capture(b.prototype,b.fireEvent,b)}if(typeof a=="object"){b.on(a)}return b}};Ext.apply(Ext.EventManager,function(){var d,k,g,b,a=Ext.lib.Dom,j=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,c=Ext.EventManager._unload,i=0,h=0,e=Ext.isWebKit?Ext.num(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1])>=525:!((Ext.isGecko&&!Ext.isWindows)||Ext.isOpera);return{_unload:function(){Ext.EventManager.un(window,"resize",this.fireWindowResize,this);c.call(Ext.EventManager)},doResizeEvent:function(){var m=a.getViewHeight(),l=a.getViewWidth();if(h!=m||i!=l){d.fire(i=l,h=m)}},onWindowResize:function(n,m,l){if(!d){d=new Ext.util.Event();k=new Ext.util.DelayedTask(this.doResizeEvent);Ext.EventManager.on(window,"resize",this.fireWindowResize,this)}d.addListener(n,m,l)},fireWindowResize:function(){if(d){k.delay(100)}},onTextResize:function(o,n,l){if(!g){g=new Ext.util.Event();var m=new Ext.Element(document.createElement("div"));m.dom.className="x-text-resize";m.dom.innerHTML="X";m.appendTo(document.body);b=m.dom.offsetHeight;setInterval(function(){if(m.dom.offsetHeight!=b){g.fire(b,b=m.dom.offsetHeight)}},this.textResizeInterval)}g.addListener(o,n,l)},removeResizeListener:function(m,l){if(d){d.removeListener(m,l)}},fireResize:function(){if(d){d.fire(a.getViewWidth(),a.getViewHeight())}},textResizeInterval:50,ieDeferSrc:false,getKeyEvent:function(){return e?"keydown":"keypress"},useKeydown:e}}());Ext.EventManager.on=Ext.EventManager.addListener;Ext.apply(Ext.EventObjectImpl.prototype,{BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,RETURN:13,SHIFT:16,CTRL:17,CONTROL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGEUP:33,PAGE_DOWN:34,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,isNavKeyPress:function(){var b=this,a=this.normalizeKey(b.keyCode);return(a>=33&&a<=40)||a==b.RETURN||a==b.TAB||a==b.ESC},isSpecialKey:function(){var a=this.normalizeKey(this.keyCode);return(this.type=="keypress"&&this.ctrlKey)||this.isNavKeyPress()||(a==this.BACKSPACE)||(a>=16&&a<=20)||(a>=44&&a<=46)},getPoint:function(){return new Ext.lib.Point(this.xy[0],this.xy[1])},hasModifier:function(){return((this.ctrlKey||this.altKey)||this.shiftKey)}});Ext.Element.addMethods({swallowEvent:function(a,b){var d=this;function c(g){g.stopPropagation();if(b){g.preventDefault()}}if(Ext.isArray(a)){Ext.each(a,function(g){d.on(g,c)});return d}d.on(a,c);return d},relayEvent:function(a,b){this.on(a,function(c){b.fireEvent(a,c)})},clean:function(b){var d=this,e=d.dom,g=e.firstChild,c=-1;if(Ext.Element.data(e,"isCleaned")&&b!==true){return d}while(g){var a=g.nextSibling;if(g.nodeType==3&&!(/\S/.test(g.nodeValue))){e.removeChild(g)}else{g.nodeIndex=++c}g=a}Ext.Element.data(e,"isCleaned",true);return d},load:function(){var a=this.getUpdater();a.update.apply(a,arguments);return this},getUpdater:function(){return this.updateManager||(this.updateManager=new Ext.Updater(this))},update:function(html,loadScripts,callback){if(!this.dom){return this}html=html||"";if(loadScripts!==true){this.dom.innerHTML=html;if(typeof callback=="function"){callback()}return this}var id=Ext.id(),dom=this.dom;html+='<span id="'+id+'"></span>';Ext.lib.Event.onAvailable(id,function(){var DOC=document,hd=DOC.getElementsByTagName("head")[0],re=/(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,srcRe=/\ssrc=([\'\"])(.*?)\1/i,typeRe=/\stype=([\'\"])(.*?)\1/i,match,attrs,srcMatch,typeMatch,el,s;while((match=re.exec(html))){attrs=match[1];srcMatch=attrs?attrs.match(srcRe):false;if(srcMatch&&srcMatch[2]){s=DOC.createElement("script");s.src=srcMatch[2];typeMatch=attrs.match(typeRe);if(typeMatch&&typeMatch[2]){s.type=typeMatch[2]}hd.appendChild(s)}else{if(match[2]&&match[2].length>0){if(window.execScript){window.execScript(match[2])}else{window.eval(match[2])}}}}el=DOC.getElementById(id);if(el){Ext.removeNode(el)}if(typeof callback=="function"){callback()}});dom.innerHTML=html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,"");return this},removeAllListeners:function(){this.removeAnchor();Ext.EventManager.removeAll(this.dom);return this},createProxy:function(a,e,d){a=(typeof a=="object")?a:{tag:"div",cls:a};var c=this,b=e?Ext.DomHelper.append(e,a,true):Ext.DomHelper.insertBefore(c.dom,a,true);if(d&&c.setBox&&c.getBox){b.setBox(c.getBox())}return b}});Ext.Element.prototype.getUpdateManager=Ext.Element.prototype.getUpdater;Ext.Element.addMethods({getAnchorXY:function(e,l,q){e=(e||"tl").toLowerCase();q=q||{};var k=this,b=k.dom==document.body||k.dom==document,n=q.width||b?Ext.lib.Dom.getViewWidth():k.getWidth(),i=q.height||b?Ext.lib.Dom.getViewHeight():k.getHeight(),p,a=Math.round,c=k.getXY(),m=k.getScroll(),j=b?m.left:!l?c[0]:0,g=b?m.top:!l?c[1]:0,d={c:[a(n*0.5),a(i*0.5)],t:[a(n*0.5),0],l:[0,a(i*0.5)],r:[n,a(i*0.5)],b:[a(n*0.5),i],tl:[0,0],bl:[0,i],br:[n,i],tr:[n,0]};p=d[e];return[p[0]+j,p[1]+g]},anchorTo:function(b,h,c,a,k,l){var i=this,e=i.dom,j=!Ext.isEmpty(k),d=function(){Ext.fly(e).alignTo(b,h,c,a);Ext.callback(l,Ext.fly(e))},g=this.getAnchor();this.removeAnchor();Ext.apply(g,{fn:d,scroll:j});Ext.EventManager.onWindowResize(d,null);if(j){Ext.EventManager.on(window,"scroll",d,null,{buffer:!isNaN(k)?k:50})}d.call(i);return i},removeAnchor:function(){var b=this,a=this.getAnchor();if(a&&a.fn){Ext.EventManager.removeResizeListener(a.fn);if(a.scroll){Ext.EventManager.un(window,"scroll",a.fn)}delete a.fn}return b},getAnchor:function(){var b=Ext.Element.data,c=this.dom;if(!c){return}var a=b(c,"_anchor");if(!a){a=b(c,"_anchor",{})}return a},getAlignToXY:function(g,A,B){g=Ext.get(g);if(!g||!g.dom){throw"Element.alignToXY with an element that doesn't exist"}B=B||[0,0];A=(!A||A=="?"?"tl-bl?":(!(/-/).test(A)&&A!==""?"tl-"+A:A||"tl-bl")).toLowerCase();var K=this,H=K.dom,M,L,n,l,s,F,v,t=Ext.lib.Dom.getViewWidth()-10,G=Ext.lib.Dom.getViewHeight()-10,b,i,j,k,u,z,N=document,J=N.documentElement,q=N.body,E=(J.scrollLeft||q.scrollLeft||0)+5,D=(J.scrollTop||q.scrollTop||0)+5,I=false,e="",a="",C=A.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!C){throw"Element.alignTo with an invalid alignment "+A}e=C[1];a=C[2];I=!!C[3];M=K.getAnchorXY(e,true);L=g.getAnchorXY(a,false);n=L[0]-M[0]+B[0];l=L[1]-M[1]+B[1];if(I){s=K.getWidth();F=K.getHeight();v=g.getRegion();b=e.charAt(0);i=e.charAt(e.length-1);j=a.charAt(0);k=a.charAt(a.length-1);u=((b=="t"&&j=="b")||(b=="b"&&j=="t"));z=((i=="r"&&k=="l")||(i=="l"&&k=="r"));if(n+s>t+E){n=z?v.left-s:t+E-s}if(n<E){n=z?v.right:E}if(l+F>G+D){l=u?v.top-F:G+D-F}if(l<D){l=u?v.bottom:D}}return[n,l]},alignTo:function(c,a,e,b){var d=this;return d.setXY(d.getAlignToXY(c,a,e),d.preanim&&!!b?d.preanim(arguments,3):false)},adjustForConstraints:function(c,a,b){return this.getConstrainToXY(a||document,false,b,c)||c},getConstrainToXY:function(b,a,c,e){var d={top:0,left:0,bottom:0,right:0};return function(i,A,l,n){i=Ext.get(i);l=l?Ext.applyIf(l,d):d;var z,D,v=0,u=0;if(i.dom==document.body||i.dom==document){z=Ext.lib.Dom.getViewWidth();D=Ext.lib.Dom.getViewHeight()}else{z=i.dom.clientWidth;D=i.dom.clientHeight;if(!A){var t=i.getXY();v=t[0];u=t[1]}}var r=i.getScroll();v+=l.left+r.left;u+=l.top+r.top;z-=l.right;D-=l.bottom;var B=v+z,g=u+D,j=n||(!A?this.getXY():[this.getLeft(true),this.getTop(true)]),p=j[0],o=j[1],k=this.getConstrainOffset(),q=this.dom.offsetWidth+k,C=this.dom.offsetHeight+k;var m=false;if((p+q)>B){p=B-q;m=true}if((o+C)>g){o=g-C;m=true}if(p<v){p=v;m=true}if(o<u){o=u;m=true}return m?[p,o]:false}}(),getConstrainOffset:function(){return 0},getCenterXY:function(){return this.getAlignToXY(document,"c-c")},center:function(a){return this.alignTo(a||document,"c-c")}});Ext.Element.addMethods({select:function(a,b){return Ext.Element.select(a,b,this.dom)}});Ext.apply(Ext.Element.prototype,function(){var c=Ext.getDom,a=Ext.get,b=Ext.DomHelper;return{insertSibling:function(i,g,h){var j=this,e,d=(g||"before").toLowerCase()=="after",k;if(Ext.isArray(i)){k=j;Ext.each(i,function(l){e=Ext.fly(k,"_internal").insertSibling(l,g,h);if(d){k=e}});return e}i=i||{};if(i.nodeType||i.dom){e=j.dom.parentNode.insertBefore(c(i),d?j.dom.nextSibling:j.dom);if(!h){e=a(e)}}else{if(d&&!j.dom.nextSibling){e=b.append(j.dom.parentNode,i,!h)}else{e=b[d?"insertAfter":"insertBefore"](j.dom,i,!h)}}return e}}}());Ext.Element.boxMarkup='<div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div><div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div><div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>';Ext.Element.addMethods(function(){var a="_internal",b=/(\d+\.?\d+)px/;return{applyStyles:function(c){Ext.DomHelper.applyStyles(this.dom,c);return this},getStyles:function(){var c={};Ext.each(arguments,function(d){c[d]=this.getStyle(d)},this);return c},setOverflow:function(c){var d=this.dom;if(c=="auto"&&Ext.isMac&&Ext.isGecko2){d.style.overflow="hidden";(function(){d.style.overflow="auto"}).defer(1)}else{d.style.overflow=c}},boxWrap:function(c){c=c||"x-box";var d=Ext.get(this.insertHtml("beforeBegin","<div class='"+c+"'>"+String.format(Ext.Element.boxMarkup,c)+"</div>"));Ext.DomQuery.selectNode("."+c+"-mc",d.dom).appendChild(this.dom);return d},setSize:function(e,c,d){var g=this;if(typeof e=="object"){c=e.height;e=e.width}e=g.adjustWidth(e);c=g.adjustHeight(c);if(!d||!g.anim){g.dom.style.width=g.addUnits(e);g.dom.style.height=g.addUnits(c)}else{g.anim({width:{to:e},height:{to:c}},g.preanim(arguments,2))}return g},getComputedHeight:function(){var d=this,c=Math.max(d.dom.offsetHeight,d.dom.clientHeight);if(!c){c=parseFloat(d.getStyle("height"))||0;if(!d.isBorderBox()){c+=d.getFrameWidth("tb")}}return c},getComputedWidth:function(){var c=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!c){c=parseFloat(this.getStyle("width"))||0;if(!this.isBorderBox()){c+=this.getFrameWidth("lr")}}return c},getFrameWidth:function(d,c){return c&&this.isBorderBox()?0:(this.getPadding(d)+this.getBorderWidth(d))},addClassOnOver:function(c){this.hover(function(){Ext.fly(this,a).addClass(c)},function(){Ext.fly(this,a).removeClass(c)});return this},addClassOnFocus:function(c){this.on("focus",function(){Ext.fly(this,a).addClass(c)},this.dom);this.on("blur",function(){Ext.fly(this,a).removeClass(c)},this.dom);return this},addClassOnClick:function(c){var d=this.dom;this.on("mousedown",function(){Ext.fly(d,a).addClass(c);var g=Ext.getDoc(),e=function(){Ext.fly(d,a).removeClass(c);g.removeListener("mouseup",e)};g.on("mouseup",e)});return this},getViewSize:function(){var g=document,h=this.dom,c=(h==g||h==g.body);if(c){var e=Ext.lib.Dom;return{width:e.getViewWidth(),height:e.getViewHeight()}}else{return{width:h.clientWidth,height:h.clientHeight}}},getStyleSize:function(){var j=this,c,i,l=document,m=this.dom,e=(m==l||m==l.body),g=m.style;if(e){var k=Ext.lib.Dom;return{width:k.getViewWidth(),height:k.getViewHeight()}}if(g.width&&g.width!="auto"){c=parseFloat(g.width);if(j.isBorderBox()){c-=j.getFrameWidth("lr")}}if(g.height&&g.height!="auto"){i=parseFloat(g.height);if(j.isBorderBox()){i-=j.getFrameWidth("tb")}}return{width:c||j.getWidth(true),height:i||j.getHeight(true)}},getSize:function(c){return{width:this.getWidth(c),height:this.getHeight(c)}},repaint:function(){var c=this.dom;this.addClass("x-repaint");setTimeout(function(){Ext.fly(c).removeClass("x-repaint")},1);return this},unselectable:function(){this.dom.unselectable="on";return this.swallowEvent("selectstart",true).applyStyles("-moz-user-select:none;-khtml-user-select:none;").addClass("x-unselectable")},getMargins:function(d){var e=this,c,g={t:"top",l:"left",r:"right",b:"bottom"},h={};if(!d){for(c in e.margins){h[g[c]]=parseFloat(e.getStyle(e.margins[c]))||0}return h}else{return e.addStyles.call(e,d,e.margins)}}}}());Ext.Element.addMethods({setBox:function(e,g,b){var d=this,a=e.width,c=e.height;if((g&&!d.autoBoxAdjust)&&!d.isBorderBox()){a-=(d.getBorderWidth("lr")+d.getPadding("lr"));c-=(d.getBorderWidth("tb")+d.getPadding("tb"))}d.setBounds(e.x,e.y,a,c,d.animTest.call(d,arguments,b,2));return d},getBox:function(j,p){var m=this,v,e,o,d=m.getBorderWidth,q=m.getPadding,g,a,u,n;if(!p){v=m.getXY()}else{e=parseInt(m.getStyle("left"),10)||0;o=parseInt(m.getStyle("top"),10)||0;v=[e,o]}var c=m.dom,s=c.offsetWidth,i=c.offsetHeight,k;if(!j){k={x:v[0],y:v[1],0:v[0],1:v[1],width:s,height:i}}else{g=d.call(m,"l")+q.call(m,"l");a=d.call(m,"r")+q.call(m,"r");u=d.call(m,"t")+q.call(m,"t");n=d.call(m,"b")+q.call(m,"b");k={x:v[0]+g,y:v[1]+u,0:v[0]+g,1:v[1]+u,width:s-(g+a),height:i-(u+n)}}k.right=k.x+k.width;k.bottom=k.y+k.height;return k},move:function(j,b,c){var g=this,m=g.getXY(),k=m[0],i=m[1],d=[k-b,i],l=[k+b,i],h=[k,i-b],a=[k,i+b],e={l:d,left:d,r:l,right:l,t:h,top:h,up:h,b:a,bottom:a,down:a};j=j.toLowerCase();g.moveTo(e[j][0],e[j][1],g.animTest.call(g,arguments,c,2))},setLeftTop:function(d,c){var b=this,a=b.dom.style;a.left=b.addUnits(d);a.top=b.addUnits(c);return b},getRegion:function(){return Ext.lib.Dom.getRegion(this.dom)},setBounds:function(b,g,d,a,c){var e=this;if(!c||!e.anim){e.setSize(d,a);e.setLocation(b,g)}else{e.anim({points:{to:[b,g]},width:{to:e.adjustWidth(d)},height:{to:e.adjustHeight(a)}},e.preanim(arguments,4),"motion")}return e},setRegion:function(b,a){return this.setBounds(b.left,b.top,b.right-b.left,b.bottom-b.top,this.animTest.call(this,arguments,a,1))}});Ext.Element.addMethods({scrollTo:function(b,d,a){var e=/top/i.test(b),c=this,g=c.dom,h;if(!a||!c.anim){h="scroll"+(e?"Top":"Left");g[h]=d}else{h="scroll"+(e?"Left":"Top");c.anim({scroll:{to:e?[g[h],d]:[d,g[h]]}},c.preanim(arguments,2),"scroll")}return c},scrollIntoView:function(e,i){var p=Ext.getDom(e)||Ext.getBody().dom,h=this.dom,g=this.getOffsetsTo(p),k=g[0]+p.scrollLeft,u=g[1]+p.scrollTop,q=u+h.offsetHeight,d=k+h.offsetWidth,a=p.clientHeight,m=parseInt(p.scrollTop,10),s=parseInt(p.scrollLeft,10),j=m+a,n=s+p.clientWidth;if(h.offsetHeight>a||u<m){p.scrollTop=u}else{if(q>j){p.scrollTop=q-a}}p.scrollTop=p.scrollTop;if(i!==false){if(h.offsetWidth>p.clientWidth||k<s){p.scrollLeft=k}else{if(d>n){p.scrollLeft=d-p.clientWidth}}p.scrollLeft=p.scrollLeft}return this},scrollChildIntoView:function(b,a){Ext.fly(b,"_scrollChildIntoView").scrollIntoView(this,a)},scroll:function(m,b,d){if(!this.isScrollable()){return false}var e=this.dom,g=e.scrollLeft,p=e.scrollTop,n=e.scrollWidth,k=e.scrollHeight,i=e.clientWidth,a=e.clientHeight,c=false,o,j={l:Math.min(g+b,n-i),r:o=Math.max(g-b,0),t:Math.max(p-b,0),b:Math.min(p+b,k-a)};j.d=j.b;j.u=j.t;m=m.substr(0,1);if((o=j[m])>-1){c=true;this.scrollTo(m=="l"||m=="r"?"left":"top",o,this.preanim(arguments,2))}return c}});Ext.Element.addMethods(function(){var d="visibility",b="display",a="hidden",h="none",c="x-masked",g="x-masked-relative",e=Ext.Element.data;return{isVisible:function(i){var j=!this.isStyle(d,a)&&!this.isStyle(b,h),k=this.dom.parentNode;if(i!==true||!j){return j}while(k&&!(/^body/i.test(k.tagName))){if(!Ext.fly(k,"_isVisible").isVisible()){return false}k=k.parentNode}return true},isDisplayed:function(){return !this.isStyle(b,h)},enableDisplayMode:function(i){this.setVisibilityMode(Ext.Element.DISPLAY);if(!Ext.isEmpty(i)){e(this.dom,"originalDisplay",i)}return this},mask:function(j,n){var p=this,l=p.dom,o=Ext.DomHelper,m="ext-el-mask-msg",i,q;if(!/^body/i.test(l.tagName)&&p.getStyle("position")=="static"){p.addClass(g)}if(i=e(l,"maskMsg")){i.remove()}if(i=e(l,"mask")){i.remove()}q=o.append(l,{cls:"ext-el-mask"},true);e(l,"mask",q);p.addClass(c);q.setDisplayed(true);if(typeof j=="string"){var k=o.append(l,{cls:m,cn:{tag:"div"}},true);e(l,"maskMsg",k);k.dom.className=n?m+" "+n:m;k.dom.firstChild.innerHTML=j;k.setDisplayed(true);k.center(p)}if(Ext.isIE&&!(Ext.isIE7&&Ext.isStrict)&&p.getStyle("height")=="auto"){q.setSize(undefined,p.getHeight())}return q},unmask:function(){var k=this,l=k.dom,i=e(l,"mask"),j=e(l,"maskMsg");if(i){if(j){j.remove();e(l,"maskMsg",undefined)}i.remove();e(l,"mask",undefined);k.removeClass([c,g])}},isMasked:function(){var i=e(this.dom,"mask");return i&&i.isVisible()},createShim:function(){var i=document.createElement("iframe"),j;i.frameBorder="0";i.className="ext-shim";i.src=Ext.SSL_SECURE_URL;j=Ext.get(this.dom.parentNode.insertBefore(i,this.dom));j.autoBoxAdjust=false;return j}}}());Ext.Element.addMethods({addKeyListener:function(b,d,c){var a;if(typeof b!="object"||Ext.isArray(b)){a={key:b,fn:d,scope:c}}else{a={key:b.key,shift:b.shift,ctrl:b.ctrl,alt:b.alt,fn:d,scope:c}}return new Ext.KeyMap(this,a)},addKeyMap:function(a){return new Ext.KeyMap(this,a)}});Ext.CompositeElementLite.importElementMethods();Ext.apply(Ext.CompositeElementLite.prototype,{addElements:function(c,a){if(!c){return this}if(typeof c=="string"){c=Ext.Element.selectorFunction(c,a)}var b=this.elements;Ext.each(c,function(d){b.push(Ext.get(d))});return this},first:function(){return this.item(0)},last:function(){return this.item(this.getCount()-1)},contains:function(a){return this.indexOf(a)!=-1},removeElement:function(d,e){var c=this,a=this.elements,b;Ext.each(d,function(g){if((b=(a[g]||a[g=c.indexOf(g)]))){if(e){if(b.dom){b.remove()}else{Ext.removeNode(b)}}a.splice(g,1)}});return this}});Ext.CompositeElement=Ext.extend(Ext.CompositeElementLite,{constructor:function(b,a){this.elements=[];this.add(b,a)},getElement:function(a){return a},transformElement:function(a){return Ext.get(a)}});Ext.Element.select=function(a,d,b){var c;if(typeof a=="string"){c=Ext.Element.selectorFunction(a,b)}else{if(a.length!==undefined){c=a}else{throw"Invalid selector"}}return(d===true)?new Ext.CompositeElement(c):new Ext.CompositeElementLite(c)};Ext.select=Ext.Element.select;Ext.UpdateManager=Ext.Updater=Ext.extend(Ext.util.Observable,function(){var b="beforeupdate",d="update",c="failure";function a(h){var i=this;i.transaction=null;if(h.argument.form&&h.argument.reset){try{h.argument.form.reset()}catch(j){}}if(i.loadScripts){i.renderer.render(i.el,h,i,g.createDelegate(i,[h]))}else{i.renderer.render(i.el,h,i);g.call(i,h)}}function g(h,i,j){this.fireEvent(i||d,this.el,h);if(Ext.isFunction(h.argument.callback)){h.argument.callback.call(h.argument.scope,this.el,Ext.isEmpty(j)?true:false,h,h.argument.options)}}function e(h){g.call(this,h,c,!!(this.transaction=null))}return{constructor:function(i,h){var j=this;i=Ext.get(i);if(!h&&i.updateManager){return i.updateManager}j.el=i;j.defaultUrl=null;j.addEvents(b,d,c);Ext.apply(j,Ext.Updater.defaults);j.transaction=null;j.refreshDelegate=j.refresh.createDelegate(j);j.updateDelegate=j.update.createDelegate(j);j.formUpdateDelegate=(j.formUpdate||function(){}).createDelegate(j);j.renderer=j.renderer||j.getDefaultRenderer();Ext.Updater.superclass.constructor.call(j)},setRenderer:function(h){this.renderer=h},getRenderer:function(){return this.renderer},getDefaultRenderer:function(){return new Ext.Updater.BasicRenderer()},setDefaultUrl:function(h){this.defaultUrl=h},getEl:function(){return this.el},update:function(i,n,p,l){var k=this,h,j;if(k.fireEvent(b,k.el,i,n)!==false){if(Ext.isObject(i)){h=i;i=h.url;n=n||h.params;p=p||h.callback;l=l||h.discardUrl;j=h.scope;if(!Ext.isEmpty(h.nocache)){k.disableCaching=h.nocache}if(!Ext.isEmpty(h.text)){k.indicatorText='<div class="loading-indicator">'+h.text+"</div>"}if(!Ext.isEmpty(h.scripts)){k.loadScripts=h.scripts}if(!Ext.isEmpty(h.timeout)){k.timeout=h.timeout}}k.showLoading();if(!l){k.defaultUrl=i}if(Ext.isFunction(i)){i=i.call(k)}var m=Ext.apply({},{url:i,params:(Ext.isFunction(n)&&j)?n.createDelegate(j):n,success:a,failure:e,scope:k,callback:undefined,timeout:(k.timeout*1000),disableCaching:k.disableCaching,argument:{options:h,url:i,form:null,callback:p,scope:j||window,params:n}},h);k.transaction=Ext.Ajax.request(m)}},formUpdate:function(k,h,j,l){var i=this;if(i.fireEvent(b,i.el,k,h)!==false){if(Ext.isFunction(h)){h=h.call(i)}k=Ext.getDom(k);i.transaction=Ext.Ajax.request({form:k,url:h,success:a,failure:e,scope:i,timeout:(i.timeout*1000),argument:{url:h,form:k,callback:l,reset:j}});i.showLoading.defer(1,i)}},startAutoRefresh:function(i,j,l,m,h){var k=this;if(h){k.update(j||k.defaultUrl,l,m,true)}if(k.autoRefreshProcId){clearInterval(k.autoRefreshProcId)}k.autoRefreshProcId=setInterval(k.update.createDelegate(k,[j||k.defaultUrl,l,m,true]),i*1000)},stopAutoRefresh:function(){if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);delete this.autoRefreshProcId}},isAutoRefreshing:function(){return !!this.autoRefreshProcId},showLoading:function(){if(this.showLoadIndicator){this.el.dom.innerHTML=this.indicatorText}},abort:function(){if(this.transaction){Ext.Ajax.abort(this.transaction)}},isUpdating:function(){return this.transaction?Ext.Ajax.isLoading(this.transaction):false},refresh:function(h){if(this.defaultUrl){this.update(this.defaultUrl,null,h,true)}}}}());Ext.Updater.defaults={timeout:30,disableCaching:false,showLoadIndicator:true,indicatorText:'<div class="loading-indicator">Loading...</div>',loadScripts:false,sslBlankUrl:Ext.SSL_SECURE_URL};Ext.Updater.updateElement=function(d,c,e,b){var a=Ext.get(d).getUpdater();Ext.apply(a,b);a.update(c,e,b?b.callback:null)};Ext.Updater.BasicRenderer=function(){};Ext.Updater.BasicRenderer.prototype={render:function(c,a,b,d){c.update(a.responseText,b.loadScripts,d)}};(function(){Date.useStrict=false;function b(d){var c=Array.prototype.slice.call(arguments,1);return d.replace(/\{(\d+)\}/g,function(e,g){return c[g]})}Date.formatCodeToRegex=function(d,c){var e=Date.parseCodes[d];if(e){e=typeof e=="function"?e():e;Date.parseCodes[d]=e}return e?Ext.applyIf({c:e.c?b(e.c,c||"{0}"):e.c},e):{g:0,c:null,s:Ext.escapeRe(d)}};var a=Date.formatCodeToRegex;Ext.apply(Date,{parseFunctions:{"M$":function(d,c){var e=new RegExp("\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/");var g=(d||"").match(e);return g?new Date(((g[1]||"")+g[2])*1):null}},parseRegexes:[],formatFunctions:{"M$":function(){return"\\/Date("+this.getTime()+")\\/"}},y2kYear:50,MILLI:"ms",SECOND:"s",MINUTE:"mi",HOUR:"h",DAY:"d",MONTH:"mo",YEAR:"y",defaults:{},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNumbers:{Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},getShortMonthName:function(c){return Date.monthNames[c].substring(0,3)},getShortDayName:function(c){return Date.dayNames[c].substring(0,3)},getMonthNumber:function(c){return Date.monthNumbers[c.substring(0,1).toUpperCase()+c.substring(1,3).toLowerCase()]},formatContainsHourInfo:(function(){var d=/(\\.)/g,c=/([gGhHisucUOPZ]|M\$)/;return function(e){return c.test(e.replace(d,""))}})(),formatCodes:{d:"String.leftPad(this.getDate(), 2, '0')",D:"Date.getShortDayName(this.getDay())",j:"this.getDate()",l:"Date.dayNames[this.getDay()]",N:"(this.getDay() ? this.getDay() : 7)",S:"this.getSuffix()",w:"this.getDay()",z:"this.getDayOfYear()",W:"String.leftPad(this.getWeekOfYear(), 2, '0')",F:"Date.monthNames[this.getMonth()]",m:"String.leftPad(this.getMonth() + 1, 2, '0')",M:"Date.getShortMonthName(this.getMonth())",n:"(this.getMonth() + 1)",t:"this.getDaysInMonth()",L:"(this.isLeapYear() ? 1 : 0)",o:"(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0)))",Y:"String.leftPad(this.getFullYear(), 4, '0')",y:"('' + this.getFullYear()).substring(2, 4)",a:"(this.getHours() < 12 ? 'am' : 'pm')",A:"(this.getHours() < 12 ? 'AM' : 'PM')",g:"((this.getHours() % 12) ? this.getHours() % 12 : 12)",G:"this.getHours()",h:"String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')",H:"String.leftPad(this.getHours(), 2, '0')",i:"String.leftPad(this.getMinutes(), 2, '0')",s:"String.leftPad(this.getSeconds(), 2, '0')",u:"String.leftPad(this.getMilliseconds(), 3, '0')",O:"this.getGMTOffset()",P:"this.getGMTOffset(true)",T:"this.getTimezone()",Z:"(this.getTimezoneOffset() * -60)",c:function(){for(var k="Y-m-dTH:i:sP",h=[],g=0,d=k.length;g<d;++g){var j=k.charAt(g);h.push(j=="T"?"'T'":Date.getFormatCode(j))}return h.join(" + ")},U:"Math.round(this.getTime() / 1000)"},isValid:function(o,c,n,k,g,j,e){k=k||0;g=g||0;j=j||0;e=e||0;var l=new Date(o<100?100:o,c-1,n,k,g,j,e).add(Date.YEAR,o<100?o-100:0);return o==l.getFullYear()&&c==l.getMonth()+1&&n==l.getDate()&&k==l.getHours()&&g==l.getMinutes()&&j==l.getSeconds()&&e==l.getMilliseconds()},parseDate:function(d,g,c){var e=Date.parseFunctions;if(e[g]==null){Date.createParser(g)}return e[g](d,Ext.isDefined(c)?c:Date.useStrict)},getFormatCode:function(d){var c=Date.formatCodes[d];if(c){c=typeof c=="function"?c():c;Date.formatCodes[d]=c}return c||("'"+String.escape(d)+"'")},createFormat:function(h){var g=[],c=false,e="";for(var d=0;d<h.length;++d){e=h.charAt(d);if(!c&&e=="\\"){c=true}else{if(c){c=false;g.push("'"+String.escape(e)+"'")}else{g.push(Date.getFormatCode(e))}}}Date.formatFunctions[h]=new Function("return "+g.join("+"))},createParser:function(){var c=["var dt, y, m, d, h, i, s, ms, o, z, zz, u, v,","def = Date.defaults,","results = String(input).match(Date.parseRegexes[{0}]);","if(results){","{1}","if(u != null){","v = new Date(u * 1000);","}else{","dt = (new Date()).clearTime();","y = Ext.num(y, Ext.num(def.y, dt.getFullYear()));","m = Ext.num(m, Ext.num(def.m - 1, dt.getMonth()));","d = Ext.num(d, Ext.num(def.d, dt.getDate()));","h = Ext.num(h, Ext.num(def.h, dt.getHours()));","i = Ext.num(i, Ext.num(def.i, dt.getMinutes()));","s = Ext.num(s, Ext.num(def.s, dt.getSeconds()));","ms = Ext.num(ms, Ext.num(def.ms, dt.getMilliseconds()));","if(z >= 0 && y >= 0){","v = new Date(y < 100 ? 100 : y, 0, 1, h, i, s, ms).add(Date.YEAR, y < 100 ? y - 100 : 0);","v = !strict? v : (strict === true && (z <= 364 || (v.isLeapYear() && z <= 365))? v.add(Date.DAY, z) : null);","}else if(strict === true && !Date.isValid(y, m + 1, d, h, i, s, ms)){","v = null;","}else{","v = new Date(y < 100 ? 100 : y, m, d, h, i, s, ms).add(Date.YEAR, y < 100 ? y - 100 : 0);","}","}","}","if(v){","if(zz != null){","v = v.add(Date.SECOND, -v.getTimezoneOffset() * 60 - zz);","}else if(o){","v = v.add(Date.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));","}","}","return v;"].join("\n");return function(m){var e=Date.parseRegexes.length,o=1,g=[],l=[],k=false,d="",j=0,h,n;for(;j<m.length;++j){d=m.charAt(j);if(!k&&d=="\\"){k=true}else{if(k){k=false;l.push(String.escape(d))}else{h=a(d,o);o+=h.g;l.push(h.s);if(h.g&&h.c){if(h.calcLast){n=h.c}else{g.push(h.c)}}}}}if(n){g.push(n)}Date.parseRegexes[e]=new RegExp("^"+l.join("")+"$","i");Date.parseFunctions[m]=new Function("input","strict",b(c,e,g.join("")))}}(),parseCodes:{d:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},j:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},D:function(){for(var c=[],d=0;d<7;c.push(Date.getShortDayName(d)),++d){}return{g:0,c:null,s:"(?:"+c.join("|")+")"}},l:function(){return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"}},N:{g:0,c:null,s:"[1-7]"},S:{g:0,c:null,s:"(?:st|nd|rd|th)"},w:{g:0,c:null,s:"[0-6]"},z:{g:1,c:"z = parseInt(results[{0}], 10);\n",s:"(\\d{1,3})"},W:{g:0,c:null,s:"(?:\\d{2})"},F:function(){return{g:1,c:"m = parseInt(Date.getMonthNumber(results[{0}]), 10);\n",s:"("+Date.monthNames.join("|")+")"}},M:function(){for(var c=[],d=0;d<12;c.push(Date.getShortMonthName(d)),++d){}return Ext.applyIf({s:"("+c.join("|")+")"},a("F"))},m:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{2})"},n:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{1,2})"},t:{g:0,c:null,s:"(?:\\d{2})"},L:{g:0,c:null,s:"(?:1|0)"},o:function(){return a("Y")},Y:{g:1,c:"y = parseInt(results[{0}], 10);\n",s:"(\\d{4})"},y:{g:1,c:"var ty = parseInt(results[{0}], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"},a:function(){return a("A")},A:{calcLast:true,g:1,c:"if (/(am)/i.test(results[{0}])) {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(AM|PM|am|pm)"},g:function(){return a("G")},G:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},h:function(){return a("H")},H:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},i:{g:1,c:"i = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},s:{g:1,c:"s = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},u:{g:1,c:"ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",s:"(\\d+)"},O:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),","mn = o.substring(3,5) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{4})"},P:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),","mn = o.substring(4,6) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{2}:\\d{2})"},T:{g:0,c:null,s:"[A-Z]{1,4}"},Z:{g:1,c:"zz = results[{0}] * 1;\nzz = (-43200 <= zz && zz <= 50400)? zz : null;\n",s:"([+-]?\\d{1,5})"},c:function(){var e=[],c=[a("Y",1),a("m",2),a("d",3),a("h",4),a("i",5),a("s",6),{c:"ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"},{c:["if(results[8]) {","if(results[8] == 'Z'){","zz = 0;","}else if (results[8].indexOf(':') > -1){",a("P",8).c,"}else{",a("O",8).c,"}","}"].join("\n")}];for(var g=0,d=c.length;g<d;++g){e.push(c[g].c)}return{g:1,c:e.join(""),s:[c[0].s,"(?:","-",c[1].s,"(?:","-",c[2].s,"(?:","(?:T| )?",c[3].s,":",c[4].s,"(?::",c[5].s,")?","(?:(?:\\.|,)(\\d+))?","(Z|(?:[-+]\\d{2}(?::)?\\d{2}))?",")?",")?",")?"].join("")}},U:{g:1,c:"u = parseInt(results[{0}], 10);\n",s:"(-?\\d+)"}}})}());Ext.apply(Date.prototype,{dateFormat:function(a){if(Date.formatFunctions[a]==null){Date.createFormat(a)}return Date.formatFunctions[a].call(this)},getTimezone:function(){return this.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/,"$1$2").replace(/[^A-Z]/g,"")},getGMTOffset:function(a){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+(a?":":"")+String.leftPad(Math.abs(this.getTimezoneOffset()%60),2,"0")},getDayOfYear:function(){var b=0,e=this.clone(),a=this.getMonth(),c;for(c=0,e.setDate(1),e.setMonth(0);c<a;e.setMonth(++c)){b+=e.getDaysInMonth()}return b+this.getDate()-1},getWeekOfYear:function(){var a=86400000,b=7*a;return function(){var d=Date.UTC(this.getFullYear(),this.getMonth(),this.getDate()+3)/a,c=Math.floor(d/7),e=new Date(c*b).getUTCFullYear();return c-Math.floor(Date.UTC(e,0,7)/b)+1}}(),isLeapYear:function(){var a=this.getFullYear();return !!((a&3)==0&&(a%100||(a%400==0&&a)))},getFirstDayOfMonth:function(){var a=(this.getDay()-(this.getDate()-1))%7;return(a<0)?(a+7):a},getLastDayOfMonth:function(){return this.getLastDateOfMonth().getDay()},getFirstDateOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),1)},getLastDateOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),this.getDaysInMonth())},getDaysInMonth:function(){var a=[31,28,31,30,31,30,31,31,30,31,30,31];return function(){var b=this.getMonth();return b==1&&this.isLeapYear()?29:a[b]}}(),getSuffix:function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}},clone:function(){return new Date(this.getTime())},isDST:function(){return new Date(this.getFullYear(),0,1).getTimezoneOffset()!=this.getTimezoneOffset()},clearTime:function(g){if(g){return this.clone().clearTime()}var b=this.getDate();this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);if(this.getDate()!=b){for(var a=1,e=this.add(Date.HOUR,a);e.getDate()!=b;a++,e=this.add(Date.HOUR,a)){}this.setDate(b);this.setHours(e.getHours())}return this},add:function(b,c){var e=this.clone();if(!b||c===0){return e}switch(b.toLowerCase()){case Date.MILLI:e.setMilliseconds(this.getMilliseconds()+c);break;case Date.SECOND:e.setSeconds(this.getSeconds()+c);break;case Date.MINUTE:e.setMinutes(this.getMinutes()+c);break;case Date.HOUR:e.setHours(this.getHours()+c);break;case Date.DAY:e.setDate(this.getDate()+c);break;case Date.MONTH:var a=this.getDate();if(a>28){a=Math.min(a,this.getFirstDateOfMonth().add("mo",c).getLastDateOfMonth().getDate())}e.setDate(a);e.setMonth(this.getMonth()+c);break;case Date.YEAR:e.setFullYear(this.getFullYear()+c);break}return e},between:function(c,a){var b=this.getTime();return c.getTime()<=b&&b<=a.getTime()}});Date.prototype.format=Date.prototype.dateFormat;if(Ext.isSafari&&(navigator.userAgent.match(/WebKit\/(\d+)/)[1]||NaN)<420){Ext.apply(Date.prototype,{_xMonth:Date.prototype.setMonth,_xDate:Date.prototype.setDate,setMonth:function(a){if(a<=-1){var d=Math.ceil(-a),c=Math.ceil(d/12),b=(d%12)?12-d%12:0;this.setFullYear(this.getFullYear()-c);return this._xMonth(b)}else{return this._xMonth(a)}},setDate:function(a){return this.setTime(this.getTime()-(this.getDate()-a)*86400000)}})}Ext.util.MixedCollection=function(b,a){this.items=[];this.map={};this.keys=[];this.length=0;this.addEvents("clear","add","replace","remove","sort");this.allowFunctions=b===true;if(a){this.getKey=a}Ext.util.MixedCollection.superclass.constructor.call(this)};Ext.extend(Ext.util.MixedCollection,Ext.util.Observable,{allowFunctions:false,add:function(b,c){if(arguments.length==1){c=arguments[0];b=this.getKey(c)}if(typeof b!="undefined"&&b!==null){var a=this.map[b];if(typeof a!="undefined"){return this.replace(b,c)}this.map[b]=c}this.length++;this.items.push(c);this.keys.push(b);this.fireEvent("add",this.length-1,c,b);return c},getKey:function(a){return a.id},replace:function(c,d){if(arguments.length==1){d=arguments[0];c=this.getKey(d)}var a=this.map[c];if(typeof c=="undefined"||c===null||typeof a=="undefined"){return this.add(c,d)}var b=this.indexOfKey(c);this.items[b]=d;this.map[c]=d;this.fireEvent("replace",c,a,d);return d},addAll:function(e){if(arguments.length>1||Ext.isArray(e)){var b=arguments.length>1?arguments:e;for(var d=0,a=b.length;d<a;d++){this.add(b[d])}}else{for(var c in e){if(this.allowFunctions||typeof e[c]!="function"){this.add(c,e[c])}}}},each:function(e,d){var b=[].concat(this.items);for(var c=0,a=b.length;c<a;c++){if(e.call(d||b[c],b[c],c,a)===false){break}}},eachKey:function(d,c){for(var b=0,a=this.keys.length;b<a;b++){d.call(c||window,this.keys[b],this.items[b],b,a)}},find:function(d,c){for(var b=0,a=this.items.length;b<a;b++){if(d.call(c||window,this.items[b],this.keys[b])){return this.items[b]}}return null},insert:function(a,b,c){if(arguments.length==2){c=arguments[1];b=this.getKey(c)}if(this.containsKey(b)){this.suspendEvents();this.removeKey(b);this.resumeEvents()}if(a>=this.length){return this.add(b,c)}this.length++;this.items.splice(a,0,c);if(typeof b!="undefined"&&b!==null){this.map[b]=c}this.keys.splice(a,0,b);this.fireEvent("add",a,c,b);return c},remove:function(a){return this.removeAt(this.indexOf(a))},removeAt:function(a){if(a<this.length&&a>=0){this.length--;var c=this.items[a];this.items.splice(a,1);var b=this.keys[a];if(typeof b!="undefined"){delete this.map[b]}this.keys.splice(a,1);this.fireEvent("remove",c,b);return c}return false},removeKey:function(a){return this.removeAt(this.indexOfKey(a))},getCount:function(){return this.length},indexOf:function(a){return this.items.indexOf(a)},indexOfKey:function(a){return this.keys.indexOf(a)},item:function(b){var a=this.map[b],c=a!==undefined?a:(typeof b=="number")?this.items[b]:undefined;return typeof c!="function"||this.allowFunctions?c:null},itemAt:function(a){return this.items[a]},key:function(a){return this.map[a]},contains:function(a){return this.indexOf(a)!=-1},containsKey:function(a){return typeof this.map[a]!="undefined"},clear:function(){this.length=0;this.items=[];this.keys=[];this.map={};this.fireEvent("clear")},first:function(){return this.items[0]},last:function(){return this.items[this.length-1]},_sort:function(k,a,j){var d,e,b=String(a).toUpperCase()=="DESC"?-1:1,h=[],l=this.keys,g=this.items;j=j||function(i,c){return i-c};for(d=0,e=g.length;d<e;d++){h[h.length]={key:l[d],value:g[d],index:d}}h.sort(function(i,c){var m=j(i[k],c[k])*b;if(m===0){m=(i.index<c.index?-1:1)}return m});for(d=0,e=h.length;d<e;d++){g[d]=h[d].value;l[d]=h[d].key}this.fireEvent("sort",this)},sort:function(a,b){this._sort("value",a,b)},reorder:function(d){this.suspendEvents();var b=this.items,c=0,g=b.length,a=[],e=[],h;for(h in d){a[d[h]]=b[h]}for(c=0;c<g;c++){if(d[c]==undefined){e.push(b[c])}}for(c=0;c<g;c++){if(a[c]==undefined){a[c]=e.shift()}}this.clear();this.addAll(a);this.resumeEvents();this.fireEvent("sort",this)},keySort:function(a,b){this._sort("key",a,b||function(d,c){var g=String(d).toUpperCase(),e=String(c).toUpperCase();return g>e?1:(g<e?-1:0)})},getRange:function(e,a){var b=this.items;if(b.length<1){return[]}e=e||0;a=Math.min(typeof a=="undefined"?this.length-1:a,this.length-1);var c,d=[];if(e<=a){for(c=e;c<=a;c++){d[d.length]=b[c]}}else{for(c=e;c>=a;c--){d[d.length]=b[c]}}return d},filter:function(c,b,d,a){if(Ext.isEmpty(b,false)){return this.clone()}b=this.createValueMatcher(b,d,a);return this.filterBy(function(e){return e&&b.test(e[c])})},filterBy:function(g,e){var h=new Ext.util.MixedCollection();h.getKey=this.getKey;var b=this.keys,d=this.items;for(var c=0,a=d.length;c<a;c++){if(g.call(e||this,d[c],b[c])){h.add(b[c],d[c])}}return h},findIndex:function(c,b,e,d,a){if(Ext.isEmpty(b,false)){return -1}b=this.createValueMatcher(b,d,a);return this.findIndexBy(function(g){return g&&b.test(g[c])},null,e)},findIndexBy:function(g,e,h){var b=this.keys,d=this.items;for(var c=(h||0),a=d.length;c<a;c++){if(g.call(e||this,d[c],b[c])){return c}}return -1},createValueMatcher:function(c,e,a,b){if(!c.exec){var d=Ext.escapeRe;c=String(c);if(e===true){c=d(c)}else{c="^"+d(c);if(b===true){c+="$"}}c=new RegExp(c,a?"":"i")}return c},clone:function(){var e=new Ext.util.MixedCollection();var b=this.keys,d=this.items;for(var c=0,a=d.length;c<a;c++){e.add(b[c],d[c])}e.getKey=this.getKey;return e}});Ext.util.MixedCollection.prototype.get=Ext.util.MixedCollection.prototype.item;Ext.AbstractManager=Ext.extend(Object,{typeName:"type",constructor:function(a){Ext.apply(this,a||{});this.all=new Ext.util.MixedCollection();this.types={}},get:function(a){return this.all.get(a)},register:function(a){this.all.add(a)},unregister:function(a){this.all.remove(a)},registerType:function(b,a){this.types[b]=a;a[this.typeName]=b},isRegistered:function(a){return this.types[a]!==undefined},create:function(a,d){var b=a[this.typeName]||a.type||d,c=this.types[b];if(c==undefined){throw new Error(String.format("The '{0}' type has not been registered with this manager",b))}return new c(a)},onAvailable:function(d,c,b){var a=this.all;a.on("add",function(e,g){if(g.id==d){c.call(b||g,g);a.un("add",c,b)}})}});Ext.util.Format=function(){var trimRe=/^\s+|\s+$/g,stripTagsRE=/<\/?[^>]+>/gi,stripScriptsRe=/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,nl2brRe=/\r?\n/g;return{ellipsis:function(value,len,word){if(value&&value.length>len){if(word){var vs=value.substr(0,len-2),index=Math.max(vs.lastIndexOf(" "),vs.lastIndexOf("."),vs.lastIndexOf("!"),vs.lastIndexOf("?"));if(index==-1||index<(len-15)){return value.substr(0,len-3)+"..."}else{return vs.substr(0,index)+"..."}}else{return value.substr(0,len-3)+"..."}}return value},undef:function(value){return value!==undefined?value:""},defaultValue:function(value,defaultValue){return value!==undefined&&value!==""?value:defaultValue},htmlEncode:function(value){return !value?value:String(value).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")},htmlDecode:function(value){return !value?value:String(value).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&")},trim:function(value){return String(value).replace(trimRe,"")},substr:function(value,start,length){return String(value).substr(start,length)},lowercase:function(value){return String(value).toLowerCase()},uppercase:function(value){return String(value).toUpperCase()},capitalize:function(value){return !value?value:value.charAt(0).toUpperCase()+value.substr(1).toLowerCase()},call:function(value,fn){if(arguments.length>2){var args=Array.prototype.slice.call(arguments,2);args.unshift(value);return eval(fn).apply(window,args)}else{return eval(fn).call(window,value)}},usMoney:function(v){v=(Math.round((v-0)*100))/100;v=(v==Math.floor(v))?v+".00":((v*10==Math.floor(v*10))?v+"0":v);v=String(v);var ps=v.split("."),whole=ps[0],sub=ps[1]?"."+ps[1]:".00",r=/(\d+)(\d{3})/;while(r.test(whole)){whole=whole.replace(r,"$1,$2")}v=whole+sub;if(v.charAt(0)=="-"){return"-$"+v.substr(1)}return"$"+v},date:function(v,format){if(!v){return""}if(!Ext.isDate(v)){v=new Date(Date.parse(v))}return v.dateFormat(format||"m/d/Y")},dateRenderer:function(format){return function(v){return Ext.util.Format.date(v,format)}},stripTags:function(v){return !v?v:String(v).replace(stripTagsRE,"")},stripScripts:function(v){return !v?v:String(v).replace(stripScriptsRe,"")},fileSize:function(size){if(size<1024){return size+" bytes"}else{if(size<1048576){return(Math.round(((size*10)/1024))/10)+" KB"}else{return(Math.round(((size*10)/1048576))/10)+" MB"}}},math:function(){var fns={};return function(v,a){if(!fns[a]){fns[a]=new Function("v","return v "+a+";")}return fns[a](v)}}(),round:function(value,precision){var result=Number(value);if(typeof precision=="number"){precision=Math.pow(10,precision);result=Math.round(value*precision)/precision}return result},number:function(v,format){if(!format){return v}v=Ext.num(v,NaN);if(isNaN(v)){return""}var comma=",",dec=".",i18n=false,neg=v<0;v=Math.abs(v);if(format.substr(format.length-2)=="/i"){format=format.substr(0,format.length-2);i18n=true;comma=".";dec=","}var hasComma=format.indexOf(comma)!=-1,psplit=(i18n?format.replace(/[^\d\,]/g,""):format.replace(/[^\d\.]/g,"")).split(dec);if(1<psplit.length){v=v.toFixed(psplit[1].length)}else{if(2<psplit.length){throw ("NumberFormatException: invalid format, formats should have no more than 1 period: "+format)}else{v=v.toFixed(0)}}var fnum=v.toString();psplit=fnum.split(".");if(hasComma){var cnum=psplit[0],parr=[],j=cnum.length,m=Math.floor(j/3),n=cnum.length%3||3,i;for(i=0;i<j;i+=n){if(i!=0){n=3}parr[parr.length]=cnum.substr(i,n);m-=1}fnum=parr.join(comma);if(psplit[1]){fnum+=dec+psplit[1]}}else{if(psplit[1]){fnum=psplit[0]+dec+psplit[1]}}return(neg?"-":"")+format.replace(/[\d,?\.?]+/,fnum)},numberRenderer:function(format){return function(v){return Ext.util.Format.number(v,format)}},plural:function(v,s,p){return v+" "+(v==1?s:(p?p:s+"s"))},nl2br:function(v){return Ext.isEmpty(v)?"":v.replace(nl2brRe,"<br/>")}}}();Ext.XTemplate=function(){Ext.XTemplate.superclass.constructor.apply(this,arguments);var y=this,j=y.html,q=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,d=/^<tpl\b[^>]*?for="(.*?)"/,v=/^<tpl\b[^>]*?if="(.*?)"/,x=/^<tpl\b[^>]*?exec="(.*?)"/,r,p=0,k=[],o="values",w="parent",l="xindex",n="xcount",e="return ",c="with(values){ ";j=["<tpl>",j,"</tpl>"].join("");while((r=j.match(q))){var b=r[0].match(d),a=r[0].match(v),A=r[0].match(x),g=null,h=null,t=null,z=b&&b[1]?b[1]:"";if(a){g=a&&a[1]?a[1]:null;if(g){h=new Function(o,w,l,n,c+e+(Ext.util.Format.htmlDecode(g))+"; }")}}if(A){g=A&&A[1]?A[1]:null;if(g){t=new Function(o,w,l,n,c+(Ext.util.Format.htmlDecode(g))+"; }")}}if(z){switch(z){case".":z=new Function(o,w,c+e+o+"; }");break;case"..":z=new Function(o,w,c+e+w+"; }");break;default:z=new Function(o,w,c+e+z+"; }")}}k.push({id:p,target:z,exec:t,test:h,body:r[1]||""});j=j.replace(r[0],"{xtpl"+p+"}");++p}for(var u=k.length-1;u>=0;--u){y.compileTpl(k[u])}y.master=k[k.length-1];y.tpls=k};Ext.extend(Ext.XTemplate,Ext.Template,{re:/\{([\w\-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,codeRe:/\{\[((?:\\\]|.|\n)*?)\]\}/g,applySubTemplate:function(a,k,j,d,c){var h=this,g,m=h.tpls[a],l,b=[];if((m.test&&!m.test.call(h,k,j,d,c))||(m.exec&&m.exec.call(h,k,j,d,c))){return""}l=m.target?m.target.call(h,k,j):k;g=l.length;j=m.target?k:j;if(m.target&&Ext.isArray(l)){for(var e=0,g=l.length;e<g;e++){b[b.length]=m.compiled.call(h,l[e],j,e+1,g)}return b.join("")}return m.compiled.call(h,l,j,d,c)},compileTpl:function(tpl){var fm=Ext.util.Format,useF=this.disableFormats!==true,sep=Ext.isGecko?"+":",",body;function fn(m,name,format,args,math){if(name.substr(0,4)=="xtpl"){return"'"+sep+"this.applySubTemplate("+name.substr(4)+", values, parent, xindex, xcount)"+sep+"'"}var v;if(name==="."){v="values"}else{if(name==="#"){v="xindex"}else{if(name.indexOf(".")!=-1){v=name}else{v="values['"+name+"']"}}}if(math){v="("+v+math+")"}if(format&&useF){args=args?","+args:"";if(format.substr(0,5)!="this."){format="fm."+format+"("}else{format='this.call("'+format.substr(5)+'", ';args=", values"}}else{args="";format="("+v+" === undefined ? '' : "}return"'"+sep+format+v+args+")"+sep+"'"}function codeFn(m,code){return"'"+sep+"("+code.replace(/\\'/g,"'")+")"+sep+"'"}if(Ext.isGecko){body="tpl.compiled = function(values, parent, xindex, xcount){ return '"+tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn)+"';};"}else{body=["tpl.compiled = function(values, parent, xindex, xcount){ return ['"];body.push(tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn));body.push("'].join('');};");body=body.join("")}eval(body);return this},applyTemplate:function(a){return this.master.compiled.call(this,a,{},1,1)},compile:function(){return this}});Ext.XTemplate.prototype.apply=Ext.XTemplate.prototype.applyTemplate;Ext.XTemplate.from=function(a){a=Ext.getDom(a);return new Ext.XTemplate(a.value||a.innerHTML)};Ext.util.CSS=function(){var d=null;var c=document;var b=/(-[a-z])/gi;var a=function(e,g){return g.charAt(1).toUpperCase()};return{createStyleSheet:function(i,l){var h;var g=c.getElementsByTagName("head")[0];var k=c.createElement("style");k.setAttribute("type","text/css");if(l){k.setAttribute("id",l)}if(Ext.isIE){g.appendChild(k);h=k.styleSheet;h.cssText=i}else{try{k.appendChild(c.createTextNode(i))}catch(j){k.cssText=i}g.appendChild(k);h=k.styleSheet?k.styleSheet:(k.sheet||c.styleSheets[c.styleSheets.length-1])}this.cacheStyleSheet(h);return h},removeStyleSheet:function(g){var e=c.getElementById(g);if(e){e.parentNode.removeChild(e)}},swapStyleSheet:function(h,e){this.removeStyleSheet(h);var g=c.createElement("link");g.setAttribute("rel","stylesheet");g.setAttribute("type","text/css");g.setAttribute("id",h);g.setAttribute("href",e);c.getElementsByTagName("head")[0].appendChild(g)},refreshCache:function(){return this.getRules(true)},cacheStyleSheet:function(h){if(!d){d={}}try{var k=h.cssRules||h.rules;for(var g=k.length-1;g>=0;--g){d[k[g].selectorText.toLowerCase()]=k[g]}}catch(i){}},getRules:function(h){if(d===null||h){d={};var k=c.styleSheets;for(var j=0,g=k.length;j<g;j++){try{this.cacheStyleSheet(k[j])}catch(l){}}}return d},getRule:function(e,h){var g=this.getRules(h);if(!Ext.isArray(e)){return g[e.toLowerCase()]}for(var j=0;j<e.length;j++){if(g[e[j]]){return g[e[j].toLowerCase()]}}return null},updateRule:function(e,j,h){if(!Ext.isArray(e)){var k=this.getRule(e);if(k){k.style[j.replace(b,a)]=h;return true}}else{for(var g=0;g<e.length;g++){if(this.updateRule(e[g],j,h)){return true}}}return false}}}();Ext.util.ClickRepeater=Ext.extend(Ext.util.Observable,{constructor:function(b,a){this.el=Ext.get(b);this.el.unselectable();Ext.apply(this,a);this.addEvents("mousedown","click","mouseup");if(!this.disabled){this.disabled=true;this.enable()}if(this.handler){this.on("click",this.handler,this.scope||this)}Ext.util.ClickRepeater.superclass.constructor.call(this)},interval:20,delay:250,preventDefault:true,stopDefault:false,timer:0,enable:function(){if(this.disabled){this.el.on("mousedown",this.handleMouseDown,this);if(Ext.isIE){this.el.on("dblclick",this.handleDblClick,this)}if(this.preventDefault||this.stopDefault){this.el.on("click",this.eventOptions,this)}}this.disabled=false},disable:function(a){if(a||!this.disabled){clearTimeout(this.timer);if(this.pressClass){this.el.removeClass(this.pressClass)}Ext.getDoc().un("mouseup",this.handleMouseUp,this);this.el.removeAllListeners()}this.disabled=true},setDisabled:function(a){this[a?"disable":"enable"]()},eventOptions:function(a){if(this.preventDefault){a.preventDefault()}if(this.stopDefault){a.stopEvent()}},destroy:function(){this.disable(true);Ext.destroy(this.el);this.purgeListeners()},handleDblClick:function(a){clearTimeout(this.timer);this.el.blur();this.fireEvent("mousedown",this,a);this.fireEvent("click",this,a)},handleMouseDown:function(a){clearTimeout(this.timer);this.el.blur();if(this.pressClass){this.el.addClass(this.pressClass)}this.mousedownTime=new Date();Ext.getDoc().on("mouseup",this.handleMouseUp,this);this.el.on("mouseout",this.handleMouseOut,this);this.fireEvent("mousedown",this,a);this.fireEvent("click",this,a);if(this.accelerate){this.delay=400}this.timer=this.click.defer(this.delay||this.interval,this,[a])},click:function(a){this.fireEvent("click",this,a);this.timer=this.click.defer(this.accelerate?this.easeOutExpo(this.mousedownTime.getElapsed(),400,-390,12000):this.interval,this,[a])},easeOutExpo:function(e,a,h,g){return(e==g)?a+h:h*(-Math.pow(2,-10*e/g)+1)+a},handleMouseOut:function(){clearTimeout(this.timer);if(this.pressClass){this.el.removeClass(this.pressClass)}this.el.on("mouseover",this.handleMouseReturn,this)},handleMouseReturn:function(){this.el.un("mouseover",this.handleMouseReturn,this);if(this.pressClass){this.el.addClass(this.pressClass)}this.click()},handleMouseUp:function(a){clearTimeout(this.timer);this.el.un("mouseover",this.handleMouseReturn,this);this.el.un("mouseout",this.handleMouseOut,this);Ext.getDoc().un("mouseup",this.handleMouseUp,this);this.el.removeClass(this.pressClass);this.fireEvent("mouseup",this,a)}});Ext.KeyNav=function(b,a){this.el=Ext.get(b);Ext.apply(this,a);if(!this.disabled){this.disabled=true;this.enable()}};Ext.KeyNav.prototype={disabled:false,defaultEventAction:"stopEvent",forceKeyDown:false,relay:function(c){var a=c.getKey(),b=this.keyToHandler[a];if(b&&this[b]){if(this.doRelay(c,this[b],b)!==true){c[this.defaultEventAction]()}}},doRelay:function(c,b,a){return b.call(this.scope||this,c,a)},enter:false,left:false,right:false,up:false,down:false,tab:false,esc:false,pageUp:false,pageDown:false,del:false,home:false,end:false,space:false,keyToHandler:{37:"left",39:"right",38:"up",40:"down",33:"pageUp",34:"pageDown",46:"del",36:"home",35:"end",13:"enter",27:"esc",9:"tab",32:"space"},stopKeyUp:function(b){var a=b.getKey();if(a>=37&&a<=40){b.stopEvent()}},destroy:function(){this.disable()},enable:function(){if(this.disabled){if(Ext.isSafari2){this.el.on("keyup",this.stopKeyUp,this)}this.el.on(this.isKeydown()?"keydown":"keypress",this.relay,this);this.disabled=false}},disable:function(){if(!this.disabled){if(Ext.isSafari2){this.el.un("keyup",this.stopKeyUp,this)}this.el.un(this.isKeydown()?"keydown":"keypress",this.relay,this);this.disabled=true}},setDisabled:function(a){this[a?"disable":"enable"]()},isKeydown:function(){return this.forceKeyDown||Ext.EventManager.useKeydown}};Ext.KeyMap=function(c,b,a){this.el=Ext.get(c);this.eventName=a||"keydown";this.bindings=[];if(b){this.addBinding(b)}this.enable()};Ext.KeyMap.prototype={stopEvent:false,addBinding:function(b){if(Ext.isArray(b)){Ext.each(b,function(j){this.addBinding(j)},this);return}var k=b.key,g=b.fn||b.handler,l=b.scope;if(b.stopEvent){this.stopEvent=b.stopEvent}if(typeof k=="string"){var h=[];var e=k.toUpperCase();for(var c=0,d=e.length;c<d;c++){h.push(e.charCodeAt(c))}k=h}var a=Ext.isArray(k);var i=function(o){if(this.checkModifiers(b,o)){var m=o.getKey();if(a){for(var n=0,j=k.length;n<j;n++){if(k[n]==m){if(this.stopEvent){o.stopEvent()}g.call(l||window,m,o);return}}}else{if(m==k){if(this.stopEvent){o.stopEvent()}g.call(l||window,m,o)}}}};this.bindings.push(i)},checkModifiers:function(b,h){var j,d,g=["shift","ctrl","alt"];for(var c=0,a=g.length;c<a;++c){d=g[c];j=b[d];if(!(j===undefined||(j===h[d+"Key"]))){return false}}return true},on:function(b,d,c){var h,a,e,g;if(typeof b=="object"&&!Ext.isArray(b)){h=b.key;a=b.shift;e=b.ctrl;g=b.alt}else{h=b}this.addBinding({key:h,shift:a,ctrl:e,alt:g,fn:d,scope:c})},handleKeyDown:function(g){if(this.enabled){var c=this.bindings;for(var d=0,a=c.length;d<a;d++){c[d].call(this,g)}}},isEnabled:function(){return this.enabled},enable:function(){if(!this.enabled){this.el.on(this.eventName,this.handleKeyDown,this);this.enabled=true}},disable:function(){if(this.enabled){this.el.removeListener(this.eventName,this.handleKeyDown,this);this.enabled=false}},setDisabled:function(a){this[a?"disable":"enable"]()}};Ext.util.TextMetrics=function(){var a;return{measure:function(b,c,d){if(!a){a=Ext.util.TextMetrics.Instance(b,d)}a.bind(b);a.setFixedWidth(d||"auto");return a.getSize(c)},createInstance:function(b,c){return Ext.util.TextMetrics.Instance(b,c)}}}();Ext.util.TextMetrics.Instance=function(b,d){var c=new Ext.Element(document.createElement("div"));document.body.appendChild(c.dom);c.position("absolute");c.setLeftTop(-1000,-1000);c.hide();if(d){c.setWidth(d)}var a={getSize:function(g){c.update(g);var e=c.getSize();c.update("");return e},bind:function(e){c.setStyle(Ext.fly(e).getStyles("font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"))},setFixedWidth:function(e){c.setWidth(e)},getWidth:function(e){c.dom.style.width="auto";return this.getSize(e).width},getHeight:function(e){return this.getSize(e).height}};a.bind(b);return a};Ext.Element.addMethods({getTextWidth:function(c,b,a){return(Ext.util.TextMetrics.measure(this.dom,Ext.value(c,this.dom.innerHTML,true)).width).constrain(b||0,a||1000000)}});Ext.util.Cookies={set:function(c,e){var a=arguments;var i=arguments.length;var b=(i>2)?a[2]:null;var h=(i>3)?a[3]:"/";var d=(i>4)?a[4]:null;var g=(i>5)?a[5]:false;document.cookie=c+"="+escape(e)+((b===null)?"":("; expires="+b.toGMTString()))+((h===null)?"":("; path="+h))+((d===null)?"":("; domain="+d))+((g===true)?"; secure":"")},get:function(d){var b=d+"=";var g=b.length;var a=document.cookie.length;var e=0;var c=0;while(e<a){c=e+g;if(document.cookie.substring(e,c)==b){return Ext.util.Cookies.getCookieVal(c)}e=document.cookie.indexOf(" ",e)+1;if(e===0){break}}return null},clear:function(a){if(Ext.util.Cookies.get(a)){document.cookie=a+"=; expires=Thu, 01-Jan-70 00:00:01 GMT"}},getCookieVal:function(b){var a=document.cookie.indexOf(";",b);if(a==-1){a=document.cookie.length}return unescape(document.cookie.substring(b,a))}};Ext.handleError=function(a){throw a};Ext.Error=function(a){this.message=(this.lang[a])?this.lang[a]:a};Ext.Error.prototype=new Error();Ext.apply(Ext.Error.prototype,{lang:{},name:"Ext.Error",getName:function(){return this.name},getMessage:function(){return this.message},toJson:function(){return Ext.encode(this)}});Ext.ComponentMgr=function(){var c=new Ext.util.MixedCollection();var b={};var a={};return{register:function(d){c.add(d)},unregister:function(d){c.remove(d)},get:function(d){return c.get(d)},onAvailable:function(g,e,d){c.on("add",function(h,i){if(i.id==g){e.call(d||i,i);c.un("add",e,d)}})},all:c,types:b,ptypes:a,isRegistered:function(d){return b[d]!==undefined},isPluginRegistered:function(d){return a[d]!==undefined},registerType:function(e,d){b[e]=d;d.xtype=e},create:function(d,e){return d.render?d:new b[d.xtype||e](d)},registerPlugin:function(e,d){a[e]=d;d.ptype=e},createPlugin:function(e,g){var d=a[e.ptype||g];if(d.init){return d}else{return new d(e)}}}}();Ext.reg=Ext.ComponentMgr.registerType;Ext.preg=Ext.ComponentMgr.registerPlugin;Ext.create=Ext.ComponentMgr.create;Ext.Component=function(b){b=b||{};if(b.initialConfig){if(b.isAction){this.baseAction=b}b=b.initialConfig}else{if(b.tagName||b.dom||Ext.isString(b)){b={applyTo:b,id:b.id||b}}}this.initialConfig=b;Ext.apply(this,b);this.addEvents("added","disable","enable","beforeshow","show","beforehide","hide","removed","beforerender","render","afterrender","beforedestroy","destroy","beforestaterestore","staterestore","beforestatesave","statesave");this.getId();Ext.ComponentMgr.register(this);Ext.Component.superclass.constructor.call(this);if(this.baseAction){this.baseAction.addComponent(this)}this.initComponent();if(this.plugins){if(Ext.isArray(this.plugins)){for(var c=0,a=this.plugins.length;c<a;c++){this.plugins[c]=this.initPlugin(this.plugins[c])}}else{this.plugins=this.initPlugin(this.plugins)}}if(this.stateful!==false){this.initState()}if(this.applyTo){this.applyToMarkup(this.applyTo);delete this.applyTo}else{if(this.renderTo){this.render(this.renderTo);delete this.renderTo}}};Ext.Component.AUTO_ID=1000;Ext.extend(Ext.Component,Ext.util.Observable,{disabled:false,hidden:false,autoEl:"div",disabledClass:"x-item-disabled",allowDomMove:true,autoShow:false,hideMode:"display",hideParent:false,rendered:false,tplWriteMode:"overwrite",bubbleEvents:[],ctype:"Ext.Component",actionMode:"el",getActionEl:function(){return this[this.actionMode]},initPlugin:function(a){if(a.ptype&&!Ext.isFunction(a.init)){a=Ext.ComponentMgr.createPlugin(a)}else{if(Ext.isString(a)){a=Ext.ComponentMgr.createPlugin({ptype:a})}}a.init(this);return a},initComponent:function(){if(this.listeners){this.on(this.listeners);delete this.listeners}this.enableBubble(this.bubbleEvents)},render:function(b,a){if(!this.rendered&&this.fireEvent("beforerender",this)!==false){if(!b&&this.el){this.el=Ext.get(this.el);b=this.el.dom.parentNode;this.allowDomMove=false}this.container=Ext.get(b);if(this.ctCls){this.container.addClass(this.ctCls)}this.rendered=true;if(a!==undefined){if(Ext.isNumber(a)){a=this.container.dom.childNodes[a]}else{a=Ext.getDom(a)}}this.onRender(this.container,a||null);if(this.autoShow){this.el.removeClass(["x-hidden","x-hide-"+this.hideMode])}if(this.cls){this.el.addClass(this.cls);delete this.cls}if(this.style){this.el.applyStyles(this.style);delete this.style}if(this.overCls){this.el.addClassOnOver(this.overCls)}this.fireEvent("render",this);var c=this.getContentTarget();if(this.html){c.update(Ext.DomHelper.markup(this.html));delete this.html}if(this.contentEl){var d=Ext.getDom(this.contentEl);Ext.fly(d).removeClass(["x-hidden","x-hide-display"]);c.appendChild(d)}if(this.tpl){if(!this.tpl.compile){this.tpl=new Ext.XTemplate(this.tpl)}if(this.data){this.tpl[this.tplWriteMode](c,this.data);delete this.data}}this.afterRender(this.container);if(this.hidden){this.doHide()}if(this.disabled){this.disable(true)}if(this.stateful!==false){this.initStateEvents()}this.fireEvent("afterrender",this)}return this},update:function(b,d,a){var c=this.getContentTarget();if(this.tpl&&typeof b!=="string"){this.tpl[this.tplWriteMode](c,b||{})}else{var e=Ext.isObject(b)?Ext.DomHelper.markup(b):b;c.update(e,d,a)}},onAdded:function(a,b){this.ownerCt=a;this.initRef();this.fireEvent("added",this,a,b)},onRemoved:function(){this.removeRef();this.fireEvent("removed",this,this.ownerCt);delete this.ownerCt},initRef:function(){if(this.ref&&!this.refOwner){var d=this.ref.split("/"),c=d.length,b=0,a=this;while(a&&b<c){a=a.ownerCt;++b}if(a){a[this.refName=d[--b]]=this;this.refOwner=a}}},removeRef:function(){if(this.refOwner&&this.refName){delete this.refOwner[this.refName];delete this.refOwner}},initState:function(){if(Ext.state.Manager){var b=this.getStateId();if(b){var a=Ext.state.Manager.get(b);if(a){if(this.fireEvent("beforestaterestore",this,a)!==false){this.applyState(Ext.apply({},a));this.fireEvent("staterestore",this,a)}}}}},getStateId:function(){return this.stateId||((/^(ext-comp-|ext-gen)/).test(String(this.id))?null:this.id)},initStateEvents:function(){if(this.stateEvents){for(var a=0,b;b=this.stateEvents[a];a++){this.on(b,this.saveState,this,{delay:100})}}},applyState:function(a){if(a){Ext.apply(this,a)}},getState:function(){return null},saveState:function(){if(Ext.state.Manager&&this.stateful!==false){var b=this.getStateId();if(b){var a=this.getState();if(this.fireEvent("beforestatesave",this,a)!==false){Ext.state.Manager.set(b,a);this.fireEvent("statesave",this,a)}}}},applyToMarkup:function(a){this.allowDomMove=false;this.el=Ext.get(a);this.render(this.el.dom.parentNode)},addClass:function(a){if(this.el){this.el.addClass(a)}else{this.cls=this.cls?this.cls+" "+a:a}return this},removeClass:function(a){if(this.el){this.el.removeClass(a)}else{if(this.cls){this.cls=this.cls.split(" ").remove(a).join(" ")}}return this},onRender:function(b,a){if(!this.el&&this.autoEl){if(Ext.isString(this.autoEl)){this.el=document.createElement(this.autoEl)}else{var c=document.createElement("div");Ext.DomHelper.overwrite(c,this.autoEl);this.el=c.firstChild}if(!this.el.id){this.el.id=this.getId()}}if(this.el){this.el=Ext.get(this.el);if(this.allowDomMove!==false){b.dom.insertBefore(this.el.dom,a);if(c){Ext.removeNode(c);c=null}}}},getAutoCreate:function(){var a=Ext.isObject(this.autoCreate)?this.autoCreate:Ext.apply({},this.defaultAutoCreate);if(this.id&&!a.id){a.id=this.id}return a},afterRender:Ext.emptyFn,destroy:function(){if(!this.isDestroyed){if(this.fireEvent("beforedestroy",this)!==false){this.destroying=true;this.beforeDestroy();if(this.ownerCt&&this.ownerCt.remove){this.ownerCt.remove(this,false)}if(this.rendered){this.el.remove();if(this.actionMode=="container"||this.removeMode=="container"){this.container.remove()}}if(this.focusTask&&this.focusTask.cancel){this.focusTask.cancel()}this.onDestroy();Ext.ComponentMgr.unregister(this);this.fireEvent("destroy",this);this.purgeListeners();this.destroying=false;this.isDestroyed=true}}},deleteMembers:function(){var b=arguments;for(var c=0,a=b.length;c<a;++c){delete this[b[c]]}},beforeDestroy:Ext.emptyFn,onDestroy:Ext.emptyFn,getEl:function(){return this.el},getContentTarget:function(){return this.el},getId:function(){return this.id||(this.id="ext-comp-"+(++Ext.Component.AUTO_ID))},getItemId:function(){return this.itemId||this.getId()},focus:function(b,a){if(a){this.focusTask=new Ext.util.DelayedTask(this.focus,this,[b,false]);this.focusTask.delay(Ext.isNumber(a)?a:10);return this}if(this.rendered&&!this.isDestroyed){this.el.focus();if(b===true){this.el.dom.select()}}return this},blur:function(){if(this.rendered){this.el.blur()}return this},disable:function(a){if(this.rendered){this.onDisable()}this.disabled=true;if(a!==true){this.fireEvent("disable",this)}return this},onDisable:function(){this.getActionEl().addClass(this.disabledClass);this.el.dom.disabled=true},enable:function(){if(this.rendered){this.onEnable()}this.disabled=false;this.fireEvent("enable",this);return this},onEnable:function(){this.getActionEl().removeClass(this.disabledClass);this.el.dom.disabled=false},setDisabled:function(a){return this[a?"disable":"enable"]()},show:function(){if(this.fireEvent("beforeshow",this)!==false){this.hidden=false;if(this.autoRender){this.render(Ext.isBoolean(this.autoRender)?Ext.getBody():this.autoRender)}if(this.rendered){this.onShow()}this.fireEvent("show",this)}return this},onShow:function(){this.getVisibilityEl().removeClass("x-hide-"+this.hideMode)},hide:function(){if(this.fireEvent("beforehide",this)!==false){this.doHide();this.fireEvent("hide",this)}return this},doHide:function(){this.hidden=true;if(this.rendered){this.onHide()}},onHide:function(){this.getVisibilityEl().addClass("x-hide-"+this.hideMode)},getVisibilityEl:function(){return this.hideParent?this.container:this.getActionEl()},setVisible:function(a){return this[a?"show":"hide"]()},isVisible:function(){return this.rendered&&this.getVisibilityEl().isVisible()},cloneConfig:function(b){b=b||{};var c=b.id||Ext.id();var a=Ext.applyIf(b,this.initialConfig);a.id=c;return new this.constructor(a)},getXType:function(){return this.constructor.xtype},isXType:function(b,a){if(Ext.isFunction(b)){b=b.xtype}else{if(Ext.isObject(b)){b=b.constructor.xtype}}return !a?("/"+this.getXTypes()+"/").indexOf("/"+b+"/")!=-1:this.constructor.xtype==b},getXTypes:function(){var a=this.constructor;if(!a.xtypes){var d=[],b=this;while(b&&b.constructor.xtype){d.unshift(b.constructor.xtype);b=b.constructor.superclass}a.xtypeChain=d;a.xtypes=d.join("/")}return a.xtypes},findParentBy:function(a){for(var b=this.ownerCt;(b!=null)&&!a(b,this);b=b.ownerCt){}return b||null},findParentByType:function(b,a){return this.findParentBy(function(d){return d.isXType(b,a)})},bubble:function(c,b,a){var d=this;while(d){if(c.apply(b||d,a||[d])===false){break}d=d.ownerCt}return this},getPositionEl:function(){return this.positionEl||this.el},purgeListeners:function(){Ext.Component.superclass.purgeListeners.call(this);if(this.mons){this.on("beforedestroy",this.clearMons,this,{single:true})}},clearMons:function(){Ext.each(this.mons,function(a){a.item.un(a.ename,a.fn,a.scope)},this);this.mons=[]},createMons:function(){if(!this.mons){this.mons=[];this.on("beforedestroy",this.clearMons,this,{single:true})}},mon:function(g,b,d,c,a){this.createMons();if(Ext.isObject(b)){var j=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;var i=b;for(var h in i){if(j.test(h)){continue}if(Ext.isFunction(i[h])){this.mons.push({item:g,ename:h,fn:i[h],scope:i.scope});g.on(h,i[h],i.scope,i)}else{this.mons.push({item:g,ename:h,fn:i[h],scope:i.scope});g.on(h,i[h])}}return}this.mons.push({item:g,ename:b,fn:d,scope:c});g.on(b,d,c,a)},mun:function(h,c,g,e){var j,d;this.createMons();for(var b=0,a=this.mons.length;b<a;++b){d=this.mons[b];if(h===d.item&&c==d.ename&&g===d.fn&&e===d.scope){this.mons.splice(b,1);h.un(c,g,e);j=true;break}}return j},nextSibling:function(){if(this.ownerCt){var a=this.ownerCt.items.indexOf(this);if(a!=-1&&a+1<this.ownerCt.items.getCount()){return this.ownerCt.items.itemAt(a+1)}}return null},previousSibling:function(){if(this.ownerCt){var a=this.ownerCt.items.indexOf(this);if(a>0){return this.ownerCt.items.itemAt(a-1)}}return null},getBubbleTarget:function(){return this.ownerCt}});Ext.reg("component",Ext.Component);Ext.Action=Ext.extend(Object,{constructor:function(a){this.initialConfig=a;this.itemId=a.itemId=(a.itemId||a.id||Ext.id());this.items=[]},isAction:true,setText:function(a){this.initialConfig.text=a;this.callEach("setText",[a])},getText:function(){return this.initialConfig.text},setIconClass:function(a){this.initialConfig.iconCls=a;this.callEach("setIconClass",[a])},getIconClass:function(){return this.initialConfig.iconCls},setDisabled:function(a){this.initialConfig.disabled=a;this.callEach("setDisabled",[a])},enable:function(){this.setDisabled(false)},disable:function(){this.setDisabled(true)},isDisabled:function(){return this.initialConfig.disabled},setHidden:function(a){this.initialConfig.hidden=a;this.callEach("setVisible",[!a])},show:function(){this.setHidden(false)},hide:function(){this.setHidden(true)},isHidden:function(){return this.initialConfig.hidden},setHandler:function(b,a){this.initialConfig.handler=b;this.initialConfig.scope=a;this.callEach("setHandler",[b,a])},each:function(b,a){Ext.each(this.items,b,a)},callEach:function(e,b){var d=this.items;for(var c=0,a=d.length;c<a;c++){d[c][e].apply(d[c],b)}},addComponent:function(a){this.items.push(a);a.on("destroy",this.removeComponent,this)},removeComponent:function(a){this.items.remove(a)},execute:function(){this.initialConfig.handler.apply(this.initialConfig.scope||window,arguments)}});(function(){Ext.Layer=function(d,c){d=d||{};var e=Ext.DomHelper,h=d.parentEl,g=h?Ext.getDom(h):document.body;if(c){this.dom=Ext.getDom(c)}if(!this.dom){var i=d.dh||{tag:"div",cls:"x-layer"};this.dom=e.append(g,i)}if(d.cls){this.addClass(d.cls)}this.constrain=d.constrain!==false;this.setVisibilityMode(Ext.Element.VISIBILITY);if(d.id){this.id=this.dom.id=d.id}else{this.id=Ext.id(this.dom)}this.zindex=d.zindex||this.getZIndex();this.position("absolute",this.zindex);if(d.shadow){this.shadowOffset=d.shadowOffset||4;this.shadow=new Ext.Shadow({offset:this.shadowOffset,mode:d.shadow})}else{this.shadowOffset=0}this.useShim=d.shim!==false&&Ext.useShims;this.useDisplay=d.useDisplay;this.hide()};var a=Ext.Element.prototype;var b=[];Ext.extend(Ext.Layer,Ext.Element,{getZIndex:function(){return this.zindex||parseInt((this.getShim()||this).getStyle("z-index"),10)||11000},getShim:function(){if(!this.useShim){return null}if(this.shim){return this.shim}var d=b.shift();if(!d){d=this.createShim();d.enableDisplayMode("block");d.dom.style.display="none";d.dom.style.visibility="visible"}var c=this.dom.parentNode;if(d.dom.parentNode!=c){c.insertBefore(d.dom,this.dom)}d.setStyle("z-index",this.getZIndex()-2);this.shim=d;return d},hideShim:function(){if(this.shim){this.shim.setDisplayed(false);b.push(this.shim);delete this.shim}},disableShadow:function(){if(this.shadow){this.shadowDisabled=true;this.shadow.hide();this.lastShadowOffset=this.shadowOffset;this.shadowOffset=0}},enableShadow:function(c){if(this.shadow){this.shadowDisabled=false;if(Ext.isDefined(this.lastShadowOffset)){this.shadowOffset=this.lastShadowOffset;delete this.lastShadowOffset}if(c){this.sync(true)}}},sync:function(d){var n=this.shadow;if(!this.updating&&this.isVisible()&&(n||this.useShim)){var i=this.getShim(),m=this.getWidth(),j=this.getHeight(),e=this.getLeft(true),o=this.getTop(true);if(n&&!this.shadowDisabled){if(d&&!n.isVisible()){n.show(this)}else{n.realign(e,o,m,j)}if(i){if(d){i.show()}var k=n.el.getXY(),g=i.dom.style,c=n.el.getSize();g.left=(k[0])+"px";g.top=(k[1])+"px";g.width=(c.width)+"px";g.height=(c.height)+"px"}}else{if(i){if(d){i.show()}i.setSize(m,j);i.setLeftTop(e,o)}}}},destroy:function(){this.hideShim();if(this.shadow){this.shadow.hide()}this.removeAllListeners();Ext.removeNode(this.dom);delete this.dom},remove:function(){this.destroy()},beginUpdate:function(){this.updating=true},endUpdate:function(){this.updating=false;this.sync(true)},hideUnders:function(c){if(this.shadow){this.shadow.hide()}this.hideShim()},constrainXY:function(){if(this.constrain){var j=Ext.lib.Dom.getViewWidth(),d=Ext.lib.Dom.getViewHeight();var o=Ext.getDoc().getScroll();var n=this.getXY();var k=n[0],i=n[1];var c=this.shadowOffset;var l=this.dom.offsetWidth+c,e=this.dom.offsetHeight+c;var g=false;if((k+l)>j+o.left){k=j-l-c;g=true}if((i+e)>d+o.top){i=d-e-c;g=true}if(k<o.left){k=o.left;g=true}if(i<o.top){i=o.top;g=true}if(g){if(this.avoidY){var m=this.avoidY;if(i<=m&&(i+e)>=m){i=m-e-5}}n=[k,i];this.storeXY(n);a.setXY.call(this,n);this.sync()}}return this},getConstrainOffset:function(){return this.shadowOffset},isVisible:function(){return this.visible},showAction:function(){this.visible=true;if(this.useDisplay===true){this.setDisplayed("")}else{if(this.lastXY){a.setXY.call(this,this.lastXY)}else{if(this.lastLT){a.setLeftTop.call(this,this.lastLT[0],this.lastLT[1])}}}},hideAction:function(){this.visible=false;if(this.useDisplay===true){this.setDisplayed(false)}else{this.setLeftTop(-10000,-10000)}},setVisible:function(i,h,k,l,j){if(i){this.showAction()}if(h&&i){var g=function(){this.sync(true);if(l){l()}}.createDelegate(this);a.setVisible.call(this,true,true,k,g,j)}else{if(!i){this.hideUnders(true)}var g=l;if(h){g=function(){this.hideAction();if(l){l()}}.createDelegate(this)}a.setVisible.call(this,i,h,k,g,j);if(i){this.sync(true)}else{if(!h){this.hideAction()}}}return this},storeXY:function(c){delete this.lastLT;this.lastXY=c},storeLeftTop:function(d,c){delete this.lastXY;this.lastLT=[d,c]},beforeFx:function(){this.beforeAction();return Ext.Layer.superclass.beforeFx.apply(this,arguments)},afterFx:function(){Ext.Layer.superclass.afterFx.apply(this,arguments);this.sync(this.isVisible())},beforeAction:function(){if(!this.updating&&this.shadow){this.shadow.hide()}},setLeft:function(c){this.storeLeftTop(c,this.getTop(true));a.setLeft.apply(this,arguments);this.sync();return this},setTop:function(c){this.storeLeftTop(this.getLeft(true),c);a.setTop.apply(this,arguments);this.sync();return this},setLeftTop:function(d,c){this.storeLeftTop(d,c);a.setLeftTop.apply(this,arguments);this.sync();return this},setXY:function(j,h,k,l,i){this.fixDisplay();this.beforeAction();this.storeXY(j);var g=this.createCB(l);a.setXY.call(this,j,h,k,g,i);if(!h){g()}return this},createCB:function(e){var d=this;return function(){d.constrainXY();d.sync(true);if(e){e()}}},setX:function(g,h,j,k,i){this.setXY([g,this.getY()],h,j,k,i);return this},setY:function(k,g,i,j,h){this.setXY([this.getX(),k],g,i,j,h);return this},setSize:function(j,k,i,m,n,l){this.beforeAction();var g=this.createCB(n);a.setSize.call(this,j,k,i,m,g,l);if(!i){g()}return this},setWidth:function(i,h,k,l,j){this.beforeAction();var g=this.createCB(l);a.setWidth.call(this,i,h,k,g,j);if(!h){g()}return this},setHeight:function(j,i,l,m,k){this.beforeAction();var g=this.createCB(m);a.setHeight.call(this,j,i,l,g,k);if(!i){g()}return this},setBounds:function(o,m,p,i,n,k,l,j){this.beforeAction();var g=this.createCB(l);if(!n){this.storeXY([o,m]);a.setXY.call(this,[o,m]);a.setSize.call(this,p,i,n,k,g,j);g()}else{a.setBounds.call(this,o,m,p,i,n,k,g,j)}return this},setZIndex:function(c){this.zindex=c;this.setStyle("z-index",c+2);if(this.shadow){this.shadow.setZIndex(c+1)}if(this.shim){this.shim.setStyle("z-index",c)}return this}})})();Ext.Shadow=function(d){Ext.apply(this,d);if(typeof this.mode!="string"){this.mode=this.defaultMode}var e=this.offset,c={h:0},b=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case"drop":c.w=0;c.l=c.t=e;c.t-=1;if(Ext.isIE){c.l-=this.offset+b;c.t-=this.offset+b;c.w-=b;c.h-=b;c.t+=1}break;case"sides":c.w=(e*2);c.l=-e;c.t=e-1;if(Ext.isIE){c.l-=(this.offset-b);c.t-=this.offset+b;c.l+=1;c.w-=(this.offset-b)*2;c.w-=b+1;c.h-=1}break;case"frame":c.w=c.h=(e*2);c.l=c.t=-e;c.t+=1;c.h-=2;if(Ext.isIE){c.l-=(this.offset-b);c.t-=(this.offset-b);c.l+=1;c.w-=(this.offset+b+1);c.h-=(this.offset+b);c.h+=1}break}this.adjusts=c};Ext.Shadow.prototype={offset:4,defaultMode:"drop",show:function(a){a=Ext.get(a);if(!this.el){this.el=Ext.Shadow.Pool.pull();if(this.el.dom.nextSibling!=a.dom){this.el.insertBefore(a)}}this.el.setStyle("z-index",this.zIndex||parseInt(a.getStyle("z-index"),10)-1);if(Ext.isIE){this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")"}this.realign(a.getLeft(true),a.getTop(true),a.getWidth(),a.getHeight());this.el.dom.style.display="block"},isVisible:function(){return this.el?true:false},realign:function(b,r,q,g){if(!this.el){return}var n=this.adjusts,k=this.el.dom,u=k.style,i=0,p=(q+n.w),e=(g+n.h),j=p+"px",o=e+"px",m,c;u.left=(b+n.l)+"px";u.top=(r+n.t)+"px";if(u.width!=j||u.height!=o){u.width=j;u.height=o;if(!Ext.isIE){m=k.childNodes;c=Math.max(0,(p-12))+"px";m[0].childNodes[1].style.width=c;m[1].childNodes[1].style.width=c;m[2].childNodes[1].style.width=c;m[1].style.height=Math.max(0,(e-12))+"px"}}},hide:function(){if(this.el){this.el.dom.style.display="none";Ext.Shadow.Pool.push(this.el);delete this.el}},setZIndex:function(a){this.zIndex=a;if(this.el){this.el.setStyle("z-index",a)}}};Ext.Shadow.Pool=function(){var b=[],a=Ext.isIE?'<div class="x-ie-shadow"></div>':'<div class="x-shadow"><div class="xst"><div class="xstl"></div><div class="xstc"></div><div class="xstr"></div></div><div class="xsc"><div class="xsml"></div><div class="xsmc"></div><div class="xsmr"></div></div><div class="xsb"><div class="xsbl"></div><div class="xsbc"></div><div class="xsbr"></div></div></div>';return{pull:function(){var c=b.shift();if(!c){c=Ext.get(Ext.DomHelper.insertHtml("beforeBegin",document.body.firstChild,a));c.autoBoxAdjust=false}return c},push:function(c){b.push(c)}}}();Ext.BoxComponent=Ext.extend(Ext.Component,{initComponent:function(){Ext.BoxComponent.superclass.initComponent.call(this);this.addEvents("resize","move")},boxReady:false,deferHeight:false,setSize:function(b,d){if(typeof b=="object"){d=b.height;b=b.width}if(Ext.isDefined(b)&&Ext.isDefined(this.boxMinWidth)&&(b<this.boxMinWidth)){b=this.boxMinWidth}if(Ext.isDefined(d)&&Ext.isDefined(this.boxMinHeight)&&(d<this.boxMinHeight)){d=this.boxMinHeight}if(Ext.isDefined(b)&&Ext.isDefined(this.boxMaxWidth)&&(b>this.boxMaxWidth)){b=this.boxMaxWidth}if(Ext.isDefined(d)&&Ext.isDefined(this.boxMaxHeight)&&(d>this.boxMaxHeight)){d=this.boxMaxHeight}if(!this.boxReady){this.width=b;this.height=d;return this}if(this.cacheSizes!==false&&this.lastSize&&this.lastSize.width==b&&this.lastSize.height==d){return this}this.lastSize={width:b,height:d};var c=this.adjustSize(b,d),g=c.width,a=c.height,e;if(g!==undefined||a!==undefined){e=this.getResizeEl();if(!this.deferHeight&&g!==undefined&&a!==undefined){e.setSize(g,a)}else{if(!this.deferHeight&&a!==undefined){e.setHeight(a)}else{if(g!==undefined){e.setWidth(g)}}}this.onResize(g,a,b,d);this.fireEvent("resize",this,g,a,b,d)}return this},setWidth:function(a){return this.setSize(a)},setHeight:function(a){return this.setSize(undefined,a)},getSize:function(){return this.getResizeEl().getSize()},getWidth:function(){return this.getResizeEl().getWidth()},getHeight:function(){return this.getResizeEl().getHeight()},getOuterSize:function(){var a=this.getResizeEl();return{width:a.getWidth()+a.getMargins("lr"),height:a.getHeight()+a.getMargins("tb")}},getPosition:function(a){var b=this.getPositionEl();if(a===true){return[b.getLeft(true),b.getTop(true)]}return this.xy||b.getXY()},getBox:function(a){var c=this.getPosition(a);var b=this.getSize();b.x=c[0];b.y=c[1];return b},updateBox:function(a){this.setSize(a.width,a.height);this.setPagePosition(a.x,a.y);return this},getResizeEl:function(){return this.resizeEl||this.el},setAutoScroll:function(a){if(this.rendered){this.getContentTarget().setOverflow(a?"auto":"")}this.autoScroll=a;return this},setPosition:function(a,g){if(a&&typeof a[1]=="number"){g=a[1];a=a[0]}this.x=a;this.y=g;if(!this.boxReady){return this}var b=this.adjustPosition(a,g);var e=b.x,d=b.y;var c=this.getPositionEl();if(e!==undefined||d!==undefined){if(e!==undefined&&d!==undefined){c.setLeftTop(e,d)}else{if(e!==undefined){c.setLeft(e)}else{if(d!==undefined){c.setTop(d)}}}this.onPosition(e,d);this.fireEvent("move",this,e,d)}return this},setPagePosition:function(a,c){if(a&&typeof a[1]=="number"){c=a[1];a=a[0]}this.pageX=a;this.pageY=c;if(!this.boxReady){return}if(a===undefined||c===undefined){return}var b=this.getPositionEl().translatePoints(a,c);this.setPosition(b.left,b.top);return this},afterRender:function(){Ext.BoxComponent.superclass.afterRender.call(this);if(this.resizeEl){this.resizeEl=Ext.get(this.resizeEl)}if(this.positionEl){this.positionEl=Ext.get(this.positionEl)}this.boxReady=true;Ext.isDefined(this.autoScroll)&&this.setAutoScroll(this.autoScroll);this.setSize(this.width,this.height);if(this.x||this.y){this.setPosition(this.x,this.y)}else{if(this.pageX||this.pageY){this.setPagePosition(this.pageX,this.pageY)}}},syncSize:function(){delete this.lastSize;this.setSize(this.autoWidth?undefined:this.getResizeEl().getWidth(),this.autoHeight?undefined:this.getResizeEl().getHeight());return this},onResize:function(d,b,a,c){},onPosition:function(a,b){},adjustSize:function(a,b){if(this.autoWidth){a="auto"}if(this.autoHeight){b="auto"}return{width:a,height:b}},adjustPosition:function(a,b){return{x:a,y:b}}});Ext.reg("box",Ext.BoxComponent);Ext.Spacer=Ext.extend(Ext.BoxComponent,{autoEl:"div"});Ext.reg("spacer",Ext.Spacer);Ext.SplitBar=function(c,e,b,d,a){this.el=Ext.get(c,true);this.el.dom.unselectable="on";this.resizingEl=Ext.get(e,true);this.orientation=b||Ext.SplitBar.HORIZONTAL;this.minSize=0;this.maxSize=2000;this.animate=false;this.useShim=false;this.shim=null;if(!a){this.proxy=Ext.SplitBar.createProxy(this.orientation)}else{this.proxy=Ext.get(a).dom}this.dd=new Ext.dd.DDProxy(this.el.dom.id,"XSplitBars",{dragElId:this.proxy.id});this.dd.b4StartDrag=this.onStartProxyDrag.createDelegate(this);this.dd.endDrag=this.onEndProxyDrag.createDelegate(this);this.dragSpecs={};this.adapter=new Ext.SplitBar.BasicLayoutAdapter();this.adapter.init(this);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.placement=d||(this.el.getX()>this.resizingEl.getX()?Ext.SplitBar.LEFT:Ext.SplitBar.RIGHT);this.el.addClass("x-splitbar-h")}else{this.placement=d||(this.el.getY()>this.resizingEl.getY()?Ext.SplitBar.TOP:Ext.SplitBar.BOTTOM);this.el.addClass("x-splitbar-v")}this.addEvents("resize","moved","beforeresize","beforeapply");Ext.SplitBar.superclass.constructor.call(this)};Ext.extend(Ext.SplitBar,Ext.util.Observable,{onStartProxyDrag:function(a,e){this.fireEvent("beforeresize",this);this.overlay=Ext.DomHelper.append(document.body,{cls:"x-drag-overlay",html:"&#160;"},true);this.overlay.unselectable();this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();Ext.get(this.proxy).setDisplayed("block");var c=this.adapter.getElementSize(this);this.activeMinSize=this.getMinimumSize();this.activeMaxSize=this.getMaximumSize();var d=c-this.activeMinSize;var b=Math.max(this.activeMaxSize-c,0);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.dd.resetConstraints();this.dd.setXConstraint(this.placement==Ext.SplitBar.LEFT?d:b,this.placement==Ext.SplitBar.LEFT?b:d,this.tickSize);this.dd.setYConstraint(0,0)}else{this.dd.resetConstraints();this.dd.setXConstraint(0,0);this.dd.setYConstraint(this.placement==Ext.SplitBar.TOP?d:b,this.placement==Ext.SplitBar.TOP?b:d,this.tickSize)}this.dragSpecs.startSize=c;this.dragSpecs.startPoint=[a,e];Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd,a,e)},onEndProxyDrag:function(c){Ext.get(this.proxy).setDisplayed(false);var b=Ext.lib.Event.getXY(c);if(this.overlay){Ext.destroy(this.overlay);delete this.overlay}var a;if(this.orientation==Ext.SplitBar.HORIZONTAL){a=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.LEFT?b[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-b[0])}else{a=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.TOP?b[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-b[1])}a=Math.min(Math.max(a,this.activeMinSize),this.activeMaxSize);if(a!=this.dragSpecs.startSize){if(this.fireEvent("beforeapply",this,a)!==false){this.adapter.setElementSize(this,a);this.fireEvent("moved",this,a);this.fireEvent("resize",this,a)}}},getAdapter:function(){return this.adapter},setAdapter:function(a){this.adapter=a;this.adapter.init(this)},getMinimumSize:function(){return this.minSize},setMinimumSize:function(a){this.minSize=a},getMaximumSize:function(){return this.maxSize},setMaximumSize:function(a){this.maxSize=a},setCurrentSize:function(b){var a=this.animate;this.animate=false;this.adapter.setElementSize(this,b);this.animate=a},destroy:function(a){Ext.destroy(this.shim,Ext.get(this.proxy));this.dd.unreg();if(a){this.el.remove()}this.purgeListeners()}});Ext.SplitBar.createProxy=function(b){var c=new Ext.Element(document.createElement("div"));document.body.appendChild(c.dom);c.unselectable();var a="x-splitbar-proxy";c.addClass(a+" "+(b==Ext.SplitBar.HORIZONTAL?a+"-h":a+"-v"));return c.dom};Ext.SplitBar.BasicLayoutAdapter=function(){};Ext.SplitBar.BasicLayoutAdapter.prototype={init:function(a){},getElementSize:function(a){if(a.orientation==Ext.SplitBar.HORIZONTAL){return a.resizingEl.getWidth()}else{return a.resizingEl.getHeight()}},setElementSize:function(b,a,c){if(b.orientation==Ext.SplitBar.HORIZONTAL){if(!b.animate){b.resizingEl.setWidth(a);if(c){c(b,a)}}else{b.resizingEl.setWidth(a,true,0.1,c,"easeOut")}}else{if(!b.animate){b.resizingEl.setHeight(a);if(c){c(b,a)}}else{b.resizingEl.setHeight(a,true,0.1,c,"easeOut")}}}};Ext.SplitBar.AbsoluteLayoutAdapter=function(a){this.basic=new Ext.SplitBar.BasicLayoutAdapter();this.container=Ext.get(a)};Ext.SplitBar.AbsoluteLayoutAdapter.prototype={init:function(a){this.basic.init(a)},getElementSize:function(a){return this.basic.getElementSize(a)},setElementSize:function(b,a,c){this.basic.setElementSize(b,a,this.moveSplitter.createDelegate(this,[b]))},moveSplitter:function(a){var b=Ext.SplitBar;switch(a.placement){case b.LEFT:a.el.setX(a.resizingEl.getRight());break;case b.RIGHT:a.el.setStyle("right",(this.container.getWidth()-a.resizingEl.getLeft())+"px");break;case b.TOP:a.el.setY(a.resizingEl.getBottom());break;case b.BOTTOM:a.el.setY(a.resizingEl.getTop()-a.el.getHeight());break}}};Ext.SplitBar.VERTICAL=1;Ext.SplitBar.HORIZONTAL=2;Ext.SplitBar.LEFT=1;Ext.SplitBar.RIGHT=2;Ext.SplitBar.TOP=3;Ext.SplitBar.BOTTOM=4;Ext.Container=Ext.extend(Ext.BoxComponent,{bufferResize:50,autoDestroy:true,forceLayout:false,defaultType:"panel",resizeEvent:"resize",bubbleEvents:["add","remove"],initComponent:function(){Ext.Container.superclass.initComponent.call(this);this.addEvents("afterlayout","beforeadd","beforeremove","add","remove");var a=this.items;if(a){delete this.items;this.add(a)}},initItems:function(){if(!this.items){this.items=new Ext.util.MixedCollection(false,this.getComponentId);this.getLayout()}},setLayout:function(a){if(this.layout&&this.layout!=a){this.layout.setContainer(null)}this.layout=a;this.initItems();a.setContainer(this)},afterRender:function(){Ext.Container.superclass.afterRender.call(this);if(!this.layout){this.layout="auto"}if(Ext.isObject(this.layout)&&!this.layout.layout){this.layoutConfig=this.layout;this.layout=this.layoutConfig.type}if(Ext.isString(this.layout)){this.layout=new Ext.Container.LAYOUTS[this.layout.toLowerCase()](this.layoutConfig)}this.setLayout(this.layout);if(this.activeItem!==undefined&&this.layout.setActiveItem){var a=this.activeItem;delete this.activeItem;this.layout.setActiveItem(a)}if(!this.ownerCt){this.doLayout(false,true)}if(this.monitorResize===true){Ext.EventManager.onWindowResize(this.doLayout,this,[false])}},getLayoutTarget:function(){return this.el},getComponentId:function(a){return a.getItemId()},add:function(b){this.initItems();var e=arguments.length>1;if(e||Ext.isArray(b)){var a=[];Ext.each(e?arguments:b,function(h){a.push(this.add(h))},this);return a}var g=this.lookupComponent(this.applyDefaults(b));var d=this.items.length;if(this.fireEvent("beforeadd",this,g,d)!==false&&this.onBeforeAdd(g)!==false){this.items.add(g);g.onAdded(this,d);this.onAdd(g);this.fireEvent("add",this,g,d)}return g},onAdd:function(a){},onAdded:function(a,b){this.ownerCt=a;this.initRef();this.cascade(function(d){d.initRef()});this.fireEvent("added",this,a,b)},insert:function(e,b){var d=arguments,h=d.length,a=[],g,j;this.initItems();if(h>2){for(g=h-1;g>=1;--g){a.push(this.insert(e,d[g]))}return a}j=this.lookupComponent(this.applyDefaults(b));e=Math.min(e,this.items.length);if(this.fireEvent("beforeadd",this,j,e)!==false&&this.onBeforeAdd(j)!==false){if(j.ownerCt==this){this.items.remove(j)}this.items.insert(e,j);j.onAdded(this,e);this.onAdd(j);this.fireEvent("add",this,j,e)}return j},applyDefaults:function(b){var a=this.defaults;if(a){if(Ext.isFunction(a)){a=a.call(this,b)}if(Ext.isString(b)){b=Ext.ComponentMgr.get(b);Ext.apply(b,a)}else{if(!b.events){Ext.applyIf(b.isAction?b.initialConfig:b,a)}else{Ext.apply(b,a)}}}return b},onBeforeAdd:function(a){if(a.ownerCt){a.ownerCt.remove(a,false)}if(this.hideBorders===true){a.border=(a.border===true)}},remove:function(a,b){this.initItems();var d=this.getComponent(a);if(d&&this.fireEvent("beforeremove",this,d)!==false){this.doRemove(d,b);this.fireEvent("remove",this,d)}return d},onRemove:function(a){},doRemove:function(e,d){var b=this.layout,a=b&&this.rendered;if(a){b.onRemove(e)}this.items.remove(e);e.onRemoved();this.onRemove(e);if(d===true||(d!==false&&this.autoDestroy)){e.destroy()}if(a){b.afterRemove(e)}},removeAll:function(c){this.initItems();var e,g=[],b=[];this.items.each(function(h){g.push(h)});for(var d=0,a=g.length;d<a;++d){e=g[d];this.remove(e,c);if(e.ownerCt!==this){b.push(e)}}return b},getComponent:function(a){if(Ext.isObject(a)){a=a.getItemId()}return this.items.get(a)},lookupComponent:function(a){if(Ext.isString(a)){return Ext.ComponentMgr.get(a)}else{if(!a.events){return this.createComponent(a)}}return a},createComponent:function(a,d){if(a.render){return a}var b=Ext.create(Ext.apply({ownerCt:this},a),d||this.defaultType);delete b.initialConfig.ownerCt;delete b.ownerCt;return b},canLayout:function(){var a=this.getVisibilityEl();return a&&a.dom&&!a.isStyle("display","none")},doLayout:function(g,e){var k=this.rendered,j=e||this.forceLayout;if(this.collapsed||!this.canLayout()){this.deferLayout=this.deferLayout||!g;if(!j){return}g=g&&!this.deferLayout}else{delete this.deferLayout}if(k&&this.layout){this.layout.layout()}if(g!==true&&this.items){var d=this.items.items;for(var b=0,a=d.length;b<a;b++){var h=d[b];if(h.doLayout){h.doLayout(false,j)}}}if(k){this.onLayout(g,j)}this.hasLayout=true;delete this.forceLayout},onLayout:Ext.emptyFn,shouldBufferLayout:function(){var a=this.hasLayout;if(this.ownerCt){return a?!this.hasLayoutPending():false}return a},hasLayoutPending:function(){var a=false;this.ownerCt.bubble(function(b){if(b.layoutPending){a=true;return false}});return a},onShow:function(){Ext.Container.superclass.onShow.call(this);if(Ext.isDefined(this.deferLayout)){delete this.deferLayout;this.doLayout(true)}},getLayout:function(){if(!this.layout){var a=new Ext.layout.AutoLayout(this.layoutConfig);this.setLayout(a)}return this.layout},beforeDestroy:function(){var a;if(this.items){while(a=this.items.first()){this.doRemove(a,true)}}if(this.monitorResize){Ext.EventManager.removeResizeListener(this.doLayout,this)}Ext.destroy(this.layout);Ext.Container.superclass.beforeDestroy.call(this)},cascade:function(g,e,b){if(g.apply(e||this,b||[this])!==false){if(this.items){var d=this.items.items;for(var c=0,a=d.length;c<a;c++){if(d[c].cascade){d[c].cascade(g,e,b)}else{g.apply(e||d[c],b||[d[c]])}}}}return this},findById:function(c){var a=null,b=this;this.cascade(function(d){if(b!=d&&d.id===c){a=d;return false}});return a},findByType:function(b,a){return this.findBy(function(d){return d.isXType(b,a)})},find:function(b,a){return this.findBy(function(d){return d[b]===a})},findBy:function(d,c){var a=[],b=this;this.cascade(function(e){if(b!=e&&d.call(c||e,e,b)===true){a.push(e)}});return a},get:function(a){return this.getComponent(a)}});Ext.Container.LAYOUTS={};Ext.reg("container",Ext.Container);Ext.layout.ContainerLayout=Ext.extend(Object,{monitorResize:false,activeItem:null,constructor:function(a){this.id=Ext.id(null,"ext-layout-");Ext.apply(this,a)},type:"container",IEMeasureHack:function(k,g){var a=k.dom.childNodes,b=a.length,n,m=[],l,h,j;for(h=0;h<b;h++){n=a[h];l=Ext.get(n);if(l){m[h]=l.getStyle("display");l.setStyle({display:"none"})}}j=k?k.getViewSize(g):{};for(h=0;h<b;h++){n=a[h];l=Ext.get(n);if(l){l.setStyle({display:m[h]})}}return j},getLayoutTargetSize:Ext.EmptyFn,layout:function(){var a=this.container,b=a.getLayoutTarget();if(!(this.hasLayout||Ext.isEmpty(this.targetCls))){b.addClass(this.targetCls)}this.onLayout(a,b);a.fireEvent("afterlayout",a,this)},onLayout:function(a,b){this.renderAll(a,b)},isValidParent:function(b,a){return a&&b.getPositionEl().dom.parentNode==(a.dom||a)},renderAll:function(e,g){var b=e.items.items,d,h,a=b.length;for(d=0;d<a;d++){h=b[d];if(h&&(!h.rendered||!this.isValidParent(h,g))){this.renderItem(h,d,g)}}},renderItem:function(d,a,b){if(d){if(!d.rendered){d.render(b,a);this.configureItem(d)}else{if(!this.isValidParent(d,b)){if(Ext.isNumber(a)){a=b.dom.childNodes[a]}b.dom.insertBefore(d.getPositionEl().dom,a||null);d.container=b;this.configureItem(d)}}}},getRenderedItems:function(g){var e=g.getLayoutTarget(),h=g.items.items,a=h.length,d,j,b=[];for(d=0;d<a;d++){if((j=h[d]).rendered&&this.isValidParent(j,e)&&j.shouldLayout!==false){b.push(j)}}return b},configureItem:function(b){if(this.extraCls){var a=b.getPositionEl?b.getPositionEl():b;a.addClass(this.extraCls)}if(b.doLayout&&this.forceLayout){b.doLayout()}if(this.renderHidden&&b!=this.activeItem){b.hide()}},onRemove:function(b){if(this.activeItem==b){delete this.activeItem}if(b.rendered&&this.extraCls){var a=b.getPositionEl?b.getPositionEl():b;a.removeClass(this.extraCls)}},afterRemove:function(a){if(a.removeRestore){a.removeMode="container";delete a.removeRestore}},onResize:function(){var c=this.container,a;if(c.collapsed){return}if(a=c.bufferResize&&c.shouldBufferLayout()){if(!this.resizeTask){this.resizeTask=new Ext.util.DelayedTask(this.runLayout,this);this.resizeBuffer=Ext.isNumber(a)?a:50}c.layoutPending=true;this.resizeTask.delay(this.resizeBuffer)}else{this.runLayout()}},runLayout:function(){var a=this.container;this.layout();a.onLayout();delete a.layoutPending},setContainer:function(b){if(this.monitorResize&&b!=this.container){var a=this.container;if(a){a.un(a.resizeEvent,this.onResize,this)}if(b){b.on(b.resizeEvent,this.onResize,this)}}this.container=b},parseMargins:function(b){if(Ext.isNumber(b)){b=b.toString()}var c=b.split(" "),a=c.length;if(a==1){c[1]=c[2]=c[3]=c[0]}else{if(a==2){c[2]=c[0];c[3]=c[1]}else{if(a==3){c[3]=c[1]}}}return{top:parseInt(c[0],10)||0,right:parseInt(c[1],10)||0,bottom:parseInt(c[2],10)||0,left:parseInt(c[3],10)||0}},fieldTpl:(function(){var a=new Ext.Template('<div class="x-form-item {itemCls}" tabIndex="-1">','<label for="{id}" style="{labelStyle}" class="x-form-item-label">{label}{labelSeparator}</label>','<div class="x-form-element" id="x-form-el-{id}" style="{elementStyle}">','</div><div class="{clearCls}"></div>',"</div>");a.disableFormats=true;return a.compile()})(),destroy:function(){if(this.resizeTask&&this.resizeTask.cancel){this.resizeTask.cancel()}if(this.container){this.container.un(this.container.resizeEvent,this.onResize,this)}if(!Ext.isEmpty(this.targetCls)){var a=this.container.getLayoutTarget();if(a){a.removeClass(this.targetCls)}}}});Ext.layout.AutoLayout=Ext.extend(Ext.layout.ContainerLayout,{type:"auto",monitorResize:true,onLayout:function(d,g){Ext.layout.AutoLayout.superclass.onLayout.call(this,d,g);var e=this.getRenderedItems(d),a=e.length,b,h;for(b=0;b<a;b++){h=e[b];if(h.doLayout){h.doLayout(true)}}}});Ext.Container.LAYOUTS.auto=Ext.layout.AutoLayout;Ext.layout.FitLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"fit",getLayoutTargetSize:function(){var a=this.container.getLayoutTarget();if(!a){return{}}return a.getStyleSize()},onLayout:function(a,b){Ext.layout.FitLayout.superclass.onLayout.call(this,a,b);if(!a.collapsed){this.setItemSize(this.activeItem||a.items.itemAt(0),this.getLayoutTargetSize())}},setItemSize:function(b,a){if(b&&a.height>0){b.setSize(a)}}});Ext.Container.LAYOUTS.fit=Ext.layout.FitLayout;Ext.layout.CardLayout=Ext.extend(Ext.layout.FitLayout,{deferredRender:false,layoutOnCardChange:false,renderHidden:true,type:"card",setActiveItem:function(d){var a=this.activeItem,b=this.container;d=b.getComponent(d);if(d&&a!=d){if(a){a.hide();if(a.hidden!==true){return false}a.fireEvent("deactivate",a)}var c=d.doLayout&&(this.layoutOnCardChange||!d.rendered);this.activeItem=d;delete d.deferLayout;d.show();this.layout();if(c){d.doLayout()}d.fireEvent("activate",d)}},renderAll:function(a,b){if(this.deferredRender){this.renderItem(this.activeItem,undefined,b)}else{Ext.layout.CardLayout.superclass.renderAll.call(this,a,b)}}});Ext.Container.LAYOUTS.card=Ext.layout.CardLayout;Ext.layout.AnchorLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"anchor",defaultAnchor:"100%",parseAnchorRE:/^(r|right|b|bottom)$/i,getLayoutTargetSize:function(){var b=this.container.getLayoutTarget(),a={};if(b){a=b.getViewSize();if(Ext.isIE&&Ext.isStrict&&a.width==0){a=b.getStyleSize()}a.width-=b.getPadding("lr");a.height-=b.getPadding("tb")}return a},onLayout:function(m,w){Ext.layout.AnchorLayout.superclass.onLayout.call(this,m,w);var p=this.getLayoutTargetSize(),k=p.width,o=p.height,q=w.getStyle("overflow"),n=this.getRenderedItems(m),t=n.length,g=[],j,a,v,l,h,c,e,d,u=0,s,b;if(k<20&&o<20){return}if(m.anchorSize){if(typeof m.anchorSize=="number"){a=m.anchorSize}else{a=m.anchorSize.width;v=m.anchorSize.height}}else{a=m.initialConfig.width;v=m.initialConfig.height}for(s=0;s<t;s++){l=n[s];b=l.getPositionEl();if(!l.anchor&&l.items&&!Ext.isNumber(l.width)&&!(Ext.isIE6&&Ext.isStrict)){l.anchor=this.defaultAnchor}if(l.anchor){h=l.anchorSpec;if(!h){d=l.anchor.split(" ");l.anchorSpec=h={right:this.parseAnchor(d[0],l.initialConfig.width,a),bottom:this.parseAnchor(d[1],l.initialConfig.height,v)}}c=h.right?this.adjustWidthAnchor(h.right(k)-b.getMargins("lr"),l):undefined;e=h.bottom?this.adjustHeightAnchor(h.bottom(o)-b.getMargins("tb"),l):undefined;if(c||e){g.push({component:l,width:c||undefined,height:e||undefined})}}}for(s=0,t=g.length;s<t;s++){j=g[s];j.component.setSize(j.width,j.height)}if(q&&q!="hidden"&&!this.adjustmentPass){var r=this.getLayoutTargetSize();if(r.width!=p.width||r.height!=p.height){this.adjustmentPass=true;this.onLayout(m,w)}}delete this.adjustmentPass},parseAnchor:function(c,h,b){if(c&&c!="none"){var e;if(this.parseAnchorRE.test(c)){var g=b-h;return function(a){if(a!==e){e=a;return a-g}}}else{if(c.indexOf("%")!=-1){var d=parseFloat(c.replace("%",""))*0.01;return function(a){if(a!==e){e=a;return Math.floor(a*d)}}}else{c=parseInt(c,10);if(!isNaN(c)){return function(a){if(a!==e){e=a;return a+c}}}}}}return false},adjustWidthAnchor:function(b,a){return b},adjustHeightAnchor:function(b,a){return b}});Ext.Container.LAYOUTS.anchor=Ext.layout.AnchorLayout;Ext.layout.ColumnLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"column",extraCls:"x-column",scrollOffset:0,targetCls:"x-column-layout-ct",isValidParent:function(b,a){return this.innerCt&&b.getPositionEl().dom.parentNode==this.innerCt.dom},getLayoutTargetSize:function(){var b=this.container.getLayoutTarget(),a;if(b){a=b.getViewSize();if(Ext.isIE&&Ext.isStrict&&a.width==0){a=b.getStyleSize()}a.width-=b.getPadding("lr");a.height-=b.getPadding("tb")}return a},renderAll:function(a,b){if(!this.innerCt){this.innerCt=b.createChild({cls:"x-column-inner"});this.innerCt.createChild({cls:"x-clear"})}Ext.layout.ColumnLayout.superclass.renderAll.call(this,a,this.innerCt)},onLayout:function(e,k){var g=e.items.items,j=g.length,n,b,a,o=[];this.renderAll(e,k);var r=this.getLayoutTargetSize();if(r.width<1&&r.height<1){return}var p=r.width-this.scrollOffset,d=r.height,q=p;this.innerCt.setWidth(p);for(b=0;b<j;b++){n=g[b];a=n.getPositionEl().getMargins("lr");o[b]=a;if(!n.columnWidth){q-=(n.getWidth()+a)}}q=q<0?0:q;for(b=0;b<j;b++){n=g[b];a=o[b];if(n.columnWidth){n.setSize(Math.floor(n.columnWidth*q)-a)}}if(Ext.isIE){if(b=k.getStyle("overflow")&&b!="hidden"&&!this.adjustmentPass){var l=this.getLayoutTargetSize();if(l.width!=r.width){this.adjustmentPass=true;this.onLayout(e,k)}}}delete this.adjustmentPass}});Ext.Container.LAYOUTS.column=Ext.layout.ColumnLayout;Ext.layout.BorderLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,rendered:false,type:"border",targetCls:"x-border-layout-ct",getLayoutTargetSize:function(){var a=this.container.getLayoutTarget();return a?a.getViewSize():{}},onLayout:function(g,I){var j,B,F,o,x=g.items.items,C=x.length;if(!this.rendered){j=[];for(B=0;B<C;B++){F=x[B];o=F.region;if(F.collapsed){j.push(F)}F.collapsed=false;if(!F.rendered){F.render(I,B);F.getPositionEl().addClass("x-border-panel")}this[o]=o!="center"&&F.split?new Ext.layout.BorderLayout.SplitRegion(this,F.initialConfig,o):new Ext.layout.BorderLayout.Region(this,F.initialConfig,o);this[o].render(I,F)}this.rendered=true}var v=this.getLayoutTargetSize();if(v.width<20||v.height<20){if(j){this.restoreCollapsed=j}return}else{if(this.restoreCollapsed){j=this.restoreCollapsed;delete this.restoreCollapsed}}var t=v.width,D=v.height,r=t,A=D,p=0,q=0,y=this.north,u=this.south,l=this.west,E=this.east,F=this.center,H,z,d,G;if(!F&&Ext.layout.BorderLayout.WARN!==false){throw"No center region defined in BorderLayout "+g.id}if(y&&y.isVisible()){H=y.getSize();z=y.getMargins();H.width=t-(z.left+z.right);H.x=z.left;H.y=z.top;p=H.height+H.y+z.bottom;A-=p;y.applyLayout(H)}if(u&&u.isVisible()){H=u.getSize();z=u.getMargins();H.width=t-(z.left+z.right);H.x=z.left;G=(H.height+z.top+z.bottom);H.y=D-G+z.top;A-=G;u.applyLayout(H)}if(l&&l.isVisible()){H=l.getSize();z=l.getMargins();H.height=A-(z.top+z.bottom);H.x=z.left;H.y=p+z.top;d=(H.width+z.left+z.right);q+=d;r-=d;l.applyLayout(H)}if(E&&E.isVisible()){H=E.getSize();z=E.getMargins();H.height=A-(z.top+z.bottom);d=(H.width+z.left+z.right);H.x=t-d+z.left;H.y=p+z.top;r-=d;E.applyLayout(H)}if(F){z=F.getMargins();var k={x:q+z.left,y:p+z.top,width:r-(z.left+z.right),height:A-(z.top+z.bottom)};F.applyLayout(k)}if(j){for(B=0,C=j.length;B<C;B++){j[B].collapse(false)}}if(Ext.isIE&&Ext.isStrict){I.repaint()}if(B=I.getStyle("overflow")&&B!="hidden"&&!this.adjustmentPass){var a=this.getLayoutTargetSize();if(a.width!=v.width||a.height!=v.height){this.adjustmentPass=true;this.onLayout(g,I)}}delete this.adjustmentPass},destroy:function(){var b=["north","south","east","west"],a,c;for(a=0;a<b.length;a++){c=this[b[a]];if(c){if(c.destroy){c.destroy()}else{if(c.split){c.split.destroy(true)}}}}Ext.layout.BorderLayout.superclass.destroy.call(this)}});Ext.layout.BorderLayout.Region=function(b,a,c){Ext.apply(this,a);this.layout=b;this.position=c;this.state={};if(typeof this.margins=="string"){this.margins=this.layout.parseMargins(this.margins)}this.margins=Ext.applyIf(this.margins||{},this.defaultMargins);if(this.collapsible){if(typeof this.cmargins=="string"){this.cmargins=this.layout.parseMargins(this.cmargins)}if(this.collapseMode=="mini"&&!this.cmargins){this.cmargins={left:0,top:0,right:0,bottom:0}}else{this.cmargins=Ext.applyIf(this.cmargins||{},c=="north"||c=="south"?this.defaultNSCMargins:this.defaultEWCMargins)}}};Ext.layout.BorderLayout.Region.prototype={collapsible:false,split:false,floatable:true,minWidth:50,minHeight:50,defaultMargins:{left:0,top:0,right:0,bottom:0},defaultNSCMargins:{left:5,top:5,right:5,bottom:5},defaultEWCMargins:{left:5,top:0,right:5,bottom:0},floatingZIndex:100,isCollapsed:false,render:function(b,c){this.panel=c;c.el.enableDisplayMode();this.targetEl=b;this.el=c.el;var a=c.getState,d=this.position;c.getState=function(){return Ext.apply(a.call(c)||{},this.state)}.createDelegate(this);if(d!="center"){c.allowQueuedExpand=false;c.on({beforecollapse:this.beforeCollapse,collapse:this.onCollapse,beforeexpand:this.beforeExpand,expand:this.onExpand,hide:this.onHide,show:this.onShow,scope:this});if(this.collapsible||this.floatable){c.collapseEl="el";c.slideAnchor=this.getSlideAnchor()}if(c.tools&&c.tools.toggle){c.tools.toggle.addClass("x-tool-collapse-"+d);c.tools.toggle.addClassOnOver("x-tool-collapse-"+d+"-over")}}},getCollapsedEl:function(){if(!this.collapsedEl){if(!this.toolTemplate){var b=new Ext.Template('<div class="x-tool x-tool-{id}">&#160;</div>');b.disableFormats=true;b.compile();Ext.layout.BorderLayout.Region.prototype.toolTemplate=b}this.collapsedEl=this.targetEl.createChild({cls:"x-layout-collapsed x-layout-collapsed-"+this.position,id:this.panel.id+"-xcollapsed"});this.collapsedEl.enableDisplayMode("block");if(this.collapseMode=="mini"){this.collapsedEl.addClass("x-layout-cmini-"+this.position);this.miniCollapsedEl=this.collapsedEl.createChild({cls:"x-layout-mini x-layout-mini-"+this.position,html:"&#160;"});this.miniCollapsedEl.addClassOnOver("x-layout-mini-over");this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this.onExpandClick,this,{stopEvent:true})}else{if(this.collapsible!==false&&!this.hideCollapseTool){var a=this.expandToolEl=this.toolTemplate.append(this.collapsedEl.dom,{id:"expand-"+this.position},true);a.addClassOnOver("x-tool-expand-"+this.position+"-over");a.on("click",this.onExpandClick,this,{stopEvent:true})}if(this.floatable!==false||this.titleCollapse){this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this[this.floatable?"collapseClick":"onExpandClick"],this)}}}return this.collapsedEl},onExpandClick:function(a){if(this.isSlid){this.panel.expand(false)}else{this.panel.expand()}},onCollapseClick:function(a){this.panel.collapse()},beforeCollapse:function(c,a){this.lastAnim=a;if(this.splitEl){this.splitEl.hide()}this.getCollapsedEl().show();var b=this.panel.getEl();this.originalZIndex=b.getStyle("z-index");b.setStyle("z-index",100);this.isCollapsed=true;this.layout.layout()},onCollapse:function(a){this.panel.el.setStyle("z-index",1);if(this.lastAnim===false||this.panel.animCollapse===false){this.getCollapsedEl().dom.style.visibility="visible"}else{this.getCollapsedEl().slideIn(this.panel.slideAnchor,{duration:0.2})}this.state.collapsed=true;this.panel.saveState()},beforeExpand:function(a){if(this.isSlid){this.afterSlideIn()}var b=this.getCollapsedEl();this.el.show();if(this.position=="east"||this.position=="west"){this.panel.setSize(undefined,b.getHeight())}else{this.panel.setSize(b.getWidth(),undefined)}b.hide();b.dom.style.visibility="hidden";this.panel.el.setStyle("z-index",this.floatingZIndex)},onExpand:function(){this.isCollapsed=false;if(this.splitEl){this.splitEl.show()}this.layout.layout();this.panel.el.setStyle("z-index",this.originalZIndex);this.state.collapsed=false;this.panel.saveState()},collapseClick:function(a){if(this.isSlid){a.stopPropagation();this.slideIn()}else{a.stopPropagation();this.slideOut()}},onHide:function(){if(this.isCollapsed){this.getCollapsedEl().hide()}else{if(this.splitEl){this.splitEl.hide()}}},onShow:function(){if(this.isCollapsed){this.getCollapsedEl().show()}else{if(this.splitEl){this.splitEl.show()}}},isVisible:function(){return !this.panel.hidden},getMargins:function(){return this.isCollapsed&&this.cmargins?this.cmargins:this.margins},getSize:function(){return this.isCollapsed?this.getCollapsedEl().getSize():this.panel.getSize()},setPanel:function(a){this.panel=a},getMinWidth:function(){return this.minWidth},getMinHeight:function(){return this.minHeight},applyLayoutCollapsed:function(a){var b=this.getCollapsedEl();b.setLeftTop(a.x,a.y);b.setSize(a.width,a.height)},applyLayout:function(a){if(this.isCollapsed){this.applyLayoutCollapsed(a)}else{this.panel.setPosition(a.x,a.y);this.panel.setSize(a.width,a.height)}},beforeSlide:function(){this.panel.beforeEffect()},afterSlide:function(){this.panel.afterEffect()},initAutoHide:function(){if(this.autoHide!==false){if(!this.autoHideHd){this.autoHideSlideTask=new Ext.util.DelayedTask(this.slideIn,this);this.autoHideHd={mouseout:function(a){if(!a.within(this.el,true)){this.autoHideSlideTask.delay(500)}},mouseover:function(a){this.autoHideSlideTask.cancel()},scope:this}}this.el.on(this.autoHideHd);this.collapsedEl.on(this.autoHideHd)}},clearAutoHide:function(){if(this.autoHide!==false){this.el.un("mouseout",this.autoHideHd.mouseout);this.el.un("mouseover",this.autoHideHd.mouseover);this.collapsedEl.un("mouseout",this.autoHideHd.mouseout);this.collapsedEl.un("mouseover",this.autoHideHd.mouseover)}},clearMonitor:function(){Ext.getDoc().un("click",this.slideInIf,this)},slideOut:function(){if(this.isSlid||this.el.hasActiveFx()){return}this.isSlid=true;var b=this.panel.tools,c,a;if(b&&b.toggle){b.toggle.hide()}this.el.show();a=this.panel.collapsed;this.panel.collapsed=false;if(this.position=="east"||this.position=="west"){c=this.panel.deferHeight;this.panel.deferHeight=false;this.panel.setSize(undefined,this.collapsedEl.getHeight());this.panel.deferHeight=c}else{this.panel.setSize(this.collapsedEl.getWidth(),undefined)}this.panel.collapsed=a;this.restoreLT=[this.el.dom.style.left,this.el.dom.style.top];this.el.alignTo(this.collapsedEl,this.getCollapseAnchor());this.el.setStyle("z-index",this.floatingZIndex+2);this.panel.el.replaceClass("x-panel-collapsed","x-panel-floating");if(this.animFloat!==false){this.beforeSlide();this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.afterSlide();this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)},scope:this,block:true})}else{this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)}},afterSlideIn:function(){this.clearAutoHide();this.isSlid=false;this.clearMonitor();this.el.setStyle("z-index","");this.panel.el.replaceClass("x-panel-floating","x-panel-collapsed");this.el.dom.style.left=this.restoreLT[0];this.el.dom.style.top=this.restoreLT[1];var a=this.panel.tools;if(a&&a.toggle){a.toggle.show()}},slideIn:function(a){if(!this.isSlid||this.el.hasActiveFx()){Ext.callback(a);return}this.isSlid=false;if(this.animFloat!==false){this.beforeSlide();this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.hide();this.afterSlide();this.afterSlideIn();Ext.callback(a)},scope:this,block:true})}else{this.el.hide();this.afterSlideIn()}},slideInIf:function(a){if(!a.within(this.el)){this.slideIn()}},anchors:{west:"left",east:"right",north:"top",south:"bottom"},sanchors:{west:"l",east:"r",north:"t",south:"b"},canchors:{west:"tl-tr",east:"tr-tl",north:"tl-bl",south:"bl-tl"},getAnchor:function(){return this.anchors[this.position]},getCollapseAnchor:function(){return this.canchors[this.position]},getSlideAnchor:function(){return this.sanchors[this.position]},getAlignAdj:function(){var a=this.cmargins;switch(this.position){case"west":return[0,0];break;case"east":return[0,0];break;case"north":return[0,0];break;case"south":return[0,0];break}},getExpandAdj:function(){var b=this.collapsedEl,a=this.cmargins;switch(this.position){case"west":return[-(a.right+b.getWidth()+a.left),0];break;case"east":return[a.right+b.getWidth()+a.left,0];break;case"north":return[0,-(a.top+a.bottom+b.getHeight())];break;case"south":return[0,a.top+a.bottom+b.getHeight()];break}},destroy:function(){if(this.autoHideSlideTask&&this.autoHideSlideTask.cancel){this.autoHideSlideTask.cancel()}Ext.destroyMembers(this,"miniCollapsedEl","collapsedEl","expandToolEl")}};Ext.layout.BorderLayout.SplitRegion=function(b,a,c){Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this,b,a,c);this.applyLayout=this.applyFns[c]};Ext.extend(Ext.layout.BorderLayout.SplitRegion,Ext.layout.BorderLayout.Region,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:false,splitSettings:{north:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.TOP,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},south:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.BOTTOM,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},east:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.RIGHT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"},west:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.LEFT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"}},applyFns:{west:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;this.panel.setPosition(c.x,c.y);var a=d.offsetWidth;b.left=(c.x+c.width-a)+"px";b.top=(c.y)+"px";b.height=Math.max(0,c.height)+"px";this.panel.setSize(c.width-a,c.height)},east:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetWidth;this.panel.setPosition(c.x+a,c.y);b.left=(c.x)+"px";b.top=(c.y)+"px";b.height=Math.max(0,c.height)+"px";this.panel.setSize(c.width-a,c.height)},north:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetHeight;this.panel.setPosition(c.x,c.y);b.left=(c.x)+"px";b.top=(c.y+c.height-a)+"px";b.width=Math.max(0,c.width)+"px";this.panel.setSize(c.width,c.height-a)},south:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetHeight;this.panel.setPosition(c.x,c.y+a);b.left=(c.x)+"px";b.top=(c.y)+"px";b.width=Math.max(0,c.width)+"px";this.panel.setSize(c.width,c.height-a)}},render:function(a,c){Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this,a,c);var d=this.position;this.splitEl=a.createChild({cls:"x-layout-split x-layout-split-"+d,html:"&#160;",id:this.panel.id+"-xsplit"});if(this.collapseMode=="mini"){this.miniSplitEl=this.splitEl.createChild({cls:"x-layout-mini x-layout-mini-"+d,html:"&#160;"});this.miniSplitEl.addClassOnOver("x-layout-mini-over");this.miniSplitEl.on("click",this.onCollapseClick,this,{stopEvent:true})}var b=this.splitSettings[d];this.split=new Ext.SplitBar(this.splitEl.dom,c.el,b.orientation);this.split.tickSize=this.tickSize;this.split.placement=b.placement;this.split.getMaximumSize=this[b.maxFn].createDelegate(this);this.split.minSize=this.minSize||this[b.minProp];this.split.on("beforeapply",this.onSplitMove,this);this.split.useShim=this.useShim===true;this.maxSize=this.maxSize||this[b.maxProp];if(c.hidden){this.splitEl.hide()}if(this.useSplitTips){this.splitEl.dom.title=this.collapsible?this.collapsibleSplitTip:this.splitTip}if(this.collapsible){this.splitEl.on("dblclick",this.onCollapseClick,this)}},getSize:function(){if(this.isCollapsed){return this.collapsedEl.getSize()}var a=this.panel.getSize();if(this.position=="north"||this.position=="south"){a.height+=this.splitEl.dom.offsetHeight}else{a.width+=this.splitEl.dom.offsetWidth}return a},getHMaxSize:function(){var b=this.maxSize||10000;var a=this.layout.center;return Math.min(b,(this.el.getWidth()+a.el.getWidth())-a.getMinWidth())},getVMaxSize:function(){var b=this.maxSize||10000;var a=this.layout.center;return Math.min(b,(this.el.getHeight()+a.el.getHeight())-a.getMinHeight())},onSplitMove:function(b,a){var c=this.panel.getSize();this.lastSplitSize=a;if(this.position=="north"||this.position=="south"){this.panel.setSize(c.width,a);this.state.height=a}else{this.panel.setSize(a,c.height);this.state.width=a}this.layout.layout();this.panel.saveState();return false},getSplitBar:function(){return this.split},destroy:function(){Ext.destroy(this.miniSplitEl,this.split,this.splitEl);Ext.layout.BorderLayout.SplitRegion.superclass.destroy.call(this)}});Ext.Container.LAYOUTS.border=Ext.layout.BorderLayout;Ext.layout.FormLayout=Ext.extend(Ext.layout.AnchorLayout,{labelSeparator:":",trackLabels:true,type:"form",onRemove:function(d){Ext.layout.FormLayout.superclass.onRemove.call(this,d);if(this.trackLabels){d.un("show",this.onFieldShow,this);d.un("hide",this.onFieldHide,this)}var b=d.getPositionEl(),a=d.getItemCt&&d.getItemCt();if(d.rendered&&a){if(b&&b.dom){b.insertAfter(a)}Ext.destroy(a);Ext.destroyMembers(d,"label","itemCt");if(d.customItemCt){Ext.destroyMembers(d,"getItemCt","customItemCt")}}},setContainer:function(a){Ext.layout.FormLayout.superclass.setContainer.call(this,a);if(a.labelAlign){a.addClass("x-form-label-"+a.labelAlign)}if(a.hideLabels){Ext.apply(this,{labelStyle:"display:none",elementStyle:"padding-left:0;",labelAdjust:0})}else{this.labelSeparator=Ext.isDefined(a.labelSeparator)?a.labelSeparator:this.labelSeparator;a.labelWidth=a.labelWidth||100;if(Ext.isNumber(a.labelWidth)){var b=Ext.isNumber(a.labelPad)?a.labelPad:5;Ext.apply(this,{labelAdjust:a.labelWidth+b,labelStyle:"width:"+a.labelWidth+"px;",elementStyle:"padding-left:"+(a.labelWidth+b)+"px"})}if(a.labelAlign=="top"){Ext.apply(this,{labelStyle:"width:auto;",labelAdjust:0,elementStyle:"padding-left:0;"})}}},isHide:function(a){return a.hideLabel||this.container.hideLabels},onFieldShow:function(a){a.getItemCt().removeClass("x-hide-"+a.hideMode);if(a.isComposite){a.doLayout()}},onFieldHide:function(a){a.getItemCt().addClass("x-hide-"+a.hideMode)},getLabelStyle:function(e){var b="",c=[this.labelStyle,e];for(var d=0,a=c.length;d<a;++d){if(c[d]){b+=c[d];if(b.substr(-1,1)!=";"){b+=";"}}}return b},renderItem:function(e,a,d){if(e&&(e.isFormField||e.fieldLabel)&&e.inputType!="hidden"){var b=this.getTemplateArgs(e);if(Ext.isNumber(a)){a=d.dom.childNodes[a]||null}if(a){e.itemCt=this.fieldTpl.insertBefore(a,b,true)}else{e.itemCt=this.fieldTpl.append(d,b,true)}if(!e.getItemCt){Ext.apply(e,{getItemCt:function(){return e.itemCt},customItemCt:true})}e.label=e.getItemCt().child("label.x-form-item-label");if(!e.rendered){e.render("x-form-el-"+e.id)}else{if(!this.isValidParent(e,d)){Ext.fly("x-form-el-"+e.id).appendChild(e.getPositionEl())}}if(this.trackLabels){if(e.hidden){this.onFieldHide(e)}e.on({scope:this,show:this.onFieldShow,hide:this.onFieldHide})}this.configureItem(e)}else{Ext.layout.FormLayout.superclass.renderItem.apply(this,arguments)}},getTemplateArgs:function(c){var a=!c.fieldLabel||c.hideLabel,b=(c.itemCls||this.container.itemCls||"")+(c.hideLabel?" x-hide-label":"");if(Ext.isIE9&&Ext.isIEQuirks&&c instanceof Ext.form.TextField){b+=" x-input-wrapper"}return{id:c.id,label:c.fieldLabel,itemCls:b,clearCls:c.clearCls||"x-form-clear-left",labelStyle:this.getLabelStyle(c.labelStyle),elementStyle:this.elementStyle||"",labelSeparator:a?"":(Ext.isDefined(c.labelSeparator)?c.labelSeparator:this.labelSeparator)}},adjustWidthAnchor:function(a,d){if(d.label&&!this.isHide(d)&&(this.container.labelAlign!="top")){var b=Ext.isIE6||(Ext.isIE&&!Ext.isStrict);return a-this.labelAdjust+(b?-3:0)}return a},adjustHeightAnchor:function(a,b){if(b.label&&!this.isHide(b)&&(this.container.labelAlign=="top")){return a-b.label.getHeight()}return a},isValidParent:function(b,a){return a&&this.container.getEl().contains(b.getPositionEl())}});Ext.Container.LAYOUTS.form=Ext.layout.FormLayout;Ext.layout.AccordionLayout=Ext.extend(Ext.layout.FitLayout,{fill:true,autoWidth:true,titleCollapse:true,hideCollapseTool:false,collapseFirst:false,animate:false,sequence:false,activeOnTop:false,type:"accordion",renderItem:function(a){if(this.animate===false){a.animCollapse=false}a.collapsible=true;if(this.autoWidth){a.autoWidth=true}if(this.titleCollapse){a.titleCollapse=true}if(this.hideCollapseTool){a.hideCollapseTool=true}if(this.collapseFirst!==undefined){a.collapseFirst=this.collapseFirst}if(!this.activeItem&&!a.collapsed){this.setActiveItem(a,true)}else{if(this.activeItem&&this.activeItem!=a){a.collapsed=true}}Ext.layout.AccordionLayout.superclass.renderItem.apply(this,arguments);a.header.addClass("x-accordion-hd");a.on("beforeexpand",this.beforeExpand,this)},onRemove:function(a){Ext.layout.AccordionLayout.superclass.onRemove.call(this,a);if(a.rendered){a.header.removeClass("x-accordion-hd")}a.un("beforeexpand",this.beforeExpand,this)},beforeExpand:function(c,b){var a=this.activeItem;if(a){if(this.sequence){delete this.activeItem;if(!a.collapsed){a.collapse({callback:function(){c.expand(b||true)},scope:this});return false}}else{a.collapse(this.animate)}}this.setActive(c);if(this.activeOnTop){c.el.dom.parentNode.insertBefore(c.el.dom,c.el.dom.parentNode.firstChild)}this.layout()},setItemSize:function(g,e){if(this.fill&&g){var d=0,c,b=this.getRenderedItems(this.container),a=b.length,h;for(c=0;c<a;c++){if((h=b[c])!=g&&!h.hidden){d+=h.header.getHeight()}}e.height-=d;g.setSize(e)}},setActiveItem:function(a){this.setActive(a,true)},setActive:function(c,b){var a=this.activeItem;c=this.container.getComponent(c);if(a!=c){if(c.rendered&&c.collapsed&&b){c.expand()}else{if(a){a.fireEvent("deactivate",a)}this.activeItem=c;c.fireEvent("activate",c)}}}});Ext.Container.LAYOUTS.accordion=Ext.layout.AccordionLayout;Ext.layout.Accordion=Ext.layout.AccordionLayout;Ext.layout.TableLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:false,type:"table",targetCls:"x-table-layout-ct",tableAttrs:null,setContainer:function(a){Ext.layout.TableLayout.superclass.setContainer.call(this,a);this.currentRow=0;this.currentColumn=0;this.cells=[]},onLayout:function(d,g){var e=d.items.items,a=e.length,h,b;if(!this.table){g.addClass("x-table-layout-ct");this.table=g.createChild(Ext.apply({tag:"table",cls:"x-table-layout",cellspacing:0,cn:{tag:"tbody"}},this.tableAttrs),null,true)}this.renderAll(d,g)},getRow:function(a){var b=this.table.tBodies[0].childNodes[a];if(!b){b=document.createElement("tr");this.table.tBodies[0].appendChild(b)}return b},getNextCell:function(j){var a=this.getNextNonSpan(this.currentColumn,this.currentRow);var g=this.currentColumn=a[0],e=this.currentRow=a[1];for(var i=e;i<e+(j.rowspan||1);i++){if(!this.cells[i]){this.cells[i]=[]}for(var d=g;d<g+(j.colspan||1);d++){this.cells[i][d]=true}}var h=document.createElement("td");if(j.cellId){h.id=j.cellId}var b="x-table-layout-cell";if(j.cellCls){b+=" "+j.cellCls}h.className=b;if(j.colspan){h.colSpan=j.colspan}if(j.rowspan){h.rowSpan=j.rowspan}this.getRow(e).appendChild(h);return h},getNextNonSpan:function(a,c){var b=this.columns;while((b&&a>=b)||(this.cells[c]&&this.cells[c][a])){if(b&&a>=b){c++;a=0}else{a++}}return[a,c]},renderItem:function(e,a,d){if(!this.table){this.table=d.createChild(Ext.apply({tag:"table",cls:"x-table-layout",cellspacing:0,cn:{tag:"tbody"}},this.tableAttrs),null,true)}if(e&&!e.rendered){e.render(this.getNextCell(e));this.configureItem(e)}else{if(e&&!this.isValidParent(e,d)){var b=this.getNextCell(e);b.insertBefore(e.getPositionEl().dom,null);e.container=Ext.get(b);this.configureItem(e)}}},isValidParent:function(b,a){return b.getPositionEl().up("table",5).dom.parentNode===(a.dom||a)},destroy:function(){delete this.table;Ext.layout.TableLayout.superclass.destroy.call(this)}});Ext.Container.LAYOUTS.table=Ext.layout.TableLayout;Ext.layout.AbsoluteLayout=Ext.extend(Ext.layout.AnchorLayout,{extraCls:"x-abs-layout-item",type:"absolute",onLayout:function(a,b){b.position();this.paddingLeft=b.getPadding("l");this.paddingTop=b.getPadding("t");Ext.layout.AbsoluteLayout.superclass.onLayout.call(this,a,b)},adjustWidthAnchor:function(b,a){return b?b-a.getPosition(true)[0]+this.paddingLeft:b},adjustHeightAnchor:function(b,a){return b?b-a.getPosition(true)[1]+this.paddingTop:b}});Ext.Container.LAYOUTS.absolute=Ext.layout.AbsoluteLayout;Ext.layout.BoxLayout=Ext.extend(Ext.layout.ContainerLayout,{defaultMargins:{left:0,top:0,right:0,bottom:0},padding:"0",pack:"start",monitorResize:true,type:"box",scrollOffset:0,extraCls:"x-box-item",targetCls:"x-box-layout-ct",innerCls:"x-box-inner",constructor:function(a){Ext.layout.BoxLayout.superclass.constructor.call(this,a);if(Ext.isString(this.defaultMargins)){this.defaultMargins=this.parseMargins(this.defaultMargins)}var d=this.overflowHandler;if(typeof d=="string"){d={type:d}}var c="none";if(d&&d.type!=undefined){c=d.type}var b=Ext.layout.boxOverflow[c];if(b[this.type]){b=b[this.type]}this.overflowHandler=new b(this,d)},onLayout:function(b,h){Ext.layout.BoxLayout.superclass.onLayout.call(this,b,h);var d=this.getLayoutTargetSize(),i=this.getVisibleItems(b),c=this.calculateChildBoxes(i,d),g=c.boxes,j=c.meta;if(d.width>0){var k=this.overflowHandler,a=j.tooNarrow?"handleOverflow":"clearOverflow";var e=k[a](c,d);if(e){if(e.targetSize){d=e.targetSize}if(e.recalculate){i=this.getVisibleItems(b);c=this.calculateChildBoxes(i,d);g=c.boxes}}}this.layoutTargetLastSize=d;this.childBoxCache=c;this.updateInnerCtSize(d,c);this.updateChildBoxes(g);this.handleTargetOverflow(d,b,h)},updateChildBoxes:function(c){for(var b=0,e=c.length;b<e;b++){var d=c[b],a=d.component;if(d.dirtySize){a.setSize(d.width,d.height)}if(isNaN(d.left)||isNaN(d.top)){continue}a.setPosition(d.left,d.top)}},updateInnerCtSize:function(c,h){var i=this.align,g=this.padding,e=c.width,a=c.height;if(this.type=="hbox"){var b=e,d=h.meta.maxHeight+g.top+g.bottom;if(i=="stretch"){d=a}else{if(i=="middle"){d=Math.max(a,d)}}}else{var d=a,b=h.meta.maxWidth+g.left+g.right;if(i=="stretch"){b=e}else{if(i=="center"){b=Math.max(e,b)}}}this.innerCt.setSize(b||undefined,d||undefined)},handleTargetOverflow:function(d,a,c){var e=c.getStyle("overflow");if(e&&e!="hidden"&&!this.adjustmentPass){var b=this.getLayoutTargetSize();if(b.width!=d.width||b.height!=d.height){this.adjustmentPass=true;this.onLayout(a,c)}}delete this.adjustmentPass},isValidParent:function(b,a){return this.innerCt&&b.getPositionEl().dom.parentNode==this.innerCt.dom},getVisibleItems:function(g){var g=g||this.container,e=g.getLayoutTarget(),h=g.items.items,a=h.length,d,j,b=[];for(d=0;d<a;d++){if((j=h[d]).rendered&&this.isValidParent(j,e)&&j.hidden!==true&&j.collapsed!==true&&j.shouldLayout!==false){b.push(j)}}return b},renderAll:function(a,b){if(!this.innerCt){this.innerCt=b.createChild({cls:this.innerCls});this.padding=this.parseMargins(this.padding)}Ext.layout.BoxLayout.superclass.renderAll.call(this,a,this.innerCt)},getLayoutTargetSize:function(){var b=this.container.getLayoutTarget(),a;if(b){a=b.getViewSize();if(Ext.isIE&&Ext.isStrict&&a.width==0){a=b.getStyleSize()}a.width-=b.getPadding("lr");a.height-=b.getPadding("tb")}return a},renderItem:function(a){if(Ext.isString(a.margins)){a.margins=this.parseMargins(a.margins)}else{if(!a.margins){a.margins=this.defaultMargins}}Ext.layout.BoxLayout.superclass.renderItem.apply(this,arguments)},destroy:function(){Ext.destroy(this.overflowHandler);Ext.layout.BoxLayout.superclass.destroy.apply(this,arguments)}});Ext.layout.boxOverflow.None=Ext.extend(Object,{constructor:function(b,a){this.layout=b;Ext.apply(this,a||{})},handleOverflow:Ext.emptyFn,clearOverflow:Ext.emptyFn});Ext.layout.boxOverflow.none=Ext.layout.boxOverflow.None;Ext.layout.boxOverflow.Menu=Ext.extend(Ext.layout.boxOverflow.None,{afterCls:"x-strip-right",noItemsMenuText:'<div class="x-toolbar-no-items">(None)</div>',constructor:function(a){Ext.layout.boxOverflow.Menu.superclass.constructor.apply(this,arguments);this.menuItems=[]},createInnerElements:function(){if(!this.afterCt){this.afterCt=this.layout.innerCt.insertSibling({cls:this.afterCls},"before")}},clearOverflow:function(a,g){var e=g.width+(this.afterCt?this.afterCt.getWidth():0),b=this.menuItems;this.hideTrigger();for(var c=0,d=b.length;c<d;c++){b.pop().component.show()}return{targetSize:{height:g.height,width:e}}},showTrigger:function(){this.createMenu();this.menuTrigger.show()},hideTrigger:function(){if(this.menuTrigger!=undefined){this.menuTrigger.hide()}},beforeMenuShow:function(h){var b=this.menuItems,a=b.length,g,e;var c=function(j,i){return j.isXType("buttongroup")&&!(i instanceof Ext.Toolbar.Separator)};this.clearMenu();h.removeAll();for(var d=0;d<a;d++){g=b[d].component;if(e&&(c(g,e)||c(e,g))){h.add("-")}this.addComponentToMenu(h,g);e=g}if(h.items.length<1){h.add(this.noItemsMenuText)}},createMenuConfig:function(c,a){var b=Ext.apply({},c.initialConfig),d=c.toggleGroup;Ext.copyTo(b,c,["iconCls","icon","itemId","disabled","handler","scope","menu"]);Ext.apply(b,{text:c.overflowText||c.text,hideOnClick:a});if(d||c.enableToggle){Ext.apply(b,{group:d,checked:c.pressed,listeners:{checkchange:function(g,e){c.toggle(e)}}})}delete b.ownerCt;delete b.xtype;delete b.id;return b},addComponentToMenu:function(b,a){if(a instanceof Ext.Toolbar.Separator){b.add("-")}else{if(Ext.isFunction(a.isXType)){if(a.isXType("splitbutton")){b.add(this.createMenuConfig(a,true))}else{if(a.isXType("button")){b.add(this.createMenuConfig(a,!a.menu))}else{if(a.isXType("buttongroup")){a.items.each(function(c){this.addComponentToMenu(b,c)},this)}}}}}},clearMenu:function(){var a=this.moreMenu;if(a&&a.items){a.items.each(function(b){delete b.menu})}},createMenu:function(){if(!this.menuTrigger){this.createInnerElements();this.menu=new Ext.menu.Menu({ownerCt:this.layout.container,listeners:{scope:this,beforeshow:this.beforeMenuShow}});this.menuTrigger=new Ext.Button({iconCls:"x-toolbar-more-icon",cls:"x-toolbar-more",menu:this.menu,renderTo:this.afterCt})}},destroy:function(){Ext.destroy(this.menu,this.menuTrigger)}});Ext.layout.boxOverflow.menu=Ext.layout.boxOverflow.Menu;Ext.layout.boxOverflow.HorizontalMenu=Ext.extend(Ext.layout.boxOverflow.Menu,{constructor:function(){Ext.layout.boxOverflow.HorizontalMenu.superclass.constructor.apply(this,arguments);var c=this,b=c.layout,a=b.calculateChildBoxes;b.calculateChildBoxes=function(d,i){var l=a.apply(b,arguments),k=l.meta,e=c.menuItems;var j=0;for(var g=0,h=e.length;g<h;g++){j+=e[g].width}k.minimumWidth+=j;k.tooNarrow=k.minimumWidth>i.width;return l}},handleOverflow:function(d,h){this.showTrigger();var k=h.width-this.afterCt.getWidth(),l=d.boxes,e=0,r=false;for(var o=0,c=l.length;o<c;o++){e+=l[o].width}var a=k-e,g=0;for(var o=0,c=this.menuItems.length;o<c;o++){var n=this.menuItems[o],m=n.component,b=n.width;if(b<a){m.show();a-=b;g++;r=true}else{break}}if(r){this.menuItems=this.menuItems.slice(g)}else{for(var j=l.length-1;j>=0;j--){var q=l[j].component,p=l[j].left+l[j].width;if(p>=k){this.menuItems.unshift({component:q,width:l[j].width});q.hide()}else{break}}}if(this.menuItems.length==0){this.hideTrigger()}return{targetSize:{height:h.height,width:k},recalculate:r}}});Ext.layout.boxOverflow.menu.hbox=Ext.layout.boxOverflow.HorizontalMenu;Ext.layout.boxOverflow.Scroller=Ext.extend(Ext.layout.boxOverflow.None,{animateScroll:true,scrollIncrement:100,wheelIncrement:3,scrollRepeatInterval:400,scrollDuration:0.4,beforeCls:"x-strip-left",afterCls:"x-strip-right",scrollerCls:"x-strip-scroller",beforeScrollerCls:"x-strip-scroller-left",afterScrollerCls:"x-strip-scroller-right",createWheelListener:function(){this.layout.innerCt.on({scope:this,mousewheel:function(a){a.stopEvent();this.scrollBy(a.getWheelDelta()*this.wheelIncrement*-1,false)}})},handleOverflow:function(a,b){this.createInnerElements();this.showScrollers()},clearOverflow:function(){this.hideScrollers()},showScrollers:function(){this.createScrollers();this.beforeScroller.show();this.afterScroller.show();this.updateScrollButtons()},hideScrollers:function(){if(this.beforeScroller!=undefined){this.beforeScroller.hide();this.afterScroller.hide()}},createScrollers:function(){if(!this.beforeScroller&&!this.afterScroller){var a=this.beforeCt.createChild({cls:String.format("{0} {1} ",this.scrollerCls,this.beforeScrollerCls)});var b=this.afterCt.createChild({cls:String.format("{0} {1}",this.scrollerCls,this.afterScrollerCls)});a.addClassOnOver(this.beforeScrollerCls+"-hover");b.addClassOnOver(this.afterScrollerCls+"-hover");a.setVisibilityMode(Ext.Element.DISPLAY);b.setVisibilityMode(Ext.Element.DISPLAY);this.beforeRepeater=new Ext.util.ClickRepeater(a,{interval:this.scrollRepeatInterval,handler:this.scrollLeft,scope:this});this.afterRepeater=new Ext.util.ClickRepeater(b,{interval:this.scrollRepeatInterval,handler:this.scrollRight,scope:this});this.beforeScroller=a;this.afterScroller=b}},destroy:function(){Ext.destroy(this.beforeScroller,this.afterScroller,this.beforeRepeater,this.afterRepeater,this.beforeCt,this.afterCt)},scrollBy:function(b,a){this.scrollTo(this.getScrollPosition()+b,a)},getItem:function(a){if(Ext.isString(a)){a=Ext.getCmp(a)}else{if(Ext.isNumber(a)){a=this.items[a]}}return a},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},updateScrollButtons:function(){if(this.beforeScroller==undefined||this.afterScroller==undefined){return}var d=this.atExtremeBefore()?"addClass":"removeClass",c=this.atExtremeAfter()?"addClass":"removeClass",a=this.beforeScrollerCls+"-disabled",b=this.afterScrollerCls+"-disabled";this.beforeScroller[d](a);this.afterScroller[c](b);this.scrolling=false},atExtremeBefore:function(){return this.getScrollPosition()===0},scrollLeft:function(a){this.scrollBy(-this.scrollIncrement,a)},scrollRight:function(a){this.scrollBy(this.scrollIncrement,a)},scrollToItem:function(d,b){d=this.getItem(d);if(d!=undefined){var a=this.getItemVisibility(d);if(!a.fullyVisible){var c=d.getBox(true,true),e=c.x;if(a.hiddenRight){e-=(this.layout.innerCt.getWidth()-c.width)}this.scrollTo(e,b)}}},getItemVisibility:function(e){var d=this.getItem(e).getBox(true,true),a=d.x,c=d.x+d.width,g=this.getScrollPosition(),b=this.layout.innerCt.getWidth()+g;return{hiddenLeft:a<g,hiddenRight:c>b,fullyVisible:a>g&&c<b}}});Ext.layout.boxOverflow.scroller=Ext.layout.boxOverflow.Scroller;Ext.layout.boxOverflow.VerticalScroller=Ext.extend(Ext.layout.boxOverflow.Scroller,{scrollIncrement:75,wheelIncrement:2,handleOverflow:function(a,b){Ext.layout.boxOverflow.VerticalScroller.superclass.handleOverflow.apply(this,arguments);return{targetSize:{height:b.height-(this.beforeCt.getHeight()+this.afterCt.getHeight()),width:b.width}}},createInnerElements:function(){var a=this.layout.innerCt;if(!this.beforeCt){this.beforeCt=a.insertSibling({cls:this.beforeCls},"before");this.afterCt=a.insertSibling({cls:this.afterCls},"after");this.createWheelListener()}},scrollTo:function(a,b){var d=this.getScrollPosition(),c=a.constrain(0,this.getMaxScrollBottom());if(c!=d&&!this.scrolling){if(b==undefined){b=this.animateScroll}this.layout.innerCt.scrollTo("top",c,b?this.getScrollAnim():false);if(b){this.scrolling=true}else{this.scrolling=false;this.updateScrollButtons()}}},getScrollPosition:function(){return parseInt(this.layout.innerCt.dom.scrollTop,10)||0},getMaxScrollBottom:function(){return this.layout.innerCt.dom.scrollHeight-this.layout.innerCt.getHeight()},atExtremeAfter:function(){return this.getScrollPosition()>=this.getMaxScrollBottom()}});Ext.layout.boxOverflow.scroller.vbox=Ext.layout.boxOverflow.VerticalScroller;Ext.layout.boxOverflow.HorizontalScroller=Ext.extend(Ext.layout.boxOverflow.Scroller,{handleOverflow:function(a,b){Ext.layout.boxOverflow.HorizontalScroller.superclass.handleOverflow.apply(this,arguments);return{targetSize:{height:b.height,width:b.width-(this.beforeCt.getWidth()+this.afterCt.getWidth())}}},createInnerElements:function(){var a=this.layout.innerCt;if(!this.beforeCt){this.afterCt=a.insertSibling({cls:this.afterCls},"before");this.beforeCt=a.insertSibling({cls:this.beforeCls},"before");this.createWheelListener()}},scrollTo:function(a,b){var d=this.getScrollPosition(),c=a.constrain(0,this.getMaxScrollRight());if(c!=d&&!this.scrolling){if(b==undefined){b=this.animateScroll}this.layout.innerCt.scrollTo("left",c,b?this.getScrollAnim():false);if(b){this.scrolling=true}else{this.scrolling=false;this.updateScrollButtons()}}},getScrollPosition:function(){return parseInt(this.layout.innerCt.dom.scrollLeft,10)||0},getMaxScrollRight:function(){return this.layout.innerCt.dom.scrollWidth-this.layout.innerCt.getWidth()},atExtremeAfter:function(){return this.getScrollPosition()>=this.getMaxScrollRight()}});Ext.layout.boxOverflow.scroller.hbox=Ext.layout.boxOverflow.HorizontalScroller;Ext.layout.HBoxLayout=Ext.extend(Ext.layout.BoxLayout,{align:"top",type:"hbox",calculateChildBoxes:function(r,b){var F=r.length,R=this.padding,D=R.top,U=R.left,y=D+R.bottom,O=U+R.right,a=b.width-this.scrollOffset,e=b.height,o=Math.max(0,e-y),P=this.pack=="start",W=this.pack=="center",A=this.pack=="end",L=0,Q=0,T=0,l=0,X=0,H=[],k,J,M,V,w,j,S,I,c,x,q,N;for(S=0;S<F;S++){k=r[S];M=k.height;J=k.width;j=!k.hasLayout&&typeof k.doLayout=="function";if(typeof J!="number"){if(k.flex&&!J){T+=k.flex}else{if(!J&&j){k.doLayout()}V=k.getSize();J=V.width;M=V.height}}w=k.margins;x=w.left+w.right;L+=x+(J||0);l+=x+(k.flex?k.minWidth||0:J);X+=x+(k.minWidth||J||0);if(typeof M!="number"){if(j){k.doLayout()}M=k.getHeight()}Q=Math.max(Q,M+w.top+w.bottom);H.push({component:k,height:M||undefined,width:J||undefined})}var K=l-a,p=X>a;var n=Math.max(0,a-L-O);if(p){for(S=0;S<F;S++){H[S].width=r[S].minWidth||r[S].width||H[S].width}}else{if(K>0){var C=[];for(var E=0,v=F;E<v;E++){var B=r[E],t=B.minWidth||0;if(B.flex){H[E].width=t}else{C.push({minWidth:t,available:H[E].width-t,index:E})}}C.sort(function(Y,i){return Y.available>i.available?1:-1});for(var S=0,v=C.length;S<v;S++){var G=C[S].index;if(G==undefined){continue}var B=r[G],m=H[G],u=m.width,t=B.minWidth,d=Math.max(t,u-Math.ceil(K/(v-S))),g=u-d;H[G].width=d;K-=g}}else{var h=n,s=T;for(S=0;S<F;S++){k=r[S];I=H[S];w=k.margins;q=w.top+w.bottom;if(P&&k.flex&&!k.width){c=Math.ceil((k.flex/s)*h);h-=c;s-=k.flex;I.width=c;I.dirtySize=true}}}}if(W){U+=n/2}else{if(A){U+=n}}for(S=0;S<F;S++){k=r[S];I=H[S];w=k.margins;U+=w.left;q=w.top+w.bottom;I.left=U;I.top=D+w.top;switch(this.align){case"stretch":N=o-q;I.height=N.constrain(k.minHeight||0,k.maxHeight||1000000);I.dirtySize=true;break;case"stretchmax":N=Q-q;I.height=N.constrain(k.minHeight||0,k.maxHeight||1000000);I.dirtySize=true;break;case"middle":var z=o-I.height-q;if(z>0){I.top=D+q+(z/2)}}U+=I.width+w.right}return{boxes:H,meta:{maxHeight:Q,nonFlexWidth:L,desiredWidth:l,minimumWidth:X,shortfall:l-a,tooNarrow:p}}}});Ext.Container.LAYOUTS.hbox=Ext.layout.HBoxLayout;Ext.layout.VBoxLayout=Ext.extend(Ext.layout.BoxLayout,{align:"left",type:"vbox",calculateChildBoxes:function(o,b){var E=o.length,R=this.padding,C=R.top,V=R.left,x=C+R.bottom,O=V+R.right,a=b.width-this.scrollOffset,c=b.height,K=Math.max(0,a-O),P=this.pack=="start",X=this.pack=="center",z=this.pack=="end",k=0,u=0,U=0,L=0,m=0,G=[],h,I,N,W,t,g,T,H,S,w,n,d,r;for(T=0;T<E;T++){h=o[T];N=h.height;I=h.width;g=!h.hasLayout&&typeof h.doLayout=="function";if(typeof N!="number"){if(h.flex&&!N){U+=h.flex}else{if(!N&&g){h.doLayout()}W=h.getSize();I=W.width;N=W.height}}t=h.margins;n=t.top+t.bottom;k+=n+(N||0);L+=n+(h.flex?h.minHeight||0:N);m+=n+(h.minHeight||N||0);if(typeof I!="number"){if(g){h.doLayout()}I=h.getWidth()}u=Math.max(u,I+t.left+t.right);G.push({component:h,height:N||undefined,width:I||undefined})}var M=L-c,l=m>c;var q=Math.max(0,(c-k-x));if(l){for(T=0,r=E;T<r;T++){G[T].height=o[T].minHeight||o[T].height||G[T].height}}else{if(M>0){var J=[];for(var D=0,r=E;D<r;D++){var A=o[D],s=A.minHeight||0;if(A.flex){G[D].height=s}else{J.push({minHeight:s,available:G[D].height-s,index:D})}}J.sort(function(Y,i){return Y.available>i.available?1:-1});for(var T=0,r=J.length;T<r;T++){var F=J[T].index;if(F==undefined){continue}var A=o[F],j=G[F],v=j.height,s=A.minHeight,B=Math.max(s,v-Math.ceil(M/(r-T))),e=v-B;G[F].height=B;M-=e}}else{var Q=q,p=U;for(T=0;T<E;T++){h=o[T];H=G[T];t=h.margins;w=t.left+t.right;if(P&&h.flex&&!h.height){S=Math.ceil((h.flex/p)*Q);Q-=S;p-=h.flex;H.height=S;H.dirtySize=true}}}}if(X){C+=q/2}else{if(z){C+=q}}for(T=0;T<E;T++){h=o[T];H=G[T];t=h.margins;C+=t.top;w=t.left+t.right;H.left=V+t.left;H.top=C;switch(this.align){case"stretch":d=K-w;H.width=d.constrain(h.minWidth||0,h.maxWidth||1000000);H.dirtySize=true;break;case"stretchmax":d=u-w;H.width=d.constrain(h.minWidth||0,h.maxWidth||1000000);H.dirtySize=true;break;case"center":var y=K-H.width-w;if(y>0){H.left=V+w+(y/2)}}C+=H.height+t.bottom}return{boxes:G,meta:{maxWidth:u,nonFlexHeight:k,desiredHeight:L,minimumHeight:m,shortfall:L-c,tooNarrow:l}}}});Ext.Container.LAYOUTS.vbox=Ext.layout.VBoxLayout;Ext.layout.ToolbarLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"toolbar",triggerWidth:18,noItemsMenuText:'<div class="x-toolbar-no-items">(None)</div>',lastOverflow:false,tableHTML:['<table cellspacing="0" class="x-toolbar-ct">',"<tbody>","<tr>",'<td class="x-toolbar-left" align="{0}">','<table cellspacing="0">',"<tbody>",'<tr class="x-toolbar-left-row"></tr>',"</tbody>","</table>","</td>",'<td class="x-toolbar-right" align="right">','<table cellspacing="0" class="x-toolbar-right-ct">',"<tbody>","<tr>","<td>",'<table cellspacing="0">',"<tbody>",'<tr class="x-toolbar-right-row"></tr>',"</tbody>","</table>","</td>","<td>",'<table cellspacing="0">',"<tbody>",'<tr class="x-toolbar-extras-row"></tr>',"</tbody>","</table>","</td>","</tr>","</tbody>","</table>","</td>","</tr>","</tbody>","</table>"].join(""),onLayout:function(e,j){if(!this.leftTr){var h=e.buttonAlign=="center"?"center":"left";j.addClass("x-toolbar-layout-ct");j.insertHtml("beforeEnd",String.format(this.tableHTML,h));this.leftTr=j.child("tr.x-toolbar-left-row",true);this.rightTr=j.child("tr.x-toolbar-right-row",true);this.extrasTr=j.child("tr.x-toolbar-extras-row",true);if(this.hiddenItem==undefined){this.hiddenItems=[]}}var k=e.buttonAlign=="right"?this.rightTr:this.leftTr,l=e.items.items,d=0;for(var b=0,g=l.length,m;b<g;b++,d++){m=l[b];if(m.isFill){k=this.rightTr;d=-1}else{if(!m.rendered){m.render(this.insertCell(m,k,d));this.configureItem(m)}else{if(!m.xtbHidden&&!this.isValidParent(m,k.childNodes[d])){var a=this.insertCell(m,k,d);a.appendChild(m.getPositionEl().dom);m.container=Ext.get(a)}}}}this.cleanup(this.leftTr);this.cleanup(this.rightTr);this.cleanup(this.extrasTr);this.fitToSize(j)},cleanup:function(b){var e=b.childNodes,a,d;for(a=e.length-1;a>=0&&(d=e[a]);a--){if(!d.firstChild){b.removeChild(d)}}},insertCell:function(e,b,a){var d=document.createElement("td");d.className="x-toolbar-cell";b.insertBefore(d,b.childNodes[a]||null);return d},hideItem:function(a){this.hiddenItems.push(a);a.xtbHidden=true;a.xtbWidth=a.getPositionEl().dom.parentNode.offsetWidth;a.hide()},unhideItem:function(a){a.show();a.xtbHidden=false;this.hiddenItems.remove(a)},getItemWidth:function(a){return a.hidden?(a.xtbWidth||0):a.getPositionEl().dom.parentNode.offsetWidth},fitToSize:function(k){if(this.container.enableOverflow===false){return}var b=k.dom.clientWidth,j=k.dom.firstChild.offsetWidth,m=b-this.triggerWidth,a=this.lastWidth||0,c=this.hiddenItems,e=c.length!=0,n=b>=a;this.lastWidth=b;if(j>b||(e&&n)){var l=this.container.items.items,h=l.length,d=0,o;for(var g=0;g<h;g++){o=l[g];if(!o.isFill){d+=this.getItemWidth(o);if(d>m){if(!(o.hidden||o.xtbHidden)){this.hideItem(o)}}else{if(o.xtbHidden){this.unhideItem(o)}}}}}e=c.length!=0;if(e){this.initMore();if(!this.lastOverflow){this.container.fireEvent("overflowchange",this.container,true);this.lastOverflow=true}}else{if(this.more){this.clearMenu();this.more.destroy();delete this.more;if(this.lastOverflow){this.container.fireEvent("overflowchange",this.container,false);this.lastOverflow=false}}}},createMenuConfig:function(c,a){var b=Ext.apply({},c.initialConfig),d=c.toggleGroup;Ext.copyTo(b,c,["iconCls","icon","itemId","disabled","handler","scope","menu"]);Ext.apply(b,{text:c.overflowText||c.text,hideOnClick:a});if(d||c.enableToggle){Ext.apply(b,{group:d,checked:c.pressed,listeners:{checkchange:function(g,e){c.toggle(e)}}})}delete b.ownerCt;delete b.xtype;delete b.id;return b},addComponentToMenu:function(b,a){if(a instanceof Ext.Toolbar.Separator){b.add("-")}else{if(Ext.isFunction(a.isXType)){if(a.isXType("splitbutton")){b.add(this.createMenuConfig(a,true))}else{if(a.isXType("button")){b.add(this.createMenuConfig(a,!a.menu))}else{if(a.isXType("buttongroup")){a.items.each(function(c){this.addComponentToMenu(b,c)},this)}}}}}},clearMenu:function(){var a=this.moreMenu;if(a&&a.items){a.items.each(function(b){delete b.menu})}},beforeMoreShow:function(h){var b=this.container.items.items,a=b.length,g,e;var c=function(j,i){return j.isXType("buttongroup")&&!(i instanceof Ext.Toolbar.Separator)};this.clearMenu();h.removeAll();for(var d=0;d<a;d++){g=b[d];if(g.xtbHidden){if(e&&(c(g,e)||c(e,g))){h.add("-")}this.addComponentToMenu(h,g);e=g}}if(h.items.length<1){h.add(this.noItemsMenuText)}},initMore:function(){if(!this.more){this.moreMenu=new Ext.menu.Menu({ownerCt:this.container,listeners:{beforeshow:this.beforeMoreShow,scope:this}});this.more=new Ext.Button({iconCls:"x-toolbar-more-icon",cls:"x-toolbar-more",menu:this.moreMenu,ownerCt:this.container});var a=this.insertCell(this.more,this.extrasTr,100);this.more.render(a)}},destroy:function(){Ext.destroy(this.more,this.moreMenu);delete this.leftTr;delete this.rightTr;delete this.extrasTr;Ext.layout.ToolbarLayout.superclass.destroy.call(this)}});Ext.Container.LAYOUTS.toolbar=Ext.layout.ToolbarLayout;Ext.layout.MenuLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"menu",setContainer:function(a){this.monitorResize=!a.floating;a.on("autosize",this.doAutoSize,this);Ext.layout.MenuLayout.superclass.setContainer.call(this,a)},renderItem:function(g,b,e){if(!this.itemTpl){this.itemTpl=Ext.layout.MenuLayout.prototype.itemTpl=new Ext.XTemplate('<li id="{itemId}" class="{itemCls}">','<tpl if="needsIcon">','<img alt="{altText}" src="{icon}" class="{iconCls}"/>',"</tpl>","</li>")}if(g&&!g.rendered){if(Ext.isNumber(b)){b=e.dom.childNodes[b]}var d=this.getItemArgs(g);g.render(g.positionEl=b?this.itemTpl.insertBefore(b,d,true):this.itemTpl.append(e,d,true));g.positionEl.menuItemId=g.getItemId();if(!d.isMenuItem&&d.needsIcon){g.positionEl.addClass("x-menu-list-item-indent")}this.configureItem(g)}else{if(g&&!this.isValidParent(g,e)){if(Ext.isNumber(b)){b=e.dom.childNodes[b]}e.dom.insertBefore(g.getActionEl().dom,b||null)}}},getItemArgs:function(d){var a=d instanceof Ext.menu.Item,b=!(a||d instanceof Ext.menu.Separator);return{isMenuItem:a,needsIcon:b&&(d.icon||d.iconCls),icon:d.icon||Ext.BLANK_IMAGE_URL,iconCls:"x-menu-item-icon "+(d.iconCls||""),itemId:"x-menu-el-"+d.id,itemCls:"x-menu-list-item ",altText:d.altText||""}},isValidParent:function(b,a){return b.el.up("li.x-menu-list-item",5).dom.parentNode===(a.dom||a)},onLayout:function(a,b){Ext.layout.MenuLayout.superclass.onLayout.call(this,a,b);this.doAutoSize()},doAutoSize:function(){var c=this.container,a=c.width;if(c.floating){if(a){c.setWidth(a)}else{if(Ext.isIE){c.setWidth(Ext.isStrict&&(Ext.isIE7||Ext.isIE8||Ext.isIE9)?"auto":c.minWidth);var d=c.getEl(),b=d.dom.offsetWidth;c.setWidth(c.getLayoutTarget().getWidth()+d.getFrameWidth("lr"))}}}}});Ext.Container.LAYOUTS.menu=Ext.layout.MenuLayout;Ext.Viewport=Ext.extend(Ext.Container,{initComponent:function(){Ext.Viewport.superclass.initComponent.call(this);document.getElementsByTagName("html")[0].className+=" x-viewport";this.el=Ext.getBody();this.el.setHeight=Ext.emptyFn;this.el.setWidth=Ext.emptyFn;this.el.setSize=Ext.emptyFn;this.el.dom.scroll="no";this.allowDomMove=false;this.autoWidth=true;this.autoHeight=true;Ext.EventManager.onWindowResize(this.fireResize,this);this.renderTo=this.el},fireResize:function(a,b){this.fireEvent("resize",this,a,b,a,b)}});Ext.reg("viewport",Ext.Viewport);Ext.Panel=Ext.extend(Ext.Container,{baseCls:"x-panel",collapsedCls:"x-panel-collapsed",maskDisabled:true,animCollapse:Ext.enableFx,headerAsText:true,buttonAlign:"right",collapsed:false,collapseFirst:true,minButtonWidth:75,elements:"body",preventBodyReset:false,padding:undefined,resizeEvent:"bodyresize",toolTarget:"header",collapseEl:"bwrap",slideAnchor:"t",disabledClass:"",deferHeight:true,expandDefaults:{duration:0.25},collapseDefaults:{duration:0.25},initComponent:function(){Ext.Panel.superclass.initComponent.call(this);this.addEvents("bodyresize","titlechange","iconchange","collapse","expand","beforecollapse","beforeexpand","beforeclose","close","activate","deactivate");if(this.unstyled){this.baseCls="x-plain"}this.toolbars=[];if(this.tbar){this.elements+=",tbar";this.topToolbar=this.createToolbar(this.tbar);this.tbar=null}if(this.bbar){this.elements+=",bbar";this.bottomToolbar=this.createToolbar(this.bbar);this.bbar=null}if(this.header===true){this.elements+=",header";this.header=null}else{if(this.headerCfg||(this.title&&this.header!==false)){this.elements+=",header"}}if(this.footerCfg||this.footer===true){this.elements+=",footer";this.footer=null}if(this.buttons){this.fbar=this.buttons;this.buttons=null}if(this.fbar){this.createFbar(this.fbar)}if(this.autoLoad){this.on("render",this.doAutoLoad,this,{delay:10})}},createFbar:function(b){var a=this.minButtonWidth;this.elements+=",footer";this.fbar=this.createToolbar(b,{buttonAlign:this.buttonAlign,toolbarCls:"x-panel-fbar",enableOverflow:false,defaults:function(d){return{minWidth:d.minWidth||a}}});this.fbar.items.each(function(d){d.minWidth=d.minWidth||this.minButtonWidth},this);this.buttons=this.fbar.items.items},createToolbar:function(b,c){var a;if(Ext.isArray(b)){b={items:b}}a=b.events?Ext.apply(b,c):this.createComponent(Ext.apply({},b,c),"toolbar");this.toolbars.push(a);return a},createElement:function(a,c){if(this[a]){c.appendChild(this[a].dom);return}if(a==="bwrap"||this.elements.indexOf(a)!=-1){if(this[a+"Cfg"]){this[a]=Ext.fly(c).createChild(this[a+"Cfg"])}else{var b=document.createElement("div");b.className=this[a+"Cls"];this[a]=Ext.get(c.appendChild(b))}if(this[a+"CssClass"]){this[a].addClass(this[a+"CssClass"])}if(this[a+"Style"]){this[a].applyStyles(this[a+"Style"])}}},onRender:function(g,e){Ext.Panel.superclass.onRender.call(this,g,e);this.createClasses();var a=this.el,h=a.dom,k,i;if(this.collapsible&&!this.hideCollapseTool){this.tools=this.tools?this.tools.slice(0):[];this.tools[this.collapseFirst?"unshift":"push"]({id:"toggle",handler:this.toggleCollapse,scope:this})}if(this.tools){i=this.tools;this.elements+=(this.header!==false)?",header":""}this.tools={};a.addClass(this.baseCls);if(h.firstChild){this.header=a.down("."+this.headerCls);this.bwrap=a.down("."+this.bwrapCls);var j=this.bwrap?this.bwrap:a;this.tbar=j.down("."+this.tbarCls);this.body=j.down("."+this.bodyCls);this.bbar=j.down("."+this.bbarCls);this.footer=j.down("."+this.footerCls);this.fromMarkup=true}if(this.preventBodyReset===true){a.addClass("x-panel-reset")}if(this.cls){a.addClass(this.cls)}if(this.buttons){this.elements+=",footer"}if(this.frame){a.insertHtml("afterBegin",String.format(Ext.Element.boxMarkup,this.baseCls));this.createElement("header",h.firstChild.firstChild.firstChild);this.createElement("bwrap",h);k=this.bwrap.dom;var c=h.childNodes[1],b=h.childNodes[2];k.appendChild(c);k.appendChild(b);var l=k.firstChild.firstChild.firstChild;this.createElement("tbar",l);this.createElement("body",l);this.createElement("bbar",l);this.createElement("footer",k.lastChild.firstChild.firstChild);if(!this.footer){this.bwrap.dom.lastChild.className+=" x-panel-nofooter"}this.ft=Ext.get(this.bwrap.dom.lastChild);this.mc=Ext.get(l)}else{this.createElement("header",h);this.createElement("bwrap",h);k=this.bwrap.dom;this.createElement("tbar",k);this.createElement("body",k);this.createElement("bbar",k);this.createElement("footer",k);if(!this.header){this.body.addClass(this.bodyCls+"-noheader");if(this.tbar){this.tbar.addClass(this.tbarCls+"-noheader")}}}if(Ext.isDefined(this.padding)){this.body.setStyle("padding",this.body.addUnits(this.padding))}if(this.border===false){this.el.addClass(this.baseCls+"-noborder");this.body.addClass(this.bodyCls+"-noborder");if(this.header){this.header.addClass(this.headerCls+"-noborder")}if(this.footer){this.footer.addClass(this.footerCls+"-noborder")}if(this.tbar){this.tbar.addClass(this.tbarCls+"-noborder")}if(this.bbar){this.bbar.addClass(this.bbarCls+"-noborder")}}if(this.bodyBorder===false){this.body.addClass(this.bodyCls+"-noborder")}this.bwrap.enableDisplayMode("block");if(this.header){this.header.unselectable();if(this.headerAsText){this.header.dom.innerHTML='<span class="'+this.headerTextCls+'">'+this.header.dom.innerHTML+"</span>";if(this.iconCls){this.setIconClass(this.iconCls)}}}if(this.floating){this.makeFloating(this.floating)}if(this.collapsible&&this.titleCollapse&&this.header){this.mon(this.header,"click",this.toggleCollapse,this);this.header.setStyle("cursor","pointer")}if(i){this.addTool.apply(this,i)}if(this.fbar){this.footer.addClass("x-panel-btns");this.fbar.ownerCt=this;this.fbar.render(this.footer);this.footer.createChild({cls:"x-clear"})}if(this.tbar&&this.topToolbar){this.topToolbar.ownerCt=this;this.topToolbar.render(this.tbar)}if(this.bbar&&this.bottomToolbar){this.bottomToolbar.ownerCt=this;this.bottomToolbar.render(this.bbar)}},setIconClass:function(b){var a=this.iconCls;this.iconCls=b;if(this.rendered&&this.header){if(this.frame){this.header.addClass("x-panel-icon");this.header.replaceClass(a,this.iconCls)}else{var e=this.header,c=e.child("img.x-panel-inline-icon");if(c){Ext.fly(c).replaceClass(a,this.iconCls)}else{var d=e.child("span."+this.headerTextCls);if(d){Ext.DomHelper.insertBefore(d.dom,{tag:"img",alt:"",src:Ext.BLANK_IMAGE_URL,cls:"x-panel-inline-icon "+this.iconCls})}}}}this.fireEvent("iconchange",this,b,a)},makeFloating:function(a){this.floating=true;this.el=new Ext.Layer(Ext.apply({},a,{shadow:Ext.isDefined(this.shadow)?this.shadow:"sides",shadowOffset:this.shadowOffset,constrain:false,shim:this.shim===false?false:undefined}),this.el)},getTopToolbar:function(){return this.topToolbar},getBottomToolbar:function(){return this.bottomToolbar},getFooterToolbar:function(){return this.fbar},addButton:function(a,c,b){if(!this.fbar){this.createFbar([])}if(c){if(Ext.isString(a)){a={text:a}}a=Ext.apply({handler:c,scope:b},a)}return this.fbar.add(a)},addTool:function(){if(!this.rendered){if(!this.tools){this.tools=[]}Ext.each(arguments,function(a){this.tools.push(a)},this);return}if(!this[this.toolTarget]){return}if(!this.toolTemplate){var h=new Ext.Template('<div class="x-tool x-tool-{id}">&#160;</div>');h.disableFormats=true;h.compile();Ext.Panel.prototype.toolTemplate=h}for(var g=0,d=arguments,c=d.length;g<c;g++){var b=d[g];if(!this.tools[b.id]){var j="x-tool-"+b.id+"-over";var e=this.toolTemplate.insertFirst(this[this.toolTarget],b,true);this.tools[b.id]=e;e.enableDisplayMode("block");this.mon(e,"click",this.createToolHandler(e,b,j,this));if(b.on){this.mon(e,b.on)}if(b.hidden){e.hide()}if(b.qtip){if(Ext.isObject(b.qtip)){Ext.QuickTips.register(Ext.apply({target:e.id},b.qtip))}else{e.dom.qtip=b.qtip}}e.addClassOnOver(j)}}},onLayout:function(b,a){Ext.Panel.superclass.onLayout.apply(this,arguments);if(this.hasLayout&&this.toolbars.length>0){Ext.each(this.toolbars,function(c){c.doLayout(undefined,a)});this.syncHeight()}},syncHeight:function(){var b=this.toolbarHeight,c=this.body,a=this.lastSize.height,d;if(this.autoHeight||!Ext.isDefined(a)||a=="auto"){return}if(b!=this.getToolbarHeight()){b=Math.max(0,a-this.getFrameHeight());c.setHeight(b);d=c.getSize();this.toolbarHeight=this.getToolbarHeight();this.onBodyResize(d.width,d.height)}},onShow:function(){if(this.floating){return this.el.show()}Ext.Panel.superclass.onShow.call(this)},onHide:function(){if(this.floating){return this.el.hide()}Ext.Panel.superclass.onHide.call(this)},createToolHandler:function(c,a,d,b){return function(g){c.removeClass(d);if(a.stopEvent!==false){g.stopEvent()}if(a.handler){a.handler.call(a.scope||c,g,c,b,a)}}},afterRender:function(){if(this.floating&&!this.hidden){this.el.show()}if(this.title){this.setTitle(this.title)}Ext.Panel.superclass.afterRender.call(this);if(this.collapsed){this.collapsed=false;this.collapse(false)}this.initEvents()},getKeyMap:function(){if(!this.keyMap){this.keyMap=new Ext.KeyMap(this.el,this.keys)}return this.keyMap},initEvents:function(){if(this.keys){this.getKeyMap()}if(this.draggable){this.initDraggable()}if(this.toolbars.length>0){Ext.each(this.toolbars,function(a){a.doLayout();a.on({scope:this,afterlayout:this.syncHeight,remove:this.syncHeight})},this);this.syncHeight()}},initDraggable:function(){this.dd=new Ext.Panel.DD(this,Ext.isBoolean(this.draggable)?null:this.draggable)},beforeEffect:function(a){if(this.floating){this.el.beforeAction()}if(a!==false){this.el.addClass("x-panel-animated")}},afterEffect:function(a){this.syncShadow();this.el.removeClass("x-panel-animated")},createEffect:function(c,b,d){var e={scope:d,block:true};if(c===true){e.callback=b;return e}else{if(!c.callback){e.callback=b}else{e.callback=function(){b.call(d);Ext.callback(c.callback,c.scope)}}}return Ext.applyIf(e,c)},collapse:function(b){if(this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforecollapse",this,b)===false){return}var a=b===true||(b!==false&&this.animCollapse);this.beforeEffect(a);this.onCollapse(a,b);return this},onCollapse:function(a,b){if(a){this[this.collapseEl].slideOut(this.slideAnchor,Ext.apply(this.createEffect(b||true,this.afterCollapse,this),this.collapseDefaults))}else{this[this.collapseEl].hide(this.hideMode);this.afterCollapse(false)}},afterCollapse:function(a){this.collapsed=true;this.el.addClass(this.collapsedCls);if(a!==false){this[this.collapseEl].hide(this.hideMode)}this.afterEffect(a);this.cascade(function(b){if(b.lastSize){b.lastSize={width:undefined,height:undefined}}});this.fireEvent("collapse",this)},expand:function(b){if(!this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforeexpand",this,b)===false){return}var a=b===true||(b!==false&&this.animCollapse);this.el.removeClass(this.collapsedCls);this.beforeEffect(a);this.onExpand(a,b);return this},onExpand:function(a,b){if(a){this[this.collapseEl].slideIn(this.slideAnchor,Ext.apply(this.createEffect(b||true,this.afterExpand,this),this.expandDefaults))}else{this[this.collapseEl].show(this.hideMode);this.afterExpand(false)}},afterExpand:function(a){this.collapsed=false;if(a!==false){this[this.collapseEl].show(this.hideMode)}this.afterEffect(a);if(this.deferLayout){delete this.deferLayout;this.doLayout(true)}this.fireEvent("expand",this)},toggleCollapse:function(a){this[this.collapsed?"expand":"collapse"](a);return this},onDisable:function(){if(this.rendered&&this.maskDisabled){this.el.mask()}Ext.Panel.superclass.onDisable.call(this)},onEnable:function(){if(this.rendered&&this.maskDisabled){this.el.unmask()}Ext.Panel.superclass.onEnable.call(this)},onResize:function(g,d,c,e){var a=g,b=d;if(Ext.isDefined(a)||Ext.isDefined(b)){if(!this.collapsed){if(Ext.isNumber(a)){this.body.setWidth(a=this.adjustBodyWidth(a-this.getFrameWidth()))}else{if(a=="auto"){a=this.body.setWidth("auto").dom.offsetWidth}else{a=this.body.dom.offsetWidth}}if(this.tbar){this.tbar.setWidth(a);if(this.topToolbar){this.topToolbar.setSize(a)}}if(this.bbar){this.bbar.setWidth(a);if(this.bottomToolbar){this.bottomToolbar.setSize(a);if(Ext.isIE){this.bbar.setStyle("position","static");this.bbar.setStyle("position","")}}}if(this.footer){this.footer.setWidth(a);if(this.fbar){this.fbar.setSize(Ext.isIE?(a-this.footer.getFrameWidth("lr")):"auto")}}if(Ext.isNumber(b)){b=Math.max(0,b-this.getFrameHeight());this.body.setHeight(b)}else{if(b=="auto"){this.body.setHeight(b)}}if(this.disabled&&this.el._mask){this.el._mask.setSize(this.el.dom.clientWidth,this.el.getHeight())}}else{this.queuedBodySize={width:a,height:b};if(!this.queuedExpand&&this.allowQueuedExpand!==false){this.queuedExpand=true;this.on("expand",function(){delete this.queuedExpand;this.onResize(this.queuedBodySize.width,this.queuedBodySize.height)},this,{single:true})}}this.onBodyResize(a,b)}this.syncShadow();Ext.Panel.superclass.onResize.call(this,g,d,c,e)},onBodyResize:function(a,b){this.fireEvent("bodyresize",this,a,b)},getToolbarHeight:function(){var a=0;if(this.rendered){Ext.each(this.toolbars,function(b){a+=b.getHeight()},this)}return a},adjustBodyHeight:function(a){return a},adjustBodyWidth:function(a){return a},onPosition:function(){this.syncShadow()},getFrameWidth:function(){var b=this.el.getFrameWidth("lr")+this.bwrap.getFrameWidth("lr");if(this.frame){var a=this.bwrap.dom.firstChild;b+=(Ext.fly(a).getFrameWidth("l")+Ext.fly(a.firstChild).getFrameWidth("r"));b+=this.mc.getFrameWidth("lr")}return b},getFrameHeight:function(){var a=this.el.getFrameWidth("tb")+this.bwrap.getFrameWidth("tb");a+=(this.tbar?this.tbar.getHeight():0)+(this.bbar?this.bbar.getHeight():0);if(this.frame){a+=this.el.dom.firstChild.offsetHeight+this.ft.dom.offsetHeight+this.mc.getFrameWidth("tb")}else{a+=(this.header?this.header.getHeight():0)+(this.footer?this.footer.getHeight():0)}return a},getInnerWidth:function(){return this.getSize().width-this.getFrameWidth()},getInnerHeight:function(){return this.body.getHeight()},syncShadow:function(){if(this.floating){this.el.sync(true)}},getLayoutTarget:function(){return this.body},getContentTarget:function(){return this.body},setTitle:function(b,a){this.title=b;if(this.header&&this.headerAsText){this.header.child("span").update(b)}if(a){this.setIconClass(a)}this.fireEvent("titlechange",this,b);return this},getUpdater:function(){return this.body.getUpdater()},load:function(){var a=this.body.getUpdater();a.update.apply(a,arguments);return this},beforeDestroy:function(){Ext.Panel.superclass.beforeDestroy.call(this);if(this.header){this.header.removeAllListeners()}if(this.tools){for(var a in this.tools){Ext.destroy(this.tools[a])}}if(this.toolbars.length>0){Ext.each(this.toolbars,function(b){b.un("afterlayout",this.syncHeight,this);b.un("remove",this.syncHeight,this)},this)}if(Ext.isArray(this.buttons)){while(this.buttons.length){Ext.destroy(this.buttons[0])}}if(this.rendered){Ext.destroy(this.ft,this.header,this.footer,this.tbar,this.bbar,this.body,this.mc,this.bwrap,this.dd);if(this.fbar){Ext.destroy(this.fbar,this.fbar.el)}}Ext.destroy(this.toolbars)},createClasses:function(){this.headerCls=this.baseCls+"-header";this.headerTextCls=this.baseCls+"-header-text";this.bwrapCls=this.baseCls+"-bwrap";this.tbarCls=this.baseCls+"-tbar";this.bodyCls=this.baseCls+"-body";this.bbarCls=this.baseCls+"-bbar";this.footerCls=this.baseCls+"-footer"},createGhost:function(a,e,b){var d=document.createElement("div");d.className="x-panel-ghost "+(a?a:"");if(this.header){d.appendChild(this.el.dom.firstChild.cloneNode(true))}Ext.fly(d.appendChild(document.createElement("ul"))).setHeight(this.bwrap.getHeight());d.style.width=this.el.dom.offsetWidth+"px";if(!b){this.container.dom.appendChild(d)}else{Ext.getDom(b).appendChild(d)}if(e!==false&&this.el.useShim!==false){var c=new Ext.Layer({shadow:false,useDisplay:true,constrain:false},d);c.show();return c}else{return new Ext.Element(d)}},doAutoLoad:function(){var a=this.body.getUpdater();if(this.renderer){a.setRenderer(this.renderer)}a.update(Ext.isObject(this.autoLoad)?this.autoLoad:{url:this.autoLoad})},getTool:function(a){return this.tools[a]}});Ext.reg("panel",Ext.Panel);Ext.Editor=function(b,a){if(b.field){this.field=Ext.create(b.field,"textfield");a=Ext.apply({},b);delete a.field}else{this.field=b}Ext.Editor.superclass.constructor.call(this,a)};Ext.extend(Ext.Editor,Ext.Component,{allowBlur:true,value:"",alignment:"c-c?",offsets:[0,0],shadow:"frame",constrain:false,swallowKeys:true,completeOnEnter:true,cancelOnEsc:true,updateEl:false,initComponent:function(){Ext.Editor.superclass.initComponent.call(this);this.addEvents("beforestartedit","startedit","beforecomplete","complete","canceledit","specialkey")},onRender:function(b,a){this.el=new Ext.Layer({shadow:this.shadow,cls:"x-editor",parentEl:b,shim:this.shim,shadowOffset:this.shadowOffset||4,id:this.id,constrain:this.constrain});if(this.zIndex){this.el.setZIndex(this.zIndex)}this.el.setStyle("overflow",Ext.isGecko?"auto":"hidden");if(this.field.msgTarget!="title"){this.field.msgTarget="qtip"}this.field.inEditor=true;this.mon(this.field,{scope:this,blur:this.onBlur,specialkey:this.onSpecialKey});if(this.field.grow){this.mon(this.field,"autosize",this.el.sync,this.el,{delay:1})}this.field.render(this.el).show();this.field.getEl().dom.name="";if(this.swallowKeys){this.field.el.swallowEvent(["keypress","keydown"])}},onSpecialKey:function(g,d){var b=d.getKey(),a=this.completeOnEnter&&b==d.ENTER,c=this.cancelOnEsc&&b==d.ESC;if(a||c){d.stopEvent();if(a){this.completeEdit()}else{this.cancelEdit()}if(g.triggerBlur){g.triggerBlur()}}this.fireEvent("specialkey",g,d)},startEdit:function(b,c){if(this.editing){this.completeEdit()}this.boundEl=Ext.get(b);var a=c!==undefined?c:this.boundEl.dom.innerHTML;if(!this.rendered){this.render(this.parentEl||document.body)}if(this.fireEvent("beforestartedit",this,this.boundEl,a)!==false){this.startValue=a;this.field.reset();this.field.setValue(a);this.realign(true);this.editing=true;this.show()}},doAutoSize:function(){if(this.autoSize){var b=this.boundEl.getSize(),a=this.field.getSize();switch(this.autoSize){case"width":this.setSize(b.width,a.height);break;case"height":this.setSize(a.width,b.height);break;case"none":this.setSize(a.width,a.height);break;default:this.setSize(b.width,b.height)}}},setSize:function(a,b){delete this.field.lastSize;this.field.setSize(a,b);if(this.el){if(Ext.isGecko2||Ext.isOpera||(Ext.isIE7&&Ext.isStrict)){this.el.setSize(a,b)}this.el.sync()}},realign:function(a){if(a===true){this.doAutoSize()}this.el.alignTo(this.boundEl,this.alignment,this.offsets)},completeEdit:function(a){if(!this.editing){return}if(this.field.assertValue){this.field.assertValue()}var b=this.getValue();if(!this.field.isValid()){if(this.revertInvalid!==false){this.cancelEdit(a)}return}if(String(b)===String(this.startValue)&&this.ignoreNoChange){this.hideEdit(a);return}if(this.fireEvent("beforecomplete",this,b,this.startValue)!==false){b=this.getValue();if(this.updateEl&&this.boundEl){this.boundEl.update(b)}this.hideEdit(a);this.fireEvent("complete",this,b,this.startValue)}},onShow:function(){this.el.show();if(this.hideEl!==false){this.boundEl.hide()}this.field.show().focus(false,true);this.fireEvent("startedit",this.boundEl,this.startValue)},cancelEdit:function(a){if(this.editing){var b=this.getValue();this.setValue(this.startValue);this.hideEdit(a);this.fireEvent("canceledit",this,b,this.startValue)}},hideEdit:function(a){if(a!==true){this.editing=false;this.hide()}},onBlur:function(){if(this.allowBlur===true&&this.editing&&this.selectSameEditor!==true){this.completeEdit()}},onHide:function(){if(this.editing){this.completeEdit();return}this.field.blur();if(this.field.collapse){this.field.collapse()}this.el.hide();if(this.hideEl!==false){this.boundEl.show()}},setValue:function(a){this.field.setValue(a)},getValue:function(){return this.field.getValue()},beforeDestroy:function(){Ext.destroyMembers(this,"field");delete this.parentEl;delete this.boundEl}});Ext.reg("editor",Ext.Editor);Ext.ColorPalette=Ext.extend(Ext.Component,{itemCls:"x-color-palette",value:null,clickEvent:"click",ctype:"Ext.ColorPalette",allowReselect:false,colors:["000000","993300","333300","003300","003366","000080","333399","333333","800000","FF6600","808000","008000","008080","0000FF","666699","808080","FF0000","FF9900","99CC00","339966","33CCCC","3366FF","800080","969696","FF00FF","FFCC00","FFFF00","00FF00","00FFFF","00CCFF","993366","C0C0C0","FF99CC","FFCC99","FFFF99","CCFFCC","CCFFFF","99CCFF","CC99FF","FFFFFF"],initComponent:function(){Ext.ColorPalette.superclass.initComponent.call(this);this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope,true)}},onRender:function(b,a){this.autoEl={tag:"div",cls:this.itemCls};Ext.ColorPalette.superclass.onRender.call(this,b,a);var c=this.tpl||new Ext.XTemplate('<tpl for="."><a href="#" class="color-{.}" hidefocus="on"><em><span style="background:#{.}" unselectable="on">&#160;</span></em></a></tpl>');c.overwrite(this.el,this.colors);this.mon(this.el,this.clickEvent,this.handleClick,this,{delegate:"a"});if(this.clickEvent!="click"){this.mon(this.el,"click",Ext.emptyFn,this,{delegate:"a",preventDefault:true})}},afterRender:function(){Ext.ColorPalette.superclass.afterRender.call(this);if(this.value){var a=this.value;this.value=null;this.select(a,true)}},handleClick:function(b,a){b.preventDefault();if(!this.disabled){var d=a.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];this.select(d.toUpperCase())}},select:function(b,a){b=b.replace("#","");if(b!=this.value||this.allowReselect){var c=this.el;if(this.value){c.child("a.color-"+this.value).removeClass("x-color-palette-sel")}c.child("a.color-"+b).addClass("x-color-palette-sel");this.value=b;if(a!==true){this.fireEvent("select",this,b)}}}});Ext.reg("colorpalette",Ext.ColorPalette);Ext.DatePicker=Ext.extend(Ext.BoxComponent,{todayText:"Today",okText:"&#160;OK&#160;",cancelText:"Cancel",todayTip:"{0} (Spacebar)",minText:"This date is before the minimum date",maxText:"This date is after the maximum date",format:"m/d/y",disabledDaysText:"Disabled",disabledDatesText:"Disabled",monthNames:Date.monthNames,dayNames:Date.dayNames,nextText:"Next Month (Control+Right)",prevText:"Previous Month (Control+Left)",monthYearText:"Choose a month (Control+Up/Down to move years)",startDay:0,showToday:true,focusOnSelect:true,initHour:12,initComponent:function(){Ext.DatePicker.superclass.initComponent.call(this);this.value=this.value?this.value.clearTime(true):new Date().clearTime();this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope||this)}this.initDisabledDays()},initDisabledDays:function(){if(!this.disabledDatesRE&&this.disabledDates){var b=this.disabledDates,a=b.length-1,c="(?:";Ext.each(b,function(g,e){c+=Ext.isDate(g)?"^"+Ext.escapeRe(g.dateFormat(this.format))+"$":b[e];if(e!=a){c+="|"}},this);this.disabledDatesRE=new RegExp(c+")")}},setDisabledDates:function(a){if(Ext.isArray(a)){this.disabledDates=a;this.disabledDatesRE=null}else{this.disabledDatesRE=a}this.initDisabledDays();this.update(this.value,true)},setDisabledDays:function(a){this.disabledDays=a;this.update(this.value,true)},setMinDate:function(a){this.minDate=a;this.update(this.value,true)},setMaxDate:function(a){this.maxDate=a;this.update(this.value,true)},setValue:function(a){this.value=a.clearTime(true);this.update(this.value)},getValue:function(){return this.value},focus:function(){this.update(this.activeDate)},onEnable:function(a){Ext.DatePicker.superclass.onEnable.call(this);this.doDisabled(false);this.update(a?this.value:this.activeDate);if(Ext.isIE){this.el.repaint()}},onDisable:function(){Ext.DatePicker.superclass.onDisable.call(this);this.doDisabled(true);if(Ext.isIE&&!Ext.isIE8){Ext.each([].concat(this.textNodes,this.el.query("th span")),function(a){Ext.fly(a).repaint()})}},doDisabled:function(a){this.keyNav.setDisabled(a);this.prevRepeater.setDisabled(a);this.nextRepeater.setDisabled(a);if(this.showToday){this.todayKeyListener.setDisabled(a);this.todayBtn.setDisabled(a)}},onRender:function(e,b){var a=['<table cellspacing="0">','<tr><td class="x-date-left"><a href="#" title="',this.prevText,'">&#160;</a></td><td class="x-date-middle" align="center"></td><td class="x-date-right"><a href="#" title="',this.nextText,'">&#160;</a></td></tr>','<tr><td colspan="3"><table class="x-date-inner" cellspacing="0"><thead><tr>'],c=this.dayNames,h;for(h=0;h<7;h++){var k=this.startDay+h;if(k>6){k=k-7}a.push("<th><span>",c[k].substr(0,1),"</span></th>")}a[a.length]="</tr></thead><tbody><tr>";for(h=0;h<42;h++){if(h%7===0&&h!==0){a[a.length]="</tr><tr>"}a[a.length]='<td><a href="#" hidefocus="on" class="x-date-date" tabIndex="1"><em><span></span></em></a></td>'}a.push("</tr></tbody></table></td></tr>",this.showToday?'<tr><td colspan="3" class="x-date-bottom" align="center"></td></tr>':"",'</table><div class="x-date-mp"></div>');var j=document.createElement("div");j.className="x-date-picker";j.innerHTML=a.join("");e.dom.insertBefore(j,b);this.el=Ext.get(j);this.eventEl=Ext.get(j.firstChild);this.prevRepeater=new Ext.util.ClickRepeater(this.el.child("td.x-date-left a"),{handler:this.showPrevMonth,scope:this,preventDefault:true,stopDefault:true});this.nextRepeater=new Ext.util.ClickRepeater(this.el.child("td.x-date-right a"),{handler:this.showNextMonth,scope:this,preventDefault:true,stopDefault:true});this.monthPicker=this.el.down("div.x-date-mp");this.monthPicker.enableDisplayMode("block");this.keyNav=new Ext.KeyNav(this.eventEl,{left:function(d){if(d.ctrlKey){this.showPrevMonth()}else{this.update(this.activeDate.add("d",-1))}},right:function(d){if(d.ctrlKey){this.showNextMonth()}else{this.update(this.activeDate.add("d",1))}},up:function(d){if(d.ctrlKey){this.showNextYear()}else{this.update(this.activeDate.add("d",-7))}},down:function(d){if(d.ctrlKey){this.showPrevYear()}else{this.update(this.activeDate.add("d",7))}},pageUp:function(d){this.showNextMonth()},pageDown:function(d){this.showPrevMonth()},enter:function(d){d.stopPropagation();return true},scope:this});this.el.unselectable();this.cells=this.el.select("table.x-date-inner tbody td");this.textNodes=this.el.query("table.x-date-inner tbody span");this.mbtn=new Ext.Button({text:"&#160;",tooltip:this.monthYearText,renderTo:this.el.child("td.x-date-middle",true)});this.mbtn.el.child("em").addClass("x-btn-arrow");if(this.showToday){this.todayKeyListener=this.eventEl.addKeyListener(Ext.EventObject.SPACE,this.selectToday,this);var g=(new Date()).dateFormat(this.format);this.todayBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom",true),text:String.format(this.todayText,g),tooltip:String.format(this.todayTip,g),handler:this.selectToday,scope:this})}this.mon(this.eventEl,"mousewheel",this.handleMouseWheel,this);this.mon(this.eventEl,"click",this.handleDateClick,this,{delegate:"a.x-date-date"});this.mon(this.mbtn,"click",this.showMonthPicker,this);this.onEnable(true)},createMonthPicker:function(){if(!this.monthPicker.dom.firstChild){var a=['<table border="0" cellspacing="0">'];for(var b=0;b<6;b++){a.push('<tr><td class="x-date-mp-month"><a href="#">',Date.getShortMonthName(b),"</a></td>",'<td class="x-date-mp-month x-date-mp-sep"><a href="#">',Date.getShortMonthName(b+6),"</a></td>",b===0?'<td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-prev"></a></td><td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-next"></a></td></tr>':'<td class="x-date-mp-year"><a href="#"></a></td><td class="x-date-mp-year"><a href="#"></a></td></tr>')}a.push('<tr class="x-date-mp-btns"><td colspan="4"><button type="button" class="x-date-mp-ok">',this.okText,'</button><button type="button" class="x-date-mp-cancel">',this.cancelText,"</button></td></tr>","</table>");this.monthPicker.update(a.join(""));this.mon(this.monthPicker,"click",this.onMonthClick,this);this.mon(this.monthPicker,"dblclick",this.onMonthDblClick,this);this.mpMonths=this.monthPicker.select("td.x-date-mp-month");this.mpYears=this.monthPicker.select("td.x-date-mp-year");this.mpMonths.each(function(c,d,e){e+=1;if((e%2)===0){c.dom.xmonth=5+Math.round(e*0.5)}else{c.dom.xmonth=Math.round((e-1)*0.5)}})}},showMonthPicker:function(){if(!this.disabled){this.createMonthPicker();var a=this.el.getSize();this.monthPicker.setSize(a);this.monthPicker.child("table").setSize(a);this.mpSelMonth=(this.activeDate||this.value).getMonth();this.updateMPMonth(this.mpSelMonth);this.mpSelYear=(this.activeDate||this.value).getFullYear();this.updateMPYear(this.mpSelYear);this.monthPicker.slideIn("t",{duration:0.2})}},updateMPYear:function(e){this.mpyear=e;var c=this.mpYears.elements;for(var b=1;b<=10;b++){var d=c[b-1],a;if((b%2)===0){a=e+Math.round(b*0.5);d.firstChild.innerHTML=a;d.xyear=a}else{a=e-(5-Math.round(b*0.5));d.firstChild.innerHTML=a;d.xyear=a}this.mpYears.item(b-1)[a==this.mpSelYear?"addClass":"removeClass"]("x-date-mp-sel")}},updateMPMonth:function(a){this.mpMonths.each(function(b,c,d){b[b.dom.xmonth==a?"addClass":"removeClass"]("x-date-mp-sel")})},selectMPMonth:function(a){},onMonthClick:function(g,b){g.stopEvent();var c=new Ext.Element(b),a;if(c.is("button.x-date-mp-cancel")){this.hideMonthPicker()}else{if(c.is("button.x-date-mp-ok")){var h=new Date(this.mpSelYear,this.mpSelMonth,(this.activeDate||this.value).getDate());if(h.getMonth()!=this.mpSelMonth){h=new Date(this.mpSelYear,this.mpSelMonth,1).getLastDateOfMonth()}this.update(h);this.hideMonthPicker()}else{if((a=c.up("td.x-date-mp-month",2))){this.mpMonths.removeClass("x-date-mp-sel");a.addClass("x-date-mp-sel");this.mpSelMonth=a.dom.xmonth}else{if((a=c.up("td.x-date-mp-year",2))){this.mpYears.removeClass("x-date-mp-sel");a.addClass("x-date-mp-sel");this.mpSelYear=a.dom.xyear}else{if(c.is("a.x-date-mp-prev")){this.updateMPYear(this.mpyear-10)}else{if(c.is("a.x-date-mp-next")){this.updateMPYear(this.mpyear+10)}}}}}}},onMonthDblClick:function(d,b){d.stopEvent();var c=new Ext.Element(b),a;if((a=c.up("td.x-date-mp-month",2))){this.update(new Date(this.mpSelYear,a.dom.xmonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}else{if((a=c.up("td.x-date-mp-year",2))){this.update(new Date(a.dom.xyear,this.mpSelMonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}}},hideMonthPicker:function(a){if(this.monthPicker){if(a===true){this.monthPicker.hide()}else{this.monthPicker.slideOut("t",{duration:0.2})}}},showPrevMonth:function(a){this.update(this.activeDate.add("mo",-1))},showNextMonth:function(a){this.update(this.activeDate.add("mo",1))},showPrevYear:function(){this.update(this.activeDate.add("y",-1))},showNextYear:function(){this.update(this.activeDate.add("y",1))},handleMouseWheel:function(a){a.stopEvent();if(!this.disabled){var b=a.getWheelDelta();if(b>0){this.showPrevMonth()}else{if(b<0){this.showNextMonth()}}}},handleDateClick:function(b,a){b.stopEvent();if(!this.disabled&&a.dateValue&&!Ext.fly(a.parentNode).hasClass("x-date-disabled")){this.cancelFocus=this.focusOnSelect===false;this.setValue(new Date(a.dateValue));delete this.cancelFocus;this.fireEvent("select",this,this.value)}},selectToday:function(){if(this.todayBtn&&!this.todayBtn.disabled){this.setValue(new Date().clearTime());this.fireEvent("select",this,this.value)}},update:function(G,A){if(this.rendered){var a=this.activeDate,p=this.isVisible();this.activeDate=G;if(!A&&a&&this.el){var o=G.getTime();if(a.getMonth()==G.getMonth()&&a.getFullYear()==G.getFullYear()){this.cells.removeClass("x-date-selected");this.cells.each(function(d){if(d.dom.firstChild.dateValue==o){d.addClass("x-date-selected");if(p&&!this.cancelFocus){Ext.fly(d.dom.firstChild).focus(50)}return false}},this);return}}var k=G.getDaysInMonth(),q=G.getFirstDateOfMonth(),g=q.getDay()-this.startDay;if(g<0){g+=7}k+=g;var B=G.add("mo",-1),h=B.getDaysInMonth()-g,e=this.cells.elements,r=this.textNodes,D=(new Date(B.getFullYear(),B.getMonth(),h,this.initHour)),C=new Date().clearTime().getTime(),v=G.clearTime(true).getTime(),u=this.minDate?this.minDate.clearTime(true):Number.NEGATIVE_INFINITY,y=this.maxDate?this.maxDate.clearTime(true):Number.POSITIVE_INFINITY,F=this.disabledDatesRE,s=this.disabledDatesText,I=this.disabledDays?this.disabledDays.join(""):false,E=this.disabledDaysText,z=this.format;if(this.showToday){var m=new Date().clearTime(),c=(m<u||m>y||(F&&z&&F.test(m.dateFormat(z)))||(I&&I.indexOf(m.getDay())!=-1));if(!this.disabled){this.todayBtn.setDisabled(c);this.todayKeyListener[c?"disable":"enable"]()}}var l=function(J,d){d.title="";var i=D.clearTime(true).getTime();d.firstChild.dateValue=i;if(i==C){d.className+=" x-date-today";d.title=J.todayText}if(i==v){d.className+=" x-date-selected";if(p){Ext.fly(d.firstChild).focus(50)}}if(i<u){d.className=" x-date-disabled";d.title=J.minText;return}if(i>y){d.className=" x-date-disabled";d.title=J.maxText;return}if(I){if(I.indexOf(D.getDay())!=-1){d.title=E;d.className=" x-date-disabled"}}if(F&&z){var w=D.dateFormat(z);if(F.test(w)){d.title=s.replace("%0",w);d.className=" x-date-disabled"}}};var x=0;for(;x<g;x++){r[x].innerHTML=(++h);D.setDate(D.getDate()+1);e[x].className="x-date-prevday";l(this,e[x])}for(;x<k;x++){var b=x-g+1;r[x].innerHTML=(b);D.setDate(D.getDate()+1);e[x].className="x-date-active";l(this,e[x])}var H=0;for(;x<42;x++){r[x].innerHTML=(++H);D.setDate(D.getDate()+1);e[x].className="x-date-nextday";l(this,e[x])}this.mbtn.setText(this.monthNames[G.getMonth()]+" "+G.getFullYear());if(!this.internalRender){var j=this.el.dom.firstChild,n=j.offsetWidth;this.el.setWidth(n+this.el.getBorderWidth("lr"));Ext.fly(j).setWidth(n);this.internalRender=true;if(Ext.isOpera&&!this.secondPass){j.rows[0].cells[1].style.width=(n-(j.rows[0].cells[0].offsetWidth+j.rows[0].cells[2].offsetWidth))+"px";this.secondPass=true;this.update.defer(10,this,[G])}}}},beforeDestroy:function(){if(this.rendered){Ext.destroy(this.keyNav,this.monthPicker,this.eventEl,this.mbtn,this.nextRepeater,this.prevRepeater,this.cells.el,this.todayBtn);delete this.textNodes;delete this.cells.elements}}});Ext.reg("datepicker",Ext.DatePicker);Ext.LoadMask=function(c,b){this.el=Ext.get(c);Ext.apply(this,b);if(this.store){this.store.on({scope:this,beforeload:this.onBeforeLoad,load:this.onLoad,exception:this.onLoad});this.removeMask=Ext.value(this.removeMask,false)}else{var a=this.el.getUpdater();a.showLoadIndicator=false;a.on({scope:this,beforeupdate:this.onBeforeLoad,update:this.onLoad,failure:this.onLoad});this.removeMask=Ext.value(this.removeMask,true)}};Ext.LoadMask.prototype={msg:"Loading...",msgCls:"x-mask-loading",disabled:false,disable:function(){this.disabled=true},enable:function(){this.disabled=false},onLoad:function(){this.el.unmask(this.removeMask)},onBeforeLoad:function(){if(!this.disabled){this.el.mask(this.msg,this.msgCls)}},show:function(){this.onBeforeLoad()},hide:function(){this.onLoad()},destroy:function(){if(this.store){this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.onLoad,this)}else{var a=this.el.getUpdater();a.un("beforeupdate",this.onBeforeLoad,this);a.un("update",this.onLoad,this);a.un("failure",this.onLoad,this)}}};Ext.slider.Thumb=Ext.extend(Object,{dragging:false,constructor:function(a){Ext.apply(this,a||{},{cls:"x-slider-thumb",constrain:false});Ext.slider.Thumb.superclass.constructor.call(this,a);if(this.slider.vertical){Ext.apply(this,Ext.slider.Thumb.Vertical)}},render:function(){this.el=this.slider.innerEl.insertFirst({cls:this.cls});this.initEvents()},enable:function(){this.disabled=false;this.el.removeClass(this.slider.disabledClass)},disable:function(){this.disabled=true;this.el.addClass(this.slider.disabledClass)},initEvents:function(){var a=this.el;a.addClassOnOver("x-slider-thumb-over");this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeDragStart.createDelegate(this),onStart:this.onDragStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onDragEnd.createDelegate(this),tolerance:3,autoStart:300});this.tracker.initEl(a)},onBeforeDragStart:function(a){if(this.disabled){return false}else{this.slider.promoteThumb(this);return true}},onDragStart:function(a){this.el.addClass("x-slider-thumb-drag");this.dragging=true;this.dragStartValue=this.value;this.slider.fireEvent("dragstart",this.slider,a,this)},onDrag:function(g){var c=this.slider,b=this.index,d=this.getNewValue();if(this.constrain){var a=c.thumbs[b+1],h=c.thumbs[b-1];if(h!=undefined&&d<=h.value){d=h.value}if(a!=undefined&&d>=a.value){d=a.value}}c.setValue(b,d,false);c.fireEvent("drag",c,g,this)},getNewValue:function(){var a=this.slider,b=a.innerEl.translatePoints(this.tracker.getXY());return Ext.util.Format.round(a.reverseValue(b.left),a.decimalPrecision)},onDragEnd:function(c){var a=this.slider,b=this.value;this.el.removeClass("x-slider-thumb-drag");this.dragging=false;a.fireEvent("dragend",a,c);if(this.dragStartValue!=b){a.fireEvent("changecomplete",a,b,this)}},destroy:function(){Ext.destroyMembers(this,"tracker","el")}});Ext.slider.MultiSlider=Ext.extend(Ext.BoxComponent,{vertical:false,minValue:0,maxValue:100,decimalPrecision:0,keyIncrement:1,increment:0,clickRange:[5,15],clickToChange:true,animate:true,constrainThumbs:true,topThumbZIndex:10000,initComponent:function(){if(!Ext.isDefined(this.value)){this.value=this.minValue}this.thumbs=[];Ext.slider.MultiSlider.superclass.initComponent.call(this);this.keyIncrement=Math.max(this.increment,this.keyIncrement);this.addEvents("beforechange","change","changecomplete","dragstart","drag","dragend");if(this.values==undefined||Ext.isEmpty(this.values)){this.values=[0]}var a=this.values;for(var b=0;b<a.length;b++){this.addThumb(a[b])}if(this.vertical){Ext.apply(this,Ext.slider.Vertical)}},addThumb:function(b){var a=new Ext.slider.Thumb({value:b,slider:this,index:this.thumbs.length,constrain:this.constrainThumbs});this.thumbs.push(a);if(this.rendered){a.render()}},promoteThumb:function(d){var a=this.thumbs,g,b;for(var e=0,c=a.length;e<c;e++){b=a[e];if(b==d){g=this.topThumbZIndex}else{g=""}b.el.setStyle("zIndex",g)}},onRender:function(){this.autoEl={cls:"x-slider "+(this.vertical?"x-slider-vert":"x-slider-horz"),cn:{cls:"x-slider-end",cn:{cls:"x-slider-inner",cn:[{tag:"a",cls:"x-slider-focus",href:"#",tabIndex:"-1",hidefocus:"on"}]}}};Ext.slider.MultiSlider.superclass.onRender.apply(this,arguments);this.endEl=this.el.first();this.innerEl=this.endEl.first();this.focusEl=this.innerEl.child(".x-slider-focus");for(var b=0;b<this.thumbs.length;b++){this.thumbs[b].render()}var a=this.innerEl.child(".x-slider-thumb");this.halfThumb=(this.vertical?a.getHeight():a.getWidth())/2;this.initEvents()},initEvents:function(){this.mon(this.el,{scope:this,mousedown:this.onMouseDown,keydown:this.onKeyDown});this.focusEl.swallowEvent("click",true)},onMouseDown:function(d){if(this.disabled){return}var c=false;for(var b=0;b<this.thumbs.length;b++){c=c||d.target==this.thumbs[b].el.dom}if(this.clickToChange&&!c){var a=this.innerEl.translatePoints(d.getXY());this.onClickChange(a)}this.focus()},onClickChange:function(c){if(c.top>this.clickRange[0]&&c.top<this.clickRange[1]){var a=this.getNearest(c,"left"),b=a.index;this.setValue(b,Ext.util.Format.round(this.reverseValue(c.left),this.decimalPrecision),undefined,true)}},getNearest:function(k,b){var m=b=="top"?this.innerEl.getHeight()-k[b]:k[b],g=this.reverseValue(m),j=(this.maxValue-this.minValue)+5,e=0,c=null;for(var d=0;d<this.thumbs.length;d++){var a=this.thumbs[d],l=a.value,h=Math.abs(l-g);if(Math.abs(h<=j)){c=a;e=d;j=h}}return c},onKeyDown:function(b){if(this.disabled||this.thumbs.length!==1){b.preventDefault();return}var a=b.getKey(),c;switch(a){case b.UP:case b.RIGHT:b.stopEvent();c=b.ctrlKey?this.maxValue:this.getValue(0)+this.keyIncrement;this.setValue(0,c,undefined,true);break;case b.DOWN:case b.LEFT:b.stopEvent();c=b.ctrlKey?this.minValue:this.getValue(0)-this.keyIncrement;this.setValue(0,c,undefined,true);break;default:b.preventDefault()}},doSnap:function(b){if(!(this.increment&&b)){return b}var d=b,c=this.increment,a=b%c;if(a!=0){d-=a;if(a*2>=c){d+=c}else{if(a*2<-c){d-=c}}}return d.constrain(this.minValue,this.maxValue)},afterRender:function(){Ext.slider.MultiSlider.superclass.afterRender.apply(this,arguments);for(var c=0;c<this.thumbs.length;c++){var b=this.thumbs[c];if(b.value!==undefined){var a=this.normalizeValue(b.value);if(a!==b.value){this.setValue(c,a,false)}else{this.moveThumb(c,this.translateValue(a),false)}}}},getRatio:function(){var a=this.innerEl.getWidth(),b=this.maxValue-this.minValue;return b==0?a:(a/b)},normalizeValue:function(a){a=this.doSnap(a);a=Ext.util.Format.round(a,this.decimalPrecision);a=a.constrain(this.minValue,this.maxValue);return a},setMinValue:function(e){this.minValue=e;var d=0,b=this.thumbs,a=b.length,c;for(;d<a;++d){c=b[d];c.value=c.value<e?e:c.value}this.syncThumb()},setMaxValue:function(e){this.maxValue=e;var d=0,b=this.thumbs,a=b.length,c;for(;d<a;++d){c=b[d];c.value=c.value>e?e:c.value}this.syncThumb()},setValue:function(d,c,b,g){var a=this.thumbs[d],e=a.el;c=this.normalizeValue(c);if(c!==a.value&&this.fireEvent("beforechange",this,c,a.value,a)!==false){a.value=c;if(this.rendered){this.moveThumb(d,this.translateValue(c),b!==false);this.fireEvent("change",this,c,a);if(g){this.fireEvent("changecomplete",this,c,a)}}}},translateValue:function(a){var b=this.getRatio();return(a*b)-(this.minValue*b)-this.halfThumb},reverseValue:function(b){var a=this.getRatio();return(b+(this.minValue*a))/a},moveThumb:function(d,c,b){var a=this.thumbs[d].el;if(!b||this.animate===false){a.setLeft(c)}else{a.shift({left:c,stopFx:true,duration:0.35})}},focus:function(){this.focusEl.focus(10)},onResize:function(c,e){var b=this.thumbs,a=b.length,d=0;for(;d<a;++d){b[d].el.stopFx()}if(Ext.isNumber(c)){this.innerEl.setWidth(c-(this.el.getPadding("l")+this.endEl.getPadding("r")))}this.syncThumb();Ext.slider.MultiSlider.superclass.onResize.apply(this,arguments)},onDisable:function(){Ext.slider.MultiSlider.superclass.onDisable.call(this);for(var b=0;b<this.thumbs.length;b++){var a=this.thumbs[b],c=a.el;a.disable();if(Ext.isIE){var d=c.getXY();c.hide();this.innerEl.addClass(this.disabledClass).dom.disabled=true;if(!this.thumbHolder){this.thumbHolder=this.endEl.createChild({cls:"x-slider-thumb "+this.disabledClass})}this.thumbHolder.show().setXY(d)}}},onEnable:function(){Ext.slider.MultiSlider.superclass.onEnable.call(this);for(var b=0;b<this.thumbs.length;b++){var a=this.thumbs[b],c=a.el;a.enable();if(Ext.isIE){this.innerEl.removeClass(this.disabledClass).dom.disabled=false;if(this.thumbHolder){this.thumbHolder.hide()}c.show();this.syncThumb()}}},syncThumb:function(){if(this.rendered){for(var a=0;a<this.thumbs.length;a++){this.moveThumb(a,this.translateValue(this.thumbs[a].value))}}},getValue:function(a){return this.thumbs[a].value},getValues:function(){var a=[];for(var b=0;b<this.thumbs.length;b++){a.push(this.thumbs[b].value)}return a},beforeDestroy:function(){var b=this.thumbs;for(var c=0,a=b.length;c<a;++c){b[c].destroy();b[c]=null}Ext.destroyMembers(this,"endEl","innerEl","focusEl","thumbHolder");Ext.slider.MultiSlider.superclass.beforeDestroy.call(this)}});Ext.reg("multislider",Ext.slider.MultiSlider);Ext.slider.SingleSlider=Ext.extend(Ext.slider.MultiSlider,{constructor:function(a){a=a||{};Ext.applyIf(a,{values:[a.value||0]});Ext.slider.SingleSlider.superclass.constructor.call(this,a)},getValue:function(){return Ext.slider.SingleSlider.superclass.getValue.call(this,0)},setValue:function(d,b){var c=Ext.toArray(arguments),a=c.length;if(a==1||(a<=3&&typeof arguments[1]!="number")){c.unshift(0)}return Ext.slider.SingleSlider.superclass.setValue.apply(this,c)},syncThumb:function(){return Ext.slider.SingleSlider.superclass.syncThumb.apply(this,[0].concat(arguments))},getNearest:function(){return this.thumbs[0]}});Ext.Slider=Ext.slider.SingleSlider;Ext.reg("slider",Ext.slider.SingleSlider);Ext.slider.Vertical={onResize:function(a,b){this.innerEl.setHeight(b-(this.el.getPadding("t")+this.endEl.getPadding("b")));this.syncThumb()},getRatio:function(){var b=this.innerEl.getHeight(),a=this.maxValue-this.minValue;return b/a},moveThumb:function(d,c,b){var a=this.thumbs[d],e=a.el;if(!b||this.animate===false){e.setBottom(c)}else{e.shift({bottom:c,stopFx:true,duration:0.35})}},onClickChange:function(c){if(c.left>this.clickRange[0]&&c.left<this.clickRange[1]){var a=this.getNearest(c,"top"),b=a.index,d=this.minValue+this.reverseValue(this.innerEl.getHeight()-c.top);this.setValue(b,Ext.util.Format.round(d,this.decimalPrecision),undefined,true)}}};Ext.slider.Thumb.Vertical={getNewValue:function(){var b=this.slider,c=b.innerEl,d=c.translatePoints(this.tracker.getXY()),a=c.getHeight()-d.top;return b.minValue+Ext.util.Format.round(a/b.getRatio(),b.decimalPrecision)}};Ext.ProgressBar=Ext.extend(Ext.BoxComponent,{baseCls:"x-progress",animate:false,waitTimer:null,initComponent:function(){Ext.ProgressBar.superclass.initComponent.call(this);this.addEvents("update")},onRender:function(d,a){var c=new Ext.Template('<div class="{cls}-wrap">','<div class="{cls}-inner">','<div class="{cls}-bar">','<div class="{cls}-text">',"<div>&#160;</div>","</div>","</div>",'<div class="{cls}-text {cls}-text-back">',"<div>&#160;</div>","</div>","</div>","</div>");this.el=a?c.insertBefore(a,{cls:this.baseCls},true):c.append(d,{cls:this.baseCls},true);if(this.id){this.el.dom.id=this.id}var b=this.el.dom.firstChild;this.progressBar=Ext.get(b.firstChild);if(this.textEl){this.textEl=Ext.get(this.textEl);delete this.textTopEl}else{this.textTopEl=Ext.get(this.progressBar.dom.firstChild);var e=Ext.get(b.childNodes[1]);this.textTopEl.setStyle("z-index",99).addClass("x-hidden");this.textEl=new Ext.CompositeElement([this.textTopEl.dom.firstChild,e.dom.firstChild]);this.textEl.setWidth(b.offsetWidth)}this.progressBar.setHeight(b.offsetHeight)},afterRender:function(){Ext.ProgressBar.superclass.afterRender.call(this);if(this.value){this.updateProgress(this.value,this.text)}else{this.updateText(this.text)}},updateProgress:function(c,d,b){this.value=c||0;if(d){this.updateText(d)}if(this.rendered&&!this.isDestroyed){var a=Math.floor(c*this.el.dom.firstChild.offsetWidth);this.progressBar.setWidth(a,b===true||(b!==false&&this.animate));if(this.textTopEl){this.textTopEl.removeClass("x-hidden").setWidth(a)}}this.fireEvent("update",this,c,d);return this},wait:function(b){if(!this.waitTimer){var a=this;b=b||{};this.updateText(b.text);this.waitTimer=Ext.TaskMgr.start({run:function(c){var d=b.increment||10;c-=1;this.updateProgress(((((c+d)%d)+1)*(100/d))*0.01,null,b.animate)},interval:b.interval||1000,duration:b.duration,onStop:function(){if(b.fn){b.fn.apply(b.scope||this)}this.reset()},scope:a})}return this},isWaiting:function(){return this.waitTimer!==null},updateText:function(a){this.text=a||"&#160;";if(this.rendered){this.textEl.update(this.text)}return this},syncProgressBar:function(){if(this.value){this.updateProgress(this.value,this.text)}return this},setSize:function(a,c){Ext.ProgressBar.superclass.setSize.call(this,a,c);if(this.textTopEl){var b=this.el.dom.firstChild;this.textEl.setSize(b.offsetWidth,b.offsetHeight)}this.syncProgressBar();return this},reset:function(a){this.updateProgress(0);if(this.textTopEl){this.textTopEl.addClass("x-hidden")}this.clearTimer();if(a===true){this.hide()}return this},clearTimer:function(){if(this.waitTimer){this.waitTimer.onStop=null;Ext.TaskMgr.stop(this.waitTimer);this.waitTimer=null}},onDestroy:function(){this.clearTimer();if(this.rendered){if(this.textEl.isComposite){this.textEl.clear()}Ext.destroyMembers(this,"textEl","progressBar","textTopEl")}Ext.ProgressBar.superclass.onDestroy.call(this)}});Ext.reg("progress",Ext.ProgressBar);(function(){var a=Ext.EventManager;var b=Ext.lib.Dom;Ext.dd.DragDrop=function(e,c,d){if(e){this.init(e,c,d)}};Ext.dd.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true},moveOnly:false,unlock:function(){this.locked=false},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(c,d){},startDrag:function(c,d){},b4Drag:function(c){},onDrag:function(c){},onDragEnter:function(c,d){},b4DragOver:function(c){},onDragOver:function(c,d){},b4DragOut:function(c){},onDragOut:function(c,d){},b4DragDrop:function(c){},onDragDrop:function(c,d){},onInvalidDrop:function(c){},b4EndDrag:function(c){},endDrag:function(c){},b4MouseDown:function(c){},onMouseDown:function(c){},onMouseUp:function(c){},onAvailable:function(){},defaultPadding:{left:0,right:0,top:0,bottom:0},constrainTo:function(j,h,o){if(Ext.isNumber(h)){h={left:h,right:h,top:h,bottom:h}}h=h||this.defaultPadding;var l=Ext.get(this.getEl()).getBox(),d=Ext.get(j),n=d.getScroll(),k,e=d.dom;if(e==document.body){k={x:n.left,y:n.top,width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()}}else{var m=d.getXY();k={x:m[0],y:m[1],width:e.clientWidth,height:e.clientHeight}}var i=l.y-k.y,g=l.x-k.x;this.resetConstraints();this.setXConstraint(g-(h.left||0),k.width-g-l.width-(h.right||0),this.xTickSize);this.setYConstraint(i-(h.top||0),k.height-i-l.height-(h.bottom||0),this.yTickSize)},getEl:function(){if(!this._domRef){this._domRef=Ext.getDom(this.id)}return this._domRef},getDragEl:function(){return Ext.getDom(this.dragElId)},init:function(e,c,d){this.initTarget(e,c,d);a.on(this.id,"mousedown",this.handleMouseDown,this)},initTarget:function(e,c,d){this.config=d||{};this.DDM=Ext.dd.DDM;this.groups={};if(typeof e!=="string"){e=Ext.id(e)}this.id=e;this.addToGroup((c)?c:"default");this.handleElId=e;this.setDragElId(e);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();this.handleOnAvailable()},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false)},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable()},setPadding:function(e,c,g,d){if(!c&&0!==c){this.padding=[e,e,e,e]}else{if(!g&&0!==g){this.padding=[e,c,e,c]}else{this.padding=[e,c,g,d]}}},setInitPosition:function(g,e){var h=this.getEl();if(!this.DDM.verifyEl(h)){return}var d=g||0;var c=e||0;var i=b.getXY(h);this.initPageX=i[0]-d;this.initPageY=i[1]-c;this.lastPageX=i[0];this.lastPageY=i[1];this.setStartPosition(i)},setStartPosition:function(d){var c=d||b.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=c[0];this.startPageY=c[1]},addToGroup:function(c){this.groups[c]=true;this.DDM.regDragDrop(this,c)},removeFromGroup:function(c){if(this.groups[c]){delete this.groups[c]}this.DDM.removeDDFromGroup(this,c)},setDragElId:function(c){this.dragElId=c},setHandleElId:function(c){if(typeof c!=="string"){c=Ext.id(c)}this.handleElId=c;this.DDM.regHandle(this.id,c)},setOuterHandleElId:function(c){if(typeof c!=="string"){c=Ext.id(c)}a.on(c,"mousedown",this.handleMouseDown,this);this.setHandleElId(c);this.hasOuterHandles=true},unreg:function(){a.un(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this)},destroy:function(){this.unreg()},isLocked:function(){return(this.DDM.isLocked()||this.locked)},handleMouseDown:function(g,d){if(this.primaryButtonOnly&&g.button!=0){return}if(this.isLocked()){return}this.DDM.refreshCache(this.groups);var c=new Ext.lib.Point(Ext.lib.Event.getPageX(g),Ext.lib.Event.getPageY(g));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(c,this)){}else{if(this.clickValidator(g)){this.setStartPosition();this.b4MouseDown(g);this.onMouseDown(g);this.DDM.handleMouseDown(g,this);this.DDM.stopEvent(g)}else{}}},clickValidator:function(d){var c=d.getTarget();return(this.isValidHandleChild(c)&&(this.id==this.handleElId||this.DDM.handleWasClicked(c,this.id)))},addInvalidHandleType:function(c){var d=c.toUpperCase();this.invalidHandleTypes[d]=d},addInvalidHandleId:function(c){if(typeof c!=="string"){c=Ext.id(c)}this.invalidHandleIds[c]=c},addInvalidHandleClass:function(c){this.invalidHandleClasses.push(c)},removeInvalidHandleType:function(c){var d=c.toUpperCase();delete this.invalidHandleTypes[d]},removeInvalidHandleId:function(c){if(typeof c!=="string"){c=Ext.id(c)}delete this.invalidHandleIds[c]},removeInvalidHandleClass:function(d){for(var e=0,c=this.invalidHandleClasses.length;e<c;++e){if(this.invalidHandleClasses[e]==d){delete this.invalidHandleClasses[e]}}},isValidHandleChild:function(h){var g=true;var k;try{k=h.nodeName.toUpperCase()}catch(j){k=h.nodeName}g=g&&!this.invalidHandleTypes[k];g=g&&!this.invalidHandleIds[h.id];for(var d=0,c=this.invalidHandleClasses.length;g&&d<c;++d){g=!Ext.fly(h).hasClass(this.invalidHandleClasses[d])}return g},setXTicks:function(g,c){this.xTicks=[];this.xTickSize=c;var e={};for(var d=this.initPageX;d>=this.minX;d=d-c){if(!e[d]){this.xTicks[this.xTicks.length]=d;e[d]=true}}for(d=this.initPageX;d<=this.maxX;d=d+c){if(!e[d]){this.xTicks[this.xTicks.length]=d;e[d]=true}}this.xTicks.sort(this.DDM.numericSort)},setYTicks:function(g,c){this.yTicks=[];this.yTickSize=c;var e={};for(var d=this.initPageY;d>=this.minY;d=d-c){if(!e[d]){this.yTicks[this.yTicks.length]=d;e[d]=true}}for(d=this.initPageY;d<=this.maxY;d=d+c){if(!e[d]){this.yTicks[this.yTicks.length]=d;e[d]=true}}this.yTicks.sort(this.DDM.numericSort)},setXConstraint:function(e,d,c){this.leftConstraint=e;this.rightConstraint=d;this.minX=this.initPageX-e;this.maxX=this.initPageX+d;if(c){this.setXTicks(this.initPageX,c)}this.constrainX=true},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks()},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0},setYConstraint:function(c,e,d){this.topConstraint=c;this.bottomConstraint=e;this.minY=this.initPageY-c;this.maxY=this.initPageY+e;if(d){this.setYTicks(this.initPageY,d)}this.constrainY=true},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var d=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var c=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(d,c)}else{this.setInitPosition()}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize)}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize)}},getTick:function(k,g){if(!g){return k}else{if(g[0]>=k){return g[0]}else{for(var d=0,c=g.length;d<c;++d){var e=d+1;if(g[e]&&g[e]>=k){var j=k-g[d];var h=g[e]-k;return(h>j)?g[d]:g[e]}}return g[g.length-1]}}},toString:function(){return("DragDrop "+this.id)}}})();if(!Ext.dd.DragDropMgr){Ext.dd.DragDropMgr=function(){var a=Ext.EventManager;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,init:function(){this.initialized=true},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(d,c){for(var e in this.ids){for(var b in this.ids[e]){var g=this.ids[e][b];if(!this.isTypeOfDD(g)){continue}g[d].apply(g,c)}}},_onLoad:function(){this.init();a.on(document,"mouseup",this.handleMouseUp,this,true);a.on(document,"mousemove",this.handleMouseMove,this,true);a.on(window,"unload",this._onUnload,this,true);a.on(window,"resize",this._onResize,this,true)},_onResize:function(b){this._execOnAll("resetConstraints",[])},lock:function(){this.locked=true},unlock:function(){this.locked=false},isLocked:function(){return this.locked},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:350,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(c,b){if(!this.initialized){this.init()}if(!this.ids[b]){this.ids[b]={}}this.ids[b][c.id]=c},removeDDFromGroup:function(d,b){if(!this.ids[b]){this.ids[b]={}}var c=this.ids[b];if(c&&c[d.id]){delete c[d.id]}},_remove:function(c){for(var b in c.groups){if(b&&this.ids[b]&&this.ids[b][c.id]){delete this.ids[b][c.id]}}delete this.handleIds[c.id]},regHandle:function(c,b){if(!this.handleIds[c]){this.handleIds[c]={}}this.handleIds[c][b]=b},isDragDrop:function(b){return(this.getDDById(b))?true:false},getRelated:function(h,c){var g=[];for(var e in h.groups){for(var d in this.ids[e]){var b=this.ids[e][d];if(!this.isTypeOfDD(b)){continue}if(!c||b.isTarget){g[g.length]=b}}}return g},isLegalTarget:function(g,e){var c=this.getRelated(g,true);for(var d=0,b=c.length;d<b;++d){if(c[d].id==e.id){return true}}return false},isTypeOfDD:function(b){return(b&&b.__ygDragDrop)},isHandle:function(c,b){return(this.handleIds[c]&&this.handleIds[c][b])},getDDById:function(c){for(var b in this.ids){if(this.ids[b][c]){return this.ids[b][c]}}return null},handleMouseDown:function(d,c){if(Ext.QuickTips){Ext.QuickTips.ddDisable()}if(this.dragCurrent){this.handleMouseUp(d)}this.currentTarget=d.getTarget();this.dragCurrent=c;var b=c.getEl();this.startX=d.getPageX();this.startY=d.getPageY();this.deltaX=this.startX-b.offsetLeft;this.deltaY=this.startY-b.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var e=Ext.dd.DDM;e.startDrag(e.startX,e.startY)},this.clickTimeThresh)},startDrag:function(b,c){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(b,c);this.dragCurrent.startDrag(b,c)}this.dragThreshMet=true},handleMouseUp:function(b){if(Ext.QuickTips){Ext.QuickTips.ddEnable()}if(!this.dragCurrent){return}clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(b,true)}else{}this.stopDrag(b);this.stopEvent(b)},stopEvent:function(b){if(this.stopPropagation){b.stopPropagation()}if(this.preventDefault){b.preventDefault()}},stopDrag:function(b){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(b);this.dragCurrent.endDrag(b)}this.dragCurrent.onMouseUp(b)}this.dragCurrent=null;this.dragOvers={}},handleMouseMove:function(d){if(!this.dragCurrent){return true}if(Ext.isIE&&(d.button!==0&&d.button!==1&&d.button!==2)){this.stopEvent(d);return this.handleMouseUp(d)}if(!this.dragThreshMet){var c=Math.abs(this.startX-d.getPageX());var b=Math.abs(this.startY-d.getPageY());if(c>this.clickPixelThresh||b>this.clickPixelThresh){this.startDrag(this.startX,this.startY)}}if(this.dragThreshMet){this.dragCurrent.b4Drag(d);this.dragCurrent.onDrag(d);if(!this.dragCurrent.moveOnly){this.fireEvents(d,false)}}this.stopEvent(d);return true},fireEvents:function(n,o){var q=this.dragCurrent;if(!q||q.isLocked()){return}var r=n.getPoint();var b=[];var g=[];var l=[];var j=[];var d=[];for(var h in this.dragOvers){var c=this.dragOvers[h];if(!this.isTypeOfDD(c)){continue}if(!this.isOverTarget(r,c,this.mode)){g.push(c)}b[h]=true;delete this.dragOvers[h]}for(var p in q.groups){if("string"!=typeof p){continue}for(h in this.ids[p]){var k=this.ids[p][h];if(!this.isTypeOfDD(k)){continue}if(k.isTarget&&!k.isLocked()&&((k!=q)||(q.ignoreSelf===false))){if(this.isOverTarget(r,k,this.mode)){if(o){j.push(k)}else{if(!b[k.id]){d.push(k)}else{l.push(k)}this.dragOvers[k.id]=k}}}}}if(this.mode){if(g.length){q.b4DragOut(n,g);q.onDragOut(n,g)}if(d.length){q.onDragEnter(n,d)}if(l.length){q.b4DragOver(n,l);q.onDragOver(n,l)}if(j.length){q.b4DragDrop(n,j);q.onDragDrop(n,j)}}else{var m=0;for(h=0,m=g.length;h<m;++h){q.b4DragOut(n,g[h].id);q.onDragOut(n,g[h].id)}for(h=0,m=d.length;h<m;++h){q.onDragEnter(n,d[h].id)}for(h=0,m=l.length;h<m;++h){q.b4DragOver(n,l[h].id);q.onDragOver(n,l[h].id)}for(h=0,m=j.length;h<m;++h){q.b4DragDrop(n,j[h].id);q.onDragDrop(n,j[h].id)}}if(o&&!j.length){q.onInvalidDrop(n)}},getBestMatch:function(d){var g=null;var c=d.length;if(c==1){g=d[0]}else{for(var e=0;e<c;++e){var b=d[e];if(b.cursorIsOver){g=b;break}else{if(!g||g.overlap.getArea()<b.overlap.getArea()){g=b}}}}return g},refreshCache:function(c){for(var b in c){if("string"!=typeof b){continue}for(var d in this.ids[b]){var e=this.ids[b][d];if(this.isTypeOfDD(e)){var g=this.getLocation(e);if(g){this.locationCache[e.id]=g}else{delete this.locationCache[e.id]}}}}},verifyEl:function(c){if(c){var b;if(Ext.isIE){try{b=c.offsetParent}catch(d){}}else{b=c.offsetParent}if(b){return true}}return false},getLocation:function(j){if(!this.isTypeOfDD(j)){return null}var h=j.getEl(),o,g,d,q,p,s,c,n,i,m;try{o=Ext.lib.Dom.getXY(h)}catch(k){}if(!o){return null}g=o[0];d=g+h.offsetWidth;q=o[1];p=q+h.offsetHeight;s=q-j.padding[0];c=d+j.padding[1];n=p+j.padding[2];i=g-j.padding[3];m=new Ext.lib.Region(s,c,n,i);h=Ext.get(h.parentNode);while(h&&m){if(h.isScrollable()){m=m.intersect(h.getRegion())}h=h.parent()}return m},isOverTarget:function(k,b,d){var g=this.locationCache[b.id];if(!g||!this.useCache){g=this.getLocation(b);this.locationCache[b.id]=g}if(!g){return false}b.cursorIsOver=g.contains(k);var j=this.dragCurrent;if(!j||!j.getTargetCoord||(!d&&!j.constrainX&&!j.constrainY)){return b.cursorIsOver}b.overlap=null;var h=j.getTargetCoord(k.x,k.y);var c=j.getDragEl();var e=new Ext.lib.Region(h.y,h.x+c.offsetWidth,h.y+c.offsetHeight,h.x);var i=e.intersect(g);if(i){b.overlap=i;return(d)?true:b.cursorIsOver}else{return false}},_onUnload:function(c,b){a.removeListener(document,"mouseup",this.handleMouseUp,this);a.removeListener(document,"mousemove",this.handleMouseMove,this);a.removeListener(window,"resize",this._onResize,this);Ext.dd.DragDropMgr.unregAll()},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null}this._execOnAll("unreg",[]);for(var b in this.elementCache){delete this.elementCache[b]}this.elementCache={};this.ids={}},elementCache:{},getElWrapper:function(c){var b=this.elementCache[c];if(!b||!b.el){b=this.elementCache[c]=new this.ElementWrapper(Ext.getDom(c))}return b},getElement:function(b){return Ext.getDom(b)},getCss:function(c){var b=Ext.getDom(c);return(b)?b.style:null},ElementWrapper:function(b){this.el=b||null;this.id=this.el&&b.id;this.css=this.el&&b.style},getPosX:function(b){return Ext.lib.Dom.getX(b)},getPosY:function(b){return Ext.lib.Dom.getY(b)},swapNode:function(d,b){if(d.swapNode){d.swapNode(b)}else{var e=b.parentNode;var c=b.nextSibling;if(c==d){e.insertBefore(d,b)}else{if(b==d.nextSibling){e.insertBefore(b,d)}else{d.parentNode.replaceChild(b,d);e.insertBefore(d,c)}}}},getScroll:function(){var d,b,e=document.documentElement,c=document.body;if(e&&(e.scrollTop||e.scrollLeft)){d=e.scrollTop;b=e.scrollLeft}else{if(c){d=c.scrollTop;b=c.scrollLeft}else{}}return{top:d,left:b}},getStyle:function(c,b){return Ext.fly(c).getStyle(b)},getScrollTop:function(){return this.getScroll().top},getScrollLeft:function(){return this.getScroll().left},moveToEl:function(b,d){var c=Ext.lib.Dom.getXY(d);Ext.lib.Dom.setXY(b,c)},numericSort:function(d,c){return(d-c)},_timeoutCount:0,_addListeners:function(){var b=Ext.dd.DDM;if(Ext.lib.Event&&document){b._onLoad()}else{if(b._timeoutCount>2000){}else{setTimeout(b._addListeners,10);if(document&&document.body){b._timeoutCount+=1}}}},handleWasClicked:function(b,d){if(this.isHandle(d,b.id)){return true}else{var c=b.parentNode;while(c){if(this.isHandle(d,c.id)){return true}else{c=c.parentNode}}}return false}}}();Ext.dd.DDM=Ext.dd.DragDropMgr;Ext.dd.DDM._addListeners()}Ext.dd.DD=function(c,a,b){if(c){this.init(c,a,b)}};Ext.extend(Ext.dd.DD,Ext.dd.DragDrop,{scroll:true,autoOffset:function(c,b){var a=c-this.startPageX;var d=b-this.startPageY;this.setDelta(a,d)},setDelta:function(b,a){this.deltaX=b;this.deltaY=a},setDragElPos:function(c,b){var a=this.getDragEl();this.alignElWithMouse(a,c,b)},alignElWithMouse:function(c,h,g){var e=this.getTargetCoord(h,g);var b=c.dom?c:Ext.fly(c,"_dd");if(!this.deltaSetXY){var i=[e.x,e.y];b.setXY(i);var d=b.getLeft(true);var a=b.getTop(true);this.deltaSetXY=[d-e.x,a-e.y]}else{b.setLeftTop(e.x+this.deltaSetXY[0],e.y+this.deltaSetXY[1])}this.cachePosition(e.x,e.y);this.autoScroll(e.x,e.y,c.offsetHeight,c.offsetWidth);return e},cachePosition:function(b,a){if(b){this.lastPageX=b;this.lastPageY=a}else{var c=Ext.lib.Dom.getXY(this.getEl());this.lastPageX=c[0];this.lastPageY=c[1]}},autoScroll:function(l,k,e,m){if(this.scroll){var n=Ext.lib.Dom.getViewHeight();var b=Ext.lib.Dom.getViewWidth();var p=this.DDM.getScrollTop();var d=this.DDM.getScrollLeft();var j=e+k;var o=m+l;var i=(n+p-k-this.deltaY);var g=(b+d-l-this.deltaX);var c=40;var a=(document.all)?80:30;if(j>n&&i<c){window.scrollTo(d,p+a)}if(k<p&&p>0&&k-p<c){window.scrollTo(d,p-a)}if(o>b&&g<c){window.scrollTo(d+a,p)}if(l<d&&d>0&&l-d<c){window.scrollTo(d-a,p)}}},getTargetCoord:function(c,b){var a=c-this.deltaX;var d=b-this.deltaY;if(this.constrainX){if(a<this.minX){a=this.minX}if(a>this.maxX){a=this.maxX}}if(this.constrainY){if(d<this.minY){d=this.minY}if(d>this.maxY){d=this.maxY}}a=this.getTick(a,this.xTicks);d=this.getTick(d,this.yTicks);return{x:a,y:d}},applyConfig:function(){Ext.dd.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false)},b4MouseDown:function(a){this.autoOffset(a.getPageX(),a.getPageY())},b4Drag:function(a){this.setDragElPos(a.getPageX(),a.getPageY())},toString:function(){return("DD "+this.id)}});Ext.dd.DDProxy=function(c,a,b){if(c){this.init(c,a,b);this.initFrame()}};Ext.dd.DDProxy.dragElId="ygddfdiv";Ext.extend(Ext.dd.DDProxy,Ext.dd.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var b=this;var a=document.body;if(!a||!a.firstChild){setTimeout(function(){b.createFrame()},50);return}var d=this.getDragEl();if(!d){d=document.createElement("div");d.id=this.dragElId;var c=d.style;c.position="absolute";c.visibility="hidden";c.cursor="move";c.border="2px solid #aaa";c.zIndex=999;a.insertBefore(d,a.firstChild)}},initFrame:function(){this.createFrame()},applyConfig:function(){Ext.dd.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||Ext.dd.DDProxy.dragElId)},showFrame:function(e,d){var c=this.getEl();var a=this.getDragEl();var b=a.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(b.width,10)/2),Math.round(parseInt(b.height,10)/2))}this.setDragElPos(e,d);Ext.fly(a).show()},_resizeProxy:function(){if(this.resizeFrame){var a=this.getEl();Ext.fly(this.getDragEl()).setSize(a.offsetWidth,a.offsetHeight)}},b4MouseDown:function(b){var a=b.getPageX();var c=b.getPageY();this.autoOffset(a,c);this.setDragElPos(a,c)},b4StartDrag:function(a,b){this.showFrame(a,b)},b4EndDrag:function(a){Ext.fly(this.getDragEl()).hide()},endDrag:function(c){var b=this.getEl();var a=this.getDragEl();a.style.visibility="";this.beforeMove();b.style.visibility="hidden";Ext.dd.DDM.moveToEl(b,a);a.style.visibility="hidden";b.style.visibility="";this.afterDrag()},beforeMove:function(){},afterDrag:function(){},toString:function(){return("DDProxy "+this.id)}});Ext.dd.DDTarget=function(c,a,b){if(c){this.initTarget(c,a,b)}};Ext.extend(Ext.dd.DDTarget,Ext.dd.DragDrop,{getDragEl:Ext.emptyFn,isValidHandleChild:Ext.emptyFn,startDrag:Ext.emptyFn,endDrag:Ext.emptyFn,onDrag:Ext.emptyFn,onDragDrop:Ext.emptyFn,onDragEnter:Ext.emptyFn,onDragOut:Ext.emptyFn,onDragOver:Ext.emptyFn,onInvalidDrop:Ext.emptyFn,onMouseDown:Ext.emptyFn,onMouseUp:Ext.emptyFn,setXConstraint:Ext.emptyFn,setYConstraint:Ext.emptyFn,resetConstraints:Ext.emptyFn,clearConstraints:Ext.emptyFn,clearTicks:Ext.emptyFn,setInitPosition:Ext.emptyFn,setDragElId:Ext.emptyFn,setHandleElId:Ext.emptyFn,setOuterHandleElId:Ext.emptyFn,addInvalidHandleClass:Ext.emptyFn,addInvalidHandleId:Ext.emptyFn,addInvalidHandleType:Ext.emptyFn,removeInvalidHandleClass:Ext.emptyFn,removeInvalidHandleId:Ext.emptyFn,removeInvalidHandleType:Ext.emptyFn,toString:function(){return("DDTarget "+this.id)}});Ext.dd.DragTracker=Ext.extend(Ext.util.Observable,{active:false,tolerance:5,autoStart:false,constructor:function(a){Ext.apply(this,a);this.addEvents("mousedown","mouseup","mousemove","dragstart","dragend","drag");this.dragRegion=new Ext.lib.Region(0,0,0,0);if(this.el){this.initEl(this.el)}Ext.dd.DragTracker.superclass.constructor.call(this,a)},initEl:function(a){this.el=Ext.get(a);a.on("mousedown",this.onMouseDown,this,this.delegate?{delegate:this.delegate}:undefined)},destroy:function(){this.el.un("mousedown",this.onMouseDown,this);delete this.el},onMouseDown:function(b,a){if(this.fireEvent("mousedown",this,b)!==false&&this.onBeforeStart(b)!==false){this.startXY=this.lastXY=b.getXY();this.dragTarget=this.delegate?a:this.el.dom;if(this.preventDefault!==false){b.preventDefault()}Ext.getDoc().on({scope:this,mouseup:this.onMouseUp,mousemove:this.onMouseMove,selectstart:this.stopSelect});if(this.autoStart){this.timer=this.triggerStart.defer(this.autoStart===true?1000:this.autoStart,this,[b])}}},onMouseMove:function(d,c){if(this.active&&Ext.isIE&&!d.browserEvent.button){d.preventDefault();this.onMouseUp(d);return}d.preventDefault();var b=d.getXY(),a=this.startXY;this.lastXY=b;if(!this.active){if(Math.abs(a[0]-b[0])>this.tolerance||Math.abs(a[1]-b[1])>this.tolerance){this.triggerStart(d)}else{return}}this.fireEvent("mousemove",this,d);this.onDrag(d);this.fireEvent("drag",this,d)},onMouseUp:function(c){var b=Ext.getDoc(),a=this.active;b.un("mousemove",this.onMouseMove,this);b.un("mouseup",this.onMouseUp,this);b.un("selectstart",this.stopSelect,this);c.preventDefault();this.clearStart();this.active=false;delete this.elRegion;this.fireEvent("mouseup",this,c);if(a){this.onEnd(c);this.fireEvent("dragend",this,c)}},triggerStart:function(a){this.clearStart();this.active=true;this.onStart(a);this.fireEvent("dragstart",this,a)},clearStart:function(){if(this.timer){clearTimeout(this.timer);delete this.timer}},stopSelect:function(a){a.stopEvent();return false},onBeforeStart:function(a){},onStart:function(a){},onDrag:function(a){},onEnd:function(a){},getDragTarget:function(){return this.dragTarget},getDragCt:function(){return this.el},getXY:function(a){return a?this.constrainModes[a].call(this,this.lastXY):this.lastXY},getOffset:function(c){var b=this.getXY(c),a=this.startXY;return[a[0]-b[0],a[1]-b[1]]},constrainModes:{point:function(b){if(!this.elRegion){this.elRegion=this.getDragCt().getRegion()}var a=this.dragRegion;a.left=b[0];a.top=b[1];a.right=b[0];a.bottom=b[1];a.constrainTo(this.elRegion);return[a.left,a.top]}}});Ext.dd.ScrollManager=function(){var c=Ext.dd.DragDropMgr;var e={};var b=null;var i={};var h=function(l){b=null;a()};var j=function(){if(c.dragCurrent){c.refreshCache(c.dragCurrent.groups)}};var d=function(){if(c.dragCurrent){var l=Ext.dd.ScrollManager;var m=i.el.ddScrollConfig?i.el.ddScrollConfig.increment:l.increment;if(!l.animate){if(i.el.scroll(i.dir,m)){j()}}else{i.el.scroll(i.dir,m,true,l.animDuration,j)}}};var a=function(){if(i.id){clearInterval(i.id)}i.id=0;i.el=null;i.dir=""};var g=function(m,l){a();i.el=m;i.dir=l;var o=m.ddScrollConfig?m.ddScrollConfig.ddGroup:undefined,n=(m.ddScrollConfig&&m.ddScrollConfig.frequency)?m.ddScrollConfig.frequency:Ext.dd.ScrollManager.frequency;if(o===undefined||c.dragCurrent.ddGroup==o){i.id=setInterval(d,n)}};var k=function(o,q){if(q||!c.dragCurrent){return}var s=Ext.dd.ScrollManager;if(!b||b!=c.dragCurrent){b=c.dragCurrent;s.refreshCache()}var t=Ext.lib.Event.getXY(o);var u=new Ext.lib.Point(t[0],t[1]);for(var m in e){var n=e[m],l=n._region;var p=n.ddScrollConfig?n.ddScrollConfig:s;if(l&&l.contains(u)&&n.isScrollable()){if(l.bottom-u.y<=p.vthresh){if(i.el!=n){g(n,"down")}return}else{if(l.right-u.x<=p.hthresh){if(i.el!=n){g(n,"left")}return}else{if(u.y-l.top<=p.vthresh){if(i.el!=n){g(n,"up")}return}else{if(u.x-l.left<=p.hthresh){if(i.el!=n){g(n,"right")}return}}}}}}a()};c.fireEvents=c.fireEvents.createSequence(k,c);c.stopDrag=c.stopDrag.createSequence(h,c);return{register:function(n){if(Ext.isArray(n)){for(var m=0,l=n.length;m<l;m++){this.register(n[m])}}else{n=Ext.get(n);e[n.id]=n}},unregister:function(n){if(Ext.isArray(n)){for(var m=0,l=n.length;m<l;m++){this.unregister(n[m])}}else{n=Ext.get(n);delete e[n.id]}},vthresh:25,hthresh:25,increment:100,frequency:500,animate:true,animDuration:0.4,ddGroup:undefined,refreshCache:function(){for(var l in e){if(typeof e[l]=="object"){e[l]._region=e[l].getRegion()}}}}}();Ext.dd.Registry=function(){var d={};var b={};var a=0;var c=function(g,e){if(typeof g=="string"){return g}var h=g.id;if(!h&&e!==false){h="extdd-"+(++a);g.id=h}return h};return{register:function(j,k){k=k||{};if(typeof j=="string"){j=document.getElementById(j)}k.ddel=j;d[c(j)]=k;if(k.isHandle!==false){b[k.ddel.id]=k}if(k.handles){var h=k.handles;for(var g=0,e=h.length;g<e;g++){b[c(h[g])]=k}}},unregister:function(j){var l=c(j,false);var k=d[l];if(k){delete d[l];if(k.handles){var h=k.handles;for(var g=0,e=h.length;g<e;g++){delete b[c(h[g],false)]}}}},getHandle:function(e){if(typeof e!="string"){e=e.id}return b[e]},getHandleFromEvent:function(h){var g=Ext.lib.Event.getTarget(h);return g?b[g.id]:null},getTarget:function(e){if(typeof e!="string"){e=e.id}return d[e]},getTargetFromEvent:function(h){var g=Ext.lib.Event.getTarget(h);return g?d[g.id]||b[g.id]:null}}}();Ext.dd.StatusProxy=function(a){Ext.apply(this,a);this.id=this.id||Ext.id();this.el=new Ext.Layer({dh:{id:this.id,tag:"div",cls:"x-dd-drag-proxy "+this.dropNotAllowed,children:[{tag:"div",cls:"x-dd-drop-icon"},{tag:"div",cls:"x-dd-drag-ghost"}]},shadow:!a||a.shadow!==false});this.ghost=Ext.get(this.el.dom.childNodes[1]);this.dropStatus=this.dropNotAllowed};Ext.dd.StatusProxy.prototype={dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",setStatus:function(a){a=a||this.dropNotAllowed;if(this.dropStatus!=a){this.el.replaceClass(this.dropStatus,a);this.dropStatus=a}},reset:function(a){this.el.dom.className="x-dd-drag-proxy "+this.dropNotAllowed;this.dropStatus=this.dropNotAllowed;if(a){this.ghost.update("")}},update:function(a){if(typeof a=="string"){this.ghost.update(a)}else{this.ghost.update("");a.style.margin="0";this.ghost.dom.appendChild(a)}var b=this.ghost.dom.firstChild;if(b){Ext.fly(b).setStyle("float","none")}},getEl:function(){return this.el},getGhost:function(){return this.ghost},hide:function(a){this.el.hide();if(a){this.reset(true)}},stop:function(){if(this.anim&&this.anim.isAnimated&&this.anim.isAnimated()){this.anim.stop()}},show:function(){this.el.show()},sync:function(){this.el.sync()},repair:function(b,c,a){this.callback=c;this.scope=a;if(b&&this.animRepair!==false){this.el.addClass("x-dd-drag-repair");this.el.hideUnders(true);this.anim=this.el.shift({duration:this.repairDuration||0.5,easing:"easeOut",xy:b,stopFx:true,callback:this.afterRepair,scope:this})}else{this.afterRepair()}},afterRepair:function(){this.hide(true);if(typeof this.callback=="function"){this.callback.call(this.scope||this)}this.callback=null;this.scope=null},destroy:function(){Ext.destroy(this.ghost,this.el)}};Ext.dd.DragSource=function(b,a){this.el=Ext.get(b);if(!this.dragData){this.dragData={}}Ext.apply(this,a);if(!this.proxy){this.proxy=new Ext.dd.StatusProxy()}Ext.dd.DragSource.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{dragElId:this.proxy.id,resizeFrame:false,isTarget:false,scroll:this.scroll===true});this.dragging=false};Ext.extend(Ext.dd.DragSource,Ext.dd.DDProxy,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",getDragData:function(a){return this.dragData},onDragEnter:function(c,d){var b=Ext.dd.DragDropMgr.getDDById(d);this.cachedTarget=b;if(this.beforeDragEnter(b,c,d)!==false){if(b.isNotifyTarget){var a=b.notifyEnter(this,c,this.dragData);this.proxy.setStatus(a)}else{this.proxy.setStatus(this.dropAllowed)}if(this.afterDragEnter){this.afterDragEnter(b,c,d)}}},beforeDragEnter:function(b,a,c){return true},alignElWithMouse:function(){Ext.dd.DragSource.superclass.alignElWithMouse.apply(this,arguments);this.proxy.sync()},onDragOver:function(c,d){var b=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(d);if(this.beforeDragOver(b,c,d)!==false){if(b.isNotifyTarget){var a=b.notifyOver(this,c,this.dragData);this.proxy.setStatus(a)}if(this.afterDragOver){this.afterDragOver(b,c,d)}}},beforeDragOver:function(b,a,c){return true},onDragOut:function(b,c){var a=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(c);if(this.beforeDragOut(a,b,c)!==false){if(a.isNotifyTarget){a.notifyOut(this,b,this.dragData)}this.proxy.reset();if(this.afterDragOut){this.afterDragOut(a,b,c)}}this.cachedTarget=null},beforeDragOut:function(b,a,c){return true},onDragDrop:function(b,c){var a=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(c);if(this.beforeDragDrop(a,b,c)!==false){if(a.isNotifyTarget){if(a.notifyDrop(this,b,this.dragData)){this.onValidDrop(a,b,c)}else{this.onInvalidDrop(a,b,c)}}else{this.onValidDrop(a,b,c)}if(this.afterDragDrop){this.afterDragDrop(a,b,c)}}delete this.cachedTarget},beforeDragDrop:function(b,a,c){return true},onValidDrop:function(b,a,c){this.hideProxy();if(this.afterValidDrop){this.afterValidDrop(b,a,c)}},getRepairXY:function(b,a){return this.el.getXY()},onInvalidDrop:function(b,a,c){this.beforeInvalidDrop(b,a,c);if(this.cachedTarget){if(this.cachedTarget.isNotifyTarget){this.cachedTarget.notifyOut(this,a,this.dragData)}this.cacheTarget=null}this.proxy.repair(this.getRepairXY(a,this.dragData),this.afterRepair,this);if(this.afterInvalidDrop){this.afterInvalidDrop(a,c)}},afterRepair:function(){if(Ext.enableFx){this.el.highlight(this.hlColor||"c3daf9")}this.dragging=false},beforeInvalidDrop:function(b,a,c){return true},handleMouseDown:function(b){if(this.dragging){return}var a=this.getDragData(b);if(a&&this.onBeforeDrag(a,b)!==false){this.dragData=a;this.proxy.stop();Ext.dd.DragSource.superclass.handleMouseDown.apply(this,arguments)}},onBeforeDrag:function(a,b){return true},onStartDrag:Ext.emptyFn,startDrag:function(a,b){this.proxy.reset();this.dragging=true;this.proxy.update("");this.onInitDrag(a,b);this.proxy.show()},onInitDrag:function(a,c){var b=this.el.dom.cloneNode(true);b.id=Ext.id();this.proxy.update(b);this.onStartDrag(a,c);return true},getProxy:function(){return this.proxy},hideProxy:function(){this.proxy.hide();this.proxy.reset(true);this.dragging=false},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)},b4EndDrag:function(a){},endDrag:function(a){this.onEndDrag(this.dragData,a)},onEndDrag:function(a,b){},autoOffset:function(a,b){this.setDelta(-12,-20)},destroy:function(){Ext.dd.DragSource.superclass.destroy.call(this);Ext.destroy(this.proxy)}});Ext.dd.DropTarget=Ext.extend(Ext.dd.DDTarget,{constructor:function(b,a){this.el=Ext.get(b);Ext.apply(this,a);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el)}Ext.dd.DropTarget.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{isTarget:true})},dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",isTarget:true,isNotifyTarget:true,notifyEnter:function(a,c,b){if(this.overClass){this.el.addClass(this.overClass)}return this.dropAllowed},notifyOver:function(a,c,b){return this.dropAllowed},notifyOut:function(a,c,b){if(this.overClass){this.el.removeClass(this.overClass)}},notifyDrop:function(a,c,b){return false},destroy:function(){Ext.dd.DropTarget.superclass.destroy.call(this);if(this.containerScroll){Ext.dd.ScrollManager.unregister(this.el)}}});Ext.dd.DragZone=Ext.extend(Ext.dd.DragSource,{constructor:function(b,a){Ext.dd.DragZone.superclass.constructor.call(this,b,a);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el)}},getDragData:function(a){return Ext.dd.Registry.getHandleFromEvent(a)},onInitDrag:function(a,b){this.proxy.update(this.dragData.ddel.cloneNode(true));this.onStartDrag(a,b);return true},afterRepair:function(){if(Ext.enableFx){Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9")}this.dragging=false},getRepairXY:function(a){return Ext.Element.fly(this.dragData.ddel).getXY()},destroy:function(){Ext.dd.DragZone.superclass.destroy.call(this);if(this.containerScroll){Ext.dd.ScrollManager.unregister(this.el)}}});Ext.dd.DropZone=function(b,a){Ext.dd.DropZone.superclass.constructor.call(this,b,a)};Ext.extend(Ext.dd.DropZone,Ext.dd.DropTarget,{getTargetFromEvent:function(a){return Ext.dd.Registry.getTargetFromEvent(a)},onNodeEnter:function(d,a,c,b){},onNodeOver:function(d,a,c,b){return this.dropAllowed},onNodeOut:function(d,a,c,b){},onNodeDrop:function(d,a,c,b){return false},onContainerOver:function(a,c,b){return this.dropNotAllowed},onContainerDrop:function(a,c,b){return false},notifyEnter:function(a,c,b){return this.dropNotAllowed},notifyOver:function(a,c,b){var d=this.getTargetFromEvent(c);if(!d){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,a,c,b);this.lastOverNode=null}return this.onContainerOver(a,c,b)}if(this.lastOverNode!=d){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,a,c,b)}this.onNodeEnter(d,a,c,b);this.lastOverNode=d}return this.onNodeOver(d,a,c,b)},notifyOut:function(a,c,b){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,a,c,b);this.lastOverNode=null}},notifyDrop:function(a,c,b){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,a,c,b);this.lastOverNode=null}var d=this.getTargetFromEvent(c);return d?this.onNodeDrop(d,a,c,b):this.onContainerDrop(a,c,b)},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)}});Ext.Element.addMethods({initDD:function(c,b,d){var a=new Ext.dd.DD(Ext.id(this.dom),c,b);return Ext.apply(a,d)},initDDProxy:function(c,b,d){var a=new Ext.dd.DDProxy(Ext.id(this.dom),c,b);return Ext.apply(a,d)},initDDTarget:function(c,b,d){var a=new Ext.dd.DDTarget(Ext.id(this.dom),c,b);return Ext.apply(a,d)}});Ext.data.Api=(function(){var a={};return{actions:{create:"create",read:"read",update:"update",destroy:"destroy"},restActions:{create:"POST",read:"GET",update:"PUT",destroy:"DELETE"},isAction:function(b){return(Ext.data.Api.actions[b])?true:false},getVerb:function(b){if(a[b]){return a[b]}for(var c in this.actions){if(this.actions[c]===b){a[b]=c;break}}return(a[b]!==undefined)?a[b]:null},isValid:function(b){var e=[];var d=this.actions;for(var c in b){if(!(c in d)){e.push(c)}}return(!e.length)?true:e},hasUniqueUrl:function(c,g){var b=(c.api[g])?c.api[g].url:null;var e=true;for(var d in c.api){if((e=(d===g)?true:(c.api[d].url!=b)?true:false)===false){break}}return e},prepare:function(b){if(!b.api){b.api={}}for(var d in this.actions){var c=this.actions[d];b.api[c]=b.api[c]||b.url||b.directFn;if(typeof(b.api[c])=="string"){b.api[c]={url:b.api[c],method:(b.restful===true)?Ext.data.Api.restActions[c]:undefined}}}},restify:function(b){b.restful=true;for(var c in this.restActions){b.api[this.actions[c]].method||(b.api[this.actions[c]].method=this.restActions[c])}b.onWrite=b.onWrite.createInterceptor(function(i,j,g,e){var d=j.reader;var h=new Ext.data.Response({action:i,raw:g});switch(g.status){case 200:return true;break;case 201:if(Ext.isEmpty(h.raw.responseText)){h.success=true}else{return true}break;case 204:h.success=true;h.data=null;break;default:return true;break}if(h.success===true){this.fireEvent("write",this,i,h.data,h,e,j.request.arg)}else{this.fireEvent("exception",this,"remote",i,j,h,e)}j.request.callback.call(j.request.scope,h.data,h,h.success);return false},b)}}})();Ext.data.Response=function(b,a){Ext.apply(this,b,{raw:a})};Ext.data.Response.prototype={message:null,success:false,status:null,root:null,raw:null,getMessage:function(){return this.message},getSuccess:function(){return this.success},getStatus:function(){return this.status},getRoot:function(){return this.root},getRawResponse:function(){return this.raw}};Ext.data.Api.Error=Ext.extend(Ext.Error,{constructor:function(b,a){this.arg=a;Ext.Error.call(this,b)},name:"Ext.data.Api"});Ext.apply(Ext.data.Api.Error.prototype,{lang:{"action-url-undefined":"No fallback url defined for this action. When defining a DataProxy api, please be sure to define an url for each CRUD action in Ext.data.Api.actions or define a default url in addition to your api-configuration.",invalid:"received an invalid API-configuration. Please ensure your proxy API-configuration contains only the actions defined in Ext.data.Api.actions","invalid-url":"Invalid url. Please review your proxy configuration.",execute:'Attempted to execute an unknown action. Valid API actions are defined in Ext.data.Api.actions"'}});Ext.data.SortTypes={none:function(a){return a},stripTagsRE:/<\/?[^>]+>/gi,asText:function(a){return String(a).replace(this.stripTagsRE,"")},asUCText:function(a){return String(a).toUpperCase().replace(this.stripTagsRE,"")},asUCString:function(a){return String(a).toUpperCase()},asDate:function(a){if(!a){return 0}if(Ext.isDate(a)){return a.getTime()}return Date.parse(String(a))},asFloat:function(a){var b=parseFloat(String(a).replace(/,/g,""));return isNaN(b)?0:b},asInt:function(a){var b=parseInt(String(a).replace(/,/g,""),10);return isNaN(b)?0:b}};Ext.data.Record=function(a,b){this.id=(b||b===0)?b:Ext.data.Record.id(this);this.data=a||{}};Ext.data.Record.create=function(e){var c=Ext.extend(Ext.data.Record,{});var d=c.prototype;d.fields=new Ext.util.MixedCollection(false,function(g){return g.name});for(var b=0,a=e.length;b<a;b++){d.fields.add(new Ext.data.Field(e[b]))}c.getField=function(g){return d.fields.get(g)};return c};Ext.data.Record.PREFIX="ext-record";Ext.data.Record.AUTO_ID=1;Ext.data.Record.EDIT="edit";Ext.data.Record.REJECT="reject";Ext.data.Record.COMMIT="commit";Ext.data.Record.id=function(a){a.phantom=true;return[Ext.data.Record.PREFIX,"-",Ext.data.Record.AUTO_ID++].join("")};Ext.data.Record.prototype={dirty:false,editing:false,error:null,modified:null,phantom:false,join:function(a){this.store=a},set:function(a,c){var b=Ext.isPrimitive(c)?String:Ext.encode;if(b(this.data[a])==b(c)){return}this.dirty=true;if(!this.modified){this.modified={}}if(this.modified[a]===undefined){this.modified[a]=this.data[a]}this.data[a]=c;if(!this.editing){this.afterEdit()}},afterEdit:function(){if(this.store!=undefined&&typeof this.store.afterEdit=="function"){this.store.afterEdit(this)}},afterReject:function(){if(this.store){this.store.afterReject(this)}},afterCommit:function(){if(this.store){this.store.afterCommit(this)}},get:function(a){return this.data[a]},beginEdit:function(){this.editing=true;this.modified=this.modified||{}},cancelEdit:function(){this.editing=false;delete this.modified},endEdit:function(){this.editing=false;if(this.dirty){this.afterEdit()}},reject:function(b){var a=this.modified;for(var c in a){if(typeof a[c]!="function"){this.data[c]=a[c]}}this.dirty=false;delete this.modified;this.editing=false;if(b!==true){this.afterReject()}},commit:function(a){this.dirty=false;delete this.modified;this.editing=false;if(a!==true){this.afterCommit()}},getChanges:function(){var a=this.modified,b={};for(var c in a){if(a.hasOwnProperty(c)){b[c]=this.data[c]}}return b},hasError:function(){return this.error!==null},clearError:function(){this.error=null},copy:function(a){return new this.constructor(Ext.apply({},this.data),a||this.id)},isModified:function(a){return !!(this.modified&&this.modified.hasOwnProperty(a))},isValid:function(){return this.fields.find(function(a){return(a.allowBlank===false&&Ext.isEmpty(this.data[a.name]))?true:false},this)?false:true},markDirty:function(){this.dirty=true;if(!this.modified){this.modified={}}this.fields.each(function(a){this.modified[a.name]=this.data[a.name]},this)}};Ext.StoreMgr=Ext.apply(new Ext.util.MixedCollection(),{register:function(){for(var a=0,b;(b=arguments[a]);a++){this.add(b)}},unregister:function(){for(var a=0,b;(b=arguments[a]);a++){this.remove(this.lookup(b))}},lookup:function(e){if(Ext.isArray(e)){var b=["field1"],d=!Ext.isArray(e[0]);if(!d){for(var c=2,a=e[0].length;c<=a;++c){b.push("field"+c)}}return new Ext.data.ArrayStore({fields:b,data:e,expandData:d,autoDestroy:true,autoCreated:true})}return Ext.isObject(e)?(e.events?e:Ext.create(e,"store")):this.get(e)},getKey:function(a){return a.storeId}});Ext.data.Store=Ext.extend(Ext.util.Observable,{writer:undefined,remoteSort:false,autoDestroy:false,pruneModifiedRecords:false,lastOptions:null,autoSave:true,batch:true,restful:false,paramNames:undefined,defaultParamNames:{start:"start",limit:"limit",sort:"sort",dir:"dir"},isDestroyed:false,hasMultiSort:false,batchKey:"_ext_batch_",constructor:function(a){this.data=new Ext.util.MixedCollection(false);this.data.getKey=function(b){return b.id};this.removed=[];if(a&&a.data){this.inlineData=a.data;delete a.data}Ext.apply(this,a);this.baseParams=Ext.isObject(this.baseParams)?this.baseParams:{};this.paramNames=Ext.applyIf(this.paramNames||{},this.defaultParamNames);if((this.url||this.api)&&!this.proxy){this.proxy=new Ext.data.HttpProxy({url:this.url,api:this.api})}if(this.restful===true&&this.proxy){this.batch=false;Ext.data.Api.restify(this.proxy)}if(this.reader){if(!this.recordType){this.recordType=this.reader.recordType}if(this.reader.onMetaChange){this.reader.onMetaChange=this.reader.onMetaChange.createSequence(this.onMetaChange,this)}if(this.writer){if(this.writer instanceof (Ext.data.DataWriter)===false){this.writer=this.buildWriter(this.writer)}this.writer.meta=this.reader.meta;this.pruneModifiedRecords=true}}if(this.recordType){this.fields=this.recordType.prototype.fields}this.modified=[];this.addEvents("datachanged","metachange","add","remove","update","clear","exception","beforeload","load","loadexception","beforewrite","write","beforesave","save");if(this.proxy){this.relayEvents(this.proxy,["loadexception","exception"])}if(this.writer){this.on({scope:this,add:this.createRecords,remove:this.destroyRecord,update:this.updateRecord,clear:this.onClear})}this.sortToggle={};if(this.sortField){this.setDefaultSort(this.sortField,this.sortDir)}else{if(this.sortInfo){this.setDefaultSort(this.sortInfo.field,this.sortInfo.direction)}}Ext.data.Store.superclass.constructor.call(this);if(this.id){this.storeId=this.id;delete this.id}if(this.storeId){Ext.StoreMgr.register(this)}if(this.inlineData){this.loadData(this.inlineData);delete this.inlineData}else{if(this.autoLoad){this.load.defer(10,this,[typeof this.autoLoad=="object"?this.autoLoad:undefined])}}this.batchCounter=0;this.batches={}},buildWriter:function(b){var a=undefined,c=(b.format||"json").toLowerCase();switch(c){case"json":a=Ext.data.JsonWriter;break;case"xml":a=Ext.data.XmlWriter;break;default:a=Ext.data.JsonWriter}return new a(b)},destroy:function(){if(!this.isDestroyed){if(this.storeId){Ext.StoreMgr.unregister(this)}this.clearData();this.data=null;Ext.destroy(this.proxy);this.reader=this.writer=null;this.purgeListeners();this.isDestroyed=true}},add:function(c){var e,a,b,d;c=[].concat(c);if(c.length<1){return}for(e=0,a=c.length;e<a;e++){b=c[e];b.join(this);if(b.dirty||b.phantom){this.modified.push(b)}}d=this.data.length;this.data.addAll(c);if(this.snapshot){this.snapshot.addAll(c)}this.fireEvent("add",this,c,d)},addSorted:function(a){var b=this.findInsertIndex(a);this.insert(b,a)},doUpdate:function(a){var b=a.id;this.getById(b).join(null);this.data.replace(b,a);if(this.snapshot){this.snapshot.replace(b,a)}a.join(this);this.fireEvent("update",this,a,Ext.data.Record.COMMIT)},remove:function(a){if(Ext.isArray(a)){Ext.each(a,function(c){this.remove(c)},this);return}var b=this.data.indexOf(a);if(b>-1){a.join(null);this.data.removeAt(b)}if(this.pruneModifiedRecords){this.modified.remove(a)}if(this.snapshot){this.snapshot.remove(a)}if(b>-1){this.fireEvent("remove",this,a,b)}},removeAt:function(a){this.remove(this.getAt(a))},removeAll:function(b){var a=[];this.each(function(c){a.push(c)});this.clearData();if(this.snapshot){this.snapshot.clear()}if(this.pruneModifiedRecords){this.modified=[]}if(b!==true){this.fireEvent("clear",this,a)}},onClear:function(b,a){Ext.each(a,function(d,c){this.destroyRecord(this,d,c)},this)},insert:function(d,c){var e,a,b;c=[].concat(c);for(e=0,a=c.length;e<a;e++){b=c[e];this.data.insert(d+e,b);b.join(this);if(b.dirty||b.phantom){this.modified.push(b)}}if(this.snapshot){this.snapshot.addAll(c)}this.fireEvent("add",this,c,d)},indexOf:function(a){return this.data.indexOf(a)},indexOfId:function(a){return this.data.indexOfKey(a)},getById:function(a){return(this.snapshot||this.data).key(a)},getAt:function(a){return this.data.itemAt(a)},getRange:function(b,a){return this.data.getRange(b,a)},storeOptions:function(a){a=Ext.apply({},a);delete a.callback;delete a.scope;this.lastOptions=a},clearData:function(){this.data.each(function(a){a.join(null)});this.data.clear()},load:function(b){b=Ext.apply({},b);this.storeOptions(b);if(this.sortInfo&&this.remoteSort){var a=this.paramNames;b.params=Ext.apply({},b.params);b.params[a.sort]=this.sortInfo.field;b.params[a.dir]=this.sortInfo.direction}try{return this.execute("read",null,b)}catch(c){this.handleException(c);return false}},updateRecord:function(b,a,c){if(c==Ext.data.Record.EDIT&&this.autoSave===true&&(!a.phantom||(a.phantom&&a.isValid()))){this.save()}},createRecords:function(c,b,e){var d=this.modified,h=b.length,a,g;for(g=0;g<h;g++){a=b[g];if(a.phantom&&a.isValid()){a.markDirty();if(d.indexOf(a)==-1){d.push(a)}}}if(this.autoSave===true){this.save()}},destroyRecord:function(b,a,c){if(this.modified.indexOf(a)!=-1){this.modified.remove(a)}if(!a.phantom){this.removed.push(a);a.lastIndex=c;if(this.autoSave===true){this.save()}}},execute:function(e,a,c,b){if(!Ext.data.Api.isAction(e)){throw new Ext.data.Api.Error("execute",e)}c=Ext.applyIf(c||{},{params:{}});if(b!==undefined){this.addToBatch(b)}var d=true;if(e==="read"){d=this.fireEvent("beforeload",this,c);Ext.applyIf(c.params,this.baseParams)}else{if(this.writer.listful===true&&this.restful!==true){a=(Ext.isArray(a))?a:[a]}else{if(Ext.isArray(a)&&a.length==1){a=a.shift()}}if((d=this.fireEvent("beforewrite",this,e,a,c))!==false){this.writer.apply(c.params,this.baseParams,e,a)}}if(d!==false){if(this.writer&&this.proxy.url&&!this.proxy.restful&&!Ext.data.Api.hasUniqueUrl(this.proxy,e)){c.params.xaction=e}this.proxy.request(Ext.data.Api.actions[e],a,c.params,this.reader,this.createCallback(e,a,b),this,c)}return d},save:function(){if(!this.writer){throw new Ext.data.Store.Error("writer-undefined")}var h=[],j,k,e,c={},d;if(this.removed.length){h.push(["destroy",this.removed])}var b=[].concat(this.getModifiedRecords());if(b.length){var g=[];for(d=b.length-1;d>=0;d--){if(b[d].phantom===true){var a=b.splice(d,1).shift();if(a.isValid()){g.push(a)}}else{if(!b[d].isValid()){b.splice(d,1)}}}if(g.length){h.push(["create",g])}if(b.length){h.push(["update",b])}}j=h.length;if(j){e=++this.batchCounter;for(d=0;d<j;++d){k=h[d];c[k[0]]=k[1]}if(this.fireEvent("beforesave",this,c)!==false){for(d=0;d<j;++d){k=h[d];this.doTransaction(k[0],k[1],e)}return e}}return -1},doTransaction:function(e,b,c){function g(h){try{this.execute(e,h,undefined,c)}catch(i){this.handleException(i)}}if(this.batch===false){for(var d=0,a=b.length;d<a;d++){g.call(this,b[d])}}else{g.call(this,b)}},addToBatch:function(c){var a=this.batches,d=this.batchKey+c,e=a[d];if(!e){a[d]=e={id:c,count:0,data:{}}}++e.count},removeFromBatch:function(d,h,g){var c=this.batches,e=this.batchKey+d,i=c[e],a;if(i){a=i.data[h]||[];i.data[h]=a.concat(g);if(i.count===1){g=i.data;delete c[e];this.fireEvent("save",this,d,g)}else{--i.count}}},createCallback:function(c,a,b){var d=Ext.data.Api.actions;return(c=="read")?this.loadRecords:function(g,e,h){this["on"+Ext.util.Format.capitalize(c)+"Records"](h,a,[].concat(g));if(h===true){this.fireEvent("write",this,c,g,e,a)}this.removeFromBatch(b,c,g)}},clearModified:function(a){if(Ext.isArray(a)){for(var b=a.length-1;b>=0;b--){this.modified.splice(this.modified.indexOf(a[b]),1)}}else{this.modified.splice(this.modified.indexOf(a),1)}},reMap:function(b){if(Ext.isArray(b)){for(var d=0,a=b.length;d<a;d++){this.reMap(b[d])}}else{delete this.data.map[b._phid];this.data.map[b.id]=b;var c=this.data.keys.indexOf(b._phid);this.data.keys.splice(c,1,b.id);delete b._phid}},onCreateRecords:function(d,a,b){if(d===true){try{this.reader.realize(a,b)}catch(c){this.handleException(c);if(Ext.isArray(a)){this.onCreateRecords(d,a,b)}}}},onUpdateRecords:function(d,a,b){if(d===true){try{this.reader.update(a,b)}catch(c){this.handleException(c);if(Ext.isArray(a)){this.onUpdateRecords(d,a,b)}}}},onDestroyRecords:function(e,b,d){b=(b instanceof Ext.data.Record)?[b]:[].concat(b);for(var c=0,a=b.length;c<a;c++){this.removed.splice(this.removed.indexOf(b[c]),1)}if(e===false){for(c=b.length-1;c>=0;c--){this.insert(b[c].lastIndex,b[c])}}},handleException:function(a){Ext.handleError(a)},reload:function(a){this.load(Ext.applyIf(a||{},this.lastOptions))},loadRecords:function(b,l,h){var e,g;if(this.isDestroyed===true){return}if(!b||h===false){if(h!==false){this.fireEvent("load",this,[],l)}if(l.callback){l.callback.call(l.scope||this,[],l,false,b)}return}var a=b.records,j=b.totalRecords||a.length;if(!l||l.add!==true){if(this.pruneModifiedRecords){this.modified=[]}for(e=0,g=a.length;e<g;e++){a[e].join(this)}if(this.snapshot){this.data=this.snapshot;delete this.snapshot}this.clearData();this.data.addAll(a);this.totalLength=j;this.applySort();this.fireEvent("datachanged",this)}else{var k=[],d,c=0;for(e=0,g=a.length;e<g;++e){d=a[e];if(this.indexOfId(d.id)>-1){this.doUpdate(d)}else{k.push(d);++c}}this.totalLength=Math.max(j,this.data.length+c);this.add(k)}this.fireEvent("load",this,a,l);if(l.callback){l.callback.call(l.scope||this,a,l,true)}},loadData:function(c,a){var b=this.reader.readRecords(c);this.loadRecords(b,{add:a},true)},getCount:function(){return this.data.length||0},getTotalCount:function(){return this.totalLength||0},getSortState:function(){return this.sortInfo},applySort:function(){if((this.sortInfo||this.multiSortInfo)&&!this.remoteSort){this.sortData()}},sortData:function(){var a=this.hasMultiSort?this.multiSortInfo:this.sortInfo,k=a.direction||"ASC",h=a.sorters,c=[];if(!this.hasMultiSort){h=[{direction:k,field:a.field}]}for(var d=0,b=h.length;d<b;d++){c.push(this.createSortFunction(h[d].field,h[d].direction))}if(c.length==0){return}var g=k.toUpperCase()=="DESC"?-1:1;var e=function(n,m){var l=c[0].call(this,n,m);if(c.length>1){for(var p=1,o=c.length;p<o;p++){l=l||c[p].call(this,n,m)}}return g*l};this.data.sort(k,e);if(this.snapshot&&this.snapshot!=this.data){this.snapshot.sort(k,e)}},createSortFunction:function(c,b){b=b||"ASC";var a=b.toUpperCase()=="DESC"?-1:1;var d=this.fields.get(c).sortType;return function(g,e){var i=d(g.data[c]),h=d(e.data[c]);return a*(i>h?1:(i<h?-1:0))}},setDefaultSort:function(b,a){a=a?a.toUpperCase():"ASC";this.sortInfo={field:b,direction:a};this.sortToggle[b]=a},sort:function(b,a){if(Ext.isArray(arguments[0])){return this.multiSort.call(this,b,a)}else{return this.singleSort(b,a)}},singleSort:function(g,c){var e=this.fields.get(g);if(!e){return false}var b=e.name,a=this.sortInfo||null,d=this.sortToggle?this.sortToggle[b]:null;if(!c){if(a&&a.field==b){c=(this.sortToggle[b]||"ASC").toggle("ASC","DESC")}else{c=e.sortDir}}this.sortToggle[b]=c;this.sortInfo={field:b,direction:c};this.hasMultiSort=false;if(this.remoteSort){if(!this.load(this.lastOptions)){if(d){this.sortToggle[b]=d}if(a){this.sortInfo=a}}}else{this.applySort();this.fireEvent("datachanged",this)}return true},multiSort:function(b,a){this.hasMultiSort=true;a=a||"ASC";if(this.multiSortInfo&&a==this.multiSortInfo.direction){a=a.toggle("ASC","DESC")}this.multiSortInfo={sorters:b,direction:a};if(this.remoteSort){this.singleSort(b[0].field,b[0].direction)}else{this.applySort();this.fireEvent("datachanged",this)}},each:function(b,a){this.data.each(b,a)},getModifiedRecords:function(){return this.modified},sum:function(e,g,a){var c=this.data.items,b=0;g=g||0;a=(a||a===0)?a:c.length-1;for(var d=g;d<=a;d++){b+=(c[d].data[e]||0)}return b},createFilterFn:function(d,c,e,a,b){if(Ext.isEmpty(c,false)){return false}c=this.data.createValueMatcher(c,e,a,b);return function(g){return c.test(g.data[d])}},createMultipleFilterFn:function(a){return function(b){var k=true;for(var d=0,c=a.length;d<c;d++){var h=a[d],g=h.fn,e=h.scope;k=k&&g.call(e,b)}return k}},filter:function(n,m,h,k,e){var l;if(Ext.isObject(n)){n=[n]}if(Ext.isArray(n)){var b=[];for(var g=0,d=n.length;g<d;g++){var a=n[g],c=a.fn,o=a.scope||this;if(!Ext.isFunction(c)){c=this.createFilterFn(a.property,a.value,a.anyMatch,a.caseSensitive,a.exactMatch)}b.push({fn:c,scope:o})}l=this.createMultipleFilterFn(b)}else{l=this.createFilterFn(n,m,h,k,e)}return l?this.filterBy(l):this.clearFilter()},filterBy:function(b,a){this.snapshot=this.snapshot||this.data;this.data=this.queryBy(b,a||this);this.fireEvent("datachanged",this)},clearFilter:function(a){if(this.isFiltered()){this.data=this.snapshot;delete this.snapshot;if(a!==true){this.fireEvent("datachanged",this)}}},isFiltered:function(){return !!this.snapshot&&this.snapshot!=this.data},query:function(d,c,e,a){var b=this.createFilterFn(d,c,e,a);return b?this.queryBy(b):this.data.clone()},queryBy:function(b,a){var c=this.snapshot||this.data;return c.filterBy(b,a||this)},find:function(d,c,g,e,a){var b=this.createFilterFn(d,c,e,a);return b?this.data.findIndexBy(b,null,g):-1},findExact:function(b,a,c){return this.data.findIndexBy(function(d){return d.get(b)===a},this,c)},findBy:function(b,a,c){return this.data.findIndexBy(b,a,c)},collect:function(j,k,b){var h=(b===true&&this.snapshot)?this.snapshot.items:this.data.items;var m,n,a=[],c={};for(var e=0,g=h.length;e<g;e++){m=h[e].data[j];n=String(m);if((k||!Ext.isEmpty(m))&&!c[n]){c[n]=true;a[a.length]=m}}return a},afterEdit:function(a){if(this.modified.indexOf(a)==-1){this.modified.push(a)}this.fireEvent("update",this,a,Ext.data.Record.EDIT)},afterReject:function(a){this.modified.remove(a);this.fireEvent("update",this,a,Ext.data.Record.REJECT)},afterCommit:function(a){this.modified.remove(a);this.fireEvent("update",this,a,Ext.data.Record.COMMIT)},commitChanges:function(){var a=this.modified.slice(0),c=a.length,b;for(b=0;b<c;b++){a[b].commit()}this.modified=[];this.removed=[]},rejectChanges:function(){var a=this.modified.slice(0),e=this.removed.slice(0).reverse(),c=a.length,d=e.length,b;for(b=0;b<c;b++){a[b].reject()}for(b=0;b<d;b++){this.insert(e[b].lastIndex||0,e[b]);e[b].reject()}this.modified=[];this.removed=[]},onMetaChange:function(a){this.recordType=this.reader.recordType;this.fields=this.recordType.prototype.fields;delete this.snapshot;if(this.reader.meta.sortInfo){this.sortInfo=this.reader.meta.sortInfo}else{if(this.sortInfo&&!this.fields.get(this.sortInfo.field)){delete this.sortInfo}}if(this.writer){this.writer.meta=this.reader.meta}this.modified=[];this.fireEvent("metachange",this,this.reader.meta)},findInsertIndex:function(a){this.suspendEvents();var c=this.data.clone();this.data.add(a);this.applySort();var b=this.data.indexOf(a);this.data=c;this.resumeEvents();return b},setBaseParam:function(a,b){this.baseParams=this.baseParams||{};this.baseParams[a]=b}});Ext.reg("store",Ext.data.Store);Ext.data.Store.Error=Ext.extend(Ext.Error,{name:"Ext.data.Store"});Ext.apply(Ext.data.Store.Error.prototype,{lang:{"writer-undefined":"Attempted to execute a write-action without a DataWriter installed."}});Ext.data.Field=Ext.extend(Object,{constructor:function(b){if(Ext.isString(b)){b={name:b}}Ext.apply(this,b);var d=Ext.data.Types,a=this.sortType,c;if(this.type){if(Ext.isString(this.type)){this.type=Ext.data.Types[this.type.toUpperCase()]||d.AUTO}}else{this.type=d.AUTO}if(Ext.isString(a)){this.sortType=Ext.data.SortTypes[a]}else{if(Ext.isEmpty(a)){this.sortType=this.type.sortType}}if(!this.convert){this.convert=this.type.convert}},dateFormat:null,useNull:false,defaultValue:"",mapping:null,sortType:null,sortDir:"ASC",allowBlank:true});Ext.data.DataReader=function(a,b){this.meta=a;this.recordType=Ext.isArray(b)?Ext.data.Record.create(b):b;if(this.recordType){this.buildExtractors()}};Ext.data.DataReader.prototype={getTotal:Ext.emptyFn,getRoot:Ext.emptyFn,getMessage:Ext.emptyFn,getSuccess:Ext.emptyFn,getId:Ext.emptyFn,buildExtractors:Ext.emptyFn,extractValues:Ext.emptyFn,realize:function(a,c){if(Ext.isArray(a)){for(var b=a.length-1;b>=0;b--){if(Ext.isArray(c)){this.realize(a.splice(b,1).shift(),c.splice(b,1).shift())}else{this.realize(a.splice(b,1).shift(),c)}}}else{if(Ext.isArray(c)&&c.length==1){c=c.shift()}if(!this.isData(c)){throw new Ext.data.DataReader.Error("realize",a)}a.phantom=false;a._phid=a.id;a.id=this.getId(c);a.data=c;a.commit();a.store.reMap(a)}},update:function(a,c){if(Ext.isArray(a)){for(var b=a.length-1;b>=0;b--){if(Ext.isArray(c)){this.update(a.splice(b,1).shift(),c.splice(b,1).shift())}else{this.update(a.splice(b,1).shift(),c)}}}else{if(Ext.isArray(c)&&c.length==1){c=c.shift()}if(this.isData(c)){a.data=Ext.apply(a.data,c)}a.commit()}},extractData:function(k,a){var j=(this instanceof Ext.data.JsonReader)?"json":"node";var c=[];if(this.isData(k)&&!(this instanceof Ext.data.XmlReader)){k=[k]}var h=this.recordType.prototype.fields,o=h.items,m=h.length,c=[];if(a===true){var l=this.recordType;for(var e=0;e<k.length;e++){var b=k[e];var g=new l(this.extractValues(b,o,m),this.getId(b));g[j]=b;c.push(g)}}else{for(var e=0;e<k.length;e++){var d=this.extractValues(k[e],o,m);d[this.meta.idProperty]=this.getId(k[e]);c.push(d)}}return c},isData:function(a){return(a&&Ext.isObject(a)&&!Ext.isEmpty(this.getId(a)))?true:false},onMetaChange:function(a){delete this.ef;this.meta=a;this.recordType=Ext.data.Record.create(a.fields);this.buildExtractors()}};Ext.data.DataReader.Error=Ext.extend(Ext.Error,{constructor:function(b,a){this.arg=a;Ext.Error.call(this,b)},name:"Ext.data.DataReader"});Ext.apply(Ext.data.DataReader.Error.prototype,{lang:{update:"#update received invalid data from server. Please see docs for DataReader#update and review your DataReader configuration.",realize:"#realize was called with invalid remote-data. Please see the docs for DataReader#realize and review your DataReader configuration.","invalid-response":"#readResponse received an invalid response from the server."}});Ext.data.DataWriter=function(a){Ext.apply(this,a)};Ext.data.DataWriter.prototype={writeAllFields:false,listful:false,apply:function(e,g,d,a){var c=[],b=d+"Record";if(Ext.isArray(a)){Ext.each(a,function(h){c.push(this[b](h))},this)}else{if(a instanceof Ext.data.Record){c=this[b](a)}}this.render(e,g,c)},render:Ext.emptyFn,updateRecord:Ext.emptyFn,createRecord:Ext.emptyFn,destroyRecord:Ext.emptyFn,toHash:function(g,c){var e=g.fields.map,d={},b=(this.writeAllFields===false&&g.phantom===false)?g.getChanges():g.data,a;Ext.iterate(b,function(i,h){if((a=e[i])){d[a.mapping?a.mapping:a.name]=h}});if(g.phantom){if(g.fields.containsKey(this.meta.idProperty)&&Ext.isEmpty(g.data[this.meta.idProperty])){delete d[this.meta.idProperty]}}else{d[this.meta.idProperty]=g.id}return d},toArray:function(b){var a=[];Ext.iterate(b,function(d,c){a.push({name:d,value:c})},this);return a}};Ext.data.DataProxy=function(a){a=a||{};this.api=a.api;this.url=a.url;this.restful=a.restful;this.listeners=a.listeners;this.prettyUrls=a.prettyUrls;this.addEvents("exception","beforeload","load","loadexception","beforewrite","write");Ext.data.DataProxy.superclass.constructor.call(this);try{Ext.data.Api.prepare(this)}catch(b){if(b instanceof Ext.data.Api.Error){b.toConsole()}}Ext.data.DataProxy.relayEvents(this,["beforewrite","write","exception"])};Ext.extend(Ext.data.DataProxy,Ext.util.Observable,{restful:false,setApi:function(){if(arguments.length==1){var a=Ext.data.Api.isValid(arguments[0]);if(a===true){this.api=arguments[0]}else{throw new Ext.data.Api.Error("invalid",a)}}else{if(arguments.length==2){if(!Ext.data.Api.isAction(arguments[0])){throw new Ext.data.Api.Error("invalid",arguments[0])}this.api[arguments[0]]=arguments[1]}}Ext.data.Api.prepare(this)},isApiAction:function(a){return(this.api[a])?true:false},request:function(e,b,g,a,h,d,c){if(!this.api[e]&&!this.load){throw new Ext.data.DataProxy.Error("action-undefined",e)}g=g||{};if((e===Ext.data.Api.actions.read)?this.fireEvent("beforeload",this,g):this.fireEvent("beforewrite",this,e,b,g)!==false){this.doRequest.apply(this,arguments)}else{h.call(d||this,null,c,false)}},load:null,doRequest:function(e,b,g,a,h,d,c){this.load(g,a,h,d,c)},onRead:Ext.emptyFn,onWrite:Ext.emptyFn,buildUrl:function(d,b){b=b||null;var c=(this.conn&&this.conn.url)?this.conn.url:(this.api[d])?this.api[d].url:this.url;if(!c){throw new Ext.data.Api.Error("invalid-url",d)}var e=null;var a=c.match(/(.*)(\.json|\.xml|\.html)$/);if(a){e=a[2];c=a[1]}if((this.restful===true||this.prettyUrls===true)&&b instanceof Ext.data.Record&&!b.phantom){c+="/"+b.id}return(e===null)?c:c+e},destroy:function(){this.purgeListeners()}});Ext.apply(Ext.data.DataProxy,Ext.util.Observable.prototype);Ext.util.Observable.call(Ext.data.DataProxy);Ext.data.DataProxy.Error=Ext.extend(Ext.Error,{constructor:function(b,a){this.arg=a;Ext.Error.call(this,b)},name:"Ext.data.DataProxy"});Ext.apply(Ext.data.DataProxy.Error.prototype,{lang:{"action-undefined":"DataProxy attempted to execute an API-action but found an undefined url / function. Please review your Proxy url/api-configuration.","api-invalid":"Recieved an invalid API-configuration. Please ensure your proxy API-configuration contains only the actions from Ext.data.Api.actions."}});Ext.data.Request=function(a){Ext.apply(this,a)};Ext.data.Request.prototype={action:undefined,rs:undefined,params:undefined,callback:Ext.emptyFn,scope:undefined,reader:undefined};Ext.data.Response=function(a){Ext.apply(this,a)};Ext.data.Response.prototype={action:undefined,success:undefined,message:undefined,data:undefined,raw:undefined,records:undefined};Ext.data.ScriptTagProxy=function(a){Ext.apply(this,a);Ext.data.ScriptTagProxy.superclass.constructor.call(this,a);this.head=document.getElementsByTagName("head")[0]};Ext.data.ScriptTagProxy.TRANS_ID=1000;Ext.extend(Ext.data.ScriptTagProxy,Ext.data.DataProxy,{timeout:30000,callbackParam:"callback",nocache:true,doRequest:function(e,g,d,h,j,k,l){var c=Ext.urlEncode(Ext.apply(d,this.extraParams));var b=this.buildUrl(e,g);if(!b){throw new Ext.data.Api.Error("invalid-url",b)}b=Ext.urlAppend(b,c);if(this.nocache){b=Ext.urlAppend(b,"_dc="+(new Date().getTime()))}var a=++Ext.data.ScriptTagProxy.TRANS_ID;var m={id:a,action:e,cb:"stcCallback"+a,scriptId:"stcScript"+a,params:d,arg:l,url:b,callback:j,scope:k,reader:h};window[m.cb]=this.createCallback(e,g,m);b+=String.format("&{0}={1}",this.callbackParam,m.cb);if(this.autoAbort!==false){this.abort()}m.timeoutId=this.handleFailure.defer(this.timeout,this,[m]);var i=document.createElement("script");i.setAttribute("src",b);i.setAttribute("type","text/javascript");i.setAttribute("id",m.scriptId);this.head.appendChild(i);this.trans=m},createCallback:function(d,b,c){var a=this;return function(e){a.trans=false;a.destroyTrans(c,true);if(d===Ext.data.Api.actions.read){a.onRead.call(a,d,c,e)}else{a.onWrite.call(a,d,c,e,b)}}},onRead:function(d,c,b){var a;try{a=c.reader.readRecords(b)}catch(g){this.fireEvent("loadexception",this,c,b,g);this.fireEvent("exception",this,"response",d,c,b,g);c.callback.call(c.scope||window,null,c.arg,false);return}if(a.success===false){this.fireEvent("loadexception",this,c,b);this.fireEvent("exception",this,"remote",d,c,b,null)}else{this.fireEvent("load",this,b,c.arg)}c.callback.call(c.scope||window,a,c.arg,a.success)},onWrite:function(h,g,c,b){var a=g.reader;try{var d=a.readResponse(h,c)}catch(i){this.fireEvent("exception",this,"response",h,g,d,i);g.callback.call(g.scope||window,null,d,false);return}if(!d.success===true){this.fireEvent("exception",this,"remote",h,g,d,b);g.callback.call(g.scope||window,null,d,false);return}this.fireEvent("write",this,h,d.data,d,b,g.arg);g.callback.call(g.scope||window,d.data,d,true)},isLoading:function(){return this.trans?true:false},abort:function(){if(this.isLoading()){this.destroyTrans(this.trans)}},destroyTrans:function(b,a){this.head.removeChild(document.getElementById(b.scriptId));clearTimeout(b.timeoutId);if(a){window[b.cb]=undefined;try{delete window[b.cb]}catch(c){}}else{window[b.cb]=function(){window[b.cb]=undefined;try{delete window[b.cb]}catch(d){}}}},handleFailure:function(a){this.trans=false;this.destroyTrans(a,false);if(a.action===Ext.data.Api.actions.read){this.fireEvent("loadexception",this,null,a.arg)}this.fireEvent("exception",this,"response",a.action,{response:null,options:a.arg});a.callback.call(a.scope||window,null,a.arg,false)},destroy:function(){this.abort();Ext.data.ScriptTagProxy.superclass.destroy.call(this)}});Ext.data.HttpProxy=function(a){Ext.data.HttpProxy.superclass.constructor.call(this,a);this.conn=a;this.conn.url=null;this.useAjax=!a||!a.events;var c=Ext.data.Api.actions;this.activeRequest={};for(var b in c){this.activeRequest[c[b]]=undefined}};Ext.extend(Ext.data.HttpProxy,Ext.data.DataProxy,{getConnection:function(){return this.useAjax?Ext.Ajax:this.conn},setUrl:function(a,b){this.conn.url=a;if(b===true){this.url=a;this.api=null;Ext.data.Api.prepare(this)}},doRequest:function(g,d,i,c,b,e,a){var h={method:(this.api[g])?this.api[g]["method"]:undefined,request:{callback:b,scope:e,arg:a},reader:c,callback:this.createCallback(g,d),scope:this};if(i.jsonData){h.jsonData=i.jsonData}else{if(i.xmlData){h.xmlData=i.xmlData}else{h.params=i||{}}}this.conn.url=this.buildUrl(g,d);if(this.useAjax){Ext.applyIf(h,this.conn);if(this.activeRequest[g]){}this.activeRequest[g]=Ext.Ajax.request(h)}else{this.conn.request(h)}this.conn.url=null},createCallback:function(b,a){return function(e,d,c){this.activeRequest[b]=undefined;if(!d){if(b===Ext.data.Api.actions.read){this.fireEvent("loadexception",this,e,c)}this.fireEvent("exception",this,"response",b,e,c);e.request.callback.call(e.request.scope,null,e.request.arg,false);return}if(b===Ext.data.Api.actions.read){this.onRead(b,e,c)}else{this.onWrite(b,e,c,a)}}},onRead:function(d,h,b){var a;try{a=h.reader.read(b)}catch(g){this.fireEvent("loadexception",this,h,b,g);this.fireEvent("exception",this,"response",d,h,b,g);h.request.callback.call(h.request.scope,null,h.request.arg,false);return}if(a.success===false){this.fireEvent("loadexception",this,h,b);var c=h.reader.readResponse(d,b);this.fireEvent("exception",this,"remote",d,h,c,null)}else{this.fireEvent("load",this,h,h.request.arg)}h.request.callback.call(h.request.scope,a,h.request.arg,a.success)},onWrite:function(g,i,c,b){var a=i.reader;var d;try{d=a.readResponse(g,c)}catch(h){this.fireEvent("exception",this,"response",g,i,c,h);i.request.callback.call(i.request.scope,null,i.request.arg,false);return}if(d.success===true){this.fireEvent("write",this,g,d.data,d,b,i.request.arg)}else{this.fireEvent("exception",this,"remote",g,i,d,b)}i.request.callback.call(i.request.scope,d.data,d,d.success)},destroy:function(){if(!this.useAjax){this.conn.abort()}else{if(this.activeRequest){var b=Ext.data.Api.actions;for(var a in b){if(this.activeRequest[b[a]]){Ext.Ajax.abort(this.activeRequest[b[a]])}}}}Ext.data.HttpProxy.superclass.destroy.call(this)}});Ext.data.MemoryProxy=function(b){var a={};a[Ext.data.Api.actions.read]=true;Ext.data.MemoryProxy.superclass.constructor.call(this,{api:a});this.data=b};Ext.extend(Ext.data.MemoryProxy,Ext.data.DataProxy,{doRequest:function(b,c,a,d,h,i,j){a=a||{};var k;try{k=d.readRecords(this.data)}catch(g){this.fireEvent("loadexception",this,null,j,g);this.fireEvent("exception",this,"response",b,j,null,g);h.call(i,null,j,false);return}h.call(i,k,j,true)}});Ext.data.Types=new function(){var a=Ext.data.SortTypes;Ext.apply(this,{stripRe:/[\$,%]/g,AUTO:{convert:function(b){return b},sortType:a.none,type:"auto"},STRING:{convert:function(b){return(b===undefined||b===null)?"":String(b)},sortType:a.asUCString,type:"string"},INT:{convert:function(b){return b!==undefined&&b!==null&&b!==""?parseInt(String(b).replace(Ext.data.Types.stripRe,""),10):(this.useNull?null:0)},sortType:a.none,type:"int"},FLOAT:{convert:function(b){return b!==undefined&&b!==null&&b!==""?parseFloat(String(b).replace(Ext.data.Types.stripRe,""),10):(this.useNull?null:0)},sortType:a.none,type:"float"},BOOL:{convert:function(b){return b===true||b==="true"||b==1},sortType:a.none,type:"bool"},DATE:{convert:function(c){var d=this.dateFormat;if(!c){return null}if(Ext.isDate(c)){return c}if(d){if(d=="timestamp"){return new Date(c*1000)}if(d=="time"){return new Date(parseInt(c,10))}return Date.parseDate(c,d)}var b=Date.parse(c);return b?new Date(b):null},sortType:a.asDate,type:"date"}});Ext.apply(this,{BOOLEAN:this.BOOL,INTEGER:this.INT,NUMBER:this.FLOAT})};Ext.data.JsonWriter=Ext.extend(Ext.data.DataWriter,{encode:true,encodeDelete:false,constructor:function(a){Ext.data.JsonWriter.superclass.constructor.call(this,a)},render:function(c,d,b){if(this.encode===true){Ext.apply(c,d);c[this.meta.root]=Ext.encode(b)}else{var a=Ext.apply({},d);a[this.meta.root]=b;c.jsonData=a}},createRecord:function(a){return this.toHash(a)},updateRecord:function(a){return this.toHash(a)},destroyRecord:function(b){if(this.encodeDelete){var a={};a[this.meta.idProperty]=b.id;return a}else{return b.id}}});Ext.data.JsonReader=function(a,b){a=a||{};Ext.applyIf(a,{idProperty:"id",successProperty:"success",totalProperty:"total"});Ext.data.JsonReader.superclass.constructor.call(this,a,b||a.fields)};Ext.extend(Ext.data.JsonReader,Ext.data.DataReader,{read:function(a){var b=a.responseText;var c=Ext.decode(b);if(!c){throw {message:"JsonReader.read: Json object not found"}}return this.readRecords(c)},readResponse:function(e,b){var h=(b.responseText!==undefined)?Ext.decode(b.responseText):b;if(!h){throw new Ext.data.JsonReader.Error("response")}var a=this.getRoot(h),g=this.getSuccess(h);if(g&&e===Ext.data.Api.actions.create){var d=Ext.isDefined(a);if(d&&Ext.isEmpty(a)){throw new Ext.data.JsonReader.Error("root-empty",this.meta.root)}else{if(!d){throw new Ext.data.JsonReader.Error("root-undefined-response",this.meta.root)}}}var c=new Ext.data.Response({action:e,success:g,data:(a)?this.extractData(a,false):[],message:this.getMessage(h),raw:h});if(Ext.isEmpty(c.success)){throw new Ext.data.JsonReader.Error("successProperty-response",this.meta.successProperty)}return c},readRecords:function(a){this.jsonData=a;if(a.metaData){this.onMetaChange(a.metaData)}var m=this.meta,h=this.recordType,b=h.prototype.fields,l=b.items,i=b.length,j;var g=this.getRoot(a),e=g.length,d=e,k=true;if(m.totalProperty){j=parseInt(this.getTotal(a),10);if(!isNaN(j)){d=j}}if(m.successProperty){j=this.getSuccess(a);if(j===false||j==="false"){k=false}}return{success:k,records:this.extractData(g,true),totalRecords:d}},buildExtractors:function(){if(this.ef){return}var l=this.meta,h=this.recordType,e=h.prototype.fields,k=e.items,j=e.length;if(l.totalProperty){this.getTotal=this.createAccessor(l.totalProperty)}if(l.successProperty){this.getSuccess=this.createAccessor(l.successProperty)}if(l.messageProperty){this.getMessage=this.createAccessor(l.messageProperty)}this.getRoot=l.root?this.createAccessor(l.root):function(g){return g};if(l.id||l.idProperty){var d=this.createAccessor(l.id||l.idProperty);this.getId=function(i){var g=d(i);return(g===undefined||g==="")?null:g}}else{this.getId=function(){return null}}var c=[];for(var b=0;b<j;b++){e=k[b];var a=(e.mapping!==undefined&&e.mapping!==null)?e.mapping:e.name;c.push(this.createAccessor(a))}this.ef=c},simpleAccess:function(b,a){return b[a]},createAccessor:function(){var a=/[\[\.]/;return function(c){if(Ext.isEmpty(c)){return Ext.emptyFn}if(Ext.isFunction(c)){return c}var b=String(c).search(a);if(b>=0){return new Function("obj","return obj"+(b>0?".":"")+c)}return function(d){return d[c]}}}(),extractValues:function(h,d,a){var g,c={};for(var e=0;e<a;e++){g=d[e];var b=this.ef[e](h);c[g.name]=g.convert((b!==undefined)?b:g.defaultValue,h)}return c}});Ext.data.JsonReader.Error=Ext.extend(Ext.Error,{constructor:function(b,a){this.arg=a;Ext.Error.call(this,b)},name:"Ext.data.JsonReader"});Ext.apply(Ext.data.JsonReader.Error.prototype,{lang:{response:"An error occurred while json-decoding your server response","successProperty-response":'Could not locate your "successProperty" in your server response. Please review your JsonReader config to ensure the config-property "successProperty" matches the property in your server-response. See the JsonReader docs.',"root-undefined-config":'Your JsonReader was configured without a "root" property. Please review your JsonReader config and make sure to define the root property. See the JsonReader docs.',"idProperty-undefined":'Your JsonReader was configured without an "idProperty" Please review your JsonReader configuration and ensure the "idProperty" is set (e.g.: "id"). See the JsonReader docs.',"root-empty":'Data was expected to be returned by the server in the "root" property of the response. Please review your JsonReader configuration to ensure the "root" property matches that returned in the server-response. See JsonReader docs.'}});Ext.data.ArrayReader=Ext.extend(Ext.data.JsonReader,{readRecords:function(r){this.arrayData=r;var l=this.meta,d=l?Ext.num(l.idIndex,l.id):null,b=this.recordType,q=b.prototype.fields,z=[],e=true,g;var u=this.getRoot(r);for(var y=0,A=u.length;y<A;y++){var t=u[y],a={},p=((d||d===0)&&t[d]!==undefined&&t[d]!==""?t[d]:null);for(var x=0,m=q.length;x<m;x++){var B=q.items[x],w=B.mapping!==undefined&&B.mapping!==null?B.mapping:x;g=t[w]!==undefined?t[w]:B.defaultValue;g=B.convert(g,t);a[B.name]=g}var c=new b(a,p);c.json=t;z[z.length]=c}var h=z.length;if(l.totalProperty){g=parseInt(this.getTotal(r),10);if(!isNaN(g)){h=g}}if(l.successProperty){g=this.getSuccess(r);if(g===false||g==="false"){e=false}}return{success:e,records:z,totalRecords:h}}});Ext.data.ArrayStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.ArrayStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.ArrayReader(a)}))},loadData:function(e,b){if(this.expandData===true){var d=[];for(var c=0,a=e.length;c<a;c++){d[d.length]=[e[c]]}e=d}Ext.data.ArrayStore.superclass.loadData.call(this,e,b)}});Ext.reg("arraystore",Ext.data.ArrayStore);Ext.data.SimpleStore=Ext.data.ArrayStore;Ext.reg("simplestore",Ext.data.SimpleStore);Ext.data.JsonStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.JsonStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.JsonReader(a)}))}});Ext.reg("jsonstore",Ext.data.JsonStore);Ext.data.XmlWriter=function(a){Ext.data.XmlWriter.superclass.constructor.apply(this,arguments);this.tpl=(typeof(this.tpl)==="string")?new Ext.XTemplate(this.tpl).compile():this.tpl.compile()};Ext.extend(Ext.data.XmlWriter,Ext.data.DataWriter,{documentRoot:"xrequest",forceDocumentRoot:false,root:"records",xmlVersion:"1.0",xmlEncoding:"ISO-8859-15",tpl:'<tpl for="."><\u003fxml version="{version}" encoding="{encoding}"\u003f><tpl if="documentRoot"><{documentRoot}><tpl for="baseParams"><tpl for="."><{name}>{value}</{name}></tpl></tpl></tpl><tpl if="records.length&gt;1"><{root}></tpl><tpl for="records"><{parent.record}><tpl for="."><{name}>{value}</{name}></tpl></{parent.record}></tpl><tpl if="records.length&gt;1"></{root}></tpl><tpl if="documentRoot"></{documentRoot}></tpl></tpl>',render:function(b,c,a){c=this.toArray(c);b.xmlData=this.tpl.applyTemplate({version:this.xmlVersion,encoding:this.xmlEncoding,documentRoot:(c.length>0||this.forceDocumentRoot===true)?this.documentRoot:false,record:this.meta.record,root:this.root,baseParams:c,records:(Ext.isArray(a[0]))?a:[a]})},createRecord:function(a){return this.toArray(this.toHash(a))},updateRecord:function(a){return this.toArray(this.toHash(a))},destroyRecord:function(b){var a={};a[this.meta.idProperty]=b.id;return this.toArray(a)}});Ext.data.XmlReader=function(a,b){a=a||{};Ext.applyIf(a,{idProperty:a.idProperty||a.idPath||a.id,successProperty:a.successProperty||a.success});Ext.data.XmlReader.superclass.constructor.call(this,a,b||a.fields)};Ext.extend(Ext.data.XmlReader,Ext.data.DataReader,{read:function(a){var b=a.responseXML;if(!b){throw {message:"XmlReader.read: XML Document not available"}}return this.readRecords(b)},readRecords:function(d){this.xmlData=d;var a=d.documentElement||d,c=Ext.DomQuery,g=0,e=true;if(this.meta.totalProperty){g=this.getTotal(a,0)}if(this.meta.successProperty){e=this.getSuccess(a)}var b=this.extractData(c.select(this.meta.record,a),true);return{success:e,records:b,totalRecords:g||b.length}},readResponse:function(g,b){var e=Ext.DomQuery,h=b.responseXML,a=h.documentElement||h;var c=new Ext.data.Response({action:g,success:this.getSuccess(a),message:this.getMessage(a),data:this.extractData(e.select(this.meta.record,a)||e.select(this.meta.root,a),false),raw:h});if(Ext.isEmpty(c.success)){throw new Ext.data.DataReader.Error("successProperty-response",this.meta.successProperty)}if(g===Ext.data.Api.actions.create){var d=Ext.isDefined(c.data);if(d&&Ext.isEmpty(c.data)){throw new Ext.data.JsonReader.Error("root-empty",this.meta.root)}else{if(!d){throw new Ext.data.JsonReader.Error("root-undefined-response",this.meta.root)}}}return c},getSuccess:function(){return true},buildExtractors:function(){if(this.ef){return}var l=this.meta,h=this.recordType,e=h.prototype.fields,k=e.items,j=e.length;if(l.totalProperty){this.getTotal=this.createAccessor(l.totalProperty)}if(l.successProperty){this.getSuccess=this.createAccessor(l.successProperty)}if(l.messageProperty){this.getMessage=this.createAccessor(l.messageProperty)}this.getRoot=function(g){return(!Ext.isEmpty(g[this.meta.record]))?g[this.meta.record]:g[this.meta.root]};if(l.idPath||l.idProperty){var d=this.createAccessor(l.idPath||l.idProperty);this.getId=function(g){var i=d(g)||g.id;return(i===undefined||i==="")?null:i}}else{this.getId=function(){return null}}var c=[];for(var b=0;b<j;b++){e=k[b];var a=(e.mapping!==undefined&&e.mapping!==null)?e.mapping:e.name;c.push(this.createAccessor(a))}this.ef=c},createAccessor:function(){var a=Ext.DomQuery;return function(b){if(Ext.isFunction(b)){return b}switch(b){case this.meta.totalProperty:return function(c,d){return a.selectNumber(b,c,d)};break;case this.meta.successProperty:return function(d,e){var c=a.selectValue(b,d,true);var g=c!==false&&c!=="false";return g};break;default:return function(c,d){return a.selectValue(b,c,d)};break}}}(),extractValues:function(h,d,a){var g,c={};for(var e=0;e<a;e++){g=d[e];var b=this.ef[e](h);c[g.name]=g.convert((b!==undefined)?b:g.defaultValue,h)}return c}});Ext.data.XmlStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.XmlStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.XmlReader(a)}))}});Ext.reg("xmlstore",Ext.data.XmlStore);Ext.data.GroupingStore=Ext.extend(Ext.data.Store,{constructor:function(d){d=d||{};this.hasMultiSort=true;this.multiSortInfo=this.multiSortInfo||{sorters:[]};var e=this.multiSortInfo.sorters,c=d.groupField||this.groupField,b=d.sortInfo||this.sortInfo,a=d.groupDir||this.groupDir;if(c){e.push({field:c,direction:a})}if(b){e.push(b)}Ext.data.GroupingStore.superclass.constructor.call(this,d);this.addEvents("groupchange");this.applyGroupField()},remoteGroup:false,groupOnSort:false,groupDir:"ASC",clearGrouping:function(){this.groupField=false;if(this.remoteGroup){if(this.baseParams){delete this.baseParams.groupBy;delete this.baseParams.groupDir}var a=this.lastOptions;if(a&&a.params){delete a.params.groupBy;delete a.params.groupDir}this.reload()}else{this.sort();this.fireEvent("datachanged",this)}},groupBy:function(e,a,d){d=d?(String(d).toUpperCase()=="DESC"?"DESC":"ASC"):this.groupDir;if(this.groupField==e&&this.groupDir==d&&!a){return}var c=this.multiSortInfo.sorters;if(c.length>0&&c[0].field==this.groupField){c.shift()}this.groupField=e;this.groupDir=d;this.applyGroupField();var b=function(){this.fireEvent("groupchange",this,this.getGroupState())};if(this.groupOnSort){this.sort(e,d);b.call(this);return}if(this.remoteGroup){this.on("load",b,this,{single:true});this.reload()}else{this.sort(c);b.call(this)}},sort:function(h,c){if(this.remoteSort){return Ext.data.GroupingStore.superclass.sort.call(this,h,c)}var g=[];if(Ext.isArray(arguments[0])){g=arguments[0]}else{if(h==undefined){g=this.sortInfo?[this.sortInfo]:[]}else{var e=this.fields.get(h);if(!e){return false}var b=e.name,a=this.sortInfo||null,d=this.sortToggle?this.sortToggle[b]:null;if(!c){if(a&&a.field==b){c=(this.sortToggle[b]||"ASC").toggle("ASC","DESC")}else{c=e.sortDir}}this.sortToggle[b]=c;this.sortInfo={field:b,direction:c};g=[this.sortInfo]}}if(this.groupField){g.unshift({direction:this.groupDir,field:this.groupField})}return this.multiSort.call(this,g,c)},applyGroupField:function(){if(this.remoteGroup){if(!this.baseParams){this.baseParams={}}Ext.apply(this.baseParams,{groupBy:this.groupField,groupDir:this.groupDir});var a=this.lastOptions;if(a&&a.params){a.params.groupDir=this.groupDir;delete a.params.groupBy}}},applyGrouping:function(a){if(this.groupField!==false){this.groupBy(this.groupField,true,this.groupDir);return true}else{if(a===true){this.fireEvent("datachanged",this)}return false}},getGroupState:function(){return this.groupOnSort&&this.groupField!==false?(this.sortInfo?this.sortInfo.field:undefined):this.groupField}});Ext.reg("groupingstore",Ext.data.GroupingStore);Ext.data.DirectProxy=function(a){Ext.apply(this,a);if(typeof this.paramOrder=="string"){this.paramOrder=this.paramOrder.split(/[\s,|]/)}Ext.data.DirectProxy.superclass.constructor.call(this,a)};Ext.extend(Ext.data.DirectProxy,Ext.data.DataProxy,{paramOrder:undefined,paramsAsHash:true,directFn:undefined,doRequest:function(b,c,a,e,k,l,n){var j=[],h=this.api[b]||this.directFn;switch(b){case Ext.data.Api.actions.create:j.push(a.jsonData);break;case Ext.data.Api.actions.read:if(h.directCfg.method.len>0){if(this.paramOrder){for(var d=0,g=this.paramOrder.length;d<g;d++){j.push(a[this.paramOrder[d]])}}else{if(this.paramsAsHash){j.push(a)}}}break;case Ext.data.Api.actions.update:j.push(a.jsonData);break;case Ext.data.Api.actions.destroy:j.push(a.jsonData);break}var m={params:a||{},request:{callback:k,scope:l,arg:n},reader:e};j.push(this.createCallback(b,c,m),this);h.apply(window,j)},createCallback:function(d,a,b){var c=this;return function(e,g){if(!g.status){if(d===Ext.data.Api.actions.read){c.fireEvent("loadexception",c,b,g,null)}c.fireEvent("exception",c,"remote",d,b,g,null);b.request.callback.call(b.request.scope,null,b.request.arg,false);return}if(d===Ext.data.Api.actions.read){c.onRead(d,b,e,g)}else{c.onWrite(d,b,e,g,a)}}},onRead:function(g,e,a,d){var b;try{b=e.reader.readRecords(a)}catch(c){this.fireEvent("loadexception",this,e,d,c);this.fireEvent("exception",this,"response",g,e,d,c);e.request.callback.call(e.request.scope,null,e.request.arg,false);return}this.fireEvent("load",this,d,e.request.arg);e.request.callback.call(e.request.scope,b,e.request.arg,true)},onWrite:function(g,d,a,c,b){var e=d.reader.extractData(d.reader.getRoot(a),false);var h=d.reader.getSuccess(a);h=(h!==false);if(h){this.fireEvent("write",this,g,e,c,b,d.request.arg)}else{this.fireEvent("exception",this,"remote",g,d,a,b)}d.request.callback.call(d.request.scope,e,c,h)}});Ext.data.DirectStore=Ext.extend(Ext.data.Store,{constructor:function(a){var b=Ext.apply({},{batchTransactions:false},a);Ext.data.DirectStore.superclass.constructor.call(this,Ext.apply(b,{proxy:Ext.isDefined(b.proxy)?b.proxy:new Ext.data.DirectProxy(Ext.copyTo({},b,"paramOrder,paramsAsHash,directFn,api")),reader:(!Ext.isDefined(b.reader)&&b.fields)?new Ext.data.JsonReader(Ext.copyTo({},b,"totalProperty,root,idProperty"),b.fields):b.reader}))}});Ext.reg("directstore",Ext.data.DirectStore);Ext.Direct=Ext.extend(Ext.util.Observable,{exceptions:{TRANSPORT:"xhr",PARSE:"parse",LOGIN:"login",SERVER:"exception"},constructor:function(){this.addEvents("event","exception");this.transactions={};this.providers={}},addProvider:function(e){var c=arguments;if(c.length>1){for(var d=0,b=c.length;d<b;d++){this.addProvider(c[d])}return}if(!e.events){e=new Ext.Direct.PROVIDERS[e.type](e)}e.id=e.id||Ext.id();this.providers[e.id]=e;e.on("data",this.onProviderData,this);e.on("exception",this.onProviderException,this);if(!e.isConnected()){e.connect()}return e},getProvider:function(a){return this.providers[a]},removeProvider:function(b){var a=b.id?b:this.providers[b];a.un("data",this.onProviderData,this);a.un("exception",this.onProviderException,this);delete this.providers[a.id];return a},addTransaction:function(a){this.transactions[a.tid]=a;return a},removeTransaction:function(a){delete this.transactions[a.tid||a];return a},getTransaction:function(a){return this.transactions[a.tid||a]},onProviderData:function(d,c){if(Ext.isArray(c)){for(var b=0,a=c.length;b<a;b++){this.onProviderData(d,c[b])}return}if(c.name&&c.name!="event"&&c.name!="exception"){this.fireEvent(c.name,c)}else{if(c.type=="exception"){this.fireEvent("exception",c)}}this.fireEvent("event",c,d)},createEvent:function(a,b){return new Ext.Direct.eventTypes[a.type](Ext.apply(a,b))}});Ext.Direct=new Ext.Direct();Ext.Direct.TID=1;Ext.Direct.PROVIDERS={};Ext.Direct.Transaction=function(a){Ext.apply(this,a);this.tid=++Ext.Direct.TID;this.retryCount=0};Ext.Direct.Transaction.prototype={send:function(){this.provider.queueTransaction(this)},retry:function(){this.retryCount++;this.send()},getProvider:function(){return this.provider}};Ext.Direct.Event=function(a){Ext.apply(this,a)};Ext.Direct.Event.prototype={status:true,getData:function(){return this.data}};Ext.Direct.RemotingEvent=Ext.extend(Ext.Direct.Event,{type:"rpc",getTransaction:function(){return this.transaction||Ext.Direct.getTransaction(this.tid)}});Ext.Direct.ExceptionEvent=Ext.extend(Ext.Direct.RemotingEvent,{status:false,type:"exception"});Ext.Direct.eventTypes={rpc:Ext.Direct.RemotingEvent,event:Ext.Direct.Event,exception:Ext.Direct.ExceptionEvent};Ext.direct.Provider=Ext.extend(Ext.util.Observable,{priority:1,constructor:function(a){Ext.apply(this,a);this.addEvents("connect","disconnect","data","exception");Ext.direct.Provider.superclass.constructor.call(this,a)},isConnected:function(){return false},connect:Ext.emptyFn,disconnect:Ext.emptyFn});Ext.direct.JsonProvider=Ext.extend(Ext.direct.Provider,{parseResponse:function(a){if(!Ext.isEmpty(a.responseText)){if(typeof a.responseText=="object"){return a.responseText}return Ext.decode(a.responseText)}return null},getEvents:function(j){var g=null;try{g=this.parseResponse(j)}catch(h){var d=new Ext.Direct.ExceptionEvent({data:h,xhr:j,code:Ext.Direct.exceptions.PARSE,message:"Error parsing json response: \n\n "+g});return[d]}var c=[];if(Ext.isArray(g)){for(var b=0,a=g.length;b<a;b++){c.push(Ext.Direct.createEvent(g[b]))}}else{c.push(Ext.Direct.createEvent(g))}return c}});Ext.direct.PollingProvider=Ext.extend(Ext.direct.JsonProvider,{priority:3,interval:3000,constructor:function(a){Ext.direct.PollingProvider.superclass.constructor.call(this,a);this.addEvents("beforepoll","poll")},isConnected:function(){return !!this.pollTask},connect:function(){if(this.url&&!this.pollTask){this.pollTask=Ext.TaskMgr.start({run:function(){if(this.fireEvent("beforepoll",this)!==false){if(typeof this.url=="function"){this.url(this.baseParams)}else{Ext.Ajax.request({url:this.url,callback:this.onData,scope:this,params:this.baseParams})}}},interval:this.interval,scope:this});this.fireEvent("connect",this)}else{if(!this.url){throw"Error initializing PollingProvider, no url configured."}}},disconnect:function(){if(this.pollTask){Ext.TaskMgr.stop(this.pollTask);delete this.pollTask;this.fireEvent("disconnect",this)}},onData:function(d,j,h){if(j){var c=this.getEvents(h);for(var b=0,a=c.length;b<a;b++){var g=c[b];this.fireEvent("data",this,g)}}else{var g=new Ext.Direct.ExceptionEvent({data:g,code:Ext.Direct.exceptions.TRANSPORT,message:"Unable to connect to the server.",xhr:h});this.fireEvent("data",this,g)}}});Ext.Direct.PROVIDERS.polling=Ext.direct.PollingProvider;Ext.direct.RemotingProvider=Ext.extend(Ext.direct.JsonProvider,{enableBuffer:10,maxRetries:1,timeout:undefined,constructor:function(a){Ext.direct.RemotingProvider.superclass.constructor.call(this,a);this.addEvents("beforecall","call");this.namespace=(Ext.isString(this.namespace))?Ext.ns(this.namespace):this.namespace||window;this.transactions={};this.callBuffer=[]},initAPI:function(){var h=this.actions;for(var j in h){var d=this.namespace[j]||(this.namespace[j]={}),e=h[j];for(var g=0,b=e.length;g<b;g++){var a=e[g];d[a.name]=this.createMethod(j,a)}}},isConnected:function(){return !!this.connected},connect:function(){if(this.url){this.initAPI();this.connected=true;this.fireEvent("connect",this)}else{if(!this.url){throw"Error initializing RemotingProvider, no url configured."}}},disconnect:function(){if(this.connected){this.connected=false;this.fireEvent("disconnect",this)}},onData:function(a,h,j){if(h){var k=this.getEvents(j);for(var b=0,c=k.length;b<c;b++){var d=k[b],l=this.getTransaction(d);this.fireEvent("data",this,d);if(l){this.doCallback(l,d,true);Ext.Direct.removeTransaction(l)}}}else{var g=[].concat(a.ts);for(var b=0,c=g.length;b<c;b++){var l=this.getTransaction(g[b]);if(l&&l.retryCount<this.maxRetries){l.retry()}else{var d=new Ext.Direct.ExceptionEvent({data:d,transaction:l,code:Ext.Direct.exceptions.TRANSPORT,message:"Unable to connect to the server.",xhr:j});this.fireEvent("data",this,d);if(l){this.doCallback(l,d,false);Ext.Direct.removeTransaction(l)}}}}},getCallData:function(a){return{action:a.action,method:a.method,data:a.data,type:"rpc",tid:a.tid}},doSend:function(d){var g={url:this.url,callback:this.onData,scope:this,ts:d,timeout:this.timeout},b;if(Ext.isArray(d)){b=[];for(var c=0,a=d.length;c<a;c++){b.push(this.getCallData(d[c]))}}else{b=this.getCallData(d)}if(this.enableUrlEncode){var e={};e[Ext.isString(this.enableUrlEncode)?this.enableUrlEncode:"data"]=Ext.encode(b);g.params=e}else{g.jsonData=b}Ext.Ajax.request(g)},combineAndSend:function(){var a=this.callBuffer.length;if(a>0){this.doSend(a==1?this.callBuffer[0]:this.callBuffer);this.callBuffer=[]}},queueTransaction:function(a){if(a.form){this.processForm(a);return}this.callBuffer.push(a);if(this.enableBuffer){if(!this.callTask){this.callTask=new Ext.util.DelayedTask(this.combineAndSend,this)}this.callTask.delay(Ext.isNumber(this.enableBuffer)?this.enableBuffer:10)}else{this.combineAndSend()}},doCall:function(i,a,b){var h=null,e=b[a.len],g=b[a.len+1];if(a.len!==0){h=b.slice(0,a.len)}var d=new Ext.Direct.Transaction({provider:this,args:b,action:i,method:a.name,data:h,cb:g&&Ext.isFunction(e)?e.createDelegate(g):e});if(this.fireEvent("beforecall",this,d,a)!==false){Ext.Direct.addTransaction(d);this.queueTransaction(d);this.fireEvent("call",this,d,a)}},doForm:function(j,b,g,i,e){var d=new Ext.Direct.Transaction({provider:this,action:j,method:b.name,args:[g,i,e],cb:e&&Ext.isFunction(i)?i.createDelegate(e):i,isForm:true});if(this.fireEvent("beforecall",this,d,b)!==false){Ext.Direct.addTransaction(d);var a=String(g.getAttribute("enctype")).toLowerCase()=="multipart/form-data",h={extTID:d.tid,extAction:j,extMethod:b.name,extType:"rpc",extUpload:String(a)};Ext.apply(d,{form:Ext.getDom(g),isUpload:a,params:i&&Ext.isObject(i.params)?Ext.apply(h,i.params):h});this.fireEvent("call",this,d,b);this.processForm(d)}},processForm:function(a){Ext.Ajax.request({url:this.url,params:a.params,callback:this.onData,scope:this,form:a.form,isUpload:a.isUpload,ts:a})},createMethod:function(d,a){var b;if(!a.formHandler){b=function(){this.doCall(d,a,Array.prototype.slice.call(arguments,0))}.createDelegate(this)}else{b=function(e,g,c){this.doForm(d,a,e,g,c)}.createDelegate(this)}b.directCfg={action:d,method:a};return b},getTransaction:function(a){return a&&a.tid?Ext.Direct.getTransaction(a.tid):null},doCallback:function(c,g){var d=g.status?"success":"failure";if(c&&c.cb){var b=c.cb,a=Ext.isDefined(g.result)?g.result:g.data;if(Ext.isFunction(b)){b(a,g)}else{Ext.callback(b[d],b.scope,[a,g]);Ext.callback(b.callback,b.scope,[a,g])}}}});Ext.Direct.PROVIDERS.remoting=Ext.direct.RemotingProvider;Ext.Resizable=Ext.extend(Ext.util.Observable,{constructor:function(d,e){this.el=Ext.get(d);if(e&&e.wrap){e.resizeChild=this.el;this.el=this.el.wrap(typeof e.wrap=="object"?e.wrap:{cls:"xresizable-wrap"});this.el.id=this.el.dom.id=e.resizeChild.id+"-rzwrap";this.el.setStyle("overflow","hidden");this.el.setPositioning(e.resizeChild.getPositioning());e.resizeChild.clearPositioning();if(!e.width||!e.height){var g=e.resizeChild.getSize();this.el.setSize(g.width,g.height)}if(e.pinned&&!e.adjustments){e.adjustments="auto"}}this.proxy=this.el.createProxy({tag:"div",cls:"x-resizable-proxy",id:this.el.id+"-rzproxy"},Ext.getBody());this.proxy.unselectable();this.proxy.enableDisplayMode("block");Ext.apply(this,e);if(this.pinned){this.disableTrackOver=true;this.el.addClass("x-resizable-pinned")}var k=this.el.getStyle("position");if(k!="absolute"&&k!="fixed"){this.el.setStyle("position","relative")}if(!this.handles){this.handles="s,e,se";if(this.multiDirectional){this.handles+=",n,w"}}if(this.handles=="all"){this.handles="n s e w ne nw se sw"}var o=this.handles.split(/\s*?[,;]\s*?| /);var c=Ext.Resizable.positions;for(var j=0,l=o.length;j<l;j++){if(o[j]&&c[o[j]]){var n=c[o[j]];this[n]=new Ext.Resizable.Handle(this,n,this.disableTrackOver,this.transparent,this.handleCls)}}this.corner=this.southeast;if(this.handles.indexOf("n")!=-1||this.handles.indexOf("w")!=-1){this.updateBox=true}this.activeHandle=null;if(this.resizeChild){if(typeof this.resizeChild=="boolean"){this.resizeChild=Ext.get(this.el.dom.firstChild,true)}else{this.resizeChild=Ext.get(this.resizeChild,true)}}if(this.adjustments=="auto"){var b=this.resizeChild;var m=this.west,h=this.east,a=this.north,o=this.south;if(b&&(m||a)){b.position("relative");b.setLeft(m?m.el.getWidth():0);b.setTop(a?a.el.getHeight():0)}this.adjustments=[(h?-h.el.getWidth():0)+(m?-m.el.getWidth():0),(a?-a.el.getHeight():0)+(o?-o.el.getHeight():0)-1]}if(this.draggable){this.dd=this.dynamic?this.el.initDD(null):this.el.initDDProxy(null,{dragElId:this.proxy.id});this.dd.setHandleElId(this.resizeChild?this.resizeChild.id:this.el.id);if(this.constrainTo){this.dd.constrainTo(this.constrainTo)}}this.addEvents("beforeresize","resize");if(this.width!==null&&this.height!==null){this.resizeTo(this.width,this.height)}else{this.updateChildSize()}if(Ext.isIE){this.el.dom.style.zoom=1}Ext.Resizable.superclass.constructor.call(this)},adjustments:[0,0],animate:false,disableTrackOver:false,draggable:false,duration:0.35,dynamic:false,easing:"easeOutStrong",enabled:true,handles:false,multiDirectional:false,height:null,width:null,heightIncrement:0,widthIncrement:0,minHeight:5,minWidth:5,maxHeight:10000,maxWidth:10000,minX:0,minY:0,pinned:false,preserveRatio:false,resizeChild:false,transparent:false,resizeTo:function(b,a){this.el.setSize(b,a);this.updateChildSize();this.fireEvent("resize",this,b,a,null)},startSizing:function(c,b){this.fireEvent("beforeresize",this,c);if(this.enabled){if(!this.overlay){this.overlay=this.el.createProxy({tag:"div",cls:"x-resizable-overlay",html:"&#160;"},Ext.getBody());this.overlay.unselectable();this.overlay.enableDisplayMode("block");this.overlay.on({scope:this,mousemove:this.onMouseMove,mouseup:this.onMouseUp})}this.overlay.setStyle("cursor",b.el.getStyle("cursor"));this.resizing=true;this.startBox=this.el.getBox();this.startPoint=c.getXY();this.offsets=[(this.startBox.x+this.startBox.width)-this.startPoint[0],(this.startBox.y+this.startBox.height)-this.startPoint[1]];this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();if(this.constrainTo){var a=Ext.get(this.constrainTo);this.resizeRegion=a.getRegion().adjust(a.getFrameWidth("t"),a.getFrameWidth("l"),-a.getFrameWidth("b"),-a.getFrameWidth("r"))}this.proxy.setStyle("visibility","hidden");this.proxy.show();this.proxy.setBox(this.startBox);if(!this.dynamic){this.proxy.setStyle("visibility","visible")}}},onMouseDown:function(a,b){if(this.enabled){b.stopEvent();this.activeHandle=a;this.startSizing(b,a)}},onMouseUp:function(b){this.activeHandle=null;var a=this.resizeElement();this.resizing=false;this.handleOut();this.overlay.hide();this.proxy.hide();this.fireEvent("resize",this,a.width,a.height,b)},updateChildSize:function(){if(this.resizeChild){var d=this.el;var e=this.resizeChild;var c=this.adjustments;if(d.dom.offsetWidth){var a=d.getSize(true);e.setSize(a.width+c[0],a.height+c[1])}if(Ext.isIE){setTimeout(function(){if(d.dom.offsetWidth){var g=d.getSize(true);e.setSize(g.width+c[0],g.height+c[1])}},10)}}},snap:function(c,e,b){if(!e||!c){return c}var d=c;var a=c%e;if(a>0){if(a>(e/2)){d=c+(e-a)}else{d=c-a}}return Math.max(b,d)},resizeElement:function(){var a=this.proxy.getBox();if(this.updateBox){this.el.setBox(a,false,this.animate,this.duration,null,this.easing)}else{this.el.setSize(a.width,a.height,this.animate,this.duration,null,this.easing)}this.updateChildSize();if(!this.dynamic){this.proxy.hide()}if(this.draggable&&this.constrainTo){this.dd.resetConstraints();this.dd.constrainTo(this.constrainTo)}return a},constrain:function(b,c,a,d){if(b-c<a){c=b-a}else{if(b-c>d){c=b-d}}return c},onMouseMove:function(z){if(this.enabled&&this.activeHandle){try{if(this.resizeRegion&&!this.resizeRegion.contains(z.getPoint())){return}var t=this.curSize||this.startBox,l=this.startBox.x,k=this.startBox.y,c=l,b=k,m=t.width,u=t.height,d=m,o=u,n=this.minWidth,A=this.minHeight,s=this.maxWidth,D=this.maxHeight,i=this.widthIncrement,a=this.heightIncrement,B=z.getXY(),r=-(this.startPoint[0]-Math.max(this.minX,B[0])),p=-(this.startPoint[1]-Math.max(this.minY,B[1])),j=this.activeHandle.position,E,g;switch(j){case"east":m+=r;m=Math.min(Math.max(n,m),s);break;case"south":u+=p;u=Math.min(Math.max(A,u),D);break;case"southeast":m+=r;u+=p;m=Math.min(Math.max(n,m),s);u=Math.min(Math.max(A,u),D);break;case"north":p=this.constrain(u,p,A,D);k+=p;u-=p;break;case"west":r=this.constrain(m,r,n,s);l+=r;m-=r;break;case"northeast":m+=r;m=Math.min(Math.max(n,m),s);p=this.constrain(u,p,A,D);k+=p;u-=p;break;case"northwest":r=this.constrain(m,r,n,s);p=this.constrain(u,p,A,D);k+=p;u-=p;l+=r;m-=r;break;case"southwest":r=this.constrain(m,r,n,s);u+=p;u=Math.min(Math.max(A,u),D);l+=r;m-=r;break}var q=this.snap(m,i,n);var C=this.snap(u,a,A);if(q!=m||C!=u){switch(j){case"northeast":k-=C-u;break;case"north":k-=C-u;break;case"southwest":l-=q-m;break;case"west":l-=q-m;break;case"northwest":l-=q-m;k-=C-u;break}m=q;u=C}if(this.preserveRatio){switch(j){case"southeast":case"east":u=o*(m/d);u=Math.min(Math.max(A,u),D);m=d*(u/o);break;case"south":m=d*(u/o);m=Math.min(Math.max(n,m),s);u=o*(m/d);break;case"northeast":m=d*(u/o);m=Math.min(Math.max(n,m),s);u=o*(m/d);break;case"north":E=m;m=d*(u/o);m=Math.min(Math.max(n,m),s);u=o*(m/d);l+=(E-m)/2;break;case"southwest":u=o*(m/d);u=Math.min(Math.max(A,u),D);E=m;m=d*(u/o);l+=E-m;break;case"west":g=u;u=o*(m/d);u=Math.min(Math.max(A,u),D);k+=(g-u)/2;E=m;m=d*(u/o);l+=E-m;break;case"northwest":E=m;g=u;u=o*(m/d);u=Math.min(Math.max(A,u),D);m=d*(u/o);k+=g-u;l+=E-m;break}}this.proxy.setBounds(l,k,m,u);if(this.dynamic){this.resizeElement()}}catch(v){}}},handleOver:function(){if(this.enabled){this.el.addClass("x-resizable-over")}},handleOut:function(){if(!this.resizing){this.el.removeClass("x-resizable-over")}},getEl:function(){return this.el},getResizeChild:function(){return this.resizeChild},destroy:function(b){Ext.destroy(this.dd,this.overlay,this.proxy);this.overlay=null;this.proxy=null;var c=Ext.Resizable.positions;for(var a in c){if(typeof c[a]!="function"&&this[c[a]]){this[c[a]].destroy()}}if(b){this.el.update("");Ext.destroy(this.el);this.el=null}this.purgeListeners()},syncHandleHeight:function(){var a=this.el.getHeight(true);if(this.west){this.west.el.setHeight(a)}if(this.east){this.east.el.setHeight(a)}}});Ext.Resizable.positions={n:"north",s:"south",e:"east",w:"west",se:"southeast",sw:"southwest",nw:"northwest",ne:"northeast"};Ext.Resizable.Handle=Ext.extend(Object,{constructor:function(d,g,c,e,a){if(!this.tpl){var b=Ext.DomHelper.createTemplate({tag:"div",cls:"x-resizable-handle x-resizable-handle-{0}"});b.compile();Ext.Resizable.Handle.prototype.tpl=b}this.position=g;this.rz=d;this.el=this.tpl.append(d.el.dom,[this.position],true);this.el.unselectable();if(e){this.el.setOpacity(0)}if(!Ext.isEmpty(a)){this.el.addClass(a)}this.el.on("mousedown",this.onMouseDown,this);if(!c){this.el.on({scope:this,mouseover:this.onMouseOver,mouseout:this.onMouseOut})}},afterResize:function(a){},onMouseDown:function(a){this.rz.onMouseDown(this,a)},onMouseOver:function(a){this.rz.handleOver(this,a)},onMouseOut:function(a){this.rz.handleOut(this,a)},destroy:function(){Ext.destroy(this.el);this.el=null}});Ext.Window=Ext.extend(Ext.Panel,{baseCls:"x-window",resizable:true,draggable:true,closable:true,closeAction:"close",constrain:false,constrainHeader:false,plain:false,minimizable:false,maximizable:false,minHeight:100,minWidth:200,expandOnShow:true,showAnimDuration:0.25,hideAnimDuration:0.25,collapsible:false,initHidden:undefined,hidden:true,elements:"header,body",frame:true,floating:true,initComponent:function(){this.initTools();Ext.Window.superclass.initComponent.call(this);this.addEvents("resize","maximize","minimize","restore");if(Ext.isDefined(this.initHidden)){this.hidden=this.initHidden}if(this.hidden===false){this.hidden=true;this.show()}},getState:function(){return Ext.apply(Ext.Window.superclass.getState.call(this)||{},this.getBox(true))},onRender:function(b,a){Ext.Window.superclass.onRender.call(this,b,a);if(this.plain){this.el.addClass("x-window-plain")}this.focusEl=this.el.createChild({tag:"a",href:"#",cls:"x-dlg-focus",tabIndex:"-1",html:"&#160;"});this.focusEl.swallowEvent("click",true);this.proxy=this.el.createProxy("x-window-proxy");this.proxy.enableDisplayMode("block");if(this.modal){this.mask=this.container.createChild({cls:"ext-el-mask"},this.el.dom);this.mask.enableDisplayMode("block");this.mask.hide();this.mon(this.mask,"click",this.focus,this)}if(this.maximizable){this.mon(this.header,"dblclick",this.toggleMaximize,this)}},initEvents:function(){Ext.Window.superclass.initEvents.call(this);if(this.animateTarget){this.setAnimateTarget(this.animateTarget)}if(this.resizable){this.resizer=new Ext.Resizable(this.el,{minWidth:this.minWidth,minHeight:this.minHeight,handles:this.resizeHandles||"all",pinned:true,resizeElement:this.resizerAction,handleCls:"x-window-handle"});this.resizer.window=this;this.mon(this.resizer,"beforeresize",this.beforeResize,this)}if(this.draggable){this.header.addClass("x-window-draggable")}this.mon(this.el,"mousedown",this.toFront,this);this.manager=this.manager||Ext.WindowMgr;this.manager.register(this);if(this.maximized){this.maximized=false;this.maximize()}if(this.closable){var a=this.getKeyMap();a.on(27,this.onEsc,this);a.disable()}},initDraggable:function(){this.dd=new Ext.Window.DD(this)},onEsc:function(a,b){if(this.activeGhost){this.unghost()}b.stopEvent();this[this.closeAction]()},beforeDestroy:function(){if(this.rendered){this.hide();this.clearAnchor();Ext.destroy(this.focusEl,this.resizer,this.dd,this.proxy,this.mask)}Ext.Window.superclass.beforeDestroy.call(this)},onDestroy:function(){if(this.manager){this.manager.unregister(this)}Ext.Window.superclass.onDestroy.call(this)},initTools:function(){if(this.minimizable){this.addTool({id:"minimize",handler:this.minimize.createDelegate(this,[])})}if(this.maximizable){this.addTool({id:"maximize",handler:this.maximize.createDelegate(this,[])});this.addTool({id:"restore",handler:this.restore.createDelegate(this,[]),hidden:true})}if(this.closable){this.addTool({id:"close",handler:this[this.closeAction].createDelegate(this,[])})}},resizerAction:function(){var a=this.proxy.getBox();this.proxy.hide();this.window.handleResize(a);return a},beforeResize:function(){this.resizer.minHeight=Math.max(this.minHeight,this.getFrameHeight()+40);this.resizer.minWidth=Math.max(this.minWidth,this.getFrameWidth()+40);this.resizeBox=this.el.getBox()},updateHandles:function(){if(Ext.isIE&&this.resizer){this.resizer.syncHandleHeight();this.el.repaint()}},handleResize:function(b){var a=this.resizeBox;if(a.x!=b.x||a.y!=b.y){this.updateBox(b)}else{this.setSize(b);if(Ext.isIE6&&Ext.isStrict){this.doLayout()}}this.focus();this.updateHandles();this.saveState()},focus:function(){var e=this.focusEl,a=this.defaultButton,c=typeof a,d,b;if(Ext.isDefined(a)){if(Ext.isNumber(a)&&this.fbar){e=this.fbar.items.get(a)}else{if(Ext.isString(a)){e=Ext.getCmp(a)}else{e=a}}d=e.getEl();b=Ext.getDom(this.container);if(d&&b){if(b!=document.body&&!Ext.lib.Region.getRegion(b).contains(Ext.lib.Region.getRegion(d.dom))){return}}}e=e||this.focusEl;e.focus.defer(10,e)},setAnimateTarget:function(a){a=Ext.get(a);this.animateTarget=a},beforeShow:function(){delete this.el.lastXY;delete this.el.lastLT;if(this.x===undefined||this.y===undefined){var a=this.el.getAlignToXY(this.container,"c-c");var b=this.el.translatePoints(a[0],a[1]);this.x=this.x===undefined?b.left:this.x;this.y=this.y===undefined?b.top:this.y}this.el.setLeftTop(this.x,this.y);if(this.expandOnShow){this.expand(false)}if(this.modal){Ext.getBody().addClass("x-body-masked");this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.mask.show()}},show:function(c,a,b){if(!this.rendered){this.render(Ext.getBody())}if(this.hidden===false){this.toFront();return this}if(this.fireEvent("beforeshow",this)===false){return this}if(a){this.on("show",a,b,{single:true})}this.hidden=false;if(Ext.isDefined(c)){this.setAnimateTarget(c)}this.beforeShow();if(this.animateTarget){this.animShow()}else{this.afterShow()}return this},afterShow:function(b){if(this.isDestroyed){return false}this.proxy.hide();this.el.setStyle("display","block");this.el.show();if(this.maximized){this.fitContainer()}if(Ext.isMac&&Ext.isGecko2){this.cascade(this.setAutoScroll)}if(this.monitorResize||this.modal||this.constrain||this.constrainHeader){Ext.EventManager.onWindowResize(this.onWindowResize,this)}this.doConstrain();this.doLayout();if(this.keyMap){this.keyMap.enable()}this.toFront();this.updateHandles();if(b&&(Ext.isIE||Ext.isWebKit)){var a=this.getSize();this.onResize(a.width,a.height)}this.onShow();this.fireEvent("show",this)},animShow:function(){this.proxy.show();this.proxy.setBox(this.animateTarget.getBox());this.proxy.setOpacity(0);var a=this.getBox();this.el.setStyle("display","none");this.proxy.shift(Ext.apply(a,{callback:this.afterShow.createDelegate(this,[true],false),scope:this,easing:"easeNone",duration:this.showAnimDuration,opacity:0.5}))},hide:function(c,a,b){if(this.hidden||this.fireEvent("beforehide",this)===false){return this}if(a){this.on("hide",a,b,{single:true})}this.hidden=true;if(c!==undefined){this.setAnimateTarget(c)}if(this.modal){this.mask.hide();Ext.getBody().removeClass("x-body-masked")}if(this.animateTarget){this.animHide()}else{this.el.hide();this.afterHide()}return this},afterHide:function(){this.proxy.hide();if(this.monitorResize||this.modal||this.constrain||this.constrainHeader){Ext.EventManager.removeResizeListener(this.onWindowResize,this)}if(this.keyMap){this.keyMap.disable()}this.onHide();this.fireEvent("hide",this)},animHide:function(){this.proxy.setOpacity(0.5);this.proxy.show();var a=this.getBox(false);this.proxy.setBox(a);this.el.hide();this.proxy.shift(Ext.apply(this.animateTarget.getBox(),{callback:this.afterHide,scope:this,duration:this.hideAnimDuration,easing:"easeNone",opacity:0}))},onShow:Ext.emptyFn,onHide:Ext.emptyFn,onWindowResize:function(){if(this.maximized){this.fitContainer()}if(this.modal){this.mask.setSize("100%","100%");var a=this.mask.dom.offsetHeight;this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true))}this.doConstrain()},doConstrain:function(){if(this.constrain||this.constrainHeader){var b;if(this.constrain){b={right:this.el.shadowOffset,left:this.el.shadowOffset,bottom:this.el.shadowOffset}}else{var a=this.getSize();b={right:-(a.width-100),bottom:-(a.height-25+this.el.getConstrainOffset())}}var c=this.el.getConstrainToXY(this.container,true,b);if(c){this.setPosition(c[0],c[1])}}},ghost:function(a){var c=this.createGhost(a);var b=this.getBox(true);c.setLeftTop(b.x,b.y);c.setWidth(b.width);this.el.hide();this.activeGhost=c;return c},unghost:function(b,a){if(!this.activeGhost){return}if(b!==false){this.el.show();this.focus.defer(10,this);if(Ext.isMac&&Ext.isGecko2){this.cascade(this.setAutoScroll)}}if(a!==false){this.setPosition(this.activeGhost.getLeft(true),this.activeGhost.getTop(true))}this.activeGhost.hide();this.activeGhost.remove();delete this.activeGhost},minimize:function(){this.fireEvent("minimize",this);return this},close:function(){if(this.fireEvent("beforeclose",this)!==false){if(this.hidden){this.doClose()}else{this.hide(null,this.doClose,this)}}},doClose:function(){this.fireEvent("close",this);this.destroy()},maximize:function(){if(!this.maximized){this.expand(false);this.restoreSize=this.getSize();this.restorePos=this.getPosition(true);if(this.maximizable){this.tools.maximize.hide();this.tools.restore.show()}this.maximized=true;this.el.disableShadow();if(this.dd){this.dd.lock()}if(this.collapsible){this.tools.toggle.hide()}this.el.addClass("x-window-maximized");this.container.addClass("x-window-maximized-ct");this.setPosition(0,0);this.fitContainer();this.fireEvent("maximize",this)}return this},restore:function(){if(this.maximized){var a=this.tools;this.el.removeClass("x-window-maximized");if(a.restore){a.restore.hide()}if(a.maximize){a.maximize.show()}this.setPosition(this.restorePos[0],this.restorePos[1]);this.setSize(this.restoreSize.width,this.restoreSize.height);delete this.restorePos;delete this.restoreSize;this.maximized=false;this.el.enableShadow(true);if(this.dd){this.dd.unlock()}if(this.collapsible&&a.toggle){a.toggle.show()}this.container.removeClass("x-window-maximized-ct");this.doConstrain();this.fireEvent("restore",this)}return this},toggleMaximize:function(){return this[this.maximized?"restore":"maximize"]()},fitContainer:function(){var a=this.container.getViewSize(false);this.setSize(a.width,a.height)},setZIndex:function(a){if(this.modal){this.mask.setStyle("z-index",a)}this.el.setZIndex(++a);a+=5;if(this.resizer){this.resizer.proxy.setStyle("z-index",++a)}this.lastZIndex=a},alignTo:function(b,a,c){var d=this.el.getAlignToXY(b,a,c);this.setPagePosition(d[0],d[1]);return this},anchorTo:function(c,e,d,b){this.clearAnchor();this.anchorTarget={el:c,alignment:e,offsets:d};Ext.EventManager.onWindowResize(this.doAnchor,this);var a=typeof b;if(a!="undefined"){Ext.EventManager.on(window,"scroll",this.doAnchor,this,{buffer:a=="number"?b:50})}return this.doAnchor()},doAnchor:function(){var a=this.anchorTarget;this.alignTo(a.el,a.alignment,a.offsets);return this},clearAnchor:function(){if(this.anchorTarget){Ext.EventManager.removeResizeListener(this.doAnchor,this);Ext.EventManager.un(window,"scroll",this.doAnchor,this);delete this.anchorTarget}return this},toFront:function(a){if(this.manager.bringToFront(this)){if(!a||!a.getTarget().focus){this.focus()}}return this},setActive:function(a){if(a){if(!this.maximized){this.el.enableShadow(true)}this.fireEvent("activate",this)}else{this.el.disableShadow();this.fireEvent("deactivate",this)}},toBack:function(){this.manager.sendToBack(this);return this},center:function(){var a=this.el.getAlignToXY(this.container,"c-c");this.setPagePosition(a[0],a[1]);return this}});Ext.reg("window",Ext.Window);Ext.Window.DD=Ext.extend(Ext.dd.DD,{constructor:function(a){this.win=a;Ext.Window.DD.superclass.constructor.call(this,a.el.id,"WindowDD-"+a.id);this.setHandleElId(a.header.id);this.scroll=false},moveOnly:true,headerOffsets:[100,25],startDrag:function(){var a=this.win;this.proxy=a.ghost(a.initialConfig.cls);if(a.constrain!==false){var c=a.el.shadowOffset;this.constrainTo(a.container,{right:c,left:c,bottom:c})}else{if(a.constrainHeader!==false){var b=this.proxy.getSize();this.constrainTo(a.container,{right:-(b.width-this.headerOffsets[0]),bottom:-(b.height-this.headerOffsets[1])})}}},b4Drag:Ext.emptyFn,onDrag:function(a){this.alignElWithMouse(this.proxy,a.getPageX(),a.getPageY())},endDrag:function(a){this.win.unghost();this.win.saveState()}});Ext.WindowGroup=function(){var g={};var d=[];var e=null;var c=function(j,i){return(!j._lastAccess||j._lastAccess<i._lastAccess)?-1:1};var h=function(){var l=d,j=l.length;if(j>0){l.sort(c);var k=l[0].manager.zseed;for(var m=0;m<j;m++){var n=l[m];if(n&&!n.hidden){n.setZIndex(k+(m*10))}}}a()};var b=function(i){if(i!=e){if(e){e.setActive(false)}e=i;if(i){i.setActive(true)}}};var a=function(){for(var j=d.length-1;j>=0;--j){if(!d[j].hidden){b(d[j]);return}}b(null)};return{zseed:9000,register:function(i){if(i.manager){i.manager.unregister(i)}i.manager=this;g[i.id]=i;d.push(i);i.on("hide",a)},unregister:function(i){delete i.manager;delete g[i.id];i.un("hide",a);d.remove(i)},get:function(i){return typeof i=="object"?i:g[i]},bringToFront:function(i){i=this.get(i);if(i!=e){i._lastAccess=new Date().getTime();h();return true}return false},sendToBack:function(i){i=this.get(i);i._lastAccess=-(new Date().getTime());h();return i},hideAll:function(){for(var i in g){if(g[i]&&typeof g[i]!="function"&&g[i].isVisible()){g[i].hide()}}},getActive:function(){return e},getBy:function(l,k){var m=[];for(var j=d.length-1;j>=0;--j){var n=d[j];if(l.call(k||n,n)!==false){m.push(n)}}return m},each:function(j,i){for(var k in g){if(g[k]&&typeof g[k]!="function"){if(j.call(i||g[k],g[k])===false){return}}}}}};Ext.WindowMgr=new Ext.WindowGroup();Ext.MessageBox=function(){var u,b,q,t,h,l,s,a,n,p,j,g,r,v,o,i="",d="",m=["ok","yes","no","cancel"];var c=function(x){r[x].blur();if(u.isVisible()){u.hide();w();Ext.callback(b.fn,b.scope||window,[x,v.dom.value,b],1)}};var w=function(){if(b&&b.cls){u.el.removeClass(b.cls)}n.reset()};var e=function(z,x,y){if(b&&b.closable!==false){u.hide();w()}if(y){y.stopEvent()}};var k=function(x){var z=0,y;if(!x){Ext.each(m,function(A){r[A].hide()});return z}u.footer.dom.style.display="";Ext.iterate(r,function(A,B){y=x[A];if(y){B.show();B.setText(Ext.isString(y)?y:Ext.MessageBox.buttonText[A]);z+=B.getEl().getWidth()+15}else{B.hide()}});return z};return{getDialog:function(x){if(!u){var z=[];r={};Ext.each(m,function(A){z.push(r[A]=new Ext.Button({text:this.buttonText[A],handler:c.createCallback(A),hideMode:"offsets"}))},this);u=new Ext.Window({autoCreate:true,title:x,resizable:false,constrain:true,constrainHeader:true,minimizable:false,maximizable:false,stateful:false,modal:true,shim:true,buttonAlign:"center",width:400,height:100,minHeight:80,plain:true,footer:true,closable:true,close:function(){if(b&&b.buttons&&b.buttons.no&&!b.buttons.cancel){c("no")}else{c("cancel")}},fbar:new Ext.Toolbar({items:z,enableOverflow:false})});u.render(document.body);u.getEl().addClass("x-window-dlg");q=u.mask;h=u.body.createChild({html:'<div class="ext-mb-icon"></div><div class="ext-mb-content"><span class="ext-mb-text"></span><br /><div class="ext-mb-fix-cursor"><input type="text" class="ext-mb-input" /><textarea class="ext-mb-textarea"></textarea></div></div>'});j=Ext.get(h.dom.firstChild);var y=h.dom.childNodes[1];l=Ext.get(y.firstChild);s=Ext.get(y.childNodes[2].firstChild);s.enableDisplayMode();s.addKeyListener([10,13],function(){if(u.isVisible()&&b&&b.buttons){if(b.buttons.ok){c("ok")}else{if(b.buttons.yes){c("yes")}}}});a=Ext.get(y.childNodes[2].childNodes[1]);a.enableDisplayMode();n=new Ext.ProgressBar({renderTo:h});h.createChild({cls:"x-clear"})}return u},updateText:function(A){if(!u.isVisible()&&!b.width){u.setSize(this.maxWidth,100)}l.update(A?A+" ":"&#160;");var y=d!=""?(j.getWidth()+j.getMargins("lr")):0,C=l.getWidth()+l.getMargins("lr"),z=u.getFrameWidth("lr"),B=u.body.getFrameWidth("lr"),x;x=Math.max(Math.min(b.width||y+C+z+B,b.maxWidth||this.maxWidth),Math.max(b.minWidth||this.minWidth,o||0));if(b.prompt===true){v.setWidth(x-y-z-B)}if(b.progress===true||b.wait===true){n.setSize(x-y-z-B)}if(Ext.isIE&&x==o){x+=4}l.update(A||"&#160;");u.setSize(x,"auto").center();return this},updateProgress:function(y,x,z){n.updateProgress(y,x);if(z){this.updateText(z)}return this},isVisible:function(){return u&&u.isVisible()},hide:function(){var x=u?u.activeGhost:null;if(this.isVisible()||x){u.hide();w();if(x){u.unghost(false,false)}}return this},show:function(A){if(this.isVisible()){this.hide()}b=A;var B=this.getDialog(b.title||"&#160;");B.setTitle(b.title||"&#160;");var x=(b.closable!==false&&b.progress!==true&&b.wait!==true);B.tools.close.setDisplayed(x);v=s;b.prompt=b.prompt||(b.multiline?true:false);if(b.prompt){if(b.multiline){s.hide();a.show();a.setHeight(Ext.isNumber(b.multiline)?b.multiline:this.defaultTextHeight);v=a}else{s.show();a.hide()}}else{s.hide();a.hide()}v.dom.value=b.value||"";if(b.prompt){B.focusEl=v}else{var z=b.buttons;var y=null;if(z&&z.ok){y=r.ok}else{if(z&&z.yes){y=r.yes}}if(y){B.focusEl=y}}if(Ext.isDefined(b.iconCls)){B.setIconClass(b.iconCls)}this.setIcon(Ext.isDefined(b.icon)?b.icon:i);o=k(b.buttons);n.setVisible(b.progress===true||b.wait===true);this.updateProgress(0,b.progressText);this.updateText(b.msg);if(b.cls){B.el.addClass(b.cls)}B.proxyDrag=b.proxyDrag===true;B.modal=b.modal!==false;B.mask=b.modal!==false?q:false;if(!B.isVisible()){document.body.appendChild(u.el.dom);B.setAnimateTarget(b.animEl);B.on("show",function(){if(x===true){B.keyMap.enable()}else{B.keyMap.disable()}},this,{single:true});B.show(b.animEl)}if(b.wait===true){n.wait(b.waitConfig)}return this},setIcon:function(x){if(!u){i=x;return}i=undefined;if(x&&x!=""){j.removeClass("x-hidden");j.replaceClass(d,x);h.addClass("x-dlg-icon");d=x}else{j.replaceClass(d,"x-hidden");h.removeClass("x-dlg-icon");d=""}return this},progress:function(z,y,x){this.show({title:z,msg:y,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth,progressText:x});return this},wait:function(z,y,x){this.show({title:y,msg:z,buttons:false,closable:false,wait:true,modal:true,minWidth:this.minProgressWidth,waitConfig:x});return this},alert:function(A,z,y,x){this.show({title:A,msg:z,buttons:this.OK,fn:y,scope:x,minWidth:this.minWidth});return this},confirm:function(A,z,y,x){this.show({title:A,msg:z,buttons:this.YESNO,fn:y,scope:x,icon:this.QUESTION,minWidth:this.minWidth});return this},prompt:function(C,B,z,y,x,A){this.show({title:C,msg:B,buttons:this.OKCANCEL,fn:z,minWidth:this.minPromptWidth,scope:y,prompt:true,multiline:x,value:A});return this},OK:{ok:true},CANCEL:{cancel:true},OKCANCEL:{ok:true,cancel:true},YESNO:{yes:true,no:true},YESNOCANCEL:{yes:true,no:true,cancel:true},INFO:"ext-mb-info",WARNING:"ext-mb-warning",QUESTION:"ext-mb-question",ERROR:"ext-mb-error",defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,minPromptWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}}}();Ext.Msg=Ext.MessageBox;Ext.dd.PanelProxy=Ext.extend(Object,{constructor:function(a,b){this.panel=a;this.id=this.panel.id+"-ddproxy";Ext.apply(this,b)},insertProxy:true,setStatus:Ext.emptyFn,reset:Ext.emptyFn,update:Ext.emptyFn,stop:Ext.emptyFn,sync:Ext.emptyFn,getEl:function(){return this.ghost},getGhost:function(){return this.ghost},getProxy:function(){return this.proxy},hide:function(){if(this.ghost){if(this.proxy){this.proxy.remove();delete this.proxy}this.panel.el.dom.style.display="";this.ghost.remove();delete this.ghost}},show:function(){if(!this.ghost){this.ghost=this.panel.createGhost(this.panel.initialConfig.cls,undefined,Ext.getBody());this.ghost.setXY(this.panel.el.getXY());if(this.insertProxy){this.proxy=this.panel.el.insertSibling({cls:"x-panel-dd-spacer"});this.proxy.setSize(this.panel.getSize())}this.panel.el.dom.style.display="none"}},repair:function(b,c,a){this.hide();if(typeof c=="function"){c.call(a||this)}},moveProxy:function(a,b){if(this.proxy){a.insertBefore(this.proxy.dom,b)}}});Ext.Panel.DD=Ext.extend(Ext.dd.DragSource,{constructor:function(b,a){this.panel=b;this.dragData={panel:b};this.proxy=new Ext.dd.PanelProxy(b,a);Ext.Panel.DD.superclass.constructor.call(this,b.el,a);var d=b.header,c=b.body;if(d){this.setHandleElId(d.id);c=b.header}c.setStyle("cursor","move");this.scroll=false},showFrame:Ext.emptyFn,startDrag:Ext.emptyFn,b4StartDrag:function(a,b){this.proxy.show()},b4MouseDown:function(b){var a=b.getPageX(),c=b.getPageY();this.autoOffset(a,c)},onInitDrag:function(a,b){this.onStartDrag(a,b);return true},createFrame:Ext.emptyFn,getDragEl:function(a){return this.proxy.ghost.dom},endDrag:function(a){this.proxy.hide();this.panel.saveState()},autoOffset:function(a,b){a-=this.startPageX;b-=this.startPageY;this.setDelta(a,b)}});Ext.state.Provider=Ext.extend(Ext.util.Observable,{constructor:function(){this.addEvents("statechange");this.state={};Ext.state.Provider.superclass.constructor.call(this)},get:function(b,a){return typeof this.state[b]=="undefined"?a:this.state[b]},clear:function(a){delete this.state[a];this.fireEvent("statechange",this,a,null)},set:function(a,b){this.state[a]=b;this.fireEvent("statechange",this,a,b)},decodeValue:function(b){var e=/^(a|n|d|b|s|o|e)\:(.*)$/,h=e.exec(unescape(b)),d,c,a,g;if(!h||!h[1]){return}c=h[1];a=h[2];switch(c){case"e":return null;case"n":return parseFloat(a);case"d":return new Date(Date.parse(a));case"b":return(a=="1");case"a":d=[];if(a!=""){Ext.each(a.split("^"),function(i){d.push(this.decodeValue(i))},this)}return d;case"o":d={};if(a!=""){Ext.each(a.split("^"),function(i){g=i.split("=");d[g[0]]=this.decodeValue(g[1])},this)}return d;default:return a}},encodeValue:function(c){var b,g="",e=0,a,d;if(c==null){return"e:1"}else{if(typeof c=="number"){b="n:"+c}else{if(typeof c=="boolean"){b="b:"+(c?"1":"0")}else{if(Ext.isDate(c)){b="d:"+c.toGMTString()}else{if(Ext.isArray(c)){for(a=c.length;e<a;e++){g+=this.encodeValue(c[e]);if(e!=a-1){g+="^"}}b="a:"+g}else{if(typeof c=="object"){for(d in c){if(typeof c[d]!="function"&&c[d]!==undefined){g+=d+"="+this.encodeValue(c[d])+"^"}}b="o:"+g.substring(0,g.length-1)}else{b="s:"+c}}}}}}return escape(b)}});Ext.state.Manager=function(){var a=new Ext.state.Provider();return{setProvider:function(b){a=b},get:function(c,b){return a.get(c,b)},set:function(b,c){a.set(b,c)},clear:function(b){a.clear(b)},getProvider:function(){return a}}}();Ext.state.CookieProvider=Ext.extend(Ext.state.Provider,{constructor:function(a){Ext.state.CookieProvider.superclass.constructor.call(this);this.path="/";this.expires=new Date(new Date().getTime()+(1000*60*60*24*7));this.domain=null;this.secure=false;Ext.apply(this,a);this.state=this.readCookies()},set:function(a,b){if(typeof b=="undefined"||b===null){this.clear(a);return}this.setCookie(a,b);Ext.state.CookieProvider.superclass.set.call(this,a,b)},clear:function(a){this.clearCookie(a);Ext.state.CookieProvider.superclass.clear.call(this,a)},readCookies:function(){var d={},h=document.cookie+";",b=/\s?(.*?)=(.*?);/g,g,a,e;while((g=b.exec(h))!=null){a=g[1];e=g[2];if(a&&a.substring(0,3)=="ys-"){d[a.substr(3)]=this.decodeValue(e)}}return d},setCookie:function(a,b){document.cookie="ys-"+a+"="+this.encodeValue(b)+((this.expires==null)?"":("; expires="+this.expires.toGMTString()))+((this.path==null)?"":("; path="+this.path))+((this.domain==null)?"":("; domain="+this.domain))+((this.secure==true)?"; secure":"")},clearCookie:function(a){document.cookie="ys-"+a+"=null; expires=Thu, 01-Jan-70 00:00:01 GMT"+((this.path==null)?"":("; path="+this.path))+((this.domain==null)?"":("; domain="+this.domain))+((this.secure==true)?"; secure":"")}});Ext.DataView=Ext.extend(Ext.BoxComponent,{selectedClass:"x-view-selected",emptyText:"",deferEmptyText:true,trackOver:false,blockRefresh:false,last:false,initComponent:function(){Ext.DataView.superclass.initComponent.call(this);if(Ext.isString(this.tpl)||Ext.isArray(this.tpl)){this.tpl=new Ext.XTemplate(this.tpl)}this.addEvents("beforeclick","click","mouseenter","mouseleave","containerclick","dblclick","contextmenu","containercontextmenu","selectionchange","beforeselect");this.store=Ext.StoreMgr.lookup(this.store);this.all=new Ext.CompositeElementLite();this.selected=new Ext.CompositeElementLite()},afterRender:function(){Ext.DataView.superclass.afterRender.call(this);this.mon(this.getTemplateTarget(),{click:this.onClick,dblclick:this.onDblClick,contextmenu:this.onContextMenu,scope:this});if(this.overClass||this.trackOver){this.mon(this.getTemplateTarget(),{mouseover:this.onMouseOver,mouseout:this.onMouseOut,scope:this})}if(this.store){this.bindStore(this.store,true)}},refresh:function(){this.clearSelections(false,true);var b=this.getTemplateTarget(),a=this.store.getRange();b.update("");if(a.length<1){if(!this.deferEmptyText||this.hasSkippedEmptyText){b.update(this.emptyText)}this.all.clear()}else{this.tpl.overwrite(b,this.collectData(a,0));this.all.fill(Ext.query(this.itemSelector,b.dom));this.updateIndexes(0)}this.hasSkippedEmptyText=true},getTemplateTarget:function(){return this.el},prepareData:function(a){return a},collectData:function(b,e){var d=[],c=0,a=b.length;for(;c<a;c++){d[d.length]=this.prepareData(b[c].data,e+c,b[c])}return d},bufferRender:function(a,b){var c=document.createElement("div");this.tpl.overwrite(c,this.collectData(a,b));return Ext.query(this.itemSelector,c)},onUpdate:function(g,a){var b=this.store.indexOf(a);if(b>-1){var e=this.isSelected(b),c=this.all.elements[b],d=this.bufferRender([a],b)[0];this.all.replaceElement(b,d,true);if(e){this.selected.replaceElement(c,d);this.all.item(b).addClass(this.selectedClass)}this.updateIndexes(b,b)}},onAdd:function(g,d,e){if(this.all.getCount()===0){this.refresh();return}var c=this.bufferRender(d,e),h,b=this.all.elements;if(e<this.all.getCount()){h=this.all.item(e).insertSibling(c,"before",true);b.splice.apply(b,[e,0].concat(c))}else{h=this.all.last().insertSibling(c,"after",true);b.push.apply(b,c)}this.updateIndexes(e)},onRemove:function(c,a,b){this.deselect(b);this.all.removeElement(b,true);this.updateIndexes(b);if(this.store.getCount()===0){this.refresh()}},refreshNode:function(a){this.onUpdate(this.store,this.store.getAt(a))},updateIndexes:function(d,c){var b=this.all.elements;d=d||0;c=c||((c===0)?0:(b.length-1));for(var a=d;a<=c;a++){b[a].viewIndex=a}},getStore:function(){return this.store},bindStore:function(a,b){if(!b&&this.store){if(a!==this.store&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("datachanged",this.onDataChanged,this);this.store.un("add",this.onAdd,this);this.store.un("remove",this.onRemove,this);this.store.un("update",this.onUpdate,this);this.store.un("clear",this.refresh,this)}if(!a){this.store=null}}if(a){a=Ext.StoreMgr.lookup(a);a.on({scope:this,beforeload:this.onBeforeLoad,datachanged:this.onDataChanged,add:this.onAdd,remove:this.onRemove,update:this.onUpdate,clear:this.refresh})}this.store=a;if(a){this.refresh()}},onDataChanged:function(){if(this.blockRefresh!==true){this.refresh.apply(this,arguments)}},findItemFromChild:function(a){return Ext.fly(a).findParent(this.itemSelector,this.getTemplateTarget())},onClick:function(c){var b=c.getTarget(this.itemSelector,this.getTemplateTarget()),a;if(b){a=this.indexOf(b);if(this.onItemClick(b,a,c)!==false){this.fireEvent("click",this,a,b,c)}}else{if(this.fireEvent("containerclick",this,c)!==false){this.onContainerClick(c)}}},onContainerClick:function(a){this.clearSelections()},onContextMenu:function(b){var a=b.getTarget(this.itemSelector,this.getTemplateTarget());if(a){this.fireEvent("contextmenu",this,this.indexOf(a),a,b)}else{this.fireEvent("containercontextmenu",this,b)}},onDblClick:function(b){var a=b.getTarget(this.itemSelector,this.getTemplateTarget());if(a){this.fireEvent("dblclick",this,this.indexOf(a),a,b)}},onMouseOver:function(b){var a=b.getTarget(this.itemSelector,this.getTemplateTarget());if(a&&a!==this.lastItem){this.lastItem=a;Ext.fly(a).addClass(this.overClass);this.fireEvent("mouseenter",this,this.indexOf(a),a,b)}},onMouseOut:function(a){if(this.lastItem){if(!a.within(this.lastItem,true,true)){Ext.fly(this.lastItem).removeClass(this.overClass);this.fireEvent("mouseleave",this,this.indexOf(this.lastItem),this.lastItem,a);delete this.lastItem}}},onItemClick:function(b,a,c){if(this.fireEvent("beforeclick",this,a,b,c)===false){return false}if(this.multiSelect){this.doMultiSelection(b,a,c);c.preventDefault()}else{if(this.singleSelect){this.doSingleSelection(b,a,c);c.preventDefault()}}return true},doSingleSelection:function(b,a,c){if(c.ctrlKey&&this.isSelected(a)){this.deselect(a)}else{this.select(a,false)}},doMultiSelection:function(c,a,d){if(d.shiftKey&&this.last!==false){var b=this.last;this.selectRange(b,a,d.ctrlKey);this.last=b}else{if((d.ctrlKey||this.simpleSelect)&&this.isSelected(a)){this.deselect(a)}else{this.select(a,d.ctrlKey||d.shiftKey||this.simpleSelect)}}},getSelectionCount:function(){return this.selected.getCount()},getSelectedNodes:function(){return this.selected.elements},getSelectedIndexes:function(){var b=[],d=this.selected.elements,c=0,a=d.length;for(;c<a;c++){b.push(d[c].viewIndex)}return b},getSelectedRecords:function(){return this.getRecords(this.selected.elements)},getRecords:function(c){var b=[],d=0,a=c.length;for(;d<a;d++){b[b.length]=this.store.getAt(c[d].viewIndex)}return b},getRecord:function(a){return this.store.getAt(a.viewIndex)},clearSelections:function(a,b){if((this.multiSelect||this.singleSelect)&&this.selected.getCount()>0){if(!b){this.selected.removeClass(this.selectedClass)}this.selected.clear();this.last=false;if(!a){this.fireEvent("selectionchange",this,this.selected.elements)}}},isSelected:function(a){return this.selected.contains(this.getNode(a))},deselect:function(a){if(this.isSelected(a)){a=this.getNode(a);this.selected.removeElement(a);if(this.last==a.viewIndex){this.last=false}Ext.fly(a).removeClass(this.selectedClass);this.fireEvent("selectionchange",this,this.selected.elements)}},select:function(d,g,b){if(Ext.isArray(d)){if(!g){this.clearSelections(true)}for(var c=0,a=d.length;c<a;c++){this.select(d[c],true,true)}if(!b){this.fireEvent("selectionchange",this,this.selected.elements)}}else{var e=this.getNode(d);if(!g){this.clearSelections(true)}if(e&&!this.isSelected(e)){if(this.fireEvent("beforeselect",this,e,this.selected.elements)!==false){Ext.fly(e).addClass(this.selectedClass);this.selected.add(e);this.last=e.viewIndex;if(!b){this.fireEvent("selectionchange",this,this.selected.elements)}}}}},selectRange:function(c,a,b){if(!b){this.clearSelections(true)}this.select(this.getNodes(c,a),true)},getNode:function(b){if(Ext.isString(b)){return document.getElementById(b)}else{if(Ext.isNumber(b)){return this.all.elements[b]}else{if(b instanceof Ext.data.Record){var a=this.store.indexOf(b);return this.all.elements[a]}}}return b},getNodes:function(e,a){var d=this.all.elements,b=[],c;e=e||0;a=!Ext.isDefined(a)?Math.max(d.length-1,0):a;if(e<=a){for(c=e;c<=a&&d[c];c++){b.push(d[c])}}else{for(c=e;c>=a&&d[c];c--){b.push(d[c])}}return b},indexOf:function(a){a=this.getNode(a);if(Ext.isNumber(a.viewIndex)){return a.viewIndex}return this.all.indexOf(a)},onBeforeLoad:function(){if(this.loadingText){this.clearSelections(false,true);this.getTemplateTarget().update('<div class="loading-indicator">'+this.loadingText+"</div>");this.all.clear()}},onDestroy:function(){this.all.clear();this.selected.clear();Ext.DataView.superclass.onDestroy.call(this);this.bindStore(null)}});Ext.DataView.prototype.setStore=Ext.DataView.prototype.bindStore;Ext.reg("dataview",Ext.DataView);Ext.list.ListView=Ext.extend(Ext.DataView,{itemSelector:"dl",selectedClass:"x-list-selected",overClass:"x-list-over",scrollOffset:undefined,columnResize:true,columnSort:true,maxColumnWidth:Ext.isIE?99:100,initComponent:function(){if(this.columnResize){this.colResizer=new Ext.list.ColumnResizer(this.colResizer);this.colResizer.init(this)}if(this.columnSort){this.colSorter=new Ext.list.Sorter(this.columnSort);this.colSorter.init(this)}if(!this.internalTpl){this.internalTpl=new Ext.XTemplate('<div class="x-list-header"><div class="x-list-header-inner">','<tpl for="columns">','<div style="width:{[values.width*100]}%;text-align:{align};"><em unselectable="on" id="',this.id,'-xlhd-{#}">',"{header}","</em></div>","</tpl>",'<div class="x-clear"></div>',"</div></div>",'<div class="x-list-body"><div class="x-list-body-inner">',"</div></div>")}if(!this.tpl){this.tpl=new Ext.XTemplate('<tpl for="rows">',"<dl>",'<tpl for="parent.columns">','<dt style="width:{[values.width*100]}%;text-align:{align};">','<em unselectable="on"<tpl if="cls"> class="{cls}</tpl>">',"{[values.tpl.apply(parent)]}","</em></dt>","</tpl>",'<div class="x-clear"></div>',"</dl>","</tpl>")}var l=this.columns,h=0,k=0,m=l.length,b=[];for(var g=0;g<m;g++){var n=l[g];if(!n.isColumn){n.xtype=n.xtype?(/^lv/.test(n.xtype)?n.xtype:"lv"+n.xtype):"lvcolumn";n=Ext.create(n)}if(n.width){h+=n.width*100;if(h>this.maxColumnWidth){n.width-=(h-this.maxColumnWidth)/100}k++}b.push(n)}l=this.columns=b;if(k<m){var d=m-k;if(h<this.maxColumnWidth){var a=((this.maxColumnWidth-h)/d)/100;for(var e=0;e<m;e++){var n=l[e];if(!n.width){n.width=a}}}}Ext.list.ListView.superclass.initComponent.call(this)},onRender:function(){this.autoEl={cls:"x-list-wrap"};Ext.list.ListView.superclass.onRender.apply(this,arguments);this.internalTpl.overwrite(this.el,{columns:this.columns});this.innerBody=Ext.get(this.el.dom.childNodes[1].firstChild);this.innerHd=Ext.get(this.el.dom.firstChild.firstChild);if(this.hideHeaders){this.el.dom.firstChild.style.display="none"}},getTemplateTarget:function(){return this.innerBody},collectData:function(){var a=Ext.list.ListView.superclass.collectData.apply(this,arguments);return{columns:this.columns,rows:a}},verifyInternalSize:function(){if(this.lastSize){this.onResize(this.lastSize.width,this.lastSize.height)}},onResize:function(c,e){var b=this.innerBody.dom,g=this.innerHd.dom,d=c-Ext.num(this.scrollOffset,Ext.getScrollBarWidth())+"px",a;if(!b){return}a=b.parentNode;if(Ext.isNumber(c)){if(this.reserveScrollOffset||((a.offsetWidth-a.clientWidth)>10)){b.style.width=d;g.style.width=d}else{b.style.width=c+"px";g.style.width=c+"px";setTimeout(function(){if((a.offsetWidth-a.clientWidth)>10){b.style.width=d;g.style.width=d}},10)}}if(Ext.isNumber(e)){a.style.height=Math.max(0,e-g.parentNode.offsetHeight)+"px"}},updateIndexes:function(){Ext.list.ListView.superclass.updateIndexes.apply(this,arguments);this.verifyInternalSize()},findHeaderIndex:function(g){g=g.dom||g;var a=g.parentNode,d=a.parentNode.childNodes,b=0,e;for(;e=d[b];b++){if(e==a){return b}}return -1},setHdWidths:function(){var d=this.innerHd.dom.getElementsByTagName("div"),c=0,b=this.columns,a=b.length;for(;c<a;c++){d[c].style.width=(b[c].width*100)+"%"}}});Ext.reg("listview",Ext.list.ListView);Ext.ListView=Ext.list.ListView;Ext.list.Column=Ext.extend(Object,{isColumn:true,align:"left",header:"",width:null,cls:"",constructor:function(a){if(!a.tpl){a.tpl=new Ext.XTemplate("{"+a.dataIndex+"}")}else{if(Ext.isString(a.tpl)){a.tpl=new Ext.XTemplate(a.tpl)}}Ext.apply(this,a)}});Ext.reg("lvcolumn",Ext.list.Column);Ext.list.NumberColumn=Ext.extend(Ext.list.Column,{format:"0,000.00",constructor:function(a){a.tpl=a.tpl||new Ext.XTemplate("{"+a.dataIndex+':number("'+(a.format||this.format)+'")}');Ext.list.NumberColumn.superclass.constructor.call(this,a)}});Ext.reg("lvnumbercolumn",Ext.list.NumberColumn);Ext.list.DateColumn=Ext.extend(Ext.list.Column,{format:"m/d/Y",constructor:function(a){a.tpl=a.tpl||new Ext.XTemplate("{"+a.dataIndex+':date("'+(a.format||this.format)+'")}');Ext.list.DateColumn.superclass.constructor.call(this,a)}});Ext.reg("lvdatecolumn",Ext.list.DateColumn);Ext.list.BooleanColumn=Ext.extend(Ext.list.Column,{trueText:"true",falseText:"false",undefinedText:"&#160;",constructor:function(e){e.tpl=e.tpl||new Ext.XTemplate("{"+e.dataIndex+":this.format}");var b=this.trueText,d=this.falseText,a=this.undefinedText;e.tpl.format=function(c){if(c===undefined){return a}if(!c||c==="false"){return d}return b};Ext.list.DateColumn.superclass.constructor.call(this,e)}});Ext.reg("lvbooleancolumn",Ext.list.BooleanColumn);Ext.list.ColumnResizer=Ext.extend(Ext.util.Observable,{minPct:0.05,constructor:function(a){Ext.apply(this,a);Ext.list.ColumnResizer.superclass.constructor.call(this)},init:function(a){this.view=a;a.on("render",this.initEvents,this)},initEvents:function(a){a.mon(a.innerHd,"mousemove",this.handleHdMove,this);this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeStart.createDelegate(this),onStart:this.onStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onEnd.createDelegate(this),tolerance:3,autoStart:300});this.tracker.initEl(a.innerHd);a.on("beforedestroy",this.tracker.destroy,this.tracker)},handleHdMove:function(i,d){var c=5,b=i.getPageX(),j=i.getTarget("em",3,true);if(j){var h=j.getRegion(),g=j.dom.style,a=j.dom.parentNode;if(b-h.left<=c&&a!=a.parentNode.firstChild){this.activeHd=Ext.get(a.previousSibling.firstChild);g.cursor=Ext.isWebKit?"e-resize":"col-resize"}else{if(h.right-b<=c&&a!=a.parentNode.lastChild.previousSibling){this.activeHd=j;g.cursor=Ext.isWebKit?"w-resize":"col-resize"}else{delete this.activeHd;g.cursor=""}}}},onBeforeStart:function(a){this.dragHd=this.activeHd;return !!this.dragHd},onStart:function(g){var d=this,b=d.view,c=d.dragHd,a=d.tracker.getXY()[0];d.proxy=b.el.createChild({cls:"x-list-resizer"});d.dragX=c.getX();d.headerIndex=b.findHeaderIndex(c);d.headersDisabled=b.disableHeaders;b.disableHeaders=true;d.proxy.setHeight(b.el.getHeight());d.proxy.setX(d.dragX);d.proxy.setWidth(a-d.dragX);this.setBoundaries()},setBoundaries:function(j){var k=this.view,h=this.headerIndex,c=k.innerHd.getWidth(),j=k.innerHd.getX(),b=Math.ceil(c*this.minPct),l=c-b,e=k.columns.length,d=k.innerHd.select("em",true),g=b+j,a=l+j,i;if(e==2){this.minX=g;this.maxX=a}else{i=d.item(h+2);this.minX=d.item(h).getX()+b;this.maxX=i?i.getX()-b:a;if(h==0){this.minX=g}else{if(h==e-2){this.maxX=a}}}},onDrag:function(c){var b=this,a=b.tracker.getXY()[0].constrain(b.minX,b.maxX);b.proxy.setWidth(a-this.dragX)},onEnd:function(i){var g=this.proxy.getWidth(),h=this.headerIndex,l=this.view,c=l.columns,b=l.innerHd.getWidth(),k=Math.ceil(g*l.maxColumnWidth/b)/100,d=this.headersDisabled,m=c[h],j=c[h+1],a=m.width+j.width;this.proxy.remove();m.width=k;j.width=a-k;delete this.dragHd;l.setHdWidths();l.refresh();setTimeout(function(){l.disableHeaders=d},100)}});Ext.ListView.ColumnResizer=Ext.list.ColumnResizer;Ext.list.Sorter=Ext.extend(Ext.util.Observable,{sortClasses:["sort-asc","sort-desc"],constructor:function(a){Ext.apply(this,a);Ext.list.Sorter.superclass.constructor.call(this)},init:function(a){this.view=a;a.on("render",this.initEvents,this)},initEvents:function(a){a.mon(a.innerHd,"click",this.onHdClick,this);a.innerHd.setStyle("cursor","pointer");a.mon(a.store,"datachanged",this.updateSortState,this);this.updateSortState.defer(10,this,[a.store])},updateSortState:function(c){var g=c.getSortState();if(!g){return}this.sortState=g;var e=this.view.columns,h=-1;for(var d=0,a=e.length;d<a;d++){if(e[d].dataIndex==g.field){h=d;break}}if(h!=-1){var b=g.direction;this.updateSortIcon(h,b)}},updateSortIcon:function(b,a){var d=this.sortClasses;var c=this.view.innerHd.select("em").removeClass(d);c.item(b).addClass(d[a=="DESC"?1:0])},onHdClick:function(c){var b=c.getTarget("em",3);if(b&&!this.view.disableHeaders){var a=this.view.findHeaderIndex(b);this.view.store.sort(this.view.columns[a].dataIndex)}}});Ext.ListView.Sorter=Ext.list.Sorter;Ext.TabPanel=Ext.extend(Ext.Panel,{deferredRender:true,tabWidth:120,minTabWidth:30,resizeTabs:false,enableTabScroll:false,scrollIncrement:0,scrollRepeatInterval:400,scrollDuration:0.35,animScroll:true,tabPosition:"top",baseCls:"x-tab-panel",autoTabs:false,autoTabSelector:"div.x-tab",activeTab:undefined,tabMargin:2,plain:false,wheelIncrement:20,idDelimiter:"__",itemCls:"x-tab-item",elements:"body",headerAsText:false,frame:false,hideBorders:true,initComponent:function(){this.frame=false;Ext.TabPanel.superclass.initComponent.call(this);this.addEvents("beforetabchange","tabchange","contextmenu");this.setLayout(new Ext.layout.CardLayout(Ext.apply({layoutOnCardChange:this.layoutOnTabChange,deferredRender:this.deferredRender},this.layoutConfig)));if(this.tabPosition=="top"){this.elements+=",header";this.stripTarget="header"}else{this.elements+=",footer";this.stripTarget="footer"}if(!this.stack){this.stack=Ext.TabPanel.AccessStack()}this.initItems()},onRender:function(c,a){Ext.TabPanel.superclass.onRender.call(this,c,a);if(this.plain){var g=this.tabPosition=="top"?"header":"footer";this[g].addClass("x-tab-panel-"+g+"-plain")}var b=this[this.stripTarget];this.stripWrap=b.createChild({cls:"x-tab-strip-wrap",cn:{tag:"ul",cls:"x-tab-strip x-tab-strip-"+this.tabPosition}});var e=(this.tabPosition=="bottom"?this.stripWrap:null);b.createChild({cls:"x-tab-strip-spacer"},e);this.strip=new Ext.Element(this.stripWrap.dom.firstChild);this.edge=this.strip.createChild({tag:"li",cls:"x-tab-edge",cn:[{tag:"span",cls:"x-tab-strip-text",cn:"&#160;"}]});this.strip.createChild({cls:"x-clear"});this.body.addClass("x-tab-panel-body-"+this.tabPosition);if(!this.itemTpl){var d=new Ext.Template('<li class="{cls}" id="{id}"><a class="x-tab-strip-close"></a>','<a class="x-tab-right" href="#"><em class="x-tab-left">','<span class="x-tab-strip-inner"><span class="x-tab-strip-text {iconCls}">{text}</span></span>',"</em></a></li>");d.disableFormats=true;d.compile();Ext.TabPanel.prototype.itemTpl=d}this.items.each(this.initTab,this)},afterRender:function(){Ext.TabPanel.superclass.afterRender.call(this);if(this.autoTabs){this.readTabs(false)}if(this.activeTab!==undefined){var a=Ext.isObject(this.activeTab)?this.activeTab:this.items.get(this.activeTab);delete this.activeTab;this.setActiveTab(a)}},initEvents:function(){Ext.TabPanel.superclass.initEvents.call(this);this.mon(this.strip,{scope:this,mousedown:this.onStripMouseDown,contextmenu:this.onStripContextMenu});if(this.enableTabScroll){this.mon(this.strip,"mousewheel",this.onWheel,this)}},findTargets:function(c){var b=null,a=c.getTarget("li:not(.x-tab-edge)",this.strip);if(a){b=this.getComponent(a.id.split(this.idDelimiter)[1]);if(b.disabled){return{close:null,item:null,el:null}}}return{close:c.getTarget(".x-tab-strip-close",this.strip),item:b,el:a}},onStripMouseDown:function(b){if(b.button!==0){return}b.preventDefault();var a=this.findTargets(b);if(a.close){if(a.item.fireEvent("beforeclose",a.item)!==false){a.item.fireEvent("close",a.item);this.remove(a.item)}return}if(a.item&&a.item!=this.activeTab){this.setActiveTab(a.item)}},onStripContextMenu:function(b){b.preventDefault();var a=this.findTargets(b);if(a.item){this.fireEvent("contextmenu",this,a.item,b)}},readTabs:function(d){if(d===true){this.items.each(function(h){this.remove(h)},this)}var c=this.el.query(this.autoTabSelector);for(var b=0,a=c.length;b<a;b++){var e=c[b],g=e.getAttribute("title");e.removeAttribute("title");this.add({title:g,contentEl:e})}},initTab:function(d,b){var e=this.strip.dom.childNodes[b],g=this.getTemplateArgs(d),c=e?this.itemTpl.insertBefore(e,g):this.itemTpl.append(this.strip,g),a="x-tab-strip-over",h=Ext.get(c);h.hover(function(){if(!d.disabled){h.addClass(a)}},function(){h.removeClass(a)});if(d.tabTip){h.child("span.x-tab-strip-text",true).qtip=d.tabTip}d.tabEl=c;h.select("a").on("click",function(i){if(!i.getPageX()){this.onStripMouseDown(i)}},this,{preventDefault:true});d.on({scope:this,disable:this.onItemDisabled,enable:this.onItemEnabled,titlechange:this.onItemTitleChanged,iconchange:this.onItemIconChanged,beforeshow:this.onBeforeShowItem})},getTemplateArgs:function(b){var a=b.closable?"x-tab-strip-closable":"";if(b.disabled){a+=" x-item-disabled"}if(b.iconCls){a+=" x-tab-with-icon"}if(b.tabCls){a+=" "+b.tabCls}return{id:this.id+this.idDelimiter+b.getItemId(),text:b.title,cls:a,iconCls:b.iconCls||""}},onAdd:function(b){Ext.TabPanel.superclass.onAdd.call(this,b);if(this.rendered){var a=this.items;this.initTab(b,a.indexOf(b));this.delegateUpdates()}},onBeforeAdd:function(b){var a=b.events?(this.items.containsKey(b.getItemId())?b:null):this.items.get(b);if(a){this.setActiveTab(b);return false}Ext.TabPanel.superclass.onBeforeAdd.apply(this,arguments);var c=b.elements;b.elements=c?c.replace(",header",""):c;b.border=(b.border===true)},onRemove:function(d){var b=Ext.get(d.tabEl);if(b){b.select("a").removeAllListeners();Ext.destroy(b)}Ext.TabPanel.superclass.onRemove.call(this,d);this.stack.remove(d);delete d.tabEl;d.un("disable",this.onItemDisabled,this);d.un("enable",this.onItemEnabled,this);d.un("titlechange",this.onItemTitleChanged,this);d.un("iconchange",this.onItemIconChanged,this);d.un("beforeshow",this.onBeforeShowItem,this);if(d==this.activeTab){var a=this.stack.next();if(a){this.setActiveTab(a)}else{if(this.items.getCount()>0){this.setActiveTab(0)}else{this.setActiveTab(null)}}}if(!this.destroying){this.delegateUpdates()}},onBeforeShowItem:function(a){if(a!=this.activeTab){this.setActiveTab(a);return false}},onItemDisabled:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).addClass("x-item-disabled")}this.stack.remove(b)},onItemEnabled:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).removeClass("x-item-disabled")}},onItemTitleChanged:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).child("span.x-tab-strip-text",true).innerHTML=b.title}},onItemIconChanged:function(d,a,c){var b=this.getTabEl(d);if(b){b=Ext.get(b);b.child("span.x-tab-strip-text").replaceClass(c,a);b[Ext.isEmpty(a)?"removeClass":"addClass"]("x-tab-with-icon")}},getTabEl:function(a){var b=this.getComponent(a);return b?b.tabEl:null},onResize:function(){Ext.TabPanel.superclass.onResize.apply(this,arguments);this.delegateUpdates()},beginUpdate:function(){this.suspendUpdates=true},endUpdate:function(){this.suspendUpdates=false;this.delegateUpdates()},hideTabStripItem:function(b){b=this.getComponent(b);var a=this.getTabEl(b);if(a){a.style.display="none";this.delegateUpdates()}this.stack.remove(b)},unhideTabStripItem:function(b){b=this.getComponent(b);var a=this.getTabEl(b);if(a){a.style.display="";this.delegateUpdates()}},delegateUpdates:function(){var a=this.rendered;if(this.suspendUpdates){return}if(this.resizeTabs&&a){this.autoSizeTabs()}if(this.enableTabScroll&&a){this.autoScrollTabs()}},autoSizeTabs:function(){var h=this.items.length,b=this.tabPosition!="bottom"?"header":"footer",c=this[b].dom.offsetWidth,a=this[b].dom.clientWidth;if(!this.resizeTabs||h<1||!a){return}var k=Math.max(Math.min(Math.floor((a-4)/h)-this.tabMargin,this.tabWidth),this.minTabWidth);this.lastTabWidth=k;var m=this.strip.query("li:not(.x-tab-edge)");for(var e=0,j=m.length;e<j;e++){var l=m[e],n=Ext.fly(l).child(".x-tab-strip-inner",true),g=l.offsetWidth,d=n.offsetWidth;n.style.width=(k-(g-d))+"px"}},adjustBodyWidth:function(a){if(this.header){this.header.setWidth(a)}if(this.footer){this.footer.setWidth(a)}return a},setActiveTab:function(c){c=this.getComponent(c);if(this.fireEvent("beforetabchange",this,c,this.activeTab)===false){return}if(!this.rendered){this.activeTab=c;return}if(this.activeTab!=c){if(this.activeTab){var a=this.getTabEl(this.activeTab);if(a){Ext.fly(a).removeClass("x-tab-strip-active")}}this.activeTab=c;if(c){var b=this.getTabEl(c);Ext.fly(b).addClass("x-tab-strip-active");this.stack.add(c);this.layout.setActiveItem(c);this.delegateUpdates();if(this.scrolling){this.scrollToTab(c,this.animScroll)}}this.fireEvent("tabchange",this,c)}},getActiveTab:function(){return this.activeTab||null},getItem:function(a){return this.getComponent(a)},autoScrollTabs:function(){this.pos=this.tabPosition=="bottom"?this.footer:this.header;var h=this.items.length,d=this.pos.dom.offsetWidth,c=this.pos.dom.clientWidth,g=this.stripWrap,e=g.dom,b=e.offsetWidth,i=this.getScrollPos(),a=this.edge.getOffsetsTo(this.stripWrap)[0]+i;if(!this.enableTabScroll||b<20){return}if(h==0||a<=c){e.scrollLeft=0;g.setWidth(c);if(this.scrolling){this.scrolling=false;this.pos.removeClass("x-tab-scrolling");this.scrollLeft.hide();this.scrollRight.hide();if(Ext.isAir||Ext.isWebKit){e.style.marginLeft="";e.style.marginRight=""}}}else{if(!this.scrolling){this.pos.addClass("x-tab-scrolling");if(Ext.isAir||Ext.isWebKit){e.style.marginLeft="18px";e.style.marginRight="18px"}}c-=g.getMargins("lr");g.setWidth(c>20?c:20);if(!this.scrolling){if(!this.scrollLeft){this.createScrollers()}else{this.scrollLeft.show();this.scrollRight.show()}}this.scrolling=true;if(i>(a-c)){e.scrollLeft=a-c}else{this.scrollToTab(this.activeTab,false)}this.updateScrollButtons()}},createScrollers:function(){this.pos.addClass("x-tab-scrolling-"+this.tabPosition);var c=this.stripWrap.dom.offsetHeight;var a=this.pos.insertFirst({cls:"x-tab-scroller-left"});a.setHeight(c);a.addClassOnOver("x-tab-scroller-left-over");this.leftRepeater=new Ext.util.ClickRepeater(a,{interval:this.scrollRepeatInterval,handler:this.onScrollLeft,scope:this});this.scrollLeft=a;var b=this.pos.insertFirst({cls:"x-tab-scroller-right"});b.setHeight(c);b.addClassOnOver("x-tab-scroller-right-over");this.rightRepeater=new Ext.util.ClickRepeater(b,{interval:this.scrollRepeatInterval,handler:this.onScrollRight,scope:this});this.scrollRight=b},getScrollWidth:function(){return this.edge.getOffsetsTo(this.stripWrap)[0]+this.getScrollPos()},getScrollPos:function(){return parseInt(this.stripWrap.dom.scrollLeft,10)||0},getScrollArea:function(){return parseInt(this.stripWrap.dom.clientWidth,10)||0},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},getScrollIncrement:function(){return this.scrollIncrement||(this.resizeTabs?this.lastTabWidth+2:100)},scrollToTab:function(e,a){if(!e){return}var c=this.getTabEl(e),h=this.getScrollPos(),d=this.getScrollArea(),g=Ext.fly(c).getOffsetsTo(this.stripWrap)[0]+h,b=g+c.offsetWidth;if(g<h){this.scrollTo(g,a)}else{if(b>(h+d)){this.scrollTo(b-d,a)}}},scrollTo:function(b,a){this.stripWrap.scrollTo("left",b,a?this.getScrollAnim():false);if(!a){this.updateScrollButtons()}},onWheel:function(g){var h=g.getWheelDelta()*this.wheelIncrement*-1;g.stopEvent();var i=this.getScrollPos(),c=i+h,a=this.getScrollWidth()-this.getScrollArea();var b=Math.max(0,Math.min(a,c));if(b!=i){this.scrollTo(b,false)}},onScrollRight:function(){var a=this.getScrollWidth()-this.getScrollArea(),c=this.getScrollPos(),b=Math.min(a,c+this.getScrollIncrement());if(b!=c){this.scrollTo(b,this.animScroll)}},onScrollLeft:function(){var b=this.getScrollPos(),a=Math.max(0,b-this.getScrollIncrement());if(a!=b){this.scrollTo(a,this.animScroll)}},updateScrollButtons:function(){var a=this.getScrollPos();this.scrollLeft[a===0?"addClass":"removeClass"]("x-tab-scroller-left-disabled");this.scrollRight[a>=(this.getScrollWidth()-this.getScrollArea())?"addClass":"removeClass"]("x-tab-scroller-right-disabled")},beforeDestroy:function(){Ext.destroy(this.leftRepeater,this.rightRepeater);this.deleteMembers("strip","edge","scrollLeft","scrollRight","stripWrap");this.activeTab=null;Ext.TabPanel.superclass.beforeDestroy.apply(this)}});Ext.reg("tabpanel",Ext.TabPanel);Ext.TabPanel.prototype.activate=Ext.TabPanel.prototype.setActiveTab;Ext.TabPanel.AccessStack=function(){var a=[];return{add:function(b){a.push(b);if(a.length>10){a.shift()}},remove:function(e){var d=[];for(var c=0,b=a.length;c<b;c++){if(a[c]!=e){d.push(a[c])}}a=d},next:function(){return a.pop()}}};Ext.Button=Ext.extend(Ext.BoxComponent,{hidden:false,disabled:false,pressed:false,enableToggle:false,menuAlign:"tl-bl?",type:"button",menuClassTarget:"tr:nth(2)",clickEvent:"click",handleMouseEvents:true,tooltipType:"qtip",buttonSelector:"button:first-child",scale:"small",iconAlign:"left",arrowAlign:"right",initComponent:function(){if(this.menu){if(Ext.isArray(this.menu)){this.menu={items:this.menu}}if(Ext.isObject(this.menu)){this.menu.ownerCt=this}this.menu=Ext.menu.MenuMgr.get(this.menu);this.menu.ownerCt=undefined}Ext.Button.superclass.initComponent.call(this);this.addEvents("click","toggle","mouseover","mouseout","menushow","menuhide","menutriggerover","menutriggerout");if(Ext.isString(this.toggleGroup)){this.enableToggle=true}},getTemplateArgs:function(){return[this.type,"x-btn-"+this.scale+" x-btn-icon-"+this.scale+"-"+this.iconAlign,this.getMenuClass(),this.cls,this.id]},setButtonClass:function(){if(this.useSetClass){if(!Ext.isEmpty(this.oldCls)){this.el.removeClass([this.oldCls,"x-btn-pressed"])}this.oldCls=(this.iconCls||this.icon)?(this.text?"x-btn-text-icon":"x-btn-icon"):"x-btn-noicon";this.el.addClass([this.oldCls,this.pressed?"x-btn-pressed":null])}},getMenuClass:function(){return this.menu?(this.arrowAlign!="bottom"?"x-btn-arrow":"x-btn-arrow-bottom"):""},onRender:function(c,a){if(!this.template){if(!Ext.Button.buttonTemplate){Ext.Button.buttonTemplate=new Ext.Template('<table id="{4}" cellspacing="0" class="x-btn {3}"><tbody class="{1}">','<tr><td class="x-btn-tl"><i>&#160;</i></td><td class="x-btn-tc"></td><td class="x-btn-tr"><i>&#160;</i></td></tr>','<tr><td class="x-btn-ml"><i>&#160;</i></td><td class="x-btn-mc"><em class="{2}" unselectable="on"><button type="{0}"></button></em></td><td class="x-btn-mr"><i>&#160;</i></td></tr>','<tr><td class="x-btn-bl"><i>&#160;</i></td><td class="x-btn-bc"></td><td class="x-btn-br"><i>&#160;</i></td></tr>',"</tbody></table>");Ext.Button.buttonTemplate.compile()}this.template=Ext.Button.buttonTemplate}var b,d=this.getTemplateArgs();if(a){b=this.template.insertBefore(a,d,true)}else{b=this.template.append(c,d,true)}this.btnEl=b.child(this.buttonSelector);this.mon(this.btnEl,{scope:this,focus:this.onFocus,blur:this.onBlur});this.initButtonEl(b,this.btnEl);Ext.ButtonToggleMgr.register(this)},initButtonEl:function(b,c){this.el=b;this.setIcon(this.icon);this.setText(this.text);this.setIconClass(this.iconCls);if(Ext.isDefined(this.tabIndex)){c.dom.tabIndex=this.tabIndex}if(this.tooltip){this.setTooltip(this.tooltip,true)}if(this.handleMouseEvents){this.mon(b,{scope:this,mouseover:this.onMouseOver,mousedown:this.onMouseDown})}if(this.menu){this.mon(this.menu,{scope:this,show:this.onMenuShow,hide:this.onMenuHide})}if(this.repeat){var a=new Ext.util.ClickRepeater(b,Ext.isObject(this.repeat)?this.repeat:{});this.mon(a,"click",this.onRepeatClick,this)}else{this.mon(b,this.clickEvent,this.onClick,this)}},afterRender:function(){Ext.Button.superclass.afterRender.call(this);this.useSetClass=true;this.setButtonClass();this.doc=Ext.getDoc();this.doAutoWidth()},setIconClass:function(a){this.iconCls=a;if(this.el){this.btnEl.dom.className="";this.btnEl.addClass(["x-btn-text",a||""]);this.setButtonClass()}return this},setTooltip:function(b,a){if(this.rendered){if(!a){this.clearTip()}if(Ext.isObject(b)){Ext.QuickTips.register(Ext.apply({target:this.btnEl.id},b));this.tooltip=b}else{this.btnEl.dom[this.tooltipType]=b}}else{this.tooltip=b}return this},clearTip:function(){if(Ext.isObject(this.tooltip)){Ext.QuickTips.unregister(this.btnEl)}},beforeDestroy:function(){if(this.rendered){this.clearTip()}if(this.menu&&this.destroyMenu!==false){Ext.destroy(this.btnEl,this.menu)}Ext.destroy(this.repeater)},onDestroy:function(){if(this.rendered){this.doc.un("mouseover",this.monitorMouseOver,this);this.doc.un("mouseup",this.onMouseUp,this);delete this.doc;delete this.btnEl;Ext.ButtonToggleMgr.unregister(this)}Ext.Button.superclass.onDestroy.call(this)},doAutoWidth:function(){if(this.autoWidth!==false&&this.el&&this.text&&this.width===undefined){this.el.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var a=this.btnEl;if(a&&a.getWidth()>20){a.clip();a.setWidth(Ext.util.TextMetrics.measure(a,this.text).width+a.getFrameWidth("lr"))}}if(this.minWidth){if(this.el.getWidth()<this.minWidth){this.el.setWidth(this.minWidth)}}}},setHandler:function(b,a){this.handler=b;this.scope=a;return this},setText:function(a){this.text=a;if(this.el){this.btnEl.update(a||"&#160;");this.setButtonClass()}this.doAutoWidth();return this},setIcon:function(a){this.icon=a;if(this.el){this.btnEl.setStyle("background-image",a?"url("+a+")":"");this.setButtonClass()}return this},getText:function(){return this.text},toggle:function(b,a){b=b===undefined?!this.pressed:!!b;if(b!=this.pressed){if(this.rendered){this.el[b?"addClass":"removeClass"]("x-btn-pressed")}this.pressed=b;if(!a){this.fireEvent("toggle",this,b);if(this.toggleHandler){this.toggleHandler.call(this.scope||this,this,b)}}}return this},onDisable:function(){this.onDisableChange(true)},onEnable:function(){this.onDisableChange(false)},onDisableChange:function(a){if(this.el){if(!Ext.isIE6||!this.text){this.el[a?"addClass":"removeClass"](this.disabledClass)}this.el.dom.disabled=a}this.disabled=a},showMenu:function(){if(this.rendered&&this.menu){if(this.tooltip){Ext.QuickTips.getQuickTip().cancelShow(this.btnEl)}if(this.menu.isVisible()){this.menu.hide()}this.menu.ownerCt=this;this.menu.show(this.el,this.menuAlign)}return this},hideMenu:function(){if(this.hasVisibleMenu()){this.menu.hide()}return this},hasVisibleMenu:function(){return this.menu&&this.menu.ownerCt==this&&this.menu.isVisible()},onRepeatClick:function(a,b){this.onClick(b)},onClick:function(a){if(a){a.preventDefault()}if(a.button!==0){return}if(!this.disabled){this.doToggle();if(this.menu&&!this.hasVisibleMenu()&&!this.ignoreNextClick){this.showMenu()}this.fireEvent("click",this,a);if(this.handler){this.handler.call(this.scope||this,this,a)}}},doToggle:function(){if(this.enableToggle&&(this.allowDepress!==false||!this.pressed)){this.toggle()}},isMenuTriggerOver:function(b,a){return this.menu&&!a},isMenuTriggerOut:function(b,a){return this.menu&&!a},onMouseOver:function(b){if(!this.disabled){var a=b.within(this.el,true);if(!a){this.el.addClass("x-btn-over");if(!this.monitoringMouseOver){this.doc.on("mouseover",this.monitorMouseOver,this);this.monitoringMouseOver=true}this.fireEvent("mouseover",this,b)}if(this.isMenuTriggerOver(b,a)){this.fireEvent("menutriggerover",this,this.menu,b)}}},monitorMouseOver:function(a){if(a.target!=this.el.dom&&!a.within(this.el)){if(this.monitoringMouseOver){this.doc.un("mouseover",this.monitorMouseOver,this);this.monitoringMouseOver=false}this.onMouseOut(a)}},onMouseOut:function(b){var a=b.within(this.el)&&b.target!=this.el.dom;this.el.removeClass("x-btn-over");this.fireEvent("mouseout",this,b);if(this.isMenuTriggerOut(b,a)){this.fireEvent("menutriggerout",this,this.menu,b)}},focus:function(){this.btnEl.focus()},blur:function(){this.btnEl.blur()},onFocus:function(a){if(!this.disabled){this.el.addClass("x-btn-focus")}},onBlur:function(a){this.el.removeClass("x-btn-focus")},getClickEl:function(b,a){return this.el},onMouseDown:function(a){if(!this.disabled&&a.button===0){this.getClickEl(a).addClass("x-btn-click");this.doc.on("mouseup",this.onMouseUp,this)}},onMouseUp:function(a){if(a.button===0){this.getClickEl(a,true).removeClass("x-btn-click");this.doc.un("mouseup",this.onMouseUp,this)}},onMenuShow:function(a){if(this.menu.ownerCt==this){this.menu.ownerCt=this;this.ignoreNextClick=0;this.el.addClass("x-btn-menu-active");this.fireEvent("menushow",this,this.menu)}},onMenuHide:function(a){if(this.menu.ownerCt==this){this.el.removeClass("x-btn-menu-active");this.ignoreNextClick=this.restoreClick.defer(250,this);this.fireEvent("menuhide",this,this.menu);delete this.menu.ownerCt}},restoreClick:function(){this.ignoreNextClick=0}});Ext.reg("button",Ext.Button);Ext.ButtonToggleMgr=function(){var a={};function b(e,j){if(j){var h=a[e.toggleGroup];for(var d=0,c=h.length;d<c;d++){if(h[d]!=e){h[d].toggle(false)}}}}return{register:function(c){if(!c.toggleGroup){return}var d=a[c.toggleGroup];if(!d){d=a[c.toggleGroup]=[]}d.push(c);c.on("toggle",b)},unregister:function(c){if(!c.toggleGroup){return}var d=a[c.toggleGroup];if(d){d.remove(c);c.un("toggle",b)}},getPressed:function(h){var e=a[h];if(e){for(var d=0,c=e.length;d<c;d++){if(e[d].pressed===true){return e[d]}}}return null}}}();Ext.SplitButton=Ext.extend(Ext.Button,{arrowSelector:"em",split:true,initComponent:function(){Ext.SplitButton.superclass.initComponent.call(this);this.addEvents("arrowclick")},onRender:function(){Ext.SplitButton.superclass.onRender.apply(this,arguments);if(this.arrowTooltip){this.el.child(this.arrowSelector).dom[this.tooltipType]=this.arrowTooltip}},setArrowHandler:function(b,a){this.arrowHandler=b;this.scope=a},getMenuClass:function(){return"x-btn-split"+(this.arrowAlign=="bottom"?"-bottom":"")},isClickOnArrow:function(c){if(this.arrowAlign!="bottom"){var b=this.el.child("em.x-btn-split");var a=b.getRegion().right-b.getPadding("r");return c.getPageX()>a}else{return c.getPageY()>this.btnEl.getRegion().bottom}},onClick:function(b,a){b.preventDefault();if(!this.disabled){if(this.isClickOnArrow(b)){if(this.menu&&!this.menu.isVisible()&&!this.ignoreNextClick){this.showMenu()}this.fireEvent("arrowclick",this,b);if(this.arrowHandler){this.arrowHandler.call(this.scope||this,this,b)}}else{this.doToggle();this.fireEvent("click",this,b);if(this.handler){this.handler.call(this.scope||this,this,b)}}}},isMenuTriggerOver:function(a){return this.menu&&a.target.tagName==this.arrowSelector},isMenuTriggerOut:function(b,a){return this.menu&&b.target.tagName!=this.arrowSelector}});Ext.reg("splitbutton",Ext.SplitButton);Ext.CycleButton=Ext.extend(Ext.SplitButton,{getItemText:function(a){if(a&&this.showText===true){var b="";if(this.prependText){b+=this.prependText}b+=a.text;return b}return undefined},setActiveItem:function(c,a){if(!Ext.isObject(c)){c=this.menu.getComponent(c)}if(c){if(!this.rendered){this.text=this.getItemText(c);this.iconCls=c.iconCls}else{var b=this.getItemText(c);if(b){this.setText(b)}this.setIconClass(c.iconCls)}this.activeItem=c;if(!c.checked){c.setChecked(true,a)}if(this.forceIcon){this.setIconClass(this.forceIcon)}if(!a){this.fireEvent("change",this,c)}}},getActiveItem:function(){return this.activeItem},initComponent:function(){this.addEvents("change");if(this.changeHandler){this.on("change",this.changeHandler,this.scope||this);delete this.changeHandler}this.itemCount=this.items.length;this.menu={cls:"x-cycle-menu",items:[]};var a=0;Ext.each(this.items,function(c,b){Ext.apply(c,{group:c.group||this.id,itemIndex:b,checkHandler:this.checkHandler,scope:this,checked:c.checked||false});this.menu.items.push(c);if(c.checked){a=b}},this);Ext.CycleButton.superclass.initComponent.call(this);this.on("click",this.toggleSelected,this);this.setActiveItem(a,true)},checkHandler:function(a,b){if(b){this.setActiveItem(a)}},toggleSelected:function(){var a=this.menu;a.render();if(!a.hasLayout){a.doLayout()}var d,b;for(var c=1;c<this.itemCount;c++){d=(this.activeItem.itemIndex+c)%this.itemCount;b=a.items.itemAt(d);if(!b.disabled){b.setChecked(true);break}}}});Ext.reg("cycle",Ext.CycleButton);Ext.Toolbar=function(a){if(Ext.isArray(a)){a={items:a,layout:"toolbar"}}else{a=Ext.apply({layout:"toolbar"},a);if(a.buttons){a.items=a.buttons}}Ext.Toolbar.superclass.constructor.call(this,a)};(function(){var a=Ext.Toolbar;Ext.extend(a,Ext.Container,{defaultType:"button",enableOverflow:false,trackMenus:true,internalDefaults:{removeMode:"container",hideParent:true},toolbarCls:"x-toolbar",initComponent:function(){a.superclass.initComponent.call(this);this.addEvents("overflowchange")},onRender:function(c,b){if(!this.el){if(!this.autoCreate){this.autoCreate={cls:this.toolbarCls+" x-small-editor"}}this.el=c.createChild(Ext.apply({id:this.id},this.autoCreate),b);Ext.Toolbar.superclass.onRender.apply(this,arguments)}},lookupComponent:function(b){if(Ext.isString(b)){if(b=="-"){b=new a.Separator()}else{if(b==" "){b=new a.Spacer()}else{if(b=="->"){b=new a.Fill()}else{b=new a.TextItem(b)}}}this.applyDefaults(b)}else{if(b.isFormField||b.render){b=this.createComponent(b)}else{if(b.tag){b=new a.Item({autoEl:b})}else{if(b.tagName){b=new a.Item({el:b})}else{if(Ext.isObject(b)){b=b.xtype?this.createComponent(b):this.constructButton(b)}}}}}return b},applyDefaults:function(e){if(!Ext.isString(e)){e=Ext.Toolbar.superclass.applyDefaults.call(this,e);var b=this.internalDefaults;if(e.events){Ext.applyIf(e.initialConfig,b);Ext.apply(e,b)}else{Ext.applyIf(e,b)}}return e},addSeparator:function(){return this.add(new a.Separator())},addSpacer:function(){return this.add(new a.Spacer())},addFill:function(){this.add(new a.Fill())},addElement:function(b){return this.addItem(new a.Item({el:b}))},addItem:function(b){return this.add.apply(this,arguments)},addButton:function(c){if(Ext.isArray(c)){var e=[];for(var d=0,b=c.length;d<b;d++){e.push(this.addButton(c[d]))}return e}return this.add(this.constructButton(c))},addText:function(b){return this.addItem(new a.TextItem(b))},addDom:function(b){return this.add(new a.Item({autoEl:b}))},addField:function(b){return this.add(b)},insertButton:function(c,g){if(Ext.isArray(g)){var e=[];for(var d=0,b=g.length;d<b;d++){e.push(this.insertButton(c+d,g[d]))}return e}return Ext.Toolbar.superclass.insert.call(this,c,g)},trackMenu:function(c,b){if(this.trackMenus&&c.menu){var d=b?"mun":"mon";this[d](c,"menutriggerover",this.onButtonTriggerOver,this);this[d](c,"menushow",this.onButtonMenuShow,this);this[d](c,"menuhide",this.onButtonMenuHide,this)}},constructButton:function(d){var c=d.events?d:this.createComponent(d,d.split?"splitbutton":this.defaultType);return c},onAdd:function(b){Ext.Toolbar.superclass.onAdd.call(this);this.trackMenu(b);if(this.disabled){b.disable()}},onRemove:function(b){Ext.Toolbar.superclass.onRemove.call(this);if(b==this.activeMenuBtn){delete this.activeMenuBtn}this.trackMenu(b,true)},onDisable:function(){this.items.each(function(b){if(b.disable){b.disable()}})},onEnable:function(){this.items.each(function(b){if(b.enable){b.enable()}})},onButtonTriggerOver:function(b){if(this.activeMenuBtn&&this.activeMenuBtn!=b){this.activeMenuBtn.hideMenu();b.showMenu();this.activeMenuBtn=b}},onButtonMenuShow:function(b){this.activeMenuBtn=b},onButtonMenuHide:function(b){delete this.activeMenuBtn}});Ext.reg("toolbar",Ext.Toolbar);a.Item=Ext.extend(Ext.BoxComponent,{hideParent:true,enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.reg("tbitem",a.Item);a.Separator=Ext.extend(a.Item,{onRender:function(c,b){this.el=c.createChild({tag:"span",cls:"xtb-sep"},b)}});Ext.reg("tbseparator",a.Separator);a.Spacer=Ext.extend(a.Item,{onRender:function(c,b){this.el=c.createChild({tag:"div",cls:"xtb-spacer",style:this.width?"width:"+this.width+"px":""},b)}});Ext.reg("tbspacer",a.Spacer);a.Fill=Ext.extend(a.Item,{render:Ext.emptyFn,isFill:true});Ext.reg("tbfill",a.Fill);a.TextItem=Ext.extend(a.Item,{constructor:function(b){a.TextItem.superclass.constructor.call(this,Ext.isString(b)?{text:b}:b)},onRender:function(c,b){this.autoEl={cls:"xtb-text",html:this.text||""};a.TextItem.superclass.onRender.call(this,c,b)},setText:function(b){if(this.rendered){this.el.update(b)}else{this.text=b}}});Ext.reg("tbtext",a.TextItem);a.Button=Ext.extend(Ext.Button,{});a.SplitButton=Ext.extend(Ext.SplitButton,{});Ext.reg("tbbutton",a.Button);Ext.reg("tbsplit",a.SplitButton)})();Ext.ButtonGroup=Ext.extend(Ext.Panel,{baseCls:"x-btn-group",layout:"table",defaultType:"button",frame:true,internalDefaults:{removeMode:"container",hideParent:true},initComponent:function(){this.layoutConfig=this.layoutConfig||{};Ext.applyIf(this.layoutConfig,{columns:this.columns});if(!this.title){this.addClass("x-btn-group-notitle")}this.on("afterlayout",this.onAfterLayout,this);Ext.ButtonGroup.superclass.initComponent.call(this)},applyDefaults:function(b){b=Ext.ButtonGroup.superclass.applyDefaults.call(this,b);var a=this.internalDefaults;if(b.events){Ext.applyIf(b.initialConfig,a);Ext.apply(b,a)}else{Ext.applyIf(b,a)}return b},onAfterLayout:function(){var a=this.body.getFrameWidth("lr")+this.body.dom.firstChild.offsetWidth;this.body.setWidth(a);this.el.setWidth(a+this.getFrameWidth())}});Ext.reg("buttongroup",Ext.ButtonGroup);(function(){var a=Ext.Toolbar;Ext.PagingToolbar=Ext.extend(Ext.Toolbar,{pageSize:20,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No data to display",beforePageText:"Page",afterPageText:"of {0}",firstText:"First Page",prevText:"Previous Page",nextText:"Next Page",lastText:"Last Page",refreshText:"Refresh",initComponent:function(){var c=[this.first=new a.Button({tooltip:this.firstText,overflowText:this.firstText,iconCls:"x-tbar-page-first",disabled:true,handler:this.moveFirst,scope:this}),this.prev=new a.Button({tooltip:this.prevText,overflowText:this.prevText,iconCls:"x-tbar-page-prev",disabled:true,handler:this.movePrevious,scope:this}),"-",this.beforePageText,this.inputItem=new Ext.form.NumberField({cls:"x-tbar-page-number",allowDecimals:false,allowNegative:false,enableKeyEvents:true,selectOnFocus:true,submitValue:false,listeners:{scope:this,keydown:this.onPagingKeyDown,blur:this.onPagingBlur}}),this.afterTextItem=new a.TextItem({text:String.format(this.afterPageText,1)}),"-",this.next=new a.Button({tooltip:this.nextText,overflowText:this.nextText,iconCls:"x-tbar-page-next",disabled:true,handler:this.moveNext,scope:this}),this.last=new a.Button({tooltip:this.lastText,overflowText:this.lastText,iconCls:"x-tbar-page-last",disabled:true,handler:this.moveLast,scope:this}),"-",this.refresh=new a.Button({tooltip:this.refreshText,overflowText:this.refreshText,iconCls:"x-tbar-loading",handler:this.doRefresh,scope:this})];var b=this.items||this.buttons||[];if(this.prependButtons){this.items=b.concat(c)}else{this.items=c.concat(b)}delete this.buttons;if(this.displayInfo){this.items.push("->");this.items.push(this.displayItem=new a.TextItem({}))}Ext.PagingToolbar.superclass.initComponent.call(this);this.addEvents("change","beforechange");this.on("afterlayout",this.onFirstLayout,this,{single:true});this.cursor=0;this.bindStore(this.store,true)},onFirstLayout:function(){if(this.dsLoaded){this.onLoad.apply(this,this.dsLoaded)}},updateInfo:function(){if(this.displayItem){var b=this.store.getCount();var c=b==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+b,this.store.getTotalCount());this.displayItem.setText(c)}},onLoad:function(b,e,j){if(!this.rendered){this.dsLoaded=[b,e,j];return}var g=this.getParams();this.cursor=(j.params&&j.params[g.start])?j.params[g.start]:0;var i=this.getPageData(),c=i.activePage,h=i.pages;this.afterTextItem.setText(String.format(this.afterPageText,i.pages));this.inputItem.setValue(c);this.first.setDisabled(c==1);this.prev.setDisabled(c==1);this.next.setDisabled(c==h);this.last.setDisabled(c==h);this.refresh.enable();this.updateInfo();this.fireEvent("change",this,i)},getPageData:function(){var b=this.store.getTotalCount();return{total:b,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:b<this.pageSize?1:Math.ceil(b/this.pageSize)}},changePage:function(b){this.doLoad(((b-1)*this.pageSize).constrain(0,this.store.getTotalCount()))},onLoadError:function(){if(!this.rendered){return}this.refresh.enable()},readPage:function(e){var b=this.inputItem.getValue(),c;if(!b||isNaN(c=parseInt(b,10))){this.inputItem.setValue(e.activePage);return false}return c},onPagingFocus:function(){this.inputItem.select()},onPagingBlur:function(b){this.inputItem.setValue(this.getPageData().activePage)},onPagingKeyDown:function(i,h){var c=h.getKey(),j=this.getPageData(),g;if(c==h.RETURN){h.stopEvent();g=this.readPage(j);if(g!==false){g=Math.min(Math.max(1,g),j.pages)-1;this.doLoad(g*this.pageSize)}}else{if(c==h.HOME||c==h.END){h.stopEvent();g=c==h.HOME?1:j.pages;i.setValue(g)}else{if(c==h.UP||c==h.PAGEUP||c==h.DOWN||c==h.PAGEDOWN){h.stopEvent();if((g=this.readPage(j))){var b=h.shiftKey?10:1;if(c==h.DOWN||c==h.PAGEDOWN){b*=-1}g+=b;if(g>=1&g<=j.pages){i.setValue(g)}}}}}},getParams:function(){return this.paramNames||this.store.paramNames},beforeLoad:function(){if(this.rendered&&this.refresh){this.refresh.disable()}},doLoad:function(d){var c={},b=this.getParams();c[b.start]=d;c[b.limit]=this.pageSize;if(this.fireEvent("beforechange",this,c)!==false){this.store.load({params:c})}},moveFirst:function(){this.doLoad(0)},movePrevious:function(){this.doLoad(Math.max(0,this.cursor-this.pageSize))},moveNext:function(){this.doLoad(this.cursor+this.pageSize)},moveLast:function(){var c=this.store.getTotalCount(),b=c%this.pageSize;this.doLoad(b?(c-b):c-this.pageSize)},doRefresh:function(){this.doLoad(this.cursor)},bindStore:function(c,d){var b;if(!d&&this.store){if(c!==this.store&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("beforeload",this.beforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.onLoadError,this)}if(!c){this.store=null}}if(c){c=Ext.StoreMgr.lookup(c);c.on({scope:this,beforeload:this.beforeLoad,load:this.onLoad,exception:this.onLoadError});b=true}this.store=c;if(b){this.onLoad(c,null,{})}},unbind:function(b){this.bindStore(null)},bind:function(b){this.bindStore(b)},onDestroy:function(){this.bindStore(null);Ext.PagingToolbar.superclass.onDestroy.call(this)}})})();Ext.reg("paging",Ext.PagingToolbar);Ext.History=(function(){var e,c;var k=false;var d;function g(){var l=location.href,m=l.indexOf("#"),n=m>=0?l.substr(m+1):null;if(Ext.isGecko){n=decodeURIComponent(n)}return n}function a(){c.value=d}function h(l){d=l;Ext.History.fireEvent("change",l)}function i(m){var l=['<html><body><div id="state">',Ext.util.Format.htmlEncode(m),"</div></body></html>"].join("");try{var o=e.contentWindow.document;o.open();o.write(l);o.close();return true}catch(n){return false}}function b(){if(!e.contentWindow||!e.contentWindow.document){setTimeout(b,10);return}var o=e.contentWindow.document;var m=o.getElementById("state");var l=m?m.innerText:null;var n=g();setInterval(function(){o=e.contentWindow.document;m=o.getElementById("state");var q=m?m.innerText:null;var p=g();if(q!==l){l=q;h(l);location.hash=l;n=l;a()}else{if(p!==n){n=p;i(p)}}},50);k=true;Ext.History.fireEvent("ready",Ext.History)}function j(){d=c.value?c.value:g();if(Ext.isIE){b()}else{var l=g();setInterval(function(){var m=g();if(m!==l){l=m;h(l);a()}},50);k=true;Ext.History.fireEvent("ready",Ext.History)}}return{fieldId:"x-history-field",iframeId:"x-history-frame",events:{},init:function(m,l){if(k){Ext.callback(m,l,[this]);return}if(!Ext.isReady){Ext.onReady(function(){Ext.History.init(m,l)});return}c=Ext.getDom(Ext.History.fieldId);if(Ext.isIE){e=Ext.getDom(Ext.History.iframeId)}this.addEvents("ready","change");if(m){this.on("ready",m,l,{single:true})}j()},add:function(l,m){if(m!==false){if(this.getToken()==l){return true}}if(Ext.isIE){return i(l)}else{location.hash=l;return true}},back:function(){history.go(-1)},forward:function(){history.go(1)},getToken:function(){return k?d:g()}}})();Ext.apply(Ext.History,new Ext.util.Observable());Ext.Tip=Ext.extend(Ext.Panel,{minWidth:40,maxWidth:300,shadow:"sides",defaultAlign:"tl-bl?",autoRender:true,quickShowInterval:250,frame:true,hidden:true,baseCls:"x-tip",floating:{shadow:true,shim:true,useDisplay:true,constrain:false},autoHeight:true,closeAction:"hide",initComponent:function(){Ext.Tip.superclass.initComponent.call(this);if(this.closable&&!this.title){this.elements+=",header"}},afterRender:function(){Ext.Tip.superclass.afterRender.call(this);if(this.closable){this.addTool({id:"close",handler:this[this.closeAction],scope:this})}},showAt:function(a){Ext.Tip.superclass.show.call(this);if(this.measureWidth!==false&&(!this.initialConfig||typeof this.initialConfig.width!="number")){this.doAutoWidth()}if(this.constrainPosition){a=this.el.adjustForConstraints(a)}this.setPagePosition(a[0],a[1])},doAutoWidth:function(a){a=a||0;var b=this.body.getTextWidth();if(this.title){b=Math.max(b,this.header.child("span").getTextWidth(this.title))}b+=this.getFrameWidth()+(this.closable?20:0)+this.body.getPadding("lr")+a;this.setWidth(b.constrain(this.minWidth,this.maxWidth));if(Ext.isIE7&&!this.repainted){this.el.repaint();this.repainted=true}},showBy:function(a,b){if(!this.rendered){this.render(Ext.getBody())}this.showAt(this.el.getAlignToXY(a,b||this.defaultAlign))},initDraggable:function(){this.dd=new Ext.Tip.DD(this,typeof this.draggable=="boolean"?null:this.draggable);this.header.addClass("x-tip-draggable")}});Ext.reg("tip",Ext.Tip);Ext.Tip.DD=function(b,a){Ext.apply(this,a);this.tip=b;Ext.Tip.DD.superclass.constructor.call(this,b.el.id,"WindowDD-"+b.id);this.setHandleElId(b.header.id);this.scroll=false};Ext.extend(Ext.Tip.DD,Ext.dd.DD,{moveOnly:true,scroll:false,headerOffsets:[100,25],startDrag:function(){this.tip.el.disableShadow()},endDrag:function(a){this.tip.el.enableShadow(true)}});Ext.ToolTip=Ext.extend(Ext.Tip,{showDelay:500,hideDelay:200,dismissDelay:5000,trackMouse:false,anchorToTarget:true,anchorOffset:0,targetCounter:0,constrainPosition:false,initComponent:function(){Ext.ToolTip.superclass.initComponent.call(this);this.lastActive=new Date();this.initTarget(this.target);this.origAnchor=this.anchor},onRender:function(b,a){Ext.ToolTip.superclass.onRender.call(this,b,a);this.anchorCls="x-tip-anchor-"+this.getAnchorPosition();this.anchorEl=this.el.createChild({cls:"x-tip-anchor "+this.anchorCls})},afterRender:function(){Ext.ToolTip.superclass.afterRender.call(this);this.anchorEl.setStyle("z-index",this.el.getZIndex()+1).setVisibilityMode(Ext.Element.DISPLAY)},initTarget:function(c){var a;if((a=Ext.get(c))){if(this.target){var b=Ext.get(this.target);this.mun(b,"mouseover",this.onTargetOver,this);this.mun(b,"mouseout",this.onTargetOut,this);this.mun(b,"mousemove",this.onMouseMove,this)}this.mon(a,{mouseover:this.onTargetOver,mouseout:this.onTargetOut,mousemove:this.onMouseMove,scope:this});this.target=a}if(this.anchor){this.anchorTarget=this.target}},onMouseMove:function(b){var a=this.delegate?b.getTarget(this.delegate):this.triggerElement=true;if(a){this.targetXY=b.getXY();if(a===this.triggerElement){if(!this.hidden&&this.trackMouse){this.setPagePosition(this.getTargetXY())}}else{this.hide();this.lastActive=new Date(0);this.onTargetOver(b)}}else{if(!this.closable&&this.isVisible()){this.hide()}}},getTargetXY:function(){if(this.delegate){this.anchorTarget=this.triggerElement}if(this.anchor){this.targetCounter++;var c=this.getOffsets(),l=(this.anchorToTarget&&!this.trackMouse)?this.el.getAlignToXY(this.anchorTarget,this.getAnchorAlign()):this.targetXY,a=Ext.lib.Dom.getViewWidth()-5,h=Ext.lib.Dom.getViewHeight()-5,i=document.documentElement,e=document.body,k=(i.scrollLeft||e.scrollLeft||0)+5,j=(i.scrollTop||e.scrollTop||0)+5,b=[l[0]+c[0],l[1]+c[1]],g=this.getSize();this.anchorEl.removeClass(this.anchorCls);if(this.targetCounter<2){if(b[0]<k){if(this.anchorToTarget){this.defaultAlign="l-r";if(this.mouseOffset){this.mouseOffset[0]*=-1}}this.anchor="left";return this.getTargetXY()}if(b[0]+g.width>a){if(this.anchorToTarget){this.defaultAlign="r-l";if(this.mouseOffset){this.mouseOffset[0]*=-1}}this.anchor="right";return this.getTargetXY()}if(b[1]<j){if(this.anchorToTarget){this.defaultAlign="t-b";if(this.mouseOffset){this.mouseOffset[1]*=-1}}this.anchor="top";return this.getTargetXY()}if(b[1]+g.height>h){if(this.anchorToTarget){this.defaultAlign="b-t";if(this.mouseOffset){this.mouseOffset[1]*=-1}}this.anchor="bottom";return this.getTargetXY()}}this.anchorCls="x-tip-anchor-"+this.getAnchorPosition();this.anchorEl.addClass(this.anchorCls);this.targetCounter=0;return b}else{var d=this.getMouseOffset();return[this.targetXY[0]+d[0],this.targetXY[1]+d[1]]}},getMouseOffset:function(){var a=this.anchor?[0,0]:[15,18];if(this.mouseOffset){a[0]+=this.mouseOffset[0];a[1]+=this.mouseOffset[1]}return a},getAnchorPosition:function(){if(this.anchor){this.tipAnchor=this.anchor.charAt(0)}else{var a=this.defaultAlign.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!a){throw"AnchorTip.defaultAlign is invalid"}this.tipAnchor=a[1].charAt(0)}switch(this.tipAnchor){case"t":return"top";case"b":return"bottom";case"r":return"right"}return"left"},getAnchorAlign:function(){switch(this.anchor){case"top":return"tl-bl";case"left":return"tl-tr";case"right":return"tr-tl";default:return"bl-tl"}},getOffsets:function(){var b,a=this.getAnchorPosition().charAt(0);if(this.anchorToTarget&&!this.trackMouse){switch(a){case"t":b=[0,9];break;case"b":b=[0,-13];break;case"r":b=[-13,0];break;default:b=[9,0];break}}else{switch(a){case"t":b=[-15-this.anchorOffset,30];break;case"b":b=[-19-this.anchorOffset,-13-this.el.dom.offsetHeight];break;case"r":b=[-15-this.el.dom.offsetWidth,-13-this.anchorOffset];break;default:b=[25,-13-this.anchorOffset];break}}var c=this.getMouseOffset();b[0]+=c[0];b[1]+=c[1];return b},onTargetOver:function(b){if(this.disabled||b.within(this.target.dom,true)){return}var a=b.getTarget(this.delegate);if(a){this.triggerElement=a;this.clearTimer("hide");this.targetXY=b.getXY();this.delayShow()}},delayShow:function(){if(this.hidden&&!this.showTimer){if(this.lastActive.getElapsed()<this.quickShowInterval){this.show()}else{this.showTimer=this.show.defer(this.showDelay,this)}}else{if(!this.hidden&&this.autoHide!==false){this.show()}}},onTargetOut:function(a){if(this.disabled||a.within(this.target.dom,true)){return}this.clearTimer("show");if(this.autoHide!==false){this.delayHide()}},delayHide:function(){if(!this.hidden&&!this.hideTimer){this.hideTimer=this.hide.defer(this.hideDelay,this)}},hide:function(){this.clearTimer("dismiss");this.lastActive=new Date();if(this.anchorEl){this.anchorEl.hide()}Ext.ToolTip.superclass.hide.call(this);delete this.triggerElement},show:function(){if(this.anchor){this.showAt([-1000,-1000]);this.origConstrainPosition=this.constrainPosition;this.constrainPosition=false;this.anchor=this.origAnchor}this.showAt(this.getTargetXY());if(this.anchor){this.anchorEl.show();this.syncAnchor();this.constrainPosition=this.origConstrainPosition}else{this.anchorEl.hide()}},showAt:function(a){this.lastActive=new Date();this.clearTimers();Ext.ToolTip.superclass.showAt.call(this,a);if(this.dismissDelay&&this.autoHide!==false){this.dismissTimer=this.hide.defer(this.dismissDelay,this)}if(this.anchor&&!this.anchorEl.isVisible()){this.syncAnchor();this.anchorEl.show()}else{this.anchorEl.hide()}},syncAnchor:function(){var a,b,c;switch(this.tipAnchor.charAt(0)){case"t":a="b";b="tl";c=[20+this.anchorOffset,2];break;case"r":a="l";b="tr";c=[-2,11+this.anchorOffset];break;case"b":a="t";b="bl";c=[20+this.anchorOffset,-2];break;default:a="r";b="tl";c=[2,11+this.anchorOffset];break}this.anchorEl.alignTo(this.el,a+"-"+b,c)},setPagePosition:function(a,b){Ext.ToolTip.superclass.setPagePosition.call(this,a,b);if(this.anchor){this.syncAnchor()}},clearTimer:function(a){a=a+"Timer";clearTimeout(this[a]);delete this[a]},clearTimers:function(){this.clearTimer("show");this.clearTimer("dismiss");this.clearTimer("hide")},onShow:function(){Ext.ToolTip.superclass.onShow.call(this);Ext.getDoc().on("mousedown",this.onDocMouseDown,this)},onHide:function(){Ext.ToolTip.superclass.onHide.call(this);Ext.getDoc().un("mousedown",this.onDocMouseDown,this)},onDocMouseDown:function(a){if(this.autoHide!==true&&!this.closable&&!a.within(this.el.dom)){this.disable();this.doEnable.defer(100,this)}},doEnable:function(){if(!this.isDestroyed){this.enable()}},onDisable:function(){this.clearTimers();this.hide()},adjustPosition:function(a,d){if(this.constrainPosition){var c=this.targetXY[1],b=this.getSize().height;if(d<=c&&(d+b)>=c){d=c-b-5}}return{x:a,y:d}},beforeDestroy:function(){this.clearTimers();Ext.destroy(this.anchorEl);delete this.anchorEl;delete this.target;delete this.anchorTarget;delete this.triggerElement;Ext.ToolTip.superclass.beforeDestroy.call(this)},onDestroy:function(){Ext.getDoc().un("mousedown",this.onDocMouseDown,this);Ext.ToolTip.superclass.onDestroy.call(this)}});Ext.reg("tooltip",Ext.ToolTip);Ext.QuickTip=Ext.extend(Ext.ToolTip,{interceptTitles:false,tagConfig:{namespace:"ext",attribute:"qtip",width:"qwidth",target:"target",title:"qtitle",hide:"hide",cls:"qclass",align:"qalign",anchor:"anchor"},initComponent:function(){this.target=this.target||Ext.getDoc();this.targets=this.targets||{};Ext.QuickTip.superclass.initComponent.call(this)},register:function(e){var h=Ext.isArray(e)?e:arguments;for(var g=0,a=h.length;g<a;g++){var l=h[g];var k=l.target;if(k){if(Ext.isArray(k)){for(var d=0,b=k.length;d<b;d++){this.targets[Ext.id(k[d])]=l}}else{this.targets[Ext.id(k)]=l}}}},unregister:function(a){delete this.targets[Ext.id(a)]},cancelShow:function(b){var a=this.activeTarget;b=Ext.get(b).dom;if(this.isVisible()){if(a&&a.el==b){this.hide()}}else{if(a&&a.el==b){this.clearTimer("show")}}},getTipCfg:function(d){var b=d.getTarget(),c,a;if(this.interceptTitles&&b.title&&Ext.isString(b.title)){c=b.title;b.qtip=c;b.removeAttribute("title");d.preventDefault()}else{a=this.tagConfig;c=b.qtip||Ext.fly(b).getAttribute(a.attribute,a.namespace)}return c},onTargetOver:function(i){if(this.disabled){return}this.targetXY=i.getXY();var c=i.getTarget();if(!c||c.nodeType!==1||c==document||c==document.body){return}if(this.activeTarget&&((c==this.activeTarget.el)||Ext.fly(this.activeTarget.el).contains(c))){this.clearTimer("hide");this.show();return}if(c&&this.targets[c.id]){this.activeTarget=this.targets[c.id];this.activeTarget.el=c;this.anchor=this.activeTarget.anchor;if(this.anchor){this.anchorTarget=c}this.delayShow();return}var g,h=Ext.fly(c),b=this.tagConfig,d=b.namespace;if(g=this.getTipCfg(i)){var a=h.getAttribute(b.hide,d);this.activeTarget={el:c,text:g,width:h.getAttribute(b.width,d),autoHide:a!="user"&&a!=="false",title:h.getAttribute(b.title,d),cls:h.getAttribute(b.cls,d),align:h.getAttribute(b.align,d)};this.anchor=h.getAttribute(b.anchor,d);if(this.anchor){this.anchorTarget=c}this.delayShow()}},onTargetOut:function(a){if(this.activeTarget&&a.within(this.activeTarget.el)&&!this.getTipCfg(a)){return}this.clearTimer("show");if(this.autoHide!==false){this.delayHide()}},showAt:function(b){var a=this.activeTarget;if(a){if(!this.rendered){this.render(Ext.getBody());this.activeTarget=a}if(a.width){this.setWidth(a.width);this.body.setWidth(this.adjustBodyWidth(a.width-this.getFrameWidth()));this.measureWidth=false}else{this.measureWidth=true}this.setTitle(a.title||"");this.body.update(a.text);this.autoHide=a.autoHide;this.dismissDelay=a.dismissDelay||this.dismissDelay;if(this.lastCls){this.el.removeClass(this.lastCls);delete this.lastCls}if(a.cls){this.el.addClass(a.cls);this.lastCls=a.cls}if(this.anchor){this.constrainPosition=false}else{if(a.align){b=this.el.getAlignToXY(a.el,a.align);this.constrainPosition=false}else{this.constrainPosition=true}}}Ext.QuickTip.superclass.showAt.call(this,b)},hide:function(){delete this.activeTarget;Ext.QuickTip.superclass.hide.call(this)}});Ext.reg("quicktip",Ext.QuickTip);Ext.QuickTips=function(){var b,a=false;return{init:function(c){if(!b){if(!Ext.isReady){Ext.onReady(function(){Ext.QuickTips.init(c)});return}b=new Ext.QuickTip({elements:"header,body",disabled:a});if(c!==false){b.render(Ext.getBody())}}},ddDisable:function(){if(b&&!a){b.disable()}},ddEnable:function(){if(b&&!a){b.enable()}},enable:function(){if(b){b.enable()}a=false},disable:function(){if(b){b.disable()}a=true},isEnabled:function(){return b!==undefined&&!b.disabled},getQuickTip:function(){return b},register:function(){b.register.apply(b,arguments)},unregister:function(){b.unregister.apply(b,arguments)},tips:function(){b.register.apply(b,arguments)}}}();Ext.slider.Tip=Ext.extend(Ext.Tip,{minWidth:10,offsets:[0,-10],init:function(a){a.on({scope:this,dragstart:this.onSlide,drag:this.onSlide,dragend:this.hide,destroy:this.destroy})},onSlide:function(b,c,a){this.show();this.body.update(this.getText(a));this.doAutoWidth();this.el.alignTo(a.el,"b-t?",this.offsets)},getText:function(a){return String(a.value)}});Ext.ux.SliderTip=Ext.slider.Tip;Ext.tree.TreePanel=Ext.extend(Ext.Panel,{rootVisible:true,animate:Ext.enableFx,lines:true,enableDD:false,hlDrop:Ext.enableFx,pathSeparator:"/",bubbleEvents:[],initComponent:function(){Ext.tree.TreePanel.superclass.initComponent.call(this);if(!this.eventModel){this.eventModel=new Ext.tree.TreeEventModel(this)}var a=this.loader;if(!a){a=new Ext.tree.TreeLoader({dataUrl:this.dataUrl,requestMethod:this.requestMethod})}else{if(Ext.isObject(a)&&!a.load){a=new Ext.tree.TreeLoader(a)}}this.loader=a;this.nodeHash={};if(this.root){var b=this.root;delete this.root;this.setRootNode(b)}this.addEvents("append","remove","movenode","insert","beforeappend","beforeremove","beforemovenode","beforeinsert","beforeload","load","textchange","beforeexpandnode","beforecollapsenode","expandnode","disabledchange","collapsenode","beforeclick","click","containerclick","checkchange","beforedblclick","dblclick","containerdblclick","contextmenu","containercontextmenu","beforechildrenrendered","startdrag","enddrag","dragdrop","beforenodedrop","nodedrop","nodedragover");if(this.singleExpand){this.on("beforeexpandnode",this.restrictExpand,this)}},proxyNodeEvent:function(c,b,a,h,g,e,d){if(c=="collapse"||c=="expand"||c=="beforecollapse"||c=="beforeexpand"||c=="move"||c=="beforemove"){c=c+"node"}return this.fireEvent(c,b,a,h,g,e,d)},getRootNode:function(){return this.root},setRootNode:function(b){this.destroyRoot();if(!b.render){b=this.loader.createNode(b)}this.root=b;b.ownerTree=this;b.isRoot=true;this.registerNode(b);if(!this.rootVisible){var a=b.attributes.uiProvider;b.ui=a?new a(b):new Ext.tree.RootTreeNodeUI(b)}if(this.innerCt){this.clearInnerCt();this.renderRoot()}return b},clearInnerCt:function(){this.innerCt.update("")},renderRoot:function(){this.root.render();if(!this.rootVisible){this.root.renderChildren()}},getNodeById:function(a){return this.nodeHash[a]},registerNode:function(a){this.nodeHash[a.id]=a},unregisterNode:function(a){delete this.nodeHash[a.id]},toString:function(){return"[Tree"+(this.id?" "+this.id:"")+"]"},restrictExpand:function(a){var b=a.parentNode;if(b){if(b.expandedChild&&b.expandedChild.parentNode==b){b.expandedChild.collapse()}b.expandedChild=a}},getChecked:function(b,c){c=c||this.root;var d=[];var e=function(){if(this.attributes.checked){d.push(!b?this:(b=="id"?this.id:this.attributes[b]))}};c.cascade(e);return d},getLoader:function(){return this.loader},expandAll:function(){this.root.expand(true)},collapseAll:function(){this.root.collapse(true)},getSelectionModel:function(){if(!this.selModel){this.selModel=new Ext.tree.DefaultSelectionModel()}return this.selModel},expandPath:function(g,a,h){if(Ext.isEmpty(g)){if(h){h(false,undefined)}return}a=a||"id";var d=g.split(this.pathSeparator);var c=this.root;if(c.attributes[a]!=d[1]){if(h){h(false,null)}return}var b=1;var e=function(){if(++b==d.length){if(h){h(true,c)}return}var i=c.findChild(a,d[b]);if(!i){if(h){h(false,c)}return}c=i;i.expand(false,false,e)};c.expand(false,false,e)},selectPath:function(e,a,g){if(Ext.isEmpty(e)){if(g){g(false,undefined)}return}a=a||"id";var c=e.split(this.pathSeparator),b=c.pop();if(c.length>1){var d=function(i,h){if(i&&h){var j=h.findChild(a,b);if(j){j.select();if(g){g(true,j)}}else{if(g){g(false,j)}}}else{if(g){g(false,j)}}};this.expandPath(c.join(this.pathSeparator),a,d)}else{this.root.select();if(g){g(true,this.root)}}},getTreeEl:function(){return this.body},onRender:function(b,a){Ext.tree.TreePanel.superclass.onRender.call(this,b,a);this.el.addClass("x-tree");this.innerCt=this.body.createChild({tag:"ul",cls:"x-tree-root-ct "+(this.useArrows?"x-tree-arrows":this.lines?"x-tree-lines":"x-tree-no-lines")})},initEvents:function(){Ext.tree.TreePanel.superclass.initEvents.call(this);if(this.containerScroll){Ext.dd.ScrollManager.register(this.body)}if((this.enableDD||this.enableDrop)&&!this.dropZone){this.dropZone=new Ext.tree.TreeDropZone(this,this.dropConfig||{ddGroup:this.ddGroup||"TreeDD",appendOnly:this.ddAppendOnly===true})}if((this.enableDD||this.enableDrag)&&!this.dragZone){this.dragZone=new Ext.tree.TreeDragZone(this,this.dragConfig||{ddGroup:this.ddGroup||"TreeDD",scroll:this.ddScroll})}this.getSelectionModel().init(this)},afterRender:function(){Ext.tree.TreePanel.superclass.afterRender.call(this);this.renderRoot()},beforeDestroy:function(){if(this.rendered){Ext.dd.ScrollManager.unregister(this.body);Ext.destroy(this.dropZone,this.dragZone)}this.destroyRoot();Ext.destroy(this.loader);this.nodeHash=this.root=this.loader=null;Ext.tree.TreePanel.superclass.beforeDestroy.call(this)},destroyRoot:function(){if(this.root&&this.root.destroy){this.root.destroy(true)}}});Ext.tree.TreePanel.nodeTypes={};Ext.reg("treepanel",Ext.tree.TreePanel);Ext.tree.TreeEventModel=function(a){this.tree=a;this.tree.on("render",this.initEvents,this)};Ext.tree.TreeEventModel.prototype={initEvents:function(){var a=this.tree;if(a.trackMouseOver!==false){a.mon(a.innerCt,{scope:this,mouseover:this.delegateOver,mouseout:this.delegateOut})}a.mon(a.getTreeEl(),{scope:this,click:this.delegateClick,dblclick:this.delegateDblClick,contextmenu:this.delegateContextMenu})},getNode:function(b){var a;if(a=b.getTarget(".x-tree-node-el",10)){var c=Ext.fly(a,"_treeEvents").getAttribute("tree-node-id","ext");if(c){return this.tree.getNodeById(c)}}return null},getNodeTarget:function(b){var a=b.getTarget(".x-tree-node-icon",1);if(!a){a=b.getTarget(".x-tree-node-el",6)}return a},delegateOut:function(b,a){if(!this.beforeEvent(b)){return}if(b.getTarget(".x-tree-ec-icon",1)){var c=this.getNode(b);this.onIconOut(b,c);if(c==this.lastEcOver){delete this.lastEcOver}}if((a=this.getNodeTarget(b))&&!b.within(a,true)){this.onNodeOut(b,this.getNode(b))}},delegateOver:function(b,a){if(!this.beforeEvent(b)){return}if(Ext.isGecko&&!this.trackingDoc){Ext.getBody().on("mouseover",this.trackExit,this);this.trackingDoc=true}if(this.lastEcOver){this.onIconOut(b,this.lastEcOver);delete this.lastEcOver}if(b.getTarget(".x-tree-ec-icon",1)){this.lastEcOver=this.getNode(b);this.onIconOver(b,this.lastEcOver)}if(a=this.getNodeTarget(b)){this.onNodeOver(b,this.getNode(b))}},trackExit:function(a){if(this.lastOverNode){if(this.lastOverNode.ui&&!a.within(this.lastOverNode.ui.getEl())){this.onNodeOut(a,this.lastOverNode)}delete this.lastOverNode;Ext.getBody().un("mouseover",this.trackExit,this);this.trackingDoc=false}},delegateClick:function(b,a){if(this.beforeEvent(b)){if(b.getTarget("input[type=checkbox]",1)){this.onCheckboxClick(b,this.getNode(b))}else{if(b.getTarget(".x-tree-ec-icon",1)){this.onIconClick(b,this.getNode(b))}else{if(this.getNodeTarget(b)){this.onNodeClick(b,this.getNode(b))}}}}else{this.checkContainerEvent(b,"click")}},delegateDblClick:function(b,a){if(this.beforeEvent(b)){if(this.getNodeTarget(b)){this.onNodeDblClick(b,this.getNode(b))}}else{this.checkContainerEvent(b,"dblclick")}},delegateContextMenu:function(b,a){if(this.beforeEvent(b)){if(this.getNodeTarget(b)){this.onNodeContextMenu(b,this.getNode(b))}}else{this.checkContainerEvent(b,"contextmenu")}},checkContainerEvent:function(b,a){if(this.disabled){b.stopEvent();return false}this.onContainerEvent(b,a)},onContainerEvent:function(b,a){this.tree.fireEvent("container"+a,this.tree,b)},onNodeClick:function(b,a){a.ui.onClick(b)},onNodeOver:function(b,a){this.lastOverNode=a;a.ui.onOver(b)},onNodeOut:function(b,a){a.ui.onOut(b)},onIconOver:function(b,a){a.ui.addClass("x-tree-ec-over")},onIconOut:function(b,a){a.ui.removeClass("x-tree-ec-over")},onIconClick:function(b,a){a.ui.ecClick(b)},onCheckboxClick:function(b,a){a.ui.onCheckChange(b)},onNodeDblClick:function(b,a){a.ui.onDblClick(b)},onNodeContextMenu:function(b,a){a.ui.onContextMenu(b)},beforeEvent:function(b){var a=this.getNode(b);if(this.disabled||!a||!a.ui){b.stopEvent();return false}return true},disable:function(){this.disabled=true},enable:function(){this.disabled=false}};Ext.tree.DefaultSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(a){this.selNode=null;this.addEvents("selectionchange","beforeselect");Ext.apply(this,a);Ext.tree.DefaultSelectionModel.superclass.constructor.call(this)},init:function(a){this.tree=a;a.mon(a.getTreeEl(),"keydown",this.onKeyDown,this);a.on("click",this.onNodeClick,this)},onNodeClick:function(a,b){this.select(a)},select:function(c,a){if(!Ext.fly(c.ui.wrap).isVisible()&&a){return a.call(this,c)}var b=this.selNode;if(c==b){c.ui.onSelectedChange(true)}else{if(this.fireEvent("beforeselect",this,c,b)!==false){if(b&&b.ui){b.ui.onSelectedChange(false)}this.selNode=c;c.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,c,b)}}return c},unselect:function(b,a){if(this.selNode==b){this.clearSelections(a)}},clearSelections:function(a){var b=this.selNode;if(b){b.ui.onSelectedChange(false);this.selNode=null;if(a!==true){this.fireEvent("selectionchange",this,null)}}return b},getSelectedNode:function(){return this.selNode},isSelected:function(a){return this.selNode==a},selectPrevious:function(a){if(!(a=a||this.selNode||this.lastSelNode)){return null}var c=a.previousSibling;if(c){if(!c.isExpanded()||c.childNodes.length<1){return this.select(c,this.selectPrevious)}else{var b=c.lastChild;while(b&&b.isExpanded()&&Ext.fly(b.ui.wrap).isVisible()&&b.childNodes.length>0){b=b.lastChild}return this.select(b,this.selectPrevious)}}else{if(a.parentNode&&(this.tree.rootVisible||!a.parentNode.isRoot)){return this.select(a.parentNode,this.selectPrevious)}}return null},selectNext:function(b){if(!(b=b||this.selNode||this.lastSelNode)){return null}if(b.firstChild&&b.isExpanded()&&Ext.fly(b.ui.wrap).isVisible()){return this.select(b.firstChild,this.selectNext)}else{if(b.nextSibling){return this.select(b.nextSibling,this.selectNext)}else{if(b.parentNode){var a=null;b.parentNode.bubble(function(){if(this.nextSibling){a=this.getOwnerTree().selModel.select(this.nextSibling,this.selectNext);return false}});return a}}}return null},onKeyDown:function(c){var b=this.selNode||this.lastSelNode;var d=this;if(!b){return}var a=c.getKey();switch(a){case c.DOWN:c.stopEvent();this.selectNext();break;case c.UP:c.stopEvent();this.selectPrevious();break;case c.RIGHT:c.preventDefault();if(b.hasChildNodes()){if(!b.isExpanded()){b.expand()}else{if(b.firstChild){this.select(b.firstChild,c)}}}break;case c.LEFT:c.preventDefault();if(b.hasChildNodes()&&b.isExpanded()){b.collapse()}else{if(b.parentNode&&(this.tree.rootVisible||b.parentNode!=this.tree.getRootNode())){this.select(b.parentNode,c)}}break}}});Ext.tree.MultiSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(a){this.selNodes=[];this.selMap={};this.addEvents("selectionchange");Ext.apply(this,a);Ext.tree.MultiSelectionModel.superclass.constructor.call(this)},init:function(a){this.tree=a;a.mon(a.getTreeEl(),"keydown",this.onKeyDown,this);a.on("click",this.onNodeClick,this)},onNodeClick:function(a,b){if(b.ctrlKey&&this.isSelected(a)){this.unselect(a)}else{this.select(a,b,b.ctrlKey)}},select:function(a,c,b){if(b!==true){this.clearSelections(true)}if(this.isSelected(a)){this.lastSelNode=a;return a}this.selNodes.push(a);this.selMap[a.id]=a;this.lastSelNode=a;a.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,this.selNodes);return a},unselect:function(b){if(this.selMap[b.id]){b.ui.onSelectedChange(false);var c=this.selNodes;var a=c.indexOf(b);if(a!=-1){this.selNodes.splice(a,1)}delete this.selMap[b.id];this.fireEvent("selectionchange",this,this.selNodes)}},clearSelections:function(b){var d=this.selNodes;if(d.length>0){for(var c=0,a=d.length;c<a;c++){d[c].ui.onSelectedChange(false)}this.selNodes=[];this.selMap={};if(b!==true){this.fireEvent("selectionchange",this,this.selNodes)}}},isSelected:function(a){return this.selMap[a.id]?true:false},getSelectedNodes:function(){return this.selNodes.concat([])},onKeyDown:Ext.tree.DefaultSelectionModel.prototype.onKeyDown,selectNext:Ext.tree.DefaultSelectionModel.prototype.selectNext,selectPrevious:Ext.tree.DefaultSelectionModel.prototype.selectPrevious});Ext.data.Tree=Ext.extend(Ext.util.Observable,{constructor:function(a){this.nodeHash={};this.root=null;if(a){this.setRootNode(a)}this.addEvents("append","remove","move","insert","beforeappend","beforeremove","beforemove","beforeinsert");Ext.data.Tree.superclass.constructor.call(this)},pathSeparator:"/",proxyNodeEvent:function(){return this.fireEvent.apply(this,arguments)},getRootNode:function(){return this.root},setRootNode:function(a){this.root=a;a.ownerTree=this;a.isRoot=true;this.registerNode(a);return a},getNodeById:function(a){return this.nodeHash[a]},registerNode:function(a){this.nodeHash[a.id]=a},unregisterNode:function(a){delete this.nodeHash[a.id]},toString:function(){return"[Tree"+(this.id?" "+this.id:"")+"]"}});Ext.data.Node=Ext.extend(Ext.util.Observable,{constructor:function(a){this.attributes=a||{};this.leaf=this.attributes.leaf;this.id=this.attributes.id;if(!this.id){this.id=Ext.id(null,"xnode-");this.attributes.id=this.id}this.childNodes=[];this.parentNode=null;this.firstChild=null;this.lastChild=null;this.previousSibling=null;this.nextSibling=null;this.addEvents({append:true,remove:true,move:true,insert:true,beforeappend:true,beforeremove:true,beforemove:true,beforeinsert:true});this.listeners=this.attributes.listeners;Ext.data.Node.superclass.constructor.call(this)},fireEvent:function(b){if(Ext.data.Node.superclass.fireEvent.apply(this,arguments)===false){return false}var a=this.getOwnerTree();if(a){if(a.proxyNodeEvent.apply(a,arguments)===false){return false}}return true},isLeaf:function(){return this.leaf===true},setFirstChild:function(a){this.firstChild=a},setLastChild:function(a){this.lastChild=a},isLast:function(){return(!this.parentNode?true:this.parentNode.lastChild==this)},isFirst:function(){return(!this.parentNode?true:this.parentNode.firstChild==this)},hasChildNodes:function(){return !this.isLeaf()&&this.childNodes.length>0},isExpandable:function(){return this.attributes.expandable||this.hasChildNodes()},appendChild:function(e){var g=false;if(Ext.isArray(e)){g=e}else{if(arguments.length>1){g=arguments}}if(g){for(var d=0,a=g.length;d<a;d++){this.appendChild(g[d])}}else{if(this.fireEvent("beforeappend",this.ownerTree,this,e)===false){return false}var b=this.childNodes.length;var c=e.parentNode;if(c){if(e.fireEvent("beforemove",e.getOwnerTree(),e,c,this,b)===false){return false}c.removeChild(e)}b=this.childNodes.length;if(b===0){this.setFirstChild(e)}this.childNodes.push(e);e.parentNode=this;var h=this.childNodes[b-1];if(h){e.previousSibling=h;h.nextSibling=e}else{e.previousSibling=null}e.nextSibling=null;this.setLastChild(e);e.setOwnerTree(this.getOwnerTree());this.fireEvent("append",this.ownerTree,this,e,b);if(c){e.fireEvent("move",this.ownerTree,e,c,this,b)}return e}},removeChild:function(c,b){var a=this.childNodes.indexOf(c);if(a==-1){return false}if(this.fireEvent("beforeremove",this.ownerTree,this,c)===false){return false}this.childNodes.splice(a,1);if(c.previousSibling){c.previousSibling.nextSibling=c.nextSibling}if(c.nextSibling){c.nextSibling.previousSibling=c.previousSibling}if(this.firstChild==c){this.setFirstChild(c.nextSibling)}if(this.lastChild==c){this.setLastChild(c.previousSibling)}this.fireEvent("remove",this.ownerTree,this,c);if(b){c.destroy(true)}else{c.clear()}return c},clear:function(a){this.setOwnerTree(null,a);this.parentNode=this.previousSibling=this.nextSibling=null;if(a){this.firstChild=this.lastChild=null}},destroy:function(a){if(a===true){this.purgeListeners();this.clear(true);Ext.each(this.childNodes,function(b){b.destroy(true)});this.childNodes=null}else{this.remove(true)}},insertBefore:function(d,a){if(!a){return this.appendChild(d)}if(d==a){return false}if(this.fireEvent("beforeinsert",this.ownerTree,this,d,a)===false){return false}var b=this.childNodes.indexOf(a);var c=d.parentNode;var e=b;if(c==this&&this.childNodes.indexOf(d)<b){e--}if(c){if(d.fireEvent("beforemove",d.getOwnerTree(),d,c,this,b,a)===false){return false}c.removeChild(d)}if(e===0){this.setFirstChild(d)}this.childNodes.splice(e,0,d);d.parentNode=this;var g=this.childNodes[e-1];if(g){d.previousSibling=g;g.nextSibling=d}else{d.previousSibling=null}d.nextSibling=a;a.previousSibling=d;d.setOwnerTree(this.getOwnerTree());this.fireEvent("insert",this.ownerTree,this,d,a);if(c){d.fireEvent("move",this.ownerTree,d,c,this,e,a)}return d},remove:function(a){if(this.parentNode){this.parentNode.removeChild(this,a)}return this},removeAll:function(a){var c=this.childNodes,b;while((b=c[0])){this.removeChild(b,a)}return this},item:function(a){return this.childNodes[a]},replaceChild:function(a,c){var b=c?c.nextSibling:null;this.removeChild(c);this.insertBefore(a,b);return c},indexOf:function(a){return this.childNodes.indexOf(a)},getOwnerTree:function(){if(!this.ownerTree){var a=this;while(a){if(a.ownerTree){this.ownerTree=a.ownerTree;break}a=a.parentNode}}return this.ownerTree},getDepth:function(){var b=0;var a=this;while(a.parentNode){++b;a=a.parentNode}return b},setOwnerTree:function(a,b){if(a!=this.ownerTree){if(this.ownerTree){this.ownerTree.unregisterNode(this)}this.ownerTree=a;if(b!==true){Ext.each(this.childNodes,function(c){c.setOwnerTree(a)})}if(a){a.registerNode(this)}}},setId:function(b){if(b!==this.id){var a=this.ownerTree;if(a){a.unregisterNode(this)}this.id=this.attributes.id=b;if(a){a.registerNode(this)}this.onIdChange(b)}},onIdChange:Ext.emptyFn,getPath:function(c){c=c||"id";var e=this.parentNode;var a=[this.attributes[c]];while(e){a.unshift(e.attributes[c]);e=e.parentNode}var d=this.getOwnerTree().pathSeparator;return d+a.join(d)},bubble:function(c,b,a){var d=this;while(d){if(c.apply(b||d,a||[d])===false){break}d=d.parentNode}},cascade:function(g,e,b){if(g.apply(e||this,b||[this])!==false){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].cascade(g,e,b)}}},eachChild:function(g,e,b){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){if(g.apply(e||d[c],b||[d[c]])===false){break}}},findChild:function(b,c,a){return this.findChildBy(function(){return this.attributes[b]==c},null,a)},findChildBy:function(h,g,b){var e=this.childNodes,a=e.length,d=0,j,c;for(;d<a;d++){j=e[d];if(h.call(g||j,j)===true){return j}else{if(b){c=j.findChildBy(h,g,b);if(c!=null){return c}}}}return null},sort:function(e,d){var c=this.childNodes;var a=c.length;if(a>0){var g=d?function(){e.apply(d,arguments)}:e;c.sort(g);for(var b=0;b<a;b++){var h=c[b];h.previousSibling=c[b-1];h.nextSibling=c[b+1];if(b===0){this.setFirstChild(h)}if(b==a-1){this.setLastChild(h)}}}},contains:function(a){return a.isAncestor(this)},isAncestor:function(a){var b=this.parentNode;while(b){if(b==a){return true}b=b.parentNode}return false},toString:function(){return"[Node"+(this.id?" "+this.id:"")+"]"}});Ext.tree.TreeNode=Ext.extend(Ext.data.Node,{constructor:function(a){a=a||{};if(Ext.isString(a)){a={text:a}}this.childrenRendered=false;this.rendered=false;Ext.tree.TreeNode.superclass.constructor.call(this,a);this.expanded=a.expanded===true;this.isTarget=a.isTarget!==false;this.draggable=a.draggable!==false&&a.allowDrag!==false;this.allowChildren=a.allowChildren!==false&&a.allowDrop!==false;this.text=a.text;this.disabled=a.disabled===true;this.hidden=a.hidden===true;this.addEvents("textchange","beforeexpand","beforecollapse","expand","disabledchange","collapse","beforeclick","click","checkchange","beforedblclick","dblclick","contextmenu","beforechildrenrendered");var b=this.attributes.uiProvider||this.defaultUI||Ext.tree.TreeNodeUI;this.ui=new b(this)},preventHScroll:true,isExpanded:function(){return this.expanded},getUI:function(){return this.ui},getLoader:function(){var a;return this.loader||((a=this.getOwnerTree())&&a.loader?a.loader:(this.loader=new Ext.tree.TreeLoader()))},setFirstChild:function(a){var b=this.firstChild;Ext.tree.TreeNode.superclass.setFirstChild.call(this,a);if(this.childrenRendered&&b&&a!=b){b.renderIndent(true,true)}if(this.rendered){this.renderIndent(true,true)}},setLastChild:function(b){var a=this.lastChild;Ext.tree.TreeNode.superclass.setLastChild.call(this,b);if(this.childrenRendered&&a&&b!=a){a.renderIndent(true,true)}if(this.rendered){this.renderIndent(true,true)}},appendChild:function(b){if(!b.render&&!Ext.isArray(b)){b=this.getLoader().createNode(b)}var a=Ext.tree.TreeNode.superclass.appendChild.call(this,b);if(a&&this.childrenRendered){a.render()}this.ui.updateExpandIcon();return a},removeChild:function(b,a){this.ownerTree.getSelectionModel().unselect(b);Ext.tree.TreeNode.superclass.removeChild.apply(this,arguments);if(!a){var c=b.ui.rendered;if(c){b.ui.remove()}if(c&&this.childNodes.length<1){this.collapse(false,false)}else{this.ui.updateExpandIcon()}if(!this.firstChild&&!this.isHiddenRoot()){this.childrenRendered=false}}return b},insertBefore:function(c,a){if(!c.render){c=this.getLoader().createNode(c)}var b=Ext.tree.TreeNode.superclass.insertBefore.call(this,c,a);if(b&&a&&this.childrenRendered){c.render()}this.ui.updateExpandIcon();return b},setText:function(b){var a=this.text;this.text=this.attributes.text=b;if(this.rendered){this.ui.onTextChange(this,b,a)}this.fireEvent("textchange",this,b,a)},setIconCls:function(b){var a=this.attributes.iconCls;this.attributes.iconCls=b;if(this.rendered){this.ui.onIconClsChange(this,b,a)}},setTooltip:function(a,b){this.attributes.qtip=a;this.attributes.qtipTitle=b;if(this.rendered){this.ui.onTipChange(this,a,b)}},setIcon:function(a){this.attributes.icon=a;if(this.rendered){this.ui.onIconChange(this,a)}},setHref:function(a,b){this.attributes.href=a;this.attributes.hrefTarget=b;if(this.rendered){this.ui.onHrefChange(this,a,b)}},setCls:function(b){var a=this.attributes.cls;this.attributes.cls=b;if(this.rendered){this.ui.onClsChange(this,b,a)}},select:function(){var a=this.getOwnerTree();if(a){a.getSelectionModel().select(this)}},unselect:function(a){var b=this.getOwnerTree();if(b){b.getSelectionModel().unselect(this,a)}},isSelected:function(){var a=this.getOwnerTree();return a?a.getSelectionModel().isSelected(this):false},expand:function(a,c,d,b){if(!this.expanded){if(this.fireEvent("beforeexpand",this,a,c)===false){return}if(!this.childrenRendered){this.renderChildren()}this.expanded=true;if(!this.isHiddenRoot()&&(this.getOwnerTree().animate&&c!==false)||c){this.ui.animExpand(function(){this.fireEvent("expand",this);this.runCallback(d,b||this,[this]);if(a===true){this.expandChildNodes(true,true)}}.createDelegate(this));return}else{this.ui.expand();this.fireEvent("expand",this);this.runCallback(d,b||this,[this])}}else{this.runCallback(d,b||this,[this])}if(a===true){this.expandChildNodes(true)}},runCallback:function(a,c,b){if(Ext.isFunction(a)){a.apply(c,b)}},isHiddenRoot:function(){return this.isRoot&&!this.getOwnerTree().rootVisible},collapse:function(b,g,h,e){if(this.expanded&&!this.isHiddenRoot()){if(this.fireEvent("beforecollapse",this,b,g)===false){return}this.expanded=false;if((this.getOwnerTree().animate&&g!==false)||g){this.ui.animCollapse(function(){this.fireEvent("collapse",this);this.runCallback(h,e||this,[this]);if(b===true){this.collapseChildNodes(true)}}.createDelegate(this));return}else{this.ui.collapse();this.fireEvent("collapse",this);this.runCallback(h,e||this,[this])}}else{if(!this.expanded){this.runCallback(h,e||this,[this])}}if(b===true){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].collapse(true,false)}}},delayedExpand:function(a){if(!this.expandProcId){this.expandProcId=this.expand.defer(a,this)}},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId)}this.expandProcId=false},toggle:function(){if(this.expanded){this.collapse()}else{this.expand()}},ensureVisible:function(c,b){var a=this.getOwnerTree();a.expandPath(this.parentNode?this.parentNode.getPath():this.getPath(),false,function(){var d=a.getNodeById(this.id);a.getTreeEl().scrollChildIntoView(d.ui.anchor);this.runCallback(c,b||this,[this])}.createDelegate(this))},expandChildNodes:function(b,e){var d=this.childNodes,c,a=d.length;for(c=0;c<a;c++){d[c].expand(b,e)}},collapseChildNodes:function(b){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].collapse(b)}},disable:function(){this.disabled=true;this.unselect();if(this.rendered&&this.ui.onDisableChange){this.ui.onDisableChange(this,true)}this.fireEvent("disabledchange",this,true)},enable:function(){this.disabled=false;if(this.rendered&&this.ui.onDisableChange){this.ui.onDisableChange(this,false)}this.fireEvent("disabledchange",this,false)},renderChildren:function(b){if(b!==false){this.fireEvent("beforechildrenrendered",this)}var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].render(true)}this.childrenRendered=true},sort:function(e,d){Ext.tree.TreeNode.superclass.sort.apply(this,arguments);if(this.childrenRendered){var c=this.childNodes;for(var b=0,a=c.length;b<a;b++){c[b].render(true)}}},render:function(a){this.ui.render(a);if(!this.rendered){this.getOwnerTree().registerNode(this);this.rendered=true;if(this.expanded){this.expanded=false;this.expand(false,false)}}},renderIndent:function(b,e){if(e){this.ui.childIndent=null}this.ui.renderIndent();if(b===true&&this.childrenRendered){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].renderIndent(true,e)}}},beginUpdate:function(){this.childrenRendered=false},endUpdate:function(){if(this.expanded&&this.rendered){this.renderChildren()}},destroy:function(a){if(a===true){this.unselect(true)}Ext.tree.TreeNode.superclass.destroy.call(this,a);Ext.destroy(this.ui,this.loader);this.ui=this.loader=null},onIdChange:function(a){this.ui.onIdChange(a)}});Ext.tree.TreePanel.nodeTypes.node=Ext.tree.TreeNode;Ext.tree.AsyncTreeNode=function(a){this.loaded=a&&a.loaded===true;this.loading=false;Ext.tree.AsyncTreeNode.superclass.constructor.apply(this,arguments);this.addEvents("beforeload","load")};Ext.extend(Ext.tree.AsyncTreeNode,Ext.tree.TreeNode,{expand:function(b,e,h,c){if(this.loading){var g;var d=function(){if(!this.loading){clearInterval(g);this.expand(b,e,h,c)}}.createDelegate(this);g=setInterval(d,200);return}if(!this.loaded){if(this.fireEvent("beforeload",this)===false){return}this.loading=true;this.ui.beforeLoad(this);var a=this.loader||this.attributes.loader||this.getOwnerTree().getLoader();if(a){a.load(this,this.loadComplete.createDelegate(this,[b,e,h,c]),this);return}}Ext.tree.AsyncTreeNode.superclass.expand.call(this,b,e,h,c)},isLoading:function(){return this.loading},loadComplete:function(a,c,d,b){this.loading=false;this.loaded=true;this.ui.afterLoad(this);this.fireEvent("load",this);this.expand(a,c,d,b)},isLoaded:function(){return this.loaded},hasChildNodes:function(){if(!this.isLeaf()&&!this.loaded){return true}else{return Ext.tree.AsyncTreeNode.superclass.hasChildNodes.call(this)}},reload:function(b,a){this.collapse(false,false);while(this.firstChild){this.removeChild(this.firstChild).destroy()}this.childrenRendered=false;this.loaded=false;if(this.isHiddenRoot()){this.expanded=false}this.expand(false,false,b,a)}});Ext.tree.TreePanel.nodeTypes.async=Ext.tree.AsyncTreeNode;Ext.tree.TreeNodeUI=Ext.extend(Object,{constructor:function(a){Ext.apply(this,{node:a,rendered:false,animating:false,wasLeaf:true,ecc:"x-tree-ec-icon x-tree-elbow",emptyIcon:Ext.BLANK_IMAGE_URL})},removeChild:function(a){if(this.rendered){this.ctNode.removeChild(a.ui.getEl())}},beforeLoad:function(){this.addClass("x-tree-node-loading")},afterLoad:function(){this.removeClass("x-tree-node-loading")},onTextChange:function(b,c,a){if(this.rendered){this.textNode.innerHTML=c}},onIconClsChange:function(c,a,b){if(this.rendered){Ext.fly(this.iconNode).replaceClass(b,a)}},onIconChange:function(b,a){if(this.rendered){var c=Ext.isEmpty(a);this.iconNode.src=c?this.emptyIcon:a;Ext.fly(this.iconNode)[c?"removeClass":"addClass"]("x-tree-node-inline-icon")}},onTipChange:function(b,c,d){if(this.rendered){var a=Ext.isDefined(d);if(this.textNode.setAttributeNS){this.textNode.setAttributeNS("ext","qtip",c);if(a){this.textNode.setAttributeNS("ext","qtitle",d)}}else{this.textNode.setAttribute("ext:qtip",c);if(a){this.textNode.setAttribute("ext:qtitle",d)}}}},onHrefChange:function(b,a,c){if(this.rendered){this.anchor.href=this.getHref(a);if(Ext.isDefined(c)){this.anchor.target=c}}},onClsChange:function(c,a,b){if(this.rendered){Ext.fly(this.elNode).replaceClass(b,a)}},onDisableChange:function(a,b){this.disabled=b;if(this.checkbox){this.checkbox.disabled=b}this[b?"addClass":"removeClass"]("x-tree-node-disabled")},onSelectedChange:function(a){if(a){this.focus();this.addClass("x-tree-selected")}else{this.removeClass("x-tree-selected")}},onMove:function(a,h,e,g,d,b){this.childIndent=null;if(this.rendered){var i=g.ui.getContainer();if(!i){this.holder=document.createElement("div");this.holder.appendChild(this.wrap);return}var c=b?b.ui.getEl():null;if(c){i.insertBefore(this.wrap,c)}else{i.appendChild(this.wrap)}this.node.renderIndent(true,e!=g)}},addClass:function(a){if(this.elNode){Ext.fly(this.elNode).addClass(a)}},removeClass:function(a){if(this.elNode){Ext.fly(this.elNode).removeClass(a)}},remove:function(){if(this.rendered){this.holder=document.createElement("div");this.holder.appendChild(this.wrap)}},fireEvent:function(){return this.node.fireEvent.apply(this.node,arguments)},initEvents:function(){this.node.on("move",this.onMove,this);if(this.node.disabled){this.onDisableChange(this.node,true)}if(this.node.hidden){this.hide()}var b=this.node.getOwnerTree();var a=b.enableDD||b.enableDrag||b.enableDrop;if(a&&(!this.node.isRoot||b.rootVisible)){Ext.dd.Registry.register(this.elNode,{node:this.node,handles:this.getDDHandles(),isHandle:false})}},getDDHandles:function(){return[this.iconNode,this.textNode,this.elNode]},hide:function(){this.node.hidden=true;if(this.wrap){this.wrap.style.display="none"}},show:function(){this.node.hidden=false;if(this.wrap){this.wrap.style.display=""}},onContextMenu:function(a){if(this.node.hasListener("contextmenu")||this.node.getOwnerTree().hasListener("contextmenu")){a.preventDefault();this.focus();this.fireEvent("contextmenu",this.node,a)}},onClick:function(c){if(this.dropping){c.stopEvent();return}if(this.fireEvent("beforeclick",this.node,c)!==false){var b=c.getTarget("a");if(!this.disabled&&this.node.attributes.href&&b){this.fireEvent("click",this.node,c);return}else{if(b&&c.ctrlKey){c.stopEvent()}}c.preventDefault();if(this.disabled){return}if(this.node.attributes.singleClickExpand&&!this.animating&&this.node.isExpandable()){this.node.toggle()}this.fireEvent("click",this.node,c)}else{c.stopEvent()}},onDblClick:function(a){a.preventDefault();if(this.disabled){return}if(this.fireEvent("beforedblclick",this.node,a)!==false){if(this.checkbox){this.toggleCheck()}if(!this.animating&&this.node.isExpandable()){this.node.toggle()}this.fireEvent("dblclick",this.node,a)}},onOver:function(a){this.addClass("x-tree-node-over")},onOut:function(a){this.removeClass("x-tree-node-over")},onCheckChange:function(){var a=this.checkbox.checked;this.checkbox.defaultChecked=a;this.node.attributes.checked=a;this.fireEvent("checkchange",this.node,a)},ecClick:function(a){if(!this.animating&&this.node.isExpandable()){this.node.toggle()}},startDrop:function(){this.dropping=true},endDrop:function(){setTimeout(function(){this.dropping=false}.createDelegate(this),50)},expand:function(){this.updateExpandIcon();this.ctNode.style.display=""},focus:function(){if(!this.node.preventHScroll){try{this.anchor.focus()}catch(c){}}else{try{var b=this.node.getOwnerTree().getTreeEl().dom;var a=b.scrollLeft;this.anchor.focus();b.scrollLeft=a}catch(c){}}},toggleCheck:function(b){var a=this.checkbox;if(a){a.checked=(b===undefined?!a.checked:b);this.onCheckChange()}},blur:function(){try{this.anchor.blur()}catch(a){}},animExpand:function(b){var a=Ext.get(this.ctNode);a.stopFx();if(!this.node.isExpandable()){this.updateExpandIcon();this.ctNode.style.display="";Ext.callback(b);return}this.animating=true;this.updateExpandIcon();a.slideIn("t",{callback:function(){this.animating=false;Ext.callback(b)},scope:this,duration:this.node.ownerTree.duration||0.25})},highlight:function(){var a=this.node.getOwnerTree();Ext.fly(this.wrap).highlight(a.hlColor||"C3DAF9",{endColor:a.hlBaseColor})},collapse:function(){this.updateExpandIcon();this.ctNode.style.display="none"},animCollapse:function(b){var a=Ext.get(this.ctNode);a.enableDisplayMode("block");a.stopFx();this.animating=true;this.updateExpandIcon();a.slideOut("t",{callback:function(){this.animating=false;Ext.callback(b)},scope:this,duration:this.node.ownerTree.duration||0.25})},getContainer:function(){return this.ctNode},getEl:function(){return this.wrap},appendDDGhost:function(a){a.appendChild(this.elNode.cloneNode(true))},getDDRepairXY:function(){return Ext.lib.Dom.getXY(this.iconNode)},onRender:function(){this.render()},render:function(c){var e=this.node,b=e.attributes;var d=e.parentNode?e.parentNode.ui.getContainer():e.ownerTree.innerCt.dom;if(!this.rendered){this.rendered=true;this.renderElements(e,b,d,c);if(b.qtip){this.onTipChange(e,b.qtip,b.qtipTitle)}else{if(b.qtipCfg){b.qtipCfg.target=Ext.id(this.textNode);Ext.QuickTips.register(b.qtipCfg)}}this.initEvents();if(!this.node.expanded){this.updateExpandIcon(true)}}else{if(c===true){d.appendChild(this.wrap)}}},renderElements:function(e,k,j,l){this.indentMarkup=e.parentNode?e.parentNode.ui.getChildIndent():"";var g=Ext.isBoolean(k.checked),b,c=this.getHref(k.href),d=['<li class="x-tree-node"><div ext:tree-node-id="',e.id,'" class="x-tree-node-el x-tree-node-leaf x-unselectable ',k.cls,'" unselectable="on">','<span class="x-tree-node-indent">',this.indentMarkup,"</span>",'<img alt="" src="',this.emptyIcon,'" class="x-tree-ec-icon x-tree-elbow" />','<img alt="" src="',k.icon||this.emptyIcon,'" class="x-tree-node-icon',(k.icon?" x-tree-node-inline-icon":""),(k.iconCls?" "+k.iconCls:""),'" unselectable="on" />',g?('<input class="x-tree-node-cb" type="checkbox" '+(k.checked?'checked="checked" />':"/>")):"",'<a hidefocus="on" class="x-tree-node-anchor" href="',c,'" tabIndex="1" ',k.hrefTarget?' target="'+k.hrefTarget+'"':"",'><span unselectable="on">',e.text,"</span></a></div>",'<ul class="x-tree-node-ct" style="display:none;"></ul>',"</li>"].join("");if(l!==true&&e.nextSibling&&(b=e.nextSibling.ui.getEl())){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",b,d)}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",j,d)}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var i=this.elNode.childNodes;this.indentNode=i[0];this.ecNode=i[1];this.iconNode=i[2];var h=3;if(g){this.checkbox=i[3];this.checkbox.defaultChecked=this.checkbox.checked;h++}this.anchor=i[h];this.textNode=i[h].firstChild},getHref:function(a){return Ext.isEmpty(a)?(Ext.isGecko?"":"#"):a},getAnchor:function(){return this.anchor},getTextEl:function(){return this.textNode},getIconEl:function(){return this.iconNode},isChecked:function(){return this.checkbox?this.checkbox.checked:false},updateExpandIcon:function(){if(this.rendered){var g=this.node,d,c,a=g.isLast()?"x-tree-elbow-end":"x-tree-elbow",e=g.hasChildNodes();if(e||g.attributes.expandable){if(g.expanded){a+="-minus";d="x-tree-node-collapsed";c="x-tree-node-expanded"}else{a+="-plus";d="x-tree-node-expanded";c="x-tree-node-collapsed"}if(this.wasLeaf){this.removeClass("x-tree-node-leaf");this.wasLeaf=false}if(this.c1!=d||this.c2!=c){Ext.fly(this.elNode).replaceClass(d,c);this.c1=d;this.c2=c}}else{if(!this.wasLeaf){Ext.fly(this.elNode).replaceClass("x-tree-node-expanded","x-tree-node-collapsed");delete this.c1;delete this.c2;this.wasLeaf=true}}var b="x-tree-ec-icon "+a;if(this.ecc!=b){this.ecNode.className=b;this.ecc=b}}},onIdChange:function(a){if(this.rendered){this.elNode.setAttribute("ext:tree-node-id",a)}},getChildIndent:function(){if(!this.childIndent){var a=[],b=this.node;while(b){if(!b.isRoot||(b.isRoot&&b.ownerTree.rootVisible)){if(!b.isLast()){a.unshift('<img alt="" src="'+this.emptyIcon+'" class="x-tree-elbow-line" />')}else{a.unshift('<img alt="" src="'+this.emptyIcon+'" class="x-tree-icon" />')}}b=b.parentNode}this.childIndent=a.join("")}return this.childIndent},renderIndent:function(){if(this.rendered){var a="",b=this.node.parentNode;if(b){a=b.ui.getChildIndent()}if(this.indentMarkup!=a){this.indentNode.innerHTML=a;this.indentMarkup=a}this.updateExpandIcon()}},destroy:function(){if(this.elNode){Ext.dd.Registry.unregister(this.elNode.id)}Ext.each(["textnode","anchor","checkbox","indentNode","ecNode","iconNode","elNode","ctNode","wrap","holder"],function(a){if(this[a]){Ext.fly(this[a]).remove();delete this[a]}},this);delete this.node}});Ext.tree.RootTreeNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{render:function(){if(!this.rendered){var a=this.node.ownerTree.innerCt.dom;this.node.expanded=true;a.innerHTML='<div class="x-tree-root-node"></div>';this.wrap=this.ctNode=a.firstChild}},collapse:Ext.emptyFn,expand:Ext.emptyFn});Ext.tree.TreeLoader=function(a){this.baseParams={};Ext.apply(this,a);this.addEvents("beforeload","load","loadexception");Ext.tree.TreeLoader.superclass.constructor.call(this);if(Ext.isString(this.paramOrder)){this.paramOrder=this.paramOrder.split(/[\s,|]/)}};Ext.extend(Ext.tree.TreeLoader,Ext.util.Observable,{uiProviders:{},clearOnLoad:true,paramOrder:undefined,paramsAsHash:false,nodeParameter:"node",directFn:undefined,load:function(b,c,a){if(this.clearOnLoad){while(b.firstChild){b.removeChild(b.firstChild)}}if(this.doPreload(b)){this.runCallback(c,a||b,[b])}else{if(this.directFn||this.dataUrl||this.url){this.requestData(b,c,a||b)}}},doPreload:function(d){if(d.attributes.children){if(d.childNodes.length<1){var c=d.attributes.children;d.beginUpdate();for(var b=0,a=c.length;b<a;b++){var e=d.appendChild(this.createNode(c[b]));if(this.preloadChildren){this.doPreload(e)}}d.endUpdate()}return true}return false},getParams:function(g){var e=Ext.apply({},this.baseParams),h=this.nodeParameter,b=this.paramOrder;h&&(e[h]=g.id);if(this.directFn){var c=[g.id];if(b){if(h&&b.indexOf(h)>-1){c=[]}for(var d=0,a=b.length;d<a;d++){c.push(e[b[d]])}}else{if(this.paramsAsHash){c=[e]}}return c}else{return e}},requestData:function(c,d,b){if(this.fireEvent("beforeload",this,c,d)!==false){if(this.directFn){var a=this.getParams(c);a.push(this.processDirectResponse.createDelegate(this,[{callback:d,node:c,scope:b}],true));this.directFn.apply(window,a)}else{this.transId=Ext.Ajax.request({method:this.requestMethod,url:this.dataUrl||this.url,success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{callback:d,node:c,scope:b},params:this.getParams(c)})}}else{this.runCallback(d,b||c,[])}},processDirectResponse:function(a,b,c){if(b.status){this.handleResponse({responseData:Ext.isArray(a)?a:null,responseText:a,argument:c})}else{this.handleFailure({argument:c})}},runCallback:function(a,c,b){if(Ext.isFunction(a)){a.apply(c,b)}},isLoading:function(){return !!this.transId},abort:function(){if(this.isLoading()){Ext.Ajax.abort(this.transId)}},createNode:function(attr){if(this.baseAttrs){Ext.applyIf(attr,this.baseAttrs)}if(this.applyLoader!==false&&!attr.loader){attr.loader=this}if(Ext.isString(attr.uiProvider)){attr.uiProvider=this.uiProviders[attr.uiProvider]||eval(attr.uiProvider)}if(attr.nodeType){return new Ext.tree.TreePanel.nodeTypes[attr.nodeType](attr)}else{return attr.leaf?new Ext.tree.TreeNode(attr):new Ext.tree.AsyncTreeNode(attr)}},processResponse:function(d,c,k,l){var m=d.responseText;try{var a=d.responseData||Ext.decode(m);c.beginUpdate();for(var g=0,h=a.length;g<h;g++){var b=this.createNode(a[g]);if(b){c.appendChild(b)}}c.endUpdate();this.runCallback(k,l||c,[c])}catch(j){this.handleFailure(d)}},handleResponse:function(c){this.transId=false;var b=c.argument;this.processResponse(c,b.node,b.callback,b.scope);this.fireEvent("load",this,b.node,c)},handleFailure:function(c){this.transId=false;var b=c.argument;this.fireEvent("loadexception",this,b.node,c);this.runCallback(b.callback,b.scope||b.node,[b.node])},destroy:function(){this.abort();this.purgeListeners()}});Ext.tree.TreeFilter=function(a,b){this.tree=a;this.filtered={};Ext.apply(this,b)};Ext.tree.TreeFilter.prototype={clearBlank:false,reverse:false,autoClear:false,remove:false,filter:function(d,a,b){a=a||"text";var c;if(typeof d=="string"){var e=d.length;if(e==0&&this.clearBlank){this.clear();return}d=d.toLowerCase();c=function(g){return g.attributes[a].substr(0,e).toLowerCase()==d}}else{if(d.exec){c=function(g){return d.test(g.attributes[a])}}else{throw"Illegal filter type, must be string or regex"}}this.filterBy(c,null,b)},filterBy:function(d,c,b){b=b||this.tree.root;if(this.autoClear){this.clear()}var a=this.filtered,i=this.reverse;var e=function(k){if(k==b){return true}if(a[k.id]){return false}var j=d.call(c||k,k);if(!j||i){a[k.id]=k;k.ui.hide();return false}return true};b.cascade(e);if(this.remove){for(var h in a){if(typeof h!="function"){var g=a[h];if(g&&g.parentNode){g.parentNode.removeChild(g)}}}}},clear:function(){var b=this.tree;var a=this.filtered;for(var d in a){if(typeof d!="function"){var c=a[d];if(c){c.ui.show()}}}this.filtered={}}};Ext.tree.TreeSorter=Ext.extend(Object,{constructor:function(a,c){Ext.apply(this,c);a.on({scope:this,beforechildrenrendered:this.doSort,append:this.updateSort,insert:this.updateSort,textchange:this.updateSortParent});var e=this.dir&&this.dir.toLowerCase()=="desc",i=this.property||"text",d=this.sortType,h=this.folderSort,b=this.caseSensitive===true,g=this.leafAttr||"leaf";if(Ext.isString(d)){d=Ext.data.SortTypes[d]}this.sortFn=function(o,m){var k=o.attributes,j=m.attributes;if(h){if(k[g]&&!j[g]){return 1}if(!k[g]&&j[g]){return -1}}var n=k[i],l=j[i],q=d?d(n):(b?n:n.toUpperCase()),p=d?d(l):(b?l:l.toUpperCase());if(q<p){return e?1:-1}else{if(q>p){return e?-1:1}}return 0}},doSort:function(a){a.sort(this.sortFn)},updateSort:function(a,b){if(b.childrenRendered){this.doSort.defer(1,this,[b])}},updateSortParent:function(a){var b=a.parentNode;if(b&&b.childrenRendered){this.doSort.defer(1,this,[b])}}});if(Ext.dd.DropZone){Ext.tree.TreeDropZone=function(a,b){this.allowParentInsert=b.allowParentInsert||false;this.allowContainerDrop=b.allowContainerDrop||false;this.appendOnly=b.appendOnly||false;Ext.tree.TreeDropZone.superclass.constructor.call(this,a.getTreeEl(),b);this.tree=a;this.dragOverData={};this.lastInsertClass="x-tree-no-status"};Ext.extend(Ext.tree.TreeDropZone,Ext.dd.DropZone,{ddGroup:"TreeDD",expandDelay:1000,expandNode:function(a){if(a.hasChildNodes()&&!a.isExpanded()){a.expand(false,null,this.triggerCacheRefresh.createDelegate(this))}},queueExpand:function(a){this.expandProcId=this.expandNode.defer(this.expandDelay,this,[a])},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId);this.expandProcId=false}},isValidDropPoint:function(a,k,i,d,c){if(!a||!c){return false}var g=a.node;var h=c.node;if(!(g&&g.isTarget&&k)){return false}if(k=="append"&&g.allowChildren===false){return false}if((k=="above"||k=="below")&&(g.parentNode&&g.parentNode.allowChildren===false)){return false}if(h&&(g==h||h.contains(g))){return false}var b=this.dragOverData;b.tree=this.tree;b.target=g;b.data=c;b.point=k;b.source=i;b.rawEvent=d;b.dropNode=h;b.cancel=false;var j=this.tree.fireEvent("nodedragover",b);return b.cancel===false&&j!==false},getDropPoint:function(h,g,l){var m=g.node;if(m.isRoot){return m.allowChildren!==false?"append":false}var c=g.ddel;var o=Ext.lib.Dom.getY(c),j=o+c.offsetHeight;var i=Ext.lib.Event.getPageY(h);var k=m.allowChildren===false||m.isLeaf();if(this.appendOnly||m.parentNode.allowChildren===false){return k?false:"append"}var d=false;if(!this.allowParentInsert){d=m.hasChildNodes()&&m.isExpanded()}var a=(j-o)/(k?2:3);if(i>=o&&i<(o+a)){return"above"}else{if(!d&&(k||i>=j-a&&i<=j)){return"below"}else{return"append"}}},onNodeEnter:function(d,a,c,b){this.cancelExpand()},onContainerOver:function(a,c,b){if(this.allowContainerDrop&&this.isValidDropPoint({ddel:this.tree.getRootNode().ui.elNode,node:this.tree.getRootNode()},"append",a,c,b)){return this.dropAllowed}return this.dropNotAllowed},onNodeOver:function(b,i,h,g){var k=this.getDropPoint(h,b,i);var c=b.node;if(!this.expandProcId&&k=="append"&&c.hasChildNodes()&&!b.node.isExpanded()){this.queueExpand(c)}else{if(k!="append"){this.cancelExpand()}}var d=this.dropNotAllowed;if(this.isValidDropPoint(b,k,i,h,g)){if(k){var a=b.ddel;var j;if(k=="above"){d=b.node.isFirst()?"x-tree-drop-ok-above":"x-tree-drop-ok-between";j="x-tree-drag-insert-above"}else{if(k=="below"){d=b.node.isLast()?"x-tree-drop-ok-below":"x-tree-drop-ok-between";j="x-tree-drag-insert-below"}else{d="x-tree-drop-ok-append";j="x-tree-drag-append"}}if(this.lastInsertClass!=j){Ext.fly(a).replaceClass(this.lastInsertClass,j);this.lastInsertClass=j}}}return d},onNodeOut:function(d,a,c,b){this.cancelExpand();this.removeDropIndicators(d)},onNodeDrop:function(i,b,h,d){var a=this.getDropPoint(h,i,b);var g=i.node;g.ui.startDrop();if(!this.isValidDropPoint(i,a,b,h,d)){g.ui.endDrop();return false}var c=d.node||(b.getTreeNode?b.getTreeNode(d,g,a,h):null);return this.processDrop(g,d,a,b,h,c)},onContainerDrop:function(a,g,c){if(this.allowContainerDrop&&this.isValidDropPoint({ddel:this.tree.getRootNode().ui.elNode,node:this.tree.getRootNode()},"append",a,g,c)){var d=this.tree.getRootNode();d.ui.startDrop();var b=c.node||(a.getTreeNode?a.getTreeNode(c,d,"append",g):null);return this.processDrop(d,c,"append",a,g,b)}return false},processDrop:function(j,h,b,a,i,d){var g={tree:this.tree,target:j,data:h,point:b,source:a,rawEvent:i,dropNode:d,cancel:!d,dropStatus:false};var c=this.tree.fireEvent("beforenodedrop",g);if(c===false||g.cancel===true||!g.dropNode){j.ui.endDrop();return g.dropStatus}j=g.target;if(b=="append"&&!j.isExpanded()){j.expand(false,null,function(){this.completeDrop(g)}.createDelegate(this))}else{this.completeDrop(g)}return true},completeDrop:function(h){var d=h.dropNode,e=h.point,c=h.target;if(!Ext.isArray(d)){d=[d]}var g;for(var b=0,a=d.length;b<a;b++){g=d[b];if(e=="above"){c.parentNode.insertBefore(g,c)}else{if(e=="below"){c.parentNode.insertBefore(g,c.nextSibling)}else{c.appendChild(g)}}}g.ui.focus();if(Ext.enableFx&&this.tree.hlDrop){g.ui.highlight()}c.ui.endDrop();this.tree.fireEvent("nodedrop",h)},afterNodeMoved:function(a,c,g,d,b){if(Ext.enableFx&&this.tree.hlDrop){b.ui.focus();b.ui.highlight()}this.tree.fireEvent("nodedrop",this.tree,d,c,a,g)},getTree:function(){return this.tree},removeDropIndicators:function(b){if(b&&b.ddel){var a=b.ddel;Ext.fly(a).removeClass(["x-tree-drag-insert-above","x-tree-drag-insert-below","x-tree-drag-append"]);this.lastInsertClass="_noclass"}},beforeDragDrop:function(b,a,c){this.cancelExpand();return true},afterRepair:function(a){if(a&&Ext.enableFx){a.node.ui.highlight()}this.hideProxy()}})}if(Ext.dd.DragZone){Ext.tree.TreeDragZone=function(a,b){Ext.tree.TreeDragZone.superclass.constructor.call(this,a.innerCt,b);this.tree=a};Ext.extend(Ext.tree.TreeDragZone,Ext.dd.DragZone,{ddGroup:"TreeDD",onBeforeDrag:function(a,b){var c=a.node;return c&&c.draggable&&!c.disabled},onInitDrag:function(b){var a=this.dragData;this.tree.getSelectionModel().select(a.node);this.tree.eventModel.disable();this.proxy.update("");a.node.ui.appendDDGhost(this.proxy.ghost.dom);this.tree.fireEvent("startdrag",this.tree,a.node,b)},getRepairXY:function(b,a){return a.node.ui.getDDRepairXY()},onEndDrag:function(a,b){this.tree.eventModel.enable.defer(100,this.tree.eventModel);this.tree.fireEvent("enddrag",this.tree,a.node,b)},onValidDrop:function(a,b,c){this.tree.fireEvent("dragdrop",this.tree,this.dragData.node,a,b);this.hideProxy()},beforeInvalidDrop:function(a,c){var b=this.tree.getSelectionModel();b.clearSelections();b.select(this.dragData.node)},afterRepair:function(){if(Ext.enableFx&&this.tree.hlDrop){Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9")}this.dragging=false}})}Ext.tree.TreeEditor=function(a,c,b){c=c||{};var d=c.events?c:new Ext.form.TextField(c);Ext.tree.TreeEditor.superclass.constructor.call(this,d,b);this.tree=a;if(!a.rendered){a.on("render",this.initEditor,this)}else{this.initEditor(a)}};Ext.extend(Ext.tree.TreeEditor,Ext.Editor,{alignment:"l-l",autoSize:false,hideEl:false,cls:"x-small-editor x-tree-editor",shim:false,shadow:"frame",maxWidth:250,editDelay:350,initEditor:function(a){a.on({scope:this,beforeclick:this.beforeNodeClick,dblclick:this.onNodeDblClick});this.on({scope:this,complete:this.updateNode,beforestartedit:this.fitToTree,specialkey:this.onSpecialKey});this.on("startedit",this.bindScroll,this,{delay:10})},fitToTree:function(b,c){var e=this.tree.getTreeEl().dom,d=c.dom;if(e.scrollLeft>d.offsetLeft){e.scrollLeft=d.offsetLeft}var a=Math.min(this.maxWidth,(e.clientWidth>20?e.clientWidth:e.offsetWidth)-Math.max(0,d.offsetLeft-e.scrollLeft)-5);this.setSize(a,"")},triggerEdit:function(a,c){this.completeEdit();if(a.attributes.editable!==false){this.editNode=a;if(this.tree.autoScroll){Ext.fly(a.ui.getEl()).scrollIntoView(this.tree.body)}var b=a.text||"";if(!Ext.isGecko&&Ext.isEmpty(a.text)){a.setText("&#160;")}this.autoEditTimer=this.startEdit.defer(this.editDelay,this,[a.ui.textNode,b]);return false}},bindScroll:function(){this.tree.getTreeEl().on("scroll",this.cancelEdit,this)},beforeNodeClick:function(a,b){clearTimeout(this.autoEditTimer);if(this.tree.getSelectionModel().isSelected(a)){b.stopEvent();return this.triggerEdit(a)}},onNodeDblClick:function(a,b){clearTimeout(this.autoEditTimer)},updateNode:function(a,b){this.tree.getTreeEl().un("scroll",this.cancelEdit,this);this.editNode.setText(b)},onHide:function(){Ext.tree.TreeEditor.superclass.onHide.call(this);if(this.editNode){this.editNode.ui.focus.defer(50,this.editNode.ui)}},onSpecialKey:function(c,b){var a=b.getKey();if(a==b.ESC){b.stopEvent();this.cancelEdit()}else{if(a==b.ENTER&&!b.hasModifier()){b.stopEvent();this.completeEdit()}}},onDestroy:function(){clearTimeout(this.autoEditTimer);Ext.tree.TreeEditor.superclass.onDestroy.call(this);var a=this.tree;a.un("beforeclick",this.beforeNodeClick,this);a.un("dblclick",this.onNodeDblClick,this)}});
+/* SWFObject v2.2 <http://code.google.com/p/swfobject/>
+ is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
+*/
+var swfobject=function(){var E="undefined",s="object",T="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",r="application/x-shockwave-flash",S="SWFObjectExprInst",y="onreadystatechange",P=window,k=document,u=navigator,U=false,V=[i],p=[],O=[],J=[],m,R,F,C,K=false,a=false,o,H,n=true,N=function(){var ab=typeof k.getElementById!=E&&typeof k.getElementsByTagName!=E&&typeof k.createElement!=E,ai=u.userAgent.toLowerCase(),Z=u.platform.toLowerCase(),af=Z?(/win/).test(Z):/win/.test(ai),ad=Z?(/mac/).test(Z):/mac/.test(ai),ag=/webkit/.test(ai)?parseFloat(ai.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,Y=!+"\v1",ah=[0,0,0],ac=null;if(typeof u.plugins!=E&&typeof u.plugins[T]==s){ac=u.plugins[T].description;if(ac&&!(typeof u.mimeTypes!=E&&u.mimeTypes[r]&&!u.mimeTypes[r].enabledPlugin)){U=true;Y=false;ac=ac.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ah[0]=parseInt(ac.replace(/^(.*)\..*$/,"$1"),10);ah[1]=parseInt(ac.replace(/^.*\.(.*)\s.*$/,"$1"),10);ah[2]=/[a-zA-Z]/.test(ac)?parseInt(ac.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof P.ActiveXObject!=E){try{var ae=new ActiveXObject(X);if(ae){ac=ae.GetVariable("$version");if(ac){Y=true;ac=ac.split(" ")[1].split(",");ah=[parseInt(ac[0],10),parseInt(ac[1],10),parseInt(ac[2],10)]}}}catch(aa){}}}return{w3:ab,pv:ah,wk:ag,ie:Y,win:af,mac:ad}}(),l=function(){if(!N.w3){return}if((typeof k.readyState!=E&&k.readyState=="complete")||(typeof k.readyState==E&&(k.getElementsByTagName("body")[0]||k.body))){g()}if(!K){if(typeof k.addEventListener!=E){k.addEventListener("DOMContentLoaded",g,false)}if(N.ie&&N.win){k.attachEvent(y,function(){if(k.readyState=="complete"){k.detachEvent(y,arguments.callee);g()}});if(P==top){(function(){if(K){return}try{k.documentElement.doScroll("left")}catch(Y){setTimeout(arguments.callee,0);return}g()})()}}if(N.wk){(function(){if(K){return}if(!(/loaded|complete/).test(k.readyState)){setTimeout(arguments.callee,0);return}g()})()}t(g)}}();function g(){if(K){return}try{var aa=k.getElementsByTagName("body")[0].appendChild(D("span"));aa.parentNode.removeChild(aa)}catch(ab){return}K=true;var Y=V.length;for(var Z=0;Z<Y;Z++){V[Z]()}}function L(Y){if(K){Y()}else{V[V.length]=Y}}function t(Z){if(typeof P.addEventListener!=E){P.addEventListener("load",Z,false)}else{if(typeof k.addEventListener!=E){k.addEventListener("load",Z,false)}else{if(typeof P.attachEvent!=E){j(P,"onload",Z)}else{if(typeof P.onload=="function"){var Y=P.onload;P.onload=function(){Y();Z()}}else{P.onload=Z}}}}}function i(){if(U){W()}else{I()}}function W(){var Y=k.getElementsByTagName("body")[0];var ab=D(s);ab.setAttribute("type",r);var aa=Y.appendChild(ab);if(aa){var Z=0;(function(){if(typeof aa.GetVariable!=E){var ac=aa.GetVariable("$version");if(ac){ac=ac.split(" ")[1].split(",");N.pv=[parseInt(ac[0],10),parseInt(ac[1],10),parseInt(ac[2],10)]}}else{if(Z<10){Z++;setTimeout(arguments.callee,10);return}}Y.removeChild(ab);aa=null;I()})()}else{I()}}function I(){var ah=p.length;if(ah>0){for(var ag=0;ag<ah;ag++){var Z=p[ag].id;var ac=p[ag].callbackFn;var ab={success:false,id:Z};if(N.pv[0]>0){var af=c(Z);if(af){if(G(p[ag].swfVersion)&&!(N.wk&&N.wk<312)){x(Z,true);if(ac){ab.success=true;ab.ref=A(Z);ac(ab)}}else{if(p[ag].expressInstall&&B()){var aj={};aj.data=p[ag].expressInstall;aj.width=af.getAttribute("width")||"0";aj.height=af.getAttribute("height")||"0";if(af.getAttribute("class")){aj.styleclass=af.getAttribute("class")}if(af.getAttribute("align")){aj.align=af.getAttribute("align")}var ai={};var Y=af.getElementsByTagName("param");var ad=Y.length;for(var ae=0;ae<ad;ae++){if(Y[ae].getAttribute("name").toLowerCase()!="movie"){ai[Y[ae].getAttribute("name")]=Y[ae].getAttribute("value")}}Q(aj,ai,Z,ac)}else{q(af);if(ac){ac(ab)}}}}}else{x(Z,true);if(ac){var aa=A(Z);if(aa&&typeof aa.SetVariable!=E){ab.success=true;ab.ref=aa}ac(ab)}}}}}function A(ab){var Y=null;var Z=c(ab);if(Z&&Z.nodeName=="OBJECT"){if(typeof Z.SetVariable!=E){Y=Z}else{var aa=Z.getElementsByTagName(s)[0];if(aa){Y=aa}}}return Y}function B(){return !a&&G("6.0.65")&&(N.win||N.mac)&&!(N.wk&&N.wk<312)}function Q(ab,ac,Y,aa){a=true;F=aa||null;C={success:false,id:Y};var af=c(Y);if(af){if(af.nodeName=="OBJECT"){m=h(af);R=null}else{m=af;R=Y}ab.id=S;if(typeof ab.width==E||(!(/%$/).test(ab.width)&&parseInt(ab.width,10)<310)){ab.width="310"}if(typeof ab.height==E||(!(/%$/).test(ab.height)&&parseInt(ab.height,10)<137)){ab.height="137"}k.title=k.title.slice(0,47)+" - Flash Player Installation";var ae=N.ie&&N.win?"ActiveX":"PlugIn",ad="MMredirectURL="+P.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ae+"&MMdoctitle="+k.title;if(typeof ac.flashvars!=E){ac.flashvars+="&"+ad}else{ac.flashvars=ad}if(N.ie&&N.win&&af.readyState!=4){var Z=D("div");Y+="SWFObjectNew";Z.setAttribute("id",Y);af.parentNode.insertBefore(Z,af);af.style.display="none";(function(){if(af.readyState==4){af.parentNode.removeChild(af)}else{setTimeout(arguments.callee,10)}})()}v(ab,ac,Y)}}function q(Z){if(N.ie&&N.win&&Z.readyState!=4){var Y=D("div");Z.parentNode.insertBefore(Y,Z);Y.parentNode.replaceChild(h(Z),Y);Z.style.display="none";(function(){if(Z.readyState==4){Z.parentNode.removeChild(Z)}else{setTimeout(arguments.callee,10)}})()}else{Z.parentNode.replaceChild(h(Z),Z)}}function h(ad){var ab=D("div");if(N.win&&N.ie){ab.innerHTML=ad.innerHTML}else{var Z=ad.getElementsByTagName(s)[0];if(Z){var ae=Z.childNodes;if(ae){var Y=ae.length;for(var aa=0;aa<Y;aa++){if(!(ae[aa].nodeType==1&&ae[aa].nodeName=="PARAM")&&!(ae[aa].nodeType==8)){ab.appendChild(ae[aa].cloneNode(true))}}}}}return ab}function v(aj,ah,Z){var Y,ab=c(Z);if(N.wk&&N.wk<312){return Y}if(ab){if(typeof aj.id==E){aj.id=Z}if(N.ie&&N.win){var ai="";for(var af in aj){if(aj[af]!=Object.prototype[af]){if(af.toLowerCase()=="data"){ah.movie=aj[af]}else{if(af.toLowerCase()=="styleclass"){ai+=' class="'+aj[af]+'"'}else{if(af.toLowerCase()!="classid"){ai+=" "+af+'="'+aj[af]+'"'}}}}}var ag="";for(var ae in ah){if(ah[ae]!=Object.prototype[ae]){ag+='<param name="'+ae+'" value="'+ah[ae]+'" />'}}ab.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ai+">"+ag+"</object>";O[O.length]=aj.id;Y=c(aj.id)}else{var aa=D(s);aa.setAttribute("type",r);for(var ad in aj){if(aj[ad]!=Object.prototype[ad]){if(ad.toLowerCase()=="styleclass"){aa.setAttribute("class",aj[ad])}else{if(ad.toLowerCase()!="classid"){aa.setAttribute(ad,aj[ad])}}}}for(var ac in ah){if(ah[ac]!=Object.prototype[ac]&&ac.toLowerCase()!="movie"){e(aa,ac,ah[ac])}}ab.parentNode.replaceChild(aa,ab);Y=aa}}return Y}function e(aa,Y,Z){var ab=D("param");ab.setAttribute("name",Y);ab.setAttribute("value",Z);aa.appendChild(ab)}function z(Z){var Y=c(Z);if(Y&&Y.nodeName=="OBJECT"){if(N.ie&&N.win){Y.style.display="none";(function(){if(Y.readyState==4){b(Z)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.removeChild(Y)}}}function b(aa){var Z=c(aa);if(Z){for(var Y in Z){if(typeof Z[Y]=="function"){Z[Y]=null}}Z.parentNode.removeChild(Z)}}function c(aa){var Y=null;try{Y=k.getElementById(aa)}catch(Z){}return Y}function D(Y){return k.createElement(Y)}function j(aa,Y,Z){aa.attachEvent(Y,Z);J[J.length]=[aa,Y,Z]}function G(aa){var Z=N.pv,Y=aa.split(".");Y[0]=parseInt(Y[0],10);Y[1]=parseInt(Y[1],10)||0;Y[2]=parseInt(Y[2],10)||0;return(Z[0]>Y[0]||(Z[0]==Y[0]&&Z[1]>Y[1])||(Z[0]==Y[0]&&Z[1]==Y[1]&&Z[2]>=Y[2]))?true:false}function w(ad,Z,ae,ac){if(N.ie&&N.mac){return}var ab=k.getElementsByTagName("head")[0];if(!ab){return}var Y=(ae&&typeof ae=="string")?ae:"screen";if(ac){o=null;H=null}if(!o||H!=Y){var aa=D("style");aa.setAttribute("type","text/css");aa.setAttribute("media",Y);o=ab.appendChild(aa);if(N.ie&&N.win&&typeof k.styleSheets!=E&&k.styleSheets.length>0){o=k.styleSheets[k.styleSheets.length-1]}H=Y}if(N.ie&&N.win){if(o&&typeof o.addRule==s){o.addRule(ad,Z)}}else{if(o&&typeof k.createTextNode!=E){o.appendChild(k.createTextNode(ad+" {"+Z+"}"))}}}function x(aa,Y){if(!n){return}var Z=Y?"visible":"hidden";if(K&&c(aa)){c(aa).style.visibility=Z}else{w("#"+aa,"visibility:"+Z)}}function M(Z){var aa=/[\\\"<>\.;]/;var Y=aa.exec(Z)!=null;return Y&&typeof encodeURIComponent!=E?encodeURIComponent(Z):Z}var d=function(){if(N.ie&&N.win){window.attachEvent("onunload",function(){var ad=J.length;for(var ac=0;ac<ad;ac++){J[ac][0].detachEvent(J[ac][1],J[ac][2])}var aa=O.length;for(var ab=0;ab<aa;ab++){z(O[ab])}for(var Z in N){N[Z]=null}N=null;for(var Y in swfobject){swfobject[Y]=null}swfobject=null;window.detachEvent("onunload",arguments.callee)})}}();return{registerObject:function(ac,Y,ab,aa){if(N.w3&&ac&&Y){var Z={};Z.id=ac;Z.swfVersion=Y;Z.expressInstall=ab;Z.callbackFn=aa;p[p.length]=Z;x(ac,false)}else{if(aa){aa({success:false,id:ac})}}},getObjectById:function(Y){if(N.w3){return A(Y)}},embedSWF:function(ac,ai,af,ah,Z,ab,aa,ae,ag,ad){var Y={success:false,id:ai};if(N.w3&&!(N.wk&&N.wk<312)&&ac&&ai&&af&&ah&&Z){x(ai,false);L(function(){af+="";ah+="";var ak={};if(ag&&typeof ag===s){for(var am in ag){ak[am]=ag[am]}}ak.data=ac;ak.width=af;ak.height=ah;var an={};if(ae&&typeof ae===s){for(var al in ae){an[al]=ae[al]}}if(aa&&typeof aa===s){for(var aj in aa){if(typeof an.flashvars!=E){an.flashvars+="&"+aj+"="+aa[aj]}else{an.flashvars=aj+"="+aa[aj]}}}if(G(Z)){var ao=v(ak,an,ai);if(ak.id==ai){x(ai,true)}Y.success=true;Y.ref=ao}else{if(ab&&B()){ak.data=ab;Q(ak,an,ai,ad);return}else{x(ai,true)}}if(ad){ad(Y)}})}else{if(ad){ad(Y)}}},switchOffAutoHideShow:function(){n=false},ua:N,getFlashPlayerVersion:function(){return{major:N.pv[0],minor:N.pv[1],release:N.pv[2]}},hasFlashPlayerVersion:G,createSWF:function(aa,Z,Y){if(N.w3){return v(aa,Z,Y)}else{return undefined}},showExpressInstall:function(aa,ab,Y,Z){if(N.w3&&B()){Q(aa,ab,Y,Z)}},removeSWF:function(Y){if(N.w3){z(Y)}},createCSS:function(ab,aa,Z,Y){if(N.w3){w(ab,aa,Z,Y)}},addDomLoadEvent:L,addLoadEvent:t,getQueryParamValue:function(ab){var aa=k.location.search||k.location.hash;if(aa){if(/\?/.test(aa)){aa=aa.split("?")[1]}if(ab==null){return M(aa)}var Z=aa.split("&");for(var Y=0;Y<Z.length;Y++){if(Z[Y].substring(0,Z[Y].indexOf("="))==ab){return M(Z[Y].substring((Z[Y].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var Y=c(S);if(Y&&m){Y.parentNode.replaceChild(m,Y);if(R){x(R,true);if(N.ie&&N.win){m.style.display="block"}}if(F){F(C)}}a=false}}}}();Ext.FlashComponent=Ext.extend(Ext.BoxComponent,{flashVersion:"9.0.115",backgroundColor:"#ffffff",wmode:"opaque",flashVars:undefined,flashParams:undefined,url:undefined,swfId:undefined,swfWidth:"100%",swfHeight:"100%",expressInstall:false,initComponent:function(){Ext.FlashComponent.superclass.initComponent.call(this);this.addEvents("initialize")},onRender:function(){Ext.FlashComponent.superclass.onRender.apply(this,arguments);var b=Ext.apply({allowScriptAccess:"always",bgcolor:this.backgroundColor,wmode:this.wmode},this.flashParams),a=Ext.apply({allowedDomain:document.location.hostname,YUISwfId:this.getId(),YUIBridgeCallback:"Ext.FlashEventProxy.onEvent"},this.flashVars);new swfobject.embedSWF(this.url,this.id,this.swfWidth,this.swfHeight,this.flashVersion,this.expressInstall?Ext.FlashComponent.EXPRESS_INSTALL_URL:undefined,a,b);this.swf=Ext.getDom(this.id);this.el=Ext.get(this.swf)},getSwfId:function(){return this.swfId||(this.swfId="extswf"+(++Ext.Component.AUTO_ID))},getId:function(){return this.id||(this.id="extflashcmp"+(++Ext.Component.AUTO_ID))},onFlashEvent:function(a){switch(a.type){case"swfReady":this.initSwf();return;case"log":return}a.component=this;this.fireEvent(a.type.toLowerCase().replace(/event$/,""),a)},initSwf:function(){this.onSwfReady(!!this.isInitialized);this.isInitialized=true;this.fireEvent("initialize",this)},beforeDestroy:function(){if(this.rendered){swfobject.removeSWF(this.swf.id)}Ext.FlashComponent.superclass.beforeDestroy.call(this)},onSwfReady:Ext.emptyFn});Ext.FlashComponent.EXPRESS_INSTALL_URL="http://swfobject.googlecode.com/svn/trunk/swfobject/expressInstall.swf";Ext.reg("flash",Ext.FlashComponent);Ext.FlashEventProxy={onEvent:function(c,b){var a=Ext.getCmp(c);if(a){a.onFlashEvent(b)}else{arguments.callee.defer(10,this,[c,b])}}};Ext.chart.Chart=Ext.extend(Ext.FlashComponent,{refreshBuffer:100,chartStyle:{padding:10,animationEnabled:true,font:{name:"Tahoma",color:4473924,size:11},dataTip:{padding:5,border:{color:10075112,size:1},background:{color:14346230,alpha:0.9},font:{name:"Tahoma",color:1393291,size:10,bold:true}}},extraStyle:null,seriesStyles:null,disableCaching:Ext.isIE||Ext.isOpera,disableCacheParam:"_dc",initComponent:function(){Ext.chart.Chart.superclass.initComponent.call(this);if(!this.url){this.url=Ext.chart.Chart.CHART_URL}if(this.disableCaching){this.url=Ext.urlAppend(this.url,String.format("{0}={1}",this.disableCacheParam,new Date().getTime()))}this.addEvents("itemmouseover","itemmouseout","itemclick","itemdoubleclick","itemdragstart","itemdrag","itemdragend","beforerefresh","refresh");this.store=Ext.StoreMgr.lookup(this.store)},setStyle:function(a,b){this.swf.setStyle(a,Ext.encode(b))},setStyles:function(a){this.swf.setStyles(Ext.encode(a))},setSeriesStyles:function(b){this.seriesStyles=b;var a=[];Ext.each(b,function(c){a.push(Ext.encode(c))});this.swf.setSeriesStyles(a)},setCategoryNames:function(a){this.swf.setCategoryNames(a)},setLegendRenderer:function(c,b){var a=this;b=b||a;a.removeFnProxy(a.legendFnName);a.legendFnName=a.createFnProxy(function(d){return c.call(b,d)});a.swf.setLegendLabelFunction(a.legendFnName)},setTipRenderer:function(c,b){var a=this;b=b||a;a.removeFnProxy(a.tipFnName);a.tipFnName=a.createFnProxy(function(h,e,g){var d=a.store.getAt(e);return c.call(b,a,d,e,g)});a.swf.setDataTipFunction(a.tipFnName)},setSeries:function(a){this.series=a;this.refresh()},bindStore:function(a,b){if(!b&&this.store){if(a!==this.store&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("datachanged",this.refresh,this);this.store.un("add",this.delayRefresh,this);this.store.un("remove",this.delayRefresh,this);this.store.un("update",this.delayRefresh,this);this.store.un("clear",this.refresh,this)}}if(a){a=Ext.StoreMgr.lookup(a);a.on({scope:this,datachanged:this.refresh,add:this.delayRefresh,remove:this.delayRefresh,update:this.delayRefresh,clear:this.refresh})}this.store=a;if(a&&!b){this.refresh()}},onSwfReady:function(b){Ext.chart.Chart.superclass.onSwfReady.call(this,b);var a;this.swf.setType(this.type);if(this.chartStyle){this.setStyles(Ext.apply({},this.extraStyle,this.chartStyle))}if(this.categoryNames){this.setCategoryNames(this.categoryNames)}if(this.tipRenderer){a=this.getFunctionRef(this.tipRenderer);this.setTipRenderer(a.fn,a.scope)}if(this.legendRenderer){a=this.getFunctionRef(this.legendRenderer);this.setLegendRenderer(a.fn,a.scope)}if(!b){this.bindStore(this.store,true)}this.refresh.defer(10,this)},delayRefresh:function(){if(!this.refreshTask){this.refreshTask=new Ext.util.DelayedTask(this.refresh,this)}this.refreshTask.delay(this.refreshBuffer)},refresh:function(){if(this.fireEvent("beforerefresh",this)!==false){var m=false;var k=[],c=this.store.data.items;for(var g=0,l=c.length;g<l;g++){k[g]=c[g].data}var e=[];var d=0;var n=null;var h=0;if(this.series){d=this.series.length;for(h=0;h<d;h++){n=this.series[h];var b={};for(var a in n){if(a=="style"&&n.style!==null){b.style=Ext.encode(n.style);m=true}else{b[a]=n[a]}}e.push(b)}}if(d>0){for(h=0;h<d;h++){n=e[h];if(!n.type){n.type=this.type}n.dataProvider=k}}else{e.push({type:this.type,dataProvider:k})}this.swf.setDataProvider(e);if(this.seriesStyles){this.setSeriesStyles(this.seriesStyles)}this.fireEvent("refresh",this)}},createFnProxy:function(a){var b="extFnProxy"+(++Ext.chart.Chart.PROXY_FN_ID);Ext.chart.Chart.proxyFunction[b]=a;return"Ext.chart.Chart.proxyFunction."+b},removeFnProxy:function(a){if(!Ext.isEmpty(a)){a=a.replace("Ext.chart.Chart.proxyFunction.","");delete Ext.chart.Chart.proxyFunction[a]}},getFunctionRef:function(a){if(Ext.isFunction(a)){return{fn:a,scope:this}}else{return{fn:a.fn,scope:a.scope||this}}},onDestroy:function(){if(this.refreshTask&&this.refreshTask.cancel){this.refreshTask.cancel()}Ext.chart.Chart.superclass.onDestroy.call(this);this.bindStore(null);this.removeFnProxy(this.tipFnName);this.removeFnProxy(this.legendFnName)}});Ext.reg("chart",Ext.chart.Chart);Ext.chart.Chart.PROXY_FN_ID=0;Ext.chart.Chart.proxyFunction={};Ext.chart.Chart.CHART_URL="http://yui.yahooapis.com/2.8.2/build/charts/assets/charts.swf";Ext.chart.PieChart=Ext.extend(Ext.chart.Chart,{type:"pie",onSwfReady:function(a){Ext.chart.PieChart.superclass.onSwfReady.call(this,a);this.setDataField(this.dataField);this.setCategoryField(this.categoryField)},setDataField:function(a){this.dataField=a;this.swf.setDataField(a)},setCategoryField:function(a){this.categoryField=a;this.swf.setCategoryField(a)}});Ext.reg("piechart",Ext.chart.PieChart);Ext.chart.CartesianChart=Ext.extend(Ext.chart.Chart,{onSwfReady:function(a){Ext.chart.CartesianChart.superclass.onSwfReady.call(this,a);this.labelFn=[];if(this.xField){this.setXField(this.xField)}if(this.yField){this.setYField(this.yField)}if(this.xAxis){this.setXAxis(this.xAxis)}if(this.xAxes){this.setXAxes(this.xAxes)}if(this.yAxis){this.setYAxis(this.yAxis)}if(this.yAxes){this.setYAxes(this.yAxes)}if(Ext.isDefined(this.constrainViewport)){this.swf.setConstrainViewport(this.constrainViewport)}},setXField:function(a){this.xField=a;this.swf.setHorizontalField(a)},setYField:function(a){this.yField=a;this.swf.setVerticalField(a)},setXAxis:function(a){this.xAxis=this.createAxis("xAxis",a);this.swf.setHorizontalAxis(this.xAxis)},setXAxes:function(c){var b;for(var a=0;a<c.length;a++){b=this.createAxis("xAxis"+a,c[a]);this.swf.setHorizontalAxis(b)}},setYAxis:function(a){this.yAxis=this.createAxis("yAxis",a);this.swf.setVerticalAxis(this.yAxis)},setYAxes:function(c){var b;for(var a=0;a<c.length;a++){b=this.createAxis("yAxis"+a,c[a]);this.swf.setVerticalAxis(b)}},createAxis:function(b,d){var e=Ext.apply({},d),c,a;if(this[b]){a=this[b].labelFunction;this.removeFnProxy(a);this.labelFn.remove(a)}if(e.labelRenderer){c=this.getFunctionRef(e.labelRenderer);e.labelFunction=this.createFnProxy(function(g){return c.fn.call(c.scope,g)});delete e.labelRenderer;this.labelFn.push(e.labelFunction)}if(b.indexOf("xAxis")>-1&&e.position=="left"){e.position="bottom"}return e},onDestroy:function(){Ext.chart.CartesianChart.superclass.onDestroy.call(this);Ext.each(this.labelFn,function(a){this.removeFnProxy(a)},this)}});Ext.reg("cartesianchart",Ext.chart.CartesianChart);Ext.chart.LineChart=Ext.extend(Ext.chart.CartesianChart,{type:"line"});Ext.reg("linechart",Ext.chart.LineChart);Ext.chart.ColumnChart=Ext.extend(Ext.chart.CartesianChart,{type:"column"});Ext.reg("columnchart",Ext.chart.ColumnChart);Ext.chart.StackedColumnChart=Ext.extend(Ext.chart.CartesianChart,{type:"stackcolumn"});Ext.reg("stackedcolumnchart",Ext.chart.StackedColumnChart);Ext.chart.BarChart=Ext.extend(Ext.chart.CartesianChart,{type:"bar"});Ext.reg("barchart",Ext.chart.BarChart);Ext.chart.StackedBarChart=Ext.extend(Ext.chart.CartesianChart,{type:"stackbar"});Ext.reg("stackedbarchart",Ext.chart.StackedBarChart);Ext.chart.Axis=function(a){Ext.apply(this,a)};Ext.chart.Axis.prototype={type:null,orientation:"horizontal",reverse:false,labelFunction:null,hideOverlappingLabels:true,labelSpacing:2};Ext.chart.NumericAxis=Ext.extend(Ext.chart.Axis,{type:"numeric",minimum:NaN,maximum:NaN,majorUnit:NaN,minorUnit:NaN,snapToUnits:true,alwaysShowZero:true,scale:"linear",roundMajorUnit:true,calculateByLabelSize:true,position:"left",adjustMaximumByMajorUnit:true,adjustMinimumByMajorUnit:true});Ext.chart.TimeAxis=Ext.extend(Ext.chart.Axis,{type:"time",minimum:null,maximum:null,majorUnit:NaN,majorTimeUnit:null,minorUnit:NaN,minorTimeUnit:null,snapToUnits:true,stackingEnabled:false,calculateByLabelSize:true});Ext.chart.CategoryAxis=Ext.extend(Ext.chart.Axis,{type:"category",categoryNames:null,calculateCategoryCount:false});Ext.chart.Series=function(a){Ext.apply(this,a)};Ext.chart.Series.prototype={type:null,displayName:null};Ext.chart.CartesianSeries=Ext.extend(Ext.chart.Series,{xField:null,yField:null,showInLegend:true,axis:"primary"});Ext.chart.ColumnSeries=Ext.extend(Ext.chart.CartesianSeries,{type:"column"});Ext.chart.LineSeries=Ext.extend(Ext.chart.CartesianSeries,{type:"line"});Ext.chart.BarSeries=Ext.extend(Ext.chart.CartesianSeries,{type:"bar"});Ext.chart.PieSeries=Ext.extend(Ext.chart.Series,{type:"pie",dataField:null,categoryField:null});Ext.menu.Menu=Ext.extend(Ext.Container,{minWidth:120,shadow:"sides",subMenuAlign:"tl-tr?",defaultAlign:"tl-bl?",allowOtherMenus:false,ignoreParentClicks:false,enableScrolling:true,maxHeight:null,scrollIncrement:24,showSeparator:true,defaultOffsets:[0,0],plain:false,floating:true,zIndex:15000,hidden:true,layout:"menu",hideMode:"offsets",scrollerHeight:8,autoLayout:true,defaultType:"menuitem",bufferResize:false,initComponent:function(){if(Ext.isArray(this.initialConfig)){Ext.apply(this,{items:this.initialConfig})}this.addEvents("click","mouseover","mouseout","itemclick");Ext.menu.MenuMgr.register(this);if(this.floating){Ext.EventManager.onWindowResize(this.hide,this)}else{if(this.initialConfig.hidden!==false){this.hidden=false}this.internalDefaults={hideOnClick:false}}Ext.menu.Menu.superclass.initComponent.call(this);if(this.autoLayout){var a=this.doLayout.createDelegate(this,[]);this.on({add:a,remove:a})}},getLayoutTarget:function(){return this.ul},onRender:function(b,a){if(!b){b=Ext.getBody()}var c={id:this.getId(),cls:"x-menu "+((this.floating)?"x-menu-floating x-layer ":"")+(this.cls||"")+(this.plain?" x-menu-plain":"")+(this.showSeparator?"":" x-menu-nosep"),style:this.style,cn:[{tag:"a",cls:"x-menu-focus",href:"#",onclick:"return false;",tabIndex:"-1"},{tag:"ul",cls:"x-menu-list"}]};if(this.floating){this.el=new Ext.Layer({shadow:this.shadow,dh:c,constrain:false,parentEl:b,zindex:this.zIndex})}else{this.el=b.createChild(c)}Ext.menu.Menu.superclass.onRender.call(this,b,a);if(!this.keyNav){this.keyNav=new Ext.menu.MenuNav(this)}this.focusEl=this.el.child("a.x-menu-focus");this.ul=this.el.child("ul.x-menu-list");this.mon(this.ul,{scope:this,click:this.onClick,mouseover:this.onMouseOver,mouseout:this.onMouseOut});if(this.enableScrolling){this.mon(this.el,{scope:this,delegate:".x-menu-scroller",click:this.onScroll,mouseover:this.deactivateActive})}},findTargetItem:function(b){var a=b.getTarget(".x-menu-list-item",this.ul,true);if(a&&a.menuItemId){return this.items.get(a.menuItemId)}},onClick:function(b){var a=this.findTargetItem(b);if(a){if(a.isFormField){this.setActiveItem(a)}else{if(a instanceof Ext.menu.BaseItem){if(a.menu&&this.ignoreParentClicks){a.expandMenu();b.preventDefault()}else{if(a.onClick){a.onClick(b);this.fireEvent("click",this,a,b)}}}}}},setActiveItem:function(a,b){if(a!=this.activeItem){this.deactivateActive();if((this.activeItem=a).isFormField){a.focus()}else{a.activate(b)}}else{if(b){a.expandMenu()}}},deactivateActive:function(){var b=this.activeItem;if(b){if(b.isFormField){if(b.collapse){b.collapse()}}else{b.deactivate()}delete this.activeItem}},tryActivate:function(g,e){var b=this.items;for(var c=g,a=b.length;c>=0&&c<a;c+=e){var d=b.get(c);if(d.isVisible()&&!d.disabled&&(d.canActivate||d.isFormField)){this.setActiveItem(d,false);return d}}return false},onMouseOver:function(b){var a=this.findTargetItem(b);if(a){if(a.canActivate&&!a.disabled){this.setActiveItem(a,true)}}this.over=true;this.fireEvent("mouseover",this,b,a)},onMouseOut:function(b){var a=this.findTargetItem(b);if(a){if(a==this.activeItem&&a.shouldDeactivate&&a.shouldDeactivate(b)){this.activeItem.deactivate();delete this.activeItem}}this.over=false;this.fireEvent("mouseout",this,b,a)},onScroll:function(d,b){if(d){d.stopEvent()}var a=this.ul.dom,c=Ext.fly(b).is(".x-menu-scroller-top");a.scrollTop+=this.scrollIncrement*(c?-1:1);if(c?a.scrollTop<=0:a.scrollTop+this.activeMax>=a.scrollHeight){this.onScrollerOut(null,b)}},onScrollerIn:function(d,b){var a=this.ul.dom,c=Ext.fly(b).is(".x-menu-scroller-top");if(c?a.scrollTop>0:a.scrollTop+this.activeMax<a.scrollHeight){Ext.fly(b).addClass(["x-menu-item-active","x-menu-scroller-active"])}},onScrollerOut:function(b,a){Ext.fly(a).removeClass(["x-menu-item-active","x-menu-scroller-active"])},show:function(b,c,a){if(this.floating){this.parentMenu=a;if(!this.el){this.render();this.doLayout(false,true)}this.showAt(this.el.getAlignToXY(b,c||this.defaultAlign,this.defaultOffsets),a)}else{Ext.menu.Menu.superclass.show.call(this)}},showAt:function(b,a){if(this.fireEvent("beforeshow",this)!==false){this.parentMenu=a;if(!this.el){this.render()}if(this.enableScrolling){this.el.setXY(b);b[1]=this.constrainScroll(b[1]);b=[this.el.adjustForConstraints(b)[0],b[1]]}else{b=this.el.adjustForConstraints(b)}this.el.setXY(b);this.el.show();Ext.menu.Menu.superclass.onShow.call(this);if(Ext.isIE){this.fireEvent("autosize",this);if(!Ext.isIE8){this.el.repaint()}}this.hidden=false;this.focus();this.fireEvent("show",this)}},constrainScroll:function(i){var b,d=this.ul.setHeight("auto").getHeight(),a=i,h,e,g,c;if(this.floating){e=Ext.fly(this.el.dom.parentNode);g=e.getScroll().top;c=e.getViewSize().height;h=i-g;b=this.maxHeight?this.maxHeight:c-h;if(d>c){b=c;a=i-h}else{if(b<d){a=i-(d-b);b=d}}}else{b=this.getHeight()}if(this.maxHeight){b=Math.min(this.maxHeight,b)}if(d>b&&b>0){this.activeMax=b-this.scrollerHeight*2-this.el.getFrameWidth("tb")-Ext.num(this.el.shadowOffset,0);this.ul.setHeight(this.activeMax);this.createScrollers();this.el.select(".x-menu-scroller").setDisplayed("")}else{this.ul.setHeight(d);this.el.select(".x-menu-scroller").setDisplayed("none")}this.ul.dom.scrollTop=0;return a},createScrollers:function(){if(!this.scroller){this.scroller={pos:0,top:this.el.insertFirst({tag:"div",cls:"x-menu-scroller x-menu-scroller-top",html:"&#160;"}),bottom:this.el.createChild({tag:"div",cls:"x-menu-scroller x-menu-scroller-bottom",html:"&#160;"})};this.scroller.top.hover(this.onScrollerIn,this.onScrollerOut,this);this.scroller.topRepeater=new Ext.util.ClickRepeater(this.scroller.top,{listeners:{click:this.onScroll.createDelegate(this,[null,this.scroller.top],false)}});this.scroller.bottom.hover(this.onScrollerIn,this.onScrollerOut,this);this.scroller.bottomRepeater=new Ext.util.ClickRepeater(this.scroller.bottom,{listeners:{click:this.onScroll.createDelegate(this,[null,this.scroller.bottom],false)}})}},onLayout:function(){if(this.isVisible()){if(this.enableScrolling){this.constrainScroll(this.el.getTop())}if(this.floating){this.el.sync()}}},focus:function(){if(!this.hidden){this.doFocus.defer(50,this)}},doFocus:function(){if(!this.hidden){this.focusEl.focus()}},hide:function(a){if(!this.isDestroyed){this.deepHide=a;Ext.menu.Menu.superclass.hide.call(this);delete this.deepHide}},onHide:function(){Ext.menu.Menu.superclass.onHide.call(this);this.deactivateActive();if(this.el&&this.floating){this.el.hide()}var a=this.parentMenu;if(this.deepHide===true&&a){if(a.floating){a.hide(true)}else{a.deactivateActive()}}},lookupComponent:function(a){if(Ext.isString(a)){a=(a=="separator"||a=="-")?new Ext.menu.Separator():new Ext.menu.TextItem(a);this.applyDefaults(a)}else{if(Ext.isObject(a)){a=this.getMenuItem(a)}else{if(a.tagName||a.el){a=new Ext.BoxComponent({el:a})}}}return a},applyDefaults:function(b){if(!Ext.isString(b)){b=Ext.menu.Menu.superclass.applyDefaults.call(this,b);var a=this.internalDefaults;if(a){if(b.events){Ext.applyIf(b.initialConfig,a);Ext.apply(b,a)}else{Ext.applyIf(b,a)}}}return b},getMenuItem:function(a){a.ownerCt=this;if(!a.isXType){if(!a.xtype&&Ext.isBoolean(a.checked)){return new Ext.menu.CheckItem(a)}return Ext.create(a,this.defaultType)}return a},addSeparator:function(){return this.add(new Ext.menu.Separator())},addElement:function(a){return this.add(new Ext.menu.BaseItem({el:a}))},addItem:function(a){return this.add(a)},addMenuItem:function(a){return this.add(this.getMenuItem(a))},addText:function(a){return this.add(new Ext.menu.TextItem(a))},onDestroy:function(){Ext.EventManager.removeResizeListener(this.hide,this);var a=this.parentMenu;if(a&&a.activeChild==this){delete a.activeChild}delete this.parentMenu;Ext.menu.Menu.superclass.onDestroy.call(this);Ext.menu.MenuMgr.unregister(this);if(this.keyNav){this.keyNav.disable()}var b=this.scroller;if(b){Ext.destroy(b.topRepeater,b.bottomRepeater,b.top,b.bottom)}Ext.destroy(this.el,this.focusEl,this.ul)}});Ext.reg("menu",Ext.menu.Menu);Ext.menu.MenuNav=Ext.extend(Ext.KeyNav,function(){function a(d,c){if(!c.tryActivate(c.items.indexOf(c.activeItem)-1,-1)){c.tryActivate(c.items.length-1,-1)}}function b(d,c){if(!c.tryActivate(c.items.indexOf(c.activeItem)+1,1)){c.tryActivate(0,1)}}return{constructor:function(c){Ext.menu.MenuNav.superclass.constructor.call(this,c.el);this.scope=this.menu=c},doRelay:function(g,d){var c=g.getKey();if(this.menu.activeItem&&this.menu.activeItem.isFormField&&c!=g.TAB){return false}if(!this.menu.activeItem&&g.isNavKeyPress()&&c!=g.SPACE&&c!=g.RETURN){this.menu.tryActivate(0,1);return false}return d.call(this.scope||this,g,this.menu)},tab:function(d,c){d.stopEvent();if(d.shiftKey){a(d,c)}else{b(d,c)}},up:a,down:b,right:function(d,c){if(c.activeItem){c.activeItem.expandMenu(true)}},left:function(d,c){c.hide();if(c.parentMenu&&c.parentMenu.activeItem){c.parentMenu.activeItem.activate()}},enter:function(d,c){if(c.activeItem){d.stopPropagation();c.activeItem.onClick(d);c.fireEvent("click",this,c.activeItem);return true}}}}());Ext.menu.MenuMgr=function(){var h,e,b,d={},a=false,l=new Date();function n(){h={};e=new Ext.util.MixedCollection();b=Ext.getDoc().addKeyListener(27,j);b.disable()}function j(){if(e&&e.length>0){var o=e.clone();o.each(function(p){p.hide()});return true}return false}function g(o){e.remove(o);if(e.length<1){b.disable();Ext.getDoc().un("mousedown",m);a=false}}function k(o){var p=e.last();l=new Date();e.add(o);if(!a){b.enable();Ext.getDoc().on("mousedown",m);a=true}if(o.parentMenu){o.getEl().setZIndex(parseInt(o.parentMenu.getEl().getStyle("z-index"),10)+3);o.parentMenu.activeChild=o}else{if(p&&!p.isDestroyed&&p.isVisible()){o.getEl().setZIndex(parseInt(p.getEl().getStyle("z-index"),10)+3)}}}function c(o){if(o.activeChild){o.activeChild.hide()}if(o.autoHideTimer){clearTimeout(o.autoHideTimer);delete o.autoHideTimer}}function i(o){var p=o.parentMenu;if(!p&&!o.allowOtherMenus){j()}else{if(p&&p.activeChild){p.activeChild.hide()}}}function m(o){if(l.getElapsed()>50&&e.length>0&&!o.getTarget(".x-menu")){j()}}return{hideAll:function(){return j()},register:function(o){if(!h){n()}h[o.id]=o;o.on({beforehide:c,hide:g,beforeshow:i,show:k})},get:function(o){if(typeof o=="string"){if(!h){return null}return h[o]}else{if(o.events){return o}else{if(typeof o.length=="number"){return new Ext.menu.Menu({items:o})}else{return Ext.create(o,"menu")}}}},unregister:function(o){delete h[o.id];o.un("beforehide",c);o.un("hide",g);o.un("beforeshow",i);o.un("show",k)},registerCheckable:function(o){var p=o.group;if(p){if(!d[p]){d[p]=[]}d[p].push(o)}},unregisterCheckable:function(o){var p=o.group;if(p){d[p].remove(o)}},onCheckChange:function(q,r){if(q.group&&r){var t=d[q.group],p=0,o=t.length,s;for(;p<o;p++){s=t[p];if(s!=q){s.setChecked(false)}}}},getCheckedItem:function(q){var r=d[q];if(r){for(var p=0,o=r.length;p<o;p++){if(r[p].checked){return r[p]}}}return null},setCheckedItem:function(q,s){var r=d[q];if(r){for(var p=0,o=r.length;p<o;p++){if(r[p].id==s){r[p].setChecked(true)}}}return null}}}();Ext.menu.BaseItem=Ext.extend(Ext.Component,{canActivate:false,activeClass:"x-menu-item-active",hideOnClick:true,clickHideDelay:1,ctype:"Ext.menu.BaseItem",actionMode:"container",initComponent:function(){Ext.menu.BaseItem.superclass.initComponent.call(this);this.addEvents("click","activate","deactivate");if(this.handler){this.on("click",this.handler,this.scope)}},onRender:function(b,a){Ext.menu.BaseItem.superclass.onRender.apply(this,arguments);if(this.ownerCt&&this.ownerCt instanceof Ext.menu.Menu){this.parentMenu=this.ownerCt}else{this.container.addClass("x-menu-list-item");this.mon(this.el,{scope:this,click:this.onClick,mouseenter:this.activate,mouseleave:this.deactivate})}},setHandler:function(b,a){if(this.handler){this.un("click",this.handler,this.scope)}this.on("click",this.handler=b,this.scope=a)},onClick:function(a){if(!this.disabled&&this.fireEvent("click",this,a)!==false&&(this.parentMenu&&this.parentMenu.fireEvent("itemclick",this,a)!==false)){this.handleClick(a)}else{a.stopEvent()}},activate:function(){if(this.disabled){return false}var a=this.container;a.addClass(this.activeClass);this.region=a.getRegion().adjust(2,2,-2,-2);this.fireEvent("activate",this);return true},deactivate:function(){this.container.removeClass(this.activeClass);this.fireEvent("deactivate",this)},shouldDeactivate:function(a){return !this.region||!this.region.contains(a.getPoint())},handleClick:function(b){var a=this.parentMenu;if(this.hideOnClick){if(a.floating){this.clickHideDelayTimer=a.hide.defer(this.clickHideDelay,a,[true])}else{a.deactivateActive()}}},beforeDestroy:function(){clearTimeout(this.clickHideDelayTimer);Ext.menu.BaseItem.superclass.beforeDestroy.call(this)},expandMenu:Ext.emptyFn,hideMenu:Ext.emptyFn});Ext.reg("menubaseitem",Ext.menu.BaseItem);Ext.menu.TextItem=Ext.extend(Ext.menu.BaseItem,{hideOnClick:false,itemCls:"x-menu-text",constructor:function(a){if(typeof a=="string"){a={text:a}}Ext.menu.TextItem.superclass.constructor.call(this,a)},onRender:function(){var a=document.createElement("span");a.className=this.itemCls;a.innerHTML=this.text;this.el=a;Ext.menu.TextItem.superclass.onRender.apply(this,arguments)}});Ext.reg("menutextitem",Ext.menu.TextItem);Ext.menu.Separator=Ext.extend(Ext.menu.BaseItem,{itemCls:"x-menu-sep",hideOnClick:false,activeClass:"",onRender:function(a){var b=document.createElement("span");b.className=this.itemCls;b.innerHTML="&#160;";this.el=b;a.addClass("x-menu-sep-li");Ext.menu.Separator.superclass.onRender.apply(this,arguments)}});Ext.reg("menuseparator",Ext.menu.Separator);Ext.menu.Item=Ext.extend(Ext.menu.BaseItem,{itemCls:"x-menu-item",canActivate:true,showDelay:200,altText:"",hideDelay:200,ctype:"Ext.menu.Item",initComponent:function(){Ext.menu.Item.superclass.initComponent.call(this);if(this.menu){if(Ext.isArray(this.menu)){this.menu={items:this.menu}}if(Ext.isObject(this.menu)){this.menu.ownerCt=this}this.menu=Ext.menu.MenuMgr.get(this.menu);this.menu.ownerCt=undefined}},onRender:function(d,b){if(!this.itemTpl){this.itemTpl=Ext.menu.Item.prototype.itemTpl=new Ext.XTemplate('<a id="{id}" class="{cls}" hidefocus="true" unselectable="on" href="{href}"','<tpl if="hrefTarget">',' target="{hrefTarget}"',"</tpl>",">",'<img alt="{altText}" src="{icon}" class="x-menu-item-icon {iconCls}"/>','<span class="x-menu-item-text">{text}</span>',"</a>")}var c=this.getTemplateArgs();this.el=b?this.itemTpl.insertBefore(b,c,true):this.itemTpl.append(d,c,true);this.iconEl=this.el.child("img.x-menu-item-icon");this.textEl=this.el.child(".x-menu-item-text");if(!this.href){this.mon(this.el,"click",Ext.emptyFn,null,{preventDefault:true})}Ext.menu.Item.superclass.onRender.call(this,d,b)},getTemplateArgs:function(){return{id:this.id,cls:this.itemCls+(this.menu?" x-menu-item-arrow":"")+(this.cls?" "+this.cls:""),href:this.href||"#",hrefTarget:this.hrefTarget,icon:this.icon||Ext.BLANK_IMAGE_URL,iconCls:this.iconCls||"",text:this.itemText||this.text||"&#160;",altText:this.altText||""}},setText:function(a){this.text=a||"&#160;";if(this.rendered){this.textEl.update(this.text);this.parentMenu.layout.doAutoSize()}},setIconClass:function(a){var b=this.iconCls;this.iconCls=a;if(this.rendered){this.iconEl.replaceClass(b,this.iconCls)}},beforeDestroy:function(){clearTimeout(this.showTimer);clearTimeout(this.hideTimer);if(this.menu){delete this.menu.ownerCt;this.menu.destroy()}Ext.menu.Item.superclass.beforeDestroy.call(this)},handleClick:function(a){if(!this.href){a.stopEvent()}Ext.menu.Item.superclass.handleClick.apply(this,arguments)},activate:function(a){if(Ext.menu.Item.superclass.activate.apply(this,arguments)){this.focus();if(a){this.expandMenu()}}return true},shouldDeactivate:function(a){if(Ext.menu.Item.superclass.shouldDeactivate.call(this,a)){if(this.menu&&this.menu.isVisible()){return !this.menu.getEl().getRegion().contains(a.getPoint())}return true}return false},deactivate:function(){Ext.menu.Item.superclass.deactivate.apply(this,arguments);this.hideMenu()},expandMenu:function(a){if(!this.disabled&&this.menu){clearTimeout(this.hideTimer);delete this.hideTimer;if(!this.menu.isVisible()&&!this.showTimer){this.showTimer=this.deferExpand.defer(this.showDelay,this,[a])}else{if(this.menu.isVisible()&&a){this.menu.tryActivate(0,1)}}}},deferExpand:function(a){delete this.showTimer;this.menu.show(this.container,this.parentMenu.subMenuAlign||"tl-tr?",this.parentMenu);if(a){this.menu.tryActivate(0,1)}},hideMenu:function(){clearTimeout(this.showTimer);delete this.showTimer;if(!this.hideTimer&&this.menu&&this.menu.isVisible()){this.hideTimer=this.deferHide.defer(this.hideDelay,this)}},deferHide:function(){delete this.hideTimer;if(this.menu.over){this.parentMenu.setActiveItem(this,false)}else{this.menu.hide()}}});Ext.reg("menuitem",Ext.menu.Item);Ext.menu.CheckItem=Ext.extend(Ext.menu.Item,{itemCls:"x-menu-item x-menu-check-item",groupClass:"x-menu-group-item",checked:false,ctype:"Ext.menu.CheckItem",initComponent:function(){Ext.menu.CheckItem.superclass.initComponent.call(this);this.addEvents("beforecheckchange","checkchange");if(this.checkHandler){this.on("checkchange",this.checkHandler,this.scope)}Ext.menu.MenuMgr.registerCheckable(this)},onRender:function(a){Ext.menu.CheckItem.superclass.onRender.apply(this,arguments);if(this.group){this.el.addClass(this.groupClass)}if(this.checked){this.checked=false;this.setChecked(true,true)}},destroy:function(){Ext.menu.MenuMgr.unregisterCheckable(this);Ext.menu.CheckItem.superclass.destroy.apply(this,arguments)},setChecked:function(b,a){var c=a===true;if(this.checked!=b&&(c||this.fireEvent("beforecheckchange",this,b)!==false)){Ext.menu.MenuMgr.onCheckChange(this,b);if(this.container){this.container[b?"addClass":"removeClass"]("x-menu-item-checked")}this.checked=b;if(!c){this.fireEvent("checkchange",this,b)}}},handleClick:function(a){if(!this.disabled&&!(this.checked&&this.group)){this.setChecked(!this.checked)}Ext.menu.CheckItem.superclass.handleClick.apply(this,arguments)}});Ext.reg("menucheckitem",Ext.menu.CheckItem);Ext.menu.DateMenu=Ext.extend(Ext.menu.Menu,{enableScrolling:false,hideOnClick:true,pickerId:null,cls:"x-date-menu",initComponent:function(){this.on("beforeshow",this.onBeforeShow,this);if(this.strict=(Ext.isIE7&&Ext.isStrict)){this.on("show",this.onShow,this,{single:true,delay:20})}Ext.apply(this,{plain:true,showSeparator:false,items:this.picker=new Ext.DatePicker(Ext.applyIf({internalRender:this.strict||!Ext.isIE,ctCls:"x-menu-date-item",id:this.pickerId},this.initialConfig))});this.picker.purgeListeners();Ext.menu.DateMenu.superclass.initComponent.call(this);this.relayEvents(this.picker,["select"]);this.on("show",this.picker.focus,this.picker);this.on("select",this.menuHide,this);if(this.handler){this.on("select",this.handler,this.scope||this)}},menuHide:function(){if(this.hideOnClick){this.hide(true)}},onBeforeShow:function(){if(this.picker){this.picker.hideMonthPicker(true)}},onShow:function(){var a=this.picker.getEl();a.setWidth(a.getWidth())}});Ext.reg("datemenu",Ext.menu.DateMenu);Ext.menu.ColorMenu=Ext.extend(Ext.menu.Menu,{enableScrolling:false,hideOnClick:true,cls:"x-color-menu",paletteId:null,initComponent:function(){Ext.apply(this,{plain:true,showSeparator:false,items:this.palette=new Ext.ColorPalette(Ext.applyIf({id:this.paletteId},this.initialConfig))});this.palette.purgeListeners();Ext.menu.ColorMenu.superclass.initComponent.call(this);this.relayEvents(this.palette,["select"]);this.on("select",this.menuHide,this);if(this.handler){this.on("select",this.handler,this.scope||this)}},menuHide:function(){if(this.hideOnClick){this.hide(true)}}});Ext.reg("colormenu",Ext.menu.ColorMenu);Ext.form.Field=Ext.extend(Ext.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"off"},fieldClass:"x-form-field",msgTarget:"qtip",msgFx:"normal",readOnly:false,disabled:false,submitValue:true,isFormField:true,msgDisplay:"",hasFocus:false,initComponent:function(){Ext.form.Field.superclass.initComponent.call(this);this.addEvents("focus","blur","specialkey","change","invalid","valid")},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:this.name||this.id||""},onRender:function(c,a){if(!this.el){var b=this.getAutoCreate();if(!b.name){b.name=this.name||this.id}if(this.inputType){b.type=this.inputType}this.autoEl=b}Ext.form.Field.superclass.onRender.call(this,c,a);if(this.submitValue===false){this.el.dom.removeAttribute("name")}var d=this.el.dom.type;if(d){if(d=="password"){d="text"}this.el.addClass("x-form-"+d)}if(this.readOnly){this.setReadOnly(true)}if(this.tabIndex!==undefined){this.el.dom.setAttribute("tabIndex",this.tabIndex)}this.el.addClass([this.fieldClass,this.cls])},getItemCt:function(){return this.itemCt},initValue:function(){if(this.value!==undefined){this.setValue(this.value)}else{if(!Ext.isEmpty(this.el.dom.value)&&this.el.dom.value!=this.emptyText){this.setValue(this.el.dom.value)}}this.originalValue=this.getValue()},isDirty:function(){if(this.disabled||!this.rendered){return false}return String(this.getValue())!==String(this.originalValue)},setReadOnly:function(a){if(this.rendered){this.el.dom.readOnly=a}this.readOnly=a},afterRender:function(){Ext.form.Field.superclass.afterRender.call(this);this.initEvents();this.initValue()},fireKey:function(a){if(a.isSpecialKey()){this.fireEvent("specialkey",this,a)}},reset:function(){this.setValue(this.originalValue);this.clearInvalid()},initEvents:function(){this.mon(this.el,Ext.EventManager.getKeyEvent(),this.fireKey,this);this.mon(this.el,"focus",this.onFocus,this);this.mon(this.el,"blur",this.onBlur,this,this.inEditor?{buffer:10}:null)},preFocus:Ext.emptyFn,onFocus:function(){this.preFocus();if(this.focusClass){this.el.addClass(this.focusClass)}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this)}},beforeBlur:Ext.emptyFn,onBlur:function(){this.beforeBlur();if(this.focusClass){this.el.removeClass(this.focusClass)}this.hasFocus=false;if(this.validationEvent!==false&&(this.validateOnBlur||this.validationEvent=="blur")){this.validate()}var a=this.getValue();if(String(a)!==String(this.startValue)){this.fireEvent("change",this,a,this.startValue)}this.fireEvent("blur",this);this.postBlur()},postBlur:Ext.emptyFn,isValid:function(a){if(this.disabled){return true}var c=this.preventMark;this.preventMark=a===true;var b=this.validateValue(this.processValue(this.getRawValue()),a);this.preventMark=c;return b},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true}return false},processValue:function(a){return a},validateValue:function(b){var a=this.getErrors(b)[0];if(a==undefined){return true}else{this.markInvalid(a);return false}},getErrors:function(){return[]},getActiveError:function(){return this.activeError||""},markInvalid:function(c){if(this.rendered&&!this.preventMark){c=c||this.invalidText;var a=this.getMessageHandler();if(a){a.mark(this,c)}else{if(this.msgTarget){this.el.addClass(this.invalidClass);var b=Ext.getDom(this.msgTarget);if(b){b.innerHTML=c;b.style.display=this.msgDisplay}}}}this.setActiveError(c)},clearInvalid:function(){if(this.rendered&&!this.preventMark){this.el.removeClass(this.invalidClass);var a=this.getMessageHandler();if(a){a.clear(this)}else{if(this.msgTarget){this.el.removeClass(this.invalidClass);var b=Ext.getDom(this.msgTarget);if(b){b.innerHTML="";b.style.display="none"}}}}this.unsetActiveError()},setActiveError:function(b,a){this.activeError=b;if(a!==true){this.fireEvent("invalid",this,b)}},unsetActiveError:function(a){delete this.activeError;if(a!==true){this.fireEvent("valid",this)}},getMessageHandler:function(){return Ext.form.MessageTargets[this.msgTarget]},getErrorCt:function(){return this.el.findParent(".x-form-element",5,true)||this.el.findParent(".x-form-field-wrap",5,true)},alignErrorEl:function(){this.errorEl.setWidth(this.getErrorCt().getWidth(true)-20)},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,"tl-tr",[2,0])},getRawValue:function(){var a=this.rendered?this.el.getValue():Ext.value(this.value,"");if(a===this.emptyText){a=""}return a},getValue:function(){if(!this.rendered){return this.value}var a=this.el.getValue();if(a===this.emptyText||a===undefined){a=""}return a},setRawValue:function(a){return this.rendered?(this.el.dom.value=(Ext.isEmpty(a)?"":a)):""},setValue:function(a){this.value=a;if(this.rendered){this.el.dom.value=(Ext.isEmpty(a)?"":a);this.validate()}return this},append:function(a){this.setValue([this.getValue(),a].join(""))}});Ext.form.MessageTargets={qtip:{mark:function(a,b){a.el.addClass(a.invalidClass);a.el.dom.qtip=b;a.el.dom.qclass="x-form-invalid-tip";if(Ext.QuickTips){Ext.QuickTips.enable()}},clear:function(a){a.el.removeClass(a.invalidClass);a.el.dom.qtip=""}},title:{mark:function(a,b){a.el.addClass(a.invalidClass);a.el.dom.title=b},clear:function(a){a.el.dom.title=""}},under:{mark:function(b,c){b.el.addClass(b.invalidClass);if(!b.errorEl){var a=b.getErrorCt();if(!a){b.el.dom.title=c;return}b.errorEl=a.createChild({cls:"x-form-invalid-msg"});b.on("resize",b.alignErrorEl,b);b.on("destroy",function(){Ext.destroy(this.errorEl)},b)}b.alignErrorEl();b.errorEl.update(c);Ext.form.Field.msgFx[b.msgFx].show(b.errorEl,b)},clear:function(a){a.el.removeClass(a.invalidClass);if(a.errorEl){Ext.form.Field.msgFx[a.msgFx].hide(a.errorEl,a)}else{a.el.dom.title=""}}},side:{mark:function(b,c){b.el.addClass(b.invalidClass);if(!b.errorIcon){var a=b.getErrorCt();if(!a){b.el.dom.title=c;return}b.errorIcon=a.createChild({cls:"x-form-invalid-icon"});if(b.ownerCt){b.ownerCt.on("afterlayout",b.alignErrorIcon,b);b.ownerCt.on("expand",b.alignErrorIcon,b)}b.on("resize",b.alignErrorIcon,b);b.on("destroy",function(){Ext.destroy(this.errorIcon)},b)}b.alignErrorIcon();b.errorIcon.dom.qtip=c;b.errorIcon.dom.qclass="x-form-invalid-tip";b.errorIcon.show()},clear:function(a){a.el.removeClass(a.invalidClass);if(a.errorIcon){a.errorIcon.dom.qtip="";a.errorIcon.hide()}else{a.el.dom.title=""}}}};Ext.form.Field.msgFx={normal:{show:function(a,b){a.setDisplayed("block")},hide:function(a,b){a.setDisplayed(false).update("")}},slide:{show:function(a,b){a.slideIn("t",{stopFx:true})},hide:function(a,b){a.slideOut("t",{stopFx:true,useDisplay:true})}},slideRight:{show:function(a,b){a.fixDisplay();a.alignTo(b.el,"tl-tr");a.slideIn("l",{stopFx:true})},hide:function(a,b){a.slideOut("l",{stopFx:true,useDisplay:true})}}};Ext.reg("field",Ext.form.Field);Ext.form.TextField=Ext.extend(Ext.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,emptyClass:"x-form-empty-field",initComponent:function(){Ext.form.TextField.superclass.initComponent.call(this);this.addEvents("autosize","keydown","keyup","keypress")},initEvents:function(){Ext.form.TextField.superclass.initEvents.call(this);if(this.validationEvent=="keyup"){this.validationTask=new Ext.util.DelayedTask(this.validate,this);this.mon(this.el,"keyup",this.filterValidation,this)}else{if(this.validationEvent!==false&&this.validationEvent!="blur"){this.mon(this.el,this.validationEvent,this.validate,this,{buffer:this.validationDelay})}}if(this.selectOnFocus||this.emptyText){this.mon(this.el,"mousedown",this.onMouseDown,this);if(this.emptyText){this.applyEmptyText()}}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Ext.form.VTypes[this.vtype+"Mask"]))){this.mon(this.el,"keypress",this.filterKeys,this)}if(this.grow){this.mon(this.el,"keyup",this.onKeyUpBuffered,this,{buffer:50});this.mon(this.el,"click",this.autoSize,this)}if(this.enableKeyEvents){this.mon(this.el,{scope:this,keyup:this.onKeyUp,keydown:this.onKeyDown,keypress:this.onKeyPress})}},onMouseDown:function(a){if(!this.hasFocus){this.mon(this.el,"mouseup",Ext.emptyFn,this,{single:true,preventDefault:true})}},processValue:function(a){if(this.stripCharsRe){var b=a.replace(this.stripCharsRe,"");if(b!==a){this.setRawValue(b);return b}}return a},filterValidation:function(a){if(!a.isNavKeyPress()){this.validationTask.delay(this.validationDelay)}},onDisable:function(){Ext.form.TextField.superclass.onDisable.call(this);if(Ext.isIE){this.el.dom.unselectable="on"}},onEnable:function(){Ext.form.TextField.superclass.onEnable.call(this);if(Ext.isIE){this.el.dom.unselectable=""}},onKeyUpBuffered:function(a){if(this.doAutoSize(a)){this.autoSize()}},doAutoSize:function(a){return !a.isNavKeyPress()},onKeyUp:function(a){this.fireEvent("keyup",this,a)},onKeyDown:function(a){this.fireEvent("keydown",this,a)},onKeyPress:function(a){this.fireEvent("keypress",this,a)},reset:function(){Ext.form.TextField.superclass.reset.call(this);this.applyEmptyText()},applyEmptyText:function(){if(this.rendered&&this.emptyText&&this.getRawValue().length<1&&!this.hasFocus){this.setRawValue(this.emptyText);this.el.addClass(this.emptyClass)}},preFocus:function(){var a=this.el,b;if(this.emptyText){if(a.dom.value==this.emptyText){this.setRawValue("");b=true}a.removeClass(this.emptyClass)}if(this.selectOnFocus||b){a.dom.select()}},postBlur:function(){this.applyEmptyText()},filterKeys:function(b){if(b.ctrlKey){return}var a=b.getKey();if(Ext.isGecko&&(b.isNavKeyPress()||a==b.BACKSPACE||(a==b.DELETE&&b.button==-1))){return}var c=String.fromCharCode(b.getCharCode());if(!Ext.isGecko&&b.isSpecialKey()&&!c){return}if(!this.maskRe.test(c)){b.stopEvent()}},setValue:function(a){if(this.emptyText&&this.el&&!Ext.isEmpty(a)){this.el.removeClass(this.emptyClass)}Ext.form.TextField.superclass.setValue.apply(this,arguments);this.applyEmptyText();this.autoSize();return this},getErrors:function(a){var d=Ext.form.TextField.superclass.getErrors.apply(this,arguments);a=Ext.isDefined(a)?a:this.processValue(this.getRawValue());if(Ext.isFunction(this.validator)){var c=this.validator(a);if(c!==true){d.push(c)}}if(a.length<1||a===this.emptyText){if(this.allowBlank){return d}else{d.push(this.blankText)}}if(!this.allowBlank&&(a.length<1||a===this.emptyText)){d.push(this.blankText)}if(a.length<this.minLength){d.push(String.format(this.minLengthText,this.minLength))}if(a.length>this.maxLength){d.push(String.format(this.maxLengthText,this.maxLength))}if(this.vtype){var b=Ext.form.VTypes;if(!b[this.vtype](a,this)){d.push(this.vtypeText||b[this.vtype+"Text"])}}if(this.regex&&!this.regex.test(a)){d.push(this.regexText)}return d},selectText:function(h,a){var c=this.getRawValue();var e=false;if(c.length>0){h=h===undefined?0:h;a=a===undefined?c.length:a;var g=this.el.dom;if(g.setSelectionRange){g.setSelectionRange(h,a)}else{if(g.createTextRange){var b=g.createTextRange();b.moveStart("character",h);b.moveEnd("character",a-c.length);b.select()}}e=Ext.isGecko||Ext.isOpera}else{e=true}if(e){this.focus()}},autoSize:function(){if(!this.grow||!this.rendered){return}if(!this.metrics){this.metrics=Ext.util.TextMetrics.createInstance(this.el)}var c=this.el;var b=c.dom.value;var e=document.createElement("div");e.appendChild(document.createTextNode(b));b=e.innerHTML;Ext.removeNode(e);e=null;b+="&#160;";var a=Math.min(this.growMax,Math.max(this.metrics.getWidth(b)+10,this.growMin));this.el.setWidth(a);this.fireEvent("autosize",this,a)},onDestroy:function(){if(this.validationTask){this.validationTask.cancel();this.validationTask=null}Ext.form.TextField.superclass.onDestroy.call(this)}});Ext.reg("textfield",Ext.form.TextField);Ext.form.TriggerField=Ext.extend(Ext.form.TextField,{defaultAutoCreate:{tag:"input",type:"text",size:"16",autocomplete:"off"},hideTrigger:false,editable:true,readOnly:false,wrapFocusClass:"x-trigger-wrap-focus",autoSize:Ext.emptyFn,monitorTab:true,deferHeight:true,mimicing:false,actionMode:"wrap",defaultTriggerWidth:17,onResize:function(a,c){Ext.form.TriggerField.superclass.onResize.call(this,a,c);var b=this.getTriggerWidth();if(Ext.isNumber(a)){this.el.setWidth(a-b)}this.wrap.setWidth(this.el.getWidth()+b)},getTriggerWidth:function(){var a=this.trigger.getWidth();if(!this.hideTrigger&&!this.readOnly&&a===0){a=this.defaultTriggerWidth}return a},alignErrorIcon:function(){if(this.wrap){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])}},onRender:function(b,a){this.doc=Ext.isIE?Ext.getBody():Ext.getDoc();Ext.form.TriggerField.superclass.onRender.call(this,b,a);this.wrap=this.el.wrap({cls:"x-form-field-wrap x-form-field-trigger-wrap"});this.trigger=this.wrap.createChild(this.triggerConfig||{tag:"img",src:Ext.BLANK_IMAGE_URL,alt:"",cls:"x-form-trigger "+this.triggerClass});this.initTrigger();if(!this.width){this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())}this.resizeEl=this.positionEl=this.wrap},getWidth:function(){return(this.el.getWidth()+this.trigger.getWidth())},updateEditState:function(){if(this.rendered){if(this.readOnly){this.el.dom.readOnly=true;this.el.addClass("x-trigger-noedit");this.mun(this.el,"click",this.onTriggerClick,this);this.trigger.setDisplayed(false)}else{if(!this.editable){this.el.dom.readOnly=true;this.el.addClass("x-trigger-noedit");this.mon(this.el,"click",this.onTriggerClick,this)}else{this.el.dom.readOnly=false;this.el.removeClass("x-trigger-noedit");this.mun(this.el,"click",this.onTriggerClick,this)}this.trigger.setDisplayed(!this.hideTrigger)}this.onResize(this.width||this.wrap.getWidth())}},setHideTrigger:function(a){if(a!=this.hideTrigger){this.hideTrigger=a;this.updateEditState()}},setEditable:function(a){if(a!=this.editable){this.editable=a;this.updateEditState()}},setReadOnly:function(a){if(a!=this.readOnly){this.readOnly=a;this.updateEditState()}},afterRender:function(){Ext.form.TriggerField.superclass.afterRender.call(this);this.updateEditState()},initTrigger:function(){this.mon(this.trigger,"click",this.onTriggerClick,this,{preventDefault:true});this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},onDestroy:function(){Ext.destroy(this.trigger,this.wrap);if(this.mimicing){this.doc.un("mousedown",this.mimicBlur,this)}delete this.doc;Ext.form.TriggerField.superclass.onDestroy.call(this)},onFocus:function(){Ext.form.TriggerField.superclass.onFocus.call(this);if(!this.mimicing){this.wrap.addClass(this.wrapFocusClass);this.mimicing=true;this.doc.on("mousedown",this.mimicBlur,this,{delay:10});if(this.monitorTab){this.on("specialkey",this.checkTab,this)}}},checkTab:function(a,b){if(b.getKey()==b.TAB){this.triggerBlur()}},onBlur:Ext.emptyFn,mimicBlur:function(a){if(!this.isDestroyed&&!this.wrap.contains(a.target)&&this.validateBlur(a)){this.triggerBlur()}},triggerBlur:function(){this.mimicing=false;this.doc.un("mousedown",this.mimicBlur,this);if(this.monitorTab&&this.el){this.un("specialkey",this.checkTab,this)}Ext.form.TriggerField.superclass.onBlur.call(this);if(this.wrap){this.wrap.removeClass(this.wrapFocusClass)}},beforeBlur:Ext.emptyFn,validateBlur:function(a){return true},onTriggerClick:Ext.emptyFn});Ext.form.TwinTriggerField=Ext.extend(Ext.form.TriggerField,{initComponent:function(){Ext.form.TwinTriggerField.superclass.initComponent.call(this);this.triggerConfig={tag:"span",cls:"x-form-twin-triggers",cn:[{tag:"img",src:Ext.BLANK_IMAGE_URL,alt:"",cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Ext.BLANK_IMAGE_URL,alt:"",cls:"x-form-trigger "+this.trigger2Class}]}},getTrigger:function(a){return this.triggers[a]},afterRender:function(){Ext.form.TwinTriggerField.superclass.afterRender.call(this);var c=this.triggers,b=0,a=c.length;for(;b<a;++b){if(this["hideTrigger"+(b+1)]){c[b].hide()}}},initTrigger:function(){var a=this.trigger.select(".x-form-trigger",true),b=this;a.each(function(d,g,c){var e="Trigger"+(c+1);d.hide=function(){var h=b.wrap.getWidth();this.dom.style.display="none";b.el.setWidth(h-b.trigger.getWidth());b["hidden"+e]=true};d.show=function(){var h=b.wrap.getWidth();this.dom.style.display="";b.el.setWidth(h-b.trigger.getWidth());b["hidden"+e]=false};this.mon(d,"click",this["on"+e+"Click"],this,{preventDefault:true});d.addClassOnOver("x-form-trigger-over");d.addClassOnClick("x-form-trigger-click")},this);this.triggers=a.elements},getTriggerWidth:function(){var a=0;Ext.each(this.triggers,function(d,c){var e="Trigger"+(c+1),b=d.getWidth();if(b===0&&!this["hidden"+e]){a+=this.defaultTriggerWidth}else{a+=b}},this);return a},onDestroy:function(){Ext.destroy(this.triggers);Ext.form.TwinTriggerField.superclass.onDestroy.call(this)},onTrigger1Click:Ext.emptyFn,onTrigger2Click:Ext.emptyFn});Ext.reg("trigger",Ext.form.TriggerField);Ext.form.TextArea=Ext.extend(Ext.form.TextField,{growMin:60,growMax:1000,growAppend:"&#160;\n&#160;",enterIsSpecial:false,preventScrollbars:false,onRender:function(b,a){if(!this.el){this.defaultAutoCreate={tag:"textarea",style:"width:100px;height:60px;",autocomplete:"off"}}Ext.form.TextArea.superclass.onRender.call(this,b,a);if(this.grow){this.textSizeEl=Ext.DomHelper.append(document.body,{tag:"pre",cls:"x-form-grow-sizer"});if(this.preventScrollbars){this.el.setStyle("overflow","hidden")}this.el.setHeight(this.growMin)}},onDestroy:function(){Ext.removeNode(this.textSizeEl);Ext.form.TextArea.superclass.onDestroy.call(this)},fireKey:function(a){if(a.isSpecialKey()&&(this.enterIsSpecial||(a.getKey()!=a.ENTER||a.hasModifier()))){this.fireEvent("specialkey",this,a)}},doAutoSize:function(a){return !a.isNavKeyPress()||a.getKey()==a.ENTER},filterValidation:function(a){if(!a.isNavKeyPress()||(!this.enterIsSpecial&&a.keyCode==a.ENTER)){this.validationTask.delay(this.validationDelay)}},autoSize:function(){if(!this.grow||!this.textSizeEl){return}var c=this.el,a=Ext.util.Format.htmlEncode(c.dom.value),d=this.textSizeEl,b;Ext.fly(d).setWidth(this.el.getWidth());if(a.length<1){a="&#160;&#160;"}else{a+=this.growAppend;if(Ext.isIE){a=a.replace(/\n/g,"&#160;<br />")}}d.innerHTML=a;b=Math.min(this.growMax,Math.max(d.offsetHeight,this.growMin));if(b!=this.lastHeight){this.lastHeight=b;this.el.setHeight(b);this.fireEvent("autosize",this,b)}}});Ext.reg("textarea",Ext.form.TextArea);Ext.form.NumberField=Ext.extend(Ext.form.TextField,{fieldClass:"x-form-field x-form-num-field",allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",baseChars:"0123456789",autoStripChars:false,initEvents:function(){var a=this.baseChars+"";if(this.allowDecimals){a+=this.decimalSeparator}if(this.allowNegative){a+="-"}a=Ext.escapeRe(a);this.maskRe=new RegExp("["+a+"]");if(this.autoStripChars){this.stripCharsRe=new RegExp("[^"+a+"]","gi")}Ext.form.NumberField.superclass.initEvents.call(this)},getErrors:function(b){var c=Ext.form.NumberField.superclass.getErrors.apply(this,arguments);b=Ext.isDefined(b)?b:this.processValue(this.getRawValue());if(b.length<1){return c}b=String(b).replace(this.decimalSeparator,".");if(isNaN(b)){c.push(String.format(this.nanText,b))}var a=this.parseValue(b);if(a<this.minValue){c.push(String.format(this.minText,this.minValue))}if(a>this.maxValue){c.push(String.format(this.maxText,this.maxValue))}return c},getValue:function(){return this.fixPrecision(this.parseValue(Ext.form.NumberField.superclass.getValue.call(this)))},setValue:function(a){a=Ext.isNumber(a)?a:parseFloat(String(a).replace(this.decimalSeparator,"."));a=this.fixPrecision(a);a=isNaN(a)?"":String(a).replace(".",this.decimalSeparator);return Ext.form.NumberField.superclass.setValue.call(this,a)},setMinValue:function(a){this.minValue=Ext.num(a,Number.NEGATIVE_INFINITY)},setMaxValue:function(a){this.maxValue=Ext.num(a,Number.MAX_VALUE)},parseValue:function(a){a=parseFloat(String(a).replace(this.decimalSeparator,"."));return isNaN(a)?"":a},fixPrecision:function(b){var a=isNaN(b);if(!this.allowDecimals||this.decimalPrecision==-1||a||!b){return a?"":b}return parseFloat(parseFloat(b).toFixed(this.decimalPrecision))},beforeBlur:function(){var a=this.parseValue(this.getRawValue());if(!Ext.isEmpty(a)){this.setValue(a)}}});Ext.reg("numberfield",Ext.form.NumberField);Ext.form.DateField=Ext.extend(Ext.form.TriggerField,{format:"m/d/Y",altFormats:"m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d|n-j|n/j",disabledDaysText:"Disabled",disabledDatesText:"Disabled",minText:"The date in this field must be equal to or after {0}",maxText:"The date in this field must be equal to or before {0}",invalidText:"{0} is not a valid date - it must be in the format {1}",triggerClass:"x-form-date-trigger",showToday:true,startDay:0,defaultAutoCreate:{tag:"input",type:"text",size:"10",autocomplete:"off"},initTime:"12",initTimeFormat:"H",safeParse:function(b,c){if(Date.formatContainsHourInfo(c)){return Date.parseDate(b,c)}else{var a=Date.parseDate(b+" "+this.initTime,c+" "+this.initTimeFormat);if(a){return a.clearTime()}}},initComponent:function(){Ext.form.DateField.superclass.initComponent.call(this);this.addEvents("select");if(Ext.isString(this.minValue)){this.minValue=this.parseDate(this.minValue)}if(Ext.isString(this.maxValue)){this.maxValue=this.parseDate(this.maxValue)}this.disabledDatesRE=null;this.initDisabledDays()},initEvents:function(){Ext.form.DateField.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{down:function(a){this.onTriggerClick()},scope:this,forceKeyDown:true})},initDisabledDays:function(){if(this.disabledDates){var b=this.disabledDates,a=b.length-1,c="(?:";Ext.each(b,function(g,e){c+=Ext.isDate(g)?"^"+Ext.escapeRe(g.dateFormat(this.format))+"$":b[e];if(e!=a){c+="|"}},this);this.disabledDatesRE=new RegExp(c+")")}},setDisabledDates:function(a){this.disabledDates=a;this.initDisabledDays();if(this.menu){this.menu.picker.setDisabledDates(this.disabledDatesRE)}},setDisabledDays:function(a){this.disabledDays=a;if(this.menu){this.menu.picker.setDisabledDays(a)}},setMinValue:function(a){this.minValue=(Ext.isString(a)?this.parseDate(a):a);if(this.menu){this.menu.picker.setMinDate(this.minValue)}},setMaxValue:function(a){this.maxValue=(Ext.isString(a)?this.parseDate(a):a);if(this.menu){this.menu.picker.setMaxDate(this.maxValue)}},getErrors:function(e){var h=Ext.form.DateField.superclass.getErrors.apply(this,arguments);e=this.formatDate(e||this.processValue(this.getRawValue()));if(e.length<1){return h}var c=e;e=this.parseDate(e);if(!e){h.push(String.format(this.invalidText,c,this.format));return h}var g=e.getTime();if(this.minValue&&g<this.minValue.clearTime().getTime()){h.push(String.format(this.minText,this.formatDate(this.minValue)))}if(this.maxValue&&g>this.maxValue.clearTime().getTime()){h.push(String.format(this.maxText,this.formatDate(this.maxValue)))}if(this.disabledDays){var a=e.getDay();for(var b=0;b<this.disabledDays.length;b++){if(a===this.disabledDays[b]){h.push(this.disabledDaysText);break}}}var d=this.formatDate(e);if(this.disabledDatesRE&&this.disabledDatesRE.test(d)){h.push(String.format(this.disabledDatesText,d))}return h},validateBlur:function(){return !this.menu||!this.menu.isVisible()},getValue:function(){return this.parseDate(Ext.form.DateField.superclass.getValue.call(this))||""},setValue:function(a){return Ext.form.DateField.superclass.setValue.call(this,this.formatDate(this.parseDate(a)))},parseDate:function(g){if(!g||Ext.isDate(g)){return g}var b=this.safeParse(g,this.format),c=this.altFormats,e=this.altFormatsArray;if(!b&&c){e=e||c.split("|");for(var d=0,a=e.length;d<a&&!b;d++){b=this.safeParse(g,e[d])}}return b},onDestroy:function(){Ext.destroy(this.menu,this.keyNav);Ext.form.DateField.superclass.onDestroy.call(this)},formatDate:function(a){return Ext.isDate(a)?a.dateFormat(this.format):a},onTriggerClick:function(){if(this.disabled){return}if(this.menu==null){this.menu=new Ext.menu.DateMenu({hideOnClick:false,focusOnSelect:false})}this.onFocus();Ext.apply(this.menu.picker,{minDate:this.minValue,maxDate:this.maxValue,disabledDatesRE:this.disabledDatesRE,disabledDatesText:this.disabledDatesText,disabledDays:this.disabledDays,disabledDaysText:this.disabledDaysText,format:this.format,showToday:this.showToday,startDay:this.startDay,minText:String.format(this.minText,this.formatDate(this.minValue)),maxText:String.format(this.maxText,this.formatDate(this.maxValue))});this.menu.picker.setValue(this.getValue()||new Date());this.menu.show(this.el,"tl-bl?");this.menuEvents("on")},menuEvents:function(a){this.menu[a]("select",this.onSelect,this);this.menu[a]("hide",this.onMenuHide,this);this.menu[a]("show",this.onFocus,this)},onSelect:function(a,b){this.setValue(b);this.fireEvent("select",this,b);this.menu.hide()},onMenuHide:function(){this.focus(false,60);this.menuEvents("un")},beforeBlur:function(){var a=this.parseDate(this.getRawValue());if(a){this.setValue(a)}}});Ext.reg("datefield",Ext.form.DateField);Ext.form.DisplayField=Ext.extend(Ext.form.Field,{validationEvent:false,validateOnBlur:false,defaultAutoCreate:{tag:"div"},fieldClass:"x-form-display-field",htmlEncode:false,initEvents:Ext.emptyFn,isValid:function(){return true},validate:function(){return true},getRawValue:function(){var a=this.rendered?this.el.dom.innerHTML:Ext.value(this.value,"");if(a===this.emptyText){a=""}if(this.htmlEncode){a=Ext.util.Format.htmlDecode(a)}return a},getValue:function(){return this.getRawValue()},getName:function(){return this.name},setRawValue:function(a){if(this.htmlEncode){a=Ext.util.Format.htmlEncode(a)}return this.rendered?(this.el.dom.innerHTML=(Ext.isEmpty(a)?"":a)):(this.value=a)},setValue:function(a){this.setRawValue(a);return this}});Ext.reg("displayfield",Ext.form.DisplayField);Ext.form.ComboBox=Ext.extend(Ext.form.TriggerField,{defaultAutoCreate:{tag:"input",type:"text",size:"24",autocomplete:"off"},listClass:"",selectedClass:"x-combo-selected",listEmptyText:"",triggerClass:"x-form-arrow-trigger",shadow:"sides",listAlign:"tl-bl?",maxHeight:300,minHeight:90,triggerAction:"query",minChars:4,autoSelect:true,typeAhead:false,queryDelay:500,pageSize:0,selectOnFocus:false,queryParam:"query",loadingText:"Loading...",resizable:false,handleHeight:8,allQuery:"",mode:"remote",minListWidth:70,forceSelection:false,typeAheadDelay:250,lazyInit:true,clearFilterOnReset:true,submitValue:undefined,initComponent:function(){Ext.form.ComboBox.superclass.initComponent.call(this);this.addEvents("expand","collapse","beforeselect","select","beforequery");if(this.transform){var c=Ext.getDom(this.transform);if(!this.hiddenName){this.hiddenName=c.name}if(!this.store){this.mode="local";var j=[],e=c.options;for(var b=0,a=e.length;b<a;b++){var h=e[b],g=(h.hasAttribute?h.hasAttribute("value"):h.getAttributeNode("value").specified)?h.value:h.text;if(h.selected&&Ext.isEmpty(this.value,true)){this.value=g}j.push([g,h.text])}this.store=new Ext.data.ArrayStore({idIndex:0,fields:["value","text"],data:j,autoDestroy:true});this.valueField="value";this.displayField="text"}c.name=Ext.id();if(!this.lazyRender){this.target=true;this.el=Ext.DomHelper.insertBefore(c,this.autoCreate||this.defaultAutoCreate);this.render(this.el.parentNode,c)}Ext.removeNode(c)}else{if(this.store){this.store=Ext.StoreMgr.lookup(this.store);if(this.store.autoCreated){this.displayField=this.valueField="field1";if(!this.store.expandData){this.displayField="field2"}this.mode="local"}}}this.selectedIndex=-1;if(this.mode=="local"){if(!Ext.isDefined(this.initialConfig.queryDelay)){this.queryDelay=10}if(!Ext.isDefined(this.initialConfig.minChars)){this.minChars=0}}},onRender:function(b,a){if(this.hiddenName&&!Ext.isDefined(this.submitValue)){this.submitValue=false}Ext.form.ComboBox.superclass.onRender.call(this,b,a);if(this.hiddenName){this.hiddenField=this.el.insertSibling({tag:"input",type:"hidden",name:this.hiddenName,id:(this.hiddenId||Ext.id())},"before",true)}if(Ext.isGecko){this.el.dom.setAttribute("autocomplete","off")}if(!this.lazyInit){this.initList()}else{this.on("focus",this.initList,this,{single:true})}},initValue:function(){Ext.form.ComboBox.superclass.initValue.call(this);if(this.hiddenField){this.hiddenField.value=Ext.value(Ext.isDefined(this.hiddenValue)?this.hiddenValue:this.value,"")}},getParentZIndex:function(){var a;if(this.ownerCt){this.findParentBy(function(b){a=parseInt(b.getPositionEl().getStyle("z-index"),10);return !!a})}return a},getZIndex:function(b){b=b||Ext.getDom(this.getListParent()||Ext.getBody());var a=parseInt(Ext.fly(b).getStyle("z-index"),10);if(!a){a=this.getParentZIndex()}return(a||12000)+5},initList:function(){if(!this.list){var a="x-combo-list",c=Ext.getDom(this.getListParent()||Ext.getBody());this.list=new Ext.Layer({parentEl:c,shadow:this.shadow,cls:[a,this.listClass].join(" "),constrain:false,zindex:this.getZIndex(c)});var b=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setSize(b,0);this.list.swallowEvent("mousewheel");this.assetHeight=0;if(this.syncFont!==false){this.list.setStyle("font-size",this.el.getStyle("font-size"))}if(this.title){this.header=this.list.createChild({cls:a+"-hd",html:this.title});this.assetHeight+=this.header.getHeight()}this.innerList=this.list.createChild({cls:a+"-inner"});this.mon(this.innerList,"mouseover",this.onViewOver,this);this.mon(this.innerList,"mousemove",this.onViewMove,this);this.innerList.setWidth(b-this.list.getFrameWidth("lr"));if(this.pageSize){this.footer=this.list.createChild({cls:a+"-ft"});this.pageTb=new Ext.PagingToolbar({store:this.store,pageSize:this.pageSize,renderTo:this.footer});this.assetHeight+=this.footer.getHeight()}if(!this.tpl){this.tpl='<tpl for="."><div class="'+a+'-item">{'+this.displayField+"}</div></tpl>"}this.view=new Ext.DataView({applyTo:this.innerList,tpl:this.tpl,singleSelect:true,selectedClass:this.selectedClass,itemSelector:this.itemSelector||"."+a+"-item",emptyText:this.listEmptyText,deferEmptyText:false});this.mon(this.view,{containerclick:this.onViewClick,click:this.onViewClick,scope:this});this.bindStore(this.store,true);if(this.resizable){this.resizer=new Ext.Resizable(this.list,{pinned:true,handles:"se"});this.mon(this.resizer,"resize",function(g,d,e){this.maxHeight=e-this.handleHeight-this.list.getFrameWidth("tb")-this.assetHeight;this.listWidth=d;this.innerList.setWidth(d-this.list.getFrameWidth("lr"));this.restrictHeight()},this);this[this.pageSize?"footer":"innerList"].setStyle("margin-bottom",this.handleHeight+"px")}}},getListParent:function(){return document.body},getStore:function(){return this.store},bindStore:function(a,b){if(this.store&&!b){if(this.store!==a&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.collapse,this)}if(!a){this.store=null;if(this.view){this.view.bindStore(null)}if(this.pageTb){this.pageTb.bindStore(null)}}}if(a){if(!b){this.lastQuery=null;if(this.pageTb){this.pageTb.bindStore(a)}}this.store=Ext.StoreMgr.lookup(a);this.store.on({scope:this,beforeload:this.onBeforeLoad,load:this.onLoad,exception:this.collapse});if(this.view){this.view.bindStore(a)}}},reset:function(){if(this.clearFilterOnReset&&this.mode=="local"){this.store.clearFilter()}Ext.form.ComboBox.superclass.reset.call(this)},initEvents:function(){Ext.form.ComboBox.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{up:function(a){this.inKeyMode=true;this.selectPrev()},down:function(a){if(!this.isExpanded()){this.onTriggerClick()}else{this.inKeyMode=true;this.selectNext()}},enter:function(a){this.onViewClick()},esc:function(a){this.collapse()},tab:function(a){if(this.forceSelection===true){this.collapse()}else{this.onViewClick(false)}return true},scope:this,doRelay:function(c,b,a){if(a=="down"||this.scope.isExpanded()){var d=Ext.KeyNav.prototype.doRelay.apply(this,arguments);if(!Ext.isIE&&Ext.EventManager.useKeydown){this.scope.fireKey(c)}return d}return true},forceKeyDown:true,defaultEventAction:"stopEvent"});this.queryDelay=Math.max(this.queryDelay||10,this.mode=="local"?10:250);this.dqTask=new Ext.util.DelayedTask(this.initQuery,this);if(this.typeAhead){this.taTask=new Ext.util.DelayedTask(this.onTypeAhead,this)}if(!this.enableKeyEvents){this.mon(this.el,"keyup",this.onKeyUp,this)}},onDestroy:function(){if(this.dqTask){this.dqTask.cancel();this.dqTask=null}this.bindStore(null);Ext.destroy(this.resizer,this.view,this.pageTb,this.list);Ext.destroyMembers(this,"hiddenField");Ext.form.ComboBox.superclass.onDestroy.call(this)},fireKey:function(a){if(!this.isExpanded()){Ext.form.ComboBox.superclass.fireKey.call(this,a)}},onResize:function(a,b){Ext.form.ComboBox.superclass.onResize.apply(this,arguments);if(!isNaN(a)&&this.isVisible()&&this.list){this.doResize(a)}else{this.bufferSize=a}},doResize:function(a){if(!Ext.isDefined(this.listWidth)){var b=Math.max(a,this.minListWidth);this.list.setWidth(b);this.innerList.setWidth(b-this.list.getFrameWidth("lr"))}},onEnable:function(){Ext.form.ComboBox.superclass.onEnable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=false}},onDisable:function(){Ext.form.ComboBox.superclass.onDisable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=true}},onBeforeLoad:function(){if(!this.hasFocus){return}this.innerList.update(this.loadingText?'<div class="loading-indicator">'+this.loadingText+"</div>":"");this.restrictHeight();this.selectedIndex=-1},onLoad:function(){if(!this.hasFocus){return}if(this.store.getCount()>0||this.listEmptyText){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable){this.el.dom.select()}if(this.autoSelect!==false&&!this.selectByValue(this.value,true)){this.select(0,true)}}else{if(this.autoSelect!==false){this.selectNext()}if(this.typeAhead&&this.lastKey!=Ext.EventObject.BACKSPACE&&this.lastKey!=Ext.EventObject.DELETE){this.taTask.delay(this.typeAheadDelay)}}}else{this.collapse()}},onTypeAhead:function(){if(this.store.getCount()>0){var b=this.store.getAt(0);var c=b.data[this.displayField];var a=c.length;var d=this.getRawValue().length;if(d!=a){this.setRawValue(c);this.selectText(d,c.length)}}},assertValue:function(){var b=this.getRawValue(),a;if(this.valueField&&Ext.isDefined(this.value)){a=this.findRecord(this.valueField,this.value)}if(!a||a.get(this.displayField)!=b){a=this.findRecord(this.displayField,b)}if(!a&&this.forceSelection){if(b.length>0&&b!=this.emptyText){this.el.dom.value=Ext.value(this.lastSelectionText,"");this.applyEmptyText()}else{this.clearValue()}}else{if(a&&this.valueField){if(this.value==b){return}b=a.get(this.valueField||this.displayField)}this.setValue(b)}},onSelect:function(a,b){if(this.fireEvent("beforeselect",this,a,b)!==false){this.setValue(a.data[this.valueField||this.displayField]);this.collapse();this.fireEvent("select",this,a,b)}},getName:function(){var a=this.hiddenField;return a&&a.name?a.name:this.hiddenName||Ext.form.ComboBox.superclass.getName.call(this)},getValue:function(){if(this.valueField){return Ext.isDefined(this.value)?this.value:""}else{return Ext.form.ComboBox.superclass.getValue.call(this)}},clearValue:function(){if(this.hiddenField){this.hiddenField.value=""}this.setRawValue("");this.lastSelectionText="";this.applyEmptyText();this.value=""},setValue:function(a){var c=a;if(this.valueField){var b=this.findRecord(this.valueField,a);if(b){c=b.data[this.displayField]}else{if(Ext.isDefined(this.valueNotFoundText)){c=this.valueNotFoundText}}}this.lastSelectionText=c;if(this.hiddenField){this.hiddenField.value=Ext.value(a,"")}Ext.form.ComboBox.superclass.setValue.call(this,c);this.value=a;return this},findRecord:function(c,b){var a;if(this.store.getCount()>0){this.store.each(function(d){if(d.data[c]==b){a=d;return false}})}return a},onViewMove:function(b,a){this.inKeyMode=false},onViewOver:function(d,b){if(this.inKeyMode){return}var c=this.view.findItemFromChild(b);if(c){var a=this.view.indexOf(c);this.select(a,false)}},onViewClick:function(b){var a=this.view.getSelectedIndexes()[0],c=this.store,d=c.getAt(a);if(d){this.onSelect(d,a)}else{this.collapse()}if(b!==false){this.el.focus()}},restrictHeight:function(){this.innerList.dom.style.height="";var b=this.innerList.dom,e=this.list.getFrameWidth("tb")+(this.resizable?this.handleHeight:0)+this.assetHeight,c=Math.max(b.clientHeight,b.offsetHeight,b.scrollHeight),a=this.getPosition()[1]-Ext.getBody().getScroll().top,g=Ext.lib.Dom.getViewHeight()-a-this.getSize().height,d=Math.max(a,g,this.minHeight||0)-this.list.shadowOffset-e-5;c=Math.min(c,d,this.maxHeight);this.innerList.setHeight(c);this.list.beginUpdate();this.list.setHeight(c+e);this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign));this.list.endUpdate()},isExpanded:function(){return this.list&&this.list.isVisible()},selectByValue:function(a,c){if(!Ext.isEmpty(a,true)){var b=this.findRecord(this.valueField||this.displayField,a);if(b){this.select(this.store.indexOf(b),c);return true}}return false},select:function(a,c){this.selectedIndex=a;this.view.select(a);if(c!==false){var b=this.view.getNode(a);if(b){this.innerList.scrollChildIntoView(b,false)}}},selectNext:function(){var a=this.store.getCount();if(a>0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex<a-1){this.select(this.selectedIndex+1)}}}},selectPrev:function(){var a=this.store.getCount();if(a>0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex!==0){this.select(this.selectedIndex-1)}}}},onKeyUp:function(b){var a=b.getKey();if(this.editable!==false&&this.readOnly!==true&&(a==b.BACKSPACE||!b.isSpecialKey())){this.lastKey=a;this.dqTask.delay(this.queryDelay)}Ext.form.ComboBox.superclass.onKeyUp.call(this,b)},validateBlur:function(){return !this.list||!this.list.isVisible()},initQuery:function(){this.doQuery(this.getRawValue())},beforeBlur:function(){this.assertValue()},postBlur:function(){Ext.form.ComboBox.superclass.postBlur.call(this);this.collapse();this.inKeyMode=false},doQuery:function(c,b){c=Ext.isEmpty(c)?"":c;var a={query:c,forceAll:b,combo:this,cancel:false};if(this.fireEvent("beforequery",a)===false||a.cancel){return false}c=a.query;b=a.forceAll;if(b===true||(c.length>=this.minChars)){if(this.lastQuery!==c){this.lastQuery=c;if(this.mode=="local"){this.selectedIndex=-1;if(b){this.store.clearFilter()}else{this.store.filter(this.displayField,c)}this.onLoad()}else{this.store.baseParams[this.queryParam]=c;this.store.load({params:this.getParams(c)});this.expand()}}else{this.selectedIndex=-1;this.onLoad()}}},getParams:function(a){var b={},c=this.store.paramNames;if(this.pageSize){b[c.start]=0;b[c.limit]=this.pageSize}return b},collapse:function(){if(!this.isExpanded()){return}this.list.hide();Ext.getDoc().un("mousewheel",this.collapseIf,this);Ext.getDoc().un("mousedown",this.collapseIf,this);this.fireEvent("collapse",this)},collapseIf:function(a){if(!this.isDestroyed&&!a.within(this.wrap)&&!a.within(this.list)){this.collapse()}},expand:function(){if(this.isExpanded()||!this.hasFocus){return}if(this.title||this.pageSize){this.assetHeight=0;if(this.title){this.assetHeight+=this.header.getHeight()}if(this.pageSize){this.assetHeight+=this.footer.getHeight()}}if(this.bufferSize){this.doResize(this.bufferSize);delete this.bufferSize}this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign));this.list.setZIndex(this.getZIndex());this.list.show();if(Ext.isGecko2){this.innerList.setOverflow("auto")}this.mon(Ext.getDoc(),{scope:this,mousewheel:this.collapseIf,mousedown:this.collapseIf});this.fireEvent("expand",this)},onTriggerClick:function(){if(this.readOnly||this.disabled){return}if(this.isExpanded()){this.collapse();this.el.focus()}else{this.onFocus({});if(this.triggerAction=="all"){this.doQuery(this.allQuery,true)}else{this.doQuery(this.getRawValue())}this.el.focus()}}});Ext.reg("combo",Ext.form.ComboBox);Ext.form.Checkbox=Ext.extend(Ext.form.Field,{focusClass:undefined,fieldClass:"x-form-field",checked:false,boxLabel:"&#160;",defaultAutoCreate:{tag:"input",type:"checkbox",autocomplete:"off"},actionMode:"wrap",initComponent:function(){Ext.form.Checkbox.superclass.initComponent.call(this);this.addEvents("check")},onResize:function(){Ext.form.Checkbox.superclass.onResize.apply(this,arguments);if(!this.boxLabel&&!this.fieldLabel){this.el.alignTo(this.wrap,"c-c")}},initEvents:function(){Ext.form.Checkbox.superclass.initEvents.call(this);this.mon(this.el,{scope:this,click:this.onClick,change:this.onClick})},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,onRender:function(b,a){Ext.form.Checkbox.superclass.onRender.call(this,b,a);if(this.inputValue!==undefined){this.el.dom.value=this.inputValue}this.wrap=this.el.wrap({cls:"x-form-check-wrap"});if(this.boxLabel){this.wrap.createChild({tag:"label",htmlFor:this.el.id,cls:"x-form-cb-label",html:this.boxLabel})}if(this.checked){this.setValue(true)}else{this.checked=this.el.dom.checked}if(Ext.isIE&&!Ext.isStrict){this.wrap.repaint()}this.resizeEl=this.positionEl=this.wrap},onDestroy:function(){Ext.destroy(this.wrap);Ext.form.Checkbox.superclass.onDestroy.call(this)},initValue:function(){this.originalValue=this.getValue()},getValue:function(){if(this.rendered){return this.el.dom.checked}return this.checked},onClick:function(){if(this.el.dom.checked!=this.checked){this.setValue(this.el.dom.checked)}},setValue:function(a){var c=this.checked,b=this.inputValue;if(a===false){this.checked=false}else{this.checked=(a===true||a==="true"||a=="1"||(b?a==b:String(a).toLowerCase()=="on"))}if(this.rendered){this.el.dom.checked=this.checked;this.el.dom.defaultChecked=this.checked}if(c!=this.checked){this.fireEvent("check",this,this.checked);if(this.handler){this.handler.call(this.scope||this,this,this.checked)}}return this}});Ext.reg("checkbox",Ext.form.Checkbox);Ext.form.CheckboxGroup=Ext.extend(Ext.form.Field,{columns:"auto",vertical:false,allowBlank:true,blankText:"You must select at least one item in this group",defaultType:"checkbox",groupCls:"x-form-check-group",initComponent:function(){this.addEvents("change");this.on("change",this.validate,this);Ext.form.CheckboxGroup.superclass.initComponent.call(this)},onRender:function(j,g){if(!this.el){var p={autoEl:{id:this.id},cls:this.groupCls,layout:"column",renderTo:j,bufferResize:false};var a={xtype:"container",defaultType:this.defaultType,layout:"form",defaults:{hideLabel:true,anchor:"100%"}};if(this.items[0].items){Ext.apply(p,{layoutConfig:{columns:this.items.length},defaults:this.defaults,items:this.items});for(var e=0,m=this.items.length;e<m;e++){Ext.applyIf(this.items[e],a)}}else{var d,n=[];if(typeof this.columns=="string"){this.columns=this.items.length}if(!Ext.isArray(this.columns)){var k=[];for(var e=0;e<this.columns;e++){k.push((100/this.columns)*0.01)}this.columns=k}d=this.columns.length;for(var e=0;e<d;e++){var b=Ext.apply({items:[]},a);b[this.columns[e]<=1?"columnWidth":"width"]=this.columns[e];if(this.defaults){b.defaults=Ext.apply(b.defaults||{},this.defaults)}n.push(b)}if(this.vertical){var r=Math.ceil(this.items.length/d),o=0;for(var e=0,m=this.items.length;e<m;e++){if(e>0&&e%r==0){o++}if(this.items[e].fieldLabel){this.items[e].hideLabel=false}n[o].items.push(this.items[e])}}else{for(var e=0,m=this.items.length;e<m;e++){var q=e%d;if(this.items[e].fieldLabel){this.items[e].hideLabel=false}n[q].items.push(this.items[e])}}Ext.apply(p,{layoutConfig:{columns:d},items:n})}this.panel=new Ext.Container(p);this.panel.ownerCt=this;this.el=this.panel.getEl();if(this.forId&&this.itemCls){var c=this.el.up(this.itemCls).child("label",true);if(c){c.setAttribute("htmlFor",this.forId)}}var h=this.panel.findBy(function(i){return i.isFormField},this);this.items=new Ext.util.MixedCollection();this.items.addAll(h)}Ext.form.CheckboxGroup.superclass.onRender.call(this,j,g)},initValue:function(){if(this.value){this.setValue.apply(this,this.buffered?this.value:[this.value]);delete this.buffered;delete this.value}},afterRender:function(){Ext.form.CheckboxGroup.superclass.afterRender.call(this);this.eachItem(function(a){a.on("check",this.fireChecked,this);a.inGroup=true})},doLayout:function(){if(this.rendered){this.panel.forceLayout=this.ownerCt.forceLayout;this.panel.doLayout()}},fireChecked:function(){var a=[];this.eachItem(function(b){if(b.checked){a.push(b)}});this.fireEvent("change",this,a)},getErrors:function(){var b=Ext.form.CheckboxGroup.superclass.getErrors.apply(this,arguments);if(!this.allowBlank){var a=true;this.eachItem(function(c){if(c.checked){return(a=false)}});if(a){b.push(this.blankText)}}return b},isDirty:function(){if(this.disabled||!this.rendered){return false}var a=false;this.eachItem(function(b){if(b.isDirty()){a=true;return false}});return a},setReadOnly:function(a){if(this.rendered){this.eachItem(function(b){b.setReadOnly(a)})}this.readOnly=a},onDisable:function(){this.eachItem(function(a){a.disable()})},onEnable:function(){this.eachItem(function(a){a.enable()})},onResize:function(a,b){this.panel.setSize(a,b);this.panel.doLayout()},reset:function(){if(this.originalValue){this.eachItem(function(a){if(a.setValue){a.setValue(false);a.originalValue=a.getValue()}});this.resetOriginal=true;this.setValue(this.originalValue);delete this.resetOriginal}else{this.eachItem(function(a){if(a.reset){a.reset()}})}(function(){this.clearInvalid()}).defer(50,this)},setValue:function(){if(this.rendered){this.onSetValue.apply(this,arguments)}else{this.buffered=true;this.value=arguments}return this},onSetValue:function(d,c){if(arguments.length==1){if(Ext.isArray(d)){Ext.each(d,function(h,e){if(Ext.isObject(h)&&h.setValue){h.setValue(true);if(this.resetOriginal===true){h.originalValue=h.getValue()}}else{var g=this.items.itemAt(e);if(g){g.setValue(h)}}},this)}else{if(Ext.isObject(d)){for(var a in d){var b=this.getBox(a);if(b){b.setValue(d[a])}}}else{this.setValueForItem(d)}}}else{var b=this.getBox(d);if(b){b.setValue(c)}}},beforeDestroy:function(){Ext.destroy(this.panel);if(!this.rendered){Ext.destroy(this.items)}Ext.form.CheckboxGroup.superclass.beforeDestroy.call(this)},setValueForItem:function(a){a=String(a).split(",");this.eachItem(function(b){if(a.indexOf(b.inputValue)>-1){b.setValue(true)}})},getBox:function(b){var a=null;this.eachItem(function(c){if(b==c||c.dataIndex==b||c.id==b||c.getName()==b){a=c;return false}});return a},getValue:function(){var a=[];this.eachItem(function(b){if(b.checked){a.push(b)}});return a},eachItem:function(b,a){if(this.items&&this.items.each){this.items.each(b,a||this)}},getRawValue:Ext.emptyFn,setRawValue:Ext.emptyFn});Ext.reg("checkboxgroup",Ext.form.CheckboxGroup);Ext.form.CompositeField=Ext.extend(Ext.form.Field,{defaultMargins:"0 5 0 0",skipLastItemMargin:true,isComposite:true,combineErrors:true,labelConnector:", ",initComponent:function(){var g=[],b=this.items,e;for(var d=0,c=b.length;d<c;d++){e=b[d];if(!Ext.isEmpty(e.ref)){e.ref="../"+e.ref}g.push(e.fieldLabel);Ext.applyIf(e,this.defaults);if(!(d==c-1&&this.skipLastItemMargin)){Ext.applyIf(e,{margins:this.defaultMargins})}}this.fieldLabel=this.fieldLabel||this.buildLabel(g);this.fieldErrors=new Ext.util.MixedCollection(true,function(h){return h.field});this.fieldErrors.on({scope:this,add:this.updateInvalidMark,remove:this.updateInvalidMark,replace:this.updateInvalidMark});Ext.form.CompositeField.superclass.initComponent.apply(this,arguments);this.innerCt=new Ext.Container({layout:"hbox",items:this.items,cls:"x-form-composite",defaultMargins:"0 3 0 0",ownerCt:this});this.innerCt.ownerCt=undefined;var a=this.innerCt.findBy(function(h){return h.isFormField},this);this.items=new Ext.util.MixedCollection();this.items.addAll(a)},onRender:function(c,a){if(!this.el){var d=this.innerCt;d.render(c);this.el=d.getEl();if(this.combineErrors){this.eachItem(function(e){Ext.apply(e,{markInvalid:this.onFieldMarkInvalid.createDelegate(this,[e],0),clearInvalid:this.onFieldClearInvalid.createDelegate(this,[e],0)})})}var b=this.el.parent().parent().child("label",true);if(b){b.setAttribute("for",this.items.items[0].id)}}Ext.form.CompositeField.superclass.onRender.apply(this,arguments)},onFieldMarkInvalid:function(d,c){var b=d.getName(),a={field:b,errorName:d.fieldLabel||b,error:c};this.fieldErrors.replace(b,a);if(!d.preventMark){d.el.addClass(d.invalidClass)}},onFieldClearInvalid:function(a){this.fieldErrors.removeKey(a.getName());a.el.removeClass(a.invalidClass)},updateInvalidMark:function(){var a=Ext.isIE6&&Ext.isStrict;if(this.fieldErrors.length==0){this.clearInvalid();if(a){this.clearInvalid.defer(50,this)}}else{var b=this.buildCombinedErrorMessage(this.fieldErrors.items);this.sortErrors();this.markInvalid(b);if(a){this.markInvalid(b)}}},validateValue:function(c,a){var b=true;this.eachItem(function(d){if(!d.isValid(a)){b=false}});return b},buildCombinedErrorMessage:function(e){var d=[],b;for(var c=0,a=e.length;c<a;c++){b=e[c];d.push(String.format("{0}: {1}",b.errorName,b.error))}return d.join("<br />")},sortErrors:function(){var a=this.items;this.fieldErrors.sort("ASC",function(g,d){var c=function(b){return function(i){return i.getName()==b}};var h=a.findIndexBy(c(g.field)),e=a.findIndexBy(c(d.field));return h<e?-1:1})},reset:function(){this.eachItem(function(a){a.reset()});(function(){this.clearInvalid()}).defer(50,this)},clearInvalidChildren:function(){this.eachItem(function(a){a.clearInvalid()})},buildLabel:function(a){return Ext.clean(a).join(this.labelConnector)},isDirty:function(){if(this.disabled||!this.rendered){return false}var a=false;this.eachItem(function(b){if(b.isDirty()){a=true;return false}});return a},eachItem:function(b,a){if(this.items&&this.items.each){this.items.each(b,a||this)}},onResize:function(e,c,a,d){var b=this.innerCt;if(this.rendered&&b.rendered){b.setSize(e,c)}Ext.form.CompositeField.superclass.onResize.apply(this,arguments)},doLayout:function(c,b){if(this.rendered){var a=this.innerCt;a.forceLayout=this.ownerCt.forceLayout;a.doLayout(c,b)}},beforeDestroy:function(){Ext.destroy(this.innerCt);Ext.form.CompositeField.superclass.beforeDestroy.call(this)},setReadOnly:function(a){if(a==undefined){a=true}a=!!a;if(this.rendered){this.eachItem(function(b){b.setReadOnly(a)})}this.readOnly=a},onShow:function(){Ext.form.CompositeField.superclass.onShow.call(this);this.doLayout()},onDisable:function(){this.eachItem(function(a){a.disable()})},onEnable:function(){this.eachItem(function(a){a.enable()})}});Ext.reg("compositefield",Ext.form.CompositeField);Ext.form.Radio=Ext.extend(Ext.form.Checkbox,{inputType:"radio",markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,getGroupValue:function(){var a=this.el.up("form")||Ext.getBody();var b=a.child('input[name="'+this.el.dom.name+'"]:checked',true);return b?b.value:null},setValue:function(b){var a,d,c;if(typeof b=="boolean"){Ext.form.Radio.superclass.setValue.call(this,b)}else{if(this.rendered){a=this.getCheckEl();c=a.child('input[name="'+this.el.dom.name+'"][value="'+b+'"]',true);if(c){Ext.getCmp(c.id).setValue(true)}}}if(this.rendered&&this.checked){a=a||this.getCheckEl();d=this.getCheckEl().select('input[name="'+this.el.dom.name+'"]');d.each(function(e){if(e.dom.id!=this.id){Ext.getCmp(e.dom.id).setValue(false)}},this)}return this},getCheckEl:function(){if(this.inGroup){return this.el.up(".x-form-radio-group")}return this.el.up("form")||Ext.getBody()}});Ext.reg("radio",Ext.form.Radio);Ext.form.RadioGroup=Ext.extend(Ext.form.CheckboxGroup,{allowBlank:true,blankText:"You must select one item in this group",defaultType:"radio",groupCls:"x-form-radio-group",getValue:function(){var a=null;this.eachItem(function(b){if(b.checked){a=b;return false}});return a},onSetValue:function(c,b){if(arguments.length>1){var a=this.getBox(c);if(a){a.setValue(b);if(a.checked){this.eachItem(function(d){if(d!==a){d.setValue(false)}})}}}else{this.setValueForItem(c)}},setValueForItem:function(a){a=String(a).split(",")[0];this.eachItem(function(b){b.setValue(a==b.inputValue)})},fireChecked:function(){if(!this.checkTask){this.checkTask=new Ext.util.DelayedTask(this.bufferChecked,this)}this.checkTask.delay(10)},bufferChecked:function(){var a=null;this.eachItem(function(b){if(b.checked){a=b;return false}});this.fireEvent("change",this,a)},onDestroy:function(){if(this.checkTask){this.checkTask.cancel();this.checkTask=null}Ext.form.RadioGroup.superclass.onDestroy.call(this)}});Ext.reg("radiogroup",Ext.form.RadioGroup);Ext.form.Hidden=Ext.extend(Ext.form.Field,{inputType:"hidden",shouldLayout:false,onRender:function(){Ext.form.Hidden.superclass.onRender.apply(this,arguments)},initEvents:function(){this.originalValue=this.getValue()},setSize:Ext.emptyFn,setWidth:Ext.emptyFn,setHeight:Ext.emptyFn,setPosition:Ext.emptyFn,setPagePosition:Ext.emptyFn,markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn});Ext.reg("hidden",Ext.form.Hidden);Ext.form.BasicForm=Ext.extend(Ext.util.Observable,{constructor:function(b,a){Ext.apply(this,a);if(Ext.isString(this.paramOrder)){this.paramOrder=this.paramOrder.split(/[\s,|]/)}this.items=new Ext.util.MixedCollection(false,function(c){return c.getItemId()});this.addEvents("beforeaction","actionfailed","actioncomplete");if(b){this.initEl(b)}Ext.form.BasicForm.superclass.constructor.call(this)},timeout:30,paramOrder:undefined,paramsAsHash:false,waitTitle:"Please Wait...",activeAction:null,trackResetOnLoad:false,initEl:function(a){this.el=Ext.get(a);this.id=this.el.id||Ext.id();if(!this.standardSubmit){this.el.on("submit",this.onSubmit,this)}this.el.addClass("x-form")},getEl:function(){return this.el},onSubmit:function(a){a.stopEvent()},destroy:function(a){if(a!==true){this.items.each(function(b){Ext.destroy(b)});Ext.destroy(this.el)}this.items.clear();this.purgeListeners()},isValid:function(){var a=true;this.items.each(function(b){if(!b.validate()){a=false}});return a},isDirty:function(){var a=false;this.items.each(function(b){if(b.isDirty()){a=true;return false}});return a},doAction:function(b,a){if(Ext.isString(b)){b=new Ext.form.Action.ACTION_TYPES[b](this,a)}if(this.fireEvent("beforeaction",this,b)!==false){this.beforeAction(b);b.run.defer(100,b)}return this},submit:function(b){b=b||{};if(this.standardSubmit){var a=b.clientValidation===false||this.isValid();if(a){var c=this.el.dom;if(this.url&&Ext.isEmpty(c.action)){c.action=this.url}c.submit()}return a}var d=String.format("{0}submit",this.api?"direct":"");this.doAction(d,b);return this},load:function(a){var b=String.format("{0}load",this.api?"direct":"");this.doAction(b,a);return this},updateRecord:function(b){b.beginEdit();var a=b.fields,d,c;a.each(function(e){d=this.findField(e.name);if(d){c=d.getValue();if(Ext.type(c)!==false&&c.getGroupValue){c=c.getGroupValue()}else{if(d.eachItem){c=[];d.eachItem(function(g){c.push(g.getValue())})}}b.set(e.name,c)}},this);b.endEdit();return this},loadRecord:function(a){this.setValues(a.data);return this},beforeAction:function(a){this.items.each(function(c){if(c.isFormField&&c.syncValue){c.syncValue()}});var b=a.options;if(b.waitMsg){if(this.waitMsgTarget===true){this.el.mask(b.waitMsg,"x-mask-loading")}else{if(this.waitMsgTarget){this.waitMsgTarget=Ext.get(this.waitMsgTarget);this.waitMsgTarget.mask(b.waitMsg,"x-mask-loading")}else{Ext.MessageBox.wait(b.waitMsg,b.waitTitle||this.waitTitle)}}}},afterAction:function(a,c){this.activeAction=null;var b=a.options;if(b.waitMsg){if(this.waitMsgTarget===true){this.el.unmask()}else{if(this.waitMsgTarget){this.waitMsgTarget.unmask()}else{Ext.MessageBox.updateProgress(1);Ext.MessageBox.hide()}}}if(c){if(b.reset){this.reset()}Ext.callback(b.success,b.scope,[this,a]);this.fireEvent("actioncomplete",this,a)}else{Ext.callback(b.failure,b.scope,[this,a]);this.fireEvent("actionfailed",this,a)}},findField:function(c){var b=this.items.get(c);if(!Ext.isObject(b)){var a=function(d){if(d.isFormField){if(d.dataIndex==c||d.id==c||d.getName()==c){b=d;return false}else{if(d.isComposite){return d.items.each(a)}else{if(d instanceof Ext.form.CheckboxGroup&&d.rendered){return d.eachItem(a)}}}}};this.items.each(a)}return b||null},markInvalid:function(h){if(Ext.isArray(h)){for(var c=0,a=h.length;c<a;c++){var b=h[c];var d=this.findField(b.id);if(d){d.markInvalid(b.msg)}}}else{var e,g;for(g in h){if(!Ext.isFunction(h[g])&&(e=this.findField(g))){e.markInvalid(h[g])}}}return this},setValues:function(c){if(Ext.isArray(c)){for(var d=0,a=c.length;d<a;d++){var b=c[d];var e=this.findField(b.id);if(e){e.setValue(b.value);if(this.trackResetOnLoad){e.originalValue=e.getValue()}}}}else{var g,h;for(h in c){if(!Ext.isFunction(c[h])&&(g=this.findField(h))){g.setValue(c[h]);if(this.trackResetOnLoad){g.originalValue=g.getValue()}}}}return this},getValues:function(b){var a=Ext.lib.Ajax.serializeForm(this.el.dom);if(b===true){return a}return Ext.urlDecode(a)},getFieldValues:function(a){var d={},e,b,c;this.items.each(function(g){if(!g.disabled&&(a!==true||g.isDirty())){e=g.getName();b=d[e];c=g.getValue();if(Ext.isDefined(b)){if(Ext.isArray(b)){d[e].push(c)}else{d[e]=[b,c]}}else{d[e]=c}}});return d},clearInvalid:function(){this.items.each(function(a){a.clearInvalid()});return this},reset:function(){this.items.each(function(a){a.reset()});return this},add:function(){this.items.addAll(Array.prototype.slice.call(arguments,0));return this},remove:function(a){this.items.remove(a);return this},cleanDestroyed:function(){this.items.filterBy(function(a){return !!a.isDestroyed}).each(this.remove,this)},render:function(){this.items.each(function(a){if(a.isFormField&&!a.rendered&&document.getElementById(a.id)){a.applyToMarkup(a.id)}});return this},applyToFields:function(a){this.items.each(function(b){Ext.apply(b,a)});return this},applyIfToFields:function(a){this.items.each(function(b){Ext.applyIf(b,a)});return this},callFieldMethod:function(b,a){a=a||[];this.items.each(function(c){if(Ext.isFunction(c[b])){c[b].apply(c,a)}});return this}});Ext.BasicForm=Ext.form.BasicForm;Ext.FormPanel=Ext.extend(Ext.Panel,{minButtonWidth:75,labelAlign:"left",monitorValid:false,monitorPoll:200,layout:"form",initComponent:function(){this.form=this.createForm();Ext.FormPanel.superclass.initComponent.call(this);this.bodyCfg={tag:"form",cls:this.baseCls+"-body",method:this.method||"POST",id:this.formId||Ext.id()};if(this.fileUpload){this.bodyCfg.enctype="multipart/form-data"}this.initItems();this.addEvents("clientvalidation");this.relayEvents(this.form,["beforeaction","actionfailed","actioncomplete"])},createForm:function(){var a=Ext.applyIf({listeners:{}},this.initialConfig);return new Ext.form.BasicForm(null,a)},initFields:function(){var c=this.form;var a=this;var b=function(d){if(a.isField(d)){c.add(d)}else{if(d.findBy&&d!=a){a.applySettings(d);if(d.items&&d.items.each){d.items.each(b,this)}}}};this.items.each(b,this)},applySettings:function(b){var a=b.ownerCt;Ext.applyIf(b,{labelAlign:a.labelAlign,labelWidth:a.labelWidth,itemCls:a.itemCls})},getLayoutTarget:function(){return this.form.el},getForm:function(){return this.form},onRender:function(b,a){this.initFields();Ext.FormPanel.superclass.onRender.call(this,b,a);this.form.initEl(this.body)},beforeDestroy:function(){this.stopMonitoring();this.form.destroy(true);Ext.FormPanel.superclass.beforeDestroy.call(this)},isField:function(a){return !!a.setValue&&!!a.getValue&&!!a.markInvalid&&!!a.clearInvalid},initEvents:function(){Ext.FormPanel.superclass.initEvents.call(this);this.on({scope:this,add:this.onAddEvent,remove:this.onRemoveEvent});if(this.monitorValid){this.startMonitoring()}},onAdd:function(a){Ext.FormPanel.superclass.onAdd.call(this,a);this.processAdd(a)},onAddEvent:function(a,b){if(a!==this){this.processAdd(b)}},processAdd:function(a){if(this.isField(a)){this.form.add(a)}else{if(a.findBy){this.applySettings(a);this.form.add.apply(this.form,a.findBy(this.isField))}}},onRemove:function(a){Ext.FormPanel.superclass.onRemove.call(this,a);this.processRemove(a)},onRemoveEvent:function(a,b){if(a!==this){this.processRemove(b)}},processRemove:function(a){if(!this.destroying){if(this.isField(a)){this.form.remove(a)}else{if(a.findBy){Ext.each(a.findBy(this.isField),this.form.remove,this.form);this.form.cleanDestroyed()}}}},startMonitoring:function(){if(!this.validTask){this.validTask=new Ext.util.TaskRunner();this.validTask.start({run:this.bindHandler,interval:this.monitorPoll||200,scope:this})}},stopMonitoring:function(){if(this.validTask){this.validTask.stopAll();this.validTask=null}},load:function(){this.form.load.apply(this.form,arguments)},onDisable:function(){Ext.FormPanel.superclass.onDisable.call(this);if(this.form){this.form.items.each(function(){this.disable()})}},onEnable:function(){Ext.FormPanel.superclass.onEnable.call(this);if(this.form){this.form.items.each(function(){this.enable()})}},bindHandler:function(){var e=true;this.form.items.each(function(g){if(!g.isValid(true)){e=false;return false}});if(this.fbar){var b=this.fbar.items.items;for(var d=0,a=b.length;d<a;d++){var c=b[d];if(c.formBind===true&&c.disabled===e){c.setDisabled(!e)}}}this.fireEvent("clientvalidation",this,e)}});Ext.reg("form",Ext.FormPanel);Ext.form.FormPanel=Ext.FormPanel;Ext.form.FieldSet=Ext.extend(Ext.Panel,{baseCls:"x-fieldset",layout:"form",animCollapse:false,onRender:function(b,a){if(!this.el){this.el=document.createElement("fieldset");this.el.id=this.id;if(this.title||this.header||this.checkboxToggle){this.el.appendChild(document.createElement("legend")).className=this.baseCls+"-header"}}Ext.form.FieldSet.superclass.onRender.call(this,b,a);if(this.checkboxToggle){var c=typeof this.checkboxToggle=="object"?this.checkboxToggle:{tag:"input",type:"checkbox",name:this.checkboxName||this.id+"-checkbox"};this.checkbox=this.header.insertFirst(c);this.checkbox.dom.checked=!this.collapsed;this.mon(this.checkbox,"click",this.onCheckClick,this)}},onCollapse:function(a,b){if(this.checkbox){this.checkbox.dom.checked=false}Ext.form.FieldSet.superclass.onCollapse.call(this,a,b)},onExpand:function(a,b){if(this.checkbox){this.checkbox.dom.checked=true}Ext.form.FieldSet.superclass.onExpand.call(this,a,b)},onCheckClick:function(){this[this.checkbox.dom.checked?"expand":"collapse"]()}});Ext.reg("fieldset",Ext.form.FieldSet);Ext.form.HtmlEditor=Ext.extend(Ext.form.Field,{enableFormat:true,enableFontSize:true,enableColors:true,enableAlignments:true,enableLists:true,enableSourceEdit:true,enableLinks:true,enableFont:true,createLinkText:"Please enter the URL for the link:",defaultLinkValue:"http://",fontFamilies:["Arial","Courier New","Tahoma","Times New Roman","Verdana"],defaultFont:"tahoma",defaultValue:(Ext.isOpera||Ext.isIE6)?"&#160;":"&#8203;",actionMode:"wrap",validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Ext.emptyFn,iframePad:3,hideMode:"offsets",defaultAutoCreate:{tag:"textarea",style:"width:500px;height:300px;",autocomplete:"off"},initComponent:function(){this.addEvents("initialize","activate","beforesync","beforepush","sync","push","editmodechange");Ext.form.HtmlEditor.superclass.initComponent.call(this)},createFontOptions:function(){var d=[],b=this.fontFamilies,c,g;for(var e=0,a=b.length;e<a;e++){c=b[e];g=c.toLowerCase();d.push('<option value="',g,'" style="font-family:',c,';"',(this.defaultFont==g?' selected="true">':">"),c,"</option>")}return d.join("")},createToolbar:function(e){var c=[];var a=Ext.QuickTips&&Ext.QuickTips.isEnabled();function d(j,h,i){return{itemId:j,cls:"x-btn-icon",iconCls:"x-edit-"+j,enableToggle:h!==false,scope:e,handler:i||e.relayBtnCmd,clickEvent:"mousedown",tooltip:a?e.buttonTips[j]||undefined:undefined,overflowText:e.buttonTips[j].title||undefined,tabIndex:-1}}if(this.enableFont&&!Ext.isSafari2){var g=new Ext.Toolbar.Item({autoEl:{tag:"select",cls:"x-font-select",html:this.createFontOptions()}});c.push(g,"-")}if(this.enableFormat){c.push(d("bold"),d("italic"),d("underline"))}if(this.enableFontSize){c.push("-",d("increasefontsize",false,this.adjustFont),d("decreasefontsize",false,this.adjustFont))}if(this.enableColors){c.push("-",{itemId:"forecolor",cls:"x-btn-icon",iconCls:"x-edit-forecolor",clickEvent:"mousedown",tooltip:a?e.buttonTips.forecolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({allowReselect:true,focus:Ext.emptyFn,value:"000000",plain:true,listeners:{scope:this,select:function(i,h){this.execCmd("forecolor",Ext.isWebKit||Ext.isIE?"#"+h:h);this.deferFocus()}},clickEvent:"mousedown"})},{itemId:"backcolor",cls:"x-btn-icon",iconCls:"x-edit-backcolor",clickEvent:"mousedown",tooltip:a?e.buttonTips.backcolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({focus:Ext.emptyFn,value:"FFFFFF",plain:true,allowReselect:true,listeners:{scope:this,select:function(i,h){if(Ext.isGecko){this.execCmd("useCSS",false);this.execCmd("hilitecolor",h);this.execCmd("useCSS",true);this.deferFocus()}else{this.execCmd(Ext.isOpera?"hilitecolor":"backcolor",Ext.isWebKit||Ext.isIE?"#"+h:h);this.deferFocus()}}},clickEvent:"mousedown"})})}if(this.enableAlignments){c.push("-",d("justifyleft"),d("justifycenter"),d("justifyright"))}if(!Ext.isSafari2){if(this.enableLinks){c.push("-",d("createlink",false,this.createLink))}if(this.enableLists){c.push("-",d("insertorderedlist"),d("insertunorderedlist"))}if(this.enableSourceEdit){c.push("-",d("sourceedit",true,function(h){this.toggleSourceEdit(!this.sourceEditMode)}))}}var b=new Ext.Toolbar({renderTo:this.wrap.dom.firstChild,items:c});if(g){this.fontSelect=g.el;this.mon(this.fontSelect,"change",function(){var h=this.fontSelect.dom.value;this.relayCmd("fontname",h);this.deferFocus()},this)}this.mon(b.el,"click",function(h){h.preventDefault()});this.tb=b;this.tb.doLayout()},onDisable:function(){this.wrap.mask();Ext.form.HtmlEditor.superclass.onDisable.call(this)},onEnable:function(){this.wrap.unmask();Ext.form.HtmlEditor.superclass.onEnable.call(this)},setReadOnly:function(b){Ext.form.HtmlEditor.superclass.setReadOnly.call(this,b);if(this.initialized){if(Ext.isIE){this.getEditorBody().contentEditable=!b}else{this.setDesignMode(!b)}var a=this.getEditorBody();if(a){a.style.cursor=this.readOnly?"default":"text"}this.disableItems(b)}},getDocMarkup:function(){var a=Ext.fly(this.iframe).getHeight()-this.iframePad*2;return String.format('<html><head><style type="text/css">body{border: 0; margin: 0; padding: {0}px; height: {1}px; cursor: text}</style></head><body></body></html>',this.iframePad,a)},getEditorBody:function(){var a=this.getDoc();return a.body||a.documentElement},getDoc:function(){return Ext.isIE?this.getWin().document:(this.iframe.contentDocument||this.getWin().document)},getWin:function(){return Ext.isIE?this.iframe.contentWindow:window.frames[this.iframe.name]},onRender:function(b,a){Ext.form.HtmlEditor.superclass.onRender.call(this,b,a);this.el.dom.style.border="0 none";this.el.dom.setAttribute("tabIndex",-1);this.el.addClass("x-hidden");if(Ext.isIE){this.el.applyStyles("margin-top:-1px;margin-bottom:-1px;")}this.wrap=this.el.wrap({cls:"x-html-editor-wrap",cn:{cls:"x-html-editor-tb"}});this.createToolbar(this);this.disableItems(true);this.tb.doLayout();this.createIFrame();if(!this.width){var c=this.el.getSize();this.setSize(c.width,this.height||c.height)}this.resizeEl=this.positionEl=this.wrap},createIFrame:function(){var a=document.createElement("iframe");a.name=Ext.id();a.frameBorder="0";a.style.overflow="auto";a.src=Ext.SSL_SECURE_URL;this.wrap.dom.appendChild(a);this.iframe=a;this.monitorTask=Ext.TaskMgr.start({run:this.checkDesignMode,scope:this,interval:100})},initFrame:function(){Ext.TaskMgr.stop(this.monitorTask);var b=this.getDoc();this.win=this.getWin();b.open();b.write(this.getDocMarkup());b.close();var a={run:function(){var c=this.getDoc();if(c.body||c.readyState=="complete"){Ext.TaskMgr.stop(a);this.setDesignMode(true);this.initEditor.defer(10,this)}},interval:10,duration:10000,scope:this};Ext.TaskMgr.start(a)},checkDesignMode:function(){if(this.wrap&&this.wrap.dom.offsetWidth){var a=this.getDoc();if(!a){return}if(!a.editorInitialized||this.getDesignMode()!="on"){this.initFrame()}}},setDesignMode:function(b){var a=this.getDoc();if(a){if(this.readOnly){b=false}a.designMode=(/on|true/i).test(String(b).toLowerCase())?"on":"off"}},getDesignMode:function(){var a=this.getDoc();if(!a){return""}return String(a.designMode).toLowerCase()},disableItems:function(a){if(this.fontSelect){this.fontSelect.dom.disabled=a}this.tb.items.each(function(b){if(b.getItemId()!="sourceedit"){b.setDisabled(a)}})},onResize:function(b,c){Ext.form.HtmlEditor.superclass.onResize.apply(this,arguments);if(this.el&&this.iframe){if(Ext.isNumber(b)){var e=b-this.wrap.getFrameWidth("lr");this.el.setWidth(e);this.tb.setWidth(e);this.iframe.style.width=Math.max(e,0)+"px"}if(Ext.isNumber(c)){var a=c-this.wrap.getFrameWidth("tb")-this.tb.el.getHeight();this.el.setHeight(a);this.iframe.style.height=Math.max(a,0)+"px";var d=this.getEditorBody();if(d){d.style.height=Math.max((a-(this.iframePad*2)),0)+"px"}}}},toggleSourceEdit:function(b){var d,a;if(b===undefined){b=!this.sourceEditMode}this.sourceEditMode=b===true;var c=this.tb.getComponent("sourceedit");if(c.pressed!==this.sourceEditMode){c.toggle(this.sourceEditMode);if(!c.xtbHidden){return}}if(this.sourceEditMode){this.previousSize=this.getSize();d=Ext.get(this.iframe).getHeight();this.disableItems(true);this.syncValue();this.iframe.className="x-hidden";this.el.removeClass("x-hidden");this.el.dom.removeAttribute("tabIndex");this.el.focus();this.el.dom.style.height=d+"px"}else{a=parseInt(this.el.dom.style.height,10);if(this.initialized){this.disableItems(this.readOnly)}this.pushValue();this.iframe.className="";this.el.addClass("x-hidden");this.el.dom.setAttribute("tabIndex",-1);this.deferFocus();this.setSize(this.previousSize);delete this.previousSize;this.iframe.style.height=a+"px"}this.fireEvent("editmodechange",this,this.sourceEditMode)},createLink:function(){var a=prompt(this.createLinkText,this.defaultLinkValue);if(a&&a!="http://"){this.relayCmd("createlink",a)}},initEvents:function(){this.originalValue=this.getValue()},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,setValue:function(a){Ext.form.HtmlEditor.superclass.setValue.call(this,a);this.pushValue();return this},cleanHtml:function(a){a=String(a);if(Ext.isWebKit){a=a.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,"")}if(a.charCodeAt(0)==this.defaultValue.replace(/\D/g,"")){a=a.substring(1)}return a},syncValue:function(){if(this.initialized){var d=this.getEditorBody();var c=d.innerHTML;if(Ext.isWebKit){var b=d.getAttribute("style");var a=b.match(/text-align:(.*?);/i);if(a&&a[1]){c='<div style="'+a[0]+'">'+c+"</div>"}}c=this.cleanHtml(c);if(this.fireEvent("beforesync",this,c)!==false){this.el.dom.value=c;this.fireEvent("sync",this,c)}}},getValue:function(){this[this.sourceEditMode?"pushValue":"syncValue"]();return Ext.form.HtmlEditor.superclass.getValue.call(this)},pushValue:function(){if(this.initialized){var a=this.el.dom.value;if(!this.activated&&a.length<1){a=this.defaultValue}if(this.fireEvent("beforepush",this,a)!==false){this.getEditorBody().innerHTML=a;if(Ext.isGecko){this.setDesignMode(false);this.setDesignMode(true)}this.fireEvent("push",this,a)}}},deferFocus:function(){this.focus.defer(10,this)},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus()}else{this.el.focus()}},initEditor:function(){try{var c=this.getEditorBody(),a=this.el.getStyles("font-size","font-family","background-image","background-repeat","background-color","color"),g,b;a["background-attachment"]="fixed";c.bgProperties="fixed";Ext.DomHelper.applyStyles(c,a);g=this.getDoc();if(g){try{Ext.EventManager.removeAll(g)}catch(d){}}b=this.onEditorEvent.createDelegate(this);Ext.EventManager.on(g,{mousedown:b,dblclick:b,click:b,keyup:b,buffer:100});if(Ext.isGecko){Ext.EventManager.on(g,"keypress",this.applyCommand,this)}if(Ext.isIE||Ext.isWebKit||Ext.isOpera){Ext.EventManager.on(g,"keydown",this.fixKeys,this)}g.editorInitialized=true;this.initialized=true;this.pushValue();this.setReadOnly(this.readOnly);this.fireEvent("initialize",this)}catch(d){}},beforeDestroy:function(){if(this.monitorTask){Ext.TaskMgr.stop(this.monitorTask)}if(this.rendered){Ext.destroy(this.tb);var b=this.getDoc();if(b){try{Ext.EventManager.removeAll(b);for(var c in b){delete b[c]}}catch(a){}}if(this.wrap){this.wrap.dom.innerHTML="";this.wrap.remove()}}Ext.form.HtmlEditor.superclass.beforeDestroy.call(this)},onFirstFocus:function(){this.activated=true;this.disableItems(this.readOnly);if(Ext.isGecko){this.win.focus();var a=this.win.getSelection();if(!a.focusNode||a.focusNode.nodeType!=3){var b=a.getRangeAt(0);b.selectNodeContents(this.getEditorBody());b.collapse(true);this.deferFocus()}try{this.execCmd("useCSS",true);this.execCmd("styleWithCSS",false)}catch(c){}}this.fireEvent("activate",this)},adjustFont:function(b){var d=b.getItemId()=="increasefontsize"?1:-1,c=this.getDoc(),a=parseInt(c.queryCommandValue("FontSize")||2,10);if((Ext.isSafari&&!Ext.isSafari2)||Ext.isChrome||Ext.isAir){if(a<=10){a=1+d}else{if(a<=13){a=2+d}else{if(a<=16){a=3+d}else{if(a<=18){a=4+d}else{if(a<=24){a=5+d}else{a=6+d}}}}}a=a.constrain(1,6)}else{if(Ext.isSafari){d*=2}a=Math.max(1,a+d)+(Ext.isSafari?"px":0)}this.execCmd("FontSize",a)},onEditorEvent:function(a){this.updateToolbar()},updateToolbar:function(){if(this.readOnly){return}if(!this.activated){this.onFirstFocus();return}var b=this.tb.items.map,c=this.getDoc();if(this.enableFont&&!Ext.isSafari2){var a=(c.queryCommandValue("FontName")||this.defaultFont).toLowerCase();if(a!=this.fontSelect.dom.value){this.fontSelect.dom.value=a}}if(this.enableFormat){b.bold.toggle(c.queryCommandState("bold"));b.italic.toggle(c.queryCommandState("italic"));b.underline.toggle(c.queryCommandState("underline"))}if(this.enableAlignments){b.justifyleft.toggle(c.queryCommandState("justifyleft"));b.justifycenter.toggle(c.queryCommandState("justifycenter"));b.justifyright.toggle(c.queryCommandState("justifyright"))}if(!Ext.isSafari2&&this.enableLists){b.insertorderedlist.toggle(c.queryCommandState("insertorderedlist"));b.insertunorderedlist.toggle(c.queryCommandState("insertunorderedlist"))}Ext.menu.MenuMgr.hideAll();this.syncValue()},relayBtnCmd:function(a){this.relayCmd(a.getItemId())},relayCmd:function(b,a){(function(){this.focus();this.execCmd(b,a);this.updateToolbar()}).defer(10,this)},execCmd:function(b,a){var c=this.getDoc();c.execCommand(b,false,a===undefined?null:a);this.syncValue()},applyCommand:function(b){if(b.ctrlKey){var d=b.getCharCode(),a;if(d>0){d=String.fromCharCode(d);switch(d){case"b":a="bold";break;case"i":a="italic";break;case"u":a="underline";break}if(a){this.win.focus();this.execCmd(a);this.deferFocus();b.preventDefault()}}}},insertAtCursor:function(c){if(!this.activated){return}if(Ext.isIE){this.win.focus();var b=this.getDoc(),a=b.selection.createRange();if(a){a.pasteHTML(c);this.syncValue();this.deferFocus()}}else{this.win.focus();this.execCmd("InsertHTML",c);this.deferFocus()}},fixKeys:function(){if(Ext.isIE){return function(g){var a=g.getKey(),d=this.getDoc(),b;if(a==g.TAB){g.stopEvent();b=d.selection.createRange();if(b){b.collapse(true);b.pasteHTML("&nbsp;&nbsp;&nbsp;&nbsp;");this.deferFocus()}}else{if(a==g.ENTER){b=d.selection.createRange();if(b){var c=b.parentElement();if(!c||c.tagName.toLowerCase()!="li"){g.stopEvent();b.pasteHTML("<br />");b.collapse(false);b.select()}}}}}}else{if(Ext.isOpera){return function(b){var a=b.getKey();if(a==b.TAB){b.stopEvent();this.win.focus();this.execCmd("InsertHTML","&nbsp;&nbsp;&nbsp;&nbsp;");this.deferFocus()}}}else{if(Ext.isWebKit){return function(b){var a=b.getKey();if(a==b.TAB){b.stopEvent();this.execCmd("InsertText","\t");this.deferFocus()}else{if(a==b.ENTER){b.stopEvent();this.execCmd("InsertHtml","<br /><br />");this.deferFocus()}}}}}}}(),getToolbar:function(){return this.tb},buttonTips:{bold:{title:"Bold (Ctrl+B)",text:"Make the selected text bold.",cls:"x-html-editor-tip"},italic:{title:"Italic (Ctrl+I)",text:"Make the selected text italic.",cls:"x-html-editor-tip"},underline:{title:"Underline (Ctrl+U)",text:"Underline the selected text.",cls:"x-html-editor-tip"},increasefontsize:{title:"Grow Text",text:"Increase the font size.",cls:"x-html-editor-tip"},decreasefontsize:{title:"Shrink Text",text:"Decrease the font size.",cls:"x-html-editor-tip"},backcolor:{title:"Text Highlight Color",text:"Change the background color of the selected text.",cls:"x-html-editor-tip"},forecolor:{title:"Font Color",text:"Change the color of the selected text.",cls:"x-html-editor-tip"},justifyleft:{title:"Align Text Left",text:"Align text to the left.",cls:"x-html-editor-tip"},justifycenter:{title:"Center Text",text:"Center text in the editor.",cls:"x-html-editor-tip"},justifyright:{title:"Align Text Right",text:"Align text to the right.",cls:"x-html-editor-tip"},insertunorderedlist:{title:"Bullet List",text:"Start a bulleted list.",cls:"x-html-editor-tip"},insertorderedlist:{title:"Numbered List",text:"Start a numbered list.",cls:"x-html-editor-tip"},createlink:{title:"Hyperlink",text:"Make the selected text a hyperlink.",cls:"x-html-editor-tip"},sourceedit:{title:"Source Edit",text:"Switch to source editing mode.",cls:"x-html-editor-tip"}}});Ext.reg("htmleditor",Ext.form.HtmlEditor);Ext.form.TimeField=Ext.extend(Ext.form.ComboBox,{minValue:undefined,maxValue:undefined,minText:"The time in this field must be equal to or after {0}",maxText:"The time in this field must be equal to or before {0}",invalidText:"{0} is not a valid time",format:"g:i A",altFormats:"g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H|gi a|hi a|giA|hiA|gi A|hi A",increment:15,mode:"local",triggerAction:"all",typeAhead:false,initDate:"1/1/2008",initDateFormat:"j/n/Y",initComponent:function(){if(Ext.isDefined(this.minValue)){this.setMinValue(this.minValue,true)}if(Ext.isDefined(this.maxValue)){this.setMaxValue(this.maxValue,true)}if(!this.store){this.generateStore(true)}Ext.form.TimeField.superclass.initComponent.call(this)},setMinValue:function(b,a){this.setLimit(b,true,a);return this},setMaxValue:function(b,a){this.setLimit(b,false,a);return this},generateStore:function(b){var c=this.minValue||new Date(this.initDate).clearTime(),a=this.maxValue||new Date(this.initDate).clearTime().add("mi",(24*60)-1),d=[];while(c<=a){d.push(c.dateFormat(this.format));c=c.add("mi",this.increment)}this.bindStore(d,b)},setLimit:function(b,g,a){var e;if(Ext.isString(b)){e=this.parseDate(b)}else{if(Ext.isDate(b)){e=b}}if(e){var c=new Date(this.initDate).clearTime();c.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());this[g?"minValue":"maxValue"]=c;if(!a){this.generateStore()}}},getValue:function(){var a=Ext.form.TimeField.superclass.getValue.call(this);return this.formatDate(this.parseDate(a))||""},setValue:function(a){return Ext.form.TimeField.superclass.setValue.call(this,this.formatDate(this.parseDate(a)))},validateValue:Ext.form.DateField.prototype.validateValue,formatDate:Ext.form.DateField.prototype.formatDate,parseDate:function(h){if(!h||Ext.isDate(h)){return h}var j=this.initDate+" ",g=this.initDateFormat+" ",b=Date.parseDate(j+h,g+this.format),c=this.altFormats;if(!b&&c){if(!this.altFormatsArray){this.altFormatsArray=c.split("|")}for(var e=0,d=this.altFormatsArray,a=d.length;e<a&&!b;e++){b=Date.parseDate(j+h,g+d[e])}}return b}});Ext.reg("timefield",Ext.form.TimeField);Ext.form.SliderField=Ext.extend(Ext.form.Field,{useTips:true,tipText:null,actionMode:"wrap",initComponent:function(){var b=Ext.copyTo({id:this.id+"-slider"},this.initialConfig,["vertical","minValue","maxValue","decimalPrecision","keyIncrement","increment","clickToChange","animate"]);if(this.useTips){var a=this.tipText?{getText:this.tipText}:{};b.plugins=[new Ext.slider.Tip(a)]}this.slider=new Ext.Slider(b);Ext.form.SliderField.superclass.initComponent.call(this)},onRender:function(b,a){this.autoCreate={id:this.id,name:this.name,type:"hidden",tag:"input"};Ext.form.SliderField.superclass.onRender.call(this,b,a);this.wrap=this.el.wrap({cls:"x-form-field-wrap"});this.resizeEl=this.positionEl=this.wrap;this.slider.render(this.wrap)},onResize:function(b,c,d,a){Ext.form.SliderField.superclass.onResize.call(this,b,c,d,a);this.slider.setSize(b,c)},initEvents:function(){Ext.form.SliderField.superclass.initEvents.call(this);this.slider.on("change",this.onChange,this)},onChange:function(b,a){this.setValue(a,undefined,true)},onEnable:function(){Ext.form.SliderField.superclass.onEnable.call(this);this.slider.enable()},onDisable:function(){Ext.form.SliderField.superclass.onDisable.call(this);this.slider.disable()},beforeDestroy:function(){Ext.destroy(this.slider);Ext.form.SliderField.superclass.beforeDestroy.call(this)},alignErrorIcon:function(){this.errorIcon.alignTo(this.slider.el,"tl-tr",[2,0])},setMinValue:function(a){this.slider.setMinValue(a);return this},setMaxValue:function(a){this.slider.setMaxValue(a);return this},setValue:function(c,b,a){if(!a){this.slider.setValue(c,b)}return Ext.form.SliderField.superclass.setValue.call(this,this.slider.getValue())},getValue:function(){return this.slider.getValue()}});Ext.reg("sliderfield",Ext.form.SliderField);Ext.form.Label=Ext.extend(Ext.BoxComponent,{onRender:function(b,a){if(!this.el){this.el=document.createElement("label");this.el.id=this.getId();this.el.innerHTML=this.text?Ext.util.Format.htmlEncode(this.text):(this.html||"");if(this.forId){this.el.setAttribute("for",this.forId)}}Ext.form.Label.superclass.onRender.call(this,b,a)},setText:function(a,b){var c=b===false;this[!c?"text":"html"]=a;delete this[c?"text":"html"];if(this.rendered){this.el.dom.innerHTML=b!==false?Ext.util.Format.htmlEncode(a):a}return this}});Ext.reg("label",Ext.form.Label);Ext.form.Action=function(b,a){this.form=b;this.options=a||{}};Ext.form.Action.CLIENT_INVALID="client";Ext.form.Action.SERVER_INVALID="server";Ext.form.Action.CONNECT_FAILURE="connect";Ext.form.Action.LOAD_FAILURE="load";Ext.form.Action.prototype={type:"default",run:function(a){},success:function(a){},handleResponse:function(a){},failure:function(a){this.response=a;this.failureType=Ext.form.Action.CONNECT_FAILURE;this.form.afterAction(this,false)},processResponse:function(a){this.response=a;if(!a.responseText&&!a.responseXML){return true}this.result=this.handleResponse(a);return this.result},decodeResponse:function(a){try{return Ext.decode(a.responseText)}catch(b){return false}},getUrl:function(c){var a=this.options.url||this.form.url||this.form.el.dom.action;if(c){var b=this.getParams();if(b){a=Ext.urlAppend(a,b)}}return a},getMethod:function(){return(this.options.method||this.form.method||this.form.el.dom.method||"POST").toUpperCase()},getParams:function(){var a=this.form.baseParams;var b=this.options.params;if(b){if(typeof b=="object"){b=Ext.urlEncode(Ext.applyIf(b,a))}else{if(typeof b=="string"&&a){b+="&"+Ext.urlEncode(a)}}}else{if(a){b=Ext.urlEncode(a)}}return b},createCallback:function(a){var a=a||{};return{success:this.success,failure:this.failure,scope:this,timeout:(a.timeout*1000)||(this.form.timeout*1000),upload:this.form.fileUpload?this.success:undefined}}};Ext.form.Action.Submit=function(b,a){Ext.form.Action.Submit.superclass.constructor.call(this,b,a)};Ext.extend(Ext.form.Action.Submit,Ext.form.Action,{type:"submit",run:function(){var e=this.options,g=this.getMethod(),d=g=="GET";if(e.clientValidation===false||this.form.isValid()){if(e.submitEmptyText===false){var a=this.form.items,c=[],b=function(h){if(h.el.getValue()==h.emptyText){c.push(h);h.el.dom.value=""}if(h.isComposite&&h.rendered){h.items.each(b)}};a.each(b)}Ext.Ajax.request(Ext.apply(this.createCallback(e),{form:this.form.el.dom,url:this.getUrl(d),method:g,headers:e.headers,params:!d?this.getParams():null,isUpload:this.form.fileUpload}));if(e.submitEmptyText===false){Ext.each(c,function(h){if(h.applyEmptyText){h.applyEmptyText()}})}}else{if(e.clientValidation!==false){this.failureType=Ext.form.Action.CLIENT_INVALID;this.form.afterAction(this,false)}}},success:function(b){var a=this.processResponse(b);if(a===true||a.success){this.form.afterAction(this,true);return}if(a.errors){this.form.markInvalid(a.errors)}this.failureType=Ext.form.Action.SERVER_INVALID;this.form.afterAction(this,false)},handleResponse:function(c){if(this.form.errorReader){var b=this.form.errorReader.read(c);var g=[];if(b.records){for(var d=0,a=b.records.length;d<a;d++){var e=b.records[d];g[d]=e.data}}if(g.length<1){g=null}return{success:b.success,errors:g}}return this.decodeResponse(c)}});Ext.form.Action.Load=function(b,a){Ext.form.Action.Load.superclass.constructor.call(this,b,a);this.reader=this.form.reader};Ext.extend(Ext.form.Action.Load,Ext.form.Action,{type:"load",run:function(){Ext.Ajax.request(Ext.apply(this.createCallback(this.options),{method:this.getMethod(),url:this.getUrl(false),headers:this.options.headers,params:this.getParams()}))},success:function(b){var a=this.processResponse(b);if(a===true||!a.success||!a.data){this.failureType=Ext.form.Action.LOAD_FAILURE;this.form.afterAction(this,false);return}this.form.clearInvalid();this.form.setValues(a.data);this.form.afterAction(this,true)},handleResponse:function(b){if(this.form.reader){var a=this.form.reader.read(b);var c=a.records&&a.records[0]?a.records[0].data:null;return{success:a.success,data:c}}return this.decodeResponse(b)}});Ext.form.Action.DirectLoad=Ext.extend(Ext.form.Action.Load,{constructor:function(b,a){Ext.form.Action.DirectLoad.superclass.constructor.call(this,b,a)},type:"directload",run:function(){var a=this.getParams();a.push(this.success,this);this.form.api.load.apply(window,a)},getParams:function(){var c=[],h={};var e=this.form.baseParams;var g=this.options.params;Ext.apply(h,g,e);var b=this.form.paramOrder;if(b){for(var d=0,a=b.length;d<a;d++){c.push(h[b[d]])}}else{if(this.form.paramsAsHash){c.push(h)}}return c},processResponse:function(a){this.result=a;return a},success:function(a,b){if(b.type==Ext.Direct.exceptions.SERVER){a={}}Ext.form.Action.DirectLoad.superclass.success.call(this,a)}});Ext.form.Action.DirectSubmit=Ext.extend(Ext.form.Action.Submit,{constructor:function(b,a){Ext.form.Action.DirectSubmit.superclass.constructor.call(this,b,a)},type:"directsubmit",run:function(){var a=this.options;if(a.clientValidation===false||this.form.isValid()){this.success.params=this.getParams();this.form.api.submit(this.form.el.dom,this.success,this)}else{if(a.clientValidation!==false){this.failureType=Ext.form.Action.CLIENT_INVALID;this.form.afterAction(this,false)}}},getParams:function(){var c={};var a=this.form.baseParams;var b=this.options.params;Ext.apply(c,b,a);return c},processResponse:function(a){this.result=a;return a},success:function(a,b){if(b.type==Ext.Direct.exceptions.SERVER){a={}}Ext.form.Action.DirectSubmit.superclass.success.call(this,a)}});Ext.form.Action.ACTION_TYPES={load:Ext.form.Action.Load,submit:Ext.form.Action.Submit,directload:Ext.form.Action.DirectLoad,directsubmit:Ext.form.Action.DirectSubmit};Ext.form.VTypes=function(){var c=/^[a-zA-Z_]+$/,d=/^[a-zA-Z0-9_]+$/,b=/^(\w+)([\-+.\'][\w]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/,a=/(((^https?)|(^ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;return{email:function(e){return b.test(e)},emailText:'This field should be an e-mail address in the format "user@example.com"',emailMask:/[a-z0-9_\.\-\+\'@]/i,url:function(e){return a.test(e)},urlText:'This field should be a URL in the format "http://www.example.com"',alpha:function(e){return c.test(e)},alphaText:"This field should only contain letters and _",alphaMask:/[a-z_]/i,alphanum:function(e){return d.test(e)},alphanumText:"This field should only contain letters, numbers and _",alphanumMask:/[a-z0-9_]/i}}();Ext.grid.GridPanel=Ext.extend(Ext.Panel,{autoExpandColumn:false,autoExpandMax:1000,autoExpandMin:50,columnLines:false,ddText:"{0} selected row{1}",deferRowRender:true,enableColumnHide:true,enableColumnMove:true,enableDragDrop:false,enableHdMenu:true,loadMask:false,minColumnWidth:25,stripeRows:false,trackMouseOver:true,stateEvents:["columnmove","columnresize","sortchange","groupchange"],view:null,bubbleEvents:[],rendered:false,viewReady:false,initComponent:function(){Ext.grid.GridPanel.superclass.initComponent.call(this);if(this.columnLines){this.cls=(this.cls||"")+" x-grid-with-col-lines"}this.autoScroll=false;this.autoWidth=false;if(Ext.isArray(this.columns)){this.colModel=new Ext.grid.ColumnModel(this.columns);delete this.columns}if(this.ds){this.store=this.ds;delete this.ds}if(this.cm){this.colModel=this.cm;delete this.cm}if(this.sm){this.selModel=this.sm;delete this.sm}this.store=Ext.StoreMgr.lookup(this.store);this.addEvents("click","dblclick","contextmenu","mousedown","mouseup","mouseover","mouseout","keypress","keydown","cellmousedown","rowmousedown","headermousedown","groupmousedown","rowbodymousedown","containermousedown","cellclick","celldblclick","rowclick","rowdblclick","headerclick","headerdblclick","groupclick","groupdblclick","containerclick","containerdblclick","rowbodyclick","rowbodydblclick","rowcontextmenu","cellcontextmenu","headercontextmenu","groupcontextmenu","containercontextmenu","rowbodycontextmenu","bodyscroll","columnresize","columnmove","sortchange","groupchange","reconfigure","viewready")},onRender:function(d,a){Ext.grid.GridPanel.superclass.onRender.apply(this,arguments);var e=this.getGridEl();this.el.addClass("x-grid-panel");this.mon(e,{scope:this,mousedown:this.onMouseDown,click:this.onClick,dblclick:this.onDblClick,contextmenu:this.onContextMenu});this.relayEvents(e,["mousedown","mouseup","mouseover","mouseout","keypress","keydown"]);var b=this.getView();b.init(this);b.render();this.getSelectionModel().init(this)},initEvents:function(){Ext.grid.GridPanel.superclass.initEvents.call(this);if(this.loadMask){this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({store:this.store},this.loadMask))}},initStateEvents:function(){Ext.grid.GridPanel.superclass.initStateEvents.call(this);this.mon(this.colModel,"hiddenchange",this.saveState,this,{delay:100})},applyState:function(a){var k=this.colModel,g=a.columns,j=this.store,m,h,l;if(g){for(var d=0,e=g.length;d<e;d++){m=g[d];h=k.getColumnById(m.id);if(h){l=k.getIndexById(m.id);k.setState(l,{hidden:m.hidden,width:m.width,sortable:m.sortable});if(l!=d){k.moveColumn(l,d)}}}}if(j){m=a.sort;if(m){j[j.remoteSort?"setDefaultSort":"sort"](m.field,m.direction)}m=a.group;if(j.groupBy){if(m){j.groupBy(m)}else{j.clearGrouping()}}}var b=Ext.apply({},a);delete b.columns;delete b.sort;Ext.grid.GridPanel.superclass.applyState.call(this,b)},getState:function(){var g={columns:[]},b=this.store,e,a;for(var d=0,h;(h=this.colModel.config[d]);d++){g.columns[d]={id:h.id,width:h.width};if(h.hidden){g.columns[d].hidden=true}if(h.sortable){g.columns[d].sortable=true}}if(b){e=b.getSortState();if(e){g.sort=e}if(b.getGroupState){a=b.getGroupState();if(a){g.group=a}}}return g},afterRender:function(){Ext.grid.GridPanel.superclass.afterRender.call(this);var a=this.view;this.on("bodyresize",a.layout,a);a.layout(true);if(this.deferRowRender){if(!this.deferRowRenderTask){this.deferRowRenderTask=new Ext.util.DelayedTask(a.afterRender,this.view)}this.deferRowRenderTask.delay(10)}else{a.afterRender()}this.viewReady=true},reconfigure:function(a,b){var c=this.rendered;if(c){if(this.loadMask){this.loadMask.destroy();this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({},{store:a},this.initialConfig.loadMask))}}if(this.view){this.view.initData(a,b)}this.store=a;this.colModel=b;if(c){this.view.refresh(true)}this.fireEvent("reconfigure",this,a,b)},onDestroy:function(){if(this.deferRowRenderTask&&this.deferRowRenderTask.cancel){this.deferRowRenderTask.cancel()}if(this.rendered){Ext.destroy(this.view,this.loadMask)}else{if(this.store&&this.store.autoDestroy){this.store.destroy()}}Ext.destroy(this.colModel,this.selModel);this.store=this.selModel=this.colModel=this.view=this.loadMask=null;Ext.grid.GridPanel.superclass.onDestroy.call(this)},processEvent:function(a,b){this.view.processEvent(a,b)},onClick:function(a){this.processEvent("click",a)},onMouseDown:function(a){this.processEvent("mousedown",a)},onContextMenu:function(b,a){this.processEvent("contextmenu",b)},onDblClick:function(a){this.processEvent("dblclick",a)},walkCells:function(k,c,b,e,j){var i=this.colModel,g=i.getColumnCount(),a=this.store,h=a.getCount(),d=true;if(b<0){if(c<0){k--;d=false}while(k>=0){if(!d){c=g-1}d=false;while(c>=0){if(e.call(j||this,k,c,i)===true){return[k,c]}c--}k--}}else{if(c>=g){k++;d=false}while(k<h){if(!d){c=0}d=false;while(c<g){if(e.call(j||this,k,c,i)===true){return[k,c]}c++}k++}}return null},getGridEl:function(){return this.body},stopEditing:Ext.emptyFn,getSelectionModel:function(){if(!this.selModel){this.selModel=new Ext.grid.RowSelectionModel(this.disableSelection?{selectRow:Ext.emptyFn}:null)}return this.selModel},getStore:function(){return this.store},getColumnModel:function(){return this.colModel},getView:function(){if(!this.view){this.view=new Ext.grid.GridView(this.viewConfig)}return this.view},getDragDropText:function(){var a=this.selModel.getCount();return String.format(this.ddText,a,a==1?"":"s")}});Ext.reg("grid",Ext.grid.GridPanel);Ext.grid.PivotGrid=Ext.extend(Ext.grid.GridPanel,{aggregator:"sum",renderer:undefined,initComponent:function(){Ext.grid.PivotGrid.superclass.initComponent.apply(this,arguments);this.initAxes();this.enableColumnResize=false;this.viewConfig=Ext.apply(this.viewConfig||{},{forceFit:true});this.colModel=new Ext.grid.ColumnModel({})},getAggregator:function(){if(typeof this.aggregator=="string"){return Ext.grid.PivotAggregatorMgr.types[this.aggregator]}else{return this.aggregator}},setAggregator:function(a){this.aggregator=a},setMeasure:function(a){this.measure=a},setLeftAxis:function(b,a){this.leftAxis=b;if(a){this.view.refresh()}},setTopAxis:function(b,a){this.topAxis=b;if(a){this.view.refresh()}},initAxes:function(){var a=Ext.grid.PivotAxis;if(!(this.leftAxis instanceof a)){this.setLeftAxis(new a({orientation:"vertical",dimensions:this.leftAxis||[],store:this.store}))}if(!(this.topAxis instanceof a)){this.setTopAxis(new a({orientation:"horizontal",dimensions:this.topAxis||[],store:this.store}))}},extractData:function(){var c=this.store.data.items,s=c.length,q=[],h,g,e,d;if(s==0){return[]}var l=this.leftAxis.getTuples(),o=l.length,m=this.topAxis.getTuples(),a=m.length,b=this.getAggregator();for(g=0;g<s;g++){h=c[g];for(e=0;e<o;e++){q[e]=q[e]||[];if(l[e].matcher(h)===true){for(d=0;d<a;d++){q[e][d]=q[e][d]||[];if(m[d].matcher(h)){q[e][d].push(h)}}}}}var n=q.length,p,r;for(g=0;g<n;g++){r=q[g];p=r.length;for(e=0;e<p;e++){q[g][e]=b(q[g][e],this.measure)}}return q},getView:function(){if(!this.view){this.view=new Ext.grid.PivotGridView(this.viewConfig)}return this.view}});Ext.reg("pivotgrid",Ext.grid.PivotGrid);Ext.grid.PivotAggregatorMgr=new Ext.AbstractManager();Ext.grid.PivotAggregatorMgr.registerType("sum",function(a,c){var e=a.length,d=0,b;for(b=0;b<e;b++){d+=a[b].get(c)}return d});Ext.grid.PivotAggregatorMgr.registerType("avg",function(a,c){var e=a.length,d=0,b;for(b=0;b<e;b++){d+=a[b].get(c)}return(d/e)||"n/a"});Ext.grid.PivotAggregatorMgr.registerType("min",function(a,c){var e=[],d=a.length,b;for(b=0;b<d;b++){e.push(a[b].get(c))}return Math.min.apply(this,e)||"n/a"});Ext.grid.PivotAggregatorMgr.registerType("max",function(a,c){var e=[],d=a.length,b;for(b=0;b<d;b++){e.push(a[b].get(c))}return Math.max.apply(this,e)||"n/a"});Ext.grid.PivotAggregatorMgr.registerType("count",function(a,b){return a.length});Ext.grid.GridView=Ext.extend(Ext.util.Observable,{deferEmptyText:true,scrollOffset:undefined,autoFill:false,forceFit:false,sortClasses:["sort-asc","sort-desc"],sortAscText:"Sort Ascending",sortDescText:"Sort Descending",columnsText:"Columns",selectedRowClass:"x-grid3-row-selected",borderWidth:2,tdClass:"x-grid3-cell",hdCls:"x-grid3-hd",markDirty:true,cellSelectorDepth:4,rowSelectorDepth:10,rowBodySelectorDepth:10,cellSelector:"td.x-grid3-cell",rowSelector:"div.x-grid3-row",rowBodySelector:"div.x-grid3-row-body",firstRowCls:"x-grid3-row-first",lastRowCls:"x-grid3-row-last",rowClsRe:/(?:^|\s+)x-grid3-row-(first|last|alt)(?:\s+|$)/g,headerMenuOpenCls:"x-grid3-hd-menu-open",rowOverCls:"x-grid3-row-over",constructor:function(a){Ext.apply(this,a);this.addEvents("beforerowremoved","beforerowsinserted","beforerefresh","rowremoved","rowsinserted","rowupdated","refresh");Ext.grid.GridView.superclass.constructor.call(this)},masterTpl:new Ext.Template('<div class="x-grid3" hidefocus="true">','<div class="x-grid3-viewport">','<div class="x-grid3-header">','<div class="x-grid3-header-inner">','<div class="x-grid3-header-offset" style="{ostyle}">{header}</div>',"</div>",'<div class="x-clear"></div>',"</div>",'<div class="x-grid3-scroller">','<div class="x-grid3-body" style="{bstyle}">{body}</div>','<a href="#" class="x-grid3-focus" tabIndex="-1"></a>',"</div>","</div>",'<div class="x-grid3-resize-marker">&#160;</div>','<div class="x-grid3-resize-proxy">&#160;</div>',"</div>"),headerTpl:new Ext.Template('<table border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',"<thead>",'<tr class="x-grid3-hd-row">{cells}</tr>',"</thead>","</table>"),bodyTpl:new Ext.Template("{rows}"),cellTpl:new Ext.Template('<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} {css}" style="{style}" tabIndex="0" {cellAttr}>','<div class="x-grid3-cell-inner x-grid3-col-{id}" unselectable="on" {attr}>{value}</div>',"</td>"),initTemplates:function(){var c=this.templates||{},d,b,g=new Ext.Template('<td class="x-grid3-hd x-grid3-cell x-grid3-td-{id} {css}" style="{style}">','<div {tooltip} {attr} class="x-grid3-hd-inner x-grid3-hd-{id}" unselectable="on" style="{istyle}">',this.grid.enableHdMenu?'<a class="x-grid3-hd-btn" href="#"></a>':"","{value}",'<img alt="" class="x-grid3-sort-icon" src="',Ext.BLANK_IMAGE_URL,'" />',"</div>","</td>"),a=['<tr class="x-grid3-row-body-tr" style="{bodyStyle}">','<td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on">','<div class="x-grid3-row-body">{body}</div>',"</td>","</tr>"].join(""),e=['<table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',"<tbody>","<tr>{cells}</tr>",this.enableRowBody?a:"","</tbody>","</table>"].join("");Ext.applyIf(c,{hcell:g,cell:this.cellTpl,body:this.bodyTpl,header:this.headerTpl,master:this.masterTpl,row:new Ext.Template('<div class="x-grid3-row {alt}" style="{tstyle}">'+e+"</div>"),rowInner:new Ext.Template(e)});for(b in c){d=c[b];if(d&&Ext.isFunction(d.compile)&&!d.compiled){d.disableFormats=true;d.compile()}}this.templates=c;this.colRe=new RegExp("x-grid3-td-([^\\s]+)","")},fly:function(a){if(!this._flyweight){this._flyweight=new Ext.Element.Flyweight(document.body)}this._flyweight.dom=a;return this._flyweight},getEditorParent:function(){return this.scroller.dom},initElements:function(){var b=Ext.Element,d=Ext.get(this.grid.getGridEl().dom.firstChild),e=new b(d.child("div.x-grid3-viewport")),c=new b(e.child("div.x-grid3-header")),a=new b(e.child("div.x-grid3-scroller"));if(this.grid.hideHeaders){c.setDisplayed(false)}if(this.forceFit){a.setStyle("overflow-x","hidden")}Ext.apply(this,{el:d,mainWrap:e,scroller:a,mainHd:c,innerHd:c.child("div.x-grid3-header-inner").dom,mainBody:new b(b.fly(a).child("div.x-grid3-body")),focusEl:new b(b.fly(a).child("a")),resizeMarker:new b(d.child("div.x-grid3-resize-marker")),resizeProxy:new b(d.child("div.x-grid3-resize-proxy"))});this.focusEl.swallowEvent("click",true)},getRows:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},findCell:function(a){if(!a){return false}return this.fly(a).findParent(this.cellSelector,this.cellSelectorDepth)},findCellIndex:function(d,c){var b=this.findCell(d),a;if(b){a=this.fly(b).hasClass(c);if(!c||a){return this.getCellIndex(b)}}return false},getCellIndex:function(b){if(b){var a=b.className.match(this.colRe);if(a&&a[1]){return this.cm.getIndexById(a[1])}}return false},findHeaderCell:function(b){var a=this.findCell(b);return a&&this.fly(a).hasClass(this.hdCls)?a:null},findHeaderIndex:function(a){return this.findCellIndex(a,this.hdCls)},findRow:function(a){if(!a){return false}return this.fly(a).findParent(this.rowSelector,this.rowSelectorDepth)},findRowIndex:function(a){var b=this.findRow(a);return b?b.rowIndex:false},findRowBody:function(a){if(!a){return false}return this.fly(a).findParent(this.rowBodySelector,this.rowBodySelectorDepth)},getRow:function(a){return this.getRows()[a]},getCell:function(b,a){return Ext.fly(this.getRow(b)).query(this.cellSelector)[a]},getHeaderCell:function(a){return this.mainHd.dom.getElementsByTagName("td")[a]},addRowClass:function(b,a){var c=this.getRow(b);if(c){this.fly(c).addClass(a)}},removeRowClass:function(c,a){var b=this.getRow(c);if(b){this.fly(b).removeClass(a)}},removeRow:function(a){Ext.removeNode(this.getRow(a));this.syncFocusEl(a)},removeRows:function(c,a){var b=this.mainBody.dom,d;for(d=c;d<=a;d++){Ext.removeNode(b.childNodes[c])}this.syncFocusEl(c)},getScrollState:function(){var a=this.scroller.dom;return{left:a.scrollLeft,top:a.scrollTop}},restoreScroll:function(a){var b=this.scroller.dom;b.scrollLeft=a.left;b.scrollTop=a.top},scrollToTop:function(){var a=this.scroller.dom;a.scrollTop=0;a.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var a=this.scroller.dom;this.grid.fireEvent("bodyscroll",a.scrollLeft,a.scrollTop)},syncHeaderScroll:function(){var a=this.innerHd,b=this.scroller.dom.scrollLeft;a.scrollLeft=b;a.scrollLeft=b},updateSortIcon:function(d,c){var a=this.sortClasses,b=a[c=="DESC"?1:0],e=this.mainHd.select("td").removeClass(a);e.item(d).addClass(b)},updateAllColumnWidths:function(){var e=this.getTotalWidth(),k=this.cm.getColumnCount(),m=this.getRows(),g=m.length,b=[],l,a,h,d,c;for(d=0;d<k;d++){b[d]=this.getColumnWidth(d);this.getHeaderCell(d).style.width=b[d]}this.updateHeaderWidth();for(d=0;d<g;d++){l=m[d];l.style.width=e;a=l.firstChild;if(a){a.style.width=e;h=a.rows[0];for(c=0;c<k;c++){h.childNodes[c].style.width=b[c]}}}this.onAllColumnWidthsUpdated(b,e)},updateColumnWidth:function(d,b){var c=this.getColumnWidth(d),j=this.getTotalWidth(),h=this.getHeaderCell(d),a=this.getRows(),e=a.length,l,g,k;this.updateHeaderWidth();h.style.width=c;for(g=0;g<e;g++){l=a[g];k=l.firstChild;l.style.width=j;if(k){k.style.width=j;k.rows[0].childNodes[d].style.width=c}}this.onColumnWidthUpdated(d,c,j)},updateColumnHidden:function(b,j){var h=this.getTotalWidth(),k=j?"none":"",g=this.getHeaderCell(b),a=this.getRows(),d=a.length,l,c,e;this.updateHeaderWidth();g.style.display=k;for(e=0;e<d;e++){l=a[e];l.style.width=h;c=l.firstChild;if(c){c.style.width=h;c.rows[0].childNodes[b].style.display=k}}this.onColumnHiddenUpdated(b,j,h);delete this.lastViewWidth;this.layout()},doRender:function(d,v,m,a,r,t){var h=this.templates,c=h.cell,y=h.row,o=r-1,b="width:"+this.getTotalWidth()+";",k=[],l=[],n={tstyle:b},q={},w=v.length,x,g,e,u,s,p;for(s=0;s<w;s++){e=v[s];l=[];p=s+a;for(u=0;u<r;u++){g=d[u];q.id=g.id;q.css=u===0?"x-grid3-cell-first ":(u==o?"x-grid3-cell-last ":"");q.attr=q.cellAttr="";q.style=g.style;q.value=g.renderer.call(g.scope,e.data[g.name],q,e,p,u,m);if(Ext.isEmpty(q.value)){q.value="&#160;"}if(this.markDirty&&e.dirty&&typeof e.modified[g.name]!="undefined"){q.css+=" x-grid3-dirty-cell"}l[l.length]=c.apply(q)}x=[];if(t&&((p+1)%2===0)){x[0]="x-grid3-row-alt"}if(e.dirty){x[1]=" x-grid3-dirty-row"}n.cols=r;if(this.getRowClass){x[2]=this.getRowClass(e,p,n,m)}n.alt=x.join(" ");n.cells=l.join("");k[k.length]=y.apply(n)}return k.join("")},processRows:function(a,g){if(!this.ds||this.ds.getCount()<1){return}var d=this.getRows(),c=d.length,e,b;g=g||!this.grid.stripeRows;a=a||0;for(b=0;b<c;b++){e=d[b];if(e){e.rowIndex=b;if(!g){e.className=e.className.replace(this.rowClsRe," ");if((b+1)%2===0){e.className+=" x-grid3-row-alt"}}}}if(a===0){Ext.fly(d[0]).addClass(this.firstRowCls)}Ext.fly(d[c-1]).addClass(this.lastRowCls)},afterRender:function(){if(!this.ds||!this.cm){return}this.mainBody.dom.innerHTML=this.renderBody()||"&#160;";this.processRows(0,true);if(this.deferEmptyText!==true){this.applyEmptyText()}this.grid.fireEvent("viewready",this.grid)},afterRenderUI:function(){var a=this.grid;this.initElements();Ext.fly(this.innerHd).on("click",this.handleHdDown,this);this.mainHd.on({scope:this,mouseover:this.handleHdOver,mouseout:this.handleHdOut,mousemove:this.handleHdMove});this.scroller.on("scroll",this.syncScroll,this);if(a.enableColumnResize!==false){this.splitZone=new Ext.grid.GridView.SplitDragZone(a,this.mainHd.dom)}if(a.enableColumnMove){this.columnDrag=new Ext.grid.GridView.ColumnDragZone(a,this.innerHd);this.columnDrop=new Ext.grid.HeaderDropZone(a,this.mainHd.dom)}if(a.enableHdMenu!==false){this.hmenu=new Ext.menu.Menu({id:a.id+"-hctx"});this.hmenu.add({itemId:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"},{itemId:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"});if(a.enableColumnHide!==false){this.colMenu=new Ext.menu.Menu({id:a.id+"-hcols-menu"});this.colMenu.on({scope:this,beforeshow:this.beforeColMenuShow,itemclick:this.handleHdMenuClick});this.hmenu.add("-",{itemId:"columns",hideOnClick:false,text:this.columnsText,menu:this.colMenu,iconCls:"x-cols-icon"})}this.hmenu.on("itemclick",this.handleHdMenuClick,this)}if(a.trackMouseOver){this.mainBody.on({scope:this,mouseover:this.onRowOver,mouseout:this.onRowOut})}if(a.enableDragDrop||a.enableDrag){this.dragZone=new Ext.grid.GridDragZone(a,{ddGroup:a.ddGroup||"GridDD"})}this.updateHeaderSortState()},renderUI:function(){var a=this.templates;return a.master.apply({body:a.body.apply({rows:"&#160;"}),header:this.renderHeaders(),ostyle:"width:"+this.getOffsetWidth()+";",bstyle:"width:"+this.getTotalWidth()+";"})},processEvent:function(b,h){var i=h.getTarget(),a=this.grid,d=this.findHeaderIndex(i),k,j,c,g;a.fireEvent(b,h);if(d!==false){a.fireEvent("header"+b,a,d,h)}else{k=this.findRowIndex(i);if(k!==false){j=this.findCellIndex(i);if(j!==false){c=a.colModel.getColumnAt(j);if(a.fireEvent("cell"+b,a,k,j,h)!==false){if(!c||(c.processEvent&&(c.processEvent(b,h,a,k,j)!==false))){a.fireEvent("row"+b,a,k,h)}}}else{if(a.fireEvent("row"+b,a,k,h)!==false){(g=this.findRowBody(i))&&a.fireEvent("rowbody"+b,a,k,h)}}}else{a.fireEvent("container"+b,a,h)}}},layout:function(j){if(!this.mainBody){return}var a=this.grid,d=a.getGridEl(),c=d.getSize(true),i=c.width,b=c.height,h=this.scroller,g,e,k;if(i<20||b<20){return}if(a.autoHeight){g=h.dom.style;g.overflow="visible";if(Ext.isWebKit){g.position="static"}}else{this.el.setSize(i,b);e=this.mainHd.getHeight();k=b-e;h.setSize(i,k);if(this.innerHd){this.innerHd.style.width=(i)+"px"}}if(this.forceFit||(j===true&&this.autoFill)){if(this.lastViewWidth!=i){this.fitColumns(false,false);this.lastViewWidth=i}}else{this.autoExpand();this.syncHeaderScroll()}this.onLayout(i,k)},onLayout:function(a,b){},onColumnWidthUpdated:function(c,a,b){},onAllColumnWidthsUpdated:function(a,b){},onColumnHiddenUpdated:function(b,c,a){},updateColumnText:function(a,b){},afterMove:function(a){},init:function(a){this.grid=a;this.initTemplates();this.initData(a.store,a.colModel);this.initUI(a)},getColumnId:function(a){return this.cm.getColumnId(a)},getOffsetWidth:function(){return(this.cm.getTotalWidth()+this.getScrollOffset())+"px"},getScrollOffset:function(){return Ext.num(this.scrollOffset,Ext.getScrollBarWidth())},renderHeaders:function(){var e=this.cm,g=this.templates,a=g.hcell,d={},h=e.getColumnCount(),j=h-1,k=[],c,b;for(c=0;c<h;c++){if(c==0){b="x-grid3-cell-first "}else{b=c==j?"x-grid3-cell-last ":""}d={id:e.getColumnId(c),value:e.getColumnHeader(c)||"",style:this.getColumnStyle(c,true),css:b,tooltip:this.getColumnTooltip(c)};if(e.config[c].align=="right"){d.istyle="padding-right: 16px;"}else{delete d.istyle}k[c]=a.apply(d)}return g.header.apply({cells:k.join(""),tstyle:String.format("width: {0};",this.getTotalWidth())})},getColumnTooltip:function(a){var b=this.cm.getColumnTooltip(a);if(b){if(Ext.QuickTips.isEnabled()){return'ext:qtip="'+b+'"'}else{return'title="'+b+'"'}}return""},beforeUpdate:function(){this.grid.stopEditing(true)},updateHeaders:function(){this.innerHd.firstChild.innerHTML=this.renderHeaders();this.updateHeaderWidth(false)},updateHeaderWidth:function(c){var b=this.innerHd.firstChild,a=this.getTotalWidth();b.style.width=this.getOffsetWidth();b.firstChild.style.width=a;if(c!==false){this.mainBody.dom.style.width=a}},focusRow:function(a){this.focusCell(a,0,false)},focusCell:function(d,b,c){this.syncFocusEl(this.ensureVisible(d,b,c));var a=this.focusEl;if(Ext.isGecko){a.focus()}else{a.focus.defer(1,a)}},resolveCell:function(h,d,g){if(!Ext.isNumber(h)){h=h.rowIndex}if(!this.ds){return null}if(h<0||h>=this.ds.getCount()){return null}d=(d!==undefined?d:0);var c=this.getRow(h),b=this.cm,e=b.getColumnCount(),a;if(!(g===false&&d===0)){while(d<e&&b.isHidden(d)){d++}a=this.getCell(h,d)}return{row:c,cell:a}},getResolvedXY:function(b){if(!b){return null}var a=b.cell,c=b.row;if(a){return Ext.fly(a).getXY()}else{return[this.el.getX(),Ext.fly(c).getY()]}},syncFocusEl:function(d,a,c){var b=d;if(!Ext.isArray(b)){d=Math.min(d,Math.max(0,this.getRows().length-1));if(isNaN(d)){return}b=this.getResolvedXY(this.resolveCell(d,a,c))}this.focusEl.setXY(b||this.scroller.getXY())},ensureVisible:function(t,g,e){var r=this.resolveCell(t,g,e);if(!r||!r.row){return null}var k=r.row,h=r.cell,n=this.scroller.dom,d=k,s=0,o=this.el.dom;while(d&&d!=o){s+=d.offsetTop;d=d.offsetParent}s-=this.mainHd.dom.offsetHeight;o=parseInt(n.scrollTop,10);var q=s+k.offsetHeight,a=n.clientHeight,m=o+a;if(s<o){n.scrollTop=s}else{if(q>m){n.scrollTop=q-a}}if(e!==false){var l=parseInt(h.offsetLeft,10),j=l+h.offsetWidth,i=parseInt(n.scrollLeft,10),b=i+n.clientWidth;if(l<i){n.scrollLeft=l}else{if(j>b){n.scrollLeft=j-n.clientWidth}}}return this.getResolvedXY(r)},insertRows:function(a,i,e,h){var d=a.getCount()-1;if(!h&&i===0&&e>=d){this.fireEvent("beforerowsinserted",this,i,e);this.refresh();this.fireEvent("rowsinserted",this,i,e)}else{if(!h){this.fireEvent("beforerowsinserted",this,i,e)}var b=this.renderRows(i,e),g=this.getRow(i);if(g){if(i===0){Ext.fly(this.getRow(0)).removeClass(this.firstRowCls)}Ext.DomHelper.insertHtml("beforeBegin",g,b)}else{var c=this.getRow(d-1);if(c){Ext.fly(c).removeClass(this.lastRowCls)}Ext.DomHelper.insertHtml("beforeEnd",this.mainBody.dom,b)}if(!h){this.processRows(i);this.fireEvent("rowsinserted",this,i,e)}else{if(i===0||i>=d){Ext.fly(this.getRow(i)).addClass(i===0?this.firstRowCls:this.lastRowCls)}}}this.syncFocusEl(i)},deleteRows:function(a,c,b){if(a.getRowCount()<1){this.refresh()}else{this.fireEvent("beforerowsdeleted",this,c,b);this.removeRows(c,b);this.processRows(c);this.fireEvent("rowsdeleted",this,c,b)}},getColumnStyle:function(b,d){var a=this.cm,g=a.config,c=d?"":g[b].css||"",e=g[b].align;c+=String.format("width: {0};",this.getColumnWidth(b));if(a.isHidden(b)){c+="display: none; "}if(e){c+=String.format("text-align: {0};",e)}return c},getColumnWidth:function(b){var c=this.cm.getColumnWidth(b),a=this.borderWidth;if(Ext.isNumber(c)){if(Ext.isBorderBox||(Ext.isWebKit&&!Ext.isSafari2)){return c+"px"}else{return Math.max(c-a,0)+"px"}}else{return c}},getTotalWidth:function(){return this.cm.getTotalWidth()+"px"},fitColumns:function(g,j,h){var a=this.grid,l=this.cm,s=l.getTotalWidth(false),q=this.getGridInnerWidth(),r=q-s,c=[],o=0,n=0,u,d,p;if(q<20||r===0){return false}var e=l.getColumnCount(true),m=l.getColumnCount(false),b=e-(Ext.isNumber(h)?1:0);if(b===0){b=1;h=undefined}for(p=0;p<m;p++){if(!l.isFixed(p)&&p!==h){u=l.getColumnWidth(p);c.push(p,u);if(!l.isHidden(p)){o=p;n+=u}}}d=(q-l.getTotalWidth())/n;while(c.length){u=c.pop();p=c.pop();l.setColumnWidth(p,Math.max(a.minColumnWidth,Math.floor(u+u*d)),true)}s=l.getTotalWidth(false);if(s>q){var t=(b==e)?o:h,k=Math.max(1,l.getColumnWidth(t)-(s-q));l.setColumnWidth(t,k,true)}if(g!==true){this.updateAllColumnWidths()}return true},autoExpand:function(k){var a=this.grid,i=this.cm,e=this.getGridInnerWidth(),c=i.getTotalWidth(false),g=a.autoExpandColumn;if(!this.userResized&&g){if(e!=c){var j=i.getIndexById(g),b=i.getColumnWidth(j),h=e-c+b,d=Math.min(Math.max(h,a.autoExpandMin),a.autoExpandMax);if(b!=d){i.setColumnWidth(j,d,true);if(k!==true){this.updateColumnWidth(j,d)}}}}},getGridInnerWidth:function(){return this.grid.getGridEl().getWidth(true)-this.getScrollOffset()},getColumnData:function(){var e=[],c=this.cm,g=c.getColumnCount(),a=this.ds.fields,d,b;for(d=0;d<g;d++){b=c.getDataIndex(d);e[d]={name:Ext.isDefined(b)?b:(a.get(d)?a.get(d).name:undefined),renderer:c.getRenderer(d),scope:c.getRendererScope(d),id:c.getColumnId(d),style:this.getColumnStyle(d)}}return e},renderRows:function(i,c){var a=this.grid,g=a.store,j=a.stripeRows,e=a.colModel,h=e.getColumnCount(),d=g.getCount(),b;if(d<1){return""}i=i||0;c=Ext.isDefined(c)?c:d-1;b=g.getRange(i,c);return this.doRender(this.getColumnData(),b,g,i,h,j)},renderBody:function(){var a=this.renderRows()||"&#160;";return this.templates.body.apply({rows:a})},refreshRow:function(g){var l=this.ds,m=this.cm.getColumnCount(),c=this.getColumnData(),n=m-1,p=["x-grid3-row"],e={tstyle:String.format("width: {0};",this.getTotalWidth())},a=[],k=this.templates.cell,j,q,b,o,h,d;if(Ext.isNumber(g)){j=g;g=l.getAt(j)}else{j=l.indexOf(g)}if(!g||j<0){return}for(d=0;d<m;d++){b=c[d];if(d==0){h="x-grid3-cell-first"}else{h=(d==n)?"x-grid3-cell-last ":""}o={id:b.id,style:b.style,css:h,attr:"",cellAttr:""};o.value=b.renderer.call(b.scope,g.data[b.name],o,g,j,d,l);if(Ext.isEmpty(o.value)){o.value="&#160;"}if(this.markDirty&&g.dirty&&typeof g.modified[b.name]!="undefined"){o.css+=" x-grid3-dirty-cell"}a[d]=k.apply(o)}q=this.getRow(j);q.className="";if(this.grid.stripeRows&&((j+1)%2===0)){p.push("x-grid3-row-alt")}if(this.getRowClass){e.cols=m;p.push(this.getRowClass(g,j,e,l))}this.fly(q).addClass(p).setStyle(e.tstyle);e.cells=a.join("");q.innerHTML=this.templates.rowInner.apply(e);this.fireEvent("rowupdated",this,j,g)},refresh:function(b){this.fireEvent("beforerefresh",this);this.grid.stopEditing(true);var a=this.renderBody();this.mainBody.update(a).setWidth(this.getTotalWidth());if(b===true){this.updateHeaders();this.updateHeaderSortState()}this.processRows(0,true);this.layout();this.applyEmptyText();this.fireEvent("refresh",this)},applyEmptyText:function(){if(this.emptyText&&!this.hasRows()){this.mainBody.update('<div class="x-grid-empty">'+this.emptyText+"</div>")}},updateHeaderSortState:function(){var b=this.ds.getSortState();if(!b){return}if(!this.sortState||(this.sortState.field!=b.field||this.sortState.direction!=b.direction)){this.grid.fireEvent("sortchange",this.grid,b)}this.sortState=b;var c=this.cm.findColumnIndex(b.field);if(c!=-1){var a=b.direction;this.updateSortIcon(c,a)}},clearHeaderSortState:function(){if(!this.sortState){return}this.grid.fireEvent("sortchange",this.grid,null);this.mainHd.select("td").removeClass(this.sortClasses);delete this.sortState},destroy:function(){var j=this,a=j.grid,d=a.getGridEl(),i=j.dragZone,g=j.splitZone,h=j.columnDrag,e=j.columnDrop,k=j.scrollToTopTask,c,b;if(k&&k.cancel){k.cancel()}Ext.destroyMembers(j,"colMenu","hmenu");j.initData(null,null);j.purgeListeners();Ext.fly(j.innerHd).un("click",j.handleHdDown,j);if(a.enableColumnMove){c=h.dragData;b=h.proxy;Ext.destroy(h.el,b.ghost,b.el,e.el,e.proxyTop,e.proxyBottom,c.ddel,c.header);if(b.anim){Ext.destroy(b.anim)}delete b.ghost;delete c.ddel;delete c.header;h.destroy();delete Ext.dd.DDM.locationCache[h.id];delete h._domRef;delete e.proxyTop;delete e.proxyBottom;e.destroy();delete Ext.dd.DDM.locationCache["gridHeader"+d.id];delete e._domRef;delete Ext.dd.DDM.ids[e.ddGroup]}if(g){g.destroy();delete g._domRef;delete Ext.dd.DDM.ids["gridSplitters"+d.id]}Ext.fly(j.innerHd).removeAllListeners();Ext.removeNode(j.innerHd);delete j.innerHd;Ext.destroy(j.el,j.mainWrap,j.mainHd,j.scroller,j.mainBody,j.focusEl,j.resizeMarker,j.resizeProxy,j.activeHdBtn,j._flyweight,i,g);delete a.container;if(i){i.destroy()}Ext.dd.DDM.currentTarget=null;delete Ext.dd.DDM.locationCache[d.id];Ext.EventManager.removeResizeListener(j.onWindowResize,j)},onDenyColumnHide:function(){},render:function(){if(this.autoFill){var a=this.grid.ownerCt;if(a&&a.getLayout()){a.on("afterlayout",function(){this.fitColumns(true,true);this.updateHeaders();this.updateHeaderSortState()},this,{single:true})}}else{if(this.forceFit){this.fitColumns(true,false)}else{if(this.grid.autoExpandColumn){this.autoExpand(true)}}}this.grid.getGridEl().dom.innerHTML=this.renderUI();this.afterRenderUI()},initData:function(a,e){var b=this;if(b.ds){var d=b.ds;d.un("add",b.onAdd,b);d.un("load",b.onLoad,b);d.un("clear",b.onClear,b);d.un("remove",b.onRemove,b);d.un("update",b.onUpdate,b);d.un("datachanged",b.onDataChange,b);if(d!==a&&d.autoDestroy){d.destroy()}}if(a){a.on({scope:b,load:b.onLoad,add:b.onAdd,remove:b.onRemove,update:b.onUpdate,clear:b.onClear,datachanged:b.onDataChange})}if(b.cm){var c=b.cm;c.un("configchange",b.onColConfigChange,b);c.un("widthchange",b.onColWidthChange,b);c.un("headerchange",b.onHeaderChange,b);c.un("hiddenchange",b.onHiddenChange,b);c.un("columnmoved",b.onColumnMove,b)}if(e){delete b.lastViewWidth;e.on({scope:b,configchange:b.onColConfigChange,widthchange:b.onColWidthChange,headerchange:b.onHeaderChange,hiddenchange:b.onHiddenChange,columnmoved:b.onColumnMove})}b.ds=a;b.cm=e},onDataChange:function(){this.refresh(true);this.updateHeaderSortState();this.syncFocusEl(0)},onClear:function(){this.refresh();this.syncFocusEl(0)},onUpdate:function(b,a){this.refreshRow(a)},onAdd:function(b,a,c){this.insertRows(b,c,c+(a.length-1))},onRemove:function(b,a,c,d){if(d!==true){this.fireEvent("beforerowremoved",this,c,a)}this.removeRow(c);if(d!==true){this.processRows(c);this.applyEmptyText();this.fireEvent("rowremoved",this,c,a)}},onLoad:function(){if(Ext.isGecko){if(!this.scrollToTopTask){this.scrollToTopTask=new Ext.util.DelayedTask(this.scrollToTop,this)}this.scrollToTopTask.delay(1)}else{this.scrollToTop()}},onColWidthChange:function(a,b,c){this.updateColumnWidth(b,c)},onHeaderChange:function(a,b,c){this.updateHeaders()},onHiddenChange:function(a,b,c){this.updateColumnHidden(b,c)},onColumnMove:function(a,c,b){this.indexMap=null;this.refresh(true);this.restoreScroll(this.getScrollState());this.afterMove(b);this.grid.fireEvent("columnmove",c,b)},onColConfigChange:function(){delete this.lastViewWidth;this.indexMap=null;this.refresh(true)},initUI:function(a){a.on("headerclick",this.onHeaderClick,this)},initEvents:Ext.emptyFn,onHeaderClick:function(b,a){if(this.headersDisabled||!this.cm.isSortable(a)){return}b.stopEditing(true);b.store.sort(this.cm.getDataIndex(a))},onRowOver:function(b,a){var c=this.findRowIndex(a);if(c!==false){this.addRowClass(c,this.rowOverCls)}},onRowOut:function(b,a){var c=this.findRowIndex(a);if(c!==false&&!b.within(this.getRow(c),true)){this.removeRowClass(c,this.rowOverCls)}},onRowSelect:function(a){this.addRowClass(a,this.selectedRowClass)},onRowDeselect:function(a){this.removeRowClass(a,this.selectedRowClass)},onCellSelect:function(c,b){var a=this.getCell(c,b);if(a){this.fly(a).addClass("x-grid3-cell-selected")}},onCellDeselect:function(c,b){var a=this.getCell(c,b);if(a){this.fly(a).removeClass("x-grid3-cell-selected")}},handleWheel:function(a){a.stopPropagation()},onColumnSplitterMoved:function(a,b){this.userResized=true;this.grid.colModel.setColumnWidth(a,b,true);if(this.forceFit){this.fitColumns(true,false,a);this.updateAllColumnWidths()}else{this.updateColumnWidth(a,b);this.syncHeaderScroll()}this.grid.fireEvent("columnresize",a,b)},beforeColMenuShow:function(){var b=this.cm,d=b.getColumnCount(),a=this.colMenu,c;a.removeAll();for(c=0;c<d;c++){if(b.config[c].hideable!==false){a.add(new Ext.menu.CheckItem({text:b.getColumnHeader(c),itemId:"col-"+b.getColumnId(c),checked:!b.isHidden(c),disabled:b.config[c].hideable===false,hideOnClick:false}))}}},handleHdMenuClick:function(c){var a=this.ds,b=this.cm.getDataIndex(this.hdCtxIndex);switch(c.getItemId()){case"asc":a.sort(b,"ASC");break;case"desc":a.sort(b,"DESC");break;default:this.handleHdMenuClickDefault(c)}return true},handleHdMenuClickDefault:function(c){var b=this.cm,d=c.getItemId(),a=b.getIndexById(d.substr(4));if(a!=-1){if(c.checked&&b.getColumnsBy(this.isHideableColumn,this).length<=1){this.onDenyColumnHide();return}b.setHidden(a,c.checked)}},handleHdDown:function(i,j){if(Ext.fly(j).hasClass("x-grid3-hd-btn")){i.stopEvent();var k=this.cm,g=this.findHeaderCell(j),h=this.getCellIndex(g),d=k.isSortable(h),c=this.hmenu,b=c.items,a=this.headerMenuOpenCls;this.hdCtxIndex=h;Ext.fly(g).addClass(a);b.get("asc").setDisabled(!d);b.get("desc").setDisabled(!d);c.on("hide",function(){Ext.fly(g).removeClass(a)},this,{single:true});c.show(j,"tl-bl?")}},handleHdMove:function(k){var i=this.findHeaderCell(this.activeHdRef);if(i&&!this.headersDisabled){var l=this.splitHandleWidth||5,j=this.activeHdRegion,p=i.style,m=this.cm,o="",g=k.getPageX();if(this.grid.enableColumnResize!==false){var a=this.activeHdIndex,b=this.getPreviousVisible(a),n=m.isResizable(a),c=b&&m.isResizable(b),d=g-j.left<=l,h=j.right-g<=(!this.activeHdBtn?l:2);if(d&&c){o=Ext.isAir?"move":Ext.isWebKit?"e-resize":"col-resize"}else{if(h&&n){o=Ext.isAir?"move":Ext.isWebKit?"w-resize":"col-resize"}}}p.cursor=o}},getPreviousVisible:function(a){while(a>0){if(!this.cm.isHidden(a-1)){return a}a--}return undefined},handleHdOver:function(c,b){var d=this.findHeaderCell(b);if(d&&!this.headersDisabled){var a=this.fly(d);this.activeHdRef=b;this.activeHdIndex=this.getCellIndex(d);this.activeHdRegion=a.getRegion();if(!this.isMenuDisabled(this.activeHdIndex,a)){a.addClass("x-grid3-hd-over");this.activeHdBtn=a.child(".x-grid3-hd-btn");if(this.activeHdBtn){this.activeHdBtn.dom.style.height=(d.firstChild.offsetHeight-1)+"px"}}}},handleHdOut:function(b,a){var c=this.findHeaderCell(a);if(c&&(!Ext.isIE||!b.within(c,true))){this.activeHdRef=null;this.fly(c).removeClass("x-grid3-hd-over");c.style.cursor=""}},isMenuDisabled:function(a,b){return this.cm.isMenuDisabled(a)},hasRows:function(){var a=this.mainBody.dom.firstChild;return a&&a.nodeType==1&&a.className!="x-grid-empty"},isHideableColumn:function(a){return !a.hidden},bind:function(a,b){this.initData(a,b)}});Ext.grid.GridView.SplitDragZone=Ext.extend(Ext.dd.DDProxy,{constructor:function(a,b){this.grid=a;this.view=a.getView();this.marker=this.view.resizeMarker;this.proxy=this.view.resizeProxy;Ext.grid.GridView.SplitDragZone.superclass.constructor.call(this,b,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});this.scroll=false;this.hw=this.view.splitHandleWidth||5},b4StartDrag:function(a,e){this.dragHeadersDisabled=this.view.headersDisabled;this.view.headersDisabled=true;var d=this.view.mainWrap.getHeight();this.marker.setHeight(d);this.marker.show();this.marker.alignTo(this.view.getHeaderCell(this.cellIndex),"tl-tl",[-2,0]);this.proxy.setHeight(d);var b=this.cm.getColumnWidth(this.cellIndex),c=Math.max(b-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(c,1000);this.setYConstraint(0,0);this.minX=a-c;this.maxX=a+1000;this.startPos=a;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,a,e)},allowHeaderDrag:function(a){return true},handleMouseDown:function(a){var h=this.view.findHeaderCell(a.getTarget());if(h&&this.allowHeaderDrag(a)){var k=this.view.fly(h).getXY(),c=k[0],i=a.getXY(),b=i[0],g=h.offsetWidth,d=false;if((b-c)<=this.hw){d=-1}else{if((c+g)-b<=this.hw){d=0}}if(d!==false){this.cm=this.grid.colModel;var j=this.view.getCellIndex(h);if(d==-1){if(j+d<0){return}while(this.cm.isHidden(j+d)){--d;if(j+d<0){return}}}this.cellIndex=j+d;this.split=h.dom;if(this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)){Ext.grid.GridView.SplitDragZone.superclass.handleMouseDown.apply(this,arguments)}}else{if(this.view.columnDrag){this.view.columnDrag.callHandleMouseDown(a)}}}},endDrag:function(g){this.marker.hide();var a=this.view,c=Math.max(this.minX,g.getPageX()),d=c-this.startPos,b=this.dragHeadersDisabled;a.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+d);setTimeout(function(){a.headersDisabled=b},50)},autoOffset:function(){this.setDelta(0,0)}});Ext.grid.PivotGridView=Ext.extend(Ext.grid.GridView,{colHeaderCellCls:"grid-hd-group-cell",title:"",getColumnHeaders:function(){return this.grid.topAxis.buildHeaders()},getRowHeaders:function(){return this.grid.leftAxis.buildHeaders()},renderRows:function(a,t){var b=this.grid,o=b.extractData(),p=o.length,g=this.templates,s=b.renderer,h=typeof s=="function",w=this.getCellCls,n=typeof w=="function",d=g.cell,x=g.row,k=[],q={},c="width:"+this.getGridInnerWidth()+"px;",l,r,e,v,m;a=a||0;t=Ext.isDefined(t)?t:p-1;for(v=0;v<p;v++){m=o[v];r=m.length;l=[];for(var u=0;u<r;u++){q.id=v+"-"+u;q.css=u===0?"x-grid3-cell-first ":(u==(r-1)?"x-grid3-cell-last ":"");q.attr=q.cellAttr="";q.value=m[u];if(Ext.isEmpty(q.value)){q.value="&#160;"}if(h){q.value=s(q.value)}if(n){q.css+=w(q.value)+" "}l[l.length]=d.apply(q)}k[k.length]=x.apply({tstyle:c,cols:r,cells:l.join(""),alt:""})}return k.join("")},masterTpl:new Ext.Template('<div class="x-grid3 x-pivotgrid" hidefocus="true">','<div class="x-grid3-viewport">','<div class="x-grid3-header">','<div class="x-grid3-header-title"><span>{title}</span></div>','<div class="x-grid3-header-inner">','<div class="x-grid3-header-offset" style="{ostyle}"></div>',"</div>",'<div class="x-clear"></div>',"</div>",'<div class="x-grid3-scroller">','<div class="x-grid3-row-headers"></div>','<div class="x-grid3-body" style="{bstyle}">{body}</div>','<a href="#" class="x-grid3-focus" tabIndex="-1"></a>',"</div>","</div>",'<div class="x-grid3-resize-marker">&#160;</div>','<div class="x-grid3-resize-proxy">&#160;</div>',"</div>"),initTemplates:function(){Ext.grid.PivotGridView.superclass.initTemplates.apply(this,arguments);var a=this.templates||{};if(!a.gcell){a.gcell=new Ext.XTemplate('<td class="x-grid3-hd x-grid3-gcell x-grid3-td-{id} ux-grid-hd-group-row-{row} '+this.colHeaderCellCls+'" style="{style}">','<div {tooltip} class="x-grid3-hd-inner x-grid3-hd-{id}" unselectable="on" style="{istyle}">',this.grid.enableHdMenu?'<a class="x-grid3-hd-btn" href="#"></a>':"","{value}","</div>","</td>")}this.templates=a;this.hrowRe=new RegExp("ux-grid-hd-group-row-(\\d+)","")},initElements:function(){Ext.grid.PivotGridView.superclass.initElements.apply(this,arguments);this.rowHeadersEl=new Ext.Element(this.scroller.child("div.x-grid3-row-headers"));this.headerTitleEl=new Ext.Element(this.mainHd.child("div.x-grid3-header-title"))},getGridInnerWidth:function(){var a=Ext.grid.PivotGridView.superclass.getGridInnerWidth.apply(this,arguments);return a-this.getTotalRowHeaderWidth()},getTotalRowHeaderWidth:function(){var d=this.getRowHeaders(),c=d.length,b=0,a;for(a=0;a<c;a++){b+=d[a].width}return b},getTotalColumnHeaderHeight:function(){return this.getColumnHeaders().length*21},getCellIndex:function(b){if(b){var a=b.className.match(this.colRe),c;if(a&&(c=a[1])){return parseInt(c.split("-")[1],10)}}return false},renderUI:function(){var b=this.templates,a=this.getGridInnerWidth();return b.master.apply({body:b.body.apply({rows:"&#160;"}),ostyle:"width:"+a+"px",bstyle:"width:"+a+"px"})},onLayout:function(b,a){Ext.grid.PivotGridView.superclass.onLayout.apply(this,arguments);var b=this.getGridInnerWidth();this.resizeColumnHeaders(b);this.resizeAllRows(b)},refresh:function(b){this.fireEvent("beforerefresh",this);this.grid.stopEditing(true);var a=this.renderBody();this.mainBody.update(a).setWidth(this.getGridInnerWidth());if(b===true){this.updateHeaders();this.updateHeaderSortState()}this.processRows(0,true);this.layout();this.applyEmptyText();this.fireEvent("refresh",this)},renderHeaders:Ext.emptyFn,fitColumns:Ext.emptyFn,resizeColumnHeaders:function(b){var a=this.grid.topAxis;if(a.rendered){a.el.setWidth(b)}},resizeRowHeaders:function(){var a=this.getTotalRowHeaderWidth(),b=String.format("margin-left: {0}px;",a);this.rowHeadersEl.setWidth(a);this.mainBody.applyStyles(b);Ext.fly(this.innerHd).applyStyles(b);this.headerTitleEl.setWidth(a);this.headerTitleEl.setHeight(this.getTotalColumnHeaderHeight())},resizeAllRows:function(b){var d=this.getRows(),c=d.length,a;for(a=0;a<c;a++){Ext.fly(d[a]).setWidth(b);Ext.fly(d[a]).child("table").setWidth(b)}},updateHeaders:function(){this.renderGroupRowHeaders();this.renderGroupColumnHeaders()},renderGroupRowHeaders:function(){var a=this.grid.leftAxis;this.resizeRowHeaders();a.rendered=false;a.render(this.rowHeadersEl);this.setTitle(this.title)},setTitle:function(a){this.headerTitleEl.child("span").dom.innerHTML=a},renderGroupColumnHeaders:function(){var a=this.grid.topAxis;a.rendered=false;a.render(this.innerHd.firstChild)},isMenuDisabled:function(a,b){return true}});Ext.grid.PivotAxis=Ext.extend(Ext.Component,{orientation:"horizontal",defaultHeaderWidth:80,paddingWidth:7,setDimensions:function(a){this.dimensions=a},onRender:function(b,a){var c=this.orientation=="horizontal"?this.renderHorizontalRows():this.renderVerticalRows();this.el=Ext.DomHelper.overwrite(b.dom,{tag:"table",cn:c},true)},renderHorizontalRows:function(){var k=this.buildHeaders(),a=k.length,g=[],c,h,e,d,b;for(d=0;d<a;d++){c=[];h=k[d].items;e=h.length;for(b=0;b<e;b++){c.push({tag:"td",html:h[b].header,colspan:h[b].span})}g[d]={tag:"tr",cn:c}}return g},renderVerticalRows:function(){var b=this.buildHeaders(),k=b.length,a=[],m=[],h,c,l,g,e,d;for(e=0;e<k;e++){c=b[e];g=c.width||80;h=c.items.length;for(d=0;d<h;d++){l=c.items[d];a[l.start]=a[l.start]||[];a[l.start].push({tag:"td",html:l.header,rowspan:l.span,width:Ext.isBorderBox?g:g-this.paddingWidth})}}h=a.length;for(e=0;e<h;e++){m[e]={tag:"tr",cn:a[e]}}return m},getTuples:function(){var b=new Ext.data.Store({});b.data=this.store.data.clone();b.fields=this.store.fields;var l=[],a=this.dimensions,c=a.length,j;for(j=0;j<c;j++){l.push({field:a[j].dataIndex,direction:a[j].direction||"ASC"})}b.sort(l);var e=b.data.items,n=[],k=[],o,h,d,g,m;c=e.length;for(j=0;j<c;j++){d=this.getRecordInfo(e[j]);g=d.data;h="";for(m in g){h+=g[m]+"---"}if(n.indexOf(h)==-1){n.push(h);k.push(d)}}b.destroy();return k},getRecordInfo:function(a){var e=this.dimensions,d=e.length,h={},j,c,b;for(b=0;b<d;b++){j=e[b];c=j.dataIndex;h[c]=a.get(c)}var g=function(i){return function(k){for(var l in i){if(k.get(l)!=i[l]){return false}}return true}};return{data:h,matcher:g(h)}},buildHeaders:function(){var l=this.getTuples(),m=l.length,a=this.dimensions,e,r=a.length,c=[],o,s,n,q,p,b,k,h,g,d;for(g=0;g<r;g++){e=a[g];s=[];p=0;b=0;for(d=0;d<m;d++){o=l[d];k=d==(m-1);n=o.data[e.dataIndex];h=q!=undefined&&q!=n;if(g>0&&d>0){h=h||o.data[a[g-1].dataIndex]!=l[d-1].data[a[g-1].dataIndex]}if(h){s.push({header:q,span:p,start:b});b+=p;p=0}if(k){s.push({header:n,span:p+1,start:b});b+=p;p=0}q=n;p++}c.push({items:s,width:e.width||this.defaultHeaderWidth});q=undefined}return c}});Ext.grid.HeaderDragZone=Ext.extend(Ext.dd.DragZone,{maxDragWidth:120,constructor:function(a,c,b){this.grid=a;this.view=a.getView();this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDragZone.superclass.constructor.call(this,c);if(b){this.setHandleElId(Ext.id(c));this.setOuterHandleElId(Ext.id(b))}this.scroll=false},getDragData:function(c){var a=Ext.lib.Event.getTarget(c),b=this.view.findHeaderCell(a);if(b){return{ddel:b.firstChild,header:b}}return false},onInitDrag:function(a){this.dragHeadersDisabled=this.view.headersDisabled;this.view.headersDisabled=true;var b=this.dragData.ddel.cloneNode(true);b.id=Ext.id();b.style.width=Math.min(this.dragData.header.offsetWidth,this.maxDragWidth)+"px";this.proxy.update(b);return true},afterValidDrop:function(){this.completeDrop()},afterInvalidDrop:function(){this.completeDrop()},completeDrop:function(){var a=this.view,b=this.dragHeadersDisabled;setTimeout(function(){a.headersDisabled=b},50)}});Ext.grid.HeaderDropZone=Ext.extend(Ext.dd.DropZone,{proxyOffsets:[-4,-9],fly:Ext.Element.fly,constructor:function(a,c,b){this.grid=a;this.view=a.getView();this.proxyTop=Ext.DomHelper.append(document.body,{cls:"col-move-top",html:"&#160;"},true);this.proxyBottom=Ext.DomHelper.append(document.body,{cls:"col-move-bottom",html:"&#160;"},true);this.proxyTop.hide=this.proxyBottom.hide=function(){this.setLeftTop(-100,-100);this.setStyle("visibility","hidden")};this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDropZone.superclass.constructor.call(this,a.getGridEl().dom)},getTargetFromEvent:function(c){var a=Ext.lib.Event.getTarget(c),b=this.view.findCellIndex(a);if(b!==false){return this.view.getHeaderCell(b)}},nextVisible:function(c){var b=this.view,a=this.grid.colModel;c=c.nextSibling;while(c){if(!a.isHidden(b.getCellIndex(c))){return c}c=c.nextSibling}return null},prevVisible:function(c){var b=this.view,a=this.grid.colModel;c=c.prevSibling;while(c){if(!a.isHidden(b.getCellIndex(c))){return c}c=c.prevSibling}return null},positionIndicator:function(d,k,j){var a=Ext.lib.Event.getPageX(j),g=Ext.lib.Dom.getRegion(k.firstChild),c,i,b=g.top+this.proxyOffsets[1];if((g.right-a)<=(g.right-g.left)/2){c=g.right+this.view.borderWidth;i="after"}else{c=g.left;i="before"}if(this.grid.colModel.isFixed(this.view.getCellIndex(k))){return false}c+=this.proxyOffsets[0];this.proxyTop.setLeftTop(c,b);this.proxyTop.show();if(!this.bottomOffset){this.bottomOffset=this.view.mainHd.getHeight()}this.proxyBottom.setLeftTop(c,b+this.proxyTop.dom.offsetHeight+this.bottomOffset);this.proxyBottom.show();return i},onNodeEnter:function(d,a,c,b){if(b.header!=d){this.positionIndicator(b.header,d,c)}},onNodeOver:function(g,b,d,c){var a=false;if(c.header!=g){a=this.positionIndicator(c.header,g,d)}if(!a){this.proxyTop.hide();this.proxyBottom.hide()}return a?this.dropAllowed:this.dropNotAllowed},onNodeOut:function(d,a,c,b){this.proxyTop.hide();this.proxyBottom.hide()},onNodeDrop:function(b,m,g,c){var d=c.header;if(d!=b){var k=this.grid.colModel,j=Ext.lib.Event.getPageX(g),a=Ext.lib.Dom.getRegion(b.firstChild),o=(a.right-j)<=((a.right-a.left)/2)?"after":"before",i=this.view.getCellIndex(d),l=this.view.getCellIndex(b);if(o=="after"){l++}if(i<l){l--}k.moveColumn(i,l);return true}return false}});Ext.grid.GridView.ColumnDragZone=Ext.extend(Ext.grid.HeaderDragZone,{constructor:function(a,b){Ext.grid.GridView.ColumnDragZone.superclass.constructor.call(this,a,b,null);this.proxy.el.addClass("x-grid3-col-dd")},handleMouseDown:function(a){},callHandleMouseDown:function(a){Ext.grid.GridView.ColumnDragZone.superclass.handleMouseDown.call(this,a)}});Ext.grid.SplitDragZone=Ext.extend(Ext.dd.DDProxy,{fly:Ext.Element.fly,constructor:function(a,c,b){this.grid=a;this.view=a.getView();this.proxy=this.view.resizeProxy;Ext.grid.SplitDragZone.superclass.constructor.call(this,c,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});this.setHandleElId(Ext.id(c));this.setOuterHandleElId(Ext.id(b));this.scroll=false},b4StartDrag:function(a,d){this.view.headersDisabled=true;this.proxy.setHeight(this.view.mainWrap.getHeight());var b=this.cm.getColumnWidth(this.cellIndex);var c=Math.max(b-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(c,1000);this.setYConstraint(0,0);this.minX=a-c;this.maxX=a+1000;this.startPos=a;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,a,d)},handleMouseDown:function(c){var b=Ext.EventObject.setEvent(c);var a=this.fly(b.getTarget());if(a.hasClass("x-grid-split")){this.cellIndex=this.view.getCellIndex(a.dom);this.split=a.dom;this.cm=this.grid.colModel;if(this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)){Ext.grid.SplitDragZone.superclass.handleMouseDown.apply(this,arguments)}}},endDrag:function(c){this.view.headersDisabled=false;var a=Math.max(this.minX,Ext.lib.Event.getPageX(c));var b=a-this.startPos;this.view.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+b)},autoOffset:function(){this.setDelta(0,0)}});Ext.grid.GridDragZone=function(b,a){this.view=b.getView();Ext.grid.GridDragZone.superclass.constructor.call(this,this.view.mainBody.dom,a);this.scroll=false;this.grid=b;this.ddel=document.createElement("div");this.ddel.className="x-grid-dd-wrap"};Ext.extend(Ext.grid.GridDragZone,Ext.dd.DragZone,{ddGroup:"GridDD",getDragData:function(b){var a=Ext.lib.Event.getTarget(b);var d=this.view.findRowIndex(a);if(d!==false){var c=this.grid.selModel;if(!c.isSelected(d)||b.hasModifier()){c.handleMouseDown(this.grid,d,b)}return{grid:this.grid,ddel:this.ddel,rowIndex:d,selections:c.getSelections()}}return false},onInitDrag:function(b){var a=this.dragData;this.ddel.innerHTML=this.grid.getDragDropText();this.proxy.update(this.ddel)},afterRepair:function(){this.dragging=false},getRepairXY:function(b,a){return false},onEndDrag:function(a,b){},onValidDrop:function(a,b,c){this.hideProxy()},beforeInvalidDrop:function(a,b){}});Ext.grid.ColumnModel=Ext.extend(Ext.util.Observable,{defaultWidth:100,defaultSortable:false,constructor:function(a){if(a.columns){Ext.apply(this,a);this.setConfig(a.columns,true)}else{this.setConfig(a,true)}this.addEvents("widthchange","headerchange","hiddenchange","columnmoved","configchange");Ext.grid.ColumnModel.superclass.constructor.call(this)},getColumnId:function(a){return this.config[a].id},getColumnAt:function(a){return this.config[a]},setConfig:function(d,b){var e,h,a;if(!b){delete this.totalWidth;for(e=0,a=this.config.length;e<a;e++){h=this.config[e];if(h.setEditor){h.setEditor(null)}}}this.defaults=Ext.apply({width:this.defaultWidth,sortable:this.defaultSortable},this.defaults);this.config=d;this.lookup={};for(e=0,a=d.length;e<a;e++){h=Ext.applyIf(d[e],this.defaults);if(Ext.isEmpty(h.id)){h.id=e}if(!h.isColumn){var g=Ext.grid.Column.types[h.xtype||"gridcolumn"];h=new g(h);d[e]=h}this.lookup[h.id]=h}if(!b){this.fireEvent("configchange",this)}},getColumnById:function(a){return this.lookup[a]},getIndexById:function(c){for(var b=0,a=this.config.length;b<a;b++){if(this.config[b].id==c){return b}}return -1},moveColumn:function(e,b){var a=this.config,d=a[e];a.splice(e,1);a.splice(b,0,d);this.dataMap=null;this.fireEvent("columnmoved",this,e,b)},getColumnCount:function(b){var d=this.config.length,e=0,a;if(b===true){for(a=0;a<d;a++){if(!this.isHidden(a)){e++}}return e}return d},getColumnsBy:function(g,e){var b=this.config,h=b.length,a=[],d,j;for(d=0;d<h;d++){j=b[d];if(g.call(e||this,j,d)===true){a[a.length]=j}}return a},isSortable:function(a){return !!this.config[a].sortable},isMenuDisabled:function(a){return !!this.config[a].menuDisabled},getRenderer:function(a){return this.config[a].renderer||Ext.grid.ColumnModel.defaultRenderer},getRendererScope:function(a){return this.config[a].scope},setRenderer:function(a,b){this.config[a].renderer=b},getColumnWidth:function(a){var b=this.config[a].width;if(typeof b!="number"){b=this.defaultWidth}return b},setColumnWidth:function(b,c,a){this.config[b].width=c;this.totalWidth=null;if(!a){this.fireEvent("widthchange",this,b,c)}},getTotalWidth:function(b){if(!this.totalWidth){this.totalWidth=0;for(var c=0,a=this.config.length;c<a;c++){if(b||!this.isHidden(c)){this.totalWidth+=this.getColumnWidth(c)}}}return this.totalWidth},getColumnHeader:function(a){return this.config[a].header},setColumnHeader:function(a,b){this.config[a].header=b;this.fireEvent("headerchange",this,a,b)},getColumnTooltip:function(a){return this.config[a].tooltip},setColumnTooltip:function(a,b){this.config[a].tooltip=b},getDataIndex:function(a){return this.config[a].dataIndex},setDataIndex:function(a,b){this.config[a].dataIndex=b},findColumnIndex:function(d){var e=this.config;for(var b=0,a=e.length;b<a;b++){if(e[b].dataIndex==d){return b}}return -1},isCellEditable:function(b,e){var d=this.config[b],a=d.editable;return !!(a||(!Ext.isDefined(a)&&d.editor))},getCellEditor:function(a,b){return this.config[a].getCellEditor(b)},setEditable:function(a,b){this.config[a].editable=b},isHidden:function(a){return !!this.config[a].hidden},isFixed:function(a){return !!this.config[a].fixed},isResizable:function(a){return a>=0&&this.config[a].resizable!==false&&this.config[a].fixed!==true},setHidden:function(a,b){var d=this.config[a];if(d.hidden!==b){d.hidden=b;this.totalWidth=null;this.fireEvent("hiddenchange",this,a,b)}},setEditor:function(a,b){this.config[a].setEditor(b)},destroy:function(){var b=this.config.length,a=0;for(;a<b;a++){this.config[a].destroy()}delete this.config;delete this.lookup;this.purgeListeners()},setState:function(a,b){b=Ext.applyIf(b,this.defaults);Ext.apply(this.config[a],b)}});Ext.grid.ColumnModel.defaultRenderer=function(a){if(typeof a=="string"&&a.length<1){return"&#160;"}return a};Ext.grid.AbstractSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(){this.locked=false;Ext.grid.AbstractSelectionModel.superclass.constructor.call(this)},init:function(a){this.grid=a;if(this.lockOnInit){delete this.lockOnInit;this.locked=false;this.lock()}this.initEvents()},lock:function(){if(!this.locked){this.locked=true;var a=this.grid;if(a){a.getView().on({scope:this,beforerefresh:this.sortUnLock,refresh:this.sortLock})}else{this.lockOnInit=true}}},sortLock:function(){this.locked=true},sortUnLock:function(){this.locked=false},unlock:function(){if(this.locked){this.locked=false;var a=this.grid,b;if(a){b=a.getView();b.un("beforerefresh",this.sortUnLock,this);b.un("refresh",this.sortLock,this)}else{delete this.lockOnInit}}},isLocked:function(){return this.locked},destroy:function(){this.unlock();this.purgeListeners()}});Ext.grid.RowSelectionModel=Ext.extend(Ext.grid.AbstractSelectionModel,{singleSelect:false,constructor:function(a){Ext.apply(this,a);this.selections=new Ext.util.MixedCollection(false,function(b){return b.id});this.last=false;this.lastActive=false;this.addEvents("selectionchange","beforerowselect","rowselect","rowdeselect");Ext.grid.RowSelectionModel.superclass.constructor.call(this)},initEvents:function(){if(!this.grid.enableDragDrop&&!this.grid.enableDrag){this.grid.on("rowmousedown",this.handleMouseDown,this)}this.rowNav=new Ext.KeyNav(this.grid.getGridEl(),{up:this.onKeyPress,down:this.onKeyPress,scope:this});this.grid.getView().on({scope:this,refresh:this.onRefresh,rowupdated:this.onRowUpdated,rowremoved:this.onRemove})},onKeyPress:function(g,b){var a=b=="up",h=a?"selectPrevious":"selectNext",d=a?-1:1,c;if(!g.shiftKey||this.singleSelect){this[h](false)}else{if(this.last!==false&&this.lastActive!==false){c=this.last;this.selectRange(this.last,this.lastActive+d);this.grid.getView().focusRow(this.lastActive);if(c!==false){this.last=c}}else{this.selectFirstRow()}}},onRefresh:function(){var g=this.grid.store,d=this.getSelections(),c=0,a=d.length,b,e;this.silent=true;this.clearSelections(true);for(;c<a;c++){e=d[c];if((b=g.indexOfId(e.id))!=-1){this.selectRow(b,true)}}if(d.length!=this.selections.getCount()){this.fireEvent("selectionchange",this)}this.silent=false},onRemove:function(a,b,c){if(this.selections.remove(c)!==false){this.fireEvent("selectionchange",this)}},onRowUpdated:function(a,b,c){if(this.isSelected(c)){a.onRowSelect(b)}},selectRecords:function(b,e){if(!e){this.clearSelections()}var d=this.grid.store,c=0,a=b.length;for(;c<a;c++){this.selectRow(d.indexOf(b[c]),true)}},getCount:function(){return this.selections.length},selectFirstRow:function(){this.selectRow(0)},selectLastRow:function(a){this.selectRow(this.grid.store.getCount()-1,a)},selectNext:function(a){if(this.hasNext()){this.selectRow(this.last+1,a);this.grid.getView().focusRow(this.last);return true}return false},selectPrevious:function(a){if(this.hasPrevious()){this.selectRow(this.last-1,a);this.grid.getView().focusRow(this.last);return true}return false},hasNext:function(){return this.last!==false&&(this.last+1)<this.grid.store.getCount()},hasPrevious:function(){return !!this.last},getSelections:function(){return[].concat(this.selections.items)},getSelected:function(){return this.selections.itemAt(0)},each:function(e,d){var c=this.getSelections(),b=0,a=c.length;for(;b<a;b++){if(e.call(d||this,c[b],b)===false){return false}}return true},clearSelections:function(a){if(this.isLocked()){return}if(a!==true){var c=this.grid.store,b=this.selections;b.each(function(d){this.deselectRow(c.indexOfId(d.id))},this);b.clear()}else{this.selections.clear()}this.last=false},selectAll:function(){if(this.isLocked()){return}this.selections.clear();for(var b=0,a=this.grid.store.getCount();b<a;b++){this.selectRow(b,true)}},hasSelection:function(){return this.selections.length>0},isSelected:function(a){var b=Ext.isNumber(a)?this.grid.store.getAt(a):a;return(b&&this.selections.key(b.id)?true:false)},isIdSelected:function(a){return(this.selections.key(a)?true:false)},handleMouseDown:function(d,i,h){if(h.button!==0||this.isLocked()){return}var a=this.grid.getView();if(h.shiftKey&&!this.singleSelect&&this.last!==false){var c=this.last;this.selectRange(c,i,h.ctrlKey);this.last=c;a.focusRow(i)}else{var b=this.isSelected(i);if(h.ctrlKey&&b){this.deselectRow(i)}else{if(!b||this.getCount()>1){this.selectRow(i,h.ctrlKey||h.shiftKey);a.focusRow(i)}}}},selectRows:function(c,d){if(!d){this.clearSelections()}for(var b=0,a=c.length;b<a;b++){this.selectRow(c[b],true)}},selectRange:function(b,a,d){var c;if(this.isLocked()){return}if(!d){this.clearSelections()}if(b<=a){for(c=b;c<=a;c++){this.selectRow(c,true)}}else{for(c=b;c>=a;c--){this.selectRow(c,true)}}},deselectRange:function(c,b,a){if(this.isLocked()){return}for(var d=c;d<=b;d++){this.deselectRow(d,a)}},selectRow:function(b,d,a){if(this.isLocked()||(b<0||b>=this.grid.store.getCount())||(d&&this.isSelected(b))){return}var c=this.grid.store.getAt(b);if(c&&this.fireEvent("beforerowselect",this,b,d,c)!==false){if(!d||this.singleSelect){this.clearSelections()}this.selections.add(c);this.last=this.lastActive=b;if(!a){this.grid.getView().onRowSelect(b)}if(!this.silent){this.fireEvent("rowselect",this,b,c);this.fireEvent("selectionchange",this)}}},deselectRow:function(b,a){if(this.isLocked()){return}if(this.last==b){this.last=false}if(this.lastActive==b){this.lastActive=false}var c=this.grid.store.getAt(b);if(c){this.selections.remove(c);if(!a){this.grid.getView().onRowDeselect(b)}this.fireEvent("rowdeselect",this,b,c);this.fireEvent("selectionchange",this)}},acceptsNav:function(c,b,a){return !a.isHidden(b)&&a.isCellEditable(b,c)},onEditorKey:function(n,l){var d=l.getKey(),h,i=this.grid,p=i.lastEdit,j=i.activeEditor,b=l.shiftKey,o,p,a,m;if(d==l.TAB){l.stopEvent();j.completeEdit();if(b){h=i.walkCells(j.row,j.col-1,-1,this.acceptsNav,this)}else{h=i.walkCells(j.row,j.col+1,1,this.acceptsNav,this)}}else{if(d==l.ENTER){if(this.moveEditorOnEnter!==false){if(b){h=i.walkCells(p.row-1,p.col,-1,this.acceptsNav,this)}else{h=i.walkCells(p.row+1,p.col,1,this.acceptsNav,this)}}}}if(h){a=h[0];m=h[1];this.onEditorSelect(a,p.row);if(i.isEditor&&i.editing){o=i.activeEditor;if(o&&o.field.triggerBlur){o.field.triggerBlur()}}i.startEditing(a,m)}},onEditorSelect:function(b,a){if(a!=b){this.selectRow(b)}},destroy:function(){Ext.destroy(this.rowNav);this.rowNav=null;Ext.grid.RowSelectionModel.superclass.destroy.call(this)}});Ext.grid.Column=Ext.extend(Ext.util.Observable,{isColumn:true,constructor:function(b){Ext.apply(this,b);if(Ext.isString(this.renderer)){this.renderer=Ext.util.Format[this.renderer]}else{if(Ext.isObject(this.renderer)){this.scope=this.renderer.scope;this.renderer=this.renderer.fn}}if(!this.scope){this.scope=this}var a=this.editor;delete this.editor;this.setEditor(a);this.addEvents("click","contextmenu","dblclick","mousedown");Ext.grid.Column.superclass.constructor.call(this)},processEvent:function(b,d,c,g,a){return this.fireEvent(b,this,c,g,d)},destroy:function(){if(this.setEditor){this.setEditor(null)}this.purgeListeners()},renderer:function(a){return a},getEditor:function(a){return this.editable!==false?this.editor:null},setEditor:function(b){var a=this.editor;if(a){if(a.gridEditor){a.gridEditor.destroy();delete a.gridEditor}else{a.destroy()}}this.editor=null;if(b){if(!b.isXType){b=Ext.create(b,"textfield")}this.editor=b}},getCellEditor:function(b){var a=this.getEditor(b);if(a){if(!a.startEdit){if(!a.gridEditor){a.gridEditor=new Ext.grid.GridEditor(a)}a=a.gridEditor}}return a}});Ext.grid.BooleanColumn=Ext.extend(Ext.grid.Column,{trueText:"true",falseText:"false",undefinedText:"&#160;",constructor:function(a){Ext.grid.BooleanColumn.superclass.constructor.call(this,a);var c=this.trueText,d=this.falseText,b=this.undefinedText;this.renderer=function(e){if(e===undefined){return b}if(!e||e==="false"){return d}return c}}});Ext.grid.NumberColumn=Ext.extend(Ext.grid.Column,{format:"0,000.00",constructor:function(a){Ext.grid.NumberColumn.superclass.constructor.call(this,a);this.renderer=Ext.util.Format.numberRenderer(this.format)}});Ext.grid.DateColumn=Ext.extend(Ext.grid.Column,{format:"m/d/Y",constructor:function(a){Ext.grid.DateColumn.superclass.constructor.call(this,a);this.renderer=Ext.util.Format.dateRenderer(this.format)}});Ext.grid.TemplateColumn=Ext.extend(Ext.grid.Column,{constructor:function(a){Ext.grid.TemplateColumn.superclass.constructor.call(this,a);var b=(!Ext.isPrimitive(this.tpl)&&this.tpl.compile)?this.tpl:new Ext.XTemplate(this.tpl);this.renderer=function(d,e,c){return b.apply(c.data)};this.tpl=b}});Ext.grid.ActionColumn=Ext.extend(Ext.grid.Column,{header:"&#160;",actionIdRe:/x-action-col-(\d+)/,altText:"",constructor:function(b){var g=this,c=b.items||(g.items=[g]),a=c.length,d,e;Ext.grid.ActionColumn.superclass.constructor.call(g,b);g.renderer=function(h,i){h=Ext.isFunction(b.renderer)?b.renderer.apply(this,arguments)||"":"";i.css+=" x-action-col-cell";for(d=0;d<a;d++){e=c[d];h+='<img alt="'+(e.altText||g.altText)+'" src="'+(e.icon||Ext.BLANK_IMAGE_URL)+'" class="x-action-col-icon x-action-col-'+String(d)+" "+(e.iconCls||"")+" "+(Ext.isFunction(e.getClass)?e.getClass.apply(e.scope||this.scope||this,arguments):"")+'"'+((e.tooltip)?' ext:qtip="'+e.tooltip+'"':"")+" />"}return h}},destroy:function(){delete this.items;delete this.renderer;return Ext.grid.ActionColumn.superclass.destroy.apply(this,arguments)},processEvent:function(c,i,d,j,b){var a=i.getTarget().className.match(this.actionIdRe),h,g;if(a&&(h=this.items[parseInt(a[1],10)])){if(c=="click"){(g=h.handler||this.handler)&&g.call(h.scope||this.scope||this,d,j,b,h,i)}else{if((c=="mousedown")&&(h.stopSelection!==false)){return false}}}return Ext.grid.ActionColumn.superclass.processEvent.apply(this,arguments)}});Ext.grid.Column.types={gridcolumn:Ext.grid.Column,booleancolumn:Ext.grid.BooleanColumn,numbercolumn:Ext.grid.NumberColumn,datecolumn:Ext.grid.DateColumn,templatecolumn:Ext.grid.TemplateColumn,actioncolumn:Ext.grid.ActionColumn};Ext.grid.RowNumberer=Ext.extend(Object,{header:"",width:23,sortable:false,constructor:function(a){Ext.apply(this,a);if(this.rowspan){this.renderer=this.renderer.createDelegate(this)}},fixed:true,hideable:false,menuDisabled:true,dataIndex:"",id:"numberer",rowspan:undefined,renderer:function(b,c,a,d){if(this.rowspan){c.cellAttr='rowspan="'+this.rowspan+'"'}return d+1}});Ext.grid.CheckboxSelectionModel=Ext.extend(Ext.grid.RowSelectionModel,{header:'<div class="x-grid3-hd-checker">&#160;</div>',width:20,sortable:false,menuDisabled:true,fixed:true,hideable:false,dataIndex:"",id:"checker",isColumn:true,constructor:function(){Ext.grid.CheckboxSelectionModel.superclass.constructor.apply(this,arguments);if(this.checkOnly){this.handleMouseDown=Ext.emptyFn}},initEvents:function(){Ext.grid.CheckboxSelectionModel.superclass.initEvents.call(this);this.grid.on("render",function(){Ext.fly(this.grid.getView().innerHd).on("mousedown",this.onHdMouseDown,this)},this)},processEvent:function(b,d,c,g,a){if(b=="mousedown"){this.onMouseDown(d,d.getTarget());return false}else{return Ext.grid.Column.prototype.processEvent.apply(this,arguments)}},onMouseDown:function(c,b){if(c.button===0&&b.className=="x-grid3-row-checker"){c.stopEvent();var d=c.getTarget(".x-grid3-row");if(d){var a=d.rowIndex;if(this.isSelected(a)){this.deselectRow(a)}else{this.selectRow(a,true);this.grid.getView().focusRow(a)}}}},onHdMouseDown:function(c,a){if(a.className=="x-grid3-hd-checker"){c.stopEvent();var b=Ext.fly(a.parentNode);var d=b.hasClass("x-grid3-hd-checker-on");if(d){b.removeClass("x-grid3-hd-checker-on");this.clearSelections()}else{b.addClass("x-grid3-hd-checker-on");this.selectAll()}}},renderer:function(b,c,a){return'<div class="x-grid3-row-checker">&#160;</div>'},onEditorSelect:function(b,a){if(a!=b&&!this.checkOnly){this.selectRow(b)}}});Ext.grid.CellSelectionModel=Ext.extend(Ext.grid.AbstractSelectionModel,{constructor:function(a){Ext.apply(this,a);this.selection=null;this.addEvents("beforecellselect","cellselect","selectionchange");Ext.grid.CellSelectionModel.superclass.constructor.call(this)},initEvents:function(){this.grid.on("cellmousedown",this.handleMouseDown,this);this.grid.on(Ext.EventManager.getKeyEvent(),this.handleKeyDown,this);this.grid.getView().on({scope:this,refresh:this.onViewChange,rowupdated:this.onRowUpdated,beforerowremoved:this.clearSelections,beforerowsinserted:this.clearSelections});if(this.grid.isEditor){this.grid.on("beforeedit",this.beforeEdit,this)}},beforeEdit:function(a){this.select(a.row,a.column,false,true,a.record)},onRowUpdated:function(a,b,c){if(this.selection&&this.selection.record==c){a.onCellSelect(b,this.selection.cell[1])}},onViewChange:function(){this.clearSelections(true)},getSelectedCell:function(){return this.selection?this.selection.cell:null},clearSelections:function(b){var a=this.selection;if(a){if(b!==true){this.grid.view.onCellDeselect(a.cell[0],a.cell[1])}this.selection=null;this.fireEvent("selectionchange",this,null)}},hasSelection:function(){return this.selection?true:false},handleMouseDown:function(b,d,a,c){if(c.button!==0||this.isLocked()){return}this.select(d,a)},select:function(g,c,b,e,d){if(this.fireEvent("beforecellselect",this,g,c)!==false){this.clearSelections();d=d||this.grid.store.getAt(g);this.selection={record:d,cell:[g,c]};if(!b){var a=this.grid.getView();a.onCellSelect(g,c);if(e!==true){a.focusCell(g,c)}}this.fireEvent("cellselect",this,g,c);this.fireEvent("selectionchange",this,this.selection)}},isSelectable:function(c,b,a){return !a.isHidden(b)},onEditorKey:function(b,a){if(a.getKey()==a.TAB){this.handleKeyDown(a)}},handleKeyDown:function(j){if(!j.isNavKeyPress()){return}var d=j.getKey(),i=this.grid,p=this.selection,b=this,m=function(g,c,e){return i.walkCells(g,c,e,i.isEditor&&i.editing?b.acceptsNav:b.isSelectable,b)},o,h,a,l,n;switch(d){case j.ESC:case j.PAGE_UP:case j.PAGE_DOWN:break;default:j.stopEvent();break}if(!p){o=m(0,0,1);if(o){this.select(o[0],o[1])}return}o=p.cell;a=o[0];l=o[1];switch(d){case j.TAB:if(j.shiftKey){h=m(a,l-1,-1)}else{h=m(a,l+1,1)}break;case j.DOWN:h=m(a+1,l,1);break;case j.UP:h=m(a-1,l,-1);break;case j.RIGHT:h=m(a,l+1,1);break;case j.LEFT:h=m(a,l-1,-1);break;case j.ENTER:if(i.isEditor&&!i.editing){i.startEditing(a,l);return}break}if(h){a=h[0];l=h[1];this.select(a,l);if(i.isEditor&&i.editing){n=i.activeEditor;if(n&&n.field.triggerBlur){n.field.triggerBlur()}i.startEditing(a,l)}}},acceptsNav:function(c,b,a){return !a.isHidden(b)&&a.isCellEditable(b,c)}});Ext.grid.EditorGridPanel=Ext.extend(Ext.grid.GridPanel,{clicksToEdit:2,forceValidation:false,isEditor:true,detectEdit:false,autoEncode:false,trackMouseOver:false,initComponent:function(){Ext.grid.EditorGridPanel.superclass.initComponent.call(this);if(!this.selModel){this.selModel=new Ext.grid.CellSelectionModel()}this.activeEditor=null;this.addEvents("beforeedit","afteredit","validateedit")},initEvents:function(){Ext.grid.EditorGridPanel.superclass.initEvents.call(this);this.getGridEl().on("mousewheel",this.stopEditing.createDelegate(this,[true]),this);this.on("columnresize",this.stopEditing,this,[true]);if(this.clicksToEdit==1){this.on("cellclick",this.onCellDblClick,this)}else{var a=this.getView();if(this.clicksToEdit=="auto"&&a.mainBody){a.mainBody.on("mousedown",this.onAutoEditClick,this)}this.on("celldblclick",this.onCellDblClick,this)}},onResize:function(){Ext.grid.EditorGridPanel.superclass.onResize.apply(this,arguments);var a=this.activeEditor;if(this.editing&&a){a.realign(true)}},onCellDblClick:function(b,c,a){this.startEditing(c,a)},onAutoEditClick:function(c,b){if(c.button!==0){return}var g=this.view.findRowIndex(b),a=this.view.findCellIndex(b);if(g!==false&&a!==false){this.stopEditing();if(this.selModel.getSelectedCell){var d=this.selModel.getSelectedCell();if(d&&d[0]===g&&d[1]===a){this.startEditing(g,a)}}else{if(this.selModel.isSelected(g)){this.startEditing(g,a)}}}},onEditComplete:function(b,d,a){this.editing=false;this.lastActiveEditor=this.activeEditor;this.activeEditor=null;var c=b.record,h=this.colModel.getDataIndex(b.col);d=this.postEditValue(d,a,c,h);if(this.forceValidation===true||String(d)!==String(a)){var g={grid:this,record:c,field:h,originalValue:a,value:d,row:b.row,column:b.col,cancel:false};if(this.fireEvent("validateedit",g)!==false&&!g.cancel&&String(d)!==String(a)){c.set(h,g.value);delete g.cancel;this.fireEvent("afteredit",g)}}this.view.focusCell(b.row,b.col)},startEditing:function(i,c){this.stopEditing();if(this.colModel.isCellEditable(c,i)){this.view.ensureVisible(i,c,true);var d=this.store.getAt(i),h=this.colModel.getDataIndex(c),g={grid:this,record:d,field:h,value:d.data[h],row:i,column:c,cancel:false};if(this.fireEvent("beforeedit",g)!==false&&!g.cancel){this.editing=true;var b=this.colModel.getCellEditor(c,i);if(!b){return}if(!b.rendered){b.parentEl=this.view.getEditorParent(b);b.on({scope:this,render:{fn:function(e){e.field.focus(false,true)},single:true,scope:this},specialkey:function(k,j){this.getSelectionModel().onEditorKey(k,j)},complete:this.onEditComplete,canceledit:this.stopEditing.createDelegate(this,[true])})}Ext.apply(b,{row:i,col:c,record:d});this.lastEdit={row:i,col:c};this.activeEditor=b;b.selectSameEditor=(this.activeEditor==this.lastActiveEditor);var a=this.preEditValue(d,h);b.startEdit(this.view.getCell(i,c).firstChild,Ext.isDefined(a)?a:"");(function(){delete b.selectSameEditor}).defer(50)}}},preEditValue:function(a,c){var b=a.data[c];return this.autoEncode&&Ext.isString(b)?Ext.util.Format.htmlDecode(b):b},postEditValue:function(c,a,b,d){return this.autoEncode&&Ext.isString(c)?Ext.util.Format.htmlEncode(c):c},stopEditing:function(b){if(this.editing){var a=this.lastActiveEditor=this.activeEditor;if(a){a[b===true?"cancelEdit":"completeEdit"]();this.view.focusCell(a.row,a.col)}this.activeEditor=null}this.editing=false}});Ext.reg("editorgrid",Ext.grid.EditorGridPanel);Ext.grid.GridEditor=function(b,a){Ext.grid.GridEditor.superclass.constructor.call(this,b,a);b.monitorTab=false};Ext.extend(Ext.grid.GridEditor,Ext.Editor,{alignment:"tl-tl",autoSize:"width",hideEl:false,cls:"x-small-editor x-grid-editor",shim:false,shadow:false});Ext.grid.PropertyRecord=Ext.data.Record.create([{name:"name",type:"string"},"value"]);Ext.grid.PropertyStore=Ext.extend(Ext.util.Observable,{constructor:function(a,b){this.grid=a;this.store=new Ext.data.Store({recordType:Ext.grid.PropertyRecord});this.store.on("update",this.onUpdate,this);if(b){this.setSource(b)}Ext.grid.PropertyStore.superclass.constructor.call(this)},setSource:function(c){this.source=c;this.store.removeAll();var b=[];for(var a in c){if(this.isEditableValue(c[a])){b.push(new Ext.grid.PropertyRecord({name:a,value:c[a]},a))}}this.store.loadRecords({records:b},{},true)},onUpdate:function(e,a,d){if(d==Ext.data.Record.EDIT){var b=a.data.value;var c=a.modified.value;if(this.grid.fireEvent("beforepropertychange",this.source,a.id,b,c)!==false){this.source[a.id]=b;a.commit();this.grid.fireEvent("propertychange",this.source,a.id,b,c)}else{a.reject()}}},getProperty:function(a){return this.store.getAt(a)},isEditableValue:function(a){return Ext.isPrimitive(a)||Ext.isDate(a)},setValue:function(d,c,a){var b=this.getRec(d);if(b){b.set("value",c);this.source[d]=c}else{if(a){this.source[d]=c;b=new Ext.grid.PropertyRecord({name:d,value:c},d);this.store.add(b)}}},remove:function(b){var a=this.getRec(b);if(a){this.store.remove(a);delete this.source[b]}},getRec:function(a){return this.store.getById(a)},getSource:function(){return this.source}});Ext.grid.PropertyColumnModel=Ext.extend(Ext.grid.ColumnModel,{nameText:"Name",valueText:"Value",dateFormat:"m/j/Y",trueText:"true",falseText:"false",constructor:function(c,b){var d=Ext.grid,e=Ext.form;this.grid=c;d.PropertyColumnModel.superclass.constructor.call(this,[{header:this.nameText,width:50,sortable:true,dataIndex:"name",id:"name",menuDisabled:true},{header:this.valueText,width:50,resizable:false,dataIndex:"value",id:"value",menuDisabled:true}]);this.store=b;var a=new e.Field({autoCreate:{tag:"select",children:[{tag:"option",value:"true",html:this.trueText},{tag:"option",value:"false",html:this.falseText}]},getValue:function(){return this.el.dom.value=="true"}});this.editors={date:new d.GridEditor(new e.DateField({selectOnFocus:true})),string:new d.GridEditor(new e.TextField({selectOnFocus:true})),number:new d.GridEditor(new e.NumberField({selectOnFocus:true,style:"text-align:left;"})),"boolean":new d.GridEditor(a,{autoSize:"both"})};this.renderCellDelegate=this.renderCell.createDelegate(this);this.renderPropDelegate=this.renderProp.createDelegate(this)},renderDate:function(a){return a.dateFormat(this.dateFormat)},renderBool:function(a){return this[a?"trueText":"falseText"]},isCellEditable:function(a,b){return a==1},getRenderer:function(a){return a==1?this.renderCellDelegate:this.renderPropDelegate},renderProp:function(a){return this.getPropertyName(a)},renderCell:function(d,b,c){var a=this.grid.customRenderers[c.get("name")];if(a){return a.apply(this,arguments)}var e=d;if(Ext.isDate(d)){e=this.renderDate(d)}else{if(typeof d=="boolean"){e=this.renderBool(d)}}return Ext.util.Format.htmlEncode(e)},getPropertyName:function(b){var a=this.grid.propertyNames;return a&&a[b]?a[b]:b},getCellEditor:function(a,e){var b=this.store.getProperty(e),d=b.data.name,c=b.data.value;if(this.grid.customEditors[d]){return this.grid.customEditors[d]}if(Ext.isDate(c)){return this.editors.date}else{if(typeof c=="number"){return this.editors.number}else{if(typeof c=="boolean"){return this.editors["boolean"]}else{return this.editors.string}}}},destroy:function(){Ext.grid.PropertyColumnModel.superclass.destroy.call(this);this.destroyEditors(this.editors);this.destroyEditors(this.grid.customEditors)},destroyEditors:function(b){for(var a in b){Ext.destroy(b[a])}}});Ext.grid.PropertyGrid=Ext.extend(Ext.grid.EditorGridPanel,{enableColumnMove:false,stripeRows:false,trackMouseOver:false,clicksToEdit:1,enableHdMenu:false,viewConfig:{forceFit:true},initComponent:function(){this.customRenderers=this.customRenderers||{};this.customEditors=this.customEditors||{};this.lastEditRow=null;var b=new Ext.grid.PropertyStore(this);this.propStore=b;var a=new Ext.grid.PropertyColumnModel(this,b);b.store.sort("name","ASC");this.addEvents("beforepropertychange","propertychange");this.cm=a;this.ds=b.store;Ext.grid.PropertyGrid.superclass.initComponent.call(this);this.mon(this.selModel,"beforecellselect",function(e,d,c){if(c===0){this.startEditing.defer(200,this,[d,1]);return false}},this)},onRender:function(){Ext.grid.PropertyGrid.superclass.onRender.apply(this,arguments);this.getGridEl().addClass("x-props-grid")},afterRender:function(){Ext.grid.PropertyGrid.superclass.afterRender.apply(this,arguments);if(this.source){this.setSource(this.source)}},setSource:function(a){this.propStore.setSource(a)},getSource:function(){return this.propStore.getSource()},setProperty:function(c,b,a){this.propStore.setValue(c,b,a)},removeProperty:function(a){this.propStore.remove(a)}});Ext.reg("propertygrid",Ext.grid.PropertyGrid);Ext.grid.GroupingView=Ext.extend(Ext.grid.GridView,{groupByText:"Group By This Field",showGroupsText:"Show in Groups",hideGroupedColumn:false,showGroupName:true,startCollapsed:false,enableGrouping:true,enableGroupingMenu:true,enableNoGroups:true,emptyGroupText:"(None)",ignoreAdd:false,groupTextTpl:"{text}",groupMode:"value",cancelEditOnToggle:true,initTemplates:function(){Ext.grid.GroupingView.superclass.initTemplates.call(this);this.state={};var a=this.grid.getSelectionModel();a.on(a.selectRow?"beforerowselect":"beforecellselect",this.onBeforeRowSelect,this);if(!this.startGroup){this.startGroup=new Ext.XTemplate('<div id="{groupId}" class="x-grid-group {cls}">','<div id="{groupId}-hd" class="x-grid-group-hd" style="{style}"><div class="x-grid-group-title">',this.groupTextTpl,"</div></div>",'<div id="{groupId}-bd" class="x-grid-group-body">')}this.startGroup.compile();if(!this.endGroup){this.endGroup="</div></div>"}},findGroup:function(a){return Ext.fly(a).up(".x-grid-group",this.mainBody.dom)},getGroups:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},onAdd:function(d,a,b){if(this.canGroup()&&!this.ignoreAdd){var c=this.getScrollState();this.fireEvent("beforerowsinserted",d,b,b+(a.length-1));this.refresh();this.restoreScroll(c);this.fireEvent("rowsinserted",d,b,b+(a.length-1))}else{if(!this.canGroup()){Ext.grid.GroupingView.superclass.onAdd.apply(this,arguments)}}},onRemove:function(e,a,b,d){Ext.grid.GroupingView.superclass.onRemove.apply(this,arguments);var c=document.getElementById(a._groupId);if(c&&c.childNodes[1].childNodes.length<1){Ext.removeNode(c)}this.applyEmptyText()},refreshRow:function(a){if(this.ds.getCount()==1){this.refresh()}else{this.isUpdating=true;Ext.grid.GroupingView.superclass.refreshRow.apply(this,arguments);this.isUpdating=false}},beforeMenuShow:function(){var c,a=this.hmenu.items,b=this.cm.config[this.hdCtxIndex].groupable===false;if((c=a.get("groupBy"))){c.setDisabled(b)}if((c=a.get("showGroups"))){c.setDisabled(b);c.setChecked(this.canGroup(),true)}},renderUI:function(){var a=Ext.grid.GroupingView.superclass.renderUI.call(this);if(this.enableGroupingMenu&&this.hmenu){this.hmenu.add("-",{itemId:"groupBy",text:this.groupByText,handler:this.onGroupByClick,scope:this,iconCls:"x-group-by-icon"});if(this.enableNoGroups){this.hmenu.add({itemId:"showGroups",text:this.showGroupsText,checked:true,checkHandler:this.onShowGroupsClick,scope:this})}this.hmenu.on("beforeshow",this.beforeMenuShow,this)}return a},processEvent:function(b,i){Ext.grid.GroupingView.superclass.processEvent.call(this,b,i);var h=i.getTarget(".x-grid-group-hd",this.mainBody);if(h){var g=this.getGroupField(),d=this.getPrefix(g),a=h.id.substring(d.length),c=new RegExp("gp-"+Ext.escapeRe(g)+"--hd");a=a.substr(0,a.length-3);if(a||c.test(h.id)){this.grid.fireEvent("group"+b,this.grid,g,a,i)}if(b=="mousedown"&&i.button==0){this.toggleGroup(h.parentNode)}}},onGroupByClick:function(){var a=this.grid;this.enableGrouping=true;a.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));a.fireEvent("groupchange",a,a.store.getGroupState());this.beforeMenuShow();this.refresh()},onShowGroupsClick:function(a,b){this.enableGrouping=b;if(b){this.onGroupByClick()}else{this.grid.store.clearGrouping();this.grid.fireEvent("groupchange",this,null)}},toggleRowIndex:function(c,a){if(!this.canGroup()){return}var b=this.getRow(c);if(b){this.toggleGroup(this.findGroup(b),a)}},toggleGroup:function(c,b){var a=Ext.get(c),d=Ext.util.Format.htmlEncode(a.id);b=Ext.isDefined(b)?b:a.hasClass("x-grid-group-collapsed");if(this.state[d]!==b){if(this.cancelEditOnToggle!==false){this.grid.stopEditing(true)}this.state[d]=b;a[b?"removeClass":"addClass"]("x-grid-group-collapsed")}},toggleAllGroups:function(c){var b=this.getGroups();for(var d=0,a=b.length;d<a;d++){this.toggleGroup(b[d],c)}},expandAllGroups:function(){this.toggleAllGroups(true)},collapseAllGroups:function(){this.toggleAllGroups(false)},getGroup:function(a,e,i,j,b,h){var c=this.cm.config[b],d=i?i.call(c.scope,a,{},e,j,b,h):String(a);if(d===""||d==="&#160;"){d=c.emptyGroupText||this.emptyGroupText}return d},getGroupField:function(){return this.grid.store.getGroupState()},afterRender:function(){if(!this.ds||!this.cm){return}Ext.grid.GroupingView.superclass.afterRender.call(this);if(this.grid.deferRowRender){this.updateGroupWidths()}},afterRenderUI:function(){Ext.grid.GroupingView.superclass.afterRenderUI.call(this);if(this.enableGroupingMenu&&this.hmenu){this.hmenu.add("-",{itemId:"groupBy",text:this.groupByText,handler:this.onGroupByClick,scope:this,iconCls:"x-group-by-icon"});if(this.enableNoGroups){this.hmenu.add({itemId:"showGroups",text:this.showGroupsText,checked:true,checkHandler:this.onShowGroupsClick,scope:this})}this.hmenu.on("beforeshow",this.beforeMenuShow,this)}},renderRows:function(){var a=this.getGroupField();var e=!!a;if(this.hideGroupedColumn){var b=this.cm.findColumnIndex(a),d=Ext.isDefined(this.lastGroupField);if(!e&&d){this.mainBody.update("");this.cm.setHidden(this.cm.findColumnIndex(this.lastGroupField),false);delete this.lastGroupField}else{if(e&&!d){this.lastGroupField=a;this.cm.setHidden(b,true)}else{if(e&&d&&a!==this.lastGroupField){this.mainBody.update("");var c=this.cm.findColumnIndex(this.lastGroupField);this.cm.setHidden(c,false);this.lastGroupField=a;this.cm.setHidden(b,true)}}}}return Ext.grid.GroupingView.superclass.renderRows.apply(this,arguments)},doRender:function(c,h,q,a,p,s){if(h.length<1){return""}if(!this.canGroup()||this.isUpdating){return Ext.grid.GroupingView.superclass.doRender.apply(this,arguments)}var z=this.getGroupField(),o=this.cm.findColumnIndex(z),w,j="width:"+this.getTotalWidth()+";",e=this.cm.config[o],b=e.groupRenderer||e.renderer,t=this.showGroupName?(e.groupName||e.header)+": ":"",y=[],l,u,v,n;for(u=0,v=h.length;u<v;u++){var k=a+u,m=h[u],d=m.data[z];w=this.getGroup(d,m,b,k,o,q);if(!l||l.group!=w){n=this.constructId(d,z,o);this.state[n]=!(Ext.isDefined(this.state[n])?!this.state[n]:this.startCollapsed);l={group:w,gvalue:d,text:t+w,groupId:n,startRow:k,rs:[m],cls:this.state[n]?"":"x-grid-group-collapsed",style:j};y.push(l)}else{l.rs.push(m)}m._groupId=n}var x=[];for(u=0,v=y.length;u<v;u++){w=y[u];this.doGroupStart(x,w,c,q,p);x[x.length]=Ext.grid.GroupingView.superclass.doRender.call(this,c,w.rs,q,w.startRow,p,s);this.doGroupEnd(x,w,c,q,p)}return x.join("")},getGroupId:function(a){var b=this.getGroupField();return this.constructId(a,b,this.cm.findColumnIndex(b))},constructId:function(c,e,a){var b=this.cm.config[a],d=b.groupRenderer||b.renderer,g=(this.groupMode=="value")?c:this.getGroup(c,{data:{}},d,0,a,this.ds);return this.getPrefix(e)+Ext.util.Format.htmlEncode(g)},canGroup:function(){return this.enableGrouping&&!!this.getGroupField()},getPrefix:function(a){return this.grid.getGridEl().id+"-gp-"+a+"-"},doGroupStart:function(a,d,b,e,c){a[a.length]=this.startGroup.apply(d)},doGroupEnd:function(a,d,b,e,c){a[a.length]=this.endGroup},getRows:function(){if(!this.canGroup()){return Ext.grid.GroupingView.superclass.getRows.call(this)}var k=[],c=this.getGroups(),h,e=0,a=c.length,d,b;for(;e<a;++e){h=c[e].childNodes[1];if(h){h=h.childNodes;for(d=0,b=h.length;d<b;++d){k[k.length]=h[d]}}}return k},updateGroupWidths:function(){if(!this.canGroup()||!this.hasRows()){return}var c=Math.max(this.cm.getTotalWidth(),this.el.dom.offsetWidth-this.getScrollOffset())+"px";var b=this.getGroups();for(var d=0,a=b.length;d<a;d++){b[d].firstChild.style.width=c}},onColumnWidthUpdated:function(c,a,b){Ext.grid.GroupingView.superclass.onColumnWidthUpdated.call(this,c,a,b);this.updateGroupWidths()},onAllColumnWidthsUpdated:function(a,b){Ext.grid.GroupingView.superclass.onAllColumnWidthsUpdated.call(this,a,b);this.updateGroupWidths()},onColumnHiddenUpdated:function(b,c,a){Ext.grid.GroupingView.superclass.onColumnHiddenUpdated.call(this,b,c,a);this.updateGroupWidths()},onLayout:function(){this.updateGroupWidths()},onBeforeRowSelect:function(b,a){this.toggleRowIndex(a,true)}});Ext.grid.GroupingView.GROUP_ID=1000;
+</script>
+
+<script id="ga" type="x">
+(function(){var aa="_gat",ba="_gaq",r=true,v=false,w=undefined,ca="4.6.5",x="length",y="cookie",A="location",B="&",C="=",D="__utma=",E="__utmb=",G="__utmc=",da="__utmk=",H="__utmv=",J="__utmz=",K="__utmx=",L="GASO=";var N=function(i){return w==i||"-"==i||""==i},ea=function(i){return i[x]>0&&" \n\r\t".indexOf(i)>-1},P=function(i,l,g){var t="-",k;if(!N(i)&&!N(l)&&!N(g)){k=i.indexOf(l);if(k>-1){g=i.indexOf(g,k);if(g<0)g=i[x];t=O(i,k+l.indexOf(C)+1,g)}}return t},Q=function(i){var l=v,g=0,t,k;if(!N(i)){l=r;for(t=0;t<i[x];t++){k=i.charAt(t);g+="."==k?1:0;l=l&&g<=1&&(0==t&&"-"==k||".0123456789".indexOf(k)>-1)}}return l},S=function(i,l){var g=encodeURIComponent;return g instanceof Function?l?encodeURI(i):g(i):escape(i)},
+T=function(i,l){var g=decodeURIComponent,t;i=i.split("+").join(" ");if(g instanceof Function)try{t=l?decodeURI(i):g(i)}catch(k){t=unescape(i)}else t=unescape(i);return t},U=function(i,l){return i.indexOf(l)>-1},V=function(i,l){i[i[x]]=l},W=function(i){return i.toLowerCase()},X=function(i,l){return i.split(l)},fa=function(i,l){return i.indexOf(l)},O=function(i,l,g){g=w==g?i[x]:g;return i.substring(l,g)},ga=function(i,l){return i.join(l)},ia=function(i){var l=1,g=0,t;if(!N(i)){l=0;for(t=i[x]-1;t>=0;t--){g=
+i.charCodeAt(t);l=(l<<6&268435455)+g+(g<<14);g=l&266338304;l=g!=0?l^g>>21:l}}return l},ja=function(){var i=window,l=w;if(i&&i.gaGlobal&&i.gaGlobal.hid)l=i.gaGlobal.hid;else{l=Y();i.gaGlobal=i.gaGlobal?i.gaGlobal:{};i.gaGlobal.hid=l}return l},Y=function(){return Math.round(Math.random()*2147483647)},Z={Ha:function(i,l){this.bb=i;this.nb=l},ib:v,_gasoDomain:w,_gasoCPath:w};Z.Gb=function(){function i(k){return new t(k[0],k[1])}function l(k){var p=[];k=k.split(",");var f;for(f=0;f<k.length;++f)p.push(i(k[f].split(":")));return p}var g=this,t=Z.Ha;g.Ia="utm_campaign";g.Ja="utm_content";g.Ka="utm_id";g.La="utm_medium";g.Ma="utm_nooverride";g.Na="utm_source";g.Oa="utm_term";g.Pa="gclid";g.ba=0;g.z=0;g.Ta=15768E6;g.sb=18E5;g.v=63072E6;g.ta=[];g.va=[];g.nc="cse";g.oc="q";g.ob=5;g.T=l("daum:q,eniro:search_word,naver:query,images.google:q,google:q,yahoo:p,msn:q,bing:q,aol:query,aol:encquery,lycos:query,ask:q,altavista:q,netscape:query,cnn:query,about:terms,mamma:query,alltheweb:q,voila:rdata,virgilio:qs,live:q,baidu:wd,alice:qs,yandex:text,najdi:q,aol:q,mama:query,seznam:q,search:q,wp:szukaj,onet:qt,szukacz:q,yam:k,pchome:q,kvasir:q,sesam:q,ozu:q,terra:query,mynet:q,ekolay:q,rambler:words");
+g.t=w;g.lb=v;g.h="/";g.U=100;g.oa="/__utm.gif";g.ga=1;g.ha=1;g.u="|";g.fa=1;g.da=1;g.Ra=1;g.b="auto";g.I=1;g.ra=1E3;g.Jc=10;g.Pb=10;g.Kc=0.2;g.o=w;g.a=document;g.e=window};Z.Hb=function(i){function l(d,a,j,c){var n="",s=0;n=P(d,"2"+a,";");if(!N(n)){d=n.indexOf("^"+j+".");if(d<0)return["",0];n=O(n,d+j[x]+2);if(n.indexOf("^")>0)n=n.split("^")[0];j=n.split(":");n=j[1];s=parseInt(j[0],10);if(!c&&s<p.r)n=""}if(N(n))n="";return[n,s]}function g(d,a){return"^"+ga([[a,d[1]].join("."),d[0]],":")}function t(d,a){f.a[y]=d+"; path="+f.h+"; "+a+p.fb()}function k(d){var a=new Date;d=new Date(a.getTime()+d);return"expires="+d.toGMTString()+"; "}var p=this,f=i;p.r=(new Date).getTime();
+var h=[D,E,G,J,H,K,L];p.k=function(){var d=f.a[y];return f.o?p.Wb(d,f.o):d};p.Wb=function(d,a){var j=[],c,n;for(c=0;c<h[x];c++){n=l(d,h[c],a)[0];N(n)||(j[j[x]]=h[c]+n+";")}return j.join("")};p.l=function(d,a,j){var c=j>0?k(j):"";if(f.o){a=p.kc(f.a[y],d,f.o,a,j);d="2"+d;c=j>0?k(f.v):""}t(d+a,c)};p.kc=function(d,a,j,c,n){var s="";n=n||f.v;c=g([c,p.r+n*1],j);s=P(d,"2"+a,";");if(!N(s)){d=g(l(d,a,j,r),j);s=ga(s.split(d),"");return s=c+s}return c};p.fb=function(){return N(f.b)?"":"domain="+f.b+";"}};Z.$=function(i){function l(b){b=b instanceof Array?b.join("."):"";return N(b)?"-":b}function g(b,e){var o=[];if(!N(b)){o=b.split(".");if(e)for(b=0;b<o[x];b++)Q(o[b])||(o[b]="-")}return o}function t(b,e,o){var m=c.M,q,u;for(q=0;q<m[x];q++){u=m[q][0];u+=N(e)?e:e+m[q][4];m[q][2](P(b,u,o))}}var k,p,f,h,d,a,j,c=this,n,s=i;c.j=new Z.Hb(i);c.kb=function(){return w==n||n==c.P()};c.k=function(){return c.j.k()};c.ma=function(){return d?d:"-"};c.vb=function(b){d=b};c.za=function(b){n=Q(b)?b*1:"-"};c.la=function(){return l(a)};
+c.Aa=function(b){a=g(b)};c.Vb=function(){c.j.l(H,"",-1)};c.lc=function(){return n?n:"-"};c.fb=function(){return N(s.b)?"":"domain="+s.b+";"};c.ja=function(){return l(k)};c.tb=function(b){k=g(b,1)};c.C=function(){return l(p)};c.ya=function(b){p=g(b,1)};c.ka=function(){return l(f)};c.ub=function(b){f=g(b,1)};c.na=function(){return l(h)};c.wb=function(b){h=g(b);for(b=0;b<h[x];b++)if(b<4&&!Q(h[b]))h[b]="-"};c.fc=function(){return j};c.Dc=function(b){j=b};c.Sb=function(){k=[];p=[];f=[];h=[];d=w;a=[];n=
+w};c.P=function(){var b="",e;for(e=0;e<c.M[x];e++)b+=c.M[e][1]();return ia(b)};c.ua=function(b){var e=c.k(),o=v;if(e){t(e,b,";");c.za(c.P());o=r}return o};c.zc=function(b){t(b,"",B);c.za(P(b,da,B))};c.Hc=function(){var b=c.M,e=[],o;for(o=0;o<b[x];o++)V(e,b[o][0]+b[o][1]());V(e,da+c.P());return e.join(B)};c.Nc=function(b,e){var o=c.M,m=s.h;c.ua(b);s.h=e;for(b=0;b<o[x];b++)N(o[b][1]())||o[b][3]();s.h=m};c.Cb=function(){c.j.l(D,c.ja(),s.v)};c.Ea=function(){c.j.l(E,c.C(),s.sb)};c.Db=function(){c.j.l(G,
+c.ka(),0)};c.Ga=function(){c.j.l(J,c.na(),s.Ta)};c.Eb=function(){c.j.l(K,c.ma(),s.v)};c.Fa=function(){c.j.l(H,c.la(),s.v)};c.Oc=function(){c.j.l(L,c.fc(),0)};c.M=[[D,c.ja,c.tb,c.Cb,"."],[E,c.C,c.ya,c.Ea,""],[G,c.ka,c.ub,c.Db,""],[K,c.ma,c.vb,c.Eb,""],[J,c.na,c.wb,c.Ga,"."],[H,c.la,c.Aa,c.Fa,"."]]};Z.Kb=function(i){var l=this,g=i,t=new Z.$(g),k=function(){},p=function(f){var h=(new Date).getTime(),d;d=(h-f[3])*(g.Kc/1E3);if(d>=1){f[2]=Math.min(Math.floor(f[2]*1+d),g.Pb);f[3]=h}return f};l.H=function(f,h,d,a,j,c){var n,s=g.I,b=g.a[A];t.ua(d);n=X(t.C(),".");if(n[1]<500||a){if(j)n=p(n);if(a||!j||n[2]>=1){if(!a&&j)n[2]=n[2]*1-1;n[1]=n[1]*1+1;f="?utmwv="+ca+"&utmn="+Y()+(N(b.hostname)?"":"&utmhn="+S(b.hostname))+(g.U==100?"":"&utmsp="+S(g.U))+f;if(0==s||2==s){a=2==s?k:c||k;l.$a(g.oa+f,a)}if(1==s||
+2==s){f=("https:"==b.protocol?"https://ssl.google-analytics.com/__utm.gif":"http://www.google-analytics.com/__utm.gif")+f+"&utmac="+h+"&utmcc="+l.ac(d);if(ka)f+="&gaq=1";l.$a(f,c)}}}t.ya(n.join("."));t.Ea()};l.$a=function(f,h){var d=new Image(1,1);d.src=f;d.onload=function(){d.onload=null;(h||k)()}};l.ac=function(f){var h=[],d=[D,J,H,K],a,j=t.k(),c;for(a=0;a<d[x];a++){c=P(j,d[a]+f,";");if(!N(c)){if(d[a]==H){c=X(c.split(f+".")[1],"|")[0];if(N(c))continue;c=f+"."+c}V(h,d[a]+c+";")}}return S(h.join("+"))}};Z.n=function(){var i=this;i.Y=[];i.hb=function(l){var g,t=i.Y,k;for(k=0;k<t.length;k++)g=l==t[k].q?t[k]:g;return g};i.Ob=function(l,g,t,k,p,f,h,d){var a=i.hb(l);if(w==a){a=new Z.n.Mb(l,g,t,k,p,f,h,d);V(i.Y,a)}else{a.Qa=g;a.Ab=t;a.zb=k;a.xb=p;a.Xa=f;a.yb=h;a.Za=d}return a}};Z.n.Lb=function(i,l,g,t,k,p){var f=this;f.Bb=i;f.Ba=l;f.D=g;f.Va=t;f.pb=k;f.qb=p;f.Ca=function(){return"&"+["utmt=item","tid="+S(f.Bb),"ipc="+S(f.Ba),"ipn="+S(f.D),"iva="+S(f.Va),"ipr="+S(f.pb),"iqt="+S(f.qb)].join("&utm")}};
+Z.n.Mb=function(i,l,g,t,k,p,f,h){var d=this;d.q=i;d.Qa=l;d.Ab=g;d.zb=t;d.xb=k;d.Xa=p;d.yb=f;d.Za=h;d.R=[];d.Nb=function(a,j,c,n,s){var b=d.gc(a),e=d.q;if(w==b)V(d.R,new Z.n.Lb(e,a,j,c,n,s));else{b.Bb=e;b.Ba=a;b.D=j;b.Va=c;b.pb=n;b.qb=s}};d.gc=function(a){var j,c=d.R,n;for(n=0;n<c.length;n++)j=a==c[n].Ba?c[n]:j;return j};d.Ca=function(){return"&"+["utmt=tran","id="+S(d.q),"st="+S(d.Qa),"to="+S(d.Ab),"tx="+S(d.zb),"sp="+S(d.xb),"ci="+S(d.Xa),"rg="+S(d.yb),"co="+S(d.Za)].join("&utmt")}};Z.Fb=function(i){function l(){var f,h,d;h="ShockwaveFlash";var a="$version",j=k.d?k.d.plugins:w;if(j&&j[x]>0)for(f=0;f<j[x]&&!d;f++){h=j[f];if(U(h.name,"Shockwave Flash"))d=h.description.split("Shockwave Flash ")[1]}else{h=h+"."+h;try{f=new ActiveXObject(h+".7");d=f.GetVariable(a)}catch(c){}if(!d)try{f=new ActiveXObject(h+".6");d="WIN 6,0,21,0";f.AllowScriptAccess="always";d=f.GetVariable(a)}catch(n){}if(!d)try{f=new ActiveXObject(h);d=f.GetVariable(a)}catch(s){}if(d){d=X(d.split(" ")[1],",");d=d[0]+
+"."+d[1]+" r"+d[2]}}return d?d:p}var g=i,t=g.e,k=this,p="-";k.V=t.screen;k.Sa=!k.V&&t.java?java.awt.Toolkit.getDefaultToolkit():w;k.d=t.navigator;k.W=p;k.xa=p;k.Wa=p;k.qa=p;k.pa=1;k.eb=p;k.bc=function(){var f;if(t.screen){k.W=k.V.width+"x"+k.V.height;k.xa=k.V.colorDepth+"-bit"}else if(k.Sa)try{f=k.Sa.getScreenSize();k.W=f.width+"x"+f.height}catch(h){}k.qa=W(k.d&&k.d.language?k.d.language:k.d&&k.d.browserLanguage?k.d.browserLanguage:p);k.pa=k.d&&k.d.javaEnabled()?1:0;k.eb=g.ha?l():p;k.Wa=S(g.a.characterSet?
+g.a.characterSet:g.a.charset?g.a.charset:p)};k.Ic=function(){return B+"utm"+["cs="+S(k.Wa),"sr="+k.W,"sc="+k.xa,"ul="+k.qa,"je="+k.pa,"fl="+S(k.eb)].join("&utm")};k.$b=function(){var f=g.a,h=t.history[x];f=k.d.appName+k.d.version+k.qa+k.d.platform+k.d.userAgent+k.pa+k.W+k.xa+(f[y]?f[y]:"")+(f.referrer?f.referrer:"");for(var d=f[x];h>0;)f+=h--^d++;return ia(f)}};Z.m=function(i,l,g,t){function k(d){var a="";d=W(d.split("://")[1]);if(U(d,"/")){d=d.split("/")[1];if(U(d,"?"))a=d.split("?")[0]}return a}function p(d){var a="";a=W(d.split("://")[1]);if(U(a,"/"))a=a.split("/")[0];return a}var f=t,h=this;h.c=i;h.rb=l;h.r=g;h.ic=function(d){var a=h.gb();return new Z.m.w(P(d,f.Ka+C,B),P(d,f.Na+C,B),P(d,f.Pa+C,B),h.Q(d,f.Ia,"(not set)"),h.Q(d,f.La,"(not set)"),h.Q(d,f.Oa,a&&!N(a.K)?T(a.K):w),h.Q(d,f.Ja,w))};h.jb=function(d){var a=p(d),j=k(d);if(U(a,"google")){d=d.split("?").join(B);
+if(U(d,B+f.oc+C))if(j==f.nc)return r}return v};h.gb=function(){var d,a=h.rb,j,c,n=f.T;if(!(N(a)||"0"==a||!U(a,"://")||h.jb(a))){d=p(a);for(j=0;j<n[x];j++){c=n[j];if(U(d,W(c.bb))){a=a.split("?").join(B);if(U(a,B+c.nb+C)){d=a.split(B+c.nb+C)[1];if(U(d,B))d=d.split(B)[0];return new Z.m.w(w,c.bb,w,"(organic)","organic",d,w)}}}}};h.Q=function(d,a,j){d=P(d,a+C,B);return j=!N(d)?T(d):!N(j)?j:"-"};h.uc=function(d){var a=f.ta,j=v,c;if(d&&"organic"==d.S){d=W(T(d.K));for(c=0;c<a[x];c++)j=j||W(a[c])==d}return j};
+h.hc=function(){var d="",a="";d=h.rb;if(!(N(d)||"0"==d||!U(d,"://")||h.jb(d))){d=d.split("://")[1];if(U(d,"/")){a=O(d,d.indexOf("/"));a=a.split("?")[0];d=W(d.split("/")[0])}if(0==d.indexOf("www."))d=O(d,4);return new Z.m.w(w,d,w,"(referral)","referral",w,a)}};h.Xb=function(d){var a="";if(f.ba){a=d&&d.hash?d.href.substring(d.href.indexOf("#")):"";a=""!=a?a+B:a}a+=d.search;return a};h.dc=function(){return new Z.m.w(w,"(direct)",w,"(direct)","(none)",w,w)};h.vc=function(d){var a=v,j,c=f.va;if(d&&"referral"==
+d.S){d=W(S(d.X));for(j=0;j<c[x];j++)a=a||U(d,W(c[j]))}return a};h.L=function(d){return w!=d&&d.mb()};h.cc=function(d,a){var j="",c="-",n,s=0,b,e,o=h.c;if(!d)return"";e=d.k();j=h.Xb(f.a[A]);if(f.z&&d.kb()){c=d.na();if(!N(c)&&!U(c,";")){d.Ga();return""}}c=P(e,J+o+".",";");n=h.ic(j);if(h.L(n)){j=P(j,f.Ma+C,B);if("1"==j&&!N(c))return""}if(!h.L(n)){n=h.gb();if(!N(c)&&h.uc(n))return""}if(!h.L(n)&&a){n=h.hc();if(!N(c)&&h.vc(n))return""}if(!h.L(n))if(N(c)&&a)n=h.dc();if(!h.L(n))return"";if(!N(c)){s=c.split(".");
+b=new Z.m.w;b.Zb(s.slice(4).join("."));b=W(b.Da())==W(n.Da());s=s[3]*1}if(!b||a){a=P(e,D+o+".",";");e=a.lastIndexOf(".");a=e>9?O(a,e+1)*1:0;s++;a=0==a?1:a;d.wb([o,h.r,a,s,n.Da()].join("."));d.Ga();return B+"utmcn=1"}else return B+"utmcr=1"}};
+Z.m.w=function(i,l,g,t,k,p,f){var h=this;h.q=i;h.X=l;h.ea=g;h.D=t;h.S=k;h.K=p;h.Ya=f;h.Da=function(){var d=[],a=[["cid",h.q],["csr",h.X],["gclid",h.ea],["ccn",h.D],["cmd",h.S],["ctr",h.K],["cct",h.Ya]],j,c;if(h.mb())for(j=0;j<a[x];j++)if(!N(a[j][1])){c=a[j][1].split("+").join("%20");c=c.split(" ").join("%20");V(d,"utm"+a[j][0]+C+c)}return d.join("|")};h.mb=function(){return!(N(h.q)&&N(h.X)&&N(h.ea))};h.Zb=function(d){var a=function(j){return T(P(d,"utm"+j+C,"|"))};h.q=a("cid");h.X=a("csr");h.ea=a("gclid");
+h.D=a("ccn");h.S=a("cmd");h.K=a("ctr");h.Ya=a("cct")}};Z.Ib=function(i,l,g,t){function k(j,c,n){var s;if(!N(n)){n=n.split(",");for(var b=0;b<n[x];b++){s=n[b];if(!N(s)){s=s.split(h);if(s[x]==4)c[s[0]]=[s[1],s[2],j]}}}}var p=this,f=l,h=C,d=i,a=t;p.O=g;p.sa="";p.p={};p.tc=function(){var j;j=X(P(p.O.k(),H+f+".",";"),f+".")[1];if(!N(j)){j=j.split("|");k(1,p.p,j[1]);p.sa=j[0];p.Z()}};p.Z=function(){p.Qb();var j=p.sa,c,n,s="";for(c in p.p)if((n=p.p[c])&&1===n[2])s+=c+h+n[0]+h+n[1]+h+1+",";N(s)||(j+="|"+s);if(N(j))p.O.Vb();else{p.O.Aa(f+"."+j);p.O.Fa()}};p.Ec=
+function(j){p.sa=j;p.Z()};p.Cc=function(j,c,n,s){if(1!=s&&2!=s&&3!=s)s=3;var b=v;if(c&&n&&j>0&&j<=d.ob){c=S(c);n=S(n);if(c[x]+n[x]<=64){p.p[j]=[c,n,s];p.Z();b=r}}return b};p.mc=function(j){if((j=p.p[j])&&1===j[2])return j[1]};p.Ub=function(j){var c=p.p;if(c[j]){delete c[j];p.Z()}};p.Qb=function(){a._clearKey(8);a._clearKey(9);a._clearKey(11);var j=p.p,c,n;for(n in j)if(c=j[n]){a._setKey(8,n,c[0]);a._setKey(9,n,c[1]);(c=c[2])&&3!=c&&a._setKey(11,n,""+c)}}};Z.N=function(){function i(m,q,u,z){if(w==f[m])f[m]={};if(w==f[m][q])f[m][q]=[];f[m][q][u]=z}function l(m,q){if(w!=f[m]&&w!=f[m][q]){f[m][q]=w;q=r;var u;for(u=0;u<a[x];u++)if(w!=f[m][a[u]]){q=v;break}if(q)f[m]=w}}function g(m){var q="",u=v,z,M;for(z=0;z<a[x];z++){M=m[a[z]];if(w!=M){if(u)q+=a[z];q+=t(M);u=v}else u=r}return q}function t(m){var q=[],u,z;for(z=0;z<m[x];z++)if(w!=m[z]){u="";if(z!=o&&w==m[z-1])u+=z.toString()+s;u+=k(m[z]);V(q,u)}return j+q.join(n)+c}function k(m){var q="",u,z,M;for(u=0;u<
+m[x];u++){z=m.charAt(u);M=e[z];q+=w!=M?M:z}return q}var p=this,f={},h="k",d="v",a=[h,d],j="(",c=")",n="*",s="!",b="'",e={};e[b]="'0";e[c]="'1";e[n]="'2";e[s]="'3";var o=1;p.qc=function(m){return w!=f[m]};p.G=function(){var m="",q;for(q in f)if(w!=f[q])m+=q.toString()+g(f[q]);return m};p.Ac=function(m){if(m==w)return p.G();var q=m.G(),u;for(u in f)if(w!=f[u]&&!m.qc(u))q+=u.toString()+g(f[u]);return q};p._setKey=function(m,q,u){if(typeof u!="string")return v;i(m,h,q,u);return r};p._setValue=function(m,
+q,u){if(typeof u!="number"&&(w==Number||!(u instanceof Number))||Math.round(u)!=u||u==NaN||u==Infinity)return v;i(m,d,q,u.toString());return r};p._getKey=function(m,q){return w!=f[m]&&w!=f[m][h]?f[m][h][q]:w};p._getValue=function(m,q){return w!=f[m]&&w!=f[m][d]?f[m][d][q]:w};p._clearKey=function(m){l(m,h)};p._clearValue=function(m){l(m,d)}};Z.Jb=function(i,l){var g=this;g.Qc=l;g.xc=i;g._trackEvent=function(t,k,p){return l._trackEvent(g.xc,t,k,p)}};Z.aa=function(i,l){function g(){if("auto"==c.b){var b=c.a.domain;if("www."==O(b,0,4))b=O(b,4);c.b=b}c.b=W(c.b)}function t(){var b=c.b,e=b.indexOf("www.google.")*b.indexOf(".google.")*b.indexOf("google.");return e||"/"!=c.h||b.indexOf("google.org")>-1}function k(b,e,o){if(N(b)||N(e)||N(o))return"-";b=P(b,D+a.c+".",e);if(!N(b)){b=b.split(".");b[5]=b[5]?b[5]*1+1:1;b[3]=b[4];b[4]=o;b=b.join(".")}return b}function p(){return"file:"!=c.a[A].protocol&&t()}function f(b){if(!b||""==b)return"";for(;ea(b.charAt(0));)b=
+O(b,1);for(;ea(b.charAt(b[x]-1));)b=O(b,0,b[x]-1);return b}function h(b,e,o,m){if(!N(b())){e(m?T(b()):b());U(b(),";")||o()}}function d(b){var e,o=""!=b&&c.a[A].host!=b;if(o)for(e=0;e<c.t[x];e++)o=o&&fa(W(b),W(c.t[e]))==-1;return o}var a=this,j=w,c=new Z.Gb,n=v,s=w;a.e=window;a.r=Math.round((new Date).getTime()/1E3);a.s=i||"UA-XXXXX-X";a.ab=c.a.referrer;a.ia=w;a.f=w;a.B=w;a.F=v;a.A=w;a.Ua="";a.g=w;a.cb=w;a.c=w;a.i=w;c.o=l?S(l):w;a.wc=function(){var b=v;if(a.B)b=a.B.match(/^[0-9a-z-_.]{10,1200}$/i);
+return b};a.jc=function(){return Y()^a.A.$b()&2147483647};a.ec=function(){if(!c.b||""==c.b||"none"==c.b){c.b="";return 1}g();return c.Ra?ia(c.b):1};a.Yb=function(b,e){if(N(b))b="-";else{e+=c.h&&"/"!=c.h?c.h:"";e=b.indexOf(e);b=e>=0&&e<=8?"0":"["==b.charAt(0)&&"]"==b.charAt(b[x]-1)?"-":b}return b};a.wa=function(b){var e="",o=c.a;e+=c.fa?a.A.Ic():"";e+=c.da?a.Ua:"";e+=c.ga&&!N(o.title)?"&utmdt="+S(o.title):"";e+="&utmhid="+ja()+"&utmr="+S(a.ia)+"&utmp="+S(a.Bc(b));return e};a.Bc=function(b){var e=c.a[A];
+return b=w!=b&&""!=b?S(b,r):S(e.pathname+e.search,r)};a.Lc=function(b){if(a.J()){var e="";if(a.g!=w&&a.g.G()[x]>0)e+="&utme="+S(a.g.G());e+=a.wa(b);j.H(e,a.s,a.c)}};a.Tb=function(){var b=new Z.$(c);return b.ua(a.c)?b.Hc():w};a._getLinkerUrl=function(b,e){var o=b.split("#"),m=b,q=a.Tb();if(q)if(e&&1>=o[x])m+="#"+q;else if(!e||1>=o[x])if(1>=o[x])m+=(U(b,"?")?B:"?")+q;else m=o[0]+(U(b,"?")?B:"?")+q+"#"+o[1];return m};a.Fc=function(){var b;if(a.wc()){a.i.Dc(a.B);a.i.Oc();Z._gasoDomain=c.b;Z._gasoCPath=
+c.h;b=c.a.createElement("script");b.type="text/javascript";b.id="_gasojs";b.src="https://www.google.com/analytics/reporting/overlay_js?gaso="+a.B+B+Y();c.a.getElementsByTagName("head")[0].appendChild(b)}};a.pc=function(){var b=a.r,e=a.i,o=e.k(),m=a.c+"",q=c.e,u=q?q.gaGlobal:w,z,M=U(o,D+m+"."),la=U(o,E+m),ma=U(o,G+m),F,I=[],R="",ha=v;o=N(o)?"":o;if(c.z){z=c.a[A]&&c.a[A].hash?c.a[A].href.substring(c.a[A].href.indexOf("#")):"";if(c.ba&&!N(z))R=z+B;R+=c.a[A].search;if(!N(R)&&U(R,D)){e.zc(R);e.kb()||e.Sb();
+F=e.ja()}h(e.ma,e.vb,e.Eb,true);h(e.la,e.Aa,e.Fa)}if(N(F))if(M)if(!la||!ma){F=k(o,";",b);a.F=r}else{F=P(o,D+m+".",";");I=X(P(o,E+m,";"),".")}else{F=ga([m,a.jc(),b,b,b,1],".");ha=a.F=r}else if(N(e.C())||N(e.ka())){F=k(R,B,b);a.F=r}else{I=X(e.C(),".");m=I[0]}F=F.split(".");if(q&&u&&u.dh==m&&!c.o){F[4]=u.sid?u.sid:F[4];if(ha){F[3]=u.sid?u.sid:F[4];if(u.vid){b=u.vid.split(".");F[1]=b[0];F[2]=b[1]}}}e.tb(F.join("."));I[0]=m;I[1]=I[1]?I[1]:0;I[2]=w!=I[2]?I[2]:c.Jc;I[3]=I[3]?I[3]:F[4];e.ya(I.join("."));
+e.ub(m);N(e.lc())||e.za(e.P());e.Cb();e.Ea();e.Db()};a.rc=function(){j=new Z.Kb(c)};a._initData=function(){var b;if(!n){if(!a.A){a.A=new Z.Fb(c);a.A.bc()}a.c=a.ec();a.i=new Z.$(c);a.g=new Z.N;s=new Z.Ib(c,a.c,a.i,a.g);a.rc()}if(p()){a.pc();s.tc()}if(!n){if(p()){a.ia=a.Yb(a.ab,c.a.domain);if(c.da){b=new Z.m(a.c,a.ia,a.r,c);a.Ua=b.cc(a.i,a.F)}}a.cb=new Z.N;n=r}Z.ib||a.sc()};a._visitCode=function(){a._initData();var b=P(a.i.k(),D+a.c+".",";");b=b.split(".");return b[x]<4?"":b[1]};a._cookiePathCopy=function(b){a._initData();
+a.i&&a.i.Nc(a.c,b)};a.sc=function(){var b=c.a[A].hash;if(b&&1==b.indexOf("gaso="))b=P(b,"gaso=",B);else b=(b=c.e.name)&&0<=b.indexOf("gaso=")?P(b,"gaso=",B):P(a.i.k(),L,";");if(b[x]>=10){a.B=b;a.Fc()}Z.ib=r};a.J=function(){return a._visitCode()%1E4<c.U*100};a.Gc=function(){var b,e,o=c.a.links;if(!c.lb){b=c.a.domain;if("www."==O(b,0,4))b=O(b,4);c.t.push("."+b)}for(b=0;b<o[x]&&(c.ra==-1||b<c.ra);b++){e=o[b];if(d(e.host))if(!e.gatcOnclick){e.gatcOnclick=e.onclick?e.onclick:a.yc;e.onclick=function(m){var q=
+!this.target||this.target=="_self"||this.target=="_top"||this.target=="_parent";q=q&&!a.Rb(m);a.Mc(m,this,q);return q?v:this.gatcOnclick?this.gatcOnclick(m):r}}}};a.yc=function(){};a._trackPageview=function(b){if(p()){a._initData();c.t&&a.Gc();a.Lc(b);a.F=v}};a._trackTrans=function(){var b=a.c,e=[],o,m,q;a._initData();if(a.f&&a.J()){for(o=0;o<a.f.Y[x];o++){m=a.f.Y[o];V(e,m.Ca());for(q=0;q<m.R[x];q++)V(e,m.R[q].Ca())}for(o=0;o<e[x];o++)j.H(e[o],a.s,b,r)}};a._setTrans=function(){var b=c.a,e,o,m;b=b.getElementById?
+b.getElementById("utmtrans"):b.utmform&&b.utmform.utmtrans?b.utmform.utmtrans:w;a._initData();if(b&&b.value){a.f=new Z.n;m=b.value.split("UTM:");c.u=!c.u||""==c.u?"|":c.u;for(b=0;b<m[x];b++){m[b]=f(m[b]);e=m[b].split(c.u);for(o=0;o<e[x];o++)e[o]=f(e[o]);if("T"==e[0])a._addTrans(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]);else"I"==e[0]&&a._addItem(e[1],e[2],e[3],e[4],e[5],e[6])}}};a._addTrans=function(b,e,o,m,q,u,z,M){a.f=a.f?a.f:new Z.n;return a.f.Ob(b,e,o,m,q,u,z,M)};a._addItem=function(b,e,o,m,q,u){var z;
+a.f=a.f?a.f:new Z.n;(z=a.f.hb(b))||(z=a._addTrans(b,"","","","","","",""));z.Nb(e,o,m,q,u)};a._setVar=function(b){if(b&&""!=b&&t()){a._initData();s.Ec(S(b));a.J()&&j.H("&utmt=var",a.s,a.c)}};a._setCustomVar=function(b,e,o,m){a._initData();return s.Cc(b,e,o,m)};a._deleteCustomVar=function(b){a._initData();s.Ub(b)};a._getVisitorCustomVar=function(b){a._initData();return s.mc(b)};a._setMaxCustomVariables=function(b){c.ob=b};a._link=function(b,e){if(c.z&&b){a._initData();c.a[A].href=a._getLinkerUrl(b,
+e)}};a._linkByPost=function(b,e){if(c.z&&b&&b.action){a._initData();b.action=a._getLinkerUrl(b.action,e)}};a._setXKey=function(b,e,o){a.g._setKey(b,e,o)};a._setXValue=function(b,e,o){a.g._setValue(b,e,o)};a._getXKey=function(b,e){return a.g._getKey(b,e)};a._getXValue=function(b,e){return a.g.getValue(b,e)};a._clearXKey=function(b){a.g._clearKey(b)};a._clearXValue=function(b){a.g._clearValue(b)};a._createXObj=function(){a._initData();return new Z.N};a._sendXEvent=function(b){var e="";a._initData();
+if(a.J()){e+="&utmt=event&utme="+S(a.g.Ac(b))+a.wa();j.H(e,a.s,a.c,v,r)}};a._createEventTracker=function(b){a._initData();return new Z.Jb(b,a)};a._trackEvent=function(b,e,o,m){var q=a.cb;if(w!=b&&w!=e&&""!=b&&""!=e){q._clearKey(5);q._clearValue(5);(b=q._setKey(5,1,b)&&q._setKey(5,2,e)&&(w==o||q._setKey(5,3,o))&&(w==m||q._setValue(5,1,m)))&&a._sendXEvent(q)}else b=v;return b};a.Mc=function(b,e,o){a._initData();if(a.J()){var m=new Z.N;m._setKey(6,1,e.href);var q=o?function(){a.db(b,e)}:w;j.H("&utmt=event&utme="+
+S(m.G())+a.wa(),a.s,a.c,v,r,q);if(o){var u=this;c.e.setTimeout(function(){u.db(b,e)},500)}}};a.db=function(b,e){if(!b)b=c.e.event;var o=r;if(e.gatcOnclick)o=e.gatcOnclick(b);if(o||typeof o=="undefined")if(!e.target||e.target=="_self")c.e[A]=e.href;else if(e.target=="_top")c.e.top.document[A]=e.href;else if(e.target=="_parent")c.e.parent.document[A]=e.href};a.Rb=function(b){if(!b)b=c.e.event;var e=b.shiftKey||b.ctrlKey||b.altKey;if(!e)if(b.modifiers&&c.e.Event)e=b.modifiers&c.e.Event.CONTROL_MASK||
+b.modifiers&c.e.Event.SHIFT_MASK||b.modifiers&c.e.Event.ALT_MASK;return e};a.Pc=function(){return c};a._setDomainName=function(b){c.b=b};a._addOrganic=function(b,e,o){c.T.splice(o?0:c.T.length,0,new Z.Ha(b,e))};a._clearOrganic=function(){c.T=[]};a._addIgnoredOrganic=function(b){V(c.ta,b)};a._clearIgnoredOrganic=function(){c.ta=[]};a._addIgnoredRef=function(b){V(c.va,b)};a._clearIgnoredRef=function(){c.va=[]};a._setAllowHash=function(b){c.Ra=b?1:0};a._setCampaignTrack=function(b){c.da=b?1:0};a._setClientInfo=
+function(b){c.fa=b?1:0};a._getClientInfo=function(){return c.fa};a._setCookiePath=function(b){c.h=b};a._setTransactionDelim=function(b){c.u=b};a._setCookieTimeout=function(b){a._setCampaignCookieTimeout(b*1E3)};a._setCampaignCookieTimeout=function(b){c.Ta=b};a._setDetectFlash=function(b){c.ha=b?1:0};a._getDetectFlash=function(){return c.ha};a._setDetectTitle=function(b){c.ga=b?1:0};a._getDetectTitle=function(){return c.ga};a._setLocalGifPath=function(b){c.oa=b};a._getLocalGifPath=function(){return c.oa};
+a._setLocalServerMode=function(){c.I=0};a._setRemoteServerMode=function(){c.I=1};a._setLocalRemoteServerMode=function(){c.I=2};a._getServiceMode=function(){return c.I};a._setSampleRate=function(b){c.U=b};a._setSessionTimeout=function(b){a._setSessionCookieTimeout(b*1E3)};a._setSessionCookieTimeout=function(b){c.sb=b};a._setAllowLinker=function(b){c.z=b?1:0};a._setAllowAnchor=function(b){c.ba=b?1:0};a._setCampNameKey=function(b){c.Ia=b};a._setCampContentKey=function(b){c.Ja=b};a._setCampIdKey=function(b){c.Ka=
+b};a._setCampMediumKey=function(b){c.La=b};a._setCampNOKey=function(b){c.Ma=b};a._setCampSourceKey=function(b){c.Na=b};a._setCampTermKey=function(b){c.Oa=b};a._setCampCIdKey=function(b){c.Pa=b};a._getAccount=function(){return a.s};a._setAccount=function(b){a.s=b};a._setNamespace=function(b){c.o=b?S(b):w};a._getVersion=function(){return ca};a._setAutoTrackOutbound=function(b){c.t=[];if(b)c.t=b};a._setTrackOutboundSubdomains=function(b){c.lb=b};a._setHrefExamineLimit=function(b){c.ra=b};a._setReferrerOverride=
+function(b){a.ab=b};a._setCookiePersistence=function(b){a._setVisitorCookieTimeout(b)};a._setVisitorCookieTimeout=function(b){c.v=b}};Z._getTracker=function(i,l){return new Z.aa(i,l)};var ka=v,$={ca:{},_createAsyncTracker:function(i,l){l=l||"";i=new Z.aa(i);$.ca[l]=i;ka=r;return i},_getAsyncTracker:function(i){i=i||"";var l=$.ca[i];if(!l){l=new Z.aa;$.ca[i]=l;ka=r}return l},push:function(){for(var i=arguments,l=0,g=0;g<i[x];g++)try{if(typeof i[g]==="function")i[g]();else{var t="",k=i[g][0],p=k.lastIndexOf(".");if(p>0){t=O(k,0,p);k=O(k,p+1)}var f=$._getAsyncTracker(t);f[k].apply(f,i[g].slice(1))}}catch(h){l++}return l}};window[aa]=Z;function na(){var i=window[ba],l=v;if(i&&typeof i.push=="function"){l=i.constructor==Array;if(!l)return}window[ba]=$;l&&$.push.apply($,i)}na();})()
+</script>
+
+
+<script id="gmail" type="x">
+var startTime=(new Date).getTime()
+
+var BrowserSupport_={IsBrowserSupported:function(){var agt=navigator.userAgent.toLowerCase();var is_op=agt.indexOf("opera")!=-1;var is_ie=agt.indexOf("msie")!=-1&&document.all&&!is_op;var is_ie5=agt.indexOf("msie 5")!=-1&&document.all&&!is_op;var is_mac=agt.indexOf("mac")!=-1;var is_gk=agt.indexOf("gecko")!=-1;var is_sf=agt.indexOf("safari")!=-1;if(is_ie&&!is_op&&!is_mac){if(agt.indexOf("palmsource")!=
+-1||agt.indexOf("regking")!=-1||agt.indexOf("windows ce")!=-1||agt.indexOf("j2me")!=-1||agt.indexOf("avantgo")!=-1||agt.indexOf(" stb")!=-1)return false;var v=BrowserSupport_.GetFollowingFloat(agt,"msie ");if(v!=null)return v>=5.5}if(is_gk&&!is_sf){var v=BrowserSupport_.GetFollowingFloat(agt,"rv:");if(v!=null)return v>=1.4;else{v=BrowserSupport_.GetFollowingFloat(agt,"galeon/");if(v!=null)return v>=
+1.3}}if(is_sf){if(agt.indexOf("rv:3.14.15.92.65")!=-1)return false;var v=BrowserSupport_.GetFollowingFloat(agt,"applewebkit/");if(v!=null)return v>=312}if(is_op){if(agt.indexOf("sony/com1")!=-1)return false;var v=BrowserSupport_.GetFollowingFloat(agt,"opera ");if(v==null)v=BrowserSupport_.GetFollowingFloat(agt,"opera/");if(v!=null)return v>=8}if(agt.indexOf("pda; sony/com2")!=-1)return true;return false},
+GetFollowingFloat:function(str,pfx){var i=str.indexOf(pfx);if(i!=-1){var v=parseFloat(str.substring(i+pfx.length));if(!isNaN(v))return v}return null},tz_path:";path=/"};if(window.location.href.toLowerCase().indexOf("google.com")>0)BrowserSupport_.tz_path+=";domain=.google.com";document.cookie="TZ="+(new Date).getTimezoneOffset()+BrowserSupport_.tz_path;var is_browser_supported=BrowserSupport_.IsBrowserSupported()
+
+if(window!=top)top.location=location.href;
+(function(){if(location.href.indexOf("nocheckbrowser")!=-1)return;if(!is_browser_supported)location="?ui=html&zy=b";var agt=navigator.userAgent.toLowerCase();var wk=/webkit\/([^ ]+)/.exec(agt);var g=/rv:([^;)]+)/.exec(agt);var ie=/msie (\d+)/.exec(agt);var opr=window.opera&&parseFloat(window.opera.version());var sup=ie&&ie[1]>=7&&!opr||navigator.product=="Gecko"&&g&&g[1]>"1.8"||wk&&wk[1].split(".")[0]>
+"522"||opr&&opr>=9.5;var win2k=agt.indexOf("windows nt 5.0")!=-1||agt.indexOf("windows 2000")!=-1;var win98OrMe=agt.indexOf("windows 98")!=-1;if(ie&&ie[1]==6&&!opr&&!win2k&&!win98OrMe){var jsv=Number(ScriptEngineMajorVersion()+"."+ScriptEngineMinorVersion());sup=jsv>=5.7||jsv==5.6&&ScriptEngineBuildVersion()>=8834}if(!sup)location="?ui=1&ov=0";var c="jscookietest=valid";document.cookie=c;if(document.cookie.indexOf(c)==
+-1)location="html/nocookies.html";document.cookie=c+";expires=Thu, 01 Jan 1970 00:00:00 GMT";if(agt.indexOf("msie")!=-1&&document.all&&agt.indexOf("opera")==-1&&agt.indexOf("mac")==-1)eval('try{new ActiveXObject(agt.indexOf("msie 5")!=-1?"Microsoft.XMLHTTP":"Msxml2.XMLHTTP")}catch(e){location="html/noactivex.html"}')})();var lbwnc=false
+
+var GLOBALS=[]; // Redacted
+GLOBALS[0]=startTime;
+var pr=0;var lp=0;function sc(k,v){document.cookie=k+"="+v+";path="+GLOBALS[7]}function onLoadTimeout(){if(lbwnc)return;if(pr>lp){lp=pr;loadTimeout=setTimeout(onLoadTimeout,3E4);return}var d=document;d.getElementById("loadingError").style.display="";d.getElementById("stb").style.display="none";if(!top._jsl){sc("GMAIL_CB",startTime);si("jscc")}si("jsle")}
+function si(i){(new Image).src="?ui=2&view=jsle&ik="+GLOBALS[9]+"&imp="+i+"&val="+pr+"&random="+startTime}var loadTimeout=setTimeout(onLoadTimeout,3E4);GLOBALS[1]=(new Date).getTime()
+
+var VIEW_DATA=[]; // Redacted
+
+var JS_MODE="OPTIMIZED,LOCALE=en",JS_OBFUSCATED=1,JS_START_TIME=(new Date).getTime(),GLOBALS=top.GLOBALS;if("32mVEedHbfc.en."!=GLOBALS[4])top.location.replace(top.location.href.split("#")[0]);function _B_log(imp,opt_val){var p="imp="+imp;if(arguments.length>1)p+="&val="+opt_val;_B_logImg_("jsle",p)}var loadTimes=[GLOBALS[0],GLOBALS[1],JS_START_TIME];
+function _B_record(){loadTimes.push((new Date).getTime())}var _B_thumbStyle_;function _B_prog(pct){top["pr"]=pct;if(_B_thumbStyle_===undefined){var thumb=top.document.getElementById("lpt");_B_thumbStyle_=thumb?thumb.style:null}if(_B_thumbStyle_){_B_thumbStyle_.width=Math.round(pct*0.99)+"%";if(pct==100)_B_thumbStyle_=null}}
+function _B_err(e){var state=loadTimes.join("-");_B_logImg_("jserr","jsstate="+encodeURIComponent(state)+"&jsmsg="+encodeURIComponent(e));_B_handleError(e)}function _B_handleError(e){throw e;}function _B_logImg_(v,p){(new Image).src="?ui=2&view="+v+"&"+p+"&ik="+GLOBALS[9]+"&random="+(new Date).getTime()}window.onerror=function(message,url,line){_B_err(message)};_B_prog(1)
+
+try{top['jpgt']=1267218585107;}catch(e){_B_err(e)}
+
+try{function e(b){throw b;}var h=true,i=null,k=false,aa=encodeURIComponent,ba=window,aaa=JS_OBFUSCATED,ca=Object,da=parseInt,baa=isFinite,caa=Function,ea=document,fa=GLOBALS,ga=decodeURIComponent,ia=isNaN,l=Math;function daa(b,a){return b.appendChild=a}function ja(b,a){return b.onreadystatechange=a}function ka(b,a){return b.width=a}function la(b,a){return b.text=a}function ma(b,a){return b.data=a}function na(b,a){return b.load=a}function oa(b,a){return b.onerror=a}function pa(b,a){return b.value=a}
+function eaa(b,a){return b.button=a}function qa(b,a){return b.indexOf=a}function ra(b,a){return b.dispatchEvent=a}function sa(b,a){return b.currentTarget=a}function ta(b,a){return b.backgroundColor=a}function faa(b,a){return b.screenX=a}function gaa(b,a){return b.screenY=a}function ua(b,a){return b.send=a}function va(b,a){return b.getName=a}function haa(b,a){return b.charCode=a}function wa(b,a){return b.remove=a}function iaa(b,a){return b.cssText=a}function xa(b,a){return b.keyCode=a}
+function ya(b,a){return b.handleEvent=a}function za(b,a){return b.type=a}function Aa(b,a){return b.clear=a}function jaa(b,a){return b.source=a}function Ba(b,a){return b.name=a}function Ca(b,a){return b.zIndex=a}function Da(b,a){return b.clientX=a}function Ea(b,a){return b.clientY=a}function Fa(b,a){return b.visibility=a}function Ga(b,a){return b.stop=a}function Ha(b,a){return b.toString=a}function kaa(b,a){return b.getMonth=a}function laa(b,a){return b.createObject=a}
+function Ia(b,a){return b.length=a}function Ja(b,a){return b.position=a}function Ka(b,a){return b.create=a}function maa(b,a){return b.prototype=a}function m(b,a){return b.className=a}function La(b,a){return b.abort=a}function naa(b,a){return b.setTimeout=a}function Ma(b,a){return b.next=a}function oaa(b,a){return b.stack=a}function Na(b,a){return b.location=a}function Oa(b,a){return b.message=a}function Pa(b,a){return b.target=a}function Qa(b,a){return b.start=a}
+function Ra(b,a){return b.enabled=a}function paa(b,a){return b.returnValue=a}function qaa(b,a){return b.removeNode=a}function Sa(b,a){return b.contains=a}function Ta(b,a){return b.border=a}function Ua(b,a){return b.display=a}function Va(b,a){return b.execute=a}function Wa(b,a){return b.height=a}
+var o="appendChild",Xa="error",p="push",Ya="filter",raa="hash",Za="version",ab="innerWidth",bb="open",cb="test",db="shift",eb="relatedTarget",fb="replaceChild",gb="clearTimeout",hb="exec",ib="width",jb="text",kb="round",lb="slice",mb="replace",nb="nodeType",ob="ceil",pb="load",rb="floor",sb="cookie",ub="getElementById",vb="mimeTypes",saa="srcElement",wb="concat",xb="charAt",yb="createTextNode",q="value",zb="preventDefault",Ab="item",Bb="insertBefore",Cb="button",Db="indexOf",Eb="metaKey",taa="compareDocumentPosition",
+r="dispatchEvent",Fb="capture",Gb="nodeName",Hb="currentTarget",Ib="screenX",Jb="screenY",Kb="match",Lb="status",uaa="defaultValue",Mb="send",Nb="readyState",Ob="charCode",Pb="remove",Qb="createElement",Rb="scrollHeight",Sb="keyCode",Tb="firstChild",Ub="forEach",Vb="addEventListener",Wb="setAttribute",Xb="handleEvent",Yb="execCommand",Zb="type",ac="parentWindow",bc="clear",cc="childNodes",vaa="attachEvent",dc="defaultView",ec="name",fc="nextSibling",gc="contentWindow",hc="getTime",ic="getElementsByTagName",
+jc="frames",kc="clientX",lc="clientY",mc="documentElement",nc="substr",oc="opener",pc="previousSibling",qc="stop",t="toString",rc="altKey",waa="innerText",sc="createObject",u="length",xaa="propertyIsEnumerable",yaa="position",tc="create",w="prototype",zaa="toUTCString",uc="className",vc="clientWidth",wc="abort",xc="setTimeout",yc="document",Ac="removeEventListener",Bc="ctrlKey",Cc="split",Dc="setInterval",Ec="stopPropagation",Fc="userAgent",Gc="stack",Hc="callee",Ic="location",Jc="caller",Kc="hasOwnProperty",
+x="style",Lc="body",Mc="ownerDocument",Nc="removeChild",Oc="parent",Pc="search",y="target",Qc="lastChild",z="call",Aaa="some",Rc="start",Sc="lastIndexOf",Tc="random",Uc="getAttribute",Vc="enabled",Wc="clientHeight",Xc="charCodeAt",Baa="arguments",Yc="href",Zc="substring",ad="removeNode",Caa="every",bd="contains",cd="apply",dd="shiftKey",ed="tagName",Daa="border",fd="attributes",gd="navigator",A="parentNode",hd="execute",id="height",jd="splice",kd="join",ld="unshift",Eaa="execScript",md="nodeValue",
+od="toLowerCase",pd="view",qd="ls",rd="ver",sd="absolute",td="overflow",ud="visible",vd="TR",wd="display",xd="none",yd="hidden",zd="BODY",Ad="jf",Bd="HR",Cd="DIV",Dd="UL",Ed="\u00a0",Fd="TD",Gd="Xd",Hd="IFRAME",Faa="Chrome",Id="stop",Gaa="begin",Jd="end",Kd="a",Ld="padding",Md="/",Nd="contacts",Od="$",Pd="d",Qd="-",Rd="e",Sd="hl",Td="iframe",Ud="border",Haa="margin",Vd="IMG",Wd="TABLE",Iaa="PRE",Xd="P",Yd="cc",Zd='" ',ae="O",be="BLOCKQUOTE",ce="group",de="pq",ee="relative",Jaa="DL",Kaa="/*",Laa="/...",
+fe="id",ge="ae",he="cd",ie="mid",je="gd",ke="cl",le="xe",me="NONE",ne="img",oe="pt",pe="block",Maa='" <',qe="gc",re="5",se="9",ue="add",ve="remove",we="contact",Naa="yr",Oaa="revert",Paa="cB",xe="LI",Qaa="COL",ye="DD",Raa="DT",ze="H2",Ae="H3",Saa="H4",Taa="H5",Uaa="ISINDEX",Be="OL",Vaa="TBODY",Waa="backgroundColor",Ce="transparent",Xaa='url("',Yaa='")',De="js",Zaa="Parent",aba="Child";function Ee(){return function(b){return b}}function B(){return function(){}}
+function Ge(b){return function(a){this[b]=a}}function D(b){return function(){return this[b]}}function E(b){return function(){return b}}var F,He=".",bba="var ";function Ie(b,a,c){b=b[Cc](He);c=c||Je;!(b[0]in c)&&c[Eaa]&&c[Eaa](bba+b[0]);for(var d;b[u]&&(d=b[db]());)if(!b[u]&&Ke(a))c[d]=a;else c=c[d]?c[d]:(c[d]={})}function Le(b,a){b=b[Cc](He);a=a||Je;for(var c;c=b[db]();)if(a[c])a=a[c];else return i;return a}function Me(){}function Ne(b){b.S=function $(){return b.AOc||(b.AOc=new b)}}
+var Oe="object",cba="[object Array]",Qe="number",dba="splice",Re="array",eba="[object Function]",fba="call",Se="function",gba="null";
+function Te(b){var a=typeof b;if(a==Oe)if(b){if(b instanceof Array||!(b instanceof ca)&&ca[w][t][z](b)==cba||typeof b[u]==Qe&&typeof b[jd]!="undefined"&&typeof b[xaa]!="undefined"&&!b[xaa](dba))return Re;if(!(b instanceof ca)&&(ca[w][t][z](b)==eba||typeof b[z]!="undefined"&&typeof b[xaa]!="undefined"&&!b[xaa](fba)))return Se}else return gba;else if(a==Se&&typeof b[z]=="undefined")return Oe;return a}function Ke(b){return b!==undefined}function Ue(b){return b!=i}function Ve(b){return Te(b)==Re}
+function We(b){var a=Te(b);return a==Re||a==Oe&&typeof b[u]==Qe}var Xe="string";function Ye(b){return typeof b==Xe}function Ze(b){return Te(b)==Se}function af(b){b=Te(b);return b==Oe||b==Re||b==Se}function bf(b){if(b[Kc]&&b[Kc](cf))return b[cf];b[cf]||(b[cf]=++hba);return b[cf]}function iba(b){var a=Te(b);if(a==Oe||a==Re){if(b.vc)return b.vc[z](b);a=a==Re?[]:{};for(var c in b)a[c]=iba(b[c]);return a}return b}
+function G(b,a){var c=a||Je;if(arguments[u]>2){var d=Array[w][lb][z](arguments,2);return function(){var f=Array[w][lb][z](arguments);Array[w][ld][cd](f,d);return b[cd](c,f)}}else return function(){return b[cd](c,arguments)}}function df(b){var a=Array[w][lb][z](arguments,1);return function(){var c=Array[w][lb][z](arguments);c[ld][cd](c,a);return b[cd](this,c)}}function H(b,a){function c(){}maa(c,a[w]);b.C=a[w];maa(b,new c);b[w].constructor=b}function ef(b,a){return ff(b,a)>=0}
+function gf(b){if(!Ve(b))for(var a=b[u]-1;a>=0;a--)delete b[a];Ia(b,0)}function hf(b,a){ef(b,a)||b[p](a)}function jf(b,a){a=ff(b,a);var c;if(c=a>=0)kf(b,a);return c}function kf(b,a){return lf[jd][z](b,a,1)[u]==1}function mf(){return lf[wb][cd](lf,arguments)}function nf(b){if(Ve(b))return mf(b);else{for(var a=[],c=0,d=b[u];c<d;c++)a[c]=b[c];return a}}var jba="callee";
+function of(b){for(var a=1;a<arguments[u];a++){var c=arguments[a],d;if(Ve(c)||(d=We(c))&&c[Kc](jba))b[p][cd](b,c);else if(d)for(var f=b[u],g=c[u],j=0;j<g;j++)b[f+j]=c[j];else b[p](c)}}function pf(b){return lf[jd][cd](b,qf(arguments,1))}function qf(b,a,c){return arguments[u]<=2?lf[lb][z](b,a):lf[lb][z](b,a,c)}function rf(b,a){a=a||b;for(var c={},d=0,f=0;f<b[u];){var g=b[f++],j=af(g)?bf(g):g;if(!ca[w][Kc][z](c,j)){c[j]=h;a[d++]=g}}Ia(a,d)}
+function sf(){for(var b=[],a=0;a<arguments[u];a++){var c=arguments[a];Ve(c)?b[p][cd](b,sf[cd](i,c)):b[p](c)}return b}function tf(){}function uf(b,a,c){for(var d in b)a[z](c,b[d],d,b)}function vf(b){var a=0;for(var c in b)a++;return a}function wf(b){var a=[],c=0;for(var d in b)a[c++]=b[d];return a}function xf(b){var a=[],c=0;for(var d in b)a[c++]=d;return a}function kba(b,a){for(var c in b)if(b[c]==a)return h;return k}function yf(b){for(var a in b)return k;return h}
+function zf(b){for(var a,c,d=1;d<arguments[u];d++){c=arguments[d];for(a in c)b[a]=c[a];for(var f=0;f<lba[u];f++){a=lba[f];if(ca[w][Kc][z](c,a))b[a]=c[a]}}}function Af(){var b=arguments[u];if(b==1&&Ve(arguments[0]))return Af[cd](i,arguments[0]);if(b%2)e(Error(".5"));for(var a={},c=0;c<b;c+=2)a[arguments[c]]=arguments[c+1];return a}function Bf(){var b=arguments[u];if(b==1&&Ve(arguments[0]))return Bf[cd](i,arguments[0]);for(var a={},c=0;c<b;c++)a[arguments[c]]=h;return a}
+function mba(b){if(typeof b.Nb==Se)return b.Nb();if(We(b)||Ye(b))return b[u];return vf(b)}var I="";function Cf(b){if(typeof b.Oa==Se)return b.Oa();if(Ye(b))return b[Cc](I);if(We(b)){for(var a=[],c=b[u],d=0;d<c;d++)a[p](b[d]);return a}return wf(b)}function Df(b){if(typeof b.Sb==Se)return b.Sb();if(typeof b.Oa!=Se){if(We(b)||Ye(b)){var a=[];b=b[u];for(var c=0;c<b;c++)a[p](c);return a}return xf(b)}}
+function nba(b,a){if(typeof b[bd]==Se)return b[bd](a);if(typeof b.BS==Se)return b.BS(a);if(We(b)||Ye(b))return ef(b,a);return kba(b,a)}function Ef(b,a,c){if(typeof b[Ub]==Se)b[Ub](a,c);else if(We(b)||Ye(b))Ff(b,a,c);else for(var d=Df(b),f=Cf(b),g=f[u],j=0;j<g;j++)a[z](c,f[j],d&&d[j],b)}function oba(b,a,c){if(typeof b[Caa]==Se)return b[Caa](a,c);if(We(b)||Ye(b))return Gf(b,a,c);for(var d=Df(b),f=Cf(b),g=f[u],j=0;j<g;j++)if(!a[z](c,f[j],d&&d[j],b))return k;return h}
+function Hf(b){this.yd={};this.ri=[];var a=arguments[u];if(a>1){if(a%2)e(Error(".5"));for(var c=0;c<a;c+=2)this.set(arguments[c],arguments[c+1])}else b&&this.Vl(b)}function pba(b,a){return b===a}function qba(b){if(b.Cf!=b.ri[u]){for(var a=0,c=0;a<b.ri[u];){var d=b.ri[a];if(If(b.yd,d))b.ri[c++]=d;a++}Ia(b.ri,c)}if(b.Cf!=b.ri[u]){var f={};for(c=a=0;a<b.ri[u];){d=b.ri[a];if(!If(f,d)){b.ri[c++]=d;f[d]=1}a++}Ia(b.ri,c)}}function If(b,a){return ca[w][Kc][z](b,a)}function Jf(){}
+function Kf(b){b&&typeof b.D==Se&&b.D()}function Lf(b,a){this.LP=a;this.nv=[];if(b>this.LP)e(Error(".7"));for(a=0;a<b;a++)this.nv[p](this[sc]())}function Mf(b,a){return b[Db](a)==0}function Nf(b,a){var c=b[u]-a[u];return c>=0&&b[Sc](a,c)==c}function Of(b){return!/[^\t\n\r ]/[cb](b)}function Pf(b){return b[mb](/^[\s\xa0]+|[\s\xa0]+$/g,I)}function Qf(b){b=String(b);if(!rba[cb](b))return aa(b);return b}var J=" ";function Rf(b){return ga(b[mb](/\+/g,J))}
+var sba="&amp;",tba="&lt;",uba="&gt;",vba="&quot;",Sf="&",Tf="<",Uf=">",Vf='"';function Wf(b,a){if(a)return b[mb](wba,sba)[mb](xba,tba)[mb](yba,uba)[mb](zba,vba);else{if(!Aba[cb](b))return b;if(b[Db](Sf)!=-1)b=b[mb](wba,sba);if(b[Db](Tf)!=-1)b=b[mb](xba,tba);if(b[Db](Uf)!=-1)b=b[mb](yba,uba);if(b[Db](Vf)!=-1)b=b[mb](zba,vba);return b}}function Xf(b,a){return b[Db](a)!=-1}function Yf(){return l[rb](l[Tc]()*2147483648)[t](36)+(l[rb](l[Tc]()*2147483648)^Zf())[t](36)}var Bba="(\\d*)(\\D*)",ag="g";
+function bg(b,a){var c=0;b=Pf(String(b))[Cc](He);a=Pf(String(a))[Cc](He);for(var d=l.max(b[u],a[u]),f=0;c==0&&f<d;f++){var g=b[f]||I,j=a[f]||I,n=new RegExp(Bba,ag),s=new RegExp(Bba,ag);do{var v=n[hb](g)||[I,I,I],C=s[hb](j)||[I,I,I];if(v[0][u]==0&&C[0][u]==0)break;c=Cba(v[1][u]==0?0:da(v[1],10),C[1][u]==0?0:da(C[1],10))||Cba(v[2][u]==0,C[2][u]==0)||Cba(v[2],C[2])}while(c==0)}return c}function Cba(b,a){if(b<a)return-1;else if(b>a)return 1;return 0}function cg(b){this.yd=new Hf;b&&this.Vl(b)}
+var dg="o";function Dba(b){var a=typeof b;return a==Oe&&b||a==Se?dg+bf(b):a[nc](0,1)+b}function Eba(b,a,c){c=c||Je;var d=c.onerror;oa(c,function $a(g,j,n){d&&d(g,j,n);j=String(j)[Cc](/[\/\\]/).pop();b({message:g,fileName:j,SZb:n});return Boolean(a)})}var eg="message";function Fba(b,a){var c=typeof b==Xe?Error(b):b;if(!c[Gc])oaa(c,Gba(arguments[Hc][Jc]));if(a){for(var d=0;c[eg+d];)++d;c[eg+d]=String(a)}return c}
+var Hba="()\n",Iba="[exception trying to get caller]\n",Jba="[...long stack...]",Kba="[...reached max depth limit...]",Lba="[end]";function Mba(b){for(var a=[],c=arguments[Hc][Jc],d=0;c&&(!b||d<b);){a[p](fg(c));a[p](Hba);try{c=c[Jc]}catch(f){a[p](Iba);break}d++;if(d>=50){a[p](Jba);break}}b&&d>=b?a[p](Kba):a[p](Lba);return a[kd](I)}function Gba(b){return Nba(b||arguments[Hc][Jc],[])}var Oba="[...circular reference...]",gg="(",hg=", ",ig="boolean",jg="true",kg="false",Pba="[fn]",lg="...",Qba=")\n";
+function Nba(b,a){var c=[];if(ef(a,b))c[p](Oba);else if(b&&a[u]<50){c[p](fg(b)+gg);for(var d=b[Baa],f=0;f<d[u];f++){f>0&&c[p](hg);var g;g=d[f];switch(typeof g){case Oe:g=g?Oe:gba;break;case Xe:g=g;break;case Qe:g=String(g);break;case ig:g=g?jg:kg;break;case Se:g=(g=fg(g))?g:Pba;break;case "undefined":default:g=typeof g;break}if(g[u]>40)g=g[nc](0,40)+lg;c[p](g)}a[p](b);c[p](Qba);try{c[p](Nba(b[Jc],a))}catch(j){c[p](Iba)}}else b?c[p](Jba):c[p](Lba);return c[kd](I)}var Rba="[Anonymous]";
+function fg(b){b=String(b);if(!Sba[b]){var a=/function ([^\(]+)/[hb](b);Sba[b]=a?a[1]:Rba}return Sba[b]}function Tba(b){this.rOb=b}var Uba="__protected_",mg="_",ng="__";function og(b,a,c){c=!!c;var d=Uba+bf(b)+mg+c+ng;a[d]||(a[d]=b.Gdb(a,c));return a[d]}var pg="window";function Vba(b,a){var c=Le(pg),d=c[xc];naa(c,function $b(g,j){g=og(b,g,a);return d[z]?d[z](this,g,j):d(g,j)})}function Wba(b,a){var c=Le(pg),d=c[Dc];c.setInterval=function $c(g,j){g=og(b,g,a);return d[z]?d[z](this,g,j):d(g,j)}}
+function Xba(b,a){this.rOb=b;this.oBc=!!a}function Yba(b,a){return function(){b.dDc&&b.dDc();return a[cd](this,arguments)}}function Zba(){}function rg(b,a,c){if(b.Qla)b.Qla.yI(c,a);else b.Dla&&b.Dla[u]<10&&b.Dla[p]([a,c])}function sg(b){rg(tg,i,b)}function ug(){return Je[gd]?Je[gd][Fc]:i}function aca(){return Je[gd]}function vg(b){return bca[b]||(bca[b]=bg(wg,b)>=0)}function xg(b,a){this.x=Ke(b)?b:0;this.y=Ke(a)?a:0}function yg(b,a){ka(this,b);Wa(this,a)}
+function zg(b){return(b=b[uc])&&typeof b[Cc]==Se?b[Cc](J):[]}function K(b){var a=zg(b),c=qf(arguments,1);c=cca(a,c);m(b,a[kd](J));return c}function Ag(b){var a=zg(b),c=qf(arguments,1);c=dca(a,c);m(b,a[kd](J));return c}function cca(b,a){for(var c=0,d=0;d<a[u];d++)if(!ef(b,a[d])){b[p](a[d]);c++}return c==a[u]}function dca(b,a){for(var c=0,d=0;d<b[u];d++)if(ef(a,b[d])){pf(b,d--,1);c++}return c==a[u]}function Bg(b,a){return ef(zg(b),a)}function Cg(b){return b?new Dg(Eg(b)):eca||(eca=new Dg)}
+function Fg(b){return Ye(b)?ea[ub](b):b}function Gg(b,a,c){return fca(ea,b,a,c)}var Hg="*",Ig="528";
+function fca(b,a,c,d){d=d||b;a=a&&a!=Hg?a[od]():I;if(d.querySelectorAll&&(a||c)&&(!Jg||gca(b)||vg(Ig)))return d.querySelectorAll(a+(c?He+c:I));if(c&&d.getElementsByClassName){b=d.getElementsByClassName(c);if(a){d={};for(var f=0,g=0,j;j=b[g];g++)if(a==j[Gb][od]())d[f++]=j;Ia(d,f);return d}else return b}b=d[ic](a||Hg);if(c){d={};for(g=f=0;j=b[g];g++){a=j[uc];if(typeof a[Cc]==Se&&ef(a[Cc](J),c))d[f++]=j}Ia(d,f);return d}else return b}var Kg="style",hca="class",ica="for";
+function Lg(b,a){uf(a,function(c,d){if(d==Kg)iaa(b[x],c);else if(d==hca)m(b,c);else if(d==ica)b.htmlFor=c;else if(d in jca)b[Wb](jca[d],c);else b[d]=c})}var kca="500",lca="9.50";function Mg(b){b=b||ba;var a=b[yc];if(Jg&&!vg(kca)&&!mca){if(typeof b.innerHeight=="undefined")b=ba;a=b.innerHeight;var c=b[yc][mc][Rb];if(b==b.top)if(c<a)a-=15;b=new yg(b[ab],a)}else{b=gca(a)&&(!Ng||Ng&&vg(lca))?a[mc]:a[Lc];b=new yg(b[vc],b[Wc])}return b}var nca=' name="',oca=' type="';
+function pca(b,a){var c=a[0],d=a[1];if(L&&d&&(d[ec]||d[Zb])){c=[Tf,c];d[ec]&&c[p](nca,Wf(d[ec]),Vf);if(d[Zb]){c[p](oca,Wf(d[Zb]),Vf);d=iba(d);delete d[Zb]}c[p](Uf);c=c[kd](I)}var f=b[Qb](c);if(d)if(Ye(d))m(f,d);else Lg(f,d);if(a[u]>2){d=function $d(n){if(n)f[o](Ye(n)?b[yb](n):n)};for(c=2;c<a[u];c++){var g=a[c];We(g)&&!qca(g)?Ff(rca(g)?nf(g):g,d):d(g)}}return f}var sca="CSS1Compat";function gca(b){return b.compatMode==sca}function Og(b,a){b[o](a)}function Pg(b){for(var a;a=b[Tb];)b[Nc](a)}
+function Qg(b,a){a[A]&&a[A][Bb](b,a)}function Rg(b,a){a[A]&&a[A][Bb](b,a[fc])}function Sg(b){return b&&b[A]?b[A][Nc](b):i}function Ug(b,a){var c=a[A];c&&c[fb](b,a)}function Vg(b){var a,c=b[A];if(c&&c[nb]!=11)if(b[ad])return b[ad](k);else{for(;a=b[Tb];)c[Bb](a,b);return Sg(b)}}function Wg(b){return Xg(b[Tb],h)}function Yg(b){return Xg(b[fc],h)}function tca(b){return Xg(b[pc],k)}function Xg(b,a){for(;b&&b[nb]!=1;)b=a?b[fc]:b[pc];return b}function qca(b){return af(b)&&b[nb]>0}
+function Zg(b,a){if(b[bd]&&a[nb]==1)return b==a||b[bd](a);if(typeof b[taa]!="undefined")return b==a||Boolean(b[taa](a)&16);for(;a&&b!=a;)a=a[A];return a==b}function Eg(b){return b[nb]==9?b:b[Mc]||b[yc]}var uca="textContent";function ah(b,a){if(uca in b)b.textContent=a;else if(b[Tb]&&b[Tb][nb]==3){for(;b[Qc]!=b[Tb];)b[Nc](b[Qc]);ma(b[Tb],a)}else{Pg(b);b[o](Eg(b)[yb](a))}}function bh(b,a){var c=[];return vca(b,a,c,h)?c[0]:undefined}function wca(b,a){var c=[];vca(b,a,c,k);return c}
+function vca(b,a,c,d){if(b!=i)for(var f=0,g;g=b[cc][f];f++){if(a(g)){c[p](g);if(d)return h}if(vca(g,a,c,d))return h}return k}var xca="innerText",ch="\n";function dh(b){if(L&&xca in b)b=b[waa][mb](/(\r\n|\r|\n)/g,ch);else{var a=[];yca(b,a,h);b=a[kd](I)}b=b[mb](/\xAD/g,I);b=b[mb](/ +/g,J);if(b!=J)b=b[mb](/^\s*/,I);return b}function eh(b){var a=[];yca(b,a,k);return a[kd](I)}
+function yca(b,a,c){if(!(b[Gb]in zca))if(b[nb]==3)c?a[p](String(b[md])[mb](/(\r\n|\r|\n)/g,I)):a[p](b[md]);else if(b[Gb]in Aca)a[p](Aca[b[Gb]]);else for(b=b[Tb];b;){yca(b,a,c);b=b[fc]}}function rca(b){if(b&&typeof b[u]==Qe)if(af(b))return typeof b[Ab]==Se||typeof b[Ab]==Xe;else if(Ze(b))return typeof b[Ab]==Se;return k}function fh(b,a,c){return gh(b,function(d){return(!a||d[Gb]==a)&&(!c||Bg(d,c))},h)}
+function gh(b,a,c,d){if(!c)b=b[A];c=d==i;for(var f=0;b&&(c||f<=d);){if(a(b))return b;b=b[A];f++}return i}function Dg(b){this.ki=b||Je[yc]||ea}function Bca(){}function N(b,a){za(this,b);Pa(this,a);sa(this,this[y])}function hh(b,a){b&&this.wc(b,a)}function Cca(){}
+function ih(b,a,c,d,f){if(a)if(Ve(a)){for(var g=0;g<a[u];g++)ih(b,a[g],c,d,f);return i}else{d=!!d;var j=jh;a in j||(j[a]=Dca());j=j[a];if(!(d in j)){j[d]=Dca();j.Cf++}j=j[d];var n=bf(b),s;j.SL++;if(j[n]){s=j[n];for(g=0;g<s[u];g++){j=s[g];if(j.GA==c&&j.Si==f){if(j.rla)break;return s[g].key}}}else{s=j[n]=Eca();j.Cf++}g=Fca();g.src=b;j=Gca();j.wc(c,g,b,a,d,f);c=j.key;g.key=c;s[p](j);kh[c]=j;lh[n]||(lh[n]=Eca());lh[n][p](j);if(b[Vb]){if(b==Je||!b.f8a)b[Vb](a,g,d)}else b[vaa](Hca(a),g);return c}else e(Error(".10"))}
+function mh(b,a,c,d,f){if(Ve(a)){for(var g=0;g<a[u];g++)mh(b,a[g],c,d,f);return i}b=ih(b,a,c,d,f);kh[b].e5a=h;return b}function nh(b,a,c,d,f){if(Ve(a)){for(var g=0;g<a[u];g++)nh(b,a[g],c,d,f);return i}d=!!d;b=Ica(b,a,d);if(!b)return k;for(g=0;g<b[u];g++)if(b[g].GA==c&&b[g][Fb]==d&&b[g].Si==f)return oh(b[g].key);return k}
+function oh(b){if(!kh[b])return k;var a=kh[b];if(a.rla)return k;var c=a.src,d=a[Zb],f=a.qf,g=a[Fb];if(c[Ac]){if(c==Je||!c.f8a)c[Ac](d,f,g)}else c.detachEvent&&c.detachEvent(Hca(d),f);c=bf(c);f=jh[d][g][c];if(lh[c]){var j=lh[c];jf(j,a);j[u]==0&&delete lh[c]}a.rla=h;f.h2b=h;Jca(d,g,c,f);delete kh[b];return h}
+function Jca(b,a,c,d){if(!d.vRa)if(d.h2b){for(var f=0,g=0;f<d[u];f++)if(d[f].rla){var j=d[f].qf;j.src=i;Kca(j);Lca(d[f])}else{if(f!=g)d[g]=d[f];g++}Ia(d,g);d.h2b=k;if(g==0){Mca(d);delete jh[b][a][c];jh[b][a].Cf--;if(jh[b][a].Cf==0){Nca(jh[b][a]);delete jh[b][a];jh[b].Cf--}if(jh[b].Cf==0){Nca(jh[b]);delete jh[b]}}}}
+function ph(b,a,c){var d=0,f=b==i,g=a==i,j=c==i;c=!!c;if(f)uf(lh,function(s){for(var v=s[u]-1;v>=0;v--){var C=s[v];if((g||a==C[Zb])&&(j||c==C[Fb])){oh(C.key);d++}}});else{b=bf(b);if(lh[b]){b=lh[b];for(f=b[u]-1;f>=0;f--){var n=b[f];if((g||a==n[Zb])&&(j||c==n[Fb])){oh(n.key);d++}}}}return d}function Ica(b,a,c){var d=jh;if(a in d){d=d[a];if(c in d){d=d[c];b=bf(b);if(d[b])return d[b]}}return i}var qh="on";function Hca(b){if(b in Oca)return Oca[b];return Oca[b]=qh+b}
+function rh(b,a,c,d,f){var g=1;a=bf(a);if(b[a]){b.SL--;b=b[a];if(b.vRa)b.vRa++;else b.vRa=1;try{for(var j=b[u],n=0;n<j;n++){var s=b[n];if(s&&!s.rla)g&=Pca(s,f)!==k}}finally{b.vRa--;Jca(c,d,a,b)}}return Boolean(g)}function Pca(b,a){a=b[Xb](a);b.e5a&&oh(b.key);return a}
+function sh(b,a){if(Ye(a))a=new N(a,b);else if(a instanceof N)Pa(a,a[y]||b);else{var c=a;a=new N(a[Zb],b);zf(a,c)}c=1;var d,f=a[Zb],g=jh;if(!(f in g))return h;g=g[f];f=h in g;var j;if(f){d=[];for(j=b;j;j=j.rv())d[p](j);j=g[h];j.SL=j.Cf;for(var n=d[u]-1;!a.sQ&&n>=0&&j.SL;n--){sa(a,d[n]);c&=rh(j,d[n],a[Zb],h,a)&&a.t1!=k}}if(k in g){j=g[k];j.SL=j.Cf;if(f)for(n=0;!a.sQ&&n<d[u]&&j.SL;n++){sa(a,d[n]);c&=rh(j,d[n],a[Zb],k,a)&&a.t1!=k}else for(b=b;!a.sQ&&b&&j.SL;b=b.rv()){sa(a,b);c&=rh(j,b,a[Zb],k,a)&&a.t1!=
+k}}return Boolean(c)}var Qca="window.event";
+function th(b,a){if(!kh[b])return h;b=kh[b];var c=b[Zb],d=jh;if(!(c in d))return h;d=d[c];var f,g;if(L){f=a||Le(Qca);a=h in d;var j=k in d;if(a){if(f[Sb]<0||f.returnValue!=undefined)return h;a:{var n=k;if(f[Sb]==0)try{xa(f,-1);break a}catch(s){n=h}if(n||f.returnValue==undefined)paa(f,h)}}n=Rca();n.wc(f,this);f=h;try{if(a){for(var v=Eca(),C=n[Hb];C;C=C[A])v[p](C);g=d[h];g.SL=g.Cf;for(var M=v[u]-1;!n.sQ&&M>=0&&g.SL;M--){sa(n,v[M]);f&=rh(g,v[M],c,h,n)}if(j){g=d[k];g.SL=g.Cf;for(M=0;!n.sQ&&M<v[u]&&g.SL;M++){sa(n,
+v[M]);f&=rh(g,v[M],c,k,n)}}}else f=Pca(b,n)}finally{if(v){Ia(v,0);Mca(v)}n.D();Sca(n)}return f}g=new hh(a,this);try{f=Pca(b,g)}finally{g.D()}return f}function uh(){}var vh="@",wh="]",xh=")";
+function yh(b){b=String(b);if(/^\s*$/[cb](b)?k:/^[\],:{}\s\u2028\u2029]*$/[cb](b[mb](/\\["\\\/bfnrtu]/g,vh)[mb](/"[^"\\\n\r\u2028\u2029\x00-\x08\x10-\x1f\x80-\x9f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,wh)[mb](/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,I)))try{return eval(gg+b+xh)}catch(a){}e(Error(".11`"+b))}function zh(b){return(new Tca).Xs(b)}function Tca(){}var Uca="\\u",Vca="000",Wca="00",Ah="0";
+function Xca(b,a,c){c[p](Vf,a[mb](Yca,function(d){if(d in Zca)return Zca[d];var f=d[Xc](0),g=Uca;if(f<16)g+=Vca;else if(f<256)g+=Wca;else if(f<4096)g+=Ah;return Zca[d]=g+f[t](16)}),Vf)}function Bh(b,a){this.Ly=b||1;this.UDa=a||Ch;this.E4a=G(this.Pnd,this);this.Oia=Zf()}function Dh(b,a,c){if(Ze(b)){if(c)b=G(b,c)}else if(b&&typeof b[Xb]==Se)b=G(b[Xb],b);else e(Error(".9"));return a>2147483647?-1:Ch[xc](b,a||0)}function Eh(b){Ch[gb](b)}function ada(){if(Fh){this.GY={};this.a1a={};this.oZa=[]}}
+function bda(b,a){if(b.Lf){a=Ye(a)?a:af(a)?bf(a):I;b.oZa[p](a)}}function cda(b){if(b.Lf){var a=b.oZa.pop();dda(b,a)}}function eda(b,a){if(b.Lf){a=bf(a);for(var c=0;c<b.oZa[u];c++){var d=b.oZa[c];fda(b,b.GY,d,a);fda(b,b.a1a,a,d)}}}function dda(b,a){var c=b.a1a[a],d=b.GY[a];c&&d&&Ff(c,function(f){Ff(d,function(g){fda(this,this.GY,f,g);fda(this,this.a1a,g,f)},this)},b)}function fda(b,a,c,d){a[c]||(a[c]=[]);ef(a[c],d)||a[c][p](d)}function gda(){return hda()}
+var ida="MSXML2.XMLHTTP.6.0",jda="MSXML2.XMLHTTP.3.0",kda="MSXML2.XMLHTTP",lda="Microsoft.XMLHTTP";function mda(){if(!nda&&typeof XMLHttpRequest=="undefined"&&typeof ActiveXObject!="undefined"){for(var b=[ida,jda,kda,lda],a=0;a<b[u];a++){var c=b[a];try{new ActiveXObject(c);return nda=c}catch(d){}}e(Error(".13"))}return nda}function Gh(){this.headers=new Hf}var Hh="complete",Ih="ready";function Jh(b,a,c,d,f,g){var j=new Gh;oda[p](j);a&&ih(j,Hh,a);ih(j,Ih,df(pda,j));g&&j.X1(g);j[Mb](b,c,d,f)}
+function qda(b,a){Gh[w].oqb=og(b,Gh[w].oqb,a)}function pda(b){b.D();jf(oda,b)}var Kh="error";function rda(b){if(!b.vab){b.vab=h;b[r](Hh);b[r](Kh)}}var Lh="readystatechange",Mh="success",sda=" [";function tda(b){if(b.ng)if(typeof uda!="undefined")if(!(b.Z0a[1]&&b.ts()==4&&b.hf()==2))if(b.XOa&&b.ts()==4)Ch[xc](G(b.Y5b,b),0);else{b[r](Lh);if(b.jm()){b.ng=k;if(b.ye()){b[r](Hh);b[r](Mh)}else{b.eo=6;var a;try{a=b.ts()>2?b.ob.statusText:I}catch(c){a=I}b.wk=a+sda+b.hf()+wh;rda(b)}vda(b)}}}
+function vda(b,a){if(b.ob){var c=b.ob,d=b.Z0a[0]?Me:i;b.ob=i;b.Z0a=i;if(b.hD){Ch[gb](b.hD);b.hD=i}if(!a){bda(Nh,c);b[r](Ih);cda(Nh)}if(Nh.Lf){b=bf(c);delete Nh.a1a[b];for(var f in Nh.GY){jf(Nh.GY[f],b);Nh.GY[f][u]==0&&delete Nh.GY[f]}}try{ja(c,d)}catch(g){}}}function Oh(b,a){this.defaultValue=b;za(this,a);pa(this,b)}var Ph="b";function Qh(b){Oh[z](this,b,Ph)}function Rh(b){oaa(this,(new Error)[Gc]||I);Fba(this);if(b)Oa(this,String(b))}
+function Sh(b,a){var c;if(b instanceof Sh){this.hma(a==i?b.hP:a);this.Pr(b.ul);wda(this,b.DX);this.iB(b.Jk());Th(this,b.UA);this.Or(b.Vf);this.Jx(b.Of().vc());Uh(this,b.td())}else if(b&&(c=String(b)[Kb](Vh))){this.hma(!!a);this.Pr(c[1]||I,h);wda(this,c[2]||I,h);this.iB(c[3]||I,h);Th(this,c[4]);this.Or(c[5]||I,h);this.uo(c[6]||I,h);Uh(this,c[7]||I,h)}else{this.hma(!!a);this.Vs=new Wh(i,this,this.hP)}}function wda(b,a,c){Xh(b);delete b.DG;b.DX=c?Yh(a):a;return b}
+function Th(b,a){Xh(b);delete b.DG;if(a){a=Number(a);if(ia(a)||a<0)e(Error(".15`"+a));b.UA=a}else b.UA=i;return b}function Zh(b,a){return b.Vs.J(a)}function Uh(b,a,c){Xh(b);delete b.DG;b.N5=c?Yh(a):a;return b}var ai="zx";function bi(b){Xh(b);b.ka(ai,Yf());return b}function Xh(b){if(b.xia)e(Error(".16"))}function ci(b,a,c,d,f,g,j,n){n=new Sh(i,n);b&&n.Pr(b);a&&wda(n,a);c&&n.iB(c);d&&Th(n,d);f&&n.Or(f);g&&n.Jx(g);j&&Uh(n,j);return n}function Yh(b){return b?ga(b):I}
+function xda(b,a){var c=i;if(Ye(b)){c=b;yda[cb](c)||(c=encodeURI(b));if(c[Pc](a)>=0)c=c[mb](a,zda)}return c}var di="%";function zda(b){b=b[Xc](0);return di+(b>>4&15)[t](16)+(b&15)[t](16)}function Wh(b,a,c){this.mT=b||i;this.Bf=a||i;this.hP=!!c}var ei="=";function fi(b){if(!b.km){b.km=new Hf;if(b.mT)for(var a=b.mT[Cc](Sf),c=0;c<a[u];c++){var d=a[c][Db](ei),f=i,g=i;if(d>=0){f=a[c][Zc](0,d);g=a[c][Zc](d+1)}else f=a[c];f=Rf(f);f=gi(b,f);b.add(f,g?Rf(g):I)}}}
+function Ada(b,a,c){var d=Df(b);if(typeof d=="undefined")e(Error(".17"));b=Cf(b);if(d[u]!=b[u])e(Error(".18"));a=new Wh(i,a,c);for(c=0;c<d[u];c++)a.add(d[c],b[c]);return a}function hi(b){delete b.Cea;delete b.mT;b.Bf&&delete b.Bf.DG}function gi(b,a){a=String(a);if(b.hP)a=a[od]();return a}var ii="i";function ji(b){Oh[z](this,b,ii)}var ki="s";function Bda(b){Oh[z](this,b,ki)}var Cda="[exception trying to get caller]";
+function Dda(b,a,c){c[p](b);try{if(b[Jc])a-- >0?Dda(b[Jc],a,c):c[p](lg)}catch(d){c[p](Cda)}}function Eda(b,a,c,d,f){var g=[];Dda(arguments[Hc],5,g);var j=Fda(b,a,c,d,f);if(j)kh[j].nZa=g;return j}var Gda=";domain=",Hda=";path=",Ida=";expires=";function li(b,a,c,d,f){if(/[;=]/[cb](b))e(Error(".19`"+b));if(/;/[cb](a))e(Error(".20`"+a));Ke(c)||(c=-1);ea.cookie=b+ei+a+(f?Gda+f:I)+(d?Hda+d:I)+(c<0?I:c==0?Ida+(new Date(1970,1,1))[zaa]():Ida+(new Date((new Date)[hc]()+c*1E3))[zaa]())}
+function mi(b,a){b=b+ei;for(var c=String(ea[sb])[Cc](Jda),d=0,f;f=c[d];d++)if(f[Db](b)==0)return f[nc](b[u]);return a}function ni(b,a,c){var d=Ke(mi(b));li(b,I,0,a,c);return d}var Kda="GMAIL_LF";function oi(b){ni(b,pi);b=Lda.J(b);if((qi&b)==0){qi|=b;li(Kda,qi[t](16),31536E3,pi)}}function Mda(b){ni(b,pi);b=Lda.J(b);if(qi&b){qi&=~b;qi==0?ni(Kda,pi):li(Kda,qi[t](16),31536E3,pi)}}function ri(b){Ke(mi(b))&&oi(b);b=Lda.J(b);return(qi&b)!=0}function Nda(){this.eE=[];this.pDa=[];this.dna=[]}
+function si(b,a,c){return(a=Oda(a,c))&&a.js&&a.js[b]}function Oda(b,a){b=b?b[oc]:top[oc];try{if(b&&b.js&&(ti==b.js._GM_JSVersion||a))return b}catch(c){}return i}function Pda(b,a,c,d,f,g,j){return(b=si(b,a,c))&&b(d,f,g,j)}function Qda(){}function ui(b,a){this.WIb=[];this.eh=[i,i];this.LIb=b;this.kMb=a||i}function Rda(b,a){b.wE=a instanceof Error?1:0;b.eh[b.wE]=a;Sda(b)}function vi(b,a,c,d){b.WIb[p]([a,c,d]);b.wE>=0&&Sda(b);return b}
+function Sda(b){if(b.XAb&&b.wE!=0){Eh(b.XAb);delete b.XAb}for(var a=b.WIb,c=b.wE,d=b.eh[c],f=k,g;a[u]>0&&b.IV==0;){var j=a[db](),n=j[c];if(n)try{var s=n[z](j[2]||b.kMb,d);if(s!==undefined)d=s;c=d instanceof Error?1:0;if(d instanceof ui){g=G(b.Tyc,b);b.Mrb()}}catch(v){c=1;d=v;a[u]||(f=h)}}b.wE=c;b.eh[c]=d;if(g&&b.IV){vi(d,g,g,void 0);d.lwc=h}if(f)b.XAb=Dh(function(){e(d)})}function Tda(b){Rh[z](this);this.MAc=b}function wi(b){Rh[z](this);this.MAc=b}function xi(){}
+function Uda(b){this.yMb=b;this.irb=[];this.eza=[];this.G9a=[]}function Vda(b,a,c){for(b=0;b<a[u];b++)a[b][hd](c);Ia(a,0)}function Wda(b,a){this.SLa=b;this.na=a}function O(){this.bk={};this.eF=[];this.rI=[];this.U2=[];this.gIa={}}var yi="active",zi="idle",Xda="userActive",Yda="userIdle";function Ai(b){var a=b.TYb,c=b.Eb();if(c!=a){Zda(b,c?yi:zi);b.TYb=c}a=b.U2[u]>0;if(a!=b.mjc){Zda(b,a?Xda:Yda);b.mjc=a}}function aea(b,a){if(b.eF[u]==0)bea(b,a);else{b.rI[p](a);Ai(b)}}
+function bea(b,a,c,d){if(b.bk[a].hc())e(Error(".22`"+a));a=cea(b,a);if(!b.uHa&&a[u]>1){var f=a[db]();b.rI=a[wb](b.rI);a=[f]}if(!c)b.H6a=0;b.eF=a;Ai(b);b.Bxa.ySc(nf(a),b.bk,i,G(b.hJc,b),G(b.jJc,b),!!d)}function cea(b,a){var c=[a];for(a=nf(b.bk[a].yMb);a[u];){var d=a.pop();if(!b.bk[d].hc()){c[ld](d);Array[w][ld][cd](a,b.bk[d].yMb)}}rf(c);return c}function Bi(b,a){b.CSc=i;b.vea=a}function Ci(b){b.vea=i}
+function dea(b,a){var c=b.eF.pop();Ia(b.eF,0);var d=Di(b.rI,function(s){return ef(cea(b,s),c)});c&&hf(d,c);for(var f=0;f<d[u];f++){jf(b.rI,d[f]);jf(b.U2,d[f])}var g=b.gIa[Xa];if(g)for(f=0;f<g[u];f++)for(var j=g[f],n=0;n<d[u];n++)j(Kh,d[n],a);b.bk[c]&&b.bk[c].dza(a);Ai(b)}function eea(b){for(;b.rI[u];){var a=b.rI[db]();if(!b.bk[a].hc()){bea(b,a);return}}Ai(b)}function Zda(b,a){b=b.gIa[a];for(var c=0;b&&c<b[u];c++)b[c](a)}
+var fea=fa[0],gea=fa[2],Ei=fa[3],ti=fa[4],hea=fa[5],Fi=fa[6],pi=fa[7],iea=fa[8],Gi=fa[9],Hi=fa[10],jea=fa[11],kea=fa[12],lea=fa[14],Ii=fa[15],Ji=fa[16],mea=fa[17],nea=fa[18],Ki=fa[19],oea=fa[20],pea=fa[21],qea=fa[22],rea=fa[23],sea=fa[24],tea=fa[25];_B_prog(4)}catch(e){_B_err(e)}
+
+try{var uda=uda||{},Je=this,cf="closure_hashCode_"+l[rb](l[Tc]()*2147483648)[t](36),hba=0,Zf=Date.now||function(){return+new Date};caa[w].GHb=function $e(a){if(arguments[u]>1){var c=Array[w][lb][z](arguments,1);c[ld](this,a);return G[cd](i,c)}else return G(this,a)};caa[w].vC=function $f(a){H(this,a)};var lf=Array[w],ff=lf[Db]?function(b,a,c){return lf[Db][z](b,a,c)}:function(b,a,c){c=c==i?0:c<0?l.max(0,b[u]+c):c;if(Ye(b)){if(!Ye(a)||a[u]!=1)return-1;return b[Db](a,c)}for(c=c;c<b[u];c++)if(c in b&&b[c]===a)return c;return-1},Ff=lf[Ub]?function(b,a,c){lf[Ub][z](b,a,c)}:function(b,a,c){for(var d=b[u],f=Ye(b)?b[Cc](I):b,g=0;g<d;g++)g in f&&a[z](c,f[g],g,b)},Di=lf[Ya]?function(b,a,c){return lf[Ya][z](b,a,c)}:function(b,a,c){for(var d=b[u],f=[],g=0,j=Ye(b)?b[Cc](I):b,n=0;n<d;n++)if(n in j){var s=j[n];
+if(a[z](c,s,n,b))f[g++]=s}return f},Li=lf.map?function(b,a,c){return lf.map[z](b,a,c)}:function(b,a,c){for(var d=b[u],f=new Array(d),g=Ye(b)?b[Cc](I):b,j=0;j<d;j++)if(j in g)f[j]=a[z](c,g[j],j,b);return f},Mi=lf[Aaa]?function(b,a,c){return lf[Aaa][z](b,a,c)}:function(b,a,c){for(var d=b[u],f=Ye(b)?b[Cc](I):b,g=0;g<d;g++)if(g in f&&a[z](c,f[g],g,b))return h;return k},Gf=lf[Caa]?function(b,a,c){return lf[Caa][z](b,a,c)}:function(b,a,c){for(var d=b[u],f=Ye(b)?b[Cc](I):b,g=0;g<d;g++)if(g in f&&!a[z](c,
+f[g],g,b))return k;return h};var Ni="StopIteration"in Je?Je.StopIteration:Error(".2");Ma(tf[w],function $g(){e(Ni)});tf[w].mG=function $h(){return this};var lba=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"];F=Hf[w];F.Cf=0;F.FX=0;var uea="Cf";F.Nb=D(uea);F.Oa=function $j(){qba(this);for(var a=[],c=0;c<this.ri[u];c++)a[p](this.yd[this.ri[c]]);return a};F.Sb=function $k(){qba(this);return this.ri[wb]()};F.Xb=function $l(a){return If(this.yd,a)};F.BS=function $m(a){for(var c=0;c<this.ri[u];c++){var d=this.ri[c];if(If(this.yd,d)&&this.yd[d]==a)return h}return k};
+F.Qc=function $n(a,c){if(this===a)return h;if(this.Cf!=a.Nb())return k;c=c||pba;qba(this);for(var d,f=0;d=this.ri[f];f++)if(!c(this.J(d),a.J(d)))return k;return h};F.nd=function $o(){return this.Cf==0};Aa(F,function $p(){this.yd={};Ia(this.ri,0);this.FX=this.Cf=0});wa(F,function $q(a){if(If(this.yd,a)){delete this.yd[a];this.Cf--;this.FX++;this.ri[u]>2*this.Cf&&qba(this);return h}return k});F.J=function $r(a,c){if(If(this.yd,a))return this.yd[a];return c};
+F.set=function $s(a,c){if(!If(this.yd,a)){this.Cf++;this.ri[p](a);this.FX++}this.yd[a]=c};F.Vl=function $t(a){var c;if(a instanceof Hf){c=a.Sb();a=a.Oa()}else{c=xf(a);a=wf(a)}for(var d=0;d<c[u];d++)this.set(c[d],a[d])};F.vc=function $u(){return new Hf(this)};F.mG=function $w(a){qba(this);var c=0,d=this.ri,f=this.yd,g=this.FX,j=this,n=new tf;Ma(n,function $v(){for(;;){if(g!=j.FX)e(Error(".6"));if(c>=d[u])e(Ni);var v=d[c++];return a?v:f[v]}});return n};F=Jf[w];F.Pc=k;var Oi="Pc";F.yPc=D(Oi);F.xga=Jf[w].yPc;F.D=function $y(){if(!this.Pc){this.Pc=h;this.L()}};F.L=B();H(Lf,Jf);F=Lf[w];F.r4=i;F.VMb=i;F.Iw=function $A(){if(this.nv[u])return this.nv.pop();return this[sc]()};F.ez=function $B(a){this.nv[u]<this.LP?this.nv[p](a):this.ZS(a)};laa(F,function $C(){return this.r4?this.r4():{}});F.ZS=function $D(a){if(this.VMb)this.VMb(a);else if(Ze(a.D))a.D();else for(var c in a)delete a[c]};F.L=function $E(){Lf.C.L[z](this);for(var a=this.nv;a[u];)this.ZS(a.pop());delete this.nv};var rba=/^[a-zA-Z0-9\-_.!~*'()]*$/,wba=/&/g,xba=/</g,yba=/>/g,zba=/\"/g,Aba=/[&<>\"]/,vea=Zf();F=cg[w];F.Nb=function $F(){return this.yd.Nb()};F.add=function $G(a){this.yd.set(Dba(a),a)};F.Vl=function $H(a){a=Cf(a);for(var c=a[u],d=0;d<c;d++)this.add(a[d])};F.wb=function $I(a){a=Cf(a);for(var c=a[u],d=0;d<c;d++)this[Pb](a[d])};wa(F,function $J(a){return this.yd[Pb](Dba(a))});Aa(F,function $K(){this.yd[bc]()});F.nd=function $L(){return this.yd.nd()};Sa(F,function $M(a){return this.yd.Xb(Dba(a))});F.iwa=function $N(a){var c=new cg;a=Cf(a);for(var d=0;d<a[u];d++){var f=a[d];this[bd](f)&&c.add(f)}return c};
+F.Oa=function $O(){return this.yd.Oa()};F.vc=function $P(){return new cg(this)};F.Qc=function $Q(a){return this.Nb()==mba(a)&&this.mQa(a)};F.mQa=function $R(a){var c=mba(a);if(this.Nb()>c)return k;if(!(a instanceof cg)&&c>5)a=new cg(a);return oba(this,function(d){return nba(a,d)})};F.mG=function $S(){return this.yd.mG(k)};var Sba={};Tba[w].Gdb=function $T(a,c){var d=this;c&&Mba(15);return function(){try{return a[cd](this,arguments)}catch(f){d.rOb(f);e(f)}finally{}}};H(Xba,Tba);var wea="__hooked_";Xba[w].Gdb=function $U(a,c){var d=wea+ +bf(this)+ng;a[d]||(a[d]=Yba(this,a));a=a[d];if(this.oBc)return a;return Xba.C.Gdb[z](this,a,c)};Zba[w].wc=function $V(){this.Dla=[]};var tg=new Zba;var Pi,xea,yea,zea,Aea,Qi,Ri,Si;Aea=zea=yea=xea=Pi=k;var Bea,Cea="Mobile";if(Bea=ug()){var Dea=aca();Pi=Bea[Db]("Opera")==0;xea=!Pi&&Bea[Db]("MSIE")!=-1;zea=(yea=!Pi&&Bea[Db]("WebKit")!=-1)&&Bea[Db](Cea)!=-1;Aea=!Pi&&!yea&&Dea.product=="Gecko"}var Ng=Pi,L=xea,Fh=Aea,Jg=yea,mca=zea,Eea=aca(),Ti=Eea&&Eea.platform||I;Qi=Xf(Ti,"Mac");Ri=Xf(Ti,"Win");Si=Xf(Ti,"Linux");var Fea=!!aca()&&Xf(aca().appVersion||I,"X11"),Gea=I,Hea;
+if(Ng&&Je.opera){var Iea=Je.opera[Za];Gea=typeof Iea==Se?Iea():Iea}else{if(Fh)Hea=/rv\:([^\);]+)(\)|;)/;else if(L)Hea=/MSIE\s+([^\);]+)(\)|;)/;else if(Jg)Hea=/WebKit\/(\S+)/;if(Hea){var Jea=Hea[hb](ug());Gea=Jea?Jea[1]:I}}var wg=Gea,bca={};xg[w].vc=function $W(){return new xg(this.x,this.y)};F=yg[w];F.vc=function $X(){return new yg(this[ib],this[id])};F.ktc=function $Y(){return this[ib]*this[id]};F.x3a=function $Z(){return this[ib]/this[id]};F.nd=function $_(){return!this.ktc()};F.ceil=function $0(){ka(this,l[ob](this[ib]));Wa(this,l[ob](this[id]));return this};F.floor=function $1(){ka(this,l[rb](this[ib]));Wa(this,l[rb](this[id]));return this};F.round=function $2(){ka(this,l[kb](this[ib]));Wa(this,l[kb](this[id]));return this};F.scale=function $3(a){this.width*=a;this.height*=a;return this};_B_prog(5)}catch(e){_B_err(e)}
+
+try{var eca;var Ui="height",Vi="width",Wi="type",jca={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",height:Ui,width:Vi,usemap:"useMap",frameborder:"frameBorder",type:Wi},zca={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},Aca={IMG:J,BR:ch};F=Dg[w];F.W=Cg;var Kea="ki";F.cb=D(Kea);F.b=function $5(a){return Ye(a)?this.ki[ub](a):a};F.Qa=Dg[w].b;F.ie=function $6(a,c,d){return fca(this.ki,a,c,d)};F.Gkc=Dg[w].ie;F.nCa=Lg;F.UO=function $7(a){return Mg(a||this.Ec())};
+F.ba=function $8(){return pca(this.ki,arguments)};F.NR=Dg[w].ba;F.createElement=function $9(a){return this.ki[Qb](a)};F.createTextNode=function $$(a){return this.ki[yb](a)};F.Ec=function $aa(){return this.ki[ac]||this.ki[dc]};daa(F,Og);F.ZA=Pg;F.yA=Qg;F.xA=Rg;qaa(F,Sg);F.oac=Ug;F.sbb=Vg;F.Bp=Wg;F.LT=Yg;F.b_=tca;F.mjb=qca;Sa(F,Zg);F.Fp=Eg;F.TQ=ah;F.iEc=bh;F.hbb=wca;F.neb=dh;F.zFc=fh;F.yFc=gh;var Lea="L2.NativeHelper";Bca[w].sPa=function $ba(){if(L)try{var a=new ActiveXObject(Lea);if(a.gcTracer){a.gcTracer.installGcTracing();this.LZ=a.gcTracer}}catch(c){}};Qa(Bca[w],function $ca(){if(this.LZ){this.LZ.isTracing()&&this.LZ.endGcTracing();this.LZ.startGcTracing()}});Ga(Bca[w],function $da(){if(this.LZ&&this.LZ.isTracing()){var a=this.LZ;this.LZ.endGcTracing();for(var c=a.getNumTraces(),d=0,f=0;f<c;f++){var g=a.getTrace(f).gcElapsedTime;l[kb](g*10)/10;d+=g}}});var Mea=new Bca;H(N,Jf);F=N[w];F.L=function $ea(){delete this[Zb];delete this[y];delete this[Hb]};F.sQ=k;F.t1=h;F.stopPropagation=function $fa(){this.sQ=h};F.preventDefault=function $ga(){this.t1=k};H(hh,N);F=hh[w];Pa(F,i);F.relatedTarget=i;F.offsetX=0;F.offsetY=0;Da(F,0);Ea(F,0);faa(F,0);gaa(F,0);eaa(F,0);xa(F,0);haa(F,0);F.ctrlKey=k;F.altKey=k;F.shiftKey=k;F.metaKey=k;F.pj=i;var Xi="mouseover",Yi="mouseout",Zi="keypress";
+F.wc=function $ha(a,c){var d=za(this,a[Zb]);Pa(this,a[y]||a[saa]);sa(this,c);if(c=a[eb]){if(Fh)try{c=c[Gb]&&c}catch(f){c=i}}else if(d==Xi)c=a.fromElement;else if(d==Yi)c=a.toElement;this.relatedTarget=c;this.offsetX=a.offsetX!==undefined?a.offsetX:a.layerX;this.offsetY=a.offsetY!==undefined?a.offsetY:a.layerY;Da(this,a[kc]!==undefined?a[kc]:a.pageX);Ea(this,a[lc]!==undefined?a[lc]:a.pageY);faa(this,a[Ib]||0);gaa(this,a[Jb]||0);eaa(this,a[Cb]);xa(this,a[Sb]||0);haa(this,a[Ob]||(d==Zi?a[Sb]:0));this.ctrlKey=
+a[Bc];this.altKey=a[rc];this.shiftKey=a[dd];this.metaKey=a[Eb];this.pj=a;delete this.t1;delete this.sQ};F.stopPropagation=function $ia(){this.sQ=h;if(this.pj[Ec])this.pj[Ec]();else this.pj.cancelBubble=h};var aj="8",Nea=L&&!vg(aj);hh[w].preventDefault=function $ja(){this.t1=k;var a=this.pj;if(a[zb])a[zb]();else{paa(a,k);if(Nea)try{if(a[Bc]||a[Sb]>=112&&a[Sb]<=123)xa(a,-1)}catch(c){}}};var Oea="pj";hh[w].DFc=D(Oea);
+hh[w].L=function $la(){hh.C.L[z](this);this.pj=i;Pa(this,i);sa(this,i);this.relatedTarget=i};var bj;var Pea=(bj="ScriptEngine"in Je&&Je.ScriptEngine()=="JScript")?Je.ScriptEngineMajorVersion()+He+Je.ScriptEngineMinorVersion()+He+Je.ScriptEngineBuildVersion():Ah;var Qea=0;F=Cca[w];F.key=0;F.rla=k;F.e5a=k;F.wc=function $ma(a,c,d,f,g,j){if(Ze(a))this.HXb=h;else if(a&&a[Xb]&&Ze(a[Xb]))this.HXb=k;else e(Error(".9"));this.GA=a;this.qf=c;this.src=d;za(this,f);this.capture=!!g;this.Si=j;this.e5a=k;this.key=++Qea;this.rla=k};ya(F,function $na(a){if(this.HXb)return this.GA[z](this.Si||this.src,a);return this.GA[Xb][z](this.GA,a)});var Dca,Nca,Eca,Mca,Fca,Rea,Kca,Gca,Lca,Rca,Sca,Sea="5.7";
+(function(){function b(){return{Cf:0,SL:0}}function a(){return[]}function c(){function Y(ha){return j[z](Y.src,Y.key,ha)}return Y}function d(){return new Cca}function f(){return new hh}var g=bj&&!(bg(Pea,Sea)>=0),j;Rea=function $oa(ha){j=ha};if(g){Dca=function $pa(){return n.Iw()};Nca=function $qa(ha){n.ez(ha)};Eca=function $ra(){return s.Iw()};Mca=function $sa(ha){s.ez(ha)};Fca=function $ta(){return v.Iw()};Kca=function $ua(){v.ez(c())};Gca=function $va(){return C.Iw()};Lca=function $wa(ha){C.ez(ha)};
+Rca=function $xa(){return M.Iw()};Sca=function $ya(ha){M.ez(ha)};var n=new Lf(0,600);n.r4=b;var s=new Lf(0,600);s.r4=a;var v=new Lf(0,600);v.r4=c;var C=new Lf(0,600);C.r4=d;var M=new Lf(0,600);M.r4=f}else{Dca=b;Nca=Me;Eca=a;Mca=Me;Fca=c;Kca=Me;Gca=d;Lca=Me;Rca=f;Sca=Me}})();var kh={},jh={},lh={},Oca={},cj="focusin",Tea=L?cj:"DOMFocusIn",dj="focusout",Uea=L?dj:"DOMFocusOut",P="click",ej="dblclick",fj="mousedown",gj="mouseup",hj="mousemove",Vea="selectstart",ij="keydown",jj="keyup",kj="blur",lj="focus",Wea="deactivate",mj="change",nj="select",oj="submit",pj="contextmenu",qj="dragstart",Xea="hashchange",rj="load",Yea="losecapture",sj="resize",tj="scroll",uj="unload",Zea={Vsd:P,ltd:ej,fwd:fj,jwd:gj,iwd:Xi,hwd:Yi,gwd:hj,eyd:Vea,yvd:Zi,xvd:ij,zvd:jj,slc:kj,anc:lj,ntd:Wea,
+gud:Tea,hud:Uea,Dlc:mj,tpc:nj,Pyd:oj,ftd:pj,Atd:qj,yDb:Kh,Iud:Xea,pnc:"help",E1a:rj,Nvd:Yea,rxd:Lh,Uxd:sj,Zxd:tj,Aqc:uj};Rea(th);H(uh,Jf);F=uh[w];F.f8a=h;F.Drb=i;F.rv=D("Drb");F.dk=Ge("Drb");F.addEventListener=function $Ba(a,c,d,f){ih(this,a,c,d,f)};F.removeEventListener=function $Ca(a,c,d,f){nh(this,a,c,d,f)};ra(F,function $Da(a){return sh(this,a)});F.L=function $Ea(){uh.C.L[z](this);ph(this);this.Drb=i};Tca[w].Xs=function $Fa(a){var c=[];this.Haa(a,c);return c[kd](I)};var vj="[",wj=",",afa="{",xj=":",bfa="}";
+Tca[w].Haa=function $Ga(a,c){switch(typeof a){case Xe:Xca(this,a,c);break;case Qe:c[p](baa(a)&&!ia(a)?a:gba);break;case ig:c[p](a);break;case "undefined":c[p](gba);break;case Oe:if(a==i){c[p](gba);break}if(Ve(a)){var d=a[u];c[p](vj);for(var f=I,g=0;g<d;g++){c[p](f);this.Haa(a[g],c);f=wj}c[p](wh);break}c[p](afa);d=I;for(f in a)if(a[Kc](f)){g=a[f];if(typeof g!=Se){c[p](d);Xca(this,f,c);c[p](xj);this.Haa(g,c);d=wj}}c[p](bfa);break;case Se:break;default:e(Error(".12`"+typeof a))}};
+var cfa="\\n",Zca={'"':'\\"',"\\":"\\\\","/":"\\/","\u0008":"\\b","\u000c":"\\f","\n":cfa,"\r":"\\r","\t":"\\t","\u000b":"\\u000b"},Yca=/\uffff/[cb]("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;H(Bh,uh);Ra(Bh[w],k);var Ch=Je.window;F=Bh[w];F.ab=i;F.setInterval=function $Ha(a){this.Ly=a;if(this.ab&&this[Vc]){this[qc]();this[Rc]()}else this.ab&&this[qc]()};F.Pnd=function $Ia(){if(this[Vc]){var a=Zf()-this.Oia;if(a>0&&a<this.Ly*0.8)this.ab=this.UDa[xc](this.E4a,this.Ly-a);else{this.e9a();if(this[Vc]){this.ab=this.UDa[xc](this.E4a,this.Ly);this.Oia=Zf()}}}};var yj="tick";F.e9a=function $Ja(){this[r](yj)};
+Qa(F,function $Ka(){Ra(this,h);if(!this.ab){this.ab=this.UDa[xc](this.E4a,this.Ly);this.Oia=Zf()}});Ga(F,function $La(){Ra(this,k);if(this.ab){this.UDa[gb](this.ab);this.ab=i}});F.L=function $Ma(){Bh.C.L[z](this);this[qc]();delete this.UDa};ada[w].Lf=Fh;ada[w].Ac=function $Na(a){this.Lf=Fh&&a};var Nh=new ada;var hda=i,dfa=i,efa=i;hda=function $Oa(){var a=mda();return a?new ActiveXObject(a):new XMLHttpRequest};dfa=function $Pa(){var a={};if(mda()){a[0]=h;a[1]=h}return a};efa=i;var nda=i;H(Gh,uh);var oda=[];F=Gh[w];F.ng=k;F.ob=i;F.Z0a=i;F.c8=I;F.zRc=I;F.eo=0;F.wk=I;F.vab=k;F.XOa=k;F.Hhb=k;F.s7=k;F.lX=0;F.hD=i;F.X1=function $Qa(a){this.lX=l.max(0,a)};var zj="GET",Aj="POST",Bj="Content-Type",ffa="application/x-www-form-urlencoded;charset=utf-8";
+ua(F,function $Ra(a,c,d,f){if(this.ng)e(Error(".14"));c=c||zj;this.c8=a;this.wk=I;this.eo=0;this.zRc=c;this.vab=k;this.ng=h;this.ob=new gda;this.Z0a=efa||(efa=dfa());eda(Nh,this.ob);ja(this.ob,G(this.Y5b,this));try{this.Hhb=h;this.ob[bb](c,a,h);this.Hhb=k}catch(g){this.wq(5,g);return}a=d||I;var j=this.headers.vc();f&&Ef(f,function(s,v){j.set(v,s)});c==Aj&&!j.Xb(Bj)&&j.set(Bj,ffa);Ef(j,function(s,v){this.ob.setRequestHeader(v,s)},this);try{if(this.hD){Ch[gb](this.hD);this.hD=i}if(this.lX>0)this.hD=
+Ch[xc](G(this.wo,this),this.lX);this.XOa=h;this.ob[Mb](a);this.XOa=k}catch(n){this.wq(5,n)}});ra(F,function $Sa(a){if(this.ob){bda(Nh,this.ob);try{return Gh.C[r][z](this,a)}finally{cda(Nh)}}else return Gh.C[r][z](this,a)});var gfa="Timed out after ",hfa="ms, aborting",Cj="timeout";F.wo=function $Ta(){if(typeof uda!="undefined")if(this.ob){this.wk=gfa+this.lX+hfa;this.eo=8;this[r](Cj);this[wc](8)}};
+F.wq=function $Ua(a,c){this.ng=k;if(this.ob){this.s7=h;this.ob[wc]();this.s7=k}this.wk=c;this.eo=a;rda(this);vda(this)};var Dj="abort";La(F,function $Va(a){if(this.ob){this.ng=k;this.s7=h;this.ob[wc]();this.s7=k;this.eo=a||7;this[r](Hh);this[r](Dj);vda(this)}});F.L=function $Wa(){if(this.ob){if(this.ng){this.ng=k;this.s7=h;this.ob[wc]();this.s7=k}vda(this,h)}Gh.C.L[z](this)};F.Y5b=function $Xa(){!this.Hhb&&!this.XOa&&!this.s7?this.oqb():tda(this)};F.oqb=function $Ya(){tda(this)};var Ej="ng";
+F.Eb=D(Ej);F.jm=function $_a(){return this.ts()==4};F.ye=function $0a(){switch(this.hf()){case 0:case 200:case 204:case 304:return h;default:return k}};F.ts=function $1a(){return this.ob?this.ob[Nb]:0};F.hf=function $2a(){try{return this.ts()>2?this.ob[Lb]:-1}catch(a){return-1}};F.zRb=function $3a(){return String(this.c8)};F.dj=function $4a(){return this.ob?this.ob.responseText:I};F.Mdb=function $5a(){return this.ob?yh(this.ob.responseText):undefined};
+F.Kga=function $6a(){return Ye(this.wk)?this.wk:String(this.wk)};_B_prog(6)}catch(e){_B_err(e)}
+
+try{var Fj="value";Oh[w].J=D(Fj);Oh[w].Ga=D(Wi);Oh[w].set=Ge(Fj);H(Qh,Oh);Qh[w].J=D(Fj);var Gj="off",Hj="1";Qh[w].Hwb=function $ab(a){var c=this[uaa];if(a==Ah||a==Gj||a==kg)c=k;else if(a==Hj||a==qh||a==jg)c=h;pa(this,c)};var Ij="7",ifa=new Qh(function(){if(L&&!vg(Ij)){var b=Number(ba.ScriptEngineMajorVersion()+He+ba.ScriptEngineMinorVersion());return!(b>=5.7||b==5.6&&ba.ScriptEngineBuildVersion()>=8834)}return k}());var jfa=new Qh(k),kfa=new Qh(k),lfa=new Qh(h),mfa=new Qh(h);H(Rh,Error);Ba(Rh[w],"CustomError");var Vh=/^(?:([^:\/?#]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/?#:@]*)(?::([0-9]+))?)?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;F=Sh[w];F.ul=I;F.DX=I;F.Gt=I;F.UA=i;F.Vf=I;F.N5=I;F.xia=k;F.hP=k;var Jj="//",Kj="?",Lj="#";Ha(F,function $bb(){if(this.DG)return this.DG;var a=[];this.ul&&a[p](xda(this.ul,nfa),xj);if(this.Gt){a[p](Jj);this.DX&&a[p](xda(this.DX,nfa),vh);var c;c=this.Gt;c=Ye(c)?aa(c):i;a[p](c);this.UA!=i&&a[p](xj,String(this.UA))}this.Vf&&a[p](xda(this.Vf,ofa));(c=String(this.Vs))&&a[p](Kj,c);this.N5&&a[p](Lj,xda(this.N5,pfa));return this.DG=a[kd](I)});
+F.vc=function $cb(){return ci(this.ul,this.DX,this.Gt,this.UA,this.Vf,this.Vs.vc(),this.N5,this.hP)};F.Pr=function $db(a,c){Xh(this);delete this.DG;if(this.ul=c?Yh(a):a)this.ul=this.ul[mb](/:$/,I);return this};var qfa="Gt";F.Jk=D(qfa);F.iB=function $fb(a,c){Xh(this);delete this.DG;this.Gt=c?Yh(a):a;return this};F.u_=function $gb(){return!!this.Gt};F.Or=function $hb(a,c){Xh(this);delete this.DG;this.Vf=c?Yh(a):a;return this};
+F.Jx=function $ib(a,c){Xh(this);delete this.DG;if(a instanceof Wh){this.Vs=a;this.Vs.Bf=this;this.Vs.hma(this.hP)}else{c||(a=xda(a,rfa));this.Vs=new Wh(a,this,this.hP)}return this};F.uo=function $jb(a,c){return this.Jx(a,c)};F.Of=D("Vs");F.Qe=function $lb(){return this.Vs[t]()};F.ka=function $mb(a,c){Xh(this);delete this.DG;this.Vs.set(a,c);return this};var sfa="N5";F.td=D(sfa);F.bub=function $ob(a){Xh(this);this.Vs[Pb](a);return this};F.cQa=D("xia");F.hma=function $qb(a){this.hP=a;this.Vs&&this.Vs.hma(a)};
+var yda=/^[a-zA-Z0-9\-_.!~*'():\/;?]*$/,nfa=/[#\/\?@]/g,ofa=/[\#\?]/g,rfa=/[\#\?@]/g,pfa=/#/g;F=Wh[w];F.km=i;F.Cf=i;F.Nb=function $rb(){fi(this);return this.Cf};F.add=function $sb(a,c){fi(this);hi(this);a=gi(this,a);if(this.Xb(a)){var d=this.km.J(a);Ve(d)?d[p](c):this.km.set(a,[d,c])}else this.km.set(a,c);this.Cf++;return this};wa(F,function $tb(a){fi(this);a=gi(this,a);if(this.km.Xb(a)){hi(this);var c=this.km.J(a);if(Ve(c))this.Cf-=c[u];else this.Cf--;return this.km[Pb](a)}return k});
+Aa(F,function $ub(){hi(this);this.km&&this.km[bc]();this.Cf=0});F.nd=function $vb(){fi(this);return this.Cf==0};F.Xb=function $wb(a){fi(this);a=gi(this,a);return this.km.Xb(a)};F.BS=function $xb(a){var c=this.Oa();return ef(c,a)};F.Sb=function $yb(){fi(this);for(var a=this.km.Oa(),c=this.km.Sb(),d=[],f=0;f<c[u];f++){var g=a[f];if(Ve(g))for(var j=0;j<g[u];j++)d[p](c[f]);else d[p](c[f])}return d};
+F.Oa=function $zb(a){fi(this);if(a){a=gi(this,a);if(this.Xb(a)){var c=this.km.J(a);if(Ve(c))return c;else{a=[];a[p](c)}}else a=[]}else{c=this.km.Oa();a=[];for(var d=0;d<c[u];d++){var f=c[d];Ve(f)?of(a,f):a[p](f)}}return a};F.set=function $Ab(a,c){fi(this);hi(this);a=gi(this,a);if(this.Xb(a)){var d=this.km.J(a);if(Ve(d))this.Cf-=d[u];else this.Cf--}this.km.set(a,c);this.Cf++;return this};F.J=function $Bb(a,c){fi(this);a=gi(this,a);if(this.Xb(a)){a=this.km.J(a);return Ve(a)?a[0]:a}else return c};
+Ha(F,function $Cb(){if(this.mT)return this.mT;if(!this.km)return I;for(var a=[],c=0,d=this.km.Sb(),f=0;f<d[u];f++){var g=d[f],j=Qf(g);g=this.km.J(g);if(Ve(g))for(var n=0;n<g[u];n++){c>0&&a[p](Sf);a[p](j,ei,Qf(g[n]));c++}else{c>0&&a[p](Sf);a[p](j,ei,Qf(g));c++}}return this.mT=a[kd](I)});F.vc=function $Db(){var a=new Wh;if(this.Cea)a.Cea=this.Cea;if(this.mT)a.mT=this.mT;if(this.km)a.km=this.km.vc();return a};
+F.hma=function $Eb(a){if(a&&!this.hP){fi(this);hi(this);Ef(this.km,function(c,d){var f=d[od]();if(d!=f){this[Pb](d);this.add(f,c)}},this)}this.hP=a};F.extend=function $Fb(){for(var a=0;a<arguments[u];a++)Ef(arguments[a],function(c,d){this.add(d,c)},this)};H(ji,Oh);ji[w].J=D(Fj);ji[w].Hwb=function $Hb(a){var c=this[uaa];if(a){a=da(a,10);c=ia(a)?this[uaa]:a}pa(this,c)};H(Bda,Oh);Bda[w].J=D(Fj);Bda[w].Hwb=Ge(Fj);var tfa=new Qh(h),ufa=new Qh(h),vfa=new Qh(h),wfa=new Qh(k),xfa=new Qh(k),yfa=new Qh(h),zfa=new Bda(I),Afa=new Qh(k),Bfa=new Qh(k),Cfa=new Qh(h),Dfa=new Qh(h),Efa=new Qh(k),Ffa=new Qh(k),Gfa=new ji(3),Hfa=new ji(0),Ifa=new ji(1E3),Jfa=new Qh(k),Kfa=new Qh(k),Lfa=new Qh(h),Mfa=new Qh(h),Nfa=new Qh(h),Ofa=new ji(0),Pfa=new Qh(k),Qfa=new Qh(k),Rfa=new Qh(k),Sfa=new Qh(h),Tfa=new Qh(k);var Ufa=Yf(),Vfa=Ufa[nc](0,4);var Mj=new Sh(top[Ic]),Nj="tf",Wfa="labs",Oj="ui",Pj="2",Xfa=function(b,a){fi(b);Ef(b.km,function(c,d){ef(a,d)||this[Pb](d)},b);return b}(Mj.Of().vc(),[Nj,Wfa]).set(Oj,Pj),Yfa="ik",Zfa=Xfa.vc().set(Yfa,Gi),Qj=Kj+String(Zfa),aga=new Sh;aga.Jx(Xfa);aga.xia=h;var Rj=new Sh;Rj.Jx(Zfa);Rj.xia=h;var bga=String(Uh((new Sh(Mj)).Jx(Zfa),I)),Sj=Uh(Mj.vc(),I);Sj.xia=h;var cga=Sj.vc().Jx(i);cga.xia=h;_B_prog(7)}catch(e){_B_err(e)}
+
+try{lfa.set(k);mfa.set(k);var dga=new function(){this.C5={}};(function(b,a){uf(a,function(c,d){this.C5[d]=c},b)})(dga,{pre:tfa,mincaching:ifa,chat:ufa,frills:vfa,evt:wfa,dom:xfa,preload_compose:yfa,tracers:zfa,lo:jfa,forced_reflows:kfa,dml:Afa,verbose:Bfa,ep:Cfa,ads:Dfa,trace_timers:Efa,noif:Ffa,tth:Gfa,icc:Hfa,icm:Ifa,gdts:Jfa,gddh:Kfa,labs:Lfa,ie6_forced_reflows:Mfa,gd:Nfa,navw:Ofa,disable_flash_upload:Pfa,uwd:Qfa,al1:lfa,al2:mfa,h5dnd:Rfa,winac:Sfa,br:Tfa});
+(function(b,a){uf(b.C5,function(c,d){d=a.J(d);Ke(d)&&c.Hwb(d)},b)})(dga,Mj.Of());var ega=tfa.J(),fga=ifa.J(),gga=ufa.J()&&vfa.J(),hga=wfa.J(),iga=xfa.J(),jga=yfa.J();jfa.J();kfa.J();var kga=Afa.J();Bfa.J();var lga=Cfa.J(),mga=Ffa.J();Gfa.J();var nga=Hfa.J(),oga=Ifa.J(),pga=!Lfa.J(),qga=Mfa.J(),rga=Kfa.J(),sga=Ofa.J(),tga=Pfa.J(),uga=Qfa.J();Rfa.J();var vga=lga&&Efa.J(),wga=zfa.J();if(wga)for(var xga=wga[Cc](wj),yga=0;yga<xga[u];yga++);var Fda=ih;if(hga)ih=Eda;tg.wc();var _DumpException=sg;oa(Je,i);Eba(sg);var zga=new Xba(sg,!lga);_B_handleError=function $Kb(a){sg(a)};Vba(zga,vga);Wba(zga,vga);th=og(zga,th,vga);Rea(th);qda(zga,vga);var Tj="6",Aga="BackgroundImageCache";if(L){Mea.sPa();if(vg(Tj))try{ea[Yb](Aga,k,h)}catch(Bga){}};var Jda=/\s*;\s*/;var Cga="GMAIL_FB",Dga="GMAIL_BG",Ega="GMAIL_DC",Fga="GMAIL_IFTO",Gga="GMAIL_BAK",Hga="GMAIL_IE",Iga="GMAIL_SSLF",Jga="GMAIL_GM",Lda=new Hf(Cga,1,Dga,2,Ega,8,Fga,16,Gga,32,Hga,64,Iga,128,Jga,256),qi=da(mi(Kda,Ah),16),Uj="GMAIL_STAT_"+l[rb](l[Tc]()*1E4);H(Nda,Jf);Nda[w].vib=function $Lb(a){var c=this.pDa[u];this.pDa[c]=a;for(var d=0;d<this.eE[u];d++){var f=Vj(a,this.eE[d]);this.dna[d][c]=f}return c};Nda[w].D=function $Mb(){this.dna=this.eE=i;Nda.C.D[z](this)};var Wj=new Nda;H(Qda,Jf);Qda[w].qa=0;var Xj=new Qda;F=Qda[w];na(F,function $Nb(a,c){this.ob&&this.ob.Eb()&&this.ob[wc]();if(!this.ob)this.ob=new Gh;this.qS=c;ih(this.ob,Hh,this.b7,k,this);this.qa=1;this.ob[Mb](a,zj)});
+F.b7=function $Ob(){nh(this.ob,Hh,this.b7,k,this);var a;_B_record();if(this.ob.hf()==400){if(!this.x4&&!ri(Iga)){this.qa=2;oi(Iga);Kga(top[Ic][raa]);this.ob.D();this.ob=i;return}}else Mda(Iga);if(this.ob.ye()){try{a=eval(this.ob.dj())}catch(c){this.qa=3}if(a&&Te(a)==Re){a=a;if(this.Iq(a)){var d=a[1];if(Te(d)!=Re)d=[0,d];a[1]=d;d=d[0];if(d==0||d>=1&&d<=2){this.x4=a[0];this.dKa=a[1];this.Sf=a[2];if(!this.Sf)this.qa=5;if(Ke(this.ogc)){a=this.ogc;d=this.dKa[1];for(var f=0;f<Wj.eE[u];f++)Lga(Wj.dna[f][a],
+d);Wj.pDa[a]=d}else this.ogc=Wj.vib(this.dKa[1]);delete this.dKa[1];if(this.qa!=5)this.qa=6;if(this.qS){a=this.qS;this.qS=i;a()}if(this.qa!=5)this.qa=7}else this.qa=8}else this.qa=4}else if(this.qa!=3)this.qa=9}else this.qa=2;this.ob.D();this.ob=i};F.Iq=function $Pb(a){return!!a[0]};F.D=function $Qb(){this.ob&&this.ob.D();Qda.C.D[z](this)};F.il=D("Sf");var Yj="qa";F.xc=D(Yj);var Mga=Pda("_GM_getSSUrl",top,h)||jea;Xj[pb](Mga);/*
+ Portions of this code are from MochiKit, received by
+ Google under the MIT license. All other code is Copyright 2005-2009 Google,
+ Inc. All Rights Reserved.
+*/
+F=ui[w];F.wE=-1;F.IV=0;F.zyb=k;F.lwc=k;F.tf=function $Tb(){if(this.wE>=0)!this.wE&&this.eh[0]instanceof ui&&this.eh[0].tf();else{if(this.LIb)this.LIb[z](this.kMb,this);else this.zyb=h;this.wE>=0||this.mE(new wi(this))}};F.Mrb=function $Ub(){this.IV++};F.YAb=function $Vb(){this.IV--;this.IV==0&&this.wE>=0&&Sda(this)};F.Tyc=function $Wb(a){Rda(this,a);this.YAb()};F.rJ=function $Xb(){if(this.wE>=0){if(!this.zyb)e(new Tda(this));this.zyb=k}};F.ad=function $Yb(a){this.rJ();Rda(this,a)};
+F.mE=function $Zb(a){this.rJ();Rda(this,a instanceof Error?a:Error(a))};H(Tda,Rh);Oa(Tda[w],"Already called");H(wi,Rh);Oa(wi[w],"Deferred was cancelled");H(xi,Jf);xi[w].tb=B();H(Uda,Jf);F=Uda[w];F.mmb=xi;F.HC=i;F.ym=function $0b(a){if(this.mmb===xi)this.mmb=a;else e(Error(".21"))};F.Lr=function $1b(a,c){return this.kW(this.irb,a,c)};F.kW=function $2b(a,c,d){c=new Wda(c,d);a[p](c);return c};F.hc=function $3b(){return!!this.HC};F.CTa=function $4b(a){var c=new this.mmb;c.tb(a());this.HC=c;Vda(this,this.G9a,a());Vda(this,this.irb,a());Ia(this.eza,0)};F.dza=function $5b(a){Vda(this,this.eza,a);Ia(this.G9a,0);Ia(this.irb,0)};F.L=function $6b(){Uda.C.L[z](this);this.HC&&this.HC.D()};
+Va(Wda[w],function $7b(a){if(this.SLa){this.SLa[z](this.na||i,a);this.SLa=this.na=i}});La(Wda[w],function $8b(){this.na=this.SLa=i});H(O,Jf);Ne(O);F=O[w];F.uHa=k;F.Bxa=i;F.CSc=i;F.H6a=0;F.TYb=k;F.mjc=k;F.Zxa=i;F.iGc=D("Zxa");F.Eb=function $$b(){return this.eF[u]>0};F.xSc=function $ac(a,c){var d=this.bk[a];if(d.hc())c.ad(this.Zxa);else{d.Lr(c.ad,c);d.kW(d.eza,c.mE,c);ef(this.eF,a)||ef(this.rI,a)||aea(this,a)}};F.gb=function $bc(a){jf(this.U2,a);jf(this.eF,a);this.bk[a].CTa(G(this.iGc,this));this.eF[u]==0&&eea(this);Ai(this)};
+na(F,function $cc(a,c){var d=this.bk[a],f=new ui;if(d.hc())f.ad(this.Zxa);else if(ef(this.eF,a)||ef(this.rI,a)){d.Lr(f.ad,f);d.kW(d.eza,f.mE,f);if(c){this.U2[p](a);Ai(this)}}else{d.Lr(f.ad,f);d.kW(d.eza,f.mE,f);c&&this.U2[p](a);aea(this,a)}return f});F.ym=function $dc(a){this.vea&&this.bk[this.vea].ym(a)};
+F.hJc=function $ec(a){this.H6a++;if(a==401){dea(this,0);Ia(this.rI,0)}else if(a==410){dea(this,3);eea(this)}else if(this.H6a>=3){dea(this,1);eea(this)}else{var c=this.eF.pop();Ia(this.eF,0);bea(this,c,h,a==8001)}};F.jJc=function $fc(){dea(this,2);eea(this)};F.Lr=function $gc(a,c){Ve(a)||(a=[a]);for(var d=0;d<a[u];d++)this.kW(a[d],c)};F.kW=function $hc(a,c){var d=this.gIa;d[a]||(d[a]=[]);d[a][p](c)};F.L=function $ic(){O.C.L[z](this);Ff(wf(this.bk),Kf);this.gIa=this.rI=this.U2=this.eF=this.bk=i};for(var Nga={},Oga=0;Oga<rea[u];Oga+=2)Nga[rea[Oga]]=rea[Oga+1];var Pga=O.S();for(var Qga in Nga)Pga.bk[Qga]=new Uda(Nga[Qga]);var Zj="bg";Bi(O.S(),Zj);O.S().gb(Zj);Ci(O.S(),Zj);var ak=parseFloat;function aha(b,a){return b.filter=a}function bha(b,a){return b.page=a}function bk(b,a){return b.collapse=a}function Q(b,a){return b.innerHTML=a}function cha(b,a){return b.insertNode=a}function ck(b,a){return b.left=a}function dk(b,a){return b.select=a}function ek(b,a){return b.detach=a}function fk(b,a){return b.tabIndex=a}function gk(b,a){return b.cellPadding=a}function hk(b,a){return b.setActive=a}function ik(b,a){return b.title=a}function dha(b,a){return b.opacity=a}
+function jk(b,a){return b.disabled=a}function kk(b,a){return b.hideFocus=a}function lk(b,a){return b.removeChild=a}function mk(b,a){return b.removeItem=a}function nk(b,a){return b.bottom=a}function eha(b,a){return b.cellSpacing=a}function ok(b,a){return b.element=a}function pk(b,a){return b.nodeValue=a}function qk(b,a){return b.right=a}
+var rk="activeElement",fha="getBoundingClientRect",sk="form",tk="collapse",uk="selection",vk="inRange",gha="createCaption",wk="innerHTML",xk="offsetWidth",yk="blur",zk="insertNode",Ak="move",Bk="createRange",Ck="left",Dk="createTextRange",hha="getBoxObjectFor",Ek="focus",Fk="select",iha="clientLeft",jha="sqrt",kha="clientTop",Gk="cloneNode",Hk="setEndPoint",Ik="detach",lha="tabIndex",Jk="rangeCount",Kk="frameElement",Lk="setActive",Mk="duplicate",Nk="scrollTop",Ok="setStart",Pk="title",Qk="getSelection",
+Rk="next",mha="offsetParent",Sk="constructor",Tk="moveToElementText",Uk="disabled",Vk="offsetLeft",Wk="getComputedStyle",Xk="close",nha="hasChildNodes",Yk="removeItem",al="moveEnd",bl="scrollWidth",cl="cells",dl="scrollLeft",el="sort",fl="bottom",gl="compareEndPoints",hl="containsNode",il="currentStyle",jl="restore",kl="rows",ll="element",oha="contentDocument",ml="removeAttribute",nl="display",R="append",ol="offsetTop",pl="toUpperCase",ql="offsetHeight",rl="right",sl="<br>",tl="+",ul="cf",vl="as",
+wl='"><div class="',pha="loading",xl=" (",yl='"><div id="',S='" class="',zl="character",Al="StartToStart",Bl="|",Cl="BR",qha="STYLE",Dl="SCRIPT",El='"><tr><td class="',Fl='<table cellpadding="0" class="',Gl='" id="',Hl="label",Il="text",Jl=": ",rha="An",Kl='">&nbsp;</td><td class="',Ll="\n\n",Ml="<br><br>",Nl="li",sha="ul",tha="pZ",uha="iE",Ol="bold",Pl="italic",vha="Change picture",Ql="Db",Rl='"><input type="checkbox" id="',wha="Kg",Sl="ni",xha="photo",yha="r0",zha="OBJECT",Aha="Oi",Bha="Start",
+Cha="End",Dha="To",Tl="ie",Eha='">&nbsp;',Ul='" height="',Fha="att",Gha="hd",Vl="<tr><td>",Hha="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;",Wl=" and ",Iha="+1",Xl="mainElement",Yl="<li>",Jha="</li>",Zl="</ul>",am="100%",Kha="live",Lha="br",bm="goomoji",cm="http://",dm='" width="',Mha="valuemin",Nha="valuemax",Oha="valuenow";
+function em(b){if(b instanceof tf)return b;if(typeof b.mG==Se)return b.mG(k);if(We(b)){var a=0,c=new tf;Ma(c,function $mc(){for(;;){if(a>=b[u])e(Ni);if(a in b)return b[a++];else a++}});return c}e(Error(".3"))}function Pha(b){return!Jg&&gca(b)?b[mc]:b[Lc]}function fm(b,a){return b>a?1:b<a?-1:0}function Qha(b,a,c,d){a=a;for(var f=c[u];(a=b[Db](c,a))>=0&&a<d;){var g=b[Xc](a-1);if(g==38||g==63){g=b[Xc](a+f);if(!g||g==61||g==38||g==35)return a}a+=f+1}return-1}
+function gm(b){b=Pha(b.ki);return new xg(b[dl],b[Nk])}function Rha(b){return gca(b.ki)}function hm(b,a,c){c?K(b,a):Ag(b,a)}function im(b){return/^[\s\xa0]*$/[cb](b)}function Sha(b,a){return b===a}function jm(b,a,c){var d=0,f=b[u]-1;for(c=c||fm;d<=f;){var g=d+f>>1,j=c(a,b[g]);if(j>0)d=g+1;else if(j<0)f=g-1;else return g}return-(d+1)}function km(b,a,c){pf(b,c,0,a)}function lm(b,a,c){for(var d=b[u],f=Ye(b)?b[Cc](I):b,g=0;g<d;g++)if(g in f&&a[z](c,f[g],g,b))return g;return-1}
+function mm(b){return typeof b==Qe}function nm(b,a){return L?b[Zb]==P?a==0:!!(b.pj[Cb]&Tha[a]):b.pj[Cb]==a}var Uha="tabIndex";function Vha(b,a){if(a)fk(b,0);else b[ml](Uha)}var Wha="tabindex";function Xha(b){var a=b.getAttributeNode(Wha);if(a&&a.specified){b=b[lha];return mm(b)&&b>=0}return k}function om(b){return Jg?b[yc]||b[gc][yc]:b[oha]||b[gc][yc]}function pm(b){return b?b[ac]||b[dc]:ba}
+function qm(b,a,c){for(var d=zg(b),f=k,g=0;g<d[u];g++)if(d[g]==a){pf(d,g--,1);f=h}if(f){d[p](c);m(b,d[kd](J))}return f}function Yha(b,a){if(b==a)return h;if(!b||!a)return k;return b[ib]==a[ib]&&b[id]==a[id]}function Zha(b,a){return new xg(b.x-a.x,b.y-a.y)}function rm(){return"goog_"+vea++}function sm(){return Array[w][kd][z](arguments,I)}function aia(b){return b[mb](/[\s\xa0]+$/,I)}function bia(b){return b[mb](/^[\s\xa0]+/,I)}function tm(b){var a={};for(var c in b)a[b[c]]=c;return a}
+function cia(b,a,c){if(a in b)return b[a];return c}function dia(b,a){var c;if(c=a in b)delete b[a];return c}function um(b,a,c){if(We(b))try{Ff(b,a,c)}catch(d){if(d!==Ni)e(d)}else{b=em(b);try{for(;;)a[z](c,b[Rk](),undefined,b)}catch(f){if(f!==Ni)e(f)}}}function eia(b,a,c){if(!We(b)||!We(a)||b[u]!=a[u])return k;var d=b[u];c=c||Sha;for(var f=0;f<d;f++)if(!c(b[f],a[f]))return k;return h}function vm(b,a,c){a=lm(b,a,c);return a<0?i:Ye(b)?b[xb](a):b[a]}function wm(b){return b[b[u]-1]}
+function xm(b){this.wa=b;b=L?dj:kj;this.qSc=ih(this.wa,L?cj:lj,this,!L);this.rSc=ih(this.wa,b,this,!L)}var fia="propertychange",ym="TEXTAREA",gia="531",zm="input";function Am(b){this.wa=b;b=L?fia:Jg&&b[ed]==ym&&!vg(gia)?Zi:zm;this.lRa=ih(this.wa,b,this)}function Bm(b,a,c,d){this.top=b;qk(this,a);nk(this,c);ck(this,d)}function hia(b,a){if(b==a)return h;if(!b||!a)return k;return b.top==a.top&&b[rl]==a[rl]&&b[fl]==a[fl]&&b[Ck]==a[Ck]}function Cm(b,a,c,d){ck(this,b);this.top=a;ka(this,c);Wa(this,d)}
+function iia(b){return new Cm(b[Ck],b.top,b[rl]-b[Ck],b[fl]-b.top)}function jia(b,a){if(b==a)return h;if(!b||!a)return k;return b[Ck]==a[Ck]&&b[ib]==a[ib]&&b.top==a.top&&b[id]==a[id]}function Dm(b,a,c){Ye(a)?kia(b,c,a):uf(a,df(kia,b))}function kia(b,a,c){b[x][lia(c)]=a}function Em(b,a){var c=Eg(b);if(c[dc]&&c[dc][Wk])if(b=c[dc][Wk](b,I))return b[a];return i}function Fm(b,a){return b[il]?b[il][a]:i}function Gm(b,a){return Em(b,a)||Fm(b,a)||b[x][a]}var Hm="position";
+function mia(b){return Gm(b,Hm)}var Im="1.9",Jm="px";function Km(b,a,c){var d,f=Fh&&(Qi||Fea)&&vg(Im);if(a instanceof xg){d=a.x;a=a.y}else{d=a;a=c}ck(b[x],typeof d==Qe?(f?l[kb](d):d)+Jm:d);b[x].top=typeof a==Qe?(f?l[kb](a):a)+Jm:a}function Lm(b){b=b?b[nb]==9?b:Eg(b):ea;if(L&&!Rha(Cg(b)))return b[Lc];return b[mc]}function nia(b){var a=b[fha]();if(L){b=b[Mc];a.left-=b[mc][iha]+b[Lc][iha];a.top-=b[mc][kha]+b[Lc][kha]}return a}var oia="fixed",pia="static";
+function qia(b){if(L)return b[mha];var a=Eg(b),c=Gm(b,Hm),d=c==oia||c==sd;for(b=b[A];b&&b!=a;b=b[A]){c=Gm(b,Hm);d=d&&c==pia&&b!=a[mc]&&b!=a[Lc];if(!d&&(b[bl]>b[vc]||b[Rb]>b[Wc]||c==oia||c==sd))return b}return i}var ria="borderLeftWidth",sia="borderRightWidth",tia="borderTopWidth";
+function Mm(b){var a=new Bm(0,Infinity,Infinity,0),c=Cg(b),d=c.cb()[Lc],f=Pha(c.ki),g;for(b=b;b=qia(b);)if((!L||b[vc]!=0)&&(!Jg||b[Wc]!=0||b!=d)&&(b[bl]!=b[vc]||b[Rb]!=b[Wc])&&Gm(b,td)!=ud){var j=Nm(b),n;n=b;if(Fh&&!vg(Im)){var s=ak(Em(n,ria));if(Om(n)){var v=n[xk]-n[vc]-s-ak(Em(n,sia));s+=v}n=new xg(s,ak(Em(n,tia)))}else n=new xg(n[iha],n[kha]);j.x+=n.x;j.y+=n.y;a.top=l.max(a.top,j.y);qk(a,l.min(a[rl],j.x+b[vc]));nk(a,l.min(a[fl],j.y+b[Wc]));ck(a,l.max(a[Ck],j.x));g=g||b!=f}d=f[dl];f=f[Nk];if(Jg){a.left+=
+d;a.top+=f}else{ck(a,l.max(a[Ck],d));a.top=l.max(a.top,f)}if(!g||Jg){a.right+=d;a.bottom+=f}c=c.UO();qk(a,l.min(a[rl],d+c[ib]));nk(a,l.min(a[fl],f+c[id]));return a.top>=0&&a[Ck]>=0&&a[fl]>a.top&&a[rl]>a[Ck]?a:i}
+function Nm(b){var a,c=Eg(b),d=Gm(b,Hm),f=Fh&&c[hha]&&!b[fha]&&d==sd&&(a=c[hha](b))&&(a[Ib]<0||a[Jb]<0),g=new xg(0,0),j=Lm(c);if(b==j)return g;if(b[fha]){a=nia(b);b=gm(Cg(c));g.x=a[Ck]+b.x;g.y=a.top+b.y}else if(c[hha]&&!f){a=c[hha](b);b=c[hha](j);g.x=a[Ib]-b[Ib];g.y=a[Jb]-b[Jb]}else{a=b;do{g.x+=a[Vk];g.y+=a[ol];if(a!=b){g.x+=a[iha]||0;g.y+=a[kha]||0}if(Jg&&mia(a)==oia){g.x+=c[Lc][dl];g.y+=c[Lc][Nk];break}a=a[mha]}while(a&&a!=b);if(Ng||Jg&&d==sd)g.y-=c[Lc][ol];for(a=b;(a=qia(a))&&a!=c[Lc]&&a!=j;){g.x-=
+a[dl];if(!Ng||a[ed]!=vd)g.y-=a[Nk]}}return g}function uia(b,a,c){if(a.cb()!=c.cb()){var d=a.cb()[Lc];c=c.Ec();var f=new xg(0,0),g=pm(Eg(d)),j=d;do{var n=g==c?Nm(j):Pm(j);f.x+=n.x;f.y+=n.y}while(g&&g!=c&&(j=g[Kk])&&(g=g[Oc]));c=f;c=Zha(c,Nm(d));if(L&&!Rha(a))c=Zha(c,gm(a));b.left+=c.x;b.top+=c.y}}function Pm(b){var a=new xg;if(b[nb]==1)if(b[fha]){var c=nia(b);a.x=c[Ck];a.y=c.top}else{c=gm(Cg(b));b=Nm(b);a.x=b.x-c.x;a.y=b.y-c.y}else{a.x=b[kc];a.y=b[lc]}return a}
+function Qm(b,a,c){var d=Nm(b);if(a instanceof xg){c=a.y;a=a.x}Km(b,b[Vk]+(a-d.x),b[ol]+(c-d.y))}function Rm(b,a,c){if(a instanceof yg){c=a[id];a=a[ib]}else{if(c==undefined)e(Error(".23"));c=c}ka(b[x],typeof a==Qe?l[kb](a)+Jm:a);Wa(b[x],typeof c==Qe?l[kb](c)+Jm:c)}var Sm="10",via="inline";
+function Tm(b){var a=Ng&&!vg(Sm);if(Gm(b,wd)!=xd)return a?new yg(b[xk]||b[vc],b[ql]||b[Wc]):new yg(b[xk],b[ql]);var c=b[x],d=c[nl],f=c.visibility,g=c[yaa];Fa(c,yd);Ja(c,sd);Ua(c,via);if(a){a=b[xk]||b[vc];b=b[ql]||b[Wc]}else{a=b[xk];b=b[ql]}Ua(c,d);Ja(c,g);Fa(c,f);return new yg(a,b)}function Um(b){var a=Nm(b);b=Tm(b);return new Cm(a.x,a.y,b[ib],b[id])}function lia(b){return wia[b]||(wia[b]=String(b)[mb](/\-([a-z])/g,function(a,c){return c[pl]()}))}
+var xia="opacity",yia="MozOpacity",zia="filter",Aia="alpha(opacity=";function Vm(b,a){b=b[x];if(xia in b)dha(b,a);else if(yia in b)b.MozOpacity=a;else if(zia in b)aha(b,a===I?I:Aia+a*100+xh)}function Wm(b,a){Ua(b[x],a?I:xd)}var Xm="head",Ym="body";function Vj(b,a){a=Cg(a);var c=i;if(L){c=a.cb().createStyleSheet();Lga(c,b)}else{var d=a.ie(Xm)[0];if(!d){c=a.ie(Ym)[0];d=a.ba(Xm);c[A][Bb](d,c)}c=a.ba(Kg);Lga(c,b);a[o](d,c)}return c}var Bia="innerHTML";
+function Lga(b,a){if(L)iaa(b,a);else b[Jg?xca:Bia]=a}var Zm="rtl",Cia="direction";function Om(b){return Zm==Gm(b,Cia)}var Dia="unselectable";function an(b,a,c){c=!c?b[ic](Hg):i;if(Eia){a=a?xd:I;b[x][Eia]=a;if(c){b=0;for(var d;d=c[b];b++)d[x][Eia]=a}}else if(L||Ng){a=a?qh:I;b[Wb](Dia,a);if(c)for(b=0;d=c[b];b++)d[Wb](Dia,a)}}var Fia="HTML";
+function bn(b,a,c,d,f,g,j,n){var s,v=c[mha];if(v){var C=v[ed]==Fia||v[ed]==zd;if(!C||mia(v)!=pia){s=Nm(v);C||(s=Zha(s,new xg(v[dl],v[Nk])))}}v=Um(b);(C=Mm(b))&&v.iwa(iia(C));uia(v,Cg(b),Cg(c));b=(a&4&&Om(b)?a^2:a)&-5;a=new xg(b&2?v[Ck]+v[ib]:v[Ck],b&1?v.top+v[id]:v.top);if(s)a=Zha(a,s);if(f){a.x+=(b&2?-1:1)*f.x;a.y+=(b&1?-1:1)*f.y}var M;if(j)if((M=Mm(c))&&s){M.top=l.max(0,M.top-s.y);M.right-=s.x;M.bottom-=s.y;ck(M,l.max(0,M[Ck]-s.x))}return cn(a,c,d,g,M,j,n)}
+function cn(b,a,c,d,f,g,j){b=b.vc();var n=0;c=(c&4&&Om(a)?c^2:c)&-5;var s=Tm(a);j=j?j.vc():s;if(d||c!=0){if(c&2)b.x-=j[ib]+(d?d[rl]:0);else if(d)b.x+=d[Ck];if(c&1)b.y-=j[id]+(d?d[fl]:0);else if(d)b.y+=d.top}if(g){n=f?Gia(b,j,f,g):256;if(n&496)return n}Km(a,b);Yha(s,j)||Rm(a,j);return n}
+function Gia(b,a,c,d){var f=0;if(b.x<c[Ck]&&d&1){b.x=c[Ck];f|=1}if(b.x<c[Ck]&&b.x+a[ib]>c[rl]&&d&16){a.width-=b.x+a[ib]-c[rl];f|=4}if(b.x+a[ib]>c[rl]&&d&1){b.x=l.max(c[rl]-a[ib],c[Ck]);f|=1}if(d&2)f|=(b.x<c[Ck]?16:0)|(b.x+a[ib]>c[rl]?32:0);if(b.y<c.top&&d&4){b.y=c.top;f|=2}if(b.y>=c.top&&b.y+a[id]>c[fl]&&d&32){a.height-=b.y+a[id]-c[fl];f|=8}if(b.y+a[id]>c[fl]&&d&4){b.y=l.max(c[fl]-a[id],c.top);f|=2}if(d&8)f|=(b.y<c.top?64:0)|(b.y+a[id]>c[fl]?128:0);return f}function Hia(){}
+function dn(b,a){ok(this,b);this.GN=a}function en(b,a,c){dn[z](this,b,a);this.dsc=c}var Iia="role";function fn(b,a){if(Fh||Jia){b[Wb](Iia,a);b.SDd=a}}var Kia="aria-";function gn(b,a,c){if(Fh||Jia)b[Wb](Kia+a,c)}var Lia="525";function Mia(b,a,c,d,f){if(!L&&!(Jg&&vg(Lia)))return h;if(Qi&&f)return Nia(b);if(f&&!d)return k;if(L&&!c&&(a==17||a==18))return k;if(L&&d&&a==b)return k;switch(b){case 13:return h;case 27:return!Jg}return Nia(b)}
+function Nia(b){if(b>=48&&b<=57)return h;if(b>=96&&b<=106)return h;if(b>=65&&b<=90)return h;switch(b){case 32:case 63:case 107:case 109:case 110:case 111:case 186:case 189:case 187:case 188:case 190:case 191:case 192:case 222:case 219:case 220:case 221:return h;default:return k}}function hn(b){b&&this.Pe(b)}var jn="key";function Oia(b,a,c,d){d&&this.wc(d,void 0);za(this,jn);xa(this,b);haa(this,a);this.repeat=c}function Pia(b,a,c,d){en[z](this,b,a,c);this.EWa=d}function kn(b){this.na=b}
+function ln(b,a,c,d,f,g){if(Ve(c))for(var j=0;j<c[u];j++)ln(b,a,c[j],d,f,g);else{a=mh(a,c,d||b,f||k,g||b.na||b);Qia(b,a)}return b}function Qia(b,a){if(b.ri)b.ri[a]=h;else if(b.Js){b.ri=Ria.Iw();b.ri[b.Js]=h;b.Js=i;b.ri[a]=h}else b.Js=a}function mn(){}function nn(b){this.ya=b||Cg();this.vBa=Sia}var Tia="disable",Uia="enable",on="highlight",Via="unhighlight",Wia="activate",Xia="unselect",Yia="check",Zia="uncheck",pn="open",qn="close";
+function aja(b,a){switch(b){case 1:return a?Tia:Uia;case 2:return a?on:Via;case 4:return a?Wia:Wea;case 8:return a?nj:Xia;case 16:return a?Yia:Zia;case 32:return a?lj:kj;case 64:return a?pn:qn;default:}e(Error(".25"))}function bja(b,a){b.wa=a}function rn(b){return b.bf?b.bf[u]:0}function sn(b,a,c){b.bf&&Ff(b.bf,a,c)}function tn(b,a){return b.bf&&a?ff(b.bf,a):-1}function un(){}
+function cja(b,a,c){var d=[];if(c)a=a[wb]([c]);Ff([],function(f){if(Gf(f,df(ef,a))&&(!c||ef(f,c)))d[p](f[kd](mg))});return d}var dja="-JE",eja="-JW",fja="-Je",gja="-KO",hja="-Jp",ija="-JO",jja="-Kq";function kja(b){var a=b.Qb();b.KIa=Af(1,a+dja,2,a+eja,4,a+fja,8,a+gja,16,a+hja,32,a+ija,64,a+jja)}function lja(b){b.KIa||kja(b);b.Xfc=tm(b.KIa)}function vn(){}function mja(b){for(var a;b;){a=bf(b);if(a=nja[a])break;b=b.C?b.C[Sk]:i}if(a)return Ze(a.S)?a.S():new a;return i}
+function wn(b,a){if(!b)e(Error(".33`"+b));if(!Ze(a))e(Error(".34`"+a));oja[b]=a}function pja(b){for(var a=zg(b),c=0,d=a[u];c<d;c++)if(b=a[c]in oja?oja[a[c]]():i)return b;return i}function xn(b,a,c){nn[z](this,c);this.Kc=a||mja(this[Sk]);this.bma(b)}function qja(b,a){b.Cc()&&a!=b.Bfb&&rja(b,a);b.Bfb=a}function sja(b,a){if(a&&b.eK){jf(b.eK,a);if(b.eK[u]==0)b.eK=i;b.Kc.kT(b,a,k)}}
+function rja(b,a){var c=b.H(),d=b.b();if(a){c.w(d,Xi,b.qA).w(d,fj,b.Ey).w(d,gj,b.X6).w(d,Yi,b.q_);L&&c.w(d,ej,b.dUb)}else{c.hb(d,Xi,b.qA).hb(d,fj,b.Ey).hb(d,gj,b.X6).hb(d,Yi,b.q_);L&&c.hb(d,ej,b.dUb)}}function yn(b,a){zn(b,16,a)&&b.Oe(16,a)}function tja(b,a){zn(b,32,a)&&b.Oe(32,a)}var An=".28";function Bn(b,a,c){if(b.Cc()&&b.VE(a)&&!c)e(Error(An));!c&&b.VE(a)&&b.Oe(a,k);b.ht=c?b.ht|a:b.ht&~a}function Cn(b,a){return!!(b.U3a&a)&&!!(b.ht&a)}function Dn(b,a,c){b.xZa=c?b.xZa|a:b.xZa&~a}
+function zn(b,a,c){return!!(b.ht&a)&&b.VE(a)!=c&&(!(b.xZa&a)||b[r](aja(a,c)))&&!b.Pc}function En(){}function uja(b,a){qja(a,k);a.U3a&=-256;Bn(a,32,k)}function Fn(b,a,c){xn[z](this,b,a||En.S(),c)}function Gn(){}function Hn(b,a){xn[z](this,i,b||Gn.S(),a);Bn(this,1,k);Bn(this,2,k);Bn(this,4,k);Bn(this,32,k);this.qa=1}function vja(){}function wja(b,a,c){if(a)fk(a,c?0:-1)}var In="vertical";function Jn(b,a,c){nn[z](this,c);this.Kc=a||vja.S();this.Rs=b||In}
+function xja(b,a){var c=b.H(),d=b.Lk();a?c.w(d,lj,b.aU).w(d,kj,b.oC).w(b.Hga(),jn,b.Qo):c.hb(d,lj,b.aU).hb(d,kj,b.oC).hb(b.Hga(),jn,b.Qo)}function yja(b,a){var c=a.b();c=c.id||(c.id=a.ea());if(!b.vY)b.vY={};b.vY[c]=a}function Kn(b){return b.rb(b.Km)}function Ln(b){zja(b,function(a,c){return(a+1)%c},rn(b)-1)}function Aja(b){zja(b,function(a,c){a--;return a<0?c-1:a},0)}function Bja(b){zja(b,function(a,c){return(a+1)%c},b.Km)}function Cja(b){zja(b,function(a,c){a--;return a<0?c-1:a},b.Km)}
+function zja(b,a,c){c=c<0?tn(b,b.wu):c;var d=rn(b);c=a(c,d);for(var f=0;f<=d;){var g=b.rb(c);if(g&&b.j5a(g)){b.Mwb(c);return h}f++;c=a(c,d)}return k}function Dja(b,a){b.gV=a}function Mn(){this.Zpa=[]}var Eja="-JT",Fja="-Jo",Nn="-Jz";function On(b,a){var c=b.Zpa[a];if(!c){switch(a){case 0:c=b.Qb()+Eja;break;case 1:c=b.Qb()+Fja;break;case 2:c=b.Qb()+Nn;break}b.Zpa[a]=c}return c}var T="div";function Gja(b,a,c){b=On(b,2);return c.ba(T,b,a)}
+function Hja(b,a){if(a=b.Cd(a)){a=a[Tb];b=On(b,1);return!!a&&!!a[uc]&&a[uc][Db](b)!=-1}return k}var Pn="J-Ks";function Ija(b,a,c,d){if(d!=Hja(b,c)){hm(c,Pn,d);c=b.Cd(c);if(d){b=On(b,1);c[Bb](a.W().ba(T,b),c[Tb]||i)}else c[Nc](c[Tb])}}function Qn(b,a,c,d){xn[z](this,b,d||Mn.S(),c);this.Fa(a)}function Rn(){}function Sn(b,a){Jn[z](this,In,a||Rn.S(),b);this.Xm(k)}function Tn(){}
+function Jja(b,a){if(b)for(var c=a?b[Tb]:b[Qc],d;c&&c[A]==b;){d=a?c[fc]:c[pc];if(c[nb]==3){var f=c[md];if(Pf(f)==I)b[Nc](c);else{pk(c,a?bia(f):aia(f));break}}else break;c=d}}function Un(){}function Vn(b,a,c,d){Fn[z](this,b,c||Un.S(),d);Bn(this,64,h);a&&this.Zs(a);this.ab=new Bh(500)}var Wn="action";function Kja(b,a,c){var d=b.H();c=c?d.w:d.hb;c[z](d,a,Wn,b.Afb);c[z](d,a,on,b.nfb);c[z](d,a,Via,b.cgb)}function Xn(b,a){b=Number(b);a=Number(a);Qa(this,b<a?b:a);this.Oc=b<a?a:b}var Lja="#$1$1$2$2$3$3";
+function Mja(b){if(!Nja[cb](b))e(Error(".39`"+b));if(b[u]==4)b=b[mb](Oja,Lja);return b[od]()}function Yn(){}var Zn="tr",Pja="-oKdM2c";function Qja(b,a,c,d){for(var f=[],g=0,j=0;g<c[id];g++){for(var n=[],s=0;s<c[ib];s++){var v=a&&a[j++];n[p](b.AJa(v,d))}f[p](d.ba(Zn,b.Qb()+Pja,n))}return b.Pqa(f,d)}var Rja="-Jn-JW",Sja="activedescendent";function Tja(b,a,c,d){if(c){c=c[A];hm(c,b.Qb()+Rja,d);b=a.b()[Tb];gn(b,Sja,c.id)}}var Uja="-Jn-KO";function Vja(b,a,c,d){c&&hm(c[A],b.Qb()+Uja,d)}
+function Wja(b){this.qi=[];this.dGa(b)}function ao(b,a,c){xn[z](this,b,a||Yn.S(),c)}function Xja(b){var a=b.Ee();return a&&a[b.Km]}function Yja(b,a){var c=b.Ee();b.dp(c?ff(c,a):-1)}function Zja(b){var a=b.Ee();if(a)if(b.We&&b.We[ib]){a=l[ob](a[u]/b.We[ib]);if(!mm(b.We[id])||b.We[id]<a)Wa(b.We,a)}else{a=l[ob](l[jha](a[u]));b.We=new yg(a,a)}else b.We=new yg(0,0)}function aka(b,a){this.GJ=b instanceof xg?b:new xg(b,a)}function bka(b,a){aka[z](this,b,a)}
+function bo(b,a){this.na=new kn(this);this.mM(b||i);a&&this.pma(a)}function cka(b){if(b.Nm)e(Error(".41"))}var dka="-200px";function eka(b){ck(b.wa[x],dka);b.wa[x].top=dka}function co(b){Sn[z](this,b);this.Qk(h);this.ra(k,h);this.kt=new Hf}function fka(b,a){b.H().hb(a.wa,a.Aab,b.D6b)}function U(b){this.pp=bj?[]:I;b!=i&&this[R][cd](this,arguments)}var gka=/#|$/,Tha=[1,4,2];Bi(O.S(),Ph);_B_prog(10)}catch(e){_B_err(e)}
+
+try{H(xm,uh);ya(xm[w],function $nc(a){var c=new hh(a.pj);za(c,a[Zb]==cj||a[Zb]==lj?cj:dj);try{this[r](c)}finally{c.D()}});xm[w].L=function $oc(){xm.C.L[z](this);oh(this.qSc);oh(this.rSc);delete this.wa};H(Am,uh);ya(Am[w],function $pc(a){a=a.pj;if(a[Zb]==fia&&a.propertyName==Fj||a[Zb]==zm||a[Zb]==Zi){if(L||Ng){var c=a[saa];if(c!=Eg(c)[rk])return}a=new hh(a);za(a,zm);try{this[r](a)}finally{a.D()}}});Am[w].L=function $qc(){Am.C.L[z](this);oh(this.lRa);delete this.wa};Bm[w].vc=function $rc(){return new Bm(this.top,this[rl],this[fl],this[Ck])};Sa(Bm[w],function $sc(a){return!this||!a?k:a instanceof Bm?a[Ck]>=this[Ck]&&a[rl]<=this[rl]&&a.top>=this.top&&a[fl]<=this[fl]:a.x>=this[Ck]&&a.x<=this[rl]&&a.y>=this.top&&a.y<=this[fl]});Bm[w].expand=function $tc(a,c,d,f){if(af(a)){this.top-=a.top;this.right+=a[rl];this.bottom+=a[fl];this.left-=a[Ck]}else{this.top-=a;this.right+=c;this.bottom+=d;this.left-=f}return this};F=Cm[w];F.vc=function $uc(){return new Cm(this[Ck],this.top,this[ib],this[id])};F.iwa=function $vc(a){var c=l.max(this[Ck],a[Ck]),d=l.min(this[Ck]+this[ib],a[Ck]+a[ib]);if(c<=d){var f=l.max(this.top,a.top);a=l.min(this.top+this[id],a.top+a[id]);if(f<=a){ck(this,c);this.top=f;ka(this,d-c);Wa(this,a-f);return h}}return k};
+F.WD=function $wc(a){var c;b:{c=l.max(this[Ck],a[Ck]);var d=l.min(this[Ck]+this[ib],a[Ck]+a[ib]);if(c<=d){var f=l.max(this.top,a.top),g=l.min(this.top+this[id],a.top+a[id]);if(f<=g){c=new Cm(c,f,d-c,g-f);break b}}c=i}if(!c||!c[id]||!c[ib])a=[this.vc()];else{c=[];d=this.top;f=this[id];g=this[Ck]+this[ib];var j=this.top+this[id],n=a[Ck]+a[ib],s=a.top+a[id];if(a.top>this.top){c[p](new Cm(this[Ck],this.top,this[ib],a.top-this.top));d=a.top;f-=a.top-this.top}if(s<j){c[p](new Cm(this[Ck],s,this[ib],j-s));
+f=s-d}a[Ck]>this[Ck]&&c[p](new Cm(this[Ck],d,a[Ck]-this[Ck],f));n<g&&c[p](new Cm(n,d,g-n,f));a=c}return a};Sa(F,function $xc(a){return a instanceof Cm?this[Ck]<=a[Ck]&&this[Ck]+this[ib]>=a[Ck]+a[ib]&&this.top<=a.top&&this.top+this[id]>=a.top+a[id]:a.x>=this[Ck]&&a.x<=this[Ck]+this[ib]&&a.y>=this.top&&a.y<=this.top+this[id]});F.Ke=function $yc(){return new yg(this[ib],this[id])};var wia={},hka="MozUserSelect",ika="WebkitUserSelect",Eia=Fh?hka:Jg?ika:i;Hia[w].If=B();H(dn,Hia);dn[w].If=function $Ac(a,c,d){bn(this[ll],this.GN,a,c,undefined,d)};H(en,dn);en[w].If=function $Bc(a,c,d,f){var g=bn(this[ll],this.GN,a,c,i,d,10,f);if(g&496){var j=this.GN,n=c;if(g&48){j^=2;n^=2}if(g&192){j^=1;n^=1}g=bn(this[ll],j,a,n,i,d,10,f);if(g&496)this.dsc?bn(this[ll],this.GN,a,c,i,d,5,f):bn(this[ll],this.GN,a,c,i,d,0,f)}};var Jia;H(hn,uh);F=hn[w];F.wa=i;F.yQa=i;F.hkb=i;F.zQa=i;F.kxa=-1;F.Hia=-1;
+var jka={"3":13,"12":144,"63232":38,"63233":40,"63234":37,"63235":39,"63236":112,"63237":113,"63238":114,"63239":115,"63240":116,"63241":117,"63242":118,"63243":119,"63244":120,"63245":121,"63246":122,"63247":123,"63248":44,"63272":46,"63273":36,"63275":35,"63276":33,"63277":34,"63289":144,"63302":45},kka={Up:38,Down:40,Left:37,Right:39,Enter:13,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,"U+007F":46,Home:36,End:35,PageUp:33,PageDown:34,Insert:45},lka={61:187,
+59:186},mka=L||Jg&&vg(Lia);F=hn[w];F.BH=function $Cc(a){if(mka&&!Mia(a[Sb],this.kxa,a[dd],a[Bc],a[rc]))this[Xb](a);else this.Hia=Fh&&a[Sb]in lka?lka[a[Sb]]:a[Sb]};F.eJc=function $Dc(){this.Hia=this.kxa=-1};
+ya(F,function $Ec(a){var c=a.pj,d,f;if(L&&a[Zb]==Zi){d=this.Hia;f=d!=13&&d!=27?c[Sb]:0}else if(Jg&&a[Zb]==Zi){d=this.Hia;f=c[Ob]>=0&&c[Ob]<63232&&Nia(d)?c[Ob]:0}else if(Ng){d=this.Hia;f=Nia(d)?c[Sb]:0}else{d=c[Sb]||this.Hia;f=c[Ob]||0;if(Qi&&f==63&&!d)d=191}var g=d,j=c.keyIdentifier;if(d)if(d>=63232&&d in jka)g=jka[d];else{if(d==25&&a[dd])g=9}else if(j&&j in kka)g=kka[j];a=g==this.kxa;this.kxa=g;c=new Oia(g,f,a,c);try{this[r](c)}finally{c.D()}});
+F.Pe=function $Fc(a){this.zQa&&this[Ik]();this.wa=a;this.yQa=ih(this.wa,Zi,this);this.hkb=ih(this.wa,ij,this.BH,k,this);this.zQa=ih(this.wa,jj,this.eJc,k,this)};ek(F,function $Gc(){if(this.yQa){oh(this.yQa);oh(this.hkb);oh(this.zQa);this.zQa=this.hkb=this.yQa=i}this.wa=i;this.kxa=-1});F.L=function $Hc(){hn.C.L[z](this);this[Ik]()};H(Oia,hh);H(Pia,en);Pia[w].If=function $Ic(a,c,d,f){this.EWa?bn(this[ll],this.GN,a,c,i,d,33,f):Pia.C.If[z](this,a,c,d,f)};H(kn,Jf);var Ria=new Lf(0,100);F=kn[w];F.w=function $Jc(a,c,d,f,g){if(Ve(c))for(var j=0;j<c[u];j++)this.w(a,c[j],d,f,g);else{a=ih(a,c,d||this,f||k,g||this.na||this);Qia(this,a)}return this};
+F.hb=function $Kc(a,c,d,f,g){if(this.Js||this.ri)if(Ve(c))for(var j=0;j<c[u];j++)this.hb(a,c[j],d,f,g);else{a:{d=d||this;g=g||this.na||this;f=!!(f||k);if(a=Ica(a,c,f))for(c=0;c<a[u];c++)if(a[c].GA==d&&a[c][Fb]==f&&a[c].Si==g){a=a[c];break a}a=i}if(a){a=a.key;oh(a);if(this.ri)dia(this.ri,a);else if(this.Js==a)this.Js=i}}return this};F.wb=function $Lc(){if(this.ri){for(var a in this.ri){oh(a);delete this.ri[a]}Ria.ez(this.ri);this.ri=i}else this.Js&&oh(this.Js)};F.L=function $Mc(){kn.C.L[z](this);this.wb()};
+
+ya(F,function $Nc(){e(Error(".24"))});_B_prog(11)}catch(e){_B_err(e)}
+
+try{Ne(mn);mn[w].z0=0;mn[w].jH=function $Oc(){return xj+(this.z0++)[t](36)};var nka=mn.S();H(nn,uh);nn[w].jhb=mn.S();var Sia=i;F=nn[w];F.Xa=i;F.ya=i;F.vA=k;F.wa=i;F.vBa=i;F.kb=i;F.mh=i;F.bf=i;F.sJ=i;F.gkc=k;F.ea=function $Pc(){return this.Xa||(this.Xa=this.jhb.jH())};F.qh=function $Qc(a){if(this.mh&&this.mh.sJ){dia(this.mh.sJ,this.Xa);var c=this.mh.sJ;if(a in c)e(Error(".4`"+a));c[a]=this}this.Xa=a};var eo="wa";F.b=D(eo);F.H=function $Sc(){return this.nha||(this.nha=new kn(this))};
+F.Ig=function $Tc(a){if(this==a)e(Error(".26"));if(a&&this.mh&&this.Xa&&this.mh.za(this.Xa)&&this.mh!=a)e(Error(".26"));this.mh=a;nn.C.dk[z](this,a)};var oka="mh";F.ac=D(oka);F.dk=function $Vc(a){if(this.mh&&this.mh!=a)e(Error(".27"));nn.C.dk[z](this,a)};var fo="ya";F.W=D(fo);var pka="vA";F.Cc=D(pka);F.ba=function $Yc(){this.wa=this.ya[Qb](T)};F.eb=function $Zc(a){this.sx(a)};
+F.sx=function $_c(a,c){if(this.vA)e(Error(An));this.wa||this.ba();a?a[Bb](this.wa,c||i):this.ya.cb()[Lc][o](this.wa);if(!this.mh||this.mh.Cc())this.ma()};F.Pb=function $0c(a){if(this.vA)e(Error(An));else if(a&&this.ji(a)){this.gkc=h;if(!this.ya||this.ya.cb()!=Eg(a))this.ya=Cg(a);this.Ff(a);this.ma()}else e(Error(".29"))};F.ji=E(h);F.Ff=Ge(eo);F.ma=function $3c(){this.vA=h;sn(this,function(a){!a.Cc()&&a.b()&&a.ma()})};
+F.Ba=function $4c(){sn(this,function(a){a.Cc()&&a.Ba()});this.nha&&this.nha.wb();this.vA=k};F.L=function $5c(){nn.C.L[z](this);this.vA&&this.Ba();if(this.nha){this.nha.D();delete this.nha}sn(this,function(a){a.D()});!this.gkc&&this.wa&&Sg(this.wa);this.mh=this.kb=this.wa=this.sJ=this.bf=i};F.X=function $6c(a){return this.ea()+He+a};F.ve=function $7c(a){if(!this.vA)e(Error(".30"));return this.ya.b(this.X(a))};F.ha=function $8c(a,c){this.Jf(a,rn(this),c)};
+F.Jf=function $9c(a,c,d){if(a.vA&&(d||!this.vA))e(Error(An));if(c<0||c>rn(this))e(Error(".31"));if(!this.sJ||!this.bf){this.sJ={};this.bf=[]}if(a.ac()==this){this.sJ[a.ea()]=a;jf(this.bf,a)}else{var f=this.sJ,g=a.ea();if(g in f)e(Error(".4`"+g));f[g]=a}a.Ig(this);km(this.bf,a,c);if(a.vA&&this.vA&&a.ac()==this){d=this.Cd();d[Bb](a.b(),d[cc][c+1]||i)}else if(d){this.wa||this.ba();c=this.rb(c+1);a.sx(this.Cd(),c?c.wa:i)}else this.vA&&!a.vA&&a.wa&&a.ma()};F.Cd=D(eo);
+F.wP=function $ad(){if(this.vBa==i)this.vBa=Om(this.vA?this.wa:this.ya.cb()[Lc]);return this.vBa};F.mma=function $bd(a){if(this.vA)e(Error(An));this.vBa=a};F.za=function $cd(a){return this.sJ&&a?cia(this.sJ,a)||i:i};F.rb=function $dd(a){return this.bf?this.bf[a]||i:i};lk(F,function $ed(a,c){if(a){var d=Ye(a)?a:a.ea();a=this.za(d);if(d&&a){dia(this.sJ,d);jf(this.bf,a);if(c){a.Ba();a.wa&&Sg(a.wa)}a.Ig(i)}}if(!a)e(Error(".32"));return a});F.Vp=function $fd(a,c){return this[Nc](this.rb(a),c)};
+F.ZA=function $gd(a){for(;this.bf&&this.bf[u]!=0;)this.Vp(0,a)};var qka;Ne(un);F=un[w];F.WG=B();F.ba=function $id(a){return a.W().ba(T,this.ry(a)[kd](J),a.Ee())};F.Cd=Ee();F.kT=function $kd(a,c,d){if(a=a.b?a.b():a)if(L&&!vg(Ij)){var f=cja(this,zg(a),c);f[p](c);df(d?K:Ag,a)[cd](i,f)}else hm(a,c,d)};F.ji=E(h);
+F.Pb=function $md(a,c){c.id&&a.qh(c.id);var d=this.Cd(c);d&&d[Tb]?a.bma(d[Tb][fc]?nf(d[cc]):d[Tb]):a.bma(i);var f=0,g=this.Qb(),j=this.Qb(),n=k,s=k;d=k;var v=zg(c);Ff(v,function(M){if(!n&&M==g){n=h;if(j==g)s=h}else if(!s&&M==j)s=h;else f|=this.geb(M)},this);a.qa=f;if(!n){v[p](g);if(j==g)s=h}s||v[p](j);(a=a.eK)&&v[p][cd](v,a);if(L&&!vg(Ij)){var C=cja(this,v);if(C[u]>0){v[p][cd](v,C);d=h}}if(!n||!s||a||d)m(c,v[kd](J));return c};F.mP=function $nd(a){a.wP()&&this.mma(a.b(),h);a.Mc()&&this.Xm(a,a.Ib())};
+F.Kaa=function $od(a,c){an(a,!c,!L&&!Ng)};var rka="-KL";F.mma=function $pd(a,c){this.kT(a,this.Qb()+rka,c)};F.yC=function $qd(a){var c;if(a.ht&32&&(c=a.Lk()))return Xha(c);return k};F.Xm=function $rd(a,c){var d;if(a.ht&32&&(d=a.Lk())){if(!c&&a.zwa()){try{d[yk]()}catch(f){}a.zwa()&&a.oC(i)}Xha(d)!=c&&Vha(d,c)}};F.ra=function $sd(a,c){Wm(a,c)};F.Oe=function $td(a,c,d){var f=a.b();if(f){var g=this.nta(c);g&&this.kT(a,g,d);this.Gna(f,c,d)}};
+var go="disabled",ska="pressed",ho="selected",io="checked",tka="expanded";F.Gna=function $ud(a,c,d){if(Fh){qka||(qka=Af(1,go,4,ska,8,ho,16,io,64,tka));(c=qka[c])&&gn(a,c,d)}};var uka="nodeType";F.xb=function $wd(a,c){var d=this.Cd(a);if(d){Pg(d);if(c)if(Ye(c))ah(d,c);else{a=function $vd(g){if(g){var j=Eg(d);d[o](Ye(g)?j[yb](g):g)}};if(Ve(c))Ff(c,a);else We(c)&&!(uka in c)?Ff(nf(c),a):a(c)}}};F.Lk=function $xd(a){return a.b()};F.Qb=E("J-bMcfAe");
+F.ry=function $zd(a){var c=this.Qb(),d=[c],f=this.Qb();f!=c&&d[p](f);c=a.xc();for(f=[];c;){var g=c&-c;f[p](this.nta(g));c&=~g}d[p][cd](d,f);(a=a.eK)&&d[p][cd](d,a);L&&!vg(Ij)&&d[p][cd](d,cja(this,d));return d};F.nta=function $Ad(a){this.KIa||kja(this);return this.KIa[a]};F.geb=function $Bd(a){this.Xfc||lja(this);a=da(this.Xfc[a],10);return ia(a)?0:a};H(vn,un);Ne(vn);F=vn[w];var jo="button";F.WG=E(jo);F.Gna=function $Dd(a,c,d){if(Fh)c==16?gn(a,ska,d):vn.C.Gna[z](this,a,c,d)};F.ba=function $Ed(a){var c=vn.C.ba[z](this,a),d=a.wK();d&&this.UQ(c,d);(d=a.Ca())&&this.Fa(c,d);a.ht&16&&this.Gna(c,16,k);return c};F.Pb=function $Fd(a,c){c=vn.C.Pb[z](this,a,c);a.vo(this.Ca(c));a.rYa(this.wK(c));a.ht&16&&this.Gna(c,16,k);return c};F.Ca=Me;F.Fa=Me;F.wK=function $Gd(a){return a[Pk]};F.UQ=function $Hd(a,c){if(a)ik(a,c||I)};var vka="-Js-Kc",wka="-Js-KK";
+F.KXa=function $Id(a,c){var d=a.wP(),f=this.Qb()+vka,g=this.Qb()+wka;a.kT(d?g:f,!!(c&1));a.kT(d?f:g,!!(c&2))};var xka="J-I";F.Qb=E(xka);var nja={},oja={};H(xn,nn);F=xn[w];F.Bg=i;F.qa=0;F.ht=39;F.U3a=255;F.xZa=0;F.yg=h;F.eK=i;F.Bfb=h;F.JGa=k;F.Lk=function $Kd(){return this.Kc.Lk(this)};F.Hga=function $Ld(){return this.sc||(this.sc=new hn)};var ko="Kc";F.li=D(ko);F.PW=function $Nd(a){if(this.Cc())e(Error(An));this.b()&&bja(this,i);this.Kc=a};F.Wl=function $Od(a){if(a){if(this.eK)ef(this.eK,a)||this.eK[p](a);else this.eK=[a];this.Kc.kT(this,a,h)}};F.kT=function $Pd(a,c){c?this.Wl(a):sja(this,a)};
+F.ba=function $Qd(){var a=this.Kc.ba(this);this.wa=a;if(Fh){var c=this.Kc.WG();c&&fn(a,c)}this.JGa||this.Kc.Kaa(a,k);this.Ib()||this.Kc.ra(a,k)};F.Cd=function $Rd(){return this.Kc.Cd(this.b())};F.ji=function $Sd(a){return this.Kc.ji(a)};F.Ff=function $Td(a){this.wa=a=this.Kc.Pb(this,a);if(Fh){var c=this.Kc.WG();c&&fn(a,c)}this.JGa||this.Kc.Kaa(a,k);this.yg=a[x][nl]!=xd};
+F.ma=function $Ud(){xn.C.ma[z](this);this.Kc.mP(this);if(this.ht&-2){this.Bfb&&rja(this,h);if(this.ht&32){var a=this.Lk();if(a){var c=this.Hga();c.Pe(a);this.H().w(c,jn,this.Qo).w(a,lj,this.aU).w(a,kj,this.oC)}}}};F.Ba=function $Vd(){xn.C.Ba[z](this);this.sc&&this.sc[Ik]();this.Ib()&&this.Mc()&&this.Kc.Xm(this,k)};F.L=function $Wd(){xn.C.L[z](this);if(this.sc){this.sc.D();delete this.sc}delete this.Kc;this.eK=this.Bg=i};var lo="Bg";F.Ee=D(lo);F.xb=function $Yd(a){this.Kc.xb(this.b(),a);this.bma(a)};
+F.bma=Ge(lo);F.un=function $_d(){var a=this.Ee();if(!a||Ye(a))return a;return(a=Ve(a)?Li(a,dh)[kd](I):dh(a))&&Pf(a)};F.lM=function $0d(a){this.xb(a)};F.mma=function $1d(a){xn.C.mma[z](this,a);var c=this.b();c&&this.Kc.mma(c,a)};F.Kaa=function $2d(a){this.JGa=a;var c=this.b();c&&this.Kc.Kaa(c,a)};F.Ib=D("yg");var mo="show",no="hide";F.ra=function $4d(a,c){if(c||this.yg!=a&&this[r](a?mo:no)){(c=this.b())&&this.Kc.ra(c,a);this.Mc()&&this.Kc.Xm(this,a);this.yg=a;return h}return k};F.Mc=function $5d(){return!this.VE(1)};
+F.Ac=function $6d(a){var c=this.ac();if(!(c&&typeof c.Mc==Se&&!c.Mc())&&zn(this,1,!a)){if(!a){this[Lk](k);this.Rk(k)}this.Ib()&&this.Kc.Xm(this,a);this.Oe(1,!a)}};F.Rk=function $7d(a){zn(this,2,a)&&this.Oe(2,a)};F.Eb=function $8d(){return this.VE(4)};hk(F,function $9d(a){zn(this,4,a)&&this.Oe(4,a)});F.Vo=function $$d(){return this.VE(8)};F.zm=function $ae(a){zn(this,8,a)&&this.Oe(8,a)};F.LH=function $be(){return this.VE(16)};F.zwa=function $ce(){return this.VE(32)};F.vj=function $de(){return this.VE(64)};
+F.Hi=function $ee(a){zn(this,64,a)&&this.Oe(64,a)};F.xc=D(Yj);F.VE=function $ge(a){return!!(this.qa&a)};F.Oe=function $he(a,c){if(this.ht&a&&c!=this.VE(a)){this.Kc.Oe(this,a,c);this.qa=c?this.qa|a:this.qa&~a}};var yka="enter";F.qA=function $ie(a){a[eb]&&!Zg(this.b(),a[eb])&&this[r](yka)&&this.Mc()&&Cn(this,2)&&this.Rk(h)};var zka="leave";F.q_=function $je(a){if(a[eb]&&!Zg(this.b(),a[eb])&&this[r](zka)){Cn(this,4)&&this[Lk](k);Cn(this,2)&&this.Rk(k)}};
+F.Ey=function $ke(a){if(this.Mc()){Cn(this,2)&&this.Rk(h);if(nm(a,0)){Cn(this,4)&&this[Lk](h);this.Kc.yC(this)&&this.Lk()[Ek]()}}!this.JGa&&nm(a,0)&&a[zb]()};F.X6=function $le(a){if(this.Mc()){Cn(this,2)&&this.Rk(h);this.Eb()&&this.ox(a)&&Cn(this,4)&&this[Lk](k)}};F.dUb=function $me(a){this.Mc()&&this.ox(a)};var Aka="altKey",Bka="ctrlKey",Cka="metaKey",Dka="shiftKey";
+F.ox=function $ne(a){Cn(this,16)&&yn(this,!this.LH());Cn(this,8)&&this.zm(h);Cn(this,64)&&this.Hi(!this.vj());var c=new N(Wn,this);if(a)for(var d=[Aka,Bka,Cka,Dka],f,g=0;f=d[g];g++)c[f]=a[f];return this[r](c)};F.aU=function $oe(){Cn(this,32)&&tja(this,h)};F.oC=function $pe(){Cn(this,4)&&this[Lk](k);Cn(this,32)&&tja(this,k)};F.Qo=function $qe(a){if(this.Ib()&&this.Mc()&&this.bU(a)){a[zb]();a[Ec]();return h}return k};F.bU=function $re(a){return a[Sb]==13&&this.ox(a)};if(!Ze(xn))e(Error(".35`"+xn));
+if(!Ze(un))e(Error(".36`"+un));var Eka=bf(xn);nja[Eka]=un;wn("J-bMcfAe",function(){return new xn(i)});_B_prog(12)}catch(e){_B_err(e)}
+
+try{H(En,vn);Ne(En);F=En[w];F.WG=B();F.ba=function $te(a){uja(this,a);return a.W().ba(jo,{"class":this.ry(a)[kd](J),disabled:!a.Mc(),title:a.wK()||I,value:a.Ca()||I},a.un()||I)};var Fka="BUTTON",oo="INPUT",Gka="reset";F.ji=function $ue(a){return a[ed]==Fka||a[ed]==oo&&(a[Zb]==jo||a[Zb]==oj||a[Zb]==Gka)};F.Pb=function $ve(a,c){uja(this,a);c[Uk]&&K(c,this.nta(1));return En.C.Pb[z](this,a,c)};F.mP=function $we(a){a.H().w(a.b(),P,a.ox)};F.Kaa=Me;F.mma=Me;F.yC=function $xe(a){return a.Mc()};F.Xm=Me;
+F.Oe=function $ye(a,c,d){En.C.Oe[z](this,a,c,d);if((a=a.b())&&c==1)jk(a,d)};F.Ca=function $ze(a){return a[q]};F.Fa=function $Ae(a,c){if(a)pa(a,c)};F.Gna=Me;H(Fn,xn);F=Fn[w];F.Ca=D(Ad);F.Fa=function $Ce(a){this.jf=a;this.li().Fa(this.b(),a)};F.vo=Ge(Ad);F.wK=D("fEa");F.UQ=function $Fe(a){this.fEa=a;this.li().UQ(this.b(),a)};F.rYa=Ge("fEa");F.KXa=function $He(a){this.li().KXa(this,a)};F.L=function $Ie(){Fn.C.L[z](this);delete this.jf;delete this.fEa};F.ma=function $Je(){Fn.C.ma[z](this);if(this.ht&32){var a=this.Lk();a&&this.H().w(a,jj,this.bU)}};F.bU=function $Ke(a){if(a[Sb]==13&&a[Zb]==jn||a[Sb]==32&&a[Zb]==jj)return this.ox(a);return a[Sb]==32};
+wn(xka,function(){return new Fn(i)});H(Gn,un);Ne(Gn);Gn[w].ba=function $Le(a){return a.W().ba(T,this.Qb())};Gn[w].Pb=function $Me(a,c){if(c[ed]==Bd){var d=c;c=this.ba(a);Qg(c,d);Sg(d)}else K(c,this.Qb());return c};Gn[w].xb=B();var po="J-Kh";Gn[w].Qb=E(po);H(Hn,xn);var Hka="separator";Hn[w].ma=function $Pe(){Hn.C.ma[z](this);fn(this.b(),Hka)};wn(po,function(){return new Hn});Ne(vja);F=vja[w];F.WG=B();F.ba=function $Re(a){return a.W().ba(T,this.ry(a)[kd](J))};F.Cd=Ee();F.ji=function $Te(a){return a[ed]==Cd};F.Pb=function $Ue(a,c){c.id&&a.qh(c.id);var d=this.Qb(),f=k,g=zg(c);g&&Ff(g,function(j){if(j==d)f=h;else j&&this.qxb(a,j,d)},this);f||K(c,d);this.rKa(a,c);return c};var Ika="-JV",qo="horizontal",Jka="-BvBYQ";F.qxb=function $Ve(a,c,d){if(c==d+dja)a.Ac(k);else if(c==d+Ika)a.lCa(qo);else c==d+Jka&&a.lCa(In)};
+F.rKa=function $We(a,c){if(c)for(var d=c[Tb],f;d&&d[A]==c;){f=d[fc];if(d[nb]==1){var g=this.IMa(d);if(g){g.wa=d;a.Mc()||g.Ac(k);a.ha(g);g.Pb(d)}}else if(!d[md]||Pf(d[md])==I)c[Nc](d);d=f}};F.IMa=function $Xe(a){return pja(a)};F.mP=function $Ye(a){a=a.b();an(a,h,Fh);if(L)kk(a,h);var c=this.WG();c&&fn(a,c)};F.Lk=function $Ze(a){return a.b()};F.Qb=E("J-Jw");F.ry=function $0e(a){var c=this.Qb(),d=[c,a.Rs==qo?c+Ika:c+Jka];a.Mc()||d[p](c+dja);return d};H(Jn,nn);F=Jn[w];F.xQa=i;F.sc=i;F.Kc=i;F.Rs=i;F.yg=h;F.Lf=h;F.mv=h;F.Km=-1;F.wu=i;F.gV=k;F.bGb=k;F.vY=i;F.Lk=function $1e(){return this.xQa||this.Kc.Lk(this)};F.Hga=function $2e(){return this.sc||(this.sc=new hn(this.Lk()))};F.li=D(ko);F.PW=function $4e(a){if(this.b())e(Error(An));this.Kc=a};F.ba=function $5e(){this.wa=this.Kc.ba(this)};F.Cd=function $6e(){return this.Kc.Cd(this.b())};F.ji=function $7e(a){return this.Kc.ji(a)};
+F.Ff=function $8e(a){this.wa=this.Kc.Pb(this,a);if(a[x][nl]==xd)this.yg=k};F.ma=function $9e(){Jn.C.ma[z](this);sn(this,function(c){c.Cc()&&yja(this,c)},this);var a=this.b();this.Kc.mP(this);this.ra(this.yg,h);this.H().w(this,yka,this.Nua).w(this,on,this.nfb).w(this,Via,this.cgb).w(this,pn,this.EJc).w(this,qn,this.OHc).w(a,fj,this.Ey).w(Eg(a),gj,this.kIc).w(a,[fj,gj,Xi,Yi],this.KHc);this.yC()&&xja(this,h)};F.Ba=function $$e(){this.dp(-1);this.wu&&this.wu.Hi(k);this.gV=k;Jn.C.Ba[z](this)};
+F.L=function $af(){Jn.C.L[z](this);if(this.sc){this.sc.D();this.sc=i}this.Kc=this.wu=this.vY=i};F.Nua=E(h);var ro="activedescendant";F.nfb=function $cf(a){var c=tn(this,a[y]);if(c>-1&&c!=this.Km){var d=Kn(this);d&&d.Rk(k);this.Km=c;d=Kn(this);this.gV&&d[Lk](h);if(this.wu&&d!=this.wu)d.ht&64?d.Hi(h):this.wu.Hi(k)}gn(this.b(),ro,a[y].b().id)};F.cgb=function $df(a){if(a[y]==Kn(this))this.Km=-1;gn(this.b(),ro,I)};
+F.EJc=function $ef(a){if((a=a[y])&&a!=this.wu&&a.ac()==this){this.wu&&this.wu.Hi(k);this.wu=a}};F.OHc=function $ff(a){if(a[y]==this.wu)this.wu=i};F.Ey=function $gf(a){this.Lf&&Dja(this,h);var c=this.Lk(),d;a:{if(c)if((d=c.getAttributeNode(Wha))&&d.specified){d=c[lha];d=mm(d)&&d>=0;break a}d=k}d?c[Ek]():a[zb]()};F.kIc=function $hf(){this.gV=k};
+F.KHc=function $if(a){var c;a:{c=a[y];if(this.vY)for(var d=this.b();c&&c[A]&&c!=d;){var f=c.id;if(f in this.vY){c=this.vY[f];break a}c=c[A]}c=i}if(c)switch(a[Zb]){case fj:c.Ey(a);break;case gj:c.X6(a);break;case Xi:c.qA(a);break;case Yi:c.q_(a);break}};F.aU=B();F.oC=function $kf(){this.dp(-1);this.gV=k;this.wu&&this.wu.Hi(k)};F.Qo=function $lf(a){if(this.Mc()&&rn(this)!=0&&this.bU(a)){a[zb]();a[Ec]();return h}return k};
+F.bU=function $mf(a){var c=Kn(this);if(c&&typeof c.Qo==Se&&c.Qo(a))return h;if(this.wu&&this.wu!=c&&typeof this.wu.Qo==Se&&this.wu.Qo(a))return h;switch(a[Sb]){case 27:if(this.yC())this.Lk()[yk]();else return k;break;case 36:Ln(this);break;case 35:Aja(this);break;case 38:if(this.Rs==In)Cja(this);else return k;break;case 37:if(this.Rs==qo)this.wP()?Bja(this):Cja(this);else return k;break;case 40:if(this.Rs==In)Bja(this);else return k;break;case 39:if(this.Rs==qo)this.wP()?Cja(this):Bja(this);else return k;
+break;default:return k}return h};F.ha=function $nf(a,c){Jn.C.ha[z](this,a,c)};F.Jf=function $of(a,c,d){Dn(a,2,h);Dn(a,64,h);if(this.yC()||!this.bGb)Bn(a,32,k);qja(a,k);Jn.C.Jf[z](this,a,c,d);d&&this.Cc()&&yja(this,a);c<=this.Km&&this.Km++};lk(F,function $pf(a,c){var d=tn(this,a);if(d!=-1)if(d==this.Km)a.Rk(k);else d<this.Km&&this.Km--;(d=a.b())&&d.id&&dia(this.vY,d.id);a=Jn.C[Nc][z](this,a,c);qja(a,h);return a});F.lCa=function $qf(a){if(this.b())e(Error(An));this.Rs=a};F.Ib=D("yg");var Kka="aftershow";
+F.ra=function $sf(a,c){if(c||this.yg!=a&&this[r](a?mo:no)){this.yg=a;var d=this.b();if(d){Wm(d,a);this.yC()&&wja(this.Kc,this.Lk(),this.Lf&&this.yg);this.yg&&!c&&this[r](Kka)}return h}return k};var so="Lf";F.Mc=D(so);F.Ac=function $uf(a){if(this.Lf!=a&&this[r](a?Uia:Tia)){if(a){this.Lf=h;sn(this,function(c){if(c.hkc)delete c.hkc;else c.Ac(h)})}else{sn(this,function(c){if(c.Mc())c.Ac(k);else c.hkc=h});this.gV=this.Lf=k}this.yC()&&wja(this.Kc,this.Lk(),a&&this.yg)}};var to="mv";F.yC=D(to);
+F.Xm=function $wf(a){a!=this.mv&&this.Cc()&&xja(this,a);this.mv=a;this.Lf&&this.yg&&wja(this.Kc,this.Lk(),a)};F.fH=D("Km");F.dp=function $yf(a){if(a=this.rb(a))a.Rk(h);else this.Km>-1&&Kn(this).Rk(k)};F.Rk=function $zf(a){this.dp(tn(this,a))};F.j5a=function $Af(a){return a.Ib()&&a.Mc()&&!!(a.ht&2)};F.Mwb=function $Bf(a){this.dp(a)};_B_prog(13)}catch(e){_B_err(e)}
+
+try{H(Mn,un);Ne(Mn);F=Mn[w];var Lka="menuitem";F.WG=E(Lka);F.ba=function $Df(a){var c=a.W().ba(T,this.ry(a)[kd](J),Gja(this,a.Ee(),a.W()));Ija(this,a,c,!!(a.ht&8)||!!(a.ht&16));return c};F.Cd=function $Ef(a){return a&&a[Tb]};F.Pb=function $Ff(a,c){var d=Wg(c),f=On(this,2);d&&d[uc][Db](f)!=-1||c[o](Gja(this,c[cc],a.W()));if(Bg(c,Pn)){a.Maa(h);this.Maa(a,c,h)}return Mn.C.Pb[z](this,a,c)};
+F.xb=function $Gf(a,c){var d=this.Cd(a),f=Hja(this,a)?d[Tb]:i;Mn.C.xb[z](this,a,c);if(f&&!Hja(this,a))d[Bb](f,d[Tb]||i)};var Mka="menuitemradio";F.Uaa=function $Hf(a,c,d){if(c){fn(c,d?Mka:this.WG());Ija(this,a,c,d)}};var Nka="menuitemcheckbox";F.Maa=function $If(a,c,d){if(c){fn(c,d?Nka:this.WG());Ija(this,a,c,d)}};var Oka="J-Ks-KO";F.nta=function $Jf(a){switch(a){case 2:return On(this,0);case 16:case 8:return Oka;default:return Mn.C.nta[z](this,a)}};
+F.geb=function $Kf(a){var c=On(this,0);switch(a){case Oka:return 16;case c:return 2;default:return Mn.C.geb[z](this,a)}};var uo="J-N";F.Qb=E(uo);H(Qn,xn);Qn[w].Ca=function $Mf(){var a=this.kb;return a!=i?a:this.un()};var wo="kb";Qn[w].Fa=Ge(wo);Qn[w].Uaa=function $Of(a){Bn(this,8,a);this.LH()&&!a&&yn(this,k);var c=this.b();c&&this.Kc.Uaa(this,c,a)};Qn[w].Maa=function $Pf(a){Bn(this,16,a);var c=this.b();c&&this.Kc.Maa(this,c,a)};wn(uo,function(){return new Qn(i)});H(Rn,vja);Ne(Rn);F=Rn[w];var Pka="menu";F.WG=E(Pka);F.ji=function $Rf(a){return a[ed]==Dd||Rn.C.ji[z](this,a)};F.IMa=function $Sf(a){return a[ed]==Bd?new Hn:Rn.C.IMa[z](this,a)};F.CJ=function $Tf(a,c){return Zg(a.b(),c)};var xo="J-M";F.Qb=E(xo);var yo="haspopup";F.mP=function $Vf(a){Rn.C.mP[z](this,a);a=a.b();gn(a,yo,jg)};wn(po,function(){return new Hn});H(Sn,Jn);F=Sn[w];F.zt=h;F.bY=k;F.Qb=function $Wf(){return this.li().Qb()};F.CJ=function $Xf(a){if(this.li().CJ(this,a))return h;for(var c=0,d=rn(this);c<d;c++){var f=this.rb(c);if(typeof f.CJ==Se&&f.CJ(a))return h}return k};F.Bk=function $Yf(a){this.ha(a,h)};F.r3=function $Zf(a,c){this.Jf(a,c,h)};mk(F,function $_f(a){(a=this[Nc](a,h))&&a.D()});F.caa=function $0f(a){(a=this.Vp(a,h))&&a.D()};F.Hw=function $1f(a){return this.rb(a)};F.Dp=function $2f(){return rn(this)};
+F.vy=function $3f(){return this.bf||[]};F.Kj=function $4f(a,c){var d=this.Ib();d||Wm(this.b(),h);Qm(this.b(),a,c);d||Wm(this.b(),k)};F.Qk=function $5f(a){(this.zt=a)&&this.Xm(h)};F.ra=function $6f(a,c){(c=Sn.C.ra[z](this,a,c))&&a&&this.Cc()&&this.zt&&this.Lk()[Ek]();return c};F.Nua=function $7f(a){this.zt&&this.Lk()[Ek]();return Sn.C.Nua[z](this,a)};F.j5a=function $8f(a){return(this.bY||a.Mc())&&a.Ib()&&!!(a.ht&2)};H(Tn,vn);Ne(Tn);F=Tn[w];var zo="J-J5-Ji ";F.ba=function $9f(a){var c={"class":zo+this.ry(a)[kd](J),title:a.wK()||I};return a.W().ba(T,c,this.Cqa(a.Ee(),a.W()))};F.Cd=function $$f(a){return a&&a[Tb][Tb]};var Qka="-Kv-H",Rka="-J6-H";F.Cqa=function $ag(a,c){return c.ba(T,zo+(this.Qb()+Qka),c.ba(T,zo+(this.Qb()+Rka),a))};F.ji=function $bg(a){return a[ed]==Cd};F.cVb=function $cg(a,c){if((c=a.W().Bp(c))&&c[uc][Db](this.Qb()+Qka)!=-1)if((a=a.W().Bp(c))&&a[uc][Db](this.Qb()+Rka)!=-1)return h;return k};
+var Ao="J-J5-Ji";F.Pb=function $dg(a,c){Jja(c,h);Jja(c,k);this.cVb(a,c)||c[o](this.Cqa(c[cc],a.W()));K(c,Ao,this.Qb());return Tn.C.Pb[z](this,a,c)};F.Qb=E("J-C7uZwb-I");H(Un,Tn);Ne(Un);if(Fh)Un[w].xb=function $fg(a,c){var d=Un.C.Cd[z](this,a&&a[Tb]);d&&Ug(this[gha](c,Cg(a)),d)};F=Un[w];F.Cd=function $gg(a){a=Un.C.Cd[z](this,a&&a[Tb]);if(Fh&&a&&a.__goog_wrapper_div)a=a[Tb];return a};F.Pb=function $hg(a,c){var d=Gg(Hg,xo,c)[0];if(d){Wm(d,k);Eg(d)[Lc][o](d);var f=new Sn;f.Pb(d);a.Zs(f)}return Un.C.Pb[z](this,a,c)};F.Cqa=function $ig(a,c){return Un.C.Cqa[z](this,[this[gha](a,c),this.gea(c)],c)};var Ska="-Jm";
+F.createCaption=function $jg(a,c){return c.ba(T,zo+(this.Qb()+Ska),a)};var Tka="-JG";F.gea=function $kg(a){return a.ba(T,zo+(this.Qb()+Tka),Ed)};var Uka="J-M-I";F.Qb=E(Uka);H(Vn,Fn);F=Vn[w];F.Qoa=h;F.Bvb=k;F.D7=k;F.ma=function $mg(){Vn.C.ma[z](this);this.Ia&&Kja(this,this.Ia,h);gn(this.b(),yo,jg)};F.Ba=function $ng(){Vn.C.Ba[z](this);if(this.Ia){this.Hi(k);this.Ia.Ba();Kja(this,this.Ia,k);var a=this.Ia.b();a&&Sg(a)}};F.L=function $og(){Vn.C.L[z](this);if(this.Ia){this.Ia.D();delete this.Ia}this.ab.D()};F.Ey=function $pg(a){Vn.C.Ey[z](this,a);if(this.Eb()){this.Hi(!this.vj());this.Ia&&Dja(this.Ia,this.vj())}};
+F.X6=function $qg(a){Vn.C.X6[z](this,a);this.Ia&&!this.Eb()&&Dja(this.Ia,k)};F.ox=function $rg(){this[Lk](k);return h};F.jIc=function $sg(a){this.Ia&&this.Ia.Ib()&&!this.CJ(a[y])&&this.Hi(k)};F.CJ=function $tg(a){return a&&Zg(this.b(),a)||this.Ia&&this.Ia.CJ(a)||k};F.bU=function $ug(a){if(a[Zb]!=(a[Sb]==32?jj:jn))return k;if(this.Ia&&this.Ia.Ib()){var c=this.Ia.Qo(a);if(a[Sb]==27){this.Hi(k);return h}return c}if(a[Sb]==40||a[Sb]==38||a[Sb]==32){this.Hi(h);return h}return k};F.Afb=function $vg(){this.Hi(k)};
+F.qJc=function $wg(){this.Eb()||this.Hi(k)};F.oC=function $xg(a){this.D7||this.Hi(k);Vn.C.oC[z](this,a)};F.fe=function $yg(){this.Ia||this.Zs(new Sn(this.W()));return this.Ia||i};F.Zs=function $zg(a){var c=this.Ia;if(a!=c){if(c){this.Hi(k);this.Cc()&&Kja(this,c,k);delete this.Ia}if(a){this.Ia=a;a.Ig(this);a.ra(k);a.Qk(this.D7);this.Cc()&&Kja(this,a,h)}}return c};F.Bk=function $Ag(a){this.fe().ha(a,h)};F.r3=function $Bg(a,c){this.fe().Jf(a,c,h)};mk(F,function $Cg(a){(a=this.fe()[Nc](a,h))&&a.D()});
+F.caa=function $Dg(a){(a=this.fe().Vp(a,h))&&a.D()};F.Hw=function $Eg(a){return this.Ia?this.Ia.rb(a):i};F.Dp=function $Fg(){return this.Ia?rn(this.Ia):0};F.ra=function $Gg(a,c){(a=Vn.C.ra[z](this,a,c))&&!this.Ib()&&this.Hi(k);return a};F.Ac=function $Hg(a){Vn.C.Ac[z](this,a);this.Mc()||this.Hi(k)};F.pB=function $Ig(){this.Hi(h)};
+F.Hi=function $Jg(a){Vn.C.Hi[z](this,a);if(this.Ia&&this.VE(64)==a){if(a){this.Ia.Cc()||this.Ia.eb();this.F0a=Mm(this.b());this.UHa=Um(this.b());this.oAa();this.Ia.dp(-1)}else{this[Lk](k);this.Ia.gV=k;if(Ue(this.oUa)){this.oUa=undefined;var c=this.Ia.b();c&&Rm(c,I,I)}}this.Ia.ra(a);c=this.H();var d=a?c.w:c.hb;d[z](c,this.W().cb(),fj,this.jIc,h);this.D7&&d[z](c,this.Ia,kj,this.qJc);d[z](c,this.ab,yj,this.cQ);a?this.ab[Rc]():this.ab[qc]()}};
+F.oAa=function $Kg(){var a=this.Qoa?5:7;a=new Pia(this.b(),a,!this.Bvb,this.Bvb);var c=this.Ia.b();if(!this.Ia.Ib()){Fa(c[x],yd);Wm(c,h)}if(!this.oUa&&this.Bvb)this.oUa=Tm(c);a.If(c,this.Qoa?4:6,i,this.oUa);if(!this.Ia.Ib()){Wm(c,k);Fa(c[x],ud)}};F.cQ=function $Lg(){var a=Um(this.b()),c=Mm(this.b());if(!jia(this.UHa,a)||!hia(this.F0a,c)){this.UHa=a;this.F0a=c;this.oAa()}};F.nfb=function $Mg(a){gn(this.b(),ro,a[y].b().id)};F.cgb=function $Ng(){Kn(this.Ia)||gn(this.b(),ro,I)};wn(Uka,function(){return new Vn(i)});_B_prog(14)}catch(e){_B_err(e)}
+
+try{Xn[w].vc=function $Og(){return new Xn(this[Rc],this.Oc)};var Oja=/#(.)(.)(.)/,Nja=/^#(?:[0-9a-f]{3}){1,2}$/i;H(Yn,un);Ne(Yn);var Vka=0;F=Yn[w];F.ba=function $Pg(a){var c=this.ry(a);return a.W().ba(T,c?c[kd](J):i,Qja(this,a.Ee(),a.Ke(),a.W()))};var Bo="table",Wka="-KW",Co="tbody",Xka="-Jj",Yka="grid";F.Pqa=function $Qg(a,c){a=c.ba(Bo,this.Qb()+Wka,c.ba(Co,this.Qb()+Xka,a));eha(a,0);gk(a,0);fn(a,Yka);return a};var Do="td",Zka="-Jn",ala="gridcell";F.AJa=function $Rg(a,c){a=c.ba(Do,{"class":this.Qb()+Zka,id:this.Qb()+Zka+Vka++},a);fn(a,ala);return a};F.ji=E(k);F.Pb=E(i);
+F.xb=function $Ug(a,c){if(a){var d=Gg(Co,this.Qb()+Xka,a)[0];if(d){var f=0;Ff(d[kl],function(v){Ff(v[cl],function(C){Pg(C);if(c){var M=c[f++];M&&Og(C,M)}})});if(f<c[u]){for(var g=[],j=Cg(a),n=d[kl][0][cl][u];f<c[u];){var s=c[f++];g[p](this.AJa(s,j));if(g[u]==n){s=j.ba(Zn,this.Qb()+Pja,g);d[o](s);Ia(g,0)}}if(g[u]>0){for(;g[u]<n;)g[p](this.AJa(I,j));s=j.ba(Zn,this.Qb()+Pja,g);d[o](s)}}}an(a,h,Fh)}};
+F.pta=function $Vg(a,c){for(a=a.b();c&&c[nb]==1&&c!=a;){if(c[ed]==Fd&&Bg(c,this.Qb()+Zka))return c[Tb];c=c[A]}return i};F.Qb=E("J-Kw");H(Wja,uh);F=Wja[w];F.NQ=i;F.JF=i;F.Dp=function $Xg(){return this.qi[u]};F.Hta=function $Yg(){return this.qi[this.qi[u]-1]};F.Hw=function $Zg(a){return this.qi[a]||i};F.dGa=function $_g(a){if(a){Ff(a,function(c){this.Ila(c,k)},this);of(this.qi,a)}};F.Bk=function $0g(a){this.r3(a,this.Dp())};F.r3=function $1g(a,c){if(a){this.Ila(a,k);km(this.qi,a,c)}};mk(F,function $2g(a){if(a&&jf(this.qi,a))if(a==this.NQ){this.NQ=i;this[r](nj)}});F.caa=function $3g(a){this[Yk](this.Hw(a))};var bla="NQ";F.rH=D(bla);
+F.fp=function $5g(a){if(a!=this.NQ){this.Ila(this.NQ,k);this.NQ=a;this.Ila(a,h)}this[r](nj)};F.Xt=function $6g(){return this.NQ?ff(this.qi,this.NQ):-1};F.Pl=function $7g(a){this.fp(this.Hw(a))};Aa(F,function $8g(){gf(this.qi);this.NQ=i});F.L=function $9g(){Wja.C.L[z](this);delete this.qi;this.NQ=i};F.Ila=function $$g(a,c){if(a)if(typeof this.JF==Se)this.JF(a,c);else typeof a.zm==Se&&a.zm(c)};H(ao,xn);F=ao[w];F.We=i;F.Km=-1;F.Sg=i;F.L=function $ah(){ao.C.L[z](this);if(this.Sg){this.Sg.D();this.Sg=i}this.We=i};F.bma=function $bh(a){ao.C.bma[z](this,a);Zja(this);if(this.Sg){this.Sg[bc]();this.Sg.dGa(a)}else{this.Sg=new Wja(a);this.Sg.JF=G(this.Ila,this);this.H().w(this.Sg,nj,this.tha)}this.Km=-1};F.un=E(i);F.lM=B();F.qA=function $eh(a){ao.C.qA[z](this,a);var c=this.li().pta(this,a[y]);c&&a[eb]&&Zg(c,a[eb])||c!=Xja(this)&&Yja(this,c)};
+F.q_=function $fh(a){ao.C.q_[z](this,a);var c=this.li().pta(this,a[y]);c&&a[eb]&&Zg(c,a[eb])||c==Xja(this)&&Tja(this.li(),this,c,k)};F.Ey=function $gh(a){ao.C.Ey[z](this,a);if(this.Eb()){a=this.li().pta(this,a[y]);a!=Xja(this)&&Yja(this,a)}};F.ox=function $hh(){var a=Xja(this);if(a){this.fp(a);return this[r](Wn)}return k};
+F.Qo=function $ih(a){var c=this.Ee();c=c?c[u]:0;var d=this.We[ib];if(c==0||!this.Mc())return k;if(a[Sb]==13||a[Sb]==32)return this.ox(a);if(a[Sb]==36){this.dp(0);return h}else if(a[Sb]==35){this.dp(c-1);return h}var f=this.Km<0?this.Xt():this.Km;switch(a[Sb]){case 37:if(f==-1)f=c;if(f>0){this.dp(f-1);a[zb]();return h}break;case 39:if(f<c-1){this.dp(f+1);a[zb]();return h}break;case 38:if(f==-1)f=c+d-1;if(f>=d){this.dp(f-d);a[zb]();return h}break;case 40:if(f==-1)f=-d;if(f<c-d){this.dp(f+d);a[zb]();
+return h}break}return k};F.tha=B();var Eo="We";F.Ke=D(Eo);F.jg=function $lh(a,c){if(this.b())e(Error(An));this.We=mm(a)?new yg(a,c):a;Zja(this)};F.fH=D("Km");F.dp=function $nh(a){if(a!=this.Km){this.l7(this.Km,k);this.Km=a;this.l7(a,h)}};F.Xt=function $oh(){return this.Sg?this.Sg.Xt():-1};F.rH=function $ph(){return this.Sg?this.Sg.rH():i};F.Pl=function $qh(a){this.Sg&&this.Sg.Pl(a)};F.fp=function $rh(a){this.Sg&&this.Sg.fp(a)};
+F.l7=function $sh(a,c){if(this.b()){var d=this.Ee();d&&a>=0&&a<d[u]&&Tja(this.li(),this,d[a],c)}};F.Ila=function $th(a,c){this.b()&&Vja(this.li(),this,a,c)};H(aka,Hia);aka[w].If=function $uh(a,c,d,f){var g=Lm(a);bn(g,0,a,c,new xg(this.GJ.x+g[dl],this.GJ.y+g[Nk]),d,i,f)};H(bka,aka);bka[w].If=function $vh(a,c,d,f){var g=Lm(a);g=Mm(g);var j;j=Cg(a);j=Pha(j.ki);j=new xg(this.GJ.x+j[dl],this.GJ.y+j[Nk]);var n=c,s=cn(j,a,n,d,g,10,f);if((s&496)!=0){if(s&16||s&32)n^=2;if(s&64||s&128)n^=1;s=cn(j,a,n,d,g,10,f);(s&496)!=0&&cn(j,a,c,d,g,undefined,f)}};H(bo,uh);F=bo[w];F.wa=i;F.eHb=h;F.S3a=i;F.Nm=k;F.njd=k;F.Jkb=-1;F.Akb=-1;F.FVb=k;F.RNb=h;var cla="toggle_display";F.Xd=cla;F.Ga=D(Gd);F.pma=Ge(Gd);F.b=D(eo);F.mM=function $zh(a){cka(this);this.wa=a};F.Hu=function $Ah(a){cka(this);this.eHb=a};F.Laa=Ge("S3a");var dla="Nm";F.Ib=D(dla);F.Bv=function $Dh(){return this.Nm||Zf()-this.Akb<150};F.ra=function $Eh(a){a?this.Ym():this.dP()};F.If=Me;var ela="move_offscreen";
+F.Ym=function $Fh(){if(!this.Nm)if(this.fob()){if(!this.wa)e(Error(".42"));this.If();var a=Eg(this.wa);this.FVb&&this.na.w(a,ij,this.j0c,h);if(this.eHb){this.na.w(a,fj,this.mka,h);if(L){for(var c=a[rk];c&&c[Gb]==Hd;){try{var d=om(c)}catch(f){break}a=d;c=a[rk]}this.na.w(a,fj,this.mka,h);this.na.w(a,Wea,this.i4b)}else this.na.w(a,kj,this.i4b)}if(this.Xd==cla)this.Wec();else this.Xd==ela&&this.If();this.Nm=h;this.hx()}};
+F.dP=function $Gh(a){if(!this.Nm||!this.dob(a))return k;this.na&&this.na.wb();if(this.Xd==cla)this.njd?Dh(this.GVb,0,this):this.GVb();else this.Xd==ela&&eka(this);this.Nm=k;this.yV(a);return h};F.Wec=function $Hh(){Fa(this.wa[x],ud);Wm(this.wa,h)};F.GVb=function $Ih(){Fa(this.wa[x],yd);Wm(this.wa,k)};var Fo="beforeshow";F.fob=function $Jh(){return this[r](Fo)};F.hx=function $Kh(){this.Jkb=Zf();this.Akb=-1;this[r](mo)};var Go="beforehide";F.dob=function $Lh(a){return this[r]({type:Go,target:a})};
+F.yV=function $Mh(a){this.Akb=Zf();this[r]({type:no,target:a})};F.mka=function $Nh(a){a=a[y];if(!Zg(this.wa,a)&&(!this.S3a||Zg(this.S3a,a))&&!(Zf()-this.Jkb<150))this.dP(a)};F.j0c=function $Oh(a){if(a[Sb]==27)if(this.dP(a[y])){a[zb]();a[Ec]()}};F.i4b=function $Ph(a){if(this.RNb){var c=Eg(this.wa);if(L||Ng){if((a=c[rk])&&Zg(this.wa,a))return}else if(a[y]!=c)return;Zf()-this.Jkb<150||this.dP()}};F.L=function $Qh(){bo.C.L[z](this);this.na.D();delete this.wa;delete this.na};_B_prog(15)}catch(e){_B_err(e)}
+
+try{H(co,Sn);F=co[w];F.kD=k;F.nZb=0;F.HS=i;F.Ff=function $Rh(a){co.C.Ff[z](this,a);(a=a[Uc](ica)||a.htmlFor)&&this.Pe(this.W().b(a),1)};F.ma=function $Sh(){co.C.ma[z](this);Ef(this.kt,this.HGb,this);var a=this.H();a.w(this,Wn,this.lh);a.w(this.W().cb(),fj,this.h4b,h);Jg&&a.w(this.W().cb(),pj,this.h4b,h)};F.Pe=function $Th(a,c,d,f,g){if(!(a?this.kt.Xb(bf(a)):k)){if(a){c={wa:a,UZa:c,sja:d,Aab:f?pj:fj,jja:g};this.kt.set(bf(a),c);a=c}else a=i;this.Cc()&&this.HGb(a)}};
+F.HGb=function $Uh(a){this.H().w(a.wa,a.Aab,this.D6b)};ek(F,function $Vh(a){if(!(a?this.kt.Xb(bf(a)):k))e(Error(".43"));a=bf(a);this.Cc()&&fka(this,this.kt.J(a));this.kt[Pb](a)});F.Nn=Ge("kD");F.pB=function $Xh(a,c,d){var f=this.Ib();if((f||Zf()-this.nZb<150)&&this.kD)this.Yb();else if(this[r](Fo)){c=Ke(a.UZa)?new en(a.wa,a.UZa):new bka(c,d);d=Ke(a.sja)?a.sja:4;if(!f)Fa(this.b()[x],yd);Wm(this.b(),h);c.If(this.b(),d,a.jja);if(!f)Fa(this.b()[x],ud);this.HS=a.wa;this.dp(-1);this.ra(h)}};
+F.DYa=function $Yh(a,c,d){this.pB({sja:d},a,c)};F.MF=function $Zh(a,c,d){this.pB({sja:d,wa:a,UZa:c},0,0)};F.Yb=function $_h(){this.ra(k);if(!this.Ib()){this.nZb=Zf();this.HS=i}};F.lh=function $0h(){this.Yb()};F.D6b=function $1h(a){for(var c=this.kt.Sb(),d=0;d<c[u];d++){var f=this.kt.J(c[d]);if(f.wa==a[Hb]){this.pB(f,a[kc],a[lc]);a[zb]();a[Ec]();return}}};F.h4b=function $2h(a){this.Ib()&&!this.CJ(a[y])&&this.Yb()};F.oC=function $3h(a){co.C.oC[z](this,a);this.Yb()};
+F.L=function $4h(){co.C.L[z](this);if(this.kt){this.kt[bc]();delete this.kt}};var fla={"":1,n:l.pow(1024,-3),u:l.pow(1024,-2),m:1/1024,k:1024,K:1024,M:l.pow(1024,2),G:l.pow(1024,3),T:l.pow(1024,4),P:l.pow(1024,5)},gla="<wbr>",hla=Jg?"<wbr></wbr>":Ng?"&shy;":gla;var ila=new RegExp("[\u0591-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]"),jla=new RegExp("[A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]"),kla=new RegExp("^[^A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]*[\u0591-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]");U[w].set=function $5h(a){this[bc]();this[R](a)};if(bj){U[w].J4a=0;U[w].append=function $6h(a,c){if(c==i)this.pp[this.J4a++]=a;else{this.pp[p][cd](this.pp,arguments);this.J4a=this.pp[u]}return this}}else U[w].append=function $6h(a,c){this.pp+=a;if(c!=i)for(var d=1;d<arguments[u];d++)this.pp+=arguments[d];return this};Aa(U[w],function $7h(){if(bj){Ia(this.pp,0);this.J4a=0}else this.pp=I});U[w].Lga=function $8h(){return this[t]()[u]};
+Ha(U[w],function $9h(){if(bj){var a=this.pp[kd](I);this[bc]();a&&this[R](a);return a}else return this.pp});O.S().gb(Ph);Ci(O.S(),Ph);Bi(O.S(),"sy110");O.S().gb("sy110");Ci(O.S(),"sy110");var lla="GearsFactory",mla="Gears.Factory",nla="ie_mobile",Ho="beta.localserver";function Io(){if(Jo!=undefined)return Jo;var b=Le("google.gears.factory");if(b)return Jo=b;try{return Jo=new (Le(lla))}catch(a){}try{b=new ActiveXObject(mla);b.getBuildInfo()[Db](nla)!=-1&&b.privateSetGlobalObject(Je);return Jo=b}catch(c){}return Jo=ola()}var pla="gears-factory";
+function ola(){var b=Le(pg);if(b&&b[gd][vb]["application/x-googlegears"])try{var a=b[yc],c=a[ub](pla);if(!c){c=a[Qb](Oe);Ua(c[x],xd);ka(c,Ah);Wa(c,Ah);za(c,"application/x-googlegears");c.id=pla;a[mc][o](c)}if(typeof c[tc]!="undefined")return c}catch(d){}return i}var qla="navigator.mimeTypes";
+function rla(){if(Ko!=undefined)return Ko;var b=Le("google.gears.factory");if(b||Le(lla))return Ko=h;if(typeof ActiveXObject!="undefined")try{new ActiveXObject(mla);return Ko=h}catch(a){return Ko=k}if((b=Le(qla))&&b["application/x-googlegears"])if(b=ola()){Jo=b;return Ko=h}return Ko=k}
+function sla(b){if(!b)e(Error(".44"));b=String(b);var a=b[mb](/[^a-zA-Z0-9\.\-@_]/g,I);if(!a)e(Error(".45`"+b));if(a[u]<=64)return a;for(var c=0,d=0;d<b[u];++d){c=31*c+b[Xc](d);c%=4294967296}b=c;return a[Zc](0,54)+String(b)}Bi(O.S(),"sy16");var tla,ula,vla,wla,xla,yla;yla=xla=wla=vla=ula=tla=k;var Lo=ug();if(Lo)if(Lo[Db]("Firefox")!=-1)tla=h;else if(Lo[Db]("Camino")!=-1)ula=h;else if(Lo[Db]("iPhone")!=-1||Lo[Db]("iPod")!=-1)vla=h;else if(Lo[Db]("Android")!=-1)wla=h;else if(Lo[Db](Faa)!=-1)xla=h;else if(Lo[Db]("Safari")!=-1)yla=h;var zla=L,Ala=tla,Bla=ula,Cla=vla,Dla=wla,Mo=xla,No=yla;var Jo=undefined,Ko=undefined;O.S().gb("sy16");Ci(O.S(),"sy16");function Ela(b,a){return b.coords=a}var Oo="coords";function Fla(b){return 1-l.pow(1-b,3)}function Po(b,a,c,d){if(!Ve(b)||!Ve(a))e(Error(".46"));if(b[u]!=a[u])e(Error(".47"));this.Xma=b;this.UCc=a;this.qw=c;this.WEb=d;Ela(this,[])}function Gla(){Ch[gb](Qo);var b=Zf();for(var a in Ro)Hla(Ro[a],b);Qo=yf(Ro)?i:Ch[xc](Gla,20)}function Ila(b){b=bf(b);delete Ro[b];if(Qo&&yf(Ro)){Ch[gb](Qo);Qo=i}}
+function Hla(b,a){b.wF=(a-b.cq)/(b.eOb-b.cq);if(b.wF>=1)b.wF=1;b.XPb=1E3/(a-b.ykb);b.ykb=a;Ze(b.WEb)?Jla(b,b.WEb(b.wF)):Jla(b,b.wF);if(b.wF==1){b.qa=0;Ila(b);b.Uob();b.oka()}else b.qa==1&&b.Qya()}function Jla(b,a){Ela(b,new Array(b.Xma[u]));for(var c=0;c<b.Xma[u];c++)b[Oo][c]=(b.UCc[c]-b.Xma[c])*a+b.Xma[c]}var Kla="resume";function Lla(b){So(b,Kla)}function So(b,a){b[r](new Mla(a,b))}
+function Mla(b,a){N[z](this,b);Ela(this,a[Oo]);this.x=a[Oo][0];this.y=a[Oo][1];this.iFa=a[Oo][2];this.qw=a.qw;this.wF=a.wF;this.JBd=a.XPb;this.rh=a.qa;this.sAd=a}function To(b,a,c){this.Mk=b;this.Ly=a||0;this.na=c;this.Li=G(this.UN,this)}Bi(O.S(),"sy40");H(Po,uh);var Ro={},Qo=i;F=Po[w];F.qa=0;F.XPb=0;F.wF=0;F.cq=i;F.eOb=i;F.ykb=i;var Nla="play";F.Iv=function $$h(a){if(a||this.qa==0){this.wF=0;Ela(this,this.Xma)}else if(this.qa==1)return k;Ila(this);this.cq=Zf();if(this.qa==-1)this.cq-=this.qw*this.wF;this.eOb=this.cq+this.qw;this.ykb=this.cq;this.wF||this.wV();So(this,Nla);this.qa==-1&&Lla(this);this.qa=1;a=bf(this);a in Ro||(Ro[a]=this);Qo||(Qo=Ch[xc](Gla,20));Hla(this,this.cq);return h};
+Ga(F,function $ai(a){Ila(this);this.qa=0;if(a)this.wF=1;Jla(this,this.wF);So(this,Id);this.oka()});var Ola="pause";F.pause=function $bi(){if(this.qa==1){Ila(this);this.qa=-1;So(this,Ola)}};var Pla="destroy";F.L=function $ci(){this.qa!=0&&this[qc](k);So(this,Pla);Po.C.L[z](this)};var Qla="animate";F.Qya=function $di(){So(this,Qla)};F.wV=function $ei(){So(this,Gaa)};F.oka=function $fi(){So(this,Jd)};var Rla="finish";F.Uob=function $gi(){So(this,Rla)};H(Mla,N);H(To,Jf);F=To[w];F.Xa=0;F.L=function $hi(){To.C.L[z](this);this[qc]();delete this.Mk;delete this.na};Qa(F,function $ii(a){this[qc]();this.Xa=Dh(this.Li,Ke(a)?a:this.Ly)});Ga(F,function $ji(){this.Eb()&&Eh(this.Xa);this.Xa=0});F.Pfa=function $ki(){this[qc]();this.UN()};F.Eb=function $li(){return this.Xa!=0};F.UN=function $mi(){this.Xa=0;this.Mk&&this.Mk[z](this.na)};O.S().gb("sy40");Ci(O.S(),"sy40");Bi(O.S(),"sy19");function Uo(b){b=b.Ga();return b=="buzz"||b=="updates_search"||b=="updates_query_search"};O.S().gb("sy19");Ci(O.S(),"sy19");var Sla="hasPermission";function Vo(){if(Wo!=i)return Wo;var b=Io();if(!b||!b[Sla])Wo=k;else if(Tla)Wo=b[tc](Ho).canServeLocally(Tla);else return k;return!!Wo}Bi(O.S(),"sy15");_B_prog(16)}catch(e){_B_err(e)}
+
+try{var Wo,Tla=i;O.S().gb("sy15");Ci(O.S(),"sy15");function Xo(b,a){this.Js=b;this.jf=a}function Yo(b){this.MA=[];b&&Ula(this,b)}function Vla(b,a,c){var d=b.MA;d[p](new Xo(a,c));b.Imb(d[u]-1)}function Ula(b,a){var c,d;if(a instanceof Yo){c=a.Sb();d=a.Oa();if(a.Nb()<=0){b=b.MA;for(a=0;a<c[u];a++)b[p](new Xo(c[a],d[a]));return}}else{c=xf(a);d=wf(a)}for(a=0;a<c[u];a++)Vla(b,c[a],d[a])}Bi(O.S(),"sy24");Xo[w].Dg=D("Js");Xo[w].Ca=D(Ad);Xo[w].vc=function $pi(){return new Xo(this.Js,this.jf)};F=Yo[w];wa(F,function $qi(){var a=this.MA,c=a[u],d=a[0];if(!(c<=0)){if(c==1)gf(a);else{a[0]=a.pop();this.Emb(0)}return d.Ca()}});F.hQ=function $ri(){var a=this.MA;if(a[u]!=0)return a[0].Ca()};F.Emb=function $si(a){for(var c=this.MA,d=c[u],f=c[a];a<l[rb](d/2);){var g=a*2+1,j=a*2+2;g=j<d&&c[j].Dg()<c[g].Dg()?j:g;if(c[g].Dg()>f.Dg())break;c[a]=c[g];a=g}c[a]=f};F.Imb=function $ti(a){for(var c=this.MA,d=c[a];a>0;){var f=l[rb]((a-1)/2);if(c[f].Dg()>d.Dg()){c[a]=c[f];a=f}else break}c[a]=d};
+F.Oa=function $ui(){for(var a=this.MA,c=[],d=a[u],f=0;f<d;f++)c[p](a[f].Ca());return c};F.Sb=function $vi(){for(var a=this.MA,c=[],d=a[u],f=0;f<d;f++)c[p](a[f].Dg());return c};F.BS=function $wi(a){return Mi(this.MA,function(c){return c.Ca()==a})};F.Xb=function $xi(a){return Mi(this.MA,function(c){return c.Dg()==a})};F.vc=function $yi(){return new Yo(this)};F.Nb=function $zi(){return this.MA[u]};F.nd=function $Ai(){return this.MA[u]==0};Aa(F,function $Bi(){gf(this.MA)});O.S().gb("sy24");Ci(O.S(),"sy24");var Wla=JS_MODE,Zo=alert,ap=screen,bp=navigator;function cp(b,a){return b.onload=a}function Xla(b,a){return b.error=a}function dp(b,a){return b.version=a}function ep(b,a){return b.selection=a}function fp(b,a){return b.navigate=a}function gp(b,a){return b.fontFamily=a}function hp(b,a){return b.selected=a}function ip(b,a){return b.getData=a}function jp(b,a){return b.getDate=a}function Yla(b,a){return b.registerService=a}function kp(b,a){return b.color=a}function lp(b,a){return b.marginLeft=a}
+function mp(b,a){return b.domain=a}function np(b,a){return b.status=a}function op(b,a){return b.focus=a}function pp(b,a){return b.backgroundPosition=a}function Zla(b,a){return b.marginTop=a}function ama(b,a){return b.padding=a}function bma(b,a){return b.moveTo=a}function cma(b,a){return b.getContext=a}function dma(b,a){return b.paddingLeft=a}function qp(b,a){return b.scrollIntoView=a}function rp(b,a){return b.overflow=a}function ema(b,a){return b.whiteSpace=a}
+function fma(b,a){return b.getTime=a}function gma(b,a){return b.borderColor=a}function sp(b,a){return b.fontWeight=a}function hma(b,a){return b.setDate=a}function tp(b,a){return b.setData=a}function up(b,a){return b.scrollTop=a}function vp(b,a){return b.hasFocus=a}function wp(b,a){return b.cursor=a}function xp(b,a){return b.selectedIndex=a}function ima(b,a){return b.complete=a}function jma(b,a){return b.size=a}function yp(b,a){return b.index=a}function zp(b,a){return b.checked=a}
+function Ap(b,a){return b.prompt=a}function kma(b,a){return b.onprogress=a}function Bp(b,a){return b.reload=a}function Cp(b,a){return b.fontSize=a}function Dp(b,a){return b.lineHeight=a}function Ep(b,a){return b.textAlign=a}function lma(b,a){return b.style=a}function Fp(b,a){return b.close=a}function mma(b,a){return b.fontStyle=a}function Gp(b,a){return b.view=a}function Hp(b,a){return b.parent=a}function Ip(b,a){return b.search=a}function nma(b,a){return b.sendMessage=a}
+function Jp(b,a){return b.call=a}function Kp(b,a){return b.colSpan=a}function Lp(b,a){return b.lastIndex=a}function Mp(b,a){return b.href=a}function Np(b,a){return b.marginRight=a}function oma(b,a){return b.onabort=a}function pma(b,a){return b.backgroundImage=a}function Op(b,a){return b.action=a}function qma(b,a){return b.minWidth=a}function Pp(b,a){return b.reset=a}function Qp(b,a){return b.update=a}function Rp(b,a){return b.label=a}function Sp(b,a){return b.description=a}
+function rma(b,a){return b.transform=a}
+var Up="filename",Vp="getItem",sma="valueOf",Wp="alert",Xp="page",Yp="expand",Zp="confirm",aq="field",bq="navigate",cq="reverse",tma="toFixed",uma="onLine",dq="data",eq="content",fq="queryCommandValue",vma="tBodies",gq="selected",hq="getData",iq="getDate",jq="bgColor",kq="registerService",lq="color",wma="marginLeft",mq="domain",nq="write",oq="insertRow",xma="MAX_VALUE",pq="getName",qq="setMonth",rq="fromCharCode",yma="self",sq="setFullYear",tq="moveTo",uq="getContext",zma="translate",Ama="setMinutes",
+vq="source",wq="scrollIntoView",Bma="enabledPlugin",xq="getHours",yq="insertCell",Cma="host",zq="setDate",Aq="setData",Dma="fill",Bq="hasFeature",Cq="getMonth",Dq="caption",Eq="plugins",Fq="hasFocus",Gq="getDay",Hq="selectedIndex",Iq="complete",Jq="sizeToContent",Kq="size",Lq="index",Mq="checked",Nq="prompt",Oq="getSeconds",Ema="getUTCDate",Fma="handle",Pq="scope",Qq="save",Rq="closed",Sq="reload",Tq="message",Gma="hostname",Hma="sender",Uq="PercentLoaded",Vq="separator",Wq="view",Ima="selectionStart",
+Xq="sendMessage",Yq="total",Jma="setSeconds",Zq="anchor",ar="getYear",Kma="checkForUpdate",br="options",cr="link",dr="info",Lma="setProperty",er="protocol",fr="getFullYear",Mma="lastIndex",Nma="marginRight",gr="setTime",Oma="clearInterval",hr="scale",ir="console",jr="action",Pma="setHours",kr="reset",lr="empty",Qma="getUTCHours",Rma="normalize",mr="update",nr="getMinutes",or="fileName",pr="label",qr="description",rr="transform",sr="getTimezoneOffset",tr="xa",Sma="Failed to enable Offline Gmail",ur=
+"cob-matches",Tma="Web Search",Uma="tasksuiloaded",vr="tasks",Vma="Classic",Wma="Friends",wr="^if",Xma="^friends",xr="la",yr="tc",Yma="; ",zr="Sa",Zma="lsmv",Ar="msg",Br="md",ana="mic",bna="yh",cna="Label",dna="Name",Cr="command",Dr="index",ena="HEAD",fna="res",Er=";",gna="lsci",Fr="disconnected",hna="cn",ina=" ou",Gr="mi",Hr="Fd",jna="gl",kna="Go to Label",Ir='" name="',lna="Sent at ",Jr=" ",mna="xd",Lr="xf",nna="kR",ona="JA-Kn-Jr-Kw-Jt",pna="JA-Kn-Jr-Kw-Jn-KO",qna="Remove color",Mr='"></div><div id="',
+Nr="ts",rna=" = ",Or="Reply to all",sna="Recover from Trash",Pr="Ignore",tna="Report phishing",una="Send",vna="Create a new label",wna="Create a filter",xna="Share",yna="Expand all",zna="transliterationConfig",Qr="^act",Ana="Public",Rr="lcv",Sr="plcv",Bna="yH",Cna="dn",Tr="frs",Dna="-iframe",Ur="-1",Vr="visibility",Wr="gwt.hosted",Xr="service",Ena="popupOpensProfiles",Fna="SOURCES",Yr="exp",Zr="alpha",Gna="GB",as="gb",Hna="Ud",bs="Home",cs="Work",ds="Other",Ina="Bt",Jna="Ax",Kna="tx",Lna="ignoreesc",
+Mna="l1",Nna="Af",es="Bj",Ona="sD",Pna="sit",fs="sii",Qna="sim",Rna="fvi",Sna="Za",Tna="Ya",gs="ab",Una="PICK",Vna="EDIT",Wna="disp",Xna="userId",Yna="hide-media",hs="db",Zna="edit",aoa="sources",boa="new_group",coa="26ac",is='" value="',doa='"></span></div>',js="uk",ks="link",eoa="Set status here",foa="uf",goa="Loading&hellip;",hoa="Sign into chat",ioa="Try to connect",ls="Offline",joa='" action="',koa="</table></div>",ms='"><tr class="',ns='</span><span id="',os='" style="display:',loa='">&nbsp; ',
+moa="Invited",ps="<td>",qs="c3",rs="vm",ss="in",ts="1px",noa="vp",ooa="Ae",poa="Ag",qoa="bt",us="sr",roa="Invisible",soa="1m",vs="mp",toa="Available",uoa="Custom Message...",voa="Busy",ws="iv",woa="Sign out of chat",xs="so",xoa="Clear custom messages",ys="de",yoa='"><td>',zs='</td><td id="',zoa="Hide",As='</span><span class="',Aoa="Waiting for ",Boa="stm",Coa="Ok",Doa="csl",Bs='"><img src="images/cleardot.gif" class="',Cs='"/><div class="',Eoa="iOeLLc",Ds='" />',Foa="Hm",Es="Ha",Fs="bottom",Goa="dh",
+Gs="mm",Hs="po",Hoa="Hc",Ioa="Hb",Joa="Hs",Koa="11",Noa="h9",Ooa="results",Poa="Bi",Qoa="ih",Is="drop",Js="dragend",Ks="dragover",Roa="data",Ls="mD",Ms=' <span class="',Soa="mG",Toa="Reply by chat to ",Ns='" idlink>',Uoa=" is not available to chat",Voa="mF",Os='"><img class="',Ps='" src="',Qs="max",Rs="line",Woa="Hebrew",Xoa="Arabic",Yoa="Urdu",Zoa="Persian",apa="\u000c",bpa="English",Ss="</td></tr></table>",cpa=' value="',Ts="</label>",Us="rc",Vs='<select id="',Ws="sA",Xs='</div><div id="',dpa='"><tr><td><div class="',
+Ys='" alt="',Zs="</td></tr></table></div>",at='">(',epa="main",fpa="fwdandpop",bt="general",ct='" target=_blank>',dt="sn",gpa="f0",hpa="nY",et="Saving...",ipa="debug",jpa="cpl",kpa="pm",ft="vs",lpa="en-GB",gt="es",ht="fr",it="hr",mpa="lv",jt="nl",npa="pt-BR",opa="pt-PT",kt="ro",lt="sk",mt="vi",nt="el",ot="iw",ppa="zh-TW",qpa="zh-CN",rpa="ko",pt="+bold",qt="+italic",spa="13px",tpa="18px",upa="32px",rt="+fontName",st="+fontSize",tt="+foreColor",ut="+removeFormat",vt='"><b>',wt="</option>",xt='<input type="checkbox" id="',
+yt='<option value="',vpa=' selected="selected"',wpa="x-small",zt="+underline",At="+backColor",Bt="+link",Ct="+insertOrderedList",Dt="+insertUnorderedList",Et="+outdent",Ft="+indent",Gt="+BLOCKQUOTE",Ht="+justifyLeft",It="+justifyCenter",Jt="+justifyRight",Kt="ei",xpa="imageInserted",ypa="r2",Lt='" title="',zpa="r3",Apa="accounts",Bpa="sx",Mt='"><label for="',Cpa='" disabled>',Dpa="fil",Epa="zh",Fpa='"><input class="',Gpa='" type="text" id="',Nt="vb",Ot="vc",Pt="vd",Hpa="iI",Ipa="cvm",Qt='</span></td><td class="',
+Jpa='<h3 class="',Kpa=" </span>",Lpa="></div>",Rt='<a target=_blank href="',Mpa="</a>.",St="<div ",Tt='"><tr><td>',Npa="Invite ",Opa="io",Ppa='<button class="',Qpa='" type="button">',Vt="</div></div></div>",Wt="</span></td></tr>",Xt="from",Yt="Ca",Zt="</a></span>",Rpa='</span>&nbsp;<span class="',Spa="ho",au='"></span>',Tpa="nw",bu="ap",Upa="://",Vpa="c0",cu="pb",du="qb",eu="lbl",Wpa="rb",fu="mc",gu="oc",Xpa="hO",Ypa="hN",Zpa="hX",hu="hV",iu="hU",aqa="Search Results",ju="zb",ku="ht",bqa="zip",lu=
+"mb",mu="mC",nu="ij",ou="href",cqa="</body></html>",dqa="Try again",pu="</span></span>",eqa="kt",fqa='"><table class="',gqa='" class= "',hqa="b7",iqa="margin-top",jqa="O6",kqa="WcILW",qu="&nbsp;-&nbsp;",ru='<img src="',su="url",lqa="nocache",tu="flickr",uu="unknown",mqa="owner",vu="picasa",wu="Ga",xu="paste",yu="Email",nqa='"></div></td><td class="',oqa="and",pqa='"><a href="',zu="OR",qqa="Iq",Au="Edit",Bu='</div></div><div class="',rqa='<param name="wmode" value="%s"/>',sqa="wmode=%s",tqa="loaded",
+Cu="delete",uqa="Hf",vqa="hS",wqa="cZ",xqa="526",Du="Bb",yqa="Fb",Eu="center",zqa="opaque",Aqa="comment",Bqa="qp",Fu="dY",Cqa="bb",Gu="Gb",Dqa="remote_iframe_",Eqa="Kb",Hu="picker",Iu="Link",Fqa="Retry",Ju='</span></div><div class="',Ku="GC",Gqa="Pb",Hqa="</span></span></div>",Lu='"/>',Iqa='<iframe id="',Jqa="gadgets",Mu="nav",Kqa="rpctoken",Nu=" at ",Lqa=" not found",Mqa="yO",Nqa="zE",Oqa="An unknown error occurred",Ou="er",Pqa="places",Qqa="fetchdone",Rqa="LAUNCH_CHESS",Sqa="import",Tqa="^ii",Uqa=
+"^ib1",Vqa="bK",Wqa='" style="display:none;"><div class="',Xqa="clear",Yqa="</a></div></div>",Zqa="websearch",ara="score",bra="bookmarks",cra="label:",dra='{}()"',era="masthead_selection_event",fra=":me",gra="has attachment images pictures photos jpg",hra="filename:(jpg OR jpeg OR png)",ira="has documents attachment",jra="has videos attachment youtube",kra="filename:(avi OR mov OR mpg OR mpeg OR mp4) OR youtube.com/watch",lra="has calendar event attachment",mra="has calendar event",nra="before date",
+ora="before:yyyy/mm/dd",pra="after date",qra="after:yyyy/mm/dd",Pu="<3",rra='to:me AND ("love you" OR "miss you")',sra="(^| )",Qu='<a id="',tra='" target="_top" class="',ura="ji",vra='<h1 class="',wra="<span class=",xra="bA",Ru=' class="',yra='"><nobr>',Su=" | ",zra="Older version",Ara="</nobr></div>",Bra="Help",Cra='"><a class="',Tu="jt",Dra="ju",Uu="old",Era="?ui=1",Vu="aL",Wu="sg",Xu="toxOdd",Fra="</span></td></tr></table>",Gra="aif",Yu="ac",Zu="Chat",Hra="CX",Ira='">Learn more</a>',Jra="older version",
+Kra="basic HTML",av="mo",bv="oa",cv="ov",Lra="DE",Mra="invite",Nra="p3",Ora="&ov=1",Pra="Search Mail",dv="url(",Qra="no-repeat",Rra="lr",Sra="ftclick",Tra="hideshowchat",Ura="Your attached file was not restored. You will have to reattach it.",Vra="Your attached files were not restored. You will have to reattach them.",Wra="undo",Xra="vsm",Yra="rvs",Zra="channel/",asa="Sponsored Link",bsa='" index="',csa="eq",dsa="Options",ev="</label></div>",fv='"><input id="',gv='"><div>',esa="fss",fsa="skins",gsa=
+"] ",hv="notes",hsa="P2",isa='</div></div></div><div class="',jsa="Wc",ksa="ln",lsa="middle",msa="normal",nsa="canvas",iv="black",osa="0 0",psa=";height:",qsa="src",rsa="e ou",ssa="o8",jv="pe",tsa='<a target="_blank" href="',kv="<br/>",usa=" account.",vsa="Submit",wsa="jsmode",xsa="ah EmPo8b",ysa="cM",zsa="gh",Asa="IL",Bsa="ke",Csa="PS",Dsa="sms",Esa="Send SMS",Fsa="Sign in",Gsa='&nbsp;<span id="',lv="red",mv="white",Hsa="a5",Isa="atc",Jsa="bp",Ksa="dtb",nv=".png",Lsa="hY",ov="hM",pv="hT",qv="hW",
+Msa='"></td></tr><tr class="',Nsa="; color: #",rv="Ad",Osa="Dismiss",Psa="$b",Qsa="-moz-grab",Rsa="ye",Ssa='"><tr><td><div id="',Tsa="yt",Usa="From",Vsa='"></span></div><div id="',Wsa='"></div></div></td></tr></table></div>',sv='" style="display:none">',Xsa="qr",Ysa="Did you mean:",Zsa="iCO6De",ata="This message has been verified as coming from the sender.",tv="gmailgadgets",uv="eb",bta="st=",vv=") ",wv="</select>",cta='"><button id="',xv='</button><button id="',yv="</button></div>",dta="Bd",eta=
+" conversations",zv="scr",fta="standard",Av='" target="_blank" class="',gta="Terms of Service",hta="</a> ",ita="fo",Bv="https:",Cv=").",jta=" &nbsp; ",Dv="Details",kta=" or ",lta="lh",mta="Background Color",nta="Text Color",ota='"></div></td></tr></table>',Ev="cursor",pta="out",qta="tok",rta="op",Fv="sf",sta="&&&START&&&",tta="&&&END&&&",Gv="bc",uta="\"'",Hv="color",Iv="xE",vta="Invite to chat",wta="Call",xta='"></td><td id="',yta="tu",zta="tW",Ata="tG",Bta="tC",Cta="t5",Dta="tB",Eta="tM",Fta="tT",
+Jv="J-N-JE",Gta="Show in chat list:",Hta="Auto",Ita="Always show",Jta="Never show",Kta="tF",Lta="tq",Mta="tO",Kv="Start video chat",Nta="J-N-Kr",Ota="PU",Lv="rhs",Mv="cg",Pta="hc",Qta="v8",Nv="fc",Ov="jc",Pv="kc",Qv="y9",Rta="Remove ",Sta="retry",Rv="$root/gmailgadgets/...",Sv="maximize",Tta='"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="',Uta='"><span>',Tv='"><img src="',Vta="Px",Uv='</label></div><div class="',Vv=
+"ff",Wta="pre",Xta="vid",Yta='"><li>',Zta="</li><li>",aua="You have blocked ",Wv="Block ",bua="Unblock ",cua="Checking...",Xv="<p>",Yv="</p>",dua="dragdrop",eua="nextSibling",fua="previousSibling",gua="ne",hua="kM",iua=" to ",Zv="lk",jua="toolbar=no,location=no,menubar=no,scrollbars=no,resizable=yes,status=no,width=",kua=",left=",lua="ui/ContactPicker",mua="inputId",nua="tempTitle",oua="_picker",pua="fd",qua="UserData",aw="<i>",rua="mailto",sua="Ld",tua="jP",uua="Small",vua="Large",bw="-10000px",
+cw="swf",wua="ShockwaveFlash.ShockwaveFlash.",xua="ContactManager",yua="DISABLE_WINDOW",zua="ENABLE_WINDOW",Aua="_manager",Bua="&nbsp;&nbsp;&nbsp;",Cua="lg",Dua="lf",Eua="childdeactivated",dw="je",Fua=">&nbsp;",ew="me",Gua="apo",Hua="</tr></table>",Iua="View recent conversations",Jua='</div></div><div id="',fw="offline",gw='px">',Kua="stylesheet",hw="mas",Lua="z-index",iw="done",jw="lp",kw="nt",lw="SET",mw="DELETE",nw="SUGGEST",Mua='<ul class="',Nua="tk",Oua=' <select id="',Pua='</span> <span class="',
+ow="_GM_mwm",Qua="bs",Rua="Messages";function Sua(b,a,c){if(b[u]!=a[u])return i;this.jdd=b;for(var d=1;d<b[u];d++)if(b[d]==i)b[d]=b[d-1]+1;else if(c)b[d]+=b[d-1];this.pD=a}function Tua(b){return b[u]==1?Ah+b:b}function pw(b,a,c,d){if(/^\d+px?$/[cb](a))return da(a,10);else{var f=b[x][c],g=b.runtimeStyle[c];b.runtimeStyle[c]=b[il][c];b[x][c]=a;a=b[x][d];b[x][c]=f;b.runtimeStyle[c]=g;return a}}
+function Uua(b){if(44032<=b&&b<=55203){if(b%28==16)return 8;return 9}else{Vua||(Vua=new Sua([0,10,1,2,1,18,95,33,13,1,594,112,275,7,263,45,1,1,1,2,1,2,1,1,56,4,12,11,48,20,17,1,101,7,1,7,2,2,1,4,33,1,1,1,30,27,91,11,58,9,269,2,1,56,1,1,3,8,4,1,3,4,13,2,29,1,2,56,1,1,1,2,6,6,1,9,1,10,2,29,2,1,56,2,3,17,30,2,3,14,1,56,1,1,3,8,4,1,20,2,29,1,2,56,1,1,2,1,6,6,11,10,2,30,1,59,1,1,1,12,1,9,1,41,3,58,3,5,17,11,2,30,2,56,1,1,1,1,2,1,3,1,5,11,11,2,30,2,58,1,2,5,7,11,10,2,30,2,70,6,2,6,7,19,2,60,11,5,5,1,1,
+8,97,13,3,5,3,6,74,2,27,1,1,1,1,1,4,2,49,14,1,5,1,2,8,45,9,1,100,2,4,1,6,1,2,2,2,23,2,2,4,3,1,3,2,7,3,4,13,1,2,2,6,1,1,1,112,96,72,82,357,1,946,3,29,3,29,2,30,2,64,2,1,7,8,1,2,11,9,1,45,3,155,1,118,3,4,2,9,1,6,3,116,17,7,2,77,2,3,228,4,1,47,1,1,5,1,1,5,1,2,38,9,12,2,1,30,1,4,2,2,1,121,8,8,2,2,392,64,523,1,2,2,24,7,49,16,96,33,3311,32,554,6,105,2,30164,4,9,2,388,1,3,1,4,1,23,2,2,1,88,2,50,16,1,97,8,25,11,2,213,6,2,2,2,2,12,1,8,1,1,434,11172,1116,1024,6942,1,737,16,16,7,216,1,158,2,89,3,513,1,2051,
+15,40,8,50981,1,1,3,3,1,5,8,8,2,7,30,4,148,3,798140,255],[1,11,1,10,1,0,1,0,1,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,1,0,2,0,2,0,2,0,2,1,2,0,2,0,2,0,1,0,2,0,2,0,2,0,2,0,2,4,0,2,0,4,2,4,2,0,2,0,2,0,2,4,0,2,0,2,4,2,4,2,0,2,0,2,0,2,4,0,2,4,2,0,2,0,2,4,0,2,0,4,2,4,2,0,2,0,2,4,0,2,0,2,4,2,4,2,0,2,0,2,0,2,4,2,4,2,0,2,0,4,0,2,4,2,0,2,0,4,0,2,0,4,2,4,2,4,2,4,2,0,2,0,4,0,2,4,2,4,2,0,2,0,4,0,2,4,2,4,2,4,0,2,0,3,2,0,2,0,2,0,3,0,2,0,2,0,2,0,2,0,2,0,4,0,2,4,2,0,2,0,2,0,2,0,4,2,4,2,4,2,4,2,0,4,2,0,2,0,4,0,4,0,2,0,2,4,2,
+4,2,0,4,0,5,6,7,0,2,0,2,0,2,0,2,0,2,0,1,4,2,4,2,4,2,0,2,0,2,0,2,0,2,4,2,4,2,4,2,0,4,0,4,0,2,4,0,2,4,0,2,4,2,4,2,4,2,4,0,2,0,2,4,0,4,2,4,2,4,0,4,2,4,2,0,2,0,1,2,1,0,1,0,1,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,4,2,4,0,4,0,4,2,0,2,0,2,4,0,2,4,2,4,2,0,2,0,2,4,0,9,0,2,0,2,0,2,0,2,0,1,0,2,0,1,0,2,0,2,0,2,0,2,4,2,0,4,2,1,2,0,2,0,2,0,2,0,1,2],h));for(var a=Vua.jdd,c=0,d=a[u];d-c>8;){var f=d+c>>1;if(a[f]<=b)c=f;else d=f}for(;c<d;++c)if(b<a[c])break;b=c-1;b=b<0?i:Vua.pD[b];return b}}
+function Wua(b,a){if(b==10&&a==11)return k;if(b==1||b==10||b==11)return h;if(a==1||a==10||a==11)return h;if(b==5&&(a==5||a==6||a==8||a==9))return k;if((b==8||b==6)&&(a==6||a==7))return k;if((b==9||b==7)&&a==7)return k;if(a==2)return k;return h}var qw="`";function rw(b){var a=b[0],c=b[1];b=b[2];a=Number(a);c=Number(c);b=Number(b);if(ia(a)||a<0||a>255||ia(c)||c<0||c>255||ia(b)||b<0||b>255)e(Error(".40`"+a+qw+c+qw+b));a=Tua(a[t](16));c=Tua(c[t](16));b=Tua(b[t](16));return Lj+a+c+b}
+var sw="left",Xua="pixelLeft";function Yua(b,a){return pw(b,Fm(b,a),sw,Xua)}function Zua(b,a,c){b=Uua(b);a=Uua(a);return Wua(b,a)&&!(c&&(b==3||a==4))}var ava="hex",bva="rgb",cva="named";
+function tw(b){var a={};b=String(b);var c=b[xb](0)==Lj?b:Lj+b;if(Nja[cb](c)){a.rA=Mja(c);za(a,ava);return a}else{a:{var d=b[Kb](dva);if(d){c=Number(d[1]);var f=Number(d[2]);d=Number(d[3]);if(c>=0&&c<=255&&f>=0&&f<=255&&d>=0&&d<=255){c=[c,f,d];break a}}c=[]}if(c[u]){a.rA=rw(c);za(a,bva);return a}else if(eva)if(c=eva[b[od]()]){a.rA=c;za(a,cva);return a}}e(Error(".38`"+b))}var fva="Style",gva="Width";
+function hva(b,a){if(Fm(b,a+fva)==xd)return 0;a=Fm(b,a+gva);if(a in iva)return iva[a];return pw(b,a,sw,Xua)}var jva="Left",kva="Right",lva="Top",mva="Bottom";function nva(b,a){if(L){var c=Yua(b,a+jva),d=Yua(b,a+kva),f=Yua(b,a+lva);b=Yua(b,a+mva);return new Bm(f,d,b,c)}else{c=Em(b,a+jva);d=Em(b,a+kva);f=Em(b,a+lva);b=Em(b,a+mva);return new Bm(ak(f),ak(d),ak(b),ak(c))}}function ova(b){if(!b.Cea)b.Cea=Yh(b[t]());return b.Cea}var pva="amp",uw="lt",vw="gt",qva="quot";
+function rva(b){return b[mb](/&([^;]+);/g,function(a,c){switch(c){case pva:return Sf;case uw:return Tf;case vw:return Uf;case qva:return Vf;default:if(c[xb](0)==Lj){c=Number(Ah+c[nc](1));if(!ia(c))return String[rq](c)}return a}})}function sva(b){var a=Je[yc][Qb](Kd);Q(a,b);a[Rma]&&a[Rma]();b=a[Tb][md];Q(a,I);return b}function V(b){return Wf(String(b))}function ww(b,a){return a?b[mb](tva,J):b}
+function xw(b,a){a=a||10;if(a>b[u])b=b;else{for(var c=[],d=0,f=0,g=0,j=0,n=0;n<b[u];n++){var s=j;j=b[Xc](n);s=j>=768&&!Zua(s,j,h);if(d>=a&&j>32&&!s){c[p](b[Zc](g,n),hla);g=n;d=0}if(f)if(j==62&&f==60)f=0;else{if(j==59&&f==38){f=0;d++}}else if(j==60||j==38)f=j;else if(j<=32)d=0;else d++}c[p](b[nc](g));b=c[kd](I)}return b}function uva(b){if(b)try{return tw(b).rA}catch(a){}return i}
+function vva(b,a,c){var d=0,f=0,g=0;if(a==0)g=f=d=c;else{var j=l[rb](b/60),n=b/60-j;b=c*(1-a);var s=c*(1-a*n);a=c*(1-a*(1-n));switch(j){case 1:d=s;f=c;g=b;break;case 2:d=b;f=c;g=a;break;case 3:d=b;f=s;g=c;break;case 4:d=a;f=b;g=c;break;case 5:d=c;f=b;g=s;break;case 6:case 0:d=c;f=a;g=b;break}}return[l[rb](d),l[rb](f),l[rb](g)]}function yw(b){b=Mja(b);return[da(b[nc](1,2),16),da(b[nc](3,2),16),da(b[nc](5,2),16)]}function wva(b){return(b=b[Kb](xva))&&b[0]||i}
+var yva="borderLeft",zva="borderRight",Ava="borderTop",Bva="borderBottom",Cva="borderBottomWidth";function Dva(b){if(L){var a=hva(b,yva),c=hva(b,zva),d=hva(b,Ava);b=hva(b,Bva);return new Bm(d,c,b,a)}else{a=Em(b,ria);c=Em(b,sia);d=Em(b,tia);b=Em(b,Cva);return new Bm(ak(d),ak(c),ak(b),ak(a))}}function Eva(b){return nva(b,Ld)}function zw(b,a){return b[x][lia(a)]}function Fva(b,a){for(var c=a[u],d=0;d<c;d++){var f=c==1?a:a[xb](d);if(b[xb](0)==f&&b[xb](b[u]-1)==f)return b[Zc](1,b[u]-1)}return b}
+function Gva(b,a){var c=b.x-a.x;b=b.y-a.y;return l[jha](c*c+b*b)}function Aw(){return pca(ea,arguments)}function Hva(b,a,c){fi(b);hi(b);a=gi(b,a);if(b.Xb(a)){var d=b.km.J(a);if(Ve(d))b.Cf-=d[u];else b.Cf--}if(c[u]>0){b.km.set(a,c);b.Cf+=c[u]}}function Bw(b,a){return b instanceof Sh?b.vc():new Sh(b,a)}var Iva="..",Jva="./",Kva="/.";
+function Cw(b,a){var c=b.vc(),d=!!a.ul;if(d)c.Pr(a.ul);else d=!!a.DX;if(d)wda(c,a.DX);else d=a.u_();if(d)c.iB(a.Jk());else d=a.UA!=i;var f=a.Vf;if(d)Th(c,a.UA);else if(d=!!a.Vf){if(f[xb](0)!=Md)if(b.u_()&&!b.Vf)f=Md+f;else{b=c.Vf[Sc](Md);if(b!=-1)f=c.Vf[nc](0,b+1)+f}b=f;if(b==Iva||b==He)f=I;else if(!Xf(b,Jva)&&!Xf(b,Kva))f=b;else{f=Mf(b,Md);b=b[Cc](Md);for(var g=[],j=0;j<b[u];){var n=b[j++];if(n==He)f&&j==b[u]&&g[p](I);else if(n==Iva){if(g[u]>1||g[u]==1&&g[0]!=I)g.pop();f&&j==b[u]&&g[p](I)}else{g[p](n);
+f=h}}f=g[kd](Md)}}if(d)c.Or(f);else d=a.Vs[t]()!==I;if(d)c.uo(ova(a.Vs));else d=!!a.N5;d&&Uh(c,a.td());return c}function Lva(b,a){var c=b[Qb](T);Q(c,a);if(c[cc][u]==1)return c[Tb];else{for(b=b.createDocumentFragment();c[Tb];)b[o](c[Tb]);return b}}function Mva(b,a){if(a>=b.lY[u])e(Error(".8"));if(b.lY[u]<b.Elb)return a;return(b.wya+Number(a))%b.Elb}function Nva(b,a){var c=b.Nb(),d=[];for(a=b.Nb()-a;a<c;a++)d[a]=b.J(a);return d}function Ova(b){return b==i?I:String(b)}
+function Dw(b,a){return(new Array(a+1))[kd](b)}var Pva="document";function Ew(b){if(Xf(b,Sf))return Pva in Je&&!Xf(b,Tf)?sva(b):rva(b);return b}var Fw="<br />";function Gw(b,a){return b[mb](/(\r\n|\r|\n)/g,a?Fw:sl)}function Hw(b,a){lf[el][z](b,a||fm)}function Qva(b){for(var a=[],c=0,d=0;d<b[u];d++){for(var f=b[Xc](d);f>255;){a[c++]=f&255;f>>=8}a[c++]=f}return a}function Iw(b){this.Db=b}function Jw(b,a){return xw(String(b),a)}
+function Kw(b,a){function c(){}maa(c,b);b=new c;for(var d in a)b[d]=a[d];return b}var Rva="\u200f",Sva="\u200e",Tva="$&";function Uva(b,a){a=(a===undefined?ila[cb](ww(b,void 0)):a)?Rva:Sva;return b[mb](Vva,a+Tva+a)}function Lw(b,a,c){this.xS=b||[];ao[z](this,i,a||Yn.S(),c);this.Q1(this.xS)}
+function Wva(b,a,c,d){c=c||function(C,M){return C==M};d=d||function(C){return b[C]};for(var f=b[u],g=a[u],j=[],n=0;n<f+1;n++){j[n]=[];j[n][0]=0}for(var s=0;s<g+1;s++)j[0][s]=0;for(n=1;n<=f;n++)for(s=1;s<=f;s++)j[n][s]=c(b[n-1],a[s-1])?j[n-1][s-1]+1:l.max(j[n-1][s],j[n][s-1]);var v=[];n=f;for(s=g;n>0&&s>0;)if(c(b[n-1],a[s-1])){v[ld](d(n-1,s-1));n--;s--}else if(j[n-1][s]>j[n][s-1])n--;else s--;return v}function Mw(b,a,c){return l.min(l.max(b,a),c)}function Xva(b){return l[rb](l[Tc]()*b)}
+function Nw(b){Hn[z](this,Gn.S(),b)}function Yva(b,a){if(b.mv){var c=b.Lk(),d=b.Cc();b.xQa=a;var f=b.Lk();if(d){b.xQa=c;xja(b,k);b.xQa=a;b.Hga().Pe(f);xja(b,h)}}else e(Error(".37"))}function Zva(b,a){b=new b;b.Qb=function $Ci(){return a};return b}function awa(b,a){b.kb=a}function Ow(b,a,c,d,f,g){c.hb(a,d,f,g||b.na,b);return b}function Pw(b,a,c,d,f,g){c.w(a,d,f,g||b.na,b);return b}
+function Qw(b){if(b[rc]&&!b[Bc]||b[Eb]||b[Sb]>=112&&b[Sb]<=123)return k;switch(b[Sb]){case 18:case 16:case 17:case 19:case 20:case 27:case 33:case 34:case 36:case 35:case 37:case 39:case 38:case 40:case 45:case 144:case 93:case 44:return k;default:return h}}function bwa(b,a){gn(b,ro,a?a.id:I)}function Rw(b){return b[x][nl]!=xd}function cwa(b,a){b=Pm(b);a=Pm(a);return new xg(b.x-a.x,b.y-a.y)}function Sw(b){return Nm(b).y}function Tw(b){return new xg(b[Vk],b[ol])}
+function Uw(b,a,c){b.vea&&b.bk[b.vea].kW(b.bk[b.vea].G9a,a,c)}function Vw(b,a,c,d,f,g,j){var n=b.bk[a];if(n.hc()){c=new Wda(c,d);j?c[hd](b.Zxa):ba[xc](G(c[hd],c),0)}else if(ef(b.eF,a)||ef(b.rI,a)){c=n.Lr(c,d);if(g){b.U2[p](a);Ai(b)}}else{c=n.Lr(c,d);if(!f){g&&b.U2[p](a);aea(b,a)}}return c}function Ww(b,a,c){var d=new ui;ba[xc](G(b.xSc,b,a,d),c||0);return d}function Xw(b,a){return b.bk[a]}function dwa(b){return b.HC}function Yw(b,a,c){return vi(b,i,a,c)}function Zw(b,a,c){return vi(b,a,i,c)}
+function ewa(b,a){var c=b.eE[u];b.eE[c]=a;b.dna[c]=[];for(var d=0;d<b.pDa[u];d++){var f=Vj(b.pDa[d],a);b.dna[c][d]=f}}function ax(b,a,c){li(b,a,c,pi)}function bx(){var b=Mj.Vf;return fwa[cb](b)||gwa[cb](b)||hwa[cb](b)||iwa[cb](b)}var cx="/a/",jwa="/../c/",kwa="/c/",lwa="../c/",dx="c",mwa="/contacts/",nwa="../",owa="/contacts";
+function pwa(b,a,c,d,f,g,j){a=a&&Mf(b.Vf,cx);b=b.Vf;if(d)if(g||f)c=b[mb](/\/(?=b\/[^/]+)/,a?jwa+c+Md:kwa);else{c=a?lwa+c:dx;if(j)c=b+(Nf(b,Md)?I:Md)+c}else if(g||f){c=b;c=a?c[mb](/\/(?=b\/[^/]+)/,mwa):c+(Nf(c,Md)?I:Md)+Nd}else{c=a?nwa+c+owa:Nd;if(j)c=b+(Nf(b,Md)?I:Md)+c}if(Nf(c,Md))c=c[Zc](0,c[u]-1);return new Sh(c)}var qwa="photos/",rwa="sml",swa="=1",ex="rp",twa="pld";function uwa(b,a,c,d,f){b=[qwa,Qf(b),Kj,f?Hj:Yf()];a&&b[p](Sf,rwa,swa);c&&b[p](Sf,ex,swa);d&&b[p](Sf,twa,swa);return b[kd](I)}
+function vwa(b,a){b=b[Kb](Vh);a=a[Kb](Vh);return b[3]==a[3]&&b[4]==a[4]}function fx(b,a){b instanceof Sh||(b=Bw(b));a instanceof Sh||(a=Bw(a));return Cw(b,a)}function gx(b,a,c){Xh(b);delete b.DG;Ve(c)||(c=[String(c)]);Hva(b.Vs,a,c);return b}function wwa(b){return b.Vf}var xwa="$1";function ywa(b,a){for(var c=b[Pc](gka),d=0,f,g=[];(f=Qha(b,d,a,c))>=0;){g[p](b[Zc](d,f));d=l.min(b[Db](Sf,f)+1||c,c)}g[p](b[nc](d));return g[kd](I)[mb](zwa,xwa)}
+function hx(b,a,c){b=[b,Sf,a,ei,Qf(c)];if(b[1]){a=b[0];c=a[Db](Lj);if(c>=0){b[p](a[nc](c));b[0]=a=a[nc](0,c)}c=a[Db](Kj);if(c<0)b[1]=Kj;else if(c==a[u]-1)b[1]=undefined}return b[kd](I)}function Awa(b){var a=b[Db](Lj);return a<0?b:b[nc](0,a)}function Bwa(b){var a=b[Db](Lj);return a<0?i:b[nc](a+1)}function Cwa(){for(;oda[u];)oda.pop().D()}
+var Dwa="No Error",Ewa="Access denied to content document",Fwa="File not found",Gwa="Firefox silently errored",Hwa="Application custom error",Iwa="An exception occurred",Jwa="Http response at 400 or 500 level",Kwa="Request was aborted",Lwa="Request timed out",Mwa="The resource is not available offline",Nwa="Unrecognized error code";
+function Owa(b){switch(b){case 0:return Dwa;case 1:return Ewa;case 2:return Fwa;case 3:return Gwa;case 4:return Hwa;case 5:return Iwa;case 6:return Jwa;case 7:return Kwa;case 8:return Lwa;case 9:return Mwa;default:return Nwa}}function ix(b){return eval(gg+b+xh)}function jx(b,a,c,d){var f=jh;if(a in f){f=f[a];if(c in f)return rh(f[c],b,a,c,d)}return h}
+function Pwa(b,a,c){b=bf(b);var d=lh[b];if(d){var f=Ke(a),g=Ke(c);if(f&&g){d=jh[a];return!!d&&!!d[c]&&b in d[c]}else return f||g?Mi(d,function(j){return f&&j[Zb]==a||g&&j[Fb]==c}):h}return k}function kx(b,a){return Lva(b.ki,a)}function lx(b){return ea[Qb](b)}function Qwa(b){return gm(Cg((b||Je||ba)[yc]))}function mx(b,a){m(b,a)}function Rwa(b,a){if(b==a)return h;if(!b||!a)return k;return b.x==a.x&&b.y==a.y}function Swa(b){this.Elb=b||100;this.lY=[]}
+function nx(b,a,c){b=Ke(c)?b[tma](c):String(b);c=b[Db](He);if(c==-1)c=b[u];return Dw(Ah,l.max(0,a-c))+b}var Twa="\\$1",Uwa="\\x08";function ox(b){return String(b)[mb](/([-()\[\]{}+?*.$\^|,:#<!\\])/g,Twa)[mb](/\x08/g,Uwa)}function px(b,a,c){if(c)b=Ew(b);if(b[u]>a)b=b[Zc](0,a-3)+lg;if(c)b=Wf(b);return b}var Vwa=" &#160;";function qx(b,a){return Gw(b[mb](/ /g,Vwa),a)}function rx(b,a){b=String(b)[od]();a=String(a)[od]();return b<a?-1:b==a?0:1}function sx(b){return im(Ova(b))}
+function tx(b){return b[mb](/[\s\xa0]+/g,J)[mb](/^\s+|\s+$/g,I)}var Wwa="$$$$";function ux(b){for(var a=1;a<arguments[u];a++){var c=String(arguments[a])[mb](/\$/g,Wwa);b=b[mb](/\%s/,c)}return b}function Xwa(b,a,c){if(typeof b[Aaa]==Se)return b[Aaa](a,c);if(We(b)||Ye(b))return Mi(b,a,c);for(var d=Df(b),f=Cf(b),g=f[u],j=0;j<g;j++)if(a[z](c,f[j],d&&d[j],b))return h;return k}
+function Ywa(b,a,c){if(typeof b[Ya]==Se)return b[Ya](a,c);if(We(b)||Ye(b))return Di(b,a,c);var d,f=Df(b),g=Cf(b),j=g[u];if(f){d={};for(var n=0;n<j;n++)if(a[z](c,g[n],f[n],b))d[f[n]]=g[n]}else{d=[];for(n=0;n<j;n++)a[z](c,g[n],undefined,b)&&d[p](g[n])}return d}function Zwa(b){var a={};for(var c in b)a[c]=b[c];return a}function axa(b,a,c){b=em(b);try{for(;;)if(a[z](c,b[Rk](),undefined,b))return h}catch(d){if(d!==Ni)e(d)}return k}function vx(b){if(Ve(b))return mf(b);return nf(b)}
+function bxa(b,a,c){a=lm(b,a,c);if(a>=0){kf(b,a);return h}return k}function cxa(b,a,c){var d;arguments[u]==2||(d=ff(b,c))<0?b[p](a):km(b,a,d)}function dxa(b,a,c,d){if(b.reduce)return d?b.reduce(G(a,d),c):b.reduce(a,c);var f=c;Ff(b,function(g,j){f=a[z](d,f,g,j,b)});return f}function exa(b){return typeof b==ig}function wx(b){return b===i}function xx(){}function yx(b,a){b.C||H(b,xx);a.Fea=b;b.lBd=a}
+function zx(b,a,c){b.C||H(b,a);c=c||0;b.rMb=c;if(a.UD){a=a.UD;for(var d=0,f=a[u]-1;d<=f;){var g=d+f>>1;if(c>a[g].rMb)f=g-1;else d=g+1}d<a[u]&&a[d].rMb==c&&++d;a[jd](d,0,b)}else a.UD=[b]}function Ax(b,a,c){b.OAc=h;zx(b,a,c)}function fxa(b){for(var a=b[Sk];a&&!a.Fea;)a=a.C&&a.C[Sk];if(!a.Fea.sMb)a.Fea.sMb=gxa(a);return new a.Fea.sMb(b)}
+function gxa(b){function a(n){arguments[Hc].C[Sk][z](this,n);var s=this.UD[u];this.SJ=[];for(var v=0;v<s;++v)this.UD[v].OAc||(this.SJ[v]=new this.UD[v](n))}var c=b.Fea;H(a,c);for(var d=[];b;){if(c=b.Fea){c.UD&&of(d,c.UD);c=c[w];for(var f in c)if(c[Kc](f)&&Ze(c[f])&&c[f]!==b){var g=!!c[f].Vd,j=hxa(f,c,d,g);if(g=ixa(f,c,j,g))a[w][f]=g}}b=b.C&&b.C[Sk]}a[w].UD=d;return a}function hxa(b,a,c,d){for(var f=[],g=0;g<c[u];++g)if(c[g][w][b]!==a[b]){f[p](g);if(d)break}return f}
+function ixa(b,a,c,d){return c[u]?d?function(){var f=this.SJ[c[0]];return f?f[b][cd](this.SJ[c[0]],arguments):this.UD[c[0]][w][b][cd](this,arguments)}:a[b].ic?function(){var f;a:{f=Array[w][lb][z](arguments,0);for(var g=0;g<c[u];++g){var j=this.SJ[c[g]];if(j=j?j[b][cd](j,f):this.UD[c[g]][w][b][cd](this,f)){f=j;break a}}f=k}return f}:a[b].Rn?function(){var f;a:for(var g=Array[w][lb][z](arguments,0),j=0;j<c[u];++j){var n=this.SJ[c[j]];n=n?n[b][cd](n,g):this.UD[c[j]][w][b][cd](this,g);if(Ue(n)){f=n;
+break a}}return f}:a[b].Ka?function(){for(var f,g=Array[w][lb][z](arguments,0),j=0;j<c[u];++j){var n=this.SJ[c[j]];n?n[b][cd](n,g):this.UD[c[j]][w][b][cd](this,g)}return f}:function(){for(var f=Array[w][lb][z](arguments,0),g=[],j=0;j<c[u];++j){var n=this.SJ[c[j]];g[p](n?n[b][cd](n,f):this.UD[c[j]][w][b][cd](this,f))}return g}:!d&&!a[b].ic&&!a[b].Rn&&!a[b].Ka?jxa:i}function jxa(){return[]}function Bx(b){if(!b.aa){b.aa=fxa(b);if(!b.tn)b.tn=kxa}}function kxa(b){return this.aa.tn(b)}
+function lxa(b,a){this.V=b;this.Aa=a||i}function Cx(b){return b.J(ag)}function Dx(b){return b.Aa}function mxa(b){this.O=b;this.O[2]=this.O[2]||[];this.O[21]=this.O[21]||[]}var nxa="data_b:",oxa="data:";function Ex(b,a,c,d){N[z](this,(d?nxa:oxa)+a);this.QLb=a;this.Pg=b;ma(this,c)}function Fx(b){return oxa+b}function Gx(b){return nxa+b}function Hx(b,a){this.Jb=b;if(this.tQc){this.KG=Od+this.Jb;this.mb=this}else this.mb=a}function Ix(b){if(b.Pc)e(Error(".51`"+b.KG))}
+function Jx(b){Hf[z](this);this.Um=b}function pxa(b,a){for(var c=b.Sb(),d=0;d<c[u];d++)qxa(b,c[d]);Jx.C[bc][z](b);if(a){a=b.Um.mb;a.Qf();try{for(d=0;d<c[u];d++)b.FKa(c[d])}finally{a.Mf()}}}function qxa(b,a){if(b.msa){var c=b.msa.J(a);if(c){oh(c);b.msa[Pb](a)}}}function Kx(b,a){Hx[z](this,b,a);this.lI=new Jx(this)}var Lx="domainInfo",rxa="adc";function sxa(b,a){Kx[z](this,Lx,b);this.Kk().w(a,Gx(rxa),this.k0c)}function txa(){this.MI=[];this.CM={}}function uxa(){this.Yka=new txa;this.yu=new Hf}
+function Mx(){vxa||(vxa=new uxa);return vxa}function Nx(b,a,c,d){var f=b.yu.J(a);d=d||0;c={Tfa:c,KL:d};if(f)if(d<wm(f).KL)f[p](c);else for(b=0;b<f[u];b++){if(d>=f[b].KL){f[jd](b,0,c);break}}else{f=[c];b.yu.set(a,f)}}function wxa(b){this.O=b;this.O[1]=this.O[1]||[];this.yr=[];for(b=0;b<this.O[1][u];b++)this.yr[b]=new xxa(this.O[1][b])}function yxa(b){this.O=b}function zxa(b){this.O=b;if(this.O[1])this.jld=new yxa(this.O[1])}
+function xxa(b){this.O=b;this.O[1]=this.O[1]||[];this.iv=[];for(b=0;b<this.O[1][u];b++)this.iv[b]=new zxa(this.O[1][b])}var Ox="'",Px="\\";function Qx(b){for(var a=I,c=I,d=0;d<b[u];){var f=Axa(b,d);if(f[xb](0)==Tf&&f[Db](Uf)!=-1){c=f[Db](Uf);c=f[Zc](1,c)}else if(c==I)a+=f;d+=f[u]}if(c==I&&a[Db](vh)!=-1){c=a;a=I}a=tx(a);a=Fva(a,Ox);a=Fva(a,Vf);a=a[mb](/\\\"/g,Vf);a=a[mb](/\\\\/g,Px);c=tx(c);return[a,c]}
+function Bxa(b){for(var a=[],c=I,d,f=0;f<b[u];){d=Axa(b,f);if(d==wj){im(c)||a[p](Qx(c));c=I;f++}else{c+=d;f+=d[u]}}im(c)||a[p](Qx(c));return a}var Cxa="\u202a",Dxa="\u202c";function Exa(b){return Li(b,function(a){a=Qx(a);return a[0]+J+Uva(Cxa+a[1]+Dxa)})}function Fxa(b,a){if(b[xb](a)!=Vf)return k;var c=0;for(a=a-1;a>=0&&b[xb](a)==Px;a--)c++;return c%2!=0}
+function Axa(b,a){var c=b[xb](a),d='"<(['[Db](c);if(d==-1)return c;if(Fxa(b,a))return c;d='">)]'[xb](d);for(var f=b[Db](d,a+1);f>=0&&Fxa(b,f);)f=b[Db](d,f+1);return f>=0?b[Zc](a,f+1):c}function Rx(b,a,c){Xla(this,b);mp(this,a);this.XI=c}var Gxa='"=" is not allowed.',Hxa="Spaces are not allowed.",Ixa="Address is malformed.",Jxa='Only one "@" is allowed.',Kxa="No username specified.",Lxa="Invalid domain specified.";
+function Sx(b){if(b[Db](ei)!=-1)return new Rx(Gxa);else if(b[Db](J)!=-1)return new Rx(Hxa);else if(b[Db](vh)==-1||b[Db](He)==-1||b[Sc](He)<b[Db](vh))return new Rx(Ixa);else{b=b[Cc](vh);if(b[u]!=2)return new Rx(Jxa);else if(b[0][u]==0)return new Rx(Kxa);for(var a=b[1][Cc](He),c=k,d=0;d<a[u];d++)if(a[d][u]==0){c=h;break}if(b[1][u]<4||a[u]<2||c)return new Rx(Lxa)}return new Rx(i,b[1],b[0])}
+function Mxa(b,a,c){if(!b&&!a)return h;else if(!b||!a)return k;var d=Tx(b[od](),vh);b=d[0][od]();var f=d[1][od]();d=Tx(a[od](),vh);a=d[0];d=d[1];if(!(f==d||Nxa(f)&&Nxa(d)))return k;b=Tx(b,tl)[0];if(c)b=b[mb](Oxa,I);a=Tx(a,tl)[0];if(c)a=a[mb](Oxa,I);return b==a}function Tx(b,a){a=b[Db](a);return a>=0?[b[Zc](0,a),b[Zc](a+1)]:[b,I]}var Ux="gmail.com";function Nxa(b){if(!b)return k;b=b[od]();return b==Ux||b=="googlemail.com"}var Pxa="@(?!",Qxa="$)";
+function Vx(b){var a=h;b=Bxa(b);for(var c=0;c<b[u];c++)a=a&&!(Rxa||(Rxa=new RegExp(Pxa+Tx(Hi,vh)[1]+Qxa,ii)))[cb](b[c][1]);return a}function Sxa(b){this.O=b;this.O[1]=this.O[1]||[];this.HHb=[];for(b=0;b<this.O[1][u];b++)this.HHb[b]=new Txa(this.O[1][b])}function Txa(b){this.O=b}function Uxa(b,a){switch(a){case 1:return b%4==0&&(b%100!=0||b%400==0)?29:28;case 5:case 8:case 10:case 3:return 30}return 31}function Vxa(b,a){a=a||new Date;return b[iq]()==a[iq]()&&Wxa(b,a)}
+function Wxa(b,a){a=a||new Date;return b[Cq]()==a[Cq]()&&Xxa(b,a)}function Xxa(b,a){a=a||new Date;return b[fr]()==a[fr]()}var Wx="y",Xx="m",Yx="h",Zx="n";function ay(b,a,c,d,f,g){if(Ye(b)){this.cJ=b==Wx?a:0;this.RH=b==Xx?a:0;this.hs=b==Pd?a:0;this.zs=b==Yx?a:0;this.Zw=b==Zx?a:0;this.zx=b==ki?a:0}else{this.cJ=b||0;this.RH=a||0;this.hs=c||0;this.zs=d||0;this.Zw=f||0;this.zx=g||0}}
+function by(b,a,c){if(mm(b)){this.Od=new Date(b,a||0,c||1);Yxa(this,c||1)}else if(af(b)){this.Od=new Date(b[fr](),b[Cq](),b[iq]());Yxa(this,b[iq]())}else{this.Od=new Date;this.Od[Pma](0);this.Od[Ama](0);this.Od[Jma](0);this.Od.setMilliseconds(0)}}var cy="Z";function Zxa(b){b=b[sr]();if(b==0)b=cy;else{var a=l.abs(b)/60,c=l[rb](a);a=(a-c)*60;b=(b>0?Qd:tl)+nx(c,2)+xj+nx(a,2)}return b}function Yxa(b,a){if(b[iq]()!=a){a=b[iq]()<a?1:-1;b.Od.setUTCHours(b.Od[Qma]()+a)}}
+function dy(b,a,c,d,f,g,j){this.Od=mm(b)?new Date(b,a||0,c||1,d||0,f||0,g||0,j||0):new Date(b?b[hc]():Zf())}function aya(b,a,c){this.ud=b;this.eQ=a;this.s8a=c}var ey="z";function fy(b){return b.J(ey)}function gy(b){return fy(b)}function bya(b){this.O=b}function cya(b){this.O=b}var dya="user";function eya(b){Kx[z](this,dya,b)}var fya="ugn",gya="udc";function hya(b,a){eya[z](this,b);b=this.Kk();b.w(a,Gx(Oj),this.b9c);b.w(a,Gx(fya),this.E1c);b.w(a,Fx(gya),this.f_c)}
+function iya(b){b=b[nc](1);return b[Cc](Md)}function hy(b,a,c){Hx[z](this,b,a?a.mb:i);a&&a.ha(this);if(this.dQa=Boolean(c)){b=this.mb.g1;b.ela.set(this.Je(),this);this.Hkb=b.CLb}}function iy(b,a){Ix(b);return b.bf?b.bf.J(a):i}function jy(b,a,c){Ix(b);Ve(a)||(a=a[Cc](Md));if(a[u]==0)return i;b=b;for(var d=0;d<a[u];d++){b=b.za(a[d],c);if(b==i)return i}return b}var ky="LOADED",ly="VALID";function my(b){Ix(b);if(!(b.Dv==ky&&b.Lz==ly&&!b.Vwa)){b.Dv=ky;b.Lz=ly;b.Vwa=k;ny(b)}}var oy="p";
+function jya(b,a){if(b.QN)if(Ze(b.QN.Raa))b.QN.Raa(i);else{var c=b.Q;c&&c.hb(b.QN,oy,b.bva)}b.QN=a;if(b.QN)Ze(b.QN.Raa)?b.QN.Raa(b):b.Kk().w(b.QN,oy,b.bva)}function kya(b,a,c){b.QN==a&&ny(b,c)}function lya(b){if(b.Lz!=ly){b.Lz=ly;b.mb.O5b(b)}}function mya(b,a){Ix(b);jya(b,i);b.Vwa=h;if(a)b.Lz=ly;ny(b)}function ny(b,a){Ix(b);b.mb.a9a(b,a)}function py(b,a,c,d){hy[z](this,b,a,c);this.qBc=!!d}function nya(b){lya(b)}var oya="True";
+function qy(b,a){this.Jb=b;this.jf=a;b=b[xb](0);if(b==Ph)this.jf=typeof this.jf==Xe?this.jf==jg||this.jf==oya||this.jf==Hj:!!Number(this.jf);else if(b==ii)this.jf=Number(a)}function ry(b,a){hy[z](this,b,a)}function pya(b){this.sAa=b}var qya="prefs";function rya(b){hy[z](this,qya,b);Bx(this);this.RZb={}}function sya(b,a,c){Ix(b);a=a[Cc](Md);for(var d=0;d<a[u];d++)a[d]=Qf(a[d]);return jy(b,a,c)}
+function sy(b){this.Xa=tya(b,0);this.ae=tya(b,1);this.mO=b[2];this.V_b=ty(b[3]);this.Ifc=ty(b[4]);this.Me=tya(b,5);this.wGb=ty(b[6]);this.cic=ty(b[7]);this.Rj=tya(b,8);this.qCc=ty(b[9]);this.j2b=ty(b[10]);this.Lsc=ty(b[11]);Mx().Kh(190,this,b);b=uya.Oa();for(var a=0;a<b[u];a++){var c=b[a];this.mO[c]=ty(this.mO[c])}}function tya(b,a){b=b[a];return b==i?I:String(b)}function ty(b){return b==Hj||b==jg||b==1||b===h}function uy(b,a){hy[z](this,b,a);this.dbb=[]}var vya="uiprefs/";
+function wya(b){this.sAa=b;this.hVa=vya}var vy="fi",xya="cp",yya="cmp";function wy(b){var a=Dx(Cx(b)),c=a.za(qya),d=a.za(dya);this.Aa=a;this.rl=c;this.ojc=d;this.Mk=new kn(this);this.Trb=[];b=fy(b).ud;ih(b,Gx(oy),this.oza,k,this);ih(b,Gx(vy),this.oza,k,this);ih(b,Gx(xya),this.oza,k,this);ih(b,Gx(yya),this.oza,k,this);ih(b,Gx(wo),this.oza,k,this)}var xy="ha";function yy(b){return b.J(xy)}var zya=":udc";
+function Aya(b){if(!b.nOc){if(b.ojc.Ca(gya))b.J9=h;else{b.Mk.w(b.Aa.Ya(),b.ojc.Je()+zya,b.Xqb);b.J9=k}b.nOc=h}var a=new ui;b.J9?a.ad(b.rl):b.Trb[p](a);return a}function Bya(b){for(var a=[],c=Cya.Oa(),d=0;d<c[u];d++){var f=c[d];a[p]([f,b.db(f)])}return a}var Dya="filters/";function Eya(b,a,c){zy(b,b.rl);return jy(b.rl,Dya+a,c)}function Ay(b,a){zy(b,b.rl);b=Fya(b,a);var c;if(b&&(c=b.J()))return c.Ca();return i}var Gya="clips";function Fya(b,a){zy(b,b.rl);return b.rl.za(Gya+a)}var By="cm2",Hya="uiprefs";
+function Cy(b,a){return(kba(Iya,a)?By:Hya)+Md+a}function zy(b,a){if(a.Pc)e(Error(".51`"+a.Je()))}function Dy(b){return function(){return b}}function Ey(b){return b}function Jya(){var b=arguments,a=b[u];return function(){var c;if(a)c=b[a-1][cd](this,arguments);for(var d=a-2;d>=0;d--)c=b[d][z](this,c);return c}}function Kya(){this.Pd={}}function Lya(b){return b?Qf(b)[mb](/%20/g,tl):I}function Mya(b){return Ywa(b,function(a){return!!a})}
+function Nya(b,a){for(var c=[],d=a.Sb(),f=0;f<d[u];f++){var g=d[f],j=a.J(g);(j=b.J(j))&&c[p](g+ei+Lya(j))}return c[kd](Sf)}function Oya(b,a){var c=b[Cc](Sf);b=new Hf;for(var d={},f=0;f<c[u];f++){var g=c[f][Cc](ei);b.set(g[0],Rf(String(g[1])))}c=b.Sb();for(f=0;f<c[u];f++){g=c[f];var j=a.J(g);if(b.Xb(g))d[j]=b.J(g)}return d}var Fy="search";
+function Gy(b,a){this.Xd=b;a=a?Mya(a):i;this.Fn=new Hf;a&&this.Fn.Vl(a);this.Fn.set(Fy,b);a=this.Fn;var c=[];c[p](Fy);c[p](b);if(a){b=a.Sb()[el]();for(var d=0;d<b[u];d++){var f=b[d];if(f!=Fy){c[p](Qf(f[od]()));c[p](Qf(a.J(f)))}}}this.Js=c[kd](vh);Hy.Aqb(this)}function Iy(b,a){Xh(a);Pya(b,a.Of());return a}function Pya(b,a){for(var c=b.Fn.Sb(),d=0;d<c[u];d++){var f=c[d];a.set(f,b.Fn.J(f))}return a}function Qya(b,a){return!!(!b&&!a||b&&a&&b.Dg()==a.Dg())}var Jy="query",Ky="q";
+function Rya(b){Gy[z](this,Jy,b);this.ae=this.Rc(Ky)}function Ly(b){var a={};a.q=b;return new Rya(a)}var Oy="adv";function Sya(b){Gy[z](this,Oy,b)}var Tya="as_subset";function Uya(b){return b.Rc(Tya)}var Py="cat";function Vya(b){Gy[z](this,Py,b);this.nn=this.Rc(Py)}function Wya(b){var a={};a.cat=b;return new Vya(a)}var Xya="ct_id";function Yya(b){Gy[z](this,Nd,b);this.CN=this.Rc(Xya)}function Qy(b){Gy[z](this,ul,b)}var Zya="str";
+function aza(b,a){var c=a.J(Fy);if(c in b.QCa)return b.QCa[c];else switch(c){case Jy:b=a.J(Ky);a=a.J(Zya);c={};c.q=b;if(a)c.str=a;return new Rya(c);case Py:a=a.J(Py);return Wya(a);case Nd:a=a.J(Xya);b={};b.ct_id=a;return new Yya(b);case Oy:b=new Hf;c=bza.Sb();for(var d=0;d<c[u];d++){var f=cza[c[d]],g=a.J(f);Ke(g)&&b.set(f,g)}return new Sya(b);case ul:b=new Hf;c=dza.Sb();for(d=0;d<c[u];d++){f=eza[c[d]];b.set(f,a.J(f))}return new Qy(b)}return i}function Ry(b,a){Sy.Ezb[b]=a}var Ty="^";
+function Uy(b){return Mf(b,Ty)?Sy.Ezb[b]:Wya(b)}function Vy(b){var a=Mf(b,Ty)?Sy.Ezb[b]:i;return a?a.Iga():b}function Wy(b){Sy.QCa[b.Ga()]=b}function Xy(b){if(b&&b.Dd)return b.Dd();return i}var Yy="spam",Zy="trash";function fza(b){b=b.Ga();return b==Yy||b==Zy}var az="apps";function gza(b){b=b.Ga();return b==Oy||b==ul||b==Jy||b==az||b==Nd}function hza(b,a){b=new b[Sk](a);return b=Hy.f_(b.Dg())}function bz(b,a){Gy[z](this,b,a)}var cz="all";function dz(b){Gy[z](this,cz,b)}var ez="archive";
+function iza(b){Gy[z](this,ez,b)}var fz="chats";function gz(b){Gy[z](this,fz,b)}var jza="delivered";function hz(b){Gy[z](this,jza,b)}var iz="drafts";function jz(b){Gy[z](this,iz,b)}var kz="inbox";function lz(b){Gy[z](this,kz,b)}var kza="muted";function mz(b){Gy[z](this,kza,b)}var nz="outbox";function oz(b){Gy[z](this,nz,b)}var pz="sent";function qz(b){Gy[z](this,pz,b)}function rz(b){Gy[z](this,Yy,b)}var sz="starred";function tz(b){Gy[z](this,sz,b)}function uz(b){Gy[z](this,Zy,b)}
+function lza(b){this.trc=Bf(b)}function mza(b){this.yZ=new lza(b)}function nza(b){this.O=b}function oza(b){this.O=b}function pza(b){this.O=b}function qza(b){this.O=b}function rza(b){this.O=b}var sza="appInfo",tza="uiv",vz="ft",wz="st",uza="pod",vza="og",xz="ll";function wza(b,a){Kx[z](this,sza,b);b=this.Kk();b.w(a,Gx(to),this.B3c);b.w(a,Gx(tza),this.d9c);b.w(a,Gx(vz),this.v1c);b.w(a,Gx(wz),this.Q6c);b.w(a,Gx(uza),this.g5c);b.w(a,Gx(wo),this.s2c);b.w(a,Fx(vza),this.B4c);b.w(a,Gx(xz),this.E2c)}
+var yz=" <";function xza(b,a,c,d,f){Ba(this,b);this.og=a;this.CU=c;this.rBa=d;this.vfc=f;this.Uea=b?b+yz+a+Uf:a;b=Wf(this.Uea);this.WS=xw(b,30)}function yza(b){this.O=b;this.O[1]=this.O[1]||[];this.Ajc=[];for(b=0;b<this.O[1][u];b++)this.Ajc[b]=new zza(this.O[1][b]);this.O[2]=this.O[2]||[];this.zic=[];for(b=0;b<this.O[2][u];b++)this.zic[b]=new zza(this.O[2][b])}function zza(b){this.O=b}var Aza="customFrom",Bza="cfs";function Cza(b,a){Kx[z](this,Aza,b);this.Kk().w(a,Gx(Bza),this.H_c)}
+function Dza(b,a){b=[];for(var c=0;c<a[u];c++){var d=a[c];d=new xza(d[pq](),d.Sj(),d.wga(),d.PT(),d.O[4]);b[p](d)}return b}var Eza="emoji",zz="em";function Fza(b,a){Kx[z](this,Eza,b);this.Kk().w(a,Fx(zz),this.y0c)}var Az="forwardingAddresses",Bz="v",Cz="u",Gza="fwd";function Hza(b,a){Kx[z](this,Az,b);this.Fa(Bz,[]);this.Fa(Cz,[]);this.Fa(Kd,[]);this.Fa(Rd,k);this.Kk().w(a,Gx(Gza),this.y1c)}function Iza(b){this.Xj(b)}var Jza="mailFetch",Kza="ama";
+function Lza(b,a){Kx[z](this,Jza,b);this.Kk().w(a,Fx(Kza),this.e5c)}function Mza(b){this.O=b}var Nza="productInfo",Dz="pi";function Oza(b,a){Kx[z](this,Nza,b);this.Kk().w(a,Gx(Dz),this.r5c)}function Pza(b){this.O=b}var Qza="quota",Rza="qu";function Sza(b,a){Kx[z](this,Qza,b);this.Kk().w(a,Fx(Rza),this.e9c)}function Tza(b){this.O=b;this.O[1]=this.O[1]||[];this.O[2]=this.O[2]||[];this.O[3]=this.O[3]||[]}
+function Ez(b,a){this.LP=b||0;this.Pd=!!a;this.yd=new Hf;this.ni=new Uza(I,undefined);Ma(this.ni,this.ni.SC=this.ni)}function Vza(b,a,c){return(b=b.yd.J(a))?b[q]:c}function Wza(b,a){if(b.Pd){Ma(a,b.ni[Rk]);a.SC=b.ni;Ma(b.ni,a);a[Rk].SC=a}else{a.SC=b.ni.SC;Ma(a,b.ni);b.ni.SC=a;Ma(a.SC,a)}if(b.LP)for(a=b.yd.Nb();a>b.LP;a--){var c=b.Pd?b.ni.SC:b.ni[Rk];c[Pb]();b.yd[Pb](c.key)}}function Xza(b,a){if(b.ni!=a){a[Pb]();b.yd[Pb](a.key)}return a[q]}function Uza(b,a){this.key=b;pa(this,a)}
+var Yza="translatableLanguages",Fz="tp";function Zza(b,a){Kx[z](this,Yza,b);this.Kk().w(a,Gx(Fz),this.C8c)}function aAa(b){this.O=b}var bAa="updatableStrings",cAa="us";function dAa(b,a){Kx[z](this,bAa,b);this.Hn=a;this.Kk().w(a,Gx(cAa),this.P8c);this.Kk().w(a,Gx(Bz),this.arb)}function Gz(b){this.Z=b}var Hz="l";
+function Iz(b){Bx(this);this.Na={};this.yDc=new cg(pea);this.V=b;this.qyc=b.J(Hz).Dq();var a=Dx(Cx(b));this.Hn=b=fy(b).ud;this.Aa=a;var c=new hya(a,b);a.ha(c);var d=new sxa(a,b);a.ha(d);var f=new Sza(a,b);a.ha(f);var g=new Fza(a,b);a.ha(g);var j=new Oza(a,b);a.ha(j);var n=new dAa(a,b);a.ha(n);var s=new Cza(a,b);a.ha(s);var v=new Hza(a,b);a.ha(v);v=new Lza(a,b);a.ha(v);var C=new Zza(a,b);a.ha(C);var M=new wza(a,b);a.ha(M);this.FAa=[c,d,f,g,j,n,s,v,C,M];for(c=0;c<this.FAa[u];c++){d=this.FAa[c];ih(a.Ya(),
+d.Je(),this.v5c,k,this)}this.aa.mib(a,b)}function Jz(b,a){return b.yDc[bd](a)}var eAa="user:";function fAa(b,a){N[z](this,eAa+b,this);this.QLb=b;ma(this,a)}var Kz="cfs:v";function gAa(b,a){if(b=b[hq](Kz))for(var c=0;c<b[u];c++)if(b[c].og==a)return h;return k}var hAa="dots";function iAa(b){b=b.Aa.za(Lx).Ca(hAa);return b==undefined?h:!!b}var jAa="em:em",kAa="ui:n",Lz="ui:e",Mz="ui:ia",Nz="ui:ic",Oz="cfs:u",Pz="ai:kb",lAa="adc:be",mAa="adc:cu",nAa="ui:evw";
+function oAa(b){var a=b[hq](jAa);return[b[hq](kAa),b[hq](Lz),b[hq](Mz),b[hq](Nz),b[hq](Kz),b[hq](Oz),b[hq](Pz),a?a.kc():undefined,b[hq](lAa),b[hq](mAa),b[hq](nAa)]}var pAa="ui:gn",qAa="sx_dn";function rAa(b,a,c){a.w(b,b.Cq(pAa),c);var d=yy(b.V);a.w(b.Aa.Ya(),d.Yn(qAa),c)}var Qz="va";function Rz(b){return b.J(Qz)}function sAa(b){this.Aa=Dx(Cx(b));this.Pd={};this.lNb=this.Aa.za(Lx)}var Sz="X";function Tz(b){return b.J(Sz)}var Uz="cu",tAa="{{num}}",uAa="{{hl}}",Vz="en";
+function vAa(b,a){b=b.lNb.Ca(Uz);if(Ue(b))if(b=b.helpall){b=b[mb](tAa,a)[mb](uAa,Vz);return new Sh(b)}return i}var Wz="http",wAa="/support/bin/answer.py",xAa="ctx",Xz="mail",yAa="answer";function Yz(b,a,c){var d=b.Pd[a];if(!d){a:{d=b.lNb.Ca(Uz);if(Ue(d))if(d=d[a]){d=(new Sh(d)).ka(Sd,Vz);break a}d=i}d||(d=vAa(b,a));if(!d)if(c||(Ue(Vz)?!ef(zAa,Vz):h))d=(new Sh).Pr(Wz).iB("mail.google.com").Or(wAa).ka(Sd,Vz).ka(xAa,Xz).ka(yAa,a);b.Pd[a]=d}return d}
+function Zz(b,a,c,d,f){this.KUc=b;this.U4=c||6E4;this.Xd=a||0;this.wpd=d||I;this.drd=f||-1}function aA(b,a,c){Bh[z](this,a,c);this.w6a=b}function bA(b,a,c,d){if(!(Ze(a)||a&&typeof a[Xb]==Se))e(Error(".9"));b=G(AAa,i,b,a,d);return Ch[xc](b,c||0)}function AAa(b,a,c){if(Ze(a)){a[z](c);c&&G(a,c)}else a&&typeof a[Xb]==Se&&a[Xb][z](a)}function cA(b){Ch[gb](b)}function dA(b,a,c,d){BAa||(BAa=new Hf);b=new aA(b,c);c=bf(b);BAa.set(c,b);ih(b,yj,a,k,d);b[Rc]();return c}
+function eA(b){var a=BAa.J(b);BAa[Pb](b);a.D()}var CAa="position:absolute;width:9em;height:9em;top:-99em";function fA(b){b=b||Cg();this.ZQ=b.ba(L?T:Td,{style:CAa});b=b.cb()[Lc];b[Bb](this.ZQ,b[Tb]);b=this.Lac=L?this.ZQ:this.ZQ[gc]||om(this.ZQ)[ac]||om(this.ZQ)[dc];if(Fh){fk(this.ZQ,-1);var a=b[yc];a[bb]();a[Xk]()}ih(b,sj,this.a7,k,this);this.LZb=this.ZQ[xk]}function gA(b){this.Ys={};this.Pia={};this.lwb={};this.Fh=b||new uh;this.mjd=!b}function hA(b){for(b=b;b.RA;)b=b.RA;return b}
+function iA(b){return b.aI||i}function jA(b,a){for(var c=b;c;c=c.RA)if(c.Ys[a])return c.Ys[a][0];if(c=DAa(b,a)){c=c(b);b[kq](a,c);return c}return i}function kA(b,a){var c=EAa(b),d=new ui,f=jA(b,a);if(f)d.ad(f);else if(f=FAa(b,a)){Zw(d,G(c[pb],c,f));Yw(d,G(b.jGc,b,a,f));Zw(d,G(b.D3c,b,a,f));d.ad(i)}else d.mE(new GAa(a));return d}function FAa(b,a){return a in b.Pia?b.Pia[a]:b.RA?FAa(b.RA,a):i}
+function lA(b,a,c){if(b.Ys[a])e(Error(".58`"+a));else if(b.Pia[a])e(Error(".59`"+a+qw+b.Pia[a]));b.Pia[a]=c}function mA(b,a,c){if(b.RA)mA(b.RA,a,c);else if(b.Ys[a])e(Error(".57`"+a));else if(b.lwb[a])e(Error(".60`"+a));else b.lwb[a]=c}function DAa(b,a){return b.RA?DAa(b.RA,a):b.lwb[a]}function EAa(b){return b.nmb?b.nmb:b.RA?EAa(b.RA):i}var HAa='Service for "',IAa='" is not registered';function GAa(b){Rh[z](this);this.id=b;Oa(this,HAa+b+IAa)}
+var JAa='Module "',KAa='" failed to load when requesting the service "',LAa='" [cause: ';function MAa(b,a,c){Rh[z](this);this.gid=b;this.hVc=a;this.oJ=c;Oa(this,JAa+a+KAa+b+LAa+c+wh)}var NAa='Configuration error when loading the module "',OAa='" for the service "',PAa='": ';function QAa(b,a,c){Rh[z](this);this.gid=b;this.hVc=a;Oa(this,NAa+a+OAa+b+PAa+c)}function nA(b,a){this.YOa={};Lf[z](this,b,a)}var oA="j";function pA(b){this.Kf=b;this.ya=b.J(oA).W();this.Sab=new kn(this)}
+function qA(b,a){var c;if(a instanceof Hf){c=a.Sb();a=a.Oa()}else{c=xf(a);a=wf(a)}for(var d={},f=0;f<c[u];f++)d[c[f]]=b.X(a[f]);return d}function rA(b){if(b.Pc)e(Error(".62"));b.wa||b.Vh()}function RAa(b,a,c){if(!a.ac())if(!(c<0||c>b.qj())){b.bf=b.bf||[];b.JP=b.JP||[];km(b.bf,a,c);b.JP[p](a);a.Ig(b);b.pia&&a.ma()}}function sA(b,a){for(var c=b.qj(),d=0;d<c;d++)if(b.rb(d)==a)return tA(b,d);return k}
+function tA(b,a){if(a<0||a>=b.qj())return k;var c=b.bf[a];kf(b.bf,a);jf(b.JP,c);c.mh=i;c.pia&&c.Ba();b.bf=b.bf[u]?b.bf:i;b.JP=b.JP[u]?b.JP:i;return h}function SAa(){Lf[z](this,400,400)}function uA(b){pA[z](this,b)}var vA="x";function TAa(b,a){if(!a&&!b.LR&&!b.MR||a==vA&&!b.LR||a==Wx&&!b.MR)return k;if(a)switch(a){case vA:b.LR=k;break;case Wx:b.MR=k;break;default:e(Error(".67"))}else b.LR=b.MR=k;return h}var wA="sizechange",UAa="fontsizechange";
+function xA(b,a,c){pA[z](this,b);this.aR=a;this.FZ=c;this.Bbb=[];ih(this.aR,wA,this.M5a,k,this);VAa.set(this.ea(),this);ih(this.FZ,UAa,this.XNa,k,this)}function WAa(b){if(b.xv()&&!(b.Sia>0)&&b.qj()>0&&b.Cc()&&!(yA>0)){yA++;try{b.Yj()}finally{zA()}}}function XAa(b,a,c){b=b.za();AA[p](b);YAa(a,c,AA);Ia(AA,0);c=BA[a][b.ea()];b.ip(a,c,k)}function zA(){if(yA>0){yA--;if(!(yA>0))for(var b=VAa.Oa(),a=0;a<b[u];a++)WAa(b[a])}}
+function CA(b,a,c,d){d=d||ZAa();c=c||ea[Lc];b=new xA(b,a,d);c[o](b.b());b.ma();return b}function ZAa(){DA||(DA=new fA(Cg(top[yc])));return DA}function aBa(){}function EA(b,a){this.dg=b;this.Sra=this.dg[yc][mc];this.Mub=new kn(this);this.Mub.w(this.dg,sj,this.a7);if(a)for(b=0;b<a[u];b++)this.Mub.w(a[b],sj,this.a7);this.vjb()&&this.x8b()}function bBa(){}
+function cBa(b){var a=b.wa[Mc][dc][Wk](b.wa,I);b.C7b=da(a.borderLeftWidth,10)+da(a.borderRightWidth,10)+da(a.paddingLeft,10)+da(a.paddingRight,10);b.S_b=da(a[wma],10)+da(a[Nma],10);b.D7b=da(a.borderTopWidth,10)+da(a.borderBottomWidth,10)+da(a.paddingTop,10)+da(a.paddingBottom,10);b.T_b=da(a.marginTop,10)+da(a.marginBottom,10)}
+function dBa(b,a){b.C7b=eBa(a.borderLeftWidth,a.borderLeftStyle)+eBa(a.borderRightWidth,a.borderRightStyle)+FA(a.paddingLeft,Ld)+FA(a.paddingRight,Ld);b.S_b=fBa(a[wma])+fBa(a[Nma]);b.D7b=eBa(a.borderTopWidth,a.borderTopStyle)+eBa(a.borderBottomWidth,a.borderBottomStyle)+FA(a.paddingTop,Ld)+FA(a.paddingBottom,Ld);b.T_b=fBa(a.marginTop)+fBa(a.marginBottom)}function eBa(b,a){return a==xd?0:FA(b,Ud)}var GA="auto";function fBa(b){return b==GA?0:FA(b,Haa)}var HA="0px";
+function FA(b){return b==HA?0:wva(b)==Jm?da(b,10):0}function IA(b){pA[z](this,b)}function JA(b,a){return b.Twa(a)&&b.KT(a)==0&&b.WZ(a)==Infinity}function KA(b){if(!b.cLa)b.cLa=b.b()[x];return b.cLa}function gBa(b,a,c){switch(a){case vA:a=b.Fl();b.Kg=c;b.Hf=a;break;case Wx:a=b.Yh();b.Kg=a;b.Hf=c;break;default:e(Error(".83"))}}function hBa(b){var a=IA.C.Ui[z](b);if(a){b.Y4a=i;b.X4a=i;b.Yjb=k;b.a5a=i;b.Z4a=i;b.Zjb=k}var c=b.ac();if(c&&(a||b.Fj()))c.Ui();return h}
+function iBa(b,a,c){switch(a){case vA:b.Y4a=c;break;case Wx:b.a5a=c;break;default:e(Error(".84"))}}function LA(b,a){if(!b.Fj())return 0;var c;a:switch(a){case vA:c=b.Y4a;break a;case Wx:c=b.a5a;break a;default:e(Error(".74"))}if(c)return c;if(jBa(b,a)){kBa(b,a);c=b.b();c=a==vA?c[xk]:c[ql];c+=a==vA?b.Epa:b.Fpa;iBa(b,a,c);return c}lBa(b,a);c=b.oF(a);c+=a==vA?b.Epa:b.Fpa;iBa(b,a,c);return c}
+function jBa(b,a){if(!b.Fj())return h;var c;a:switch(a){case vA:c=b.X4a;break a;case Wx:c=b.Z4a;break a;default:e(Error(".75"))}if(c)return h;else{c=b.Q3(a);switch(a){case vA:b.X4a=c;break;case Wx:b.Z4a=c;break;default:e(Error(".85"))}return c}}function kBa(b,a){if(!jBa(b,a))e(Error(".87"));var c;a:switch(a){case vA:c=b.Yjb;break a;case Wx:c=b.Zjb;break a;default:e(Error(".76"))}if(!c){lBa(b,a);b.Fj()&&b.VV(a);switch(a){case vA:b.Yjb=h;break;case Wx:b.Zjb=h;break;default:e(Error(".86"))}}}
+function mBa(b,a){switch(a){case vA:return b.W4a==-1;case Wx:return b.O3==-1;default:e(Error(".86"))}}function lBa(b,a){b.NXa(b.Fj())&&a==vA&&b.Ui(Wx)}function MA(b,a,c){if(a==vA){if(b.W4a!=c){b.W4a=c;ka(KA(b),NA(c));return h}}else if(b.O3!=c){b.O3=c;Wa(KA(b),NA(c));return h}return k}
+function nBa(b){if(b.Fj()){var a=b.b();OA.mM(a);if(Jg){var c=OA.wa;a={};var d=c[Mc][dc].getMatchedCSSRules(c,I),f=[];f[p](oBa);if(d)for(g=0;g<d[u];g++)f[p](d[g][x]);f[p](c[x]);for(var g=0;g<f[u];g++){c=f[g];for(d=0;d<pBa[u];d++){var j=pBa[d],n=c[j];if(n)a[j]=n}}dBa(OA,a)}else L?dBa(OA,OA.wa[il]):cBa(OA);a=OA.C7b;f=OA.S_b;if(a!=b.U4a||f!=b.Epa){b.Ui(vA);b.Epa=f;b.U4a=a}a=OA.D7b;f=OA.T_b;if(a!=b.V4a||f!=b.Fpa){b.Ui(Wx);b.Fpa=f;b.V4a=a}b=b.Uc();for(a=0;a<b[u];a++){f=b[a];f instanceof IA&&nBa(f)}}}
+function NA(b){return b<0?I:qBa?b+Jm:b}function rBa(b,a,c,d){d?sBa(b,a,c):YAa(b,a,c)}
+function YAa(b,a,c){for(var d=BA[b],f=c[u],g=0,j=0;j<f;j++){var n=i,s=c[j];n=s.KT(b);s.WZ(b);var v=s.rK(b),C=JA(s,b);switch(v){case 0:n=n;break;case -1:if(C)n=-1;else{v=LA(s,b);n=s.Sda(b,v);n=n==v?-1:n}break;default:if(a==-1){g++;n=n}else n=s.Sda(b,a);break}d[s.ea()]=n}if(g){for(j=a=0;j<f;j++){s=c[j];n=d[s.ea()];if(n==-1)n=LA(s,b);a=l.max(a,n)}for(j=0;j<f&&g>0;j++){s=c[j];if(s.rK(b)>0){g--;d[s.ea()]=s.Sda(b,a)}}}}
+function sBa(b,a,c){var d=BA[b];Ia(PA,Ia(tBa,Ia(QA,Ia(uBa,0))));for(var f=c[u],g=0;g<f;g++){var j=0;j=c[g];if(j.Fj()){tBa[g]=j.rK(b);QA[g]=j.KT(b);uBa[g]=j.WZ(b)}else{QA[g]=0;uBa[g]=0}PA[g]=0}var n=k;for(g=0;g<f;g++){j=c[g];if(j.Fj())if(JA(j,b))PA[g]=-1;else if(j.Twa(b)){var s=LA(j,b);j=j.Sda(b,s);PA[g]=j==s?-1:j}else if(j.rK(b)==0)PA[g]=QA[g];else{if(!n){n=h;Ia(RA,0)}RA[p](g)}}if(n)if(a==-1)for(g=0;g<RA[u];g++){b=RA[g];PA[b]=QA[b]}else{for(g=n=0;g<f;g++){s=PA[g];if(s<0)s=LA(c[g],b);n+=s}for(g=j=
+s=0;g<RA[u];g++){b=RA[g];s+=tBa[b];j+=QA[b]}a=l.max(a-n,j);vBa(RA,QA,uBa,tBa,a,s,PA);for(g=n=0;g<RA[u];g++){b=RA[g];n+=PA[b]}n-=a;for(g=0;g<RA[u]&&n>0;g++){b=RA[g];a=PA[b];s=QA[b];if(a>s){a=l.min(n,a-s);PA[b]-=a;n-=a}}if(n>0)e(Error(".89`"+n))}for(g=0;g<f;g++){j=c[g];d[j.ea()]=PA[g]}}
+function vBa(b,a,c,d,f,g,j){for(b=nf(b);;){for(var n=f/g,s=i,v=i,C=0,M=0,Y=b[u],ha=0;ha<Y;ha++){var tb=b[ha],zc=l[ob](d[tb]*n);if(zc<a[tb]){s||(s={});s[tb]=1;C+=a[tb]-zc}else if(zc>c[tb]){v||(v={});v[tb]=1;M+=zc-c[tb]}j[tb]=zc}if(!s&&!v)break;var qb=0,nd=0;n=function $Di(Pe){j[Pe]=l.min(l.max(j[Pe],a[Pe]),c[Pe]);qb+=j[Pe];nd+=d[Pe];jf(b,Pe)};if(M==C){v&&Ef(v,n);s&&Ef(s,n);break}else{M>C?Ef(v,n):Ef(s,n);f-=qb;g-=nd}}}
+function wBa(b){if(!b.pia)return k;var a=b.Yj;for(b=b;b&&b!=a;){if(!b.ZHa)return k;b=b.mh}return h}function SA(b){pA[z](this,b);this.sIa=i}function TA(b,a){SA[z](this,b);this.Wu=a}function xBa(b,a){if(b.VFa)if(a==vA){if(b.XHa!=-1){b.XHa=-1;ka(b.Kca,I)}}else if(b.WHa!=-1){b.WHa=-1;Wa(b.Kca,I)}}
+var UA='<table class="',yBa="ve",zBa='" cellspacing="0" cellpadding="0" role="alert">',ABa='<tr><td class="vj"></td><td class="vi"></td><td class="vk"></td></tr><tr><td class="vi"></td><td class="vh"></td><td class="vi"></td></tr><tr><td class="vf"></td><td class="vi"></td><td class="vg"></td></tr>',VA="</table>";function BBa(b,a){b=a||new U;b[R](UA,ul,J,yBa,zBa,ABa,VA);if(!a)return b[t]()}function WA(b,a){pA[z](this,b);this.Jc(a)}function CBa(b){if(!b.FDa)b.FDa=b.b()[Tb][Tb];return b.FDa}
+function XA(b){if(!b.hy)b.hy=CBa(b)[cc][1][cc][1];return b.hy}function YA(b,a){if(!b.MZb&&!a)b.MZb=new TA(b[uq](),b);return b.MZb}function DBa(b,a){var c=b.b();if(b.b8a)b.b8a!=a&&qm(c,b.b8a,a);else K(c,a);b.b8a=a}function EBa(){}var FBa="b8";function ZA(b,a){WA[z](this,b,FBa);this.Djd=a?a:0;this.Ym(k);Pw(this.H(),this.b(),aB,this.lh)}function GBa(b,a,c,d){b=a[ic](c);for(c=0;a=b[c];c++)K(a,d)}var bB="link_";
+function cB(b,a){la(this,b);if(Ye(a)){this.id=a;if(!Mf(this.id,bB))this.id=bB+this.id}else this.uri=a}var dB="Undo",eB="Learn more",HBa="link_undo";function IBa(b,a,c){var d;if(c===h)d=dB;else if(c)d=c;c=[];a&&c[p](new cB(eB,a));d&&c[p](new cB(d,HBa));return fB(b,c)}var JBa='&nbsp;&nbsp;<span class="ag" id="',KBa='" tabindex="0" role="link" idlink>',gB="</span>",LBa='&nbsp;&nbsp;<a class=ad target=_blank href="',W='">',hB="</a>";
+function fB(b,a){a={ke:b,VZb:a};b=new U;b[R](a.ke);if(a.VZb){a=a.VZb;for(var c=a[u],d=0;d<c;d++){var f=a[d];b[R](f.id?JBa+V(f.id)+KBa+f[jb]+gB:LBa+f.uri+W+f[jb]+hB)}}b=b[t]();return b}var iB="Loading...",MBa="Still working...";function jB(){this.f1=0;this.Sm=iB;this.Iaa=MBa;this.nCb=[]}function NBa(b){for(var a=4,c=0;c<b[u];c++)a=l.min(a,b[c].ts());return a}function kB(b,a){a<b.f1||lB(b,a)}
+function lB(b,a){if(a!=b.f1){if(a<b.f1)e(Error(".90`"+b.f1+qw+a));if(a>4)e(Error(".91"));for(var c=b.f1+1;c<=a;c++){b.f1=c;b.d9a()}if(a==4){Ff(b.nCb,function(d){d.ad(this)});Ia(b.nCb,0)}}}function OBa(b){this.sAc=b}function PBa(b){return b.J(Yx)}function QBa(b){return b.sAc}var mB="FAIL";function nB(b,a,c,d){this.Lc=b;this.oT=a;this.vW=!!b&&b.o5!=mB&&!c;this.C0=d}function oB(b,a){jB[z](this);this.V=b;this.iaa=a;b=fy(b);this.Hn=b.ud;this.nKa=b.s8a}var RBa="CREATED";
+function SBa(b){if(b.qa!=RBa)e(Error(".92`"+b.qa))}function TBa(b,a){a=new N(a,b);b.Sma&&b.Sma[r](a);b[r](a)}function UBa(b,a){b.MDc=h;b.jDc=a;b.h2a=k}var VBa="PROCESSED",WBa=";0";function XBa(b){var a=b.nKa;a.w_b();try{b.qa=VBa;try{QBa(PBa(b.V)).WH(b);b.rza();b.Wm&&b.Wm.AH&&b.Wm.AH(b);TBa(b,Cz)}catch(c){rg(tg,WBa,c)}a.WH(b)}finally{a.vic()}}var YBa="COMPLETED",ZBa=";1";
+function aCa(b){var a=b.nKa;a.w_b();try{b.Eg()&&XBa(b);b.qa=YBa;try{QBa(PBa(b.V)).tqb(b);b.vL();b.Wm&&b.Wm.wh&&b.Wm.wh(b);TBa(b,Bz);lB(b,4)}catch(c){rg(tg,ZBa,c)}b.Lc=i;a.tqb(b)}finally{a.vic()}}function pB(b,a,c){oB[z](this,b,Wn);this.mg=a;this.Lb=Tz(b);this.aX=c;this.UR=qB[a];if(!this.UR)e(Error(".94`"+a));this.HPa=k}function bCa(b){return b.YQ&&!!!b.bh&&!!b.Wd()}function rB(b){return b.Kv[mb](cCa,I)}function sB(b,a,c,d){var f=i;if(c)f=Yz(b.Lb,c);return IBa(a,f,d)}
+function tB(b,a,c){pB[z](this,b,a,c);this.BV=[];this.RDa=[]}function uB(b,a,c){if(b.hia)e(Error(".95"));hf(b.BV,a);hf(b.RDa,c)}function dCa(b,a){if(b.BV[u])e(Error(".96"));b.hia=h;b.FVc=a}function vB(b,a,c){tB[z](this,b,c||3,a);Bx(this);this.uj=h}function eCa(b){this.Lc=b}var wB="top",fCa="target",gCa="noreferrer",hCa='<META HTTP-EQUIV="refresh" content="0; url=';
+function iCa(b,a,c){a||(a={});var d=c||ba;c=typeof b[Yc]!="undefined"?b[Yc]:String(b);b=a[y]||b[y];var f=[];for(var g in a)switch(g){case Vi:case Ui:case wB:case sw:f[p](g+ei+a[g]);break;case fCa:case gCa:break;default:f[p](g+ei+(a[g]?1:0))}g=f[kd](wj);if(a.noreferrer){if(a=d[bb](I,b,g)){a[yc][nq](hCa+Wf(c)+W);a[yc][Xk]()}}else a=d[bb](c,b,g);return a}function jCa(b){Bx(this);this.V=b}function xB(b){return b.J(fo)}function yB(b,a,c){return kCa(b,a,c,h)}var lCa="nocheckbrowser";
+function zB(b,a,c){Mj.Of().Xb(lCa)&&a.ka(lCa,I);return yB(b,a,c)}var AB="_blank";function kCa(b,a,c,d){c=c||{};c[y]||Pa(c,AB);if(c[ib]){c.resizable=h;c.scrollbars=h}return b.Q0(a,c,d)}function mCa(b){this.tkc=b}function nCa(b){tB[z](this,b,42,2)}function oCa(b){this.Jb=b;pCa[b]=this}function BB(b,a){this.S1b=b;this.Xd=a;if(!this[Sk].i3a)this[Sk].i3a={};this[Sk].i3a[this[t]()]=this}function qCa(b){if(!b)return b;return b.lC()}function CB(b,a){BB[z](this,b,a)}function DB(b){return new CB(EB,b)}
+var FB="w";function rCa(b){N[z](this,FB);this.FV=b}function sCa(){jB[z](this);this.Ic=0}function GB(b,a){if(a!=b.Ic){if(a>3)e(Error(".97"));b.Ic=a;a!=0&&lB(b,4)}}function HB(){}var IB="t";function JB(b){return b.J(IB)}function tCa(b,a){tB[z](this,b,64,a);this.jb=JB(b);this.uj=k}function uCa(b,a){tB[z](this,b,21,a);this.uj=h}function KB(b,a){tB[z](this,b,1,a);this.uj=h}function vCa(b,a){tB[z](this,b,2,a);this.uj=h}function wCa(b,a){tB[z](this,b,8,a);this.uj=h}
+function xCa(b,a){tB[z](this,b,18,a);this.uj=h}function LB(b,a,c,d){tB[z](this,b,a,d);this.iR=c}function MB(b,a,c){LB[z](this,b,13,a,c);this.uj=h}function yCa(b,a,c){tB[z](this,b,c||4,a);this.uj=h}function zCa(b,a,c){tB[z](this,b,9,c);this.uj=h;this.iNb=a}function ACa(b,a){tB[z](this,b,10,a);this.uj=h}function NB(b){this.o2a=b}function BCa(b,a){BB[z](this,b,a)}function OB(b){return new BCa(EB,b)}function PB(b){this.V=b;this.Z=Rz(b);Bx(this)}function QB(b){b=CCa[b];return b!=undefined?RB[b]:i}
+function SB(b,a,c,d,f,g,j){if(QB(b)!=i)return i;DCa[b]=a;a=new ECa;Op(a,b);a.NEa=g;a.eqd=c;a.PX=d;a.a2=f;if(j){b=CCa[j];for(km(RB,a,b);b<RB[u];)CCa[RB[b][jr]]=b++}else{CCa[b]=RB[u];RB[p](a)}return a}function FCa(b,a,c,d,f,g,j,n){b=SB(b,a,c,d,f,j,n);if(b!=i)b.PYb=g;return b}function GCa(b,a,c,d,f,g,j){b=SB(b,a,c,d,f,g,j);if(b!=i)b.N_a=h;return b}function HCa(b,a,c,d,f,g,j){b=SB(b,a,c,d,f,g,j);if(b!=i)b.BWa=h;return b}
+function ICa(b,a,c,d){var f=a.dMb;Ia(f,0);for(var g=0;g<RB[u];g++){var j=RB[g][jr];if(JCa(b,j,c)){TB(a,j,d[j]);f[p](j)}else TB(a,j,k)}}function JCa(b,a,c){a=QB(a);if(!a)return k;if(!c)return h;a=a.NEa;return Ve(a)?ef(a,c):Ze(a)?a(b.V):h}function ECa(){}function KCa(){}function UB(b){pA[z](this,b);this.V=b}function VB(b){UB[z](this,b);this.ge=new Hf}function TB(b,a,c){if(b.Fs(a)&&b.ge.J(a)!=c){b.ge.set(a,c);b.Cl=h}}var WB="actionitem";function XB(b,a){N[z](this,WB);Op(this,b);la(this,a)}
+function LCa(){this.iAa={}}var X='<div class="',YB="ar",ZB="at",aC='" style="background-color: #',MCa="; border-color: #",NCa=';"><div class="',bC="au",OCa='" style="border-color:#',PCa="av",QCa='searchType="',RCa='label="',SCa='style="color: #',TCa="</div></div></div></div>";function UCa(b,a){var c=a||new U;c[R](X,YB,J,vl,wl,ZB,aC,b[lq][jq],MCa,b[lq][jq],NCa,bC,OCa,b[lq][jq],wl,PCa,Vf,b.Dvb?QCa+b.Dvb+Vf:I,b[pr]?RCa+b[pr]+Vf:I,SCa,b[lq].tg,W,b[ec],TCa);if(!a)return c[t]()}
+function VCa(b){this.dg=b}var cC="F";function WCa(b,a){a=new VCa(a);b[kq](cC,a);return a}function dC(b){return b.J(cC)}function eC(b){return b.dg.Ec()}function fC(){this.ee=[]}function gC(b){var a;if(b)if(Ve(b)){a=[];for(var c=0;c<b[u];c++)a[p](b[c].cb())}else a=[b.cb()];else a=[Cg().cb()];this.eE=a;this.xkb=Zf();this.Q=b=new kn(this);for(c=0;c<this.eE[u];c++){b.w(this.eE[c],XCa,this.XO,h);b.w(this.eE[c][Lc],YCa,this.XO,h)}}var ZCa="activity";
+function aDa(b,a,c){b.xkb=a;b.fZb=c;if(a>b.R0b){b[r](ZCa);b.R0b=a+3E3}}function hC(b,a){a=a||bDa(this);this.qhb=b;this.Dz=a;this.Uuc=G(this.UXc,this);cDa(this)}function bDa(b){dDa.add(b);if(iC==i)iC=new gC;return iC}function cDa(b){var a=b.qhb+1-(Zf()-b.Dz.xkb);if(a>0)b.Oya=Dh(b.Uuc,a);else{b.rP=h;ih(b.Dz,ZCa,b.t3b,k,b);b.mgb=h;b[r](zi)}}function eDa(b){if(b.mgb){nh(b.Dz,ZCa,b.t3b,k,b);b.mgb=k}}function jC(b){this.qhb=b;this.UGa=new fC;this.i1=new Hf}var kC="A";function lC(b){return b.J(kC)}
+var fDa=":2";function mC(b,a,c){b.UGa.MG([a,c]);if(!b.ab)b.ab=bA(fDa,b.wYc,0,b)}function gDa(b,a){if(a.Cu)e(Error(".102"));a.Cu=b;var c=Zf();a.AKa=c+a.zMb;hDa(a,c);b.i1.set(String(a.id),a)}function iDa(b,a){b.i1[Pb](String(a.id));if(!a.Cu)e(Error(".103"));if(a.ab){cA(a.ab);a.ab=i}a.Cu=i}function nC(b,a,c,d,f){this.id=String(jDa++);this.fy=b;this.C5=a;this.zMb=c;this.Mk=d;this.na=f||i}function hDa(b,a,c){c=c||0;if(b.ab){cA(b.ab);b.ab=i}a=l.max(b.AKa+c-a,0);b.ab=bA(b.fy,b.ix,a,b)}var kDa=";3";
+function lDa(b,a){var c=h,d=b.C5;if(d&1)if(b.Cu.qia())c=k;var f=b.Cu.Hh;if(d&2)if(f&&f.My())c=k;if(d&4)if(f&&!f.My())c=k;if(c){b.xKa=k;if(b.AKa-a<=25){try{b.Mk[z](b.na)}catch(g){rg(tg,kDa,g)}a=Zf();b.AKa=a+b.zMb;hDa(b,a)}else hDa(b,a,b.AKa-a)}else b.xKa=h}function mDa(b,a){b.uWb=a;if(!b.uWb){a=b.i1.Oa();for(var c=0;c<a[u];c++){var d=a[c];if(d.C5&1&&d.xKa){mC(b,b.kvb,b);break}}}}function nDa(b,a){b.Hh=new hC(b.qhb,a);ih(b.Hh,yi,b.R8,k,b);ih(b.Hh,zi,b.S8,k,b)}
+function oC(b){this.dg=b||ba;this.OU=ih(this.dg,sj,this.a7,k,this);this.We=Mg(this.dg);if(this.vjb())this.R0a=ba[Dc](G(this.lJb,this),500)}function pC(b,a){this.V=b;a&&oDa(this,a)}function qC(b){return b.J(oA)}function pDa(b,a){a=new pC(b,a);b[kq](oA,a)}function oDa(b,a){if(b.wrb)e(Error(".104"));b.wrb=a;b.Y=Cg(a);b.eoa=new oC(pm(a));b.eoa.dk(b.V.Ya())}function qDa(b){this.V=b;this.Q=new kn(this);this.Yca=k}var rC="B";function sC(b){return b.J(rC)}
+function rDa(b){var a=new qDa(b);b[kq](rC,a);return a}var sDa="1.8.1",tC="SPAN";function tDa(b,a){var c=pm(a),d=Jg?a[Lc]:a[mc],f=a;if(L)f=c;else if(Fh&&!vg(sDa))f=a[mc];a=f;b.Nr=d;b.KQ=a;b.kgd=Cg(b.Nr);b.HF=d[Nk];b.Q.w(a,tj,b.Xfd);if(L&&!vg(Ij)){b.vrd=new cg([Cd,tC,Vd,Fd,vd,Wd,Iaa,Xd]);b.Q.w(b.kgd.cb(),Zi,b.mgd)}}function uC(b){if(L&&b.Ppa){var a=b.Ppa.cb()[Lc][Dk]();a[tk]();a[Fk]();b.lf()}}function uDa(b){return b.Nr[Nk]}var vDa="1.9a";
+function vC(b,a){var c=b.Nr;if(b.HF!=a)if(!(Fh&&!vg(vDa)&&c[vc]==0&&c[Wc]==0)){b.HF=a;up(c,a)}}var wDa="border: 0; vertical-align: bottom",xDa='javascript:""';function yDa(b){return b.ba(Td,{frameborder:0,style:wDa,src:xDa})}function wC(b,a,c){Pa(this,b);this.handle=a||b;this.txa=c||new Cm(NaN,NaN,NaN,NaN);this.ki=Eg(b);this.Q=new kn(this);ih(this[Fma],fj,this.sM,k,this)}function zDa(b){b[zb]()}var xC="start";function ADa(b,a){if(b[r](new BDa(xC,b,a[kc],a[lc],a))!==k)b.mZ=h}
+function CDa(b,a,c){var d=gm(Cg(b.ki));a+=d.x-b.Oza.x;c+=d.y-b.Oza.y;b.Oza=d;b.Hea+=a;b.Iea+=c;a=DDa(b,b.Hea);b=EDa(b,b.Iea);return new xg(a,b)}function DDa(b,a){var c=b.txa;b=!ia(c[Ck])?c[Ck]:i;c=!ia(c[ib])?c[ib]:0;return l.min(b!=i?b+c:Infinity,l.max(b!=i?b:-Infinity,a))}function EDa(b,a){var c=b.txa;b=!ia(c.top)?c.top:i;c=!ia(c[id])?c[id]:0;return l.min(b!=i?b+c:Infinity,l.max(b!=i?b:-Infinity,a))}
+function BDa(b,a,c,d,f,g,j,n){N[z](this,b);Da(this,c);Ea(this,d);this.AAd=f;ck(this,Ke(g)?g:a.Hea);this.top=Ke(j)?j:a.Iea;this.VBc=a;this.SBc=!!n}var FDa="Kj-JD";function yC(b,a,c){nn[z](this,c);this.Al=b||FDa;this.LBb=!!a;this.Yf=GDa;this.xq=new xm(this.W().cb())}function HDa(b){b.Cc()||b.eb();return b.y2}function zC(b){b.Cc()||b.eb();return b.b()}function IDa(b){b.Cc()||b.eb();return b.Em}
+function AC(b,a){b.Yxa=a;JDa(b);var c=b.W();if(b.Cc()&&a&&b.Ib()){b.jq&&c.yA(b.jq,b.b());b.Em&&c.yA(b.Em,b.b());b.DWa()}}var KDa="-K7-GIHV4";function LDa(b,a){b.dfa=a;if(b.dfa&&!b.ih&&b.b())b.ih=MDa(b);else if(!b.dfa&&b.ih){b.b()&&Ag(b.iD,b.Al+KDa);b.ih.D();b.ih=i}}function MDa(b){var a=new wC(b.b(),b.iD);K(b.iD,b.Al+KDa);return a}var NDa="-Jh";
+function JDa(b){if(b.LBb&&b.Yxa&&!b.jq){b.jq=yDa(b.W());m(b.jq,b.Al+NDa);Wm(b.jq,k);Vm(b.jq,0)}else if((!b.LBb||!b.Yxa)&&b.jq){Sg(b.jq);b.jq=i}if(b.Yxa&&!b.Em){b.Em=b.W().ba(T,b.Al+NDa);Vm(b.Em,b.Z3a);Wm(b.Em,k)}else if(!b.Yxa&&b.Em){Sg(b.Em);b.Em=i}}function ODa(b,a){b.jq&&a[o](b.jq);b.Em&&a[o](b.Em)}var BC="dialogselect";function CC(b,a){za(this,BC);this.key=b;this.caption=a}function DC(b){this.ya=b||Cg();Hf[z](this)}function PDa(b,a){b.wa=a;b.eb()}
+function EC(b){yC[z](this,undefined,undefined,qC(b).W());this.M4=h;this.eb()}var QDa="Error";function FC(b,a){b=new EC(b);b.Fc(QDa);b.xb(a);b.oh(GC);b.ra(h);return b}var RDa="xy",SDa="xx";function HC(b,a,c,d,f){EC[z](this,f);this.V=f;this.Cb=sC(f);this.IAc=a;this.n2a=d;d=this.Cd();f=f.J(oA).W();this.P9=f[Qb](T);m(this.P9,RDa);Q(this.P9,b);d[o](this.P9);this.xF=f[Qb](zm);m(this.xF,SDa);pa(this.xF,a);d[o](this.xF);this.Fc(c);this.oh(GDa);this.H().w(this,BC,this.MC)}
+function IC(b,a,c,d){EC[z](this,a);this.Cb=sC(a);this.n2a=b;this.Fc(c);d!=undefined&&this.xb(d);this.oh(GDa);this.H().w(this,BC,this.MC)}function TDa(b){return String[rq](b[Xc](0)-65248)}
+function UDa(b){var a=b[Xc](0);return b[u]==1?"\u3002\u300c\u300d\u3001\u30fb\u30f2\u30a1\u30a3\u30a5\u30a7\u30a9\u30e3\u30e5\u30e7\u30c3\u30fc\u30a2\u30a4\u30a6\u30a8\u30aa\u30ab\u30ad\u30af\u30b1\u30b3\u30b5\u30b7\u30b9\u30bb\u30bd\u30bf\u30c1\u30c4\u30c6\u30c8\u30ca\u30cb\u30cc\u30cd\u30ce\u30cf\u30d2\u30d5\u30d8\u30db\u30de\u30df\u30e0\u30e1\u30e2\u30e4\u30e6\u30e8\u30e9\u30ea\u30eb\u30ec\u30ed\u30ef\u30f3\u309b\u309c"[xb](a-65377):b[Xc](1)==65438?"\u30f4__\u30ac\u30ae\u30b0\u30b2\u30b4\u30b6\u30b8\u30ba\u30bc\u30be\u30c0\u30c2\u30c5\u30c7\u30c9_____\u30d0\u30d3\u30d6\u30d9\u30dc"[xb](a-
+65395):"\u30d1\u30d4\u30d7\u30da\u30dd"[xb](a-65418)}function VDa(b,a,c){for(var d,f=i,g=0;(d=a[hb](b))!=i;){if(f==i)f=[];g<d[Lq]&&f[p](b[Zc](g,d[Lq]));f[p](c(d[0]));g=a[Mma]}if(f==i)return b;g<b[u]&&f[p](b[Zc](g));return f[kd](I)}function JC(b,a){b=b[mb](/\uFF3E/g,Qd);b=VDa(b,WDa,TDa);b=VDa(b,XDa,UDa);return(a?b:Pf(b[mb](/\s+/g,J)))[mb](YDa,Qd)[od]()}function ZDa(){}function aEa(b){Rp(this,b)}
+function bEa(b,a,c){this.rt=b[1];this.lD=b[2];this.mqa=b[3];this.EU=b[4];this.Bwa=b[5];this.wra=b[6];this.Yna=b[7]||I;this.CDa=b[8];this.SA=b[9]||0;this.Nx=a;this.V=c;this.Jb=b[0];this.Sm=Vy(this.Jb);this.ufa=Wf(this.Sm);this.esb=i;Bx(this)}function cEa(b,a){if(b.rt!=a){b.rt=a;b.xj(2)}}function dEa(b,a){if(b.Yna!=a){b.Yna=a;b.xj(256)}}function eEa(b){this.V=b;this.kr=new ZDa}function KC(b){return b.J(cy)}var LC="labels",fEa="_GM_getLabelDataNode";
+function MC(b){if(!b.qn){var a=Dx(Cx(b.V));b.qn=a.za(LC)}if(!b.qn){a=eC(dC(b.V));b.qn=Pda(fEa,a)}return b.qn}function NC(b,a){return(b=a?gEa(MC(b),a,h):k)?b.J():i}function hEa(b,a,c){a=JC(a);if(a[u]>40||a==I)return k;if(!iEa[cb](a))return k;if(ff(jEa,a)!=-1)return k;if(c){if(ff(c,a)!=-1)return k}else{b=OC(MC(b),h);for(var d=0;c=b[d];d++)if(JC(c)==a)return k}return h}
+var kEa="The name is too long.",lEa="No name specified.",mEa="The ^ character is not allowed.",nEa="Sorry, you can't create a label named \"",oEa="\" (it's a reserved system label).",pEa="The label name you have chosen already exists.";function PC(b,a,c){a=JC(a);if(a[u]>40)return kEa;if(a==I)return lEa;if(!iEa[cb](a))return mEa;if(ff(jEa,a)!=-1)return nEa+(a+oEa);b=OC(MC(b),h);for(var d,f=0;d=b[f];f++)if(d!=c&&JC(d)==a)return pEa;return i}
+function QC(b,a,c,d,f,g){a=new HC(a,c,d,f,g);b=G(b.wqd,b);a.Wna=b;a.ra(h)}function qEa(b,a){var c=NC(b,a);if(c){a=c.esb;if(!a){a=UCa({name:c.ufa,color:b.kr.X5(c)});c.esb=a}}else{a=Vy(a);a=UCa({name:Wf(a),color:b.kr.PO(0)})}return a}function rEa(){this.Q=new kn(this);this.poa=[];this.Dh=[]}function RC(b){return b.J(Kd)}function sEa(b){var a=new rEa(b);b[kq](Kd,a);return a}var SC="I";function tEa(b,a){Ff(b.Dh,function(c){c(a)});b.poa[p](a);b.Q.w(a,SC,b.uha)}
+function uEa(b,a){Ff(b.poa,a);b.Dh[p](a)}var TC="D";function vEa(b,a){b.iL=a;b[r](TC)}function UC(b){return b.iL}function wEa(b,a,c){return hx(ywa(Awa(b),ai),ai,c)+a}function Kga(b,a,c){a=a||top;b=b?Lj+b:a[Ic][raa];if(Ke(c)?c:Jg)Na(a,wEa(a[Ic][Yc],b,Yf()));else{a[Ic].hash=b;a[Ic][Sq](h)}}function xEa(){this.yu=new cg}function VC(b){return b.J(Ph)}function WC(b){b[r](cC)}var XC="G";function yEa(b){N[z](this,XC);this.ZH=b}function zEa(){this.Q=new kn(this)}var AEa="beforeunload";
+function YC(b,a){this.sC=b;this.Gk=new kn(this);this.V=a;this.dRa=[];this.OIa=k;this.Gk.w(this.sC,uj,this.uha);this.Gk.w(this.sC,AEa,this.Teb);tEa(RC(a),this)}function ZC(b,a){b.dRa[p](a)}var aD="H";function BEa(b,a){N[z](this,aD,b);this.hj=a;this.PPb=k}function CEa(b,a){this.Pf=b;this.Jb=(this.UPa=!!a&&a.Ca(Rd)==b)?a.Ca(Zx):I}function DEa(b){this.V=b}function EEa(b,a){b=Dx(Cx(b.V)).za(dya);return new CEa(a,b)}function bD(){this.Kab=[]}var cD="k";function dD(b){return b.J(cD)}
+function FEa(b){this.V=b;this.Rjc={};this.VEa={};this.PVb={}}var eD="E";function fD(b){return b.J(eD)}function gD(b,a,c){if(b.VEa[a])e(Error(".107`"+a));b.VEa[a]=c}function hD(b,a,c){b.mW(a,b.Rjc,c)}function iD(b,a,c){b.mW(a,b.PVb,c)}var jD="K",kD="f";
+function lD(b){gA[z](this,b?b.Ya():new uh);var a=b?b.Ev:this;this.Ev=a;if(this.Ev==this){this.Snd=Zf();this.nmb=O.S();sEa(this);this[kq](ag,new lxa(this,void 0));this[kq](eD,new FEa(this));this[kq](Ph,new xEa(this));this[kq](cD,new bD);this[kq](jD,new LCa(this));this[kq](Zx,new zEa(this));this[kq](kD,new DEa(this));this[kq](cy,new eEa(this));this.Q=new kn(this);ln(this.Q,RC(this),TC,this.Gpb)}else{if(a.Wpa)a.Wpa[p](this);else a.Wpa=[this];b&&this.kma(b);this.nmb=EAa(a)}Bx(this)}
+function _ForceReloadStyles(){}function mD(b){return new lD(b)}function GEa(b){if(b.Ev==b)if(!b.Pc&&b.va&&!b.E5a){b.G5a.i6a();b.va[qc]()}}function nD(b){return b.Ev.tod}function oD(b){return b.Ev.va}function HEa(b){if(b.E5a)b.Ev.va=i}function pD(b){return b.Ev.G5a}var qD="ce";function IEa(b){b=Dx(Cx(b.Ev)).za(Lx).Ca(qD);return(Ue(b)?!!b:h)&&!bx()}function JEa(b){return!!(gga&&IEa(b))}var KEa="_GM_EmoticonHandler",LEa="_GM_chatEngine",MEa="_GM_chatController";
+function NEa(b){var a=eC(dC(b)),c=rD(b);sD(c)._GM_EmoticonHandler=si(KEa,a);if(!oD(b)){c=si(LEa,a);a=si(MEa,a);if(c&&a){b.Ev.va=c;b.Ev.G5a=a;b.Ev.E5a=h}}}var OEa="_GM_bcService";function PEa(b){if(!jA(b,dx)){var a=eC(dC(b));(a=si(OEa,a))&&b[kq](dx,a,h)}}var tD="ui:fru";function uD(b){return new Sh(Rz(b)[hq](tD))}function vD(b){if(!b.cEa)if(typeof QEa!="undefined")b.cEa=new QEa(iA(b));return b.cEa}
+function wD(b){var a=rD(iA(b));a=sD(a);var c=a[yc][ub](pha);if(c)Ua(c[x],xd);(c=a.loadTimeout)&&a[gb](c);hA(b).hL=k}function REa(b){this.Db=b}function SEa(b){this.O=b;this.O[1]=this.O[1]||[];this.aS=[];for(b=0;b<this.O[1][u];b++)this.aS[b]=new xD(this.O[1][b]);if(this.O[4])this.v9b=new TEa(this.O[4])}function xD(b){this.O=b}function TEa(b){this.O=b;this.O[1]=this.O[1]||[]}function UEa(b){this.O=b}
+function VEa(b){this.O=b;this.O[1]=this.O[1]||[];this.aS=[];for(b=0;b<this.O[1][u];b++)this.aS[b]=new xD(this.O[1][b])}function WEa(b){this.O=b;this.O[2]=this.O[2]||[]}function XEa(b){this.O=b;if(this.O[1])this.jQb=new YEa(this.O[1]);this.O[2]=this.O[2]||[];this.lkc=[];for(b=0;b<this.O[2][u];b++)this.lkc[b]=new ZEa(this.O[2][b])}function ZEa(b){this.O=b}function YEa(b){this.O=b;this.aS=new xD(this.O[2])}function aFa(b){this.O=b}
+function bFa(b){if(b){this.ycc=b.Wga()||-1;this.Ccc=b.aeb()||I;this.FXa=b.lua()||I;this.qHb=b.O[4]||-1}else{this.ycc=-1;this.FXa=this.Ccc=I;this.qHb=-1}}function cFa(b,a){this.Hn=b;a&&this.oM(a);this.YAd=Zf();this.Ayb=k;this.Bf=this.oib()}function yD(b){if(b.uba)e(Error(".109"))}function dFa(b,a){eFa(b,a,h)}function eFa(b,a,c){if(a instanceof Wh){var d=a.Sb();rf(d);for(var f=0;f<d[u];f++){var g=d[f],j=a.Oa(g);c?b.Be(g,j):b.Ua(g,j)}}else Ef(a,function(n,s){c?this.Be(s,n):this.Ua(s,n)},b)}
+function fFa(b,a){BB[z](this,b,a)}function zD(b,a){if(b instanceof lD)b=fy(b).ud;cFa[z](this,b,a)}function AD(b){var a=b[uq]();pA[z](this,a);this.ia=b}function BD(b,a){AD[z](this,a);this.V=b}function CD(){var b=gFa;return!!b&&b.yYa()}function DD(){var b=gFa;return!!b&&b.oi()}function hFa(b,a){this.xe=b;this.YKc=!!a;this.UK=iFa(this);if(!this.UK){b=L&&!vg(Ij)?Lh:rj;this.P0=ih(this.xe,b,this.Rua,k,this);this.jwa=ba[Dc](G(this.Rua,this),100)}}function jFa(b){if(b.jwa){ba[Oma](b.jwa);b.jwa=i}}
+function iFa(b){var a=k;try{a=L?b.xe[Nb]==Hh:!!om(b.xe)[Lc]&&(!b.YKc||!!om(b.xe)[Lc][Tb])}catch(c){}return a}var kFa="ifload";function lFa(b,a,c){this.JV=[];this.Li=a;for(a=0;a<b[u];a++){var d=new hFa(b[a],c);if(d.hc())d.D();else{this.JV[p](d);ih(d,kFa,this)}}this.JV[u]||this.Li()}function mFa(b,a){this.MOa=b;this.Li=a}function nFa(b,a){for(var c=0;c<b.MOa[u];c++){var d=om(b.MOa[c])[Lc];if(d)Q(d,I)}Ia(b.MOa,0);b.Li(a)}var oFa=":5";
+function pFa(b,a,c,d){for(var f=[],g=0;g<a[u];g++){var j=b[ub](a[g]);if(j)f[p](j);else{bA(oFa,df(pFa,b,a,c),20);return}}(new mFa(f,c))[Rc](d)}function qFa(b){this.Zf=b;this.PIb=Eg(this.Zf)}function rFa(b,a){a=new qFa(a);b[kq](Pd,a);return a}function rD(b){return b.J(Pd)}function sD(b){return pm(b.PIb)}var ED="Aa";function sFa(b){Bx(this);this.V=b;this.lb=yy(this.V);this.Cb=sC(b);this.Z=Rz(b);jA(b,ED)||hA(b)[kq](ED,new tFa);_GM_ftcb||(_GM_ftcb=G(this.ODc,this))}
+function tFa(){this.sya=1;this.lna={};this.ROb=[]}function uFa(b,a,c,d,f,g){var j={IX:a,x1b:c,rhb:new ui,cq:f,wc:d};a=new ui;c&&Zw(a,function(){return c});Zw(a,function(){return j.rhb});Zw(a,d,g);b.ROb[p](j);a.ad(j);return j}function vFa(b,a){b=b.ROb;for(var c=0;c<b[u];++c){if(b[c].IX==a)return b[c];if(b[c].IX[Rq]){b[jd](c,1);--c}}return i}function FD(b){return b.V.J(ED)}var HD="xc";function wFa(b,a,c,d){var f=FD(b).sya++,g=[];g[p](HD);xFa(b,g);g[p](a);g[p](c);FD(b).lna[f]=zh(g);yFa(b,f,d)}
+var zFa="uri";function AFa(b,a,c){var d=FD(b).sya++,f=[c?zFa:Yd];xFa(b,f);FD(b).lna[d]=zh(f);return yFa(b,d,a,c)}function xFa(b,a){a[p](oAa(b.Z));a[p](Bya(b.lb))}var BFa="btop";function ID(){return(new Sh(aga)).ka(pd,BFa).ka(rd,tea)}var JD="cm",KD="fs",LD="am";function CFa(){return(new Sh(Rj)).ka(pd,JD).ka(KD,Hj).ka(Nj,Hj).ka(rd,ti).ka(LD,Fi)}var DFa="cmid";
+function yFa(b,a,c,d){var f=new Wh;if(d)for(var g,j=EFa.Sb(),n=0;n<j[u];n++){var s=j[n];if(g=d.J(s))f.set(EFa.J(s),g)}f.set(DFa,a);b.aa.LGa(f);if(MD(b)){a=Uh(ID(b),Qf(f));d=xB(b.V);c=zB(d,a,c?i:FFa(b));ND(b,c,JD,b.VNc)}else{a=Uh(CFa(),Qf(f[t]()));d=xB(b.V);return zB(d,a,c?i:FFa(b))}}var OD="cv",PD="th",QD="qt";
+function GFa(b,a,c,d,f){var g=new Wh;f=MD(b)&&!f?ID(b):(new Sh(Rj)).ka(pd,OD).ka(KD,Hj).ka(Nj,Hj).ka(rd,ti).ka(LD,Fi);if(!b.aa.B2a(a,c,d,g)){Pya(a,f.Of());f.ka(PD,c);d&&d[u]!=0&&f.ka(QD,HFa(d))}b.aa.LGa(g);Uh(f,Qf(g[t]()));return f}function IFa(b,a,c,d,f,g){a=GFa(b,a,c,d);c=xB(b.V);f=zB(c,a,f?i:FFa(b,g));MD(b)&&ND(b,f,OD,b.XNc)}var RD="cw";function JFa(){return(new Sh(Rj)).ka(pd,RD).ka(KD,Hj).ka(Nj,Hj).ka(rd,ti).ka(LD,Fi)}
+function FFa(b,a){var c;b=a?a:top;try{c=Mg(b)}catch(d){c=Mg()}b=l[rb](c[id]*0.8);return{width:l.min(c[ib],b),height:b}}function HFa(b){for(var a=[],c=0;c<b[u];c++){var d=b[c];a[p](d[0]);a[p](d[1]?1:I)}return a[kd](He)}function KFa(b){b=rD(b.V);return String(sD(b)[Ic])}function MD(b){return Jz(b.Z,988)&&Sfa.J()&&!L}function ND(b,a,c,d){if(a){var f=Zf();c=c?O.S()[pb](c,h):i;uFa(FD(b),a,c,d,f,b)}}var SD="pa";function LFa(b){var a=new sFa(b);b[kq](SD,a)}function TD(b){return b.J(SD)}
+function UD(b){this.Jmd=b}function MFa(){}var NFa="UTC";function OFa(b){if(typeof b==Qe){var a=new MFa;a.pZa=b;a.rhc=PFa(b);b=b;if(b==0)b=NFa;else{var c=[NFa,b<0?tl:Qd];b=l.abs(b);c[p](l[rb](b/60)%100);b%=60;b!=0&&c[p](xj,b);b=c[kd](I)}a.SAb=[b,b];a.D_a=[];return a}a=new MFa;a.rhc=b.id;a.pZa=-b.std_offset;a.SAb=b.names;a.D_a=b.transitions;return a}var QFa="GMT";function RFa(b){var a=[QFa];a[p](b<=0?tl:Qd);b=l.abs(b);a[p](nx(l[rb](b/60)%100,2),xj,nx(b%60,2));return a[kd](I)}var SFa="Etc/GMT";
+function PFa(b){if(b==0)return SFa;var a=[SFa,b<0?Qd:tl];b=l.abs(b);a[p](l[rb](b/60)%100);b%=60;b!=0&&a[p](xj,nx(b,2));return a[kd](I)}function TFa(b,a){a=Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a[Ema](),a[Qma](),a.getUTCMinutes())/36E5;for(var c=0;c<b.D_a[u]&&a>=b.D_a[c];)c+=2;return c==0?0:b.D_a[c-1]}function UFa(b,a){b=-(b.pZa-TFa(b,a));a=[b<0?Qd:tl];b=l.abs(b);a[p](nx(l[rb](b/60)%100,2),nx(b%60,2));return a[kd](I)}function VD(b){this.ap=[];typeof b==Qe?this.RGa(b):this.bpa(b)}
+function WD(b,a,c){var d=c?(a[sr]()-(c.pZa-TFa(c,a)))*6E4:0,f=d?new Date(a[hc]()+d):a,g=f;if(c&&f[sr]()!=a[sr]()){d+=d>0?-86400000:864E5;g=new Date(a[hc]()+d)}d=[];for(var j=0;j<b.ap[u];++j){var n=b.ap[j][jb];1==b.ap[j][Zb]?d[p](VFa(b,n,a,f,g,c)):d[p](n)}return d[kd](I)}var XD="M",YD="S",ZD="L",aE="Q";
+function VFa(b,a,c,d,f,g){var j=a[u];switch(a[xb](0)){case XC:c=d[fr]()>0?1:0;return j>=4?bE.Lmc[c]:bE.xDb[c];case Wx:c=d[fr]();if(c<0)c=-c;return j==2?nx(c%100,2):String(c);case XD:a:{c=d[Cq]();switch(j){case 5:j=bE.ooc[c];break a;case 4:j=bE.xca[c];break a;case 3:j=bE.wEb[c];break a;default:j=nx(c+1,j);break a}}return j;case cD:return nx(f[xq]()||24,j);case YD:return(f[hc]()%1E3/1E3)[tma](l.min(3,j))[nc](2)+(j>3?nx(0,j-3):I);case eD:return b.Hbb(j,d);case Kd:j=f[xq]();return bE.MCb[j>=12&&j<24?
+1:0];case Yx:return nx(f[xq]()%12||12,j);case jD:return nx(f[xq]()%12,j);case aD:return nx(f[xq](),j);case dx:a:{c=d[Gq]();switch(j){case 5:j=bE.Tpc[c];break a;case 4:j=bE.Wpc[c];break a;case 3:j=bE.Vpc[c];break a;default:j=nx(c,1);break a}}return j;case ZD:a:{c=d[Cq]();switch(j){case 5:j=bE.Spc[c];break a;case 4:j=bE.Rpc[c];break a;case 3:j=bE.Upc[c];break a;default:j=nx(c+1,j);break a}}return j;case aE:c=l[rb](d[Cq]()/3);return j<4?bE.xEb[c]:bE.dEb[c];case Pd:return nx(d[iq](),j);case Xx:return nx(f[nr](),
+j);case ki:return nx(f[Oq](),j);case Bz:j=(j=g)||OFa(c[sr]());return j.rhc;case ey:b=(b=g)||OFa(c[sr]());return j<4?b.wNa(c):b.Nga(c);case cy:b=(b=g)||OFa(c[sr]());return j<4?UFa(b,c):RFa(b.pZa-TFa(b,c));default:return I}}function cE(b,a){return Vxa(b,a)||a[hc]()-b[hc]()<432E5?WD(WFa,b)[od]():Xxa(b,a)?WD(XFa,b):WD(YFa,b)}function dE(b){return b.J(dg)}function eE(b){SA[z](this,b);this.n4=ZFa}function ZFa(b){var a=b.wa;b=KA(b);var c=b[yaa],d=b[ib];Ja(b,sd);ka(b,I);a=a[xk];Ja(b,c);ka(b,d);return a}
+function aGa(b){bGa||(bGa=new VD(7));return WD(bGa,b)}function cGa(b){dGa||(dGa=new VD(0));return WD(dGa,b)}function eGa(b){var a=Zf();if(a<b)b=a;b=b;a=Zf();var c=l[rb]((a-b)/6E4),d=k;if(c<0){d=h;c*=-1}if(c<60)b=fGa(c,d,0);else{c=l[rb](c/60);if(c<24)b=fGa(c,d,1);else{c=(new Date)[sr]()*6E4;c=l[rb]((a+c)/864E5)-l[rb]((b+c)/864E5);if(d)c*=-1;b=c<14?fGa(c,d,2):I}}return b}function gGa(b,a,c){var d=b[hc](),f=eGa(d);if(f)f=xl+f+xh;return l[rb]((Zf()-d)/6E4)<1440?(a||aGa(b))+f:(c||cGa(b))+f}
+var hGa=" minute ago",iGa=" minutes ago",fE="in ",jGa=" minute",kGa=" minutes",lGa=" hour ago",mGa=" hours ago",nGa=" hour",oGa=" hours",pGa=" day ago",qGa=" days ago",rGa=" day",sGa=" days";
+function fGa(b,a,c){if(!a&&c==0){a=b+hGa;c=b+iGa;return b==1?a:c}else if(a&&c==0){a=fE+(b+jGa);c=fE+(b+kGa);return b==1?a:c}else if(!a&&c==1){a=b+lGa;c=b+mGa;return b==1?a:c}else if(a&&c==1){a=fE+(b+nGa);c=fE+(b+oGa);return b==1?a:c}else if(!a&&c==2){a=b+pGa;c=b+qGa;return b==1?a:c}else if(a&&c==2){a=fE+(b+rGa);c=fE+(b+sGa);return b==1?a:c}else return I}var tGa="<span ",gE='id="',hE='title="',uGa="idlink ",iE='class="',jE='" tabindex="0" role="link">';
+function kE(b,a){var c=a||new U;c[R](tGa,b.id?gE+b.id+Zd:I,b[Pk]?hE+b[Pk]+Zd:I,b.tA?uGa:I,iE,b[uc]?b[uc]:Rd,jE,b.Ab,gB);if(!a)return c[t]()}var vGa="mA",lE="ms",wGa='">&gt;</div><div id="',xGa='">&lt;</div></div><div id="',yGa="mB",mE='"></div>',nE='<div id="',zGa='" class="mv"></div>';function AGa(b,a){var c=a||new U;c[R](X,vGa,yl,b.IMc,S,lE,wGa,b.PMc,S,lE,xGa,b.phb,S,yGa,mE,nE+b.pMc+zGa);if(!a)return c[t]()}
+var BGa='<span class="my">',oE="</span> - ",CGa='<a class="e" href="',pE="<span>",DGa=' - <span class="mx">',EGa=' - <a class="',FGa="mz",qE='" href="',GGa="related articles",HGa="&nbsp;&raquo;</a>";function IGa(b,a){var c=a||new U;c[R](b[vq]?BGa+b[vq]+oE:I,b.PH?CGa+b.PH+W+b[Pk]+hB:b[Pk]?pE+b[Pk]+gB:I,b[qr]?pE+b[qr]+gB:I,b.Ob?DGa+b.Ob+gB:I);b.Utb&&c[R](EGa,FGa,qE,b.Utb,W,GGa,HGa);if(!a)return c[t]()}function JGa(b,a){var c=a||new U;kE({id:b.id,Ab:b.ke},c);if(!a)return c[t]()}var rE="fb";
+function sE(b){BD[z](this,b,new eE(b));this.Lh=TD(b);this.Z=Rz(b);this.jb=JB(b);this.xf=fy(b);this.xl=tE(b);this.Jc();this.H().w(this.xf.ud,Fx(rE),this.C1c)}var uE="mt";function KGa(b,a,c){var d=b.wN[u]-1;if(a>d)b.xec=h;else{var f=b.wN[a];if(!f)e(Error(".115"));if(f.yo){f.TDa=Zf();LGa(f.yo,kD,f.TDa,f.Ara?0:1);MGa(f.yo,kD,f.Ara?1:0)}if(f.Ara){(new Image).src=f.Ara;f.Ara=i}if(a>0!=(b.MJ!=0))m(b.bsa,a>0?lE:uE);Q(b.M9a,f.Bg);Q(b.Y4,f.QAb);b.MJ=a;b.xec=k;NGa(b)}if(c&&d-a<1)DD()?vE(b.B()):OGa(b)}
+var PGa="Loading clips";function OGa(b){var a=new zD(b.xf.ud,i);a.Ua(pd,rE);if(b.QFa&&(b.QFa.md()==wE||b.QFa.md()==xE))a.Ii(b.QFa.Bb());a.Se(PGa);if(!a.Na)a.Na={};a.Na.fn=h;b=QGa;if(!a.Na)a.Na={};a.Na.fv=b;a[Mb]()}var RGa="paddingLeft",SGa="paddingRight",yE="right",TGa="pixelRight";function NGa(b){if(L&&!vg(Ij)){var a=pw(b.Y4,Fm(b.Y4,RGa),sw,Xua),c=pw(b.Y4,Fm(b.Y4,SGa),yE,TGa);ka(b.M9a[x],b.Y4[Vk]-a-c)}}
+function UGa(b,a){if(a<=0)return i;b=Zf();if(l[rb]((b-a)/864E5)<7){var c=eGa(a);if(c)return c}return cE(new Date(a),new Date(b))}function VGa(b,a,c,d,f,g){this.mic=b;this.QAb=a;this.Bg=c;this.iBd=d;this.Ara=f;this.yo=g}function WGa(b){this.ee={};if(b)for(var a=0;a<b[u];a++)this.ee[XGa(this,b[a])]=i}function XGa(b,a){return a in YGa||String(a)[Xc](0)==32?J+a:a}function ZGa(b){this.O=b}var aHa="adsconfig",bHa="acfg";
+function cHa(b){Kx[z](this,aHa,Dx(Cx(b)));b=fy(b);this.Kk().w(b.ud,Fx(bHa),this.eYc)}function zE(b,a){BB[z](this,b,a)}function dHa(b){this.V=b;this.vv=dE(b)}var eHa="ad-";function AE(b){return new zE(EB,eHa+b,h,k)}function fHa(b){b.fjb=k}function BE(b,a,c,d,f){b.vv.jj(a,c+(d?Qd+d:I)+(f?Qd+f:I))}function CE(b){this.hsc=b}function gHa(b,a,c){this.Xv=b;this.id=a;this.ER=c;this.HJb={};this.yra={};this.vnb={};gHa[w].uA=0}var hHa="cv_n",iHa="cv_p",DE="tl",jHa="tl_i",kHa="tl_l",EE="sm",FE="rm";
+function GE(b){return b.ER==OD?b.Z2a?hHa:iHa:b.ER==DE?b.Xv.fjb?jHa:kHa:b.ER==EE?EE:FE}function lHa(b,a){if(b.uA!=1)e(Error(".117`"+b.uA));b.uA=2;BE(b.Xv,a?mHa:nHa,GE(b))}function oHa(b,a,c,d){var f=GE(b);c>0&&BE(b.Xv,pHa,f,a,c);d>0&&BE(b.Xv,qHa,f,a,d)}function LGa(b,a,c,d){var f=b.uA;if(!Ke(b.vnb[a])){if(f<3)e(Error(".119`"+b.uA));b.vnb[a]=d;b.uA=4;var g=GE(b);f!=4&&BE(b.Xv,rHa,g,i,c-b.qhc);d>0&&BE(b.Xv,sHa,g,a,d);b.yra[a]&&b.yra[a]>0&&BE(b.Xv,tHa,g,a,b.yra[a])}}
+function MGa(b,a,c){var d=b.uA;if(!Ke(b.yra[a])){if(d<3)e(Error(".120`"+d));b.yra[a]=c;Ke(b.vnb[a])&&c>0&&BE(b.Xv,tHa,GE(b),a,c)}}function uHa(b,a,c,d,f){c=a+Qd+c;if(!b.HJb[c]){if(b.uA!=4)e(Error(".121`"+b.uA));b.HJb[c]=h;if(d==IB)d=vHa;else if(d==Cz)d=wHa;else e(Error(".122"));BE(b.Xv,d,GE(b),a,f)}}function xHa(b,a,c){switch(b){case OD:return b+Qd+a+Qd+c;case DE:return b+Qd+c;default:return b}}var yHa="ak";
+function HE(b,a){this.na=void 0;Bx(this);this.ob=a||new Gh;this.ob.X1(1E4);this.TFa=new Array(1);this.Jca=-1;this.w2a=new Hf;this.UFa=[];this.Xv=new dHa(b);this.Y2a=new cHa(b);Dx(Cx(b)).ha(this.Y2a);this.xf=fy(b);this.KHb=new WGa;this.w(this.xf.ud,Fx(yHa),this.gYc);this.aa.tb(b)}function zHa(b){b=AHa(b);return b!=i&&b.ER==EE}function AHa(b){return b.TFa[b.Jca]}var IE="ad",BHa="aav";
+function CHa(b,a,c,d){var f=new Sh(Qj);a.uri=f;f.ka(pd,IE);f.ka(BHa,2);if(a.Z2a)f.ka(yHa,a.Z2a);else if(c&&d){f.ka(PD,c);Iy(d,f)}else return;b.aa.e4a(a);if(a.uA!=0)e(Error(".116`"+a.uA));a.uA=1;BE(a.Xv,DHa,GE(a));b.ob.Eb()?EHa(b,a):b.scc(a)}function EHa(b,a){b.UFa[p](a.id)}function JE(b,a){a=b.w2a.J(a);return Ke(a)?b.TFa[a]:i}var FHa="!";
+function GHa(b,a,c){b.Jca=(b.Jca+1)%1;var d=b.TFa[b.Jca];if(d&&!Mf(d.id,FHa)){d.X0a&&b.ob[wc]();b.w2a[Pb](d.id);jf(b.UFa,d.id)}if(d=JE(b,a)){d.id=FHa+d.id;jf(b.UFa,a)}c=new gHa(b.Xv,a,c);b.TFa[b.Jca]=c;b.w2a.set(a,b.Jca);return c}function tE(b){return b.J(aD)}function HHa(){this.Lya=this.mxa=0;this.ob=new Gh;this.Q=new kn(this)}var IHa="exception",JHa="ex-name",KHa="ex-message",LHa="ex-",MHa="*** ",NHa=" ***";
+function OHa(b,a,c){var d={},f=Ye(a);b.Wva(d,IHa,b.tRb(a),c);if(f){d[JHa]=Xe;d[KHa]=a}else for(c=0;c<PHa[u];c++){f=PHa[c];if(f in a){var g=LHa+f;try{d[g]=a[f]}catch(j){d[g]=MHa+j+NHa}}}b.X0b(d);return d}function QHa(){this.eO=[];this.hDa=[]}function RHa(b,a,c){za(this,b);this.sR=a;Sp(this,c||b)}function KE(b,a,c){c=c||Zf();var d=SHa[a];a=new RHa(a.lC(),c,d);THa(b,a,b.eO);THa(b,a,b.hDa)}function UHa(b,a,c,d){c=Ke(c)?c:Zf();THa(b,new RHa(a,c,d),b.eO)}
+function THa(b,a,c){for(b=c[u]-1;b>=0;b--)if(a.sR>=c[b].sR)break;km(c,a,b+1)}function LE(b,a,c,d){this.xqa=b;this.C3a=a;this.V=c;this.mg=d;this.fFb=[];this.TR=new QHa}var VHa=".123`";function WHa(b,a,c){if(a[u]>c){ME.yI(Error(VHa+a));return k}return h}var NE="sv",XHa="ev",YHa="lo",OE="pf",PE="pn",QE="ps",RE="r",SE="rf",TE="ra",UE="rn",VE="rs",ZHa="mn",WE="mg",aIa="/S:";
+function bIa(b){if(!b.bod)return i;var a;var c=b.hDa;a=b.Mu;if(c[u]){for(var d=[],f=0;f<c[u];f++){var g=c[f];d[p](g[Zb]);d[p](ei);d[p](g.sR-a);d[p](wj)}d.pop();a=d[kd](I)}else a=i;d=nea&&nea!=I&&b.IPc?[nea,b.Mu][kd](Md):i;f=b.jDa;g=b.kDa;c=new Hf;c.set(Bz,2);c.set(Kd,b.mg.lC());c.set(NE,qCa(b.Gld));c.set(XHa,qCa(b.WCc));c.set(IB,b.BAb);c.set(Rd,a);c.set(YHa,d);c.set(oy,f.Xyb[u]);c.set(OE,f.xfa);c.set(SD,f.PG);c.set(PE,f.JA);c.set(QE,f.jz);c.set(RE,g.Xyb[u]);c.set(SE,g.xfa);c.set(TE,g.PG);c.set(UE,
+g.JA);c.set(VE,g.jz);c.set(ZHa,cIa(b,b.Uxa));c.set(WE,cIa(b,b.amb));b=[aIa];a=c.Sb();for(d=0;d<a[u];d++){f=a[d];if(g=c.J(f)){b[p](f);b[p](ei);b[p](Qf(g));b[p](Sf)}}b.pop();return b[kd](I)}function cIa(b,a){if(!a||a.Nb()==0)return i;b=[];for(var c=a.Sb(),d=0;d<c[u];d++){var f=c[d],g=a.J(f);b[p](f);b[p](xj);b[p](Qf(g));b[p](wj)}b.pop();return b[kd](I)}
+function dIa(b,a){var c=b.vgb();this.eDd=b.C0-(c?0:1);if(c){this.rh=0;this.PG=b.Mda-b.Esa}else{this.rh=b.jm()?1:2;c=b.NQa;this.PG=c-b.Esa;c=b.Gsa-c;var d=b.vNa();d=d==-1?0:d;if(d>c)d=c;this.jz=d;this.JA=c-this.jz}a=this.A2b=l.max(a-b.Esa,0);if(a>0){c=l.min(a,this.PG);this.PG-=c;a-=c;c=l.min(a,this.JA);this.JA-=c;a-=c;c=l.min(a,this.jz);this.jz-=c;a-=c;if(a>0)this.A2b-=a}this.xEd=this.PG+this.JA+this.jz;this.qHa=b.zcb().qHb}function eIa(){this.Xyb=[]}
+function fIa(b,a,c){this.Li=b;this.na=a;if(!c){c=new Sh("//www.google.com/images/cleardot.gif");bi(c)}this.Bf=c}var gIa="onLine";function hIa(b){b.J3a++;if(gIa in bp&&!bp[uma])Dh(G(b.tza,b,k),0);else{b.zr=new Image;cp(b.zr,G(b.zTa,b));oa(b.zr,G(b.XP,b));oma(b.zr,G(b.d2c,b));b.QI=Dh(b.e2c,b.Mba,b);b.zr.src=String(b.Bf)}}function iIa(b){if(b.zr){cp(b.zr,i);oa(b.zr,i);oma(b.zr,i);b.zr=i}if(b.QI){Eh(b.QI);b.QI=i}if(b.U0){Eh(b.U0);b.U0=i}}
+function jIa(){this.Fv=new fIa(this.Wpb,this);this.Kwc=l[kb](51E3)+l[kb](18E3*l[Tc]())}var XE="images/cleardot.gif";function kIa(b,a){if((a?a:Zf())-b.zZb>b.Kwc){if(!b.Fv.Rwa()){a=new Sh(XE);bi(a);b.Fv.sYa(a);b.Fv[Rc]()}return h}return k}function YE(){this.zu=new fC;this.MAa=[];lIa(this,1E3);this.Loa=new Hf;this.pEa=[];this.Q=new kn}
+function mIa(b,a){var c={};c.Uba=G(b.Hod,b);c.bQ=G(b.OTa,b);c.WH=G(b.WH,b);c.UIc=G(b.qfb,b);c.cfb=G(b.cIc,b);c.osc=G(b.ZFb,b);c.QBd=G(b.qGc,b);c.RBd=G(b.rGc,b);c.Acd=G(b.uVa,b);c.uFb=G(b.D2a,b);a.oM(c);b.pEa[p](a)}function lIa(b,a,c){if(c)b.yya=a;else{if(a<1E3)a=1E3;else if(a>3E5)a=3E5;b.yya=l[kb](0.85*a)+l[kb](0.3*a*l[Tc]())}}function nIa(b){var a=b.zu.Nb();b.ld&&a++;return a}function oIa(b,a,c){b.Loa.set(a,c)}var ZE="ACTIVE";
+function pIa(b){b.ld.uc();b.N8=0;b.QSa=-1;var a=b.ld,c=Zf();if(a.Esa==-1)a.Esa=c;a.NQa=c;a.C0++;try{b.EG(ZE);b.GAb()}catch(d){e(d)}}var qIa=";4";function rIa(b){try{b.ld.Gsa=Zf()}catch(a){rg(tg,qIa,a);b.Vka=a}}var sIa=";5";function tIa(b,a){try{b.ld.wWa=new bFa(new aFa(a))}catch(c){rg(tg,sIa,c);b.Vka=c}}function uIa(b,a){b.xOb=a}var vIa="RETRY_TIMER";function wIa(b){if(b.qa==vIa){if(b.Lv){cA(b.Lv);b.Lv=0}pIa(b)}}function xIa(b){if(b.Mw){cA(b.Mw);b.Mw=i}}function yIa(b){b.NCc=h}var zIa="nrt",AIa="rhma";
+function BIa(b){var a=b.ld;a.Ua(zIa,a.C0);b=b.YR.wRb();b!=i&&a.Be(AIa,b)}function CIa(b,a){N[z](this,b);this.f0a=a}function DIa(b){this.V=b;this.rPb=k;this.Q=new kn(this);this.OUa=[];this.xf=fy(b);this.Q.w(this.xf.ud,XD,this.VJc);this.Q.w(VC(b),cC,this.gqb)}function aF(b){return b.J(ii)}function EIa(b){if(b.Csa){cA(b.Csa);b.Csa=i}}function FIa(b){var a=b.xf.ud.P5();if(a&&b.qia()&&b.ukb!=a){b.ukb=a;b.Bdd(a)}}var GIa="7.0";
+function HIa(b){if(b.OUa[u]!=0){var a=mi(Uj,I);a=a;for(var c=b.OUa,d=c[u],f=3950-a[u],g=0;g<d&&f>=c[g][u];){f-=c[g][u];g++}a+=pf(c,0,g)[kd](I);a=a;ax(Uj,a,86400);if(L&&bg(wg,GIa)<0){for(c=[];!mi(Uj,void 0);){d=a[u]<100?0:a[Sc](aIa,a[u]-100);if(d<1)break;c[p](a[Zc](d));a=a[Zc](0,d);ax(Uj,a,86400)}df(pf,b.OUa,0,0)[cd](i,c)}}}function IIa(){this.zCa=new Hf;this.Hxb={}}function JIa(b,a,c){this.jna=b;this.key=a;this.Ied=c||k}function bF(b){this.Q=new kn(this);this.JU=[];this.eBa=b.J(Ky)}
+function KIa(b){this.na=new kn(this);b&&LIa(this,b)}function LIa(b,a){b.na.w(a,ae,b.Y8c);b.na.w(a,Xd,b.X8c)}function cF(b){pA[z](this,b)}function dF(b){pA[z](this,b)}function eF(b,a){b.Lca(a,b.qj())}function fF(b,a){pA[z](this,b);this.yjc=a}function gF(b,a){fF[z](this,b,Wx);this.Igc=!!a}function MIa(b,a,c,d,f){this.id=b;this.caption=a;this.iMb=c;this.foa=d;this.Fbc=f}function NIa(b){this.jAa={};this.n8b={};this.V=b;this.m8b={}}function hF(b){return b.J(Wx)}var OIa="R";
+function PIa(b,a){b.jAa[a.id]=a;for(var c=0;c<a.foa[u];c++)b.n8b[a.foa[c]]=a;b[r](OIa)}function QIa(b,a){return b.jAa[a]}var RIa="lz",SIa="<span>Build label: ",TIa="</span> &nbsp; ",UIa="<span>Compile Mode: ",iF="</span></div>";function VIa(b,a){var c=a||new U;c[R](X,RIa,W,b.dIb?SIa+b.dIb+(b.bIb>0?gg+b.bIb+xh:I)+TIa:I,UIa,b.UQc,iF);if(!a)return c[t]()}function WIa(){this.Q=new kn(this)}function XIa(b,a){N[z](this,b);this.Pg=a}function jF(b){return b.J(eo)}
+function kF(b,a){uf(YIa,function(c){this.Q.w(a,c,this.lka)},b)}function ZIa(b,a){uf(YIa,function(c){this.Q.hb(a,c,this.lka)},b)}function lF(b){pB[z](this,b,36,20);this.Z=Rz(b);this.XA=new Hf}function mF(b){this.Db=b;this.Mb=jF(b);this.dX=Xj;this.pQ=this.dX.x4;this.xf=fy(b)}function aJa(b){var a=Mx().Gn(48,b);b[kq](Yj,a);return a}function nF(b){return b.J(Yj)}function bJa(b){b.dX[pb](cJa(b,b.pQ),G(b.N7c,b))}var oF="ss";function cJa(b,a){return(new Sh(aga)).ka(pd,oF).ka(rd,a).ka(LD,Fi)}
+function pF(b,a,c){this.dE=b?b.cb():ea;this.ey=a||I;this.kzb=c}var dJa="nowrap";function qF(b){if(!b.wg){b.wg=b.dE[Qb](T);m(b.wg,b.ey);ema(b.wg[x],dJa);rp(b.wg[x],GA);if(b.kzb)for(var a in b.kzb)b.wg[x][a]=b.kzb[a];Fa(b.wg[x],yd);ka(b.wg[x],HA);Ua(b.wg[x],I);b.dE[Lc][o](b.wg)}return b.wg}
+function eJa(b,a,c,d,f,g){if(b&&a){var j=a;a=new pF(c,f,g);var n=qF(a);ka(n[x],j);j=n[vc]||n[xk];a.D();a=j;j=b=Ew(b);n=b[u];c=new pF(c,f,g);f=qF(c);c.gp(j);for(g=f[bl]||f[vc];g>a&&n>0;){j=b[nc](0,--n)+(d?lg:I);c.gp(j);g=f[bl]||f[vc]}c.D();return Wf(j)}else return b}function fJa(b,a,c,d){a=new pF(a,c,d);a.gp(b);b=qF(a);b=b[bl]||b[vc];a.D();return b}function rF(b,a){fF[z](this,b,vA);this.lmd=!!a}function sF(b){gF[z](this,b)}function gJa(b,a,c){Ta(this,b);ama(this,a);this.yn=c}
+function hJa(b){if(!b.Ohc)b.Ohc=b.b()[Tb];return b.Ohc}function iJa(b){if(!b.zAb)b.zAb=hJa(b)[x];return b.zAb}function jJa(b){if(!b.wAb)b.wAb=hJa(b)[Tb];return b.wAb}function kJa(b){if(!b.vAb)b.vAb=jJa(b)[x];return b.vAb}function lJa(b){if(!b.yAb)b.yAb=hJa(b)[cc][1];return b.yAb}function mJa(b){if(!b.xAb)b.xAb=lJa(b)[x];return b.xAb}function nJa(b){if(!b.uAb)b.uAb=hJa(b)[cc][2];return b.uAb}function oJa(b){if(!b.Nhc)b.Nhc=nJa(b)[x];return b.Nhc}
+function pJa(b){if(!b.Okb)b.Okb=b.b()[cc][1];return b.Okb}function qJa(b){if(!b.bvb)b.bvb=pJa(b)[Tb];return b.bvb}function rJa(b){if(!b.U6a)b.U6a=qJa(b)[Tb];return b.U6a}function sJa(b){if(!b.R6a)b.R6a=rJa(b)[Tb];return b.R6a}function tJa(b){if(!b.QHb)b.QHb=b.b()[cc][3];return b.QHb}function uJa(b){if(!b.C4a)b.C4a=tJa(b)[x];return b.C4a}function vJa(b){if(!b.y4a)b.y4a=tJa(b)[Tb];return b.y4a}function wJa(b){if(!b.x4a)b.x4a=vJa(b)[x];return b.x4a}
+function xJa(b){if(!b.B4a)b.B4a=tJa(b)[cc][1];return b.B4a}function yJa(b){if(!b.A4a)b.A4a=xJa(b)[x];return b.A4a}function zJa(b){if(!b.w4a)b.w4a=tJa(b)[cc][2];return b.w4a}function AJa(b){if(!b.OHb)b.OHb=zJa(b)[x];return b.OHb}
+var BJa="padding:",tF="px ",CJa="px;margin:",DJa="px 0px",EJa='" style="height:',FJa=";display:",GJa='dir="ltr"',uF='><div class="',HJa="ph p",vF='" style="width:',wF='"></div><div class="',IJa="ph q",JJa="l o",xF='"></div></div><div class="',KJa="l m",LJa="l n",MJa='" style="margin-left:',yF='" style="',NJa="diLZtc",OJa='"></div></div></div></div><div class="',zF="dJ",PJa="ph i",QJa="ph j",RJa="l h",AF='"></div></div>';
+function SJa(b,a,c,d,f,g,j,n){f=[BJa,l.max(0,f),tF,l.max(0,g),tF,l.max(0,j),tF,l.max(0,n),CJa,l.min(0,f),tF,a+l.min(0,g),tF,l.min(0,j),DJa][kd](I);b={gYb:k,borderTop:NA(b),borderBottom:NA(c),borderLeft:NA(d),borderRight:NA(a),zBc:b==0?xd:I,uBc:c==0?xd:I,Oyc:f,yad:d+l.min(0,n)+Jm};a=new U;a[R](X,Dz,EJa,b.borderTop,FJa,b.zBc,Vf,b.gYb?GJa:I,uF,HJa,vF,b.borderLeft,wF,IJa,vF,b.borderRight,wF,JJa,xF,KJa,wl,LJa,MJa,b.yad,wl,cD,yF,b.Oyc,wl,NJa,OJa,zF,wF,Dz,EJa,b.borderBottom,FJa,b.uBc,Vf,b.gYb?GJa:I,uF,PJa,
+vF,b.borderLeft,wF,QJa,vF,b.borderRight,wF,RJa,AF);b=a[t]();return b}function TJa(b,a,c,d,f){if(!(b.AG==a&&b.Zu==d&&b.zG==c&&b.yG==f))if(b.wa){yA++;try{if(b.zG!=c||b.yG!=f)b.Ui(vA);if(b.AG!=a||b.Zu!=d)b.Ui(Wx);b.AG=a;b.zG=c;b.Zu=d;b.yG=f;b.JHa=h}finally{zA()}}else{b.AG=a;b.zG=c;b.Zu=d;b.yG=f}}
+function UJa(b,a,c,d,f){if(!(b.CL==a&&b.AL==d&&b.paddingRight==c&&b.BL==f))if(b.wa){yA++;try{if(b.gQ!=c||b.BL!=f)b.Ui(vA);if(b.CL!=a||b.AL!=d)b.Ui(Wx);b.CL=a;b.gQ=c;b.AL=d;b.BL=f;b.JHa=h}finally{zA()}}else{b.CL=a;b.gQ=c;b.AL=d;b.BL=f}}
+function VJa(b){if(b.JHa){var a=b.W8b,c=b.V8b,d=b.T8b,f=b.U8b,g=b.e9b,j=b.d9b,n=b.b9b,s=b.c9b,v=!Ke(a),C=b.W8b=b.AG,M=b.V8b=b.zG,Y=b.T8b=b.Zu,ha=b.U8b=b.yG,tb=b.e9b=b.CL,zc=b.d9b=b.gQ,qb=b.b9b=b.AL,nd=b.c9b=b.BL;if(v||C!=a){if(a==0)Ua(iJa(b),I);if(C==0)Ua(iJa(b),xd);else Wa(iJa(b),NA(C))}if(v||Y!=d){if(d==0)Ua(uJa(b),I);if(Y==0)Ua(uJa(b),xd);else Wa(uJa(b),NA(Y))}if(v||M!=c){a=NA(M);ka(mJa(b),a);ka(yJa(b),a)}if(v||ha!=f){a=NA(ha);ka(kJa(b),a);ka(wJa(b),a)}if(!b.T6a)b.T6a=rJa(b)[x];a=b.T6a;if(v||tb!=
+g&&(tb>0||g>0))a.paddingTop=l.max(0,tb)+Jm;if(v||zc!=j&&(zc>0||j>0))a.paddingRight=l.max(0,zc)+Jm;if(v||qb!=n&&(qb>0||n>0))a.paddingBottom=l.max(0,qb)+Jm;if(v||nd!=s&&(nd>0||s>0))dma(a,l.max(0,nd)+Jm);if(v||tb!=g&&(tb<0||g<0))Zla(a,l.min(0,tb)+Jm);if(v||M+l.min(0,zc)!=c+l.min(0,j))Np(a,M+l.min(0,zc)+Jm);if(v||qb!=n&&(qb<0||n<0))a.marginBottom=l.min(0,qb)+Jm;if(v||ha+l.min(0,nd)!=f+l.min(0,s)){if(!b.avb)b.avb=qJa(b)[x];lp(b.avb,ha+l.min(0,nd)+Jm)}if(L&&!vg(Ij)){if(v&&ha<3||ha!=f&&(ha<3||f<3))Np(kJa(b),
+Np(wJa(b),l.max(-ha,-3)+Jm));if(v&&M<3||M!=c&&(M<3||c<3))lp(mJa(b),lp(yJa(b),l.max(-M,-3)+Jm));if(v||ha!=f&&(ha>0&&ha<=3||f>0&&f<=3))lp(oJa(b),lp(AJa(b),(ha>3?0:ha)+Jm));if(v||M!=c&&(M>0&&M<=3||c>0&&c<=3))Np(oJa(b),Np(AJa(b),(M>3?0:M)+Jm))}b.JHa=k}}function BF(b,a){AD[z](this,new sF(b));this.ia.JXa(CF);this.yJa=Ke(a)?a:15}function DF(b,a,c){var d;if(c==0)d=h;else{d=a[Ck]==a[rl]||!(c&1||c&4)||!(c&2||c&8);d=(a.top==a[fl]||!(c&1||c&2)||!(c&4||c&8))&&d}if(d){b.ia.JXa(a);b.yJa=c}}
+function WJa(){this.Zma=new Swa(5)}function XJa(b){var a=0,c=b.Zma.Nb();if(c){for(var d=0;d<c;d++)a+=b.Zma.J(d);return a/c}return 0}function YJa(b){this.V=b;this.J3=new WJa;this.Fv=new jIa}var ZJa="Oops... the system encountered a problem (#999) - Retrying in 999s...";function aKa(b,a){b=a||new U;b[R](ZJa);if(!a)return b[t]()}var bKa="Retry Now. Learn more.";function cKa(b,a){b=a||new U;b[R](bKa);if(!a)return b[t]()}
+var dKa="vZ",eKa="v5",fKa="v4",EF='"><span class="',gKa="v1",hKa="Oops&hellip; the system encountered a problem (#",iKa="Oops&hellip; the system encountered a problem",jKa="Retrying in ",kKa="&hellip;",lKa="Retrying now&hellip;",Z="</div>";function mKa(b,a){var c=a||new U;c[R](X,dKa,J,eKa,J,fKa,EF,gKa,W);b.NG?c[R](hKa+(b.NG+xh)):c[R](iKa);c[R](oE);b.xla?c[R](jKa+(b.xla+kKa)):c[R](lKa);c[R](Z);if(!a)return c[t]()}var nKa="Unable to reach ",oKa=". Please check your internet connection. Connecting in 999s...";
+function pKa(b,a){b=a||new U;b[R](nKa+(Ji+oKa));if(!a)return b[t]()}var qKa="Try Now.";function rKa(b,a){b=a||new U;b[R](qKa);if(!a)return b[t]()}var sKa='<span class="v1">',tKa=".</span> ",uKa="Please check your internet connection.",vKa="Connecting in ",wKa="Trying to reconnect now&hellip;";function xKa(b,a){var c=a||new U;c[R](X,dKa,J,eKa,J,fKa,W,sKa+(nKa+(Ji+tKa)),uKa,J);b.xla?c[R](vKa+(b.xla+kKa)):c[R](wKa);c[R](Z);if(!a)return c[t]()}var yKa="v0",zKa="v2 e",AKa="Retry now",BKa=' <a target="_blank" href="';
+function CKa(b,a){var c=a||new U;c[R](X,yKa,W);b.xla&&kE({id:b.hic,className:zKa,Ab:AKa},c);b.io&&c[R](BKa,b.io,W,eB,hB);c[R](Z);if(!a)return c[t]()}var DKa="Try now";function EKa(b,a){var c=a||new U;b.xla&&kE({id:b.hic,className:zKa,Ab:DKa},c);if(!a)return c[t]()}var FKa="v3";function GKa(b,a){var c=a||new U;c[R](X,dKa,J,FKa,EF,gKa,W,b.ke,iF);if(!a)return c[t]()}var HKa="vX";
+function IKa(b,a){BD[z](this,b,new BF(b,12));this.mQc=a;this.Y=qC(b).W();this.Lb=Tz(b);this.cnb=b.J(Cz);this.fc=dC(b);K(this.ia.b(),HKa);a=new rF(b);a.Qr(-1);this.ia.so(a);var c=G(this.nUc,this);this.EP=new eE(b);this.EP.Qr(-1);this.EP.n4=c;this.EP.qe();this.v1=new eE(b);this.v1.Qr(-1);this.v1.n4=c;this.v1.qe();eF(a,[this.EP,this.v1]);this.H().w(a.b(),P,this.He);(this.Fv=this.cnb.Fv)&&this.H().w(this.Fv,ZD,this.Wpb);this.Ck=VC(b);this.H().w(this.Ck,cC,this.gqb);this.qc(k);this.xf=fy(b)}
+function JKa(b){b.Pa()}var KKa=":9";function LKa(b,a,c){if(b.hca){if(c+a<b.FSa){cA(b.hca);b.hca=bA(KKa,b.R6b,a,b);b.FSa=c+a}}else{b.hca=bA(KKa,b.R6b,a,b);b.FSa=c+a}}var FF="OK",MKa="SLOW";function NKa(b,a){var c=b.xf.ud.jNa(),d;if(c[u]==0)d=FF;else{d=6E4;var f=15E3;if(b.qa==MKa){d/=2;f/=2}for(var g=FF,j=0;j<c[u];j++){var n=c[j];if(a-n.Mu>=(n.gia?d:f))g=MKa}d=g}b.EG(d,a);c[u]&&LKa(b,1E4,a);return d!=FF}
+function OKa(b){for(var a=i,c=b.Ck.sK(),d=0;d<c[u];d++)if(c[d].ts()<4){var f=c[d],g;if(f.B)g=jA(f.B(),cC);else{var j=f.rv();if(j&&j.B)g=jA(j.B(),cC)}if(!g&&b.mQc||b.fc==g){a=f;break}}return a}var PKa="LOADING";function QKa(b,a){var c=OKa(b);if(c==i)return k;b.Iaa=c.kua();b.p_b=c.Nf();if(b.p_b){b.EG(PKa,a);return h}return k}function RKa(b){var a={ke:b.p_b};Q(b.EP.b(),GKa(a));Q(b.v1.b(),I)}function SKa(b){var a={ke:b.Iaa};Q(b.EP.b(),GKa(a));Q(b.v1.b(),I)}var TKa=":10";
+function UKa(b){this.na=void 0;this.AAa=I;this.Sh=[];this.fc=dC(b);this.ab=new aA(TKa,2E3);this.w(this.ab,yj,this.MWc)}function VKa(b,a){this.id=b;this.ke=a}function WKa(b,a){ik(eC(b.fc)[yc],a)}var GF="sa";function XKa(b){return b.J(GF)}function HF(b){this.Bc=b}var IF="C",YKa="vY",ZKa="Error ",JF="V",KF="ba",aLa="beforeaction",LF="ga",MF="lc";
+function NF(b){Bx(this);BD[z](this,b,new gF(b));b[kq](IF,this,h);this.XF=XKa(b);this.Aa=Dx(Cx(b));this.xB=sC(b);this.jNb=qC(b);this.xl=tE(b);this.Aad=qC(iA(b));this.xf=fy(b);this.Bd=rD(b);this.qUa=rD(iA(b));this.dda=VC(b);this.H().w(jF(b),Cz,this.Bob);this.H().w(this.dda,cC,this.fqb);this.Xdc=k;this.mw=aF(this.B());this.C_a=new KIa(this.mw);this.xB.lf();var a=this.xf.ud,c=iA(this.B()),d=qC(c).W().ba(T,{className:YKa});this.zcc=d;this.qUa.Zf[o](d);var f=this.Aad.Fp();f=new xA(c,new EA(pm(f)),ZAa());
+f.B_a=ZKa;d[o](f.b());f.ma();ZC(dC(c).Ec(),f);var g=dC(this.B()).Ec()==UC(RC(this.B()));this.did=d=new IKa(c,g);d.Qr(-1);g&&uIa(a,d);a=new rF(c);a.ha(new cF(c));a.ha(d);a.ha(new cF(c));f.so(a);this.H().w(d,JF,this.Pic);this.Pic();this.JD();this.H().w(this,KF,this.uka);this.H().w(this,aLa,this.JYc);this.H().w(b.Ya(),jD,this.qTa);this.H().w(this.xf.ud,Gx(wo),this.Wdc);Fh&&this.H().w(this,LF,this.s0c);this.H().w(this.xf.ud,Fx(MF),this.Epb);O.S().Lr(Kh,G(this.FTa,this));c=hF(b);a={mail:100,contacts:90};
+for(var j in a)c.m8b[j]=a[j];j=new bF(b);b[kq](oy,j);try{yA++;Mx().Kh(5,this)}finally{zA()}}function bLa(b,a){if(!b.w8a){b.w8a=new gF(b.B());b.ia.ha(b.w8a)}b.w8a.ha(a)}function cLa(b){b=new eE(b.B());Q(b.b(),VIa({dIb:Ei,bIb:gea,UQc:Wla}));return b}function dLa(b){var a=OF.J();a=tm(a);b=Rz(b)[hq](Pz);for(var c=0;c<b[u];c++)a[b[c][1]]=b[c][0];return a}function PF(b){for(;b;){if(b instanceof NF)return b;b=b.rv()}return i}function QF(b,a,c){(b=PF(b))&&b.Ox(a,c)}function eLa(b){aF(b.B()).s5a()}
+var RF="W";function SF(b,a){N[z](this,RF,b);Gp(this,a)}function TF(b,a,c,d){N[z](this,a,b);this.q9=Ke(c)?c:i;this.Qza=Ke(d)?d:i}var UF="ca";function fLa(b,a,c,d,f,g,j){N[z](this,UF,b);jaa(this,a);this.vb=c;ok(this,d);this.czc=f;this.jCd=!!g;this.HPb=!!j}function gLa(b){var a=[];hLa(b,a,iLa);return a[kd](Sf)}var jLa="fieldset",VF="file",kLa="select-multiple",WF="image",lLa=".x",mLa=".y";
+function hLa(b,a,c){for(var d=b.elements,f,g=0;f=d[g];g++)if(!(f[Uk]||f[ed][od]()==jLa)){var j=f[ec];switch(f[Zb][od]()){case VF:case oj:case Gka:case jo:break;case kLa:f=nLa(f);if(f!=i)for(var n,s=0;n=f[s];s++)c(a,j,n);break;default:n=nLa(f);n!=i&&c(a,j,n)}}d=b[ic](zm);for(g=0;f=d[g];g++)if(f[sk]==b&&f[Zb][od]()==WF){j=f[ec];c(a,j,f[q]);c(a,j+lLa,Ah);c(a,j+mLa,Ah)}}function iLa(b,a,c){b[p](aa(a)+ei+aa(c))}
+function oLa(b){b=b.elements;for(var a,c=0;a=b[c];c++)if(!a[Uk]&&a[Zb]&&a[Zb][od]()==VF)return h;return k}var XF="checkbox",pLa="radio",qLa="select-one";function nLa(b){var a=b[Zb];if(!Ke(a))return i;switch(a[od]()){case XF:case pLa:return b[Mq]?b[q]:i;case qLa:a=b[Hq];return a>=0?b[br][a][q]:i;case kLa:a=[];for(var c,d=0;c=b[br][d];d++)c[gq]&&a[p](c[q]);return a[u]?a:i;default:return Ke(b[q])?b[q]:i}}function YF(){}
+function rLa(b,a,c){switch(b){case 1:case 3:return 8;case 4:return a;case 7:return 100;case 6:return c||0;case 8:return 101;case 5:return 9;default:return 102}}function ZF(){this.ob=new Gh;ih(this.ob,Hh,this.cva,k,this);ih(this.ob,Ih,this.YUb,k,this)}function sLa(b,a){if(b=a.RC){var c=new U;Ef(b,function(d,f){c[R](Qf(f),ei,Qf(d),Sf)});return c[t]()}else if(a.QC)return gLa(a.QC);return I}function tLa(b){this.V=b;this.iQ=new fC;this.wVa=new fC}var uLa="STARTED",vLa="drqchanged";
+function wLa(b){if(!b.iQ.nd())if(!b.tWb)if(!b.uRa){if(b.xt){var a=b.xt.xc();if(a==YBa)b.xt=i;else if(a==VBa&&!b.xt.Eg())b.xt=i;else return}b.tWb=h;try{for(;!b.xt&&!b.iQ.nd();){var c=b.iQ.ly();if(c.h2a){b.xt=c;c.Eg()||XBa(c);UBa(c,new nB(i,100));aCa(c)}else{c.qa=uLa;QBa(PBa(c.V)).a6c(c);TBa(c,IB);lB(c,1);var d=new zD(c.Hn);c.Ja(d);b.xt=c;d[Mb]();var f=b.xt;f.Lc=d;f.Eg()||XBa(f)}}}finally{b.tWb=k}b[r](vLa)}}function aG(b){this.Cu=b;this.ela=new Hf}function xLa(b,a){b.ela[Pb](a.Je())}var yLa="INVALID";
+function zLa(b,a){for(var c=Zf(),d=b.ela.Sb(),f=0;f<d[u];f++){var g=d[f],j=b.ela.J(g),n=k,s=c-j.Hkb;if(a)n=h;else if(j.zMa()==yLa&&s>=ALa)n=h;else if(s>=BLa)n=h;if(n){b.ela[Pb](g);j.Pc||j.D()}}}function bG(){this.HD=0;this.GEa=new Hf;this.bFa={}}function CLa(b,a,c){for(var d=0;a!=i;){if(!(a.hC()&32)){d==0&&DLa(b,a.Je(),c);d==1&&DLa(b,a.pua(),c);d>0&&DLa(b,a.SQb(),c)}a=a.ac();d++}}function DLa(b,a,c){if(b.HD>0)Pwa(b,a,k)&&ELa(b,a,c);else jx(b,a,k,new FLa(a,[c],b.bFa))}
+function ELa(b,a,c){var d=b.GEa.J(a);d?hf(d,c):b.GEa.set(a,[c])}function FLa(b,a,c){za(this,b);this.dG=a;this.aJ=c||i}function KLa(b,a){hy[z](this,b,i);this.g1=a;this.Fh=new bG;this.YY=[]}function LLa(b){this.V=b;this.jb=JB(b);this.E9=hF(b);this.Na={}}function MLa(){}var cG="Ba";function NLa(b,a,c){N[z](this,cG,b);this.NCd=b;this.lDd=a;this.knb=c}function dG(b){return b.J(vA)}function OLa(b,a){var c=b.Na[a.id];if(!c){c=new MLa;b.Na[a.id]=c}return c}function PLa(b){this.Xp=b}
+function eG(){YE[z](this);Bx(this)}function QLa(b,a){b.Nhd=a}var fG="act";function RLa(b){b=b.jNa();for(var a=0;a<b[u];a++){var c=b[a];if(c.Rc(fG)){var d=c.H();if(d&&d.f5a){if(d.f5a())continue}else if(d&&c.xG.H().f5a())continue;return h}}return k}function _A(){return arguments[u]==1&&mm(arguments[0])?[arguments[0]]:top.Array[cd](i,arguments)}function SLa(b,a){this.vv=dE(b);this.xDc=a}var TLa="closure_frame";function gG(){this.Jb=TLa+ULa++;this.Kva=[];VLa[this.Jb]=this}var WLa="_inner";
+function XLa(b,a){b=Nf(b[ec],WLa)?b[Oc][ec]:b[ec];var c=VLa[b[Zc](0,b[Sc](mg))];c&&b==c.A_&&c.qfb(a)}function YLa(b,a){Ef(a,function(c,d){c=Aw(zm,{type:yd,name:d,value:c});b[o](c)})}function ZLa(b,a,c,d){if(b.ng)e(Error(".136"));c=new Sh(c||a[jr]);d&&bi(c);b.c8=c;b.Nh=a;Op(b.Nh,c[t]());aMa(b)}var hG="10px",bMa="-10px",cMa="<body><iframe id=",dMa=" name=",eMa="></iframe>",iG="textarea";
+function aMa(b){b.ng=h;b.gy=k;b.eo=0;b.A_=b.Jb+mg+(b.IWc++)[t](36);var a={name:b.A_,id:b.A_};if(L&&wg<7)a.src=xDa;b.xe=Aw(Td,a);a=b.xe[x];Fa(a,yd);ka(a,Wa(a,hG));if(Jg)Zla(a,lp(a,bMa));else{Ja(a,sd);a.top=ck(a,bMa)}if(L){Pa(b.Nh,b.A_||I);ea[Lc][o](b.xe);ih(b.xe,Lh,b.kpb,k,b);try{b.wab=k;b.Nh.submit()}catch(c){nh(b.xe,Lh,b.kpb,k,b);b.Po(1)}}else{ea[Lc][o](b.xe);a=b.A_+WLa;var d=om(b.xe),f=cMa+a+dMa+a+eMa;if(Ng)Q(d[mc],f);else d[nq](f);ih(d[ub](a),rj,b.hza,k,b);var g=b.Nh[ic](iG);f=0;for(var j=g[u];f<
+j;f++)dh(g[f])!=g[f][q]&&ah(g[f],g[f][q]);g=d.importNode(b.Nh,h);Pa(g,a);d[Lc][o](g);var n=b.Nh[ic](nj),s=g[ic](nj);f=0;for(j=n[u];f<j;f++)xp(s[f],n[f][Hq]);n=b.Nh[ic](zm);s=g[ic](zm);f=0;for(j=n[u];f<j;f++)if(n[f][Zb]==VF)if(n[f][q]!=s[f][q]){Pa(b.Nh,a);g=b.Nh;break}try{b.wab=k;g.submit();d[Xk]();if(Fh)b.nPb=Dh(b.ehc,250,b)}catch(v){nh(d[ub](a),rj,b.hza,k,b);d[Xk]();b.Po(2)}}}function fMa(b){var a=b.xe;gMa(b);hMa(b);bda(Nh,a);try{b[r](Ih)}finally{cda(Nh)}}
+function gMa(b){var a=b.xe;if(a){ja(a,i);cp(a,i);oa(a,i);b.Kva[p](a)}if(b.y_){Eh(b.y_);b.y_=i}if(Fh||Ng)b.y_=Dh(b.l9a,2E3,b);else b.l9a();b.xe=i;b.A_=i}function hMa(b){b.Nh&&b.Nh==jG&&Pg(b.Nh);b.Nh=i}function iMa(b){if(b.xe)return om(jMa(b));return i}function jMa(b){if(b.xe)return L?b.xe:om(b.xe)[ub](b.A_+WLa);return i}var kMa="incrementaldata";function lMa(b){N[z](this,kMa);ma(this,b)}
+function mMa(){this.tv=new gG;this.tv.rab=nMa;ih(this.tv,Hh,this.mUb,k,this);ih(this.tv,Ih,this.oUb,k,this);ih(this.tv,kMa,this.nUb,k,this)}function nMa(b){b=pm(b);var a=i;if(Ke(b.gmail_error))a=700+b.gmail_error;else if(Ke(b.rc))a=Tj+b.rc;return a}function kG(b){return bg(oMa,b)>=0}function pMa(){this.NUa=[];this.u9=new Hf}function qMa(b,a){if(rMa(b,a)){var c=b.u9.J(a);b.u9.set(a,c?c+1:1)}}function rMa(b,a){if(!a||a[Db](Md)>=0)return k;return h}var lG="GMAIL_IMP",sMa="%2F";
+function tMa(b){var a=!b.u9.nd();if(b.NUa[u]>0||a){var c=[];of(c,b.NUa);a&&of(c,uMa(b));(a=mi(lG,void 0))&&a!=I&&c[p](Rf(a));c=Qf(c[kd](Md));if(c[u]>3950){c=c[Zc](0,c[Sc](sMa,3950));Rf(c)}ax(lG,c,86400);if(L&&bg(wg,GIa)<0){for(;!mi(lG,void 0);){if(c[u]<100){c=I;break}c=c[Zc](0,c[Sc](sMa,c[u]-100));ax(lG,c,86400)}Rf(c)}b[bc]()}}function uMa(b){for(var a=[],c=b.u9.Sb(),d=0;d<c[u];d++){var f=c[d];a[p](f+Qd+b.u9.J(f))}return a}
+function vMa(b){b.pb(mG?wMa:xMa);var a=Mg(),c=new U(a[ib]);c[R](Qd);c[R](a[id]);b.jj(yMa,c[t]())}function nG(b){return new zE(EB,b,k,k)}function oG(b){return new zE(EB,b,h,k)}function pG(b){return new zE(EB,b,k,h)}function zMa(){this.Q=new kn(this)}function AMa(){BMa=this}function CMa(b,a,c,d,f){var g=new eG;g.J3=a;g.Fv=c;g.Fv&&g.Q.w(g.Fv,ZD,g.CIa);a=new ZF;mIa(g,a);if(d&&!mga){d=new mMa;top[f]=XLa;top[f]=og(zga,top[f]);mIa(g,d)}b.Y0b(g);return g}var DMa="legacycontacts";
+function qG(b){return jA(b,DMa)}var EMa="pcab";function rG(b){return(b=jA(b,DMa))&&b.dcb(EMa)}function sG(b,a,c){this.uE=b;this.Jb=a;this.BKb=new cg(c)}function FMa(b){if(!b.aPb)b.aPb=new cg(b.uE);return b.aPb}var GMa="hilite",HMa="canceldismiss",tG="dismiss";function uG(b,a,c){this.wj=b;this.JF=c;this.Kc=a;ih(a,[GMa,nj,HMa,tG],this);this.pz=i;this.Rg=[];this.Hy=-1;this.aC=0;this.ZD=this.zf=i}
+function IMa(b){if(b.Hy>=b.aC&&b.Hy<b.aC+b.Rg[u]-1){b.mU(b.Hy+1);return h}else if(b.Hy==-1){b.mU(b.aC);return h}return k}function JMa(b){if(b.Hy>b.aC){b.mU(b.Hy-1);return h}else b.GGa&&b.Hy==b.aC&&b.mU(-1);return k}function KMa(b){if(!b.ZD)b.ZD=ba[xc](G(b.nw,b),100)}function LMa(b){ba[xc](G(function(){if(this.ZD){ba[gb](this.ZD);this.ZD=i}},b),10)}function vG(b,a){a=a-b.aC;if(a<0||a>=b.Rg[u])return-1;return a}
+function wG(b,a){if(xG(b))b.selectionStart=a;else if(L){var c=MMa(b),d=c[0];if(d[vk](c[1])){a=NMa(b,a);d[tk](h);d[Ak](zl,a);d[Fk]()}}}function yG(b){return OMa(b,h)[0]}var PMa="EndToStart",QMa="StartToEnd",RMa="\r\n";
+function OMa(b,a){var c=0,d=0;if(xG(b)){c=b[Ima];d=a?-1:b.selectionEnd}else if(L){var f=MMa(b),g=f[0];f=f[1];if(g[vk](f)){g[Hk](PMa,f);if(b[Zb]==iG){b=f[Mk]();var j=g[jb];c=j;f=d=b[jb];for(var n=k;!n;)if(g[gl](QMa,g)==0)n=h;else{g[al](zl,-1);if(g[jb]==j)c+=RMa;else n=h}if(a)a=[c[u],-1];else{for(a=k;!a;)if(b[gl](QMa,b)==0)a=h;else{b[al](zl,-1);if(b[jb]==d)f+=RMa;else a=h}a=[c[u],c[u]+f[u]]}return a}c=g[jb][u];d=a?-1:g[jb][u]+f[jb][u]}}return[c,d]}
+function zG(b,a){if(xG(b))b.selectionEnd=a;else if(L){var c=MMa(b),d=c[1];if(c[0][vk](d)){a=NMa(b,a);b=NMa(b,yG(b));d[tk](h);d[al](zl,a-b);d[Fk]()}}}function SMa(b){return OMa(b,k)[1]}function AG(b,a){if(xG(b)){b.selectionStart=a;b.selectionEnd=a}else if(L){a=NMa(b,a);b=b[Dk]();b[tk](h);b[Ak](zl,a);b[Fk]()}}
+function TMa(b,a){if(xG(b)){var c=b[q],d=b[Ima];pa(b,c[nc](0,d)+a+c[nc](b.selectionEnd));b.selectionStart=d;b.selectionEnd=d+a[u]}else if(L){c=MMa(b);b=c[1];if(c[0][vk](b)){c=b[Mk]();la(b,a);b[Hk](Al,c);b[Fk]()}}else e(Error(".137"))}function MMa(b){var a=b[Mc]||b[yc],c=a[uk][Bk]();if(b[Zb]==iG){a=a[Lc][Dk]();a[Tk](b)}else a=b[Dk]();return[a,c]}function NMa(b,a){if(b[Zb]==iG)a=b[q][Zc](0,a)[mb](/(\r\n|\r|\n)/g,ch)[u];return a}function xG(b){try{return typeof b[Ima]==Qe}catch(a){return k}}
+var UMa=",;",VMa="[\\s",WMa="]+",XMa="[\\s]+",YMa="\\s*[",ZMa="]$";function BG(b,a,c,d){d=d||150;this.XBa=Ue(b)?b:UMa;this.HAc=this.XBa[Zc](0,1);b=this.Jja?VMa+this.XBa+WMa:XMa;this.gic=new RegExp(Ty+b+Bl+b+Od,ag);this.bid=new RegExp(YMa+this.XBa+ZMa);this.g_b=a||I;this.jcd=this.Jja=c!=i?c:h;this.ab=d>0?new Bh(d):i;this.tw=new kn(this);this.Aoa=new kn(this);this.sc=new hn;this.Kia=-1}
+function aNa(b,a){var c=b.Jja&&a[Ob]&&b.XBa[Db](String[rq](a[Ob]))!=-1;b.xcc&&c&&b[mr]();if(b.gwb&&c)if(b.kd.vI()){a[zb]();return h}return k}function bNa(b){if(b.b3){b.b3=k;b.tw.hb(b.Ul,Zi,b.ql);b.tw.hb(b.Ul,jj,b.qka)}}function cNa(b,a,c){b=dNa(b,a);if(c==a[u])return b[u]-1;for(var d=a=0,f=0;d<b[u]&&f<c;d++){f+=b[d][u];a=d}return a}
+function dNa(b,a){if(!b.Jja)return[a];a=String(a)[Cc](I);for(var c=[],d=[],f=0,g=k;f<a[u];f++)if(b.g_b&&b.g_b[Db](a[f])!=-1){if(b.Zbb&&!g){c[p](d[kd](I));Ia(d,0)}d[p](a[f]);g=!g}else if(!g&&b.XBa[Db](a[f])!=-1){d[p](a[f]);c[p](d[kd](I));Ia(d,0)}else d[p](a[f]);c[p](d[kd](I));return c}var eNa="Jd-SUR3Rd",fNa="Jd-oKdM2c",gNa="Je",hNa="Jd-Je",iNa="Jd-JU";
+function CG(b,a,c,d){this.mh=b||ea[Lc];this.ya=Cg(this.mh);this.XL=!b;this.wa=i;this.pz=I;this.Rg=[];this.uZa=this.KK=-1;this.yg=k;m(this,eNa);this.yBa=fNa;this.PZb=gNa;this.JFa=hNa;this.SLc=iNa;this.xea=a||i;this.cqd=d!=i?d:h;this.Hfd=c!=i?c:k;this.ekb=i;this.v_a=k}var DG="display:none",jNa="listbox",kNa="combobox",lNa="autocomplete",mNa="list";
+function nNa(b){if(!b.wa){var a=b.ya.ba(T,{style:DG});b.wa=a;b.gdc(a);fn(a,jNa);a.id="goog-acr-"+oNa++;if(b.zf){fn(b.zf,kNa);gn(b.zf,lNa,mNa);gn(b.zf,yo,h)}b.ya[o](b.mh,a);ih(a,P,b.sj,k,b);ih(a,fj,b.CH,k,b);ih(b.ya.cb(),P,b.fUb,k,b);ih(a,Xi,b.BK,k,b)}}var pNa="(.*?)(^|\\W+)(",qNa="gi";
+function rNa(b,a,c){if(a[nb]==3){var d,f=i;if(Ve(c)){d=c[u]>0?c[0]:I;if(c[u]>1)f=qf(c,1)}else d=c;if(d[u]!=0){var g=a[md];d=ox(d);d=new RegExp(pNa+d+xh,qNa);c=[];for(var j=0,n=d[hb](g);n;){c[p](n[1]);c[p](n[2]);c[p](n[3]);j=d[Mma];n=d[hb](g)}c[p](g[Zc](j));if(c[u]>1){pk(a,c[0]+c[1]);f=b.ya[Qb](Ph);m(f,b.SLc);b.ya[o](f,b.ya[yb](c[2]));f=a[A][Bb](f,a[fc]);for(g=c[u]-1;g>=3;g--)a[A][Bb](b.ya[yb](c[g]),f[fc])}else f&&rNa(b,a,f)}}else for(a=a[Tb];a;){f=a[fc];rNa(b,a,c);a=f}}
+function sNa(b,a){for(;a&&a!=b.wa&&!Bg(a,b.yBa);)a=a[A];return a?ff(b.xx,a):-1}function tNa(b){this.Ud=b}function EG(b,a,c,d){this.V=b;this.Bd=rD(b);uG[z](this,this,this.PJa(),this.Iqa());this.Ve=this.JF;this.Ve.kd=this;this.l4=a||qG(this.V);this.XX=c;this.Nfa=d;Bx(this)}function uNa(){if(this.Ib()){var b=this.zf,a=Um(b);b=Mm(b);if(!jia(this.UHa,a)||!hia(this.F0a,b)){this.UHa=a;this.F0a=b;this.If()}Dh(uNa,1E3,this)}}var FG="za";function vNa(b){var a=new EG(b);b[kq](FG,a);return a}
+function GG(b){return b.J(FG)}function wNa(b,a){BB[z](this,b,a)}function HG(b){return new wNa(EB,b)}var xNa=":16",yNa=";8";function zNa(b,a){var c=ri(Fga);if(a){_B_log(ANa,c?1:0);if(!c){oi(Fga);bA(xNa,function(){b[Ic][Sq](h)},2E3);return}}_B_record();Mda(Fga);try{main()}catch(d){rg(tg,yNa,d)}}function BNa(b,a,c){this.Ea=b;this.Rf=a;this.eka=c||40}function IG(b,a){var c=lx(T);Q(c,b);return(new CNa(c,a?DNa:ENa)).jh()}
+function CNa(b,a){this.Skd=a;this.CRa=k;this.ngc=[];this.Asb=this.ntb=0;this.O8=2;this.CXa=1;this.nqa=[];for(JG(this,1,b);this.nqa[u]!=0;){b=this.nqa.pop();a=this.nqa.pop();switch(b){case 1:FNa(this,a);break;case 2:this.ntb+=a;break;case 3:this.Asb+=a;break;case 4:GNa(this,a);break}}}function HNa(b,a){if(a[u]!=0){switch(b.CXa){case 2:b.O8==0&&INa(b,J);break;case 3:for(;b.O8<1;)JNa(b);break;case 4:for(;b.O8<2;)JNa(b);break}b.CXa=1;b.O8>0&&INa(b,KNa(b,h));INa(b,a);b.O8=0}}
+function INa(b,a){b.ngc[p](a)}function JNa(b){b.O8>0?INa(b,KNa(b,k)+ch):INa(b,ch);b.O8++}function KNa(b,a){b=Dw(Uf,b.ntb);if(a&&b[u]>0)b+=J;return b}function GNa(b,a){if(b.CXa<a)b.CXa=a}function JG(b,a,c){b.nqa[p](c);b.nqa[p](a)}var LNa="#text",KG="SELECT",MNa="________________________________",NNa="XMP",ONa="gmail_quote";
+function FNa(b,a){a[fc]!=i&&JG(b,1,a[fc]);var c=a[uc];if(!(c&&ef(b.Skd,c))){if(PNa[cb](a[Gb]))QNa(b,4);else RNa[cb](a[Gb])&&QNa(b,3);switch(a[Gb]){case LNa:a=a[md][mb](SNa,I)[mb](TNa,ch)[mb](UNa,ch);if(b.Asb==0){if(a[u]!=0){c=" \t\u000c\r\n\u200b"[Db](a[xb](0))!=-1;var d=" \t\u000c\r\n\u200b"[Db](a[xb](a[u]-1))!=-1;a=a[mb](VNa,J)[mb](WNa,I);c&&GNa(b,2);HNa(b,a);d&&GNa(b,2)}}else{a=a[Cc](ch);HNa(b,a[0]);for(c=1;c<a[u];c++){JNa(b);HNa(b,a[c])}}return;case Cl:JNa(b);return;case qha:case Dl:case KG:return;
+case Bd:b.CRa=h;HNa(b,MNa);return;case Iaa:case NNa:b.Asb++;JG(b,3,-1);break;case be:b.CRa=h;if(Bg(a,ONa)){b.ntb++;JG(b,2,-1)}break;default:b.CRa=h;break}a[Tb]!=i&&JG(b,1,a[Tb])}}function QNa(b,a){GNa(b,a);JG(b,4,a)}function LG(b,a){this.mAa=4;this.Jv=a||undefined;bo[z](this,b)}function MG(b,a,c,d,f){b.jja=a==i||a instanceof Bm?a:new Bm(a,c,d,f);b.Ib()&&b.If()}
+var XNa="wc",YNa='" role="alert" tabindex="-1"><table cellpadding="0" class="',ZNa="wf",aOa="wk",bOa="Dp",cOa="Keyboard shortcuts",NG='</td><td class="',dOa="wj",eOa='"><a id="',fOa='" target="keyboard_shortcuts_help_window" href="',gOa="wi",hOa="Open in a new window",iOa='</a> | <span id="',OG="Close",jOa='</span></td></tr></table><table cellpadding="0" class="',PG="wd",kOa='"><tr>',QG='<td class="',lOa="Dn",RG='"><table cellpadding="0" class="',mOa='"><tbody>',nOa='<tr><th class="',oOa="Do",pOa=
+'" /><th class="',qOa="</th></tr>",SG='<tr><td class="',rOa="wg",sOa=':</td><td class="',tOa="we",TG="</td></tr>",uOa="</tbody></table></td>",vOa="</tr></table></div>";
+function wOa(b,a){var c=a||new U;c[R](X,XNa,YNa,ul,J,ZNa,El,aOa,J,bOa,W,cOa,NG,dOa,J,bOa,eOa,b.Imd,fOa,b.ijd,S,gOa,W,hOa,iOa,b.p6a,S,gOa,W,OG,jOa,ul,J,PG,kOa);b=b.uq;for(var d=b[u],f=0;f<d;f++){var g=b[f];c[R](QG,lOa,RG,ul,mOa);for(var j=g[u],n=0;n<j;n++){var s=g[n];c[R](nOa,oOa,pOa,oOa,W,V(s[Pk]),qOa);s=s.bq;for(var v=s[u],C=0;C<v;C++){var M=s[C];c[R](SG,rOa,J,lOa,W,M.key,sOa,tOa,J,lOa,W,V(M[qr]),TG)}}c[R](uOa)}c[R](vOa);if(!a)return c[t]()}
+function UG(b){nn[z](this);this.V=b;this.Y=qC(b).W();this.Lb=Tz(b);this.Cb=sC(b);this.na=new kn(this);var a=this.Y.ba(T);K(a,eo);rD(b).Zf[o](a);this.Ha=new LG(a);this.Ha.Hu(k)}var xOa="<Shift>",yOa="<Esc>",zOa="<Ctrl>";function AOa(b,a){return a[od]()!=a?[xOa,tl,a[od]()]:a==String[rq](27)?yOa:a==String[rq](17)?zOa:a}var BOa="\t",VG="or",COa="then";
+function DOa(b,a){var c=[];if(a[u]>1){a=a[Cc](BOa);for(var d=0;d<a[u];d++){var f=a[d];d>0&&c[p](VG);for(var g=0;g<f[u];g++){of(c,AOa(b,f[xb](g)));g!=f[u]-1&&!ef(EOa,c[c[u]-1])&&c[p](COa)}}}else of(c,AOa(b,a));return c}var FOa="SAVE_DRAFT",GOa="<Enter>",HOa="tab",IOa="<Tab>",WG='<span class="',JOa="wb",KOa="wh",XG="</span> ";
+function LOa(b){var a=new Hf(dLa(b.V));a.set(FOa,MOa);for(var c=[],d=0;d<NOa[u];d++){for(var f=[],g=NOa[d],j=0;j<g[u];j++){for(var n=g[j],s=n.bq,v=[],C=0;C<s[u];C++){var M=s[C],Y;if(Ve(M)){Y=M[0];M=M[1]}else{Y=M;M=YG[M]}var ha=[];if(a.Xb(Y))ha=DOa(b,a.J(Y));else{Y=Y[Cc](/\b/);for(var tb=0;tb<Y[u];tb++){var zc=Y[tb];if(zc==Bl)ha[p](VG);else if(zc==Md)ha[p](Md);else if(zc==Uf)ha[p](COa);else if(zc[od]()==yka)ha[p](GOa);else if(zc[od]()==HOa)ha[p](IOa);else a.Xb(zc)?of(ha,DOa(b,a.J(zc))):ha[p](zc)}}Y=
+{Grd:ha};ha=new U;Y=Y.Grd;tb=Y[u];for(zc=0;zc<tb;zc++)ha[R](WG,zc%2?JOa:KOa,W,V(Y[zc]),XG);ha=ha[t]();v[p]({key:ha,description:M})}f[p]({title:n[Pk],bq:v})}c[p](f)}return c}function OOa(b){if(b==undefined)b=[];this.CQc=POa(b[0]);this.wQc=POa(b[1]);this.kPc=POa(b[2]);this.lPc=POa(b[3]);this.jPc=POa(b[4])}function POa(b){if(b!=undefined)return b!=0}function QOa(b){if(b!=undefined)return b?1:0}
+var ROa="In addition to marking this message as spam, ",SOa=" can attempt to automatically unsubscribe you from ",ZG="<b>",TOa="</b>, by sending an unsubscribe request on your behalf.",aH="<div>",bH=' <a href="',cH='" target="_blank">',UOa="Learn more.",dH="</a></div>";function VOa(b,a){var c=a||new U,d=ROa+(Ji+(SOa+(ZG+(V(b[ec])+TOa))));c[R](aH,d,bH,b.tc,cH,UOa,dH);if(!a)return c[t]()}
+var WOa="In addition to marking these messages as spam, ",XOa=" can attempt to automatically unsubscribe you from these senders, by sending an unsubscribe request on your behalf.",YOa="</a><br><br>",ZOa="<div><b>",aPa="</b></div>";function bPa(b,a){var c=a||new U;c[R](aH,WOa+(Ji+XOa),bH,b.tc,cH,UOa,YOa);b=b.YX;for(var d=b[u],f=0;f<d;f++)c[R](ZOa,V(b[f]),aPa);c[R](Z);if(!a)return c[t]()}function cPa(b,a){EC[z](this,b);this.Lb=Tz(b);this.qGa=a;this.V=b;this.Jc()}function dPa(b){this.sAa=b}
+function fH(b){if(!Ue(b.IJb))b.IJb=ePa;return b.IJb}var fPa='".*?"';function gH(b,a){N[z](this,b);this.Pm=a;var c;try{var d=a[Kb](fPa)[0];c=d[Zc](1,d[u]-1)}catch(f){c=I}this.ck=c}function hH(b){if(!b.M7b)b.M7b=b.Pm?yh(b.Pm):i;return b.M7b}function iH(b,a,c,d){this.ya=c||Cg();this.Zva=0;this.Zv=b;this.gz=a;this.Vxa=d||{};this.G6a=[]}var gPa="log-connect";function hPa(b){N[z](this,gPa);this.hj=b}var jH="f-msg",kH="mf";function iPa(b){b[r](new gH(jH,zh([kH,I,I])))}
+function lH(b,a,c){this.Q=new kn(this);this.Zv=b;this.gz=a;this.Vxa=c||{}}function jPa(b){N[z](this,"flutestate");this.W1b=b}function kPa(b){N[z](this,kH);this.Pm=b}var mH="fe";function lPa(b){N[z](this,mH);this.nOb=b}function mPa(b,a){if(b=a==undefined?b.lA():a)if(b=b[4].renderer)return b;return 0}var nPa="nf0";function oPa(b){var a=b.lA();b.CZ=a&&a[1]!=nPa?1:b.CZ==1?3:2;b[r](new kPa(a))}var pPa="other",qPa="windows",rPa="Intel",sPa="mac",tPa="mac-ppc";
+function uPa(){var b=pPa;if(Ri)b=qPa;else if(Qi)b=Ti[Db](rPa)!=-1?sPa:tPa;return b}function vPa(b){return{os:uPa(b),clientver:1}}function wPa(b){if(!b.iDa)return 0;switch(b.iDa.pr){case ii:return 2;case Kd:return 1;default:return 0}}function nH(){var b=Ti[Db](rPa)!=-1;return Ri||Qi&&b}function oH(b,a){oB[z](this,b,pd);this.Wqd=a}function xPa(b){this.sg=b}function yPa(){Bx(this);this.s0=new Hf}function pH(b,a){return b.s0.J(a?a:b.F8a)}
+function zPa(b,a){for(var c=b.s0.Sb(),d=0;d<c[u];d++){var f=b.s0.J(c[d]);if(f.wH(a))return f}return i}function APa(b,a){for(var c,d=b.s0.Sb(),f=0;f<d[u];f++){c=b.s0.J(d[f]);c=qH(c,a);if(c!=i)return c}return c}var rH="da";function sH(b){return b.J(rH)}function BPa(){this.Vrb=[]}function tH(b){return b.J(Bz)}var CPa=":17";
+function DPa(b,a){var c=a?b.jMb:b.gr;b.IB();EPa(b);if(c){b.Xda&&b.Xda.Ad(c);b.qa=b.gr?2:0;if(!a&&c.U4!=-1)b.v_=bA(CPa,b.IK,c.U4,b);if(!a&&c.QE()>=0)b.xBb=bA(CPa,b.Mna,c.QE(),b)}else{b.Xda&&b.Xda.IK();b.qa=0}}function EPa(b){b.xBb&&cA(b.xBb);b.xBb=i}var FPa="^igs";function uH(b){var a=new Hf;a.set(ce,b);Gy[z](this,ce,a);this.yr=b;b=FPa+b;GPa[b]=h;Ry(b,this)}function vH(b){AD[z](this,b);this.Cb=sC(this[uq]())}function wH(b){pA[z](this,b)}
+function HPa(b,a){if(jfa.J()){if(b.Wx)Ua(b.Wx.b()[x],xd);b.Wx=a;Ua(b.Wx.b()[x],I)}else if(a!=b.Wx){if(a&&a.ac()!=b)e(Error(".139"));yA++;try{b.Wx&&b.Wx.qc(k);b.Wx=a;b.Wx&&b.Wx.qc(h);b.Ui()}finally{zA()}}}var IPa="history_state",JPa='<input type="text" name="%s" id="%s" style="display:none" />',xH="https",KPa="https:///",LPa="history_iframe",MPa='src="',NPa='<iframe id="%s" style="display:none" %s></iframe>';
+function yH(b,a,c,d){if(b&&!a)e(Error(".140"));var f;if(c)f=c;else{f=IPa+OPa;ea[nq](ux(JPa,f,f));f=Fg(f)}this.tva=f;this.dg=c?pm(Eg(c)):ba;this.GD=this.dg[Ic][Yc][Cc](Lj)[0]+Lj;this.LOa=a;if(L&&!a)this.LOa=ba[Ic][er]==xH?KPa:xDa;this.ab=new Bh(150);this.lca=!b;this.Q=new kn(this);if(b||L&&!zH){if(d)b=d;else{b=LPa+OPa;a=this.LOa?MPa+Wf(this.LOa)+Vf:I;ea[nq](ux(NPa,b,a));b=Fg(b)}this.xe=b;this.xic=h}if(L&&!zH){this.Q.w(this.dg,rj,this.j4b);this.dec=this.KKa=k}this.lca?this.gma(AH(this),h):BH(this,this.tva[q]);
+OPa++}function AH(b){return b.dja!==i?b.dja:b.lca?b.Mga(b.dg):PPa(b)||I}function QPa(b,a,c,d){if(AH(b)!=a)if(b.lca){b.gma(a,c);zH||L&&BH(b,a,c,d);b.Lf&&b.rJ()}else{BH(b,a,c);b.dja=b.Ry=pa(b.tva,a);b[r](new RPa(a))}}var SPa="text/html",TPa="replace",UPa="<title>%s</title><body>%s</body>";
+function BH(b,a,c,d){if(b.xic||a!=PPa(b)){b.xic=k;a=Qf(a);if(L){var f=om(b.xe);f[bb](SPa,c?TPa:undefined);f[nq](ux(UPa,Wf(d||b.dg[yc][Pk]),a));f[Xk]()}else{a=b.LOa+Lj+a;if(b=b.xe[gc])if(c)b[Ic][mb](a);else Mp(b[Ic],a)}}}function PPa(b){if(L){b=om(b.xe);return b[Lc]?Rf(b[Lc][wk]):i}else{var a=b.xe[gc];if(a){var c;try{c=Rf(b.Mga(a))}catch(d){b.BRa||b.WXa(h);return i}b.BRa&&b.WXa(k);return c||i}else return i}}var VPa="navigate";function RPa(b){N[z](this,VPa);this.ce=b}
+function WPa(b){this.V=b;this.rca=fD(this.V);this.Pd={};this.aIa=[];this.eP=b.J(Xx);if(!this.eP)e(Error(".141"));this.eP.Ac(h);this.eP.dk(this);ih(this.eP,VPa,this.dpb,k,this)}function XPa(b,a,c){b.Ry=b.Haa(a);b.eP.Zaa(b.Ry,c);b.Pd[b.Ry]=a}function YPa(b,a,c){delete b.Pd[b.Ry];b.Ry=b.Haa(a);QPa(b.eP,b.Ry,h,c);b.Pd[b.Ry]=a}function ZPa(b,a,c){a=a||AH(b.eP);b.Ry=a;return c?aQa(b,a):bQa(b,a)}
+function bQa(b,a){for(b.Pd[a]&&jf(b.aIa,a);b.aIa[u]>=40;)delete b.Pd[b.aIa[db]()];b.aIa[p](a);return b.Pd[a]?b.Pd[a]:(b.Pd[a]=aQa(b,a))}function aQa(b,a){a=a[Cc](Md);var c=a[db]();return(b=b.rca.PVb[c])?b.aca(c,a):i}function cQa(b,a,c,d){N[z](this,b);this.FV=a;this.iAc=c;this.rnb=d}function CH(b,a,c,d,f){this.kFc=b;this.NY=a||I;this.LWa=c||dQa;this.v4a=d||eQa;this.Fad=f||fQa}
+function DH(b){AD[z](this,new wH(b));this.V=b;this.rca=fD(b);this.nU=new WPa(b);this.H().w(this.nU,VPa,this.dpb);this.mw=b.J(ii);this.ut=b.J(IF);this.cGb=k;this.vz=[];this.Z2=new cg;this.y1b=new Hf;this.Ck=VC(b);this.Ck.yu.add(this);this.jb=JB(b);this.Jc()}function EH(b){return jA(b,TC)}function FH(b){return b.J(TC)}function GH(b){return b.Z2.Oa()}function gQa(b,a){if(!b.Z2[bd](a)){b.Z2.add(a);b.vz[jd](1,0,a);b.ia.ha(a);hQa(b,iQa)}}
+function jQa(b,a,c){if(!b.Z2[bd](a))return k;b.Z2[Pb](a);if(a==b.zc())b.vz[u]>1?kQa(b,b.vz[1]):kQa(b,i);jf(b.vz,a);if(a==b.gL){lQa(b);WC(b.Ck)}c||b.ia[Nc](a);return h}function mQa(b,a){(b=b.ut.ZG())&&UHa(b.TR,a)}function nQa(b,a){(b=b.ut.ZG())&&KE(b.TR,a)}function hQa(b,a){a=a||0;for(var c=b.vz[u],d=c-1;d>=1&&c>a;){var f=b.vz[d];if(f.EIb()){b.oWa(f);f.D();c--}d--}}function oQa(b){if(b.lya){b.lya.D();b.lya=i}}var pQa=":18",qQa="View Changed";
+function kQa(b,a){var c=b.zc();if(c&&c.gY())return k;c&&c.Df();yA++;try{if(a){if(!b.Z2[bd](a))e(Error(".143"));HPa(b.ia,a);jf(b.vz,a);b.vz[ld](a);b.kYb=h;a.Wb();b.f2b=h;b.Ui(vA)}else{HPa(b.ia,i);b.kYb=k}b[r](new cQa(kC,b.Cxa,c,a));if(c&&!c.Jpa()){jQa(b,c,h);L?b.X9b(c):bA(pQa,G(b.X9b,b,c),600)}}finally{mQa(b,qQa);zA()}if(a)XPa(b.nU,b.Cxa||{view:a.md()},rQa(b,a.TO()));b[r](new cQa(Wx,b.Cxa,c,a));WC(b.Ck);b.Cxa=i;return h}
+function lQa(b){if(b.xra){b.xra.tf();b.xra=i}if(b.Zia){GB(b.Zia,2);b.Zia=i}if(b.gL){var a=b.gL;b.gL=i;a.Bo(k)}}function sQa(b){if(b.gL){var a=[];b.gL.ej(a);if(!(NBa(a)<3)){a=b.gL;b.gL=i;a=kQa(b,a);if(b.Zia){GB(b.Zia,a?1:2);b.Zia=i}}}}function tQa(b){var a=b.zc();if(!a||!a.Bo(k)&&!a.gY()){a&&a.Df();return h}else{b.mw.s5a();return k}}function rQa(b,a){return b.yhc?b.yhc[z](i,a):a}function uQa(b,a){this.Rg=b;this.bqd=!a}var vQa="(^|\\W+)";
+function wQa(b,a,c){var d=[];if(a!=I){a=ox(a);var f=new RegExp(vQa+a,ii);axa(b.Rg,function(g){String(g)[Kb](f)&&d[p](g);return d[u]>=c})}return d}
+function xQa(b,a,c){var d=[];um(b.Rg,function(g,j){var n=a[od](),s=String(g)[od](),v=0;if(s[Db](n)!=-1)v=da((s[Db](n)/4)[t](),10);else for(var C=n[Cc](I),M=-1,Y=10,ha=0,tb;tb=C[ha];ha++){tb=s[Db](tb);if(tb>M){M=tb-M-1;if(M>Y-5)M=Y-5;v+=M;M=tb}else{v+=Y;Y+=5}}v<n[u]*6&&d[p]({Rld:g,IBa:v,index:j})});d[el](function(g,j){var n=g.IBa-j.IBa;if(n!=0)return n;return g[Lq]-j[Lq]});b=[];for(var f=0;f<c&&f<d[u];f++)b[p](d[f].Rld);return b}function yQa(b,a){zQa[b.id]||ih(b,lj,AQa);zQa[b.id]=a}
+function BQa(b){if(b){nh(b,lj,AQa);delete zQa[b.id]}}function AQa(b){K(b[y],zQa[b[y].id]);ih(b[y],kj,CQa)}function CQa(b){Ag(b[y],zQa[b[y].id]);nh(b[y],kj,CQa)}var DQa=":19";function HH(b){this.V=b;this.ee=new Hf;this.wYa={};this.gMa={};this.ab=new aA(DQa,3E4);ih(this.ab,yj,G(this.Pa,this))}var IH="ja";function EQa(b){return b.J(IH)}function FQa(b,a){b=b.WVb||I;if(a)a[R](b);else return b}var JH="ix_bi",KH="J";function GQa(b){var a=yy(b).db(JH)>0?KH:aE;return kA(b,a)}var HQa="1.8",IQa="6.0",JQa="520";
+function LH(){return Fh&&vg(HQa)||L&&vg(IQa)||Jg&&vg(JQa)||Ng&&vg(lca)}var MH="&nbsp;",KQa="</div><div>";function NH(b){b=Wf(b);b=b[mb](/ /g,Vwa);b=b[mb](LQa,ch);b=b[mb](MQa,ch);b=b;if(L){b=b[Cc](ch);for(var a=0;a<b[u];a++)if(Of(b[a]))b[a]=MH;b=aH+b[kd](KQa)+Z}else b=Gw(b);return b}
+var NQa=' cellspacing="0" style="border-collapse:separate"',OQa='><tr><td class="',PQa="lU",QQa='"></td><td rowspan="3" class="',RQa="lT",SQa="lN",TQa="lK",OH='"></td><td class="',UQa="lJ",VQa="lM",WQa="lL",XQa="lV",YQa='"></td></tr><tr><td rowspan="2" class="',ZQa="lR",aRa="lW",bRa='">&nbsp;</div></td><td class="',cRa='</td><td rowspan="2" class="',dRa="lS",eRa='">&nbsp;</div></td></tr><tr><td class="',fRa="lI",gRa='"></td></tr><tr><td colspan="2" class="',hRa="lP",iRa="lO",jRa='"></td><td colspan="2" class="',
+kRa="lQ",lRa='"></td></tr></table>';function PH(b,a){var c=a||new U;c[R](Fl,ul,Vf,b.OQc?NQa:I,OQa,PQa,QQa,RQa,J,SQa,J,TQa,OH,RQa,J,UQa,J,VQa,QQa,RQa,J,SQa,J,WQa,OH,XQa,YQa,ZQa,wl,aRa,bRa,V(b.EN),W,b[eq],cRa,dRa,wl,aRa,eRa,UQa,J,fRa,gRa,hRa,OH,iRa,jRa,kRa,lRa);if(!a)return c[t]()}var mRa="cm1";function nRa(b){this.Db=b;oRa=Jz(Rz(b),832)?mRa:Nd}function QH(b,a,c,d,f,g){this.Nsc=f;this.sja=g;Vn[z](this,b,a,c,d)}function RH(){}function SH(b,a,c){hy[z](this,b,a,c);this.jw=[]}
+function pRa(b,a){Ix(b);for(var c=0;c<b.jw[u];c++){var d=b.jw[c];if(!a||a!=d)d.rg()}}function qRa(b){wp(this,b)}
+function TH(b,a){this.gPb=b;this.Sq=a[0];this.gk=a[1];this.Qy=a[2];this.Jl=!(a[3]&&h);this.kl=a[5];this.Zba=a[6];this.M1=this.cwb=a[7];this.f8b=a[8];this.rB=a[9];this.SCa=a[10];this.eQc=!!a[11];this.dJb=a[12];this.gda=a[13];this.A4=a[14];this.Mhc=a[15];this.dL=a[16];this.XGa=a[17];this.Jt=a[18];this.DQc=!!a[20];this.apd=a[21];this.nS=a[23];this.HY=a[24];this.TCa=a[25]||this.Qy;Bx(this)}var rRa='class="zF"',sRa='class="yP"';
+function tRa(b){switch(b.utb){case 2:b.M1=b.cwb[mb](uRa,rRa);break;case 1:b.M1=b.cwb[mb](vRa,sRa);break}}function wRa(b,a){b=b.TCa;a=a.TCa;return b<a?-1:b>a?1:0}function xRa(b){this.Uk=b}function yRa(b){this.Mr=b}function UH(b,a){oH[z](this,b.B(),4);Bx(this);this.Z=Rz(b.B());this.Xi=b;this.Kd=a;this.xl=tE(this.B())}function zRa(){}function ARa(){}
+function VH(b){bG[z](this);this.qn=b;this.ON=[];this.HD=[];this.PN=new Hf;this.Ved=new ARa;this.na=new kn(this);this.na.w(this.qn.mb.Ya(),FG,this.u7c);this.na.w(this.qn.mb.Ya(),ED,this.F0c)}function WH(b,a,c){za(this,b);yp(this,a);this.Ih=c}function BRa(b,a,c){this.PBc=b;this.Kcd=a;this.Xbd=c}var XH="Fa";function CRa(b,a){N[z](this,XH,b);this.dG=a}function DRa(b){if(b.oc){b.oc[wc]();b.oc=i}}function ERa(b){if(b.oc)return l.max(b.Eo,b.oc.Ay()+b.oc.MT());return b.Eo}
+function FRa(b,a,c){c=a+c;return a>=b.Uz&&c<=b.Eo}function GRa(b,a,c,d){if(b.oc==a){if(!b.Vha)e(Error(".145"));if(c!=b.L8)e(Error(".144`"+c+qw+b.L8));if(c!=b.Eo)e(Error(".144`"+c+qw+b.Eo));b.ON[c]=d;b.PN.set(d.Je(),d);d.Iz();b.L8++;b.Eo++;if(!b.lVb){YH(b,new WH(1));b.lVb=h}}}function HRa(b){for(var a=b.Uz,c=b.Eo;c>=a;c--)if(b.J(c)!=i)return c+1;return a}function IRa(b){b=b.J(HRa(b)-1);if(!b)return i;return(b=b.J())?b.HY:i}function ZH(b){YH(b,new WH(7))}
+function JRa(b){if(!b.Vha)e(Error(".145"));for(var a=b.Eo,c=b.Uz;c<a;c++){var d=b.ON[c];d&&nya(d)}}function YH(b,a){if(b.Vha)b.HD[p](a);else{a=new CRa(b,[a]);var c=[];for(b=b;b;b=b.rv())c[p](b);for(b=0;b<c[u];b++){sa(a,c[b]);jx(c[b],a[Zb],k,a)}}}function KRa(){}function aI(b){VH[z](this,b);Bx(this);this.Yla(wRa)}
+function LRa(b){this.ug=b[1];this.nj=b[2];this.wna=Boolean(b[3]);this.y_a=b[4];this.ae=b[5];this.ZZa=b[6];this.Kmb=b[7];this.hEa=b[8];this.oO=b[9];this.dAb=b[10];this.j4a=b[11];this.Cgc=b[12];this.r9b=b[13]}function MRa(b,a){if(a!=b.nj){b.nj=a;b[r](oy)}}function NRa(b){this.Um=b}function ORa(b,a){Bx(this);SH[z](this,Qf(b.Dg()),a);this.Ea=b;this.gPb=Xy(this.Ea)}function PRa(b,a){if(!b.Pc){var c=a.Hc(),d=b.za(c,h);d||(d=new py(c,b,h,h));d.set(a);return d}}
+function QRa(b,a){b=b.Uc().Oa();for(var c=0;c<b[u];c++){var d=b[c].za(a);if(d&&d.Fi())return d.J().vf()}}function bI(b,a){b=b.Uc().Oa();for(var c=0;c<b[u];c++){var d=b[c],f=d.za(a);f&&f.Fi()&&d.rg()}}function RRa(b,a,c){Ix(b);b=b.Uc().Oa();for(var d=0;d<b[u];d++){var f=b[d].za(a);f&&f.hc()&&!f.Ds()&&c(f.J())}}function cI(b,a){(b=b.za(Qf(a.Dg()),k))&&b.Fi()&&b.rg()}function SRa(b){b=b.Uc().Oa();for(var a=0;a<b[u];a++){var c=b[a],d=c.Bb();c.hc()&&gza(d)&&c.rg()}}
+function TRa(b){b=b.Uc().Oa();for(var a=0;a<b[u];a++){var c=b[a];c.hc()&&c.rg()}}function URa(b,a){b=b.Uc().Oa();for(var c=0;c<b[u];c++){var d=b[c];d.za(a,h)&&d.rg()}}function dI(b){return new BCa(eI,b)}function VRa(){this.dHb={};this.Cf=0}
+function WRa(b,a){this.Ea=b;this.Sq=a[1];this.gk=a[2];this.wf=a[8];this.u9a=a[9];this.w9a={};var c=a[10];for(b=0;b<c[u];b++){var d=c[b];this.w9a[d[0]]=d[1]}this.dL=a[6];this.Qy=a[7];this.GQa={};if(a[11]){c=a[11];for(b=0;b<c[u];b++){d=c[b];this.GQa[d[0]]=d[1]}}this.a1=a[12];this.UHb=a[13]}function XRa(b){var a=nf(b.wf);of(a,b.u9a);return a}
+function YRa(b,a){var c=a.gf;if(ef(b.wf,c))b.v0&&jf(b.v0,c);else if(!ef(b.u9a,c))if(b.v0&&b.v0[u])if(b.v0[0]==c){b.wf[p](c);b.gk=c;b.v0[db]();b.K8[0]==c&&b.K8[db]();b[r](oy);ZRa(a,4)}}var aSa="draft",bSa="new";function cSa(b,a,c,d,f){if(!b.K8){b.K8=[];b.v0=[];if(!b.TQa)b.TQa=b.gk}if(b.TQa==a){b.TQa=c;if(!ef(b.wf,c)){f!=aSa&&b.v0[p](c);if(f==bSa){b.K8[p](c);b.CRc=d;b[r](oy)}}}}function fI(b){this.Um=b}function gI(b,a){oH[z](this,b.B(),a);this.IY=b}function dSa(b){this.Mr=b}
+function hI(b){gI[z](this,b.ac(),1);Bx(this);this.Yda=b}function eSa(b,a){b.kX=a}
+function fSa(b,a,c,d){this.Ea=b;this.Sq=a;this.gf=d[1];this.VVa=d[2]==I?i:d[2];this.eZ=d[3];this.fQb=d[4];this.dga=d[5];this.Nt=d[6];this.Od=new Date(d[7]);this.hZa=String(d[8]);this.vQ=d[9]||[];this.iOa=Boolean(d[10]);this.QXb=d[11];this.zba=d[12];this.lHa=c;this.vub=d[14];this.Tib=d[15];this.Gxb=d[16];this.Qbb=d[17];this.Zwa=Boolean(d[18]);this.rB=d[19];this.XGa=d[20];this.gda=d[21];this.hxa=d[22];this.LPb=d[23];this.llb=d[24];this.wXa=d[25];this.Zhd=!im(d[26])?d[26]:i;this.ewb=!im(d[27])?d[27]:
+i;this.dwb=!im(d[28])?d[28]:i;this.mYb=d[29];this.JOb=d[30];this.yic=d[31];Bx(this);this.aa.wU(d[lb](26))}function gSa(b){return b.JOb||b.Nt}var hSa="^u";function iI(b){return b.Zh(hSa)}function iSa(b,a){a?b.TL(hSa):b.bS(hSa)}function ZRa(b,a){if(b.eZ!=a){b.eZ=a;b[r](oy)}}function jSa(b){this.wja=b}function kSa(b,a){this.yL=b;this.Vy=a}function lSa(b,a){b.hG=a;b.aY=b.hG==0||b.hG==1||b.hG==3||b.hG==4;b.QNa=b.hG==1||b.hG==2}var mSa="image/";
+function nSa(b,a,c){this.P_b={};this.Fkc=I;for(var d=c[0],f=[],g=[],j=0;j<d[u];j++){var n=new kSa(b,a);n.fca(d[j]);this.P_b[n.z8]=n;if(Mf(n.lL,mSa))f[f[u]]=n;else g[g[u]]=n}c[u]>1&&oSa(this,c[1]);if(c[u]>2)this.Fkc=c[2];this.Sq=b;this.gf=a;this.mXc=f[u];this.sh=mf(f,g);this.odd=c}function oSa(b,a){b.vQc=a[0];b.znb=a[1];b.Gnb=a[2];b.T2b=a[3];b.U2b=a[4]}
+function pSa(b,a,c){this.Ea=b;this.Sq=a;this.gf=c[0];this.p_a=c[1];this.rIa=c[2];this.wHa=c[3];this.tWa=c[4];this.zba=c[5];this.DB=c[6];this.sh=new nSa(this.Sq,this.gf,c[7]||[]);this.tac=Boolean(c[8]);this.QVa=c[9];this.pIb=c[11];this.UYa=c[12];this.fkc=c[13];this.Dec=Boolean(c[14]);this.Zdc=Boolean(c[15]);this.NHb=Boolean(c[16]);this.I_b=c[17];this.pfc=c[18];this.awa=c[19];this.uub=c[20];this.tub=c[21];this.FRa=c[22];if(c[23])Xw(O.S(),UF).hc()?this.Jcc(c[23]):Vw(O.S(),UF,G(this.Jcc,this,c[23]));
+if(c[24][0]){this.Zwa=Boolean(c[24][0]);this.bkc=c[24][1];this.ckc=c[24][2];this.dkc=c[24][3];this.Zjc=c[24][4];this.akc=c[24][5]}this.rB=c[25];this.hxa=c[26];this.Rlb=c[27];this.Sec=Boolean(c[28]);if(c[29]&&c[29][0]){this.Rjb=Boolean(c[29][0]);this.xMb=Boolean(c[29][1]);this.Q2b=c[29][2];this.L2b=c[29][3];this.dZb=c[29][4]}else this.Rjb=k;this.ahb=Number(c[30]);this.Jt=c[31];this.xvb=c[32];this.k8b=c[33];this.Vkd=new OOa(c[34]);this.mec=Boolean(c[35]);this.sXb=Boolean(c[36]);this.Jvc=Boolean(c[37])}
+function jI(b,a){if(a){if(!b.o4a)b.o4a=Exa(b.p_a);return b.o4a}else return b.p_a}function kI(b,a){if(a){if(!b.m4a)b.m4a=Exa(b.rIa);return b.m4a}else return b.rIa}function qSa(b,a){if(a){if(!b.l4a)b.l4a=Exa(b.wHa);return b.l4a}else return b.wHa}function rSa(b){return b.xvb&&b.xvb[u]>0?b.xvb[0]:I}function lI(b,a,c,d,f){hy[z](this,b,a);this.Ea=c;this.Sq=d;this.lHa=f;new py(eg,this,k,k);Bx(this)}function sSa(b,a){b.mb.Qf();try{var c=b.za(eg);mya(c,a);mya(b,a)}finally{b.mb.Mf()}}function tSa(){}
+function uSa(b,a,c){hy[z](this,a,c,h);this.Ea=b;this.Utc=new VRa;Bx(this)}function mI(b,a,c){Ix(b);if(!b.hc())e(Error(".148"));for(var d=0;d<a[u];d++){var f=a[d];if(!b.za(f))e(Error(".149`"+f))}d=new hI(b);b=b.J().vf();d.kX=b;d.wf=a;d.q_b=void 0;d.Tjd=!!c;d[Mb]();return d}function vSa(b,a){var c=b.Bb();b.aGb=k;b.k0={};c=new WRa(c,a);b.set(c);a=new Hf;var d=XRa(c);for(c=0;c<d[u];c++)a.set(d[c],1);b=b.Uc();d=b.Sb();for(c=0;c<d[u];c++){var f=d[c],g=b.J(f);a.J(f)||sSa(g,h)}}
+
+function wSa(b,a){var c=a[1],d=b.J();if(d){var f=a[9];if(f)d.GQa[c]=f;else{f=d.GQa[c];a[9]=f}}f=b.za(c);if(!f){f=a[6];f=new lI(c,b,b.Ea,b.Hc(),b.Utc.cta(f))}f.nM(a);if(b.k0)b.k0[c]=h;d&&YRa(d,f.J())}function xSa(b){b.aGb=h}var nI="csd";function ySa(b,a,c){if(a==nI){b.mb.Qf();try{var d=c[2];Ix(b);if(b.hc()){b.mb.Qf();try{var f=b.J(),g=d[1];if(ef(f.wf,g))e(Error(".147"));f.wf[p](g);f.TQa=g;f[r](oy);wSa(b,d)}finally{b.mb.Mf()}}}finally{b.mb.Mf()}}}
+function zSa(b){if(!b.hc())e(Error(".150"));return b.GT()[bd](hSa)}var oI="^t";function ASa(b){if(b.hc())if(b.aGb){var a=b.J().wf;if(a[u]!=0){var c=pI(b);b.Txc(c);var d=b.Ea.Ga();if(BSa[bd](d))for(d=0;d<c[u];d++){var f=c[d];(f.Ea.Ga()==sz?f.Zh(oI):f.QXb)&&ZRa(f,4)}else zSa(b)?CSa(b,c,hSa):CSa(b,c,oI);d=b.J();for(f=0;f<c[u];f++){var g=c[f];d.w9a[g.gf]&&ZRa(g,4)}b=b.za(a[a[u]-1]).J();ZRa(b,4)}}}function CSa(b,a,c){for(b=0;b<a[u];b++){var d=a[b];d.Zh(c)&&ZRa(d,4)}}
+function pI(b){var a=[],c=b.J();c=XRa(c);for(var d=i,f=0;f<c[u];f++){var g=b.za(c[f]);if(g&&g.hc()&&!g.Ds())a[p](g.J());else{d=d||[];d[p](c[f])}}return a}function DSa(b,a){b.Whd=a}function ESa(b,a,c){gI[z](this,b,3);this.gk=a;this.Obd=c}function FSa(b,a){gI[z](this,b,2);this.BV=a;this.AOb=new Hf;b=gy(b.B()).eQ;SBa(this);this.Hn=b}function GSa(b,a){hy[z](this,Qf(b.Dg()),a);this.Ea=b}function HSa(b,a){b=new FSa(b,a);b[Mb]();return b}function ISa(b,a,c){(b=b.za(a,h))&&b.Fi()&&b.J().dL<c&&b.rg()}
+var qI="conversations";function JSa(b){hy[z](this,qI,b);b=gy(this.B());ih(b.ud,Fx(nI),this.P6c,k,this)}function rI(b,a,c){Ix(b);return b.za(Qf(a.Dg()),c)}function sI(b,a,c){b.mb.Qf();try{for(var d=b.Uc().Oa(),f=0;f<d[u];f++){var g=d[f].za(a,h);g&&c(g)}}finally{b.mb.Mf()}}function KSa(b,a){Ix(b);b.mb.Qf();try{for(var c=b.Uc().Oa(),d=0;d<c[u];d++)for(var f=c[d].Uc().Oa(),g=0;g<f[u];g++){var j=f[g];j&&j.Fi()&&a(j)&&j.rg()}}finally{b.mb.Mf()}}function LSa(b){KSa(b,E(h))}
+function tI(b,a){sI(b,a,function(c){c.Fi()&&c.rg()})}function MSa(b,a){KSa(b,function(c){a:{c=c.Uc().Oa();for(var d=0;d<c[u];d++){var f=c[d].J();if(f&&gSa(f)[od]()==a[od]()){c=h;break a}}c=k}return c})}function NSa(b,a,c){Ix(b);var d=k;b=Xwa(b.Uc(),function(f){if((f=f.za(a,h))&&f.Fi()&&f.J().vf()==c){d=h;return Xwa(pI(f),function(g){return g.Uf()})}return k});return d?b:i}var OSa='<div class="J-J5-Ji ',uI='<img class="',vI=' id="',PSa=' title="',QSa='alt="',wI='" >';
+function xI(b,a){var c=a||new U;c[R](b.Xe?OSa+b.Xe+W:I,uI,b.Hb,Vf,b.As?vI+b.As+Vf:I,MPa,b.je?b.je:XE,Vf,b[Pk]?PSa+b[Pk]+Vf:I,QSa,b.alt||b.alt==I?b.alt:b[Pk]?b[Pk]:I,wI,b.Xe?Z:I);if(!a)return c[t]()}var yI="J-K-I",RSa="L3",zI='" act="',SSa='tabindex="',TSa="J-K-I-Kv-H",USa="J-K-I-J6-H",VSa="J-K-I-KC",WSa="J-K-I-K9-KP",XSa='">&nbsp;</div><div class="',YSa="J-K-I-Jz",ZSa=' style="width: ',aTa='ex"',bTa="</div></div></div></div></div>";
+function AI(b,a){var c=a||new U;c[R](nE,b.id,S,yI,J,Ao,J,b[uc]?b[uc]+J:I,RSa,zI,b[jr],Zd,b[Pk]?hE+V(b[Pk])+Vf:I,SSa,b.Ugc?b.Ugc:Ah,wl,Ao,J,TSa,wl,Ao,J,USa,wl,VSa,wl,WSa,XSa,YSa,Vf,b[ib]?ZSa+b[ib]+aTa:I,Uf,b.xh,bTa);if(!a)return c[t]()}function BI(b,a,c){Fn[z](this,b,a||Tn.S(),c)}function CI(){}var DI="Ia";function cTa(b,a){N[z](this,DI,b);this.Ti=a}function dTa(b,a){tB[z](this,b,17,a)}function EI(b,a,c){this.Mk=b;this.Ly=a;this.na=c;this.Li=G(this.ix,this)}
+function eTa(b,a,c){hy[z](this,b,c);this.qr=c;this.nM(a)}function fTa(b){return b!=-1}function gTa(b,a,c){b=a;if(c)b=Di(a,fTa);b=b;c=[];for(var d=0;d<b[u];d++){for(var f={value:b[d]},g=c[u];g>0&&c[g-1][q]>f[q];)g--;f.aDd=c[g];c[g]=f;f.hcd=c[g-1]}b=[];for(c=wm(c);c;){b[p](c[q]);c=c.hcd}b[cq]();for(d=c=0;c<a[u];c++)if(a[c]!=b[d])a[c]=-1;else d++}
+function hTa(b,a){var c=Qf(a);if(!b.za(c)){b.mb.Qf();try{for(var d=FI(b),f=d[u];f>0;){var g=d[f-1].J()[pq]();if(rx(a,g)>0)break;f--}var j,n=d[f-1],s=d[f];j=n&&s?(n.J().Nx+s.J().Nx)/2:n?n.J().Nx+1:s?s.J().Nx/2:1;var v=new py(c,b),C=nf(iTa);C[0]=a;var M=new bEa(C,j,b.B());v.set(M);my(b)}finally{b.mb.Mf()}}}function jTa(b,a){if(!b.hc())return i;if(a){a=FI(b);a=kTa(b,a)}else{a=[];b=b.Uc().Oa();for(var c=0;c<b[u];c++){var d=b[c];d.Ds()||a[p](d.J()[pq]())}}return a}
+function FI(b){if(!b.hc())return i;var a=[];b=b.Uc().Oa();for(var c=0;c<b[u];c++){var d=b[c];d.Ds()||a[p](d)}a[el](lTa);return a}function kTa(b,a){b=[];for(var c=0;c<a[u];c++)b[p](a[c].J()[pq]());return b}function lTa(b,a){if(b&&a){b=b.J().Nx;a=a.J().Nx;if(b<a)return-1;if(b>a)return 1}return 0}function mTa(b,a){this.exa=b;this.KYb=a;this.MYb=[];this.Q=new kn(this);this.Q.w(this.exa.mb.Ya(),this.exa.pua(),this.upb)}var nTa='<span tabindex="0" ';
+function oTa(b,a){var c=a||new U;c[R](nTa,b[Pk]?hE+b[Pk]+Zd:I,b.id?gE+b.id+Zd:I,iE,b[uc],W,b.yU,gB);if(!a)return c[t]()}var pTa="nX",qTa="<tr class=",rTa="Alfa2e",sTa=" id=",tTa="><td class=",uTa="nL",GI="</td><td>",vTa="</tbody></table>";function wTa(b,a){var c=a||new U;c[R](Fl,ul,J,pTa,mOa);b=b.Ti;for(var d=b[u],f=0;f<d;f++){var g=b[f];c[R](qTa,rTa,sTa,g.id,tTa,uTa,Uf);g.tXb&&xTa(g,c);c[R](GI);yTa(g,c);c[R](TG)}c[R](vTa);if(!a)return c[t]()}
+var zTa="pM",ATa='" style="color: #',BTa='" tabindex="0" role="button" aria-haspopup="true"><div class="',CTa="p6",DTa=' style="background-color: #',ETa="p8",FTa='" style="visibility:hidden">&#x25bc;</div></div></div>';function xTa(b,a){var c=a||new U;c[R](X,zTa,ATa,b.tg,MCa,b[jq],BTa,CTa,Zd,b.bjb?GJa:I,DTa,b[jq],wl,ETa,FTa);if(!a)return c[t]()}var GTa="n2",HTa='"><div class=',ITa="nU",JTa="n0",HI='<a href="',KTa='" target="_top" ',II="</div></div>";
+function yTa(b,a){var c=a||new U;c[R](X,GTa,J,b.ZKc,HTa,ITa,Uf);var d={className:JTa,title:b.dRc,href:b[Yc],yU:b.kkb},f=c||new U;f[R](HI,d[Yc],KTa,d[Pk]?hE+d[Pk]+Zd:I,d.id?gE+d.id+Zd:I,iE,d[uc],W,d.yU,hB);c||f[t]();b.YVb&&xI({Hb:b.YVb},c);c[R](II);if(!a)return c[t]()}function JI(b,a,c,d){this.DQa=b;this.VSc=a;this.AQa=c||i;this.Wlb=d||i;this.ejc=h;b.Ltb(this.fJc,this)}var LTa="n1";
+function MTa(b,a,c){var d=c.Dp()!=I&&b.ejc?LTa:I;a.id=NTa(b,c.ea());a.kkb=OTa(b,c,h);a.dRc=OTa(b,c,h);a.ZKc=d;a.YVb=c.Fga();Mp(a,b.VSc+Lj+Wf(c.CSb()));a.bjb=k;a.tXb=c.P3();if(a.tXb){a.tg=c.PO();a.bgColor=c.lK()}}function OTa(b,a,c){var d=b.Nec?a.Dp():I;c=c?Wf(a.Gf()):a.Gf();d=d!=I?[c,xl,d,xh][kd](I):c;if(b.wzb){c=d[Sc](Md);return PTa(b,a)>0?d[nc](c+1):d}else return d}function NTa(b,a){return b.EJ.X(Hz+a)}function KI(b,a){return b.EJ.b(Hz+a)}function QTa(b,a){return b.hd.ie(T,GTa,a)[0]}
+function PTa(b,a){var c=a.Gf();if(c[nc](c[u]-1)==Md)c=c[nc](0,c[u]-1);var d=c[Sc](Md);if(d==-1)return 0;a=jm(b.hp,a,b.DQa.sga());if(!a)return 0;b=b.hp[a-1].Gf();if(Mf(b,c[nc](0,d)))return c[Cc](Md)[u]-1;return 0}function LI(b,a,c,d){this.Qm=new mTa(c,d);var f=JB(b);JI[z](this,this.Qm,a,function(g){QF(this.Fh,RTa);f[bq]({view:wE,search:g.Bb(),style:g.wra})});this.Db=b;this.Z=Rz(b);this.Nec=!Jz(this.Z,539)}function MI(b,a,c,d){LI[z](this,b,a,c,d)}function STa(b){return!b.Rw()&&b.bo()}
+function TTa(b){return!b.Rw()&&!b.bo()}function NI(b){this.AP=b}function UTa(b){this.AP=b}var VTa="qk",OI='"><span id="',WTa='" idlink ',XTa='tabindex="0" role="link"',YTa='<sup class="ql">',ZTa="</sup>";function aUa(b,a){var c=a||new U;c[R](X,VTa,OI,b.dwc,S,b[uc],WTa,b[uc]?XTa:I,Uf,b[eq],gB,b.CVa?YTa+b.CVa+ZTa:I,Z);if(!a)return c[t]()}
+function PI(b,a,c,d,f,g){AD[z](this,bUa(this,b));this.oIa=d||i;b=cUa;b.content=a;b.dwc=this.X(dx);m(b,f||I);b.CVa=g||I;Q(this.ia.za().b(),aUa(b));c&&mx(this.b(),c)}var dUa="pX",eUa="pk";function fUa(b){var a=b.b(),c=b.YK?dUa:eUa;b=b.YK?eUa:dUa;var d=zg(a);if(Ye(c))jf(d,c);else Ve(c)&&dca(d,c);if(Ye(b)&&!ef(d,b))d[p](b);else Ve(b)&&cca(d,b);m(a,d[kd](J))}function bUa(b,a){b=new BF(a,b.yJa||5);b.U1(new Bm(2-b.gta().top,0,2-b.gta()[fl],0));b.so(new eE(a));return b}function QI(b){return b.b(dx)}
+function RI(b){this.X_=b}function gUa(b){this.X_=b}var hUa=" pk";function iUa(b,a,c,d){b=a[Qb](T);Q(b,c);m(b,d+hUa);c=Gg(T,NJa,b)[0];return{element:b,Myc:c}}function SI(b,a,c,d,f){LI[z](this,b,a,c,d);this.rWb=!!f;Bx(this)}var TI="^i";function jUa(b){return b.ea()==TI||b.Rw()&&b.bo()}function kUa(b){return b.ea()!=TI&&b.Rw()&&!b.bo()}
+var lUa="<div id=",UI=" class=",mUa="oo",nUa="><div class=",oUa="nM",pUa=' role="navigation"><div id=',qUa="n3",rUa="></div></div><div class=",sUa="n6",tUa="n8",uUa=">&nbsp;</div>",vUa="n4 toxOdd",wUa='<span class="CJ">',xUa='</span><span class="n5" ',yUa=">&#x25bc;</span>",zUa="</div></div><div id=",AUa="CI",BUa=' style="display: none;"><div class=',CUa="nW",DUa="nN",EUa="><div id=",FUa="></div></div></div></div>";
+function GUa(b,a){var c=a||new U;c[R](lUa,b.FTc,UI,mUa,nUa,oUa,pUa,b.ETc,UI,qUa,rUa,sUa,nUa,tUa,uUa);oTa({id:b.rVc,className:vUa,yU:wUa+V(b.sVc)+xUa+(b.bjb?GJa:I)+yUa},c);c[R](zUa,b.Vlb,UI,AUa,BUa,CUa,nUa,DUa,EUa,b.xUc,UI,qUa,FUa);if(!a)return c[t]()}function VI(b,a){AD[z](this,new eE(b));this.bL=[[],[]];this.vHb=a;this.I8=JB(b);this.Cb=sC(this[uq]())}function HUa(b,a,c){var d=b.YT;c.YIb=b?G(d,b):d;b.Gz(a,c);b.Cc()&&a==1&&IUa(b)}var JUa="CK",KUa="CL";
+function LUa(b,a,c,d,f,g){d=d?b.vHb+Lj+d:I;var j=b.W();c=j.ba(T,i,j.ba(Kd,{href:d,"class":JUa},c));m(c,KUa);b.Gz(a,new MUa(c,f,g))}function NUa(b,a){var c=0;b.cC(function(d){if(d instanceof JI)c+=d.hp?d.hp[u]:0},a);return c}function OUa(b,a,c){for(var d=0;d<b.bL[u];d++)if(d!=1||b.nm&&b.nm.Bv())for(var f,g=0;f=b.bL[d][g];g++)if(f.b()&&Zg(f.b(),a)){c(f);break}}function PUa(b,a){a&&!b.nm&&b.s7a();b.nm&&b.nm.ra(a)}var QUa="n7";function RUa(b,a){hm(b.b(Hz),QUa,a)}var SUa=" more",TUa="More";
+function UUa(b){b=NUa(b,1);if(b>0)return b+SUa;return TUa}function IUa(b){var a=b.b(Hz),c=b.bL[1][u]>0;Wm(a,c);if(c){ah(a[Tb],UUa(b));if(!b.D1b){b.H().w(a,[Zi,fj],b.N3c);b.D1b=h}}}var VUa="CM";function WUa(b){for(var a,c,d,f=0;f<b.bL[u];f++){a=k,c=i;for(var g,j=0;g=b.bL[f][j];j++)if(g.b()[uc]==VUa){if(c)Ua(c[x],a&&d?I:xd);c=g.b();d=a;a=k}else a||(a=g instanceof JI?(g.hp?g.hp[u]:0)>0:h);if(c)Ua(c[x],a&&d?I:xd)}}function XUa(b,a){b.Rwb(b.G1,k);b.Rwb(a,h);b.G1=a}
+function MUa(b,a,c){this.wa=b;this.na=a||i;this.Ela=c||i}function YUa(b,a,c){MUa[z](this,b,a,c)}function ZUa(b,a,c,d){dn[z](this,b,a);this.lFc=c;this.Ela=d||i}function WI(){}function aVa(b){oH[z](this,b.B(),5);this.W_=b}var XI="ld";function YI(b){hy[z](this,LC,b);b=gy(this.B());ih(b.ud,Gx(XI),this.x2c,k,this);Bx(this);this.Kka=new Hf}var ZI="custom";function bVa(b,a){(b=b.za(ZI))&&hTa(b,a)}var cVa="system/",dVa="custom/";
+function gEa(b,a,c){var d=Qf(a);return Mf(a,Ty)?jy(b,cVa+d,c):jy(b,dVa+d,c)}function OC(b,a,c){if(!b.hc()||c&&!b.Fi())return i;return jTa(b.za(ZI),a)}function eVa(b,a){var c=a.J().SA;c!=0&&b.Kka.set(c,a)}var fVa="/labels",aJ="ml";
+function bJ(b){VI[z](this,b,nD(b));Bx(this);this.Lh=TD(b);this.Aa=Dx(Cx(b));this.co=this.Aa.za(LC);this.Bd=rD(b);this.V_=new kn(this);if(this.co.Fi())this.p5b();else{b=this.Aa;this.V_.w(b.Ya(),b.Je()+fVa,this.p5b)}Vw(O.S(),aJ,this.Hpb,this,h);Vw(O.S(),XI,this.H2c,this,h)}var gVa="nV";function hVa(b){if(!(!b.Cc()||b.gVb))if(!(typeof PH=="undefined"||L&&!vg(Ij))){var a=b.W()[Qb](T);Q(a,PH({EN:gVa,content:I}));var c=b.b(Xx);c[o](a[Tb]);Gg(Do,gVa,c[Qc])[0][o](c[Tb][Tb]);c[Nc](c[Tb]);b.gVb=h}}
+var cJ="system",iVa="Manage labels",jVa="settings/labels",kVa="Create new label";
+function lVa(b,a){var c=b.co.za(cJ),d=b.co.za(ZI),f=b.aa.ceb()||STa,g=b.aa.Qcb()||TTa;mVa=b.aa.fQa();HUa(b,0,new SI(b.B(),a,c,jUa,h));b.rG(0);f=new MI(b.B(),a,d,f);f.wzb=b.aa.Vxb();HUa(b,0,f);HUa(b,1,new SI(b.B(),a,c,kUa));b.rG(1);HUa(b,1,new MI(b.B(),a,d,g));b.rG(1);b.zP&&b.cC(function(j){j.XXa&&j.XXa(this.zP)});LUa(b,1,iVa,jVa,function(){this.I8[bq]({view:dJ,fk:LC})},b);LUa(b,1,kVa,I,function(){this.Ks&&this.Ks.Pjd()},b)}var eJ="ta";function nVa(b){b.B().Ya()[r](new N(eJ,b))}
+function oVa(b){this.d2b=b}function pVa(b){eaa(this,b)}var fJ="<div class=",qVa="py",rVa=' idlink tabindex="0" role="link">',sVa="&nbsp;<h2 class=",tVa="pw",uVa='></h2><div class="',vVa="qn";function wVa(b,a){var c=a||new U;c[R](fJ,qVa,rVa);xI(Kw(b,{Hb:de}),c);c[R](sVa,tVa,uVa,vVa,AF);if(!a)return c[t]()}function xVa(b,a){var c=a||new U;xI(b,c);if(!a)return c[t]()}var yVa="qm";
+function zVa(b,a,c){pA[z](this,b);Bx(this);b=this.b();this.H().w(b,P,this.TZc);ik(this.b(),a);K(b,yVa);a={Hb:c,alt:a};this.aa.Nk(a);Q(b,xVa(a))}function gJ(b){AD[z](this,new gF(b));this.hea()}function AVa(b,a){b.lV=a}var hJ="Ja";function iJ(b,a,c){AD[z](this,new gF(a));Ba(this,b);this.Wq=c;this.Wq.lV||AVa(this.Wq,this);this.H().w(this.Wq,hJ,this.yka);this.ia.ha(this.Wq)}function BVa(){}function CVa(){DVa||(DVa=new BVa);return DVa}function jJ(b){Bx(this);gJ[z](this,b)}
+function kJ(b,a,c){c=c||Mx().Gn(14,a,h);iJ[z](this,b,a,c);this.lb=yy(a);this.Wq.jB(EVa(this))}var FVa="bx_navbs_";function EVa(b){b=b.lb.db(FVa+b[ec]);return b!=i?!!Number(b):h}var lJ="labelslppnav";function GVa(b,a){kJ[z](this,lJ,b,a);this.cg=KC(b);this.LU=new bJ(b);this.ha(this.LU)}function HVa(){}function IVa(b){AD[z](this,new gF(b));this.Aj=[]}function JVa(b){return function(a,c){var d=b?a.aZ:a.a1,f=b?c.aZ:c.a1;return d<f?1:d>f?-1:a.DXa>c.DXa?1:-1}}function KVa(b,a,c){LVa(b,a,a[pq](),c)}
+function LVa(b,a,c,d){var f=b.sRb(c);b.hGa(new MVa(a,c,mm(f)?f:d,f,b.DXa++))}function qH(b,a){for(var c,d=0;c=b.Aj[d];d++)if(c.q7==a)return d;return i}function MVa(b,a,c,d,f){this.Ra=b;this.q7=a;this.aZ=c;this.a1=c>100?c:d||c;this.DXa=f}function mJ(b){IVa[z](this,b);this.Aa=Dx(Cx(b));var a=fy(b).ud;this.lb=yy(b);a.Xsb?this.rKb():ln(this.H(),a,Fx(oy),this.rKb);Mx().Kh(1,this)}
+function NVa(b,a,c){if(a!=c)if(!(b.Aj[a].aZ>=100))if(!(c<a&&b.Aj[c].aZ>=100)){var d=b.Aj[a];kf(b.Aj,a);km(b.Aj,d,c);yA++;d=b.ia;var f=d.rb(a);d.Vp(a);d.Jf(f,c);zA();OVa(b)}}function PVa(b,a){return b.q7==a.q7}function QVa(b,a){return a}
+function RVa(b){var a=nf(b.Aj);a[el](JVa(h));a=Wva(a,b.Aj,PVa,QVa);for(var c=b.iVa.vc(),d=0;d<b.Aj[u];d++)c[Pb](b.Aj[d].q7);for(d=0;d<a[u];d++){var f=b.Aj[a[d]];f.lma(f.aZ)}var g=0,j;for(d=0;d<=a[u];d++){j=d<a[u]?a[d]:b.Aj[u];if(j>g){var n=j-g,s=NaN,v=NaN;if(d>0){var C=a[d-1];s=b.Aj[C].aZ}if(d<a[u])v=b.Aj[j].aZ;f=NaN;if(v==s){for(var M=C-1;M>=0;M--)if(b.Aj[M].B6()>s){f=M;break}if(ia(f)){s=NaN;f=-1}else s=b.Aj[f].B6();n++}s=ia(s)?100:l.min(s,100);s=SVa(v,s,n);if(!ia(f)){v=s.pop();for(M=f+1;M<=C;M++){f=
+b.Aj[M];c.set(f.q7,v);f.lma(v)}n--}for(v=0;v<n;v++){M=s.pop();f=b.Aj[g+v];c.set(f.q7,M);f.lma(M)}}g=j+1}b.iVa=c;return Li(c.Sb()[el](),function(Y){return Y+xj+c.J(Y)})[kd](Bl)}var nJ="sx_no",oJ="bx_lq",pJ="chat";function OVa(b){var a=RVa(b),c=b[uq](),d=b.lb.db(nJ);if(a!=d){c=new lF(c);b.lb.Yc(nJ,a);c.Yc(nJ,a);b[uq]();a=b.lb.db(oJ);d=qH(b,pJ);d=qH(b,ZI)<d;if(a!=d){b.lb.Yc(oJ,d);c.Yc(oJ,d)}c.bh=h;c[Mb]()}}
+function SVa(b,a,c){var d,f=0;if(ia(c))e(Error(".154`"+c));if(ia(b)&&ia(a))d=0;else if(ia(b))d=l[ob](a)-c-1;else if(ia(a))d=l[rb](b);else{if(b>=a)e(Error(".155"));var g=b>=0?1:-1,j=a>=0?1:-1;b=l.abs(b);a=l.abs(a);var n=l.max(String(l[rb](b))[u],String(l[rb](a))[u]);b=nx(b,n)[mb](/\./,I);var s=nx(a,n)[mb](/\./,I);for(var v=a=0;;){var C=a>=b[u]?0:Number(b[xb](a))*g;v=10*v+((a>=s[u]?0:Number(s[xb](a))*j)-C);a++;if(v>c){f=n-a;j=b[Zc](0,a);d=Number(j)*g;g=a-j[u];if(g>0)d*=l.pow(10,g);break}}}g=[];j=l.pow(10,
+l.abs(f));for(n=1;n<=c;n++){b=d+n;if(f>0)b*=j;else if(f<0)b/=j;g[p](b)}return g}var TVa="pz pp Dv",UVa="p9";function qJ(b){Bx(this);PI[z](this,b,this.aa.un(),TVa,G(this.rSa,this),this.jmb(UVa));this.jb=JB(b)}function rJ(){}var sJ="tools";function VVa(b,a){Bx(this);kJ[z](this,sJ,b,a);this.c2b=new Hf;this.hea()}function WVa(b,a){return b.c2b.J(a)}function tJ(b,a){pB[z](this,b,a,2);this.wf=[];this.uj=h}function uJ(b,a){hf(b.wf,a)}function vJ(b){tJ[z](this,b,5);Bx(this)}function XVa(b){this.Lc=b}
+function YVa(){}function wJ(b){return b.J(Rd)}function ZVa(b){var a=new YVa(b);b[kq](Rd,a);return a}function xJ(b,a){vH[z](this,a);this.V=b;this.EB=wJ(b);this.EB.zC==kD&&this.sf(1)}function yJ(){}function aWa(){var b=vA+bWa[t](16);bWa++;return b}function cWa(b){this.Jb=b}function dWa(b,a,c,d,f){this.zYb=b;this.YK=a;this.bF=c;this.H_a=d||0;this.XY=f||0}function zJ(b,a){this.Jb=XF;this.Iua=b;this.Ada=a}function eWa(){this.Wra=0}function AJ(b,a){AD[z](this,a);this.xa=b}
+function BJ(b,a,c,d){tB[z](this,b,77,d);this.pkb=a;this.okb=c;this.uj=h}function CJ(b,a){b=[];for(var c,d=0;c=a[d];d++)b[p](Vf+(c+Vf));return Wf(b[kd](hg))}function fWa(b){tB[z](this,b,16,1)}function gWa(b,a){tB[z](this,b,46,a)}function hWa(b,a){tB[z](this,b,98,a);this.uj=h}function iWa(b,a){tB[z](this,b,45,a)}function jWa(b,a){var c=a||new U;c[R](aH);b=b.Zgd;for(var d=b[u],f=0;f<d;f++)c[R](b[f]);c[R](Z);if(!a)return c[t]()}var kWa='"><div act="',lWa="AP",mWa='" tabindex="0">',nWa="Refresh";
+function oWa(b,a){var c=a||new U;c[R](X,Ao,kWa,V(b.Odd),S,lWa,mWa,nWa,II);if(!a)return c[t]()}function DJ(b){this.Bn=b}var pWa="Delete forever",qWa="<b>Archive</b>",rWa="Move to Inbox",sWa="Discard drafts",tWa="Not spam",uWa="Remove star",vWa="Report spam",EJ="Delete";
+function FJ(b){VB[z](this,b);this.Cb=sC(b);this.om=Mx().Gn(19,b);this.Xk(this.om);Bx(this);this.Yf={};Bx(this);if(!GJ){b=GJ=new Hf;b.set(17,HJ(pWa,17));b.set(7,HJ(qWa,7));b.set(8,HJ(rWa,8));b.set(16,HJ(sWa,16));b.set(18,HJ(tWa,18));b.set(4,HJ(uWa,4));b.set(9,HJ(vWa,9));b.set(10,HJ(EJ,10));this.aa.Oca(GJ)}}function wWa(b){var a=Mx().Gn(16,b.B());a.b2=b.b2;a.gp(b.On);a.T1(b.Me);for(var c=b.ge.Sb(),d=0;d<c[u];d++){var f=c[d];a.ge.set(f,b.ge.J(f))}return a}var xWa="mam",yWa="Pl",IJ="%%",zWa='More actions<div class="AZ J-J5-Ji">&nbsp;</div>';
+function AWa(){JJ.id=xWa;m(JJ,yI);var b;b=new U;b[R](X,yWa,J,Ao,W);AI({id:IJ+V(JJ.id)+IJ,xh:zWa},b);b[R](Z);b=b[t]();return b}var BWa="move",CWa="tag",DWa="J-K-I-Js-KK",EWa='Move to<div class="AZ J-J5-Ji">&nbsp;</div>',FWa="J-K-I-Js-Kc",GWa='Labels<div class="AZ J-J5-Ji">&nbsp;</div>';
+function HWa(b){JJ.zVc=BWa;JJ.Cmd=CWa;m(JJ,yI);JJ.Rec=IWa(b);JJ.BVc=GJ.J(8);b=new U;b[R](X,yWa,J,Ao,W);JJ.Rec?AI({id:IJ+V(JJ.zVc)+IJ,className:V(DWa),xh:EWa},b):b[R](JJ.BVc);AI({id:IJ+V(JJ.Cmd)+IJ,className:JJ.Rec?V(FWa):I,xh:GWa},b);b[R](Z);b=b[t]();return b}function JWa(b){JJ.Odd=20;var a=new U;a[R](oWa(JJ));b=b.aa.XRb();Ff(b,function(c){a[R](c)});return a[t]()}var KWa="J-K-I-KE";
+function LWa(b){KJ[0]=b.Ar(13)?MWa(b):I;for(var a=KJ[0]?0:1,c=1,d=GJ.Sb(),f=0;f<d[u];f++){var g=d[f];if(b.Ar(g))KJ[c++]=GJ.J(g)}for(b=c-1;c<KJ[u];)KJ[c++]=I;for(c=a;c<=b;c++)KJ[c]=KJ[c][mb](RSa,[c>a?FWa:I,c<b?DWa:I,c==a?KWa:I][kd](J));JJ.oS=KJ;a=new U;a[R](X,yWa,J,Ao,W);c=JJ.oS;b=c[u];for(d=0;d<b;d++)a[R](c[d]);a[R](Z);a=a[t]();return a}var NWa='Remove label "';function MWa(b){b=NWa+(Wf(b.Me)+Vf);return HJ(b,13)}
+function OWa(b,a){b.Jy=a;b.Owa=h;Q(b.b(),a[mb](/%%([A-z0-9_]+)%%/g,function(c,d){return b.X(d)}));b.Cc()&&b.b2&&PWa(b)}function PWa(b){b.H().w(b.b(),[Xi,fj],b.p8,h,b)}function QWa(b,a){if(b.gvc!=a){b.p8();for(var c=[9,18,98],d,f=0;d=c[f];f++){b.Yf[d]&&b.Yf[d].Ac(!a);b.ge.set(d,!a)}b.gvc=a}}function IWa(b){if(!b.Ea)return k;switch(b.Ea.Ga()){case cz:case pz:case Jy:case az:case Oy:case ul:case nz:case iz:case sz:case fz:case jza:return k}return h}
+function HJ(b,a,c){JJ.id=I;JJ.xh=b;Op(JJ,a);ik(JJ,c);return AI(JJ)}function LJ(){}function RWa(){this.Zpa=[]}function MJ(b,a,c,d){Qn[z](this,b,a,c,d||new RWa)}function SWa(b,a){b.Onb=a;NJ(b)}function NJ(b,a){if(b.Onb)b.Onb(b,a||I)}function OJ(b,a){Sn[z](this,a,b)}function TWa(b){b.Xm(h);Yva(b,b.gm);Fh&&b.gm[Wb](lNa,Gj);if(b.e0b)b.gm.maxLength=b.e0b}function UWa(b){if(b.Ve){nh(b.Ve,zm,b.kUb,k,b);nh(b.gm[A],P,b.H4b,k,b);b.Ve.D();b.Ve=undefined;b.nLa=undefined}}var VWa="(^|[- ,_/.:])",PJ="span";
+function WWa(b,a){if(b.gEc!=a){if(b.cxa)Fa(b.cxa[x],a==I?ud:yd);if(b.HGa&&b.nLa){var c=a[Kb](/^(.+),[ ]*([^,]*)$/),d=c&&c[1]?c[1][Cc](wj):[];if(a[nc](a[u]-1,1)==wj||d[u]!=b.nLa[u]){var f=d[d[u]-1]||I;if(Kn(b)&&f!=I){var g=Kn(b).un();if(g[od]()[Db](f[od]())==0){d[d[u]-1]=g;pa(b.gm,d[kd](wj)+wj)}}b.nLa=d;b[r](mj);b.dp(-1)}if(c)a=c[u]>2?Pf(c[2]):I}c=new RegExp(VWa+ox(a),ii);for(f=b.eEc;d=b.bf[f];f++)if(d instanceof MJ)NJ(d,a);else if(!(b.z9&&b.z9[d.ea()]))if(g=d.un()){var j=g[Kb](c);if(a==I||j){d.ra(h);
+(j=g[Db](j[0]))&&j++;a==I?d.xb(g):d.xb(b.W().ba(PJ,i,g[nc](0,j),b.W().ba(Ph,i,g[nc](j,a[u])),g[nc](j+a[u],g[u]-a[u]-j)))}else d.ra(k)}else d.ra(a==I);b.gEc=a}}function XWa(b,a){for(a=a;a;){var c=Yg(a),d=b.li().IMa(a);if(d){d.wa=a;b.ha(d);d.Pb(a)}a=c}}var YWa="AX",ZWa="AW",aXa="AR";
+function QJ(b,a,c,d,f){var g=typeof PH!="undefined"&&!(L&&!vg(Ij));b=qC(b).W();b=f?new OJ(undefined,b):new Sn(b,g?LJ.S():undefined);b.ra(k);b.bY=k;b.Qk(f||k);if(g)d=PH({EN:YWa,content:d});Q(c,d);b.Pb(c);a.Zs(b);K(b.b(),g?ZWa:aXa);this.Ls=b}function bXa(b,a,c){ih(b.Ls,no,a,k,c)}var cXa="filterchange";function dXa(b,a,c,d,f,g){QJ[z](this,a,c,d,f,g);this.Qm=b;ih(this.Ls,cXa,this.l3c,k,this);ih(this.Ls.b(),ij,this.o3c,k,this)}function eXa(b,a,c){b.FFb=c?G(a,c):a}function fXa(b,a,c){b.aLb=c?G(a,c):a}
+function gXa(b,a,c){b.M_b=c?G(a,c):a;SWa(b.Ls.rb(rn(b.Ls)-1),function(d,f){d.ra(f==I)})}function hXa(b,a,c){a=c?G(a,c):a;SWa(b.Ls.rb(rn(b.Ls)-2),a)}function iXa(b,a,c,d,f,g){dXa[z](this,b,a,c,d,f,g);this.Qm=b;this.Cb=sC(a);this.lq=c;ih(this.Ls,Wn,this.Vm,k,this);ih(this.Ls,mj,this.j3c,k,this);this.tGb=this.Ls.rb(rn(this.Ls)-3);this.tGb.ra(k)}
+function jXa(b,a,c){for(var d,f=0;d=b.Ls.rb(f);f++)if(d instanceof RJ){var g=d.un();if(d.Dda!=(b.Qm.HT(g)||0))switch(d.Dda){case 0:c[p](g);break;case 2:a[p](g);break}}return a[u]+c[u]>0}function kXa(b,a){var c=rn(b.Ls),d=b.Ls.rb(c-2);c=b.Ls.rb(c-1);if(a){d.ra(k);c.ra(k)}else{var f=b.Ls.GE();NJ(d,f);NJ(c,f)}b.tGb.ra(a)}function SJ(){this.Zpa=[]}function RJ(b,a,c,d){Qn[z](this,b,a,c,d||new SJ);this.Maa(h)}function lXa(b,a){mXa(b,a);b.k3a=a==1}var nXa="-Ky-Jp",oXa="-JR-Jp";
+function mXa(b,a){if(b[r](a!=0?Yia:Zia)){b.Oe(16,a!=0);b.Dda=a;a=b.li();a.kT(b,a.Qb()+nXa,b.Dda==1);a.kT(b,a.Qb()+oXa,b.Dda==2)}}function pXa(b){this.j0=b}var qXa="J-M-JJ",rXa='"><div></div><input type="text" maxlength="40" ignoreesc="true" /><div class="',sXa="A0",tXa="J-M-Jz",TJ='</div><div class="';
+function uXa(b,a){var c=a||new U;c[R](X,qXa,rXa,sXa,xF,tXa,W);for(var d=b.Ti,f=d[u],g=0;g<f;g++)c[R](X,uo,zI,76,W,V(d[g]),Z);c[R](TJ,po,mE);d=b.Bz;f=d[u];for(g=0;g<f;g++){var j=d[g];c[R](X,uo,zI,j,W,vXa[j],Z)}c[R](X,po,mE);wXa(b,c);if(!a)return c[t]()}var xXa="J-LC",yXa="J-LC-Jz",zXa="J-LC-Jo",AXa="<hr>",UJ="J-JK",BXa='" style="display: none;">',CXa="Apply";
+function DXa(b,a){var c=a||new U;c[R](X,qXa,rXa,sXa,xF,tXa,W);for(var d=b.Ti,f=d[u],g=0;g<f;g++)c[R](X,xXa,wl,yXa,wl,zXa,J,Ao,mE,V(d[g]),II);c[R](Z,b.rG?AXa:I,X,UJ,BXa,CXa,Z);wXa(b,c);if(!a)return c[t]()}function EXa(b,a){var c=a||new U;b=b.Bz;for(var d=b[u],f=0;f<d;f++)c[R](X,uo,W,DCa[b[f]],Z);if(!a)return c[t]()}var FXa="Create new";function wXa(b,a){b=a||new U;b[R](X,UJ,zI,14,W,FXa,TJ,UJ,zI,78,W,iVa,Z);if(!a)return b[t]()}
+function GXa(b,a){this.V=b;this.kl=[];this.Jia={};if(a)for(b=0;b<a[u];b++){var c=new bEa([a[b]],b,this.V);this.Jia[c.ea()]=c;this.kl[p](c)}this.I1={}}var HXa="/custom/*";
+function VJ(b){VB[z](this,b);Bx(this);this.Aa=Dx(Cx(b));this.Cb=sC(b);this.ge.set(76,h);this.ge.set(77,h);this.ge.set(14,h);var a=this.Aa,c=a.za(LC);if(c){this.H().w(a.Ya(),c.Je()+HXa,this.B2c);this.K2()}else this.Qm=new GXa(this.B(),[]);this.dMb=[];this.jb=JB(b);this.cg=KC(b);b=QB(8);b.NEa[p](fz,cz,Zy);b=QB(9);b.NEa[p](kz,sz,Py,ez);b=QB(10);b.NEa[p](kz,Py,ez);b=QB(4);b.NEa[p](sz);TB(this,78,h)}
+function IXa(){for(var b=xf(vXa),a=[],c=0;c<RB[u];c++)a[p](RB[c][jr]);for(c=0;c<b[u];c++)jf(a,da(b[c],10));return a}function JXa(b,a,c,d,f,g){var j=new QH(i,i,CI.S(),b.W());j.CXb=Jz(Rz(b.B()),1033);j.Pb(a);j.OZb=c;j.Jfd=d;j.D7=g||k;Dn(j,64,h);ih(j,pn,f,k,b);return j}function KXa(b,a){if(a.vj())a.Hi(k);else{b=[b.U_,b.XM,b.hV,b.aa.Uga()];for(var c=0;c<b[u];c++){var d=b[c];d&&d.Hi(d==a)}}}function LXa(b,a){if(L)for(b=b;b;b=b[A])if(b[ed]&&mia(b)==ee)Ca(b[x],a||I)}
+function MXa(b,a){if(CD())switch(a){case 64:case 42:case 95:return k}return h}var WJ="Please enter a new label name:",NXa="New Label";function OXa(b,a){QC(b.cg,WJ,I,NXa,G(b.s3,b,a),iA(b.B()))}
+function PXa(b){if(b.iV){b.hV.Zs(i);b.iV.fe().D()}var a=[],c=b.Dd();Ff(b.Qm.Jo(),function(s){s=s.ea();s!=c&&a[p](s)});var d={Ti:a,Bz:xf(vXa)};b.iV=new QJ(b.B(),b.hV,b.Hmb,uXa(d),h);bXa(b.iV,b.aQ,b);hXa(b.iV,b.vSa,b);d=b.iV.fe();for(var f=0,g,j=0;g=d.rb(j);j++){var n=g.b();Number(n[Uc](fG)||n.act)==76&&awa(g,a[f++])}ih(b.iV.fe(),Wn,b.V3c,k,b)}
+function QXa(b){if(b.DA){ph(b.DA.fe().b());b.U_.Zs(i);b.DA.fe().D()}b.zLa=[];for(var a=Li(b.Qm.Jo(),function(j){return j.ea()}),c=0;c<a[u];c++)b.zLa[p](JC(a[c]));c={Ti:a,rG:a[u]>0};b.DA=new iXa(b.Qm,b.B(),b.U_,b.jkb,DXa(c),h);bXa(b.DA,b.aQ,b);hXa(b.DA,b.vSa,b);eXa(b.DA,b.t3,b);fXa(b.DA,b.fUc,b);gXa(b.DA,b.j7b,b);var d=b.DA.fe(),f=0,g;for(c=0;g=d.rb(c);c++)g instanceof RJ&&awa(g,a[f++]);ih(b.DA.fe(),Wn,b.t2c,k,b)}
+function RXa(b){var a=IXa(b),c={Bz:a};b.hn=new QJ(b.B(),b.XM,b.p2a,EXa(c));bXa(b.hn,b.aQ,b);var d;for(c=0;d=a[c];c++)b.hn.fe().rb(c).kb=d}function SXa(b,a,c){Ff(b.Qm.Jo(),function(d){d=d.ea();if(!Mf(d,Ty)){var f=a[d]==c?2:a[d]>0?1:0;this.Qm.HT(d)!=f&&this.Qm.hCa(d,f)}},b);b.Y6a=c;b.CGa=k}function TXa(b){b.CGa||Ff(b.Qm.Jo(),function(a){a=a.ea();Mf(a,Ty)||this.Qm.hCa(a,a==this.Me?2:1)},b);b.Y6a=0;b.CGa=h}
+function UXa(b){return Xwa(b.ge,function(a,c){switch(Number(c)){case 12:case 13:case 14:case 76:case 77:case 78:return k;default:return a}})}function VXa(b){b.hn||RXa(b);return b.hn.fe()}var XJ='<tr class="',WXa="zfUHAf",YJ='"><td class="',ZJ="MZZu1b",XXa='"><input type="checkbox" style="visibility:hidden">&nbsp;</td><td class="',YXa='"></td></tr>';function ZXa(b,a){b=a||new U;b[R](XJ,WXa,YJ,ZJ,XXa,ZJ,OH,ZJ,YXa);if(!a)return b[t]()}
+function aYa(b,a){b=a||new U;b[R](XJ,WXa,YJ,ZJ,OH,ZJ,OH,ZJ,YXa);if(!a)return b[t]()}var bYa='" colspan=3 style="text-align:center">';function cYa(b,a){var c=a||new U;c[R](XJ,WXa,YJ,ZJ,bYa,b.ke,TG);if(!a)return c[t]()}function dYa(b,a){b=a||new U;b[R](vTa);if(!a)return b[t]()}function eYa(){}function fYa(){}function gYa(){this.Cx={}}function hYa(b,a){for(var c=[],d=0;d<a[u];d++){var f=a[d];if(b.Vo(f)){delete b.Cx[f];c[p](f)}}b[r](new iYa(c))}function jYa(b){hYa(b,xf(b.Cx))}
+function kYa(b,a){if(b.Cx[a])delete b.Cx[a];else b.Cx[a]=h;b[r](new iYa([a]))}var lYa="selection";function iYa(b){N[z](this,lYa);this.kh=b}function mYa(){this.Ovb=new Hf;this.gIb=Zx}function aK(b,a,c){Ba(this,b);this.ke=a;this.thd=c}
+function bK(b,a,c){AD[z](this,new gF(b));this.Ll=a;this.Aa=this.Ll.mb;this.Og=c.Jw();this.E_=c.E_;this.az=c.Ut();this.LBa=c.LBa;this.cXa=c.cXa;this.Rf=this.az*this.Og;this.Fia=new Hf;this.qi=new Hf;this.Om=[];this.vl=c.a_b||new gYa;this.ynb=c.T2a;this.n8=c.n8;this.Gka=[];this.GUa={};this.PD=c.PD||nYa;this.fkb=c.fkb;this.na=new eYa;this.jU=[];this.Fbb=[]}function oYa(b){return b.Ll.J().xK()}function pYa(b,a,c){qYa(b,a,c);cK(b);rYa(b)}
+function qYa(b,a,c){if(b.NS)return k;var d=!sYa(b);b.Bh&&a!=b.elb&&a==kD&&d&&b.vda();if(b.Bh)b=k;else if(d){b.Kd.rg();b.elb=a;d=b.na.UKb()||new zRa;d[Ok](b.Rf);d.Cf=b.Og+b.ynb;d.zja=b.Og-b.n8;d.lma(a);c&&d.axb(c);b.Bh=b.Kd[pb](d);a==Ph&&b.Bh.Se(I);b.Bh.Ie(b);b.Bh.lB(b);b.na.a7b(b.Bh);b.qca();b=h}else{a=b.Ll.J().xK();if(b.az>0&&a<=b.Rf){a=l.max(0,l[rb]((a-1)/b.Og));b.mha(a)}b=k}return b}
+function tYa(b,a){a=a||new zRa;var c=IRa(b.Kd);if(c){a.wwb(c);c=b.Kd;var d=HRa(c);c.Eo=d;c.L8=d;a[Ok](d);a.Cf=b.Og;a.lma(kD);b.Bh=b.Kd[pb](a);b.Bh.Ie(b);b.Bh.lB(b);b.qca()}}function sYa(b,a){a=a?b.Og+a:b.Og;a-=b.n8;return FRa(b.Kd,b.Rf,a)&&b.Kd.Es()}function cK(b){if(b.Lj&&b.Ll.Fi()&&b.Kd.Es()){b.na.qpa();var a=b.E_?1E3:b.Og;if(!b.nR||b.EF<a)uYa(b)}}var vYa="1.9b",wYa="Ma";
+function uYa(b){var a=b.Kd.J(b.Rf);a=a&&a.hc();var c=FRa(b.Kd,b.Rf,b.Og);if(a||c){xYa(b);yYa(b);if(b.EF==0){b.na.xHa();Ff(b.jU,function(n){n.xHa()})}b.Lj.AHa();c=0;for(var d=b.E_?1E3:b.Og,f=b.EF;f<d;f++)if((a=b.Kd.J(b.Rf+f))&&a.hc()){var g=a.J(),j=g.ea();b.Lj.QGa(g);b.Fia.set(j,a);a.Iz();b.qi.set(j,g);b.Om[p](g);c++}else break;if(c){b.Lj.PLa();b.EF+=c;rYa(b)}if(FRa(b.Kd,b.Rf,b.Og)){b.EGa=h;Ff(b.Fbb,B());b.sGa();rYa(b);if(b.elb==kD&&b.cXa)b.JQ();else b.Tl&&kfa.J()&&Fh&&!vg(vYa)&&b.Lj.MPb();b.NS=b.fkb}b.na.dN();
+b[r](wYa)}}function rYa(b){if(b.nR||b.NS)if(b.EF&&b.ft==2){b.Mn(0);b.ft=1}else if(b.EGa&&b.ft==3){b.Mn(b.EF-1);b.ft=1}else if(b.EGa&&b.ft==4){b.Mn(zYa(b,b.Lfc,b.Om));b.ft=1;b.Lfc=i}else if(b.ft>=100)if(b.na.Rcc())b.ft=1}function zYa(b,a,c){var d=c[u];if(d==0)return-1;var f,g;for(f=0;f<d;f++){g=b.PD(a,c[f]);if(g<=0)break}if(g==0||f==0)return f;if(f>=d)return d-1;if(f==0)return d;return f}
+function AYa(b){var a=b.Bh;b.Bh=i;var c=k;if(a.Vj())b.na.XTa(a);else if(a.h1()){c=qYa(b,b.elb);if(!c){b.na.b7b(a);cK(b);rYa(b)}}else b.na.XTa(a);b.qca();b.na.Z6b(a)}var BYa="Co";
+function xYa(b){if(!b.nR){Ff(b.jU,function(d){d[kr]()});Ff(b.Fbb,function(d){d[kr]()});b.na.i6b();var a=b.kda.b();Q(a,I);b.p4a=0;L&&K(a,BYa);if(b.ft==1&&b.Th>=0&&b.Th<b.Om[u]){b.ft=4;b.Lfc=b.Om[b.Th]}b.Lj.Lub();b.EF=0;b.EGa=k;b.qi[bc]();a=b.Fia.Oa();for(var c=0;c<a[u];c++)a[c].bB();b.Fia[bc]();Ia(b.Om,0);b.Th=-1;Ia(b.Gka,0);b.GUa={};b.nR=h;b.eKa=k}}var dK="sb";function CYa(b){var a=b.vl.XG();if(a==GF)b.hPa=2;else if(a==dK)b.hPa=1}
+function yYa(b){if(b.hPa==1){b.Qz(Zx);jYa(b.vl)}else b.hPa==2?b.Qz(Zx):b.Qz(b.vl.XG());b.hPa=0}function eK(b){b.Tl&&b.Lj.hB(b.Th)}function nYa(b,a){b=b.ea();a=a.ea();var c=b[u]-a[u];return c?c:b<a?-1:b>a?1:0}function DYa(b,a,c,d){this.V=b;this.Qdd=a;this.Mvc=c;this.na=d?d:i;this.Dz=this.V.J(XC);this.Hh=new hC(1E4,this.Dz)}function EYa(b){var a=Zf();b.DRc=a;b.xya=a+FYa(b,b.Dz.TZ(a));GYa(b,a)}function FYa(b,a){for(b=0;b<HYa[u];b+=2)if(a<HYa[b]||HYa[b]==-1)return HYa[b+1];return 12E4}var IYa=":23";
+function GYa(b,a){if(b.ab){cA(b.ab);b.ab=i}if(b.Hh)if(a>=b.xya)if(b.Hh.My()&&b.Mvc[z](b.na))b.bWa();else b.ab=bA(IYa,b.ix,1E4,b);else b.ab=bA(IYa,b.ix,b.xya-a,b)}function JYa(b,a,c){this.vl=b;this.xa=a;this.Ea=c}function KYa(b,a){b=a||new U;b[R](vTa);if(!a)return b[t]()}function LYa(b,a){var c=a||new U;c[R](XJ,b.oaa,Gl,b.cM,W);if(!a)return c[t]()}var fK="</tr>";function MYa(b,a){b=a||new U;b[R](fK);if(!a)return b[t]()}
+function gK(b,a){var c=new eE(b[uq]());AJ[z](this,b,c);this.hg=c;this.vl=b[Qk]();this.zC=a.zC;this.TD=a.TD;this.TD.Ig(this);this.ZJb=a.SZa;this.GDa=a.GDa;this.Cb=sC(this[uq]())}function NYa(b,a,c){b.GB=-1;b.FIa=i;var d=hK(b,a);if(d){var f=iK(b,d),g=b.xa[Vp](f);if(c){b.GB=a;b.FIa=f}a=jK(b,g,2,i);b.TD.uz(d,a)}}function OYa(b,a,c){var d=b.xa[Vp](iK(b,c));d=jK(b,d);b.TD.o2c(a,c,d)}function PYa(b,a){for(var c=b.hg.b();a&&a!=c;){var d;if(a.id&&(d=b.td(a.id))&&Mf(d,RE))return a;a=a[A]}return i}
+function iK(b,a){if(a==i)return I;return b.td(a.id)[Zc](1)}function hK(b,a){b=b.hg.b();for(b=Wg(b);b&&a>=0;){var c=Wg(b);if(a>=c[kl][u])a-=c[kl][u];else return c[kl][Ab](a);b=Yg(b)}return i}function jK(b,a,c,d){var f=b.vl.Vo(a.g_());b=a.ea()==b.FIa;return new dWa(a,f,b,c,d)}function QYa(){}function RYa(){this.yJ=[]}function kK(b,a){this.Jb=b;this.ey=a}function lK(b){this.Jb=b}var mK="date";function nK(){this.Jb=mK}function oK(b){this.uB=b}var SYa="icons";function pK(){this.Jb=SYa;Bx(this)}
+function qK(b){this.DOa=b}var rK="personal";function sK(b){this.Jb=rK;this.fu=b}var TYa="yW";function UYa(b,a){var c=a||new U;c[R](nE,b.Uhd,S,TYa,W,b.zuc,b.Vhd,Z);if(!a)return c[t]()}var VYa="senders";function tK(){Bx(this);this.Jb=VYa}function WYa(b,a){var c=new U;a.ppa&&Ff(a.ppa,function(d){c[R](d(a))});a.zuc=c[t]()}function XYa(b){this.vcc=b}var YYa="star";function ZYa(){this.Jb=YYa;Bx(this)}function aZa(b){this.qZa=b}function uK(b){this.mkb=b}function bZa(b,a){Bx(this);this.Ea=b;this.cg=a}
+function cZa(b,a,c){a[p](qEa(b.cg,c))}var dZa="xS",eZa="xT",fZa='<div class="y6"><span id="',gZa='&lrm;<span class="y2">&nbsp;-&nbsp;';function hZa(b,a){var c=a||new U;c[R](X,dZa,wl,eZa,W);iZa(b,c);FQa({WVb:fZa+b.qgc+W+b.m2+gB+(b.xfc?gZa+b.xfc+gB:I)+Z},c);c[R](II);if(!a)return c[t]()}var jZa="yi";function iZa(b,a){var c=a||new U;if(b.dxa){c[R](X,jZa,Gl,b.nkb,W);kZa(b,c);c[R](Z)}if(!a)return c[t]()}var lZa='">&nbsp;</div>';function kZa(b,a){var c=a||new U;c[R](b.dxa,X,vl,lZa);if(!a)return c[t]()}
+var vK="subject";function wK(b,a){this.Jb=vK;this.mkb=new bZa(b,a)}function mZa(b,a){b=I;if(a.GPa()&&a.dJb)b=J+a.dJb;return a.sH()+b}function nZa(){this.oq=[]}function xK(b,a){a.Ig(b);b.oq[p](a)}function oZa(b,a){for(var c=0;c<b.oq[u];c++)if(b.oq[c][pq]()==a)return b.oq[c];return i}function pZa(b,a,c,d){var f=a[Zb];if(f==P||f==ej)b.V8(a,c,d);else if(f==ij)b.BTa(a,c,d);else if(f==fj)nm(a,2)?b.h5b(a,c,d):b.g5b(a,c,d);else f==pj&&b.ATa(a,c,d)}var qZa="<table>";
+function rZa(b,a,c){var d=new U;if(L){d[R](qZa);yK.oaa=b.e_(c);yK.cM=sZa(b,c);LYa(yK,d);tZa(b,c,d);MYa(i,d);d[R](VA);b=b.W()[Qb](T);Q(b,d);d=Wg(b)[kl](0);for(b=0;b<d[cl][u];b++){m(a[cl][b],d[cl][b][uc]);a[cl][b].id=d[cl][b].id;Q(a[cl][b],d[cl][b][wk])}}else{tZa(b,c,d);m(a,b.e_(c));Q(a,d)}}function tZa(b,a,c){for(var d=0;d<b.oq[u];d++)b.oq[d].sW(a,c)}function sZa(b,a){return a[Vp]()?b.Zj(RE,a.ea()):I}function zK(b){this.oq=[];this.ub=b[Wq];Bx(this);this.aa.wc()}function uZa(b){this.paa=b}
+function AK(b){this.ub=b}function BK(b,a){this.ub=a[Wq];this.vl=a[uk];this.Ea=a[Pc];this.V=b;this.Ixb=h;Bx(this);gK[z](this,a.ZZb,vZa(this,a))}var wZa="nA",CK="xY",xZa=" zt";function vZa(b,a){for(var c=new QYa,d=b.iLb(a),f=b.aa.Acb(a)||[new zJ(wZa,CK),new ZYa,new tK,new sK(a.Gma),new wK(a[Pc],KC(b.V)),new pK,new nK],g=0,j;j=f[g];g++)xK(d,j);c.TD=d;d=b.i7a(a);c.SZa=d;c.GDa+=xZa;b.aa.Y_a(c,a);return c}function yZa(b,a,c,d){this.xa=a;this.pA=c;this.Ea=d}function zZa(b,a){this.xa=b;this.pA=a}
+function AZa(b,a){this.jb=JB(b);this.Ea=a}function DK(b,a,c){bK[z](this,b,a,c);this.Xi=a}function EK(b){this.hg=b}function BZa(b,a,c,d,f,g){AD[z](this,new eE(b));Bx(this);this.Ea=a;this.eFb=d;this.xa=f;this.Du=g;this.jb=JB(b);this.Lb=Tz(b);Pw(this.H(),this.b(),aB,this.M1c)}function FK(b){if(b.xa.xwa()){var a;a=b.Du.XG();a=a==GF?CZa(b):a==dK?DZa(b):EZa(b);if(a==I){Q(b.ia.b(),I);b.qc(k)}else{Q(b.ia.b(),a);b.ia.qe(Wx);b.qc(h)}}else b.qc(k)}
+var FZa="yb",GZa="All ",GK="</b>",HZa=" conversations on this page are selected.",HK='<span id="',IZa='" class="x8">Select all conversations that match this search</span>',JZa='" class="x8">',KZa="Select all ",LZa=" conversations in ";
+function CZa(b){var a=b.xMa();switch(b.Ea.Ga()){case Jy:case Nd:case Oy:case ul:b=new U;b[R](X,fo,J,FZa,W,pE+(GZa+(ZG+(a.ag+(GK+(HZa+(gB+(J+(HK+a.Ij+IZa)))))))),Z);a=b[t]();return a;default:b=new U;a=pE+(GZa+(ZG+(a.NKb+(GK+(HZa+(gB+(J+(HK+a.Ij+JZa+(KZa+(ZG+(a.ZF+(GK+(LZa+(V(a.LQ)+gB))))))))))))));b[R](X,fo,J,FZa,W,a,Z);a=b[t]();return a}}var MZa="yc",NZa="All conversations in this search are selected.",OZa='" class="x8">Clear selection</span>',PZa=" are selected.";
+function DZa(b){var a=b.xMa();switch(b.Ea.Ga()){case Jy:case Nd:case Oy:case ul:b=new U;b[R](X,fo,J,MZa,W,pE+(NZa+(gB+(J+(HK+a.Ij+OZa)))),Z);a=b[t]();return a;default:b=new U;a=pE+(GZa+(ZG+(a.ZF+(GK+(LZa+(V(a.LQ)+(PZa+(gB+(J+(HK+a.Ij+OZa))))))))));b[R](X,fo,J,MZa,W,a,Z);a=b[t]();return a}}
+var QZa="You can change your chat history options in ",RZa='<span class="e" id="',IK="Settings",SZa="&nbsp; ",TZa='" target="_blank">Learn more</a>',UZa="<span id=",VZa=' class="x2">Delete all spam messages now</span> (messages that have been in Spam more than 30 days will be automatically deleted)',WZa="(messages that have been in Spam more than 30 days will be automatically deleted)",XZa=' class="x2">Empty Trash now</span> (messages that have been in Trash more than 30 days will be automatically deleted)',
+YZa="(messages that have been in Trash more than 30 days will be automatically deleted)",ZZa="yd",a_a="Tip:",b_a=" Archive rather than delete in order to find old emails using search.",c_a='<a class="x9" target=_blank href="',JK="&nbsp;&nbsp;",d_a='" class="x8">Return to normal search</span>';
+function EZa(b){var a=oYa(b.xa),c=b.Ea.Ga(),d=b.aa.Tdb(c);if(d)return d;switch(c){case fz:if(!bx()){a={};a.Z1=b.X(KK.kFa);a.tc=Yz(b.Lb,29290);b=new U;b[R](X,fo,W,QZa+(RZa+a.Z1+jE+(IK+(gB+(SZa+(CGa+a.tc+TZa))))),Z);b=b[t]();return b}break;case Yy:b={PAc:b.X(KK.nDb),xR:a};a=new U;a[R](X,fo,W);b.xR>0?a[R](UZa+b.PAc+VZa):a[R](WZa);a[R](Z);b=a[t]();return b;case Zy:b={GCc:b.X(KK.u1a),xR:a};a=new U;a[R](X,fo,W);b.xR>0?a[R](UZa+b.GCc+XZa):a[R](YZa);a[R](Z);b=a[t]();return b;case Jy:case Oy:if(b.Ea.Rc(Zya)){b=
+{Fy:Yz(b.Lb,6576),UWc:b.X(KK.oEb)};a=new U;a[R](X,fo,J,ZZa,W,pE+(ZG+(a_a+(GK+(b_a+(gB+(J+(c_a+b.Fy+W+(eB+(hB+(JK+(HK+b.UWc+d_a))))))))))),Z);b=a[t]();return b}break}return I}function e_a(){}function LK(b){fF[z](this,b,vA)}function f_a(b,a){var c=a||new U;c[R](tGa,b.id?gE+b.id+Zd:I,b[Pk]?hE+b[Pk]+Zd:I,b.tA?uGa:I,iE,b[uc]?b[uc]:Rd,b.Xrc?J+b.Xrc:I,jE,b.Ab,gB);if(!a)return c[t]()}var g_a="Di";function h_a(b,a){b=a||new U;b[R](X,g_a,lZa);if(!a)return b[t]()}var MK="Dj",NK=" - ",i_a="</b> of <b>millions</b>";
+function j_a(b,a){var c=a||new U;c[R](WG,MK,W,ZG+(b.Mt+(GK+(NK+(ZG+(b.Cv+i_a))))),gB);if(!a)return c[t]()}var k_a="</b> of <b>hundreds of thousands</b>";function l_a(b,a){var c=a||new U;c[R](WG,MK,W,ZG+(b.Mt+(GK+(NK+(ZG+(b.Cv+k_a))))),gB);if(!a)return c[t]()}var m_a="</b> of <b>tens of thousands</b>";function n_a(b,a){var c=a||new U;c[R](WG,MK,W,ZG+(b.Mt+(GK+(NK+(ZG+(b.Cv+m_a))))),gB);if(!a)return c[t]()}var o_a="</b> of <b>thousands</b>";
+function p_a(b,a){var c=a||new U;c[R](WG,MK,W,ZG+(b.Mt+(GK+(NK+(ZG+(b.Cv+o_a))))),gB);if(!a)return c[t]()}var q_a="</b> of <b>hundreds</b>";function r_a(b,a){var c=a||new U;c[R](WG,MK,W,ZG+(b.Mt+(GK+(NK+(ZG+(b.Cv+q_a))))),gB);if(!a)return c[t]()}var s_a=" of about ";function t_a(b,a){var c=a||new U;c[R](WG,MK,W,ZG+(b.Mt+(GK+(NK+(ZG+(b.Cv+(GK+(s_a+(ZG+(b[Yq]+GK))))))))),gB);if(!a)return c[t]()}var OK=" of ";
+function u_a(b,a){var c=a||new U;c[R](WG,MK,W,ZG+(b.Mt+(GK+(NK+(ZG+(b.Cv+(GK+(OK+(ZG+(b[Yq]+GK))))))))),gB);if(!a)return c[t]()}var v_a="</b> offline";function w_a(b,a){var c=a||new U;c[R](WG,MK,W,ZG+(b.Mt+(GK+(NK+(ZG+(b.Cv+(GK+(OK+(ZG+(b[Yq]+v_a))))))))),gB);if(!a)return c[t]()}function PK(b,a){AD[z](this,new eE(b));this.xa=a;this.Ll=a.Ll;this.zrb=this.ia.b()}function x_a(b,a){b.Xkb=a}
+function y_a(b){var a=b.zrb,c=b.Ll,d=k;if(c.hc()){var f=c.J();c=f.xK();f=f.fN()?f.I_()?2:1:f.I_()&&f.uua()>f.xK()?2:0;var g=b.xa.Jw(),j=b.xa.Ut(),n=l[ob](c/g)-1;g=g*j;var s=b.xa.Dp();if(s>0){d={};d.jkd=j>=2;d.myb=j!=0;d.nyb=f==1||j!=n;d.nkd=f!=1&&n-j>=2;d.iRa=b.Xkb;d.HMc=b.X(ki);d.mhb=b.X(oy);d.nhb=b.X(Zx);d.KMc=b.X(Rd);d.Amd=b.keb(g,s,c,f);Q(a,b.Ybb(d));d=h}else Q(a,h_a());b.VFb(d)}else Q(a,h_a())}function z_a(b,a,c){var d={};d.Mt=b+1;d.Cv=b+a;d.total=c;return d}
+function A_a(b,a){return b==2?w_a(a):b==1?a[Yq]>=2E6?j_a(a):a[Yq]>=2E5?l_a(a):a[Yq]>=2E4?n_a(a):a[Yq]>=2E3?p_a(a):a[Yq]>=200?r_a(a):t_a(a):u_a(a)}function QK(b,a,c){PK[z](this,b,c);this.pA=a}var B_a='<h2 class="',C_a="Conversations",D_a='</h2><div class="',E_a="yV",F_a='" role="navigation">',G_a="Select",H_a=': <span class="',I_a="yU",J_a='<span selector="',K_a='" role="link" tabindex="0">';
+function L_a(b,a){var c=a||new U;c[R](B_a,qD,W,C_a,D_a,E_a,F_a,G_a,H_a,I_a,W);for(var d=b.pXa,f=d[u],g=0;g<f;g++){var j=d[g];c[R](J_a,j[ec],K_a,j.ke,gB,g!=f-1?b[Vq]+J:I)}c[R](II);if(!a)return c[t]()}function M_a(b){this.vl=b}function RK(b,a){Bx(this);BD[z](this,b,new eE(b));this.xa=a;this.JD()}var N_a="Fn",O_a='<span sort="',P_a='class="Fp"',Q_a='class="Fo"';
+function R_a(b,a){var c=a||new U;c[R](X,N_a,W);for(var d=b.Gsc,f=d[u],g=0;g<f;g++){var j=d[g];j={Ku:j.Ga(),message:j.Yg(),rrc:j.Ga()==b.fAc};var n=c||new U;n[R](O_a,V(j.Ku),Vf,j.rrc?P_a:Q_a,Uf,V(j[Tq]),gB);c||n[t]();c[R](J)}c[R](Z);if(!a)return c[t]()}function S_a(b,a){this.Xd=b;this.SB=a}function T_a(){}function U_a(b){Bx(this);this.V=b}var SK="ka";function V_a(b){return b.J(SK)}function W_a(b,a){var c=[X_a];b=b.aa.feb(a);for(a=0;a<b[u];a++)b[a]&&c[p](b[a]);return c}var Y_a="sx_sds";
+function Z_a(b,a){var c=yy(b.V).Oo(Y_a);b=W_a(b,a);for(a=0;a<b[u];a++)if(c==b[a].Ga())return c;return mK}var TK="sort";function a0a(b,a){BD[z](this,b,new eE(b));this.Ea=a;this.iZa=this.Ea.Rc(TK);if(!this.iZa)this.iZa=mK;this.jb=JB(b);this.Gbc=V_a(b);this.JD()}var b0a="D E";
+function c0a(b,a,c,d,f,g,j){gF[z](this,b);this.gj=c;this.zoa=d;this.Lla=f;this.ald=j?new a0a(b,a):i;m(this.b(),[g,b0a][kd](J));d=new LK(b);b=new TA(b,c);b[Jq](vA);d.ha(b);if(this.zoa){!a.Rc(TK)||x_a(this.zoa,2);this.zoa[Jq](vA);d.ha(this.zoa)}if(j){this.ha(d);this.Lla&&this.ha(this.Lla);this.ha(this.ald)}else{this.Lla&&this.ha(this.Lla);this.ha(d)}}
+function UK(b,a){this.V=b;this.Z=Rz(b);this.Ea=a[Pc];this.vl=a[uk];this.RYa=a.Gma;this.D0a=a.gCb;this.az=a.rUa;this.Og=a.o9;this.Aa=Dx(Cx(this.V));this.ynb=this.mdb()}function d0a(b,a,c){var d=new e_a;Gp(d,a);ep(d,b.vl);Ip(d,b.Ea);d.Gma=b.RYa;d.gCb=b.D0a;d.ZZb=c;return d}
+function VK(b,a,c,d,f,g){this.V=b;this.Aa=Dx(Cx(this.V));this.Mb=jF(b);this.cnb=b.J(Cz);this.Z=Rz(b);this.Ea=a;this.phc=d;this.w2=c;this.Lvc=f;this.zvc=g?g:i;this.bTc=new Hf;this.rAa=[];this.Q=new kn(this);this.fzb=this.qa=0;if(Jz(this.Z,852))this.fzb=1;this.Hh=new hC(6E4,b.J(XC));this.Q.w(this.Hh,yi,this.R8)}var e0a="us:p",f0a=":24";
+function g0a(b){if(!ega)return k;if(b.ab){cA(b.ab);b.ab=i}if(b.Pc)return k;var a=b.Z[hq](e0a);if(a){if(a!=b.Xzc){b.Xzc=a;a=a[Cc](xj);if(a[u]>0)b.Q8=Number(a[0]);if(a[u]>1){Ia(b.rAa,0);for(var c=a[1][Cc](wj),d=0;d<c[u];d+=2)b.rAa[p]([Number(c[d]),Number(c[d+1])])}if(a[u]>2)b.I8a=Number(a[2])}}else{b.qa=1;return h}if(b.Q8<=0||b.rAa[u]==0){b.qa=2;return h}c=Zf();if(h0a)if(c-h0a<3E5){b.qa=12;return h}b.nlb();if(b.Ska)return k;if(!b.Lvc[z](b.zvc)){b.qa=8;return h}if(!b.tD&&!b.Tl){b.qa=9;return h}a=b.Aa.za(qI);
+if(a==i){b.qa=4;b.ab=bA(f0a,b.YU,2E3,b);return h}d=b.AZb+b.I8a;if(b.I8a>0&&b.AZb>0&&c<d){b.qa=13;b.ab=bA(f0a,b.YU,d-c,b);return h}if(b.Hh.My()){b.qa=3;return h}d=b.cnb.J3;var f=0;if(d)f=XJa(d);for(var g=c=0;g<b.rAa[u];g++){var j=b.rAa[g];if(f>j[0]){c=j[1];break}}if(!d||d.Zma.Nb()==0)c=5;if(0==c){b.qa=10;return h}if(fga){b.qa=11;return h}a=rI(a,b.Ea);c=c;f=i;if(b.tD)f=b.tD.Hc();for(g=d=0;g<b.w2[u];g++){j=b.w2[g].Hc();a.za(j).Fi()&&d++}if(d>=b.Q8){b.qa=5;c=[]}else{j=[];if(b.fzb==1){d=d;f=f;g=[];for(j=
+1;j<=3;j++)for(var n=0;n<b.w2[u]&&g[u]<c&&d<b.Q8;n++){var s=b.w2[n];i0a(b,s)==j&&j0a(b,n,a,g,f,h,k)&&d++}for(n=0;n<b.w2[u]&&g[u]<c&&d<b.Q8;n++){s=b.w2[n];if(!s.Jl||i0a(b,s)>3)j0a(b,n,a,g,f,k,k)&&d++}j=g}else for(g=0;g<b.w2[u]&&j[u]<c&&d<b.Q8;g++)j0a(b,g,a,j,f)&&d++;c=j}if(b.qa==5)return h;if(c[u]){if(b.qa==0||b.qa==4)dE(b.V).cma(k0a,Zf()-b.V.Ev.Snd);b.qa=6;b.Ska=HSa(a,c);kF(b.Mb,b.Ska);b.Ska.Ie(b)}else b.qa=7;return h}
+function j0a(b,a,c,d,f,g,j){a=b.w2[a];var n=a.Hc();if(!c.za(n).Fi()&&n!=f&&!(b.pna&&b.pna.Xb(n))&&(!j||!a.Jl)&&(!g||a.Jl)){d[p](n);return h}return k}function i0a(b,a){b=a.Jo();a=5;for(var c=0;c<b[u];c++)if(b[c][Kb](l0a)){var d=Number(b[c][Zc](3));if(d<a)a=d}return a}function m0a(){n0a||(n0a=new gYa);return n0a}
+var o0a="xI",p0a="xG",q0a='"> &nbsp;</td><td class="',r0a="zz",s0a="A deleted message matches your search. ",t0a='" class="xH">',u0a="View it",v0a=" or go to ",w0a='" class="xH">Trash</span> to delete forever.',x0a="Deleted messages match your search. ",y0a="View them";
+function z0a(b,a){var c=a||new U;c[R](XJ,o0a,YJ,p0a,q0a,p0a,W);xI(Kw(b,{Hb:r0a}),c);c[R](NG,p0a,W);b.yod==1?c[R](s0a+(HK+b.Ojc+t0a+(u0a+(gB+(v0a+(HK+b.bic+w0a)))))):c[R](x0a+(HK+b.Ojc+t0a+(y0a+(gB+(v0a+(HK+b.bic+w0a))))));c[R](TG);if(!a)return c[t]()}var A0a="No messages matched your search. You can ",B0a='" class="x0">broaden your search</span> to look in "Mail & Spam & Trash".';function C0a(b,a){var c=a||new U;c[R](A0a+(HK+b.Ij+B0a));if(!a)return c[t]()}
+var D0a="yS",E0a="Search results for:",F0a='<span class="yT">';function G0a(b,a){var c=a||new U;c[R](X,D0a,W,E0a+(F0a+(b.Zgb+gB)),Z);if(!a)return c[t]()}var H0a="yR",I0a="Searched ",J0a=". Still searching...</span>";function K0a(b,a){var c=a||new U;c[R](X,H0a,W,pE+(I0a+(b.Rnd+J0a)),Z);if(!a)return c[t]()}var L0a="<span>Search interrupted. To get all results, refresh the list.</span>";function M0a(b,a){b=a||new U;b[R](X,H0a,W,L0a,Z);if(!a)return b[t]()}var N0a="<span>Search complete.</span>";
+function O0a(b,a){b=a||new U;b[R](X,H0a,W,N0a,Z);if(!a)return b[t]()}var WK="threadlists";function P0a(b,a,c,d){this.V=b;this.Sr=a;this.xa=c;this.Ea=d;this.Z=Rz(b);this.Aa=Dx(Cx(b));this.Xi=this.Aa.za(WK).Zn(d);this.jb=JB(b);this.Lh=TD(b);this.mw=aF(b)}var Q0a="tfu",R0a="tur",S0a="tfc",T0a="pfs",U0a="pfy";
+function V0a(b,a,c){if(!(b.xa.Th<0)){var d=b.Sr.xa.Zsa(),f=d.Hc(),g=d.vf(),j;j=b.xa;j=j.Th<0?-1:j.Rf+j.Th;var n=b.Xi.J(),s=n.nj,v=n.fN(),C=n.I_(),M=n.uua(),Y=n.ZZa;if(a){IFa(b.Lh,b.Ea,f,Y,c);if(d.Jl&&!MD(b.Lh)){d.LRa();b.Cg=b.Aa.za(qI);b.Cg&&b.Cg.Yaa(f,d.vf(),h)}}else{QF(b.Sr,W0a);Y=XK(b.Sr);a=b.xa.Th;c=b.Sr.zdb();for(var ha=-1,tb=0,zc=k,qb=0;qb<Y[u];qb++){if(ha==-1&&Y[qb].Jl){ha=qb;zc=h}if(zc&&Y[qb].Jl)tb++;else Y[qb].Jl||(zc=k)}if(Jz(b.Z,717)){if(X0a){X0a=k;b.mw.Hz(Q0a,ha);b.mw.Hz(R0a,tb);b.mw.Hz(S0a,
+a)}b.mw.Hz(T0a,c)}Jz(b.Z,697)&&b.mw.Hz(U0a,b.Sr.Bdb());a=[];c=[];for(ha=0;ha<Y[u];ha++){a[p](Y[ha].Hc());c[p](Y[ha].vf())}if(Y=b.Aa.za(qI)){Y=rI(Y,b.Ea);ha=d.Hc();(Y=Y.za(ha,h))&&Y.Fi()&&Y.J().dL>d.dL&&b.Xi.rg()}if(d.Jl){Y=d.Hc();ha=b.Aa.za(qI);(Y=(ha=rI(ha,b.Ea,h))&&ha.za(Y,h))&&DSa(Y,d.M1)}b.Sr.opa();b.jb[bq]({view:YK,search:b.Sr.YRb(),Zo:f,Am:g,zSa:a,ASa:c,zz:j,urc:b.xa.Th,xR:s,x_a:v,cga:C,A_a:M,Iba:n.ZZa,Lja:b.xa.mV})}}}function Y0a(b){this.Db=b}
+var Z0a="advanced-search",a1a="create-filter",ZK="m_inbox",aL="vftt_inbox";function b1a(b,a){var c=i;switch(b){case Hl:case Py:c=Wya(c1a(a[db]()));break;case Fy:case Jy:c=Ly(c1a(a[db]()));break;case Z0a:case Oy:b=c1a(a[db]());c=new Sya(Oya(b,d1a));break;case a1a:case ul:b=c1a(a[db]());c=new Qy(Oya(b,e1a));break;case ce:b=c1a(a[db]());b=Oya(b,f1a);c=new uH(b.group);break;case kz:case sz:case cz:case iz:case fz:case pz:case jza:case Yy:case Zy:case ez:case ZK:case aL:c=Sy.QCa[b];break}return c}
+function c1a(b){return b?Rf(b):I}var g1a="ix_nt";function h1a(b,a){return gza(a)?20:yy(b).Ep(g1a)}function i1a(b,a,c){b=h1a(b,a);return l[rb](c/b)}var bL="bx_sc",cL="bx_ns";
+function dL(b,a,c,d,f){Bx(this);xJ[z](this,b,this.aa.vMa(b,a));f.tb(this);this.Aa=Dx(Cx(b));this.Mb=jF(b);this.xB=sC(b);this.EB=wJ(b);this.Z=Rz(b);this.lb=yy(b);this.xl=tE(b);this.fc=dC(b);this.Xi=this.Aa.za(WK).Zn(a);this.Ea=a;this.D0a=d;this.Og=this.Jw();this.az=c;this.Rf=this.az*this.Og;this.RYa=this.lb.nf(bL);this.z2b=this.lb.nf(cL);this.H3=new DYa(b,this.rZa,this.Dvc,this);ep(this,f.tNa()[Qk]());this.Nda=f;this.co=this.Aa.za(LC);this.jb=JB(b);this.Rh=tH(b);this.xa=this.Nda.xa;this.Du=this.Nda.tNa();
+this.Dz=this.B().J(XC);this.Hh=new hC(12E5,this.Dz);this.Uq=new VK(b,a,XK(this),eL(this),this.DIb,this);this.Uq.dk(this);this.vya=f.vya;this.eUa=f.rdb();this.pA=f.Ocb();this.Jc();this.EB.zC==kD&&this.sf(1);this.eJ=new PB(b)}function eL(b){return b.xa.vy()}function XK(b){return b.xa.Om}function j1a(b){var a=b.Jw();if(b.Og!=a){b.Og=a;b.xa.Saa(a);return h}return k}function k1a(b){var a=b.lb.nf(cL);if(b.z2b!=a){b.z2b=a;return h}return k}
+function l1a(b){var a=b.lb.nf(bL);if(b.RYa!=a){b.xa.qCa(a);b.RYa=a;return h}return k}var m1a="Invalid search query - returning all mail.";function n1a(b){b.Bb().nd()&&b.Rh.Ad(new Zz(m1a))}function o1a(b,a){b=[];for(var c=0;c<a[u];c++){var d=a[c];if(d)for(var f=0;f<d[u];f++)b[p](d[f])}return b}function p1a(b,a,c){b.Du.Kib(a.mg)?dCa(a,b.xa.hdb()):fL(b,function(d){if(this[uk].Vo(d.vf()))uB(a,d.Hc(),c?d.Qy:d.vf())});return h}function q1a(b){if(b.Ml){var a=b.Ml;b.Ml=i;a[wc]()}}
+var r1a="This action will affect all conversations in this search. Are you sure you want to continue?",s1a="This action will affect the one conversation in ",t1a=". Are you sure you want to continue?",u1a="This action will affect both conversations in ",v1a="This action will affect all ";
+function w1a(b,a){a=b.xMa(a);switch(b.Ea.Ga()){case Jy:case Nd:case Oy:case ul:b=new U;b[R](r1a);b=b[t]();return b;default:b=new U;if(a.ZF==1)b[R](s1a+(a.LQ+t1a));else a.ZF==2?b[R](u1a+(a.LQ+t1a)):b[R](v1a+(a.ZF+(LZa+(a.LQ+t1a))));b=b[t]();return b}}function x1a(b){b.aa.h4a();b[Sq]()}function gL(b,a){b=b.xa.FO(a);return b!=i?b.Hc():i}function y1a(b,a){b=b.xa.FO(a);return b!=i?b.vf():i}function z1a(b){b.xa.ola();b.skb=b.Ml;b.Ml=i;b.qca()}
+function A1a(b,a,c,d){var f=a[c].Jl;if(f==a[d].Jl)return b.xa.mV==oy?c:d;return f?c:d}function B1a(b,a,c){return(b=a[u]-c[u])?b:a<c?-1:a>c?1:0}function fL(b,a){for(var c=eL(b).Oa(),d=0;d<c[u];d++)a[z](b,c[d])}function C1a(b,a,c,d){b.xa.Mn(a);b.xB.lf();V0a(b.eUa,c,d)}function D1a(){}function hL(){}var E1a="XMLHTTP TEXT (",F1a="): ";function iL(b,a,c,d){b[dr](E1a+a+F1a+G1a(b,c)+(d?J+d:I))}var H1a="Exception";function jL(b,a,c){b.TW((c||H1a)+a)}var I1a="y2f%",J1a="Exception parsing expected JS array - probably was not JS";
+function G1a(b,a){if(!a||a==I1a)return a;try{for(var c=ix(a),d=0;d<c[u];d++)Ve(c[d])&&K1a(b,c[d]);return zh(c)}catch(f){b.Ef(J1a);return a}}var L1a="noop";function K1a(b,a){if(!(a[u]<2)){b=a[1];if(Ve(b))if(!(b[u]<1)){a=b[0];if(a!=dx&&a!=L1a&&a!=Id)for(a=1;a<b[u];a++)b[a]=I}}}var M1a="=redacted&";function N1a(b,a){if(!a)return i;b=I;a=a[Cc](Sf);for(var c=0;c<a[u];c++){var d=a[c][Cc](ei);if(d[u]>1){var f=d[0];d=d[1];var g=f[Cc](mg);b+=g[u]>=2&&g[1]==Wi?f+ei+d+Sf:f+M1a}}return b}var O1a="TestLoadImageWithRetries: ";
+function P1a(b,a,c,d,f){(new hL).Ef(O1a+f);if(d==0)c(k);else{var g=f||0;d--;Q1a(b,a,function(j){j?c(h):Je[xc](function(){P1a(b,a,c,d,g)},g)})}}var R1a="TestLoadImage: loading ",S1a="TestLoadImage: loaded",T1a="TestLoadImage: error",U1a="TestLoadImage: abort",V1a="TestLoadImage: timeout";
+function Q1a(b,a,c){var d=new hL;d.Ef(R1a+b);var f=new Image;cp(f,function $Ei(){try{d.Ef(S1a);W1a(f);c(h)}catch(j){jL(d,j)}});oa(f,function $Fi(){try{d.Ef(T1a);W1a(f);c(k)}catch(j){jL(d,j)}});oma(f,function $Gi(){try{d.Ef(U1a);W1a(f);c(k)}catch(j){jL(d,j)}});f.krb=function $Hi(){try{d.Ef(V1a);W1a(f);c(k)}catch(j){jL(d,j)}};Je[xc](function(){f.krb&&f.krb()},a);f.src=b}function W1a(b){cp(b,i);oa(b,i);oma(b,i);b.krb=i}
+function kL(b,a,c,d,f){this.ec=b;this.cd=a;this.Lx=c;this.tI=d;this.uBa=f||1;this.wo=45E3;this.Q=new kn(this);this.XUa=new Bh;this.XUa[Dc](250)}var X1a="Non-200 return code (",Y1a="XMLHTTP failure (no data)",Z1a="HttpConnection timeout",a2a="Unknown error";function b2a(b,a){switch(b){case 0:return X1a+a+xh;case 1:return Y1a;case 2:return Z1a;default:return a2a}}function c2a(b,a,c,d){b.Xd=1;b.Qn=bi(a.vc());b.JL=i;b.A8a=c;if(d)b.fcc=k;d2a(b)}
+var e2a="application/x-www-form-urlencoded",f2a="XMLHTTP REQ (",g2a=") [attempt ",h2a="]: ";function d2a(b){b.BF=b.Qn.vc();gx(b.BF,IB,b.uBa);b.hFa=0;b.Tx=new Gh;ih(b.Tx,Lh,b.Bkc,k,b);var a=b.rE?Zwa(b.rE):{};if(b.JL){b.Xna=Aj;a[Bj]=e2a;b.Tx[Mb](b.BF,b.Xna,b.JL,a)}else{b.Xna=zj;if(b.fcc&&!Jg)a.Connection=qn;b.Tx[Mb](b.BF,b.Xna,i,a)}b.AWa=Zf();a=b.cd;a[dr](f2a+b.tI+g2a+b.uBa+h2a+b.Xna+ch+b.BF+ch+N1a(a,b.JL));lL(b)}
+var i2a="420+",j2a="No response text for uri ",k2a=" status ",l2a="XMLHTTP RESP (",m2a=") [ attempt ",n2a="Unknown SID";
+function o2a(b){var a=b.Tx.ts();if(L||Jg&&!vg(i2a)){if(a<4)return}else if(a<3||a==3&&!Ng&&!b.Tx.dj())return;p2a(b);var c=b.Tx.hf();b.Tw=c;var d=b.Tx.dj();d||b.cd.Ef(j2a+b.BF+k2a+c);b.hR=c==200;b.cd[dr](l2a+b.tI+m2a+b.uBa+h2a+b.Xna+ch+b.BF+ch+a+J+c);if(b.hR){a==4&&b.tJ();if(b.A8a){q2a(b,a,d);Ng&&a==3&&r2a(b)}else{iL(b.cd,b.tI,d,i);s2a(b,d)}if(b.hR)if(!b.xda)if(a==4)b.ec.uL(b);else{b.hR=k;lL(b)}}else{if(c==400&&d[Db](n2a)>0){b.wk=3;mL(13)}else{b.wk=0;mL(14)}iL(b.cd,b.tI,d);b.tJ();t2a(b)}}
+var u2a="[Incomplete Response]",v2a="[Invalid Chunk]",w2a="[Invalid Chunked Response]";function q2a(b,a,c){for(var d=h;!b.xda&&b.hFa<c[u];){var f=x2a(b,c);if(f==y2a){if(a==4){b.wk=4;mL(15);d=k}iL(b.cd,b.tI,i,u2a);break}else if(f==z2a){b.wk=4;mL(16);iL(b.cd,b.tI,c,v2a);d=k;break}else{iL(b.cd,b.tI,f,i);s2a(b,f)}}if(a==4&&c[u]==0){b.wk=1;mL(17);d=k}b.hR=b.hR&&d;if(!d){iL(b.cd,b.tI,c,w2a);b.tJ();t2a(b)}}function r2a(b){b.Q.w(b.XUa,yj,b.Dbd);b.XUa[Rc]()}
+function x2a(b,a){var c=b.hFa,d=a[Db](ch,c);if(d==-1)return y2a;c=Number(a[Zc](c,d));if(ia(c))return z2a;d=d+1;if(d+c>a[u])return y2a;a=a[nc](d,c);b.hFa=d+c;return a}var A2a="htmlfile",B2a="<html>",C2a='<script>document.domain="',D2a='"<\/script>',E2a="</html>",F2a="DOMAIN",G2a='<iframe src="',H2a='"></iframe>',I2a="TRIDENT REQ (",J2a="]: GET\n";
+function K2a(b,a,c){b.Xd=3;b.Qn=bi(a.vc());b.EM=new ActiveXObject(A2a);a=I;var d=B2a;if(c){a=ba[Ic][Gma];d+=C2a+a+D2a}d+=E2a;b.EM[bb]();b.EM[nq](d);b.EM[Xk]();b.EM[ac].m=G(b.G8c,b);b.EM[ac].d=G(b.L6b,b,h);b.EM[ac].rpcClose=G(b.L6b,b,k);c=b.EM[Qb](T);b.EM[o](c);b.BF=b.Qn.vc();b.BF.ka(F2a,a);b.BF.ka(IB,b.uBa);Q(c,G2a+b.BF+H2a);b.AWa=Zf();b.cd[dr](I2a+b.tI+m2a+b.uBa+J2a+b.BF);lL(b)}function lL(b){b.qCb=Zf()+b.wo;L2a(b,b.wo)}function L2a(b,a){if(b.koa!=i)e(Error(".163"));b.koa=nL(G(b.F9c,b),a)}
+function p2a(b){if(b.koa){Je[gb](b.koa);b.koa=i}}function t2a(b){b.ec.G_()||b.xda||b.ec.uL(b)}var M2a="Error in httprequest callback";function s2a(b,a){try{b.ec.h6b(b,a)}catch(c){jL(b.cd,c,M2a)}}function N2a(b,a){this.ec=b;this.cd=a}var O2a="TestConnection: starting stage 2",P2a="TYPE",oL="html",Q2a="xmlhttp";
+function R2a(b){b.cd.Ef(O2a);b.Lc=new kL(b,b.cd,void 0,void 0,void 0);b.Lc.R1(b.rE);var a=S2a(b.ec,b.o7,b.Vf);mL(5);if(L){gx(a,P2a,oL);K2a(b.Lc,a,Boolean(b.o7))}else{gx(a,P2a,Q2a);c2a(b.Lc,a,k)}}function T2a(b){this.vS=b;this.qa=1;this.fQ=[];this.Hka=[];this.cd=new hL}var U2a="statevent";function V2a(b,a){N[z](this,U2a,b);this.gDa=a}var W2a="timingevent";function X2a(b,a,c,d){N[z](this,W2a,b);jma(this,a);this.BBa=c;this.QDd=d}
+function Y2a(b){if(b.j4){b.j4[wc]();b.j4=i}if(b.FD){b.FD.tf();b.FD=i}if(b.fY){Je[gb](b.fY);b.fY=i}if(b.Bw){b.Bw.tf();b.Bw=i}if(b.jK){Je[gb](b.jK);b.jK=i}}function Z2a(b){var a=0;b.FD&&a++;b.Bw&&a++;return a}function a3a(b){if(!b.Bw)if(!b.jK){b.jK=nL(G(b.v6b,b),0);b.K5=0}}var b3a="SID",c3a="RID",d3a="AID";
+function e3a(b,a){var c,d;if(a){c=a.tI;d=a.JL}else{c=b.CSa++;d=f3a(b)}a=b.cMa.vc();a.ka(b3a,b.Lx);a.ka(c3a,c);a.ka(d3a,b.MQa);g3a(b,a);c=new kL(b,b.cd,b.Lx,c,b.K5+1);c.R1(b.rE);c[xc](l[kb](1E4)+l[kb](1E4*l[Tc]()));b.Bw=c;b=d;c.Xd=1;c.Qn=bi(a.vc());c.JL=b;c.A8a=h;d2a(c)}function g3a(b,a){if(b.na)(b=b.na.uQb(b))&&Ef(b,function(c,d){a.ka(d,c)})}var h3a="count=",i3a="req";
+function f3a(b){for(var a=l.min(b.fQ[u],1E3),c=[h3a+a],d=0;d<a;d++){var f=b.fQ[d];Ef(f,function(g,j){c[p](i3a+d+mg+j+ei+aa(g))});b.Hka[p](f)}b.fQ[jd](0,a);return c[kd](Sf)}function j3a(b){if(!b.FD)if(!b.fY){b.kHb=1;b.fY=nL(G(b.u6b,b),0);b.pHa=0}}var k3a="Test Connection Finished",l3a="connectChannel_()";function m3a(b,a,c){b.cd.Ef(k3a);b.cjc=b.Dsc&&c;b.Tw=a.hH();b.cd.Ef(l3a);b.XCc(1,0);b.cMa=n3a(b,b.Vf);a3a(b)}var o3a="Test Connection Failed";function p3a(b,a){b.cd.Ef(o3a);b.Tw=a.hH();pL(b,2)}
+var q3a="Error code ";function pL(b,a){b.cd[dr](q3a+a);if(a==2||a==9){var c=i;if(b.na)c=b.na.MRb(b);var d=G(b.Xmd,b);c=c;if(!c){c=new Sh("http://www.google.com/url");bi(c);gx(c,Ky,"http://www.google.com/images/cleardot.gif")}Q1a(c[t](),1E4,d)}else mL(2);b.J0(a)}var r3a="GetForwardChannelUri: ";function n3a(b,a){a=s3a(b,i,a);b.cd.Ef(r3a+a);return a}var t3a="GetBackChannelUri: ";function S2a(b,a,c){a=s3a(b,L?a:i,c);b.cd.Ef(t3a+a);return a}var u3a="VER";
+function s3a(b,a,c,d){var f=ba[Ic],g=ci(f[er],i,a?a+He+f[Gma]:f[Gma],d||f.port,c);b.ssa&&Ef(b.ssa,function(j,n){g.ka(n,j)});g.ka(u3a,6);g3a(b,g);return g}function nL(b,a){if(!Ze(b))e(Error(".166"));return Je[xc](function(){b()},a)}function mL(b){qL[r](new V2a(qL,b))}function v3a(){}var w3a=":25";
+function x3a(b,a,c,d,f){this.Ze=b;this.lS=a;this.qKb=d||i;this.Xza=new fC;this.NAa=new fC;this.XHb=f||i;this.cd=i;this.vS=c;this.qa=-1;this.wk=0;this.ec=this.cea(this.vS);this.Mw=new aA(w3a,1E3);ih(this.Mw,yj,this.aNb,h,this);this.Mw[Rc]();this.yla=5E3+l[Tc]()*2E4}var y3a="Qa";function z3a(b,a){if(b.qa!=a){var c=b.qa;b.qa=a;switch(b.qa){case 5:A3a(b);break;case 4:b.wk=0;b.usa=k;b.Hg(i);b.Ze[r](y3a);break}b.usa||b.Ze[r](new B3a(c,a,b.wk))}}function C3a(b){if(Ue(b.BSa)){cA(b.BSa);b.BSa=i}}
+function D3a(b){if(Ue(b.Prb)){cA(b.Prb);b.Prb=i}}var E3a=":27";function A3a(b){if(!(b.wk==1||b.wk==4)){if(!b.UOa&&b.yla*2<24E4)b.yla*=2;if(b.UOa)b.yla=500;b.Sja=Zf()+b.yla;C3a(b);b.BSa=bA(E3a,b.Tac,b.yla,b)}}function F3a(b,a){var c=Zf(),d=b.OQa>0&&c-b.OQa>3E4;if(a)b.OQa=c;return d}function G3a(b,a,c,d){this.rDa=new Hf;this.av=new x3a(this,b,a,c,d)}function H3a(b,a){this.Xd=a;this.Ze=b}var rL="Oa";function I3a(b){N[z](this,rL);this.aM=b}var sL="Pa";
+function B3a(b,a,c){N[z](this,sL);this.ika=b;this.tm=a;Xla(this,c)}var J3a="Ra";function K3a(b,a){N[z](this,J3a);this.HUa=b;this.J_a=a}function tL(b){return b.J(dx)}function L3a(b){var a=b.xc();(a==1||a==5||a==6)&&b.av.Tac()}function uL(b){this.ik=b}var vL="ub",wL="ua";function xL(b){this.na=void 0;this.V=b;this.lb=yy(b);this.Aa=Dx(Cx(this.V));this.Hn=fy(b).ud;this.UQa={};this.pUa=[];this.wKa=new Hf;Bx(this);b=Gx(vL);this.w(this.Hn,b,this.O_c);b=Fx(wL);this.w(this.Hn,b,this.N_c)}
+function M3a(b){if(!b.Jg)b.Jg=b.Aa.za(WK,k);if(!b.Cg)b.Cg=b.Aa.za(qI,k);if(!b.co)b.co=b.Aa.za(LC,k)}function N3a(b,a,c,d,f,g,j){for(var n=0;n<d[u];n++){var s=d[n],v=s[0];s=s[1];yL(b,a,c,v,s,f,g);b.STa(v,s,j)}}function yL(b,a,c,d,f,g,j,n){if(g[u]&&b.co)for(var s=0;s<g[u];s++){var v=g[s];v[xb](0)!=Ty&&bVa(b.co,v)}a=b.lJ(a,c,d);g[u]&&b.SX(d,f,g,n);j[u]&&b.m1(d,f,j,n);a&&O3a(a)}function zL(b,a){for(var c=0;c<b.pUa[u];c++)b.pUa[c].AOb.set(a,1)}
+function P3a(b,a,c,d,f){if(!f){if(b.Jg){cI(b.Jg,Q3a);cI(b.Jg,R3a);SRa(b.Jg);b.fXb();c&&URa(b.Jg,c)}if(b.Cg&&c){tI(b.Cg,c);zL(b,c)}}}var AL="^s",BL="^k",CL="^r";function S3a(b,a,c,d){this.ik=b;this.aX=a;this.Ea=c;this.Sq=d;this.on=this.Uk=i;b=this.ik.co;if(b.hc()){a=OC(b);a[p](TI);a[p](AL);a[p](BL);a[p](CL);b.AFb(a);b.aa.Hoa(a);b=a}else b=i;this.kl=b;this.aBb=T3a(this);this.AAb=T3a(this);this.NYb=h;Bx(this)}function T3a(b){for(var a={},c=0;c<b.kl[u];c++)a[b.kl[c]]=0;return a}
+function O3a(b){b.K2(1);if(b.NYb)for(var a=0;a<b.kl[u];a++){var c=b.kl[a],d=b.aBb[c],f=b.AAb[c];if(d||f)U3a(b,c,d,f)}else b.ik.co.rg()}function V3a(b,a,c,d){for(b=0;b<c[u];b++)a[c[b]]+=d}function U3a(b,a,c,d){var f=gEa(b.ik.co,a,h);if(f&&f.hc()){f=f.J();if(f.rt>=0){var g=f.rt;if(!b.aa.xwb(g,c,f)){cEa(f,g+c);dEa(f,I)}}if(f.lD>=0){g=f.lD+d;if(f.lD!=g){f.lD=g;f.xj(4)}}}b.aa.z5a(a,c,d)}var W3a="prf",X3a="msgs",Y3a="lnm";
+function Z3a(b,a){b=a.Rc(W3a);var c=a.Rc(X3a);a=a.Rc(Y3a);return!!(b==Hj||c&&!a)}function a4a(b,a){if(a){b=UC(RC(b.V));if(b=EH(b.B())){b=b.vz;a=new Hf(a,1);for(var c=0;c<b[u];c++){var d=b[c];if(d.md()==wE||d.md()==xE)d.Bb().lba(a)&&d.xa.xwa()&&d.xa.eXb()}}}}function b4a(b){b.Jg&&TRa(b.Jg);b.Cg&&LSa(b.Cg)}function DL(b){this.c5a=b}function c4a(b){this.Db=b}function d4a(b){this.Db=b}function e4a(b){this.jb=b}
+function EL(b,a,c){YC[z](this,b,a);this.V=a;this.Jz=RC(a);this.xf=fy(a);this.Ma=yy(a);this.QOb=!!c;this.Ttb();this.QOb||vEa(this.Jz,this)}var FL="be";function f4a(b){lA(b.V,aE,Rd);lA(b.V,KH,FL)}function GL(b,a){if(a)loadTimes=[a,a,a,a,a,Zf()]}function HL(){}function IL(b){Bx(this);this.V=b;this.Jz=RC(b);this.Q=new kn(this);this.Q.w(this.Jz,eD,this.tYc);this.Q.w(this.Jz,TC,this.Gpb)}function g4a(b,a,c){(new IL(b)).tb();b=new EL(top,b);b.OK(a,c);return b}var h4a="DOMMouseScroll",i4a="mousewheel";
+function j4a(b){this.wa=b;this.lRa=ih(this.wa,Fh?h4a:i4a,this)}function k4a(b,a,c,d){a&&this.wc(a,void 0);za(this,i4a);this.detail=b;this.Hea=c;this.Iea=d}
+var Vua=i,dva=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i,JL="#000000",l4a="#008000",m4a="#ffffff",eva={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:JL,blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",
+cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",
+firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:l4a,greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",
+lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",
+mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",
+rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:m4a,whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},iva={thin:2,
+medium:4,thick:6},tva=/<[^>]*>|&[^;]+;/g,xva=/[^\d]+$/,Vva=/(\(.*?\)+)|(\[.*?\]+)|(\{.*?\}+)|(<.*?>+)/g,iwa=/\/a\/[^\/]+\/b\/[^\/]+\/u\/[^\/]+/,n4a=/\/b\/[^\/]+(?:\/u\/[^\/]+)?\/?/,hwa=/\/mail\/b\/[^\/]+\/u\/[^\/]+/,gwa=/\/a\/[^\/]+\/d\/[^\/]+/,fwa=/\/mail\/d\/[^\/]+/,zwa=/[?&]($|#)/;H(Iw,Jf);Iw[w].tb=B();H(Lw,ao);F=Lw[w];F.HSa=i;F.ota=D(dZa);F.Q1=function $Ki(a){this.xS=a;this.HSa=i;this.xb(this.h7a())};var KL="background-color";F.qH=function $Li(){var a=this.rH();if(a){a=zw(a,KL);return uva(a)}else return i};
+F.RW=function $Mi(a){a=uva(a);if(!this.HSa)this.HSa=Li(this.xS,function(c){return uva(c)});this.Pl(a?ff(this.HSa,a):-1)};var o4a="-Jt",p4a="background-color:",q4a="RGB (";F.h7a=function $Ni(){return Li(this.xS,function(a){var c=this.W().ba(T,{"class":this.li().Qb()+o4a,style:p4a+a});ik(c,a[xb](0)==Lj?q4a+yw(a)[kd](hg)+xh:a);return c},this)};H(Nw,Hn);F=Swa[w];F.wya=0;F.add=function $Oi(a){this.lY[this.wya]=a;this.wya=(this.wya+1)%this.Elb};F.J=function $Pi(a){a=Mva(this,a);return this.lY[a]};
+F.set=function $Qi(a,c){a=Mva(this,a);this.lY[a]=c};F.Nb=function $Ri(){return this.lY[u]};F.nd=function $Si(){return this.lY[u]==0};Aa(F,function $Ti(){Ia(this.lY,0);this.wya=0});F.Oa=function $Ui(){return Nva(this,this.Nb())};F.Sb=function $Vi(){for(var a=[],c=this.Nb(),d=0;d<c;d++)a[d]=d;return a};F.Xb=function $Wi(a){return a<this.Nb()};F.BS=function $Xi(a){for(var c=this.Nb(),d=0;d<c;d++)if(this.J(d)==a)return h;return k};
+F.Hta=function $Yi(){if(this.Nb()==0)return i;return this.J(this.Nb()-1)};var r4a=i;Bi(O.S(),Kd);_B_prog(44)}catch(e){_B_err(e)}
+
+try{xx[w].tn=function $Zi(a){if(this.SJ)for(var c=0;c<this.SJ[u];++c)if(this.SJ[c]instanceof a)return this.SJ[c];return i};H(lxa,Jf);lxa[w].L=function $_i(){if(this.Aa){this.Aa.D();this.Aa=i}};Ha(mxa[w],function $0i(){return this.O[t]()});mxa[w].kc=D(ae);H(Ex,N);H(Hx,Jf);F=Hx[w];F.DL=i;F.L=function $2i(){if(this.Q){this.Q.D();this.Q=i}};F.Kk=function $3i(){Ix(this);if(!this.Q)this.Q=new kn(this);return this.Q};var LL="Jb";F.vn=D(LL);F.Je=D("KG");F.ac=D(Jaa);F.Ig=function $7i(a){if(this.DL!=i&&a!=i)e(Error(".49"));if(a&&a.mb!=this.mb)e(Error(".50"));this.t9a=this.Jyb=i;if(a!=i){Ix(this);this.KG=a.Je()+Md+this.Jb}else this.KG=i;this.DL=a};F.pua=function $8i(){if(!this.Jyb)this.Jyb=this.KG+Kaa;return this.Jyb};
+F.SQb=function $9i(){if(!this.t9a)this.t9a=this.KG+Laa;return this.t9a};F.WRb=function $$i(a){return this.Je()+xj+a};F.hC=E(4);H(Jx,Hf);F=Jx[w];Aa(F,function $bj(){pxa(this,h)});F.D=function $cj(){pxa(this,k)};wa(F,function $dj(a){qxa(this,a);var c=Jx.C[Pb][z](this,a);c&&this.FKa(a);return c});F.set=function $ej(a,c){if(this.J(a)!==c){qxa(this,a);Jx.C.set[z](this,a,c);if(c&&c instanceof uh){c=ih(c,oy,G(this.FKa,this,a));if(!this.msa)this.msa=new Hf;this.msa.set(a,c)}this.FKa(a)}};F.Vl=function $fj(a){var c=this.Um.mb;c.Qf();try{Jx.C.Vl[z](this,a)}finally{c.Mf()}};F.FKa=function $gj(a){this.Um.mb.c9a(this.Um,a)};H(Kx,Hx);F=Kx[w];F.J=D(fRa);F.L=function $ij(){Kx.C.L[z](this);this.lI.D()};F.hC=function $jj(){var a=hy.C.hC[z](this);a|=16;return a};F.Ca=function $kj(a){return this.lI.J(a)};F.Fa=function $lj(a,c){this.lI.set(a,c)};H(sxa,Kx);var s4a="hg",ML="ia",NL="al",OL="cs",PL="af",QL="pd",RL="it",t4a="chh",u4a="cfh",v4a="chu",w4a="chih",x4a="cfu",y4a="sbu",SL="ow",TL="sl",UL="hb",z4a="hv",A4a="hh",VL="vl",WL="pl",B4a="bl",XL="lu",YL="ip",C4a="rh",D4a="cad",ZL="asd",E4a="aid",F4a="ihru",G4a="edw",H4a="spg",I4a="ulm",J4a="tlt",K4a="ppl",L4a="bjl",M4a="tal";
+sxa[w].k0c=function $mj(a){a=new mxa(a[dq]);this.mb.Qf();try{this.Fa(s4a,a.O[1]);this.Fa(ML,a.O[3]);this.Fa(NL,a.O[4]);this.Fa(OL,a.O[5]);this.Fa(PL,a.O[6]);this.Fa(QL,a.O[7]);this.Fa(RL,a.O[8]);this.Fa(t4a,a.O[9]);this.Fa(u4a,a.O[10]);this.Fa(v4a,a.O[25]);this.Fa(w4a,a.O[29]);this.Fa(x4a,a.O[26]);this.Fa(y4a,a.O[27]);this.Fa(RD,a.O[11]);this.Fa(qD,a.O[24]);this.Fa(SL,a.O[12]);this.Fa(TL,a.O[13]);this.Fa(UL,a.O[14]);this.Fa(z4a,a.O[15]);this.Fa(A4a,a.O[16]);this.Fa(DE,a.O[17]);this.Fa(VL,a.O[18]);
+this.Fa(WL,a.O[19]);this.Fa(EE,a.O[20]);this.Fa(PG,a.O[28]);for(var c=[],d=a.O[21],f=0;f<d[u];f++)c[p](new RegExp(d[f],ii));this.Fa(mH,c);this.Fa(FL,a.O[22]);this.Fa(B4a,a.O[23]);d={};var g=a.O[2];for(f=0;f<g[u];f+=2)d[g[f]]=g[f+1];this.Fa(Uz,d);this.Fa(XL,a.O[31]);this.Fa(YL,a.O[32]);this.Fa(C4a,a.O[33]);this.Fa(D4a,a.O[34]);this.Fa(ZL,a.O[35]);this.Fa(E4a,a.O[36]);this.Fa(F4a,a.O[37]);this.Fa(fe,a.O[38]);this.Fa(hAa,a.O[39]);this.Fa(G4a,a.O[40]);this.Fa(H4a,a.O[41]);this.Fa(I4a,a.O[42]);this.Fa(J4a,
+a.O[43]);this.Fa(K4a,a.O[44]);this.Fa(L4a,a.O[45]);this.Fa(M4a,a.O[46])}finally{this.mb.Mf()}};H(txa,Jf);F=txa[w];F.Js=1;F.FVa=0;F.Ug=function $nj(a,c,d){var f=this.CM[a];f||(f=this.CM[a]=[]);var g=this.Js;this.MI[g]=a;this.MI[g+1]=c;this.MI[g+2]=d;this.Js=g+3;f[p](g);return g};F.oz=function $oj(a,c,d){var f=this.Ug(a,function(){c[cd](d,arguments);this.O_a(f)},this);return f};F.vX=function $pj(a,c,d){if(a=this.CM[a]){var f=this.MI;if(a=vm(a,function(g){return f[g+1]==c&&f[g+2]==d}))return this.O_a(a)}return k};
+F.O_a=function $qj(a){if(this.FVa!=0){if(!this.Zza)this.Zza=[];this.Zza[p](a);return k}var c=this.MI[a];if(c){var d=this.CM[c];d&&jf(d,a);delete this.MI[a];delete this.MI[a+1];delete this.MI[a+2]}return!!c};F.Kh=function $rj(a){var c=this.CM[a];if(c){this.FVa++;for(var d=qf(arguments,1),f=0,g=c[u];f<g;f++){var j=c[f];this.MI[j+1][cd](this.MI[j+2],d)}this.FVa--;if(this.Zza&&this.FVa==0)for(;c=this.Zza.pop();)this.O_a(c);return f!=0}return k};
+Aa(F,function $sj(a){if(a){var c=this.CM[a];if(c){Ff(c,this.O_a,this);delete this.CM[a]}}else{Ia(this.MI,0);this.CM={}}});F.Nb=function $tj(a){if(a){var c=this.CM[a];return c?c[u]:0}a=0;for(c in this.CM)a+=this.Nb(c);return a};F.L=function $uj(){txa.C.L[z](this);delete this.MI;delete this.CM;delete this.Zza};var vxa;H(uxa,Jf);F=uxa[w];F.Ug=function $vj(a,c){this.Yka.Ug(String(a),c)};F.oz=function $wj(a,c){this.Yka.oz(String(a),c)};F.vX=function $xj(a,c){return this.Yka.vX(String(a),c)};F.Kh=function $yj(a){var c=qf(arguments,1);c[ld](String(a));return this.Yka.Kh[cd](this.Yka,c)};F.D=function $zj(){if(!this.Pc){uxa.C.D[z](this);this.Yka.D();this.yu[bc]();vxa=this.yu=i}};F.Gn=function $Aj(a){for(var c=qf(arguments,1),d=this.yu.J(a),f=0;d&&f<d[u];f++){var g=d[f].Tfa[cd](i,c);if(Ue(g))return g}return i};
+F.Ued=function $Bj(a){for(var c=qf(arguments,1),d=this.yu.J(a),f=[],g=0;d&&g<d[u];g++){var j=d[g].Tfa[cd](i,c);if(Ue(j))f[f[u]]=j}return f};Ha(wxa[w],function $Cj(){return this.O[t]()});wxa[w].kc=D(ae);F=yxa[w];F.ea=function $Ej(){return this.O[0]};F.Yh=function $Fj(){return this.O[1]};F.Fl=function $Gj(){return this.O[2]};F.yua=function $Hj(){return this.O[3]};F.zua=function $Ij(){return this.O[4]};Ha(F,function $Jj(){return this.O[t]()});F.kc=D(ae);zxa[w].ea=function $Lj(){return this.O[0]};Ha(zxa[w],function $Mj(){return this.O[t]()});zxa[w].kc=D(ae);xxa[w].ea=function $Oj(){return this.O[0]};Ha(xxa[w],function $Pj(){return this.O[t]()});
+xxa[w].kc=D(ae);var Rxa,Oxa=/\./g;Ha(Sxa[w],function $Rj(){return this.O[t]()});Sxa[w].kc=D(ae);Txa[w].ea=function $Tj(){return this.O[1]};Ha(Txa[w],function $Uj(){return this.O[t]()});Txa[w].kc=D(ae);var N4a="PT0S",aM="Y",bM="T";
+ay[w].bEa=function $Wj(a){var c=l.min(this.cJ,this.RH,this.hs,this.zs,this.Zw,this.zx),d=l.max(this.cJ,this.RH,this.hs,this.zs,this.Zw,this.zx);if(c<0&&d>0)return i;if(!a&&c==0&&d==0)return N4a;d=[];c<0&&d[p](Qd);d[p](Xd);if(this.cJ||a)d[p](l.abs(this.cJ)+aM);if(this.RH||a)d[p](l.abs(this.RH)+XD);if(this.hs||a)d[p](l.abs(this.hs)+TC);if(this.zs||this.Zw||this.zx||a){d[p](bM);if(this.zs||a)d[p](l.abs(this.zs)+aD);if(this.Zw||a)d[p](l.abs(this.Zw)+XD);if(this.zx||a)d[p](l.abs(this.zx)+YD)}return d[kd](I)};
+ay[w].Qc=function $Xj(a){return a.cJ==this.cJ&&a.RH==this.RH&&a.hs==this.hs&&a.zs==this.zs&&a.Zw==this.Zw&&a.zx==this.zx};ay[w].vc=function $Yj(){return new ay(this.cJ,this.RH,this.hs,this.zs,this.Zw,this.zx)};ay[w].add=function $Zj(a){this.cJ+=a.cJ;this.RH+=a.RH;this.hs+=a.hs;this.zs+=a.zs;this.Zw+=a.Zw;this.zx+=a.zx};F=by[w];F.SG=0;F.Sfa=3;F.vc=function $_j(){var a=new by(this.Od);a.SG=this.SG;a.Sfa=this.Sfa;return a};F.getFullYear=function $0j(){return this.Od[fr]()};F.getYear=function $1j(){return this[fr]()};
+kaa(F,function $2j(){return this.Od[Cq]()});jp(F,function $3j(){return this.Od[iq]()});fma(F,function $4j(){return this.Od[hc]()});F.getDay=function $5j(){return this.Od[Gq]()};F.getUTCFullYear=function $6j(){return this.Od.getUTCFullYear()};F.getUTCMonth=function $7j(){return this.Od.getUTCMonth()};F.getUTCDate=function $8j(){return this.Od[Ema]()};F.getUTCHours=function $9j(){return this.Od[Qma]()};F.getUTCMinutes=function $$j(){return this.Od.getUTCMinutes()};F.getTimezoneOffset=function $ak(){return this.Od[sr]()};
+F.set=function $bk(a){this.Od=new Date(a[fr](),a[Cq](),a[iq]())};F.setFullYear=function $ck(a){this.Od[sq](a)};F.setYear=function $dk(a){this[sq](a)};F.setMonth=function $ek(a){this.Od[qq](a)};hma(F,function $fk(a){this.Od[zq](a)});F.setTime=function $gk(a){this.Od[gr](a)};F.setUTCFullYear=function $hk(a){this.Od.setUTCFullYear(a)};F.setUTCMonth=function $ik(a){this.Od.setUTCMonth(a)};F.setUTCDate=function $jk(a){this.Od.setUTCDate(a)};
+F.add=function $kk(a){if(a.cJ||a.RH){var c=this[Cq]()+a.RH+a.cJ*12,d=this[ar]()+l[rb](c/12);c%=12;if(c<0)c+=12;var f=l.min(Uxa(d,c),this[iq]());this[zq](1);this[sq](d);this[qq](c);this[zq](f)}if(a.hs){c=new Date(this[ar](),this[Cq](),this[iq](),12);a=new Date(c[hc]()+a.hs*864E5);this[zq](1);this[sq](a[fr]());this[qq](a[Cq]());this[zq](a[iq]());Yxa(this,a[iq]())}};F.bEa=function $lk(a,c){return[this[fr](),nx(this[Cq]()+1,2),nx(this[iq](),2)][kd](a?Qd:I)+(c?Zxa(this):I)};
+F.Qc=function $mk(a){return this[ar]()==a[ar]()&&this[Cq]()==a[Cq]()&&this[iq]()==a[iq]()};Ha(F,function $nk(){return this.bEa()});F.valueOf=function $ok(){return this.Od[sma]()};H(dy,by);F=dy[w];F.getHours=function $pk(){return this.Od[xq]()};F.getMinutes=function $qk(){return this.Od[nr]()};F.getSeconds=function $rk(){return this.Od[Oq]()};F.getMilliseconds=function $sk(){return this.Od.getMilliseconds()};F.getUTCHours=function $tk(){return this.Od[Qma]()};F.getUTCMinutes=function $uk(){return this.Od.getUTCMinutes()};
+F.setHours=function $vk(a){this.Od[Pma](a)};F.setMinutes=function $wk(a){this.Od[Ama](a)};F.setSeconds=function $xk(a){this.Od[Jma](a)};F.setMilliseconds=function $yk(a){this.Od.setMilliseconds(a)};F.setUTCHours=function $zk(a){this.Od.setUTCHours(a)};F.add=function $Ak(a){by[w].add[z](this,a);a.zs&&this[Pma](this.Od[xq]()+a.zs);a.Zw&&this[Ama](this.Od[nr]()+a.Zw);a.zx&&this[Jma](this.Od[Oq]()+a.zx)};
+F.bEa=function $Bk(a,c){var d=by[w].bEa[z](this,a);if(a)return d+J+nx(this[xq](),2)+xj+nx(this[nr](),2)+xj+nx(this[Oq](),2)+(c?Zxa(this):I);return d+bM+nx(this[xq](),2)+nx(this[nr](),2)+nx(this[Oq](),2)+(c?Zxa(this):I)};F.Qc=function $Ck(a){return this[hc]()==a[hc]()};Ha(F,function $Dk(){return this.bEa()});F.vc=function $Ek(){var a=new dy(this.Od);a.SG=this.SG;a.Sfa=this.Sfa;return a};_B_prog(45)}catch(e){_B_err(e)}
+
+try{var cM={};cM.bx_show0=h;cM.bx_show1=h;cM.bx_show2=h;cM.ix_nt=iea;cM.bx_hs=k;cM.bx_sc=k;cM.bx_ns=k;var dM="\n\r";cM.sx_dn=dM;cM.sx_rt=dM;cM.sx_sg=dM;cM.sx_sf="http://www.brainyquote.com/link/quotefu.rss";cM.bx_ve=k;cM.sx_vs=dM;cM.sx_vm=dM;cM.bx_vc=k;cM.lx_vst=(new by)[hc]();cM.lx_vend=dM;cM.bx_cm=h;cM.bx_en=k;cM.sx_dl=Vz;cM.bx_rf=k;cM.ix_ca=k;cM.ix_dotr=k;cM.bx_asd=h;cM.ix_at=k;cM.ix_ql=10;cM.bx_lq=k;cM.bx_sn=h;cM.sx_em=dM;cM.sx_at=I;cM.bx_pe=k;cM.ix_pd=k;cM.bx_ie=k;cM.sx_pu=dM;cM.ix_pp=k;
+cM.bx_pd=k;cM.bx_sp=k;cM.bx_qlfo=h;cM.ix_llsp=60;var O4a="classic";cM.sx_eisp=O4a;cM.bx_eie=h;cM.sx_emsk=dM;cM.bx_emao=k;cM.bx_dsp=h;cM.bx_vesp=h;cM.sx_clcp=I;cM.ix_clcip=-2;cM.sx_ltl="is:starred is:drafts";cM.sx_ltt=I;cM.sx_ltp=wB;cM.ix_ltps=9;cM.bx_sme=k;cM.bx_tm=h;cM.ix_gdc=0;cM.ix_lsas=104857600;cM.bx_too=h;cM.ix_scp=10;cM.bx_aec=1;cM.sx_dtsp=I;cM.sx_skcs=dM;cM.sx_sd=dM;cM.sx_sklctn=dM;cM.ix_lscd=0;cM.bx_iae=h;cM.ix_ieb=0;cM.ix_uwptl=5;cM.ix_usptl=2;cM.bx_ud=k;cM.bx_usf=h;cM.bx_ibcop=h;
+cM.bx_ibcac=h;cM.bx_ibcar=h;cM.sx_sds=I;cM.bx_ioof=h;var P4a="COMPOSE",Q4a="SEARCH",eM="BACK",fM="PREV",gM="NEXT",hM="STAR",R4a="REMOVE",iM="IGNORE",jM="SPAM",kM="TRASH",lM="OPEN",S4a="PREVMSG",T4a="NEXTMSG",mM="REPLY",nM="REPLY_NEW_WINDOW",oM="REPLYALL",pM="REPLYALL_NEW_WINDOW",qM="FORWARD",rM="FORWARD_NEW_WINDOW",U4a="QUICKCONTACTS",V4a="GO_INBOX",W4a="GO_STARRED",X4a="GO_SENT",Y4a="GO_DRAFTS",Z4a="GO_ALL",a5a="GO_CONTACTS",b5a="SELECT_ALL",c5a="SELECT_NONE",d5a="SELECT_READ",e5a="SELECT_UNREAD",f5a="SELECT_STARRED",g5a="SELECT_UNSTARRED",h5a="LAST_IM_MOLE",
+i5a="UPDATE_CONVERSATION",j5a="REMOVE_LABEL_AND_PREV",k5a="REMOVE_LABEL_AND_NEXT",sM="UNDO",tM="MORE_ACTIONS",l5a="MARK_AS_READ",m5a="MARK_AS_UNREAD",n5a="SHORTCUT_HELP",o5a="ARCHIVE",p5a="MOVE_TO",q5a="LABEL_AS",r5a={Zsd:P4a,qEb:Q4a,osd:eM,Cwd:fM,Lwd:gM,tpc:KG,Nyd:hM,Bxd:R4a,unc:iM,Oxd:jM,mwd:kM,OPEN:lM,fxd:S4a,Hwd:T4a,Fxd:mM,Lxd:nM,Gxd:oM,Hxd:pM,pud:qM,tud:rM,oxd:U4a,Bud:V4a,Dud:W4a,Cud:X4a,Aud:Y4a,yud:Z4a,zud:a5a,fyd:b5a,gyd:c5a,hyd:d5a,jyd:e5a,iyd:f5a,kyd:g5a,Ivd:h5a,Jzd:i5a,Dxd:j5a,Cxd:k5a,xqc:sM,
+ewd:tM,Svd:l5a,Tvd:m5a,ryd:n5a,gsd:o5a,lwd:p5a,Dvd:q5a},s5a,YG={};YG.COMPOSE="Compose";var uM="Search";YG.SEARCH=uM;var t5a="Back to threadlist";YG.BACK=t5a;YG.PREV="Newer conversation";YG.NEXT="Older conversation";YG.SELECT="Select conversation";YG.STAR="Star conversation";var u5a="Remove label";YG.REMOVE=u5a;YG.IGNORE="Ignore conversation";YG.SPAM="Report as spam";YG.TRASH="Move to trash";var v5a="Open conversation";YG.OPEN=v5a;YG.PREVMSG="Previous message";YG.NEXTMSG="Next message";var vM="Reply";
+YG.REPLY=vM;YG.REPLY_NEW_WINDOW="Reply in a new window";YG.REPLYALL="Reply all";YG.REPLYALL_NEW_WINDOW="Reply all in a new window";var w5a="Forward";YG.FORWARD=w5a;YG.FORWARD_NEW_WINDOW="Forward in a new window";YG.QUICKCONTACTS="Focus chat contact search";YG.GO_INBOX="Go to Inbox";YG.GO_STARRED="Go to Starred conversations";YG.GO_SENT="Go to Sent messages";YG.GO_DRAFTS="Go to Drafts";YG.GO_ALL="Go to All mail";YG.GO_CONTACTS="Go to Contacts";YG.SELECT_ALL="Select all conversations";
+YG.SELECT_NONE="Deselect all conversations";YG.SELECT_READ="Select read conversations";YG.SELECT_UNREAD="Select unread conversations";YG.SELECT_STARRED="Select starred conversations";YG.SELECT_UNSTARRED="Select unstarred conversations";YG.LAST_IM_MOLE="Focus last chat mole";YG.UPDATE_CONVERSATION="Update conversation";YG.REMOVE_LABEL_AND_PREV="Remove label and go to previous conversation";YG.REMOVE_LABEL_AND_NEXT="Remove label and go To next conversation";YG.UNDO="Undo last action";
+YG.MORE_ACTIONS="Open more actions menu";var wM="Mark as read";YG.MARK_AS_READ=wM;var x5a="Mark as unread";YG.MARK_AS_UNREAD=x5a;YG.SHORTCUT_HELP="Open shortcut help";var y5a="Archive";YG.ARCHIVE=y5a;YG.MOVE_TO="Open move to menu";YG.LABEL_AS="Open label as menu";var OF=new uh;
+OF.ri={c:P4a,"/":Q4a,u:eM,k:fM,j:gM,x:KG,s:hM,y:R4a,m:iM,"!":jM,"#":kM,o:lM,p:S4a,n:T4a,r:mM,R:nM,a:oM,A:pM,f:qM,F:rM,q:U4a,gi:V4a,gs:W4a,gt:X4a,gd:Y4a,ga:Z4a,gc:a5a,"*a":b5a,"*n":c5a,"*r":d5a,"*u":e5a,"*s":f5a,"*t":g5a,"\u001b":h5a,N:i5a,"]":j5a,"[":k5a,z:sM,".":tM,I:l5a,U:m5a,"?":n5a,e:o5a,v:p5a,l:q5a};OF.Gi=function $Fk(a,c,d){for(var f=a;f[u]>0;f=f[lb](0,-1))if(OF.ri[f])e(Error(".52`"+a+qw+f));OF.ri[a]=c;YG[c]=d;OF[r](Ky)};OF.J=function $Gk(){return OF.ri};_B_prog(46)}catch(e){_B_err(e)}
+
+try{H(aya,Jf);aya[w].L=function $Hk(){Kf(this.ud);Kf(this.eQ);Kf(this.s8a)};Ha(bya[w],function $Ik(){return this.O[t]()});bya[w].kc=D(ae);F=cya[w];F.zO=function $Kk(){return this.O[1]};va(F,function $Lk(){return this.O[2]});F.qta=function $Mk(){return this.O[8]};Ha(F,function $Nk(){return this.O[t]()});F.kc=D(ae);H(eya,Kx);H(hya,eya);var xM="ic",z5a="cru",A5a="fru",B5a="evw",C5a="oid";hya[w].b9c=function $Pk(a){a=new cya(a[dq]);this.mb.Qf();try{this.Fa(Rd,a.zO());this.Fa(Zx,a[pq]());this.Fa(Pd,a.O[3]);this.Fa(ML,a.O[4]);this.Fa(xM,a.O[5]);this.Fa(z5a,a.O[6]);this.Fa(LF,a.O[7]);this.Fa(dx,a.qta());this.Fa(A5a,a.O[9]);this.Fa(ge,a.O[11]);this.Fa(B5a,a.O[12]);this.Fa(C5a,a.O[13])}finally{this.mb.Mf()}};var yM="gn";hya[w].E1c=function $Qk(a){this.Fa(yM,(new bya(a[dq])).O[1])};hya[w].f_c=function $Rk(){this.Fa(gya,h)};var D5a="ix_cps",Iya={bxd:By,Lvd:D5a};H(hy,Hx);var E5a=new Hf;F=hy[w];var F5a="NOT LOADED";F.Dv=F5a;F.Lz=ly;F.YAa=0;F.Hkb=0;F.hC=function $Sk(){var a=hy.C.hC[z](this);a|=26;if(this.dQa)a|=1;return a};F.J=function $Tk(){Ix(this);return this.QN};F.Uc=function $Uk(){Ix(this);return this.bf?this.bf:E5a};F.qj=function $Vk(){Ix(this);return this.bf?this.bf.Nb():0};F.za=function $Wk(a){return iy(this,a)};F.cNa=function $Xk(){Ix(this);return this.Dv};F.zMa=function $Yk(){Ix(this);return this.Lz};F.Ds=function $Zk(){Ix(this);return!!this.Vwa};
+F.hc=function $_k(){Ix(this);return this.cNa()==ky};F.Es=function $0k(){Ix(this);return this.zMa()==ly};F.Fi=function $1k(){Ix(this);return this.cNa()==ky&&this.zMa()==ly};F.B=function $2k(){return this.mb.B()};F.L=function $3k(){hy.C.L[z](this);if(this.bf){for(var a=this.bf.Oa(),c=0;c<a[u];c++)a[c].D();this.bf[bc]()}a=this.ac();c=this.mb;xLa(c.g1,this);jya(this,i);a&&a[Nc](this);c&&c.M5b(this,a)};
+F.ha=function $4k(a){var c=a.vn();if(!this.bf)this.bf=new Hf;if(this.bf.Xb(c))e(Error(".53`"+this.Je()+qw+c));if(a.ac())e(Error(".54`"+a.Je()));a.Ig(this);this.bf.set(c,a)};lk(F,function $5k(a){var c=a.vn();if(!this.bf||!this.bf.Xb(c))e(Error(".55`"+this.Je()+qw+c));a.Ig(i);this.bf[Pb](c)});F.set=function $6k(a){Ix(this);this.Dv=ky;this.Lz=ly;this.Vwa=k;jya(this,a);ny(this)};F.DJb=function $7k(){Ix(this);this.Dv=F5a;this.Lz=ly;this.Vwa=k;jya(this,i);ny(this)};F.QK=function $8k(){this.Lz=yLa;this.mb.N5b(this)};
+F.bva=function $9k(a){ny(this,a.aJ)};F.Iz=function $$k(){if(this.dQa){var a=this.mb.g1;this.YAa==0&&xLa(a,this);this.YAa++;this.mb.Ypb(this)}};F.bB=function $al(){if(this.dQa)if(this.YAa!=0){this.YAa--;this.mb.Ypb(this);var a=this.mb.g1;if(this.YAa==0){this.Hkb=a.CLb;a.ela.set(this.Je(),this)}}};H(py,hy);py[w].PK=function $bl(){this.QK()};py[w].hC=function $cl(){var a=py.C.hC[z](this);if(this.qBc)a|=32;return a};H(qy,uh);va(qy[w],D(LL));qy[w].Ca=D(Ad);Ha(qy[w],function $fl(){return String(this.jf)});H(ry,hy);ry[w].nM=function $gl(a){this.mb.Qf();try{var c;if(a[u]==1||a[1][u]==0)c=[];c=Ve(a[1][0])?a[1]:qf(a,1);for(a=0;a<c[u];a++){var d=c[a][0],f=c[a][1],g=this.za(Qf(d));g||(g=new py(Qf(d),this));g.set(new qy(d,f))}my(this)}finally{this.mb.Mf()}};ry[w].za=function $hl(a,c){Ix(this);var d=iy(this,a);if(d||c)return d;return new py(a,this)};H(pya,xx);F=pya[w];F.CJa=B();F.CJa.Rn=h;F.KMa=B();F.KMa.Rn=h;F.Hwa=B();F.Hwa.ic=h;H(rya,hy);yx(pya,rya);F=rya[w];F.za=function $ll(a,c){Ix(this);var d=iy(this,a);if(d||c)return d;return(a=this.aa.CJa(a))?a:i};F.rg=function $ml(){Ix(this);if(this.Fi()){this.mb.Qf();try{this.QK();for(var a=this.Uc().Oa(),c=0;c<a[u];c++)a[c].PK()}finally{this.mb.Mf()}}};F.db=function $nl(a){Ix(this);if(this.aa.Hwa(a)){Ix(this);return this.RZb[a]}var c=sya(this,a).J();if(c==i){c=this.aa.KMa(a);if(c!=i){this.Yc(a,c);return c}else return i}return c.Ca()};
+F.Yc=function $ol(a,c){Ix(this);if(this.aa.Hwa(a)){Ix(this);this.RZb[a]=typeof c==ig?c?Hj:Ah:typeof c==Qe?String(c):c}else{var d=sya(this,a);a=a[Cc](Md);c=new qy(a.pop(),c);d.set(c)}};F.Oo=function $pl(a){return String(this.db(a))};F.nf=function $ql(a){return!!Number(this.db(a))};F.Ep=function $rl(a){return Number(this.db(a))};F.Yn=function $sl(a){return sya(this,a).Je()};H(sy,uh);var zM="Xa";sy[w].ea=D(zM);sy[w].Qe=D(ge);var AM="Me";sy[w].Dd=D(AM);sy[w].Vc=D("Rj");var uya=new cg;uya.Vl([5,6,7,8,9,11,13,14]);H(uy,hy);uy[w].nM=function $xl(a){for(var c=new Hf,d=1;d<a[u];d++)c.set(Qf(a[d][0]),a[d]);this.mb.Qf();try{var f=this.Uc(),g=f.Sb();for(d=0;d<g[u];d++){var j=g[d],n=f.J(j),s=c.J(j);if(s){var v=new sy(s);n.set(v);c[Pb](j)}else mya(n,h)}f=this;var C=c.Sb();for(d=0;d<C[u];d++){j=C[d];var M=c.J(j),Y=new py(Qf(j),f),ha=new sy(M);Y.set(ha)}this.dbb=[];for(d=1;d<a[u];d++)this.dbb[p](this.za(Qf(a[d][0])).J());my(this)}finally{this.mb.Mf()}};
+uy[w].za=function $yl(a,c){Ix(this);var d=iy(this,a);if(d||c)return d;return new py(a,this)};uy[w].DT=D("dbb");zx(wya,pya);var BM="filters";wya[w].CJa=function $Al(a){switch(a){case Hya:return new ry(Hya,this.sAa);case BM:return new uy(BM,this.sAa)}return i};wya[w].KMa=function $Bl(a){return(a=Mf(a,this.hVa)?a[lb](this.hVa[u]):i)?cM[a]:i};var CM="sx_cks_";wya[w].Hwa=function $Cl(a){return(Mf(a,this.hVa)?a[lb](this.hVa[u]):i)==CM};H(wy,Jf);var G5a={},DM="enabled";G5a[0]=DM;G5a[1]="customize";var H5a="popular";G5a[2]=H5a;wy[w].L=function $Dl(){wy.C.L[z](this);this.Mk.D()};wy[w].Xqb=function $El(){this.J9=h;Ff(this.Trb,function(a){a.ad(this.rl)},this);Ia(this.Trb,0)};
+var EM="bx_hs",I5a="bx_cm",J5a="bx_pd",K5a="ix_fv",L5a="bx_tkup",M5a="bx_tksp",N5a="bx_tkmn",O5a="sx_tkli",P5a="ix_tklv",FM="sx_dl",GM="sx_trl",HM="bx_tm",Q5a="sx_trh",R5a="sx_trlo",S5a="sx_rt",T5a="bx_en",U5a="bx_rf",IM="sx_em",JM="sx_at",KM="bx_ve",LM="sx_vs",MM="sx_vm",V5a="bx_vc",W5a="lx_vst",NM="lx_vend",OM="ix_ss",PM="sx_sg",QM="bx_se",X5a="sx_sa",Y5a="sx_sf",Z5a="bx_lis",a6a="bx_xs",RM="sx_xs",b6a="ix_ca",c6a="ix_dotr",SM="ix_ql",d6a="bx_aa",TM="bx_sn",UM="bx_pe",e6a="ix_pd",VM="bx_ie",f6a=
+"bx_yjsc",g6a="bx_yjotr",WM="sx_yjpls",h6a="sx_yjgps",i6a="bx_yjgpc",j6a="sx_pu",k6a="ix_pp",XM="bx_qlfo",l6a="sx_yjcaps",m6a="bx_yjcapc",n6a="sx_yjaps",o6a="bx_yjapc",p6a="bx_yjabs",q6a="ix_as",r6a="sx_eisp",YM="bx_eie",s6a="sx_emsk",ZM="bx_emao",t6a="sx_bkmk_",aN="sx_bkmk_c",bN="ix_udf",cN="ix_utf",u6a="sx_ussl",v6a="sx_mgp",w6a="sx_clcp",x6a="ix_clcip",y6a="sx_wsh",dN="bx_bau",z6a="bx_dsp",A6a="bx_vesp",B6a="bx_vctn",C6a="sx_ts",eN="sx_tl",fN="bx_te",D6a="bx_ta",E6a="sx_st",F6a="sx_oshs",gN="sx_skcs",
+G6a="sx_sd",hN="sx_sklctn",iN="bx_iae",jN="ix_ieb",kN="ix_ifm",H6a="sx_dtsp",I6a="sx_ltl",J6a="sx_ltt",lN="sx_ltp",mN="ix_ltps",nN="bx_sme",K6a="ix_scp",L6a="sx_ugp",oN="bx_asd",M6a="ix_gdc",pN="ix_lsas",N6a="sx_yjvps",O6a="bx_yjvpc",qN="bx_too",P6a="sx_finb",Q6a="bx_aec",R6a="lppn_ldt",rN="ix_lscd",S6a="ix_uwptl",T6a="ix_usptl",U6a="bx_upd",sN="bx_ud",V6a="bx_usf",W6a="bx_ibcop",X6a="bx_ibcac",Y6a="bx_ibcar",tN="sx_iods",Z6a="ix_iothe",a7a="bx_iopd",b7a="sx_iogps",c7a="sx_iogpp",d7a="bx_ioao",e7a=
+"bx_ioof",f7a="sx_iocs",g7a="bx_smsp",Cya=new Hf({wvd:EM,uyd:"bx_show0",tyd:"bx_show1",vyd:"bx_show2",yyd:"bx_show3",Mud:"bx_hidetp",Pud:I5a,Rwd:J5a,Uyd:"bx_sv",Ssd:K5a,Jwd:g1a,syd:bL,YDb:cL,Psd:"sx_ca",bzd:L5a,czd:M5a,azd:N5a,Yyd:O5a,Zyd:P5a,ztd:FM,vmc:qAa,jzd:GM,hzd:HM,izd:Q5a,kzd:R5a,Mxd:S5a,Vtd:T5a,Kxd:U5a,sud:IM,rud:JM,Szd:KM,Wzd:LM,Uzd:MM,Rzd:V5a,Vzd:W5a,Tzd:NM,qxd:OM,Gpc:PM,Ayd:QM,zyd:X5a,AEb:Y5a,Mvd:Z5a,Qzd:a6a,Xtd:RM,Jyd:"bx_sp",dwd:"ix_mm",cwd:"sx_si",awd:"ix_rc",bwd:"sx_rw",csd:"ix_at",
+Qsd:b6a,std:c6a,Ixd:"ix_yjrbc",nxd:SM,Cvd:oJ,vwd:nJ,jsd:d6a,Gyd:TM,Xwd:UM,Wwd:e6a,Rud:VM,kxd:"sx_pf",Rsd:"bx_disableyj",Kud:f6a,Jud:g6a,Xxd:WM,pvd:h6a,ovd:i6a,Koc:j6a,Swd:k6a,Jvd:"sx_tz",mxd:XM,isd:l6a,hsd:m6a,bsd:n6a,asd:o6a,Zrd:p6a,gAd:g6a,ptd:"sx_dbglp",Fvd:"ix_llsp",esd:q6a,Ttd:r6a,Std:YM,Qtd:s6a,Ptd:ZM,wwd:FVa,ktd:CM,Nsd:t6a,Msd:aN,Kzd:bN,Pzd:cN,Ozd:u6a,Rvd:v6a,itd:w6a,jtd:x6a,eAd:y6a,QCb:dN,bAd:"bx_yjvsc",ytd:z6a,Yzd:A6a,Isd:JH,Xzd:B6a,nzd:C6a,ozd:eN,lzd:fN,mzd:D6a,pzd:E6a,Mwd:F6a,Xsd:gN,Cyd:G6a,
+Byd:hN,Qud:iN,Sud:jN,Tud:kN,ttd:H6a,Yud:I6a,Zud:J6a,Xud:lN,Wud:mN,Lzd:nN,lyd:K6a,Bzd:L6a,ksd:oN,xud:M6a,Pvd:pN,aAd:N6a,Zzd:O6a,Xyd:qN,uud:P6a,dsd:Q6a,Ovd:R6a,Qvd:rN,Izd:S6a,Hzd:T6a,Fzd:U6a,Azd:sN,Gzd:V6a,Ezd:W6a,Dzd:X6a,Czd:Y6a,evd:tN,kvd:Z6a,jvd:a7a,fvd:b7a,gvd:c7a,cvd:d7a,hvd:e7a,dvd:f7a,ayd:Y_a,Eyd:g7a});F=wy[w];F.DT=function $Fl(){zy(this,this.rl);return this.rl.za(BM).DT()};F.GE=function $Gl(a){zy(this,this.rl);return(a=Eya(this,a,h))?a.J():i};F.Fi=function $Hl(){return this.rl.Fi()};F.rg=function $Il(){this.rl.rg()};
+F.db=function $Jl(a){return this.rl.db(Cy(this,a))};F.Yc=function $Kl(a,c){this.rl.Yc(Cy(this,a),c)};F.Oo=function $Ll(a){return this.rl.Oo(Cy(this,a))};F.nf=function $Ml(a){return this.rl.nf(Cy(this,a))};F.Ep=function $Nl(a){return this.rl.Ep(Cy(this,a))};F.Yn=function $Ol(a){return this.rl.Yn(Cy(this,a))};F.oza=function $Pl(a){if(!a.Pg||a.Pg.H()!=this)this.rk(a.Pg,a.QLb,a[dq])};
+F.rk=function $Ql(a,c,d){if(!this.Pc)switch(c){case oy:(a=this.rl.za(Hya))||(a=new ry(Hya,this.rl));a.nM(d);break;case vy:(a=this.rl.za(BM))||(a=new uy(BM,this.rl));a.nM(d);break;case xya:d=Ve(d[1])?d[1]:qf(d,1);for(a=0;a<d[u];a++){var f=Gya+G5a[a];(c=this.rl.za(f))||(c=new py(f,this.rl));c.set(new qy(f,!!Number(d[a])))}break;case yya:(a=this.rl.za(By))||(a=new ry(By,this.rl));a.nM(d);break;case wo:for(f in r5a){a=CM+r5a[f];this.Yc(a[od](),dM)}d=(new Sxa(d)).HHb;for(f=0;f<d[u];f++){c=d[f];a=CM+c.ea();
+this.Yc(a[od](),c.O[0])}break}};_B_prog(47)}catch(e){_B_err(e)}
+
+try{var uN=Dy(k),vN=Dy(h);var Hy={};Kya[w].Aqb=function $Rl(a){var c=a.Dg();this.Pd[c]||(this.Pd[c]=a)};Kya[w].f_=function $Sl(a){return this.Pd[a]};Hy.rfc=new Kya;Hy.Aqb=function $Tl(a){Hy.rfc.Aqb(a)};Hy.f_=function $Ul(a){return Hy.rfc.f_(a)};var _GM_getMailSearch=Hy;F=Gy[w];F.Ga=D(Gd);F.Qc=function $Wl(a){return!!(a&&this.Dg()==a.Dg())};F.Dg=D("Js");F.Xs=function $Yl(){e(Error(".56`"+this.Xd))};F.Rc=function $Zl(a){return this.Fn.J(a)};F.ZZ=D(N_a);F.nd=E(k);Ha(F,function $1l(){return this.Dg()});F.lba=uN;H(Rya,Gy);F=Rya[w];F.Qe=D(ge);var h7a="search/";F.Xs=function $3l(){return h7a+Lya(this.ae)};F.nd=function $4l(){return!this.ae};F.FL=E(h);F.Qb=E(rC);var i7a="Search results";va(F,E(i7a));H(Sya,Gy);var j7a="as_from",k7a="as_to",l7a="as_subj",m7a="as_has",n7a="as_hasnot",o7a="as_attach",p7a="as_within",q7a="as_date",cza={WM:j7a,RR:k7a,QR:l7a,Ryd:Tya,mnc:m7a,nnc:n7a,clc:o7a,fAd:p7a,p1a:q7a,xyd:Zya},d1a=new Hf({from:j7a,to:k7a,subject:l7a,subset:Tya,has:m7a,hasnot:n7a,attach:o7a,within:p7a,date:q7a}),bza=new Hf(cza);F=Sya[w];var r7a="advanced-search/";F.Xs=function $8l(){return r7a+Nya(this.ZZ(),d1a)};
+F.nd=function $9l(){var a=this.ZZ();return!(a.J(j7a)||a.J(k7a)||a.J(l7a)||a.J(Tya)!=cz||a.J(m7a)||a.J(n7a)||a.J(o7a)||a.J(q7a))};F.FL=E(h);F.Qb=E(rC);va(F,E(i7a));F.uy=function $cm(){return this.Rc(j7a)||I};F.kC=function $dm(){return this.Rc(k7a)||I};F.mi=function $em(){return this.Rc(l7a)||I};F.Bta=function $fm(){return this.Rc(m7a)||I};F.Dta=function $gm(){return this.Rc(n7a)||I};F.Cta=function $hm(){return!!this.Rc(o7a)};jp(F,function $im(){return this.Rc(q7a)||I});H(Vya,Gy);F=Vya[w];var s7a="nn";F.Pt=D(s7a);var t7a="%2E",u7a="label/";F.Xs=function $km(){var a=Lya(this.nn);if(a==He)a=t7a;return u7a+a};F.FL=E(h);F.Qb=E(rC);va(F,function $nm(){return Vf+this.Pt()+Vf});F.Dd=function $om(){return this.Pt()};F.Iga=function $pm(){return this.Pt()};F.pv=E(1);F.lba=function $rm(a){return a.Xb(this.Dd())};H(Yya,Gy);var v7a="CN";Yya[w].tga=D(v7a);Yya[w].FL=E(k);var wN="Contacts";va(Yya[w],E(wN));H(Qy,Gy);var xN="cf1_from",yN="cf1_to",zN="cf1_subj",AN="cf1_has",BN="cf1_hasnot",CN="cf1_attach",eza={WM:xN,RR:yN,QR:zN,mnc:AN,nnc:BN,clc:CN},e1a=new Hf({from:xN,to:yN,subject:zN,has:AN,hasnot:BN,attach:CN}),dza=new Hf(eza);F=Qy[w];var w7a="create-filter/";F.Xs=function $vm(){return w7a+Nya(this.ZZ(),e1a)};F.FL=E(k);F.Qb=E(kC);va(F,E(i7a));F.uy=function $zm(){return this.Rc(xN)||I};F.kC=function $Am(){return this.Rc(yN)||I};F.mi=function $Bm(){return this.Rc(zN)||I};
+F.Bta=function $Cm(){return this.Rc(AN)||I};F.Dta=function $Dm(){return this.Rc(BN)||I};F.Cta=function $Em(){return!!this.Rc(CN)};var Sy=new function(){this.Ezb={};this.QCa={}},BSa=new cg([sz,pz,Jy,az,iz,Oy,ul]);H(bz,Gy);F=bz[w];F.Xs=function $Fm(){return this.Ga()};F.FL=E(h);F.Qb=E(ey);F.lba=function $Im(a){return a.Xb(this.Dd())};F.Iga=function $Jm(){return this[pq]()};H(dz,bz);var x7a="All Mail";va(dz[w],E(x7a));var DN="^all";dz[w].Dd=E(DN);dz[w].pv=E(0);Ne(dz);Ry(DN,dz.S());Wy(dz.S());H(iza,Gy);va(iza[w],E(I));Ne(iza);Wy(iza.S());H(gz,bz);var y7a="Chats";va(gz[w],E(y7a));var EN="^b";gz[w].Dd=E(EN);gz[w].pv=E(0);Ne(gz);Ry(EN,gz.S());Wy(gz.S());H(hz,bz);var z7a="Delivered";va(hz[w],E(z7a));var A7a="^d";hz[w].Dd=E(A7a);hz[w].pv=E(0);Ne(hz);Ry(A7a,hz.S());Wy(hz.S());H(jz,bz);var B7a="Drafts";va(jz[w],E(B7a));jz[w].Dd=E(CL);jz[w].pv=E(2);Ne(jz);Ry(CL,jz.S());Wy(jz.S());H(lz,bz);var FN="Inbox";va(lz[w],E(FN));lz[w].Dd=E(TI);lz[w].pv=E(1);Ne(lz);Ry(TI,lz.S());Wy(lz.S());H(mz,bz);var C7a="Muted";va(mz[w],E(C7a));var GN="^g";mz[w].Dd=E(GN);mz[w].pv=E(0);Ne(mz);Ry(GN,mz.S());Wy(mz.S());H(oz,bz);var D7a="Outbox";va(oz[w],E(D7a));var HN="^ob";oz[w].Dd=E(HN);oz[w].pv=E(2);Ne(oz);Ry(HN,oz.S());Wy(oz.S());H(qz,bz);var E7a="Sent Mail";va(qz[w],E(E7a));var IN="^f";qz[w].Dd=E(IN);qz[w].pv=E(0);Ne(qz);Ry(IN,qz.S());Wy(qz.S());H(rz,bz);var JN="Spam";va(rz[w],E(JN));rz[w].Dd=E(AL);rz[w].pv=E(1);rz[w].Qb=E(IF);Ne(rz);Ry(AL,rz.S());Wy(rz.S());H(tz,bz);var KN="Starred";va(tz[w],E(KN));tz[w].Dd=E(oI);tz[w].pv=E(0);Ne(tz);Ry(oI,tz.S());Wy(tz.S());H(uz,bz);var LN="Trash";va(uz[w],E(LN));uz[w].Dd=E(BL);uz[w].pv=E(0);uz[w].Qb=E(IF);Ne(uz);Ry(BL,uz.S());Wy(uz.S());var F7a=dz.S();iza.S();gz.S();hz.S();var R3a=jz.S(),G7a=lz.S();mz.S();var H7a=oz.S(),Q3a=qz.S();rz.S();var I7a=tz.S(),J7a=uz.S();_B_prog(48)}catch(e){_B_err(e)}
+
+try{lza[w].Eb=function $in(a){return!!this.trc[a]};mza[w].Dq=D("yZ");Ha(nza[w],function $kn(){return this.O[t]()});nza[w].kc=D(ae);oza[w].Cp=function $mn(){return this.O[2]};Ha(oza[w],function $nn(){return this.O[t]()});oza[w].kc=D(ae);jp(pza[w],function $pn(){return this.O[1]});Ha(pza[w],function $qn(){return this.O[t]()});pza[w].kc=D(ae);Ha(qza[w],function $sn(){return this.O[t]()});qza[w].kc=D(ae);Ha(rza[w],function $un(){return this.O[t]()});rza[w].kc=D(ae);H(wza,Kx);F=wza[w];var MN="np";F.B3c=function $wn(a){a=a[dq];for(var c=1;c<a[u];++c){var d=a[c];if(Ve(d))switch(d[0]){case 0:this.Fa(ex,d[1]);break;case 1:this.Fa(MN,d[1]);break;default:}}};F.d9c=function $xn(a){this.Fa(ii,(new rza(a[dq])).O[1])};F.v1c=function $yn(a){this.Fa(IB,(new nza(a[dq])).O[1])};F.Q6c=function $zn(a){a=new qza(a[dq]);this.Fa(ki,Zf()/1E3-a.O[1])};F.g5c=function $An(a){this.Fa(Pd,(new pza(a[dq]))[iq]())};F.s2c=function $Bn(a){this.Fa(wo,a[dq][1])};
+F.B4c=function $Cn(a){this.Fa(vza,new oza(a[dq]))};F.E2c=function $Dn(a){this.Fa(xz,a[dq][1])};Ha(yza[w],function $En(){return this.O[t]()});yza[w].kc=D(ae);F=zza[w];va(F,function $Gn(){return this.O[0]});F.Sj=function $Hn(){return this.O[1]};F.wga=function $In(){return this.O[2]};F.PT=function $Jn(){return this.O[3]};Ha(F,function $Kn(){return this.O[t]()});F.kc=D(ae);H(Cza,Kx);Cza[w].H_c=function $Mn(a){a=new yza(a[dq]);this.mb.Qf();try{this.Fa(Bz,Dza(this,a.Ajc));this.Fa(Cz,Dza(this,a.zic))}finally{this.mb.Mf()}};H(Fza,Kx);var NN="dc";Fza[w].y0c=function $Nn(a){a=new wxa(a[dq]);this.mb.Qf();try{this.Fa(zz,a);this.Fa(NN,h)}finally{this.mb.Mf()}};H(Hza,Kx);Hza[w].y1c=function $On(a){this.mb.Qf();try{this.Fa(Bz,vx(a[dq][1]));this.Fa(Cz,vx(a[dq][2]));a[dq][u]>3&&this.Fa(Kd,vx(a[dq][3]));a[dq][u]>4&&this.Fa(Rd,Boolean(a[dq][4]))}finally{this.mb.Mf()}};var K7a=new Hf({"197":772,"743":744,"745":746,"764":765,"766":767,"804":805,"806":807,"947":948,"983":984,"991":992,"1041":1042,"1170":1171,"714":715,"455":733,"942":943,"496":497,"427":480,"431":491,"428":481,"424":477,"453":492,"434":483,"425":478,"435":484,"747":748,"437":486,"436":485,"429":482,"534":535,"387":476,"438":487,"439":488,"539":540,"553":554,"551":555,"548":549,"574":575,"590":591,"586":587,"577":578,"580":581,"582":583,"599":600,"619":620,"874":875,"621":622,"631":632,"654":655,"645":646,
+"513":556,"678":679,"693":694,"648":695,"1136":1137,"719":720,"721":722,"724":725,"734":735,"739":740,"628":751,"784":785,"799":800,"790":791,"794":795,"1093":1094,"801":802,"1002":1003,"692":825,"771":831,"815":816,"898":899,"248":904,"1031":1032,"872":935,"812":813,"945":946,"1011":1012,"1027":1028,"1063":1064,"981":1081,"1090":1091,"1168":1169,"1096":1097,"1117":1118,"1005":1120,"1132":1133,"1134":1135,"1138":1139,"1157":1158,"1152":1153,"593":594,"595":596,"700":701,"1045":1046,"1154":1155,"633":634});Iza[w].Xj=function $Pn(a){var c=a[2];this.id=a[0];this.og=a[1];this.ZYb=c[1];this.fka=c[3];this.wPc=!!c[6];this.fLc=!!c[8];this.Yib=!!c[7];this.Knb=c[5]-this.fka;this.JI=c[0];this.CZb=c[2];this.Cec=this.JI!=0&&this.JI!=1&&this.JI!=11};H(Lza,Kx);var L7a="ri",ON="ma";Lza[w].e5c=function $Qn(a){a=a[dq];this.mb.Qf();try{this.Fa(L7a,a[1]*1E3);this.Fa(ON,a[2]);for(var c=3,d=[];a[c];){d[p](new Iza(a[c]));c++}this.Fa(Kd,d)}finally{this.mb.Mf()}};Ha(Mza[w],function $Rn(){return this.O[t]()});Mza[w].kc=D(ae);H(Oza,Kx);var M7a="psu",N7a="msu",O7a="tou",PN="gm",P7a="bppu";Oza[w].r5c=function $Tn(a){a=new Mza(a[dq]);this.mb.Qf();try{this.Fa(Zx,a.O[1]);this.Fa(RE,a.O[2]);this.Fa(ii,a.O[3]);this.Fa(Yx,a.O[4]);this.Fa(Hz,a.O[5]);this.Fa(Kd,a.O[6]);this.Fa(dx,a.O[7]);this.Fa(Rd,a.O[8]);this.Fa(Pd,a.O[9]);this.Fa(oy,a.O[10]);this.Fa(M7a,a.O[11]);this.Fa(N7a,a.O[12]);this.Fa(O7a,a.O[13]);this.Fa(PN,a.O[14]);this.Fa(GF,a.O[15]);this.Fa(P7a,a.O[16])}finally{this.mb.Mf()}};Pza[w].Aq=function $Un(){return this.O[4]};Ha(Pza[w],function $Vn(){return this.O[t]()});Pza[w].kc=D(ae);H(Sza,Kx);var QN="up",RN="ug",Q7a="tg",R7a="nq",S7a="aq",T7a="um";Sza[w].e9c=function $Xn(a){a=new Pza(a[dq]);this.mb.Qf();try{this.Fa(QN,a.O[3]);this.Fa(IB,a.O[2]);this.Fa(dx,a.Aq());this.Fa(RN,a.O[8]);this.Fa(Q7a,a.O[9]);this.Fa(QE,a.O[7]);this.Fa(R7a,a.O[5]);this.Fa(S7a,a.O[6]);this.Fa(T7a,a.O[1])}finally{this.mb.Mf()}};Ha(Tza[w],function $Yn(){return this.O[t]()});Tza[w].kc=D(ae);F=Ez[w];F.J=function $_n(a,c){if(a=this.yd.J(a)){if(this.Pd){a[Pb]();Wza(this,a)}return a[q]}return c};F.set=function $0n(a,c){var d=this.yd.J(a);if(d){pa(d,c);if(this.Pd){d[Pb]();Wza(this,d)}}else{d=new Uza(a,c);this.yd.set(a,d);Wza(this,d)}};F.hQ=function $1n(){return this.ni[Rk][q]};F.shift=function $2n(){return Xza(this,this.ni[Rk])};F.pop=function $3n(){return Xza(this,this.ni.SC)};wa(F,function $4n(a){var c=this.yd.J(a);if(c){c[Pb]();this.yd[Pb](a);return h}return k});F.Nb=function $5n(){return this.yd.Nb()};
+F.nd=function $6n(){return this.yd.nd()};F.Sb=function $7n(){return this.map(function(a,c){return c})};F.Oa=function $8n(){return this.map(Ee())};Sa(F,function $9n(a){return this[Aaa](function(c){return c==a})});F.Xb=function $$n(a){return this.yd.Xb(a)};Aa(F,function $ao(){this.yd[bc]();Ma(this.ni,this.ni.SC=this.ni)});F.forEach=function $bo(a,c){for(var d=this.ni[Rk];d!=this.ni;d=d[Rk])a[z](c,d[q],d.key,this)};
+F.map=function $co(a,c){for(var d=[],f=this.ni[Rk];f!=this.ni;f=f[Rk])d[p](a[z](c,f[q],f.key,this));return d};F.some=function $do(a,c){for(var d=this.ni[Rk];d!=this.ni;d=d[Rk])if(a[z](c,d[q],d.key,this))return h;return k};F.every=function $eo(a,c){for(var d=this.ni[Rk];d!=this.ni;d=d[Rk])if(!a[z](c,d[q],d.key,this))return k;return h};wa(Uza[w],function $fo(){Ma(this.SC,this[Rk]);this[Rk].SC=this.SC;this.SC=Ma(this,i)});H(Zza,Kx);Zza[w].C8c=function $go(a){this.mb.Qf();try{var c=new Tza(a[dq]),d=new cg(c.O[1]),f=new cg(c.O[2]);this.Fa(ki,d);this.Fa(IB,f);var g=new Ez,j=c.O[3];for(a=0;a<j[u];a+=2)g.set(j[a+1],j[a]);this.Fa(Pd,g)}finally{this.mb.Mf()}};Ha(aAa[w],function $ho(){return this.O[t]()});aAa[w].kc=D(ae);H(dAa,Kx);dAa[w].P8c=function $jo(a){a=a[dq];this.mb.Qf();try{this.Fa(rd,a[1]);var c=a[2];for(a=0;a<c[u];a++){var d=c[a];this.Fa(d[0],d[1])}}finally{this.mb.Mf()}};var U7a="usus";dAa[w].arb=function $ko(a){(new aAa(a[dq])).O[3]!=this.Ca(rd)&&oIa(this.Hn,U7a,Hj)};H(Gz,xx);Gz[w].mib=B();Gz[w].mib.Ka=h;Gz[w].bH=B();Gz[w].bH.Rn=h;H(Iz,uh);yx(Gz,Iz);
+var V7a="us:n",W7a="us:m",X7a="us:u",Y7a="us:h",Z7a="us:at",SN="ui:d",a8a="ui:c",b8a="ui:cru",c8a="ui:ga",d8a="ui:sk",e8a="ui:ae",f8a="pi:n",g8a="pi:i",h8a="pi:l",i8a="pi:a",TN="pi:e",j8a="pi:p",k8a="pi:tou",l8a="pi:gm",m8a="pi:sa",n8a="qu:um",o8a="qu:up",p8a="qu:t",q8a="qu:ug",r8a="qu:tg",s8a="qu:c",t8a="qu:ps",u8a="qu:nq",v8a="qu:aq",w8a="pi:psu",x8a="pi:msu",y8a="pi:bppu",z8a="adc:hg",A8a="adc:al",B8a="adc:af",C8a="adc:pd",D8a="adc:id",E8a="adc:chh",F8a="adc:chu",G8a="adc:chih",H8a="adc:sbu",I8a=
+"adc:sl",J8a="adc:hb",K8a="adc:sm",L8a="adc:fe",M8a="adc:wd",N8a="adc:lu",O8a="adc:rh",P8a="adc:cad",Q8a="adc:aid",R8a="adc:ihru",S8a="em:dc",T8a="ama:ri",UN="ama:a",U8a="tl:d",V8a="tl:s",W8a="tl:t",X8a="ai:rp",Y8a="ai:np",VN="ai:i",Z8a="ai:t",WN="ui:udc",a9a="ai:d",b9a="ai:s",c9a="ai:og",d9a="ai:ll",XN="ui:oid",e9a=["us:ver","us:l",V7a,W7a,X7a,e0a,Y7a,Z7a,Lz,kAa,SN,a8a,Mz,Nz,b8a,tD,c8a,d8a,e8a,pAa,f8a,"pi:r",g8a,"pi:h",h8a,i8a,"pi:c",TN,"pi:d",j8a,k8a,l8a,m8a,n8a,o8a,p8a,q8a,r8a,s8a,t8a,u8a,v8a,
+w8a,x8a,y8a,z8a,mAa,"adc:ia",A8a,"adc:cs",B8a,C8a,D8a,"adc:it",E8a,"adc:cfh",F8a,G8a,"adc:cfu",H8a,"adc:cw","adc:ce","adc:ow",I8a,J8a,"adc:hv","adc:hh","adc:tl","adc:vl","adc:pl",K8a,L8a,lAa,"adc:bl",M8a,N8a,"adc:ip",O8a,P8a,"adc:asd",Q8a,R8a,jAa,"em:ds",S8a,Kz,Oz,T8a,"ama:ma",UN,U8a,V8a,W8a,X8a,Y8a,VN,Z8a,WN,Pz,a9a,b9a,c9a,d9a,nAa,XN],YN={};YN["$root/user"]=Oj;YN["$root/domainInfo"]=rxa;YN["$root/quota"]=Rza;YN["$root/emoji"]=zz;YN["$root/productInfo"]=Dz;YN["$root/updatableStrings"]=cAa;
+YN["$root/customFrom"]=Bza;var f9a="$root/mailFetch";YN[f9a]=Kza;YN["$root/translatableLanguages"]=DE;var ZN="ai";YN["$root/appInfo"]=ZN;var aO={};aO.ui=0;aO.adc=1;aO.qu=2;aO.em=3;aO.pi=4;aO.us=5;aO.cfs=6;aO.ama=7;aO.tl=8;aO.ai=9;var g9a={},bO={};bO.ui={};bO.adc={};bO.qu={};bO.em={};bO.pi={};bO.us={};bO.cfs={};bO.ama={};bO.tl={};bO.ai={};
+for(var h9a=0;h9a<e9a[u];h9a++){var i9a=e9a[h9a],j9a=i9a[Cc](xj);if(j9a[u]==2){var k9a=j9a[0],l9a=j9a[1],m9a=aO[k9a];if(Ke(m9a)){g9a[i9a]=[m9a,l9a];bO[k9a][l9a]=i9a}}}F=Iz[w];F.v5c=function $no(a){for(var c=0;c<a.dG[u];c++){var d=a.dG[c][Cc](xj);if(d[u]==2){var f=d[1],g=YN[d[0]];if(g){d=bO[g][f];f=this.FAa[aO[g]].Ca(f);this[r](new fAa(d,f))}}}};F.B=D(JF);ip(F,function $po(a){var c=g9a[a];return c?this.FAa[c[0]].Ca(c[1]):this.Na[a]});F.Cq=function $qo(a){return eAa+a};F.hasFeature=function $ro(a){return this.qyc.Eb(a)};
+F.TSa=function $so(){for(var a=0,c=K7a.Sb(),d=0;d<c[u];d++)Jz(this,Number(c[d]))&&a++;return a};H(fAa,N);Iz[w].Sj=function $to(){return Hi};Iz[w].DK=function $uo(a){return rx(a,Hi)==0||gAa(this,a)};Iz[w].Gf=function $vo(){var a=yy(this.V);a=Pf(a.Oo(qAa));return im(a)||a==cM.sx_dn?this[hq](pAa):a};Iz[w].bH=function $wo(){var a=this.aa.bH();if(a!=undefined)return a;return G7a};_B_prog(49)}catch(e){_B_err(e)}
+
+try{var cO="bn",dO="eu",eO="gu",fO="hi",gO="is",hO="kn",iO="mr",jO="te",kO="ur",zAa=[cO,dO,eO,fO,gO,hO,aJ,iO,lE,VG,eJ,jO,DE,kO];H(Zz,uh);F=Zz[w];F.MVb=h;F.Wd=D("KUc");F.vH=D("wpd");F.QE=D("drd");F.Ga=D(Gd);F.qk=B();var n9a=L;var BAa;H(aA,Bh);aA[w].e9a=function $Co(){aA.C.e9a[z](this)};H(fA,uh);fA[w].L=function $Do(){fA.C.L[z](this);nh(this.Lac,sj,this.a7,k,this);this.Lac=i;if(!Fh||vg(Im))Sg(this.ZQ);delete this.ZQ};fA[w].a7=function $Eo(){var a=this.ZQ[xk];if(this.LZb!=a){this.LZb=a;this[r](UAa)}};H(gA,Jf);F=gA[w];F.kma=Ge("RA");F.J=function $Go(a){var c=jA(this,a);if(!c&&!this.nBd)e(new GAa(a));return c};F.D3c=function $Ho(a,c){var d=jA(this,a);if(!d)e(new QAa(a,c,"Module loaded but service or factory not registered with app contexts."));return d};F.jGc=function $Io(a,c,d){return d instanceof wi?d:new MAa(a,c,d)};Yla(F,function $Jo(a,c,d){if(this.Ys[a])e(Error(".57`"+a));this.Ys[a]=[c,!d];delete this.Pia[a]});
+F.L=function $Ko(){for(var a in this.Ys){var c=this.Ys[a];c[1]&&typeof c[0].D!="undefined"&&c[0].D()}this.Ys=i;this.mjd&&this.Fh.D();this.Fh=i;Kf(this.aI);this.aI=i};var lO="Fh";F.Ya=D(lO);H(GAa,Rh);H(MAa,Rh);H(QAa,Rh);H(nA,Lf);F=nA[w];F.jhb=nka;laa(F,function $Mo(){return this.jhb.jH()});F.Iw=function $No(){var a=nA.C.Iw[z](this);this.YOa[a]=h;return a};F.ez=function $Oo(a){if(!this.YOa[a])e(Error(".61"));nA.C.ez[z](this,a);delete this.YOa[a]};F.ZS=B();F.D=function $Qo(){nA.C.D[z](this);this.YOa=i};var o9a=new nA(1E3,2800);H(pA,uh);F=pA[w];cma(F,D("Kf"));F.ea=function $So(){if(!this.Xa)this.Xa=o9a.Iw();return this.Xa};F.W=D(fo);F.X=function $Uo(a){if(this.Pc)e(Error(".62"));if(!this.MK){this.MK=p9a.Iw();this.Qsa=p9a.Iw()}a=String(a);var c=this.Qsa.J(a);if(!c){c=o9a.Iw();this.Qsa.set(a,c);this.MK.set(c,a)}return c};F.td=function $Vo(a){return this.MK?this.MK.J(a):i};F.ve=function $Wo(a){return this.MK?this.ya.b(this.X(a)):i};F.Ga=function $Xo(){return fg(this[Sk])};Ha(F,function $Yo(){return this.Ga()});F.zcb=E(I);
+F.ac=D(oka);F.rv=function $0o(){return this.ac()};F.dk=function $1o(){e(Error(".63"))};F.qj=function $2o(){return this.bf?this.bf[u]:0};F.rb=function $3o(a){return this.bf?this.bf[a]:i};F.Uc=function $4o(){return this.bf?this.bf:[]};F.JQb=function $5o(a){if(!a||this.Xa==a)return this;for(var c=this.qj(),d=0;d<c;d++){var f=this.rb(d).JQb(a);if(f)return f}return i};F.b=function $6o(a){rA(this);return a?this.ve(String(a)):this.wa};F.Cc=D("pia");F.Vh=function $8o(){this.wa=this.ya[Qb](T)};
+F.Ig=function $9o(a){if(this.mh)e(Error(".64"));this.mh=a};F.Xk=function $$o(a){RAa(this,a,this.qj())};F.DJb=function $ap(){for(;tA(this,0););};F.ma=function $bp(){this.pia=h;if(this.JP)for(var a=this.JP,c=a[u],d=0;d<c;d++)a[d].ma()};F.Ba=function $cp(){this.pia=k;if(this.JP)for(var a=this.JP,c=a[u],d=0;d<c;d++)a[d].Ba()};
+F.L=function $dp(){if(this.pia){this.Ba();Sg(this.wa)}this.wa=i;for(var a=nf(this.Uc()),c=0;c<a[u];c++)a[c].D();this.Xa&&o9a.ez(this.Xa);if(this.MK){a=this.MK.Sb();for(c=0;c<a[u];c++){var d=a[c],f=this.MK.J(d);this.MK[Pb](d);this.Qsa[Pb](f);o9a.ez(d)}p9a.ez(this.MK);p9a.ez(this.Qsa);this.Qsa=this.MK=i}this.Sab.D();this.Sab=i;pA.C.L[z](this)};F.H=D("Sab");H(SAa,Lf);laa(SAa[w],function $fp(){return new Hf});var p9a=new SAa;H(uA,pA);uA[w].LR=h;uA[w].MR=h;uA[w].xv=function $gp(a){if(!a)return this.LR||this.MR;switch(a){case vA:return this.LR;case Wx:return this.MR;default:e(Error(".65"))}};uA[w].Ui=function $hp(a){if(!a&&this.LR&&this.MR||a==vA&&this.LR||a==Wx&&this.MR)return k;if(a)switch(a){case vA:this.LR=h;break;case Wx:this.MR=h;break;default:e(Error(".66"))}else this.LR=this.MR=h;return h};H(xA,uA);F=xA[w];F.Sia=0;F.B_a=I;F.Cbb=i;F.za=function $ip(){return this.rb(0)};F.so=function $jp(a){if(!this.za()){yA++;try{this.W()[o](this.b(),a.b());a.RQ(this);this.Xk(a);this.Ui()}finally{zA()}}};lk(F,function $kp(){var a=this.za(),c=tA(this,0);if(c){a.RQ(i);this.W()[ad](a.b());this.Ui()}return c});F.L=function $lp(){VAa[Pb](this.ea());nh(this.FZ,UAa,this.XNa,k,this);if(VAa.nd()&&DA){DA.D();DA=i}nh(this.aR,wA,this.M5a,k,this);this.aR.D();this.aR=i;xA.C.L[z](this)};
+F.M5a=function $mp(){this.bIa=i;this.Ui()};F.Ui=function $np(a){if(this.Sia==3&&(a==2||!a))e(Error(".68"));a=xA.C.Ui[z](this,a);WAa(this);return a};var q9a="lp_start",mO="lp_end";F.Yj=function $op(){if(!jfa.J()){this.Sia=1;this[r](q9a);if(!this.bIa)this.bIa=this.aR.Ke(this);this.za();lfa.J()&&nBa(this.za());this.Sia=2;this.xv(vA)&&XAa(this,vA,this.bIa[ib]);TAa(this,vA);this.Sia=3;this.xv(Wx)&&XAa(this,Wx,this.bIa[id]);TAa(this,Wx);this.Sia=0;this[r](mO)}};var r9a=":0";
+F.XNa=function $pp(){if(!this.Cbb)this.Cbb=bA(r9a,this.MIc,50,this)};F.MIc=function $qp(){yA++;for(var a=this.Bbb,c=0;c<a[u];c++)a[c]();this.M5a();zA();this.Cbb=i};var DA=i,yA=0,VAa=new Hf;H(aBa,uh);aBa[w].Ke=function $rp(){return new yg(0,0)};H(EA,aBa);F=EA[w];var s9a=":1";F.x8b=function $sp(){var a=new yg(this.Sra[vc],this.Sra[Wc]);if(!this.xCb||a[ib]!=this.xCb[ib]||a[id]!=this.xCb[id]){this.hgb();this.xCb=a}this.v8b=bA(s9a,this.x8b,500,this)};F.We=i;F.hOa=i;
+F.vjb=function $tp(){return Jg&&Ri||Ng&&this.dg[yma]!=this.dg.top};F.Ke=function $up(){if(!this.We)this.We=new yg(this.Sra[vc],this.Sra[Wc]);return this.We};F.a7=function $vp(){if(L){this.hOa&&cA(this.hOa);this.hOa=bA(r9a,this.hgb,500,this)}else this.hgb()};F.hgb=function $wp(){this.We=this.hOa=i;this[r](wA)};F.L=function $xp(){this.Mub.D();this.Sra=this.dg=i;this.v8b&&cA(this.v8b);EA.C.L[z](this)};_B_prog(50)}catch(e){_B_err(e)}
+
+try{bBa[w].mM=Ge(eo);
+var t9a="paddingTop",u9a="paddingBottom",v9a="marginLeft",w9a="marginRight",x9a="marginTop",y9a="marginBottom",pBa=[ria,sia,tia,Cva,"borderLeftStyle","borderRightStyle","borderTopStyle","borderBottomStyle",RGa,SGa,t9a,u9a,v9a,w9a,x9a,y9a],oBa={borderLeftWidth:HA,borderRightWidth:HA,borderTopWidth:HA,borderBottomWidth:HA,borderLeftStyle:xd,borderRightStyle:xd,borderTopStyle:xd,borderBottomStyle:xd,paddingLeft:HA,paddingRight:HA,paddingTop:HA,paddingBottom:HA,marginLeft:HA,marginRight:HA,marginTop:HA,
+marginBottom:HA};H(IA,uA);var qBa=!(L&&!vg(aj)),OA=new bBa;F=IA[w];F.v8=0;F.GC=0;F.o8=Infinity;F.TU=Infinity;F.tCb=1;F.Hgb=-1;F.L4=h;F.Kg=0;F.Hf=0;F.ZHa=h;F.W4a=-1;F.O3=-1;F.Epa=0;F.Fpa=0;F.U4a=0;F.V4a=0;F.KT=function $zp(a){switch(a){case vA:return this.v8;case Wx:return this.GC;default:e(Error(".69"))}};F.hGc=function $Ap(){return this.KT(vA)};F.gGc=function $Bp(){return this.KT(Wx)};F.WZ=function $Cp(a){switch(a){case vA:return this.o8;case Wx:return this.TU;default:e(Error(".70"))}};F.edb=function $Dp(){return this.WZ(Wx)};
+F.Sda=function $Ep(a,c){switch(a){case vA:return l.min(l.max(c,this.v8),this.o8);case Wx:return l.min(l.max(c,this.GC),this.TU);default:e(Error(".71"))}};F.rK=function $Fp(a){switch(a){case vA:return this.tCb;case Wx:return this.Hgb;default:e(Error(".72"))}};F.Twa=function $Gp(a){return this.rK(a)==-1};var z9a="L4";F.Fj=D(z9a);F.ps=D("ZHa");F.Ke=function $Jp(a){switch(a){case vA:return this.ps()?this.Kg:0;case Wx:return this.ps()?this.Hf:0;default:e(Error(".73"))}};F.Yh=function $Kp(){return this.Ke(vA)};
+F.Fl=function $Lp(){return this.Ke(Wx)};F.L=function $Mp(){IA.C.L[z](this);var a=this.ea(),c=BA;delete c.x[a];delete c.y[a]};var A9a="nH";F.Vh=function $Np(){IA.C.Vh[z](this);K(this.wa,A9a)};F.RQ=Ge("Yj");F.ARb=D("Yj");F.jCa=function $Qp(a){this.AI(a,undefined,undefined,undefined)};F.Hx=function $Rp(a){this.AI(undefined,a,undefined,undefined)};F.idc=function $Sp(a,c){switch(a){case vA:this.AI(c,undefined,undefined,undefined);break;case Wx:this.AI(undefined,c,undefined,undefined);break;default:e(Error(".77"))}};
+F.fdc=function $Tp(a){this.AI(undefined,undefined,a,undefined)};F.SQ=function $Up(a){this.AI(undefined,undefined,undefined,a)};F.Gid=function $Vp(a,c){switch(a){case vA:this.AI(undefined,undefined,c,undefined);break;case Wx:this.AI(undefined,undefined,undefined,c);break;default:e(Error(".78"))}};
+F.AI=function $Wp(a,c,d,f){var g=this.v8,j=this.GC,n=this.o8,s=this.TU;a=Ke(a)?a:g;c=Ke(c)?c:j;d=Ke(d)?d:n;f=Ke(f)?f:s;if(!(a==g&&c==j&&d==n&&f==s)){var v=h;if(a<0)v=k;if(c<0)v=k;if(a>d)v=k;if(c>f)v=k;if(!v)e(Error(".79"));this.v8=a;this.GC=c;this.o8=d;this.TU=f;if(a==g&&d==n)this.Ui(Wx);else c==j&&f==s?this.Ui(vA):this.Ui()}};F.Qr=function $Xp(a){this.S1(a,undefined)};F.sf=function $Yp(a){this.S1(undefined,a)};
+F.zid=function $Zp(a,c){switch(a){case vA:this.S1(c,undefined);break;case Wx:this.S1(undefined,c);break;default:e(Error(".80"))}};F.S1=function $_p(a,c){var d=this.tCb,f=this.Hgb;a=Ke(a)?a:d;c=Ke(c)?c:f;if(!(a==d&&c==f)){var g=h;if(a<0&&a!=-1)g=k;if(c<0&&c!=-1)g=k;if(!g)e(Error(".81"));this.tCb=a;this.Hgb=c;if(a==d)this.Ui(Wx);else c==f?this.Ui(vA):this.Ui()}};
+F.sizeToContent=function $0p(a){switch(a){case vA:this.S1(-1,undefined);this.AI(0,undefined,Infinity,undefined);break;case Wx:this.S1(undefined,-1);this.AI(undefined,0,undefined,Infinity);break;default:e(Error(".82"))}};F.Ql=function $1p(a){this.zdc(vA,a)};F.Kx=function $2p(a){this.zdc(Wx,a)};F.zdc=function $3p(a,c){yA++;this.idc(a,0);this.Gid(a,c);this.idc(a,c);this.zid(a,0);zA()};F.qc=function $4p(a){if(a!=this.L4){this.L4=a;hBa(this)}};
+F.Ui=function $5p(a){if(!IA.C.Ui[z](this,a))return k;if(!a||a==vA){this.X4a=this.Y4a=i;this.Yjb=k}if(!a||a==Wx){this.Z4a=this.a5a=i;this.Zjb=k}var c=this.ac();c&&this.Fj()&&c.Ui(a);return h};F.oF=E(0);F.Q3=E(k);F.VV=function $8p(a){MA(this,a,-1)};F.Yb=function $9p(){this.NXa(k)};F.NXa=function $$p(a){if(this.ZHa!=a){this.ZHa=a;Ua(KA(this),a?I:xd);return h}return k};
+F.ip=function $aq(a,c,d){this.i4a(a);this.b();var f=this.Fj();d=!!d;lBa(this,a);if(f)if(!(!this.xv()&&c==this.Ke(a)&&d==mBa(this,a))){if(this.rK(a)!=-1&&c==-1)e(Error(".88"));f=0;if(c!=-1)switch(a){case vA:f=this.Epa+this.U4a;break;case Wx:f=this.Fpa+this.V4a;break}this.di(a,c-f,d)}TAa(this,a);this.yGa(a)};F.i4a=B();F.yGa=B();F.di=function $dq(a,c,d){this.b();gBa(this,a,c);c=c==-1||d?-1:c;MA(this,a,c)};var BA={};BA.x={};BA.y={};var AA=[],PA=[],tBa=[],QA=[],uBa=[],RA=[];H(SA,IA);SA[w].qe=function $eq(a){if(a)this.Twa(a)&&this.Ui(a);else{a=this.Twa(vA);var c=this.Twa(Wx);if(a&&c)this.Ui();else if(a)this.Ui(vA);else c&&this.Ui(Wx)}};SA[w].ma=function $fq(){SA.C.ma[z](this);if(this.Yj){this.sIa=G(this.XNa,this);this.Yj.Bbb[p](this.sIa)}};SA[w].Ba=function $gq(){SA.C.Ba[z](this);if(this.Yj){jf(this.Yj.Bbb,this.sIa);this.sIa=i}};SA[w].XNa=function $hq(){this.qe()};H(TA,SA);F=TA[w];F.n4=function $iq(a){a=a.Wu;if(!a)return 0;var c=a.b();a=c[x];var d=a[yaa],f=a[ib];Ja(a,sd);ka(a,I);c=c[xk];Ja(a,d);a.mDd=f;return c};F.Vh=function $jq(){TA.C.Vh[z](this);var a=this.Wu;rA(a);var c=a.b();this.VFa=c;this.Kca=c[x];this.W()[o](this.wa,c);this.Xk(a)};F.L=function $kq(){!this.wa&&this.Wu&&this.Wu.D();this.Kca=this.VFa=this.Wu=this.n4=i;TA.C.L[z](this)};ek(F,function $lq(){if(this.Wu){tA(this,0);this.WHa=this.XHa=this.Kca=this.VFa=this.Wu=i;this.qe();return h}return k});
+F.Q3=function $mq(a){return a==Wx};F.VV=function $nq(a){MA(this,a,-1);xBa(this,a)};F.oF=function $oq(a){var c=this.b();if(!c)return 0;if(a==vA)return this.n4(this);else{xBa(this,a);return c[Wc]}};F.di=function $pq(a,c,d){if(a==vA){c==-1&&!d?TA.C.di[z](this,a,LA(this,a),k):TA.C.di[z](this,a,c,d);this.qe(Wx)}else TA.C.di[z](this,a,-1,d);if(this.VFa)if(a==vA){if(this.XHa!=-1){this.XHa=-1;ka(this.Kca,NA(-1))}}else{a=c==-1?-1:c;if(this.WHa!=a){this.WHa=a;Wa(this.Kca,NA(a))}}};H(WA,pA);WA[w].Jc=function $qq(a){var c=this.b();DBa(this,a);Q(c,BBa())};var aB=new EBa,B9a=[P,Zi];EBa[w].w=function $rq(a,c,d,f,g){function j(n){if(n[Zb]==P&&nm(n,0)||n[Zb]==Zi&&(n[Sb]==13||n[Sb]==3))c[z](f,n)}j.Mk=c;j.Ela=f;g?g.w(a,B9a,j):ih(a,B9a,j)};EBa[w].hb=function $sq(a,c,d,f,g){for(var j=0;d=B9a[j];j++)for(var n=Ica(a,d,k)||[],s,v=0;s=n[v];v++)if(s.GA.Mk==c&&s.GA.Ela==f){g?g.hb(a,d,s.GA):nh(a,d,s.GA);break}};H(ZA,WA);F=ZA[w];F.Ym=function $tq(a){if(this.Djd==0)Ua(this.b()[x],a?I:xd);else Fa(this.b()[x],a?I:yd);var c=YA(this,h);c&&c.qe();this.yg=a};var C9a="param";F.lh=function $uq(a){a=a[y];for(var c=this.b();a&&a!=c;){var d=a.id;if(Mf(d,bB)){c=d[nc](5);this.gr&&this.gr.qk&&this.gr.qk(c,a[Uc](C9a));this.gr&&this.gr.MVb&&this.IK();break}a=a[A]}};var nO="cb",D9a="b9";
+F.Ad=function $vq(a,c){c=c||a.Wd();var d=XA(this);Q(d,c);switch(a.Ga()){case 0:DBa(this,FBa);break;case 1:DBa(this,he);break;case 2:DBa(this,Yd);break}GBa(this,d,Bo,nO);GBa(this,d,PJ,UF);GBa(this,d,Kd,D9a);this.gr=a;this.Ym(h)};F.IK=function $wq(){this.Ym(k);Q(XA(this),I);this.gr=undefined};F.ZK=D("yg");_B_prog(51)}catch(e){_B_err(e)}
+
+try{H(jB,uh);F=jB[w];var E9a="f1";F.ts=D(E9a);F.d9a=function $zq(){this[r](ki)};F.zn=function $Aq(){return this.f1==4};F.Ig=function $Bq(a){this.mh=a;this.dk(a)};F.Nf=D("Sm");F.Se=Ge("Sm");F.kua=D("Iaa");F.D=function $Fq(){jB.C.D[z](this);this.mh=i};H(OBa,Jf);var oO="oT";nB[w].hm=D(oO);Ha(nB[w],function $Hq(){return String(this.oT)});H(oB,jB);var YIa={Rxd:IB,Qxd:Cz,Pxd:Bz};F=oB[w];F.s9b=0;F.qa=RBa;F.B=D(JF);var F9a="Lc";F.P5=D(F9a);F.xc=D(Yj);var G9a="QUEUED";ua(F,function $Lq(){if(this.qa!=RBa)e(Error(".93"));this.s9b=Zf();this.qa=G9a;this.nKa[Mb](this)});La(F,function $Mq(){this.nKa[wc](this)});F.Vj=function $Nq(){return!!this.MDc};F.zga=D("jDc");F.Ie=Ge("Wm");F.Ja=function $Qq(a){a.oM(this);a.EOc(this.s9b)};F.Eg=E(h);F.lB=Ge("Sma");F.d9a=function $Tq(){oB.C.d9a[z](this);this.Sma&&this.Sma[r](ki)};
+F.Z6=function $Uq(a){if(!this.zn())if(a==this.Lc){a.oha()&&UBa(this,a.zga());aCa(this)}};F.rza=B();F.vL=B();var qB={},pO="rd";qB[1]=pO;qB[2]=kO;qB[3]=wz;qB[4]="xst";qB[5]=wz;qB[6]="xst";var qO="sp";qB[9]=qO;qB[120]="unsub";qB[10]=Zn;var H9a="dm";qB[11]=H9a;var rO="dr";qB[15]=rO;var sO="dd";qB[16]=sO;var tO="dl";qB[17]=tO;qB[45]=tO;qB[46]=tO;qB[18]=cAa;var I9a="uq";qB[98]=I9a;qB[30]=ex;qB[31]=MN;qB[12]="ac_";qB[13]="rc_";var uO="ib";qB[8]=uO;var vO="ig";qB[21]=vO;qB[22]=EE;var wO="sd";qB[23]=wO;qB[27]=ul;var xO="ii";qB[35]=xO;qB[36]=qya;qB[37]="ivd";qB[29]="astc";qB[38]="urt";qB[39]="rap";qB[40]="mcf_";
+qB[41]="dcf_";qB[42]="cce";qB[43]="cma_";qB[44]="dma_";var yO="dt";qB[47]=yO;qB[48]="rtr";qB[49]="aser";qB[50]="her";var J9a="ere";qB[51]=J9a;qB[52]="cc_";qB[53]="dc_";qB[54]="nc_";var zO="df";qB[56]=zO;qB[57]=SE;qB[58]="crte";var K9a="ae_";qB[62]=K9a;var L9a="de_";qB[63]=L9a;qB[61]="co_";qB[64]="cffm";qB[65]="ch_";qB[66]=PL;var AO="fl";qB[67]=AO;qB[69]="tua";qB[95]="tae";qB[117]="tha";var M9a="sh";qB[70]=M9a;var N9a="uu";qB[85]=N9a;qB[121]=XL;var BO="rr";qB[135]=BO;var CO="mu";qB[167]=CO;
+var O9a="umu";qB[168]=O9a;qB[163]="spa";var DO="su";qB[133]=DO;var P9a="du";qB[71]=P9a;var EO="pc";qB[72]=EO;var FO="uc";qB[107]=FO;qB[96]=NN;var GO="hu";qB[115]=GO;var HO="ru";qB[106]=HO;qB[124]="upq";qB[76]=uE;qB[77]="arl";qB[82]="gaa";qB[83]="gar";qB[84]="gas";var IO="crs";qB[86]=IO;var Q9a="crd";qB[87]=Q9a;qB[89]="ihl_";var R9a="miv";qB[90]=R9a;var S9a="mis";qB[91]=S9a;qB[92]=ie;var T9a="mib";qB[93]=T9a;qB[97]=kO;var JO="mtd";qB[101]=JO;qB[102]=OL;qB[103]="mddel_";qB[104]="mdsig_";var U9a="lpd";
+qB[105]=U9a;qB[108]="lnd";var V9a="sfl";qB[109]=V9a;qB[110]=lE;qB[111]=KD;qB[112]="sstl";qB[113]="mai";qB[114]="mani";var KO="fa";qB[116]=KO;qB[118]="bpoo";qB[119]="bpoi";qB[123]="par";qB[125]="mfas";qB[126]="muc";qB[128]="afw";qB[129]="vfw";qB[130]="rfw";qB[131]="sfw";qB[132]="cts";qB[162]=TE;var LO="tot";qB[165]=LO;qB[173]="fsu";H(pB,oB);pB[w].YQ=h;var cCa=/style=color:#\w+\ /;F=pB[w];F.pQb=D(WE);F.ws=D("aX");F.f5a=function $Zq(){return!!this.g5a};var W9a="o5";F.Ne=Ge(W9a);var MO="GMAIL_AT";F.Ja=function $0q(a){pB.C.Ja[z](this,a);a.Ua(ZB,mi(MO,I));a.Ua(pd,QN);a.Ua(fG,this.UR);a.Se(this.Zg());a.wl(!!this.uj);this.o5&&a.Ne(this.o5)};F.Zg=E("Server action");F.Eg=E(k);F.Wd=E(i);F.QE=E(-1);F.vH=E(I);F.rk=function $6q(a,c,d){if(c==Kd){this.NVa=h;this.eg=d[1];this.Kv=d[2];this.gq=d[3];this.gFb&&this.gFb(this)}};
+F.tf=function $7q(){this.HPa=h};H(tB,pB);F=tB[w];var NO="Ea";F.Bb=D(NO);F.Ii=Ge(NO);F.peb=function $$q(){return this.hia?Infinity:this.BV[u]};F.Mg=function $ar(){for(var a=[],c=0;c<this.BV[u];c++)a[p]([this.BV[c],this.RDa[c]]);return a};F.Lp=function $br(){return!!this.hia};F.Cr=function $cr(){return this.BV[u]==1};F.Eg=E(k);F.Wd=function $er(){return this.Eg()?this.Kv:this.yp()};F.yp=E(I);var X9a="msq";F.Ja=function $gr(a){tB.C.Ja[z](this,a);if(this.hia){a.Be(KF,1);a.Be(X9a,this.FVc)}else a.Be(IB,this.RDa);a.Ii(this.Ea)};H(vB,tB);var Y9a="All conversations have been starred.",Z9a="The conversation has been starred.",aab=" conversations have been starred.";vB[w].yp=function $hr(){var a,c=this.peb();(a=this.aa.gcb(c))||(a=c==Infinity?Y9a:c==1?Z9a:c+aab);return sB(this,a,5904)};vB[w].Ja=function $ir(a){vB.C.Ja[z](this,a);this.aa.Ja(a)};yx(eCa,vB);eCa[w].Ja=B();eCa[w].gcb=B();eCa[w].gcb.ic=h;jCa[w].B=D(JF);var bab="Grrr! A popup blocker may be preventing ",cab=" from opening the page. If you have a popup blocker, try disabling it to open the window.";jCa[w].Q0=function $mr(a,c,d){if(this.aa.Tka(a))return i;var f=bab+(Ii+cab),g=dC(this.V);g=eC(g);var j=g.top[oc];a=iCa(a,c,g.js&&g.js._GM_main||!j||j[Rq]?g.top:j);if((!a||a[Rq]||!a[Ek])&&d)g[Wp](f);return a};jCa[w].Yo=function $nr(a,c,d){c=c||{};c.noreferrer=h;if(a=kCa(this,a,c,d))a.opener=i;return a};yx(mCa,jCa);mCa[w].Tka=B();
+mCa[w].Tka.ic=h;H(nCa,tB);nCa[w].Eg=E(h);nCa[w].vL=function $qr(){if(this.eg){var a=this.gq;if(this.p2b)try{this.p2b[yc][Ic][mb](a[0]);return}catch(c){}var d=xB(this.B());yB(d,a[0],{width:800,height:600})}};var pCa,OO;pCa={};OO=i;oCa[w].Nga=D(LL);oCa[w].lC=function $sr(a){var c;c=this.Jb;OO||(OO={});var d=OO[c];if(Ke(d))c=d;else c=OO[c]=c;if(!c)return a;return c+xj+a};var dab=new oCa("lib");var EB=new oCa(Xz);BB[w].Xs=function $tr(){return this[t]()};BB[w].lC=function $ur(){if(!this.vkc)this.vkc=this.S1b.lC(this.Xd);return this.vkc};Ha(BB[w],function $vr(){if(!this.Ghc)this.Ghc=this.S1b.Nga()+xj+this.Xd;return this.Ghc});H(CB,BB);var wE=DB(DE),YK=DB(OD),PO="co",QO=DB(PO),RO="ct",SO=DB(RO),eab=DB(ki),TO="pu",dJ=DB(TO),UO=DB(je),fab=DB(IB),VO="chs",gab=DB(VO);H(rCa,N);H(sCa,jB);var WO="Ic";sCa[w].Tga=D(WO);H(HB,uh);fp(HB[w],function $xr(a){this[r](new rCa(a));if(this.na)return this.na[bq](a);else{a=new sCa;GB(a,3);return a}});HB[w].SH=function $yr(a){return this.na?this.na.SH(a):k};HB[w].gH=function $zr(a){if(this.na)return this.na.gH(a);else e(Error(".98"))};HB[w].zc=function $Ar(){if(this.na)return this.na.zc();else e(Error(".99"))};H(tCa,tB);tCa[w].Ja=function $Br(a){tCa.C.Ja[z](this,a);a.Be(IB,this.BV);a.Ii(this.Ea)};tCa[w].vL=function $Cr(){if(this.eg){var a=this.gq,c=a[0],d=a[2],f=a[3],g={};g.cf1_from=a[1];g.cf1_to=c;g.cf1_subj=f;g.cf1_has=d;g.cfl_origin=this.jb.gH();QF(this.zf,XO);this.jb[bq]({view:wE,search:new Qy(g)})}};H(uCa,tB);var hab="All conversations have been muted.",iab="The conversation has been muted.",jab=" conversations have been muted.";uCa[w].yp=function $Dr(){var a;a=this.Lp()?hab:this.Cr()?iab:this.Mg()[u]+jab;return sB(this,a,i,h)};H(KB,tB);KB[w].Ujc=k;var kab="vrd";KB[w].Ja=function $Er(a){KB.C.Ja[z](this,a);this.Ujc&&a.Ua(kab,Hj)};var lab="All conversations have been marked as read.",mab="The conversation has been marked as read.",nab=" conversations have been marked as read.";KB[w].yp=function $Fr(){var a;a=this.Lp()?lab:this.Cr()?mab:this.Mg()[u]+nab;return sB(this,a,i,h)};H(vCa,tB);var oab="All conversations have been marked as unread.",pab="The conversation has been marked as unread.",qab=" conversations have been marked as unread.";vCa[w].yp=function $Gr(){var a;a=this.Lp()?oab:this.Cr()?pab:this.Mg()[u]+qab;return sB(this,a,i,h)};_B_prog(52)}catch(e){_B_err(e)}
+
+try{H(wCa,tB);var rab="All conversations have been moved to the Inbox.",sab="The conversation has been moved to the Inbox.",tab=" conversations have been moved to the Inbox.";wCa[w].yp=function $Hr(){var a;a=this.Lp()?rab:this.Cr()?sab:this.Mg()[u]+tab;return sB(this,a,18522,h)};H(xCa,tB);var uab="All conversations have been unmarked as spam and moved to the Inbox.",vab="The conversation has been unmarked as spam and moved to the Inbox.",wab=" conversations have been unmarked as spam and moved to the Inbox.";xCa[w].yp=function $Ir(){var a;a=this.Lp()?uab:this.Cr()?vab:this.Mg()[u]+wab;return sB(this,a,6602,h)};H(LB,tB);LB[w].Ja=function $Jr(a){LB.C.Ja[z](this,a);a.Ua(fG,this.UR+this.iR)};H(MB,LB);var xab="All conversations have been archived.",yab="The conversation has been archived.",zab=" conversations have been archived.",YO='The label "',Aab='" has been removed from all conversations.',Bab='" has been removed from the conversation.',Cab='" has been removed from ',Dab=" conversations.";
+MB[w].yp=function $Kr(){var a,c;if(this.Dd()==TI){c=6576;a=this.Lp()?xab:this.Cr()?yab:this.Mg()[u]+zab}else if(this.Lp())a=YO+(Wf(this.Dd())+Aab);else if(this.Cr()){c=6560;a=YO+(Wf(this.Dd())+Bab)}else a=YO+(Wf(this.Dd())+(Cab+(this.Mg()[u]+Dab)));return sB(this,a,c,h)};var Eab="iR";MB[w].Dd=D(Eab);H(yCa,tB);var Fab="All conversations have been unstarred.",Gab="The conversation has been unstarred.",Hab=" conversations have been unstarred.";yCa[w].yp=function $Mr(){var a;a=this.Lp()?Fab:this.Cr()?Gab:this.Mg()[u]+Hab;return sB(this,a,5904)};H(zCa,tB);var Iab="The conversation has been marked as spam. We'll attempt to unsubscribe you from these emails.",Jab=" conversations have been marked as spam. We'll attempt to unsubscribe you from these emails.",Kab="The conversation has been marked as spam.",Lab=" conversations have been marked as spam.";zCa[w].yp=function $Nr(){var a,c;if(this.iNb){c=80405;a=this.Cr()?Iab:this.Mg()[u]+Jab}else{c=6602;a=this.Cr()?Kab:this.Mg()[u]+Lab}return sB(this,a,c,h)};var Mab="dun";
+zCa[w].Ja=function $Or(a){zCa.C.Ja[z](this,a);this.iNb&&a.Ua(Mab,Hj)};H(ACa,tB);var Nab="All conversations have been moved to the Trash..",Oab="The conversation has been moved to the Trash.",Pab=" conversations have been moved to the Trash.";ACa[w].yp=function $Pr(){var a;a=this.Lp()?Nab:this.Cr()?Oab:this.Mg()[u]+Pab;return sB(this,a,7401,h)};H(NB,xx);F=NB[w];F.eca=B();F.eca.Ka=h;F.dca=B();F.dca.Ka=h;F.D=B();F.D.Ka=h;H(BCa,BB);var Qab=OB(ii),Rab=OB(IB),ZO=OB(dx),Sab=OB("cpt"),Tab=OB(RE),Uab=OB("rpt"),Vab=OB(Kd),Wab=OB("apt"),Xab=OB(kD),Yab=OB("fpt"),Zab=OB(vz),abb=OB("ftpt"),bbb=OB(Zn),cbb=OB(eJ),dbb=OB(Nj),ebb=OB(FE),fbb=OB("astc"),gbb=OB(oA),hbb=OB(cD),ibb=OB(Cz),jbb=OB(vA),kbb=OB("mar"),lbb=OB("mau"),mbb=OB(ZB),nbb=OB("tml"),obb=OB("tsl"),pbb=OB(vl),qbb=OB(VE),rbb=OB(Xx),sbb=OB(YB),tbb=OB("mti"),ubb=OB(NL),vbb=OB(Wx),wbb=OB(aJ),xbb=OB("arl"),ybb=OB(FHa),aP="ns",zbb=OB(aP),Abb=OB(ex),Bbb=OB(UE),Cbb=OB(Lj),bP="tm",Dbb=
+OB(bP),Ebb=OB(zO),Fbb=OB("anl"),Gbb=OB(qD),Hbb=OB(EO),cP="re",Ibb=OB(cP),Jbb=OB("dad"),Kbb=OB(MN),dP="pp",Lbb=OB(dP),RTa=OB(MF),W0a=OB(dg),eP="se",XO=OB(eP),Mbb=OB(wO),Nbb=OB(NE),fP="un",Obb=OB(fP),gP="et",Pbb=OB(gP),Qbb=OB("das"),Rbb=OB("dtm"),Sbb=OB(ke),hP="rl",Tbb=OB(hP),Ubb=OB("rcl"),Vbb=OB(tO),Wbb=OB(AO),Xbb=OB(KO),Ybb=OB("ihl"),Zbb=OB(ul),iP="ef",acb=OB(iP),bcb=OB("dfi"),ccb=OB(PO),dcb=OB(PL),ecb=OB(SE),fcb=OB(RO),jP=OB(ki),gcb=OB(oF),hcb=OB("mxg");OB("mng");
+var icb=OB(YHa),jcb="uh",kcb=OB(jcb),lcb=OB(M9a),mcb=OB("trm");OB(IO);OB(Q9a);var kP="ws",ncb=OB(kP),ocb=OB(R9a),pcb=OB(S9a),qcb=OB(ie),rcb=OB(T9a),scb=OB(JO),tcb=OB(TO),ucb=OB("puc"),vcb=OB(dO),wcb=OB(XL),xcb=OB(P9a),ycb=OB("duc"),zcb=OB("muc");OB(GO);var Acb=OB("hus"),lP="ec",Bcb=OB(lP),mP="ou",Ccb=OB(mP),Dcb=OB("lmu"),Ecb=OB(DO),Fcb=OB("ump"),Gcb=OB(vy),nP="ea",Hcb=OB(nP),oP="ex",Icb=OB(oP),Jcb=OB("sadi"),Kcb=OB("sstl"),Lcb=OB("mai"),Mcb=OB("mani"),Ncb=OB("unsub"),Ocb=OB(I9a),Pcb=OB("mufh");OB(HO);
+var Qcb=OB(BO),Rcb=OB(CO),Scb=OB(TE),Tcb=OB(SL),Ucb=OB("spa"),Vcb=OB("iosg"),Wcb=OB(LO);H(PB,Jf);yx(NB,PB);var RB=[],CCa={},DCa={};PB[w].eca=function $Tr(a,c,d){var f=d.i_a,g={};if(d.Lp){g[1]=h;g[2]=h;g[3]=h;g[4]=h;g[7]=h;g[8]=h;g[10]=h}else for(var j=0;j<f[u];j++){var n=f[j];g[n.Jl?1:2]=h;g[n.Uf()?4:3]=h;g[n.Zh(TI)?7:8]=h;g[n.Oy()?18:9]=h;g[64]=h;g[10]||(g[10]=!n.Zh(BL));g[21]||n.Zh(GN)||(g[21]=h)}this.aa.eca(g,d);ICa(this,a,c,g)};
+PB[w].dca=function $Ur(a,c,d){var f=d.Ti,g=d.zPc,j={};j[1]=k;j[2]=h;j[10]=h;j[42]=this.Z[hq](Nz);var n=f[bd](TI);j[7]=n;j[8]=!n;n=f[bd](AL);j[18]=n;j[9]=!n;n=f[bd](oI);j[4]=n&&!g;j[3]=!n&&!g;j[64]=c!=ul&&c!=fz;j[21]=!f[bd](GN);this.aa.dca(j,d);ICa(this,a,c,j)};PB[w].nk=function $Vr(a,c,d,f){var g=new KCa;a=QB(a);QF(c,a.eqd);if(exa(a.a2))g.a2=a.a2;else if(Ze(a.a2))g.a2=a.a2[z](a,f);if(a.N_a){g.N_a=h;g.PX=a.PX;return g}g.BWa=a.BWa;Op(g,a.PYb?new a.PX(this.V,a.PYb,d):new a.PX(this.V,d));return g};
+PB[w].D=function $Wr(){PB.C.D[z](this);this.aa.D()};var Xcb="Add star",pP="f_inbox",Ycb="Move to inbox",Zcb="Create event",adb="Filter messages like these",bdb="Mute";
+(function(){SB(1,wM,kbb,KB,h);SB(2,x5a,lbb,vCa,h);HCa(3,Xcb,pbb,vB,k,[Oy,cz,az,ez,Py,fz,Nd,ul,iz,kz,ZK,pP,aL,ce,Jy,pz,Yy]);HCa(4,uWa,qbb,yCa,function(b){return b==sz},[Oy,cz,az,ez,Py,fz,Nd,ul,iz,kz,ZK,pP,aL,ce,Jy,pz,Yy]);FCa(7,y5a,sbb,MB,function(b){return b==kz||b==ZK||b==aL||b==ce},TI,[Oy,cz,az,Py,fz,Nd,ul,Jy,sz]);SB(8,Ycb,tbb,wCa,function(b){return b==Zy},[Oy,az,Py,Nd,ul,iz,Jy,pz,sz]);GCa(9,vWa,ybb,zCa,h,[Oy,az,Nd,ul,Jy,Zy]);SB(18,tWa,zbb,xCa,h,[Oy,az,ul,Jy]);SB(10,EJ,Cbb,ACa,h,[fz,Nd,ul,pz,sz]);
+SB(42,Zcb,Gbb,nCa,k);SB(64,adb,Zbb,tCa,k,[Oy,cz,az,ez,Py,Nd,iz,kz,ZK,pP,aL,ce,Jy,pz,Yy,sz,Zy]);SB(21,bdb,rbb,uCa,h,[Oy,az,ez,Nd,ul,kz,ZK,pP,aL,ce,Jy,pz,sz])})();H(UB,pA);UB[w].B=D(JF);H(VB,UB);VB[w].Ar=function $Yr(a){return!!this.ge.J(a)};VB[w].Fs=E(h);VB[w].rO=function $_r(){return this.ge.Sb()};Qp(VB[w],function $0r(){this.Cl=k});H(XB,N);H(LCa,uh);LCa[w].Zta=D("iAa");var cdb="dg";VCa[w].Ec=D(cdb);VCa[w].alert=function $3r(a){this.dg.Ec()[Wp](a)};VCa[w].confirm=function $4r(a){return this.dg.Ec()[Zp](a)};Ap(VCa[w],function $5r(a,c){return this.dg.Ec()[Nq](a,c)});F=fC[w];F.ni=0;F.r2=0;F.MG=function $6r(a){this.ee[this.r2++]=a};F.ly=function $7r(){if(this.ni!=this.r2){var a=this.ee[this.ni];delete this.ee[this.ni];this.ni++;return a}};F.hQ=function $8r(){if(this.ni!=this.r2)return this.ee[this.ni]};F.Nb=function $9r(){return this.r2-this.ni};F.nd=function $$r(){return this.r2-this.ni==0};Aa(F,function $as(){Ia(this.ee,0);this.r2=this.ni=0});Sa(F,function $bs(a){return ef(this.ee,a)});
+wa(F,function $cs(a){a=ff(this.ee,a);if(a<0)return k;if(a==this.ni)this.ly();else{kf(this.ee,a);this.r2--}return h});F.Oa=function $ds(){return this.ee[lb](this.ni,this.r2)};H(gC,uh);gC[w].fZb=I;gC[w].R0b=0;var YCa=[P,ej,fj,gj,hj],XCa=[ij,jj];gC[w].L=function $es(){gC.C.L[z](this);this.Q.D();this.Q=i;delete this.eE};gC[w].XO=function $fs(a){var c=k;switch(a[Zb]){case hj:if(typeof this.wZb==Qe&&this.wZb!=a[kc]||typeof this.xZb==Qe&&this.xZb!=a[lc])c=h;this.wZb=a[kc];this.xZb=a[lc];break;default:c=h}c&&aDa(this,Zf(),a[Zb])};gC[w].TZ=function $gs(a){return(a||Zf())-this.xkb};_B_prog(53)}catch(e){_B_err(e)}
+
+try{H(hC,uh);hC[w].mgb=k;hC[w].Oya=i;hC[w].rP=k;var iC=i,dDa=new cg;hC[w].UXc=function $hs(){this.Oya=i;cDa(this)};hC[w].t3b=function $is(){this.rP=k;eDa(this);this[r](yi);cDa(this)};hC[w].L=function $js(){eDa(this);if(this.Oya!=i){Je[gb](this.Oya);this.Oya=i}dDa[Pb](this);if(iC!=i&&dDa.nd()){iC.D();iC=i}hC.C.L[z](this)};var qP="rP";hC[w].My=D(qP);H(jC,Jf);jC[w].ab=i;jC[w].D=function $ls(){jC.C.D[z](this);if(this.ab){cA(this.ab);this.ab=i}this.UGa[bc]();for(var a=this.i1.Oa(),c=0;c<a[u];c++)a[c].D();this.i1[bc]();if(this.Hh){this.Hh.D();this.Hh=i}};var ddb=";2";jC[w].wYc=function $ms(){for(this.ab=i;!this.UGa.nd();)try{var a=this.UGa.ly();a[0][z](a[1])}catch(c){rg(tg,ddb,c)}};H(nC,Jf);var jDa=1;nC[w].D=function $ns(){nC.C.D[z](this);this.Cu&&iDa(this.Cu,this)};nC[w].ix=function $os(){this.ab=i;lDa(this,Zf())};jC[w].qia=D("uWb");
+jC[w].kvb=function $qs(){for(var a=Zf(),c=this.i1.Oa(),d=0;d<c[u];d++)lDa(c[d],a)};jC[w].R8=function $rs(){for(var a=this.i1.Oa(),c=0;c<a[u];c++){var d=a[c];if(d.C5&2&&d.xKa){mC(this,this.kvb,this);break}}};jC[w].S8=function $ss(){for(var a=this.i1.Oa(),c=0;c<a[u];c++){var d=a[c];if(d.C5&4&&d.xKa){mC(this,this.kvb,this);break}}};H(oC,uh);F=oC[w];F.OU=i;F.dg=i;F.We=i;F.R0a=i;F.vjb=function $ts(){return Jg&&Ri||Ng&&this.dg[yma]!=this.dg.top};F.Ke=function $us(){return this.We?this.We.vc():i};F.L=function $vs(){oC.C.L[z](this);if(this.OU){oh(this.OU);this.OU=i}if(this.R0a){ba[Oma](this.R0a);this.R0a=i}this.We=this.dg=i};F.a7=function $ws(){this.lJb()};F.lJb=function $xs(){var a=Mg(this.dg);if(!Yha(a,this.We)){this.We=a;this[r](sj)}};H(pC,Jf);pC[w].Fp=D("wrb");pC[w].W=D(aM);pC[w].UO=function $As(){return this.eoa.Ke()};pC[w].L=function $Bs(){this.Y=this.wrb=i;if(this.eoa){this.eoa.D();this.eoa=i}};H(qDa,uh);F=qDa[w];F.HF=0;F.L=function $Cs(){qDa.C.L[z](this);this.KQ=this.Nr=i;this.Q.D();this.Q=i};var edb="-50px";F.lf=function $Ds(){this[r](rC);try{var a=this.Jsa.cb()[Lc];if(L)a[Ek]();else if(Jg||Fh&&vg(vYa)||Ng){if(!this.sKa){var c=this.Jsa[Qb](zm),d=c[x];Ja(d,sd);Wa(d,ka(d,hG));ck(d,edb);a[o](c);this.sKa=c}this.sKa[x].top=uDa(this)+Jm;this.sKa[Ek]();this.sKa[yk]();Ng&&a[Mc][dc][Ek]()}else Ze(a[yk])&&a[yk]()}catch(f){}};
+qp(F,function $Es(a,c,d,f){var g=this.HF,j=this.Nr[ql],n=g+j,s=Sw(a);a=s+a[ql];f=f||0;if(d||s<g||a>n){d=0;d+=c==0?a-j+5:c==1?(s+a-j)/2:s-5;c=l.max(0,d-f)}else c=-1;j=this.Nr;if(c>=0)if(!(Fh&&!vg(vDa)&&j[vc]==0&&j[Wc]==0)){up(j,c);this.HF=c}});F.Xfd=function $Fs(a){if(a[y]==this.KQ||L&&!a[y])this.HF=this.Nr[Nk]};F.mgd=function $Gs(a){var c=a[y];if(a[Sb]==32&&(!c||this.vrd[bd](c[ed]))){c=this.Nr;var d=this.HF,f=c[ql]*0.9;if(a[dd]){if(a[dd]&&d>0)up(c,d-f)}else if(d+f<c[Rb])up(c,d+f)}};H(wC,uh);var fdb=L||Fh&&vg("1.9.3");F=wC[w];faa(F,0);gaa(F,0);F.Tfc=0;F.Ufc=0;F.Hea=0;F.Iea=0;F.Lf=h;F.mZ=k;F.bhb=0;F.vVc=0;F.dWb=k;F.H=D(aE);F.oCa=Ge("KQ");F.Ac=Ge(so);F.L=function $Ks(){wC.C.L[z](this);nh(this[Fma],fj,this.sM,k,this);this.Q.D();delete this[y];delete this[Fma];delete this.Q};
+F.sM=function $Ls(a){if(this.Lf&&!this.mZ&&(a[Zb]!=fj||nm(a,0))){if(this.bhb==0){ADa(this,a);if(this.mZ)a[zb]();else return}else a[zb]();this.Exb();faa(this,this.Tfc=a[Ib]);gaa(this,this.Ufc=a[Jb]);this.Hea=this[y][Vk];this.Iea=this[y][ol];this.Oza=gm(Cg(this.ki));this.vVc=Zf()}};
+F.Exb=function $Ms(){var a=this.ki,c=a[mc],d=!fdb;this.Q.w(a,hj,this.F1b,d);this.Q.w(a,gj,this.ww,d);if(fdb){c.setCapture(k);this.Q.w(c,Yea,this.ww)}else this.Q.w(pm(a),kj,this.ww);L&&this.dWb&&this.Q.w(a,qj,zDa);this.KQ&&this.Q.w(this.KQ,tj,this.y6c,d)};F.ww=function $Ns(a,c){this.Q.wb();fdb&&this.ki.releaseCapture();if(this.mZ){this.mZ=k;var d=DDa(this,this.Hea),f=EDa(this,this.Iea);this[r](new BDa(Jd,this,a[kc],a[lc],a,d,f,c))}};F.cOb=function $Os(a){this.ww(a,h)};var gdb="beforedrag";
+F.F1b=function $Ps(a){if(this.Lf){var c=a[Ib]-this[Ib],d=a[Jb]-this[Jb];faa(this,a[Ib]);gaa(this,a[Jb]);if(!this.mZ){var f=this.Tfc-this[Ib],g=this.Ufc-this[Jb];if(f*f+g*g>this.bhb){ADa(this,a);if(!this.mZ){this.ww(a);return}}}d=CDa(this,c,d);c=d.x;d=d.y;if(this.mZ)if(this[r](new BDa(gdb,this,a[kc],a[lc],a,c,d))!==k){this.GKa(a,c,d,k);a[zb]()}}};F.y6c=function $Qs(a){var c=CDa(this,0,0);Da(a,this.Oza.x-this[Ib]);Ea(a,this.Oza.x-this[Jb]);this.GKa(a,c.x,c.y,h)};var rP="drag";
+F.GKa=function $Rs(a,c,d){ck(this[y][x],c+Jm);this[y][x].top=d+Jm;this[r](new BDa(rP,this,a[kc],a[lc],a,c,d))};H(BDa,N);H(yC,nn);F=yC[w];F.LBb=k;F.Yxa=h;F.dfa=h;F.Z3a=0.3;F.ug=I;F.Bg=I;F.Yf=i;F.ih=i;F.yg=k;F.M4=k;F.Em=i;F.jq=i;F.iD=i;F.uR=i;F.iAb=i;F.y2=i;F.QD=i;F.bw=i;F.Fc=function $Ss(a){this.ug=a;this.uR&&ah(this.uR,a)};F.Le=D(RN);F.xb=function $Us(a){this.Bg=a;if(this.QD)Q(this.QD,a)};F.Ee=D(lo);F.Cd=function $Ws(){this.QD||this.eb();return this.QD};F.uH=function $Xs(){this.Cc()||this.eb();return this.iD};F.Ot=function $Ys(){this.Cc()||this.eb();return this.bw};F.TQb=D("dfa");
+var hdb="-K7",idb="-K7-K0",jdb="-K7-Jq",kdb="-Jl",ldb="dialog",mdb="labelledby";
+F.ba=function $_s(){JDa(this);var a=this.W();this.wa=a.ba(T,{className:this.Al,tabIndex:0},this.iD=a.ba(T,{className:this.Al+hdb,id:this.ea()},this.uR=a.ba(PJ,this.Al+idb,this.ug),this.y2=a.ba(PJ,this.Al+jdb)),this.QD=a.ba(T,this.Al+Nn),this.bw=a.ba(T,this.Al+kdb),this.Sgc=a.ba(PJ,{tabIndex:0}));this.iAb=this.iD.id;fn(this.b(),ldb);gn(this.b(),mdb,this.iAb||I);if(this.Bg)Q(this.QD,this.Bg);Wm(this.b(),k);this.Yf&&PDa(this.Yf,this.bw)};
+F.eb=function $0s(a){if(this.Cc())e(Error(An));this.b()||this.ba();a=a||this.W().cb()[Lc];ODa(this,a);yC.C.eb[z](this,a)};F.ji=function $1s(a){return a&&a[ed]&&a[ed]==Cd&&yC.C.ji[z](this,a)};
+F.Ff=function $2s(a){yC.C.Ff[z](this,a);K(this.b(),this.Al);a=this.Al+Nn;if(this.QD=Gg(i,a,this.b())[0])this.Bg=this.QD[wk];else{this.QD=this.W().ba(T,a);if(this.Bg)Q(this.QD,this.Bg);this.b()[o](this.QD)}a=this.Al+hdb;var c=this.Al+idb,d=this.Al+jdb;if(this.iD=Gg(i,a,this.b())[0]){this.uR=Gg(i,c,this.iD)[0];this.y2=Gg(i,d,this.iD)[0]}else{this.iD=this.W().ba(T,a);this.b()[Bb](this.iD,this.QD)}if(this.uR)this.ug=dh(this.uR);else{this.uR=this.W().ba(PJ,c,this.ug);this.iD[o](this.uR)}gn(this.b(),mdb,
+this.iAb||I);if(!this.y2){this.y2=this.W().ba(PJ,d);this.iD[o](this.y2)}a=this.Al+kdb;if(this.bw=Gg(i,a,this.b())[0]){this.Yf=new DC(this.W());this.Yf.Pb(this.bw)}else{this.bw=this.W().ba(T,a);this.b()[o](this.bw);this.Yf&&PDa(this.Yf,this.bw)}JDa(this);ODa(this,Eg(this.b())[Lc]);Wm(this.b(),k)};F.ma=function $3s(){yC.C.ma[z](this);if(this.dfa&&!this.ih)this.ih=MDa(this);this.H().w(this.y2,P,this.v8c).w(this.xq,cj,this.dx);fn(this.b(),ldb);this.uR.id!==I&&gn(this.b(),mdb,this.uR.id)};
+F.Ba=function $4s(){this.Ib()&&this.ra(k);if(this.ih){this.ih.D();this.ih=i}yC.C.Ba[z](this)};var ndb="position:fixed;width:0;height:0",sP="afterhide";
+F.ra=function $5s(a){if(a!=this.yg){var c=this.W().cb(),d=pm(c)||ba;this.Cc()||this.eb(c[Lc]);if(a){this.DWa();this.If();this.H().w(this.b(),ij,this.yk,h).w(d,sj,this.XH,h)}else this.H().hb(this.b(),ij,this.yk,h).hb(d,sj,this.XH,h);this.jq&&Wm(this.jq,a);this.Em&&Wm(this.Em,a);Wm(this.b(),a);if(a){Fh&&this.b()[Ek]();if(this.jA())if(d=this.jA().wga())for(var f=this.bw[ic](jo),g=0,j;j=f[g];g++)if(j[ec]==d){try{if(Jg||Ng){var n=c[Qb](zm);iaa(n[x],ndb);this.b()[o](n);n[Ek]();this.b()[Nc](n)}j[Ek]()}catch(s){}break}}if(this.yg=
+a)this.H().w(this.bw,P,this.L3b);else{this.H().hb(this.bw,P,this.L3b);this[r](sP);this.M4&&this.D()}}};F.Ib=D("yg");F.DWa=function $7s(){this.jq&&Wm(this.jq,k);this.Em&&Wm(this.Em,k);var a=this.W().cb(),c=Mg(pm(a)||ba),d=a[Lc][bl];a=l.max(a[Lc][Rb],c[id]);if(this.jq){Wm(this.jq,h);Rm(this.jq,d,a)}if(this.Em){Wm(this.Em,h);Rm(this.Em,d,a)}if(this.dfa){c=Tm(this.b());this.ih.txa=new Cm(0,0,d-c[ib],a-c[id])}};
+F.If=function $8s(){var a=this.W().cb(),c=pm(a)||ba;if(mia(this.b())==oia)var d=a=0;else{d=gm(this.W());a=d.x;d=d.y}var f=Tm(this.b());c=Mg(c);a=l.max(a+c[ib]/2-f[ib]/2,0);d=l.max(d+c[id]/2-f[id]/2,0);f=this.b();if(this.wP()){qk(f[x],l[kb](a)+Jm);f[x].top=l[kb](d)+Jm}else Km(f,a,d)};F.v8c=function $9s(){var a=this.jA(),c=a&&a.o5a;if(c){a=a.J(c);this[r](new CC(c,a))&&this.ra(k)}else this.ra(k)};
+F.L=function $$s(){yC.C.L[z](this);if(this.xq){this.xq.D();this.xq=i}if(this.Em){Sg(this.Em);this.Em=i}if(this.jq){Sg(this.jq);this.jq=i}this.Sgc=this.bw=this.y2=i};F.oh=function $at(a){this.Yf=a;if(this.bw)if(this.Yf)PDa(this.Yf,this.bw);else Q(this.bw,I)};F.jA=D("Yf");F.L3b=function $ct(a){a:{for(a=a[y];a!=i&&a!=this.bw;){if(a[ed]==Fka){a=a;break a}a=a[A]}a=i}if(a&&!a[Uk]){a=a[ec];var c=this.jA().J(a);this[r](new CC(a,c))&&this.ra(k)}};
+F.yk=function $dt(a){var c=k,d=k,f=this.jA(),g=a[y];if(a[Sb]==27){var j=f&&f.o5a;g=g[ed]==KG&&!g[Uk];if(j&&!g){d=h;c=f.J(j);c=this[r](new CC(j,c))}else g||(c=h)}else if(a[Sb]==13){if(g[ed]==Fka)j=g[ec];else if(f){var n=f.wga(),s=n&&f.yMa(n);g=(g[ed]==ym||g[ed]==KG)&&!g[Uk];if(s&&!s[Uk]&&!g)j=n}if(j){d=h;c=this[r](new CC(j,String(f.J(j))))}}else if(a[Sb]==9&&a[dd]&&g==this.b())d=h;if(c||d){a[Ec]();a[zb]()}c&&this.ra(k)};F.XH=function $et(){this.DWa()};
+F.dx=function $ft(a){this.Sgc==a[y]&&Dh(this.zEc,0,this)};F.zEc=function $gt(){L&&this.W().cb()[Lc][Ek]();this.b()[Ek]()};H(CC,N);var GDa,GC,odb;H(DC,Hf);F=DC[w];F.Al="J-ldDVFe";F.D8a=i;F.wa=i;F.o5a=i;F.set=function $ht(a,c,d,f){Hf[w].set[z](this,a,c);if(d)this.D8a=a;if(f)this.o5a=a;return this};var pdb="-zTETae";F.eb=function $it(){if(this.wa){Q(this.wa,I);var a=Cg(this.wa);Ef(this,function(c,d){c=a.ba(jo,{name:d},c);if(d==this.D8a)m(c,this.Al+pdb);this.wa[o](c)},this)}};var tP="cancel";
+F.Pb=function $jt(a){if(!(!a||a[nb]!=1)){this.wa=a;a=this.wa[ic](jo);for(var c=0,d,f,g;d=a[c];c++){f=d[ec]||d.id;g=dh(d)||d[q];if(f){var j=c==0;this.set(f,g,j,d[ec]==tP);j&&K(d,this.Al+pdb)}}}};F.wga=D("D8a");F.yMa=function $lt(a){for(var c=this.wa[ic](Fka),d=0,f;f=c[d];d++)if(f[ec]==a||f.id==a)return f;return i};var uP="ok";GC=(new DC).set(uP,FF,h,h);var vP="Cancel";GDa=(new DC).set(uP,FF,h).set(tP,vP,k,h);var wP="yes",xP="Yes",yP="no",zP="No";odb=(new DC).set(wP,xP,h).set(yP,zP,k,h);
+(new DC).set(wP,xP).set(yP,zP,h).set(tP,vP,k,h);var AP="continue",qdb="Continue",BP="save",CP="Save";(new DC).set(AP,qdb).set(BP,CP).set(tP,vP,h,h);_B_prog(54)}catch(e){_B_err(e)}
+
+try{H(EC,yC);EC[w].DVa=k;EC[w].ra=function $mt(a){if(this.Ib()!=a&&!this.DVa){var c=this.b(),d=IDa(this),f=[ij,Zi];if(a){ih(c,f,this.PA,k,this);ih(d,P,this.G3b,k,this)}else{nh(c,f,this.PA,k,this);nh(d,P,this.G3b,k,this)}}EC.C.ra[z](this,a)};EC[w].G3b=function $nt(){this.b()[Ek]()};EC[w].PA=function $ot(a){this.DVa||a[Ec]()};H(HC,EC);HC[w].MC=function $pt(a){if(a.key!=uP)this.ra(k);else{var c=Pf(this.xF[q]),d=this.Wna?this.Wna(c,this.IAc):i;if(d){a[zb]();Q(this.P9,d);this.xF[Ek]()}else{this.n2a(c);this.ra(k)}}};HC[w].ra=function $qt(a){HC.C.ra[z](this,a);a?this.xF[Ek]():this.Cb.lf()};H(IC,EC);IC[w].MC=function $rt(a){a.key==uP&&this.n2a()};IC[w].ra=function $st(a){IC.C.ra[z](this,a);a||this.Cb.lf()};var WDa=/[\uFF01-\uFF5E]/g,XDa=/([\uFF73\uFF76-\uFF84\uFF8A-\uFF8E]\uFF9E)|([\uFF8A-\uFF8E]\uFF9F)|([\uFF61-\uFF9F])/g;var YDa=/[ \/(){}&|\"\000]/g;var rdb="#cc0000",DP=[{bgColor:"#f1f5ec",tg:"#006633"},{bgColor:"#dee5f2",tg:"#5a6986"},{bgColor:"#e0ecff",tg:"#206cff"},{bgColor:"#dfe2ff",tg:"#0000cc"},{bgColor:"#e0d5f9",tg:"#5229a3"},{bgColor:"#fde9f4",tg:"#854f61"},{bgColor:"#ffe3e3",tg:rdb},{bgColor:"#fff0e1",tg:"#ec7000"},{bgColor:"#fadcb3",tg:"#b36d00"},{bgColor:"#f3e7b3",tg:"#ab8b00"},{bgColor:"#ffffd4",tg:"#636330"},{bgColor:"#f9ffef",tg:"#64992c"},{bgColor:"#f1f5ec",tg:"#006633"},{bgColor:"#5a6986",tg:"#dee5f2"},{bgColor:"#206cff",tg:"#e0ecff"},
+{bgColor:"#0000cc",tg:"#dfe2ff"},{bgColor:"#5229a3",tg:"#e0d5f9"},{bgColor:"#854f61",tg:"#fde9f4"},{bgColor:rdb,tg:"#ffe3e3"},{bgColor:"#ec7000",tg:"#fff0e1"},{bgColor:"#b36d00",tg:"#fadcb3"},{bgColor:"#ab8b00",tg:"#f3e7b3"},{bgColor:"#636330",tg:"#ffffd4"},{bgColor:"#64992c",tg:"#f9ffef"},{bgColor:"#006633",tg:"#f1f5ec"}];F=ZDa[w];var sdb="#222222";F.PO=function $tt(a){if(a<0)return sdb;else if(a>=DP[u])return DP[0].tg;return DP[a].tg};var EP="#eeeeee";
+F.lK=function $ut(a){if(a<0)return EP;else if(a>=DP[u])return DP[0][jq];return DP[a][jq]};F.X5=function $vt(a){var c=I,d=I;d=a.rga();if(a.Rw()||d<0){c=EP;d=sdb}else if(d>=DP[u]){c=DP[0][jq];d=DP[0].tg}else{c=DP[d][jq];d=DP[d].tg}return{tg:d[Zc](1),bgColor:c[Zc](1)}};F.qcb=function $wt(){return DP};F.icb=function $xt(){return Li(DP,function(a){return a[jq]})};F.JMa=function $yt(){var a=DP[0];return{tg:a.tg[Zc](1),bgColor:a[jq][Zc](1)}};H(aEa,xx);aEa[w].Fga=B();aEa[w].Fga.ic=h;yx(aEa,bEa);F=bEa[w];F.fca=function $At(a,c){var d=0;if(this.rt!=a[1]){this.rt=a[1];d|=2}if(this.lD!=a[2]){this.lD=a[2];d|=4}if(this.mqa!=a[3]){this.mqa=a[3];d|=8;this.esb=i}if(this.EU!=a[4]){this.EU=a[4];d|=16}if(this.Bwa!=a[5]){this.Bwa=a[5];d|=64}if(this.wra!=a[6]){this.wra=a[6];d|=128}var f=a[7]||I;if(this.Yna!=f){this.Yna=f;d|=256}if(this.CDa!=a[8]){this.CDa=a[8];d|=512}a=a[9]||0;if(this.SA!=a){this.SA=a;d|=1024}if(this.Nx!=c){this.Nx=c;d|=32}d&&this.xj(d);return d!=0};va(F,D(LL));F.ea=function $Ct(){return this[pq]()};
+F.Gf=D("Sm");var FP="EU";F.bo=D(FP);F.cjb=D("Bwa");F.Dp=function $Gt(){var a=this.Yna?this.Yna:this.peb();return typeof a==Qe?a>0?String(a):I:a||I};F.CSb=function $Ht(){return this.Bb().Xs()};F.P3=function $It(){return!this.Rw()};F.PO=function $Jt(){return KC(this.V).kr.PO(this.mqa)[Zc](1)};F.lK=function $Kt(){return KC(this.V).kr.lK(this.mqa)[Zc](1)};F.peb=function $Lt(){var a=this.Bb();switch(a&&a.pv?a.pv():0){case 1:return l.max(0,this.rt);case 2:return l.max(0,this.lD);case 0:default:return i}};
+F.rga=D("mqa");F.Nf=D("Sm");var tdb="pV",udb="pW";F.Fga=function $Ot(){switch(this.Bb().Ga()){case fz:return tdb;case sz:return udb;default:return this.aa.Fga(this.Bb().Ga())||i}};F.Bb=function $Pt(){return Uy(this.Jb)};var vdb=" total=",wdb=" unread=";Ha(F,function $Qt(){var a=[this.Nf()];this.lD>=0&&a[p](vdb+this.lD);this.rt>=0&&a[p](wdb+this.rt);return a[kd](I)});F.Rw=function $Rt(){return Mf(this.Jb,Ty)};F.Raa=function $St(a){this.bI=a;this.xj(1)};
+F.xj=function $Tt(a){this.bI&&kya(this.bI,this,a)};H(eEa,uh);var jEa="inbox, star, starred, chat, chats, draft, drafts, sent, sentmail, sent-mail, sent mail, all, allmail, all-mail, all mail, anywhere, archive, spam, bin, read, unread, voicemail, voicemails, mute, muted, important, outbox, buzz"[Cc](/\s*[,\u3001]\s*/),iEa=/^[^^]+$/;eEa[w].Rw=function $Ut(a){return Mf(a,Ty)};var xdb=" Please try another name:";eEa[w].wqd=function $Vt(a,c){return(a=PC(this,a,c))?a+xdb:i};_B_prog(55)}catch(e){_B_err(e)}
+
+try{H(rEa,uh);F=rEa[w];F.qa=0;F.L=function $Wt(){rEa.C.L[z](this);this.Dh=i;this.Q.D();this.poa=this.Q=i};F.xc=D(Yj);F.Oe=Ge(Yj);F.uha=function $Zt(a){a=a[y];jf(this.poa,a);this.Q.hb(a,SC,this.uha);if(a==this.iL&&!(this.qa==1||this.qa==2)){this.qa=1;this[r](eD);this.qa=2;this.iL=i}};H(xEa,uh);xEa[w].sK=function $_t(){var a=[],c=this.yu.Oa();Ff(c,function(d){of(a,d.sK())});return a};H(yEa,N);H(zEa,Jf);zEa[w].L=function $0t(){this.Q.D()};var GP="cut",ydb="copy";zEa[w].XFa=function $1t(a){if(L){this.Q.w(a,GP,this.lUb);this.Q.w(a,ydb,this.lUb)}};var HP="Text";zEa[w].lUb=function $2t(a){var c=Eg(a[y]),d=pm(c);if((c=c[uk]?c[uk][Bk]():i)&&d.clipboardData[Aq](HP,c[jb])){a[zb]();if(a[Zb]==GP)la(c,I)}};H(YC,uh);F=YC[w];F.uha=function $3t(){this.Gk.wb();Ff(this.dRa,function(a){a.D()});Ia(this.dRa,0);this[r](SC);this.D()};F.Teb=function $4t(a){if(!this.OIa){var c=[],d=new BEa(this,c);try{this[r](d)}catch(f){}if(!d.PPb&&c[u])paa(a.pj,c[kd](ch));else!L&&!(Fh&&vg(Im))&&this.uha();if(Jg)if(c[u])return c[kd](ch)}};F.o6a=function $5t(){this.OIa=h;this.uha();this.sC[Xk]()};var zdb="sC";F.Ec=D(zdb);F.B=D(JF);F.L=function $8t(){YC.C.L[z](this);Kf(this.Gk);this.Gk=i};H(BEa,N);F=CEa[w];F.ea=Dy(I);F.Rb=D("Pf");F.Vc=D("Pf");va(F,function $au(){return this.Gf()});F.wi=Ge(LL);F.Gf=D(LL);F.Uo=D("UPa");F.pP=uN;F.SK=uN;F.Jjb=uN;F.I7=uN;F.Lec=Dy(0);F.WPa=uN;F.iXb=uN;F.PRb=Dy(I);F.UMa=Dy(I);F.N_=uN;F.l5a=uN;F.m5a=uN;F.ijc=uN;F.udb=Dy(0);F.JO=Dy(0);F.mXb=uN;F.rSb=Dy(I);F.tSb=Dy(0);F.Kcb=Dy(I);F.HO=Dy([]);F.Yta=E(I);F.tdb=function $fu(){return this.Yta(h)};F.f6=E(i);F=DEa[w];F.Rrb=[];F.tH=function $hu(a){return this.na?this.na.tH(a):EEa(this,a)};F.pBa=function $iu(a,c){if(!this.na)e(Error(".106"));this.na.pBa(a,c)};F.KE=function $ju(a){return this.na.KE(a)};F.Hv=function $ku(a){this.TI.Hv(a)};H(bD,Jf);bD[w].L=function $lu(){bD.C.L[z](this);Ff(this.Kab,function(a){a.D()})};bD[w].tb=function $mu(){if(!this.TWb){Ff(this.Kab,function(a){a.tb(this)},this);this.TWb=h}};bD[w].qo=function $nu(a){this.TWb&&a.tb(this);this.Kab[p](a)};FEa[w].mW=function $ou(a,c,d){Ff(d,function(f){if(c[f])e(Error(".108`"+f));else c[f]=a})};H(lD,gA);F=lD[w];F.hL=h;F.Gpb=function $pu(){this.Q.w(UC(RC(this)),aD,this.Teb)};var Adb="There is currently a request to the server pending. You may lose recent changes by navigating away.",Bdb="There are requests to the server pending. You may lose recent changes by navigating away.";F.Teb=function $qu(a){if(this.OEc)a.PPb=h;else{var c=fy(this).ud;a=a.hj;c.Cuc=h;var d=nIa(c);if(d)if(RLa(c))a[p](d==1?Adb:Bdb)}};
+F.D=function $ru(){if(!this.Pc){var a=this.Ev==this,c=this.Ya();c[r](KH);if(a){c.D();this.va&&!this.E5a&&this.va.D();if(a=this.Wpa)for(;a[u];)a[0].D();Mx().D()}else{a=this.Ev.Wpa;for(c=0;c<a[u];c++)if(a[c]==this){a[jd](c,1);break}}if(this.cEa){this.cEa.D();this.cEa=i}if(this.Q){this.Q.D();this.Q=i}lD.C.D[z](this)}};F.wT=function $su(a){return this.aa.wT(a)};F.eN=function $tu(){return yy(this).nf(EM)};F.NH=function $uu(){return hA(this).hL};yx(REa,lD);
+REa[w].wT=function $vu(a){var c=Ii;im(a)||(c+=NK+a+NK+Rz(this.Db).Sj());return c};REa[w].wT.Vd=h;Ha(SEa[w],function $wu(){return this.O[t]()});SEa[w].kc=D(ae);xD[w].Le=function $yu(){return this.O[0]};xD[w].dha=function $zu(){return this.O[5]};Ha(xD[w],function $Au(){return this.O[t]()});xD[w].kc=D(ae);Ha(TEa[w],function $Cu(){return this.O[t]()});TEa[w].kc=D(ae);UEa[w].l_=function $Eu(){return this.O[2]};UEa[w].vf=function $Fu(){return this.O[4]};Ha(UEa[w],function $Gu(){return this.O[t]()});UEa[w].kc=D(ae);Ha(VEa[w],function $Iu(){return this.O[t]()});VEa[w].kc=D(ae);WEa[w].vf=function $Ku(){return this.O[1]};Ha(WEa[w],function $Lu(){return this.O[t]()});WEa[w].kc=D(ae);Ha(XEa[w],function $Nu(){return this.O[t]()});XEa[w].kc=D(ae);F=ZEa[w];F.Aeb=function $Pu(){return this.O[0]};F.Dd=function $Qu(){return this.O[1]};F.Le=function $Ru(){return this.O[3]};F.Yg=function $Su(){return this.O[5]};fma(F,function $Tu(){return this.O[6]});F.dha=function $Uu(){return this.O[8]};Ha(F,function $Vu(){return this.O[t]()});F.kc=D(ae);F=YEa[w];F.EQb=function $Xu(){return this.O[0]};F.Dd=function $Yu(){return this.O[1]};var IP="aS";F.nMa=D(IP);Ha(F,function $_u(){return this.O[t]()});
+F.kc=D(ae);F=aFa[w];F.Wga=function $1u(){return this.O[1]};F.aeb=function $2u(){return this.O[2]};F.lua=function $3u(){return this.O[3]};Ha(F,function $4u(){return this.O[t]()});F.kc=D(ae);var Cdb=new bFa;bFa[w].vNa=D("ycc");bFa[w].aeb=D("Ccc");bFa[w].lua=D("FXa");F=cFa[w];F.gia=h;F.Sm=I;var JP="RETRY";F.o5=JP;F.Mba=-1;F.Mu=-1;F.Esa=-1;F.NQa=-1;F.wWa=Cdb;F.Gsa=-1;F.Mda=-1;F.C0=0;F.Ne=function $9u(a){yD(this);this.o5=a};F.OW=function $$u(a){yD(this);this.K8b=a};F.wl=function $av(a){yD(this);if(a&&this.QC)e(Error(".110"));this.gia=a};F.bD=function $bv(a){yD(this);this.Lib=a};F.sCa=function $cv(a){yD(this);this.Mba=a};F.c9=function $dv(){this.o5=mB;this.Hn[wc](this,101)};F.vNa=function $ev(){return this.wWa.vNa()};F.Se=function $fv(a){yD(this);this.Sm=a};
+F.Nf=D("Sm");var Ddb=":3";ua(F,function $hv(){if(this.uba)e(Error(".111"));this.Mu=Zf();this.Hn[Mb](this);this.uba=h;if(this.Mba>=0)this.QI=bA(Ddb,this.c9,this.Mba,this)});La(F,function $iv(){if(!this.uba)e(Error(".112"));if(!this[Iq]){this.o5=mB;this.Hn[wc](this)}});F.Aia=function $jv(){return!!this.uba};F.jm=function $kv(){return!!this[Iq]};F.oha=function $lv(){return!!this.uOb};F.zga=D("tOb");var KP="na";F.oM=Ge(KP);F.H=D(KP);ip(F,function $pv(a){return this.Na?this.Na[a]:i});
+F.vPa=function $qv(a,c){this.na&&this.na.rk&&this.na.rk(this,a,c)};F.wPa=function $rv(a){this.na&&this.na.r_&&this.na.r_(this,a)};F.hwa=function $sv(a){this.uOb=h;this.tOb=a;this.Y8()};F.xPa=function $tv(){this.uOb=k;this.tOb=i;this.Mba=-1;this.jHb=k;this.Y8()};F.Y8=function $uv(){ima(this,h);this.Mda=Zf();if(this.QI){cA(this.QI);this.QI=i}this.na&&this.na.Z6&&this.na.Z6(this)};F.oib=function $vv(){return new Sh};F.hYa=function $wv(a){yD(this);if(this.gia)e(Error(".113"));this.QC=a};
+F.QO=function $xv(){var a=this.Bf.vc();this.Ea&&Iy(this.Ea,a);return a};F.uc=function $yv(){return String(this.QO())};F.Ua=function $zv(a,c){gx(this.Bf,a,c)};F.Rc=function $Av(a){return Zh(this.Bf,a)};F.gYa=function $Bv(a){eFa(this,a,k)};F.Be=function $Cv(a,c){if(!this.RC)this.RC=new Wh;Ve(c)||(c=[String(c)]);Hva(this.RC,a,c)};H(fFa,BB);H(zD,cFa);var Edb=new fFa(EB,"CsRequest");F=zD[w];F.rwa=h;F.oib=function $Dv(){return new Sh(Rj)};F.EOc=Ge("rAc");F.Ga=function $Fv(){return Edb};F.zcb=D("wWa");F.vgb=function $Hv(){return this.oha()};F.Ii=function $Iv(a){yD(this);this.Ea=a};F.Bb=D(NO);F.O1=Ge("rwa");F.yIb=function $Lv(){return this.rwa&&!this.xG&&!this.yHb&&!this.QC&&this.Rc(pd)==QN};F.BIb=function $Mv(a){var c=this.Rc(pd);return this.rwa&&!this.xG&&!this.yHb&&!!c&&c!=QN&&Qya(this.Bb(),a.Bb())};
+F.rid=function $Nv(a){if(!a.yIb()||!this.BIb(a))e(Error(".114"));var c=a.Bf.Of();c[Pb](pd);for(var d=c.Sb(),f=0;f<d[u];f++){var g=d[f];this.Ua(g,c.Oa(g))}if(c=a.RC){d=c.Sb();for(f=0;f<d[u];f++){g=d[f];this.Be(g,c.Oa(g))}}this.xG=a;a.yHb=this};F.vPa=function $Ov(a,c){zD.C.vPa[z](this,a,c);this.xG&&this.xG.vPa(a,c)};F.wPa=function $Pv(a){zD.C.wPa[z](this,a);this.xG&&this.xG.wPa(a)};F.hwa=function $Qv(a){zD.C.hwa[z](this,a);this.xG&&this.xG.hwa(a)};F.xPa=function $Rv(){zD.C.xPa[z](this);this.xG&&this.xG.xPa()};_B_prog(56)}catch(e){_B_err(e)}
+
+try{H(AD,IA);F=AD[w];F.rK=function $Sv(a){return this.ia.rK(a)};F.KT=function $Tv(a){return this.ia.KT(a)};F.WZ=function $Uv(a){return this.ia.WZ(a)};F.Sda=function $Vv(a,c){return this.ia.Sda(a,c)};F.Vh=function $Wv(){AD.C.Vh[z](this);var a=this.ia;rA(a);this.W()[o](this.b(),a.b());this.Xk(a)};F.L=function $Xv(){this.wa||this.ia.D();AD.C.L[z](this)};F.RQ=function $Yv(a){AD.C.RQ[z](this,a);this.ia.RQ(a)};F.AI=function $Zv(a,c,d,f){this.ia.AI(a,c,d,f)};F.S1=function $_v(a,c){this.ia.S1(a,c)};
+F.oF=function $0v(a){return LA(this.ia,a)};F.Q3=function $1v(a){return jBa(this.ia,a)};F.VV=function $2v(a){AD.C.VV[z](this,a);kBa(this.ia,a)};F.di=function $3v(a,c,d){var f=!!d,g=this.ia;if(a==vA)if(c==-1&&!d){d=LA(g,a);AD.C.di[z](this,a,d,k)}else{AD.C.di[z](this,a,c,d);f=h}else AD.C.di[z](this,a,-1,d);g.ip(a,c,f)};H(BD,AD);BD[w].B=D(JF);var gFa=i;H(hFa,uh);F=hFa[w];F.P0=i;F.hc=D("UK");F.Gw=D(le);F.L=function $7v(){delete this.xe;jFa(this);oh(this.P0);hFa.C.L[z](this)};F.Rua=function $8v(){if(iFa(this)){jFa(this);oh(this.P0);this.P0=i;this.UK=h;this[r](kFa)}};ya(lFa[w],function $9v(a){a=a[y];for(var c=0;c<this.JV[u];c++)if(this.JV[c]==a){this.JV[jd](c,1);break}a.D();this.JV[u]||this.Li()});var Fdb=":4";Qa(mFa[w],function $$v(a){if(a)this.hD=bA(Fdb,this.wo,a,this);this.PVc=new lFa(this.MOa,G(this.YMc,this),h)});mFa[w].YMc=function $aw(){this.hD&&cA(this.hD);nFa(this,k)};mFa[w].wo=function $bw(){for(var a=this.PVc,c=0;c<a.JV[u];c++)a.JV[c].D();Ia(a.JV,0);nFa(this,h)};var LP="to",MP="bcc",EFa=new Hf({to:LP,cc:Yd,bcc:MP,subject:DO,body:Ym});F=sFa[w];F.fcb=function $cw(a){var c=FD(this).lna[a];delete FD(this).lna[a];return c};F.VNc=function $dw(a){var c=a.IX;ik(c[yc],Ii);var d=mD(hA(this.V));(new Gdb(c,d,h)).tb(a.cq)};F.UNc=function $ew(a){var c=a.IX;ik(c[yc],Ii);var d=mD(hA(this.V));(new Hdb(c,d,h)).tb(a.cq)};F.XNc=function $fw(a){var c=a.IX;ik(c[yc],Ii);var d=mD(hA(this.V));(new Idb(c,d,h)).tb(a.cq)};
+F.Hv=function $gw(a){var c;c=MD(this)?ID(this):JFa(this);Uh(c,a);a=xB(this.V);c=zB(a,c,{width:425,height:480});MD(this)&&ND(this,c,i,this.UNc);return c};F.cUa=function $hw(a,c){if(MD(this))a=ID(this);var d=xB(this.V);a=zB(d,a,{width:430,height:395});MD(this)&&ND(this,a,kP,c);return a};var NP="mailto:",Jdb="$1//$2";
+F.WP=function $iw(a){var c=a[y][Yc];if(a[y][ed]==kC&&c){c=Pf(c);var d=k;if(Mf(c,NP)){c=c[mb](/^(mailto:)([^\/])/,Jdb);c=new Sh(c);var f=c.Of();if(c.DX&&c.u_()){var g=f.Oa(LP);g[ld](c.DX+vh+c.Jk());f.set(LP,g[kd](wj))}AFa(this,k,f)}else{f=KFa(this);if(Awa(c)==f){c=(c=Bwa(c))&&ga(c)||I;(c=qC(this.V).Fp().getElementsByName(c)[Ab](0))&&this.Cb[wq](c,2)}else{f=c;g=KFa(this);if(Bwa(f)&&vwa(f,g)){c=Bwa(c)||I;JB(this.V).SH(c)}else if(Fh&&(a[Bc]||a[dd]))d=h;else xB(this.V).Yo(c,{target:AB},h)}}if(!d){a[zb]();
+a[Ec]()}}};var Kdb="canvas_frame";F.ODc=function $jw(a){var c=vFa(FD(this),a),d=this;pFa(a[yc],[Kdb],function(){if(c.rhb.wE>=0){if(!c.x1b||c.x1b.wE>=0)c.wc[z](d,c)}else c.rhb.ad(c)})};yx(UD,sFa);UD[w].LGa=B();UD[w].LGa.Ka=h;UD[w].B2a=E(k);UD[w].B2a.ic=h;var _GM_ftcb;var Ldb="AD",OP="N",Mdb="February",Ndb="September",Odb="November",Pdb="December",Qdb="Wednesday",Rdb="Thursday",Sdb="Saturday",Tdb="PM",bE={xDb:["BC",Ldb],Lmc:["Before Christ","Anno Domini"],ooc:[KH,cC,XD,kC,XD,KH,KH,kC,YD,ae,OP,TC],Spc:[KH,cC,XD,kC,XD,KH,KH,kC,YD,ae,OP,TC],xca:["January",Mdb,"March","April","May","June","July","August",Ndb,"October",Odb,Pdb],Rpc:["January",Mdb,"March","April","May","June","July","August",Ndb,"October",Odb,Pdb],wEb:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug",
+"Sep","Oct","Nov","Dec"],Upc:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],c2a:["Sunday","Monday","Tuesday",Qdb,Rdb,"Friday",Sdb],Wpc:["Sunday","Monday","Tuesday",Qdb,Rdb,"Friday",Sdb],U1a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Vpc:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],poc:[YD,XD,bM,RF,bM,cC,YD],Tpc:[YD,XD,bM,RF,bM,cC,YD],xEb:["Q1","Q2","Q3","Q4"],dEb:["1st quarter","2nd quarter","3rd quarter","4th quarter"],MCb:["AM",Tdb],soa:["EEEE, MMMM d, y","MMMM d, y",
+"MMM d, y","M/d/yy"],CFa:["h:mm:ss a zzzz","h:mm:ss a z","h:mm:ss a","h:mm a"],PCb:{Md:"M/d",MMMMd:"MMMM d",MMMd:"MMM d"},Xmc:6,REb:[5,6],Ymc:2};MFa[w].Nga=function $mw(a){return this.SAb[TFa(this,a)>0?3:1]};MFa[w].wNa=function $nw(a){return this.SAb[TFa(this,a)>0?2:0]};var Udb=[/^\'(?:[^\']|\'\')*\'/,/^(?:G+|y+|M+|k+|S+|E+|a+|h+|K+|H+|c+|L+|Q+|d+|m+|s+|v+|z+|Z+)/,/^[^\'GyMkSEahKHcLQdmsvzZ]+/],Vdb="''";VD[w].bpa=function $ow(a){for(;a;)for(var c=0;c<Udb[u];++c){var d=a[Kb](Udb[c]);if(d){d=d[0];a=a[Zc](d[u]);if(c==0)if(d==Vdb)d=Ox;else{d=d[Zc](1,d[u]-1);d=d[mb](/\'\'/,Ox)}this.ap[p]({text:d,type:c});break}}};VD[w].RGa=function $pw(a){if(a<4)a=bE.soa[a];else if(a<8)a=bE.CFa[a-4];else if(a<12)a=bE.soa[a-8]+J+bE.CFa[a-8];else{this.RGa(10);return}this.bpa(a)};
+VD[w].Hbb=function $qw(a,c){c=c[Gq]();return a>=4?bE.c2a[c]:bE.U1a[c]};var WFa=new VD(7),YFa=new VD(3);new VD(2);var Wdb=new VD(1);new VD(9);new VD(0);var Xdb="EEEE",Ydb=new VD(Xdb),XFa=new VD("MMM d"),Zdb=new VD("EEE, MMM d, yyyy 'at' h:mm a");var PP="ud",xE=new CB(EB,PP);H(eE,SA);F=eE[w];F.L=function $rw(){this.n4=i;eE.C.L[z](this)};F.Q3=function $sw(a){return a==Wx};F.VV=function $tw(a){MA(this,a,-1)};F.oF=function $uw(a){if(a==vA)return this.n4(this);MA(this,a,-1);return this.b()[ql]};F.di=function $vw(a,c,d){if(a==vA){c==-1&&!d?eE.C.di[z](this,a,LA(this,a),k):eE.C.di[z](this,a,c,d);this.qe(Wx)}else eE.C.di[z](this,a,c,d)};F.xb=function $ww(a){this[bc]();Q(this.b(),a);this.qe()};F.ha=function $xw(a){this.Xk(a)};F.Jf=function $yw(a,c){RAa(this,a,c)};
+lk(F,function $zw(a){return sA(this,a)});F.Vp=function $Aw(a){return tA(this,a)};Aa(F,function $Bw(){this.DJb()});var dGa,bGa;H(sE,BD);sE[w].wN=[];sE[w].MJ=-1;sE[w].Nm=h;var QGa=0,aeb=/<span cliptip=1>(.*)<\/span>/i;F=sE[w];var beb="mq";F.Jc=function $Cw(){var a=this.ia;K(a.b(),beb);var c={pMc:this.X(Kd),phb:this.X(Ph),PMc:this.X(dx),IMc:this.X(Pd)};Q(a.b(),AGa(c));a.qe(Wx)};
+F.ma=function $Dw(){sE.C.ma[z](this);this.M9a=this.b(Kd);this.Y4=this.b(Ph);this.bsa=this.b(dx);this.aLa=this.b(Pd);this.H().w(this.bsa,Xi,this.aOa);this.H().w(this.aLa,Xi,this.aOa);this.H().w(this.bsa,Yi,this.aOa);this.H().w(this.aLa,Yi,this.aOa);this.H().w(this.b(),P,this.He)};F.Ba=function $Ew(){sE.C.Ba[z](this);this.H().wb()};F.D=function $Fw(){this.aLa=this.bsa=this.Y4=this.M9a=i;sE.C.D[z](this)};F.wL=function $Gw(a){this.QFa=a;QGa++};
+var ceb="fn",QP='<a class="',deb="About these ads",eeb='</a>&nbsp;<span class="',feb="B9kNyc",geb="updated",RP=' dir="',heb=' <span dir="',SP="ltr",ieb='">- <a dir="ltr" class="mr" href="',jeb="</a> -</span> ",keb="<span",leb=" &bull; ";
+F.C1c=function $Hw(a){var c=a.Pg&&a.Pg[hq](ceb),d=k,f=this.xl.Y2a;Ia(this.wN,this.MJ+1);a=new XEa(a[dq]);var g=a.jQb;if(g){d=AHa(this.xl);var j=g.Dd();if(f.pMa()){j={url:f.pMa()};f=new U;f[R](QP,Rd,qE,j.url,W,deb,eeb,feb,W,geb,gB);j=f[t]()}g=g.nMa();if(f=g.O[6])var n=!!(f&1),s=!!(f&2),v=!!(f&4);n={title:g.Le(),FA:g.O[1],Vw:g.O[2],WAa:g.O[3],sca:g.O[4],ZDa:n,a0:s,b0:v};s=new U;s[R](QP,Rd,qE,n.WAa,Vf,n.ZDa?RP+V(Zm)+Zd:I,Uf,n[Pk],hB,n.sca?heb+V(SP)+ieb+n.WAa+W+n.sca+jeb:I,n.FA?keb+(n.a0?RP+V(Zm)+Vf:
+I)+Uf+n.FA+gB+(n.Vw?(n.a0!=n.b0?leb:MH)+keb+(n.b0?RP+V(Zm)+Vf:I)+Uf+n.Vw+gB:I):I);n=s[t]();d=new VGa(IE,j,n,i,g.dha(),d);this.wN[p](d);d=h}a=a.lkc;for(s=0;s<a[u];s++){d=a[s];v=d.Aeb();n=IGa({source:d.O[2],title:d.Le(),PH:d.O[4],description:d.Yg(),Ob:d[hc]()?UGa(this,d[hc]()):I,Utb:d.O[7]});if(v==Fz)if(n[Kb](aeb))n=n[mb](aeb,JGa({id:this.X(Rd),ke:xwa}));d=new VGa(v,d.Dd(),n,i,i,i);this.wN[p](d);d=h}if(this.wN[u]>50){a=this.wN[u]-50;this.wN[jd](0,a);this.MJ-=a}if(c&&this.xec){c=this.MJ+(d?1:0);KGa(this,
+c)}else if(!c){c=this.MJ+1;KGa(this,c);dE(this.B()).jj(meb,this.wN[c].mic)}};F.di=function $Iw(a,c,d){sE.C.di[z](this,a,c,d);a==vA&&this.MJ>=0&&NGa(this)};F.aOa=function $Jw(a){var c=a[y];if(!Bg(c,uE))switch(a[Zb]){case Xi:m(c,CO);break;case Yi:m(c,lE);break}};var neb="webclips";
+F.He=function $Kw(a){if(a[y].id==this.X(Rd)){dE(this.B()).pb(oeb);this.jb[bq]({view:dJ,fk:neb})}else if(a[y]==this.bsa){this.MJ>0&&KGa(this,this.MJ-1);dE(this.B()).pb(peb)}else if(a[y]==this.aLa){KGa(this,this.MJ+1,h);dE(this.B()).pb(qeb)}else if(a[y][Yc]){var c=this.wN[this.MJ];dE(this.B()).jj(reb,c.mic);this.Lh.WP(a);if(c.yo){a=zg(a[y]);var d;if(a[u]>0)if(a[0]==Rd)d=IB;else if(a[0]==iO)d=Cz;uHa(c.yo,kD,0,d,Zf()-c.TDa)}}};_B_prog(57)}catch(e){_B_err(e)}
+
+try{var YGa={};F=WGa[w];F.Bea=function $Lw(a){return a[Xc](0)==32?a[nc](1):a};F.add=function $Mw(a){this.ee[XGa(this,a)]=i};Aa(F,function $Nw(){this.ee={}});F.vc=function $Ow(){var a=new WGa;for(var c in this.ee)if(this.ee[Kc](c))a.ee[c]=i;return a};Sa(F,function $Pw(a){return this.ee[Kc](XGa(this,a))});F.Qc=function $Qw(a){return this.mQa(a)&&a.mQa(this)};F.forEach=function $Rw(a,c){for(var d in this.ee)this.ee[Kc](d)&&a[z](c,this.Bea(d),undefined,this)};
+F.Nb=function $Sw(){var a=0;for(var c in this.ee)this.ee[Kc](c)&&a++;return a};F.Oa=function $Tw(){var a=[];for(var c in this.ee)this.ee[Kc](c)&&a[p](this.Bea(c));return a};F.nd=function $Uw(){for(var a in this.ee)if(this.ee[Kc](a))return k;return h};F.mQa=function $Vw(a){for(var c in this.ee)if(!a.ee[Kc](c)&&this.ee[Kc](c))return k;return h};wa(F,function $Ww(a){a=XGa(this,a);if(this.ee[Kc](a)){delete this.ee[a];return h}return k});F.mG=function $Xw(){return em(this.Oa())};F=ZGa[w];F.Odb=function $Yw(){return this.O[1]};F.Ndb=function $Zw(){return this.O[2]};F.Pdb=function $_w(){return this.O[3]};F.pMa=function $0w(){return this.O[4]};Ha(F,function $1w(){return this.O[t]()});F.kc=D(ae);H(cHa,Kx);F=cHa[w];var seb="rtis",teb="rtes",ueb="rus",veb="alpl";F.eYc=function $3w(a){a=new ZGa(a[dq]);this.Fa(seb,a.Odb());this.Fa(teb,a.Ndb());this.Fa(ueb,a.Pdb());this.Fa(veb,a.pMa())};F.Odb=function $4w(){return this.Ca(seb)};F.Ndb=function $5w(){return this.Ca(teb)};F.Pdb=function $6w(){return this.Ca(ueb)};F.pMa=function $7w(){return this.Ca(veb)};H(zE,BB);dHa[w].fjb=h;var web=AE(oy),DHa=AE(Hz),nHa=AE(kD),mHa=AE(IB),xeb=AE(UE),yeb=AE(TE),rHa=AE(Bz),TP="nr",pHa=AE(TP),sHa=AE(aP),qHa=AE(rO),UP="ds",tHa=AE(UP),vHa=AE(RO),wHa=AE(Uz);H(CE,xx);CE[w].tb=B();CE[w].tb.Ka=h;CE[w].e4a=B();CE[w].e4a.Ka=h;H(HE,kn);yx(CE,HE);HE[w].gYc=function $$w(a){a=new UEa(a[dq]);var c=i,d=a.l_(),f=a.O[3],g=a.vf();f=xHa(d,g,f);if(d==OD)c=JE(this,f);if(c==i||c.mKa!=i)c=GHa(this,f,d);c.Z2a=a.O[1];c.qhc=Zf();CHa(this,c)};HE[w].scc=function $ax(a){a.X0a=G(this.igb,this,a);this.w(this.ob,Hh,a.X0a);this.ob[Mb](String(a.uri),zj)};
+var zeb="Parsed response empty",Aeb="Xhr parse error(",Beb="):",Ceb="ads",Deb="ati",Eeb="aor",VP="ch",WP="ci",XP="rv",Feb="ats",Geb="XHR response was not an array",Heb="Xhr connection error:",Ieb=":6";
+HE[w].igb=function $bx(a){this.hb(this.ob,Hh,a.X0a);a.X0a=i;if(this.ob.ye()){var c=this.ob.dj(),d;if(sx(c))a.ZX=zeb;else{var f=c[Zc](c[Db](ch));try{d=ix(f)}catch(g){a.ZX=Aeb+g+Beb+c}}if(d)if(Ve(d)){c=d[0];for(var j,n,s=0;s<c[u];s++){d=c[s];f=d[0];if(f==rE)j=new XEa(d);else if(f==Ceb)n=new SEa(d)}var v=0,C=0;d=f=0;if(j)if(j=j.jQb)if(j.nMa().dha())C++;else v++;if(n){n=n.aS;for(s=0;s<n[u];s++)if(n[s].dha())d++;else f++}n=v;j=C;f=f;d=d;if(a.uA!=1)e(Error(".118`"+a.uA));a.uA=3;BE(a.Xv,n+j+f+d>0?yeb:xeb,
+GE(a));oHa(a,kD,n,j);oHa(a,RE,f,d);for(n=0;n<c[u];n++){j=c[n];d=j[0];f=i;if(d==Deb){a.Nzb=new WEa(j);if(a.ER==DE||a.ER==EE)a.Am=a.Nzb.vf()}else if(d==rE){a.jFc=new XEa(j);f=new Ex(i,d,j)}else if(d==Eeb){a.rac=new VEa(j);f=new Ex(i,d,j)}else if(d==VP)f=new Ex(i,d,j);else if(d==Ceb)a.vGa=new SEa(j);else if(d==WP){a.QJb=j;f=new Ex(i,d,j)}else if(d==JD){a.Nxc=j;f=new Ex(i,d,j)}else if(d==XP)f=new Ex(i,d,j);else if(d==Feb)f=new Ex(i,d,j);f&&this.xf.ud[r](f)}}else{a.ZX=Geb;lHa(a,this.ob.eo==8)}else lHa(a,
+this.ob.eo==8)}else{a.ZX=Heb+this.ob.Kga();lHa(a,this.ob.eo==8)}if(!this.ob.Eb()){a.p8a&&a.mKa==i&&this.TTb(a);(a=JE(this,this.UFa.pop()))&&bA(Ieb,G(this.scc,this,a),0)}};HE[w].TTb=function $cx(a){a.p8a(a);a.mKa=h};H(HHa,Jf);var YP="name",PHa=["description","fileName","lineNumber",eg,YP,"stack"],Jeb=Qj+"&view=jr&type=p&jsid="+Ufa;F=HHa[w];F.pwb=Ge(JF);F.tRb=function $ex(){return ti};var Keb="log-message";F.Wva=function $fx(a,c,d,f){a.r=c;a.email=Hi;a.ua=bp[Fc];a.build=Ei;a.jsver=d;a.jsm=Wla;a.t=String(new Date);if(f)a[Keb]=f};F.X0b=B();F.yI=function $hx(a,c){if(a!=this.ERc){this.Ihd(OHa(this,a,c));this.ERc=a}};
+F.Ihd=function $ix(a){try{if(this.Lya>0)a.unsent=this.Lya;var c=Zf();if(c-this.mxa<6E4||this.ob.Eb()?h:k){this.Lya++;return k}this.mxa=c;if(a.jsver==ti)oaa(a,Gba(arguments[Hc][Jc]));var d=new U;Ef(a,function(j,n){try{d[R](Qf(n),ei,Qf(j),Sf)}catch(s){}});var f=d[t]();this.s1b()&&this.q1b(f);if(!bp[uma])return this.lmb();this.ob[Mb](Jeb,Aj,f);this.Lya=0;return h}catch(g){return k}};F.ZRa=B();F.s1b=E(k);F.q1b=B();F.lmb=E(k);F.L=function $nx(){HHa.C.L[z](this);if(this.Q){this.Q.D();this.Q=i}};
+var ME=new HHa;tg.Qla=ME;(function(b){if(b.Dla){Ff(b.Dla,function(a){this.Qla.yI(a[1],a[0])},b);b.Dla=i}})(tg);var SHa={};Pp(QHa[w],function $ox(){Ia(this.eO,0);Ia(this.hDa,0)});LE[w].pjc=0;var Leb={};F=LE[w];F.pQb=D(WE);F.Ujb=function $qx(){return this.xqa.Ujb(this,NBa(this.C3a.sK()))};F.Yg=function $rx(){return Leb[this.mg]||this.mg.lC()};F.Sid=Ge("Gld");Qa(F,function $tx(){var a=this.xqa.qQb();a&&this.Sid(a)});F.wid=Ge("WCc");F.NFc=D("pDc");F.MGc=D("gAb");F.VX=function $xx(a){this.pjc+=a};F.lua=D("FXa");F.Hz=function $zx(a,c){if(WHa(this,a,8)){if(!this.Uxa)this.Uxa=new Hf;this.Uxa.set(a,c)}};
+F.ZOa=function $Ax(a,c){if(this.Uxa){var d=this.Uxa.J(a)||0;this.Hz(a,d+c)}else this.Hz(a,c)};F.Foa=function $Bx(a,c){if(WHa(this,a,8))if(WHa(this,c,30)){if(!this.amb)this.amb=new Hf;this.amb.set(a,c)}};dIa[w].PG=0;dIa[w].JA=0;dIa[w].jz=0;F=eIa[w];F.xfa=0;F.PG=0;F.JA=0;F.jz=0;F.qHa=0;F.add=function $Cx(a){this.Xyb[p](a);this.xfa+=a.rh==0;this.PG+=a.PG;this.JA+=a.JA;this.jz+=a.jz;if(a.qHa>0)this.qHa+=a.qHa};F=fIa[w];F.Mba=1E4;F.yx=k;F.vfd=0;F.J3a=0;F.T7b=0;F.QI=i;F.U0=i;naa(F,Ge("Mba"));var ZP="Bf";F.QO=D(ZP);F.sYa=Ge(ZP);var Meb="yx";F.Rwa=D(Meb);Qa(F,function $Hx(){if(this.yx)e(Error(".124"));this.yx=h;this.J3a=0;hIa(this)});Ga(F,function $Ix(){iIa(this);this.yx=k});F.zTa=function $Jx(){this.tza(h)};F.XP=function $Kx(){this.tza(k)};F.d2c=function $Lx(){this.tza(k)};F.e2c=function $Mx(){this.tza(k)};
+F.tza=function $Nx(a){iIa(this);if(a){this.yx=k;this.Li[z](this.na,h)}else if(this.J3a<=this.vfd)if(this.T7b)this.U0=Dh(this.Q4c,this.T7b,this);else hIa(this);else{this.yx=k;this.Li[z](this.na,k)}};F.Q4c=function $Ox(){this.U0=i;hIa(this)};_B_prog(58)}catch(e){_B_err(e)}
+
+try{H(jIa,uh);jIa[w].zZb=0;jIa[w].u0=h;jIa[w].Wpb=function $Px(a){this.zZb=Zf();this.u0=a;this[r](ZD)};H(YE,uh);YE[w].Ggb=3E4;YE[w].Gwc=6E4;YE[w].Mw=i;YE[w].qG=0;var Neb=/var gmail_error\s*=\s*(\d+)/m,Oeb=/var rc\s*=\s*(\d+)/m;F=YE[w];F.QSa=-1;F.N8=0;var Peb="READY";F.qa=Peb;F.Sja=0;F.yya=0;F.D=function $Qx(){if(!this.Pc){YE.C.D[z](this);this.zu[bc]();xIa(this)}for(var a=0;a<this.pEa[u];a++)this.pEa[a].D();this.Q.D()};ua(F,function $Rx(a){this.zu.MG(a);this.Plb(h)});F.xc=D(Yj);F.P5=D(XI);F.w6=D("Sja");F.f2a=function $Vx(){this.YR&&this.YR[wc](this.qG)};La(F,function $Wx(a,c){this.i3(a,c)});
+F.i3=function $Xx(a,c){a.uc();c=Ke(c)?c:100;if(a==this.ld){this.qG=c;this.f2a()}else this.zu[Pb](a)&&a.hwa(new nB(a,c))};F.jNa=function $Yx(){var a=this.zu.Oa();this.ld&&a[ld](this.ld);return a};F.MUb=E(h);F.NRb=Ee();F.D2a=function $0x(){if(!this.Loa.nd())for(var a=this.Loa.Sb(),c=0;c<a[u];c++){var d=a[c],f=this.Loa.J(d);this.ld.Ua(d,f);this.Loa[Pb](d)}};var Qeb=":7";
+F.GAb=function $1x(){try{this.ld.uc();this.qG=0;for(var a,c=0,d=i,f=0;f<this.pEa[u];f++){var g=this.pEa[f],j=g.wma(this.ld);if(j>=c){c=j;d=g}}a=d;if(!a)e(Error(".125`"+this.ld));this.YR=a;this.Vka=i;this.YR.yna(this.ld);if(!this.Mw)this.Mw=bA(Qeb,this.V4b,this.Ggb,this)}catch(n){e(n)}};var Reb="WAITING_FOR_READY",Seb="WAITING_FOR_RETRY";
+F.EG=function $2x(a){switch(a){case Peb:case Reb:if(this.ld)e(Error(".126`"+a));break;case ZE:case Seb:case vIa:if(!this.ld)e(Error(".127`"+a));break}if(a!=this.qa){this.qa=a;this[r](XD);this.xOb&&JKa(this.xOb)}};F.Plb=function $3x(a){if(this.qa==Peb){var c=this.zu.hQ();if(c)if(this.MUb(a,c)){this.zu.ly();this.ld=this.NRb(c);pIa(this)}}};var aQ="di";
+F.cIc=function $4x(a){for(var c=0;c<a[u];c++){var d=a[c];this.N8++;var f=d[0];if(!this.kmb(f,d)){this.MAa[p](d);this.N8==1&&rIa(this,d);if(f==aQ)tIa(this,d);else if(f==Rd){this.UNa(d);this.uVa()}}}};F.qfb=function $5x(a){this.N8++;var c=a[0];if(this.ala){cA(this.ala);this.ala=0}if(!this.kmb(c,a)){this.MAa[p](a);this.N8==1&&rIa(this,a);if(c==aQ)tIa(this,a);else if(c==Rd){this.UNa(a);this.uVa()}else this.ala=bA(Qeb,this.uVa,50,this)}};F.kmb=E(k);F.UNa=function $7x(a){this.QSa=a[1]};
+F.uVa=function $8x(){if(this.ala){cA(this.ala);this.ala=0}if(this.MAa[u]){var a=this.ld,c=this.MAa;this.MAa=[];this.b1(a,c)}};var Teb=";6";F.b1=function $9x(a,c){if(!this.Vka)try{for(var d=0;d<c[u];d++){var f=c[d],g=f[0];this[r](new Ex(a,g,f,h))}a&&a.wPa(c);for(d=0;d<c[u];d++){f=c[d];g=f[0];a&&a.vPa(g,f);this[r](new Ex(a,g,f))}}catch(j){rg(tg,Teb,j);this.Vka=j}};F.ZFb=function $$x(){return this.N8==this.QSa};var Ueb="N8";F.rGc=D(Ueb);F.qGc=D("QSa");
+F.WH=function $cy(){if(this.Vka||!this.ZFb()){var a;if(this.Vka)a=new nB(this.ld,12,h);else{var c=this.ld;a=new nB(c,103,k,c.C0);c.Ua(ava,1);this.NCc&&BIa(this)}this.OTa(a);return k}if(this.qa!=ZE)e(Error(".128"));this.ld.uc();this.ld.xPa();this.KS=this.ld=i;lIa(this,1E3);this.EG(Reb);return h};F.eec=function $dy(a){return!a.vW};
+F.OTa=function $ey(a){a.hm();if(this.qa!=ZE)e(Error(".129"));this.ld.uc();var c=this.ld;c.Gsa=-1;c.wWa=Cdb;if(this.eec(a)){c=this.ld;this.ld=this.KS=i;c.hwa(a);a=Reb}else{this.KS=a;a=Seb}this.EG(a)};F.Hod=function $fy(){xIa(this);switch(this.qa){case Reb:this.EG(Peb);this.Plb(k);break;case Seb:this.Sja=Zf()+this.yya;this.EG(vIa);this.Lv=bA(Qeb,this.xqb,this.yya,this);lIa(this,2*this.yya);break;default:e(Error(".130`"+this.qa))}};F.xqb=function $gy(){this.Lv=0;this.qa==vIa&&pIa(this)};
+F.V4b=function $hy(){this.Mw=bA(Qeb,this.V4b,this.Ggb,this);this.CIa()};F.CIa=function $iy(){if(!(!this.ld||this.ld.Ayb))if(this.Fv){var a=Zf(),c=this.ld.NQa;if(c>-1&&a-c>this.Gwc)kIa(this.Fv)||this.Fv.u0||this.i3(this.ld,1)}};H(CIa,N);H(DIa,uh);F=DIa[w];F.D=function $jy(){DIa.C.D[z](this);this.Q.D();EIa(this)};F.Ox=function $ky(a,c,d,f,g){var j=this.Tn;EIa(this);mDa(lC(d),h);Mea[Rc]();j=this.Tn=new LE(a,c,d,f);this.hFb=i;UHa(j.TR,xC,g);FIa(this);j[Rc]();a.b3a(j);this[r](new CIa(OP,j));return j};F.s5a=function $ly(){var a=this.Tn;if(a){UHa(this.Tn.TR,tP);Mea[qc]();this.ukb=this.hFb=this.Tn=undefined;EIa(this);this[r](new CIa(Xd,a))}};var Veb=":8";F.pEc=function $my(){if(!this.Csa)this.Csa=bA(Veb,this.m1c,20,this)};var Web="FAILED";
+F.m1c=function $ny(){this.Csa=i;var a=this.Tn;if(a){a.xqa.BHb(a);if(!this.rPb){this.rPb=h;a.IPc=h}var c=a.xqa.qQb();c&&a.wid(c);UHa(a.TR,Jd);Mea[qc]();c=a.TR.eO;if(c[u]<2)c=k;else{var d=a.TR.hDa;a.gAb=i;a.hDa=d;a.Mu=c[0].sR;a.d5=c[c[u]-1].sR;a.BAb=a.d5-a.Mu-a.pjc;c=a.fFb;d=a.eid=[];for(var f=a.FXa=[],g=a.jDa=new eIa,j=a.kDa=new eIa,n=0;n<c[u];n++){var s=c[n];if(s.Gsa!=-1?s.Gsa>a.Mu&&s.Mda<=a.d5:s.Mda!=-1&&s.Mda>a.Mu&&s.Mda<=a.d5){var v=new dIa(s,a.Mu);s.rAc<a.Mu?g.add(v):j.add(v);if(s.vgb()){d[p](Web);
+f[p](Web)}else{s=s.zcb();d[p](s.aeb()||me);f[p](s.lua()||me)}}}a.xod=g.PG+g.JA+g.jz+j.PG+j.JA+j.jz;c=a.bod=h}c&&this.OUa[p](bIa(a));this.CP=a;this.ukb=this.hFb=this.Tn=undefined;mDa(lC(this.V),k);Mx().Kh(151,a);this[r](new CIa(ae,a))}};F.gqb=function $oy(){this.Tn&&this.Tn.Ujb()&&this.pEc()};F.qia=function $py(){return!!this.Tn};F.Hz=function $qy(a,c){this.Tn&&this.Tn.Hz(a,c)};F.ZOa=function $ry(a,c){this.Tn&&this.Tn.ZOa(a,c)};F.Foa=function $sy(a,c){this.Tn&&this.Tn.Foa(a,c)};
+F.VX=function $ty(a){this.Tn&&this.Tn.VX(a)};F.VJc=function $uy(){FIa(this)};F.Bdd=function $vy(a){if(this.Tn){this.Tn.fFb[p](a);return h}return k};H(IIa,Jf);IIa[w].L=function $wy(){this.zCa[bc]()};H(bF,uh);var Xeb={3:13,8:10,13:13,27:27,46:127};bF[w].pZb=0;bF[w].L=function $xy(){this.Q.D();Ff(this.JU,function(a){a.D()})};bF[w].XFa=function $yy(a){a=new hn(a);this.Q.w(a,jn,this.KC);this.JU[p](a)};
+bF[w].KC=function $zy(a){var c;a:{var d=a[Sb];if(a[Bc]||a[Eb]||a[rc]&&!a[dd]||d==16||d==18)c=k;else{try{for(var f=a[y];f;f=f[A]){var g;var j=f,n=j[Gb],s=d==13||Jg&&d==3,v=s?Bf(zg(j)):undefined;g=d==27?k:s&&(n==kC||v[yI]||v[xo]||v.toxOdd)||n==oo&&(j[Zb]!=XF||d==32)||n==ym||n==Fka||n==KG;if(g){c=k;break a}}}catch(C){}c=h}}if(c){Fh&&this.eBa.Hxb[String[rq](a[Ob])]&&a[zb]();c=Zf();if(c-this.pZb>1E3)this.cL=I;this.pZb=c;if(c=a[Ob]>0?a[Ob]:Xeb[a[Sb]]){c=String[rq](c);this.cL+=a[dd]?c[pl]():c[od]();for(d=
+0;d<this.cL[u];d++){f=this.cL[nc](d);(c=this.eBa.zCa.J(f)||i)||(c=this.eBa.zCa.J(f[od]())||i);if(c&&(!a.repeat||c.Ied)){d=new N(aE,this);d.jna=c.jna;d.ZH=a;this[r](d);a[zb]();this.cL=I;break}}}}};H(KIa,Jf);F=KIa[w];F.Y8c=function $Ay(a){a=a.f0a;if(a==this.Tn){this.CP=a;this.Tn=i}};F.X8c=function $By(a){if(a.f0a==this.Tn)this.Tn=i};F.ZG=D("Tn");var Yeb="CP";F.Ita=D(Yeb);F.L=function $Ey(){this.na.D()};H(cF,IA);H(dF,IA);F=dF[w];F.RQ=function $Fy(a){dF.C.RQ[z](this,a);for(var c=this.Uc(),d=0;d<c[u];d++)c[d].RQ(a)};F.ha=function $Gy(a){this.Jf(a,this.qj())};F.Jf=function $Hy(a,c){this.Lca([a],c)};F.Lca=function $Iy(a,c){var d=this.qj();if(a[u]&&c>=0&&c<=d){rA(this);yA++;try{var f=wBa(this);for(d=0;d<a[u];d++){var g=c+d,j=a[d];rA(j);(f||!j.Fj())&&j.Yb();this.bia(j,g);j.RQ(this.Yj);RAa(this,j,g)}j.Fj()&&this.Ui()}finally{zA()}}};
+F.bia=function $Jy(a,c){if(c==this.qj())this.W()[o](this.b(),a.b());else{var d=this.b();d[Bb](a.b(),d[cc][c])}};F.Vp=function $Ky(a){var c=this.rb(a),d=tA(this,a);if(d){var f=c.Fj();c.RQ(i);this.jBa(c,a);f&&this.Ui()}return d};lk(F,function $Ly(a){if(!this.bf)return k;yA++;try{return this.Vp(ff(this.bf,a))}finally{zA()}});Aa(F,function $My(){yA++;try{for(;this.Vp(0););}finally{zA()}});F.jBa=function $Ny(a){Sg(a.b())};_B_prog(59)}catch(e){_B_err(e)}
+
+try{H(fF,dF);F=fF[w];F.oF=function $Oy(a){for(var c=this.qj(),d=0,f=0;f<c;f++){var g=this.rb(f),j=g.KT(a),n=g.WZ(a),s=g.rK(a),v=JA(g,a);switch(s){case 0:d+=j;break;case -1:g=LA(g,a);if(!v){g=l.max(g,j);g=l.min(g,n)}d+=g;break;default:d+=j;break}}return d};F.Q3=function $Py(a){if(a==vA)return k;else{for(var c=this.qj(),d=0;d<c;d++){var f=this.rb(d);if(!JA(f,a)||!jBa(f,a))return k}return h}};F.VV=function $Qy(a){for(var c=this.qj(),d=0;d<c;d++)kBa(this.rb(d),a);MA(this,a,-1)};
+F.di=function $Ry(a,c,d){this.wX(a,c,d);this.Hpa(a,c);this.J2(a,c,BA[a])};F.wX=function $Sy(a,c,d){a==vA&&c==-1?fF.C.di[z](this,a,LA(this,a),k):fF.C.di[z](this,a,c,d)};F.Hpa=function $Ty(a,c){this.qj()&&rBa(a,c,this.Uc(),a==this.yjc)};F.J2=function $Uy(a,c,d){var f=this.qj();if(f)for(var g=0;g<f;g++){var j=this.rb(g),n=d[j.ea()];j.ip(a,n,this.hjc(a,c,j,n))}};F.hjc=function $Vy(a,c,d,f){return this.yjc==Wx&&a==vA&&f==c};H(gF,fF);F=gF[w];F.LEa=wB;F.jAc=wB;F.Vh=function $Wy(){gF.C.Vh[z](this);var a=this.wa;if(this.Igc){this.rq=this.W()[Qb](T);m(this.rq,Ldb);this.vN=this.rq[x];this.W()[o](a,this.rq)}else{this.rq=a;this.vN=this.cLa}};F.L=function $Xy(){this.vN=this.rq=i;gF.C.L[z](this)};F.wX=function $Yy(a,c,d){gF.C.wX[z](this,a,c,d);if(this.jAc!=this.LEa){Ja(this.cLa,this.LEa==wB?I:ee);Ja(this.vN,this.LEa==wB?I:sd)}};var Zeb="I8";
+F.bia=function $Zy(a,c){var d=a.b();if(mfa.J()){d=this.W()[Qb](T);m(d,Zeb);Q(d,MH);if(c==this.qj()){this.rq[o](d);this.rq[o](a.b())}else{c=this.rq[cc][c*2];this.rq[Bb](d,c);this.rq[Bb](a.b(),c)}}else c==this.qj()?this.rq[o](d):this.rq[Bb](d,this.rq[cc][c])};F.jBa=function $_y(a){mfa.J()&&Sg(a.b()[pc]);Sg(a.b())};H(NIa,uh);H(WIa,uh);H(XIa,N);WIa[w].lka=function $0y(a){a[Zb]==Bz&&ZIa(this,a[y]);this[r](new XIa(a[Zb],a[y]))};WIa[w].L=function $1y(){Kf(this.Q);this.Q=i};H(lF,pB);F=lF[w];F.Zg=E("Save settings");F.Eg=E(h);F.Yc=function $4y(a,c){this.XA.set(a,c)};F.Wd=D("Kv");var afb="p_",bfb="dp";F.Ja=function $6y(a){for(var c=new Hf,d=this.XA.Sb(),f=[],g=0;g<d[u];g++){var j=d[g],n=this.XA.J(j);n==dM&&Ye(n)?f[p](j):c.set(afb+j,n);j==gN&&this.Z[hq](d8a)&&a.Ua(LD,Fi)}f[u]>0&&c.set(bfb,f);lF.C.Ja[z](this,a);dFa(a,c);a.Ne(mB);a.wl(!!this.bh)};H(mF,uh);Nx(Mx(),48,function(b){return new mF(b)},0);F=mF[w];F.rR=i;var cfb="reload";F.YLa=function $7y(){this.pQ=cfb;bJa(this)};F.N7c=function $8y(){this[r](YD);this.pQ=this.dX.x4};F.il=function $9y(){return this.dX.il()};F.Xld=function $$y(a){a=a[dq][1];nh(this.xf.ud,Gx(NE),i,k,this);if(a!=this.pQ){this.pQ=a;bJa(this)}};F.wh=B();F.txb=Ge("QDa");F.D=function $cz(){this.dX.D();if(this.rR){this.rR[Rq]||this.rR[Xk]();this.rR=i}mF.C.D[z](this)};H(pF,Jf);pF[w].L=function $dz(){this.wg&&Sg(this.wg);this.dE=this.wg=i};pF[w].gp=function $ez(a){var c=qF(this);if(uca in c)c.textContent=a;else{for(;c[nha]();)c[Nc](c[Tb]);c[o](this.dE[yb](a))}};H(rF,fF);rF[w].PNa=sw;rF[w].nIb=-1;rF[w].mIb=I;var dfb=L||Fh&&!vg(vDa);F=rF[w];F.Vh=function $fz(){rF.C.Vh[z](this);var a=this.wa;this.rq=this.W().ba(T,{className:yP});this.vN=this.rq[x];this.D5=this.W()[Qb](T);m(this.D5,zF);this.W()[o](a,this.rq);this.W()[o](a,this.D5)};F.L=function $gz(){this.D5=this.vN=this.rq=i;rF.C.L[z](this)};F.wX=function $hz(a,c,d){rF.C.wX[z](this,a,c,d&&(!dfb||this.PNa==sw));a=this.PNa==sw?I:yE;if(this.mIb!=a){this.mIb=a;if(L)this.vN.styleFloat=a;else this.vN.cssFloat=a}};
+F.J2=function $iz(a,c,d){var f=this.qj();if(f){if(a==vA){for(var g=0,j=0;j<f;j++)g+=d[this.rb(j).ea()];f=g<=c?-1:g;if(this.nIb!=f){this.nIb=f;ka(this.vN,NA(f))}}rF.C.J2[z](this,a,c,d)}};F.bia=function $jz(a,c){var d=a.b();K(d,s7a);c==this.qj()?this.rq[o](a.b()):this.rq[Bb](d,this.rq[cc][c])};F.jBa=function $kz(a){a=a.b();Ag(a,s7a);this.W()[ad](a)};H(sF,gF);F=sF[w];F.AG=0;F.zG=0;F.Zu=0;F.yG=0;F.CL=0;F.gQ=0;F.AL=0;F.BL=0;F.YHa=-1;F.gta=function $lz(){return new Bm(this.AG,this.zG,this.Zu,this.yG)};F.mK=function $mz(a){return a==vA?this.yG+this.zG+this.BL+this.gQ:this.AG+this.Zu+this.CL+this.AL};
+F.Vh=function $nz(){sF.C.Vh[z](this);Q(this.wa,this.qAa?this.qAa:SJa(this.AG,this.zG,this.Zu,this.yG,this.CL,this.gQ,this.AL,this.BL));this.W8b=this.AG;this.V8b=this.zG;this.T8b=this.Zu;this.U8b=this.yG;this.e9b=this.CL;this.d9b=this.gQ;this.b9b=this.AL;this.c9b=this.BL;this.JHa=k};
+F.Mcc=function $oz(a){var c=a[Daa],d=a.padding;this.qAa=i;var f=c||new Bm(this.AG,this.zG,this.Zu,this.yG);if(f.top<0||f[rl]<0||f[fl]<0||f[Ck]<0)e(Error(".133`"+f.top+qw+f[Ck]+qw+f[rl]+qw+f[fl]));var g=d||new Bm(this.CL,this.gQ,this.AL,this.BL);if(f.top+g.top<0||f[rl]+g[rl]<0||f[fl]+g[fl]<0||f[Ck]+g[Ck]<0)e(Error(".134"));if(c)TJa(this,c.top||0,c[rl]||0,c[fl]||0,c[Ck]||0);if(d)UJa(this,d.top||0,d[rl]||0,d[fl]||0,d[Ck]||0);if(!this.wa)this.qAa=a.yn};
+F.JXa=function $pz(a,c,d,f){this.qAa=i;var g=this.AG,j=this.zG,n=this.Zu,s=this.yG;if(Ke(a)&&!mm(a)){g=Ke(a.top)?a.top:g;j=Ke(a[rl])?a[rl]:j;n=Ke(a[fl])?a[fl]:n;s=Ke(a[Ck])?a[Ck]:s}else{g=Ke(a)?a:g;j=Ke(c)?c:j;n=Ke(d)?d:n;s=Ke(f)?f:s}if(g<0||j<0||n<0||s<0)e(Error(".133`"+g+qw+s+qw+j+qw+n));if(g+this.CL<0||j+this.gQ<0||n+this.AL<0||s+this.BL<0)e(Error(".134"));TJa(this,g,j,n,s)};
+F.U1=function $qz(a,c,d,f){this.qAa=i;var g=this.CL,j=this.gQ,n=this.AL,s=this.BL;if(Ke(a)&&!mm(a)){g=Ke(a.top)?a.top:g;j=Ke(a[rl])?a[rl]:j;n=Ke(a[fl])?a[fl]:n;s=Ke(a[Ck])?a[Ck]:s}else{g=Ke(a)?a:g;j=Ke(c)?c:j;n=Ke(d)?d:n;s=Ke(f)?f:s}if(g+this.AG<0||j+this.zG<0||n+this.Zu<0||s+this.yG<0)e(Error(".134"));UJa(this,g,j,n,s)};
+F.L=function $rz(){this.Q6a=this.T6a=this.avb=this.C4a=this.zAb=this.x4a=this.A4a=this.vAb=this.xAb=this.R6a=this.U6a=this.Okb=this.w4a=this.bvb=this.uAb=this.y4a=this.B4a=this.wAb=this.yAb=i;sF.C.L[z](this)};F.oF=function $sz(a){return this.mK(a)+sF.C.oF[z](this,a)};F.VV=function $tz(a){sF.C.VV[z](this,a);VJa(this)};F.bia=function $uz(a,c){if(c==this.qj())this.W()[o](sJa(this),a.b());else{var d=sJa(this);d[Bb](a.b(),d[cc][c])}};
+F.di=function $vz(a,c,d){VJa(this);sF.C.di[z](this,a,c,d);if(a==Wx){a=this.mK(a);c=c==-1?-1:l.max(c-a,0);if(this.YHa!=c){this.YHa=c;if(!this.Q6a)this.Q6a=sJa(this)[x];Wa(this.Q6a,NA(c))}}};F.wX=function $wz(a,c,d){if(a==vA||c==-1||c<this.mK(Wx))sF.C.wX[z](this,a,c,d);else{gBa(this,Wx,c);if(this.O3!=-1){this.O3=-1;Wa(KA(this),NA(-1))}}};F.Hpa=function $xz(a,c){if(c!=-1)c=l.max(c-this.mK(a),0);sF.C.Hpa[z](this,a,c)};F.J2=function $yz(a,c,d){if(c!=-1)c=l.max(c-this.mK(a),0);sF.C.J2[z](this,a,c,d)};_B_prog(60)}catch(e){_B_err(e)}
+
+try{H(BF,AD);var CF=new Bm(4,4,4,4);F=BF[w];F.za=function $zz(){return this.ia.rb(0)};F.LXa=function $Az(a){DF(this,this.gta(),a)};F.gta=function $Bz(){return this.ia.gta()};F.JXa=function $Cz(a){DF(this,a,this.yJa)};F.U1=function $Dz(a){this.ia.U1(a)};F.so=function $Ez(a){var c=this.ia;yA++;try{this[Nc]();c.ha(a)}finally{zA()}};lk(F,function $Fz(){return this.ia.Vp(0)});H(IKa,BD);var efb={103:106836};F=IKa[w];F.qa=FF;F.FSa=0;F.hca=i;F.u0=h;F.Iaa=i;F.xc=D(Yj);F.gqb=function $Hz(){var a=OKa(this)==i?0:500;LKa(this,a,Zf())};F.R6b=function $Iz(){this.hca=i;this.FSa=0;this.Pa()};var ffb="ERROR";F.Pa=function $Jz(){var a=Zf(),c;if(c=this.xf.ud.KS){this.Fv&&kIa(this.Fv,a)||!(c.hm()==103&&c.C0&&c.C0==1)&&this.EG(ffb,a);c=h}else c=k;c||NKa(this,a)||QKa(this,a)||this.EG(FF,a)};var bQ="tn";
+F.EG=function $Kz(a){var c=this.qa!=a;this.qa=a;a=this.qa!=FF;switch(this.qa){case ffb:var d=this.xf.ud,f=d.KS,g=d.xc();f=f.hm();var j=-1;if(g==vIa)j=d.w6();var n;if(j>0){d=Zf();n=this.a7a(j-d);LKa(this,1E3,d)}d=efb[f];n={NG:nx(f,3),xla:n,hic:this.X(bQ),io:d?Yz(this.Lb,d):i};f=this.u0?mKa(n):xKa(n);Q(this.EP.b(),f);n=this.u0?CKa(n):EKa(n);Q(this.v1.b(),n);break;case MKa:c&&SKa(this);break;case PKa:c&&RKa(this);break;case FF:default:break}this.qc(a);if(c&&a){this.EP.qe();this.v1.qe()}};
+F.NXa=function $Lz(a){IKa.C.NXa[z](this,a)&&this[r](JF)};F.nUc=function $Mz(a){if(this.qa==ffb){a=(this.u0?a==this.EP?aKa:cKa:a==this.EP?pKa:rKa)();a=fJa(a,this.Y,HKa);a+=20;return a}else return ZFa(a)};F.Wpb=function $Nz(){this.u0=this.Fv.u0;this.Pa()};var gfb="1s";F.a7a=function $Oz(a){a=l[rb](a/1E3);if(a<=1)return gfb;else if(a<90)return a+ki;else{var c=l[rb](a/60);a%=60;return c+(xj+nx(a,2))}};F.He=function $Pz(a){OKa(this)[r](new yEa(a));a[y].id==this.X(bQ)&&wIa(this.xf.ud)};
+F.D=function $Qz(){this.hca&&cA(this.hca);IKa.C.D[z](this)};H(UKa,kn);F=UKa[w];F.Rva=-1;F.z0=0;F.Fc=function $Rz(a){this.AAa=a;this.Rva==-1&&WKa(this,a)};F.ZM=function $Sz(a){var c=this.z0++;this.Sh[p](new VKa(c,a));this.ab[Rc]();return c};F.rW=function $Tz(a){for(var c=0;c<this.Sh[u];c++)if(this.Sh[c].id==a){kf(this.Sh,c);if(this.Rva==c){WKa(this,this.AAa);this.Rva=-1}return h}return k};F.MWc=function $Uz(){var a=this.Rva+1;if(a>=this.Sh[u])a=-1;if(a==-1){WKa(this,this.AAa);this.Sh[u]==0&&this.ab[qc]()}else WKa(this,this.Sh[a].ke);this.Rva=a};H(HF,xx);HF[w].wT=function $Vz(a){var c=Ii,d=Rz(this.Bc.B());im(a)||(c+=NK+a+NK+d.Sj());return c};HF[w].wT.Vd=h;H(NF,BD);yx(HF,NF);var hfb=[];F=NF[w];F.L=function $Wz(){NF.C.L[z](this);this.C_a.D();this.zcc=i};F.JD=function $Xz(){yA++;try{this.i7();var a=this.ia;lea&&a.ha(cLa(this))}finally{zA()}};F.Pic=function $Yz(){hm(this.zcc,R7a,!this.did.ps())};F.i7=B();F.ma=function $_z(){NF.C.ma[z](this);if(qga&&L&&!vg(Ij)){var a=this.Yj;this.H().w(a,mO,this.egd)}};F.egd=function $0z(){if(!this.pVb)if(!(!L||vg(Ij))){var a=lC(this.B());mC(a,this.UMc,this);this.pVb=h}};
+F.UMc=function $1z(){var a=this.ia.b();m(a,a[uc]);this.pVb=k};F.UH=function $2z(){wD(this.B());this.atc=h;var a=this.B();this.Wdc();if(this.B().eN()){a=a.J(oy);a.XFa(this.jNb.Fp());this.H().w(a,aE,this.spb)}a=this.H();this.B();if(L){var c=this.jNb.Fp();a.w(c,Tea,this.Vob);a.w(c,Uea,this.gob)}else{c=sD(this.Bd);a.w(c,lj,this.Vob,h);a.w(c,kj,this.gob,h);c=sD(this.qUa);a.w(c,lj,this.Vob,h);a.w(c,kj,this.gob,h)}a=bi(fx(Je[Ic][Yc],"//www.google.com/setgmail"));(new Image).src=a[t]();this.B().Ya()[r](GF)};
+F.Wdc=function $3z(){if(!this.Xdc){this.Xdc=h;this.H().w(OF,Ky,this.bXb)}this.bXb()};var ifb="\r";F.bXb=function $4z(){var a;a=this.B().J(Ky);var c=dLa(this.B());for(var d in c)for(var f=c[d][Cc](BOa),g=0;g<f[u];g++){var j=f[g];a.zCa.set(j,new JIa(d,j,h));a.Hxb[j[nc](0,1)]=1}a.zCa.set(ifb,new JIa(lM,ifb,void 0));a.Hxb["\r"[nc](0,1)]=1};F.spb=B();F.Vob=function $6z(){var a=this.xB;if(h!=a.Yca){a.Yca=h;a[r](IF)}};F.gob=function $7z(){var a=this.xB;if(k!=a.Yca){a.Yca=k;a[r](IF)}};F.zc=E(i);
+F.qQb=function $9z(){var a=this.zc();return a?a.md():i};F.Ox=function $$z(a,c){a=this.mw.Ox(this,this.wQb(),this.B(),a,c);return this.C_a.Tn=a};F.ZG=function $aA(){return this.C_a.ZG()};F.Ita=function $bA(){return this.C_a.Ita()};F.b3a=function $cA(){this.zc()&&fHa(this.xl.Xv)};F.BHb=B();F.fqb=B();F.Ujb=function $fA(a,c){a=this.Xta();return c==4||this.Zha&&a&&a.md()==YK&&c==3};F.Bob=function $gA(a){a=a.Pg;a.iaa==Wn&&this.Qs(a)};F.CP=i;F.Qs=Ge(Yeb);F.Epb=B();F.FTa=B();
+F.uka=function $kA(a){CD()||QBa(PBa(this.B())).tka(a.yL,a.m3b,a.o2b,a.dQb,a.F2b);this.i1b(a)};F.i1b=B();F.qTa=function $mA(){oD(this.B()).dk(this);pD(this.B()).dk(this)};F.JYc=function $nA(){this.xB.lf()};var jfb="manual";F.s0c=function $oA(){var a=this.B().J(XC);aDa(a,Zf(),jfb)};F.fcb=function $pA(a){return TD(this.B()).fcb(a)};F.YFc=function $qA(){return this.Aa.za(LC)};F.iZ=B();F.oRb=function $sA(){return Qab};
+F.Via=function $tA(a){var c=this.B();vMa(dE(c));a=this.Ox(this.oRb(),a||fea).TR;KE(a,kfb,loadTimes[0]);KE(a,lfb,loadTimes[1]);KE(a,mfb,loadTimes[2]);KE(a,nfb,loadTimes[3]);KE(a,ofb,loadTimes[4]);KE(a,pfb,loadTimes[5]);var d=0;delete hfb;var f=hA(c);if(hfb){var g=G(function(){if(d==hfb[u]){this.iZ();Mx().Kh(6)}else hfb[d++](f,g)},this);g()}else{this.iZ();Mx().Kh(6)}};H(SF,N);H(TF,N);H(fLa,N);H(function(b,a){N[z](this,nP,b);la(this,a)},N);H(YF,Jf);F=YF[w];F.H=D(KP);F.oM=Ge(KP);F.wma=E(0);F.yna=function $xA(a){this.FAb(a)};F.FAb=function $yA(a){this.na.uFb();this.ld=a};F.P5=D(XI);La(F,function $AA(){e(Error(".0"))});F.gec=function $BA(){return!!this.ld};F.wRb=E(i);H(ZF,YF);ZF[w].D=function $DA(){nh(this.ob,Hh,this.cva,k,this);nh(this.ob,Ih,this.YUb,k,this);this.ob.D();this.ob=i;ZF.C.D[z](this)};YF[w].wma=function $wA(a){var c=a.QC;if(c)if(oLa(c))return 0;if(a.gia&&!a.K8b)return 0.9;return 0.5};F=ZF[w];var cQ="rt";F.yna=function $EA(a){this.FAb(a);a.Ua(cQ,oA);this.lec(a)?this.ob[Mb](a.uc()):this.ob[Mb](a.uc(),Aj,sLa(this,a))};La(F,function $FA(a){this.qG=a;this.ob[wc](7)});
+F.cva=function $GA(a){var c=a[y];if(c.ye()){if(c.dj()[u]>0){a:{a=c.dj();a=a[Zc](a[Db](ch));var d;try{d=ix(a)}catch(f){d=new nB(this.P5(),10);this.H().bQ(d);break a}Ve(d)&&this.H().cfb(d[0]);this.H().WH()}return}this.qG=104}var g=this.qG;this.qG=0;d=c.hf();a=c.eo;var j;if(g)j=g;else if(a==6){j=c.dj();if(c=j[Kb](Neb))j=700+da(c[1],10);else j=(c=j[Kb](Oeb))?Tj+c[1]:i}j||(j=rLa(a,NaN,d));d=new nB(this.P5(),j);this.H().bQ(d)};F.YUb=function $HA(){this.H().Uba()};F.lec=function $IA(a){return a.Lib&&!a.RC};H(tLa,uh);F=tLa[w];F.uRa=0;F.dcd=function $JA(a){var c=this.xt;try{this.xt=a;a.Lc=i;a.Eg()||XBa(a);aCa(a)}finally{this.xt=c}};ua(F,function $KA(a){this.iQ.MG(a);this[r](vLa);wLa(this)});F.WH=function $LA(a){if(a==this.xt)if(!this.xt.Eg()){this.wVa.MG(this.xt);this.xt=i;this[r](vLa)}};F.tqb=function $MA(a){if(a.Eg()){if(a==this.xt){this.xt=i;this[r](vLa)}}else for(a=this.wVa.hQ();a&&a.xc()==YBa;){this.wVa.ly();a=this.wVa.hQ()}};
+La(F,function $NA(a){if(a==this.xt){a=this.xt.P5();a.xG||a[wc]()}else a.h2a=h});F.w_b=function $OA(){this.uRa++};F.vic=function $PA(){this.uRa--;this.uRa==0&&wLa(this)};F.Ya=function $QA(){return this};H(aG,Jf);var BLa=ifa.J()?3E4:12E4,ALa=ifa.J()?1E4:2E4;aG[w].L=function $RA(){if(this.MVa){this.MVa.D();this.MVa=i}if(this.Mw){this.Mw.D();this.Mw=i}aG.C.L[z](this)};aG[w].U4b=function $SA(){this.CLb=Zf()};aG[w].E5c=function $TA(){zLa(this,k)};_B_prog(61)}catch(e){_B_err(e)}
+
+try{H(bG,uh);bG[w].a9a=function $UA(a,c){var d=a.Je();this.bFa[d]|=Ke(c)?c:65535;CLa(this,a,d);this.HD<=0&&delete this.bFa[d]};bG[w].c9a=function $VA(a,c){c=a.Je()+xj+c;DLa(this,c,c);CLa(this,a,c)};bG[w].Qf=function $WA(){this.HD++;this.HD==1&&bG.C[r][z](this,FG)};var qfb=";7";
+bG[w].Mf=function $XA(){this.HD--;if(this.HD==0){for(var a=this.GEa.Sb(),c=0;c<a[u];c++){var d=a[c],f=this.GEa.J(d);f=new FLa(d,f,this.bFa);this.GEa[Pb](d);try{jx(this,d,k,f)}catch(g){rg(tg,qfb,g)}}this.bFa={};bG.C[r][z](this,ED)}else if(this.HD==-1){this.HD=0;e(Error(".135"))}};H(FLa,N);H(KLa,hy);F=KLa[w];F.L=function $YA(){this.Fh.D();KLa.C.L[z](this);if(this.g1){this.g1.D();this.g1=i}};F.tQc=h;F.cj=function $ZA(a,c){Ve(a)||(a=iya(a));if(a[u]==0||a[0]!=this.vn())return i;if(a[u]==1)return this;return jy(this,a[lb](1),c)};F.Ya=D(lO);F.Qf=function $0A(){this.Fh.Qf()};F.Mf=function $1A(){this.Fh.Mf()};F.rg=function $2A(){for(var a=this.Uc().Oa(),c=i;c=a.pop();){c.QK&&c.QK();if(c.hC()&8){c=c.Uc().Oa();for(var d=0;d<c[u];d++)a[p](c[d])}}};F.B=D(JF);F.pwb=Ge(JF);
+F.a9a=function $5A(a,c){this.Fh.a9a(a,c)};F.c9a=function $6A(a,c){this.Fh.c9a(a,c)};F.M5b=function $7A(a,c){for(var d=0;d<this.YY[u];d++)try{this.YY[d].M5b(a,c)}catch(f){}};F.N5b=function $8A(a){for(var c=0;c<this.YY[u];c++)try{this.YY[c].N5b(a)}catch(d){}};F.O5b=function $9A(a){for(var c=0;c<this.YY[u];c++)try{this.YY[c].O5b(a)}catch(d){}};F.Ypb=function $$A(a){for(var c=0;c<this.YY[u];c++)try{this.YY[c].Ypb(a)}catch(d){}};H(LLa,uh);hk(LLa[w],function $aB(a){a=typeof a==Xe?this.E9.jAa[a]:a;a!=this.XR?this.jb[bq](OLa(this,a).ARc||a.iMb):this.jb[bq](a.iMb)});LLa[w].BEa=function $bB(a){var c=this.E9.n8b[a[Wq]];if(c&&c!=this.XR){var d=this.XR;if(this.XR){var f=OLa(this,this.XR).EJ;f&&this.H8&&this.H8.daa(f)}this.XR=c;(f=OLa(this,c).EJ)&&this.H8&&KVa(this.H8,f,99);this[r](new NLa(this,d,c))}if(c)OLa(this,c).ARc=a};
+LLa[w].cCa=function $cB(a,c){var d=OLa(this,a),f=d.EJ;d.EJ=c;if(a==this.XR&&this.H8){f&&this.H8.daa(f);c&&KVa(this.H8,c,99)}};H(PLa,xx);F=PLa[w];F.D=B();F.D.Ka=h;F.ojb=B();F.ojb.ic=h;F.bQ=B();F.bQ.ic=h;F.vqb=B();F.vqb.ic=h;F.e2a=B();F.e2a.ic=h;F.J5a=B();F.J5a.ic=h;F.iX=B();F.iX.ic=h;F.dBa=B();F.dBa.ic=h;F.Eoa=B();F.Eoa.ic=h;F.bfb=B();F.bfb.ic=h;H(eG,YE);yx(PLa,eG);F=eG[w];F.ywa=h;F.D=function $nB(){if(!this.Pc){eG.C.D[z](this);this.aa.D();this.mw=i}};F.f2a=function $oB(){this.aa.e2a()||eG.C.f2a[z](this)};F.kmb=function $pB(a,c){return this.aa.bfb(a,c)};var rfb="nsc",sfb="seid";F.D2a=function $qB(){eG.C.D2a[z](this);this.aQa&&this.mw?HIa(this.mw):this.ld.Ua(rfb,1);this.vv&&tMa(this.vv);this.aQa&&this.Nhd&&!this.ld.Lib&&this.ld.Ua(sfb,Vfa)};F.zfd=function $rB(){pIa(this)};var tfb=":13",dQ="init";
+F.GAb=function $sB(){if(this.aa.ojb())bA(tfb,this.zfd,200,this);else{this.ywa&&this.ld.Rc(pd)&&this.ld.rwa&&this.ld.Rc(dQ)!=Hj&&this.aQa&&!this.Xsb&&this.ld.Ua(dQ,Hj);eG.C.GAb[z](this);this.Cuc=k}};F.WH=function $tB(){if(this.qa!=ZE)e(Error(".128"));var a=this.ld,c=eG.C.WH[z](this);if(c){if(this.ywa&&a.Rc(pd)&&a.rwa)this.ywa=k;this.aa.vqb()}return c};var eQ="err";
+F.OTa=function $uB(a){this.mw&&this.mw.Hz(eQ+a.hm(),this.ld.C0);if(this.qa!=ZE)e(Error(".129"));this.ywa&&this.ld.Rc(dQ)==Hj&&this.ld.Ua(dQ,Ah);this.aa.bQ(a)||eG.C.OTa[z](this,a)};F.NRb=function $vB(a){if(!a.yIb())return a;var c=this.zu.hQ();if(!c||!c.BIb(a))return a;if(c.Rc(W3a)||c.Rc(GA))return a;c=this.zu.ly();c.rid(a);return c};F.MUb=function $wB(a,c){if(a&&c.Rc(pd)==QN&&c.Rc(fG)!=EE){bA(tfb,G(this.Plb,this,k),50);return k}return h};
+F.UNa=function $xB(a){eG.C.UNa[z](this,a);if(this.YR.gec()&&this.ld&&this.J3){a=a[4];var c=Zf()-this.ld.NQa-this.ld.vNa();this.J3.Zma.add(a/c*8E3)}};F.b1=function $yB(a,c){eG.C.b1[z](this,a,c)};F.eec=function $zB(a){return!a.vW||DD()};F.CIa=function $AB(){if(this.ld)this.aa.J5a()||eG.C.CIa[z](this)};F.iX=function $BB(){this.aa.iX()};F.Eoa=function $CB(a){this.aa.Eoa(a)};F.dBa=function $DB(a){this.aa.dBa(a)};top._A=_A;H(SLa,YF);F=SLa[w];F.vOb=k;F.wma=function $EB(a){if(this.Shc||this.vOb)return 0;else if(this.xDc!=a.Rc(pd)){this.vOb=h;return 0}return 1};var ufb=":14";F.yna=function $FB(a){SLa.C.yna[z](this,a);this.Shc=Zf();this.nna=dA(ufb,this.Wmd,20,this)};La(F,function $GB(){this.ld=i});F.gec=E(k);
+F.Wmd=function $IB(){var a,c=k;if(top.VIEW_DATA){this.na.cfb(top.VIEW_DATA);this.ld=i;this.na.WH();this.na.Uba();top.VIEW_DATA=i;a=vfb;c=h}else if(top.VIEW_DATA_SE!=undefined&&top.VIEW_DATA_SE!=i){this.na.bQ(new nB(this.ld,700+top.VIEW_DATA_SE));this.ld=i;this.na.Uba();top.VIEW_DATA_SE=i;a=wfb;c=h}else if(Zf()-this.Shc>6E4){this.na.bQ(new nB(this.ld,101));this.ld=i;this.na.Uba();a=xfb;c=h}if(c){a&&this.vv.pb(a);if(this.nna){eA(this.nna);this.nna=i}}};
+F.D=function $JB(){if(this.nna){eA(this.nna);this.nna=i}SLa.C.D[z](this)};var jG;H(gG,uh);var VLa={},ULa=0;F=gG[w];F.Nh=i;F.xe=i;F.A_=i;F.IWc=0;F.ng=k;F.gy=k;F.Nv=k;F.c8=i;F.QQa=i;F.eo=0;F.lX=0;F.hD=i;F.nPb=i;F.y_=i;var yfb="form",zfb="utf-8";ua(F,function $KB(a,c,d,f){if(this.ng)e(Error(".136"));this.c8=a=new Sh(a);c=c?c[pl]():zj;d&&bi(a);if(!jG){jG=Aw(yfb);jG.acceptCharset=zfb;d=jG[x];Ja(d,sd);Fa(d,yd);d.top=ck(d,bMa);ka(d,Wa(d,hG));rp(d,yd);ea[Lc][o](jG)}this.Nh=jG;c==zj&&YLa(this.Nh,a.Of());f&&YLa(this.Nh,f);Op(this.Nh,a[t]());this.Nh.method=c;aMa(this)});
+La(F,function $LB(a){if(this.ng){ph(jMa(this));this.Nv=this.ng=this.gy=k;this.eo=a||7;this[r](Dj);fMa(this)}});F.L=function $MB(){this.ng&&this[wc]();gG.C.L[z](this);this.xe&&gMa(this);hMa(this);delete this.rab;this.c8=this.cZb=this.QQa=this.aZb=this.Nh=i;this.eo=0;delete VLa[this.Jb]};F.jm=D("gy");var Afb="Nv";F.ye=D(Afb);F.Eb=D(Ej);F.dj=D("QQa");F.Mdb=function $RB(){return yh(this.QQa)};var Bfb="c8";F.zRb=D(Bfb);F.Kga=function $TB(){return Owa(this.eo)};F.X1=function $UB(a){this.lX=l.max(0,a)};
+ra(F,function $VB(a){this.xe&&bda(Nh,this.xe);try{gG.C[r][z](this,a)}finally{this.xe&&cda(Nh)}});var Cfb="about:blank";F.kpb=function $WB(){if(this.xe[Nb]==Hh){nh(this.xe,Lh,this.kpb,k,this);var a;try{a=om(this.xe);if(L&&a[Ic]==Cfb&&!bp[uma]){this.Po(9);return}}catch(c){this.Po(1);return}this.Rua(a)}};F.hza=function $XB(){if(!(Ng&&iMa(this)[Ic]==Cfb)){nh(jMa(this),rj,this.hza,k,this);this.Rua(iMa(this))}};
+F.Rua=function $YB(a){this.gy=h;this.ng=k;var c;try{var d=a[Lc];this.QQa=d.textContent||d[waa];this.aZb=d[wk]}catch(f){c=1}var g;if(!c&&typeof this.rab==Se)if(g=this.rab(a))c=4;if(c)this.Po(c,g);else{this.Nv=h;this.eo=0;this[r](Hh);this[r](Mh);fMa(this)}};F.Po=function $ZB(a,c){if(!this.wab){this.ng=this.Nv=k;this.gy=h;this.eo=a;if(a==4)this.cZb=c;this[r](Hh);this[r](Kh);fMa(this);this.wab=h}};F.qfb=function $_B(a){this[r](new lMa(a))};
+F.l9a=function $0B(){if(this.y_){Eh(this.y_);this.y_=i}for(var a=0;a<this.Kva[u];){var c=this.Kva[a];if(Nh.Lf?!Nh.GY[Ye(c)?c:af(c)?bf(c):I]:h){kf(this.Kva,a);Sg(c)}else a++}if(this.Kva[u]!=0)this.y_=Dh(this.l9a,2E3,this)};F.ehc=function $1B(){if(this.ng){iMa(this);this.nPb=Dh(this.ehc,250,this)}};H(lMa,N);H(mMa,YF);F=mMa[w];F.D=function $2B(){nh(this.tv,Hh,this.mUb,k,this);nh(this.tv,Ih,this.oUb,k,this);nh(this.tv,kMa,this.nUb,k,this);this.tv.D();this.tv=i;mMa.C.D[z](this)};F.wma=function $3B(a){if(a.jHb)return 0.1;if(!a.gia)return 0.9;return 0.5};F.Zua=function $4B(){this.ld.jHb=h;this[wc](101)};F.fqa=function $5B(){if(this.QI){cA(this.QI);this.QI=i}};var Dfb=":15";
+F.yna=function $6B(a){mMa.C.yna[z](this,a);a.Ua(cQ,Yx);var c=a.Rc(fG);if(c!=wO&&c!=EE)this.QI=bA(Dfb,this.Zua,6E4,this);if(a.QC!=i)ZLa(this.tv,a.QC,a.uc(),h);else if(a.RC==i&&!a.Rc(fG))this.tv[Mb](a.uc(),zj,a.Lib);else{c=i;if(a.RC)c=a.RC;this.tv[Mb](a.uc(),Aj,h,c)}};La(F,function $7B(a){this.fqa();this.qG=a;this.tv[wc](7)});F.mUb=B();
+F.oUb=function $9B(){this.fqa();this.na.Acd();var a=this.na.osc();a&&!this.tv.ye();if(a||this.tv.ye())this.na.WH();else{if(this.qG){a=this.qG;this.qG=0}else a=rLa(this.tv.eo,this.tv.cZb,undefined);this.na.bQ(new nB(this.ld,a))}this.na.Uba()};F.nUb=function $$B(a){this.na.UIc(a[dq])};F.wRb=function $aC(){return this.tv.aZb};_B_prog(62)}catch(e){_B_err(e)}
+
+try{var mG,oMa,Efb="Shockwave Flash",Ffb="Shockwave Flash 2.0",Gfb="2.0.0.11",Hfb="application/x-shockwave-flash",Ifb="ShockwaveFlash.ShockwaveFlash.7",Jfb="$version",Kfb="ShockwaveFlash.ShockwaveFlash.6",Lfb="6.0.21",Mfb="ShockwaveFlash.ShockwaveFlash";
+(function(){function b(n){n=n[Kb](/[\d]+/g);Ia(n,3);return n[kd](He)}var a=k,c=I;if(bp[Eq]&&bp[Eq][u]){var d=bp[Eq][Efb];if(d){a=h;if(d[qr])c=b(d[qr])}if(bp[Eq][Ffb]){a=h;c=Gfb}}else if(bp[vb]&&bp[vb][u]){if(a=(d=bp[vb][Hfb])&&d[Bma])c=b(d[Bma][qr])}else try{d=new ActiveXObject(Ifb);a=h;c=b(d.GetVariable(Jfb))}catch(f){try{d=new ActiveXObject(Kfb);a=h;c=Lfb}catch(g){try{d=new ActiveXObject(Mfb);a=h;c=b(d.GetVariable(Jfb))}catch(j){}}}mG=a;oMa=c})();F=pMa[w];F.pb=function $bC(a){this.hW(a.lC())};F.jj=function $cC(a,c){this.hW(a.lC()+Qd+c)};F.zF=function $dC(a,c){this.hW(a.lC()+Qd+c)};F.hW=function $eC(a){rMa(this,a)&&this.NUa[p](a)};F.u7=function $fC(a){qMa(this,a.lC())};F.ENc=function $gC(a,c){qMa(this,a.lC()+c)};F.cma=function $hC(a,c){a=a.lC();rMa(this,a)&&this.u9.set(a,c)};Aa(F,function $iC(){Ia(this.NUa,0);this.u9[bc]()});
+var yMa=oG(Pd),wMa=nG("bf-i"),xMa=nG("bf-n"),Nfb=nG("tl-v"),Ofb=nG("tl-r"),Pfb=oG("tl-s"),Qfb=nG("tl-f"),Rfb=oG("tl-si"),Sfb=nG("cv-v"),Tfb=nG("cv-p"),Ufb=oG("cv-pfn"),Vfb=nG("cv-b"),Wfb=nG("cv-t"),Xfb=nG("cv-pa");nG("cv-fa");nG("cv-ac");
+var Yfb=oG("cd-da"),Zfb=nG("cd-ei"),agb=nG("cd-i"),bgb=nG("cd-ia"),cgb=pG("cd-tm"),dgb=nG("cd-r"),egb=nG("cd-ra"),fgb=nG("cd-f"),ggb=nG("cd-rbc"),hgb=nG("cd-ic"),igb=nG("cd-c"),jgb=nG("cd-e"),kgb=nG("co-rt"),lgb=nG("co-o"),mgb=nG("co-ra"),ngb=nG("co-f"),ogb=nG("co-p"),pgb=nG("co-d"),qgb=nG("co-so");nG("co-tm");var rgb=nG("co-mu"),k0a=pG("pf-s"),sgb=oG("pf-np"),tgb=oG("pf-nup"),ugb=oG("pf-cl"),vgb=nG("pf-r"),wgb=nG("pf-u"),xgb=nG("ma-tl-o");oG("ma-tl-s");var ygb=nG("ma-cv-o");oG("ma-cv-s");
+var zgb=nG("mt-tl-o"),Agb=nG("mt-tl-s-"),Bgb=nG("mt-cv-o"),Cgb=nG("mt-cv-s-"),Dgb=nG("la-tl-o"),Egb=nG("la-tl-s-"),Fgb=nG("la-cv-o"),Ggb=nG("la-cv-s-"),Hgb=new zE(EB,"dd-tl",h,h),Igb=pG("dd-t"),Jgb=pG("dd-c"),Kgb=nG("k-tl-en"),Lgb=nG("k-y"),Mgb=nG("k-yn"),Ngb=nG("k-yp"),Ogb=nG("k-t"),Pgb=nG("k-e"),Qgb=nG("k-cv-u"),Rgb=nG("k-tl-o"),Sgb=nG("k-c"),Tgb=nG("k-rs"),Ugb=nG("k-de"),Vgb=nG("k-cv-j"),Wgb=nG("k-cv-k"),Xgb=nG("k-cv-r"),Ygb=nG("k-cv-r-n"),Zgb=nG("k-cv-ra"),ahb=nG("k-cv-ra-n"),bhb=nG("k-cv-f"),
+chb=nG("k-cv-f-n"),dhb=nG("mh-s"),ehb=nG("mh-sw"),fhb=nG("mh-swl"),ghb=nG("mh-as"),hhb=nG("mh-cf"),ihb=nG("cm-d"),jhb=nG("cm-ud"),khb=nG("cm-cc"),lhb=nG("cm-bcc"),mhb=nG("cm-att"),nhb=nG("cm-ev"),ohb=nG("cm-ratt"),phb=nG("cm-rev"),qhb=nG("cm-ioa");nG("cm-rec");var rhb=oG("cm-fafp"),shb=nG("cm-dat"),thb=nG("mc-ht"),uhb=nG("mc-pt"),vhb=nG("mc-sw-pt"),whb=nG("mc-sw-ht");pG("bc-u-q");pG("bc-u-s");pG("bc-u-r");
+var xhb=pG("bc-c"),yhb=pG("bc-ce"),zhb=pG("bc-ne"),Ahb=pG("bc-oe"),Bhb=pG("bc-ee"),Chb=oG("bc-se"),Dhb=oG("bc-sce"),Ehb=oG("bc-pm"),Fhb=oG("bc-um"),Ghb=pG("y-me"),Hhb=pG("y-mr"),Ihb=pG("y-ms"),Jhb=nG("qc-e"),Khb=nG("qc-c"),Lhb=oG(ex),Mhb=nG("cm-ipc"),Nhb=nG("cr-ch"),Ohb=nG("cr-ml"),Phb=nG("cr-ss"),Qhb=oG("cr-sz"),Rhb=oG("cr-scl"),Shb=nG("cr-sc");nG("cr-vs");
+var Thb=nG("cml-mi"),Uhb=nG("cml-ma"),Vhb=nG("cml-pi"),Whb=nG("cml-po"),Xhb=nG("cml-off"),Yhb=nG("cml-noff"),Zhb=nG("cml-ivc"),aib=nG("cml-svc"),bib=nG("cml-sac"),cib=nG("cml-nvc"),dib=oG("cml-im"),eib=nG("cml-vrv"),fib=nG("cml-vrc"),gib=nG("cml-vnav"),hib=nG("cml-vnac"),iib=nG("cml-vuls"),jib=nG("cml-vulc"),kib=nG("cml-vulf"),lib=nG("cml-verf"),mib=nG("cml-lncc"),nib=nG("cml-lnvc"),oib=nG("cml-lsc"),pib=nG("cml-lsvc"),qib=nG("vml-lip"),rib=nG("cml-qrv"),sib=nG("cml-qrc"),tib=nG("cml-qrf"),uib=nG("cml-qsv"),
+vib=nG("cml-qsc"),wib=nG("cml-qsf"),xib=nG("cml-epc"),yib=oG("cml-esc"),zib=nG("ctb-svt"),Aib=nG("ctb-sat"),Bib=nG("ctb-ivt"),Cib=nG("ctb-ev"),Dib=nG("ctb-ea"),Eib=nG("ctb-eic"),Fib=nG("ctb-emu"),Gib=nG("ctb-eof"),Hib=nG("ctb-eun"),Iib=nG("ctb-ip");nG("crd-sv");var Jib=nG("cl-irl"),Kib=pG("cl-rld"),Lib=pG("cml-o"),Mib=pG("cml-c");nG("ce-rf");nG("ce-rfd");
+var Nib=nG("cds-vw"),Oib=nG("cds-ce"),Pib=nG("cds-econ"),Qib=nG("cds-ecof"),Rib=nG("cds-vy"),Sib=nG("cds-pysd"),Tib=nG("cds-tt"),Uib=nG("cds-invo"),Vib=nG("cds-se"),Wib=nG("cds-cl"),Xib=nG("cbp-bd"),Yib=nG("cbp-ok"),Zib=oG("cbp-e0"),ajb=oG("cbp-e1"),bjb=oG("cbp-e2"),ejb=oG("cbp-e3"),fjb=oG("cbp-e4"),gjb=oG("cbp-to");nG("l-eb");nG("l-cb");
+var hjb=oG("l-nv"),reb=oG("fn-cl"),oeb=nG("fn-c"),qeb=nG("fn-n"),peb=nG("fn-p"),meb=oG("fn-v"),ijb=nG("pc-ca"),jjb=nG("pc-c"),kjb=nG("pc-i"),ljb=nG("pc-m"),mjb=nG("pc-cn"),njb=nG("pc-cp"),ojb=nG("pc-mm"),pjb=nG("pc-r"),qjb=nG("pc-ss"),rjb=nG("pc-vp"),sjb=nG("pc-vh"),tjb=nG("pc-vb"),ujb=nG("pc-va"),vjb=nG("pc-sv"),wjb=nG("pc-nv"),xjb=nG("pc-iv"),yjb=oG("pc-im"),zjb=nG("pc-vrv"),Ajb=nG("pc-vrc"),Bjb=nG("pc-vnav"),Cjb=nG("pc-vnac"),Djb=oG("gd-r"),Ejb=oG("gd-i"),Fjb=oG("gd-d"),Gjb=oG("gd-t"),Hjb=oG("gd-s"),
+ANa=nG("ifto");nG("jsle");var Ijb=nG("qs-ns"),Jjb=nG("qs-tc"),Kjb=oG("qs-bc"),Ljb=oG("qs-b"),Mjb=nG("qs-t"),Njb=nG("qr-ns"),Ojb=nG("qr-bc"),Pjb=nG("qr-bs"),Qjb=oG("ws-as"),Rjb=oG("ws-rs"),Sjb=nG("ws-m"),Tjb=oG(kP),Ujb=nG("ws-tbe"),Vjb=nG("ws-tb"),Wjb=nG("gb-ov");oG(lP);
+var Xjb=nG("cca"),Yjb=nG("ccf"),Zjb=nG("ccbp"),akb=oG("cccf"),bkb=nG("sol-ncc"),ckb=oG("sol-ss"),dkb=nG("jsc"),ekb=nG("jsnc"),fkb=oG("r-cs"),gkb=oG("BME"),hkb=oG("BMD"),ikb=oG("BMC"),jkb=oG("BMO"),kkb=nG("rv-d"),lkb=nG("rv-c"),mkb=nG("rv-to"),nkb=nG("rv-f-r"),okb=nG("rv-f-n"),pkb=nG("rv-f-i"),qkb=nG("md-s"),rkb=nG("s-lt"),skb=oG("ed-s"),vfb=nG("ed-su"),wfb=nG("ed-e"),xfb=nG("ed-t"),tkb=nG("ed-ex"),ukb=nG("ed-ne"),vkb=nG("up-oum"),wkb=nG("up-oop"),xkb=nG("up-oapd"),ykb=nG("up-ofd"),zkb=oG("aqf-s"),
+Akb=oG("aqf-m"),Bkb=oG("aqf-n"),Ckb=oG("aqf-o"),Dkb=oG("aqf-b");H(zMa,Jf);F=zMa[w];var Ekb="jsm",fQ="script",Fkb="text/javascript";F.ySc=function $jC(a,c,d,f,g,j){c=!!j;d=(new Sh).ka(Oj,Pj).ka(pd,Ekb).ka(YP,a[kd](wj)).ka(rd,ti).ka(LD,Fi);c&&d.ka(ai,Yf());c=d[t]();if(kga){a=lx(fQ);a.src=c;za(a,Fkb);ea[Lc][o](a)}else{d=new Gh;this.Q.w(d,Mh,G(this.zka,this,d,a,f),k,i);this.Q.w(d,Kh,G(this.J0,this,d,a,f),k,i);this.Q.w(d,Cj,G(this.c9,this,a,g),k,i);this.Q.w(d,Ih,d.D,k,d);d.X1(3E4);d[Mb](c)}};var Gkb="JavaScript",Hkb="var _et_ = 1;";
+F.zka=function $kC(a,c,d){a=a.dj();if(Nf(a,"Google Inc.\n"))try{if(Je[Eaa])Je[Eaa](a,Gkb);else if(Je.eval){if(r4a==i){Je.eval(Hkb);if(typeof Je._et_!="undefined"){delete Je._et_;r4a=h}else r4a=k}if(r4a)Je.eval(a);else{var f=Je[yc],g=f[Qb](fQ);za(g,Fkb);g.defer=k;g[o](f[yb](a));f[Lc][o](g);f[Lc][Nc](g)}}else e(Error(".1"))}catch(j){d(8001)}else d(8001)};F.J0=function $lC(a,c,d){d(a.hf())};F.c9=function $mC(a,c){c()};F.D=function $nC(){zMa.C.D[z](this);this.Q.D()};_B_prog(63)}catch(e){_B_err(e)}
+
+try{var BMa,gQ;H(AMa,xi);Xw(O.S(),Kd).ym(AMa);var Ikb="GG_iframeFn",Jkb="root",Kkb=":11",Lkb=":12";
+AMa[w].tb=function $oC(){var a=new lD;gQ=this.V=a;O.S().Zxa=a;var c=O.S();c.uHa=h;this.jVc=new zMa;c.Bxa=this.jVc;a[kq](Wx,new NIa(a));c=new IIa(a);a[kq](Ky,c);c=new YJa(a);a[kq](Cz,c);var d=c.J3;c=CMa(this,d,c.Fv,h,Ikb);c.aQa=h;d=CMa(this,d,i,k);a[kq](ey,new aya(c,d,new tLa(a)));d=Uh(new Sh(Mj),I)[t]();a.Ev.tod=d;d=new jC(2E4);a[kq](kC,d);d=new aG(d);var f=new KLa(Jkb,d),g=Cx(a);if(g.Aa)e(Error(".48"));g.Aa=f;f.pwb(a);new rya(f);f=this.V;g=new mza(sea);f[kq](Hz,g);f=new Iz(a);a[kq](Qz,f);g=new wy(a);
+a[kq](xy,g);Jz(f,866)&&yIa(c);Jz(f,718)&&QLa(c,h);f=new pMa;a[kq](dg,f);g=new sAa(a);a[kq](Sz,g);if(!d.MVa){g=new nC(Kkb,1,6E4,d.E5c,d);gDa(d.Cu,g);d.MVa=g;d.Mw=new aA(Lkb,2E4);ih(d.Mw,yj,d.U4b,k,d);d.Mw[Rc]();d.U4b()}c.vv=f;ME.pwb(a)};AMa[w].Y0b=B();var hQ="12",Mkb=new sG([Tj,hQ],Hj),Nkb="1d",iQ="4",Okb=new sG([Pj,Nkb,Tj,"1c",hQ,"16","13","14"],iQ,[Mkb]),jQ="3";new sG([Tj,hQ,"16","17","18","1a"],jQ,[Mkb]);var Pkb=new sG([Pj,iQ,Tj,Ph,"1c",hQ,"13","14","16","17","19",Pd,"1e","1b"],Pj,[Mkb,Okb]);Ha(sG[w],function $qC(){return this.Jb?ag+this.Jb:this.uE[kd](wj)});
+Sa(sG[w],function $rC(a){if(this.BKb[bd](a))return h;if(!this.s9a)this.s9a=new cg;if(this.s9a[bd](a))return k;var c=FMa(this),d=FMa(a);if(oba(d,c[bd],c)){this.BKb.add(a);return h}else{this.s9a.add(a);return k}});H(uG,uh);F=uG[w];F.oja=10;F.mHa=h;F.GGa=k;F.Iod=k;F.li=D(ko);ya(F,function $tC(a){if(a[y]==this.Kc)switch(a[Zb]){case GMa:this.mU(a.Kn);break;case nj:this.vI();break;case HMa:LMa(this);break;case tG:KMa(this);break}});F.Zaa=function $uC(a,c){if(this.pz!=a){this.pz=a;this.wj.ula(this.pz,this.oja,G(this.zlb,this),c);LMa(this)}};F.vj=function $vC(){return this.Kc.Ib()};F.mU=function $wC(a){this.Hy=a;this.Kc.mU(a);return vG(this,a)!=-1};var kQ="update";
+F.vI=function $xC(){var a=vG(this,this.Hy);if(a!=-1){a=this.Rg[a];var c=this.JF.yaa(a);this.nw();if(!c){this[r]({type:kQ,Kn:a});this.Iod&&this.JF[mr](h)}return h}else{this.nw();this[r]({type:kQ,Kn:i});return k}};F.nw=function $yC(){this.Hy=-1;this.pz=i;this.aC+=this.Rg[u];this.Rg=[];ba[gb](this.ZD);this.ZD=i;this.Kc.nw()};F.L=function $zC(){uG.C.L[z](this);this.Kc.D();this.JF.D();this.wj=i};
+F.zlb=function $AC(a,c,d){if(this.pz==a){a=d?vG(this,this.Hy):i;this.aC+=this.Rg[u];this.Rg=c;d=[];for(var f=0;f<c[u];++f)d[p]({id:this.aC+f,data:c[f]});this.Kc.kub(d,this.pz,this.zf);if(this.mHa&&d[u]!=0)this.mU(a!=i?this.aC+a:this.aC);else this.Hy=-1}};F.Wr=function $BC(){var a=this.JF;a.Wr[cd](a,arguments)};F.lw=function $CC(){var a=this.JF;a.lw[cd](a,arguments)};H(BG,Jf);F=BG[w];F.L0a=h;F.Zbb=h;F.Uic=k;F.xcc=h;F.gwb=h;F.Ul=i;F.eL=I;F.b3=k;F.MWa=k;F.mpd=h;var Qkb="kd";F.zT=D(Qkb);F.Ca=function $EC(){return this.Ul[q]};F.Fa=function $FC(a){pa(this.Ul,a)};F.QZ=function $GC(){return yG(this.Ul)};F.Iu=function $HC(a){wG(this.Ul,a);zG(this.Ul,a)};F.Wr=function $IC(){for(var a=0;a<arguments[u];a++){var c=arguments[a];gn(c,yo,h);this.tw.w(c,lj,this.dx);this.tw.w(c,kj,this.Xo);this.Ul||this.Aoa.w(c,ij,this.k5b)}};
+F.lw=function $JC(){for(var a=0;a<arguments[u];a++){var c=arguments[a];c==this.Ul&&this.Xo();this.tw.hb(c,lj,this.dx);this.tw.hb(c,kj,this.Xo);this.Ul||this.Aoa.hb(c,ij,this.k5b)}};
+F.yaa=function $KC(a,c){if(Ke(c)?c:this.Jja){c=cNa(this,this.Ca(),this.QZ());var d=dNa(this,this.Ca());a=a[t]();this.bid[cb](a)||(a=aia(a)+this.HAc);if(this.L0a){if(c!=0&&!im(d[c-1]))a=J+a;if(c<d[u]&&!im(d[c+1]))a+=J}if(a!=d[c]){d[c]=a;this.Fa(d[kd](I));for(var f=a=0;f<=c;f++)a+=d[f][u];this.Ul[Ek]();this.Iu(a)}}else this.Fa(a[t]());this.MWa=h;return k};F.L=function $LC(){BG.C.L[z](this);this.tw.D();delete this.tw;this.Aoa.D();this.Aoa=i};
+F.Qo=function $MC(a){switch(a[Sb]){case 40:if(this.kd.vj()){this.Emb();a[zb]();return h}else if(!this.Jja){this[mr](h);a[zb]();return h}break;case 38:if(this.kd.vj()){this.Imb();a[zb]();return h}break;case 9:this[mr]();if(this.kd.vI()&&this.jcd){a[zb]();return h}break;case 13:this[mr]();if(this.kd.vI()){a[zb]();return h}break;case 27:if(this.kd.vj()){this.kd.nw();return h}break;case 229:if(!this.b3){if(!this.b3){this.tw.w(this.Ul,jj,this.qka);this.tw.w(this.Ul,Zi,this.ql);this.b3=h}return h}break;
+default:if(this.ab&&!this.mpd){this.ab[qc]();this.ab[Rc]()}}return aNa(this,a)};F.wfb=E(k);F.dx=function $OC(a){this.Aoa.wb();this.kd&&LMa(this.kd);if(a[y]!=this.Ul){this.Ul=a[y]||i;if(this.ab){this.ab[Rc]();this.tw.w(this.ab,yj,this.cQ)}this.eL=this.Ca();this.sc.Pe(this.Ul);this.tw.w(this.sc,jn,this.KC);L&&this.tw.w(this.Ul,Zi,this.b5b)}};
+F.Xo=function $PC(){if(this.Ul){this.tw.hb(this.sc,jn,this.KC);this.sc[Ik]();this.tw.hb(this.Ul,jj,this.wfb);L&&this.tw.hb(this.Ul,Zi,this.b5b);this.b3&&bNa(this);this.Ul=i;if(this.ab){this.ab[qc]();this.tw.hb(this.ab,yj,this.cQ)}this.kd&&KMa(this.kd)}};F.cQ=function $QC(){this[mr]()};F.k5b=function $RC(a){this.dx(a)};F.KC=function $SC(a){this.Kia=a[Sb];this.kd&&this.Qo(a)};F.ql=function $TC(){this.b3&&this.Kia!=229&&bNa(this)};F.qka=function $UC(a){if(this.b3&&(a[Sb]==13||a[Sb]==77&&a[Bc]))bNa(this)};
+F.b5b=function $VC(a){aNa(this,a)};Qp(F,function $WC(a){if(a||this.Ul&&this.Ca()!=this.eL){if(a||!this.MWa){a=this.L7b();if(this.kd){this.kd.zf=this.Ul;this.kd.Zaa(a,this.Ca())}}this.eL=this.Ca()}this.MWa=k});F.L7b=function $XC(){var a=this.QZ(),c=this.Ca();a=dNa(this,c)[cNa(this,c,a)];return this.gic?String(a)[mb](this.gic,I):a};F.Imb=function $YC(){return this.Uic?IMa(this.kd):JMa(this.kd)};F.Emb=function $ZC(){return this.Uic?JMa(this.kd):IMa(this.kd)};H(CG,uh);var oNa=0;F=CG[w];F.b=D(eo);F.kub=function $0C(a,c,d){this.pz=c;this.Rg=a;this.KK=0;this.uZa=Zf();this.zf=d;this.xx=[];this.cp()};F.nw=function $1C(){this.zf&&bwa(this.zf,i);if(this.yg){this.yg=k;Wm(this.wa,k)}};F.Nc=function $2C(){if(!this.yg){this.yg=h;Wm(this.wa,h)}};F.Ib=D("yg");
+F.Sgb=function $4C(a){this.KK>=0&&Ag(this.xx[this.KK],this.JFa,this.PZb);this.KK=a;if(a>=0&&a<this.wa[cc][u]){a=this.xx[a];K(a,this.JFa,this.PZb);this.zf&&bwa(this.zf,a);var c=this.wa,d=Nm(a),f=Nm(c),g=Dva(c),j=d.x-f.x-g[Ck];d=d.y-f.y-g.top;f=c[Wc]-a[ql];c.scrollLeft+=l.min(j,l.max(j-(c[vc]-a[xk]),0));c.scrollTop+=l.min(d,l.max(d-f,0))}};F.mU=function $5C(a){if(a==-1)this.Sgb(-1);else for(var c=0;c<this.Rg[u];c++)if(this.Rg[c].id==a){this.Sgb(c);return}};F.gdc=function $6C(a){K(a,this[uc])};
+var lQ="option";
+F.cp=function $7C(){nNa(this);if(this.v_a)Fa(this.wa[x],yd);Ia(this.xx,0);this.ya.ZA(this.wa);if(this.xea&&this.xea.eb)this.xea.eb(this,this.wa,this.Rg,this.pz);else{var a=i;um(this.Rg,function(c){c=c;var d=this.pz,f=this.ya.ba(T,{className:this.yBa,id:"goog-acri-"+oNa++});fn(f,lQ);this.xea&&this.xea.WL?this.xea.WL(c,d,f):this.qWa(c,d,f);d&&this.cqd&&rNa(this,f,d);K(f,this.yBa);this.xx[p](f);c=f;this.v_a?this.wa[Bb](c,a):this.ya[o](this.wa,c);a=c},this)}if(this.Rg[u]==0)this.nw();else{this.Nc();this.S8b(this.wa);
+this.If();an(this.wa,h)}};var Rkb="LEFT",Skb="RIGHT";F.If=function $8C(){if(this.zf&&this.XL){var a=Nm(this.zf),c=Tm(this.zf),d=Tm(Lm(this.zf)),f=Tm(this.wa);a.y=this.v_a?a.y-f[id]:a.y+c[id];if((this.Hfd||a.x+f[ib]>d[ib])&&this.ekb!=Rkb){a.x=a.x+c[ib]-f[ib];this.ekb=Skb}else this.ekb=Rkb;Qm(this.wa,a);if(this.v_a)Fa(this.wa[x],ud)}};
+F.L=function $9C(){CG.C.L[z](this);if(this.wa){nh(this.wa,P,this.sj,k,this);nh(this.wa,fj,this.CH,k,this);nh(this.ya.cb(),P,this.fUb,k,this);nh(this.wa,Xi,this.BK,k,this);this.ya[ad](this.wa);this.wa=i;this.yg=k}delete this.mh};F.S8b=function $$C(a){if(Fh&&Qi){ka(a[x],I);rp(a[x],ud);ka(a[x],a[xk]);rp(a[x],GA)}};F.qWa=function $aD(a,c,d){Q(d,Wf(a[dq][t]()))};F.sj=function $bD(a){var c=sNa(this,a[y]);c>=0&&this[r]({type:nj,Kn:this.Rg[c].id});a[Ec]()};F.CH=function $cD(a){this[r](HMa);a[Ec]();a[zb]()};
+F.fUb=function $dD(){this[r](tG)};F.BK=function $eD(a){a=sNa(this,a[y]);if(a>=0)Zf()-this.uZa<300||this[r]({type:GMa,Kn:this.Rg[a].id})};_B_prog(64)}catch(e){_B_err(e)}
+
+try{H(tNa,xx);tNa[w].Ofb=B();tNa[w].Ofb.Ka=h;H(EG,uG);yx(tNa,EG);EG[w].oja=15;var mQ="email",Tkb=[mQ];F=EG[w];F.ula=function $gD(a,c,d){this.zWa({ce:a,pm:c,uC:h,YE:h,Alb:1,ZOb:Tkb,fS:this.XX,filter:this.Nfa,eia:h},G(this.Reb,this,d))};F.Reb=function $hD(a,c,d,f,g){a(g.ce,c)};F.zWa=function $iD(a,c){if(!this.l4){this.l4=qG(this.V);if(!this.l4){c(nQ,oQ,i,a,4);return}}if(this.PB){this.PB.tf();this.PB=i}this.PB=this.l4.Lq(a,c)};var pQ="ah";
+F.PJa=function $kD(){var a=new CG(this.Bd.Zf,this);a.XL=h;m(a,pQ);a.Nc=function $jD(){CG[w].Nc[z](a);uNa[z](a)};return a};F.Iqa=function $lD(){return new BG(UMa,Vf)};F.Wr=function $mD(){this.Ve.Wr[cd](this.Ve,arguments)};F.lw=function $nD(){this.Ve.lw[cd](this.Ve,arguments)};var Ukb="an",Vkb=" ap",Wkb='<div class="ai"><div class="aj"></div></div>',qQ="ao";
+F.WL=function $oD(a,c,d){c=oD(this.V);var f=a[dq][jb],g=!!(a[dq].vPb&1),j=I;if(c){a=a[dq].Rb();j=I;var n=k;if(a){j=c.KE(a);n=c.sa.SK(a)}c={F_:n,Kja:n?Ukb:LD,Hb:j,Te:f,qya:g};f=new U;f[R](X,S7a,c.qya?Vkb:I,W,c.F_?Wkb:I,X,NL,wl,yHa,J,c.Hb,xF,c.Kja,W,V(c.Te),II);j=f[t]()}else{c={Te:f,qya:g};f=new U;f[R](X,qQ,c.qya?Vkb:I,W,V(c.Te),Z);j=f[t]()}Q(d,j)};F.vI=function $pD(){var a=vG(this,this.Hy);if(a!=-1){this.aa.Ofb(a,this.Rg);a=this.Rg[a];if(a.Uma){a.Uma();return h}}return EG.C.vI[z](this)};H(wNa,BB);var kfb=HG(Xx),lfb=HG(RE),mfb=HG(oA),nfb=HG("jl"),ofb=HG(ki),pfb=HG(ii);var Xkb="hist_frame",Ykb="sound_frame";Ie("_B_init",function(b){b=df(pFa,b[yc],[Xkb,Ykb,Kdb],df(zNa,b),1E4);if(Xj.ob)Xj.qS=b;else b()},void 0);F=BNa[w];F.Bb=D(NO);F.Ay=D("Rf");F.MT=D("eka");var Zkb="HY";F.wwb=Ge(Zkb);var alb="num",blb="cont";F.Ja=function $uD(a){a.Ii(this.Ea);a.Ua(xC,this.Rf);a.Ua(alb,this.eka);this.HY&&a.Ua(blb,this.HY)};var clb=" start=",dlb=" num=";Ha(F,function $vD(){return this.Ea[t]()+clb+this.Rf+dlb+this.eka});var elb="h4",ENa=[elb,ON,"vem",TP,"gmail_nodisplay"],flb="h5",glb="im",DNa=mf(ENa,flb,glb),RNa=/^(DIV|TR|LI|FORM|HR)$/,PNa=/^(P|UL|OL|BLOCKQUOTE|H\d|PRE|XMP)$/,VNa=/[ \t\f\r\n\u200B]+/g,WNa=/^[ \t\f\r\n\u200B]+|[ \t\f\r\n\u200B]+$/gm,SNa=/\u200B+/g,TNa=/\r\n/g,UNa=/\r+/g;CNa[w].jh=function $wD(){return this.ngc[kd](I)};H(LG,bo);LG[w].dD=function $xD(a){this.mAa=a;this.Ib()&&this.If()};LG[w].Kj=function $yD(a){this.Jv=a||undefined;this.Ib()&&this.If()};LG[w].If=function $zD(){if(this.Jv){var a=!this.Ib()&&this.Ga()!=ela,c=this.b();if(a){Fa(c[x],yd);Wm(c,h)}this.Jv.If(c,this.mAa,this.jja);a&&Wm(c,k)}};H(UG,nn);var EOa=[zOa,tl];F=UG[w];F.D=function $AD(){if(!this.Pc){UG.C.D[z](this);this.na.D();this.na=i;this.Ha.D();this.Ha=i}};F.Nc=function $BD(){var a=this.Y,c=this.X(Kd),d=this.X(Ph);Q(this.Ha.b(),wOa({ijd:Yz(this.Lb,6594),Imd:c,p6a:d,uq:LOa(this)}));var f=a.cb();this.na.w(f,ij,this.i5c,h);this.na.w(f,fj,this.mka);this.na.w(a.b(c),P,this.Yb);this.na.w(a.b(d),P,this.Yb);this.Ha.ra(h);this.Ha.b()[Ek]()};F.Yb=function $CD(){this.na.wb();this.Cb.lf();this.Ha.ra(k)};F.i5c=function $DD(){this.Yb()};
+F.mka=function $ED(a){Zg(this.Ha.b(),a[y])||this.Yb()};
+var MOa=String[rq](17)+"+s",hlb={title:"Jumping",bq:[V4a,W4a,X4a,Y4a,Z4a,a5a]},ilb={title:"Navigation",bq:[eM,["PREV/NEXT","Newer/older conversation"],["OPEN|Enter","Open conversation; collapse/expand conversation"],["PREVMSG/NEXTMSG","Read previous/next message"]]},jlb={title:"Application",bq:[P4a,Q4a,U4a,n5a]},klb="Actions",rQ={title:klb,bq:[KG,hM,R4a,o5a,iM,jM,kM,mM,nM,oM,pM,qM,rM,i5a,["Tab>Enter","Send mail"],h5a,["REMOVE_LABEL_AND_PREV/REMOVE_LABEL_AND_NEXT","Remove conversation from current view and go previous/next"],
+sM,tM,l5a,m5a,[FOa,"Save draft"]]},NOa=[[hlb,{title:"Threadlist selection",bq:[b5a,c5a,d5a,e5a,f5a,g5a]},ilb,jlb],[rQ]];OOa[w].kc=function $FD(){var a=[];a[p](QOa(this.CQc));a[p](QOa(this.wQc));a[p](QOa(this.kPc));a[p](QOa(this.lPc));a[p](QOa(this.jPc));return a};var llb='px;" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>',mlb='<embed id="%s" src="%s" style="position:absolute;top:'+(Si?Hj:Ah)+"px;left:"+(Si?Hj:Ah)+"px;height:"+(Si?Hj:"100")+"px;width:"+(Si?Hj:"100")+llb;H(cPa,EC);var nlb="Unsubscribe and report spam",olb="Unsubscribe from ",plb="Unsubscribe from these lists?";cPa[w].Jc=function $GD(){this.oh((new DC).set(Cz,nlb,h).set(VE,vWa).set(dx,vP,k,h));var a=Yz(this.Lb,80405);if(this.qGa[u]==1){this.Fc(olb+(this.qGa[0]+Kj));this.xb(VOa({name:this.qGa[0],tc:a}))}else{this.Fc(plb);this.xb(bPa({YX:this.qGa,tc:a}))}};var qlb={};qlb.ix_cps=250;zx(dPa,pya);dPa[w].CJa=function $HD(a){if(a==By)return new ry(By,this.sAa);return i};var rlb="cm2/";dPa[w].KMa=function $ID(a){return(a=Mf(a,rlb)?a[lb](4):i)?qlb[a]:i};dPa[w].Hwa=E(k);var ePa=i;gH.vC(N);H(iH,uh);iH[w].ah=k;iH[w].nI=k;iH[w].kec=k;H(hPa,N);F=iH[w];var slb="onunload",tlb="embed",ulb="plugin";F.tb=function $KD(){if(L)try{ba[vaa](slb,G(this.Mra,this));this.ec=new ActiveXObject("GoogleTalk.Plugin")}catch(a){this.ec=i}else if(Je[gd])if(bp[vb]["application/googletalk"]){var c=this.ya.cb()[Qb](tlb);c.id=ulb;Ba(c,ulb);ka(c,1);Wa(c,1);za(c,"application/googletalk");this.ya.cb()[mc][o](c);this.ec=c}else this.ec=i;else this.ec=i;this.ec&&this.Bsa();return!!this.ec};
+F.Bsa=function $LD(){if(!this.ah)if(this.Zva<2E4){Dh(this.Bsa,2E3,this);this.Zva+=2E3;try{this.ec.onmessage=G(this.bIc,this)}catch(a){}}else iPa(this)};var vlb="of-msg";ua(F,function $MD(a){if(this.ah){try{this.ec[Mb](a)}catch(c){return}this[r](new gH(vlb,a))}});var wlb="f-connect",xlb="f-ready",ylb="f-dead",zlb="jmidata";
+F.bIc=function $ND(a){if(!this.ah)this.ah=h;a=new gH(jH,a);if(a.ck==wlb){if(!this.F6a)this.F6a=Dh(this.gcc,1E4,this);this.G6a[p](hH(a).pop())}else{if(a.ck==xlb){this.nI=h;Eh(this.F6a);this.F6a=i;this.G6a[p]({iDd:h});this.gcc();zf(this.Vxa,{jid:this.Zv,domain:ea[mq],useragent:ug(),pluginversion:this.ec[Za],renderer:this.gz.U5()});var c=fH(this.gz);Ue(c)&&c.GU()&&zf(this.Vxa,{o3dVersion:c.Cy()});this[Mb](zh([kH,2,this.Vxa]))}else if(a.ck==ylb){this.nI=k;iPa(this)}else if(!this.kec&&a.ck==zlb)return;
+this[r](a)}};F.hsa=Ge("kec");F.Kl=D(pQ);F.Mra=function $QD(){this.ec=i};F.D=function $RD(){if(!this.xga()){this.Mra();iH.C.D[z](this)}};F.gcc=function $SD(){this[r](new hPa(this.G6a))};_B_prog(65)}catch(e){_B_err(e)}
+
+try{H(lH,uh);H(jPa,N);lH[w].CZ=0;kPa.vC(N);lPa.vC(N);F=lH[w];F.tb=function $TD(){if(!this.z7){this.HL=new iH(this.Zv,this.gz,i,this.Vxa);this.CZ=0;if(this.HL.tb()){Dh(this.Dwc,25E3,this);if(!this.z7){this.HL.dk(this);this.Q.w(this.HL,jH,this.Sua);this.z7=h}}else{this.Mra();oPa(this)}}};F.Mra=function $UD(){if(this.HL){this.HL.D();this.HL=i}};F.Dwc=function $VD(){this.CZ==0&&oPa(this)};F.vk=function $WD(){return this.z7&&this.CZ==1};F.GU=function $XD(){return!!this.HL};
+F.c7=function $YD(){var a=this.lA();a=a?a[4]:vPa(this);if(a.caps)return!!(a.caps&8);return k};F.qY=function $ZD(){return!!(mPa(this)&2)};F.Mpa=function $_D(){return!!(mPa(this)&1)};var sQ="nf",Alb="termall";
+F.Sua=function $0D(a){if(a.ck==kH){a=hH(a);if(!a[1]||a[1][Db](sQ)<0){this.ZI=a;this.ZI[4]||(this.ZI[4]=vPa(this));this.ZI[4].clientver=1;Ke(this.ZI[4].renderer)||(this.ZI[4].renderer=1);this.ZI[4].browserRenderer=this.gz.U5();if(mG)this.ZI[4].flashVersion=oMa;if(Ue(fH(this.gz)))this.ZI[4].o3dVersion=fH(this.gz).Cy()}oPa(this)}else if(a.ck==mH)this[r](new lPa(hH(a)));else if(a.ck==Alb)this[r](Jd);else if(a.ck==ylb)this.iDa=this.ZI=i;else if(a.ck==KD){this.iDa=hH(a)[1];this[r](new jPa(wPa(this)))}};
+var Blb="0.0.0";F.lA=function $1D(a){var c;if(!this.ZI||this.ZI[1]==I)c=[kH,nPa,Blb,1,vPa(this)];else{c=this.ZI[lb]();if(!(this.gz.U5()&mPa(this,c))){c[1]=nPa;c[2]=Blb;c[4].os=uPa(this)}}return a?zh(c):c};F.wy=function $2D(){if(!this.iDa)return 0;switch(this.iDa.callType){case Bz:return 3;case Kd:return 1;default:return 0}};F.hsa=function $3D(a){this.HL&&this.HL.hsa(a)};F.D=function $4D(){if(!this.xga()){this.Q.D();this.Q=i;this.HL&&this.Mra();lH.C.D[z](this)}};H(oH,oB);oH[w].HNa=D("Wqd");H(xPa,xx);F=xPa[w];F.Vr=B();F.Vr.ic=h;F.Rca=B();F.Rca.ic=h;F.D=B();F.D.Ka=h;H(yPa,Jf);yx(xPa,yPa);F=yPa[w];F.Vr=function $9D(a,c,d){this.aa.Vr(a,c,d)||KVa(pH(this,d),a,c)};F.Rca=function $$D(a,c,d,f){this.aa.Rca(a,c,d,f)||LVa(pH(this,f),a,c,d)};F.BQ=function $aE(a,c){pH(this,c).daa(a)};F.Hp=function $bE(a){var c=zPa(this,a);return c?c.wH(a):i};F.L=function $cE(){this.s0=i;this.aa.D()};H(BPa,uh);F=BPa[w];F.cCa=Ge("Xda");F.Ad=function $eE(a){if(a.Wd()){this.gr&&this.gr.D();this.gr=a;DPa(this)}else this.IK()};F.IK=function $fE(){if(this.gr){this.IB();EPa(this);this.gr&&this.gr.D();this.gr=i}DPa(this,h)};F.Mna=function $gE(){var a=this.gr;a&&this.Xda&&this.Xda.Ad(a,a.vH());EPa(this)};F.ZK=function $hE(){return!!this.v_};F.Ox=function $iE(){if(this.qa==2)this.qa=3};F.Nxa=function $jE(){if(this.qa==1)this.Ad(this.Vrb[jd](0,1)[0]);else this.qa==3&&this.IK()};
+F.IB=function $kE(){this.v_&&cA(this.v_);this.v_=i};F.L=function $lE(){BPa.C.L[z](this);this.IB();EPa(this);this.gr&&this.gr.D()};H(uH,Gy);var GPa={},f1a=new Hf({group:ce});va(uH[w],E("Group"));var Clb="/group=";uH[w].Xs=function $nE(){return this.Ga()+Clb+this.yr};uH[w].FL=vN;uH[w].Qb=E(ey);H(vH,AD);F=vH[w];F.md=Me;F.TO=Me;F.ej=Me;F.sK=function $pE(){var a=[];this.ej(a);return a};F.Bo=E(k);F.ln=E(k);F.gY=E(k);F.Df=Me;F.Wb=Me;F.X_a=function $tE(){vC(this.Cb,0)};F.EIb=E(h);F.Jpa=E(h);F.Qh=Me;Bp(F,Me);var Dlb=" type:";Ha(F,function $wE(){return vj+fg(this[Sk])+Dlb+this.md()+wh});H(wH,dF);F=wH[w];F.Lca=function $xE(a,c){for(var d=0;d<a[u];d++)a[d].qc(k);wH.C.Lca[z](this,a,c)};F.Vp=function $yE(a){var c=this.rb(a);yA++;try{var d=wH.C.Vp[z](this,a);if(d&&c==this.Wx)this.Wx=i}finally{zA()}return d};F.Q3=function $zE(a){if(a==vA)return k;var c=this.Wx;if(c)if(!JA(c,a)||!jBa(c,a))return k;return h};F.oF=function $AE(a){var c=this.Wx;if(!c)return 0;var d=c.KT(a),f=c.WZ(a),g=c.rK(a);if(JA(c,a))return LA(c,a);if(g==-1)return l.min(l.max(LA(c,a),d),f);return d};
+F.VV=function $BE(a){var c=this.Wx;c&&kBa(c,a);MA(this,a,-1)};F.di=function $CE(a,c,d){wH.C.di[z](this,a,c,d);d=this.Wx;var f=this.qj();if(d){AA[p](d);YAa(a,c,AA);Ia(AA,0);var g=BA[a][d.ea()];d.ip(a,g,a==vA&&c!=-1&&g==c)}for(c=0;c<f;c++){g=this.rb(c);g!=d&&g.ip(a,0,h)}};H(yH,uh);yH[w].Lf=k;yH[w].BRa=k;yH[w].Ry=i;var zH=L&&ea.documentMode>=8||Fh&&vg("1.9.2")||Jg&&vg("532.1");F=yH[w];F.dja=i;F.L=function $DE(){yH.C.L[z](this);this.Q.D();this.Ac(k)};var Elb="pageshow";
+F.Ac=function $EE(a){if(a!=this.Lf)if(L&&!zH&&!this.KKa)this.dec=a;else if(a){if(Ng)this.Q.w(this.dg[yc],Flb,this.W9c);else Fh&&this.Q.w(this.dg,Elb,this.hx);if(zH&&this.lca){this.Q.w(this.dg,Xea,this.L1c);this.Lf=h;this[r](new RPa(AH(this)))}else if(!L||this.KKa){this.Q.w(this.ab,yj,this.rJ);this.Lf=h;if(!L)this.Ry=AH(this);this.ab[Rc]();this[r](new RPa(AH(this)))}}else{this.Lf=k;this.Q.wb();this.ab[qc]()}};F.j4b=function $FE(){this.KKa=h;this.tva[q]&&BH(this,this.tva[q],h);this.Ac(this.dec)};
+F.hx=function $GE(a){if(a.pj.persisted){this.Ac(k);this.Ac(h)}};F.L1c=function $HE(){var a=this.Mga(this.dg);a!=this.Ry&&this.Pa(a)};F.Zaa=function $IE(a,c){QPa(this,a,k,c)};F.Mga=function $JE(a){a=a[Ic][Yc];var c=a[Db](Lj);return c<0?I:a[Zc](c+1)};F.gma=function $KE(a,c){a=this.GD+(a||I);var d=this.dg[Ic];if(a!=d[Yc])if(c)d[mb](a);else Mp(d,a)};
+F.rJ=function $LE(){if(this.lca){var a=this.Mga(this.dg);a!=this.Ry&&this.Pa(a)}if(!this.lca||L&&!zH){a=PPa(this)||I;if(this.dja==i||a==this.dja){this.dja=i;a!=this.Ry&&this.Pa(a)}}};F.Pa=function $ME(a){this.Ry=pa(this.tva,a);if(this.lca){L&&!zH&&BH(this,a);this.gma(a)}else BH(this,a);this[r](new RPa(AH(this)))};F.WXa=function $NE(a){if(this.BRa!=a)this.ab[Dc](a?1E4:150);this.BRa=a};F.W9c=function $OE(){this.ab[qc]();this.ab[Rc]()};var Flb=[fj,ij,hj],OPa=0;H(RPa,N);H(WPa,uh);F=WPa[w];F.Ry=I;F.D=function $PE(){if(!this.Pc){WPa.C.D[z](this);this.eP.D();this.eP=i}};F.gH=function $QE(a){return a?this.Haa(a):AH(this.eP)};F.dpb=function $RE(a){if((a.ce||I)==this.Ry)a[Ec]()};F.Haa=function $SE(a){return this.rca.Rjc[a[Wq]].Gaa(a)[kd](Md)[mb](/\/$/,I)};var Glb=new wNa(dab,Pd),Hlb=new wNa(dab,dx),Ilb=new wNa(dab,kD);H(cQa,N);var dQa=15,eQa=new Bm(4,4,4,4),fQa=new Bm(0,0,0,0);CH[w].jCa=function $TE(a){qma(this,a);return this};H(DH,AD);var iQa=ifa.J()?3:4;F=DH[w];F.e2b=k;F.D=function $UE(){DH.C.D[z](this);this.Ck.yu[Pb](this);this.nU.D()};F.zc=function $VE(){return this.kYb?this.vz[0]:i};F.oWa=function $WE(a){return jQa(this,a)};var Jlb="Starting navigate";
+fp(F,function $XE(a){mQa(this,Jlb);lQa(this);var c=a[Wq],d=this.V,f=this.rca.VEa[c]||i;if(f){c=this.Zia=new sCa;var g=jA(d,f);if(g)this.nV(a,c,g);else{nQa(this,Glb);this.glb=f;this.y1b.set(f,a);this.GW=new jB;this.GW.Se(iB);WC(this.Ck);d=this.xra=kA(d,f);Zw(d,G(this.R6c,this,a,c));Yw(d,G(this.FTa,this,a,c));Yw(d,sg)}return c}else e(new Rh("ERROR : No view service registered for "+c))});F.SH=function $YE(a){var c=k;if(a=ZPa(this.nU,a)){this.jb[bq](a);c=h}return c};F.gH=function $ZE(a){return this.nU.gH(a)};
+Bp(F,function $_E(){var a=this.zc();if(a){a[Sq]();this[r](vA)}});var tQ="Da";F.Jc=function $0E(){this.H().w(this,[ki,NO],this.A5c);this.H().w(this,tQ,this.iob)};F.R6c=function $1E(a,c,d){nQa(this,Hlb);var f=this.GW;this.GW.D();this.xra=this.GW=i;this.nV(a,c,d);if(f){lB(f,4);f.D();WC(this.Ck)}};var Klb="View Created";
+F.nV=function $2E(a,c,d){this.lya=new jB;var f=this.zc();if(f)a.Ica=f;var g=d.pga(this.V,this,a);if(g&&g==f){yA++;try{this.zc()[Sq]();GB(c,1);this[r](vA)}finally{zA()}oQa(this);WC(this.Ck);XPa(this.nU,a||{view:g.md()})}else if(f&&f.Bo(h)){this.mw.s5a();GB(c,2);oQa(this)}else{if(!g){g=d.JJ(this.V,this,a);gQa(this,g)}mQa(this,Klb);yA++;try{c=g;if(!this.Z2[bd](c))e(Error(".143"));if(c.ln(a)){oQa(this);this.oWa(c);c.D()}else{this.gL=c;this.Cxa=a;oQa(this);sQa(this)}WC(this.Ck)}catch(j){e(j)}finally{zA()}this[r](new cQa(ey,
+this.Cxa,f,g))}};F.dpb=function $3E(){this.cGb&&this.SH()};F.X9b=function $4E(a){if(this.Z2[bd](a))e(Error(".142"));this.ia[Nc](a);a.D()};F.di=function $5E(a,c,d){DH.C.di[z](this,a,c,d);if(this.f2b){this.f2b=k;(a=this.zc())&&a.X_a()}};F.yGa=function $6E(a){DH.C.yGa[z](this,a);if(this.e2b&&!this.xv()){this.b()[ql];this.e2b=k}};var Llb="gL";F.cGc=D(Llb);F.Xta=function $8E(){return this.gL||this.zc()};
+F.sK=function $9E(){var a=this.Xta(),c=[];a&&a.ej(c);this.GW&&c[p](this.GW);this.lya&&c[p](this.lya);return c};F.Ina=B();F.A5c=function $aF(a){a:{for(a=a[y];a&&a!=this;){if(a instanceof vH){a=a;break a}a=a.rv()}a=i}if(a==this.gL||a==this.zc()){sQa(this);WC(this.Ck)}};F.iob=function $bF(a){this.Ina(a[y])};F.Qh=function $cF(a,c){var d=this.zc();d&&d.Qh(a,c)};
+F.FTa=function $dF(a,c,d){if(d instanceof wi)return i;a=this.rca.VEa[a[Wq]]||i;if(this.glb&&this.glb==a){nQa(this,Ilb);GB(c,3);oQa(this);if(this.GW){this.GW.D();this.GW=i}this.xra=this.glb=i;WC(this.Ck)}return d};_B_prog(66)}catch(e){_B_err(e)}
+
+try{uQa[w].ula=function $eF(a,c,d){var f=wQa(this,a,c);if(f[u]==0&&this.bqd)f=xQa(this,a,c);d(a,f)};var zQa={};var eI=new oCa(K4a);H(HH,uh);HH[w].Gi=function $fF(a,c,d,f){this.ab[Vc]||this.ab[Rc]();this.ee.set(c,a);this.wYa[c]=d;this.gMa[c]=f};HH[w].cG=function $gF(a){this.ee[Pb](a);delete this.wYa[a];delete this.gMa[a];this.ee.nd()&&this.ab[qc]()};HH[w].Pa=function $hF(){for(var a=qC(this.V).W(),c=this.ee.Sb(),d=0;d<c[u];d++){var f=c[d],g=gGa(this.ee.J(f),this.wYa[f],this.gMa[f]),j=a.b(f);if(j)Q(j,g);else this.cG(f)}};HH[w].D=function $iF(){if(!this.Pc){this.gMa=this.wYa=this.ee=i;this.ab[qc]();this.ab.D();this.ab=i;HH.C.D[z](this)}};var LQa=/\r\n/g,MQa=/\r/g;var oRa;H(nRa,Iw);nRa[w].tb=function $jF(){var a=fD(this.Db);hD(a,this,[SO]);iD(a,this,[oRa]);gD(a,SO,XD);lA(this.Db,XD,RO)};nRa[w].Gaa=function $kF(){return[oRa]};nRa[w].aca=function $lF(){return{view:SO}};H(QH,Vn);QH[w].Hi=function $mF(a){this.FXb=h;QH.C.Hi[z](this,a)};var Mlb="200px",Nlb=":20";
+QH[w].oAa=function $nF(){var a=this.fe(),c=a.b(),d=a.Cd();qma(c[x],I);Wa(d[x],I);if(!a.Ib()){c[x].brd=yd;if(Ng)dha(c[x],Ah);Wm(c,h)}if(this.FXb){var f=Nm(this.OZb||this.b()),g=Um(this.Jfd||this.b());a instanceof OJ&&a.gCa(I);f=g[Ck]+g[ib]-f.x-8;if(L&&!vg(aj)&&a instanceof OJ){ka(d[x],l.max((a.gm||i)[xk]+4,f)+Jm);if(!vg(Ij)){Wa(d[x],d[Rb]>200?Mlb:GA);bA(Nlb,this.hdc,100,this)}}else qma(d[x],f+Jm);this.FXb=k;up(d,0)}f=this.Nsc||(this.Qoa?5:7);d=this.sja||(this.Qoa?4:6);f=new en(this.OZb||this.b(),f,
+!L);g=new Bm(Fh&&!this.CXb?0:-2,0,0,0);if(d==6)qk(g,-3);else if(d==4)ck(g,-4);f.If(c,d,g);if(!a.Ib()){Wm(c,k);c[x].brd=ud;if(Ng)dha(c[x],I)}};QH[w].hdc=function $oF(){if(this.fe().Ib()){var a=this.fe().Cd();Wa(a[x],a[Rb]>200?Mlb:GA);bA(Nlb,this.hdc,100,this)}};RH[w].JJ=E(i);RH[w].TJa=E(i);RH[w].pga=E(i);H(SH,hy);SH[w].wr=function $sF(){Ix(this);var a=this.jea();this.jw[p](a);return a};H(qRa,xx);qRa[w].K2a=B();qRa[w].K2a.Ka=h;F=TH[w];F.utb=0;F.ea=D("Sq");F.Hc=D("Sq");var uQ="gk";F.g_=D(uQ);F.vf=D(uQ);F.Uf=function $yF(){return this.Zh(oI)};F.GPa=function $zF(){return this.Zh(EN)};var Olb="^vm";F.Gs=function $AF(){return this.Zh(Olb)};F.Dd=function $BF(a){return this.kl[a]};F.Zh=function $CF(a){return this.kl?ef(this.kl,a):k};var Plb="kl";F.Jo=D(Plb);F.wua=function $EF(){return this.Oy()?this.Jl?[AL]:[]:this.Mm()?this.Jl?[BL]:[]:this.Zba};F.Oy=function $FF(){return this.Zh(AL)};F.Mm=function $GF(){return this.Zh(BL)};
+var Qlb="rB";F.sH=D(Qlb);F.qjb=D("eQc");var Rlb=/_/;TH[w].Ojb=D("DQc");TH[w].LRa=function $KF(){if(this.Jl){this.Jl=k;this.Zba=[];this.utb=1;this.A4=this.hWa(this.A4);this.rB=this.hWa(this.rB);tRa(this);this.bI&&kya(this.bI,this,2)}};TH[w].hWa=function $LF(a){return a[mb](/<b>/gi,I)[mb](/<\/b>/gi,I)};var vRa=new RegExp(rRa,ag),uRa=new RegExp(sRa,ag);F=TH[w];F.mB=function $MF(a){this.bI.mb.Qf();try{a.Uf?this.bS(oI,1):this.TL(oI,1);this.aa.mB(a)}finally{this.bI.mb.Mf()}};
+F.bS=function $NF(a,c){return this.dV(a,i,c)};F.TL=function $OF(a,c){return this.dV(i,a,c)};F.dV=function $PF(a,c,d){var f=k,g,j;if(Ye(c)){if(jf(this.kl,c)){jf(this.Zba,c);f=h}}else if(Ve(c))for(g=0;g<c[u];++g){j=c[g];if(jf(this.kl,j)){jf(this.Zba,j);f=h}}if(Ye(a)){if(!ef(this.kl,a)){this.kl[p](a);this.Jl&&this.Zba[p](a);f=h}}else if(Ve(a))for(g=0;g<a[u];++g){j=a[g];if(!ef(this.kl,j)){this.kl[p](j);this.Jl&&this.Zba[p](j);f=h}}if(f)this.bI&&kya(this.bI,this,d||4);return f};var Slb=" unread",Tlb=" labels=";
+Ha(F,function $QF(){var a=[];a[p](this.gk);this.Jl&&a[p](Slb);a[p](Tlb+this.kl[kd](wj));this.rB&&a[p](J+this.rB);this.gda&&a[p](J+this.gda);return a[kd](I)});var Ulb="bI";F.Raa=Ge(Ulb);yx(xRa,TH);xRa[w].mB=B();H(yRa,xx);F=yRa[w];F.Lua=B();F.Lua.ic=h;F.h1=B();F.h1.ic=h;F.p3=B();F.p3.Ka=h;H(UH,oH);yx(yRa,UH);F=UH[w];F.Rja=-1;F.evb=0;F.Ay=function $WF(){return this.Ixa.Ay()};F.MT=function $XF(){return this.Ixa.MT()};F.axb=Ge("Rja");F.Fwb=Ge("Cab");var Vlb="Loading threadlist",Wlb="ari";F.Ja=function $_F(a){UH.C.Ja[z](this,a);a.Se(Vlb);a.Ua(pd,DE);this.Ixa.Ja(a);this.aa.p3(a);if(this.Gib){a.wl(h);a.Ne(mB);a.OW(k);a.Ua(GA,Hj);a.Ua(rd,ti);a.Ua(LD,Fi);this.Rja!=-1&&a.Ua(Wlb,this.Rja);a.sCa(3E4)}else{if(this.xl&&zHa(this.xl)||this.Cab)a.Ua(vl,Ah);a.wl(k);a.Ne(JP);a.OW(h)}};
+var Xlb="ti",vQ="tb",Ylb="tlm",Zlb="tsp",amb="iu",bmb="tnt";
+F.r_=function $0F(a,c){for(a=0;a<c[u];){var d=c[a],f=d[0];switch(f){case Xlb:f=this.Kd;f.oc==this&&f.YL(this.Ay(),this.MT());this.Kd.RU();f=this.Xi;f.Pc||f.set(new LRa(d));kB(this,2);a++;break;case vQ:a=this.Xfb(c,a);break;case Ylb:this.Kd.RU();ZH(this.Kd);this.Xi.RU();a++;break;case Zlb:this.QPc=h;f=d[1];this.Kd.PTa(f[0],f[1],f[2]);f=this.Xi;if(!f.Pc){f=f.J();MRa(f,d[2]);var g=d[3];if(g!=f.wna){f.wna=g;f[r](oy)}g=d[4];if(g!=f.y_a){f.y_a=g;f[r](oy)}d=d[5];if(d!=f.hEa){f.hEa=d;f[r](oy)}}kB(this,3);
+a++;break;case jO:this.gla=h;this.Kd.uL(this);a++;break;case amb:this.Kd.RU();this.Xi.RU();this.pUb(d);a++;break;default:this.aa.Lua(f,d);a++;break}}if(this.aa.h1())this.gla=h;if(this.evb){kB(this,3);Jz(this.Z,793)&&aF(this.B()).Hz(bmb,this.evb)}};F.rza=function $1F(){this.gla||this.Kd.uL(this)};F.h1=D("gla");
+F.Xfb=function $3F(a,c){var d=this.Xi.mb,f=d.za(qI),g;if(f)g=rI(f,this.Xi.Bb(),h);d.Qf();try{this.Xi.J();for(var j=c;j<a[u];){var n=a[j];if(n[0]!=vQ)break;var s=n[1],v=n[2];for(c=0;c<v;c++){var C;var M=this.Xi;if(M.Pc)C=void 0;else{var Y=new TH(M.gPb,n[c+3]);C=PRa(M,Y)}if(g){var ha=C.J();ISa(g,ha.Hc(),ha.dL)}GRa(this.Kd,this,s+c,C);this.evb++}j++}}finally{d.Mf()}return j};var wQ="Kd";F.wr=D(wQ);F.Zn=D("Xi");F.pUb=B();_B_prog(67)}catch(e){_B_err(e)}
+
+try{F=zRa[w];F.Rf=0;F.Cf=50;F.zja=50;F.a1=kD;F.Ay=D("Rf");F.setStart=Ge("Rf");F.Nb=D(uea);F.wwb=Ge(Zkb);var cmb="a1";F.B6=D(cmb);F.lma=Ge(cmb);F.axb=Ge("Rja");ARa[w].Ola=function $dG(a){a[Mb]()};H(VH,bG);F=VH[w];F.Og=70;F.Lz=yLa;F.Uz=-1;F.Eo=-1;F.L8=-1;F.D=function $eG(){VH.C.D[z](this);this.L8=this.Eo=this.Uz=-1;Ia(this.ON,0);for(var a=this.PN.Oa(),c=0;c<a[u];c++)a[c].bB();this.PN[bc]();this.na.D();jf(this.qn.jw,this)};var dmb="PD";F.Yla=Ge(dmb);BRa[w].kia=D("PBc");H(CRa,N);F=VH[w];var xQ="Og";F.Jw=D(xQ);F.NO=function $iG(){if(this.oc)return l.min(this.Uz,this.oc.Ay());return this.Uz};F.jNa=function $jG(){return this.oc?[this.oc]:[]};F.hc=function $kG(a){return a>=this.Uz&&a<this.Eo};
+F.J=function $lG(a){if(this.hc(a))return(a=this.ON[a])?a:i};na(F,function $mG(a){DRa(this);pRa(this.qn,this);this.oc=this.x7a(a);this.Ved.Ola(this.oc);return this.oc});F.uL=function $nG(a){if(this.oc==a){if(a.h1())this.Eo=a.Ay()+a.MT();this.oc=i}};qaa(F,function $oG(a){for(var c=this.Eo,d=this.Uz;d<c;d++)if(this.ON[d]==a){kf(this.ON,d);this.Eo--;YH(this,new WH(3,d));break}if(this.PN.J(a.Je())){a.bB();this.PN[Pb](a.Je())}});
+cha(F,function $pG(a){var c=a.J();if(!(this.Uz>=this.Eo)){this.PN.J(a.Je())&&this[ad](a);var d=this.Uz,f=this.Eo,g=HRa(this),j=-1,n=this.ON[d];if(n)if(this.PD(n.J(),c)>0||d==0)for(d=d;d<f;d++){n=this.ON[d];if(!n)break;if(this.PD(n.J(),c)<1){j=d;break}}else return;if(j<0&&g!=f)j=g;if(j>=0){km(this.ON,a,j);this.PN.set(a.Je(),a);a.Iz();this.Eo++;this.L8++;YH(this,new WH(2,j,a))}}});F.PTa=function $qG(a,c,d){var f=new WH(6);f.Hcd=new BRa(a,c,d);YH(this,f)};
+F.yib=function $rG(a){if(this.oc==a){DRa(this);this.Eo=a.Ay()+a.MT()}};var emb="Lz";F.zMa=D(emb);F.Es=function $tG(){return this.Lz==ly};F.RU=function $uG(){this.Lz=ly};F.rg=function $vG(){this.Lz=yLa;YH(this,new WH(5))};F.containsNode=function $wG(a){return this.PN.Xb(a.Je())};F.YL=function $xG(a,c){this.Lz=yLa;this.L8=this.Eo=this.Uz=a;this.Og=c;Ia(this.ON,0);a=this.PN.Oa();for(c=0;c<a[u];c++)a[c].bB();this.PN[bc]()};F.u7c=function $yG(){if(!this.Vha)this.Vha=h};
+F.F0c=function $zG(){if(this.Vha){this.lVb=this.Vha=k;if(this.HD[u]){var a=new CRa(this,this.HD);this.HD=[];for(var c=[],d=this;d;d=d.rv())c[p](d);for(d=0;d<c[u];d++){sa(a,c[d]);jx(c[d],a[Zb],k,a)}}}};H(KRa,zRa);KRa[w].Fwb=Ge("Cab");H(aI,VH);yx(qRa,aI);aI[w].kPa=function $BG(a,c){var d=new BNa(this.qn.Bb(),c.Ay(),c.Nb());d.wwb(c.HY);a.Ixa=d;this.aa.K2a(a,c);d=c.B6();if(d==kD)a.Gib=k;else if(d==Ph)a.Gib=h;else e(Error(".146"));if(c.Rja)(d=c.Rja)&&a.axb(d);a.Fwb(!!c.Cab)};aI[w].x7a=function $CG(a){var c=new UH(this.qn,this);this.kPa(c,a);return c};H(LRa,uh);F=LRa[w];
+F.fca=function $DG(a){var c=k;if(a[1]!=this.ug){this.ug=a[1];c=h}if(a[2]!=this.nj){this.nj=a[2];c=h}if(a[3]!=this.y_a){this.y_a=a[3];c=h}if(Boolean(a[3])!=this.wna){this.wna=Boolean(a[3]);c=h}if(a[5]!=this.ae){this.ae=a[5];c=h}if(a[6]!=this.ZZa){this.ZZa=a[6];c=h}if(a[7]!=this.Kmb){this.Kmb=a[7];c=h}if(a[8]!=this.hEa){this.hEa=a[8];c=h}if(a[9]!=this.oO){this.oO=a[9];c=h}if(a[10]!=this.dAb){this.dAb=a[10];c=h}if(a[11]!=this.j4a)this.j4a=a[11];if(a[5]!=this.ae){this.Cgc=a[12];this.r9b=a[13];c=h}c&&
+this[r](oy)};F.Le=D(RN);var fmb="nj";F.xK=D(fmb);F.fN=D("wna");F.Qe=D(ge);F.xeb=D("hEa");var gmb="oO";F.I_=D(gmb);F.uua=D("dAb");F.DPa=D("j4a");F.Fc=function $MG(a){if(a!=this.ug){this.ug=a;this[r](oy)}};F.hdb=D("Kmb");var hmb=" total_threads=",imb=" estimates",jmb=" query=";Ha(F,function $OG(){var a=[];a[p](this.ug);a[p](hmb+this.nj);this.wna&&a[p](imb);a[p](jmb+this.ae);return a[kd](I)});H(NRa,xx);NRa[w].jea=B();NRa[w].jea.Rn=h;H(ORa,SH);yx(NRa,ORa);F=ORa[w];F.Bb=D(NO);F.rg=function $RG(){Ix(this);this.QK()};F.QK=function $SG(){ORa.C.QK[z](this);pRa(this);this.mb.Qf();try{for(var a=this.Uc().Oa(),c=0;c<a[u];c++)a[c].PK()}finally{this.mb.Mf()}};F.RU=function $TG(){Ix(this);lya(this)};F.jea=function $UG(){var a=this.aa.jea();a||(a=new aI(this));return a};var kmb=dI(MF),lmb=dI(EO),mmb=dI(oA),yQ="sc",nmb=dI(yQ),omb=dI(Ph),pmb=dI(ki),qmb=dI(QL),rmb="asc",smb=dI(rmb),tmb=dI(WE),zQ="nc",umb=dI(zQ),vmb=dI(Ej);var wmb=["#00681c","#790619","#5b1094","#c88900","#cc0060","#008391","#009486","#b90038","#846600","#330099"];VRa[w].cta=function $VG(a){var c=this.dHb[a];if(!c){c=wmb[this.Cf%wmb[u]];this.dHb[a]=c;this.Cf++}return c};H(WRa,uh);F=WRa[w];F.Hc=D("Sq");F.vf=D(uQ);F.Bb=D(NO);F.GT=function $ZG(){for(var a=new cg,c=XRa(this),d=0;d<c[u];d++){var f=this.GQa[c[d]];f&&a.Vl(f)}return a};F.Jo=function $_G(){return this.GT().Oa()};var xmb="threadid=",ymb=" msgids=";Ha(F,function $0G(){return xmb+this.gk+ymb+this.wf[kd](wj)});H(fI,xx);fI[w].nB=B();fI[w].nB.ic=h;fI[w].D=B();fI[w].D.Ka=h;H(gI,oH);F=gI[w];F.nj=-1;F.Jv=-1;F.Bya=k;var zmb="qX";F.fN=D(zmb);F.Ja=function $4G(a){gI.C.Ja[z](this,a);a.Ua(pd,OD);a.Ii(this.IY.Bb())};H(dSa,xx);dSa[w].p3=B();dSa[w].p3.ic=h;H(hI,gI);yx(dSa,hI);hI[w].tYa=Ge("IKb");var Amb="ser",Bmb="Loading message data",Cmb="Loading conversation";hI[w].Ja=function $7G(a){hI.C.Ja[z](this,a);a.bD(k);a.wl(k);a.Ua(PD,this.kX||this.Yda.vn());this.IKb&&a.Ua(RD,this.IKb);if(this.wf){a.Ne(JP);a.OW(k);a.Ua(X3a,this.wf[kd](wj));this.Tjd&&a.Ua(Amb,Hj);this.q_b&&a.Ua(Y3a,Hj);a.Se(Bmb)}else{a.Ne(JP);a.OW(h);a.Se(Cmb)}this.aa.p3(a)};var Dmb="cnf";
+hI[w].r_=function $8G(a,c){a=k;this.Yda.mb.Qf();try{for(var d=0;d<c[u];d++){var f=c[d];switch(f[0]){case OL:vSa(this.Yda,f);kB(this,2);break;case lE:wSa(this.Yda,f);a=h;break;case Dmb:this.Bya=h;break;case qD:xSa(this.Yda);break}}}finally{this.Yda.mb.Mf()}if(a){kB(this,3);this.Wm&&this.Wm.rha&&this.Wm.rha()}};H(fSa,uh);F=fSa[w];F.Us=function $9G(){var a=[this.Ea.Dg(),this.Sq,this.lHa,lE,this.gf,this.VVa,this.eZ,this.fQb,this.dga,this.Nt,this.Od[hc](),this.hZa,this.vQ,this.iOa,this.QXb,this.zba,i,this.vub,this.Tib,this.Gxb,this.Qbb,this.Zwa,this.rB,this.XGa,this.gda,this.hxa,this.LPb,this.llb,this.wXa,this.Zhd,this.ewb,this.dwb,this.mYb,this.JOb,this.yic];this.aa.Us(a);return a};F.Bb=D(NO);F.Hc=D("Sq");F.OPa=D("Tib");F.ps=D("eZ");F.uy=D("fQb");var Emb="Od";jp(F,D(Emb));F.mi=D("zba");
+F.sH=function $gH(){return this.rB?this.rB:this.zba};F.Zh=function $hH(a){return ef(this.vQ,a)};F.wua=function $iH(){return this.Oy()?iI(this)?[AL]:[]:this.Mm()?iI(this)?[BL]:[]:iI(this)?this.vQ:[]};F.Uf=function $jH(){return this.Zh(oI)};var Fmb="^bc";F.Mp=function $kH(){return this.Zh(Fmb)};F.Oy=function $lH(){return this.Zh(AL)};F.Mm=function $mH(){return this.Zh(BL)};var Gmb="^p";F.L7=function $nH(){return this.Zh(Gmb)};F.Ny=function $oH(){return this.eZ==1};F.wha=D("iOa");
+F.Jga=function $qH(){return this.hxa||[]};F.Gs=D("Zwa");F.cta=D("lHa");F.H6=function $tH(){return this.aa.H6()};F.Vga=function $uH(){return this.aa.Vga()};F.Ijb=D("mYb");var Hmb="search=",Imb=" origthreadid=",Jmb=" msgid=",Kmb=" draft",Lmb=" snippet=";Ha(F,function $wH(){return Hmb+this.Ea+Imb+this.Sq+Jmb+this.gf+(this.Tib?Kmb:I)+Lmb+this.hZa+Tlb+this.hZa});F.bS=function $xH(a){return this.dV(a,i)};F.TL=function $yH(a){return this.dV(i,a)};
+F.dV=function $zH(a,c){var d=k,f,g;if(Ye(c)){if(jf(this.vQ,c))d=h}else if(Ve(c))for(f=0;f<c[u];++f){g=c[f];if(jf(this.vQ,g))d=h}if(Ye(a)){if(!this.Zh(a)){this.vQ[p](a);d=h}}else if(Ve(a))for(f=0;f<a[u];++f){g=a[f];if(!this.Zh(g)){this.vQ[p](g);d=h}}d&&this[r](oy);return d};F.mB=function $AH(a){var c=[],d=[];this.aa.mB(a,c,d);a.Uf?c[ld](oI):d[ld](oI);this.dV(c,d)};bk(F,function $BH(){if(this.eZ!=2&&this.eZ!=1){this.eZ=3;this[r](oy)}});yx(jSa,fSa);F=jSa[w];F.Us=B();F.Us.Ka=h;F.wU=B();F.wU.Ka=h;
+F.mB=B();F.mB.Ka=h;F.H6=B();F.H6.Ka=k;F.H6.Vd=h;F.Vga=B();F.Vga.Ka=k;F.Vga.Vd=h;_B_prog(68)}catch(e){_B_err(e)}
+
+try{F=kSa[w];F.oGb=Qj;var Mmb="&view=att&th=",Nmb="&attid=",Omb="&disp=attd";F.fca=function $HH(a){this.z8=a[0];this.fileName=a[1];this.lL=a[2];this.wsa=a[3];this.QG=l[rb]((this.wsa+1023)/1024);lSa(this,a[4]);this.iJ=a[5];this.Ro=a[6];this.Lab=a[7];this.yM=a[8];this.cT=a[9];this.TM=a[10];this.QEa=a[11];this.REa=a[12];this.Fza=a[13];this.Gza=a[14];this.Pka=a[15];this.PEa=a[16];this.d9=a[17];this.X2=a[18];this.Kfa=a[19];this.Dwa=Boolean(a[20]);this.GBa=a[21];this.eda=Qj+Mmb+this.Vy+Nmb+this.z8+Omb};
+F.Us=function $IH(){return[this.yL,this.Vy,this.z8,this[or],this.lL,this.wsa,this.hG,this.iJ,this.Ro,this.Lab,this.yM,this.cT,this.TM,this.QEa,this.REa,this.Fza,this.Gza,this.Pka,this.PEa,this.d9,this.X2,this.Kfa,this.Dwa,this.GBa]};
+F.vc=function $JH(){var a=new kSa(this.yL,this.Vy);a.z8=this.z8;a.fileName=this[or];a.lL=this.lL;a.wsa=this.wsa;a.QG=this.QG;a.hG=this.hG;a.iJ=this.iJ;a.Ro=this.Ro;a.Lab=this.Lab;a.yM=this.yM;a.cT=this.cT;a.TM=this.TM;a.QEa=this.QEa;a.REa=this.REa;a.Fza=this.Fza;a.Gza=this.Gza;a.d9=this.d9;a.Pka=this.Pka;a.aY=this.aY;a.QNa=this.QNa;a.eda=this.eda;a.PEa=this.PEa;a.d9=this.d9;a.X2=this.X2;a.Kfa=this.Kfa;a.Dwa=this.Dwa;a.GBa=this.GBa;return a};
+F.ET=function $KH(){return this.yL+mg+this.Vy+mg+this.z8+mg+this.hG};F=nSa[w];F.znb=0;F.Gnb=0;F.T2b=0;F.U2b=0;F.Hc=D("Sq");F.Nb=function $MH(){return this.sh[u]};F.XK=function $NH(){return!!this.vQc};H(pSa,uh);F=pSa[w];F.Jcc=function $OH(a){this.oIb=Ve(a)?Pmb(a):a};F.lAb=i;F.w5a=i;F.d4a=i;F.yub=i;F.o4a=i;F.m4a=i;F.l4a=i;F.n4a=i;
+F.Us=function $PH(){return[this.Ea.Dg(),this.Sq,this.gf,this.p_a,this.rIa,this.wHa,this.tWa,this.zba,this.DB,this.sh.odd,this.tac,this.QVa,,this.pIb,this.UYa,this.fkc,this.Dec,this.Zdc,this.NHb,this.I_b,this.pfc,this.awa,this.uub,this.tub,this.FRa,this.oIb,[this.Zwa,this.bkc,this.ckc,this.dkc,this.Zjc,this.akc],this.rB,this.hxa,this.Rlb,this.Sec,[this.Rjb,this.xMb,this.Q2b,this.L2b,this.dZb],this.ahb,this.Jt,[rSa(this)],this.k8b,this.Vkd.kc(),this.mec,this.sXb,this.lIa]};F.Bb=D(NO);F.Hc=D("Sq");
+F.PT=function $SH(a){if(a){if(!this.n4a)this.n4a=Exa(this.tWa);return this.n4a}else return this.tWa};F.mi=D("zba");F.sH=function $UH(){return this.rB?this.rB:this.zba};var Qmb="DB";F.Ew=D(Qmb);F.JYa=D("Dec");F.Kxb=D("Zdc");F.QYa=D("Sec");F.Wwa=D("Rjb");F.zKa=D("xMb");F.Hnb=D("Q2b");F.Zja=D("L2b");F.RQa=D("dZb");F.Idb=function $3H(){return this.QVa[1]};F.Gs=D("Zwa");F.Jga=D("hxa");F.Dia=function $6H(){return!!this.Jt&&this.Jt[0]==QN};F.Rxb=D("mec");F.lIa=D("Jvc");
+F.kIa=function $9H(){if(typeof this.CIb=="undefined")this.CIb=!(Fh&&this.ahb>160||Ng&&this.ahb>460);return this.CIb};var Rmb="msgid=",Smb=" subject=";Ha(F,function $$H(){return Rmb+this.gf+Smb+this.sH()});H(lI,hy);lI[w].nM=function $aI(a){var c=new fSa(this.Ea,this.Sq,this.lHa,a);if(a[13][u]){a=new pSa(this.Ea,this.Sq,a[13]);this.za(eg).set(a)}this.set(c)};lI[w].PK=function $bI(){if(this.Fi()){this.mb.Qf();try{this.za(eg).PK();this.QK()}finally{this.mb.Mf()}}};lI[w].L=function $cI(){this.aa.D();lI.C.L[z](this)};yx(tSa,lI);tSa[w].D=B();tSa[w].D.Ka=h;H(uSa,hy);yx(fI,uSa);F=uSa[w];F.bVb=k;F.Bb=D(NO);F.Hc=function $fI(){return this.vn()};na(F,function $gI(a,c){Ix(this);var d=new hI(this);c&&d.tYa(c);a&&eSa(d,a);d[Mb]();return d});F.dlb=function $hI(){Ix(this);if(!this.hc())e(Error(".148"));for(var a=this.J().v0,c=[],d=0;d<a[u];d++)c[p](a[d]);a=new hI(this);d=this.J().vf();a.kX=d;a.wf=c;a.q_b=h;a[Mb]();return a};F.rg=function $iI(){Ix(this);if(this.Fi()){this.mb.Qf();try{for(var a=this.Uc().Oa(),c=0;c<a[u];c++)a[c].PK();this.QK()}finally{this.mb.Mf()}}};
+F.GT=function $jI(){if(!this.hc())e(Error(".150"));return this.J().GT()};F.Jo=function $kI(){return this.GT().Oa()};F.wua=function $lI(){if(!this.hc())e(Error(".150"));for(var a=new cg,c=pI(this),d=0;d<c[u];d++){var f=c[d].wua();a.Vl(f)}return a.Oa()};F.nB=function $mI(a,c){if(this.hc()){Ix(this);for(var d=pI(this),f=0;f<d[u];f++){var g=d[f],j=g.gf;if(!this.aa.nB(g,j,a,c))if(c.Uf)j==a&&g.mB(c);else j<=a&&g.mB(c)}ASa(this)}};
+F.YXa=function $nI(a,c){if(this.hc()){Ix(this);(a=this.za(a))&&a.hc()&&!a.Ds()&&a.J().mB(c);ASa(this)}};F.Yaa=function $oI(a,c){if(this.hc()){Ix(this);for(var d=pI(this),f=0;f<d[u];f++){var g=d[f];g.gf<=a&&iSa(g,c)}ASa(this)}};F.Xwb=function $pI(a,c){if(this.hc()){Ix(this);for(var d=0;d<a[u];d++){var f=this.za(a[d]);if(f&&f.hc()&&!f.Ds()){f=f.J();iSa(f,c)}}ASa(this)}};F.Wwb=function $qI(a){if(this.hc()){Ix(this);(a=this.za(a))&&a.hc()&&!a.Ds()&&a.J().TL(BL);ASa(this)}};
+F.EFb=function $rI(a,c,d,f){if(this.hc()){Ix(this);a=!Ke(f);for(var g=pI(this),j=0;j<g[u];j++){var n=g[j];if(a||n.gf==f)for(var s=0;s<d[u];s++){var v=d[s];c?n.bS(v):n.TL(v)}}}};F.E4=function $sI(a,c){if(this.hc()){Ix(this);for(var d=pI(this),f=0;f<d[u];f++){var g=d[f],j=g.TL(a);c&&j&&g.bS(c)}}};F.Txc=function $tI(a){for(var c=0;c<a[u];c++){var d=a[c];d.OPa()||d[tk]()}};F.tka=function $uI(a,c,d,f){var g=this.J();ef(g.wf,c)||cSa(g,a,c,d,f)};F.Ydb=D("Whd");F.L=function $wI(){this.aa.D();uSa.C.L[z](this)};H(ESa,gI);var Tmb="cnp";ESa[w].r_=function $xI(a,c){a=k;this.IY.mb.Qf();try{for(var d=0;d<c[u];d++){var f=c[d];switch(f[0]){case Tmb:this.Fmd=f[1];this.KWc=f[2];this.nj=f[3];this.qX=f[4];this.Jv=f[5];this.LA=f[6];this.Wm&&this.Wm.zUb&&this.Wm.zUb();break;case OL:var g=this.IY.za(f[1]);vSa(g,f);this.on=g;kB(this,2);break;case lE:if(this.on){wSa(this.on,f);a=h}break;case Dmb:this.Bya=h;break;case qD:this.on&&xSa(this.on);break}}}finally{this.IY.mb.Mf()}if(a){kB(this,3);this.Wm&&this.Wm.rha&&this.Wm.rha()}};
+var Umb="prev",AQ="next",Vmb="nextprev";ESa[w].Ja=function $yI(a){ESa.C.Ja[z](this,a);a.bD(k);a.wl(k);a.Ne(JP);a.OW(h);a.Ua(PD,this.gk);var c=this.Obd;if(c==oy)a.Ua(Umb,1);else if(c==Zx)a.Ua(AQ,1);else if(c==ki)a.Ua(Vmb,1);else e(Error(".151"))};H(FSa,gI);F=FSa[w];F.R2b=0;F.S2b=0;F.Eg=E(k);F.r_=function $AI(a,c){this.IY.mb.Qf();try{for(a=0;a<c[u];a++){var d=c[a];switch(d[0]){case OL:var f=d[1];if(!this.AOb.Xb(f)){var g=this.IY.za(f);vSa(g,d);this.mea=g}break;case lE:this.mea&&wSa(this.mea,d);break;case qD:if(this.mea){xSa(this.mea);this.R2b++;zSa(this.mea)&&this.S2b++;this.mea=i}break;case QL:this.Zbd=h;break;case Dmb:this.Wm&&this.Wm.bUb&&this.Wm.bUb(this,d[1]);break}}}finally{this.IY.mb.Mf()}};
+F.Ja=function $BI(a){FSa.C.Ja[z](this,a);a.bD(k);a.wl(h);a.Ne(mB);a.OW(k);a.sCa(1E4);a.Ii(this.IY.Bb());a.Ua(pd,OD);a.Ua(PD,this.BV);a.Ua(W3a,Hj)};H(GSa,hy);GSa[w].Bb=D(NO);GSa[w].za=function $DI(a,c){Ix(this);var d=iy(this,a);if(d||c)return d;return new uSa(this.Ea,a,this)};GSa[w].rg=function $EI(){Ix(this);this.mb.Qf();try{for(var a=this.Uc().Oa(),c=0;c<a[u];c++)a[c].rg()}finally{this.mb.Mf()}};H(JSa,hy);F=JSa[w];F.P6c=function $FI(a){var c=a[dq],d=a.Pg.Bb();if(d!=i){a=c[0];(d=this.zp(d,c[1],k))&&ySa(d,a,c)}};F.za=function $GI(a,c){Ix(this);var d=iy(this,a);if(d||c)return d;if(a=Hy.f_(Rf(a)))return new GSa(a,this)};F.zp=function $HI(a,c,d){Ix(this);a=Qf(a.Dg())+Md+c;return jy(this,a,d)};F.nB=function $II(a,c,d){sI(this,a,function(f){f.nB(c,d)})};F.YXa=function $JI(a,c,d){sI(this,a,function(f){f.YXa(c,d)})};F.Yaa=function $KI(a,c,d){sI(this,a,function(f){f.Yaa(c,d)})};
+F.Xwb=function $LI(a,c,d){sI(this,a,function(f){f.Xwb(c,d)})};F.Wwb=function $MI(a,c,d){sI(this,a,function(f){f.Wwb(c,d)})};F.SX=function $NI(a,c,d,f){this.t3(a,c,h,d,f)};F.m1=function $OI(a,c,d,f){this.t3(a,c,k,d,f)};F.t3=function $PI(a,c,d,f,g){sI(this,a,function(j){j.EFb(c,d,f,g)})};F.E4=function $QI(a,c){this.mb.Qf();try{for(var d=this.Uc().Oa(),f=0;f<d[u];f++)for(var g=d[f].Uc().Oa(),j=0;j<g[u];j++){var n=g[j];n&&n.E4(a,c)}}finally{this.mb.Mf()}};
+F.tka=function $RI(a,c,d,f,g){Ix(this);this.mb.Qf();try{for(var j=this.Uc().Oa(),n=0;n<j[u];n++){var s=j[n].za(a);s&&s.hc()&&s.tka(c,d,f,g)}}finally{this.mb.Mf()}};F.Ydb=function $SI(a){for(var c=this.Uc().Oa(),d=0;d<c[u];d++){var f=c[d].za(a,h);if(f&&f.hc())if(f=f.Ydb())return f}return i};_B_prog(69)}catch(e){_B_err(e)}
+
+try{Uw(O.S(),function(b){b=Dx(Cx(b));new JSa(b)});H(BI,Fn);wn("J-C7uZwb-I",function(){return new BI(i)});H(CI,Tn);Ne(CI);F=CI[w];F.ba=CI.C.ba;F.Cd=function $TI(a){return a&&a[Tb]&&a[Tb][Tb]&&a[Tb][Tb][Tb][Qc]};var Wmb="-KC",Xmb="-K9-KP";F.Cqa=function $UI(a,c){var d=this.Qb();return c.ba(T,zo+(d+Qka),c.ba(T,zo+(d+Rka),c.ba(T,d+Wmb,c.ba(T,d+Xmb,Ed),c.ba(T,d+Nn,a))))};
+F.cVb=function $VI(a,c){if((c=a.W().Bp(c))&&c[uc][Db](this.Qb()+Qka)!=-1)if((c=a.W().Bp(c))&&c[uc][Db](this.Qb()+Rka)!=-1)if((c=a.W().Bp(c))&&c[uc][Db](this.Qb()+Wmb)!=-1)if((c=a.W().Bp(c))&&c[uc][Db](this.Qb()+Xmb)!=-1)if((a=a.W().LT(c))&&a[uc][Db](this.Qb()+Nn)!=-1)return h;return k};F.Qb=E(yI);wn(yI,function(){return new Fn(i,CI.S())});wn("J-K-ornU0b-I",function(){var b=new Fn(i,CI.S());Bn(b,16,h);return b});H(cTa,N);H(dTa,tB);var Ymb="The conversation has been deleted.",Zmb=" conversations have been deleted.";dTa[w].yp=function $XI(){var a;a=this.Cr()?Ymb:this.Mg()[u]+Zmb;return sB(this,a,7401)};H(EI,Jf);F=EI[w];F.vma=k;F.Tza=0;F.ab=i;F.Pfa=function $YI(){if(!this.ab&&!this.Tza)this.UN();else this.vma=h};Ga(F,function $ZI(){if(this.ab){Eh(this.ab);this.ab=i;this.vma=k}});F.pause=function $_I(){this.Tza++};F.sI=function $0I(){this.Tza--;if(!this.Tza&&this.vma&&!this.ab){this.vma=k;this.UN()}};F.L=function $1I(){EI.C.L[z](this);this[qc]()};F.ix=function $2I(){this.ab=i;if(this.vma&&!this.Tza){this.vma=k;this.UN()}};F.UN=function $3I(){this.ab=Dh(this.Li,this.Ly);this.Mk[z](this.na)};H(eTa,hy);var iTa=[I,0,0,0,h,k];
+eTa[w].nM=function $4I(a){this.mb.Qf();try{for(var c=[],d=0;d<a[u];d++)c[d]=Qf(a[d][0]);var f;if(this.qj()==0){f=[];for(d=0;d<a[u];d++)f[d]=d+1}else{for(var g={},j=0;j<c[u];j++)g[c[j]]=h;var n=this.Uc(),s=n.Sb();for(j=0;j<s[u];j++){var v=s[j];if(!g[v]){var C=n.J(v);if(!C.Ds()){this.qr.Kka[Pb](C.J().SA);mya(C,h)}}}g=[];var M=this.Uc();n=j=k;s=-1;for(v=0;v<c[u];v++){var Y=M.J(c[v]);if(!Y||Y.Ds()){g[p](-1);n=h}else{var ha=Y.J().Nx;j=j||ha<s;s=ha;g[p](ha)}}j&&gTa(this,g,n);if(n||j){M=0;Y=1;for(j=ha=0;ha<
+g[u];ha++){var tb=g[ha];if(tb==-1){if(j<=ha){for(j=ha+1;j<g[u];j++)if(g[j]!=-1)break;Y=((g[j]||M+j-ha+1)-M)/(j-ha+1)}tb=M+Y;g[ha]=tb}M=tb}}f=g}var zc=this.Uc();for(d=0;d<a[u];d++){var qb=a[d],nd=c[d],Fe=zc.J(nd),Pe=f[d];if(!Fe||Fe.Ds()){Fe||(Fe=new py(nd,this));var qg=new bEa(qb,Pe,this.B());Fe.set(qg);eVa(this.qr,Fe)}else{var te=Fe.J(),Zk=te.SA;if(te.fca(qb,Pe))if(te.SA!=Zk){this.qr.Kka[Pb](Zk);eVa(this.qr,Fe)}lya(Fe)}}my(this)}finally{this.mb.Mf()}};
+eTa[w].PK=function $5I(){if(this.Fi()){this.mb.Qf();try{this.QK();for(var a=this.Uc().Oa(),c=0;c<a[u];c++)a[c].PK()}finally{this.mb.Mf()}}};F=mTa[w];F.Jo=function $6I(){for(var a=[],c=FI(this.exa),d=0;d<c[u];d++){var f=c[d].J();this.KYb(f)&&a[p](f)}return a};F.q6=function $7I(a){return(a=(a=this.exa.za(Qf(a)))&&a.J())&&this.KYb(a)?a:i};F.sga=function $8I(){return function(a,c){a=a.Nx;c=c.Nx;return a<c?-1:a>c?1:0}};F.Ltb=function $9I(a,c){this.MYb[p]({Tfa:a,scope:c})};F.D=function $$I(){this.Q.D()};
+F.upb=function $aJ(a){for(var c=[],d=this.exa.mb,f=0,g;g=a.dG[f];f++)if((g=d.cj(g))&&g.hc()){g=Rf(g.vn());c[p](g)}a=new cTa(this,c);for(f=0;c=this.MYb[f];f++)c.Tfa[z](c[Pq],a)};var mVa=h,BQ={Ti:[]};F=JI[w];F.Nec=h;F.wzb=k;var anb="gGMWSc",bnb="margin-left";F.eb=function $bJ(a,c){this.hd=Cg(c);this.EJ=a;ok(this,this.hd[Qb](T));c[o](this[ll]);this.hp=nf(this.DQa.Jo());Q(this[ll],wTa(this.A7a()));if(this.wzb){var d;for(a=0;d=this.hp[a];a++){c=KI(this,d.ea());d=PTa(this,d);if(d>0){d=d*0.75;var f=QTa(this,c);K(c,anb);Dm(f,bnb,String(d)+zz)}}}};F.Cc=function $cJ(){return!!this.EJ};F.b=function $dJ(){return this[ll]||i};F.XXa=Ge("Wlb");
+F.qA=function $fJ(a){for(var c,d=0;c=this.hp[d];d++){var f=KI(this,c.ea());if(f&&Zg(f,a[y])){if(c.P3())Fa(this.hd.ie(T,ETa,f)[0][x],I);K(f,bla);break}}};F.q_=function $gJ(a){for(var c,d=0;c=this.hp[d];d++){var f=KI(this,c.ea());if(!a[eb]||!Zg(f,a[eb])){if(c.P3())Fa(this.hd.ie(T,ETa,f)[0][x],yd);Ag(f,bla)}}};
+F.qk=function $hJ(a){if(this.AQa)for(var c,d=0;c=this.hp[d];d++){var f=KI(this,c.ea());if(Zg(f,a[y])){var g=c.P3()&&this.Wlb?this.hd.ie(T,zTa,f)[0]:i;if(g&&Zg(g,a[y])){this.Wlb.pB(c,g);return k}f=QTa(this,f)[Tb][Tb];if(mVa||Zg(f,a[y])){this.AQa[z](this,c);return h}}}return k};F.D=B();F.UZ=function $jJ(a){if(this.hp)for(var c,d=0;c=this.hp[d];d++){c=c.ea();var f=KI(this,c);f&&a[p]({label:c,element:f})}return a};
+F.EMa=function $kJ(a){if(this.hp)for(var c,d=0;c=this.hp[d];d++){c=c.ea();var f=KI(this,c);if(f){f=QTa(this,f);a[p]({label:c,anchor:f[Tb][Tb]})}}return a};var cnb="nZ";F.QQ=function $lJ(a,c){(a=this.Zh(a.ea())?KI(this,a.ea()):i)&&hm(a,cnb,c)};F.A7a=function $mJ(){var a=this.hp[u];Ia(BQ.Ti,a);for(var c=0;c<a;c++){BQ.Ti[c]=BQ.Ti[c]||{};MTa(this,BQ.Ti[c],this.hp[c])}return BQ};
+F.fJc=function $nJ(a){if(this.Cc()){for(var c=k,d,f=0;d=a.Ti[f];f++){var g=this.Zh(d),j=this.DQa.q6(d);if(g&&!j){c=d;for(d=0;d<this.hp[u];d++)if(c==this.hp[d].ea()){c=d;d=this[ll][Tb][vma][0];d[nha]()&&d[Nc](d[cc][c]);kf(this.hp,c);break}c=h}else if(!g&&j){this.eGa(j);c=h}else j&&this.S_a(j)}this.YIb&&this.YIb(c)}};
+F.eGa=function $oJ(a){var c=this[ll][Tb][vma][0],d=-(jm(this.hp,a,this.DQa.sga())+1),f=BQ.Ti[0]=BQ.Ti[0]||{};MTa(this,f,a);var g=this.hd[Qb](Zn);g.id=f.id;m(g,rTa);var j=this.hd[Qb](Do);m(j,uTa);if(a.P3())Q(j,xTa(f));g[o](j);j=this.hd[Qb](Do);Q(j,yTa(f));g[o](j);!c[nha]()||d==this.hp[u]?c[o](g):c[Bb](g,c[cc][d]);km(this.hp,a,d)};
+F.S_a=function $pJ(a){var c=KI(this,a.ea()),d=QTa(this,c),f=a.Dp()!=I;hm(d,LTa,f);d=d[Tb][Tb];f=OTa(this,a);ah(d,f);ik(d,f);if(a.P3()){c=this.hd.ie(T,zTa,c)[0];d=Lj+a.lK();kp(c[x],Lj+a.PO());gma(c[x],d);ta(c[Tb][x],d)}};F.Zh=function $qJ(a){if(this.hp)for(var c,d=0;c=this.hp[d];d++)if(a==c.ea())return h;return k};H(LI,JI);LI[w].eb=function $rJ(a,c){LI.C.eb[z](this,a,c);this.Fh=a};LI[w].D=function $sJ(){LI.C.D[z](this);this.Qm.D()};H(MI,LI);var dnb="zw";MI[w].eb=function $tJ(a,c){MI.C.eb[z](this,a,c);K(this[ll],dnb)};H(NI,xx);F=NI[w];F.Ykb=B();F.Ykb.Ka=h;F.W5=B();F.W5.Vd=h;F.ceb=B();F.ceb.Rn=h;F.Qcb=B();F.Qcb.Rn=h;F.fQa=B();F.fQa.Rn=h;F.Vxb=B();F.Vxb.ic=h;_B_prog(70)}catch(e){_B_err(e)}
+
+try{Ax(UTa,NI,0);UTa[w].W5=E("G9");UTa[w].fQa=E(k);H(PI,AD);var cUa={};F=PI[w];F.YK=k;F.ma=function $CJ(){PI.C.ma[z](this);fUa(this);this.oIa&&Pw(this.H(),QI(this),aB,this.oIa)};F.Ba=function $DJ(){this.oIa&&Ow(this.H(),QI(this),aB,this.oIa);PI.C.Ba[z](this)};F.zm=function $EJ(a){if(a!=this.YK){this.YK=a;fUa(this)}};F.LXa=Ge("yJa");F.Vo=D("YK");H(RI,xx);RI[w].zHa=B();RI[w].zHa.ic=h;RI[w].QQ=B();RI[w].QQ.Rn=h;zx(gUa,RI,0);var enb="qj",fnb="qi";gUa[w].zHa=function $JJ(a,c){if(this.X_.rWb){var d=CF,f=new Bm(2-d.top,0,2-d[fl],0);a=d.top;var g=d[rl],j=d[fl];d=d[Ck];var n=f.top,s=f[rl],v=f[fl];f=f[Ck];var C=SJa(a,g,j,d,n,s,v,f);a=(new gJa(new Bm(a,g,j,d),new Bm(n,s,v,f),C)).yn;g=Cg(c);this.lMb=iUa(this,g,a,enb);this.Cfc=iUa(this,g,a,fnb);c[o](this.lMb[ll]);c[o](this.Cfc[ll])}return h};var gnb="ol";
+gUa[w].QQ=function $KJ(a,c){var d=KI(this.X_,a.ea());if(d){var f=fza(a.Bb());if(this.X_.rWb){var g=f?this.Cfc:this.lMb;if(c){bn(d,4,g[ll],4,new xg(-4,0));Wa(g.Myc[x],d[ql]-4+Jm)}Fa(g[ll][x],c?ud:yd)}if(this.X_.Zh(a.ea())){a=f?gnb:cnb;hm(d,a,c)}}return h};H(SI,LI);yx(RI,SI);var hnb="LrBjie";SI[w].eb=function $LJ(a,c){this.aa.zHa(a,c);SI.C.eb[z](this,a,c);K(this[ll],hnb)};SI[w].QQ=function $MJ(a,c){this.aa.QQ(a,c)||SI.C.QQ[z](this,a,c)};H(VI,AD);F=VI[w];var inb="z0";F.hq=function $NJ(a,c,d,f){var g=this.W()[Qb](T);Q(g,AI({id:I,xh:c}));m(g,inb);this.Gz(a,new YUa(g,d,f))};F.rG=function $OJ(a){var c=this.W()[Qb](T);m(c,VUa);this.Gz(a,new MUa(c))};F.Gz=function $PJ(a,c){this.bL[a][p](c);if(this.Cc()){c.eb(this,this.xKb[a]);WUa(this)}};F.cC=function $QJ(a,c){for(var d=0;d<this.bL[u];d++)if(c==undefined||d==c)for(var f,g=0;f=this.bL[d][g];g++)a(f,d)};F.W5=E(i);F.L=function $SJ(){VI.C.L[z](this);this.cC(function(a){a.D()})};
+F.A7a=function $TJ(){return{FTc:this.X(RE),ETc:this.X(Kd),Vlb:this.X(Xx),xUc:this.X(Rd),rVc:this.X(Hz),sVc:UUa(this),bjb:k,tRa:this.vHb}};F.Vh=function $UJ(){VI.C.Vh[z](this);var a=this.ia.b();Q(a,GUa(this.A7a()));var c=this.W5();c&&K(a,c);an(a,h,h)};F.ma=function $VJ(){VI.C.ma[z](this);var a=this.xKb=[this.b(Kd),this.b(Rd)],c=this;this.cC(function(f,g){f.eb(c,a[g])});var d=this.b();Pw(this.H().w(d,[Xi,Yi],this.Spb),d,aB,this.mTa);IUa(this);WUa(this)};
+F.Ba=function $WJ(){if(!this.Pc){Pg(this.b(Kd));Pg(this.b(Rd))}if(this.nm){this.nm.D();this.nm=undefined}this.D1b=k;this.H().wb();VI.C.Ba[z](this)};F.L=function $SJ(){this.cC(function(a){a.D()});VI.C.L[z](this)};F.Spb=function $XJ(a){OUa(this,a[y],function(c){a[Zb]==Xi?c.qA(a):c.q_(a)})};F.mTa=function $YJ(a){this.Cb.lf();var c;OUa(this,a[y],function(d){if(!(a[Zb]==P&&(a[Bc]||a[dd]))){c=d.qk(a);a[zb]();a[Ec]()}});c&&PUa(this,k)};
+F.N3c=function $ZJ(a){if(a[Zb]==fj&&nm(a,0)||a[Zb]==Zi&&a[Sb]==13)PUa(this,!!!(this.nm&&this.nm.Bv()))};F.s7a=function $_J(){var a=new ZUa(this.b(),5,this.ifd,this),c=this.b(Xx);a=this.nm=new LG(c,a);cka(a);a.FVb=h;MG(this.nm,0,0,0,-5);a=G(this.H().w,this.H(),this.nm);a(mo,this.zpb);a(no,this.ypb);a(Go,this.xpb)};F.ifd=function $0J(a){var c=this.wdb();a=a[xk];var d=c[xk],f=this.b()[xk];if(a<f)ka(c[x],f-(a-d)+Jm)};F.zpb=function $1J(){RUa(this,h)};F.xpb=B();
+F.ypb=function $3J(){ka(this.wdb()[x],I);RUa(this,k)};F.wdb=function $4J(){return this.nm.b()};F.YT=function $5J(a){if(a){IUa(this);WUa(this);this.nm&&this.nm.Ib()&&this.nm.If()}};F.Rwb=function $6J(a,c){if(a){var d=a.ea();this.cC(function(f){f.Zh&&f.Zh(d)&&f.QQ(a,c)})}};F=MUa[w];F.eb=function $7J(a,c){c[o](this.wa)};F.Cc=function $8J(){return this.wa[A]!=i};F.b=D(eo);F.UZ=Ee();F.qA=B();F.q_=B();F.qk=function $cK(){if(this.na){this.na[z](this.Ela);return h}return k};F.D=B();H(YUa,MUa);
+YUa[w].eb=function $eK(a,c){this.lq=new BI(i,CI.S());this.lq.Pb(this.wa[Tb]);this.na&&ih(this.lq,Wn,this.na,k,this.Ela);c[o](this.wa)};YUa[w].qk=B();YUa[w].D=function $gK(){if(this.lq){this.lq.D();this.lq=i}};H(ZUa,dn);ZUa[w].If=function $hK(a,c,d){this.lFc[z](this.Ela,a);ZUa.C.If[z](this,a,c,d)};H(WI,xx);WI[w].Hoa=B();WI[w].Hoa.Ka=h;WI[w].iGa=B();WI[w].iGa.Ka=h;H(aVa,oH);var jnb="Loading labels";aVa[w].Ja=function $kK(a){aVa.C.Ja[z](this,a);a.Ua(pd,MN);a.Se(jnb)};H(YI,hy);yx(WI,YI);F=YI[w];F.L=function $lK(){this.Kka=i;YI.C.L[z](this)};na(F,function $mK(){Ix(this);if(this.oc)return this.oc;this.oc=new aVa(this);this.oc.Ie(this);this.oc[Mb]();return this.oc});F.rg=function $nK(){Ix(this);if(this.Fi()){this.mb.Qf();try{this.QK();for(var a=this.Uc().Oa(),c=0;c<a[u];c++)a[c].PK()}finally{this.mb.Mf()}}};
+F.x2c=function $oK(a){a=a[dq];this.mb.Qf();try{var c=a[1],d=a[2];this.CFb(c);var f=this.za(cJ);if(f)f.nM(c);else new eTa(cJ,c,this);var g=this.za(ZI);if(g)g.nM(d);else new eTa(ZI,d,this);my(this)}finally{this.mb.Mf()}};F.wh=function $pK(a){if(this.oc==a)this.oc=i};F.CFb=B();F.BFb=B();F.AFb=B();H(bJ,VI);yx(NI,bJ);F=bJ[w];F.W5=function $tK(){return this.aa.W5()};F.ma=function $uK(){bJ.C.ma[z](this);hVa(this)};F.L=function $vK(){bJ.C.L[z](this);this.V_&&this.V_.D();this.zP&&this.zP.D();this.nm&&this.nm.D()};F.UZ=function $wK(a,c,d){this.cC(function(f){c==f instanceof SI&&f.UZ(a)},d);return a};F.EMa=function $xK(a,c,d){this.cC(function(f){c==f instanceof SI&&f.EMa(a)},d);return a};var knb="Compose Mail";
+F.p5b=function $yK(){if(this.co.Fi()){this.V_.wb();Jz(Rz(this.B()),1033)&&this.hq(0,knb,this.i_c,this);lVa(this,nD(this.B()));nVa(this)}};F.i_c=function $zK(a){a[dd]||a[Bc]?AFa(this.Lh,a[Bc]):this.Zmb()};F.Zmb=function $AK(){QF(this,ZO);this.I8[bq]({view:QO})};F.Hpb=function $BK(){this.Ks=new lnb(this.B(),this,16);var a=this.zP=new CQ(this.B(),this.b(),this.Ks);this.cC(function(c){c.XXa&&c.XXa(a)})};F.H2c=function $CK(){hVa(this)};F.wdb=function $DK(){return Gg(T,DUa,this.nm.b())[0]||this.nm.b()};
+F.s7a=function $EK(){bJ.C.s7a[z](this);this.nm.Laa(this.Bd.Zf);this.nm.RNb=k;this.aa.Ykb(this.H(),this.nm)};F.zpb=function $FK(a){bJ.C.zpb[z](this,a);nVa(this)};F.xpb=function $GK(a){bJ.C.xpb[z](this,a);var c=a[y];c&&this.zP&&this.zP.yUc(c)&&a[zb]()};F.ypb=function $HK(a){bJ.C.ypb[z](this,a);nVa(this)};F.dRb=function $IK(){return this.bL[0][2]};F.Spb=function $JK(a){if(!this.sNb||a[Zb]==Yi)bJ.C.Spb[z](this,a)};F.YT=function $KK(a){bJ.C.YT[z](this,a);XUa(this,this.G1);a&&nVa(this)};
+F.Rwb=function $LK(a,c){if(a){var d=a.ea();this.cC(function(f){f.QQ&&f.QQ(a,c&&f.Zh(d))})}};F.B=function $MK(){return this[uq]()};H(oVa,xx);oVa[w].Nk=B();oVa[w].Nk.Ka=h;H(pVa,xx);pVa[w].Nk=B();pVa[w].Nk.Ka=h;H(zVa,pA);yx(pVa,zVa);zVa[w].TZc=function $PK(a){this[r](P);a[Ec]()};H(gJ,AD);F=gJ[w];F.ey=I;F.ug=I;F.lV=i;F.ha=function $QK(a){this.ia.ha(a)};F.Jf=function $RK(a,c){this.ia.Jf(a,c)};lk(F,function $SK(a){this.ia[Nc](a)});F.hq=B();F.Uc=function $UK(){return this.ia.Uc()};F.Fc=Ge(RN);F.Le=D(RN);F.aha=E(i);F.jB=B();F.AA=E(h);F.P1=function $_K(a){if(this.ey!=I){var c=this.ey[Cc](J);for(var d in c)Ag(this.b(),c[d])}a!=I&&K(this.b(),a);this.ey=a};F.hea=B();var DVa;H(iJ,AD);F=BVa[w];F.iod=3;F.hod=new Bm(CF.top,CF[rl],0,CF[Ck]);F.jod=new Bm(-2,0,0,0);F.Lyc=0;F.Kyc=new Bm(0,1,1,1);F.Nyc=new Bm(0,0,0,0);F=iJ[w];F.L=function $1K(){iJ.C.L[z](this);this.Wq.D();this.lV=i};F.ha=function $2K(a){this.Wq.ha(a)};F.Jf=function $3K(a,c){this.Wq.Jf(a,c)};lk(F,function $4K(a){this.Wq[Nc](a)});F.hq=function $5K(a){this.Wq.hq(a)};F.Uc=function $6K(){return this.Wq.Uc()};va(F,D(YP));F.P1=function $8K(a){this.Wq.P1(a)};F.Fc=function $9K(a){this.Wq.Fc(a)};F.Le=function $$K(){return this.Wq.Le()};
+F.aha=function $aL(){return this.Wq.aha()};F.jB=function $bL(a){this.Wq.jB(a)};F.AA=function $cL(){return this.Wq.AA()};F.TE=function $dL(a){for(var c=this.Uc(),d=0;d<c[u];d++){var f=c[d];f.TE&&f.TE(a)}};var mnb="Ka";F.qc=function $eL(a){iJ.C.qc[z](this,a);this[r](mnb)};F.li=D("Wq");F.yka=B();_B_prog(71)}catch(e){_B_err(e)}
+
+try{H(jJ,gJ);yx(oVa,jJ);F=jJ[w];F.zhc=k;F.ha=function $hL(a){this.hy.ha(a)};F.Jf=function $iL(a,c){this.hy.Jf(a,c)};lk(F,function $jL(a){this.hy[Nc](a)});F.hq=function $kL(a){this.W().ie(T,vVa,this.eq.b())[0][o](a.b());if(!this.Yf)this.Yf=[];this.Yf[p](a)};F.Uc=function $lL(){return this.hy.Uc()};F.Fc=function $mL(a){jJ.C.Fc[z](this,a);this.xo()};F.Cdc=function $nL(a){this.zhc=a;this.xo()};var DQ="pr",EQ="pv",nnb="alt",onb="Collapse",pnb="Expand";
+F.jB=function $oL(a){if(this.FOb!=a){this.FOb=a;var c=this.eq.b(),d=this.W().ie(ne,de,c)[0];if(a){qm(c,DQ,EQ);d[Wb](nnb,onb)}else{qm(c,EQ,DQ);d[Wb](nnb,pnb)}this.hy.qc(a)}};F.AA=function $pL(){return!!this.FOb};var qnb="pS";F.hea=function $qL(){var a=this.ia;a.ha(this.lLb());a.ha(this.TKb());this.P1(qnb)};F.ma=function $rL(){jJ.C.ma[z](this);this.xo();this.H().w(this.eq.b(),[P,ij],this.Ynb);K(this.lV.b(),QE)};
+F.Ba=function $sL(){jJ.C.Ba[z](this);this.H().wb();if(this.Yf){for(;this.Yf[u]>0;)this.Yf.pop().D();this.Yf=i}};F.lLb=function $tL(){if(this.XF)e(Error(".152"));var a=this[uq]();this.eq=new eE(a);var c={alt:onb};this.aa.Nk(c);this.eq.xb(wVa(c));c=this.W().ie(ne,de,this.eq.b())[0];fn(c,jo);K(this.eq.b(),EQ);this.XF=new BF(a);this.XF.so(this.eq);a=CVa();this.XF.U1(a.jod);DF(this.XF,a.hod,a.iod);a=this.XF.b();K(a,RE);return this.XF};F.aha=D("XF");
+F.TKb=function $vL(){if(this.hy)e(Error(".153"));var a=this[uq]();this.hy=new gF(a);this.cw=new BF(a);this.cw.so(this.hy);K(this.cw.b(),TO);K(this.hy.b(),oe);a=CVa();this.cw.U1(a.Nyc);DF(this.cw,a.Kyc,a.Lyc);return this.cw};var rnb="h2",snb=" &raquo;";F.xo=function $wL(){if(this.Cc()){var a=Gg(rnb,tVa,this.eq.b())[0],c=this.Le();if(this.zhc){K(a,Jm);c+=snb}else Ag(a,Jm);Q(a,c);this.eq.qe()}};var FQ="La";
+F.Ynb=function $xL(a){if(!(a[Zb]==ij&&(a[Ob]||a[Sb])!=13)){if(Bg(a[y],Jm))this[r](FQ);else{this.jB(!this.AA());this[r](hJ)}a[Ec]()}};H(kJ,iJ);kJ[w].Qh=function $yL(a,c){for(var d=this.Uc(),f=0;f<d[u];f++){var g=d[f];g.Qh&&g.Qh(a,c)}};kJ[w].TE=function $zL(a){kJ.C.TE[z](this,a);this.Wq.jB(EVa(this))};kJ[w].yka=function $AL(){var a=this.Wq.AA();if(a!=EVa(this)){var c=this[uq](),d=FVa+this[ec];a=a?1:0;this.lb.Yc(d,a);c=new lF(c);c.Yc(d,a);c.bh=h;c[Mb]()}};kJ[w].B=function $BL(){return this[uq]()};Nx(Mx(),14,function(b,a){return a?new jJ(b):new gJ(b)});H(GVa,kJ);Mx().Ug(2,function(b){b=b.B();var a=new GVa(b,Mx().Gn(14,b,k)),c=QIa(hF(b),Xz);dG(b).cCa(c,a)});GVa[w].GO=D("LU");GVa[w].TE=function $DL(a){var c=a.md();a=c==wE||c==YK||c==xE?a.Bb():i;a=Xy(a);XUa(this.LU,NC(this.cg,a))};H(HVa,xx);HVa[w].un=E(wN);HVa[w].un.Vd=h;H(IVa,AD);var tnb=155;F=IVa[w];F.DXa=0;F.Yh=function $FL(){return tnb};F.hGa=function $GL(a){var c;c=jm(this.Aj,a,JVa(k));c=c<0?-(c+1):c;km(this.Aj,a,c);K(a.Ra.b(),dP);this.ia.Jf(a.Ra,c)};F.sRb=E(i);F.daa=function $IL(a){for(var c=this.ia,d=c.Uc(),f=d[u]-1;f>=0;f--)if(d[f]==a){c.Vp(f);for(f=0;f<this.Aj[u];f++)if(this.Aj[f].Ra==a){this.Aj[jd](f,1);return h}break}return k};F.wH=function $JL(a){return(a=this.Aj[qH(this,a)])?a.Ra:i};F.FO=function $KL(a){return this.Aj[a]};
+F.TE=function $LL(a){for(var c=0;c<this.Aj[u];c++){var d=this.Aj[c].Ra;d.TE&&d.TE(a)}};MVa[w].Hp=D(J3a);MVa[w].B6=D(cmb);MVa[w].lma=Ge(cmb);H(mJ,IVa);F=mJ[w];F.rKb=function $PL(){this[uq]();var a=this.lb.db(nJ),c=new Hf;if(Ue(a)){a=a[Cc](Bl);for(var d=0;d<a[u];d++){var f=a[d][Cc](xj);f!=I&&c.set(f[0],Number(f[1]))}}else{a=this.lb.nf(oJ);c.set(pJ,a?75:85)}this.iVa=c;this.iJa=h;yA++;try{this.ia.Ql(this.Yh());var g=this.Aj;if(g[u]>0){this.Aj=[];c=0;for(var j=g[u];c<j;c++)this.hGa(g[c])}}finally{zA()}this[uq]();this.H().w(this.Aa.Ya(),this.lb.Yn(oJ),this.Bic);this.Bic();Mx().Kh(240)};F.iJa=k;F.Yh=function $QL(){return sga||mJ.C.Yh[z](this)};
+F.daa=function $RL(a){if(mJ.C.daa[z](this,a)){OVa(this);return h}return k};F.sRb=function $SL(a){if(!this.iJa)return i;return this.iVa.J(a)};F.Qh=function $TL(a,c){for(var d=0;d<this.Aj[u];d++){var f=this.Aj[d].Ra;f.Qh&&f.Qh(a,c)}};F.hGa=function $UL(a){this.iJa?mJ.C.hGa[z](this,a):this.Aj[p](a)};F.daa=function $RL(a){if(!this.iJa)return jf(this.Aj,a);mJ.C.daa[z](this,a)};
+F.Bic=function $VL(){this[uq]();var a=qH(this,pJ),c=qH(this,ZI),d=this.lb.nf(oJ);if(a==i||c==i)this.lb.db(nJ)||this.iVa.set(pJ,d?75:85);else d!=c<a&&NVa(this,a,c)};H(qJ,PI);yx(HVa,qJ);qJ[w].TE=function $WL(a){this.zm(a.md()==SO)};qJ[w].rSa=function $XL(){if(DD())vE(this[uq]());else{QF(this,fcb);this.jb[bq]({view:SO})}};qJ[w].jmb=Ee();H(rJ,xx);rJ[w].AYa=B();rJ[w].AYa.ic=h;rJ[w].Pca=B();H(VVa,kJ);yx(rJ,VVa);Mx().Ug(2,function(b){b=b.B();var a=new VVa(b,Mx().Gn(14,b,k));a.aa.AYa()?sH(b).Rca(a,sJ,95):a.D()});VVa[w].hea=function $0L(){var a=this.B();if(!bx()||Rz(a)[Bq](5058))this.aa.Pca(this,a)};VVa[w].Pca=function $1L(a,c){this.c2b.set(a,c);this.ha(c)};H(tJ,pB);F=tJ[w];F.Bb=D(NO);F.Ii=Ge(NO);F.Hc=D("Sq");F.cD=Ge("Sq");F.Cr=function $6L(){return this.wf[u]==1};F.Ja=function $7L(a){tJ.C.Ja[z](this,a);a.Be(Xx,this.wf);a.Ii(this.Ea)};H(vJ,tJ);vJ[w].Wd=E(i);vJ[w].Zg=E("Starring message");vJ[w].Ja=function $$L(a){vJ.C.Ja[z](this,a);this.aa.Ja(a)};yx(XVa,vJ);XVa[w].Ja=B();YVa[w].zC=ki;YVa[w].UXa=Ge("zC");H(xJ,vH);xJ[w].D=function $cM(){xJ.C.D[z](this)};xJ[w].yK=Me;xJ[w].Bb=Me;xJ[w].B=D(JF);var bWa=1,unb="parent";yJ[w].Ig=Ge(unb);yJ[w].Zj=function $fM(a,c){return this[Oc].Zj(a,c)};yJ[w].vs=function $gM(a,c){return this[Oc].vs(a,c)};yJ[w].W=function $hM(){return this[Oc].W()};H(cWa,yJ);F=cWa[w];va(F,D(LL));F.I2=Me;F.fZc=function $jM(a,c,d){var f=a[Zb];return f==P||f==ej?this.Vya(a,c,d):f==ij?this.mob(a,c,d):f==Xi?this.R3b(a,c,d):f==fj?nm(a,2)?void 0:this.Wya(a,c,d):f==pj?void 0:k};F.R3b=Me;F.Vya=Me;F.mob=Me;F.Wya=Me;dWa[w].ea=function $kM(){return this.zYb.ea()};dWa[w].getItem=D("zYb");dWa[w].Vo=D("YK");var vnb="bF";dWa[w].Eb=D(vnb);H(zJ,cWa);var wnb=aWa(),xnb=aWa(),GQ={};F=zJ[w];F.Wla=Ge("Ada");var HQ='<td id="',ynb="-x3",znb="-jd",IQ='<input id="',Anb="-jc",Bnb='" type="checkbox" aria-labelledby="',JQ=' checked="true"',Cnb=" /></td>";
+F.sW=function $pM(a,c){var d=a[Vp]().ea();GQ.Mwc=this.Zj(xnb,d);GQ.qq=this.Zj(wnb,d);GQ.fRc=this.eRc?this.Zj(this.eRc,d):I;GQ.LH=a.Vo();lma(GQ,I);GQ.Oeb=this.Iua;GQ.jwc=this.Ada?J+this.Ada:I;a=c||new U;a[R](HQ,GQ.Mwc,S,GQ.Oeb+ynb,GQ.jwc,yF,V(GQ[x]),W);xI({Hb:GQ.Oeb+znb},a);a[R](IQ,GQ.qq,S,GQ.Oeb+Anb,Bnb,GQ.fRc,Vf,GQ.LH?JQ:I,Cnb);c||a[t]()};
+F.I2=function $qM(a,c){var d=c.ea(),f=c.H_a;if(f&2){var g=this.vs(xnb,d);if(g){var j=c.Eb();g=Wg(g);if(L)if(j){a=Sw(a);j=Sw(g[mha]);g[x].top=a-j+5+Jm}else g[x].top=I;else Fa(g[x],j?ud:I)}}if(f&1)if(d=this.vs(wnb,d))zp(d,c.Vo())};F.Wya=function $rM(a,c,d){c=d[Vp]();c=this.Zj(xnb,c.ea());a[y].id==c&&a[zb]();return h};F.Vya=function $sM(a){a.gNb=h;a[y][Ek]();return h};F.mob=function $tM(a){return a[Sb]==13};_B_prog(72)}catch(e){_B_err(e)}
+
+try{eWa[w].sM=function $uM(){this.Wra++};eWa[w].ww=function $vM(){this.Wra!=0&&this.Wra--};H(AJ,AD);F=AJ[w];F.uz=Me;F.cub=Me;F.insertRow=Me;F.hB=Me;F.Oic=Me;F.AHa=Me;F.PLa=Me;F.QGa=Me;F.eM=Me;F.Rdb=Me;F.eua=Me;F.Lub=Me;F.MPb=Me;H(BJ,tB);var Dnb="All conversations have been added to ",Enb="All conversations have been removed from ",Fnb=" and added to ",Gnb="The conversation has been added to ",Hnb="The conversation has been removed from ",Inb=" conversations have been added to ",Jnb=" conversations have been removed from ";
+BJ[w].yp=function $wM(){var a;a=this.okb;var c=this.pkb;a=this.Lp()?c[u]==0?Dnb+(CJ(this,a)+He):a[u]==0?Enb+(CJ(this,c)+He):Enb+(CJ(this,c)+(Fnb+(CJ(this,a)+He))):this.Cr()?c[u]==0?Gnb+(CJ(this,a)+He):a[u]==0?Hnb+(CJ(this,c)+He):Hnb+(CJ(this,c)+(Fnb+(CJ(this,a)+He))):c[u]==0?this.Mg()[u]+(Inb+(CJ(this,a)+He)):a[u]==0?this.Mg()[u]+(Jnb+(CJ(this,c)+He)):this.Mg()[u]+(Jnb+(CJ(this,c)+(Fnb+(CJ(this,a)+He))));return sB(this,a,6560,h)};var Knb="acn",Lnb="rcn";
+BJ[w].Ja=function $xM(a){BJ.C.Ja[z](this,a);a.Ua(fG,this.UR);a.Ua(Knb,this.okb);a.Ua(Lnb,this.pkb)};H(fWa,tB);var Mnb="Drafts have been deleted from all conversations.",Nnb="Drafts have been deleted from the conversation.",Onb="Drafts have been deleted from ";fWa[w].yp=function $yM(){var a;a=this.Lp()?Mnb:this.Cr()?Nnb:Onb+(this.Mg()[u]+Dab);return sB(this,a,i,k)};H(gWa,tB);gWa[w].Ja=function $zM(a){if(!this.hia)e(Error(".156"));if(this.Ea.Ga()!=Yy)e(Error(".157"));gWa.C.Ja[z](this,a)};var Pnb="All messages marked spam have been deleted forever.";gWa[w].yp=function $AM(){return sB(this,Pnb,i,k)};H(hWa,tB);var Qnb="All conversations have been delivered.",Rnb="The conversation has been delivered.",Snb=" conversations have been delivered.";hWa[w].yp=function $BM(){var a;a=this.Lp()?Qnb:this.Cr()?Rnb:this.Mg()[u]+Snb;return sB(this,a,6602,k)};H(iWa,tB);iWa[w].Ja=function $CM(a){if(!this.hia)e(Error(".158"));if(this.Ea.Ga()!=Zy)e(Error(".159"));iWa.C.Ja[z](this,a)};var Tnb="All messages in the Trash have been deleted forever.";iWa[w].yp=function $DM(){return sB(this,Tnb,i,k)};H(DJ,xx);F=DJ[w];F.Oca=B();F.Oca.Ka=h;F.Fs=B();F.Fs.ic=h;F.KW=B();F.KW.Ka=h;F.XRb=B();F.qqb=B();F.qqb.Ka=h;F.D=B();F.D.Ka=h;F.qja=B();F.qja.Vd=h;F.Udb=E(I);F.Udb.Vd=h;var GJ;H(FJ,VB);yx(DJ,FJ);Nx(Mx(),16,function(b){return new FJ(b)});var JJ={},KJ=[];F=FJ[w];F.Me=I;F.b2=h;F.oyb=h;F.Jy=I;F.On=I;F.oga=D("Yf");F.T1=function $NM(a){this.om.T1(a);this.Me=a};var KQ="On";F.gp=Ge(KQ);F.jh=D(KQ);F.vc=function $QM(){var a=wWa(this);OWa(a,this.Jy);return a};var Unb='<div act="',Vnb='" class="AO" tabindex="0">',Wnb='<div class="AQ">';
+F.wc=function $RM(){if(this.Owa)e(Error(".160"));la(JJ,this.jh());JJ.EYa=this.Ar(19);JJ.iuc=19;var a;a=new U;a[R](JJ.EYa?Unb+JJ.iuc+Vnb+JJ[jb]+Z:JJ[jb]?Wnb+JJ[jb]+Z:I);a=a[t]();this.Hvb=[a,this.oyb?this.aa.Udb():I,LWa(this),this.b2?HWa(this):I,this.b2?AWa(this):I];this.Ar(20)&&km(this.Hvb,JWa(this),this.Hvb[u]);Mx().Kh(90,this);JJ.Zgd=this.Hvb;OWa(this,jWa(JJ))};F.D=function $SM(){FJ.C.D[z](this);this.aa.D()};F.ma=function $TM(){FJ.C.ma[z](this);this.Owa&&this.b2&&PWa(this)};
+F.D=function $SM(){ph(this.b());FJ.C.D[z](this);this.om.D();for(var a in this.Yf){ph(this.Yf[a]);this.Yf[a].D()}this.Yf=i};F.qja=function $UM(a){this.oyb&&this.aa.qja(a)};
+F.p8=function $VM(){if(!this.Wyc){ph(this.b());var a=this.b(BWa),c=this.b(CWa);if(a){this.om.ZLb(a,c);this.om.B8a(c,a)}else this.om.B8a(c,c);a=this.X(xWa);var d;c=this.b()[ic](T);for(var f,g=0;f=c[g];g++){d=i;var j=Number(f[Uc](fG)||f.act);if(f.id==a){d=this.om;f=f;d.XM=JXa(d,f,f,f,d.RXc);d.p2a=d.W().ba(T,{"class":xo,style:DG});f[A][A][o](d.p2a);d=d.XM}else if(j==19||j==20)this.H().w(f,[fj,P,ij],this.M0c);else if(j&&f[uc][Db](yI)!=-1){d=new BI(i,CI.S());d.Pb(f);d.kb=j;this.Yf[j]=d}d&&ih(d,Wn,this.lh,
+k,this)}this.Wyc=h}};F.lh=function $WM(a){a[y].b();var c=a[y].kb;uC(this.Cb);if(!ia(c)&&c>0){var d=c==13?this.Me:a[y].un();this[r](new XB(c,d));a[Ec]();this.Cb.lf()}};F.r_a=function $XM(){this.p8();this.om.r_a()};F.s_a=function $YM(){this.p8();this.om.s_a()};F.q_a=function $ZM(){this.p8();this.om.q_a()};F.Fs=function $_M(a){switch(a){case 13:case 7:case 9:case 10:case 8:case 4:case 17:case 15:case 16:case 18:case 20:case 19:return h}return this.aa.Fs(a)};var Xnb=":21";
+F.M0c=function $0M(a){var c=a[Zb],d=a[y],f=k,g=d[A],j=I;g=Number(d[Uc](fG)||d.act||g&&d[A][Uc](fG));if(ia(g)||!this.Ar(g))g=0;if(c==fj&&a[Cb]==(L?1:0)&&g==19){f=this.nMb=h;uC(this.Cb);if(L)bA(Xnb,this.Cb.lf,0,this.Cb);else{this.Cb.lf();a[zb]()}}else if(c==P&&g==19&&this.nMb)this.nMb=k;else if(g&&(c==P||c==ij&&(a[Sb]==13||Jg&&a[Sb]==3))){f=h;uC(this.Cb);this.Cb.lf();g==20&&this.aa.qqb();a[Ec]()}if(f&&g>0){j=g==13?this.Me:d[Tb][md];this[r](new XB(g,j))}};
+F.KW=function $1M(a,c){switch(a.Ga()){case iz:c==wE&&TB(this,16,h);break;case Yy:TB(this,17,h);TB(this,18,h);break;case Zy:TB(this,17,h);TB(this,9,h);break;case Py:TB(this,13,h);TB(this,9,h);TB(this,10,h);break;default:TB(this,7,h);TB(this,9,h);TB(this,10,h)}a.Ga()==Py&&this.T1(a.Pt());this.oyb=c!=YK;this.aa.KW(a,c);this.Ea=a};H(LJ,Rn);Ne(LJ);LJ[w].Pb=function $2M(a,c){c=LJ.C.Pb[z](this,a,c);this.rKa(a,Gg(Do,YWa,c)[0]);return c};H(RWa,Mn);Ne(RWa);RWa[w].Qb=E(UJ);H(MJ,Qn);MJ[w].Onb=i;MJ[w].ma=function $4M(){MJ.C.ma[z](this);NJ(this)};wn(UJ,function(){return new MJ(i)});H(OJ,Sn);F=OJ[w];F.e0b=0;F.Me=I;F.HGa=k;F.eEc=0;var Ynb="-JJ";F.ba=function $5M(){OJ.C.ba[z](this);var a=this.W(),c=a.ba(T,this.li().Qb()+Ynb,this.cxa=a.ba(T,i,this.Me),this.gm=a.ba(zm,{type:Il})),d=this.b();a[o](d,c);this.vqa=a.ba(T,this.li().Qb()+Nn);a[o](d,this.vqa);TWa(this)};
+F.ra=function $6M(a,c){if((c=OJ.C.ra[z](this,a,c))&&a&&this.Cc()){this.gCa(I);if(!this.Ve&&this.gm){this.Ve=new Am(this.gm);an(this.gm,k);ih(this.Ve,zm,this.kUb,k,this);ih(this.gm[A],P,this.H4b,k,this);if(this.HGa)this.nLa=[]}}else c&&!a&&UWa(this);return c};F.L=function $7M(){UWa(this);this.cxa=this.gm=undefined;OJ.C.L[z](this)};F.gCa=function $8M(a){if(this.gm){pa(this.gm,a);WWa(this,a)}};F.GE=function $9M(){return this.gm&&Ye(this.gm[q])?this.gm[q]:I};
+F.kUb=function $$M(){WWa(this,this.gm[q]);var a=Kn(this);if(!a||!a.Ib())Ln(this);this[r](cXa)};F.Qo=function $aN(a){if(a[dd]||a[Bc]||a[rc]||a[Sb]==36||a[Sb]==35)return k;if(a[Sb]==27){this[r](kj);return h}return OJ.C.Qo[z](this,a)};F.dp=function $bN(a){OJ.C.dp[z](this,a);a=this.Cd();var c=Kn(this)?Kn(this).b():i;if(c&&Zg(a,c)){var d=L?0:a[ol],f=c[ol]+c[ql]-d-(a[Wc]+a[Nk]);a.scrollTop+=l.max(f,0);f=a[Nk]-(c[ol]-d);a.scrollTop-=l.max(f,0)}};F.H4b=function $cN(){this.gm[Ek]()};
+F.Cd=function $dN(){return this.vqa||this.b()};F.Ff=function $eN(a){this.wa=a;a=this.W().ie(T,this.li().Qb()+Ynb,a)[0];this.cxa=Wg(a);this.gm=Yg(this.cxa);(this.vqa=(a=Yg(a))&&Bg(a,this.li().Qb()+Nn)?a:i)&&XWa(this,Wg(this.vqa));XWa(this,Yg(a));TWa(this)};H(QJ,Jf);QJ[w].fe=D("Ls");QJ[w].L=function $gN(){QJ.C.L[z](this);this.Ls.D();this.Ls=i};H(dXa,QJ);dXa[w].l3c=function $hN(a){a=a[y];if(Kn(a)){var c=Kn(a).b();Number(c[Uc](fG)||c.act)==14&&a.dp(-1)}};dXa[w].o3c=function $iN(a){if(a[Sb]==9){this.lq.vj()&&kXa(this,h);a[zb]()}};_B_prog(73)}catch(e){_B_err(e)}
+
+try{H(iXa,dXa);iXa[w].j3c=function $jN(a){if(a[y]instanceof RJ){a=[];kXa(this,jXa(this,a,a))}};iXa[w].Vm=function $kN(a){a=a[y].b();a=Number(a[Uc](fG)||a.act);this.lq.Hi(k);uC(this.Cb);if(a==78)this.M_b&&this.M_b();else if(a==14){a=this.Ls.GE();this.aLb&&this.aLb(a)}else{a=[];var c=[];jXa(this,a,c)&&this.FFb&&this.FFb(a,c)}};H(SJ,Mn);Ne(SJ);SJ[w].Pb=function $lN(a,c){c=SJ.C.Pb[z](this,a,c);this.Uaa(a,c,h);if(Bg(c,this.Qb()+oXa))lXa(a,2);else Bg(c,this.Qb()+nXa)?lXa(a,1):lXa(a,0);return c};SJ[w].Qb=E(xXa);H(RJ,Qn);RJ[w].Dda=0;RJ[w].k3a=k;RJ[w].ox=function $nN(a){switch(this.Dda){case 0:mXa(this,this.k3a?1:2);break;case 1:mXa(this,2);break;case 2:mXa(this,0);break}var c=this.li().Qb()+Fja;return this[r](a[y]&&Bg(a[y],c)||this.k3a?mj:Wn)};wn(xXa,function(){return new RJ(i)});H(pXa,xx);F=pXa[w];F.tra=E(i);F.tra.Vd=h;F.pCa=B();F.pCa.Vd=h;F.Uga=E(i);F.Uga.Vd=h;F=GXa[w];F.Jo=D(Plb);F.q6=function $sN(a){return this.Jia[a]};F.sga=function $tN(){var a=this;return function(c,d){var f=a.HT(c.kb),g=a.HT(d.kb);return g>f?1:g<f?-1:fm(a.q6(c.kb).Nx,a.q6(d.kb).Nx)}};F.Ltb=B();F.D=B();F.HT=function $wN(a){return this.I1[a]||0};F.hCa=function $xN(a,c){this.I1[a]=c};F.AJb=function $yN(){this.I1={}};H(VJ,VB);yx(pXa,VJ);Nx(Mx(),19,function(b){return new VJ(b)},1);VJ[w].Me=I;VJ[w].Fmb=h;VJ[w].ikb=h;VJ[w].B2c=function $zN(){this.K2()};var vXa={},Znb=vXa;Znb[8]=FN;Znb[9]=JN;Znb[10]=LN;F=VJ[w];F.T1=Ge(AM);F.Dd=D(AM);F.ZLb=function $CN(a,c){this.hV=JXa(this,a,a,c,this.W3c,h);this.Hmb=this.W().ba(T,{"class":xo,style:DG});a[A][A][o](this.Hmb);return this.hV};F.B8a=function $DN(a,c){this.U_=JXa(this,a,c,a,this.u2c,h);this.jkb=this.W().ba(T,{"class":xo,style:DG});a[A][A][o](this.jkb);return this.U_};
+F.tra=function $EN(a){return this.aa.tra(a)};F.pCa=function $FN(a){this.aa.pCa(a)};F.s_a=function $GN(){this.hV&&KXa(this,this.hV)};F.q_a=function $HN(){KXa(this,this.U_)};F.r_a=function $IN(){KXa(this,this.XM)};F.Yb=function $JN(){for(var a=[this.U_,this.XM,this.hV,this.aa.Uga()],c=0;c<a[u];c++){var d=a[c];d&&d.Hi(k)}};F.aQ=function $KN(a){if(a[y]instanceof Sn||a[y]instanceof OJ){this.Cb.lf();LXa(a[y].b())}};var LQ="mam_before_show",aob=":22";
+F.W3c=function $LN(){this[r](LQ);if(this.Fmb){PXa(this);this.Fmb=k;if(Jg||L)bA(aob,G(this.APb,this,this.iV.fe()),100)}for(var a=this.iV.fe(),c,d,f=0;d=a.rb(f);f++){var g=d.b();g=Number(g[Uc](fG)||g.act);if(g==76)d.ra(d.kb!=this.Dd());else if(g){d.ra(this.Ar(g));g=d;var j=!d.Ib();if(!a.z9)a.z9={};a.z9[g.ea()]=j;if(d.Ib())c=d}else if(d instanceof Hn){d.ra(!(c instanceof Hn));c=d;g=!d.Ib();if(!a.z9)a.z9={};a.z9[c.ea()]=g;c=d}}dE(this.B()).pb(this.kp==wE?zgb:Bgb);NJ(a.rb(rn(a)-2));LXa(this.Hmb,10)};
+F.u2c=function $MN(){this[r](LQ);if(this.ikb){QXa(this);this.ikb=k;if(Jg||L)bA(aob,G(this.APb,this,this.DA.fe()),100)}for(var a=this.DA.fe(),c=[],d,f=0;d=a.rb(f);f++)if(d instanceof RJ){lXa(d,this.Qm.HT(d.kb)||0);c[p](d)}c[el](this.Qm.sga());a.Cd();for(f=0;d=c[f];f++)a.Jf(d,f);dE(this.B()).pb(this.kp==wE?Dgb:Fgb);LXa(this.jkb,10);kXa(this.DA,k)};
+F.RXc=function $NN(){this[r](LQ);this.hn||RXa(this);var a=this.hn.fe(),c=IXa(this),d,f,g=this.ac().oga();if(UXa(this))for(d=0;f=c[d];d++){a.rb(d).ra(!g[f]&&this.Ar(f));a.rb(d).Ac(MXa(this,f))}else for(d=0;f=c[d];d++){a.rb(d).ra(!g[f]&&ef(this.dMb,f));a.rb(d).Ac(k)}this.XM.b()[Ek]();dE(this.B()).pb(this.kp==wE?xgb:ygb);LXa(this.p2a,10)};F.APb=function $ON(a){if(a.gm){pa(a.gm||i,I);(a.gm||i)[Ek]()}};
+F.V3c=function $PN(a){var c=a[y].b();c=Number(c[Uc](fG)||c.act);uC(this.Cb);if(!ia(c)&&c>0)if(c==78)this.j7b();else if(c==14)(a=Pf(this.iV.fe().GE()))&&hEa(this.cg,a,this.zLa)?this.s3(76,a):OXa(this,76);else this[r](new XB(c,a[y].kb));dE(this.B()).pb(this.kp==wE?Agb:Cgb)};F.t2c=function $QN(){dE(this.B()).pb(this.kp==wE?Egb:Ggb)};F.fUc=function $RN(a){a&&hEa(this.cg,a,this.zLa)?this.s3(14,a):OXa(this,14)};F.t3=function $SN(a,c){this[r](new XB(77,[c,a]))};
+F.DWa=function $TN(){Wm(VJ.Em,k);var a=this.W().cb(),c=Mg(pm(a)||ba);Rm(VJ.Em,a[Lc][bl],l.max(this.Cb.Nr[Rb],c[id]));Wm(VJ.Em,h)};F.j7b=function $UN(){this.jb[bq]({view:dJ,fk:LC})};F.s3=function $VN(a,c){this[r](new XB(a,c))};var bob='" (create new)';F.vSa=function $WN(a,c){if(!this.Y6a&&!this.CGa)a.ra(k);else{c=Pf(c);if(c==I){a.ra(h);a.lM(FXa)}else{var d=hEa(this.cg,c,this.zLa);a.ra(d);var f=this.W();d&&a.xb(f.ba(PJ,i,Vf,f.ba(Ph,i,c),bob))}}};
+F.K2=function $XN(){var a=OC(this.Aa.za(LC),h);this.Qm=new GXa(this.B(),a);this.Fmb=this.ikb=h};F.Fs=function $YN(a){switch(a){case 76:case 77:case 78:return h}return VJ.C.Fs[z](this,a)};F.L=function $ZN(){VJ.C.L[z](this);this.hV&&this.hV.D();this.DA&&ph(this.DA.fe().b());this.U_&&this.U_.D();this.XM&&this.XM.D();this.aa.Uga()&&this.aa.Uga().D();this.d1b()};F.ZRa=B();F.d1b=B();F=eYa[w];F.qpa=Me;F.xHa=Me;F.dN=Me;F.Rcc=uN;F.eta=E(-1);F.m6b=Me;F.J3b=Me;F.PTa=Me;F.i6b=Me;F.brb=Me;F.b7b=Me;F.XTa=Me;F.Z6b=Me;F.a7b=Me;F.TFb=Me;F.mC=Me;F.UKb=Dy(i);F.idb=Dy(0);F.gub=Dy(I);F.kac=Dy(I);F=fYa[w];F.Og=20;F.Nza=0;F.T2a=0;F.n8=0;F.LBa=h;F.cXa=h;F.E_=k;F.Jw=D(xQ);F.Saa=Ge(xQ);F.Ut=D("Nza");F.nxb=Ge("LBa");F.Yla=Ge(dmb);H(gYa,uh);F=gYa[w];F.hIb=Zx;F.zm=function $7N(a){for(var c=[],d=a.Sb(),f=0;f<d[u];f++){var g=d[f],j=a.J(g);if(j!=this.Vo(g)){if(j)this.Cx[g]=h;else delete this.Cx[g];c[p](g)}}this[r](new iYa(c))};F.E6=function $8N(){return new Hf(this.Cx)};F.Vo=function $9N(a){return!!this.Cx[a]};F.XG=D("hIb");H(iYa,N);dk(aK[w],function $aO(a){return this.thd(a)});var MQ="All",NQ=new aK(cz,MQ,E(h)),OQ="None",cob=new aK(xd,OQ,E(k));H(bK,AD);F=bK[w];F.nR=h;F.EF=0;F.Th=-1;F.ft=2;F.mV=Zx;F.p4a=0;F.wc=function $bO(){var a=this.ia;Ff(this.jU,function(c){a.ha(c)});a.ha(this.Lj);this.kda=new eE(this[uq]());a.ha(this.kda);Ff(this.Fbb,function(c){a.ha(c)});this.H().w(this.vl,lYa,this.YJc);this.Uva()};F.cdc=Ge(KP);F.oma=Ge(vz);F.wr=D(wQ);F.Ut=D("az");F.Jw=D(xQ);F.Saa=Ge(xQ);F.nxb=Ge("LBa");F.vy=D(fnb);F.getItem=function $kO(a){return this.qi.J(a)};F.Dp=function $lO(){return this.Om[u]};
+F.FO=function $mO(a){if(a<0||a>=this.Om[u])return i;return this.Om[a]};F.Zsa=function $nO(){return this.Om[this.Th]};F.Mn=function $oO(a){this.Th=a;eK(this)};var dob="mV";F.ndc=Ge(dob);F.getSelection=D(VL);F.xwa=function $rO(){return this.Ll.hc()};F.eXb=function $sO(){this.Ll.rg()};F.Ydd=function $tO(a,c){a.w(this.Aa.Ya(),this.Ll.Je(),c)};var eob="NS";F.cja=Ge(eob);F.hSb=function $vO(){for(var a=0,c=this.Om,d=0;d<c[u];d++)this.vl.Vo(c[d].g_())&&a++;return a};
+F.Wb=function $wO(){this.Tl=h;CYa(this);yYa(this)};F.Df=function $xO(){this.Tl=k;eK(this)};F.Wvc=function $yO(){this.vda()};F.ola=function $zO(){pYa(this,kD)};Bp(F,function $AO(){this.vda();this.NS=k;this.Ll.rg();pYa(this,kD);CYa(this)});F.ZVa=function $BO(a){pYa(this,a)};F.luc=function $CO(a){var c=this.NS;this.cja(k);this.Ll.rg();pYa(this,Ph,a);!this.Bh&&c&&this.cja(h)};F.cp=function $DO(){this.nR=k;cK(this)};F.uW=function $EO(){this.ft=2;this.Th=-1;eK(this);this.SWa=i;this.NS=k};
+F.JQ=function $FO(){this.Tl&&this.LBa&&this.Lj.eM(this.Th)};F.cC=function $GO(a){for(var c=this.qi.Oa(),d=0;d<c[u];d++)a[z](this,c[d])};F.hB=function $HO(){return eK(this)};F.Uva=function $IO(){this.H().w(this.Aa.Ya(),this.Ll.Je(),this.efb);this.H().w(this.Aa.Ya(),this.Ll.pua(),this.dIc);this.Kd=this.Ll.wr();this.Kd.Yla(this.PD);this.H().w(this.Kd,XH,this.aIc)};F.vda=function $JO(){if(this.Bh){var a=this.Bh;this.Bh=i;a[wc]()}};F.CFc=function $KO(){return this.kda?this.kda.b():i};
+var fob="HmCP1d",gob='" role="main"><col class="',hob="Cm",PQ='"><col class="',iob="oj0HKf",job='"><col><tbody>';F.sGa=function $LO(){var a=this.Dp(),c=this.na.idb(),d=l.max(0,c-a),f=this.na.kac();if(!(d==this.p4a&&!f)){var g;g=new U;g[R](Fl,ul,J,fob,gob,hob,PQ,iob,job);g=g[t]();g=[g];g[p](f);Jg&&d==1&&a==0&&g[p](aYa(i));var j=-1;a||(j=l[rb](c/2));for(a=0;a<d;a++)a==j?g[p](cYa({ke:this.na.gub()})):g[p](ZXa(i));this.p4a=d;g[p](dYa(i));a=this.kda.b();Q(a,g[kd](I));if(L)if(d||f)Ag(a,BYa);this.kda.qe(Wx)}};
+F.uz=function $MO(a,c){var d=k,f;a:{for(f=0;f<this.Om[u];f++)if(this.Om[f].ea()==a){f=f;break a}f=-1}if(f!=-1){var g=this.Ll.za(a);if(g.hc()&&!g.Ds()){d=g.J();this.qi.set(a,d);this.Om[f]=d;this.Lj.uz(f,d,c);d=h}}return d};
+F.oBa=function $NO(a){var c=-1;if(a==this.Th){c=this.na.eta(a);if(c<0||c>=this.EF)c=a}else c=this.Th;this.EF--;var d=this.Lj.cub(a);this.qi[Pb](d);var f=this.Fia.J(d);if(f){f.bB();this.Fia[Pb](d)}c>=0&&a<c&&c--;kf(this.Om,a);if(c<0)this.Mn(-1);else this.Th>=this.EF?this.Mn(this.EF-1):this.Mn(c)};F.efb=function $OO(){this.Ll.hc()};
+F.dIc=function $PO(a){if(!this.nR&&this.Bh)this.eKa=h;else{for(var c=a.dG,d=c[u],f=0;f<d;f++){var g=c[f],j=this.Aa.cj(g);if(j.ac()==this.Ll){j=j.vn();if(this.qi.Xb(j)){this.Gka[p](j);this.GUa[j]|=a.aJ[g]}}}this.Gka[u]&&this.Ui(vA)}};
+F.aIc=function $QO(a){yA++;try{for(var c=k,d=0;d<a.dG[u];d++){var f=a.dG[d];if(f[Zb]==1)c=h;else if(f[Zb]==2){if(c){cK(this);c=k}if(this.nR){var g=f[Lq]-this.Rf;if(g>=0&&(g<this.Og||this.E_)){var j=g,n=f.Ih,s=n.J();this.Fia.set(s.ea(),n);this.qi.set(s.ea(),s);n.Iz();this.Om[u]==this.Og&&!this.E_&&this.oBa(this.Og-1);km(this.Om,s,j);this.Th>=j&&this.Th<this.Og-1&&this.Th++;this.EF++;this.Lj[oq](j,s);eK(this)}}else this.eKa=h}else if(f[Zb]==3){if(c){cK(this);c=k}if(this.nR){g=f[Lq]-this.Rf;if(g>=0&&
+(g<this.Og||this.E_))this.oBa(g)}else this.eKa=h}else if(f[Zb]==5)c=this.nR=k;else if(f[Zb]==7){if(this.eKa){cK(this);c=k}this.nR=h}else if(f[Zb]==6){xYa(this);this.na.PTa(f.Hcd)}}c&&cK(this)}finally{zA()}this.na.TFb()};F.AH=function $RO(a){a==this.Bh&&AYa(this)};F.wh=B();F.uPc=function $TO(){return this.Kd.Es()};F.yib=function $UO(a){this.Kd.yib(a)};F.Ya=function $VO(){return this};F.mha=function $WO(a){this.na.mC(a)};F.qca=function $XO(){this.na.brb()};
+F.di=function $YO(a,c,d){bK.C.di[z](this,a,c,d);if(this.Gka[u]){a=this.Gka;c=this.GUa;d=k;for(var f=0;f<a[u];f++){var g=a[f];d|=this.uz(g,c[g])}d&&eK(this);Ia(this.Gka,0);this.GUa={}}};var QQ="Na";F.YJc=function $ZO(a){var c={};this.cC(function(g){c[g.g_()]=g});for(var d=0;d<a.kh[u];d++){var f=c[a.kh[d]];f&&this.qi.Xb(f.ea())&&this.Lj.Oic(f)}this[r](QQ)};
+F.zD=function $_O(a){var c=this.Ll.J().xK();a==NQ&&c>this.Og?this.Qz(GF):this.Qz(Zx);var d=new Hf;this.cC(function(f){var g=f.g_();d.set(g,a[Fk](f))});this.vl.zm(d);this.na.m6b(a)};F.Qz=function $0O(a){if(this.vl.XG()!=a){this.vl.hIb=a;this.na.J3b(a)}};F.uNa=function $1O(){var a=new mYa;a.Ovb=this.vl.E6();a.gIb=this.vl.XG();return a};F.DI=function $2O(a){var c=a.Ovb;a=a.gIb;jYa(this.vl);this.vl.zm(c);this.Qz(a)};F.nnb=function $3O(){if(this.Th<this.EF-1){this.mV=Zx;this.Mn(this.Th+1);this.JQ();return h}return k};
+F.Q8b=function $4O(){if(this.Th>0){this.mV=oy;this.Mn(this.Th-1);this.JQ()}return k};_B_prog(74)}catch(e){_B_err(e)}
+
+try{var HYa=[3E5,12E4,6E5,18E4,36E5,3E5,-1,6E5];F=DYa[w];F.DRc=0;F.xya=0;F.D=function $5O(){if(this.ab){cA(this.ab);this.ab=i}if(this.Hh){this.Hh.D();this.Hh=i}};F.ix=function $6O(){this.ab=i;GYa(this,Zf())};F.bWa=function $7O(){this.Qdd[z](this.na)};F=JYa[w];F.getSelection=D(VL);F.zD=function $9O(a){this.xa.zD(a)};F.Jib=function $$O(){return this.vl.XG()==dK};F.Kib=function $aP(a){return this.Jib()||a==45||a==46};F.hua=function $bP(a){return this.Kib(a)?oYa(this.xa):this.xa.hSb()};F.XG=function $cP(){return this.vl.XG()};F.Qz=function $dP(a){this.xa.Qz(a)};H(gK,AJ);gK[w].GB=-1;var kob=[Xi,fj,P,ij,pj];L&&kob[p](ej);F=gK[w];var lob="Cp";F.wc=function $eP(){this.zC==kD&&this.hg.sf(1);L&&K(this.hg.b(),BYa);var a=this.hg.b();K(a,lob);this.H().w(a,kob,this.W7c);this.HDa=new xm(a);this.H().w(this.HDa,cj,this.X7c);this.H().w(this.HDa,dj,this.Y7c)};F.L=function $fP(){gK.C.L[z](this);if(this.HDa){this.HDa.D();this.HDa=i}};
+F.insertRow=function $gP(a,c){this.GB>=a&&this.GB<this.xa.Jw()-1&&this.GB++;var d=this.hg.b()[ic](Wd)[0];if(d){a=d[oq](a);c=jK(this,c);this.TD.zWc(a,c)}else{this.AHa();this.QGa(c);this.PLa()}};F.uz=function $hP(a,c,d){a==this.Rdb()&&this.Cb.lf();a=hK(this,a);c=jK(this,c,i,d);this.TD.uz(a,c)};
+F.cub=function $iP(a){var c=this.hg.b(),d=Wg(c);for(c=a;d;){var f=Wg(d);if(c>=f[kl][u])c-=f[kl][u];else{d=f[kl][Ab](c);var g=iK(this,d);d==this.Izb&&this.Cb.lf();f.deleteRow(c);this.hg.qe(Wx);if(a<this.GB)this.GB--;else if(a==this.GB){this.GB=-1;this.FIa=i}return g}d=Yg(d)}return i};F.hB=function $jP(a){var c=this.eN();if(!c&&this.GB>=0)NYa(this,this.GB,k);else{this.GB>=0&&NYa(this,this.GB,k);c&&a>=0&&NYa(this,a,h)}};F.Oic=function $kP(a){var c=this.b(RE+a.ea());a=jK(this,a,1,i);this.TD.uz(c,a)};
+var mob='<table cellpadding="0" id="',nob="<tbody>";F.AHa=function $lP(){this.Fba=new U;var a={Hzb:this.X(J4a),zmd:this.GDa};var c=this.Fba,d=c||new U;d[R](mob,a.Hzb,S,a.zmd,W);c||d[t]();this.ZJb&&this.ZJb.xed(this.Fba);c=(a=this.Fba)||new U;c[R](nob);a||c[t]()};F.PLa=function $mP(){this.Fba[R](KYa());var a=this.W()[Qb](T);Q(a,this.Fba[t]());this.hg.b()[o](a);this.Fba[bc]();L&&Ag(this.hg.b(),BYa);this.hg.qe(Wx)};F.QGa=function $nP(a){this.TD.WL(jK(this,a),this.Fba)};
+F.eM=function $oP(a){(a=hK(this,a))&&this.Cb[wq](a,1)};F.Lub=function $pP(){var a=this.hg.b();Q(a,I);L&&K(a,BYa);this.GB=-1;this.FIa=i;this.Rdb()!=-1&&this.Cb.lf()};F.MPb=function $qP(){this.hg.b()[ql]};F.Rdb=function $rP(){return this.eua(this.Izb)};F.eN=E(h);
+F.W7c=function $tP(a){var c=a[Zb];if(!(c==fj&&!nm(a,0)&&!nm(a,2)))if(!((c==P||c==ej)&&!nm(a,0))){a.gNb=k;var d=PYa(this,a[y]);if(d)if(c==P||c==ej)this.V8(a,d);else if(c==ij)this.BTa(a,d);else if(c==Xi)OYa(this,a,d);else if(c==fj)OYa(this,a,d);else c==pj&&this.ATa(a,d);else c==fj&&a[zb]();if(a.gNb){c=this.xa[Vp](iK(this,d));var f=a[dd];this.xa.Qz(Zx);a=c.g_();if(f&&this.FZb){a:{c=this.FZb;f=this.xa.Om;for(var g=0;g<f[u];g++)if(f[g].g_()==c){c=g;break a}c=-1}f=this.eua(d);if(c==-1)c=f;d=l.min(c,f);
+c=l.max(c,f);f=!this.vl.Vo(a);g=new Hf;var j=this.xa.Om;for(d=d;d<=c;d++)g.set(j[d].g_(),f);this.vl.zm(g)}else kYa(this.vl,a);this.FZb=a}}};F.BTa=function $uP(a,c){OYa(this,a,c)};F.V8=function $vP(a,c){OYa(this,a,c)};F.ATa=function $wP(a,c){OYa(this,a,c)};F.X7c=function $xP(a){this.Izb=PYa(this,a[y])};F.Y7c=function $yP(){this.Izb=i};F.eua=function $zP(a){var c=this.hg.b();c=Wg(c);for(var d=0;c;){for(var f=Wg(c)[kl],g=f[u],j=0;j<g;j++){if(f[Ab](j)==a)return d;d++}c=Yg(c)}return-1};
+F.Zj=function $AP(a,c){return this.X(a+c)};F.vs=function $BP(a,c){return this.b(a+c)};QYa[w].zC=ki;QYa[w].GDa="F cf";QYa[w].UXa=function $CP(a){return this.zC=a};var oob='<COL class="';RYa[w].xed=function $DP(a){for(var c=0;c<this.yJ[u];c++){var d=this.yJ[c];a[R](oob);a[R](d.ey);a[R](W)}};H(lK,cWa);lK[w].ao=function $EP(){return this[Oc][Oc].ao()};lK[w].B=function $FP(){return this[Oc].B()};H(nK,lK);var pob={},qob="xW",rob='"><span title="',sob="</span></td>";nK[w].sW=function $GP(a,c){this.hI(a,pob);a=c||new U;a[R](QG,qob,J,CK,rob,pob.sod,Gl,pob.wAc,W,pob.Hnd,sob);c||a[t]()};nK[w].hI=function $HP(a,c){a=a[Vp]();var d=a.ea();c.Hnd=a.A4;c.sod=a.Mhc[mb](Rlb,J);c.wAc=this.Zj(UP,d)};nK[w].I2=function $IP(a,c){if(c.XY&2){a=c[Vp]();if(c=this.vs(UP,a.ea())){Q(c,a.A4);ik(c,a.Mhc[mb](Rlb,J))}}};_B_prog(75)}catch(e){_B_err(e)}
+
+try{H(oK,xx);F=oK[w];F.Y_a=B();F.Y_a.ic=h;F.qeb=Me;F.qeb.Vd=h;F.Acb=B();F.Acb.Vd=h;H(pK,lK);var RQ={},tob="yf",uob="Ab",vob="Voicemail",wob="xL",xob="Calendar event",yob="yE",zob="Attachment",Aob="xM",Bob="Chat log",SQ="</td>";
+pK[w].sW=function $LP(a,c){this.hI(a,RQ);RQ.tMb=this.aa.pWa(RQ);a=c||new U;a[R](QG,tob,J,CK,W);if(RQ.tMb)a[R](RQ.tMb);else if(RQ.Gs)xI({Hb:uob,title:vob,je:RQ.kCb,Xe:RQ.lCb},a);else if(RQ.fda)RQ.Jtc==0?xI({Hb:wob,title:RQ.fda,alt:xob,je:RQ.rIb,Xe:RQ.d5a},a):xI({Hb:yob,title:RQ.fda,alt:zob,je:RQ.Brb,Xe:RQ.Crb},a);else RQ.GPa?xI({Hb:Aob,alt:Bob,je:RQ.S3,Xe:RQ.U3},a):a[R](MH);a[R](SQ);c||a[t]()};pK[w].hI=function $MP(a,c){var d=a[Vp]();c.GPa=d.GPa();c.fda=d.gda;c.Gs=d.Gs();c.Jtc=d.XGa;this.aa.Jj(a,c)};
+yx(qK,pK);qK[w].Jj=B();qK[w].Jj.Ka=h;qK[w].pWa=B();qK[w].pWa.Rn=h;H(sK,lK);var TQ="fu";sK[w].Mc=D(TQ);sK[w].Ac=Ge(TQ);var Cob={};sK[w].sW=function $RP(a,c){this.hI(a,Cob);a=c||new U;a[R](QG,CK,W,Cob.Zad,SQ);c||a[t]()};sK[w].hI=function $SP(a,c){a=a[Vp]();c.Zad=this.fu?a.f8b:I};H(tK,lK);var UQ={ppa:[]},Dob="yX";tK[w].sW=function $TP(a,c){this.hI(a,UQ);WYa(this,UQ);a=c||new U;a[R](QG,Dob,J,CK,W);UYa(UQ,a);a[R](SQ);c||a[t]()};tK[w].I2=function $UP(a,c){if(c.XY&2)if(this.vs(wO,c.ea())){this.hI(c,UQ);WYa(this,UQ);Q(a,UYa(UQ))}};tK[w].hI=function $VP(a,c){a=a[Vp]();var d=a.ea();c.Vhd=a.M1;c.Uhd=this.Zj(wO,d);Ia(c.ppa,0);this.aa.Jj(c,a)};yx(XYa,tK);XYa[w].Jj=B();XYa[w].Jj.Ka=h;H(ZYa,lK);var VQ={};F=ZYa[w];var Eob="zy",Fob="y4";F.sW=function $XP(a,c){this.hI(a,VQ);a=c||new U;if(VQ.Mm){a[R](QG,Eob,J,CK,W);xI(Kw(VQ,{Hb:r0a,alt:LN}),a)}else{a[R](QG,Fob,J,CK,W);xI(Kw(VQ,{Hb:VQ.nld,As:VQ.old}),a)}a[R](SQ);c||a[t]()};var WQ="si";F.hI=function $YP(a,c){var d=a[Vp](),f=d.ea();c.old=this.Zj(WQ,f);c.Mm=d.Mm();c.nld=this.aa.rqa(d);c.alt=this.aa.eKb(d);this.aa.O2a(a,c)};F.I2=function $ZP(a,c){if(c.XY&1){a=c[Vp]();if(c=this.vs(WQ,a.ea()))m(c,this.aa.rqa(a))}};
+F.Wya=function $_P(a,c,d){this.ao().aP(d.ea());sC(this.B()).lf();a[zb]();return h};F.Vya=E(h);F.mob=function $1P(a){return a[Sb]==13};yx(aZa,ZYa);F=aZa[w];var Gob="y3",Hob="zG";F.rqa=function $2P(a){return a.Uf()?Gob:Hob};F.rqa.Vd=h;F.eKb=function $3P(a){return a.Uf()?KN:I};F.eKb.Vd=h;F.O2a=B();F.O2a.Ka=h;H(uK,xx);uK[w].zYa=E(k);uK[w].zYa.ic=h;yx(uK,bZa);var Iob=[],Job=[],Kob=[],Lob=[TI,AL,BL,GN],XQ=[TI,oI,DN,IN,AL,BL,EN,CL];bZa[w].Wsa=function $6P(a){var c=a.Jo();Ia(Iob,0);Ia(Job,0);for(a=0;a<c[u];a++){var d=c[a];Mf(d,Ty)?Iob[p](d):Job[p](d)}Ia(Kob,0);(c=Xy(this.Ea))&&!ef(XQ,c)&&cZa(this,Kob,c);for(a=0;a<Iob[u];a++){d=Iob[a];ef(Lob,d)&&d!=c&&!this.aa.zYa(d,this.Ea)&&cZa(this,Kob,d)}for(a=0;a<Job[u];a++){d=Job[a];d!=c&&cZa(this,Kob,d)}return Kob[kd](J)};H(wK,lK);var Mob={},Nob='" tabindex="0" role="link" class="';wK[w].sW=function $7P(a,c){this.hI(a,Mob);a=c||new U;a[R](HQ,Mob.iRc,Nob,CK,W);hZa(Mob,a);a[R](SQ);c||a[t]()};var Oob="lssc";wK[w].hI=function $8P(a,c){a=a[Vp]();var d=a.ea();c.dxa=this.mkb.Wsa(a);c.m2=mZa(this,a);c.xfc=a.SCa;c.qjb=a.qjb();c.iRc=this.Zj(Oob,d);c.nkb=this.Zj(qd,d);c.qgc=this.Zj(oF,d)};
+wK[w].I2=function $9P(a,c){a=c[Vp]();var d=a.ea();c=c.XY;if(c&4){var f=this.mkb.Wsa(a),g=this.vs(qd,d);if(g)if(f)Q(g,kZa({dxa:f}));else Sg(g);else if(f){var j;if(j=(j=this.vs(oF,d))&&j[A]){f=iZa({dxa:f,nkb:this.Zj(qd,d)});g=kx(this.W(),f);Qg(g,j)}}}if(c&2)if(d=this.vs(oF,d))Q(d,mZa(this,a))};H(nZa,yJ);F=nZa[w];F.hUa=5;F.GAc=I;F.hC=D("hUa");F.insertCell=function $aQ(a,c){a.Ig(this);for(var d=0;d<this.oq[u];d++)if(this.oq[d][pq]()==c){km(this.oq,a,d);return}this.oq[p](a)};F.WL=function $bQ(a,c){yK.oaa=this.e_(a);yK.cM=sZa(this,a);LYa(yK,c);tZa(this,a,c);MYa(i,c)};var Pob="zoom",YQ="1.0";F.zWc=function $cQ(a,c){var d=this.e_(c);m(a,d);a.id=sZa(this,c);if(L){d=this.oq[u];for(var f=0;f<d;f++)a[yq](f);Dm(a,Pob,YQ)}rZa(this,a,c)};
+F.uz=function $dQ(a,c){this.Fac(c)&&mx(a,this.e_(c));var d=this.Dac(c);if(d==1)for(d=0;d<this.oq[u];d++)this.oq[d].I2(a[cl][d],c);else d==2&&rZa(this,a,c)};F.Fac=function $eQ(a){var c=a.H_a;a=a.XY;var d=k;if(c){d|=this.hUa&1&&c&1;d|=this.hUa&2&&c&2}if(a)d|=this.hUa&4&&a;return d};F.Dac=E(1);
+F.o2c=function $gQ(a,c,d){var f;a:{for(f=a[y];f!=i&&f!=c;){if(f[ed]==Fd){f=f;break a}f=f[A]}f=i}var g=k;if(f){var j;a:{for(j=0;j<this.oq[u];j++)if(c[cl][j]==f){j=this.oq[j];break a}j=i}if(j)g=j.fZc(a,f,d)}g||pZa(this,a,c,d)};F.V8=Me;F.BTa=Me;F.g5b=function $hQ(a){a[zb]()};F.h5b=function $iQ(a){a[zb]()};F.ATa=Me;var yK={};nZa[w].e_=D("GAc");H(zK,nZa);F=zK[w];F.B=function $kQ(){return this.ub.B()};F.ao=D(vL);F.uz=function $mQ(a,c){this.aa.uz(a,c)||zK.C.uz[z](this,a,c)};F.WL=function $nQ(a,c){this.aa.WL(a,c)||zK.C.WL[z](this,a,c)};F.e_=function $oQ(a){var c=a[Vp]();a=(c.Jl?2:0)|(a.Vo()?1:0)|(c.qjb()?4:0);return Qob[a]};F.Fac=function $pQ(a){var c=a.XY;if(c&2)return h;if(c==65535)return h;if(a.H_a&1)return h};F.Dac=function $qQ(a){var c=a.H_a;a=a.XY;if(a==65535)return 2;else if(a||c)return 1};
+F.g5b=function $rQ(a,c,d){if(!this.aa.wpb(a,c,d)){d=this[Oc];var f=a[dd]||a[Bc],g=a[Bc];C1a(d.ub,d.eua(c),f,g);a[zb]()}};F.h5b=function $sQ(a,c,d){this.aa.yqb(a,c,d)||a[zb]()};F.V8=function $tQ(a,c,d){this.aa.TH(a,c,d)};F.BTa=function $uQ(a,c){if(a[Sb]==13){a[Ec]();a[zb]();var d=this.xa;a=a[dd];C1a(d.ub,d.eua(c),a,void 0)}};F.ATa=function $vQ(a,c,d){this.aa.vob(a,c,d)};var Qob=["zA yO","zA yO x7","zA zE","zA zE x7","zA yO zB","zA yO x7 zB","zA zE zB","zA zE x7 zB"];yx(uZa,zK);F=uZa[w];F.wc=B();
+F.wc.Ka=h;F.uz=B();F.uz.ic=h;F.WL=B();F.WL.ic=h;F.wpb=B();F.wpb.ic=h;F.yqb=B();F.yqb.ic=h;F.TH=B();F.TH.ic=h;F.vob=B();F.vob.ic=h;H(AK,xx);F=AK[w];F.vMa=function $DQ(a){return new gF(a)};F.vMa.Vd=h;F.A5a=B();F.A5a.Ka=h;F.Wb=B();F.Wb.Ka=h;F.Df=B();F.Df.Ka=h;F.C0a=B();F.C0a.Ka=h;F.uW=B();F.uW.Ka=h;F.h4a=B();F.h4a.Ka=h;Bp(F,B());F[Sq].Ka=h;F.opa=B();F.opa.Ka=h;F.qma=B();F.qma.Ka=h;F.aP=B();F.aP.Vd=h;F.Qh=B();F.Qh.ic=h;F.Qqa=B();F.Qqa.ic=h;F.YNa=B();F.YNa.Ka=h;F.CKc=B();F.CKc.Ka=h;F.agb=B();F.agb.Ka=h;F.pQa=B();F.pQa.ic=h;F.Pjb=B();F.Pjb.ic=h;F.D=B();F.D.Ka=h;F.zD=B();F.Osb=B();F.Osb.ic=h;F.jdb=B();F.jdb.Rn=h;F.dNa=B();
+F.dNa.Rn=h;F.DO=B();F.i6=B();F.Wmb=B();F.Wmb.Ka=h;F.Qvb=B();F.Qvb.Vd=h;F.MY=function $3Q(a,c,d,f){return a.MY(c,d,f)};F.MY.Vd=h;H(BK,gK);yx(oK,BK);var Rob=new kK(XF,hob),Sob=new kK(YYa,"y5"),Tob=new kK(VYa,"yY"),Uob=new kK(rK,"yF"),Vob=new kK(vK,i),Wob=new kK(SYa,"yg"),Xob=new kK(mK,"xX");F=BK[w];F.i7a=function $4Q(){for(var a=new RYa,c=this.aa.qeb()||[Rob,Sob,Tob,Uob,Vob,Wob,Xob],d=0,f;f=c[d];d++)a.yJ[p](f);return a};F.iLb=function $5Q(a){return new zK(a)};F.B=D(JF);F.ao=D(vL);F.qCa=function $8Q(a){oZa(this.TD,rK).Ac(a)};F.eN=function $9Q(){return this.V.eN()&&this.Ixb};_B_prog(76)}catch(e){_B_err(e)}
+
+try{yZa[w].ZIc=function $$Q(a){a=a.Mg()[u];var c=this.xa;sYa(c,a)||c.Kd.rg();var d=c.Ll.J().xK()-a;if(c.az>0&&d<=c.Rf){d=l.max(0,l[rb]((d-1)/c.Og));c.mha(d)}c=this.xa.Jw();d=this.xa.Ut();var f=d*c;a=this.xa.Ll.J().nj-a;d>0&&a<=f&&this.pA.mC(l.max(0,l[rb]((a-1)/c)),2)};yZa[w].WPc=function $aR(a){return Uy(a).Qc(this.Ea)};zZa[w].Tja=function $bR(a){if(this.xa.Th<this.xa.Dp()-1)this.xa.nnb();else{var c=oYa(this.xa);c=l[ob](c/this.xa.Jw())-1;if(this.xa.Ut()<c&&!this.xa.Bh){a&&QF(this.xa,Kbb);this.pA.mC(this.xa.Ut()+1,2)}else this.xa.JQ()}};zZa[w].yAa=function $cR(a){if(this.xa.Th>0)this.xa.Q8b();else if(this.xa.Ut()>0&&!this.xa.Bh){a&&QF(this.xa,Lbb);this.pA.mC(this.xa.Ut()-1,3)}else this.xa.JQ()};hk(AZa[w],Ge(Ej));AZa[w].mC=function $eR(a,c){if(this.ng)this.jb[bq]({view:wE,search:this.Ea,tZa:c||2,page:a})};H(DK,bK);DK[w].qCa=function $fR(a){var c=this.Lj;c.qCa&&c.qCa(a)};DK[w].PGc=function $gR(){return this.Xi.J().Qe()};DK[w].hdb=function $hR(){return this.Xi.J().hdb()};DK[w].xeb=function $iR(){return this.Xi.J().xeb()};H(EK,xx);EK[w].Tdb=B();EK[w].Tdb.Rn=h;EK[w].cpb=B();EK[w].cpb.ic=h;H(BZa,AD);yx(EK,BZa);BZa[w].xMa=function $lR(){return{ag:this.xa.Jw(),NKb:this.xa.Om[u],ZF:oYa(this.xa),LQ:this.Ea[pq](),Ij:this.X(KK.jFa)}};
+BZa[w].M1c=function $mR(a){var c=a[y],d=c.id;c=c[A]?c[A].id:I;var f=KK;if(!this.aa.cpb(a)){a=this.X(f.jFa);if(d==a||c==a){d=this.Du.XG();if(d==GF)this.Du.Qz(dK);else if(d==dK){this.Du.Qz(Zx);this.Du.zD(Yob)}}else if(d==this.X(f.u1a))this.eFb.nk(45,i);else if(d==this.X(f.nDb))this.eFb.nk(46,i);else if(d==this.X(f.oEb)){d=new Sh;Iy(this.Ea,d);d.ka(Zya,0);d=aza(Sy,d.Of());this.jb[bq]({view:wE,search:d})}else d==this.X(f.kFa)&&this.jb[bq]({view:dJ,fk:pJ})}};H(LK,fF);LK[w].Vh=function $nR(){LK.C.Vh[z](this);this.D5=this.W()[Qb](T);m(this.D5,zF);this.W()[o](this.wa,this.D5)};var Zob="Cq",apb="Cr";LK[w].bia=function $oR(a,c){if(this.qj()>1||c>1)e(Error(".161"));var d=this.D5;if(this.qj()==1&&c==0){d=this.rb(0).b();Ag(d,Zob);K(d,apb);d=d}a=a.b();c==0?K(a,Zob):K(a,apb);this.W().yA(a,d)};LK[w].jBa=function $pR(a,c){a=a.b();c==0?Ag(a,Zob):Ag(a,apb);this.W()[ad](a);if(c==0&&this.qj()==1){c=this.rb(0).b();Ag(c,apb);K(c,Zob)}};
+LK[w].hjc=function $qR(a,c,d,f){return a==vA&&f==-1};H(PK,AD);F=PK[w];F.rQa=0;F.Xkb=1;F.ma=function $rR(){PK.C.ma[z](this);this.H().w(this.Ll.mb.Ya(),this.Ll.Je(),this.lka);this.H().w(this.xa,wYa,this.Znb);Pw(this.H(),this.zrb,aB,this.N4c);this.H().w(this.zrb,P,this.M4c);y_a(this)};F.Ba=function $sR(){PK.C.Ba[z](this);this.H().wb()};F.VFb=Me;var bpb="&laquo; ",cpb="First",dpb="Newest",epb="&lsaquo; ",fpb="Prev",gpb="Newer",hpb="Next",ipb="Older",jpb=" &rsaquo;",kpb="Last",lpb="Oldest";
+F.Ybb=function $tR(a){var c=new U;c[R](WG,g_a,W);if(a.jkd){var d=new U(bpb);a.iRa==2?d[R](cpb):d[R](dpb);f_a({id:a.HMc,Ab:d[t]()},c);c[R](JK)}if(a.myb){d=new U(epb);a.iRa==2?d[R](fpb):d[R](gpb);f_a({id:a.mhb,Ab:d[t]()},c)}c[R](MH,a.Amd,MH);if(a.nyb){d=new U;a.iRa==2?d[R](hpb):d[R](ipb);d[R](jpb);f_a({id:a.nhb,Ab:d[t]()},c)}if(a.nkd){c[R](JK);d=new U;a.iRa==2?d[R](kpb):d[R](lpb);d[R](snb);f_a({id:a.KMc,Ab:d[t]()},c)}c[R](gB);a=c[t]();return a};
+F.keb=function $uR(a,c,d,f){a=z_a(a,c,d);return A_a(f,a)};F.lka=function $vR(){this.Ll.hc()&&y_a(this)};F.Znb=function $wR(){var a=this.xa.Dp();if(a!=this.rQa){this.rQa=a;y_a(this)}};F.N4c=function $xR(a){var c=this.xa.Ut(),d=-1;a=a[y].id;switch(a?this.td(a):i){case ki:d=0;break;case oy:d=c-1;break;case Zx:d=c+1;break;case Rd:c=this.Ll.J().xK();d=this.xa.Jw();d=l[ob](c/d)-1;break;case Xx:tYa(this.xa);return}d>=0&&this.LTa(d)};F.M4c=function $yR(a){a[zb]()};F.LTa=B();H(QK,PK);QK[w].LTa=function $AR(a){QF(this,Hbb);this.pA.mC(a)};QK[w].Ybb=function $BR(a){return QK.C.Ybb[z](this,a)};H(M_a,xx);M_a[w].Xid=B();M_a[w].Xid.Ka=h;var Yob=cob,mpb=new aK("read","Read",function(b){return!b.Jl}),npb="unread",opb=new aK(npb,"Unread",function(b){return b.Jl}),ppb=new aK(sz,KN,function(b){return b.Uf()}),qpb="Unstarred",rpb=new aK("unstarred",qpb,function(b){return!b.Uf()}),ZQ=[NQ,Yob,mpb,opb,ppb,rpb];H(RK,BD);yx(M_a,RK);RK[w].JD=function $DR(){var a={pXa:ZQ,separator:wj};Q(this.ia.b(),L_a(a));Pw(this.H(),this.b(),aB,this.lh);this.ia.qe(Wx)};var spb="selector";RK[w].lh=function $ER(a){a=a[y][Uc](spb);for(var c=0;c<ZQ[u];c++){var d=ZQ[c];if(a==d[ec]){this.xa.zD(d);dE(this.B()).jj(Pfb,d[ec]);break}}};S_a[w].Ga=D(Gd);S_a[w].Yg=D("SB");H(T_a,xx);T_a[w].feb=B();H(U_a,Jf);yx(T_a,U_a);var X_a=new S_a(mK,"Sort by date");H(a0a,BD);a0a[w].JD=function $IR(){var a;if(this.Gbc)a=W_a(this.Gbc,this.Ea.Ga());var c=this.ia.b();if(!a||a[u]<2)Wm(c,k);else{Q(c,R_a({fAc:this.iZa,Gsc:a}));Pw(this.H(),this.b(),aB,this.lh);this.ia.qe(Wx)}};a0a[w].lh=function $JR(a){if((a=a[y][Uc](TK))&&a!=this.iZa){var c=this.Ea,d=new Hf(c.ZZ());!a||a==mK?d[Pb](TK):d.set(TK,a);a=hza(c,d);this.jb[bq]({view:wE,search:a})}};H(c0a,gF);Qp(c0a[w],function $KR(a,c){if(!this.tW){if(c!=I)switch(a.Ga()){case Jy:case az:case ul:case Oy:this.gj.gp(G0a({Zgb:xw(Wf(c))}))}this.gj.wc();this.tW=h}});F=UK[w];F.tb=function $LR(a){var c=this.Aa.za(WK).Zn(this.Ea),d=this.Jta();c=new DK(this.V,c,d);d=this.Qqa(d0a(this,a,c));d.wc();c.Lj=d;c.wc();this.xa=c;this.pA=new AZa(this.V,this.Ea);this.vya=new zZa(this.xa,this.pA);this.eUa=new P0a(this.V,a,this.xa,this.Ea);this.LOc=new yZa(this.V,this.xa,this.pA,this.Ea);this.Du=new JYa(this.vl,this.xa,this.Ea)};F.B=D(JF);
+F.Jta=function $NR(){var a=new fYa;a.Saa(this.Og);a.Nza=this.az;a.T2a=this.ynb;a.n8=5;a.a_b=this.vl;a.Yla(wRa);var c=gza(this.Ea);a.fkb=c;return a};F.MY=function $OR(a,c,d,f){var g=new QK(this.V,this.pA,this.xa);f=f===k?i:new RK(this.V,this.xa);return new c0a(this.V,this.Ea,a,g,f,c,d)};F.Ocb=D("pA");F.rdb=D("eUa");F.Qqa=function $RR(a){return new BK(this.V,a)};var tpb="Du";F.tNa=D(tpb);F.p7a=function $TR(a,c){return new BZa(this.V,this.Ea,a,c,this.xa,this.Du)};var aR="default";
+F.mdb=function $UR(){var a=this.Ea,c=this.Z[hq](Z7a),d=a.Ga(),f=k,g;if(c){c=c[Cc](wj);for(var j=0;j+1<c[u];j+=2){var n=c[j],s=Number(c[j+1]);if(n==d||n==aR&&!f){g=s;f=h}}}f||(g=gza(a)?5:20);return g};F.Wcb=D("LOc");H(VK,uh);var h0a=0;VK[w].Q8=0;VK[w].I8a=0;var l0a=new RegExp(Ty+"^ib"[mb](Ty,"\\^"));F=VK[w];F.D=function $WR(){VK.C.D[z](this);this.Q.D();this.Hh.D();this.nlb()};hk(F,function $XR(a){(this.Tl=a)||bA(f0a,this.nlb,0,this)});F.R8=function $YR(){this.YU()};F.YU=function $ZR(){g0a(this)&&this[r](TE)};F.bUb=function $_R(a,c){if(this.Ska==a){if(!this.pna)this.pna=new Hf;this.pna.set(c,1)}};
+F.wh=function $0R(a){if(this.Ska==a){if(Jz(this.Z,717)){dE(this.V).zF(sgb,a.R2b);dE(this.V).zF(tgb,a.S2b)}this.AZb=Zf();this.Ska=i;var c=k;if(!a.Vj())if(a.Zbd)h0a=Zf();else c=h;this.qa=0;c&&this.YU();this[r](TE)}};F.nlb=function $1R(){for(var a=this.Pc||!this.tD&&!this.Tl,c=this.bTc,d=c.Sb(),f=0;f<d[u];f++){var g=d[f],j=c.J(g);if(a||!this.phc.Xb(g)){c[Pb](g);j.bB()}}if(!a)if(d=this.Aa.za(qI)){a=rI(d,this.Ea);d=this.phc.Sb();for(f=0;f<d[u];f++){g=d[f];if(!c.Xb(g)){j=a.za(g);j.Iz();c.set(g,j)}}}};
+F.Adb=function $2R(){return[this.Q8,this.qa]};F.zdb=D(Yj);F.Bdb=D("fzb");_B_prog(77)}catch(e){_B_err(e)}
+
+try{var n0a;var X0a=h;H(Y0a,Iw);var bR="compose",upb="Mail";Y0a[w].tb=function $5R(){jA(this.Db,TE)||lA(this.Db,TE,IB);jA(this.Db,OP)||lA(this.Db,OP,OD);jA(this.Db,ZD)||lA(this.Db,ZD,JD);var a=fD(this.Db);gD(a,wE,TE);gD(a,YK,OP);gD(a,QO,ZD);hD(a,this,[wE,YK,QO]);iD(a,this,[Hl,Py,Fy,Jy,Z0a,Oy,a1a,ul,bR,ce,kz,sz,cz,iz,fz,pz,jza,Yy,Zy,ez,ZK,aL]);a=hF(this.Db);PIa(a,new MIa(Xz,upb,{view:wE,search:G7a},[wE,YK,QO,SO,eab,dJ,xE],i))};
+Y0a[w].Gaa=function $6R(a){var c=[];switch(a[Wq]){case wE:c[p](a[Pc].Xs());a[Xp]>0&&c[p](oy+(a[Xp]+1));break;case YK:var d=a.Zo;c[p](a[Pc].Xs());c[p](d);break;case QO:c[p](bR);break}return c};Y0a[w].aca=function $7R(a,c){var d={};if(a==bR){Gp(d,QO);return d}Ip(d,b1a(a,c));if(d[Pc]==i)return i;if(c[u]==0)Gp(d,wE);else{a=c[db]();if(a[xb](0)==oy){Gp(d,wE);bha(d,da(a[nc](1),10)-1)}else{Gp(d,YK);d.Zo=a}}return d};H(dL,xJ);yx(AK,dL);F=dL[w];F.Toa=h;F.L=function $8R(){dL.C.L[z](this);q1a(this);this.H3.D();this.Hh.D();this.Uq.D();this.aa.D();this.eJ.D()};F.Bb=D(NO);F.Ut=D("az");F.Jw=D(xQ);F.Zn=D("Xi");F.Jw=function $aS(){return h1a(this.B(),this.Ea)};
+F.Jc=function $cS(){this.wC();this.xa.Ydd(this.H(),this.wKc);var a=new eYa;a.qpa=G(this.qpa,this);a.xHa=G(this.f4a,this);a.idb=G(this.dNa,this);a.gub=G(this.ldb,this);a.kac=G(this.Ded,this);a.dN=G(this.dN,this);a.Rcc=G(this.vid,this);a.eta=G(this.eta,this);a.m6b=G(this.M6c,this);a.J3b=G(this.TYc,this);a.PTa=G(this.E6c,this);a.i6b=G(this.c6c,this);a.brb=G(this.crb,this);a.b7b=G(this.y9c,this);a.XTa=G(this.drb,this);a.Z6b=G(this.w9c,this);a.a7b=G(this.x9c,this);a.TFb=G(this.isc,this);a.mC=G(this.mC,
+this);a.UKb=G(this.ozc,this);this.xa.cdc(a);this.Z0b();(a=this.xa.CFc())&&Pw(this.H(),a,aB,this.I3b);var c=Xy(this.Ea);a=this.Aa;if(c){var d=Mf(c,Ty)?cJ:ZI;c=this.co.Je()+Md+d+Md+Qf(c);this.H().w(a.Ya(),c,this.tpb)}c=this.co.Je()+HXa;this.H().w(a.Ya(),c,this.I_c);this.Kk().w(FH(this.B()),ey,this.jYc)};F.Z0b=B();F.I_c=function $eS(a){for(var c=0;c<a.dG[u];c++){var d=a.dG[c];if(a.aJ[d]&8){var f=(d=this.Aa.cj(d))?d.J():i;f&&fL(this,function(g){g.Zh(f[pq]())&&this.xa.uz(g.Hc(),4)})}}};
+F.Bo=function $fS(){this.xa.Wvc();q1a(this)};F.ln=function $gS(a){var c=dE(this.B()),d=Xy(this.Ea);d?c.jj(hjb,d[mb](/\//g,Qd)):c.pb(Nfb);c=Rz(this.B());if(Jz(c,1105)){if(a=a?a.Ica:i)this.eCb=a;a&&a.md()==QO||this.xa.ola()}else this.xa.ola();this.xa.Bh||dE(this.B()).pb(Qfb)};
+F.Wb=function $hS(){this.Tl=h;this.pA[Lk](h);var a=k,c=k;c|=l1a(this);a|=j1a(this);a|=k1a(this);var d=Rz(this.B());if(a)x1a(this);else if(c)this.xa.cp();else Jz(d,1105)&&this.eCb&&this.eCb.md()==QO||this.xa.ola();this.xa.Wb();this.Uq[Lk](h);this.Uq.YU();n1a(this);this.eCb=i;this.aa.Wb()};F.jYc=function $iS(a){var c=Rz(this.B());Jz(c,1105)&&a.rnb==this&&Je[xc](G(this.xa.ZVa,this.xa,Ph),0)};F.X_a=function $jS(){if(this.SWa){vC(this.xB,this.SWa);this.SWa=i}else vC(this.xB,0);this.xa.hB()};
+F.Df=function $kS(){this.Tl=k;this.pA[Lk](k);this.SWa=uDa(this.xB);this.xa.Df();this.Uq[Lk](k);this.Ch&&this.Ch.gj.om.Yb();this.Co&&this.Co.gj.om.Yb();this.aa.Df()};F.uW=function $lS(){this.xa.uW();this.aa.uW()};
+F.wC=function $mS(){var a=this.B(),c=[];this.IRa(a);this.Ch&&c[p](this.Ch);this.k1b(c,a);this.Eha=this.Nda.p7a(this,this);this.Eha.qc(k);c[p](this.Eha);for(var d=this.DO(),f=0;f<d[u];f++)c[p](d[f]);this.B1=new eE(a);this.B1.qc(k);c[p](this.B1);c[p](this.xa);d=this.i6();for(f=0;f<d[u];f++)c[p](d[f]);this.tlb(a);this.Co&&c[p](this.Co);this.H().w(this,LQ,this.eob);this.aa.A5a(a,this.Ea,c);eF(this.ia,c)};F.DO=function $nS(){return o1a(this,this.aa.DO())};F.i6=function $oS(){return o1a(this,this.aa.i6())};
+var vpb="A1";F.IRa=function $pS(a){this.Ch=this.aa.MY(this.Nda,this.HRa(),vpb,h);this.Ch.gj.om.kp=wE;this.aa.agb(a,this.Ch)};var wpb="AY";F.tlb=function $qS(){this.Co=this.aa.MY(this.Nda,this.HRa(),wpb,k);this.Co.gj.om.kp=wE};F.Kk=function $rS(){return this.H()};F.k1b=B();F.Dvc=function $tS(){if(!this.Tl&&!this.tD)return k;if(this.xa.Bh)return k;if(this.xa.NS&&this.Dz.TZ(Zf())<6E4)return k;if(this.aa.Pjb())return k;return h};F.rZa=function $uS(){this.xa.luc(FYa(this.H3,this.H3.Dz.TZ(Zf()+2E3))/1E3)};
+F.HRa=function $vS(){var a=Mx().Gn(16,this.B()),c=this.Ea;if(c.Ga()==ul)a.b2=k;else{a.KW(c,wE);TB(a,20,h)}this.aa.YNa(a);this.H().w(a,WB,this.Vm);return a};F.eob=function $wS(a){this.qBb(a[y])};
+F.qBb=function $xS(a){if(!((!this.Ch||a!=this.Ch.gj.om)&&(!this.Co||a!=this.Co.gj.om))){var c=this.Du.Jib(),d=[];fL(this,function(n){this[uk].Vo(n.vf())&&d[p](n)});var f=new D1a;f.i_a=d;f.Lp=c;this.eJ.eca(a,this.Ea.Ga(),f);if(c)TXa(a);else{var g={},j=0;fL(this,function(n){if(this[uk].Vo(n.vf())){n=n.Jo();for(var s=0;s<n[u];s++)g[n[s]]=(g[n[s]]||0)+1;j++}});SXa(a,g,j)}QWa(a.ac(),c)}};F.DRb=function $yS(){var a=[];this.Ch&&a[p](this.Ch.gj);this.Co&&a[p](this.Co.gj);return a};F.ASb=D("Ch");
+F.Vm=function $AS(a){this.nk(a[jr],a[jb])};
+var xpb="No conversations selected.",ypb="^unsub",zpb="Only the first 25 conversations of your ",Apb=" selected conversations will be used in filter creation. Would you like to continue?",Bpb="You are about to move the entire conversation to the Trash. Are you sure you want to trash the entire conversation containing your sent message?",Cpb="You are about to move ",Dpb=" entire conversations to the trash. Are you sure you want to trash the entire conversations containing your sent messages?",Epb=
+"Moving conversations from All Mail to the Trash will remove them from all views, including labels and search results. This is because in ",Fpb=", a conversation can be displayed in a variety of views, but there is only one copy. Are you sure you want to move the only copy to the Trash?";
+F.nk=function $BS(a,c){q1a(this);if(a==134)this.aa.Qvb(c);else{var d=this.Du.hua(a);if(a!=20&&a!=122&&d==0)this.Rh.Ad(new Zz(xpb));else{var f=this.B(),g,j=k,n;if(JCa(this.eJ,a)){n=this.eJ.nk(a,this,1,this.Ea.Ga());g=n[jr];if(n.N_a){var s=k,v=[];if(Jz(this.Z,811)){fL(this,function(M){if(this[uk].Vo(M.vf()))if(M.Zh(ypb)){of(v,M.apd||[]);s=h}});rf(v)}if(s){a=new cPa(this.B(),v);this.H().w(a,BC,G(this.Sqb,this,a,Zf(),n));a.ra(h);return}else g=new n.PX(f,k,1)}a==95&&fL(this,function(M){g.Bdc(M.sH(),M.vf())})}else switch(a){case 98:QF(this,
+Ocb);g=new hWa(f,1);break;case 12:QF(this,ubb);g=new cR(f,c,1);break;case 13:QF(this,vbb);g=new MB(f,c,1);break;case 20:QF(this,Ibb);this.xa.cja(k);j=h;this.xa.eXb();dE(f).pb(Ofb);break;case 122:this.rZa();break;case 16:QF(this,Jbb);g=new fWa(f);break;case 17:QF(this,Ebb);g=new dTa(f,1);break;case 45:QF(this,Pbb);g=new iWa(f,1);break;case 46:QF(this,Qbb);g=new gWa(f,1);break;case 14:var C=KC(f);if(c&&!PC(C,c)){c=Pf(c);QF(this,Fbb);g=new cR(f,c,1)}else QC(C,WJ,I,NXa,G(this.s3,this),iA(this.B()));break;
+case 76:QF(this,wbb);g=(C=Xy(this.Bb()))?new dR(f,C,c,1):new cR(f,c,1);break;case 77:QF(this,xbb);g=new BJ(f,c[0],c[1],1);break;default:g=this.aa.jdb(f,a,c)}if(g&&a==64&&d>25)this.TJ(zpb+(d+Apb))||(g=i);else{c=this.Du.Kib(a);if(g&&c)this.TJ(w1a(this,a))||(g=i)}if(g&&a==10){if(this.Ea.Ga()==pz&&!this.TJ(d==1?Bpb:Cpb+(d+Dpb)))g=i;if(this.Ea.Ga()==cz&&!this.TJ(Epb+(Ii+Fpb)))g=i}this.OLa(g,j,n)}}};
+F.OLa=function $CS(a,c,d){var f=this.xa.NS;this.xa.cja(k);d=d&&d.BWa;if(a){a.Ii(this.Ea);a.lB(this);p1a(this,a,d);a:if(a.Lp())a.IFa=h;else{var g=a.mg,j=this.Ea.Ga();d=this.Nda.Wcb();if(g==13){g=a.Dd();if(!d.WPc(g))break a}else if(!(g==4&&j==sz))if(!(g==8&&j==Zy))if(g!=9&&g!=18&&g!=98&&g!=10&&g!=21&&g!=17&&g!=76&&g!=77&&g!=110&&g!=111)break a;d.ZIc(a)}a.Ie(this);a.lB(this);this.Ml=a;kF(this.Mb,a);a[Mb]()}c&&this.xa.ZVa(kD);!this.xa.NS&&f&&this.xa.cja(h);this.qca()};
+F.Sqb=function $DS(a,c,d,f){this.H().hb(a,BC);aF(this.B()).VX(Zf()-c);if(f.key==dx)(d=PF(this))&&eLa(d);else{a=f.key==Cz;this.OLa(new d.PX(this.B(),a,1),k,d)}};F.hua=function $ES(a){return this.Du.hua(a)};F.xMa=function $FS(a){return{ag:this.Og,NKb:XK(this)[u],ZF:this.Du.hua(a),LQ:this.Ea[pq](),Ij:this.X(KK.jFa)}};F.qpa=function $GS(){var a=this.xa.PGc();this.Ch&&this.Ch[mr](this.Ea,a);this.Co&&this.Co[mr](this.Ea,I)};
+F.f4a=function $HS(){l1a(this);k1a(this);if(this.Xi.J()){var a=this.Xi.J().nj,c=dE(this.B()),d=this.Ea.Ga();c.jj(Rfb,d+Qd+a)}};F.dN=function $IS(){this.Uq.YU()};F.vid=function $JS(){if(!this.xa.EGa)return k;var a=this.xa.ft;if(a==101){this.xa.Mn(this.CNa(this.vZa,h));return h}else if(a==102){(a=this.xa.vy().J(this.Ald))?this.xa.Mn(ff(this.xa.Om,a)):this.xa.Mn(this.CNa(this.vZa,h));return h}return k};F.eta=function $KS(a){return this.CNa(XK(this)[a].TCa,k)};F.M6c=function $LS(a){this.aa.zD(a)};
+F.TYc=function $MS(){FK(this.Eha);for(var a=this.Du.Jib(),c=this.DRb(),d=0;d<c[u];d++)QWa(c[d],a)};F.E6c=function $NS(a){Q(this.B1.b(),a.Xbd?M0a():a.kia()?O0a():K0a({Rnd:a.Kcd}));this.B1.qc(h);this.B1.qe(Wx);this.oEd=h};F.y9c=function $OS(a){EYa(this.H3);this.aa.C0a(a)};F.drb=function $PS(){var a=this.H3,c=Zf();a.xya=c+FYa(a,a.Dz.TZ(c));GYa(a,c)};F.w9c=function $QS(){this.Uq.YU();this.Ch&&this.Ch.gj.qja(this.xa.Ya());this.Co&&this.Co.gj.qja(this.xa.Ya())};
+F.x9c=function $RS(a){var c=this.xl.Xv;if(Ay(this.lb,DM)&&!fza(this.Ea)&&!a.Gib)BE(c,web,c.fjb?jHa:kHa)};F.isc=function $SS(){this[r](TE);this.Uq.YU()};F.ozc=function $TS(){var a=new KRa;if(Jz(this.Z,1130)||Jz(this.Z,1037))a.Fwb(!!this.tD);return a};F.crb=function $US(){this.qca()};F.c6c=function $VS(){var a=this.xa.Th;if(this.xa.ft==1&&a>=0&&a<XK(this)[u]){this.xa.oma(101);this.vZa=this.xa.Zsa().TCa}a=this.Uq;a.pna&&a.pna[bc]();this.LAb=k;this.B1.qc(k)};F.dNa=E(9);
+F.Ded=function $XS(){var a=this.xa.xeb(),c=a>0,d=this.o1b();if((this.LAb||!c)&&!d)return I;var f=[];if(c&&!this.LAb){a={yod:a,Ojc:this.X(KK.QEb),bic:this.X(KK.CDb)};this.aa.Wmb(a);f[p](z0a(a));this.LAb=h}d&&this.W0b(f);return f[kd](I)};F.o1b=E(k);F.W0b=B();
+var Gpb="No new mail! There's always ",Hpb="No starred messages. Stars let you give messages a special status to make them easier to find. To star a message, click on the light blue star beside any message or conversation.",Ipb="No chat messages.",Jpb="Your chat history will appear here if you choose to save your chats. You can change this in ",Kpb='" class="x0">Settings</span>.',Lpb="No sent messages! ",Mpb='" class="x0">Send</span> one now!',Npb="You don't have any saved drafts.<br>Saving a draft allows you to keep a message you aren't ready to send yet.",
+Opb="You don't have any mail! Our servers are feeling unloved.",Ppb="Hooray, no spam here!",Qpb="No conversations in the Trash. Who needs to delete when you have over 7000 MB of storage?!",Rpb="There are no conversations with this label.",Spb="in:anywhere",Tpb="No messages matched your search. Try using ",Upb='" class="x0">search options</span> to define a new query.',Vpb="ast",Wpb="No messages matched your search.",Xpb="No existing messages match your criteria.";
+F.ldb=function $_S(){var a=this.p1b();if(a)return a;switch(this.Ea.Ga()){case kz:case ZK:case aL:if(this.Z[hq](z8a))return I;a=this.Z[hq](TN);a={tkd:a==Vz,gF:a};var c=new U;a.tkd?c[R]('No new mail! Want to read updates from your favorite sites? Try <a class="xZ" target="_blank" href="http://www.google.com/reader/?source=gmailnonewmail">Google Reader</a>'):c[R](Gpb+('<a class="xZ" target="_blank" href="http://news.google.com/?hl='+a.gF+"\">Google News</a> if you're looking for something to read."));
+a=c[t]();return a;case sz:a=new U;a[R](Hpb);a=a[t]();return a;case fz:a={Ij:this.X(KK.kFa),aQc:bx()};a=a;c=new U;a.aQc?c[R](Ipb):c[R](Jpb+(HK+a.Ij+Kpb));a=c[t]();return a;case pz:a={Ij:this.X(KK.sEb)};a=a;c=new U;c[R](Lpb+(HK+a.Ij+Mpb));a=c[t]();return a;case iz:a=new U;a[R](Npb);a=a[t]();return a;case cz:a=new U;a[R](Opb);a=a[t]();return a;case Yy:a=new U;a[R](Ppb);a=a[t]();return a;case Zy:a=new U;a[R](Qpb);a=a[t]();return a;case Py:a=new U;a[R](Rpb);a=a[t]();return a;case Jy:a=this.Ea.Qe();if(Xf(a,
+Spb)){a={Ij:this.X(KK.rEb)};a=a;c=new U;c[R](Tpb+(HK+a.Ij+Upb));a=c[t]();return a}else{a={Ij:this.X(KK.j1a)};return C0a(a)}case Oy:if(Uya(this.Ea)!=Vpb){a={Ij:this.X(KK.j1a)};return C0a(a)}else{a=new U;a[R](Wpb);a=a[t]();return a}case ul:a=new U;a[R](Xpb);a=a[t]();return a;default:return I}};F.p1b=E(i);F.md=function $1S(){return wE};F.ej=function $2S(a){if(this.Ml)a[p](this.Ml);else this.xa.Bh&&a[p](this.xa.Bh)};
+F.qca=function $3S(){this[r](NO);if(this.skb&&!(this.Ml||this.xa.Bh)){var a=this.skb;this.skb=i;if(a.Lp())jYa(this[uk]);else{a=a.RDa;for(var c={},d=0;d<a[u];d++)c[a[d]]=1;fL(this,function(f){delete c[f.vf()]});a=xf(c);hYa(this[uk],a)}this.Qz(Zx)}};F.TO=function $4S(){var a=this.Ea[pq](),c=Xy(this.Ea);if(c){var d=KC(this.B());if((c=NC(d,c))&&c.rt>0)a+=xl+c.rt+xh}return a};F.yK=function $5S(){var a=this.Ea;return new CH(a.FL(),a.Qb())};F.tpb=function $6S(){this[r](new TF(this,tQ,this))};F.EIb=function $7S(){return!this.tD};
+Bp(F,function $8S(){q1a(this);this.xa[Sq]();n1a(this);this.aa[Sq]()});
+F.Qh=function $9S(a,c){if(!(!this.B().eN()||this.aa.Qh(a,c)||this.aa.pQa())){var d=i,f=i,g,j=i;switch(a){case R4a:f=this.Ea.Ga();if(f==kz){f=13;g=TI}else if(f==sz)f=4;else if(f==Py){f=13;g=this.Ea.Pt()}else f=7;j=Lgb;break;case o5a:f=7;j=Pgb;break;case s5a:f=95;j=Ogb;break;case hM:(a=gL(this,this.xa.Th))&&this.aP(a);break;case fM:this.yAa(h);break;case gM:this.Tja(h);break;case KG:this.Qz(Zx);a=y1a(this,this.xa.Th);kYa(this[uk],a);break;case lM:V0a(this.eUa,c[dd],void 0);j=c[Sb]==13?Kgb:Rgb;break;
+case iM:if(this.Du.XG()!=dK&&JCa(this.eJ,21,this.Ea.Ga()))f=21;break;case jM:f=9;j=Tgb;break;case kM:f=10;j=Ugb;break;case eM:f=20;break;case b5a:d=NQ;break;case c5a:d=Yob;break;case d5a:d=mpb;break;case e5a:d=opb;break;case f5a:d=ppb;break;case g5a:d=rpb;break;case p5a:this.Ch&&this.Ch.gj.s_a();break;case q5a:this.Ch&&this.Ch.gj.q_a();break;case tM:this.Ch&&this.Ch.gj.r_a();break;case l5a:f=1;break;case m5a:f=2;break}f&&this.nk(f,g);d&&this.Du.zD(d);j&&dE(this.B()).pb(j)}};
+F.mC=function $$S(a,c){this.pA.mC(a,c)};F.lPa=function $aT(a,c,d,f){if(a)this.xa.oma(a);else if(c){this.xa.oma(102);this.Ald=c;this.vZa=d;f&&this.xa.ndc(f)}else if(d){this.xa.oma(101);this.vZa=d;f&&this.xa.ndc(f)}else this.xa.oma(2)};F.qma=function $bT(a){this.aa.qma(a)};F.kJ=function $cT(){this.jb[bq]({view:wE,search:this.Ea,gkb:h,page:this.Ut()})};F.Tja=function $dT(a){this.vya.Tja(a)};F.yAa=function $eT(a){this.vya.yAa(a)};F.wKc=function $fT(){if(this.xa.xwa()){this.t1b();FK(this.Eha)}};
+F.t1b=B();F.AH=function $hT(a){a==this.Ml&&z1a(this)};F.CNa=function $iT(a,c){var d=this.xa.Om,f=d[u];if(f==0)return-1;if(!Ue(a))return 0;var g,j;for(g=0;g<f;g++){j=B1a(this,d[g].TCa,a);if(j<=0)break}if(j==0&&c||g==0)return g;if(g>=f)return f-1;return A1a(this,d,g-1,g)};
+F.I3b=function $jT(a){a=a[y].id;var c=KK;if(a==this.X(c.j1a))this[r](new TF(this,cy));else if(a==this.X(c.rEb))this[r](new TF(this,Od));else if(a==this.X(c.kFa))this.jb[bq]({view:dJ,fk:pJ});else if(a==this.X(c.sEb))this.jb[bq]({view:QO});else if(a==this.X(c.QEb)){a=new Sh;Iy(this.Ea,a);a.ka(Zya,1);a=aza(Sy,a.Of());this.jb[bq]({view:wE,search:a})}else a==this.X(c.CDb)&&this.jb[bq]({view:wE,search:J7a})};F.s3=function $kT(a){this.nk(14,a)};
+F.aP=function $lT(a){var c=eL(this).J(a);if(!c)e(Error(".162`"+a));if(!c.Mm())if(!this.aa.aP(a,c)){var d=this.B();if(c.Uf()){d=new yCa(d,1);c=c.vf()}else{d=new vB(d,1);c=c.Qy}d.Ii(this.Ea);uB(d,a,c);d.bh=h;d[Mb]()}};F.opa=function $mT(){this.aa.opa();var a=this.xa.Bh;if(a&&a.QPc){this.xa.yib(a);Q(this.B1.b(),M0a())}};F.YRb=D(NO);F.DIb=function $oT(){if(this.xa.Bh)return k;if(this.Ml)return k;if(this.aa.Osb())return k;return h};
+F.Adb=function $pT(){var a=this.Aa.za(qI),c=0;if(a){a=rI(a,this.Ea);for(var d=eL(this).Sb(),f=0;f<d[u];f++)a.za(d[f]).Fi()&&c++}var g=f=d=a=0;if(this.xa instanceof bK){g=this.xa.wr();a=g.Uz;d=g.Eo;f=g.NO();g=ERa(g)}var j=this.Uq.Adb();return{eBd:a,dBd:d,f2:f,zBd:g,hXc:c,QCd:j[0],DDd:j[1]}};F.zdb=function $qT(){return this.Uq.zdb()};F.Bdb=function $rT(){return this.Uq.Bdb()};F.zD=function $sT(a){this.xa.zD(a)};F.Qz=function $tT(a){this.Du.Qz(a)};F.uNa=function $uT(){return this.xa.uNa()};F.DI=function $vT(a){this.xa.DI(a)};
+F.TJ=function $wT(a){var c=Zf();a=this.fc[Zp](a);aF(this.B()).VX(Zf()-c);return a};var KK={ezd:J4a,jFa:B4a,u1a:"etl",nDb:"ets",j1a:"bsl",fEb:"qst",eEb:"qsb-",rEb:"sol",kFa:"csetl",sEb:"sendl",QEb:"vttl",CDb:DE,oEb:"rtnsl",Tsd:"chv"};_B_prog(79)}catch(e){_B_err(e)}
+
+try{hL[w].Ef=function $xT(a){this[dr](a)};hL[w].info=B();hL[w].K0a=B();hL[w].TW=B();F=kL[w];F.rE=i;F.hR=k;F.koa=i;F.qCb=i;F.AWa=i;F.Xd=i;F.Qn=i;F.BF=i;F.JL=i;F.Tx=i;F.hFa=0;F.EM=i;F.Xna=i;F.wk=i;F.Tw=-1;F.fcc=h;F.xda=k;var z2a={},y2a={};F=kL[w];F.R1=Ge("rE");naa(F,Ge("wo"));var Ypb="Called back with an unexpected xmlhttp",Zpb="Failed call to OnXmlHttpReadyStateChanged_",aqb="ResponseText: ",bqb="No response text";F.Bkc=function $DT(a){a=a[y];try{a==this.Tx?o2a(this):this.cd.K0a(Ypb)}catch(c){this.cd.Ef(Zpb);this.Tx&&this.Tx.dj()?jL(this.cd,c,aqb+this.Tx.dj()):jL(this.cd,c,bqb)}finally{}};
+F.Dbd=function $ET(){var a=this.Tx.ts(),c=this.Tx.dj();if(this.hFa<c[u]){p2a(this);q2a(this,a,c);this.hR&&a!=4&&lL(this)}};F.czb=function $FT(){this.XUa[qc]();this.Q.wb()};F.G8c=function $GT(a){nL(G(this.F8c,this,a),0)};var cqb="TRIDENT TEXT (";F.F8c=function $HT(a){if(!this.xda){var c=this.cd;c[dr](cqb+this.tI+F1a+G1a(c,a));p2a(this);s2a(this,a);lL(this)}};F.L6b=function $IT(a){nL(G(this.E8c,this,a),0)};var dqb="failure";
+F.E8c=function $JT(a){if(!this.xda){this.cd[dr](cqb+this.tI+F1a+a?Mh:dqb);p2a(this);this.tJ();this.hR=a;this.ec.uL(this)}};F.tf=function $KT(){this.xda=h;p2a(this);this.tJ()};var eqb="WatchDog timer called too early";F.F9c=function $LT(){this.koa=i;var a=Zf();if(a-this.qCb>=0)this.Zua();else{this.cd.K0a(eqb);L2a(this,this.qCb-a)}};var fqb="Received watchdog timeout even though request loaded successfully",gqb="TIMEOUT: ";
+F.Zua=function $MT(){this.hR&&this.cd.TW(fqb);this.cd[dr](gqb+this.BF);this.tJ();this.wk=2;mL(18);t2a(this)};F.tJ=function $NT(){this.czb();if(this.Tx){var a=this.Tx;this.Tx=i;nh(a,Lh,this.Bkc,k,this);a[wc]()}if(this.EM)this.EM=i};var hqb="hR";F.rua=D(hqb);F.Kga=D(aOa);F.hH=D("Tw");F.Kw=D("Lx");F=N2a[w];F.rE=i;F.Lc=i;F.OVa=k;F.pbb=i;F.Mia=i;F.Vf=i;F.qa=i;F.Tw=-1;F.o7=i;F.r4a=i;F.R1=Ge("rE");var iqb="MODE";F.bs=function $TT(a){this.Vf=a;a=n3a(this.ec,this.Vf);mL(3);gx(a,iqb,dQ);this.Lc=new kL(this,this.cd,void 0,void 0,void 0);this.Lc.R1(this.rE);c2a(this.Lc,a,k,h);this.qa=0};var jqb="Test Connection Blocked";F.Cwc=function $UT(a){if(a){this.qa=2;R2a(this)}else{mL(4);a=this.ec;a.cd.Ef(jqb);a.Tw=a.j4.hH();pL(a,9)}};La(F,function $VT(){if(this.Lc){this.Lc.tf();this.Lc=i}this.Tw=-1});F.G_=E(k);
+var kqb="TestConnection: Got data for stage 1",lqb="TestConnection: Null responseText",mqb="11111";F.h6b=function $XT(a,c){this.Tw=a.hH();if(this.qa==0){this.cd.Ef(kqb);if(c){try{var d=ix(c)}catch(f){jL(this.cd,f);p3a(this.ec,this,4);return}this.o7=this.ec.dGb?d[0]:i;this.r4a=d[1]}else{this.cd.Ef(lqb);p3a(this.ec,this,4)}}else if(this.qa==2)if(this.OVa){mL(7);this.Mia=Zf()}else if(c==mqb){mL(6);this.OVa=h;this.pbb=Zf()}else{mL(8);this.pbb=this.Mia=Zf();this.OVa=k}};
+var nqb="TestConnection: request complete for initial check",oqb="/mail/images/cleardot.gif",pqb="TestConnection: request complete for stage 2",qqb="Test connection succeeded; using streaming connection",rqb="Test connection failed; not using streaming",sqb="TestConnection: request failed, in state ";
+F.uL=function $YT(){this.Tw=this.Lc.hH();if(this.Lc.rua())if(this.qa==0){this.cd.Ef(nqb);if(this.r4a){this.qa=1;var a=s3a(this.ec,this.r4a,oqb);bi(a);P1a(a[t](),5E3,G(this.Cwc,this),3,2E3)}else{this.qa=2;R2a(this)}}else{if(this.qa==2){this.cd.Ef(pqb);a=k;if(a=L?this.Mia-this.pbb<200?k:h:this.OVa){this.cd.Ef(qqb);mL(12);m3a(this.ec,this,h)}else{this.cd.Ef(rqb);mL(11);m3a(this.ec,this,k)}}}else{this.cd.Ef(sqb+this.qa);if(this.qa==0)mL(9);else this.qa==2&&mL(10);p3a(this.ec,this,this.Lc.Kga())}};
+F.hH=D("Tw");F.Eb=function $_T(){return this.ec.Eb()};F=T2a[w];F.rE=i;F.ssa=i;F.Bw=i;F.FD=i;F.Vf=i;F.cMa=i;F.lHb=i;F.o7=i;F.dGb=h;F.CSa=0;F.ELa=k;F.na=i;F.jK=i;F.fY=i;F.j4=i;F.cjc=i;F.Dsc=h;F.MQa=-1;F.Tw=-1;var qL=new uh;H(V2a,N);H(X2a,N);F=T2a[w];F.PQ=Ge(he);var tqb="connect()",uqb="connectTest_()";F.bs=function $1T(a,c,d,f,g){this.cd.Ef(tqb);mL(0);this.Vf=c;this.ssa=d||{};if(f&&Ke(g)){this.ssa.OSID=f;this.ssa.OAID=g}this.cd.Ef(uqb);this.j4=new N2a(this,this.cd);this.j4.R1(this.rE);this.j4.bs(a)};var vqb="disconnect()",wqb="terminate";
+F.Qea=function $2T(){this.cd.Ef(vqb);Y2a(this);if(this.qa==3){var a=this.CSa++,c=this.cMa.vc();c.ka(b3a,this.Lx);c.ka(c3a,a);c.ka(P2a,wqb);g3a(this,c);a=new kL(this,this.cd,this.Lx,a,void 0);a.Xd=2;a.Qn=bi(c.vc());(new Image).src=a.Qn;a.AWa=Zf();lL(a);this.sTa()}};F.Kw=D("Lx");F.R1=Ge("rE");F.H=D(KP);F.oM=Ge(KP);var xqb="Already have 1000 queued maps upon queueing ";F.Hg=function $7T(a){if(this.qa==0)e(Error(".164"));this.fQ[u]==1E3&&this.cd.TW(xqb+zh(a));this.fQ[p](a);if(this.qa==2||this.qa==3)a3a(this)};
+var yqb="setFailFast: ",zqb="Retry count ",Aqb=" > new maxRetries ",Bqb=". Fail immediately!";F.Gwb=function $8T(a){this.ELa=a;this.cd[dr](yqb+a);if((this.Bw||this.jK)&&this.K5>(this.ELa?0:2)){this.cd[dr](zqb+this.K5+Aqb+(this.ELa?0:2)+Bqb);if(this.Bw){this.Bw.tf();this.uL(this.Bw)}else{Je[gb](this.jK);this.jK=i;pL(this,2)}}};F.G_=function $9T(){return this.qa==0};F.xc=D(Yj);F.hH=D("Tw");
+var Cqb="startForwardChannel_",Dqb="Not supposed to retry the open",Eqb="startForwardChannel_ returned: nothing to send",Fqb="startForwardChannel_ returned: connection already in progress",Gqb="startForwardChannel_ finished, sent request";F.v6b=function $bU(a){this.jK=i;this.cd.Ef(Cqb);if(this.qa==1)if(a)this.cd.TW(Dqb);else{this.R0();this.qa=2}else if(this.qa==3)if(a)e3a(this,a);else if(this.fQ[u]==0)this.cd.Ef(Eqb);else if(this.Bw)this.cd.Ef(Fqb);else{e3a(this);this.cd.Ef(Gqb)}};
+var Hqb="open_()",Iqb="CVER";F.R0=function $cU(){this.cd.Ef(Hqb);this.CSa=l[rb](l[Tc]()*1E5);var a=this.CSa++,c=new kL(this,this.cd,I,a,void 0);c.R1(this.rE);var d=f3a(this),f=this.cMa.vc();f.ka(c3a,a);this.vS&&f.ka(Iqb,this.vS);g3a(this,f);c.Xd=1;c.Qn=bi(f.vc());c.JL=d;c.A8a=h;d2a(c);this.Bw=c};var Jqb="Creating new HttpRequest",Kqb="rpc",Lqb="New Request created";
+F.u6b=function $dU(){this.fY=i;this.cd.Ef(Jqb);this.FD=new kL(this,this.cd,this.Lx,Kqb,this.kHb);this.FD.R1(this.rE);var a=this.lHb.vc();a.ka(c3a,Kqb);a.ka(b3a,this.Lx);a.ka(AUa,this.cjc?Ah:Hj);a.ka(d3a,this.MQa);g3a(this,a);if(L){a.ka(P2a,oL);K2a(this.FD,a,Boolean(this.o7))}else{a.ka(P2a,Q2a);c2a(this.FD,a,h)}this.cd.Ef(Lqb)};
+F.h6b=function $eU(a,c){if(!(this.qa==0||this.FD!=a&&this.Bw!=a)){this.Tw=a.hH();if(this.Bw==a&&this.qa==3){if(c!=I1a){this.cd.Ef("Bad data returned - missing/invald magic cookie");pL(this,11)}}else im(c)||this.mpb(ix(c))}};var Mqb="Request complete",Nqb="Not retrying due to error type",Oqb="Maybe retrying, last error: ",Pqb="Request already in progress",Qqb="Going to retry POST",Rqb="Going to retry GET",Sqb="Exceeded max number of retries",Tqb="Error: HTTP request failed";
+F.uL=function $fU(a){this.cd.Ef(Mqb);var c;if(this.FD==a){this.FD=i;c=2}else if(this.Bw==a){this.Bw=i;c=1}else return;this.Tw=a.hH();if(this.qa!=0)if(a.rua())if(c==1){var d=Zf()-a.AWa;qL[r](new X2a(qL,a.JL?a.JL[u]:0,d,this.K5));a3a(this);Ia(this.Hka,0)}else j3a(this);else{d=a.Kga();if(d==3||d==0&&this.Tw>0)this.cd.Ef(Nqb);else{this.cd.Ef(Oqb+b2a(d,this.Tw));if(c==1){if(this.Bw||this.jK){this.cd.TW(Pqb);a=k}else if(this.qa==1||this.K5>=(this.ELa?0:2))a=k;else{this.cd.Ef(Qqb);this.jK=nL(G(this.v6b,
+this,a),this.rNa(this.K5));this.K5++;a=h}if(a)return}if(c==2){if(this.FD||this.fY){this.cd.TW(Pqb);a=k}else if(this.pHa>=3)a=k;else{this.cd.Ef(Rqb);this.kHb++;this.fY=nL(G(this.u6b,this),this.rNa(this.pHa));this.pHa++;a=h}if(a)return}this.cd.Ef(Sqb)}this.cd.Ef(Tqb);switch(d){case 1:pL(this,5);break;case 4:pL(this,10);break;case 3:pL(this,6);break;default:pL(this,2);break}}};var Uqb="Inactive channel";F.rNa=function $gU(a){var c=5E3+l[rb](l[Tc]()*1E4);if(!this.Eb()){this.cd.Ef(Uqb);c*=2}c*=a;return c};
+F.mpb=function $hU(a){for(var c=this.na&&this.na.uIa?[]:i,d=0;d<a[u];d++){var f=a[d];this.MQa=f[0];f=f[1];if(this.qa==2)if(f[0]==dx){this.Lx=f[1];this.o7=this.dGb?f[2]:i;this.qa=3;this.na&&this.na.bJb(this);this.lHb=S2a(this,this.o7,this.Vf);j3a(this)}else f[0]==Id&&pL(this,7);else if(this.qa==3){if(f[0]==Id){if(c&&c[u]){this.na.uIa(this,c);Ia(c,0)}pL(this,7)}else f[0]!=L1a&&c&&c[p](f);this.pHa=0}}c&&c[u]&&this.na.uIa(this,c)};F.XCc=function $iU(){if(!ef(arguments,this.qa))e(Error(".165`"+this.qa))};
+F.Xmd=function $jU(a){if(a){this.cd[dr]("Successfully pinged google.com");mL(2)}else{this.cd[dr]("Failed to ping google.com");mL(1)}};var Vqb="HttpChannel: error - ";F.J0=function $kU(a){this.cd.Ef(Vqb+a);this.qa=0;this.na&&this.na.C5a(this,a);this.sTa();Y2a(this)};var Wqb="Number of undelivered maps, pending: ",Xqb=", outgoing: ";
+F.sTa=function $lU(){this.qa=0;this.Tw=-1;if(this.na)if(this.Hka[u]==0&&this.fQ[u]==0)this.na.B5a(this);else{this.cd.Ef(Wqb+this.Hka[u]+Xqb+this.fQ[u]);var a=nf(this.Hka),c=nf(this.fQ);Ia(this.Hka,0);Ia(this.fQ,0);this.na.B5a(this,a,c)}};F.Eb=function $mU(){return this.na.Eb(this)};F=v3a[w];F.uIa=i;F.bJb=B();F.C5a=B();F.B5a=B();F.uQb=function $qU(){return{}};F.MRb=E(i);F.Eb=E(h);_B_prog(80)}catch(e){_B_err(e)}
+
+try{H(x3a,v3a);F=x3a[w];F.Sja=i;F.OQa=0;F.UOa=k;F.vUa=[];F.D=function $tU(){nh(this.Mw,yj,this.aNb,h,this);this.qa!=-1&&this.ec.Qea();this.qa=1;this.Xza[bc]();C3a(this);D3a(this);this.Mw.D()};F.xc=function $uU(){if(this.usa)return 4;return this.qa};F.Xn=D(aOa);F.w6=D("Sja");F.uIa=function $xU(a,c){if(a==this.ec){for(a=0;a<c[u];a++)this.Xza.MG(c[a]);this.b1()}};var Yqb=":26";
+F.b1=function $yU(){D3a(this);for(var a=Zf(),c=[];!this.Xza.nd();){var d=this.Xza.ly(),f=Zf(),g=d[0];if(!(d[u]<=0))if(this.qa==3&&d[0]==Ph)z3a(this,4);else if(this.qa==4)try{var j=this.Ze.rDa.J(d[0]);if(j&&Ve(d[1])){var n=d[1];j[r](new I3a(n));g+=Qd+n[0]}}catch(s){}d=g;g=Zf();c[p]([d+xj+(g-f)]);if(g-a>500)break}if(!this.Xza.nd())this.Prb=bA(Yqb,this.b1,0,this)};F.bJb=function $zU(a){if(a==this.ec){this.yla=5E3+l[Tc]()*2E4;z3a(this,3)}};
+F.C5a=function $AU(a,c){if(a==this.ec){this.usa=k;if(c==4)this.wk=1;else if(c==2)this.wk=2;else if(c==6){if(this.qa==4)if(!F3a(this,h))this.usa=h;this.wk=0;this.UOa=h}else if(c==8)this.wk=3;else if(c==7)this.wk=2;else if(c==9)this.wk=4;F3a(this,h);z3a(this,5)}};F.B5a=function $BU(a,c,d){if(a==this.ec)if(this.qa!=5&&this.qa!=6){this.usa=k;z3a(this,1);if(c||d)this.Ze[r](new K3a(c||i,d||i))}};F.uQb=function $CU(a){if(a!=this.ec)return{};a={};for(var c=0;c<this.vUa[u];c++)a=this.vUa[c].YFa(a);return a};
+F.MRb=function $DU(a){if(a!=this.ec)return i;if(this.qKb){a=new Sh(this.qKb);bi(a);return a}return i};F.Eb=E(h);var Zqb="test",arb="bind";F.fJa=function $FU(){C3a(this);if(!this.lS)e(Error(".167"));var a=this.lS+Zqb,c=this.lS+arb;if(this.qa!=-1){this.ec.xc()==3||Z2a(this.ec)!=0;var d=this.ec.Kw(),f=this.ec.MQa;this.ec=this.cea(this.vS);this.ec.bs(a,c,{},d,f)}else this.ec.bs(a,c,{});z3a(this,2)};F.mq=function $GU(){switch(this.xc()){case -1:case 2:case 3:case 4:return h;default:return Ue(this.BSa)}};
+F.Hg=function $HU(a,c){if(!this.mq())e(Error(".168`"+a[Zb]));c=c||1;if(Ue(a)){this.NAa.MG(a);this.NAa.Nb()>=5E3&&this.NAa.ly()}if(this.qa==4&&c==1)for(;!this.NAa.nd();)this.ec.Hg(this.NAa.ly())};F.cea=function $IU(a){a=this.XHb?this.XHb(a):new T2a(a);this.cd&&this.PQ(this.cd);a.oM(this);return a};F.Tac=function $JU(){this.Sja=i;if(this.qa==1||this.qa==5||this.qa==6){this.UOa=k;this.ec&&Z2a(this.ec)==0?this.fJa():A3a(this)}};F.aNb=function $KU(){if(!F3a(this,k))this.OQa=Zf()};
+F.mGa=function $LU(a){hf(this.vUa,a)};F.lWa=function $MU(a){jf(this.vUa,a)};F.PQ=function $NU(a){this.cd=a;if(this.ec)a?this.ec.PQ(a):this.ec.PQ(new hL)};H(G3a,uh);H(H3a,uh);H(I3a,N);H3a[w].Ga=D(Gd);H3a[w].mq=function $PU(){return this.Ze.mq()};H3a[w].Hg=function $QU(a,c){this.Ze.Hg(this,a,c)};H(B3a,N);H(K3a,N);F=G3a[w];F.L=function $RU(){G3a.C.L[z](this);this.av.D();for(var a=this.rDa.Oa(),c=0;c<a[u];c++)a[c].D();this.rDa[bc]()};F.By=function $SU(a){var c=this.rDa.J(a);if(!c){c=new H3a(this,a);this.rDa.set(a,c)}return c};F.mGa=function $TU(a){this.av.mGa(a)};F.lWa=function $UU(a){this.av.lWa(a)};F.bs=function $VU(){this.xc()==-1&&this.av.fJa()};
+F.Qea=function $WU(){this.av.ec.Qea()};F.Kw=function $XU(){return this.av.ec.Kw()};F.mq=function $YU(){return this.av.mq()};var brb="_sc";F.Hg=function $ZU(a,c,d){if(brb in c)e(Error(".169"));c._sc=a.Ga();this.av.Hg(c,d)};F.xc=function $_U(){return this.av.xc()};F.Xn=function $0U(){return this.av.Xn()};F.w6=function $1U(){return this.av.w6()};F.PQ=function $2U(a){this.av.PQ(a)};F.Gwb=function $3U(a){this.av.ec.Gwb(a)};F.hH=function $4U(){return this.av.ec.hH()};var crb=new CB(eI,PO),eR=new CB(eI,ke),fR=new CB(eI,he),gR=new CB(eI,glb);H(uL,xx);F=uL[w];F.Qs=E(k);F.Qs.ic=h;F.Tsb=B();F.Tsb.Ka=h;F.lJ=B();F.lJ.Ka=h;H(xL,kn);yx(uL,xL);F=xL[w];F.hZb=0;F.B=D(JF);F.a6c=function $9U(a){a.iaa==Wn&&a.IFa&&this.Aa.rg()};var hR="^iim",iR="^ig";
+F.WH=function $$U(a){if(!this.Pc)if(a.iaa==Wn){M3a(this);yA++;try{this.Aa.Qf();try{if(!this.aa.Qs(a)&&!a.IFa){var c=a.ws(),d=a.Bb?a.Bb():i;switch(a.mg){case 1:case 2:for(var f=0,g=a.Mg();f<g[u];f++){var j=g[f][0],n=g[f][1],s=a.mg==1,v=this.lJ(c,d,j);this.Jg&&this.Jg.Yaa(j,n,s);if(this.Cg){this.Cg.Yaa(j,n,s);zL(this,j)}v&&O3a(v)}break;case 97:var C=a.Hc(),M=a.wf,Y=this.lJ(a.ws(),a.Bb(),C),ha=this.Cg,tb;if(ha){ha.Xwb(C,M,k);zL(this,C);tb=ha.Ydb(C)}var zc=this.Jg;if(zc)tb?zc.Yaa(C,C,k,tb):bI(zc,C);Y&&
+O3a(Y);break;case 3:case 4:var qb=a.mg!=4;f=0;for(g=a.Mg();f<g[u];f++)this.STa(g[f][0],g[f][1],qb);break;case 110:var nd=d?Xy(d):i,Fe=[],Pe=nd?[nd]:[];qb=h;N3a(this,c,d,a.Mg(),Fe,Pe,qb);break;case 111:Fe=(nd=a.Dd())?[nd]:[];Pe=[];qb=k;N3a(this,c,d,a.Mg(),Fe,Pe,qb);break;case 5:case 6:qb=a.mg!=6;var qg=a.Hc();f=0;for(g=a.wf;f<g[u];f++)this.Iqb(qg,g[f],qb);break;case 11:qg=a.Hc();f=0;for(g=a.wf;f<g[u];f++){var te=qg;if(this.Cg){tI(this.Cg,te);zL(this,te)}this.Jg&&TRa(this.Jg)}break;case 48:qg=a.Hc();
+f=0;for(g=a.wf;f<g[u];f++){te=qg;if(this.Cg){this.Cg.Wwb(te,g[f],k);zL(this,te)}this.Jg&&TRa(this.Jg)}break;case 12:case 13:case 76:case 77:Pe=[];Fe=[];switch(a.mg){case 12:Fe=[a.Dd()];break;case 13:Pe=[a.Dd()];break;case 76:Pe=[a.IXc];Fe=[a.Dd()];break;case 77:Pe=a.pkb;Fe=a.okb;break}this.aa.lJ(a,Fe,Pe);te=a.Mg();for(f=0;f<te[u];f++){g=te[f];qg=g[0];var Zk=g[1];yL(this,c,d,qg,Zk,Fe,Pe)}break;case 53:f=nd=a.Dd();this.Jg&&this.Jg.E4(f,void 0);this.Cg&&this.Cg.E4(f,void 0);break;case 54:var My=a.KU,
+Ny=a.sWc;this.Jg&&this.Jg.E4(My,Ny);this.Cg&&this.Cg.E4(My,Ny);break;case 67:case 116:a.wac();break;case 8:te=a.Mg();for(f=0;f<te[u];f++){g=te[f];qg=g[0];Zk=g[1];var Ut=qg;yL(this,c,d,Ut,Zk,[TI],[AL,BL,GN]);if(this.Cg){tI(this.Cg,Ut);zL(this,Ut)}}break;case 16:te=a.Mg();for(f=0;f<te[u];f++)this.Aa.rg();break;case 10:te=a.Mg();for(f=0;f<te[u];f++){g=te[f];qg=g[0];Zk=g[1];Ut=qg;var Kr=Zk,Tp=[BL];a=[AL,TI,GN];this.aa.lJ(i,Tp,a);yL(this,c,d,Ut,Kr,Tp,a)}break;case 9:te=a.Mg();for(f=0;f<te[u];f++){g=te[f];
+qg=g[0];Zk=g[1];yL(this,c,d,qg,Zk,[AL],[TI,BL,GN,hR,iR])}break;case 18:te=a.Mg();for(f=0;f<te[u];f++){g=te[f];qg=g[0];Zk=g[1];yL(this,c,d,qg,Zk,[TI],[AL,BL,GN])}break;case 98:te=a.Mg();for(f=0;f<te[u];f++){g=te[f];qg=g[0];Zk=g[1];yL(this,c,d,qg,Zk,[A7a],[AL,BL,GN])}break;case 30:var GD=a.Hc(),vo=a.wf[0],b9=this.lJ(c,d,GD);this.SX(GD,i,[Gmb],vo);this.SX(GD,i,[AL]);this.m1(GD,i,[TI,BL,GN]);b9&&O3a(b9);break;case 31:var Loa=a.Hc();yL(this,c,d,Loa,i,[],[Gmb],a.wf[0]);break;case 17:te=a.Mg();for(f=0;f<
+te[u];f++){g=te[f];qg=g[0];Zk=g[1];a=qg;j=Zk;Kr=this.co;if(Kr.hc()){Tp=OC(Kr);Tp[p](TI);Tp[p](AL);Tp[p](BL);Tp[p](CL);Tp[p](oI);Tp[p](EN);Tp[p](DN);Kr.BFb(Tp);Kr.aa.iGa(Tp);Ut=Tp}else Ut=i;yL(this,c,d,a,j,[],Ut)}break;case 47:te=a.Mg();for(f=0;f<te[u];f++){g=te[f];c=qg=g[0];if(this.Jg){SRa(this.Jg);cI(this.Jg,J7a)}if(this.Cg){tI(this.Cg,c);zL(this,c)}}break;case 21:Fe=[GN];Pe=[AL,BL,TI];this.aa.lJ(a,Fe,Pe);te=a.Mg();for(f=0;f<te[u];f++){g=te[f];qg=g[0];Zk=g[1];yL(this,c,d,qg,Zk,Fe,Pe)}break;case 22:var eH=
+a.Hc(),c9=a.c_();if(a.eg||!a.Eg()){a.WQ&&!a.Eg()&&this.m1(eH,eH,[TI]);P3a(this,d,eH,c9,a.OM())}else P3a(this,d,eH,c9);break;case 23:eH=a.Hc();c9=a.c_();P3a(this,d,eH,c9);break;case 15:qg=a.Hc();var cjb=a.wf;for(f=0;f<cjb[u];f++)P3a(this,d,qg,i);break;case 49:case 50:this.Cg&&MSa(this.Cg,a.Qla);break;case 58:var GLa=a.uGc();if(this.Cg){tI(this.Cg,GLa);zL(this,GLa)}break;case 36:var HLa=a.XA,ILa=HLa.Sb();for(f=0;f<ILa[u];f++){var JLa=ILa[f];this.lb.Yc(JLa,HLa.J(JLa))}break;case 61:var Moa=this.lb,djb=
+a.NQc();zy(Moa,Moa.rl);Fya(Moa,DM).set(new qy(DM,djb));break;case 27:case 57:a.FPc()&&b4a(this);break;default:this.aa.Tsb(a)}}}finally{this.Aa.Mf()}}finally{zA()}}else a.iaa==pd&&a.HNa()==2&&this.pUa[p](a)};F.tqb=function $aV(a){!this.Pc&&a.iaa==pd&&a.HNa()==2&&jf(this.pUa,a)};F.STa=function $bV(a,c,d){d={Uf:d};this.Jg&&this.Jg.nB(a,c,d);if(this.Cg){this.Cg.nB(a,c,d);zL(this,a)}};
+F.Iqb=function $cV(a,c,d){d={Uf:d};if(this.Cg){this.Cg.YXa(a,c,d);zL(this,a)}if(this.Jg)if(c=QRa(this.Jg,a))if(d.Uf)this.Jg.nB(a,c,d);else{var f=NSa(this.Cg,a,c);if(wx(f)){bI(this.Jg,a);cI(this.Jg,I7a)}else f||this.Jg.nB(a,c,d)}else cI(this.Jg,I7a)};F.lJ=function $dV(a,c,d){var f;if(this.co){a=f=new S3a(this,a,c,d);if(a.aX==2&&a.ik.Cg){if((c=a.ik.Cg.zp(a.Ea,a.Sq,h))&&c.hc())a.on=c}else if(a.aX==1&&a.ik.Jg)if(c=(c=a.ik.Jg.Zga(a.Ea,a.Sq))&&c.hc()?c.J():i)a.Uk=c;a.K2(-1)}return f};
+F.SX=function $eV(a,c,d,f){this.Jg&&this.Jg.SX(a,c,d);if(this.Cg){this.Cg.SX(a,c,d,f);zL(this,a)}};F.m1=function $fV(a,c,d,f){this.Jg&&this.Jg.m1(a,c,d);if(this.Cg){this.Cg.m1(a,c,d,f);zL(this,a)}};F.fXb=B();S3a[w].K2=function $hV(a){if(this.on){var c=this.on.wua(),d=this.on.Jo();V3a(this,this.aBb,c,a);V3a(this,this.AAb,d,a)}else if(this.Uk){c=this.Uk.wua();d=this.Uk.Jo();V3a(this,this.aBb,c,a);V3a(this,this.AAb,d,a)}else this.NYb=k};
+xL[w].O_c=function $iV(a){M3a(this);var c=a[dq],d=c[1];a=a.Pg;var f=a.Rc(pd);a=f==QN?a.Rc(fG)==qB[22]?k:h:f==OD&&Z3a(this,a);if(!a&&this.wKa.Nb()){var g=this.wKa.Sb();for(f=0;f<g[u];f++){var j=g[f];a4a(this,j)}this.wKa[bc]()}for(f=0;f<d[u];f++){g=d[f];j=g[0];if(this.UQa[j]!=g[1])a?this.wKa.set(j,1):a4a(this,j)}if(c[u]>2)if(this.hZb!=c[2]){this.lb.rg();this.co&&this.co.rg()}};
+xL[w].N_c=function $jV(a){M3a(this);var c=a[dq],d=c[1];a=a.Pg.Rc(fG)==qB[22]?h:k;var f=this.UQa;this.UQa={};for(var g=0;g<d[u];g++){var j=d[g],n=j[0];j=j[1];var s=f[n];this.UQa[n]=j;a&&s!=j&&a4a(this,n)}if(c[u]>2)this.hZb=c[2]};xL[w].tka=function $kV(a,c,d,f,g){M3a(this);this.Cg&&this.Cg.tka(a,c,d,f,g)};yx(DL,S3a);DL[w].z5a=B();DL[w].z5a.Ka=h;DL[w].xwb=B();DL[w].xwb.ic=h;_B_prog(81)}catch(e){_B_err(e)}
+
+try{H(c4a,Iw);var drb="gv",erb="U",jR="gp";c4a[w].tb=function $nV(){var a=fD(this.Db);hD(a,this,[UO]);iD(a,this,[je]);gD(a,UO,RF);lA(this.Db,RF,drb);lA(this.Db,erb,jR);a=RC(this.Db);uEa(a,function(c){c=c.B();lA(c,JF,LF);lA(c,bM,yM)})};c4a[w].Gaa=function $oV(a){return[je,a.ega]};c4a[w].aca=function $pV(a,c){a={};if(c[0]){Gp(a,UO);a.ega=c[0]}return a};H(d4a,Iw);var frb="settings";d4a[w].tb=function $qV(){var a=fD(this.Db);iD(a,this,[frb]);hD(a,this,[dJ]);gD(a,dJ,ML);lA(this.Db,ML,ki)};d4a[w].Gaa=function $rV(a){var c=[frb];a.fk&&c[p](a.fk);return c};d4a[w].aca=function $sV(a,c){a={view:dJ};if(c[0])a.fk=c[0];return a};e4a[w].e9=function $tV(a){this.jb[bq]({view:QO,nt:a})};H(EL,YC);F=EL[w];F.Ttb=function $uV(){var a=this.V;pDa(a);rDa(a);WCa(a,this);var c=new HB(a);a[kq](IB,c);var d=new LLa(a);a[kq](vA,d);a[kq](Bz,new BPa(a));a[kq](eo,new WIa(a));d=new HH(a);a[kq](IH,d);d=new jCa(a);a[kq](fo,d);d=new UKa(a);a[kq](GF,d);a[kq](RE,new e4a(c))};F.B=D(JF);var grb="cO",hrb="cQ",irb="cP";
+F.OK=function $wV(a,c){if(jA(this.V,Pd))e(Error(".170"));var d=this.sC[yc];ewa(Wj,d);var f=d[ub](Kdb);if(a){Sg(f);a=d}else{a=om(f);ewa(Wj,a);if(Jg){d=Cg(a);var g=d.ba(T);Ja(g[x],oia);Wa(g[x],Ah);ka(g[x],Ah);d[o](a[Lc],g)}K(f,grb);K(a[mc],hrb);K(a[Lc],irb);a=a;this.Gk.w(f[gc],uj,this.SIc)}c=c&&L?this.sC[yc][ub](c):this.sC[yc][Lc];this.Thb(a,c);L&&this.V.J(Zx).XFa(a[Lc]);ZVa(this.V).UXa(ki)};
+F.Thb=function $xV(a,c){var d=this.V;oDa(qC(d),a);rFa(d,a[Lc]);var f=sC(d);tDa(f,a);if(f.Ppa)e(Error(".105"));f.Ppa=Cg(this.sC[yc]);if(f.Jsa)e(Error(".105"));f.Jsa=Cg(a);this.Gk.w(f,rC,this.EHc);a=Cg(this.sC);f=mD(d);pDa(f);oDa(qC(f),Eg(c));d.aI=f;rFa(f,c);c=qC(d).W();c=new gC([c,a]);if(jA(hA(d),XC))d[kq](XC,c);else{hA(d)[kq](XC,c);nDa(lC(d),c)}};F.EHc=function $yV(){var a=iA(this.V);if(Ng&&a){a=qC(a).Fp()[rk];a[ed]==ym&&a[yk]()}};
+F.SIc=function $zV(){if(!Ng&&!(Fh&&vg(Im)))this.Jz.qa==1||this.Jz.qa==2||top[Ic][Sq](h)};F.L=function $AV(){if(this.QOb){iA(this.V).D();this.V.D()}EL.C.L[z](this)};H(HL,xx);HL[w].qo=B();HL[w].qo.Ka=h;H(IL,Jf);yx(HL,IL);F=IL[w];var kR="aa",lR="lb",jrb="GMAIL_LOGIN";F.tb=function $CV(){var a=this.V,c=dD(a);c.qo(new Y0a(a));c.qo(new nRa(a));c.qo(new d4a(a));c.qo(new c4a(a));this.aa.qo(a,c);c.tb();c=this.V;var d=new DIa(c);c[kq](ii,d);fy(this.V).ud.mw=d;c=new xL(a);a[kq](Yx,new OBa(c));OO=Af(EB.Nga(),I,dab.Nga(),kD,eI.Nga(),oy);lA(this.V,OIa,JD);lA(this.V,kR,lR);a=this.V;c=new U_a(a);a[kq](SK,c);ni(jrb,Md,".google.com");a=this.V;c=new HE(a,void 0);a[kq](aD,c)};F.L=function $DV(){IL.C.L[z](this);this.Q.D()};
+F.Gpb=function $EV(){this.Q.w(this.Jz.iL,aD,this.LYc)};var krb="All windows that have been popped out will be closed.";F.LYc=function $FV(a){this.Jz.poa[u]>1&&a.hj[p](krb)};F.tYc=function $GV(){try{var a=this.V,c=this.Jz.iL,d=nf(this.Jz.poa);Ff(d,function(n){n!=c&&n.o6a()});var f=jA(a,Xx);f&&f.Ac(k);GEa(a);a.D();ME.D();this.Y9a&&this.Y9a.D();var g=O.S();g.Bxa.D();Cwa();this.Q.D();g.D();this.p9a()}catch(j){}finally{}this.D()};F.p9a=function $HV(){vf(kh)&&ph()};H(j4a,uh);var lrb="532.0";ya(j4a[w],function $IV(a){var c=0,d=0,f=0;a=a.pj;if(a[Zb]==i4a){d=1;if(L||Jg&&(Ri||vg(lrb)))d=40;f=-a.wheelDelta/d;if(Ke(a.wheelDeltaX)){c=-a.wheelDeltaX/d;d=-a.wheelDeltaY/d}else d=f}else{f=a.detail;if(f>100)f=3;else if(f<-100)f=-3;if(Ke(a.axis)&&a.axis===a.HORIZONTAL_AXIS)c=f;else d=f}c=new k4a(f,a,c,d);try{this[r](c)}finally{c.D()}});j4a[w].L=function $JV(){j4a.C.L[z](this);oh(this.lRa);delete this.lRa};H(k4a,hh);function yrb(b){this.V=b;this.Ma=yy(b);this.cg=KC(b);this.Dea=new ZDa}function zrb(b){b.kw=new Hf;var a=b.Ma.db(w6a);a=a||cM.sx_clcp;if(!sx(a)){for(var c=new cg,d=OC(MC(b.cg)),f=0;f<d[u];f++){var g=NC(b.cg,d[f]).rga();g<-1&&c.add(g)}d=[];a=a[Cc](wj);var j=k;for(f=0;f<a[u];f++){var n=a[f][Cc](xj);g=da(n[0],10);if(c[bd](g)){b.kw.set(g,{tg:n[1],bgColor:n[2]});d[p](n[kd](xj))}else j=h}if(j){b=new lF(b.V);b.bh=h;b.Yc(w6a,d[kd](wj));b[Mb]()}}}function nR(b){b.kw||zrb(b);return b.kw};F=yrb[w];F.PO=function $ZV(a){if(a<-1)return(a=nR(this).J(a))?a.tg:sdb;return this.Dea.PO(a)};F.lK=function $_V(a){if(a<-1)return(a=nR(this).J(a))?a[jq]:EP;return this.Dea.lK(a)};F.X5=function $0V(a){var c=a.rga();if(c<-1){c=(a=nR(this).J(c))?a[jq]:EP;return{tg:(a?a.tg:sdb)[Zc](1),bgColor:c[Zc](1)}}return this.Dea.X5(a)};F.qcb=function $1V(){return this.Dea.qcb()};F.icb=function $2V(){return this.Dea.icb()};F.JMa=function $3V(){return this.Dea.JMa()};
+F.rga=function $4V(a,c){for(var d=nR(this).Sb(),f=nR(this).Oa(),g=0;g<f[u];g++)if(a==f[g].tg&&c==f[g][jq])return da(d[g],10);d=(d=this.Ma.db(x6a))?da(d,10):cM.ix_clcip;f=(f=this.Ma.db(w6a))?f:cM.sx_clcp;f+=(f!=I?wj:I)+d+xj+a+xj+c;if(f[u]>2E3)return i;g=new lF(this.V);g.bh=h;g.Yc(x6a,d-1);g[Mb]();g=new lF(this.V);g.bh=h;g.Yc(w6a,f);g[Mb]();nR(this).set(d,{tg:a,bgColor:c});return d};_B_prog(82)}catch(e){_B_err(e)}
+
+try{Xw(O.S(),Kd).Lr(function(b){var a=new yrb(b);KC(b).kr=a});var Brb="0.3.6";function oR(b,a,c){this.fF=c||Io()[tc](Ho,YQ);this.Jb=sla(b);this.Gub=a?String(a):i;this.xzb=bg(Io()[Za],Brb)>=0}var Crb="progress";function Drb(b,a,c){if(b.HLa!=a||b.BZ!=c){b.HLa=a;b.BZ=c;b[r](Crb)}}function pR(b){if(!b.qy())e(Error(".171"))}function Erb(b){if(!b.xzb&&b.RI!=i){b.ab[Oma](b.RI);b.RI=i;b.ab=i}}function Frb(b,a){N[z](this,b);if(a)this.sLa=a}function qR(b){this.tab=new Hf;this.Qwa=b}function Grb(b,a){b=500*l.pow(2,a);return b+b*l[Tc]()/2}
+function rR(){qR[z](this,h);this.ZL=[];this.na=new kn(this)}function sR(b){qR[z](this,h);this.Dc=b;this.na=new kn(this);this.na.w(b,Mh,this);this.na.w(b,Kh,this);this.na.w(b,Crb,this)}H(oR,uh);F=oR[w];F.RI=i;F.ab=i;F.ng=k;F.HLa=0;F.BZ=0;F.Eb=D(Ej);F.jm=function $7V(){return this.HLa==this.BZ};F.ye=function $8V(){return this.hf()==0};F.Kga=function $9V(){return this.Wn?this.Wn.lastErrorMessage:I};F.qy=function $$V(){if(!this.Wn)this.Wn=this.fF.openManagedStore(this.Jb,this.Gub);return!!this.Wn};
+Ka(F,function $aW(a){if(!this.qy()){this.Wn=this.fF.createManagedStore(this.Jb,this.Gub);pR(this)}if(a)this.Wn.manifestUrl=String(a)});var Hrb="beta.timer";Qp(F,function $bW(){if(!this.ng){pR(this);if(this.xzb){kma(this.Wn,G(this.NJc,this));this.Wn.oncomplete=G(this.ZT,this);oa(this.Wn,G(this.Po,this))}else{this.ab=Io()[tc](Hrb,YQ);this.RI=this.ab[Dc](G(this.Lwc,this),500);Drb(this,0,1)}this.Wn[Kma]();this.ng=h}});F.BRb=function $cW(){pR(this);return this.Wn.manifestUrl};
+F.iCa=function $dW(a){pR(this);this.Wn.manifestUrl=String(a)};F.Cy=function $eW(){return this.qy()?this.Wn.currentVersion:i};F.hf=function $fW(){pR(this);return this.Wn.updateStatus};F.Mc=function $gW(){pR(this);return this.Wn[Vc]};F.Ac=function $hW(a){pR(this);Ra(this.Wn,!!a)};wa(F,function $iW(){pR(this);this.fF.removeManagedStore(this.Jb,this.Gub);this.Wn=i;if(this.qy())e(Error(".172"))});
+F.Lwc=function $jW(){var a;if(this.Wn.updateStatus==3){a=new Frb(Kh,this.Wn.lastErrorMessage);Drb(this,0,1)}else if(this.Wn.updateStatus==0){a=new Frb(Mh);Drb(this,1,1)}if(a){Erb(this);this[r](a);this[r](Hh);this.ng=k}};F.NJc=function $kW(a){Drb(this,a.filesComplete,a.filesTotal)};F.ZT=function $lW(){this[r](Mh);this[r](Hh);this.ng=k};F.Po=function $mW(a){this[r](new Frb(Kh,a[Tq]));this[r](Hh);this.ng=k};
+F.L=function $nW(){oR.C.L[z](this);if(this.xzb&&this.Wn){kma(this.Wn,i);this.Wn.oncomplete=i;oa(this.Wn,i)}Erb(this);this.Wn=this.fF=i};H(Frb,N);Frb[w].sLa=i;H(qR,uh);F=qR[w];F.Lv=i;var Irb=":28";F.TRa=function $oW(a){var c=this.tab.J(a)||0;this.tab.set(a,++c);if(c>5||this.tab.Nb()>50)return k;if(!this.Lv)this.Lv=bA(Irb,this.vW,Grb(this,c),this);return h};F.vW=function $pW(){if(!this.Eb())e(Error(".173"));this.eqa();this.Wma()};F.eqa=function $qW(){if(this.Lv){cA(this.Lv);this.Lv=i}};F.L=function $rW(){qR.C.L[z](this);this.eqa()};H(rR,qR);F=rR[w];F.XIa=k;F.H=D(KP);F.j_=function $tW(){return dxa(this.ZL,function(a,c){return a+c.j_()},0)};F.Z5=function $uW(){return dxa(this.ZL,function(a,c){return a+c.Z5()},0)};F.Eb=function $vW(){return Mi(this.ZL,function(a){return a.Eb()})};F.jm=function $wW(){return!this.ye()||Gf(this.ZL,function(a){return a.jm()||!a.Qwa})};F.ye=function $xW(){return Gf(this.ZL,function(a){return a.ye()||!a.Qwa})};
+F.Xn=function $yW(){var a=Li(Di(this.ZL,function(c){return!c.ye()}),function(c){return c.Xn()});return a[u]>0?a[kd](ch):i};Qa(F,function $zW(){if(!this.Eb()){this.XIa=k;Ff(this.ZL,function(a){a[Rc]()})}});F.add=function $AW(a){if(this.Eb())e(Error(".174"));this.ZL[p](a);this.na.w(a,tr,this);this.na.w(a,fo,this)};ya(F,function $BW(a){switch(a[Zb]){case tr:this.XIa||this[r](tr);break;case fo:if(!this.XIa&&this.jm()){this.XIa=h;this[r](fo)}break}});
+F.L=function $CW(){rR.C.L[z](this);this.na.D();this.na=i;for(var a=0;a<this.ZL[u];a++)this.ZL[a].D();this.ZL=i};H(sR,qR);F=sR[w];F.ng=k;F.gy=k;F.Nv=h;F.wq=i;F.j_=function $DW(){return this.BZ=this.BZ||this.Dc.BZ};F.Z5=function $EW(){return this.Dc.HLa+this.j_()-this.Dc.BZ};F.Eb=D(Ej);F.jm=D("gy");F.ye=D(Afb);F.Xn=D("wq");Qa(F,function $JW(){if(this.ng)e(Error(".175"));this.Dc.qy()||this.Dc[tc]();this.Wma()});F.Wma=function $KW(){this.Nv=this.ng=h;this.gy=k;this.wq=i;this.Dc[mr]()};var Jrb="Error capturing resource";
+ya(F,function $LW(a){if(a[Zb]==Crb)this[r](tr);else{this.Nv=a[Zb]==Mh;if(!this.Nv){this.wq=a.sLa||I;if(!DD()){a=Jrb+(this.Dc.qy()?xl+this.Dc.BRb()+xh:I)+xj+a.sLa;ME.yI(Error(a),Sma)}if(this.TRa(this.wq))return}this.ng=k;this.gy=h;this.Nv&&this.eqa();this[r](fo)}});F.L=function $MW(){sR.C.L[z](this);this.na.D();this.Dc=this.na=i};_B_prog(83)}catch(e){_B_err(e)}
+
+try{var Mrb="$root/cob-matches/thread/",Nrb="$root/earlydata";function Orb(b){this.on=this.Um=b;this.xJ=i;b.mb.za(ur)?this.Ioa():ih(b.mb.Ya(),Mrb+b.Hc(),this.F0,k,this)}var Prb="$root/cob-matches/message/";function Qrb(b){this.IZa=b;this.xJ=i;b.mb.za(ur)?this.Ioa():ih(b.mb.Ya(),Prb+b.vn(),this.F0,k,this)}if(172>tnb)tnb=172;zx(Orb,fI);Orb[w].F0=function $RW(){this.nBa();this.Ioa()};Orb[w].Ioa=function $SW(){this.xJ=this.on.mb.za(ur).Zga().za(this.on.Hc());this.xJ.Iz()};Orb[w].nBa=function $TW(){nh(this.on.mb.Ya(),Mrb+this.on.Hc(),this.F0,k,this)};Orb[w].D=function $UW(){this.nBa();if(this.xJ){this.xJ.bB();this.xJ=i}};zx(Qrb,tSa);Qrb[w].F0=function $VW(){this.nBa();this.Ioa()};Qrb[w].Ioa=function $WW(){this.xJ=this.IZa.mb.za(ur).PP.za(this.IZa.vn());this.xJ.Iz()};Qrb[w].nBa=function $XW(){nh(this.IZa.mb.Ya(),Prb+this.IZa.vn(),this.F0,k,this)};Qrb[w].D=function $YW(){this.nBa();if(this.xJ){this.xJ.bB();this.xJ=i}};function Urb(b,a){tB[z](this,b,95,a);this.uj=h;this.nhc={};this.Q=new kn(this);this.sg=sH(b)}var Vrb="Waiting for task list to load.";function Wrb(b,a){b.Jra(Vrb,5E3);mh(a.Vi,Uma,G(b.C2a,b))}function Xrb(b,a){b.Q.w(a,pn,b.k0b);WVa(b.sg.Hp(sJ),vr).dUa(k)}function Yrb(b){this.o2a=b};H(Urb,tB);F=Urb[w];F.Ja=function $2W(a){Urb.C.Ja[z](this,a);this.C2a()};F.C2a=function $3W(){var a=kA(this.B(),UF);Zw(a,this.Crc,this)};var Zrb="tasks:default",asb="Your conversation has been added to the task list",bsb="Your conversations have been added to the task list";F.Crc=function $4W(a){var c=a.Dq();(a=c.Gl(Zrb))&&this.Q.hb(c,pn,this.k0b);if(a&&a.uta()){a.nF();c=this.RDa;a.Urc(c,this.nhc);this.Jra(c[u]==1?asb:bsb,6E4)}else a?Wrb(this,a):Xrb(this,c)};var csb="Opening Tasks...";
+F.k0b=function $5W(a){if(a.bya==vr){this.C2a();this.Jra(csb,3E3)}};F.Bdc=function $6W(a,c){this.nhc[c]=a};F.Jra=function $7W(a,c){a=new Zz(a,undefined,c);tH(this.B()).Ad(a)};F.L=function $8W(){Urb.C.L[z](this);this.Q.D()};Ax(Yrb,NB);Yrb[w].eca=function $9W(a,c){if(c.Lp||c.i_a[u]!=0)a[95]=h};Yrb[w].dca=function $$W(a){a[95]=h};Mx().Ug(170,function(b,a){a.ka(Wfa,Hj)});function psb(b){this.O=b}var qsb="lastActivity";function rsb(b,a){Kx[z](this,qsb,b);this.Kk().w(a,Fx(xr),this.G2c)}function ssb(b){this.Db=b;this.Aa=Dx(Cx(b));this.xf=fy(b)}psb[w].Fq=function $xX(){return this.O[8]};psb[w].Kdb=function $yX(){return this.O[10]};Ha(psb[w],function $zX(){return this.O[t]()});psb[w].kc=D(ae);H(rsb,Kx);rsb[w].UYb=0;rsb[w].G2c=function $BX(a){a=new psb(a[dq]);var c=a.Fq();if(!(c<=this.UYb)){this.tPc=h;this.mb.Qf();try{this.Fa(Pd,a.O[1]);this.Fa(xr,a.O[5]);this.Fa(YHa,a.O[7]);this.Fa(uw,a.O[9]);this.Fa(Hz,a.O[3]);this.Fa(KP,a.O[4]);this.Fa(yP,a.O[6]);this.Fa(yr,a.O[2]);this.Fa(IB,c);this.Fa(Kd,a.Kdb());this.UYb=c}finally{this.mb.Mf()}}};H(ssb,Iw);ssb[w].tb=function $CX(){var a=this.Aa,c=new rsb(a,this.xf.ud);a.ha(c)};Xw(O.S(),Kd).Lr(function(b){dD(b).qo(new ssb(b))});var usb="UeNMbe",vsb="ZCbBHb",wsb="</div><div class=",xsb="></div></div>";function ysb(b,a){var c=a||new U;c[R](fJ,usb,nUa,vsb,Uf,b.ke,wsb,VUa,xsb);if(!a)return c[t]()}function zsb(b){this.AP=b;this.lb=yy(b.B())};zx(zsb,NI);F=zsb[w];F.yyb=0;var Asb='Tip: Drag labels in and out of this menu or customize which labels show under <a href="',Bsb='#settings/labels">Settings</a>.';F.Ykb=function $DX(a,c){if(!(this.yyb>0)){this.Ecc=this.lb.Ep(R6a);if(this.Ecc!=0){var d=Asb+(nD(this.AP.B())+Bsb),f=this.AP.W()[Qb](T);Q(f,ysb({ke:d}));this.rna=f;d=this.AP.b(Rd);Qg(this.rna,d);this.Q=a;this.d_b=c;a.w(c,mo,this.Mic,k,this);a.w(c,no,this.w0b,k,this);c=this.rna[ic](kC)[0];Pw(a,c,aB,this.lh)}}};
+F.Mic=function $EX(){var a=new lF(this.AP.B());a.bh=h;a.Yc(R6a,this.Ecc-1);a[Mb]();this.Q.hb(this.d_b,mo,this.Mic,k,this)};F.lh=function $FX(a){JB(this.AP.B())[bq]({view:dJ,fk:LC});a[zb]();a[Ec]()};F.w0b=function $GX(){this.yyb++;if(this.rna&&this.yyb>=4){var a=this.rna[ic](kC)[0];this.Q.hb(this.d_b,no,this.w0b,k,this);Ow(this.Q,a,aB,this.lh);Sg(this.rna);this.rna=i}};function wR(b,a){return b.isCaptured=a}var xR="isValidRow",Csb="createWorkerFromUrl",yR="abortCapture",zR="isCaptured",Dsb="EXPIRED",Esb="Disable ",AR="stable",BR="uphill",Fsb="-b",Gsb="History",Hsb="PendingHistory";function Isb(b){li(b,Dsb,0,pi)}var Jsb="exp/197/html/en/help.html";function Ksb(){return Jsb}function Lsb(b){this.tkc=b}function Msb(b,a){tB[z](this,b,101,a);this.uj=h}function Nsb(b){this.o2a=b}function CR(b){if(b=jA(b,KF))return b.QGc();return i}function vE(b){CR(b).HCa()}var Osb="Offline Mail";
+function DR(){return Osb}var Psb="525.17";function Qsb(){return L&&vg(Tj)||Fh&&vg(HQa)||Jg&&vg(Psb)&&Qi&&No&&!Rsb()||rla()}var Ssb="10.6.0";function Rsb(){if(Qi&&No){var b=/Mac OS X ([0-9_]+);/[hb](ug());if(b&&b[u]==2)if(b=b[1]){b=b[Cc](mg)[kd](He);if(bg(b,Ssb)>=0)return h}}return k}function Tsb(){}function Usb(b){this.Jmd=b}function Vsb(b,a){this.JR=b;a!=i&&this.wc(a)}function Wsb(b,a){N[z](this,b);Oa(this,a[Lc]);this.Pm=this[Tq];this.O0b=a}
+function Xsb(){this.fFa={};var b=Le("google.gears.workerPool");this.JR=b?b:this.SFc();this.JR.onmessage=G(this.Sua,this)}function Ysb(b,a,c){N[z](this,b);this.eEd=a;Oa(this,c[Lc]);this.O0b=c}function Zsb(b,a){qR[z](this,a);this.eFa=String(b);this.jda=new Sh;this.jda.Pr(b.ul);this.jda.iB(b.Jk());Th(this.jda,b.UA);this.na=new kn(this)}function atb(b){this.kf=b}var btb="INSERT OR REPLACE INTO StoreVersionInfo (StoreName, Version) VALUES(?,?)";function ctb(b,a){b.kf[hd](btb,b[ec],a)}
+var dtb="CREATE TRIGGER ",etb=" ON ",ftb=" WHEN ",gtb=" BEGIN ",htb="; END";function ER(b,a,c,d){return dtb+d+c[ec]+J+a+etb+c.TZa+(c.trd?ftb+c.trd:I)+gtb+c.Bz[kd](Yma)+htb}var itb="IF NOT EXISTS ",jtb="CREATE TABLE ",ktb=" (\n",ltb=",\n ",mtb="CREATE VIRTUAL TABLE ",ntb=" USING FTS2 (\n",otb="CREATE",ptb=" UNIQUE",qtb=" INDEX ",rtb="BEFORE INSERT",stb="AFTER INSERT",ttb="BEFORE UPDATE",utb="AFTER UPDATE",vtb="BEFORE DELETE",wtb="AFTER DELETE";
+function xtb(b,a,c){c=c?itb:I;switch(a[Zb]){case 1:return jtb+c+a[ec]+ktb+a.uq[kd](ltb)+xh;case 2:return mtb+c+a[ec]+ntb+a.uq[kd](ltb)+xh;case 3:return otb+(a.Tjb?ptb:I)+qtb+c+a[ec]+etb+a.TZa+ktb+a.uq[kd](ltb)+xh;case 4:return ER(b,rtb,a,c);case 5:return ER(b,stb,a,c);case 6:return ER(b,ttb,a,c);case 7:return ER(b,utb,a,c);case 8:return ER(b,vtb,a,c);case 9:return ER(b,wtb,a,c)}return I}var ytb="DROP TABLE IF EXISTS ",ztb="DROP INDEX IF EXISTS ",Atb="DROP TRIGGER IF EXISTS ";
+function Btb(b,a){switch(a[Zb]){case 1:case 2:return ytb+a[ec];case 3:return ztb+a[ec];case 4:case 5:case 6:case 7:case 8:case 9:return Atb+a[ec]}return I}var Ctb="SELECT 1 FROM SQLITE_MASTER WHERE TYPE=? AND NAME=?";function Dtb(b,a,c){return b.kf.Kr(Ctb,a,c)!=i}var Etb="beta.database";function FR(b,a){var c=Io();try{this.kf=c[tc](Etb,YQ)}catch(d){e(Error(".183`"+d[Tq]))}if(this.kf!=i){this.hbc=b=sla(b+Qd+a);this.kf[bb](b)}else e(Error(".184"))}function Ftb(b){N[z](this,b)}
+function Gtb(b){var a=[];if(b)for(var c=b.fieldCount();b[xR]();){for(var d=new Array(c),f=0;f<c;f++)d[f]=b[aq](f);a[p](d);b[Rk]()}return a}function Htb(b){var a=[];if(b)for(;b[xR]();){a[p](b[aq](0));b[Rk]()}return a}function Itb(b){return b&&b[xR]()?b[aq](0):i}function Jtb(b){if(b&&b[xR]()){for(var a={},c=b.fieldCount(),d=0;d<c;d++)a[b.fieldName(d)]=b[aq](d);return a}else return i}
+function Ktb(b,a,c,d){if(c[u]==0||d>=c[u])return b[hd](a);else{if(Ve(c[d]))return b[hd](a,c[d]);c=Array[w][lb][z](c,d);return b[hd](a,c)}}function Ltb(b,a,c,d,f){b=Ktb(b,a,d,f);try{return c(b)}finally{b&&b[Xk]()}}var Mtb="ROLLBACK",Ntb="COMMIT",Otb="beforerollback",Ptb="beforecommit",Qtb="rollback",Rtb="commit";function Stb(b,a){var c,d;c=a?Mtb:Ntb;d=a?Otb:Ptb;var f=b[r](new Ftb(d));if(f){b.kf[hd](c);b.xL=0;d=a?Qtb:Rtb;b[r](new Ftb(d))}return f}
+function GR(b){if(b.QBb){if(b.xL<=0)e(Error(".187"));if(b.xL==1){var a=Stb(b,b.pya);return!b.pya&&a}else b.xL--}return k}function HR(b,a){FR[z](this,b,a);this.Dc=new atb(this);this.na=new kn(this);this.na.w(this,Gaa,this.Rbd);this.na.w(this,Qtb,this.Wbd);this.na.w(this,Rtb,this.Tbd);this.pqa=[];this.wBa=[]}var Ttb="-u";function Utb(b,a){return new HR(b,a+Ttb)}function IR(b,a){this.yb=b;this.SF=a}function JR(b){IR[z](this,b,this)}
+function KR(b,a,c){b.yb.mn();try{b.yb[hd](btb,a,c);GR(b.yb)}catch(d){b.yb.xm(d);e(d)}}var Vtb="WebCache-";function Wtb(b,a,c,d,f,g,j){this.id=d;dp(this,f);wR(this,g);this.fF=b;a=sla(Vtb+d+Qd+a+Qd+c);this.Tr=new cg;this.NM=new cg;this.Dc=b.openStore(a);if(!this.Dc)this.Dc=b.createStore(a);for(b=0;b<j[u];b++){a=j[b];this.Tr.add(a);!this[zR]&&!this.Dc[zR](a)&&this.NM.add(a)}wR(this,this.NM.nd());this.T2=this.NM.Oa()}
+function Xtb(b,a,c,d,f){IR[z](this,d,f);this.fF=b;this.AR=a;this.nGb=c;this.zK=[];this.Fh=new uh}function Ytb(b){Ia(b.zK,0);b.YSa=0;b.ZSa=0;b.Cgb=k;b.VSa=0;for(var a=b.RE.Oa(),c=0;c<a[u];c++){var d=a[c];d[kr]();d[zR]||b.zK[p](d);b.YSa+=d.T2[u];b.ZSa+=d.Tr.Nb()}}var Ztb="SELECT GroupId, Version, Captured, UrlProtoStr FROM UrlGroups";function aub(b){b.RE=new Hf;b.yb.MEc(Ztb,b.nzc,b)}var bub="Ta";
+function cub(b){if(b.zK[u]){var a=b.zK[0];b=G(b.jbb,b);a.pIa=b;a.R3=a.T2[0];a.sN=a.Dc[Fb]([a.R3],G(a.jbb,a));a.eCd=k;a.hD=Dh(a.fMc,1E4,a)}else{b.yx=k;b.Fh[r](bub)}}function dub(b,a){qR[z](this,h);this.Hn=b;this.Dc=a;this.na=new kn(this);this.na.w(a.Ya(),zr,this);this.na.w(a.Ya(),bub,this)}var eub="=;NONE;",fub="lsm",gub="lslm",hub="lsrm";
+function LR(b,a,c,d,f,g,j,n,s,v){rR[z](this);this.kla=s;s=MR(g,j,Mj.Vf);var C=g+eub;g=g+ei+j;this.iF=new oR(c,s,a);this.jF=new oR(d,C,a);if(this.kla)this.hF=new oR(f,g,a);d=this.IBb=Utb(j,v);f=new JR(d);f.cA();this.eG=new Xtb(a,j,c,d,f);if(!this.iF.qy()){this.iF[tc]();this.iTc=this.iF.Cy()}if(!this.jF.qy()){this.jF[tc]();this.kTc=this.jF.Cy()}if(this.kla&&!this.hF.qy()){this.hF[tc]();this.jTc=this.hF.Cy()}this.eG.cA();this.iF.iCa(iub(fub,this.iF.Cy()||I,Gi));this.jF.iCa(iub(gub,this.jF.Cy()||I,Gi));
+if(this.kla)this.hF.iCa(iub(hub,this.hF.Cy()||I,Gi));for(a=0;a<n[u];a++){c=new Sh(n[a].eFa);L&&c.ul==xH&&c.Jk()[Db](Ux)!=-1||this.add(new Zsb(c,n[a].Qwa))}this.add(new sR(this.iF));this.add(new sR(this.jF));this.kla&&this.add(new sR(this.hF));this.add(new dub(b,this.eG))}function iub(b,a,c,d){return(new Sh(d)).ka(pd,b).ka(Zma,a).ka(Yfa,c)[t]()}function MR(b,a,c){if(!c[Kb](jub))return b+ei+a;return i}function kub(){this.Jsc=[];this.pE=[];Tla=this.K3;Wo=i}function lub(b){b=b.Yt();return!!b&&b.Lf}
+function mub(b){this.Xp=b}function NR(){this.Ana=++nub;this.uac=new cg}function oub(b,a){switch(a.Rc(pd)){case DE:case OD:return a.Bb().Ga()==nz}return k}function pub(b,a){b=/^0000.*/;var c=a.Rc(PD)||(a.RC?a.RC.J(PD):i);a=a.Rc(Ar)||(a.RC?a.RC.J(Ar):i);return!!c&&b[cb](c)||!!a&&b[cb](a)}
+function qub(b,a){var c=a.Rc(pd);if(oub(b,a))return h;a:{switch(a.Rc(pd)){case DE:case OD:b=a.Bb().Ga()==ul;break a}b=k}if(b)return k;a:switch(a.Rc(pd)){case DE:b=Uo(a.Bb());break a;default:b=k;break a}if(b)return k;switch(c){case bC:case OD:case Br:case MN:case DE:case TO:case ana:case zz:return h;case QN:a:{a=a.Rc(fG);if(!OR[a]){c=a[Db](mg);if(c==-1||!OR[a[nc](0,c+1)]){a=k;break a}}a=h}if(a)return h}return k}function rub(b,a){a=a.Rc(pd);b.uac[bd](a)||b.uac.add(a)}
+function sub(b,a){if(a.Rc(pd)==QN){b=a.Rc(fG);return b==EE||b==wO}return k}var tub,uub;_B_prog(84)}catch(e){_B_err(e)}
+
+try{Ax(Lsb,mCa);Lsb[w].Tka=function $HX(a){var c=CR(this.tkc.B());return!!c&&c.Tka(a)};H(Msb,tB);var vub="All conversations have been moved to Drafts.",wub="The conversation has been moved to Drafts.",xub=" conversations have been moved to Drafts.";Msb[w].yp=function $IX(){var a;a=this.Lp()?vub:this.Cr()?wub:this.Mg()[u]+xub;return sB(this,a,i,k)};Ax(Nsb,NB);Nsb[w].eca=function $JX(a,c){c=c.i_a;for(var d=0;d<c[u];d++)if(c[d].fQc()){a[101]=h;return}};Nsb[w].dca=function $KX(a,c){if(c.Ti[bd](HN))a[101]=h};SB(101,"Move to drafts",scb,Msb,function(b){return b==nz},function(){return Vo()});zD[w].Mod=k;Tsb[w].yYa=function $LX(){var a=uub;if(a&&a.Yt())return a.Yt().Lf;return k};Tsb[w].oi=function $MX(){var a=uub;if(a)return!a.vk();return k};gFa=new Tsb;Ax(Usb,UD);var yub="lsst",zub="lssecwin";Usb[w].LGa=function $NX(a){if(Vo()){a.set(yub,lub(PR)?1:0);a.set(zub,1)}};Usb[w].B2a=function $OX(a,c,d,f){if(Vo()){Pya(a,f);f.set(PD,c);d&&d[u]!=0&&f.set(QD,HFa(d));return h}else return k};var Aub={};F=HHa[w];F.ZRa=function $jx(){this.Q.w(this.ob,Hh,this.cVc,k,this)};F.q1b=Ge("cKa");F.Twb=Ge(bna);F.yeb=function $QX(){if(!this.mD){var a=this.yh||i;if(!a)return i;this.mD=a.yeb()}return this.mD};F.cVc=function $RX(){if(this.ob.ye())this.cKa=i;else this.lmb()};F.lmb=function $mx(){var a=this.yh||i;if((a=a&&a.Yt())&&this.cKa){a.Yvb(this.cKa);this.cKa=i;return h}return k};F.s1b=E(h);
+var Bub="TraceId",Cub="EndId",Dub="ParentId",Eub="Command",Fub="MessageId",Gub="OrigConversationId",Hub="ContactId",Iub="ChangeId",Jub="StartTime",Kub="TotalTime",Lub="TotalDbTime",Mub="Complete",Nub="AuxData",Oub="ConversationCount",Pub="MessageCount",Qub="ChangeCount",Rub="Value",Sub="---\n",Tub="ls-info";
+F.X0b=function $gx(a){if(this.yeb()){for(var c=[[Bub,Cub,Dub,Eub,Fub,Gub,Hub,Iub,cna,Jub,Kub,Lub,Mub,Nub],[Bub,Oub,Pub,Qub],[Bub,dna,Rub]],d=this.mD.OGc(50),f=new U,g=0;g<3;g++){var j=d[g];if(j[u]>0){f[R](c[g][kd](wj)+ch);for(var n=0;n<j[u];n++)f[R](j[n][kd](wj)+ch);f[R](Sub)}}a[Tub]=f[t]()}};F.tRb=function $ex(a){if(!Ye(a)&&a.Hrd){a=a.Hrd;if(a in Aub)return Aub[a]}return ti};NF[w].i1b=function $lA(a){if(!this.wd){var c=jA(this.B(),Od);if(c)this.wd=c.OO();if(!this.wd)return}CD()?this.wd.otc(a.yL,a.m3b,a.o2b,a.dQb,a.F2b):this.wd.BDa()};var Uub=Ki[1],QR=Ki[2],Vub=Ki[3],RR=Ki[4],Wub=Ki[5],Xub=Ki[6],Yub=Ki[9],Zub=Ki[10],avb=Ki[11],bvb=Ki[12],cvb=Ki[13],dvb=Ki[14],SR=Ki[15];H(Vsb,uh);F=Vsb[w];F.p_=function $SX(a){this[r](new Wsb(eg,a))&&Ve(a[Lc])&&a[Lc][u]==2&&mm(a[Lc][0])&&this[r](new Wsb(Cr,a))};F.Xa=i;F.wc=function $TX(a){if(this.Xa!=i)e(Error(".176"));this.Xa=a;this.JR.fFa[this.ea()]=this};nma(F,function $UX(a){this.JR[Xq](a,this)});F.ea=function $VX(){if(this.Xa==i)e(Error(".177"));return this.Xa};F.L=function $WX(){Vsb.C.L[z](this);delete this.JR.fFa[this.ea()];this.JR=i};H(Wsb,N);H(Xsb,uh);F=Xsb[w];F.JR=i;var evb="beta.workerpool";F.SFc=function $XX(){return Io()[tc](evb)};F.createWorkerFromUrl=function $YX(a){a=this.JR[Csb](a);a=new Vsb(this,a);return this.fFa[a.ea()]=a};nma(F,function $ZX(a,c){this.JR[Xq](a,c.ea())});var fvb="uknown_worker";F.Sua=function $_X(a,c,d){if(!this.Pc){a=this.fFa;a[c]||this[r](new Ysb(fvb,c,d));(c=a[c])&&c.p_(d)}};F.L=function $0X(){Xsb.C.L[z](this);this.JR=i;delete this.fFa};H(Ysb,N);H(Zsb,qR);F=Zsb[w];F.ng=k;F.gy=k;F.Nv=h;F.wq=i;F.j_=E(1);F.Z5=function $2X(){return Number(this.jm())};F.Eb=D(Ej);F.jm=D("gy");F.ye=D(Afb);F.Xn=D("wq");Qa(F,function $7X(){if(this.ng)e(Error(".175"));this.Wma()});var gvb="iscaptured";F.Wma=function $8X(){if(!this.KR){this.KR=(new Xsb)[Csb](this.eFa);this.na.w(this.KR,eg,this)}this.ng=h;this.gy=k;this.Nv=h;this.wq=i;this.KR[Xq](gvb)};var hvb=":443",ivb="iscaptured-no",jvb="capture",kvb="capture-fail-",lvb="iscaptured-yes",mvb="capture-ok",nvb=".179`";
+ya(F,function $9X(a){var c=a.O0b||{},d=a[Tq];a[zb]();a=c.origin;if(a!=this.jda)if(!(/^https\:/[cb](a)&&!/\:\d+$/[cb](a)&&a+hvb==this.jda))e(Error(".178`"+a+qw+this.jda));if(d==ivb)this.KR[Xq](jvb);else{a=Mf(d,kvb);if(d==lvb||d==mvb||a){if(this.wq=(this.Nv=!a)?i:d[nc](13)){ME.yI(Error(nvb+this.eFa+qw+this.wq),Sma);if(this.TRa(this.wq))return}this.ng=k;this.gy=h;this.Nv&&this.eqa();this[r](tr);this[r](fo)}}});
+F.L=function $$X(){Zsb.C.L[z](this);this.na.D();this.na=i;if(this.KR){this.KR.D();this.KR=i}};_B_prog(85)}catch(e){_B_err(e)}
+
+try{H(atb,Jf);F=atb[w];Ba(F,"Base");dp(F,1);F.GF=[];F.R2=B();F.HP=B();F.kta=B();F.dPa=B();var ovb="unknown exception",pvb="StoreVersionInfo",qvb="StoreName TEXT NOT NULL PRIMARY KEY",rvb="Version INTEGER NOT NULL";
+F.cA=function $eY(){var a=this.ANa();if(a){if(a!=this[Za]){this.kf.mn();try{this.R2(a);ctb(this,this[Za]);GR(this.kf)}catch(c){this.kf.xm(c);e(Error(".180`"+this[ec]+qw+a+qw+this[Za]+qw+(c[Tq]||ovb)))}}}else{this.kf.mn();try{this.Xra(this.GF);this.Oqa(this.GF);this.Oqa([{type:1,name:pvb,uq:[qvb,rvb]}],h);this.HP();ctb(this,this[Za]);GR(this.kf)}catch(d){this.kf.xm(d);e(Error(".181`"+this[ec]+qw+(d[Tq]||ovb)))}}this.kta();this.dPa()};
+F.removeStore=function $fY(){this.kf.mn();try{this.nWa();this.Xra(this.GF);GR(this.kf)}catch(a){this.kf.xm(a);e(Error(".182`"+this[ec]+qw+(a[Tq]||ovb)))}};va(F,D(YP));var svb="SELECT Version FROM StoreVersionInfo WHERE StoreName=?";F.ANa=function $hY(){try{return this.kf.Kr(svb,this[ec])||0}catch(a){return 0}};var tvb="DELETE FROM StoreVersionInfo WHERE StoreName=?";F.nWa=function $iY(){try{this.kf[hd](tvb,this[ec])}catch(a){}};
+F.Oqa=function $jY(a,c){this.kf.mn();try{for(var d=0;d<a[u];++d)this.kf[hd](xtb(this,a[d],c));GR(this.kf)}catch(f){this.kf.xm(f)}};F.Xra=function $kY(a){this.kf.mn();try{for(var c=a[u]-1;c>=0;--c)this.kf[hd](Btb(this,a[c]));GR(this.kf)}catch(d){this.kf.xm(d)}};F.ova=function $lY(a){return Dtb(this,Bo,a)};F.xha=function $mY(a){return Dtb(this,Dr,a)};F.L=function $nY(){atb.C.L[z](this);this.kf=i};H(FR,uh);H(Ftb,N);FR[w].QBb=h;FR[w].xL=0;FR[w].pya=k;FR[w].BAc="IMMEDIATE";var uvb={DEFERRED:0,IMMEDIATE:1,EXCLUSIVE:2};F=FR[w];F.uLb=uvb.DEFERRED;Va(F,function $oY(a){a=String(a);var c;try{if(arguments[u]==1)return this.kf[hd](a);c=arguments[u]==2&&Ve(arguments[1])?arguments[1]:qf(arguments,1);return this.kf[hd](a,c)}catch(d){if(c)a+=Jl+zh(c);e(Fba(d,a))}});F.KAa=function $pY(a){return Ltb(this,a,Gtb,arguments,1)};F.Zka=function $qY(a){return Ltb(this,a,Htb,arguments,1)};
+F.Kr=function $rY(a){return Ltb(this,a,Itb,arguments,1)};F.Xcd=function $sY(a){return Ltb(this,a,Jtb,arguments,1)};F.MEc=function $tY(a,c,d){var f=Ktb(this,a,arguments,3);try{for(var g=0,j=f.fieldCount(),n=[],s=0;s<j;s++)n[p](f.fieldName(s));for(var v;f[xR]();){v=[];for(s=0;s<j;s++)v[p](f[aq](s));if(!c[z](d,v,g,n))break;f[Rk]();g++}}finally{f[Xk]()}};var vvb="beforebegin",wvb="BEGIN ";
+F.mn=function $uY(){var a;a:{a=this.BAc;if(this.QBb)if(this.xL==0){this.pya=k;this[r](new Ftb(vvb));this.kf[hd](wvb+a);this.uLb=uvb[a];this.xL=1;try{this[r](new Ftb(Gaa))}catch(c){this.kf[hd](Mtb);this.xL=0;e(c)}a=h;break a}else if(this.pya)e(Error(".185"));else if(uvb[a]>this.uLb)e(Error(".186"));else this.xL++;a=k}return a};F.xm=function $vY(a){var c=h;if(this.QBb){if(this.xL<=0)e(Error(".187"));if(this.xL==1)c=Stb(this,h);else{this.xL--;this.pya=h;if(a)e(a);return k}}return c};
+F.open=function $wY(){if(this.kf&&this.hbc)this.kf[bb](this.hbc);else e(Error(".188"))};Fp(F,function $xY(){this.kf&&this.kf[Xk]()});F.L=function $yY(){FR.C.L[z](this);this.kf=i};wa(F,function $zY(){this.kf[Pb]()});H(HR,FR);var TR={Ux:1,dAd:2,C1a:3,Gsd:4,Xrd:5,Hsd:6,Yrd:7,Fsd:8,Wrd:9};F=HR[w];F.Wbd=function $AY(){if(this.mD&&this.wk){this.mD.Qed(this.wk);this.wk=i}for(var a=0;a<this.wBa[u];a++)this.wBa[a]();Ia(this.wBa,0);Ia(this.pqa,0)};F.Tbd=function $BY(){for(var a=0;a<this.pqa[u];a++)this.pqa[a]();Ia(this.wBa,0);Ia(this.pqa,0)};F.ova=function $CY(a){return this.Dc.ova(a)};F.xha=function $DY(a){return this.Dc.xha(a)};F.Oqa=function $EY(a,c){this.Dc.Oqa(a,c)};F.Xra=function $FY(a){this.Dc.Xra(a)};F.wk=i;
+F.Rbd=function $GY(){this.mD&&this.mD.Add()};F.xm=function $HY(a){this.wk=a||i;return HR.C.xm[z](this,a)};F.L=function $IY(){HR.C.L[z](this);Ia(this.wBa,0);Ia(this.pqa,0);this.na.D();this.na=i;this.Dc.D();this.mD=this.Dc=i};H(IR,Jf);F=IR[w];Ba(F,"Base");dp(F,Hj);F.GF=[];F.ycb=D(FZa);F.R2=B();F.HP=B();F.kta=B();F.dPa=B();F.cA=function $OY(){var a=this.SF.ANa(this[ec]);if(a){if(bg(a,this[Za])!=0){this.yb.mn();try{this.R2(a);GR(this.yb)}catch(c){this.yb.xm(c)}}}else{this.yb.mn();try{this.yb.Oqa(this.GF);this.HP();var d=this.SF.ycb();d.mn();try{KR(this.SF,this[ec],this[Za]);GR(d)}catch(f){d.xm(f);e(f)}GR(this.yb)}catch(g){this.yb.xm();e(Error(".189`"+this[ec]+qw+g[Tq]))}}this.kta();this.dPa()};
+F.removeStore=function $PY(){this.yb.mn();try{this.SF.nWa(this[ec]);this.yb.Xra(this.GF);GR(this.yb)}catch(a){this.yb.xm(a);e(Error(".190`"+this[ec]))}};F.L=function $QY(){IR.C.L[z](this);this.SF=this.yb=i};H(JR,IR);F=JR[w];Ba(F,"StateStore");var xvb="2.2";dp(F,xvb);F.GF=[{type:TR.Ux,name:"StateInfo",uq:["ClientId INTEGER NOT NULL","MappedIdCounter INTEGER NOT NULL","FirstLoad INTEGER DEFAULT 1","ServerMode TEXT"]},{type:TR.Ux,name:pvb,uq:[qvb,"Version TEXT NOT NULL"]}];var yvb="2.1",zvb="ALTER TABLE StateInfo ADD COLUMN FirstLoad INTEGER DEFAULT 1",Avb="ALTER TABLE StateInfo ADD COLUMN ServerMode TEXT",Bvb="UPDATE StateInfo SET ServerMode=?",Cvb="SELECT ServerMode FROM StateInfo LIMIT 1";
+F.R2=function $RY(a){if(bg(a,yvb)<0){this.yb.mn();try{this.yb[hd](zvb);KR(this,this[ec],yvb);GR(this.yb)}catch(c){this.yb.xm(c);e(Error(".191`"+this[ec]))}}if(bg(a,xvb)<0){this.yb.mn();try{this.yb[hd](Avb);this.yb[hd](Bvb,GA);KR(this,this[ec],xvb);GR(this.yb)}catch(d){try{this.yb.Kr(Cvb);this.yb[hd](Bvb,GA);KR(this,this[ec],xvb);GR(this.yb)}catch(f){this.yb.xm(d);e(Error(".192`"+this[ec]))}}}};var Dvb="INSERT INTO StateInfo (ClientId,MappedIdCounter,FirstLoad,ServerMode) VALUES(0,0,1,?)",Evb="INSERT INTO StoreVersionInfo (StoreName, Version) VALUES(?,?)";
+F.HP=function $SY(){this.yb[hd](Dvb,GA);this.yb[hd](Evb,this[ec],this[Za])};var Fvb="SELECT FirstLoad FROM StateInfo";F.EXb=function $TY(){return!!this.yb.Kr(Fvb)};F.ANa=function $UY(a){try{return this.yb.Kr(svb,a)||i}catch(c){return i}};F.nWa=function $VY(a){try{this.yb[hd](tvb,a)}catch(c){}};var Gvb="SELECT ClientId FROM StateInfo";F.vO=function $WY(){return this.yb.Kr(Gvb)};_B_prog(86)}catch(e){_B_err(e)}
+
+try{H(Wtb,Jf);F=Wtb[w];F.sN=-1;F.L=function $XY(){Wtb.C.L[z](this);this.ob&&nh(this.ob,Hh,this.cva,k,this);this.sN!=-1&&this.Dc[yR](this.sN)};Qp(F,function $YY(a,c){Ia(this.T2,0);for(var d=this.Tr.vc(),f=0;f<c[u];f++){var g=c[f];if(this.Tr[bd](g))d[Pb](g);else{this.Tr.add(g);this.NM.add(g)}}c=d.Oa();for(f=0;f<c[u];f++){g=c[f];this.Dc[Pb](g);this.Tr[Pb](g);this.NM[Pb](g);this.R3==g&&this.Dc[yR](this.sN)}dp(this,a);wR(this,this.NM.Nb()==0);this.T2=this.NM.Oa()});Pp(F,function $ZY(){this.T2=this.NM.Oa()});
+F.jbb=function $_Y(a,c){Eh(this.hD);this.hD=0;this.sN=-1;if(c){this.R3=i;this.T2[jd](0,1);this.NM[Pb](a);wR(this,this.NM.Nb()==0);this.pIa&&this.pIa(this,h,h)}else{if(!this.ob){this.ob=new Gh;ih(this.ob,Hh,this.cva,k,this)}this.ob[Mb](this.R3,ena)}};F.fMc=function $0Y(){this.Dc[yR](this.sN);this.sN=-1;this.Po(h)};F.Po=function $1Y(a){this.R3=i;a||this.T2[jd](0,1);this.pIa&&this.pIa(this,k,!a)};
+F.cva=function $2Y(a){a=a[y];if(a.ye())this.Po(k);else{var c=a.hf();if(a.eo!=Dj)this.Po(c!=404&&(c<=300||c>=400))}};wa(F,function $3Y(){this[yR]();this.fF.removeStore(this.Dc[ec])});F.abortCapture=function $4Y(){if(this.sN!=-1){this.Dc[yR](this.sN);this.sN=-1}else this.R3&&this.ob[wc]();this.R3=i};H(Xtb,IR);F=Xtb[w];Ba(F,"UrlStore");dp(F,YQ);F.ZSa=0;F.YSa=0;F.VSa=0;F.yx=k;F.Cgb=k;F.rLa=k;F.L=function $5Y(){if(this.RE){for(var a=this.RE.Oa(),c=0;c<a[u];c++)a[c].D();this.RE=i}this.Fh.D();Xtb.C.L[z](this)};F.GF=[{type:TR.Ux,name:"UrlGroups",uq:["GroupId TEXT PRIMARY KEY NOT NULL","Version TEXT NOT NULL","Captured INTEGER DEFAULT 0 CHECK (Captured IN (0, 1))","UrlProtoStr TEXT NOT NULL"]}];F.Ya=D(lO);F.kta=function $7Y(){aub(this);Ytb(this)};var Hvb="UPDATE UrlGroups SET Captured=? WHERE GroupId=?";
+F.nzc=function $8Y(a){var c=a[0],d=a[1],f=a[2];a=eval(a[3]);d=new Wtb(this.fF,this.AR,this.nGb,c,d,f,a);f!=d[zR]&&this.yb[hd](Hvb,Number(d[zR]),c);d[zR]||this.zK[p](d);this.RE.set(c,d);return h};Qa(F,function $9Y(){if(!this.yx){Ytb(this);this.Cgb=this.yx=h;cub(this)}});Ga(F,function $$Y(){this.yx&&this.zK[u]&&this.zK[0][yR]();this.yx=k});var Ivb="DELETE FROM UrlGroups";wa(F,function $aZ(){this[qc]();aub(this);for(var a=this.RE.Oa(),c=0;c<a[u];c++){var d=a[c];d[Pb]();d.D()}this.RE[bc]();this.yb[hd](Ivb)});
+var Jvb="UPDATE UrlGroups SET Captured=1 WHERE GroupId=?";F.jbb=function $bZ(a,c,d){if(d){this.YSa--;c||this.VSa++;if(this.zK[0].T2[u]==0){a[zR]&&this.yb[hd](Jvb,a.id);this.zK[jd](0,1)}this.Fh[r](zr);cub(this)}else{this.yx=k;this.rLa=h;this.Fh[r](bub)}};F.j_=D("ZSa");F.Z5=function $dZ(){return this.ZSa-this.YSa};F.jm=function $eZ(){return this.Cgb&&!this.yx};F.Eb=D(Meb);F.ye=function $gZ(){return this.VSa==0&&!this.rLa};
+var Kvb="Could not successfully contact the server",Lvb="Could not fetch the following urls:",Mvb="\n ";F.Xn=function $hZ(){if(this.rLa)return Kvb;else if(this.VSa>0){for(var a=[Lvb],c=this.RE.Oa(),d=0;d<c[u];d++)of(a,c[d].NM.Oa());return a[kd](Mvb)}else return i};H(dub,qR);F=dub[w];F.tla=i;F.ld=i;F.yac=k;F.yWa=k;F.ng=k;F.j_=function $iZ(){return this.Dc.j_()};F.Z5=function $jZ(){return this.Dc.Z5()};F.jm=function $kZ(){return this.yWa||this.Dc.jm()};F.ye=function $lZ(){return!this.yWa&&!this.Dc.rLa};F.Xn=function $mZ(){return this.tla||this.Dc.Xn()};Qa(F,function $nZ(){this.ng=h;this.yWa=k;this.Wma()});var Nvb="startInternal after complete success";
+F.Wma=function $oZ(){if(!(this.ld||this.Dc.Eb()))if(!this.yac||this.tla)this.Ex();else!this.Dc.jm()||!this.Dc.ye()?this.Dc[Rc]():ME.yI(Fba(Nvb))};F.Eb=D(Ej);var Ovb="Sending UrlStore request";F.Ex=function $qZ(){var a=new zD(this.Hn,this);a.bD(k);a.wl(h);a.Ne(mB);a.Ua(pd,fna);a.Ua(ZB,mi(MO,I));for(var c=[],d=[],f=this.Dc.RE.Oa(),g=0;g<f[u];g++){var j=f[g],n=[];n[1]=j.id;n[2]=j[Za];n[3]=[];c[p](n)}d[1]=c;a.Be(RE,zh(d));a.Se(Ovb);this.ld=a;this.tla=i;a[Mb]()};
+var Pvb="UPDATE UrlGroups SET Version=?, Captured=?, UrlProtoStr=? WHERE GroupId=?",Qvb="INSERT INTO UrlGroups (GroupId, Version, Captured, UrlProtoStr) VALUES (?, ?, ?, ?)",Rvb="DELETE FROM UrlGroups WHERE GroupId=?";
+F.rk=function $rZ(a,c,d){if(c==fna){a=this.Dc;d=d[1];a.yx&&a.zK[0][yR]();var f=d[1],g=a.RE.vc();if(f&&f[u]!=0)for(d=0;d<f[u];d++){var j=f[d];c=j[1];var n=j[3],s=j[2];if(j=a.RE.J(c)){g[Pb](c);if(s!=j[Za]){j[mr](s,n);a.yb[hd](Pvb,j[Za],Number(j[zR]),zh(n),c)}}else{j=new Wtb(a.fF,a.AR,a.nGb,c,s,n[u]==0,n);a.RE.set(c,j);a.yb[hd](Qvb,c,j[Za],Number(j[zR]),zh(n))}j[zR]||a.zK[p](j)}f=g.Oa();for(d=0;d<f[u];d++){j=f[d];c=j.id;j[Pb]();j.D();a.RE[Pb](c);a.yb[hd](Rvb,c)}Ytb(a);a.yx&&cub(a);this.Dc[Rc]()}};
+var Svb="UrlStore request error: ";F.Z6=function $sZ(a){this.ld=i;if(a.oha()){this.tla=Svb+a.zga();ME.yI(Error(this.tla));if(!this.TRa(this.tla)){this.yWa=h;this.gy()}}};var Tvb="Failed to capture URLs";ya(F,function $tZ(a){if(a[Zb]==zr)this[r](tr);else if(a[Zb]==bub){if(!this.Dc.ye()){a=this.Dc.Xn()||I;ME.yI(Error(a),Tvb);if(this.TRa(a))return}this.gy()}});F.gy=function $uZ(){this.yac=this.ng=k;this.eqa();this[r](fo)};F.L=function $vZ(){dub.C.L[z](this);this.na.D();this.Dc=this.na=i};H(LR,rR);LR[w].iTc=i;LR[w].kTc=i;LR[w].jTc=i;var jub=/\/b\/[^/]+/;LR[w].L=function $wZ(){LR.C.L[z](this);if(this.iF){this.iF.D();this.iF=i}if(this.jF){this.jF.D();this.jF=i}if(this.hF){this.hF.D();this.hF=i}if(this.eG){this.eG.D();this.eG=i}if(this.IBb){this.IBb.D();this.IBb=i}};LR[w].Ac=function $xZ(a){this.iF.qy()||this.iF[tc]();this.iF.Ac(a);if(this.kla){this.hF.qy()||this.hF[tc]();this.hF.Ac(a)}if(a){this.jF.qy()||this.jF[tc]();this.jF.Ac(a)}};
+wa(LR[w],function $yZ(){this.iF[Pb]();this.jF[Pb]();this.kla&&this.hF[Pb]();this.eG[Pb]()});H(kub,Jf);F=kub[w];F.K3=Mj[t]()[Kb](/[^\?#]+/)[0];F.kWc=i;F.rFa=QR;F.LX=Hi;F.VDb=SR;F.woa=RR;F.Db=i;F.U4=-1;var Uvb="lsDur",Vvb="lsIn",Wvb="lsDurEx";
+F.wc=function $zZ(a,c){this.Db=a;a=new Sh(Mj);var d=a.td();if(d){d=new Wh(Rf(d));var f=d.J(Uvb),g;if(f&&!ia(g=Number(f))){this.U4=g;this.Jsc=d.Oa(Vvb);this.pE=d.Oa(Wvb)}}g=[];if(Xub){d=Xub[Cc](Er);for(var j=0;j<d[u];j++)if(!(d[j][u]<1)){f=d[j][Cc](wj,2);f[u]==2&&g[p]([f[0],f[1]])}}this.kWc=g;g=O.S();g.bk.lu.Lr(this.lJc,this);if(Vo()){g.uHa=k;this[pb](c)}else{a.td()==gna&&Mx().oz(6,G(PR.Syc,this));c()}};F.Syc=function $AZ(){var a=RC(this.Db);a=kA(a.iL.B(),KF);Zw(a,function(c){c.gLa()})};
+na(F,function $BZ(a){Vw(O.S(),XL,G(this.TNc,this,a))});F.lJc=function $CZ(){O.S().bk.lu.HC.jC().iVc()};F.TNc=function $DZ(a){O.S().bk.lu.HC.jC().wc(a)};F.Yt=function $EZ(){var a=jA(this.Db,Od);return a&&a.Yt()||i};var PR=new kub;hfb[p](G(PR.wc,PR));_B_prog(87)}catch(e){_B_err(e)}
+
+try{zx(mub,PLa);F=mub[w];F.E_b=10;F.Y8a=k;F.Oxa=function $FZ(){var a=this.NP();if(a=a&&a.Yt())this.Xp.Ggb=2E4;return a};F.NP=function $GZ(){if(!this.yh){var a=PR.Db;this.yh=a&&jA(a,Od)}return this.yh};F.ojb=function $HZ(){if(!Vo())return k;var a=this.NP()?this.yh.B0b():h,c=this.Oxa(),d=this.fDa&&this.fDa.Rwa();return a&&!c&&this.E_b-- >0||!!d};var UR="connected";F.vqb=function $IZ(){if(this.Dxa!=this.Xp.YR){this.NP()&&this.yh.bCa(UR);return h}};
+F.bQ=function $JZ(a){if(!Vo())return k;if(a.hm()==100&&this.Xp.qG!=11)return k;if(this.Xp.YR==this.Dxa)return k;if(!qub(this.Dxa,this.Xp.ld))return k;this.Y8a=h;this.NP()&&this.yh.bCa(Fr);this.Y8a=k;if((a=this.Oxa())&&a.Lf){lIa(this.Xp,2,h);this.Xp.KS=i;this.Xp.EG(Seb);return h}if(--this.E_b>0){lIa(this.Xp,mub.Sxd,h);this.Xp.KS=i;this.Xp.EG(Seb);return h}return k};F.D=function $KZ(){if(this.qlb){nh(this.qlb,SK,this.Pgc,k,this);this.qlb=i}};
+F.iX=function $LZ(){this.fDa=new fIa(this.w7c,this);var a=new Sh(XE);bi(a);this.fDa.sYa(a);this.fDa[xc](4E3);this.fDa[Rc]();return h};F.ncc=function $MZ(){this.NP().Hid(this.lWc)};F.w7c=function $NZ(a){this.lWc=a;this.NP()?this.ncc():Mx().oz(100,G(this.ncc,this))};F.Eoa=function $OZ(a){ih(a,SK,this.Pgc,k,this);this.qlb=a};F.Pgc=function $PZ(){this.NP()&&!this.yh.vk()&&this.Xp.xc()==ZE&&this.Xp.YR!=this.Dxa&&!this.Y8a&&this.Xp[wc](this.Xp.ld,11)};F.e2a=function $QZ(){return this.Xp.YR==this.Dxa};
+F.J5a=function $RZ(){if(this.Oxa()){if(this.Xp.ld.Ayb)return k;this.Xp.i3(this.Xp.ld,1);return h}return k};F.dBa=function $SZ(a){mIa(this.Xp,a);this.Dxa=a};F.bfb=function $TZ(a,c){if(Vo()&&(a==vL||a==oy)){this.Xp.b1(this.Xp.ld,[c]);return h}return k};nG("oc_d");nG("oc_h");var Xvb=nG("oc_ea"),Yvb=nG("oc_es"),Zvb=nG("oc_sn"),awb=nG("oc_ln"),bwb=nG("oc_cn"),cwb=nG("oc_os"),dwb=nG("oc_ps"),ewb=nG("oc_rs"),fwb=nG("oc_do"),gwb=nG("oc_rn");H(NR,YF);NR[w].bF=k;var nub=0;NR[w].Ana=0;var hwb="response";NR[w].D=function $UZ(){NR.C.D[z](this);if(this.Xw){nh(this.Xw,hwb+this.Ana,this.M0,k,this);nh(this.Xw,Kh+this.Ana,this.J0,k,this);this.Xw=i}};NR[w].NP=function $VZ(){if(!this.yh){var a=gQ;this.yh=a&&jA(a,Od)}return this.yh};NR[w].Oxa=function $WZ(){if(!this.Xw){var a=this.NP();if(this.Xw=a&&a.Yt()){ih(this.Xw,hwb+this.Ana,this.M0,k,this);ih(this.Xw,Kh+this.Ana,this.J0,k,this)}}return this.Xw};var OR={};OR.rd=h;OR.ur=h;OR.arl=h;OR.st=h;
+OR.xst=h;OR.sp=h;OR.tr=h;OR.dm=h;OR.dr=h;OR.dd=h;OR.dl=h;OR.dl=h;OR.dl=h;OR.us=h;OR.rp=k;OR.np=k;OR.ac_=h;OR.rc_=h;OR.ib=h;OR.mt=h;OR.ig=h;OR.sm=h;OR.sd=h;OR.cf=k;OR.ii=k;OR.prefs=h;OR.ivd=k;OR.astc=k;OR.urt=h;OR.rap=k;OR.mcf_=k;OR.dcf_=k;OR.cce=k;OR.cma_=k;OR.dma_=k;OR.dt=h;OR.rtr=h;OR.aser=k;OR.her=k;OR.ere=k;OR.cc_=h;OR.dc_=h;OR.nc_=h;OR.df=k;OR.rf=k;OR.crte=k;OR.ae_=k;OR.de_=k;OR.co_=k;OR.cffm=k;OR.ch_=h;OR.fl=h;OR.mtd=h;OR.ms=h;OR.fs=h;OR.cs=h;F=NR[w];var iwb="lss",jwb="aup";
+F.wma=function $XZ(a){if(!Vo())return 0;var c=this.Oxa(),d=Rz(gQ);if(c&&(oub(this,a)||a.Rc(pd)==QN&&a.Rc(fG)==JO||a.Rc(pd)==QN&&a.Rc(fG)==AO&&a.Rc(hna)==HN||pub(this,a)))return 1;if(c&&Jz(d,850)&&(sub(this,a)||a.Rc(pd)==QN&&a.Rc(fG)==rO||a.Rc(pd)==QN&&a.Rc(fG)==OL))return 1;if(!c||!c.Lf)return 0;if(a.Rc(pd)==iwb||a.Rc(pd)==jwb||a.Rc(Amb)==Hj&&a.Rc(pd)==OD)return 0;c=this.NP();if(qub(this,a)||!a.Mod&&!c.vk())return 0.9;rub(this,a);return 0};
+F.Po=function $YZ(a,c){a=new nB(this.P5(),a,c);c=this.H();c.bQ(a);c.Uba();this.bF=k;this.FRc=h};F.NEc=function $ZZ(){this.Po(13,k)};F.FAb=function $_Z(a){this.ld=a;if(qub(this,a)){this.H().uFb();var c=mi(lG,void 0);c&&this.Xw.Ghd(c);(c=Uj&&mi(Uj,void 0))&&this.Xw.Ohd(c);this.Xw.Ola(a,this.Ana);this.bF=h;this.FRc=k}else{rub(this,a);Dh(this.NEc,1,this)}};F.M0=function $0Z(a){var c=this.H();c.cfb(a[dq]);Isb(lG);Uj&&Isb(Uj);c.WH();c.Uba();this.bF=k};F.J0=function $1Z(a){this.Po(14,!!a[dq][0])};La(F,function $2Z(){e(Error(".0"))});AMa[w].Y0b=function $pC(a){this.LSc=new NR;a.dBa(this.LSc)};YI[w].BFb=function $rK(a){Vo()&&cxa(a,HN,AL)};YI[w].AFb=function $sK(a){Vo()&&a[p](HN)};YI[w].CFb=function $qK(a){if(Vo()){var c=jA(this.B(),Od);c=c&&c.OO();for(var d,f=0;f<a[u];f++)switch(a[f][0]){case HN:c&&c.sdc(a[f]);return;case CL:d=f;break}var g;if(c)g=c.y7b;if(!g||g[u]==0){if(!tub){g=nf(iTa);g[0]=HN;tub=g}g=tub}km(a,g,d)}};qJ[w].jmb=function $YL(a){return a+ina};var uwb="New messages will be forwarded as they arrive.";function vwb(b){this.O=b;this.O[1]=this.O[1]||[];this.u8=[];for(b=0;b<this.O[1][u];b++)this.u8[b]=new VR(this.O[1][b])}function wwb(b){this.O=b}function VR(b){this.O=b;this.O[2]=this.O[2]||[];this.O[3]=this.O[3]||[];this.Cac=[];for(b=0;b<this.O[3][u];b++)this.Cac[b]=new wwb(this.O[3][b])}
+function WR(b){if(b){this.Rj=b.O[0];this.Fd=b.EQb();var a=b.O[2];this.yw=[];for(var c=0;c<a[u];c++)this.yw[a[c]]=h;a=b.Cac;this.q1=[];for(c=0;c<a[u];c++)this.q1[a[c].Ga()]=a[c].Ca();this.Me=b.Dd()}}var xwb="migData";function ywb(b,a){Kx[z](this,xwb,b);this.Kk().w(a,Gx(Gr),this.A3c)}function zwb(b){this.Z=b}Ha(vwb[w],function $b_(){return this.O[t]()});vwb[w].kc=D(ae);wwb[w].Ga=function $d_(){return this.O[0]};wwb[w].Ca=function $e_(){return this.O[1]};Ha(wwb[w],function $f_(){return this.O[t]()});
+wwb[w].kc=D(ae);VR[w].EQb=function $h_(){return this.O[1]};VR[w].Dd=function $i_(){return this.O[4]};Ha(VR[w],function $j_(){return this.O[t]()});VR[w].kc=D(ae);F=WR[w];F.Vc=D("Rj");F.fCa=Ge("Rj");F.hf=D(Hr);F.hasFeature=function $o_(a){return!!this.yw[a]};F.Dd=D(AM);H(ywb,Kx);ywb[w].A3c=function $q_(a){var c=[];a=(new vwb(a[dq])).u8;for(var d=0;d<a[u];d++){var f=new WR(a[d]);c[p](f)}this.Fa(Gr,c)};zx(zwb,Gz);zwb[w].mib=function $r_(a,c){c=new ywb(a,c);a.ha(c)};function Iwb(b){this.Db=b}H(Iwb,Iw);var Jwb="OMNIBOX_LABEL_NAV_SHORTCUT_TASK";Iwb[w].tb=function $A_(){OF.Gi(jna,Jwb,kna);hlb.bq[p](Jwb)};Xw(O.S(),Kd).Lr(function(b){dD(b).qo(new Iwb(b))});function lxb(b){mF[z](this,b);this.Q=new kn(this);this.Hh=new hC(3E5,this.Db.J(XC));this.Q.w(this.Hh,zi,this.S8);this.Q.w(this.Hh,yi,this.R8)}var mxb=":29";function nxb(b){if(b.ab){cA(b.ab);b.ab=0}if(b.dX.x4!=b.pQ&&!CD()){bJa(b);b[r](bM)}b.ab=bA(mxb,b.ix,3E5,b)}H(lxb,mF);Nx(Mx(),48,function(b){return new lxb(b)},10);F=lxb[w];F.ab=0;F.S8=function $U_(){nxb(this)};F.R8=function $V_(){cA(this.ab);this.ab=0};F.ix=function $W_(){nxb(this)};
+F.D=function $X_(){if(this.Hh){this.Hh.D();this.Hh=undefined}if(this.ab){cA(this.ab);this.ab=0}lxb.C.D[z](this)};function Txb(b){this.na=void 0;this.cAb=new cg;this.ZWa=new Yo;this.gEa=[];this.w_a=[];this.w(fy(b).ud,Fx(Feb),this.n8c)}function Uxb(b){this.hsc=b}function Vxb(b,a){var c=b.bAb.gEa[u],d=l.min(c,5);if(c>0){c=qf(b.bAb.gEa,0,d);b=qf(b.bAb.w_a,0,d);d={};d.tart=c[kd](wj);d.tars=b[kd](wj);if(a instanceof Sh)for(var f in d)a.ka(f,d[f]);else a.gYa(d)}}function Wxb(b){this.Mr=b;this.xl=tE(b.B())}H(Txb,kn);
+Txb[w].n8c=function $40(a){a=a[dq];for(var c=1;c<a[u];c++){var d=a[c][0],f=a[c][1];if(!this.cAb[bd](d)){this.cAb.add(d);Vla(this.ZWa,f,d);this.ZWa.Nb()>20&&this.cAb[Pb](this.ZWa[Pb]())}}this.gEa=[];this.w_a=[];for(a=this.ZWa.vc();a.Nb()>0;){this.gEa[p](a.hQ());this.w_a[p](a.MA[0]&&a.MA[0].Dg());a[Pb]()}this.gEa[cq]();this.w_a[cq]()};_B_prog(88)}catch(e){_B_err(e)}
+
+try{zx(Uxb,CE);Uxb[w].tb=function $50(a){this.bAb=new Txb(a)};Uxb[w].e4a=function $60(a){a.ER==OD&&a.Am&&Vxb(this,a.uri)};zx(Wxb,dSa);Wxb[w].p3=function $70(a){if(!this.Mr.wf){var c=this.xl.tn(Uxb);Vxb(c,a)}};function nyb(b){var a=Dx(Cx(b));Kx[z](this,zna,a);b=fy(b).ud;this.Kk().w(b,Fx(DE),this.L_c)}function oyb(b){this.Db=b;this.Aa=Dx(Cx(b))}cM.sx_tl=fO;cM.bx_te=k;cM.bx_ta=h;H(nyb,Kx);nyb[w].L_c=function $b1(a){this.Fa(Hz,qf(a[dq],1))};nyb[w].tMa=function $c1(){return this.Ca(Hz)||"ar,bn,gu,hi,kn,ml,mr,ne,pa,ta,te,ur,fa"[Cc](wj)};H(oyb,Iw);oyb[w].tb=function $d1(){this.Aa.ha(new nyb(this.Db))};Uw(O.S(),function(b){dD(b).qo(new oyb(b))});function fS(b,a){this.yH=b;this.Fua=a}var pyb="Chat contacts",qyb="Family",ryb="Coworkers";function syb(b){Kx[z](this,"updates",b);this.Fa(Ah,new fS(Ah,Ana));this.Fa(Pj,new fS(Pj,pyb));this.Fa(Pd,new fS(Pd,Wma));this.Fa(Rd,new fS(Rd,qyb));this.Fa(kD,new fS(kD,ryb));this.IW(Rr,0);this.IW(Sr,0)}function tyb(b,a){for(var c in uyb)jf(a,uyb[c])}var vyb="act_oid";function gS(b){Gy[z](this,"updates_search",b);this.bTa=this.Rc(vyb)||I}function hS(b,a){this.Y=b;this.N0a=a}
+function wyb(b,a){b=a[Qb](PJ);fk(b,0);return b}function xyb(b,a){var c=om(a),d=wyb(b,Cg(c));function f(){Dh(function(){L&&c[Lc][Ek]();c[Lc][Bb](d,c[Lc][cc][0]);d[Ek]()},0)}b.bSa=new xm(b.Y.cb());ih(b.bSa,cj,f);f()}function yyb(b){var a;a=gm(b.Y);var c=b.Y.UO();a=new zyb(a.x,a.y,c[ib],c[id]);Km(b.LJ,a[Ck],a.top);Rm(b.LJ,a[ib],a[id])}function Ayb(b){var a=b.Y.cb()[Lc][A];b.urb=h;b.k3b=zw(a,td);Dm(a,td,yd)}function iS(b,a,c){c&&b.ka(a,c)}
+function zyb(b,a,c,d){ck(this,b);this.top=a;ka(this,c);Wa(this,d)}H(fS,uh);F=fS[w];F.Ieb=0;F.ea=D(Bna);va(F,D("Fua"));F.wi=function $j1(a){if(a!=this.Fua){this.Fua=a;this[r](oy)}};F.Ke=D("Ieb");F.jg=function $l1(a){if(a!=this.Ieb){this.Ieb=a;this[r](oy)}};H(syb,Kx);var uyb={Hvd:Rr,exd:Sr,ixd:TO,vmc:Cna,Koc:GO};F=syb[w];F.Rt=function $m1(a,c){var d=this.Ca(a);if(d)c&&d.wi(c);else{d=new fS(a,c||I);this.Fa(a,d)}return d};F.FT=function $n1(a){return this.Ca(a)?this.Rt(a).Ke():I};F.nNa=function $o1(){return this.Ca(TO)||"http://www.google.com/profiles/me"};F.Ddb=function $p1(){var a=this.J().Sb();tyb(this,a);jf(a,OL);jf(a,Tr);jf(a,Ah);jf(a,hQ);jf(a,Pj);return Li(a,G(function(c){return this.Rt(c)},this))};F.IW=function $q1(a,c){this.Fa(a,c)};
+F.V_a=function $r1(){this.IW(Sr,this.ncb(Rr))};F.ncb=function $s1(a){return this.Ca(a)};F.Naa=function $t1(a){this.Fa(Cna,a)};F.Gf=function $u1(){return this.Ca(Cna)};F.udc=function $v1(a){this.Fa(GO,a)};F.Vt=function $w1(){return this.Ca(GO)};H(gS,Gy);new Hf({obfuscatedId:vyb});new Hf({Kwd:vyb});F=gS[w];F.Xs=function $x1(){return"buzz/"+this.Rc(vyb)||I};va(F,E("Buzz"));F.XZ=D("bTa");F.iQa=function $A1(a){if(Ke(this.Uvb))return this.Uvb;return this.Uvb=this.bTa==Rz(a)[hq](XN)};F.FL=E(h);F.Qb=E(ey);var Byb={};hS[w].urb=k;var Cyb="-container-div",Dyb="position: absolute; z-index: 10",Eyb="-done-",Fyb="-bg",Gyb="position: absolute; background-color: #666;filter:alpha(opacity=50); opacity:0.5;width: 100%; height: 100%;",Hyb="display: none; position: absolute; border: 0;width: 100%; height: 100%;",Iyb="doneFunc",Jyb="posx",Kyb="posy",Lyb="posw",Myb="posh",Nyb="&gwt.hosted=";
+hS[w].fo=function $D1(a,c,d){var f=this.N0a+Cyb;if(this.Y.Qa(f))return k;this.LJ=this.Y.ba(T,{id:f,style:Dyb});this.Y.cb()[Lc][o](this.LJ);this.S7a=this.N0a+Eyb+Yf();this.Y.Ec()[this.S7a]=G(this.yrd,this,d);Ayb(this);this.LJ[o](this.Y.ba(T,{id:this.N0a+Fyb,style:Gyb}));this.LJ[o](wyb(this,this.Y));this.ZJa=new oC(this.Y.Ec());ih(this.ZJa,sj,G(this.KKc,this));var g=this.Y.ba(Td,{id:this.N0a+Dna,style:Hyb,scrolling:yP,tabIndex:Ur,allowTransparency:jg});this.LJ[o](g);this.LJ[o](wyb(this,this.Y));var j=
+L&&!vg(Ij);j||Dm(g,Vr,yd);mh(g,rj,G(function(){j||Dm(g,Vr,ud);xyb(this,g)},this));Dm(g,wd,pe);yyb(this);d=new Sh(a);d.ka(Iyb,this.S7a);if(c){iS(d,Jyb,c[Ck]);iS(d,Kyb,c.top);iS(d,Lyb,c[ib]);iS(d,Myb,c[id])}if(a=Zh(a,Wr)){d.bub(Wr);a=d[t]()+Nyb+a}else a=d[t]();g.src=a;return h};hS[w].KKc=function $E1(){Ua(this.LJ[x],xd);yyb(this);Ua(this.LJ[x],pe)};
+hS[w].yrd=function $F1(a,c){if(this.ZJa){this.ZJa.D();this.ZJa=i}if(this.bSa){this.bSa.D();this.bSa=i}this.Y[ad](this.LJ);this.LJ=i;if(this.urb){var d=this.Y.cb()[Lc][A];Dm(d,td,this.k3b)}this.urb=k;this.k3b=I;this.Y.Ec()[this.S7a]=i;this.ECd=k;a&&a(c)};Ie("goog.DialogWidgetLauncher.PseudoRect",zyb,void 0);O.S().gb(Kd);Ci(O.S(),Kd);var uLb="Tasks";function vLb(b,a,c,d){this.Ck=VC(b);this.Ck.yu.add(this);b=JB(b).zc();QF(b,a);this.Zb=new jB;this.CEd=i;mh(c,d,G(this.jEc,this))}function wLb(b){this.ap=[];typeof b==Qe?this.RGa(b):this.bpa(b)}
+function xLb(b,a,c,d,f){for(var g=new yLb,j=[d],n=-1,s=0,v=0,C=0;C<b.ap[u];C++)if(b.ap[C].ag>0){if(n<0&&b.ap[C].Aca){n=C;s=d;v=0}if(n>=0){var M=b.ap[C].ag;if(C==n){M-=v;v++;if(M==0)return 0}if(!zLb(b,a,j,b.ap[C],M,g)){C=n-1;j[0]=s}}else{n=-1;if(!zLb(b,a,j,b.ap[C],0,g))return 0}}else{n=-1;if(b.ap[C][jb][xb](0)==J){M=j[0];ALb(b,a,j);if(j[0]>M)continue}else if(a[Db](b.ap[C][jb],j[0])==j[0]){j[0]+=b.ap[C][jb][u];continue}return 0}a:{if(g.lOb!=undefined&&g.pe!=undefined&&g.lOb==0&&g.pe>0)g.pe=-(g.pe-1);
+g.pe!=undefined&&c[sq](g.pe);b=c[iq]();c[zq](1);g.Ge!=undefined&&c[qq](g.Ge);g.zea!=undefined?c[zq](g.zea):c[zq](b);if(g.zs==undefined)g.zs=c[xq]();if(g.iGb!=undefined&&g.iGb>0)if(g.zs<12)g.zs+=12;c[Pma](g.zs);g.Zw!=undefined&&c[Ama](g.Zw);g.zx!=undefined&&c[Jma](g.zx);g.fmb!=undefined&&c.setMilliseconds(g.fmb);if(f&&(g.pe!=undefined&&g.pe!=c[fr]()||g.Ge!=undefined&&g.Ge!=c[Cq]()||g.zea!=undefined&&g.zea!=c[iq]()||g.zs>=24||g.Zw>=60||g.zx>=60||g.fmb>=1E3))c=k;else{if(g.TAb!=undefined){f=c[sr]();c[gr](c[hc]()+
+(g.TAb-f)*60*1E3)}if(g.Msc){f=new Date;f[sq](f[fr]()-80);c[hc]()<f[hc]()&&c[sq](f[fr]()+100)}if(g.Aea!=undefined)if(g.zea==undefined){g=(7+g.Aea-c[Gq]())%7;if(g>3)g-=7;f=c[Cq]();c[zq](c[iq]()+g);if(c[Cq]()!=f)c[zq](c[iq]()+(g>0?-7:7))}else if(g.Aea!=c[Gq]()){c=k;break a}c=h}}return c?j[0]-d:0}function BLb(b,a){if(a.ag<=0)return k;b="MydhHmsSDkK"[Db](a[jb][xb](0));return b>0||b==0&&a.ag<3}function ALb(b,a,c){if(b=a[Zc](c[0])[Kb](/^\s+/))c[0]+=b[0][u]}
+function zLb(b,a,c,d,f,g){ALb(b,a,c);var j=c[0],n=d[jb][xb](0),s=-1;if(BLb(b,d))if(f>0){if(j+f>a[u])return k;s=CLb(b,a[Zc](0,j+f),c)}else s=CLb(b,a,c);switch(n){case XC:g.lOb=bV(b,a,c,bE.xDb);return h;case XD:a:{d=s;if(d<0){d=bV(b,a,c,bE.xca);if(d<0)d=bV(b,a,c,bE.wEb);if(d<0){g=k;break a}g.Ge=d}else g.Ge=d-1;g=h}return g;case eD:d=bV(b,a,c,bE.c2a);if(d<0)d=bV(b,a,c,bE.U1a);if(d<0)g=k;else{g.Aea=d;g=h}return g;case Kd:g.iGb=bV(b,a,c,bE.MCb);return h;case Wx:a:{s=s;var v;if(s<0){v=a[xb](c[0]);if(v!=
+tl&&v!=Qd){g=k;break a}c[0]++;s=CLb(b,a,c);if(s<0){g=k;break a}if(v==Qd)s=-s}if(!v&&c[0]-j==2&&d.ag==2){b=s;a=(new Date)[fr]()-80;c=a%100;g.Msc=b==c;b+=l[rb](a/100)*100+(b<c?100:0);g.pe=b}else g.pe=s;g=h}return g;case aE:d=s;if(d<0){d=bV(b,a,c,bE.dEb);if(d<0)d=bV(b,a,c,bE.xEb);if(d<0)g=k;else{g.Ge=d*3;g.zea=1;g=h}}else g=k;return g;case Pd:g.zea=s;return h;case YD:b=c[0]-j;g.fmb=b<3?s*l.pow(10,3-b):l[kb](s/l.pow(10,b-3));return h;case Yx:if(s==12)s=0;case jD:case aD:case cD:g.zs=s;return h;case Xx:g.Zw=
+s;return h;case ki:g.zx=s;return h;case ey:case cy:case Bz:if(a[Db](QFa,c[0])==c[0])c[0]+=3;b:if(c[0]>=a[u]){g.TAb=0;g=h}else{d=1;switch(a[xb](c[0])){case Qd:d=-1;case tl:c[0]++}j=c[0];s=CLb(b,a,c);if(s==0&&c[0]==j)g=k;else{if(c[0]<a[u]&&a[xb](c[0])==xj){v=s*60;c[0]++;j=c[0];s=CLb(b,a,c);if(s==0&&c[0]==j){g=k;break b}v+=s}else{v=s;if(v<24&&c[0]-j<=2)v*=60;else v=v%100+v/100*60}v*=d;g.TAb=-v;g=h}}return g;default:return k}}
+function CLb(b,a,c){b=a[Zc](c[0])[Kb](/^\d+/);if(!b)return-1;c[0]+=b[0][u];return da(b[0],10)}function bV(b,a,c,d){b=0;var f=-1;a=a[Zc](c[0])[od]();for(var g=0;g<d[u];g++){var j=d[g][u];if(j>b&&a[Db](d[g][od]())==0){f=g;b=j}}if(f>=0)c[0]+=b;return f}function yLb(){}Bi(O.S(),"sy151");_B_prog(89)}catch(e){_B_err(e)}
+
+try{vLb[w].sK=function $Kla(){if(this.Zb)return[this.Zb];return[]};vLb[w].jEc=function $Lla(){this.Zb=i;WC(this.Ck);this.Ck.yu[Pb](this)};wLb[w].bpa=function $Mla(a){for(var c=k,d=I,f=0;f<a[u];f++){var g=a[xb](f);if(g==J){if(d[u]>0){this.ap[p]({text:d,ag:0,Aca:k});d=I}for(this.ap[p]({text:J,ag:0,Aca:k});f<a[u]-1&&a[xb](f+1)==J;)f++}else if(c)if(g==Ox)if(f+1<a[u]&&a[xb](f+1)==Ox){d+=Ox;f++}else c=k;else d+=g;else if("GyMdkHmsSEDahKzZvQ"[Db](g)>=0){if(d[u]>0){this.ap[p]({text:d,ag:0,Aca:k});d=I}var j;j=a[xb](f);for(var n=f+1;n<a[u]&&a[xb](n)==j;)n++;j=n-f;this.ap[p]({text:g,ag:j,Aca:k});f+=j-1}else if(g==Ox)if(f+1<a[u]&&a[xb](f+1)==Ox){d+=
+Ox;f++}else c=h;else d+=g}d[u]>0&&this.ap[p]({text:d,ag:0,Aca:k});a=k;for(c=0;c<this.ap[u];c++)if(BLb(this,this.ap[c])){if(!a&&c+1<this.ap[u]&&BLb(this,this.ap[c+1])){a=h;this.ap[c].Aca=h}}else a=k};wLb[w].RGa=function $Nla(a){if(a>11)a=10;this.bpa(a<4?bE.soa[a]:a<8?bE.CFa[a-4]:bE.soa[a-8]+J+bE.CFa[a-8])};wLb[w].parse=function $Ola(a,c,d){return xLb(this,a,c,d||0,k)};O.S().gb("sy151");Ci(O.S(),"sy151");Bi(O.S(),"sy150");function pY(b){this.Qzb=b}H(pY,xx);F=pY[w];F.QRa=B();F.QRa.Vd=h;F.PRa=B();F.PRa.Vd=h;F.BJa=B();F.BJa.Vd=h;O.S().gb("sy150");Ci(O.S(),"sy150");var OAc='" type="text" autocomplete="off" ignoreesc="true" title="',PAc='" label="';function kY(b,a){nn[z](this,a);this.Me=b||I}function QAc(b){if(!b.QEc&&b.Q&&b.b()[sk]){b.Q.w(b.b()[sk],oj,b.NIc);b.QEc=h}}function lY(b){return b.b()[q]!=I&&b.b()[q]!=b.Me}function RAc(b){if(b[xb](0)==tl)return b;b=b[mb](/\D/g,I);b=b[xb](0)==Hj?tl+b:Iha+b;if(b[u]==12)return b;return i}Bi(O.S(),"sy148");H(kY,nn);F=kY[w];F.hO=i;F.ba=function $qNa(){this.wa=this.W().ba(zm,{type:Il})};F.Ff=function $rNa(a){kY.C.Ff[z](this,a);if(!this.Me)this.Me=a[Uc](Hl)||I};F.ma=function $sNa(){kY.C.ma[z](this);this.E3a();this.rJ();this.b().jl=this};F.Ba=function $tNa(){kY.C.Ba[z](this);this.Fra();this.b().jl=i};F.E3a=function $uNa(){var a=new kn(this);a.w(this.b(),lj,this.WNa);a.w(this.b(),kj,this.o_);Fh&&a.w(this.b(),[Zi,ij,jj],this.DIc);var c=Eg(this.b());a.w(pm(c),rj,this.MKc);this.Q=a;QAc(this)};
+F.Fra=function $vNa(){if(this.Q){this.Q.D();this.Q=i}};F.L=function $wNa(){kY.C.L[z](this);this.Fra()};F.voa="label-input-label";F.WNa=function $yNa(){this.ef=h;Ag(this.b(),this.voa);if(!lY(this)&&!this.tNc){var a=this,c=function $xNa(){pa(a.b(),I)};L?Dh(c,10):c()}};F.o_=function $zNa(){this.hO=i;this.ef=k;this.rJ()};F.DIc=function $ANa(a){if(a[Sb]==27){if(a[Zb]==ij)this.hO=this.b()[q];else if(a[Zb]==Zi)pa(this.b(),this.hO);else if(a[Zb]==jj)this.hO=i;a[zb]()}};
+F.NIc=function $BNa(){if(!lY(this)){pa(this.b(),I);Dh(this.zHc,10,this)}};F.zHc=function $CNa(){if(!lY(this))pa(this.b(),this.Me)};F.MKc=function $DNa(){this.rJ()};Aa(F,function $ENa(){pa(this.b(),I);if(this.hO!=i)this.hO=I});F.Fa=function $FNa(a){if(this.hO!=i)this.hO=a;pa(this.b(),a);this.rJ()};F.Ca=function $GNa(){if(this.hO!=i)return this.hO;return lY(this)?this.b()[q]:I};
+F.rJ=function $HNa(){QAc(this);if(lY(this))Ag(this.b(),this.voa);else{!this.tNc&&!this.ef&&K(this.b(),this.voa);Dh(this.mfd,10,this)}};F.mfd=function $INa(){if(this.b()&&!lY(this)&&!this.ef)pa(this.b(),this.Me)};var fBc="Your attachment(s) were not restored. You can only attach items while online.";function gBc(b){this.ik=b}zx(gBc,uL);gBc[w].Qs=function $VNa(a){if(a.mg==101){var c=a.ws(),d=a.Bb(),f=this.ik,g=f.Cg;a=a.Mg();for(var j=0;j<a[u];j++){var n=a[j],s=n[0];n=n[1];var v=f.lJ(c,d,s);f.SX(s,n,[CL]);f.m1(s,n,[HN]);v&&O3a(v);if(g){tI(g,s);zL(f,s)}}return h}return k};xL[w].fXb=function $gV(){this.Jg.KOc()};O.S().gb("sy148");Ci(O.S(),"sy148");Bi(O.S(),"sy157");O.S().gb("sy157");Ci(O.S(),"sy157");Bi(O.S(),"sy159");function nCc(b,a){var c=a||new U;c[R](b[ec],b.xM?xl+b.xM+xh:I);if(!a)return c[t]()};O.S().gb("sy159");Ci(O.S(),"sy159");Bi(O.S(),"sy160");function oCc(b,a,c,d){this.x1=b;this.hvb=a;this.ABa=c;this.dbc=d}function pCc(b,a,c,d,f,g){d=Ke(d)?d:b[0];if(c){g||(b[0]=Qd+b[0]);d=Qd+d}return new oCc(b,d,a,f)}var qCc="^(?:";function rCc(b,a){this.tKb=b;this.Dyc=new RegExp(qCc+a[kd](Bl)+Beb)}function sCc(b){this.fUa=b}function tCc(b){this.O=b;this.O[1]=this.O[1]||[];this.QYb=[];for(b=0;b<this.O[1][u];b++)this.QYb[b]=new uCc(this.O[1][b])}function uCc(b){this.O=b}function vCc(b,a){oH[z](this,b,33);this.wj=a}
+function wCc(b){this.V=b;this.cg=KC(b);this.sg=sH(b);this.Hza=new sCc(xCc);Mx().oz(11,G(this.wSc,this))}var yCc="quick link";
+function zCc(b,a,c){var d=[],f=MC(b.cg),g=jTa(f.za(cJ));of(g,OC(f));b.FQa&&Hw(g,function(v,C){v=b.FQa[v];C=b.FQa[C];return v>C?-1:v<C?1:0});for(f=0;d[u]<c&&f<g[u];f++){var j=g[f],n=b.cg.Rw(j)?Vy(j):undefined;if((n||j)[Kb](a))d[p](ACc(b,j,n))}if(g=b.sg.Hp(bra)){g=g.XA;var s;for(f=0;d[u]<c&&(s=g[f]);f++){n=s[Cc](Md);j=Rf(String(n[0]));n=Rf(String(n[1]));if(n[Kb](a)||j[Kb](a))d[p](b.HJ([j,yCc],Ph,I,n,h))}}return d}
+function ACc(b,a,c){var d=NC(b.cg,a);d=nCc({name:c||a,xM:d.rt>0?d.rt:0});var f=JC(a);return b.HJ([d,Hl],b.AU?ki:Hz,cra+(c||f),a,h)}function BCc(b,a,c,d){BG[z](this,b,a,c,d)}var CCc='<span class="HxZ6qc">&nbsp;-&nbsp;';function DCc(b,a){var c=a||new U;c[R](I,pE,V(b.ce),gB,b.n7b?CCc+V(b.n7b)+gB:I,I);if(!a)return c[t]()}function ECc(b,a,c,d){CG[z](this,b,a,c,d)}var FCc="ah j3STDe";
+function GCc(b,a,c,d){b=new ECc(c,i,k,h);m(b,FCc);b.yBa=S7a;b.XL=h;c=new BCc(J,dra,h,150);c.L0a=k;c.Zbb=k;c.kd=this;c.Wr(a);c.gwb=k;uG[z](this,d,b,c);this.oja=7;this.GGa=this.mHa=h;this.zf=a}function HCc(b){N[z](this,era);this.IRc=b}Ha(oCc[w],D("hvb"));rCc[w].Vta=function $nOa(a,c,d,f){if(!a[Kb](this.Dyc))return[];var g=a[Cc](xj),j=[];j[u]<d&&String(g[0]+fra)[Kb](c)&&j[p](pCc([g[0]+fra],dx,f));c=this.tKb.Oga(g[1],d,h);for(var n=0;n<c[u]&&j[u]<d;n++)j[p](this.Z6a(c[n],f,g[0]));j[0]&&j[0].x1[0]!=a&&j[ld](pCc([a],dx,f));return j};rCc[w].Ko=function $oOa(a,c,d,f){c=[];a=this.tKb.Oga(a,d);for(var g=0;g<a[u]&&c[u]<d;g++)c[p](this.Z6a(a[g],f));return c};
+rCc[w].Z6a=function $pOa(a,c,d){var f=Pf(a[pq]());a=Pf(a.Vc());var g=d?d+xj:I,j=[I];if(f&&a)j=[g+f,a];else if(f)j=[g+f];else if(a)j=[g+a];return pCc(j,dx,c,(d?d+xj:I)+a)};sCc[w].Vta=function $qOa(a,c,d,f){d=[];for(var g=this.fUa,j=0;j<g[u];j++){var n=g[j][0];if(a[Kb](Ty+n+xj)){g=g[j][1];for(j=0;j<g[u];j++){var s=n+xj+g[j];s[Kb](c)&&d[p](this.HJ(s,f))}d[0]&&d[0].x1[0]!=a&&d[ld](this.HJ(a,f));return d}}return[]};var ICc="operator";sCc[w].Ko=function $rOa(a,c,d,f){a=[];for(d=0;d<this.fUa[u];d++)this.fUa[d][0][Kb](c)&&a[p](this.HJ(this.fUa[d][0]+xj,f,ICc));return a};sCc[w].HJ=function $sOa(a,c,d){return pCc(Ke(d)?[a,d]:[a],dg,c)};_B_prog(90)}catch(e){_B_err(e)}
+
+try{Ha(tCc[w],function $tOa(){return this.O[t]()});tCc[w].kc=D(ae);uCc[w].Iga=function $vOa(){return this.O[0]};Ha(uCc[w],function $wOa(){return this.O[t]()});uCc[w].kc=D(ae);H(vCc,oH);var JCc="omni";vCc[w].Ja=function $yOa(a){vCc.C.Ja[z](this,a);a.Ua(pd,JCc);a.Ne(mB)};vCc[w].rk=function $zOa(a,c,d){if(c==JCc){a=this.wj;d=(new tCc(d)).QYb;a.FQa={};c=0;for(var f;f=d[c];c++)a.FQa[f.Iga()]=f.O[1]}};wCc[w].AU=k;var xCc=[[gO,[sz,"read",npb,kza,pJ]],["has",["attachment"]],["filename",["jpg","pdf","doc","ppt","xls"]],[ss,[kz,Zy,Yy,"anywhere"]],[Hl,[]],[vK,[]],[mNa,[]]],KCc=[Xt,LP,Yd,MP,"deliveredto"],LCc=[["and &&","AND","AND"],["or ||",zu,zu],[gra,"has photos",hra],[ira,"has documents","filename:(pdf OR doc OR xls OR ppt) OR docs.google.com OR spreadsheets.google.com"],[jra,"has videos",kra],[lra,mra,"filename:ics"],[nra,nra,ora],[pra,pra,qra],[Pu,Pu,rra]];F=wCc[w];
+F.wSc=function $AOa(){(new vCc(this.V,this))[Mb]()};F.ula=function $BOa(a,c,d,f){var g;if(!this.AJ&&(g=rG(this.V)))this.AJ=new rCc(g,KCc);c=this.t6(a,c,f);d(a,c,k)};var MCc="^label:",NCc="search mail";
+F.t6=function $COa(a,c,d){this.AU=a[xb](0)==Qd;var f=Pf(a[mb](/[\(\)\{\}\"\']|(?:^-)/g,I));if(f==I)return[];var g=f[od]();f=new RegExp(sra+ox(f),ii);if(this.AJ){var j=this.AJ.Vta(g,f,c,this.AU);if(j[u]>0)return j}if(g[Kb](MCc)){j=g[Cc](xj,2)[1];j=new RegExp(vQa+ox(j),ii);j=zCc(this,j,c)}else j=[];if(j[u]>0)return j;j=this.Hza.Vta(g,f,c,this.AU);if(j[u]>0)return j;j=this.Hza.Ko(g,f,c,this.AU);var n=this.pzb(f,c),s=zCc(this,f,c),v=s[u]+j[u]+n[u];v=v>=c-3-1?3:c-1-v;g=this.AJ?this.AJ.Ko(g,f,v,this.AU):
+[];a=this.AU?a[nc](1):a;d=[this.HJ([d?d:a,NCc],ki,a,undefined,!!d)];of(d,g,s,j,n);return d[lb](0,c)};F.pzb=function $DOa(a,c){for(var d=[],f=0;f<LCc[u]&&d[u]<c;f++)LCc[f][0][Kb](a)&&d[p](this.HJ([LCc[f][1]],RE,LCc[f][2]));return d};F.Z6a=function $EOa(a,c){var d=Pf(a[pq]());a=Pf(a.Vc());var f=c?c+xj:I,g=[I];if(d&&a)g=[f+d,a];else if(d)g=[f+d];else if(a)g=[f+a];return this.HJ(g,dx,(c?c+xj:I)+a)};
+F.HJ=function $FOa(a,c,d,f,g){d=Ke(d)?d:a[0];if(this.AU){g||(a[0]=Qd+a[0]);d=Qd+d}return new oCc(a,d,c,f)};H(BCc,BG);BCc[w].Qo=function $GOa(a){BCc.C.Qo[z](this,a);switch(a[Sb]){case 13:this.kd.Dsa();this.kd.nw();break;case 39:this.kd.vI()&&a[zb]()}};H(ECc,CG);ECc[w].qWa=function $HOa(a,c,d){a=a[dq];Q(d,DCc({ce:a.x1[0],n7b:a.x1[1]}))};H(GCc,uG);GCc[w].vI=function $IOa(){var a=vG(this,this.Hy);if(a!=-1){var c=Ke(this.Rg[a].iQb);this.JRc=a=this.Rg[a];if(c)a+=J;this.JF.yaa(a,!c);this.nw();this[r](kQ);return h}return k};GCc[w].Dsa=function $JOa(){sh(this,new HCc(this.JRc))};H(HCc,N);O.S().gb("sy160");Ci(O.S(),"sy160");Bi(O.S(),"sy161");O.S().gb("sy161");Ci(O.S(),"sy161");var RCc='" token="',SCc="token",TCc="Report ",UCc=" bug",VCc="New!",WCc="Take our survey",XCc="xu",YCc="z4",ZCc=' <a class="',aDc="xr",bDc="Pn",cDc="60:ls",dDc="/b/",eDc="You can ",fDc="wl",gDc="<option ",hDc="mon";function iDc(b){var a=Zf();b.xya=a;GYa(b,a)}function jDc(b,a){b.bmd=a;b.Li[z](b.na)}function kDc(b,a,c){var d=b[a.id]||0;b=b[c.id]||0;return d>b?-1:d<b?1:a[Dq]>c[Dq]?1:-1}
+function lDc(b,a){b.tD=a;b.tD&&!b.xa.uPc()&&b.xa.ZVa(Ph);if(!b.Tl)if(b.tD){b.tD.vLc&&b.xa.cja(k);b.xa.ZVa(Ph)}var c=b.Uq;c.tD=a;if(a!=i)c.ACd=a.Hc();b.Uq.YU()}function mDc(b){b.Hh.My()||iDc(b.H3)}function qY(b,a){b.jMb=a;b.gr||DPa(b,h)}function nDc(b,a){this.Li=b;this.na=a;b=new Sh;b.ka(pd,UF);b.ka(VF,Pj);this.Wic=String(b);b.ka(VF,Hj);this.Vic=String(bi(b))}function oDc(b,a){b.pQ=a}function pDc(b){return Cf(b.jAa)[el](df(kDc,b.m8b))}
+function qDc(b){if(!b.ul)b.ul=(new Sh(b.PIb[Ic][Yc])).ul;return b.ul==xH}function rDc(b){b.OEc=h}function sDc(b,a){var c=a||new U;c[R](Qu,b.id,qE,b[Yc],tra,Rd,W,b.yU,hB);if(!a)return c[t]()}function tDc(b){var a=(new Sh(kea)).ka(Sd,Vz);Mx().Kh(170,b,a);return a}var uDc="?logout&hl=en";function vDc(b){var a=I;if(b[hq](Mz)){b=new Sh(Mj);if(b.Jk()=="mail.google.com"){b.Of()[bc]();b.Pr(xH);Uh(b,I);a=b[t]()}}return a+uDc}var wDc="mail/whatsnew.html",xDc="about_whatsnew.html";
+function yDc(b){var a;if((a=b[hq](V7a))&&da(a,10)){a=b[hq](X7a);if(!(new Sh(a)).Jk()){if(b[hq](Mz)){b=b[hq](i8a);a=a||wDc}else{b=b[hq](h8a);a=a||xDc}a=Ue(b)?b+a:a}}else a=i;return a}function zDc(b){var a=i,c=b[hq](V7a);if(c&&da(c,10)){a=b[hq](W7a);a=Ke(a)?String(a):i}return a}function rY(b,a){yH[z](this,k,undefined,b,a);this.OXb=k}function ADc(b){b.OXb=h;b.gma(b.ZLc,b.Jed);L&&!zH&&!b.KKa&&b.j4b()}function BDc(){return Xw(O.S(),PN).hc()}
+var CDc="[gmonkey.get] Invalid version number: ",DDc='[gmonkey.get] Version "',EDc='" not loaded, use:\ngmonkey.load("',FDc='", function(api) { ... })';function GDc(b){if(BDc(b))switch(Number(b)){case 1:return HDc;default:Zo(CDc+b)}else Zo(DDc+b+EDc+b+FDc);return i}function IDc(){top.gmonkey=self.gmonkey;nh(top,rj,IDc)}function JDc(b){this.O=b}function KDc(b,a){pB[z](this,b,37,6);this.quc=a}function LDc(b){pB[z](this,b,38,7)}function sY(b){this.Rd=b}function MDc(b){this.link=b;this.Hm=[1]}
+function NDc(b,a){b.Hm[jd](b.Hm[u]-1,0,a)}function tY(b,a,c){this.yn=b;this.KL=a;za(this,c?c:1)}function ODc(b){this.O=b}var PDc="jobsetinfo";function QDc(b,a){Kx[z](this,PDc,b);this.Kk().w(a,Fx(ura),this.p2c)}function RDc(b){this.Db=b;this.Aa=Dx(Cx(b));this.xf=fy(b)}var SDc='" role="banner">',TDc=' Logo</h1><div id="',UDc="a9",VDc='" idlink role="link" title="';function WDc(b,a){var c=a||new U;c[R](vra,qD,SDc,b.si,TDc,b.id,S,UDc,VDc,b.si+" by Google",mE);if(!a)return c[t]()}
+var XDc='<b><a target=_blank class="bE" href="',YDc="</a></b> | ";function ZDc(b,a){var c=a||new U;c[R](b.fnb&&b.enb?XDc+b.enb+W+b.fnb+YDc:I);if(!a)return c[t]()}var aEc="&nbsp;| ",bEc="><span id=",cEc="><a class=",dEc="bB",eEc=' href="#"><u>',fEc="Report issues",gEc="</u> <small>&#9660;</small></a></span><div id=",hEc=" for=",iEc="</div></span> | ";
+function jEc(b,a){var c=a||new U;if(b.vWa[u]==1)c[R](b.vWa[0].yn,aEc);else if(b.vWa[u]>1){c[R](wra,xra,bEc,b.vac,cEc,dEc,eEc,fEc,gEc,b.Red,hEc,b.vac,Ru,xo,W);b=b.vWa;for(var d=b[u],f=0;f<d;f++)c[R](X,uo,W,b[f].yn,Z);c[R](iEc)}if(!a)return c[t]()}var kEc="a8",lEc="<span class=bA><span id=",mEc='><a class=bB href="#"><u><b>',nEc="</b></u> <small>&#9660;</small></a></span><div id=",oEc=' class="J-M"></div></span> | ',pEc="</b> | ",qEc=" | ";
+function rEc(b,a){var c=a||new U;c[R](nE,b.rHc,S,kEc,yra);b.BYb&&sEc(b,c);b.IXb&&jEc(b,c);var d=c||new U;d[R](b.tjd?lEc+b.aFb+mEc+V(b.kjc)+nEc+b.crc+hEc+b.aFb+oEc:ZG+V(b.kjc)+pEc);c||d[t]();c[R](UZa,b.ptc,Uf);b.fpa&&tEc(b,c);c[R](ns,b.oWc,W);ZDc(b,c);c[R](ns,b.DXc,au);d=c||new U;for(var f=b.gVc,g=f[u],j=0;j<g;j++)d[R](f[j],aEc);c||d[t]();uEc(b,c);c[R](Su);if(b.njb&&b.mkd){d=c||new U;sDc({id:b.ebb,href:b.fbb,yU:zra},d);c||d[t]();c[R](Su)}vEc(b,c);c[R](qEc);b.IXb||jEc(b,c);wEc(b,c);c[R](Ara);if(!a)return c[t]()}
+var xEc="a7",yEc='" target="_blank" href="',zEc="Manage this domain";function AEc(b,a){var c=a||new U;b.fpa&&c[R](QP,Rd,J,xEc,yEc,b.fpa,W,zEc,hB);if(!a)return c[t]()}function tEc(b,a){var c=a||new U;AEc(b,c);c[R](Su);if(!a)return c[t]()}var BEc="#settings";function uEc(b,a){var c=a||new U;sDc({id:b.Z1,href:b.tRa+BEc,yU:IK},c);if(!a)return c[t]()}var CEc='<span><a target=_blank class="';function vEc(b,a){var c=a||new U;c[R](CEc,Rd,J,xEc,qE,b.zVb,Gl,b.yVb,W,Bra,Zt);if(!a)return c[t]()}var DEc='" target="_top">';
+function wEc(b,a){var c=a||new U;c[R](QP,Rd,J,xEc,J,mP,Gl,b.lfc,qE,b.B_b,DEc,b.mfc,hB);if(!a)return c[t]()}var EEc="aH",FEc="bU",GEc="End now",HEc='</a>&nbsp;&nbsp;&nbsp;<a class="',IEc="Vacation Settings",JEc='</a></div><span id="',KEc="&nbsp;</span></div>";function LEc(b,a){var c=a||new U;c[R](X,EEc,Gl,V(b.mqd),wl,FEc,Cra,Rd,J,xEc,Gl,V(b.TCc),W,GEc,HEc,Rd,J,xEc,Gl,V(b.Z1),W,IEc,JEc,V(b.oqd),W,V(b.nqd),KEc);if(!a)return c[t]()}var MEc='" scrolling="no" ></iframe>';
+function NEc(b,a){var c=a||new U;c[R](Iqa,b.id,Ps,b.j8a,S,VP,MEc);if(!a)return c[t]()}var OEc="Devel jobset: ",PEc="Ozk3xc",QEc="</a> | ";function sEc(b,a){var c=a||new U,d=OEc+V(b.BYb);c[R](QP,PEc,yEc,b.TQc,W,d,QEc);if(!a)return c[t]()}function uY(b){UB[z](this,b);Bx(this);this.Z=Rz(b);this.Lb=Tz(b);this.H().w(fy(b).ud,Fx(WN),this.a9c);this.jb=JB(b);this.Aa=Dx(Cx(b))}function REc(b,a){return Li(a,function(c){return c.yn})}
+function SEc(b,a){b=TEc(b,b.aa.HE());if(a)b=Di(b,function(c){return(c[Zb]&a)!=0});return b}function TEc(b,a){return Di(sf(a),function(c){return c!=i})}var UEc="guser",VEc="Sign out",WEc="aml";
+function XEc(b,a,c){var d=b.B(),f=REc(b,a[1]),g;g=b.Aa.za(PDc);g={vM:g.Ca(Tu),url:g.Ca(Dra)};var j=!Jz(b.Z,1067)&&!Jz(b.Z,1164);return{rHc:UEc,kjc:Hi,Z1:b.X(ki),tRa:nD(d),lfc:b.X(xs),zVb:tDc(b.Lb),ebb:b.X(Uu),fbb:Era,oWc:b.X(sQ),enb:yDc(b.Z),fnb:zDc(b.Z),yVb:b.X(GO),B_b:vDc(b.Z),mfc:VEc,gVc:f,ptc:b.X(NL),fpa:b.Z[hq](A8a),vWa:a[3],Red:b.X(FE),vac:b.X(hP),tjd:c,crc:b.X(LD),aFb:b.X(WEc),IXb:Jz(b.Z,55),njb:!bx(),mkd:j,DXc:b.X(SL),BYb:g.vM,TQc:g.url}}function vY(b){this.bi=b}
+function wY(b,a){BD[z](this,b,new eE(b));this.Z=Rz(b);this.iga=a;this.Bd=rD(b)}var YEc="qq",ZEc="navigation";function aFc(b,a){var c=b.ia,d=c.b();if(a.O[1]){var f=sD(b.Bd);ba.GBAR_doc=f[yc];Q(d,a.Cp());Li(d[ic](Kd),function(g){K(g,YEc)});K(d,Bqa);fn(d,ZEc);f.eval&&a.O[3]&&f.eval(a.O[3]);Vj(a.O[4],d)}else Q(d,I);d[o](b.iga.b());c.Xk(b.iga);d[o](b.W().ba(T,{className:Vu}))}function xY(b){this.kj=b}function bFc(b,a,c,d){this.id=b;Sp(this,a);this.Si=c;this.scope=d||Je;Ra(this,h)}var cFc="stlp";
+function dFc(b){bFc[z](this,cFc,I,this.XJc,this);this.ci=b;this.Ud=this.fM=this.VUa=this.waa=i}function eFc(b){this.kj=b}
+function yY(b){eE[z](this,b.B());this.xk=b;this.Cb=sC(b.B());this.CW=[];this.jb=JB(b.B());this.ctb={};this.Ud=i;Mx().Ug(110,G(this.Cza,this));b=dG(b.B());this.H().w(b,cG,this.iqb);Bx(this);b=this.aa.sNa();b[p](new bFc(EE,this.koc,this.D6c,this));b[p](new bFc(Wu,this.loc,this.G6c,this));this.ura=i;for(var a=0;a<b[u];a++){var c=b[a];if(c){this.CW[p](c);this.ctb[c.id]=c;if(!this.ura&&c[Vc])this.ura=c.id}}}
+function zY(b,a,c){if(a=b.ctb[a]){Ra(a,c);a.Dna.ra(a[Vc]);b.ura=i;for(c=0;c<b.CW[u];c++){a=b.CW[c];if(a[Vc]){b.ura=a.id;break}}}}function fFc(b,a,c){var d=a.id==Xz,f=b.aa.jjb();f=d&&!f;zY(b,EE,f);f=f?I:xd;Ua(b.b(xs)[x],f);Ua(b.b(kD)[x],f);d&&gFc(b,b.aa.zT(a,c))}function gFc(b,a){var c=b.ny;b.Ud&&b.Ud.lw(c);a&&a.Wr(c);b.Ud=a}
+var hFc='" role="search"><tr><td class=',iFc="bN",jFc="><input type=text id=",kFc=' onsubmit="return false" class="',lFc="bQ",mFc='" maxlength=2048 size=40 tabindex=0></td><td class="',nFc="bM",oFc="bR",pFc='"><span id=',qFc=' tabindex=0 role=link class="',rFc="</span><br><span id=";
+function sFc(b,a){b=new U;b[R](Fl,ul,J,Pd,hFc,iFc,jFc,a.fXa,kFc,lFc,J,TP,mFc,iFc,J,nFc,W);for(var c=a.oS,d=c[u],f=0;f<d;f++){var g=c[f];AI({id:g.id,xh:g[jb]},b)}b[R](NG,iFc,J,oFc,pFc,a.Kgd,qFc,Xu,W,a.Lgd,rFc,a.rzc,qFc,Xu,W,a.szc,Fra);a=b[t]();return a}function tFc(b){for(var a=[],c=0;c<b.CW[u];c++){var d=b.CW[c];a[p]({id:b.X(d.id),text:d[qr]})}return{fXa:b.X(Bpa),Kgd:b.X(xs),rzc:b.X(kD),oS:a,Lgd:b.moc,szc:b.Ync}}function uFc(b){(b=b.ctb[b.ura])&&b.Si[z](b[Pq])}
+function vFc(b,a,c,d){if(a=b.b(a)){var f=new BI(i,CI.S());f.Pb(a);b.H().w(f,Wn,c,k,d);return f}else return i}var wFc="aC";
+function AY(b,a){BD[z](this,b,new gF(b));Bx(this);this.Y=qC(b).W();this.Aa=Dx(Cx(b));this.Z=Rz(b);this.Lb=Tz(b);this.kg=nF(b);this.Ma=yy(b);this.Mb=jF(b);this.Jc(a);a=this.H();a.w(this.Z,this.Z.Cq(WN),this.p0b);a.w(this.Z,this.Z.Cq(WN),this.q0b);a.w(this.Aa.Ya(),this.Ma.Yn(KM),this.OP);a.w(this.Aa.Ya(),this.Ma.Yn(W5a),this.OP);a.w(this.Aa.Ya(),this.Ma.Yn(NM),this.OP);a.w(this.Aa.Ya(),this.Ma.Yn(LM),this.OP);this.aa.Goa(b);this.jb=JB(b);this.Ck=VC(b);this.Ck.yu.add(this);this.Cb=sC(b);m(this.b(),wFc)}
+function xFc(b){yA++;try{yFc(b,k);b.EX[Jq](Wx);b.EX.Hx(0);b.EX.SQ(Infinity);b.ci.qc(h);b.Oq&&b.Oq.Yb()}finally{zA()}}function zFc(b){yA++;try{yFc(b,h);b.EX.Kx(70);b.Oq.Nc();b.ci.qc(k)}finally{zA()}}function yFc(b,a){var c=YA(b.Xja);if(a){b.EX[Nc](c);b.ia.ha(c)}else{b.ia[Nc](c);b.EX.ha(c)}}var AFc="Mail Settings",BFc="Mail Help";
+function CFc(b,a){yA++;try{var c=b.Z[hq](F8a),d=b.Z[hq](E8a);if(c){var f=new eE(a);Q(f.b(),NEc({id:b.X(Gra),j8a:c}));b.ada.ha(f);Wa(b.b(Gra),b.Z[hq](G8a));b.KLb=Zf();var g=fy(a);b.H().w(g.ud,Fx(VP),b.kUc)}if(d){f=new eE(a);Q(f.b(),DFc(b,d,b.Z));b.ada.ha(f)}if(b.ada.qj()>0){b.jyb=b.Z[hq](I8a);b.jyb||EFc(b);var j=new cF(a);j.Kx(9);b.ada.ha(j);b.ada.qc(h);b.gTa.qc(!d);var n=b.b(eP);n&&b.H().w(n,P,b.V6c)}if(b.Cc())if(b.Z[hq](K8a)){var s=b.b(eP),v=b.b(GO);if(s&&v){Q(s,AFc);Q(v,BFc)}}}finally{zA()}}
+function EFc(b){b=b.b(Hz);var a=b[x];if(zia in a)aha(a,I);else pma(a,xd);wp(b[x],aR)}var FFc="ven",GFc="vsub";function HFc(b){b.B();return{mqd:b.X(Nt),nqd:b.Ma.db(LM),TCc:b.X(FFc),Z1:b.X(ft),oqd:b.X(GFc)}}function IFc(b,a){var c={};c.q=a;b.JM(a,c);b[Pc](new Rya(c));b.Cb.lf();dE(b.B()).pb(dhb)}
+function JFc(b,a){if(b.Oq)a();else{b.U8a=new jB;WC(b.Ck);var c=O.S();Vw(c,Br,function(){b.U8a=i;WC(b.Ck);if(!b.Oq){b.Oq=new KFc(b.B(),b);b.EX.ha(b.Oq.NGc());b.H().w(b.Oq,Yu,b.b3c);var d=b.IH.ac(),f=ff(d.Uc(),b.IH);d.Jf(b.Oq,f+1)}a()})}}
+function DFc(b,a){var c={Z1:b.X(eP),lfc:b.X(xs),zVb:tDc(b.Lb),yVb:b.X(GO),B_b:vDc(b.Z),mfc:VEc,tRa:nD(b.B())};b=AEc({fpa:b.Z[hq](A8a)});return a[mb](/\{\{userEmail\}\}/g,Hi)[mb](/\{\{manageDomainLink\}\}/g,b)[mb](/\{\{settingsLink\}\}/g,uEc(c))[mb](/\{\{helpLink\}\}/g,vEc(c))[mb](/\{\{signOutLink\}\}/g,wEc(c))}function LFc(b,a){return Di(sf(a),function(c){return c!=i})}var MFc="pz pA";
+function NFc(b){PI[z](this,b,knb,MFc,G(this.lh,this),UVa);this.Lh=TD(b);this.jb=JB(b);if(this.slb=QIa(hF(b),Xz)){b=dG(b);this.qc(b.XR==this.slb);this.H().w(b,cG,this.iqb,k,this)}}function OFc(b){kJ[z](this,pJ,b);this.Fc(Zu);this.P1(ki)}function PFc(b){this.V=b;this.zi=FH(b);this.rca=fD(b);ih(this.zi,kC,this.F3b,k,this)}function QFc(b,a,c){b=b.zi.vz;for(var d=[],f=0;f<b[u];f++){var g=b[f];if(g.md()==wE)if((!a||Qya(a,g.Bb()))&&(!Ke(c)||c==g.Ut()))d[p](g)}return d}
+function RFc(b,a){var c=b.rca.VEa[a[Wq]]||i;if(c)if(c=jA(b.V,c)){(a=c.JJ(b.V,b,a))&&gQa(b.zi,a);return a}return i}function SFc(b){this.HTc=b}var TFc=" q0CeU";
+function BY(b){Bx(this);BD[z](this,b,(this.Agb=this.aa.NBb())?new BF(b):new sF(b));this.Ma=yy(b);var a=new gF(b);if(this.Agb){this.ia.so(a);this.ia.U1(new Bm(-2,-2,-2,-2))}else{this.ia.ha(a);this.ia.JXa(5,0,5,5)}this.Aqd=a;this.Rbb=new sE(b);a=new DH(b);b[kq](TC,a);this.zi=a;this.zi.yhc=b.wT.GHb(b);this.CTc=new PFc(b);this.dOc=this.ia.b()[uc]+TFc;this.W7a=new CH(h);ih(this.zi,kC,this.Cza,k,this);eF(this.Aqd,[this.Rbb,this.zi])}var UFc="z9",VFc="toxOdd Aa";
+function WFc(b,a){var c=a||new U;b=b.tbd;for(var d=b[u],f=0;f<d;f++){var g=b[f];c[R](X,UFc,Gl,g.id,W);oTa({className:VFc,yU:V(g[Dq])},c);c[R](Z)}if(!a)return c[t]()}function XFc(b){AD[z](this,new eE(b));this.E9=hF(b);this.D9=dG(b);this.Cb=sC(b);K(this.b(),Hra);YFc(this);this.O2();Pw(this.H().w(this.E9,OIa,this.iZc).w(this.D9,cG,this.gZc),this.b(),aB,this.mTa)}function YFc(b){for(var a=b.b(),c=[],d=pDc(b.E9),f,g=0;f=d[g];g++)c[p]({id:b.X(f.id),caption:f[Dq]});Q(a,WFc({tbd:c}));b.qc(d[u]>1)}
+var ZFc="Firebug is known to make ",aGc=" slow unless it is configured correctly.&nbsp;",bGc='">Fix this</a>&nbsp;&nbsp;&nbsp;<span id="link_firebug_hide" idlink tabindex="0" role="link">Hide</span>';function cGc(b,a){var c=a||new U;c[R](ZFc+(Ji+(aGc+(Rt+b.Fy+bGc))));if(!a)return c[t]()}var dGc="Certain GreaseMonkey scripts may interfere with ",eGc=". &nbsp;",fGc='">Fix this</a>&nbsp;&nbsp;&nbsp;<span id="link_bg_hide" idlink tabindex="0" role="link">Hide</span>';
+function gGc(b,a){var c=a||new U;c[R](dGc+(Ji+(eGc+(Rt+b.Fy+fGc))));if(!a)return c[t]()}var hGc=" is temporarily unable to access your Contacts. You may experience issues while this persists. &nbsp;";function iGc(b,a){var c=a||new U;c[R](Ji+(hGc+(Rt+b.Fy+Ira)));if(!a)return c[t]()}var jGc='">I want it, tell me more!</a>&nbsp;&nbsp;&nbsp;<span id="link_ie_hide" idlink tabindex="0" role="link">Dismiss</span>';
+function kGc(b,a){var c=a||new U;c[R](Ji+(" runs faster in Google Chrome. &nbsp;"+(Rt+b.Fy+jGc)));if(!a)return c[t]()}function lGc(b,a){b=a||new U;b[R]('Google Mail is now Gmail in the UK. &nbsp;<span id="link_gm_change" idlink tabindex="0" role="link">Change your address to @gmail.com.</span>&nbsp;&nbsp;&nbsp;<span id="link_gm_hide" idlink tabindex="0" role="link">Hide</span>');if(!a)return b[t]()}
+var mGc=" If this problem persists, try ",nGc='<a target=_top href="',oGc="reloading",pGc=" the page, ",qGc='<span style="display:',rGc="using ",sGc="using the ",tGc=", or using ",uGc=" mode. ",vGc='">Learn More</a>.';function wGc(b,a){var c=a||new U;b=b.FOc+(mGc+(nGc+b.qbd+W+(oGc+(hB+(pGc+(qGc+V(b.xkd)+W+(rGc+(nGc+b.bhd+W+(xH+(hB+(hg+(gB+(sGc+(nGc+b.hEc+W+(Jra+(hB+(tGc+(nGc+b.dMc+W+(Kra+(hB+(uGc+(Rt+b.HK+vGc))))))))))))))))))))));c[R](b);if(!a)return c[t]()}function CY(b){this.Bc=this.Bc=b}
+function xGc(b){this.Ye=b}function yGc(b){var a=this.B(),c=oD(a);if(c&&!this.AA()){c=c.sa.Ed[1];b=b[y];a=ZCb(a,b);this[r](new fLa(this,0,c,b,a))}}function zGc(){this.AA()||this[r](new TF(this,rH))}function DY(b){kJ[z](this,pJ,b);this.Z=Rz(b);this.Fc(Zu);this.P1(ki);this.VIa=[];Bx(this);this.aa.iib()}function AGc(b,a){var c=ef(b.VIa,b.S9);a=a==3||a==4;b.S9.qc((b.AA()||!c)&&a)}
+function BGc(b,a){b.li().hy.qc(h);for(var c=0;c<b.VIa[u];c++)b.VIa[c].qc(a);if(b.LI){c=tL(b.B());b.LI.jB(a);AGc(b,c.xc())}}
+function EY(b){Bx(this);this.Lh=TD(b);this.Aa=Dx(Cx(b));var a=new yPa;b[kq](rH,a);this.sg=a;this.Bd=rD(b);aDb=this.aa.bdb();CGc=this.aa.Qdb();NF[z](this,b);this.Ma=yy(b);this.S4a=ri(Ega);this.mPb=ri(Cga);this.FHb=ri(Dga);this.eWb=ri(Hga);this.OTb=ri(Jga);this.aa.iX();this.Z=Rz(b);this.H().w(this.Z,this.Z.Cq(WN),this.Qxa);this.Lb=Tz(b);this.Jz=RC(b);this.uWc=new EI(this.p4c,15E3,this);this.inb=new Hf;this.Rh=tH(b);this.fc=dC(b);this.fc.Ec();this.kg=nF(b);this.Mb=jF(b);top.js=ba;_GM_getComponent=G(this.JQb,
+this);_GM_getAndRemoveTearoffData=G(this.fcb,this);_GM_getLabelDataNode=G(this.YFc,this);_GM_handleNavigateEvent=G(this.g4c,this);_GM_invitesDone=G(this.UOc,this);_GM_validateLabelName=G(this.tqd,this);_GM_refreshActivityFooter=G(this.Pdd,this);_GM_openInviteWindow=DGc;_GM_getSSUrl=G(this.IFc,this);_GM_loadSSVer=G(this.BSc,this);a=Number(top.jpgt);var c=Number(qea);if(c>0&&a>0)c>a?dE(b).pb(dkb):dE(b).pb(ekb);Jz(this.Z,915)&&this.sg.Rca(new XFc(b),Pqa,105);lA(b,UF,av);lA(b,bv,vw);lA(b,tr,kP);lA(b,
+nP,cv);lA(b,FB,dP);try{yA++;Mx().Kh(2,this);this.aa.ZP()}finally{zA()}}var EGc="idlink";function FGc(b,a){if(a[Uc]&&a[Uc](EGc)!=i)return h;return(a=a[A])&&FGc(b,a)}function GGc(b){if(!(b.Y7b<3)){b.Rh.Nxa();var a=Ke(ba.gCurrentContextMenuHandler);if(a!=b.ngb){b.ngb=a;FY(b)}b.ngb||HGc(b)}}function IGc(b,a){b.aa.z2a(a,b.sg)||b.sg.Vr(a,75)}function JGc(b,a){b.jb[bq]({view:wE,search:a})}var KGc="GMAIL_AR",LGc=":44";
+function MGc(b,a){if(!(b.Jz.qa==1||b.Jz.qa==2)&&tQa(b.zi)){rDc(b.B());ax(KGc,NGc(b),300);b=b.zi.nU.gH(a);Kga(b)}else bA(LGc,function(){MGc(this,a)},6E4,b)}function NGc(b){b=b.Z[hq](b9a);return l[kb](Zf()/1E3-b)}var OGc=":45";function PGc(b){b.cwc=h;if(!b.rY)b.rY=bA(OGc,b.cZc,30,b)}function QGc(b){if(b.rY){cA(b.rY);b.rY=i}if(b.cwc){var a=b.zi.zc(),c=a?a.TO():I;b.XF.Fc(b.aa.wT(c||I));b.aa.Tqb(a)}}function HGc(b){var a=Boolean(ba[ir]&&ba[ir].firebug);if(a!=b.hVb){b.hVb=a;FY(b)}}
+function RGc(b,a){return vm(b.zi.vz,function(c){var d=c.md();return(d==wE||d==xE)&&c.Toa&&c!=a})}var SGc="Trident",TGc="/p/mail.html";
+function FY(b){var a=b.aa.Ccb(),c=b.Ma.Oo(FM),d=b.Z[hq](a8a);if(a){c=G(b.Il,b);a.qk=c;qY(b.Rh,a)}else if(b.xVb&1){a={Fy:Yz(b.Lb,106432)};a=new Zz(iGc(a),1,-1);c=G(b.Il,b);a.qk=c;qY(b.Rh,a)}else if(b.hVb&&!b.mPb){a={Fy:Yz(b.Lb,77355)};a=new Zz(cGc(a),1,-1);c=G(b.Il,b);a.qk=c;qY(b.Rh,a)}else if(b.ngb&&!b.FHb){a={Fy:Yz(b.Lb,80253)};a=new Zz(gGc(a),1,-1);c=G(b.Il,b);a.qk=c;qY(b.Rh,a)}else{a=ug()[Db](SGc)!=-1;if(Jz(b.Z,418)&&!b.eWb&&L&&(wg==6||wg==7)&&!a&&!b.Z[hq](z8a)&&UGc(b,c,d)&&!(VGc()||WGc())&&(wg!=
+6||XGc())){a={Fy:new Sh("http://www.google.com/chrome/intl/"+c+TGc)};a=new Zz(kGc(a),2,-1);c=G(b.Il,b);a.qk=c;qY(b.Rh,a)}else if(Jz(b.Z,1089)&&!b.OTb&&d==Gna&&Mf(c,Vz)&&b.Z[hq](SN)=="googlemail.com"){a=new Zz(lGc(),2,-1);c=G(b.Il,b);a.qk=c;qY(b.Rh,a)}else qY(b.Rh,i)}}var YGc="es-419";
+function UGc(b,a,c){b=[Gna,Lra];var d=[lpa,ys];return ef([Vz,lpa,YB,Zj,UF,ppa,qpa,it,OL,rH,jt,gP,Dpa,vy,ht,ys,nt,ot,fO,GO,fe,RL,IH,rpa,mpa,uw,yP,WL,npa,opa,kt,HO,us,lt,TL,gt,YGc,NE,PD,Zn,js,mt,DE],a)&&(!ef(b,c)||ef(d,a))}var ZGc="Windows NT 5.0",aHc="Windows 2000";function WGc(){if(Ri){var b=bp[Fc];return Xf(b,ZGc)||Xf(b,aHc)}return k}var bHc="Windows 98";function VGc(){if(Ri)return Xf(bp[Fc],bHc);return k}var cHc="Windows NT 5.1",dHc="Windows XP",eHc="SV1";
+function XGc(){if(Ri){var b=bp[Fc];return!(Xf(b,cHc)||Xf(b,dHc))||Xf(b,eHc)}return h}var fHc="ivit",gHc="ivem";function DGc(b,a,c){var d=hHc[a];if(d&&!d[Rq])d[Ek]();else{d=new Sh(Rj);d.ka(pd,Mra);d.ka(fHc,a);c&&d.ka(gHc,c);b=xB(b);d=yB(b,d,{width:600,height:640});hHc[a]=d}}function _GM_getComponent(){}function _GM_getAndRemoveTearoffData(){}function _GM_getLabelDataNode(){}function _GM_handleNavigateEvent(){}function _GM_invitesDone(){}function _GM_validateLabelName(){}
+function _GM_refreshActivityFooter(){}function _GM_getSSUrl(){}function _GM_loadSSVer(){}function iHc(){}function jHc(){}function kHc(b,a){this.Rj=a;pB[z](this,b,35,4)}var lHc="p2",mHc="p4",nHc="Give ",oHc=" to:",pHc='</div><div><input type=text id="',qHc="p0",rHc='"></input></div><table cellpadding="0" class="',sHc='"><tr><td><button id="',tHc="Send Invite",uHc='</button> <span id="',vHc='</span></td></tr></table></div><div id="',wHc="pU",xHc="Preview Invite";
+function yHc(b,a){var c=a||new U;c[R](X,lHc,wl,mHc,W,nHc+(b.si+oHc),pHc,b.Pw,S,qHc,rHc,ul,sHc,b.nJ,S,tha,W,tHc,uHc,b.dzc,S,Nra,W,V(b.VOc),vHc,b.Ij,S,wHc,jE,xHc,II);if(!a)return c[t]()}var zHc="invites";function AHc(b){kJ[z](this,zHc,b);this.Z=Rz(b);this.Mb=jF(b);this.fc=dC(b);this.Jc();this.H().w(this.Z,this.Z.Cq(VN),this.Tic)}nDc[w].qJ=function $KOa(){Jh(this.Vic,G(this.PKc,this))};
+nDc[w].PKc=function $LOa(a){a=a[y];if(a.ye()){this.sEc=a.dj();Jh(this.Vic,G(this.QKc,this))}else if(a.hf()==400){this.Bpa=k;this.lvc=h;Jh(this.Wic,G(this.ZUb,this))}else jDc(this,k)};nDc[w].QKc=function $MOa(a){a=a[y];if(a.ye()){this.Bpa=this.sEc!=a.dj();Jh(this.Wic,G(this.ZUb,this))}else jDc(this,k)};nDc[w].ZUb=function $NOa(a){a=a[y];if(a.ye()){this.Ucd=Hi!=Pf(a.dj());jDc(this,h)}else jDc(this,k)};var BHc=/\/b\/[^\/]+/;Bi(O.S(),Xx);_B_prog(93)}catch(e){_B_err(e)}
+
+try{H(rY,yH);rY[w].Mga=function $OOa(a){try{return rY.C.Mga[z](this,a)}catch(c){e(c)}};rY[w].WXa=function $POa(a){rY.C.WXa[z](this,a)};rY[w].gma=function $QOa(a,c){if(this.OXb)rY.C.gma[z](this,a,c);else{this.ZLc=a;this.Jed=!!c}};var Uzc,GY=gQ;Ie("gmonkey.info",E('The "gmonkey" module is not officially supported and is subject to change, we will support previous versions for at least 1-month. Use gmonkey.load(v, callback) to load in the full API where v is the version number of the API you want passed to calback. Latest set of the bindings is "1.0". kthxbye +/\'\\'),void 0);Ie("gmonkey.isLoaded",BDc,void 0);Ie("gmonkey.load",function(b,a){Vw(O.S(),PN,function(){a(GDc(b))})},void 0);Ie("gmonkey.get",GDc,void 0);
+ih(top,rj,IDc);JDc[w].hf=function $ROa(){return this.O[1]};Ha(JDc[w],function $SOa(){return this.O[t]()});JDc[w].kc=D(ae);H(KDc,pB);KDc[w].Wd=D("quc");H(LDc,pB);LDc[w].Zg=E("Undo relabel");H(sY,xx);F=sY[w];F.HE=B();F.Eua=B();F.Eua.Ka=h;F.Qta=B();F.bNa=B();F.ma=B();F.ma.Ka=h;F.Ba=B();F.Ba.Ka=h;F.D=B();F.D.Ka=h;ODc[w].BNa=function $2Oa(){return this.O[1]};Ha(ODc[w],function $3Oa(){return this.O[t]()});ODc[w].kc=D(ae);H(QDc,Kx);QDc[w].p2c=function $5Oa(a){a=new ODc(a[dq]);this.Fa(Tu,a.BNa());this.Fa(Dra,a.O[2])};H(RDc,Iw);RDc[w].tb=function $6Oa(){var a=this.Aa,c=new QDc(a,this.xf.ud);a.ha(c)};Uw(O.S(),function(b){dD(b).qo(new RDc(b))});H(uY,UB);yx(sY,uY);F=uY[w];F.a9c=function $7Oa(){Q(this.b(sQ),ZDc({enb:yDc(this.Z),fnb:zDc(this.Z)}));var a=this.Z;if(a[hq](Mz)&&a[hq](A8a))Q(this.b(NL),tEc({fpa:a[hq](A8a)}))};
+F.ma=function $8Oa(){uY.C.ma[z](this);for(var a=SEc(this),c=[],d=0;d<a[u];d++)c[d]=new MDc(a[d]);this.aa.Eua(c);a={};a[1]=[];a[2]=[];a[3]=[];for(d=0;d<c[u];d++)a[c[d].Hm[0]][p](c[d][cr]);c=TEc(this,this.aa.Qta(4));d=c[u]>0;Q(this.b(),rEc(XEc(this,a,d)));this.H().w(this.b(ki),P,this.U6c);var f=this.b(Uu);f&&this.H().w(f,P,this.Zpb);this.aa.ma();if(a[3][u]+a[2][u]>1){this.p1=new co(this.W());this.p1.Pb(this.b(FE));this.p1.Nn(h);this.p1.ma()}if(d){this.rD=new co(this.W());this.rD.Pb(this.b(LD));this.rD.Nn(h);
+for(a=0;a<c[u];a++)this.rD.ha(c[a],h);this.rD.ma();c=TEc(this,this.aa.bNa(LD));for(a=0;a<c[u];a++)this.H().w(this.rD,Wn,c[a])}};F.D=function $9Oa(){this.aa.D();if(this.p1){this.p1.D();this.p1=i}if(this.rD){this.rD.D();this.rD=i}uY.C.D[z](this)};F.Ba=function $$Oa(){this.aa.Ba();this.p1&&this.p1.Ba();this.rD&&this.rD.Ba();uY.C.Ba[z](this)};F.U6c=function $aPa(a){if(!a[dd]&&!a[Bc]&&!a[Eb]){QF(this,jP);this.jb[bq]({view:dJ});a[zb]()}};F.Zpb=function $bPa(a){if(Jz(this.Z,931))a[y].href+=Ora;dE(this.B()).pb(Wjb)};H(vY,xx);F=vY[w];F.D=B();F.D.Ka=h;F.Kzc=B();F.Kzc.Ka=h;F.ma=B();F.ma.Ka=h;F.edc=B();F.edc.ic=h;F.Goa=B();F.Goa.Ka=h;F.y2a=B();F.JM=B();F.JM.Ka=h;F.cOa=B();F.cOa.ic=h;F.Txb=B();F.Txb.ic=h;H(wY,BD);wY[w].ma=function $lPa(){wY.C.ma[z](this);var a=this.Z[hq](c9a);a?aFc(this,a):this.H().w(this.Z,this.Z.Cq(c9a),this.cUb)};wY[w].cUb=function $mPa(a){this.H().hb(this.Z,this.Z.Cq(c9a),this.cUb);aFc(this,a[dq])};wY[w].D=function $nPa(){sA(this,this.iga);this.iga.D();wY.C.D[z](this)};H(xY,xx);F=xY[w];F.sNa=B();F.D=B();F.D.Ka=h;F.wva=B();F.wva.Ka=h;F.zT=B();F.zT.Rn=h;F.N2=B();F.N2.Ka=h;F.vza=B();F.vza.ic=h;F.jjb=B();F.jjb.ic=h;H(dFc,bFc);var CHc=[wu,Es];F=dFc[w];F.D=function $vPa(){this.YL()};F.YL=function $wPa(){if(this.waa){nh(this.waa,CHc,this.QUb,k,this);Kf(this.Ud);this.waa=this.Ud=this.fM=i}this.VUa=i};
+F.BEa=function $xPa(a){if(a!=this.VUa){this.YL();this.VUa=a;zY(this.ci,this.id,k);if(a.Fbc){var c=kA(this.ci.B(),a.Fbc);Zw(c,function(d){if(this.VUa==a){this.waa=d;if(this.fM=d.dSb()){Sp(this,this.fM[pr]);this.Dna.lM(this[qr]);zY(this.ci,this.id,h)}(this.Ud=d.zT())&&gFc(this.ci,this.Ud);ih(this.waa,CHc,this.QUb,k,this)}},this)}}};
+F.QUb=function $yPa(a){if(a[Zb]==wu){a=!this.fM;if(this.fM=this.waa.dSb()){Sp(this,this.fM[pr]);this.Dna.lM(this[qr])}else a=!a;a&&zY(this.ci,this.id,!!this.fM)}else if(a[Zb]==Es){a=this.Ud;this.Ud=this.waa.zT();gFc(this.ci,this.Ud);Kf(a)}};F.XJc=function $zPa(){var a=this.ci.Qe();this.fM&&this.fM[Pc](a)};zx(eFc,xY);eFc[w].sNa=function $APa(){return this.o9b=new dFc(this.kj)};eFc[w].D=function $BPa(){Kf(this.o9b)};eFc[w].N2=function $CPa(a){this.o9b.BEa(a)};H(yY,eE);yx(xY,yY);F=yY[w];F.wva=function $DPa(){zY(this,Wu,k);this.aa.wva()};F.Vh=function $EPa(){this.wa=this.W()[Qb](T);Q(this.wa,sFc(this,tFc(this)))};F.iqb=function $FPa(a){var c=this.jb.zc();fFc(this,a.knb,c);this.aa.N2(a.knb,c)};F.Cza=function $GPa(a){var c;c=dG(this.xk.B()).XR;fFc(this,c,a);this.aa.N2(c,a)};F.B=function $HPa(){return this.xk.B()};F.CRb=D("xk");var DHc="ny";F.IGc=D(DHc);
+F.ma=function $KPa(){this.ny=this.b(Bpa);this.xk.B().eN()&&Fh&&vg(vYa)&&this.Cb.lf();var a=this.b(xs),c=this.b(kD);Pw(Pw(this.H(),a,aB,this.SZc),c,aB,this.EZc).w(this.ny,Zi,this.Bqb);for(a=0;a<this.CW[u];a++){c=this.CW[a];c.Dna=vFc(this,c.id,c.Si,c[Pq])}L&&yQa(this.ny,Mna)};F.Ba=function $LPa(){yY.C.Ba[z](this);this.ny&&BQa(this.ny)};F.L=function $MPa(){yY.C.L[z](this);this.xk=this.ny=i;for(var a=0;a<this.CW[u];a++){var c=this.CW[a];if(c.Dna){Kf(c.Dna);c.Dna=i}}this.aa.D()};F.SZc=function $NPa(){this.xk.iba()};
+F.EZc=function $OPa(){DD()?vE(this.B()):this.xk.Ama()};F.uo=function $PPa(a){pa(this.ny,a)};F.Qe=function $QPa(){return Pf(this.ny[q])};F.Ksa=function $RPa(){var a=this.ny;a[Ek]();a[Fk]()};F.Bqb=function $SPa(a){if(!this.aa.vza(a))if(a[Sb]==13||Jg&&a[Sb]==3){uFc(this);a[Ec]();a[zb]()}};F.D6c=function $TPa(){var a=this.Qe();IFc(this.xk,a)};F.G6c=function $UPa(){var a=this.Qe(),c=this.xk;a="http://www.google.com/search?client=gmail&rls=gm&q="+Qf(a);xB(c.B()).Yo(a,{target:AB},h);dE(c.B()).pb(ehb)};
+F.koc=Pra;F.loc="Search the Web";F.moc="Show search options";F.Ync=wna;H(AY,BD);yx(vY,AY);Nx(Mx(),10,function(b,a){return new AY(b.B(),a)});F=AY[w];F.jyb=h;
+F.Jc=function $VPa(a){var c=new gF(this.B());c.qc(k);this.sHa=c;c=new gF(this.B());c.qc(k);this.ada=c;c=this.B();var d=new uY(c);this.gTa=new wY(c,d);this.hBd=i;c=new eE(this.B());Q(c.b(),WDc({id:this.X(Hz),si:Ji}));c.Ql(158);c.Kx(70);this.oTc=c;this.ci=new yY(this);this.Xja=new ZA(this.B(),1);c=this.B();tH(c).cCa(this.Xja);this.EX=new gF(c);this.IH=new rF(c);d=this.B();eF(this.IH,[this.oTc,this.EX]);this.EX.ha(this.ci);c=this.ia;eF(c,[this.ada,this.gTa]);var f=[this.sHa,this.IH];if(a>0){d=new gF(d);
+eF(d,f);var g=this.B();f=new cF(g);f.Ql(a);var j=new cF(g);j.Ql(a);a=new rF(g);eF(a,[f,d,j]);c.ha(a)}else eF(c,f);c.ha(YA(this.Xja))};F.wh=function $WPa(a){a.eg&&top[Ic][mb](top[Ic][Yc][Cc](Lj)[0])};var EHc='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="',FHc='", sizingMethod="crop")',GHc="top left",HHc="Z4b7Xb",IHc="GHl1cf",JHc="Rgky9";
+F.URa=function $XPa(){if(this.Cc()&&this.jyb)if(!this.aa.edc()){var a;a=this.B();var c=this.Z[hq](l8a);if(c===undefined){mh(this.Z,this.Z.Cq(l8a),this.URa,k,this);a=I}else{var d=this.Z[hq](N8a);d===undefined&&mh(this.Z,this.Z.Cq(N8a),this.URa,k,this);var f=this.kg.il();if(f)a=d||f[c?1:0];else{dE(a).pb(bkb);dE(a).zF(ckb,Xj.xc());a=I}}if(a&&a!=this.dAc){c=this.b(Hz);d=a;f=c[x];if(L&&!vg(aj))aha(f,EHc+d+FHc);else{pma(f,dv+d+xh);pp(f,GHc);f.backgroundRepeat=Qra}this.dAc=a;m(c,UDc);if(this.Z[hq](N8a))K(c,
+HHc);else this.Z[hq](l8a)?K(c,IHc):K(c,JHc)}}};F.p0b=function $YPa(){this.Cc()&&this.Z[hq](J8a)&&this.ci.wva()};
+F.OP=function $ZPa(){if(this.Cc()){yA++;try{for(var a=this.sHa;a.qj()>0;){var c=a.rb(0);a[Nc](c);c.D();this.rjc=i}this.B();var d=LFc(this,this.aa.y2a(this.Z));Ff(d,this.pFb,this);var f;var g=this.aa.Txb();f=g===undefined?this.Ma.nf(KM):g;if(f&&!this.rjc){var j=this.Y[Qb](T);Q(j,LEc(HFc(this)));this.pFb(j);this.rjc=j;var n=this.b(FFc),s=this.b(ft);this.H().w(n,P,this.l9c);this.H().w(s,P,this.m9c)}a.qc(a.qj()>0)}finally{zA()}}};
+F.q0b=function $_Pa(){if(this.Cc()){var a=this.B();this.Z[hq](WN)&&this.Z[hq](Mz)&&CFc(this,a)}};F.kUc=function $0Pa(){var a=Zf();if(!(a-this.KLb<=3E4)){var c=this.b(Gra),d=this.Z[hq](F8a);if(c&&d){d=new Sh(d);c.src=bi(d)[t]();this.KLb=a}}};F.pFb=function $1Pa(a){var c=this.B(),d=new cF(c);d.Kx(5);this.sHa.ha(d);c=new eE(c);c.b()[o](a);this.sHa.ha(c)};F.l9c=function $2Pa(){var a=new lF(this.B());a.Yc(KM,0);kF(this.Mb,a);a[Mb]()};F.m9c=function $3Pa(a){this.jb[bq]({view:dJ});a[zb]()};
+F.ma=function $4Pa(){AY.C.ma[z](this);this.H().w(this.kg,YD,this.URa);this.q0b();this.URa();this.p0b();this.OP();var a=this.b(Hz);a&&this.H().w(a,P,this.T2c);xFc(this);this.aa.ma()};F.T2c=function $5Pa(){QF(this,icb);this.jb[bq]({view:wE,search:this.Z.bH()})};F.JM=function $6Pa(a,c){this.aa.JM(a,c)};F.Qh=function $7Pa(a){switch(a){case Q4a:this.ci.Ksa();break}};F.Ksa=function $8Pa(){this.ci.Ksa()};F.sK=function $9Pa(){if(this.U8a)return[this.U8a];return[]};F.b3c=function $$Pa(){xFc(this)};
+F.iba=function $aQa(a){var c=this;JFc(this,function(){c.Oq.iba(a);zFc(c)})};F.Ama=function $bQa(a,c,d,f,g,j,n,s,v){var C=this;JFc(this,function(){C.Oq.Ama(a,c,d,f,g,j,n,s,v);zFc(C)})};F.sA=function $cQa(){if(this.Oq){this.Oq.sA();xFc(this)}};var KHc="in:anywhere ";F.pda=function $dQa(){if(!(this.Oq&&this.Oq.pda())){var a=KHc+this.ci.Qe();IFc(this,a)}};Ip(F,function $eQa(a,c,d){QF(this,XO);a=this.jb[bq]({view:wE,search:a});if(c&&d)a.zn()?c[z](d,a.Tga()):this.H().w(a,ki,G(this.k4c,this,c,d))});
+F.k4c=function $fQa(a,c,d){if(d[y].zn()){a[z](c,d[y].Tga());this.H().hb(d[y],ki)}};F.tGc=D("gTa");F.D=function $hQa(){AY.C.D[z](this);this.aa.D();this.Ck.yu[Pb](this);this.DCd=this.CDd=this.wEd=this.ICd=this.Oq=this.ci=this.Xja=i;ba[Oma](this.Ly)};var LHc="in:trash",MHc="in:spam",NHc="cfl_origin";
+F.wL=function $iQa(a){if(!this.aa.cOa(a)){var c=a.md();if(c==wE||c==YK||c==xE){var d;if(a.Bb)d=a.Bb();c=this.Oq&&this.Oq.uD;switch(d.Ga()){case Py:this.ci.uo(cra+JC(d.Pt()));this.sA();break;case az:case Jy:this.ci.uo(d.Qe());this.sA();break;case Zy:this.ci.uo(LHc);this.sA();break;case Yy:this.ci.uo(MHc);this.sA();break;case Oy:case ul:this.ci.uo(I);c&&c.Bb()&&c.Bb().Ga()!=d.Ga()&&this.sA();if(!c)if(d.Ga()==Oy)this.iba();else{c=d;this.Ama(k,undefined,d.Bta(),d.uy(),d.kC(),d.mi(),d.Dta(),d.Cta(),c.Rc(NHc)||
+I)}c=this.Oq.uD;c.Iic(d);if(a.Zn){var f=a.Zn().J();c.H6b(f,a)}break;default:this.ci.uo(I);this.sA()}if(!c)if(d.Ga()==Oy)this.iba(d);else if(d.Ga()==ul){c=d;this.Ama(k,undefined,d.Rc(AN),d.Rc(xN),d.Rc(yN),d.Rc(zN),d.Rc(BN),!!d.Rc(CN),c.Rc(NHc)||I)}}else{this.ci.uo(I);this.sA()}}};F.V6c=function $jQa(a){QF(this,jP);this.jb[bq]({view:dJ});a[zb]()};_B_prog(94)}catch(e){_B_err(e)}
+
+try{H(NFc,PI);Mx().Ug(2,function(b){b=b.B();Jz(Rz(b),1033)||sH(b).Rca(new NFc(b),bR,102)});F=NFc[w];F.iqb=function $kQa(a){this.qc(a.knb==this.slb)};F.TE=function $lQa(a){this.zm(a.md()==QO)};F.lh=function $mQa(a){a[dd]||a[Bc]?AFa(this.Lh,a[Bc]):this.Zmb()};F.Zmb=function $nQa(){QF(this,ZO);this.jb[bq]({view:QO})};F.B=function $oQa(){return this[uq]()};H(OFc,kJ);H(PFc,Jf);PFc[w].L=function $pQa(){PFc.C.L[z](this);nh(this.zi,kC,this.F3b,k,this)};PFc[w].F3b=function $qQa(a){var c=a.iAc;a=a.rnb;if(c&&c.md()==YK){var d=c.Bb();c=QFc(this);for(d=0;d<c[u];d++){var f=c[d];f.tD=i;f.Uq.tD=i}}if(a&&a.md()==YK){d=a.Bb();f=i1a(this.V,d,a.nG);c=QFc(this,d,f);(c=c[u]>0?c[0]:RFc(this,{view:wE,search:d,page:f}))&&lDc(c,a)}};H(SFc,xx);SFc[w].NBb=E(h);SFc[w].NBb.Vd=h;H(BY,BD);yx(SFc,BY);var OHc=new CH(k,"j7diG");BY[w].L=function $sQa(){BY.C.L[z](this);this.CTc.D()};BY[w].i4a=function $tQa(a){if(this.g2b){var c=this.W7a,d=this.Rbb,f=c.kFc&&!!Ay(this.Ma,DM);if(f!=d.Nm){d.Nm=f;Ua(d.ia.b()[x],f?I:xd)}d=this.ia;f=d.b();if(!this.Y7||c.NY!=this.Y7.NY){m(f,this.dOc+J+c.NY);this.Agb&&d.LXa(c.LWa)}if(this.Agb){d.U1(c.Fad);if(!this.Y7||c.v4a!=this.Y7.v4a||c.LWa!=this.Y7.LWa)DF(d,c.v4a,c.LWa)}this.g2b=k;this.Y7=this.W7a}BY.C.i4a[z](this,a)};
+BY[w].Cza=function $uQa(a){if(a=a.rnb){var c=a.yK?a.yK():OHc;this.W7a=c;if(!this.Y7||this.Y7.minWidth!=c.minWidth){var d=this.ia;d.jCa(c.minWidth||0);d.Ui(vA)}this.g2b=h;this.Rbb.wL(a)}};H(XFc,AD);XFc[w].mTa=function $vQa(a){for(var c=pDc(this.E9),d,f=0;d=c[f];f++)if(Zg(this.b(d.id),a[y])){this.D9[Lk](d);break}this.Cb.lf()};XFc[w].iZc=function $wQa(){YFc(this)};XFc[w].gZc=function $xQa(){this.O2()};var PHc="z8";XFc[w].O2=function $yQa(){for(var a=this.D9.XR,c=pDc(this.E9),d,f=0;d=c[f];f++){var g=this.b(d.id);g&&hm(g,PHc,d==a)}};H(CY,HF);F=CY[w];F.ska=B();F.ska.Ka=h;F.gua=function $AQa(){return Q3a};F.gua.Vd=h;F.Qs=E(k);F.Qs.ic=h;F.Il=E(k);F.Il.ic=h;F.Ccb=E(i);F.Ccb.ic=h;F.rz=E(k);F.rz.ic=h;F.bdb=E(9);F.bdb.Vd=h;F.Qdb=E(9);F.Qdb.Vd=h;F.q7a=E(i);F.q7a.ic=h;F.ZP=B();F.ZP.Ka=h;F.a3c=B();F.a3c.Ka=h;F.LCa=B();F.LCa.ic=h;F.D=B();F.D.Ka=h;F.iX=B();F.iX.Ka=h;F.dOa=B();F.dOa.ic=h;F.dgb=B();F.dgb.ic=h;F.s4=B();F.s4.Rn=h;F.Tqb=B();F.Tqb.Ka=h;F.z2a=B();F.z2a.ic=h;F.Umb=B();F.Umb.Ka=h;H(xGc,xx);xGc[w].iib=function $TQa(){var a=this.Ye.aha().b();this.Ye.H().w(a,Xi,yGc);this.Ye.H().w(a,Yi,zGc)};xGc[w].iib.Vd=h;H(DY,kJ);yx(xGc,DY);F=DY[w];F.ikd=h;F.dua=D(nFc);F.yGc=D(Hpa);F.BGc=D("S9");F.DGc=D("itb");F.CGc=D(xe);
+F.fvc=function $ZQa(){var a=this.B();yA++;this.itb=new HY(a);this.ha(new TA(a,this.itb));this.iI=new NS(a);this.ha(this.iI);this.LI=new IY(a);this.ha(this.LI);this.bM=Mx().Gn(12,a,this.iI);this.ha(this.bM);this.S9=new JY(a);this.ha(this.S9);this.VIa[p](this.iI,this.bM,this.S9);Mx().Kh(30,this);a=oD(a);this.H().w(a.sa,ii,this.xo);a=tL(this.B());this.H().w(a,sL,this.vZc);rAa(this.Z,this.H(),G(this.xo,this));this.xo();BGc(this,this.AA());zA()};
+F.yka=function $_Qa(a){yA++;DY.C.yka[z](this,a);this.xo();BGc(this,this.AA());zA();dE(this.B()).pb(this.AA()?Jhb:Khb)};F.vZc=function $0Qa(a){this.xo();AGc(this,a.tm)};F.xo=function $1Qa(){var a=this.B();a=oD(a);this.AA()||!this.ikd||!a?this.Fc(Zu):this.Fc(a.sa.wGc())};F.Qh=function $2Qa(a){a==U4a&&this.itb[Ek]()};var aDb,CGc;H(EY,NF);yx(CY,EY);var hHc=[],QHc=L;F=EY[w];F.Y7b=4;F.CRb=D("xk");F.iZ=function $4Qa(){var a=new Sh(top[Ic]);a.Of()[Pb](KD);if(!this.jb.SH())switch(Zh(a,pd)){case JD:this.jb[bq]({view:QO,uri:a});break;case TO:a=Zh(a,wz);var c={view:dJ};if(a)c.fk=a;this.jb[bq](c);break;default:(a=aza(Sy,a.Of()))||(a=this.Z.bH());JGc(this,a)}};
+F.L=function $5Qa(){this.aa.D();if(this.bp){this.bp.D();this.bp=i}try{yA++;Mx().Kh(3,this)}finally{zA()}EY.C.L[z](this);if(this.rY){cA(this.rY);this.rY=i}if(this.tma){this.tma.D();this.tma=i}if(this.Usa){this.Usa.D();this.Usa=i}if(this.hrb){this.hrb.D();this.hrb=i}if(this.qxa){this.qxa.D();this.qxa=i}};var RHc="qk qa",SHc="Inbox (8888)",THc="Starred (XXXX)",UHc="Chats (XXXX)",VHc="Drafts (8888)",WHc="Spam (8888)";
+F.i7=function $6Qa(){EY.C.i7[z](this);var a=this.B(),c=this.ia,d=this.B();d=new BY(d);this.zi=d.zi;this.jb=JB(a);this.jb.na=this;this.D9=dG(a);this.H().w(this,LF,this.KC);this.H().w(this,RF,this.bza);this.H().w(this,Wx,this.X6b);this.H().w(this,vA,this.X6b);this.H().w(this,Sz,this.Gqb);this.H().w(this,cy,this.SYc);this.H().w(this,Od,this.m7c);this.H().w(this,kR,this.g7c);this.H().w(this,tQ,this.iob);this.xf=fy(a);var f=this.xf.ud;this.H().w(f,Fx(Bz),this.arb);this.H().w(f,Fx(Rra),this.U2c);this.H().w(f,
+Fx(Yx),this.N1c);this.H().w(UC(RC(a)),aD,this.NYc);c.jCa(780);f=c.b();L?this.H().w(f,Vea,this.K6c):this.H().w(f,fj,this.LC);this.xk=Mx().Gn(10,this,CGc);c.ha(this.xk);this.IH=this.aa.q7a(a)||new rF(a);c.ha(this.IH);if(aDb>0){c=new cF(a);c.Ql(aDb);this.IH.ha(c)}c=qC(iA(this.B())).W();f=c.ba(PJ,RHc);c.cb()[Lc][o](f);for(var g=[knb,knb,SHc,THc,UHc,E7a,VHc,x7a,WHc,LN,wN],j=[],n=0;n<g[u];n++)j[p](g[n]);Q(f,j[kd](sl));g=f[xk]+Eva(f)[Ck]-13;c[ad](f);c=g+18;if(c>tnb)tnb=c;c=new mJ(a);f=this.sg;f.s0.set(sw,
+c);f.F8a=sw;this.IH.ha(c);this.D9.H8=c;this.Zub=new gF(a);this.IH.ha(this.Zub);if(CGc>0){c=new cF(a);c.Ql(CGc);this.IH.ha(c)}this.Zub.ha(d);Vw(O.S(),aJ,this.Hpb,this,h);Vw(O.S(),EO,this.Zsb,this,h);QHc&&bA(LGc,this.Nmd,5E3,this)};F.Zsb=function $7Qa(){var a=this.B(),c=this.aa.s4(a);c||(c=new KY(a));c.dk(this);this.bp=c;this.H().w(this,UF,c.h7c,k,c);this.H().w(this,rH,c.Q1c,k,c)};
+F.Hpb=function $8Qa(){var a=this.V;this.I5=new LY(a);this.Zub.ha(this.I5);this.H().w(this,Sra,this.Nqb);this.H().w(this,Tra,this.yTa);this.Usa=new XHc(a);this.hrb=new YHc(a.J(XC),dE(a));this.aa.LCa();try{yA++;Mx().Kh(11,this.B())}finally{zA()}};F.zc=function $9Qa(){return this.zi?this.zi.zc():i};F.wQb=D("zi");F.Xta=function $aRa(){return this.zi.Xta()};F.b3a=function $bRa(a){EY.C.b3a[z](this,a);this.Rh.Ox()};F.BHb=function $cRa(){QGc(this)};
+F.sEa=function $dRa(a){QF(this,Obb);var c=0;if(this.CP)c=this.CP.mg;if(!this.aa.rz(c,a)){a=this.zi.zc();if(c==15){c=this.CP.VAb;if(c.X9){a=this.zi.zc();a.md()==YK&&a.Ena(c)}else this.jb[bq](c);if(c.cx==1&&!this.aa.dgb())this.fc[Wp](Ura);else c.cx>1&&this.fc[Wp](Vra)}else{c=new LDc(this.B());c.IFa=h;kF(this.Mb,c);c[Mb]();a.md()==YK&&a.sOa()?a.Sod():this.zi[Sq]()}}};var ZHc="CLEAR_VIEW_CACHE";
+F.spb=function $eRa(a){var c=a.jna,d=i;switch(c){case P4a:if(a.ZH[dd])AFa(this.Lh);else{QF(this,ZO);this.jb[bq]({view:QO})}dE(this.B()).pb(Sgb);break;case V4a:d=G7a;break;case W4a:d=I7a;break;case X4a:d=Q3a;break;case Y4a:d=R3a;break;case Z4a:d=F7a;break;case h5a:var f=a.ZH[y];if(f&&f[Uc]&&f[Uc](Lna)){a.ZH[zb]();return}this.xB.lf();pD(this.B())&&pD(this.B()).wbb();break;case a5a:if(DD())vE(this.B());else if(Jz(Rz(this.B()),832))this.D9[Lk](hF(this.B()).jAa.contacts);else{QF(this,fcb);this.jb[bq]({view:SO})}break;
+case sM:(f=this.W().b(HBa))&&this.sEa(f[Uc](C9a));break;case n5a:if(!(L&&wg<7&&this.zi.zc().md()==eab)){if(!this.tma)this.tma=new UG(this.B());this.tma.Nc()}break}if(c==ZHc){hQa(this.zi);zLa(this.Aa.g1,h);f=h}else f=k;if(!f)if(!Mx().Gn(4,this.zi.zc(),c,a.ZH)){if(d!=i){QF(this,RTa);JGc(this,d)}this.zi.Qh(c,a.ZH);this.xk.Qh(c,a.ZH);pH(this.sg).Qh(c,a.ZH);this.bp&&this.bp.Yb()}};F.g4c=function $fRa(a){a=yh(a);var c=a[Pc];if(c)Ip(a,Hy.f_(c));if(c=a[Wq])Gp(a,CB.i3a[c]);this[bq](a)};F.SH=function $gRa(a){return this.zi.SH(a)};
+F.gH=function $hRa(a){return this.zi.gH(a)};fp(F,function $iRa(a){this.aa.Umb(a);this.I5&&this.I5.ska();if(this.bp){this.bp.Yb();this.bp.Jac()}var c=this.zi[bq](a);this.aa.ska(a);return c});F.KC=function $jRa(){this.bp&&this.bp.Yb()};F.K6c=function $kRa(a){a[dd]&&FGc(this,a[y])&&a[zb]()};F.LC=function $lRa(a){if(a[dd]&&FGc(this,a[y])){a[zb]();this.xB.lf()}};F.bza=function $mRa(a){(a=RGc(this,a[Wq]))?a.kJ():JGc(this,this.Z.bH())};F.fqb=function $nRa(){this.Y7b=NBa(this.zi.sK());GGc(this);this.Qxa()};
+F.Qxa=function $oRa(){if(!this.Zha&&this.zi.zc()){this.Zha=h;this.UH();WC(this.dda)}};
+F.UH=function $pRa(){EY.C.UH[z](this);var a=this.B(),c=O.S(),d=a.J(Xx);ADc(d);this.zi.cGb=h;Ww(c,aJ);Ww(c,OL);Ww(c,OD);if(JEa(a))if(Jz(this.Z,1074)){IGc(this,new OFc(a));d=Ww(c,fP);Zw(d,function(){(new aIc(this.B())).wc()},this)}else{IGc(this,new DY(a));d=Ww(c,VP);Zw(d,function(){(new bIc(this.B())).wc()},this)}if(jga){d=Ww(c,JD);Zw(d,function(){LH()&&GQa(a)})}this.Z[Bq](5007)&&!this.Ma.db(sN)&&Ww(c,QN);Mx().Kh(4,a)};
+var cIc="You have been signed out of this account.\n\nThis may have happened automatically because another user signed in from the same browser. To continue using this account, you will need to sign in again. This is done to protect your account and to ensure the privacy of your information.",dIc='You have been signed out of this account.\n\nThis may have happened automatically because another user signed in from the same browser. To continue using this account, you will need to sign in again.\n\nIf you were composing a message, you can copy and paste the text of the message into another application, such as a text editor. When you\'re done, click "Sign out" and then sign in again to finish composing your message.';
+F.Epb=function $qRa(){var a=this.zi.zc();if(!a||!a.Bo(k)&&!a.gY()){a&&a.Df();this.fc[Wp](cIc);Na(top,vDc(this.Z))}else this.fc[Wp](dIc)};F.Qs=function $rRa(a){EY.C.Qs[z](this,a);if(!this.aa.Qs(a))if(bCa(a)){var c=a.SU?1:0;a=new Zz(a.Wd(),c,i,a.vH(),a.QE());c=G(this.Il,this);a.qk=c;c=this.Rh;c.Vrb[p](a);c.qa=1;GGc(this)}};var eIc="Some ",fIc=" features have failed to load.",gIc=" features have failed to load due to an Internet connectivity problem.",hIc="?ui=html";
+F.FTa=function $sRa(a,c,d){var f;switch(d){case 0:this.Epb(i);return;case 3:f=this.zi.y1b.J(c);this.aa.dOa()||MGc(this,f);return;case 1:f=eIc+(Ji+fIc);break;case 2:f=eIc+(Ji+gIc);break}a=Uh(new Sh(Mj),I);c=xH==a.ul?xd:I;d=(new Sh(a)).Pr(xH);f={FOc:f,qbd:a[t](),xkd:c,bhd:d[t](),hEc:Era,dMc:hIc,HK:Yz(this.Lb,99541)};if(!this.qxa||!this.qxa.Ib())this.qxa=FC(iA(this.B()),wGc(f))};F.NYc=function $tRa(){for(var a=0;a<hHc[u];a++){var c=hHc[a];c&&!c[Rq]&&c[Xk]()}};F.SYc=function $uRa(){this.xk.pda()};
+F.m7c=function $vRa(){this.xk.iba()};F.g7c=function $wRa(a){this.xk.Ama(a[wq],a.fEc,a.sLc,a.O5,a.nt,a.dq)};F.yTa=function $xRa(a){var c=this.B();if(c=oD(c)){a.wec?c.sa.mba():c.sa.nba();c=this.sg.Hp(pJ);c.Wq.jB(a.wec);c.Wq[r](hJ)}};F.Nqb=function $yRa(a){switch(a[jr]){case 0:this.xk.iba();break;case 1:this.xk.Ksa();break}};
+F.arb=function $zRa(a){var c=new aAa(a[dq]);a=c.O[1];if(c.O[2]!=hea)this.aa.dOa()||MGc(this,void 0);else if(a!=ti)(c=c.O[5])&&this.Usa&&this.Usa.Eid(a,c);else c.O[4]&&this.kg&&oDc(this.kg,c.O[4])};F.U2c=function $ARa(a){var c=a[dq][1];if(tQa(this.zi)){rDc(this.B());bA(LGc,function(){Na(top,c)},0)}};F.sqb=B();F.X6b=function $CRa(a){PGc(this);var c=this.zi.zc();this.xk.wL(c);this.I5&&this.I5.wL();a.FV&&this.D9.BEa(a.FV);pH(this.sg).TE(c);this.Qxa();Mx().Kh(110,c)};F.cZc=function $DRa(){this.rY=i;QGc(this)};
+F.iob=function $ERa(a){a.q9==this.zi.zc()&&PGc(this)};F.uka=function $FRa(a){EY.C.uka[z](this,a);for(var c=0;c<a.Ti[u];c++)this.inb.set(a.Ti[c],1);this.uWc.Pfa()};F.p4c=function $GRa(){for(var a=this.zi.vz,c=[],d=0;d<a[u];d++){var f=a[d];if((f.md()==wE||f.md()==xE)&&f.Toa)c[p](f)}for(a=0;a<c[u];a++){d=c[a];d.Bb().lba(this.inb)&&mDc(d)}this.inb[bc]()};var iIc="cache_hide",jIc="firebug_hide",kIc="bg_hide",lIc="ie_hide",mIc="gm_change",nIc="gm_hide";
+F.Il=function $HRa(a,c){if(!this.aa.Il(a))if(a==Wra)this.sEa(c);else if(a==Mra){dE(this.B()).pb(Mhb);DGc(this.B(),0,[c])}else if(a==Xra){QF(this,W0a);this.jb[bq]({view:YK,search:this.aa.gua(),BXa:c,zz:0,Iba:[]})}else if(a==Yra){a=this.zi.zc();var d=a.md();if(d==YK)a.oI(c);else d==QO&&a.oI()}else if(a==iIc){this.S4a=h;oi(Ega);FY(this)}else if(a==jIc){this.mPb=h;oi(Cga);FY(this)}else if(a==kIc){this.FHb=h;oi(Dga);FY(this)}else if(a==lIc){this.eWb=h;oi(Hga);FY(this)}else if(a==mIc){c=dC(this.B());Na(eC(c).top,
+"http://mail.google.com/mail/googlemail/rebrand")}else if(a==nIc){this.OTb=h;oi(Jga);FY(this)}else a==frb&&this.jb[bq]({view:dJ,fk:c})};F.tqd=function $IRa(a){return PC(KC(this.B()),a)};F.IFc=function $JRa(){return cJa(this.kg,this.kg.dX.x4)};F.BSc=function $KRa(a){this.kg.pQ=a;a=this.kg;a.dX.x4!=a.pQ&&bJa(a)};var oIc="Refreshing last activity footer";F.Pdd=function $LRa(){var a=new zD(this.xf.ud);a.bD(k);a.wl(h);a.Ne(mB);a.OW(k);a.Ua(pd,Br);a.Se(oIc);a[Mb]()};
+F.UOc=function $MRa(a,c,d){hHc[d][Xk]();hHc[d]=i;a=new KDc(this.B(),a);kF(this.Mb,a);a[Mb]()};F.Gqb=function $NRa(a){DGc(this.B(),a.q9,a.Qza)};F.Nmd=function $ORa(){if(this.testingEnabled)FY(this);else{this.uda=new nDc(this.Mmd,this);this.uda.qJ()}};F.Mmd=function $PRa(){var a=dE(this[uq]());if(this.Bpa=this.uda.Bpa)a.jj(akb,qDc(this.Bd)?Hj:Ah);this.uda.lvc&&a.pb(Xjb);this.uda.bmd||a.pb(Yjb);this.uda.Ucd&&a.pb(Zjb);if(!this.Bpa&&this.S4a){Mda(Ega);this.S4a=k}this.uda=i;FY(this)};
+F.N1c=function $QRa(a){a=new JDc(a[dq]);if(a.hf()!=this.xVb){this.xVb=a.hf();FY(this)}};var _GM_main=h,_GM_labelNamePrompt=WJ,_GM_labelNameRetry="Please try another name:",_GM_openInviteWindow=i,_GM_chatEngine=i,_GM_chatController=i,_GM_mwm=i,_GM_bcService=i,_GM_JSVersion=ti;_B_prog(96)}catch(e){_B_err(e)}
+
+try{H(iHc,xi);Xw(O.S(),Xx).ym(iHc);iHc[w].tb=function $RRa(a){a=a;a=Dx(Cx(a));new YI(a)};Ax(jHc,rJ,1);jHc[w].AYa=E(h);jHc[w].Pca=function $TRa(a,c){Jz(Rz(c),832)||a.Pca(Nd,new qJ(c))};H(kHc,pB);kHc[w].Ja=function $URa(a){kHc.C.Ja[z](this,a);a.wl(h);a.Ua(zz,this.Rj)};kHc[w].Zg=E("Sending invitation");H(AHc,kJ);Mx().Ug(2,function(b){b=b.B();sH(b).Vr(new AHc(b),2)});F=AHc[w];F.Tic=function $WRa(){var a=this.Z[hq](VN)>0;a&&this.cp();this.qc(a)};var pIc="ivbtn",qIc="ivcs",rIc="ivi",sIc="ivpl",tIc=" left";F.nr=function $XRa(){return{si:Ji,fDd:this.Z[hq](VN),nJ:this.X(pIc),dzc:this.X(qIc),Pw:this.X(rIc),Ij:this.X(sIc),VOc:this.Z[hq](VN)+tIc}};var uIc="Invite a friend",vIc="pY",wIc="p1";
+F.Jc=function $YRa(){yA++;try{var a=this.B();this.Fc(uIc);this.P1(vIc);this.hXb=new eE(a);this.hXb.xb(yHc(this.nr()));this.ha(this.hXb);this.qV=new ZA(a);K(this.qV.b(),wIc);this.ha(YA(this.qV))}finally{zA()}};F.cp=function $ZRa(){var a=this.b(qIc);if(a)Q(a,this.Z[hq](VN)+tIc)};F.ma=function $_Ra(){AHc.C.ma[z](this);this.H().w(this.b(pIc),P,this.Pla);this.H().w(this.b(sIc),P,this.mqb);var a=this.b(rIc);this.H().w(a,Zi,this.ql);GG(this.B()).Wr(a);this.Tic()};
+F.Ba=function $0Ra(){AHc.C.Ba[z](this);this.H().wb();GG(this.B()).lw(this.b(rIc))};var xIc="Please specify who you wish to invite.";F.Pla=function $1Ra(){var a=this.b(rIc);if(im(a[q]))this.fc[Wp](xIc);else{var c=new kHc(this.B(),a[q]);c.Ie(this);kF(this.Mb,c);c[Mb]();pa(a,I)}};var yIc="Oops, we weren't able to send your invite. Please try again later.";F.wh=function $2Ra(a){if(a.eg){a=new Zz(rB(a));var c=PF(this);c=G(c.Il,c);a.qk=c;this.qV.Ad(a)}else this.fc[Wp](yIc)};
+F.mqb=function $3Ra(){var a=this.b(rIc)[q];this[r](new TF(this,Sz,0,a))};F.ql=function $4Ra(a){if(a[Sb]==13){a[zb]();GG(this.B()).vj()||this.Pla(a)}};function dKc(b){CY[z](this,b)}function eKc(b){b=kA(b.Bc.B(),bM);Zw(b,function(a){a.tb()});Yw(b,sg)}function fKc(b){b=kA(b.Bc.B(),erb);Zw(b,function(a){a.tb()});Yw(b,sg)}zx(dKc,CY);dKc[w].ZP=function $1Sa(){Nfa.J()&&Mx().oz(4,G(this.UH,this))};dKc[w].UH=function $2Sa(){eKc(this);fKc(this)};function XKc(b){this.Qzb=b}var YKc="GOTO_TASKS",ZKc="Go to Tasks",aLc="ADD_TO_TASKS",bLc="Add conversation to Tasks",cLc="Add to Tasks";
+function dLc(b){this.Z=Rz(b);var a=Jz(this.Z,998),c=Jz(this.Z,375);a=a&&!c?VCc:undefined;Bx(this);PI[z](this,b,uLb,undefined,G(this.dUa,this,h,k,undefined),this.aa.BJa(UVa),a);OF.Gi(uQ,YKc,ZKc);hlb.bq[p](YKc);s5a=aLc;OF.Gi(bM,s5a,bLc);rQ.bq[p](s5a);SB(95,cLc,mbb,Urb,k,[Oy,cz,az,ez,Py,fz,Nd,ul,iz,pP,kz,ZK,Jy,pz,Yy,sz,aL,ce],3);this.Ma=yy(b);b=Aya(this.Ma);Zw(b,G(this.K8c,this))}function eLc(){}H(XKc,pY);Ax(XKc,pY,0);XKc[w].QRa=function $dTa(a,c){a=kA(a,UF);Zw(a,c)};XKc[w].PRa=E(k);XKc[w].BJa=Ee();H(dLc,PI);yx(pY,dLc);F=dLc[w];F.K8c=function $gTa(){this.Ma.db(L5a)&&this.aa.QRa(this[uq](),G(this.T9c,this))};var fLc="tasks_mole_loaded",gLc="gtasks.TasksNavigationTab performAction MOLE_LOAD";F.dUa=function $hTa(a,c){if(!this.aa.PRa()){this.C3a=new vLb(this[uq](),nbb,this,fLc,gLc);var d=kA(this[uq](),bv);Zw(d,function(f){f.YH(a,!!c)})}};F.T9c=function $iTa(){this.dUa(k,this.Ma.nf(N5a))};F.dXc=function $jTa(){this[r](fLc)};F.Qh=function $kTa(a){a==YKc&&this.dUa(h)};Ax(eLc,rJ,0);eLc[w].AYa=E(h);eLc[w].Pca=function $mTa(a,c){a.Pca(vr,new dLc(c))};Mx().Ug(11,function(b){(new ALc(b)).wc()});var BLc="1 Labs feature is enabled",CLc=" Labs features are enabled",DLc='<img src="pimages/2/labs/labs_bar_icon.png" width="11" height="11" alt="" class="nG"/>';function ELc(b,a){var c=a||new U,d=new U;b.TSa==1?d[R](BLc):d[R](b.TSa+CLc);kE({id:b.jRc,title:d[t](),Ab:DLc},c);if(!a)return c[t]()}function FLc(b){this.Rd=b;this.Z=Rz(b.B());this.Bnb=this.Z.TSa();this.ll=i;this.jb=JB(b.B())};zx(FLc,sY,80);var GLc="80:la";FLc[w].HE=function $zTa(){return this.Bnb>0?new tY(ELc({jRc:this.Rd.X(GLc),TSa:this.Bnb}),80):[]};FLc[w].ma=function $ATa(){if(this.Bnb>0)this.ll=ih(this.Rd.b(GLc),P,this.He,k,this)};FLc[w].Ba=function $BTa(){this.ll&&oh(this.ll)};FLc[w].He=function $CTa(a){if(!a[dd]&&!a[Bc]&&!a[Eb]){QF(this.Rd,jP);this.jb[bq]({view:dJ,fk:Wfa});a[zb]()}};function HLc(b){this.O=b;if(this.O[1])this.Wc=new ILc(this.O[1])}function ILc(b){this.O=b}function JLc(b){oH[z](this,b,26)}function KLc(b){this.bi=b;this.Mb=jF(b.B())}HLc[w].Mo=D(jsa);Ha(HLc[w],function $ETa(){return this.O[t]()});HLc[w].kc=D(ae);ILc[w].Ga=function $GTa(){return this.O[0]};ILc[w].Nf=function $HTa(){return this.O[1]};Ha(ILc[w],function $ITa(){return this.O[t]()});ILc[w].kc=D(ae);_B_prog(97)}catch(e){_B_err(e)}
+
+try{H(JLc,oH);var LLc="lno",MLc="Loading login notification.";JLc[w].Ja=function $KTa(a){JLc.C.Ja[z](this,a);a.Ua(pd,LLc);a.Ne(mB);a.Se(MLc)};JLc[w].rk=function $LTa(a,c,d){if(c==LLc)this.Wc=(new HLc(d)).Mo()};zx(KLc,vY);F=KLc[w];F.Goa=function $MTa(){Mx().oz(4,G(this.UWa,this))};var NLc=":48";F.UWa=function $NTa(){bA(NLc,G(this.Ex,this),5E3)};F.Ex=function $OTa(){var a=new JLc(this.bi.B());a.Ie(this);kF(this.Mb,a);a[Mb]()};F.wh=function $PTa(a){if(a instanceof JLc)(a=a.Wc)&&Vw(O.S(),ksa,G(this.Jra,this,a),this,k,h,h)};F.Jra=function $QTa(a){var c=a.Ga();(this.Eya=OLc().H(c,this.bi.B()))&&this.Eya.DJc(a)};F.D=function $RTa(){if(this.Eya){this.Eya.D();this.Eya=i}};function PLc(b,a,c,d,f){a.w(b,c,d,f)}function QLc(b,a){var c=a||new U;c[R](UZa,b.yZa,Uf);RLc(b,c);c[R](gB);if(!a)return c[t]()}var SLc="0.4",TLc="0.3",ULc="0.2";function RLc(b,a){var c=a||new U;c[R](WG,Rd,jE,ls,As,Rd,J,bDc,W);if(b.PTb)c[R](VCc);else if(b.B6a&&b.G3a)c[R](SLc);else b.B6a||b.G3a?c[R](TLc):c[R](ULc);c[R](gB);if(!a)return c[t]()}function VLc(b){this.Rd=b;this.Z=Rz(b.B());this.K7=Jz(this.Z,1044);this.Lb=Tz(b.B())}function WLc(b){(b=b.Rd.b(cDc))&&ph(b)}
+function XLc(b){if(b.LI){b.LI.D();b.LI=i}}function YLc(b){this.bi=b;ih(b.B().Ya(),Yj,this.x5b,k,this)}function ZLc(b){CY[z](this,b)}function aMc(b){this.Qzb=b};zx(VLc,sY,60);F=VLc[w];F.HE=function $STa(){if(bx()||!Qsb()||this.K7)return i;return new tY(QLc({yZa:this.Rd.X(cDc),B6a:Jz(this.Z,896),G3a:Jz(this.Z,850),PTb:this.K7}),60)};F.ma=function $TTa(){if(Qsb()){var a=Mx();if(jA(this.Rd.B(),Od))this.DWb();else{if(!this.K7){var c=this.Rd.b(cDc);c&&PLc(c,aB,this.Q5b,k,this)}a.Ug(102,G(this.eLb,this));a.Ug(100,G(this.DWb,this))}a.Ug(101,G(this.kJc,this))}};F.Ba=function $UTa(){WLc(this)};
+F.DWb=function $VTa(){var a=jA(this.Rd.B(),Od);a&&a.o3(this.Xeb,this);var c=this.Rd.b(Uu);c&&K(c,mP);this.LI||this.eLb(a.jC())};F.kJc=function $WTa(){var a;if(this.K7){a=this.Rd.b(SL);Pg(a)}else{a=this.Rd.b(cDc);Q(a,RLc({B6a:Jz(this.Z,896),G3a:Jz(this.Z,850),PTb:this.K7}));aB.w(a,this.Q5b,k,this)}XLc(this)};F.eLb=function $XTa(a){this.LI=new OY(this.Rd.B(),a);this.LI.Ig(this.Rd);a=this.K7?this.Rd.b(SL):this.Rd.b(cDc);WLc(this);Pg(a);this.LI.eb(a);this.K7&&a[o](this.Rd.W()[yb](Su))};
+F.Q5b=function $YTa(){PR[pb](G(this.hyb,this))};F.hyb=function $ZTa(){var a=kA(this.Rd.B(),KF);Zw(a,function(c){c.gLa()})};F.D=function $_Ta(){XLc(this)};F.Xeb=function $0Ta(){var a=this.Rd.b(GO),c;if(a){c=DD()?Ksb(this.Lb):tDc(this.Lb);Mp(a,c)}};zx(YLc,vY);YLc[w].D=function $1Ta(){nh(this.bi.B().Ya(),Yj,this.x5b,k,this)};YLc[w].x5b=function $2Ta(){var a=jA(this.bi.B(),Od);a&&a.o3(this.Xeb,this)};YLc[w].Xeb=function $3Ta(){var a=this.bi.ci.b(Wu);if(a)jk(a,DD())};zx(ZLc,CY);F=ZLc[w];F.ZP=function $4Ta(){lA(this.Bc.B(),KF,XL)};F.Il=function $5Ta(a){if(this.rHa&&this.rHa.Il(a)){FY(this.Bc);return h}return k};F.Ccb=function $6Ta(){if(!this.rHa){if(!this.ouc){var a=kA(this.Bc.B(),kR);this.ouc=h;Zw(a,this.nuc,this);Yw(a,sg)}return i}return this.rHa.Mo()};F.nuc=function $7Ta(){this.rHa=this.Bc.B().J(kR);var a=this.Bc;a.Rh.jMb||FY(a)};F.iX=function $8Ta(){Vo()&&gy(this.Bc.B()).ud.iX()};F.dOa=function $9Ta(){if(Vo()){this.IT().Yma();return h}else return k};
+F.IT=function $$Ta(){return jA(this.Bc.B(),Od)};F.dgb=function $aUa(){if(CD()){dC(this.Bc.B())[Wp](fBc);return h}return k};H(aMc,pY);zx(aMc,pY,1);aMc[w].QRa=function $bUa(a,c){if(Vo()){if(!this.Q)this.Q=new kn(this);jA(a,Od)?this.Qtb(a,c):ln(this.Q,a.Ya(),Yj,G(this.Qtb,this,a,c))}else this.Qtb(a,c)};aMc[w].Qtb=function $cUa(a,c){if(!DD()){a=kA(a,UF);Zw(a,c)}};aMc[w].PRa=function $dUa(){if(DD()){vE(this.Qzb[uq]());return h}return k};aMc[w].BJa=function $eUa(a){return a+ina};var hMc="Import complete!",iMc="bD",jMc="Your contacts and messages from ",kMc="</b> have finished importing.",lMc="Your messages from ",mMc="Your contacts from ",nMc="Visit the ",oMc=" label to see your messages.";
+function pMc(b,a){var c=a||new U;c[R](X,EEc,Gl,b.puc,wl,FEc,W);kE({id:b.rBc,Ab:zoa},c);c[R](Z,hMc);b=b.emb;for(var d=b[u],f=0;f<d;f++){var g=b[f];c[R](X,iMc,W);if(g.Mva&&g.Chb){var j=jMc+(ZG+(V(g.Zc)+kMc));c[R](j)}else if(g.Mva){j=lMc+(ZG+(V(g.Zc)+kMc));c[R](j)}else{j=mMc+(ZG+(V(g.Zc)+kMc));c[R](j)}g.Lbb&&c[R](J,uwb);if(g.Zh){g={className:I,title:V(g.EQa),href:V(g[Yc]),yU:V(g.EQa)};j=new U;j[R](HI,g[Yc],Lt,g[Pk],tra,g[uc],W,g.yU,hB);g=j[t]();c[R](J,nMc+(g+oMc))}c[R](Z)}c[R](Z);if(!a)return c[t]()}
+function qMc(b,a,c){pB[z](this,b,93,a);this.Rj=c}function rMc(b){this.O=b;this.O[1]=this.O[1]||[];this.u8=[];for(b=0;b<this.O[1][u];b++)this.u8[b]=new VR(this.O[1][b])}function sMc(b){oH[z](this,b,18);this.Wxa=[]}function tMc(b){this.bi=b;this.Y=qC(b.B()).W();this.Mb=jF(b.B());this.BY=[]}var uMc=":49";function vMc(b,a){if(!b.Dub){b.Dub=h;bA(uMc,G(b.Chd,b),a)}}
+function wMc(b){for(var a=b.bi,c=[],d=0;d<b.BY[u];d++){var f=b.BY[d],g=f.Dd(),j=nD(a.B())+Lj+Uy(g).Xs();c[p]({Zc:f.Vc(),Zh:!im(g),href:j,EQa:g,Chb:f[Bq](4),Mva:f[Bq](2),Lbb:f.hf()==9})}return{rBc:a.X(ie),puc:a.X(T9a),emb:c}};H(qMc,pB);qMc[w].Zg=E("Dismiss migration banner");qMc[w].Ja=function $kUa(a){qMc.C.Ja[z](this,a);a.Be(mQ,this.Rj)};qMc[w].Eg=E(k);Ha(rMc[w],function $mUa(){return this.O[t]()});rMc[w].kc=D(ae);H(sMc,oH);var xMc="Loading completed migrations.";sMc[w].Ja=function $oUa(a){sMc.C.Ja[z](this,a);a.Ua(pd,ana);a.Se(xMc)};sMc[w].rk=function $pUa(a,c,d){if(c==ana)this.Wxa=(new rMc(d)).u8};zx(tMc,vY);F=tMc[w];F.Dub=k;F.Goa=function $qUa(){Mx().oz(4,G(this.jOc,this))};F.y2a=function $rUa(){if(this.BY[u]>0){var a=this.Y[Qb](T);Q(a,pMc(wMc(this)));this.AQ();this.Z8a=ih(a,P,this.IYc,k,this);return a}return i};F.jOc=function $sUa(){vMc(this,3E3)};F.Chd=function $tUa(){var a=new sMc(this.bi.B());a.Ie(this);kF(this.Mb,a);a[Mb]()};
+F.wh=function $uUa(a){if(a instanceof sMc){this.Dub=k;for(var c=[],d=0;d<a.Wxa[u];d++){var f=new WR(a.Wxa[d]),g=f.hf();if(g==5||g==9)c[p](f)}this.BY=c;this.BY[u]>0&&this.bi.OP();vMc(this,432E5)}else e(Error(".247"))};F.IYc=function $vUa(a){var c=this.bi;if(a[y].id==c.X(ie)){for(a=0;a<this.BY[u];a++)(new qMc(c.B(),7,this.BY[a].Vc()))[Mb]();this.BY=[];this.AQ();if(c=c.b(T9a))Ua(c[x],xd)}};F.AQ=function $wUa(){if(this.Z8a){oh(this.Z8a);this.Z8a=i}};F.D=function $xUa(){this.AQ()};function OOc(b){this.kj=b;this.Q=new kn(this);this.Bd=rD(b.B());this.jb=JB(b.B());this.bF=k;b=Mx();Nx(b,4,G(this.Qfb,this))}zx(OOc,xY);F=OOc[w];F.N2=function $KWa(a,c){this.bF=!!a&&a.id==Xz&&c.md()!=xE};F.vza=D(vnb);F.D=function $MWa(){OOc.C.D[z](this);Kf(this.Q);Kf(this.Ud)};F.a9=function $NWa(a){var c=this.kj.Qe();if((a=a.IRc)&&c==a[t]()){c=a.ABa;if(c==Hz){c=Uy(a.dbc);this.jb[bq]({view:wE,search:c});this.kj.ny[yk]();return}else if(c==Ph){this.jb.SH(a.dbc);this.kj.ny[yk]();return}}uFc(this.kj)};
+F.Qfb=function $OWa(a,c){if(c==Jwb&&a.md()!=xE){this.kj.Ksa();this.kj.uo(cra);this.Ud.Zaa(cra);JMa(this.Ud);return h}return i};F.zT=function $PWa(a,c){if(a&&a.id==Xz&&c.md()!=xE){this.Ud||this.Bqa();return this.Ud}else return i};F.Bqa=function $QWa(){var a=this.kj.B();this.Ud=new GCc(a,this.kj.ny,this.Bd.Zf,new wCc(a));this.Q.w(this.Ud,era,this.a9)};_B_prog(98)}catch(e){_B_err(e)}
+
+try{function POc(b){this.bi=b;this.Y=qC(b.B()).W()};zx(POc,vY);POc[w].Goa=function $RWa(a){a=Rz(a);var c=this.bi,d=this.bi.H();d.w(a,a.Cq(v8a),c.OP,k,c);d.w(a,a.Cq(u8a),c.OP,k,c)};
+var QOc="You have run out of space for your ",ROc=" account. You will not be able to send or receive any emails until you delete some items.",SOc='<a target="_blank" href=',TOc="view our tips on reducing your email storage",UOc=" or ",VOc='">purchase additional storage</a>.',WOc="aF",XOc='" width="100%"><tr><td class="',YOc="bV",ZOc="bW",aPc="You are almost out of space for your ",bPc="aG";
+POc[w].y2a=function $SWa(a){var c={si:a[hq](f8a),F9b:a[hq](x8a),q9b:a[hq](w8a)},d;if(a[hq](v8a)){d=new U;a=QOc+(V(c.si)+ROc);c=eDc+(SOc+V(c.F9b)+Uf+(TOc+(hB+(UOc+(tsa+V(c.q9b)+VOc)))));d[R](X,WOc,RG,ul,XOc,YOc,W);xI({Hb:ZOc},d);d[R](GI,a,kv,c,Zs);d=d[t]()}else if(a[hq](u8a)){d=new U;a=aPc+(V(c.si)+usa);c=eDc+(SOc+V(c.F9b)+Uf+(TOc+(hB+(UOc+(tsa+V(c.q9b)+VOc)))));d[R](X,bPc,W,a,kv,c,Z);d=d[t]()}if(d){c=this.Y[Qb](T);Q(c,d);return c}return i};function fQc(){}function gQc(){hQc||(hQc=new fQc);return hQc}var hQc;fQc[w].m_b=k;fQc[w].Y1b=k;var iQc="wn",jQc=[fDc,"wq","wp","wo",iQc];F=fQc[w];F.Nqd=Af(wE,"cS",xE,"cS",YK,"cN",QO,"cL",SO,ysa,eab,"cR",UO,"HmByof",fab,"PjD5hf");F.Pe=function $zXa(a){if(this.vt)e(Error(".256"));this.vt=a;this.Kf=a.B();this.Y=qC(this.Kf).W();this.sg=sH(this.Kf);this.kg=nF(this.Kf)};var kQc="wm",lQc="vI8oZc";
+F.wc=function $AXa(){if(this.Y1b&&this.m_b){L&&jQc[ld](kQc);for(var a=this.Y.ba(T,{"class":lQc}),c=0;c<jQc[u];c++){var d=this.Y.ba(T,{"class":jQc[c]});this.Y[o](a,d)}this.uqa=a;if((a=this.vt.Yj.b())&&a[Tb]){Dm(a,Hm,ee);this.Y.yA(this.uqa,a[Tb])}(a=this.vt.ia.b())&&Dm(a,Hm,ee);this.wBb();ih(this.kg,YD,this.wBb,k,this)}};F.D=function $BXa(){nh(this.kg,YD,this.wBb,k,this);hQc=this.Y=this.vt=i};var mQc="backgroundPosition",nQc="px bottom",oQc="backgroundImage",pQc="backgroundPositionX",qQc="backgroundPositionY";
+F.wBb=function $CXa(){var a=this.Y.ie(T,iQc,this.uqa)[0],c=this.kg.il()[3];if(a){if(c!=0)this.kZb!=c&&Dm(a,mQc,pH(this.sg).Yh()-da(c,10)+nQc);else if(zw(a,mQc)!=I)if(L&&vg(Ij)){if(Fm(a,oQc)!=xd){var d=this.Y.ba(T,{"class":iQc});this.uqa[o](d);a[x].backgroundPositionX=Fm(d,pQc);a[x].backgroundPositionY=Fm(d,qQc);this.uqa[Nc](d)}}else this.kZb!=c&&Dm(a,mQc,I);this.kZb=c}a=this.kg.il()[2];a=da(a,10);if(this.BRc!=a){yA++;c=pH(this.sg);c.ia.Ql(c.Yh()+a);zA();this.BRc=a}};
+Mx().Ug(6,function(){var b=gQc();b.m_b=h;b.wc()});Mx().Ug(240,function(){var b=gQc();b.Y1b=h;b.wc()});Mx().Ug(2,function(b){gQc().Pe(b)});Mx().Ug(3,function(){var b=gQc();b&&b.D()});var rQc="vI8oZc ";Mx().Ug(110,function(b){var a=gQc(),c;if(b.yK)c=b.yK().Rzc;c=c||a.Nqd[b.md()];m(a.uqa,rQc+c)});function wUc(b){this.bi=b}zx(wUc,vY);var xUc=":51",yUc=":52";wUc[w].Txb=function $jZa(){var a=this.bi.B(),c=yy(a);if(!c.nf(KM))return k;this.TBb&&cA(this.TBb);a=(new Date)[hc]();var d=c.Ep(W5a);if(d&&d>a){this.TBb=bA(xUc,this.bi.OP,d-a,this);return k}if(c=c.Ep(NM)){if(c<a)return k;this.TBb=bA(yUc,this.bi.OP,c-a,this)}return h};O.S().gb(Xx);Ci(O.S(),Xx);var zUc="hP",AUc="</span></h1>";function GZb(b,a){var c=a||new U;c[R](vra,xy,OI,b.fb.g3,S,zUc,W,b.m2,ns,b.fb.ODb,W);W4b(b,c);c[R](AUc);if(!a)return c[t]()}
+function W4b(b,a){var c=a||new U;b=b.Ti;for(var d=b[u],f=0;f<d;f++){var g=b[f],j=c||new U;j[R](Fl,ul,J,Zpa,ms,Lsa,J,ov,YJ,pv,J,ov,OH,iu,J,ov,aC,V(g[lq][jq]),OH,vqa,J,ov,aC,V(g[lq][jq]),OH,hu,J,ov,aC,V(g[lq][jq]),OH,qv,J,ov,Msa,hqb,YJ,pv,J,iu,J,ov,aC,V(g[lq][jq]),OH,iu,J,ov,aC,V(g[lq][jq]),Nsa,V(g[lq].tg),EF,Ypa,Ir,V(g[ec]),Lt,V(g.Ibc),Ys,V(g.Ibc),W,V(g.ke),Qt,vqa,J,ov,aC,V(g[lq].tg),OH,hu,J,ov,aC,V(g[lq][jq]),Nsa,V(g[lq].tg),EF,Xpa,Ir,V(g[ec]),Lt,V(g.eac),Ys,V(g.eac),W,Sz,Qt,qv,J,hu,J,ov,aC,V(g[lq][jq]),
+Msa,Lsa,J,ov,YJ,pv,J,ov,OH,iu,J,ov,aC,V(g[lq][jq]),OH,vqa,J,ov,aC,V(g[lq][jq]),OH,hu,J,ov,aC,V(g[lq][jq]),OH,qv,J,ov,lRa);c||j[t]()}if(!a)return c[t]()}var BUc="New Message from ",CUc=" New Messages",DUc='</span>&nbsp;&nbsp;<span id="',EUc="Update Conversation";function V4b(b,a){var c=a||new U;c[R](pE);if(b.N2b==1){var d=BUc+V(b[Hma]);c[R](d)}else c[R](b.N2b+CUc);c[R](DUc,b.xEa,S,rv,W,EUc,DUc,b.aNc,S,rv,W,Pr,gB);if(!a)return c[t]()}Bi(O.S(),"sy165");O.S().gb("sy165");Ci(O.S(),"sy165");Bi(O.S(),"sy166");var FUc="Sponsored mail with enhanced content";function q6b(b,a){var c=a||new U;c[R](FUc,bH,V(b.io),cH,eB,hB);if(!a)return c[t]()};O.S().gb("sy166");Ci(O.S(),"sy166");Bi(O.S(),"sy170");var NUc=" 7 5";function OUc(b,a,c,d){if(Fh&&!Ri)return b;b=Xaa+a+Yaa;if(Jg)b+=NUc;b+=hg+c;if(!Fh&&d)b+=" !important";return b};O.S().gb("sy170");Ci(O.S(),"sy170");var PUc='" selector="',QUc="C1";function RUc(b,a){Ix(b);if(a=b.za(a)){for(var c=b.jw,d=0;d<c[u];d++)c[d][ad](a);mya(a,void 0)}b=b.J();MRa(b,b.nj-1)}function SUc(b,a){b.M1=a}function TUc(b,a){for(var c=a[pq](),d=0;d<b.oq[u];d++)if(b.oq[d][pq]()==c){b.oq[d].Ig(i);a.Ig(b);b.oq[d]=a;return}}function UUc(b,a){for(var c=0;c<b.yJ[u];c++)if(b.yJ[c].Jb==a.Jb){b.yJ[c]=a;return}}function VUc(b){hy[z](this,WK,b)}function WUc(b){this.Bra=b}function XUc(){}function YUc(b){this.ohc=b}function ZUc(){Bx(this)}
+function aVc(b,a,c,d,f){var g=new XUc;ep(g,m0a());g.gCb=f;Ip(g,c);g.rUa=d;g.o9=h1a(a,c);var j=yy(a);g.Gma=j.nf(bL);b=b.aa.RJa(a,c,d,f,g);if(!b){g=new UK(a,g);b=new dL(a,c,d,f,g)}return b}function bVc(){Bx(this)}function cVc(){return new ZUc}H(VUc,hy);F=VUc[w];F.za=function $lZa(a,c){Ix(this);var d=iy(this,a);if(d||c)return d;if(a=Hy.f_(Rf(a)))return new ORa(a,this)};F.Zn=function $mZa(a,c){Ix(this);return this.za(Qf(a.Dg()),c)};
+F.Zga=function $nZa(a,c,d){Ix(this);var f=i;if(a=this.za(Qf(a.Dg()),d))f=a.za(c,d);return f};F.nB=function $oZa(a,c,d){Ix(this);RRa(this,a,function(f){f.mB(d)});cI(this,I7a);SRa(this)};F.Yaa=function $pZa(a,c,d,f){Ix(this);RRa(this,a,function(g){if(d)g.vf()<=c&&g.LRa();else{g.Jl=h;if(!g.Oy()&&!g.Mm())g.Zba=nf(g.kl);g.utb=2;g.A4=ZG+g.A4+GK;g.rB=ZG+g.rB+GK;f?SUc(g,f):tRa(g);g.bI&&kya(g.bI,g,2)}});SRa(this)};F.SX=function $qZa(a,c,d){this.t3(a,c,h,d)};F.m1=function $rZa(a,c,d){this.t3(a,c,k,d)};
+F.t3=function $sZa(a,c,d,f){var g=k,j=k;RRa(this,a,function(C){for(var M=0;M<f[u];M++){var Y=f[M],ha;ha=d?C.bS(Y):C.TL(Y);if(Y==AL)g=ha;else if(Y==BL)j=ha}});for(c=0;c<f[u];c++){var n=Uy(f[c]);if(n){var s=this.Zn(n,h);if(s)if(d)s.rg();else s.hc()&&RUc(s,a)}}if(g||j){var v=this.Uc().Oa();for(c=0;c<v[u];c++){s=v[c];n=s.Bb();if(s.hc()){n=n.Ga();if(n==Py||n==cz||n==sz||n==pz||n==fz)d?RUc(s,a):s.rg()}}}SRa(this)};
+F.E4=function $tZa(a,c){Ix(this);var d=this.Uc().Oa();this.mb.Qf();try{for(var f=0;f<d[u];f++){var g=d[f];if(g.hc()){var j=g.Bb(),n=j.Ga();if(n==Oy||n==az||n==Jy||n==Py&&(j.Pt()==a||j.Pt()==c))g.rg();else for(var s=g.Uc().Oa(),v=0;v<s[u];v++){var C=s[v];if(C.hc()&&!C.Ds()){var M=C.J(),Y=M.TL(a);c&&Y&&M.bS(c)}}}}}finally{this.mb.Mf()}};Bi(O.S(),IB);_B_prog(99)}catch(e){_B_err(e)}
+
+try{H(WUc,xx);WUc[w].tb=B();WUc[w].tb.Ka=h;H(YUc,xx);YUc[w].RJa=B();YUc[w].RJa.ic=h;H(ZUc,RH);yx(YUc,ZUc);F=ZUc[w];F.JJ=function $wZa(a,c,d){a=a;this.U_a(a,d);c=Ke(d.zz)?i1a(a,d[Pc],d.zz):d[Xp]||0;a=aVc(this,a,d[Pc],c,d[x]);a.qc(k);this.xU(a,d);return a};F.TJa=function $xZa(a,c){a=a;var d=c.td();d=d?new Wh(Rf(d)):c.Of();c={uri:c};a=aVc(this,a,aza(Sy,d),1,Hz);this.xU(a,c);return a};
+F.pga=function $yZa(a,c,d){a=a;this.U_a(a,d);a=Ke(d.zz)?i1a(a,d[Pc],d.zz):d[Xp]||0;var f=d[Pc],g=i;c=GH(c);for(var j=0;j<c[u]&&!g;j++)if(c[j]instanceof dL&&f.Qc(c[j].Bb())&&d[x]==c[j].D0a&&a==c[j].Ut()){g=c[j];d.gkb||g.uW();this.xU(g,d)}return g};F.xU=function $zZa(a,c){bha(c,a.Ut());a.lPa(c.tZa,c.Zo,c.Am,c.Lja);a.qma(c)};F.U_a=function $AZa(a,c){if(!c[x]){a=KC(a);var d=Xy(c[Pc]);a=NC(a,d);lma(c,a?a.wra:Hz)}};H(bVc,xi);yx(WUc,bVc);Xw(O.S(),IB).ym(bVc);bVc[w].tb=function $BZa(a){a=a;mA(a,TE,cVc);var c=Dx(Cx(a));new VUc(c);this.aa.tb(a)};var dVc="tBhihb",eVc='" style="width:16px; height:16px" onerror="this.parentNode.removeChild(this);">';function fVc(b,a){var c=a||new U;c[R](uI,dVc,Ps,b.Zuc,eVc);if(!a)return c[t]()}function gVc(b){this.Uk=b}function hVc(b){this.vcc=b}function iVc(b){this.ub=b}function jVc(b){if(b.G4a)b.G4a.Uk=b.ub.xa.Zsa();else b.G4a=new gVc(b.ub.xa.Zsa());return b.G4a}var kVc="-ot";function lVc(b,a){dE(b.ub.B()).jj(a,jVc(b).NT()+kVc)}gVc[w].NT=function $CZa(){return this.Uk.nS[0]};gVc[w].Cwa=function $DZa(){return!!this.Uk.nS[1]};
+gVc[w].twa=function $EZa(){return!!this.Uk.nS[2]};zx(hVc,XYa);hVc[w].Jj=function $FZa(a,c){c=new gVc(c);if((CD()?k:!!c.Uk.nS&&c.NT()&&!c.Cwa()&&c.twa()&&!!!c.Uk.nS[3])&&c.Uk.nS[4]){a.Zuc=c.Uk.nS[4];a.ppa[p](fVc)}};zx(iVc,AK);iVc[w].opa=function $GZa(){if(jVc(this).Uk.nS&&jVc(this).NT())if(jVc(this).Cwa())lVc(this,ikb);else if(jVc(this).twa())jVc(this).Uk.nS[3]?lVc(this,jkb):lVc(this,gkb);else lVc(this,hkb)};function GVc(){this.yGb=[]}function HVc(b,a){b.yGb[p](a)}var IVc="earlydata";function JVc(b){this.V=b;this.Aa=Dx(Cx(this.V));this.Q=new kn(this);(new py(IVc,this.Aa)).set(new GVc);this.Q.w(fy(b).eQ,Fx(JD),this.Zya)}function KVc(b){this.Bra=b}H(GVc,uh);H(JVc,Jf);JVc[w].Zya=function $2Za(a){a=a[dq];if(a[0]==JD){var c=this.Aa.cj(Nrb,h);c&&c.J()?HVc(c.J(),a):this.AQ()}};JVc[w].L=function $3Za(){this.AQ()};JVc[w].AQ=function $4Za(){if(this.Q){this.Q.hb(fy(this.V).eQ,Fx(JD),this.Zya);this.Q.D();this.Q=i}};zx(KVc,WUc);KVc[w].tb=function $5Za(a){this.vBd=new JVc(a)};function LVc(b){this.Bn=b}Ax(LVc,DJ);LVc[w].qqb=function $6Za(){if(Xw(O.S(),vw).hc()){var a=kZ;a&&a.nsb()}};function VXc(b,a,c,d){N[z](this,Psa,b);this.wVc=a;ok(this,c);this.Gnd=d}var WXc="oZ";function XXc(){zJ[z](this,WXc,CK)}function YXc(b){this.uB=b}H(VXc,N);H(XXc,zJ);var ZXc=OUc(Qsa,"images/2/openhand.cur",aR,h)+Er;XXc[w].R3b=function $Y_a(a,c){wp(c[x],ZXc);return k};XXc[w].Wya=function $Z_a(a,c,d){var f=this[Oc][Oc].ao(),g=this[Oc].B(),j=d[Vp]();g.Ya()[r](new VXc(f,a,c,j));return XXc.C.Wya[z](this,a,c,d)};zx(YXc,oK);var aYc=[I,EN,IN,CL,DN],bYc=[8,3,9,10,16],cYc=new kK(XF,"Ci");F=YXc[w];F.Y_a=function $__a(a){UUc(a.SZa,cYc);TUc(a.TD,new XXc)};F.WKc=function $0_a(){return this.uB.ao()[uk].XG()==dK};F.wcb=function $1_a(){var a=this.uB.ao().Bb();return(a?Xy(a):I)||I};F.y0b=function $2_a(a){var c=this.uB.ao();if(!c[uk].Vo(a)){this.kTa=c[uk].E6();this.kTa.set(a,k);jYa(c[uk]);kYa(c[uk],a)}};F.x0b=function $3_a(){if(this.kTa){this.uB.ao()[uk].zm(this.kTa);delete this.kTa}};
+F.AVc=function $4_a(a){var c=this.wcb();if(!a||c==a)c=i;else{var d=76;if(KC(this.uB.B()).Rw(a))switch(a){case TI:d=8;break;case oI:if(ef(aYc,c))d=3;break;case AL:d=9;break;case BL:d=10;if(c==CL)d=16;break}else if(ef(aYc,c))d=12;c=d}if(c){a=ef(bYc,c)?i:a;this.uB.ao().nk(c,a)}};F.Krc=function $5_a(a,c){if(!this.uB.ao().aa.pQa()){this.y0b(this.uB.xa[Vp](iK(this.uB,c)).vf());this.uB.ao().nk(12,a);this.x0b()}};F.TQb=function $6_a(){return this.uB.b()[ic](Zn)};function EYc(b){this.Bn=b}var FYc="xF",GYc="Additional messages could be available in regular online mode. You can leave Flaky Connection Mode and try your search again.",HYc="Additional messages may be found when you are online.";function IYc(b,a){var c=a||new U;c[R](SG,FYc,Kl,FYc,Kl,FYc,W);b.bDa?c[R](GYc):c[R](HYc);c[R](TG);if(!a)return c[t]()}function JYc(b,a){switch(a){case cz:case fz:case iz:case kz:case sz:case pz:case Yy:case Zy:case Py:return h}return k}TH[w].fQc=function $A0a(){return this.Zh(HN)};VUc[w].KOc=function $B0a(){Vo()&&cI(this,H7a)};zx(EYc,DJ);var KYc="Move to Drafts";EYc[w].Oca=function $C0a(a){var c=HJ(KYc,101,void 0);a.set(101,c)};EYc[w].Fs=function $D0a(a){return a==101};EYc[w].KW=function $E0a(a){if(a.Ga()==nz){TB(this.Bn,101,h);TB(this.Bn,9,k)}else TB(this.Bn,101,k)};var LYc="b4";VJ[w].a1b=function $F0a(){if(CD())for(var a=this.b()[cc],c=0;c<a[u];c++)if(a[c][Uc](fG)==String(64))m(a[c],LYc)};VJ[w].ZRa=function $_N(){var a=jA(this.B(),Od);a&&a.M2a(this.a1b,this)};VJ[w].d1b=function $0N(){var a=jA(this.B(),Od);a&&a.dub(this.a1b,this)};Lob[p](HN);KK.Wtd="ls_esm";F=dL[w];var MYc="No messages waiting to be sent.",NYc="There are no conversations with this label. You can leave Flaky Connection Mode to see all conversations.",OYc="There are no conversations with this label. Additional conversations are only available online.";
+F.p1b=function $0S(){var a=this.Ea.Ga();if(a==nz){a=new U;a[R](MYc);a=a[t]();return a}var c=this.Xi.J();if(c.I_()&&(c.fN()||c.DPa())){a=jA(this.B(),Od);a={bDa:a&&a.Gm()==AR};a=a;c=new U;a.bDa?c[R](GYc):c[R](HYc);a=c[t]();return a}if(c.I_()&&c.uua()&&JYc(this,a)){a=jA(this.B(),Od);a={yyc:a&&a.vk()};a=a;c=new U;a.yyc?c[R](NYc):c[R](OYc);a=c[t]();return a}return i};F.k1b=function $sS(a,c){this.IP=new eE(c);this.IP.qc(k);a[p](this.IP)};F.Z0b=function $dS(){Pw(this.H(),this.IP.b(),aB,this.V2c)};
+F.V2c=B();var PYc="Better search results could be available in regular online mode. You can leave Flaky Connection Mode and try your search again.",QYc="Better search results may be found when you are online.";
+F.t1b=function $gT(){if(!this.IP.Pc)if(this.Xi.hc()){var a=this.Ea.Ga(),c=this.Xi.J(),d;if(a!=nz&&c.I_()){a=jA(this.B(),Od);if(c.nj>0&&c.DPa()){c={bDa:a&&a.Gm()==AR};d=new U;d[R](X,fo,W);c.bDa?d[R](PYc):d[R](QYc);d[R](Z);d=d[t]()}else if(a&&a.ev==BR&&a.Gm()!=AR){c=new U;c[R](X,fo,W,"Showing only messages located on this computer until your offline changes have been synchronized.",Z);d=c[t]()}}if(d){Q(this.IP.b(),d);this.IP.qe(Wx);this.IP.qc(h)}else{Q(this.IP.b(),I);this.IP.qc(k)}}else this.IP.qc(k)};
+F.o1b=function $YS(){var a=this.Xi.J(),c=a.nj;return a.I_()&&c>0&&!a.DPa()&&this.Rf+XK(this)[u]==c&&(a.fN()||c<a.uua())};F.W0b=function $ZS(a){if(this.Ea.Ga()!=nz){var c=jA(this.B(),Od);c={bDa:c&&c.Gm()==AR};a[p](IYc(c))}};O.S().gb(IB);Ci(O.S(),IB);_B_prog(100)}catch(e){_B_err(e)}
+
+try{function zIc(b,a){EL[z](this,b,a);f4a(this);a[kq](Xd,new eWa);LFa(a)}H(zIc,EL);var AIc="Main ",BIc="hist_state";
+zIc[w].tb=function $5Ra(){this.OK(k,Xl);var a=this.B(),c=dE(this.V);c.pb(mea?tkb:ukb);if(mea){var d=this.xf.ud,f=Mj.td(),g=Zh(Mj,pd),j=Rz(this.V).bH();if(!f||f==j.Ga()&&!g){this.Y9a=new SLa(this.V,g||DE);mIa(d,this.Y9a)}else{f=f[Cc](Md)[0];c.jj(skb,j.Ga()+Qd+f+Qd+(g?g:xd))}if(!(d.Xsb||!d.ywa||!d.aQa)){d.Xsb=h;d.b1(i,mea)}}c=rD(a);d=rD(iA(a));d=new EA(sD(c),[sD(d)]);c=CA(a,d,c.Zf);c.B_a=AIc;ZC(this,c);d=Cg(top);a[kq](Xx,new rY(d.b(BIc),d.b(Xkb)));vNa(a);d=aJa(a);_ForceReloadStyles=G(d.YLa,d);a=new EY(a);
+c.so(a);a.Via();Uzc=a};main=function $6Ra(){ik(ea,Ii);var a=gQ,c=new IL(a),d=c.V,f=wwa(fx(Mj,Zra));f=new G3a(f,aj,XE,void 0);d[kq](dx,f);_GM_bcService=f;c.tb();c=a;if(Sfa.J())c=mD(a);(new zIc(top,c)).tb()};}catch(e){_B_err(e)}
+
+_B_record();_B_init(top)
+
+top._jsl=true
+
+window._GM_writeInnerHtml=function(element,html){element.innerHTML=html};
+window._GM_writeInnerHtmlLoaded();
+</script>
+
+
+<script id="gravity" type="x">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-86951-7']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
+ })();
+
+
+
+(function(){var aa="_gat",ba="_gaq",r=true,v=false,w=undefined,ca="4.6.5",x="length",y="cookie",A="location",B="&",C="=",D="__utma=",E="__utmb=",G="__utmc=",da="__utmk=",H="__utmv=",J="__utmz=",K="__utmx=",L="GASO=";var N=function(i){return w==i||"-"==i||""==i},ea=function(i){return i[x]>0&&" \n\r\t".indexOf(i)>-1},P=function(i,l,g){var t="-",k;if(!N(i)&&!N(l)&&!N(g)){k=i.indexOf(l);if(k>-1){g=i.indexOf(g,k);if(g<0)g=i[x];t=O(i,k+l.indexOf(C)+1,g)}}return t},Q=function(i){var l=v,g=0,t,k;if(!N(i)){l=r;for(t=0;t<i[x];t++){k=i.charAt(t);g+="."==k?1:0;l=l&&g<=1&&(0==t&&"-"==k||".0123456789".indexOf(k)>-1)}}return l},S=function(i,l){var g=encodeURIComponent;return g instanceof Function?l?encodeURI(i):g(i):escape(i)},
+T=function(i,l){var g=decodeURIComponent,t;i=i.split("+").join(" ");if(g instanceof Function)try{t=l?decodeURI(i):g(i)}catch(k){t=unescape(i)}else t=unescape(i);return t},U=function(i,l){return i.indexOf(l)>-1},V=function(i,l){i[i[x]]=l},W=function(i){return i.toLowerCase()},X=function(i,l){return i.split(l)},fa=function(i,l){return i.indexOf(l)},O=function(i,l,g){g=w==g?i[x]:g;return i.substring(l,g)},ga=function(i,l){return i.join(l)},ia=function(i){var l=1,g=0,t;if(!N(i)){l=0;for(t=i[x]-1;t>=0;t--){g=
+i.charCodeAt(t);l=(l<<6&268435455)+g+(g<<14);g=l&266338304;l=g!=0?l^g>>21:l}}return l},ja=function(){var i=window,l=w;if(i&&i.gaGlobal&&i.gaGlobal.hid)l=i.gaGlobal.hid;else{l=Y();i.gaGlobal=i.gaGlobal?i.gaGlobal:{};i.gaGlobal.hid=l}return l},Y=function(){return Math.round(Math.random()*2147483647)},Z={Ha:function(i,l){this.bb=i;this.nb=l},ib:v,_gasoDomain:w,_gasoCPath:w};Z.Gb=function(){function i(k){return new t(k[0],k[1])}function l(k){var p=[];k=k.split(",");var f;for(f=0;f<k.length;++f)p.push(i(k[f].split(":")));return p}var g=this,t=Z.Ha;g.Ia="utm_campaign";g.Ja="utm_content";g.Ka="utm_id";g.La="utm_medium";g.Ma="utm_nooverride";g.Na="utm_source";g.Oa="utm_term";g.Pa="gclid";g.ba=0;g.z=0;g.Ta=15768E6;g.sb=18E5;g.v=63072E6;g.ta=[];g.va=[];g.nc="cse";g.oc="q";g.ob=5;g.T=l("daum:q,eniro:search_word,naver:query,images.google:q,google:q,yahoo:p,msn:q,bing:q,aol:query,aol:encquery,lycos:query,ask:q,altavista:q,netscape:query,cnn:query,about:terms,mamma:query,alltheweb:q,voila:rdata,virgilio:qs,live:q,baidu:wd,alice:qs,yandex:text,najdi:q,aol:q,mama:query,seznam:q,search:q,wp:szukaj,onet:qt,szukacz:q,yam:k,pchome:q,kvasir:q,sesam:q,ozu:q,terra:query,mynet:q,ekolay:q,rambler:words");
+g.t=w;g.lb=v;g.h="/";g.U=100;g.oa="/__utm.gif";g.ga=1;g.ha=1;g.u="|";g.fa=1;g.da=1;g.Ra=1;g.b="auto";g.I=1;g.ra=1E3;g.Jc=10;g.Pb=10;g.Kc=0.2;g.o=w;g.a=document;g.e=window};Z.Hb=function(i){function l(d,a,j,c){var n="",s=0;n=P(d,"2"+a,";");if(!N(n)){d=n.indexOf("^"+j+".");if(d<0)return["",0];n=O(n,d+j[x]+2);if(n.indexOf("^")>0)n=n.split("^")[0];j=n.split(":");n=j[1];s=parseInt(j[0],10);if(!c&&s<p.r)n=""}if(N(n))n="";return[n,s]}function g(d,a){return"^"+ga([[a,d[1]].join("."),d[0]],":")}function t(d,a){f.a[y]=d+"; path="+f.h+"; "+a+p.fb()}function k(d){var a=new Date;d=new Date(a.getTime()+d);return"expires="+d.toGMTString()+"; "}var p=this,f=i;p.r=(new Date).getTime();
+var h=[D,E,G,J,H,K,L];p.k=function(){var d=f.a[y];return f.o?p.Wb(d,f.o):d};p.Wb=function(d,a){var j=[],c,n;for(c=0;c<h[x];c++){n=l(d,h[c],a)[0];N(n)||(j[j[x]]=h[c]+n+";")}return j.join("")};p.l=function(d,a,j){var c=j>0?k(j):"";if(f.o){a=p.kc(f.a[y],d,f.o,a,j);d="2"+d;c=j>0?k(f.v):""}t(d+a,c)};p.kc=function(d,a,j,c,n){var s="";n=n||f.v;c=g([c,p.r+n*1],j);s=P(d,"2"+a,";");if(!N(s)){d=g(l(d,a,j,r),j);s=ga(s.split(d),"");return s=c+s}return c};p.fb=function(){return N(f.b)?"":"domain="+f.b+";"}};Z.$=function(i){function l(b){b=b instanceof Array?b.join("."):"";return N(b)?"-":b}function g(b,e){var o=[];if(!N(b)){o=b.split(".");if(e)for(b=0;b<o[x];b++)Q(o[b])||(o[b]="-")}return o}function t(b,e,o){var m=c.M,q,u;for(q=0;q<m[x];q++){u=m[q][0];u+=N(e)?e:e+m[q][4];m[q][2](P(b,u,o))}}var k,p,f,h,d,a,j,c=this,n,s=i;c.j=new Z.Hb(i);c.kb=function(){return w==n||n==c.P()};c.k=function(){return c.j.k()};c.ma=function(){return d?d:"-"};c.vb=function(b){d=b};c.za=function(b){n=Q(b)?b*1:"-"};c.la=function(){return l(a)};
+c.Aa=function(b){a=g(b)};c.Vb=function(){c.j.l(H,"",-1)};c.lc=function(){return n?n:"-"};c.fb=function(){return N(s.b)?"":"domain="+s.b+";"};c.ja=function(){return l(k)};c.tb=function(b){k=g(b,1)};c.C=function(){return l(p)};c.ya=function(b){p=g(b,1)};c.ka=function(){return l(f)};c.ub=function(b){f=g(b,1)};c.na=function(){return l(h)};c.wb=function(b){h=g(b);for(b=0;b<h[x];b++)if(b<4&&!Q(h[b]))h[b]="-"};c.fc=function(){return j};c.Dc=function(b){j=b};c.Sb=function(){k=[];p=[];f=[];h=[];d=w;a=[];n=
+w};c.P=function(){var b="",e;for(e=0;e<c.M[x];e++)b+=c.M[e][1]();return ia(b)};c.ua=function(b){var e=c.k(),o=v;if(e){t(e,b,";");c.za(c.P());o=r}return o};c.zc=function(b){t(b,"",B);c.za(P(b,da,B))};c.Hc=function(){var b=c.M,e=[],o;for(o=0;o<b[x];o++)V(e,b[o][0]+b[o][1]());V(e,da+c.P());return e.join(B)};c.Nc=function(b,e){var o=c.M,m=s.h;c.ua(b);s.h=e;for(b=0;b<o[x];b++)N(o[b][1]())||o[b][3]();s.h=m};c.Cb=function(){c.j.l(D,c.ja(),s.v)};c.Ea=function(){c.j.l(E,c.C(),s.sb)};c.Db=function(){c.j.l(G,
+c.ka(),0)};c.Ga=function(){c.j.l(J,c.na(),s.Ta)};c.Eb=function(){c.j.l(K,c.ma(),s.v)};c.Fa=function(){c.j.l(H,c.la(),s.v)};c.Oc=function(){c.j.l(L,c.fc(),0)};c.M=[[D,c.ja,c.tb,c.Cb,"."],[E,c.C,c.ya,c.Ea,""],[G,c.ka,c.ub,c.Db,""],[K,c.ma,c.vb,c.Eb,""],[J,c.na,c.wb,c.Ga,"."],[H,c.la,c.Aa,c.Fa,"."]]};Z.Kb=function(i){var l=this,g=i,t=new Z.$(g),k=function(){},p=function(f){var h=(new Date).getTime(),d;d=(h-f[3])*(g.Kc/1E3);if(d>=1){f[2]=Math.min(Math.floor(f[2]*1+d),g.Pb);f[3]=h}return f};l.H=function(f,h,d,a,j,c){var n,s=g.I,b=g.a[A];t.ua(d);n=X(t.C(),".");if(n[1]<500||a){if(j)n=p(n);if(a||!j||n[2]>=1){if(!a&&j)n[2]=n[2]*1-1;n[1]=n[1]*1+1;f="?utmwv="+ca+"&utmn="+Y()+(N(b.hostname)?"":"&utmhn="+S(b.hostname))+(g.U==100?"":"&utmsp="+S(g.U))+f;if(0==s||2==s){a=2==s?k:c||k;l.$a(g.oa+f,a)}if(1==s||
+2==s){f=("https:"==b.protocol?"https://ssl.google-analytics.com/__utm.gif":"http://www.google-analytics.com/__utm.gif")+f+"&utmac="+h+"&utmcc="+l.ac(d);if(ka)f+="&gaq=1";l.$a(f,c)}}}t.ya(n.join("."));t.Ea()};l.$a=function(f,h){var d=new Image(1,1);d.src=f;d.onload=function(){d.onload=null;(h||k)()}};l.ac=function(f){var h=[],d=[D,J,H,K],a,j=t.k(),c;for(a=0;a<d[x];a++){c=P(j,d[a]+f,";");if(!N(c)){if(d[a]==H){c=X(c.split(f+".")[1],"|")[0];if(N(c))continue;c=f+"."+c}V(h,d[a]+c+";")}}return S(h.join("+"))}};Z.n=function(){var i=this;i.Y=[];i.hb=function(l){var g,t=i.Y,k;for(k=0;k<t.length;k++)g=l==t[k].q?t[k]:g;return g};i.Ob=function(l,g,t,k,p,f,h,d){var a=i.hb(l);if(w==a){a=new Z.n.Mb(l,g,t,k,p,f,h,d);V(i.Y,a)}else{a.Qa=g;a.Ab=t;a.zb=k;a.xb=p;a.Xa=f;a.yb=h;a.Za=d}return a}};Z.n.Lb=function(i,l,g,t,k,p){var f=this;f.Bb=i;f.Ba=l;f.D=g;f.Va=t;f.pb=k;f.qb=p;f.Ca=function(){return"&"+["utmt=item","tid="+S(f.Bb),"ipc="+S(f.Ba),"ipn="+S(f.D),"iva="+S(f.Va),"ipr="+S(f.pb),"iqt="+S(f.qb)].join("&utm")}};
+Z.n.Mb=function(i,l,g,t,k,p,f,h){var d=this;d.q=i;d.Qa=l;d.Ab=g;d.zb=t;d.xb=k;d.Xa=p;d.yb=f;d.Za=h;d.R=[];d.Nb=function(a,j,c,n,s){var b=d.gc(a),e=d.q;if(w==b)V(d.R,new Z.n.Lb(e,a,j,c,n,s));else{b.Bb=e;b.Ba=a;b.D=j;b.Va=c;b.pb=n;b.qb=s}};d.gc=function(a){var j,c=d.R,n;for(n=0;n<c.length;n++)j=a==c[n].Ba?c[n]:j;return j};d.Ca=function(){return"&"+["utmt=tran","id="+S(d.q),"st="+S(d.Qa),"to="+S(d.Ab),"tx="+S(d.zb),"sp="+S(d.xb),"ci="+S(d.Xa),"rg="+S(d.yb),"co="+S(d.Za)].join("&utmt")}};Z.Fb=function(i){function l(){var f,h,d;h="ShockwaveFlash";var a="$version",j=k.d?k.d.plugins:w;if(j&&j[x]>0)for(f=0;f<j[x]&&!d;f++){h=j[f];if(U(h.name,"Shockwave Flash"))d=h.description.split("Shockwave Flash ")[1]}else{h=h+"."+h;try{f=new ActiveXObject(h+".7");d=f.GetVariable(a)}catch(c){}if(!d)try{f=new ActiveXObject(h+".6");d="WIN 6,0,21,0";f.AllowScriptAccess="always";d=f.GetVariable(a)}catch(n){}if(!d)try{f=new ActiveXObject(h);d=f.GetVariable(a)}catch(s){}if(d){d=X(d.split(" ")[1],",");d=d[0]+
+"."+d[1]+" r"+d[2]}}return d?d:p}var g=i,t=g.e,k=this,p="-";k.V=t.screen;k.Sa=!k.V&&t.java?java.awt.Toolkit.getDefaultToolkit():w;k.d=t.navigator;k.W=p;k.xa=p;k.Wa=p;k.qa=p;k.pa=1;k.eb=p;k.bc=function(){var f;if(t.screen){k.W=k.V.width+"x"+k.V.height;k.xa=k.V.colorDepth+"-bit"}else if(k.Sa)try{f=k.Sa.getScreenSize();k.W=f.width+"x"+f.height}catch(h){}k.qa=W(k.d&&k.d.language?k.d.language:k.d&&k.d.browserLanguage?k.d.browserLanguage:p);k.pa=k.d&&k.d.javaEnabled()?1:0;k.eb=g.ha?l():p;k.Wa=S(g.a.characterSet?
+g.a.characterSet:g.a.charset?g.a.charset:p)};k.Ic=function(){return B+"utm"+["cs="+S(k.Wa),"sr="+k.W,"sc="+k.xa,"ul="+k.qa,"je="+k.pa,"fl="+S(k.eb)].join("&utm")};k.$b=function(){var f=g.a,h=t.history[x];f=k.d.appName+k.d.version+k.qa+k.d.platform+k.d.userAgent+k.pa+k.W+k.xa+(f[y]?f[y]:"")+(f.referrer?f.referrer:"");for(var d=f[x];h>0;)f+=h--^d++;return ia(f)}};Z.m=function(i,l,g,t){function k(d){var a="";d=W(d.split("://")[1]);if(U(d,"/")){d=d.split("/")[1];if(U(d,"?"))a=d.split("?")[0]}return a}function p(d){var a="";a=W(d.split("://")[1]);if(U(a,"/"))a=a.split("/")[0];return a}var f=t,h=this;h.c=i;h.rb=l;h.r=g;h.ic=function(d){var a=h.gb();return new Z.m.w(P(d,f.Ka+C,B),P(d,f.Na+C,B),P(d,f.Pa+C,B),h.Q(d,f.Ia,"(not set)"),h.Q(d,f.La,"(not set)"),h.Q(d,f.Oa,a&&!N(a.K)?T(a.K):w),h.Q(d,f.Ja,w))};h.jb=function(d){var a=p(d),j=k(d);if(U(a,"google")){d=d.split("?").join(B);
+if(U(d,B+f.oc+C))if(j==f.nc)return r}return v};h.gb=function(){var d,a=h.rb,j,c,n=f.T;if(!(N(a)||"0"==a||!U(a,"://")||h.jb(a))){d=p(a);for(j=0;j<n[x];j++){c=n[j];if(U(d,W(c.bb))){a=a.split("?").join(B);if(U(a,B+c.nb+C)){d=a.split(B+c.nb+C)[1];if(U(d,B))d=d.split(B)[0];return new Z.m.w(w,c.bb,w,"(organic)","organic",d,w)}}}}};h.Q=function(d,a,j){d=P(d,a+C,B);return j=!N(d)?T(d):!N(j)?j:"-"};h.uc=function(d){var a=f.ta,j=v,c;if(d&&"organic"==d.S){d=W(T(d.K));for(c=0;c<a[x];c++)j=j||W(a[c])==d}return j};
+h.hc=function(){var d="",a="";d=h.rb;if(!(N(d)||"0"==d||!U(d,"://")||h.jb(d))){d=d.split("://")[1];if(U(d,"/")){a=O(d,d.indexOf("/"));a=a.split("?")[0];d=W(d.split("/")[0])}if(0==d.indexOf("www."))d=O(d,4);return new Z.m.w(w,d,w,"(referral)","referral",w,a)}};h.Xb=function(d){var a="";if(f.ba){a=d&&d.hash?d.href.substring(d.href.indexOf("#")):"";a=""!=a?a+B:a}a+=d.search;return a};h.dc=function(){return new Z.m.w(w,"(direct)",w,"(direct)","(none)",w,w)};h.vc=function(d){var a=v,j,c=f.va;if(d&&"referral"==
+d.S){d=W(S(d.X));for(j=0;j<c[x];j++)a=a||U(d,W(c[j]))}return a};h.L=function(d){return w!=d&&d.mb()};h.cc=function(d,a){var j="",c="-",n,s=0,b,e,o=h.c;if(!d)return"";e=d.k();j=h.Xb(f.a[A]);if(f.z&&d.kb()){c=d.na();if(!N(c)&&!U(c,";")){d.Ga();return""}}c=P(e,J+o+".",";");n=h.ic(j);if(h.L(n)){j=P(j,f.Ma+C,B);if("1"==j&&!N(c))return""}if(!h.L(n)){n=h.gb();if(!N(c)&&h.uc(n))return""}if(!h.L(n)&&a){n=h.hc();if(!N(c)&&h.vc(n))return""}if(!h.L(n))if(N(c)&&a)n=h.dc();if(!h.L(n))return"";if(!N(c)){s=c.split(".");
+b=new Z.m.w;b.Zb(s.slice(4).join("."));b=W(b.Da())==W(n.Da());s=s[3]*1}if(!b||a){a=P(e,D+o+".",";");e=a.lastIndexOf(".");a=e>9?O(a,e+1)*1:0;s++;a=0==a?1:a;d.wb([o,h.r,a,s,n.Da()].join("."));d.Ga();return B+"utmcn=1"}else return B+"utmcr=1"}};
+Z.m.w=function(i,l,g,t,k,p,f){var h=this;h.q=i;h.X=l;h.ea=g;h.D=t;h.S=k;h.K=p;h.Ya=f;h.Da=function(){var d=[],a=[["cid",h.q],["csr",h.X],["gclid",h.ea],["ccn",h.D],["cmd",h.S],["ctr",h.K],["cct",h.Ya]],j,c;if(h.mb())for(j=0;j<a[x];j++)if(!N(a[j][1])){c=a[j][1].split("+").join("%20");c=c.split(" ").join("%20");V(d,"utm"+a[j][0]+C+c)}return d.join("|")};h.mb=function(){return!(N(h.q)&&N(h.X)&&N(h.ea))};h.Zb=function(d){var a=function(j){return T(P(d,"utm"+j+C,"|"))};h.q=a("cid");h.X=a("csr");h.ea=a("gclid");
+h.D=a("ccn");h.S=a("cmd");h.K=a("ctr");h.Ya=a("cct")}};Z.Ib=function(i,l,g,t){function k(j,c,n){var s;if(!N(n)){n=n.split(",");for(var b=0;b<n[x];b++){s=n[b];if(!N(s)){s=s.split(h);if(s[x]==4)c[s[0]]=[s[1],s[2],j]}}}}var p=this,f=l,h=C,d=i,a=t;p.O=g;p.sa="";p.p={};p.tc=function(){var j;j=X(P(p.O.k(),H+f+".",";"),f+".")[1];if(!N(j)){j=j.split("|");k(1,p.p,j[1]);p.sa=j[0];p.Z()}};p.Z=function(){p.Qb();var j=p.sa,c,n,s="";for(c in p.p)if((n=p.p[c])&&1===n[2])s+=c+h+n[0]+h+n[1]+h+1+",";N(s)||(j+="|"+s);if(N(j))p.O.Vb();else{p.O.Aa(f+"."+j);p.O.Fa()}};p.Ec=
+function(j){p.sa=j;p.Z()};p.Cc=function(j,c,n,s){if(1!=s&&2!=s&&3!=s)s=3;var b=v;if(c&&n&&j>0&&j<=d.ob){c=S(c);n=S(n);if(c[x]+n[x]<=64){p.p[j]=[c,n,s];p.Z();b=r}}return b};p.mc=function(j){if((j=p.p[j])&&1===j[2])return j[1]};p.Ub=function(j){var c=p.p;if(c[j]){delete c[j];p.Z()}};p.Qb=function(){a._clearKey(8);a._clearKey(9);a._clearKey(11);var j=p.p,c,n;for(n in j)if(c=j[n]){a._setKey(8,n,c[0]);a._setKey(9,n,c[1]);(c=c[2])&&3!=c&&a._setKey(11,n,""+c)}}};Z.N=function(){function i(m,q,u,z){if(w==f[m])f[m]={};if(w==f[m][q])f[m][q]=[];f[m][q][u]=z}function l(m,q){if(w!=f[m]&&w!=f[m][q]){f[m][q]=w;q=r;var u;for(u=0;u<a[x];u++)if(w!=f[m][a[u]]){q=v;break}if(q)f[m]=w}}function g(m){var q="",u=v,z,M;for(z=0;z<a[x];z++){M=m[a[z]];if(w!=M){if(u)q+=a[z];q+=t(M);u=v}else u=r}return q}function t(m){var q=[],u,z;for(z=0;z<m[x];z++)if(w!=m[z]){u="";if(z!=o&&w==m[z-1])u+=z.toString()+s;u+=k(m[z]);V(q,u)}return j+q.join(n)+c}function k(m){var q="",u,z,M;for(u=0;u<
+m[x];u++){z=m.charAt(u);M=e[z];q+=w!=M?M:z}return q}var p=this,f={},h="k",d="v",a=[h,d],j="(",c=")",n="*",s="!",b="'",e={};e[b]="'0";e[c]="'1";e[n]="'2";e[s]="'3";var o=1;p.qc=function(m){return w!=f[m]};p.G=function(){var m="",q;for(q in f)if(w!=f[q])m+=q.toString()+g(f[q]);return m};p.Ac=function(m){if(m==w)return p.G();var q=m.G(),u;for(u in f)if(w!=f[u]&&!m.qc(u))q+=u.toString()+g(f[u]);return q};p._setKey=function(m,q,u){if(typeof u!="string")return v;i(m,h,q,u);return r};p._setValue=function(m,
+q,u){if(typeof u!="number"&&(w==Number||!(u instanceof Number))||Math.round(u)!=u||u==NaN||u==Infinity)return v;i(m,d,q,u.toString());return r};p._getKey=function(m,q){return w!=f[m]&&w!=f[m][h]?f[m][h][q]:w};p._getValue=function(m,q){return w!=f[m]&&w!=f[m][d]?f[m][d][q]:w};p._clearKey=function(m){l(m,h)};p._clearValue=function(m){l(m,d)}};Z.Jb=function(i,l){var g=this;g.Qc=l;g.xc=i;g._trackEvent=function(t,k,p){return l._trackEvent(g.xc,t,k,p)}};Z.aa=function(i,l){function g(){if("auto"==c.b){var b=c.a.domain;if("www."==O(b,0,4))b=O(b,4);c.b=b}c.b=W(c.b)}function t(){var b=c.b,e=b.indexOf("www.google.")*b.indexOf(".google.")*b.indexOf("google.");return e||"/"!=c.h||b.indexOf("google.org")>-1}function k(b,e,o){if(N(b)||N(e)||N(o))return"-";b=P(b,D+a.c+".",e);if(!N(b)){b=b.split(".");b[5]=b[5]?b[5]*1+1:1;b[3]=b[4];b[4]=o;b=b.join(".")}return b}function p(){return"file:"!=c.a[A].protocol&&t()}function f(b){if(!b||""==b)return"";for(;ea(b.charAt(0));)b=
+O(b,1);for(;ea(b.charAt(b[x]-1));)b=O(b,0,b[x]-1);return b}function h(b,e,o,m){if(!N(b())){e(m?T(b()):b());U(b(),";")||o()}}function d(b){var e,o=""!=b&&c.a[A].host!=b;if(o)for(e=0;e<c.t[x];e++)o=o&&fa(W(b),W(c.t[e]))==-1;return o}var a=this,j=w,c=new Z.Gb,n=v,s=w;a.e=window;a.r=Math.round((new Date).getTime()/1E3);a.s=i||"UA-XXXXX-X";a.ab=c.a.referrer;a.ia=w;a.f=w;a.B=w;a.F=v;a.A=w;a.Ua="";a.g=w;a.cb=w;a.c=w;a.i=w;c.o=l?S(l):w;a.wc=function(){var b=v;if(a.B)b=a.B.match(/^[0-9a-z-_.]{10,1200}$/i);
+return b};a.jc=function(){return Y()^a.A.$b()&2147483647};a.ec=function(){if(!c.b||""==c.b||"none"==c.b){c.b="";return 1}g();return c.Ra?ia(c.b):1};a.Yb=function(b,e){if(N(b))b="-";else{e+=c.h&&"/"!=c.h?c.h:"";e=b.indexOf(e);b=e>=0&&e<=8?"0":"["==b.charAt(0)&&"]"==b.charAt(b[x]-1)?"-":b}return b};a.wa=function(b){var e="",o=c.a;e+=c.fa?a.A.Ic():"";e+=c.da?a.Ua:"";e+=c.ga&&!N(o.title)?"&utmdt="+S(o.title):"";e+="&utmhid="+ja()+"&utmr="+S(a.ia)+"&utmp="+S(a.Bc(b));return e};a.Bc=function(b){var e=c.a[A];
+return b=w!=b&&""!=b?S(b,r):S(e.pathname+e.search,r)};a.Lc=function(b){if(a.J()){var e="";if(a.g!=w&&a.g.G()[x]>0)e+="&utme="+S(a.g.G());e+=a.wa(b);j.H(e,a.s,a.c)}};a.Tb=function(){var b=new Z.$(c);return b.ua(a.c)?b.Hc():w};a._getLinkerUrl=function(b,e){var o=b.split("#"),m=b,q=a.Tb();if(q)if(e&&1>=o[x])m+="#"+q;else if(!e||1>=o[x])if(1>=o[x])m+=(U(b,"?")?B:"?")+q;else m=o[0]+(U(b,"?")?B:"?")+q+"#"+o[1];return m};a.Fc=function(){var b;if(a.wc()){a.i.Dc(a.B);a.i.Oc();Z._gasoDomain=c.b;Z._gasoCPath=
+c.h;b=c.a.createElement("script");b.type="text/javascript";b.id="_gasojs";b.src="https://www.google.com/analytics/reporting/overlay_js?gaso="+a.B+B+Y();c.a.getElementsByTagName("head")[0].appendChild(b)}};a.pc=function(){var b=a.r,e=a.i,o=e.k(),m=a.c+"",q=c.e,u=q?q.gaGlobal:w,z,M=U(o,D+m+"."),la=U(o,E+m),ma=U(o,G+m),F,I=[],R="",ha=v;o=N(o)?"":o;if(c.z){z=c.a[A]&&c.a[A].hash?c.a[A].href.substring(c.a[A].href.indexOf("#")):"";if(c.ba&&!N(z))R=z+B;R+=c.a[A].search;if(!N(R)&&U(R,D)){e.zc(R);e.kb()||e.Sb();
+F=e.ja()}h(e.ma,e.vb,e.Eb,true);h(e.la,e.Aa,e.Fa)}if(N(F))if(M)if(!la||!ma){F=k(o,";",b);a.F=r}else{F=P(o,D+m+".",";");I=X(P(o,E+m,";"),".")}else{F=ga([m,a.jc(),b,b,b,1],".");ha=a.F=r}else if(N(e.C())||N(e.ka())){F=k(R,B,b);a.F=r}else{I=X(e.C(),".");m=I[0]}F=F.split(".");if(q&&u&&u.dh==m&&!c.o){F[4]=u.sid?u.sid:F[4];if(ha){F[3]=u.sid?u.sid:F[4];if(u.vid){b=u.vid.split(".");F[1]=b[0];F[2]=b[1]}}}e.tb(F.join("."));I[0]=m;I[1]=I[1]?I[1]:0;I[2]=w!=I[2]?I[2]:c.Jc;I[3]=I[3]?I[3]:F[4];e.ya(I.join("."));
+e.ub(m);N(e.lc())||e.za(e.P());e.Cb();e.Ea();e.Db()};a.rc=function(){j=new Z.Kb(c)};a._initData=function(){var b;if(!n){if(!a.A){a.A=new Z.Fb(c);a.A.bc()}a.c=a.ec();a.i=new Z.$(c);a.g=new Z.N;s=new Z.Ib(c,a.c,a.i,a.g);a.rc()}if(p()){a.pc();s.tc()}if(!n){if(p()){a.ia=a.Yb(a.ab,c.a.domain);if(c.da){b=new Z.m(a.c,a.ia,a.r,c);a.Ua=b.cc(a.i,a.F)}}a.cb=new Z.N;n=r}Z.ib||a.sc()};a._visitCode=function(){a._initData();var b=P(a.i.k(),D+a.c+".",";");b=b.split(".");return b[x]<4?"":b[1]};a._cookiePathCopy=function(b){a._initData();
+a.i&&a.i.Nc(a.c,b)};a.sc=function(){var b=c.a[A].hash;if(b&&1==b.indexOf("gaso="))b=P(b,"gaso=",B);else b=(b=c.e.name)&&0<=b.indexOf("gaso=")?P(b,"gaso=",B):P(a.i.k(),L,";");if(b[x]>=10){a.B=b;a.Fc()}Z.ib=r};a.J=function(){return a._visitCode()%1E4<c.U*100};a.Gc=function(){var b,e,o=c.a.links;if(!c.lb){b=c.a.domain;if("www."==O(b,0,4))b=O(b,4);c.t.push("."+b)}for(b=0;b<o[x]&&(c.ra==-1||b<c.ra);b++){e=o[b];if(d(e.host))if(!e.gatcOnclick){e.gatcOnclick=e.onclick?e.onclick:a.yc;e.onclick=function(m){var q=
+!this.target||this.target=="_self"||this.target=="_top"||this.target=="_parent";q=q&&!a.Rb(m);a.Mc(m,this,q);return q?v:this.gatcOnclick?this.gatcOnclick(m):r}}}};a.yc=function(){};a._trackPageview=function(b){if(p()){a._initData();c.t&&a.Gc();a.Lc(b);a.F=v}};a._trackTrans=function(){var b=a.c,e=[],o,m,q;a._initData();if(a.f&&a.J()){for(o=0;o<a.f.Y[x];o++){m=a.f.Y[o];V(e,m.Ca());for(q=0;q<m.R[x];q++)V(e,m.R[q].Ca())}for(o=0;o<e[x];o++)j.H(e[o],a.s,b,r)}};a._setTrans=function(){var b=c.a,e,o,m;b=b.getElementById?
+b.getElementById("utmtrans"):b.utmform&&b.utmform.utmtrans?b.utmform.utmtrans:w;a._initData();if(b&&b.value){a.f=new Z.n;m=b.value.split("UTM:");c.u=!c.u||""==c.u?"|":c.u;for(b=0;b<m[x];b++){m[b]=f(m[b]);e=m[b].split(c.u);for(o=0;o<e[x];o++)e[o]=f(e[o]);if("T"==e[0])a._addTrans(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]);else"I"==e[0]&&a._addItem(e[1],e[2],e[3],e[4],e[5],e[6])}}};a._addTrans=function(b,e,o,m,q,u,z,M){a.f=a.f?a.f:new Z.n;return a.f.Ob(b,e,o,m,q,u,z,M)};a._addItem=function(b,e,o,m,q,u){var z;
+a.f=a.f?a.f:new Z.n;(z=a.f.hb(b))||(z=a._addTrans(b,"","","","","","",""));z.Nb(e,o,m,q,u)};a._setVar=function(b){if(b&&""!=b&&t()){a._initData();s.Ec(S(b));a.J()&&j.H("&utmt=var",a.s,a.c)}};a._setCustomVar=function(b,e,o,m){a._initData();return s.Cc(b,e,o,m)};a._deleteCustomVar=function(b){a._initData();s.Ub(b)};a._getVisitorCustomVar=function(b){a._initData();return s.mc(b)};a._setMaxCustomVariables=function(b){c.ob=b};a._link=function(b,e){if(c.z&&b){a._initData();c.a[A].href=a._getLinkerUrl(b,
+e)}};a._linkByPost=function(b,e){if(c.z&&b&&b.action){a._initData();b.action=a._getLinkerUrl(b.action,e)}};a._setXKey=function(b,e,o){a.g._setKey(b,e,o)};a._setXValue=function(b,e,o){a.g._setValue(b,e,o)};a._getXKey=function(b,e){return a.g._getKey(b,e)};a._getXValue=function(b,e){return a.g.getValue(b,e)};a._clearXKey=function(b){a.g._clearKey(b)};a._clearXValue=function(b){a.g._clearValue(b)};a._createXObj=function(){a._initData();return new Z.N};a._sendXEvent=function(b){var e="";a._initData();
+if(a.J()){e+="&utmt=event&utme="+S(a.g.Ac(b))+a.wa();j.H(e,a.s,a.c,v,r)}};a._createEventTracker=function(b){a._initData();return new Z.Jb(b,a)};a._trackEvent=function(b,e,o,m){var q=a.cb;if(w!=b&&w!=e&&""!=b&&""!=e){q._clearKey(5);q._clearValue(5);(b=q._setKey(5,1,b)&&q._setKey(5,2,e)&&(w==o||q._setKey(5,3,o))&&(w==m||q._setValue(5,1,m)))&&a._sendXEvent(q)}else b=v;return b};a.Mc=function(b,e,o){a._initData();if(a.J()){var m=new Z.N;m._setKey(6,1,e.href);var q=o?function(){a.db(b,e)}:w;j.H("&utmt=event&utme="+
+S(m.G())+a.wa(),a.s,a.c,v,r,q);if(o){var u=this;c.e.setTimeout(function(){u.db(b,e)},500)}}};a.db=function(b,e){if(!b)b=c.e.event;var o=r;if(e.gatcOnclick)o=e.gatcOnclick(b);if(o||typeof o=="undefined")if(!e.target||e.target=="_self")c.e[A]=e.href;else if(e.target=="_top")c.e.top.document[A]=e.href;else if(e.target=="_parent")c.e.parent.document[A]=e.href};a.Rb=function(b){if(!b)b=c.e.event;var e=b.shiftKey||b.ctrlKey||b.altKey;if(!e)if(b.modifiers&&c.e.Event)e=b.modifiers&c.e.Event.CONTROL_MASK||
+b.modifiers&c.e.Event.SHIFT_MASK||b.modifiers&c.e.Event.ALT_MASK;return e};a.Pc=function(){return c};a._setDomainName=function(b){c.b=b};a._addOrganic=function(b,e,o){c.T.splice(o?0:c.T.length,0,new Z.Ha(b,e))};a._clearOrganic=function(){c.T=[]};a._addIgnoredOrganic=function(b){V(c.ta,b)};a._clearIgnoredOrganic=function(){c.ta=[]};a._addIgnoredRef=function(b){V(c.va,b)};a._clearIgnoredRef=function(){c.va=[]};a._setAllowHash=function(b){c.Ra=b?1:0};a._setCampaignTrack=function(b){c.da=b?1:0};a._setClientInfo=
+function(b){c.fa=b?1:0};a._getClientInfo=function(){return c.fa};a._setCookiePath=function(b){c.h=b};a._setTransactionDelim=function(b){c.u=b};a._setCookieTimeout=function(b){a._setCampaignCookieTimeout(b*1E3)};a._setCampaignCookieTimeout=function(b){c.Ta=b};a._setDetectFlash=function(b){c.ha=b?1:0};a._getDetectFlash=function(){return c.ha};a._setDetectTitle=function(b){c.ga=b?1:0};a._getDetectTitle=function(){return c.ga};a._setLocalGifPath=function(b){c.oa=b};a._getLocalGifPath=function(){return c.oa};
+a._setLocalServerMode=function(){c.I=0};a._setRemoteServerMode=function(){c.I=1};a._setLocalRemoteServerMode=function(){c.I=2};a._getServiceMode=function(){return c.I};a._setSampleRate=function(b){c.U=b};a._setSessionTimeout=function(b){a._setSessionCookieTimeout(b*1E3)};a._setSessionCookieTimeout=function(b){c.sb=b};a._setAllowLinker=function(b){c.z=b?1:0};a._setAllowAnchor=function(b){c.ba=b?1:0};a._setCampNameKey=function(b){c.Ia=b};a._setCampContentKey=function(b){c.Ja=b};a._setCampIdKey=function(b){c.Ka=
+b};a._setCampMediumKey=function(b){c.La=b};a._setCampNOKey=function(b){c.Ma=b};a._setCampSourceKey=function(b){c.Na=b};a._setCampTermKey=function(b){c.Oa=b};a._setCampCIdKey=function(b){c.Pa=b};a._getAccount=function(){return a.s};a._setAccount=function(b){a.s=b};a._setNamespace=function(b){c.o=b?S(b):w};a._getVersion=function(){return ca};a._setAutoTrackOutbound=function(b){c.t=[];if(b)c.t=b};a._setTrackOutboundSubdomains=function(b){c.lb=b};a._setHrefExamineLimit=function(b){c.ra=b};a._setReferrerOverride=
+function(b){a.ab=b};a._setCookiePersistence=function(b){a._setVisitorCookieTimeout(b)};a._setVisitorCookieTimeout=function(b){c.v=b}};Z._getTracker=function(i,l){return new Z.aa(i,l)};var ka=v,$={ca:{},_createAsyncTracker:function(i,l){l=l||"";i=new Z.aa(i);$.ca[l]=i;ka=r;return i},_getAsyncTracker:function(i){i=i||"";var l=$.ca[i];if(!l){l=new Z.aa;$.ca[i]=l;ka=r}return l},push:function(){for(var i=arguments,l=0,g=0;g<i[x];g++)try{if(typeof i[g]==="function")i[g]();else{var t="",k=i[g][0],p=k.lastIndexOf(".");if(p>0){t=O(k,0,p);k=O(k,p+1)}var f=$._getAsyncTracker(t);f[k].apply(f,i[g].slice(1))}}catch(h){l++}return l}};window[aa]=Z;function na(){var i=window[ba],l=v;if(i&&typeof i.push=="function"){l=i.constructor==Array;if(!l)return}window[ba]=$;l&&$.push.apply($,i)}na();})()
+
+
+
+/* Based on Alex Arnell's inheritance implementation. */
+var Class = {
+ create: function() {
+ var parent = null, properties = $A(arguments);
+ if (Object.isFunction(properties[0]))
+ parent = properties.shift();
+
+ function klass() {
+ this.initialize.apply(this, arguments);
+ }
+
+ Object.extend(klass, Class.Methods);
+ klass.superclass = parent;
+ klass.subclasses = [];
+
+ if (parent) {
+ var subclass = function() { };
+ subclass.prototype = parent.prototype;
+ klass.prototype = new subclass;
+ parent.subclasses.push(klass);
+ }
+
+ for (var i = 0; i < properties.length; i++)
+ klass.addMethods(properties[i]);
+
+ if (!klass.prototype.initialize)
+ klass.prototype.initialize = this.emptyFunction;
+
+ klass.prototype.constructor = klass;
+
+ return klass;
+ },
+ emptyFunction:function () {},
+
+};
+
+Class.Methods = {
+ addMethods: function(source) {
+ var ancestor = this.superclass && this.superclass.prototype;
+ var properties = Object.keys(source);
+
+ if (!Object.keys({ toString: true }).length)
+ properties.push("toString", "valueOf");
+
+ for (var i = 0, length = properties.length; i < length; i++) {
+ var property = properties[i], value = source[property];
+ if (ancestor && Object.isFunction(value) &&
+ value.argumentNames().first() == "$super") {
+ var method = value, value = Object.extend((function(m) {
+ return function() { return ancestor[m].apply(this, arguments) };
+ })(property).wrap(method), {
+ valueOf: function() { return method },
+ toString: function() { return method.toString() }
+ });
+ }
+ this.prototype[property] = value;
+ }
+
+ return this;
+ }
+};
+
+Object.extend = function(destination, source) {
+ for (var property in source)
+ destination[property] = source[property];
+ return destination;
+};
+
+Object.extend(Object, {
+ inspect: function(object) {
+ try {
+ if (Object.isUndefined(object)) return 'undefined';
+ if (object === null) return 'null';
+ return object.inspect ? object.inspect() : String(object);
+ } catch (e) {
+ if (e instanceof RangeError) return '...';
+ throw e;
+ }
+ },
+
+ toJSON: function(object) {
+ var type = typeof object;
+ switch (type) {
+ case 'undefined':
+ case 'function':
+ case 'unknown': return;
+ case 'boolean': return object.toString();
+ }
+
+ if (object === null) return 'null';
+ if (object.toJSON) return object.toJSON();
+ if (Object.isElement(object)) return;
+
+ var results = [];
+ for (var property in object) {
+ var value = Object.toJSON(object[property]);
+ if (!Object.isUndefined(value))
+ results.push(property.toJSON() + ': ' + value);
+ }
+
+ return '{' + results.join(', ') + '}';
+ },
+
+ toQueryString: function(object) {
+ return $H(object).toQueryString();
+ },
+
+ toHTML: function(object) {
+ return object && object.toHTML ? object.toHTML() : String.interpret(object);
+ },
+
+ keys: function(object) {
+ var keys = [];
+ for (var property in object)
+ keys.push(property);
+ return keys;
+ },
+
+ values: function(object) {
+ var values = [];
+ for (var property in object)
+ values.push(object[property]);
+ return values;
+ },
+
+ clone: function(object) {
+ return Object.extend({ }, object);
+ },
+
+ isElement: function(object) {
+ return object && object.nodeType == 1;
+ },
+
+ isArray: function(object) {
+ return object != null && typeof object == "object" &&
+ 'splice' in object && 'join' in object;
+ },
+
+ isHash: function(object) {
+ return object instanceof Hash;
+ },
+
+ isFunction: function(object) {
+ return typeof object == "function";
+ },
+
+ isString: function(object) {
+ return typeof object == "string";
+ },
+
+ isNumber: function(object) {
+ return typeof object == "number";
+ },
+
+ isUndefined: function(object) {
+ return typeof object == "undefined";
+ }
+});
+
+function $A(iterable) {
+ if (!iterable) return [];
+ if (iterable.toArray) return iterable.toArray();
+ var length = iterable.length || 0, results = new Array(length);
+ while (length--) results[length] = iterable[length];
+ return results;
+}
+
+if (WebKit = navigator.userAgent.indexOf('AppleWebKit/') > -1) {
+ $A = function(iterable) {
+ if (!iterable) return [];
+ if (!(Object.isFunction(iterable) && iterable == '[object NodeList]') &&
+ iterable.toArray) return iterable.toArray();
+ var length = iterable.length || 0, results = new Array(length);
+ while (length--) results[length] = iterable[length];
+ return results;
+ };
+}
+
+
+
+/*
+ * Box2Djs (port of Box2DFlash 1.4.3.1) - http://box2d-js.sourceforge.net/
+ * Single-filed and jsmined ( http://code.google.com/p/jsmin-php/ ) by Mr.doob
+ */
+var b2Settings=Class.create();b2Settings.prototype={initialize:function(){}}
+b2Settings.USHRT_MAX=0x0000ffff;b2Settings.b2_pi=Math.PI;b2Settings.b2_massUnitsPerKilogram=1.0;b2Settings.b2_timeUnitsPerSecond=1.0;b2Settings.b2_lengthUnitsPerMeter=30.0;b2Settings.b2_maxManifoldPoints=2;b2Settings.b2_maxShapesPerBody=64;b2Settings.b2_maxPolyVertices=8;b2Settings.b2_maxProxies=1024;b2Settings.b2_maxPairs=8*b2Settings.b2_maxProxies;b2Settings.b2_linearSlop=0.005*b2Settings.b2_lengthUnitsPerMeter;b2Settings.b2_angularSlop=2.0/180.0*b2Settings.b2_pi;b2Settings.b2_velocityThreshold=1.0*b2Settings.b2_lengthUnitsPerMeter/b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_maxLinearCorrection=0.2*b2Settings.b2_lengthUnitsPerMeter;b2Settings.b2_maxAngularCorrection=8.0/180.0*b2Settings.b2_pi;b2Settings.b2_contactBaumgarte=0.2;b2Settings.b2_timeToSleep=0.5*b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_linearSleepTolerance=0.01*b2Settings.b2_lengthUnitsPerMeter/b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_angularSleepTolerance=2.0/180.0/b2Settings.b2_timeUnitsPerSecond;b2Settings.b2Assert=function(a)
+{if(!a){var nullVec;nullVec.x++;}};
+var b2Vec2=Class.create();b2Vec2.prototype={initialize:function(x_,y_){this.x=x_;this.y=y_;},SetZero:function(){this.x=0.0;this.y=0.0;},Set:function(x_,y_){this.x=x_;this.y=y_;},SetV:function(v){this.x=v.x;this.y=v.y;},Negative:function(){return new b2Vec2(-this.x,-this.y);},Copy:function(){return new b2Vec2(this.x,this.y);},Add:function(v)
+{this.x+=v.x;this.y+=v.y;},Subtract:function(v)
+{this.x-=v.x;this.y-=v.y;},Multiply:function(a)
+{this.x*=a;this.y*=a;},MulM:function(A)
+{var tX=this.x;this.x=A.col1.x*tX+A.col2.x*this.y;this.y=A.col1.y*tX+A.col2.y*this.y;},MulTM:function(A)
+{var tX=b2Math.b2Dot(this,A.col1);this.y=b2Math.b2Dot(this,A.col2);this.x=tX;},CrossVF:function(s)
+{var tX=this.x;this.x=s*this.y;this.y=-s*tX;},CrossFV:function(s)
+{var tX=this.x;this.x=-s*this.y;this.y=s*tX;},MinV:function(b)
+{this.x=this.x<b.x?this.x:b.x;this.y=this.y<b.y?this.y:b.y;},MaxV:function(b)
+{this.x=this.x>b.x?this.x:b.x;this.y=this.y>b.y?this.y:b.y;},Abs:function()
+{this.x=Math.abs(this.x);this.y=Math.abs(this.y);},Length:function()
+{return Math.sqrt(this.x*this.x+this.y*this.y);},Normalize:function()
+{var length=this.Length();if(length<Number.MIN_VALUE)
+{return 0.0;}
+var invLength=1.0/length;this.x*=invLength;this.y*=invLength;return length;},IsValid:function()
+{return b2Math.b2IsValid(this.x)&&b2Math.b2IsValid(this.y);},x:null,y:null};b2Vec2.Make=function(x_,y_)
+{return new b2Vec2(x_,y_);};
+var b2Mat22=Class.create();b2Mat22.prototype={initialize:function(angle,c1,c2)
+{if(angle==null)angle=0;this.col1=new b2Vec2();this.col2=new b2Vec2();if(c1!=null&&c2!=null){this.col1.SetV(c1);this.col2.SetV(c2);}
+else{var c=Math.cos(angle);var s=Math.sin(angle);this.col1.x=c;this.col2.x=-s;this.col1.y=s;this.col2.y=c;}},Set:function(angle)
+{var c=Math.cos(angle);var s=Math.sin(angle);this.col1.x=c;this.col2.x=-s;this.col1.y=s;this.col2.y=c;},SetVV:function(c1,c2)
+{this.col1.SetV(c1);this.col2.SetV(c2);},Copy:function(){return new b2Mat22(0,this.col1,this.col2);},SetM:function(m)
+{this.col1.SetV(m.col1);this.col2.SetV(m.col2);},AddM:function(m)
+{this.col1.x+=m.col1.x;this.col1.y+=m.col1.y;this.col2.x+=m.col2.x;this.col2.y+=m.col2.y;},SetIdentity:function()
+{this.col1.x=1.0;this.col2.x=0.0;this.col1.y=0.0;this.col2.y=1.0;},SetZero:function()
+{this.col1.x=0.0;this.col2.x=0.0;this.col1.y=0.0;this.col2.y=0.0;},Invert:function(out)
+{var a=this.col1.x;var b=this.col2.x;var c=this.col1.y;var d=this.col2.y;var det=a*d-b*c;det=1.0/det;out.col1.x=det*d;out.col2.x=-det*b;out.col1.y=-det*c;out.col2.y=det*a;return out;},Solve:function(out,bX,bY)
+{var a11=this.col1.x;var a12=this.col2.x;var a21=this.col1.y;var a22=this.col2.y;var det=a11*a22-a12*a21;det=1.0/det;out.x=det*(a22*bX-a12*bY);out.y=det*(a11*bY-a21*bX);return out;},Abs:function()
+{this.col1.Abs();this.col2.Abs();},col1:new b2Vec2(),col2:new b2Vec2()};
+var b2Math=Class.create();b2Math.prototype={initialize:function(){}}
+b2Math.b2IsValid=function(x)
+{return isFinite(x);};b2Math.b2Dot=function(a,b)
+{return a.x*b.x+a.y*b.y;};b2Math.b2CrossVV=function(a,b)
+{return a.x*b.y-a.y*b.x;};b2Math.b2CrossVF=function(a,s)
+{var v=new b2Vec2(s*a.y,-s*a.x);return v;};b2Math.b2CrossFV=function(s,a)
+{var v=new b2Vec2(-s*a.y,s*a.x);return v;};b2Math.b2MulMV=function(A,v)
+{var u=new b2Vec2(A.col1.x*v.x+A.col2.x*v.y,A.col1.y*v.x+A.col2.y*v.y);return u;};b2Math.b2MulTMV=function(A,v)
+{var u=new b2Vec2(b2Math.b2Dot(v,A.col1),b2Math.b2Dot(v,A.col2));return u;};b2Math.AddVV=function(a,b)
+{var v=new b2Vec2(a.x+b.x,a.y+b.y);return v;};b2Math.SubtractVV=function(a,b)
+{var v=new b2Vec2(a.x-b.x,a.y-b.y);return v;};b2Math.MulFV=function(s,a)
+{var v=new b2Vec2(s*a.x,s*a.y);return v;};b2Math.AddMM=function(A,B)
+{var C=new b2Mat22(0,b2Math.AddVV(A.col1,B.col1),b2Math.AddVV(A.col2,B.col2));return C;};b2Math.b2MulMM=function(A,B)
+{var C=new b2Mat22(0,b2Math.b2MulMV(A,B.col1),b2Math.b2MulMV(A,B.col2));return C;};b2Math.b2MulTMM=function(A,B)
+{var c1=new b2Vec2(b2Math.b2Dot(A.col1,B.col1),b2Math.b2Dot(A.col2,B.col1));var c2=new b2Vec2(b2Math.b2Dot(A.col1,B.col2),b2Math.b2Dot(A.col2,B.col2));var C=new b2Mat22(0,c1,c2);return C;};b2Math.b2Abs=function(a)
+{return a>0.0?a:-a;};b2Math.b2AbsV=function(a)
+{var b=new b2Vec2(b2Math.b2Abs(a.x),b2Math.b2Abs(a.y));return b;};b2Math.b2AbsM=function(A)
+{var B=new b2Mat22(0,b2Math.b2AbsV(A.col1),b2Math.b2AbsV(A.col2));return B;};b2Math.b2Min=function(a,b)
+{return a<b?a:b;};b2Math.b2MinV=function(a,b)
+{var c=new b2Vec2(b2Math.b2Min(a.x,b.x),b2Math.b2Min(a.y,b.y));return c;};b2Math.b2Max=function(a,b)
+{return a>b?a:b;};b2Math.b2MaxV=function(a,b)
+{var c=new b2Vec2(b2Math.b2Max(a.x,b.x),b2Math.b2Max(a.y,b.y));return c;};b2Math.b2Clamp=function(a,low,high)
+{return b2Math.b2Max(low,b2Math.b2Min(a,high));};b2Math.b2ClampV=function(a,low,high)
+{return b2Math.b2MaxV(low,b2Math.b2MinV(a,high));};b2Math.b2Swap=function(a,b)
+{var tmp=a[0];a[0]=b[0];b[0]=tmp;};b2Math.b2Random=function()
+{return Math.random()*2-1;};b2Math.b2NextPowerOfTwo=function(x)
+{x|=(x>>1)&0x7FFFFFFF;x|=(x>>2)&0x3FFFFFFF;x|=(x>>4)&0x0FFFFFFF;x|=(x>>8)&0x00FFFFFF;x|=(x>>16)&0x0000FFFF;return x+1;};b2Math.b2IsPowerOfTwo=function(x)
+{var result=x>0&&(x&(x-1))==0;return result;};b2Math.tempVec2=new b2Vec2();b2Math.tempVec3=new b2Vec2();b2Math.tempVec4=new b2Vec2();b2Math.tempVec5=new b2Vec2();b2Math.tempMat=new b2Mat22();
+var b2AABB=Class.create();b2AABB.prototype={IsValid:function(){var dX=this.maxVertex.x;var dY=this.maxVertex.y;dX=this.maxVertex.x;dY=this.maxVertex.y;dX-=this.minVertex.x;dY-=this.minVertex.y;var valid=dX>=0.0&&dY>=0.0;valid=valid&&this.minVertex.IsValid()&&this.maxVertex.IsValid();return valid;},minVertex:new b2Vec2(),maxVertex:new b2Vec2(),initialize:function(){this.minVertex=new b2Vec2();this.maxVertex=new b2Vec2();}};
+var b2Bound=Class.create();b2Bound.prototype={IsLower:function(){return(this.value&1)==0;},IsUpper:function(){return(this.value&1)==1;},Swap:function(b){var tempValue=this.value;var tempProxyId=this.proxyId;var tempStabbingCount=this.stabbingCount;this.value=b.value;this.proxyId=b.proxyId;this.stabbingCount=b.stabbingCount;b.value=tempValue;b.proxyId=tempProxyId;b.stabbingCount=tempStabbingCount;},value:0,proxyId:0,stabbingCount:0,initialize:function(){}}
+
+var b2BoundValues=Class.create();b2BoundValues.prototype={lowerValues:[0,0],upperValues:[0,0],initialize:function(){this.lowerValues=[0,0];this.upperValues=[0,0];}}
+
+var b2Pair=Class.create();b2Pair.prototype={SetBuffered:function(){this.status|=b2Pair.e_pairBuffered;},ClearBuffered:function(){this.status&=~b2Pair.e_pairBuffered;},IsBuffered:function(){return(this.status&b2Pair.e_pairBuffered)==b2Pair.e_pairBuffered;},SetRemoved:function(){this.status|=b2Pair.e_pairRemoved;},ClearRemoved:function(){this.status&=~b2Pair.e_pairRemoved;},IsRemoved:function(){return(this.status&b2Pair.e_pairRemoved)==b2Pair.e_pairRemoved;},SetFinal:function(){this.status|=b2Pair.e_pairFinal;},IsFinal:function(){return(this.status&b2Pair.e_pairFinal)==b2Pair.e_pairFinal;},userData:null,proxyId1:0,proxyId2:0,next:0,status:0,initialize:function(){}};b2Pair.b2_nullPair=b2Settings.USHRT_MAX;b2Pair.b2_nullProxy=b2Settings.USHRT_MAX;b2Pair.b2_tableCapacity=b2Settings.b2_maxPairs;b2Pair.b2_tableMask=b2Pair.b2_tableCapacity-1;b2Pair.e_pairBuffered=0x0001;b2Pair.e_pairRemoved=0x0002;b2Pair.e_pairFinal=0x0004;
+var b2PairCallback=Class.create();b2PairCallback.prototype={PairAdded:function(proxyUserData1,proxyUserData2){return null},PairRemoved:function(proxyUserData1,proxyUserData2,pairUserData){},initialize:function(){}};
+var b2BufferedPair=Class.create();b2BufferedPair.prototype={proxyId1:0,proxyId2:0,initialize:function(){}}
+
+var b2PairManager=Class.create();b2PairManager.prototype={initialize:function(){var i=0;this.m_hashTable=new Array(b2Pair.b2_tableCapacity);for(i=0;i<b2Pair.b2_tableCapacity;++i)
+{this.m_hashTable[i]=b2Pair.b2_nullPair;}
+this.m_pairs=new Array(b2Settings.b2_maxPairs);for(i=0;i<b2Settings.b2_maxPairs;++i)
+{this.m_pairs[i]=new b2Pair();}
+this.m_pairBuffer=new Array(b2Settings.b2_maxPairs);for(i=0;i<b2Settings.b2_maxPairs;++i)
+{this.m_pairBuffer[i]=new b2BufferedPair();}
+for(i=0;i<b2Settings.b2_maxPairs;++i)
+{this.m_pairs[i].proxyId1=b2Pair.b2_nullProxy;this.m_pairs[i].proxyId2=b2Pair.b2_nullProxy;this.m_pairs[i].userData=null;this.m_pairs[i].status=0;this.m_pairs[i].next=(i+1);}
+this.m_pairs[b2Settings.b2_maxPairs-1].next=b2Pair.b2_nullPair;this.m_pairCount=0;},Initialize:function(broadPhase,callback){this.m_broadPhase=broadPhase;this.m_callback=callback;},AddBufferedPair:function(proxyId1,proxyId2){var pair=this.AddPair(proxyId1,proxyId2);if(pair.IsBuffered()==false)
+{pair.SetBuffered();this.m_pairBuffer[this.m_pairBufferCount].proxyId1=pair.proxyId1;this.m_pairBuffer[this.m_pairBufferCount].proxyId2=pair.proxyId2;++this.m_pairBufferCount;}
+pair.ClearRemoved();if(b2BroadPhase.s_validate)
+{this.ValidateBuffer();}},RemoveBufferedPair:function(proxyId1,proxyId2){var pair=this.Find(proxyId1,proxyId2);if(pair==null)
+{return;}
+if(pair.IsBuffered()==false)
+{pair.SetBuffered();this.m_pairBuffer[this.m_pairBufferCount].proxyId1=pair.proxyId1;this.m_pairBuffer[this.m_pairBufferCount].proxyId2=pair.proxyId2;++this.m_pairBufferCount;}
+pair.SetRemoved();if(b2BroadPhase.s_validate)
+{this.ValidateBuffer();}},Commit:function(){var i=0;var removeCount=0;var proxies=this.m_broadPhase.m_proxyPool;for(i=0;i<this.m_pairBufferCount;++i)
+{var pair=this.Find(this.m_pairBuffer[i].proxyId1,this.m_pairBuffer[i].proxyId2);pair.ClearBuffered();var proxy1=proxies[pair.proxyId1];var proxy2=proxies[pair.proxyId2];if(pair.IsRemoved())
+{if(pair.IsFinal()==true)
+{this.m_callback.PairRemoved(proxy1.userData,proxy2.userData,pair.userData);}
+this.m_pairBuffer[removeCount].proxyId1=pair.proxyId1;this.m_pairBuffer[removeCount].proxyId2=pair.proxyId2;++removeCount;}
+else
+{if(pair.IsFinal()==false)
+{pair.userData=this.m_callback.PairAdded(proxy1.userData,proxy2.userData);pair.SetFinal();}}}
+for(i=0;i<removeCount;++i)
+{this.RemovePair(this.m_pairBuffer[i].proxyId1,this.m_pairBuffer[i].proxyId2);}
+this.m_pairBufferCount=0;if(b2BroadPhase.s_validate)
+{this.ValidateTable();}},AddPair:function(proxyId1,proxyId2){if(proxyId1>proxyId2){var temp=proxyId1;proxyId1=proxyId2;proxyId2=temp;}
+var hash=b2PairManager.Hash(proxyId1,proxyId2)&b2Pair.b2_tableMask;var pair=pair=this.FindHash(proxyId1,proxyId2,hash);if(pair!=null)
+{return pair;}
+var pIndex=this.m_freePair;pair=this.m_pairs[pIndex];this.m_freePair=pair.next;pair.proxyId1=proxyId1;pair.proxyId2=proxyId2;pair.status=0;pair.userData=null;pair.next=this.m_hashTable[hash];this.m_hashTable[hash]=pIndex;++this.m_pairCount;return pair;},RemovePair:function(proxyId1,proxyId2){if(proxyId1>proxyId2){var temp=proxyId1;proxyId1=proxyId2;proxyId2=temp;}
+var hash=b2PairManager.Hash(proxyId1,proxyId2)&b2Pair.b2_tableMask;var node=this.m_hashTable[hash];var pNode=null;while(node!=b2Pair.b2_nullPair)
+{if(b2PairManager.Equals(this.m_pairs[node],proxyId1,proxyId2))
+{var index=node;if(pNode){pNode.next=this.m_pairs[node].next;}
+else{this.m_hashTable[hash]=this.m_pairs[node].next;}
+var pair=this.m_pairs[index];var userData=pair.userData;pair.next=this.m_freePair;pair.proxyId1=b2Pair.b2_nullProxy;pair.proxyId2=b2Pair.b2_nullProxy;pair.userData=null;pair.status=0;this.m_freePair=index;--this.m_pairCount;return userData;}
+else
+{pNode=this.m_pairs[node];node=pNode.next;}}
+return null;},Find:function(proxyId1,proxyId2){if(proxyId1>proxyId2){var temp=proxyId1;proxyId1=proxyId2;proxyId2=temp;}
+var hash=b2PairManager.Hash(proxyId1,proxyId2)&b2Pair.b2_tableMask;return this.FindHash(proxyId1,proxyId2,hash);},FindHash:function(proxyId1,proxyId2,hash){var index=this.m_hashTable[hash];while(index!=b2Pair.b2_nullPair&&b2PairManager.Equals(this.m_pairs[index],proxyId1,proxyId2)==false)
+{index=this.m_pairs[index].next;}
+if(index==b2Pair.b2_nullPair)
+{return null;}
+return this.m_pairs[index];},ValidateBuffer:function(){},ValidateTable:function(){},m_broadPhase:null,m_callback:null,m_pairs:null,m_freePair:0,m_pairCount:0,m_pairBuffer:null,m_pairBufferCount:0,m_hashTable:null};b2PairManager.Hash=function(proxyId1,proxyId2)
+{var key=((proxyId2<<16)&0xffff0000)|proxyId1;key=~key+((key<<15)&0xFFFF8000);key=key^((key>>12)&0x000fffff);key=key+((key<<2)&0xFFFFFFFC);key=key^((key>>4)&0x0fffffff);key=key*2057;key=key^((key>>16)&0x0000ffff);return key;};b2PairManager.Equals=function(pair,proxyId1,proxyId2)
+{return(pair.proxyId1==proxyId1&&pair.proxyId2==proxyId2);};b2PairManager.EqualsPair=function(pair1,pair2)
+{return pair1.proxyId1==pair2.proxyId1&&pair1.proxyId2==pair2.proxyId2;};
+var b2BroadPhase=Class.create();b2BroadPhase.prototype={initialize:function(worldAABB,callback){this.m_pairManager=new b2PairManager();this.m_proxyPool=new Array(b2Settings.b2_maxPairs);this.m_bounds=new Array(2*b2Settings.b2_maxProxies);this.m_queryResults=new Array(b2Settings.b2_maxProxies);this.m_quantizationFactor=new b2Vec2();var i=0;this.m_pairManager.Initialize(this,callback);this.m_worldAABB=worldAABB;this.m_proxyCount=0;for(i=0;i<b2Settings.b2_maxProxies;i++){this.m_queryResults[i]=0;}
+this.m_bounds=new Array(2);for(i=0;i<2;i++){this.m_bounds[i]=new Array(2*b2Settings.b2_maxProxies);for(var j=0;j<2*b2Settings.b2_maxProxies;j++){this.m_bounds[i][j]=new b2Bound();}}
+var dX=worldAABB.maxVertex.x;var dY=worldAABB.maxVertex.y;dX-=worldAABB.minVertex.x;dY-=worldAABB.minVertex.y;this.m_quantizationFactor.x=b2Settings.USHRT_MAX/dX;this.m_quantizationFactor.y=b2Settings.USHRT_MAX/dY;var tProxy;for(i=0;i<b2Settings.b2_maxProxies-1;++i)
+{tProxy=new b2Proxy();this.m_proxyPool[i]=tProxy;tProxy.SetNext(i+1);tProxy.timeStamp=0;tProxy.overlapCount=b2BroadPhase.b2_invalid;tProxy.userData=null;}
+tProxy=new b2Proxy();this.m_proxyPool[b2Settings.b2_maxProxies-1]=tProxy;tProxy.SetNext(b2Pair.b2_nullProxy);tProxy.timeStamp=0;tProxy.overlapCount=b2BroadPhase.b2_invalid;tProxy.userData=null;this.m_freeProxy=0;this.m_timeStamp=1;this.m_queryResultCount=0;},InRange:function(aabb){var dX;var dY;var d2X;var d2Y;dX=aabb.minVertex.x;dY=aabb.minVertex.y;dX-=this.m_worldAABB.maxVertex.x;dY-=this.m_worldAABB.maxVertex.y;d2X=this.m_worldAABB.minVertex.x;d2Y=this.m_worldAABB.minVertex.y;d2X-=aabb.maxVertex.x;d2Y-=aabb.maxVertex.y;dX=b2Math.b2Max(dX,d2X);dY=b2Math.b2Max(dY,d2Y);return b2Math.b2Max(dX,dY)<0.0;},GetProxy:function(proxyId){if(proxyId==b2Pair.b2_nullProxy||this.m_proxyPool[proxyId].IsValid()==false)
+{return null;}
+return this.m_proxyPool[proxyId];},CreateProxy:function(aabb,userData){var index=0;var proxy;var proxyId=this.m_freeProxy;proxy=this.m_proxyPool[proxyId];this.m_freeProxy=proxy.GetNext();proxy.overlapCount=0;proxy.userData=userData;var boundCount=2*this.m_proxyCount;var lowerValues=new Array();var upperValues=new Array();this.ComputeBounds(lowerValues,upperValues,aabb);for(var axis=0;axis<2;++axis)
+{var bounds=this.m_bounds[axis];var lowerIndex=0;var upperIndex=0;var lowerIndexOut=[lowerIndex];var upperIndexOut=[upperIndex];this.Query(lowerIndexOut,upperIndexOut,lowerValues[axis],upperValues[axis],bounds,boundCount,axis);lowerIndex=lowerIndexOut[0];upperIndex=upperIndexOut[0];var tArr=new Array();var j=0;var tEnd=boundCount-upperIndex
+var tBound1;var tBound2;for(j=0;j<tEnd;j++){tArr[j]=new b2Bound();tBound1=tArr[j];tBound2=bounds[upperIndex+j];tBound1.value=tBound2.value;tBound1.proxyId=tBound2.proxyId;tBound1.stabbingCount=tBound2.stabbingCount;}
+tEnd=tArr.length;var tIndex=upperIndex+2;for(j=0;j<tEnd;j++){tBound2=tArr[j];tBound1=bounds[tIndex+j]
+tBound1.value=tBound2.value;tBound1.proxyId=tBound2.proxyId;tBound1.stabbingCount=tBound2.stabbingCount;}
+tArr=new Array();tEnd=upperIndex-lowerIndex;for(j=0;j<tEnd;j++){tArr[j]=new b2Bound();tBound1=tArr[j];tBound2=bounds[lowerIndex+j];tBound1.value=tBound2.value;tBound1.proxyId=tBound2.proxyId;tBound1.stabbingCount=tBound2.stabbingCount;}
+tEnd=tArr.length;tIndex=lowerIndex+1;for(j=0;j<tEnd;j++){tBound2=tArr[j];tBound1=bounds[tIndex+j]
+tBound1.value=tBound2.value;tBound1.proxyId=tBound2.proxyId;tBound1.stabbingCount=tBound2.stabbingCount;}
+++upperIndex;bounds[lowerIndex].value=lowerValues[axis];bounds[lowerIndex].proxyId=proxyId;bounds[upperIndex].value=upperValues[axis];bounds[upperIndex].proxyId=proxyId;bounds[lowerIndex].stabbingCount=lowerIndex==0?0:bounds[lowerIndex-1].stabbingCount;bounds[upperIndex].stabbingCount=bounds[upperIndex-1].stabbingCount;for(index=lowerIndex;index<upperIndex;++index)
+{bounds[index].stabbingCount++;}
+for(index=lowerIndex;index<boundCount+2;++index)
+{var proxy2=this.m_proxyPool[bounds[index].proxyId];if(bounds[index].IsLower())
+{proxy2.lowerBounds[axis]=index;}
+else
+{proxy2.upperBounds[axis]=index;}}}
+++this.m_proxyCount;for(var i=0;i<this.m_queryResultCount;++i)
+{this.m_pairManager.AddBufferedPair(proxyId,this.m_queryResults[i]);}
+this.m_pairManager.Commit();this.m_queryResultCount=0;this.IncrementTimeStamp();return proxyId;},DestroyProxy:function(proxyId){var proxy=this.m_proxyPool[proxyId];var boundCount=2*this.m_proxyCount;for(var axis=0;axis<2;++axis)
+{var bounds=this.m_bounds[axis];var lowerIndex=proxy.lowerBounds[axis];var upperIndex=proxy.upperBounds[axis];var lowerValue=bounds[lowerIndex].value;var upperValue=bounds[upperIndex].value;var tArr=new Array();var j=0;var tEnd=upperIndex-lowerIndex-1;var tBound1;var tBound2;for(j=0;j<tEnd;j++){tArr[j]=new b2Bound();tBound1=tArr[j];tBound2=bounds[lowerIndex+1+j];tBound1.value=tBound2.value;tBound1.proxyId=tBound2.proxyId;tBound1.stabbingCount=tBound2.stabbingCount;}
+tEnd=tArr.length;var tIndex=lowerIndex;for(j=0;j<tEnd;j++){tBound2=tArr[j];tBound1=bounds[tIndex+j]
+tBound1.value=tBound2.value;tBound1.proxyId=tBound2.proxyId;tBound1.stabbingCount=tBound2.stabbingCount;}
+tArr=new Array();tEnd=boundCount-upperIndex-1;for(j=0;j<tEnd;j++){tArr[j]=new b2Bound();tBound1=tArr[j];tBound2=bounds[upperIndex+1+j];tBound1.value=tBound2.value;tBound1.proxyId=tBound2.proxyId;tBound1.stabbingCount=tBound2.stabbingCount;}
+tEnd=tArr.length;tIndex=upperIndex-1;for(j=0;j<tEnd;j++){tBound2=tArr[j];tBound1=bounds[tIndex+j]
+tBound1.value=tBound2.value;tBound1.proxyId=tBound2.proxyId;tBound1.stabbingCount=tBound2.stabbingCount;}
+tEnd=boundCount-2;for(var index=lowerIndex;index<tEnd;++index)
+{var proxy2=this.m_proxyPool[bounds[index].proxyId];if(bounds[index].IsLower())
+{proxy2.lowerBounds[axis]=index;}
+else
+{proxy2.upperBounds[axis]=index;}}
+tEnd=upperIndex-1;for(var index2=lowerIndex;index2<tEnd;++index2)
+{bounds[index2].stabbingCount--;}
+this.Query([0],[0],lowerValue,upperValue,bounds,boundCount-2,axis);}
+for(var i=0;i<this.m_queryResultCount;++i)
+{this.m_pairManager.RemoveBufferedPair(proxyId,this.m_queryResults[i]);}
+this.m_pairManager.Commit();this.m_queryResultCount=0;this.IncrementTimeStamp();proxy.userData=null;proxy.overlapCount=b2BroadPhase.b2_invalid;proxy.lowerBounds[0]=b2BroadPhase.b2_invalid;proxy.lowerBounds[1]=b2BroadPhase.b2_invalid;proxy.upperBounds[0]=b2BroadPhase.b2_invalid;proxy.upperBounds[1]=b2BroadPhase.b2_invalid;proxy.SetNext(this.m_freeProxy);this.m_freeProxy=proxyId;--this.m_proxyCount;},MoveProxy:function(proxyId,aabb){var axis=0;var index=0;var bound;var prevBound
+var nextBound
+var nextProxyId=0;var nextProxy;if(proxyId==b2Pair.b2_nullProxy||b2Settings.b2_maxProxies<=proxyId)
+{return;}
+if(aabb.IsValid()==false)
+{return;}
+var boundCount=2*this.m_proxyCount;var proxy=this.m_proxyPool[proxyId];var newValues=new b2BoundValues();this.ComputeBounds(newValues.lowerValues,newValues.upperValues,aabb);var oldValues=new b2BoundValues();for(axis=0;axis<2;++axis)
+{oldValues.lowerValues[axis]=this.m_bounds[axis][proxy.lowerBounds[axis]].value;oldValues.upperValues[axis]=this.m_bounds[axis][proxy.upperBounds[axis]].value;}
+for(axis=0;axis<2;++axis)
+{var bounds=this.m_bounds[axis];var lowerIndex=proxy.lowerBounds[axis];var upperIndex=proxy.upperBounds[axis];var lowerValue=newValues.lowerValues[axis];var upperValue=newValues.upperValues[axis];var deltaLower=lowerValue-bounds[lowerIndex].value;var deltaUpper=upperValue-bounds[upperIndex].value;bounds[lowerIndex].value=lowerValue;bounds[upperIndex].value=upperValue;if(deltaLower<0)
+{index=lowerIndex;while(index>0&&lowerValue<bounds[index-1].value)
+{bound=bounds[index];prevBound=bounds[index-1];var prevProxyId=prevBound.proxyId;var prevProxy=this.m_proxyPool[prevBound.proxyId];prevBound.stabbingCount++;if(prevBound.IsUpper()==true)
+{if(this.TestOverlap(newValues,prevProxy))
+{this.m_pairManager.AddBufferedPair(proxyId,prevProxyId);}
+prevProxy.upperBounds[axis]++;bound.stabbingCount++;}
+else
+{prevProxy.lowerBounds[axis]++;bound.stabbingCount--;}
+proxy.lowerBounds[axis]--;bound.Swap(prevBound);--index;}}
+if(deltaUpper>0)
+{index=upperIndex;while(index<boundCount-1&&bounds[index+1].value<=upperValue)
+{bound=bounds[index];nextBound=bounds[index+1];nextProxyId=nextBound.proxyId;nextProxy=this.m_proxyPool[nextProxyId];nextBound.stabbingCount++;if(nextBound.IsLower()==true)
+{if(this.TestOverlap(newValues,nextProxy))
+{this.m_pairManager.AddBufferedPair(proxyId,nextProxyId);}
+nextProxy.lowerBounds[axis]--;bound.stabbingCount++;}
+else
+{nextProxy.upperBounds[axis]--;bound.stabbingCount--;}
+proxy.upperBounds[axis]++;bound.Swap(nextBound);index++;}}
+if(deltaLower>0)
+{index=lowerIndex;while(index<boundCount-1&&bounds[index+1].value<=lowerValue)
+{bound=bounds[index];nextBound=bounds[index+1];nextProxyId=nextBound.proxyId;nextProxy=this.m_proxyPool[nextProxyId];nextBound.stabbingCount--;if(nextBound.IsUpper())
+{if(this.TestOverlap(oldValues,nextProxy))
+{this.m_pairManager.RemoveBufferedPair(proxyId,nextProxyId);}
+nextProxy.upperBounds[axis]--;bound.stabbingCount--;}
+else
+{nextProxy.lowerBounds[axis]--;bound.stabbingCount++;}
+proxy.lowerBounds[axis]++;bound.Swap(nextBound);index++;}}
+if(deltaUpper<0)
+{index=upperIndex;while(index>0&&upperValue<bounds[index-1].value)
+{bound=bounds[index];prevBound=bounds[index-1];prevProxyId=prevBound.proxyId;prevProxy=this.m_proxyPool[prevProxyId];prevBound.stabbingCount--;if(prevBound.IsLower()==true)
+{if(this.TestOverlap(oldValues,prevProxy))
+{this.m_pairManager.RemoveBufferedPair(proxyId,prevProxyId);}
+prevProxy.lowerBounds[axis]++;bound.stabbingCount--;}
+else
+{prevProxy.upperBounds[axis]++;bound.stabbingCount++;}
+proxy.upperBounds[axis]--;bound.Swap(prevBound);index--;}}}},Commit:function(){this.m_pairManager.Commit();},QueryAABB:function(aabb,userData,maxCount){var lowerValues=new Array();var upperValues=new Array();this.ComputeBounds(lowerValues,upperValues,aabb);var lowerIndex=0;var upperIndex=0;var lowerIndexOut=[lowerIndex];var upperIndexOut=[upperIndex];this.Query(lowerIndexOut,upperIndexOut,lowerValues[0],upperValues[0],this.m_bounds[0],2*this.m_proxyCount,0);this.Query(lowerIndexOut,upperIndexOut,lowerValues[1],upperValues[1],this.m_bounds[1],2*this.m_proxyCount,1);var count=0;for(var i=0;i<this.m_queryResultCount&&count<maxCount;++i,++count)
+{var proxy=this.m_proxyPool[this.m_queryResults[i]];userData[i]=proxy.userData;}
+this.m_queryResultCount=0;this.IncrementTimeStamp();return count;},Validate:function(){var pair;var proxy1;var proxy2;var overlap;for(var axis=0;axis<2;++axis)
+{var bounds=this.m_bounds[axis];var boundCount=2*this.m_proxyCount;var stabbingCount=0;for(var i=0;i<boundCount;++i)
+{var bound=bounds[i];if(bound.IsLower()==true)
+{stabbingCount++;}
+else
+{stabbingCount--;}}}},ComputeBounds:function(lowerValues,upperValues,aabb)
+{var minVertexX=aabb.minVertex.x;var minVertexY=aabb.minVertex.y;minVertexX=b2Math.b2Min(minVertexX,this.m_worldAABB.maxVertex.x);minVertexY=b2Math.b2Min(minVertexY,this.m_worldAABB.maxVertex.y);minVertexX=b2Math.b2Max(minVertexX,this.m_worldAABB.minVertex.x);minVertexY=b2Math.b2Max(minVertexY,this.m_worldAABB.minVertex.y);var maxVertexX=aabb.maxVertex.x;var maxVertexY=aabb.maxVertex.y;maxVertexX=b2Math.b2Min(maxVertexX,this.m_worldAABB.maxVertex.x);maxVertexY=b2Math.b2Min(maxVertexY,this.m_worldAABB.maxVertex.y);maxVertexX=b2Math.b2Max(maxVertexX,this.m_worldAABB.minVertex.x);maxVertexY=b2Math.b2Max(maxVertexY,this.m_worldAABB.minVertex.y);lowerValues[0]=(this.m_quantizationFactor.x*(minVertexX-this.m_worldAABB.minVertex.x))&(b2Settings.USHRT_MAX-1);upperValues[0]=((this.m_quantizationFactor.x*(maxVertexX-this.m_worldAABB.minVertex.x))&0x0000ffff)|1;lowerValues[1]=(this.m_quantizationFactor.y*(minVertexY-this.m_worldAABB.minVertex.y))&(b2Settings.USHRT_MAX-1);upperValues[1]=((this.m_quantizationFactor.y*(maxVertexY-this.m_worldAABB.minVertex.y))&0x0000ffff)|1;},TestOverlapValidate:function(p1,p2){for(var axis=0;axis<2;++axis)
+{var bounds=this.m_bounds[axis];if(bounds[p1.lowerBounds[axis]].value>bounds[p2.upperBounds[axis]].value)
+return false;if(bounds[p1.upperBounds[axis]].value<bounds[p2.lowerBounds[axis]].value)
+return false;}
+return true;},TestOverlap:function(b,p)
+{for(var axis=0;axis<2;++axis)
+{var bounds=this.m_bounds[axis];if(b.lowerValues[axis]>bounds[p.upperBounds[axis]].value)
+return false;if(b.upperValues[axis]<bounds[p.lowerBounds[axis]].value)
+return false;}
+return true;},Query:function(lowerQueryOut,upperQueryOut,lowerValue,upperValue,bounds,boundCount,axis){var lowerQuery=b2BroadPhase.BinarySearch(bounds,boundCount,lowerValue);var upperQuery=b2BroadPhase.BinarySearch(bounds,boundCount,upperValue);for(var j=lowerQuery;j<upperQuery;++j)
+{if(bounds[j].IsLower())
+{this.IncrementOverlapCount(bounds[j].proxyId);}}
+if(lowerQuery>0)
+{var i=lowerQuery-1;var s=bounds[i].stabbingCount;while(s)
+{if(bounds[i].IsLower())
+{var proxy=this.m_proxyPool[bounds[i].proxyId];if(lowerQuery<=proxy.upperBounds[axis])
+{this.IncrementOverlapCount(bounds[i].proxyId);--s;}}
+--i;}}
+lowerQueryOut[0]=lowerQuery;upperQueryOut[0]=upperQuery;},IncrementOverlapCount:function(proxyId){var proxy=this.m_proxyPool[proxyId];if(proxy.timeStamp<this.m_timeStamp)
+{proxy.timeStamp=this.m_timeStamp;proxy.overlapCount=1;}
+else
+{proxy.overlapCount=2;this.m_queryResults[this.m_queryResultCount]=proxyId;++this.m_queryResultCount;}},IncrementTimeStamp:function(){if(this.m_timeStamp==b2Settings.USHRT_MAX)
+{for(var i=0;i<b2Settings.b2_maxProxies;++i)
+{this.m_proxyPool[i].timeStamp=0;}
+this.m_timeStamp=1;}
+else
+{++this.m_timeStamp;}},m_pairManager:new b2PairManager(),m_proxyPool:new Array(b2Settings.b2_maxPairs),m_freeProxy:0,m_bounds:new Array(2*b2Settings.b2_maxProxies),m_queryResults:new Array(b2Settings.b2_maxProxies),m_queryResultCount:0,m_worldAABB:null,m_quantizationFactor:new b2Vec2(),m_proxyCount:0,m_timeStamp:0};b2BroadPhase.s_validate=false;b2BroadPhase.b2_invalid=b2Settings.USHRT_MAX;b2BroadPhase.b2_nullEdge=b2Settings.USHRT_MAX;b2BroadPhase.BinarySearch=function(bounds,count,value)
+{var low=0;var high=count-1;while(low<=high)
+{var mid=Math.floor((low+high)/2);if(bounds[mid].value>value)
+{high=mid-1;}
+else if(bounds[mid].value<value)
+{low=mid+1;}
+else
+{return(mid);}}
+return(low);};
+var b2Collision=Class.create();b2Collision.prototype={initialize:function(){}}
+b2Collision.b2_nullFeature=0x000000ff;b2Collision.ClipSegmentToLine=function(vOut,vIn,normal,offset)
+{var numOut=0;var vIn0=vIn[0].v;var vIn1=vIn[1].v;var distance0=b2Math.b2Dot(normal,vIn[0].v)-offset;var distance1=b2Math.b2Dot(normal,vIn[1].v)-offset;if(distance0<=0.0)vOut[numOut++]=vIn[0];if(distance1<=0.0)vOut[numOut++]=vIn[1];if(distance0*distance1<0.0)
+{var interp=distance0/(distance0-distance1);var tVec=vOut[numOut].v;tVec.x=vIn0.x+interp*(vIn1.x-vIn0.x);tVec.y=vIn0.y+interp*(vIn1.y-vIn0.y);if(distance0>0.0)
+{vOut[numOut].id=vIn[0].id;}
+else
+{vOut[numOut].id=vIn[1].id;}
+++numOut;}
+return numOut;};b2Collision.EdgeSeparation=function(poly1,edge1,poly2)
+{var vert1s=poly1.m_vertices;var count2=poly2.m_vertexCount;var vert2s=poly2.m_vertices;var normalX=poly1.m_normals[edge1].x;var normalY=poly1.m_normals[edge1].y;var tX=normalX;var tMat=poly1.m_R;normalX=tMat.col1.x*tX+tMat.col2.x*normalY;normalY=tMat.col1.y*tX+tMat.col2.y*normalY;var normalLocal2X=normalX;var normalLocal2Y=normalY;tMat=poly2.m_R;tX=normalLocal2X*tMat.col1.x+normalLocal2Y*tMat.col1.y;normalLocal2Y=normalLocal2X*tMat.col2.x+normalLocal2Y*tMat.col2.y;normalLocal2X=tX;var vertexIndex2=0;var minDot=Number.MAX_VALUE;for(var i=0;i<count2;++i)
+{var tVec=vert2s[i];var dot=tVec.x*normalLocal2X+tVec.y*normalLocal2Y;if(dot<minDot)
+{minDot=dot;vertexIndex2=i;}}
+tMat=poly1.m_R;var v1X=poly1.m_position.x+(tMat.col1.x*vert1s[edge1].x+tMat.col2.x*vert1s[edge1].y)
+var v1Y=poly1.m_position.y+(tMat.col1.y*vert1s[edge1].x+tMat.col2.y*vert1s[edge1].y)
+tMat=poly2.m_R;var v2X=poly2.m_position.x+(tMat.col1.x*vert2s[vertexIndex2].x+tMat.col2.x*vert2s[vertexIndex2].y)
+var v2Y=poly2.m_position.y+(tMat.col1.y*vert2s[vertexIndex2].x+tMat.col2.y*vert2s[vertexIndex2].y)
+v2X-=v1X;v2Y-=v1Y;var separation=v2X*normalX+v2Y*normalY;return separation;};b2Collision.FindMaxSeparation=function(edgeIndex,poly1,poly2,conservative)
+{var count1=poly1.m_vertexCount;var dX=poly2.m_position.x-poly1.m_position.x;var dY=poly2.m_position.y-poly1.m_position.y;var dLocal1X=(dX*poly1.m_R.col1.x+dY*poly1.m_R.col1.y);var dLocal1Y=(dX*poly1.m_R.col2.x+dY*poly1.m_R.col2.y);var edge=0;var maxDot=-Number.MAX_VALUE;for(var i=0;i<count1;++i)
+{var dot=(poly1.m_normals[i].x*dLocal1X+poly1.m_normals[i].y*dLocal1Y);if(dot>maxDot)
+{maxDot=dot;edge=i;}}
+var s=b2Collision.EdgeSeparation(poly1,edge,poly2);if(s>0.0&&conservative==false)
+{return s;}
+var prevEdge=edge-1>=0?edge-1:count1-1;var sPrev=b2Collision.EdgeSeparation(poly1,prevEdge,poly2);if(sPrev>0.0&&conservative==false)
+{return sPrev;}
+var nextEdge=edge+1<count1?edge+1:0;var sNext=b2Collision.EdgeSeparation(poly1,nextEdge,poly2);if(sNext>0.0&&conservative==false)
+{return sNext;}
+var bestEdge=0;var bestSeparation;var increment=0;if(sPrev>s&&sPrev>sNext)
+{increment=-1;bestEdge=prevEdge;bestSeparation=sPrev;}
+else if(sNext>s)
+{increment=1;bestEdge=nextEdge;bestSeparation=sNext;}
+else
+{edgeIndex[0]=edge;return s;}
+while(true)
+{if(increment==-1)
+edge=bestEdge-1>=0?bestEdge-1:count1-1;else
+edge=bestEdge+1<count1?bestEdge+1:0;s=b2Collision.EdgeSeparation(poly1,edge,poly2);if(s>0.0&&conservative==false)
+{return s;}
+if(s>bestSeparation)
+{bestEdge=edge;bestSeparation=s;}
+else
+{break;}}
+edgeIndex[0]=bestEdge;return bestSeparation;};b2Collision.FindIncidentEdge=function(c,poly1,edge1,poly2)
+{var count1=poly1.m_vertexCount;var vert1s=poly1.m_vertices;var count2=poly2.m_vertexCount;var vert2s=poly2.m_vertices;var vertex11=edge1;var vertex12=edge1+1==count1?0:edge1+1;var tVec=vert1s[vertex12];var normal1Local1X=tVec.x;var normal1Local1Y=tVec.y;tVec=vert1s[vertex11];normal1Local1X-=tVec.x;normal1Local1Y-=tVec.y;var tX=normal1Local1X;normal1Local1X=normal1Local1Y;normal1Local1Y=-tX;var invLength=1.0/Math.sqrt(normal1Local1X*normal1Local1X+normal1Local1Y*normal1Local1Y);normal1Local1X*=invLength;normal1Local1Y*=invLength;var normal1X=normal1Local1X;var normal1Y=normal1Local1Y;tX=normal1X;var tMat=poly1.m_R;normal1X=tMat.col1.x*tX+tMat.col2.x*normal1Y;normal1Y=tMat.col1.y*tX+tMat.col2.y*normal1Y;var normal1Local2X=normal1X;var normal1Local2Y=normal1Y;tMat=poly2.m_R;tX=normal1Local2X*tMat.col1.x+normal1Local2Y*tMat.col1.y;normal1Local2Y=normal1Local2X*tMat.col2.x+normal1Local2Y*tMat.col2.y;normal1Local2X=tX;var vertex21=0;var vertex22=0;var minDot=Number.MAX_VALUE;for(var i=0;i<count2;++i)
+{var i1=i;var i2=i+1<count2?i+1:0;tVec=vert2s[i2];var normal2Local2X=tVec.x;var normal2Local2Y=tVec.y;tVec=vert2s[i1];normal2Local2X-=tVec.x;normal2Local2Y-=tVec.y;tX=normal2Local2X;normal2Local2X=normal2Local2Y;normal2Local2Y=-tX;invLength=1.0/Math.sqrt(normal2Local2X*normal2Local2X+normal2Local2Y*normal2Local2Y);normal2Local2X*=invLength;normal2Local2Y*=invLength;var dot=normal2Local2X*normal1Local2X+normal2Local2Y*normal1Local2Y;if(dot<minDot)
+{minDot=dot;vertex21=i1;vertex22=i2;}}
+var tClip;tClip=c[0];tVec=tClip.v;tVec.SetV(vert2s[vertex21]);tVec.MulM(poly2.m_R);tVec.Add(poly2.m_position);tClip.id.features.referenceFace=edge1;tClip.id.features.incidentEdge=vertex21;tClip.id.features.incidentVertex=vertex21;tClip=c[1];tVec=tClip.v;tVec.SetV(vert2s[vertex22]);tVec.MulM(poly2.m_R);tVec.Add(poly2.m_position);tClip.id.features.referenceFace=edge1;tClip.id.features.incidentEdge=vertex21;tClip.id.features.incidentVertex=vertex22;};b2Collision.b2CollidePolyTempVec=new b2Vec2();b2Collision.b2CollidePoly=function(manifold,polyA,polyB,conservative)
+{manifold.pointCount=0;var edgeA=0;var edgeAOut=[edgeA];var separationA=b2Collision.FindMaxSeparation(edgeAOut,polyA,polyB,conservative);edgeA=edgeAOut[0];if(separationA>0.0&&conservative==false)
+return;var edgeB=0;var edgeBOut=[edgeB];var separationB=b2Collision.FindMaxSeparation(edgeBOut,polyB,polyA,conservative);edgeB=edgeBOut[0];if(separationB>0.0&&conservative==false)
+return;var poly1;var poly2;var edge1=0;var flip=0;var k_relativeTol=0.98;var k_absoluteTol=0.001;if(separationB>k_relativeTol*separationA+k_absoluteTol)
+{poly1=polyB;poly2=polyA;edge1=edgeB;flip=1;}
+else
+{poly1=polyA;poly2=polyB;edge1=edgeA;flip=0;}
+var incidentEdge=[new ClipVertex(),new ClipVertex()];b2Collision.FindIncidentEdge(incidentEdge,poly1,edge1,poly2);var count1=poly1.m_vertexCount;var vert1s=poly1.m_vertices;var v11=vert1s[edge1];var v12=edge1+1<count1?vert1s[edge1+1]:vert1s[0];var dvX=v12.x-v11.x;var dvY=v12.y-v11.y;var sideNormalX=v12.x-v11.x;var sideNormalY=v12.y-v11.y;var tX=sideNormalX;var tMat=poly1.m_R;sideNormalX=tMat.col1.x*tX+tMat.col2.x*sideNormalY;sideNormalY=tMat.col1.y*tX+tMat.col2.y*sideNormalY;var invLength=1.0/Math.sqrt(sideNormalX*sideNormalX+sideNormalY*sideNormalY);sideNormalX*=invLength;sideNormalY*=invLength;var frontNormalX=sideNormalX;var frontNormalY=sideNormalY;tX=frontNormalX;frontNormalX=frontNormalY;frontNormalY=-tX;var v11X=v11.x;var v11Y=v11.y;tX=v11X;tMat=poly1.m_R;v11X=tMat.col1.x*tX+tMat.col2.x*v11Y;v11Y=tMat.col1.y*tX+tMat.col2.y*v11Y;v11X+=poly1.m_position.x;v11Y+=poly1.m_position.y;var v12X=v12.x;var v12Y=v12.y;tX=v12X;tMat=poly1.m_R;v12X=tMat.col1.x*tX+tMat.col2.x*v12Y;v12Y=tMat.col1.y*tX+tMat.col2.y*v12Y;v12X+=poly1.m_position.x;v12Y+=poly1.m_position.y;var frontOffset=frontNormalX*v11X+frontNormalY*v11Y;var sideOffset1=-(sideNormalX*v11X+sideNormalY*v11Y);var sideOffset2=sideNormalX*v12X+sideNormalY*v12Y;var clipPoints1=[new ClipVertex(),new ClipVertex()];var clipPoints2=[new ClipVertex(),new ClipVertex()];var np=0;b2Collision.b2CollidePolyTempVec.Set(-sideNormalX,-sideNormalY);np=b2Collision.ClipSegmentToLine(clipPoints1,incidentEdge,b2Collision.b2CollidePolyTempVec,sideOffset1);if(np<2)
+return;b2Collision.b2CollidePolyTempVec.Set(sideNormalX,sideNormalY);np=b2Collision.ClipSegmentToLine(clipPoints2,clipPoints1,b2Collision.b2CollidePolyTempVec,sideOffset2);if(np<2)
+return;if(flip){manifold.normal.Set(-frontNormalX,-frontNormalY);}
+else{manifold.normal.Set(frontNormalX,frontNormalY);}
+var pointCount=0;for(var i=0;i<b2Settings.b2_maxManifoldPoints;++i)
+{var tVec=clipPoints2[i].v;var separation=(frontNormalX*tVec.x+frontNormalY*tVec.y)-frontOffset;if(separation<=0.0||conservative==true)
+{var cp=manifold.points[pointCount];cp.separation=separation;cp.position.SetV(clipPoints2[i].v);cp.id.Set(clipPoints2[i].id);cp.id.features.flip=flip;++pointCount;}}
+manifold.pointCount=pointCount;};b2Collision.b2CollideCircle=function(manifold,circle1,circle2,conservative)
+{manifold.pointCount=0;var dX=circle2.m_position.x-circle1.m_position.x;var dY=circle2.m_position.y-circle1.m_position.y;var distSqr=dX*dX+dY*dY;var radiusSum=circle1.m_radius+circle2.m_radius;if(distSqr>radiusSum*radiusSum&&conservative==false)
+{return;}
+var separation;if(distSqr<Number.MIN_VALUE)
+{separation=-radiusSum;manifold.normal.Set(0.0,1.0);}
+else
+{var dist=Math.sqrt(distSqr);separation=dist-radiusSum;var a=1.0/dist;manifold.normal.x=a*dX;manifold.normal.y=a*dY;}
+manifold.pointCount=1;var tPoint=manifold.points[0];tPoint.id.set_key(0);tPoint.separation=separation;tPoint.position.x=circle2.m_position.x-(circle2.m_radius*manifold.normal.x);tPoint.position.y=circle2.m_position.y-(circle2.m_radius*manifold.normal.y);};b2Collision.b2CollidePolyAndCircle=function(manifold,poly,circle,conservative)
+{manifold.pointCount=0;var tPoint;var dX;var dY;var xLocalX=circle.m_position.x-poly.m_position.x;var xLocalY=circle.m_position.y-poly.m_position.y;var tMat=poly.m_R;var tX=xLocalX*tMat.col1.x+xLocalY*tMat.col1.y;xLocalY=xLocalX*tMat.col2.x+xLocalY*tMat.col2.y;xLocalX=tX;var dist;var normalIndex=0;var separation=-Number.MAX_VALUE;var radius=circle.m_radius;for(var i=0;i<poly.m_vertexCount;++i)
+{var s=poly.m_normals[i].x*(xLocalX-poly.m_vertices[i].x)+poly.m_normals[i].y*(xLocalY-poly.m_vertices[i].y);if(s>radius)
+{return;}
+if(s>separation)
+{separation=s;normalIndex=i;}}
+if(separation<Number.MIN_VALUE)
+{manifold.pointCount=1;var tVec=poly.m_normals[normalIndex];manifold.normal.x=tMat.col1.x*tVec.x+tMat.col2.x*tVec.y;manifold.normal.y=tMat.col1.y*tVec.x+tMat.col2.y*tVec.y;tPoint=manifold.points[0];tPoint.id.features.incidentEdge=normalIndex;tPoint.id.features.incidentVertex=b2Collision.b2_nullFeature;tPoint.id.features.referenceFace=b2Collision.b2_nullFeature;tPoint.id.features.flip=0;tPoint.position.x=circle.m_position.x-radius*manifold.normal.x;tPoint.position.y=circle.m_position.y-radius*manifold.normal.y;tPoint.separation=separation-radius;return;}
+var vertIndex1=normalIndex;var vertIndex2=vertIndex1+1<poly.m_vertexCount?vertIndex1+1:0;var eX=poly.m_vertices[vertIndex2].x-poly.m_vertices[vertIndex1].x;var eY=poly.m_vertices[vertIndex2].y-poly.m_vertices[vertIndex1].y;var length=Math.sqrt(eX*eX+eY*eY);eX/=length;eY/=length;if(length<Number.MIN_VALUE)
+{dX=xLocalX-poly.m_vertices[vertIndex1].x;dY=xLocalY-poly.m_vertices[vertIndex1].y;dist=Math.sqrt(dX*dX+dY*dY);dX/=dist;dY/=dist;if(dist>radius)
+{return;}
+manifold.pointCount=1;manifold.normal.Set(tMat.col1.x*dX+tMat.col2.x*dY,tMat.col1.y*dX+tMat.col2.y*dY);tPoint=manifold.points[0];tPoint.id.features.incidentEdge=b2Collision.b2_nullFeature;tPoint.id.features.incidentVertex=vertIndex1;tPoint.id.features.referenceFace=b2Collision.b2_nullFeature;tPoint.id.features.flip=0;tPoint.position.x=circle.m_position.x-radius*manifold.normal.x;tPoint.position.y=circle.m_position.y-radius*manifold.normal.y;tPoint.separation=dist-radius;return;}
+var u=(xLocalX-poly.m_vertices[vertIndex1].x)*eX+(xLocalY-poly.m_vertices[vertIndex1].y)*eY;tPoint=manifold.points[0];tPoint.id.features.incidentEdge=b2Collision.b2_nullFeature;tPoint.id.features.incidentVertex=b2Collision.b2_nullFeature;tPoint.id.features.referenceFace=b2Collision.b2_nullFeature;tPoint.id.features.flip=0;var pX,pY;if(u<=0.0)
+{pX=poly.m_vertices[vertIndex1].x;pY=poly.m_vertices[vertIndex1].y;tPoint.id.features.incidentVertex=vertIndex1;}
+else if(u>=length)
+{pX=poly.m_vertices[vertIndex2].x;pY=poly.m_vertices[vertIndex2].y;tPoint.id.features.incidentVertex=vertIndex2;}
+else
+{pX=eX*u+poly.m_vertices[vertIndex1].x;pY=eY*u+poly.m_vertices[vertIndex1].y;tPoint.id.features.incidentEdge=vertIndex1;}
+dX=xLocalX-pX;dY=xLocalY-pY;dist=Math.sqrt(dX*dX+dY*dY);dX/=dist;dY/=dist;if(dist>radius)
+{return;}
+manifold.pointCount=1;manifold.normal.Set(tMat.col1.x*dX+tMat.col2.x*dY,tMat.col1.y*dX+tMat.col2.y*dY);tPoint.position.x=circle.m_position.x-radius*manifold.normal.x;tPoint.position.y=circle.m_position.y-radius*manifold.normal.y;tPoint.separation=dist-radius;};b2Collision.b2TestOverlap=function(a,b)
+{var t1=b.minVertex;var t2=a.maxVertex;var d1X=t1.x-t2.x;var d1Y=t1.y-t2.y;t1=a.minVertex;t2=b.maxVertex;var d2X=t1.x-t2.x;var d2Y=t1.y-t2.y;if(d1X>0.0||d1Y>0.0)
+return false;if(d2X>0.0||d2Y>0.0)
+return false;return true;};
+var Features=Class.create();Features.prototype={set_referenceFace:function(value){this._referenceFace=value;this._m_id._key=(this._m_id._key&0xffffff00)|(this._referenceFace&0x000000ff)},get_referenceFace:function(){return this._referenceFace;},_referenceFace:0,set_incidentEdge:function(value){this._incidentEdge=value;this._m_id._key=(this._m_id._key&0xffff00ff)|((this._incidentEdge<<8)&0x0000ff00)},get_incidentEdge:function(){return this._incidentEdge;},_incidentEdge:0,set_incidentVertex:function(value){this._incidentVertex=value;this._m_id._key=(this._m_id._key&0xff00ffff)|((this._incidentVertex<<16)&0x00ff0000)},get_incidentVertex:function(){return this._incidentVertex;},_incidentVertex:0,set_flip:function(value){this._flip=value;this._m_id._key=(this._m_id._key&0x00ffffff)|((this._flip<<24)&0xff000000)},get_flip:function(){return this._flip;},_flip:0,_m_id:null,initialize:function(){}};
+var b2ContactID=Class.create();b2ContactID.prototype={initialize:function(){this.features=new Features();this.features._m_id=this;},Set:function(id){this.set_key(id._key);},Copy:function(){var id=new b2ContactID();id.set_key(this._key);return id;},get_key:function(){return this._key;},set_key:function(value){this._key=value;this.features._referenceFace=this._key&0x000000ff;this.features._incidentEdge=((this._key&0x0000ff00)>>8)&0x000000ff;this.features._incidentVertex=((this._key&0x00ff0000)>>16)&0x000000ff;this.features._flip=((this._key&0xff000000)>>24)&0x000000ff;},features:new Features(),_key:0};
+var b2ContactPoint=Class.create();b2ContactPoint.prototype={position:new b2Vec2(),separation:null,normalImpulse:null,tangentImpulse:null,id:new b2ContactID(),initialize:function(){this.position=new b2Vec2();this.id=new b2ContactID();}};var b2Distance=Class.create();b2Distance.prototype={initialize:function(){}};b2Distance.ProcessTwo=function(p1Out,p2Out,p1s,p2s,points)
+{var rX=-points[1].x;var rY=-points[1].y;var dX=points[0].x-points[1].x;var dY=points[0].y-points[1].y;var length=Math.sqrt(dX*dX+dY*dY);dX/=length;dY/=length;var lambda=rX*dX+rY*dY;if(lambda<=0.0||length<Number.MIN_VALUE)
+{p1Out.SetV(p1s[1]);p2Out.SetV(p2s[1]);p1s[0].SetV(p1s[1]);p2s[0].SetV(p2s[1]);points[0].SetV(points[1]);return 1;}
+lambda/=length;p1Out.x=p1s[1].x+lambda*(p1s[0].x-p1s[1].x);p1Out.y=p1s[1].y+lambda*(p1s[0].y-p1s[1].y);p2Out.x=p2s[1].x+lambda*(p2s[0].x-p2s[1].x);p2Out.y=p2s[1].y+lambda*(p2s[0].y-p2s[1].y);return 2;};b2Distance.ProcessThree=function(p1Out,p2Out,p1s,p2s,points)
+{var aX=points[0].x;var aY=points[0].y;var bX=points[1].x;var bY=points[1].y;var cX=points[2].x;var cY=points[2].y;var abX=bX-aX;var abY=bY-aY;var acX=cX-aX;var acY=cY-aY;var bcX=cX-bX;var bcY=cY-bY;var sn=-(aX*abX+aY*abY);var sd=(bX*abX+bY*abY);var tn=-(aX*acX+aY*acY);var td=(cX*acX+cY*acY);var un=-(bX*bcX+bY*bcY);var ud=(cX*bcX+cY*bcY);if(td<=0.0&&ud<=0.0)
+{p1Out.SetV(p1s[2]);p2Out.SetV(p2s[2]);p1s[0].SetV(p1s[2]);p2s[0].SetV(p2s[2]);points[0].SetV(points[2]);return 1;}
+var n=abX*acY-abY*acX;var vc=n*(aX*bY-aY*bX);var va=n*(bX*cY-bY*cX);if(va<=0.0&&un>=0.0&&ud>=0.0)
+{var lambda=un/(un+ud);p1Out.x=p1s[1].x+lambda*(p1s[2].x-p1s[1].x);p1Out.y=p1s[1].y+lambda*(p1s[2].y-p1s[1].y);p2Out.x=p2s[1].x+lambda*(p2s[2].x-p2s[1].x);p2Out.y=p2s[1].y+lambda*(p2s[2].y-p2s[1].y);p1s[0].SetV(p1s[2]);p2s[0].SetV(p2s[2]);points[0].SetV(points[2]);return 2;}
+var vb=n*(cX*aY-cY*aX);if(vb<=0.0&&tn>=0.0&&td>=0.0)
+{var lambda=tn/(tn+td);p1Out.x=p1s[0].x+lambda*(p1s[2].x-p1s[0].x);p1Out.y=p1s[0].y+lambda*(p1s[2].y-p1s[0].y);p2Out.x=p2s[0].x+lambda*(p2s[2].x-p2s[0].x);p2Out.y=p2s[0].y+lambda*(p2s[2].y-p2s[0].y);p1s[1].SetV(p1s[2]);p2s[1].SetV(p2s[2]);points[1].SetV(points[2]);return 2;}
+var denom=va+vb+vc;denom=1.0/denom;var u=va*denom;var v=vb*denom;var w=1.0-u-v;p1Out.x=u*p1s[0].x+v*p1s[1].x+w*p1s[2].x;p1Out.y=u*p1s[0].y+v*p1s[1].y+w*p1s[2].y;p2Out.x=u*p2s[0].x+v*p2s[1].x+w*p2s[2].x;p2Out.y=u*p2s[0].y+v*p2s[1].y+w*p2s[2].y;return 3;};b2Distance.InPoinsts=function(w,points,pointCount)
+{for(var i=0;i<pointCount;++i)
+{if(w.x==points[i].x&&w.y==points[i].y)
+{return true;}}
+return false;};b2Distance.Distance=function(p1Out,p2Out,shape1,shape2)
+{var p1s=new Array(3);var p2s=new Array(3);var points=new Array(3);var pointCount=0;p1Out.SetV(shape1.m_position);p2Out.SetV(shape2.m_position);var vSqr=0.0;var maxIterations=20;for(var iter=0;iter<maxIterations;++iter)
+{var vX=p2Out.x-p1Out.x;var vY=p2Out.y-p1Out.y;var w1=shape1.Support(vX,vY);var w2=shape2.Support(-vX,-vY);vSqr=(vX*vX+vY*vY);var wX=w2.x-w1.x;var wY=w2.y-w1.y;var vw=(vX*wX+vY*wY);if(vSqr-b2Dot(vX*wX+vY*wY)<=0.01*vSqr)
+{if(pointCount==0)
+{p1Out.SetV(w1);p2Out.SetV(w2);}
+b2Distance.g_GJK_Iterations=iter;return Math.sqrt(vSqr);}
+switch(pointCount)
+{case 0:p1s[0].SetV(w1);p2s[0].SetV(w2);points[0]=w;p1Out.SetV(p1s[0]);p2Out.SetV(p2s[0]);++pointCount;break;case 1:p1s[1].SetV(w1);p2s[1].SetV(w2);points[1].x=wX;points[1].y=wY;pointCount=b2Distance.ProcessTwo(p1Out,p2Out,p1s,p2s,points);break;case 2:p1s[2].SetV(w1);p2s[2].SetV(w2);points[2].x=wX;points[2].y=wY;pointCount=b2Distance.ProcessThree(p1Out,p2Out,p1s,p2s,points);break;}
+if(pointCount==3)
+{b2Distance.g_GJK_Iterations=iter;return 0.0;}
+var maxSqr=-Number.MAX_VALUE;for(var i=0;i<pointCount;++i)
+{maxSqr=b2Math.b2Max(maxSqr,(points[i].x*points[i].x+points[i].y*points[i].y));}
+if(pointCount==3||vSqr<=100.0*Number.MIN_VALUE*maxSqr)
+{b2Distance.g_GJK_Iterations=iter;return Math.sqrt(vSqr);}}
+b2Distance.g_GJK_Iterations=maxIterations;return Math.sqrt(vSqr);};b2Distance.g_GJK_Iterations=0;
+var b2Manifold=Class.create();b2Manifold.prototype={initialize:function(){this.points=new Array(b2Settings.b2_maxManifoldPoints);for(var i=0;i<b2Settings.b2_maxManifoldPoints;i++){this.points[i]=new b2ContactPoint();}
+this.normal=new b2Vec2();},points:null,normal:null,pointCount:0};
+var b2OBB=Class.create();b2OBB.prototype={R:new b2Mat22(),center:new b2Vec2(),extents:new b2Vec2(),initialize:function(){this.R=new b2Mat22();this.center=new b2Vec2();this.extents=new b2Vec2();}};
+var b2Proxy=Class.create();b2Proxy.prototype={GetNext:function(){return this.lowerBounds[0];},SetNext:function(next){this.lowerBounds[0]=next;},IsValid:function(){return this.overlapCount!=b2BroadPhase.b2_invalid;},lowerBounds:[(0),(0)],upperBounds:[(0),(0)],overlapCount:0,timeStamp:0,userData:null,initialize:function(){this.lowerBounds=[(0),(0)];this.upperBounds=[(0),(0)];}}
+
+var ClipVertex=Class.create();ClipVertex.prototype={v:new b2Vec2(),id:new b2ContactID(),initialize:function(){this.v=new b2Vec2();this.id=new b2ContactID();}};var b2Shape=Class.create();b2Shape.prototype={TestPoint:function(p){return false},GetUserData:function(){return this.m_userData;},GetType:function(){return this.m_type;},GetBody:function(){return this.m_body;},GetPosition:function(){return this.m_position;},GetRotationMatrix:function(){return this.m_R;},ResetProxy:function(broadPhase){},GetNext:function(){return this.m_next;},initialize:function(def,body){this.m_R=new b2Mat22();this.m_position=new b2Vec2();this.m_userData=def.userData;this.m_friction=def.friction;this.m_restitution=def.restitution;this.m_body=body;this.m_proxyId=b2Pair.b2_nullProxy;this.m_maxRadius=0.0;this.m_categoryBits=def.categoryBits;this.m_maskBits=def.maskBits;this.m_groupIndex=def.groupIndex;},DestroyProxy:function()
+{if(this.m_proxyId!=b2Pair.b2_nullProxy)
+{this.m_body.m_world.m_broadPhase.DestroyProxy(this.m_proxyId);this.m_proxyId=b2Pair.b2_nullProxy;}},Synchronize:function(position1,R1,position2,R2){},QuickSync:function(position,R){},Support:function(dX,dY,out){},GetMaxRadius:function(){return this.m_maxRadius;},m_next:null,m_R:new b2Mat22(),m_position:new b2Vec2(),m_type:0,m_userData:null,m_body:null,m_friction:null,m_restitution:null,m_maxRadius:null,m_proxyId:0,m_categoryBits:0,m_maskBits:0,m_groupIndex:0};b2Shape.Create=function(def,body,center){switch(def.type)
+{case b2Shape.e_circleShape:{return new b2CircleShape(def,body,center);}
+case b2Shape.e_boxShape:case b2Shape.e_polyShape:{return new b2PolyShape(def,body,center);}}
+return null;};b2Shape.Destroy=function(shape)
+{if(shape.m_proxyId!=b2Pair.b2_nullProxy)
+shape.m_body.m_world.m_broadPhase.DestroyProxy(shape.m_proxyId);};b2Shape.e_unknownShape=-1;b2Shape.e_circleShape=0;b2Shape.e_boxShape=1;b2Shape.e_polyShape=2;b2Shape.e_meshShape=3;b2Shape.e_shapeTypeCount=4;b2Shape.PolyMass=function(massData,vs,count,rho)
+{var center=new b2Vec2();center.SetZero();var area=0.0;var I=0.0;var pRef=new b2Vec2(0.0,0.0);var inv3=1.0/3.0;for(var i=0;i<count;++i)
+{var p1=pRef;var p2=vs[i];var p3=i+1<count?vs[i+1]:vs[0];var e1=b2Math.SubtractVV(p2,p1);var e2=b2Math.SubtractVV(p3,p1);var D=b2Math.b2CrossVV(e1,e2);var triangleArea=0.5*D;area+=triangleArea;var tVec=new b2Vec2();tVec.SetV(p1);tVec.Add(p2);tVec.Add(p3);tVec.Multiply(inv3*triangleArea);center.Add(tVec);var px=p1.x;var py=p1.y;var ex1=e1.x;var ey1=e1.y;var ex2=e2.x;var ey2=e2.y;var intx2=inv3*(0.25*(ex1*ex1+ex2*ex1+ex2*ex2)+(px*ex1+px*ex2))+0.5*px*px;var inty2=inv3*(0.25*(ey1*ey1+ey2*ey1+ey2*ey2)+(py*ey1+py*ey2))+0.5*py*py;I+=D*(intx2+inty2);}
+massData.mass=rho*area;center.Multiply(1.0/area);massData.center=center;I=rho*(I-area*b2Math.b2Dot(center,center));massData.I=I;};b2Shape.PolyCentroid=function(vs,count,out)
+{var cX=0.0;var cY=0.0;var area=0.0;var pRefX=0.0;var pRefY=0.0;var inv3=1.0/3.0;for(var i=0;i<count;++i)
+{var p1X=pRefX;var p1Y=pRefY;var p2X=vs[i].x;var p2Y=vs[i].y;var p3X=i+1<count?vs[i+1].x:vs[0].x;var p3Y=i+1<count?vs[i+1].y:vs[0].y;var e1X=p2X-p1X;var e1Y=p2Y-p1Y;var e2X=p3X-p1X;var e2Y=p3Y-p1Y;var D=(e1X*e2Y-e1Y*e2X);var triangleArea=0.5*D;area+=triangleArea;cX+=triangleArea*inv3*(p1X+p2X+p3X);cY+=triangleArea*inv3*(p1Y+p2Y+p3Y);}
+cX*=1.0/area;cY*=1.0/area;out.Set(cX,cY);};
+var b2ShapeDef=Class.create();b2ShapeDef.prototype={initialize:function()
+{this.type=b2Shape.e_unknownShape;this.userData=null;this.localPosition=new b2Vec2(0.0,0.0);this.localRotation=0.0;this.friction=0.2;this.restitution=0.0;this.density=0.0;this.categoryBits=0x0001;this.maskBits=0xFFFF;this.groupIndex=0;},ComputeMass:function(massData)
+{massData.center=new b2Vec2(0.0,0.0)
+if(this.density==0.0)
+{massData.mass=0.0;massData.center.Set(0.0,0.0);massData.I=0.0;};switch(this.type)
+{case b2Shape.e_circleShape:{var circle=this;massData.mass=this.density*b2Settings.b2_pi*circle.radius*circle.radius;massData.center.Set(0.0,0.0);massData.I=0.5*(massData.mass)*circle.radius*circle.radius;}
+break;case b2Shape.e_boxShape:{var box=this;massData.mass=4.0*this.density*box.extents.x*box.extents.y;massData.center.Set(0.0,0.0);massData.I=massData.mass/3.0*b2Math.b2Dot(box.extents,box.extents);}
+break;case b2Shape.e_polyShape:{var poly=this;b2Shape.PolyMass(massData,poly.vertices,poly.vertexCount,this.density);}
+break;default:massData.mass=0.0;massData.center.Set(0.0,0.0);massData.I=0.0;break;}},type:0,userData:null,localPosition:null,localRotation:null,friction:null,restitution:null,density:null,categoryBits:0,maskBits:0,groupIndex:0};
+var b2BoxDef=Class.create();Object.extend(b2BoxDef.prototype,b2ShapeDef.prototype);Object.extend(b2BoxDef.prototype,{initialize:function()
+{this.type=b2Shape.e_unknownShape;this.userData=null;this.localPosition=new b2Vec2(0.0,0.0);this.localRotation=0.0;this.friction=0.2;this.restitution=0.0;this.density=0.0;this.categoryBits=0x0001;this.maskBits=0xFFFF;this.groupIndex=0;this.type=b2Shape.e_boxShape;this.extents=new b2Vec2(1.0,1.0);},extents:null});
+var b2CircleDef=Class.create();Object.extend(b2CircleDef.prototype,b2ShapeDef.prototype);Object.extend(b2CircleDef.prototype,{initialize:function()
+{this.type=b2Shape.e_unknownShape;this.userData=null;this.localPosition=new b2Vec2(0.0,0.0);this.localRotation=0.0;this.friction=0.2;this.restitution=0.0;this.density=0.0;this.categoryBits=0x0001;this.maskBits=0xFFFF;this.groupIndex=0;this.type=b2Shape.e_circleShape;this.radius=1.0;},radius:null});var b2CircleShape=Class.create();Object.extend(b2CircleShape.prototype,b2Shape.prototype);Object.extend(b2CircleShape.prototype,{TestPoint:function(p){var d=new b2Vec2();d.SetV(p);d.Subtract(this.m_position);return b2Math.b2Dot(d,d)<=this.m_radius*this.m_radius;},initialize:function(def,body,localCenter){this.m_R=new b2Mat22();this.m_position=new b2Vec2();this.m_userData=def.userData;this.m_friction=def.friction;this.m_restitution=def.restitution;this.m_body=body;this.m_proxyId=b2Pair.b2_nullProxy;this.m_maxRadius=0.0;this.m_categoryBits=def.categoryBits;this.m_maskBits=def.maskBits;this.m_groupIndex=def.groupIndex;this.m_localPosition=new b2Vec2();var circle=def;this.m_localPosition.Set(def.localPosition.x-localCenter.x,def.localPosition.y-localCenter.y);this.m_type=b2Shape.e_circleShape;this.m_radius=circle.radius;this.m_R.SetM(this.m_body.m_R);var rX=this.m_R.col1.x*this.m_localPosition.x+this.m_R.col2.x*this.m_localPosition.y;var rY=this.m_R.col1.y*this.m_localPosition.x+this.m_R.col2.y*this.m_localPosition.y;this.m_position.x=this.m_body.m_position.x+rX;this.m_position.y=this.m_body.m_position.y+rY;this.m_maxRadius=Math.sqrt(rX*rX+rY*rY)+this.m_radius;var aabb=new b2AABB();aabb.minVertex.Set(this.m_position.x-this.m_radius,this.m_position.y-this.m_radius);aabb.maxVertex.Set(this.m_position.x+this.m_radius,this.m_position.y+this.m_radius);var broadPhase=this.m_body.m_world.m_broadPhase;if(broadPhase.InRange(aabb))
+{this.m_proxyId=broadPhase.CreateProxy(aabb,this);}
+else
+{this.m_proxyId=b2Pair.b2_nullProxy;}
+if(this.m_proxyId==b2Pair.b2_nullProxy)
+{this.m_body.Freeze();}},Synchronize:function(position1,R1,position2,R2){this.m_R.SetM(R2);this.m_position.x=(R2.col1.x*this.m_localPosition.x+R2.col2.x*this.m_localPosition.y)+position2.x;this.m_position.y=(R2.col1.y*this.m_localPosition.x+R2.col2.y*this.m_localPosition.y)+position2.y;if(this.m_proxyId==b2Pair.b2_nullProxy)
+{return;}
+var p1X=position1.x+(R1.col1.x*this.m_localPosition.x+R1.col2.x*this.m_localPosition.y);var p1Y=position1.y+(R1.col1.y*this.m_localPosition.x+R1.col2.y*this.m_localPosition.y);var lowerX=Math.min(p1X,this.m_position.x);var lowerY=Math.min(p1Y,this.m_position.y);var upperX=Math.max(p1X,this.m_position.x);var upperY=Math.max(p1Y,this.m_position.y);var aabb=new b2AABB();aabb.minVertex.Set(lowerX-this.m_radius,lowerY-this.m_radius);aabb.maxVertex.Set(upperX+this.m_radius,upperY+this.m_radius);var broadPhase=this.m_body.m_world.m_broadPhase;if(broadPhase.InRange(aabb))
+{broadPhase.MoveProxy(this.m_proxyId,aabb);}
+else
+{this.m_body.Freeze();}},QuickSync:function(position,R){this.m_R.SetM(R);this.m_position.x=(R.col1.x*this.m_localPosition.x+R.col2.x*this.m_localPosition.y)+position.x;this.m_position.y=(R.col1.y*this.m_localPosition.x+R.col2.y*this.m_localPosition.y)+position.y;},ResetProxy:function(broadPhase)
+{if(this.m_proxyId==b2Pair.b2_nullProxy)
+{return;}
+var proxy=broadPhase.GetProxy(this.m_proxyId);broadPhase.DestroyProxy(this.m_proxyId);proxy=null;var aabb=new b2AABB();aabb.minVertex.Set(this.m_position.x-this.m_radius,this.m_position.y-this.m_radius);aabb.maxVertex.Set(this.m_position.x+this.m_radius,this.m_position.y+this.m_radius);if(broadPhase.InRange(aabb))
+{this.m_proxyId=broadPhase.CreateProxy(aabb,this);}
+else
+{this.m_proxyId=b2Pair.b2_nullProxy;}
+if(this.m_proxyId==b2Pair.b2_nullProxy)
+{this.m_body.Freeze();}},Support:function(dX,dY,out)
+{var len=Math.sqrt(dX*dX+dY*dY);dX/=len;dY/=len;out.Set(this.m_position.x+this.m_radius*dX,this.m_position.y+this.m_radius*dY);},m_localPosition:new b2Vec2(),m_radius:null});
+var b2MassData=Class.create();b2MassData.prototype={mass:0.0,center:new b2Vec2(0,0),I:0.0,initialize:function(){this.center=new b2Vec2(0,0);}}
+
+var b2PolyDef=Class.create();Object.extend(b2PolyDef.prototype,b2ShapeDef.prototype);Object.extend(b2PolyDef.prototype,{initialize:function()
+{this.type=b2Shape.e_unknownShape;this.userData=null;this.localPosition=new b2Vec2(0.0,0.0);this.localRotation=0.0;this.friction=0.2;this.restitution=0.0;this.density=0.0;this.categoryBits=0x0001;this.maskBits=0xFFFF;this.groupIndex=0;this.vertices=new Array(b2Settings.b2_maxPolyVertices);this.type=b2Shape.e_polyShape;this.vertexCount=0;for(var i=0;i<b2Settings.b2_maxPolyVertices;i++){this.vertices[i]=new b2Vec2();}},vertices:new Array(b2Settings.b2_maxPolyVertices),vertexCount:0});var b2PolyShape=Class.create();Object.extend(b2PolyShape.prototype,b2Shape.prototype);Object.extend(b2PolyShape.prototype,{TestPoint:function(p){var pLocal=new b2Vec2();pLocal.SetV(p);pLocal.Subtract(this.m_position);pLocal.MulTM(this.m_R);for(var i=0;i<this.m_vertexCount;++i)
+{var tVec=new b2Vec2();tVec.SetV(pLocal);tVec.Subtract(this.m_vertices[i]);var dot=b2Math.b2Dot(this.m_normals[i],tVec);if(dot>0.0)
+{return false;}}
+return true;},initialize:function(def,body,newOrigin){this.m_R=new b2Mat22();this.m_position=new b2Vec2();this.m_userData=def.userData;this.m_friction=def.friction;this.m_restitution=def.restitution;this.m_body=body;this.m_proxyId=b2Pair.b2_nullProxy;this.m_maxRadius=0.0;this.m_categoryBits=def.categoryBits;this.m_maskBits=def.maskBits;this.m_groupIndex=def.groupIndex;this.syncAABB=new b2AABB();this.syncMat=new b2Mat22();this.m_localCentroid=new b2Vec2();this.m_localOBB=new b2OBB();var i=0;var hX;var hY;var tVec;var aabb=new b2AABB();this.m_vertices=new Array(b2Settings.b2_maxPolyVertices);this.m_coreVertices=new Array(b2Settings.b2_maxPolyVertices);this.m_normals=new Array(b2Settings.b2_maxPolyVertices);this.m_type=b2Shape.e_polyShape;var localR=new b2Mat22(def.localRotation);if(def.type==b2Shape.e_boxShape)
+{this.m_localCentroid.x=def.localPosition.x-newOrigin.x;this.m_localCentroid.y=def.localPosition.y-newOrigin.y;var box=def;this.m_vertexCount=4;hX=box.extents.x;hY=box.extents.y;var hcX=Math.max(0.0,hX-2.0*b2Settings.b2_linearSlop);var hcY=Math.max(0.0,hY-2.0*b2Settings.b2_linearSlop);tVec=this.m_vertices[0]=new b2Vec2();tVec.x=localR.col1.x*hX+localR.col2.x*hY;tVec.y=localR.col1.y*hX+localR.col2.y*hY;tVec=this.m_vertices[1]=new b2Vec2();tVec.x=localR.col1.x*-hX+localR.col2.x*hY;tVec.y=localR.col1.y*-hX+localR.col2.y*hY;tVec=this.m_vertices[2]=new b2Vec2();tVec.x=localR.col1.x*-hX+localR.col2.x*-hY;tVec.y=localR.col1.y*-hX+localR.col2.y*-hY;tVec=this.m_vertices[3]=new b2Vec2();tVec.x=localR.col1.x*hX+localR.col2.x*-hY;tVec.y=localR.col1.y*hX+localR.col2.y*-hY;tVec=this.m_coreVertices[0]=new b2Vec2();tVec.x=localR.col1.x*hcX+localR.col2.x*hcY;tVec.y=localR.col1.y*hcX+localR.col2.y*hcY;tVec=this.m_coreVertices[1]=new b2Vec2();tVec.x=localR.col1.x*-hcX+localR.col2.x*hcY;tVec.y=localR.col1.y*-hcX+localR.col2.y*hcY;tVec=this.m_coreVertices[2]=new b2Vec2();tVec.x=localR.col1.x*-hcX+localR.col2.x*-hcY;tVec.y=localR.col1.y*-hcX+localR.col2.y*-hcY;tVec=this.m_coreVertices[3]=new b2Vec2();tVec.x=localR.col1.x*hcX+localR.col2.x*-hcY;tVec.y=localR.col1.y*hcX+localR.col2.y*-hcY;}
+else
+{var poly=def;this.m_vertexCount=poly.vertexCount;b2Shape.PolyCentroid(poly.vertices,poly.vertexCount,b2PolyShape.tempVec);var centroidX=b2PolyShape.tempVec.x;var centroidY=b2PolyShape.tempVec.y;this.m_localCentroid.x=def.localPosition.x+(localR.col1.x*centroidX+localR.col2.x*centroidY)-newOrigin.x;this.m_localCentroid.y=def.localPosition.y+(localR.col1.y*centroidX+localR.col2.y*centroidY)-newOrigin.y;for(i=0;i<this.m_vertexCount;++i)
+{this.m_vertices[i]=new b2Vec2();this.m_coreVertices[i]=new b2Vec2();hX=poly.vertices[i].x-centroidX;hY=poly.vertices[i].y-centroidY;this.m_vertices[i].x=localR.col1.x*hX+localR.col2.x*hY;this.m_vertices[i].y=localR.col1.y*hX+localR.col2.y*hY;var uX=this.m_vertices[i].x;var uY=this.m_vertices[i].y;var length=Math.sqrt(uX*uX+uY*uY);if(length>Number.MIN_VALUE)
+{uX*=1.0/length;uY*=1.0/length;}
+this.m_coreVertices[i].x=this.m_vertices[i].x-2.0*b2Settings.b2_linearSlop*uX;this.m_coreVertices[i].y=this.m_vertices[i].y-2.0*b2Settings.b2_linearSlop*uY;}}
+var minVertexX=Number.MAX_VALUE;var minVertexY=Number.MAX_VALUE;var maxVertexX=-Number.MAX_VALUE;var maxVertexY=-Number.MAX_VALUE;this.m_maxRadius=0.0;for(i=0;i<this.m_vertexCount;++i)
+{var v=this.m_vertices[i];minVertexX=Math.min(minVertexX,v.x);minVertexY=Math.min(minVertexY,v.y);maxVertexX=Math.max(maxVertexX,v.x);maxVertexY=Math.max(maxVertexY,v.y);this.m_maxRadius=Math.max(this.m_maxRadius,v.Length());}
+this.m_localOBB.R.SetIdentity();this.m_localOBB.center.Set((minVertexX+maxVertexX)*0.5,(minVertexY+maxVertexY)*0.5);this.m_localOBB.extents.Set((maxVertexX-minVertexX)*0.5,(maxVertexY-minVertexY)*0.5);var i1=0;var i2=0;for(i=0;i<this.m_vertexCount;++i)
+{this.m_normals[i]=new b2Vec2();i1=i;i2=i+1<this.m_vertexCount?i+1:0;this.m_normals[i].x=this.m_vertices[i2].y-this.m_vertices[i1].y;this.m_normals[i].y=-(this.m_vertices[i2].x-this.m_vertices[i1].x);this.m_normals[i].Normalize();}
+for(i=0;i<this.m_vertexCount;++i)
+{i1=i;i2=i+1<this.m_vertexCount?i+1:0;}
+this.m_R.SetM(this.m_body.m_R);this.m_position.x=this.m_body.m_position.x+(this.m_R.col1.x*this.m_localCentroid.x+this.m_R.col2.x*this.m_localCentroid.y);this.m_position.y=this.m_body.m_position.y+(this.m_R.col1.y*this.m_localCentroid.x+this.m_R.col2.y*this.m_localCentroid.y);b2PolyShape.tAbsR.col1.x=this.m_R.col1.x*this.m_localOBB.R.col1.x+this.m_R.col2.x*this.m_localOBB.R.col1.y;b2PolyShape.tAbsR.col1.y=this.m_R.col1.y*this.m_localOBB.R.col1.x+this.m_R.col2.y*this.m_localOBB.R.col1.y;b2PolyShape.tAbsR.col2.x=this.m_R.col1.x*this.m_localOBB.R.col2.x+this.m_R.col2.x*this.m_localOBB.R.col2.y;b2PolyShape.tAbsR.col2.y=this.m_R.col1.y*this.m_localOBB.R.col2.x+this.m_R.col2.y*this.m_localOBB.R.col2.y;b2PolyShape.tAbsR.Abs()
+hX=b2PolyShape.tAbsR.col1.x*this.m_localOBB.extents.x+b2PolyShape.tAbsR.col2.x*this.m_localOBB.extents.y;hY=b2PolyShape.tAbsR.col1.y*this.m_localOBB.extents.x+b2PolyShape.tAbsR.col2.y*this.m_localOBB.extents.y;var positionX=this.m_position.x+(this.m_R.col1.x*this.m_localOBB.center.x+this.m_R.col2.x*this.m_localOBB.center.y);var positionY=this.m_position.y+(this.m_R.col1.y*this.m_localOBB.center.x+this.m_R.col2.y*this.m_localOBB.center.y);aabb.minVertex.x=positionX-hX;aabb.minVertex.y=positionY-hY;aabb.maxVertex.x=positionX+hX;aabb.maxVertex.y=positionY+hY;var broadPhase=this.m_body.m_world.m_broadPhase;if(broadPhase.InRange(aabb))
+{this.m_proxyId=broadPhase.CreateProxy(aabb,this);}
+else
+{this.m_proxyId=b2Pair.b2_nullProxy;}
+if(this.m_proxyId==b2Pair.b2_nullProxy)
+{this.m_body.Freeze();}},syncAABB:new b2AABB(),syncMat:new b2Mat22(),Synchronize:function(position1,R1,position2,R2){this.m_R.SetM(R2);this.m_position.x=this.m_body.m_position.x+(R2.col1.x*this.m_localCentroid.x+R2.col2.x*this.m_localCentroid.y);this.m_position.y=this.m_body.m_position.y+(R2.col1.y*this.m_localCentroid.x+R2.col2.y*this.m_localCentroid.y);if(this.m_proxyId==b2Pair.b2_nullProxy)
+{return;}
+var hX;var hY;var v1=R1.col1;var v2=R1.col2;var v3=this.m_localOBB.R.col1;var v4=this.m_localOBB.R.col2;this.syncMat.col1.x=v1.x*v3.x+v2.x*v3.y;this.syncMat.col1.y=v1.y*v3.x+v2.y*v3.y;this.syncMat.col2.x=v1.x*v4.x+v2.x*v4.y;this.syncMat.col2.y=v1.y*v4.x+v2.y*v4.y;this.syncMat.Abs();hX=this.m_localCentroid.x+this.m_localOBB.center.x;hY=this.m_localCentroid.y+this.m_localOBB.center.y;var centerX=position1.x+(R1.col1.x*hX+R1.col2.x*hY);var centerY=position1.y+(R1.col1.y*hX+R1.col2.y*hY);hX=this.syncMat.col1.x*this.m_localOBB.extents.x+this.syncMat.col2.x*this.m_localOBB.extents.y;hY=this.syncMat.col1.y*this.m_localOBB.extents.x+this.syncMat.col2.y*this.m_localOBB.extents.y;this.syncAABB.minVertex.x=centerX-hX;this.syncAABB.minVertex.y=centerY-hY;this.syncAABB.maxVertex.x=centerX+hX;this.syncAABB.maxVertex.y=centerY+hY;v1=R2.col1;v2=R2.col2;v3=this.m_localOBB.R.col1;v4=this.m_localOBB.R.col2;this.syncMat.col1.x=v1.x*v3.x+v2.x*v3.y;this.syncMat.col1.y=v1.y*v3.x+v2.y*v3.y;this.syncMat.col2.x=v1.x*v4.x+v2.x*v4.y;this.syncMat.col2.y=v1.y*v4.x+v2.y*v4.y;this.syncMat.Abs();hX=this.m_localCentroid.x+this.m_localOBB.center.x;hY=this.m_localCentroid.y+this.m_localOBB.center.y;centerX=position2.x+(R2.col1.x*hX+R2.col2.x*hY);centerY=position2.y+(R2.col1.y*hX+R2.col2.y*hY);hX=this.syncMat.col1.x*this.m_localOBB.extents.x+this.syncMat.col2.x*this.m_localOBB.extents.y;hY=this.syncMat.col1.y*this.m_localOBB.extents.x+this.syncMat.col2.y*this.m_localOBB.extents.y;this.syncAABB.minVertex.x=Math.min(this.syncAABB.minVertex.x,centerX-hX);this.syncAABB.minVertex.y=Math.min(this.syncAABB.minVertex.y,centerY-hY);this.syncAABB.maxVertex.x=Math.max(this.syncAABB.maxVertex.x,centerX+hX);this.syncAABB.maxVertex.y=Math.max(this.syncAABB.maxVertex.y,centerY+hY);var broadPhase=this.m_body.m_world.m_broadPhase;if(broadPhase.InRange(this.syncAABB))
+{broadPhase.MoveProxy(this.m_proxyId,this.syncAABB);}
+else
+{this.m_body.Freeze();}},QuickSync:function(position,R){this.m_R.SetM(R);this.m_position.x=position.x+(R.col1.x*this.m_localCentroid.x+R.col2.x*this.m_localCentroid.y);this.m_position.y=position.y+(R.col1.y*this.m_localCentroid.x+R.col2.y*this.m_localCentroid.y);},ResetProxy:function(broadPhase){if(this.m_proxyId==b2Pair.b2_nullProxy)
+{return;}
+var proxy=broadPhase.GetProxy(this.m_proxyId);broadPhase.DestroyProxy(this.m_proxyId);proxy=null;var R=b2Math.b2MulMM(this.m_R,this.m_localOBB.R);var absR=b2Math.b2AbsM(R);var h=b2Math.b2MulMV(absR,this.m_localOBB.extents);var position=b2Math.b2MulMV(this.m_R,this.m_localOBB.center);position.Add(this.m_position);var aabb=new b2AABB();aabb.minVertex.SetV(position);aabb.minVertex.Subtract(h);aabb.maxVertex.SetV(position);aabb.maxVertex.Add(h);if(broadPhase.InRange(aabb))
+{this.m_proxyId=broadPhase.CreateProxy(aabb,this);}
+else
+{this.m_proxyId=b2Pair.b2_nullProxy;}
+if(this.m_proxyId==b2Pair.b2_nullProxy)
+{this.m_body.Freeze();}},Support:function(dX,dY,out)
+{var dLocalX=(dX*this.m_R.col1.x+dY*this.m_R.col1.y);var dLocalY=(dX*this.m_R.col2.x+dY*this.m_R.col2.y);var bestIndex=0;var bestValue=(this.m_coreVertices[0].x*dLocalX+this.m_coreVertices[0].y*dLocalY);for(var i=1;i<this.m_vertexCount;++i)
+{var value=(this.m_coreVertices[i].x*dLocalX+this.m_coreVertices[i].y*dLocalY);if(value>bestValue)
+{bestIndex=i;bestValue=value;}}
+out.Set(this.m_position.x+(this.m_R.col1.x*this.m_coreVertices[bestIndex].x+this.m_R.col2.x*this.m_coreVertices[bestIndex].y),this.m_position.y+(this.m_R.col1.y*this.m_coreVertices[bestIndex].x+this.m_R.col2.y*this.m_coreVertices[bestIndex].y));},m_localCentroid:new b2Vec2(),m_localOBB:new b2OBB(),m_vertices:null,m_coreVertices:null,m_vertexCount:0,m_normals:null});b2PolyShape.tempVec=new b2Vec2();b2PolyShape.tAbsR=new b2Mat22();
+var b2Body=Class.create();b2Body.prototype={SetOriginPosition:function(position,rotation){if(this.IsFrozen())
+{return;}
+this.m_rotation=rotation;this.m_R.Set(this.m_rotation);this.m_position=b2Math.AddVV(position,b2Math.b2MulMV(this.m_R,this.m_center));this.m_position0.SetV(this.m_position);this.m_rotation0=this.m_rotation;for(var s=this.m_shapeList;s!=null;s=s.m_next)
+{s.Synchronize(this.m_position,this.m_R,this.m_position,this.m_R);}
+this.m_world.m_broadPhase.Commit();},GetOriginPosition:function(){return b2Math.SubtractVV(this.m_position,b2Math.b2MulMV(this.m_R,this.m_center));},SetCenterPosition:function(position,rotation){if(this.IsFrozen())
+{return;}
+this.m_rotation=rotation;this.m_R.Set(this.m_rotation);this.m_position.SetV(position);this.m_position0.SetV(this.m_position);this.m_rotation0=this.m_rotation;for(var s=this.m_shapeList;s!=null;s=s.m_next)
+{s.Synchronize(this.m_position,this.m_R,this.m_position,this.m_R);}
+this.m_world.m_broadPhase.Commit();},GetCenterPosition:function(){return this.m_position;},GetRotation:function(){return this.m_rotation;},GetRotationMatrix:function(){return this.m_R;},SetLinearVelocity:function(v){this.m_linearVelocity.SetV(v);},GetLinearVelocity:function(){return this.m_linearVelocity;},SetAngularVelocity:function(w){this.m_angularVelocity=w;},GetAngularVelocity:function(){return this.m_angularVelocity;},ApplyForce:function(force,point)
+{if(this.IsSleeping()==false)
+{this.m_force.Add(force);this.m_torque+=b2Math.b2CrossVV(b2Math.SubtractVV(point,this.m_position),force);}},ApplyTorque:function(torque)
+{if(this.IsSleeping()==false)
+{this.m_torque+=torque;}},ApplyImpulse:function(impulse,point)
+{if(this.IsSleeping()==false)
+{this.m_linearVelocity.Add(b2Math.MulFV(this.m_invMass,impulse));this.m_angularVelocity+=(this.m_invI*b2Math.b2CrossVV(b2Math.SubtractVV(point,this.m_position),impulse));}},GetMass:function(){return this.m_mass;},GetInertia:function(){return this.m_I;},GetWorldPoint:function(localPoint){return b2Math.AddVV(this.m_position,b2Math.b2MulMV(this.m_R,localPoint));},GetWorldVector:function(localVector){return b2Math.b2MulMV(this.m_R,localVector);},GetLocalPoint:function(worldPoint){return b2Math.b2MulTMV(this.m_R,b2Math.SubtractVV(worldPoint,this.m_position));},GetLocalVector:function(worldVector){return b2Math.b2MulTMV(this.m_R,worldVector);},IsStatic:function(){return(this.m_flags&b2Body.e_staticFlag)==b2Body.e_staticFlag;},IsFrozen:function()
+{return(this.m_flags&b2Body.e_frozenFlag)==b2Body.e_frozenFlag;},IsSleeping:function(){return(this.m_flags&b2Body.e_sleepFlag)==b2Body.e_sleepFlag;},AllowSleeping:function(flag)
+{if(flag)
+{this.m_flags|=b2Body.e_allowSleepFlag;}
+else
+{this.m_flags&=~b2Body.e_allowSleepFlag;this.WakeUp();}},WakeUp:function(){this.m_flags&=~b2Body.e_sleepFlag;this.m_sleepTime=0.0;},GetShapeList:function(){return this.m_shapeList;},GetContactList:function()
+{return this.m_contactList;},GetJointList:function()
+{return this.m_jointList;},GetNext:function(){return this.m_next;},GetUserData:function(){return this.m_userData;},initialize:function(bd,world){this.sMat0=new b2Mat22();this.m_position=new b2Vec2();this.m_R=new b2Mat22(0);this.m_position0=new b2Vec2();var i=0;var sd;var massData;this.m_flags=0;this.m_position.SetV(bd.position);this.m_rotation=bd.rotation;this.m_R.Set(this.m_rotation);this.m_position0.SetV(this.m_position);this.m_rotation0=this.m_rotation;this.m_world=world;this.m_linearDamping=b2Math.b2Clamp(1.0-bd.linearDamping,0.0,1.0);this.m_angularDamping=b2Math.b2Clamp(1.0-bd.angularDamping,0.0,1.0);this.m_force=new b2Vec2(0.0,0.0);this.m_torque=0.0;this.m_mass=0.0;var massDatas=new Array(b2Settings.b2_maxShapesPerBody);for(i=0;i<b2Settings.b2_maxShapesPerBody;i++){massDatas[i]=new b2MassData();}
+this.m_shapeCount=0;this.m_center=new b2Vec2(0.0,0.0);for(i=0;i<b2Settings.b2_maxShapesPerBody;++i)
+{sd=bd.shapes[i];if(sd==null)break;massData=massDatas[i];sd.ComputeMass(massData);this.m_mass+=massData.mass;this.m_center.x+=massData.mass*(sd.localPosition.x+massData.center.x);this.m_center.y+=massData.mass*(sd.localPosition.y+massData.center.y);++this.m_shapeCount;}
+if(this.m_mass>0.0)
+{this.m_center.Multiply(1.0/this.m_mass);this.m_position.Add(b2Math.b2MulMV(this.m_R,this.m_center));}
+else
+{this.m_flags|=b2Body.e_staticFlag;}
+this.m_I=0.0;for(i=0;i<this.m_shapeCount;++i)
+{sd=bd.shapes[i];massData=massDatas[i];this.m_I+=massData.I;var r=b2Math.SubtractVV(b2Math.AddVV(sd.localPosition,massData.center),this.m_center);this.m_I+=massData.mass*b2Math.b2Dot(r,r);}
+if(this.m_mass>0.0)
+{this.m_invMass=1.0/this.m_mass;}
+else
+{this.m_invMass=0.0;}
+if(this.m_I>0.0&&bd.preventRotation==false)
+{this.m_invI=1.0/this.m_I;}
+else
+{this.m_I=0.0;this.m_invI=0.0;}
+this.m_linearVelocity=b2Math.AddVV(bd.linearVelocity,b2Math.b2CrossFV(bd.angularVelocity,this.m_center));this.m_angularVelocity=bd.angularVelocity;this.m_jointList=null;this.m_contactList=null;this.m_prev=null;this.m_next=null;this.m_shapeList=null;for(i=0;i<this.m_shapeCount;++i)
+{sd=bd.shapes[i];var shape=b2Shape.Create(sd,this,this.m_center);shape.m_next=this.m_shapeList;this.m_shapeList=shape;}
+this.m_sleepTime=0.0;if(bd.allowSleep)
+{this.m_flags|=b2Body.e_allowSleepFlag;}
+if(bd.isSleeping)
+{this.m_flags|=b2Body.e_sleepFlag;}
+if((this.m_flags&b2Body.e_sleepFlag)||this.m_invMass==0.0)
+{this.m_linearVelocity.Set(0.0,0.0);this.m_angularVelocity=0.0;}
+this.m_userData=bd.userData;},Destroy:function(){var s=this.m_shapeList;while(s)
+{var s0=s;s=s.m_next;b2Shape.Destroy(s0);}},sMat0:new b2Mat22(),SynchronizeShapes:function(){this.sMat0.Set(this.m_rotation0);for(var s=this.m_shapeList;s!=null;s=s.m_next)
+{s.Synchronize(this.m_position0,this.sMat0,this.m_position,this.m_R);}},QuickSyncShapes:function(){for(var s=this.m_shapeList;s!=null;s=s.m_next)
+{s.QuickSync(this.m_position,this.m_R);}},IsConnected:function(other){for(var jn=this.m_jointList;jn!=null;jn=jn.next)
+{if(jn.other==other)
+return jn.joint.m_collideConnected==false;}
+return false;},Freeze:function(){this.m_flags|=b2Body.e_frozenFlag;this.m_linearVelocity.SetZero();this.m_angularVelocity=0.0;for(var s=this.m_shapeList;s!=null;s=s.m_next)
+{s.DestroyProxy();}},m_flags:0,m_position:new b2Vec2(),m_rotation:null,m_R:new b2Mat22(0),m_position0:new b2Vec2(),m_rotation0:null,m_linearVelocity:null,m_angularVelocity:null,m_force:null,m_torque:null,m_center:null,m_world:null,m_prev:null,m_next:null,m_shapeList:null,m_shapeCount:0,m_jointList:null,m_contactList:null,m_mass:null,m_invMass:null,m_I:null,m_invI:null,m_linearDamping:null,m_angularDamping:null,m_sleepTime:null,m_userData:null};b2Body.e_staticFlag=0x0001;b2Body.e_frozenFlag=0x0002;b2Body.e_islandFlag=0x0004;b2Body.e_sleepFlag=0x0008;b2Body.e_allowSleepFlag=0x0010;b2Body.e_destroyFlag=0x0020;
+var b2BodyDef=Class.create();b2BodyDef.prototype={initialize:function()
+{this.shapes=new Array();this.userData=null;for(var i=0;i<b2Settings.b2_maxShapesPerBody;i++){this.shapes[i]=null;}
+this.position=new b2Vec2(0.0,0.0);this.rotation=0.0;this.linearVelocity=new b2Vec2(0.0,0.0);this.angularVelocity=0.0;this.linearDamping=0.0;this.angularDamping=0.0;this.allowSleep=true;this.isSleeping=false;this.preventRotation=false;},userData:null,shapes:new Array(),position:null,rotation:null,linearVelocity:null,angularVelocity:null,linearDamping:null,angularDamping:null,allowSleep:null,isSleeping:null,preventRotation:null,AddShape:function(shape)
+{for(var i=0;i<b2Settings.b2_maxShapesPerBody;++i)
+{if(this.shapes[i]==null)
+{this.shapes[i]=shape;break;}}}};
+var b2CollisionFilter=Class.create();b2CollisionFilter.prototype={ShouldCollide:function(shape1,shape2){if(shape1.m_groupIndex==shape2.m_groupIndex&&shape1.m_groupIndex!=0)
+{return shape1.m_groupIndex>0;}
+var collide=(shape1.m_maskBits&shape2.m_categoryBits)!=0&&(shape1.m_categoryBits&shape2.m_maskBits)!=0;return collide;},initialize:function(){}};b2CollisionFilter.b2_defaultFilter=new b2CollisionFilter;
+var b2Island=Class.create();b2Island.prototype={initialize:function(bodyCapacity,contactCapacity,jointCapacity,allocator)
+{var i=0;this.m_bodyCapacity=bodyCapacity;this.m_contactCapacity=contactCapacity;this.m_jointCapacity=jointCapacity;this.m_bodyCount=0;this.m_contactCount=0;this.m_jointCount=0;this.m_bodies=new Array(bodyCapacity);for(i=0;i<bodyCapacity;i++)
+this.m_bodies[i]=null;this.m_contacts=new Array(contactCapacity);for(i=0;i<contactCapacity;i++)
+this.m_contacts[i]=null;this.m_joints=new Array(jointCapacity);for(i=0;i<jointCapacity;i++)
+this.m_joints[i]=null;this.m_allocator=allocator;},Clear:function()
+{this.m_bodyCount=0;this.m_contactCount=0;this.m_jointCount=0;},Solve:function(step,gravity)
+{var i=0;var b;for(i=0;i<this.m_bodyCount;++i)
+{b=this.m_bodies[i];if(b.m_invMass==0.0)
+continue;b.m_linearVelocity.Add(b2Math.MulFV(step.dt,b2Math.AddVV(gravity,b2Math.MulFV(b.m_invMass,b.m_force))));b.m_angularVelocity+=step.dt*b.m_invI*b.m_torque;b.m_linearVelocity.Multiply(b.m_linearDamping);b.m_angularVelocity*=b.m_angularDamping;b.m_position0.SetV(b.m_position);b.m_rotation0=b.m_rotation;}
+var contactSolver=new b2ContactSolver(this.m_contacts,this.m_contactCount,this.m_allocator);contactSolver.PreSolve();for(i=0;i<this.m_jointCount;++i)
+{this.m_joints[i].PrepareVelocitySolver();}
+for(i=0;i<step.iterations;++i)
+{contactSolver.SolveVelocityConstraints();for(var j=0;j<this.m_jointCount;++j)
+{this.m_joints[j].SolveVelocityConstraints(step);}}
+for(i=0;i<this.m_bodyCount;++i)
+{b=this.m_bodies[i];if(b.m_invMass==0.0)
+continue;b.m_position.x+=step.dt*b.m_linearVelocity.x;b.m_position.y+=step.dt*b.m_linearVelocity.y;b.m_rotation+=step.dt*b.m_angularVelocity;b.m_R.Set(b.m_rotation);}
+for(i=0;i<this.m_jointCount;++i)
+{this.m_joints[i].PreparePositionSolver();}
+if(b2World.s_enablePositionCorrection)
+{for(b2Island.m_positionIterationCount=0;b2Island.m_positionIterationCount<step.iterations;++b2Island.m_positionIterationCount)
+{var contactsOkay=contactSolver.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);var jointsOkay=true;for(i=0;i<this.m_jointCount;++i)
+{var jointOkay=this.m_joints[i].SolvePositionConstraints();jointsOkay=jointsOkay&&jointOkay;}
+if(contactsOkay&&jointsOkay)
+{break;}}}
+contactSolver.PostSolve();for(i=0;i<this.m_bodyCount;++i)
+{b=this.m_bodies[i];if(b.m_invMass==0.0)
+continue;b.m_R.Set(b.m_rotation);b.SynchronizeShapes();b.m_force.Set(0.0,0.0);b.m_torque=0.0;}},UpdateSleep:function(dt)
+{var i=0;var b;var minSleepTime=Number.MAX_VALUE;var linTolSqr=b2Settings.b2_linearSleepTolerance*b2Settings.b2_linearSleepTolerance;var angTolSqr=b2Settings.b2_angularSleepTolerance*b2Settings.b2_angularSleepTolerance;for(i=0;i<this.m_bodyCount;++i)
+{b=this.m_bodies[i];if(b.m_invMass==0.0)
+{continue;}
+if((b.m_flags&b2Body.e_allowSleepFlag)==0)
+{b.m_sleepTime=0.0;minSleepTime=0.0;}
+if((b.m_flags&b2Body.e_allowSleepFlag)==0||b.m_angularVelocity*b.m_angularVelocity>angTolSqr||b2Math.b2Dot(b.m_linearVelocity,b.m_linearVelocity)>linTolSqr)
+{b.m_sleepTime=0.0;minSleepTime=0.0;}
+else
+{b.m_sleepTime+=dt;minSleepTime=b2Math.b2Min(minSleepTime,b.m_sleepTime);}}
+if(minSleepTime>=b2Settings.b2_timeToSleep)
+{for(i=0;i<this.m_bodyCount;++i)
+{b=this.m_bodies[i];b.m_flags|=b2Body.e_sleepFlag;}}},AddBody:function(body)
+{this.m_bodies[this.m_bodyCount++]=body;},AddContact:function(contact)
+{this.m_contacts[this.m_contactCount++]=contact;},AddJoint:function(joint)
+{this.m_joints[this.m_jointCount++]=joint;},m_allocator:null,m_bodies:null,m_contacts:null,m_joints:null,m_bodyCount:0,m_jointCount:0,m_contactCount:0,m_bodyCapacity:0,m_contactCapacity:0,m_jointCapacity:0,m_positionError:null};b2Island.m_positionIterationCount=0;
+var b2TimeStep=Class.create();b2TimeStep.prototype={dt:null,inv_dt:null,iterations:0,initialize:function(){}};
+var b2ContactNode=Class.create();b2ContactNode.prototype={other:null,contact:null,prev:null,next:null,initialize:function(){}};
+var b2Contact=Class.create();b2Contact.prototype={GetManifolds:function(){return null},GetManifoldCount:function()
+{return this.m_manifoldCount;},GetNext:function(){return this.m_next;},GetShape1:function(){return this.m_shape1;},GetShape2:function(){return this.m_shape2;},initialize:function(s1,s2)
+{this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!s1||!s2){this.m_shape1=null;this.m_shape2=null;return;}
+this.m_shape1=s1;this.m_shape2=s2;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;},Evaluate:function(){},m_flags:0,m_prev:null,m_next:null,m_node1:new b2ContactNode(),m_node2:new b2ContactNode(),m_shape1:null,m_shape2:null,m_manifoldCount:0,m_friction:null,m_restitution:null};b2Contact.e_islandFlag=0x0001;b2Contact.e_destroyFlag=0x0002;b2Contact.AddType=function(createFcn,destroyFcn,type1,type2)
+{b2Contact.s_registers[type1][type2].createFcn=createFcn;b2Contact.s_registers[type1][type2].destroyFcn=destroyFcn;b2Contact.s_registers[type1][type2].primary=true;if(type1!=type2)
+{b2Contact.s_registers[type2][type1].createFcn=createFcn;b2Contact.s_registers[type2][type1].destroyFcn=destroyFcn;b2Contact.s_registers[type2][type1].primary=false;}};b2Contact.InitializeRegisters=function(){b2Contact.s_registers=new Array(b2Shape.e_shapeTypeCount);for(var i=0;i<b2Shape.e_shapeTypeCount;i++){b2Contact.s_registers[i]=new Array(b2Shape.e_shapeTypeCount);for(var j=0;j<b2Shape.e_shapeTypeCount;j++){b2Contact.s_registers[i][j]=new b2ContactRegister();}}
+b2Contact.AddType(b2CircleContact.Create,b2CircleContact.Destroy,b2Shape.e_circleShape,b2Shape.e_circleShape);b2Contact.AddType(b2PolyAndCircleContact.Create,b2PolyAndCircleContact.Destroy,b2Shape.e_polyShape,b2Shape.e_circleShape);b2Contact.AddType(b2PolyContact.Create,b2PolyContact.Destroy,b2Shape.e_polyShape,b2Shape.e_polyShape);};b2Contact.Create=function(shape1,shape2,allocator){if(b2Contact.s_initialized==false)
+{b2Contact.InitializeRegisters();b2Contact.s_initialized=true;}
+var type1=shape1.m_type;var type2=shape2.m_type;var createFcn=b2Contact.s_registers[type1][type2].createFcn;if(createFcn)
+{if(b2Contact.s_registers[type1][type2].primary)
+{return createFcn(shape1,shape2,allocator);}
+else
+{var c=createFcn(shape2,shape1,allocator);for(var i=0;i<c.GetManifoldCount();++i)
+{var m=c.GetManifolds()[i];m.normal=m.normal.Negative();}
+return c;}}
+else
+{return null;}};b2Contact.Destroy=function(contact,allocator){if(contact.GetManifoldCount()>0)
+{contact.m_shape1.m_body.WakeUp();contact.m_shape2.m_body.WakeUp();}
+var type1=contact.m_shape1.m_type;var type2=contact.m_shape2.m_type;var destroyFcn=b2Contact.s_registers[type1][type2].destroyFcn;destroyFcn(contact,allocator);};b2Contact.s_registers=null;b2Contact.s_initialized=false;
+var b2ContactConstraint=Class.create();b2ContactConstraint.prototype={initialize:function(){this.normal=new b2Vec2();this.points=new Array(b2Settings.b2_maxManifoldPoints);for(var i=0;i<b2Settings.b2_maxManifoldPoints;i++){this.points[i]=new b2ContactConstraintPoint();}},points:null,normal:new b2Vec2(),manifold:null,body1:null,body2:null,friction:null,restitution:null,pointCount:0};
+var b2ContactConstraintPoint=Class.create();b2ContactConstraintPoint.prototype={localAnchor1:new b2Vec2(),localAnchor2:new b2Vec2(),normalImpulse:null,tangentImpulse:null,positionImpulse:null,normalMass:null,tangentMass:null,separation:null,velocityBias:null,initialize:function(){this.localAnchor1=new b2Vec2();this.localAnchor2=new b2Vec2();}};
+var b2ContactRegister=Class.create();b2ContactRegister.prototype={createFcn:null,destroyFcn:null,primary:null,initialize:function(){}};
+var b2ContactSolver=Class.create();b2ContactSolver.prototype={initialize:function(contacts,contactCount,allocator){this.m_constraints=new Array();this.m_allocator=allocator;var i=0;var tVec;var tMat;this.m_constraintCount=0;for(i=0;i<contactCount;++i)
+{this.m_constraintCount+=contacts[i].GetManifoldCount();}
+for(i=0;i<this.m_constraintCount;i++){this.m_constraints[i]=new b2ContactConstraint();}
+var count=0;for(i=0;i<contactCount;++i)
+{var contact=contacts[i];var b1=contact.m_shape1.m_body;var b2=contact.m_shape2.m_body;var manifoldCount=contact.GetManifoldCount();var manifolds=contact.GetManifolds();var friction=contact.m_friction;var restitution=contact.m_restitution;var v1X=b1.m_linearVelocity.x;var v1Y=b1.m_linearVelocity.y;var v2X=b2.m_linearVelocity.x;var v2Y=b2.m_linearVelocity.y;var w1=b1.m_angularVelocity;var w2=b2.m_angularVelocity;for(var j=0;j<manifoldCount;++j)
+{var manifold=manifolds[j];var normalX=manifold.normal.x;var normalY=manifold.normal.y;var c=this.m_constraints[count];c.body1=b1;c.body2=b2;c.manifold=manifold;c.normal.x=normalX;c.normal.y=normalY;c.pointCount=manifold.pointCount;c.friction=friction;c.restitution=restitution;for(var k=0;k<c.pointCount;++k)
+{var cp=manifold.points[k];var ccp=c.points[k];ccp.normalImpulse=cp.normalImpulse;ccp.tangentImpulse=cp.tangentImpulse;ccp.separation=cp.separation;var r1X=cp.position.x-b1.m_position.x;var r1Y=cp.position.y-b1.m_position.y;var r2X=cp.position.x-b2.m_position.x;var r2Y=cp.position.y-b2.m_position.y;tVec=ccp.localAnchor1;tMat=b1.m_R;tVec.x=r1X*tMat.col1.x+r1Y*tMat.col1.y;tVec.y=r1X*tMat.col2.x+r1Y*tMat.col2.y;tVec=ccp.localAnchor2;tMat=b2.m_R;tVec.x=r2X*tMat.col1.x+r2Y*tMat.col1.y;tVec.y=r2X*tMat.col2.x+r2Y*tMat.col2.y;var r1Sqr=r1X*r1X+r1Y*r1Y;var r2Sqr=r2X*r2X+r2Y*r2Y;var rn1=r1X*normalX+r1Y*normalY;var rn2=r2X*normalX+r2Y*normalY;var kNormal=b1.m_invMass+b2.m_invMass;kNormal+=b1.m_invI*(r1Sqr-rn1*rn1)+b2.m_invI*(r2Sqr-rn2*rn2);ccp.normalMass=1.0/kNormal;var tangentX=normalY
+var tangentY=-normalX;var rt1=r1X*tangentX+r1Y*tangentY;var rt2=r2X*tangentX+r2Y*tangentY;var kTangent=b1.m_invMass+b2.m_invMass;kTangent+=b1.m_invI*(r1Sqr-rt1*rt1)+b2.m_invI*(r2Sqr-rt2*rt2);ccp.tangentMass=1.0/kTangent;ccp.velocityBias=0.0;if(ccp.separation>0.0)
+{ccp.velocityBias=-60.0*ccp.separation;}
+var tX=v2X+(-w2*r2Y)-v1X-(-w1*r1Y);var tY=v2Y+(w2*r2X)-v1Y-(w1*r1X);var vRel=c.normal.x*tX+c.normal.y*tY;if(vRel<-b2Settings.b2_velocityThreshold)
+{ccp.velocityBias+=-c.restitution*vRel;}}
+++count;}}},PreSolve:function(){var tVec;var tVec2;var tMat;for(var i=0;i<this.m_constraintCount;++i)
+{var c=this.m_constraints[i];var b1=c.body1;var b2=c.body2;var invMass1=b1.m_invMass;var invI1=b1.m_invI;var invMass2=b2.m_invMass;var invI2=b2.m_invI;var normalX=c.normal.x;var normalY=c.normal.y;var tangentX=normalY;var tangentY=-normalX;var j=0;var tCount=0;if(b2World.s_enableWarmStarting)
+{tCount=c.pointCount;for(j=0;j<tCount;++j)
+{var ccp=c.points[j];var PX=ccp.normalImpulse*normalX+ccp.tangentImpulse*tangentX;var PY=ccp.normalImpulse*normalY+ccp.tangentImpulse*tangentY;tMat=b1.m_R;tVec=ccp.localAnchor1;var r1X=tMat.col1.x*tVec.x+tMat.col2.x*tVec.y;var r1Y=tMat.col1.y*tVec.x+tMat.col2.y*tVec.y;tMat=b2.m_R;tVec=ccp.localAnchor2;var r2X=tMat.col1.x*tVec.x+tMat.col2.x*tVec.y;var r2Y=tMat.col1.y*tVec.x+tMat.col2.y*tVec.y;b1.m_angularVelocity-=invI1*(r1X*PY-r1Y*PX);b1.m_linearVelocity.x-=invMass1*PX;b1.m_linearVelocity.y-=invMass1*PY;b2.m_angularVelocity+=invI2*(r2X*PY-r2Y*PX);b2.m_linearVelocity.x+=invMass2*PX;b2.m_linearVelocity.y+=invMass2*PY;ccp.positionImpulse=0.0;}}
+else{tCount=c.pointCount;for(j=0;j<tCount;++j)
+{var ccp2=c.points[j];ccp2.normalImpulse=0.0;ccp2.tangentImpulse=0.0;ccp2.positionImpulse=0.0;}}}},SolveVelocityConstraints:function(){var j=0;var ccp;var r1X;var r1Y;var r2X;var r2Y;var dvX;var dvY;var lambda;var newImpulse;var PX;var PY;var tMat;var tVec;for(var i=0;i<this.m_constraintCount;++i)
+{var c=this.m_constraints[i];var b1=c.body1;var b2=c.body2;var b1_angularVelocity=b1.m_angularVelocity;var b1_linearVelocity=b1.m_linearVelocity;var b2_angularVelocity=b2.m_angularVelocity;var b2_linearVelocity=b2.m_linearVelocity;var invMass1=b1.m_invMass;var invI1=b1.m_invI;var invMass2=b2.m_invMass;var invI2=b2.m_invI;var normalX=c.normal.x;var normalY=c.normal.y;var tangentX=normalY;var tangentY=-normalX;var tCount=c.pointCount;for(j=0;j<tCount;++j)
+{ccp=c.points[j];tMat=b1.m_R;tVec=ccp.localAnchor1;r1X=tMat.col1.x*tVec.x+tMat.col2.x*tVec.y
+r1Y=tMat.col1.y*tVec.x+tMat.col2.y*tVec.y
+tMat=b2.m_R;tVec=ccp.localAnchor2;r2X=tMat.col1.x*tVec.x+tMat.col2.x*tVec.y
+r2Y=tMat.col1.y*tVec.x+tMat.col2.y*tVec.y
+dvX=b2_linearVelocity.x+(-b2_angularVelocity*r2Y)-b1_linearVelocity.x-(-b1_angularVelocity*r1Y);dvY=b2_linearVelocity.y+(b2_angularVelocity*r2X)-b1_linearVelocity.y-(b1_angularVelocity*r1X);var vn=dvX*normalX+dvY*normalY;lambda=-ccp.normalMass*(vn-ccp.velocityBias);newImpulse=b2Math.b2Max(ccp.normalImpulse+lambda,0.0);lambda=newImpulse-ccp.normalImpulse;PX=lambda*normalX;PY=lambda*normalY;b1_linearVelocity.x-=invMass1*PX;b1_linearVelocity.y-=invMass1*PY;b1_angularVelocity-=invI1*(r1X*PY-r1Y*PX);b2_linearVelocity.x+=invMass2*PX;b2_linearVelocity.y+=invMass2*PY;b2_angularVelocity+=invI2*(r2X*PY-r2Y*PX);ccp.normalImpulse=newImpulse;dvX=b2_linearVelocity.x+(-b2_angularVelocity*r2Y)-b1_linearVelocity.x-(-b1_angularVelocity*r1Y);dvY=b2_linearVelocity.y+(b2_angularVelocity*r2X)-b1_linearVelocity.y-(b1_angularVelocity*r1X);var vt=dvX*tangentX+dvY*tangentY;lambda=ccp.tangentMass*(-vt);var maxFriction=c.friction*ccp.normalImpulse;newImpulse=b2Math.b2Clamp(ccp.tangentImpulse+lambda,-maxFriction,maxFriction);lambda=newImpulse-ccp.tangentImpulse;PX=lambda*tangentX;PY=lambda*tangentY;b1_linearVelocity.x-=invMass1*PX;b1_linearVelocity.y-=invMass1*PY;b1_angularVelocity-=invI1*(r1X*PY-r1Y*PX);b2_linearVelocity.x+=invMass2*PX;b2_linearVelocity.y+=invMass2*PY;b2_angularVelocity+=invI2*(r2X*PY-r2Y*PX);ccp.tangentImpulse=newImpulse;}
+b1.m_angularVelocity=b1_angularVelocity;b2.m_angularVelocity=b2_angularVelocity;}},SolvePositionConstraints:function(beta){var minSeparation=0.0;var tMat;var tVec;for(var i=0;i<this.m_constraintCount;++i)
+{var c=this.m_constraints[i];var b1=c.body1;var b2=c.body2;var b1_position=b1.m_position;var b1_rotation=b1.m_rotation;var b2_position=b2.m_position;var b2_rotation=b2.m_rotation;var invMass1=b1.m_invMass;var invI1=b1.m_invI;var invMass2=b2.m_invMass;var invI2=b2.m_invI;var normalX=c.normal.x;var normalY=c.normal.y;var tangentX=normalY;var tangentY=-normalX;var tCount=c.pointCount;for(var j=0;j<tCount;++j)
+{var ccp=c.points[j];tMat=b1.m_R;tVec=ccp.localAnchor1;var r1X=tMat.col1.x*tVec.x+tMat.col2.x*tVec.y
+var r1Y=tMat.col1.y*tVec.x+tMat.col2.y*tVec.y
+tMat=b2.m_R;tVec=ccp.localAnchor2;var r2X=tMat.col1.x*tVec.x+tMat.col2.x*tVec.y
+var r2Y=tMat.col1.y*tVec.x+tMat.col2.y*tVec.y
+var p1X=b1_position.x+r1X;var p1Y=b1_position.y+r1Y;var p2X=b2_position.x+r2X;var p2Y=b2_position.y+r2Y;var dpX=p2X-p1X;var dpY=p2Y-p1Y;var separation=(dpX*normalX+dpY*normalY)+ccp.separation;minSeparation=b2Math.b2Min(minSeparation,separation);var C=beta*b2Math.b2Clamp(separation+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0.0);var dImpulse=-ccp.normalMass*C;var impulse0=ccp.positionImpulse;ccp.positionImpulse=b2Math.b2Max(impulse0+dImpulse,0.0);dImpulse=ccp.positionImpulse-impulse0;var impulseX=dImpulse*normalX;var impulseY=dImpulse*normalY;b1_position.x-=invMass1*impulseX;b1_position.y-=invMass1*impulseY;b1_rotation-=invI1*(r1X*impulseY-r1Y*impulseX);b1.m_R.Set(b1_rotation);b2_position.x+=invMass2*impulseX;b2_position.y+=invMass2*impulseY;b2_rotation+=invI2*(r2X*impulseY-r2Y*impulseX);b2.m_R.Set(b2_rotation);}
+b1.m_rotation=b1_rotation;b2.m_rotation=b2_rotation;}
+return minSeparation>=-b2Settings.b2_linearSlop;},PostSolve:function(){for(var i=0;i<this.m_constraintCount;++i)
+{var c=this.m_constraints[i];var m=c.manifold;for(var j=0;j<c.pointCount;++j)
+{var mPoint=m.points[j];var cPoint=c.points[j];mPoint.normalImpulse=cPoint.normalImpulse;mPoint.tangentImpulse=cPoint.tangentImpulse;}}},m_allocator:null,m_constraints:new Array(),m_constraintCount:0};
+var b2CircleContact=Class.create();Object.extend(b2CircleContact.prototype,b2Contact.prototype);Object.extend(b2CircleContact.prototype,{initialize:function(s1,s2){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!s1||!s2){this.m_shape1=null;this.m_shape2=null;return;}
+this.m_shape1=s1;this.m_shape2=s2;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;this.m_manifold=[new b2Manifold()];this.m_manifold[0].pointCount=0;this.m_manifold[0].points[0].normalImpulse=0.0;this.m_manifold[0].points[0].tangentImpulse=0.0;},Evaluate:function(){b2Collision.b2CollideCircle(this.m_manifold[0],this.m_shape1,this.m_shape2,false);if(this.m_manifold[0].pointCount>0)
+{this.m_manifoldCount=1;}
+else
+{this.m_manifoldCount=0;}},GetManifolds:function()
+{return this.m_manifold;},m_manifold:[new b2Manifold()]});b2CircleContact.Create=function(shape1,shape2,allocator){return new b2CircleContact(shape1,shape2);};b2CircleContact.Destroy=function(contact,allocator){};
+var b2Conservative=Class.create();b2Conservative.prototype={initialize:function(){}}
+b2Conservative.R1=new b2Mat22();b2Conservative.R2=new b2Mat22();b2Conservative.x1=new b2Vec2();b2Conservative.x2=new b2Vec2();b2Conservative.Conservative=function(shape1,shape2){var body1=shape1.GetBody();var body2=shape2.GetBody();var v1X=body1.m_position.x-body1.m_position0.x;var v1Y=body1.m_position.y-body1.m_position0.y;var omega1=body1.m_rotation-body1.m_rotation0;var v2X=body2.m_position.x-body2.m_position0.x;var v2Y=body2.m_position.y-body2.m_position0.y;var omega2=body2.m_rotation-body2.m_rotation0;var r1=shape1.GetMaxRadius();var r2=shape2.GetMaxRadius();var p1StartX=body1.m_position0.x;var p1StartY=body1.m_position0.y;var a1Start=body1.m_rotation0;var p2StartX=body2.m_position0.x;var p2StartY=body2.m_position0.y;var a2Start=body2.m_rotation0;var p1X=p1StartX;var p1Y=p1StartY;var a1=a1Start;var p2X=p2StartX;var p2Y=p2StartY;var a2=a2Start;b2Conservative.R1.Set(a1);b2Conservative.R2.Set(a2);shape1.QuickSync(p1,b2Conservative.R1);shape2.QuickSync(p2,b2Conservative.R2);var s1=0.0;var maxIterations=10;var dX;var dY;var invRelativeVelocity=0.0;var hit=true;for(var iter=0;iter<maxIterations;++iter)
+{var distance=b2Distance.Distance(b2Conservative.x1,b2Conservative.x2,shape1,shape2);if(distance<b2Settings.b2_linearSlop)
+{if(iter==0)
+{hit=false;}
+else
+{hit=true;}
+break;}
+if(iter==0)
+{dX=b2Conservative.x2.x-b2Conservative.x1.x;dY=b2Conservative.x2.y-b2Conservative.x1.y;var dLen=Math.sqrt(dX*dX+dY*dY);var relativeVelocity=(dX*(v1X-v2X)+dY*(v1Y-v2Y))+Math.abs(omega1)*r1+Math.abs(omega2)*r2;if(Math.abs(relativeVelocity)<Number.MIN_VALUE)
+{hit=false;break;}
+invRelativeVelocity=1.0/relativeVelocity;}
+var ds=distance*invRelativeVelocity;var s2=s1+ds;if(s2<0.0||1.0<s2)
+{hit=false;break;}
+if(s2<(1.0+100.0*Number.MIN_VALUE)*s1)
+{hit=true;break;}
+s1=s2;p1X=p1StartX+s1*v1.x;p1Y=p1StartY+s1*v1.y;a1=a1Start+s1*omega1;p2X=p2StartX+s1*v2.x;p2Y=p2StartY+s1*v2.y;a2=a2Start+s1*omega2;b2Conservative.R1.Set(a1);b2Conservative.R2.Set(a2);shape1.QuickSync(p1,b2Conservative.R1);shape2.QuickSync(p2,b2Conservative.R2);}
+if(hit)
+{dX=b2Conservative.x2.x-b2Conservative.x1.x;dY=b2Conservative.x2.y-b2Conservative.x1.y;var length=Math.sqrt(dX*dX+dY*dY);if(length>FLT_EPSILON)
+{d*=b2_linearSlop/length;}
+if(body1.IsStatic())
+{body1.m_position.x=p1X;body1.m_position.y=p1Y;}
+else
+{body1.m_position.x=p1X-dX;body1.m_position.y=p1Y-dY;}
+body1.m_rotation=a1;body1.m_R.Set(a1);body1.QuickSyncShapes();if(body2.IsStatic())
+{body2.m_position.x=p2X;body2.m_position.y=p2Y;}
+else
+{body2.m_position.x=p2X+dX;body2.m_position.y=p2Y+dY;}
+body2.m_position.x=p2X+dX;body2.m_position.y=p2Y+dY;body2.m_rotation=a2;body2.m_R.Set(a2);body2.QuickSyncShapes();return true;}
+shape1.QuickSync(body1.m_position,body1.m_R);shape2.QuickSync(body2.m_position,body2.m_R);return false;};
+var b2NullContact=Class.create();Object.extend(b2NullContact.prototype,b2Contact.prototype);Object.extend(b2NullContact.prototype,{initialize:function(s1,s2){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!s1||!s2){this.m_shape1=null;this.m_shape2=null;return;}
+this.m_shape1=s1;this.m_shape2=s2;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;},Evaluate:function(){},GetManifolds:function(){return null;}});
+var b2PolyAndCircleContact=Class.create();Object.extend(b2PolyAndCircleContact.prototype,b2Contact.prototype);Object.extend(b2PolyAndCircleContact.prototype,{initialize:function(s1,s2){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!s1||!s2){this.m_shape1=null;this.m_shape2=null;return;}
+this.m_shape1=s1;this.m_shape2=s2;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;this.m_manifold=[new b2Manifold()];b2Settings.b2Assert(this.m_shape1.m_type==b2Shape.e_polyShape);b2Settings.b2Assert(this.m_shape2.m_type==b2Shape.e_circleShape);this.m_manifold[0].pointCount=0;this.m_manifold[0].points[0].normalImpulse=0.0;this.m_manifold[0].points[0].tangentImpulse=0.0;},Evaluate:function(){b2Collision.b2CollidePolyAndCircle(this.m_manifold[0],this.m_shape1,this.m_shape2,false);if(this.m_manifold[0].pointCount>0)
+{this.m_manifoldCount=1;}
+else
+{this.m_manifoldCount=0;}},GetManifolds:function()
+{return this.m_manifold;},m_manifold:[new b2Manifold()]})
+b2PolyAndCircleContact.Create=function(shape1,shape2,allocator){return new b2PolyAndCircleContact(shape1,shape2);};b2PolyAndCircleContact.Destroy=function(contact,allocator){};
+var b2PolyContact=Class.create();Object.extend(b2PolyContact.prototype,b2Contact.prototype);Object.extend(b2PolyContact.prototype,{initialize:function(s1,s2){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!s1||!s2){this.m_shape1=null;this.m_shape2=null;return;}
+this.m_shape1=s1;this.m_shape2=s2;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;this.m0=new b2Manifold();this.m_manifold=[new b2Manifold()];this.m_manifold[0].pointCount=0;},m0:new b2Manifold(),Evaluate:function(){var tMani=this.m_manifold[0];var tPoints=this.m0.points;for(var k=0;k<tMani.pointCount;k++){var tPoint=tPoints[k];var tPoint0=tMani.points[k];tPoint.normalImpulse=tPoint0.normalImpulse;tPoint.tangentImpulse=tPoint0.tangentImpulse;tPoint.id=tPoint0.id.Copy();}
+this.m0.pointCount=tMani.pointCount;b2Collision.b2CollidePoly(tMani,this.m_shape1,this.m_shape2,false);if(tMani.pointCount>0)
+{var match=[false,false];for(var i=0;i<tMani.pointCount;++i)
+{var cp=tMani.points[i];cp.normalImpulse=0.0;cp.tangentImpulse=0.0;var idKey=cp.id.key;for(var j=0;j<this.m0.pointCount;++j)
+{if(match[j]==true)
+continue;var cp0=this.m0.points[j];var id0=cp0.id;if(id0.key==idKey)
+{match[j]=true;cp.normalImpulse=cp0.normalImpulse;cp.tangentImpulse=cp0.tangentImpulse;break;}}}
+this.m_manifoldCount=1;}
+else
+{this.m_manifoldCount=0;}},GetManifolds:function()
+{return this.m_manifold;},m_manifold:[new b2Manifold()]});b2PolyContact.Create=function(shape1,shape2,allocator){return new b2PolyContact(shape1,shape2);};b2PolyContact.Destroy=function(contact,allocator){};
+var b2ContactManager=Class.create();Object.extend(b2ContactManager.prototype,b2PairCallback.prototype);Object.extend(b2ContactManager.prototype,{initialize:function(){this.m_nullContact=new b2NullContact();this.m_world=null;this.m_destroyImmediate=false;},PairAdded:function(proxyUserData1,proxyUserData2){var shape1=proxyUserData1;var shape2=proxyUserData2;var body1=shape1.m_body;var body2=shape2.m_body;if(body1.IsStatic()&&body2.IsStatic())
+{return this.m_nullContact;}
+if(shape1.m_body==shape2.m_body)
+{return this.m_nullContact;}
+if(body2.IsConnected(body1))
+{return this.m_nullContact;}
+if(this.m_world.m_filter!=null&&this.m_world.m_filter.ShouldCollide(shape1,shape2)==false)
+{return this.m_nullContact;}
+if(body2.m_invMass==0.0)
+{var tempShape=shape1;shape1=shape2;shape2=tempShape;var tempBody=body1;body1=body2;body2=tempBody;}
+var contact=b2Contact.Create(shape1,shape2,this.m_world.m_blockAllocator);if(contact==null)
+{return this.m_nullContact;}
+else
+{contact.m_prev=null;contact.m_next=this.m_world.m_contactList;if(this.m_world.m_contactList!=null)
+{this.m_world.m_contactList.m_prev=contact;}
+this.m_world.m_contactList=contact;this.m_world.m_contactCount++;}
+return contact;},PairRemoved:function(proxyUserData1,proxyUserData2,pairUserData){if(pairUserData==null)
+{return;}
+var c=pairUserData;if(c!=this.m_nullContact)
+{if(this.m_destroyImmediate==true)
+{this.DestroyContact(c);c=null;}
+else
+{c.m_flags|=b2Contact.e_destroyFlag;}}},DestroyContact:function(c)
+{if(c.m_prev)
+{c.m_prev.m_next=c.m_next;}
+if(c.m_next)
+{c.m_next.m_prev=c.m_prev;}
+if(c==this.m_world.m_contactList)
+{this.m_world.m_contactList=c.m_next;}
+if(c.GetManifoldCount()>0)
+{var body1=c.m_shape1.m_body;var body2=c.m_shape2.m_body;var node1=c.m_node1;var node2=c.m_node2;body1.WakeUp();body2.WakeUp();if(node1.prev)
+{node1.prev.next=node1.next;}
+if(node1.next)
+{node1.next.prev=node1.prev;}
+if(node1==body1.m_contactList)
+{body1.m_contactList=node1.next;}
+node1.prev=null;node1.next=null;if(node2.prev)
+{node2.prev.next=node2.next;}
+if(node2.next)
+{node2.next.prev=node2.prev;}
+if(node2==body2.m_contactList)
+{body2.m_contactList=node2.next;}
+node2.prev=null;node2.next=null;}
+b2Contact.Destroy(c,this.m_world.m_blockAllocator);--this.m_world.m_contactCount;},CleanContactList:function()
+{var c=this.m_world.m_contactList;while(c!=null)
+{var c0=c;c=c.m_next;if(c0.m_flags&b2Contact.e_destroyFlag)
+{this.DestroyContact(c0);c0=null;}}},Collide:function()
+{var body1;var body2;var node1;var node2;for(var c=this.m_world.m_contactList;c!=null;c=c.m_next)
+{if(c.m_shape1.m_body.IsSleeping()&&c.m_shape2.m_body.IsSleeping())
+{continue;}
+var oldCount=c.GetManifoldCount();c.Evaluate();var newCount=c.GetManifoldCount();if(oldCount==0&&newCount>0)
+{body1=c.m_shape1.m_body;body2=c.m_shape2.m_body;node1=c.m_node1;node2=c.m_node2;node1.contact=c;node1.other=body2;node1.prev=null;node1.next=body1.m_contactList;if(node1.next!=null)
+{node1.next.prev=c.m_node1;}
+body1.m_contactList=c.m_node1;node2.contact=c;node2.other=body1;node2.prev=null;node2.next=body2.m_contactList;if(node2.next!=null)
+{node2.next.prev=node2;}
+body2.m_contactList=node2;}
+else if(oldCount>0&&newCount==0)
+{body1=c.m_shape1.m_body;body2=c.m_shape2.m_body;node1=c.m_node1;node2=c.m_node2;if(node1.prev)
+{node1.prev.next=node1.next;}
+if(node1.next)
+{node1.next.prev=node1.prev;}
+if(node1==body1.m_contactList)
+{body1.m_contactList=node1.next;}
+node1.prev=null;node1.next=null;if(node2.prev)
+{node2.prev.next=node2.next;}
+if(node2.next)
+{node2.next.prev=node2.prev;}
+if(node2==body2.m_contactList)
+{body2.m_contactList=node2.next;}
+node2.prev=null;node2.next=null;}}},m_world:null,m_nullContact:new b2NullContact(),m_destroyImmediate:null});
+var b2World=Class.create();b2World.prototype={initialize:function(worldAABB,gravity,doSleep){this.step=new b2TimeStep();this.m_contactManager=new b2ContactManager();this.m_listener=null;this.m_filter=b2CollisionFilter.b2_defaultFilter;this.m_bodyList=null;this.m_contactList=null;this.m_jointList=null;this.m_bodyCount=0;this.m_contactCount=0;this.m_jointCount=0;this.m_bodyDestroyList=null;this.m_allowSleep=doSleep;this.m_gravity=gravity;this.m_contactManager.m_world=this;this.m_broadPhase=new b2BroadPhase(worldAABB,this.m_contactManager);var bd=new b2BodyDef();this.m_groundBody=this.CreateBody(bd);},SetListener:function(listener){this.m_listener=listener;},SetFilter:function(filter){this.m_filter=filter;},CreateBody:function(def){var b=new b2Body(def,this);b.m_prev=null;b.m_next=this.m_bodyList;if(this.m_bodyList)
+{this.m_bodyList.m_prev=b;}
+this.m_bodyList=b;++this.m_bodyCount;return b;},DestroyBody:function(b)
+{if(b.m_flags&b2Body.e_destroyFlag)
+{return;}
+if(b.m_prev)
+{b.m_prev.m_next=b.m_next;}
+if(b.m_next)
+{b.m_next.m_prev=b.m_prev;}
+if(b==this.m_bodyList)
+{this.m_bodyList=b.m_next;}
+b.m_flags|=b2Body.e_destroyFlag;--this.m_bodyCount;b.m_prev=null;b.m_next=this.m_bodyDestroyList;this.m_bodyDestroyList=b;},CleanBodyList:function()
+{this.m_contactManager.m_destroyImmediate=true;var b=this.m_bodyDestroyList;while(b)
+{var b0=b;b=b.m_next;var jn=b0.m_jointList;while(jn)
+{var jn0=jn;jn=jn.next;if(this.m_listener)
+{this.m_listener.NotifyJointDestroyed(jn0.joint);}
+this.DestroyJoint(jn0.joint);}
+b0.Destroy();}
+this.m_bodyDestroyList=null;this.m_contactManager.m_destroyImmediate=false;},CreateJoint:function(def){var j=b2Joint.Create(def,this.m_blockAllocator);j.m_prev=null;j.m_next=this.m_jointList;if(this.m_jointList)
+{this.m_jointList.m_prev=j;}
+this.m_jointList=j;++this.m_jointCount;j.m_node1.joint=j;j.m_node1.other=j.m_body2;j.m_node1.prev=null;j.m_node1.next=j.m_body1.m_jointList;if(j.m_body1.m_jointList)j.m_body1.m_jointList.prev=j.m_node1;j.m_body1.m_jointList=j.m_node1;j.m_node2.joint=j;j.m_node2.other=j.m_body1;j.m_node2.prev=null;j.m_node2.next=j.m_body2.m_jointList;if(j.m_body2.m_jointList)j.m_body2.m_jointList.prev=j.m_node2;j.m_body2.m_jointList=j.m_node2;if(def.collideConnected==false)
+{var b=def.body1.m_shapeCount<def.body2.m_shapeCount?def.body1:def.body2;for(var s=b.m_shapeList;s;s=s.m_next)
+{s.ResetProxy(this.m_broadPhase);}}
+return j;},DestroyJoint:function(j)
+{var collideConnected=j.m_collideConnected;if(j.m_prev)
+{j.m_prev.m_next=j.m_next;}
+if(j.m_next)
+{j.m_next.m_prev=j.m_prev;}
+if(j==this.m_jointList)
+{this.m_jointList=j.m_next;}
+var body1=j.m_body1;var body2=j.m_body2;body1.WakeUp();body2.WakeUp();if(j.m_node1.prev)
+{j.m_node1.prev.next=j.m_node1.next;}
+if(j.m_node1.next)
+{j.m_node1.next.prev=j.m_node1.prev;}
+if(j.m_node1==body1.m_jointList)
+{body1.m_jointList=j.m_node1.next;}
+j.m_node1.prev=null;j.m_node1.next=null;if(j.m_node2.prev)
+{j.m_node2.prev.next=j.m_node2.next;}
+if(j.m_node2.next)
+{j.m_node2.next.prev=j.m_node2.prev;}
+if(j.m_node2==body2.m_jointList)
+{body2.m_jointList=j.m_node2.next;}
+j.m_node2.prev=null;j.m_node2.next=null;b2Joint.Destroy(j,this.m_blockAllocator);--this.m_jointCount;if(collideConnected==false)
+{var b=body1.m_shapeCount<body2.m_shapeCount?body1:body2;for(var s=b.m_shapeList;s;s=s.m_next)
+{s.ResetProxy(this.m_broadPhase);}}},GetGroundBody:function(){return this.m_groundBody;},step:new b2TimeStep(),Step:function(dt,iterations){var b;var other;this.step.dt=dt;this.step.iterations=iterations;if(dt>0.0)
+{this.step.inv_dt=1.0/dt;}
+else
+{this.step.inv_dt=0.0;}
+this.m_positionIterationCount=0;this.m_contactManager.CleanContactList();this.CleanBodyList();this.m_contactManager.Collide();var island=new b2Island(this.m_bodyCount,this.m_contactCount,this.m_jointCount,this.m_stackAllocator);for(b=this.m_bodyList;b!=null;b=b.m_next)
+{b.m_flags&=~b2Body.e_islandFlag;}
+for(var c=this.m_contactList;c!=null;c=c.m_next)
+{c.m_flags&=~b2Contact.e_islandFlag;}
+for(var j=this.m_jointList;j!=null;j=j.m_next)
+{j.m_islandFlag=false;}
+var stackSize=this.m_bodyCount;var stack=new Array(this.m_bodyCount);for(var k=0;k<this.m_bodyCount;k++)
+stack[k]=null;for(var seed=this.m_bodyList;seed!=null;seed=seed.m_next)
+{if(seed.m_flags&(b2Body.e_staticFlag|b2Body.e_islandFlag|b2Body.e_sleepFlag|b2Body.e_frozenFlag))
+{continue;}
+island.Clear();var stackCount=0;stack[stackCount++]=seed;seed.m_flags|=b2Body.e_islandFlag;;while(stackCount>0)
+{b=stack[--stackCount];island.AddBody(b);b.m_flags&=~b2Body.e_sleepFlag;if(b.m_flags&b2Body.e_staticFlag)
+{continue;}
+for(var cn=b.m_contactList;cn!=null;cn=cn.next)
+{if(cn.contact.m_flags&b2Contact.e_islandFlag)
+{continue;}
+island.AddContact(cn.contact);cn.contact.m_flags|=b2Contact.e_islandFlag;other=cn.other;if(other.m_flags&b2Body.e_islandFlag)
+{continue;}
+stack[stackCount++]=other;other.m_flags|=b2Body.e_islandFlag;}
+for(var jn=b.m_jointList;jn!=null;jn=jn.next)
+{if(jn.joint.m_islandFlag==true)
+{continue;}
+island.AddJoint(jn.joint);jn.joint.m_islandFlag=true;other=jn.other;if(other.m_flags&b2Body.e_islandFlag)
+{continue;}
+stack[stackCount++]=other;other.m_flags|=b2Body.e_islandFlag;}}
+island.Solve(this.step,this.m_gravity);this.m_positionIterationCount=b2Math.b2Max(this.m_positionIterationCount,b2Island.m_positionIterationCount);if(this.m_allowSleep)
+{island.UpdateSleep(dt);}
+for(var i=0;i<island.m_bodyCount;++i)
+{b=island.m_bodies[i];if(b.m_flags&b2Body.e_staticFlag)
+{b.m_flags&=~b2Body.e_islandFlag;}
+if(b.IsFrozen()&&this.m_listener)
+{var response=this.m_listener.NotifyBoundaryViolated(b);if(response==b2WorldListener.b2_destroyBody)
+{this.DestroyBody(b);b=null;island.m_bodies[i]=null;}}}}
+this.m_broadPhase.Commit();},Query:function(aabb,shapes,maxCount){var results=new Array();var count=this.m_broadPhase.QueryAABB(aabb,results,maxCount);for(var i=0;i<count;++i)
+{shapes[i]=results[i];}
+return count;},GetBodyList:function(){return this.m_bodyList;},GetJointList:function(){return this.m_jointList;},GetContactList:function(){return this.m_contactList;},m_blockAllocator:null,m_stackAllocator:null,m_broadPhase:null,m_contactManager:new b2ContactManager(),m_bodyList:null,m_contactList:null,m_jointList:null,m_bodyCount:0,m_contactCount:0,m_jointCount:0,m_bodyDestroyList:null,m_gravity:null,m_allowSleep:null,m_groundBody:null,m_listener:null,m_filter:null,m_positionIterationCount:0};b2World.s_enablePositionCorrection=1;b2World.s_enableWarmStarting=1;
+var b2WorldListener=Class.create();b2WorldListener.prototype={NotifyJointDestroyed:function(joint){},NotifyBoundaryViolated:function(body)
+{return b2WorldListener.b2_freezeBody;},initialize:function(){}};b2WorldListener.b2_freezeBody=0;b2WorldListener.b2_destroyBody=1;
+var b2JointNode=Class.create();b2JointNode.prototype={other:null,joint:null,prev:null,next:null,initialize:function(){}}
+
+var b2Joint=Class.create();b2Joint.prototype={GetType:function(){return this.m_type;},GetAnchor1:function(){return null},GetAnchor2:function(){return null},GetReactionForce:function(invTimeStep){return null},GetReactionTorque:function(invTimeStep){return 0.0},GetBody1:function()
+{return this.m_body1;},GetBody2:function()
+{return this.m_body2;},GetNext:function(){return this.m_next;},GetUserData:function(){return this.m_userData;},initialize:function(def){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=def.type;this.m_prev=null;this.m_next=null;this.m_body1=def.body1;this.m_body2=def.body2;this.m_collideConnected=def.collideConnected;this.m_islandFlag=false;this.m_userData=def.userData;},PrepareVelocitySolver:function(){},SolveVelocityConstraints:function(step){},PreparePositionSolver:function(){},SolvePositionConstraints:function(){return false},m_type:0,m_prev:null,m_next:null,m_node1:new b2JointNode(),m_node2:new b2JointNode(),m_body1:null,m_body2:null,m_islandFlag:null,m_collideConnected:null,m_userData:null};b2Joint.Create=function(def,allocator){var joint=null;switch(def.type)
+{case b2Joint.e_distanceJoint:{joint=new b2DistanceJoint(def);}
+break;case b2Joint.e_mouseJoint:{joint=new b2MouseJoint(def);}
+break;case b2Joint.e_prismaticJoint:{joint=new b2PrismaticJoint(def);}
+break;case b2Joint.e_revoluteJoint:{joint=new b2RevoluteJoint(def);}
+break;case b2Joint.e_pulleyJoint:{joint=new b2PulleyJoint(def);}
+break;case b2Joint.e_gearJoint:{joint=new b2GearJoint(def);}
+break;default:break;}
+return joint;};b2Joint.Destroy=function(joint,allocator){};b2Joint.e_unknownJoint=0;b2Joint.e_revoluteJoint=1;b2Joint.e_prismaticJoint=2;b2Joint.e_distanceJoint=3;b2Joint.e_pulleyJoint=4;b2Joint.e_mouseJoint=5;b2Joint.e_gearJoint=6;b2Joint.e_inactiveLimit=0;b2Joint.e_atLowerLimit=1;b2Joint.e_atUpperLimit=2;b2Joint.e_equalLimits=3;
+var b2JointDef=Class.create();b2JointDef.prototype={initialize:function()
+{this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;},type:0,userData:null,body1:null,body2:null,collideConnected:null}
+
+var b2DistanceJoint=Class.create();Object.extend(b2DistanceJoint.prototype,b2Joint.prototype);Object.extend(b2DistanceJoint.prototype,{initialize:function(def){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=def.type;this.m_prev=null;this.m_next=null;this.m_body1=def.body1;this.m_body2=def.body2;this.m_collideConnected=def.collideConnected;this.m_islandFlag=false;this.m_userData=def.userData;this.m_localAnchor1=new b2Vec2();this.m_localAnchor2=new b2Vec2();this.m_u=new b2Vec2();var tMat;var tX;var tY;tMat=this.m_body1.m_R;tX=def.anchorPoint1.x-this.m_body1.m_position.x;tY=def.anchorPoint1.y-this.m_body1.m_position.y;this.m_localAnchor1.x=tX*tMat.col1.x+tY*tMat.col1.y;this.m_localAnchor1.y=tX*tMat.col2.x+tY*tMat.col2.y;tMat=this.m_body2.m_R;tX=def.anchorPoint2.x-this.m_body2.m_position.x;tY=def.anchorPoint2.y-this.m_body2.m_position.y;this.m_localAnchor2.x=tX*tMat.col1.x+tY*tMat.col1.y;this.m_localAnchor2.y=tX*tMat.col2.x+tY*tMat.col2.y;tX=def.anchorPoint2.x-def.anchorPoint1.x;tY=def.anchorPoint2.y-def.anchorPoint1.y;this.m_length=Math.sqrt(tX*tX+tY*tY);this.m_impulse=0.0;},PrepareVelocitySolver:function(){var tMat;tMat=this.m_body1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=this.m_body2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;this.m_u.x=this.m_body2.m_position.x+r2X-this.m_body1.m_position.x-r1X;this.m_u.y=this.m_body2.m_position.y+r2Y-this.m_body1.m_position.y-r1Y;var length=Math.sqrt(this.m_u.x*this.m_u.x+this.m_u.y*this.m_u.y);if(length>b2Settings.b2_linearSlop)
+{this.m_u.Multiply(1.0/length);}
+else
+{this.m_u.SetZero();}
+var cr1u=(r1X*this.m_u.y-r1Y*this.m_u.x);var cr2u=(r2X*this.m_u.y-r2Y*this.m_u.x);this.m_mass=this.m_body1.m_invMass+this.m_body1.m_invI*cr1u*cr1u+this.m_body2.m_invMass+this.m_body2.m_invI*cr2u*cr2u;this.m_mass=1.0/this.m_mass;if(b2World.s_enableWarmStarting)
+{var PX=this.m_impulse*this.m_u.x;var PY=this.m_impulse*this.m_u.y;this.m_body1.m_linearVelocity.x-=this.m_body1.m_invMass*PX;this.m_body1.m_linearVelocity.y-=this.m_body1.m_invMass*PY;this.m_body1.m_angularVelocity-=this.m_body1.m_invI*(r1X*PY-r1Y*PX);this.m_body2.m_linearVelocity.x+=this.m_body2.m_invMass*PX;this.m_body2.m_linearVelocity.y+=this.m_body2.m_invMass*PY;this.m_body2.m_angularVelocity+=this.m_body2.m_invI*(r2X*PY-r2Y*PX);}
+else
+{this.m_impulse=0.0;}},SolveVelocityConstraints:function(step){var tMat;tMat=this.m_body1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=this.m_body2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var v1X=this.m_body1.m_linearVelocity.x+(-this.m_body1.m_angularVelocity*r1Y);var v1Y=this.m_body1.m_linearVelocity.y+(this.m_body1.m_angularVelocity*r1X);var v2X=this.m_body2.m_linearVelocity.x+(-this.m_body2.m_angularVelocity*r2Y);var v2Y=this.m_body2.m_linearVelocity.y+(this.m_body2.m_angularVelocity*r2X);var Cdot=(this.m_u.x*(v2X-v1X)+this.m_u.y*(v2Y-v1Y));var impulse=-this.m_mass*Cdot;this.m_impulse+=impulse;var PX=impulse*this.m_u.x;var PY=impulse*this.m_u.y;this.m_body1.m_linearVelocity.x-=this.m_body1.m_invMass*PX;this.m_body1.m_linearVelocity.y-=this.m_body1.m_invMass*PY;this.m_body1.m_angularVelocity-=this.m_body1.m_invI*(r1X*PY-r1Y*PX);this.m_body2.m_linearVelocity.x+=this.m_body2.m_invMass*PX;this.m_body2.m_linearVelocity.y+=this.m_body2.m_invMass*PY;this.m_body2.m_angularVelocity+=this.m_body2.m_invI*(r2X*PY-r2Y*PX);},SolvePositionConstraints:function(){var tMat;tMat=this.m_body1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=this.m_body2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var dX=this.m_body2.m_position.x+r2X-this.m_body1.m_position.x-r1X;var dY=this.m_body2.m_position.y+r2Y-this.m_body1.m_position.y-r1Y;var length=Math.sqrt(dX*dX+dY*dY);dX/=length;dY/=length;var C=length-this.m_length;C=b2Math.b2Clamp(C,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);var impulse=-this.m_mass*C;this.m_u.Set(dX,dY);var PX=impulse*this.m_u.x;var PY=impulse*this.m_u.y;this.m_body1.m_position.x-=this.m_body1.m_invMass*PX;this.m_body1.m_position.y-=this.m_body1.m_invMass*PY;this.m_body1.m_rotation-=this.m_body1.m_invI*(r1X*PY-r1Y*PX);this.m_body2.m_position.x+=this.m_body2.m_invMass*PX;this.m_body2.m_position.y+=this.m_body2.m_invMass*PY;this.m_body2.m_rotation+=this.m_body2.m_invI*(r2X*PY-r2Y*PX);this.m_body1.m_R.Set(this.m_body1.m_rotation);this.m_body2.m_R.Set(this.m_body2.m_rotation);return b2Math.b2Abs(C)<b2Settings.b2_linearSlop;},GetAnchor1:function(){return b2Math.AddVV(this.m_body1.m_position,b2Math.b2MulMV(this.m_body1.m_R,this.m_localAnchor1));},GetAnchor2:function(){return b2Math.AddVV(this.m_body2.m_position,b2Math.b2MulMV(this.m_body2.m_R,this.m_localAnchor2));},GetReactionForce:function(invTimeStep)
+{var F=new b2Vec2();F.SetV(this.m_u);F.Multiply(this.m_impulse*invTimeStep);return F;},GetReactionTorque:function(invTimeStep)
+{return 0.0;},m_localAnchor1:new b2Vec2(),m_localAnchor2:new b2Vec2(),m_u:new b2Vec2(),m_impulse:null,m_mass:null,m_length:null});
+var b2DistanceJointDef=Class.create();Object.extend(b2DistanceJointDef.prototype,b2JointDef.prototype);Object.extend(b2DistanceJointDef.prototype,{initialize:function()
+{this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.anchorPoint1=new b2Vec2();this.anchorPoint2=new b2Vec2();this.type=b2Joint.e_distanceJoint;},anchorPoint1:new b2Vec2(),anchorPoint2:new b2Vec2()});
+var b2Jacobian=Class.create();b2Jacobian.prototype={linear1:new b2Vec2(),angular1:null,linear2:new b2Vec2(),angular2:null,SetZero:function(){this.linear1.SetZero();this.angular1=0.0;this.linear2.SetZero();this.angular2=0.0;},Set:function(x1,a1,x2,a2){this.linear1.SetV(x1);this.angular1=a1;this.linear2.SetV(x2);this.angular2=a2;},Compute:function(x1,a1,x2,a2){return(this.linear1.x*x1.x+this.linear1.y*x1.y)+this.angular1*a1+(this.linear2.x*x2.x+this.linear2.y*x2.y)+this.angular2*a2;},initialize:function(){this.linear1=new b2Vec2();this.linear2=new b2Vec2();}};
+var b2GearJoint=Class.create();Object.extend(b2GearJoint.prototype,b2Joint.prototype);Object.extend(b2GearJoint.prototype,{GetAnchor1:function(){var tMat=this.m_body1.m_R;return new b2Vec2(this.m_body1.m_position.x+(tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y),this.m_body1.m_position.y+(tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y));},GetAnchor2:function(){var tMat=this.m_body2.m_R;return new b2Vec2(this.m_body2.m_position.x+(tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y),this.m_body2.m_position.y+(tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y));},GetReactionForce:function(invTimeStep){return new b2Vec2();},GetReactionTorque:function(invTimeStep){return 0.0;},GetRatio:function(){return this.m_ratio;},initialize:function(def){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=def.type;this.m_prev=null;this.m_next=null;this.m_body1=def.body1;this.m_body2=def.body2;this.m_collideConnected=def.collideConnected;this.m_islandFlag=false;this.m_userData=def.userData;this.m_groundAnchor1=new b2Vec2();this.m_groundAnchor2=new b2Vec2();this.m_localAnchor1=new b2Vec2();this.m_localAnchor2=new b2Vec2();this.m_J=new b2Jacobian();this.m_revolute1=null;this.m_prismatic1=null;this.m_revolute2=null;this.m_prismatic2=null;var coordinate1;var coordinate2;this.m_ground1=def.joint1.m_body1;this.m_body1=def.joint1.m_body2;if(def.joint1.m_type==b2Joint.e_revoluteJoint)
+{this.m_revolute1=def.joint1;this.m_groundAnchor1.SetV(this.m_revolute1.m_localAnchor1);this.m_localAnchor1.SetV(this.m_revolute1.m_localAnchor2);coordinate1=this.m_revolute1.GetJointAngle();}
+else
+{this.m_prismatic1=def.joint1;this.m_groundAnchor1.SetV(this.m_prismatic1.m_localAnchor1);this.m_localAnchor1.SetV(this.m_prismatic1.m_localAnchor2);coordinate1=this.m_prismatic1.GetJointTranslation();}
+this.m_ground2=def.joint2.m_body1;this.m_body2=def.joint2.m_body2;if(def.joint2.m_type==b2Joint.e_revoluteJoint)
+{this.m_revolute2=def.joint2;this.m_groundAnchor2.SetV(this.m_revolute2.m_localAnchor1);this.m_localAnchor2.SetV(this.m_revolute2.m_localAnchor2);coordinate2=this.m_revolute2.GetJointAngle();}
+else
+{this.m_prismatic2=def.joint2;this.m_groundAnchor2.SetV(this.m_prismatic2.m_localAnchor1);this.m_localAnchor2.SetV(this.m_prismatic2.m_localAnchor2);coordinate2=this.m_prismatic2.GetJointTranslation();}
+this.m_ratio=def.ratio;this.m_constant=coordinate1+this.m_ratio*coordinate2;this.m_impulse=0.0;},PrepareVelocitySolver:function(){var g1=this.m_ground1;var g2=this.m_ground2;var b1=this.m_body1;var b2=this.m_body2;var ugX;var ugY;var rX;var rY;var tMat;var tVec;var crug;var K=0.0;this.m_J.SetZero();if(this.m_revolute1)
+{this.m_J.angular1=-1.0;K+=b1.m_invI;}
+else
+{tMat=g1.m_R;tVec=this.m_prismatic1.m_localXAxis1;ugX=tMat.col1.x*tVec.x+tMat.col2.x*tVec.y;ugY=tMat.col1.y*tVec.x+tMat.col2.y*tVec.y;tMat=b1.m_R;rX=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;rY=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;crug=rX*ugY-rY*ugX;this.m_J.linear1.Set(-ugX,-ugY);this.m_J.angular1=-crug;K+=b1.m_invMass+b1.m_invI*crug*crug;}
+if(this.m_revolute2)
+{this.m_J.angular2=-this.m_ratio;K+=this.m_ratio*this.m_ratio*b2.m_invI;}
+else
+{tMat=g2.m_R;tVec=this.m_prismatic2.m_localXAxis1;ugX=tMat.col1.x*tVec.x+tMat.col2.x*tVec.y;ugY=tMat.col1.y*tVec.x+tMat.col2.y*tVec.y;tMat=b2.m_R;rX=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;rY=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;crug=rX*ugY-rY*ugX;this.m_J.linear2.Set(-this.m_ratio*ugX,-this.m_ratio*ugY);this.m_J.angular2=-this.m_ratio*crug;K+=this.m_ratio*this.m_ratio*(b2.m_invMass+b2.m_invI*crug*crug);}
+this.m_mass=1.0/K;b1.m_linearVelocity.x+=b1.m_invMass*this.m_impulse*this.m_J.linear1.x;b1.m_linearVelocity.y+=b1.m_invMass*this.m_impulse*this.m_J.linear1.y;b1.m_angularVelocity+=b1.m_invI*this.m_impulse*this.m_J.angular1;b2.m_linearVelocity.x+=b2.m_invMass*this.m_impulse*this.m_J.linear2.x;b2.m_linearVelocity.y+=b2.m_invMass*this.m_impulse*this.m_J.linear2.y;b2.m_angularVelocity+=b2.m_invI*this.m_impulse*this.m_J.angular2;},SolveVelocityConstraints:function(step){var b1=this.m_body1;var b2=this.m_body2;var Cdot=this.m_J.Compute(b1.m_linearVelocity,b1.m_angularVelocity,b2.m_linearVelocity,b2.m_angularVelocity);var impulse=-this.m_mass*Cdot;this.m_impulse+=impulse;b1.m_linearVelocity.x+=b1.m_invMass*impulse*this.m_J.linear1.x;b1.m_linearVelocity.y+=b1.m_invMass*impulse*this.m_J.linear1.y;b1.m_angularVelocity+=b1.m_invI*impulse*this.m_J.angular1;b2.m_linearVelocity.x+=b2.m_invMass*impulse*this.m_J.linear2.x;b2.m_linearVelocity.y+=b2.m_invMass*impulse*this.m_J.linear2.y;b2.m_angularVelocity+=b2.m_invI*impulse*this.m_J.angular2;},SolvePositionConstraints:function(){var linearError=0.0;var b1=this.m_body1;var b2=this.m_body2;var coordinate1;var coordinate2;if(this.m_revolute1)
+{coordinate1=this.m_revolute1.GetJointAngle();}
+else
+{coordinate1=this.m_prismatic1.GetJointTranslation();}
+if(this.m_revolute2)
+{coordinate2=this.m_revolute2.GetJointAngle();}
+else
+{coordinate2=this.m_prismatic2.GetJointTranslation();}
+var C=this.m_constant-(coordinate1+this.m_ratio*coordinate2);var impulse=-this.m_mass*C;b1.m_position.x+=b1.m_invMass*impulse*this.m_J.linear1.x;b1.m_position.y+=b1.m_invMass*impulse*this.m_J.linear1.y;b1.m_rotation+=b1.m_invI*impulse*this.m_J.angular1;b2.m_position.x+=b2.m_invMass*impulse*this.m_J.linear2.x;b2.m_position.y+=b2.m_invMass*impulse*this.m_J.linear2.y;b2.m_rotation+=b2.m_invI*impulse*this.m_J.angular2;b1.m_R.Set(b1.m_rotation);b2.m_R.Set(b2.m_rotation);return linearError<b2Settings.b2_linearSlop;},m_ground1:null,m_ground2:null,m_revolute1:null,m_prismatic1:null,m_revolute2:null,m_prismatic2:null,m_groundAnchor1:new b2Vec2(),m_groundAnchor2:new b2Vec2(),m_localAnchor1:new b2Vec2(),m_localAnchor2:new b2Vec2(),m_J:new b2Jacobian(),m_constant:null,m_ratio:null,m_mass:null,m_impulse:null});
+var b2GearJointDef=Class.create();Object.extend(b2GearJointDef.prototype,b2JointDef.prototype);Object.extend(b2GearJointDef.prototype,{initialize:function()
+{this.type=b2Joint.e_gearJoint;this.joint1=null;this.joint2=null;this.ratio=1.0;},joint1:null,joint2:null,ratio:null});
+var b2MouseJoint=Class.create();Object.extend(b2MouseJoint.prototype,b2Joint.prototype);Object.extend(b2MouseJoint.prototype,{GetAnchor1:function(){return this.m_target;},GetAnchor2:function(){var tVec=b2Math.b2MulMV(this.m_body2.m_R,this.m_localAnchor);tVec.Add(this.m_body2.m_position);return tVec;},GetReactionForce:function(invTimeStep)
+{var F=new b2Vec2();F.SetV(this.m_impulse);F.Multiply(invTimeStep);return F;},GetReactionTorque:function(invTimeStep)
+{return 0.0;},SetTarget:function(target){this.m_body2.WakeUp();this.m_target=target;},initialize:function(def){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=def.type;this.m_prev=null;this.m_next=null;this.m_body1=def.body1;this.m_body2=def.body2;this.m_collideConnected=def.collideConnected;this.m_islandFlag=false;this.m_userData=def.userData;this.K=new b2Mat22();this.K1=new b2Mat22();this.K2=new b2Mat22();this.m_localAnchor=new b2Vec2();this.m_target=new b2Vec2();this.m_impulse=new b2Vec2();this.m_ptpMass=new b2Mat22();this.m_C=new b2Vec2();this.m_target.SetV(def.target);var tX=this.m_target.x-this.m_body2.m_position.x;var tY=this.m_target.y-this.m_body2.m_position.y;this.m_localAnchor.x=(tX*this.m_body2.m_R.col1.x+tY*this.m_body2.m_R.col1.y);this.m_localAnchor.y=(tX*this.m_body2.m_R.col2.x+tY*this.m_body2.m_R.col2.y);this.m_maxForce=def.maxForce;this.m_impulse.SetZero();var mass=this.m_body2.m_mass;var omega=2.0*b2Settings.b2_pi*def.frequencyHz;var d=2.0*mass*def.dampingRatio*omega;var k=mass*omega*omega;this.m_gamma=1.0/(d+def.timeStep*k);this.m_beta=def.timeStep*k/(d+def.timeStep*k);},K:new b2Mat22(),K1:new b2Mat22(),K2:new b2Mat22(),PrepareVelocitySolver:function(){var b=this.m_body2;var tMat;tMat=b.m_R;var rX=tMat.col1.x*this.m_localAnchor.x+tMat.col2.x*this.m_localAnchor.y;var rY=tMat.col1.y*this.m_localAnchor.x+tMat.col2.y*this.m_localAnchor.y;var invMass=b.m_invMass;var invI=b.m_invI;this.K1.col1.x=invMass;this.K1.col2.x=0.0;this.K1.col1.y=0.0;this.K1.col2.y=invMass;this.K2.col1.x=invI*rY*rY;this.K2.col2.x=-invI*rX*rY;this.K2.col1.y=-invI*rX*rY;this.K2.col2.y=invI*rX*rX;this.K.SetM(this.K1);this.K.AddM(this.K2);this.K.col1.x+=this.m_gamma;this.K.col2.y+=this.m_gamma;this.K.Invert(this.m_ptpMass);this.m_C.x=b.m_position.x+rX-this.m_target.x;this.m_C.y=b.m_position.y+rY-this.m_target.y;b.m_angularVelocity*=0.98;var PX=this.m_impulse.x;var PY=this.m_impulse.y;b.m_linearVelocity.x+=invMass*PX;b.m_linearVelocity.y+=invMass*PY;b.m_angularVelocity+=invI*(rX*PY-rY*PX);},SolveVelocityConstraints:function(step){var body=this.m_body2;var tMat;tMat=body.m_R;var rX=tMat.col1.x*this.m_localAnchor.x+tMat.col2.x*this.m_localAnchor.y;var rY=tMat.col1.y*this.m_localAnchor.x+tMat.col2.y*this.m_localAnchor.y;var CdotX=body.m_linearVelocity.x+(-body.m_angularVelocity*rY);var CdotY=body.m_linearVelocity.y+(body.m_angularVelocity*rX);tMat=this.m_ptpMass;var tX=CdotX+(this.m_beta*step.inv_dt)*this.m_C.x+this.m_gamma*this.m_impulse.x;var tY=CdotY+(this.m_beta*step.inv_dt)*this.m_C.y+this.m_gamma*this.m_impulse.y;var impulseX=-(tMat.col1.x*tX+tMat.col2.x*tY);var impulseY=-(tMat.col1.y*tX+tMat.col2.y*tY);var oldImpulseX=this.m_impulse.x;var oldImpulseY=this.m_impulse.y;this.m_impulse.x+=impulseX;this.m_impulse.y+=impulseY;var length=this.m_impulse.Length();if(length>step.dt*this.m_maxForce)
+{this.m_impulse.Multiply(step.dt*this.m_maxForce/length);}
+impulseX=this.m_impulse.x-oldImpulseX;impulseY=this.m_impulse.y-oldImpulseY;body.m_linearVelocity.x+=body.m_invMass*impulseX;body.m_linearVelocity.y+=body.m_invMass*impulseY;body.m_angularVelocity+=body.m_invI*(rX*impulseY-rY*impulseX);},SolvePositionConstraints:function(){return true;},m_localAnchor:new b2Vec2(),m_target:new b2Vec2(),m_impulse:new b2Vec2(),m_ptpMass:new b2Mat22(),m_C:new b2Vec2(),m_maxForce:null,m_beta:null,m_gamma:null});
+var b2MouseJointDef=Class.create();Object.extend(b2MouseJointDef.prototype,b2JointDef.prototype);Object.extend(b2MouseJointDef.prototype,{initialize:function()
+{this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.target=new b2Vec2();this.type=b2Joint.e_mouseJoint;this.maxForce=0.0;this.frequencyHz=5.0;this.dampingRatio=0.7;this.timeStep=1.0/60.0;},target:new b2Vec2(),maxForce:null,frequencyHz:null,dampingRatio:null,timeStep:null});
+var b2PrismaticJoint=Class.create();Object.extend(b2PrismaticJoint.prototype,b2Joint.prototype);Object.extend(b2PrismaticJoint.prototype,{GetAnchor1:function(){var b1=this.m_body1;var tVec=new b2Vec2();tVec.SetV(this.m_localAnchor1);tVec.MulM(b1.m_R);tVec.Add(b1.m_position);return tVec;},GetAnchor2:function(){var b2=this.m_body2;var tVec=new b2Vec2();tVec.SetV(this.m_localAnchor2);tVec.MulM(b2.m_R);tVec.Add(b2.m_position);return tVec;},GetJointTranslation:function(){var b1=this.m_body1;var b2=this.m_body2;var tMat;tMat=b1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var p1X=b1.m_position.x+r1X;var p1Y=b1.m_position.y+r1Y;var p2X=b2.m_position.x+r2X;var p2Y=b2.m_position.y+r2Y;var dX=p2X-p1X;var dY=p2Y-p1Y;tMat=b1.m_R;var ax1X=tMat.col1.x*this.m_localXAxis1.x+tMat.col2.x*this.m_localXAxis1.y;var ax1Y=tMat.col1.y*this.m_localXAxis1.x+tMat.col2.y*this.m_localXAxis1.y;var translation=ax1X*dX+ax1Y*dY;return translation;},GetJointSpeed:function(){var b1=this.m_body1;var b2=this.m_body2;var tMat;tMat=b1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var p1X=b1.m_position.x+r1X;var p1Y=b1.m_position.y+r1Y;var p2X=b2.m_position.x+r2X;var p2Y=b2.m_position.y+r2Y;var dX=p2X-p1X;var dY=p2Y-p1Y;tMat=b1.m_R;var ax1X=tMat.col1.x*this.m_localXAxis1.x+tMat.col2.x*this.m_localXAxis1.y;var ax1Y=tMat.col1.y*this.m_localXAxis1.x+tMat.col2.y*this.m_localXAxis1.y;var v1=b1.m_linearVelocity;var v2=b2.m_linearVelocity;var w1=b1.m_angularVelocity;var w2=b2.m_angularVelocity;var speed=(dX*(-w1*ax1Y)+dY*(w1*ax1X))+(ax1X*(((v2.x+(-w2*r2Y))-v1.x)-(-w1*r1Y))+ax1Y*(((v2.y+(w2*r2X))-v1.y)-(w1*r1X)));return speed;},GetMotorForce:function(invTimeStep){return invTimeStep*this.m_motorImpulse;},SetMotorSpeed:function(speed)
+{this.m_motorSpeed=speed;},SetMotorForce:function(force)
+{this.m_maxMotorForce=force;},GetReactionForce:function(invTimeStep)
+{var tImp=invTimeStep*this.m_limitImpulse;var tMat;tMat=this.m_body1.m_R;var ax1X=tImp*(tMat.col1.x*this.m_localXAxis1.x+tMat.col2.x*this.m_localXAxis1.y);var ax1Y=tImp*(tMat.col1.y*this.m_localXAxis1.x+tMat.col2.y*this.m_localXAxis1.y);var ay1X=tImp*(tMat.col1.x*this.m_localYAxis1.x+tMat.col2.x*this.m_localYAxis1.y);var ay1Y=tImp*(tMat.col1.y*this.m_localYAxis1.x+tMat.col2.y*this.m_localYAxis1.y);return new b2Vec2(ax1X+ay1X,ax1Y+ay1Y);},GetReactionTorque:function(invTimeStep)
+{return invTimeStep*this.m_angularImpulse;},initialize:function(def){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=def.type;this.m_prev=null;this.m_next=null;this.m_body1=def.body1;this.m_body2=def.body2;this.m_collideConnected=def.collideConnected;this.m_islandFlag=false;this.m_userData=def.userData;this.m_localAnchor1=new b2Vec2();this.m_localAnchor2=new b2Vec2();this.m_localXAxis1=new b2Vec2();this.m_localYAxis1=new b2Vec2();this.m_linearJacobian=new b2Jacobian();this.m_motorJacobian=new b2Jacobian();var tMat;var tX;var tY;tMat=this.m_body1.m_R;tX=(def.anchorPoint.x-this.m_body1.m_position.x);tY=(def.anchorPoint.y-this.m_body1.m_position.y);this.m_localAnchor1.Set((tX*tMat.col1.x+tY*tMat.col1.y),(tX*tMat.col2.x+tY*tMat.col2.y));tMat=this.m_body2.m_R;tX=(def.anchorPoint.x-this.m_body2.m_position.x);tY=(def.anchorPoint.y-this.m_body2.m_position.y);this.m_localAnchor2.Set((tX*tMat.col1.x+tY*tMat.col1.y),(tX*tMat.col2.x+tY*tMat.col2.y));tMat=this.m_body1.m_R;tX=def.axis.x;tY=def.axis.y;this.m_localXAxis1.Set((tX*tMat.col1.x+tY*tMat.col1.y),(tX*tMat.col2.x+tY*tMat.col2.y));this.m_localYAxis1.x=-this.m_localXAxis1.y;this.m_localYAxis1.y=this.m_localXAxis1.x;this.m_initialAngle=this.m_body2.m_rotation-this.m_body1.m_rotation;this.m_linearJacobian.SetZero();this.m_linearMass=0.0;this.m_linearImpulse=0.0;this.m_angularMass=0.0;this.m_angularImpulse=0.0;this.m_motorJacobian.SetZero();this.m_motorMass=0.0;this.m_motorImpulse=0.0;this.m_limitImpulse=0.0;this.m_limitPositionImpulse=0.0;this.m_lowerTranslation=def.lowerTranslation;this.m_upperTranslation=def.upperTranslation;this.m_maxMotorForce=def.motorForce;this.m_motorSpeed=def.motorSpeed;this.m_enableLimit=def.enableLimit;this.m_enableMotor=def.enableMotor;},PrepareVelocitySolver:function(){var b1=this.m_body1;var b2=this.m_body2;var tMat;tMat=b1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var invMass1=b1.m_invMass;var invMass2=b2.m_invMass;var invI1=b1.m_invI;var invI2=b2.m_invI;tMat=b1.m_R;var ay1X=tMat.col1.x*this.m_localYAxis1.x+tMat.col2.x*this.m_localYAxis1.y;var ay1Y=tMat.col1.y*this.m_localYAxis1.x+tMat.col2.y*this.m_localYAxis1.y;var eX=b2.m_position.x+r2X-b1.m_position.x;var eY=b2.m_position.y+r2Y-b1.m_position.y;this.m_linearJacobian.linear1.x=-ay1X;this.m_linearJacobian.linear1.y=-ay1Y;this.m_linearJacobian.linear2.x=ay1X;this.m_linearJacobian.linear2.y=ay1Y;this.m_linearJacobian.angular1=-(eX*ay1Y-eY*ay1X);this.m_linearJacobian.angular2=r2X*ay1Y-r2Y*ay1X;this.m_linearMass=invMass1+invI1*this.m_linearJacobian.angular1*this.m_linearJacobian.angular1+
+invMass2+invI2*this.m_linearJacobian.angular2*this.m_linearJacobian.angular2;this.m_linearMass=1.0/this.m_linearMass;this.m_angularMass=1.0/(invI1+invI2);if(this.m_enableLimit||this.m_enableMotor)
+{tMat=b1.m_R;var ax1X=tMat.col1.x*this.m_localXAxis1.x+tMat.col2.x*this.m_localXAxis1.y;var ax1Y=tMat.col1.y*this.m_localXAxis1.x+tMat.col2.y*this.m_localXAxis1.y;this.m_motorJacobian.linear1.x=-ax1X;this.m_motorJacobian.linear1.y=-ax1Y;this.m_motorJacobian.linear2.x=ax1X;this.m_motorJacobian.linear2.y=ax1Y;this.m_motorJacobian.angular1=-(eX*ax1Y-eY*ax1X);this.m_motorJacobian.angular2=r2X*ax1Y-r2Y*ax1X;this.m_motorMass=invMass1+invI1*this.m_motorJacobian.angular1*this.m_motorJacobian.angular1+
+invMass2+invI2*this.m_motorJacobian.angular2*this.m_motorJacobian.angular2;this.m_motorMass=1.0/this.m_motorMass;if(this.m_enableLimit)
+{var dX=eX-r1X;var dY=eY-r1Y;var jointTranslation=ax1X*dX+ax1Y*dY;if(b2Math.b2Abs(this.m_upperTranslation-this.m_lowerTranslation)<2.0*b2Settings.b2_linearSlop)
+{this.m_limitState=b2Joint.e_equalLimits;}
+else if(jointTranslation<=this.m_lowerTranslation)
+{if(this.m_limitState!=b2Joint.e_atLowerLimit)
+{this.m_limitImpulse=0.0;}
+this.m_limitState=b2Joint.e_atLowerLimit;}
+else if(jointTranslation>=this.m_upperTranslation)
+{if(this.m_limitState!=b2Joint.e_atUpperLimit)
+{this.m_limitImpulse=0.0;}
+this.m_limitState=b2Joint.e_atUpperLimit;}
+else
+{this.m_limitState=b2Joint.e_inactiveLimit;this.m_limitImpulse=0.0;}}}
+if(this.m_enableMotor==false)
+{this.m_motorImpulse=0.0;}
+if(this.m_enableLimit==false)
+{this.m_limitImpulse=0.0;}
+if(b2World.s_enableWarmStarting)
+{var P1X=this.m_linearImpulse*this.m_linearJacobian.linear1.x+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear1.x;var P1Y=this.m_linearImpulse*this.m_linearJacobian.linear1.y+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear1.y;var P2X=this.m_linearImpulse*this.m_linearJacobian.linear2.x+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear2.x;var P2Y=this.m_linearImpulse*this.m_linearJacobian.linear2.y+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear2.y;var L1=this.m_linearImpulse*this.m_linearJacobian.angular1-this.m_angularImpulse+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.angular1;var L2=this.m_linearImpulse*this.m_linearJacobian.angular2+this.m_angularImpulse+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.angular2;b1.m_linearVelocity.x+=invMass1*P1X;b1.m_linearVelocity.y+=invMass1*P1Y;b1.m_angularVelocity+=invI1*L1;b2.m_linearVelocity.x+=invMass2*P2X;b2.m_linearVelocity.y+=invMass2*P2Y;b2.m_angularVelocity+=invI2*L2;}
+else
+{this.m_linearImpulse=0.0;this.m_angularImpulse=0.0;this.m_limitImpulse=0.0;this.m_motorImpulse=0.0;}
+this.m_limitPositionImpulse=0.0;},SolveVelocityConstraints:function(step){var b1=this.m_body1;var b2=this.m_body2;var invMass1=b1.m_invMass;var invMass2=b2.m_invMass;var invI1=b1.m_invI;var invI2=b2.m_invI;var oldLimitImpulse;var linearCdot=this.m_linearJacobian.Compute(b1.m_linearVelocity,b1.m_angularVelocity,b2.m_linearVelocity,b2.m_angularVelocity);var linearImpulse=-this.m_linearMass*linearCdot;this.m_linearImpulse+=linearImpulse;b1.m_linearVelocity.x+=(invMass1*linearImpulse)*this.m_linearJacobian.linear1.x;b1.m_linearVelocity.y+=(invMass1*linearImpulse)*this.m_linearJacobian.linear1.y;b1.m_angularVelocity+=invI1*linearImpulse*this.m_linearJacobian.angular1;b2.m_linearVelocity.x+=(invMass2*linearImpulse)*this.m_linearJacobian.linear2.x;b2.m_linearVelocity.y+=(invMass2*linearImpulse)*this.m_linearJacobian.linear2.y;b2.m_angularVelocity+=invI2*linearImpulse*this.m_linearJacobian.angular2;var angularCdot=b2.m_angularVelocity-b1.m_angularVelocity;var angularImpulse=-this.m_angularMass*angularCdot;this.m_angularImpulse+=angularImpulse;b1.m_angularVelocity-=invI1*angularImpulse;b2.m_angularVelocity+=invI2*angularImpulse;if(this.m_enableMotor&&this.m_limitState!=b2Joint.e_equalLimits)
+{var motorCdot=this.m_motorJacobian.Compute(b1.m_linearVelocity,b1.m_angularVelocity,b2.m_linearVelocity,b2.m_angularVelocity)-this.m_motorSpeed;var motorImpulse=-this.m_motorMass*motorCdot;var oldMotorImpulse=this.m_motorImpulse;this.m_motorImpulse=b2Math.b2Clamp(this.m_motorImpulse+motorImpulse,-step.dt*this.m_maxMotorForce,step.dt*this.m_maxMotorForce);motorImpulse=this.m_motorImpulse-oldMotorImpulse;b1.m_linearVelocity.x+=(invMass1*motorImpulse)*this.m_motorJacobian.linear1.x;b1.m_linearVelocity.y+=(invMass1*motorImpulse)*this.m_motorJacobian.linear1.y;b1.m_angularVelocity+=invI1*motorImpulse*this.m_motorJacobian.angular1;b2.m_linearVelocity.x+=(invMass2*motorImpulse)*this.m_motorJacobian.linear2.x;b2.m_linearVelocity.y+=(invMass2*motorImpulse)*this.m_motorJacobian.linear2.y;b2.m_angularVelocity+=invI2*motorImpulse*this.m_motorJacobian.angular2;}
+if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit)
+{var limitCdot=this.m_motorJacobian.Compute(b1.m_linearVelocity,b1.m_angularVelocity,b2.m_linearVelocity,b2.m_angularVelocity);var limitImpulse=-this.m_motorMass*limitCdot;if(this.m_limitState==b2Joint.e_equalLimits)
+{this.m_limitImpulse+=limitImpulse;}
+else if(this.m_limitState==b2Joint.e_atLowerLimit)
+{oldLimitImpulse=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Max(this.m_limitImpulse+limitImpulse,0.0);limitImpulse=this.m_limitImpulse-oldLimitImpulse;}
+else if(this.m_limitState==b2Joint.e_atUpperLimit)
+{oldLimitImpulse=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Min(this.m_limitImpulse+limitImpulse,0.0);limitImpulse=this.m_limitImpulse-oldLimitImpulse;}
+b1.m_linearVelocity.x+=(invMass1*limitImpulse)*this.m_motorJacobian.linear1.x;b1.m_linearVelocity.y+=(invMass1*limitImpulse)*this.m_motorJacobian.linear1.y;b1.m_angularVelocity+=invI1*limitImpulse*this.m_motorJacobian.angular1;b2.m_linearVelocity.x+=(invMass2*limitImpulse)*this.m_motorJacobian.linear2.x;b2.m_linearVelocity.y+=(invMass2*limitImpulse)*this.m_motorJacobian.linear2.y;b2.m_angularVelocity+=invI2*limitImpulse*this.m_motorJacobian.angular2;}},SolvePositionConstraints:function(){var limitC;var oldLimitImpulse;var b1=this.m_body1;var b2=this.m_body2;var invMass1=b1.m_invMass;var invMass2=b2.m_invMass;var invI1=b1.m_invI;var invI2=b2.m_invI;var tMat;tMat=b1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var p1X=b1.m_position.x+r1X;var p1Y=b1.m_position.y+r1Y;var p2X=b2.m_position.x+r2X;var p2Y=b2.m_position.y+r2Y;var dX=p2X-p1X;var dY=p2Y-p1Y;tMat=b1.m_R;var ay1X=tMat.col1.x*this.m_localYAxis1.x+tMat.col2.x*this.m_localYAxis1.y;var ay1Y=tMat.col1.y*this.m_localYAxis1.x+tMat.col2.y*this.m_localYAxis1.y;var linearC=ay1X*dX+ay1Y*dY;linearC=b2Math.b2Clamp(linearC,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);var linearImpulse=-this.m_linearMass*linearC;b1.m_position.x+=(invMass1*linearImpulse)*this.m_linearJacobian.linear1.x;b1.m_position.y+=(invMass1*linearImpulse)*this.m_linearJacobian.linear1.y;b1.m_rotation+=invI1*linearImpulse*this.m_linearJacobian.angular1;b2.m_position.x+=(invMass2*linearImpulse)*this.m_linearJacobian.linear2.x;b2.m_position.y+=(invMass2*linearImpulse)*this.m_linearJacobian.linear2.y;b2.m_rotation+=invI2*linearImpulse*this.m_linearJacobian.angular2;var positionError=b2Math.b2Abs(linearC);var angularC=b2.m_rotation-b1.m_rotation-this.m_initialAngle;angularC=b2Math.b2Clamp(angularC,-b2Settings.b2_maxAngularCorrection,b2Settings.b2_maxAngularCorrection);var angularImpulse=-this.m_angularMass*angularC;b1.m_rotation-=b1.m_invI*angularImpulse;b1.m_R.Set(b1.m_rotation);b2.m_rotation+=b2.m_invI*angularImpulse;b2.m_R.Set(b2.m_rotation);var angularError=b2Math.b2Abs(angularC);if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit)
+{tMat=b1.m_R;r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;p1X=b1.m_position.x+r1X;p1Y=b1.m_position.y+r1Y;p2X=b2.m_position.x+r2X;p2Y=b2.m_position.y+r2Y;dX=p2X-p1X;dY=p2Y-p1Y;tMat=b1.m_R;var ax1X=tMat.col1.x*this.m_localXAxis1.x+tMat.col2.x*this.m_localXAxis1.y;var ax1Y=tMat.col1.y*this.m_localXAxis1.x+tMat.col2.y*this.m_localXAxis1.y;var translation=(ax1X*dX+ax1Y*dY);var limitImpulse=0.0;if(this.m_limitState==b2Joint.e_equalLimits)
+{limitC=b2Math.b2Clamp(translation,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);limitImpulse=-this.m_motorMass*limitC;positionError=b2Math.b2Max(positionError,b2Math.b2Abs(angularC));}
+else if(this.m_limitState==b2Joint.e_atLowerLimit)
+{limitC=translation-this.m_lowerTranslation;positionError=b2Math.b2Max(positionError,-limitC);limitC=b2Math.b2Clamp(limitC+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0.0);limitImpulse=-this.m_motorMass*limitC;oldLimitImpulse=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Max(this.m_limitPositionImpulse+limitImpulse,0.0);limitImpulse=this.m_limitPositionImpulse-oldLimitImpulse;}
+else if(this.m_limitState==b2Joint.e_atUpperLimit)
+{limitC=translation-this.m_upperTranslation;positionError=b2Math.b2Max(positionError,limitC);limitC=b2Math.b2Clamp(limitC-b2Settings.b2_linearSlop,0.0,b2Settings.b2_maxLinearCorrection);limitImpulse=-this.m_motorMass*limitC;oldLimitImpulse=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Min(this.m_limitPositionImpulse+limitImpulse,0.0);limitImpulse=this.m_limitPositionImpulse-oldLimitImpulse;}
+b1.m_position.x+=(invMass1*limitImpulse)*this.m_motorJacobian.linear1.x;b1.m_position.y+=(invMass1*limitImpulse)*this.m_motorJacobian.linear1.y;b1.m_rotation+=invI1*limitImpulse*this.m_motorJacobian.angular1;b1.m_R.Set(b1.m_rotation);b2.m_position.x+=(invMass2*limitImpulse)*this.m_motorJacobian.linear2.x;b2.m_position.y+=(invMass2*limitImpulse)*this.m_motorJacobian.linear2.y;b2.m_rotation+=invI2*limitImpulse*this.m_motorJacobian.angular2;b2.m_R.Set(b2.m_rotation);}
+return positionError<=b2Settings.b2_linearSlop&&angularError<=b2Settings.b2_angularSlop;},m_localAnchor1:new b2Vec2(),m_localAnchor2:new b2Vec2(),m_localXAxis1:new b2Vec2(),m_localYAxis1:new b2Vec2(),m_initialAngle:null,m_linearJacobian:new b2Jacobian(),m_linearMass:null,m_linearImpulse:null,m_angularMass:null,m_angularImpulse:null,m_motorJacobian:new b2Jacobian(),m_motorMass:null,m_motorImpulse:null,m_limitImpulse:null,m_limitPositionImpulse:null,m_lowerTranslation:null,m_upperTranslation:null,m_maxMotorForce:null,m_motorSpeed:null,m_enableLimit:null,m_enableMotor:null,m_limitState:0});
+var b2PrismaticJointDef=Class.create();Object.extend(b2PrismaticJointDef.prototype,b2JointDef.prototype);Object.extend(b2PrismaticJointDef.prototype,{initialize:function()
+{this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.type=b2Joint.e_prismaticJoint;this.anchorPoint=new b2Vec2(0.0,0.0);this.axis=new b2Vec2(0.0,0.0);this.lowerTranslation=0.0;this.upperTranslation=0.0;this.motorForce=0.0;this.motorSpeed=0.0;this.enableLimit=false;this.enableMotor=false;},anchorPoint:null,axis:null,lowerTranslation:null,upperTranslation:null,motorForce:null,motorSpeed:null,enableLimit:null,enableMotor:null});
+var b2PulleyJoint=Class.create();Object.extend(b2PulleyJoint.prototype,b2Joint.prototype);Object.extend(b2PulleyJoint.prototype,{GetAnchor1:function(){var tMat=this.m_body1.m_R;return new b2Vec2(this.m_body1.m_position.x+(tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y),this.m_body1.m_position.y+(tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y));},GetAnchor2:function(){var tMat=this.m_body2.m_R;return new b2Vec2(this.m_body2.m_position.x+(tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y),this.m_body2.m_position.y+(tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y));},GetGroundPoint1:function(){return new b2Vec2(this.m_ground.m_position.x+this.m_groundAnchor1.x,this.m_ground.m_position.y+this.m_groundAnchor1.y);},GetGroundPoint2:function(){return new b2Vec2(this.m_ground.m_position.x+this.m_groundAnchor2.x,this.m_ground.m_position.y+this.m_groundAnchor2.y);},GetReactionForce:function(invTimeStep){return new b2Vec2();},GetReactionTorque:function(invTimeStep){return 0.0;},GetLength1:function(){var tMat;tMat=this.m_body1.m_R;var pX=this.m_body1.m_position.x+(tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y);var pY=this.m_body1.m_position.y+(tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y);var dX=pX-(this.m_ground.m_position.x+this.m_groundAnchor1.x);var dY=pY-(this.m_ground.m_position.y+this.m_groundAnchor1.y);return Math.sqrt(dX*dX+dY*dY);},GetLength2:function(){var tMat;tMat=this.m_body2.m_R;var pX=this.m_body2.m_position.x+(tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y);var pY=this.m_body2.m_position.y+(tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y);var dX=pX-(this.m_ground.m_position.x+this.m_groundAnchor2.x);var dY=pY-(this.m_ground.m_position.y+this.m_groundAnchor2.y);return Math.sqrt(dX*dX+dY*dY);},GetRatio:function(){return this.m_ratio;},initialize:function(def){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=def.type;this.m_prev=null;this.m_next=null;this.m_body1=def.body1;this.m_body2=def.body2;this.m_collideConnected=def.collideConnected;this.m_islandFlag=false;this.m_userData=def.userData;this.m_groundAnchor1=new b2Vec2();this.m_groundAnchor2=new b2Vec2();this.m_localAnchor1=new b2Vec2();this.m_localAnchor2=new b2Vec2();this.m_u1=new b2Vec2();this.m_u2=new b2Vec2();var tMat;var tX;var tY;this.m_ground=this.m_body1.m_world.m_groundBody;this.m_groundAnchor1.x=def.groundPoint1.x-this.m_ground.m_position.x;this.m_groundAnchor1.y=def.groundPoint1.y-this.m_ground.m_position.y;this.m_groundAnchor2.x=def.groundPoint2.x-this.m_ground.m_position.x;this.m_groundAnchor2.y=def.groundPoint2.y-this.m_ground.m_position.y;tMat=this.m_body1.m_R;tX=def.anchorPoint1.x-this.m_body1.m_position.x;tY=def.anchorPoint1.y-this.m_body1.m_position.y;this.m_localAnchor1.x=tX*tMat.col1.x+tY*tMat.col1.y;this.m_localAnchor1.y=tX*tMat.col2.x+tY*tMat.col2.y;tMat=this.m_body2.m_R;tX=def.anchorPoint2.x-this.m_body2.m_position.x;tY=def.anchorPoint2.y-this.m_body2.m_position.y;this.m_localAnchor2.x=tX*tMat.col1.x+tY*tMat.col1.y;this.m_localAnchor2.y=tX*tMat.col2.x+tY*tMat.col2.y;this.m_ratio=def.ratio;tX=def.groundPoint1.x-def.anchorPoint1.x;tY=def.groundPoint1.y-def.anchorPoint1.y;var d1Len=Math.sqrt(tX*tX+tY*tY);tX=def.groundPoint2.x-def.anchorPoint2.x;tY=def.groundPoint2.y-def.anchorPoint2.y;var d2Len=Math.sqrt(tX*tX+tY*tY);var length1=b2Math.b2Max(0.5*b2PulleyJoint.b2_minPulleyLength,d1Len);var length2=b2Math.b2Max(0.5*b2PulleyJoint.b2_minPulleyLength,d2Len);this.m_constant=length1+this.m_ratio*length2;this.m_maxLength1=b2Math.b2Clamp(def.maxLength1,length1,this.m_constant-this.m_ratio*b2PulleyJoint.b2_minPulleyLength);this.m_maxLength2=b2Math.b2Clamp(def.maxLength2,length2,(this.m_constant-b2PulleyJoint.b2_minPulleyLength)/this.m_ratio);this.m_pulleyImpulse=0.0;this.m_limitImpulse1=0.0;this.m_limitImpulse2=0.0;},PrepareVelocitySolver:function(){var b1=this.m_body1;var b2=this.m_body2;var tMat;tMat=b1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var p1X=b1.m_position.x+r1X;var p1Y=b1.m_position.y+r1Y;var p2X=b2.m_position.x+r2X;var p2Y=b2.m_position.y+r2Y;var s1X=this.m_ground.m_position.x+this.m_groundAnchor1.x;var s1Y=this.m_ground.m_position.y+this.m_groundAnchor1.y;var s2X=this.m_ground.m_position.x+this.m_groundAnchor2.x;var s2Y=this.m_ground.m_position.y+this.m_groundAnchor2.y;this.m_u1.Set(p1X-s1X,p1Y-s1Y);this.m_u2.Set(p2X-s2X,p2Y-s2Y);var length1=this.m_u1.Length();var length2=this.m_u2.Length();if(length1>b2Settings.b2_linearSlop)
+{this.m_u1.Multiply(1.0/length1);}
+else
+{this.m_u1.SetZero();}
+if(length2>b2Settings.b2_linearSlop)
+{this.m_u2.Multiply(1.0/length2);}
+else
+{this.m_u2.SetZero();}
+if(length1<this.m_maxLength1)
+{this.m_limitState1=b2Joint.e_inactiveLimit;this.m_limitImpulse1=0.0;}
+else
+{this.m_limitState1=b2Joint.e_atUpperLimit;this.m_limitPositionImpulse1=0.0;}
+if(length2<this.m_maxLength2)
+{this.m_limitState2=b2Joint.e_inactiveLimit;this.m_limitImpulse2=0.0;}
+else
+{this.m_limitState2=b2Joint.e_atUpperLimit;this.m_limitPositionImpulse2=0.0;}
+var cr1u1=r1X*this.m_u1.y-r1Y*this.m_u1.x;var cr2u2=r2X*this.m_u2.y-r2Y*this.m_u2.x;this.m_limitMass1=b1.m_invMass+b1.m_invI*cr1u1*cr1u1;this.m_limitMass2=b2.m_invMass+b2.m_invI*cr2u2*cr2u2;this.m_pulleyMass=this.m_limitMass1+this.m_ratio*this.m_ratio*this.m_limitMass2;this.m_limitMass1=1.0/this.m_limitMass1;this.m_limitMass2=1.0/this.m_limitMass2;this.m_pulleyMass=1.0/this.m_pulleyMass;var P1X=(-this.m_pulleyImpulse-this.m_limitImpulse1)*this.m_u1.x;var P1Y=(-this.m_pulleyImpulse-this.m_limitImpulse1)*this.m_u1.y;var P2X=(-this.m_ratio*this.m_pulleyImpulse-this.m_limitImpulse2)*this.m_u2.x;var P2Y=(-this.m_ratio*this.m_pulleyImpulse-this.m_limitImpulse2)*this.m_u2.y;b1.m_linearVelocity.x+=b1.m_invMass*P1X;b1.m_linearVelocity.y+=b1.m_invMass*P1Y;b1.m_angularVelocity+=b1.m_invI*(r1X*P1Y-r1Y*P1X);b2.m_linearVelocity.x+=b2.m_invMass*P2X;b2.m_linearVelocity.y+=b2.m_invMass*P2Y;b2.m_angularVelocity+=b2.m_invI*(r2X*P2Y-r2Y*P2X);},SolveVelocityConstraints:function(step){var b1=this.m_body1;var b2=this.m_body2;var tMat;tMat=b1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var v1X;var v1Y;var v2X;var v2Y;var P1X;var P1Y;var P2X;var P2Y;var Cdot;var impulse;var oldLimitImpulse;v1X=b1.m_linearVelocity.x+(-b1.m_angularVelocity*r1Y);v1Y=b1.m_linearVelocity.y+(b1.m_angularVelocity*r1X);v2X=b2.m_linearVelocity.x+(-b2.m_angularVelocity*r2Y);v2Y=b2.m_linearVelocity.y+(b2.m_angularVelocity*r2X);Cdot=-(this.m_u1.x*v1X+this.m_u1.y*v1Y)-this.m_ratio*(this.m_u2.x*v2X+this.m_u2.y*v2Y);impulse=-this.m_pulleyMass*Cdot;this.m_pulleyImpulse+=impulse;P1X=-impulse*this.m_u1.x;P1Y=-impulse*this.m_u1.y;P2X=-this.m_ratio*impulse*this.m_u2.x;P2Y=-this.m_ratio*impulse*this.m_u2.y;b1.m_linearVelocity.x+=b1.m_invMass*P1X;b1.m_linearVelocity.y+=b1.m_invMass*P1Y;b1.m_angularVelocity+=b1.m_invI*(r1X*P1Y-r1Y*P1X);b2.m_linearVelocity.x+=b2.m_invMass*P2X;b2.m_linearVelocity.y+=b2.m_invMass*P2Y;b2.m_angularVelocity+=b2.m_invI*(r2X*P2Y-r2Y*P2X);if(this.m_limitState1==b2Joint.e_atUpperLimit)
+{v1X=b1.m_linearVelocity.x+(-b1.m_angularVelocity*r1Y);v1Y=b1.m_linearVelocity.y+(b1.m_angularVelocity*r1X);Cdot=-(this.m_u1.x*v1X+this.m_u1.y*v1Y);impulse=-this.m_limitMass1*Cdot;oldLimitImpulse=this.m_limitImpulse1;this.m_limitImpulse1=b2Math.b2Max(0.0,this.m_limitImpulse1+impulse);impulse=this.m_limitImpulse1-oldLimitImpulse;P1X=-impulse*this.m_u1.x;P1Y=-impulse*this.m_u1.y;b1.m_linearVelocity.x+=b1.m_invMass*P1X;b1.m_linearVelocity.y+=b1.m_invMass*P1Y;b1.m_angularVelocity+=b1.m_invI*(r1X*P1Y-r1Y*P1X);}
+if(this.m_limitState2==b2Joint.e_atUpperLimit)
+{v2X=b2.m_linearVelocity.x+(-b2.m_angularVelocity*r2Y);v2Y=b2.m_linearVelocity.y+(b2.m_angularVelocity*r2X);Cdot=-(this.m_u2.x*v2X+this.m_u2.y*v2Y);impulse=-this.m_limitMass2*Cdot;oldLimitImpulse=this.m_limitImpulse2;this.m_limitImpulse2=b2Math.b2Max(0.0,this.m_limitImpulse2+impulse);impulse=this.m_limitImpulse2-oldLimitImpulse;P2X=-impulse*this.m_u2.x;P2Y=-impulse*this.m_u2.y;b2.m_linearVelocity.x+=b2.m_invMass*P2X;b2.m_linearVelocity.y+=b2.m_invMass*P2Y;b2.m_angularVelocity+=b2.m_invI*(r2X*P2Y-r2Y*P2X);}},SolvePositionConstraints:function(){var b1=this.m_body1;var b2=this.m_body2;var tMat;var s1X=this.m_ground.m_position.x+this.m_groundAnchor1.x;var s1Y=this.m_ground.m_position.y+this.m_groundAnchor1.y;var s2X=this.m_ground.m_position.x+this.m_groundAnchor2.x;var s2Y=this.m_ground.m_position.y+this.m_groundAnchor2.y;var r1X;var r1Y;var r2X;var r2Y;var p1X;var p1Y;var p2X;var p2Y;var length1;var length2;var C;var impulse;var oldLimitPositionImpulse;var linearError=0.0;{tMat=b1.m_R;r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;p1X=b1.m_position.x+r1X;p1Y=b1.m_position.y+r1Y;p2X=b2.m_position.x+r2X;p2Y=b2.m_position.y+r2Y;this.m_u1.Set(p1X-s1X,p1Y-s1Y);this.m_u2.Set(p2X-s2X,p2Y-s2Y);length1=this.m_u1.Length();length2=this.m_u2.Length();if(length1>b2Settings.b2_linearSlop)
+{this.m_u1.Multiply(1.0/length1);}
+else
+{this.m_u1.SetZero();}
+if(length2>b2Settings.b2_linearSlop)
+{this.m_u2.Multiply(1.0/length2);}
+else
+{this.m_u2.SetZero();}
+C=this.m_constant-length1-this.m_ratio*length2;linearError=b2Math.b2Max(linearError,Math.abs(C));C=b2Math.b2Clamp(C,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);impulse=-this.m_pulleyMass*C;p1X=-impulse*this.m_u1.x;p1Y=-impulse*this.m_u1.y;p2X=-this.m_ratio*impulse*this.m_u2.x;p2Y=-this.m_ratio*impulse*this.m_u2.y;b1.m_position.x+=b1.m_invMass*p1X;b1.m_position.y+=b1.m_invMass*p1Y;b1.m_rotation+=b1.m_invI*(r1X*p1Y-r1Y*p1X);b2.m_position.x+=b2.m_invMass*p2X;b2.m_position.y+=b2.m_invMass*p2Y;b2.m_rotation+=b2.m_invI*(r2X*p2Y-r2Y*p2X);b1.m_R.Set(b1.m_rotation);b2.m_R.Set(b2.m_rotation);}
+if(this.m_limitState1==b2Joint.e_atUpperLimit)
+{tMat=b1.m_R;r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;p1X=b1.m_position.x+r1X;p1Y=b1.m_position.y+r1Y;this.m_u1.Set(p1X-s1X,p1Y-s1Y);length1=this.m_u1.Length();if(length1>b2Settings.b2_linearSlop)
+{this.m_u1.x*=1.0/length1;this.m_u1.y*=1.0/length1;}
+else
+{this.m_u1.SetZero();}
+C=this.m_maxLength1-length1;linearError=b2Math.b2Max(linearError,-C);C=b2Math.b2Clamp(C+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0.0);impulse=-this.m_limitMass1*C;oldLimitPositionImpulse=this.m_limitPositionImpulse1;this.m_limitPositionImpulse1=b2Math.b2Max(0.0,this.m_limitPositionImpulse1+impulse);impulse=this.m_limitPositionImpulse1-oldLimitPositionImpulse;p1X=-impulse*this.m_u1.x;p1Y=-impulse*this.m_u1.y;b1.m_position.x+=b1.m_invMass*p1X;b1.m_position.y+=b1.m_invMass*p1Y;b1.m_rotation+=b1.m_invI*(r1X*p1Y-r1Y*p1X);b1.m_R.Set(b1.m_rotation);}
+if(this.m_limitState2==b2Joint.e_atUpperLimit)
+{tMat=b2.m_R;r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;p2X=b2.m_position.x+r2X;p2Y=b2.m_position.y+r2Y;this.m_u2.Set(p2X-s2X,p2Y-s2Y);length2=this.m_u2.Length();if(length2>b2Settings.b2_linearSlop)
+{this.m_u2.x*=1.0/length2;this.m_u2.y*=1.0/length2;}
+else
+{this.m_u2.SetZero();}
+C=this.m_maxLength2-length2;linearError=b2Math.b2Max(linearError,-C);C=b2Math.b2Clamp(C+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0.0);impulse=-this.m_limitMass2*C;oldLimitPositionImpulse=this.m_limitPositionImpulse2;this.m_limitPositionImpulse2=b2Math.b2Max(0.0,this.m_limitPositionImpulse2+impulse);impulse=this.m_limitPositionImpulse2-oldLimitPositionImpulse;p2X=-impulse*this.m_u2.x;p2Y=-impulse*this.m_u2.y;b2.m_position.x+=b2.m_invMass*p2X;b2.m_position.y+=b2.m_invMass*p2Y;b2.m_rotation+=b2.m_invI*(r2X*p2Y-r2Y*p2X);b2.m_R.Set(b2.m_rotation);}
+return linearError<b2Settings.b2_linearSlop;},m_ground:null,m_groundAnchor1:new b2Vec2(),m_groundAnchor2:new b2Vec2(),m_localAnchor1:new b2Vec2(),m_localAnchor2:new b2Vec2(),m_u1:new b2Vec2(),m_u2:new b2Vec2(),m_constant:null,m_ratio:null,m_maxLength1:null,m_maxLength2:null,m_pulleyMass:null,m_limitMass1:null,m_limitMass2:null,m_pulleyImpulse:null,m_limitImpulse1:null,m_limitImpulse2:null,m_limitPositionImpulse1:null,m_limitPositionImpulse2:null,m_limitState1:0,m_limitState2:0});b2PulleyJoint.b2_minPulleyLength=b2Settings.b2_lengthUnitsPerMeter;
+var b2PulleyJointDef=Class.create();Object.extend(b2PulleyJointDef.prototype,b2JointDef.prototype);Object.extend(b2PulleyJointDef.prototype,{initialize:function()
+{this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.groundPoint1=new b2Vec2();this.groundPoint2=new b2Vec2();this.anchorPoint1=new b2Vec2();this.anchorPoint2=new b2Vec2();this.type=b2Joint.e_pulleyJoint;this.groundPoint1.Set(-1.0,1.0);this.groundPoint2.Set(1.0,1.0);this.anchorPoint1.Set(-1.0,0.0);this.anchorPoint2.Set(1.0,0.0);this.maxLength1=0.5*b2PulleyJoint.b2_minPulleyLength;this.maxLength2=0.5*b2PulleyJoint.b2_minPulleyLength;this.ratio=1.0;this.collideConnected=true;},groundPoint1:new b2Vec2(),groundPoint2:new b2Vec2(),anchorPoint1:new b2Vec2(),anchorPoint2:new b2Vec2(),maxLength1:null,maxLength2:null,ratio:null});
+var b2RevoluteJoint=Class.create();Object.extend(b2RevoluteJoint.prototype,b2Joint.prototype);Object.extend(b2RevoluteJoint.prototype,{GetAnchor1:function(){var tMat=this.m_body1.m_R;return new b2Vec2(this.m_body1.m_position.x+(tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y),this.m_body1.m_position.y+(tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y));},GetAnchor2:function(){var tMat=this.m_body2.m_R;return new b2Vec2(this.m_body2.m_position.x+(tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y),this.m_body2.m_position.y+(tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y));},GetJointAngle:function(){return this.m_body2.m_rotation-this.m_body1.m_rotation;},GetJointSpeed:function(){return this.m_body2.m_angularVelocity-this.m_body1.m_angularVelocity;},GetMotorTorque:function(invTimeStep){return invTimeStep*this.m_motorImpulse;},SetMotorSpeed:function(speed)
+{this.m_motorSpeed=speed;},SetMotorTorque:function(torque)
+{this.m_maxMotorTorque=torque;},GetReactionForce:function(invTimeStep)
+{var tVec=this.m_ptpImpulse.Copy();tVec.Multiply(invTimeStep);return tVec;},GetReactionTorque:function(invTimeStep)
+{return invTimeStep*this.m_limitImpulse;},initialize:function(def){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=def.type;this.m_prev=null;this.m_next=null;this.m_body1=def.body1;this.m_body2=def.body2;this.m_collideConnected=def.collideConnected;this.m_islandFlag=false;this.m_userData=def.userData;this.K=new b2Mat22();this.K1=new b2Mat22();this.K2=new b2Mat22();this.K3=new b2Mat22();this.m_localAnchor1=new b2Vec2();this.m_localAnchor2=new b2Vec2();this.m_ptpImpulse=new b2Vec2();this.m_ptpMass=new b2Mat22();var tMat;var tX;var tY;tMat=this.m_body1.m_R;tX=def.anchorPoint.x-this.m_body1.m_position.x;tY=def.anchorPoint.y-this.m_body1.m_position.y;this.m_localAnchor1.x=tX*tMat.col1.x+tY*tMat.col1.y;this.m_localAnchor1.y=tX*tMat.col2.x+tY*tMat.col2.y;tMat=this.m_body2.m_R;tX=def.anchorPoint.x-this.m_body2.m_position.x;tY=def.anchorPoint.y-this.m_body2.m_position.y;this.m_localAnchor2.x=tX*tMat.col1.x+tY*tMat.col1.y;this.m_localAnchor2.y=tX*tMat.col2.x+tY*tMat.col2.y;this.m_intialAngle=this.m_body2.m_rotation-this.m_body1.m_rotation;this.m_ptpImpulse.Set(0.0,0.0);this.m_motorImpulse=0.0;this.m_limitImpulse=0.0;this.m_limitPositionImpulse=0.0;this.m_lowerAngle=def.lowerAngle;this.m_upperAngle=def.upperAngle;this.m_maxMotorTorque=def.motorTorque;this.m_motorSpeed=def.motorSpeed;this.m_enableLimit=def.enableLimit;this.m_enableMotor=def.enableMotor;},K:new b2Mat22(),K1:new b2Mat22(),K2:new b2Mat22(),K3:new b2Mat22(),PrepareVelocitySolver:function(){var b1=this.m_body1;var b2=this.m_body2;var tMat;tMat=b1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var invMass1=b1.m_invMass;var invMass2=b2.m_invMass;var invI1=b1.m_invI;var invI2=b2.m_invI;this.K1.col1.x=invMass1+invMass2;this.K1.col2.x=0.0;this.K1.col1.y=0.0;this.K1.col2.y=invMass1+invMass2;this.K2.col1.x=invI1*r1Y*r1Y;this.K2.col2.x=-invI1*r1X*r1Y;this.K2.col1.y=-invI1*r1X*r1Y;this.K2.col2.y=invI1*r1X*r1X;this.K3.col1.x=invI2*r2Y*r2Y;this.K3.col2.x=-invI2*r2X*r2Y;this.K3.col1.y=-invI2*r2X*r2Y;this.K3.col2.y=invI2*r2X*r2X;this.K.SetM(this.K1);this.K.AddM(this.K2);this.K.AddM(this.K3);this.K.Invert(this.m_ptpMass);this.m_motorMass=1.0/(invI1+invI2);if(this.m_enableMotor==false)
+{this.m_motorImpulse=0.0;}
+if(this.m_enableLimit)
+{var jointAngle=b2.m_rotation-b1.m_rotation-this.m_intialAngle;if(b2Math.b2Abs(this.m_upperAngle-this.m_lowerAngle)<2.0*b2Settings.b2_angularSlop)
+{this.m_limitState=b2Joint.e_equalLimits;}
+else if(jointAngle<=this.m_lowerAngle)
+{if(this.m_limitState!=b2Joint.e_atLowerLimit)
+{this.m_limitImpulse=0.0;}
+this.m_limitState=b2Joint.e_atLowerLimit;}
+else if(jointAngle>=this.m_upperAngle)
+{if(this.m_limitState!=b2Joint.e_atUpperLimit)
+{this.m_limitImpulse=0.0;}
+this.m_limitState=b2Joint.e_atUpperLimit;}
+else
+{this.m_limitState=b2Joint.e_inactiveLimit;this.m_limitImpulse=0.0;}}
+else
+{this.m_limitImpulse=0.0;}
+if(b2World.s_enableWarmStarting)
+{b1.m_linearVelocity.x-=invMass1*this.m_ptpImpulse.x;b1.m_linearVelocity.y-=invMass1*this.m_ptpImpulse.y;b1.m_angularVelocity-=invI1*((r1X*this.m_ptpImpulse.y-r1Y*this.m_ptpImpulse.x)+this.m_motorImpulse+this.m_limitImpulse);b2.m_linearVelocity.x+=invMass2*this.m_ptpImpulse.x;b2.m_linearVelocity.y+=invMass2*this.m_ptpImpulse.y;b2.m_angularVelocity+=invI2*((r2X*this.m_ptpImpulse.y-r2Y*this.m_ptpImpulse.x)+this.m_motorImpulse+this.m_limitImpulse);}
+else{this.m_ptpImpulse.SetZero();this.m_motorImpulse=0.0;this.m_limitImpulse=0.0;}
+this.m_limitPositionImpulse=0.0;},SolveVelocityConstraints:function(step){var b1=this.m_body1;var b2=this.m_body2;var tMat;tMat=b1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var oldLimitImpulse;var ptpCdotX=b2.m_linearVelocity.x+(-b2.m_angularVelocity*r2Y)-b1.m_linearVelocity.x-(-b1.m_angularVelocity*r1Y);var ptpCdotY=b2.m_linearVelocity.y+(b2.m_angularVelocity*r2X)-b1.m_linearVelocity.y-(b1.m_angularVelocity*r1X);var ptpImpulseX=-(this.m_ptpMass.col1.x*ptpCdotX+this.m_ptpMass.col2.x*ptpCdotY);var ptpImpulseY=-(this.m_ptpMass.col1.y*ptpCdotX+this.m_ptpMass.col2.y*ptpCdotY);this.m_ptpImpulse.x+=ptpImpulseX;this.m_ptpImpulse.y+=ptpImpulseY;b1.m_linearVelocity.x-=b1.m_invMass*ptpImpulseX;b1.m_linearVelocity.y-=b1.m_invMass*ptpImpulseY;b1.m_angularVelocity-=b1.m_invI*(r1X*ptpImpulseY-r1Y*ptpImpulseX);b2.m_linearVelocity.x+=b2.m_invMass*ptpImpulseX;b2.m_linearVelocity.y+=b2.m_invMass*ptpImpulseY;b2.m_angularVelocity+=b2.m_invI*(r2X*ptpImpulseY-r2Y*ptpImpulseX);if(this.m_enableMotor&&this.m_limitState!=b2Joint.e_equalLimits)
+{var motorCdot=b2.m_angularVelocity-b1.m_angularVelocity-this.m_motorSpeed;var motorImpulse=-this.m_motorMass*motorCdot;var oldMotorImpulse=this.m_motorImpulse;this.m_motorImpulse=b2Math.b2Clamp(this.m_motorImpulse+motorImpulse,-step.dt*this.m_maxMotorTorque,step.dt*this.m_maxMotorTorque);motorImpulse=this.m_motorImpulse-oldMotorImpulse;b1.m_angularVelocity-=b1.m_invI*motorImpulse;b2.m_angularVelocity+=b2.m_invI*motorImpulse;}
+if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit)
+{var limitCdot=b2.m_angularVelocity-b1.m_angularVelocity;var limitImpulse=-this.m_motorMass*limitCdot;if(this.m_limitState==b2Joint.e_equalLimits)
+{this.m_limitImpulse+=limitImpulse;}
+else if(this.m_limitState==b2Joint.e_atLowerLimit)
+{oldLimitImpulse=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Max(this.m_limitImpulse+limitImpulse,0.0);limitImpulse=this.m_limitImpulse-oldLimitImpulse;}
+else if(this.m_limitState==b2Joint.e_atUpperLimit)
+{oldLimitImpulse=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Min(this.m_limitImpulse+limitImpulse,0.0);limitImpulse=this.m_limitImpulse-oldLimitImpulse;}
+b1.m_angularVelocity-=b1.m_invI*limitImpulse;b2.m_angularVelocity+=b2.m_invI*limitImpulse;}},SolvePositionConstraints:function(){var oldLimitImpulse;var limitC;var b1=this.m_body1;var b2=this.m_body2;var positionError=0.0;var tMat;tMat=b1.m_R;var r1X=tMat.col1.x*this.m_localAnchor1.x+tMat.col2.x*this.m_localAnchor1.y;var r1Y=tMat.col1.y*this.m_localAnchor1.x+tMat.col2.y*this.m_localAnchor1.y;tMat=b2.m_R;var r2X=tMat.col1.x*this.m_localAnchor2.x+tMat.col2.x*this.m_localAnchor2.y;var r2Y=tMat.col1.y*this.m_localAnchor2.x+tMat.col2.y*this.m_localAnchor2.y;var p1X=b1.m_position.x+r1X;var p1Y=b1.m_position.y+r1Y;var p2X=b2.m_position.x+r2X;var p2Y=b2.m_position.y+r2Y;var ptpCX=p2X-p1X;var ptpCY=p2Y-p1Y;positionError=Math.sqrt(ptpCX*ptpCX+ptpCY*ptpCY);var invMass1=b1.m_invMass;var invMass2=b2.m_invMass;var invI1=b1.m_invI;var invI2=b2.m_invI;this.K1.col1.x=invMass1+invMass2;this.K1.col2.x=0.0;this.K1.col1.y=0.0;this.K1.col2.y=invMass1+invMass2;this.K2.col1.x=invI1*r1Y*r1Y;this.K2.col2.x=-invI1*r1X*r1Y;this.K2.col1.y=-invI1*r1X*r1Y;this.K2.col2.y=invI1*r1X*r1X;this.K3.col1.x=invI2*r2Y*r2Y;this.K3.col2.x=-invI2*r2X*r2Y;this.K3.col1.y=-invI2*r2X*r2Y;this.K3.col2.y=invI2*r2X*r2X;this.K.SetM(this.K1);this.K.AddM(this.K2);this.K.AddM(this.K3);this.K.Solve(b2RevoluteJoint.tImpulse,-ptpCX,-ptpCY);var impulseX=b2RevoluteJoint.tImpulse.x;var impulseY=b2RevoluteJoint.tImpulse.y;b1.m_position.x-=b1.m_invMass*impulseX;b1.m_position.y-=b1.m_invMass*impulseY;b1.m_rotation-=b1.m_invI*(r1X*impulseY-r1Y*impulseX);b1.m_R.Set(b1.m_rotation);b2.m_position.x+=b2.m_invMass*impulseX;b2.m_position.y+=b2.m_invMass*impulseY;b2.m_rotation+=b2.m_invI*(r2X*impulseY-r2Y*impulseX);b2.m_R.Set(b2.m_rotation);var angularError=0.0;if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit)
+{var angle=b2.m_rotation-b1.m_rotation-this.m_intialAngle;var limitImpulse=0.0;if(this.m_limitState==b2Joint.e_equalLimits)
+{limitC=b2Math.b2Clamp(angle,-b2Settings.b2_maxAngularCorrection,b2Settings.b2_maxAngularCorrection);limitImpulse=-this.m_motorMass*limitC;angularError=b2Math.b2Abs(limitC);}
+else if(this.m_limitState==b2Joint.e_atLowerLimit)
+{limitC=angle-this.m_lowerAngle;angularError=b2Math.b2Max(0.0,-limitC);limitC=b2Math.b2Clamp(limitC+b2Settings.b2_angularSlop,-b2Settings.b2_maxAngularCorrection,0.0);limitImpulse=-this.m_motorMass*limitC;oldLimitImpulse=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Max(this.m_limitPositionImpulse+limitImpulse,0.0);limitImpulse=this.m_limitPositionImpulse-oldLimitImpulse;}
+else if(this.m_limitState==b2Joint.e_atUpperLimit)
+{limitC=angle-this.m_upperAngle;angularError=b2Math.b2Max(0.0,limitC);limitC=b2Math.b2Clamp(limitC-b2Settings.b2_angularSlop,0.0,b2Settings.b2_maxAngularCorrection);limitImpulse=-this.m_motorMass*limitC;oldLimitImpulse=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Min(this.m_limitPositionImpulse+limitImpulse,0.0);limitImpulse=this.m_limitPositionImpulse-oldLimitImpulse;}
+b1.m_rotation-=b1.m_invI*limitImpulse;b1.m_R.Set(b1.m_rotation);b2.m_rotation+=b2.m_invI*limitImpulse;b2.m_R.Set(b2.m_rotation);}
+return positionError<=b2Settings.b2_linearSlop&&angularError<=b2Settings.b2_angularSlop;},m_localAnchor1:new b2Vec2(),m_localAnchor2:new b2Vec2(),m_ptpImpulse:new b2Vec2(),m_motorImpulse:null,m_limitImpulse:null,m_limitPositionImpulse:null,m_ptpMass:new b2Mat22(),m_motorMass:null,m_intialAngle:null,m_lowerAngle:null,m_upperAngle:null,m_maxMotorTorque:null,m_motorSpeed:null,m_enableLimit:null,m_enableMotor:null,m_limitState:0});b2RevoluteJoint.tImpulse=new b2Vec2();
+var b2RevoluteJointDef=Class.create();Object.extend(b2RevoluteJointDef.prototype,b2JointDef.prototype);Object.extend(b2RevoluteJointDef.prototype,{initialize:function()
+{this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.type=b2Joint.e_revoluteJoint;this.anchorPoint=new b2Vec2(0.0,0.0);this.lowerAngle=0.0;this.upperAngle=0.0;this.motorTorque=0.0;this.motorSpeed=0.0;this.enableLimit=false;this.enableMotor=false;},anchorPoint:null,lowerAngle:null,upperAngle:null,motorTorque:null,motorSpeed:null,enableLimit:null,enableMotor:null});
+
+
+
+if (!window['google']) {
+window['google'] = {};
+}
+if (!window['google']['loader']) {
+window['google']['loader'] = {};
+google.loader.ServiceBase = 'http://www.google.com/uds';
+google.loader.GoogleApisBase = 'http://ajax.googleapis.com/ajax';
+google.loader.ApiKey = 'notsupplied';
+google.loader.KeyVerified = true;
+google.loader.LoadFailure = false;
+google.loader.Secure = false;
+google.loader.GoogleLocale = 'www.google.com';
+google.loader.ClientLocation = {"latitude":37.454,"longitude":-122.203,"address":{"city":"Atherton","region":"CA","country":"USA","country_code":"US"}};
+google.loader.AdditionalParams = '';
+google.loader.OriginalAppPath = 'http://mrdoob.com/projects/chromeexperiments/google_gravity/';
+(function() {var d=true,e=null,g=false,h=encodeURIComponent,j=window,k=google,m=undefined,n=document;function p(a,b){return a.load=b}var q="push",s="replace",t="charAt",u="ServiceBase",v="name",w="getTime",x="length",y="prototype",z="setTimeout",A="loader",B="substring",C="join",D="toLowerCase";function E(a){if(a in F)return F[a];return F[a]=navigator.userAgent[D]().indexOf(a)!=-1}var F={};function G(a,b){var c=function(){};c.prototype=b[y];a.S=b[y];a.prototype=new c}
+function H(a,b){var c=a.G||[];c=c.concat(Array[y].slice.call(arguments,2));if(typeof a.t!="undefined")b=a.t;if(typeof a.s!="undefined")a=a.s;var f=function(){var i=c.concat(Array[y].slice.call(arguments));return a.apply(b,i)};f.G=c;f.t=b;f.s=a;return f}function I(a){a=new Error(a);a.toString=function(){return this.message};return a}function J(a,b){a=a.split(/\./);for(var c=j,f=0;f<a[x]-1;f++){c[a[f]]||(c[a[f]]={});c=c[a[f]]}c[a[a[x]-1]]=b}function K(a,b,c){a[b]=c}if(!L)var L=J;if(!M)var M=K;k[A].u={};L("google.loader.callbacks",k[A].u);var N={},O={};k[A].eval={};L("google.loader.eval",k[A].eval);
+p(k,function(a,b,c){function f(r){var o=r.split(".");if(o[x]>2)throw I("Module: '"+r+"' not found!");else if(typeof o[1]!="undefined"){i=o[0];c.packages=c.packages||[];c.packages[q](o[1])}}var i=a;c=c||{};if(a instanceof Array||a&&typeof a=="object"&&typeof a[C]=="function"&&typeof a.reverse=="function")for(var l=0;l<a[x];l++)f(a[l]);else f(a);if(a=N[":"+i]){if(c&&!c.language&&c.locale)c.language=c.locale;if(c&&typeof c.callback=="string"){l=c.callback;if(l.match(/^[[\]A-Za-z0-9._]+$/)){l=j.eval(l);
+c.callback=l}}if((l=c&&c.callback!=e)&&!a.r(b))throw I("Module: '"+i+"' must be loaded before DOM onLoad!");else if(l)a.l(b,c)?j[z](c.callback,0):a.load(b,c);else a.l(b,c)||a.load(b,c)}else throw I("Module: '"+i+"' not found!");});L("google.load",k.load);k.R=function(a,b){b?aa(a):P(j,"load",a)};L("google.setOnLoadCallback",k.R);function P(a,b,c){if(a.addEventListener)a.addEventListener(b,c,g);else if(a.attachEvent)a.attachEvent("on"+b,c);else{var f=a["on"+b];a["on"+b]=f!=e?ba([c,f]):c}}
+function ba(a){return function(){for(var b=0;b<a[x];b++)a[b]()}}var Q=[];function aa(a){if(Q[x]==0){P(j,"load",R);if(!E("msie")&&!(E("safari")||E("konqueror"))&&E("mozilla")||j.opera)j.addEventListener("DOMContentLoaded",R,g);else if(E("msie"))n.write("<script defer onreadystatechange='google.loader.domReady()' src=//:><\/script>");else(E("safari")||E("konqueror"))&&j[z](ca,10)}Q[q](a)}
+k[A].M=function(){var a=j.event.srcElement;if(a.readyState=="complete"){a.onreadystatechange=e;a.parentNode.removeChild(a);R()}};L("google.loader.domReady",k[A].M);var da={loaded:d,complete:d};function ca(){if(da[n.readyState])R();else Q[x]>0&&j[z](ca,10)}function R(){for(var a=0;a<Q[x];a++)Q[a]();Q.length=0}
+k[A].e=function(a,b,c){if(c){var f;if(a=="script"){f=n.createElement("script");f.type="text/javascript";f.src=b}else if(a=="css"){f=n.createElement("link");f.type="text/css";f.href=b;f.rel="stylesheet"}(a=n.getElementsByTagName("head")[0])||(a=n.body.parentNode.appendChild(n.createElement("head")));a.appendChild(f)}else if(a=="script")n.write('<script src="'+b+'" type="text/javascript"><\/script>');else a=="css"&&n.write('<link href="'+b+'" type="text/css" rel="stylesheet"></link>')};
+L("google.loader.writeLoadTag",k[A].e);k[A].O=function(a){O=a};L("google.loader.rfm",k[A].O);k[A].Q=function(a){for(var b in a)if(typeof b=="string"&&b&&b[t](0)==":"&&!N[b])N[b]=new T(b[B](1),a[b])};L("google.loader.rpl",k[A].Q);k[A].P=function(a){if((a=a.specs)&&a[x])for(var b=0;b<a[x];++b){var c=a[b];if(typeof c=="string")N[":"+c]=new U(c);else{c=new V(c[v],c.baseSpec,c.customSpecs);N[":"+c[v]]=c}}};L("google.loader.rm",k[A].P);k[A].loaded=function(a){N[":"+a.module].j(a)};
+L("google.loader.loaded",k[A].loaded);k[A].L=function(){var a=(new Date)[w](),b=Math.floor(Math.random()*1E7);return"qid="+(a.toString(16)+b.toString(16))};L("google.loader.createGuidArg_",k[A].L);J("google_exportSymbol",J);J("google_exportProperty",K);k[A].b={};L("google.loader.themes",k[A].b);k[A].b.A="http://www.google.com/cse/style/look/bubblegum.css";M(k[A].b,"BUBBLEGUM",k[A].b.A);k[A].b.C="http://www.google.com/cse/style/look/greensky.css";M(k[A].b,"GREENSKY",k[A].b.C);k[A].b.B="http://www.google.com/cse/style/look/espresso.css";
+M(k[A].b,"ESPRESSO",k[A].b.B);k[A].b.F="http://www.google.com/cse/style/look/shiny.css";M(k[A].b,"SHINY",k[A].b.F);k[A].b.D="http://www.google.com/cse/style/look/minimalist.css";M(k[A].b,"MINIMALIST",k[A].b.D);function U(a){this.a=a;this.p=[];this.o={};this.c={};this.k=d;this.d=-1}
+U[y].g=function(a,b){var c="";if(b!=m){if(b.language!=m)c+="&hl="+h(b.language);if(b.nocss!=m)c+="&output="+h("nocss="+b.nocss);if(b.nooldnames!=m)c+="&nooldnames="+h(b.nooldnames);if(b.packages!=m)c+="&packages="+h(b.packages);if(b.callback!=e)c+="&async=2";if(b.style!=m)c+="&style="+h(b.style);if(b.other_params!=m)c+="&"+b.other_params}if(!this.k){if(k[this.a]&&k[this.a].JSHash)c+="&sig="+h(k[this.a].JSHash);b=[];for(var f in this.o)f[t](0)==":"&&b[q](f[B](1));for(f in this.c)f[t](0)==":"&&b[q](f[B](1));
+c+="&have="+h(b[C](","))}return k[A][u]+"/?file="+this.a+"&v="+a+k[A].AdditionalParams+c};U[y].w=function(a){var b=e;if(a)b=a.packages;var c=e;if(b)if(typeof b=="string")c=[a.packages];else if(b[x]){c=[];for(a=0;a<b[x];a++)typeof b[a]=="string"&&c[q](b[a][s](/^\s*|\s*$/,"")[D]())}c||(c=["default"]);b=[];for(a=0;a<c[x];a++)this.o[":"+c[a]]||b[q](c[a]);return b};
+p(U[y],function(a,b){var c=this.w(b),f=b&&b.callback!=e;if(f)var i=new W(b.callback);for(var l=[],r=c[x]-1;r>=0;r--){var o=c[r];f&&i.H(o);if(this.c[":"+o]){c.splice(r,1);f&&this.c[":"+o][q](i)}else l[q](o)}if(c[x]){if(b&&b.packages)b.packages=c.sort()[C](",");if(!b&&O[":"+this.a]!=e&&O[":"+this.a].versions[":"+a]!=e&&!k[A].AdditionalParams&&this.k){a=O[":"+this.a];k[this.a]=k[this.a]||{};for(var S in a.properties)if(S&&S[t](0)==":")k[this.a][S[B](1)]=a.properties[S];k[A].e("script",k[A][u]+a.path+
+a.js,f);a.css&&k[A].e("css",k[A][u]+a.path+a.css,f)}else if(!b||!b.autoloaded)k[A].e("script",this.g(a,b),f);if(this.k){this.k=g;this.d=(new Date)[w]();if(this.d%100!=1)this.d=-1}for(r=0;r<l[x];r++){o=l[r];this.c[":"+o]=[];f&&this.c[":"+o][q](i)}}});
+U[y].j=function(a){if(this.d!=-1){X("al_"+this.a,"jl."+((new Date)[w]()-this.d),d);this.d=-1}this.p=this.p.concat(a.components);k[A][this.a]||(k[A][this.a]={});k[A][this.a].packages=this.p.slice(0);for(var b=0;b<a.components[x];b++){this.o[":"+a.components[b]]=d;var c=this.c[":"+a.components[b]];if(c){for(var f=0;f<c[x];f++)c[f].K(a.components[b]);delete this.c[":"+a.components[b]]}}X("hl",this.a)};U[y].l=function(a,b){return this.w(b)[x]==0};U[y].r=function(){return d};
+function W(a){this.J=a;this.m={};this.q=0}W[y].H=function(a){this.q++;this.m[":"+a]=d};W[y].K=function(a){if(this.m[":"+a]){this.m[":"+a]=g;this.q--;this.q==0&&j[z](this.J,0)}};function V(a,b,c){this.name=a;this.I=b;this.n=c;this.v=this.h=g;this.i=[];k[A].u[this[v]]=H(this.j,this)}G(V,U);p(V[y],function(a,b){var c=b&&b.callback!=e;if(c){this.i[q](b.callback);b.callback="google.loader.callbacks."+this[v]}else this.h=d;if(!b||!b.autoloaded)k[A].e("script",this.g(a,b),c);X("el",this[v])});V[y].l=function(a,b){return b&&b.callback!=e?this.v:this.h};V[y].j=function(){this.v=d;for(var a=0;a<this.i[x];a++)j[z](this.i[a],0);this.i=[]};
+var Y=function(a,b){return a.string?h(a.string)+"="+h(b):a.regex?b[s](/(^.*$)/,a.regex):""};V[y].g=function(a,b){return this.N(this.z(a),a,b)};
+V[y].N=function(a,b,c){var f="";if(a.key)f+="&"+Y(a.key,k[A].ApiKey);if(a.version)f+="&"+Y(a.version,b);b=k[A].Secure&&a.ssl?a.ssl:a.uri;if(c!=e)for(var i in c)if(a.params[i])f+="&"+Y(a.params[i],c[i]);else if(i=="other_params")f+="&"+c[i];else if(i=="base_domain")b="http://"+c[i]+a.uri[B](a.uri.indexOf("/",7));k[this[v]]={};if(b.indexOf("?")==-1&&f)f="?"+f[B](1);return b+f};V[y].r=function(a){return this.z(a).deferred};V[y].z=function(a){if(this.n)for(var b=0;b<this.n[x];++b){var c=this.n[b];if((new RegExp(c.pattern)).test(a))return c}return this.I};function T(a,b){this.a=a;this.f=b;this.h=g}G(T,U);p(T[y],function(a,b){this.h=d;k[A].e("script",this.g(a,b),g)});T[y].l=function(){return this.h};T[y].j=function(){};T[y].g=function(a,b){if(!this.f.versions[":"+a]){if(this.f.aliases){var c=this.f.aliases[":"+a];if(c)a=c}if(!this.f.versions[":"+a])throw I("Module: '"+this.a+"' with version '"+a+"' not found!");}a=k[A].GoogleApisBase+"/libs/"+this.a+"/"+a+"/"+this.f.versions[":"+a][b&&b.uncompressed?"uncompressed":"compressed"];X("el",this.a);return a};
+T[y].r=function(){return g};var ea=g,Z=[],fa=(new Date)[w](),X=function(a,b,c){if(!ea){P(j,"unload",ga);ea=d}if(c){if(!k[A].Secure&&(!k[A].Options||k[A].Options.csi===g)){a=a[D]()[s](/[^a-z0-9_.]+/g,"_");b=b[D]()[s](/[^a-z0-9_.]+/g,"_");j[z](H($,e,"http://csi.gstatic.com/csi?s=uds&v=2&action="+h(a)+"&it="+h(b)),1E4)}}else{Z[q]("r"+Z[x]+"="+h(a+(b?"|"+b:"")));j[z](ga,Z[x]>5?0:15E3)}},ga=function(){if(Z[x]){$(k[A][u]+"/stats?"+Z[C]("&")+"&nc="+(new Date)[w]()+"_"+((new Date)[w]()-fa));Z.length=0}},$=function(a){var b=new Image,
+c=ha++;ia[c]=b;b.onload=b.onerror=function(){delete ia[c]};b.src=a;b=e},ia={},ha=0;J("google.loader.recordStat",X);J("google.loader.createImageForLogging",$);
+
+}) ();google.loader.rm({"specs":[{"name":"books","baseSpec":{"uri":"http://books.google.com/books/api.js","ssl":null,"key":{"string":"key"},"version":{"string":"v"},"deferred":true,"params":{"callback":{"string":"callback"},"language":{"string":"hl"}}}},"feeds",{"name":"friendconnect","baseSpec":{"uri":"http://www.google.com/friendconnect/script/friendconnect.js","ssl":null,"key":{"string":"key"},"version":{"string":"v"},"deferred":false,"params":{}}},"spreadsheets","gdata","visualization",{"name":"sharing","baseSpec":{"uri":"http://www.google.com/s2/sharing/js","ssl":null,"key":{"string":"key"},"version":{"string":"v"},"deferred":false,"params":{"language":{"string":"hl"}}}},"search",{"name":"maps","baseSpec":{"uri":"http://maps.google.com/maps?file\u003dgoogleapi","ssl":"https://maps-api-ssl.google.com/maps?file\u003dgoogleapi","key":{"string":"key"},"version":{"string":"v"},"deferred":true,"params":{"callback":{"regex":"callback\u003d$1\u0026async\u003d2"},"language":{"string":"hl"}}},"customSpecs":[{"uri":"http://maps.google.com/maps/api/js","ssl":null,"key":{"string":"key"},"version":{"string":"v"},"deferred":true,"params":{"callback":{"string":"callback"},"language":{"string":"hl"}},"pattern":"^(3|3..*)$"}]},"annotations_v2","orkut","language","earth",{"name":"annotations","baseSpec":{"uri":"http://www.google.com/reviews/scripts/annotations_bootstrap.js","ssl":null,"key":{"string":"key"},"version":{"string":"v"},"deferred":true,"params":{"callback":{"string":"callback"},"language":{"string":"hl"},"country":{"string":"gl"}}}},"ads","elements"]});
+google.loader.rfm({":feeds":{"versions":{":1":"1",":1.0":"1"},"path":"/api/feeds/1.0/e291a634414cb5ef1c9f3b5424b8ac4b/","js":"default+en.I.js","css":"default.css","properties":{":JSHash":"e291a634414cb5ef1c9f3b5424b8ac4b",":Version":"1.0"}},":search":{"versions":{":1":"1",":1.0":"1"},"path":"/api/search/1.0/457a1b12dfe20ca00fd65f9ad5d52ccd/","js":"default+en.I.js","css":"default.css","properties":{":JSHash":"457a1b12dfe20ca00fd65f9ad5d52ccd",":NoOldNames":false,":Version":"1.0"}},":language":{"versions":{":1":"1",":1.0":"1"},"path":"/api/language/1.0/cd6e6992328d3619ee31352c39a90b10/","js":"default+en.I.js","properties":{":JSHash":"cd6e6992328d3619ee31352c39a90b10",":Version":"1.0"}},":spreadsheets":{"versions":{":0":"1",":0.3":"1"},"path":"/api/spreadsheets/0.3/8331b0bbcc74776270648505340e9200/","js":"default.I.js","properties":{":JSHash":"8331b0bbcc74776270648505340e9200",":Version":"0.3"}},":earth":{"versions":{":1":"1",":1.0":"1"},"path":"/api/earth/1.0/36b9e8d98246edaa2aac0e8ecc4dcec7/","js":"default.I.js","properties":{":JSHash":"36b9e8d98246edaa2aac0e8ecc4dcec7",":Version":"1.0"}},":annotations":{"versions":{":1":"1",":1.0":"1"},"path":"/api/annotations/1.0/95e76f84c9532973f104478d1e810796/","js":"default+en.I.js","properties":{":JSHash":"95e76f84c9532973f104478d1e810796",":Version":"1.0"}}});
+google.loader.rpl({":scriptaculous":{"versions":{":1.8.3":{"uncompressed":"scriptaculous.js","compressed":"scriptaculous.js"},":1.8.2":{"uncompressed":"scriptaculous.js","compressed":"scriptaculous.js"},":1.8.1":{"uncompressed":"scriptaculous.js","compressed":"scriptaculous.js"}},"aliases":{":1.8":"1.8.3",":1":"1.8.3"}},":yui":{"versions":{":2.6.0":{"uncompressed":"build/yuiloader/yuiloader.js","compressed":"build/yuiloader/yuiloader-min.js"},":2.7.0":{"uncompressed":"build/yuiloader/yuiloader.js","compressed":"build/yuiloader/yuiloader-min.js"},":2.8.0r4":{"uncompressed":"build/yuiloader/yuiloader.js","compressed":"build/yuiloader/yuiloader-min.js"}},"aliases":{":2":"2.8.0r4",":2.7":"2.7.0",":2.6":"2.6.0",":2.8":"2.8.0r4",":2.8.0":"2.8.0r4"}},":swfobject":{"versions":{":2.1":{"uncompressed":"swfobject_src.js","compressed":"swfobject.js"},":2.2":{"uncompressed":"swfobject_src.js","compressed":"swfobject.js"}},"aliases":{":2":"2.2"}},":ext-core":{"versions":{":3.1.0":{"uncompressed":"ext-core-debug.js","compressed":"ext-core.js"},":3.0.0":{"uncompressed":"ext-core-debug.js","compressed":"ext-core.js"}},"aliases":{":3":"3.1.0",":3.0":"3.0.0",":3.1":"3.1.0"}},":mootools":{"versions":{":1.2.3":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.1.1":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.2.4":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.2.1":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.2.2":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.1.2":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"}},"aliases":{":1":"1.1.2",":1.11":"1.1.1",":1.2":"1.2.4",":1.1":"1.1.2"}},":jqueryui":{"versions":{":1.7.2":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.6.0":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.7.0":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.7.1":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.5.3":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.5.2":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"}},"aliases":{":1.7":"1.7.2",":1":"1.7.2",":1.6":"1.6.0",":1.5":"1.5.3"}},":chrome-frame":{"versions":{":1.0.2":{"uncompressed":"CFInstall.js","compressed":"CFInstall.min.js"},":1.0.1":{"uncompressed":"CFInstall.js","compressed":"CFInstall.min.js"},":1.0.0":{"uncompressed":"CFInstall.js","compressed":"CFInstall.min.js"}},"aliases":{":1":"1.0.2",":1.0":"1.0.2"}},":prototype":{"versions":{":1.6.0.2":{"uncompressed":"prototype.js","compressed":"prototype.js"},":1.6.1.0":{"uncompressed":"prototype.js","compressed":"prototype.js"},":1.6.0.3":{"uncompressed":"prototype.js","compressed":"prototype.js"}},"aliases":{":1.6.1":"1.6.1.0",":1":"1.6.1.0",":1.6":"1.6.1.0",":1.6.0":"1.6.0.3"}},":jquery":{"versions":{":1.2.3":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.3.1":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.3.0":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.3.2":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.2.6":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.4.0":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.4.1":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.4.2":{"uncompressed":"jquery.js","compressed":"jquery.min.js"}},"aliases":{":1":"1.4.2",":1.4":"1.4.2",":1.3":"1.3.2",":1.2":"1.2.6"}},":dojo":{"versions":{":1.2.3":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.3.1":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.1.1":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.3.0":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.3.2":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.2.0":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.4.0":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.4.1":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"}},"aliases":{":1":"1.4.1",":1.4":"1.4.1",":1.3":"1.3.2",":1.2":"1.2.3",":1.1":"1.1.1"}}});
+}
+if (window['google'] != undefined && window['google']['loader'] != undefined) {
+if (!window['google']['search']) {
+window['google']['search'] = {};
+google.search.Version = '1.0';
+google.search.NoOldNames = false;
+google.search.JSHash = '457a1b12dfe20ca00fd65f9ad5d52ccd';
+google.search.LoadArgs = 'file\75uds.js\46v\0750.1';
+google.loader.ApiKey = 'notsupplied';
+google.loader.KeyVerified = true;
+google.loader.LoadFailure = false;
+}
+google.loader.writeLoadTag("script", google.loader.ServiceBase + "/api/search/1.0/457a1b12dfe20ca00fd65f9ad5d52ccd/default+en.I.js", false);
+}
+
+
+
+(function() {
+var _UDS_CONST_LOCALE = 'en';
+var _UDS_CONST_SHORT_DATE_PATTERN = 'MDY';
+var _UDS_MSG_SEARCHER_IMAGE = ('Image');
+var _UDS_MSG_SEARCHER_WEB = ('Web');
+var _UDS_MSG_SEARCHER_BLOG = ('Blog');
+var _UDS_MSG_SEARCHER_VIDEO = ('Video');
+var _UDS_MSG_SEARCHER_LOCAL = ('Local');
+var _UDS_MSG_SEARCHCONTROL_SAVE = ('save');
+var _UDS_MSG_SEARCHCONTROL_KEEP = ('keep');
+var _UDS_MSG_SEARCHCONTROL_INCLUDE = ('include');
+var _UDS_MSG_SEARCHCONTROL_COPY = ('copy');
+var _UDS_MSG_SEARCHCONTROL_CLOSE = ('close');
+var _UDS_MSG_SEARCHCONTROL_SPONSORED_LINKS = ('Sponsored Links');
+var _UDS_MSG_SEARCHCONTROL_SEE_MORE = ('see more...');
+var _UDS_MSG_SEARCHCONTROL_WATERMARK = ('clipped from Google');
+var _UDS_MSG_SEARCHER_CONFIG_SET_LOCATION = ('Search location');
+var _UDS_MSG_SEARCHER_CONFIG_DISABLE_ADDRESS_LOOKUP = ('Disable address lookup');
+var _UDS_MSG_SEARCHER_NEWS = ('News');
+function _UDS_MSG_MINUTES_AGO(AGE_MINUTES_AGO) {return ('' + AGE_MINUTES_AGO + ' minutes ago');}
+var _UDS_MSG_ONE_HOUR_AGO = ('1 hour ago');
+function _UDS_MSG_HOURS_AGO(AGE_HOURS_AGO) {return ('' + AGE_HOURS_AGO + ' hours ago');}
+function _UDS_MSG_NEWS_ALL_N_RELATED(NUMBER) {return ('all ' + NUMBER + ' related');}
+var _UDS_MSG_NEWS_RELATED = ('Related Articles');
+var _UDS_MSG_BRANDING_STRING = ('powered by Google');
+var _UDS_MSG_SORT_BY_DATE = ('Sort by date');
+var _UDS_MSG_MONTH_ABBR_JAN = ('Jan');
+var _UDS_MSG_MONTH_ABBR_FEB = ('Feb');
+var _UDS_MSG_MONTH_ABBR_MAR = ('Mar');
+var _UDS_MSG_MONTH_ABBR_APR = ('Apr');
+var _UDS_MSG_MONTH_ABBR_MAY = ('May');
+var _UDS_MSG_MONTH_ABBR_JUN = ('Jun');
+var _UDS_MSG_MONTH_ABBR_JUL = ('Jul');
+var _UDS_MSG_MONTH_ABBR_AUG = ('Aug');
+var _UDS_MSG_MONTH_ABBR_SEP = ('Sep');
+var _UDS_MSG_MONTH_ABBR_OCT = ('Oct');
+var _UDS_MSG_MONTH_ABBR_NOV = ('Nov');
+var _UDS_MSG_MONTH_ABBR_DEC = ('Dec');
+var _UDS_MSG_DIRECTIONS = ('directions');
+var _UDS_MSG_CLEAR_RESULTS = ('clear results');
+var _UDS_MSG_SHOW_ONE_RESULT = ('show one result');
+var _UDS_MSG_SHOW_MORE_RESULTS = ('show more results');
+var _UDS_MSG_SHOW_ALL_RESULTS = ('show all results');
+var _UDS_MSG_SETTINGS = ('settings');
+var _UDS_MSG_SEARCH = ('search');
+var _UDS_MSG_SEARCH_UC = ('Search');
+var _UDS_MSG_POWERED_BY = ('powered by');
+function _UDS_MSG_LOCAL_ATTRIBUTION(LOCAL_RESULTS_PROVIDER) {return ('Business listings provided by ' + LOCAL_RESULTS_PROVIDER + '');}
+var _UDS_MSG_SEARCHER_BOOK = ('Book');
+function _UDS_MSG_FOUND_ON_PAGE(FOUND_ON_PAGE) {return ('Page ' + FOUND_ON_PAGE + '');}
+function _UDS_MSG_TOTAL_PAGE_COUNT(PAGE_COUNT) {return ('' + PAGE_COUNT + ' pages');}
+var _UDS_MSG_SEARCHER_BY = ('by');
+var _UDS_MSG_SEARCHER_CODE = ('Code');
+var _UDS_MSG_UNKNOWN_LICENSE = ('Unknown License');
+var _UDS_MSG_SEARCHER_GSA = ('Search Appliance');
+var _UDS_MSG_SEARCHCONTROL_MORERESULTS = ('More results');
+var _UDS_MSG_SEARCHCONTROL_PREVIOUS = ('Previous');
+var _UDS_MSG_SEARCHCONTROL_NEXT = ('Next');
+var _UDS_MSG_GET_DIRECTIONS = ('Get directions');
+var _UDS_MSG_GET_DIRECTIONS_TO_HERE = ('To here');
+var _UDS_MSG_GET_DIRECTIONS_FROM_HERE = ('From here');
+var _UDS_MSG_CLEAR_RESULTS_UC = ('Clear results');
+var _UDS_MSG_SEARCH_THE_MAP = ('search the map');
+var _UDS_MSG_SCROLL_THROUGH_RESULTS = ('scroll through results');
+var _UDS_MSG_EDIT_TAGS = ('edit tags');
+var _UDS_MSG_TAG_THIS_SEARCH = ('tag this search');
+var _UDS_MSG_SEARCH_STRING = ('search string');
+var _UDS_MSG_OPTIONAL_LABEL = ('optional label');
+var _UDS_MSG_DELETE = ('delete');
+var _UDS_MSG_DELETED = ('deleted');
+var _UDS_MSG_CANCEL = ('cancel');
+var _UDS_MSG_UPLOAD_YOUR_VIDEOS = ('upload your own video');
+var _UDS_MSG_IM_DONE_WATCHING = ('i\047m done watching this');
+var _UDS_MSG_CLOSE_VIDEO_PLAYER = ('close video player');
+var _UDS_MSG_NO_RESULTS = ('No Results');
+var _UDS_MSG_LINKEDCSE_ERROR_RESULTS = ('This Custom Search Engine is loading. Try again in a few seconds.');
+var _UDS_MSG_COUPONS = ('Coupons');
+var _UDS_MSG_BACK = ('back');
+var _UDS_MSG_SUBSCRIBE = ('Subscribe');
+var _UDS_MSG_SEARCHER_PATENT = ('Patent');
+var _UDS_MSG_USPAT = ('US Pat.');
+var _UDS_MSG_USPAT_APP = ('US Pat. App');
+var _UDS_MSG_PATENT_FILED = ('Filed');
+var _UDS_MSG_ADS_BY_GOOGLE = ('Ads by Google');
+var _UDS_MSG_SET_DEFAULT_LOCATION = ('Set default location');
+var _UDS_MSG_NEWSCAT_TOPSTORIES = ('Top Stories');
+var _UDS_MSG_NEWSCAT_WORLD = ('World');
+var _UDS_MSG_NEWSCAT_NATION = ('Nation');
+var _UDS_MSG_NEWSCAT_BUSINESS = ('Business');
+var _UDS_MSG_NEWSCAT_SCITECH = ('Sci/Tech');
+var _UDS_MSG_NEWSCAT_ENTERTAINMENT = ('Entertainment');
+var _UDS_MSG_NEWSCAT_HEALTH = ('Health');
+var _UDS_MSG_NEWSCAT_SPORTS = ('Sports');
+var _UDS_MSG_NEWSCAT_POLITICS = ('Politics');
+var b=true,c=null,g=false,i=encodeURIComponent,j=google_exportSymbol,aa=_UDS_CONST_SHORT_DATE_PATTERN,k=window,m=google,ba=navigator,o=undefined,ca=parseInt,da=parseFloat,ea=_UDS_CONST_LOCALE,p=document,fa=decodeURIComponent,q=Math;function ga(a,d){return a.onload=d}function ha(a,d){return a.onreadystatechange=d}function ia(a,d){return a.input=d}function ja(a,d){return a.width=d}function r(a,d){return a.innerHTML=d}function ka(a,d){return a.value=d}function la(a,d){return a.type=d}
+function ma(a,d){return a.visibility=d}function s(a,d){return a.title=d}function t(a,d){return a.className=d}function na(a,d){return a.checked=d}function oa(a,d){return a.onclick=d}function pa(a,d){return a.display=d}function qa(a,d){return a.execute=d}function u(a,d){return a.height=d}
+var v="appendChild",ra="push",sa="clearTimeout",w="input",x="width",ta="round",z="replace",ua="floor",va="content",xa="value",ya="indexOf",za="match",Aa="readyState",Ba="focus",A="createElement",C="setAttribute",Ca="cloneNode",Da="type",Ea="recordStat",Fa="ServiceBase",Ga="getTime",D="length",Ha="title",E="prototype",F="cursor",Ia="className",Ja="Version",Ka="checked",La="setTimeout",Ma="document",Na="split",Oa="userAgent",Pa="location",Qa="getComputedStyle",G="style",Ra="close",H="search",I="call",
+J="loader",Sa="currentStyle",Ta="console",Ua="action",Va="apply",Wa="navigator",K="CurrentLocale",L="execute",Xa="height",Ya="toLowerCase",Za="event",M;if(!m[H].NoOldNames){j("UDS_ServiceBase",m[J][Fa]);j("UDS_OriginalAppPath",m[J].OriginalAppPath);j("UDS_ApiKey",m[J].ApiKey);j("UDS_KeyVerified",m[J].KeyVerified);j("UDS_LoadFailure",m[J].LoadFailure);j("UDS_CurrentLocale",ea);j("UDS_ShortDatePattern",aa);j("UDS_Version",m[H][Ja]);j("UDS_JSHash",m[H].JSHash)}if(!N)var N=j;if(!O)var O=google_exportProperty;var P={};P.blank="&nbsp;";P.image=_UDS_MSG_SEARCHER_IMAGE;P.web=_UDS_MSG_SEARCHER_WEB;P.blog=_UDS_MSG_SEARCHER_BLOG;P.video=_UDS_MSG_SEARCHER_VIDEO;P.local=_UDS_MSG_SEARCHER_LOCAL;P.news=_UDS_MSG_SEARCHER_NEWS;P.book=_UDS_MSG_SEARCHER_BOOK;P.patent="Patent";P["ads-by-google"]=_UDS_MSG_ADS_BY_GOOGLE;P.cse="Custom Search Control";P.save=_UDS_MSG_SEARCHCONTROL_SAVE;P.keep=_UDS_MSG_SEARCHCONTROL_KEEP;P.include=_UDS_MSG_SEARCHCONTROL_INCLUDE;P.copy=_UDS_MSG_SEARCHCONTROL_COPY;P.close=_UDS_MSG_SEARCHCONTROL_CLOSE;
+P["sponsored-links"]=_UDS_MSG_SEARCHCONTROL_SPONSORED_LINKS;P["see-more"]=_UDS_MSG_SEARCHCONTROL_SEE_MORE;P.watermark=_UDS_MSG_SEARCHCONTROL_WATERMARK;P["search-location"]=_UDS_MSG_SEARCHER_CONFIG_SET_LOCATION;P["disable-address-lookup"]=_UDS_MSG_SEARCHER_CONFIG_DISABLE_ADDRESS_LOOKUP;P["sort-by-date"]=_UDS_MSG_SORT_BY_DATE;P.pbg=_UDS_MSG_BRANDING_STRING;P["n-minutes-ago"]=_UDS_MSG_MINUTES_AGO;P["n-hours-ago"]=_UDS_MSG_HOURS_AGO;P["one-hour-ago"]=_UDS_MSG_ONE_HOUR_AGO;P["all-n-related"]=_UDS_MSG_NEWS_ALL_N_RELATED;
+P["related-articles"]=_UDS_MSG_NEWS_RELATED;P["page-count"]=_UDS_MSG_TOTAL_PAGE_COUNT;var Q=[];Q[0]=_UDS_MSG_MONTH_ABBR_JAN;Q[1]=_UDS_MSG_MONTH_ABBR_FEB;Q[2]=_UDS_MSG_MONTH_ABBR_MAR;Q[3]=_UDS_MSG_MONTH_ABBR_APR;Q[4]=_UDS_MSG_MONTH_ABBR_MAY;Q[5]=_UDS_MSG_MONTH_ABBR_JUN;Q[6]=_UDS_MSG_MONTH_ABBR_JUL;Q[7]=_UDS_MSG_MONTH_ABBR_AUG;Q[8]=_UDS_MSG_MONTH_ABBR_SEP;Q[9]=_UDS_MSG_MONTH_ABBR_OCT;Q[10]=_UDS_MSG_MONTH_ABBR_NOV;Q[11]=_UDS_MSG_MONTH_ABBR_DEC;P["month-abbr"]=Q;P.directions=_UDS_MSG_DIRECTIONS;
+P["clear-results"]=_UDS_MSG_CLEAR_RESULTS;P["show-one-result"]=_UDS_MSG_SHOW_ONE_RESULT;P["show-more-results"]=_UDS_MSG_SHOW_MORE_RESULTS;P["show-all-results"]=_UDS_MSG_SHOW_ALL_RESULTS;P.settings=_UDS_MSG_SETTINGS;P.search=_UDS_MSG_SEARCH;P["search-uc"]=_UDS_MSG_SEARCH_UC;P["powered-by"]=_UDS_MSG_POWERED_BY;P.sa=_UDS_MSG_SEARCHER_GSA;P.by=_UDS_MSG_SEARCHER_BY;P.code=_UDS_MSG_SEARCHER_CODE;P["unknown-license"]=_UDS_MSG_UNKNOWN_LICENSE;P["more-results"]=_UDS_MSG_SEARCHCONTROL_MORERESULTS;
+P.previous=_UDS_MSG_SEARCHCONTROL_PREVIOUS;P.next=_UDS_MSG_SEARCHCONTROL_NEXT;P["get-directions"]=_UDS_MSG_GET_DIRECTIONS;P["to-here"]=_UDS_MSG_GET_DIRECTIONS_TO_HERE;P["from-here"]=_UDS_MSG_GET_DIRECTIONS_FROM_HERE;P["clear-results-uc"]=_UDS_MSG_CLEAR_RESULTS_UC;P["search-the-map"]=_UDS_MSG_SEARCH_THE_MAP;P["scroll-results"]=_UDS_MSG_SCROLL_THROUGH_RESULTS;P["edit-tags"]=_UDS_MSG_EDIT_TAGS;P["tag-search"]=_UDS_MSG_TAG_THIS_SEARCH;P["search-string"]=_UDS_MSG_SEARCH_STRING;P["optional-label"]=_UDS_MSG_OPTIONAL_LABEL;
+P["delete"]=_UDS_MSG_DELETE;P.deleted=_UDS_MSG_DELETED;P.cancel=_UDS_MSG_CANCEL;P["upload-video"]=_UDS_MSG_UPLOAD_YOUR_VIDEOS;P["im-done"]=_UDS_MSG_IM_DONE_WATCHING;P["close-player"]=_UDS_MSG_CLOSE_VIDEO_PLAYER;P["no-results"]=_UDS_MSG_NO_RESULTS;P["linked-cse-error-results"]=_UDS_MSG_LINKEDCSE_ERROR_RESULTS;P.back=_UDS_MSG_BACK;P.subscribe=_UDS_MSG_SUBSCRIBE;P["us-pat"]="US Pat.";P["us-pat-app"]="US Pat. App";P["us-pat-filed"]="Filed";function $a(a,d){var e=function(){};e.prototype=d[E];a.prototype=new e;a[E].Mg=function(f){var h=Array[E].splice[Va](arguments,[1,arguments[D]]);return f[Va](a,h)}}var _json_cache_defeater_=(new Date)[Ga](),_json_request_require_prep=b;function ab(a,d){bb("msie")&&cb("msie 6.0")?k[La](R(this,db,[a,d]),0):db(a,d)}function eb(a){_json_request_require_prep=g;ab(a,c);_json_request_require_prep=b}
+function db(a,d){var e=p.getElementsByTagName("head")[0];e||(e=p.body.parentNode[v](p[A]("head")));var f=p[A]("script");la(f,"text/javascript");f.charset="utf-8";a=_json_request_require_prep?a+"&key="+m[J].ApiKey+"&v="+d:a;if(fb()||gb())a=a+"&nocache="+_json_cache_defeater_++;f.src=a;var h=function(){ga(f,c);f.parentNode.removeChild(f);delete f};a=function(l){l=(l?l:k[Za]).target?(l?l:k[Za]).target:(l?l:k[Za]).srcElement;if(l[Aa]=="loaded"||l[Aa]=="complete"){ha(l,c);h()}};if(ba.product=="Gecko")ga(f,
+h);else ha(f,a);e[v](f)}function hb(a,d){return function(){return d[Va](a,arguments)}}function R(a,d,e){return function(){return d[Va](a,e)}}function ib(a){for(;a.firstChild;)a.removeChild(a.firstChild)}function jb(a,d){if(a)try{ib(a);a[v](d)}catch(e){}return d}function T(a,d){try{a[v](d)}catch(e){}return d}function kb(a){return p.createTextNode(a?a:"")}function U(a,d){var e=p[A]("div");if(a)r(e,a);if(d)t(e,d);return e}function lb(a,d){var e=p[A]("div");a&&T(e,kb(a));if(d)t(e,d);return e}
+function V(a){var d=p[A]("div");if(a)t(d,a);return d}function mb(a,d){var e=p[A]("span");a&&T(e,kb(a));if(d)t(e,d);return e}function nb(a,d,e){var f=p[A]("table");f[C]("cellSpacing",a?a:0);f[C]("cellPadding",d?d:0);if(e)t(f,e);return f}function ob(a,d,e){(a=a.insertRow(-1))||alert(a);for(var f=0;f<d;f++)X(a,e);return a}function X(a,d){a=a.insertCell(-1);if(d)t(a,d);return a}function pb(a){var d=p[A]("td");if(a)t(d,a);return d}
+function qb(a,d,e,f){var h=p[A]("img");h.src=a;if(d)ja(h,d);if(e)u(h,e);if(f)t(h,f);return h}function rb(a,d,e,f,h){var l=p[A]("a");l.href=a;if(d)f?T(l,mb(d,f)):T(l,kb(d));if(e)l.target=e;if(h)s(l,h);return l}function Y(a,d,e,f,h){var l=U(c,f),n=p[A]("a");n.href=a;r(n,d);if(f)t(n,f);if(e)n.target=e;if(h)s(n,h);l[v](n);return l}function sb(a,d,e,f,h){var l=U(c,f),n=p[A]("a");n.href=a;d&&T(n,kb(d));if(f)t(n,f);if(e)n.target=e;if(h)s(n,h);l[v](n);return l}
+function tb(a){var d=p[A]("form");if(a)t(d,a);return d}function ub(a,d){var e=p[A]("input");la(e,"submit");ka(e,a);if(d)t(e,d);return e}function vb(a,d,e){var f=p[A]("input");f[C]("autoComplete","off");la(f,"text");if(a==-1)Z(f,"util-css-expand");else f.size=a>0?a:10;d&&wb(f,d);if(e)ka(f,e);return f}function xb(a,d,e,f){var h=p[A]("input");la(h,"checkbox");h.name=a;ka(h,d);if(f)t(h,f);if(e)na(h,e);return h}function yb(a,d){t(a,d)}function wb(a,d){Z(a,d)}function zb(a,d){$(a,d)}
+function Z(a,d){var e;a:{if(!(a==c||a[Ia]==c)){e=a[Ia][Na](" ");for(var f=0;f<e[D];f++)if(e[f]==d){e=b;break a}}e=g}e||(a.className+=" "+d)}function $(a,d){if(a[Ia]!=c){for(var e=a[Ia][Na](" "),f=[],h=g,l=0;l<e[D];l++)if(e[l]!=d)e[l]&&f[ra](e[l]);else h=b;if(h)t(a,f.join(" "))}}function Ab(a){if(Bb!="")return Bb;var d=a[Ya]()[Na](".");if(d[D]<2)Bb=".com";a=d.pop();d=d.pop();return Bb=a[D]==2?Cb[d]&&Cb[d][a]==1?"."+d+"."+a:"."+a:".com"}
+var Bb="",Cb={pf:{Vg:1,Zg:1,hh:1,id:1,ih:1,"in":1,kh:1,mh:1,nh:1,oh:1,rh:1,Ah:1,Ph:1,Th:1,Uh:1,Yh:1,Zh:1,bi:1},Wg:{Ng:1,Pg:1,Rg:1,Sg:1,Tg:1,Ug:1,pf:1,$g:1,"do":1,ah:1,bh:1,dh:1,eh:1,fh:1,gh:1,lh:1,sh:1,th:1,uh:1,vh:1,wh:1,xh:1,yh:1,zh:1,Ch:1,Dh:1,Eh:1,Fh:1,Gh:1,Hh:1,Kh:1,Mh:1,Oh:1,Qh:1,Rh:1,Sh:1,Wh:1,Xh:1,ai:1},Bh:{Og:1}};function bb(a){if(a in Db)return Db[a];return Db[a]=ba[Oa][Ya]()[ya](a)!=-1}function cb(a){if(a in Eb)return Eb[a];return Eb[a]=ba.appVersion[Ya]()[ya](a)!=-1}var Db={},Eb={};
+function fb(){return bb("msie")}function gb(){return bb("safari")||bb("konqueror")}var Fb,Gb;if(k.Lg){Fb=b;if(k.XMLHttpRequest)Gb=b}function Hb(a){this.bc=a+"branding";this.Sb=a+"branding-vertical";this.jh=a+"branding-img";this.Vh=a+"branding-user-defined";this.qe=a+"branding-img-noclear";this.of=a+"branding-clickable";this.text=a+"branding-text"};m[H].a=function(){this.fa=this.Xg=c;this.Fc=this.Gg=0;this.ke=b;this.M={width:100,height:75};this.Fa=m[H].a.db;this.we=1;this.S(m[H].a.X);this.$d();this.gwsUrl=this.u=this.H=this.Lh=this.w=this.Kb=this.Cb=this.bb=this.tc=this.Pb=this.ic=this.gc=c;this.pa=[];this.me=typeof k==="object"&&k[Pa]&&k[Pa].hostname&&k[Pa].hostname!=""?Ab(k[Pa].hostname):".com";this.rb=this.lb=c};N("google.search.Search",m[H].a);m[H].a.Jc=m[J][Fa];O(m[H].a,"BASE",m[H].a.Jc);m[H].a.la="large";O(m[H].a,"LARGE_RESULTSET",m[H].a.la);
+m[H].a.X="small";O(m[H].a,"SMALL_RESULTSET",m[H].a.X);m[H].a.Ma="filtered_cse";O(m[H].a,"FILTERED_CSE_RESULTSET",m[H].a.Ma);m[H].a.Te=8;O(m[H].a,"LARGE_RESULTS",m[H].a.Te);m[H].a.cf=4;O(m[H].a,"SMALL_RESULTS",m[H].a.cf);m[H].a.Ne=10;O(m[H].a,"FILTERED_CSE_RESULTS",m[H].a.Ne);m[H].a.od=5E3;O(m[H].a,"KEEP_SWEEPER_DELAY",m[H].a.od);m[H].a.We="_top";O(m[H].a,"LINK_TARGET_TOP",m[H].a.We);m[H].a.Ve="_self";O(m[H].a,"LINK_TARGET_SELF",m[H].a.Ve);m[H].a.Ue="_parent";O(m[H].a,"LINK_TARGET_PARENT",m[H].a.Ue);
+m[H].a.db="_blank";O(m[H].a,"LINK_TARGET_BLANK",m[H].a.db);m[H].a.eb="order-by-relevance";O(m[H].a,"ORDER_BY_RELEVANCE",m[H].a.eb);m[H].a.ma="order-by-date";O(m[H].a,"ORDER_BY_DATE",m[H].a.ma);m[H].a.rd="order-by-ascending-date";O(m[H].a,"ORDER_BY_ASCENDING_DATE",m[H].a.rd);m[H].a.Db="restrict-type";O(m[H].a,"RESTRICT_TYPE",m[H].a.Db);m[H].a.Ub="restrict-safesearch";O(m[H].a,"RESTRICT_SAFESEARCH",m[H].a.Ub);m[H].a.Wb="active";O(m[H].a,"SAFESEARCH_STRICT",m[H].a.Wb);m[H].a.Vb="off";
+O(m[H].a,"SAFESEARCH_OFF",m[H].a.Vb);m[H].a.Ad="moderate";O(m[H].a,"SAFESEARCH_MODERATE",m[H].a.Ad);m[H].a.Na="restrict-extended";O(m[H].a,"RESTRICT_EXTENDED_ARGS",m[H].a.Na);m[H].a.Ag=P;O(m[H].a,"strings",m[H].a.Ag);m[H].a[E].dg=function(){var a=this.na+"?hl="+m[H][K]+"&source=uds";a+=this.u?this.u:"&q=";return this.wa&&this.wa!=""?this.wa:a};m[H].a[E].sg=function(a){this.H=a==c||a==""?c:a};O(m[H].a[E],"setQueryAddition",m[H].a[E].sg);
+m[H].a[E].ya=function(a,d,e){a=m[H].a.Jc+this.Ba+"?callback="+a+"&context="+d+"&lstkp="+this.nf()+"&rsz="+this.za+"&hl="+m[H][K];if(this.wb)a+="&source="+i(this.wb);if(this.me)a+="&gss="+this.me;if(m[H].JSHash)a+="&sig="+m[H].JSHash;if(e)a+="&start="+e;return a};m[H].a[E].wg=function(a){this.wb=a};O(m[H].a[E],"setSearcherSrc",m[H].a[E].wg);m[H].a[E].xb=function(a){this.Fa=a};O(m[H].a[E],"setLinkTarget",m[H].a[E].xb);M=m[H].a[E];M.s=function(){return this.Fa&&this.Fa!=""?this.Fa:c};
+M.Lf=function(){this.Gg++;this.Fc++;this.Kb&&k[sa](this.Kb);this.Kb=k[La](R(this,this[L],[c]),m[H].a.od)};M.nf=function(){k[sa](this.Kb);var a=this.Fc;this.Fc=0;return a};M.nc=function(){if(this.gc==c)this.gc="gsc-"+this.w+"Result";return this.gc};M.ia=function(){if(this.ic==c)this.ic="gs-"+this.w+"Result";return this.ic};M.Hf=function(){if(this.Pb==c)this.Pb=P[this.w];return this.bb?this.bb:this.Pb};M.Ff=function(){if(this.tc==c)this.tc=P[this.w];return this.bb?this.bb:this.tc};M.Gf=function(){return this.za};
+O(m[H].a[E],"getResultSetSize",m[H].a[E].Gf);m[H].a[E].S=function(a){switch(a){case m[H].a.la:this.za=m[H].a.la;break;default:case m[H].a.X:this.za=m[H].a.X;break}};O(m[H].a[E],"setResultSetSize",m[H].a[E].S);qa(m[H].a[E],function(a){var d=(new Date)[Ga]();this.Ec=d%100==1?d:-1;d=this.ha(a,c,c);d+=this.Wa?"&"+this.Wa:"";if(k._googleudsextrastuff)d+=k._googleudsextrastuff;this.cursor=c;this.Rf=a;ab(d,m[H][Ja]);if(this.pa&&this.pa[D]>0)for(d=0;d<this.pa[D];d++)this.pa[d][L](a)});
+O(m[H].a[E],"execute",m[H].a[E][L]);m[H].a[E].ne=function(a){if(this[F]&&a<this[F].pages[D]){a=this.ha(this.Rf,c,c,this[F].pages[a].start);this.cursor=c;ab(a,m[H][Ja])}};O(m[H].a[E],"gotoPage",m[H].a[E].ne);m[H].a[E].ef=function(a){this.pa&&this.pa[ra](a)};O(m[H].a[E],"addRelatedSearcher",m[H].a[E].ef);m[H].a[E].Ef=function(a,d,e){return this.ha(a,d,e)+"&key="+m[J].ApiKey+"&v="+m[H][Ja]};O(m[H].a[E],"getExecuteUrl",m[H].a[E].Ef);
+m[H].a[E].ta=function(a){var d=Y("http://code.google.com/apis/ajaxsearch/faq.html",P.watermark+" - "+this.qf(),"_blank","gs-watermark");T(a,d)};m[H].a[E].qf=function(){var a=new Date;return a.getMonth()+1+"/"+a.getFullYear()};
+m[H].a[E].Va=function(a){var d;d=a.getFullYear();var e=a.getMonth(),f=P["month-abbr"][e];a=a.getDate();if(a<10)a="0"+a;switch(m[H].ShortDatePattern){case "MDY":d=f+" "+a+", "+d;break;case "YMD":if(m[H][K]=="zh-CN"||m[H][K]=="zh-TW"||m[H][K]=="ja"||m[H][K]=="ko"){f=Ib[m[H][K]];d=d+f.year+(e+1)+f.month+a+f.day}else d=d+" "+f+" "+a;break;default:case "DMY":d=a+" "+f+" "+d;break}return d};O(m[H].a[E],"formatToShortDate",m[H].a[E].Va);
+var Ib={"zh-CN":{month:" \u6708 ",year:" \u5e74 ",day:" \u65e5 "},"zh-TW":{month:" \u6708 ",year:" \u5e74 ",day:" \u65e5 "},ja:{month:"\u6708",year:"\u5e74",day:"\u65e5"},ko:{month:" \uc6d4 ",year:" \ub144 ",day:" \uc77c "}};m[H].a.pd=36E5;m[H].a.bf=6E4;m[H].a.af=864E5;
+m[H].a[E].mc=function(a){var d=(new Date)[Ga](),e=a[Ga]();if(d<e)return P["n-minutes-ago"](2);d=d-e;if(d<m[H].a.pd){a=q[ua](d/m[H].a.bf);a=a<=1?2:a;return P["n-minutes-ago"](a)}if(d<m[H].a.af){a=q[ua](d/m[H].a.pd);if(a<=1)return P["one-hour-ago"];else{a=a;return P["n-hours-ago"](a)}}return this.Va(a)};O(m[H].a[E],"formatToRelativeDate",m[H].a[E].mc);m[H].a[E].$d=function(){this.Ih=this.gwsUrl=c;this.results=[]};O(m[H].a[E],"clearResults",m[H].a[E].$d);
+m[H].a[E].zf=function(){this.ae&&this.ae();if(this.Ec!=-1){m[J][Ea]("asa_"+this.w,"req."+((new Date)[Ga]()-this.Ec),b);this.Ec=-1}};
+m[H].a[E].W=function(a,d,e,f){if(!(a==c&&d==204)){this.gwsUrl=c;if(this.results&&this.results[D]>0)for(var h=0;h<this.results[D];h++)this.results[h].html&&Jb(this.results[h].html);if(a&&a.results&&a.results[D]>0){this.results=a.results;if(a[F]&&a[F].moreResultsUrl)this.gwsUrl=this.wa&&this.wa!=""?this.wa:a[F].moreResultsUrl;else if(this.u&&this.na)this.gwsUrl=this.dg()}else this.results=[];this.completionStatus=d;this.hashStatus=f;this.Yg=e;this.ze=a&&a.resultAttribution&&a.resultAttribution!=c&&
+a.resultAttribution!=""?a.resultAttribution:c;if(a&&a[F]&&a[F].pages&&a[F].pages[D]>0)this.cursor=a[F];else typeof this[F]!="undefined"&&delete this[F];if(a&&a.context)this.context=a.context;else typeof this.context!="undefined"&&delete this.context;if(a&&a.promotions)this.promotions=a.promotions;else typeof this.promotions!="undefined"&&delete this.promotions;if(a&&a.omittedResults)this.omittedResults=a.omittedResults;else typeof this.omittedResults!="undefined"&&delete this.omittedResults;this.ke&&
+this.hf();this.zf()}};O(m[H].a[E],"onSearchComplete",m[H].a[E].W);m[H].a[E].le=function(){var a=c;if(this.ze)a=U(this.ze,"gs-results-attribution");return a};O(m[H].a[E],"getAttribution",m[H].a[E].le);m[H].a[E].hf=function(){var a,d;for(a=0;a<this.results[D];a++){d=this.results[a];this.C(d)}};m[H].a[E].zb=function(a,d,e){e||(e=[c]);this.ae=R(a,d,e)};O(m[H].a[E],"setSearchCompleteCallback",m[H].a[E].zb);
+m[H].a.ka=function(a,d){var e=g,f;if(a[D])for(var h=0;h<a[D];h++)if(a[h]==c){a[h]=d;f=h;e=b;break}if(!e){f=a[D];a[ra](d)}return f};O(m[H].a,"AllocateCompletionMapContext",m[H].a.ka);m[H].a[E].Bb=function(a){this.bb=a};O(m[H].a[E],"setUserDefinedLabel",m[H].a[E].Bb);m[H].a[E].yg=function(a){this.Cb=a};O(m[H].a[E],"setUserDefinedClassSuffix",m[H].a[E].yg);m[H].a[E].qg=function(){this.ke=g};O(m[H].a[E],"setNoHtmlGeneration",m[H].a[E].qg);
+m[H].a.$a=function(a,d,e,f,h){var l=q.min(q.min(e[x]/a,e[Xa]/d),1),n={};ja(n,q[ta](a*l));u(n,q[ta](d*l));if(f){ja(f,n[x]);u(f,n[Xa]);if(h)f[G].left=(e[x]-n[x])/2+"px"}return n};O(m[H].a,"scaleImage",m[H].a.$a);m[H].a.Qd=1;O(m[H].a,"VERTICAL_BRANDING",m[H].a.Qd);m[H].a.Oe=2;O(m[H].a,"HORIZONTAL_BRANDING",m[H].a.Oe);
+m[H].a.Cf=function(a,d,e){var f=d&&d==m[H].a.Qd,h=new Hb("gsc-");d=V(h.bc);var l=nb(c,c,h.bc);T(d,l);f=!f;if(!f){Z(d,h.Sb);Z(l,h.Sb)}var n=ob(l,0),y,B;if(f)B=y=n;else{y=n;B=ob(l,0)}var W="/css/small-logo.png",S=51;n=15;if(e)if(typeof e=="string")if(e[za](/^http:\/\/www\.youtube\.com/)){W="/css/youtube-logo-55x24.png";S=55;n=24;Z(d,h.bc+"-youtube");if(!f){Z(d,h.Sb+"-youtube");Z(l,h.Sb+"-youtube")}}f=X(y,h.text);l=X(B,h.qe);y=U(P["powered-by"],h.text);W=m[J][Fa]+W;S=S;n=n;B=h.qe;if(Fb&&!Gb){B=V(B);
+B[G].filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+W+'")';ja(B[G],S+"px");u(B[G],n+"px")}else B=qb(W,c,c,B);n=B;T(f,y);if(e){f="http://www.google.com";if(typeof e=="string"&&(e[za](/^http:\/\/[a-z]*\.google\.com/)||e[za](/^http:\/\/www\.youtube\.com/)))f=e;e=rb(f,c,"_BLANK");t(e,h.of);T(e,n);T(l,e)}else T(l,n);if(a){a=typeof a=="string"?p.getElementById(a):a;ib(a);T(a,d)}return d};O(m[H].a,"getBranding",m[H].a.Cf);m[H].a.setOnLoadCallback=function(a,d){m.setOnLoadCallback(a,d)};
+O(m[H].a,"setOnLoadCallback",m[H].a.setOnLoadCallback);var Kb;function Jb(a){Kb||(Kb=p[A]("DIV"));Kb[v](a);r(Kb,"")}m[H].a[E].Af=function(a){var d=this.lb;if(a)d=a;a={};var e=V(this.ia());Z(e,"gs-result");Z(e,"gs-error-result");d=U(d,"gs-snippet");T(e,d);a.html=e;return a};m[H].a[E].Bf=function(a){var d=this.rb;if(a)d=a;a={};var e=V(this.ia());Z(e,"gs-result");Z(e,"gs-no-results-result");d=U(d,"gs-snippet");T(e,d);a.html=e;return a};j("google.search.CurrentLocale",ea);
+j("google.search.ShortDatePattern",aa);m[H].q=function(){m[H].a[I](this);this.w="blog";this.Ba="/GblogSearch";this.na="http://blogsearch.google.com/blogsearch";this.l=c;this.N=g;this.Ta=b;this.fa=hb(this,m[H].q[E].oa);this.Sa="gsc-blogConfig";this.o=c};N("google.search.BlogSearch",m[H].q);$a(m[H].q,m[H].a);m[H].q.B="GblogSearch";O(m[H].q,"RESULT_CLASS",m[H].q.B);m[H].q.n=[];m[H].q.I=function(a,d,e,f,h){var l=0;if(a)l=ca(a,10);a=m[H].q.n[l];m[H].q.n[l]=c;a.W(d,e,f,h)};O(m[H].q,"RawCompletion",m[H].q.I);
+m[H].q[E].ha=function(a,d,e,f){e=e==c?m[H].a.ka(m[H].q.n,this):e;d=this.ya(d==c?"google.search.BlogSearch.RawCompletion":d,e,f);if(a){a=a;if(this.H)a=a+" "+this.H;if(this.l)a=a+" blogurl:"+this.l;a="&q="+i(a);if(this.N)a+="&scoring=d";d+=a;this.u=a}return d};
+m[H].q[E].C=function(a){a.html&&delete a.html;var d=V(this.ia());Z(d,"gs-result");var e;e=Y(a.postUrl,a[Ha],this.s(),"gs-title");T(d,e);e=new Date(a.publishedDate);e=U(this.Va(e),"gs-publishedDate");T(d,e);e=new Date(a.publishedDate);e=U(this.mc(e),"gs-relativePublishedDate");T(d,e);e=U(a[va],"gs-snippet");T(d,e);e=Y(a.blogUrl,a.blogUrl,this.s(),"gs-visibleUrl");T(d,e);a.html=d;this.ta(a.html)};O(m[H].q[E],"createResultHtml",m[H].q[E].C);m[H].q[E].qa=function(a){this.l=a==c||a==""?c:a};
+O(m[H].q[E],"setSiteRestriction",m[H].q[E].qa);m[H].q[E].K=function(a){this.N=a==m[H].a.ma?b:g};O(m[H].q[E],"setResultOrder",m[H].q[E].K);
+m[H].q[E].oa=function(a,d){if(d){if(this.o==c){d=V("gsc-configSetting");this.o=xb(c,"0",this.N,"gsc-configSettingCheckbox");T(d,this.o);T(d,U(P["sort-by-date"],"gsc-configSettingCheckboxLabel"));var e=V("gsc-configSettingSubmit");T(e,ub(P[Ra],"gsc-configSettingSubmit"));T(d,e);T(a,d)}else na(this.o,this.N);this.o[Ba]()}else if(this.o)this.o[Ka]?this.K(m[H].a.ma):this.K(m[H].a.eb)};m[H].k=function(){m[H].a[I](this);this.w="book";this.Ba="/GbookSearch";this.na="http://books.google.com/books";this.Jb=g;this.Gc=c};N("google.search.BookSearch",m[H].k);$a(m[H].k,m[H].a);m[H].k.B="GbookSearch";O(m[H].k,"RESULT_CLASS",m[H].k.B);m[H].k.Pd="user-list";O(m[H].k,"USER_LIST",m[H].k.Pd);m[H].k.Hd=1;O(m[H].k,"TYPE_ALL_BOOKS",m[H].k.Hd);m[H].k.Ld=2;O(m[H].k,"TYPE_FULL_VIEW_BOOKS",m[H].k.Ld);m[H].k.n=[];
+m[H].k.I=function(a,d,e,f,h){var l=0;if(a)l=ca(a,10);a=m[H].k.n[l];m[H].k.n[l]=c;a.W(d,e,f,h)};O(m[H].k,"RawCompletion",m[H].k.I);m[H].k[E].ha=function(a,d,e,f){e=e==c?m[H].a.ka(m[H].k.n,this):e;d=this.ya(d==c?"google.search.BookSearch.RawCompletion":d,e,f);if(a){a=a;if(this.H)a=a+" "+this.H;a="&q="+i(a);if(this.Jb)a+="&as_brr=1";if(this.Gc)a=a+"&as_list="+this.Gc;d+=a;this.u=a}return d};
+m[H].k[E].C=function(a){a.html&&delete a.html;a.thumbnailHtml=this.hc(a);var d=V(this.ia());Z(d,"gs-result");var e=V("gs-text-box"),f=nb(),h=ob(f,0),l=X(h,"gs-image-box");h=X(h,"gs-text-box");T(l,a.thumbnailHtml[Ca](b));T(h,e);T(d,f);f=Y(a.unescapedUrl,a[Ha],this.s(),"gs-title");T(e,f);f=U(P.by+"&nbsp;"+a.authors,"gs-author");T(e,f);f=V("gs-spacer");T(e,f);if(a.publishedYear){f=U(a.publishedYear,"gs-publishedDate");T(e,f)}if(ca(a.pageCount,10)>0){f=U("-&nbsp;"+P["page-count"](a.pageCount),"gs-pageCount");
+T(e,f)}f=Y("http://books.google.com","books.google.com",this.s(),"gs-visibleUrl");T(e,f);a.html=d;this.ta(a.html)};O(m[H].k[E],"createResultHtml",m[H].k[E].C);
+m[H].k[E].hc=function(a){var d=V("gs-image-box gs-book-image-box"),e=V("gs-row-1"),f=qb("http://books.google.com/googlebooks/pages-trans.gif",c,c,"gs-pages");T(e,f);f=qb("http://books.google.com/googlebooks/p_edge-trans.gif",c,c,"gs-page-edge");T(e,f);T(d,e);e=V("gs-row-2");f=m[H].a.$a(a.tbWidth,a.tbHeight,this.M);f=qb(a.tbUrl,f[x],f[Xa],"gs-image");a=rb(a.unescapedUrl,c,this.s(),"gs-image");t(a,"gs-image");T(a,f);T(e,a);T(d,e);return d};
+m[H].k[E].R=function(a,d){if(a==m[H].a.Db)if(d)if(d==m[H].k.Hd)this.Jb=g;else if(d==m[H].k.Ld)this.Jb=b;else this.R(a,c);else this.Jb=g;else if(a==m[H].k.Pd)this.Gc=d&&d[za](/^[a-zA-Z0-9\-_]*$/)?d:c};O(m[H].k[E],"setRestriction",m[H].k[E].R);m[H].c=function(){m[H].a[I](this);this.we=2;this.w="image";this.Ba="/GimageSearch";this.na="http://images.google.com/images";this.l=this.yc=this.lc=this.rc=this.pc=this.oc=this.qc=this.Ha=c;this.M={width:112,height:84}};N("google.search.ImageSearch",m[H].c);$a(m[H].c,m[H].a);m[H].c.B="GimageSearch";O(m[H].c,"RESULT_CLASS",m[H].c.B);m[H].c.yd="restrict-imagesize";O(m[H].c,"RESTRICT_IMAGESIZE",m[H].c.yd);m[H].c.Se=["icon"];O(m[H].c,"IMAGESIZE_SMALL",m[H].c.Se);m[H].c.Re=["small","medium","large","xlarge"];
+O(m[H].c,"IMAGESIZE_MEDIUM",m[H].c.Re);m[H].c.Qe=["xxlarge"];O(m[H].c,"IMAGESIZE_LARGE",m[H].c.Qe);m[H].c.Pe=["huge"];O(m[H].c,"IMAGESIZE_EXTRA_LARGE",m[H].c.Pe);m[H].c.vd="restrict-coloration";O(m[H].c,"RESTRICT_COLORIZATION",m[H].c.vd);m[H].c.Kc="mono";O(m[H].c,"COLORIZATION_BLACK_AND_WHITE",m[H].c.Kc);m[H].c.Mc="gray";O(m[H].c,"COLORIZATION_GRAYSCALE",m[H].c.Mc);m[H].c.Lc="color";O(m[H].c,"COLORIZATION_COLOR",m[H].c.Lc);m[H].c.ud="restrict-colorfilter";O(m[H].c,"RESTRICT_COLORFILTER",m[H].c.ud);
+m[H].c.Vc="red";O(m[H].c,"COLOR_RED",m[H].c.Vc);m[H].c.Sc="orange";O(m[H].c,"COLOR_ORANGE",m[H].c.Sc);m[H].c.Yc="yellow";O(m[H].c,"COLOR_YELLOW",m[H].c.Yc);m[H].c.Rc="green";O(m[H].c,"COLOR_GREEN",m[H].c.Rc);m[H].c.Wc="teal";O(m[H].c,"COLOR_TEAL",m[H].c.Wc);m[H].c.Oc="blue";O(m[H].c,"COLOR_BLUE",m[H].c.Oc);m[H].c.Uc="purple";O(m[H].c,"COLOR_PURPLE",m[H].c.Uc);m[H].c.Tc="pink";O(m[H].c,"COLOR_PINK",m[H].c.Tc);m[H].c.Xc="white";O(m[H].c,"COLOR_WHITE",m[H].c.Xc);m[H].c.Qc="gray";
+O(m[H].c,"COLOR_GRAY",m[H].c.Qc);m[H].c.Nc="black";O(m[H].c,"COLOR_BLACK",m[H].c.Nc);m[H].c.Pc="brown";O(m[H].c,"COLOR_BROWN",m[H].c.Pc);m[H].c.xd="restrict-filetype";O(m[H].c,"RESTRICT_FILETYPE",m[H].c.xd);m[H].c.bd="jpg";O(m[H].c,"FILETYPE_JPG",m[H].c.bd);m[H].c.cd="png";O(m[H].c,"FILETYPE_PNG",m[H].c.cd);m[H].c.ad="gif";O(m[H].c,"FILETYPE_GIF",m[H].c.ad);m[H].c.$c="bmp";O(m[H].c,"FILETYPE_BMP",m[H].c.$c);m[H].c.zd="restrict-imagetype";O(m[H].c,"RESTRICT_IMAGETYPE",m[H].c.zd);m[H].c.ed="face";
+O(m[H].c,"IMAGETYPE_FACES",m[H].c.ed);m[H].c.dd="clipart";O(m[H].c,"IMAGETYPE_CLIPART",m[H].c.dd);m[H].c.fd="lineart";O(m[H].c,"IMAGETYPE_LINEART",m[H].c.fd);m[H].c.gd="news";O(m[H].c,"IMAGETYPE_NEWS",m[H].c.gd);m[H].c.hd="photo";O(m[H].c,"IMAGETYPE_PHOTO",m[H].c.hd);m[H].c.td="restrict";O(m[H].c,"RESTRICT",m[H].c.td);m[H].c.wd="cc_attribute";O(m[H].c,"RESTRICT_CREATIVE_COMMONS",m[H].c.wd);m[H].c.n=[];m[H].c.I=function(a,d,e,f,h){var l=0;if(a)l=ca(a,10);a=m[H].c.n[l];m[H].c.n[l]=c;a.W(d,e,f,h)};
+O(m[H].c,"RawCompletion",m[H].c.I);
+m[H].c[E].ha=function(a,d,e,f){e=e==c?m[H].a.ka(m[H].c.n,this):e;d=this.ya(d==c?"google.search.ImageSearch.RawCompletion":d,e,f);if(a){a=a;if(this.H)a=a+" "+this.H;a="&q="+i(a);if(this.Ha)a=a+"&safe="+this.Ha;if(this.qc)a=a+"&imgsz="+i(this.qc);if(this.oc)a=a+"&imgc="+i(this.oc);if(this.pc)a=a+"&imgcolor="+i(this.pc);if(this.rc)a=a+"&imgtype="+i(this.rc);if(this.lc)a=a+"&as_filetype="+i(this.lc);if(this.yc)a=a+"&restrict="+i(this.yc);if(this.l)a=a+"&as_sitesearch="+i(this.l);d+=a;this.u=a;if(f&&f!=
+0)this.u=this.u+"&start="+f}return d};
+m[H].c[E].C=function(a){a.html&&delete a.html;var d=V(this.ia());Z(d,"gs-result");var e=V("gs-image-box"),f=m[H].a.$a(a.tbWidth,a.tbHeight,this.M),h=qb(a.tbUrl,f[x],f[Xa],"gs-image");h[G].left=(this.M[x]-f[x])/2+"px";s(h,a.titleNoFormatting+" ("+a.visibleUrl+")");f=rb(a.unescapedUrl,c,this.s(),"gs-image");t(f,"gs-image");T(f,h);T(e,f);T(d,e);e=V("gs-text-box");h=U(a[va],"gs-snippet");s(h,a.contentNoFormatting);T(e,h);h=U(a[x]+" x "+a[Xa],"gs-size");T(e,h);h=Y(a.originalContextUrl,a.visibleUrl,this.s(),
+"gs-visibleUrl");s(h,a.visibleUrl);T(e,h);T(d,e);a.html=d;this.ta(a.html)};O(m[H].c[E],"createResultHtml",m[H].c[E].C);m[H].c[E].qa=function(a){this.l=a};O(m[H].c[E],"setSiteRestriction",m[H].c[E].qa);
+m[H].c[E].R=function(a,d){if(a==m[H].a.Ub)this.Ha=d?d==m[H].a.Wb||d==m[H].a.Vb?d:c:c;else if(a==m[H].c.yd)this.qc=d?d.join("|"):c;else if(a==m[H].c.vd)this.oc=d?d==m[H].c.Kc||d==m[H].c.Mc||d==m[H].c.Lc?d:c:c;else if(a==m[H].c.ud)this.pc=d?d==m[H].c.Vc||d==m[H].c.Sc||d==m[H].c.Yc||d==m[H].c.Rc||d==m[H].c.Wc||d==m[H].c.Oc||d==m[H].c.Uc||d==m[H].c.Tc||d==m[H].c.Xc||d==m[H].c.Qc||d==m[H].c.Nc||d==m[H].c.Pc?d:c:c;else if(a==m[H].c.xd)this.lc=d?d==m[H].c.bd||d==m[H].c.cd||d==m[H].c.ad||d==m[H].c.$c?d:c:
+c;else if(a==m[H].c.zd)this.rc=d?d==m[H].c.ed||d==m[H].c.dd||d==m[H].c.fd||d==m[H].c.gd||d==m[H].c.hd?d:c:c;else if(a==m[H].c.td)this.yc=d?d==m[H].c.wd?d:c:c};O(m[H].c[E],"setRestriction",m[H].c[E].R);m[H].e=function(){m[H].a[I](this);this.ba=c;this.aa="San Francisco, CA";this.ea={y:37.77916,x:-122.42009};this.Ra=c;this.qb=b;this.fb=g;this.Za=c;this.Ta=b;this.fa=hb(this,this.oa);this.Sa="gsc-locationConfig";this.w="local";this.Ba="/GlocalSearch";this.na="http://www.google.com/local";this.Pa=this.G=c};N("google.search.LocalSearch",m[H].e);$a(m[H].e,m[H].a);m[H].e.B="GlocalSearch";O(m[H].e,"RESULT_CLASS",m[H].e.B);m[H].e.Kd="blended";O(m[H].e,"TYPE_BLENDED_RESULTS",m[H].e.Kd);m[H].e.Nd="kmlonly";
+O(m[H].e,"TYPE_KMLONLY_RESULTS",m[H].e.Nd);m[H].e.Od="localonly";O(m[H].e,"TYPE_LOCALONLY_RESULTS",m[H].e.Od);m[H].e.Hc="disabled";O(m[H].e,"ADDRESS_LOOKUP_DISABLED",m[H].e.Hc);m[H].e.Ic="enabled";O(m[H].e,"ADDRESS_LOOKUP_ENABLED",m[H].e.Ic);m[H].e.Ed=17;O(m[H].e,"STATIC_MAP_ZOOM_FARTHEST",m[H].e.Ed);m[H].e.df=4;O(m[H].e,"STATIC_MAP_ZOOM_DEFAULT",m[H].e.df);m[H].e.Dd=0;O(m[H].e,"STATIC_MAP_ZOOM_CLOSEST",m[H].e.Dd);m[H].e.$b=8;O(m[H].e,"STATIC_MAP_MAX_POINTS",m[H].e.$b);m[H].e.cg=3.141592653589;
+m[H].e.yf=6367E3;m[H].e.Eg=16093;m[H].e.n=[];m[H].e.I=function(a,d,e,f,h){var l=0;if(a)l=ca(a,10);a=m[H].e.n[l];m[H].e.n[l]=c;a.resultViewport=d&&d.viewport?d.viewport:c;a.W(d,e,f,h)};O(m[H].e,"RawCompletion",m[H].e.I);
+m[H].e[E].ha=function(a,d,e,f){e=e==c?m[H].a.ka(m[H].e.n,this):e;d=this.ya(d==c?"google.search.LocalSearch.RawCompletion":d,e,f);f="";if(a){f="&q="+i(a);d+=f}this.$h=c;if(this.ba){var h;if(this.qb){e=this.ba.getCenterLatLng();h=this.ba.getSpanLatLng();a="&sll="+e.y+","+e.x;a+="&sspn="+h[Xa]+","+h[x]}else{e=this.ba.getCenter();h=this.ba.getBounds().toSpan().toUrlValue();a="&sll="+e.y+","+e.x;a+="&sspn="+h}a+=m[H].e.cc(e.y,e.x);d+=a;f+=a}else if(this.ea){a="&sll="+this.ea.y+","+this.ea.x;if(this.Ra)a=
+a+"&sspn="+this.Ra.lat+","+this.Ra.lng;a+=m[H].e.cc(this.ea.y,this.ea.x);d+=a;f+=a}else if(this.aa){a="&near="+i(this.aa);d+=a;f+=a}if(this.fb){d+="&nogeocode=t";f+="&nogeocode=t"}if(this.Za){d+="&mrt="+i(this.Za);f+="&mrt="+i(this.Za)}if(f)this.u=f;return d};m[H].e.cc=function(a,d){var e=2*m[H].e.Eg/m[H].e.yf*2*m[H].e.cg,f=d-e,h=a+e;d=d+e;return"&gll="+q[ua]((a-e)*1E6)+","+q[ua](f*1E6)+","+q[ua](h*1E6)+","+q[ua](d*1E6)+"&llsep=500,500"};O(m[H].e,"centerToGll",m[H].e.cc);
+m[H].e[E].C=function(a){a.html&&delete a.html;var d=V(this.ia());Z(d,"gs-result");var e;e=Y(a.url,a[Ha],this.s(),"gs-title");T(d,e);if(a.listingType=="kml"&&a[va]&&a[va]!=""){e=U(a[va],"gs-snippet");T(d,e)}var f=V("gs-address");if(a.addressLines&&a.addressLines[D]>0)for(var h=0;h<a.addressLines[D];h++){e=a.addressLines[h];var l="gs-addressLine";if(h==0)l="gs-street gs-addressLine";else if(h==1)l="gs-city gs-addressLine";e=U(e,l);T(f,e)}else{e=U(a.streetAddress,"gs-street");T(f,e);h="";if(a.city!=
+""){h=a.city;if(a.region!="")h+=", "}e=U(h,"gs-city");T(f,e);e=U(a.region,"gs-region");T(f,e)}e=U(a.country,"gs-country");T(f,e);T(d,f);if(a.phoneNumbers&&a.phoneNumbers[D]){h=f=c;e=a.phoneNumbers[0];for(var n=0;n<a.phoneNumbers[D];n++){l=a.phoneNumbers[n];if(l[Da]=="main"){f=l;break}if(l[Da]==""||l[Da]=="mobile"&&h==c)h=l}l=f?f:h?h:e;e=U(l.number,"gs-phone");T(d,e)}if(a.ddUrl&&a.ddUrl!=""){e=Y(a.ddUrl,P.directions,this.s(),"gs-directions");T(d,e)}if(a.ddUrlToHere&&a.ddUrlToHere!=""&&a.ddUrlFromHere&&
+a.ddUrlFromHere!=""){e=V("gs-directions-to-from");f=U(P["get-directions"]+":","gs-label");e[v](f);f=Y(a.ddUrlToHere,P["to-here"],this.s(),"gs-secondary-link");e[v](f);f=U("-","gs-spacer");e[v](f);f=Y(a.ddUrlFromHere,P["from-here"],this.s(),"gs-secondary-link");e[v](f);T(d,e)}a.html=d;this.ta(a.html)};O(m[H].e[E],"createResultHtml",m[H].e[E].C);
+m[H].e[E].Ce=function(a){if(a.centerAndZoom){this.qb=b;this.ba=a;this.ea=c;this.aa="";if(this.G)this.G=c}else if(a.setCenter){this.qb=g;this.ba=a;this.Ra=this.ea=c;this.aa="";if(this.G)this.G=c}else if(a.x&&a.y){this.qb=b;this.ea=a;this.ba=this.Ra=c;this.aa="";if(this.G)this.G=c}else if(a!=c&&a!=""){this.qb=b;this.ba=c;this.aa=a;this.ea=c;if(this.G)this.G=c;var d=new m[H].e;d.zb(this,this.gf,[d,a]);d[L](a)}};O(m[H].e[E],"setCenterPoint",m[H].e[E].Ce);
+m[H].e[E].gf=function(a,d){if(a.results&&a.results[D]){var e={};e.y=da(a.results[0].lat);e.x=da(a.results[0].lng);this.ea=e;this.aa=d;this.Ta=b;this.ba=c;if(a.resultViewport){d={};d.ph=da(a.resultViewport.span.lat)/2;d.qh=da(a.resultViewport.span.lng)/2;this.Ra=d}}};
+m[H].e[E].oa=function(a,d){if(d){if(this.G==c){d=c;if(this.ba==c){var e=V("gsc-configSetting");this.G=vb(c,"gsc-configSettingInput",this.aa==""?c:this.aa);T(e,U(P["search-location"],"gsc-configSettingInputLabel"));T(e,this.G);T(a,e);d=this.G}e=V("gsc-configSetting");this.Pa=xb(c,"0",this.fb,"gsc-configSettingCheckbox");T(e,this.Pa);T(e,U(P["disable-address-lookup"],"gsc-configSettingCheckboxLabel"));if(d==c)d=this.Pa;var f=U(c,"gsc-configSettingSubmit");T(f,ub(P[Ra],"gsc-configSettingSubmit"));T(e,
+f);T(a,e);d[Ba]()}}else{if(this.G){if(this.G[xa]){this.aa=this.G[xa];this.Ce(this.aa)}this.G=c}if(this.Pa){this.fb=this.Pa[Ka];this.Pa=c}ib(a)}};m[H].e[E].lg=function(a){if(a==m[H].e.Hc)this.fb=b;else if(a==m[H].e.Ic)this.fb=g};O(m[H].e[E],"setAddressLookupMode",m[H].e[E].lg);m[H].e.ye=function(a,d,e,f){var h=a.staticMapUrl;h=h[z](/&h=\d*/,"&h="+d);h=h[z](/&w=\d*/,"&w="+e);if(f&&f>=m[H].e.Dd&&f<=m[H].e.Ed)h=h[z](/&zl=\d*/,"&zl="+f);return a.staticMapUrl=h};O(m[H].e,"resizeStaticMapUrl",m[H].e.ye);
+m[H].e.rf=function(a,d,e,f){var h="",l="http://mt.google.com/mapdata?cc=us&tstyp=5&zl=4&w=150&h=100",n={};n.staticMapUrl=l;l=m[H].e.ye(n,d,e,f);if(f==c)l=l[z](/&zl=\d*/,"");d=a[D];if(d>m[H].e.$b)d=m[H].e.$b;for(e=0;e<d;e++){n=a[e];if(n.lat&&n.lng)if(typeof n.lat=="string"){f=da(n.lat);n=da(n.lng)}else{f=n.lat;n=n.lng}else if(n.x&&n.y){f=n.y;n=n.x}else return c;n=n*1E6;f="&Point=b&Point.latitude_e6=__LAT__&Point.longitude_e6=__LNG__&Point.iconid=__ICONID__&Point=e"[z](/__LAT__/,q[ua](f*1E6));f=f[z](/__LNG__/,
+q[ua](n));n=51+e;if(d==1)n=15;f=f[z](/__ICONID__/,n);h+=f}return l+h};O(m[H].e,"computeStaticMapUrl",m[H].e.rf);m[H].e[E].R=function(a,d){if(a==m[H].a.Db)if(d){this.Za=c;this.Za=d==m[H].e.Kd||d==m[H].e.Nd||d==m[H].e.Od?d:c}else this.Za=c};O(m[H].e[E],"setRestriction",m[H].e[E].R);m[H].m=function(){m[H].a[I](this);this.w="news";this.Ba="/GnewsSearch";this.na="http://news.google.com/nwshp";this.Nh=c;this.ab="site:";this.N=g;this.Ta=b;this.fa=hb(this,this.oa);this.Sa="gsc-newsConfig";this.F=this.o=c};N("google.search.NewsSearch",m[H].m);$a(m[H].m,m[H].a);m[H].m.B="GnewsSearch";O(m[H].m,"RESULT_CLASS",m[H].m.B);m[H].m.sd="GnewsSearch.quote";O(m[H].m,"QUOTE_RESULT_CLASS",m[H].m.sd);m[H].m.n=[];
+m[H].m.I=function(a,d,e,f,h){var l=0;if(a)l=ca(a,10);a=m[H].m.n[l];m[H].m.n[l]=c;a.W(d,e,f,h)};O(m[H].m,"RawCompletion",m[H].m.I);
+m[H].m[E].ha=function(a,d,e,f){e=e==c?m[H].a.ka(m[H].m.n,this):e;d=this.ya(d==c?"google.search.NewsSearch.RawCompletion":d,e,f);if(a||!a&&this.F){e=c;if(a)e=a;if(this.H)e=e==c?this.H:e+" "+this.H;if(this.l)e=e==c?this.ab+this.l:e+" "+this.ab+this.l;a=e?"&q="+i(e):"";if(this.N)a+="&scoring=d";if(this.F){e="";for(var h in this.F)if(h.charAt(0)==":")e+="&"+this.F[h];a+=e}if(this.l&&this.ab=="source:")d=d[z](/&hl=.*&/,"&hl=en&");d+=a;this.u=a;if(f&&f!=0)this.u=this.u+"&start="+f}return d};
+m[H].m[E].C=function(a){a.html&&delete a.html;if(a.GsearchResultClass!=m[H].m.sd){var d=V(this.ia());Z(d,"gs-result");var e;e=Y(a.unescapedUrl,a[Ha],this.s(),"gs-title");T(d,e);e=U(a.publisher,"gs-publisher");T(d,e);e=a[Pa][Na](",");if(e[D]>1){e=U(", "+e[e[D]-1],"gs-location");T(d,e)}e=new Date(a.publishedDate);e=U(" - "+this.Va(e),"gs-publishedDate");T(d,e);e=new Date(a.publishedDate);e=U(" - "+this.mc(e),"gs-relativePublishedDate");T(d,e);e=U(a[va],"gs-snippet");T(d,e);if(a.clusterUrl&&a.clusterUrl!=
+""){e=Y(a.clusterUrl,P["related-articles"]+"&nbsp;&raquo;",this.s(),"gs-clusterUrl");T(d,e)}a.html=d;this.ta(a.html)}};O(m[H].m[E],"createResultHtml",m[H].m[E].C);m[H].m[E].qa=function(a){if(a==c||a==""){this.l=c;this.ab="site:"}else if(a[za]("[./:]")){this.ab="site:";this.l=a}else{this.ab="source:";this.l=a[z](/\s/g,"_")}};O(m[H].m[E],"setSiteRestriction",m[H].m[E].qa);m[H].m[E].K=function(a){this.N=a==m[H].a.ma?b:g};O(m[H].m[E],"setResultOrder",m[H].m[E].K);
+m[H].m[E].oa=function(a,d){if(d){if(this.o==c){d=V("gsc-configSetting");this.o=xb(c,"0",this.N,"gsc-configSettingCheckbox");T(d,this.o);T(d,U(P["sort-by-date"],"gsc-configSettingCheckboxLabel"));var e=V("gsc-configSettingSubmit");T(e,ub(P[Ra],"gsc-configSettingSubmit"));T(d,e);T(a,d)}else na(this.o,this.N);this.o[Ba]()}else if(this.o)this.o[Ka]?this.K(m[H].a.ma):this.K(m[H].a.eb)};m[H].m[E].jf={geo:b,qsid:b,quotesearch:b,topic:b,ned:b,scoring:b,as_mind:b,as_minm:b,as_miny:b,as_maxd:b,as_maxm:b,as_maxy:b};
+m[H].m[E].R=function(a,d){if(a==m[H].a.Na)if(d)for(var e in d){a=d[e];if(typeof this.jf[e]!="undefined"){this.F=this.F||{};this.F[":"+e]=e+"="+i(a)}}else this.F=c};O(m[H].m[E],"setRestriction",m[H].m[E].R);m[H].h=function(){m[H].a[I](this);this.w="patent";this.Ba="/GpatentSearch";this.na="http://www.google.com/patents";this.Je="";this.tb=c;this.Ta=b;this.fa=hb(this,this.oa);this.Sa="gsc-patentConfig";this.o=c};N("google.search.PatentSearch",m[H].h);$a(m[H].h,m[H].a);m[H].h.B="GpatentSearch";O(m[H].h,"RESULT_CLASS",m[H].h.B);m[H].h.Id=1;O(m[H].h,"TYPE_ANY_STATUS",m[H].h.Id);m[H].h.Md=2;O(m[H].h,"TYPE_ISSUED_PATENTS",m[H].h.Md);m[H].h.Jd=3;O(m[H].h,"TYPE_APPLICATIONS",m[H].h.Jd);m[H].h.n=[];
+m[H].h.I=function(a,d,e,f,h){var l=0;if(a)l=ca(a,10);a=m[H].h.n[l];m[H].h.n[l]=c;a.W(d,e,f,h)};O(m[H].h,"RawCompletion",m[H].h.I);m[H].h[E].ha=function(a,d,e,f){e=e==c?m[H].a.ka(m[H].h.n,this):e;d=this.ya(d==c?"google.search.PatentSearch.RawCompletion":d,e,f);if(a){a=a;if(this.H)a=a+" "+this.H;a="&q="+i(a)+this.Je;if(this.tb)a+=this.tb;d+=a;this.u=a}return d};
+m[H].h[E].C=function(a){a.html&&delete a.html;a.thumbnailHtml=this.hc(a);var d=V(this.ia());Z(d,"gs-result");var e=V("gs-text-box"),f=nb(),h=ob(f,0),l=X(h,"gs-image-box");h=X(h,"gs-text-box");T(l,a.thumbnailHtml[Ca](b));T(h,e);T(d,f);l=Y(a.unescapedUrl,a[Ha],this.s(),"gs-title");T(e,l);f=V("gs-patent-info gs-metadata");T(e,f);l=c;l=a.patentNumber?a.patentStatus=="issued"?P["us-pat"]+"&nbsp;"+a.patentNumber:P["us-pat-app"]+"&nbsp;"+a.patentNumber:P["us-pat-app"]+"&nbsp; N/A";l=U(l,"gs-patent-number");
+T(f,l);if(a.applicationDate){l=U(" - "+this.Va(new Date(a.applicationDate)),"gs-publishedDate");T(f,l)}if(a.assignee){l=U(" - "+a.assignee,"gs-author");T(f,l)}l=U(a[va],"gs-snippet");T(e,l);T(e,l);a.html=d;this.ta(a.html)};O(m[H].h[E],"createResultHtml",m[H].h[E].C);m[H].h[E].hc=function(a){var d=V("gs-patent-image"),e=qb(a.tbUrl,75,100,"gs-image");a=rb(a.unescapedUrl,c,this.s(),"gs-image");t(a,"gs-image");T(a,e);T(d,a);return d};
+m[H].h[E].K=function(a){this.tb=a==m[H].a.ma?"&scoring=d":a==m[H].a.rd?"&scoring=ad":c};O(m[H].h[E],"setResultOrder",m[H].h[E].K);m[H].h[E].R=function(a,d){if(a==m[H].a.Db)this.Je=d?d==m[H].h.Id?"":d==m[H].h.Md?"&as_psrg=1":d==m[H].h.Jd?"&as_psra=1":"":""};O(m[H].h[E],"setRestriction",m[H].h[E].R);
+m[H].h[E].oa=function(a,d){if(d){var e=g;if(this.tb&&this.tb=="&scoring=d")e=b;if(this.o==c){d=V("gsc-configSetting");this.o=xb(c,"0",e,"gsc-configSettingCheckbox");T(d,this.o);T(d,U(P["sort-by-date"],"gsc-configSettingCheckboxLabel"));e=V("gsc-configSettingSubmit");T(e,ub(P[Ra],"gsc-configSettingSubmit"));T(d,e);T(a,d)}else na(this.o,e);this.o[Ba]()}else if(this.o)this.o[Ka]?this.K(m[H].a.ma):this.K(m[H].a.eb)};m[H].A=function(){this.xe=this.$=m[H].b.Da;this.i=c;this.M={width:112,height:84};this.Tb={width:100,height:75};this.rb=c};N("google.search.SearcherOptions",m[H].A);m[H].A[E].Ee=function(a){switch(a){case m[H].b.Zc:case m[H].b.La:case m[H].b.Da:this.$=a;break;default:this.$=m[H].b.Da;break}this.xe=this.$};O(m[H].A[E],"setExpandMode",m[H].A[E].Ee);m[H].A[E].tg=function(a){ib(a);this.i=a};O(m[H].A[E],"setRoot",m[H].A[E].tg);m[H].A[E].yb=function(a){this.rb=a};O(m[H].A[E],"setNoResultsString",m[H].A[E].yb);
+m[H].A[E].ng=function(a){if(a>100)a=100;u(this.M,a);ja(this.M,q[ta](a*1.33))};O(m[H].A[E],"setImageResultsTbHeight",m[H].A[E].ng);m[H].A[E].zg=function(a){if(a>100)a=100;u(this.Tb,a);ja(this.Tb,q[ta](a*1.33))};O(m[H].A[E],"setVideoResultsTbHeight",m[H].A[E].zg);m[H].T=function(){ia(this,c);this.Ie=c;this.Z=m[H].b.ra};N("google.search.DrawOptions",m[H].T);m[H].T[E].og=function(a){ia(this,a)};O(m[H].T[E],"setInput",m[H].T[E].og);
+m[H].T[E].ug=function(a){if(a&&typeof a=="string")a=p.getElementById(a);this.Ie=a};O(m[H].T[E],"setSearchFormRoot",m[H].T[E].ug);m[H].T[E].De=function(a){this.Z=a==m[H].b.ra||a==m[H].b.Ka?a:m[H].b.ra};O(m[H].T[E],"setDrawMode",m[H].T[E].De);
+m[H].z=function(a,d,e){this.t=e;this.fc=this.kc=g;this.f=a;this.v=c;this.hg=R(d,m[H].b[E].bg,[this]);this.kg=R(d,m[H].b[E].wc,[this,m[H].z.Zb]);this.jg=R(d,m[H].b[E].wc,[this,m[H].z.Yb]);this.ig=R(d,m[H].b[E].wc,[this,m[H].z.Cd]);this.gg=R(d,m[H].b[E].ag,[this]);this.fg=R(d,m[H].b[E].Xf,[this]);this.f.zb(d,m[H].b[E].W,[this]);this.f.S(d.Mb);this.f.xb(d.Fa);this.Q=this.Ua=this.va=this.zc=this.nb=this.Rb=this.i=c;this.pb=b};m[H].z.Xb=0;m[H].z.Zb=1;m[H].z.Yb=2;m[H].z.Cd=3;
+m[H].z[E].Dc=function(a){var d="gsc-results-selector ";d+=a==m[H].z.Xb?this.t.$==m[H].b.Da?"gsc-one-result-active":this.f.za==m[H].a.X?"gsc-more-results-active":"gsc-all-results-active":a==m[H].z.Zb?"gsc-one-result-active":a==m[H].z.Yb?"gsc-more-results-active":"gsc-all-results-active";t(this.zc,d)};
+m[H].b=function(a){if(!m[J].KeyVerified)if(m[H].b.ue())m[J].KeyVerified=b;else return;this.Vd=this.Mb=m[H].a.X;this.Z=m[H].b.ra;this.Nb=this.i=c;ia(this,c);this.Qb=m[H].b.Eb;this.Of=R(this,m[H].b[E].Yf,[c]);this.Pf=R(this,m[H].b[E].Zf,[c]);this.Xa=this.ub=this.Bc=this.Lb=c;this.gb=this.Uf=g;this.Fa=m[H].a.db;this.sc=P.copy;this.d=[];this.Qg=[];var d;if(a)for(var e=0;e<a[D];e++){d=new m[H].z(a[e],this,g);this.d[ra](d)}};N("google.search.SearchControl",m[H].b);m[H].b.qd=P["no-results"];
+O(m[H].b,"NO_RESULTS_DEFAULT_STRING",m[H].b.qd);m[H].b.Gd=350;O(m[H].b,"TIMEOUT_SHORT",m[H].b.Gd);m[H].b.Eb=500;O(m[H].b,"TIMEOUT_MEDIUM",m[H].b.Eb);m[H].b.Fd=700;O(m[H].b,"TIMEOUT_LONG",m[H].b.Fd);m[H].b.Zc=1;O(m[H].b,"EXPAND_MODE_CLOSED",m[H].b.Zc);m[H].b.La=2;O(m[H].b,"EXPAND_MODE_OPEN",m[H].b.La);m[H].b.Da=3;O(m[H].b,"EXPAND_MODE_PARTIAL",m[H].b.Da);m[H].b.ra=1;O(m[H].b,"DRAW_MODE_LINEAR",m[H].b.ra);m[H].b.Ka=2;O(m[H].b,"DRAW_MODE_TABBED",m[H].b.Ka);m[H].b.nd="save";
+O(m[H].b,"KEEP_LABEL_SAVE",m[H].b.nd);m[H].b.md="keep";O(m[H].b,"KEEP_LABEL_KEEP",m[H].b.md);m[H].b.ld="include";O(m[H].b,"KEEP_LABEL_INCLUDE",m[H].b.ld);m[H].b.kd="copy";O(m[H].b,"KEEP_LABEL_COPY",m[H].b.kd);m[H].b.jd="blank";O(m[H].b,"KEEP_LABEL_BLANK",m[H].b.jd);try{m[H].b.appPath=k[Pa].href}catch(Lb){m[H].b.appPath=c}
+m[H].b.ue=function(){var a=b,d;d=k[Pa].host[Ya]()[Na](".");if(d[D]<2)d=g;else{var e=d.pop(),f=d.pop();if((f=="igoogle"||f=="gmodules"||f=="googlesyndication")&&e=="com")d=b;else{if(e[D]==2&&d[D]>0)if(Cb[f]&&Cb[f][e]==1)f=d.pop();d=f=="google"}}if(d)return b;if(m[J].LoadFailure)if(m[J].OriginalAppPath&&m[H].b.appPath){m[J].LoadFailure=g;a=b}m[J].KeyVerified=b;m[J].LoadFailure=g;return a};O(m[H].b,"keyCheck",m[H].b.ue);
+m[H].b[E].jb=function(a,d){this.ua=b;this.Qa=a;if(d){if(d.includeVerticalAds!=o)this.Ca=d.includeVerticalAds;if(d.includeSideAds!=o)this.Ca=d.includeSideAds;if(d.iframes!=o)this.mb=d.iframes;if(d.useNarrowTopAd!=o)if(this.mb)this.Ig=d.useNarrowTopAd;if(d.channel)this.Sd=d.channel;if(d.clientIP)this.Td=d.clientIP;if(d.safe)this.Ud=d.safe;if(d[Oa])this.Wd=d[Oa];if(a=d.adtest||d.debug)this.ac=a;if(d.numTopAds!=o){this.Ga=d.numTopAds;this.Ga=q.max(0,q.min(4,this.Ga))}if(d.numSideAds!=o){this.xa=d.numSideAds;
+this.Ca=(this.xa=q.max(0,q.min(8,this.xa)))?b:g}this.Be=d.enableSearchCompleteCallback?b:g}m[J][Ea]("hl","afs_ads")};O(m[H].b[E],"enableAds",m[H].b[E].jb);m[H].b[E].Oa=function(a,d){d||(d=new m[H].A);a.pa=c;this.d[ra](new m[H].z(a,this,d));if(this.vb(a))this.Jf=b;a.wb="gsc"};O(m[H].b[E],"addSearcher",m[H].b[E].Oa);
+m[H].b[E].ce=function(a){if(this.d[a].t.i){this.d[a].pb=g;this.d[a].i=this.d[a].t.i;Z(this.d[a].i,"gsc-resultsRoot");$(this.d[a].i,"gsc-resultsbox-visible");Z(this.d[a].i,"gsc-resultsbox-invisible")}else this.d[a].i=V("gsc-resultsRoot");this.d[a].f.Cb&&wb(this.d[a].i,"gsc-resultsRoot-"+this.d[a].f.Cb);if(this.Z==m[H].b.Ka)this.p[a].ga=this.d[a].i;var d=nb(c,c,"gsc-resultsHeader"),e=ob(d,0);this.d[a].Ja=X(e,"gsc-twiddleRegionCell");e=X(e,"gsc-configLabelCell");this.d[a].Rb=U("","gsc-twiddle");T(this.d[a].Ja,
+this.d[a].Rb);var f=lb(this.d[a].f.Ff(),"gsc-title");T(this.d[a].Rb,f);this.d[a].nb=U("","gsc-stats");T(this.d[a].Ja,this.d[a].nb);f=U();var h=U(P.blank,"gsc-result-selector gsc-one-result"),l=U(P.blank,"gsc-result-selector gsc-more-results"),n=U(P.blank,"gsc-result-selector gsc-all-results");s(h,P["show-one-result"]);s(l,P["show-more-results"]);s(n,P["show-all-results"]);T(f,h);T(f,l);T(f,n);oa(h,this.d[a].kg);oa(l,this.d[a].jg);oa(n,this.d[a].ig);this.d[a].zc=f;this.d[a].Dc(m[H].z.Xb);T(this.d[a].Ja,
+this.d[a].zc);oa(this.d[a].Rb,this.d[a].hg);if(this.d[a].f.fa){this.d[a].P=mb("","gsc-configLabel");r(this.d[a].P,P.blank);Z(this.d[a].P,"gsc-twiddle-closed");T(e,this.d[a].P);oa(this.d[a].P,this.d[a].gg);s(this.d[a].P,P.settings);this.d[a].va=V("gsc-config");Z(this.d[a].va,this.d[a].f.Sa);this.d[a].Ua=tb("gsc-config");Z(this.d[a].Ua,this.d[a].f.Sa);this.d[a].Ua.onsubmit=this.d[a].fg;T(this.d[a].va,this.d[a].Ua);pa(this.d[a].va[G],"none")}this.d[a].Q=V("gsc-results");e=this.d[a].f.nc();Z(this.d[a].Q,
+e);this.d[a].t.i==c&&T(this.Aa,this.d[a].i);T(this.d[a].i,d);this.d[a].va&&T(this.d[a].i,this.d[a].va);T(this.d[a].i,this.d[a].Q)};m[H].b[E].de=function(a){var d=this.d[a],e={},f=d.f.Hf();e.V=lb(f);e.ga=c;e.Cc=d.f;e.w=d.f.w;oa(e.V,R(this,this.Dg,[a]));this.p[a]=e;T(this.ca,e.V);a="gs-spacer";if(bb("opera"))a+=" gs-spacer-opera";a=mb(" ",a);T(this.ca,a);d.t.Ee(m[H].b.La)};
+m[H].b[E].Ib=function(a,d){var e=c,f=c;if(d)if(d.Z){this.Z=d.Z;e=d[w];f=d.Ie}else this.Z=m[H].b.ra;else this.Z=m[H].b.ra;this.i=V("gsc-control");if(e!=c){ia(this,e);this[w].onkeyup=this.Of;this[w].onpaste=this.Pf}else{if(f==c)f=this.i;d=new m[H].L(b,f);d.Ge(this,this.submit);d.Fe(this,this.dc);ia(this,d[w]);this.kb&&d.Kf()}this.Aa=V("gsc-resultsbox-invisible");if(this.Z==m[H].b.Ka){this.ca=V("gsc-tabsAreaInvisible");T(this.i,this.ca);this.p=[];for(d=this.J=0;d<this.d[D];d++)this.de(d)}this.da=this.i;
+if(this.ua){this.da=V("gsc-wrapper");this.O=V("gsc-adBlockInvisible");this.U=V("gsc-adBlockInvisible");T(this.da,this.O);T(this.i,this.U);T(this.i,this.da);this.ac&&wb(this.i,"gsc-ad-preview")}T(this.da,this.Aa);for(d=0;d<this.d[D];d++){this.ce(d);if(this.Z==m[H].b.Ka){Z(this.p[d].V,"gsc-tabHeader");Z(this.p[d].ga,"gsc-tabData");if(d==this.J){Z(this.p[d].V,"gsc-tabhActive");Z(this.p[d].ga,"gsc-tabdActive")}else{Z(this.p[d].V,"gsc-tabhInactive");Z(this.p[d].ga,"gsc-tabdInactive")}}}if(a&&typeof a==
+"string")a=p.getElementById(a);if(a){jb(a,this.i);if((a=this.Df())&&a<300){this.Uf=b;Z(this.i,"gsc-narrow")}}};O(m[H].b[E],"draw",m[H].b[E].Ib);m[H].b[E].xg=function(a){switch(a){case m[H].b.Gd:case m[H].b.Eb:case m[H].b.Fd:this.Qb=a;break;default:this.Qb=m[H].b.Eb;break}};O(m[H].b[E],"setTimeoutInterval",m[H].b[E].xg);m[H].b[E].rg=function(a,d,e){if(e)switch(e){case m[H].b.nd:case m[H].b.md:case m[H].b.ld:case m[H].b.kd:case m[H].b.jd:this.sc=P[e];break;default:this.sc=e;break}this.Lb=hb(a,d)};
+O(m[H].b[E],"setOnKeepCallback",m[H].b[E].rg);M=m[H].b[E];M.vb=function(a){var d=a.w;if(this.kb){if(d=="web"&&a.D!=m[H].g.Y)return g;return b}else return d=="blog"||d=="image"?b:g};
+M.Dg=function(a){if(this.J!=a){$(this.p[this.J].V,"gsc-tabhActive");$(this.p[this.J].ga,"gsc-tabdActive");Z(this.p[this.J].V,"gsc-tabhInactive");Z(this.p[this.J].ga,"gsc-tabdInactive");this.J=a;Z(this.p[this.J].V,"gsc-tabhActive");Z(this.p[this.J].ga,"gsc-tabdActive");$(this.p[this.J].V,"gsc-tabhInactive");$(this.p[this.J].ga,"gsc-tabdInactive");if(this.ua)this.vb(this.p[this.J].Cc)?this.ob():this.fe()}};
+M.ob=function(){if(this.ua){t(this.O,"gsc-adBlockInvisible");t(this.U,"gsc-adBlockInvisible");this.Ca&&zb(this.da,"gsc-thinWrapper")}};M.fe=function(){if(this.ua){this.vc>0?yb(this.O,"gsc-adBlock"):yb(this.O,"gsc-adBlockInvisible");if(this.Ca)if(this.uc>0){t(this.U,"gsc-adBlockVertical");Z(this.da,"gsc-thinWrapper")}else{t(this.U,"gsc-adBlockInvisible");$(this.da,"gsc-thinWrapper")}}};M.submit=function(){this[w][xa][D]?this[L]():this.dc();return g};O(m[H].b[E],"submit",m[H].b[E].submit);M=m[H].b[E];
+M.Hb=function(){if(this.ca&&!this.Cg&&(!this.kb||this.Rd))t(this.ca,"gsc-tabsArea")};M.Mf=function(a,d,e){d[v](a);(new Mb(e,"parent",a)).sf()};M.Nf=function(a,d,e){var f=k;(f.postMessage?f:f[Ma].postMessage?f[Ma]:c)?this.lf(a,e):this.kf(a,e);d[v](a)};M.re=function(a,d,e){t(e,"gsc-adBlockNoHeight");d=this.Fb.Jg(this.tf(a,d,e));var f;if(f=k[Wa]?k[Wa][Oa]:c){f=Nb(f);var h=k[Wa]?k[Wa][Oa]:c;f=(h?h[ya]("Opera")!=0&&h[ya]("MSIE")!=-1:g)&&(f==6||f==7)}else f=g;f&&!Ob()?this.Mf(a,e,d):this.Nf(a,e,d)};
+qa(M,function(a){if(a){a=a;this[w].onfocus&&this[w].onfocus();ka(this[w],a)}else a=this[w][xa];this.Fb=c;if(a[D]){this.gb=g;t(this.Aa,"gsc-resultsbox-visible");this.Hb();this.Wa=m[J].createGuidArg_();var d=this.ua;if(d&&this.Jf&&this.Z==m[H].b.ra)d=g;var e=this.Qf();if(e==o&&!this.Qa&&!this.mb)d=g;if(d){this.mg();d="w"+this.Ga;if(this.Ca)d=d+"n"+this.xa;if(this.mb){d="w"+this.Ga;d=m[J][Fa]+"/GafsAds?q="+i(a)+"&hl="+i(m[H][K])+"&ad="+i(d)+"&source="+this.d[0].f.wb+"&"+this.Wa}else d="http://www.google.com/"+
+(e?"cse":"search")+"?output=js&num=0&ie=utf8&oe=utf8&q="+i(a)+"&hl="+i(m[H][K])+"&ad="+i(d)+"&js=uds&"+this.Wa;if(e)d+="&cx="+e;if(this.Qa)d+="&client="+i(this.Qa);if(this.Sd)d+="&channel="+i(this.Sd);if(this.ac)d+="&adtest=on";if(this.Td)d+="&ip="+i(this.Td);if(this.Ud)d+="&adsafe="+i(this.Ud);if(this.Wd)d+="&useragent="+i(this.Wd);if(this.mb){ma(this.Aa[G],"hidden");this.Fb=new m[H].cb;this.ob();r(this.O,"");r(this.U,"");if(fb()||gb())d+="&nocache="+_json_cache_defeater_++;d+="&referer="+k[Pa].host;
+if(this.Ga>0){if(this.Ig)d=d[z](/&ad=[^&]*/,"&ad=n1w0");var f=this.je();e=d.substring(0,2E3);e=e[z](/%\w?$/,"");f.src=e;this.re(f,g,this.O)}if(this.Ca&&this.xa>0){e=d[z](/&ad=[^&]*/,"&ad="+("n"+this.xa));d=this.je();e=e.substring(0,2E3);e=e[z](/%\w?$/,"");d.src=e;this.re(d,b,this.U)}}else{var h=this;k.google_afs_request_done=function(l){h.Wf(l)};eb(d)}}for(e=0;e<this.d[D];e++){if(!this.d[e].pb){$(this.d[e].i,"gsc-resultsbox-invisible");Z(this.d[e].i,"gsc-resultsbox-visible")}this.Bc&&this.Bc(this,
+this.d[e].f,a);if(this.d[e].f.pa)this.d[e].f.pa=c;this.d[e].f.Wa=this.Wa;this.d[e].f[L](a)}this.Fb&&this.Fb.start(2E3)}});O(m[H].b[E],"execute",m[H].b[E][L]);M=m[H].b[E];M.tf=function(a,d,e){var f=this;return function(h){m[J][Ea]("afsq","1");var l=h&&h>40;if(d)f.uc=l?1:0;else f.vc=l?1:0;f.Sf(a,h,l);if(f.ca)if(f.vb(f.p[f.J].Cc))l=g;l?f.fe():yb(e,"gsc-adBlockInvisible")}};
+M.kf=function(a,d){var e=function(){var f=0;try{var h=a.contentWindow;if(h.frames&&h.frames[D])f=h.frames[0].name}catch(l){}d(f)};if(fb())ha(a,function(){if(a[Aa]=="loaded"||a[Aa]=="complete"){ha(a,c);e()}});else ga(a,function(){ga(a,c);e()})};
+M.lf=function(a,d){var e=function(f){f=f?f:k[Za];if(f.source==a.contentWindow){if(k.detachEvent)k.detachEvent("onmessage",e);else k.removeEventListener&&k.removeEventListener("message",e,g);d(f.data)}};if(k.attachEvent)k.attachEvent("onmessage",e);else k.addEventListener&&k.addEventListener("message",e,g)};
+M.je=function(){var a=p[A]("iframe");a.name="google_afs_ads_frame";u(a,0);a.frameBorder=0;a.marginWidth=0;a.marginHeight=0;a.vspace=0;a.hspace=0;a[C]("allowTransparency",b);a.scrolling="no";ma(a[G],"hidden");return a};M.Sf=function(a,d,e){ja(a,"100%");if(e){u(a[G],d+"px");ma(a[G],"visible")}else{u(a[G],"0px");ma(a[G],"hidden")}};M.Qf=function(){for(var a=0;a<this.d[D];a++){var d=this.d[a].f;if(d.w=="web")if(d.D!=m[H].g.Y)if(d.D==m[H].g.ib)return d.l}return c};
+M.Wf=function(a){k.google_afs_request_done=c;if(this.O){m[J][Ea]("afsq","1");r(this.O,"");r(this.U,"");this.vc=this.uc=0;if(!a||a[D]<1)this.ob();else{if(!this.ca)for(var d=0;d<this.d[D];d++){var e=this.d[d].f;if(this.vb(e)){this.ob();return}}t(this.O,"gsc-adBlock");e=g;var f=p[A]("h2");d="";if(this.ac)d="*DEBUG* ";d+=P["ads-by-google"];r(f,d);T(this.O,f);var h=a[D];for(d=0;d<h;d++){var l=a[d];if(l[Da]=="text/wide"){this.vc++;var n=V("gsc-ad"),y=Y(l.url,l.line1,m[H].a.db);T(n,y);y=p[A]("cite");r(y,
+l.visible_url);T(n,y);y=mb();r(y,l.line2);T(n,y);T(this.O,n)}else if(this.Ca){this.uc++;if(!e){e=b;Z(this.da,"gsc-thinWrapper");T(this.U,f[Ca](b));t(this.U,"gsc-adBlockVertical")}n=V("gsc-ad");y=Y(l.url,l.line1,m[H].a.db);T(n,y);y=mb();r(y,l.line2+"<br/>"+l.line3);T(n,y);y=p[A]("cite");r(y,l.visible_url);T(n,y);T(this.U,n)}}this.Ca&&!e&&zb(this.da,"gsc-thinWrapper");if(this.ca){e=this.p[this.J].Cc;this.vb(e)&&this.ob()}this.ub&&this.Be&&this.ub(this,"ads")}}};
+M.Yf=function(){var a=this[w][xa];if(a&&a!=""){this.Xa&&k[sa](this.Xa);this.Xa=k[La](R(this,m[H].b[E][L],[c]),this.Qb)}};M.Zf=function(){this.Xa&&k[sa](this.Xa);this.Xa=k[La](R(this,m[H].b[E][L],[c]),this.Qb)};M.mg=function(){var a,d;switch(this.Vd){case m[H].a.Ma:a=3;d=5;break;case m[H].a.la:a=2;d=4;break;case m[H].a.X:default:a=1;d=2;break}if(this.Ga==o)this.Ga=a;if(this.xa==o)this.xa=d};
+M.S=function(a){switch(a){case m[H].a.la:case m[H].a.Ma:this.Mb=m[H].a.la;break;default:case m[H].a.X:this.Mb=m[H].a.X;break}for(var d=0;d<this.d[D];d++)this.d[d].f.S(a);this.Vd=a};O(m[H].b[E],"setResultSetSize",m[H].b[E].S);m[H].b[E].xb=function(a){this.Fa=a;for(var d=0;d<this.d[D];d++)this.d[d].f.xb(a)};O(m[H].b[E],"setLinkTarget",m[H].b[E].xb);m[H].b[E].yb=function(a){for(var d=0;d<this.d[D];d++)this.d[d].t.yb(a)};O(m[H].b[E],"setNoResultsString",m[H].b[E].yb);M=m[H].b[E];
+M.bg=function(a){a.kc?this.Ia(a,g):this.Ia(a,b)};M.Ia=function(a,d,e){if(d){$(a.Ja,"gsc-twiddle-closed");Z(a.Ja,"gsc-twiddle-opened");a.kc=b;pa(a.Q[G],"block")}else{$(a.Ja,"gsc-twiddle-opened");Z(a.Ja,"gsc-twiddle-closed");a.kc=g;pa(a.Q[G],"none");r(a.nb,e?"(0)":"("+a.f.results[D]+")")}};M.Xf=function(a){this.Ab(a,g,b);return g};M.ag=function(a){if(a.f.Ta)a.fc?this.Ab(a,g,b):this.Ab(a,b,b)};
+M.Ab=function(a,d,e){if(d){if(a.P&&a.f.fa){Z(a.P,"gsc-twiddle-opened");$(a.P,"gsc-twiddle-closed");r(a.P,P[Ra]);a.fc=b;pa(a.va[G],"block");a.f.fa(a.Ua,b)}}else if(a.P&&a.f.fa){$(a.P,"gsc-twiddle-opened");Z(a.P,"gsc-twiddle-closed");r(a.P,P.blank);a.fc=g;a.f.fa(a.Ua,g);pa(a.va[G],"none");e&&this[L]()}};M.$f=function(a,d){if(this.Lb){d.f.Lf();this.Lb(a)}};M.mf=function(){this.gb=b};O(m[H].b[E],"cancelSearch",m[H].b[E].mf);
+m[H].b[E].dc=function(){ka(this[w],"");this[w].onblur&&this[w].onblur();t(this.Aa,"gsc-resultsbox-invisible");this.ca&&yb(this.ca,"gsc-tabsAreaInvisible");this.O&&yb(this.O,"gsc-adBlockInvisible");if(this.U){t(this.U,"gsc-adBlockInvisible");$(this.da,"gsc-thinWrapper")}for(var a=0;a<this.d[D];a++){if(!this.d[a].pb){$(this.d[a].i,"gsc-resultsbox-visible");Z(this.d[a].i,"gsc-resultsbox-invisible")}var d=this.d[a];ib(d.Q);d.v=c;this.Ia(d,g,b);this.Ab(d,g,g)}};O(m[H].b[E],"clearAllResults",m[H].b[E].dc);
+m[H].b[E].W=function(a){if(this.mb&&a==this.d[this.J])ma(this.Aa[G],"visible");var d,e,f=g,h;if(!this.gb){ib(a.Q);a.v=c;this.Ia(a,g,b);this.Ab(a,g,g);a.Dc(m[H].z.Xb);var l=a.f.context,n=this.ca&&l;if(this.kb&&!this.Rd){if(n){h=l[Ha];for(e=0;e<this.p[D];e++){d=this.p[e];if(d.w==a.f.w){var y=a.f;h&&!a.f.bb&&jb(d.V,kb(h));break}}}this.Rd=b;this.Hb()}if((d=a.f.promotions)&&d[D]>0)for(e=0;e<d[D];e++){var B=d[e];B.html||a.f.be(B);if(B.html){h=V(a.f.nc());Z(h,"gsc-result");var W=B.html[Ca](b);T(h,W);T(a.Q,
+h)}}B=a.f.results;if(a.f.lb&&a.f.completionStatus>=400){B=[];B[ra](a.f.Af())}else if(B[D]==0&&a.t.rb&&a.f.completionStatus==200){B=[];B[ra](a.f.Bf(a.t.rb))}for(e=0;e<B[D];e++){d=B[e];d.html||a.f.C(d);if(d.html){f=b;h=V(a.f.nc());Z(h,"gsc-result");a.f.Cb&&wb(h,"gsc-result-"+a.f.Cb);W=d.html[Ca](b);if(d.GsearchResultClass==m[H].c.B){if(a.t.M)if(a.t.M[x]!=a.f.M[x]||a.t.M[Xa]!=a.f.M[Xa])for(var S=W.getElementsByTagName("img"),wa=0;wa<S[D];wa++)m[H].a.$a(d.tbWidth,d.tbHeight,a.t.M,S[wa],b)}else if(d.GsearchResultClass==
+m[H].r.B)if(a.t.Tb){S=W.getElementsByTagName("img");for(wa=0;wa<S[D];wa++)m[H].a.$a(d.tbWidth,d.tbHeight,a.t.Tb,S[wa])}T(h,W);if(this.Lb){W=this.sc;S=U("","gsc-keeper");r(S,W);T(h,S);oa(S,R(this,m[H].b[E].$f,[d,a]))}if(e>=a.f.we){if(!a.v){a.v=V("gsc-expansionArea");T(a.Q,a.v);if(a.t.$==m[H].b.Da)pa(a.v[G],"none")}T(a.v,h)}else T(a.Q,h)}}if(!a.v&&a.f[F]){a.v=V("gsc-expansionArea");T(a.Q,a.v)}if(a.v&&a.f.u&&a.f.gwsUrl){h=Y(a.f.gwsUrl,P["more-results"]+"&nbsp;&raquo;",a.f.s(),"gsc-trailing-more-results");
+if(a.f[F]){e=V("gsc-cursor-box");d=this.vf(a);e[v](d);a.f[F].currentPageIndex==a.f[F].pages[D]-1&&e[v](h);T(a.v,e)}else T(a.v,h)}if(f){r(a.nb,"("+a.f.results[D]+")");a.t.$==m[H].b.Da||a.t.$==m[H].b.La?this.Ia(a,b):this.Ia(a,g);(e=a.f.le())&&T(a.Q,e)}else{r(a.nb,"(0)");r(a.Q,"");this.Ia(a,g)}a.t.$=a.t.xe;this.ub&&this.ub(this,a.f);if(this.kb&&n&&!this.ff&&l.facets){a=this[w][xa];l=l.facets;for(e=0;e<l[D];e++){n=l[e];f=new m[H].g;y&&y.l&&f.qa(y.l,n.label);f.Bb(n.anchor);this.Oa(f);f.S(y.za);f[L](a)}for(e=
+0;e<this.d[D];e++)if(!this.p[e]){this.de(e);this.ce(e);Z(this.p[e].V,"gsc-tabHeader");Z(this.p[e].ga,"gsc-tabData");Z(this.p[e].V,"gsc-tabhInactive");Z(this.p[e].ga,"gsc-tabdInactive")}this.ff=b}}};O(m[H].b[E],"onSearchComplete",m[H].b[E].W);m[H].b[E].vf=function(a){for(var d=V("gsc-cursor"),e=a.f[F],f=0;f<e.pages[D];f++){var h="gsc-cursor-page";if(f==e.currentPageIndex)h+=" gsc-cursor-current-page";h=U(e.pages[f].label,h);oa(h,R(this,m[H].b[E].eg,[a,f]));d[v](h)}return d};
+m[H].b.Bd={border:"border",borderColor:"border-color",borderStyle:"border-style",borderWidth:"border-width",borderTop:"border-top",borderTopColor:"border-top-color",borderTopStyle:"border-top-style",borderTopWidth:"border-top-width",borderRight:"border-right",borderRightColor:"border-right-color",borderRightStyle:"border-right-style",borderRightWidth:"border-right-width",borderBottom:"border-bottom",borderBottomColor:"border-bottom-color",borderBottomStyle:"border-bottom-style",borderBottomWidth:"border-bottom-width",
+borderLeft:"border-left",borderLeftColor:"border-left-color",borderLeftStyle:"border-left-style",borderLeftWidth:"border-left-width",color:"color",cssFloat:"float",styleFloat:"float",clear:"clear",cursor:"cursor",display:"display",font:"font",fontFamily:"font-family",fontSize:"font-size",fontStyle:"font-style",fontWeight:"font-weight",height:"height",margin:"margin",marginTop:"margin-top",marginRight:"margin-right",marginBottom:"margin-bottom",marginLeft:"margin-left",overflow:"overflow",padding:"padding",
+paddingTop:"padding-top",paddingRight:"padding-right",paddingBottom:"padding-bottom",paddingLeft:"padding-left",textAlign:"text-align",textDecoration:"text-decoration",textTransform:"text-transform",verticalAlign:"vertical-align",visibility:"visibility",width:"width"};
+m[H].b.se=function(a,d){if(gb())alert("google.search.SearchControl.inlineCurrentStyle is not supported on Safari");else{var e=b;if(d)e=d;if(e)for(d=0;d<a.childNodes[D];d++)m[H].b.se(a.childNodes[d],b);if(a.nodeType==1){var f,h;d=e=g;if(k[Qa]){f=k[Qa](a,c);e=h=b}else if(a[Sa]){f=a[Sa];h=g;e=b}if(e){for(var l in f)if(m[H].b.Bd[l]){e=m[H].b.Bd[l];var n=f[l];if(l=="display"&&n=="none"){r(a,"");d=b}if(f[l]!="")h?a[G].setProperty(e,n):a[G][C](e,n)}if(d)if(!h)a.outerHTML='<div style="display:none"/>'}}}};
+O(m[H].b,"inlineCurrentStyle",m[H].b.se);m[H].b[E].Df=function(a){a=a?a:this.i;var d=c;if(k[Qa])d=k[Qa](a,c);else if(a[Sa])d=a[Sa];else if(p.defaultView[Qa])d=p.defaultView[Qa](a,c);return d?ca(d[x],10):300};m[H].b[E].zb=function(a,d){this.ub=hb(a,d)};O(m[H].b[E],"setSearchCompleteCallback",m[H].b[E].zb);m[H].b[E].vg=function(a,d){this.Bc=hb(a,d)};O(m[H].b[E],"setSearchStartingCallback",m[H].b[E].vg);
+m[H].b[E].wc=function(a,d){a.Dc(d);var e=g;switch(d){default:case m[H].z.Zb:if(a.v)pa(a.v[G],"none");break;case m[H].z.Yb:if(a.v)pa(a.v[G],"block");if(a.f.za!=m[H].a.X)e=b;a.f.S(m[H].a.X);break;case m[H].z.Cd:if(a.v)pa(a.v[G],"block");if(a.f.za!=m[H].a.la)e=b;a.f.S(m[H].a.la);break}if(e){d=this[w][xa];if(d[D]){this.gb=g;t(this.Aa,"gsc-resultsbox-visible");this.Hb();if(!a.pb){$(a.i,"gsc-resultsbox-invisible");Z(a.i,"gsc-resultsbox-visible")}a.t.$=m[H].b.La;a.f[L](d)}}};
+m[H].b[E].eg=function(a,d){this.gb=g;t(this.Aa,"gsc-resultsbox-visible");this.Hb();if(!a.pb){$(a.i,"gsc-resultsbox-invisible");Z(a.i,"gsc-resultsbox-visible")}a.t.$=m[H].b.La;a.f.ne(d)};
+m[H].L=function(a,d,e){var f=tb("gsc-search-box");f.acceptCharset="utf-8";var h=c,l=P["search-uc"],n=P[H];if(e){if(e.buttonText)n=l=e.buttonText;if(e.clickableBrandingUrl){h="http://www.google.com";if(typeof e.clickableBrandingUrl=="string"&&e.clickableBrandingUrl[za](/^http:\/\/[a-z]*\.google\.com/))h=e.clickableBrandingUrl;h=rb(h,c,"_BLANK");t(h,"gsc-branding-clickable")}}this.Nb=ub(l,"gsc-search-button");s(this.Nb,n);if(a){e="gsc-branding-img";this.ec=U(P.blank,"gsc-clear-button");s(this.ec,P["clear-results"])}else e=
+"gsc-branding-img-noclear";ia(this,vb(c,"gsc-input",c));this[w].name="search";s(this[w],n);n=nb(c,c,"gsc-search-box");T(f,n);n=ob(n,0);this.te=X(n,"gsc-input");l=X(n,"gsc-search-button");if(a){a=X(n,"gsc-clear-button");T(a,this.ec)}T(this.te,this[w]);T(l,this.Nb);a=nb(c,c,"gsc-branding");T(f,a);n=ob(a,0);this.userDefinedCell=X(n,"gsc-branding-user-defined");a=X(n,"gsc-branding-text");n=X(n,e);l=U(P["powered-by"],"gsc-branding-text");var y=m[J][Fa]+"/css/small-logo.png";e=e;if(fb()){e=V(e);e[G].filter=
+'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+y+'")';ja(e[G],"51px");u(e[G],"15px")}else e=qb(y,c,c,e);e=e;T(a,l);if(h){T(h,e);T(n,h)}else T(n,e);this.Ae=f;ib(d);T(d,this.Ae)};N("google.search.SearchForm",m[H].L);m[H].L[E].Ge=function(a,d){this.Ke=R(this,this.Bg,[this]);this.Ob=R(a,d,[this]);this.Ae.onsubmit=this.Ke;oa(this.Nb,this.Ke)};O(m[H].L[E],"setOnSubmitCallback",m[H].L[E].Ge);m[H].L[E].Fe=function(a,d){oa(this.ec,R(a,d,[this]))};O(m[H].L[E],"setOnClearCallback",m[H].L[E].Fe);
+m[H].L[E].Bg=function(){var a=this.te.offsetWidth,d=this[w][xa];this.Ob&&this.Ob();if(fb()){var e=this,f;f=d[D]*8>=a?a-6:"99%";k[La](function(){ja(e[w][G],f)},1)}return g};qa(m[H].L[E],function(a){if(a)ka(this[w],a);this.Ob&&this.Ob()});O(m[H].L[E],"execute",m[H].L[E][L]);
+m[H].L[E].Kf=function(){var a=this[w],d=function(){if(a[xa]=="")a[G].background="#FFFFFF url(http://www.google.com/coop/intl/"+m[H][K]+"/images/google_custom_search_watermark.gif) left no-repeat"};a.onblur=d;a.onfocus=function(){a[G].background="#FFFFFF"};d()};m[H].cb=function(){this.xc=0;this.ie=g;this.sb=[]};m[H].cb[E].Jg=function(a){this.xc++;var d=this;return function(){for(var e=[],f=0;f<arguments[D];++f)e[ra](arguments[f]);if(d.ie)this.ge(a,e);else{d.sb[ra]([a,e]);d.xc--;d.xc==0&&d.he()}}};
+m[H].cb[E].he=function(){for(var a=0;a<this.sb[D];a++)this.ge(this.sb[a][0],this.sb[a][1]);this.sb=[];this.ie=b};m[H].cb[E].ge=function(a,d){k[La](function(){a[Va](c,d)},0)};m[H].cb[E].start=function(a){k[La](R(this,this.he,[]),a)};m[H].j=function(a,d){m[H].b[I](this);this.kb=b;this.S(m[H].a.la);this.jb("",{iframes:b});this.hb=new m[H].g;if(a==o){a={crefUrl:"http://www.google.com/coop/tools/autocse?referer="+k[Pa]};this.Kg=b}this.hb.qa(a);this.hb.Pb=P.cse;d&&d[m[H].a.Na]&&this.hb.R(m[H].a.Na,d[m[H].a.Na]);this.Oa(this.hb);this.yb(m[H].b.qd);this.Fg=(new Date)[Ga]()};N("google.search.CustomSearchControl",m[H].j);$a(m[H].j,m[H].b);
+m[H].j[E].Ib=function(a,d){(d=d)||(d=new m[H].T);d.De(m[H].b.Ka);if(this.Kg&&this.d[D]==1)this.Cg=b;m[H].b[E].Ib[I](this,a,d);t(this.i,"gsc-control-cse")};O(m[H].j[E],"draw",m[H].j[E].Ib);
+qa(m[H].j[E],function(a){var d=this.i.offsetWidth;$(this.da,"gsc-thinWrapper");if(d<m[H].j.Xe)this.ua=g;else if(d<m[H].j.Ze)this.jb(this.Qa,{useNarrowTopAd:b,includeVerticalAds:g});else{d={useNarrowTopAd:g,includeVerticalAds:d>m[H].j.Ye};if(this.ve)d.numTopAds=m[H].j.$e;this.jb(this.Qa,d)}if((new Date)[Ga]()-this.Fg<m[H].j.Le&&this.ua){d=fa(k[Pa].href)[z](/\+/g," ");var e=fa(a)[z](/\+/g," ");this.ua=d[ya](e)!=-1}m[H].b[E][L][I](this,a)});O(m[H].j[E],"execute",m[H].j[E][L]);m[H].j[E].Bb=function(a){this.hb.Bb(a)};
+O(m[H].j[E],"setUserDefinedLabel",m[H].j[E].Bb);m[H].j[E].Oa=function(a,d){m[H].b[E].Oa[I](this,a,d);a.wb="gcsc"};O(m[H].j[E],"addSearcher",m[H].j[E].Oa);m[H].j[E].xf=function(){m[H].b[E].jb("",{numTopAds:0,numSideAds:0});this.Qa=c;this.Be=g};O(m[H].j[E],"disableAds",m[H].j[E].xf);m[H].j[E].pg=function(){this.ve=b};O(m[H].j[E],"setMoreAds",m[H].j[E].pg);m[H].j.Me="";O(m[H].j,"AUTO_PUBID",m[H].j.Me);m[H].j.Xe=250;m[H].j.Ze=500;m[H].j.Ye=800;m[H].j.Le=500;m[H].j[E].ve=g;m[H].j.$e=4;m[H].r=function(){m[H].a[I](this);this.w="video";this.Ba="/GvideoSearch";this.na="http://video.google.com/videosearch";this.N=g;this.Ta=b;this.fa=hb(this,this.oa);this.Sa="gsc-videoConfig";this.o=c};N("google.search.VideoSearch",m[H].r);$a(m[H].r,m[H].a);m[H].r.B="GvideoSearch";O(m[H].r,"RESULT_CLASS",m[H].r.B);m[H].r.n=[];m[H].r.I=function(a,d,e,f,h){var l=0;if(a)l=ca(a,10);a=m[H].r.n[l];m[H].r.n[l]=c;a.W(d,e,f,h)};O(m[H].r,"RawCompletion",m[H].r.I);
+m[H].r[E].ha=function(a,d,e,f){e=e==c?m[H].a.ka(m[H].r.n,this):e;d=this.ya(d==c?"google.search.VideoSearch.RawCompletion":d,e,f);if(a){a=a;if(this.H)a=a+" "+this.H;a="&q="+i(a);if(this.N)a+="&scoring=d";d+=a;this.u=a;if(f&&f!=0)this.u=this.u+"&start="+f}return d};
+m[H].r[E].C=function(a){a.html&&delete a.html;var d=V(this.ia());Z(d,"gs-result");var e=V("gs-image-box"),f=V("gs-text-box"),h=nb(),l=ob(h,0),n=X(l,"gs-image-box");l=X(l,"gs-text-box");T(n,e);T(l,f);T(d,h);h=m[H].a.$a(a.tbWidth,a.tbHeight,this.M);h=qb(a.tbUrl,h[x],h[Xa],"gs-image");n=rb(a.url,c,this.s(),"gs-image");t(n,"gs-image");T(n,h);T(e,n);e=Y(a.url,a[Ha],this.s(),"gs-title");T(f,e);e=U(a[va],"gs-snippet");if(fb())u(e[G],"2.6em");T(f,e);e=U(this.Va(new Date(a.published)),"gs-publishedDate");
+T(f,e);e=Y("http://"+a.publisher,a.publisher,this.s(),"gs-publisher");T(f,e);a.html=d;this.ta(a.html)};O(m[H].r[E],"createResultHtml",m[H].r[E].C);
+m[H].r.wf=function(a,d){var e=c;if(a.playUrl&&a.playUrl!=""){e=a.playUrl;var f="gsc-video-player";if(d)f=d;if(bb("opera")){var h=p[A]("object");t(h,f);h[C]("type","application/x-shockwave-flash");h[C]("data",e)}else{h=p[A]("embed");t(h,f);h[C]("type","application/x-shockwave-flash");h[C]("src",e);if(a.videoType)a.videoType=="Google"?h[C]("bgcolor","#000000"):h[C]("wmode","transparent");else h[C]("bgcolor","#000000")}e=V(d);e[v](h)}return e};O(m[H].r,"createPlayer",m[H].r.wf);
+m[H].r[E].K=function(a){this.N=a==m[H].a.ma?b:g};O(m[H].r[E],"setResultOrder",m[H].r[E].K);m[H].r[E].oa=function(a,d){if(d){if(this.o==c){d=V("gsc-configSetting");this.o=xb(c,"0",this.N,"gsc-configSettingCheckbox");T(d,this.o);T(d,U(P["sort-by-date"],"gsc-configSettingCheckboxLabel"));var e=V("gsc-configSettingSubmit");T(e,ub(P[Ra],"gsc-configSettingSubmit"));T(d,e);T(a,d)}else na(this.o,this.N);this.o[Ba]()}else if(this.o)this.o[Ka]?this.K(m[H].a.ma):this.K(m[H].a.eb)};m[H].g=function(){m[H].a[I](this);this.w="web";this.Ba="/GwebSearch";this.na="http://www.google.com/search";this.l=c;this.D=m[H].g.Y;this.F=this.Ha=this.wa=this.jc=this.Ea=c};N("google.search.WebSearch",m[H].g);$a(m[H].g,m[H].a);m[H].g.B="GwebSearch";O(m[H].g,"RESULT_CLASS",m[H].g.B);m[H].g.ib="cx";O(m[H].g,"cxRestriction_CX",m[H].g.ib);m[H].g.Gb="cref";O(m[H].g,"cxRestriction_CREF",m[H].g.Gb);m[H].g.Y="none";O(m[H].g,"cxRestriction_NONE",m[H].g.Y);m[H].g.n=[];
+m[H].g.I=function(a,d,e,f,h){var l=0;if(a)l=ca(a,10);a=m[H].g.n[l];m[H].g.n[l]=c;a.W(d,e,f,h)};O(m[H].g,"RawCompletion",m[H].g.I);m[H].g[E].Hg=function(a){return a[z](/\s+$/,"")[z](/^\s+/,"")};m[H].g[E].Vf=function(a){a=this.Hg(a);return a[z](/\s+/g,"_")[Ya]()};
+m[H].g[E].ha=function(a,d,e,f){e=e==c?m[H].a.ka(m[H].g.n,this):e;if(this.D==m[H].g.Y&&this.Jh==m[H].a.Ma)throw createException("The resultset size google.search.Search.FILTERED_CSE_RESULTSET can only be used for querying filtered Custom Search Engines.");d=this.ya(d==c?"google.search.WebSearch.RawCompletion":d,e,f);if(a){a=a;if(this.H)a=a+" "+this.H;if(this.l&&this.D!=m[H].g.Y&&this.jc){e=this.jc;var h=a;if(this.Ea!=c)h=a+" more:"+this.Ea;e=e[z](/__HL__/,m[H][K]);this.wa=e=e[z](/__QUERY__/,i(h))}if(this.l&&
+this.D==m[H].g.Y)a=a+" site:"+this.l;e="";if(this.l&&this.D!=m[H].g.Y){if(this.D==m[H].g.ib)e=e+"&cx="+this.l;else if(this.D==m[H].g.Gb)e=e+"&cref="+i(this.l);if(this.Ea!=c)a=a+" more:"+this.Ea}e=e+"&q="+i(a);if(this.Ha)e=e+"&safe="+this.Ha;if(this.F)e+=this.F;d+=e;this.u=e;if(f&&f!=0)this.u=this.u+"&start="+f}if(k.google[J].GoogleLocale)d+="&gl="+i(k.google[J].GoogleLocale);return d};
+m[H].g[E].be=function(a){a.html&&delete a.html;var d=V("gs-promotion");Z(d,"gs-result");var e=sb(a.url,a[Ha],this.s(),"gs-title");T(d,e);e=nb(0,0);var f=ob(e,0),h;T(d,e);if(a.image){e=a.image;e=qb(e.url,e[x],e[Xa],"gs-promotion-image");h=pb("gs-promotion-image-td");T(h,e);T(f,h)}if(a.bodyLines){h=pb();var l=V();T(f,h);T(h,l);f=a.bodyLines;for(h=0;h<f[D];h++){e=f[h];var n=e[Ha],y=e.url,B=e.visibleUrl;e=V("gs-snippet");if(y&&B){y=rb(y,B,this.s(),"gs-title");T(e,y)}n&&T(e,kb(n));T(l,e)}}e=lb(a.visibleUrl,
+"gs-visibleUrl");T(l,e);Z(e,"gs-visibleUrl-short");a.html=d};O(m[H].g[E],"createPromotionHtml",m[H].g[E].be);m[H].g[E].ee=function(a,d,e,f){var h=V("gs-image-box gs-web-image-box");if(e==o)e=100;a=qb(a,e,f,"gs-image");d=rb(d,c,this.s());t(d,"gs-image");T(d,a);T(h,d);return h};m[H].g[E].Xd=function(a,d){if(d.url){var e=sb(d.url,d.label,this.s(),"gs-action");d["class"]&&wb(e,d["class"]);a.actionHtml||(a.actionHtml=V("gs-actions"));T(a.actionHtml,e)}};
+m[H].g[E].C=function(a){a.html&&delete a.html;a.thumbnailHtml&&delete a.thumbnailHtml;a.actionHtml&&delete a.actionHtml;var d=V(this.ia());Z(d,"gs-result");if(a.richSnippet){var e=a.richSnippet;if(e.thumbnail&&e.thumbnail.src)a.thumbnailHtml=this.ee(e.thumbnail.src,a.unescapedUrl,e.thumbnail[x],e.thumbnail[Xa]);else if(e[Ma]&&e[Ma].thumbnailUrl)a.thumbnailHtml=this.ee(e[Ma].thumbnailUrl,a.unescapedUrl);if(e[Ua])if(e[Ua][D]&&e[Ua][0])for(var f=0;f<e[Ua][D];f++)this.Xd(a,e[Ua][f]);else this.Xd(a,e[Ua]);
+a.thumbnailHtml&&T(d,a.thumbnailHtml[Ca](b))}e=Y(a.unescapedUrl,a[Ha],this.s(),"gs-title");T(d,e);e=U(a[va],"gs-snippet");T(d,e);e=U(a.visibleUrl,"gs-visibleUrl");T(d,e);Z(e,"gs-visibleUrl-short");e=a.unescapedUrl[ya](a.visibleUrl);f=a.visibleUrl;if(e!=-1&&e!=0)f=a.unescapedUrl.substring(e);e=U(f,"gs-visibleUrl");Z(e,"gs-visibleUrl-long");T(d,e);a.actionHtml&&T(d,a.actionHtml[Ca](b));a.html=d;this.ta(a.html)};O(m[H].g[E],"createResultHtml",m[H].g[E].C);
+m[H].g[E].qa=function(a,d,e){this.lb=this.wa=c;var f=g;if(a==c||typeof a=="string"&&a==""){f=g;this.l=c;this.D=m[H].g.Y;this.lb=this.Ea=c}else if(typeof a=="string")if(f=a[za](/(^partner-pub-\d*:.*)|(^\d{21}:.*)/)){this.l=a;this.D=m[H].g.ib}else{this.l=a;this.D=m[H].g.Y}else if(a.siteUrl){f=g;this.l=a.siteUrl}else if(a.cseId){f=b;this.l=a.cseId;this.D=m[H].g.ib}else if(a.crefUrl){f=b;this.l=a.crefUrl;this.D=m[H].g.Gb;this.lb=P["linked-cse-error-results"]}else{f=g;this.l=c;this.D=m[H].g.Y;this.Ea=
+c}if(f){if(d)this.Ea=this.Vf(d);if(e)if(e[za](/__HL__/)&&e[za](/__QUERY__/))this.jc=e;if(this.D==m[H].g.Gb)if(!this.l[za](/^http:\/\/www\.google\.com\/coop\/tools\/autocse\?referer=/))(new Image).src="http://www.google.com/cse/tools/ping?cref="+i(this.l)+"&nocache="+Number(new Date)}};O(m[H].g[E],"setSiteRestriction",m[H].g[E].qa);
+m[H].g[E].R=function(a,d){if(a==m[H].a.Ub)this.Ha=d?d==m[H].a.Wb||d==m[H].a.Vb||d==m[H].a.Ad?d:c:c;if(a==m[H].a.Na)if(d)for(var e in d){a=d[e];if(e=="lr"||e=="usg"||e=="filter"||e=="gl"||e=="richsnippet"){if(this.F==c)this.F="&";else this.F+="&";this.F+=e+"="+i(a)}}else this.F=c};O(m[H].g[E],"setRestriction",m[H].g[E].R);m[H].g[E].S=function(a){if(m[H].a.Ma==a)this.za=m[H].a.Ma;else m[H].a[E].S[I](this,a)};O(m[H].g[E],"setResultSetSize",m[H].g[E].S);if(!m[H].NoOldNames){j("GwebSearch",m[H].g);j("GbookSearch",m[H].k);j("GblogSearch",m[H].q);j("GvideoSearch",m[H].r);j("GnewsSearch",m[H].m);j("GlocalSearch",m[H].e);j("GimageSearch",m[H].c);j("GpatentSearch",m[H].h);j("GSearch",m[H].a);j("GSearchControl",m[H].b);j("GSearchForm",m[H].L);j("GsearcherOptions",m[H].A);j("GdrawOptions",m[H].T)};var Mb=function(a,d,e){this.Tf=a;this.Ac=d;this.Ya=g;this.pe=e||c;this.console=k[Ta]||{log:function(){}};if(!this.pe&&this.Ac=="parent")this[Ta].log("You forgot to pass an iframe.");else{if(!k.UDS_IEXDC_SETUP_COMPLETE)try{k.execScript("Class UDS_GCXPC____NIXVBS_wrapper\n Private UDS_M_TRANSPORT\nPublic Sub UDS_SET_TRANSPORT(transport)\nIf isEmpty(UDS_M_TRANSPORT) Then\nSet UDS_M_TRANSPORT = transport\nEnd If\nEnd Sub\nPublic Sub UDS_SEND_MESSAGE_(payload)\n Call UDS_M_TRANSPORT.UDS_GCXPC____NIXJS_handle_message(payload)\nEnd Sub\nPublic Sub UDS_CREATE_CHANNEL(channel)\n Call UDS_M_TRANSPORT.UDS_GCXPC____NIXJS_create_channel(channel)\nEnd Sub\nPublic Sub UDS_GCXPC____NIXVBS_container()\n End Sub\nEnd Class\n Function UDS_GCXPC____NIXVBS_get_wrapper(transport)\nDim wrap\nSet wrap = New UDS_GCXPC____NIXVBS_wrapper\nwrap.UDS_SET_TRANSPORT transport\nSet UDS_GCXPC____NIXVBS_get_wrapper = wrap\nEnd Function",
+"vbscript");k.UDS_IEXDC_SETUP_COMPLETE=b}catch(f){}this.UDS_GCXPC____NIXJS_handle_message=this.If;this.UDS_GCXPC____NIXJS_create_channel=this.uf}},Ob=function(){var a=k[Wa]?k[Wa][Oa]:c;if(a)return/trident\/\d/i.test(a)&&Nb(a)==7;return g},Pb=/MSIE\s+([^\);]+)(\)|;)/,Nb=function(a){return(a=Pb.exec(a))?a[1]:""};M=Mb[E];M.If=function(a){this.Ac=="parent"&&a=="connected"?this.He():this.Tf(a)};M.uf=function(a){this.oe=a};
+M.Zd=function(a){return function(){if(!a.Ya){var d=a.pe;try{d.contentWindow.opener=k.UDS_GCXPC____NIXVBS_get_wrapper(a);a.Ya=b}catch(e){this[Ta].log("Exception caught while attempting Google IE XDC: "+e.message)}a.Ya||k[La](a.Zd(a),100)}}};M.Yd=function(a){return function(){if(!a.Ya){try{var d=k.opener;if(d&&"UDS_GCXPC____NIXVBS_container"in d){a.oe=d;a.oe.UDS_CREATE_CHANNEL(k.UDS_GCXPC____NIXVBS_get_wrapper(a));a.Ya=b;a.send("connected");a.He()}}catch(e){return}a.Ya||k[La](a.Yd(a),100)}}};
+M.send=function(){this[Ta].log("Cross-domain channel has been modified.")};M.sf=function(a){this.He=a||function(){};this.Ac=="parent"?this.Zd(this)():this.Yd(this)()};
+google.loader.loaded({"module":"search","version":"1.0","components":["default"]});
+google.loader.eval.search = function() {eval(arguments[0]);};if (google.loader.eval.scripts && google.loader.eval.scripts['search']) {(function() {var scripts = google.loader.eval.scripts['search'];for (var i = 0; i < scripts.length; i++) {google.loader.eval.search(scripts[i]);}})();google.loader.eval.scripts['search'] = null;}})();
+
+
+
+var canvas;
+
+var delta = [0,0];
+var stage = [window.screenX,window.screenY,window.innerWidth,window.innerHeight];
+getBrowserDimensions();
+
+var isPlaying = false;
+var isMouseDown = false;
+
+var worldAABB;
+var world;
+var iterations = 1;
+var timeStep = 1/25;
+
+var walls = new Array();
+var wall_thickness = 200;
+var wallsSetted = false;
+
+var mouseJoint;
+var mouseX = 0;
+var mouseY = 0;
+
+var mouseOnClick = new Array();
+
+var timer = 0;
+//var stats = new Stats();
+var elements = new Array();
+var bodies = new Array();
+var properties = new Array();
+
+var gWebSearch;
+var imFeelingLuckyMode = false;
+var resultBodies = new Array();
+
+init();
+
+// GOOGLE API
+
+function onLoad()
+{
+ gWebSearch = new GwebSearch();
+ gWebSearch.setResultSetSize(GSearch.SMALL_RESULTSET);
+ gWebSearch.setSearchCompleteCallback(null, onWebSearch);
+}
+
+function onWebSearch()
+{
+ if(imFeelingLuckyMode)
+ {
+ location.href = gWebSearch.results[0].unescapedUrl;
+ return;
+ }
+
+ for (var i = 0; i < gWebSearch.results.length; i++)
+ addResult(gWebSearch.results[i]);
+}
+
+//
+
+function init()
+{
+ canvas = document.getElementById('canvas');
+
+ document.onmousedown = onDocumentMouseDown;
+ document.onmouseup = onDocumentMouseUp;
+ document.onmousemove = onDocumentMouseMove;
+ document.ondblclick = onDocumentDoubleClick;
+
+ document.onkeypress = onDocumentKeyPress;
+
+ // init box2d
+
+ worldAABB = new b2AABB();
+ worldAABB.minVertex.Set(-200, -200);
+ worldAABB.maxVertex.Set( screen.width + 200, screen.height + 200);
+
+ world = new b2World(worldAABB, new b2Vec2(0, 0), true);
+
+ // walls
+ setWalls();
+
+ // Get box2d elements
+
+ elements = getElementsByClass("box2d");
+
+ for (i = 0; i < elements.length; i++)
+ {
+ var element = elements[i];
+ properties[i] = findPos(element);
+ properties[i][2] = element.offsetWidth;
+ properties[i][3] = element.offsetHeight;
+ }
+
+ for (i = 0; i < elements.length; i++)
+ {
+ var element = elements[i];
+ element.style['position'] = 'absolute';
+ element.style['left'] = properties[i][0] + 'px';
+ element.style['top'] = properties[i][1] + 'px';
+ //element.style['backgroundColor'] = '#ffff00';
+ element.onmousedown = onElementMouseDown;
+ element.onmouseup = onElementMouseUp;
+ element.onclick = onElementClick;
+
+ bodies[i] = createBox(world, properties[i][0] + (properties[i][2] >> 1), properties[i][1] + (properties[i][3] >> 1), properties[i][2] / 2, properties[i][3] / 2, false);
+ }
+}
+
+function play()
+{
+ setInterval(loop, 25);
+}
+
+// .. ACTIONS
+
+function onDocumentMouseDown()
+{
+ isMouseDown = true;
+ return false;
+}
+
+function onDocumentMouseUp()
+{
+ isMouseDown = false;
+ return false;
+}
+
+function onDocumentMouseMove()
+{
+ if (!isPlaying)
+ {
+ isPlaying = true;
+ play();
+ }
+
+ mouseX = window.event.clientX;
+ mouseY = window.event.clientY;
+}
+
+function onDocumentDoubleClick()
+{
+ for (i = 0; i < resultBodies.length; i++)
+ {
+ var body = resultBodies[i]
+ canvas.removeChild( body.GetUserData().element );
+ world.DestroyBody(body);
+ body = null;
+ }
+
+ resultBodies = new Array();
+}
+
+function onDocumentKeyPress(e)
+{
+ if (e.charCode == 13)
+ search();
+}
+
+function onElementMouseDown()
+{
+ mouseOnClick[0] = window.event.clientX;
+ mouseOnClick[1] = window.event.clientY;
+ return false;
+}
+
+function onElementMouseUp()
+{
+ return false;
+}
+
+function onElementClick()
+{
+ var range = 5;
+
+ if (mouseOnClick[0] > window.event.clientX + range || mouseOnClick[0] < window.event.clientX - range && mouseOnClick[1] > window.event.clientY + range || mouseOnClick[1] < window.event.clientY - range)
+ return false;
+
+ if (this == document.getElementById('btnG')) search();
+ if (this == document.getElementById('btnI')) imFeelingLucky();
+ if (this == document.getElementById('q')) document.f.q.focus();
+}
+
+// API STUFF
+
+function search()
+{
+ if (!isPlaying)
+ {
+ isPlaying = true;
+ play();
+ }
+
+ onDocumentDoubleClick(); // clean
+ gWebSearch.execute(document.getElementById('q').value);
+ return false;
+}
+
+function imFeelingLucky()
+{
+ imFeelingLuckyMode = true;
+ gWebSearch.execute(document.getElementById('q').value);
+ return false;
+}
+
+function addResult(data)
+{
+ var element = document.createElement("div");
+ element.innerHTML = '<div><h3 class=r><a href="' + data.unescapedUrl + '" class=l onmousedown="return clk(this.href,\'\',\'\',\'res\',\'1\',\'&amp;sig2=3Ti89FTuSYfE6a-5k1jjKQ\')">' + data.title + '</a></h3><span style=display:inline-block><button class=w10 title="Promote"></button><button class=w20 title="Remove"></button></span><div class="s">' + data.content + '<br><cite>' + data.visibleUrl + '</cite></div>';
+
+ canvas.appendChild( element );
+ properties.push([Math.random() * (window.innerWidth / 2),-200,600,element.offsetHeight]);
+
+ var i = properties.length - 1;
+
+ element.style['position'] = 'absolute';
+ element.style['left'] = 0 + 'px';
+ element.style['top'] = -100 + 'px';
+ element.style['backgroundColor'] = '#ffffff';
+ element.onmousedown = onElementMouseDown;
+ element.onmouseup = onElementMouseUp;
+ element.onclick = onElementClick;
+
+ elements[i] = element;
+
+ resultBodies.push( bodies[i] = createBox(world, properties[i][0] + (properties[i][2] >> 1), properties[i][1] + (properties[i][3] >> 1), properties[i][2] / 2, properties[i][3] / 2, false, element) );
+
+}
+
+//
+
+function loop()
+{
+ if (getBrowserDimensions())
+ setWalls();
+
+ delta[0] += (0 - delta[0]) * .5;
+ delta[1] += (0 - delta[1]) * .5;
+
+ world.m_gravity.x = 0 + delta[0];
+ world.m_gravity.y = 350 + delta[1];
+
+ mouseDrag();
+ world.Step(timeStep, iterations);
+
+ for (i = 0; i < elements.length; i++)
+ {
+ var element = elements[i];
+
+ element.style['left'] = (bodies[i].m_position0.x - (properties[i][2] >> 1)) + 'px';
+ element.style['top'] = (bodies[i].m_position0.y - (properties[i][3] >> 1)) + 'px';
+
+ // webkit
+ element.style['-webkit-transform'] = 'rotate(' + (bodies[i].m_rotation0 * 57.2957795) + 'deg)';
+
+ // gecko
+ element.style['MozTransform'] = 'rotate(' + (bodies[i].m_rotation0 * 57.2957795) + 'deg)';
+
+ // opera
+ element.style['OTransform'] = 'rotate(' + (bodies[i].m_rotation0 * 57.2957795) + 'deg)';
+ }
+}
+
+
+// .. BOX2D UTILS
+
+function createBox(world, x, y, width, height, fixed, element)
+{
+ if (typeof(fixed) == 'undefined') fixed = true;
+ var boxSd = new b2BoxDef();
+ if (!fixed) boxSd.density = 1.0;
+ boxSd.extents.Set(width, height);
+ var boxBd = new b2BodyDef();
+ boxBd.AddShape(boxSd);
+ boxBd.position.Set(x,y);
+ boxBd.userData = {element: element};
+ return world.CreateBody(boxBd)
+}
+
+function mouseDrag()
+{
+ // mouse press
+ if (isMouseDown && !mouseJoint)
+ {
+ var body = getBodyAtMouse();
+
+ if (body)
+ {
+ var md = new b2MouseJointDef();
+ md.body1 = world.m_groundBody;
+ md.body2 = body;
+ md.target.Set(mouseX, mouseY);
+ md.maxForce = 30000.0 * body.m_mass;
+ md.timeStep = timeStep;
+ mouseJoint = world.CreateJoint(md);
+ body.WakeUp();
+ }
+ }
+
+ // mouse release
+ if (!isMouseDown)
+ {
+ if (mouseJoint)
+ {
+ world.DestroyJoint(mouseJoint);
+ mouseJoint = null;
+ }
+ }
+
+ // mouse move
+ if (mouseJoint)
+ {
+ var p2 = new b2Vec2(mouseX, mouseY);
+ mouseJoint.SetTarget(p2);
+ }
+}
+
+function getBodyAtMouse()
+{
+ // Make a small box.
+ var mousePVec = new b2Vec2();
+ mousePVec.Set(mouseX, mouseY);
+
+ var aabb = new b2AABB();
+ aabb.minVertex.Set(mouseX - 1, mouseY - 1);
+ aabb.maxVertex.Set(mouseX + 1, mouseY + 1);
+
+ // Query the world for overlapping shapes.
+ var k_maxCount = 10;
+ var shapes = new Array();
+ var count = world.Query(aabb, shapes, k_maxCount);
+ var body = null;
+
+ for (var i = 0; i < count; ++i)
+ {
+ if (shapes[i].m_body.IsStatic() == false)
+ {
+ if ( shapes[i].TestPoint(mousePVec) )
+ {
+ body = shapes[i].m_body;
+ break;
+ }
+ }
+ }
+ return body;
+}
+
+function setWalls()
+{
+ if (wallsSetted)
+ {
+ world.DestroyBody(walls[0]);
+ world.DestroyBody(walls[1]);
+ world.DestroyBody(walls[2]);
+ world.DestroyBody(walls[3]);
+
+ walls[0] = null;
+ walls[1] = null;
+ walls[2] = null;
+ walls[3] = null;
+ }
+
+ walls[0] = createBox(world, stage[2] / 2, - wall_thickness, stage[2], wall_thickness);
+ walls[1] = createBox(world, stage[2] / 2, stage[3] + wall_thickness, stage[2], wall_thickness);
+ walls[2] = createBox(world, - wall_thickness, stage[3] / 2, wall_thickness, stage[3]);
+ walls[3] = createBox(world, stage[2] + wall_thickness, stage[3] / 2, wall_thickness, stage[3]);
+
+ wallsSetted = true;
+}
+
+// .. UTILS
+
+function getElementsByClass( searchClass )
+{
+ var classElements = new Array();
+ var els = document.getElementsByTagName('*');
+ var elsLen = els.length
+ for (i = 0, j = 0; i < elsLen; i++)
+ {
+ var classes = els[i].className.split(' ');
+ for (k = 0; k < classes.length; k++)
+ if ( classes[k] == searchClass )
+ classElements[j++] = els[i];
+ }
+ return classElements;
+}
+
+function findPos(obj)
+{
+ var curleft = curtop = 0;
+ if (obj.offsetParent)
+ {
+ do
+ {
+ curleft += obj.offsetLeft;
+ curtop += obj.offsetTop;
+ }
+ while (obj = obj.offsetParent);
+ }
+ return [curleft,curtop];
+}
+
+function getBrowserDimensions()
+{
+ var changed = false;
+
+ if (stage[0] != window.screenX)
+ {
+ delta[0] = (window.screenX - stage[0]) * 50;
+ stage[0] = window.screenX;
+ changed = true;
+ }
+
+ if (stage[1] != window.screenY)
+ {
+ delta[1] = (window.screenY - stage[1]) * 50;
+ stage[1] = window.screenY;
+ changed = true;
+ }
+
+ if (stage[2] != window.innerWidth)
+ {
+ stage[2] = window.innerWidth;
+ changed = true;
+ }
+
+ if (stage[3] != window.innerHeight)
+ {
+ stage[3] = window.innerHeight;
+ changed = true;
+ }
+
+ return changed;
+}
+
+</script>
+
+
+<script id='jquery' id="x">
+/*
+ * jQuery JavaScript Library v1.3
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-01-13 12:50:31 -0500 (Tue, 13 Jan 2009)
+ * Revision: 6104
+ */
+(function(){var l=this,g,x=l.jQuery,o=l.$,n=l.jQuery=l.$=function(D,E){return new n.fn.init(D,E)},C=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;n.fn=n.prototype={init:function(D,G){D=D||document;if(D.nodeType){this[0]=D;this.length=1;this.context=D;return this}if(typeof D==="string"){var F=C.exec(D);if(F&&(F[1]||!G)){if(F[1]){D=n.clean([F[1]],G)}else{var H=document.getElementById(F[3]);if(H){if(H.id!=F[3]){return n().find(D)}var E=n(H);E.context=document;E.selector=D;return E}D=[]}}else{return n(G).find(D)}}else{if(n.isFunction(D)){return n(document).ready(D)}}if(D.selector&&D.context){this.selector=D.selector;this.context=D.context}return this.setArray(n.makeArray(D))},selector:"",jquery:"1.3",size:function(){return this.length},get:function(D){return D===g?n.makeArray(this):this[D]},pushStack:function(E,G,D){var F=n(E);F.prevObject=this;F.context=this.context;if(G==="find"){F.selector=this.selector+(this.selector?" ":"")+D}else{if(G){F.selector=this.selector+"."+G+"("+D+")"}}return F},setArray:function(D){this.length=0;Array.prototype.push.apply(this,D);return this},each:function(E,D){return n.each(this,E,D)},index:function(D){return n.inArray(D&&D.jquery?D[0]:D,this)},attr:function(E,G,F){var D=E;if(typeof E==="string"){if(G===g){return this[0]&&n[F||"attr"](this[0],E)}else{D={};D[E]=G}}return this.each(function(H){for(E in D){n.attr(F?this.style:this,E,n.prop(this,D[E],F,H,E))}})},css:function(D,E){if((D=="width"||D=="height")&&parseFloat(E)<0){E=g}return this.attr(D,E,"curCSS")},text:function(E){if(typeof E!=="object"&&E!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(E))}var D="";n.each(E||this,function(){n.each(this.childNodes,function(){if(this.nodeType!=8){D+=this.nodeType!=1?this.nodeValue:n.fn.text([this])}})});return D},wrapAll:function(D){if(this[0]){var E=n(D,this[0].ownerDocument).clone();if(this[0].parentNode){E.insertBefore(this[0])}E.map(function(){var F=this;while(F.firstChild){F=F.firstChild}return F}).append(this)}return this},wrapInner:function(D){return this.each(function(){n(this).contents().wrapAll(D)})},wrap:function(D){return this.each(function(){n(this).wrapAll(D)})},append:function(){return this.domManip(arguments,true,function(D){if(this.nodeType==1){this.appendChild(D)}})},prepend:function(){return this.domManip(arguments,true,function(D){if(this.nodeType==1){this.insertBefore(D,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(D){this.parentNode.insertBefore(D,this)})},after:function(){return this.domManip(arguments,false,function(D){this.parentNode.insertBefore(D,this.nextSibling)})},end:function(){return this.prevObject||n([])},push:[].push,find:function(D){if(this.length===1&&!/,/.test(D)){var F=this.pushStack([],"find",D);F.length=0;n.find(D,this[0],F);return F}else{var E=n.map(this,function(G){return n.find(D,G)});return this.pushStack(/[^+>] [^+>]/.test(D)?n.unique(E):E,"find",D)}},clone:function(E){var D=this.map(function(){if(!n.support.noCloneEvent&&!n.isXMLDoc(this)){var H=this.cloneNode(true),G=document.createElement("div");G.appendChild(H);return n.clean([G.innerHTML])[0]}else{return this.cloneNode(true)}});var F=D.find("*").andSelf().each(function(){if(this[h]!==g){this[h]=null}});if(E===true){this.find("*").andSelf().each(function(H){if(this.nodeType==3){return}var G=n.data(this,"events");for(var J in G){for(var I in G[J]){n.event.add(F[H],J,G[J][I],G[J][I].data)}}})}return D},filter:function(D){return this.pushStack(n.isFunction(D)&&n.grep(this,function(F,E){return D.call(F,E)})||n.multiFilter(D,n.grep(this,function(E){return E.nodeType===1})),"filter",D)},closest:function(D){var E=n.expr.match.POS.test(D)?n(D):null;return this.map(function(){var F=this;while(F&&F.ownerDocument){if(E?E.index(F)>-1:n(F).is(D)){return F}F=F.parentNode}})},not:function(D){if(typeof D==="string"){if(f.test(D)){return this.pushStack(n.multiFilter(D,this,true),"not",D)}else{D=n.multiFilter(D,this)}}var E=D.length&&D[D.length-1]!==g&&!D.nodeType;return this.filter(function(){return E?n.inArray(this,D)<0:this!=D})},add:function(D){return this.pushStack(n.unique(n.merge(this.get(),typeof D==="string"?n(D):n.makeArray(D))))},is:function(D){return !!D&&n.multiFilter(D,this).length>0},hasClass:function(D){return !!D&&this.is("."+D)},val:function(J){if(J===g){var D=this[0];if(D){if(n.nodeName(D,"option")){return(D.attributes.value||{}).specified?D.value:D.text}if(n.nodeName(D,"select")){var H=D.selectedIndex,K=[],L=D.options,G=D.type=="select-one";if(H<0){return null}for(var E=G?H:0,I=G?H+1:L.length;E<I;E++){var F=L[E];if(F.selected){J=n(F).val();if(G){return J}K.push(J)}}return K}return(D.value||"").replace(/\r/g,"")}return g}if(typeof J==="number"){J+=""}return this.each(function(){if(this.nodeType!=1){return}if(n.isArray(J)&&/radio|checkbox/.test(this.type)){this.checked=(n.inArray(this.value,J)>=0||n.inArray(this.name,J)>=0)}else{if(n.nodeName(this,"select")){var M=n.makeArray(J);n("option",this).each(function(){this.selected=(n.inArray(this.value,M)>=0||n.inArray(this.text,M)>=0)});if(!M.length){this.selectedIndex=-1}}else{this.value=J}}})},html:function(D){return D===g?(this[0]?this[0].innerHTML:null):this.empty().append(D)},replaceWith:function(D){return this.after(D).remove()},eq:function(D){return this.slice(D,+D+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(D){return this.pushStack(n.map(this,function(F,E){return D.call(F,E,F)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=n.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild,D=this.length>1?I.cloneNode(true):I;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),G>0?D.cloneNode(true):I)}}if(F){n.each(F,y)}}return this;function K(N,O){return M&&n.nodeName(N,"table")&&n.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};n.fn.init.prototype=n.fn;function y(D,E){if(E.src){n.ajax({url:E.src,async:false,dataType:"script"})}else{n.globalEval(E.text||E.textContent||E.innerHTML||"")}if(E.parentNode){E.parentNode.removeChild(E)}}function e(){return +new Date}n.extend=n.fn.extend=function(){var I=arguments[0]||{},G=1,H=arguments.length,D=false,F;if(typeof I==="boolean"){D=I;I=arguments[1]||{};G=2}if(typeof I!=="object"&&!n.isFunction(I)){I={}}if(H==G){I=this;--G}for(;G<H;G++){if((F=arguments[G])!=null){for(var E in F){var J=I[E],K=F[E];if(I===K){continue}if(D&&K&&typeof K==="object"&&!K.nodeType){I[E]=n.extend(D,J||(K.length!=null?[]:{}),K)}else{if(K!==g){I[E]=K}}}}}return I};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,p=document.defaultView||{},r=Object.prototype.toString;n.extend({noConflict:function(D){l.$=o;if(D){l.jQuery=x}return n},isFunction:function(D){return r.call(D)==="[object Function]"},isArray:function(D){return r.call(D)==="[object Array]"},isXMLDoc:function(D){return D.documentElement&&!D.body||D.tagName&&D.ownerDocument&&!D.ownerDocument.body},globalEval:function(F){F=n.trim(F);if(F){var E=document.getElementsByTagName("head")[0]||document.documentElement,D=document.createElement("script");D.type="text/javascript";if(n.support.scriptEval){D.appendChild(document.createTextNode(F))}else{D.text=F}E.insertBefore(D,E.firstChild);E.removeChild(D)}},nodeName:function(E,D){return E.nodeName&&E.nodeName.toUpperCase()==D.toUpperCase()},each:function(F,J,E){var D,G=0,H=F.length;if(E){if(H===g){for(D in F){if(J.apply(F[D],E)===false){break}}}else{for(;G<H;){if(J.apply(F[G++],E)===false){break}}}}else{if(H===g){for(D in F){if(J.call(F[D],D,F[D])===false){break}}}else{for(var I=F[0];G<H&&J.call(I,G,I)!==false;I=F[++G]){}}}return F},prop:function(G,H,F,E,D){if(n.isFunction(H)){H=H.call(G,E)}return typeof H==="number"&&F=="curCSS"&&!b.test(D)?H+"px":H},className:{add:function(D,E){n.each((E||"").split(/\s+/),function(F,G){if(D.nodeType==1&&!n.className.has(D.className,G)){D.className+=(D.className?" ":"")+G}})},remove:function(D,E){if(D.nodeType==1){D.className=E!==g?n.grep(D.className.split(/\s+/),function(F){return !n.className.has(E,F)}).join(" "):""}},has:function(E,D){return n.inArray(D,(E.className||E).toString().split(/\s+/))>-1}},swap:function(G,F,H){var D={};for(var E in F){D[E]=G.style[E];G.style[E]=F[E]}H.call(G);for(var E in F){G.style[E]=D[E]}},css:function(F,D,H){if(D=="width"||D=="height"){var J,E={position:"absolute",visibility:"hidden",display:"block"},I=D=="width"?["Left","Right"]:["Top","Bottom"];function G(){J=D=="width"?F.offsetWidth:F.offsetHeight;var L=0,K=0;n.each(I,function(){L+=parseFloat(n.curCSS(F,"padding"+this,true))||0;K+=parseFloat(n.curCSS(F,"border"+this+"Width",true))||0});J-=Math.round(L+K)}if(n(F).is(":visible")){G()}else{n.swap(F,E,G)}return Math.max(0,J)}return n.curCSS(F,D,H)},curCSS:function(H,E,F){var K,D=H.style;if(E=="opacity"&&!n.support.opacity){K=n.attr(D,"opacity");return K==""?"1":K}if(E.match(/float/i)){E=v}if(!F&&D&&D[E]){K=D[E]}else{if(p.getComputedStyle){if(E.match(/float/i)){E="float"}E=E.replace(/([A-Z])/g,"-$1").toLowerCase();var L=p.getComputedStyle(H,null);if(L){K=L.getPropertyValue(E)}if(E=="opacity"&&K==""){K="1"}}else{if(H.currentStyle){var I=E.replace(/\-(\w)/g,function(M,N){return N.toUpperCase()});K=H.currentStyle[E]||H.currentStyle[I];if(!/^\d+(px)?$/i.test(K)&&/^\d/.test(K)){var G=D.left,J=H.runtimeStyle.left;H.runtimeStyle.left=H.currentStyle.left;D.left=K||0;K=D.pixelLeft+"px";D.left=G;H.runtimeStyle.left=J}}}}return K},clean:function(E,J,H){J=J||document;if(typeof J.createElement==="undefined"){J=J.ownerDocument||J[0]&&J[0].ownerDocument||document}if(!H&&E.length===1&&typeof E[0]==="string"){var G=/^<(\w+)\s*\/?>$/.exec(E[0]);if(G){return[J.createElement(G[1])]}}var F=[],D=[],K=J.createElement("div");n.each(E,function(O,Q){if(typeof Q==="number"){Q+=""}if(!Q){return}if(typeof Q==="string"){Q=Q.replace(/(<(\w+)[^>]*?)\/>/g,function(S,T,R){return R.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?S:T+"></"+R+">"});var N=n.trim(Q).toLowerCase();var P=!N.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!N.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||N.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!N.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!N.indexOf("<td")||!N.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!N.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!n.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];K.innerHTML=P[1]+Q+P[2];while(P[0]--){K=K.lastChild}if(!n.support.tbody){var M=!N.indexOf("<table")&&N.indexOf("<tbody")<0?K.firstChild&&K.firstChild.childNodes:P[1]=="<table>"&&N.indexOf("<tbody")<0?K.childNodes:[];for(var L=M.length-1;L>=0;--L){if(n.nodeName(M[L],"tbody")&&!M[L].childNodes.length){M[L].parentNode.removeChild(M[L])}}}if(!n.support.leadingWhitespace&&/^\s/.test(Q)){K.insertBefore(J.createTextNode(Q.match(/^\s*/)[0]),K.firstChild)}Q=n.makeArray(K.childNodes)}if(Q.nodeType){F.push(Q)}else{F=n.merge(F,Q)}});if(H){for(var I=0;F[I];I++){if(n.nodeName(F[I],"script")&&(!F[I].type||F[I].type.toLowerCase()==="text/javascript")){D.push(F[I].parentNode?F[I].parentNode.removeChild(F[I]):F[I])}else{if(F[I].nodeType===1){F.splice.apply(F,[I+1,0].concat(n.makeArray(F[I].getElementsByTagName("script"))))}H.appendChild(F[I])}}return D}return F},attr:function(I,F,J){if(!I||I.nodeType==3||I.nodeType==8){return g}var G=!n.isXMLDoc(I),K=J!==g;F=G&&n.props[F]||F;if(I.tagName){var E=/href|src|style/.test(F);if(F=="selected"&&I.parentNode){I.parentNode.selectedIndex}if(F in I&&G&&!E){if(K){if(F=="type"&&n.nodeName(I,"input")&&I.parentNode){throw"type property can't be changed"}I[F]=J}if(n.nodeName(I,"form")&&I.getAttributeNode(F)){return I.getAttributeNode(F).nodeValue}if(F=="tabIndex"){var H=I.getAttributeNode("tabIndex");return H&&H.specified?H.value:I.nodeName.match(/^(a|area|button|input|object|select|textarea)$/i)?0:g}return I[F]}if(!n.support.style&&G&&F=="style"){return n.attr(I.style,"cssText",J)}if(K){I.setAttribute(F,""+J)}var D=!n.support.hrefNormalized&&G&&E?I.getAttribute(F,2):I.getAttribute(F);return D===null?g:D}if(!n.support.opacity&&F=="opacity"){if(K){I.zoom=1;I.filter=(I.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(J)+""=="NaN"?"":"alpha(opacity="+J*100+")")}return I.filter&&I.filter.indexOf("opacity=")>=0?(parseFloat(I.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}F=F.replace(/-([a-z])/ig,function(L,M){return M.toUpperCase()});if(K){I[F]=J}return I[F]},trim:function(D){return(D||"").replace(/^\s+|\s+$/g,"")},makeArray:function(F){var D=[];if(F!=null){var E=F.length;if(E==null||typeof F==="string"||n.isFunction(F)||F.setInterval){D[0]=F}else{while(E){D[--E]=F[E]}}}return D},inArray:function(F,G){for(var D=0,E=G.length;D<E;D++){if(G[D]===F){return D}}return -1},merge:function(G,D){var E=0,F,H=G.length;if(!n.support.getAll){while((F=D[E++])!=null){if(F.nodeType!=8){G[H++]=F}}}else{while((F=D[E++])!=null){G[H++]=F}}return G},unique:function(J){var E=[],D={};try{for(var F=0,G=J.length;F<G;F++){var I=n.data(J[F]);if(!D[I]){D[I]=true;E.push(J[F])}}}catch(H){E=J}return E},grep:function(E,I,D){var F=[];for(var G=0,H=E.length;G<H;G++){if(!D!=!I(E[G],G)){F.push(E[G])}}return F},map:function(D,I){var E=[];for(var F=0,G=D.length;F<G;F++){var H=I(D[F],F);if(H!=null){E[E.length]=H}}return E.concat.apply([],E)}});var B=navigator.userAgent.toLowerCase();n.browser={version:(B.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(B),opera:/opera/.test(B),msie:/msie/.test(B)&&!/opera/.test(B),mozilla:/mozilla/.test(B)&&!/(compatible|webkit)/.test(B)};n.each({parent:function(D){return D.parentNode},parents:function(D){return n.dir(D,"parentNode")},next:function(D){return n.nth(D,2,"nextSibling")},prev:function(D){return n.nth(D,2,"previousSibling")},nextAll:function(D){return n.dir(D,"nextSibling")},prevAll:function(D){return n.dir(D,"previousSibling")},siblings:function(D){return n.sibling(D.parentNode.firstChild,D)},children:function(D){return n.sibling(D.firstChild)},contents:function(D){return n.nodeName(D,"iframe")?D.contentDocument||D.contentWindow.document:n.makeArray(D.childNodes)}},function(D,E){n.fn[D]=function(F){var G=n.map(this,E);if(F&&typeof F=="string"){G=n.multiFilter(F,G)}return this.pushStack(n.unique(G),D,F)}});n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(D,E){n.fn[D]=function(){var F=arguments;return this.each(function(){for(var G=0,H=F.length;G<H;G++){n(F[G])[E](this)}})}});n.each({removeAttr:function(D){n.attr(this,D,"");if(this.nodeType==1){this.removeAttribute(D)}},addClass:function(D){n.className.add(this,D)},removeClass:function(D){n.className.remove(this,D)},toggleClass:function(E,D){if(typeof D!=="boolean"){D=!n.className.has(this,E)}n.className[D?"add":"remove"](this,E)},remove:function(D){if(!D||n.filter(D,[this]).length){n("*",this).add([this]).each(function(){n.event.remove(this);n.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){n(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(D,E){n.fn[D]=function(){return this.each(E,arguments)}});function j(D,E){return D[0]&&parseInt(n.curCSS(D[0],E,true),10)||0}var h="jQuery"+e(),u=0,z={};n.extend({cache:{},data:function(E,D,F){E=E==l?z:E;var G=E[h];if(!G){G=E[h]=++u}if(D&&!n.cache[G]){n.cache[G]={}}if(F!==g){n.cache[G][D]=F}return D?n.cache[G][D]:G},removeData:function(E,D){E=E==l?z:E;var G=E[h];if(D){if(n.cache[G]){delete n.cache[G][D];D="";for(D in n.cache[G]){break}if(!D){n.removeData(E)}}}else{try{delete E[h]}catch(F){if(E.removeAttribute){E.removeAttribute(h)}}delete n.cache[G]}},queue:function(E,D,G){if(E){D=(D||"fx")+"queue";var F=n.data(E,D);if(!F||n.isArray(G)){F=n.data(E,D,n.makeArray(G))}else{if(G){F.push(G)}}}return F},dequeue:function(G,F){var D=n.queue(G,F),E=D.shift();if(!F||F==="fx"){E=D[0]}if(E!==g){E.call(G)}}});n.fn.extend({data:function(D,F){var G=D.split(".");G[1]=G[1]?"."+G[1]:"";if(F===g){var E=this.triggerHandler("getData"+G[1]+"!",[G[0]]);if(E===g&&this.length){E=n.data(this[0],D)}return E===g&&G[1]?this.data(G[0]):E}else{return this.trigger("setData"+G[1]+"!",[G[0],F]).each(function(){n.data(this,D,F)})}},removeData:function(D){return this.each(function(){n.removeData(this,D)})},queue:function(D,E){if(typeof D!=="string"){E=D;D="fx"}if(E===g){return n.queue(this[0],D)}return this.each(function(){var F=n.queue(this,D,E);if(D=="fx"&&F.length==1){F[0].call(this)}})},dequeue:function(D){return this.each(function(){n.dequeue(this,D)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.1
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){var N=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|[^[\]]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,I=0,F=Object.prototype.toString;var E=function(ae,S,aa,V){aa=aa||[];S=S||document;if(S.nodeType!==1&&S.nodeType!==9){return[]}if(!ae||typeof ae!=="string"){return aa}var ab=[],ac,Y,ah,ag,Z,R,Q=true;N.lastIndex=0;while((ac=N.exec(ae))!==null){ab.push(ac[1]);if(ac[2]){R=RegExp.rightContext;break}}if(ab.length>1&&G.match.POS.exec(ae)){if(ab.length===2&&G.relative[ab[0]]){var U="",X;while((X=G.match.POS.exec(ae))){U+=X[0];ae=ae.replace(G.match.POS,"")}Y=E.filter(U,E(/\s$/.test(ae)?ae+"*":ae,S))}else{Y=G.relative[ab[0]]?[S]:E(ab.shift(),S);while(ab.length){var P=[];ae=ab.shift();if(G.relative[ae]){ae+=ab.shift()}for(var af=0,ad=Y.length;af<ad;af++){E(ae,Y[af],P)}Y=P}}}else{var ai=V?{expr:ab.pop(),set:D(V)}:E.find(ab.pop(),ab.length===1&&S.parentNode?S.parentNode:S);Y=E.filter(ai.expr,ai.set);if(ab.length>0){ah=D(Y)}else{Q=false}while(ab.length){var T=ab.pop(),W=T;if(!G.relative[T]){T=""}else{W=ab.pop()}if(W==null){W=S}G.relative[T](ah,W,M(S))}}if(!ah){ah=Y}if(!ah){throw"Syntax error, unrecognized expression: "+(T||ae)}if(F.call(ah)==="[object Array]"){if(!Q){aa.push.apply(aa,ah)}else{if(S.nodeType===1){for(var af=0;ah[af]!=null;af++){if(ah[af]&&(ah[af]===true||ah[af].nodeType===1&&H(S,ah[af]))){aa.push(Y[af])}}}else{for(var af=0;ah[af]!=null;af++){if(ah[af]&&ah[af].nodeType===1){aa.push(Y[af])}}}}}else{D(ah,aa)}if(R){E(R,S,aa,V)}return aa};E.matches=function(P,Q){return E(P,null,null,Q)};E.find=function(V,S){var W,Q;if(!V){return[]}for(var R=0,P=G.order.length;R<P;R++){var T=G.order[R],Q;if((Q=G.match[T].exec(V))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){Q[1]=(Q[1]||"").replace(/\\/g,"");W=G.find[T](Q,S);if(W!=null){V=V.replace(G.match[T],"");break}}}}if(!W){W=S.getElementsByTagName("*")}return{set:W,expr:V}};E.filter=function(S,ac,ad,T){var Q=S,Y=[],ah=ac,V,ab;while(S&&ac.length){for(var U in G.filter){if((V=G.match[U].exec(S))!=null){var Z=G.filter[U],R=null,X=0,aa,ag;ab=false;if(ah==Y){Y=[]}if(G.preFilter[U]){V=G.preFilter[U](V,ah,ad,Y,T);if(!V){ab=aa=true}else{if(V===true){continue}else{if(V[0]===true){R=[];var W=null,af;for(var ae=0;(af=ah[ae])!==g;ae++){if(af&&W!==af){R.push(af);W=af}}}}}}if(V){for(var ae=0;(ag=ah[ae])!==g;ae++){if(ag){if(R&&ag!=R[X]){X++}aa=Z(ag,V,X,R);var P=T^!!aa;if(ad&&aa!=null){if(P){ab=true}else{ah[ae]=false}}else{if(P){Y.push(ag);ab=true}}}}}if(aa!==g){if(!ad){ah=Y}S=S.replace(G.match[U],"");if(!ab){return[]}break}}}S=S.replace(/\s*,\s*/,"");if(S==Q){if(ab==null){throw"Syntax error, unrecognized expression: "+S}else{break}}Q=S}return ah};var G=E.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(P){return P.getAttribute("href")}},relative:{"+":function(T,Q){for(var R=0,P=T.length;R<P;R++){var S=T[R];if(S){var U=S.previousSibling;while(U&&U.nodeType!==1){U=U.previousSibling}T[R]=typeof Q==="string"?U||false:U===Q}}if(typeof Q==="string"){E.filter(Q,T,true)}},">":function(U,Q,V){if(typeof Q==="string"&&!/\W/.test(Q)){Q=V?Q:Q.toUpperCase();for(var R=0,P=U.length;R<P;R++){var T=U[R];if(T){var S=T.parentNode;U[R]=S.nodeName===Q?S:false}}}else{for(var R=0,P=U.length;R<P;R++){var T=U[R];if(T){U[R]=typeof Q==="string"?T.parentNode:T.parentNode===Q}}if(typeof Q==="string"){E.filter(Q,U,true)}}},"":function(S,Q,U){var R="done"+(I++),P=O;if(!Q.match(/\W/)){var T=Q=U?Q:Q.toUpperCase();P=L}P("parentNode",Q,R,S,T,U)},"~":function(S,Q,U){var R="done"+(I++),P=O;if(typeof Q==="string"&&!Q.match(/\W/)){var T=Q=U?Q:Q.toUpperCase();P=L}P("previousSibling",Q,R,S,T,U)}},find:{ID:function(Q,R){if(R.getElementById){var P=R.getElementById(Q[1]);return P?[P]:[]}},NAME:function(P,Q){return Q.getElementsByName?Q.getElementsByName(P[1]):null},TAG:function(P,Q){return Q.getElementsByTagName(P[1])}},preFilter:{CLASS:function(S,Q,R,P,U){S=" "+S[1].replace(/\\/g,"")+" ";for(var T=0;Q[T];T++){if(U^(" "+Q[T].className+" ").indexOf(S)>=0){if(!R){P.push(Q[T])}}else{if(R){Q[T]=false}}}return false},ID:function(P){return P[1].replace(/\\/g,"")},TAG:function(Q,P){for(var R=0;!P[R];R++){}return M(P[R])?Q[1]:Q[1].toUpperCase()},CHILD:function(P){if(P[1]=="nth"){var Q=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(P[2]=="even"&&"2n"||P[2]=="odd"&&"2n+1"||!/\D/.test(P[2])&&"0n+"+P[2]||P[2]);P[2]=(Q[1]+(Q[2]||1))-0;P[3]=Q[3]-0}P[0]="done"+(I++);return P},ATTR:function(Q){var P=Q[1];if(G.attrMap[P]){Q[1]=G.attrMap[P]}if(Q[2]==="~="){Q[4]=" "+Q[4]+" "}return Q},PSEUDO:function(T,Q,R,P,U){if(T[1]==="not"){if(T[3].match(N).length>1){T[3]=E(T[3],null,null,Q)}else{var S=E.filter(T[3],Q,R,true^U);if(!R){P.push.apply(P,S)}return false}}else{if(G.match.POS.test(T[0])){return true}}return T},POS:function(P){P.unshift(true);return P}},filters:{enabled:function(P){return P.disabled===false&&P.type!=="hidden"},disabled:function(P){return P.disabled===true},checked:function(P){return P.checked===true},selected:function(P){P.parentNode.selectedIndex;return P.selected===true},parent:function(P){return !!P.firstChild},empty:function(P){return !P.firstChild},has:function(R,Q,P){return !!E(P[3],R).length},header:function(P){return/h\d/i.test(P.nodeName)},text:function(P){return"text"===P.type},radio:function(P){return"radio"===P.type},checkbox:function(P){return"checkbox"===P.type},file:function(P){return"file"===P.type},password:function(P){return"password"===P.type},submit:function(P){return"submit"===P.type},image:function(P){return"image"===P.type},reset:function(P){return"reset"===P.type},button:function(P){return"button"===P.type||P.nodeName.toUpperCase()==="BUTTON"},input:function(P){return/input|select|textarea|button/i.test(P.nodeName)}},setFilters:{first:function(Q,P){return P===0},last:function(R,Q,P,S){return Q===S.length-1},even:function(Q,P){return P%2===0},odd:function(Q,P){return P%2===1},lt:function(R,Q,P){return Q<P[3]-0},gt:function(R,Q,P){return Q>P[3]-0},nth:function(R,Q,P){return P[3]-0==Q},eq:function(R,Q,P){return P[3]-0==Q}},filter:{CHILD:function(P,S){var V=S[1],W=P.parentNode;var U="child"+W.childNodes.length;if(W&&(!W[U]||!P.nodeIndex)){var T=1;for(var Q=W.firstChild;Q;Q=Q.nextSibling){if(Q.nodeType==1){Q.nodeIndex=T++}}W[U]=T-1}if(V=="first"){return P.nodeIndex==1}else{if(V=="last"){return P.nodeIndex==W[U]}else{if(V=="only"){return W[U]==1}else{if(V=="nth"){var Y=false,R=S[2],X=S[3];if(R==1&&X==0){return true}if(R==0){if(P.nodeIndex==X){Y=true}}else{if((P.nodeIndex-X)%R==0&&(P.nodeIndex-X)/R>=0){Y=true}}return Y}}}}},PSEUDO:function(V,R,S,W){var Q=R[1],T=G.filters[Q];if(T){return T(V,S,R,W)}else{if(Q==="contains"){return(V.textContent||V.innerText||"").indexOf(R[3])>=0}else{if(Q==="not"){var U=R[3];for(var S=0,P=U.length;S<P;S++){if(U[S]===V){return false}}return true}}}},ID:function(Q,P){return Q.nodeType===1&&Q.getAttribute("id")===P},TAG:function(Q,P){return(P==="*"&&Q.nodeType===1)||Q.nodeName===P},CLASS:function(Q,P){return P.test(Q.className)},ATTR:function(T,R){var P=G.attrHandle[R[1]]?G.attrHandle[R[1]](T):T[R[1]]||T.getAttribute(R[1]),U=P+"",S=R[2],Q=R[4];return P==null?false:S==="="?U===Q:S==="*="?U.indexOf(Q)>=0:S==="~="?(" "+U+" ").indexOf(Q)>=0:!R[4]?P:S==="!="?U!=Q:S==="^="?U.indexOf(Q)===0:S==="$="?U.substr(U.length-Q.length)===Q:S==="|="?U===Q||U.substr(0,Q.length+1)===Q+"-":false},POS:function(T,Q,R,U){var P=Q[2],S=G.setFilters[P];if(S){return S(T,R,Q,U)}}}};for(var K in G.match){G.match[K]=RegExp(G.match[K].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var D=function(Q,P){Q=Array.prototype.slice.call(Q);if(P){P.push.apply(P,Q);return P}return Q};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(J){D=function(T,S){var Q=S||[];if(F.call(T)==="[object Array]"){Array.prototype.push.apply(Q,T)}else{if(typeof T.length==="number"){for(var R=0,P=T.length;R<P;R++){Q.push(T[R])}}else{for(var R=0;T[R];R++){Q.push(T[R])}}}return Q}}(function(){var Q=document.createElement("form"),R="script"+(new Date).getTime();Q.innerHTML="<input name='"+R+"'/>";var P=document.documentElement;P.insertBefore(Q,P.firstChild);if(!!document.getElementById(R)){G.find.ID=function(T,U){if(U.getElementById){var S=U.getElementById(T[1]);return S?S.id===T[1]||S.getAttributeNode&&S.getAttributeNode("id").nodeValue===T[1]?[S]:g:[]}};G.filter.ID=function(U,S){var T=U.getAttributeNode&&U.getAttributeNode("id");return U.nodeType===1&&T&&T.nodeValue===S}}P.removeChild(Q)})();(function(){var P=document.createElement("div");P.appendChild(document.createComment(""));if(P.getElementsByTagName("*").length>0){G.find.TAG=function(Q,U){var T=U.getElementsByTagName(Q[1]);if(Q[1]==="*"){var S=[];for(var R=0;T[R];R++){if(T[R].nodeType===1){S.push(T[R])}}T=S}return T}}P.innerHTML="<a href='#'></a>";if(P.firstChild.getAttribute("href")!=="#"){G.attrHandle.href=function(Q){return Q.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var P=E;E=function(T,S,Q,R){S=S||document;if(!R&&S.nodeType===9){try{return D(S.querySelectorAll(T),Q)}catch(U){}}return P(T,S,Q,R)};E.find=P.find;E.filter=P.filter;E.selectors=P.selectors;E.matches=P.matches})()}if(document.documentElement.getElementsByClassName){G.order.splice(1,0,"CLASS");G.find.CLASS=function(P,Q){return Q.getElementsByClassName(P[1])}}function L(Q,W,V,Z,X,Y){for(var T=0,R=Z.length;T<R;T++){var P=Z[T];if(P){P=P[Q];var U=false;while(P&&P.nodeType){var S=P[V];if(S){U=Z[S];break}if(P.nodeType===1&&!Y){P[V]=T}if(P.nodeName===W){U=P;break}P=P[Q]}Z[T]=U}}}function O(Q,V,U,Y,W,X){for(var S=0,R=Y.length;S<R;S++){var P=Y[S];if(P){P=P[Q];var T=false;while(P&&P.nodeType){if(P[U]){T=Y[P[U]];break}if(P.nodeType===1){if(!X){P[U]=S}if(typeof V!=="string"){if(P===V){T=true;break}}else{if(E.filter(V,[P]).length>0){T=P;break}}}P=P[Q]}Y[S]=T}}}var H=document.compareDocumentPosition?function(Q,P){return Q.compareDocumentPosition(P)&16}:function(Q,P){return Q!==P&&(Q.contains?Q.contains(P):true)};var M=function(P){return P.documentElement&&!P.body||P.tagName&&P.ownerDocument&&!P.ownerDocument.body};n.find=E;n.filter=E.filter;n.expr=E.selectors;n.expr[":"]=n.expr.filters;E.selectors.filters.hidden=function(P){return"hidden"===P.type||n.css(P,"display")==="none"||n.css(P,"visibility")==="hidden"};E.selectors.filters.visible=function(P){return"hidden"!==P.type&&n.css(P,"display")!=="none"&&n.css(P,"visibility")!=="hidden"};E.selectors.filters.animated=function(P){return n.grep(n.timers,function(Q){return P===Q.elem}).length};n.multiFilter=function(R,P,Q){if(Q){R=":not("+R+")"}return E.matches(R,P)};n.dir=function(R,Q){var P=[],S=R[Q];while(S&&S!=document){if(S.nodeType==1){P.push(S)}S=S[Q]}return P};n.nth=function(T,P,R,S){P=P||1;var Q=0;for(;T;T=T[R]){if(T.nodeType==1&&++Q==P){break}}return T};n.sibling=function(R,Q){var P=[];for(;R;R=R.nextSibling){if(R.nodeType==1&&R!=Q){P.push(R)}}return P};return;l.Sizzle=E})();n.event={add:function(H,E,G,J){if(H.nodeType==3||H.nodeType==8){return}if(H.setInterval&&H!=l){H=l}if(!G.guid){G.guid=this.guid++}if(J!==g){var F=G;G=this.proxy(F);G.data=J}var D=n.data(H,"events")||n.data(H,"events",{}),I=n.data(H,"handle")||n.data(H,"handle",function(){return typeof n!=="undefined"&&!n.event.triggered?n.event.handle.apply(arguments.callee.elem,arguments):g});I.elem=H;n.each(E.split(/\s+/),function(L,M){var N=M.split(".");M=N.shift();G.type=N.slice().sort().join(".");var K=D[M];if(n.event.specialAll[M]){n.event.specialAll[M].setup.call(H,J,N)}if(!K){K=D[M]={};if(!n.event.special[M]||n.event.special[M].setup.call(H,J,N)===false){if(H.addEventListener){H.addEventListener(M,I,false)}else{if(H.attachEvent){H.attachEvent("on"+M,I)}}}}K[G.guid]=G;n.event.global[M]=true});H=null},guid:1,global:{},remove:function(J,G,I){if(J.nodeType==3||J.nodeType==8){return}var F=n.data(J,"events"),E,D;if(F){if(G===g||(typeof G==="string"&&G.charAt(0)==".")){for(var H in F){this.remove(J,H+(G||""))}}else{if(G.type){I=G.handler;G=G.type}n.each(G.split(/\s+/),function(L,N){var P=N.split(".");N=P.shift();var M=RegExp("(^|\\.)"+P.slice().sort().join(".*\\.")+"(\\.|$)");if(F[N]){if(I){delete F[N][I.guid]}else{for(var O in F[N]){if(M.test(F[N][O].type)){delete F[N][O]}}}if(n.event.specialAll[N]){n.event.specialAll[N].teardown.call(J,P)}for(E in F[N]){break}if(!E){if(!n.event.special[N]||n.event.special[N].teardown.call(J,P)===false){if(J.removeEventListener){J.removeEventListener(N,n.data(J,"handle"),false)}else{if(J.detachEvent){J.detachEvent("on"+N,n.data(J,"handle"))}}}E=null;delete F[N]}}})}for(E in F){break}if(!E){var K=n.data(J,"handle");if(K){K.elem=null}n.removeData(J,"events");n.removeData(J,"handle")}}},trigger:function(H,J,G,D){var F=H.type||H;if(!D){H=typeof H==="object"?H[h]?H:n.extend(n.Event(F),H):n.Event(F);if(F.indexOf("!")>=0){H.type=F=F.slice(0,-1);H.exclusive=true}if(!G){H.stopPropagation();if(this.global[F]){n.each(n.cache,function(){if(this.events&&this.events[F]){n.event.trigger(H,J,this.handle.elem)}})}}if(!G||G.nodeType==3||G.nodeType==8){return g}H.result=g;H.target=G;J=n.makeArray(J);J.unshift(H)}H.currentTarget=G;var I=n.data(G,"handle");if(I){I.apply(G,J)}if((!G[F]||(n.nodeName(G,"a")&&F=="click"))&&G["on"+F]&&G["on"+F].apply(G,J)===false){H.result=false}if(!D&&G[F]&&!H.isDefaultPrevented()&&!(n.nodeName(G,"a")&&F=="click")){this.triggered=true;try{G[F]()}catch(K){}}this.triggered=false;if(!H.isPropagationStopped()){var E=G.parentNode||G.ownerDocument;if(E){n.event.trigger(H,J,E,true)}}},handle:function(J){var I,D;J=arguments[0]=n.event.fix(J||l.event);var K=J.type.split(".");J.type=K.shift();I=!K.length&&!J.exclusive;var H=RegExp("(^|\\.)"+K.slice().sort().join(".*\\.")+"(\\.|$)");D=(n.data(this,"events")||{})[J.type];for(var F in D){var G=D[F];if(I||H.test(G.type)){J.handler=G;J.data=G.data;var E=G.apply(this,arguments);if(E!==g){J.result=E;if(E===false){J.preventDefault();J.stopPropagation()}}if(J.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(G){if(G[h]){return G}var E=G;G=n.Event(E);for(var F=this.props.length,I;F;){I=this.props[--F];G[I]=E[I]}if(!G.target){G.target=G.srcElement||document}if(G.target.nodeType==3){G.target=G.target.parentNode}if(!G.relatedTarget&&G.fromElement){G.relatedTarget=G.fromElement==G.target?G.toElement:G.fromElement}if(G.pageX==null&&G.clientX!=null){var H=document.documentElement,D=document.body;G.pageX=G.clientX+(H&&H.scrollLeft||D&&D.scrollLeft||0)-(H.clientLeft||0);G.pageY=G.clientY+(H&&H.scrollTop||D&&D.scrollTop||0)-(H.clientTop||0)}if(!G.which&&((G.charCode||G.charCode===0)?G.charCode:G.keyCode)){G.which=G.charCode||G.keyCode}if(!G.metaKey&&G.ctrlKey){G.metaKey=G.ctrlKey}if(!G.which&&G.button){G.which=(G.button&1?1:(G.button&2?3:(G.button&4?2:0)))}return G},proxy:function(E,D){D=D||function(){return E.apply(this,arguments)};D.guid=E.guid=E.guid||D.guid||this.guid++;return D},special:{ready:{setup:A,teardown:function(){}}},specialAll:{live:{setup:function(D,E){n.event.add(this,E[0],c)},teardown:function(F){if(F.length){var D=0,E=RegExp("(^|\\.)"+F[0]+"(\\.|$)");n.each((n.data(this,"events").live||{}),function(){if(E.test(this.type)){D++}});if(D<1){n.event.remove(this,F[0],c)}}}}}};n.Event=function(D){if(!this.preventDefault){return new n.Event(D)}if(D&&D.type){this.originalEvent=D;this.type=D.type;this.timeStamp=D.timeStamp}else{this.type=D}if(!this.timeStamp){this.timeStamp=e()}this[h]=true};function k(){return false}function t(){return true}n.Event.prototype={preventDefault:function(){this.isDefaultPrevented=t;var D=this.originalEvent;if(!D){return}if(D.preventDefault){D.preventDefault()}D.returnValue=false},stopPropagation:function(){this.isPropagationStopped=t;var D=this.originalEvent;if(!D){return}if(D.stopPropagation){D.stopPropagation()}D.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=t;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(E){var D=E.relatedTarget;while(D&&D!=this){try{D=D.parentNode}catch(F){D=this}}if(D!=this){E.type=E.data;n.event.handle.apply(this,arguments)}};n.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(E,D){n.event.special[D]={setup:function(){n.event.add(this,E,a,D)},teardown:function(){n.event.remove(this,E,a)}}});n.fn.extend({bind:function(E,F,D){return E=="unload"?this.one(E,F,D):this.each(function(){n.event.add(this,E,D||F,D&&F)})},one:function(F,G,E){var D=n.event.proxy(E||G,function(H){n(this).unbind(H,D);return(E||G).apply(this,arguments)});return this.each(function(){n.event.add(this,F,D,E&&G)})},unbind:function(E,D){return this.each(function(){n.event.remove(this,E,D)})},trigger:function(D,E){return this.each(function(){n.event.trigger(D,E,this)})},triggerHandler:function(D,F){if(this[0]){var E=n.Event(D);E.preventDefault();E.stopPropagation();n.event.trigger(E,F,this[0]);return E.result}},toggle:function(F){var D=arguments,E=1;while(E<D.length){n.event.proxy(F,D[E++])}return this.click(n.event.proxy(F,function(G){this.lastToggle=(this.lastToggle||0)%E;G.preventDefault();return D[this.lastToggle++].apply(this,arguments)||false}))},hover:function(D,E){return this.mouseenter(D).mouseleave(E)},ready:function(D){A();if(n.isReady){D.call(document,n)}else{n.readyList.push(D)}return this},live:function(F,E){var D=n.event.proxy(E);D.guid+=this.selector+F;n(document).bind(i(F,this.selector),this.selector,D);return this},die:function(E,D){n(document).unbind(i(E,this.selector),D?{guid:D.guid+this.selector+E}:null);return this}});function c(G){var D=RegExp("(^|\\.)"+G.type+"(\\.|$)"),F=true,E=[];n.each(n.data(this,"events").live||[],function(H,I){if(D.test(I.type)){var J=n(G.target).closest(I.data)[0];if(J){E.push({elem:J,fn:I})}}});n.each(E,function(){if(!G.isImmediatePropagationStopped()&&this.fn.call(this.elem,G,this.fn.data)===false){F=false}});return F}function i(E,D){return["live",E,D.replace(/\./g,"`").replace(/ /g,"|")].join(".")}n.extend({isReady:false,readyList:[],ready:function(){if(!n.isReady){n.isReady=true;if(n.readyList){n.each(n.readyList,function(){this.call(document,n)});n.readyList=null}n(document).triggerHandler("ready")}}});var w=false;function A(){if(w){return}w=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);n.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);n.ready()}});if(document.documentElement.doScroll&&!l.frameElement){(function(){if(n.isReady){return}try{document.documentElement.doScroll("left")}catch(D){setTimeout(arguments.callee,0);return}n.ready()})()}}}n.event.add(l,"load",n.ready)}n.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(E,D){n.fn[D]=function(F){return F?this.bind(D,F):this.trigger(D)}});n(l).bind("unload",function(){for(var D in n.cache){if(D!=1&&n.cache[D].handle){n.event.remove(n.cache[D].handle.elem)}}});(function(){n.support={};var E=document.documentElement,F=document.createElement("script"),J=document.createElement("div"),I="script"+(new Date).getTime();J.style.display="none";J.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var G=J.getElementsByTagName("*"),D=J.getElementsByTagName("a")[0];if(!G||!G.length||!D){return}n.support={leadingWhitespace:J.firstChild.nodeType==3,tbody:!J.getElementsByTagName("tbody").length,objectAll:!!J.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!J.getElementsByTagName("link").length,style:/red/.test(D.getAttribute("style")),hrefNormalized:D.getAttribute("href")==="/a",opacity:D.style.opacity==="0.5",cssFloat:!!D.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};F.type="text/javascript";try{F.appendChild(document.createTextNode("window."+I+"=1;"))}catch(H){}E.insertBefore(F,E.firstChild);if(l[I]){n.support.scriptEval=true;delete l[I]}E.removeChild(F);if(J.attachEvent&&J.fireEvent){J.attachEvent("onclick",function(){n.support.noCloneEvent=false;J.detachEvent("onclick",arguments.callee)});J.cloneNode(true).fireEvent("onclick")}n(function(){var K=document.createElement("div");K.style.width="1px";K.style.paddingLeft="1px";document.body.appendChild(K);n.boxModel=n.support.boxModel=K.offsetWidth===2;document.body.removeChild(K)})})();var v=n.support.cssFloat?"cssFloat":"styleFloat";n.props={"for":"htmlFor","class":"className","float":v,cssFloat:v,styleFloat:v,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};n.fn.extend({_load:n.fn.load,load:function(F,I,J){if(typeof F!=="string"){return this._load(F)}var H=F.indexOf(" ");if(H>=0){var D=F.slice(H,F.length);F=F.slice(0,H)}var G="GET";if(I){if(n.isFunction(I)){J=I;I=null}else{if(typeof I==="object"){I=n.param(I);G="POST"}}}var E=this;n.ajax({url:F,type:G,dataType:"html",data:I,complete:function(L,K){if(K=="success"||K=="notmodified"){E.html(D?n("<div/>").append(L.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(D):L.responseText)}if(J){E.each(J,[L.responseText,K,L])}}});return this},serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?n.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(D,E){var F=n(this).val();return F==null?null:n.isArray(F)?n.map(F,function(H,G){return{name:E.name,value:H}}):{name:E.name,value:F}}).get()}});n.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(D,E){n.fn[E]=function(F){return this.bind(E,F)}});var q=e();n.extend({get:function(D,F,G,E){if(n.isFunction(F)){G=F;F=null}return n.ajax({type:"GET",url:D,data:F,success:G,dataType:E})},getScript:function(D,E){return n.get(D,null,E,"script")},getJSON:function(D,E,F){return n.get(D,E,F,"json")},post:function(D,F,G,E){if(n.isFunction(F)){G=F;F={}}return n.ajax({type:"POST",url:D,data:F,success:G,dataType:E})},ajaxSetup:function(D){n.extend(n.ajaxSettings,D)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(L){L=n.extend(true,L,n.extend(true,{},n.ajaxSettings,L));var V,E=/=\?(&|$)/g,Q,U,F=L.type.toUpperCase();if(L.data&&L.processData&&typeof L.data!=="string"){L.data=n.param(L.data)}if(L.dataType=="jsonp"){if(F=="GET"){if(!L.url.match(E)){L.url+=(L.url.match(/\?/)?"&":"?")+(L.jsonp||"callback")+"=?"}}else{if(!L.data||!L.data.match(E)){L.data=(L.data?L.data+"&":"")+(L.jsonp||"callback")+"=?"}}L.dataType="json"}if(L.dataType=="json"&&(L.data&&L.data.match(E)||L.url.match(E))){V="jsonp"+q++;if(L.data){L.data=(L.data+"").replace(E,"="+V+"$1")}L.url=L.url.replace(E,"="+V+"$1");L.dataType="script";l[V]=function(W){U=W;H();K();l[V]=g;try{delete l[V]}catch(X){}if(G){G.removeChild(S)}}}if(L.dataType=="script"&&L.cache==null){L.cache=false}if(L.cache===false&&F=="GET"){var D=e();var T=L.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+D+"$2");L.url=T+((T==L.url)?(L.url.match(/\?/)?"&":"?")+"_="+D:"")}if(L.data&&F=="GET"){L.url+=(L.url.match(/\?/)?"&":"?")+L.data;L.data=null}if(L.global&&!n.active++){n.event.trigger("ajaxStart")}var P=/^(\w+:)?\/\/([^\/?#]+)/.exec(L.url);if(L.dataType=="script"&&F=="GET"&&P&&(P[1]&&P[1]!=location.protocol||P[2]!=location.host)){var G=document.getElementsByTagName("head")[0];var S=document.createElement("script");S.src=L.url;if(L.scriptCharset){S.charset=L.scriptCharset}if(!V){var N=false;S.onload=S.onreadystatechange=function(){if(!N&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){N=true;H();K();G.removeChild(S)}}}G.appendChild(S);return g}var J=false;var I=L.xhr();if(L.username){I.open(F,L.url,L.async,L.username,L.password)}else{I.open(F,L.url,L.async)}try{if(L.data){I.setRequestHeader("Content-Type",L.contentType)}if(L.ifModified){I.setRequestHeader("If-Modified-Since",n.lastModified[L.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}I.setRequestHeader("X-Requested-With","XMLHttpRequest");I.setRequestHeader("Accept",L.dataType&&L.accepts[L.dataType]?L.accepts[L.dataType]+", */*":L.accepts._default)}catch(R){}if(L.beforeSend&&L.beforeSend(I,L)===false){if(L.global&&!--n.active){n.event.trigger("ajaxStop")}I.abort();return false}if(L.global){n.event.trigger("ajaxSend",[I,L])}var M=function(W){if(I.readyState==0){if(O){clearInterval(O);O=null;if(L.global&&!--n.active){n.event.trigger("ajaxStop")}}}else{if(!J&&I&&(I.readyState==4||W=="timeout")){J=true;if(O){clearInterval(O);O=null}Q=W=="timeout"?"timeout":!n.httpSuccess(I)?"error":L.ifModified&&n.httpNotModified(I,L.url)?"notmodified":"success";if(Q=="success"){try{U=n.httpData(I,L.dataType,L)}catch(Y){Q="parsererror"}}if(Q=="success"){var X;try{X=I.getResponseHeader("Last-Modified")}catch(Y){}if(L.ifModified&&X){n.lastModified[L.url]=X}if(!V){H()}}else{n.handleError(L,I,Q)}K();if(L.async){I=null}}}};if(L.async){var O=setInterval(M,13);if(L.timeout>0){setTimeout(function(){if(I){if(!J){M("timeout")}if(I){I.abort()}}},L.timeout)}}try{I.send(L.data)}catch(R){n.handleError(L,I,null,R)}if(!L.async){M()}function H(){if(L.success){L.success(U,Q)}if(L.global){n.event.trigger("ajaxSuccess",[I,L])}}function K(){if(L.complete){L.complete(I,Q)}if(L.global){n.event.trigger("ajaxComplete",[I,L])}if(L.global&&!--n.active){n.event.trigger("ajaxStop")}}return I},handleError:function(E,G,D,F){if(E.error){E.error(G,D,F)}if(E.global){n.event.trigger("ajaxError",[G,E,F])}},active:0,httpSuccess:function(E){try{return !E.status&&location.protocol=="file:"||(E.status>=200&&E.status<300)||E.status==304||E.status==1223}catch(D){}return false},httpNotModified:function(F,D){try{var G=F.getResponseHeader("Last-Modified");return F.status==304||G==n.lastModified[D]}catch(E){}return false},httpData:function(I,G,F){var E=I.getResponseHeader("content-type"),D=G=="xml"||!G&&E&&E.indexOf("xml")>=0,H=D?I.responseXML:I.responseText;if(D&&H.documentElement.tagName=="parsererror"){throw"parsererror"}if(F&&F.dataFilter){H=F.dataFilter(H,G)}if(typeof H==="string"){if(G=="script"){n.globalEval(H)}if(G=="json"){H=l["eval"]("("+H+")")}}return H},param:function(D){var F=[];function G(H,I){F[F.length]=encodeURIComponent(H)+"="+encodeURIComponent(I)}if(n.isArray(D)||D.jquery){n.each(D,function(){G(this.name,this.value)})}else{for(var E in D){if(n.isArray(D[E])){n.each(D[E],function(){G(E,this)})}else{G(E,n.isFunction(D[E])?D[E]():D[E])}}}return F.join("&").replace(/%20/g,"+")}});var m={},d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function s(E,D){var F={};n.each(d.concat.apply([],d.slice(0,D)),function(){F[this]=E});return F}n.fn.extend({show:function(I,K){if(I){return this.animate(s("show",3),I,K)}else{for(var G=0,E=this.length;G<E;G++){var D=n.data(this[G],"olddisplay");this[G].style.display=D||"";if(n.css(this[G],"display")==="none"){var F=this[G].tagName,J;if(m[F]){J=m[F]}else{var H=n("<"+F+" />").appendTo("body");J=H.css("display");if(J==="none"){J="block"}H.remove();m[F]=J}this[G].style.display=n.data(this[G],"olddisplay",J)}}return this}},hide:function(G,H){if(G){return this.animate(s("hide",3),G,H)}else{for(var F=0,E=this.length;F<E;F++){var D=n.data(this[F],"olddisplay");if(!D&&D!=="none"){n.data(this[F],"olddisplay",n.css(this[F],"display"))}this[F].style.display="none"}return this}},_toggle:n.fn.toggle,toggle:function(F,E){var D=typeof F==="boolean";return n.isFunction(F)&&n.isFunction(E)?this._toggle.apply(this,arguments):F==null||D?this.each(function(){var G=D?F:n(this).is(":hidden");n(this)[G?"show":"hide"]()}):this.animate(s("toggle",3),F,E)},fadeTo:function(D,F,E){return this.animate({opacity:F},D,E)},animate:function(H,E,G,F){var D=n.speed(E,G,F);return this[D.queue===false?"each":"queue"](function(){var J=n.extend({},D),L,K=this.nodeType==1&&n(this).is(":hidden"),I=this;for(L in H){if(H[L]=="hide"&&K||H[L]=="show"&&!K){return J.complete.call(this)}if((L=="height"||L=="width")&&this.style){J.display=n.css(this,"display");J.overflow=this.style.overflow}}if(J.overflow!=null){this.style.overflow="hidden"}J.curAnim=n.extend({},H);n.each(H,function(N,R){var Q=new n.fx(I,J,N);if(/toggle|show|hide/.test(R)){Q[R=="toggle"?K?"show":"hide":R](H)}else{var P=R.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),S=Q.cur(true)||0;if(P){var M=parseFloat(P[2]),O=P[3]||"px";if(O!="px"){I.style[N]=(M||1)+O;S=((M||1)/Q.cur(true))*S;I.style[N]=S+O}if(P[1]){M=((P[1]=="-="?-1:1)*M)+S}Q.custom(S,M,O)}else{Q.custom(S,R,"")}}});return true})},stop:function(E,D){var F=n.timers;if(E){this.queue([])}this.each(function(){for(var G=F.length-1;G>=0;G--){if(F[G].elem==this){if(D){F[G](true)}F.splice(G,1)}}});if(!D){this.dequeue()}return this}});n.each({slideDown:s("show",1),slideUp:s("hide",1),slideToggle:s("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(D,E){n.fn[D]=function(F,G){return this.animate(E,F,G)}});n.extend({speed:function(F,G,E){var D=typeof F==="object"?F:{complete:E||!E&&G||n.isFunction(F)&&F,duration:F,easing:E&&G||G&&!n.isFunction(G)&&G};D.duration=n.fx.off?0:typeof D.duration==="number"?D.duration:n.fx.speeds[D.duration]||n.fx.speeds._default;D.old=D.complete;D.complete=function(){if(D.queue!==false){n(this).dequeue()}if(n.isFunction(D.old)){D.old.call(this)}};return D},easing:{linear:function(F,G,D,E){return D+E*F},swing:function(F,G,D,E){return((-Math.cos(F*Math.PI)/2)+0.5)*E+D}},timers:[],timerId:null,fx:function(E,D,F){this.options=D;this.elem=E;this.prop=F;if(!D.orig){D.orig={}}}});n.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(n.fx.step[this.prop]||n.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(E){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var D=parseFloat(n.css(this.elem,this.prop,E));return D&&D>-10000?D:parseFloat(n.curCSS(this.elem,this.prop))||0},custom:function(H,G,F){this.startTime=e();this.start=H;this.end=G;this.unit=F||this.unit||"px";this.now=this.start;this.pos=this.state=0;var D=this;function E(I){return D.step(I)}E.elem=this.elem;n.timers.push(E);if(E()&&n.timerId==null){n.timerId=setInterval(function(){var J=n.timers;for(var I=0;I<J.length;I++){if(!J[I]()){J.splice(I--,1)}}if(!J.length){clearInterval(n.timerId);n.timerId=null}},13)}},show:function(){this.options.orig[this.prop]=n.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());n(this.elem).show()},hide:function(){this.options.orig[this.prop]=n.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(G){var F=e();if(G||F>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var D=true;for(var E in this.options.curAnim){if(this.options.curAnim[E]!==true){D=false}}if(D){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(n.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){n(this.elem).hide()}if(this.options.hide||this.options.show){for(var H in this.options.curAnim){n.attr(this.elem.style,H,this.options.orig[H])}}}if(D){this.options.complete.call(this.elem)}return false}else{var I=F-this.startTime;this.state=I/this.options.duration;this.pos=n.easing[this.options.easing||(n.easing.swing?"swing":"linear")](this.state,I,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};n.extend(n.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(D){n.attr(D.elem.style,"opacity",D.now)},_default:function(D){if(D.elem.style&&D.elem.style[D.prop]!=null){D.elem.style[D.prop]=D.now+D.unit}else{D.elem[D.prop]=D.now}}}});if(document.documentElement.getBoundingClientRect){n.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return n.offset.bodyOffset(this[0])}var F=this[0].getBoundingClientRect(),I=this[0].ownerDocument,E=I.body,D=I.documentElement,K=D.clientTop||E.clientTop||0,J=D.clientLeft||E.clientLeft||0,H=F.top+(self.pageYOffset||n.boxModel&&D.scrollTop||E.scrollTop)-K,G=F.left+(self.pageXOffset||n.boxModel&&D.scrollLeft||E.scrollLeft)-J;return{top:H,left:G}}}else{n.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return n.offset.bodyOffset(this[0])}n.offset.initialized||n.offset.initialize();var I=this[0],F=I.offsetParent,E=I,N=I.ownerDocument,L,G=N.documentElement,J=N.body,K=N.defaultView,D=K.getComputedStyle(I,null),M=I.offsetTop,H=I.offsetLeft;while((I=I.parentNode)&&I!==J&&I!==G){L=K.getComputedStyle(I,null);M-=I.scrollTop,H-=I.scrollLeft;if(I===F){M+=I.offsetTop,H+=I.offsetLeft;if(n.offset.doesNotAddBorder&&!(n.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(I.tagName))){M+=parseInt(L.borderTopWidth,10)||0,H+=parseInt(L.borderLeftWidth,10)||0}E=F,F=I.offsetParent}if(n.offset.subtractsBorderForOverflowNotVisible&&L.overflow!=="visible"){M+=parseInt(L.borderTopWidth,10)||0,H+=parseInt(L.borderLeftWidth,10)||0}D=L}if(D.position==="relative"||D.position==="static"){M+=J.offsetTop,H+=J.offsetLeft}if(D.position==="fixed"){M+=Math.max(G.scrollTop,J.scrollTop),H+=Math.max(G.scrollLeft,J.scrollLeft)}return{top:M,left:H}}}n.offset={initialize:function(){if(this.initialized){return}var K=document.body,E=document.createElement("div"),G,F,M,H,L,D,I=K.style.marginTop,J='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"cellpadding="0"cellspacing="0"><tr><td></td></tr></table>';L={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(D in L){E.style[D]=L[D]}E.innerHTML=J;K.insertBefore(E,K.firstChild);G=E.firstChild,F=G.firstChild,H=G.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(F.offsetTop!==5);this.doesAddBorderForTableAndCells=(H.offsetTop===5);G.style.overflow="hidden",G.style.position="relative";this.subtractsBorderForOverflowNotVisible=(F.offsetTop===-5);K.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(K.offsetTop===0);K.style.marginTop=I;K.removeChild(E);this.initialized=true},bodyOffset:function(D){n.offset.initialized||n.offset.initialize();var F=D.offsetTop,E=D.offsetLeft;if(n.offset.doesNotIncludeMarginInBodyOffset){F+=parseInt(n.curCSS(D,"marginTop",true),10)||0,E+=parseInt(n.curCSS(D,"marginLeft",true),10)||0}return{top:F,left:E}}};n.fn.extend({position:function(){var H=0,G=0,E;if(this[0]){var F=this.offsetParent(),I=this.offset(),D=/^body|html$/i.test(F[0].tagName)?{top:0,left:0}:F.offset();I.top-=j(this,"marginTop");I.left-=j(this,"marginLeft");D.top+=j(F,"borderTopWidth");D.left+=j(F,"borderLeftWidth");E={top:I.top-D.top,left:I.left-D.left}}return E},offsetParent:function(){var D=this[0].offsetParent||document.body;while(D&&(!/^body|html$/i.test(D.tagName)&&n.css(D,"position")=="static")){D=D.offsetParent}return n(D)}});n.each(["Left","Top"],function(E,D){var F="scroll"+D;n.fn[F]=function(G){if(!this[0]){return null}return G!==g?this.each(function(){this==l||this==document?l.scrollTo(!E?G:n(l).scrollLeft(),E?G:n(l).scrollTop()):this[F]=G}):this[0]==l||this[0]==document?self[E?"pageYOffset":"pageXOffset"]||n.boxModel&&document.documentElement[F]||document.body[F]:this[0][F]}});n.each(["Height","Width"],function(G,E){var D=G?"Left":"Top",F=G?"Right":"Bottom";n.fn["inner"+E]=function(){return this[E.toLowerCase()]()+j(this,"padding"+D)+j(this,"padding"+F)};n.fn["outer"+E]=function(I){return this["inner"+E]()+j(this,"border"+D+"Width")+j(this,"border"+F+"Width")+(I?j(this,"margin"+D)+j(this,"margin"+F):0)};var H=E.toLowerCase();n.fn[H]=function(I){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+E]||document.body["client"+E]:this[0]==document?Math.max(document.documentElement["client"+E],document.body["scroll"+E],document.documentElement["scroll"+E],document.body["offset"+E],document.documentElement["offset"+E]):I===g?(this.length?n.css(this[0],H):null):this.css(H,typeof I==="string"?I:I+"px")}})})();
+</script>
+
+
+<script id="jsgb" type="x">
+/*
+ * jsgb.toolbox.js - This is part of JSGB, a JavaScript GameBoy Emulator
+ * Copyright (C) 2009 Pedro Ladaria <Sonic1980 at Gmail dot com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ * The full license is available at http://www.gnu.org/licenses/gpl.html
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+var br='<br/'+'>\n';
+
+// Convert an 8 bit number into a JavaScript signed integer
+// Z80's negative numbers are in two's complement
+function sb(n){return (n>127)?((n&127)-128):n;}
+
+// Left zero fill until length of s = l
+function zf(s,l) {while (s.length<l)s='0'+s;return s;}
+
+// Convert decimal to hexadecimal
+function hex(n){return (n*1).toString(16).toUpperCase();}
+function hex2(n) {return zf(hex(n),2);};
+function hex4(n) {return zf(hex(n),4);};
+
+// Convert decimal to binary
+function bin(n){return (n*1).toString(2);}
+
+// Insert a space every "l" chars.
+// for example: sp('12345678',4) returns '1234 5678'
+function sp(s,l){
+ var r=[],i=0;
+ while (s.length>l) {
+ r[i++]=s.substr(0,l);
+ s=s.substr(l);
+ }
+ if (s.length>0) r[i]=s;
+ return r.join('&nbsp;');
+}
+
+// Get element from id
+function $(id){return document.getElementById(id);}
+
+// Get milliseconds from the UNIX epoch
+function get_ms(){return new Date().getTime();}
+
+// Random number between a and b
+function rand2(a,b) { return a+Math.round(Math.random()*(b-a)); }
+
+// Get object properties
+function printObj(o) {
+ var s = "" ;
+ for (var p in o) s+=p+" = "+o[p]+"\n" ;
+ return s ;
+}
+
+
+
+
+
+
+/*
+ * scrollbar.js v0.1 - A simple scrollbar for JavaScript
+ * Copyright (C) 2009 Pedro Ladaria <Sonic1980 at Gmail dot com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ * The full license is available at http://www.gnu.org/licenses/gpl.html
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * ____________________________________________________________________________
+ *
+ * Note: this doesn't works in MSIE.
+ *
+ * CSS Styles used by scrollBar Object:
+ * .SCROLLBAR
+ * .SCROLLBAR > .BACKGROUND
+ * .SCROLLBAR > .BACKGROUND > .DRAG
+ */
+
+function dragMachine(dragid,onchange) {
+ var d=this;
+//d.startX=0;
+ d.startY=0;
+//d.objX=0;
+ d.objY=0;
+//d.oldX=0;
+ d.oldY=0;
+ d.obj=$(dragid);
+ d.maxY=0;
+ d.minY=0;
+//d.posX=0;
+ d.posY=0; // position (0~1)
+ d.onchange=onchange;
+
+ d.drag=function(event) {
+ //d.startX=event.clientX+window.scrollX;
+ d.startY=event.clientY+window.scrollY;
+ document.addEventListener("mousemove", d.dragging, true);
+ document.addEventListener("mouseup", d.drop, true);
+ d.objX=parseInt(d.obj.style.left);
+ d.objY=parseInt(d.obj.style.top );
+ //obj.style.zIndex++;
+ event.preventDefault();
+ };
+
+ d.dragging=function(event) {
+ var nowX, nowY;
+ //nowX=event.clientX+window.scrollX;
+ nowY=event.clientY+window.scrollY;
+ //var X=d.objX+nowX-d.startX;
+ var Y=d.objY+nowY-d.startY;
+ //if (X>d.maxX) X=d.maxX; if (X<d.minX) X=d.minX;
+ if (Y>d.maxY) Y=d.maxY; if (Y<d.minY) Y=d.minY;
+ d.posY=(Y/d.maxY);
+ //d.obj.style.left=X+"px";
+ d.obj.style.top=Y+"px";
+ event.preventDefault();
+ if ((d.oldY!=Y)/* ||(d.oldX!=X) */) {
+ onchange();
+ d.oldY=Y;
+ //d.oldX=X;
+ }
+ }
+
+ d.setpos=function(x,y) {
+ //d.posX=x;
+ if (y>1.0) y=1.0; else if (y<0.0) y=0.0;
+ d.posY=y;
+ //d.obj.style.left=Math.round(d.posX*d.maxX)+'px';
+ d.obj.style.top=Math.round(d.posY*d.maxY)+'px';
+ }
+
+ d.drop=function(event) {
+ document.removeEventListener("mousemove", d.dragging, true);
+ document.removeEventListener("mouseup", d.drop, true);
+ };
+
+}
+
+function scrollBar(parent,onchange) {
+ var scb=this;
+ scb.parentid=parent;
+ scb.startX=0,
+ scb.startY=0
+ scb.backid=parent+"_BG"; // background id
+ scb.dragid=parent+"_DG"; // drag thing id
+ scb.dragger = null;
+
+ scb.update=function(){
+ $(scb.backid).style.height=$(scb.parentid).clientHeight+'px';
+ scb.dragger.maxY=$(scb.parentid).clientHeight-$(scb.dragid).clientHeight-4;
+ $(scb.dragid).style.top=Math.round(scb.dragger.maxY*scb.dragger.posY)+'px';
+ };
+
+ (scb.create=function(){
+ $(scb.parentid).className='SCROLLBAR';
+ $(scb.parentid).innerHTML=
+ '<div id="'+scb.backid+'" class="BACKGROUND">'+
+ '<div id="'+scb.dragid+'" class="DRAG"></div></div>';
+ scb.dragger = new dragMachine(scb.dragid,onchange);
+ $(scb.dragid).addEventListener("mousedown", scb.dragger.drag, true);
+ })();
+}
+
+
+
+
+/*
+ * jsgb.cpu.js v0.021 - GB CPU Emulator for JSGB, a JavaScript GameBoy Emulator
+ * Copyright (C) 2009 Pedro Ladaria <Sonic1980 at Gmail dot com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ * The full license is available at http://www.gnu.org/licenses/gpl.html
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+var gbEnableCallerStack = false;
+
+// CPU Registers
+var RA=0; // Accumulator
+var FZ=0, // bit 7 - Zero
+ FN=0, // bit 6 - Sub
+ FH=0, // bit 5 - Half Carry
+ FC=0; // bit 4 - Carry
+var RB=0; // Register B
+var RC=0; // Register C
+var RD=0; // Register D
+var RE=0; // Register E
+var HL=0; // Registers H and L
+var SP=0; // Stack Pointer
+var PC=0; // Program Counter
+var T1=0; // Temp Register 1
+var T2=0; // Temp Register 2
+
+var gbHalt = false;
+var gbPause = true;
+var gbIME = true;
+var gbCPUTicks = 0;
+var gbDAATable = [];
+
+// OpCode Arrays
+var OP=[], OPCB=[]; // Opcode Array
+var MN=[], MNCB=[]; // Mnemonics
+
+for (var i=0;i<=0xFF;i++) {
+ MN[i]=function() { return 'DB 0x'+hex2(MEMR(PC))+'; unknown'; };
+ OPCB[i]=function() {};
+ MNCB[i]=function() { return 'DW 0xCB'+hex2(MEMR(PC+1)); };
+}
+
+if (gbEnableCallerStack) {
+ var gbCallerStack = [];
+ var gb_Save_Caller = function() {
+ gbCallerStack.unshift(PC-1);
+ if (gbCallerStack.length>8) gbCallerStack.pop();
+ }
+ var gb_Dump_Caller_Stack = function() {
+ var s='Caller Stack:\n';
+ for (var i in gbCallerStack) s+='0x'+hex4(gbCallerStack[i])+'\n';
+ return s;
+ }
+}
+else {
+ var gb_Dump_Caller_Stack = function() {
+ return 'Caller stack disabled.\n'+
+ 'To enable set gbEnableCallerStack=true in jsgb.cpu.js';
+ }
+}
+function gb_CPU_UNK() {
+ gb_Pause();
+ alert(
+ 'Unknown opcode: '+
+ 'PC='+hex(PC)+' - '+
+ 'OP=0x'+hex(MEMR(PC))+'\n\n'+
+ gb_Dump_Caller_Stack()
+ );
+}
+function gb_CPU_RL(n) {
+ T1=FC;
+ FC=(n>>7)&1;
+ n=((n<<1)&0xFF)|T1;
+ FN=FH=0;
+ FZ=(n==0);
+ gbCPUTicks=8;
+ return n;
+}
+function gb_CPU_RLC(n) {
+ FC=(n>>7)&1;
+ n=((n<<1)&0xFF)|FC;
+ FN=FH=0;
+ FZ=(n==0);
+ gbCPUTicks=8;
+ return n;
+}
+function gb_CPU_RR(n) {
+ T1=FC;
+ FC=n&1;
+ n=(n>>1)|(T1<<7);
+ FN=FH=0;
+ FZ=(n==0);
+ gbCPUTicks=8;
+ return n;
+}
+function gb_CPU_RRC(n) {
+ FC=n&1;
+ n=(n>>1)|(FC<<7);
+ FN=FH=0;
+ FZ=(n==0);
+ gbCPUTicks=8;
+ return n;
+}
+function gb_CPU_SWAP(R) {
+ if (R=='H') return ''+
+ 'HL=((HL&0x0F00)<<4) | ((HL&0xF000)>>4) | (HL&0x00FF);'+
+ 'gbCPUTicks=8;';
+ else if (R=='L') return ''+
+ 'HL=((HL&0x000F)<<4) | ((HL&0x00F0)>>4) | (HL&0xFF00);'+
+ 'gbCPUTicks=8;';
+ else if (R=='(HL)') return ''+
+ 'T1=MEMR(HL);'+
+ 'MEMW(HL, ((T1<<4)|(T1>>4))&0xFF);'+
+ 'gbCPUTicks=8;';
+ else return ''+
+ ''+R+'=(('+R+'<<4)|('+R+'>>4))&0xFF;'+
+ 'gbCPUTicks=8;';
+}
+function gb_CPU_ADD_A(R,C) {
+ return ''+
+ 'FH=((RA&0x0F)+('+R+'&0x0F))>0x0F;'+
+ 'FC=((RA&0xFF)+('+R+'&0xFF))>0xFF;'+
+ 'RA=(RA+'+R+')&0xFF;'+
+ 'FZ=(RA==0);'+
+ 'FN=0;'+
+ 'gbCPUTicks='+C+';';
+}
+function gb_CPU_ADC_A(R,C) {
+ return ''+
+ 'T2=FC;'+
+ 'FH=((RA&0x0F)+('+R+'&0x0F)+T2)>0x0F;'+
+ 'FC=((RA&0xFF)+('+R+'&0xFF)+T2)>0xFF;'+
+ 'RA=(RA+'+R+'+T2)&0xFF;'+
+ 'FZ=(RA==0);'+
+ 'FN=0;'+
+ 'gbCPUTicks='+C+';';
+}
+function gb_CPU_SUB_A(R,C) { //!!!
+ if (R=='RA') return ''+
+ 'FH=false;'+
+ 'FC=false;'+
+ 'RA=0;'+
+ 'FZ=true;'+
+ 'FN=1;'+
+ 'gbCPUTicks='+C+';';
+ else return ''+
+ 'FH=(RA&0x0F)<('+R+'&0x0F);'+
+ 'FC=(RA&0xFF)<('+R+'&0xFF);'+
+ 'RA=(RA-'+R+')&0xFF;'+
+ 'FZ=(RA==0);'+
+ 'FN=1;'+
+ 'gbCPUTicks='+C+';';
+}
+function gb_CPU_SBC_A(R,C) {
+ return ''+
+ 'T2=FC;'+
+ 'FH=((RA&0x0F)<(('+R+'&0x0F)+T2));'+
+ 'FC=((RA&0xFF)<(('+R+'&0xFF)+T2));'+
+ 'RA=(RA-'+R+'-T2)&0xFF;'+
+ 'FZ=(RA==0);'+
+ 'FN=1;'+
+ 'gbCPUTicks='+C+';';
+}
+function gb_CPU_AND_A(R,C) {
+ return ''+
+ ((R=='RA')?'':'RA&='+R+';')+
+ 'FZ=(RA==0);'+
+ 'FH=1;'+
+ 'FN=FC=0;'+
+ 'gbCPUTicks='+C+';';
+}
+function gb_CPU_OR_A(R,C) {
+ return ''+
+ ((R=='RA')?'':'RA|='+R+';')+
+ 'FZ=(RA==0);'+
+ 'FN=FH=FC=0;'+
+ 'gbCPUTicks='+C+';';
+}
+function gb_CPU_XOR_A(R,C) {
+ return ''+
+ ((R=='RA')?'RA=0;':'RA^='+R+';')+
+ ((R=='RA')?'FZ=1;':'FZ=(RA==0);')+
+ 'FN=FH=FC=0;'+
+ 'gbCPUTicks='+C+';';
+}
+function gb_CPU_CP_A(R,C) {
+ return ''+
+ 'FZ=(RA=='+R+');'+
+ 'FN=1;'+
+ 'FC=RA<'+R+';'+
+ 'FH=(RA&0x0F)<('+R+'&0x0F);'+
+ 'gbCPUTicks='+C+';';
+}
+function gb_CPU_INC(R,C) { //!!!
+ return ''+
+ ''+R+'=(++'+R+')&0xFF;'+
+ 'FZ=('+R+'==0);'+
+ 'FN=0;'+
+ 'FH=('+R+'&0xF)==0;'+
+ 'gbCPUTicks='+C+';';
+}
+function gb_CPU_DEC(R,C) {
+ return ''+
+ ''+R+'=(--'+R+')&0xFF;'+
+ 'FZ=('+R+'==0);'+
+ 'FN=1;'+
+ 'FH=('+R+'&0xF)==0xF;'+
+ 'gbCPUTicks=4;';
+}
+function gb_CPU_ADD16(n1,n2) {
+ FN=0;
+ FH=((n1&0xFFF)+(n2&0xFFF))>0xFFF; // TODO test bit 11. Not sure on this
+ n1+=n2;
+ FC=n1>0xFFFF;
+ n1&=0xFFFF;
+ gbCPUTicks=8;
+ return n1;
+}
+function gb_CPU_INC16(n) {
+ gbCPUTicks=8;
+ return (n+1)&0xFFFF;
+}
+function gb_CPU_JR(c) {
+ if (c=='true') return ''+
+ 'PC+=sb(MEMR(PC))+1;'+
+ 'gbCPUTicks=12;';
+ else return ''+
+ 'if ('+c+') {'+
+ ' PC+=sb(MEMR(PC))+1; gbCPUTicks=12;'+
+ '} else {'+
+ ' PC++;'+
+ ' gbCPUTicks=8;'+
+ '}';
+}
+function gb_CPU_JP(c) {
+ if (c=='true') return ''+
+ 'PC=(MEMR(PC+1)<<8)|MEMR(PC);'+
+ 'gbCPUTicks=12;';
+ else return ''+
+ 'if ('+c+') PC=(MEMR(PC+1)<<8)|MEMR(PC);'+
+ 'else PC+=2;'+
+ 'gbCPUTicks=12;';
+}
+function gb_CPU_CALL(c) {
+ if (c=='true') return ''+
+ ((gbEnableCallerStack)?'gb_Save_Caller();':'')+
+ 'PC+=2;'+
+ 'MEMW(--SP,PC>>8);'+
+ 'MEMW(--SP,PC&0xFF);'+
+ 'PC=(MEMR(PC-1)<<8)|MEMR(PC-2);'+
+ 'gbCPUTicks=12;';
+ else return ''+
+ ((gbEnableCallerStack)?'gb_Save_Caller();':'')+
+ 'PC+=2;'+
+ 'if ('+c+') {'+
+ ' MEMW(--SP,PC>>8);'+
+ ' MEMW(--SP,PC&0xFF);'+
+ ' PC=(MEMR(PC-1)<<8)|MEMR(PC-2);'+
+ '}'+
+ 'gbCPUTicks=12;';
+}
+function gb_CPU_RST(a) {
+ return ''+
+ 'MEMW(--SP,PC>>8);'+
+ 'MEMW(--SP,PC&0xFF);'+
+ 'PC='+a+';'+
+ 'gbCPUTicks=32;';
+}
+function gb_CPU_RET(c) { //!!!
+ if (c=='true') return ''+
+ 'PC=(MEMR(SP+1)<<8)|MEMR(SP);'+
+ 'SP+=2;'+
+ 'gbCPUTicks=8;';
+ else return ''+
+ 'if ('+c+') {'+
+ ' PC=(MEMR(SP+1)<<8)|MEMR(SP);'+
+ ' SP+=2;'+
+ '}'+
+ 'gbCPUTicks=8;';
+}
+function gb_CPU_DDA() { //!!!
+ return ''+
+ 'T1=RA;'+
+ 'if(FC)T1|=256;'+
+ 'if(FH)T1|=512;'+
+ 'if(FN)T1|=1024;'+
+ 'T1=gbDAATable[T1];'+
+ 'RA=T1>>8;'+
+ 'FZ=(T1>>7)&1;'+
+ 'FN=(T1>>6)&1;'+
+ 'FH=(T1>>5)&1;'+
+ 'FC=(T1>>4)&1;'+
+ 'gbCPUTicks=4;';
+}
+function gb_CPU_RLA() { //!!!
+ return ''+
+ 'T1=FC;'+
+ 'FC=(RA>>7)&1;'+
+ 'RA=((RA<<1)&0xFF)|T1;'+
+ 'FN=FH=0;'+
+ 'FZ=(RA==0);'+ // TODO not sure. on z80 Z is not affected
+ 'gbCPUTicks=4;';
+}
+function gb_CPU_HALT() {
+ return ''+
+ 'if (gbIME) gbHalt=true;'+
+ 'else {'+
+ ' gb_Pause();'+
+ ' alert(\'HALT instruction with interrupts disabled.\');'+
+ '}'+
+ 'gbCPUTicks=4;';
+}
+function gb_LD_MEM_R16(R,C) {
+ return ''+
+ 'T1=(MEMR(PC+1)<<8)+MEMR(PC);'+
+ 'MEMW(T1++,'+R+'&0xFF);'+
+ 'MEMW(T1,'+R+'>>8);'+
+ 'PC+=2;'+
+ 'gbCPUTicks='+C+';';
+}
+function gb_CPU_SLA_R(R, C) {
+ return ''+
+ 'FC=('+R+'>>7)&1;'+
+ ''+R+'=('+R+'<<1)&0xFF;'+
+ 'FN=FH=0;'+
+ 'FZ=('+R+'==0);'+
+ 'gbCPUTicks='+C+';';
+}
+function gb_CPU_NOP() {
+ gbCPUTicks=0;
+}
+
+OP[0x00]=gb_CPU_NOP; // NOP
+OP[0x01]=function(){ RC=MEMR(PC++); RB=MEMR(PC++); gbCPUTicks=12; }; // LD BC,u16
+OP[0x02]=function(){ MEMW((RB<<8)|RC,RA); gbCPUTicks=8; }; // LD (BC),A
+OP[0x03]=function(){ T1=gb_CPU_INC16((RB<<8)|RC); RB=T1>>8; RC=T1&0xFF; }; // INC BC
+OP[0x04]=new Function(gb_CPU_INC('RB',4)); // INC B
+OP[0x05]=new Function(gb_CPU_DEC('RB',4)); // DEC B
+OP[0x06]=function(){ RB=MEMR(PC++); gbCPUTicks=8; }; // LD B,u8
+OP[0x07]=function(){ FC=(RA>>7)&1; RA=((RA<<1)&0xFF)|FC; FN=FH=0; FZ=RA==0; gbCPUTicks=4; }; // RLCA
+OP[0x08]=new Function(gb_LD_MEM_R16('HL',20)); // LD (u16),SP
+OP[0x09]=function(){ HL=gb_CPU_ADD16(HL,(RB<<8)|RC); }; // ADD HL,BC
+OP[0x0A]=function(){ RA=MEMR(((RB&0x00FF)<<8)|RC); gbCPUTicks=8; }; // LD A,(BC)
+OP[0x0B]=function(){ var BC=((RB<<8)+RC-1)&0xFFFF; RB=BC>>8; RC=BC&0xFF; gbCPUTicks=8; }; // DEC BC
+OP[0x0C]=new Function(gb_CPU_INC('RC',4)); // INC C
+OP[0x0D]=new Function(gb_CPU_DEC('RC',4)); // DEC C
+OP[0x0E]=function(){ RC=MEMR(PC++); gbCPUTicks=8; }; // LD C,u8;
+OP[0x0F]=function(){ FC=RA&1; RA=(RA>>1)|(FC<<7); FN=0; FH=0; FZ=RA==0; gbCPUTicks=4; }; // RRCA
+OP[0x10]=function(){ gb_Pause();alert('STOP instruction\n'+gb_Dump_Caller_Stack()); gbCPUTicks=4; }; // STOP
+OP[0x11]=function(){ RE=MEMR(PC++); RD=MEMR(PC++); gbCPUTicks=12; }; // LD DE,u16
+OP[0x12]=function(){ MEMW((RD<<8)|RE,RA); gbCPUTicks=8; }; // LD (DE),A
+OP[0x13]=function(){ T1=gb_CPU_INC16((RD<<8)|RE); RD=T1>>8; RE=T1&0xFF; }; // INC DE
+OP[0x14]=new Function(gb_CPU_INC('RD',4)); // INC D
+OP[0x15]=new Function(gb_CPU_DEC('RD',4)); // DEC D
+OP[0x16]=function(){ RD=MEMR(PC++); gbCPUTicks=8; }; // LD D,u8
+OP[0x17]=new Function(gb_CPU_RLA()); // RLA
+OP[0x18]=new Function(gb_CPU_JR('true')); // JR s8
+OP[0x19]=function(){ HL=gb_CPU_ADD16(HL,(RD<<8)|RE); }; // ADD HL,DE
+OP[0x1A]=function(){ RA=MEMR(((RD&0x00FF)<<8)|RE); gbCPUTicks=8; }; // LD A,(DE)
+OP[0x1B]=function(){ var DE=((RD<<8)+RE-1)&0xFFFF; RD=DE>>8; RE=DE&0xFF; gbCPUTicks=8; }; // DEC DE
+OP[0x1C]=new Function(gb_CPU_INC('RE',4)); // INC E
+OP[0x1D]=new Function(gb_CPU_DEC('RE',4)); // DEC E
+OP[0x1E]=function(){ RE=MEMR(PC++); gbCPUTicks=8; }; // LD E,u8;
+OP[0x1F]=function(){ T1=FC; FC=RA&1; RA=(RA>>1)|(T1<<7); FN=0; FH=0; FZ=RA==0; gbCPUTicks=4; }; // RRA
+OP[0x20]=new Function(gb_CPU_JR('!FZ')); // JR NZ,s8
+OP[0x21]=function(){ HL=(MEMR(PC+1)<<8)|MEMR(PC); PC+=2; gbCPUTicks=12; }; // LD HL,u16;
+OP[0x22]=function(){ MEMW(HL,RA); HL=(++HL)&0xFFFF; gbCPUTicks=8; }; // LDI (HL),A
+OP[0x23]=function(){ HL=gb_CPU_INC16(HL); }; // INC HL
+OP[0x24]=new Function('T1=HL>>8;'+gb_CPU_INC('T1',4)+'HL=(HL&0x00FF)|(T1<<8);'); // INC H
+OP[0x25]=new Function('T1=HL>>8;'+gb_CPU_DEC('T1',4)+'HL=(HL&0x00FF)|(T1<<8);'); // DEC H
+OP[0x26]=function(){ HL&=0x00FF; HL|=MEMR(PC++)<<8; gbCPUTicks=8; }; // LD H,u8
+OP[0x27]=new Function(gb_CPU_DDA()); // DAA
+OP[0x28]=new Function(gb_CPU_JR('FZ')); // JR Z,s8
+OP[0x29]=function(){ HL=gb_CPU_ADD16(HL,HL); }; // ADD HL,HL
+OP[0x2A]=function(){ RA=MEMR(HL); HL=(HL+1)&0xFFFF; gbCPUTicks=8; }; // LDI A,(HL)
+OP[0x2B]=function(){ HL=(HL-1)&0xFFFF; gbCPUTicks=8; }; // DEC HL
+OP[0x2C]=new Function('T1=HL&0xFF;'+gb_CPU_INC('T1',4)+'HL=(HL&0xFF00)|T1;'); // INC L
+OP[0x2D]=new Function('T1=HL&0xFF;'+gb_CPU_DEC('T1',4)+'HL=(HL&0xFF00)|T1;'); // DEC L
+OP[0x2E]=function(){ HL&=0xFF00; HL|=MEMR(PC++); gbCPUTicks=8; }; // LD L,u8
+OP[0x2F]=function(){ RA^=0xFF; FN=1; FH=1; gbCPUTicks=4; }; // CPL
+OP[0x30]=new Function(gb_CPU_JR('!FC')); // JR NC,s8
+OP[0x31]=function(){ SP=(MEMR(PC+1)<<8)|MEMR(PC); PC+=2; gbCPUTicks=12; }; // LD SP,u16
+OP[0x32]=function(){ MEMW(HL,RA); HL=(HL-1)&0xFFFF; gbCPUTicks=8; }; // LDD (HL),A
+OP[0x33]=function(){ SP=gb_CPU_INC16(SP); }; // INC SP
+OP[0x34]=new Function('T1=MEMR(HL);'+gb_CPU_INC('T1',12)+'MEMW(HL,T1);'); // INC (HL)
+OP[0x35]=new Function('T1=MEMR(HL);'+gb_CPU_DEC('T1',12)+'MEMW(HL,T1);'); // DEC (HL)
+OP[0x36]=function(){ MEMW(HL,MEMR(PC++)); gbCPUTicks=12; }; // LD (HL),u8;
+OP[0x37]=function(){ FC=1; FN=0; FH=0; gbCPUTicks=4; }; // SCF
+OP[0x38]=new Function(gb_CPU_JR('FC')); // JR C,s8
+OP[0x39]=function(){ HL=gb_CPU_ADD16(HL,SP); }; // ADD HL,SP
+OP[0x3A]=function(){ RA=MEMR(HL); HL=(HL-1)&0xFFFF; gbCPUTicks=8; }; // LDD A,(HL)
+OP[0x3B]=function(){ SP=(SP-1)&0xFFFF; gbCPUTicks=8; }; // DEC SP
+OP[0x3C]=new Function(gb_CPU_INC('RA',4)); // INC A
+OP[0x3D]=new Function(gb_CPU_DEC('RA',4)); // DEC A
+OP[0x3E]=function(){ RA=MEMR(PC++); gbCPUTicks=8; }; // LD A,u8;
+OP[0x3F]=function(){ FC=(~FC)&1; FN=FH=0; gbCPUTicks=4; }; // CCF
+OP[0x40]=gb_CPU_NOP; // LD B,B
+OP[0x41]=function(){ RB=RC; gbCPUTicks=4; }; // LD B,C
+OP[0x42]=function(){ RB=RD; gbCPUTicks=4; }; // LD B,D
+OP[0x43]=function(){ RB=RE; gbCPUTicks=4; }; // LD B,E
+OP[0x44]=function(){ RB=HL>>8; gbCPUTicks=4; }; // LD B,H
+OP[0x45]=function(){ RB=HL&0xFF; gbCPUTicks=4; }; // LD B,L
+OP[0x46]=function(){ RB=MEMR(HL); gbCPUTicks=8; }; // LD B,(HL)
+OP[0x47]=function(){ RB=RA; gbCPUTicks=4; }; // LD B,A
+OP[0x48]=function(){ RC=RB; gbCPUTicks=4; }; // LD C,B
+OP[0x49]=gb_CPU_NOP; // LD C,C
+OP[0x4A]=function(){ RC=RD; gbCPUTicks=4; }; // LD C,D
+OP[0x4B]=function(){ RC=RE; gbCPUTicks=4; }; // LD C,E
+OP[0x4C]=function(){ RC=HL>>8; gbCPUTicks=4; }; // LD C,H
+OP[0x4D]=function(){ RC=HL&0xFF; gbCPUTicks=4; }; // LD C,L
+OP[0x4E]=function(){ RC=MEMR(HL); gbCPUTicks=8; }; // LD C,(HL)
+OP[0x4F]=function(){ RC=RA; gbCPUTicks=4; }; // LD C,A
+OP[0x50]=function(){ RD=RB; gbCPUTicks=4; }; // LD D,B
+OP[0x51]=function(){ RD=RC; gbCPUTicks=4; }; // LD D,C
+OP[0x52]=gb_CPU_NOP; // LD D,D
+OP[0x53]=function(){ RD=RE; gbCPUTicks=4; }; // LD D,E
+OP[0x54]=function(){ RD=HL>>8; gbCPUTicks=4; }; // LD D,H
+OP[0x55]=function(){ RD=HL&0xFF; gbCPUTicks=4; }; // LD D,L
+OP[0x56]=function(){ RD=MEMR(HL); gbCPUTicks=8; }; // LD D,(HL)
+OP[0x57]=function(){ RD=RA; gbCPUTicks=4; }; // LD D,A
+OP[0x58]=function(){ RE=RB; gbCPUTicks=4; }; // LD E,B
+OP[0x59]=function(){ RE=RC; gbCPUTicks=4; }; // LD E,C
+OP[0x5A]=function(){ RE=RD; gbCPUTicks=4; }; // LD E,D
+OP[0x5B]=gb_CPU_NOP; // LD E,E
+OP[0x5C]=function(){ RE=HL>>8; gbCPUTicks=4; }; // LD E,H
+OP[0x5D]=function(){ RE=HL&0xFF; gbCPUTicks=4; }; // LD E,L
+OP[0x5E]=function(){ RE=MEMR(HL); gbCPUTicks=8; }; // LD E,(HL)
+OP[0x5F]=function(){ RE=RA; gbCPUTicks=4; }; // LD E,A
+OP[0x60]=function(){ HL=(HL&0x00FF)|(RB<<8); gbCPUTicks=4; }; // LD H,B
+OP[0x61]=function(){ HL=(HL&0x00FF)|(RC<<8); gbCPUTicks=4; }; // LD H,C
+OP[0x62]=function(){ HL=(HL&0x00FF)|(RD<<8); gbCPUTicks=4; }; // LD H,D
+OP[0x63]=function(){ HL=(HL&0x00FF)|(RE<<8); gbCPUTicks=4; }; // LD H,E
+OP[0x64]=gb_CPU_NOP; // LD H,H
+OP[0x65]=function(){ HL=(HL&0x00FF)|((HL&0xFF)<<8); gbCPUTicks=4; }; // LD H,L
+OP[0x66]=function(){ HL=(HL&0x00FF)|(MEMR(HL)<<8); gbCPUTicks=8; }; // LD H,(HL)
+OP[0x67]=function(){ HL=(RA<<8)|(HL&0xFF); gbCPUTicks=4; }; // LD H,A
+OP[0x68]=function(){ HL=(HL&0xFF00)|RB; gbCPUTicks=4; }; // LD L,B
+OP[0x69]=function(){ HL=(HL&0xFF00)|RC; gbCPUTicks=4; }; // LD L,C
+OP[0x6A]=function(){ HL=(HL&0xFF00)|RD; gbCPUTicks=4; }; // LD L,D
+OP[0x6B]=function(){ HL=(HL&0xFF00)|RE; gbCPUTicks=4; }; // LD L,E
+OP[0x6C]=function(){ HL=(HL&0xFF00)|(HL>>8); gbCPUTicks=4; }; // LD L,H
+OP[0x6D]=gb_CPU_NOP; // LD L,L
+OP[0x6E]=function(){ HL=(HL&0xFF00)|(MEMR(HL)); gbCPUTicks=8; }; // LD L,(HL)
+OP[0x6F]=function(){ HL=RA|(HL&0xFF00); gbCPUTicks=4; }; // LD L,A
+OP[0x70]=function(){ MEMW(HL,RB); gbCPUTicks=8; }; // LD (HL),B
+OP[0x71]=function(){ MEMW(HL,RC); gbCPUTicks=8; }; // LD (HL),C
+OP[0x72]=function(){ MEMW(HL,RD); gbCPUTicks=8; }; // LD (HL),D
+OP[0x73]=function(){ MEMW(HL,RE); gbCPUTicks=8; }; // LD (HL),E
+OP[0x74]=function(){ MEMW(HL,HL>>8); gbCPUTicks=8; }; // LD (HL),H
+OP[0x75]=function(){ MEMW(HL,HL&0x00FF); gbCPUTicks=8; }; // LD (HL),L
+OP[0x76]=new Function(gb_CPU_HALT()); // HALT
+OP[0x77]=function(){ MEMW(HL,RA); gbCPUTicks=8; }; // LD (HL),A
+OP[0x78]=function(){ RA=RB; gbCPUTicks=4; }; // LD A,B
+OP[0x79]=function(){ RA=RC; gbCPUTicks=4; }; // LD A,C
+OP[0x7A]=function(){ RA=RD; gbCPUTicks=4; }; // LD A,D
+OP[0x7B]=function(){ RA=RE; gbCPUTicks=4; }; // LD A,E
+OP[0x7C]=function(){ RA=HL>>8; gbCPUTicks=4; }; // LD A,H
+OP[0x7D]=function(){ RA=HL&0xFF; gbCPUTicks=4; }; // LD A,L
+OP[0x7E]=function(){ RA=MEMR(HL); gbCPUTicks=8; }; // LD A,(HL)
+OP[0x7F]=gb_CPU_NOP; // LD A,A
+OP[0x80]=new Function(gb_CPU_ADD_A('RB',4)); // ADD A,B
+OP[0x81]=new Function(gb_CPU_ADD_A('RC',4)); // ADD A,C
+OP[0x82]=new Function(gb_CPU_ADD_A('RD',4)); // ADD A,D
+OP[0x83]=new Function(gb_CPU_ADD_A('RE',4)); // ADD A,E
+OP[0x84]=new Function('T1=HL>>8;'+gb_CPU_ADD_A('T1',4)); // ADD A,H
+OP[0x85]=new Function('T1=HL&0xFF;'+gb_CPU_ADD_A('T1',4)); // ADD A,L
+OP[0x86]=new Function('T1=MEMR(HL);'+gb_CPU_ADD_A('T1',8)); // ADD A,(HL)
+OP[0x87]=new Function(gb_CPU_ADD_A('RA',4)); // ADD A,A
+OP[0x88]=new Function(gb_CPU_ADC_A('RB',4)); // ADC A,B
+OP[0x89]=new Function(gb_CPU_ADC_A('RC',4)); // ADC A,C
+OP[0x8A]=new Function(gb_CPU_ADC_A('RD',4)); // ADC A,D
+OP[0x8B]=new Function(gb_CPU_ADC_A('RE',4)); // ADC A,E
+OP[0x8C]=new Function('T1=HL>>8;'+gb_CPU_ADC_A('T1',4)); // ADC A,H
+OP[0x8D]=new Function('T1=HL&0xFF;'+gb_CPU_ADC_A('T1',4)); // ADC A,L
+OP[0x8E]=new Function('T1=MEMR(HL);'+gb_CPU_ADC_A('T1',8)); // ADC A,(HL)
+OP[0x8F]=new Function(gb_CPU_ADC_A('RA',4)); // ADC A,A
+OP[0x90]=new Function(gb_CPU_SUB_A('RB',4)); // SUB B
+OP[0x91]=new Function(gb_CPU_SUB_A('RC',4)); // SUB C
+OP[0x92]=new Function(gb_CPU_SUB_A('RD',4)); // SUB D
+OP[0x93]=new Function(gb_CPU_SUB_A('RE',4)); // SUB E
+OP[0x94]=new Function('T1=HL>>8;'+gb_CPU_SUB_A('T1',4)); // SUB H
+OP[0x95]=new Function('T1=HL&0xFF;'+gb_CPU_SUB_A('T1',4)); // SUB L
+OP[0x96]=new Function('T1=MEMR(HL);'+gb_CPU_SUB_A('T1',8)); // SUB (HL)
+OP[0x97]=new Function(gb_CPU_SUB_A('RA',4)); // SUB A
+OP[0x98]=new Function(gb_CPU_SBC_A('RB',4)); // SBC A,B
+OP[0x99]=new Function(gb_CPU_SBC_A('RC',4)); // SBC A,C
+OP[0x9A]=new Function(gb_CPU_SBC_A('RD',4)); // SBC A,D
+OP[0x9B]=new Function(gb_CPU_SBC_A('RE',4)); // SBC A,E
+OP[0x9C]=new Function('T1=HL>>8;'+gb_CPU_SBC_A('T1',4)); // SBC A,H
+OP[0x9D]=new Function('T1=HL&0xFF;'+gb_CPU_SBC_A('T1',4)); // SBC A,L
+OP[0x9E]=new Function('T1=MEMR(HL);'+gb_CPU_SBC_A('T1',8)); // SBC A,(HL)
+OP[0x9F]=new Function(gb_CPU_SBC_A('RA',4)); // SBC A,A
+OP[0xA0]=new Function(gb_CPU_AND_A('RB',4)); // AND B
+OP[0xA1]=new Function(gb_CPU_AND_A('RC',4)); // AND C
+OP[0xA2]=new Function(gb_CPU_AND_A('RD',4)); // AND D
+OP[0xA3]=new Function(gb_CPU_AND_A('RE',4)); // AND E
+OP[0xA4]=new Function(gb_CPU_AND_A('HL>>8',4)); // AND H
+OP[0xA5]=new Function(gb_CPU_AND_A('HL&0xFF',4)); // AND L
+OP[0xA6]=new Function(gb_CPU_AND_A('MEMR(HL)',8)); // AND (HL)
+OP[0xA7]=new Function(gb_CPU_AND_A('RA',4)); // AND A
+OP[0xA8]=new Function(gb_CPU_XOR_A('RB',4)); // XOR B
+OP[0xA9]=new Function(gb_CPU_XOR_A('RC',4)); // XOR C
+OP[0xAA]=new Function(gb_CPU_XOR_A('RD',4)); // XOR D
+OP[0xAB]=new Function(gb_CPU_XOR_A('RE',4)); // XOR E
+OP[0xAC]=new Function(gb_CPU_XOR_A('HL>>8',4)); // XOR H
+OP[0xAD]=new Function(gb_CPU_XOR_A('HL&0xFF',4)); // XOR L
+OP[0xAE]=new Function(gb_CPU_XOR_A('MEMR(HL)',8)); // XOR (HL)
+OP[0xAF]=new Function(gb_CPU_XOR_A('RA',4)); // XOR A
+OP[0xB0]=new Function(gb_CPU_OR_A('RB',4)); // OR B
+OP[0xB1]=new Function(gb_CPU_OR_A('RC',4)); // OR C
+OP[0xB2]=new Function(gb_CPU_OR_A('RD',4)); // OR D
+OP[0xB3]=new Function(gb_CPU_OR_A('RE',4)); // OR E
+OP[0xB4]=new Function(gb_CPU_OR_A('HL>>8',4)); // OR H
+OP[0xB5]=new Function(gb_CPU_OR_A('HL&0xFF',4)); // OR L
+OP[0xB6]=new Function(gb_CPU_OR_A('MEMR(HL)',8)); // OR (HL)
+OP[0xB7]=new Function(gb_CPU_OR_A('RA',4)); // OR A
+OP[0xB8]=new Function(gb_CPU_CP_A('RB',4)); // CP B
+OP[0xB9]=new Function(gb_CPU_CP_A('RC',4)); // CP C
+OP[0xBA]=new Function(gb_CPU_CP_A('RD',4)); // CP D
+OP[0xBB]=new Function(gb_CPU_CP_A('RE',4)); // CP E
+OP[0xBC]=new Function('T1=HL>>8;'+gb_CPU_CP_A('T1',4)); // CP H
+OP[0xBD]=new Function('T1=HL&0xFF;'+gb_CPU_CP_A('T1',4)); // CP L
+OP[0xBE]=new Function('T1=MEMR(HL);'+gb_CPU_CP_A('T1',8)); // CP (HL)
+OP[0xBF]=new Function(gb_CPU_CP_A('RA',4)); // CP A
+OP[0xC0]=new Function(gb_CPU_RET('!FZ')); // RET NZ
+OP[0xC1]=function(){ RC=MEMR(SP++); RB=MEMR(SP++); gbCPUTicks=12; }; // POP BC
+OP[0xC2]=new Function(gb_CPU_JP('!FZ')); // JP NZ,u16
+OP[0xC3]=new Function(gb_CPU_JP('true')); // JP u16;
+OP[0xC4]=new Function(gb_CPU_CALL('!FZ')); // CALL NZ,u16
+OP[0xC5]=function(){ MEMW(--SP,RB); MEMW(--SP,RC); gbCPUTicks=16; }; // PUSH BC
+OP[0xC6]=new Function('T1=MEMR(PC++);'+gb_CPU_ADD_A('T1',8)); // ADD A,u8
+OP[0xC7]=new Function(gb_CPU_RST('0x00')); // RST 0x00
+OP[0xC8]=new Function(gb_CPU_RET('FZ')); // RET Z
+OP[0xC9]=new Function(gb_CPU_RET('true')); // RET
+OP[0xCA]=new Function(gb_CPU_JP('FZ')); // JP Z,u16;
+OP[0xCB]=function(){ OPCB[MEMR(PC++)](); };
+OP[0xCC]=new Function(gb_CPU_CALL('FZ')); // CALL Z,u16
+OP[0xCD]=new Function(gb_CPU_CALL('true')); // CALL u16
+OP[0xCE]=new Function('T1=MEMR(PC++);'+gb_CPU_ADC_A('T1',4)); // ADC A,u8;
+OP[0xCF]=new Function(gb_CPU_RST('0x08')); // RST 0x08
+OP[0xD0]=new Function(gb_CPU_RET('!FC')); // RET NC
+OP[0xD1]=function(){ RE=MEMR(SP++); RD=MEMR(SP++); gbCPUTicks=12; }; // POP DE
+OP[0xD2]=new Function(gb_CPU_JP('!FC')); // JP NC,u16
+OP[0xD3]=gb_CPU_UNK;
+OP[0xD4]=new Function(gb_CPU_CALL('!FC')); // CALL NC,u16
+OP[0xD5]=function(){ MEMW(--SP,RD); MEMW(--SP,RE); gbCPUTicks=16; }; // PUSH DE
+OP[0xD6]=new Function('T1=MEMR(PC++);'+gb_CPU_SUB_A('T1',8)); // SUB u8
+OP[0xD7]=new Function(gb_CPU_RST('0x10')); // RST 0x10
+OP[0xD8]=new Function(gb_CPU_RET('FC')); // RET C
+OP[0xD9]=new Function(gb_CPU_RET('true')+'gbIME=true;'); // RETI
+OP[0xDA]=new Function(gb_CPU_JP('FC')); // JP C,u16
+OP[0xDB]=gb_CPU_UNK;
+OP[0xDC]=new Function(gb_CPU_CALL('FC')); // CALL C,u16
+OP[0xDD]=gb_CPU_UNK;
+OP[0xDE]=new Function('T1=MEMR(PC++);'+gb_CPU_SBC_A('T1',8)); // SBC A,u8;
+OP[0xDF]=new Function(gb_CPU_RST('0x18')); // RST 0x18
+OP[0xE0]=function(){ MEMW(0xFF00+MEMR(PC++),RA); gbCPUTicks=12; }; // LD (0xFF00+u8),A
+OP[0xE1]=function(){ T1=MEMR(SP++); HL=(MEMR(SP++)<<8)|T1; gbCPUTicks=12; }; // POP HL
+OP[0xE2]=function(){ MEMW(0xFF00+RC,RA); gbCPUTicks=8; }; // LD (0xFF00+C),A
+OP[0xE3]=gb_CPU_UNK;
+OP[0xE4]=gb_CPU_UNK;
+OP[0xE5]=function(){ MEMW(--SP,HL>>8); MEMW(--SP,HL&0xFF); gbCPUTicks=16; }; // PUSH HL
+OP[0xE6]=new Function(gb_CPU_AND_A('MEMR(PC++)',8)); // AND u8
+OP[0xE7]=new Function(gb_CPU_RST('0x20')); // RST 0x20
+OP[0xE8]=function(){ SP=gb_CPU_ADD16(SP,sb(MEMR(PC++))); gbCPUTicks+=8; }; // ADD SP,u8
+OP[0xE9]=function(){ PC=HL; gbCPUTicks=4; }; // JP (HL)
+OP[0xEA]=function(){ MEMW((MEMR(PC+1)<<8)|MEMR(PC),RA); PC+=2; gbCPUTicks=16; }; // LD (u16),A
+OP[0xEB]=gb_CPU_UNK;
+OP[0xEC]=gb_CPU_UNK;
+OP[0xED]=gb_CPU_UNK;
+OP[0xEE]=new Function(gb_CPU_XOR_A('MEMR(PC++)',8)); // XOR u8
+OP[0xEF]=new Function(gb_CPU_RST('0x28')); // RST 0x28
+OP[0xF0]=function(){ RA=MEMR(0xFF00+MEMR(PC++)); gbCPUTicks=12; }; // LD A,(0xFF00+u8)
+OP[0xF1]=function(){ T1=MEMR(SP++); RA=MEMR(SP++); FZ=(T1>>7)&1; FN=(T1>>6)&1; FH=(T1>>5)&1; FC=(T1>>4)&1; gbCPUTicks=12; }; // POP AF
+OP[0xF2]=function(){ RA=MEMR(0xFF00+RC); gbCPUTicks=8; }; // LD A,(0xFF00+C)
+OP[0xF3]=function(){ gbIME=false; gbCPUTicks=4; }; // DI
+OP[0xF4]=gb_CPU_UNK;
+OP[0xF5]=function(){ MEMW(--SP,RA); MEMW(--SP,(FZ<<7)|(FN<<6)|(FH<<5)|(FC<<4)); gbCPUTicks=16; }; // PUSH AF
+OP[0xF6]=new Function(gb_CPU_OR_A('MEMR(PC++)',8)); // OR u8;
+OP[0xF7]=new Function(gb_CPU_RST('0x30')); // RST 0x30
+OP[0xF8]=function(){ var n=MEMR(PC++); HL=SP+sb(n); FZ=0; RN=0; FH=(((SP&0x0F)+(n&0x0F))>0x0F); FC=(((SP&0xFF)+(n&0xFF))>0xFF); gbCPUTicks=12; }; // LD HL,SP+u8;
+OP[0xF9]=function(){ SP=HL; gbCPUTicks=8; }; // LD SP,HL
+OP[0xFA]=function(){ RA=MEMR((MEMR(PC+1)<<8)|MEMR(PC)); PC+=2; gbCPUTicks=16; }; // LD A,(u16)
+OP[0xFB]=function(){ gbIME=true; gbCPUTicks=4; }; // EI
+OP[0xFC]=gb_CPU_UNK;
+OP[0xFD]=gb_CPU_UNK;
+OP[0xFE]=new Function('T1=MEMR(PC++);'+gb_CPU_CP_A('T1',8)); // CP u8
+OP[0xFF]=new Function(gb_CPU_RST('0x38')); // RST 0x38
+
+OPCB[0x00]=function(){ RB=gb_CPU_RLC(RB); };
+OPCB[0x01]=function(){ RC=gb_CPU_RLC(RC); };
+OPCB[0x02]=function(){ RD=gb_CPU_RLC(RD); };
+OPCB[0x03]=function(){ RE=gb_CPU_RLC(RE); };
+OPCB[0x04]=function(){ HL=(HL&0x00FF)|(gb_CPU_RLC(HL>>8)<<8); };
+OPCB[0x05]=function(){ HL=(HL&0xFF00)|gb_CPU_RLC(HL&0xFF); };
+OPCB[0x06]=function(){ MEMW(HL,gb_CPU_RLC(MEMR(HL))); gbCPUTicks+=8; };
+OPCB[0x07]=function(){ RA=gb_CPU_RLC(RA); };
+OPCB[0x08]=function(){ RB=gb_CPU_RRC(RB); };
+OPCB[0x09]=function(){ RC=gb_CPU_RRC(RC); };
+OPCB[0x0A]=function(){ RD=gb_CPU_RRC(RD); };
+OPCB[0x0B]=function(){ RE=gb_CPU_RRC(RE); };
+OPCB[0x0C]=function(){ HL=(HL&0x00FF)|(gb_CPU_RRC(HL>>8)<<8); };
+OPCB[0x0D]=function(){ HL=(HL&0xFF00)|gb_CPU_RRC(HL&0xFF); };
+OPCB[0x0E]=function(){ MEMW(HL,gb_CPU_RRC(MEMR(HL))); gbCPUTicks+=8; };
+OPCB[0x0F]=function(){ RA=gb_CPU_RRC(RA); };
+OPCB[0x10]=function(){ RB=gb_CPU_RL(RB); };
+OPCB[0x11]=function(){ RC=gb_CPU_RL(RC); };
+OPCB[0x12]=function(){ RD=gb_CPU_RL(RD); };
+OPCB[0x13]=function(){ RE=gb_CPU_RL(RE); };
+OPCB[0x14]=function(){ HL=(HL&0x00FF)|(gb_CPU_RL(HL>>8)<<8); };
+OPCB[0x15]=function(){ HL=(HL&0xFF00)|gb_CPU_RL(HL&0xFF); };
+OPCB[0x16]=function(){ MEMW(HL,gb_CPU_RL(MEMR(HL))); gbCPUTicks+=8; };
+OPCB[0x17]=function(){ RA=gb_CPU_RL(RA); };
+OPCB[0x18]=function(){ RB=gb_CPU_RR(RB); };
+OPCB[0x19]=function(){ RC=gb_CPU_RR(RC); };
+OPCB[0x1A]=function(){ RD=gb_CPU_RR(RD); };
+OPCB[0x1B]=function(){ RE=gb_CPU_RR(RE); };
+OPCB[0x1C]=function(){ HL=(HL&0x00FF)|(gb_CPU_RR(HL>>8)<<8); };
+OPCB[0x1D]=function(){ HL=(HL&0xFF00)|gb_CPU_RR(HL&0xFF); };
+OPCB[0x1E]=function(){ MEMW(HL,gb_CPU_RR(MEMR(HL))); gbCPUTicks+=8; };
+OPCB[0x1F]=function(){ RA=gb_CPU_RR(RA); };
+OPCB[0x20]=new Function(gb_CPU_SLA_R('RB',8)); // SLA B
+OPCB[0x21]=new Function(gb_CPU_SLA_R('RC',8)); // SLA C
+OPCB[0x22]=new Function(gb_CPU_SLA_R('RD',8)); // SLA D
+OPCB[0x23]=new Function(gb_CPU_SLA_R('RE',8)); // SLA E
+OPCB[0x24]=new Function('T1=HL>>8;'+gb_CPU_SLA_R('T1',8)+'HL=(T1<<8)|(HL&0x00FF);'); // SLA H
+OPCB[0x25]=new Function('T1=HL&0xFF;'+gb_CPU_SLA_R('T1',8)+'HL=(HL&0xFF00)|T1;'); // SLA L
+OPCB[0x26]=new Function('T1=MEMR(HL);'+gb_CPU_SLA_R('T1',16)+'MEMW(HL,T1);'); // SLA (HL)
+OPCB[0x27]=new Function(gb_CPU_SLA_R('RA',8)); // SLA A
+OPCB[0x28]=function(){ FC=RB&1; RB=(RB>>1)|(RB&0x80); FN=0;FH=0;FZ=RB==0; gbCPUTicks=8; }; // SRA n
+OPCB[0x29]=function(){ FC=RC&1; RC=(RC>>1)|(RC&0x80); FN=0;FH=0;FZ=RC==0; gbCPUTicks=8; }; // SRA n
+OPCB[0x2A]=function(){ FC=RD&1;RD=(RD>>1)|(RD&0x80); FN=0;FH=0;FZ=RD==0; gbCPUTicks=8; }; // SRA n
+OPCB[0x2B]=function(){ FC=RE&1;RE=(RE>>1)|(RE&0x80); FN=0;FH=0;FZ=RE==0; gbCPUTicks=8; }; // SRA n
+OPCB[0x2C]=function(){ var H=HL>>8; FC=H&1; H=(H>>1)|(H&0x80); FN=0;FH=0;FZ=H==0; HL=(H<<8)|(HL&0x00FF); gbCPUTicks=8; }; // SRA n
+OPCB[0x2D]=function(){ var L=HL&0xFF; FC=L&1; L=(L>>1)|(L&0x80); FN=0;FH=0;FZ=L==0; HL=(HL&0xFF00)|L; gbCPUTicks=8; }; // SRA n
+OPCB[0x2E]=function(){ var M=MEMR(HL); FC=M&1; M=(M>>1)|(M&0x80); FN=0;FH=0;FZ=M==0; MEMW(HL,M); gbCPUTicks=16; }; // SRA n
+OPCB[0x2F]=function(){ FC=RA&1; RA=(RA>>1)|(RA&0x80); FN=0;FH=0;FZ=RA==0; gbCPUTicks=8; }; // SRA n
+OPCB[0x30]=new Function(gb_CPU_SWAP('RB'));
+OPCB[0x31]=new Function(gb_CPU_SWAP('RC'));
+OPCB[0x32]=new Function(gb_CPU_SWAP('RD'));
+OPCB[0x33]=new Function(gb_CPU_SWAP('RE'));
+OPCB[0x34]=new Function(gb_CPU_SWAP('H'));
+OPCB[0x35]=new Function(gb_CPU_SWAP('L'));
+OPCB[0x36]=new Function(gb_CPU_SWAP('(HL)'));
+OPCB[0x37]=new Function(gb_CPU_SWAP('RA'));
+OPCB[0x38]=function(){ FC=RB&1; RB=RB>>1; FN=0;FH=0;FZ=RB==0; gbCPUTicks=8; }; // SRL n
+OPCB[0x39]=function(){ FC=RC&1; RC=RC>>1; FN=0;FH=0;FZ=RC==0; gbCPUTicks=8; }; // SRL n
+OPCB[0x3A]=function(){ FC=RD&1; RD=RD>>1; FN=0;FH=0;FZ=RD==0; gbCPUTicks=8; }; // SRL n
+OPCB[0x3B]=function(){ FC=RE&1; RE=RE>>1; FN=0;FH=0;FZ=RE==0; gbCPUTicks=8; }; // SRL n
+OPCB[0x3C]=function(){ var H=HL>>8; FC=H&1; H=H>>1; FN=0;FH=0;FZ=H==0; HL=(H<<8)|(HL&0x00FF); gbCPUTicks=8; }; // SRL n
+OPCB[0x3D]=function(){ var L=HL&0xFF; FC=L&1; L=L>>1; FN=0;FH=0;FZ=L==0; HL=(HL&0xFF00)|L; gbCPUTicks=8; }; // SRL n
+OPCB[0x3E]=function(){ var M=MEMR(HL); FC=M&1; M=M>>1; FN=0;FH=0;FZ=M==0; MEMW(HL,M); gbCPUTicks=16; }; // SRL n
+OPCB[0x3F]=function(){ FC=RA&1; RA=RA>>1; FN=0;FH=0;FZ=RA==0; gbCPUTicks=8; }; // SRL n
+
+for (var i=0;i<8;i++) {
+ var o=(1<<6)|(i<<3);
+ // BIT n,r - CB 01 xxx xxx - CB 01 bit reg
+ OPCB[o|7]=new Function("FZ=!(RA&"+(1<<i)+");FN=0;FH=1; gbCPUTicks=8;");
+ MNCB[o|7]=new Function("return 'BIT "+i+",A';");
+ OPCB[o|0]=new Function("FZ=!(RB&"+(1<<i)+");FN=0;FH=1; gbCPUTicks=8;");
+ MNCB[o|0]=new Function("return 'BIT "+i+",B';");
+ OPCB[o|1]=new Function("FZ=!(RC&"+(1<<i)+");FN=0;FH=1; gbCPUTicks=8;");
+ MNCB[o|1]=new Function("return 'BIT "+i+",C';");
+ OPCB[o|2]=new Function("FZ=!(RD&"+(1<<i)+");FN=0;FH=1; gbCPUTicks=8;");
+ MNCB[o|2]=new Function("return 'BIT "+i+",D';");
+ OPCB[o|3]=new Function("FZ=!(RE&"+(1<<i)+");FN=0;FH=1; gbCPUTicks=8;");
+ MNCB[o|3]=new Function("return 'BIT "+i+",E';");
+ OPCB[o|4]=new Function("FZ=!(HL&"+(256<<i)+");FN=0;FH=1; gbCPUTicks=8;");
+ MNCB[o|4]=new Function("return 'BIT "+i+",H';");
+ OPCB[o|5]=new Function("FZ=!(HL&"+(1<<i)+");FN=0;FH=1; gbCPUTicks=8;");
+ MNCB[o|5]=new Function("return 'BIT "+i+",L';");
+ OPCB[o|6]=new Function("FZ=!(MEMR(HL)&"+(1<<i)+");FN=0;FH=1; gbCPUTicks=16;");
+ MNCB[o|6]=new Function("return 'BIT "+i+",(HL)';");
+ // RES n,r - CB 10 xxx xxx - CB 10 bit reg
+ o=(2<<6)|(i<<3);
+ OPCB[o|7]=new Function("RA&="+((~(1<<i))&0xFF)+"; gbCPUTicks=8;");
+ MNCB[o|7]=new Function("return 'RES "+i+",A';");
+ OPCB[o|0]=new Function("RB&="+((~(1<<i))&0xFF)+"; gbCPUTicks=8;");
+ MNCB[o|0]=new Function("return 'RES "+i+",B';");
+ OPCB[o|1]=new Function("RC&="+((~(1<<i))&0xFF)+"; gbCPUTicks=8;");
+ MNCB[o|1]=new Function("return 'RES "+i+",C';");
+ OPCB[o|2]=new Function("RD&="+((~(1<<i))&0xFF)+"; gbCPUTicks=8;");
+ MNCB[o|2]=new Function("return 'RES "+i+",D';");
+ OPCB[o|3]=new Function("RE&="+((~(1<<i))&0xFF)+"; gbCPUTicks=8;");
+ MNCB[o|3]=new Function("return 'RES "+i+",E';");
+ OPCB[o|4]=new Function("HL&="+((~(256<<i))&0xFFFF)+"; gbCPUTicks=8;");
+ MNCB[o|4]=new Function("return 'RES "+i+",H';");
+ OPCB[o|5]=new Function("HL&="+((~(1<<i))&0xFFFF)+"; gbCPUTicks=8;");
+ MNCB[o|5]=new Function("return 'RES "+i+",L';");
+ OPCB[o|6]=new Function("MEMW(HL,MEMR(HL)&"+((~(1<<i))&0xFF)+"); gbCPUTicks=16;");
+ MNCB[o|6]=new Function("return 'RES "+i+",(HL)';");
+ // SET n,r - CB 11 xxx xxx - CB 11 bit reg
+ o=(3<<6)|(i<<3);
+ OPCB[o|7]=new Function("RA|="+(1<<i)+"; gbCPUTicks=8;");
+ MNCB[o|7]=new Function("return 'SET "+i+",A';");
+ OPCB[o|0]=new Function("RB|="+(1<<i)+"; gbCPUTicks=8;");
+ MNCB[o|0]=new Function("return 'SET "+i+",B';");
+ OPCB[o|1]=new Function("RC|="+(1<<i)+"; gbCPUTicks=8;");
+ MNCB[o|1]=new Function("return 'SET "+i+",C';");
+ OPCB[o|2]=new Function("RD|="+(1<<i)+"; gbCPUTicks=8;");
+ MNCB[o|2]=new Function("return 'SET "+i+",D';");
+ OPCB[o|3]=new Function("RE|="+(1<<i)+"; gbCPUTicks=8;");
+ MNCB[o|3]=new Function("return 'SET "+i+",E';");
+ OPCB[o|4]=new Function("HL|="+(256<<i)+"; gbCPUTicks=8;");
+ MNCB[o|4]=new Function("return 'SET "+i+",H';");
+ OPCB[o|5]=new Function("HL|="+(1<<i)+"; gbCPUTicks=8;");
+ MNCB[o|5]=new Function("return 'SET "+i+",L';");
+ OPCB[o|6]=new Function("MEMW(HL,MEMR(HL)|"+(1<<i)+"); gbCPUTicks=16;");
+ MNCB[o|6]=new Function("return 'SET "+i+",(HL)';");
+}
+
+MN[0x01]=function(){ return 'LD BC,0x'+hex4((MEMR(PC+2)<<8)+MEMR(PC+1)); };
+MN[0x00]=function(){ return 'NOP'; };
+MN[0x02]=function(){ return 'LD (BC),A'; };
+MN[0x03]=function(){ return 'INC BC'; };
+MN[0x04]=function(){ return 'INC B'; };
+MN[0x05]=function(){ return 'DEC B'; };
+MN[0x06]=function(){ return 'LD B,0x'+hex2(MEMR(PC+1)); };
+MN[0x07]=function(){ return 'RLCA'; };
+MN[0x08]=function(){ return 'LD(0x'+hex4((MEMR(PC+2)<<8)+MEMR(PC+1))+'),SP'; };
+MN[0x09]=function(){ return 'ADD HL,BC'; };
+MN[0x0A]=function(){ return 'LD A,(BC)'; };
+MN[0x0B]=function(){ return 'DEC BC'; };
+MN[0x0C]=function(){ return 'INC C'; };
+MN[0x0D]=function(){ return 'DEC C'; };
+MN[0x0E]=function(){ return 'LD C,0x'+hex2(MEMR(PC+1)); };
+MN[0x0F]=function(){ return 'RRCA'; };
+MN[0x10]=function(){ return 'STOP'; };
+MN[0x11]=function(){ return 'LD DE,0x'+hex4((MEMR(PC+2)<<8)+MEMR(PC+1)); };
+MN[0x12]=function(){ return 'LD (DE),A'; };
+MN[0x13]=function(){ return 'INC DE'; };
+MN[0x14]=function(){ return 'INC D'; };
+MN[0x15]=function(){ return 'DEC D'; };
+MN[0x16]=function(){ return 'LD D,0x'+hex2(MEMR(PC+1)); };
+MN[0x17]=function(){ return 'RLA'; };
+MN[0x18]=function(){ return 'JR '+sb(MEMR(PC+1))+'; 0x'+hex2(MEMR(PC+1)); };
+MN[0x19]=function(){ return 'ADD HL,DE'; };
+MN[0x1A]=function(){ return 'LD A,(DE)'; };
+MN[0x1B]=function(){ return 'DEC DE'; };
+MN[0x1C]=function(){ return 'INC E'; };
+MN[0x1D]=function(){ return 'DEC E'; };
+MN[0x1E]=function(){ return 'LD E,0x'+hex2(MEMR(PC+1)); };
+MN[0x1F]=function(){ return 'RRA'; };
+MN[0x20]=function(){ return 'JR NZ,'+sb(MEMR(PC+1))+'; 0x'+hex2(MEMR(PC+1)); };
+MN[0x21]=function(){ return 'LD HL,0x'+hex4((MEMR(PC+2)<<8)+MEMR(PC+1)); };
+MN[0x22]=function(){ return 'LDI (HL),A'; };
+MN[0x23]=function(){ return 'INC HL'; };
+MN[0x24]=function(){ return 'INC H'; };
+MN[0x25]=function(){ return 'DEC H'; };
+MN[0x26]=function(){ return 'LD H,0x'+hex2(MEMR(PC+1)); };
+MN[0x27]=function(){ return 'DAA'; };
+MN[0x28]=function(){ return 'JR Z,'+sb(MEMR(PC+1))+'; 0x'+hex2(MEMR(PC+1)); };
+MN[0x29]=function(){ return 'ADD HL,HL'; };
+MN[0x2A]=function(){ return 'LDI A,(HL)'; };
+MN[0x2B]=function(){ return 'DEC HL'; };
+MN[0x2C]=function(){ return 'INC L'; };
+MN[0x2D]=function(){ return 'DEC L'; };
+MN[0x2E]=function(){ return 'LD L,0x'+hex2(MEMR(PC+1)); };
+MN[0x2F]=function(){ return 'CPL'; };
+MN[0x30]=function(){ return 'JR NC,'+sb(MEMR(PC+1))+'; 0x'+hex2(MEMR(PC+1)); };
+MN[0x31]=function(){ return 'LD SP,0x'+hex4((MEMR(PC+2)<<8)+MEMR(PC+1)); };
+MN[0x32]=function(){ return 'LDD (HL),A'; };
+MN[0x33]=function(){ return 'INC SP'; };
+MN[0x34]=function(){ return 'INC (HL)'; };
+MN[0x35]=function(){ return 'DEC (HL)'; };
+MN[0x36]=function(){ return 'LD (HL),0x'+hex2(MEMR(PC+1)); };
+MN[0x37]=function(){ return 'SCF'; };
+MN[0x38]=function(){ return 'JR C,'+sb(MEMR(PC+1))+'; 0x'+hex2(MEMR(PC+1)); };
+MN[0x39]=function(){ return 'ADD HL,SP'; };
+MN[0x3A]=function(){ return 'LDD A,(HL)'; };
+MN[0x3B]=function(){ return 'DEC SP'; };
+MN[0x3C]=function(){ return 'INC A'; };
+MN[0x3D]=function(){ return 'DEC A'; };
+MN[0x3E]=function(){ return 'LD A,0x'+hex2(MEMR(PC+1)); }; // ???
+MN[0x3F]=function(){ return 'CCF'; };
+MN[0x40]=function(){ return 'LD B,B'; };
+MN[0x41]=function(){ return 'LD B,C'; };
+MN[0x42]=function(){ return 'LD B,D'; };
+MN[0x43]=function(){ return 'LD B,E'; };
+MN[0x44]=function(){ return 'LD B,H'; };
+MN[0x45]=function(){ return 'LD B,L'; };
+MN[0x46]=function(){ return 'LD B,(HL)'; };
+MN[0x47]=function(){ return 'LD B,A'; };
+MN[0x48]=function(){ return 'LD C,B'; };
+MN[0x49]=function(){ return 'LD C,C'; };
+MN[0x4A]=function(){ return 'LD C,D'; };
+MN[0x4B]=function(){ return 'LD C,E'; };
+MN[0x4C]=function(){ return 'LD C,H'; };
+MN[0x4D]=function(){ return 'LD C,L'; };
+MN[0x4E]=function(){ return 'LD C,(HL)'; };
+MN[0x4F]=function(){ return 'LD C,A'; };
+MN[0x50]=function(){ return 'LD D,B'; };
+MN[0x51]=function(){ return 'LD D,C'; };
+MN[0x52]=function(){ return 'LD D,D'; };
+MN[0x53]=function(){ return 'LD D,E'; };
+MN[0x54]=function(){ return 'LD D,H'; };
+MN[0x55]=function(){ return 'LD D,L'; };
+MN[0x56]=function(){ return 'LD D,(HL)'; };
+MN[0x57]=function(){ return 'LD D,A'; };
+MN[0x58]=function(){ return 'LD E,B'; };
+MN[0x59]=function(){ return 'LD E,C'; };
+MN[0x5A]=function(){ return 'LD E,D'; };
+MN[0x5B]=function(){ return 'LD E,E'; };
+MN[0x5C]=function(){ return 'LD E,H'; };
+MN[0x5D]=function(){ return 'LD E,L'; };
+MN[0x5E]=function(){ return 'LD E,(HL)'; };
+MN[0x5F]=function(){ return 'LD E,A'; };
+MN[0x60]=function(){ return 'LD H,B'; };
+MN[0x61]=function(){ return 'LD H,C'; };
+MN[0x62]=function(){ return 'LD H,D'; };
+MN[0x63]=function(){ return 'LD H,E'; };
+MN[0x64]=function(){ return 'LD H,H'; };
+MN[0x65]=function(){ return 'LD H,L'; };
+MN[0x66]=function(){ return 'LD H,(HL)'; };
+MN[0x67]=function(){ return 'LD H,A'; };
+MN[0x68]=function(){ return 'LD L,B'; };
+MN[0x69]=function(){ return 'LD L,C'; };
+MN[0x6A]=function(){ return 'LD L,D'; };
+MN[0x6B]=function(){ return 'LD L,E'; };
+MN[0x6C]=function(){ return 'LD L,H'; };
+MN[0x6D]=function(){ return 'LD L,L'; };
+MN[0x6E]=function(){ return 'LD L,(HL)'; };
+MN[0x6F]=function(){ return 'LD L,A'; };
+MN[0x70]=function(){ return 'LD (HL),B'; };
+MN[0x71]=function(){ return 'LD (HL),C'; };
+MN[0x72]=function(){ return 'LD (HL),D'; };
+MN[0x73]=function(){ return 'LD (HL),E'; };
+MN[0x74]=function(){ return 'LD (HL),H'; };
+MN[0x75]=function(){ return 'LD (HL),L'; };
+MN[0x76]=function(){ return 'HALT'; };
+MN[0x77]=function(){ return 'LD (HL),A'; };
+MN[0x78]=function(){ return 'LD A,B'; };
+MN[0x79]=function(){ return 'LD A,C'; };
+MN[0x7A]=function(){ return 'LD A,D'; };
+MN[0x7B]=function(){ return 'LD A,E'; };
+MN[0x7C]=function(){ return 'LD A,H'; };
+MN[0x7D]=function(){ return 'LD A,L'; };
+MN[0x7E]=function(){ return 'LD A,(HL)'; };
+MN[0x7F]=function(){ return 'LD A,A'; };
+MN[0x80]=function(){ return 'ADD A,B'; };
+MN[0x81]=function(){ return 'ADD A,C'; };
+MN[0x82]=function(){ return 'ADD A,D'; };
+MN[0x83]=function(){ return 'ADD A,E'; };
+MN[0x84]=function(){ return 'ADD A,H'; };
+MN[0x85]=function(){ return 'ADD A,L'; };
+MN[0x86]=function(){ return 'ADD A,(HL)'; };
+MN[0x87]=function(){ return 'ADD A,A'; };
+MN[0x88]=function(){ return 'ADC A,B'; };
+MN[0x89]=function(){ return 'ADC A,C'; };
+MN[0x8A]=function(){ return 'ADC A,D'; };
+MN[0x8B]=function(){ return 'ADC A,E'; };
+MN[0x8C]=function(){ return 'ADC A,H'; };
+MN[0x8D]=function(){ return 'ADC A,L'; };
+MN[0x8E]=function(){ return 'ADC A,(HL)'; };
+MN[0x8F]=function(){ return 'ADC A,A'; };
+MN[0x90]=function(){ return 'SUB B'; };
+MN[0x91]=function(){ return 'SUB C'; };
+MN[0x92]=function(){ return 'SUB D'; };
+MN[0x93]=function(){ return 'SUB E'; };
+MN[0x94]=function(){ return 'SUB H'; };
+MN[0x95]=function(){ return 'SUB L'; };
+MN[0x96]=function(){ return 'SUB (HL)'; };
+MN[0x97]=function(){ return 'SUB A'; };
+MN[0x98]=function(){ return 'SBC A,B'; };
+MN[0x99]=function(){ return 'SBC A,C'; };
+MN[0x9A]=function(){ return 'SBC A,D'; };
+MN[0x9B]=function(){ return 'SBC A,E'; };
+MN[0x9C]=function(){ return 'SBC A,H'; };
+MN[0x9D]=function(){ return 'SBC A,L'; };
+MN[0x9E]=function(){ return 'SBC A,(HL)'; };
+MN[0x9F]=function(){ return 'SBC A,A'; };
+MN[0xA0]=function(){ return 'AND B'; };
+MN[0xA1]=function(){ return 'AND C'; };
+MN[0xA2]=function(){ return 'AND D'; };
+MN[0xA3]=function(){ return 'AND E'; };
+MN[0xA4]=function(){ return 'AND H'; };
+MN[0xA5]=function(){ return 'AND L'; };
+MN[0xA6]=function(){ return 'AND (HL)'; };
+MN[0xA7]=function(){ return 'AND A'; };
+MN[0xA8]=function(){ return 'XOR B'; };
+MN[0xA9]=function(){ return 'XOR C'; };
+MN[0xAA]=function(){ return 'XOR D'; };
+MN[0xAB]=function(){ return 'XOR E'; };
+MN[0xAC]=function(){ return 'XOR H'; };
+MN[0xAD]=function(){ return 'XOR L'; };
+MN[0xAE]=function(){ return 'XOR (HL)'; };
+MN[0xAF]=function(){ return 'XOR A'; };
+MN[0xB0]=function(){ return 'OR B'; };
+MN[0xB1]=function(){ return 'OR C'; };
+MN[0xB2]=function(){ return 'OR D'; };
+MN[0xB3]=function(){ return 'OR E'; };
+MN[0xB4]=function(){ return 'OR H'; };
+MN[0xB5]=function(){ return 'OR L'; };
+MN[0xB6]=function(){ return 'OR (HL)'; };
+MN[0xB7]=function(){ return 'OR A'; };
+MN[0xB8]=function(){ return 'CP B'; };
+MN[0xB9]=function(){ return 'CP C'; };
+MN[0xBA]=function(){ return 'CP D'; };
+MN[0xBB]=function(){ return 'CP E'; };
+MN[0xBC]=function(){ return 'CP H'; };
+MN[0xBD]=function(){ return 'CP L'; };
+MN[0xBE]=function(){ return 'CP (HL)'; };
+MN[0xBF]=function(){ return 'CP A'; };
+MN[0xC0]=function(){ return 'RET NZ'; };
+MN[0xC1]=function(){ return 'POP BC'; };
+MN[0xC2]=function(){ return 'JP NZ,0x'+hex(MEMR(PC+1)|(MEMR(PC+2)<<8)); };
+MN[0xC3]=function(){ return 'JP 0x'+hex(MEMR(PC+1)|(MEMR(PC+2)<<8)); };
+MN[0xC4]=function(){ return 'CALL NZ,0x'+hex(MEMR(PC+1)|(MEMR(PC+2)<<8)); };
+MN[0xC5]=function(){ return 'PUSH BC'; };
+MN[0xC6]=function(){ return 'ADD A,0x'+hex2(MEMR(PC+1)); };
+MN[0xC7]=function(){ return 'RST 0x00'; };
+MN[0xC8]=function(){ return 'RET Z'; };
+MN[0xC9]=function(){ return 'RET'; };
+MN[0xCA]=function(){ return 'JP Z,0x'+hex(MEMR(PC+1)|(MEMR(PC+2)<<8)); };
+MN[0xCB]=function(){ return MNCB[MEMR(PC+1)](); };
+MN[0xCC]=function(){ return 'CALL Z,0x'+hex(MEMR(PC+1)|(MEMR(PC+2)<<8)); };
+MN[0xCD]=function(){ return 'CALL 0x'+hex(MEMR(PC+1)|(MEMR(PC+2)<<8)); };
+MN[0xCE]=function(){ return 'ADC A,0x'+hex2(MEMR(PC+1)); };
+MN[0xCF]=function(){ return 'RST 0x08'; };
+MN[0xD0]=function(){ return 'RET NC'; };
+MN[0xD1]=function(){ return 'POP DE'; };
+MN[0xD2]=function(){ return 'JP NC,0x'+hex(MEMR(PC+1)|(MEMR(PC+2)<<8)); };
+MN[0xD4]=function(){ return 'CALL NC,0x'+hex(MEMR(PC+1)|(MEMR(PC+2)<<8)); };
+MN[0xD5]=function(){ return 'PUSH DE'; };
+MN[0xD6]=function(){ return 'SUB 0x'+hex2(MEMR(PC+1)); };
+MN[0xD7]=function(){ return 'RST 0x10'; };
+MN[0xD8]=function(){ return 'RET C'; };
+MN[0xD9]=function(){ return 'RETI'; };
+MN[0xDA]=function(){ return 'JP C,0x'+hex(MEMR(PC+1)|(MEMR(PC+2)<<8)); };
+MN[0xDC]=function(){ return 'CALL C,0x'+hex(MEMR(PC+1)|(MEMR(PC+2)<<8)); };
+MN[0xDE]=function(){ return 'SBC A,0x'+hex2(MEMR(PC+1)); };
+MN[0xDF]=function(){ return 'RST 0x18'; };
+MN[0xE0]=function(){ return 'LD (0xFF00+0x'+hex2(MEMR(PC+1))+'),A'; };
+MN[0xE1]=function(){ return 'POP HL'; };
+MN[0xE2]=function(){ return 'LD (0xFF00+C),A'; };
+MN[0xE5]=function(){ return 'PUSH HL'; };
+MN[0xE6]=function(){ return 'AND 0x'+hex2(MEMR(PC+1)); };
+MN[0xE7]=function(){ return 'RST 0x20'; };
+MN[0xE8]=function(){ return 'ADD SP,0x'+hex2(MEMR(PC+1)); };
+MN[0xE9]=function(){ return 'JP (HL)'; };
+MN[0xEA]=function(){ return 'LD (0x'+hex((MEMR(PC+2)<<8)|MEMR(PC+1),4)+'),A'; };
+MN[0xEE]=function(){ return 'XOR 0x'+hex2(MEMR(PC+1)); };
+MN[0xEF]=function(){ return 'RST 0x28'; };
+MN[0xF0]=function(){ return 'LD A,(0xFF00+0x'+hex2(MEMR(PC+1))+')'; };
+MN[0xF1]=function(){ return 'POP AF'; };
+MN[0xF2]=function(){ return 'LD A,(0xFF00+C)'; };
+MN[0xF3]=function(){ return 'DI'; };
+MN[0xF5]=function(){ return 'PUSH AF'; };
+MN[0xF6]=function(){ return 'OR 0x'+hex2(MEMR(PC+1)); };
+MN[0xF7]=function(){ return 'RST 0x30'; };
+MN[0xF8]=function(){ return 'LD HL,SP+0x'+hex2(MEMR(PC+1)); };
+MN[0xF9]=function(){ return 'LD SP,HL'; };
+MN[0xFA]=function(){ return 'LD A,(0x'+hex4((MEMR(PC+2)<<8)+MEMR(PC+1))+')'; };
+MN[0xFB]=function(){ return 'EI'; };
+MN[0xFE]=function(){ return 'CP '+MEMR(PC+1)+'; 0x'+hex2(MEMR(PC+1)); };
+MN[0xFF]=function(){ return 'RST 0x38'; };
+
+MNCB[0x00]=function(){ return 'RLC B'; };
+MNCB[0x01]=function(){ return 'RLC C'; };
+MNCB[0x02]=function(){ return 'RLC D'; };
+MNCB[0x03]=function(){ return 'RLC E'; };
+MNCB[0x04]=function(){ return 'RLC H'; };
+MNCB[0x05]=function(){ return 'RLC L'; };
+MNCB[0x06]=function(){ return 'RLC (HL)'; };
+MNCB[0x07]=function(){ return 'RLC A'; };
+MNCB[0x08]=function(){ return 'RRC B'; };
+MNCB[0x09]=function(){ return 'RRC C'; };
+MNCB[0x0A]=function(){ return 'RRC D'; };
+MNCB[0x0B]=function(){ return 'RRC E'; };
+MNCB[0x0C]=function(){ return 'RRC H'; };
+MNCB[0x0D]=function(){ return 'RRC L'; };
+MNCB[0x0E]=function(){ return 'RRC (HL)'; };
+MNCB[0x0F]=function(){ return 'RRC A'; };
+MNCB[0x10]=function(){ return 'RL B'; };
+MNCB[0x11]=function(){ return 'RL C'; };
+MNCB[0x12]=function(){ return 'RL D'; };
+MNCB[0x13]=function(){ return 'RL E'; };
+MNCB[0x14]=function(){ return 'RL H'; };
+MNCB[0x15]=function(){ return 'RL L'; };
+MNCB[0x16]=function(){ return 'RL (HL)'; };
+MNCB[0x17]=function(){ return 'RL A'; };
+MNCB[0x18]=function(){ return 'RR B'; };
+MNCB[0x19]=function(){ return 'RR C'; };
+MNCB[0x1A]=function(){ return 'RR D'; };
+MNCB[0x1B]=function(){ return 'RR E'; };
+MNCB[0x1C]=function(){ return 'RR H'; };
+MNCB[0x1D]=function(){ return 'RR L'; };
+MNCB[0x1E]=function(){ return 'RR (HL)'; };
+MNCB[0x1F]=function(){ return 'RR A'; };
+MNCB[0x20]=function(){ return 'SLA B'; };
+MNCB[0x21]=function(){ return 'SLA C'; };
+MNCB[0x22]=function(){ return 'SLA D'; };
+MNCB[0x23]=function(){ return 'SLA E'; };
+MNCB[0x24]=function(){ return 'SLA H'; };
+MNCB[0x25]=function(){ return 'SLA L'; };
+MNCB[0x26]=function(){ return 'SLA (HL)'; };
+MNCB[0x27]=function(){ return 'SLA A'; };
+MNCB[0x28]=function(){ return 'SRA B'; };
+MNCB[0x29]=function(){ return 'SRA C'; };
+MNCB[0x2A]=function(){ return 'SRA D'; };
+MNCB[0x2B]=function(){ return 'SRA E'; };
+MNCB[0x2C]=function(){ return 'SRA H'; };
+MNCB[0x2D]=function(){ return 'SRA L'; };
+MNCB[0x2E]=function(){ return 'SRA (HL)'; };
+MNCB[0x2F]=function(){ return 'SRA A'; };
+MNCB[0x30]=function(){ return 'SWAP B'; };
+MNCB[0x31]=function(){ return 'SWAP C'; };
+MNCB[0x32]=function(){ return 'SWAP D'; };
+MNCB[0x33]=function(){ return 'SWAP E'; };
+MNCB[0x34]=function(){ return 'SWAP H'; };
+MNCB[0x35]=function(){ return 'SWAP L'; };
+MNCB[0x36]=function(){ return 'SWAP (HL)'; };
+MNCB[0x37]=function(){ return 'SWAP A'; };
+MNCB[0x38]=function(){ return 'SRL B'; };
+MNCB[0x39]=function(){ return 'SRL C'; };
+MNCB[0x3A]=function(){ return 'SRL D'; };
+MNCB[0x3B]=function(){ return 'SRL E'; };
+MNCB[0x3C]=function(){ return 'SRL H'; };
+MNCB[0x3D]=function(){ return 'SRL L'; };
+MNCB[0x3E]=function(){ return 'SRL (HL)'; };
+MNCB[0x3F]=function(){ return 'SRL A'; };
+
+function gb_Init_CPU() {
+ gbPause = true;
+ RA=0x01; // 0x01->GB/SGB; 0xFF->GBP; 0x11->GBC
+ FZ=0x01; // F=0xB0->Z1 N0 H1 C1
+ FN=0x00;
+ FH=0x01;
+ FC=0x01;
+ RB=0x00;
+ RC=0x13;
+ RD=0x00;
+ RE=0xD8;
+ PC=0x0100;
+ SP=0xFFFE;
+ HL=0x014D;
+ gbCPUTicks=0;
+}
+
+var gbDAATable= [ // DDA code from VisualBoyAdvance
+ 0x0080,0x0100,0x0200,0x0300,0x0400,0x0500,0x0600,0x0700,
+ 0x0800,0x0900,0x1020,0x1120,0x1220,0x1320,0x1420,0x1520,
+ 0x1000,0x1100,0x1200,0x1300,0x1400,0x1500,0x1600,0x1700,
+ 0x1800,0x1900,0x2020,0x2120,0x2220,0x2320,0x2420,0x2520,
+ 0x2000,0x2100,0x2200,0x2300,0x2400,0x2500,0x2600,0x2700,
+ 0x2800,0x2900,0x3020,0x3120,0x3220,0x3320,0x3420,0x3520,
+ 0x3000,0x3100,0x3200,0x3300,0x3400,0x3500,0x3600,0x3700,
+ 0x3800,0x3900,0x4020,0x4120,0x4220,0x4320,0x4420,0x4520,
+ 0x4000,0x4100,0x4200,0x4300,0x4400,0x4500,0x4600,0x4700,
+ 0x4800,0x4900,0x5020,0x5120,0x5220,0x5320,0x5420,0x5520,
+ 0x5000,0x5100,0x5200,0x5300,0x5400,0x5500,0x5600,0x5700,
+ 0x5800,0x5900,0x6020,0x6120,0x6220,0x6320,0x6420,0x6520,
+ 0x6000,0x6100,0x6200,0x6300,0x6400,0x6500,0x6600,0x6700,
+ 0x6800,0x6900,0x7020,0x7120,0x7220,0x7320,0x7420,0x7520,
+ 0x7000,0x7100,0x7200,0x7300,0x7400,0x7500,0x7600,0x7700,
+ 0x7800,0x7900,0x8020,0x8120,0x8220,0x8320,0x8420,0x8520,
+ 0x8000,0x8100,0x8200,0x8300,0x8400,0x8500,0x8600,0x8700,
+ 0x8800,0x8900,0x9020,0x9120,0x9220,0x9320,0x9420,0x9520,
+ 0x9000,0x9100,0x9200,0x9300,0x9400,0x9500,0x9600,0x9700,
+ 0x9800,0x9900,0x00B0,0x0130,0x0230,0x0330,0x0430,0x0530,
+ 0x0090,0x0110,0x0210,0x0310,0x0410,0x0510,0x0610,0x0710,
+ 0x0810,0x0910,0x1030,0x1130,0x1230,0x1330,0x1430,0x1530,
+ 0x1010,0x1110,0x1210,0x1310,0x1410,0x1510,0x1610,0x1710,
+ 0x1810,0x1910,0x2030,0x2130,0x2230,0x2330,0x2430,0x2530,
+ 0x2010,0x2110,0x2210,0x2310,0x2410,0x2510,0x2610,0x2710,
+ 0x2810,0x2910,0x3030,0x3130,0x3230,0x3330,0x3430,0x3530,
+ 0x3010,0x3110,0x3210,0x3310,0x3410,0x3510,0x3610,0x3710,
+ 0x3810,0x3910,0x4030,0x4130,0x4230,0x4330,0x4430,0x4530,
+ 0x4010,0x4110,0x4210,0x4310,0x4410,0x4510,0x4610,0x4710,
+ 0x4810,0x4910,0x5030,0x5130,0x5230,0x5330,0x5430,0x5530,
+ 0x5010,0x5110,0x5210,0x5310,0x5410,0x5510,0x5610,0x5710,
+ 0x5810,0x5910,0x6030,0x6130,0x6230,0x6330,0x6430,0x6530,
+ 0x6010,0x6110,0x6210,0x6310,0x6410,0x6510,0x6610,0x6710,
+ 0x6810,0x6910,0x7030,0x7130,0x7230,0x7330,0x7430,0x7530,
+ 0x7010,0x7110,0x7210,0x7310,0x7410,0x7510,0x7610,0x7710,
+ 0x7810,0x7910,0x8030,0x8130,0x8230,0x8330,0x8430,0x8530,
+ 0x8010,0x8110,0x8210,0x8310,0x8410,0x8510,0x8610,0x8710,
+ 0x8810,0x8910,0x9030,0x9130,0x9230,0x9330,0x9430,0x9530,
+ 0x9010,0x9110,0x9210,0x9310,0x9410,0x9510,0x9610,0x9710,
+ 0x9810,0x9910,0xA030,0xA130,0xA230,0xA330,0xA430,0xA530,
+ 0xA010,0xA110,0xA210,0xA310,0xA410,0xA510,0xA610,0xA710,
+ 0xA810,0xA910,0xB030,0xB130,0xB230,0xB330,0xB430,0xB530,
+ 0xB010,0xB110,0xB210,0xB310,0xB410,0xB510,0xB610,0xB710,
+ 0xB810,0xB910,0xC030,0xC130,0xC230,0xC330,0xC430,0xC530,
+ 0xC010,0xC110,0xC210,0xC310,0xC410,0xC510,0xC610,0xC710,
+ 0xC810,0xC910,0xD030,0xD130,0xD230,0xD330,0xD430,0xD530,
+ 0xD010,0xD110,0xD210,0xD310,0xD410,0xD510,0xD610,0xD710,
+ 0xD810,0xD910,0xE030,0xE130,0xE230,0xE330,0xE430,0xE530,
+ 0xE010,0xE110,0xE210,0xE310,0xE410,0xE510,0xE610,0xE710,
+ 0xE810,0xE910,0xF030,0xF130,0xF230,0xF330,0xF430,0xF530,
+ 0xF010,0xF110,0xF210,0xF310,0xF410,0xF510,0xF610,0xF710,
+ 0xF810,0xF910,0x00B0,0x0130,0x0230,0x0330,0x0430,0x0530,
+ 0x0090,0x0110,0x0210,0x0310,0x0410,0x0510,0x0610,0x0710,
+ 0x0810,0x0910,0x1030,0x1130,0x1230,0x1330,0x1430,0x1530,
+ 0x1010,0x1110,0x1210,0x1310,0x1410,0x1510,0x1610,0x1710,
+ 0x1810,0x1910,0x2030,0x2130,0x2230,0x2330,0x2430,0x2530,
+ 0x2010,0x2110,0x2210,0x2310,0x2410,0x2510,0x2610,0x2710,
+ 0x2810,0x2910,0x3030,0x3130,0x3230,0x3330,0x3430,0x3530,
+ 0x3010,0x3110,0x3210,0x3310,0x3410,0x3510,0x3610,0x3710,
+ 0x3810,0x3910,0x4030,0x4130,0x4230,0x4330,0x4430,0x4530,
+ 0x4010,0x4110,0x4210,0x4310,0x4410,0x4510,0x4610,0x4710,
+ 0x4810,0x4910,0x5030,0x5130,0x5230,0x5330,0x5430,0x5530,
+ 0x5010,0x5110,0x5210,0x5310,0x5410,0x5510,0x5610,0x5710,
+ 0x5810,0x5910,0x6030,0x6130,0x6230,0x6330,0x6430,0x6530,
+ 0x0600,0x0700,0x0800,0x0900,0x0A00,0x0B00,0x0C00,0x0D00,
+ 0x0E00,0x0F00,0x1020,0x1120,0x1220,0x1320,0x1420,0x1520,
+ 0x1600,0x1700,0x1800,0x1900,0x1A00,0x1B00,0x1C00,0x1D00,
+ 0x1E00,0x1F00,0x2020,0x2120,0x2220,0x2320,0x2420,0x2520,
+ 0x2600,0x2700,0x2800,0x2900,0x2A00,0x2B00,0x2C00,0x2D00,
+ 0x2E00,0x2F00,0x3020,0x3120,0x3220,0x3320,0x3420,0x3520,
+ 0x3600,0x3700,0x3800,0x3900,0x3A00,0x3B00,0x3C00,0x3D00,
+ 0x3E00,0x3F00,0x4020,0x4120,0x4220,0x4320,0x4420,0x4520,
+ 0x4600,0x4700,0x4800,0x4900,0x4A00,0x4B00,0x4C00,0x4D00,
+ 0x4E00,0x4F00,0x5020,0x5120,0x5220,0x5320,0x5420,0x5520,
+ 0x5600,0x5700,0x5800,0x5900,0x5A00,0x5B00,0x5C00,0x5D00,
+ 0x5E00,0x5F00,0x6020,0x6120,0x6220,0x6320,0x6420,0x6520,
+ 0x6600,0x6700,0x6800,0x6900,0x6A00,0x6B00,0x6C00,0x6D00,
+ 0x6E00,0x6F00,0x7020,0x7120,0x7220,0x7320,0x7420,0x7520,
+ 0x7600,0x7700,0x7800,0x7900,0x7A00,0x7B00,0x7C00,0x7D00,
+ 0x7E00,0x7F00,0x8020,0x8120,0x8220,0x8320,0x8420,0x8520,
+ 0x8600,0x8700,0x8800,0x8900,0x8A00,0x8B00,0x8C00,0x8D00,
+ 0x8E00,0x8F00,0x9020,0x9120,0x9220,0x9320,0x9420,0x9520,
+ 0x9600,0x9700,0x9800,0x9900,0x9A00,0x9B00,0x9C00,0x9D00,
+ 0x9E00,0x9F00,0x00B0,0x0130,0x0230,0x0330,0x0430,0x0530,
+ 0x0610,0x0710,0x0810,0x0910,0x0A10,0x0B10,0x0C10,0x0D10,
+ 0x0E10,0x0F10,0x1030,0x1130,0x1230,0x1330,0x1430,0x1530,
+ 0x1610,0x1710,0x1810,0x1910,0x1A10,0x1B10,0x1C10,0x1D10,
+ 0x1E10,0x1F10,0x2030,0x2130,0x2230,0x2330,0x2430,0x2530,
+ 0x2610,0x2710,0x2810,0x2910,0x2A10,0x2B10,0x2C10,0x2D10,
+ 0x2E10,0x2F10,0x3030,0x3130,0x3230,0x3330,0x3430,0x3530,
+ 0x3610,0x3710,0x3810,0x3910,0x3A10,0x3B10,0x3C10,0x3D10,
+ 0x3E10,0x3F10,0x4030,0x4130,0x4230,0x4330,0x4430,0x4530,
+ 0x4610,0x4710,0x4810,0x4910,0x4A10,0x4B10,0x4C10,0x4D10,
+ 0x4E10,0x4F10,0x5030,0x5130,0x5230,0x5330,0x5430,0x5530,
+ 0x5610,0x5710,0x5810,0x5910,0x5A10,0x5B10,0x5C10,0x5D10,
+ 0x5E10,0x5F10,0x6030,0x6130,0x6230,0x6330,0x6430,0x6530,
+ 0x6610,0x6710,0x6810,0x6910,0x6A10,0x6B10,0x6C10,0x6D10,
+ 0x6E10,0x6F10,0x7030,0x7130,0x7230,0x7330,0x7430,0x7530,
+ 0x7610,0x7710,0x7810,0x7910,0x7A10,0x7B10,0x7C10,0x7D10,
+ 0x7E10,0x7F10,0x8030,0x8130,0x8230,0x8330,0x8430,0x8530,
+ 0x8610,0x8710,0x8810,0x8910,0x8A10,0x8B10,0x8C10,0x8D10,
+ 0x8E10,0x8F10,0x9030,0x9130,0x9230,0x9330,0x9430,0x9530,
+ 0x9610,0x9710,0x9810,0x9910,0x9A10,0x9B10,0x9C10,0x9D10,
+ 0x9E10,0x9F10,0xA030,0xA130,0xA230,0xA330,0xA430,0xA530,
+ 0xA610,0xA710,0xA810,0xA910,0xAA10,0xAB10,0xAC10,0xAD10,
+ 0xAE10,0xAF10,0xB030,0xB130,0xB230,0xB330,0xB430,0xB530,
+ 0xB610,0xB710,0xB810,0xB910,0xBA10,0xBB10,0xBC10,0xBD10,
+ 0xBE10,0xBF10,0xC030,0xC130,0xC230,0xC330,0xC430,0xC530,
+ 0xC610,0xC710,0xC810,0xC910,0xCA10,0xCB10,0xCC10,0xCD10,
+ 0xCE10,0xCF10,0xD030,0xD130,0xD230,0xD330,0xD430,0xD530,
+ 0xD610,0xD710,0xD810,0xD910,0xDA10,0xDB10,0xDC10,0xDD10,
+ 0xDE10,0xDF10,0xE030,0xE130,0xE230,0xE330,0xE430,0xE530,
+ 0xE610,0xE710,0xE810,0xE910,0xEA10,0xEB10,0xEC10,0xED10,
+ 0xEE10,0xEF10,0xF030,0xF130,0xF230,0xF330,0xF430,0xF530,
+ 0xF610,0xF710,0xF810,0xF910,0xFA10,0xFB10,0xFC10,0xFD10,
+ 0xFE10,0xFF10,0x00B0,0x0130,0x0230,0x0330,0x0430,0x0530,
+ 0x0610,0x0710,0x0810,0x0910,0x0A10,0x0B10,0x0C10,0x0D10,
+ 0x0E10,0x0F10,0x1030,0x1130,0x1230,0x1330,0x1430,0x1530,
+ 0x1610,0x1710,0x1810,0x1910,0x1A10,0x1B10,0x1C10,0x1D10,
+ 0x1E10,0x1F10,0x2030,0x2130,0x2230,0x2330,0x2430,0x2530,
+ 0x2610,0x2710,0x2810,0x2910,0x2A10,0x2B10,0x2C10,0x2D10,
+ 0x2E10,0x2F10,0x3030,0x3130,0x3230,0x3330,0x3430,0x3530,
+ 0x3610,0x3710,0x3810,0x3910,0x3A10,0x3B10,0x3C10,0x3D10,
+ 0x3E10,0x3F10,0x4030,0x4130,0x4230,0x4330,0x4430,0x4530,
+ 0x4610,0x4710,0x4810,0x4910,0x4A10,0x4B10,0x4C10,0x4D10,
+ 0x4E10,0x4F10,0x5030,0x5130,0x5230,0x5330,0x5430,0x5530,
+ 0x5610,0x5710,0x5810,0x5910,0x5A10,0x5B10,0x5C10,0x5D10,
+ 0x5E10,0x5F10,0x6030,0x6130,0x6230,0x6330,0x6430,0x6530,
+ 0x00C0,0x0140,0x0240,0x0340,0x0440,0x0540,0x0640,0x0740,
+ 0x0840,0x0940,0x0440,0x0540,0x0640,0x0740,0x0840,0x0940,
+ 0x1040,0x1140,0x1240,0x1340,0x1440,0x1540,0x1640,0x1740,
+ 0x1840,0x1940,0x1440,0x1540,0x1640,0x1740,0x1840,0x1940,
+ 0x2040,0x2140,0x2240,0x2340,0x2440,0x2540,0x2640,0x2740,
+ 0x2840,0x2940,0x2440,0x2540,0x2640,0x2740,0x2840,0x2940,
+ 0x3040,0x3140,0x3240,0x3340,0x3440,0x3540,0x3640,0x3740,
+ 0x3840,0x3940,0x3440,0x3540,0x3640,0x3740,0x3840,0x3940,
+ 0x4040,0x4140,0x4240,0x4340,0x4440,0x4540,0x4640,0x4740,
+ 0x4840,0x4940,0x4440,0x4540,0x4640,0x4740,0x4840,0x4940,
+ 0x5040,0x5140,0x5240,0x5340,0x5440,0x5540,0x5640,0x5740,
+ 0x5840,0x5940,0x5440,0x5540,0x5640,0x5740,0x5840,0x5940,
+ 0x6040,0x6140,0x6240,0x6340,0x6440,0x6540,0x6640,0x6740,
+ 0x6840,0x6940,0x6440,0x6540,0x6640,0x6740,0x6840,0x6940,
+ 0x7040,0x7140,0x7240,0x7340,0x7440,0x7540,0x7640,0x7740,
+ 0x7840,0x7940,0x7440,0x7540,0x7640,0x7740,0x7840,0x7940,
+ 0x8040,0x8140,0x8240,0x8340,0x8440,0x8540,0x8640,0x8740,
+ 0x8840,0x8940,0x8440,0x8540,0x8640,0x8740,0x8840,0x8940,
+ 0x9040,0x9140,0x9240,0x9340,0x9440,0x9540,0x9640,0x9740,
+ 0x9840,0x9940,0x3450,0x3550,0x3650,0x3750,0x3850,0x3950,
+ 0x4050,0x4150,0x4250,0x4350,0x4450,0x4550,0x4650,0x4750,
+ 0x4850,0x4950,0x4450,0x4550,0x4650,0x4750,0x4850,0x4950,
+ 0x5050,0x5150,0x5250,0x5350,0x5450,0x5550,0x5650,0x5750,
+ 0x5850,0x5950,0x5450,0x5550,0x5650,0x5750,0x5850,0x5950,
+ 0x6050,0x6150,0x6250,0x6350,0x6450,0x6550,0x6650,0x6750,
+ 0x6850,0x6950,0x6450,0x6550,0x6650,0x6750,0x6850,0x6950,
+ 0x7050,0x7150,0x7250,0x7350,0x7450,0x7550,0x7650,0x7750,
+ 0x7850,0x7950,0x7450,0x7550,0x7650,0x7750,0x7850,0x7950,
+ 0x8050,0x8150,0x8250,0x8350,0x8450,0x8550,0x8650,0x8750,
+ 0x8850,0x8950,0x8450,0x8550,0x8650,0x8750,0x8850,0x8950,
+ 0x9050,0x9150,0x9250,0x9350,0x9450,0x9550,0x9650,0x9750,
+ 0x9850,0x9950,0x9450,0x9550,0x9650,0x9750,0x9850,0x9950,
+ 0xA050,0xA150,0xA250,0xA350,0xA450,0xA550,0xA650,0xA750,
+ 0xA850,0xA950,0xA450,0xA550,0xA650,0xA750,0xA850,0xA950,
+ 0xB050,0xB150,0xB250,0xB350,0xB450,0xB550,0xB650,0xB750,
+ 0xB850,0xB950,0xB450,0xB550,0xB650,0xB750,0xB850,0xB950,
+ 0xC050,0xC150,0xC250,0xC350,0xC450,0xC550,0xC650,0xC750,
+ 0xC850,0xC950,0xC450,0xC550,0xC650,0xC750,0xC850,0xC950,
+ 0xD050,0xD150,0xD250,0xD350,0xD450,0xD550,0xD650,0xD750,
+ 0xD850,0xD950,0xD450,0xD550,0xD650,0xD750,0xD850,0xD950,
+ 0xE050,0xE150,0xE250,0xE350,0xE450,0xE550,0xE650,0xE750,
+ 0xE850,0xE950,0xE450,0xE550,0xE650,0xE750,0xE850,0xE950,
+ 0xF050,0xF150,0xF250,0xF350,0xF450,0xF550,0xF650,0xF750,
+ 0xF850,0xF950,0xF450,0xF550,0xF650,0xF750,0xF850,0xF950,
+ 0x00D0,0x0150,0x0250,0x0350,0x0450,0x0550,0x0650,0x0750,
+ 0x0850,0x0950,0x0450,0x0550,0x0650,0x0750,0x0850,0x0950,
+ 0x1050,0x1150,0x1250,0x1350,0x1450,0x1550,0x1650,0x1750,
+ 0x1850,0x1950,0x1450,0x1550,0x1650,0x1750,0x1850,0x1950,
+ 0x2050,0x2150,0x2250,0x2350,0x2450,0x2550,0x2650,0x2750,
+ 0x2850,0x2950,0x2450,0x2550,0x2650,0x2750,0x2850,0x2950,
+ 0x3050,0x3150,0x3250,0x3350,0x3450,0x3550,0x3650,0x3750,
+ 0x3850,0x3950,0x3450,0x3550,0x3650,0x3750,0x3850,0x3950,
+ 0x4050,0x4150,0x4250,0x4350,0x4450,0x4550,0x4650,0x4750,
+ 0x4850,0x4950,0x4450,0x4550,0x4650,0x4750,0x4850,0x4950,
+ 0x5050,0x5150,0x5250,0x5350,0x5450,0x5550,0x5650,0x5750,
+ 0x5850,0x5950,0x5450,0x5550,0x5650,0x5750,0x5850,0x5950,
+ 0x6050,0x6150,0x6250,0x6350,0x6450,0x6550,0x6650,0x6750,
+ 0x6850,0x6950,0x6450,0x6550,0x6650,0x6750,0x6850,0x6950,
+ 0x7050,0x7150,0x7250,0x7350,0x7450,0x7550,0x7650,0x7750,
+ 0x7850,0x7950,0x7450,0x7550,0x7650,0x7750,0x7850,0x7950,
+ 0x8050,0x8150,0x8250,0x8350,0x8450,0x8550,0x8650,0x8750,
+ 0x8850,0x8950,0x8450,0x8550,0x8650,0x8750,0x8850,0x8950,
+ 0x9050,0x9150,0x9250,0x9350,0x9450,0x9550,0x9650,0x9750,
+ 0x9850,0x9950,0x9450,0x9550,0x9650,0x9750,0x9850,0x9950,
+ 0xFA60,0xFB60,0xFC60,0xFD60,0xFE60,0xFF60,0x00C0,0x0140,
+ 0x0240,0x0340,0x0440,0x0540,0x0640,0x0740,0x0840,0x0940,
+ 0x0A60,0x0B60,0x0C60,0x0D60,0x0E60,0x0F60,0x1040,0x1140,
+ 0x1240,0x1340,0x1440,0x1540,0x1640,0x1740,0x1840,0x1940,
+ 0x1A60,0x1B60,0x1C60,0x1D60,0x1E60,0x1F60,0x2040,0x2140,
+ 0x2240,0x2340,0x2440,0x2540,0x2640,0x2740,0x2840,0x2940,
+ 0x2A60,0x2B60,0x2C60,0x2D60,0x2E60,0x2F60,0x3040,0x3140,
+ 0x3240,0x3340,0x3440,0x3540,0x3640,0x3740,0x3840,0x3940,
+ 0x3A60,0x3B60,0x3C60,0x3D60,0x3E60,0x3F60,0x4040,0x4140,
+ 0x4240,0x4340,0x4440,0x4540,0x4640,0x4740,0x4840,0x4940,
+ 0x4A60,0x4B60,0x4C60,0x4D60,0x4E60,0x4F60,0x5040,0x5140,
+ 0x5240,0x5340,0x5440,0x5540,0x5640,0x5740,0x5840,0x5940,
+ 0x5A60,0x5B60,0x5C60,0x5D60,0x5E60,0x5F60,0x6040,0x6140,
+ 0x6240,0x6340,0x6440,0x6540,0x6640,0x6740,0x6840,0x6940,
+ 0x6A60,0x6B60,0x6C60,0x6D60,0x6E60,0x6F60,0x7040,0x7140,
+ 0x7240,0x7340,0x7440,0x7540,0x7640,0x7740,0x7840,0x7940,
+ 0x7A60,0x7B60,0x7C60,0x7D60,0x7E60,0x7F60,0x8040,0x8140,
+ 0x8240,0x8340,0x8440,0x8540,0x8640,0x8740,0x8840,0x8940,
+ 0x8A60,0x8B60,0x8C60,0x8D60,0x8E60,0x8F60,0x9040,0x9140,
+ 0x9240,0x9340,0x3450,0x3550,0x3650,0x3750,0x3850,0x3950,
+ 0x3A70,0x3B70,0x3C70,0x3D70,0x3E70,0x3F70,0x4050,0x4150,
+ 0x4250,0x4350,0x4450,0x4550,0x4650,0x4750,0x4850,0x4950,
+ 0x4A70,0x4B70,0x4C70,0x4D70,0x4E70,0x4F70,0x5050,0x5150,
+ 0x5250,0x5350,0x5450,0x5550,0x5650,0x5750,0x5850,0x5950,
+ 0x5A70,0x5B70,0x5C70,0x5D70,0x5E70,0x5F70,0x6050,0x6150,
+ 0x6250,0x6350,0x6450,0x6550,0x6650,0x6750,0x6850,0x6950,
+ 0x6A70,0x6B70,0x6C70,0x6D70,0x6E70,0x6F70,0x7050,0x7150,
+ 0x7250,0x7350,0x7450,0x7550,0x7650,0x7750,0x7850,0x7950,
+ 0x7A70,0x7B70,0x7C70,0x7D70,0x7E70,0x7F70,0x8050,0x8150,
+ 0x8250,0x8350,0x8450,0x8550,0x8650,0x8750,0x8850,0x8950,
+ 0x8A70,0x8B70,0x8C70,0x8D70,0x8E70,0x8F70,0x9050,0x9150,
+ 0x9250,0x9350,0x9450,0x9550,0x9650,0x9750,0x9850,0x9950,
+ 0x9A70,0x9B70,0x9C70,0x9D70,0x9E70,0x9F70,0xA050,0xA150,
+ 0xA250,0xA350,0xA450,0xA550,0xA650,0xA750,0xA850,0xA950,
+ 0xAA70,0xAB70,0xAC70,0xAD70,0xAE70,0xAF70,0xB050,0xB150,
+ 0xB250,0xB350,0xB450,0xB550,0xB650,0xB750,0xB850,0xB950,
+ 0xBA70,0xBB70,0xBC70,0xBD70,0xBE70,0xBF70,0xC050,0xC150,
+ 0xC250,0xC350,0xC450,0xC550,0xC650,0xC750,0xC850,0xC950,
+ 0xCA70,0xCB70,0xCC70,0xCD70,0xCE70,0xCF70,0xD050,0xD150,
+ 0xD250,0xD350,0xD450,0xD550,0xD650,0xD750,0xD850,0xD950,
+ 0xDA70,0xDB70,0xDC70,0xDD70,0xDE70,0xDF70,0xE050,0xE150,
+ 0xE250,0xE350,0xE450,0xE550,0xE650,0xE750,0xE850,0xE950,
+ 0xEA70,0xEB70,0xEC70,0xED70,0xEE70,0xEF70,0xF050,0xF150,
+ 0xF250,0xF350,0xF450,0xF550,0xF650,0xF750,0xF850,0xF950,
+ 0xFA70,0xFB70,0xFC70,0xFD70,0xFE70,0xFF70,0x00D0,0x0150,
+ 0x0250,0x0350,0x0450,0x0550,0x0650,0x0750,0x0850,0x0950,
+ 0x0A70,0x0B70,0x0C70,0x0D70,0x0E70,0x0F70,0x1050,0x1150,
+ 0x1250,0x1350,0x1450,0x1550,0x1650,0x1750,0x1850,0x1950,
+ 0x1A70,0x1B70,0x1C70,0x1D70,0x1E70,0x1F70,0x2050,0x2150,
+ 0x2250,0x2350,0x2450,0x2550,0x2650,0x2750,0x2850,0x2950,
+ 0x2A70,0x2B70,0x2C70,0x2D70,0x2E70,0x2F70,0x3050,0x3150,
+ 0x3250,0x3350,0x3450,0x3550,0x3650,0x3750,0x3850,0x3950,
+ 0x3A70,0x3B70,0x3C70,0x3D70,0x3E70,0x3F70,0x4050,0x4150,
+ 0x4250,0x4350,0x4450,0x4550,0x4650,0x4750,0x4850,0x4950,
+ 0x4A70,0x4B70,0x4C70,0x4D70,0x4E70,0x4F70,0x5050,0x5150,
+ 0x5250,0x5350,0x5450,0x5550,0x5650,0x5750,0x5850,0x5950,
+ 0x5A70,0x5B70,0x5C70,0x5D70,0x5E70,0x5F70,0x6050,0x6150,
+ 0x6250,0x6350,0x6450,0x6550,0x6650,0x6750,0x6850,0x6950,
+ 0x6A70,0x6B70,0x6C70,0x6D70,0x6E70,0x6F70,0x7050,0x7150,
+ 0x7250,0x7350,0x7450,0x7550,0x7650,0x7750,0x7850,0x7950,
+ 0x7A70,0x7B70,0x7C70,0x7D70,0x7E70,0x7F70,0x8050,0x8150,
+ 0x8250,0x8350,0x8450,0x8550,0x8650,0x8750,0x8850,0x8950,
+ 0x8A70,0x8B70,0x8C70,0x8D70,0x8E70,0x8F70,0x9050,0x9150,
+ 0x9250,0x9350,0x9450,0x9550,0x9650,0x9750,0x9850,0x9950];
+
+
+
+
+/*
+ * jsgb.debugger.js v0.02 - Memory module for JSGB, a GameBoy Emulator
+ * Copyright (C) 2009 Pedro Ladaria <Sonic1980 at Gmail dot com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ * The full license is available at http://www.gnu.org/licenses/gpl.html
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+var gbMemory = new Array(0x10000);
+
+// special register mirror values and bit states
+var gbRegLY = 0;
+var gbRegLYC = 0;
+var gbRegSCY = 0;
+var gbRegSCX = 0;
+var gbRegWY = 0;
+var gbRegWX = 0;
+var gbRegDIV = 0;
+var gbRegIF = 0;
+var gbRegIE = 0;
+var gbRegSTAT_Mode = 0;
+var gbRegSTAT_IntLYLYC = false;
+var gbRegSTAT_IntMode2 = false;
+var gbRegSTAT_IntMode1 = false;
+var gbRegSTAT_IntMode0 = false;
+
+var gbRegLCDC_DisplayOn = false;
+var gbRegLCDC_WindowYOffs = 0;
+var gbRegLCDC_WindowDisplay = false;
+var gbRegLCDC_SpriteDisplay = false;
+var gbRegLCDC_SpriteSize = false;
+var gbRegLCDC_BackgroundYOffs = 0;
+var gbRegLCDC_BackgroundXOffs = 0;
+var gbRegLCDC_BgAndWinDisplay = false;
+var gbRegTAC_TimerOn = false;
+
+// special register addresses
+var _P1_ = 0xFF00;
+var _SC_ = 0xFF02;
+var _DIV_ = 0xFF04;
+var _TIMA_ = 0xFF05;
+var _TMA_ = 0xFF06;
+var _TAC_ = 0xFF07;
+var _IF_ = 0xFF0F;
+var _LCDC_ = 0xFF40;
+var _STAT_ = 0xFF41;
+var _SCY_ = 0xFF42;
+var _SCX_ = 0xFF43;
+var _LY_ = 0xFF44;
+var _LYC_ = 0xFF45;
+var _DMA_ = 0xFF46;
+var _BGP_ = 0xFF47;
+var _OBP0_ = 0xFF48;
+var _OBP1_ = 0xFF49;
+var _WY_ = 0xFF4A;
+var _WX_ = 0xFF4B;
+var _IE_ = 0xFFFF;
+
+// start addresses
+var _ROM0_ = 0x0000;
+var _ROM1_ = 0x4000;
+var _VRAM_ = 0x8000; // video RAM
+var _BTD0_ = 0x8000; // backgroun tile data 0
+var _BTD1_ = 0x8800; // backgroun tile data 1
+var _BTM0_ = 0x9800; // background tile map 0
+var _BTM1_ = 0x9C00; // background tile map 1
+var _RAM1_ = 0xA000; // switchable RAM
+var _RAM0_ = 0xC000; // internal RAM
+var _ECHO_ = 0xE000; // echo of internal RAM
+var _OAM_ = 0xFE00; // object attribute
+
+function gb_Memory_Read_ROM_Only(a) {
+ return gbMemory[a];
+}
+
+function gb_Memory_Read_MBC1_ROM(a) {
+ switch (a>>12) {
+ case 0:
+ case 1:
+ case 2:
+ case 3: return gbMemory[a];
+ case 4:
+ case 5:
+ case 6:
+ case 7: return gbROM[gbROMBank1offs+a];
+ default: return gbMemory[a];
+ }
+}
+
+var MEMR = gb_Memory_Read_ROM_Only;
+
+function MEMW(a,v) {
+ // Special registers+HRAM
+ if (a>=0xFF00) {
+ switch(a&0xFF) {
+ case 0x00: // FF00 P1 Joypad
+ //if(v==3)gbMemory[a]=0xF0; else // Fx->GB/GBP; 3x->SGB
+ gb_Read_Joypad(v);
+ return;
+ case 0x02: // FF02 SC
+ gbMemory[0xFF02]=0;
+ return;
+ case 0x04: // FF04 DIV
+ gbMemory[0xFF04]=0; // Writing any value sets it to 0.
+ return;
+ case 0x07: // FF07 TAC - TIMER CONTROL
+ gbMemory[0xFF07]=v;
+ gbRegTAC_TimerOn=((v&4)!=0);
+ gb_Set_Timer_Freq(v&3);
+ return;
+ case 0x0F: // FF0F IF - Interrupt Flags
+ gbMemory[0xFF0F]=gbRegIF=(v&31);
+ return;
+ case 0x40: // FF40 LCDC
+ var i=((v>>7)!=0);
+ if (i!=gbRegLCDC_DisplayOn) {
+ // TODO not sure on this
+ gbMemory[_LY_]=gbRegLY=gbLCDTicks=0;
+ //if (!i) gb_Clear_Framebuffer();
+ }
+ gbRegLCDC_DisplayOn=i;
+ gbRegLCDC_WindowYOffs=(v&64)?256:0;
+ gbRegLCDC_WindowDisplay=(v&32)?true:false;
+ gbRegLCDC_BackgroundXOffs=(v&16)?0:256;
+ gbRegLCDC_BackgroundYOffs=(v&8)?256:0;
+ gbRegLCDC_SpriteSize=(v&4)?16:8;
+ gbRegLCDC_SpriteDisplay=(v&2)?true:false;
+ gbRegLCDC_BgAndWinDisplay=(v&1)?true:false;
+ gbMemory[0xFF40]=v;
+ return;
+ case 0x41: // FF41 STAT
+ gbRegSTAT_Mode=v&3;
+ gbRegSTAT_IntLYLYC=(v&64)?true:false;
+ gbRegSTAT_IntMode2=(v&32)?true:false;
+ gbRegSTAT_IntMode1=(v&16)?true:false;
+ gbRegSTAT_IntMode0=(v&8)?true:false;
+ gbMemory[0xFF41]=v;
+ return;
+ case 0x42: // FF42 SCY
+ gbMemory[0xFF42]=gbRegSCY=v;
+ return;
+ case 0x43: // FF43 SCX
+ gbMemory[0xFF43]=gbRegSCX=v;
+ return;
+ case 0x44: // FF44 LY
+ gbMemory[0xFF44]=gbRegLY=0; // Writing any value sets it to 0.
+ return;
+ case 0x45: // FF45 LYC
+ gbMemory[0xFF45]=gbRegLYC=v;
+ return;
+ case 0x46: // FF46 DMA TRANSFER
+ v=v<<8; // start address of DMA
+ a=0xFE00; // OAM addr
+ while (a<0xFEA0) gbMemory[a++] = MEMR(v++);
+ return;
+ case 0x47: // FF47 BGP - Background Palette
+ gbMemory[0xFF47]=v;
+ gbBackPal[0]=v&3;
+ gbBackPal[1]=(v>>2)&3;
+ gbBackPal[2]=(v>>4)&3;
+ gbBackPal[3]=(v>>6)&3;
+ return;
+ case 0x48: // FF48 OBP0 - Sprite Palette 0
+ gbMemory[0xFF48]=v;
+ gbSpritePal[0][0]=v&3;
+ gbSpritePal[0][1]=(v>>2)&3;
+ gbSpritePal[0][2]=(v>>4)&3;
+ gbSpritePal[0][3]=(v>>6)&3;
+ return;
+ case 0x49: // FF49 OBP1 - Sprite Palette 1
+ gbMemory[0xFF49]=v;
+ gbSpritePal[1][0]=v&3;
+ gbSpritePal[1][1]=(v>>2)&3;
+ gbSpritePal[1][2]=(v>>4)&3;
+ gbSpritePal[1][3]=(v>>6)&3;
+ return;
+ case 0x4A: // FF4A WY
+ gbMemory[0xFF4A]=gbRegWY=v;
+ return;
+ case 0x4B: // FF4B WX
+ gbMemory[0xFF4B]=gbRegWX=v;
+ return;
+ case 0xFF: // FFFF IE - Interrupt Enable
+ gbMemory[0xFFFF]=gbRegIE=(v&31);
+ return;
+ default: // THE OTHERS
+ gbMemory[a]=v;
+ return;
+ }
+ }
+ // writing to ROM?
+ else if (a<0x8000) {
+
+ switch (gbCartridgeType) {
+
+ case _ROM_ONLY_:
+ return;
+
+ case _ROM_MBC1_:
+ switch (a>>12) {
+ // write to 2000-3FFF: select ROM bank
+ case 2:
+ case 3:
+ //$('STATUS').innerHTML='Select ROM Bank: '+(v&31);
+ gbROMBankSwitch(v&31);
+ return;
+ // write to 6000-7FFF: select MBC1 mode
+ case 6:
+ case 7:
+ gbMBC1Mode = v&1;
+ return;
+ // unhandled cases
+ default:
+ //$('STATUS').innerHTML='Unhandled MBC1 ROM write:\naddr: '+hex4(a)+' - val: '+hex2(v);
+ return;
+ }
+ default:
+ alert('Unknown Memory Bank Controller.\naddr: '+hex4(a)+' - val: '+hex2(v));
+ gb_Pause();
+ return;
+ }
+ }
+ // make changes if the new value is different
+ else if (gbMemory[a]!=v) {
+ // 8000-97FF: Tile data
+ if (a<0x9800) {
+ gbUpdateTiles=true;
+ gbUpdateTilesList[(a-0x8000)>>4]=true;
+ gbMemory[a]=v;
+ }
+ // 9800-9FFF: Tile maps
+ else if (a<0xA000) {
+ gbUpdateBackground=true;
+ gbUpdateBackgroundTileList[a-0x9800]=true;
+ gbMemory[a]=v;
+ }
+ // A000-BFFF: Switchable RAM
+ else if (a<0xC000) {
+ gbMemory[a]=v;
+ }
+ // C000-DFFF: Internal RAM
+ else if (a<0xE000) {
+ gbMemory[a]=v;
+ // C000-DDFF: Writes to ECHO
+ if (a<0xDE00) gbMemory[a+0x2000]=v;
+ }
+ // E000-FDFF: ECHO
+ else if (a<0xFE00) {
+ gbMemory[a]=v;
+ gbMemory[a-0x2000]=v;
+ }
+ else gbMemory[a]=v;
+ }
+}
+
+function where_mem(a) { // TODO rewrite this
+ if (a<0x4000) return 'ROM0'; else
+ if (a<0x8000) return 'ROM1'; else
+ if (a<0xA000) return 'VRAM'; else
+ if (a<0xC000) return 'RAM1'; else
+ if (a<0xE000) return 'RAM0'; else
+ if (a<0xFE00) return 'ECHO'; else
+ if (a<0xFEA0) return 'OAM&nbsp;'; else
+ if (a<0xFF00) return 'I/O&nbsp;'; else
+ if (a<0xFF4C) return 'I/O&nbsp;'; else
+ if (a<0xFF80) return 'I/O&nbsp;'; else
+ if (a<0xFFFF) return 'HRAM'; else
+ if (a=0xFFFF) return 'IE&nbsp;&nbsp;'; else
+ return '&nbsp;&nbsp;&nbsp;&nbsp;';
+}
+
+function gb_Init_Memory() {
+ var i=0x100000;
+ while (i) {
+ gbMemory[--i] = 0;
+ gbMemory[--i] = 0;
+ gbMemory[--i] = 0;
+ gbMemory[--i] = 0;
+ }
+ MEMW(0xFF00,0xFF); // P1
+ MEMW(0xFF04,0xAF); // DIV
+ MEMW(0xFF05,0x00); // TIMA
+ MEMW(0xFF06,0x00); // TMA
+ MEMW(0xFF07,0xF8); // TAC
+ MEMW(0xFF0F,0x00); // IF
+ MEMW(0xFF10,0x80); // NR10
+ MEMW(0xFF11,0xBF); // NR11
+ MEMW(0xFF12,0xF3); // NR12
+ MEMW(0xFF14,0xBF); // NR14
+ MEMW(0xFF16,0x3F); // NR21
+ MEMW(0xFF17,0x00); // NR22
+ MEMW(0xFF19,0xBF); // NR24
+ MEMW(0xFF1A,0x7F); // NR30
+ MEMW(0xFF1B,0xFF); // NR31
+ MEMW(0xFF1C,0x9F); // NR32
+ MEMW(0xFF1E,0xBF); // NR33
+ MEMW(0xFF20,0xFF); // NR41
+ MEMW(0xFF21,0x00); // NR42
+ MEMW(0xFF22,0x00); // NR43
+ MEMW(0xFF23,0xBF); // NR30
+ MEMW(0xFF24,0x77); // NR50
+ MEMW(0xFF25,0xF3); // NR51
+ MEMW(0xFF26,0xF1); // NR52 0xF1->GB; 0xF0->SGB
+ MEMW(0xFF40,0x91); // LCDC
+ MEMW(0xFF42,0x00); // SCY
+ MEMW(0xFF43,0x00); // SCX
+ MEMW(0xFF44,0x00); // LY
+ MEMW(0xFF45,0x00); // LYC
+ MEMW(0xFF47,0xFC); // BGP
+ MEMW(0xFF48,0xFF); // OBP0
+ MEMW(0xFF49,0xFF); // OBP1
+ MEMW(0xFF4A,0x00); // WY
+ MEMW(0xFF4B,0x00); // WX
+ MEMW(0xFFFF,0x00); // IE
+}
+
+
+
+
+/*
+ * jsgb.rom.js v0.01 - ROM loader for JSGB, a GameBoy Emulator
+ * Copyright (C) 2009 Pedro Ladaria <Sonic1980 at Gmail dot com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ * The full license is available at http://www.gnu.org/licenses/gpl.html
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+var gbROM = [];
+var gbCartridgeType = 0;
+var gbBankSwitchCount = 0;
+
+var _ROM_ONLY_ = 0x00;
+var _ROM_MBC1_ = 0x01;
+
+var gbMBC1Mode = 0;
+
+var gbROMBank1offs = 0;
+
+var gbCartridgeType = 0;
+var gbCartridgeTypes = [];
+gbCartridgeTypes[0] = 'ROM only';
+gbCartridgeTypes[1] = 'ROM+MBC1';
+
+var gbROMBanks = []; // 1 Bank = 16 KBytes = 256 Kbits
+gbROMBanks[0x00] = 2;
+gbROMBanks[0x01] = 4;
+gbROMBanks[0x02] = 8;
+gbROMBanks[0x03] = 16;
+gbROMBanks[0x04] = 32;
+gbROMBanks[0x05] = 64;
+gbROMBanks[0x06] = 128;
+gbROMBanks[0x52] = 72;
+gbROMBanks[0x53] = 80;
+gbROMBanks[0x54] = 96;
+
+var gbRAMBanks = [];
+gbRAMBanks[0] = 0;
+gbRAMBanks[1] = 1;
+gbRAMBanks[2] = 2; // ? docs say 1
+gbRAMBanks[3] = 4;
+gbRAMBanks[4] = 16;
+
+var gbROMInfo = {};
+
+function gb_ROM_Load(fileName) {
+ gbBankSwitchCount = 0;
+ gbROM = [];
+ var i = 0;
+ var req = new XMLHttpRequest();
+ req.open('GET', fileName, false);
+ req.overrideMimeType('text/plain; charset=x-user-defined');
+ req.send(null);
+ if ((req.readyState==4)/*&&(req.status==200)*/) {
+ var s=req.responseText;
+ i=s.length;
+ while (i--) gbROM[i]=s.charCodeAt(i)&0xff;
+ i=0x8000;
+ while (i--) gbMemory[i]=gbROM[i]; // copy 2 banks into memory
+ }
+ else {
+ alert('Error loading ROM: '+fileName);
+ }
+ // ROM and RAM banks
+ gbROMInfo.ROMBanks = gbROMBanks[gbROM[0x148]];
+ gbROMInfo.RAMBanks = gbRAMBanks[gbROM[0x149]];
+ // ROM name
+ var s = gbROM.slice(0x0134,0x0143);
+ gbROMInfo.Name = '';
+ for (var i=0; i<16; i++) {
+ if (s[i]==0) break;
+ gbROMInfo.Name+=String.fromCharCode(s[i]);
+ }
+ // Cartridge type
+ gbROMInfo.CartridgeType = gbCartridgeType = gbROM[0x147];
+ // Set MEMR function
+ switch (gbROMInfo.CartridgeType) {
+ case _ROM_ONLY_:
+ MEMR = gb_Memory_Read_ROM_Only;
+ break;
+ case _ROM_MBC1_:
+ MEMR = gb_Memory_Read_MBC1_ROM;
+ gbMBC1Mode = 0;
+ break;
+ }
+
+}
+
+function gbROMBankSwitch(bank) {
+ gbBankSwitchCount++;
+ gbROMBank1offs = (bank==0)?0:(--bank*0x4000); // new ROM Bank 1 address
+ /*
+ var i = (0x4000>>5)+1; // loops count
+ var j = 0x4000-1; // write address
+ var k = (bank==0)?((0x4000)-1):((bank*0x4000)-1); // read address
+ while (--i) {
+ gbMemory[++j]=gbROM[++k]; gbMemory[++j]=gbROM[++k];
+ gbMemory[++j]=gbROM[++k]; gbMemory[++j]=gbROM[++k];
+ gbMemory[++j]=gbROM[++k]; gbMemory[++j]=gbROM[++k];
+ gbMemory[++j]=gbROM[++k]; gbMemory[++j]=gbROM[++k];
+ //8
+ gbMemory[++j]=gbROM[++k]; gbMemory[++j]=gbROM[++k];
+ gbMemory[++j]=gbROM[++k]; gbMemory[++j]=gbROM[++k];
+ gbMemory[++j]=gbROM[++k]; gbMemory[++j]=gbROM[++k];
+ gbMemory[++j]=gbROM[++k]; gbMemory[++j]=gbROM[++k];
+ //16
+ gbMemory[++j]=gbROM[++k]; gbMemory[++j]=gbROM[++k];
+ gbMemory[++j]=gbROM[++k]; gbMemory[++j]=gbROM[++k];
+ gbMemory[++j]=gbROM[++k]; gbMemory[++j]=gbROM[++k];
+ gbMemory[++j]=gbROM[++k]; gbMemory[++j]=gbROM[++k];
+ //24
+ gbMemory[++j]=gbROM[++k]; gbMemory[++j]=gbROM[++k];
+ gbMemory[++j]=gbROM[++k]; gbMemory[++j]=gbROM[++k];
+ gbMemory[++j]=gbROM[++k]; gbMemory[++j]=gbROM[++k];
+ gbMemory[++j]=gbROM[++k]; gbMemory[++j]=gbROM[++k];
+ //32
+ }
+ */
+}
+
+
+/*
+ MBC1 (Memory Bank Controller 1)
+
+ MBC1 has two different maximum memory modes:
+ 16Mbit ROM/8KByte RAM
+ 4Mbit ROM/32KByte RAM.
+
+ The MBC1 defaults to 16Mbit ROM/8KByte RAM mode
+ on power up.
+
+ Writing a value (XXXXXXXS - X = Don't
+ care, S = Memory model select) into 6000-7FFF area
+ will select the memory model to use.
+
+ S = 0 selects 16/8 mode. -> default
+ S = 1 selects 4/32 mode.
+
+ Writing a value (XXXBBBBB - X = Don't cares, B =
+ bank select bits) into 2000-3FFF area will select
+ an appropriate ROM bank at 4000-7FFF. Values of 0
+ and 1 do the same thing and point to ROM bank 1.
+
+ Rom bank 0 is not accessible from 4000-7FFF and can
+ only be read from 0000-3FFF.
+
+ If memory model is set to 4/32: [1]
+ Writing a value (XXXXXXBB - X = Don't care, B =
+ bank select bits) into 4000-5FFF area will select
+ an appropriate RAM bank at A000-C000. Before you
+ can read or write to a RAM bank you have to enable
+ it by writing a XXXX1010 into 0000-1FFF area*.
+
+ To disable RAM bank operations write any value but
+ XXXX1010 into 0000-1FFF area.
+ Disabling a RAM bank probably protects that bank from false writes
+ during power down of the GameBoy. (NOTE: Nintendo
+ suggests values $0A to enable and $00 to disable
+ RAM bank!!)
+
+ If memory model is set to 16/8 mode: [0]
+ Writing a value (XXXXXXBB - X = Don't care, B =
+ bank select bits) into 4000-5FFF area will set the
+ two most significant ROM address lines.
+
+ * NOTE: The Super Smart Card doesn't require this
+ operation because it's RAM bank is ALWAYS enabled.
+ Include this operation anyway to allow your code
+ to work with both.
+*/
+
+
+
+/*
+ * jsgb.interrupts.js v0.02 - Interrupt handling for JSGB, a GameBoy Emulator
+ * Copyright (C) 2009 Pedro Ladaria <Sonic1980 at Gmail dot com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ * The full license is available at http://www.gnu.org/licenses/gpl.html
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+var gbInterrupts = [];
+
+function gb_Int_VBlank() { // IF/IE bit 0
+ gbIME=gbHalt=false;
+ MEMW(_IF_,gbRegIF&0xFE); // reset IF bit 0
+ MEMW(--SP,PC>>8);
+ MEMW(--SP,PC&0xFF);
+ PC=0x0040;
+ gbCPUTicks+=32;
+}
+
+function gb_Int_STAT() { // IF/IE bit 1
+ gbIME=gbHalt=false;
+ MEMW(_IF_,gbRegIF&0xFD); // reset IF bit 1
+ MEMW(--SP,PC>>8);
+ MEMW(--SP,PC&0xFF);
+ PC=0x0048;
+ gbCPUTicks+=32;
+}
+
+function gb_Int_Timer() { // IF/IE bit 2
+ gbIME=gbHalt=false;
+ MEMW(_IF_,gbRegIF&0xFB); // reset IF bit 2
+ MEMW(--SP,PC>>8);
+ MEMW(--SP,PC&0xFF);
+ PC=0x0050;
+ gbCPUTicks+=32;
+}
+
+function gb_Int_Serial() { // IF/IE bit 3
+ gbIME=gbHalt=false;
+ MEMW(_IF_,gbRegIF&0xF7); // reset IF bit 3
+ MEMW(--SP,PC>>8);
+ MEMW(--SP,PC&0xFF);
+ PC=0x0058;
+ gbCPUTicks+=32;
+}
+
+function gb_Int_Buttons() { // IF/IE bit 4
+ gbIME=gbHalt=false;
+ MEMW(_IF_,gbRegIF&0xEF); // reset IF bit 4
+ MEMW(--SP,PC>>8);
+ MEMW(--SP,PC&0xFF);
+ PC=0x0060;
+ gbCPUTicks+=32;
+}
+
+function gb_Init_Interrupts() {
+ gbIME=gbHalt=false;
+ for (var i=0; i<32; i++) {
+ if (i&1) gbInterrupts[i] = gb_Int_VBlank; else
+ if (i&2) gbInterrupts[i] = gb_Int_STAT; else
+ if (i&4) gbInterrupts[i] = gb_Int_Timer; else
+ if (i&8) gbInterrupts[i] = gb_Int_Serial; else
+ if (i&16)gbInterrupts[i] = gb_Int_Buttons; else
+ gbInterrupts[i] = function(){};
+ }
+}
+
+
+
+/*
+ * jsgb.input.js v0.02 - buttons input module for JSGB, a JS GameBoy Emulator
+ * Copyright (C) 2009 Pedro Ladaria <Sonic1980 at Gmail dot com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ * The full license is available at http://www.gnu.org/licenses/gpl.html
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+var gbPin14=0; // up down left right
+var gbPin15=0; // start select a b
+
+function gb_Read_Joypad(v) {
+ switch ((v>>4)&3) {
+ case 0: gbMemory[_P1_]=gbPin14 & gbPin15; return; // TODO not sure on this
+ case 1: gbMemory[_P1_]=gbPin15; return;
+ case 2: gbMemory[_P1_]=gbPin14; return;
+ case 3: gbMemory[_P1_]=0xFF; return; // TODO not sure on this
+ }
+}
+
+function gb_OnKeyDown_Event(e) {
+ //$('DEBUG').innerHTML=document.title=e.which;
+ switch (e.which) {
+ // down
+ case 40: gbPin14&=0xF7; MEMW(_IF_,gbRegIF|16); e.preventDefault(); return;
+ // up
+ case 38: gbPin14&=0xFB; MEMW(_IF_,gbRegIF|16); e.preventDefault(); return;
+ // left
+ case 37: gbPin14&=0xFD; MEMW(_IF_,gbRegIF|16); e.preventDefault(); return;
+ // right
+ case 39: gbPin14&=0xFE; MEMW(_IF_,gbRegIF|16); e.preventDefault(); return;
+ // start
+ case 65: gbPin15&=0xF7; MEMW(_IF_,gbRegIF|16); e.preventDefault(); return;
+ // select
+ case 83: gbPin15&=0xFB; MEMW(_IF_,gbRegIF|16); e.preventDefault(); return;
+ // button B
+ case 90: gbPin15&=0xFD; MEMW(_IF_,gbRegIF|16); e.preventDefault(); return;
+ // button A
+ case 88: gbPin15&=0xFE; MEMW(_IF_,gbRegIF|16); e.preventDefault(); return;
+ }
+}
+
+function gb_OnKeyUp_Event(e) {
+ switch (e.which) {
+ // down
+ case 40: gbPin14|=8; MEMW(_IF_,gbRegIF|16); e.preventDefault(); return;
+ // up
+ case 38: gbPin14|=4; MEMW(_IF_,gbRegIF|16); e.preventDefault(); return;
+ // left
+ case 37: gbPin14|=2; MEMW(_IF_,gbRegIF|16); e.preventDefault(); return;
+ // right
+ case 39: gbPin14|=1; MEMW(_IF_,gbRegIF|16); e.preventDefault(); return;
+ // start
+ case 65: gbPin15|=8; MEMW(_IF_,gbRegIF|16); e.preventDefault(); return;
+ // select
+ case 83: gbPin15|=4; MEMW(_IF_,gbRegIF|16); e.preventDefault(); return;
+ // button B
+ case 90: gbPin15|=2; MEMW(_IF_,gbRegIF|16); e.preventDefault(); return;
+ // button A
+ case 88: gbPin15|=1; MEMW(_IF_,gbRegIF|16); e.preventDefault(); return;
+ }
+}
+
+function gb_Init_Input() {
+ document.onkeydown = gb_OnKeyDown_Event;
+ document.onkeyup = gb_OnKeyUp_Event;
+ gbPin14=0xEF;
+ gbPin15=0xDF;
+}
+
+
+
+
+/*
+ * jsgb.lcd.js v0.02 - LCD controller emulation for JSGB, a JS GameBoy Emulator
+ * Copyright (C) 2009 Pedro Ladaria <Sonic1980 at Gmail dot com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ * The full license is available at http://www.gnu.org/licenses/gpl.html
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+var gbTileData = []; // tile data arrays
+var gbBackgroundData = [];
+var gbLCDObj; // LCD Object
+var gbLCDCtx; // LCD Context
+var gbFrameBuffer = [];
+var gbLCDImage; // LCD canvas image
+var gbLCDImageData; // LCD canvas image data
+//var gbLCDScanline; // LCD canvas scanline
+//var gbScanlineData = []; // Scanline data in GB memory
+var gbFPS = 0; // Frames per second counter
+var gbEndFrame = false;
+var gbCurrentWinLine=0;
+
+var gbUpdateTiles = false;
+var gbUpdateTilesList = [];
+var gbUpdateBackground = false
+var gbUpdateBackgroundTileList = [];
+var gbUpdateBackgroundDataList = [];
+
+var gbBackPal = []; // BGP pallete - initialized in jsgb.memory.js
+var gbSpritePal = [[],[]]; // palettes OBP0 and OBP1 - for sprites
+var gbColors = [[0xEF,0xFF,0xDE],[0xAD,0xD7,0x94],
+ [0x52,0x92,0x73],[0x18,0x34,0x42]];
+
+function gb_Update_Tile_Data() {
+ var tda = 0; // tile data addr
+ var line = 0; // line (2 bytes)
+ var j = 0;
+ // loop tiles and redraw if needed
+ for (var i=0;i<384;i++) if (gbUpdateTilesList[i]) {
+ tda=0x8000+i*16;
+ for (j=0; j<8; j++) { // loop 8 lines
+ line = gbMemory[tda++];
+ line|= gbMemory[tda++] << 8;
+ gbTileData[i][j][0] = ((line & 0x8080) + 0x3FFF) >> 14;
+ gbTileData[i][j][1] = ((line & 0x4040) + 0x1FFF) >> 13;
+ gbTileData[i][j][2] = ((line & 0x2020) + 0x0FFF) >> 12;
+ gbTileData[i][j][3] = ((line & 0x1010) + 0x07FF) >> 11;
+ gbTileData[i][j][4] = ((line & 0x0808) + 0x03FF) >> 10;
+ gbTileData[i][j][5] = ((line & 0x0404) + 0x01FF) >> 9;
+ gbTileData[i][j][6] = ((line & 0x0202) + 0x00FF) >> 8;
+ gbTileData[i][j][7] = ((line & 0x0101) + 0x007F) >> 7;
+ }
+ // mark this tile for update in gb_Update_Background()
+ gbUpdateBackgroundDataList[i] = gbUpdateBackground = true;
+ gbUpdateTilesList[i] = false;
+ }
+ gbUpdateTiles=false;
+}
+
+function gb_Update_Background() {
+/*
+ This function draws 4 background buffers in a single array,
+ one for every combination of source tile maps and tile data addresses.
+
+ A tile is painted only if tile map or tile data has changed. It knows that
+ looking at arrays gbUpdateBackgroundDataList and gbUpdateBackgroundTileList.
+ These arrays are updated when writing to VRAM:
+ - 8000-97FF: Tile data
+ - 9800-9FFF: Tile maps
+
+ +----------+----------+
+ | | |
+ | Map0 | Map0 |
+ | Tile0 | Tile1 |
+ | | |
+ +----------+----------+
+ | | |
+ | Map1 | Map1 |
+ | Tile0 | Tile1 |
+ | | |
+ +----------+----------+
+
+ Map and Tile addresses can be switched in LCDC register.
+
+ Map0 = tile map starting at 0x9800
+ Map1 = tile map starting at 0x9C00
+ Tile0 = tile data index at 0x8000+i (i=unsigned byte)
+ Tile1 = tile data index at 0x8800+i (i=signed byte)
+
+ Tile0 and Tile1 share 128 indexes:
+ _______________________________
+ Tile0 -> [_______________________________]_______________
+ Tile1 -> [_______________________________]
+ Tile index -> 0···············128·············256·············384
+
+ This way the GameBoy can access 384 different tiles using a byte index.
+*/
+ var tile0 = 0; // tile index for tiledata at 8000+(unsigned byte)
+ var tile1 = 0; // tile index for tiledata at 8800+(signed byte)
+ var x = 0;
+ var y = 0;
+ var z = 0;
+ var dy = 0;
+ var addr = 0x9800;
+ var tileline;
+ var backline;
+
+ for (var i=0;i<2048;i++) {
+ tile0 = gbMemory[addr++];
+ tile1 = 256+sb(tile0);
+ if (gbUpdateBackgroundTileList[i] || gbUpdateBackgroundDataList[tile0]) {
+ dy = 8;
+ while (dy--) {
+ z = x;
+ tileline=gbTileData[tile0][dy];
+ backline=gbBackgroundData[y+dy];
+ backline[z++] = tileline[0];
+ backline[z++] = tileline[1];
+ backline[z++] = tileline[2];
+ backline[z++] = tileline[3];
+ backline[z++] = tileline[4];
+ backline[z++] = tileline[5];
+ backline[z++] = tileline[6];
+ backline[z++] = tileline[7];
+ }
+ }
+ if (gbUpdateBackgroundTileList[i] || gbUpdateBackgroundDataList[tile1]) {
+ dy = 8;
+ while (dy--) {
+ z = 256+x;
+ tileline = gbTileData[tile1][dy];
+ backline = gbBackgroundData[y+dy];
+ backline[z++] = tileline[0];
+ backline[z++] = tileline[1];
+ backline[z++] = tileline[2];
+ backline[z++] = tileline[3];
+ backline[z++] = tileline[4];
+ backline[z++] = tileline[5];
+ backline[z++] = tileline[6];
+ backline[z++] = tileline[7];
+ }
+ }
+ gbUpdateBackgroundTileList[i] = false;
+ if ((x+=8)>=256) { x=0; y+=8; }
+ }
+ for (i=0;i<384;i++) gbUpdateBackgroundDataList[i]=false;
+ gbUpdateBackground = false;
+}
+
+function gb_Framebuffer_to_LCD() {
+ var x = 92160; // 144*160*4
+
+ var y = 0;
+ var i = 23040; // 144*160
+ while (i) {
+ y = gbColors[gbFrameBuffer[--i]];
+ gbLCDImageData[x-=2] = y[2]; // b
+ gbLCDImageData[--x ] = y[1]; // g
+ gbLCDImageData[--x ] = y[0]; // r
+ y = gbColors[gbFrameBuffer[--i]];
+ gbLCDImageData[x-=2] = y[2]; // b
+ gbLCDImageData[--x ] = y[1]; // g
+ gbLCDImageData[--x ] = y[0]; // r
+ y = gbColors[gbFrameBuffer[--i]];
+ gbLCDImageData[x-=2] = y[2]; // b
+ gbLCDImageData[--x ] = y[1]; // g
+ gbLCDImageData[--x ] = y[0]; // r
+ y = gbColors[gbFrameBuffer[--i]];
+ gbLCDImageData[x-=2] = y[2]; // b
+ gbLCDImageData[--x ] = y[1]; // g
+ gbLCDImageData[--x ] = y[0]; // r
+ }
+ gbLCDCtx.putImageData(gbLCDImage, 0,0);
+}
+
+function gb_Clear_Scanline() {
+ var offset = gbRegLY*160; // framebuffer's offset
+ var i = 160+offset;
+ while (offset<i) {
+ gbFrameBuffer[--i] = 0; gbFrameBuffer[--i] = 0;
+ gbFrameBuffer[--i] = 0; gbFrameBuffer[--i] = 0;
+ gbFrameBuffer[--i] = 0; gbFrameBuffer[--i] = 0;
+ gbFrameBuffer[--i] = 0; gbFrameBuffer[--i] = 0;
+ }
+}
+
+function gb_Clear_Framebuffer() {
+ var i = 23040; // 144*160
+ while (i) {
+ gbFrameBuffer[--i] = 0; gbFrameBuffer[--i] = 0;
+ gbFrameBuffer[--i] = 0; gbFrameBuffer[--i] = 0;
+ gbFrameBuffer[--i] = 0; gbFrameBuffer[--i] = 0;
+ gbFrameBuffer[--i] = 0; gbFrameBuffer[--i] = 0;
+ }
+}
+
+function gb_Draw_Scanline() {
+ var i = 0;
+ var j = 0;
+ var k = 0;
+ var x = 0;
+ var y = 0;
+ var offset = gbRegLY*160; // framebuffer's offset
+ var line;
+
+ if (gbRegLY==0) {
+ gbCurrentWinLine=0;
+ if (gbUpdateTiles) gb_Update_Tile_Data();
+ if (gbUpdateBackground) gb_Update_Background();
+ }
+
+ // Draw Background
+ if (gbRegLCDC_BgAndWinDisplay) {
+ // copy background line
+ y = gbRegLCDC_BackgroundYOffs+((gbRegSCY+gbRegLY)%256);
+ x = 160+offset;
+ i = 160;
+ line = gbBackgroundData[y];
+ // copy background line to framebuffer
+ while (x>offset) { // loop unrolling
+ gbFrameBuffer[--x] = gbBackPal[line[gbRegLCDC_BackgroundXOffs+((--i+gbRegSCX)%256)]];
+ gbFrameBuffer[--x] = gbBackPal[line[gbRegLCDC_BackgroundXOffs+((--i+gbRegSCX)%256)]];
+ gbFrameBuffer[--x] = gbBackPal[line[gbRegLCDC_BackgroundXOffs+((--i+gbRegSCX)%256)]];
+ gbFrameBuffer[--x] = gbBackPal[line[gbRegLCDC_BackgroundXOffs+((--i+gbRegSCX)%256)]];
+ gbFrameBuffer[--x] = gbBackPal[line[gbRegLCDC_BackgroundXOffs+((--i+gbRegSCX)%256)]];
+ gbFrameBuffer[--x] = gbBackPal[line[gbRegLCDC_BackgroundXOffs+((--i+gbRegSCX)%256)]];
+ gbFrameBuffer[--x] = gbBackPal[line[gbRegLCDC_BackgroundXOffs+((--i+gbRegSCX)%256)]];
+ gbFrameBuffer[--x] = gbBackPal[line[gbRegLCDC_BackgroundXOffs+((--i+gbRegSCX)%256)]];
+ }
+
+ // Draw Window - TODO this could be buggy
+ if (gbRegLCDC_WindowDisplay) if ((gbRegWY<=gbRegLY) && (gbRegWX<167)) {
+ y = gbRegLCDC_WindowYOffs+gbCurrentWinLine;
+ i = gbRegWX-7+offset;
+ j = (i<0)?-i:0;
+ line = gbBackgroundData[y];
+ // copy window line to framebuffer
+ for (x=j; x<167-gbRegWX; x++) {
+ gbFrameBuffer[x+i] = gbBackPal[line[gbRegLCDC_BackgroundXOffs+x]];
+ }
+ gbCurrentWinLine++;
+ }
+ }
+
+ // Draw Sprites
+ if (gbRegLCDC_SpriteDisplay) {
+ var addr = _OAM_;
+ var tile = 0;
+ var flags = 0;
+ var count = 0; // max 10 sprites per scanline
+ var pixel = 0;
+ var flip = 0;
+ var hide = 0; // sprite priority 1=behind background
+ var pal;
+ j=40;
+ while (j--) { // loop 40 sprites (160 bytes)
+ y=gbMemory[addr++]-16;
+ // check Y pos
+ if ((gbRegLY>=y) && (gbRegLY<(y+gbRegLCDC_SpriteSize))) {
+ // TODO handle Y flipped sprites with size = 16
+ x=gbMemory[addr++]-8;
+ // check X pos
+ if ((x>-8) && (x<160)) {
+ count++;
+ tile = gbMemory[addr++];
+ flags = gbMemory[addr++];
+ hide = (flags>>7)&1;
+ flip = (flags>>5)&3;
+ pal = gbSpritePal[(flags>>4)&1];
+ if (gbRegLCDC_SpriteSize==16) {
+ tile&=0xFE;
+ if (gbRegLY>=(y+8)) { // if it's the 2nd half of the sprite
+ y+=8;
+ if (flip<2) tile++; // not flip Y
+ }
+ else if (flip>1) tile++; // flip Y
+ }
+ i=8;
+ k=x+offset;
+ switch (flip) {
+ case 0: // no flip
+ line=gbTileData[tile][gbRegLY-y]; // sprite line
+ while (i--) {
+ if (pixel=line[i]) { // if not transparent
+ if ((x+i)<0) break;
+ if (!(hide && gbFrameBuffer[k+i]))
+ gbFrameBuffer[k+i]=pal[pixel];
+ }
+ }
+ break;
+ case 1: // flip X
+ line=gbTileData[tile][gbRegLY-y]; // sprite line
+ while (i--) {
+ if (pixel=line[7-i]) {
+ if ((x+i)<0) break;
+ if (!(hide && gbFrameBuffer[k+i]))
+ gbFrameBuffer[k+i]=pal[pixel];
+ }
+ }
+ break;
+ case 2: // flip Y
+ line=gbTileData[tile][7-(gbRegLY-y)]; // sprite line
+ while (i--) {
+ if (pixel=line[i]) {
+ if ((x+i)<0) break;
+ if (!(hide && gbFrameBuffer[k+i]))
+ gbFrameBuffer[k+i]=pal[pixel];
+ }
+ }
+ break;
+ case 3: // flip XY
+ line=gbTileData[tile][7-(gbRegLY-y)]; // sprite line
+ while (i--) {
+ if (pixel=line[7-i]) {
+ if ((x+i)<0) break;
+ if (!(hide && gbFrameBuffer[k+i]))
+ gbFrameBuffer[k+i]=pal[pixel];
+ }
+ }
+ break;
+ }
+ } else addr+=2; // x fail
+ } else addr+=3; // y fail
+ if (count>=10) break;
+ }
+ }
+}
+
+function gb_Init_LCD() {
+ gbScanlineCycles = 0;
+ // init LCD Screen variables
+ gbLCDObj=$('LCD');
+ gbLCDCtx=gbLCDObj.getContext('2d');
+ gbLCDCtx.width=160;
+ gbLCDCtx.height=144;
+ gbLCDCtx.fillStyle='rgb('+gbColors[0][0]+','+gbColors[0][1]+','+gbColors[0][2]+')';
+ gbLCDCtx.fillRect(0,0,160,144);
+ // get LCD scanline canvas data
+ gbLCDImage = gbLCDCtx.getImageData(0,0,160,144);
+ gbLCDImageData = gbLCDImage.data;
+ // update tiles info
+ gbUpdateTiles = false;
+ for (var i=0; i<384; i++) {
+ gbUpdateTilesList[i]=false;
+ gbUpdateBackgroundDataList[i]=false;
+ }
+ // update bg info
+ gbUpdateBackground = false;
+ for (var i=0; i<2048; i++) {
+ gbUpdateBackgroundTileList[i] = false;
+ }
+ // create Background lines
+ for (var j=0; j<512; j++) {
+ gbBackgroundData[j] = [];
+ for (var i=0; i<512; i++) gbBackgroundData[j][i] = 0;
+ }
+ // create Tiles
+ for (var i=0; i<384; i++) {
+ gbTileData[i] = [];
+ // create Tile lines
+ for (var j=0; j<8; j++) {
+ gbTileData[i][j] = [];
+ for (var k=0; k<8; k++) gbTileData[i][j][k] = 0;
+ }
+ }
+ // fill frame buffer
+ gb_Clear_Framebuffer();
+}
+
+
+
+
+/*
+ * jsgb.graphics.js v0.02 - Timers functions for JSGB, a GameBoy Emulator
+ * Copyright (C) 2009 Pedro Ladaria <Sonic1980 at Gmail dot com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ * The full license is available at http://www.gnu.org/licenses/gpl.html
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+var gbDIVTicks = 0; // DIV Ticks Count
+var gbLCDTicks = 0; // ScanLine Counter
+var gbTimerTicks = 0; // Timer Ticks Count
+var gbTimerOverflow = 1024; // Timer Max Ticks
+
+function gb_Set_Timer_Freq(f) {
+ switch(f) { // TAC bits 0 and 1
+ case 0: gbTimerOverflow=1024; return; // 4.096 KHz
+
+ case 1: gbTimerOverflow=16; return; // 262.144 Khz
+ case 2: gbTimerOverflow=64; return; // 65.536 KHz
+ case 3: gbTimerOverflow=256; return; // 16.384 KHz
+ }
+}
+
+function gb_Mode0() { // H-Blank
+ if (gbRegSTAT_Mode!=0) {
+ gbMemory[_STAT_]&=0xFC; // set STAT bits 1-0 to 0
+ gbRegSTAT_Mode=0;
+ if (gbRegSTAT_IntMode0) MEMW(_IF_,gbRegIF|2); // if STAT bit 3 -> set IF bit1
+ }
+}
+
+function gb_Mode2() { // OAM in use
+ if (gbRegSTAT_Mode!=2) {
+ gbRegSTAT_Mode=2;
+ gbMemory[_STAT_]=(gbMemory[_STAT_]&0xFC)|2;// set STAT bits 1-0 to 2
+ if (gbRegSTAT_IntMode2) MEMW(_IF_,gbRegIF|2);// set IF bit 1
+ }
+}
+
+function gb_Mode3() { // OAM+VRAM busy
+ if (gbRegSTAT_Mode!=3) {
+ gbRegSTAT_Mode=3;
+ gbMemory[_STAT_]|=3; // set STAT bits 1-0 to 3
+ if (gbRegLCDC_DisplayOn) gb_Draw_Scanline();
+ else gb_Clear_Scanline();
+ }
+}
+
+function gb_Mode1() { // V-Blank
+ gbRegSTAT_Mode=1;
+ gbMemory[_STAT_]=(gbMemory[_STAT_]&0xFC)|1;
+ if (gbRegSTAT_IntMode1) MEMW(_IF_,gbRegIF|2); // set IF flag 1
+ MEMW(_IF_,gbRegIF|1); // set IF flag 0
+ if (gbRegLCDC_DisplayOn) gb_Framebuffer_to_LCD(); // Display frame
+ else gbLCDCtx.fillRect(0,0,160,144);;
+}
+
+function gb_LY_LYC_compare() { // LY - LYC Compare
+ if (gbRegLY==gbRegLYC) { // If LY==LCY
+ gbMemory[_STAT_]|=0x04; // set STAT bit 2: LY-LYC coincidence flag
+ if (gbRegSTAT_IntLYLYC) MEMW(_IF_,gbRegIF|2); // set IF bit 1
+ }
+ else {
+ gbMemory[_STAT_]&=0xFB; // reset STAT bit 2 (LY!=LYC)
+ }
+}
+
+function gb_TIMER_Control() {
+
+ // DIV control
+ if ((gbDIVTicks+=gbCPUTicks)>=256) {
+ gbDIVTicks-=256;
+ gbMemory[_DIV_]=(++gbMemory[_DIV_])&0xFF; // inc DIV
+ }
+
+ // LCD Timing
+ gbLCDTicks+=gbCPUTicks; // ScanLineCounter += InstructionCyclesCount
+ if (gbLCDTicks>=456){ // when ScanLineCounter overflows -> new scanline
+ gbLCDTicks-=456;
+ // I'm comparing LY and LYC before incrementing LY
+ // that's because MarioLand and the dot under the coin
+ gb_LY_LYC_compare();
+ if ((++gbRegLY)>=154) gbRegLY-=154; // inc LY (current scanline)
+ gbMemory[_LY_]=gbRegLY;
+ if (gbRegLY==144) gb_Mode1(); // mode1: 4560 cycles
+ else if (gbRegLY==0) {
+ gbEndFrame=true;
+ gbFPS++;
+ }
+ }
+ if (gbRegLY<144) { // if not in V-Blank
+ if (gbLCDTicks<=204) gb_Mode0(); // mode0: 204 cycles
+ else if (gbLCDTicks<=284) gb_Mode2(); // mode2: 80 cycles
+ else gb_Mode3(); // mode3: 172 cycles
+ }
+
+ // Internal Timer
+ if (gbRegTAC_TimerOn) {
+ if ((gbTimerTicks+=gbCPUTicks)>=gbTimerOverflow) {
+ gbTimerTicks-=gbTimerOverflow;
+ if ((++gbMemory[_TIMA_])>=256) {
+ gbMemory[_TIMA_]=gbMemory[_TMA_];
+ MEMW(_IF_,gbRegIF|4); // set IF bit 2
+ }
+ }
+ }
+}
+
+
+
+/*
+ * jsgb.debugger.js v0.02 - Debugger for JSGB, a GameBoy Emulator
+ * Copyright (C) 2009 Pedro Ladaria <Sonic1980 at Gmail dot com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ * The full license is available at http://www.gnu.org/licenses/gpl.html
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+var gbIsBreakpoint = false;
+
+function gb_Dump_All() {
+ gb_Dump_CPU();
+ gb_Dump_IORegs();
+ //asmScroll.dragger.posY*(0xFFFF-dump_asm_h+1)
+ asmScroll.dragger.setpos(0,((PC-10<0)?0:(PC-10))/(0xFFFF-dump_asm_h+1));
+ gb_Dump_ASM();
+ gb_Dump_Mem();
+ memScroll.update();
+ asmScroll.update();
+ //gb_Dump_Background();
+ //dump_sp();
+ gb_Dump_Cartridge_info();
+}
+
+// CPU //
+
+function gb_Dump_CPU() {
+ $('RA').innerHTML='A: '+zf(hex(RA),2)+br+sp(zf(bin(RA),8),4);
+ $('RB').innerHTML='B: '+zf(hex(RB),2)+br+sp(zf(bin(RB),8),4);
+ $('RC').innerHTML='C: '+zf(hex(RC),2)+br+sp(zf(bin(RC),8),4);
+ $('RD').innerHTML='D: '+zf(hex(RD),2)+br+sp(zf(bin(RD),8),4);
+ $('RE').innerHTML='E: '+zf(hex(RE),2)+br+sp(zf(bin(RE),8),4);
+ $('HL').innerHTML='&nbsp;HL: '+zf(hex(HL),4)+br+sp(zf(bin(HL),16),4);
+ $('SP').innerHTML='&nbsp;SP: '+zf(hex(SP),4)+br+sp(zf(bin(SP),16),4);
+ $('PC').innerHTML='&nbsp;PC: '+zf(hex(PC),4)+br+sp(zf(bin(PC),16),4);
+ $('RF').innerHTML='Z:'+(FZ*1)+' N:'+(FN*1)+'<br/'+'>H:'+(FH*1)+' C:'+(FC*1);
+}
+
+// SPECIAL REGISTERS //
+
+function gb_Dump_IORegs() {
+ $('SPRDUMP').innerHTML=
+ 'FF00:P1&nbsp; &nbsp;'+sp(zf(bin(gbMemory[0xFF00]),8),4)+br+
+ 'FF04:DIV&nbsp; ' +gbMemory[0xFF04]+'=0x'+zf(hex(gbMemory[0xFF04]),2)+br+
+ 'FF05:TIMA ' +gbMemory[0xFF05]+'=0x'+zf(hex(gbMemory[0xFF05]),2)+br+
+ 'FF06:TMA &nbsp;' +gbMemory[0xFF06]+'=0x'+zf(hex(gbMemory[0xFF06]),2)+br+
+ 'FF07:TAC&nbsp; ' +sp(zf(bin(gbMemory[0xFF07]),8),4)+br+
+ 'FF0F:IF&nbsp; &nbsp;'+sp(zf(bin(gbMemory[0xFF0F]),8),4)+br+
+ 'FF40:LCDC ' +sp(zf(bin(gbMemory[_LCDC_]),8),4)+br+
+ 'FF41:STAT ' +sp(zf(bin(gbMemory[0xFF41]),8),4)+br+
+ 'FF42:SCY&nbsp; ' +gbMemory[0xFF42]+br+
+ 'FF43:SCX&nbsp; ' +gbMemory[0xFF43]+br+
+ 'FF44:LY&nbsp; &nbsp;'+gbMemory[0xFF44]+br+
+ 'FF45:LYC &nbsp;' +gbMemory[0xFF45]+br+
+
+ 'FF46:DMA &nbsp;' +'0x'+zf(hex(gbMemory[0xFF46]),2)+br+
+ 'FF47:BGP &nbsp;' +sp(zf(bin(gbMemory[0xFF47]),8),4)+br+
+ 'FF48:OBP0&nbsp;' +sp(zf(bin(gbMemory[0xFF48]),8),4)+br+
+ 'FF49:OBP1&nbsp;' +sp(zf(bin(gbMemory[0xFF49]),8),4)+br+
+
+ 'FF4A:WY&nbsp; &nbsp;'+gbMemory[0xFF4A]+br+
+ 'FF4B:WX&nbsp; &nbsp;'+gbMemory[0xFF4B]+br+
+ 'FFFF:IE&nbsp; &nbsp;'+sp(zf(bin(gbMemory[0xFFFF]),8),4)+br+
+ '<hr>'+
+ 'Emulator vars'+br+
+ 'IME: '+gbIME+br+
+ 'CPU Ticks: '+gbCPUTicks+br+
+ 'DIV Ticks: '+gbDIVTicks+br+
+ 'LCD Ticks: '+gbLCDTicks+br+
+ 'Timer Ticks: '+gbTimerTicks+br+
+ 'Timer Max: '+gbTimerOverflow+br;
+}
+
+// MEMORY //
+
+var dump_mem_w=16;
+var dump_mem_h=40;
+var dump_mem_a=dump_mem_w*dump_mem_h;
+function gb_Dump_Mem() {
+ var s='';
+ var w=dump_mem_w;
+ var h=dump_mem_h;
+ var c=0; // char
+ var d=''; // display char
+ var hx= ''; // hex values string
+ var as= ''; // ascii values string
+ var of= Math.round(memScroll.dragger.posY*(0xFFFF-(dump_mem_a-w)))&(0xFFFF-w+1);
+ for (var j=0;j<h;j++) {
+ s+=where_mem(of)+':';
+ s+=zf(hex(of),4)+'&nbsp; ';
+ hx='';
+ as='';
+ for (var i=0;i<w;i++) {
+ c=MEMR(of+i);
+ hx+=zf(hex(c),2)+' ';
+ d=String.fromCharCode(c);
+ if (c>126) d='.';
+ else if (c<32) d='.';
+ else if (c==60) d='&lt;';
+ else if (c==62) d='&gt;';
+ else if (c==32) d='&nbsp;';
+ as+=d;
+ }
+ s+=hx+' '+as+'&nbsp;';
+ s+=br;
+ of+=w;
+ }
+ $('MEMDUMP').innerHTML=s;
+}
+
+// DISASSEMBLER + BREAKPOINTS STUFF //
+
+function gb_GoTo_ASM(a) {
+ a='0x'+a;
+ asmScroll.dragger.setpos(0,((a-10<0)?0:(a-10))/(0xFFFF-dump_asm_h+1));
+ gb_Dump_ASM();
+}
+
+function gb_Save_Breakpoints_Cookie(ba) {
+ var date = new Date(); date.setTime(date.getTime()+(30*24*60*60*1000));
+ var expires = "; expires="+date.toGMTString();
+ ba=(ba.length>0)?ba.join(','):'';
+ //document.title='COOKIE WRITE:'+ba;
+ document.cookie = 'JSGB_gbBreakpointsP='+ba+expires+"; path=/";
+}
+
+function gb_Load_Breakpoints_Cookie() {
+ var n='JSGB_gbBreakpointsP=';
+ var ca = document.cookie.split(';');
+ for(var i in ca) {
+ var c = ca[i];
+ while (c.charAt(0)==' ') c=c.substring(1,c.length);
+ if (c.indexOf(n)==0) {
+ var ba=c.substring(n.length,c.length);
+ if(ba=='')return [];
+ ba=ba.split(',');
+ for(var j in ba) ba[j]*=1;
+ gbIsBreakpoint = ba.length>0;
+ return ba;
+ }
+ }
+ return [];
+}
+
+var gbBreakpointsList = gb_Load_Breakpoints_Cookie();
+
+function gb_Set_Breakpoint(addr) {
+ addr*=1; // convert to integer
+ if ((addr>0xFFFF) || (addr<0)) return;
+ var i=gbBreakpointsList.indexOf(addr);
+ if (i<0) gbBreakpointsList.push(addr);// Set breakpoint
+ else gbBreakpointsList.splice(i,1); // Remove breakpoint
+ gb_Save_Breakpoints_Cookie(gbBreakpointsList);
+ gbIsBreakpoint = gbBreakpointsList.length>0;
+ gb_Dump_ASM();
+}
+
+function gb_Clear_All_Breakpoints() {
+ gbBreakpointsList=[];
+ gb_Save_Breakpoints_Cookie(gbBreakpointsList);
+ gbIsBreakpoint = false;
+ gb_Dump_ASM();
+}
+
+function gb_Show_Function(PC) {
+ var s=(MEMR(PC)==0xCB)?OPCB[MEMR(PC+1)]:OP[MEMR(PC)];
+ var ident = 0;
+ s = s.toString().
+ split('\n').join('').split('\t').join('').split(' ').join('').
+ split('{').join(' {\n').split('}').join('}\n').split(';').join(';\n');
+ s = s.split('\n');
+ for (var i=0; i<s.length; i++) {
+ if (s[i].indexOf('}')>=0) ident--;
+ for (var j=0; j<ident; j++) s[i]=' '+s[i];
+ if (s[i].indexOf('{')>=0) ident++;
+ }
+ s = s.join('\n');
+ alert(s);
+}
+
+var dump_asm_h = 40;
+function gb_Dump_ASM() {
+ var s='';
+ var oPC=PC;
+ var of=0;
+ var id='';
+ var st='';
+ PC=Math.round(asmScroll.dragger.posY*(0xFFFF-dump_asm_h+1));
+ if (PC<=0) PC=0;
+ for (var i=0;i<dump_asm_h;i++) {
+ id='ASM_'+PC;
+ st=(gbBreakpointsList.indexOf(PC)>=0)?' class="BK"':'';
+ st+=(oPC==PC)?' style="background:#9F9;"':'';
+ s+='<div id="'+id+'"'+st+'>';
+ s+='<span onclick="gb_Show_Function('+PC+');" class="CP U CB80">fn</span> ';
+ s+='<span onclick="gb_Set_Breakpoint('+PC+');" class="CP C800">';
+ s+=zf(hex(PC),4)+': ';
+ s+=zf(hex(MEMR(PC)),2)+' = ';
+ s+=MN[MEMR(PC)]();
+ s+='</span></div>\n';
+ PC++;
+ }
+//else s+='<div>&nbsp;</div>\n';
+ $('ASMDUMP').innerHTML=s;
+
+ PC=oPC;
+}
+
+// BACKGROUND //
+
+function gb_Dump_Background() {
+ //gb_Draw_Background();
+ $('BG_CANVAS').width=512;
+ $('BG_CANVAS').height=512;
+ var bgctx = $('BG_CANVAS').getContext('2d');
+ var img = bgctx.getImageData(0,0,512,512);
+
+ var k = 0;
+ var c = 0;
+ for (var j=0; j<512; j++) {
+ for (var i=0; i<512; i++) {
+ c = gbColors[gbBackgroundData[j][i]];
+ img.data[k++]=c[0];
+ img.data[k++]=c[1];
+ img.data[k++]=c[2];
+ img.data[k++]=255;
+ }
+ }
+ bgctx.putImageData(img, 0,0);
+
+ var b=0;
+ var s='BG/Win info @ LCDC Reg'+br;
+ b=(gbMemory[_LCDC_]>>5)&1;
+ s+='bit5='+b+'; Window display = '+(b==0?'off':'on')+br;
+
+ b=(gbMemory[_LCDC_]>>4)&1;
+ s+='bit4='+b+'; Tile data = '+((b==0)?'0x8800-0x97FF':'0x8000-0x8FFF')+br;
+
+ b=(gbMemory[_LCDC_]>>3)&1;
+ s+='bit3='+b+'; Tile map = '+((b==0)?'0x9800-0x9BFF':'0x9C00-0x9FFF')+br;
+
+ b=(gbMemory[_LCDC_]>>0)&1;
+ s+='bit0='+b+'; Display = '+((b==0)?'off':'on')+br;
+
+ $('BG_INFO').innerHTML=s;
+
+}
+
+// CARTRIDGE INFO
+
+function gb_Dump_Cartridge_info() {
+ var s = '';
+ s+= 'Game name:&nbsp;&nbsp;&nbsp;&nbsp;';
+ s+= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+br;
+ s+= gbROMInfo.Name+'<hr>';
+ s+= 'Type: '+br+gbCartridgeTypes[gbROMInfo.CartridgeType]+'<hr>';
+
+ s+= 'ROM Size: '+br+gbROMInfo.ROMBanks+' banks: ';
+ s+= (gbROMInfo.ROMBanks*32)+' Kb'+'<hr>';
+
+ s+= 'RAM Size: '+br+gbROMInfo.RAMBanks+' banks: ';
+ s+= (gbROMInfo.RAMBanks*32)+' Kb';
+
+ $('ROM_INFO').innerHTML = s;
+}
+
+// SPRITES //
+/*
+function dump_sp() {
+ var b=0;
+ var s='Sprite info @ LCDC Reg'+br;
+
+ b=(gbMemory[_LCDC_]>>2)&1;
+ s+='bit2='+b+'; OBJ size='+((b==0)?'8x8':'8x16')+br;
+
+ b=(gbMemory[_LCDC_]>>1)&1;
+ s+='bit1='+b+'; OBJ display='+((b==1)?'On':'Off')+br;
+
+ $('SP_INFO').innerHTML=s;
+}
+*/
+// COMMON //
+
+var memScroll;
+var asmScroll;
+var gbDebuggerInitiated = false;
+
+function gb_Init_Debugger() {
+ if (!gbDebuggerInitiated) {
+ $('DEBUGGER').innerHTML=gbDebuggerControls;
+ memScroll = new scrollBar('MEMSCROLL',gb_Dump_Mem);
+ asmScroll = new scrollBar('ASMSCROLL',gb_Dump_ASM);
+ gbDebuggerInitiated = true;
+ }
+}
+
+var gbDebuggerControls =
+'<div class="FL MT MR MB">\
+<table>\
+<thead><tr><th colspan="2" style="min-width:270px;">Assembler</th></tr></thead>\
+<tbody><tr><td colspan="2">\
+<input class="BTN" type="button" onclick="gb_Clear_All_Breakpoints();" value="Clear all breakpoints"/>\
+<input class="BTN" type="button" onclick="gb_GoTo_ASM(prompt(\'Enter address (in hex)\'));" value="Goto..."/>\
+<input class="BTN" type="button" onclick="alert(gb_Dump_Caller_Stack());" value="Caller stack..."/>\
+</td></tr>\
+<tr>\
+<td id="ASMDUMP">data</td>\
+<td id="ASMSCROLL">s</td>\
+</tr>\
+</tbody>\
+</table>\
+</div>\
+\
+<div class="FL MT MR MB">\
+<table>\
+<thead><tr><th colspan="2">Memory dump</th></tr></thead>\
+<tbody>\
+<tr><td colspan="2">\
+<input value="ROM0" class="BTN" type="button" onclick="memScroll.dragger.setpos(0,0x0000/(0xFFFF-dump_mem_a));gb_gb_Dump_Mem();"/>\
+<input value="ROM1" class="BTN" type="button" onclick="memScroll.dragger.setpos(0,0x4000/(0xFFFF-dump_mem_a));gb_Dump_Mem();"/>\
+<input value="VRAM" class="BTN" type="button" onclick="memScroll.dragger.setpos(0,0x8000/(0xFFFF-dump_mem_a));gb_Dump_Mem();"/>\
+<input value="OAM" class="BTN" type="button" onclick="memScroll.dragger.setpos(0,0xFE00/(0xFFFF-dump_mem_a));gb_Dump_Mem();"/>\
+<input value="PC" class="BTN" type="button" onclick="memScroll.dragger.setpos(0,PC/(0xFFFF-dump_mem_a));gb_Dump_Mem();"/>\
+<input value="SP" class="BTN" type="button" onclick="memScroll.dragger.setpos(0,SP/(0xFFFF-dump_mem_a));gb_Dump_Mem();"/>\
+<input value="HL" class="BTN" type="button" onclick="memScroll.dragger.setpos(0,HL/(0xFFFF-dump_mem_a));gb_Dump_Mem();"/>\
+</td></tr>\
+<tr>\
+<td id="MEMDUMP">a</td>\
+<td id="MEMSCROLL">s</td>\
+</tr>\
+</tbody>\
+</table>\
+</div>\
+\
+<div class="FL">\
+<table class="FL MT MR MB C">\
+<thead><tr><th colspan="2">CPU Dump</th></tr></thead>\
+<tbody>\
+<tr><td id="RA">A</td><td id="RF">F</td></tr>\
+<tr><td id="RB">B</td><td id="RC">C</td></tr>\
+<tr><td id="RD">D</td><td id="RE">E</td></tr>\
+<tr><td colspan="2" id="HL">HL</td></tr>\
+<tr><td colspan="2" id="SP">SP</td></tr>\
+<tr><td colspan="2" id="PC">PC</td></tr>\
+</tbody>\
+</table>\
+\
+<table class="MT MR C CLR">\
+<thead><tr><th>Cartridge Info</th></tr></thead>\
+<tbody>\
+<tr><td class="L" id="ROM_INFO">info</td></tr>\
+</tbody>\
+</table>\
+</div>\
+\
+<div class="FL MT MR MB">\
+<table>\
+<thead><tr><th>Special regs</th></tr></thead>\
+<tbody><tr><td id="SPRDUMP">data</td></tr></tbody>\
+</table>\
+</div>\
+\
+<!--\
+<div class="FL MR CLR">\
+<table class="C FL MR">\
+<thead><tr><th>Tile images</th></tr></thead>\
+<tbody>\
+<tr><td id="TILES">tiles</td></tr>\
+</tbody>\
+</table>\
+\
+<table class="FL MR MB">\
+<thead><tr><th>Background buffer</th></tr></thead>\
+<tbody>\
+<tr><td>\
+<canvas id="BG_CANVAS" width="512" height="512"></canvas>\
+<hr/>\
+<span id="BG_INFO"></span>\
+<input type="button" value="update" onclick="gb_Dump_Background()"/>\
+</td></tr>\
+</tbody>\
+</table>\
+\
+\
+<table class="FL MR MB">\
+<thead><tr><th>Sprites</th></tr></thead>\
+<tbody>\
+<tr><td>\
+<canvas style="background:#C8FFD0;" id="SP_CANVAS" width="160" height="144"></canvas>\
+<hr/>\
+<span id="SP_INFO"></span>\
+</td></tr>\
+</tbody>\
+</table>\
+</div>\
+-->\
+';
+
+
+
+var gbRunInterval;
+var gbFpsInterval;
+
+function gb_Frame() {
+ gbEndFrame=false;
+ while (!(gbEndFrame||gbPause)) {
+ if (!gbHalt) OP[MEMR(PC++)](); else gbCPUTicks=4;
+ if (gbIME) gbInterrupts[gbRegIE & gbRegIF]();
+ gb_TIMER_Control();
+ if (gbIsBreakpoint) if (gbBreakpointsList.indexOf(PC)>=0) {
+ gb_Pause();
+ gb_Toggle_Debugger(true);
+ }
+ }
+}
+
+function gb_Step(){
+ if (!gbHalt) OP[MEMR(PC++)](); else gbCPUTicks=4;
+ if (gbIME) gbInterrupts[gbRegIE & gbRegIF]();
+ gb_TIMER_Control();
+ gb_Dump_All();
+}
+
+function gb_Run() {
+ if (!gbPause) return;
+ gbPause=false;
+ $('BR').disabled=1;
+ $('BP').disabled=0;
+ $('BS').disabled=1;
+ gbFpsInterval=setInterval(gb_Show_Fps,1000);
+ gbRunInterval=setInterval(gb_Frame,16);
+}
+
+function gb_Pause() {
+ if (gbPause) return;
+ gbPause=true;
+ $('BR').disabled=0;
+ $('BP').disabled=1;
+ $('BS').disabled=0;
+ clearInterval(gbRunInterval);
+ clearInterval(gbFpsInterval);
+ $('STATUS').innerHTML='Pause';
+ gb_Dump_All();
+}
+
+function gb_Insert_Cartridge(fileName, Start) {
+ gb_Pause();
+ gbSeconds = 0;
+ gbFrames = 0;
+ gb_Init_Debugger();
+ gb_Init_Memory();
+ gb_Init_LCD();
+ gb_Init_Interrupts();
+ gb_Init_CPU();
+ gb_Init_Input();
+ gb_ROM_Load('roms/'+fileName);
+ gb_Dump_All();
+ if (Start) $('BR').onclick();
+ else $('BP').onclick();
+}
+
+
+
+
+
+var gbSeconds = 0;
+var gbFrames = 0;
+
+function gb_Resize_LCD() {
+ if ($('BX').value=='Size x2') {
+ $('BX').value='Size x3';
+ $('LCD').style.width='320px';
+ $('LCD').style.height='288px';
+ }
+ else if ($('BX').value=='Size x3') {
+ $('BX').value='Size x1';
+ $('LCD').style.width='480px';
+ $('LCD').style.height='432px';
+ }
+ else {
+ $('BX').value='Size x2';
+ $('LCD').style.width='160px';
+ $('LCD').style.height='144px';
+ }
+}
+
+function gb_Show_Fps() {
+ gbFrames+=gbFPS;
+ gbSeconds++;
+ $('STATUS').innerHTML =
+ 'Running: '+gbFPS+' '+
+ 'fps - Average: '+(gbFrames/gbSeconds).toFixed(2)+' - '+
+ 'Bank switches/s: '+gbBankSwitchCount;
+ gbFPS=0;
+ gbBankSwitchCount=0;
+}
+
+function gb_Toggle_Debugger(show) {
+ $('DEBUGGER').style.height=(show)?'auto':'0px';
+}
+
+window.onload = function() {
+ gb_Insert_Cartridge($('CARTRIDGE').value, false);
+ gb_Toggle_Debugger($('TOGGLE_DEBUGGER').checked);
+}
+
+
+
+
+<!--
+google_ad_client = "pub-7288014189644083";
+/* jsgb 468x60, creado 30/10/09 */
+google_ad_slot = "9211520759";
+google_ad_width = 468;
+google_ad_height = 60;
+//-->
+
+
+
+(function(){var g=true,h=null,j=false,aa=(new Date).getTime(),k=function(a){var b=(new Date).getTime()-aa;b="&dtd="+(b<1E3?b:"M");return a+b};var l=this,ba=function(a,b,c){a=a.split(".");c=c||l;!(a[0]in c)&&c.execScript&&c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)if(!a.length&&b!==undefined)c[d]=b;else c=c[d]?c[d]:(c[d]={})},m=function(a){var b=typeof a;if(b=="object")if(a){if(a instanceof Array||!(a instanceof Object)&&Object.prototype.toString.call(a)=="[object Array]"||typeof a.length=="number"&&typeof a.splice!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("splice"))return"array";
+if(!(a instanceof Object)&&(Object.prototype.toString.call(a)=="[object Function]"||typeof a.call!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("call")))return"function"}else return"null";else if(b=="function"&&typeof a.call=="undefined")return"object";return b},o=function(a){return m(a)=="array"},ca=function(a){var b=m(a);return b=="array"||b=="object"&&typeof a.length=="number"},p=function(a){return typeof a=="string"},da=function(a){a=m(a);return a=="object"||
+a=="array"||a=="function"},ea=function(a){var b=m(a);if(b=="object"||b=="array"){if(a.clone)return a.clone.call(a);b=b=="array"?[]:{};for(var c in a)b[c]=ea(a[c]);return b}return a},fa=function(a,b){var c=b||l;if(arguments.length>2){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(c,e)}}else return function(){return a.apply(c,arguments)}},ga=Date.now||function(){return+new Date},q=function(a,
+b,c){ba(a,b,c)};var r=function(a,b){a=parseFloat(a);return isNaN(a)||a>1||a<0?b:a},s=function(a,b){if(a=="true")return g;if(a=="false")return j;return b},ha=/^([\w-]+\.)*([\w-]{2,})(\:[0-9]+)?$/,t=function(a,b){if(!a)return b;return(a=a.match(ha))?a[0]:b};var ia=function(){return t("","googleads.g.doubleclick.net")},ja=function(){return t("","pagead2.googlesyndication.com")},u=function(){return t("","pagead2.googlesyndication.com")};var v=Array.prototype,ka=v.forEach?function(a,b,c){v.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=p(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},la=function(){return v.concat.apply(v,arguments)},ma=function(a){if(o(a))return la(a);else{for(var b=[],c=0,d=a.length;c<d;c++)b[c]=a[c];return b}};var w=function(a,b){this.width=a;this.height=b};w.prototype.clone=function(){return new w(this.width,this.height)};w.prototype.toString=function(){return"("+this.width+" x "+this.height+")"};w.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};w.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};
+w.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};w.prototype.scale=function(a){this.width*=a;this.height*=a;return this};var na=function(a,b,c){for(var d in a)b.call(c,a[d],d,a)};var ta=function(a,b){if(b)return a.replace(oa,"&amp;").replace(pa,"&lt;").replace(qa,"&gt;").replace(ra,"&quot;");else{if(!sa.test(a))return a;if(a.indexOf("&")!=-1)a=a.replace(oa,"&amp;");if(a.indexOf("<")!=-1)a=a.replace(pa,"&lt;");if(a.indexOf(">")!=-1)a=a.replace(qa,"&gt;");if(a.indexOf('"')!=-1)a=a.replace(ra,"&quot;");return a}},oa=/&/g,pa=/</g,qa=/>/g,ra=/\"/g,sa=/[&<>\"]/,wa=function(a){if(a.indexOf("&")!=-1)return"document"in l&&a.indexOf("<")==-1?ua(a):va(a);return a},ua=function(a){var b=
+l.document.createElement("a");b.innerHTML=a;b.normalize&&b.normalize();a=b.firstChild.nodeValue;b.innerHTML="";return a},va=function(a){return a.replace(/&([^;]+);/g,function(b,c){switch(c){case "amp":return"&";case "lt":return"<";case "gt":return">";case "quot":return'"';default:if(c.charAt(0)=="#"){c=Number("0"+c.substr(1));if(!isNaN(c))return String.fromCharCode(c)}return b}})},xa=function(a,b){for(var c=b.length,d=0;d<c;d++){var e=c==1?b:b.charAt(d);if(a.charAt(0)==e&&a.charAt(a.length-1)==e)return a.substring(1,
+a.length-1)}return a},ya=function(a,b){var c=0;a=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split(".");b=String(b).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split(".");for(var d=Math.max(a.length,b.length),e=0;c==0&&e<d;e++){var f=a[e]||"",i=b[e]||"",n=new RegExp("(\\d*)(\\D*)","g"),y=new RegExp("(\\d*)(\\D*)","g");do{var F=n.exec(f)||["","",""],G=y.exec(i)||["","",""];if(F[0].length==0&&G[0].length==0)break;c=F[1].length==0?0:parseInt(F[1],10);var ob=G[1].length==0?0:parseInt(G[1],10);c=x(c,ob)||
+x(F[2].length==0,G[2].length==0)||x(F[2],G[2])}while(c==0)}return c},x=function(a,b){if(a<b)return-1;else if(a>b)return 1;return 0};ga();var z,A,B,C,D,za,Aa,Ba,Ca,Da=function(){return l.navigator?l.navigator.userAgent:h},E=function(){return l.navigator},Ea=function(){D=C=B=A=z=j;var a;if(a=Da()){var b=E();z=a.indexOf("Opera")==0;A=!z&&a.indexOf("MSIE")!=-1;C=(B=!z&&a.indexOf("WebKit")!=-1)&&a.indexOf("Mobile")!=-1;D=!z&&!B&&b.product=="Gecko"}};Ea();
+var H=z,I=A,Fa=D,Ga=B,Ha=C,Ia=function(){var a=E();return a&&a.platform||""},Ja=Ia(),Ka=function(){za=Ja.indexOf("Mac")!=-1;Aa=Ja.indexOf("Win")!=-1;Ba=Ja.indexOf("Linux")!=-1;Ca=!!E()&&(E().appVersion||"").indexOf("X11")!=-1};Ka();
+var La=za,Ma=Aa,Na=Ba,Oa=function(){var a="",b;if(H&&l.opera){a=l.opera.version;a=typeof a=="function"?a():a}else{if(Fa)b=/rv\:([^\);]+)(\)|;)/;else if(I)b=/MSIE\s+([^\);]+)(\)|;)/;else if(Ga)b=/WebKit\/(\S+)/;if(b)a=(a=b.exec(Da()))?a[1]:""}return a},Pa=Oa(),Qa={},J=function(a){return Qa[a]||(Qa[a]=ya(Pa,a)>=0)};var Ra=function(a){return p(a)?document.getElementById(a):a},Sa=Ra,Ua=function(a,b){na(b,function(c,d){if(d=="style")a.style.cssText=c;else if(d=="class")a.className=c;else if(d=="for")a.htmlFor=c;else if(d in Ta)a.setAttribute(Ta[d],c);else a[d]=c})},Ta={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",height:"height",width:"width",usemap:"useMap",frameborder:"frameBorder",type:"type"},Va=function(a){var b=a.document;if(Ga&&!J("500")&&!Ha){if(typeof a.innerHeight==
+"undefined")a=window;b=a.innerHeight;var c=a.document.documentElement.scrollHeight;if(a==a.top)if(c<b)b-=15;return new w(a.innerWidth,b)}a=b.compatMode=="CSS1Compat"&&(!H||H&&J("9.50"))?b.documentElement:b.body;return new w(a.clientWidth,a.clientHeight)},Xa=function(){return Wa(document,arguments)},Wa=function(a,b){var c=b[0],d=b[1];if(I&&d&&(d.name||d.type)){c=["<",c];d.name&&c.push(' name="',ta(d.name),'"');if(d.type){c.push(' type="',ta(d.type),'"');d=ea(d);delete d.type}c.push(">");c=c.join("")}var e=
+a.createElement(c);if(d)if(p(d))e.className=d;else Ua(e,d);if(b.length>2){d=function(i){if(i)e.appendChild(p(i)?a.createTextNode(i):i)};for(c=2;c<b.length;c++){var f=b[c];ca(f)&&!(da(f)&&f.nodeType>0)?ka(Ya(f)?ma(f):f,d):d(f)}}return e},Za=function(a,b){a.appendChild(b)},Ya=function(a){if(a&&typeof a.length=="number")if(da(a))return typeof a.item=="function"||typeof a.item=="string";else if(m(a)=="function")return typeof a.item=="function";return j};var $a=document,K=window;u();var L=function(a,b){for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.call(h,a[c],c,a)},ab=function(a){if(arguments.length<2)return a.length;for(var b=1,c=arguments.length;b<c;++b)a.push(arguments[b]);return a.length};function M(a){return typeof encodeURIComponent=="function"?encodeURIComponent(a):escape(a)}
+function bb(a,b,c){var d=document.createElement("script");d.type="text/javascript";if(b)d.onload=b;if(c)d.id=c;d.src=a;var e=document.getElementsByTagName("head")[0];if(!e)return j;window.setTimeout(function(){e.appendChild(d)},0);return g}function cb(a,b){a.google_image_requests||(a.google_image_requests=[]);var c=new Image;c.src=b;a.google_image_requests.push(c)}function db(a){if(a in eb)return eb[a];return eb[a]=navigator.userAgent.toLowerCase().indexOf(a)!=-1}var eb={};
+function fb(){if(navigator.plugins&&navigator.mimeTypes.length){var a=navigator.plugins["Shockwave Flash"];if(a&&a.description)return a.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s)+r/,".")}else if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){a=3;for(var b=1;b;)try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+(a+1));a++}catch(c){b=h}return a.toString()}else if(db("msie")&&!window.opera){b=h;try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(d){a=
+0;try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");a=6;b.AllowScriptAccess="always"}catch(e){if(a==6)return a.toString()}try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(f){}}if(b){a=b.GetVariable("$version").split(" ")[1];return a.replace(/,/g,".")}}return"0"}function N(a){var b=a.google_ad_format;if(b)return b.indexOf("_0ads")>0;return a.google_ad_output!="html"&&a.google_num_radlinks>0}function O(a){return!!a&&a.indexOf("_sdo")!=-1}
+function P(a,b){if(!(Math.random()<1.0E-4)){var c=Math.random();if(c<b){b=Math.floor(c/b*a.length);return a[b]}}return""}
+var gb=function(a){a.u_tz=-(new Date).getTimezoneOffset();a.u_his=window.history.length;a.u_java=navigator.javaEnabled();if(window.screen){a.u_h=window.screen.height;a.u_w=window.screen.width;a.u_ah=window.screen.availHeight;a.u_aw=window.screen.availWidth;a.u_cd=window.screen.colorDepth}if(navigator.plugins)a.u_nplug=navigator.plugins.length;if(navigator.mimeTypes)a.u_nmime=navigator.mimeTypes.length},hb=function(a){var b=K;if(a&&b.top!=b)b=b.top;try{return b.document&&!b.document.body?new w(-1,
+-1):Va(b||window)}catch(c){return new w(-12245933,-12245933)}},ib=function(a,b){var c=a.length;if(c==0)return 0;b=b||305419896;for(var d=0;d<c;d++){var e=a.charCodeAt(d);b^=(b<<5)+(b>>2)+e&4294967295}return b},jb=function(a){if(a==a.top)return 0;var b=[];b.push(document.URL);a.name&&b.push(a.name);a=g;a=hb(!a);b.push(a.width.toString());b.push(a.height.toString());b=ib(b.join(""));return b>0?b:4294967296+b};var kb={google_ad_channel:"channel",google_ad_host:"host",google_ad_host_channel:"h_ch",google_ad_host_tier_id:"ht_id",google_ad_section:"region",google_ad_type:"ad_type",google_adtest:"adtest",google_allow_expandable_ads:"ea",google_alternate_ad_url:"alternate_ad_url",google_alternate_color:"alt_color",google_bid:"bid",google_city:"gcs",google_color_bg:"color_bg",google_color_border:"color_border",google_color_line:"color_line",google_color_link:"color_link",google_color_text:"color_text",google_color_url:"color_url",
+google_contents:"contents",google_country:"gl",google_cust_age:"cust_age",google_cust_ch:"cust_ch",google_cust_gender:"cust_gender",google_cust_id:"cust_id",google_cust_interests:"cust_interests",google_cust_job:"cust_job",google_cust_l:"cust_l",google_cust_lh:"cust_lh",google_cust_u_url:"cust_u_url",google_disable_video_autoplay:"disable_video_autoplay",google_ed:"ed",google_encoding:"oe",google_feedback:"feedback_link",google_flash_version:"flash",google_font_face:"f",google_font_size:"fs",google_hints:"hints",
+google_kw:"kw",google_kw_type:"kw_type",google_language:"hl",google_page_url:"url",google_region:"gr",google_reuse_colors:"reuse_colors",google_safe:"adsafe",google_tag_info:"gut",google_targeting:"targeting",google_ui_features:"ui",google_ui_version:"uiv",google_video_doc_id:"video_doc_id",google_video_product_type:"video_product_type"},lb={google_ad_client:"client",google_ad_format:"format",google_ad_output:"output",google_ad_callback:"callback",google_ad_height:"h",google_ad_override:"google_ad_override",
+google_ad_slot:"slotname",google_ad_width:"w",google_ctr_threshold:"ctr_t",google_image_size:"image_size",google_last_modified_time:"lmt",google_max_num_ads:"num_ads",google_max_radlink_len:"max_radlink_len",google_num_radlinks:"num_radlinks",google_num_radlinks_per_unit:"num_radlinks_per_unit",google_only_ads_with_video:"only_ads_with_video",google_rl_dest_url:"rl_dest_url",google_rl_filtering:"rl_filtering",google_rl_mode:"rl_mode",google_rt:"rt",google_skip:"skip"},mb={google_only_pyv_ads:"pyv",
+google_with_pyv_ads:"withpyv"};function nb(a,b){try{return a.top.document.URL==b.URL}catch(c){}return j}function pb(a,b,c,d){c=c||a.google_ad_width;d=d||a.google_ad_height;if(nb(a,b))return j;var e=b.documentElement;if(c&&d){var f=1,i=1;if(a.innerHeight){f=a.innerWidth;i=a.innerHeight}else if(e&&e.clientHeight){f=e.clientWidth;i=e.clientHeight}else if(b.body){f=b.body.clientWidth;i=b.body.clientHeight}if(i>2*d||f>2*c)return j}return g}function qb(a,b){L(b,function(c,d){a["google_"+d]=c})}
+function rb(a,b){if(!b)return a.URL;return a.referrer}function sb(a,b){if(!b&&a.google_referrer_url==h)return"0";else if(b&&a.google_referrer_url==h)return"1";else if(!b&&a.google_referrer_url!=h)return"2";else if(b&&a.google_referrer_url!=h)return"3";return"4"}function tb(a,b,c,d){a.page_url=rb(c,d);a.page_location=h}function ub(a,b,c,d){a.page_url=b.google_page_url;a.page_location=rb(c,d)||"EMPTY"}
+function vb(a,b){var c={},d=pb(a,b,a.google_ad_width,a.google_ad_height);c.iframing=sb(a,d);a.google_page_url?ub(c,a,b,d):tb(c,a,b,d);c.last_modified_time=b.URL==c.page_url?Date.parse(b.lastModified)/1E3:h;c.referrer_url=d?a.google_referrer_url:a.google_page_url&&a.google_referrer_url?a.google_referrer_url:b.referrer;return c}function wb(a){var b={},c=a.URL.substring(a.URL.lastIndexOf("http"));b.iframing=h;b.page_url=c;b.page_location=a.URL;b.last_modified_time=h;b.referrer_url=c;return b}
+function xb(a,b){b=yb(a,b);qb(a,b)}function yb(a,b){return a=a.google_page_url==h&&zb[b.domain]?wb(b):vb(a,b)}var zb={};zb["ad.yieldmanager.com"]=g;var Ab=r("0.0001",0),Bb=r("1",0.01),Cb=r("0.01",0),Db=r("0.01",0),Eb=r("0.008",0),Fb=r("0.01",0),Gb=r("0",0);var Hb=s("false",j),Ib=s("false",j),Jb=s("false",j);var Kb=function(a,b,c){b=fa(b,l,a);a=window.onerror;window.onerror=b;try{c()}catch(d){c=d.toString();var e="";if(d.fileName)e=d.fileName;var f=-1;if(d.lineNumber)f=d.lineNumber;b=b(c,e,f);if(!b)throw d;}window.onerror=a};q("google_protectAndRun",Kb);
+var Mb=function(a,b,c,d){if(Math.random()<0.01){var e=$a;a=["http://",ja(),"/pagead/gen_204","?id=jserror","&jscb=",Hb?1:0,"&jscd=",Ib?1:0,"&context=",M(a),"&msg=",M(b),"&file=",M(c),"&line=",M(d.toString()),"&url=",M(e.URL.substring(0,512)),"&ref=",M(e.referrer.substring(0,512))];a.push(Lb());cb(K,a.join(""))}return!Jb};q("google_handleError",Mb);
+var Ob=function(a){Nb|=a},Nb=0,Lb=function(){var a=["&client=",M(K.google_ad_client),"&format=",M(K.google_ad_format),"&slotname=",M(K.google_ad_slot),"&output=",M(K.google_ad_output),"&ad_type=",M(K.google_ad_type)];return a.join("")};var Q="",Rb=function(){if(window.google_ad_frameborder==h)window.google_ad_frameborder=0;if(window.google_ad_output==h)window.google_ad_output="html";if(O(window.google_ad_format)){var a=window.google_ad_format.match(/^(\d+)x(\d+)_.*/);if(a){window.google_ad_width=parseInt(a[1],10);window.google_ad_height=parseInt(a[2],10);window.google_ad_output="html"}}window.google_ad_format=Pb(window.google_ad_format,window.google_ad_output,window.google_ad_width,window.google_ad_height,window.google_ad_slot,
+!!window.google_override_format);Q=window.google_ad_client||"";window.google_ad_client=Qb(window.google_ad_format,window.google_ad_client);xb(window,document);if(window.google_num_slots_by_channel==h)window.google_num_slots_by_channel={};if(window.google_viewed_host_channels==h)window.google_viewed_host_channels={};if(window.google_num_slots_by_client==h)window.google_num_slots_by_client={};if(window.google_prev_ad_formats_by_region==h)window.google_prev_ad_formats_by_region={};if(window.google_prev_ad_slotnames_by_region==
+h)window.google_prev_ad_slotnames_by_region={};if(window.google_correlator==h)window.google_correlator=(new Date).getTime();if(window.google_adslot_loaded==h)window.google_adslot_loaded={};if(window.google_adContentsBySlot==h)window.google_adContentsBySlot={};if(window.google_flash_version==h)window.google_flash_version=fb();if(window.google_new_domain_checked==h)window.google_new_domain_checked=0;if(window.google_new_domain_enabled==h)window.google_new_domain_enabled=0;if(!window.google_num_ad_slots)window.google_num_ad_slots=
+0;if(!window.google_num_0ad_slots)window.google_num_0ad_slots=0;if(!window.google_num_sdo_slots)window.google_num_sdo_slots=0;window.google_ad_section=window.google_ad_section||window.google_ad_region||"";window.google_country=window.google_country||window.google_gl||"";a=(new Date).getTime();if(o(window.google_color_bg))window.google_color_bg=R(window.google_color_bg,a);if(o(window.google_color_text))window.google_color_text=R(window.google_color_text,a);if(o(window.google_color_link))window.google_color_link=
+R(window.google_color_link,a);if(o(window.google_color_url))window.google_color_url=R(window.google_color_url,a);if(o(window.google_color_border))window.google_color_border=R(window.google_color_border,a);if(o(window.google_color_line))window.google_color_line=R(window.google_color_line,a)},Sb=function(a){L(kb,function(b,c){a[c]=h});L(lb,function(b,c){a[c]=h});L(mb,function(b,c){a[c]=h});a.google_container_id=h;a.google_eids=h;a.google_page_location=h;a.google_referrer_url=h;a.google_ad_region=h;
+a.google_gl=h},R=function(a,b){Ob(2);return a[b%a.length]},Qb=function(a,b){if(!b)return"";b=b.toLowerCase();return b=O(a)?Tb(b):Ub(b)},Ub=function(a){if(a&&a.substring(0,3)!="ca-")a="ca-"+a;return a},Tb=function(a){if(a&&a.substring(0,7)!="ca-aff-")a="ca-aff-"+a;return a},Pb=function(a,b,c,d,e,f){if(!a&&b=="html")a=c+"x"+d;return a=Vb(a,e,f)?a.toLowerCase():""},Vb=function(a,b,c){if(!a)return j;if(!b)return g;return c};var S=document,T=navigator,U=window;
+function Wb(){var a=S.cookie,b=Math.round((new Date).getTime()/1E3),c=U.google_analytics_domain_name;c=typeof c=="undefined"?Xb("auto"):Xb(c);var d=a.indexOf("__utma="+c+".")>-1,e=a.indexOf("__utmb="+c)>-1,f=a.indexOf("__utmc="+c)>-1,i={},n=!!U&&!!U.gaGlobal;if(d){a=a.split("__utma="+c+".")[1].split(";")[0].split(".");i.sid=e&&f?a[3]+"":n&&U.gaGlobal.sid?U.gaGlobal.sid:b+"";i.vid=a[0]+"."+a[1];i.from_cookie=g}else{i.sid=n&&U.gaGlobal.sid?U.gaGlobal.sid:b+"";i.vid=n&&U.gaGlobal.vid?U.gaGlobal.vid:
+(Math.round(Math.random()*2147483647)^Yb()&2147483647)+"."+b;i.from_cookie=j}i.dh=c;i.hid=n&&U.gaGlobal.hid?U.gaGlobal.hid:Math.round(Math.random()*2147483647);return U.gaGlobal=i}
+function Yb(){var a=S.cookie?S.cookie:"",b=U.history.length,c,d=[T.appName,T.version,T.language?T.language:T.browserLanguage,T.platform,T.userAgent,T.javaEnabled()?1:0].join("");if(U.screen)d+=U.screen.width+"x"+U.screen.height+U.screen.colorDepth;else if(U.java){c=java.awt.Toolkit.getDefaultToolkit().getScreenSize();d+=c.screen.width+"x"+c.screen.height}d+=a;d+=S.referrer?S.referrer:"";for(a=d.length;b>0;)d+=b--^a++;return Zb(d)}
+function Zb(a){var b=1,c=0,d;if(!(a==undefined||a=="")){b=0;for(d=a.length-1;d>=0;d--){c=a.charCodeAt(d);b=(b<<6&268435455)+c+(c<<14);c=b&266338304;b=c!=0?b^c>>21:b}}return b}function Xb(a){if(!a||a==""||a=="none")return 1;if("auto"==a){a=S.domain;if("www."==a.substring(0,4))a=a.substring(4,a.length)}return Zb(a.toLowerCase())};var V=function(){this.defaultBucket=[];this.layers={};for(var a=0,b=arguments.length;a<b;++a)this.layers[arguments[a]]=""},$b=function(a){for(var b=new V,c=0,d=a.defaultBucket.length;c<d;++c)b.defaultBucket.push(a.defaultBucket[c]);L(a.layers,fa(V.prototype.f,b));return b},ac=function(a){if(!(a&&a.defaultBucket&&a.defaultBucket.push&&a.layers))return j;var b=g,c=function(d,e){if(!(e in a)||typeof d!=typeof a[e])b=j};L(V.prototype,c);return b};V.prototype.f=function(a,b){this.layers[b]=a};
+V.prototype.z=function(a,b){if(a=="")return"";if(!b){this.defaultBucket.push(a);return a}if(this.layers.hasOwnProperty(b))return this.layers[b]=a;return""};V.prototype.d=function(a,b,c){if(!(Math.random()<1.0E-4)&&this.p(c)){var d=Math.random();if(d<b){b=Math.floor(a.length*d/b);if(a=a[b])return this.z(a,c)}}return""};V.prototype.p=function(a){if(!a)return g;return this.layers.hasOwnProperty(a)&&this.layers[a]==""};V.prototype.a=function(a){if(this.layers.hasOwnProperty(a))return this.layers[a];return""};
+V.prototype.o=function(){var a=[],b=function(c){c!=""&&a.push(c)};L(this.layers,b);if(this.defaultBucket.length>0&&a.length>0)return this.defaultBucket.join(",")+","+a.join(",");return this.defaultBucket.join(",")+a.join(",")};var bc={google:1,googlegroups:1,gmail:1,googlemail:1,googleimages:1,googleprint:1};function cc(a){a=a.google_page_location||a.google_page_url;if(!a)return j;a=a.toString();if(a.indexOf("http://")==0)a=a.substring(7,a.length);else if(a.indexOf("https://")==0)a=a.substring(8,a.length);var b=a.indexOf("/");if(b==-1)b=a.length;a=a.substring(0,b);a=a.split(".");b=j;if(a.length>=3)b=a[a.length-3]in bc;if(a.length>=2)b=b||a[a.length-2]in bc;return b}
+function dc(a,b,c){if(cc(a)){a.google_new_domain_checked=1;return j}if(a.google_new_domain_checked==0){var d=Math.random();if(d<=c){c="http://"+ia()+"/pagead/test_domain.js";d="script";b.write("<"+d+' src="'+c+'"></'+d+">");a.google_new_domain_checked=1;return g}}return j}var ec=function(a,b){if(!b)return j;if(b.a("1")=="44901211")return 0==a%2;if(b.a("1")=="44901215")return 0==Math.floor(a/2)%2;if(b.a("1")=="44901216")return 1==Math.floor(a/2)%2;return j};
+function fc(a,b,c){if(!cc(a)&&a.google_new_domain_enabled==1)return ec(b,c)?"http://"+t("","googleads2.g.doubleclick.net"):"http://"+ia();return"http://"+ja()};var W=function(a){this.A=a;this.i=[];this.h=0;this.b=[];this.t=0;this.c=[];this.r=j;this.j=this.k="";this.q=j};W.prototype.v=function(a,b){var c=this.A[b],d=this.i;this.A[b]=function(e){if(e&&e.length>0){var f=e.length>1?e[1].url:h;d.push([a,wa(e[0].url),f])}c(e)}};W.prototype.u=function(){this.h++};W.prototype.w=function(a){this.b.push(a)};var gc="http://"+u()+"/pagead/osd.js";W.prototype.s=function(){if(!this.r){bb(gc);this.r=g}};
+W.prototype.l=function(a){if(this.h>0)for(var b=document.getElementsByTagName("iframe"),c=this.q?"google_ads_iframe_":"google_ads_frame",d=0;d<b.length;d++){var e=b.item(d);e.src&&e.name&&e.name.indexOf(c)==0&&a(e,e.src)}};
+W.prototype.m=function(a){var b=this.i;if(b.length>0)for(var c=document.getElementsByTagName("a"),d=0;d<c.length;d++)for(var e=0;e<b.length;e++)if(c.item(d).href==b[e][1]){var f=c.item(d).parentNode;if(b[e][2])for(var i=f,n=0;n<4;n++){if(i.innerHTML.indexOf(b[e][2])>0){f=i;break}i=i.parentNode}a(f,b[e][0]);b.splice(e,1);break}};W.prototype.n=function(a){for(var b=0;b<this.b.length;b++){var c=this.b[b],d=hc(c);if(d)(d=document.getElementById("google_ads_div_"+d))&&a(d,c)}};
+W.prototype.e=function(a){this.m(a);this.n(a);this.l(a)};W.prototype.setupOsd=function(a,b,c){this.t=a;this.k=b;this.j=c};W.prototype.getOsdMode=function(){return this.t};W.prototype.getEid=function(){return this.k};W.prototype.getCorrelator=function(){return this.j};W.prototype.g=function(){return this.i.length+this.h+this.b.length};W.prototype.setValidOutputTypes=function(a){this.c=a};
+W.prototype.registerAdBlockByType=function(a,b,c){if(this.c.length>0){for(var d=0;d<this.c.length;d++)if(this.c[d]==a){this.q=c;if(a=="js")this.v(b,"google_ad_request_done");else if(a=="html")this.u();else a=="json_html"&&this.w(b)}this.s()}};var hc=function(a){if((a=a.match(/[&\?](?:slotname)=([^&]+)/))&&a.length==2)return a[1];return""},ic=function(){window.__google_ad_urls||(window.__google_ad_urls=new W(window));return window.__google_ad_urls};q("Goog_AdSense_getAdAdapterInstance",ic);
+q("Goog_AdSense_OsdAdapter",W);q("Goog_AdSense_OsdAdapter.prototype.numBlocks",W.prototype.g);q("Goog_AdSense_OsdAdapter.prototype.findBlocks",W.prototype.e);q("Goog_AdSense_OsdAdapter.prototype.getOsdMode",W.prototype.getOsdMode);q("Goog_AdSense_OsdAdapter.prototype.getEid",W.prototype.getEid);q("Goog_AdSense_OsdAdapter.prototype.getCorrelator",W.prototype.getCorrelator);q("Goog_AdSense_OsdAdapter.prototype.setValidOutputTypes",W.prototype.setValidOutputTypes);
+q("Goog_AdSense_OsdAdapter.prototype.setupOsd",W.prototype.setupOsd);q("Goog_AdSense_OsdAdapter.prototype.registerAdBlockByType",W.prototype.registerAdBlockByType);var jc=function(a,b){var c=a.nodeType==9?a:a.ownerDocument||a.document;if(c.defaultView&&c.defaultView.getComputedStyle)if(a=c.defaultView.getComputedStyle(a,""))return a[b];return h},kc=function(a,b){return jc(a,b)||(a.currentStyle?a.currentStyle[b]:h)||a.style[b]},lc=function(a,b,c,d){if(/^\d+px?$/.test(b))return parseInt(b,10);else{var e=a.style[c],f=a.runtimeStyle[c];a.runtimeStyle[c]=a.currentStyle[c];a.style[c]=b;b=a.style[d];a.style[c]=e;a.runtimeStyle[c]=f;return b}},mc=function(a){var b=
+a.nodeType==9?a:a.ownerDocument||a.document,c="";if(b.createTextRange){c=b.body.createTextRange();c.moveToElementText(a);c=c.queryCommandValue("FontName")}if(!c){c=kc(a,"fontFamily");if(H&&Na)c=c.replace(/ \[[^\]]*\]/,"")}a=c.split(",");if(a.length>1)c=a[0];return xa(c,"\"'")},nc=/[^\d]+$/,oc=function(a){return(a=a.match(nc))&&a[0]||h},pc={cm:1,"in":1,mm:1,pc:1,pt:1},qc={em:1,ex:1},rc=function(a){var b=kc(a,"fontSize"),c=oc(b);if(b&&"px"==c)return parseInt(b,10);if(I)if(c in pc)return lc(a,b,"left",
+"pixelLeft");else if(a.parentNode&&a.parentNode.nodeType==1&&c in qc){a=a.parentNode;c=kc(a,"fontSize");return lc(a,b==c?"1em":b,"left","pixelLeft")}c=Xa("span",{style:"visibility:hidden;position:absolute;line-height:0;padding:0;margin:0;border:0;height:1em;"});Za(a,c);b=c.offsetHeight;c&&c.parentNode&&c.parentNode.removeChild(c);return b};var sc,X={};function tc(a){if(a==1)return g;return!X[a]}function uc(a,b){if(!(!a||a==""))if(b==1)if(X[b])X[b]+=","+a;else X[b]=a;else X[b]=a}function vc(){var a=[];L(X,function(b){a.push(b)});return a.join(",")}function wc(a,b){if(o(a))for(var c=0;c<a.length;c++)p(a[c])&&uc(a[c],b)}var Y=j;
+function xc(a,b){var c="script";Y=yc(a,b);if(!Y)a.google_allow_expandable_ads=j;var d=!zc();Y&&d&&b.write("<"+c+' src="http://'+u()+'/pagead/expansion_embed.js"></'+c+">");a=dc(a,b,Bb);(d=d||a)&&db("msie")&&!window.opera?b.write("<"+c+' src="http://'+u()+'/pagead/render_ads.js"></'+c+">"):b.write("<"+c+'>google_protectAndRun("ads_core.google_render_ad", google_handleError, google_render_ad);</'+c+">")}function Z(a){return a!=h?'"'+a+'"':'""'}
+function Ac(a){var b="google_unique_id";if(a[b])++a[b];else a[b]=1;return a[b]}var Bc=function(a,b){var c=b.slice(-1),d=c=="?"||c=="#"?"":"&",e=[b];b=function(f,i){if(f||f===0||f===j){if(typeof f=="boolean")f=f?1:0;ab(e,d,i,"=",M(f));d="&"}};L(a,b);return e.join("")};function Cc(){var a=I&&J("6"),b=Fa&&J("1.8.1"),c=Ga&&J("525");if(Ma&&(a||b||c))return g;else if(La&&(c||b))return g;else if(Na&&b)return g;return j}
+function zc(){return(typeof ExpandableAdSlotFactory=="function"||typeof ExpandableAdSlotFactory=="object")&&typeof ExpandableAdSlotFactory.createIframe=="function"}function yc(a,b){if(a.google_allow_expandable_ads===j||!b.body||a.google_ad_output!="html"||pb(a,b)||!Dc(a)||isNaN(a.google_ad_height)||isNaN(a.google_ad_width)||!Cc())return j;return g}function Dc(a){var b=a.google_ad_format;if(O(b))return j;if(N(a)&&b!="468x15_0ads_al")return j;return g}
+function Ec(){var a;if(K.google_ad_output=="html"&&!(N(K)||O(K.google_ad_format))&&tc(0)){a=["6083035","6083034"];a=P(a,Gb);uc(a,0)}return a=="6083035"}function Fc(a,b){if((a.google_unique_id||0)!=0||O(a.google_ad_format))return"";var c="";a=N(a);if(b=="html"||a)c=P(["36815001","36815002"],Cb);if(c==""&&(b=="js"||a))c=P(["36815003","36815004"],Db);if(c==""&&(b=="html"||b=="js"))c=P(["36813005","36813006"],Eb);return c}
+function Gc(){var a=ic(),b=window.google_enable_osd,c;if(b===g){c="36813006";Hc(c,a)}else if(b!==j&&tc(0)){c=a.getEid();if(c=="")(c=Fc(window,window.google_ad_output))&&Hc(c,a);else if(c!="36815001"&&c!="36815002"&&c!="36815003"&&c!="36815004"&&c!="36813005"&&c!="36813006")c=""}if(c){uc(c,0);return c}return""}
+function Hc(a,b){var c=b.getOsdMode(),d=[];switch(a){case "36815004":c=1;d=["js"];break;case "36815002":c=1;d=["html"];break;case "36813006":c=0;d=["html","js"];break}d.length>0&&b.setValidOutputTypes(d);b.setupOsd(c,a,window.google_correlator)}
+function Ic(a,b,c,d){var e=Ac(a);c=Bc({ifi:e},c);c=c.substring(0,1992);c=c.replace(/%\w?$/,"");var f="script";if((a.google_ad_output=="js"||a.google_ad_output=="json_html")&&(a.google_ad_request_done||a.google_radlink_request_done))b.write("<"+f+' language="JavaScript1.1" src='+Z(k(c))+"></"+f+">");else if(a.google_ad_output=="html")if(Y&&zc()){b=a.google_container_id||d||h;a["google_expandable_ad_slot"+e]=ExpandableAdSlotFactory.createIframe("google_ads_frame"+e,k(c),a.google_ad_width,a.google_ad_height,
+b)}else{e='<iframe name="google_ads_frame" width='+Z(a.google_ad_width)+" height="+Z(a.google_ad_height)+" frameborder="+Z(a.google_ad_frameborder)+" src="+Z(k(c))+' marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no"></iframe>';a.google_container_id?Jc(a.google_container_id,b,e):b.write(e)}return c}function Kc(a){Sb(a)}
+function Lc(a){var b=Mc().a("ac1")=="44901217";if(!Nc(b))return j;b=Ec();var c=fc(window,window.google_unique_id||0,Mc());a=Oc(a);b=c+Pc(a.google_ad_format,b);window.google_ad_url=Bc(a,b);return g}
+var Sc=function(a){a.dt=aa;var b=window.google_prev_ad_formats_by_region,c=window.google_ad_section,d=window.google_ad_format,e=window.google_ad_slot;if(b[c])if(!O(d)){a.prev_fmts=b[c];if(window.google_num_slots_by_client.length>1)a.slot=window.google_num_slots_by_client[Q]}var f=window.google_prev_ad_slotnames_by_region;if(f[c])a.prev_slotnames=f[c].toLowerCase();if(d){if(!O(d))if(b[c])b[c]+=","+d;else b[c]=d}else if(e)if(f[c])f[c]+=","+e;else f[c]=e;a.correlator=window.google_correlator;if(window.google_new_domain_checked==
+1&&window.google_new_domain_enabled==0)a.dblk=1;if(window.google_ad_channel){b=window.google_num_slots_by_channel;c="";d=window.google_ad_channel.split(Qc);for(e=0;e<d.length;e++){f=d[e];if(b[f])c+=f+"+";else b[f]=1}a.pv_ch=c}if(window.google_ad_host_channel){b=Rc(window.google_ad_host_channel,window.google_viewed_host_channels);a.pv_h_ch=b}if(Hb)a.jscb=1;if(Ib)a.jscd=1;a.frm=window.google_iframing;b=Wb();a.ga_vid=b.vid;a.ga_sid=b.sid;a.ga_hid=b.hid;a.ga_fc=b.from_cookie;a.ga_wpids=window.google_analytics_uacct},
+Tc=function(a){var b=g;if(b=hb(b)){a.biw=b.width;a.bih=b.height}},Uc=function(a){var b=jb(window);if(b!=0)a.ifk=b.toString()};function Rc(a,b){var c=a.split("|");a=-1;for(var d=[],e=0;e<c.length;e++){var f=c[e].split(Qc);b[e]||(b[e]={});for(var i="",n=0;n<f.length;n++){var y=f[n];if(y!="")if(b[e][y])i+="+"+y;else b[e][y]=1}i=i.slice(1);d[e]=i;if(i!="")a=e}b="";if(a>-1){for(e=0;e<a;e++)b+=d[e]+"|";b+=d[a]}return b}
+var $=function(){if(window.google_exp_persistent&&ac(window.google_exp_persistent))return window.google_exp_persistent;return new V("1","ac1")};q("google_exp_persistent",$());var Mc=function(){sc||(sc=$b($()));return sc};function Vc(){var a=["44901211","44901215","44901216","44901212"];$().d(a,Ab,"1");a=["44901217","44901218"];$().d(a,Fb,"ac1")}
+function Wc(){0==(window.google_unique_id||0)&&Vc();var a=Gc(),b=Math.random()<0.01,c=h,d="";if(b){d="google_temp_span";c=Xc(d)}b=Lc(c);c&&c.id==d&&(c&&c.parentNode?c.parentNode.removeChild(c):h);if(b){c=Ic(window,document,window.google_ad_url);a&&ic().registerAdBlockByType(window.google_ad_output,c,j);Kc(window)}}
+var Yc=function(a){L(lb,function(b,c){a[b]=window[c]});L(kb,function(b,c){a[b]=window[c]});L(mb,function(b,c){a[b]=window[c]})},Zc=function(a){wc(window.google_eids,1);a.eid=vc();var b=Mc().o();if(a.eid.length>0&&b.length>0)a.eid+=",";a.eid+=b};function $c(a,b,c,d){a=Mb(a,b,c,d);xc(window,document);return a}function ad(){Rb()}
+function bd(a){var b={};a=a.split("?");a=a[a.length-1].split("&");for(var c=0;c<a.length;c++){var d=a[c].split("=");if(d[0])try{b[d[0].toLowerCase()]=d.length>1?window.decodeURIComponent?decodeURIComponent(d[1].replace(/\+/g," ")):unescape(d[1]):""}catch(e){}}return b}function cd(){var a=window,b=bd(document.URL);if(b.google_ad_override){a.google_ad_override=b.google_ad_override;a.google_adtest="on"}}
+function Jc(a,b,c){if(a)if((a=b.getElementById(a))&&c&&c.length!=""){a.style.visibility="visible";a.innerHTML=c}}
+var Pc=function(a,b){return a=O(a)?"/pagead/sdo?":b?"/pagead/render_iframe_ads.html#":"/pagead/ads?"},dd=function(a,b){b.dff=mc(a);b.dfs=rc(a)},ed=function(a){a.ref=window.google_referrer_url;a.loc=window.google_page_location},Nc=function(a){var b=window.google_prev_ad_formats_by_region,c=window.google_prev_ad_slotnames_by_region,d=window.google_ad_section;if(O(window.google_ad_format)){window.google_num_sdo_slots+=1;if(!a&&window.google_num_sdo_slots>4)return j}else if(N(window)){window.google_num_0ad_slots+=
+1;if(!a&&window.google_num_0ad_slots>3)return j}else{window.google_num_ad_slots+=1;if(window.google_num_slots_to_rotate){Ob(1);b[d]=h;c[d]=h;if(window.google_num_slot_to_show==h)window.google_num_slot_to_show=(new Date).getTime()%window.google_num_slots_to_rotate+1;if(window.google_num_slot_to_show!=window.google_num_ad_slots)return j}else if(!a&&window.google_num_ad_slots>6&&d=="")return j}a=window.google_num_slots_by_client;if(a[Q])a[Q]+=1;else{a[Q]=1;a.length+=1}return g},Oc=function(a){var b=
+{};Yc(b);Sc(b);gb(b);a&&dd(a,b);Tc(b);Uc(b);Zc(b);ed(b);b.fu=Nb;return b},Xc=function(a){var b=window.google_container_id&&Sa(window.google_container_id)||Sa(a);if(!b&&!window.google_container_id&&a){document.write("<span id="+a+"></span>");b=Sa(a)}return b},Qc=/[+, ]/;window.google_render_ad=Wc;function fd(){if(Jb&&typeof K.alternateShowAds=="function")K.alternateShowAds.call(h);else{cd();Kb("show_ads.google_init_globals",$c,ad);xc(window,document)}}Kb("show_ads.main",Mb,fd);})()
+</script>
+
+
+<script id="mochikit" type="x">
+/***
+
+ MochiKit.MochiKit 1.4.2 : PACKED VERSION
+
+ THIS FILE IS AUTOMATICALLY GENERATED. If creating patches, please
+ diff against the source tree, not this file.
+
+ See <http://mochikit.com/> for documentation, downloads, license, etc.
+
+ (c) 2005 Bob Ippolito. All rights Reserved.
+
+***/
+
+if(typeof (dojo)!="undefined"){
+dojo.provide("MochiKit.Base");
+}
+if(typeof (MochiKit)=="undefined"){
+MochiKit={};
+}
+if(typeof (MochiKit.Base)=="undefined"){
+MochiKit.Base={};
+}
+if(typeof (MochiKit.__export__)=="undefined"){
+MochiKit.__export__=(MochiKit.__compat__||(typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined"));
+}
+MochiKit.Base.VERSION="1.4.2";
+MochiKit.Base.NAME="MochiKit.Base";
+MochiKit.Base.update=function(_1,_2){
+if(_1===null||_1===undefined){
+_1={};
+}
+for(var i=1;i<arguments.length;i++){
+var o=arguments[i];
+if(typeof (o)!="undefined"&&o!==null){
+for(var k in o){
+_1[k]=o[k];
+}
+}
+}
+return _1;
+};
+MochiKit.Base.update(MochiKit.Base,{__repr__:function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+},toString:function(){
+return this.__repr__();
+},camelize:function(_6){
+var _7=_6.split("-");
+var cc=_7[0];
+for(var i=1;i<_7.length;i++){
+cc+=_7[i].charAt(0).toUpperCase()+_7[i].substring(1);
+}
+return cc;
+},counter:function(n){
+if(arguments.length===0){
+n=1;
+}
+return function(){
+return n++;
+};
+},clone:function(_b){
+var me=arguments.callee;
+if(arguments.length==1){
+me.prototype=_b;
+return new me();
+}
+},_deps:function(_d,_e){
+if(!(_d in MochiKit)){
+MochiKit[_d]={};
+}
+if(typeof (dojo)!="undefined"){
+dojo.provide("MochiKit."+_d);
+}
+for(var i=0;i<_e.length;i++){
+if(typeof (dojo)!="undefined"){
+dojo.require("MochiKit."+_e[i]);
+}
+if(typeof (JSAN)!="undefined"){
+JSAN.use("MochiKit."+_e[i],[]);
+}
+if(!(_e[i] in MochiKit)){
+throw "MochiKit."+_d+" depends on MochiKit."+_e[i]+"!";
+}
+}
+},_flattenArray:function(res,lst){
+for(var i=0;i<lst.length;i++){
+var o=lst[i];
+if(o instanceof Array){
+arguments.callee(res,o);
+}else{
+res.push(o);
+}
+}
+return res;
+},flattenArray:function(lst){
+return MochiKit.Base._flattenArray([],lst);
+},flattenArguments:function(lst){
+var res=[];
+var m=MochiKit.Base;
+var _18=m.extend(null,arguments);
+while(_18.length){
+var o=_18.shift();
+if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){
+for(var i=o.length-1;i>=0;i--){
+_18.unshift(o[i]);
+}
+}else{
+res.push(o);
+}
+}
+return res;
+},extend:function(_1b,obj,_1d){
+if(!_1d){
+_1d=0;
+}
+if(obj){
+var l=obj.length;
+if(typeof (l)!="number"){
+if(typeof (MochiKit.Iter)!="undefined"){
+obj=MochiKit.Iter.list(obj);
+l=obj.length;
+}else{
+throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
+}
+}
+if(!_1b){
+_1b=[];
+}
+for(var i=_1d;i<l;i++){
+_1b.push(obj[i]);
+}
+}
+return _1b;
+},updatetree:function(_20,obj){
+if(_20===null||_20===undefined){
+_20={};
+}
+for(var i=1;i<arguments.length;i++){
+var o=arguments[i];
+if(typeof (o)!="undefined"&&o!==null){
+for(var k in o){
+var v=o[k];
+if(typeof (_20[k])=="object"&&typeof (v)=="object"){
+arguments.callee(_20[k],v);
+}else{
+_20[k]=v;
+}
+}
+}
+}
+return _20;
+},setdefault:function(_26,obj){
+if(_26===null||_26===undefined){
+_26={};
+}
+for(var i=1;i<arguments.length;i++){
+var o=arguments[i];
+for(var k in o){
+if(!(k in _26)){
+_26[k]=o[k];
+}
+}
+}
+return _26;
+},keys:function(obj){
+var _2c=[];
+for(var _2d in obj){
+_2c.push(_2d);
+}
+return _2c;
+},values:function(obj){
+var _2f=[];
+for(var _30 in obj){
+_2f.push(obj[_30]);
+}
+return _2f;
+},items:function(obj){
+var _32=[];
+var e;
+for(var _34 in obj){
+var v;
+try{
+v=obj[_34];
+}
+catch(e){
+continue;
+}
+_32.push([_34,v]);
+}
+return _32;
+},_newNamedError:function(_36,_37,_38){
+_38.prototype=new MochiKit.Base.NamedError(_36.NAME+"."+_37);
+_36[_37]=_38;
+},operator:{truth:function(a){
+return !!a;
+},lognot:function(a){
+return !a;
+},identity:function(a){
+return a;
+},not:function(a){
+return ~a;
+},neg:function(a){
+return -a;
+},add:function(a,b){
+return a+b;
+},sub:function(a,b){
+return a-b;
+},div:function(a,b){
+return a/b;
+},mod:function(a,b){
+return a%b;
+},mul:function(a,b){
+return a*b;
+},and:function(a,b){
+return a&b;
+},or:function(a,b){
+return a|b;
+},xor:function(a,b){
+return a^b;
+},lshift:function(a,b){
+return a<<b;
+},rshift:function(a,b){
+return a>>b;
+},zrshift:function(a,b){
+return a>>>b;
+},eq:function(a,b){
+return a==b;
+},ne:function(a,b){
+return a!=b;
+},gt:function(a,b){
+return a>b;
+},ge:function(a,b){
+return a>=b;
+},lt:function(a,b){
+return a<b;
+},le:function(a,b){
+return a<=b;
+},seq:function(a,b){
+return a===b;
+},sne:function(a,b){
+return a!==b;
+},ceq:function(a,b){
+return MochiKit.Base.compare(a,b)===0;
+},cne:function(a,b){
+return MochiKit.Base.compare(a,b)!==0;
+},cgt:function(a,b){
+return MochiKit.Base.compare(a,b)==1;
+},cge:function(a,b){
+return MochiKit.Base.compare(a,b)!=-1;
+},clt:function(a,b){
+return MochiKit.Base.compare(a,b)==-1;
+},cle:function(a,b){
+return MochiKit.Base.compare(a,b)!=1;
+},logand:function(a,b){
+return a&&b;
+},logor:function(a,b){
+return a||b;
+},contains:function(a,b){
+return b in a;
+}},forwardCall:function(_76){
+return function(){
+return this[_76].apply(this,arguments);
+};
+},itemgetter:function(_77){
+return function(arg){
+return arg[_77];
+};
+},typeMatcher:function(){
+var _79={};
+for(var i=0;i<arguments.length;i++){
+var typ=arguments[i];
+_79[typ]=typ;
+}
+return function(){
+for(var i=0;i<arguments.length;i++){
+if(!(typeof (arguments[i]) in _79)){
+return false;
+}
+}
+return true;
+};
+},isNull:function(){
+for(var i=0;i<arguments.length;i++){
+if(arguments[i]!==null){
+return false;
+}
+}
+return true;
+},isUndefinedOrNull:function(){
+for(var i=0;i<arguments.length;i++){
+var o=arguments[i];
+if(!(typeof (o)=="undefined"||o===null)){
+return false;
+}
+}
+return true;
+},isEmpty:function(obj){
+return !MochiKit.Base.isNotEmpty.apply(this,arguments);
+},isNotEmpty:function(obj){
+for(var i=0;i<arguments.length;i++){
+var o=arguments[i];
+if(!(o&&o.length)){
+return false;
+}
+}
+return true;
+},isArrayLike:function(){
+for(var i=0;i<arguments.length;i++){
+var o=arguments[i];
+var typ=typeof (o);
+if((typ!="object"&&!(typ=="function"&&typeof (o.item)=="function"))||o===null||typeof (o.length)!="number"||o.nodeType===3||o.nodeType===4){
+return false;
+}
+}
+return true;
+},isDateLike:function(){
+for(var i=0;i<arguments.length;i++){
+var o=arguments[i];
+if(typeof (o)!="object"||o===null||typeof (o.getTime)!="function"){
+return false;
+}
+}
+return true;
+},xmap:function(fn){
+if(fn===null){
+return MochiKit.Base.extend(null,arguments,1);
+}
+var _8a=[];
+for(var i=1;i<arguments.length;i++){
+_8a.push(fn(arguments[i]));
+}
+return _8a;
+},map:function(fn,lst){
+var m=MochiKit.Base;
+var itr=MochiKit.Iter;
+var _90=m.isArrayLike;
+if(arguments.length<=2){
+if(!_90(lst)){
+if(itr){
+lst=itr.list(lst);
+if(fn===null){
+return lst;
+}
+}else{
+throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
+}
+}
+if(fn===null){
+return m.extend(null,lst);
+}
+var _91=[];
+for(var i=0;i<lst.length;i++){
+_91.push(fn(lst[i]));
+}
+return _91;
+}else{
+if(fn===null){
+fn=Array;
+}
+var _93=null;
+for(i=1;i<arguments.length;i++){
+if(!_90(arguments[i])){
+if(itr){
+return itr.list(itr.imap.apply(null,arguments));
+}else{
+throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
+}
+}
+var l=arguments[i].length;
+if(_93===null||_93>l){
+_93=l;
+}
+}
+_91=[];
+for(i=0;i<_93;i++){
+var _95=[];
+for(var j=1;j<arguments.length;j++){
+_95.push(arguments[j][i]);
+}
+_91.push(fn.apply(this,_95));
+}
+return _91;
+}
+},xfilter:function(fn){
+var _98=[];
+if(fn===null){
+fn=MochiKit.Base.operator.truth;
+}
+for(var i=1;i<arguments.length;i++){
+var o=arguments[i];
+if(fn(o)){
+_98.push(o);
+}
+}
+return _98;
+},filter:function(fn,lst,_9d){
+var _9e=[];
+var m=MochiKit.Base;
+if(!m.isArrayLike(lst)){
+if(MochiKit.Iter){
+lst=MochiKit.Iter.list(lst);
+}else{
+throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
+}
+}
+if(fn===null){
+fn=m.operator.truth;
+}
+if(typeof (Array.prototype.filter)=="function"){
+return Array.prototype.filter.call(lst,fn,_9d);
+}else{
+if(typeof (_9d)=="undefined"||_9d===null){
+for(var i=0;i<lst.length;i++){
+var o=lst[i];
+if(fn(o)){
+_9e.push(o);
+}
+}
+}else{
+for(i=0;i<lst.length;i++){
+o=lst[i];
+if(fn.call(_9d,o)){
+_9e.push(o);
+}
+}
+}
+}
+return _9e;
+},_wrapDumbFunction:function(_a2){
+return function(){
+switch(arguments.length){
+case 0:
+return _a2();
+case 1:
+return _a2(arguments[0]);
+case 2:
+return _a2(arguments[0],arguments[1]);
+case 3:
+return _a2(arguments[0],arguments[1],arguments[2]);
+}
+var _a3=[];
+for(var i=0;i<arguments.length;i++){
+_a3.push("arguments["+i+"]");
+}
+return eval("(func("+_a3.join(",")+"))");
+};
+},methodcaller:function(_a5){
+var _a6=MochiKit.Base.extend(null,arguments,1);
+if(typeof (_a5)=="function"){
+return function(obj){
+return _a5.apply(obj,_a6);
+};
+}else{
+return function(obj){
+return obj[_a5].apply(obj,_a6);
+};
+}
+},method:function(_a9,_aa){
+var m=MochiKit.Base;
+return m.bind.apply(this,m.extend([_aa,_a9],arguments,2));
+},compose:function(f1,f2){
+var _ae=[];
+var m=MochiKit.Base;
+if(arguments.length===0){
+throw new TypeError("compose() requires at least one argument");
+}
+for(var i=0;i<arguments.length;i++){
+var fn=arguments[i];
+if(typeof (fn)!="function"){
+throw new TypeError(m.repr(fn)+" is not a function");
+}
+_ae.push(fn);
+}
+return function(){
+var _b2=arguments;
+for(var i=_ae.length-1;i>=0;i--){
+_b2=[_ae[i].apply(this,_b2)];
+}
+return _b2[0];
+};
+},bind:function(_b4,_b5){
+if(typeof (_b4)=="string"){
+_b4=_b5[_b4];
+}
+var _b6=_b4.im_func;
+var _b7=_b4.im_preargs;
+var _b8=_b4.im_self;
+var m=MochiKit.Base;
+if(typeof (_b4)=="function"&&typeof (_b4.apply)=="undefined"){
+_b4=m._wrapDumbFunction(_b4);
+}
+if(typeof (_b6)!="function"){
+_b6=_b4;
+}
+if(typeof (_b5)!="undefined"){
+_b8=_b5;
+}
+if(typeof (_b7)=="undefined"){
+_b7=[];
+}else{
+_b7=_b7.slice();
+}
+m.extend(_b7,arguments,2);
+var _ba=function(){
+var _bb=arguments;
+var me=arguments.callee;
+if(me.im_preargs.length>0){
+_bb=m.concat(me.im_preargs,_bb);
+}
+var _bd=me.im_self;
+if(!_bd){
+_bd=this;
+}
+return me.im_func.apply(_bd,_bb);
+};
+_ba.im_self=_b8;
+_ba.im_func=_b6;
+_ba.im_preargs=_b7;
+return _ba;
+},bindLate:function(_be,_bf){
+var m=MochiKit.Base;
+if(typeof (_be)!="string"){
+return m.bind.apply(this,arguments);
+}
+var _c1=m.extend([],arguments,2);
+var _c2=function(){
+var _c3=arguments;
+var me=arguments.callee;
+if(me.im_preargs.length>0){
+_c3=m.concat(me.im_preargs,_c3);
+}
+var _c5=me.im_self;
+if(!_c5){
+_c5=this;
+}
+return _c5[me.im_func].apply(_c5,_c3);
+};
+_c2.im_self=_bf;
+_c2.im_func=_be;
+_c2.im_preargs=_c1;
+return _c2;
+},bindMethods:function(_c6){
+var _c7=MochiKit.Base.bind;
+for(var k in _c6){
+var _c9=_c6[k];
+if(typeof (_c9)=="function"){
+_c6[k]=_c7(_c9,_c6);
+}
+}
+},registerComparator:function(_ca,_cb,_cc,_cd){
+MochiKit.Base.comparatorRegistry.register(_ca,_cb,_cc,_cd);
+},_primitives:{"boolean":true,"string":true,"number":true},compare:function(a,b){
+if(a==b){
+return 0;
+}
+var _d0=(typeof (a)=="undefined"||a===null);
+var _d1=(typeof (b)=="undefined"||b===null);
+if(_d0&&_d1){
+return 0;
+}else{
+if(_d0){
+return -1;
+}else{
+if(_d1){
+return 1;
+}
+}
+}
+var m=MochiKit.Base;
+var _d3=m._primitives;
+if(!(typeof (a) in _d3&&typeof (b) in _d3)){
+try{
+return m.comparatorRegistry.match(a,b);
+}
+catch(e){
+if(e!=m.NotFound){
+throw e;
+}
+}
+}
+if(a<b){
+return -1;
+}else{
+if(a>b){
+return 1;
+}
+}
+var _d4=m.repr;
+throw new TypeError(_d4(a)+" and "+_d4(b)+" can not be compared");
+},compareDateLike:function(a,b){
+return MochiKit.Base.compare(a.getTime(),b.getTime());
+},compareArrayLike:function(a,b){
+var _d9=MochiKit.Base.compare;
+var _da=a.length;
+var _db=0;
+if(_da>b.length){
+_db=1;
+_da=b.length;
+}else{
+if(_da<b.length){
+_db=-1;
+}
+}
+for(var i=0;i<_da;i++){
+var cmp=_d9(a[i],b[i]);
+if(cmp){
+return cmp;
+}
+}
+return _db;
+},registerRepr:function(_de,_df,_e0,_e1){
+MochiKit.Base.reprRegistry.register(_de,_df,_e0,_e1);
+},repr:function(o){
+if(typeof (o)=="undefined"){
+return "undefined";
+}else{
+if(o===null){
+return "null";
+}
+}
+try{
+if(typeof (o.__repr__)=="function"){
+return o.__repr__();
+}else{
+if(typeof (o.repr)=="function"&&o.repr!=arguments.callee){
+return o.repr();
+}
+}
+return MochiKit.Base.reprRegistry.match(o);
+}
+catch(e){
+if(typeof (o.NAME)=="string"&&(o.toString==Function.prototype.toString||o.toString==Object.prototype.toString)){
+return o.NAME;
+}
+}
+try{
+var _e3=(o+"");
+}
+catch(e){
+return "["+typeof (o)+"]";
+}
+if(typeof (o)=="function"){
+_e3=_e3.replace(/^\s+/,"").replace(/\s+/g," ");
+_e3=_e3.replace(/,(\S)/,", $1");
+var idx=_e3.indexOf("{");
+if(idx!=-1){
+_e3=_e3.substr(0,idx)+"{...}";
+}
+}
+return _e3;
+},reprArrayLike:function(o){
+var m=MochiKit.Base;
+return "["+m.map(m.repr,o).join(", ")+"]";
+},reprString:function(o){
+return ("\""+o.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\v]/g,"\\v").replace(/[\r]/g,"\\r");
+},reprNumber:function(o){
+return o+"";
+},registerJSON:function(_e9,_ea,_eb,_ec){
+MochiKit.Base.jsonRegistry.register(_e9,_ea,_eb,_ec);
+},evalJSON:function(){
+return eval("("+MochiKit.Base._filterJSON(arguments[0])+")");
+},_filterJSON:function(s){
+var m=s.match(/^\s*\/\*(.*)\*\/\s*$/);
+if(m){
+return m[1];
+}
+return s;
+},serializeJSON:function(o){
+var _f0=typeof (o);
+if(_f0=="number"||_f0=="boolean"){
+return o+"";
+}else{
+if(o===null){
+return "null";
+}else{
+if(_f0=="string"){
+var res="";
+for(var i=0;i<o.length;i++){
+var c=o.charAt(i);
+if(c=="\""){
+res+="\\\"";
+}else{
+if(c=="\\"){
+res+="\\\\";
+}else{
+if(c=="\b"){
+res+="\\b";
+}else{
+if(c=="\f"){
+res+="\\f";
+}else{
+if(c=="\n"){
+res+="\\n";
+}else{
+if(c=="\r"){
+res+="\\r";
+}else{
+if(c=="\t"){
+res+="\\t";
+}else{
+if(o.charCodeAt(i)<=31){
+var hex=o.charCodeAt(i).toString(16);
+if(hex.length<2){
+hex="0"+hex;
+}
+res+="\\u00"+hex.toUpperCase();
+}else{
+res+=c;
+}
+}
+}
+}
+}
+}
+}
+}
+}
+return "\""+res+"\"";
+}
+}
+}
+var me=arguments.callee;
+var _f6;
+if(typeof (o.__json__)=="function"){
+_f6=o.__json__();
+if(o!==_f6){
+return me(_f6);
+}
+}
+if(typeof (o.json)=="function"){
+_f6=o.json();
+if(o!==_f6){
+return me(_f6);
+}
+}
+if(_f0!="function"&&typeof (o.length)=="number"){
+var res=[];
+for(var i=0;i<o.length;i++){
+var val=me(o[i]);
+if(typeof (val)!="string"){
+continue;
+}
+res.push(val);
+}
+return "["+res.join(", ")+"]";
+}
+var m=MochiKit.Base;
+try{
+_f6=m.jsonRegistry.match(o);
+if(o!==_f6){
+return me(_f6);
+}
+}
+catch(e){
+if(e!=m.NotFound){
+throw e;
+}
+}
+if(_f0=="undefined"){
+throw new TypeError("undefined can not be serialized as JSON");
+}
+if(_f0=="function"){
+return null;
+}
+res=[];
+for(var k in o){
+var _fa;
+if(typeof (k)=="number"){
+_fa="\""+k+"\"";
+}else{
+if(typeof (k)=="string"){
+_fa=me(k);
+}else{
+continue;
+}
+}
+val=me(o[k]);
+if(typeof (val)!="string"){
+continue;
+}
+res.push(_fa+":"+val);
+}
+return "{"+res.join(", ")+"}";
+},objEqual:function(a,b){
+return (MochiKit.Base.compare(a,b)===0);
+},arrayEqual:function(_fd,arr){
+if(_fd.length!=arr.length){
+return false;
+}
+return (MochiKit.Base.compare(_fd,arr)===0);
+},concat:function(){
+var _ff=[];
+var _100=MochiKit.Base.extend;
+for(var i=0;i<arguments.length;i++){
+_100(_ff,arguments[i]);
+}
+return _ff;
+},keyComparator:function(key){
+var m=MochiKit.Base;
+var _104=m.compare;
+if(arguments.length==1){
+return function(a,b){
+return _104(a[key],b[key]);
+};
+}
+var _107=m.extend(null,arguments);
+return function(a,b){
+var rval=0;
+for(var i=0;(rval===0)&&(i<_107.length);i++){
+var key=_107[i];
+rval=_104(a[key],b[key]);
+}
+return rval;
+};
+},reverseKeyComparator:function(key){
+var _10e=MochiKit.Base.keyComparator.apply(this,arguments);
+return function(a,b){
+return _10e(b,a);
+};
+},partial:function(func){
+var m=MochiKit.Base;
+return m.bind.apply(this,m.extend([func,undefined],arguments,1));
+},listMinMax:function(_113,lst){
+if(lst.length===0){
+return null;
+}
+var cur=lst[0];
+var _116=MochiKit.Base.compare;
+for(var i=1;i<lst.length;i++){
+var o=lst[i];
+if(_116(o,cur)==_113){
+cur=o;
+}
+}
+return cur;
+},objMax:function(){
+return MochiKit.Base.listMinMax(1,arguments);
+},objMin:function(){
+return MochiKit.Base.listMinMax(-1,arguments);
+},findIdentical:function(lst,_11a,_11b,end){
+if(typeof (end)=="undefined"||end===null){
+end=lst.length;
+}
+if(typeof (_11b)=="undefined"||_11b===null){
+_11b=0;
+}
+for(var i=_11b;i<end;i++){
+if(lst[i]===_11a){
+return i;
+}
+}
+return -1;
+},mean:function(){
+var sum=0;
+var m=MochiKit.Base;
+var args=m.extend(null,arguments);
+var _121=args.length;
+while(args.length){
+var o=args.shift();
+if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){
+_121+=o.length-1;
+for(var i=o.length-1;i>=0;i--){
+sum+=o[i];
+}
+}else{
+sum+=o;
+}
+}
+if(_121<=0){
+throw new TypeError("mean() requires at least one argument");
+}
+return sum/_121;
+},median:function(){
+var data=MochiKit.Base.flattenArguments(arguments);
+if(data.length===0){
+throw new TypeError("median() requires at least one argument");
+}
+data.sort(compare);
+if(data.length%2==0){
+var _125=data.length/2;
+return (data[_125]+data[_125-1])/2;
+}else{
+return data[(data.length-1)/2];
+}
+},findValue:function(lst,_127,_128,end){
+if(typeof (end)=="undefined"||end===null){
+end=lst.length;
+}
+if(typeof (_128)=="undefined"||_128===null){
+_128=0;
+}
+var cmp=MochiKit.Base.compare;
+for(var i=_128;i<end;i++){
+if(cmp(lst[i],_127)===0){
+return i;
+}
+}
+return -1;
+},nodeWalk:function(node,_12d){
+var _12e=[node];
+var _12f=MochiKit.Base.extend;
+while(_12e.length){
+var res=_12d(_12e.shift());
+if(res){
+_12f(_12e,res);
+}
+}
+},nameFunctions:function(_131){
+var base=_131.NAME;
+if(typeof (base)=="undefined"){
+base="";
+}else{
+base=base+".";
+}
+for(var name in _131){
+var o=_131[name];
+if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
+try{
+o.NAME=base+name;
+}
+catch(e){
+}
+}
+}
+},queryString:function(_135,_136){
+if(typeof (MochiKit.DOM)!="undefined"&&arguments.length==1&&(typeof (_135)=="string"||(typeof (_135.nodeType)!="undefined"&&_135.nodeType>0))){
+var kv=MochiKit.DOM.formContents(_135);
+_135=kv[0];
+_136=kv[1];
+}else{
+if(arguments.length==1){
+if(typeof (_135.length)=="number"&&_135.length==2){
+return arguments.callee(_135[0],_135[1]);
+}
+var o=_135;
+_135=[];
+_136=[];
+for(var k in o){
+var v=o[k];
+if(typeof (v)=="function"){
+continue;
+}else{
+if(MochiKit.Base.isArrayLike(v)){
+for(var i=0;i<v.length;i++){
+_135.push(k);
+_136.push(v[i]);
+}
+}else{
+_135.push(k);
+_136.push(v);
+}
+}
+}
+}
+}
+var rval=[];
+var len=Math.min(_135.length,_136.length);
+var _13e=MochiKit.Base.urlEncode;
+for(var i=0;i<len;i++){
+v=_136[i];
+if(typeof (v)!="undefined"&&v!==null){
+rval.push(_13e(_135[i])+"="+_13e(v));
+}
+}
+return rval.join("&");
+},parseQueryString:function(_13f,_140){
+var qstr=(_13f.charAt(0)=="?")?_13f.substring(1):_13f;
+var _142=qstr.replace(/\+/g,"%20").split(/\&amp\;|\&\#38\;|\&#x26;|\&/);
+var o={};
+var _144;
+if(typeof (decodeURIComponent)!="undefined"){
+_144=decodeURIComponent;
+}else{
+_144=unescape;
+}
+if(_140){
+for(var i=0;i<_142.length;i++){
+var pair=_142[i].split("=");
+var name=_144(pair.shift());
+if(!name){
+continue;
+}
+var arr=o[name];
+if(!(arr instanceof Array)){
+arr=[];
+o[name]=arr;
+}
+arr.push(_144(pair.join("=")));
+}
+}else{
+for(i=0;i<_142.length;i++){
+pair=_142[i].split("=");
+var name=pair.shift();
+if(!name){
+continue;
+}
+o[_144(name)]=_144(pair.join("="));
+}
+}
+return o;
+}});
+MochiKit.Base.AdapterRegistry=function(){
+this.pairs=[];
+};
+MochiKit.Base.AdapterRegistry.prototype={register:function(name,_14a,wrap,_14c){
+if(_14c){
+this.pairs.unshift([name,_14a,wrap]);
+}else{
+this.pairs.push([name,_14a,wrap]);
+}
+},match:function(){
+for(var i=0;i<this.pairs.length;i++){
+var pair=this.pairs[i];
+if(pair[1].apply(this,arguments)){
+return pair[2].apply(this,arguments);
+}
+}
+throw MochiKit.Base.NotFound;
+},unregister:function(name){
+for(var i=0;i<this.pairs.length;i++){
+var pair=this.pairs[i];
+if(pair[0]==name){
+this.pairs.splice(i,1);
+return true;
+}
+}
+return false;
+}};
+MochiKit.Base.EXPORT=["flattenArray","noop","camelize","counter","clone","extend","update","updatetree","setdefault","keys","values","items","NamedError","operator","forwardCall","itemgetter","typeMatcher","isCallable","isUndefined","isUndefinedOrNull","isNull","isEmpty","isNotEmpty","isArrayLike","isDateLike","xmap","map","xfilter","filter","methodcaller","compose","bind","bindLate","bindMethods","NotFound","AdapterRegistry","registerComparator","compare","registerRepr","repr","objEqual","arrayEqual","concat","keyComparator","reverseKeyComparator","partial","merge","listMinMax","listMax","listMin","objMax","objMin","nodeWalk","zip","urlEncode","queryString","serializeJSON","registerJSON","evalJSON","parseQueryString","findValue","findIdentical","flattenArguments","method","average","mean","median"];
+MochiKit.Base.EXPORT_OK=["nameFunctions","comparatorRegistry","reprRegistry","jsonRegistry","compareDateLike","compareArrayLike","reprArrayLike","reprString","reprNumber"];
+MochiKit.Base._exportSymbols=function(_152,_153){
+if(!MochiKit.__export__){
+return;
+}
+var all=_153.EXPORT_TAGS[":all"];
+for(var i=0;i<all.length;i++){
+_152[all[i]]=_153[all[i]];
+}
+};
+MochiKit.Base.__new__=function(){
+var m=this;
+m.noop=m.operator.identity;
+m.forward=m.forwardCall;
+m.find=m.findValue;
+if(typeof (encodeURIComponent)!="undefined"){
+m.urlEncode=function(_157){
+return encodeURIComponent(_157).replace(/\'/g,"%27");
+};
+}else{
+m.urlEncode=function(_158){
+return escape(_158).replace(/\+/g,"%2B").replace(/\"/g,"%22").rval.replace(/\'/g,"%27");
+};
+}
+m.NamedError=function(name){
+this.message=name;
+this.name=name;
+};
+m.NamedError.prototype=new Error();
+m.update(m.NamedError.prototype,{repr:function(){
+if(this.message&&this.message!=this.name){
+return this.name+"("+m.repr(this.message)+")";
+}else{
+return this.name+"()";
+}
+},toString:m.forwardCall("repr")});
+m.NotFound=new m.NamedError("MochiKit.Base.NotFound");
+m.listMax=m.partial(m.listMinMax,1);
+m.listMin=m.partial(m.listMinMax,-1);
+m.isCallable=m.typeMatcher("function");
+m.isUndefined=m.typeMatcher("undefined");
+m.merge=m.partial(m.update,null);
+m.zip=m.partial(m.map,null);
+m.average=m.mean;
+m.comparatorRegistry=new m.AdapterRegistry();
+m.registerComparator("dateLike",m.isDateLike,m.compareDateLike);
+m.registerComparator("arrayLike",m.isArrayLike,m.compareArrayLike);
+m.reprRegistry=new m.AdapterRegistry();
+m.registerRepr("arrayLike",m.isArrayLike,m.reprArrayLike);
+m.registerRepr("string",m.typeMatcher("string"),m.reprString);
+m.registerRepr("numbers",m.typeMatcher("number","boolean"),m.reprNumber);
+m.jsonRegistry=new m.AdapterRegistry();
+var all=m.concat(m.EXPORT,m.EXPORT_OK);
+m.EXPORT_TAGS={":common":m.concat(m.EXPORT_OK),":all":all};
+m.nameFunctions(this);
+};
+MochiKit.Base.__new__();
+if(MochiKit.__export__){
+compare=MochiKit.Base.compare;
+compose=MochiKit.Base.compose;
+serializeJSON=MochiKit.Base.serializeJSON;
+mean=MochiKit.Base.mean;
+median=MochiKit.Base.median;
+}
+MochiKit.Base._exportSymbols(this,MochiKit.Base);
+MochiKit.Base._deps("Iter",["Base"]);
+MochiKit.Iter.NAME="MochiKit.Iter";
+MochiKit.Iter.VERSION="1.4.2";
+MochiKit.Base.update(MochiKit.Iter,{__repr__:function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+},toString:function(){
+return this.__repr__();
+},registerIteratorFactory:function(name,_15c,_15d,_15e){
+MochiKit.Iter.iteratorRegistry.register(name,_15c,_15d,_15e);
+},isIterable:function(o){
+return o!=null&&(typeof (o.next)=="function"||typeof (o.iter)=="function");
+},iter:function(_160,_161){
+var self=MochiKit.Iter;
+if(arguments.length==2){
+return self.takewhile(function(a){
+return a!=_161;
+},_160);
+}
+if(typeof (_160.next)=="function"){
+return _160;
+}else{
+if(typeof (_160.iter)=="function"){
+return _160.iter();
+}
+}
+try{
+return self.iteratorRegistry.match(_160);
+}
+catch(e){
+var m=MochiKit.Base;
+if(e==m.NotFound){
+e=new TypeError(typeof (_160)+": "+m.repr(_160)+" is not iterable");
+}
+throw e;
+}
+},count:function(n){
+if(!n){
+n=0;
+}
+var m=MochiKit.Base;
+return {repr:function(){
+return "count("+n+")";
+},toString:m.forwardCall("repr"),next:m.counter(n)};
+},cycle:function(p){
+var self=MochiKit.Iter;
+var m=MochiKit.Base;
+var lst=[];
+var _16b=self.iter(p);
+return {repr:function(){
+return "cycle(...)";
+},toString:m.forwardCall("repr"),next:function(){
+try{
+var rval=_16b.next();
+lst.push(rval);
+return rval;
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+if(lst.length===0){
+this.next=function(){
+throw self.StopIteration;
+};
+}else{
+var i=-1;
+this.next=function(){
+i=(i+1)%lst.length;
+return lst[i];
+};
+}
+return this.next();
+}
+}};
+},repeat:function(elem,n){
+var m=MochiKit.Base;
+if(typeof (n)=="undefined"){
+return {repr:function(){
+return "repeat("+m.repr(elem)+")";
+},toString:m.forwardCall("repr"),next:function(){
+return elem;
+}};
+}
+return {repr:function(){
+return "repeat("+m.repr(elem)+", "+n+")";
+},toString:m.forwardCall("repr"),next:function(){
+if(n<=0){
+throw MochiKit.Iter.StopIteration;
+}
+n-=1;
+return elem;
+}};
+},next:function(_171){
+return _171.next();
+},izip:function(p,q){
+var m=MochiKit.Base;
+var self=MochiKit.Iter;
+var next=self.next;
+var _177=m.map(self.iter,arguments);
+return {repr:function(){
+return "izip(...)";
+},toString:m.forwardCall("repr"),next:function(){
+return m.map(next,_177);
+}};
+},ifilter:function(pred,seq){
+var m=MochiKit.Base;
+seq=MochiKit.Iter.iter(seq);
+if(pred===null){
+pred=m.operator.truth;
+}
+return {repr:function(){
+return "ifilter(...)";
+},toString:m.forwardCall("repr"),next:function(){
+while(true){
+var rval=seq.next();
+if(pred(rval)){
+return rval;
+}
+}
+return undefined;
+}};
+},ifilterfalse:function(pred,seq){
+var m=MochiKit.Base;
+seq=MochiKit.Iter.iter(seq);
+if(pred===null){
+pred=m.operator.truth;
+}
+return {repr:function(){
+return "ifilterfalse(...)";
+},toString:m.forwardCall("repr"),next:function(){
+while(true){
+var rval=seq.next();
+if(!pred(rval)){
+return rval;
+}
+}
+return undefined;
+}};
+},islice:function(seq){
+var self=MochiKit.Iter;
+var m=MochiKit.Base;
+seq=self.iter(seq);
+var _183=0;
+var stop=0;
+var step=1;
+var i=-1;
+if(arguments.length==2){
+stop=arguments[1];
+}else{
+if(arguments.length==3){
+_183=arguments[1];
+stop=arguments[2];
+}else{
+_183=arguments[1];
+stop=arguments[2];
+step=arguments[3];
+}
+}
+return {repr:function(){
+return "islice("+["...",_183,stop,step].join(", ")+")";
+},toString:m.forwardCall("repr"),next:function(){
+var rval;
+while(i<_183){
+rval=seq.next();
+i++;
+}
+if(_183>=stop){
+throw self.StopIteration;
+}
+_183+=step;
+return rval;
+}};
+},imap:function(fun,p,q){
+var m=MochiKit.Base;
+var self=MochiKit.Iter;
+var _18d=m.map(self.iter,m.extend(null,arguments,1));
+var map=m.map;
+var next=self.next;
+return {repr:function(){
+return "imap(...)";
+},toString:m.forwardCall("repr"),next:function(){
+return fun.apply(this,map(next,_18d));
+}};
+},applymap:function(fun,seq,self){
+seq=MochiKit.Iter.iter(seq);
+var m=MochiKit.Base;
+return {repr:function(){
+return "applymap(...)";
+},toString:m.forwardCall("repr"),next:function(){
+return fun.apply(self,seq.next());
+}};
+},chain:function(p,q){
+var self=MochiKit.Iter;
+var m=MochiKit.Base;
+if(arguments.length==1){
+return self.iter(arguments[0]);
+}
+var _198=m.map(self.iter,arguments);
+return {repr:function(){
+return "chain(...)";
+},toString:m.forwardCall("repr"),next:function(){
+while(_198.length>1){
+try{
+var _199=_198[0].next();
+return _199;
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+_198.shift();
+var _199=_198[0].next();
+return _199;
+}
+}
+if(_198.length==1){
+var arg=_198.shift();
+this.next=m.bind("next",arg);
+return this.next();
+}
+throw self.StopIteration;
+}};
+},takewhile:function(pred,seq){
+var self=MochiKit.Iter;
+seq=self.iter(seq);
+return {repr:function(){
+return "takewhile(...)";
+},toString:MochiKit.Base.forwardCall("repr"),next:function(){
+var rval=seq.next();
+if(!pred(rval)){
+this.next=function(){
+throw self.StopIteration;
+};
+this.next();
+}
+return rval;
+}};
+},dropwhile:function(pred,seq){
+seq=MochiKit.Iter.iter(seq);
+var m=MochiKit.Base;
+var bind=m.bind;
+return {"repr":function(){
+return "dropwhile(...)";
+},"toString":m.forwardCall("repr"),"next":function(){
+while(true){
+var rval=seq.next();
+if(!pred(rval)){
+break;
+}
+}
+this.next=bind("next",seq);
+return rval;
+}};
+},_tee:function(_1a4,sync,_1a6){
+sync.pos[_1a4]=-1;
+var m=MochiKit.Base;
+var _1a8=m.listMin;
+return {repr:function(){
+return "tee("+_1a4+", ...)";
+},toString:m.forwardCall("repr"),next:function(){
+var rval;
+var i=sync.pos[_1a4];
+if(i==sync.max){
+rval=_1a6.next();
+sync.deque.push(rval);
+sync.max+=1;
+sync.pos[_1a4]+=1;
+}else{
+rval=sync.deque[i-sync.min];
+sync.pos[_1a4]+=1;
+if(i==sync.min&&_1a8(sync.pos)!=sync.min){
+sync.min+=1;
+sync.deque.shift();
+}
+}
+return rval;
+}};
+},tee:function(_1ab,n){
+var rval=[];
+var sync={"pos":[],"deque":[],"max":-1,"min":-1};
+if(arguments.length==1||typeof (n)=="undefined"||n===null){
+n=2;
+}
+var self=MochiKit.Iter;
+_1ab=self.iter(_1ab);
+var _tee=self._tee;
+for(var i=0;i<n;i++){
+rval.push(_tee(i,sync,_1ab));
+}
+return rval;
+},list:function(_1b2){
+var rval;
+if(_1b2 instanceof Array){
+return _1b2.slice();
+}
+if(typeof (_1b2)=="function"&&!(_1b2 instanceof Function)&&typeof (_1b2.length)=="number"){
+rval=[];
+for(var i=0;i<_1b2.length;i++){
+rval.push(_1b2[i]);
+}
+return rval;
+}
+var self=MochiKit.Iter;
+_1b2=self.iter(_1b2);
+var rval=[];
+var _1b6;
+try{
+while(true){
+_1b6=_1b2.next();
+rval.push(_1b6);
+}
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+return rval;
+}
+return undefined;
+},reduce:function(fn,_1b8,_1b9){
+var i=0;
+var x=_1b9;
+var self=MochiKit.Iter;
+_1b8=self.iter(_1b8);
+if(arguments.length<3){
+try{
+x=_1b8.next();
+}
+catch(e){
+if(e==self.StopIteration){
+e=new TypeError("reduce() of empty sequence with no initial value");
+}
+throw e;
+}
+i++;
+}
+try{
+while(true){
+x=fn(x,_1b8.next());
+}
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+}
+return x;
+},range:function(){
+var _1bd=0;
+var stop=0;
+var step=1;
+if(arguments.length==1){
+stop=arguments[0];
+}else{
+if(arguments.length==2){
+_1bd=arguments[0];
+stop=arguments[1];
+}else{
+if(arguments.length==3){
+_1bd=arguments[0];
+stop=arguments[1];
+step=arguments[2];
+}else{
+throw new TypeError("range() takes 1, 2, or 3 arguments!");
+}
+}
+}
+if(step===0){
+throw new TypeError("range() step must not be 0");
+}
+return {next:function(){
+if((step>0&&_1bd>=stop)||(step<0&&_1bd<=stop)){
+throw MochiKit.Iter.StopIteration;
+}
+var rval=_1bd;
+_1bd+=step;
+return rval;
+},repr:function(){
+return "range("+[_1bd,stop,step].join(", ")+")";
+},toString:MochiKit.Base.forwardCall("repr")};
+},sum:function(_1c1,_1c2){
+if(typeof (_1c2)=="undefined"||_1c2===null){
+_1c2=0;
+}
+var x=_1c2;
+var self=MochiKit.Iter;
+_1c1=self.iter(_1c1);
+try{
+while(true){
+x+=_1c1.next();
+}
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+}
+return x;
+},exhaust:function(_1c5){
+var self=MochiKit.Iter;
+_1c5=self.iter(_1c5);
+try{
+while(true){
+_1c5.next();
+}
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+}
+},forEach:function(_1c7,func,obj){
+var m=MochiKit.Base;
+var self=MochiKit.Iter;
+if(arguments.length>2){
+func=m.bind(func,obj);
+}
+if(m.isArrayLike(_1c7)&&!self.isIterable(_1c7)){
+try{
+for(var i=0;i<_1c7.length;i++){
+func(_1c7[i]);
+}
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+}
+}else{
+self.exhaust(self.imap(func,_1c7));
+}
+},every:function(_1cd,func){
+var self=MochiKit.Iter;
+try{
+self.ifilterfalse(func,_1cd).next();
+return false;
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+return true;
+}
+},sorted:function(_1d0,cmp){
+var rval=MochiKit.Iter.list(_1d0);
+if(arguments.length==1){
+cmp=MochiKit.Base.compare;
+}
+rval.sort(cmp);
+return rval;
+},reversed:function(_1d3){
+var rval=MochiKit.Iter.list(_1d3);
+rval.reverse();
+return rval;
+},some:function(_1d5,func){
+var self=MochiKit.Iter;
+try{
+self.ifilter(func,_1d5).next();
+return true;
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+return false;
+}
+},iextend:function(lst,_1d9){
+var m=MochiKit.Base;
+var self=MochiKit.Iter;
+if(m.isArrayLike(_1d9)&&!self.isIterable(_1d9)){
+for(var i=0;i<_1d9.length;i++){
+lst.push(_1d9[i]);
+}
+}else{
+_1d9=self.iter(_1d9);
+try{
+while(true){
+lst.push(_1d9.next());
+}
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+}
+}
+return lst;
+},groupby:function(_1dd,_1de){
+var m=MochiKit.Base;
+var self=MochiKit.Iter;
+if(arguments.length<2){
+_1de=m.operator.identity;
+}
+_1dd=self.iter(_1dd);
+var pk=undefined;
+var k=undefined;
+var v;
+function fetch(){
+v=_1dd.next();
+k=_1de(v);
+}
+function eat(){
+var ret=v;
+v=undefined;
+return ret;
+}
+var _1e5=true;
+var _1e6=m.compare;
+return {repr:function(){
+return "groupby(...)";
+},next:function(){
+while(_1e6(k,pk)===0){
+fetch();
+if(_1e5){
+_1e5=false;
+break;
+}
+}
+pk=k;
+return [k,{next:function(){
+if(v==undefined){
+fetch();
+}
+if(_1e6(k,pk)!==0){
+throw self.StopIteration;
+}
+return eat();
+}}];
+}};
+},groupby_as_array:function(_1e7,_1e8){
+var m=MochiKit.Base;
+var self=MochiKit.Iter;
+if(arguments.length<2){
+_1e8=m.operator.identity;
+}
+_1e7=self.iter(_1e7);
+var _1eb=[];
+var _1ec=true;
+var _1ed;
+var _1ee=m.compare;
+while(true){
+try{
+var _1ef=_1e7.next();
+var key=_1e8(_1ef);
+}
+catch(e){
+if(e==self.StopIteration){
+break;
+}
+throw e;
+}
+if(_1ec||_1ee(key,_1ed)!==0){
+var _1f1=[];
+_1eb.push([key,_1f1]);
+}
+_1f1.push(_1ef);
+_1ec=false;
+_1ed=key;
+}
+return _1eb;
+},arrayLikeIter:function(_1f2){
+var i=0;
+return {repr:function(){
+return "arrayLikeIter(...)";
+},toString:MochiKit.Base.forwardCall("repr"),next:function(){
+if(i>=_1f2.length){
+throw MochiKit.Iter.StopIteration;
+}
+return _1f2[i++];
+}};
+},hasIterateNext:function(_1f4){
+return (_1f4&&typeof (_1f4.iterateNext)=="function");
+},iterateNextIter:function(_1f5){
+return {repr:function(){
+return "iterateNextIter(...)";
+},toString:MochiKit.Base.forwardCall("repr"),next:function(){
+var rval=_1f5.iterateNext();
+if(rval===null||rval===undefined){
+throw MochiKit.Iter.StopIteration;
+}
+return rval;
+}};
+}});
+MochiKit.Iter.EXPORT_OK=["iteratorRegistry","arrayLikeIter","hasIterateNext","iterateNextIter"];
+MochiKit.Iter.EXPORT=["StopIteration","registerIteratorFactory","iter","count","cycle","repeat","next","izip","ifilter","ifilterfalse","islice","imap","applymap","chain","takewhile","dropwhile","tee","list","reduce","range","sum","exhaust","forEach","every","sorted","reversed","some","iextend","groupby","groupby_as_array"];
+MochiKit.Iter.__new__=function(){
+var m=MochiKit.Base;
+if(typeof (StopIteration)!="undefined"){
+this.StopIteration=StopIteration;
+}else{
+this.StopIteration=new m.NamedError("StopIteration");
+}
+this.iteratorRegistry=new m.AdapterRegistry();
+this.registerIteratorFactory("arrayLike",m.isArrayLike,this.arrayLikeIter);
+this.registerIteratorFactory("iterateNext",this.hasIterateNext,this.iterateNextIter);
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+m.nameFunctions(this);
+};
+MochiKit.Iter.__new__();
+if(MochiKit.__export__){
+reduce=MochiKit.Iter.reduce;
+}
+MochiKit.Base._exportSymbols(this,MochiKit.Iter);
+MochiKit.Base._deps("Logging",["Base"]);
+MochiKit.Logging.NAME="MochiKit.Logging";
+MochiKit.Logging.VERSION="1.4.2";
+MochiKit.Logging.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.Logging.toString=function(){
+return this.__repr__();
+};
+MochiKit.Logging.EXPORT=["LogLevel","LogMessage","Logger","alertListener","logger","log","logError","logDebug","logFatal","logWarning"];
+MochiKit.Logging.EXPORT_OK=["logLevelAtLeast","isLogMessage","compareLogMessage"];
+MochiKit.Logging.LogMessage=function(num,_1f9,info){
+this.num=num;
+this.level=_1f9;
+this.info=info;
+this.timestamp=new Date();
+};
+MochiKit.Logging.LogMessage.prototype={repr:function(){
+var m=MochiKit.Base;
+return "LogMessage("+m.map(m.repr,[this.num,this.level,this.info]).join(", ")+")";
+},toString:MochiKit.Base.forwardCall("repr")};
+MochiKit.Base.update(MochiKit.Logging,{logLevelAtLeast:function(_1fc){
+var self=MochiKit.Logging;
+if(typeof (_1fc)=="string"){
+_1fc=self.LogLevel[_1fc];
+}
+return function(msg){
+var _1ff=msg.level;
+if(typeof (_1ff)=="string"){
+_1ff=self.LogLevel[_1ff];
+}
+return _1ff>=_1fc;
+};
+},isLogMessage:function(){
+var _200=MochiKit.Logging.LogMessage;
+for(var i=0;i<arguments.length;i++){
+if(!(arguments[i] instanceof _200)){
+return false;
+}
+}
+return true;
+},compareLogMessage:function(a,b){
+return MochiKit.Base.compare([a.level,a.info],[b.level,b.info]);
+},alertListener:function(msg){
+alert("num: "+msg.num+"\nlevel: "+msg.level+"\ninfo: "+msg.info.join(" "));
+}});
+MochiKit.Logging.Logger=function(_205){
+this.counter=0;
+if(typeof (_205)=="undefined"||_205===null){
+_205=-1;
+}
+this.maxSize=_205;
+this._messages=[];
+this.listeners={};
+this.useNativeConsole=false;
+};
+MochiKit.Logging.Logger.prototype={clear:function(){
+this._messages.splice(0,this._messages.length);
+},logToConsole:function(msg){
+if(typeof (window)!="undefined"&&window.console&&window.console.log){
+window.console.log(msg.replace(/%/g,"\uff05"));
+}else{
+if(typeof (opera)!="undefined"&&opera.postError){
+opera.postError(msg);
+}else{
+if(typeof (printfire)=="function"){
+printfire(msg);
+}else{
+if(typeof (Debug)!="undefined"&&Debug.writeln){
+Debug.writeln(msg);
+}else{
+if(typeof (debug)!="undefined"&&debug.trace){
+debug.trace(msg);
+}
+}
+}
+}
+}
+},dispatchListeners:function(msg){
+for(var k in this.listeners){
+var pair=this.listeners[k];
+if(pair.ident!=k||(pair[0]&&!pair[0](msg))){
+continue;
+}
+pair[1](msg);
+}
+},addListener:function(_20a,_20b,_20c){
+if(typeof (_20b)=="string"){
+_20b=MochiKit.Logging.logLevelAtLeast(_20b);
+}
+var _20d=[_20b,_20c];
+_20d.ident=_20a;
+this.listeners[_20a]=_20d;
+},removeListener:function(_20e){
+delete this.listeners[_20e];
+},baseLog:function(_20f,_210){
+if(typeof (_20f)=="number"){
+if(_20f>=MochiKit.Logging.LogLevel.FATAL){
+_20f="FATAL";
+}else{
+if(_20f>=MochiKit.Logging.LogLevel.ERROR){
+_20f="ERROR";
+}else{
+if(_20f>=MochiKit.Logging.LogLevel.WARNING){
+_20f="WARNING";
+}else{
+if(_20f>=MochiKit.Logging.LogLevel.INFO){
+_20f="INFO";
+}else{
+_20f="DEBUG";
+}
+}
+}
+}
+}
+var msg=new MochiKit.Logging.LogMessage(this.counter,_20f,MochiKit.Base.extend(null,arguments,1));
+this._messages.push(msg);
+this.dispatchListeners(msg);
+if(this.useNativeConsole){
+this.logToConsole(msg.level+": "+msg.info.join(" "));
+}
+this.counter+=1;
+while(this.maxSize>=0&&this._messages.length>this.maxSize){
+this._messages.shift();
+}
+},getMessages:function(_212){
+var _213=0;
+if(!(typeof (_212)=="undefined"||_212===null)){
+_213=Math.max(0,this._messages.length-_212);
+}
+return this._messages.slice(_213);
+},getMessageText:function(_214){
+if(typeof (_214)=="undefined"||_214===null){
+_214=30;
+}
+var _215=this.getMessages(_214);
+if(_215.length){
+var lst=map(function(m){
+return "\n ["+m.num+"] "+m.level+": "+m.info.join(" ");
+},_215);
+lst.unshift("LAST "+_215.length+" MESSAGES:");
+return lst.join("");
+}
+return "";
+},debuggingBookmarklet:function(_218){
+if(typeof (MochiKit.LoggingPane)=="undefined"){
+alert(this.getMessageText());
+}else{
+MochiKit.LoggingPane.createLoggingPane(_218||false);
+}
+}};
+MochiKit.Logging.__new__=function(){
+this.LogLevel={ERROR:40,FATAL:50,WARNING:30,INFO:20,DEBUG:10};
+var m=MochiKit.Base;
+m.registerComparator("LogMessage",this.isLogMessage,this.compareLogMessage);
+var _21a=m.partial;
+var _21b=this.Logger;
+var _21c=_21b.prototype.baseLog;
+m.update(this.Logger.prototype,{debug:_21a(_21c,"DEBUG"),log:_21a(_21c,"INFO"),error:_21a(_21c,"ERROR"),fatal:_21a(_21c,"FATAL"),warning:_21a(_21c,"WARNING")});
+var self=this;
+var _21e=function(name){
+return function(){
+self.logger[name].apply(self.logger,arguments);
+};
+};
+this.log=_21e("log");
+this.logError=_21e("error");
+this.logDebug=_21e("debug");
+this.logFatal=_21e("fatal");
+this.logWarning=_21e("warning");
+this.logger=new _21b();
+this.logger.useNativeConsole=true;
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+m.nameFunctions(this);
+};
+if(typeof (printfire)=="undefined"&&typeof (document)!="undefined"&&document.createEvent&&typeof (dispatchEvent)!="undefined"){
+printfire=function(){
+printfire.args=arguments;
+var ev=document.createEvent("Events");
+ev.initEvent("printfire",false,true);
+dispatchEvent(ev);
+};
+}
+MochiKit.Logging.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.Logging);
+MochiKit.Base._deps("DateTime",["Base"]);
+MochiKit.DateTime.NAME="MochiKit.DateTime";
+MochiKit.DateTime.VERSION="1.4.2";
+MochiKit.DateTime.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.DateTime.toString=function(){
+return this.__repr__();
+};
+MochiKit.DateTime.isoDate=function(str){
+str=str+"";
+if(typeof (str)!="string"||str.length===0){
+return null;
+}
+var iso=str.split("-");
+if(iso.length===0){
+return null;
+}
+var date=new Date(iso[0],iso[1]-1,iso[2]);
+date.setFullYear(iso[0]);
+date.setMonth(iso[1]-1);
+date.setDate(iso[2]);
+return date;
+};
+MochiKit.DateTime._isoRegexp=/(\d{4,})(?:-(\d{1,2})(?:-(\d{1,2})(?:[T ](\d{1,2}):(\d{1,2})(?::(\d{1,2})(?:\.(\d+))?)?(?:(Z)|([+-])(\d{1,2})(?::(\d{1,2}))?)?)?)?)?/;
+MochiKit.DateTime.isoTimestamp=function(str){
+str=str+"";
+if(typeof (str)!="string"||str.length===0){
+return null;
+}
+var res=str.match(MochiKit.DateTime._isoRegexp);
+if(typeof (res)=="undefined"||res===null){
+return null;
+}
+var year,_227,day,hour,min,sec,msec;
+year=parseInt(res[1],10);
+if(typeof (res[2])=="undefined"||res[2]===""){
+return new Date(year);
+}
+_227=parseInt(res[2],10)-1;
+day=parseInt(res[3],10);
+if(typeof (res[4])=="undefined"||res[4]===""){
+return new Date(year,_227,day);
+}
+hour=parseInt(res[4],10);
+min=parseInt(res[5],10);
+sec=(typeof (res[6])!="undefined"&&res[6]!=="")?parseInt(res[6],10):0;
+if(typeof (res[7])!="undefined"&&res[7]!==""){
+msec=Math.round(1000*parseFloat("0."+res[7]));
+}else{
+msec=0;
+}
+if((typeof (res[8])=="undefined"||res[8]==="")&&(typeof (res[9])=="undefined"||res[9]==="")){
+return new Date(year,_227,day,hour,min,sec,msec);
+}
+var ofs;
+if(typeof (res[9])!="undefined"&&res[9]!==""){
+ofs=parseInt(res[10],10)*3600000;
+if(typeof (res[11])!="undefined"&&res[11]!==""){
+ofs+=parseInt(res[11],10)*60000;
+}
+if(res[9]=="-"){
+ofs=-ofs;
+}
+}else{
+ofs=0;
+}
+return new Date(Date.UTC(year,_227,day,hour,min,sec,msec)-ofs);
+};
+MochiKit.DateTime.toISOTime=function(date,_22f){
+if(typeof (date)=="undefined"||date===null){
+return null;
+}
+var hh=date.getHours();
+var mm=date.getMinutes();
+var ss=date.getSeconds();
+var lst=[((_22f&&(hh<10))?"0"+hh:hh),((mm<10)?"0"+mm:mm),((ss<10)?"0"+ss:ss)];
+return lst.join(":");
+};
+MochiKit.DateTime.toISOTimestamp=function(date,_235){
+if(typeof (date)=="undefined"||date===null){
+return null;
+}
+var sep=_235?"T":" ";
+var foot=_235?"Z":"";
+if(_235){
+date=new Date(date.getTime()+(date.getTimezoneOffset()*60000));
+}
+return MochiKit.DateTime.toISODate(date)+sep+MochiKit.DateTime.toISOTime(date,_235)+foot;
+};
+MochiKit.DateTime.toISODate=function(date){
+if(typeof (date)=="undefined"||date===null){
+return null;
+}
+var _239=MochiKit.DateTime._padTwo;
+var _23a=MochiKit.DateTime._padFour;
+return [_23a(date.getFullYear()),_239(date.getMonth()+1),_239(date.getDate())].join("-");
+};
+MochiKit.DateTime.americanDate=function(d){
+d=d+"";
+if(typeof (d)!="string"||d.length===0){
+return null;
+}
+var a=d.split("/");
+return new Date(a[2],a[0]-1,a[1]);
+};
+MochiKit.DateTime._padTwo=function(n){
+return (n>9)?n:"0"+n;
+};
+MochiKit.DateTime._padFour=function(n){
+switch(n.toString().length){
+case 1:
+return "000"+n;
+break;
+case 2:
+return "00"+n;
+break;
+case 3:
+return "0"+n;
+break;
+case 4:
+default:
+return n;
+}
+};
+MochiKit.DateTime.toPaddedAmericanDate=function(d){
+if(typeof (d)=="undefined"||d===null){
+return null;
+}
+var _240=MochiKit.DateTime._padTwo;
+return [_240(d.getMonth()+1),_240(d.getDate()),d.getFullYear()].join("/");
+};
+MochiKit.DateTime.toAmericanDate=function(d){
+if(typeof (d)=="undefined"||d===null){
+return null;
+}
+return [d.getMonth()+1,d.getDate(),d.getFullYear()].join("/");
+};
+MochiKit.DateTime.EXPORT=["isoDate","isoTimestamp","toISOTime","toISOTimestamp","toISODate","americanDate","toPaddedAmericanDate","toAmericanDate"];
+MochiKit.DateTime.EXPORT_OK=[];
+MochiKit.DateTime.EXPORT_TAGS={":common":MochiKit.DateTime.EXPORT,":all":MochiKit.DateTime.EXPORT};
+MochiKit.DateTime.__new__=function(){
+var base=this.NAME+".";
+for(var k in this){
+var o=this[k];
+if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
+try{
+o.NAME=base+k;
+}
+catch(e){
+}
+}
+}
+};
+MochiKit.DateTime.__new__();
+if(typeof (MochiKit.Base)!="undefined"){
+MochiKit.Base._exportSymbols(this,MochiKit.DateTime);
+}else{
+(function(_245,_246){
+if((typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")||(MochiKit.__export__===false)){
+var all=_246.EXPORT_TAGS[":all"];
+for(var i=0;i<all.length;i++){
+_245[all[i]]=_246[all[i]];
+}
+}
+})(this,MochiKit.DateTime);
+}
+MochiKit.Base._deps("Format",["Base"]);
+MochiKit.Format.NAME="MochiKit.Format";
+MochiKit.Format.VERSION="1.4.2";
+MochiKit.Format.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.Format.toString=function(){
+return this.__repr__();
+};
+MochiKit.Format._numberFormatter=function(_249,_24a,_24b,_24c,_24d,_24e,_24f,_250,_251){
+return function(num){
+num=parseFloat(num);
+if(typeof (num)=="undefined"||num===null||isNaN(num)){
+return _249;
+}
+var _253=_24a;
+var _254=_24b;
+if(num<0){
+num=-num;
+}else{
+_253=_253.replace(/-/,"");
+}
+var me=arguments.callee;
+var fmt=MochiKit.Format.formatLocale(_24c);
+if(_24d){
+num=num*100;
+_254=fmt.percent+_254;
+}
+num=MochiKit.Format.roundToFixed(num,_24e);
+var _257=num.split(/\./);
+var _258=_257[0];
+var frac=(_257.length==1)?"":_257[1];
+var res="";
+while(_258.length<_24f){
+_258="0"+_258;
+}
+if(_250){
+while(_258.length>_250){
+var i=_258.length-_250;
+res=fmt.separator+_258.substring(i,_258.length)+res;
+_258=_258.substring(0,i);
+}
+}
+res=_258+res;
+if(_24e>0){
+while(frac.length<_251){
+frac=frac+"0";
+}
+res=res+fmt.decimal+frac;
+}
+return _253+res+_254;
+};
+};
+MochiKit.Format.numberFormatter=function(_25c,_25d,_25e){
+if(typeof (_25d)=="undefined"){
+_25d="";
+}
+var _25f=_25c.match(/((?:[0#]+,)?[0#]+)(?:\.([0#]+))?(%)?/);
+if(!_25f){
+throw TypeError("Invalid pattern");
+}
+var _260=_25c.substr(0,_25f.index);
+var _261=_25c.substr(_25f.index+_25f[0].length);
+if(_260.search(/-/)==-1){
+_260=_260+"-";
+}
+var _262=_25f[1];
+var frac=(typeof (_25f[2])=="string"&&_25f[2]!="")?_25f[2]:"";
+var _264=(typeof (_25f[3])=="string"&&_25f[3]!="");
+var tmp=_262.split(/,/);
+var _266;
+if(typeof (_25e)=="undefined"){
+_25e="default";
+}
+if(tmp.length==1){
+_266=null;
+}else{
+_266=tmp[1].length;
+}
+var _267=_262.length-_262.replace(/0/g,"").length;
+var _268=frac.length-frac.replace(/0/g,"").length;
+var _269=frac.length;
+var rval=MochiKit.Format._numberFormatter(_25d,_260,_261,_25e,_264,_269,_267,_266,_268);
+var m=MochiKit.Base;
+if(m){
+var fn=arguments.callee;
+var args=m.concat(arguments);
+rval.repr=function(){
+return [self.NAME,"(",map(m.repr,args).join(", "),")"].join("");
+};
+}
+return rval;
+};
+MochiKit.Format.formatLocale=function(_26e){
+if(typeof (_26e)=="undefined"||_26e===null){
+_26e="default";
+}
+if(typeof (_26e)=="string"){
+var rval=MochiKit.Format.LOCALE[_26e];
+if(typeof (rval)=="string"){
+rval=arguments.callee(rval);
+MochiKit.Format.LOCALE[_26e]=rval;
+}
+return rval;
+}else{
+return _26e;
+}
+};
+MochiKit.Format.twoDigitAverage=function(_270,_271){
+if(_271){
+var res=_270/_271;
+if(!isNaN(res)){
+return MochiKit.Format.twoDigitFloat(res);
+}
+}
+return "0";
+};
+MochiKit.Format.twoDigitFloat=function(_273){
+var res=roundToFixed(_273,2);
+if(res.indexOf(".00")>0){
+return res.substring(0,res.length-3);
+}else{
+if(res.charAt(res.length-1)=="0"){
+return res.substring(0,res.length-1);
+}else{
+return res;
+}
+}
+};
+MochiKit.Format.lstrip=function(str,_276){
+str=str+"";
+if(typeof (str)!="string"){
+return null;
+}
+if(!_276){
+return str.replace(/^\s+/,"");
+}else{
+return str.replace(new RegExp("^["+_276+"]+"),"");
+}
+};
+MochiKit.Format.rstrip=function(str,_278){
+str=str+"";
+if(typeof (str)!="string"){
+return null;
+}
+if(!_278){
+return str.replace(/\s+$/,"");
+}else{
+return str.replace(new RegExp("["+_278+"]+$"),"");
+}
+};
+MochiKit.Format.strip=function(str,_27a){
+var self=MochiKit.Format;
+return self.rstrip(self.lstrip(str,_27a),_27a);
+};
+MochiKit.Format.truncToFixed=function(_27c,_27d){
+var res=Math.floor(_27c).toFixed(0);
+if(_27c<0){
+res=Math.ceil(_27c).toFixed(0);
+if(res.charAt(0)!="-"&&_27d>0){
+res="-"+res;
+}
+}
+if(res.indexOf("e")<0&&_27d>0){
+var tail=_27c.toString();
+if(tail.indexOf("e")>0){
+tail=".";
+}else{
+if(tail.indexOf(".")<0){
+tail=".";
+}else{
+tail=tail.substring(tail.indexOf("."));
+}
+}
+if(tail.length-1>_27d){
+tail=tail.substring(0,_27d+1);
+}
+while(tail.length-1<_27d){
+tail+="0";
+}
+res+=tail;
+}
+return res;
+};
+MochiKit.Format.roundToFixed=function(_280,_281){
+var _282=Math.abs(_280)+0.5*Math.pow(10,-_281);
+var res=MochiKit.Format.truncToFixed(_282,_281);
+if(_280<0){
+res="-"+res;
+}
+return res;
+};
+MochiKit.Format.percentFormat=function(_284){
+return MochiKit.Format.twoDigitFloat(100*_284)+"%";
+};
+MochiKit.Format.EXPORT=["truncToFixed","roundToFixed","numberFormatter","formatLocale","twoDigitAverage","twoDigitFloat","percentFormat","lstrip","rstrip","strip"];
+MochiKit.Format.LOCALE={en_US:{separator:",",decimal:".",percent:"%"},de_DE:{separator:".",decimal:",",percent:"%"},pt_BR:{separator:".",decimal:",",percent:"%"},fr_FR:{separator:" ",decimal:",",percent:"%"},"default":"en_US"};
+MochiKit.Format.EXPORT_OK=[];
+MochiKit.Format.EXPORT_TAGS={":all":MochiKit.Format.EXPORT,":common":MochiKit.Format.EXPORT};
+MochiKit.Format.__new__=function(){
+var base=this.NAME+".";
+var k,v,o;
+for(k in this.LOCALE){
+o=this.LOCALE[k];
+if(typeof (o)=="object"){
+o.repr=function(){
+return this.NAME;
+};
+o.NAME=base+"LOCALE."+k;
+}
+}
+for(k in this){
+o=this[k];
+if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
+try{
+o.NAME=base+k;
+}
+catch(e){
+}
+}
+}
+};
+MochiKit.Format.__new__();
+if(typeof (MochiKit.Base)!="undefined"){
+MochiKit.Base._exportSymbols(this,MochiKit.Format);
+}else{
+(function(_289,_28a){
+if((typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")||(MochiKit.__export__===false)){
+var all=_28a.EXPORT_TAGS[":all"];
+for(var i=0;i<all.length;i++){
+_289[all[i]]=_28a[all[i]];
+}
+}
+})(this,MochiKit.Format);
+}
+MochiKit.Base._deps("Async",["Base"]);
+MochiKit.Async.NAME="MochiKit.Async";
+MochiKit.Async.VERSION="1.4.2";
+MochiKit.Async.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.Async.toString=function(){
+return this.__repr__();
+};
+MochiKit.Async.Deferred=function(_28d){
+this.chain=[];
+this.id=this._nextId();
+this.fired=-1;
+this.paused=0;
+this.results=[null,null];
+this.canceller=_28d;
+this.silentlyCancelled=false;
+this.chained=false;
+};
+MochiKit.Async.Deferred.prototype={repr:function(){
+var _28e;
+if(this.fired==-1){
+_28e="unfired";
+}else{
+if(this.fired===0){
+_28e="success";
+}else{
+_28e="error";
+}
+}
+return "Deferred("+this.id+", "+_28e+")";
+},toString:MochiKit.Base.forwardCall("repr"),_nextId:MochiKit.Base.counter(),cancel:function(){
+var self=MochiKit.Async;
+if(this.fired==-1){
+if(this.canceller){
+this.canceller(this);
+}else{
+this.silentlyCancelled=true;
+}
+if(this.fired==-1){
+this.errback(new self.CancelledError(this));
+}
+}else{
+if((this.fired===0)&&(this.results[0] instanceof self.Deferred)){
+this.results[0].cancel();
+}
+}
+},_resback:function(res){
+this.fired=((res instanceof Error)?1:0);
+this.results[this.fired]=res;
+this._fire();
+},_check:function(){
+if(this.fired!=-1){
+if(!this.silentlyCancelled){
+throw new MochiKit.Async.AlreadyCalledError(this);
+}
+this.silentlyCancelled=false;
+return;
+}
+},callback:function(res){
+this._check();
+if(res instanceof MochiKit.Async.Deferred){
+throw new Error("Deferred instances can only be chained if they are the result of a callback");
+}
+this._resback(res);
+},errback:function(res){
+this._check();
+var self=MochiKit.Async;
+if(res instanceof self.Deferred){
+throw new Error("Deferred instances can only be chained if they are the result of a callback");
+}
+if(!(res instanceof Error)){
+res=new self.GenericError(res);
+}
+this._resback(res);
+},addBoth:function(fn){
+if(arguments.length>1){
+fn=MochiKit.Base.partial.apply(null,arguments);
+}
+return this.addCallbacks(fn,fn);
+},addCallback:function(fn){
+if(arguments.length>1){
+fn=MochiKit.Base.partial.apply(null,arguments);
+}
+return this.addCallbacks(fn,null);
+},addErrback:function(fn){
+if(arguments.length>1){
+fn=MochiKit.Base.partial.apply(null,arguments);
+}
+return this.addCallbacks(null,fn);
+},addCallbacks:function(cb,eb){
+if(this.chained){
+throw new Error("Chained Deferreds can not be re-used");
+}
+this.chain.push([cb,eb]);
+if(this.fired>=0){
+this._fire();
+}
+return this;
+},_fire:function(){
+var _299=this.chain;
+var _29a=this.fired;
+var res=this.results[_29a];
+var self=this;
+var cb=null;
+while(_299.length>0&&this.paused===0){
+var pair=_299.shift();
+var f=pair[_29a];
+if(f===null){
+continue;
+}
+try{
+res=f(res);
+_29a=((res instanceof Error)?1:0);
+if(res instanceof MochiKit.Async.Deferred){
+cb=function(res){
+self._resback(res);
+self.paused--;
+if((self.paused===0)&&(self.fired>=0)){
+self._fire();
+}
+};
+this.paused++;
+}
+}
+catch(err){
+_29a=1;
+if(!(err instanceof Error)){
+err=new MochiKit.Async.GenericError(err);
+}
+res=err;
+}
+}
+this.fired=_29a;
+this.results[_29a]=res;
+if(cb&&this.paused){
+res.addBoth(cb);
+res.chained=true;
+}
+}};
+MochiKit.Base.update(MochiKit.Async,{evalJSONRequest:function(req){
+return MochiKit.Base.evalJSON(req.responseText);
+},succeed:function(_2a2){
+var d=new MochiKit.Async.Deferred();
+d.callback.apply(d,arguments);
+return d;
+},fail:function(_2a4){
+var d=new MochiKit.Async.Deferred();
+d.errback.apply(d,arguments);
+return d;
+},getXMLHttpRequest:function(){
+var self=arguments.callee;
+if(!self.XMLHttpRequest){
+var _2a7=[function(){
+return new XMLHttpRequest();
+},function(){
+return new ActiveXObject("Msxml2.XMLHTTP");
+},function(){
+return new ActiveXObject("Microsoft.XMLHTTP");
+},function(){
+return new ActiveXObject("Msxml2.XMLHTTP.4.0");
+},function(){
+throw new MochiKit.Async.BrowserComplianceError("Browser does not support XMLHttpRequest");
+}];
+for(var i=0;i<_2a7.length;i++){
+var func=_2a7[i];
+try{
+self.XMLHttpRequest=func;
+return func();
+}
+catch(e){
+}
+}
+}
+return self.XMLHttpRequest();
+},_xhr_onreadystatechange:function(d){
+var m=MochiKit.Base;
+if(this.readyState==4){
+try{
+this.onreadystatechange=null;
+}
+catch(e){
+try{
+this.onreadystatechange=m.noop;
+}
+catch(e){
+}
+}
+var _2ac=null;
+try{
+_2ac=this.status;
+if(!_2ac&&m.isNotEmpty(this.responseText)){
+_2ac=304;
+}
+}
+catch(e){
+}
+if(_2ac==200||_2ac==201||_2ac==204||_2ac==304||_2ac==1223){
+d.callback(this);
+}else{
+var err=new MochiKit.Async.XMLHttpRequestError(this,"Request failed");
+if(err.number){
+d.errback(err);
+}else{
+d.errback(err);
+}
+}
+}
+},_xhr_canceller:function(req){
+try{
+req.onreadystatechange=null;
+}
+catch(e){
+try{
+req.onreadystatechange=MochiKit.Base.noop;
+}
+catch(e){
+}
+}
+req.abort();
+},sendXMLHttpRequest:function(req,_2b0){
+if(typeof (_2b0)=="undefined"||_2b0===null){
+_2b0="";
+}
+var m=MochiKit.Base;
+var self=MochiKit.Async;
+var d=new self.Deferred(m.partial(self._xhr_canceller,req));
+try{
+req.onreadystatechange=m.bind(self._xhr_onreadystatechange,req,d);
+req.send(_2b0);
+}
+catch(e){
+try{
+req.onreadystatechange=null;
+}
+catch(ignore){
+}
+d.errback(e);
+}
+return d;
+},doXHR:function(url,opts){
+var self=MochiKit.Async;
+return self.callLater(0,self._doXHR,url,opts);
+},_doXHR:function(url,opts){
+var m=MochiKit.Base;
+opts=m.update({method:"GET",sendContent:""},opts);
+var self=MochiKit.Async;
+var req=self.getXMLHttpRequest();
+if(opts.queryString){
+var qs=m.queryString(opts.queryString);
+if(qs){
+url+="?"+qs;
+}
+}
+if("username" in opts){
+req.open(opts.method,url,true,opts.username,opts.password);
+}else{
+req.open(opts.method,url,true);
+}
+if(req.overrideMimeType&&opts.mimeType){
+req.overrideMimeType(opts.mimeType);
+}
+req.setRequestHeader("X-Requested-With","XMLHttpRequest");
+if(opts.headers){
+var _2bd=opts.headers;
+if(!m.isArrayLike(_2bd)){
+_2bd=m.items(_2bd);
+}
+for(var i=0;i<_2bd.length;i++){
+var _2bf=_2bd[i];
+var name=_2bf[0];
+var _2c1=_2bf[1];
+req.setRequestHeader(name,_2c1);
+}
+}
+return self.sendXMLHttpRequest(req,opts.sendContent);
+},_buildURL:function(url){
+if(arguments.length>1){
+var m=MochiKit.Base;
+var qs=m.queryString.apply(null,m.extend(null,arguments,1));
+if(qs){
+return url+"?"+qs;
+}
+}
+return url;
+},doSimpleXMLHttpRequest:function(url){
+var self=MochiKit.Async;
+url=self._buildURL.apply(self,arguments);
+return self.doXHR(url);
+},loadJSONDoc:function(url){
+var self=MochiKit.Async;
+url=self._buildURL.apply(self,arguments);
+var d=self.doXHR(url,{"mimeType":"text/plain","headers":[["Accept","application/json"]]});
+d=d.addCallback(self.evalJSONRequest);
+return d;
+},wait:function(_2ca,_2cb){
+var d=new MochiKit.Async.Deferred();
+var m=MochiKit.Base;
+if(typeof (_2cb)!="undefined"){
+d.addCallback(function(){
+return _2cb;
+});
+}
+var _2ce=setTimeout(m.bind("callback",d),Math.floor(_2ca*1000));
+d.canceller=function(){
+try{
+clearTimeout(_2ce);
+}
+catch(e){
+}
+};
+return d;
+},callLater:function(_2cf,func){
+var m=MochiKit.Base;
+var _2d2=m.partial.apply(m,m.extend(null,arguments,1));
+return MochiKit.Async.wait(_2cf).addCallback(function(res){
+return _2d2();
+});
+}});
+MochiKit.Async.DeferredLock=function(){
+this.waiting=[];
+this.locked=false;
+this.id=this._nextId();
+};
+MochiKit.Async.DeferredLock.prototype={__class__:MochiKit.Async.DeferredLock,acquire:function(){
+var d=new MochiKit.Async.Deferred();
+if(this.locked){
+this.waiting.push(d);
+}else{
+this.locked=true;
+d.callback(this);
+}
+return d;
+},release:function(){
+if(!this.locked){
+throw TypeError("Tried to release an unlocked DeferredLock");
+}
+this.locked=false;
+if(this.waiting.length>0){
+this.locked=true;
+this.waiting.shift().callback(this);
+}
+},_nextId:MochiKit.Base.counter(),repr:function(){
+var _2d5;
+if(this.locked){
+_2d5="locked, "+this.waiting.length+" waiting";
+}else{
+_2d5="unlocked";
+}
+return "DeferredLock("+this.id+", "+_2d5+")";
+},toString:MochiKit.Base.forwardCall("repr")};
+MochiKit.Async.DeferredList=function(list,_2d7,_2d8,_2d9,_2da){
+MochiKit.Async.Deferred.apply(this,[_2da]);
+this.list=list;
+var _2db=[];
+this.resultList=_2db;
+this.finishedCount=0;
+this.fireOnOneCallback=_2d7;
+this.fireOnOneErrback=_2d8;
+this.consumeErrors=_2d9;
+var cb=MochiKit.Base.bind(this._cbDeferred,this);
+for(var i=0;i<list.length;i++){
+var d=list[i];
+_2db.push(undefined);
+d.addCallback(cb,i,true);
+d.addErrback(cb,i,false);
+}
+if(list.length===0&&!_2d7){
+this.callback(this.resultList);
+}
+};
+MochiKit.Async.DeferredList.prototype=new MochiKit.Async.Deferred();
+MochiKit.Async.DeferredList.prototype._cbDeferred=function(_2df,_2e0,_2e1){
+this.resultList[_2df]=[_2e0,_2e1];
+this.finishedCount+=1;
+if(this.fired==-1){
+if(_2e0&&this.fireOnOneCallback){
+this.callback([_2df,_2e1]);
+}else{
+if(!_2e0&&this.fireOnOneErrback){
+this.errback(_2e1);
+}else{
+if(this.finishedCount==this.list.length){
+this.callback(this.resultList);
+}
+}
+}
+}
+if(!_2e0&&this.consumeErrors){
+_2e1=null;
+}
+return _2e1;
+};
+MochiKit.Async.gatherResults=function(_2e2){
+var d=new MochiKit.Async.DeferredList(_2e2,false,true,false);
+d.addCallback(function(_2e4){
+var ret=[];
+for(var i=0;i<_2e4.length;i++){
+ret.push(_2e4[i][1]);
+}
+return ret;
+});
+return d;
+};
+MochiKit.Async.maybeDeferred=function(func){
+var self=MochiKit.Async;
+var _2e9;
+try{
+var r=func.apply(null,MochiKit.Base.extend([],arguments,1));
+if(r instanceof self.Deferred){
+_2e9=r;
+}else{
+if(r instanceof Error){
+_2e9=self.fail(r);
+}else{
+_2e9=self.succeed(r);
+}
+}
+}
+catch(e){
+_2e9=self.fail(e);
+}
+return _2e9;
+};
+MochiKit.Async.EXPORT=["AlreadyCalledError","CancelledError","BrowserComplianceError","GenericError","XMLHttpRequestError","Deferred","succeed","fail","getXMLHttpRequest","doSimpleXMLHttpRequest","loadJSONDoc","wait","callLater","sendXMLHttpRequest","DeferredLock","DeferredList","gatherResults","maybeDeferred","doXHR"];
+MochiKit.Async.EXPORT_OK=["evalJSONRequest"];
+MochiKit.Async.__new__=function(){
+var m=MochiKit.Base;
+var ne=m.partial(m._newNamedError,this);
+ne("AlreadyCalledError",function(_2ed){
+this.deferred=_2ed;
+});
+ne("CancelledError",function(_2ee){
+this.deferred=_2ee;
+});
+ne("BrowserComplianceError",function(msg){
+this.message=msg;
+});
+ne("GenericError",function(msg){
+this.message=msg;
+});
+ne("XMLHttpRequestError",function(req,msg){
+this.req=req;
+this.message=msg;
+try{
+this.number=req.status;
+}
+catch(e){
+}
+});
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+m.nameFunctions(this);
+};
+MochiKit.Async.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.Async);
+MochiKit.Base._deps("DOM",["Base"]);
+MochiKit.DOM.NAME="MochiKit.DOM";
+MochiKit.DOM.VERSION="1.4.2";
+MochiKit.DOM.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.DOM.toString=function(){
+return this.__repr__();
+};
+MochiKit.DOM.EXPORT=["removeEmptyTextNodes","formContents","currentWindow","currentDocument","withWindow","withDocument","registerDOMConverter","coerceToDOM","createDOM","createDOMFunc","isChildNode","getNodeAttribute","removeNodeAttribute","setNodeAttribute","updateNodeAttributes","appendChildNodes","insertSiblingNodesAfter","insertSiblingNodesBefore","replaceChildNodes","removeElement","swapDOM","BUTTON","TT","PRE","H1","H2","H3","H4","H5","H6","BR","CANVAS","HR","LABEL","TEXTAREA","FORM","STRONG","SELECT","OPTION","OPTGROUP","LEGEND","FIELDSET","P","UL","OL","LI","DL","DT","DD","TD","TR","THEAD","TBODY","TFOOT","TABLE","TH","INPUT","SPAN","A","DIV","IMG","getElement","$","getElementsByTagAndClassName","addToCallStack","addLoadEvent","focusOnLoad","setElementClass","toggleElementClass","addElementClass","removeElementClass","swapElementClass","hasElementClass","computedStyle","escapeHTML","toHTML","emitHTML","scrapeText","getFirstParentByTagAndClassName","getFirstElementByTagAndClassName"];
+MochiKit.DOM.EXPORT_OK=["domConverters"];
+MochiKit.DOM.DEPRECATED=[["computedStyle","MochiKit.Style.getStyle","1.4"],["elementDimensions","MochiKit.Style.getElementDimensions","1.4"],["elementPosition","MochiKit.Style.getElementPosition","1.4"],["getViewportDimensions","MochiKit.Style.getViewportDimensions","1.4"],["hideElement","MochiKit.Style.hideElement","1.4"],["makeClipping","MochiKit.Style.makeClipping","1.4.1"],["makePositioned","MochiKit.Style.makePositioned","1.4.1"],["setElementDimensions","MochiKit.Style.setElementDimensions","1.4"],["setElementPosition","MochiKit.Style.setElementPosition","1.4"],["setDisplayForElement","MochiKit.Style.setDisplayForElement","1.4"],["setOpacity","MochiKit.Style.setOpacity","1.4"],["showElement","MochiKit.Style.showElement","1.4"],["undoClipping","MochiKit.Style.undoClipping","1.4.1"],["undoPositioned","MochiKit.Style.undoPositioned","1.4.1"],["Coordinates","MochiKit.Style.Coordinates","1.4"],["Dimensions","MochiKit.Style.Dimensions","1.4"]];
+MochiKit.Base.update(MochiKit.DOM,{currentWindow:function(){
+return MochiKit.DOM._window;
+},currentDocument:function(){
+return MochiKit.DOM._document;
+},withWindow:function(win,func){
+var self=MochiKit.DOM;
+var _2f6=self._document;
+var _2f7=self._window;
+var rval;
+try{
+self._window=win;
+self._document=win.document;
+rval=func();
+}
+catch(e){
+self._window=_2f7;
+self._document=_2f6;
+throw e;
+}
+self._window=_2f7;
+self._document=_2f6;
+return rval;
+},formContents:function(elem){
+var _2fa=[];
+var _2fb=[];
+var m=MochiKit.Base;
+var self=MochiKit.DOM;
+if(typeof (elem)=="undefined"||elem===null){
+elem=self._document.body;
+}else{
+elem=self.getElement(elem);
+}
+m.nodeWalk(elem,function(elem){
+var name=elem.name;
+if(m.isNotEmpty(name)){
+var _300=elem.tagName.toUpperCase();
+if(_300==="INPUT"&&(elem.type=="radio"||elem.type=="checkbox")&&!elem.checked){
+return null;
+}
+if(_300==="SELECT"){
+if(elem.type=="select-one"){
+if(elem.selectedIndex>=0){
+var opt=elem.options[elem.selectedIndex];
+var v=opt.value;
+if(!v){
+var h=opt.outerHTML;
+if(h&&!h.match(/^[^>]+\svalue\s*=/i)){
+v=opt.text;
+}
+}
+_2fa.push(name);
+_2fb.push(v);
+return null;
+}
+_2fa.push(name);
+_2fb.push("");
+return null;
+}else{
+var opts=elem.options;
+if(!opts.length){
+_2fa.push(name);
+_2fb.push("");
+return null;
+}
+for(var i=0;i<opts.length;i++){
+var opt=opts[i];
+if(!opt.selected){
+continue;
+}
+var v=opt.value;
+if(!v){
+var h=opt.outerHTML;
+if(h&&!h.match(/^[^>]+\svalue\s*=/i)){
+v=opt.text;
+}
+}
+_2fa.push(name);
+_2fb.push(v);
+}
+return null;
+}
+}
+if(_300==="FORM"||_300==="P"||_300==="SPAN"||_300==="DIV"){
+return elem.childNodes;
+}
+_2fa.push(name);
+_2fb.push(elem.value||"");
+return null;
+}
+return elem.childNodes;
+});
+return [_2fa,_2fb];
+},withDocument:function(doc,func){
+var self=MochiKit.DOM;
+var _309=self._document;
+var rval;
+try{
+self._document=doc;
+rval=func();
+}
+catch(e){
+self._document=_309;
+throw e;
+}
+self._document=_309;
+return rval;
+},registerDOMConverter:function(name,_30c,wrap,_30e){
+MochiKit.DOM.domConverters.register(name,_30c,wrap,_30e);
+},coerceToDOM:function(node,ctx){
+var m=MochiKit.Base;
+var im=MochiKit.Iter;
+var self=MochiKit.DOM;
+if(im){
+var iter=im.iter;
+var _315=im.repeat;
+}
+var map=m.map;
+var _317=self.domConverters;
+var _318=arguments.callee;
+var _319=m.NotFound;
+while(true){
+if(typeof (node)=="undefined"||node===null){
+return null;
+}
+if(typeof (node)=="function"&&typeof (node.length)=="number"&&!(node instanceof Function)){
+node=im?im.list(node):m.extend(null,node);
+}
+if(typeof (node.nodeType)!="undefined"&&node.nodeType>0){
+return node;
+}
+if(typeof (node)=="number"||typeof (node)=="boolean"){
+node=node.toString();
+}
+if(typeof (node)=="string"){
+return self._document.createTextNode(node);
+}
+if(typeof (node.__dom__)=="function"){
+node=node.__dom__(ctx);
+continue;
+}
+if(typeof (node.dom)=="function"){
+node=node.dom(ctx);
+continue;
+}
+if(typeof (node)=="function"){
+node=node.apply(ctx,[ctx]);
+continue;
+}
+if(im){
+var _31a=null;
+try{
+_31a=iter(node);
+}
+catch(e){
+}
+if(_31a){
+return map(_318,_31a,_315(ctx));
+}
+}else{
+if(m.isArrayLike(node)){
+var func=function(n){
+return _318(n,ctx);
+};
+return map(func,node);
+}
+}
+try{
+node=_317.match(node,ctx);
+continue;
+}
+catch(e){
+if(e!=_319){
+throw e;
+}
+}
+return self._document.createTextNode(node.toString());
+}
+return undefined;
+},isChildNode:function(node,_31e){
+var self=MochiKit.DOM;
+if(typeof (node)=="string"){
+node=self.getElement(node);
+}
+if(typeof (_31e)=="string"){
+_31e=self.getElement(_31e);
+}
+if(typeof (node)=="undefined"||node===null){
+return false;
+}
+while(node!=null&&node!==self._document){
+if(node===_31e){
+return true;
+}
+node=node.parentNode;
+}
+return false;
+},setNodeAttribute:function(node,attr,_322){
+var o={};
+o[attr]=_322;
+try{
+return MochiKit.DOM.updateNodeAttributes(node,o);
+}
+catch(e){
+}
+return null;
+},getNodeAttribute:function(node,attr){
+var self=MochiKit.DOM;
+var _327=self.attributeArray.renames[attr];
+var _328=self.attributeArray.ignoreAttr[attr];
+node=self.getElement(node);
+try{
+if(_327){
+return node[_327];
+}
+var _329=node.getAttribute(attr);
+if(_329!=_328){
+return _329;
+}
+}
+catch(e){
+}
+return null;
+},removeNodeAttribute:function(node,attr){
+var self=MochiKit.DOM;
+var _32d=self.attributeArray.renames[attr];
+node=self.getElement(node);
+try{
+if(_32d){
+return node[_32d];
+}
+return node.removeAttribute(attr);
+}
+catch(e){
+}
+return null;
+},updateNodeAttributes:function(node,_32f){
+var elem=node;
+var self=MochiKit.DOM;
+if(typeof (node)=="string"){
+elem=self.getElement(node);
+}
+if(_32f){
+var _332=MochiKit.Base.updatetree;
+if(self.attributeArray.compliant){
+for(var k in _32f){
+var v=_32f[k];
+if(typeof (v)=="object"&&typeof (elem[k])=="object"){
+if(k=="style"&&MochiKit.Style){
+MochiKit.Style.setStyle(elem,v);
+}else{
+_332(elem[k],v);
+}
+}else{
+if(k.substring(0,2)=="on"){
+if(typeof (v)=="string"){
+v=new Function(v);
+}
+elem[k]=v;
+}else{
+elem.setAttribute(k,v);
+}
+}
+if(typeof (elem[k])=="string"&&elem[k]!=v){
+elem[k]=v;
+}
+}
+}else{
+var _335=self.attributeArray.renames;
+for(var k in _32f){
+v=_32f[k];
+var _336=_335[k];
+if(k=="style"&&typeof (v)=="string"){
+elem.style.cssText=v;
+}else{
+if(typeof (_336)=="string"){
+elem[_336]=v;
+}else{
+if(typeof (elem[k])=="object"&&typeof (v)=="object"){
+if(k=="style"&&MochiKit.Style){
+MochiKit.Style.setStyle(elem,v);
+}else{
+_332(elem[k],v);
+}
+}else{
+if(k.substring(0,2)=="on"){
+if(typeof (v)=="string"){
+v=new Function(v);
+}
+elem[k]=v;
+}else{
+elem.setAttribute(k,v);
+}
+}
+}
+}
+if(typeof (elem[k])=="string"&&elem[k]!=v){
+elem[k]=v;
+}
+}
+}
+}
+return elem;
+},appendChildNodes:function(node){
+var elem=node;
+var self=MochiKit.DOM;
+if(typeof (node)=="string"){
+elem=self.getElement(node);
+}
+var _33a=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
+var _33b=MochiKit.Base.concat;
+while(_33a.length){
+var n=_33a.shift();
+if(typeof (n)=="undefined"||n===null){
+}else{
+if(typeof (n.nodeType)=="number"){
+elem.appendChild(n);
+}else{
+_33a=_33b(n,_33a);
+}
+}
+}
+return elem;
+},insertSiblingNodesBefore:function(node){
+var elem=node;
+var self=MochiKit.DOM;
+if(typeof (node)=="string"){
+elem=self.getElement(node);
+}
+var _340=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
+var _341=elem.parentNode;
+var _342=MochiKit.Base.concat;
+while(_340.length){
+var n=_340.shift();
+if(typeof (n)=="undefined"||n===null){
+}else{
+if(typeof (n.nodeType)=="number"){
+_341.insertBefore(n,elem);
+}else{
+_340=_342(n,_340);
+}
+}
+}
+return _341;
+},insertSiblingNodesAfter:function(node){
+var elem=node;
+var self=MochiKit.DOM;
+if(typeof (node)=="string"){
+elem=self.getElement(node);
+}
+var _347=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
+if(elem.nextSibling){
+return self.insertSiblingNodesBefore(elem.nextSibling,_347);
+}else{
+return self.appendChildNodes(elem.parentNode,_347);
+}
+},replaceChildNodes:function(node){
+var elem=node;
+var self=MochiKit.DOM;
+if(typeof (node)=="string"){
+elem=self.getElement(node);
+arguments[0]=elem;
+}
+var _34b;
+while((_34b=elem.firstChild)){
+elem.removeChild(_34b);
+}
+if(arguments.length<2){
+return elem;
+}else{
+return self.appendChildNodes.apply(this,arguments);
+}
+},createDOM:function(name,_34d){
+var elem;
+var self=MochiKit.DOM;
+var m=MochiKit.Base;
+if(typeof (_34d)=="string"||typeof (_34d)=="number"){
+var args=m.extend([name,null],arguments,1);
+return arguments.callee.apply(this,args);
+}
+if(typeof (name)=="string"){
+var _352=self._xhtml;
+if(_34d&&!self.attributeArray.compliant){
+var _353="";
+if("name" in _34d){
+_353+=" name=\""+self.escapeHTML(_34d.name)+"\"";
+}
+if(name=="input"&&"type" in _34d){
+_353+=" type=\""+self.escapeHTML(_34d.type)+"\"";
+}
+if(_353){
+name="<"+name+_353+">";
+_352=false;
+}
+}
+var d=self._document;
+if(_352&&d===document){
+elem=d.createElementNS("http://www.w3.org/1999/xhtml",name);
+}else{
+elem=d.createElement(name);
+}
+}else{
+elem=name;
+}
+if(_34d){
+self.updateNodeAttributes(elem,_34d);
+}
+if(arguments.length<=2){
+return elem;
+}else{
+var args=m.extend([elem],arguments,2);
+return self.appendChildNodes.apply(this,args);
+}
+},createDOMFunc:function(){
+var m=MochiKit.Base;
+return m.partial.apply(this,m.extend([MochiKit.DOM.createDOM],arguments));
+},removeElement:function(elem){
+var self=MochiKit.DOM;
+var e=self.coerceToDOM(self.getElement(elem));
+e.parentNode.removeChild(e);
+return e;
+},swapDOM:function(dest,src){
+var self=MochiKit.DOM;
+dest=self.getElement(dest);
+var _35c=dest.parentNode;
+if(src){
+src=self.coerceToDOM(self.getElement(src),_35c);
+_35c.replaceChild(src,dest);
+}else{
+_35c.removeChild(dest);
+}
+return src;
+},getElement:function(id){
+var self=MochiKit.DOM;
+if(arguments.length==1){
+return ((typeof (id)=="string")?self._document.getElementById(id):id);
+}else{
+return MochiKit.Base.map(self.getElement,arguments);
+}
+},getElementsByTagAndClassName:function(_35f,_360,_361){
+var self=MochiKit.DOM;
+if(typeof (_35f)=="undefined"||_35f===null){
+_35f="*";
+}
+if(typeof (_361)=="undefined"||_361===null){
+_361=self._document;
+}
+_361=self.getElement(_361);
+if(_361==null){
+return [];
+}
+var _363=(_361.getElementsByTagName(_35f)||self._document.all);
+if(typeof (_360)=="undefined"||_360===null){
+return MochiKit.Base.extend(null,_363);
+}
+var _364=[];
+for(var i=0;i<_363.length;i++){
+var _366=_363[i];
+var cls=_366.className;
+if(typeof (cls)!="string"){
+cls=_366.getAttribute("class");
+}
+if(typeof (cls)=="string"){
+var _368=cls.split(" ");
+for(var j=0;j<_368.length;j++){
+if(_368[j]==_360){
+_364.push(_366);
+break;
+}
+}
+}
+}
+return _364;
+},_newCallStack:function(path,once){
+var rval=function(){
+var _36d=arguments.callee.callStack;
+for(var i=0;i<_36d.length;i++){
+if(_36d[i].apply(this,arguments)===false){
+break;
+}
+}
+if(once){
+try{
+this[path]=null;
+}
+catch(e){
+}
+}
+};
+rval.callStack=[];
+return rval;
+},addToCallStack:function(_36f,path,func,once){
+var self=MochiKit.DOM;
+var _374=_36f[path];
+var _375=_374;
+if(!(typeof (_374)=="function"&&typeof (_374.callStack)=="object"&&_374.callStack!==null)){
+_375=self._newCallStack(path,once);
+if(typeof (_374)=="function"){
+_375.callStack.push(_374);
+}
+_36f[path]=_375;
+}
+_375.callStack.push(func);
+},addLoadEvent:function(func){
+var self=MochiKit.DOM;
+self.addToCallStack(self._window,"onload",func,true);
+},focusOnLoad:function(_378){
+var self=MochiKit.DOM;
+self.addLoadEvent(function(){
+_378=self.getElement(_378);
+if(_378){
+_378.focus();
+}
+});
+},setElementClass:function(_37a,_37b){
+var self=MochiKit.DOM;
+var obj=self.getElement(_37a);
+if(self.attributeArray.compliant){
+obj.setAttribute("class",_37b);
+}else{
+obj.setAttribute("className",_37b);
+}
+},toggleElementClass:function(_37e){
+var self=MochiKit.DOM;
+for(var i=1;i<arguments.length;i++){
+var obj=self.getElement(arguments[i]);
+if(!self.addElementClass(obj,_37e)){
+self.removeElementClass(obj,_37e);
+}
+}
+},addElementClass:function(_382,_383){
+var self=MochiKit.DOM;
+var obj=self.getElement(_382);
+var cls=obj.className;
+if(typeof (cls)!="string"){
+cls=obj.getAttribute("class");
+}
+if(typeof (cls)!="string"||cls.length===0){
+self.setElementClass(obj,_383);
+return true;
+}
+if(cls==_383){
+return false;
+}
+var _387=cls.split(" ");
+for(var i=0;i<_387.length;i++){
+if(_387[i]==_383){
+return false;
+}
+}
+self.setElementClass(obj,cls+" "+_383);
+return true;
+},removeElementClass:function(_389,_38a){
+var self=MochiKit.DOM;
+var obj=self.getElement(_389);
+var cls=obj.className;
+if(typeof (cls)!="string"){
+cls=obj.getAttribute("class");
+}
+if(typeof (cls)!="string"||cls.length===0){
+return false;
+}
+if(cls==_38a){
+self.setElementClass(obj,"");
+return true;
+}
+var _38e=cls.split(" ");
+for(var i=0;i<_38e.length;i++){
+if(_38e[i]==_38a){
+_38e.splice(i,1);
+self.setElementClass(obj,_38e.join(" "));
+return true;
+}
+}
+return false;
+},swapElementClass:function(_390,_391,_392){
+var obj=MochiKit.DOM.getElement(_390);
+var res=MochiKit.DOM.removeElementClass(obj,_391);
+if(res){
+MochiKit.DOM.addElementClass(obj,_392);
+}
+return res;
+},hasElementClass:function(_395,_396){
+var obj=MochiKit.DOM.getElement(_395);
+if(obj==null){
+return false;
+}
+var cls=obj.className;
+if(typeof (cls)!="string"){
+cls=obj.getAttribute("class");
+}
+if(typeof (cls)!="string"){
+return false;
+}
+var _399=cls.split(" ");
+for(var i=1;i<arguments.length;i++){
+var good=false;
+for(var j=0;j<_399.length;j++){
+if(_399[j]==arguments[i]){
+good=true;
+break;
+}
+}
+if(!good){
+return false;
+}
+}
+return true;
+},escapeHTML:function(s){
+return s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
+},toHTML:function(dom){
+return MochiKit.DOM.emitHTML(dom).join("");
+},emitHTML:function(dom,lst){
+if(typeof (lst)=="undefined"||lst===null){
+lst=[];
+}
+var _3a1=[dom];
+var self=MochiKit.DOM;
+var _3a3=self.escapeHTML;
+var _3a4=self.attributeArray;
+while(_3a1.length){
+dom=_3a1.pop();
+if(typeof (dom)=="string"){
+lst.push(dom);
+}else{
+if(dom.nodeType==1){
+lst.push("<"+dom.tagName.toLowerCase());
+var _3a5=[];
+var _3a6=_3a4(dom);
+for(var i=0;i<_3a6.length;i++){
+var a=_3a6[i];
+_3a5.push([" ",a.name,"=\"",_3a3(a.value),"\""]);
+}
+_3a5.sort();
+for(i=0;i<_3a5.length;i++){
+var _3a9=_3a5[i];
+for(var j=0;j<_3a9.length;j++){
+lst.push(_3a9[j]);
+}
+}
+if(dom.hasChildNodes()){
+lst.push(">");
+_3a1.push("</"+dom.tagName.toLowerCase()+">");
+var _3ab=dom.childNodes;
+for(i=_3ab.length-1;i>=0;i--){
+_3a1.push(_3ab[i]);
+}
+}else{
+lst.push("/>");
+}
+}else{
+if(dom.nodeType==3){
+lst.push(_3a3(dom.nodeValue));
+}
+}
+}
+}
+return lst;
+},scrapeText:function(node,_3ad){
+var rval=[];
+(function(node){
+var cn=node.childNodes;
+if(cn){
+for(var i=0;i<cn.length;i++){
+arguments.callee.call(this,cn[i]);
+}
+}
+var _3b2=node.nodeValue;
+if(typeof (_3b2)=="string"){
+rval.push(_3b2);
+}
+})(MochiKit.DOM.getElement(node));
+if(_3ad){
+return rval;
+}else{
+return rval.join("");
+}
+},removeEmptyTextNodes:function(_3b3){
+_3b3=MochiKit.DOM.getElement(_3b3);
+for(var i=0;i<_3b3.childNodes.length;i++){
+var node=_3b3.childNodes[i];
+if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
+node.parentNode.removeChild(node);
+}
+}
+},getFirstElementByTagAndClassName:function(_3b6,_3b7,_3b8){
+var self=MochiKit.DOM;
+if(typeof (_3b6)=="undefined"||_3b6===null){
+_3b6="*";
+}
+if(typeof (_3b8)=="undefined"||_3b8===null){
+_3b8=self._document;
+}
+_3b8=self.getElement(_3b8);
+if(_3b8==null){
+return null;
+}
+var _3ba=(_3b8.getElementsByTagName(_3b6)||self._document.all);
+if(_3ba.length<=0){
+return null;
+}else{
+if(typeof (_3b7)=="undefined"||_3b7===null){
+return _3ba[0];
+}
+}
+for(var i=0;i<_3ba.length;i++){
+var _3bc=_3ba[i];
+var cls=_3bc.className;
+if(typeof (cls)!="string"){
+cls=_3bc.getAttribute("class");
+}
+if(typeof (cls)=="string"){
+var _3be=cls.split(" ");
+for(var j=0;j<_3be.length;j++){
+if(_3be[j]==_3b7){
+return _3bc;
+}
+}
+}
+}
+return null;
+},getFirstParentByTagAndClassName:function(elem,_3c1,_3c2){
+var self=MochiKit.DOM;
+elem=self.getElement(elem);
+if(typeof (_3c1)=="undefined"||_3c1===null){
+_3c1="*";
+}else{
+_3c1=_3c1.toUpperCase();
+}
+if(typeof (_3c2)=="undefined"||_3c2===null){
+_3c2=null;
+}
+if(elem){
+elem=elem.parentNode;
+}
+while(elem&&elem.tagName){
+var _3c4=elem.tagName.toUpperCase();
+if((_3c1==="*"||_3c1==_3c4)&&(_3c2===null||self.hasElementClass(elem,_3c2))){
+return elem;
+}
+elem=elem.parentNode;
+}
+return null;
+},__new__:function(win){
+var m=MochiKit.Base;
+if(typeof (document)!="undefined"){
+this._document=document;
+var _3c7="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
+this._xhtml=(document.documentElement&&document.createElementNS&&document.documentElement.namespaceURI===_3c7);
+}else{
+if(MochiKit.MockDOM){
+this._document=MochiKit.MockDOM.document;
+}
+}
+this._window=win;
+this.domConverters=new m.AdapterRegistry();
+var _3c8=this._document.createElement("span");
+var _3c9;
+if(_3c8&&_3c8.attributes&&_3c8.attributes.length>0){
+var _3ca=m.filter;
+_3c9=function(node){
+return _3ca(_3c9.ignoreAttrFilter,node.attributes);
+};
+_3c9.ignoreAttr={};
+var _3cc=_3c8.attributes;
+var _3cd=_3c9.ignoreAttr;
+for(var i=0;i<_3cc.length;i++){
+var a=_3cc[i];
+_3cd[a.name]=a.value;
+}
+_3c9.ignoreAttrFilter=function(a){
+return (_3c9.ignoreAttr[a.name]!=a.value);
+};
+_3c9.compliant=false;
+_3c9.renames={"class":"className","checked":"defaultChecked","usemap":"useMap","for":"htmlFor","readonly":"readOnly","colspan":"colSpan","bgcolor":"bgColor","cellspacing":"cellSpacing","cellpadding":"cellPadding"};
+}else{
+_3c9=function(node){
+return node.attributes;
+};
+_3c9.compliant=true;
+_3c9.ignoreAttr={};
+_3c9.renames={};
+}
+this.attributeArray=_3c9;
+var _3d2=function(_3d3,arr){
+var _3d5=arr[0];
+var _3d6=arr[1];
+var _3d7=_3d6.split(".")[1];
+var str="";
+str+="if (!MochiKit."+_3d7+") { throw new Error(\"";
+str+="This function has been deprecated and depends on MochiKit.";
+str+=_3d7+".\");}";
+str+="return "+_3d6+".apply(this, arguments);";
+MochiKit[_3d3][_3d5]=new Function(str);
+};
+for(var i=0;i<MochiKit.DOM.DEPRECATED.length;i++){
+_3d2("DOM",MochiKit.DOM.DEPRECATED[i]);
+}
+var _3d9=this.createDOMFunc;
+this.UL=_3d9("ul");
+this.OL=_3d9("ol");
+this.LI=_3d9("li");
+this.DL=_3d9("dl");
+this.DT=_3d9("dt");
+this.DD=_3d9("dd");
+this.TD=_3d9("td");
+this.TR=_3d9("tr");
+this.TBODY=_3d9("tbody");
+this.THEAD=_3d9("thead");
+this.TFOOT=_3d9("tfoot");
+this.TABLE=_3d9("table");
+this.TH=_3d9("th");
+this.INPUT=_3d9("input");
+this.SPAN=_3d9("span");
+this.A=_3d9("a");
+this.DIV=_3d9("div");
+this.IMG=_3d9("img");
+this.BUTTON=_3d9("button");
+this.TT=_3d9("tt");
+this.PRE=_3d9("pre");
+this.H1=_3d9("h1");
+this.H2=_3d9("h2");
+this.H3=_3d9("h3");
+this.H4=_3d9("h4");
+this.H5=_3d9("h5");
+this.H6=_3d9("h6");
+this.BR=_3d9("br");
+this.HR=_3d9("hr");
+this.LABEL=_3d9("label");
+this.TEXTAREA=_3d9("textarea");
+this.FORM=_3d9("form");
+this.P=_3d9("p");
+this.SELECT=_3d9("select");
+this.OPTION=_3d9("option");
+this.OPTGROUP=_3d9("optgroup");
+this.LEGEND=_3d9("legend");
+this.FIELDSET=_3d9("fieldset");
+this.STRONG=_3d9("strong");
+this.CANVAS=_3d9("canvas");
+this.$=this.getElement;
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+m.nameFunctions(this);
+}});
+MochiKit.DOM.__new__(((typeof (window)=="undefined")?this:window));
+if(MochiKit.__export__){
+withWindow=MochiKit.DOM.withWindow;
+withDocument=MochiKit.DOM.withDocument;
+}
+MochiKit.Base._exportSymbols(this,MochiKit.DOM);
+MochiKit.Base._deps("Selector",["Base","DOM","Iter"]);
+MochiKit.Selector.NAME="MochiKit.Selector";
+MochiKit.Selector.VERSION="1.4.2";
+MochiKit.Selector.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.Selector.toString=function(){
+return this.__repr__();
+};
+MochiKit.Selector.EXPORT=["Selector","findChildElements","findDocElements","$$"];
+MochiKit.Selector.EXPORT_OK=[];
+MochiKit.Selector.Selector=function(_3da){
+this.params={classNames:[],pseudoClassNames:[]};
+this.expression=_3da.toString().replace(/(^\s+|\s+$)/g,"");
+this.parseExpression();
+this.compileMatcher();
+};
+MochiKit.Selector.Selector.prototype={__class__:MochiKit.Selector.Selector,parseExpression:function(){
+function abort(_3db){
+throw "Parse error in selector: "+_3db;
+}
+if(this.expression==""){
+abort("empty expression");
+}
+var repr=MochiKit.Base.repr;
+var _3dd=this.params;
+var expr=this.expression;
+var _3df,_3e0,_3e1,rest;
+while(_3df=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!^$*]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){
+_3dd.attributes=_3dd.attributes||[];
+_3dd.attributes.push({name:_3df[2],operator:_3df[3],value:_3df[4]||_3df[5]||""});
+expr=_3df[1];
+}
+if(expr=="*"){
+return this.params.wildcard=true;
+}
+while(_3df=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+(?:\([^)]*\))?)(.*)/i)){
+_3e0=_3df[1];
+_3e1=_3df[2];
+rest=_3df[3];
+switch(_3e0){
+case "#":
+_3dd.id=_3e1;
+break;
+case ".":
+_3dd.classNames.push(_3e1);
+break;
+case ":":
+_3dd.pseudoClassNames.push(_3e1);
+break;
+case "":
+case undefined:
+_3dd.tagName=_3e1.toUpperCase();
+break;
+default:
+abort(repr(expr));
+}
+expr=rest;
+}
+if(expr.length>0){
+abort(repr(expr));
+}
+},buildMatchExpression:function(){
+var repr=MochiKit.Base.repr;
+var _3e4=this.params;
+var _3e5=[];
+var _3e6,i;
+function childElements(_3e8){
+return "MochiKit.Base.filter(function (node) { return node.nodeType == 1; }, "+_3e8+".childNodes)";
+}
+if(_3e4.wildcard){
+_3e5.push("true");
+}
+if(_3e6=_3e4.id){
+_3e5.push("element.id == "+repr(_3e6));
+}
+if(_3e6=_3e4.tagName){
+_3e5.push("element.tagName.toUpperCase() == "+repr(_3e6));
+}
+if((_3e6=_3e4.classNames).length>0){
+for(i=0;i<_3e6.length;i++){
+_3e5.push("MochiKit.DOM.hasElementClass(element, "+repr(_3e6[i])+")");
+}
+}
+if((_3e6=_3e4.pseudoClassNames).length>0){
+for(i=0;i<_3e6.length;i++){
+var _3e9=_3e6[i].match(/^([^(]+)(?:\((.*)\))?$/);
+var _3ea=_3e9[1];
+var _3eb=_3e9[2];
+switch(_3ea){
+case "root":
+_3e5.push("element.nodeType == 9 || element === element.ownerDocument.documentElement");
+break;
+case "nth-child":
+case "nth-last-child":
+case "nth-of-type":
+case "nth-last-of-type":
+_3e9=_3eb.match(/^((?:(\d+)n\+)?(\d+)|odd|even)$/);
+if(!_3e9){
+throw "Invalid argument to pseudo element nth-child: "+_3eb;
+}
+var a,b;
+if(_3e9[0]=="odd"){
+a=2;
+b=1;
+}else{
+if(_3e9[0]=="even"){
+a=2;
+b=0;
+}else{
+a=_3e9[2]&&parseInt(_3e9)||null;
+b=parseInt(_3e9[3]);
+}
+}
+_3e5.push("this.nthChild(element,"+a+","+b+","+!!_3ea.match("^nth-last")+","+!!_3ea.match("of-type$")+")");
+break;
+case "first-child":
+_3e5.push("this.nthChild(element, null, 1)");
+break;
+case "last-child":
+_3e5.push("this.nthChild(element, null, 1, true)");
+break;
+case "first-of-type":
+_3e5.push("this.nthChild(element, null, 1, false, true)");
+break;
+case "last-of-type":
+_3e5.push("this.nthChild(element, null, 1, true, true)");
+break;
+case "only-child":
+_3e5.push(childElements("element.parentNode")+".length == 1");
+break;
+case "only-of-type":
+_3e5.push("MochiKit.Base.filter(function (node) { return node.tagName == element.tagName; }, "+childElements("element.parentNode")+").length == 1");
+break;
+case "empty":
+_3e5.push("element.childNodes.length == 0");
+break;
+case "enabled":
+_3e5.push("(this.isUIElement(element) && element.disabled === false)");
+break;
+case "disabled":
+_3e5.push("(this.isUIElement(element) && element.disabled === true)");
+break;
+case "checked":
+_3e5.push("(this.isUIElement(element) && element.checked === true)");
+break;
+case "not":
+var _3ee=new MochiKit.Selector.Selector(_3eb);
+_3e5.push("!( "+_3ee.buildMatchExpression()+")");
+break;
+}
+}
+}
+if(_3e6=_3e4.attributes){
+MochiKit.Base.map(function(_3ef){
+var _3f0="MochiKit.DOM.getNodeAttribute(element, "+repr(_3ef.name)+")";
+var _3f1=function(_3f2){
+return _3f0+".split("+repr(_3f2)+")";
+};
+_3e5.push(_3f0+" != null");
+switch(_3ef.operator){
+case "=":
+_3e5.push(_3f0+" == "+repr(_3ef.value));
+break;
+case "~=":
+_3e5.push("MochiKit.Base.findValue("+_3f1(" ")+", "+repr(_3ef.value)+") > -1");
+break;
+case "^=":
+_3e5.push(_3f0+".substring(0, "+_3ef.value.length+") == "+repr(_3ef.value));
+break;
+case "$=":
+_3e5.push(_3f0+".substring("+_3f0+".length - "+_3ef.value.length+") == "+repr(_3ef.value));
+break;
+case "*=":
+_3e5.push(_3f0+".match("+repr(_3ef.value)+")");
+break;
+case "|=":
+_3e5.push(_3f1("-")+"[0].toUpperCase() == "+repr(_3ef.value.toUpperCase()));
+break;
+case "!=":
+_3e5.push(_3f0+" != "+repr(_3ef.value));
+break;
+case "":
+case undefined:
+break;
+default:
+throw "Unknown operator "+_3ef.operator+" in selector";
+}
+},_3e6);
+}
+return _3e5.join(" && ");
+},compileMatcher:function(){
+var code="return (!element.tagName) ? false : "+this.buildMatchExpression()+";";
+this.match=new Function("element",code);
+},nthChild:function(_3f4,a,b,_3f7,_3f8){
+var _3f9=MochiKit.Base.filter(function(node){
+return node.nodeType==1;
+},_3f4.parentNode.childNodes);
+if(_3f8){
+_3f9=MochiKit.Base.filter(function(node){
+return node.tagName==_3f4.tagName;
+},_3f9);
+}
+if(_3f7){
+_3f9=MochiKit.Iter.reversed(_3f9);
+}
+if(a){
+var _3fc=MochiKit.Base.findIdentical(_3f9,_3f4);
+return ((_3fc+1-b)/a)%1==0;
+}else{
+return b==MochiKit.Base.findIdentical(_3f9,_3f4)+1;
+}
+},isUIElement:function(_3fd){
+return MochiKit.Base.findValue(["input","button","select","option","textarea","object"],_3fd.tagName.toLowerCase())>-1;
+},findElements:function(_3fe,axis){
+var _400;
+if(axis==undefined){
+axis="";
+}
+function inScope(_401,_402){
+if(axis==""){
+return MochiKit.DOM.isChildNode(_401,_402);
+}else{
+if(axis==">"){
+return _401.parentNode===_402;
+}else{
+if(axis=="+"){
+return _401===nextSiblingElement(_402);
+}else{
+if(axis=="~"){
+var _403=_402;
+while(_403=nextSiblingElement(_403)){
+if(_401===_403){
+return true;
+}
+}
+return false;
+}else{
+throw "Invalid axis: "+axis;
+}
+}
+}
+}
+}
+if(_400=MochiKit.DOM.getElement(this.params.id)){
+if(this.match(_400)){
+if(!_3fe||inScope(_400,_3fe)){
+return [_400];
+}
+}
+}
+function nextSiblingElement(node){
+node=node.nextSibling;
+while(node&&node.nodeType!=1){
+node=node.nextSibling;
+}
+return node;
+}
+if(axis==""){
+_3fe=(_3fe||MochiKit.DOM.currentDocument()).getElementsByTagName(this.params.tagName||"*");
+}else{
+if(axis==">"){
+if(!_3fe){
+throw "> combinator not allowed without preceeding expression";
+}
+_3fe=MochiKit.Base.filter(function(node){
+return node.nodeType==1;
+},_3fe.childNodes);
+}else{
+if(axis=="+"){
+if(!_3fe){
+throw "+ combinator not allowed without preceeding expression";
+}
+_3fe=nextSiblingElement(_3fe)&&[nextSiblingElement(_3fe)];
+}else{
+if(axis=="~"){
+if(!_3fe){
+throw "~ combinator not allowed without preceeding expression";
+}
+var _406=[];
+while(nextSiblingElement(_3fe)){
+_3fe=nextSiblingElement(_3fe);
+_406.push(_3fe);
+}
+_3fe=_406;
+}
+}
+}
+}
+if(!_3fe){
+return [];
+}
+var _407=MochiKit.Base.filter(MochiKit.Base.bind(function(_408){
+return this.match(_408);
+},this),_3fe);
+return _407;
+},repr:function(){
+return "Selector("+this.expression+")";
+},toString:MochiKit.Base.forwardCall("repr")};
+MochiKit.Base.update(MochiKit.Selector,{findChildElements:function(_409,_40a){
+var uniq=function(arr){
+var res=[];
+for(var i=0;i<arr.length;i++){
+if(MochiKit.Base.findIdentical(res,arr[i])<0){
+res.push(arr[i]);
+}
+}
+return res;
+};
+return MochiKit.Base.flattenArray(MochiKit.Base.map(function(_40f){
+var _410="";
+var _411=function(_412,expr){
+if(match=expr.match(/^[>+~]$/)){
+_410=match[0];
+return _412;
+}else{
+var _414=new MochiKit.Selector.Selector(expr);
+var _415=MochiKit.Iter.reduce(function(_416,_417){
+return MochiKit.Base.extend(_416,_414.findElements(_417||_409,_410));
+},_412,[]);
+_410="";
+return _415;
+}
+};
+var _418=_40f.replace(/(^\s+|\s+$)/g,"").split(/\s+/);
+return uniq(MochiKit.Iter.reduce(_411,_418,[null]));
+},_40a));
+},findDocElements:function(){
+return MochiKit.Selector.findChildElements(MochiKit.DOM.currentDocument(),arguments);
+},__new__:function(){
+var m=MochiKit.Base;
+this.$$=this.findDocElements;
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+m.nameFunctions(this);
+}});
+MochiKit.Selector.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.Selector);
+MochiKit.Base._deps("Style",["Base","DOM"]);
+MochiKit.Style.NAME="MochiKit.Style";
+MochiKit.Style.VERSION="1.4.2";
+MochiKit.Style.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.Style.toString=function(){
+return this.__repr__();
+};
+MochiKit.Style.EXPORT_OK=[];
+MochiKit.Style.EXPORT=["setStyle","setOpacity","getStyle","getElementDimensions","elementDimensions","setElementDimensions","getElementPosition","elementPosition","setElementPosition","makePositioned","undoPositioned","makeClipping","undoClipping","setDisplayForElement","hideElement","showElement","getViewportDimensions","getViewportPosition","Dimensions","Coordinates"];
+MochiKit.Style.Dimensions=function(w,h){
+this.w=w;
+this.h=h;
+};
+MochiKit.Style.Dimensions.prototype.__repr__=function(){
+var repr=MochiKit.Base.repr;
+return "{w: "+repr(this.w)+", h: "+repr(this.h)+"}";
+};
+MochiKit.Style.Dimensions.prototype.toString=function(){
+return this.__repr__();
+};
+MochiKit.Style.Coordinates=function(x,y){
+this.x=x;
+this.y=y;
+};
+MochiKit.Style.Coordinates.prototype.__repr__=function(){
+var repr=MochiKit.Base.repr;
+return "{x: "+repr(this.x)+", y: "+repr(this.y)+"}";
+};
+MochiKit.Style.Coordinates.prototype.toString=function(){
+return this.__repr__();
+};
+MochiKit.Base.update(MochiKit.Style,{getStyle:function(elem,_421){
+var dom=MochiKit.DOM;
+var d=dom._document;
+elem=dom.getElement(elem);
+_421=MochiKit.Base.camelize(_421);
+if(!elem||elem==d){
+return undefined;
+}
+if(_421=="opacity"&&typeof (elem.filters)!="undefined"){
+var _424=(MochiKit.Style.getStyle(elem,"filter")||"").match(/alpha\(opacity=(.*)\)/);
+if(_424&&_424[1]){
+return parseFloat(_424[1])/100;
+}
+return 1;
+}
+if(_421=="float"||_421=="cssFloat"||_421=="styleFloat"){
+if(elem.style["float"]){
+return elem.style["float"];
+}else{
+if(elem.style.cssFloat){
+return elem.style.cssFloat;
+}else{
+if(elem.style.styleFloat){
+return elem.style.styleFloat;
+}else{
+return "none";
+}
+}
+}
+}
+var _425=elem.style?elem.style[_421]:null;
+if(!_425){
+if(d.defaultView&&d.defaultView.getComputedStyle){
+var css=d.defaultView.getComputedStyle(elem,null);
+_421=_421.replace(/([A-Z])/g,"-$1").toLowerCase();
+_425=css?css.getPropertyValue(_421):null;
+}else{
+if(elem.currentStyle){
+_425=elem.currentStyle[_421];
+if(/^\d/.test(_425)&&!/px$/.test(_425)&&_421!="fontWeight"){
+var left=elem.style.left;
+var _428=elem.runtimeStyle.left;
+elem.runtimeStyle.left=elem.currentStyle.left;
+elem.style.left=_425||0;
+_425=elem.style.pixelLeft+"px";
+elem.style.left=left;
+elem.runtimeStyle.left=_428;
+}
+}
+}
+}
+if(_421=="opacity"){
+_425=parseFloat(_425);
+}
+if(/Opera/.test(navigator.userAgent)&&(MochiKit.Base.findValue(["left","top","right","bottom"],_421)!=-1)){
+if(MochiKit.Style.getStyle(elem,"position")=="static"){
+_425="auto";
+}
+}
+return _425=="auto"?null:_425;
+},setStyle:function(elem,_42a){
+elem=MochiKit.DOM.getElement(elem);
+for(var name in _42a){
+switch(name){
+case "opacity":
+MochiKit.Style.setOpacity(elem,_42a[name]);
+break;
+case "float":
+case "cssFloat":
+case "styleFloat":
+if(typeof (elem.style["float"])!="undefined"){
+elem.style["float"]=_42a[name];
+}else{
+if(typeof (elem.style.cssFloat)!="undefined"){
+elem.style.cssFloat=_42a[name];
+}else{
+elem.style.styleFloat=_42a[name];
+}
+}
+break;
+default:
+elem.style[MochiKit.Base.camelize(name)]=_42a[name];
+}
+}
+},setOpacity:function(elem,o){
+elem=MochiKit.DOM.getElement(elem);
+var self=MochiKit.Style;
+if(o==1){
+var _42f=/Gecko/.test(navigator.userAgent)&&!(/Konqueror|AppleWebKit|KHTML/.test(navigator.userAgent));
+elem.style["opacity"]=_42f?0.999999:1;
+if(/MSIE/.test(navigator.userAgent)){
+elem.style["filter"]=self.getStyle(elem,"filter").replace(/alpha\([^\)]*\)/gi,"");
+}
+}else{
+if(o<0.00001){
+o=0;
+}
+elem.style["opacity"]=o;
+if(/MSIE/.test(navigator.userAgent)){
+elem.style["filter"]=self.getStyle(elem,"filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+o*100+")";
+}
+}
+},getElementPosition:function(elem,_431){
+var self=MochiKit.Style;
+var dom=MochiKit.DOM;
+elem=dom.getElement(elem);
+if(!elem||(!(elem.x&&elem.y)&&(!elem.parentNode===null||self.getStyle(elem,"display")=="none"))){
+return undefined;
+}
+var c=new self.Coordinates(0,0);
+var box=null;
+var _436=null;
+var d=MochiKit.DOM._document;
+var de=d.documentElement;
+var b=d.body;
+if(!elem.parentNode&&elem.x&&elem.y){
+c.x+=elem.x||0;
+c.y+=elem.y||0;
+}else{
+if(elem.getBoundingClientRect){
+box=elem.getBoundingClientRect();
+c.x+=box.left+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0);
+c.y+=box.top+(de.scrollTop||b.scrollTop)-(de.clientTop||0);
+}else{
+if(elem.offsetParent){
+c.x+=elem.offsetLeft;
+c.y+=elem.offsetTop;
+_436=elem.offsetParent;
+if(_436!=elem){
+while(_436){
+c.x+=parseInt(_436.style.borderLeftWidth)||0;
+c.y+=parseInt(_436.style.borderTopWidth)||0;
+c.x+=_436.offsetLeft;
+c.y+=_436.offsetTop;
+_436=_436.offsetParent;
+}
+}
+var ua=navigator.userAgent.toLowerCase();
+if((typeof (opera)!="undefined"&&parseFloat(opera.version())<9)||(ua.indexOf("AppleWebKit")!=-1&&self.getStyle(elem,"position")=="absolute")){
+c.x-=b.offsetLeft;
+c.y-=b.offsetTop;
+}
+if(elem.parentNode){
+_436=elem.parentNode;
+}else{
+_436=null;
+}
+while(_436){
+var _43b=_436.tagName.toUpperCase();
+if(_43b==="BODY"||_43b==="HTML"){
+break;
+}
+var disp=self.getStyle(_436,"display");
+if(disp.search(/^inline|table-row.*$/i)){
+c.x-=_436.scrollLeft;
+c.y-=_436.scrollTop;
+}
+if(_436.parentNode){
+_436=_436.parentNode;
+}else{
+_436=null;
+}
+}
+}
+}
+}
+if(typeof (_431)!="undefined"){
+_431=arguments.callee(_431);
+if(_431){
+c.x-=(_431.x||0);
+c.y-=(_431.y||0);
+}
+}
+return c;
+},setElementPosition:function(elem,_43e,_43f){
+elem=MochiKit.DOM.getElement(elem);
+if(typeof (_43f)=="undefined"){
+_43f="px";
+}
+var _440={};
+var _441=MochiKit.Base.isUndefinedOrNull;
+if(!_441(_43e.x)){
+_440["left"]=_43e.x+_43f;
+}
+if(!_441(_43e.y)){
+_440["top"]=_43e.y+_43f;
+}
+MochiKit.DOM.updateNodeAttributes(elem,{"style":_440});
+},makePositioned:function(_442){
+_442=MochiKit.DOM.getElement(_442);
+var pos=MochiKit.Style.getStyle(_442,"position");
+if(pos=="static"||!pos){
+_442.style.position="relative";
+if(/Opera/.test(navigator.userAgent)){
+_442.style.top=0;
+_442.style.left=0;
+}
+}
+},undoPositioned:function(_444){
+_444=MochiKit.DOM.getElement(_444);
+if(_444.style.position=="relative"){
+_444.style.position=_444.style.top=_444.style.left=_444.style.bottom=_444.style.right="";
+}
+},makeClipping:function(_445){
+_445=MochiKit.DOM.getElement(_445);
+var s=_445.style;
+var _447={"overflow":s.overflow,"overflow-x":s.overflowX,"overflow-y":s.overflowY};
+if((MochiKit.Style.getStyle(_445,"overflow")||"visible")!="hidden"){
+_445.style.overflow="hidden";
+_445.style.overflowX="hidden";
+_445.style.overflowY="hidden";
+}
+return _447;
+},undoClipping:function(_448,_449){
+_448=MochiKit.DOM.getElement(_448);
+if(typeof (_449)=="string"){
+_448.style.overflow=_449;
+}else{
+if(_449!=null){
+_448.style.overflow=_449["overflow"];
+_448.style.overflowX=_449["overflow-x"];
+_448.style.overflowY=_449["overflow-y"];
+}
+}
+},getElementDimensions:function(elem,_44b){
+var self=MochiKit.Style;
+var dom=MochiKit.DOM;
+if(typeof (elem.w)=="number"||typeof (elem.h)=="number"){
+return new self.Dimensions(elem.w||0,elem.h||0);
+}
+elem=dom.getElement(elem);
+if(!elem){
+return undefined;
+}
+var disp=self.getStyle(elem,"display");
+if(disp=="none"||disp==""||typeof (disp)=="undefined"){
+var s=elem.style;
+var _450=s.visibility;
+var _451=s.position;
+var _452=s.display;
+s.visibility="hidden";
+s.position="absolute";
+s.display=self._getDefaultDisplay(elem);
+var _453=elem.offsetWidth;
+var _454=elem.offsetHeight;
+s.display=_452;
+s.position=_451;
+s.visibility=_450;
+}else{
+_453=elem.offsetWidth||0;
+_454=elem.offsetHeight||0;
+}
+if(_44b){
+var _455="colSpan" in elem&&"rowSpan" in elem;
+var _456=(_455&&elem.parentNode&&self.getStyle(elem.parentNode,"borderCollapse")=="collapse");
+if(_456){
+if(/MSIE/.test(navigator.userAgent)){
+var _457=elem.previousSibling?0.5:1;
+var _458=elem.nextSibling?0.5:1;
+}else{
+var _457=0.5;
+var _458=0.5;
+}
+}else{
+var _457=1;
+var _458=1;
+}
+_453-=Math.round((parseFloat(self.getStyle(elem,"paddingLeft"))||0)+(parseFloat(self.getStyle(elem,"paddingRight"))||0)+_457*(parseFloat(self.getStyle(elem,"borderLeftWidth"))||0)+_458*(parseFloat(self.getStyle(elem,"borderRightWidth"))||0));
+if(_455){
+if(/Gecko|Opera/.test(navigator.userAgent)&&!/Konqueror|AppleWebKit|KHTML/.test(navigator.userAgent)){
+var _459=0;
+}else{
+if(/MSIE/.test(navigator.userAgent)){
+var _459=1;
+}else{
+var _459=_456?0.5:1;
+}
+}
+}else{
+var _459=1;
+}
+_454-=Math.round((parseFloat(self.getStyle(elem,"paddingTop"))||0)+(parseFloat(self.getStyle(elem,"paddingBottom"))||0)+_459*((parseFloat(self.getStyle(elem,"borderTopWidth"))||0)+(parseFloat(self.getStyle(elem,"borderBottomWidth"))||0)));
+}
+return new self.Dimensions(_453,_454);
+},setElementDimensions:function(elem,_45b,_45c){
+elem=MochiKit.DOM.getElement(elem);
+if(typeof (_45c)=="undefined"){
+_45c="px";
+}
+var _45d={};
+var _45e=MochiKit.Base.isUndefinedOrNull;
+if(!_45e(_45b.w)){
+_45d["width"]=_45b.w+_45c;
+}
+if(!_45e(_45b.h)){
+_45d["height"]=_45b.h+_45c;
+}
+MochiKit.DOM.updateNodeAttributes(elem,{"style":_45d});
+},_getDefaultDisplay:function(elem){
+var self=MochiKit.Style;
+var dom=MochiKit.DOM;
+elem=dom.getElement(elem);
+if(!elem){
+return undefined;
+}
+var _462=elem.tagName.toUpperCase();
+return self._defaultDisplay[_462]||"block";
+},setDisplayForElement:function(_463,_464){
+var _465=MochiKit.Base.extend(null,arguments,1);
+var _466=MochiKit.DOM.getElement;
+for(var i=0;i<_465.length;i++){
+_464=_466(_465[i]);
+if(_464){
+_464.style.display=_463;
+}
+}
+},getViewportDimensions:function(){
+var d=new MochiKit.Style.Dimensions();
+var w=MochiKit.DOM._window;
+var b=MochiKit.DOM._document.body;
+if(w.innerWidth){
+d.w=w.innerWidth;
+d.h=w.innerHeight;
+}else{
+if(b&&b.parentElement&&b.parentElement.clientWidth){
+d.w=b.parentElement.clientWidth;
+d.h=b.parentElement.clientHeight;
+}else{
+if(b&&b.clientWidth){
+d.w=b.clientWidth;
+d.h=b.clientHeight;
+}
+}
+}
+return d;
+},getViewportPosition:function(){
+var c=new MochiKit.Style.Coordinates(0,0);
+var d=MochiKit.DOM._document;
+var de=d.documentElement;
+var db=d.body;
+if(de&&(de.scrollTop||de.scrollLeft)){
+c.x=de.scrollLeft;
+c.y=de.scrollTop;
+}else{
+if(db){
+c.x=db.scrollLeft;
+c.y=db.scrollTop;
+}
+}
+return c;
+},__new__:function(){
+var m=MochiKit.Base;
+var _470=["A","ABBR","ACRONYM","B","BASEFONT","BDO","BIG","BR","CITE","CODE","DFN","EM","FONT","I","IMG","KBD","LABEL","Q","S","SAMP","SMALL","SPAN","STRIKE","STRONG","SUB","SUP","TEXTAREA","TT","U","VAR"];
+this._defaultDisplay={"TABLE":"table","THEAD":"table-header-group","TBODY":"table-row-group","TFOOT":"table-footer-group","COLGROUP":"table-column-group","COL":"table-column","TR":"table-row","TD":"table-cell","TH":"table-cell","CAPTION":"table-caption","LI":"list-item","INPUT":"inline-block","SELECT":"inline-block"};
+if(/MSIE/.test(navigator.userAgent)){
+for(var k in this._defaultDisplay){
+var v=this._defaultDisplay[k];
+if(v.indexOf("table")==0){
+this._defaultDisplay[k]="block";
+}
+}
+}
+for(var i=0;i<_470.length;i++){
+this._defaultDisplay[_470[i]]="inline";
+}
+this.elementPosition=this.getElementPosition;
+this.elementDimensions=this.getElementDimensions;
+this.hideElement=m.partial(this.setDisplayForElement,"none");
+this.showElement=m.partial(this.setDisplayForElement,"block");
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+m.nameFunctions(this);
+}});
+MochiKit.Style.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.Style);
+MochiKit.Base._deps("LoggingPane",["Base","Logging"]);
+MochiKit.LoggingPane.NAME="MochiKit.LoggingPane";
+MochiKit.LoggingPane.VERSION="1.4.2";
+MochiKit.LoggingPane.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.LoggingPane.toString=function(){
+return this.__repr__();
+};
+MochiKit.LoggingPane.createLoggingPane=function(_474){
+var m=MochiKit.LoggingPane;
+_474=!(!_474);
+if(m._loggingPane&&m._loggingPane.inline!=_474){
+m._loggingPane.closePane();
+m._loggingPane=null;
+}
+if(!m._loggingPane||m._loggingPane.closed){
+m._loggingPane=new m.LoggingPane(_474,MochiKit.Logging.logger);
+}
+return m._loggingPane;
+};
+MochiKit.LoggingPane.LoggingPane=function(_476,_477){
+if(typeof (_477)=="undefined"||_477===null){
+_477=MochiKit.Logging.logger;
+}
+this.logger=_477;
+var _478=MochiKit.Base.update;
+var _479=MochiKit.Base.updatetree;
+var bind=MochiKit.Base.bind;
+var _47b=MochiKit.Base.clone;
+var win=window;
+var uid="_MochiKit_LoggingPane";
+if(typeof (MochiKit.DOM)!="undefined"){
+win=MochiKit.DOM.currentWindow();
+}
+if(!_476){
+var url=win.location.href.split("?")[0].replace(/[#:\/.><&%-]/g,"_");
+var name=uid+"_"+url;
+var nwin=win.open("",name,"dependent,resizable,height=200");
+if(!nwin){
+alert("Not able to open debugging window due to pop-up blocking.");
+return undefined;
+}
+nwin.document.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" "+"\"http://www.w3.org/TR/html4/loose.dtd\">"+"<html><head><title>[MochiKit.LoggingPane]</title></head>"+"<body></body></html>");
+nwin.document.close();
+nwin.document.title+=" "+win.document.title;
+win=nwin;
+}
+var doc=win.document;
+this.doc=doc;
+var _482=doc.getElementById(uid);
+var _483=!!_482;
+if(_482&&typeof (_482.loggingPane)!="undefined"){
+_482.loggingPane.logger=this.logger;
+_482.loggingPane.buildAndApplyFilter();
+return _482.loggingPane;
+}
+if(_483){
+var _484;
+while((_484=_482.firstChild)){
+_482.removeChild(_484);
+}
+}else{
+_482=doc.createElement("div");
+_482.id=uid;
+}
+_482.loggingPane=this;
+var _485=doc.createElement("input");
+var _486=doc.createElement("input");
+var _487=doc.createElement("button");
+var _488=doc.createElement("button");
+var _489=doc.createElement("button");
+var _48a=doc.createElement("button");
+var _48b=doc.createElement("div");
+var _48c=doc.createElement("div");
+var _48d=uid+"_Listener";
+this.colorTable=_47b(this.colorTable);
+var _48e=[];
+var _48f=null;
+var _490=function(msg){
+var _492=msg.level;
+if(typeof (_492)=="number"){
+_492=MochiKit.Logging.LogLevel[_492];
+}
+return _492;
+};
+var _493=function(msg){
+return msg.info.join(" ");
+};
+var _495=bind(function(msg){
+var _497=_490(msg);
+var text=_493(msg);
+var c=this.colorTable[_497];
+var p=doc.createElement("span");
+p.className="MochiKit-LogMessage MochiKit-LogLevel-"+_497;
+p.style.cssText="margin: 0px; white-space: -moz-pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; white-space: pre-line; word-wrap: break-word; wrap-option: emergency; color: "+c;
+p.appendChild(doc.createTextNode(_497+": "+text));
+_48c.appendChild(p);
+_48c.appendChild(doc.createElement("br"));
+if(_48b.offsetHeight>_48b.scrollHeight){
+_48b.scrollTop=0;
+}else{
+_48b.scrollTop=_48b.scrollHeight;
+}
+},this);
+var _49b=function(msg){
+_48e[_48e.length]=msg;
+_495(msg);
+};
+var _49d=function(){
+var _49e,_49f;
+try{
+_49e=new RegExp(_485.value);
+_49f=new RegExp(_486.value);
+}
+catch(e){
+logDebug("Error in filter regex: "+e.message);
+return null;
+}
+return function(msg){
+return (_49e.test(_490(msg))&&_49f.test(_493(msg)));
+};
+};
+var _4a1=function(){
+while(_48c.firstChild){
+_48c.removeChild(_48c.firstChild);
+}
+};
+var _4a2=function(){
+_48e=[];
+_4a1();
+};
+var _4a3=bind(function(){
+if(this.closed){
+return;
+}
+this.closed=true;
+if(MochiKit.LoggingPane._loggingPane==this){
+MochiKit.LoggingPane._loggingPane=null;
+}
+this.logger.removeListener(_48d);
+try{
+try{
+_482.loggingPane=null;
+}
+catch(e){
+logFatal("Bookmarklet was closed incorrectly.");
+}
+if(_476){
+_482.parentNode.removeChild(_482);
+}else{
+this.win.close();
+}
+}
+catch(e){
+}
+},this);
+var _4a4=function(){
+_4a1();
+for(var i=0;i<_48e.length;i++){
+var msg=_48e[i];
+if(_48f===null||_48f(msg)){
+_495(msg);
+}
+}
+};
+this.buildAndApplyFilter=function(){
+_48f=_49d();
+_4a4();
+this.logger.removeListener(_48d);
+this.logger.addListener(_48d,_48f,_49b);
+};
+var _4a7=bind(function(){
+_48e=this.logger.getMessages();
+_4a4();
+},this);
+var _4a8=bind(function(_4a9){
+_4a9=_4a9||window.event;
+key=_4a9.which||_4a9.keyCode;
+if(key==13){
+this.buildAndApplyFilter();
+}
+},this);
+var _4aa="display: block; z-index: 1000; left: 0px; bottom: 0px; position: fixed; width: 100%; background-color: white; font: "+this.logFont;
+if(_476){
+_4aa+="; height: 10em; border-top: 2px solid black";
+}else{
+_4aa+="; height: 100%;";
+}
+_482.style.cssText=_4aa;
+if(!_483){
+doc.body.appendChild(_482);
+}
+_4aa={"cssText":"width: 33%; display: inline; font: "+this.logFont};
+_479(_485,{"value":"FATAL|ERROR|WARNING|INFO|DEBUG","onkeypress":_4a8,"style":_4aa});
+_482.appendChild(_485);
+_479(_486,{"value":".*","onkeypress":_4a8,"style":_4aa});
+_482.appendChild(_486);
+_4aa="width: 8%; display:inline; font: "+this.logFont;
+_487.appendChild(doc.createTextNode("Filter"));
+_487.onclick=bind("buildAndApplyFilter",this);
+_487.style.cssText=_4aa;
+_482.appendChild(_487);
+_488.appendChild(doc.createTextNode("Load"));
+_488.onclick=_4a7;
+_488.style.cssText=_4aa;
+_482.appendChild(_488);
+_489.appendChild(doc.createTextNode("Clear"));
+_489.onclick=_4a2;
+_489.style.cssText=_4aa;
+_482.appendChild(_489);
+_48a.appendChild(doc.createTextNode("Close"));
+_48a.onclick=_4a3;
+_48a.style.cssText=_4aa;
+_482.appendChild(_48a);
+_48b.style.cssText="overflow: auto; width: 100%";
+_48c.style.cssText="width: 100%; height: "+(_476?"8em":"100%");
+_48b.appendChild(_48c);
+_482.appendChild(_48b);
+this.buildAndApplyFilter();
+_4a7();
+if(_476){
+this.win=undefined;
+}else{
+this.win=win;
+}
+this.inline=_476;
+this.closePane=_4a3;
+this.closed=false;
+return this;
+};
+MochiKit.LoggingPane.LoggingPane.prototype={"logFont":"8pt Verdana,sans-serif","colorTable":{"ERROR":"red","FATAL":"darkred","WARNING":"blue","INFO":"black","DEBUG":"green"}};
+MochiKit.LoggingPane.EXPORT_OK=["LoggingPane"];
+MochiKit.LoggingPane.EXPORT=["createLoggingPane"];
+MochiKit.LoggingPane.__new__=function(){
+this.EXPORT_TAGS={":common":this.EXPORT,":all":MochiKit.Base.concat(this.EXPORT,this.EXPORT_OK)};
+MochiKit.Base.nameFunctions(this);
+MochiKit.LoggingPane._loggingPane=null;
+};
+MochiKit.LoggingPane.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.LoggingPane);
+MochiKit.Base._deps("Color",["Base","DOM","Style"]);
+MochiKit.Color.NAME="MochiKit.Color";
+MochiKit.Color.VERSION="1.4.2";
+MochiKit.Color.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.Color.toString=function(){
+return this.__repr__();
+};
+MochiKit.Color.Color=function(red,_4ac,blue,_4ae){
+if(typeof (_4ae)=="undefined"||_4ae===null){
+_4ae=1;
+}
+this.rgb={r:red,g:_4ac,b:blue,a:_4ae};
+};
+MochiKit.Color.Color.prototype={__class__:MochiKit.Color.Color,colorWithAlpha:function(_4af){
+var rgb=this.rgb;
+var m=MochiKit.Color;
+return m.Color.fromRGB(rgb.r,rgb.g,rgb.b,_4af);
+},colorWithHue:function(hue){
+var hsl=this.asHSL();
+hsl.h=hue;
+var m=MochiKit.Color;
+return m.Color.fromHSL(hsl);
+},colorWithSaturation:function(_4b5){
+var hsl=this.asHSL();
+hsl.s=_4b5;
+var m=MochiKit.Color;
+return m.Color.fromHSL(hsl);
+},colorWithLightness:function(_4b8){
+var hsl=this.asHSL();
+hsl.l=_4b8;
+var m=MochiKit.Color;
+return m.Color.fromHSL(hsl);
+},darkerColorWithLevel:function(_4bb){
+var hsl=this.asHSL();
+hsl.l=Math.max(hsl.l-_4bb,0);
+var m=MochiKit.Color;
+return m.Color.fromHSL(hsl);
+},lighterColorWithLevel:function(_4be){
+var hsl=this.asHSL();
+hsl.l=Math.min(hsl.l+_4be,1);
+var m=MochiKit.Color;
+return m.Color.fromHSL(hsl);
+},blendedColor:function(_4c1,_4c2){
+if(typeof (_4c2)=="undefined"||_4c2===null){
+_4c2=0.5;
+}
+var sf=1-_4c2;
+var s=this.rgb;
+var d=_4c1.rgb;
+var df=_4c2;
+return MochiKit.Color.Color.fromRGB((s.r*sf)+(d.r*df),(s.g*sf)+(d.g*df),(s.b*sf)+(d.b*df),(s.a*sf)+(d.a*df));
+},compareRGB:function(_4c7){
+var a=this.asRGB();
+var b=_4c7.asRGB();
+return MochiKit.Base.compare([a.r,a.g,a.b,a.a],[b.r,b.g,b.b,b.a]);
+},isLight:function(){
+return this.asHSL().b>0.5;
+},isDark:function(){
+return (!this.isLight());
+},toHSLString:function(){
+var c=this.asHSL();
+var ccc=MochiKit.Color.clampColorComponent;
+var rval=this._hslString;
+if(!rval){
+var mid=(ccc(c.h,360).toFixed(0)+","+ccc(c.s,100).toPrecision(4)+"%"+","+ccc(c.l,100).toPrecision(4)+"%");
+var a=c.a;
+if(a>=1){
+a=1;
+rval="hsl("+mid+")";
+}else{
+if(a<=0){
+a=0;
+}
+rval="hsla("+mid+","+a+")";
+}
+this._hslString=rval;
+}
+return rval;
+},toRGBString:function(){
+var c=this.rgb;
+var ccc=MochiKit.Color.clampColorComponent;
+var rval=this._rgbString;
+if(!rval){
+var mid=(ccc(c.r,255).toFixed(0)+","+ccc(c.g,255).toFixed(0)+","+ccc(c.b,255).toFixed(0));
+if(c.a!=1){
+rval="rgba("+mid+","+c.a+")";
+}else{
+rval="rgb("+mid+")";
+}
+this._rgbString=rval;
+}
+return rval;
+},asRGB:function(){
+return MochiKit.Base.clone(this.rgb);
+},toHexString:function(){
+var m=MochiKit.Color;
+var c=this.rgb;
+var ccc=MochiKit.Color.clampColorComponent;
+var rval=this._hexString;
+if(!rval){
+rval=("#"+m.toColorPart(ccc(c.r,255))+m.toColorPart(ccc(c.g,255))+m.toColorPart(ccc(c.b,255)));
+this._hexString=rval;
+}
+return rval;
+},asHSV:function(){
+var hsv=this.hsv;
+var c=this.rgb;
+if(typeof (hsv)=="undefined"||hsv===null){
+hsv=MochiKit.Color.rgbToHSV(this.rgb);
+this.hsv=hsv;
+}
+return MochiKit.Base.clone(hsv);
+},asHSL:function(){
+var hsl=this.hsl;
+var c=this.rgb;
+if(typeof (hsl)=="undefined"||hsl===null){
+hsl=MochiKit.Color.rgbToHSL(this.rgb);
+this.hsl=hsl;
+}
+return MochiKit.Base.clone(hsl);
+},toString:function(){
+return this.toRGBString();
+},repr:function(){
+var c=this.rgb;
+var col=[c.r,c.g,c.b,c.a];
+return this.__class__.NAME+"("+col.join(", ")+")";
+}};
+MochiKit.Base.update(MochiKit.Color.Color,{fromRGB:function(red,_4de,blue,_4e0){
+var _4e1=MochiKit.Color.Color;
+if(arguments.length==1){
+var rgb=red;
+red=rgb.r;
+_4de=rgb.g;
+blue=rgb.b;
+if(typeof (rgb.a)=="undefined"){
+_4e0=undefined;
+}else{
+_4e0=rgb.a;
+}
+}
+return new _4e1(red,_4de,blue,_4e0);
+},fromHSL:function(hue,_4e4,_4e5,_4e6){
+var m=MochiKit.Color;
+return m.Color.fromRGB(m.hslToRGB.apply(m,arguments));
+},fromHSV:function(hue,_4e9,_4ea,_4eb){
+var m=MochiKit.Color;
+return m.Color.fromRGB(m.hsvToRGB.apply(m,arguments));
+},fromName:function(name){
+var _4ee=MochiKit.Color.Color;
+if(name.charAt(0)=="\""){
+name=name.substr(1,name.length-2);
+}
+var _4ef=_4ee._namedColors[name.toLowerCase()];
+if(typeof (_4ef)=="string"){
+return _4ee.fromHexString(_4ef);
+}else{
+if(name=="transparent"){
+return _4ee.transparentColor();
+}
+}
+return null;
+},fromString:function(_4f0){
+var self=MochiKit.Color.Color;
+var _4f2=_4f0.substr(0,3);
+if(_4f2=="rgb"){
+return self.fromRGBString(_4f0);
+}else{
+if(_4f2=="hsl"){
+return self.fromHSLString(_4f0);
+}else{
+if(_4f0.charAt(0)=="#"){
+return self.fromHexString(_4f0);
+}
+}
+}
+return self.fromName(_4f0);
+},fromHexString:function(_4f3){
+if(_4f3.charAt(0)=="#"){
+_4f3=_4f3.substring(1);
+}
+var _4f4=[];
+var i,hex;
+if(_4f3.length==3){
+for(i=0;i<3;i++){
+hex=_4f3.substr(i,1);
+_4f4.push(parseInt(hex+hex,16)/255);
+}
+}else{
+for(i=0;i<6;i+=2){
+hex=_4f3.substr(i,2);
+_4f4.push(parseInt(hex,16)/255);
+}
+}
+var _4f7=MochiKit.Color.Color;
+return _4f7.fromRGB.apply(_4f7,_4f4);
+},_fromColorString:function(pre,_4f9,_4fa,_4fb){
+if(_4fb.indexOf(pre)===0){
+_4fb=_4fb.substring(_4fb.indexOf("(",3)+1,_4fb.length-1);
+}
+var _4fc=_4fb.split(/\s*,\s*/);
+var _4fd=[];
+for(var i=0;i<_4fc.length;i++){
+var c=_4fc[i];
+var val;
+var _501=c.substring(c.length-3);
+if(c.charAt(c.length-1)=="%"){
+val=0.01*parseFloat(c.substring(0,c.length-1));
+}else{
+if(_501=="deg"){
+val=parseFloat(c)/360;
+}else{
+if(_501=="rad"){
+val=parseFloat(c)/(Math.PI*2);
+}else{
+val=_4fa[i]*parseFloat(c);
+}
+}
+}
+_4fd.push(val);
+}
+return this[_4f9].apply(this,_4fd);
+},fromComputedStyle:function(elem,_503){
+var d=MochiKit.DOM;
+var cls=MochiKit.Color.Color;
+for(elem=d.getElement(elem);elem;elem=elem.parentNode){
+var _506=MochiKit.Style.getStyle.apply(d,arguments);
+if(!_506){
+continue;
+}
+var _507=cls.fromString(_506);
+if(!_507){
+break;
+}
+if(_507.asRGB().a>0){
+return _507;
+}
+}
+return null;
+},fromBackground:function(elem){
+var cls=MochiKit.Color.Color;
+return cls.fromComputedStyle(elem,"backgroundColor","background-color")||cls.whiteColor();
+},fromText:function(elem){
+var cls=MochiKit.Color.Color;
+return cls.fromComputedStyle(elem,"color","color")||cls.blackColor();
+},namedColors:function(){
+return MochiKit.Base.clone(MochiKit.Color.Color._namedColors);
+}});
+MochiKit.Base.update(MochiKit.Color,{clampColorComponent:function(v,_50d){
+v*=_50d;
+if(v<0){
+return 0;
+}else{
+if(v>_50d){
+return _50d;
+}else{
+return v;
+}
+}
+},_hslValue:function(n1,n2,hue){
+if(hue>6){
+hue-=6;
+}else{
+if(hue<0){
+hue+=6;
+}
+}
+var val;
+if(hue<1){
+val=n1+(n2-n1)*hue;
+}else{
+if(hue<3){
+val=n2;
+}else{
+if(hue<4){
+val=n1+(n2-n1)*(4-hue);
+}else{
+val=n1;
+}
+}
+}
+return val;
+},hsvToRGB:function(hue,_513,_514,_515){
+if(arguments.length==1){
+var hsv=hue;
+hue=hsv.h;
+_513=hsv.s;
+_514=hsv.v;
+_515=hsv.a;
+}
+var red;
+var _518;
+var blue;
+if(_513===0){
+red=_514;
+_518=_514;
+blue=_514;
+}else{
+var i=Math.floor(hue*6);
+var f=(hue*6)-i;
+var p=_514*(1-_513);
+var q=_514*(1-(_513*f));
+var t=_514*(1-(_513*(1-f)));
+switch(i){
+case 1:
+red=q;
+_518=_514;
+blue=p;
+break;
+case 2:
+red=p;
+_518=_514;
+blue=t;
+break;
+case 3:
+red=p;
+_518=q;
+blue=_514;
+break;
+case 4:
+red=t;
+_518=p;
+blue=_514;
+break;
+case 5:
+red=_514;
+_518=p;
+blue=q;
+break;
+case 6:
+case 0:
+red=_514;
+_518=t;
+blue=p;
+break;
+}
+}
+return {r:red,g:_518,b:blue,a:_515};
+},hslToRGB:function(hue,_520,_521,_522){
+if(arguments.length==1){
+var hsl=hue;
+hue=hsl.h;
+_520=hsl.s;
+_521=hsl.l;
+_522=hsl.a;
+}
+var red;
+var _525;
+var blue;
+if(_520===0){
+red=_521;
+_525=_521;
+blue=_521;
+}else{
+var m2;
+if(_521<=0.5){
+m2=_521*(1+_520);
+}else{
+m2=_521+_520-(_521*_520);
+}
+var m1=(2*_521)-m2;
+var f=MochiKit.Color._hslValue;
+var h6=hue*6;
+red=f(m1,m2,h6+2);
+_525=f(m1,m2,h6);
+blue=f(m1,m2,h6-2);
+}
+return {r:red,g:_525,b:blue,a:_522};
+},rgbToHSV:function(red,_52c,blue,_52e){
+if(arguments.length==1){
+var rgb=red;
+red=rgb.r;
+_52c=rgb.g;
+blue=rgb.b;
+_52e=rgb.a;
+}
+var max=Math.max(Math.max(red,_52c),blue);
+var min=Math.min(Math.min(red,_52c),blue);
+var hue;
+var _533;
+var _534=max;
+if(min==max){
+hue=0;
+_533=0;
+}else{
+var _535=(max-min);
+_533=_535/max;
+if(red==max){
+hue=(_52c-blue)/_535;
+}else{
+if(_52c==max){
+hue=2+((blue-red)/_535);
+}else{
+hue=4+((red-_52c)/_535);
+}
+}
+hue/=6;
+if(hue<0){
+hue+=1;
+}
+if(hue>1){
+hue-=1;
+}
+}
+return {h:hue,s:_533,v:_534,a:_52e};
+},rgbToHSL:function(red,_537,blue,_539){
+if(arguments.length==1){
+var rgb=red;
+red=rgb.r;
+_537=rgb.g;
+blue=rgb.b;
+_539=rgb.a;
+}
+var max=Math.max(red,Math.max(_537,blue));
+var min=Math.min(red,Math.min(_537,blue));
+var hue;
+var _53e;
+var _53f=(max+min)/2;
+var _540=max-min;
+if(_540===0){
+hue=0;
+_53e=0;
+}else{
+if(_53f<=0.5){
+_53e=_540/(max+min);
+}else{
+_53e=_540/(2-max-min);
+}
+if(red==max){
+hue=(_537-blue)/_540;
+}else{
+if(_537==max){
+hue=2+((blue-red)/_540);
+}else{
+hue=4+((red-_537)/_540);
+}
+}
+hue/=6;
+if(hue<0){
+hue+=1;
+}
+if(hue>1){
+hue-=1;
+}
+}
+return {h:hue,s:_53e,l:_53f,a:_539};
+},toColorPart:function(num){
+num=Math.round(num);
+var _542=num.toString(16);
+if(num<16){
+return "0"+_542;
+}
+return _542;
+},__new__:function(){
+var m=MochiKit.Base;
+this.Color.fromRGBString=m.bind(this.Color._fromColorString,this.Color,"rgb","fromRGB",[1/255,1/255,1/255,1]);
+this.Color.fromHSLString=m.bind(this.Color._fromColorString,this.Color,"hsl","fromHSL",[1/360,0.01,0.01,1]);
+var _544=1/3;
+var _545={black:[0,0,0],blue:[0,0,1],brown:[0.6,0.4,0.2],cyan:[0,1,1],darkGray:[_544,_544,_544],gray:[0.5,0.5,0.5],green:[0,1,0],lightGray:[2*_544,2*_544,2*_544],magenta:[1,0,1],orange:[1,0.5,0],purple:[0.5,0,0.5],red:[1,0,0],transparent:[0,0,0,0],white:[1,1,1],yellow:[1,1,0]};
+var _546=function(name,r,g,b,a){
+var rval=this.fromRGB(r,g,b,a);
+this[name]=function(){
+return rval;
+};
+return rval;
+};
+for(var k in _545){
+var name=k+"Color";
+var _54f=m.concat([_546,this.Color,name],_545[k]);
+this.Color[name]=m.bind.apply(null,_54f);
+}
+var _550=function(){
+for(var i=0;i<arguments.length;i++){
+if(!(arguments[i] instanceof MochiKit.Color.Color)){
+return false;
+}
+}
+return true;
+};
+var _552=function(a,b){
+return a.compareRGB(b);
+};
+m.nameFunctions(this);
+m.registerComparator(this.Color.NAME,_550,_552);
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+}});
+MochiKit.Color.EXPORT=["Color"];
+MochiKit.Color.EXPORT_OK=["clampColorComponent","rgbToHSL","hslToRGB","rgbToHSV","hsvToRGB","toColorPart"];
+MochiKit.Color.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.Color);
+MochiKit.Color.Color._namedColors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};
+MochiKit.Base._deps("Signal",["Base","DOM","Style"]);
+MochiKit.Signal.NAME="MochiKit.Signal";
+MochiKit.Signal.VERSION="1.4.2";
+MochiKit.Signal._observers=[];
+MochiKit.Signal.Event=function(src,e){
+this._event=e||window.event;
+this._src=src;
+};
+MochiKit.Base.update(MochiKit.Signal.Event.prototype,{__repr__:function(){
+var repr=MochiKit.Base.repr;
+var str="{event(): "+repr(this.event())+", src(): "+repr(this.src())+", type(): "+repr(this.type())+", target(): "+repr(this.target());
+if(this.type()&&this.type().indexOf("key")===0||this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu"){
+str+=", modifier(): "+"{alt: "+repr(this.modifier().alt)+", ctrl: "+repr(this.modifier().ctrl)+", meta: "+repr(this.modifier().meta)+", shift: "+repr(this.modifier().shift)+", any: "+repr(this.modifier().any)+"}";
+}
+if(this.type()&&this.type().indexOf("key")===0){
+str+=", key(): {code: "+repr(this.key().code)+", string: "+repr(this.key().string)+"}";
+}
+if(this.type()&&(this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu")){
+str+=", mouse(): {page: "+repr(this.mouse().page)+", client: "+repr(this.mouse().client);
+if(this.type()!="mousemove"&&this.type()!="mousewheel"){
+str+=", button: {left: "+repr(this.mouse().button.left)+", middle: "+repr(this.mouse().button.middle)+", right: "+repr(this.mouse().button.right)+"}";
+}
+if(this.type()=="mousewheel"){
+str+=", wheel: "+repr(this.mouse().wheel);
+}
+str+="}";
+}
+if(this.type()=="mouseover"||this.type()=="mouseout"||this.type()=="mouseenter"||this.type()=="mouseleave"){
+str+=", relatedTarget(): "+repr(this.relatedTarget());
+}
+str+="}";
+return str;
+},toString:function(){
+return this.__repr__();
+},src:function(){
+return this._src;
+},event:function(){
+return this._event;
+},type:function(){
+if(this._event.type==="DOMMouseScroll"){
+return "mousewheel";
+}else{
+return this._event.type||undefined;
+}
+},target:function(){
+return this._event.target||this._event.srcElement;
+},_relatedTarget:null,relatedTarget:function(){
+if(this._relatedTarget!==null){
+return this._relatedTarget;
+}
+var elem=null;
+if(this.type()=="mouseover"||this.type()=="mouseenter"){
+elem=(this._event.relatedTarget||this._event.fromElement);
+}else{
+if(this.type()=="mouseout"||this.type()=="mouseleave"){
+elem=(this._event.relatedTarget||this._event.toElement);
+}
+}
+try{
+if(elem!==null&&elem.nodeType!==null){
+this._relatedTarget=elem;
+return elem;
+}
+}
+catch(ignore){
+}
+return undefined;
+},_modifier:null,modifier:function(){
+if(this._modifier!==null){
+return this._modifier;
+}
+var m={};
+m.alt=this._event.altKey;
+m.ctrl=this._event.ctrlKey;
+m.meta=this._event.metaKey||false;
+m.shift=this._event.shiftKey;
+m.any=m.alt||m.ctrl||m.shift||m.meta;
+this._modifier=m;
+return m;
+},_key:null,key:function(){
+if(this._key!==null){
+return this._key;
+}
+var k={};
+if(this.type()&&this.type().indexOf("key")===0){
+if(this.type()=="keydown"||this.type()=="keyup"){
+k.code=this._event.keyCode;
+k.string=(MochiKit.Signal._specialKeys[k.code]||"KEY_UNKNOWN");
+this._key=k;
+return k;
+}else{
+if(this.type()=="keypress"){
+k.code=0;
+k.string="";
+if(typeof (this._event.charCode)!="undefined"&&this._event.charCode!==0&&!MochiKit.Signal._specialMacKeys[this._event.charCode]){
+k.code=this._event.charCode;
+k.string=String.fromCharCode(k.code);
+}else{
+if(this._event.keyCode&&typeof (this._event.charCode)=="undefined"){
+k.code=this._event.keyCode;
+k.string=String.fromCharCode(k.code);
+}
+}
+this._key=k;
+return k;
+}
+}
+}
+return undefined;
+},_mouse:null,mouse:function(){
+if(this._mouse!==null){
+return this._mouse;
+}
+var m={};
+var e=this._event;
+if(this.type()&&(this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu")){
+m.client=new MochiKit.Style.Coordinates(0,0);
+if(e.clientX||e.clientY){
+m.client.x=(!e.clientX||e.clientX<0)?0:e.clientX;
+m.client.y=(!e.clientY||e.clientY<0)?0:e.clientY;
+}
+m.page=new MochiKit.Style.Coordinates(0,0);
+if(e.pageX||e.pageY){
+m.page.x=(!e.pageX||e.pageX<0)?0:e.pageX;
+m.page.y=(!e.pageY||e.pageY<0)?0:e.pageY;
+}else{
+var de=MochiKit.DOM._document.documentElement;
+var b=MochiKit.DOM._document.body;
+m.page.x=e.clientX+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0);
+m.page.y=e.clientY+(de.scrollTop||b.scrollTop)-(de.clientTop||0);
+}
+if(this.type()!="mousemove"&&this.type()!="mousewheel"){
+m.button={};
+m.button.left=false;
+m.button.right=false;
+m.button.middle=false;
+if(e.which){
+m.button.left=(e.which==1);
+m.button.middle=(e.which==2);
+m.button.right=(e.which==3);
+}else{
+m.button.left=!!(e.button&1);
+m.button.right=!!(e.button&2);
+m.button.middle=!!(e.button&4);
+}
+}
+if(this.type()=="mousewheel"){
+m.wheel=new MochiKit.Style.Coordinates(0,0);
+if(e.wheelDeltaX||e.wheelDeltaY){
+m.wheel.x=e.wheelDeltaX/-40||0;
+m.wheel.y=e.wheelDeltaY/-40||0;
+}else{
+if(e.wheelDelta){
+m.wheel.y=e.wheelDelta/-40;
+}else{
+m.wheel.y=e.detail||0;
+}
+}
+}
+this._mouse=m;
+return m;
+}
+return undefined;
+},stop:function(){
+this.stopPropagation();
+this.preventDefault();
+},stopPropagation:function(){
+if(this._event.stopPropagation){
+this._event.stopPropagation();
+}else{
+this._event.cancelBubble=true;
+}
+},preventDefault:function(){
+if(this._event.preventDefault){
+this._event.preventDefault();
+}else{
+if(this._confirmUnload===null){
+this._event.returnValue=false;
+}
+}
+},_confirmUnload:null,confirmUnload:function(msg){
+if(this.type()=="beforeunload"){
+this._confirmUnload=msg;
+this._event.returnValue=msg;
+}
+}});
+MochiKit.Signal._specialMacKeys={3:"KEY_ENTER",63289:"KEY_NUM_PAD_CLEAR",63276:"KEY_PAGE_UP",63277:"KEY_PAGE_DOWN",63275:"KEY_END",63273:"KEY_HOME",63234:"KEY_ARROW_LEFT",63232:"KEY_ARROW_UP",63235:"KEY_ARROW_RIGHT",63233:"KEY_ARROW_DOWN",63302:"KEY_INSERT",63272:"KEY_DELETE"};
+(function(){
+var _561=MochiKit.Signal._specialMacKeys;
+for(i=63236;i<=63242;i++){
+_561[i]="KEY_F"+(i-63236+1);
+}
+})();
+MochiKit.Signal._specialKeys={8:"KEY_BACKSPACE",9:"KEY_TAB",12:"KEY_NUM_PAD_CLEAR",13:"KEY_ENTER",16:"KEY_SHIFT",17:"KEY_CTRL",18:"KEY_ALT",19:"KEY_PAUSE",20:"KEY_CAPS_LOCK",27:"KEY_ESCAPE",32:"KEY_SPACEBAR",33:"KEY_PAGE_UP",34:"KEY_PAGE_DOWN",35:"KEY_END",36:"KEY_HOME",37:"KEY_ARROW_LEFT",38:"KEY_ARROW_UP",39:"KEY_ARROW_RIGHT",40:"KEY_ARROW_DOWN",44:"KEY_PRINT_SCREEN",45:"KEY_INSERT",46:"KEY_DELETE",59:"KEY_SEMICOLON",91:"KEY_WINDOWS_LEFT",92:"KEY_WINDOWS_RIGHT",93:"KEY_SELECT",106:"KEY_NUM_PAD_ASTERISK",107:"KEY_NUM_PAD_PLUS_SIGN",109:"KEY_NUM_PAD_HYPHEN-MINUS",110:"KEY_NUM_PAD_FULL_STOP",111:"KEY_NUM_PAD_SOLIDUS",144:"KEY_NUM_LOCK",145:"KEY_SCROLL_LOCK",186:"KEY_SEMICOLON",187:"KEY_EQUALS_SIGN",188:"KEY_COMMA",189:"KEY_HYPHEN-MINUS",190:"KEY_FULL_STOP",191:"KEY_SOLIDUS",192:"KEY_GRAVE_ACCENT",219:"KEY_LEFT_SQUARE_BRACKET",220:"KEY_REVERSE_SOLIDUS",221:"KEY_RIGHT_SQUARE_BRACKET",222:"KEY_APOSTROPHE"};
+(function(){
+var _562=MochiKit.Signal._specialKeys;
+for(var i=48;i<=57;i++){
+_562[i]="KEY_"+(i-48);
+}
+for(i=65;i<=90;i++){
+_562[i]="KEY_"+String.fromCharCode(i);
+}
+for(i=96;i<=105;i++){
+_562[i]="KEY_NUM_PAD_"+(i-96);
+}
+for(i=112;i<=123;i++){
+_562[i]="KEY_F"+(i-112+1);
+}
+})();
+MochiKit.Signal.Ident=function(_564){
+this.source=_564.source;
+this.signal=_564.signal;
+this.listener=_564.listener;
+this.isDOM=_564.isDOM;
+this.objOrFunc=_564.objOrFunc;
+this.funcOrStr=_564.funcOrStr;
+this.connected=_564.connected;
+};
+MochiKit.Signal.Ident.prototype={};
+MochiKit.Base.update(MochiKit.Signal,{__repr__:function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+},toString:function(){
+return this.__repr__();
+},_unloadCache:function(){
+var self=MochiKit.Signal;
+var _566=self._observers;
+for(var i=0;i<_566.length;i++){
+if(_566[i].signal!=="onload"&&_566[i].signal!=="onunload"){
+self._disconnect(_566[i]);
+}
+}
+},_listener:function(src,sig,func,obj,_56c){
+var self=MochiKit.Signal;
+var E=self.Event;
+if(!_56c){
+if(typeof (func.im_self)=="undefined"){
+return MochiKit.Base.bindLate(func,obj);
+}else{
+return func;
+}
+}
+obj=obj||src;
+if(typeof (func)=="string"){
+if(sig==="onload"||sig==="onunload"){
+return function(_56f){
+obj[func].apply(obj,[new E(src,_56f)]);
+var _570=new MochiKit.Signal.Ident({source:src,signal:sig,objOrFunc:obj,funcOrStr:func});
+MochiKit.Signal._disconnect(_570);
+};
+}else{
+return function(_571){
+obj[func].apply(obj,[new E(src,_571)]);
+};
+}
+}else{
+if(sig==="onload"||sig==="onunload"){
+return function(_572){
+func.apply(obj,[new E(src,_572)]);
+var _573=new MochiKit.Signal.Ident({source:src,signal:sig,objOrFunc:func});
+MochiKit.Signal._disconnect(_573);
+};
+}else{
+return function(_574){
+func.apply(obj,[new E(src,_574)]);
+};
+}
+}
+},_browserAlreadyHasMouseEnterAndLeave:function(){
+return /MSIE/.test(navigator.userAgent);
+},_browserLacksMouseWheelEvent:function(){
+return /Gecko\//.test(navigator.userAgent);
+},_mouseEnterListener:function(src,sig,func,obj){
+var E=MochiKit.Signal.Event;
+return function(_57a){
+var e=new E(src,_57a);
+try{
+e.relatedTarget().nodeName;
+}
+catch(err){
+return;
+}
+e.stop();
+if(MochiKit.DOM.isChildNode(e.relatedTarget(),src)){
+return;
+}
+e.type=function(){
+return sig;
+};
+if(typeof (func)=="string"){
+return obj[func].apply(obj,[e]);
+}else{
+return func.apply(obj,[e]);
+}
+};
+},_getDestPair:function(_57c,_57d){
+var obj=null;
+var func=null;
+if(typeof (_57d)!="undefined"){
+obj=_57c;
+func=_57d;
+if(typeof (_57d)=="string"){
+if(typeof (_57c[_57d])!="function"){
+throw new Error("'funcOrStr' must be a function on 'objOrFunc'");
+}
+}else{
+if(typeof (_57d)!="function"){
+throw new Error("'funcOrStr' must be a function or string");
+}
+}
+}else{
+if(typeof (_57c)!="function"){
+throw new Error("'objOrFunc' must be a function if 'funcOrStr' is not given");
+}else{
+func=_57c;
+}
+}
+return [obj,func];
+},connect:function(src,sig,_582,_583){
+src=MochiKit.DOM.getElement(src);
+var self=MochiKit.Signal;
+if(typeof (sig)!="string"){
+throw new Error("'sig' must be a string");
+}
+var _585=self._getDestPair(_582,_583);
+var obj=_585[0];
+var func=_585[1];
+if(typeof (obj)=="undefined"||obj===null){
+obj=src;
+}
+var _588=!!(src.addEventListener||src.attachEvent);
+if(_588&&(sig==="onmouseenter"||sig==="onmouseleave")&&!self._browserAlreadyHasMouseEnterAndLeave()){
+var _589=self._mouseEnterListener(src,sig.substr(2),func,obj);
+if(sig==="onmouseenter"){
+sig="onmouseover";
+}else{
+sig="onmouseout";
+}
+}else{
+if(_588&&sig=="onmousewheel"&&self._browserLacksMouseWheelEvent()){
+var _589=self._listener(src,sig,func,obj,_588);
+sig="onDOMMouseScroll";
+}else{
+var _589=self._listener(src,sig,func,obj,_588);
+}
+}
+if(src.addEventListener){
+src.addEventListener(sig.substr(2),_589,false);
+}else{
+if(src.attachEvent){
+src.attachEvent(sig,_589);
+}
+}
+var _58a=new MochiKit.Signal.Ident({source:src,signal:sig,listener:_589,isDOM:_588,objOrFunc:_582,funcOrStr:_583,connected:true});
+self._observers.push(_58a);
+if(!_588&&typeof (src.__connect__)=="function"){
+var args=MochiKit.Base.extend([_58a],arguments,1);
+src.__connect__.apply(src,args);
+}
+return _58a;
+},_disconnect:function(_58c){
+if(!_58c.connected){
+return;
+}
+_58c.connected=false;
+var src=_58c.source;
+var sig=_58c.signal;
+var _58f=_58c.listener;
+if(!_58c.isDOM){
+if(typeof (src.__disconnect__)=="function"){
+src.__disconnect__(_58c,sig,_58c.objOrFunc,_58c.funcOrStr);
+}
+return;
+}
+if(src.removeEventListener){
+src.removeEventListener(sig.substr(2),_58f,false);
+}else{
+if(src.detachEvent){
+src.detachEvent(sig,_58f);
+}else{
+throw new Error("'src' must be a DOM element");
+}
+}
+},disconnect:function(_590){
+var self=MochiKit.Signal;
+var _592=self._observers;
+var m=MochiKit.Base;
+if(arguments.length>1){
+var src=MochiKit.DOM.getElement(arguments[0]);
+var sig=arguments[1];
+var obj=arguments[2];
+var func=arguments[3];
+for(var i=_592.length-1;i>=0;i--){
+var o=_592[i];
+if(o.source===src&&o.signal===sig&&o.objOrFunc===obj&&o.funcOrStr===func){
+self._disconnect(o);
+if(!self._lock){
+_592.splice(i,1);
+}else{
+self._dirty=true;
+}
+return true;
+}
+}
+}else{
+var idx=m.findIdentical(_592,_590);
+if(idx>=0){
+self._disconnect(_590);
+if(!self._lock){
+_592.splice(idx,1);
+}else{
+self._dirty=true;
+}
+return true;
+}
+}
+return false;
+},disconnectAllTo:function(_59b,_59c){
+var self=MochiKit.Signal;
+var _59e=self._observers;
+var _59f=self._disconnect;
+var _5a0=self._lock;
+var _5a1=self._dirty;
+if(typeof (_59c)==="undefined"){
+_59c=null;
+}
+for(var i=_59e.length-1;i>=0;i--){
+var _5a3=_59e[i];
+if(_5a3.objOrFunc===_59b&&(_59c===null||_5a3.funcOrStr===_59c)){
+_59f(_5a3);
+if(_5a0){
+_5a1=true;
+}else{
+_59e.splice(i,1);
+}
+}
+}
+self._dirty=_5a1;
+},disconnectAll:function(src,sig){
+src=MochiKit.DOM.getElement(src);
+var m=MochiKit.Base;
+var _5a7=m.flattenArguments(m.extend(null,arguments,1));
+var self=MochiKit.Signal;
+var _5a9=self._disconnect;
+var _5aa=self._observers;
+var i,_5ac;
+var _5ad=self._lock;
+var _5ae=self._dirty;
+if(_5a7.length===0){
+for(i=_5aa.length-1;i>=0;i--){
+_5ac=_5aa[i];
+if(_5ac.source===src){
+_5a9(_5ac);
+if(!_5ad){
+_5aa.splice(i,1);
+}else{
+_5ae=true;
+}
+}
+}
+}else{
+var sigs={};
+for(i=0;i<_5a7.length;i++){
+sigs[_5a7[i]]=true;
+}
+for(i=_5aa.length-1;i>=0;i--){
+_5ac=_5aa[i];
+if(_5ac.source===src&&_5ac.signal in sigs){
+_5a9(_5ac);
+if(!_5ad){
+_5aa.splice(i,1);
+}else{
+_5ae=true;
+}
+}
+}
+}
+self._dirty=_5ae;
+},signal:function(src,sig){
+var self=MochiKit.Signal;
+var _5b3=self._observers;
+src=MochiKit.DOM.getElement(src);
+var args=MochiKit.Base.extend(null,arguments,2);
+var _5b5=[];
+self._lock=true;
+for(var i=0;i<_5b3.length;i++){
+var _5b7=_5b3[i];
+if(_5b7.source===src&&_5b7.signal===sig&&_5b7.connected){
+try{
+_5b7.listener.apply(src,args);
+}
+catch(e){
+_5b5.push(e);
+}
+}
+}
+self._lock=false;
+if(self._dirty){
+self._dirty=false;
+for(var i=_5b3.length-1;i>=0;i--){
+if(!_5b3[i].connected){
+_5b3.splice(i,1);
+}
+}
+}
+if(_5b5.length==1){
+throw _5b5[0];
+}else{
+if(_5b5.length>1){
+var e=new Error("Multiple errors thrown in handling 'sig', see errors property");
+e.errors=_5b5;
+throw e;
+}
+}
+}});
+MochiKit.Signal.EXPORT_OK=[];
+MochiKit.Signal.EXPORT=["connect","disconnect","signal","disconnectAll","disconnectAllTo"];
+MochiKit.Signal.__new__=function(win){
+var m=MochiKit.Base;
+this._document=document;
+this._window=win;
+this._lock=false;
+this._dirty=false;
+try{
+this.connect(window,"onunload",this._unloadCache);
+}
+catch(e){
+}
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+m.nameFunctions(this);
+};
+MochiKit.Signal.__new__(this);
+if(MochiKit.__export__){
+connect=MochiKit.Signal.connect;
+disconnect=MochiKit.Signal.disconnect;
+disconnectAll=MochiKit.Signal.disconnectAll;
+signal=MochiKit.Signal.signal;
+}
+MochiKit.Base._exportSymbols(this,MochiKit.Signal);
+MochiKit.Base._deps("Position",["Base","DOM","Style"]);
+MochiKit.Position.NAME="MochiKit.Position";
+MochiKit.Position.VERSION="1.4.2";
+MochiKit.Position.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.Position.toString=function(){
+return this.__repr__();
+};
+MochiKit.Position.EXPORT_OK=[];
+MochiKit.Position.EXPORT=[];
+MochiKit.Base.update(MochiKit.Position,{includeScrollOffsets:false,prepare:function(){
+var _5bb=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
+var _5bc=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;
+this.windowOffset=new MochiKit.Style.Coordinates(_5bb,_5bc);
+},cumulativeOffset:function(_5bd){
+var _5be=0;
+var _5bf=0;
+do{
+_5be+=_5bd.offsetTop||0;
+_5bf+=_5bd.offsetLeft||0;
+_5bd=_5bd.offsetParent;
+}while(_5bd);
+return new MochiKit.Style.Coordinates(_5bf,_5be);
+},realOffset:function(_5c0){
+var _5c1=0;
+var _5c2=0;
+do{
+_5c1+=_5c0.scrollTop||0;
+_5c2+=_5c0.scrollLeft||0;
+_5c0=_5c0.parentNode;
+}while(_5c0);
+return new MochiKit.Style.Coordinates(_5c2,_5c1);
+},within:function(_5c3,x,y){
+if(this.includeScrollOffsets){
+return this.withinIncludingScrolloffsets(_5c3,x,y);
+}
+this.xcomp=x;
+this.ycomp=y;
+this.offset=this.cumulativeOffset(_5c3);
+if(_5c3.style.position=="fixed"){
+this.offset.x+=this.windowOffset.x;
+this.offset.y+=this.windowOffset.y;
+}
+return (y>=this.offset.y&&y<this.offset.y+_5c3.offsetHeight&&x>=this.offset.x&&x<this.offset.x+_5c3.offsetWidth);
+},withinIncludingScrolloffsets:function(_5c6,x,y){
+var _5c9=this.realOffset(_5c6);
+this.xcomp=x+_5c9.x-this.windowOffset.x;
+this.ycomp=y+_5c9.y-this.windowOffset.y;
+this.offset=this.cumulativeOffset(_5c6);
+return (this.ycomp>=this.offset.y&&this.ycomp<this.offset.y+_5c6.offsetHeight&&this.xcomp>=this.offset.x&&this.xcomp<this.offset.x+_5c6.offsetWidth);
+},overlap:function(mode,_5cb){
+if(!mode){
+return 0;
+}
+if(mode=="vertical"){
+return ((this.offset.y+_5cb.offsetHeight)-this.ycomp)/_5cb.offsetHeight;
+}
+if(mode=="horizontal"){
+return ((this.offset.x+_5cb.offsetWidth)-this.xcomp)/_5cb.offsetWidth;
+}
+},absolutize:function(_5cc){
+_5cc=MochiKit.DOM.getElement(_5cc);
+if(_5cc.style.position=="absolute"){
+return;
+}
+MochiKit.Position.prepare();
+var _5cd=MochiKit.Position.positionedOffset(_5cc);
+var _5ce=_5cc.clientWidth;
+var _5cf=_5cc.clientHeight;
+var _5d0={"position":_5cc.style.position,"left":_5cd.x-parseFloat(_5cc.style.left||0),"top":_5cd.y-parseFloat(_5cc.style.top||0),"width":_5cc.style.width,"height":_5cc.style.height};
+_5cc.style.position="absolute";
+_5cc.style.top=_5cd.y+"px";
+_5cc.style.left=_5cd.x+"px";
+_5cc.style.width=_5ce+"px";
+_5cc.style.height=_5cf+"px";
+return _5d0;
+},positionedOffset:function(_5d1){
+var _5d2=0,_5d3=0;
+do{
+_5d2+=_5d1.offsetTop||0;
+_5d3+=_5d1.offsetLeft||0;
+_5d1=_5d1.offsetParent;
+if(_5d1){
+p=MochiKit.Style.getStyle(_5d1,"position");
+if(p=="relative"||p=="absolute"){
+break;
+}
+}
+}while(_5d1);
+return new MochiKit.Style.Coordinates(_5d3,_5d2);
+},relativize:function(_5d4,_5d5){
+_5d4=MochiKit.DOM.getElement(_5d4);
+if(_5d4.style.position=="relative"){
+return;
+}
+MochiKit.Position.prepare();
+var top=parseFloat(_5d4.style.top||0)-(_5d5["top"]||0);
+var left=parseFloat(_5d4.style.left||0)-(_5d5["left"]||0);
+_5d4.style.position=_5d5["position"];
+_5d4.style.top=top+"px";
+_5d4.style.left=left+"px";
+_5d4.style.width=_5d5["width"];
+_5d4.style.height=_5d5["height"];
+},clone:function(_5d8,_5d9){
+_5d8=MochiKit.DOM.getElement(_5d8);
+_5d9=MochiKit.DOM.getElement(_5d9);
+_5d9.style.position="absolute";
+var _5da=this.cumulativeOffset(_5d8);
+_5d9.style.top=_5da.y+"px";
+_5d9.style.left=_5da.x+"px";
+_5d9.style.width=_5d8.offsetWidth+"px";
+_5d9.style.height=_5d8.offsetHeight+"px";
+},page:function(_5db){
+var _5dc=0;
+var _5dd=0;
+var _5de=_5db;
+do{
+_5dc+=_5de.offsetTop||0;
+_5dd+=_5de.offsetLeft||0;
+if(_5de.offsetParent==document.body&&MochiKit.Style.getStyle(_5de,"position")=="absolute"){
+break;
+}
+}while(_5de=_5de.offsetParent);
+_5de=_5db;
+do{
+_5dc-=_5de.scrollTop||0;
+_5dd-=_5de.scrollLeft||0;
+}while(_5de=_5de.parentNode);
+return new MochiKit.Style.Coordinates(_5dd,_5dc);
+}});
+MochiKit.Position.__new__=function(win){
+var m=MochiKit.Base;
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+m.nameFunctions(this);
+};
+MochiKit.Position.__new__(this);
+MochiKit.Base._exportSymbols(this,MochiKit.Position);
+MochiKit.Base._deps("Visual",["Base","DOM","Style","Color","Position"]);
+MochiKit.Visual.NAME="MochiKit.Visual";
+MochiKit.Visual.VERSION="1.4.2";
+MochiKit.Visual.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.Visual.toString=function(){
+return this.__repr__();
+};
+MochiKit.Visual._RoundCorners=function(e,_5e2){
+e=MochiKit.DOM.getElement(e);
+this._setOptions(_5e2);
+if(this.options.__unstable__wrapElement){
+e=this._doWrap(e);
+}
+var _5e3=this.options.color;
+var C=MochiKit.Color.Color;
+if(this.options.color==="fromElement"){
+_5e3=C.fromBackground(e);
+}else{
+if(!(_5e3 instanceof C)){
+_5e3=C.fromString(_5e3);
+}
+}
+this.isTransparent=(_5e3.asRGB().a<=0);
+var _5e5=this.options.bgColor;
+if(this.options.bgColor==="fromParent"){
+_5e5=C.fromBackground(e.offsetParent);
+}else{
+if(!(_5e5 instanceof C)){
+_5e5=C.fromString(_5e5);
+}
+}
+this._roundCornersImpl(e,_5e3,_5e5);
+};
+MochiKit.Visual._RoundCorners.prototype={_doWrap:function(e){
+var _5e7=e.parentNode;
+var doc=MochiKit.DOM.currentDocument();
+if(typeof (doc.defaultView)==="undefined"||doc.defaultView===null){
+return e;
+}
+var _5e9=doc.defaultView.getComputedStyle(e,null);
+if(typeof (_5e9)==="undefined"||_5e9===null){
+return e;
+}
+var _5ea=MochiKit.DOM.DIV({"style":{display:"block",marginTop:_5e9.getPropertyValue("padding-top"),marginRight:_5e9.getPropertyValue("padding-right"),marginBottom:_5e9.getPropertyValue("padding-bottom"),marginLeft:_5e9.getPropertyValue("padding-left"),padding:"0px"}});
+_5ea.innerHTML=e.innerHTML;
+e.innerHTML="";
+e.appendChild(_5ea);
+return e;
+},_roundCornersImpl:function(e,_5ec,_5ed){
+
+if(this.options.border){
+this._renderBorder(e,_5ed);
+}
+if(this._isTopRounded()){
+this._roundTopCorners(e,_5ec,_5ed);
+}
+if(this._isBottomRounded()){
+this._roundBottomCorners(e,_5ec,_5ed);
+}
+},_renderBorder:function(el,_5ef){
+var _5f0="1px solid "+this._borderColor(_5ef);
+var _5f1="border-left: "+_5f0;
+var _5f2="border-right: "+_5f0;
+var _5f3="style='"+_5f1+";"+_5f2+"'";
+el.innerHTML="<div "+_5f3+">"+el.innerHTML+"</div>";
+},_roundTopCorners:function(el,_5f5,_5f6){
+var _5f7=this._createCorner(_5f6);
+for(var i=0;i<this.options.numSlices;i++){
+_5f7.appendChild(this._createCornerSlice(_5f5,_5f6,i,"top"));
+}
+el.style.paddingTop=0;
+el.insertBefore(_5f7,el.firstChild);
+},_roundBottomCorners:function(el,_5fa,_5fb){
+var _5fc=this._createCorner(_5fb);
+for(var i=(this.options.numSlices-1);i>=0;i--){
+_5fc.appendChild(this._createCornerSlice(_5fa,_5fb,i,"bottom"));
+}
+el.style.paddingBottom=0;
+el.appendChild(_5fc);
+},_createCorner:function(_5fe){
+var dom=MochiKit.DOM;
+return dom.DIV({style:{backgroundColor:_5fe.toString()}});
+},_createCornerSlice:function(_600,_601,n,_603){
+var _604=MochiKit.DOM.SPAN();
+var _605=_604.style;
+_605.backgroundColor=_600.toString();
+_605.display="block";
+_605.height="1px";
+_605.overflow="hidden";
+_605.fontSize="1px";
+var _606=this._borderColor(_600,_601);
+if(this.options.border&&n===0){
+_605.borderTopStyle="solid";
+_605.borderTopWidth="1px";
+_605.borderLeftWidth="0px";
+_605.borderRightWidth="0px";
+_605.borderBottomWidth="0px";
+_605.height="0px";
+_605.borderColor=_606.toString();
+}else{
+if(_606){
+_605.borderColor=_606.toString();
+_605.borderStyle="solid";
+_605.borderWidth="0px 1px";
+}
+}
+if(!this.options.compact&&(n==(this.options.numSlices-1))){
+_605.height="2px";
+}
+this._setMargin(_604,n,_603);
+this._setBorder(_604,n,_603);
+return _604;
+},_setOptions:function(_607){
+this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false,__unstable__wrapElement:false};
+MochiKit.Base.update(this.options,_607);
+this.options.numSlices=(this.options.compact?2:4);
+},_whichSideTop:function(){
+var _608=this.options.corners;
+if(this._hasString(_608,"all","top")){
+return "";
+}
+var _609=(_608.indexOf("tl")!=-1);
+var _60a=(_608.indexOf("tr")!=-1);
+if(_609&&_60a){
+return "";
+}
+if(_609){
+return "left";
+}
+if(_60a){
+return "right";
+}
+return "";
+},_whichSideBottom:function(){
+var _60b=this.options.corners;
+if(this._hasString(_60b,"all","bottom")){
+return "";
+}
+var _60c=(_60b.indexOf("bl")!=-1);
+var _60d=(_60b.indexOf("br")!=-1);
+if(_60c&&_60d){
+return "";
+}
+if(_60c){
+return "left";
+}
+if(_60d){
+return "right";
+}
+return "";
+},_borderColor:function(_60e,_60f){
+if(_60e=="transparent"){
+return _60f;
+}else{
+if(this.options.border){
+return this.options.border;
+}else{
+if(this.options.blend){
+return _60f.blendedColor(_60e);
+}
+}
+}
+return "";
+},_setMargin:function(el,n,_612){
+var _613=this._marginSize(n)+"px";
+var _614=(_612=="top"?this._whichSideTop():this._whichSideBottom());
+var _615=el.style;
+if(_614=="left"){
+_615.marginLeft=_613;
+_615.marginRight="0px";
+}else{
+if(_614=="right"){
+_615.marginRight=_613;
+_615.marginLeft="0px";
+}else{
+_615.marginLeft=_613;
+_615.marginRight=_613;
+}
+}
+},_setBorder:function(el,n,_618){
+var _619=this._borderSize(n)+"px";
+var _61a=(_618=="top"?this._whichSideTop():this._whichSideBottom());
+var _61b=el.style;
+if(_61a=="left"){
+_61b.borderLeftWidth=_619;
+_61b.borderRightWidth="0px";
+}else{
+if(_61a=="right"){
+_61b.borderRightWidth=_619;
+_61b.borderLeftWidth="0px";
+}else{
+_61b.borderLeftWidth=_619;
+_61b.borderRightWidth=_619;
+}
+}
+},_marginSize:function(n){
+if(this.isTransparent){
+return 0;
+}
+var o=this.options;
+if(o.compact&&o.blend){
+var _61e=[1,0];
+return _61e[n];
+}else{
+if(o.compact){
+var _61f=[2,1];
+return _61f[n];
+}else{
+if(o.blend){
+var _620=[3,2,1,0];
+return _620[n];
+}else{
+var _621=[5,3,2,1];
+return _621[n];
+}
+}
+}
+},_borderSize:function(n){
+var o=this.options;
+var _624;
+if(o.compact&&(o.blend||this.isTransparent)){
+return 1;
+}else{
+if(o.compact){
+_624=[1,0];
+}else{
+if(o.blend){
+_624=[2,1,1,1];
+}else{
+if(o.border){
+_624=[0,2,0,0];
+}else{
+if(this.isTransparent){
+_624=[5,3,2,1];
+}else{
+return 0;
+}
+}
+}
+}
+}
+return _624[n];
+},_hasString:function(str){
+for(var i=1;i<arguments.length;i++){
+if(str.indexOf(arguments[i])!=-1){
+return true;
+}
+}
+return false;
+},_isTopRounded:function(){
+return this._hasString(this.options.corners,"all","top","tl","tr");
+},_isBottomRounded:function(){
+return this._hasString(this.options.corners,"all","bottom","bl","br");
+},_hasSingleTextChild:function(el){
+return (el.childNodes.length==1&&el.childNodes[0].nodeType==3);
+}};
+MochiKit.Visual.roundElement=function(e,_629){
+new MochiKit.Visual._RoundCorners(e,_629);
+};
+MochiKit.Visual.roundClass=function(_62a,_62b,_62c){
+var _62d=MochiKit.DOM.getElementsByTagAndClassName(_62a,_62b);
+for(var i=0;i<_62d.length;i++){
+MochiKit.Visual.roundElement(_62d[i],_62c);
+}
+};
+MochiKit.Visual.tagifyText=function(_62f,_630){
+_630=_630||"position:relative";
+if(/MSIE/.test(navigator.userAgent)){
+_630+=";zoom:1";
+}
+_62f=MochiKit.DOM.getElement(_62f);
+var ma=MochiKit.Base.map;
+ma(function(_632){
+if(_632.nodeType==3){
+ma(function(_633){
+_62f.insertBefore(MochiKit.DOM.SPAN({style:_630},_633==" "?String.fromCharCode(160):_633),_632);
+},_632.nodeValue.split(""));
+MochiKit.DOM.removeElement(_632);
+}
+},_62f.childNodes);
+};
+MochiKit.Visual.forceRerendering=function(_634){
+try{
+_634=MochiKit.DOM.getElement(_634);
+var n=document.createTextNode(" ");
+_634.appendChild(n);
+_634.removeChild(n);
+}
+catch(e){
+}
+};
+MochiKit.Visual.multiple=function(_636,_637,_638){
+_638=MochiKit.Base.update({speed:0.1,delay:0},_638);
+var _639=_638.delay;
+var _63a=0;
+MochiKit.Base.map(function(_63b){
+_638.delay=_63a*_638.speed+_639;
+new _637(_63b,_638);
+_63a+=1;
+},_636);
+};
+MochiKit.Visual.PAIRS={"slide":["slideDown","slideUp"],"blind":["blindDown","blindUp"],"appear":["appear","fade"],"size":["grow","shrink"]};
+MochiKit.Visual.toggle=function(_63c,_63d,_63e){
+_63c=MochiKit.DOM.getElement(_63c);
+_63d=(_63d||"appear").toLowerCase();
+_63e=MochiKit.Base.update({queue:{position:"end",scope:(_63c.id||"global"),limit:1}},_63e);
+var v=MochiKit.Visual;
+v[MochiKit.Style.getStyle(_63c,"display")!="none"?v.PAIRS[_63d][1]:v.PAIRS[_63d][0]](_63c,_63e);
+};
+MochiKit.Visual.Transitions={};
+MochiKit.Visual.Transitions.linear=function(pos){
+return pos;
+};
+MochiKit.Visual.Transitions.sinoidal=function(pos){
+return 0.5-Math.cos(pos*Math.PI)/2;
+};
+MochiKit.Visual.Transitions.reverse=function(pos){
+return 1-pos;
+};
+MochiKit.Visual.Transitions.flicker=function(pos){
+return 0.25-Math.cos(pos*Math.PI)/4+Math.random()/2;
+};
+MochiKit.Visual.Transitions.wobble=function(pos){
+return 0.5-Math.cos(9*pos*Math.PI)/2;
+};
+MochiKit.Visual.Transitions.pulse=function(pos,_646){
+if(_646){
+pos*=2*_646;
+}else{
+pos*=10;
+}
+var _647=pos-Math.floor(pos);
+return (Math.floor(pos)%2==0)?_647:1-_647;
+};
+MochiKit.Visual.Transitions.parabolic=function(pos){
+return pos*pos;
+};
+MochiKit.Visual.Transitions.none=function(pos){
+return 0;
+};
+MochiKit.Visual.Transitions.full=function(pos){
+return 1;
+};
+MochiKit.Visual.ScopedQueue=function(){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls();
+}
+this.__init__();
+};
+MochiKit.Base.update(MochiKit.Visual.ScopedQueue.prototype,{__init__:function(){
+this.effects=[];
+this.interval=null;
+},add:function(_64c){
+var _64d=new Date().getTime();
+var _64e=(typeof (_64c.options.queue)=="string")?_64c.options.queue:_64c.options.queue.position;
+var ma=MochiKit.Base.map;
+switch(_64e){
+case "front":
+ma(function(e){
+if(e.state=="idle"){
+e.startOn+=_64c.finishOn;
+e.finishOn+=_64c.finishOn;
+}
+},this.effects);
+break;
+case "end":
+var _651;
+ma(function(e){
+var i=e.finishOn;
+if(i>=(_651||i)){
+_651=i;
+}
+},this.effects);
+_64d=_651||_64d;
+break;
+case "break":
+ma(function(e){
+e.finalize();
+},this.effects);
+break;
+}
+_64c.startOn+=_64d;
+_64c.finishOn+=_64d;
+if(!_64c.options.queue.limit||this.effects.length<_64c.options.queue.limit){
+this.effects.push(_64c);
+}
+if(!this.interval){
+this.interval=this.startLoop(MochiKit.Base.bind(this.loop,this),40);
+}
+},startLoop:function(func,_656){
+return setInterval(func,_656);
+},remove:function(_657){
+this.effects=MochiKit.Base.filter(function(e){
+return e!=_657;
+},this.effects);
+if(!this.effects.length){
+this.stopLoop(this.interval);
+this.interval=null;
+}
+},stopLoop:function(_659){
+clearInterval(_659);
+},loop:function(){
+var _65a=new Date().getTime();
+MochiKit.Base.map(function(_65b){
+_65b.loop(_65a);
+},this.effects);
+}});
+MochiKit.Visual.Queues={instances:{},get:function(_65c){
+if(typeof (_65c)!="string"){
+return _65c;
+}
+if(!this.instances[_65c]){
+this.instances[_65c]=new MochiKit.Visual.ScopedQueue();
+}
+return this.instances[_65c];
+}};
+MochiKit.Visual.Queue=MochiKit.Visual.Queues.get("global");
+MochiKit.Visual.DefaultOptions={transition:MochiKit.Visual.Transitions.sinoidal,duration:1,fps:25,sync:false,from:0,to:1,delay:0,queue:"parallel"};
+MochiKit.Visual.Base=function(){
+};
+MochiKit.Visual.Base.prototype={__class__:MochiKit.Visual.Base,start:function(_65d){
+var v=MochiKit.Visual;
+this.options=MochiKit.Base.setdefault(_65d,v.DefaultOptions);
+this.currentFrame=0;
+this.state="idle";
+this.startOn=this.options.delay*1000;
+this.finishOn=this.startOn+(this.options.duration*1000);
+this.event("beforeStart");
+if(!this.options.sync){
+v.Queues.get(typeof (this.options.queue)=="string"?"global":this.options.queue.scope).add(this);
+}
+},loop:function(_65f){
+if(_65f>=this.startOn){
+if(_65f>=this.finishOn){
+return this.finalize();
+}
+var pos=(_65f-this.startOn)/(this.finishOn-this.startOn);
+var _661=Math.round(pos*this.options.fps*this.options.duration);
+if(_661>this.currentFrame){
+this.render(pos);
+this.currentFrame=_661;
+}
+}
+},render:function(pos){
+if(this.state=="idle"){
+this.state="running";
+this.event("beforeSetup");
+this.setup();
+this.event("afterSetup");
+}
+if(this.state=="running"){
+if(this.options.transition){
+pos=this.options.transition(pos);
+}
+pos*=(this.options.to-this.options.from);
+pos+=this.options.from;
+this.event("beforeUpdate");
+this.update(pos);
+this.event("afterUpdate");
+}
+},cancel:function(){
+if(!this.options.sync){
+MochiKit.Visual.Queues.get(typeof (this.options.queue)=="string"?"global":this.options.queue.scope).remove(this);
+}
+this.state="finished";
+},finalize:function(){
+this.render(1);
+this.cancel();
+this.event("beforeFinish");
+this.finish();
+this.event("afterFinish");
+},setup:function(){
+},finish:function(){
+},update:function(_663){
+},event:function(_664){
+if(this.options[_664+"Internal"]){
+this.options[_664+"Internal"](this);
+}
+if(this.options[_664]){
+this.options[_664](this);
+}
+},repr:function(){
+return "["+this.__class__.NAME+", options:"+MochiKit.Base.repr(this.options)+"]";
+}};
+MochiKit.Visual.Parallel=function(_665,_666){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_665,_666);
+}
+this.__init__(_665,_666);
+};
+MochiKit.Visual.Parallel.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Parallel.prototype,{__class__:MochiKit.Visual.Parallel,__init__:function(_668,_669){
+this.effects=_668||[];
+this.start(_669);
+},update:function(_66a){
+MochiKit.Base.map(function(_66b){
+_66b.render(_66a);
+},this.effects);
+},finish:function(){
+MochiKit.Base.map(function(_66c){
+_66c.finalize();
+},this.effects);
+}});
+MochiKit.Visual.Sequence=function(_66d,_66e){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_66d,_66e);
+}
+this.__init__(_66d,_66e);
+};
+MochiKit.Visual.Sequence.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Sequence.prototype,{__class__:MochiKit.Visual.Sequence,__init__:function(_670,_671){
+var defs={transition:MochiKit.Visual.Transitions.linear,duration:0};
+this.effects=_670||[];
+MochiKit.Base.map(function(_673){
+defs.duration+=_673.options.duration;
+},this.effects);
+MochiKit.Base.setdefault(_671,defs);
+this.start(_671);
+},update:function(_674){
+var time=_674*this.options.duration;
+for(var i=0;i<this.effects.length;i++){
+var _677=this.effects[i];
+if(time<=_677.options.duration){
+_677.render(time/_677.options.duration);
+break;
+}else{
+time-=_677.options.duration;
+}
+}
+},finish:function(){
+MochiKit.Base.map(function(_678){
+_678.finalize();
+},this.effects);
+}});
+MochiKit.Visual.Opacity=function(_679,_67a){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_679,_67a);
+}
+this.__init__(_679,_67a);
+};
+MochiKit.Visual.Opacity.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Opacity.prototype,{__class__:MochiKit.Visual.Opacity,__init__:function(_67c,_67d){
+var b=MochiKit.Base;
+var s=MochiKit.Style;
+this.element=MochiKit.DOM.getElement(_67c);
+if(this.element.currentStyle&&(!this.element.currentStyle.hasLayout)){
+s.setStyle(this.element,{zoom:1});
+}
+_67d=b.update({from:s.getStyle(this.element,"opacity")||0,to:1},_67d);
+this.start(_67d);
+},update:function(_680){
+MochiKit.Style.setStyle(this.element,{"opacity":_680});
+}});
+MochiKit.Visual.Move=function(_681,_682){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_681,_682);
+}
+this.__init__(_681,_682);
+};
+MochiKit.Visual.Move.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Move.prototype,{__class__:MochiKit.Visual.Move,__init__:function(_684,_685){
+this.element=MochiKit.DOM.getElement(_684);
+_685=MochiKit.Base.update({x:0,y:0,mode:"relative"},_685);
+this.start(_685);
+},setup:function(){
+MochiKit.Style.makePositioned(this.element);
+var s=this.element.style;
+var _687=s.visibility;
+var _688=s.display;
+if(_688=="none"){
+s.visibility="hidden";
+s.display="";
+}
+this.originalLeft=parseFloat(MochiKit.Style.getStyle(this.element,"left")||"0");
+this.originalTop=parseFloat(MochiKit.Style.getStyle(this.element,"top")||"0");
+if(this.options.mode=="absolute"){
+this.options.x-=this.originalLeft;
+this.options.y-=this.originalTop;
+}
+if(_688=="none"){
+s.visibility=_687;
+s.display=_688;
+}
+},update:function(_689){
+MochiKit.Style.setStyle(this.element,{left:Math.round(this.options.x*_689+this.originalLeft)+"px",top:Math.round(this.options.y*_689+this.originalTop)+"px"});
+}});
+MochiKit.Visual.Scale=function(_68a,_68b,_68c){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_68a,_68b,_68c);
+}
+this.__init__(_68a,_68b,_68c);
+};
+MochiKit.Visual.Scale.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Scale.prototype,{__class__:MochiKit.Visual.Scale,__init__:function(_68e,_68f,_690){
+this.element=MochiKit.DOM.getElement(_68e);
+_690=MochiKit.Base.update({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_68f},_690);
+this.start(_690);
+},setup:function(){
+this.restoreAfterFinish=this.options.restoreAfterFinish||false;
+this.elementPositioning=MochiKit.Style.getStyle(this.element,"position");
+var ma=MochiKit.Base.map;
+var b=MochiKit.Base.bind;
+this.originalStyle={};
+ma(b(function(k){
+this.originalStyle[k]=this.element.style[k];
+},this),["top","left","width","height","fontSize"]);
+this.originalTop=this.element.offsetTop;
+this.originalLeft=this.element.offsetLeft;
+var _694=MochiKit.Style.getStyle(this.element,"font-size")||"100%";
+ma(b(function(_695){
+if(_694.indexOf(_695)>0){
+this.fontSize=parseFloat(_694);
+this.fontSizeType=_695;
+}
+},this),["em","px","%"]);
+this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;
+if(/^content/.test(this.options.scaleMode)){
+this.dims=[this.element.scrollHeight,this.element.scrollWidth];
+}else{
+if(this.options.scaleMode=="box"){
+this.dims=[this.element.offsetHeight,this.element.offsetWidth];
+}else{
+this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth];
+}
+}
+},update:function(_696){
+var _697=(this.options.scaleFrom/100)+(this.factor*_696);
+if(this.options.scaleContent&&this.fontSize){
+MochiKit.Style.setStyle(this.element,{fontSize:this.fontSize*_697+this.fontSizeType});
+}
+this.setDimensions(this.dims[0]*_697,this.dims[1]*_697);
+},finish:function(){
+if(this.restoreAfterFinish){
+MochiKit.Style.setStyle(this.element,this.originalStyle);
+}
+},setDimensions:function(_698,_699){
+var d={};
+var r=Math.round;
+if(/MSIE/.test(navigator.userAgent)){
+r=Math.ceil;
+}
+if(this.options.scaleX){
+d.width=r(_699)+"px";
+}
+if(this.options.scaleY){
+d.height=r(_698)+"px";
+}
+if(this.options.scaleFromCenter){
+var topd=(_698-this.dims[0])/2;
+var _69d=(_699-this.dims[1])/2;
+if(this.elementPositioning=="absolute"){
+if(this.options.scaleY){
+d.top=this.originalTop-topd+"px";
+}
+if(this.options.scaleX){
+d.left=this.originalLeft-_69d+"px";
+}
+}else{
+if(this.options.scaleY){
+d.top=-topd+"px";
+}
+if(this.options.scaleX){
+d.left=-_69d+"px";
+}
+}
+}
+MochiKit.Style.setStyle(this.element,d);
+}});
+MochiKit.Visual.Highlight=function(_69e,_69f){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_69e,_69f);
+}
+this.__init__(_69e,_69f);
+};
+MochiKit.Visual.Highlight.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Highlight.prototype,{__class__:MochiKit.Visual.Highlight,__init__:function(_6a1,_6a2){
+this.element=MochiKit.DOM.getElement(_6a1);
+_6a2=MochiKit.Base.update({startcolor:"#ffff99"},_6a2);
+this.start(_6a2);
+},setup:function(){
+var b=MochiKit.Base;
+var s=MochiKit.Style;
+if(s.getStyle(this.element,"display")=="none"){
+this.cancel();
+return;
+}
+this.oldStyle={backgroundImage:s.getStyle(this.element,"background-image")};
+s.setStyle(this.element,{backgroundImage:"none"});
+if(!this.options.endcolor){
+this.options.endcolor=MochiKit.Color.Color.fromBackground(this.element).toHexString();
+}
+if(b.isUndefinedOrNull(this.options.restorecolor)){
+this.options.restorecolor=s.getStyle(this.element,"background-color");
+}
+this._base=b.map(b.bind(function(i){
+return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16);
+},this),[0,1,2]);
+this._delta=b.map(b.bind(function(i){
+return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i];
+},this),[0,1,2]);
+},update:function(_6a7){
+var m="#";
+MochiKit.Base.map(MochiKit.Base.bind(function(i){
+m+=MochiKit.Color.toColorPart(Math.round(this._base[i]+this._delta[i]*_6a7));
+},this),[0,1,2]);
+MochiKit.Style.setStyle(this.element,{backgroundColor:m});
+},finish:function(){
+MochiKit.Style.setStyle(this.element,MochiKit.Base.update(this.oldStyle,{backgroundColor:this.options.restorecolor}));
+}});
+MochiKit.Visual.ScrollTo=function(_6aa,_6ab){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_6aa,_6ab);
+}
+this.__init__(_6aa,_6ab);
+};
+MochiKit.Visual.ScrollTo.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.ScrollTo.prototype,{__class__:MochiKit.Visual.ScrollTo,__init__:function(_6ad,_6ae){
+this.element=MochiKit.DOM.getElement(_6ad);
+this.start(_6ae);
+},setup:function(){
+var p=MochiKit.Position;
+p.prepare();
+var _6b0=p.cumulativeOffset(this.element);
+if(this.options.offset){
+_6b0.y+=this.options.offset;
+}
+var max;
+if(window.innerHeight){
+max=window.innerHeight-window.height;
+}else{
+if(document.documentElement&&document.documentElement.clientHeight){
+max=document.documentElement.clientHeight-document.body.scrollHeight;
+}else{
+if(document.body){
+max=document.body.clientHeight-document.body.scrollHeight;
+}
+}
+}
+this.scrollStart=p.windowOffset.y;
+this.delta=(_6b0.y>max?max:_6b0.y)-this.scrollStart;
+},update:function(_6b2){
+var p=MochiKit.Position;
+p.prepare();
+window.scrollTo(p.windowOffset.x,this.scrollStart+(_6b2*this.delta));
+}});
+MochiKit.Visual.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
+MochiKit.Visual.Morph=function(_6b4,_6b5){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_6b4,_6b5);
+}
+this.__init__(_6b4,_6b5);
+};
+MochiKit.Visual.Morph.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Morph.prototype,{__class__:MochiKit.Visual.Morph,__init__:function(_6b7,_6b8){
+this.element=MochiKit.DOM.getElement(_6b7);
+this.start(_6b8);
+},setup:function(){
+var b=MochiKit.Base;
+var _6ba=this.options.style;
+this.styleStart={};
+this.styleEnd={};
+this.units={};
+var _6bb,unit;
+for(var s in _6ba){
+_6bb=_6ba[s];
+s=b.camelize(s);
+if(MochiKit.Visual.CSS_LENGTH.test(_6bb)){
+var _6be=_6bb.match(/^([\+\-]?[0-9\.]+)(.*)$/);
+_6bb=parseFloat(_6be[1]);
+unit=(_6be.length==3)?_6be[2]:null;
+this.styleEnd[s]=_6bb;
+this.units[s]=unit;
+_6bb=MochiKit.Style.getStyle(this.element,s);
+_6be=_6bb.match(/^([\+\-]?[0-9\.]+)(.*)$/);
+_6bb=parseFloat(_6be[1]);
+this.styleStart[s]=_6bb;
+}else{
+if(/[Cc]olor$/.test(s)){
+var c=MochiKit.Color.Color;
+_6bb=c.fromString(_6bb);
+if(_6bb){
+this.units[s]="color";
+this.styleEnd[s]=_6bb.toHexString();
+_6bb=MochiKit.Style.getStyle(this.element,s);
+this.styleStart[s]=c.fromString(_6bb).toHexString();
+this.styleStart[s]=b.map(b.bind(function(i){
+return parseInt(this.styleStart[s].slice(i*2+1,i*2+3),16);
+},this),[0,1,2]);
+this.styleEnd[s]=b.map(b.bind(function(i){
+return parseInt(this.styleEnd[s].slice(i*2+1,i*2+3),16);
+},this),[0,1,2]);
+}
+}else{
+this.element.style[s]=_6bb;
+}
+}
+}
+},update:function(_6c2){
+var _6c3;
+for(var s in this.styleStart){
+if(this.units[s]=="color"){
+var m="#";
+var _6c6=this.styleStart[s];
+var end=this.styleEnd[s];
+MochiKit.Base.map(MochiKit.Base.bind(function(i){
+m+=MochiKit.Color.toColorPart(Math.round(_6c6[i]+(end[i]-_6c6[i])*_6c2));
+},this),[0,1,2]);
+this.element.style[s]=m;
+}else{
+_6c3=this.styleStart[s]+Math.round((this.styleEnd[s]-this.styleStart[s])*_6c2*1000)/1000+this.units[s];
+this.element.style[s]=_6c3;
+}
+}
+}});
+MochiKit.Visual.fade=function(_6c9,_6ca){
+var s=MochiKit.Style;
+var _6cc=s.getStyle(_6c9,"opacity");
+_6ca=MochiKit.Base.update({from:s.getStyle(_6c9,"opacity")||1,to:0,afterFinishInternal:function(_6cd){
+if(_6cd.options.to!==0){
+return;
+}
+s.hideElement(_6cd.element);
+s.setStyle(_6cd.element,{"opacity":_6cc});
+}},_6ca);
+return new MochiKit.Visual.Opacity(_6c9,_6ca);
+};
+MochiKit.Visual.appear=function(_6ce,_6cf){
+var s=MochiKit.Style;
+var v=MochiKit.Visual;
+_6cf=MochiKit.Base.update({from:(s.getStyle(_6ce,"display")=="none"?0:s.getStyle(_6ce,"opacity")||0),to:1,afterFinishInternal:function(_6d2){
+v.forceRerendering(_6d2.element);
+},beforeSetupInternal:function(_6d3){
+s.setStyle(_6d3.element,{"opacity":_6d3.options.from});
+s.showElement(_6d3.element);
+}},_6cf);
+return new v.Opacity(_6ce,_6cf);
+};
+MochiKit.Visual.puff=function(_6d4,_6d5){
+var s=MochiKit.Style;
+var v=MochiKit.Visual;
+_6d4=MochiKit.DOM.getElement(_6d4);
+var _6d8=MochiKit.Style.getElementDimensions(_6d4,true);
+var _6d9={position:s.getStyle(_6d4,"position"),top:_6d4.style.top,left:_6d4.style.left,width:_6d4.style.width,height:_6d4.style.height,opacity:s.getStyle(_6d4,"opacity")};
+_6d5=MochiKit.Base.update({beforeSetupInternal:function(_6da){
+MochiKit.Position.absolutize(_6da.effects[0].element);
+},afterFinishInternal:function(_6db){
+s.hideElement(_6db.effects[0].element);
+s.setStyle(_6db.effects[0].element,_6d9);
+},scaleContent:true,scaleFromCenter:true},_6d5);
+return new v.Parallel([new v.Scale(_6d4,200,{sync:true,scaleFromCenter:_6d5.scaleFromCenter,scaleMode:{originalHeight:_6d8.h,originalWidth:_6d8.w},scaleContent:_6d5.scaleContent,restoreAfterFinish:true}),new v.Opacity(_6d4,{sync:true,to:0})],_6d5);
+};
+MochiKit.Visual.blindUp=function(_6dc,_6dd){
+var d=MochiKit.DOM;
+var s=MochiKit.Style;
+_6dc=d.getElement(_6dc);
+var _6e0=s.getElementDimensions(_6dc,true);
+var _6e1=s.makeClipping(_6dc);
+_6dd=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleMode:{originalHeight:_6e0.h,originalWidth:_6e0.w},restoreAfterFinish:true,afterFinishInternal:function(_6e2){
+s.hideElement(_6e2.element);
+s.undoClipping(_6e2.element,_6e1);
+}},_6dd);
+return new MochiKit.Visual.Scale(_6dc,0,_6dd);
+};
+MochiKit.Visual.blindDown=function(_6e3,_6e4){
+var d=MochiKit.DOM;
+var s=MochiKit.Style;
+_6e3=d.getElement(_6e3);
+var _6e7=s.getElementDimensions(_6e3,true);
+var _6e8;
+_6e4=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6e7.h,originalWidth:_6e7.w},restoreAfterFinish:true,afterSetupInternal:function(_6e9){
+_6e8=s.makeClipping(_6e9.element);
+s.setStyle(_6e9.element,{height:"0px"});
+s.showElement(_6e9.element);
+},afterFinishInternal:function(_6ea){
+s.undoClipping(_6ea.element,_6e8);
+}},_6e4);
+return new MochiKit.Visual.Scale(_6e3,100,_6e4);
+};
+MochiKit.Visual.switchOff=function(_6eb,_6ec){
+var d=MochiKit.DOM;
+var s=MochiKit.Style;
+_6eb=d.getElement(_6eb);
+var _6ef=s.getElementDimensions(_6eb,true);
+var _6f0=s.getStyle(_6eb,"opacity");
+var _6f1;
+_6ec=MochiKit.Base.update({duration:0.7,restoreAfterFinish:true,beforeSetupInternal:function(_6f2){
+s.makePositioned(_6eb);
+_6f1=s.makeClipping(_6eb);
+},afterFinishInternal:function(_6f3){
+s.hideElement(_6eb);
+s.undoClipping(_6eb,_6f1);
+s.undoPositioned(_6eb);
+s.setStyle(_6eb,{"opacity":_6f0});
+}},_6ec);
+var v=MochiKit.Visual;
+return new v.Sequence([new v.appear(_6eb,{sync:true,duration:0.57*_6ec.duration,from:0,transition:v.Transitions.flicker}),new v.Scale(_6eb,1,{sync:true,duration:0.43*_6ec.duration,scaleFromCenter:true,scaleX:false,scaleMode:{originalHeight:_6ef.h,originalWidth:_6ef.w},scaleContent:false,restoreAfterFinish:true})],_6ec);
+};
+MochiKit.Visual.dropOut=function(_6f5,_6f6){
+var d=MochiKit.DOM;
+var s=MochiKit.Style;
+_6f5=d.getElement(_6f5);
+var _6f9={top:s.getStyle(_6f5,"top"),left:s.getStyle(_6f5,"left"),opacity:s.getStyle(_6f5,"opacity")};
+_6f6=MochiKit.Base.update({duration:0.5,distance:100,beforeSetupInternal:function(_6fa){
+s.makePositioned(_6fa.effects[0].element);
+},afterFinishInternal:function(_6fb){
+s.hideElement(_6fb.effects[0].element);
+s.undoPositioned(_6fb.effects[0].element);
+s.setStyle(_6fb.effects[0].element,_6f9);
+}},_6f6);
+var v=MochiKit.Visual;
+return new v.Parallel([new v.Move(_6f5,{x:0,y:_6f6.distance,sync:true}),new v.Opacity(_6f5,{sync:true,to:0})],_6f6);
+};
+MochiKit.Visual.shake=function(_6fd,_6fe){
+var d=MochiKit.DOM;
+var v=MochiKit.Visual;
+var s=MochiKit.Style;
+_6fd=d.getElement(_6fd);
+var _702={top:s.getStyle(_6fd,"top"),left:s.getStyle(_6fd,"left")};
+_6fe=MochiKit.Base.update({duration:0.5,afterFinishInternal:function(_703){
+s.undoPositioned(_6fd);
+s.setStyle(_6fd,_702);
+}},_6fe);
+return new v.Sequence([new v.Move(_6fd,{sync:true,duration:0.1*_6fe.duration,x:20,y:0}),new v.Move(_6fd,{sync:true,duration:0.2*_6fe.duration,x:-40,y:0}),new v.Move(_6fd,{sync:true,duration:0.2*_6fe.duration,x:40,y:0}),new v.Move(_6fd,{sync:true,duration:0.2*_6fe.duration,x:-40,y:0}),new v.Move(_6fd,{sync:true,duration:0.2*_6fe.duration,x:40,y:0}),new v.Move(_6fd,{sync:true,duration:0.1*_6fe.duration,x:-20,y:0})],_6fe);
+};
+MochiKit.Visual.slideDown=function(_704,_705){
+var d=MochiKit.DOM;
+var b=MochiKit.Base;
+var s=MochiKit.Style;
+_704=d.getElement(_704);
+if(!_704.firstChild){
+throw new Error("MochiKit.Visual.slideDown must be used on a element with a child");
+}
+d.removeEmptyTextNodes(_704);
+var _709=s.getStyle(_704.firstChild,"bottom")||0;
+var _70a=s.getElementDimensions(_704,true);
+var _70b;
+_705=b.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_70a.h,originalWidth:_70a.w},restoreAfterFinish:true,afterSetupInternal:function(_70c){
+s.makePositioned(_70c.element);
+s.makePositioned(_70c.element.firstChild);
+if(/Opera/.test(navigator.userAgent)){
+s.setStyle(_70c.element,{top:""});
+}
+_70b=s.makeClipping(_70c.element);
+s.setStyle(_70c.element,{height:"0px"});
+s.showElement(_70c.element);
+},afterUpdateInternal:function(_70d){
+var _70e=s.getElementDimensions(_70d.element,true);
+s.setStyle(_70d.element.firstChild,{bottom:(_70d.dims[0]-_70e.h)+"px"});
+},afterFinishInternal:function(_70f){
+s.undoClipping(_70f.element,_70b);
+if(/MSIE/.test(navigator.userAgent)){
+s.undoPositioned(_70f.element);
+s.undoPositioned(_70f.element.firstChild);
+}else{
+s.undoPositioned(_70f.element.firstChild);
+s.undoPositioned(_70f.element);
+}
+s.setStyle(_70f.element.firstChild,{bottom:_709});
+}},_705);
+return new MochiKit.Visual.Scale(_704,100,_705);
+};
+MochiKit.Visual.slideUp=function(_710,_711){
+var d=MochiKit.DOM;
+var b=MochiKit.Base;
+var s=MochiKit.Style;
+_710=d.getElement(_710);
+if(!_710.firstChild){
+throw new Error("MochiKit.Visual.slideUp must be used on a element with a child");
+}
+d.removeEmptyTextNodes(_710);
+var _715=s.getStyle(_710.firstChild,"bottom");
+var _716=s.getElementDimensions(_710,true);
+var _717;
+_711=b.update({scaleContent:false,scaleX:false,scaleMode:{originalHeight:_716.h,originalWidth:_716.w},scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_718){
+s.makePositioned(_718.element);
+s.makePositioned(_718.element.firstChild);
+if(/Opera/.test(navigator.userAgent)){
+s.setStyle(_718.element,{top:""});
+}
+_717=s.makeClipping(_718.element);
+s.showElement(_718.element);
+},afterUpdateInternal:function(_719){
+var _71a=s.getElementDimensions(_719.element,true);
+s.setStyle(_719.element.firstChild,{bottom:(_719.dims[0]-_71a.h)+"px"});
+},afterFinishInternal:function(_71b){
+s.hideElement(_71b.element);
+s.undoClipping(_71b.element,_717);
+s.undoPositioned(_71b.element.firstChild);
+s.undoPositioned(_71b.element);
+s.setStyle(_71b.element.firstChild,{bottom:_715});
+}},_711);
+return new MochiKit.Visual.Scale(_710,0,_711);
+};
+MochiKit.Visual.squish=function(_71c,_71d){
+var d=MochiKit.DOM;
+var b=MochiKit.Base;
+var s=MochiKit.Style;
+var _721=s.getElementDimensions(_71c,true);
+var _722;
+_71d=b.update({restoreAfterFinish:true,scaleMode:{originalHeight:_721.w,originalWidth:_721.h},beforeSetupInternal:function(_723){
+_722=s.makeClipping(_723.element);
+},afterFinishInternal:function(_724){
+s.hideElement(_724.element);
+s.undoClipping(_724.element,_722);
+}},_71d);
+return new MochiKit.Visual.Scale(_71c,/Opera/.test(navigator.userAgent)?1:0,_71d);
+};
+MochiKit.Visual.grow=function(_725,_726){
+var d=MochiKit.DOM;
+var v=MochiKit.Visual;
+var s=MochiKit.Style;
+_725=d.getElement(_725);
+_726=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.full,scaleContent:true,scaleFromCenter:false},_726);
+var _72a={top:_725.style.top,left:_725.style.left,height:_725.style.height,width:_725.style.width,opacity:s.getStyle(_725,"opacity")};
+var dims=s.getElementDimensions(_725,true);
+var _72c,_72d;
+var _72e,_72f;
+switch(_726.direction){
+case "top-left":
+_72c=_72d=_72e=_72f=0;
+break;
+case "top-right":
+_72c=dims.w;
+_72d=_72f=0;
+_72e=-dims.w;
+break;
+case "bottom-left":
+_72c=_72e=0;
+_72d=dims.h;
+_72f=-dims.h;
+break;
+case "bottom-right":
+_72c=dims.w;
+_72d=dims.h;
+_72e=-dims.w;
+_72f=-dims.h;
+break;
+case "center":
+_72c=dims.w/2;
+_72d=dims.h/2;
+_72e=-dims.w/2;
+_72f=-dims.h/2;
+break;
+}
+var _730=MochiKit.Base.update({beforeSetupInternal:function(_731){
+s.setStyle(_731.effects[0].element,{height:"0px"});
+s.showElement(_731.effects[0].element);
+},afterFinishInternal:function(_732){
+s.undoClipping(_732.effects[0].element);
+s.undoPositioned(_732.effects[0].element);
+s.setStyle(_732.effects[0].element,_72a);
+}},_726);
+return new v.Move(_725,{x:_72c,y:_72d,duration:0.01,beforeSetupInternal:function(_733){
+s.hideElement(_733.element);
+s.makeClipping(_733.element);
+s.makePositioned(_733.element);
+},afterFinishInternal:function(_734){
+new v.Parallel([new v.Opacity(_734.element,{sync:true,to:1,from:0,transition:_726.opacityTransition}),new v.Move(_734.element,{x:_72e,y:_72f,sync:true,transition:_726.moveTransition}),new v.Scale(_734.element,100,{scaleMode:{originalHeight:dims.h,originalWidth:dims.w},sync:true,scaleFrom:/Opera/.test(navigator.userAgent)?1:0,transition:_726.scaleTransition,scaleContent:_726.scaleContent,scaleFromCenter:_726.scaleFromCenter,restoreAfterFinish:true})],_730);
+}});
+};
+MochiKit.Visual.shrink=function(_735,_736){
+var d=MochiKit.DOM;
+var v=MochiKit.Visual;
+var s=MochiKit.Style;
+_735=d.getElement(_735);
+_736=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.none,scaleContent:true,scaleFromCenter:false},_736);
+var _73a={top:_735.style.top,left:_735.style.left,height:_735.style.height,width:_735.style.width,opacity:s.getStyle(_735,"opacity")};
+var dims=s.getElementDimensions(_735,true);
+var _73c,_73d;
+switch(_736.direction){
+case "top-left":
+_73c=_73d=0;
+break;
+case "top-right":
+_73c=dims.w;
+_73d=0;
+break;
+case "bottom-left":
+_73c=0;
+_73d=dims.h;
+break;
+case "bottom-right":
+_73c=dims.w;
+_73d=dims.h;
+break;
+case "center":
+_73c=dims.w/2;
+_73d=dims.h/2;
+break;
+}
+var _73e;
+var _73f=MochiKit.Base.update({beforeStartInternal:function(_740){
+s.makePositioned(_740.effects[0].element);
+_73e=s.makeClipping(_740.effects[0].element);
+},afterFinishInternal:function(_741){
+s.hideElement(_741.effects[0].element);
+s.undoClipping(_741.effects[0].element,_73e);
+s.undoPositioned(_741.effects[0].element);
+s.setStyle(_741.effects[0].element,_73a);
+}},_736);
+return new v.Parallel([new v.Opacity(_735,{sync:true,to:0,from:1,transition:_736.opacityTransition}),new v.Scale(_735,/Opera/.test(navigator.userAgent)?1:0,{scaleMode:{originalHeight:dims.h,originalWidth:dims.w},sync:true,transition:_736.scaleTransition,scaleContent:_736.scaleContent,scaleFromCenter:_736.scaleFromCenter,restoreAfterFinish:true}),new v.Move(_735,{x:_73c,y:_73d,sync:true,transition:_736.moveTransition})],_73f);
+};
+MochiKit.Visual.pulsate=function(_742,_743){
+var d=MochiKit.DOM;
+var v=MochiKit.Visual;
+var b=MochiKit.Base;
+var _747=MochiKit.Style.getStyle(_742,"opacity");
+_743=b.update({duration:3,from:0,afterFinishInternal:function(_748){
+MochiKit.Style.setStyle(_748.element,{"opacity":_747});
+}},_743);
+var _749=_743.transition||v.Transitions.sinoidal;
+_743.transition=function(pos){
+return _749(1-v.Transitions.pulse(pos,_743.pulses));
+};
+return new v.Opacity(_742,_743);
+};
+MochiKit.Visual.fold=function(_74b,_74c){
+var d=MochiKit.DOM;
+var v=MochiKit.Visual;
+var s=MochiKit.Style;
+_74b=d.getElement(_74b);
+var _750=s.getElementDimensions(_74b,true);
+var _751={top:_74b.style.top,left:_74b.style.left,width:_74b.style.width,height:_74b.style.height};
+var _752=s.makeClipping(_74b);
+_74c=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleMode:{originalHeight:_750.h,originalWidth:_750.w},afterFinishInternal:function(_753){
+new v.Scale(_74b,1,{scaleContent:false,scaleY:false,scaleMode:{originalHeight:_750.h,originalWidth:_750.w},afterFinishInternal:function(_754){
+s.hideElement(_754.element);
+s.undoClipping(_754.element,_752);
+s.setStyle(_754.element,_751);
+}});
+}},_74c);
+return new v.Scale(_74b,5,_74c);
+};
+MochiKit.Visual.Color=MochiKit.Color.Color;
+MochiKit.Visual.getElementsComputedStyle=MochiKit.DOM.computedStyle;
+MochiKit.Visual.__new__=function(){
+var m=MochiKit.Base;
+m.nameFunctions(this);
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+};
+MochiKit.Visual.EXPORT=["roundElement","roundClass","tagifyText","multiple","toggle","Parallel","Sequence","Opacity","Move","Scale","Highlight","ScrollTo","Morph","fade","appear","puff","blindUp","blindDown","switchOff","dropOut","shake","slideDown","slideUp","squish","grow","shrink","pulsate","fold"];
+MochiKit.Visual.EXPORT_OK=["Base","PAIRS"];
+MochiKit.Visual.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.Visual);
+MochiKit.Base._deps("DragAndDrop",["Base","Iter","DOM","Signal","Visual","Position"]);
+MochiKit.DragAndDrop.NAME="MochiKit.DragAndDrop";
+MochiKit.DragAndDrop.VERSION="1.4.2";
+MochiKit.DragAndDrop.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.DragAndDrop.toString=function(){
+return this.__repr__();
+};
+MochiKit.DragAndDrop.EXPORT=["Droppable","Draggable"];
+MochiKit.DragAndDrop.EXPORT_OK=["Droppables","Draggables"];
+MochiKit.DragAndDrop.Droppables={drops:[],remove:function(_756){
+this.drops=MochiKit.Base.filter(function(d){
+return d.element!=MochiKit.DOM.getElement(_756);
+},this.drops);
+},register:function(drop){
+this.drops.push(drop);
+},unregister:function(drop){
+this.drops=MochiKit.Base.filter(function(d){
+return d!=drop;
+},this.drops);
+},prepare:function(_75b){
+MochiKit.Base.map(function(drop){
+if(drop.isAccepted(_75b)){
+if(drop.options.activeclass){
+MochiKit.DOM.addElementClass(drop.element,drop.options.activeclass);
+}
+drop.options.onactive(drop.element,_75b);
+}
+},this.drops);
+},findDeepestChild:function(_75d){
+deepest=_75d[0];
+for(i=1;i<_75d.length;++i){
+if(MochiKit.DOM.isChildNode(_75d[i].element,deepest.element)){
+deepest=_75d[i];
+}
+}
+return deepest;
+},show:function(_75e,_75f){
+if(!this.drops.length){
+return;
+}
+var _760=[];
+if(this.last_active){
+this.last_active.deactivate();
+}
+MochiKit.Iter.forEach(this.drops,function(drop){
+if(drop.isAffected(_75e,_75f)){
+_760.push(drop);
+}
+});
+if(_760.length>0){
+drop=this.findDeepestChild(_760);
+MochiKit.Position.within(drop.element,_75e.page.x,_75e.page.y);
+drop.options.onhover(_75f,drop.element,MochiKit.Position.overlap(drop.options.overlap,drop.element));
+drop.activate();
+}
+},fire:function(_762,_763){
+if(!this.last_active){
+return;
+}
+MochiKit.Position.prepare();
+if(this.last_active.isAffected(_762.mouse(),_763)){
+this.last_active.options.ondrop(_763,this.last_active.element,_762);
+}
+},reset:function(_764){
+MochiKit.Base.map(function(drop){
+if(drop.options.activeclass){
+MochiKit.DOM.removeElementClass(drop.element,drop.options.activeclass);
+}
+drop.options.ondesactive(drop.element,_764);
+},this.drops);
+if(this.last_active){
+this.last_active.deactivate();
+}
+}};
+MochiKit.DragAndDrop.Droppable=function(_766,_767){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_766,_767);
+}
+this.__init__(_766,_767);
+};
+MochiKit.DragAndDrop.Droppable.prototype={__class__:MochiKit.DragAndDrop.Droppable,__init__:function(_769,_76a){
+var d=MochiKit.DOM;
+var b=MochiKit.Base;
+this.element=d.getElement(_769);
+this.options=b.update({greedy:true,hoverclass:null,activeclass:null,hoverfunc:b.noop,accept:null,onactive:b.noop,ondesactive:b.noop,onhover:b.noop,ondrop:b.noop,containment:[],tree:false},_76a);
+this.options._containers=[];
+b.map(MochiKit.Base.bind(function(c){
+this.options._containers.push(d.getElement(c));
+},this),this.options.containment);
+MochiKit.Style.makePositioned(this.element);
+MochiKit.DragAndDrop.Droppables.register(this);
+},isContained:function(_76e){
+if(this.options._containers.length){
+var _76f;
+if(this.options.tree){
+_76f=_76e.treeNode;
+}else{
+_76f=_76e.parentNode;
+}
+return MochiKit.Iter.some(this.options._containers,function(c){
+return _76f==c;
+});
+}else{
+return true;
+}
+},isAccepted:function(_771){
+return ((!this.options.accept)||MochiKit.Iter.some(this.options.accept,function(c){
+return MochiKit.DOM.hasElementClass(_771,c);
+}));
+},isAffected:function(_773,_774){
+return ((this.element!=_774)&&this.isContained(_774)&&this.isAccepted(_774)&&MochiKit.Position.within(this.element,_773.page.x,_773.page.y));
+},deactivate:function(){
+if(this.options.hoverclass){
+MochiKit.DOM.removeElementClass(this.element,this.options.hoverclass);
+}
+this.options.hoverfunc(this.element,false);
+MochiKit.DragAndDrop.Droppables.last_active=null;
+},activate:function(){
+if(this.options.hoverclass){
+MochiKit.DOM.addElementClass(this.element,this.options.hoverclass);
+}
+this.options.hoverfunc(this.element,true);
+MochiKit.DragAndDrop.Droppables.last_active=this;
+},destroy:function(){
+MochiKit.DragAndDrop.Droppables.unregister(this);
+},repr:function(){
+return "["+this.__class__.NAME+", options:"+MochiKit.Base.repr(this.options)+"]";
+}};
+MochiKit.DragAndDrop.Draggables={drags:[],register:function(_775){
+if(this.drags.length===0){
+var conn=MochiKit.Signal.connect;
+this.eventMouseUp=conn(document,"onmouseup",this,this.endDrag);
+this.eventMouseMove=conn(document,"onmousemove",this,this.updateDrag);
+this.eventKeypress=conn(document,"onkeypress",this,this.keyPress);
+}
+this.drags.push(_775);
+},unregister:function(_777){
+this.drags=MochiKit.Base.filter(function(d){
+return d!=_777;
+},this.drags);
+if(this.drags.length===0){
+var disc=MochiKit.Signal.disconnect;
+disc(this.eventMouseUp);
+disc(this.eventMouseMove);
+disc(this.eventKeypress);
+}
+},activate:function(_77a){
+window.focus();
+this.activeDraggable=_77a;
+},deactivate:function(){
+this.activeDraggable=null;
+},updateDrag:function(_77b){
+if(!this.activeDraggable){
+return;
+}
+var _77c=_77b.mouse();
+if(this._lastPointer&&(MochiKit.Base.repr(this._lastPointer.page)==MochiKit.Base.repr(_77c.page))){
+return;
+}
+this._lastPointer=_77c;
+this.activeDraggable.updateDrag(_77b,_77c);
+},endDrag:function(_77d){
+if(!this.activeDraggable){
+return;
+}
+this._lastPointer=null;
+this.activeDraggable.endDrag(_77d);
+this.activeDraggable=null;
+},keyPress:function(_77e){
+if(this.activeDraggable){
+this.activeDraggable.keyPress(_77e);
+}
+},notify:function(_77f,_780,_781){
+MochiKit.Signal.signal(this,_77f,_780,_781);
+}};
+MochiKit.DragAndDrop.Draggable=function(_782,_783){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_782,_783);
+}
+this.__init__(_782,_783);
+};
+MochiKit.DragAndDrop.Draggable.prototype={__class__:MochiKit.DragAndDrop.Draggable,__init__:function(_785,_786){
+var v=MochiKit.Visual;
+var b=MochiKit.Base;
+_786=b.update({handle:false,starteffect:function(_789){
+this._savedOpacity=MochiKit.Style.getStyle(_789,"opacity")||1;
+new v.Opacity(_789,{duration:0.2,from:this._savedOpacity,to:0.7});
+},reverteffect:function(_78a,_78b,_78c){
+var dur=Math.sqrt(Math.abs(_78b^2)+Math.abs(_78c^2))*0.02;
+return new v.Move(_78a,{x:-_78c,y:-_78b,duration:dur});
+},endeffect:function(_78e){
+new v.Opacity(_78e,{duration:0.2,from:0.7,to:this._savedOpacity});
+},onchange:b.noop,zindex:1000,revert:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false},_786);
+var d=MochiKit.DOM;
+this.element=d.getElement(_785);
+if(_786.handle&&(typeof (_786.handle)=="string")){
+this.handle=d.getFirstElementByTagAndClassName(null,_786.handle,this.element);
+}
+if(!this.handle){
+this.handle=d.getElement(_786.handle);
+}
+if(!this.handle){
+this.handle=this.element;
+}
+if(_786.scroll&&!_786.scroll.scrollTo&&!_786.scroll.outerHTML){
+_786.scroll=d.getElement(_786.scroll);
+this._isScrollChild=MochiKit.DOM.isChildNode(this.element,_786.scroll);
+}
+MochiKit.Style.makePositioned(this.element);
+this.delta=this.currentDelta();
+this.options=_786;
+this.dragging=false;
+this.eventMouseDown=MochiKit.Signal.connect(this.handle,"onmousedown",this,this.initDrag);
+MochiKit.DragAndDrop.Draggables.register(this);
+},destroy:function(){
+MochiKit.Signal.disconnect(this.eventMouseDown);
+MochiKit.DragAndDrop.Draggables.unregister(this);
+},currentDelta:function(){
+var s=MochiKit.Style.getStyle;
+return [parseInt(s(this.element,"left")||"0"),parseInt(s(this.element,"top")||"0")];
+},initDrag:function(_791){
+if(!_791.mouse().button.left){
+return;
+}
+var src=_791.target();
+var _793=(src.tagName||"").toUpperCase();
+if(_793==="INPUT"||_793==="SELECT"||_793==="OPTION"||_793==="BUTTON"||_793==="TEXTAREA"){
+return;
+}
+if(this._revert){
+this._revert.cancel();
+this._revert=null;
+}
+var _794=_791.mouse();
+var pos=MochiKit.Position.cumulativeOffset(this.element);
+this.offset=[_794.page.x-pos.x,_794.page.y-pos.y];
+MochiKit.DragAndDrop.Draggables.activate(this);
+_791.stop();
+},startDrag:function(_796){
+this.dragging=true;
+if(this.options.selectclass){
+MochiKit.DOM.addElementClass(this.element,this.options.selectclass);
+}
+if(this.options.zindex){
+this.originalZ=parseInt(MochiKit.Style.getStyle(this.element,"z-index")||"0");
+this.element.style.zIndex=this.options.zindex;
+}
+if(this.options.ghosting){
+this._clone=this.element.cloneNode(true);
+this.ghostPosition=MochiKit.Position.absolutize(this.element);
+this.element.parentNode.insertBefore(this._clone,this.element);
+}
+if(this.options.scroll){
+if(this.options.scroll==window){
+var _797=this._getWindowScroll(this.options.scroll);
+this.originalScrollLeft=_797.left;
+this.originalScrollTop=_797.top;
+}else{
+this.originalScrollLeft=this.options.scroll.scrollLeft;
+this.originalScrollTop=this.options.scroll.scrollTop;
+}
+}
+MochiKit.DragAndDrop.Droppables.prepare(this.element);
+MochiKit.DragAndDrop.Draggables.notify("start",this,_796);
+if(this.options.starteffect){
+this.options.starteffect(this.element);
+}
+},updateDrag:function(_798,_799){
+if(!this.dragging){
+this.startDrag(_798);
+}
+MochiKit.Position.prepare();
+MochiKit.DragAndDrop.Droppables.show(_799,this.element);
+MochiKit.DragAndDrop.Draggables.notify("drag",this,_798);
+this.draw(_799);
+this.options.onchange(this);
+if(this.options.scroll){
+this.stopScrolling();
+var p,q;
+if(this.options.scroll==window){
+var s=this._getWindowScroll(this.options.scroll);
+p=new MochiKit.Style.Coordinates(s.left,s.top);
+q=new MochiKit.Style.Coordinates(s.left+s.width,s.top+s.height);
+}else{
+p=MochiKit.Position.page(this.options.scroll);
+p.x+=this.options.scroll.scrollLeft;
+p.y+=this.options.scroll.scrollTop;
+p.x+=(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0);
+p.y+=(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);
+q=new MochiKit.Style.Coordinates(p.x+this.options.scroll.offsetWidth,p.y+this.options.scroll.offsetHeight);
+}
+var _79d=[0,0];
+if(_799.page.x>(q.x-this.options.scrollSensitivity)){
+_79d[0]=_799.page.x-(q.x-this.options.scrollSensitivity);
+}else{
+if(_799.page.x<(p.x+this.options.scrollSensitivity)){
+_79d[0]=_799.page.x-(p.x+this.options.scrollSensitivity);
+}
+}
+if(_799.page.y>(q.y-this.options.scrollSensitivity)){
+_79d[1]=_799.page.y-(q.y-this.options.scrollSensitivity);
+}else{
+if(_799.page.y<(p.y+this.options.scrollSensitivity)){
+_79d[1]=_799.page.y-(p.y+this.options.scrollSensitivity);
+}
+}
+this.startScrolling(_79d);
+}
+if(/AppleWebKit/.test(navigator.appVersion)){
+window.scrollBy(0,0);
+}
+_798.stop();
+},finishDrag:function(_79e,_79f){
+var dr=MochiKit.DragAndDrop;
+this.dragging=false;
+if(this.options.selectclass){
+MochiKit.DOM.removeElementClass(this.element,this.options.selectclass);
+}
+if(this.options.ghosting){
+MochiKit.Position.relativize(this.element,this.ghostPosition);
+MochiKit.DOM.removeElement(this._clone);
+this._clone=null;
+}
+if(_79f){
+dr.Droppables.fire(_79e,this.element);
+}
+dr.Draggables.notify("end",this,_79e);
+var _7a1=this.options.revert;
+if(_7a1&&typeof (_7a1)=="function"){
+_7a1=_7a1(this.element);
+}
+var d=this.currentDelta();
+if(_7a1&&this.options.reverteffect){
+this._revert=this.options.reverteffect(this.element,d[1]-this.delta[1],d[0]-this.delta[0]);
+}else{
+this.delta=d;
+}
+if(this.options.zindex){
+this.element.style.zIndex=this.originalZ;
+}
+if(this.options.endeffect){
+this.options.endeffect(this.element);
+}
+dr.Draggables.deactivate();
+dr.Droppables.reset(this.element);
+},keyPress:function(_7a3){
+if(_7a3.key().string!="KEY_ESCAPE"){
+return;
+}
+this.finishDrag(_7a3,false);
+_7a3.stop();
+},endDrag:function(_7a4){
+if(!this.dragging){
+return;
+}
+this.stopScrolling();
+this.finishDrag(_7a4,true);
+_7a4.stop();
+},draw:function(_7a5){
+var pos=MochiKit.Position.cumulativeOffset(this.element);
+var d=this.currentDelta();
+pos.x-=d[0];
+pos.y-=d[1];
+if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){
+pos.x-=this.options.scroll.scrollLeft-this.originalScrollLeft;
+pos.y-=this.options.scroll.scrollTop-this.originalScrollTop;
+}
+var p=[_7a5.page.x-pos.x-this.offset[0],_7a5.page.y-pos.y-this.offset[1]];
+if(this.options.snap){
+if(typeof (this.options.snap)=="function"){
+p=this.options.snap(p[0],p[1]);
+}else{
+if(this.options.snap instanceof Array){
+var i=-1;
+p=MochiKit.Base.map(MochiKit.Base.bind(function(v){
+i+=1;
+return Math.round(v/this.options.snap[i])*this.options.snap[i];
+},this),p);
+}else{
+p=MochiKit.Base.map(MochiKit.Base.bind(function(v){
+return Math.round(v/this.options.snap)*this.options.snap;
+},this),p);
+}
+}
+}
+var _7ac=this.element.style;
+if((!this.options.constraint)||(this.options.constraint=="horizontal")){
+_7ac.left=p[0]+"px";
+}
+if((!this.options.constraint)||(this.options.constraint=="vertical")){
+_7ac.top=p[1]+"px";
+}
+if(_7ac.visibility=="hidden"){
+_7ac.visibility="";
+}
+},stopScrolling:function(){
+if(this.scrollInterval){
+clearInterval(this.scrollInterval);
+this.scrollInterval=null;
+MochiKit.DragAndDrop.Draggables._lastScrollPointer=null;
+}
+},startScrolling:function(_7ad){
+if(!_7ad[0]&&!_7ad[1]){
+return;
+}
+this.scrollSpeed=[_7ad[0]*this.options.scrollSpeed,_7ad[1]*this.options.scrollSpeed];
+this.lastScrolled=new Date();
+this.scrollInterval=setInterval(MochiKit.Base.bind(this.scroll,this),10);
+},scroll:function(){
+var _7ae=new Date();
+var _7af=_7ae-this.lastScrolled;
+this.lastScrolled=_7ae;
+if(this.options.scroll==window){
+var s=this._getWindowScroll(this.options.scroll);
+if(this.scrollSpeed[0]||this.scrollSpeed[1]){
+var dm=_7af/1000;
+this.options.scroll.scrollTo(s.left+dm*this.scrollSpeed[0],s.top+dm*this.scrollSpeed[1]);
+}
+}else{
+this.options.scroll.scrollLeft+=this.scrollSpeed[0]*_7af/1000;
+this.options.scroll.scrollTop+=this.scrollSpeed[1]*_7af/1000;
+}
+var d=MochiKit.DragAndDrop;
+MochiKit.Position.prepare();
+d.Droppables.show(d.Draggables._lastPointer,this.element);
+d.Draggables.notify("drag",this);
+if(this._isScrollChild){
+d.Draggables._lastScrollPointer=d.Draggables._lastScrollPointer||d.Draggables._lastPointer;
+d.Draggables._lastScrollPointer.x+=this.scrollSpeed[0]*_7af/1000;
+d.Draggables._lastScrollPointer.y+=this.scrollSpeed[1]*_7af/1000;
+if(d.Draggables._lastScrollPointer.x<0){
+d.Draggables._lastScrollPointer.x=0;
+}
+if(d.Draggables._lastScrollPointer.y<0){
+d.Draggables._lastScrollPointer.y=0;
+}
+this.draw(d.Draggables._lastScrollPointer);
+}
+this.options.onchange(this);
+},_getWindowScroll:function(win){
+var vp,w,h;
+MochiKit.DOM.withWindow(win,function(){
+vp=MochiKit.Style.getViewportPosition(win.document);
+});
+if(win.innerWidth){
+w=win.innerWidth;
+h=win.innerHeight;
+}else{
+if(win.document.documentElement&&win.document.documentElement.clientWidth){
+w=win.document.documentElement.clientWidth;
+h=win.document.documentElement.clientHeight;
+}else{
+w=win.document.body.offsetWidth;
+h=win.document.body.offsetHeight;
+}
+}
+return {top:vp.y,left:vp.x,width:w,height:h};
+},repr:function(){
+return "["+this.__class__.NAME+", options:"+MochiKit.Base.repr(this.options)+"]";
+}};
+MochiKit.DragAndDrop.__new__=function(){
+MochiKit.Base.nameFunctions(this);
+this.EXPORT_TAGS={":common":this.EXPORT,":all":MochiKit.Base.concat(this.EXPORT,this.EXPORT_OK)};
+};
+MochiKit.DragAndDrop.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.DragAndDrop);
+MochiKit.Base._deps("Sortable",["Base","Iter","DOM","Position","DragAndDrop"]);
+MochiKit.Sortable.NAME="MochiKit.Sortable";
+MochiKit.Sortable.VERSION="1.4.2";
+MochiKit.Sortable.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.Sortable.toString=function(){
+return this.__repr__();
+};
+MochiKit.Sortable.EXPORT=[];
+MochiKit.Sortable.EXPORT_OK=[];
+MochiKit.Base.update(MochiKit.Sortable,{sortables:{},_findRootElement:function(_7b7){
+while(_7b7.tagName.toUpperCase()!="BODY"){
+if(_7b7.id&&MochiKit.Sortable.sortables[_7b7.id]){
+return _7b7;
+}
+_7b7=_7b7.parentNode;
+}
+},_createElementId:function(_7b8){
+if(_7b8.id==null||_7b8.id==""){
+var d=MochiKit.DOM;
+var id;
+var _7bb=1;
+while(d.getElement(id="sortable"+_7bb)!=null){
+_7bb+=1;
+}
+d.setNodeAttribute(_7b8,"id",id);
+}
+},options:function(_7bc){
+_7bc=MochiKit.Sortable._findRootElement(MochiKit.DOM.getElement(_7bc));
+if(!_7bc){
+return;
+}
+return MochiKit.Sortable.sortables[_7bc.id];
+},destroy:function(_7bd){
+var s=MochiKit.Sortable.options(_7bd);
+var b=MochiKit.Base;
+var d=MochiKit.DragAndDrop;
+if(s){
+MochiKit.Signal.disconnect(s.startHandle);
+MochiKit.Signal.disconnect(s.endHandle);
+b.map(function(dr){
+d.Droppables.remove(dr);
+},s.droppables);
+b.map(function(dr){
+dr.destroy();
+},s.draggables);
+delete MochiKit.Sortable.sortables[s.element.id];
+}
+},create:function(_7c3,_7c4){
+_7c3=MochiKit.DOM.getElement(_7c3);
+var self=MochiKit.Sortable;
+self._createElementId(_7c3);
+_7c4=MochiKit.Base.update({element:_7c3,tag:"li",dropOnEmpty:false,tree:false,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:[_7c3],handle:false,only:false,hoverclass:null,ghosting:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:/^[^_]*_(.*)$/,onChange:MochiKit.Base.noop,onUpdate:MochiKit.Base.noop,accept:null},_7c4);
+self.destroy(_7c3);
+var _7c6={revert:true,ghosting:_7c4.ghosting,scroll:_7c4.scroll,scrollSensitivity:_7c4.scrollSensitivity,scrollSpeed:_7c4.scrollSpeed,constraint:_7c4.constraint,handle:_7c4.handle};
+if(_7c4.starteffect){
+_7c6.starteffect=_7c4.starteffect;
+}
+if(_7c4.reverteffect){
+_7c6.reverteffect=_7c4.reverteffect;
+}else{
+if(_7c4.ghosting){
+_7c6.reverteffect=function(_7c7){
+_7c7.style.top=0;
+_7c7.style.left=0;
+};
+}
+}
+if(_7c4.endeffect){
+_7c6.endeffect=_7c4.endeffect;
+}
+if(_7c4.zindex){
+_7c6.zindex=_7c4.zindex;
+}
+var _7c8={overlap:_7c4.overlap,containment:_7c4.containment,hoverclass:_7c4.hoverclass,onhover:self.onHover,tree:_7c4.tree,accept:_7c4.accept};
+var _7c9={onhover:self.onEmptyHover,overlap:_7c4.overlap,containment:_7c4.containment,hoverclass:_7c4.hoverclass,accept:_7c4.accept};
+MochiKit.DOM.removeEmptyTextNodes(_7c3);
+_7c4.draggables=[];
+_7c4.droppables=[];
+if(_7c4.dropOnEmpty||_7c4.tree){
+new MochiKit.DragAndDrop.Droppable(_7c3,_7c9);
+_7c4.droppables.push(_7c3);
+}
+MochiKit.Base.map(function(e){
+var _7cb=_7c4.handle?MochiKit.DOM.getFirstElementByTagAndClassName(null,_7c4.handle,e):e;
+_7c4.draggables.push(new MochiKit.DragAndDrop.Draggable(e,MochiKit.Base.update(_7c6,{handle:_7cb})));
+new MochiKit.DragAndDrop.Droppable(e,_7c8);
+if(_7c4.tree){
+e.treeNode=_7c3;
+}
+_7c4.droppables.push(e);
+},(self.findElements(_7c3,_7c4)||[]));
+if(_7c4.tree){
+MochiKit.Base.map(function(e){
+new MochiKit.DragAndDrop.Droppable(e,_7c9);
+e.treeNode=_7c3;
+_7c4.droppables.push(e);
+},(self.findTreeElements(_7c3,_7c4)||[]));
+}
+self.sortables[_7c3.id]=_7c4;
+_7c4.lastValue=self.serialize(_7c3);
+_7c4.startHandle=MochiKit.Signal.connect(MochiKit.DragAndDrop.Draggables,"start",MochiKit.Base.partial(self.onStart,_7c3));
+_7c4.endHandle=MochiKit.Signal.connect(MochiKit.DragAndDrop.Draggables,"end",MochiKit.Base.partial(self.onEnd,_7c3));
+},onStart:function(_7cd,_7ce){
+var self=MochiKit.Sortable;
+var _7d0=self.options(_7cd);
+_7d0.lastValue=self.serialize(_7d0.element);
+},onEnd:function(_7d1,_7d2){
+var self=MochiKit.Sortable;
+self.unmark();
+var _7d4=self.options(_7d1);
+if(_7d4.lastValue!=self.serialize(_7d4.element)){
+_7d4.onUpdate(_7d4.element);
+}
+},findElements:function(_7d5,_7d6){
+return MochiKit.Sortable.findChildren(_7d5,_7d6.only,_7d6.tree,_7d6.tag);
+},findTreeElements:function(_7d7,_7d8){
+return MochiKit.Sortable.findChildren(_7d7,_7d8.only,_7d8.tree?true:false,_7d8.treeTag);
+},findChildren:function(_7d9,only,_7db,_7dc){
+if(!_7d9.hasChildNodes()){
+return null;
+}
+_7dc=_7dc.toUpperCase();
+if(only){
+only=MochiKit.Base.flattenArray([only]);
+}
+var _7dd=[];
+MochiKit.Base.map(function(e){
+if(e.tagName&&e.tagName.toUpperCase()==_7dc&&(!only||MochiKit.Iter.some(only,function(c){
+return MochiKit.DOM.hasElementClass(e,c);
+}))){
+_7dd.push(e);
+}
+if(_7db){
+var _7e0=MochiKit.Sortable.findChildren(e,only,_7db,_7dc);
+if(_7e0&&_7e0.length>0){
+_7dd=_7dd.concat(_7e0);
+}
+}
+},_7d9.childNodes);
+return _7dd;
+},onHover:function(_7e1,_7e2,_7e3){
+if(MochiKit.DOM.isChildNode(_7e2,_7e1)){
+return;
+}
+var self=MochiKit.Sortable;
+if(_7e3>0.33&&_7e3<0.66&&self.options(_7e2).tree){
+return;
+}else{
+if(_7e3>0.5){
+self.mark(_7e2,"before");
+if(_7e2.previousSibling!=_7e1){
+var _7e5=_7e1.parentNode;
+_7e1.style.visibility="hidden";
+_7e2.parentNode.insertBefore(_7e1,_7e2);
+if(_7e2.parentNode!=_7e5){
+self.options(_7e5).onChange(_7e1);
+}
+self.options(_7e2.parentNode).onChange(_7e1);
+}
+}else{
+self.mark(_7e2,"after");
+var _7e6=_7e2.nextSibling||null;
+if(_7e6!=_7e1){
+var _7e5=_7e1.parentNode;
+_7e1.style.visibility="hidden";
+_7e2.parentNode.insertBefore(_7e1,_7e6);
+if(_7e2.parentNode!=_7e5){
+self.options(_7e5).onChange(_7e1);
+}
+self.options(_7e2.parentNode).onChange(_7e1);
+}
+}
+}
+},_offsetSize:function(_7e7,type){
+if(type=="vertical"||type=="height"){
+return _7e7.offsetHeight;
+}else{
+return _7e7.offsetWidth;
+}
+},onEmptyHover:function(_7e9,_7ea,_7eb){
+var _7ec=_7e9.parentNode;
+var self=MochiKit.Sortable;
+var _7ee=self.options(_7ea);
+if(!MochiKit.DOM.isChildNode(_7ea,_7e9)){
+var _7ef;
+var _7f0=self.findElements(_7ea,{tag:_7ee.tag,only:_7ee.only});
+var _7f1=null;
+if(_7f0){
+var _7f2=self._offsetSize(_7ea,_7ee.overlap)*(1-_7eb);
+for(_7ef=0;_7ef<_7f0.length;_7ef+=1){
+if(_7f2-self._offsetSize(_7f0[_7ef],_7ee.overlap)>=0){
+_7f2-=self._offsetSize(_7f0[_7ef],_7ee.overlap);
+}else{
+if(_7f2-(self._offsetSize(_7f0[_7ef],_7ee.overlap)/2)>=0){
+_7f1=_7ef+1<_7f0.length?_7f0[_7ef+1]:null;
+break;
+}else{
+_7f1=_7f0[_7ef];
+break;
+}
+}
+}
+}
+_7ea.insertBefore(_7e9,_7f1);
+self.options(_7ec).onChange(_7e9);
+_7ee.onChange(_7e9);
+}
+},unmark:function(){
+var m=MochiKit.Sortable._marker;
+if(m){
+MochiKit.Style.hideElement(m);
+}
+},mark:function(_7f4,_7f5){
+var d=MochiKit.DOM;
+var self=MochiKit.Sortable;
+var _7f8=self.options(_7f4.parentNode);
+if(_7f8&&!_7f8.ghosting){
+return;
+}
+if(!self._marker){
+self._marker=d.getElement("dropmarker")||document.createElement("DIV");
+MochiKit.Style.hideElement(self._marker);
+d.addElementClass(self._marker,"dropmarker");
+self._marker.style.position="absolute";
+document.getElementsByTagName("body").item(0).appendChild(self._marker);
+}
+var _7f9=MochiKit.Position.cumulativeOffset(_7f4);
+self._marker.style.left=_7f9.x+"px";
+self._marker.style.top=_7f9.y+"px";
+if(_7f5=="after"){
+if(_7f8.overlap=="horizontal"){
+self._marker.style.left=(_7f9.x+_7f4.clientWidth)+"px";
+}else{
+self._marker.style.top=(_7f9.y+_7f4.clientHeight)+"px";
+}
+}
+MochiKit.Style.showElement(self._marker);
+},_tree:function(_7fa,_7fb,_7fc){
+var self=MochiKit.Sortable;
+var _7fe=self.findElements(_7fa,_7fb)||[];
+for(var i=0;i<_7fe.length;++i){
+var _800=_7fe[i].id.match(_7fb.format);
+if(!_800){
+continue;
+}
+var _801={id:encodeURIComponent(_800?_800[1]:null),element:_7fa,parent:_7fc,children:[],position:_7fc.children.length,container:self._findChildrenElement(_7fe[i],_7fb.treeTag.toUpperCase())};
+if(_801.container){
+self._tree(_801.container,_7fb,_801);
+}
+_7fc.children.push(_801);
+}
+return _7fc;
+},_findChildrenElement:function(_802,_803){
+if(_802&&_802.hasChildNodes){
+_803=_803.toUpperCase();
+for(var i=0;i<_802.childNodes.length;++i){
+if(_802.childNodes[i].tagName.toUpperCase()==_803){
+return _802.childNodes[i];
+}
+}
+}
+return null;
+},tree:function(_805,_806){
+_805=MochiKit.DOM.getElement(_805);
+var _807=MochiKit.Sortable.options(_805);
+_806=MochiKit.Base.update({tag:_807.tag,treeTag:_807.treeTag,only:_807.only,name:_805.id,format:_807.format},_806||{});
+var root={id:null,parent:null,children:new Array,container:_805,position:0};
+return MochiKit.Sortable._tree(_805,_806,root);
+},setSequence:function(_809,_80a,_80b){
+var self=MochiKit.Sortable;
+var b=MochiKit.Base;
+_809=MochiKit.DOM.getElement(_809);
+_80b=b.update(self.options(_809),_80b||{});
+var _80e={};
+b.map(function(n){
+var m=n.id.match(_80b.format);
+if(m){
+_80e[m[1]]=[n,n.parentNode];
+}
+n.parentNode.removeChild(n);
+},self.findElements(_809,_80b));
+b.map(function(_811){
+var n=_80e[_811];
+if(n){
+n[1].appendChild(n[0]);
+delete _80e[_811];
+}
+},_80a);
+},_constructIndex:function(node){
+var _814="";
+do{
+if(node.id){
+_814="["+node.position+"]"+_814;
+}
+}while((node=node.parent)!=null);
+return _814;
+},sequence:function(_815,_816){
+_815=MochiKit.DOM.getElement(_815);
+var self=MochiKit.Sortable;
+var _816=MochiKit.Base.update(self.options(_815),_816||{});
+return MochiKit.Base.map(function(item){
+return item.id.match(_816.format)?item.id.match(_816.format)[1]:"";
+},MochiKit.DOM.getElement(self.findElements(_815,_816)||[]));
+},serialize:function(_819,_81a){
+_819=MochiKit.DOM.getElement(_819);
+var self=MochiKit.Sortable;
+_81a=MochiKit.Base.update(self.options(_819),_81a||{});
+var name=encodeURIComponent(_81a.name||_819.id);
+if(_81a.tree){
+return MochiKit.Base.flattenArray(MochiKit.Base.map(function(item){
+return [name+self._constructIndex(item)+"[id]="+encodeURIComponent(item.id)].concat(item.children.map(arguments.callee));
+},self.tree(_819,_81a).children)).join("&");
+}else{
+return MochiKit.Base.map(function(item){
+return name+"[]="+encodeURIComponent(item);
+},self.sequence(_819,_81a)).join("&");
+}
+}});
+MochiKit.Sortable.Sortable=MochiKit.Sortable;
+MochiKit.Sortable.__new__=function(){
+MochiKit.Base.nameFunctions(this);
+this.EXPORT_TAGS={":common":this.EXPORT,":all":MochiKit.Base.concat(this.EXPORT,this.EXPORT_OK)};
+};
+MochiKit.Sortable.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.Sortable);
+if(typeof (MochiKit)=="undefined"){
+MochiKit={};
+}
+if(typeof (MochiKit.MochiKit)=="undefined"){
+MochiKit.MochiKit={};
+}
+MochiKit.MochiKit.NAME="MochiKit.MochiKit";
+MochiKit.MochiKit.VERSION="1.4.2";
+MochiKit.MochiKit.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.MochiKit.toString=function(){
+return this.__repr__();
+};
+MochiKit.MochiKit.SUBMODULES=["Base","Iter","Logging","DateTime","Format","Async","DOM","Selector","Style","LoggingPane","Color","Signal","Position","Visual","DragAndDrop","Sortable"];
+if(typeof (JSAN)!="undefined"||typeof (dojo)!="undefined"){
+if(typeof (dojo)!="undefined"){
+dojo.provide("MochiKit.MochiKit");
+(function(lst){
+for(var i=0;i<lst.length;i++){
+dojo.require("MochiKit."+lst[i]);
+}
+})(MochiKit.MochiKit.SUBMODULES);
+}
+if(typeof (JSAN)!="undefined"){
+(function(lst){
+for(var i=0;i<lst.length;i++){
+JSAN.use("MochiKit."+lst[i],[]);
+}
+})(MochiKit.MochiKit.SUBMODULES);
+}
+(function(){
+var _823=MochiKit.Base.extend;
+var self=MochiKit.MochiKit;
+var _825=self.SUBMODULES;
+var _826=[];
+var _827=[];
+var _828={};
+var i,k,m,all;
+for(i=0;i<_825.length;i++){
+m=MochiKit[_825[i]];
+_823(_826,m.EXPORT);
+_823(_827,m.EXPORT_OK);
+for(k in m.EXPORT_TAGS){
+_828[k]=_823(_828[k],m.EXPORT_TAGS[k]);
+}
+all=m.EXPORT_TAGS[":all"];
+if(!all){
+all=_823(null,m.EXPORT,m.EXPORT_OK);
+}
+var j;
+for(j=0;j<all.length;j++){
+k=all[j];
+self[k]=m[k];
+}
+}
+self.EXPORT=_826;
+self.EXPORT_OK=_827;
+self.EXPORT_TAGS=_828;
+}());
+}else{
+if(typeof (MochiKit.__compat__)=="undefined"){
+MochiKit.__compat__=true;
+}
+(function(){
+if(typeof (document)=="undefined"){
+return;
+}
+var _82e=document.getElementsByTagName("script");
+var _82f="http://www.w3.org/1999/xhtml";
+var _830="http://www.w3.org/2000/svg";
+var _831="http://www.w3.org/1999/xlink";
+var _832="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
+var base=null;
+var _834=null;
+var _835={};
+var i;
+var src;
+for(i=0;i<_82e.length;i++){
+src=null;
+switch(_82e[i].namespaceURI){
+case _830:
+src=_82e[i].getAttributeNS(_831,"href");
+break;
+default:
+src=_82e[i].getAttribute("src");
+break;
+}
+if(!src){
+continue;
+}
+_835[src]=true;
+if(src.match(/MochiKit.js(\?.*)?$/)){
+base=src.substring(0,src.lastIndexOf("MochiKit.js"));
+_834=_82e[i];
+}
+}
+if(base===null){
+return;
+}
+var _838=MochiKit.MochiKit.SUBMODULES;
+for(var i=0;i<_838.length;i++){
+if(MochiKit[_838[i]]){
+continue;
+}
+var uri=base+_838[i]+".js";
+if(uri in _835){
+continue;
+}
+if(_834.namespaceURI==_830||_834.namespaceURI==_832){
+var s=document.createElementNS(_834.namespaceURI,"script");
+s.setAttribute("id","MochiKit_"+base+_838[i]);
+if(_834.namespaceURI==_830){
+s.setAttributeNS(_831,"href",uri);
+}else{
+s.setAttribute("src",uri);
+}
+s.setAttribute("type","application/x-javascript");
+_834.parentNode.appendChild(s);
+}else{
+document.write("<"+_834.nodeName+" src=\""+uri+"\" type=\"text/javascript\"><\/script>");
+}
+}
+})();
+}
+</script>
+
+
+<script id="pipio" type="x">
+var G_INCOMPAT = false;function GScript(src) {document.write('<' + 'script src="' + src + '"' +' type="text/javascript"><' + '/script>');}function GBrowserIsCompatible() {if (G_INCOMPAT) return false;return true;}function GApiInit() {if (GApiInit.called) return;GApiInit.called = true;window.GAddMessages && GAddMessages({160: '\x3cH1\x3eServer Error\x3c/H1\x3eThe server encountered a temporary error and could not complete your request.\x3cp\x3ePlease try again in a minute or so.\x3c/p\x3e',1415: '.',1416: ',',1547: 'mi',1616: 'km',4100: 'm',4101: 'ft',10018: 'Loading...',10021: 'Zoom In',10022: 'Zoom Out',10024: 'Drag to zoom',10029: 'Return to the last result',10049: 'Map',10050: 'Satellite',10093: 'Terms of Use',10111: 'Map',10112: 'Sat',10116: 'Hybrid',10117: 'Hyb',10120: 'We are sorry, but we don\x27t have maps at this zoom level for this region.\x3cp\x3eTry zooming out for a broader look.\x3c/p\x3e',10121: 'We are sorry, but we don\x27t have imagery at this zoom level for this region.\x3cp\x3eTry zooming out for a broader look.\x3c/p\x3e',10507: 'Pan left',10508: 'Pan right',10509: 'Pan up',10510: 'Pan down',10511: 'Show street map',10512: 'Show satellite imagery',10513: 'Show imagery with street names',10806: 'Click to see this area on Google Maps',10807: 'Traffic',10808: 'Show Traffic',10809: 'Hide Traffic',12150: '%1$s on %2$s',12151: '%1$s on %2$s at %3$s',12152: '%1$s on %2$s between %3$s and %4$s',10985: 'Zoom in',10986: 'Zoom out',11047: 'Center map here',11089: '\x3ca href\x3d\x22javascript:void(0);\x22\x3eZoom In\x3c/a\x3e to see traffic for this region',11259: 'Full-screen',11751: 'Show street map with terrain',11752: 'Style:',11757: 'Change map style',11758: 'Terrain',11759: 'Ter',11794: 'Show labels',11303: 'Street View Help',11274: 'To use street view, you need Adobe Flash Player version %1$d or newer.',11382: 'Get the latest Flash Player.',11314: 'We\x27re sorry, street view is currently unavailable due to high demand.\x3cbr\x3ePlease try again later!',1559: 'N',1560: 'S',1561: 'W',1562: 'E',1608: 'NW',1591: 'NE',1605: 'SW',1606: 'SE',11907: 'This image is no longer available',10041: 'Help',12471: 'Current Location',12492: 'Earth',12823: 'Google has disabled usage of the Maps API for this application. See the Terms of Service for more information: %1$s.',12822: 'http://code.google.com/apis/maps/terms.html',12915: 'Improve the map',12916: 'Google, Europa Technologies',13171: 'Hybrid 3D',0: ''});}var GLoad;(function() {var jslinker={version:"182",jsbinary:[{id:"maps2",url:"http://maps.gstatic.com/intl/en_us/mapfiles/193c/maps2/main.js"},{id:"maps2.api",url:"http://maps.gstatic.com/intl/en_us/mapfiles/193c/maps2.api/main.js"},{id:"gc",url:"http://maps.gstatic.com/intl/en_us/mapfiles/193c/gc.js"},{id:"suggest",url:"http://maps.gstatic.com/intl/en_us/mapfiles/193c/suggest/main.js"},{id:"pphov",url:"http://maps.gstatic.com/intl/en_us/mapfiles/193c/pphov.js"}]};GLoad = function(callback) {var callee = arguments.callee;var apiCallback = callback;GApiInit();var opts = {public_api:true,export_legacy_names:true,tile_override:[{maptype:0,min_zoom:7,max_zoom:7,rect:[{lo:{lat_e7:330000000,lng_e7:1246050000},hi:{lat_e7:386200000,lng_e7:1293600000}},{lo:{lat_e7:366500000,lng_e7:1297000000},hi:{lat_e7:386200000,lng_e7:1320034790}}],uris:["http://mt0.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26","http://mt1.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26","http://mt2.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26","http://mt3.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26"],mapprint_url:"http://www.gmaptiles.co.kr/mapprint"},{maptype:0,min_zoom:8,max_zoom:9,rect:[{lo:{lat_e7:330000000,lng_e7:1246050000},hi:{lat_e7:386200000,lng_e7:1279600000}},{lo:{lat_e7:345000000,lng_e7:1279600000},hi:{lat_e7:386200000,lng_e7:1286700000}},{lo:{lat_e7:348900000,lng_e7:1286700000},hi:{lat_e7:386200000,lng_e7:1293600000}},{lo:{lat_e7:354690000,lng_e7:1293600000},hi:{lat_e7:386200000,lng_e7:1320034790}}],uris:["http://mt0.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26","http://mt1.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26","http://mt2.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26","http://mt3.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26"],mapprint_url:"http://www.gmaptiles.co.kr/mapprint"},{maptype:0,min_zoom:10,max_zoom:19,rect:[{lo:{lat_e7:329890840,lng_e7:1246055600},hi:{lat_e7:386930130,lng_e7:1284960940}},{lo:{lat_e7:344646740,lng_e7:1284960940},hi:{lat_e7:386930130,lng_e7:1288476560}},{lo:{lat_e7:350277470,lng_e7:1288476560},hi:{lat_e7:386930130,lng_e7:1310531620}},{lo:{lat_e7:370277730,lng_e7:1310531620},hi:{lat_e7:386930130,lng_e7:1320034790}}],uris:["http://mt0.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26","http://mt1.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26","http://mt2.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26","http://mt3.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26"],mapprint_url:"http://www.gmaptiles.co.kr/mapprint"},{maptype:3,min_zoom:7,max_zoom:7,rect:[{lo:{lat_e7:330000000,lng_e7:1246050000},hi:{lat_e7:386200000,lng_e7:1293600000}},{lo:{lat_e7:366500000,lng_e7:1297000000},hi:{lat_e7:386200000,lng_e7:1320034790}}],uris:["http://mt0.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26","http://mt1.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26","http://mt2.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26","http://mt3.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26"]},{maptype:3,min_zoom:8,max_zoom:9,rect:[{lo:{lat_e7:330000000,lng_e7:1246050000},hi:{lat_e7:386200000,lng_e7:1279600000}},{lo:{lat_e7:345000000,lng_e7:1279600000},hi:{lat_e7:386200000,lng_e7:1286700000}},{lo:{lat_e7:348900000,lng_e7:1286700000},hi:{lat_e7:386200000,lng_e7:1293600000}},{lo:{lat_e7:354690000,lng_e7:1293600000},hi:{lat_e7:386200000,lng_e7:1320034790}}],uris:["http://mt0.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26","http://mt1.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26","http://mt2.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26","http://mt3.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26"]},{maptype:3,min_zoom:10,rect:[{lo:{lat_e7:329890840,lng_e7:1246055600},hi:{lat_e7:386930130,lng_e7:1284960940}},{lo:{lat_e7:344646740,lng_e7:1284960940},hi:{lat_e7:386930130,lng_e7:1288476560}},{lo:{lat_e7:350277470,lng_e7:1288476560},hi:{lat_e7:386930130,lng_e7:1310531620}},{lo:{lat_e7:370277730,lng_e7:1310531620},hi:{lat_e7:386930130,lng_e7:1320034790}}],uris:["http://mt0.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26","http://mt1.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26","http://mt2.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26","http://mt3.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26"]}],jsmain:"http://maps.gstatic.com/intl/en_us/mapfiles/193c/maps2.api/main.js",sensor:"false",log_info_window_ratio:0.0099999997764825821,log_fragment_count:10,log_fragment_seed:1,obliques_urls:["http://khmdb0.google.com/kh?v=25\x26","http://khmdb1.google.com/kh?v=25\x26"],token:3404841739,jsmodule_base_url:"http://maps.gstatic.com/intl/en_us/mapfiles/193c/maps2.api",transit_allowed:false,generic_tile_urls:["http://mt0.google.com/vt?hl=en\x26src=api\x26","http://mt1.google.com/vt?hl=en\x26src=api\x26"]};var pageArgs = {};apiCallback(["http://mt0.google.com/vt/lyrs\x3dm@118\x26hl\x3den\x26src\x3dapi\x26","http://mt1.google.com/vt/lyrs\x3dm@118\x26hl\x3den\x26src\x3dapi\x26"], ["http://khm0.google.com/kh/v\x3d56\x26","http://khm1.google.com/kh/v\x3d56\x26"], ["http://mt0.google.com/vt/lyrs\x3dh@118\x26hl\x3den\x26src\x3dapi\x26","http://mt1.google.com/vt/lyrs\x3dh@118\x26hl\x3den\x26src\x3dapi\x26"],"ABQIAAAALwQiU3peqAXUIcejQciDOhQxPI_3sheoXqkznc--aWwZLihkTxQfCzOEVRK5IMcDZ5VBKRhkCfrTzg","","",true,"google.maps.",opts,["http://mt0.google.com/vt/v\x3dapp.118\x26hl\x3den\x26src\x3dapi\x26","http://mt1.google.com/vt/v\x3dapp.118\x26hl\x3den\x26src\x3dapi\x26"],jslinker,pageArgs);if (!callee.called) {callee.called = true;}}})();function GUnload() {if (window.GUnloadApi) {GUnloadApi();}}var _mIsRtl = false;var _mF = [ ,,false,,,20,4096,"bounds_cippppt.txt","cities_cippppt.txt","local/add/flagStreetView",true,,400,,,,,,,"/maps/c/ui/HovercardLauncher/dommanifest.js",,,,false,false,,,,,,true,,,,,,,,"http://maps.google.com/maps/stk/fetch",0,,true,,,,true,,,,"http://maps.google.com/maps/stk/style",,"107485602240773805043.00043dadc95ca3874f1fa",,,false,1000,,"http://cbk0.google.com",false,,"ar,iw",,,,,,,,,"http://pagead2.googlesyndication.com/pagead/imgad?id\x3dCMKp3NaV5_mE1AEQEBgQMgieroCd6vHEKA",,,false,false,,false,,,,,"SS","en,fr,ja",,,,,,,true,,,false,,,true,,,,,"","1",,false,false,,false,,,,"AU,BE,FR,NZ,US",,,false,true,500,"http://chart.apis.google.com/chart?cht\x3dqr\x26chs\x3d80x80\x26chld\x3d|0\x26chl\x3d",,,,true,,,,,false,,,false,false,true,,,true,,,,,,,,10,,true,true,,,false,30,"infowindow_v1","",false,true,22,'http://khm.google.com/vt/lbw/lyrs\x3dm\x26hl\x3den\x26','http://khm.google.com/vt/lbw/lyrs\x3ds\x26hl\x3den\x26','http://khm.google.com/vt/lbw/lyrs\x3dy\x26hl\x3den\x26','http://khm.google.com/vt/lbw/lyrs\x3dp\x26hl\x3den\x26',,,false,"US,AU,NZ,FR,DK,MX,BE,CA,DE,GB,IE,PR,PT,RU,SG,JM,HK,TW,MY,TH,AT,CZ,CN,IN,KR",,,"windows-ie,windows-firefox,windows-chrome,macos-safari,macos-firefox",true,false,20000,600,30,,,,,,false,false,,,"maps.google.com",,,true,true,"",true,,false,,true,"4:http://gt%1$d.google.com/mt?v\x3dgwm.fresh\x26","4:http://gt%1$d.google.com/mt?v\x3dgwh.fresh\x26",true,false,false,,0.25,,"107485602240773805043.0004561b22ebdc3750300",false,,,,false,,,true,,8,,,,,false,"https://cbks0.google.com",false,true,,,,,,false,,,,,,,,false,,,true,true,false,,,,true,"http://mt0.google.com/vt/ft",false,,"http://chart.apis.google.com/chart",true,,,,,,'0.25',false,true,,,,false,,2,160,,,false,true,false,,,true,false,,,45,true,,false,true,true,,,,false,false,false,,false,false,,false,,false,false,true,true,,,false,true,false,false,false,true,,"DE,CH,LI,AT,BE,PL,NL,HU,GR,HR,CZ,SK,TR,BR,EE,ES,AD,SE,NO,DK,FI,IT,VA,SM,IL,CL,MX,AR,BG,PT",false,,"25",true,25,"Home for sale",,false,false,true,false,false,false,"4:https://gt%1$d.google.com/mt?v\x3dgwm.fresh\x26","4:https://gt%1$d.google.com/mt?v\x3dgwh.fresh\x26",,,,true,"",true,true,false,true,true,,,false,"1.x",false,false,false,,true,5000,false,true,,"US",true,true,false,true,false,false,false,24,6,2,false,true,0,false,false,false,false,false,false,false,false,false,true,false,false,true,false,false,"/maps/c",false ];var _mHost = "http://maps.google.com";var _mUri = "/maps";var _mDomain = "google.com";var _mStaticPath = "http://maps.gstatic.com/intl/en_us/mapfiles/";var _mRelativeStaticPath = "/intl/en_us/mapfiles/";var _mJavascriptVersion = G_API_VERSION = "193c";var _mTermsUrl = "http://www.google.com/intl/en_us/help/terms_maps.html";var _mLocalSearchUrl = "http://www.google.com/uds/solutions/localsearch/gmlocalsearch.js";var _mHL = "en";var _mGL = "us";var _mTrafficEnableApi = true;var _mTrafficTileServerUrls = ["http://mt0.google.com/mapstt","http://mt1.google.com/mapstt","http://mt2.google.com/mapstt","http://mt3.google.com/mapstt"];var _mTrafficCameraLayerIds = ["msid:103669521412303283270.000470c7965f9af525967","msid:111496436295867409379.00047329600bf6daab897"];var _mCityblockLatestFlashUrl = "http://maps.google.com/local_url?q=http://www.adobe.com/shockwave/download/download.cgi%3FP1_Prod_Version%3DShockwaveFlash&amp;dq=&amp;file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAALwQiU3peqAXUIcejQciDOhQxPI_3sheoXqkznc--aWwZLihkTxQfCzOEVRK5IMcDZ5VBKRhkCfrTzg&amp;s=ANYYN7manSNIV_th6k0SFvGB4jz36is1Gg";var _mCityblockFrogLogUsage = false;var _mCityblockInfowindowLogUsage = false;var _mCityblockDrivingDirectionsLogUsage =false;var _mCityblockPrintwindowLogUsage =false;var _mCityblockPrintwindowImpressionLogUsage =false;var _mCityblockUseSsl = false;var _mAddressBookUrl = "/maps?file\x3dapi\x26v\x3d2\x26sensor\x3dfalse\x26key\x3dABQIAAAALwQiU3peqAXUIcejQciDOhQxPI_3sheoXqkznc--aWwZLihkTxQfCzOEVRK5IMcDZ5VBKRhkCfrTzg\x26ie\x3dUTF8\x26hl\x3den\x26sidr\x3d1\x26oi\x3dsl_menu_edit";var _mWizActions = {hyphenSep: 1,breakSep: 2,dir: 3,searchNear: 6,savePlace: 9};var _mIGoogleUseXSS = false;var _mIGoogleEt = "4b884af4qHpyQdiX";var _mIGoogleServerTrustedUrl = "";var _mMMEnablePanelTab = true;var _mIdcRouterPath = true;var _mIGoogleServerUntrustedUrl = "http://maps.gmodules.com";var _mMplGGeoXml = 100;var _mMplGPoly = 100;var _mMplMapViews = 100;var _mMplGeocoding = 100;var _mMplDirections = 100;var _mMplEnableGoogleLinks = true;var _mMMEnableAddContent = true;var _mMSEnablePublicView = true;var _mMSSurveyUrl = "";var _mMMLogPanelLoad = true;var _mSatelliteToken = "fzwq2qY6BqjPHQ5kJMl8N7UWue2Nynpzzfv1fw";var _mMapCopy = "Map data \x26#169;2010 ";var _mSatelliteCopy = "Imagery \x26#169;2010 ";var _mGoogleCopy = "\x26#169;2010 Google";var _mPreferMetric = false;var _mMapPrintUrl = 'http://www.google.com/mapprint';var _mSvgForced = true;var _mLogPanZoomClks = false;var _mSXBmwAssistUrl = '';var _mSXCarEnabled = true;var _mSXServices = {};var _mSXPhoneEnabled = true;var _mSXQRCodeEnabled = false;var _mLyrcItems = [{label:"12102",layer_id:"com.panoramio.all",featurelet:{feature_id:"layers.panoramio",feature_url:"http://maps.gstatic.com/mapfiles/ftr/layers/panoramio.3.js"}},{label:"12103",layer_id:"com.youtube.all",featurelet:{feature_id:"layers.youtube",feature_url:"http://maps.gstatic.com/mapfiles/ftr/layers/youtube.0.js"}},{label:"12210",layer_id:"org.wikipedia.en"},{label:"12953",layer_id:"com.google.webcams",featurelet:{feature_id:"layers.webcams",feature_url:"http://maps.gstatic.com/mapfiles/ftr/layers/webcams.0.js"}}];var _mAttrInpNumMap = {'hundred': 100,'thousand': 1000,'k': 1000,'million': 1000000,'m': 1000000,'billion': 1000000000,'b': 1000000000};var _mMSMarker = 'Placemark';var _mMSLine = 'Line';var _mMSPolygon = 'Shape';var _mMSImage = 'Image';var _mDirectionsDragging = true;var _mDirectionsEnableCityblock = true;var _mDirectionsEnableApi = true;var _mAdSenseForMapsEnable = "true";var _mAdSenseForMapsFeedUrl = "http://pagead2.googlesyndication.com/afmaps/ads";var _mReviewsWidgetUrl = "http://www.google.com/reviews/scripts/annotations_bootstrap.js?hl\x3den\x26amp;gl\x3dus";var _mLayersTileBaseUrls = ['http://mt0.google.com/mapslt','http://mt1.google.com/mapslt','http://mt2.google.com/mapslt','http://mt3.google.com/mapslt'];var _mLayersFeaturesBaseUrl = "http://mt0.google.com/mapslt/ft";var _mPerTileBase = "http://mt0.google.com/vt/pt";function GLoadMapsScript() {if (!GLoadMapsScript.called && GBrowserIsCompatible()) {GLoadMapsScript.called = true;GScript("http://maps.gstatic.com/intl/en_us/mapfiles/193c/maps2.api/main.js");}}(function() {if (!window.google) window.google = {};if (!window.google.maps) window.google.maps = {};var ns = window.google.maps;ns.BrowserIsCompatible = GBrowserIsCompatible;ns.Unload = GUnload;})();GLoadMapsScript();var _mObfuscatedGaiaId = "104607409716829822249";
+
+
+
+(function(){function aa(a){throw a;}
+var e=true,i=null,j=false,l,ba=Number.MAX_VALUE,ca="",da="*",ea=":",fa=",",ga=".";var ha="blur",ia="change",m="click",ja="contextmenu",ka="dblclick",la="focus",oa="gesturechange",pa="gestureend",qa="keyup",ra="load",sa="mousemove",ta="mousewheel",ua="DOMMouseScroll",wa="paste",xa="unload",ya="focusin",za="focusout",Aa="updatejson",Ba="construct",Ca="maptypechanged",Da="moveend",Ea="resize",Fa="zoom",Ga="zoomend",Ha="infowindowbeforeclose",Ia="infowindowprepareopen",Ja="infowindowclose",Ka="infowindowopen",La="tilesloaded",Na="visibletilesloaded",Oa="clearlisteners",Pa="softstateurlhook",
+Qa="visibilitychanged",Ra="logclick",Sa="moduleloaded";var Ta=1,Ua=2,Va=4,Wa=1,Xa=1,Za=2,$a=1,ab=2,cb=3,db=4,eb=5;var fb="mapsapi";var gb=_mF[38],hb=_mF[39],ib=_mF[57],jb=_mF[60],kb=_mF[69],lb=_mF[99],mb=_mF[100],nb=_mF[105],ob=_mF[119],pb=_mF[149],qb=_mF[150],rb=_mF[151],sb=_mF[152],tb=_mF[153],ub=_mF[154],vb=_mF[155],wb=_mF[156],xb=_mF[163],zb=_mF[166],Ab=_mF[167],Bb=_mF[168],Cb=_mF[174],Db=_mF[183],Eb=_mF[188],Fb=_mF[189],Gb=_mF[190],Hb=_mF[192],Ib=_mF[212],Jb=_mF[213],Kb=_mF[233],Lb=_mF[234],Mb=_mF[238],Nb=_mF[239],Ob=_mF[249],Pb=_mF[257],Qb=_mF[262],Rb=_mF[271],Sb=_mF[280],Ub=_mF[283],Vb=_mF[288],Wb=_mF[289],Xb=_mF[294],
+Yb=_mF[299],Zb=_mF[315],$b=_mF[316],ac=_mF[325];var bc=bc||{},cc=this,gc=function(a){if(a.hasOwnProperty&&a.hasOwnProperty(ec))return a[ec];a[ec]||(a[ec]=++fc);return a[ec]},
+ec="closure_hashCode_"+Math.floor(Math.random()*2147483648).toString(36),fc=0,n=function(a,b){var c=b||cc;if(arguments.length>2){var d=Array.prototype.slice.call(arguments,2);return function(){var f=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(f,d);return a.apply(c,f)}}else return function(){return a.apply(c,
+arguments)}},
+p=function(a,b){function c(){}
+c.prototype=b.prototype;a.sW=b.prototype;a.prototype=new c;a.prototype.constructor=a};var hc=i,ic=i,jc=i,kc=i;function lc(a,b){window[a]=b}
+function mc(a,b){for(var c=0;c<b.length;++c){var d=b[c],f=d[1];if(d[0]){var g=nc(a,d[0]);if(g.length==1)window[g[0]]=f;else{for(var h=window,k=0;k<g.length-1;++k){var o=g[k];h[o]||(h[o]={});h=h[o]}h[g[g.length-1]]=f}}if(g=d[2])for(k=0;k<g.length;++k)f.prototype[g[k][0]]=g[k][1];if(d=d[3])for(k=0;k<d.length;++k)f[d[k][0]]=d[k][1]}}
+function nc(a,b){if(b.charAt(0)=="_")return[b];return(/^[A-Z][A-Z0-9_]*$/.test(b)&&a&&a.indexOf(".")==-1?a+"_"+b:a+b).split(".")}
+function oc(a,b,c){a=nc(a,b);if(a.length==1)window[a[0]]=c;else{for(b=window;r(a)>1;){var d=a.shift();b[d]||(b[d]={});b=b[d]}b[a[0]]=c}}
+function pc(a){for(var b={},c=0,d=r(a);c<d;++c){var f=a[c];b[f[0]]=f[1]}return b}
+function sc(a,b,c,d,f,g,h,k){var o=pc(h),q=pc(d);tc(o,function(M,Y){Y=o[M];(M=q[M])&&oc(a,M,Y)});
+var s=pc(f),u=pc(b);tc(s,function(M,Y){(M=u[M])&&oc(a,M,Y)});
+b=pc(g);var H=pc(c),G={},I={};t(k,function(M){var Y=M[0];G[M[1]]=Y;t(M[2]||[],function(Ma){G[Ma]=Y});
+t(M[3]||[],function(Ma){I[Ma]=Y})});
+tc(b,function(M,Y){var Ma=H[M],O=j,va=G[M];if(!va){va=I[M];O=e}if(!va)aa(new Error("No class for method: id "+M+", name "+Ma));M=s[va];if(!M)aa(new Error("No constructor for class id: "+va));if(Ma)if(O)M[Ma]=Y;else if(O=M.prototype)O[Ma]=Y;else aa(new Error("No prototype for class id: "+va))})}
+;function uc(a,b){this.PV=a;this.fW=b}
+;var vc=[],wc,xc,yc=new Image,zc={};function Ac(a){if(typeof _mCityblockUseSsl=="undefined"||!_mCityblockUseSsl)yc.src=a}
+window.GVerify=Ac;var Bc=[],Cc=[],Dc,Ec,Fc,Gc,Hc=[0,90,180,270],Ic=["NORTH","EAST","SOUTH","WEST"],Jc="ab1",Kc="mt0",Lc="mt1",Mc="plt",Nc="vt1";function Oc(a,b,c,d,f,g,h,k,o,q,s,u){v(Pc,Ba,function(H){Cc.push(H)});
+if(typeof wc!="object"){o=o||{export_legacy_names:e,public_api:e};hc=d||i;ic=f||i;jc=g||i;kc=o.sensor||i;xc=!!h;Dc=o.bcp47_language_code;Ec=o.log_info_window_ratio||0;Fc=o.log_fragment_count||0;Gc=o.log_fragment_seed||0;new uc(1729,131071);Qc(Rc,i);k=k||"G";f=o.export_legacy_names;q=q||[];d=o.public_api;g=Sc(o);h=Tc(o);Uc(a,b,c,q,k,d,g,h,!!o.load_tileshift,f,o.obliques_urls||[]);vc.push(k);f&&vc.push("G");t(vc,function(H){Vc(H)});
+Wc(Xc(o.jsmain,o.module_override),Yc);(a=o.experiment_ids)&&Zc(a.join(","));if(d){$c(fb);ad(u?u.timers:undefined)}}}
+function bd(a){var b=a.getTick(Nc),c=a.getTick("jsd.drag");if(!b||!c)a.branch();if(b&&c){var d=a.getTick(Kc),f=a.getTick(Jc);a.tick(Mc,Math.max(b,c)-d+f);a.done()}}
+function ad(a){var b=new cd("apiboot");a&&b.adopt(a);b.tick(Jc);dd(b);var c=0;if(a)c=ed()-a.start;var d=v(Pc,Ba,function(f){w(d);d=i;var g=new cd("maptiles"),h={};h.start=ed()-c;g.adopt(h);if(b){h=f.O();b.Xg("ms",h.width+"x"+h.height);b.tick(Kc);g.tick(Kc);fd(f,La,function(){b.done(Lc);g.done(Lc);dd(i)});
+fd(f,Na,function(o){b.Xg("nvt",""+o);b.tick(Nc);g.tick(Nc);bd(b)});
+var k=v(x(gd),Sa,function(o){if(o=="drag"){w(k);k=i;bd(b)}})}else{g.tick(Kc);
+fd(f,La,function(){hd(g,f);g.done(Lc)});
+fd(f,Na,function(){g.tick(Nc)})}});
+setTimeout(function(){if(d){b.done();b=i;dd(i)}},
+10000)}
+function Sc(a){var b=[];if(a)if((a=a.zoom_override)&&a.length)for(var c=0;c<a.length;++c)for(var d=b[a[c].maptype]=[],f=a[c].override,g=0;g<f.length;++g){var h=f[g].rect;h=new id(new z(h.lo.lat_e7/10000000,h.lo.lng_e7/10000000),new z(h.hi.lat_e7/10000000,h.hi.lng_e7/10000000));d.push([h,f[g].max_zoom])}return b}
+function Tc(a){var b=[];if(a)if((a=a.tile_override)&&a.length)for(var c=0;c<a.length;++c){b[a[c].maptype]||(b[a[c].maptype]=[]);b[a[c].maptype].push({minZoom:a[c].min_zoom,maxZoom:a[c].max_zoom,rect:a[c].rect,uris:a[c].uris,mapprintUrl:a[c].mapprint_url})}return b}
+function jd(){for(var a=[],b=x(kd).Z,c=0,d=r(b);c<d;++c){var f=b[c],g=f.Wb;if(g&&!g.__tag__){g.__tag__=e;A(g,Oa);a.push(g)}f.remove()}for(c=0;c<r(a);++c){g=a[c];if(g.__tag__)try{delete g.__tag__;delete g.__e_}catch(h){g.__tag__=j;g.__e_=i}}x(kd).clear();ld(document.body)}
+function Uc(a,b,c,d,f,g,h,k,o,q,s){var u=new md(_mMapCopy),H=new md(_mSatelliteCopy),G=new md(_mMapCopy),I=new md;lc("GAddCopyright",nd(u,H,G));window.GAppFeatures=od;var M=[];wc=[];M.push(["DEFAULT_MAP_TYPES",wc]);var Y=new pd(B(30,30)+1),Ma=f=="G";function O(qc,ag,kf,rh){zc[kf]=qc;ag&&wc.push(qc);M.push([kf,qc]);rh&&Ma&&M.push([rh,qc])}
+D.initializeLowBandwidthMapLayers();var va,Ya,Tb;if(r(a)){va=qd(a,u,Y,h,k,g);O(va,e,"NORMAL_MAP","MAP_TYPE")}if(r(b)){var dc=[];ac&&t(Hc,function(qc){dc.push(new rd(30,qc))});
+a=new sd;Ya=td(b,H,Y,h,a);O(Ya,e,"SATELLITE_MAP","SATELLITE_TYPE");b=[];if(ac)b=ud(s,I,a,dc,M);if(o){var rc=Ya.getTileLayers()[0];vd("tlsf",Xa,function(qc){qc(rc)});
+lc("GTileShiftUpdateOffset",wd("tlsf",Za))}if(r(c)){o=new sd;Tb=xd(c,u,Y,h,k,Ya,g,o);ac&&yd(c,u,o,b,M);O(Tb,e,"HYBRID_MAP","HYBRID_TYPE")}}r(d)&&O(zd(d,G,Y,h,k),!g,"PHYSICAL_MAP");c=!g&&nb&&E.bC(xb);O(Ad(),c,"SATELLITE_3D_MAP");O(Bd(),c,"HYBRID_3D_MAP");if(g&&Eb&&va&&Ya&&Tb)M=M.concat(Cd(va,Ya,Tb,Y));mc(f,M);q&&mc("G",M)}
+function qd(a,b,c,d,f,g){var h={shortName:F(10111),urlArg:"m",errorMessage:F(10120),alt:F(10511),tileSize:256,lbw:D.mapTileLayer},k=i;k=Rb?new Dd(a,b,17):new Ed(a,b,17);k.ip(d[0]);k.fp(Fd(f[0],c,256,17));!g&&Wb&&Gd(k);return new Hd([k],c,F(10049),h)}
+function td(a,b,c,d,f){f={shortName:F(10112),urlArg:"k",textColor:"white",linkColor:"white",errorMessage:F(10121),alt:F(10512),lbw:D.satTileLayer,maxZoomEnabled:e,rmtc:f,isDefault:e};a=new Id(a,b,19,_mSatelliteToken,_mDomain);a.ip(d[1]);return new Hd([a],c,F(10050),f)}
+function ud(a,b,c,d,f){var g=[];t(Hc,function(h,k){var o=Jd(a,function(s){return s+"deg="+h+"&"});
+o=new Id(o,b,21,_mSatelliteToken,_mDomain);var q={shortName:"Aer",textColor:"white",linkColor:"white",errorMessage:F(10121),alt:F(10512),heading:h,rmtc:c};o=new Hd([o],d[k],"Aerial",q);g.push(o);f.push(["AERIAL_"+Ic[k]+"_MAP",o]);f.push(["OBLIQUE_SATELLITE_"+Ic[k]+"_MAP",o])});
+f.push(["AERIAL_MAP",g[0]]);return g}
+function xd(a,b,c,d,f,g,h,k){k={shortName:F(10117),urlArg:"h",textColor:"white",linkColor:"white",errorMessage:F(10121),alt:F(10513),tileSize:256,lbw:D.hybTileLayer,maxZoomEnabled:e,rmtc:k,isDefault:e};g=g.getTileLayers()[0];var o=i;o=Rb?new Dd(a,b,17,e):new Ed(a,b,17,e);o.ip(d[2]);o.fp(Fd(f[2],c,256,17));!h&&Wb&&Gd(o);return new Hd([g,o],c,F(10116),k)}
+function yd(a,b,c,d,f){var g=[];t(Hc,function(h,k){var o=d[k].getTileLayers()[0],q=Jd(a,function(H){return H+"opts=o&deg="+h+"&"}),
+s=i;s=Rb?new Dd(q,b,21,e):new Ed(q,b,21,e);q={shortName:"Aer Hyb",textColor:"white",linkColor:"white",errorMessage:F(10121),alt:F(10513),heading:h,rmtc:c};var u=d[k].getProjection();o=new Hd([o,s],u,"Aerial Hybrid",q);g.push(o);f.push(["AERIAL_HYBRID_"+Ic[k]+"_MAP",o]);f.push(["OBLIQUE_HYBRID_"+Ic[k]+"_MAP",o])});
+f.push(["AERIAL_HYBRID_MAP",g[0]]);return g}
+function zd(a,b,c,d,f){var g={shortName:F(11759),urlArg:"p",errorMessage:F(10120),alt:F(11751),tileSize:256,lbw:D.terTileLayer};a=new Ed(a,b,15,j);a.ip(d[3]);a.fp(Fd(f[3],c,256,15));return new Hd([a],c,F(11758),g)}
+function Fd(a,b,c,d){for(var f=[],g=0;g<r(a);++g){for(var h={minZoom:a[g].minZoom||1,maxZoom:a[g].maxZoom||d,uris:a[g].uris,rect:[]},k=0;k<r(a[g].rect);++k){h.rect[k]=[];for(var o=h.minZoom;o<=h.maxZoom;++o){var q=b.fromLatLngToPixel(new z(a[g].rect[k].lo.lat_e7/10000000,a[g].rect[k].lo.lng_e7/10000000),o),s=b.fromLatLngToPixel(new z(a[g].rect[k].hi.lat_e7/10000000,a[g].rect[k].hi.lng_e7/10000000),o);h.rect[k][o]={n:Kd(s.y/c),w:Kd(q.x/c),s:Kd(q.y/c),e:Kd(s.x/c)}}}f.push(h)}return f?new Ld(f):i}
+function Md(a,b,c){var d=B(30,30),f=new pd(d+1),g=new Hd([],f,a,{maxResolution:d,urlArg:b});t(wc,function(h){h.getUrlArg()==c&&g.YS(h)});
+return g}
+var Nd;function Ad(){return Nd=Md(F(12492),"e","k")}
+var Od;function Bd(){return Od=Md(F(13171),"f","h")}
+function nd(a,b,c){return function(d,f,g,h,k,o,q,s,u,H,G){var I=a;if(d=="k")I=b;else if(d=="p")I=c;d=new id(new z(g,h),new z(k,o));I.Oi(new Qd(f,d,q,s,u,H,G))}}
+function Vc(a){t(Bc,function(b){b(a)})}
+window.GUnloadApi=jd;function Rd(a){if(!a)return"";var b="";if(a.nodeType==3||a.nodeType==4||a.nodeType==2)b+=a.nodeValue;else if(a.nodeType==1||a.nodeType==9||a.nodeType==11)for(var c=0;c<r(a.childNodes);++c)b+=arguments.callee(a.childNodes[c]);return b}
+function Sd(a){if(typeof ActiveXObject!="undefined"&&typeof GetObject!="undefined"){var b=new ActiveXObject("Microsoft.XMLDOM");b.loadXML(a);return b}if(typeof DOMParser!="undefined")return(new DOMParser).parseFromString(a,"text/xml");return J("div",i)}
+function Td(a){return new Ud(a)}
+function Ud(a){this.qH=a}
+Ud.prototype.$U=function(a,b){if(E.type==1){Vd(b,a.transformNode(this.qH));return e}else if(XSLTProcessor&&XSLTProcessor.prototype.importStylesheet){var c=new XSLTProcessor;c.importStylesheet(this.qH);a=c.transformToFragment(a,window.document);Wd(b);b.appendChild(a);return e}else return j};function Xd(){return typeof Dc=="string"?Dc:"en"}
+;var Yd={},Zd="__ticket__";function $d(a,b,c){this.AG=a;this.FU=b;this.zG=c}
+$d.prototype.toString=function(){return""+this.zG+"-"+this.AG};
+$d.prototype.sc=function(){return this.FU[this.zG]==this.AG};
+function ae(a){var b=arguments.callee;if(!b.Lq)b.Lq=1;var c=(a||"")+b.Lq;b.Lq++;return c}
+function be(a,b){var c;if(typeof a=="string"){c=Yd;a=a}else{c=a;a=(b||"")+Zd}c[a]||(c[a]=0);b=++c[a];return new $d(b,c,a)}
+function ce(a){if(typeof a=="string")Yd[a]&&Yd[a]++;else a[Zd]&&a[Zd]++}
+;var de=window._mStaticPath,Rc=de+"transparent.png",ee=Math.PI,fe=Math.abs,ge=Math.asin,he=Math.atan,je=Math.atan2,ke=Math.ceil,le=Math.cos,Kd=Math.floor,B=Math.max,me=Math.min,ne=Math.pow,K=Math.round,oe=Math.sin,pe=Math.sqrt,qe=Math.tan,re="function";function r(a){return a?a.length:0}
+function se(a,b,c){if(b!=i)a=B(a,b);if(c!=i)a=me(a,c);return a}
+function te(a,b,c){if(a==Number.POSITIVE_INFINITY)return c;else if(a==Number.NEGATIVE_INFINITY)return b;for(;a>c;)a-=c-b;for(;a<b;)a+=c-b;return a}
+function ue(a){return typeof a!="undefined"}
+function ve(a){return typeof a=="number"}
+function we(a){return typeof a=="string"}
+function xe(a,b,c){for(var d=0,f=0;f<r(a);++f)if(a[f]===b||c&&a[f]==b){a.splice(f--,1);d++}return d}
+function ye(a,b,c){for(var d=0;d<r(a);++d)if(a[d]===b||c&&a[d]==b)return j;a.push(b);return e}
+function ze(a,b,c){for(var d=0;d<r(a);++d)if(c(a[d],b)){a.splice(d,0,b);return e}a.push(b);return e}
+function Ce(a,b){for(var c=0;c<a.length;++c)if(a[c]==b)return e;return j}
+function De(a,b,c){tc(b,function(d){a[d]=b[d]},
+c)}
+function Ee(a){for(var b in a)return j;return e}
+function Fe(a){for(var b in a)delete a[b]}
+function Ge(a,b,c){t(c,function(d){if(!b.hasOwnProperty||b.hasOwnProperty(d))a[d]=b[d]})}
+function t(a,b){if(a)for(var c=0,d=r(a);c<d;++c)b(a[c],c)}
+function tc(a,b,c){if(a)for(var d in a)if(c||!a.hasOwnProperty||a.hasOwnProperty(d))b(d,a[d])}
+function He(a,b){var c=0;tc(a,function(){++c},
+b);return c}
+function Ie(a,b){if(a.hasOwnProperty)return a.hasOwnProperty(b);else{for(var c in a)if(c==b)return e;return j}}
+function Je(a,b,c){for(var d,f=r(a),g=0;g<f;++g){var h=b.call(a[g]);d=g==0?h:c(d,h)}return d}
+function Jd(a,b){for(var c=[],d=r(a),f=0;f<d;++f)c.push(b(a[f],f));return c}
+function Ke(a,b,c,d){c=Le(c,0);var f=r(b);d=Le(d,f);for(c=c;c<d;++c)a.push(b[c])}
+function Me(a){return Array.prototype.slice.call(a,0)}
+function Ne(){return j}
+function Oe(){return e}
+function Pe(){return i}
+function Qe(a){return a*(ee/180)}
+function Re(a){return a/(ee/180)}
+function Se(a,b,c){return fe(a-b)<=(c||1.0E-9)}
+var Te="&amp;",Ue="&lt;",Ve="&gt;",We="&",Xe="<",Ye=">",Ze=/&/g,$e=/</g,af=/>/g;function cf(a){if(a.indexOf(We)!=-1)a=a.replace(Ze,Te);if(a.indexOf(Xe)!=-1)a=a.replace($e,Ue);if(a.indexOf(Ye)!=-1)a=a.replace(af,Ve);return a}
+function df(a){return a.replace(/^\s+/,"").replace(/\s+$/,"")}
+function ef(a,b){var c=r(a),d=r(b);return d==0||d<=c&&a.lastIndexOf(b)==c-d}
+function ff(a){a.length=0}
+function gf(){return Function.prototype.call.apply(Array.prototype.slice,arguments)}
+function hf(a){return parseInt(a,10)}
+function jf(a){return parseInt(a,16)}
+function Le(a,b){return ue(a)&&a!=i?a:b}
+function L(a,b,c){return(c?c:de)+a+(b?".gif":".png")}
+function N(){}
+function lf(a,b){if(a)return function(){--a||b()};
+else{b();return N}}
+function mf(a){var b=[],c=i;return function(d){d=d||N;if(c)d.apply(this,c);else{b.push(d);r(b)==1&&a.call(this,function(){for(c=Me(arguments);r(b);)b.shift().apply(this,c)})}}}
+function nf(a){return!!a&&(a instanceof Array||Object.prototype.toString.call(a)=="[object Array]")}
+function x(a){if(!a.Wb)a.Wb=new a;return a.Wb}
+function of(a,b,c){var d=[];tc(a,function(f,g){d.push(f+b+g)});
+return d.join(c)}
+function pf(){var a=Me(arguments);a.unshift(i);return qf.apply(i,a)}
+function rf(a,b){var c=gf(arguments,2);return function(){var d=Me(arguments);if(r(d)<b)d.length=b;Array.prototype.splice.apply(d,Array.prototype.concat.apply([],[[b,0],c]));return a.apply(this,d)}}
+function qf(a,b){if(arguments.length>2){var c=gf(arguments,2);return function(){return b.apply(a||this,arguments.length>0?c.concat(Me(arguments)):c)}}else return function(){return b.apply(a||this,
+arguments)}}
+function sf(){return qf.apply(i,arguments)}
+function tf(){return qf.apply(i,arguments)}
+function uf(a,b){var c=gf(arguments,2);return function(){return b.apply(a,c)}}
+;var vf=["opera","msie","chrome","applewebkit","firefox","camino","mozilla"],wf=["x11;","macintosh","windows"];
+function xf(a){this.agent=a;this.cpu=this.os=this.type=-1;this.revision=this.version=0;a=a.toLowerCase();for(var b=0;b<r(vf);b++){var c=vf[b];if(a.indexOf(c)!=-1){this.type=b;if((new RegExp(c+"[ /]?([0-9]+(.[0-9]+)?)")).exec(a))this.version=parseFloat(RegExp.$1);break}}if(this.type==6)if(/^Mozilla\/.*Gecko\/.*(Minefield|Shiretoko)[ \/]?([0-9]+(.[0-9]+)?)/.exec(this.agent)){this.type=4;this.version=parseFloat(RegExp.$2)}for(b=0;b<r(wf);b++){c=wf[b];if(a.indexOf(c)!=-1){this.os=b;break}}if(this.os==
+1&&a.indexOf("intel")!=-1)this.cpu=0;if(this.Na()&&/\brv:\s*(\d+\.\d+)/.exec(a))this.revision=parseFloat(RegExp.$1)}
+l=xf.prototype;l.Na=function(){return this.type==4||this.type==6||this.type==5};
+l.pb=function(){return this.type==2||this.type==3};
+l.Jn=function(){return this.type==1&&this.version<7};
+l.gO=function(){return this.type==4&&this.version>=3};
+l.ox=function(){return this.Jn()};
+l.px=function(){if(this.type==1)return e;if(this.pb())return j;if(this.Na())return!this.revision||this.revision<1.9;return e};
+l.aC=function(){return this.type==1?"CSS1Compat"!=this.qA():j};
+l.qA=function(){return Le(document.compatMode,"")};
+l.Dh=function(){return this.type==3&&(this.agent.indexOf("iPhone")!=-1||this.agent.indexOf("iPod")!=-1||this.agent.indexOf("Android")!=-1)};
+l.bC=function(a){var b=this.qM()+"-"+this.QM();return a.indexOf(b)!=-1};
+var yf={};yf[2]="windows";yf[1]="macos";yf[0]="unix";yf[-1]="other";var zf={};zf[1]="ie";zf[4]="firefox";zf[2]="chrome";zf[3]="safari";zf[0]="opera";zf[5]="camino";zf[6]="mozilla";zf[-1]="other";xf.prototype.qM=function(){return yf[this.os]};
+xf.prototype.QM=function(){return zf[this.type]};
+var E=new xf(navigator.userAgent);function J(a,b,c,d,f,g,h){var k;if(E.type==1&&g){a="<"+a+" ";for(k in g)a+=k+"='"+g[k]+"' ";a+=">";g=i}a=Af(b).createElement(a);if(g)for(k in g)a.setAttribute(k,g[k]);c&&Bf(a,c,h);d&&Cf(a,d);b&&!f&&Df(b,a);return a}
+function Ef(a,b){a=Af(b).createTextNode(a);b&&Df(b,a);return a}
+function Af(a){return a?a.nodeType==9?a:a.ownerDocument||document:document}
+function Q(a){return K(a)+"px"}
+function Ff(a){return a+"em"}
+function Bf(a,b,c){Gf(a);c?Hf(a,b.x):If(a,b.x);Jf(a,b.y)}
+function If(a,b){a.style.left=Q(b)}
+function Hf(a,b){a.style.right=Q(b)}
+function Jf(a,b){a.style.top=Q(b)}
+function Cf(a,b){a=a.style;a.width=b.getWidthString();a.height=b.getHeightString()}
+function Kf(a){return new R(a.offsetWidth,a.offsetHeight)}
+function Lf(a,b){a.style.width=Q(b)}
+function Mf(a,b){a.style.height=Q(b)}
+function Nf(a,b){return b&&Af(b)?Af(b).getElementById(a):document.getElementById(a)}
+function Of(a,b){a.style.display=b?"":"none"}
+function Pf(a,b){a.style.visibility=b?"":"hidden"}
+function Qf(a){Of(a,j)}
+function Rf(a){Of(a,e)}
+function Sf(a){return a.style.display=="none"}
+function Tf(a){Pf(a,j)}
+function Uf(a){Pf(a,e)}
+function Vf(a){a.style.visibility="visible"}
+function Wf(a){a.style.position="relative"}
+function Gf(a){a.style.position="absolute"}
+function Xf(a){Yf(a,"hidden")}
+function Zf(a){Yf(a,"auto")}
+function Yf(a,b){a.style.overflow=b}
+function $f(a,b){if(ue(b))try{a.style.cursor=b}catch(c){b=="pointer"&&$f(a,"hand")}}
+function bg(a){cg(a,"gmnoscreen");dg(a,"gmnoprint")}
+function eg(a){cg(a,"gmnoprint");dg(a,"gmnoscreen")}
+function fg(a,b){a.style.zIndex=b}
+function ed(){return(new Date).getTime()}
+function Df(a,b){a.appendChild(b)}
+function gg(a){if(E.Na())a.style.MozUserSelect="none";else if(E.pb())a.style.KhtmlUserSelect="none";else{a.unselectable="on";a.onselectstart=Ne}}
+function hg(a,b){if(E.type==1)a.style.filter="alpha(opacity="+K(b*100)+")";else a.style.opacity=b}
+function ig(a){var b=Af(a);if(a.currentStyle)return a.currentStyle;if(b.defaultView&&b.defaultView.getComputedStyle)return b.defaultView.getComputedStyle(a,"")||{};return a.style}
+function jg(a,b){var c=hf(b);if(!isNaN(c)){if(b==c||b==c+"px")return c;if(a){c=a.style;var d=c.width;c.width=b;a=a.clientWidth;c.width=d;return a}}return 0}
+function kg(a,b){b=ig(a)[b];return jg(a,b)}
+function lg(a){return a.replace(/%3A/gi,":").replace(/%20/g,"+").replace(/%2C/gi,",")}
+function mg(a,b){var c=[];tc(a,function(d,f){f!=i&&c.push(encodeURIComponent(d)+"="+lg(encodeURIComponent(f)))});
+a=c.join("&");return b?a?"?"+a:"":a}
+function ng(a){a=a.split("&");for(var b={},c=0;c<r(a);c++){var d=a[c].split("=");if(r(d)==2){var f=d[1].replace(/,/gi,"%2C").replace(/[+]/g,"%20").replace(/:/g,"%3A");try{b[decodeURIComponent(d[0])]=decodeURIComponent(f)}catch(g){}}}return b}
+function og(a){var b=a.indexOf("?");return b!=-1?a.substr(b+1):""}
+function pg(a){try{return eval("["+a+"][0]")}catch(b){return i}}
+function qg(a,b,c,d){rg(d);return window.setTimeout(function(){b.call(a);sg(d)},
+c)}
+;function Qd(){Qd.g.apply(this,arguments)}
+function tg(){tg.g.apply(this,arguments)}
+function md(){md.g.apply(this,arguments)}
+;Qd.g=function(a,b,c,d,f,g,h){this.id=a;this.minZoom=c;this.bounds=b;this.text=d;this.maxZoom=f;this.kJ=g;this.featureTriggers=h};
+md.g=function(a){this.Nw=[];this.fh={};this.qR=a||""};
+md.prototype.Oi=function(a){if(this.fh[a.id])return j;for(var b=this.Nw,c=a.minZoom;r(b)<=c;)b.push([]);b[c].push(a);this.fh[a.id]=1;A(this,"newcopyright",a);return e};
+md.prototype.as=function(a){for(var b=[],c=this.Nw,d=0;d<r(c);d++)for(var f=0;f<r(c[d]);f++){var g=c[d][f];g.bounds.contains(a)&&b.push(g)}return b};
+tg.g=function(a,b,c){this.prefix=a;this.copyrightTexts=b;this.featureTriggers=c};
+tg.prototype.toString=function(){return this.prefix+" "+this.copyrightTexts.join(", ")};
+md.prototype.kA=function(a,b){for(var c={},d={},f=[],g=[],h=this.Nw,k=i,o=me(b,r(h)-1);o>=0;o--){for(var q=h[o],s=j,u=j,H=0;H<r(q);H++){var G=q[H];if(!(typeof G.maxZoom=="number"&&G.maxZoom<b)){var I=G.bounds,M=G.text;if(I.intersects(a)){if(M&&!c[M]){f.push(M);c[M]=1}t(G.featureTriggers||[],function(Y){if(!d[Y[0]]&&(r(Y)<2||b>=Y[1])&&(r(Y)<3||b<=Y[2])){g.push(Y[0]);d[Y[0]]=1}});
+if(G.kJ)u=e;else if(k===i)k=new id(I.nb(),I.mb());else k.union(I);if(!u&&k.kc(a))s=e}}}if(s)break}return[f,g]};
+md.prototype.getCopyrights=function(a,b){return this.kA(a,b)[0]};
+md.prototype.$r=function(a,b){a=this.kA(a,b);if(r(a[0])>0||r(a[1])>0)return new tg(this.qR,a[0],a[1]);return i};var ug="Status",vg="code";function wg(){wg.g.apply(this,arguments)}
+;var xg="_xdc_";wg.g=function(a,b,c){c=c||{};this.Mb=a;this.lj=b;this.LG=Le(c.timeout,10000);this.EI=Le(c.callback,"callback");this.FI=Le(c.suffix,"");this.rD=Le(c.neat,j);this.mT=Le(c.locale,j);this.DI=c.callbackNameGenerator||n(this.TJ,this)};
+var yg=0;
+wg.prototype.send=function(a,b,c,d,f){f=f||{};var g=this.lj.getElementsByTagName("head")[0];if(g){rg(d,"xdc0");var h=this.DI(a);window[xg]||(window[xg]={});var k=this.lj.createElement("script"),o=0;if(this.LG>0){o=zg(h,k,a,c,d);o=window.setTimeout(o,this.LG)}c="?";if(this.Mb&&this.Mb.indexOf("?")!=-1)c="&";a=this.Mb+c+Ag(a,this.rD);if(this.mT){a=a;c=this.rD;var q={};q.hl=window._mHL;q.country=window._mGL;a=a+"&"+Ag(q,c)}if(b){b=Bg(h,k,b,o,d);window[xg][h]=b;a+="&"+this.EI+"="+xg+"."+h}k.setAttribute("type","text/javascript");
+k.setAttribute("id",h);k.setAttribute("charset","UTF-8");k.setAttribute("src",a);g.appendChild(k);f.id=h;f.timeout=o;f.stats=d}else c&&c(a)};
+wg.prototype.cancel=function(a){var b=a.id,c=a.timeout;a=a.stats;c&&window.clearTimeout(c);if(b)if((c=this.lj.getElementById(b))&&c.tagName=="SCRIPT"&&typeof window[xg][b]=="function"){Cg(c);delete window[xg][b];sg(a,"xdcc")}};
+wg.prototype.TJ=function(){return"_"+(yg++).toString(36)+ed().toString(36)+this.FI};
+function zg(a,b,c,d,f){return function(){Dg(a,b);Eg(f,"xdce");d&&d(c);sg(f)}}
+function Bg(a,b,c,d,f){return function(g){window.clearTimeout(d);Dg(a,b);Eg(f,"xdc1");c(g);sg(f)}}
+function Dg(a,b){window.setTimeout(function(){Cg(b);window[xg][a]&&delete window[xg][a]},
+0)}
+function Ag(a,b){var c=[];tc(a,function(d,f){var g=[f];if(nf(f))g=f;t(g,function(h){if(h!=i){h=b?lg(encodeURIComponent(h)):encodeURIComponent(h);c.push(encodeURIComponent(d)+"="+h)}})});
+return c.join("&")}
+;function Fg(){}
+;function Gg(a,b,c){c=c&&c.dynamicCss;var d=J("style",i);d.setAttribute("type","text/css");if(d.styleSheet)d.styleSheet.cssText=b;else{b=document.createTextNode(b);d.appendChild(b)}a:{d.originalName=a;b=Hg();for(var f=b.getElementsByTagName(d.nodeName),g=0;g<r(f);g++){var h=f[g],k=h.originalName;if(!(!k||k<a)){if(k==a)c&&h.parentNode.replaceChild(d,h);else h.parentNode.insertBefore(d,h);break a}}b.appendChild(d)}}
+window.__gcssload__=Gg;function Ig(a,b){(new Jg(b)).run(a)}
+function Jg(a){this.Ge=a}
+Jg.prototype.run=function(a){for(this.Xc=[a];r(this.Xc);)this.BR(this.Xc.shift())};
+Jg.prototype.BR=function(a){this.Ge(a);for(a=a.firstChild;a;a=a.nextSibling)a.nodeType==1&&this.Xc.push(a)};
+function Kg(a,b,c){a.setAttribute(b,c)}
+function Lg(a,b){a.removeAttribute(b)}
+function dg(a,b){var c=a.className?String(a.className):"";if(c){c=c.split(/\s+/);for(var d=j,f=0;f<r(c);++f)if(c[f]==b){d=e;break}d||c.push(b);a.className=c.join(" ")}else a.className=b}
+function cg(a,b){var c=a.className?String(a.className):"";if(!(!c||c.indexOf(b)==-1)){c=c.split(/\s+/);for(var d=0;d<r(c);++d)c[d]==b&&c.splice(d--,1);a.className=c.join(" ")}}
+function Mg(a){return a.parentNode.removeChild(a)}
+function Hg(){if(!Ng){var a=document.getElementsByTagName("base")[0];if(!document.body&&a&&r(a.childNodes))return a;Ng=document.getElementsByTagName("head")[0]}return Ng}
+var Ng;function Og(){Og.g.apply(this,arguments)}
+;function Cg(a){if(a.parentNode){a.parentNode.removeChild(a);Pg(a)}ld(a)}
+function ld(a){Ig(a,function(b){if(b.nodeType!=3){b.onselectstart=i;b.imageFetcherOpts=i}})}
+function Wd(a){for(var b;b=a.firstChild;){Pg(b);a.removeChild(b)}}
+function Vd(a,b){if(a.innerHTML!=b){Wd(a);a.innerHTML=b}}
+function Qg(a){if((a=a.srcElement||a.target)&&a.nodeType==3)a=a.parentNode;return a}
+function Pg(a,b){Ig(a,function(c){Rg(c,b)})}
+function Sg(a){a.type==m&&A(document,Ra,a);if(E.type==1){a.cancelBubble=e;a.returnValue=j}else{a.preventDefault();a.stopPropagation()}}
+function Tg(a){a.type==m&&A(document,Ra,a);if(E.type==1)a.cancelBubble=e;else a.stopPropagation()}
+function Ug(a){if(E.type==1)a.returnValue=j;else a.preventDefault()}
+;var Vg="pixels";function S(a,b){this.x=a;this.y=b}
+var Xg=new S(0,0);S.prototype.toString=function(){return"("+this.x+", "+this.y+")"};
+S.prototype.equals=function(a){if(!a)return j;return a.x==this.x&&a.y==this.y};
+function R(a,b,c,d){this.width=a;this.height=b;this.CV=c||"px";this.uN=d||"px"}
+var Yg=new R(0,0);R.prototype.getWidthString=function(){return this.width+this.CV};
+R.prototype.getHeightString=function(){return this.height+this.uN};
+R.prototype.toString=function(){return"("+this.width+", "+this.height+")"};
+R.prototype.equals=function(a){if(!a)return j;return a.width==this.width&&a.height==this.height};
+function Zg(a){this.minX=this.minY=ba;this.maxX=this.maxY=-ba;var b=arguments;if(r(a))t(a,n(this.extend,this));else if(r(b)>=4){this.minX=b[0];this.minY=b[1];this.maxX=b[2];this.maxY=b[3]}}
+l=Zg.prototype;l.min=function(){return new S(this.minX,this.minY)};
+l.max=function(){return new S(this.maxX,this.maxY)};
+l.O=function(){return new R(this.maxX-this.minX,this.maxY-this.minY)};
+l.mid=function(){return new S((this.minX+this.maxX)/2,(this.minY+this.maxY)/2)};
+l.toString=function(){return"("+this.min()+", "+this.max()+")"};
+l.ma=function(){return this.minX>this.maxX||this.minY>this.maxY};
+l.kc=function(a){var b=this;return b.minX<=a.minX&&b.maxX>=a.maxX&&b.minY<=a.minY&&b.maxY>=a.maxY};
+l.Kf=function(a){var b=this;return b.minX<=a.x&&b.maxX>=a.x&&b.minY<=a.y&&b.maxY>=a.y};
+l.jJ=function(a){return this.maxX>=a.x&&this.minY<=a.y&&this.maxY>=a.y};
+l.extend=function(a){if(this.ma()){this.minX=this.maxX=a.x;this.minY=this.maxY=a.y}else{this.minX=me(this.minX,a.x);this.maxX=B(this.maxX,a.x);this.minY=me(this.minY,a.y);this.maxY=B(this.maxY,a.y)}};
+l.EK=function(a){if(!a.ma()){this.minX=me(this.minX,a.minX);this.maxX=B(this.maxX,a.maxX);this.minY=me(this.minY,a.minY);this.maxY=B(this.maxY,a.maxY)}};
+var $g=function(a,b){a=new Zg(B(a.minX,b.minX),B(a.minY,b.minY),me(a.maxX,b.maxX),me(a.maxY,b.maxY));if(a.ma())return new Zg;return a},
+ah=function(a,b){if(a.minX>b.maxX)return j;if(b.minX>a.maxX)return j;if(a.minY>b.maxY)return j;if(b.minY>a.maxY)return j;return e};
+Zg.prototype.equals=function(a){return this.minX==a.minX&&this.minY==a.minY&&this.maxX==a.maxX&&this.maxY==a.maxY};
+Zg.prototype.copy=function(){return new Zg(this.minX,this.minY,this.maxX,this.maxY)};
+function bh(a,b,c,d){this.point=new S(a,b);this.xunits=c||Vg;this.yunits=d||Vg}
+function ch(a,b,c,d){this.size=new R(a,b);this.xunits=c||Vg;this.yunits=d||Vg}
+;var dh="iframeshim";var eh="BODY";
+function fh(a,b){var c=new S(0,0);if(a==b)return c;var d=Af(a);if(a.getBoundingClientRect){d=a.getBoundingClientRect();c.x+=d.left;c.y+=d.top;gh(c,ig(a));if(b){a=fh(b);c.x-=a.x;c.y-=a.y}return c}else if(d.getBoxObjectFor&&window.pageXOffset==0&&window.pageYOffset==0){if(b){var f=ig(b);c.x-=jg(i,f.borderLeftWidth);c.y-=jg(i,f.borderTopWidth)}else b=d.documentElement;f=d.getBoxObjectFor(a);b=d.getBoxObjectFor(b);c.x+=f.screenX-b.screenX;c.y+=f.screenY-b.screenY;gh(c,ig(a));return c}else return hh(a,b)}
+function hh(a,b){var c=new S(0,0),d=ig(a);a=a;var f=e;if(E.pb()||E.type==0&&E.version>=9){gh(c,d);f=j}for(;a&&a!=b;){c.x+=a.offsetLeft;c.y+=a.offsetTop;f&&gh(c,d);a.nodeName==eh&&ih(c,a,d);var g=a.offsetParent,h=i;if(g){h=ig(g);E.Na()&&E.revision>=1.8&&g.nodeName!=eh&&h.overflow!="visible"&&gh(c,h);c.x-=g.scrollLeft;c.y-=g.scrollTop;if(E.type!=1&&jh(a,d,h)){if(E.Na()){d=ig(g.parentNode);if(E.qA()!="BackCompat"||d.overflow!="visible"){c.x-=window.pageXOffset;c.y-=window.pageYOffset}gh(c,d)}break}}a=
+g;d=h}if(E.type==1&&document.documentElement){c.x+=document.documentElement.clientLeft;c.y+=document.documentElement.clientTop}if(b&&a==i){b=hh(b);c.x-=b.x;c.y-=b.y}return c}
+function jh(a,b,c){if(a.offsetParent.nodeName==eh&&c.position=="static"){a=b.position;return E.type==0?a!="static":a=="absolute"}return j}
+function ih(a,b,c){var d=b.parentNode,f=j;if(E.Na()){var g=ig(d);f=c.overflow!="visible"&&g.overflow!="visible";var h=c.position!="static";if(h||f){a.x+=jg(i,c.marginLeft);a.y+=jg(i,c.marginTop);gh(a,g)}if(h){a.x+=jg(i,c.left);a.y+=jg(i,c.top)}a.x-=b.offsetLeft;a.y-=b.offsetTop}if((E.Na()||E.type==1)&&document.compatMode!="BackCompat"||f)if(window.pageYOffset){a.x-=window.pageXOffset;a.y-=window.pageYOffset}else{a.x-=d.scrollLeft;a.y-=d.scrollTop}}
+function gh(a,b){a.x+=jg(i,b.borderLeftWidth);a.y+=jg(i,b.borderTopWidth)}
+function kh(a,b){if(ue(a.offsetX)&&!E.pb()&&!(E.type==1&&E.version>=8)){var c=Qg(a);a=new S(a.offsetX,a.offsetY);b=fh(c,b);return b=new S(b.x+a.x,b.y+a.y)}else if(ue(a.clientX)){c=E.pb()?new S(a.pageX-window.pageXOffset,a.pageY-window.pageYOffset):new S(a.clientX,a.clientY);b=fh(b);return b=new S(c.x-b.x,c.y-b.y)}else return Xg}
+;var lh=e;function kd(){this.Z=[]}
+kd.prototype.Pk=function(a){var b=a.Fa;if(!(b<0)){var c=this.Z.pop();if(b<this.Z.length){this.Z[b]=c;c.Zo(b)}a.Zo(-1)}};
+kd.prototype.CR=function(a){this.Z.push(a);a.Zo(this.Z.length-1)};
+kd.prototype.clear=function(){for(var a=0;a<this.Z.length;++a)this.Z[a].Zo(-1);this.Z=[]};
+function v(a,b,c,d){return x(mh).make(a,b,c,0,d)}
+function nh(a,b){return r(oh(a,b,j))>0}
+function w(a){a.remove();x(kd).Pk(a)}
+function ph(a,b,c){A(a,Oa,b);t(qh(a,b),function(d){if(!c||d.RC(c)){d.remove();x(kd).Pk(d)}})}
+function Rg(a,b){A(a,Oa);t(qh(a),function(c){if(!b||c.RC(b)){c.remove();x(kd).Pk(c)}})}
+function qh(a,b){var c=[];if(a=a.__e_)if(b)a[b]&&Ke(c,a[b]);else tc(a,function(d,f){Ke(c,f)});
+return c}
+function oh(a,b,c){var d=i,f=a.__e_;if(f){d=f[b];if(!d){d=[];if(c)f[b]=d}}else{d=[];if(c){a.__e_={};a.__e_[b]=d}}return d}
+function A(a,b){var c=gf(arguments,2);t(qh(a,b),function(d){if(lh)d.bt(c);else try{d.bt(c)}catch(f){}})}
+function sh(a,b,c,d){if(a.addEventListener){var f=j;if(b==ya){b=la;f=e}else if(b==za){b=ha;f=e}var g=f?4:1;a.addEventListener(b,c,f);c=x(mh).make(a,b,c,g,d)}else if(a.attachEvent){c=x(mh).make(a,b,c,2,d);a.attachEvent("on"+b,c.zJ())}else{a["on"+b]=c;c=x(mh).make(a,b,c,3,d)}if(a!=window||b!=xa)x(kd).CR(c);return c}
+function T(a,b,c,d){c=th(c,d);return sh(a,b,c)}
+function uh(a,b,c,d,f){c=th(c,d);return sh(a,b,c,f)}
+function th(a,b){return function(c){return b.call(a,c,this)}}
+function vh(a,b,c){var d=[];d.push(T(a,m,b,c));E.type==1&&d.push(T(a,ka,b,c));return d}
+function U(a,b,c,d){return v(a,b,n(d,c),c)}
+function wh(a,b,c,d,f){return v(a,b,n(d,c),f)}
+function fd(a,b,c,d){rg(d);var f=v(a,b,function(){c.apply(a,arguments);w(f);sg(d)});
+return f}
+function xh(a,b,c,d,f){return fd(a,b,n(d,c),f)}
+function yh(a,b,c){return v(a,b,zh(b,c))}
+function zh(a,b){return function(){var c=[b,a];Ke(c,arguments);A.apply(this,c)}}
+function Ah(a,b){return function(c){A(b,a,c)}}
+function mh(){this.Ts=i}
+mh.prototype.gT=function(a){this.Ts=a};
+mh.prototype.make=function(a,b,c,d,f){return this.Ts?new this.Ts(a,b,c,d,f):i};
+Og.g=function(a,b,c,d,f){this.Wb=a;this.yj=b;this.xh=c;this.Gs=i;this.RR=d;this.Dd=f||i;this.Fa=-1;oh(a,b,e).push(this)};
+l=Og.prototype;l.zJ=function(){return this.Gs=n(function(a){if(!a)a=window.event;if(a&&!a.target)try{a.target=a.srcElement}catch(b){}var c=this.bt([a]);if(a&&m==a.type)if((a=a.srcElement)&&"A"==a.tagName&&"javascript:void(0)"==a.href)return j;return c},
+this)};
+l.remove=function(){if(this.Wb){switch(this.RR){case 1:this.Wb.removeEventListener(this.yj,this.xh,j);break;case 4:this.Wb.removeEventListener(this.yj,this.xh,e);break;case 2:this.Wb.detachEvent("on"+this.yj,this.Gs);break;case 3:this.Wb["on"+this.yj]=i;break}xe(oh(this.Wb,this.yj),this);this.Gs=this.xh=this.Wb=i}};
+l.Zo=function(a){this.Fa=a};
+l.RC=function(a){return this.Dd===a};
+l.bt=function(a){if(this.Wb)return this.xh.apply(this.Wb,a)};
+x(mh).gT(Og);function Bh(a,b){this.moduleUrlsFn=a;this.moduleDependencies=b}
+function Ch(){this.ac=[]}
+Ch.prototype.init=function(a,b){var c=this.Ra=new Bh(a,b);t(this.ac,function(d){d(c)});
+ff(this.ac)};
+Ch.prototype.iA=function(a){this.Ra?a(this.Ra):this.ac.push(a)};
+function gd(){this.NE={};this.Hu={};this.ac={};this.St={};this.Eq=new Ch;this.Ac={};this.dr=i}
+l=gd.prototype;l.init=function(a,b){this.Eq.init(a,b)};
+l.kM=function(a,b){var c=this.Ac;this.Eq.iA(function(d){(d=d.moduleUrlsFn(a))&&b(d,c[a])})};
+l.tS=function(a,b,c,d,f){A(this,"modulerequired",a,b);if(this.Hu[a])c(this.St[a]);else{this.ac[a]||(this.ac[a]=[]);this.ac[a].push(c);f||this.BC(a,b,d)}};
+l.BC=function(a,b,c){if(!this.Hu[a]){c&&this.Qz(a,c);if(!this.NE[a]){this.NE[a]=e;A(this,"moduleload",a,b);this.dr&&this.Qz(a,this.dr);this.Eq.iA(n(function(d){t(d.moduleDependencies[a],n(function(f){this.BC(f,undefined,c)},
+this));this.iw(a,"jss");this.kM(a,Dh)},
+this))}}};
+l.require=function(a,b,c,d,f){this.tS(a,b,function(g){c(g[b])},
+d,f)};
+l.provide=function(a,b,c){var d=this.St;d[a]||(d[a]={});if(typeof this.hw=="number"){this.iw(a,"jsl",this.hw);delete this.hw}if(ue(b))d[a][b]=c;else this.mN(a)};
+l.mN=function(a){this.Hu[a]=e;var b=this.St[a];t(this.ac[a],function(c){c(b)});
+delete this.ac[a];this.iw(a,"jsd");A(this,Sa,a)};
+l.XS=function(a){this.dr=a};
+l.Qz=function(a,b){var c=this.Ac;if(c[a]){for(var d=0;d<r(c[a]);++d)if(c[a][d]==b)return;c[a].push(b)}else c[a]=[b];b.branch()};
+l.iw=function(a,b,c){var d=this.Ac;if(!d[a]&&b=="jss")d[a]=[new cd("jsloader-"+a)];else{var f=d[a];if(f){for(var g=0;g<r(f);++g)f[g].tick(b+"."+a,c);if(b=="jsd"){for(g=0;g<r(f);++g)f[g].done();delete d[a]}}}};
+l.EU=function(){this.hw=ed()};
+function Eh(a){x(gd).EU();eval(a)}
+window.__gjsload_maps2_api__=Eh;function vd(a,b,c,d,f){x(gd).require(a,b,c,d,f)}
+function V(a,b,c){x(gd).provide(a,b,c)}
+function Wc(a,b){x(gd).init(a,b)}
+function wd(a,b,c){return function(){var d=arguments;vd(a,b,function(f){f.apply(i,d)},
+c)}}
+function dd(a){x(gd).XS(a)}
+;function Fh(a,b){a.prototype&&Gh(a.prototype,Hh(b));Gh(a,b)}
+function Gh(a,b){tc(a,function(d,f){if(typeof f==re)var g=a[d]=function(){var h=arguments,k;b(n(function(o){if((o=(o||a)[d])&&o!=g)k=o.apply(this,h);else aa(new Error("No implementation for ."+d))},
+this),f.defer===e);c||(k=f.apply(this,h));return k}},
+j);var c=j;b(function(d){c=e;d!=a&&De(a,d,e)},
+e)}
+function Ih(a,b,c){function d(f,g){vd(b,c,f,undefined,g)}
+Fh(a,d)}
+function Jh(a){var b=function(){return a.apply(this,arguments)};
+p(b,a);b.defer=e;return b}
+function Hh(a){return function(b,c,d){a(function(f){f?b(f.prototype):b(undefined)},
+c,d)}}
+function Kh(a,b,c,d,f){function g(h,k,o){vd(b,c,h,o,k)}
+Lh(a.prototype,d,Hh(g));Lh(a,f||{},g)}
+function Lh(a,b,c){tc(b,function(d,f){a[d]=function(){var g=arguments,h=undefined;c(n(function(k){h=k[d].apply(this,g)},
+this),f);return h}})}
+;function Mh(){Mh.g.apply(this,arguments)}
+function Nh(){Nh.g.apply(this,arguments)}
+p(Nh,Mh);Mh.g=function(a){if(a){this.left=a.offsetLeft;this.top=a.offsetTop}};
+var Oh=function(){},
+Ph=function(){};
+Mh.qe=Oh;Mh.Yk=Oh;Mh.Xf=N;Mh.Dj=N;l=Mh.prototype;l.qe=Oh;l.Yk=Oh;l.Xf=N;l.Dj=N;l.moveBy=Oh;l.uc=Ph;l.moveTo=Oh;l.Vt=Ph;l.disable=N;l.enable=N;l.enabled=N;l.dragging=N;l.gm=N;l.Fu=Oh;Ih(Mh,"drag",1);Kh(Nh,"drag",2,{},{g:j});function Qh(){}
+;var Rh="hideWhileLoading",Sh="__src__",Th="isPending";function Uh(){this.ca={};this.zf=new Vh;this.zf.pT(20);this.zf.To(e);this.DB=i;Db&&vd("urir",Wa,n(function(a){this.DB=new a(Db)},
+this))}
+var Wh=function(){this.ob=new Image};
+Wh.prototype.SF=function(a){this.ob.src=a};
+Wh.prototype.KF=function(a){this.ob.onload=a};
+Wh.prototype.JF=function(a){this.ob.onerror=a};
+Wh.prototype.O=function(){return new R(this.ob.width,this.ob.height)};
+var Xh=function(a,b){this.Gn(a,b)};
+l=Xh.prototype;l.Gn=function(a,b){this.Da=a;this.Ef=[b];this.qp=0;this.Vd=new R(NaN,NaN)};
+l.We=function(){return this.qp};
+l.GH=function(a){this.Ef.push(a)};
+l.load=function(){this.qp=1;this.ob=new Wh;this.ob.KF(uf(this,this.ur,2));this.ob.JF(uf(this,this.ur,3));var a=be(this),b=n(function(){a.sc()&&this.ob.SF(this.Da)},
+this);x(Uh).zf.Cf(b)};
+l.ur=function(a){this.qp=a;if(this.complete())this.Vd=this.ob.O();delete this.ob;a=0;for(var b=r(this.Ef);a<b;++a)this.Ef[a](this);ff(this.Ef)};
+l.HI=function(){ce(this);this.ob.KF(i);this.ob.JF(i);this.ob.SF(Rc);this.ur(4)};
+l.complete=function(){return this.qp==2};
+Uh.prototype.fetch=function(a,b){var c=this.ca[a];if(c)switch(c.We()){case 0:case 1:c.GH(b);return;case 2:b(c,e);return}c=this.ca[a]=new Xh(a,b);c.load()};
+Uh.prototype.remove=function(a){this.rG(a);delete this.ca[a]};
+Uh.prototype.rG=function(a){var b=this.ca[a];if(b&&b.We()==1){b.HI();delete this.ca[a]}};
+Uh.prototype.nn=function(a){return!!this.ca[a]&&this.ca[a].complete()};
+var Zh=function(a,b,c){c=c||{};var d=x(Uh);if(a[Rh])if(a.tagName=="DIV")a.style.filter="";else a.src=Rc;a[Sh]=b;a[Th]=e;var f=be(a),g=function(k){d.fetch(k,function(o,q){Yh(f,a,o,k,q,c)})},
+h=d.DB;h!=i?h.renderUriAsync(b,g):g(b)},
+Yh=function(a,b,c,d,f,g){var h=function(){if(a.sc())a:{var k=g;k=k||{};b[Th]=j;b.preCached=f;switch(c.We()){case 3:k.onErrorCallback&&k.onErrorCallback(d,b);break a;case 4:break a;case 2:break;default:break a}var o=E.type==1&&ef(b.src,Rc);if(b.tagName=="DIV"){$h(b,d,k.scale);o=e}if(o)Cf(b,k.size||c.Vd);b.src=d;k.onLoadCallback&&k.onLoadCallback(d,b)}};
+E.Jn()?h():x(Uh).zf.Cf(h)};
+function ai(a,b,c){return function(d,f){a||x(Uh).remove(d);b&&b(d,f);sg(c)}}
+function Qc(a,b,c,d,f,g){f=f||{};var h=f.cache!==j;rg(g);var k=ai(h,f.onLoadCallback,g);h=ai(h,f.onErrorCallback,g);g=d&&f.scale;k={scale:g,size:d,onLoadCallback:k,onErrorCallback:h};if(f.alpha&&E.ox()){c=J("div",b,c,d,e);c.scaleMe=g;Xf(c)}else{c=J("img",b,c,d,e);c.src=Rc}if(f.hideWhileLoading)c[Rh]=e;c.imageFetcherOpts=k;Zh(c,a,k);f.printOnly&&eg(c);gg(c);if(E.type==1)c.galleryImg="no";if(f.styleClass)dg(c,f.styleClass);else{c.style.border="0px";c.style.padding="0px";c.style.margin="0px"}sh(c,ja,
+Ug);b&&Df(b,c);return c}
+function bi(a){return!!a[Sh]&&a[Sh]==a.src}
+function ci(a){x(Uh).rG(a[Sh]);a[Th]=j}
+function di(a){return we(a)&&ef(a.toLowerCase(),".png")}
+function ei(a){fi||(fi=new RegExp('"',"g"));return a.replace(fi,"\\000022")}
+var fi;function gi(a){var b=og(a);return a.replace(b,escape(b))}
+function $h(a,b,c){a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod="+(c?"scale":"crop")+',src="'+gi(ei(b))+'")'}
+function hi(a,b,c,d,f,g,h,k){b=J("div",b,f,d);Xf(b);if(c)c=new S(-c.x,-c.y);if(!h){h=new Qh;h.alpha=e}Qc(a,b,c,g,h,k).style["-khtml-user-drag"]="none";return b}
+function ii(a,b,c){Cf(a,b);Bf(a.firstChild,new S(0-c.x,0-c.y))}
+var ji=0,ki=new Qh;ki.alpha=e;ki.cache=e;function li(a,b,c){b=(b.charAt(0)==ga?b.substr(1):b).split(ga);a=a;for(var d=r(b),f=0,g=d-1;f<g;++f){var h=b[f];a[h]||(a[h]={});a=a[h]}a[b[d-1]]=c}
+;function mi(){mi.g.apply(this,arguments)}
+Kh(mi,"kbrd",1,{},{g:j});function ni(a){var b={};tc(a,function(c,d){c=encodeURIComponent(c);d=encodeURIComponent(d);b[c]=d});
+return of(b,ea,fa)}
+;function oi(){}
+;l=oi.prototype;l.initialize=function(){aa("Required interface method not implemented: initialize")};
+l.remove=function(){aa("Required interface method not implemented: remove")};
+l.copy=function(){aa("Required interface method not implemented: copy")};
+l.redraw=function(){aa("Required interface method not implemented: redraw")};
+l.Ea=function(){return"Overlay"};
+function pi(a){return K(a*-100000)<<5}
+oi.prototype.show=function(){aa("Required interface method not implemented: show")};
+oi.prototype.hide=function(){aa("Required interface method not implemented: hide")};
+oi.prototype.I=function(){aa("Required interface method not implemented: isHidden")};
+oi.prototype.ya=function(){return j};
+oi.re=function(a,b){a.XQ=b};
+oi.rd=function(a){return a.XQ};function qi(){}
+l=qi.prototype;l.initialize=function(){aa("Required interface method not implemented")};
+l.ba=function(){aa("Required interface method not implemented")};
+l.ka=function(){aa("Required interface method not implemented")};
+l.Vf=function(){};
+l.Lj=function(){return j};
+l.oB=function(){return i};function ri(){this.hx={};this.uj=[];this.mW={};this.ak=i}
+ri.prototype.CC=function(a,b){if(b)for(var c=0;c<r(this.uj);++c){var d=this.uj[c];if(d.url==a){Ke(d.ui,b);break}}if(!this.hx[a]){this.hx[a]=e;c=[];b&&Ke(c,b);this.uj.push({url:a,ui:c});if(!this.ak)this.ak=qg(this,this.QO,0)}};
+ri.prototype.TO=function(a,b){for(var c=0;c<r(a);++c)this.CC(a[c],b)};
+ri.prototype.QO=function(){var a=this.iJ();this.ak&&clearTimeout(this.ak);this.ak=i;var b=Hg();b&&t(a,n(function(c){var d=c.url;si(c.ui);c=document.createElement("script");T(c,"error",this,function(){});
+c.setAttribute("type","text/javascript");c.setAttribute("charset","UTF-8");c.setAttribute("src",d);b.appendChild(c)},
+this))};
+var si=function(a){t(a,function(b){if(!b.WE){b.WE=e;for(var c=0;b.getTick("sf_"+c);)c++;b.tick("sf_"+c)}});
+t(a,function(b){delete b.WE})};
+ri.prototype.iJ=function(){var a=r("/cat_js")+6,b=[],c=[],d=[],f,g,h;t(this.uj,function(o){var q=o.url,s=o.ui,u=ti(q)[4];if(ui(u)){o=q.substr(0,q.indexOf(u));var H=u.substr(0,u.lastIndexOf(".")).split("/");if(r(c)){for(var G=0;r(H)>G&&g[G]==H[G];)++G;u=g.slice(0,G);var I=g.slice(G).join("/"),M=H.slice(G).join("/"),Y=h+1+r(M);if(I)Y+=(r(c)-1)*(r(I)+1);if(o==f&&r(c)<30&&G>1&&ui(u.join("/"),e)&&Y<=2048){if(I){q=0;for(o=r(c);q<o;++q)c[q]=I+"/"+c[q]}c.push(M);Ke(d,s);h=Y;g=u;return}else{u=vi(f,g,c,h);
+b.push({url:u,ui:d})}}c=[H.pop()];d=[];Ke(d,s);f=o;g=H;h=r(q)+a}else{if(r(c)){u=vi(f,g,c,h);b.push({url:u,ui:d});c=[];d=[]}b.push(o)}});
+if(r(c)){var k=vi(f,g,c,h);b.push({url:k,ui:d})}ff(this.uj);return b};
+var ui=function(a,b){if(!ob)return j;var c=ui;if(!c.VD){c.VD=/^(?:\/intl\/[^\/]+)?\/mapfiles(?:\/|$)/;c.GK=/.js$/}return c.VD.test(a)&&(b||c.GK.test(a))},
+vi=function(a,b,c,d){if(r(c)>1){a=a+"/cat_js"+b.join("/")+"/%7B"+c.join(",")+"%7D.js";d==r(a);return a}return a+b.join("/")+"/"+c[0]+".js"};
+function Dh(a,b){var c=x(ri);typeof a=="string"?c.CC(a,b):c.TO(a,b)}
+;function Ai(){this.aF={};this.jD={}}
+l=Ai.prototype;l.fM=function(a,b,c){var d=[],f=lf(r(a),function(){b.apply(i,d)});
+t(a,n(function(g,h){this.get(g,function(k){d[h]=k;f()},
+c)},
+this))};
+l.set=function(a,b){this.WA(a).set(b)};
+l.get=function(a,b,c){a=this.WA(a);a.get(b,c);a.init(this)};
+l.AM=function(a,b){return this.sM(a,b)};
+l.sM=function(a,b){b=b||0;var c=a+"."+b,d=this.jD[c];if(!d){d=new Bi;d.rT(a,b);this.jD[c]=d}return d};
+l.WA=function(a){if(a instanceof Bi)return a;var b=this.aF[gc(a)];if(!b){b=new Bi;this.wT(a,b)}return b};
+l.wT=function(a,b){this.aF[gc(a)]=b};
+function Bi(){this.ov=i;this.wo=[];this.WD=[];this.Rt=i;this.ew=0;this.mH=j}
+l=Bi.prototype;l.set=function(a){this.ov=a;for(var b=0,c=r(this.wo);b<c;b++){this.wo[b](a);sg(this.WD[b])}this.wo=[]};
+l.get=function(a,b){if(this.ov)a(this.ov);else{this.wo.push(a);rg(b);this.WD.push(b)}};
+l.rT=function(a,b){this.Rt=a;this.ew=b};
+l.init=function(a){if(this.Rt&&!this.mH){this.mH=e;vd(this.Rt,this.ew,n(this.BQ,this,a))}};
+l.BQ=function(a,b){b&&b(a,this);this.ew==0&&a.set(this,{})};function Ci(a){this.ticks=a;this.tick=0}
+Ci.prototype.reset=function(){this.tick=0};
+Ci.prototype.next=function(){this.tick++;return(Math.sin(Math.PI*(this.tick/this.ticks-0.5))+1)/2};
+Ci.prototype.more=function(){return this.tick<this.ticks};
+Ci.prototype.extend=function(){if(this.tick>this.ticks/3)this.tick=K(this.ticks/3)};function Di(a){this.jl=ed();this.Dm=a;this.Tt=e}
+Di.prototype.reset=function(){this.jl=ed();this.Tt=e};
+Di.prototype.next=function(){var a=ed()-this.jl;if(a>=this.Dm){this.Tt=j;return 1}else return(Math.sin(Math.PI*(a/this.Dm-0.5))+1)/2};
+Di.prototype.more=function(){return this.Tt};
+Di.prototype.extend=function(){var a=ed();if(a-this.jl>this.Dm/3)this.jl=a-K(this.Dm/3)};function Ei(a){if(r(arguments)<1)return"";var b=/([^%]*)%(\d*)\$([#|-|0|+|\x20|\'|I]*|)(\d*|)(\.\d+|)(h|l|L|)(s|c|d|i|b|o|u|x|X|f)(.*)/,c;switch(F(1415)){case ".":c=/(\d)(\d\d\d\.|\d\d\d$)/;break;default:c=new RegExp("(\\d)(\\d\\d\\d"+F(1415)+"|\\d\\d\\d$)")}var d;switch(F(1416)){case ".":d=/(\d)(\d\d\d\.)/;break;default:d=new RegExp("(\\d)(\\d\\d\\d"+F(1416)+")")}for(var f="$1"+F(1416)+"$2",g="",h=a,k=b.exec(a);k;){h=k[3];var o=-1;if(k[5].length>1)o=Math.max(0,hf(k[5].substr(1)));var q=k[7],s="",
+u=hf(k[2]);if(u<r(arguments))s=arguments[u];u="";switch(q){case "s":u+=s;break;case "c":u+=String.fromCharCode(hf(s));break;case "d":case "i":u+=hf(s).toString();break;case "b":u+=hf(s).toString(2);break;case "o":u+=hf(s).toString(8).toLowerCase();break;case "u":u+=Math.abs(hf(s)).toString();break;case "x":u+=hf(s).toString(16).toLowerCase();break;case "X":u+=hf(s).toString(16).toUpperCase();break;case "f":u+=o>=0?Math.round(parseFloat(s)*Math.pow(10,o))/Math.pow(10,o):parseFloat(s);break;default:break}if(h.search(/I/)!=
+-1&&h.search(/\'/)!=-1&&(q=="i"||q=="d"||q=="u"||q=="f")){h=u=u.replace(/\./g,F(1415));u=h.replace(c,f);if(u!=h){do{h=u;u=h.replace(d,f)}while(h!=u)}}g+=k[1]+u;h=k[8];k=b.exec(h)}return g+h}
+;function cd(){cd.g.apply(this,arguments)}
+;var Fi=/[~.,?&]/g,Gi=j;cd.g=function(a,b){this.Uf=a.replace(Fi,"-");this.yi=[];this.BG={};this.cD=this.ue=b||ed();this.Jr=1;this.LE=0;this.Af={};this.Wi={};this.Bn={};this.hj="";this.WV={};this.Up=j};
+l=cd.prototype;l.CH=function(){this.Up=e};
+l.getTick=function(a){if(a=="start")return this.ue;return this.BG[a]};
+l.adopt=function(a){if(!(!a||typeof a.start=="undefined")){this.ue=a.start;this.oP(a)}};
+l.oP=function(a){a&&tc(a,n(function(b,c){b!="start"&&this.tick(b,c)},
+this))};
+l.tick=function(a,b){window.gErrorLogger&&window.gErrorLogger.tick&&window.gErrorLogger.tick(this.Uf,a);b=b||ed();if(b>this.cD)this.cD=b;for(var c=b-this.ue,d=r(this.yi);d>0&&this.yi[d-1][1]>c;)d--;this.yi.splice(d||0,0,[a,c]);this.BG[a]=b};
+l.done=function(a,b){a&&this.tick(a);this.Jr--;this.LE>0&&this.Uf.indexOf("-LATE")==-1&&this.bT(this.Uf+"-LATE");if(this.Jr<=0){this.LE++;if(this.hj)this.OJ(b||document);r(this.yi)>0&&this.oS();if(!Ee(this.Af)||!Ee(this.Bn))this.kS();this.Pr()}};
+l.Pr=function(){};
+l.branch=function(a){a&&this.tick(a);this.Jr++};
+l.timers=function(){return this.yi};
+l.oS=function(){if(!this.Up){A(this,"beforereport");A(cd,"report",this.Uf,this.yi,this.Wi)}};
+l.kS=function(){if(!this.Up){if(!Ee(this.Af)&&!Ee(this.Wi))this.Af.cad=ni(this.Wi);A(cd,"reportaction",this.Af,this.Bn);Fe(this.Af);Fe(this.Wi);Fe(this.Bn)}};
+l.bT=function(a){this.Uf=a.replace(Fi,"-")};
+l.action=function(a){var b=[],c=i,d=j;Hi(a,function(f){var g=Ii(f);if(g){b.unshift(g);c||(c=f.getAttribute("jsinstance"))}if(!d&&f.getAttribute("jstrack"))d=e});
+if(d){this.Af.ct=this.Uf;r(b)>0&&this.Xg("oi",b.join(ga));if(c){c=c.charAt(0)==da?hf(c.substr(1)):hf(c);this.Af.cd=c}}};
+l.Xg=function(a,b){this.Wi[a]=b};
+l.impression=function(a){this.tick("imp0");var b=[];a.parentNode&&Hi(a.parentNode,function(d){(d=Ii(d))&&b.unshift(d)});
+var c=this.Bn;Ji(a,function(d){if(d=Ii(d)){b.push(d);d=b.join(ga);c[d]||(c[d]=0);c[d]++;return e}return j},
+function(){b.pop()});
+this.tick("imp1")};
+l.OJ=function(a){if(this.hj){a.cookie="TR=; path=/; domain=.google.com; expires=01/01/1970 00:00:00";A(cd,"dapperreport",this.hj,this.ue,ed(),this.Uf)}Gi=j};
+var Hi=function(a,b){for(a=a;a&&a!=document.body;a=a.parentNode)b(a)},
+Ji=function(a,b,c){if(!(a.nodeType!=1||ig(a).display=="none"||ig(a).visibility=="hidden")){for(var d=b(a),f=a.firstChild;f;f=f.nextSibling)arguments.callee(f,b,c);d&&c()}},
+Ii=function(a){if(!a.__oi&&a.getAttribute)a.__oi=a.getAttribute("oi");return a.__oi},
+Eg=function(a,b,c){a&&a.tick(b,c)},
+rg=function(a,b){a&&a.branch(b)},
+sg=function(a,b,c){a&&a.done(b,c)};function Ki(){Ki.g.apply(this,arguments)}
+;Ki.g=function(){this.Gd={}};
+l=Ki.prototype;l.set=function(a,b){this.Gd[a]=b;return this};
+l.sT=function(a){De(this.Gd,a)};
+l.remove=function(a){delete this.Gd[a]};
+l.get=function(a){return this.Gd[a]};
+l.Xe=function(a,b,c){if(c){this.set("hl",_mHL);_mGL&&this.set("gl",_mGL)}c=this.wM();b=b?b:_mUri;return c?(a?"":_mHost)+b+"?"+c:(a?"":_mHost)+b};
+l.wM=function(){return mg(this.Gd)};Ki.prototype.Cv=function(a){a.ha()&&Li(this.Gd,a,e,e,"m");hc!=i&&hc!=""&&this.set("key",hc);ic!=i&&ic!=""&&this.set("client",ic);jc!=i&&jc!=""&&this.set("channel",jc);kc!=i&&kc!=""&&this.set("sensor",kc);this.set("mapclient","jsapi")};
+Ki.prototype.Pv=function(a,b){this.set("ll",a);this.set("spn",b)};function Mi(a,b){this.f=a;this.Jp=b;b={};b.neat=e;this.Ha=new wg(_mHost+"/maps/vp",window.document,b);U(a,Da,this,this.Sh);var c=n(this.Sh,this);U(a,Ca,i,function(){window.setTimeout(c,0)});
+U(a,Ea,this,this.po)}
+l=Mi.prototype;l.Sh=function(){var a=this.f;if(this.Ul!=a.F()||this.o!=a.o){this.WJ();this.zg();this.Zg(0,0,e)}else{var b=a.T(),c=a.H().sb();a=K((b.lat()-this.qx.lat())/c.lat());b=K((b.lng()-this.qx.lng())/c.lng());this.Me="p";this.Zg(a,b,e)}};
+l.po=function(){this.zg();this.Zg(0,0,j)};
+l.zg=function(){var a=this.f;this.qx=a.T();this.o=a.o;this.Ul=a.F();this.j={}};
+l.WJ=function(){var a=this.f,b=a.F();if(this.Ul&&this.Ul!=b)this.Me=this.Ul<b?"zi":"zo";if(this.o){a=a.o.getUrlArg();b=this.o.getUrlArg();if(b!=a)this.Me=b+a}};
+l.Zg=function(a,b,c){if(!(this.f.allowUsageLogging&&!this.f.allowUsageLogging())){a=a+","+b;if(!this.j[a]){this.j[a]=1;if(c){var d=new Ki;d.Cv(this.f);d.set("vp",d.get("ll"));d.remove("ll");this.Jp!="m"&&d.set("mapt",this.Jp);if(this.Me){d.set("ev",this.Me);this.Me=""}this.f.Pf&&d.set("output","embed");c={};Ge(c,ng(og(document.location.href)),["host","e","expid","source_ip"]);A(this.f,"reportpointhook",c);tc(c,function(f,g){g!=i&&d.set(f,g)});
+this.Ha.send(d.Gd);A(this.f,"viewpointrequest")}}}};
+l.wE=function(){var a=new Ki;a.Cv(this.f);a.set("vp",a.get("ll"));a.remove("ll");this.Jp!="m"&&a.set("mapt",this.Jp);window._mUrlHostParameter&&a.set("host",window._mUrlHostParameter);this.f.Pf&&a.set("output","embed");a.set("ev","r");var b={};A(this.f,"refreshpointhook",b);tc(b,function(c,d){d!=i&&a.set(c,d)});
+this.Ha.send(a.Gd);A(this.f,"viewpointrequest")};function ti(a){Ni||(Ni=/^(?:([^:\/?#]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/?#:@]*)(?::([0-9]+))?)?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/);(a=a.match(Ni))&&a.shift();return a}
+var Ni;var Oi=new RegExp("[\u0591-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]"),Pi=new RegExp("^[^A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]*[\u0591-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]"),Qi=new RegExp("^[\u0000- !-@[-`{-\u00bf\u00d7\u00f7\u02b9-\u02ff\u2000-\u2bff]*$|^http://");var Ri,Si,Ti=["q_d","l_d","l_near","d_d","d_daddr"],Ui,Vi=j;function Wi(){return typeof _mIsRtl=="boolean"?_mIsRtl:j}
+function Xi(a,b){if(!a)return Wi();if(b)return Oi.test(a);var c=b=0;a=a.split(" ");for(var d=0;d<a.length;d++)if(Pi.test(a[d])){b++;c++}else Qi.test(a[d])||c++;return(c==0?0:b/c)>0.4}
+function Yi(a,b){return Xi(a,b)?"rtl":"ltr"}
+function Zi(a,b){return Xi(a,b)?"right":"left"}
+function $i(a,b){return Xi(a,b)?"left":"right"}
+function aj(a){var b=a.target||a.srcElement;setTimeout(function(){if(Vi){var c=Yi(b.value),d=Zi(b.value);b.setAttribute("dir",c);b.style.textAlign=d}},
+0)}
+function bj(a){a=Nf(a);if(a!=i){sh(a,qa,aj);sh(a,wa,aj)}}
+function cj(a,b){return Xi(a,b)?"\u200f":"\u200e"}
+function dj(a,b){return'<span dir="'+Yi(a,b)+'">'+(b?a:cf(a))+"</span>"+cj()}
+function ej(a){if(!Ui)return a;return(Xi(a)?"\u202b":"\u202a")+a+"\u202c"+cj()}
+if(typeof jb=="string"&&typeof _mHL=="string"){var fj=jb.split(",");if(Ce(fj,_mHL)){t(Ti,bj);Vi=e}}Wi();var gj=Wi()?"Left":"Right";Ri=Wi()?"right":"left";Wi();Si="margin"+gj;Ui=E.os!=2||E.type==4||Wi();function hj(){try{if(typeof ActiveXObject!="undefined")return new ActiveXObject("Microsoft.XMLHTTP");else if(window.XMLHttpRequest)return new XMLHttpRequest}catch(a){}return i}
+function ij(a,b,c,d,f){var g=hj();if(!g)return j;if(b){rg(f);g.onreadystatechange=function(){if(g.readyState==4){var h;h=-1;var k=i;try{h=g.status;k=g.responseText}catch(o){}h={status:h,responseText:k};b(h.responseText,h.status);g.onreadystatechange=N;sg(f)}}}if(c){g.open("POST",
+a,e);(a=d)||(a="application/x-www-form-urlencoded");g.setRequestHeader("Content-Type",a);g.send(c)}else{g.open("GET",a,e);g.send(i)}return e}
+;function Vh(){this.Xc=[];this.ol=i;this.iv=j;this.Pp=0;this.$C=100;this.hR=0;this.nx=j}
+l=Vh.prototype;l.pT=function(a){this.$C=a};
+l.To=function(a){this.nx=a};
+l.XP=function(a,b){aa(b)};
+l.Cf=function(a,b){this.Xc.push([a,b]);rg(b);this.VE();this.nx&&this.nE()};
+l.cancel=function(){this.nU();for(var a=0;a<this.Xc.length;++a)sg(this.Xc[a][1]);ff(this.Xc)};
+l.nU=function(){window.clearTimeout(this.ol);this.ol=i};
+l.nE=function(){if(!this.iv){this.iv=e;try{for(;r(this.Xc)&&this.Pp<this.$C;){var a=this.Xc.shift();this.IS(a[0]);sg(a[1])}}finally{this.iv=j;if(this.Pp||r(this.Xc))this.VE()}}};
+l.VE=function(){if(!this.ol)this.ol=qg(this,this.JQ,this.hR)};
+l.JQ=function(){this.ol=i;this.Pp=0;this.nE()};
+l.IS=function(a){var b=ed();try{a(this)}catch(c){this.XP(a,c)}this.Pp+=ed()-b};function z(){z.g.apply(this,arguments)}
+function id(){id.g.apply(this,arguments)}
+;function jj(a,b){if(a==-ee&&b!=ee)a=ee;if(b==-ee&&a!=ee)b=ee;this.lo=a;this.hi=b}
+l=jj.prototype;l.Yd=function(){return this.lo>this.hi};
+l.ma=function(){return this.lo-this.hi==2*ee};
+l.ZB=function(){return this.hi-this.lo==2*ee};
+l.intersects=function(a){var b=this.lo,c=this.hi;if(this.ma()||a.ma())return j;if(this.Yd())return a.Yd()||a.lo<=this.hi||a.hi>=b;else{if(a.Yd())return a.lo<=c||a.hi>=b;return a.lo<=c&&a.hi>=b}};
+l.Hq=function(a){var b=this.lo,c=this.hi;if(this.Yd()){if(a.Yd())return a.lo>=b&&a.hi<=c;return(a.lo>=b||a.hi<=c)&&!this.ma()}else{if(a.Yd())return this.ZB()||a.ma();return a.lo>=b&&a.hi<=c}};
+l.contains=function(a){if(a==-ee)a=ee;var b=this.lo,c=this.hi;return this.Yd()?(a>=b||a<=c)&&!this.ma():a>=b&&a<=c};
+l.extend=function(a){if(!this.contains(a))if(this.ma())this.lo=this.hi=a;else if(this.distance(a,this.lo)<this.distance(this.hi,a))this.lo=a;else this.hi=a};
+l.equals=function(a){if(this.ma())return a.ma();return fe(a.lo-this.lo)%2*ee+fe(a.hi-this.hi)%2*ee<=1.0E-9};
+l.distance=function(a,b){var c=b-a;if(c>=0)return c;return b+ee-(a-ee)};
+l.span=function(){return this.ma()?0:this.Yd()?2*ee-(this.lo-this.hi):this.hi-this.lo};
+l.center=function(){var a=(this.lo+this.hi)/2;if(this.Yd()){a+=ee;a=te(a,-ee,ee)}return a};
+function kj(a,b){this.lo=a;this.hi=b}
+l=kj.prototype;l.ma=function(){return this.lo>this.hi};
+l.intersects=function(a){var b=this.lo,c=this.hi;return b<=a.lo?a.lo<=c&&a.lo<=a.hi:b<=a.hi&&b<=c};
+l.Hq=function(a){if(a.ma())return e;return a.lo>=this.lo&&a.hi<=this.hi};
+l.contains=function(a){return a>=this.lo&&a<=this.hi};
+l.extend=function(a){if(this.ma())this.hi=this.lo=a;else if(a<this.lo)this.lo=a;else if(a>this.hi)this.hi=a};
+l.equals=function(a){if(this.ma())return a.ma();return fe(a.lo-this.lo)+fe(this.hi-a.hi)<=1.0E-9};
+l.span=function(){return this.ma()?0:this.hi-this.lo};
+l.center=function(){return(this.hi+this.lo)/2};z.g=function(a,b,c){a-=0;b-=0;if(!c){a=se(a,-90,90);b=te(b,-180,180)}this.df=a;this.x=this.Ua=b;this.y=a};
+l=z.prototype;l.toString=function(){return"("+this.lat()+", "+this.lng()+")"};
+l.equals=function(a){if(!a)return j;return Se(this.lat(),a.lat())&&Se(this.lng(),a.lng())};
+l.copy=function(){return new z(this.lat(),this.lng())};
+l.Cp=function(a){return new z(this.df,this.Ua+a,e)};
+l.Zt=function(a){return this.Cp(K((a.Ua-this.Ua)/360)*360)};
+function lj(a,b){b=Math.pow(10,b);return Math.round(a*b)/b}
+l=z.prototype;l.Aa=function(a){a=ue(a)?a:6;return lj(this.lat(),a)+","+lj(this.lng(),a)};
+l.lat=function(){return this.df};
+l.lng=function(){return this.Ua};
+l.lT=function(a){a-=0;this.y=this.df=a};
+l.yF=function(a){a-=0;this.x=this.Ua=a};
+l.$d=function(){return Qe(this.df)};
+l.ff=function(){return Qe(this.Ua)};
+l.Pb=function(a,b){return this.rx(a)*(b||6378137)};
+l.rx=function(a){var b=this.$d(),c=a.$d(),d=b-c;a=this.ff()-a.ff();return 2*ge(pe(ne(oe(d/2),2)+le(b)*le(c)*ne(oe(a/2),2)))};
+z.fromUrlValue=function(a){a=a.split(",");return new z(parseFloat(a[0]),parseFloat(a[1]))};
+var mj=function(a,b,c){return new z(Re(a),Re(b),c)};
+z.prototype.MG=function(){return this.lng()+","+this.lat()};
+id.g=function(a,b){if(a&&!b)b=a;if(a){var c=se(a.$d(),-ee/2,ee/2),d=se(b.$d(),-ee/2,ee/2);this.Ia=new kj(c,d);a=a.ff();b=b.ff();if(b-a>=ee*2)this.Ja=new jj(-ee,ee);else{a=te(a,-ee,ee);b=te(b,-ee,ee);this.Ja=new jj(a,b)}}else{this.Ia=new kj(1,-1);this.Ja=new jj(ee,-ee)}};
+l=id.prototype;l.T=function(){return mj(this.Ia.center(),this.Ja.center())};
+l.toString=function(){return"("+this.nb()+", "+this.mb()+")"};
+l.Aa=function(a){var b=this.nb(),c=this.mb();return[b.Aa(a),c.Aa(a)].join(",")};
+l.equals=function(a){return this.Ia.equals(a.Ia)&&this.Ja.equals(a.Ja)};
+l.contains=function(a){return this.Ia.contains(a.$d())&&this.Ja.contains(a.ff())};
+l.intersects=function(a){return this.Ia.intersects(a.Ia)&&this.Ja.intersects(a.Ja)};
+l.kc=function(a){return this.Ia.Hq(a.Ia)&&this.Ja.Hq(a.Ja)};
+l.extend=function(a){this.Ia.extend(a.$d());this.Ja.extend(a.ff())};
+l.union=function(a){this.extend(a.nb());this.extend(a.mb())};
+l.Oc=function(){return Re(this.Ia.hi)};
+l.qc=function(){return Re(this.Ia.lo)};
+l.rc=function(){return Re(this.Ja.lo)};
+l.pc=function(){return Re(this.Ja.hi)};
+l.nb=function(){return mj(this.Ia.lo,this.Ja.lo)};
+l.XA=function(){return mj(this.Ia.lo,this.Ja.hi)};
+l.gs=function(){return mj(this.Ia.hi,this.Ja.lo)};
+l.mb=function(){return mj(this.Ia.hi,this.Ja.hi)};
+l.sb=function(){return mj(this.Ia.span(),this.Ja.span(),e)};
+l.iO=function(){return this.Ja.ZB()};
+l.hO=function(){return this.Ia.hi>=ee/2&&this.Ia.lo<=-ee/2};
+l.ma=function(){return this.Ia.ma()||this.Ja.ma()};
+l.lO=function(a){var b=this.sb();a=a.sb();return b.lat()>a.lat()&&b.lng()>a.lng()};
+function nj(){this.yf=Number.MAX_VALUE;this.Ke=-Number.MAX_VALUE;this.qf=90;this.hf=-90;for(var a=0,b=r(arguments);a<b;++a)this.extend(arguments[a])}
+l=nj.prototype;l.extend=function(a){if(a.Ua<this.yf)this.yf=a.Ua;if(a.Ua>this.Ke)this.Ke=a.Ua;if(a.df<this.qf)this.qf=a.df;if(a.df>this.hf)this.hf=a.df};
+l.nb=function(){return new z(this.qf,this.yf,e)};
+l.mb=function(){return new z(this.hf,this.Ke,e)};
+l.qc=function(){return this.qf};
+l.Oc=function(){return this.hf};
+l.pc=function(){return this.Ke};
+l.rc=function(){return this.yf};
+l.intersects=function(a){return a.pc()>this.yf&&a.rc()<this.Ke&&a.Oc()>this.qf&&a.qc()<this.hf};
+l.T=function(){return new z((this.qf+this.hf)/2,(this.yf+this.Ke)/2,e)};
+l.contains=function(a){var b=a.lat();a=a.lng();return b>=this.qf&&b<=this.hf&&a>=this.yf&&a<=this.Ke};
+l.kc=function(a){return a.rc()>=this.yf&&a.pc()<=this.Ke&&a.qc()>=this.qf&&a.Oc()<=this.hf};
+function oj(a,b){var c=a.$d();a=a.ff();var d=le(c);b[0]=le(a)*d;b[1]=oe(a)*d;b[2]=oe(c)}
+function pj(a,b){var c=je(a[2],pe(a[0]*a[0]+a[1]*a[1]));a=je(a[1],a[0]);b.lT(Re(c));b.yF(Re(a))}
+function qj(){var a=Me(arguments);a.push(a[0]);for(var b=[],c=0,d=0;d<3;++d){b[d]=a[d].rx(a[d+1]);c+=b[d]}c/=2;a=qe(0.5*c);for(d=0;d<3;++d)a*=qe(0.5*(c-b[d]));return 4*he(pe(B(0,a)))}
+function rj(){for(var a=Me(arguments),b=[[],[],[]],c=0;c<3;++c)oj(a[c],b[c]);a=0;a+=b[0][0]*b[1][1]*b[2][2];a+=b[1][0]*b[2][1]*b[0][2];a+=b[2][0]*b[0][1]*b[1][2];a-=b[0][0]*b[2][1]*b[1][2];a-=b[1][0]*b[0][1]*b[2][2];a-=b[2][0]*b[1][1]*b[0][2];b=Number.MIN_VALUE*10;return a>b?1:a<-b?-1:0}
+;function sj(){}
+;function tj(){aa("Required interface method not implemented")}
+l=sj.prototype;l.fromLatLngToPixel=tj;l.fromPixelToLatLng=tj;l.getNearestImage=function(a,b,c){b=this.getWrapWidth(b);c=K((c.x-a.x)/b);a.x+=b*c;return c};
+l.tileCheckRange=function(){return e};
+l.getWrapWidth=function(){return Infinity};function pd(a){this.yu=[];this.zu=[];this.wu=[];this.xu=[];for(var b=256,c=0;c<a;c++){var d=b/2;this.yu.push(b/360);this.zu.push(b/(2*ee));this.wu.push(new S(d,d));this.xu.push(b);b*=2}}
+pd.prototype=new sj;pd.prototype.fromLatLngToPixel=function(a,b){var c=this.wu[b],d=K(c.x+a.lng()*this.yu[b]);a=se(Math.sin(Qe(a.lat())),-0.9999,0.9999);b=K(c.y+0.5*Math.log((1+a)/(1-a))*-this.zu[b]);return new S(d,b)};
+pd.prototype.fromPixelToLatLng=function(a,b,c){var d=this.wu[b],f=(a.x-d.x)/this.yu[b];a=Re(2*Math.atan(Math.exp((a.y-d.y)/-this.zu[b]))-ee/2);return new z(a,f,c)};
+pd.prototype.tileCheckRange=function(a,b,c){b=this.xu[b];if(a.y<0||a.y*c>=b)return j;if(a.x<0||a.x*c>=b){c=Kd(b/c);a.x%=c;if(a.x<0)a.x+=c}return e};
+pd.prototype.getWrapWidth=function(a){return this.xu[a]};var uj=pe(2);function rd(a,b,c){this.Ot=c||new pd(a);this.ym=b%360;this.NU=new S(0,0)}
+p(rd,sj);l=rd.prototype;l.fromLatLngToPixel=function(a,b){a=this.Ot.fromLatLngToPixel(a,b);b=this.getWrapWidth(b);var c=b/2,d=a.x,f=a.y;switch(this.ym){case 0:break;case 90:a.x=f;a.y=b-d;break;case 180:a.x=b-d;a.y=b-f;break;case 270:a.x=b-f;a.y=d;break}a.y=(a.y-c)/uj+c;return a};
+l.getNearestImage=function(a,b,c){b=this.getWrapWidth(b);if(this.ym%180==90){c=K((c.y-a.y)/b);a.y+=b*c}else{c=K((c.x-a.x)/b);a.x+=b*c}return c};
+l.fromPixelToLatLng=function(a,b,c){var d=this.getWrapWidth(b),f=d/2,g=a.x;a=(a.y-f)*uj+f;f=this.NU;switch(this.ym){case 0:f.x=g;f.y=a;break;case 90:f.x=d-a;f.y=g;break;case 180:f.x=d-g;f.y=d-a;break;case 270:f.x=a;f.y=d-g;break}return this.Ot.fromPixelToLatLng(f,b,c)};
+l.tileCheckRange=function(a,b,c){b=this.getWrapWidth(b);if(this.ym%180==90){if(a.x<0||a.x*c>=b)return j;if(a.y<0||a.y*c>=b){c=Kd(b/c);a.y%=c;if(a.y<0)a.y+=c}}else{if(a.y<0||a.y*c>=b)return j;if(a.x<0||a.x*c>=b){c=Kd(b/c);a.x%=c;if(a.x<0)a.x+=c}}return e};
+l.getWrapWidth=function(a){return this.Ot.getWrapWidth(a)};var vj=vj||{},wj=function(a,b,c){var d=window.google;d&&d.test&&d.test.report&&d.test.report(a,i,b,c)},
+xj=function(a){var b=window.google;b&&b.test&&b.test.checkpoint&&b.test.checkpoint(a)};var yj={};yj.initialize=N;yj.redraw=N;yj.remove=N;yj.copy=function(){return this};
+yj.wa=j;yj.ya=Oe;yj.show=function(){this.wa=j};
+yj.hide=function(){this.wa=e};
+yj.I=function(){return this.wa};
+function zj(a,b,c){Aj(a.prototype,yj);Ih(a,b,c)}
+function Aj(a,b){tc(b,function(c){a.hasOwnProperty(c)||(a[c]=b[c])})}
+;function Bj(){Bj.g.apply(this,arguments)}
+;Bj.g=function(a){if(a){this.controls=a.width<400||a.height<150?{smallzoomcontrol3d:e,menumaptypecontrol:e}:{largemapcontrol3d:e,hierarchicalmaptypecontrol:e,scalecontrol:e};if(Sb&&a.width>=500&&a.height>=500)this.controls.googlebar=e;this.maptypes={normal:e,satellite:e,hybrid:e,physical:e};this.zoom={scrollwheel:e,doubleclick:e};this.keyboard=e}};function Cj(){Cj.g.apply(this,arguments)}
+;function Hd(){Hd.g.apply(this,arguments)}
+;Hd.g=function(a,b,c,d){d=d||{};this.Gb=d.heading||0;if(this.Gb<0||this.Gb>=360)aa("Heading out of bounds.");(this.fv=d.rmtc||i)&&this.fv.Pl(this,!!d.isDefault);this.hb=a||[];this.HP=c||"";this.of=b||new sj;this.MT=d.shortName||c||"";this.xV=d.urlArg||"c";this.nk=d.maxResolution||Je(this.hb,function(){return this.maxResolution()},
+Math.max)||0;this.vk=d.minResolution||Je(this.hb,function(){return this.minResolution()},
+Math.min)||0;this.DU=d.textColor||"black";this.JO=d.linkColor||"#7777cc";this.Jm=d.errorMessage||"";this.nl=d.tileSize||256;this.GR=d.radius||6378137;this.It=0;this.eI=d.alt||"";this.aP=d.lbw||i;this.iP=d.maxZoomEnabled||j;this.Ez=this;for(a=0;a<r(this.hb);++a)U(this.hb[a],"newcopyright",this,this.nu)};
+l=Hd.prototype;l.getName=function(a){return a?this.MT:this.HP};
+l.getAlt=function(){return this.eI};
+l.getProjection=function(){return this.of};
+l.getTileLayers=function(){return this.hb};
+l.getCopyrights=function(a,b){for(var c=this.hb,d=[],f=0;f<r(c);f++){var g=c[f].getCopyright(a,b);g&&d.push(g)}return d};
+l.getMinimumResolution=function(){return this.vk};
+l.getMaximumResolution=function(a){return a?this.es(a):this.nk};
+l.JM=function(a,b){b=this.getProjection().fromLatLngToPixel(a,b);a=Math.floor(b.x/this.getTileSize());b=Math.floor(b.y/this.getTileSize());return new S(a,b)};
+var Dj=function(a){var b=[];tc(a,function(c,d){d&&b.push(d)});
+return"cb"+b.join("_").replace(/\W/g,"$")};
+l=Hd.prototype;l.CJ=function(a,b){var c="";if(r(this.hb)){c=this.hb[0].getTileUrl(a,b);a=ti(c)[4];c=c.substr(0,c.lastIndexOf(a))}a={};a.callbackNameGenerator=Dj;this.eD=new wg(c+"/mz",document,a)};
+l.getMaxZoomAtLatLng=function(a,b,c){if(this.iP){var d=22;if(c!==undefined)if(c<1)d=1;else if(c<22)d=c;a=this.JM(a,d);c={};c.x=a.x;c.y=a.y;c.z=d;c.v=this.aB(0);var f=function(g){var h={};if(g.zoom){h.zoom=g.zoom;h.status=200}else h.status=500;b(h)};
+this.eD||this.CJ(a,d);this.eD.send(c,f,f)}else{d={};d.zoom=c==undefined?this.es(a):Math.min(this.es(a),c);d.estimated=e;d.status=200;b(d)}};
+l.getTextColor=function(){return this.DU};
+l.getLinkColor=function(){return this.JO};
+l.getErrorMessage=function(){return this.Jm};
+l.getUrlArg=function(){return this.xV};
+l.aB=function(a,b,c){var d=i;a=a||-1;if(a==-1)d=this.hb[this.hb.length-1];else if(a<r(this.hb))d=this.hb[a];else return"";b=b||new S(0,0);c=c||0;var f;if(r(this.hb))f=d.getTileUrl(b,c).match(/[&?\/](?:v|lyrs)=([^&]*)/);return f&&f[1]?f[1]:""};
+l.mC=function(a,b){if(r(this.hb)){var c=this.getTileSize();a=this.hb[this.hb.length-1].getTileUrl(new S(Kd(a.x/c),Kd(a.y/c)),b);return a.indexOf("/vt?")>=0||a.indexOf("/vt/")>=0}return j};
+l.getTileSize=function(){return this.nl};
+l.getSpanZoomLevel=function(a,b,c){var d=this.of,f=this.getMaximumResolution(a),g=this.vk,h=K(c.width/2),k=K(c.height/2);for(f=f;f>=g;--f){var o=d.fromLatLngToPixel(a,f);o=new S(o.x-h-3,o.y+k+3);var q=new S(o.x+c.width+3,o.y-c.height-3);o=(new id(d.fromPixelToLatLng(o,f),d.fromPixelToLatLng(q,f))).sb();if(o.lat()>=b.lat()&&o.lng()>=b.lng())return f}return 0};
+l.getBoundsZoomLevel=function(a,b){var c=this.of,d=this.getMaximumResolution(a.T()),f=this.vk,g=a.nb();for(a=a.mb();g.lng()>a.lng();)g.yF(g.lng()-360);for(d=d;d>=f;--d){var h=c.fromLatLngToPixel(g,d),k=c.fromLatLngToPixel(a,d);if(fe(k.x-h.x)<=b.width&&fe(k.y-h.y)<=b.height)return d}return 0};
+l.nu=function(){A(this,"newcopyright")};
+l.es=function(a){for(var b=this.hb,c=[0,j],d=0;d<r(b);d++)b[d].hP(a,c);return c[1]?c[0]:B(this.nk,B(this.It,c[0]))};
+l.BF=function(a){this.It=a};
+l.YS=function(a){this.Ez=a};
+l.getHeading=function(){return this.Gb};
+l.getRotatableMapTypeCollection=function(){return this.fv};function Ej(a){this.Zb=a||0;this.on={};this.Bh=[]}
+l=Ej.prototype;l.qi=function(a){this.Zb=a};
+l.gM=function(){return Jd(this.Bh,n(function(a){return this.on[a]},
+this))};
+l.Pl=function(a,b){if(b)this.Py=a;else{this.on[a.getHeading()]=a;this.Bh.push(a.getHeading())}};
+l.isImageryVisible=function(a,b,c){c(b>=this.Zb)};
+l.Tm=function(){if(!this.Py)aa("No default map type available.");return this.Py};
+l.rs=function(a){if(!r(this.Bh))aa("No rotated map types available.");return this.on[this.nM(a)]};
+l.nM=function(a){a%=360;if(this.on[a])return a;for(var b=this.Bh.concat(this.Bh[0]+360),c=0,d=r(b)-1;c<d-1;){var f=K((c+d)/2);if(a<this.Bh[f])d=f;else c=f}c=b[c];b=b[d];return a<(c+b)/2?c:b%360};function sd(){Ej.call(this,14)}
+p(sd,Ej);sd.prototype.isImageryVisible=function(a,b,c){if(b>=this.Zb)if(x(Fj).sN("ob"))x(Fj).Lm("ob",a,c,i,b);else var d=v(x(Fj),"appfeaturesdata",function(f){if(f=="ob"){w(d);x(Fj).Lm("ob",a,c,i,b)}});
+else c(j)};var Gj={};function Hj(a){for(var b in a)b in Gj||(Gj[b]=a[b])}
+function F(a){return ue(Gj[a])?Gj[a]:""}
+window.GAddMessages=Hj;function Ij(a,b){this.gw=a;this.cO=b||a;this.Gh=i;this.tm=[]}
+var Jj=[Na,La],Kj=["movestart","panbyuser","zoominbyuser","zoomoutbyuser","zoomto"];l=Ij.prototype;l.nw=function(a,b,c,d){this.Gh&&this.Gh.sc()&&this.TB();this.Gh=be(this);d?fd(this.gw,d,n(this.mG,this,a,b,c,this.Gh)):this.mG(a,b,c,this.Gh)};
+l.TB=function(){ce(this);if(this.Yq){this.Yq();this.Yq=i}this.Wx()};
+l.Wx=function(){t(this.tm,function(a){w(a)});
+this.tm=[]};
+l.mG=function(a,b,c,d){if(this.Gh.sc()){a();this.GT(b,c,d)}};
+l.GT=function(a,b,c){var d=this,f=this.gw,g=this.cO;t(Jj,n(function(h){this.tm.push(fd(f,h,n(function(k){if(c.sc()){ce(d);b(h,k);this.Wx()}},
+this)))},
+this));this.Yq=function(){a()};
+t(Kj,n(function(h){this.tm.push(fd(g,h,n(function(){c.sc()&&this.TB()},
+this)))},
+this))};function Ld(a){this.$Q=a}
+Ld.prototype.getTileUrl=function(a,b){var c=this.Yr(a,b);return c&&Lj(c,a,b)};
+Ld.prototype.Yr=function(a,b){var c=this.$Q;if(!c)return i;for(var d=0;d<c.length;++d)if(!(c[d].minZoom>b||c[d].maxZoom<b)){var f=r(c[d].rect);if(f==0)return c[d].uris;for(var g=0;g<f;++g){var h=c[d].rect[g][b];if(h.n<=a.y&&h.s>=a.y&&h.w<=a.x&&h.e>=a.x)return c[d].uris}}return i};Cj.g=function(a,b,c,d){this.fh=a||new md;this.vk=b||0;this.nk=c||0;U(this.fh,"newcopyright",this,this.nu);a=d||{};this.ng=Le(a.opacity,1);this.cg=Le(a.isPng,j);this.GG=a.tileUrlTemplate;this.DO=a.kmlUrl};
+l=Cj.prototype;l.minResolution=function(){return this.vk};
+l.maxResolution=function(){return this.nk};
+l.ip=function(a){this.Ow=a};
+l.hP=function(a,b){var c=j;if(this.Ow)for(var d=0;d<this.Ow.length;++d){var f=this.Ow[d];if(f[0].contains(a)){b[0]=B(b[0],f[1]);c=e}}if(!c){a=this.as(a);if(r(a)>0)for(d=0;d<r(a);d++){if(a[d].maxZoom)b[0]=B(b[0],a[d].maxZoom)}else b[0]=this.nk}b[1]=c};
+l.getTileUrl=function(a,b){return this.GG?this.GG.replace("{X}",a.x).replace("{Y}",a.y).replace("{Z}",b).replace("{V1_Z}",17-b):Rc};
+l.isPng=function(){return this.cg};
+l.getOpacity=function(){return this.ng};
+l.getCopyright=function(a,b){return this.fh.$r(a,b)};
+l.as=function(a){return this.fh.as(a)};
+l.nu=function(){A(this,"newcopyright")};
+l.zT=function(a){this.FG=a};
+l.ZQ=function(a,b,c,d,f){this.FG&&this.FG(a,b,c,d,f)};function Lj(a,b,c){var d=(b.x+2*b.y)%a.length,f="Galileo".substr(0,(b.x*3+b.y)%8),g="";if(b.y>=10000&&b.y<100000)g="&s=";return[a[d],"x=",b.x,g,"&y=",b.y,"&z=",c,"&s=",f].join("")}
+;function Ed(a,b,c,d){var f={};f.isPng=d;Cj.call(this,b,0,c,f);this.Ec=a;this.Mg=i}
+p(Ed,Cj);Ed.prototype.getTileUrl=function(a,b){var c=this.Mg&&this.Mg.Yr(a,b)||this.Ec;return Lj(c,a,b)};
+Ed.prototype.fp=function(a){this.Mg=a};function Mj(a,b){if(!a)return e;try{b=b||document;Nj(a,"testcookie","1","","",b);if(b.cookie.indexOf("testcookie")!=-1){Nj(a,"testcookie","1","","Thu, 01-Jan-1970 00:00:01 GMT",b);return e}}catch(c){}return j}
+function Nj(a,b,c,d,f,g){(g||document).cookie=[b,"=",c,"; domain=.",a,d?"; path=/"+d:"",f?"; expires="+f:""].join("")}
+;function Id(a,b,c,d,f){Ed.call(this,a,b,c);d&&this.vT(d,f)}
+p(Id,Ed);Id.prototype.vT=function(a,b){if(!(Math.round(Math.random()*100)<=hb)&&Mj(b)){Nj(b,"khcookie",a,"kh");if(rb){Nj(b,"khcookie",a,"maptilecompress");Nj(b,"khcookie",a,"vt/lbw")}}else for(b=0;b<r(this.Ec);++b)this.Ec[b]+="cookie="+a+"&"};function Gd(a){var b=n(a.getTileUrl,a);a.getTileUrl=function(c,d){var f=b(c,d);if(c=Oj(c,d))f+="&opts="+c;return f}}
+var Pj=new Zg(53324,34608,60737,41615);function Oj(a,b){if(b<16)return i;b=1<<b-16;a=new S(a.x/b,a.y/b);if(!Pj.Kf(a))return i;if(Wb){if(Vb)return"bs";return"b"}return i}
+;function Qj(){this.Ha=i;this.Ap=[]}
+l=Qj.prototype;l.bO=j;l.jv=j;l.ot=0;l.vj=i;l.initialize=function(a,b){this.Ha=new wg(b,window.document);this.bO=e;this.jS=tf(this,this.PH);U(a,Da,this,this.fH);U(a,Ga,this,this.fH)};
+l.QG=function(a){Ce(this.Ap,a)||this.Ap.push(a)};
+l.fH=function(){if(!this.jv){var a=120000-(ed()-this.ot);if(a<=0){this.ot=ed();this.li()}else{this.jv=e;function b(){this.jv=j;this.ot=ed();this.li()}
+setTimeout(n(b,this),a)}}};
+l.li=function(){if(r(this.Ap)!=0){var a={};a.x=0;a.y=0;a.z=0;a.lyrs=this.Ap.join(",");this.Ha.send(a,this.jS)}};
+l.PH=function(a){if(a&&a.yW==0)if(!this.vj||this.vj<a.e){this.vj=a.e;A(this,"pt_update")}};
+l.tA=function(){return this.vj};
+l.vv=function(a){this.vj=a};function Dd(a,b,c,d){var f={};f.isPng=d;Cj.call(this,b,0,c,f);this.Ec=a;a=a[0].match(this.Dz);this.Xq=parseInt(a[2],10);this.Xb=a[1];x(Qj).vv(this.Xq,this.Xb,new S(0,0),0);x(Qj).QG(this.Xb);this.Mg=i}
+p(Dd,Cj);l=Dd.prototype;l.Dz=new RegExp(/(m|h|r)@(\d+)/);l.vv=function(a){this.Xq=a;a=this.eM();for(var b=0,c=r(this.Ec);b<c;++b)this.Ec[b]=this.Ec[b].replace(this.Dz,a)};
+l.getTileUrl=function(a,b){var c=this.Mg&&this.Mg.Yr(a,b)||this.Ec;return Lj(c,a,b)};
+l.eM=function(){return this.Xb+"@"+this.Xq};
+l.fp=function(a){this.Mg=a};function Pc(){Pc.g.apply(this,arguments)}
+;var Rj="__mal_";
+Pc.g=function(a,b){b=b||new Sj;Eg(b.stats,"mctr0");this.So=b.nW||new Ai;b.gW||Wd(a);this.A=a;this.Ca=[];Ke(this.Ca,b.mapTypes||wc);Fg(r(this.Ca));this.o=b.jk?b.jk.mapType:this.Ca[0];this.rB=j;t(this.Ca,n(this.kD,this));U(x(Qj),"pt_update",this,this.jR);this.qU=b.vG;if(b.jk)this.Za=b.jk.zoom;if(b.size){this.ze=b.size;Cf(a,b.size)}else this.ze=Kf(a);ig(a).position!="absolute"&&Wf(a);a.style.backgroundColor=b.backgroundColor||"#e5e3df";var c=this.EJ(a,b.vW);this.Hn=c;Xf(c);c.style.width="100%";c.style.height=
+"100%";this.l=Tj(0,this.Hn);this.mP();Uj(a);this.nK={draggableCursor:b.draggableCursor,draggingCursor:b.draggingCursor};this.tD=b.noResize;this.ic=b.jk?b.jk.center:b.center||i;this.Kc=i;this.Vv=Hb;this.Ii=[];Eg(b.stats,"mczl0");for(a=0;a<2;++a)this.Ii.push(new Vj(this.l,this.ze,this));Eg(b.stats,"mczl1");this.fa=this.Ii[1];this.bc=this.Ii[0];this.EG=new Ij(this);U(this,"zoomto",this,this.ow);U(this,"zoominbyuser",this,this.ow);U(this,"zoomoutbyuser",this,this.ow);this.HT();this.Vh=[];this.lf=this.Cd=
+i;this.FT();this.HG=yh(this.fa,La,this);this.Dx=yh(this.fa,"beforetilesload",this);this.lH=yh(this.fa,Na,this);this.mj=e;this.Ay=this.bj=j;this.qm=mf(n(function(d){vd("zoom",1,n(function(f){this.Ay=e;d(new f(this))},
+this))},
+this));this.Zb=0;this.be=B(30,30);this.wr=e;this.Wc=[];this.fq=[];this.Uh=[];this.ro={};this.Uc=[];this.ON();this.$c=[];this.eh=[];this.Z=[];this.xa(window);this.Wq=i;this.gH=new Mi(this,b.hH);this.Ha=new wg(_mHost+"/maps/gen_204",window.document);this.Pf=b.eO||j;b.ml||this.JN(b);this.gB=b.googleBarOptions;this.xs=j;this.ZO=b.logoPassive;this.zz();this.sy=j;A(Pc,Ba,this);Eg(b.stats,"mctr1")};
+Pc.prototype.EJ=function(a,b){var c=i;if(b)c=Nf(b);if(c)Bf(c,Xg);else c=J("DIV",a,Xg);return c};
+Pc.prototype.ON=function(){for(var a=0;a<8;++a)this.Uc.push(Tj(100+a,this.l));Wj([this.Uc[4],this.Uc[6],this.Uc[7]]);$f(this.Uc[4],"default");$f(this.Uc[7],"default")};
+Pc.prototype.JN=function(a){var b=i;if(xc||a.eO)this.$p(a.logoPassive);else b=a.copyrightOptions?a.copyrightOptions:{googleCopyright:e,allowSetVisibility:!hc};a=this.Gc=new Xj(b);var c;if(b=Nf("overview-toggle"))c=new Yj(3,new R(3+b.offsetWidth,2));this.$a(a,c)};
+Pc.prototype.mP=function(){if(E.pb()&&Wi()){this.Hn.setAttribute("dir","ltr");this.l.setAttribute("dir","rtl")}};
+var Uj=function(a){var b=ig(a).dir||ig(a).direction;E.type==1&&!Wi()&&b=="rtl"&&Kg(a,"dir","ltr")};
+l=Pc.prototype;l.$p=function(a){this.$a(new Zj(a))};
+l.xJ=function(a,b){a=new Mh(a,b);b=[U(a,"dragstart",this,this.lg),U(a,"drag",this,this.jf),U(a,"move",this,this.uQ),U(a,"dragend",this,this.kg),U(a,m,this,this.RP),U(a,ka,this,this.fu)];Ke(this.Z,b);return a};
+l.xa=function(a,b){t(this.Z,w);ff(this.Z);if(b)if(ue(b.noResize))this.tD=b.noResize;this.G=this.xJ(this.l,this.nK);var c=[T(this.A,ja,this,this.GD),T(this.A,sa,this,this.mg),T(this.A,"mouseover",this,this.tQ),T(this.A,"mouseout",this,this.AD),U(this,Ca,this,this.nP),U(this,ka,this,this.QJ)];Ke(this.Z,c);this.UN();this.tD||this.Z.push(T(a,Ea,this,this.$i));t(this.eh,function(d){d.control.xa(a)});
+this.Ub().xa(a,b)};
+l.mi=function(a,b){if(b||!this.Eh())this.Kc=a};
+l.T=function(){return this.ic};
+l.Ga=function(a,b,c,d,f){Yb&&this.IF(Hb);this.He()&&this.qm(function(k){k.cancelContinuousZoom()});
+if(b){var g=c||this.o||this.Ca[0],h=se(b,0,B(30,30));g.BF(h)}d&&A(this,"panbyuser");this.aj(a,b,c,f)};
+l.fF=function(a){this.ic=a};
+l.aj=function(a,b,c,d){var f=!this.ha();b&&this.tn();this.am(d);var g=[],h=i,k=i;if(a){k=a;h=this.xb();this.ic=a}else{var o=this.bh();k=o.latLng;h=o.divPixel;this.ic=o.newCenter}if(c&&this.qU)c=c.Ez;var q=c||this.o||this.Ca[0];c=0;if(ue(b)&&ve(b))c=b;else if(this.Za)c=this.Za;var s=this.At(c,q,this.bh().latLng);if(s!=this.Za){g.push([this,Ga,this.Za,s,d]);this.Za=s}d&&this.YU(d,f);if(q!=this.o||f){this.o=q;Eg(d,"zlsmt0");t(this.Ii,function(H){H.Bb(q)});
+Eg(d,"zlsmt1");g.push([this,Ca,d])}c=this.fa;var u=this.zb();Eg(d,"pzcfg0");c.configure(k,h,s,u);Eg(d,"pzcfg1");c.show();t(this.$c,function(H){var G=H.La;G.configure(k,h,s,u);H.I()||G.show()});
+if(!this.ic)this.ic=this.X(this.xb());this.Ku(e);if(a||b!=i||f){g.push([this,"move"]);g.push([this,Da])}if(f){this.UE();g.push([this,ra]);this.sy=e}for(a=0;a<r(g);++a)A.apply(i,g[a])};
+l.nG=function(a,b,c){var d=function(){b.branch();c.oG==0&&b.tick("tlol0");c.oG++},
+f=function(){b.tick("tlolim");b.done()},
+g=n(function(){if(c.pl==1){b.tick("tlol1");this.lf=this.Cd=i}b.done();c.pl--},
+this);a.nw(d,f,g);delete d;delete f;delete g};
+l.XU=function(a){this.Cd={oG:0,pl:r(this.Vh)};this.lf=a;t(this.Vh,n(function(b){this.nG(b,a,this.Cd)},
+this))};
+l.YU=function(a){this.XU(a);var b=function(){a.tick("t0");a.branch()},
+c=function(){a.done("tim")},
+d=n(function(f,g){f==Na&&a.Xg("nvt",""+g);hd(a,this);a.tick("t1");a.done()},
+this);this.EG.nw(b,c,d);delete b;delete c;delete d};
+l.qb=function(a,b,c){var d=this.xb(),f=this.J(a),g=d.x-f.x;d=d.y-f.y;f=this.O();this.am(c);if(fe(g)==0&&fe(d)==0)this.ic=a;else if(fe(g)<=f.width&&fe(d)<f.height){this.to(new R(g,d),b,c);xj("panned-to")}else this.Ga(a,undefined,undefined,b,c)};
+l.F=function(){return K(this.Za)};
+l.te=function(a){this.aj(undefined,a)};
+l.$F=function(a){this.Za=a};
+l.Dc=function(a,b,c){A(this,"zoominbyuser");this.Sp(1,e,a,b,c)};
+l.bd=function(a,b){A(this,"zoomoutbyuser");this.Sp(-1,e,a,j,b)};
+l.NV=function(a,b,c){this.Sp(a,j,b,j,c)};
+l.tH=function(a,b,c){this.Sp(a,j,b,e,c)};
+l.Sp=function(a,b,c,d,f){this.He()&&f?this.qm(function(g){g.zoomContinuously(a,b,c,d)}):this.KV(a,
+b,c,d)};
+l.Lc=function(){var a=this.zb(),b=this.O();return new Zg([new S(a.x,a.y),new S(a.x+b.width,a.y+b.height)])};
+l.H=function(){var a=this.Lc(),b=new S(a.minX,a.maxY);a=new S(a.maxX,a.minY);return this.gL(b,a)};
+l.gL=function(a,b){var c=this.X(a,e),d=this.X(b,e),f=d.lat(),g=d.lng(),h=c.lat(),k=c.lng();if(d.lat()<c.lat()){f=c.lat();h=d.lat()}c=new id(new z(h,k),new z(f,g));a=this.X(new S((a.x+b.x)/2,(a.y+b.y)/2),e);c.contains(a)||(c=new id(new z(h,g),new z(f,k)));return c};
+l.RM=function(){var a=this.Lc(),b=new S(a.minX,a.maxY);a=new S(a.maxX,a.minY);return new nj(this.X(b,e),this.X(a,e))};
+l.O=function(){return this.ze};
+l.AL=function(){return this.o};
+l.hM=function(){return this.Ca};
+l.Bb=function(a,b){if(this.ha())this.Yf().Rk()?this.Yf().oT(a,b):this.aj(undefined,undefined,a,b);else this.o=a};
+l.Pl=function(a){if(this.oO(a))if(ye(this.Ca,a)){this.kD(a);A(this,"addmaptype",a)}};
+l.CE=function(a){if(!(r(this.Ca)<=1))if(xe(this.Ca,a)){this.o==a&&this.Bb(this.Ca[0]);this.II(a);A(this,"removemaptype",a)}};
+l.oO=function(a){return a==Nd||a==Od?E.bC(xb):e};
+l.Yf=function(){if(!this.SE)this.SE=new $j(this);return this.SE};
+l.em=function(a){this.Yf().em(a)};
+l.Wj=function(){return this.Yf().Wj()};
+l.Er=function(){this.Yf().Er()};
+l.or=function(){this.Yf().or()};
+l.Rk=function(){return this.Yf().Rk()};
+l.AE=function(a,b){var c=this.ro;t(a,function(d){c[d]=b});
+this.Uh.push(b);b.initialize(this)};
+l.Fj=function(a){return this.ro[a]};
+l.ba=function(a,b){var c=this.ro[a.Ea?a.Ea():""];this.fq.push(a);if(c)c.ba(a,b);else{if(a instanceof ak){b=0;for(c=r(this.$c);b<c&&this.$c[b].zPriority<=a.zPriority;)++b;this.$c.splice(b,0,a);a.initialize(this);for(b=0;b<=c;++b)this.$c[b].La.ri(b);b=this.bh();c=a.La;c.configure(b.latLng,b.divPixel,this.Za,this.zb());a.I()||c.show()}else{this.Wc.push(a);a.initialize(this,undefined,b);a.redraw(e)}this.Yw(a)}A(this,"addoverlay",a)};
+l.Yw=function(a){var b=v(a,m,n(function(c){A(this,m,a,undefined,c)},
+this));this.Ol(b,a);b=v(a,ja,n(function(c){this.GD(c,a);Tg(c)},
+this));this.Ol(b,a);b=v(a,Aa,n(function(c){A(this,"markerload",c,a.UD);if(!a.Pk)a.Pk=fd(a,"remove",n(function(){A(this,"markerunload",a)},
+this))},
+this));this.Ol(b,a)};
+function bk(a){if(a[Rj]){t(a[Rj],function(b){w(b)});
+a[Rj]=i}}
+l=Pc.prototype;l.ka=function(a,b){var c=this.ro[a.Ea?a.Ea():""];xe(this.fq,a);if(c){c.ka(a,b);A(this,"removeoverlay",a)}else if(xe(a instanceof ak?this.$c:this.Wc,a)){a.remove();bk(a);A(this,"removeoverlay",a)}};
+l.Vf=function(a){t(this.Wc,a);t(this.Uh,function(b){b.Vf(a)})};
+l.XI=function(a){var b=(a||{}).Dd,c=[],d=function(g){oi.rd(g)==b&&c.push(g)};
+t(this.Wc,d);t(this.$c,d);t(this.Uh,function(g){g.Vf(d)});
+a=0;for(var f=r(c);a<f;++a)this.ka(c[a])};
+l.Zx=function(a){var b=this.oa();b&&this.YQ(b.rd(),a)&&this.da();this.XI(a);this.KC=this.LC=i;this.mi(i);A(this,"clearoverlays")};
+l.$a=function(a,b){this.ge(a);var c=a.initialize(this);b=b||a.getDefaultPosition();a.printable()||bg(c);a.selectable()||gg(c);vh(c,i,Tg);if(!a.Jq||!a.Jq())sh(c,ja,Sg);c.style.zIndex==""&&fg(c,0);yh(a,"zoomto",this);b&&b.apply(c);this.Wq&&a.allowSetVisibility()&&this.Wq(c);ze(this.eh,{control:a,element:c,position:b},function(d,f){return d.position&&f.position&&d.position.anchor<f.position.anchor})};
+l.jA=function(){return Jd(this.eh,function(a){return a.control})};
+l.uL=function(a){return(a=this.Zr(a))&&a.element?a.element:i};
+l.ge=function(a,b){for(var c=this.eh,d=0;d<r(c);++d){var f=c[d];if(f.control==a){b||Cg(f.element);c.splice(d,1);a.Jk();a.clear();return}}};
+l.TS=function(a,b){(a=this.Zr(a))&&b.apply(a.element)};
+l.vL=function(a){return(a=this.Zr(a))&&a.position?a.position:i};
+l.Zr=function(a){for(var b=this.eh,c=0;c<r(b);++c)if(b[c].control==a)return b[c];return i};
+l.rn=function(){this.kF(Tf)};
+l.ti=function(){this.kF(Uf)};
+l.kF=function(a){var b=this.eh;this.Wq=a;for(var c=0;c<r(b);++c){var d=b[c];d.control.allowSetVisibility()&&a(d.element)}};
+l.$i=function(){var a=Kf(this.A);if(!a.equals(this.O())){this.ze=a;E.type==1&&Cf(this.Hn,a);if(this.ha()){this.ic=this.X(this.xb());t(this.Ii,function(c){c.ZF(a)});
+t(this.$c,function(c){c.La.ZF(a)});
+var b=this.getBoundsZoomLevel(this.vA());b<this.Nc()&&this.qi(B(0,b));A(this,Ea)}}};
+l.vA=function(){if(!this.Xz)this.Xz=new id(new z(-85,-180),new z(85,180));return this.Xz};
+l.getBoundsZoomLevel=function(a){return(this.o||this.Ca[0]).getBoundsZoomLevel(a,this.ze)};
+l.UE=function(){this.KS=this.T();this.LS=this.F()};
+l.QE=function(){var a=this.KS,b=this.LS;if(a)b==this.F()?this.qb(a,e):this.Ga(a,b,i,e)};
+l.ha=function(){return this.sy};
+l.nc=function(){this.G.disable()};
+l.Ic=function(){this.G.enable()};
+l.qj=function(){return this.G.enabled()};
+l.At=function(a,b,c){return se(a,this.Nc(b),this.Mc(b,c))};
+l.qi=function(a){a=se(a,0,B(30,30));if(a!=this.Zb)if(!(a>this.Mc())){var b=this.Nc();this.Zb=a;if(this.Zb>this.Za)this.te(this.Zb);else this.Zb!=b&&A(this,"zoomrangechange")}};
+l.Nc=function(a){a=(a||this.o||this.Ca[0]).getMinimumResolution();return B(a,this.Zb)};
+l.Ev=function(a){var b=se(a,0,B(30,30));if(a!=this.be)if(!(b<this.Nc())){a=this.Mc();this.be=b;if(this.be<this.Za)this.te(this.be);else this.be!=a&&A(this,"zoomrangechange")}};
+l.Mc=function(a,b){a=(a||this.o||this.Ca[0]).getMaximumResolution(b||this.ic);return me(a,this.be)};
+l.Ya=function(a){return this.Uc[a]};
+l.TD=function(a){return Sf(this.Uc[a])};
+l.R=function(){return this.A};
+l.rA=function(){return this.G};
+l.HT=function(){v(this,"beforetilesload",n(function(){this.xr&&this.Ov(new cd("pan_drag"))},
+this))};
+l.lg=function(){this.am();this.xr=e};
+l.jf=function(){if(this.xr)if(this.lh)A(this,"drag");else{A(this,"dragstart");A(this,"movestart");this.lh=e}};
+l.kg=function(a){if(this.lh){A(this,"dragend");A(this,Da);this.AD(a);var b={};a=kh(a,this.A);var c=this.oh(a),d=this.O();b.infoWindow=this.Sj();b.mll=this.T();b.cll=c;b.cp=a;b.ms=d;A(this,"panto","mdrag",b);this.xr=this.lh=j}};
+l.GD=function(a,b){if(!a.cancelContextMenu){var c=kh(a,this.A),d=this.oh(c);if(!b||b==this.R())b=this.Fj("Polygon").oB(d);if(this.mj)if(this.Sg){this.Sg=j;this.bd(i,e);clearTimeout(this.AS);A(this,"zoomto","drclk")}else{this.Sg=e;var f=Qg(a);this.AS=qg(this,n(function(){this.Sg=j;A(this,"singlerightclick",c,f,b)},
+this),250)}else A(this,"singlerightclick",c,Qg(a),b);Ug(a);if(E.type==4&&E.os==0)a.cancelBubble=e}};
+l.fu=function(a){a.button>1||this.qj()&&this.wr&&this.tl(a,ka)};
+l.Eh=function(){var a=j;this.He()&&this.qm(function(b){a=b.Eh()});
+return a};
+l.QJ=function(a,b){if(b)if(this.mj){if(!this.Eh()){this.Dc(b,e,e);A(this,"zoomto","dclk")}}else this.qb(b,e)};
+l.RP=function(a){var b=ed();if(!ue(this.rC)||b-this.rC>100)this.tl(a,m);this.rC=b};
+l.hh=i;l.tl=function(a,b,c){c=c||kh(a,this.A);var d;this.hh=d=this.ha()?ck(c,this):new z(0,0);for(var f=0,g=this.Uh.length;f<g;++f)if(this.Uh[f].Lj(a,b,c,d))return;b==m||b==ka?A(this,b,i,d):A(this,b,d)};
+l.mg=function(a){this.lh||this.tl(a,sa)};
+l.AD=function(a){if(!this.lh){var b=kh(a,this.A);if(!this.qO(b)){this.eC=j;this.tl(a,"mouseout",b)}}};
+l.qO=function(a){var b=this.O();return a.x>=2&&a.y>=2&&a.x<b.width-2&&a.y<b.height-2};
+l.tQ=function(a){if(!(this.lh||this.eC)){this.eC=e;this.tl(a,"mouseover")}};
+function ck(a,b){var c=b.zb();return b.X(new S(c.x+a.x,c.y+a.y))}
+l=Pc.prototype;l.uQ=function(){this.ic=this.X(this.xb());var a=this.zb();this.fa.RE(a);t(this.$c,function(b){b.La.RE(a)});
+this.Ku(j);A(this,"move")};
+l.Ku=function(a){function b(c){c&&c.redraw(a)}
+t(this.Wc,b);t(this.Uh,function(c){c.Vf(b)})};
+l.to=function(a,b,c){var d=Math.sqrt(a.width*a.width+a.height*a.height);d=B(5,K(d/20));this.Xh=new Ci(d);this.Xh.reset();this.bp(a);A(this,"movestart");b&&A(this,"panbyuser");this.ez(c)};
+l.bp=function(a){this.aR=new R(a.width,a.height);a=this.G;this.cR=new S(a.left,a.top)};
+l.FT=function(){v(this,"addoverlay",n(function(a){if(a instanceof ak){a=new Ij(a.La,this);this.Vh.push(a);if(this.Cd&&this.lf){this.Cd.pl++;this.nG(a,this.lf,this.Cd)}}},
+this));v(this,"removeoverlay",n(function(a){if(a instanceof ak)for(var b=0;b<r(this.Vh);++b)if(this.Vh[b].gw==a.La){this.Vh.splice(b,1);if(this.Cd&&this.lf){this.Cd.pl--;if(this.Cd.pl==0){this.lf.done("tlol1");this.Cd=this.lf=i}else this.lf.done()}break}},
+this))};
+l.Ov=function(a,b){var c=function(g){g.branch("t0");g.done()},
+d=function(g){g.CH()},
+f=function(g,h,k){h==Na&&g.Xg("nvt",""+k);g.done("t1")};
+this.EG.nw(pf(c,a),pf(d,a),pf(f,a),b);delete c;delete d;delete f};
+l.ow=function(){this.Ov(new cd("zoom"))};
+l.WU=function(){this.Ov(new cd("pan_ctrl"),"panbyuser")};
+l.db=function(a,b){this.WU();var c=this.O(),d=K(c.width*0.3);c=K(c.height*0.3);this.to(new R(a*d,b*c),e)};
+l.ez=function(a){!this.pg&&a&&a.branch();this.pg=a;this.NF(this.Xh.next());if(this.Xh.more())this.vo=setTimeout(n(this.ez,this,a),10);else{this.pg=this.vo=i;a&&a.done();A(this,Da)}};
+l.NF=function(a){var b=this.cR,c=this.aR;this.G.uc(b.x+c.width*a,b.y+c.height*a)};
+l.am=function(a){if(this.vo){clearTimeout(this.vo);this.vo=i;A(this,Da);if(this.pg&&this.pg!==a)this.pg.done();else this.pg&&setTimeout(function(){a.done()},
+0);this.pg=i}};
+l.fL=function(a){var b=this.zb();return this.fa.Nm(new S(a.x+b.x,a.y+b.y))};
+l.oh=function(a){return ck(a,this)};
+l.Tz=function(a){a=this.J(a);var b=this.zb();return new S(a.x-b.x,a.y-b.y)};
+l.X=function(a,b){return this.fa.X(a,b)};
+l.Sd=function(a){return this.fa.Sd(a)};
+l.J=function(a,b){var c=this.fa;b=b||this.xb();return c.J(a,undefined,b)};
+l.Uz=function(a){return this.fa.J(a)};
+l.vM=function(a,b,c){var d=this.o.getProjection();c=c==i?this.F():c;a=d.fromLatLngToPixel(a,c);b=d.fromLatLngToPixel(b,c);b=new S(b.x-a.x,b.y-a.y);return Math.sqrt(b.x*b.x+b.y*b.y)};
+l.ws=function(){return this.fa.ws()};
+l.zb=function(){return new S(-this.G.left,-this.G.top)};
+l.xb=function(){var a=this.zb(),b=this.O();a.x+=K(b.width/2);a.y+=K(b.height/2);return a};
+l.bh=function(){return this.Kc&&this.H().contains(this.Kc)?{latLng:this.Kc,divPixel:this.J(this.Kc),newCenter:i}:{latLng:this.ic,divPixel:this.xb(),newCenter:this.ic}};
+function Tj(a,b){b=J("div",b,Xg);fg(b,a);return b}
+l=Pc.prototype;l.KV=function(a,b,c,d){a=b?this.F()+a:a;if(this.At(a,this.o,this.T())==a)if(c&&d)this.Ga(c,a,this.o);else if(c){A(this,"zoomstart",a-this.F(),c,d);b=this.Kc;this.Kc=c;this.te(a);this.Kc=b}else this.te(a);else c&&d&&this.qb(c)};
+l.yN=function(){t(this.$c,function(a){a.La.hide()})};
+l.hJ=function(a){var b=this.bh(),c=this.F(),d=this.zb();t(this.$c,function(f){var g=f.La;g.configure(b.latLng,a,c,d);f.I()||g.show()})};
+l.De=function(a){return a};
+l.UN=function(){this.Z.push(T(document,m,this,this.NI))};
+l.NI=function(a){var b=this.oa();for(a=Qg(a);a;a=a.parentNode){if(a==this.A){this.XL();return}if(a==this.Uc[7]&&b&&b.bg())break}this.$O()};
+l.$O=function(){this.Is=j};
+l.XL=function(){this.Is=e};
+l.jT=function(a){this.Is=a};
+l.rN=function(){return this.Is||j};
+l.tT=function(a){this.fa=a;w(this.HG);w(this.Dx);w(this.lH);this.HG=yh(this.fa,La,this);this.Dx=yh(this.fa,"beforetilesload",this);this.lH=yh(this.fa,Na,this)};
+l.uT=function(a){this.bc=a};
+l.tn=function(){Qf(this.bc.l)};
+l.xK=function(){if(!this.bj){this.bj=e;this.qm(n(function(){this.ha()&&this.aj()},
+this))}};
+l.YJ=function(){this.bj=j};
+l.lJ=function(){return this.bj};
+l.He=function(){return this.Ay&&this.bj};
+l.uz=function(){this.mj=e};
+l.jr=function(){this.mj=j};
+l.jK=function(){return this.mj};
+l.yK=function(){this.wr=e};
+l.ZJ=function(){this.wr=j};
+l.xN=function(){t(this.Uc,Tf)};
+l.XT=function(){t(this.Uc,Uf)};
+l.qQ=function(a){this.rB=e;if(a==(this.mapType||this.Ca[0]))A(this,"zoomrangechange")};
+l.kD=function(a){this.Ol(U(a,"newcopyright",this,function(){this.qQ(a)}),
+a)};
+l.Ol=function(a,b){if(b[Rj])b[Rj].push(a);else b[Rj]=[a]};
+l.II=function(a){a[Rj]&&t(a[Rj],function(b){w(b)})};
+l.Bz=function(){if(!this.kv()){this.Ro=mf(n(function(a){vd("scrwh",1,n(function(b){a(new b(this))},
+this))},
+this));this.Ro(n(function(a){yh(a,"zoomto",this);this.magnifyingGlassControl=new dk;this.$a(this.magnifyingGlassControl)},
+this))}};
+l.Wy=function(){if(this.kv()){this.Ro(function(a){a.disable()});
+this.Ro=i;this.ge(this.bP);this.bP=i}};
+l.kv=function(){return!!this.Ro};
+l.zz=function(){if(E.Dh()&&!this.uu()){this.Wn=mf(n(function(a){vd("touch",5,n(function(b){a(new b(this))},
+this))},
+this));this.Wn(n(function(a){yh(a,oa,this.l);yh(a,pa,this.l)},
+this))}};
+l.aK=function(){if(this.uu()){this.Wn(n(function(a){a.disable();ph(a,oa);ph(a,pa)},
+this));this.Wn=i}};
+l.uu=function(){return!!this.Wn};
+l.nP=function(a){if(this.o==Nd||this.o==Od)this.ld||this.Fy(a)};
+l.Fy=function(a,b){vd("earth",1,n(function(c){if(!this.ld){this.ld=new c(this);this.ld.initialize(a)}b&&b(this.ld)},
+this),a)};
+l.PM=function(a){this.ld?this.ld.SA(a):this.Fy(i,function(b){b.SA(a)})};
+l.getEventContract=function(){if(!this.Ma)this.Ma=new ek;return this.Ma};
+l.DJ=function(a,b,c){c=c||{};var d=ve(c.zoomLevel)?c.zoomLevel:15,f=c.mapType||this.o,g=c.mapTypes||this.Ca,h=c.size||new R(217,200);Cf(a,h);var k=new Sj;k.mapTypes=g;k.size=h;k.ml=ue(c.ml)?c.ml:e;k.copyrightOptions=c.copyrightOptions;k.hH="p";k.noResize=c.noResize;k.vG=e;a=new Pc(a,k);if(c.staticMap)a.nc();else{a.$a(new fk);r(a.Ca)>1&&a.$a(new gk(e))}a.Ga(b,d,f);var o=c.overlays;if(!o){o=[];this.Vf(function(q){q instanceof hk||o.push(q)})}for(b=0;b<r(o);++b)if(o[b]!=this.oa())if(!(o[b].ya()&&o[b].I()))if(c=
+o[b].copy()){c instanceof ik&&c.nc();
+a.ba(c)}return a};
+l.Ub=function(){if(!this.ik){this.ik=new jk(this,this.So);for(var a=["maxtab","markerload",Ka,Ja,"infowindowupdate",Ha,Ia,"maximizedcontentadjusted","iwopenfrommarkerjsonapphook"],b=0,c=r(a);b<c;++b)yh(this.ik,a[b],this)}return this.ik};
+l.GN=function(){return this.TD(7)&&this.TD(5)?e:j};
+l.ja=function(a,b,c,d){this.Ub().ja(a,b,c,d)};
+l.Hp=function(a,b,c,d,f){this.Ub().Hp(a,b,c,d,f)};
+l.Gp=function(a,b,c){this.Ub().Gp(a,b,c)};
+l.cl=function(a){this.Ub().cl(a)};
+l.YQ=function(a,b){b=(b||{}).Dd;if(Ce(this.Wc,a))return oi.rd(a)==b;return e};
+l.da=function(){this.Ub().da()};
+l.Ej=function(){return this.Ub().Ej()};
+l.oa=function(){return this.Ub().oa()};
+l.Sj=function(){var a=this.oa();return!!a&&!a.I()};
+l.Kb=function(a,b){return this.Ub().Kb(a,b)};
+l.qu=function(a,b,c,d,f){this.Ub().qu(a,b,c,d,f)};
+l.jR=function(){t(this.Ca,function(a){t(a.getTileLayers(),function(b){if(b instanceof Dd){var c=x(Qj).tA(b.Xb,new S(0,0),0);b.vv(c)}})});
+t(this.Ii,function(a){a.refresh()})};
+l.it=function(){var a=this.o;return a==Nd||a==Od};
+l.IF=function(a){this.Vv=a};
+function Li(a,b,c,d,f){if(c){a.ll=b.T().Aa();a.spn=b.H().sb().Aa()}if(d){c=b.o.getUrlArg();if(c!=f)a.t=c;else delete a.t}a.z=b.F();A(b,Pa,a)}
+;var $j=function(a){this.f=a;this.Sk=this.Kn=j;this.Gb=a.o.getHeading();this.Cs=e};
+l=$j.prototype;l.Wj=function(){return this.Kn};
+l.em=function(a){var b=this.f,c=this.f.o;if(this.Kn){var d=c.getRotatableMapTypeCollection(),f=this.Gb;if(d){c=d.rs(a);if(f!=c.getHeading()){this.Gb=c.getHeading();this.$o(c)}}else this.Gb=c.getHeading();f!=a&&A(b,"headingchanged")}};
+l.Sx=function(){if(this.Cs){var a=this.f.o;a.getRotatableMapTypeCollection()?this.AF(a.getRotatableMapTypeCollection().Tm()):this.Dp(a.getHeading(),j)}};
+l.oT=function(a,b){var c=a.getRotatableMapTypeCollection();if(c&&a==c.Tm())this.AF(a,b);else{this.$o(a,b);this.Dp(a.getHeading(),j)}};
+l.AF=function(a,b){var c=this.f,d=a.getRotatableMapTypeCollection();d.isImageryVisible(c.H(),c.F(),n(function(f){if(f)a=d.rs(c.o.getHeading());this.$o(a,b);this.Dp(c.o.getHeading(),f)},
+this))};
+l.$o=function(a,b){this.Cs=j;this.f.aj(undefined,undefined,a,b);this.Cs=e};
+l.Dp=function(a,b){if(this.Gb!=a){this.Gb=a;A(this.f,"headingchanged")}if(this.Kn!=b){this.Kn=b;A(this.f,"rotatabilitychanged")}};
+l.Er=function(){if(!this.Sk){this.Sk=e;this.FS=Jd([Ga,Ca],n(function(a){return U(this.f,a,this,this.Sx)},
+this));this.Sx()}};
+l.or=function(){if(this.Sk){this.Sk=j;t(this.FS,w);var a=this.f,b=a.o.getRotatableMapTypeCollection();b&&this.$o(b.Tm());this.Dp(a.o.getHeading(),j)}};
+l.Rk=function(){return this.Sk};function Sj(){}
+;function Vj(a,b,c,d,f){this.A=a;this.f=c;this.kl=f;this.Ig=i;this.dt=j;this.l=J("div",this.A,Xg);this.no=0;sh(this.l,ja,Ug);Qf(this.l);this.wg=new R(0,0);this.Ka=[];this.tc=0;this.dc=i;if(this.f.He())this.Jl=i;this.fc=[];this.Ae=[];this.gk=[];this.Po=this.Jf=j;this.Ps=0;this.ze=b;this.Qo=0;this.o=i;this.kt=!!d;d||this.Bb(c.o);U(D,ia,this,this.QP)}
+l=Vj.prototype;l.yh=e;l.gf=0;l.Oh=0;l.configure=function(a,b,c,d){this.Qo=this.tc=c;if(this.f.He())this.Jl=a;a=this.Sd(a);this.wg=new R(a.x-b.x,a.y-b.y);this.dc=kk(d,this.wg,this.o.getTileSize());for(b=0;b<r(this.Ka);b++)Uf(this.Ka[b].pane);this.refresh();this.dt=e};
+l.ry=function(a,b,c,d){x(Uh).zf.To(j);this.configure(a,b,c,d);x(Uh).zf.To(e)};
+l.RE=function(a){this.gf=this.Oh=0;this.Mz();a=kk(a,this.wg,this.o.getTileSize());if(!a.equals(this.dc)){this.Jf=e;Ee(this.fc)&&A(this,"beforetilesload");for(var b=this.dc.topLeftTile,c=this.dc.gridTopLeft,d=a.topLeftTile,f=this.o.getTileSize(),g=b.x;g<d.x;++g){b.x++;c.x+=f;this.oc(this.DS)}for(g=b.x;g>d.x;--g){b.x--;c.x-=f;this.oc(this.CS)}for(g=b.y;g<d.y;++g){b.y++;c.y+=f;this.oc(this.BS)}for(g=b.y;g>d.y;--g){b.y--;c.y-=f;this.oc(this.ES)}a.equals(this.dc);this.Po=e;this.TG();this.Jf=j}};
+l.Mz=function(){if(this.f.Vv&&this.dc){this.f.IF(j);this.refresh()}};
+l.ZF=function(a){this.ze=a;this.oc(this.wt);this.Mz();a=i;if(!this.kt&&D.isInLowBandwidthMode())a=this.Yb;for(var b=0;b<r(this.Ka);b++){a&&this.Ka[b].Hv(a);a=this.Ka[b]}};
+l.Bb=function(a){if(a!=this.o){this.o=a;this.by();a=a.getTileLayers();r(a)<=100;for(var b=i,c=0;c<r(a);++c){this.TH(a[c],c,b);b=this.Ka[c]}this.Id=this.Ka[0];if(!this.kt&&D.isInLowBandwidthMode())this.aG();else this.Id=this.Ka[0]}};
+l.aG=function(){var a=this.o.aP;if(a){if(!this.Yb)this.Yb=new lk(this.l,a,-1);a=this.Id=this.Yb;this.wt(a,e);this.Ka[0].Hv(a);this.Rz(n(function(b){if(!b.isLowBandwidthTile)if(bi(b)&&!ef(b[Sh],Rc)){b.bandwidthAllowed=D.ALLOW_KEEP;Rf(b)}else this.hr(b)},
+this));this.dc&&this.refresh()}};
+l.hr=function(a){a.bandwidthAllowed=D.DENY;delete this.Ae[a[Sh]];delete this.fc[a[Sh]];ci(a);this.dl(a,Rc,j);Qf(a)};
+l.IO=function(){this.Ka[0].YI();this.Id=this.Ka[0];this.Rz(Rf);this.dc&&this.refresh();this.Yb&&this.Yb.Rr(n(function(a){this.dl(a,Rc,j)},
+this))};
+l.Rz=function(a){this.oc(function(b){b.Rr(a)})};
+l.remove=function(){this.by();Cg(this.l)};
+l.show=function(){Rf(this.l)};
+l.J=function(a,b,c){if(this.f.He()&&this.Jl){b=b||this.ln(this.Qo);var d=this.Vz(this.Jl),f=i;if(c)f=this.Nm(this.Sz(c,d,b));a=this.Sd(a,i,f);return this.Wz(this.Tr(a),d,b)}else{f=c?this.Nm(c):i;a=this.Sd(a,i,f);return this.Tr(a)}};
+l.ws=function(){return(this.f.He()?this.ln(this.Qo):1)*this.o.getProjection().getWrapWidth(this.tc)};
+l.X=function(a,b){if(this.f.He()&&this.Jl){var c=this.ln(this.Qo),d=this.Vz(this.Jl);a=this.Sz(a,d,c)}else a=a;a=this.Nm(a);return this.o.getProjection().fromPixelToLatLng(a,this.tc,b)};
+l.Sd=function(a,b,c){var d=this.o.getProjection();b=b||this.tc;a=d.fromLatLngToPixel(a,b);c&&d.getNearestImage(a,b,c);return a};
+l.Nm=function(a){return new S(a.x+this.wg.width,a.y+this.wg.height)};
+l.Tr=function(a){return new S(a.x-this.wg.width,a.y-this.wg.height)};
+l.Vz=function(a){return this.Tr(this.Sd(a))};
+l.oc=function(a){var b=this;t(this.Ka,function(c){a.call(b,c)});
+this.Yb&&D.isInLowBandwidthMode()&&a.call(this,this.Yb)};
+l.fJ=function(a){var b=a.tileLayer;a=this.lG(a);for(var c=this.no=0;c<r(a);++c){var d=a[c];this.If(d,b,new S(d.coordX,d.coordY))}};
+l.gU=function(){this.oc(this.lG);this.Po=j};
+l.lG=function(a){var b=this.f.bh().latLng;this.hU(a.images,b,a.sortedImages);return a.sortedImages};
+l.If=function(a,b,c){var d;if(a.errorTile){Cg(a.errorTile);a.errorTile=i;d=e}if(a.baseTileHasError){a.baseTileHasError=i;d=e}var f=this.o,g=this.f.O(),h=f.getTileSize(),k=this.dc.gridTopLeft;k=new S(k.x+c.x*h,k.y+c.y*h);var o=this.dc.topLeftTile;o=new S(o.x+c.x,o.y+c.y);b.ZQ(k,o,h,this.f.H(),this.tc);if(k.x!=a.offsetLeft||k.y!=a.offsetTop)Bf(a,k);Cf(a,new R(h,h));var q=this.tc;c=e;if(f.getProjection().tileCheckRange(o,q,h)){if(a.isLowBandwidthTile&&a.imageAbove&&bi(a.imageAbove)&&!ef(a.imageAbove[Sh],
+Rc))b=a.imageAbove[Sh];else{b=b.getTileUrl(o,q);if(b==i){b=Rc;c=j}}f=e;k=new S(k.x+kg(this.A,"left"),k.y+kg(this.A,"top"));if(!(new Zg(-h,-h,g.width,g.height)).Kf(k)){if(this.f.Vv)b=Rc;f=j}if(b!=a[Sh]){if(D.isInLowBandwidthMode()){if(this.Yb&&a.bandwidthAllowed==D.DENY){this.hr(a);return j}if(a.bandwidthAllowed==D.ALLOW_KEEP&&!Ee(this.fc)){this.hr(a);return j}else if(a.bandwidthAllowed==D.ALLOW_ONE)a.bandwidthAllowed=D.ALLOW_KEEP}this.dl(a,b,f)}}else{this.dl(a,Rc,j);c=j}if(Sf(a)&&(bi(a)||d))a.bandwidthWaitToShow&&
+D.isInLowBandwidthMode()||Rf(a);return c};
+l.refresh=function(){A(this,"beforetilesload");if(this.dc){this.Jf=e;this.Oh=this.gf=0;if(this.kl&&!this.Ig)this.Ig=new cd(this.kl);this.oc(this.fJ);this.Po=j;this.TG();this.Jf=j}};
+l.TG=function(){Ee(this.Ae)&&A(this,Na,this.Oh);Ee(this.fc)&&A(this,La,this.gf)};
+function mk(a,b){this.topLeftTile=a;this.gridTopLeft=b}
+mk.prototype.equals=function(a){if(!a)return j;return a.topLeftTile.equals(this.topLeftTile)&&a.gridTopLeft.equals(this.gridTopLeft)};
+function kk(a,b,c){var d=new S(a.x+b.width,a.y+b.height);a=Kd(d.x/c-Ob);d=Kd(d.y/c-Ob);var f=a*c-b.width;b=d*c-b.height;return new mk(new S(a,d),new S(f,b))}
+Vj.prototype.by=function(){this.oc(function(a){a.clear()});
+this.Ka.length=0;if(this.Yb){this.Yb.clear();this.Yb=i}this.Id=i};
+function lk(a,b,c){this.images=[];this.pane=Tj(c,a);this.tileLayer=b;this.sortedImages=[];this.index=c}
+lk.prototype.clear=function(){var a=this.images;if(a){for(var b=r(a),c=0;c<b;++c)for(var d=a.pop(),f=r(d),g=0;g<f;++g)nk(d.pop());delete this.tileLayer;delete this.images;delete this.sortedImages;Cg(this.pane)}};
+var nk=function(a){if(a.errorTile){Cg(a.errorTile);a.errorTile=i}Cg(a);if(a.imageAbove)a.imageAbove=i;if(a.imageBelow)a.imageBelow=i};
+lk.prototype.Hv=function(a){for(var b=this.images,c=r(b)-1;c>=0;c--)for(var d=r(b[c])-1;d>=0;d--){b[c][d].imageBelow=a.images[c][d];a.images[c][d].imageAbove=b[c][d]}};
+lk.prototype.Rr=function(a){t(this.images,function(b){t(b,function(c){a(c)})})};
+lk.prototype.YI=function(){this.Rr(function(a){var b=a.imageBelow;a.imageBelow=i;if(b)b.imageAbove=i})};
+l=Vj.prototype;l.TH=function(a,b,c){a=new lk(this.l,a,b);this.wt(a,e);c&&a.Hv(c);this.Ka.push(a)};
+l.pi=function(a){this.yh=a;a=0;for(var b=r(this.Ka);a<b;++a)for(var c=this.Ka[a],d=0,f=r(c.images);d<f;++d)for(var g=c.images[d],h=0,k=r(g);h<k;++h)g[h][Rh]=this.yh};
+l.GU=function(a,b,c){a==this.Id?this.nI(b,c):this.JV(b,c)};
+l.wt=function(a,b){var c=this.o.getTileSize(),d=new R(c,c),f=a.tileLayer,g=a.images,h=a.pane,k=sf(this,this.GU,a),o=new Qh;o.alpha=f.isPng();o.hideWhileLoading=e;o.onLoadCallback=sf(this,this.up);o.onErrorCallback=k;var q=this.ze,s=Ob*2+1;k=ke(q.width/c+s);c=ke(q.height/c+s);for(b=!b&&r(g)>0&&this.dt;r(g)>k;){s=g.pop();for(q=0;q<r(s);++q)nk(s[q])}for(q=r(g);q<k;++q)g.push([]);for(q=0;q<r(g);++q){for(;r(g[q])>c;)nk(g[q].pop());for(k=r(g[q]);k<c;++k){s=Qc(Rc,h,Xg,d,o);if(rb)if(a==this.Yb){s.bandwidthAllowed=
+D.ALLOW_ALL;s.isLowBandwidthTile=e}else s.bandwidthAllowed=D.DENY;b&&this.If(s,f,new S(q,k));var u=f.getOpacity();u<1&&hg(s,u);g[q].push(s)}}};
+l.hU=function(a,b,c){var d=this.o.getTileSize();b=this.Sd(b);b.x=b.x/d-0.5;b.y=b.y/d-0.5;d=this.dc.topLeftTile;for(var f=0,g=r(a),h=0;h<g;++h)for(var k=r(a[h]),o=0;o<k;++o){var q=a[h][o];q.coordX=h;q.coordY=o;var s=d.x+h-b.x,u=d.y+o-b.y;q.sqdist=s*s+u*u;c[f++]=q}c.length=f;c.sort(function(H,G){return H.sqdist-G.sqdist})};
+l.DS=function(a){var b=a.tileLayer,c=a.images;a=c.shift();c.push(a);c=r(c)-1;for(var d=0;d<r(a);++d)this.If(a[d],b,new S(c,d))};
+l.CS=function(a){var b=a.tileLayer,c=a.images;if(a=c.pop()){c.unshift(a);for(c=0;c<r(a);++c)this.If(a[c],b,new S(0,c))}};
+l.ES=function(a){var b=a.tileLayer;a=a.images;for(var c=0;c<r(a);++c){var d=a[c].pop();a[c].unshift(d);this.If(d,b,new S(c,0))}};
+l.BS=function(a){var b=a.tileLayer;a=a.images;for(var c=r(a[0])-1,d=0;d<r(a);++d){var f=a[d].shift();a[d].push(f);this.If(f,b,new S(d,c))}};
+l.mS=function(a){if("http://"+window.location.host==_mHost){var b=ng(og(a));b=Ei("x:%1$s,y:%2$s,zoom:%3$s",b.x,b.y,b.zoom);if(a.match("transparent.png"))b="transparent";ij("/maps/gen_204?ev=failed_tile&cad="+b)}};
+l.nI=function(a,b){if(a.indexOf("tretry")==-1&&this.o.getUrlArg()=="m"&&!ef(a,Rc)){var c=!!this.Ae[a];delete this.fc[a];delete this.Ae[a];delete this.gk[a];this.mS(a);a+="&tretry=1";this.dl(b,a,c)}else{this.up(a,b);var d,f;a=this.Id.images;for(d=0;d<r(a);++d){c=a[d];for(f=0;f<r(c);++f)if(c[f]==b)break;if(f<r(c))break}if(d!=r(a)){this.oc(function(g){if(g=g.images[d]&&g.images[d][f]){Qf(g);g.baseTileHasError=e}});
+!b.errorTile&&!b.isLowBandwidthTile&&this.yJ(b);this.f.tn()}}};
+l.dl=function(a,b,c){a[Sh]&&a[Th]&&this.up(a[Sh],a);if(!ef(b,Rc)){this.fc[b]=1;if(c)this.Ae[b]=1;if(a.isLowBandwidthTile)this.gk[b]=1;a.fetchBegin=ed()}Zh(a,b,a.imageFetcherOpts)};
+l.up=function(a,b){if(!(ef(a,Rc)||!this.fc[a])){if(b.fetchBegin){var c=ed()-b.fetchBegin;b.fetchBegin=i;b.isLowBandwidthTile||D.trackTileLoad(b,c);if(ok()){pk.push(c);qk.push("u");this.gf==0&&Eg(this.Ig,"first")}}if(b.bandwidthWaitToShow&&Sf(b)&&b.imageBelow&&b.bandwidthAllowed!=D.DENY)if(!Sf(b.imageBelow)||b.imageBelow.baseTileHasError)for(c=b;c;c=c.imageAbove){Rf(c);c.bandwidthWaitToShow=j}if(!Ee(this.Ae)){++this.Oh;delete this.Ae[a];Ee(this.Ae)&&!this.Jf&&A(this,Na,this.Oh)}++this.gf;delete this.fc[a];
+if(!this.kt&&D.isInLowBandwidthMode()){if(b.isLowBandwidthTile){b=He(this.gk);delete this.gk[a];b==1&&He(this.gk)==0&&!this.Jf&&this.UG()}this.Yb&&this.eu()&&this.AC()}else Ee(this.fc)&&!this.Jf&&this.UG()}};
+l.UG=function(){A(this,La,this.gf);if(this.Ig){this.Ig.tick("total_"+this.gf);this.Ig.done();this.Ig=i}};
+l.eu=function(){return He(this.fc)+this.Ps<Pb};
+l.QP=function(a){a?this.aG():this.IO()};
+l.AC=function(){setTimeout(n(this.NO,this),0);this.Ps++};
+l.NO=function(){this.Ps--;var a,b=Infinity,c;if(!this.eu())return j;this.Po&&this.gU();for(var d=r(this.Ka)-1;d>=0;--d)for(var f=this.Ka[d],g=f.sortedImages,h=0;h<r(g);++h){var k=g[h];if(k.bandwidthAllowed==D.DENY){if(h<b){b=h;a=k;c=f}break}}if(a){a.bandwidthAllowed=D.ALLOW_ONE;a.bandwidthWaitToShow=e;this.If(a,c.tileLayer,new S(a.coordX,a.coordY));this.eu()&&this.AC();return e}return j};
+l.JV=function(a,b){this.up(a,b);Zh(b,Rc,b.imageFetcherOpts)};
+l.yJ=function(a){var b=this.o.getTileSize();b=J("div",this.Ka[0].pane,Xg,new R(b,b));b.style.left=a.style.left;b.style.top=a.style.top;var c=J("div",b),d=c.style;d.fontFamily="Arial,sans-serif";d.fontSize="x-small";d.textAlign="center";d.padding=Ff(6);gg(c);Vd(c,this.o.getErrorMessage());a.errorTile=b};
+l.dz=function(a,b,c){var d=this.ln(a);a=K(this.o.getTileSize()*d);d=a/this.o.getTileSize();d=this.Wz(this.dc.gridTopLeft,b,d);b=K(d.x+c.x);c=K(d.y+c.y);d=this.Id.images;for(var f=r(d),g=r(d[0]),h,k,o,q=Q(a),s=0;s<f;++s){k=d[s];o=Q(b+a*s);for(var u=0;u<g;++u){h=k[u].style;h.left=o;h.top=Q(c+a*u);h.width=h.height=q}}};
+l.pn=function(){var a=this.Id;this.oc(function(b){b!=a&&Tf(b.pane)})};
+l.QT=function(){for(var a=0,b=r(this.Ka);a<b;++a)Uf(this.Ka[a].pane)};
+l.hide=function(){Qf(this.l);this.dt=j};
+l.ri=function(a){fg(this.l,a)};
+l.ln=function(a){var b=this.ze.width;if(b<1)return 1;b=Kd(Math.log(b)*Math.LOG2E-2);a=se(a-this.tc,-b,b);return Math.pow(2,a)};
+l.Sz=function(a,b,c){return new S(1/c*(a.x-b.x)+b.x,1/c*(a.y-b.y)+b.y)};
+l.Wz=function(a,b,c){return new S(c*(a.x-b.x)+b.x,c*(a.y-b.y)+b.y)};
+l.tG=function(){this.oc(function(a){a=a.images;for(var b=0;b<r(a);++b)for(var c=0;c<r(a[b]);++c){var d=a[b][c];this.fc[d[Sh]]&&this.no++;ci(d)}});
+this.fc=[];this.Ae=[];if(this.no){A(this,Na,this.Oh);A(this,La,this.gf)}};
+l.loaded=function(){return Ee(this.fc)};
+l.uG=function(){return this.no>r(this.Id.sortedImages)*0.66};function rk(){rk.g.apply(this,arguments)}
+;rk.g=function(a,b){this.vR=a||j;this.PS=b||j};
+l=rk.prototype;l.printable=function(){return this.vR};
+l.selectable=function(){return this.PS};
+l.initialize=function(){return i};
+l.W=function(a,b){this.initialize(a,b)};
+l.Jk=N;l.getDefaultPosition=N;l.Jb=N;l.xa=N;l.Xk=function(a){a=a.style;a.color="black";a.fontFamily="Arial,sans-serif";a.fontSize="small"};
+l.allowSetVisibility=Oe;l.Jq=Ne;l.clear=function(){Rg(this)};
+var tk=function(a,b,c){if(c)sk(b);else{function d(){Of(b,!a.it())}
+d();v(a,Ca,d)}};
+function uk(a){(a=Nf(a))&&Qf(a)}
+;function vk(){this.LR=new RegExp("[^:]+?:([^'\"\\/;]*('{1}(\\\\\\\\|\\\\'|\\\\?[^'\\\\])*'{1}|\"{1}(\\\\\\\\|\\\\\"|\\\\?[^\"\\\\])*\"{1}|\\/{1}(\\\\\\\\|\\\\\\/|\\\\?[^\\/\\\\])*\\/{1})*)+;?","g")}
+vk.prototype.match=function(a){return a.match(this.LR)};var wk="$this",xk="$context",yk="$top",zk=/;$/,Ak=/\s*;\s*/;function Bk(a,b){if(!this.ad)this.ad={};b?De(this.ad,b.ad):De(this.ad,Ck);this.ad[wk]=a;this.ad[xk]=this;this.k=Le(a,ca);if(!b)this.ad[yk]=this.k}
+var Ck={};Ck.$default=i;var Dk=[],Ek=function(a,b){if(r(Dk)>0){var c=Dk.pop();Bk.call(c,a,b);return c}else return new Bk(a,b)},
+Fk=function(a){for(var b in a.ad)delete a.ad[b];a.k=i;Dk.push(a)};
+Bk.prototype.jsexec=function(a,b){try{return a.call(b,this.ad,this.k)}catch(c){return Ck.$default}};
+Bk.prototype.clone=function(a,b,c){a=Ek(a,this);a.eb("$index",b);a.eb("$count",c);return a};
+Bk.prototype.eb=function(a,b){this.ad[a]=b};
+var Gk="a_",Hk="b_",Ik="with (a_) with (b_) return ",Jk={},Kk=new vk;function Lk(a){if(!Jk[a])try{Jk[a]=new Function(Gk,Hk,Ik+a)}catch(b){}return Jk[a]}
+function Mk(a){return a}
+function Nk(a){for(var b=[],c=Kk.match(a),d=-1,f=0,g=i,h=0,k=r(c);h<k;++h){g=c[h];f+=r(g);d=g.indexOf(ea);b.push(df(g.substring(0,d)));var o=g.match(zk)?r(g)-1:r(g);b.push(Lk(g.substring(d+1,o)))}f<r(a)&&0;return b}
+function Ok(a){var b=[];a=a.split(Ak);for(var c=0,d=r(a);c<d;++c)if(a[c]){var f=Lk(a[c]);b.push(f)}return b}
+;var Pk="jsinstance",Qk="jsts",Rk="div",Sk="id";function Tk(a,b,c,d){c=new Uk(b,c,d);Vk(b);c.JS(uf(c,c.lt,a,b));c.wG()}
+function Uk(a,b,c){this.lW=a;this.Ge=b||N;this.lj=Af(a);this.su=1;this.SG=c||i}
+Uk.prototype.CU=function(){this.su++};
+Uk.prototype.wG=function(){this.su--;this.su==0&&this.Ge()};
+var Wk=0,Xk={};Xk[0]={};var Yk={},Zk={},$k=[],Vk=function(a){a.__jstcache||Ig(a,function(b){al(b)})},
+bl=[["jsselect",Lk],["jsdisplay",Lk],["jsvalues",Nk],["jsvars",Nk],["jseval",Ok],["transclude",Mk],["jscontent",Lk],["jsskip",Lk]],al=function(a){if(a.__jstcache)return a.__jstcache;var b=a.getAttribute("jstcache");if(b!=i)return a.__jstcache=Xk[b];b=$k.length=0;for(var c=r(bl);b<c;++b){var d=bl[b][0],f=a.getAttribute(d);Zk[d]=f;f!=i&&$k.push(d+"="+f)}if($k.length==0){a.setAttribute("jstcache","0");return a.__jstcache=Xk[0]}var g=$k.join("&");if(b=Yk[g]){a.setAttribute("jstcache",b);return a.__jstcache=
+Xk[b]}var h={};b=0;for(c=r(bl);b<c;++b){f=bl[b];d=f[0];var k=f[1];f=Zk[d];if(f!=i)h[d]=k(f)}b=ca+ ++Wk;a.setAttribute("jstcache",b);Xk[b]=h;Yk[g]=b;return a.__jstcache=h},
+cl={};l=Uk.prototype;l.JS=function(a){this.Lx=[];this.qE=[];this.hq=[];a();this.oE()};
+l.oE=function(){for(var a=this.Lx,b=this.qE,c,d,f,g;a.length;){c=a[a.length-1];d=b[b.length-1];if(d>=c.length){this.JR(a.pop());b.pop()}else{f=c[d++];g=c[d++];c=c[d++];b[b.length-1]=d;f.call(this,g,c)}}};
+l.Kk=function(a){this.Lx.push(a);this.qE.push(0)};
+l.dj=function(){return this.hq.length?this.hq.pop():[]};
+l.JR=function(a){ff(a);this.hq.push(a)};
+l.RG=function(a,b,c){if(a){c.parentNode.replaceChild(a,c);c=this.dj();c.push(this.lt,b,a);this.Kk(c)}else Mg(c)};
+l.lt=function(a,b){var c=this.oC(b),d=c.transclude;if(d){c=dl(d);!c&&this.SG?this.SG(b,n(function(){d=b.getAttribute("transclude");this.RG(dl(d),a,b);this.oE()},
+this)):this.RG(c,a,b)}else(c=c.jsselect)?this.yO(a,b,c):this.Xj(a,b)};
+l.Xj=function(a,b){var c=this.oC(b),d=c.jsdisplay;if(d){if(!a.jsexec(d,b)){Qf(b);return}Rf(b)}(d=c.jsvars)&&this.AO(a,b,d);(d=c.jsvalues)&&this.zO(a,b,d);if(d=c.jseval)for(var f=0,g=r(d);f<g;++f)a.jsexec(d[f],b);if(d=c.jsskip)if(a.jsexec(d,b))return;if(c=c.jscontent)this.xO(a,b,c);else{c=this.dj();for(b=b.firstChild;b;b=b.nextSibling)b.nodeType==1&&c.push(this.lt,a,b);c.length&&this.Kk(c)}};
+l.yO=function(a,b,c){c=a.jsexec(c,b);var d=b.getAttribute(Pk),f=j;if(d)if(d.charAt(0)==da){d=hf(d.substr(1));f=e}else d=hf(d);var g=nf(c),h=g?r(c):1,k=g&&h==0;if(g)if(k)if(d)Mg(b);else{b.setAttribute(Pk,"*0");Qf(b)}else{Rf(b);if(d===i||d===ca||f&&d<h-1){f=this.dj();for(d=d||0,g=h-1;d<g;++d){var o=b.cloneNode(e);b.parentNode.insertBefore(o,b);el(o,c,d);k=a.clone(c[d],d,h);f.push(this.Xj,k,o,Fk,k,i)}el(b,c,d);k=a.clone(c[d],d,h);f.push(this.Xj,k,b,Fk,k,i);this.Kk(f)}else if(d<h){f=c[d];el(b,c,d);k=
+a.clone(f,d,h);f=this.dj();f.push(this.Xj,k,b,Fk,k,i);this.Kk(f)}else Mg(b)}else if(c==i)Qf(b);else{Rf(b);k=a.clone(c,0,1);f=this.dj();f.push(this.Xj,k,b,Fk,k,i);this.Kk(f)}};
+l.AO=function(a,b,c){for(var d=0,f=r(c);d<f;d+=2){var g=c[d],h=a.jsexec(c[d+1],b);a.eb(g,h)}};
+l.zO=function(a,b,c){for(var d=0,f=r(c);d<f;d+=2){var g=c[d],h=a.jsexec(c[d+1],b),k=cl[b.tagName]&&cl[b.tagName][g];if(k){this.CU();k(b,g,h,n(this.wG,this))}else if(g.charAt(0)=="$")a.eb(g,h);else if(g.charAt(0)==ga)li(b,g,h);else if(g)if(typeof h=="boolean")h?Kg(b,g,g):Lg(b,g);else b.setAttribute(g,ca+h)}b.__jsvalues_parsed=e};
+l.xO=function(a,b,c){a=ca+a.jsexec(c,b);if(b.innerHTML!=a){for(;b.firstChild;)Mg(b.firstChild);a=this.lj.createTextNode(a);b.appendChild(a)}};
+l.oC=function(a){if(a.__jstcache)return a.__jstcache;var b=a.getAttribute("jstcache");if(b)return a.__jstcache=Xk[b];return al(a)};
+function dl(a,b){var c=document;if(a=b?fl(c,a,b):c.getElementById(a)){Vk(a);a=a.cloneNode(e);a.removeAttribute(Sk);return a}else return i}
+function fl(a,b,c,d){var f=a.getElementById(b);if(f)return f;c=c();d=d||Qk;if(f=a.getElementById(d))f=f;else{f=a.createElement(Rk);f.id=d;Qf(f);Gf(f);a.body.appendChild(f)}d=a.createElement(Rk);f.appendChild(d);d.innerHTML=c;return f=a.getElementById(b)}
+function el(a,b,c){c==r(b)-1?Kg(a,Pk,da+c):Kg(a,Pk,ca+c)}
+;function ek(){ek.g.apply(this,arguments)}
+function gl(){gl.g.apply(this,arguments)}
+;ek.g=function(){this.Wp={};this.SB=[];this.M=[];this.Rf={}};
+ek.prototype.DK=function(a){var b=this;return function(c){a:{for(var d=Qg(c);d&&d!=this;d=d.parentNode){var f;f=d;var g=f.__jsaction;if(!g){g=f.__jsaction={};var h=hl(f,"jsaction");if(h){h=h.split(Ak);for(var k=0,o=r(h);k<o;k++){var q=h[k];if(q){var s=q.indexOf(ea);if(s<0)g[m]=il(q,f,this);else{var u=df(q.substr(0,s));g[u]=il(df(q.substr(s+1)),f,this)}}}}}if(f=g[a]){g=d;if(!g.__jsvalues_parsed){if(h=hl(g,"jsvalues")){h=h.split(Ak);k=0;for(o=r(h);k<o;k++){s=h[k];u=s.indexOf(ea);if(!(u<0)){q=df(s.substr(0,
+u));if(q.charAt(0)==ga){s=df(s.substr(u+1));li(g,q,pg(s))}}}}g.__jsvalues_parsed=e}c=new jl(f,d,c,undefined);break a}}c=i}if(c)if(b.lB(c))c.done();else b.Gz||c.done()}};
+ek.prototype.lB=function(a,b){var c=this.Wp[a.bV];if(c){b&&a.tick("re");c(a);return e}return j};
+ek.prototype.KE=function(){this.Gz&&qg(this,function(){this.Gz.iI(n(this.iS,this))},
+0)};
+ek.prototype.iS=function(a){for(var b=a.node(),c=0;c<r(this.M);c++)if(this.M[c].containsNode(b))return this.lB(a,e);return j};
+function hl(a,b){var c=i;if(a.getAttribute)c=a.getAttribute(b);return c}
+function il(a,b,c){if(a.indexOf(ga)>=0)return a;for(b=b;b;b=b.parentNode){var d;d=b;var f=d.__jsnamespace;ue(f)||(f=d.__jsnamespace=hl(d,"jsnamespace"));if(d=f)return d+ga+a;if(b==c)break}return a}
+function kl(a,b){return function(c){return sh(c,a,b)}}
+l=ek.prototype;l.Yg=function(a){if(!Ie(this.Rf,a)){var b=this.DK(a),c=kl(a,b);this.Rf[a]=b;this.SB.push(c);t(this.M,function(d){d.RB(c)})}};
+l.Jd=function(a,b,c){tc(c,n(function(d,f){f=b?n(f,b):f;if(a)this.Wp[a+"."+d]=f;else this.Wp[d]=f},
+this));this.KE()};
+l.Bf=function(a){if(this.qN(a))return i;var b=new gl(a);t(this.SB,function(c){b.RB(c)});
+this.M.push(b);this.KE();return b};
+l.qN=function(a){for(var b=0;b<this.M.length;b++)if(this.M[b].containsNode(a))return e;return j};
+l.Nu=function(a){a.SI();xe(this.M,a)};
+gl.g=function(a){this.l=a;this.pB=[]};
+gl.prototype.containsNode=function(a){var b=this.l;for(a=a;b!=a&&a.parentNode;)a=a.parentNode;return b==a};
+gl.prototype.RB=function(a){this.pB.push(a.call(i,this.l))};
+gl.prototype.SI=function(){t(this.pB,w)};function ll(){}
+ll.prototype.iI=function(){};var Yc={};function ml(a){Yc[a]||(Yc[a]=[]);for(var b=1,c=arguments.length;b<c;b++)Yc[a].push(arguments[b])}
+ml("act_mm","act");ml("act_s","act");ml("act_d","act");ml("qopa","act","qop","act_s");ml("dropapin","act_dap");ml("act_dap","act","sha1");ml("mymaps","act_mm");ml("ms","info");ml("rv","act");ml("mplh","sha1","gdgt");ml("dir","qdt","act_d");ml("trtlr","qdt");ml("mspe","poly");ml("ftr","act");ml("labs","ftr","sdb");ml("act_br","act","browse");ml("re","act","qopa","act_s");ml("ab","ac");ml("sesame","ac");ml("sg","ac");function Xc(a,b){var c=a.replace("/main.js","");return function(d){if(a)return[c+"/mod_"+d+".js"];else if(b)for(var f=0;f<b.length;++f)if(b[f].name==d)return b[f].urls;return i}}
+;function nl(){nl.g.apply(this,arguments)}
+Kh(nl,"dspmr",1,{rH:e,dS:e,Yp:j,BE:j},{g:e});var sk=function(a){x(nl).rH(a)};function Fj(){this.Ni={};this.UO={};var a={};a.locale=e;this.Kd=new wg(_mHost+"/maps/tldata",document,a);this.Rd={};this.xg={}}
+Fj.prototype.Zp=function(a,b){var c=this.Ni,d=this.UO;d[a]||(d[a]={});var f=j;b=b.bounds;for(var g=0;g<r(b);++g){var h=b[g],k=h.ix;if(k==-1||k==-2){this.jV(a,h);f=e}else if(!d[a][k]){d[a][k]=e;c[a]||(c[a]=[]);c[a].push(ol(h,e));f=e}}f&&A(this,"appfeaturesdata",a)};
+Fj.prototype.H=function(a){if(this.Ni[a])return this.Ni[a];return i};
+Fj.prototype.sN=function(a){return this.Rd[a]||this.xg[a]};
+var od=function(a){var b=x(Fj);tc(a,function(c,d){b.Zp(c,d)})},
+ol=function(a,b){var c=[a.s*1.0E-6,a.w*1.0E-6,a.n*1.0E-6,a.e*1.0E-6];if(b)c.push(a.minz||1);return c};
+Fj.prototype.jV=function(a,b){if(this.Rd[a])this.Rd[a].Tw(ol(b,j),b.ix==-2);else{this.xg[a]||(this.xg[a]=[]);this.xg[a].push(b)}};
+Fj.prototype.Lm=function(a,b,c,d,f){if(this.Rd[a])c(this.Rd[a].pE(b));else if(this.xg[a])vd("qdt",1,n(function(k){this.Rd[a]||(this.Rd[a]=a=="ob"?new k(i,i,18):new k);t(this.xg[a],n(function(o){this.Rd[a].Tw(ol(o,j),o.ix==-2)},
+this));delete this.xg[a];c(this.Rd[a].pE(b))},
+this),d);else if(this.Ni[a]){d=this.Ni[a];for(var g=0;g<r(d);g++)if(r(d[g])==5)if(!(f&&f<d[g][4])){var h=new id(new z(d[g][0],d[g][1]),new z(d[g][2],d[g][3]));if(b.intersects(h)){c(e);return}}c(j)}};Ck.bidiDir=Yi;Ck.bidiAlign=Zi;Ck.bidiAlignEnd=$i;Ck.bidiMark=cj;Ck.bidiSpan=dj;Ck.bidiEmbed=ej;Ck.isRtl=Wi;function pl(a,b,c,d){if(ef(a.src,Rc))a.src="";Zh(a,ca+c,{onLoadCallback:d,onErrorCallback:d})}
+cl.IMG||(cl.IMG={});cl.IMG.src=pl;var ql=ga+"src";cl.IMG||(cl.IMG={});cl.IMG[ql]=pl;function rl(a,b,c,d){wd("exdom",Ua)(a,b,c,d)}
+;var D={};D.wH="delay";D.xH="forced";D.yH="ip";D.zH="nodelay";D.Rw="tiles";D.uH="lbm";D.vH="lbr";D.ALLOW_ALL=3;D.ALLOW_ONE=2;D.ALLOW_KEEP=1;D.DENY=0;D.Us=j;D.Ty=j;D.xp=[];D.mw=0;D.setupBandwidthHandler=function(a,b,c){if(!rb)return-1;if(Kb)if(Lb){D.setLowBandwidthMode(e,D.yH);return 0}var d=0;if(!c||Kb){c=ed();d=B(0,a-c+sb*1000)}if(d<=0)D.setLowBandwidthMode(e,D.zH);else{var f=setTimeout(function(){D.setLowBandwidthMode(e,D.wH)},
+d);fd(b,La,function(){clearTimeout(f)})}return d};
+D.YK=function(a){D.Ty=e;D.setLowBandwidthMode(a,D.xH)};
+D.setLowBandwidthMode=function(a,b){if(rb)if(D.Us!=a){D.Us=a;A(D,ia,a);var c={};c[D.uH]=a+0;if(b)c[D.vH]=b;sl(i,c)}};
+D.isInLowBandwidthMode=function(){return D.Us};
+D.initializeLowBandwidthMapLayers=function(){if(rb){D.mapTileLayer=new tl(tb,17);D.satTileLayer=new tl(ub,19);D.hybTileLayer=new tl(vb,17);D.terTileLayer=new tl(wb,15)}};
+D.trackTileLoad=function(a,b){if(!(!rb||D.Ty||!bi(a)||a.preCached)){D.xp.unshift(b);D.mw+=b;if(!(D.xp.length<Bb)){a=D.mw/D.xp.length;if(a>zb)D.setLowBandwidthMode(e,D.Rw);else a<Ab&&D.setLowBandwidthMode(j,D.Rw);D.mw-=D.xp.pop()}}};
+function tl(a,b){a=a.split(",");Id.call(this,a,i,b,_mSatelliteToken,_mDomain)}
+p(tl,Id);function ul(a){var b=[],c=a.split(":",1)[0],d=hf(c);if(d){a=a.substring(c.length+1);for(c=0;c<d;++c)b.push(Ei(a,c))}return b}
+function vl(a){if(_mGL=="in")for(var b=0;b<a.length;++b){var c=/[&?]$/.test(a[b])?"":/[?]/.test(a[b])?"&":"?";a[b]=[a[b],c,"gl=",_mGL,"&"].join("")}}
+function wl(a,b){md.call(this);this.lm=a||"#000";this.QC=b}
+p(wl,md);wl.prototype.vK=function(a,b){var c=new Ki;c.set("ll",a.T().Aa());c.set("spn",a.sb().Aa());c.set("z",b);this.QC&&c.set("t",this.QC);return'<a target="_blank" style="color:'+this.lm+'" href="'+c.Xe(e,"http://google.com/mapmaker")+'">'+F(12915)+"</a>"};
+wl.prototype.$r=function(a,b){a=_mMapCopy+" "+F(12916)+" - "+this.vK(a,b);return new tg("",[a])};
+function Cd(a,b,c,d){var f=[];if(Ib){f.push(["MAPMAKER_NORMAL_MAP",a]);f.push(["MAPMAKER_HYBRID_MAP",c]);f.push(["MAPMAKER_MAP_TYPES",[a,b,c]]);return f}var g=new wl(a.getLinkColor(),"m"),h=ul(_mCityblockUseSsl?Zb:Fb);vl(h);a={shortName:F(10111),errorMessage:F(10120),alt:F(10511),urlArg:"gm"};g=new Ed(h,g,17);a=new Hd([g],d,F(10049),a);f.push(["MAPMAKER_NORMAL_MAP",a]);h=ul(_mCityblockUseSsl?$b:Gb);vl(h);g=b.getTileLayers()[0];var k=new wl(c.getLinkColor(),"h");c={shortName:F(10117),urlArg:"gh",textColor:"white",
+linkColor:"white",errorMessage:F(10121),alt:F(10513)};h=new Ed(h,k,17,e);d=new Hd([g,h],d,F(10116),c);f.push(["MAPMAKER_HYBRID_MAP",d]);f.push(["MAPMAKER_MAP_TYPES",[a,b,d]]);return f}
+;function xl(a){De(this,a,e)}
+function jl(){jl.g.apply(this,arguments)}
+p(jl,cd);jl.g=function(a,b,c,d){cd.call(this,a,d);this.bV=a;this.uD=b;this.Me=new xl(c);c.type==m&&this.action(b)};
+jl.prototype.Pr=function(){cd.prototype.Pr.call(this);this.Me=this.uD=i};
+jl.prototype.node=function(){return this.uD};
+jl.prototype.event=function(){return this.Me};
+jl.prototype.value=function(a){var b=this.node();return b?b[a]:undefined};function ok(){return typeof _stats!="undefined"}
+function yl(a,b,c){ok()&&vd("stats",$a,function(d){d(a,b,c)});
+wj(a,b,c)}
+v(cd,"report",yl);function sl(a,b){Cb&&vd("stats",ab,function(c){c(a,b)})}
+v(cd,"reportaction",sl);function zl(a,b,c,d){vd("stats",eb,function(f){f(a,b,c,d)})}
+v(cd,"dapperreport",zl);function Zc(a){ok()&&vd("stats",cb,function(b){b(a)})}
+function $c(a){ok()&&vd("stats",db,function(b){b(a)})}
+;var pk=[],qk=[];function hd(a,b){a.Xg("mt",b.o.getUrlArg()+(D.isInLowBandwidthMode()?"l":"h"))}
+;function Al(){}
+p(Al,oi);function Bl(){}
+;function Cl(){Cl.g.apply(this,arguments)}
+var Dl,El;p(Cl,Al);var Fl=Ne,Gl=j;l=Cl.prototype;l.Wa=Bl;l.sh=Pe;l.Tj=Ne;l.Zh=Pe;l.redraw=function(){};
+l.remove=function(){this.Qa=e};
+l.Nz=Pe;l.Qq=N;zj(Cl,"poly",2);
+Cl.g=function(a,b,c,d,f){this.color=b||Hl;this.weight=Le(c,Il);this.opacity=Le(d,Jl);this.N=e;this.ea=i;this.mc=j;b=f||{};this.Yn=!!b.mapsdt;this.Pm=!!b.geodesic;this.mD=b.mouseOutTolerance||i;this.jc=e;if(f&&f.clickable!=i)this.jc=f.clickable;this.ia=i;this.hd={};this.Db={};this.Va=j;this.S=i;this.Oa=a&&r(a)||this.Va?4:0;this.ce=i;if(this.Va){this.ah=3;this.Ce=16}else{this.ah=1;this.Ce=32}this.Jw=0;this.j=[];this.jb=[];this.U=[];if(a){f=[];for(b=0;b<r(a);b++)if(c=a[b])c.lat&&c.lng?f.push(c):f.push(new z(c.y,
+c.x));this.j=f;this.Qq()}this.f=i;this.Qa=e;this.Vj={}};
+l=Cl.prototype;l.Ea=function(){return"Polyline"};
+l.initialize=function(a){this.f=a;this.Qa=j};
+l.copy=function(){var a=new Cl(i,this.color,this.weight,this.opacity);a.j=Me(this.j);a.Ce=this.Ce;a.S=this.S;a.Oa=this.Oa;a.ce=this.ce;a.ia=this.ia;return a};
+l.Vb=function(a){return new z(this.j[a].lat(),this.j[a].lng())};
+l.GM=function(){return{color:this.color,weight:this.weight,opacity:this.opacity}};
+l.Ud=function(){return r(this.j)};
+l.show=function(){this.Wa(e)};
+l.hide=function(){this.Wa(j)};
+l.I=function(){return!this.N};
+l.ya=function(){return!this.Yn};
+l.sL=function(){var a=this.Ud();if(a==0)return i;var b=this.Vb(Kd((a-1)/2));a=this.Vb(ke((a-1)/2));b=this.f.J(b);a=this.f.J(a);return this.f.X(new S((b.x+a.x)/2,(b.y+a.y)/2))};
+l.aM=function(a){var b=this.j,c=0;a=a||6378137;for(var d=0,f=r(b);d<f-1;++d)c+=b[d].Pb(b[d+1],a);return c};
+l.zv=function(a){this.ia=a};
+l.hE=function(){x(Vh).Cf(n(function(){this.H();this.Se()},
+this))};
+l.J=function(a){return this.f.J(a)};
+l.X=function(a){return this.f.X(a)};
+function Kl(a,b){b=new Cl(i,a.color,a.weight,a.opacity,b);b.LO(a);return b}
+l=Cl.prototype;
+l.LO=function(a){this.ia=a;Ge(this,a,["name","description","snippet"]);this.Ce=a.zoomFactor;if(this.Ce==16)this.ah=3;var b=r(a.levels||[]);if(b){for(var c=a.points,d=r(c),f=new Array(b),g=0,h=0,k=0,o=0;g<d;++o){var q=1,s=0,u;do{u=c.charCodeAt(g++)-63-1;q+=u<<s;s+=5}while(u>=31);h+=q&1?~(q>>1):q>>1;q=1;s=0;do{u=c.charCodeAt(g++)-63-1;q+=u<<s;s+=5}while(u>=31);k+=q&1?~(q>>1):q>>1;f[o]=new z(h*1.0E-5,k*1.0E-5,e)}this.j=f;c=a.levels;d=new Array(b);for(f=0;f<b;++f)d[f]=c.charCodeAt(f)-63;b=this.S=d;this.Oa=
+a.numLevels;this.ce=Ll(b,this.Oa)}else{this.j=[];this.S=[];this.Oa=0;this.ce=[]}this.K=i};
+l.H=function(a,b){if(this.K&&!a&&!b)return this.K;var c=r(this.j);if(c==0)return this.K=i;var d=a?a:0;c=b?b:c;var f=new id(this.j[d]);if(this.Pm)for(d=d+1;d<c;++d){var g=Ml([this.j[d-1],this.j[d]]);f.extend(g.nb());f.extend(g.mb())}else for(d=d+1;d<c;d++)f.extend(this.j[d]);if(!a&&!b)this.K=f;return f};
+l.cn=function(){return this.Oa};
+l.kw=function(){var a=[];t(this.j,function(b){a.push(b.MG())});
+return a.join(" ")};
+l.getKml=function(a){vd("kmlu",2,n(function(b){a(b(this))},
+this))};var Nl=2,Ol="#0055ff";function Pl(){Pl.g.apply(this,arguments)}
+p(Pl,Al);l=Pl.prototype;l.Wa=Bl;l.sh=Pe;l.aE=Pe;l.redraw=Bl;l.remove=function(){this.Qa=e;t(this.xj,w);this.xj.length=0};
+zj(Pl,"poly",3);Pl.g=function(a,b,c,d,f,g,h){h=h||{};this.D=[];var k=h.mouseOutTolerance;this.mD=k;if(a){this.D=[new Cl(a,b,c,d,{mouseOutTolerance:k})];this.D[0].Wo&&this.D[0].Wo(e);c=this.D[0].weight}this.fill=f||!ue(f);this.color=f||Ol;this.opacity=Le(g,0.25);this.outline=!!(a&&c&&c>0);this.N=e;this.ea=i;this.mc=j;this.Yn=!!h.mapsdt;this.jc=e;if(h.clickable!=i)this.jc=h.clickable;this.ia=i;this.hd={};this.Db={};this.sf=[];this.Qa=e;this.xj=[]};
+l=Pl.prototype;l.Ea=function(){return"Polygon"};
+l.initialize=function(a){this.f=a;this.Qa=j;for(var b=0;b<r(this.D);++b){this.D[b].initialize(a);this.xj.push(U(this.D[b],"lineupdated",this,this.qV))}};
+l.qV=function(){this.hd={};this.Db={};this.K=i;this.sf=[];A(this,"lineupdated")};
+l.copy=function(){var a=new Pl(i,i,i,i,i,i);a.ia=this.ia;Ge(a,this,["fill","color","opacity","outline","name","description","snippet"]);for(var b=0;b<r(this.D);++b)a.D.push(this.D[b].copy());return a};
+l.H=function(){if(!this.K){for(var a=i,b=0;b<r(this.D);b++){var c=this.D[b].H();if(c)if(a){a.extend(c.gs());a.extend(c.XA())}else a=c}this.K=a}return this.K};
+l.Vb=function(a){if(r(this.D)>0)return this.D[0].Vb(a);return i};
+l.Ud=function(){if(r(this.D)>0)return this.D[0].Ud()};
+l.show=function(){this.Wa(e)};
+l.hide=function(){this.Wa(j)};
+l.I=function(){return!this.N};
+l.ya=function(){return!this.Yn};
+l.lL=function(a){for(var b=0,c=this.D[0].j,d=c[0],f=1,g=r(c);f<g-1;++f)b+=qj(d,c[f],c[f+1])*rj(d,c[f],c[f+1]);a=a||6378137;return Math.abs(b)*a*a};
+l.zv=function(a){this.ia=a};
+l.hE=function(){x(Vh).Cf(n(function(){this.H();this.Se()},
+this))};
+function Ql(a,b){var c=new Pl(i,i,i,i,a.fill?a.color||Ol:i,a.opacity,b);c.ia=a;Ge(c,a,["name","description","snippet","outline"]);for(var d=Le(a.outline,e),f=0;f<r(a.polylines||[]);++f){a.polylines[f].weight=a.polylines[f].weight||Nl;if(!d)a.polylines[f].weight=0;c.D[f]=Kl(a.polylines[f],b);c.D[f].Wo(e)}return c}
+Pl.prototype.cn=function(){for(var a=0,b=0;b<r(this.D);++b)if(this.D[b].cn()>a)a=this.D[b].cn();return a};
+Pl.prototype.getKml=function(a){vd("kmlu",3,n(function(b){a(b(this))},
+this))};function Ml(a){var b;b=[];var c=[];oj(a[0],b);oj(a[1],c);var d=[];Rl(b,c,d);b=[];Rl(d,[0,0,1],b);c=new Sl;Rl(d,b,c.r3);if(c.r3[0]*c.r3[0]+c.r3[1]*c.r3[1]+c.r3[2]*c.r3[2]>1.0E-12)pj(c.r3,c.latlng);else c.latlng=new z(a[0].lat(),a[0].lng());b=c.latlng;c=new id;c.extend(a[0]);c.extend(a[1]);d=c.Ia;c=c.Ja;var f=Qe(b.lng());b=Qe(b.lat());c.contains(f)&&d.extend(b);if(c.contains(f+ee)||c.contains(f-ee))d.extend(-b);return new nj(new z(Re(d.lo),a[0].lng(),e),new z(Re(d.hi),a[1].lng(),e))}
+function Sl(a,b){this.latlng=a?a:new z(0,0);this.r3=b?b:[0,0,0]}
+Sl.prototype.toString=function(){var a=this.r3;return this.latlng+", ["+a[0]+", "+a[1]+", "+a[2]+"]"};var Hl="#0000ff",Il=5,Jl=0.45,Ll=function(a,b){for(var c=r(a),d=new Array(c),f=new Array(b),g=0;g<b;++g)f[g]=c;for(g=c-1;g>=0;--g){for(var h=a[g],k=c,o=h+1;o<b;++o)if(k>f[o])k=f[o];d[g]=k;f[h]=g}return d};Fl=function(){return Dl};
+Cl.prototype.lb=function(a){for(var b=0,c=1;c<r(this.j);++c)b+=this.j[c].Pb(this.j[c-1]);if(a)b+=a.Pb(this.j[r(this.j)-1]);return b*3.2808399};
+Cl.prototype.Xo=function(a,b){this.Qk=!!b;if(this.kb!=a){Gl=this.kb=a;if(this.f){this.f.Fj("Polyline").rv(!this.kb);A(this.f,"capture",this,m,a)}}};
+function Tl(a){return function(){var b=arguments;vd("mspe",a,n(function(c){c.apply(this,b)},
+this))}}
+l=Cl.prototype;l.zm=function(){var a=arguments;vd("mspe",1,n(function(b){b.apply(this,a)},
+this))};
+l.Ar=Tl(3);l.cq=Tl(4);l.Tj=function(){return this.kb};
+l.Br=function(){var a=arguments;vd("mspe",5,n(function(b){b.apply(this,a)},
+this))};
+l.bf=function(){if(!this.ok)return j;return this.Ud()>=this.ok};
+l.Wo=function(a){this.Hb=a};
+l.er=Tl(6);l.Lv=Tl(7);l=Pl.prototype;l.Ar=Tl(8);l.Lv=Tl(9);l.$S=Tl(18);l.er=Tl(10);l.Tj=function(){return this.D[0].kb};
+l.cq=Tl(11);l.Br=Tl(12);l.zm=Tl(13);Cl.prototype.aq=Tl(20);v(Pc,Ba,function(a){a.AE(["Polyline","Polygon"],new Ul)});
+function Ul(){Ul.g.apply(this,arguments)}
+p(Ul,qi);Ul.g=Jh(N);Ul.prototype.initialize=Jh(N);Ul.prototype.ba=N;Ul.prototype.ka=N;Ul.prototype.rv=N;Ih(Ul,"poly",4);function ak(){ak.g.apply(this,arguments)}
+p(ak,oi);function Vl(){Vl.g.apply(this,arguments)}
+;function Wl(){Wl.g.apply(this,arguments)}
+;function Yj(){Yj.g.apply(this,arguments)}
+;ak.g=function(a,b){this.Cc=a;this.N=e;if(b){if(ve(b.zPriority))this.zPriority=b.zPriority;if(b.statsFlowType)this.kl=b.statsFlowType}};
+l=ak.prototype;l.constructor=ak;l.yh=e;l.zPriority=10;l.kl="";l.initialize=function(a){this.La=new Vj(a.Ya(1),a.O(),a,e,this.kl);this.La.pi(this.yh);a=a.o;var b={};b.tileSize=a.getTileSize();this.La.Bb(new Hd([this.Cc],a.getProjection(),"",b));yh(this.La,La,this)};
+l.remove=function(){ph(this.La,La);this.La.remove();this.La=i};
+l.pi=function(a){this.yh=a;this.La&&this.La.pi(a)};
+l.copy=function(){var a=new ak(this.Cc);a.pi(this.yh);return a};
+l.redraw=N;l.hide=function(){this.N=j;this.La.hide()};
+l.show=function(){this.N=e;this.La.show()};
+l.I=function(){return!this.N};
+l.ya=Oe;l.KM=function(){return this.Cc};
+l.refresh=function(){this.La&&this.La.refresh()};
+l.getKml=function(a){var b=this.Cc.DO;b?vd("kmlu",7,function(c){a(c(b))}):a(i)};var Xl=0,Yl=1,Zl=0,$l="iconAnchor",am="iconSize",bm="image",cm="imageMap",dm="infoWindowAnchor",em="transparent",fm,gm,hm,im;function jm(a,b,c,d){De(this,a||{});if(b)this.image=b;if(c)this.label=c;if(d)this.shadow=d}
+function km(a){var b=a.infoWindowAnchor;a=a.iconAnchor;return new R(b.x-a.x,b.y-a.y)}
+function lm(a,b,c){var d=0;if(b==i)b=Yl;switch(b){case Xl:d=a;break;case Zl:d=c-1-a;break;case Yl:default:d=(c-1)*a}return d}
+function mm(a,b){if(a.image){var c=r(a.image);c=a.image.substring(0,c-4);a.printImage=c+"ie.gif";a.mozPrintImage=c+"ff.gif";if(b){a.shadow=b.shadow;a.iconSize=new R(b.width,b.height);a.shadowSize=new R(b.shadow_width,b.shadow_height);var d,f;d=b.hotspot_x;f=b.hotspot_y;var g=b.hotspot_x_units,h=b.hotspot_y_units;d=d!=i?lm(d,g,a.iconSize.width):(a.iconSize.width-1)/2;f=f!=i?lm(f,h,a.iconSize.height):a.iconSize.height;a.iconAnchor=new S(d,f);a.infoWindowAnchor=new S(d,2);if(b.mask)a.transparent=c+"t.png";
+a.imageMap=[0,0,0,b.width,b.height,b.width,b.height,0]}}}
+fm=new jm;fm[bm]=L("marker");fm.shadow=L("shadow50");fm[am]=new R(20,34);fm.shadowSize=new R(37,34);fm[$l]=new S(9,34);fm.maxHeight=13;fm.dragCrossImage=L("drag_cross_67_16");fm.dragCrossSize=new R(16,16);fm.dragCrossAnchor=new S(7,9);fm[dm]=new S(9,2);fm[em]=L("markerTransparent");fm[cm]=[9,0,6,1,4,2,2,4,0,8,0,12,1,14,2,16,5,19,7,23,8,26,9,30,9,34,11,34,11,30,12,26,13,24,14,21,16,18,18,16,20,12,20,8,18,4,16,2,15,1,13,0];fm.printImage=L("markerie",e);fm.mozPrintImage=L("markerff",e);
+fm.printShadow=L("dithshadow",e);var nm=new jm;nm[bm]=L("circle");nm[em]=L("circleTransparent");nm[cm]=[10,10,10];nm.imageMapType="circle";nm.shadow=L("circle-shadow45");nm[am]=new R(20,34);nm.shadowSize=new R(37,34);nm[$l]=new S(9,34);nm.maxHeight=13;nm.dragCrossImage=L("drag_cross_67_16");nm.dragCrossSize=new R(16,16);nm.dragCrossAnchor=new S(7,9);nm[dm]=new S(9,2);nm.printImage=L("circleie",e);nm.mozPrintImage=L("circleff",e);gm=new jm(fm,L("dd-start"));gm.printImage=L("dd-startie",e);
+gm.mozPrintImage=L("dd-startff",e);hm=new jm(fm,L("dd-pause"));hm.printImage=L("dd-pauseie",e);hm.mozPrintImage=L("dd-pauseff",e);im=new jm(fm,L("dd-end"));im.printImage=L("dd-endie",e);im.mozPrintImage=L("dd-endff",e);function om(a){a=se(K(a),0,255);return Kd(a/16).toString(16)+(a%16).toString(16)}
+;function pm(a){var b=[1518500249,1859775393,2400959708,3395469782];a+=String.fromCharCode(128);var c=r(a),d=ke(c/4)+2;d=ke(d/16);for(var f=new Array(d),g=0;g<d;g++){f[g]=new Array(16);for(var h=0;h<16;h++)f[g][h]=a.charCodeAt(g*64+h*4)<<24|a.charCodeAt(g*64+h*4+1)<<16|a.charCodeAt(g*64+h*4+2)<<8|a.charCodeAt(g*64+h*4+3)}f[d-1][14]=(c-1>>>30)*8;f[d-1][15]=(c-1)*8&4294967295;a=1732584193;c=4023233417;h=2562383102;var k=271733878,o=3285377520,q=new Array(80),s,u,H,G,I;for(g=0;g<d;g++){for(var M=0;M<
+16;M++)q[M]=f[g][M];for(M=16;M<80;M++)q[M]=(q[M-3]^q[M-8]^q[M-14]^q[M-16])<<1|(q[M-3]^q[M-8]^q[M-14]^q[M-16])>>>31;s=a;u=c;H=h;G=k;I=o;for(M=0;M<80;M++){var Y=Kd(M/20);Y=(s<<5|s>>>27)+qm(Y,u,H,G)+I+b[Y]+q[M]&4294967295;I=G;G=H;H=u<<30|u>>>2;u=s;s=Y}a=a+s&4294967295;c=c+u&4294967295;h=h+H&4294967295;k=k+G&4294967295;o=o+I&4294967295}return rm(a)+rm(c)+rm(h)+rm(k)+rm(o)}
+function qm(a,b,c,d){switch(a){case 0:return b&c^~b&d;case 1:return b^c^d;case 2:return b&c^b&d^c&d;case 3:return b^c^d}}
+function rm(a){for(var b="",c=7;c>=0;c--)b+=(a>>>c*4&15).toString(16);return b}
+;function sm(a){this.Ha=new wg(_mHost+"/maps/gen_204",window.document);this.Da=a}
+sm.prototype.log=function(a){if(Fc!=0){var b;b="";var c,d,f,g,h,k,o=0;do{c=a.charCodeAt(o++);d=a.charCodeAt(o++);f=a.charCodeAt(o++);g=c>>2;c=(c&3)<<4|d>>4;h=(d&15)<<2|f>>6;k=f&63;if(isNaN(d))h=k=64;else if(isNaN(f))k=64;b=b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-=".charAt(g)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-=".charAt(c)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-=".charAt(h)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-=".charAt(k)}while(o<
+a.length);b=b;a=pm(b).substr(0,10);d=[];f=Gc%Fc;for(g=r(b);f<g;){d.push(b[f]);f+=Fc}b=d.join("");this.Ha.send({ev:"frag",src:this.Da,fpr:a,fra:b,see:Gc})}};function ik(){ik.g.apply(this,arguments)}
+p(ik,oi);function tm(a,b,c,d,f){this.B=a;this.gb=b;this.jj=i;this.wb=c;this.jc=this.N=this.kd=e;this.ng=1;this.RV=d;this.xe={border:"1px solid "+d,backgroundColor:"white",fontSize:"1%"};f&&De(this.xe,f)}
+p(tm,ik);l=tm.prototype;l.initialize=Pe;l.Gg=Pe;l.$k=Pe;l.qv=Pe;l.LF=Pe;l.Jb=Pe;l.remove=Pe;l.Yl=Pe;l.Ic=Pe;l.nc=Pe;l.cc=Pe;l.redraw=Pe;l.cc=Pe;l.hide=Pe;l.show=Pe;Ih(tm,"mspe",17);tm.prototype.Ea=function(){return"ControlPoint"};
+tm.prototype.I=function(){return!this.N};
+tm.prototype.ya=Oe;tm.prototype.Hj=function(){return this.B};function um(a,b,c,d){this.B=a;this.ue=b;this.Fr=c;this.$=d||{};um.g.apply(this,arguments)}
+um.g=N;p(um,oi);um.prototype.copy=function(){return new um(this.B,this.ue,this.Fr,this.$)};
+zj(um,"arrow",1);function vm(){if(ue(El))return El;var a;a:{a=j;if(document.namespaces){for(var b=0;b<document.namespaces.length;b++){var c=document.namespaces(b);if(c.name=="v")if(c.urn=="urn:schemas-microsoft-com:vml")a=e;else{a=j;break a}}if(!a){a=e;document.namespaces.add("v","urn:schemas-microsoft-com:vml")}}a=a}if(!a)return El=j;a=J("div",document.body);Vd(a,'<v:shape id="vml_flag1" adj="1" />');b=a.firstChild;b.style.behavior="url(#default#VML)";El=b?typeof b.adj=="object":e;Cg(a);return El}
+function wm(){if(E.type==0&&E.version<10)return j;if(document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Shape","1.1"))return e;return j}
+function xm(){if(!E.pb())return j;return!!document.createElement("canvas").getContext}
+;var Rl=function(a,b,c){c[0]=a[1]*b[2]-a[2]*b[1];c[1]=a[2]*b[0]-a[0]*b[2];c[2]=a[0]*b[1]-a[1]*b[0]};ik.g=function(a,b,c){if(!a.lat&&!a.lon)a=new z(a.y,a.x);this.B=a;this.jj=i;this.va=0;this.N=this.wb=j;this.Ir=[];this.V=[];this.qa=fm;this.zh=this.Rs=i;this.jc=e;this.ii=this.cg=j;this.f=i;if(b instanceof jm||b==i||c!=i){this.qa=b||fm;this.jc=!c;this.$={icon:this.qa,clickable:this.jc}}else{b=this.$=b||{};this.qa=b.icon||fm;this.xy&&this.xy(b);if(b.clickable!=i)this.jc=b.clickable;if(b.isPng)this.cg=e}b&&Ge(this,b,["id","icon_id","name","description","snippet","nodeData"]);this.gz=ym;if(b&&b.getDomId)this.gz=
+b.getDomId;A(ik,Ba,this)};
+l=ik.prototype;l.oD=i;l.Ea=function(){return"Marker"};
+l.NN=function(a,b,c,d){var f=this.qa;a=J("div",a,b.position,i,i,i,this.ii);a.appendChild(c);fg(c,0);c=new Qh;c.alpha=di(f.label.url)||this.cg;c.cache=e;c.onLoadCallback=d;c.onErrorCallback=d;d=Qc(f.label.url,a,f.label.anchor,f.label.size,c);fg(d,1);bg(d);this.V.push(a)};
+l.initialize=function(a){this.f=a;this.N=e;this.vJ();this.$.hide&&this.hide()};
+l.vJ=function(){var a=this.f,b=this.qa,c=this.V,d=a.Ya(4);if(this.$.ground)d=a.Ya(0);var f=a.Ya(2);a=a.Ya(6);if(this.$.zS)this.ii=e;var g=this.Hf(),h=3,k=sf(this,function(){--h==0&&A(this,"initialized")}),
+o=new Qh,q=b.sprite&&b.sprite.image?di(b.sprite.image):di(b.image);o.alpha=q||this.cg;o.scale=e;o.cache=e;o.styleClass=b.styleClass;o.onLoadCallback=k;o.onErrorCallback=k;q=zm(b.image,b.sprite,d,i,b.iconSize,o);if(b.label)this.NN(d,g,q,k);else{Bf(q,g.position,this.ii);d.appendChild(q);c.push(q);k("",i)}this.Rs=q;if(b.shadow&&!this.$.ground){o=new Qh;o.alpha=di(b.shadow)||this.cg;o.scale=e;o.cache=e;o.onLoadCallback=k;o.onErrorCallback=k;k=Qc(b.shadow,f,g.shadowPosition,b.shadowSize,o);bg(k);k.hC=
+e;c.push(k)}else k("",i);k=i;if(b.transparent){o=new Qh;o.alpha=di(b.transparent)||this.cg;o.scale=e;o.cache=e;o.styleClass=b.styleClass;k=Qc(b.transparent,a,g.position,b.iconSize,o);bg(k);c.push(k);k.sO=e}this.GJ(d,f,q,g);this.ri();this.sJ(a,q,k)};
+l.GJ=function(a,b,c,d){var f=this.qa,g=this.V,h=new Qh;h.scale=e;h.cache=e;h.printOnly=e;var k;if(E.px())k=E.Na()?f.mozPrintImage:f.printImage;if(k){bg(c);a=zm(k,f.sprite,a,d.position,f.iconSize,h);g.push(a)}if(f.printShadow&&!E.Na()){b=Qc(f.printShadow,b,d.position,f.shadowSize,h);b.hC=e;g.push(b)}};
+l.sJ=function(a,b,c){var d=this.qa;if(!this.jc&&!this.wb)this.vx(c||b);else{b=c||b;var f=E.Na();if(c&&d.imageMap&&f){b="gmimap"+ji++;a=this.zh=J("map",a);sh(a,ja,Ug);a.setAttribute("name",b);a.setAttribute("id",b);f=J("area",i);f.setAttribute("log","miw");var g=d.imageMap.join(",");f.setAttribute("coords",g);d=Le(d.imageMapType,"poly");f.setAttribute("shape",d);f.setAttribute("alt","");f.setAttribute("href","javascript:void(0)");a.appendChild(f);c.setAttribute("usemap","#"+b);b=f}else $f(b,"pointer");
+c=this.gz(this);b.setAttribute("id",c);b.nodeData=this.nodeData;this.oD=b;this.Yl(b)}};
+l.Tb=function(){return this.f};
+var zm=function(a,b,c,d,f,g){if(b){f=f||new R(b.width,b.height);return hi(b.image||a,c,new S(b.left?b.left:0,b.top),f,d,i,g)}else return Qc(a,c,d,f,g)};
+l=ik.prototype;l.Hf=function(){var a=this.qa.iconAnchor,b=this.jj=this.f.J(this.B),c=b.x-a.x;if(this.ii)c=-c;a=this.Ao=new S(c,b.y-a.y-this.va);c=new S(a.x+this.va/2,a.y+this.va/2);return{divPixel:b,position:a,shadowPosition:c}};
+l.fT=function(a){Zh(this.Rs,a,{scale:e,size:this.qa.iconSize})};
+l.VI=function(){t(this.V,Cg);ff(this.V);this.oD=this.Rs=i;if(this.zh){Cg(this.zh);this.zh=i}};
+l.remove=function(){this.VI();t(this.Ir,function(a){if(a[Am]==this)a[Am]=i});
+ff(this.Ir);this.da&&this.da();A(this,"remove");this.vd=i};
+l.copy=function(){this.$.id=this.id;this.$.icon_id=this.icon_id;return new ik(this.B,this.$)};
+l.hide=function(){this.Wa(j)};
+l.show=function(){this.Wa(e)};
+l.Wa=function(a,b){if(!(!b&&this.N==a)){this.N=a;t(this.V,a?Uf:Tf);this.zh&&Pf(this.zh,a);A(this,Qa,a)}};
+l.I=function(){return!this.N};
+l.ya=function(){return e};
+l.redraw=function(a){if(this.V.length){if(!a)if(this.f.J(this.B).equals(this.jj))return;a=this.V;for(var b=this.Hf(),c=0,d=r(a);c<d;++c)if(a[c].dO)this.oK(b,a[c]);else a[c].hC?Bf(a[c],b.shadowPosition,this.ii):Bf(a[c],b.position,this.ii)}};
+l.ri=function(){if(this.V&&this.V.length)for(var a=this.$.zIndexProcess?this.$.zIndexProcess(this):pi(this.B.lat()),b=this.V,c=0;c<r(b);++c)this.QV&&b[c].sO?fg(b[c],1000000000):fg(b[c],a)};
+l.xB=function(a){this.ZV=a;this.$.zIndexProcess&&this.ri()};
+l.Hj=function(){return this.B};
+l.H=function(){return new id(this.B)};
+l.cc=function(a){var b=this.B;this.B=a;this.ri();this.redraw(e);A(this,"changed",this,b,a);A(this,"kmlchanged")};
+l.pd=function(){return this.qa};
+l.bB=function(){return this.$.title};
+l.uh=function(){return this.qa.iconSize||new R(0,0)};
+l.zb=function(){return this.Ao};
+l.kq=function(a){a[Am]=this;this.Ir.push(a)};
+l.Yl=function(a){this.wb?this.lq(a):this.kq(a);this.vx(a)};
+l.vx=function(a){var b=this.$.title;b&&!this.$.hoverable?Kg(a,"title",b):Lg(a,"title")};
+l.zv=function(a){this.ia=a;A(this,Aa,a)};
+l.getKml=function(a){vd("kmlu",1,n(function(b){a(b(this))},
+this))};
+l.$u=function(a){vd("apiiw",7,n(function(b){if(!this.vd){this.vd=new b(this);xh(this,"remove",this,this.$R)}this.bm||a.call(this)},
+this))};
+l.$R=function(){if(this.vd){this.vd.remove();delete this.vd}};
+l.ja=function(a,b){this.bm=j;this.$u(function(){this.vd.ja(a,b)})};
+l.Zl=function(a,b){if(this.Ws){w(this.Ws);this.Ws=i}this.da();if(a)this.Ws=v(this,m,uf(this,this.ja,a,b))};
+l.AJ=function(a,b){if(a.infoWindow)this.infoWindow=n(this.QQ,this,a,b)};
+l.QQ=function(a,b,c,d){this.bm=j;rg(d);this.$u(function(){this.vd.PQ(a,b,c,d)})};
+l.da=function(){if(this.vd)this.vd.da();else this.bm=e};
+l.Kb=function(a,b){this.bm=j;this.$u(function(){this.vd.Kb(a,b)})};
+var Bm=0,ym=function(a){return a.id?"mtgt_"+a.id:"mtgt_unnamed_"+Bm++};var Am="__marker__",Cm=[[m,e,e,j],[ka,e,e,j],["mousedown",e,e,j],["mouseup",j,e,j],["mouseover",j,j,j],["mouseout",j,j,j],[ja,j,j,e]],Dm={};(function(){t(Cm,function(a){Dm[a[0]]={mU:a[1],bL:a[3]}})})();
+function Wj(a){t(a,function(b){for(var c=0;c<Cm.length;++c)sh(b,Cm[c][0],Em);Fm(b);v(b,Oa,Gm)})}
+function Fm(a){E.Dh()&&vd("touch",Va,function(b){new b(a)})}
+function Em(a){var b=Qg(a)[Am],c=a.type;if(b){Dm[c].mU&&Tg(a);Dm[c].bL?A(b,c,a):A(b,c,b.B)}}
+function Gm(){Ig(this,function(a){if(a[Am])try{delete a[Am]}catch(b){a[Am]=i}})}
+function Hm(a,b){t(Cm,function(c){c[2]&&v(a,c[0],function(){A(b,c[0],b.B)})})}
+;function Im(){this.kk=[];this.yt=new sm("mk");this.Ml=Math.random()<Ec;v(ik,Ba,n(this.zD,this))}
+Im.prototype.zD=function(a){if(this.Ml){r(this.kk)||setTimeout(n(this.YO,this),1000);this.kk.push(a);v(a,"remove",n(function(){xe(this.kk,a)},
+this))}};
+Im.prototype.YO=function(){for(var a=[],b=this.kk,c=Math.min(r(b),200),d=0;d<c;++d){var f=b[d];if(!f.I()){var g=f.B;f=encodeURIComponent(f.bB());a.push([g.lat(),g.lng(),f].join(","))}}if(r(a)){a.sort();a.push(b[0].Tb().F());this.yt.log(a.join(","))}this.Ml=j;this.kk=[]};
+var Jm=i;fd(ik,Ba,function(a){Jm=new Im;Jm.zD(a)});var Km=Q(12);
+function Lm(a,b,c,d,f,g,h,k){if(Ub){this.l=k?k:dl("tb_jstemplate",Mm);a&&a.appendChild(this.l);this.Pj=i;this.wq=e;this.k={};this.k.width=String(d);this.k.right=String(f);this.k.fontSize=Km;this.k.title=c?c:"";this.k.whiteSpace="";this.k.textAlign="center";this.k.label=b;this.k.paddingLeft="";this.k.paddingRight="";this.k.visible=e;this.k.toggled=j;this.k.subtypes=h?h:[];this.k.showChildren=h?r(h):j;this.k.rightAlign=j;this.vg()}else{a=J("div",a);Gf(a);h=a.style;h.backgroundColor="white";h.border=
+"1px solid black";h.textAlign="center";h.width=String(d);h.right=String(f);$f(a,"pointer");c&&a.setAttribute("title",c);c=J("div",a);c.style.fontSize=Km;Ef(b,c);this.l=a;this.ub=c}this.kC=j;this.cW=e;this.o=g}
+l=Lm.prototype;l.Uw=function(a,b,c,d){if(Ub){var f={};f.label=a;f.mapType=b;f.alt=c;f.checked=d;this.k.subtypes.push(f);if(this.wq)this.k.showChildren=e;this.vg()}};
+l.Sv=function(){if(Ub){this.zq();this.wq=e;if(!this.k.showChildren){this.k.showChildren=e;this.vg()}}};
+l.qn=function(){if(Ub){this.zq();this.wq=j;if(this.k.showChildren){this.k.showChildren=j;this.vg()}}};
+l.qF=function(a){if(Ub){this.zq();this.Pj=qg(this.l,n(this.qn,this),a)}};
+l.zq=function(){Ub&&clearTimeout(this.Pj)};
+l.vg=function(){if(Ub){var a=Ek(this.k);Tk(a,this.l);this.ub=this.l.firstChild}};
+l.yb=function(){return this.o};
+l.RS=function(a){if(Ub){if(this.k.title!=a){this.k.title=a;this.vg()}}else this.l.setAttribute("title",a)};
+l.Gg=function(a){if(Ub){for(var b in a)this.k[b]=a[b];this.vg()}};
+l.se=function(a,b){if(b){if(this.k.toggled!=a){this.k.toggled=a;this.vg()}}else{b=this.ub.style;b.fontWeight=a?"bold":"";b.border=a?"1px solid #6C9DDF":"1px solid white";for(var c=a?["Top","Left"]:["Bottom","Right"],d=a?"1px solid #345684":"1px solid #b0b0b0",f=0;f<r(c);f++)b["border"+c[f]]=d}return this.kC=a};
+l.Ln=function(){return this.kC};function Mm(){Yi()=="rtl";return'<div id="tbo_jstemplate" jsskip="$this.skip"><div id="tb_jstemplate" style="background-color: white;text-align: center;border: 1px solid black;position: absolute;cursor: pointer;" jsdisplay="visible" jsvalues=".style.width:$this.width;.style.right:$this.right;.style.whiteSpace:$this.whiteSpace;.style.textAlign:$this.textAlign;.title:$this.title;"><div jscontent="$this.label" jsvalues=".style.fontSize:$this.fontSize;.style.paddingLeft:$this.paddingLeft;.style.paddingRight:$this.paddingRight;.style.fontWeight:$this.toggled ? \'bold\' : \'\';.style.borderTop:$this.toggled ? \'1px solid #345684\' : \'1px solid white\';.style.borderLeft:$this.toggled ? \'1px solid #345684\' : \'1px solid white\';.style.borderBottom:$this.toggled ? \'1px solid #6C9DDF\' : \'1px solid #b0b0b0\';.style.borderRight:$this.toggled ? \'1px solid #6C9DDF\' : \'1px solid #b0b0b0\';"></div><div style="white-space:nowrap;text-align:left;font-size:11px;width:83px;background-color:white;border:1px solid black;padding-left:2px;position:absolute;" jsdisplay="showChildren" jsvalues=".style.left:$this.rightAlign ? \'-21px\' : \'-1px\';"><div jsselect="subtypes" jsvalues=".title:$this.alt"><input type="checkbox" style="vertical-align:middle;" jsvalues=".checked:$this.checked;"></input><span jscontent="$this.label"></span></div></div></div></div><div id="mmtc_jstemplate" jsselect="buttons"><div transclude="tbo_jstemplate"></div></div>'}
+;function Nm(a){return function(b){b?a(new z(Number(b.Location.lat),Number(b.Location.lng))):a(i)}}
+function Om(a){return function(){a(i)}}
+function Pm(a,b){return function(c){if(c){c[vg]=200;c.location=Qm(c.Location);c.copyright=c.Data&&c.Data.copyright;c.links=c.Links;t(c.links,Rm);b(c)}else b({query:a,code:600})}}
+function Sm(a,b){return function(){b({query:a,code:500})}}
+function Tm(a){this.pm=a||"api";this.Ha=new wg(_mHost+"/cbk",document)}
+Tm.prototype.Fq=function(){var a={};a.output="json";a.oe="utf-8";a.cb_client=this.pm;return a};
+Tm.prototype.MA=function(a,b){var c=this.Fq();c.ll=a.Aa();this.Ha.send(c,Pm(a.Aa(),b),Sm(a.Aa(),b))};
+Tm.prototype.oM=function(a,b){var c=this.Fq();c.ll=a.Aa();this.Ha.send(c,Nm(b),Om(b))};
+Tm.prototype.tM=function(a,b){var c=this.Fq();c.panoid=a;this.Ha.send(c,Pm(a,b),Sm(a,b))};function Um(){Cj.call(this,new md(""));this.RI=(_mCityblockUseSsl?Jb:ib)+"/cbk"}
+p(Um,Cj);Um.prototype.isPng=function(){return e};
+Um.prototype.getTileUrl=function(a,b){if(b>=0){var c=this.f.o.getName();a=this.RI+"?output="+(c==F(10116)||c==F(10050)?"hybrid":"overlay")+"&zoom="+b+"&x="+a.x+"&y="+a.y;a+="&cb_client=api";return a}else return Rc};
+Um.prototype.nT=function(a){this.f=a};
+Um.prototype.Tb=function(){return this.f};function Vm(){ak.call(this,new Um,{zPriority:4})}
+p(Vm,ak);Vm.prototype.initialize=function(a){this.f=a;ak.prototype.initialize.apply(this,[a]);this.Cc.nT(a);this.Tx=i;this.Z=[];this.Z.push(U(a,Ea,this,this.vq));this.Z.push(U(x(Fj),"appfeaturesdata",this,this.vq));this.vq()};
+Vm.prototype.vq=function(a){if(!a||a=="cb")x(Fj).Lm("cb",this.f.H(),n(function(b){if(this.Tx!=b){this.Tx=b;A(this,"changed",b)}},
+this))};
+Vm.prototype.remove=function(){t(this.Z,w);ff(this.Z);ak.prototype.remove.apply(this)};
+Vm.prototype.Ea=function(){return"CityblockLayerOverlay"};function Qm(a){a.latlng=new z(Number(a.lat),Number(a.lng));var b=a.pov={};b.yaw=a.yaw&&Number(a.yaw);b.pitch=a.pitch&&Number(a.pitch);b.zoom=a.zoom&&Number(a.zoom);return a}
+function Rm(a){a.yaw=a.yawDeg&&Number(a.yawDeg);return a}
+;function Wm(){Wm.g.apply(this,arguments)}
+Wm.g=function(){this.wa=j};
+l=Wm.prototype;l.hide=function(){return this.wa=e};
+l.show=function(){this.wa=j};
+l.I=function(){return this.wa};
+l.en=function(){return{}};
+l.gn=function(){return i};
+l.retarget=N;l.hF=N;l.$i=N;l.remove=N;l.focus=N;l.blur=N;l.ap=N;l.bl=N;l.al=N;l.YF=N;l.qb=N;l.Mm=N;l.ga=function(){return i};
+l.Gj=function(){return""};
+Ih(Wm,"cb_api",2);function Xm(){}
+p(Xm,rk);function gk(){gk.g.apply(this,arguments)}
+p(gk,Xm);function Ym(){Ym.g.apply(this,arguments)}
+p(Ym,Xm);function Zm(){Zm.g.apply(this,arguments)}
+p(Zm,Xm);Yj.g=function(a,b){this.anchor=a;this.offset=b||Yg};
+Yj.prototype.apply=function(a){Gf(a);a.style[this.WM()]=this.offset.getWidthString();a.style[this.RL()]=this.offset.getHeightString()};
+Yj.prototype.WM=function(){switch(this.anchor){case 1:case 3:return"right";default:return"left"}};
+Yj.prototype.RL=function(){switch(this.anchor){case 2:case 3:return"bottom";default:return"top"}};function $m(a){var b=this.Sb&&this.Sb();b=J("div",a.R(),i,b);this.W(a,b);return b}
+function Zj(){Zj.g.apply(this,arguments)}
+Zj.g=N;p(Zj,rk);Zj.prototype.hp=N;Zj.prototype.W=N;Ih(Zj,"ctrapi",7);Zj.prototype.allowSetVisibility=Ne;Zj.prototype.initialize=$m;Zj.prototype.getDefaultPosition=function(){return new Yj(2,new R(2,2))};
+function Xj(){Xj.g.apply(this,arguments)}
+Xj.g=N;p(Xj,rk);l=Xj.prototype;l.allowSetVisibility=Ne;l.printable=Oe;l.wk=N;l.sq=N;l.xa=N;l.W=N;Ih(Xj,"ctrapi",2);Xj.prototype.initialize=$m;Xj.prototype.getDefaultPosition=function(){return new Yj(3,new R(3,2))};
+function dk(){}
+p(dk,rk);dk.prototype.W=N;Ih(dk,"ctrapi",8);dk.prototype.initialize=$m;dk.prototype.allowSetVisibility=Ne;dk.prototype.getDefaultPosition=Pe;dk.prototype.Sb=function(){return new R(60,40)};
+function an(){}
+p(an,rk);an.prototype.W=N;Ih(an,"ctrapi",13);an.prototype.initialize=$m;an.prototype.getDefaultPosition=function(){return new Yj(0,new R(7,7))};
+an.prototype.Sb=function(){return new R(37,94)};
+function bn(){bn.g.apply(this,arguments)}
+bn.g=N;p(bn,rk);bn.prototype.W=N;Ih(bn,"ctrapi",12);bn.prototype.initialize=$m;bn.prototype.getDefaultPosition=function(){return xc?new Yj(2,new R(68,5)):new Yj(2,new R(7,4))};
+bn.prototype.Sb=function(){return new R(0,26)};
+function cn(){cn.g.apply(this,arguments)}
+p(cn,rk);cn.prototype.getDefaultPosition=function(){return new Yj(0,new R(7,7))};
+cn.prototype.Sb=function(){return new R(59,354)};
+cn.prototype.initialize=$m;function dn(){dn.g.apply(this,arguments)}
+dn.g=N;p(dn,cn);dn.prototype.W=N;Ih(dn,"ctrapi",5);function en(){en.g.apply(this,arguments)}
+en.g=N;p(en,cn);en.prototype.W=N;Ih(en,"ctrapi",6);function fn(){fn.g.apply(this,arguments)}
+Kh(fn,"ctrapi",17,{},{g:j});function gn(){gn.g.apply(this,arguments)}
+p(gn,rk);gn.prototype.initialize=$m;function fk(){fk.g.apply(this,arguments)}
+fk.g=N;p(fk,gn);fk.prototype.W=N;Ih(fk,"ctrapi",14);fk.prototype.getDefaultPosition=function(){return new Yj(0,new R(7,7))};
+fk.prototype.Sb=function(){return new R(17,35)};
+function hn(){hn.g.apply(this,arguments)}
+hn.g=N;p(hn,gn);hn.prototype.W=N;Ih(hn,"ctrapi",15);hn.prototype.getDefaultPosition=function(){return new Yj(0,new R(10,10))};
+hn.prototype.Sb=function(){return new R(19,42)};
+Xm.prototype.Jb=N;Xm.prototype.W=N;Ih(Xm,"ctrapi",1);Xm.prototype.initialize=$m;Xm.prototype.getDefaultPosition=function(){return new Yj(1,new R(7,7))};
+Ym.g=N;Ym.prototype.W=N;Ih(Ym,"ctrapi",9);Zm.g=N;Zm.prototype.W=N;Zm.prototype.Jk=N;Ih(Zm,"ctrapi",10);function jn(){jn.g.apply(this,arguments)}
+jn.g=N;p(jn,Xm);jn.prototype.W=N;Ih(jn,"ctrapi",18);gk.g=N;gk.prototype.Sl=N;gk.prototype.FE=N;gk.prototype.$x=N;gk.prototype.W=N;Ih(gk,"ctrapi",4);gk.prototype.Sb=function(){var a=Nf("hmtctl_inline");return a?new R(a.offsetWidth,a.offsetHeight):new R(0,0)};function kn(){this.Ad=new ln(this);kn.g.apply(this,arguments);this.show();this.mq(this.Ad)}
+p(kn,rk);kn.g=N;kn.prototype.mq=N;kn.prototype.Bb=N;kn.prototype.W=N;Ih(kn,"ovrmpc",1);l=kn.prototype;l.show=function(a){this.Ad.show(a)};
+l.hide=function(a){this.Ad.hide(a)};
+l.initialize=$m;l.QA=Pe;l.getDefaultPosition=function(){return new Yj(3,Yg)};
+l.O=function(){return Yg};
+function mn(){mn.g.apply(this,arguments)}
+mn.g=N;mn.prototype=new rk(j,e);mn.prototype.W=N;Ih(mn,"ctrapi",3);mn.prototype.initialize=$m;mn.prototype.getDefaultPosition=function(){return new Yj(2,new R(2,2))};
+function nn(){nn.g.apply(this,arguments)}
+nn.g=N;nn.prototype=new rk(j,e);nn.prototype.W=N;Ih(nn,"ctrapi",16);nn.prototype.initialize=$m;nn.prototype.getDefaultPosition=function(){return new Yj(2,new R(3,5))};function ln(a){this.wa=e;this.mJ=a;a=Nf("overview-toggle");sk(a)}
+var pn=function(a){var b=new ln,c=b.IH(function(d,f){if(!b.I()){on(a,b,f);w(c)}});
+return b},
+on=function(a,b,c){vd("ovrmpc",1,function(d){d=new d(a,b,c,e);b.SS(d)},
+c)};
+l=ln.prototype;l.I=function(){return this.wa};
+l.TU=function(){this.IT(!this.wa)};
+l.IT=function(a){if(a!=this.wa)a?this.hide():this.show()};
+l.IH=function(a){return v(this,"changed",a)};
+l.SS=function(a){this.mJ=a};
+l.show=function(a,b){this.wa=j;A(this,"changed",a,b)};
+l.hide=function(a){this.wa=e;A(this,"changed",a)};function qn(){}
+p(qn,rk);l=qn.prototype;l.getDefaultPosition=function(){return new Yj(1,new R(7,7))};
+l.initialize=function(a){var b=this.Sb&&this.Sb();b=J("div",a.R(),i,b);b.setAttribute("id","nlcc");U(a,Da,this,this.vw);U(a,Ga,this,this.vw);this.W(a,b);return b};
+l.vw=function(){this.xl()};
+l.W=N;l.GF=N;l.xl=N;Ih(qn,"nl",1);l=ik.prototype;l.ho=function(a){var b={};if(E.pb()&&!a)b={left:0,top:0};else if(E.type==1&&E.version<7)b={draggingCursor:"hand"};a=new Nh(a,b);this.oI(a);return a};
+l.oI=function(a){v(a,"dragstart",uf(this,this.lg,a));v(a,"drag",uf(this,this.jf,a));U(a,"dragend",this,this.kg);Hm(a,this)};
+l.lq=function(a){this.G=this.ho(a);this.cf=this.ho(i);this.kd?this.vz():this.Uy();this.pI(a);this.XR=U(this,"remove",this,this.VR)};
+l.pI=function(a){T(a,"mouseover",this,this.iu);T(a,"mouseout",this,this.gu);sh(a,ja,Ah(ja,this))};
+l.Ic=function(){this.kd=e;this.vz()};
+l.vz=function(){if(this.G){this.G.enable();this.cf.enable();if(!this.lz&&this.mK){var a=this.qa,b=a.dragCrossImage||L("drag_cross_67_16");a=a.dragCrossSize||rn;var c=new Qh;c.alpha=e;b=this.lz=Qc(b,this.f.Ya(2),Xg,a,c);b.dO=e;this.V.push(b);bg(b);Qf(b)}}};
+l.nc=function(){this.kd=j;this.Uy()};
+l.Uy=function(){if(this.G){this.G.disable();this.cf.disable()}};
+l.dragging=function(){return!!(this.G&&this.G.dragging()||this.cf&&this.cf.dragging())};
+l.rA=function(){return this.G};
+l.lg=function(a){this.pj=new S(a.left,a.top);this.oj=this.f.J(this.B);A(this,"dragstart",this.B);a=be(this.Vp);this.LN();a=pf(this.gv,a,this.fK);qg(this,a,0)};
+l.LN=function(){this.DN()};
+l.DN=function(){this.Ci=ke(pe(2*this.Fx*(this.mk-this.va)))};
+l.fz=function(){this.Ci-=this.Fx;this.dT(this.va+this.Ci)};
+l.fK=function(){this.fz();return this.va!=this.mk};
+l.dT=function(a){a=B(0,me(this.mk,a));if(this.mz&&this.dragging()&&this.va!=a){var b=this.f.J(this.B);b.y+=a-this.va;this.cc(this.f.X(b))}this.va=a;this.ri()};
+l.gv=function(a,b,c){if(a.sc()){var d=b.call(this);this.redraw(e);if(d){a=pf(this.gv,a,b,c);qg(this,a,this.tI);return}}c&&c.call(this)};
+l.jf=function(a,b){if(!this.Ih){var c=new S(a.left-this.pj.x,a.top-this.pj.y),d=new S(this.oj.x+c.x,this.oj.y+c.y);if(this.kI){var f=this.f.Lc(),g=0,h=0,k=me((f.maxX-f.minX)*0.04,20),o=me((f.maxY-f.minY)*0.04,20);if(d.x-f.minX<20)g=k;else if(f.maxX-d.x<20)g=-k;if(d.y-f.minY-this.va-sn.y<20)h=o;else if(f.maxY-d.y+sn.y<20)h=-o;if(g||h){b||A(this.f,"movestart");this.f.G.Vt(g,h);a.left-=g;a.top-=h;d.x-=g;d.y-=h;this.Ih=setTimeout(n(function(){this.Ih=i;this.jf(a,e)},
+this),30)}}b&&!this.Ih&&A(this.f,Da);b=2*B(c.x,c.y);this.va=me(B(b,this.va),this.mk);if(this.mz)d.y+=this.va;this.cc(this.f.X(d));A(this,"drag",this.B)}};
+l.kg=function(){if(this.Ih){window.clearTimeout(this.Ih);this.Ih=i;A(this.f,Da)}A(this,"dragend",this.B);if(E.pb()&&this.Nn){var a=this.f.oa();a&&a.Ry();this.Ao.y+=this.va;this.Ao.y-=this.va}a=be(this.Vp);this.IN();a=pf(this.gv,a,this.dK,this.TK);qg(this,a,0)};
+l.IN=function(){this.Ci=0;this.nq=e;this.Gx=j};
+l.TK=function(){this.nq=j};
+l.dK=function(){this.fz();if(this.va!=0)return e;if(this.uI&&!this.Gx){this.Gx=e;this.Ci=ke(this.Ci*-0.5)+1;return e}return this.nq=j};
+l.qj=function(){return this.wb&&this.kd};
+l.draggable=function(){return this.wb};
+var sn={x:7,y:9},rn=new R(16,16);l=ik.prototype;l.xy=function(a){this.Vp=ae("marker");if(a)this.kI=(this.wb=!!a.draggable)&&a.autoPan!==j?e:!!a.autoPan;if(this.wb){this.uI=a.bouncy!=i?a.bouncy:e;this.Fx=a.bounceGravity||1;this.Ci=0;this.tI=a.bounceTimeout||30;this.kd=e;this.mK=a.dragCross!=j?e:j;this.mz=!!a.dragCrossMove;this.mk=13;a=this.qa;if(ve(a.maxHeight)&&a.maxHeight>=0)this.mk=a.maxHeight;this.oz=a.dragCrossAnchor||sn}};
+l.VR=function(){if(this.G){this.G.gm();Rg(this.G);this.G=i}if(this.cf){this.cf.gm();Rg(this.cf);this.cf=i}this.lz=i;ce(this.Vp);w(this.XR)};
+l.oK=function(a,b){if(this.dragging()||this.nq){Bf(b,new S(a.divPixel.x-this.oz.x,a.divPixel.y-this.oz.y));Rf(b)}else Qf(b)};
+l.iu=function(){this.dragging()||A(this,"mouseover",this.B)};
+l.gu=function(){this.dragging()||A(this,"mouseout",this.B)};Vl.g=function(a,b,c){this.name=a;if(typeof b=="string"){a=J("div",i);Vd(a,b);b=a}else if(b.nodeType==3){a=J("div",i);a.appendChild(b);b=a}this.contentElem=b;this.onclick=c};var tn=new R(690,786);Wl.g=N;l=Wl.prototype;l.OB=function(){};
+l.reset=function(a,b,c,d,f){this.B=a;this.Gf=c;if(f)this.Ed=f;this.wa=j};
+l.uh=function(){return new R(0,0)};
+l.ks=function(){return Yg};
+l.I=Oe;l.Ry=N;l.Oo=N;l.hide=N;l.hG=N;l.show=N;l.nr=N;l.Dr=N;l.xq=N;l.Wk=N;l.bg=N;l.gG=N;l.wB=N;l.vs=N;l.Rm=N;l.YA=N;l.av=N;l.Yx=N;l.zb=N;l.fA=N;l.Fp=N;l.Nl=N;l.mv=N;l.Dv=N;l.ps=N;l.EF=N;l.create=N;l.maximize=N;l.Mv=N;l.restore=N;l.CF=N;zj(Wl,"apiiw",1);l=Wl.prototype;l.M={};l.lc=[];l.B=new z(0,0);l.Dd=i;l.Zc=[];l.Ed=0;l.Yv=Yg;l.Gf=tn;l.wa=e;l.tL=function(){return this.lc};
+l.re=function(a){this.Dd=a};
+l.rd=function(){return this.Dd};
+l.Hj=function(){return this.B};
+l.ZA=function(){return this.Zc};
+l.zM=function(){return this.Ed};
+l.initialize=function(a){this.M=this.Hy(a.Ya(7),a.Ya(5));this.OB(a,this.M)};
+l.Hy=function(a,b){var c=new S(-10000,0);a=J("div",a,c);b=J("div",b,c);Qf(a);Qf(b);bg(a);bg(b);b={window:a,shadow:b};a=b.contents=J("div",a,Xg);Wf(a);bg(a);fg(a,10);return b};function jk(a,b){this.f=a;this.So=b;this.Rj=e;this.ww=j;this.Cu=[];this.HB=j;this.Z=[];this.jt=this.JB=j;this.Kh=i}
+l=jk.prototype;l.XF=function(){this.ww=e};
+l.bv=function(){this.ww=j;if(this.Cu.length>0){var a=this.Cu.shift();setTimeout(a,0)}};
+l.xa=function(){for(var a=0;a<r(this.Z);++a)w(this.Z[a]);this.Z=[];this.Z.push(U(this.f,m,this,this.kP))};
+l.ja=function(a,b,c,d){if(this.Rj){b=nf(b)?b:b?[new Vl(i,b)]:i;this.JD(a,b,c,d)}};
+l.ax=function(a){var b=this.oa();if(b){var c=this.Ze||{};if(c.limitSizeToMap&&!this.Xd()){var d={width:c.maxWidth||640,height:c.maxHeight||598},f=this.f.R(),g=f.offsetHeight-200;f=f.offsetWidth-50;if(d.height>g)d.height=B(40,g);if(d.width>f)d.width=B(199,f);b.Wk(!!c.autoScroll&&!this.Xd()&&(a.width>d.width||a.height>d.height));a.height=me(a.height,d.height);a.width=me(a.width,d.width)}else{b.Wk(!!c.autoScroll&&!this.Xd()&&(a.width>(c.maxWidth||640)||a.height>(c.maxHeight||598)));if(c.maxHeight)a.height=
+me(a.height,c.maxHeight)}}};
+l.Hp=function(a,b,c,d,f){var g=this.oa();if(g){this.JB=e;d=d&&!a?d:rl;var h=this.Ze?this.Ze.maxWidth:i,k=g.Zc,o=Jd(a||k,function(s){return s.contentElem});
+if(!a&&d==rl){var q=g.Ed;o[q]=o[q].cloneNode(e)}rg(f);d(o,n(function(s,u){if(g.Zc!=k)sg(f);else{this.ax(u);g.reset(g.B,a,u,g.ks(),g.Ed);a||g.Fp();b&&b();A(this,"infowindowupdate",Le(c,e),f);this.JB=j;sg(f);xj("iw-updated")}},
+this),h,f)}};
+l.Gp=function(a,b,c){var d=this.oa();if(d)if(this.ww)this.Cu.push(n(this.Gp,this,a,b));else{this.XF();a(d.Zc[d.Ed]);a=c||c==i;this.Hp(undefined,n(function(){b&&b();this.bv()},
+this),a)}};
+l.JD=function(a,b,c,d){var f=d||new cd("iw");f.tick("iwo0");var g=this.Ze=c||{};c=this.Ej();g.noCloseBeforeOpen||this.da();c.re(g.owner||i);this.XF();g.onPrepareOpenFn&&g.onPrepareOpenFn(b);A(this,Ia,b,a);c=i;if(b)c=Jd(b,function(k){return k.contentElem});
+if(b&&!g.contentSize){var h=be(this.IB);f.branch();rl(c,n(function(k,o){h.sc()&&this.Oz(a,b,o,g,f);this.bv();f.done()},
+this),g.maxWidth,f)}else{c=g.contentSize?g.contentSize:new R(200,100);this.Oz(a,b,c,g,f);this.bv()}d||f.done()};
+l.Oz=function(a,b,c,d,f){var g=this.oa();g.Dv(d.maxMode||0);d.buttons?g.Nl(d.buttons):g.Oo();this.ax(c);g.reset(a,b,c,d.pixelOffset,d.selectedTab);ue(d.maxUrl)||d.maxTitle||d.maxContent?this.Kh.WN(d.maxUrl,d):g.Yx();this.HB?this.gx(d,f):xh(this.oa(),"infowindowcontentset",this,pf(this.gx,d,f))};
+l.MN=function(){var a=this.oa();if(E.type==4){this.Z.push(U(this.f,Da,a,function(){this.gG()}));
+this.Z.push(U(this.f,"movestart",a,function(){this.wB()}))}};
+l.Xd=function(){var a=this.oa();return!!a&&a.bg()};
+l.cl=function(a){this.Kh&&this.Kh.cl(a)};
+l.kP=function(a){!a&&!(ue(this.Ze)&&this.Ze.noCloseOnClick)&&this.da()};
+l.gx=function(a,b){A(this,"infowindowupdate",e,b);this.jt=e;a.onOpenFn&&a.onOpenFn();A(this,Ka,b);this.GB=a.onCloseFn;this.FB=a.onBeforeCloseFn;this.f.mi(this.oa().B);b.tick("iwo1")};
+l.da=function(){var a=this.oa();if(a){be(this.IB);if(!a.I()||this.jt){this.jt=j;var b=this.FB;if(b){b();this.FB=i}a.hide();A(this,Ha);(this.Ze||{}).noClearOnClose||a.xq();if(b=this.GB){b();this.GB=i}A(this,Ja)}a.re(i)}};
+l.Ej=function(){if(!this.cb){this.cb=new Wl;this.TN(this.cb)}return this.cb};
+l.TN=function(a){oi.re(a,this);this.f.ba(a);xh(a,"infowindowcontentset",this,function(){this.HB=e});
+U(a,"closeclick",this,this.da);U(a,"animate",this.f,this.f.NF);this.ET();this.DT();T(a.M.contents,m,this,this.eQ);this.IB=ae("infowindowopen");this.MN()};
+l.ET=function(){vd("apiiw",3,n(function(a){this.Kh=new a(this.oa(),this.f);yh(this.Kh,"maximizedcontentadjusted",this);yh(this.Kh,"maxtab",this)},
+this))};
+l.DT=function(){vd("apiiw",6,n(function(a){var b=this.oa();a=new a(b,this.f,this);U(this,"infowindowupdate",a,a.jQ);U(this,Ja,a,a.fQ);U(b,"restoreclick",a,a.sR)},
+this))};
+l.oa=function(){return this.cb};
+l.eQ=function(){var a=this.oa();A(a,m,a.B)};
+l.Kb=function(a,b){if(!this.Rj)return i;var c=J("div",this.f.R());c.style.border="1px solid #979797";Tf(c);b=b||{};var d=this.f.DJ(c,a,{ml:e,mapType:b.mapType||this.KC,zoomLevel:b.zoomLevel||this.LC}),f=new Vl(i,c);this.JD(a,[f],b);Uf(c);U(d,Ga,this,function(){this.LC=d.F()});
+U(d,Ca,this,function(){this.KC=d.o});
+return d};
+l.sU=function(){return this.Ze&&this.Ze.suppressMapPan};
+var un=new jm;un.infoWindowAnchor=new S(0,0);un.iconAnchor=new S(0,0);jk.prototype.qu=function(a,b,c,d,f){for(var g=a.modules||[],h=[],k=0,o=r(g);k<o;k++)g[k]&&h.push(this.So.AM(g[k]));var q=be("loadMarkerModules");this.So.fM(h,n(function(){q.sc()&&this.SQ(a,b,c,d,f)},
+this),f)};
+jk.prototype.SQ=function(a,b,c,d,f){if(c)d=c;else{b=b||new z(a.latlng.lat,a.latlng.lng);c={};c.icon=un;c.id=a.id;if(d)c.pixelOffset=d;d=new ik(b,c)}d.zv(a);this.f.da();b={marker:d,features:{}};A(this,"iwopenfrommarkerjsonapphook",b);A(this,"markerload",a,d.UD);d.AJ(a,b.features);d.f=this.f;d.infoWindow(j,f)};function vn(){this.yt=new sm("iw");this.Ml=Math.random()<Ec}
+vn.prototype.hQ=function(a,b){if(this.Ml){var c=b.B;b=b.Zc[b.Ed].contentElem.innerHTML;a=a.F();c=[c.lat(),c.lng(),encodeURIComponent(b),a].join(",");c.length<2048*Fc&&this.yt.log(c)}};
+v(Pc,Ba,function(a){var b=new vn;v(a,Ka,function(){b.hQ(a,a.Ej())})});jk.prototype.Cr=function(){this.Rj=e};
+jk.prototype.lr=function(){this.da();this.Rj=j};
+jk.prototype.Vs=function(){return this.Rj};function wn(){this.reset()}
+l=wn.prototype;l.reset=function(){this.ca={}};
+l.get=function(a){return this.ca[this.toCanonical(a)]};
+l.isCachable=function(a){return!!(a&&a.name)};
+l.put=function(a,b){if(a&&this.isCachable(b))this.ca[this.toCanonical(a)]=b};
+l.toCanonical=function(a){return a.Aa?a.Aa():a.replace(/,/g," ").replace(/\s\s*/g," ").toLowerCase()};
+function xn(){this.reset()}
+p(xn,wn);xn.prototype.isCachable=function(a){if(!wn.prototype.isCachable.call(this,a))return j;var b=500;if(a[ug]&&a[ug][vg])b=a[ug][vg];return b==200||b>=600&&b!=620};function yn(){yn.g.apply(this,arguments)}
+yn.g=function(a){this.ca=a||new xn};
+l=yn.prototype;l.ga=N;l.$m=N;l.Wr=N;l.reset=N;l.gA=function(){return this.ca};
+l.eF=function(a){this.ca=a};
+l.Pv=function(a){this.hc=a};
+l.eB=function(){return this.hc};
+l.cF=function(a){this.$g=a};
+l.eA=function(){return this.$g};
+Ih(yn,"api_gc",1);function zn(){zn.g.apply(this,arguments)}
+;zn.g=N;zn.prototype.enable=N;zn.prototype.disable=N;Ih(zn,"adsense",1);function An(){An.g.apply(this,arguments)}
+p(An,oi);function Bn(){Bn.g.apply(this,arguments)}
+p(Bn,oi);An.g=N;l=An.prototype;l.ya=Oe;l.$A=Pe;l.nn=Ne;l.DC=Ne;l.Um=function(){return i};
+l.Vm=function(){return i};
+l.bs=Pe;l.Ea=function(){return"GeoXml"};
+l.ys=N;l.getKml=N;zj(An,"kml_api",2);Bn.g=N;Bn.prototype.getKml=N;zj(Bn,"kml_api",1);function Cn(){Cn.g.apply(this,arguments)}
+Cn.g=N;p(Cn,oi);Cn.prototype.getKml=N;zj(Cn,"kml_api",4);var Dn={co:{ck:1,cr:1,hu:1,id:1,il:1,"in":1,je:1,jp:1,ke:1,kr:1,ls:1,nz:1,th:1,ug:1,uk:1,ve:1,vi:1,za:1},com:{ag:1,ar:1,au:1,bo:1,br:1,bz:1,co:1,cu:1,"do":1,ec:1,fj:1,gi:1,gr:1,gt:1,hk:1,jm:1,ly:1,mt:1,mx:1,my:1,na:1,nf:1,ni:1,np:1,pa:1,pe:1,ph:1,pk:1,pr:1,py:1,sa:1,sg:1,sv:1,tr:1,tw:1,ua:1,uy:1,vc:1,vn:1},off:{ai:1}};function En(a){return Fn(window.location,a)}
+function Fn(a,b){var c;c=a.host.toLowerCase().split(".");if(r(c)<2)c=j;else{var d=c.pop(),f=c.pop();if((f=="igoogle"||f=="gmodules"||f=="googlepages"||f=="googleusercontent"||f=="orkut"||f=="googlegroups")&&d=="com")c=e;else{if(r(d)==2&&r(c)>0)if(Dn[f]&&Dn[f][d]==1)f=c.pop();c=f=="google"}}if(c)return e;if(a.protocol=="file:")return e;if(a.hostname=="localhost")return e;d=a.protocol;var g=a.host;f=a.pathname;a=[];if(f){if(f.indexOf("/")!=0)f="/"+f}else f="/";if(g.charAt(g.length-1)==".")g=g.substr(0,
+g.length-1);c=[d];d=="https:"&&c.unshift("http:");g=g.toLowerCase();d=[g];g=g.split(".");g[0]!="www"&&d.push("www."+g.join("."));g.shift();for(var h=r(g);h>1;){if(h!=2||g[0]!="co"&&g[0]!="off"){d.push(g.join("."));g.shift()}h--}f=f.split("/");for(g=[];r(f)>1;){f.pop();g.push(f.join("/")+"/")}for(f=0;f<r(c);++f)for(h=0;h<r(d);++h)for(var k=0;k<r(g);++k){a.push(c[f]+"//"+d[h]+g[k]);var o=d[h].indexOf(":");o!=-1&&a.push(c[f]+"//"+d[h].substr(0,o)+g[k])}for(c=0;c<r(a);++c){d=pm(a[c]);if(b==d)return e}return j}
+window.GValidateKey=En;l=Pc.prototype;l.wz=function(){this.oF(e)};
+l.$J=function(){this.oF(j)};
+l.$p=function(a){a=this.xs?new nn(a,this.gB):new Zj(a);this.$a(a);this.ek=a};
+l.YR=function(){if(this.ek){this.ge(this.ek);this.ek.clear();delete this.ek}};
+l.oF=function(a){this.xs=a;this.YR();this.$p(this.ZO)};
+l.Cr=function(){this.Ub().Cr()};
+l.lr=function(){this.Ub().lr()};
+l.Vs=function(){return this.Ub().Vs()};
+l.mA=function(){return new Bj(this.O())};
+l.XO=function(a){a=a?"maps_api_set_default_ui":"maps_api_set_ui";var b=new Ki;b.set("imp",a);this.Ha.send(b.Gd)};
+l.WF=function(){var a=this.VF(this.mA(),e);if(this.cv){w(this.cv);delete this.cv}this.cv=v(this,Ea,n(function(){t(a,n(function(b){this.ge(b)},
+this));this.WF()},
+this))};
+l.VF=function(a,b){this.XO(!!b);t([["NORMAL_MAP","normal"],["SATELLITE_MAP","satellite"],["HYBRID_MAP","hybrid"],["PHYSICAL_MAP","physical"]],n(function(d){var f=zc[d[0]];if(f)a.maptypes[d[1]]?this.Pl(f):this.CE(f)},
+this));a.zoom.scrollwheel?this.Bz():this.Wy();a.zoom.doubleclick?this.uz():this.jr();a.keyboard&&new mi(this);b=[];if(a.controls.largemapcontrol3d){var c=new en;b.push(c);this.$a(c)}else if(a.controls.smallzoomcontrol3d){c=new hn;b.push(c);this.$a(c)}if(a.controls.maptypecontrol){c=new Ym;b.push(c);this.$a(c)}else if(a.controls.menumaptypecontrol){c=new Zm;b.push(c);this.$a(c)}else if(a.controls.hierarchicalmaptypecontrol){c=new gk;b.push(c);this.$a(c)}if(a.controls.scalecontrol){c=new bn;b.push(c);
+this.gB||this.xs?this.$a(c,new Yj(2,new R(92,5))):this.$a(c)}a.controls.overviewmapcontrol&&pn(this).show();if(a.controls.googlebar){this.wz();b.push(this.ek)}return b};function Gn(){var a=[];a=a.concat(Hn());a=a.concat(In());return a=a.concat(Jn())}
+function Hn(){var a=[{symbol:Kn,name:"visible",url:"http://mw1.google.com/mw-planetary/lunar/lunarmaps_v1/clem_bw/",zoom_levels:9},{symbol:Ln,name:"elevation",url:"http://mw1.google.com/mw-planetary/lunar/lunarmaps_v1/terrain/",zoom_levels:7}],b=[],c=new pd(30),d=new md;d.Oi(new Qd("1",new id(new z(-180,-90),new z(180,90)),0,"NASA/USGS"));for(var f=[],g=0;g<a.length;g++){var h=a[g],k=new Mn(h.url,d,h.zoom_levels);k=new Hd([k],c,h.name,{radius:1738000,shortName:h.name,alt:"Show "+h.name+" map"});f.push(k);
+b.push([h.symbol,f[g]])}b.push([Nn,f]);return b}
+function Mn(a,b,c){Cj.call(this,b,0,c);this.Ui=a}
+p(Mn,Cj);Mn.prototype.getTileUrl=function(a,b){var c=Math.pow(2,b);return this.Ui+b+"/"+a.x+"/"+(c-a.y-1)+".jpg"};
+function In(){for(var a=[{symbol:On,name:"elevation",url:"http://mw1.google.com/mw-planetary/mars/elevation/",zoom_levels:8,credits:"NASA/JPL/GSFC"},{symbol:Pn,name:"visible",url:"http://mw1.google.com/mw-planetary/mars/visible/",zoom_levels:9,credits:"NASA/JPL/ASU/MSSS"},{symbol:Qn,name:"infrared",url:"http://mw1.google.com/mw-planetary/mars/infrared/",zoom_levels:12,credits:"NASA/JPL/ASU"}],b=[],c=new pd(30),d=[],f=0;f<a.length;f++){var g=a[f],h=new md;h.Oi(new Qd("2",new id(new z(-180,-90),new z(180,
+90)),0,g.credits));h=new Rn(g.url,h,g.zoom_levels);h=new Hd([h],c,g.name,{radius:3396200,shortName:g.name,alt:"Show "+g.name+" map"});d.push(h);b.push([g.symbol,d[f]])}b.push([Sn,d]);return b}
+function Rn(a,b,c){Cj.call(this,b,0,c);this.Ui=a}
+p(Rn,Cj);Rn.prototype.getTileUrl=function(a,b){var c=Math.pow(2,b),d=a.x;a=a.y;for(var f=["t"],g=0;g<b;g++){c/=2;if(a<c)if(d<c)f.push("q");else{f.push("r");d-=c}else{if(d<c)f.push("t");else{f.push("s");d-=c}a-=c}}return this.Ui+f.join("")+".jpg"};
+function Jn(){var a=[{symbol:Tn,name:"visible",url:"http://mw1.google.com/mw-planetary/sky/skytiles_v1/",zoom_levels:19}],b=[],c=new pd(30),d=new md;d.Oi(new Qd("1",new id(new z(-180,-90),new z(180,90)),0,"SDSS, DSS Consortium, NASA/ESA/STScI"));for(var f=[],g=0;g<a.length;g++){var h=a[g],k=new Un(h.url,d,h.zoom_levels);k=new Hd([k],c,h.name,{radius:57.2957763671875,shortName:h.name,alt:"Show "+h.name+" map"});f.push(k);b.push([h.symbol,f[g]])}b.push([Vn,f]);return b}
+function Un(a,b,c){Cj.call(this,b,0,c);this.Ui=a}
+p(Un,Cj);Un.prototype.getTileUrl=function(a,b){return this.Ui+a.x+"_"+a.y+"_"+b+".jpg"};function Wn(){Wn.g.apply(this,arguments)}
+Kh(Wn,"log",1,{write:j,oH:j,pH:j,KA:j},{g:e});function Xn(){Xn.g.apply(this,arguments)}
+Xn.g=N;Xn.prototype.Ww=N;Xn.prototype.aq=N;Xn.prototype.refresh=N;Xn.prototype.GA=function(){return 0};
+Ih(Xn,"mkrmr",1);function Yn(){Yn.g.apply(this,arguments)}
+Kh(Yn,"apidir",1,{load:j,zC:j,clear:j,We:j,H:j,qd:j,ab:j,bn:j,Xm:j,Sm:j,hn:j,lb:j,od:j,getPolyline:j,FA:j},{g:j,nA:j});function Zn(){Zn.g.apply(this,arguments)}
+Kh(Zn,"apidir",2,{clear:j,HE:j,Mo:j},{g:j});function $n(){$n.g.apply(this,arguments)}
+$n.g=N;p($n,oi);$n.prototype.Zd=Ne;zj($n,"tfcapi",1);function hk(){hk.g.apply(this,arguments)}
+hk.g=N;hk.addInitializer=function(){};
+l=hk.prototype;l.setParameter=function(){};
+l.OF=function(){};
+l.refresh=function(){};
+l.Tb=Pe;l.yv=N;l.Bk=function(){};
+l.og=function(){};
+l.getKml=N;zj(hk,"lyrs",1);hk.prototype.Ch=Ne;hk.prototype.I=yj.I;hk.prototype.Ea=function(){return"Layer"};function ao(a,b){this.zN=a;this.$=b||i}
+ao.prototype.gC=function(a){return!!a.id.match(this.zN)};
+ao.prototype.XD=function(a){this.$&&a.ux(this.$);a.yv()};function bo(){bo.g.apply(this,arguments)}
+p(bo,qi);bo.g=Jh(N);l=bo.prototype;l.f=i;l.initialize=Jh(function(a){this.f=a;this.fg={}});
+l.ba=N;l.ka=N;l.Ym=N;Ih(bo,"lyrs",2);bo.prototype.Td=function(a,b){var c=this.fg[a];c||(c=this.fg[a]=new hk(a,b,this));return c};v(Pc,Ba,function(a){var b=new bo(window._mLayersTileBaseUrls,window._mLayersFeaturesBaseUrl);a.AE(["Layer"],b)});var co;function X(a){return co+=a||1}
+co=0;
+var eo=X(),fo=X(),go=X(),ho=X(),io=X(),jo=X(),ko=X(),lo=X(),mo=X(),no=X(),oo=X(),po=X(),qo=X(),ro=X(),so=X(),to=X(),uo=X(),vo=X(),wo=X(),xo=X(),yo=X(),zo=X(),Ao=X(),Bo=X(),Co=X(),Do=X(),Eo=X(),Fo=X(),Go=X(),Ho=X(),Io=X(),Jo=X(),Ko=X(),Lo=X(),Mo=X(),No=X(),Oo=X(),Po=X(),Qo=X(),Ro=X(),So=X(),To=X(),Uo=X(),Vo=X(),Wo=X(),Xo=X(),Yo=X(),Zo=X(),$o=X(),ap=X(),bp=X(),cp=X(),dp=X(),ep=X(),fp=X(),gp=X(),hp=X(),ip=X(),jp=X(),kp=X(),lp=X(),mp=X(),np=X(),op=X(),pp=X(),qp=X(),rp=X(),sp=X(),tp=X(),up=X(),vp=X(),
+wp=X(),xp=X();co=0;var yp=X(),zp=X(),Ap=X(),Bp=X(),Cp=X(),Dp=X(),Ep=X(),Fp=X(),Gp=X(),Hp=X(),Ip=X(),Jp=X(),Kp=X(),Lp=X(),Mp=X(),Np=X(),Op=X(),Pp=X(),Qp=X(),Rp=X(),Sp=X(),Tp=X(),Up=X(),Vp=X(),Wp=X(),Xp=X(),Yp=X(),Zp=X(),$p=X(),aq=X(),bq=X(),cq=X(),dq=X(),eq=X(),fq=X(),gq=X(),hq=X(),iq=X(),jq=X(),kq=X(),lq=X(),mq=X(),nq=X(),Nn=X(),Kn=X(),Ln=X(),Sn=X(),On=X(),Pn=X(),Qn=X(),Vn=X(),Tn=X(),oq=X(),pq=X(),qq=X(),rq=X(),sq=X();co=0;
+var tq=X(),uq=X(),vq=X(),wq=X(),xq=X(),yq=X(),zq=X(),Aq=X(),Bq=X(),Cq=X(),Dq=X(),Eq=X(),Fq=X(),Gq=X(),Hq=X(),Iq=X(),Jq=X(),Kq=X(),Lq=X(),Mq=X(),Nq=X(),Oq=X(),Pq=X(),Qq=X(),Rq=X(),Sq=X(),Tq=X(),Uq=X(),Vq=X(),Wq=X(),Xq=X(),Yq=X(),Zq=X(),$q=X(),ar=X(),br=X(),cr=X(),dr=X(),er=X(),fr=X(),gr=X(),hr=X(),ir=X(),jr=X(),kr=X(),lr=X(),mr=X(),nr=X(),or=X(),pr=X(),qr=X(),rr=X(),sr=X(),tr=X(),ur=X(),vr=X(),wr=X(),xr=X(),yr=X(),zr=X(),Ar=X();co=100;
+var Br=X(),Cr=X(),Dr=X(),Er=X(),Fr=X(),Gr=X(),Hr=X(),Ir=X(),Jr=X(),Kr=X(),Lr=X(),Mr=X(),Nr=X(),Or=X(),Pr=X(),Qr=X();co=200;var Rr=X(),Sr=X(),Tr=X(),Ur=X(),Vr=X(),Wr=X(),Xr=X(),Yr=X(),Zr=X(),$r=X(),as=X(),bs=X(),cs=X(),ds=X(),es=X(),fs=X(),gs=X();co=300;var hs=X(),is=X(),js=X(),ks=X(),ls=X(),ms=X(),ns=X(),os=X(),ps=X(),qs=X(),rs=X(),ss=X(),ts=X(),us=X(),vs=X(),ws=X(),xs=X(),ys=X(),zs=X(),As=X(),Bs=X(),Cs=X(),Ds=X(),Es=X(),Fs=X(),Gs=X();co=400;
+var Hs=X(),Is=X(),Js=X(),Ks=X(),Ls=X(),Ms=X(),Ns=X(),Os=X(),Ps=X(),Qs=X(),Rs=X(),Ss=X(),Ts=X(),Us=X(),Vs=X(),Ws=X(),Xs=X(),Ys=X(),Zs=X(),$s=X(),at=X(),bt=X(),ct=X(),dt=X(),et=X(),ft=X(),gt=X(),ht=X(),it=X(),jt=X(),kt=X(),lt=X(),mt=X(),nt=X(),ot=X(),pt=X(),qt=X(),rt=X(),st=X(),tt=X(),ut=X(),vt=X(),wt=X(),zt=X(),At=X(),Bt=X(),Ct=X(),Dt=X();co=500;var Et=X(),Ft=X(),Gt=X(),Ht=X(),It=X(),Jt=X(),Kt=X(),Lt=X(),Mt=X(),Nt=X(),Ot=X(),Pt=X(),Qt=X(),Rt=X();co=600;
+var St=X(),Tt=X(),Ut=X(),Vt=X(),Wt=X(),Xt=X(),Yt=X(),Zt=X(),$t=X(),au=X(),bu=X(),cu=X(),du=X(),eu=X(),fu=X(),gu=X(),hu=X();co=700;var iu=X(),ju=X(),ku=X(),lu=X(),mu=X(),nu=X(),ou=X(),pu=X(),qu=X(),ru=X(),su=X(),tu=X(),uu=X(),vu=X(),wu=X(),xu=X(),yu=X(),zu=X(),Au=X(),Bu=X(),Cu=X(),Du=X(),Eu=X();co=800;var Fu=X(),Gu=X(),Hu=X(),Iu=X(),Ju=X(),Ku=X(),Lu=X(),Mu=X(),Nu=X(),Ou=X(),Pu=X(),Qu=X(),Ru=X(),Su=X();co=900;
+var Tu=X(),Uu=X(),Vu=X(),Wu=X(),Xu=X(),Yu=X(),Zu=X(),$u=X(),av=X(),bv=X(),cv=X(),dv=X(),ev=X(),fv=X(),gv=X(),hv=X(),iv=X(),jv=X(),kv=X(),lv=X(),mv=X(),nv=X(),ov=X(),pv=X(),qv=X(),rv=X();co=1000;var sv=X(),tv=X(),uv=X(),vv=X(),wv=X(),xv=X(),yv=X(),zv=X(),Av=X(),Bv=X(),Cv=X(),Dv=X(),Ev=X(),Fv=X(),Gv=X(),Hv=X(),Iv=X(),Jv=X(),Kv=X(),Lv=X(),Mv=X(),Nv=X(),Ov=X(),Pv=X(),Qv=X(),Rv=X();co=1100;
+var Sv=X(),Tv=X(),Uv=X(),Vv=X(),Wv=X(),Xv=X(),Yv=X(),Zv=X(),$v=X(),aw=X(),bw=X(),cw=X(),dw=X(),ew=X(),fw=X(),gw=X(),hw=X(),iw=X(),jw=X(),kw=X(),lw=X(),mw=X();co=1200;var nw=X(),ow=X(),pw=X(),qw=X(),rw=X(),sw=X(),tw=X(),uw=X(),vw=X(),ww=X(),xw=X(),yw=X(),zw=X(),Aw=X(),Bw=X(),Cw=X(),Dw=X(),Ew=X(),Fw=X();X();X();X();X();var Gw=X();co=1300;
+var Hw=X(),Iw=X(),Jw=X(),Kw=X(),Lw=X(),Mw=X(),Nw=X(),Ow=X(),Pw=X(),Qw=X(),Rw=X(),Sw=X(),Tw=X(),Uw=X(),Vw=X(),Ww=X(),Xw=X(),Yw=X(),Zw=X(),$w=X(),ax=X(),bx=X(),cx=X(),dx=X(),ex=X(),fx=X(),gx=X(),hx=X(),ix=X(),jx=X(),kx=X(),lx=X(),mx=X(),nx=X(),ox=X(),px=X(),qx=X(),rx=X(),sx=X(),tx=X(),ux=X(),vx=X(),wx=X(),xx=X(),yx=X(),zx=X(),Ax=X(),Bx=X(),Cx=X(),Dx=X(),Ex=X(),Fx=X(),Gx=X(),Hx=X(),Ix=X(),Jx=X(),Kx=X(),Lx=X(),Mx=X(),Nx=X(),Ox=X(),Px=X(),Qx=X(),Rx=X(),Sx=X(),Tx=X(),Ux=X(),Vx=X(),Wx=X(),Xx=X(),Yx=X(),
+Zx=X(),$x=X(),ay=X(),by=X(),cy=X(),dy=X(),ey=X(),fy=X(),gy=X(),hy=X(),iy=X(),jy=X(),ky=X(),ly=X();co=1400;var my=X(),ny=X(),oy=X(),py=X();X();var qy=X(),uy=X();X();var vy=X(),wy=X();co=1500;var xy=X(),yy=X(),zy=X(),Ay=X(),By=X(),Cy=X(),Dy=X(),Ey=X(),Fy=X(),Gy=X(),Hy=X(),Iy=X(),Jy=X(),Ky=X(),Ly=X(),My=X(),Ny=X(),Oy=X(),Py=X(),Qy=X(),Ry=X(),Sy=X(),Ty=X(),Uy=X();co=0;X(2);X(2);X(2);X(2);X(2);var Vy=[[Oo,cr,[tq,uq,vq,wq,xq,Br,yq,zq,Aq,Bq,Cr,Cq,Dq,Eq,Fq,Gq,Hq,Iq,Dr,Jq,Kq,Lq,Mq,Nq,Lq,Oq,Pq,Qq,Rq,Sq,Tq,Uq,Vq,Er,Wq,Xq,Yq,Zq,$q,ar,Fr,br,Gr,Hr,Ir,Jr,dr,er,fr,gr,hr,ir,jr,kr,lr,mr,nr,or,pr,qr,rr,sr,tr,Kr,Lr,Mr,ur,vr,Nr,Or,wr,xr,yr,zr,Ar,wy]],[Fo,Pr],[Eo,Qr],[Do,i,[Rr,Sr,Tr,Ur,Vr,Wr,Xr,Yr,Zr,$r,bs,cs,ds,es,as]],[Yo,fs,[],[gs]],[So,xs,[hs,is,js,ks,ls,ms,ns,os,ps,qs,rs,ss,ts,us,vs,ws,ys,zs,As,Bs,Cs,Ds,Es,Fs,Gs]],[bp,Hs,[Is,Js,Ks,Ls,Os,Ps,Ns,Ms,Qs,Rs,Ss,Ts,Us,Vs],[Ws]],[ap,Xs,[Ys,Zs,$s,at,bt,ct,dt,
+et,ft,gt,ht,it,jt,kt,lt],[mt]],[zo,nt,[ot,pt,qt,rt,st]],[hp,tt,[ut,vt,wt,zt,At]],[ip,Bt,[]],[jp,Ct,[]],[Co,Dt],[to,i,[],[Ht,Et,Ft,Gt,Kt,It,Jt,Lt,Mt,Nt,Ot,Pt,Qt]],[wp,i,[],[Rt]],[$o,St,[Tt,Ut],[Vt]],[kp,Wt,[Xt,Yt],[Zt]],[go,$t,[au,cu,bu,du,eu,fu,gu,hu]],[Jo,iu,[ju,ku,mu,nu,ou,pu,qu],[lu]],[Ko,ru,[su,tu,uu,vu,wu,xu,yu,zu,Au,Bu,Cu,Du,Eu]],[ko,Fu,[Iu,Gu,Hu,Ju,Ku,Lu,Mu,Nu,Ou,Pu,Qu]],[yo,Ru],[vo,Su],[no,Tu],[oo,Uu,[Vu,Wu,Xu]],[qp,Yu],[rp,Zu,[$u,av,bv,cv,dv,ev]],[xo,fv,[gv,hv,iv,jv,kv,lv,mv,nv,ov,pv,qv,
+rv]],[Po,sv,[tv,uv,vv]],[dp,wv,[xv,yv,zv,Av,Bv]],[so,Cv,[Dv,Ev,Jv,Kv],[Fv,Gv,Hv,Iv]],[To,Lv,[Mv,Nv,Ov,Pv]],[mo,Sv],[lo,Tv],[gp,Uv],[Ho,Vv],[Io,Wv],[lp,Xv],[mp,Yv],[np,Zv],[Qo,$v],[Uo,aw],[Ao,bw,[cw,dw,ew]],[Zo,fw,[gw,hw,iw,jw]],[Wo,kw,[lw]],[Ro,mw],[cp,nw],[Vo,ow],[Xo,pw],[Mo,i,[],[qw,rw,sw,tw]],[vp,i,[],[uw,vw]],[xp,ww,[xw],[yw]],[Lo,zw,[Aw,Bw,Cw,Dw,Ew]],[sp,Fw,[]],[fo,i,[],[Gw]],[po,Hw,[Iw,Jw,Kw,Lw,Mw,Nw,Ow,Pw,Qw,Rw,Sw,Tw,Uw,Vw,Ww],[Xw]],[ro,Yw,[Zw,$w,ax]],[eo,jy,[ky,ly]],[uo,qy,[uy]],[wo,i,[vy]],
+[Bo,i,[my,ny,oy,py]],[ho,xy,[yy,zy,Ay]],[io,By],[jo,Cy,[Dy,Ey,Fy,Gy,Hy,Iy,Jy,Ky,Ly,My,Ny,Oy,Py,Qy,Ry,Sy,Ty,Uy]],[Go,i,[],[Qv,Rv]]];var Wy=[[eo,"AdsManager"],[go,"Bounds"],[fo,"Bandwidth"],[ho,"StreetviewClient"],[io,"StreetviewOverlay"],[jo,"StreetviewPanorama"],[ko,"ClientGeocoder"],[lo,"Control"],[mo,"ControlPosition"],[no,"Copyright"],[oo,"CopyrightCollection"],[po,"Directions"],[ro,"DirectionsRenderer"],[so,"DraggableObject"],[to,"Event"],[uo,i],[vo,"FactualGeocodeCache"],[xo,"GeoXml"],[yo,"GeocodeCache"],[wo,i],[zo,"GroundOverlay"],[Bo,"_IDC"],[Co,"Icon"],[Do,i],[Do,i],[Eo,"InfoWindowTab"],[Fo,"KeyboardHandler"],[Ho,"LargeMapControl"],
+[Io,"LargeMapControl3D"],[Jo,"LatLng"],[Ko,"LatLngBounds"],[Lo,"Layer"],[Mo,"Log"],[No,"Map"],[Oo,"Map2"],[Po,"MapType"],[Qo,"MapTypeControl"],[Ro,"MapUIOptions"],[So,"Marker"],[To,"MarkerManager"],[Uo,"MenuMapTypeControl"],[Ao,"HierarchicalMapTypeControl"],[Vo,"MercatorProjection"],[Xo,"ObliqueMercator"],[Yo,"Overlay"],[Zo,"OverviewMapControl"],[$o,"Point"],[ap,"Polygon"],[bp,"Polyline"],[cp,"Projection"],[dp,"RotatableMapTypeCollection"],[gp,"ScaleControl"],[hp,"ScreenOverlay"],[ip,"ScreenPoint"],
+[jp,"ScreenSize"],[kp,"Size"],[lp,"SmallMapControl"],[mp,"SmallZoomControl"],[np,"SmallZoomControl3D"],[qp,"TileLayer"],[rp,"TileLayerOverlay"],[sp,"TrafficOverlay"],[vp,"Xml"],[wp,"XmlHttp"],[xp,"Xslt"],[Wo,"NavLabelControl"],[Go,"Language"]],Xy=[[tq,"addControl"],[uq,"addMapType"],[vq,"addOverlay"],[wq,"checkResize"],[xq,"clearOverlays"],[Br,"closeInfoWindow"],[yq,"continuousZoomEnabled"],[zq,"disableContinuousZoom"],[Aq,"disableDoubleClickZoom"],[Bq,"disableDragging"],[Cr,"disableInfoWindow"],
+[Cq,"disablePinchToZoom"],[Dq,"disableScrollWheelZoom"],[Eq,"doubleClickZoomEnabled"],[Fq,"draggingEnabled"],[Gq,"enableContinuousZoom"],[Hq,"enableDoubleClickZoom"],[Iq,"enableDragging"],[Dr,"enableInfoWindow"],[Jq,"enablePinchToZoom"],[Kq,"enableScrollWheelZoom"],[Lq,"fromContainerPixelToLatLng"],[Mq,"fromLatLngToContainerPixel"],[Nq,"fromDivPixelToLatLng"],[Oq,"fromLatLngToDivPixel"],[Pq,"getBounds"],[Qq,"getBoundsZoomLevel"],[Rq,"getCenter"],[Sq,"getContainer"],[Tq,"getCurrentMapType"],[Uq,"getDefaultUI"],
+[Vq,"getDragObject"],[Er,"getInfoWindow"],[Wq,"getMapTypes"],[Xq,"getPane"],[Yq,"getSize"],[$q,"getZoom"],[ar,"hideControls"],[Fr,"infoWindowEnabled"],[br,"isLoaded"],[Gr,"openInfoWindow"],[Hr,"openInfoWindowHtml"],[Ir,"openInfoWindowTabs"],[Jr,"openInfoWindowTabsHtml"],[dr,"panBy"],[er,"panDirection"],[fr,"panTo"],[gr,"pinchToZoomEnabled"],[hr,"removeControl"],[ir,"removeMapType"],[jr,"removeOverlay"],[kr,"returnToSavedPosition"],[lr,"savePosition"],[mr,"scrollWheelZoomEnabled"],[nr,"setCenter"],
+[or,"setFocus"],[pr,"setMapType"],[qr,"setUI"],[rr,"setUIToDefault"],[sr,"setZoom"],[tr,"showControls"],[Kr,"showMapBlowup"],[Lr,"updateCurrentTab"],[Mr,"updateInfoWindow"],[ur,"zoomIn"],[vr,"zoomOut"],[Nr,"enableGoogleBar"],[Or,"disableGoogleBar"],[wr,"changeHeading"],[xr,"disableRotation"],[yr,"enableRotation"],[zr,"isRotatable"],[Ar,"rotationEnabled"],[Rr,"disableMaximize"],[Sr,"enableMaximize"],[Tr,"getContentContainers"],[Ur,"getPixelOffset"],[Vr,"getPoint"],[Wr,"getSelectedTab"],[Xr,"getTabs"],
+[Yr,"hide"],[Zr,"isHidden"],[$r,"maximize"],[bs,"reset"],[cs,"restore"],[ds,"selectTab"],[es,"show"],[as,"supportsHide"],[gs,"getZIndex"],[hs,"bindInfoWindow"],[is,"bindInfoWindowHtml"],[js,"bindInfoWindowTabs"],[ks,"bindInfoWindowTabsHtml"],[ls,"closeInfoWindow"],[ms,"disableDragging"],[ns,"draggable"],[os,"dragging"],[ps,"draggingEnabled"],[qs,"enableDragging"],[rs,"getIcon"],[ss,"getPoint"],[ts,"getLatLng"],[us,"getTitle"],[vs,"hide"],[ws,"isHidden"],[ys,"openInfoWindow"],[zs,"openInfoWindowHtml"],
+[As,"openInfoWindowTabs"],[Bs,"openInfoWindowTabsHtml"],[Cs,"setImage"],[Ds,"setPoint"],[Es,"setLatLng"],[Fs,"show"],[Gs,"showMapBlowup"],[Is,"deleteVertex"],[Ks,"enableDrawing"],[Js,"disableEditing"],[Ls,"enableEditing"],[Ms,"getBounds"],[Ns,"getLength"],[Os,"getVertex"],[Ps,"getVertexCount"],[Qs,"hide"],[Rs,"insertVertex"],[Ss,"isHidden"],[Ts,"setStrokeStyle"],[Us,"show"],[Ws,"fromEncoded"],[Vs,"supportsHide"],[Ys,"deleteVertex"],[Zs,"disableEditing"],[$s,"enableDrawing"],[at,"enableEditing"],[bt,
+"getArea"],[ct,"getBounds"],[dt,"getVertex"],[et,"getVertexCount"],[ft,"hide"],[gt,"insertVertex"],[ht,"isHidden"],[it,"setFillStyle"],[jt,"setStrokeStyle"],[kt,"show"],[mt,"fromEncoded"],[lt,"supportsHide"],[Aw,"show"],[Bw,"hide"],[Cw,"isHidden"],[Dw,"isEnabled"],[Ew,"setParameter"],[Ht,"cancelEvent"],[Et,"addListener"],[Ft,"addDomListener"],[Gt,"removeListener"],[Kt,"clearAllListeners"],[It,"clearListeners"],[Jt,"clearInstanceListeners"],[Lt,"clearNode"],[Mt,"trigger"],[Nt,"bind"],[Ot,"bindDom"],
+[Pt,"callback"],[Qt,"callbackArgs"],[Rt,"create"],[Tt,"equals"],[Ut,"toString"],[Vt,"ORIGIN"],[Xt,"equals"],[Yt,"toString"],[Zt,"ZERO"],[au,"toString"],[cu,"equals"],[bu,"mid"],[du,"min"],[eu,"max"],[fu,"containsBounds"],[gu,"containsPoint"],[hu,"extend"],[ju,"equals"],[ku,"toUrlValue"],[lu,"fromUrlValue"],[mu,"lat"],[nu,"lng"],[ou,"latRadians"],[pu,"lngRadians"],[qu,"distanceFrom"],[su,"equals"],[tu,"contains"],[uu,"containsLatLng"],[vu,"intersects"],[wu,"containsBounds"],[xu,"extend"],[yu,"getSouthWest"],
+[zu,"getNorthEast"],[Au,"toSpan"],[Bu,"isFullLat"],[Cu,"isFullLng"],[Du,"isEmpty"],[Eu,"getCenter"],[Gu,"getLocations"],[Hu,"getLatLng"],[Iu,"getAddress"],[Ju,"getCache"],[Ku,"setCache"],[Lu,"reset"],[Mu,"setViewport"],[Nu,"getViewport"],[Ou,"setBaseCountryCode"],[Pu,"getBaseCountryCode"],[Qu,"getAddressInBounds"],[Vu,"addCopyright"],[Wu,"getCopyrights"],[Xu,"getCopyrightNotice"],[$u,"getTileLayer"],[av,"hide"],[bv,"isHidden"],[cv,"refresh"],[dv,"show"],[ev,"supportsHide"],[gv,"getDefaultBounds"],
+[hv,"getDefaultCenter"],[iv,"getDefaultSpan"],[jv,"getKml"],[kv,"getTileLayerOverlay"],[lv,"gotoDefaultViewport"],[mv,"hasLoaded"],[nv,"hide"],[ov,"isHidden"],[pv,"loadedCorrectly"],[qv,"show"],[rv,"supportsHide"],[ot,"getKml"],[pt,"hide"],[qt,"isHidden"],[rt,"show"],[st,"supportsHide"],[ut,"getKml"],[vt,"hide"],[wt,"isHidden"],[zt,"show"],[At,"supportsHide"],[tv,"getName"],[uv,"getBoundsZoomLevel"],[vv,"getSpanZoomLevel"],[xv,"getDefault"],[yv,"getMapTypeArray"],[zv,"getRotatedMapType"],[Av,"isImageryVisible"],
+[Bv,"setMinZoomLevel"],[Dv,"setDraggableCursor"],[Ev,"setDraggingCursor"],[Fv,"getDraggableCursor"],[Gv,"getDraggingCursor"],[Hv,"setDraggableCursor"],[Iv,"setDraggingCursor"],[Jv,"moveTo"],[Kv,"moveBy"],[cw,"addRelationship"],[dw,"removeRelationship"],[ew,"clearRelationships"],[Mv,"addMarkers"],[Nv,"addMarker"],[Ov,"getMarkerCount"],[Pv,"refresh"],[gw,"getOverviewMap"],[hw,"show"],[iw,"hide"],[jw,"setMapType"],[lw,"setMinAddressLinkLevel"],[qw,"write"],[rw,"writeUrl"],[sw,"writeHtml"],[tw,"getMessages"],
+[uw,"parse"],[vw,"value"],[xw,"transformToHtml"],[yw,"create"],[Gw,"forceLowBandwidthMode"],[Iw,"load"],[Jw,"loadFromWaypoints"],[Kw,"clear"],[Lw,"getStatus"],[Mw,"getBounds"],[Nw,"getNumRoutes"],[Ow,"getRoute"],[Pw,"getNumGeocodes"],[Qw,"getGeocode"],[Rw,"getCopyrightsHtml"],[Sw,"getSummaryHtml"],[Tw,"getDistance"],[Uw,"getDuration"],[Vw,"getPolyline"],[Ww,"getMarker"],[Xw,"getDirections"],[Zw,"clear"],[$w,"renderResult"],[ax,"renderTrip"],[ky,"enable"],[ly,"disable"],[uy,"destroy"],[vy,"setMessage"],
+[wy,"__internal_testHookRespond"],[my,"call_"],[ny,"registerService_"],[oy,"initialize_"],[py,"clear_"],[yy,"getNearestPanorama"],[zy,"getNearestPanoramaLatLng"],[Ay,"getPanoramaById"],[Dy,"hide"],[Ey,"show"],[Fy,"isHidden"],[Gy,"setContainer"],[Hy,"checkResize"],[Iy,"remove"],[Jy,"focus"],[Ky,"blur"],[Ly,"getPOV"],[My,"setPOV"],[Ny,"panTo"],[Oy,"followLink"],[Py,"setLocationAndPOVFromServerResponse"],[Qy,"setLocationAndPOV"],[Ry,"setUserPhoto"],[Sy,"getScreenPoint"],[Ty,"getLatLng"],[Uy,"getPanoId"],
+[Zq,"getEarthInstance"],[Qv,"isRtl"],[Rv,"getLanguageCode"]],Yy=[[aq,"DownloadUrl"],[oq,"Async"],[yp,"API_VERSION"],[zp,"MAP_MAP_PANE"],[Ap,"MAP_OVERLAY_LAYER_PANE"],[Bp,"MAP_MARKER_SHADOW_PANE"],[Cp,"MAP_MARKER_PANE"],[Dp,"MAP_FLOAT_SHADOW_PANE"],[Ep,"MAP_MARKER_MOUSE_TARGET_PANE"],[Fp,"MAP_FLOAT_PANE"],[Pp,"DEFAULT_ICON"],[Qp,"GEO_SUCCESS"],[Rp,"GEO_MISSING_ADDRESS"],[Sp,"GEO_UNKNOWN_ADDRESS"],[Tp,"GEO_UNAVAILABLE_ADDRESS"],[Up,"GEO_BAD_KEY"],[Vp,"GEO_TOO_MANY_QUERIES"],[Wp,"GEO_SERVER_ERROR"],
+[Gp,"GOOGLEBAR_TYPE_BLENDED_RESULTS"],[Hp,"GOOGLEBAR_TYPE_KMLONLY_RESULTS"],[Ip,"GOOGLEBAR_TYPE_LOCALONLY_RESULTS"],[Jp,"GOOGLEBAR_RESULT_LIST_SUPPRESS"],[Kp,"GOOGLEBAR_RESULT_LIST_INLINE"],[Lp,"GOOGLEBAR_LINK_TARGET_TOP"],[Mp,"GOOGLEBAR_LINK_TARGET_SELF"],[Np,"GOOGLEBAR_LINK_TARGET_PARENT"],[Op,"GOOGLEBAR_LINK_TARGET_BLANK"],[Xp,"ANCHOR_TOP_RIGHT"],[Yp,"ANCHOR_TOP_LEFT"],[Zp,"ANCHOR_BOTTOM_RIGHT"],[$p,"ANCHOR_BOTTOM_LEFT"],[bq,"START_ICON"],[cq,"PAUSE_ICON"],[dq,"END_ICON"],[eq,"GEO_MISSING_QUERY"],
+[fq,"GEO_UNKNOWN_DIRECTIONS"],[gq,"GEO_BAD_REQUEST"],[hq,"TRAVEL_MODE_DRIVING"],[iq,"TRAVEL_MODE_WALKING"],[jq,"TRAVEL_MODE_TRANSIT"],[kq,"MPL_GEOXML"],[lq,"MPL_POLY"],[mq,"MPL_MAPVIEW"],[nq,"MPL_GEOCODING"],[Nn,"MOON_MAP_TYPES"],[Kn,"MOON_VISIBLE_MAP"],[Ln,"MOON_ELEVATION_MAP"],[Sn,"MARS_MAP_TYPES"],[On,"MARS_ELEVATION_MAP"],[Pn,"MARS_VISIBLE_MAP"],[Qn,"MARS_INFRARED_MAP"],[Vn,"SKY_MAP_TYPES"],[Tn,"SKY_VISIBLE_MAP"],[pq,"LAYER_PARAM_COLOR"],[qq,"LAYER_PARAM_DENSITY_MODIFIER"],[rq,"ADSMANAGER_STYLE_ADUNIT"],
+[sq,"ADSMANAGER_STYLE_ICON"]];function Zy(a,b){b=b||{};return b.delayDrag?new Nh(a,b):new Mh(a,b)}
+Zy.prototype=Mh.prototype;function $y(a,b){b=b||{};var c=new Sj;c.mapTypes=b.mapTypes;c.size=b.size;c.draggingCursor=b.draggingCursor;c.draggableCursor=b.draggableCursor;c.logoPassive=b.logoPassive;c.googleBarOptions=b.googleBarOptions;c.backgroundColor=b.backgroundColor;Pc.call(this,a,c)}
+$y.prototype=Pc.prototype;
+var az={},bz=[[eo,zn],[go,Zg],[fo,D],[ko,yn],[lo,rk],[mo,Yj],[no,Qd],[oo,md],[so,Mh],[to,{}],[vo,xn],[xo,An],[yo,wn],[zo,Bn],[Ao,gk],[Co,jm],[Do,Wl],[Eo,Vl],[Fo,mi],[Go,{}],[Ho,dn],[Io,en],[Jo,z],[Ko,id],[Mo,{}],[No,Pc],[Oo,$y],[Po,Hd],[Qo,Ym],[Ro,Bj],[So,ik],[To,Xn],[Uo,Zm],[Vo,pd],[Wo,qn],[Yo,oi],[Zo,kn],[$o,S],[ap,Pl],[bp,Cl],[cp,sj],[gp,bn],[hp,Cn],[ip,bh],[jp,ch],[kp,R],[lp,an],[mp,fk],[np,hn],[qp,Cj],[rp,ak],[vp,{}],[wp,{}],[xp,Ud]],cz=[[yp,_mJavascriptVersion],[zp,0],[Ap,1],[Bp,2],[Cp,4],[Dp,
+5],[Ep,6],[Fp,7],[Pp,fm],[Gp,"blended"],[Hp,"kmlonly"],[Ip,"localonly"],[Jp,"suppress"],[Kp,"inline"],[Lp,"_top"],[Mp,"_self"],[Np,"_parent"],[Op,"_blank"],[Qp,200],[Rp,601],[Sp,602],[Tp,603],[Up,610],[Vp,620],[Wp,500],[Xp,1],[Yp,0],[Zp,3],[$p,2],[aq,ij],[rq,"adunit"],[sq,"icon"]];lh=e;
+var $=Pc.prototype,dz=Wl.prototype,ez=ik.prototype,fz=Cl.prototype,gz=Pl.prototype,hz=S.prototype,iz=R.prototype,jz=Zg.prototype,kz=z.prototype,lz=id.prototype,mz=kn.prototype,nz=qn.prototype,oz=Ud.prototype,pz=yn.prototype,qz=md.prototype,rz=ak.prototype,sz=Mh.prototype,tz=Xn.prototype,uz=An.prototype,vz=Bn.prototype,wz=Cn.prototype,xz=gk.prototype,yz=[[Rq,$.T],[nr,$.Ga],[or,$.mi],[Pq,$.H],[$q,$.F],[sr,$.te],[ur,$.Dc],[vr,$.bd],[Tq,$.AL],[Vq,$.rA],[Wq,$.hM],[pr,$.Bb],[uq,$.Pl],[ir,$.CE],[Yq,$.O],
+[dr,$.to],[er,$.db],[fr,$.qb],[vq,$.ba],[jr,$.ka],[xq,$.Zx],[Xq,$.Ya],[tq,$.$a],[hr,$.ge],[tr,$.ti],[ar,$.rn],[wq,$.$i],[Sq,$.R],[Qq,$.getBoundsZoomLevel],[lr,$.UE],[kr,$.QE],[br,$.ha],[Bq,$.nc],[Iq,$.Ic],[Fq,$.qj],[Lq,$.oh],[Mq,$.Tz],[Nq,$.X],[Oq,$.J],[Gq,$.xK],[zq,$.YJ],[yq,$.lJ],[Hq,$.uz],[Aq,$.jr],[Eq,$.jK],[Kq,$.Bz],[Dq,$.Wy],[mr,$.kv],[Jq,$.zz],[Cq,$.aK],[gr,$.uu],[qr,$.VF],[rr,$.WF],[Uq,$.mA],[Gr,$.ja],[Hr,$.ja],[Ir,$.ja],[Jr,$.ja],[Kr,$.Kb],[Er,$.Ej],[Mr,$.Hp],[Lr,$.Gp],[Br,$.da],[Dr,$.Cr],
+[Cr,$.lr],[Fr,$.Vs],[Rr,dz.nr],[Sr,dz.Dr],[$r,dz.maximize],[cs,dz.restore],[ds,dz.mv],[Yr,dz.hide],[es,dz.show],[Zr,dz.I],[as,dz.ya],[bs,dz.reset],[Vr,dz.Hj],[Ur,dz.ks],[Wr,dz.zM],[Xr,dz.ZA],[Tr,dz.tL],[gs,pi],[ys,ez.ja],[zs,ez.ja],[As,ez.ja],[Bs,ez.ja],[hs,ez.Zl],[is,ez.Zl],[js,ez.Zl],[ks,ez.Zl],[ls,ez.da],[Gs,ez.Kb],[rs,ez.pd],[ss,ez.Hj],[ts,ez.Hj],[us,ez.bB],[Ds,ez.cc],[Es,ez.cc],[qs,ez.Ic],[ms,ez.nc],[os,ez.dragging],[ns,ez.draggable],[ps,ez.qj],[Cs,ez.fT],[vs,ez.hide],[Fs,ez.show],[ws,ez.I],
+[Is,fz.er],[Js,fz.zm],[Ks,fz.Ar],[Ls,fz.Br],[Ms,fz.H],[Ns,fz.aM],[Os,fz.Vb],[Ps,fz.Ud],[Qs,fz.hide],[Rs,fz.cq],[Ss,fz.I],[Ts,fz.Lv],[Us,fz.show],[Vs,fz.ya],[Ws,Kl],[Ys,gz.er],[Zs,gz.zm],[$s,gz.Ar],[at,gz.Br],[dt,gz.Vb],[et,gz.Ud],[bt,gz.lL],[ct,gz.H],[ft,gz.hide],[gt,gz.cq],[ht,gz.I],[it,gz.$S],[jt,gz.Lv],[kt,gz.show],[lt,gz.ya],[mt,Ql],[Et,rf(v,3,az)],[Ft,rf(sh,3,az)],[Gt,w],[It,rf(ph,2,az)],[Jt,rf(Rg,1,az)],[Lt,rf(Pg,1,az)],[Mt,A],[Nt,rf(wh,4,az)],[Ot,rf(uh,4,az)],[Pt,qf],[Qt,uf],[Rt,hj],[Tt,hz.equals],
+[Ut,hz.toString],[Vt,Xg],[Xt,iz.equals],[Yt,iz.toString],[Zt,Yg],[au,jz.toString],[cu,jz.equals],[bu,jz.mid],[du,jz.min],[eu,jz.max],[fu,jz.kc],[gu,jz.Kf],[hu,jz.extend],[ju,kz.equals],[ku,kz.Aa],[lu,z.fromUrlValue],[mu,kz.lat],[nu,kz.lng],[ou,kz.$d],[pu,kz.ff],[qu,kz.Pb],[su,lz.equals],[tu,lz.contains],[uu,lz.contains],[vu,lz.intersects],[wu,lz.kc],[xu,lz.extend],[yu,lz.nb],[zu,lz.mb],[Au,lz.sb],[Bu,lz.hO],[Cu,lz.iO],[Du,lz.ma],[Eu,lz.T],[Gu,pz.$m],[Hu,pz.ga],[Iu,pz.getAddress],[Ju,pz.gA],[Ku,pz.eF],
+[Lu,pz.reset],[Mu,pz.Pv],[Nu,pz.eB],[Ou,pz.cF],[Pu,pz.eA],[Qu,pz.Wr],[Vu,qz.Oi],[Wu,qz.getCopyrights],[Xu,qz.$r],[av,rz.hide],[bv,rz.I],[cv,rz.refresh],[dv,rz.show],[ev,rz.ya],[$u,rz.KM],[gv,uz.bs],[hv,uz.Um],[iv,uz.Vm],[jv,uz.getKml],[kv,uz.$A],[lv,uz.ys],[mv,uz.nn],[nv,uz.hide],[ov,uz.I],[pv,uz.DC],[qv,uz.show],[rv,uz.ya],[ot,vz.getKml],[pt,vz.hide],[qt,vz.I],[rt,vz.show],[st,vz.ya],[ut,wz.getKml],[vt,wz.hide],[wt,wz.I],[zt,wz.show],[At,wz.ya],[Dv,sz.qe],[Ev,sz.Yk],[Fv,Mh.Xf],[Gv,Mh.Dj],[Hv,Mh.qe],
+[Iv,Mh.Yk],[Jv,sz.moveTo],[Kv,sz.moveBy],[Mv,tz.aq],[Nv,tz.Ww],[Ov,tz.GA],[Pv,tz.refresh],[gw,mz.QA],[hw,mz.show],[iw,mz.hide],[jw,mz.Bb],[lw,nz.GF],[cw,xz.Sl],[dw,xz.FE],[ew,xz.$x],[qw,n(Wn.prototype.write,x(Wn))],[rw,n(Wn.prototype.pH,x(Wn))],[sw,n(Wn.prototype.oH,x(Wn))],[tw,n(Wn.prototype.KA,x(Wn))],[uw,Sd],[vw,Rd],[xw,oz.$U],[yw,Td],[Gw,D.YK],[ky,zn.prototype.enable],[ly,zn.prototype.disable],[Qv,Wi],[Rv,Xd]];window._mTrafficEnableApi&&bz.push([sp,$n]);
+if(window._mDirectionsEnableApi){bz.push([po,Yn],[ro,Zn]);var zz=Yn.prototype,Az=Zn.prototype;yz.push([Iw,zz.load],[Jw,zz.zC],[Kw,zz.clear],[Lw,zz.We],[Mw,zz.H],[Nw,zz.qd],[Ow,zz.ab],[Pw,zz.bn],[Qw,zz.Xm],[Rw,zz.Sm],[Sw,zz.hn],[Tw,zz.lb],[Uw,zz.od],[Vw,zz.getPolyline],[Ww,zz.FA],[Xw,Yn.nA],[Zw,Az.clear],[$w,Az.HE],[ax,Az.Mo]);cz.push([bq,gm],[cq,hm],[dq,im],[eq,601],[fq,604],[gq,400],[hq,1],[iq,2],[jq,3])}
+if(ac){bz.push([Xo,rd],[dp,Ej]);var Bz=Ej.prototype;yz.push([wr,$.em],[xr,$.or],[yr,$.Er],[zr,$.Wj],[Ar,$.Rk],[xv,Bz.Tm],[yv,Bz.gM],[zv,Bz.rs],[Av,Bz.isImageryVisible],[Bv,Bz.qi])}var Cz=Tm.prototype,Dz=Wm.prototype;bz.push([ho,Tm],[io,Vm],[jo,Wm]);yz.push([yy,Cz.MA],[zy,Cz.oM],[Ay,Cz.tM],[Dy,Dz.hide],[Ey,Dz.show],[Fy,Dz.I],[Gy,Dz.hF],[Hy,Dz.$i],[Iy,Dz.remove],[Jy,Dz.focus],[Ky,Dz.blur],[Ly,Dz.en],[My,Dz.ap],[Ny,Dz.qb],[Oy,Dz.Mm],[Py,Dz.bl],[Qy,Dz.al],[Ry,Dz.YF],[Sy,Dz.gn],[Ty,Dz.ga],[Uy,Dz.Gj]);
+Tm.ReturnValues={SUCCESS:200,SERVER_ERROR:500,NO_NEARBY_PANO:600};Wm.ErrorValues={NO_NEARBY_PANO:600,NO_PHOTO:601,FLASH_UNAVAILABLE:603};yz.push([Nr,$.wz],[Or,$.$J]);yz.push([Zq,$.PM]);var Ez=hk.prototype;bz.push([Lo,hk]);yz.push([Aw,Ez.show],[Bw,Ez.hide],[Cw,Ez.I],[Dw,Ez.Ch],[Ew,Ez.setParameter]);cz.push([pq,"c"],[qq,"dm"]);Array.prototype.push.apply(cz,Gn());Bc.push(function(a){sc(a,Wy,Xy,Yy,bz,yz,cz,Vy)});function Fz(a,b){var c=new Sj;c.mapTypes=b||i;Pc.call(this,a,c);v(this,Ga,function(d,f){A(this,Fa,this.De(d),this.De(f))})}
+p(Fz,Pc);l=Fz.prototype;l.rL=function(){var a=this.T();return new S(a.lng(),a.lat())};
+l.nL=function(){var a=this.H();return new Zg([a.nb(),a.mb()])};
+l.DM=function(){var a=this.H().sb();return new R(a.lng(),a.lat())};
+l.wh=function(){return this.De(this.F())};
+l.Bb=function(a){if(this.ha())Pc.prototype.Bb.call(this,a);else this.gJ=a};
+l.JI=function(a,b){a=new z(a.y,a.x);if(this.ha()){b=this.De(b);this.Ga(a,b)}else{var c=this.gJ;b=this.De(b);this.Ga(a,b,c)}};
+l.KI=function(a){this.Ga(new z(a.y,a.x))};
+l.HR=function(a){this.qb(new z(a.y,a.x))};
+l.tH=function(a){this.te(this.De(a))};
+l.ja=function(a,b,c,d,f){var g={};g.pixelOffset=c;g.onOpenFn=d;g.onCloseFn=f;Pc.prototype.ja.call(this,new z(a.y,a.x),b,g)};
+l.TQ=Fz.prototype.ja;l.Kb=function(a,b,c,d,f,g){var h={};h.pixelOffset=d;h.onOpenFn=f;h.onCloseFn=g;h.mapType=c;h.zoomLevel=ue(b)?this.De(b):undefined;Pc.prototype.Kb.call(this,new z(a.y,a.x),h)};
+l.De=function(a){return typeof a=="number"?17-a:a};
+Bc.push(function(a){var b=Fz.prototype;b=[["Map",Fz,[["getCenterLatLng",b.rL],["getBoundsLatLng",b.nL],["getSpanLatLng",b.DM],["getZoomLevel",b.wh],["setMapType",b.Bb],["centerAtLatLng",b.KI],["recenterOrPanToLatLng",b.HR],["zoomTo",b.tH],["centerAndZoom",b.JI],["openInfoWindow",b.ja],["openInfoWindowHtml",b.TQ],["openInfoWindowXslt",N],["showMapBlowup",b.Kb]]],[i,ik,[["openInfoWindowXslt",N]]]];a=="G"&&mc(a,b)});Gg("api.css","@media print{.gmnoprint{display:none}}@media screen{.gmnoscreen{display:none}}");window.GLoad&&window.GLoad(Oc);})()
+
+
+
+/* SWFObject v2.2 <http://code.google.com/p/swfobject/>
+ is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
+*/
+var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
+
+
+
+/* HTTP Host: static.ak.connect.facebook.com */
+/* Generated: February 26th 2010 1:51:38 PM PDT */
+/* Machine: 10.27.115.117 */
+/* Source: Local/Global Cache */
+/* Location: JIT Construction: v222481 */
+/* Locale: en_US */
+/* Components: js/connect/core/FB/monitorWrapper.js:r221967,js/connect/core/FB/prelude.js:r221967,js/connect/core/FB/log.js:r221967,js/connect/core/FB/class.js:r221967,js/connect/core/FB/Type.js:r221967,js/connect/core/FB/HiddenContainer.js:r221967,js/connect/core/FB/HiddenContainerLoad.js:r221967,js/connect/core/FB/Delegate.js:r221967,js/connect/core/FB/Loader.js:r221967,js/connect/core/FB/Bootstrap.js:r221967,js/api_lib/v0.4/XdCommReceiver.js:r221967 */
+
+if (!window.FB) {FB = {};} if(!FB.dynData) { FB.dynData = {"site_vars":{"canvas_client_compute_content_size_method":1,"use_postMessage":1,"use_xdProxy":0,"use_ui_server":1,"monitor_usage_regex":"somethingtoputhere.com|huffingtonpost.com|lala.com","monitor_usage_rate":0.05,"enable_custom_href":1},"resources":{"base_url_format":"http:\/\/{0}.connect.facebook.com\/","base_cdn_url":"http:\/\/static.ak.fbcdn.net\/","api_channel":210036,"api_server":210036,"www_channel":210036,"xd_proxy":205601,"xd_comm_swf_url":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/z48NA\/hash\/6r2djk2l.swf","share_button":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/z1NNP\/hash\/4273uaqa.png","login_img_dark_small_short":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/zATAA\/hash\/a969rwcd.png","login_img_dark_medium_short":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/zI08N\/hash\/156b4b3s.png","login_img_dark_medium_long":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/zDFXV\/hash\/85b5jlja.png","login_img_dark_large_short":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/zHW0N\/hash\/a22m3ibb.png","login_img_dark_large_long":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/zC8F0\/hash\/8mzymam2.png","login_img_light_small_short":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/z68PZ\/hash\/8t35mjql.png","login_img_light_medium_short":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/zEV10\/hash\/6ad3z8m6.png","login_img_light_medium_long":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/z7T3O\/hash\/4li2k73z.png","login_img_light_large_short":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/zEYEC\/hash\/7e3mp7ee.png","login_img_light_large_long":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/z1RA7\/hash\/8rc0izvz.png","login_img_white_small_short":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/z79GY\/hash\/di0gkqrt.png","login_img_white_medium_short":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/zDTB7\/hash\/cdozw38w.png","login_img_white_medium_long":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/z6AST\/hash\/338d3m67.png","login_img_white_large_short":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/z6FD4\/hash\/8yzn0wu3.png","login_img_white_large_long":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/z5V8V\/hash\/5pwowlag.png","logout_img_small":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/z68NS\/hash\/cxrz4k7j.png","logout_img_medium":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/zATSY\/hash\/4lsqsd7l.png","logout_img_large":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/z8P0T\/hash\/4515xk7j.png"}};} if (!FB.locale) {FB.locale = "en_US";} if (!FB.localeIsRTL) {FB.localeIsRTL = false;}
+
+
+if(!window.FB)FB={};if(!FB.Monitor)FB.Monitor={wrapObject:function(a,b,f){if(typeof(a)!="object")return a;if(!FB.Monitor.loggingEnabled())return a;if(b=='FB.Debug'||b=='FB.HiddenContainer'||b=='FB.XdComm.Server'||b.indexOf('FBIntern')==0)return a;for(var d in a){var c=a[d];if(!a.hasOwnProperty(d)||typeof(c)!='function'||c.wrapped)continue;var e={containerName:b,functionName:d};a[d]=FB.Monitor._monitorWrapper(c,a,f,e);a[d].wrapped=true;}return a;},disableLogging:function(){FB.Monitor.loggingEnabledCache=false;},loggingEnabled:function(){if(FB.Monitor.loggingEnabledCache===null){var c=FB.dynData&&FB.dynData.site_vars&&FB.dynData.site_vars.monitor_usage_regex;if(!c){FB.Monitor.loggingEnabledCache=false;}else{var a=new RegExp(c);var b=FB.dynData.site_vars.monitor_usage_rate;FB.Monitor.loggingEnabledCache=a.test(document.domain)?(Math.random()/b)<1:false;}}return FB.Monitor.loggingEnabledCache;},externalCallback:function(a){if(typeof(a)!='function')return a;return function(){var d=FB.Monitor.internalCallStackDepth;FB.Monitor.internalCallStackDepth=0;var b=Array.prototype.slice.call(arguments);var c=a.apply(this,b);FB.Monitor.internalCallStackDepth=d;return c;};},_monitorWrapper:function(b,a,d,c){return function(){var e=Array.prototype.slice.call(arguments);context=d?this:(a||window);c=c||{containerName:'unknown',functionName:'unknown'};if(FB.Monitor.internalCallStackDepth==0)if(c.functionName.substr(0,1)!='_')FB.Monitor.logFunction(c,e);++FB.Monitor.internalCallStackDepth;var f=b.apply(context,e);--FB.Monitor.internalCallStackDepth;return f;};},logFunction:function(e,c){var b=[];for(var d=0;d<c.length;d++){var a=c[d];b[d]=a?a.toString():a;}FB.Monitor.log("functions",e.containerName+"."+e.functionName,b);},logXFBML:function(c){var b={};for(var d=0;d<c.attributes.length;++d){var a=c.attributes[d];if(a.specified!==false&&a.nodeName&&a.nodeValue&&a.nodeName!="class")b[a.nodeName]=a.nodeValue.toString();}var e=c.nodeName.toLowerCase();FB.Monitor.log("tags",e,b);},log:function(b,d,a){var c={name:d,args:a};FB.Monitor.loggingQueue[b].push(c);if(!FB.Monitor.pendingTimer){setTimeout(FB.Monitor.send,FB.Monitor.TIMER_INTERVAL);FB.Monitor.pendingTimer=true;}},clearQueues:function(){var a=FB.Monitor.loggingQueue;FB.Monitor.pendingTimer=false;FB.Monitor.loggingQueue={tags:[],functions:[]};return a;},send:function(){if(FB.MonitorSender){FB.bind(FB.MonitorSender.send)();}else{FB.Monitor.TIMER_INTERVAL=FB.Monitor.TIMER_INTERVAL*1.5;setTimeout(FB.Monitor.send,FB.Monitor.TIMER_INTERVAL);}},TIMER_INTERVAL:6*1000,internalCallStackDepth:0,loggingQueue:{tags:[],functions:[]},pendingTimer:false,loggingEnabledCache:null};
+if(!window.FB)FB={};FB.forEach=function(c,a,f){if(Object.prototype.toString.apply(c)==='[object Array]'){if(c.forEach){c.forEach(a);}else for(var b=0,e=c.length;b<e;b++)a(c[b],b,c);}else for(var d in c)if(f||c.hasOwnProperty(d))a(c[d],d,c);};FB.copy=function(c,b,a){FB.forEach(b,function(e,d){if(a||typeof c[d]==='undefined')c[d]=e;});};FB.copy(FB,{$:function(a){return document.getElementById(a);},TypeLoader:{NOTIFY:{},LOADED_MODULES:{},LOADED_CLASSES:{},resolve:function(f,e,a){for(var b=0,c=e.length;b<c;b++){var d=e[b];if(d==='')continue;if(typeof f[d]==='undefined')if(a){f[d]={};}else return false;f=f[d];}return f;},provide:function(c,b,a){FB.Monitor.wrapObject(b,c,false);var d=this.resolve(window,c.split('.'),true);if(a||!this.LOADED_MODULES[c]){FB.copy(d,b,true);if(b._onLoad)d._onLoad();}this.LOADED_MODULES[c]=true;},subclass:function(e,a,i){if(this.LOADED_CLASSES[e])return;if(a!=='FB.Class'&&!this.LOADED_CLASSES[a]){FB.Log.debug('"'+e+'" needs to wait for "'+a+'"');var j=FB.redo(arguments,this);this.NOTIFY[a]?this.NOTIFY[a].push(j):this.NOTIFY[a]=[j];return;}var b=this.resolve(window,a.split('.')),f=b.extend(i),g=this.NOTIFY[e],h=e.split('.'),d=this.resolve(window,h,true),c=h.pop();FB.Monitor.wrapObject(f.prototype,e,true);FB.Monitor.wrapObject(f,e,false);FB.copy(f,d);this.resolve(window,h)[c]=f;this.LOADED_CLASSES[e]=true;if(g){FB.forEach(g,function(k){k();});delete this.NOTIFY[e];}}},bind:function(){var a=Array.prototype.slice.call(arguments),c=a.shift(),b=a.shift();var d=function(){++FB.Monitor.internalCallStackDepth;var e=c.apply(b,a.concat(Array.prototype.slice.call(arguments)));--FB.Monitor.internalCallStackDepth;return e;};d._targets=[b,c];return d;},redo:function(a,c){var b=Array.prototype.slice.call(a);b.unshift(c);b.unshift(a.callee);return FB.bind.apply(FB,b);}});FB.provide=FB.bind(FB.TypeLoader.provide,FB.TypeLoader);FB.subclass=FB.bind(FB.TypeLoader.subclass,FB.TypeLoader);
+FB.provide('FB.Log',{level:3,Level:{DEBUG:3,INFO:2,WARNING:1,ERROR:0},_helper:function(){var a=Array.prototype.slice.call(arguments),c=a.shift(),b=a.shift();if(this.level>=b&&window.console)(console[c]||console.log).apply(console,a);}});FB.provide('FB.Log',{debug:FB.bind(FB.Log._helper,FB.Log,'debug',FB.Log.Level.DEBUG),info:FB.bind(FB.Log._helper,FB.Log,'info',FB.Log.Level.INFO),warn:FB.bind(FB.Log._helper,FB.Log,'warn',FB.Log.Level.WARNING),error:FB.bind(FB.Log._helper,FB.Log,'error',FB.Log.Level.ERROR)},true);
+(function(){var b=false,a=/xyz/.test(function(){xyz;})?/\b_super\b/:/.*/;FB.Class=function(){};FB.Class.extend=function(e){var d=this.prototype;b=true;var f=new this();b=false;FB.forEach(e,function(h,g){f[g]=typeof h==="function"&&typeof d[g]==="function"&&a.test(h)?(function(j,i){return function(){var l=this._super;this._super=d[j];var k=i.apply(this,arguments);this._super=l;return k;};})(g,h):h;});var c=function(){if(!b){var g;if(this instanceof c){g=this;}else{b=true;g=new c();b=false;}if(g.init)g.init.apply(g,arguments);return g;}};c.prototype=f;c.constructor=c;c.extend=FB.Class.extend;return c;};})();
+if(!window.FB)FB={};if(!FB.Type){FB.Type={createNamespace:function(b){var d=window;var c=b.split('.');for(var a=0;a<c.length;a++){var f=c[a];var e=d[f];if(!e)d[f]=e={};d=e;}return d;},createEnum:function(e,c,d){if(this.getObj(e))return;var a=function(){};a.prototype=c;for(var b in c)a[b]=c[b];if(d)a.__flags=true;this.setObj(e,a);},createClass2:function(cls,baseType){if(baseType&&typeof(baseType)=="string")baseType=eval(baseType);cls.prototype.constructor=cls;this.extend(cls,FB.Type.Methods);cls.__baseType=baseType||Object;if(baseType)cls.__basePrototypePending=true;},setObj:function(fullName,value){var i=fullName.lastIndexOf('.');var objName;var scope=window;if(i>0){var ns=fullName.substring(0,i);this.createNamespace(ns);objName=fullName.substring(i+1);scope=eval(ns);}else objName=fullName;scope[objName]=value;},getObj:function(b){var d=window;var c=b.split('.');for(var a=0;a<c.length;a++){var e=c[a];d=d[e];if(!d)break;}return d;},createClass:function(a,b){if(this.getObj(a))return;if(arguments.length==1&&typeof(a)!="string"){return this._createClass(a);}else this.setObj(a,this._createClass(b));},_createClass:function(b){var a=b.ctor||function(){};if(b.static_ctor)this.addStaticInit(b.static_ctor);if(b.instance)a.prototype=b.instance;if(b['static'])this.extend(a,b['static']);this.createClass2(a,b.base);return a;},addStaticInit:function(a){if(!FB.Type._pendingInits)FB.Type._pendingInits=[];FB.Type._pendingInits[FB.Type._pendingInits.length]=a;window.setTimeout(FB.Type.runPendingInits,0);},runPendingInits:function(){if(FB.Type._pendingInits){var b=FB.Type._pendingInits;FB.Type._pendingInits=null;var a=b.length;for(var c=0;c<a;c++)b[c]();}},extend:function(a,c){for(var b in c)a[b]=c[b];return a;},getInstanceType:function(a){return a.constructor;}};FB.Type.Methods={setupBase:function(){if(this.__basePrototypePending){var a=this.__baseType;if(a.__basePrototypePending)a.setupBase();for(var b in a.prototype){var c=a.prototype[b];if(!this.prototype[b])this.prototype[b]=c;}delete this.__basePrototypePending;}},constructBase:function(b,a){if(this.__basePrototypePending)this.setupBase();if(!a){this.__baseType.apply(b);}else this.__baseType.apply(b,a);},callBase:function(c,d,a){var b=this.__baseType.prototype[d];if(!a){return b.apply(c);}else return b.apply(c,a);},get_baseType:function(){return this.__baseType||null;}};}
+FB.provide('FB.HiddenContainer',{_onLoad:function(){if(document.getElementById('FB_HiddenContainer')==null){var a;try{var b=window.navigator.userAgent.toLowerCase().indexOf('msie')>=0&&window.attachEvent;if((!b||document.readyState=='completed')&&document.body){a=document.createElement('div');a.id="FB_HiddenContainer";a.style.position="absolute";a.style.top="-10000px";a.style.width="0px";a.style.height="0px";document.body.appendChild(a);}}catch(e){a=null;}if(!a)document.write('<div id="FB_HiddenContainer" '+'style="position:absolute; top:-10000px; left:-10000px; width:0px; height:0px;" >'+'</div>');}},get:function(){return FB.$('FB_HiddenContainer');}});
+FB.provide('FB.HiddenContainerLoader',{_onLoad:function(){FB.HiddenContainer.get();}});
+FB.subclass('FB.Delegate','FB.Class',{});FB.provide('FB.Delegate',{Null:function(){},_create:function(b){var a=function(){if(b.length==2){return b[1].apply(b[0],arguments);}else{var d=b.slice();for(var c=0;c<d.length;c+=2)d[c+1].apply(d[c],arguments);return null;}};a._targets=b;return a;},create:function(b,a){if(!b)return a;return FB.Delegate._create([b,a]);},combine:function(a,b){if(!a){if(!b._targets)return FB.Delegate.create(null,b);return b;}if(!b){if(!a._targets)return FB.Delegate.create(null,a);return a;}var c=a._targets?a._targets:[null,a];var d=b._targets?b._targets:[null,b];return FB.Delegate._create(c.concat(d));},remove:function(a,b){if(!a||(a===b))return null;if(!b)return a;var f=a._targets;var e=null;var d;if(b._targets){e=b._targets[0];d=b._targets[1];}else d=b;for(var c=0;c<f.length;c+=2)if((f[c]===e)&&(f[c+1]===d)){if(f.length==2)return null;f.splice(c,2);return FB.Delegate._create(f);}return a;}});if(!window.Delegate)window.Delegate=FB.Delegate;
+if(!window.FB)FB={};if(!FB.Loader)FB.Loader={loaded:{},loading:{},loadedCss:{},loadedCallback:null,onScriptLoaded:function(b){var a=b.length;for(var c=0;c<a;c++){var d=b[c];FB.Loader.loaded[d]=true;}if(FB.Loader.loadedCallback)window.setTimeout(function(){FB.Loader.loadedCallback(b);},0);},loadCssComps:function(a){var b=FB.Loader.getStaticResourceUrl('connect.php/'+FB.locale+'/css/'+a.join('/'));if(!this.loadedCss[b]){var c=document.createElement('link');c.setAttribute('rel','stylesheet');c.setAttribute('type','text/css');c.setAttribute('href',b);document.getElementsByTagName('head')[0].appendChild(c);this.loadedCss[b]=true;}},getStaticResourceUrl:function(b){var a=FB.dynData.resources.base_url_format;var c=(a.indexOf('https')===0)?'ssl':'static.ak';return a.replace('{0}',c)+b;}};
+if(!FB.Bootstrap){FB.Bootstrap={requireFeatures:function(e,c){if(FB.Bootstrap.isXdChannel)return;var i={features:e,callback:FB.Monitor.externalCallback(c),completed:false};if(FB.Bootstrap._checkRequest(i))return;FB.Bootstrap._featureReqQueue.push(i);FB.Loader.loadedCallback=FB.Delegate.combine(FB.Loader.loadedCallback,FB.Bootstrap._onCompLoaded);FB.Bootstrap._transformFeatureList(e);var h={};var a=[];var f;var b=e.length;var g=0;for(f=0;f<b;f++){var d=e[f];if(!(FB.Loader.loaded[d]))if(!(FB.Loader.loaded[d]||FB.Loader.loading[d])){h[d]=true;a[a.length]=d;}}a.sort();var j=FB.Loader.getStaticResourceUrl('connect.php/'+FB.locale+'/js/'+a.join('/'));FB.Bootstrap.addScript(j);},_requireFeatures:function(b,a){this.requireFeatures(b,FB.bind(a));},_checkRequest:function(d){if(!d.completed){var b=0;var e=d.features.length;var c=0;for(b=0;b<e;b++){var a=d.features[b];if(FB.Loader.loaded[a])c++;}if(c==e){d.completed=true;if(d.callback)d.callback(true);}}return d.completed;},_transformFeatureList:function(b){var c={Api:true,CanvasUtil:true,Connect:true,XFBML:true};var a=b.length;var g=false;var f={};for(var d=0;d<a;d++){f[b[d]]=true;if(c[b[d]])g=true;}if(g)for(var e in c)if(!f[e])b[b.length]=e;},ensureInit:function(a){if(!a)throw ("FB.ensureInit called without a valid callback");a=FB.Monitor.externalCallback(a);if(FB.Facebook&&FB.Facebook.get_initialized&&FB.Facebook.get_initialized().get_isReady()&&FB.Facebook.get_initialized().result)return a();FB.Bootstrap._requireFeatures(FB.Bootstrap.features,function(){FB.Facebook.get_initialized().waitForValue(true,a);});},init:function(a,c,b){FB.Bootstrap._requireFeatures(FB.Bootstrap.features,function(){if(FB.Facebook)FB.Facebook.init(a,c,b);});},addScript:function(f){var d;var e=document.getElementsByTagName('script');if(e){var a=e.length;for(var b=0;b<a;b++){d=e[b];if(d.src==f)return;}}d=document.createElement("script");d.type="text/javascript";d.src=f;var c=document.getElementsByTagName('HEAD')[0]||document.body;c.appendChild(d);},setLocale:function(b,a){window.FB.locale=b;window.FB.localeIsRTL=a;},_initializeXdChannel:function(){FB.Bootstrap.isXdChannel=window.location.search.indexOf(FB.Bootstrap.fbc_channel_token)>=0;},_detectDocumentNamespaces:function(){if(document.namespaces&&!document.namespaces.item['fb'])document.namespaces.add('fb');},createDefaultXdChannelUrl:function(){var a=location.protocol+'//'+location.hostname+location.pathname+location.search;if(location.search||location.search.length>0){a+='&';}else a+='?';a+='fbc_channel=1';return a;},_onCompLoaded:function(){var b=0;var a=FB.Bootstrap._featureReqQueue.length;for(b=0;b<a;b++)FB.Bootstrap._checkRequest(FB.Bootstrap._featureReqQueue[b]);},_onLoad:function(){this._initializeXdChannel();this._detectDocumentNamespaces();},features:["XFBML","CanvasUtil"],fbc_channel_token:'fbc_channel=1',_featureReqQueue:[]};FB.Monitor.wrapObject(FB.Bootstrap,'FB.Bootstrap');window.FB_RequireFeatures=FB.Bootstrap.requireFeatures;window.FB.init=FB.Bootstrap.init;window.FB.ensureInit=FB.Bootstrap.ensureInit;FB.Bootstrap._onLoad();}
+if(!window.FBIntern)FBIntern={};if(!FBIntern.XdReceiver){FBIntern.XdReceiver={delay:100,timerId:-1,dispatchMessage:function(){var i=document.URL;var e=i.indexOf('#');var d;if(e>0){d=i.substring(e+1);}else{e=i.indexOf('fb_login&');if(e>0){d=i.substring(e+9);}else return;}var a='debug=1&';if(d.indexOf(a)==0)d=d.substring(a.length);var h;var c=null;try{var f=window.parent;if(d.indexOf('fname=')==0){var g=d.indexOf('&');var b=d.substr(6,g-6);if(b=="_opener"){f=f.opener;}else if(b=="_oparen"){f=f.opener.parent;}else if(b!="_parent")f=f.frames[b];h=d.substr(g+1);}else{f=f.parent;h=d;}c=f.FB.XdComm.Server.singleton.onReceiverLoaded;}catch(e){if(e.number==-2146828218)return;}if(c){f.FB.XdComm.Server.singleton.onReceiverLoaded(h);if(FBIntern.XdReceiver.timerId!=-1){window.clearInterval(FBIntern.XdReceiver.timerId);FBIntern.XdReceiver.timerId=-1;}}else if(FBIntern.XdReceiver.timerId==-1)try{FBIntern.XdReceiver.timerId=window.setInterval(FBIntern.XdReceiver.dispatchMessage,FBIntern.XdReceiver.delay);}catch(e){}}};if(!(window.FB&&FB.Bootstrap&&!FB.Bootstrap.isXdChannel))try{FBIntern.XdReceiver.dispatchMessage();}catch(e){}}(function(){var c=document.getElementsByTagName('script');var d=c[c.length-1];if(d!=undefined){var a=d.getAttribute('fb-api-key');var b=d.getAttribute('fb-xd-receiver');if(a!=null)window.setTimeout(function(){FB.init(a,b);},0);}})();
+
+if (FB && FB.Loader) { FB.Loader.onScriptLoaded(["FB.monitor-wrapper","FB.Prelude","FB.Log","FB.Class","FB.Type","FB.HiddenContainer","FB.HiddenContainerLoader","FB.Delegate","FB.Loader","FB.Bootstrap","XdCommReceiver"]); }
+
+
+
+var MooTools={"version":"1.2.4","build":"0d9113241a90b9cd5643b926795852a2026710d4"};var Native=function(options){options=options||{};var name=options.name;var legacy=options.legacy;var protect=options.protect;var methods=options.implement;var generics=options.generics;var initialize=options.initialize;var afterImplement=options.afterImplement||function(){};var object=initialize||legacy;generics=generics!==false;object.constructor=Native;object.$family={name:"native"};if(legacy&&initialize){object.prototype=legacy.prototype;}object.prototype.constructor=object;if(name){var family=name.toLowerCase();object.prototype.$family={name:family};Native.typize(object,family);}var add=function(obj,name,method,force){if(!protect||force||!obj.prototype[name]){obj.prototype[name]=method;}if(generics){Native.genericize(obj,name,protect);}afterImplement.call(obj,name,method);return obj;};object.alias=function(a1,a2,a3){if(typeof a1=="string"){var pa1=this.prototype[a1];if((a1=pa1)){return add(this,a2,a1,a3);}}for(var a in a1){this.alias(a,a1[a],a2);}return this;};object.implement=function(a1,a2,a3){if(typeof a1=="string"){return add(this,a1,a2,a3);}for(var p in a1){add(this,p,a1[p],a2);}return this;};if(methods){object.implement(methods);}return object;};Native.genericize=function(object,property,check){if((!check||!object[property])&&typeof object.prototype[property]=="function"){object[property]=function(){var args=Array.prototype.slice.call(arguments);return object.prototype[property].apply(args.shift(),args);};}};Native.implement=function(objects,properties){for(var i=0,l=objects.length;i<l;i++){objects[i].implement(properties);}};Native.typize=function(object,family){if(!object.type){object.type=function(item){return($type(item)===family);};}};(function(){var natives={"Array":Array,"Date":Date,"Function":Function,"Number":Number,"RegExp":RegExp,"String":String};for(var n in natives){new Native({name:n,initialize:natives[n],protect:true});}var types={"boolean":Boolean,"native":Native,"object":Object};for(var t in types){Native.typize(types[t],t);}var generics={"Array":["concat","indexOf","join","lastIndexOf","pop","push","reverse","shift","slice","sort","splice","toString","unshift","valueOf"],"String":["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]};for(var g in generics){for(var i=generics[g].length;i--;){Native.genericize(natives[g],generics[g][i],true);}}})();var Hash=new Native({name:"Hash",initialize:function(object){if($type(object)=="hash"){object=$unlink(object.getClean());}for(var key in object){this[key]=object[key];}return this;}});Hash.implement({forEach:function(fn,bind){for(var key in this){if(this.hasOwnProperty(key)){fn.call(bind,this[key],key,this);}}},getClean:function(){var clean={};for(var key in this){if(this.hasOwnProperty(key)){clean[key]=this[key];}}return clean;},getLength:function(){var length=0;for(var key in this){if(this.hasOwnProperty(key)){length++;}}return length;}});Hash.alias("forEach","each");Array.implement({forEach:function(fn,bind){for(var i=0,l=this.length;i<l;i++){fn.call(bind,this[i],i,this);}}});Array.alias("forEach","each");function $A(iterable){if(iterable.item){var l=iterable.length,array=new Array(l);while(l--){array[l]=iterable[l];}return array;}return Array.prototype.slice.call(iterable);}function $arguments(i){return function(){return arguments[i];};}function $chk(obj){return !!(obj||obj===0);}function $clear(timer){clearTimeout(timer);clearInterval(timer);return null;}function $defined(obj){return(obj!=undefined);}function $each(iterable,fn,bind){var type=$type(iterable);((type=="arguments"||type=="collection"||type=="array")?Array:Hash).each(iterable,fn,bind);}function $empty(){}function $extend(original,extended){for(var key in (extended||{})){original[key]=extended[key];}return original;}function $H(object){return new Hash(object);}function $lambda(value){return($type(value)=="function")?value:function(){return value;};}function $merge(){var args=Array.slice(arguments);args.unshift({});return $mixin.apply(null,args);}function $mixin(mix){for(var i=1,l=arguments.length;i<l;i++){var object=arguments[i];if($type(object)!="object"){continue;}for(var key in object){var op=object[key],mp=mix[key];mix[key]=(mp&&$type(op)=="object"&&$type(mp)=="object")?$mixin(mp,op):$unlink(op);}}return mix;}function $pick(){for(var i=0,l=arguments.length;i<l;i++){if(arguments[i]!=undefined){return arguments[i];}}return null;}function $random(min,max){return Math.floor(Math.random()*(max-min+1)+min);}function $splat(obj){var type=$type(obj);return(type)?((type!="array"&&type!="arguments")?[obj]:obj):[];}var $time=Date.now||function(){return +new Date;};function $try(){for(var i=0,l=arguments.length;i<l;i++){try{return arguments[i]();}catch(e){}}return null;}function $type(obj){if(obj==undefined){return false;}if(obj.$family){return(obj.$family.name=="number"&&!isFinite(obj))?false:obj.$family.name;}if(obj.nodeName){switch(obj.nodeType){case 1:return"element";case 3:return(/\S/).test(obj.nodeValue)?"textnode":"whitespace";}}else{if(typeof obj.length=="number"){if(obj.callee){return"arguments";}else{if(obj.item){return"collection";}}}}return typeof obj;}function $unlink(object){var unlinked;switch($type(object)){case"object":unlinked={};for(var p in object){unlinked[p]=$unlink(object[p]);}break;case"hash":unlinked=new Hash(object);break;case"array":unlinked=[];for(var i=0,l=object.length;i<l;i++){unlinked[i]=$unlink(object[i]);}break;default:return object;}return unlinked;}var Browser=$merge({Engine:{name:"unknown",version:0},Platform:{name:(window.orientation!=undefined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.querySelector)},Plugins:{},Engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925));},trident:function(){return(!window.ActiveXObject)?false:((window.XMLHttpRequest)?((document.querySelectorAll)?6:5):4);},webkit:function(){return(navigator.taintEnabled)?false:((Browser.Features.xpath)?((Browser.Features.query)?525:420):419);},gecko:function(){return(!document.getBoxObjectFor&&window.mozInnerScreenX==null)?false:((document.getElementsByClassName)?19:18);}}},Browser||{});Browser.Platform[Browser.Platform.name]=true;Browser.detect=function(){for(var engine in this.Engines){var version=this.Engines[engine]();if(version){this.Engine={name:engine,version:version};this.Engine[engine]=this.Engine[engine+version]=true;break;}}return{name:engine,version:version};};Browser.detect();Browser.Request=function(){return $try(function(){return new XMLHttpRequest();},function(){return new ActiveXObject("MSXML2.XMLHTTP");},function(){return new ActiveXObject("Microsoft.XMLHTTP");});};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var version=($try(function(){return navigator.plugins["Shockwave Flash"].description;},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version");})||"0 r0").match(/\d+/g);return{version:parseInt(version[0]||0+"."+version[1],10)||0,build:parseInt(version[2],10)||0};})();function $exec(text){if(!text){return text;}if(window.execScript){window.execScript(text);}else{var script=document.createElement("script");script.setAttribute("type","text/javascript");script[(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerText":"text"]=text;document.head.appendChild(script);document.head.removeChild(script);}return text;}Native.UID=1;var $uid=(Browser.Engine.trident)?function(item){return(item.uid||(item.uid=[Native.UID++]))[0];}:function(item){return item.uid||(item.uid=Native.UID++);};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(win){$uid(win);if(!win.Element){win.Element=$empty;if(Browser.Engine.webkit){win.document.createElement("iframe");}win.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{};}win.document.window=win;return $extend(win,Window.Prototype);},afterImplement:function(property,value){window[property]=Window.Prototype[property]=value;}});Window.Prototype={$family:{name:"window"}};new Window(window);var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(doc){$uid(doc);doc.head=doc.getElementsByTagName("head")[0];doc.html=doc.getElementsByTagName("html")[0];if(Browser.Engine.trident&&Browser.Engine.version<=4){$try(function(){doc.execCommand("BackgroundImageCache",false,true);});}if(Browser.Engine.trident){doc.window.attachEvent("onunload",function(){doc.window.detachEvent("onunload",arguments.callee);doc.head=doc.html=doc.window=null;});}return $extend(doc,Document.Prototype);},afterImplement:function(property,value){document[property]=Document.Prototype[property]=value;}});Document.Prototype={$family:{name:"document"}};new Document(document);Array.implement({every:function(fn,bind){for(var i=0,l=this.length;i<l;i++){if(!fn.call(bind,this[i],i,this)){return false;}}return true;},filter:function(fn,bind){var results=[];for(var i=0,l=this.length;i<l;i++){if(fn.call(bind,this[i],i,this)){results.push(this[i]);}}return results;},clean:function(){return this.filter($defined);},indexOf:function(item,from){var len=this.length;for(var i=(from<0)?Math.max(0,len+from):from||0;i<len;i++){if(this[i]===item){return i;}}return -1;},map:function(fn,bind){var results=[];for(var i=0,l=this.length;i<l;i++){results[i]=fn.call(bind,this[i],i,this);}return results;},some:function(fn,bind){for(var i=0,l=this.length;i<l;i++){if(fn.call(bind,this[i],i,this)){return true;}}return false;},associate:function(keys){var obj={},length=Math.min(this.length,keys.length);for(var i=0;i<length;i++){obj[keys[i]]=this[i];}return obj;},link:function(object){var result={};for(var i=0,l=this.length;i<l;i++){for(var key in object){if(object[key](this[i])){result[key]=this[i];delete object[key];break;}}}return result;},contains:function(item,from){return this.indexOf(item,from)!=-1;},extend:function(array){for(var i=0,j=array.length;i<j;i++){this.push(array[i]);}return this;},getLast:function(){return(this.length)?this[this.length-1]:null;},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null;},include:function(item){if(!this.contains(item)){this.push(item);}return this;},combine:function(array){for(var i=0,l=array.length;i<l;i++){this.include(array[i]);}return this;},erase:function(item){for(var i=this.length;i--;i){if(this[i]===item){this.splice(i,1);}}return this;},empty:function(){this.length=0;return this;},flatten:function(){var array=[];for(var i=0,l=this.length;i<l;i++){var type=$type(this[i]);if(!type){continue;}array=array.concat((type=="array"||type=="collection"||type=="arguments")?Array.flatten(this[i]):this[i]);}return array;},hexToRgb:function(array){if(this.length!=3){return null;}var rgb=this.map(function(value){if(value.length==1){value+=value;}return value.toInt(16);});return(array)?rgb:"rgb("+rgb+")";},rgbToHex:function(array){if(this.length<3){return null;}if(this.length==4&&this[3]==0&&!array){return"transparent";}var hex=[];for(var i=0;i<3;i++){var bit=(this[i]-0).toString(16);hex.push((bit.length==1)?"0"+bit:bit);}return(array)?hex:"#"+hex.join("");}});Function.implement({extend:function(properties){for(var property in properties){this[property]=properties[property];}return this;},create:function(options){var self=this;options=options||{};return function(event){var args=options.arguments;args=(args!=undefined)?$splat(args):Array.slice(arguments,(options.event)?1:0);if(options.event){args=[event||window.event].extend(args);}var returns=function(){return self.apply(options.bind||null,args);};if(options.delay){return setTimeout(returns,options.delay);}if(options.periodical){return setInterval(returns,options.periodical);}if(options.attempt){return $try(returns);}return returns();};},run:function(args,bind){return this.apply(bind,$splat(args));},pass:function(args,bind){return this.create({bind:bind,arguments:args});},bind:function(bind,args){return this.create({bind:bind,arguments:args});},bindWithEvent:function(bind,args){return this.create({bind:bind,arguments:args,event:true});},attempt:function(args,bind){return this.create({bind:bind,arguments:args,attempt:true})();},delay:function(delay,bind,args){return this.create({bind:bind,arguments:args,delay:delay})();},periodical:function(periodical,bind,args){return this.create({bind:bind,arguments:args,periodical:periodical})();}});Number.implement({limit:function(min,max){return Math.min(max,Math.max(min,this));},round:function(precision){precision=Math.pow(10,precision||0);return Math.round(this*precision)/precision;},times:function(fn,bind){for(var i=0;i<this;i++){fn.call(bind,i,this);}},toFloat:function(){return parseFloat(this);},toInt:function(base){return parseInt(this,base||10);}});Number.alias("times","each");(function(math){var methods={};math.each(function(name){if(!Number[name]){methods[name]=function(){return Math[name].apply(null,[this].concat($A(arguments)));};}});Number.implement(methods);})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);String.implement({test:function(regex,params){return((typeof regex=="string")?new RegExp(regex,params):regex).test(this);},contains:function(string,separator){return(separator)?(separator+this+separator).indexOf(separator+string+separator)>-1:this.indexOf(string)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim();},camelCase:function(){return this.replace(/-\D/g,function(match){return match.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(match){return("-"+match.charAt(0).toLowerCase());});},capitalize:function(){return this.replace(/\b[a-z]/g,function(match){return match.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1");},toInt:function(base){return parseInt(this,base||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(array){var hex=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(hex)?hex.slice(1).hexToRgb(array):null;},rgbToHex:function(array){var rgb=this.match(/\d{1,3}/g);return(rgb)?rgb.rgbToHex(array):null;},stripScripts:function(option){var scripts="";var text=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){scripts+=arguments[1]+"\n";return"";});if(option===true){$exec(scripts);}else{if($type(option)=="function"){option(scripts,text);}}return text;},substitute:function(object,regexp){return this.replace(regexp||(/\\?\{([^{}]+)\}/g),function(match,name){if(match.charAt(0)=="\\"){return match.slice(1);}return(object[name]!=undefined)?object[name]:"";});}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(value){for(var key in this){if(this.hasOwnProperty(key)&&this[key]===value){return key;}}return null;},hasValue:function(value){return(Hash.keyOf(this,value)!==null);},extend:function(properties){Hash.each(properties||{},function(value,key){Hash.set(this,key,value);},this);return this;},combine:function(properties){Hash.each(properties||{},function(value,key){Hash.include(this,key,value);},this);return this;},erase:function(key){if(this.hasOwnProperty(key)){delete this[key];}return this;},get:function(key){return(this.hasOwnProperty(key))?this[key]:null;},set:function(key,value){if(!this[key]||this.hasOwnProperty(key)){this[key]=value;}return this;},empty:function(){Hash.each(this,function(value,key){delete this[key];},this);return this;},include:function(key,value){if(this[key]==undefined){this[key]=value;}return this;},map:function(fn,bind){var results=new Hash;Hash.each(this,function(value,key){results.set(key,fn.call(bind,value,key,this));},this);return results;},filter:function(fn,bind){var results=new Hash;Hash.each(this,function(value,key){if(fn.call(bind,value,key,this)){results.set(key,value);}},this);return results;},every:function(fn,bind){for(var key in this){if(this.hasOwnProperty(key)&&!fn.call(bind,this[key],key)){return false;}}return true;},some:function(fn,bind){for(var key in this){if(this.hasOwnProperty(key)&&fn.call(bind,this[key],key)){return true;}}return false;},getKeys:function(){var keys=[];Hash.each(this,function(value,key){keys.push(key);});return keys;},getValues:function(){var values=[];Hash.each(this,function(value){values.push(value);});return values;},toQueryString:function(base){var queryString=[];Hash.each(this,function(value,key){if(base){key=base+"["+key+"]";}var result;switch($type(value)){case"object":result=Hash.toQueryString(value,key);break;case"array":var qs={};value.each(function(val,i){qs[i]=val;});result=Hash.toQueryString(qs,key);break;default:result=key+"="+encodeURIComponent(value);}if(value!=undefined){queryString.push(result);}});return queryString.join("&");}});Hash.alias({keyOf:"indexOf",hasValue:"contains"});var Event=new Native({name:"Event",initialize:function(event,win){win=win||window;var doc=win.document;event=event||win.event;if(event.$extended){return event;}this.$extended=true;var type=event.type;var target=event.target||event.srcElement;while(target&&target.nodeType==3){target=target.parentNode;}if(type.test(/key/)){var code=event.which||event.keyCode;var key=Event.Keys.keyOf(code);if(type=="keydown"){var fKey=code-111;if(fKey>0&&fKey<13){key="f"+fKey;}}key=key||String.fromCharCode(code).toLowerCase();}else{if(type.match(/(click|mouse|menu)/i)){doc=(!doc.compatMode||doc.compatMode=="CSS1Compat")?doc.html:doc.body;var page={x:event.pageX||event.clientX+doc.scrollLeft,y:event.pageY||event.clientY+doc.scrollTop};var client={x:(event.pageX)?event.pageX-win.pageXOffset:event.clientX,y:(event.pageY)?event.pageY-win.pageYOffset:event.clientY};if(type.match(/DOMMouseScroll|mousewheel/)){var wheel=(event.wheelDelta)?event.wheelDelta/120:-(event.detail||0)/3;}var rightClick=(event.which==3)||(event.button==2);var related=null;if(type.match(/over|out/)){switch(type){case"mouseover":related=event.relatedTarget||event.fromElement;break;case"mouseout":related=event.relatedTarget||event.toElement;}if(!(function(){while(related&&related.nodeType==3){related=related.parentNode;}return true;}).create({attempt:Browser.Engine.gecko})()){related=false;}}}}return $extend(this,{event:event,type:type,page:page,client:client,rightClick:rightClick,wheel:wheel,relatedTarget:related,target:target,code:code,key:key,shift:event.shiftKey,control:event.ctrlKey,alt:event.altKey,meta:event.metaKey});}});Event.Keys=new Hash({"enter":13,"up":38,"down":40,"left":37,"right":39,"esc":27,"space":32,"backspace":8,"tab":9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault();},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault();}else{this.event.returnValue=false;}return this;}});function Class(params){if(params instanceof Function){params={initialize:params};}var newClass=function(){Object.reset(this);if(newClass._prototyping){return this;}this._current=$empty;var value=(this.initialize)?this.initialize.apply(this,arguments):this;delete this._current;delete this.caller;return value;}.extend(this);newClass.implement(params);newClass.constructor=Class;newClass.prototype.constructor=newClass;return newClass;}Function.prototype.protect=function(){this._protected=true;return this;};Object.reset=function(object,key){if(key==null){for(var p in object){Object.reset(object,p);}return object;}delete object[key];switch($type(object[key])){case"object":var F=function(){};F.prototype=object[key];var i=new F;object[key]=Object.reset(i);break;case"array":object[key]=$unlink(object[key]);break;}return object;};new Native({name:"Class",initialize:Class}).extend({instantiate:function(F){F._prototyping=true;var proto=new F;delete F._prototyping;return proto;},wrap:function(self,key,method){if(method._origin){method=method._origin;}return function(){if(method._protected&&this._current==null){throw new Error('The method "'+key+'" cannot be called.');}var caller=this.caller,current=this._current;this.caller=current;this._current=arguments.callee;var result=method.apply(this,arguments);this._current=current;this.caller=caller;return result;}.extend({_owner:self,_origin:method,_name:key});}});Class.implement({implement:function(key,value){if($type(key)=="object"){for(var p in key){this.implement(p,key[p]);}return this;}var mutator=Class.Mutators[key];if(mutator){value=mutator.call(this,value);if(value==null){return this;}}var proto=this.prototype;switch($type(value)){case"function":if(value._hidden){return this;}proto[key]=Class.wrap(this,key,value);break;case"object":var previous=proto[key];if($type(previous)=="object"){$mixin(previous,value);}else{proto[key]=$unlink(value);}break;case"array":proto[key]=$unlink(value);break;default:proto[key]=value;}return this;}});Class.Mutators={Extends:function(parent){this.parent=parent;this.prototype=Class.instantiate(parent);this.implement("parent",function(){var name=this.caller._name,previous=this.caller._owner.parent.prototype[name];if(!previous){throw new Error('The method "'+name+'" has no parent.');}return previous.apply(this,arguments);}.protect());},Implements:function(items){$splat(items).each(function(item){if(item instanceof Function){item=Class.instantiate(item);}this.implement(item);},this);}};var Chain=new Class({$chain:[],chain:function(){this.$chain.extend(Array.flatten(arguments));return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false;},clearChain:function(){this.$chain.empty();return this;}});var Events=new Class({$events:{},addEvent:function(type,fn,internal){type=Events.removeOn(type);if(fn!=$empty){this.$events[type]=this.$events[type]||[];this.$events[type].include(fn);if(internal){fn.internal=true;}}return this;},addEvents:function(events){for(var type in events){this.addEvent(type,events[type]);}return this;},fireEvent:function(type,args,delay){type=Events.removeOn(type);if(!this.$events||!this.$events[type]){return this;}this.$events[type].each(function(fn){fn.create({"bind":this,"delay":delay,"arguments":args})();},this);return this;},removeEvent:function(type,fn){type=Events.removeOn(type);if(!this.$events[type]){return this;}if(!fn.internal){this.$events[type].erase(fn);}return this;},removeEvents:function(events){var type;if($type(events)=="object"){for(type in events){this.removeEvent(type,events[type]);}return this;}if(events){events=Events.removeOn(events);}for(type in this.$events){if(events&&events!=type){continue;}var fns=this.$events[type];for(var i=fns.length;i--;i){this.removeEvent(type,fns[i]);}}return this;}});Events.removeOn=function(string){return string.replace(/^on([A-Z])/,function(full,first){return first.toLowerCase();});};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments));if(!this.addEvent){return this;}for(var option in this.options){if($type(this.options[option])!="function"||!(/^on[A-Z]/).test(option)){continue;}this.addEvent(option,this.options[option]);delete this.options[option];}return this;}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(tag,props){var konstructor=Element.Constructors.get(tag);if(konstructor){return konstructor(props);}if(typeof tag=="string"){return document.newElement(tag,props);}return document.id(tag).set(props);},afterImplement:function(key,value){Element.Prototype[key]=value;if(Array[key]){return;}Elements.implement(key,function(){var items=[],elements=true;for(var i=0,j=this.length;i<j;i++){var returns=this[i][key].apply(this[i],arguments);items.push(returns);if(elements){elements=($type(returns)=="element");}}return(elements)?new Elements(items):items;});}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var params=Array.link(arguments,{properties:Object.type,iframe:$defined});var props=params.properties||{};var iframe=document.id(params.iframe);var onload=props.onload||$empty;delete props.onload;props.id=props.name=$pick(props.id,props.name,iframe?(iframe.id||iframe.name):"IFrame_"+$time());iframe=new Element(iframe||"iframe",props);var onFrameLoad=function(){var host=$try(function(){return iframe.contentWindow.location.host;});if(!host||host==window.location.host){var win=new Window(iframe.contentWindow);new Document(iframe.contentWindow.document);$extend(win.Element.prototype,Element.Prototype);}onload.call(iframe.contentWindow,iframe.contentWindow.document);};var contentWindow=$try(function(){return iframe.contentWindow;});((contentWindow&&contentWindow.document.body)||window.frames[props.id])?onFrameLoad():iframe.addListener("load",onFrameLoad);return iframe;}});var Elements=new Native({initialize:function(elements,options){options=$extend({ddup:true,cash:true},options);elements=elements||[];if(options.ddup||options.cash){var uniques={},returned=[];for(var i=0,l=elements.length;i<l;i++){var el=document.id(elements[i],!options.cash);if(options.ddup){if(uniques[el.uid]){continue;}uniques[el.uid]=true;}if(el){returned.push(el);}}elements=returned;}return(options.cash)?$extend(elements,this):elements;}});Elements.implement({filter:function(filter,bind){if(!filter){return this;}return new Elements(Array.filter(this,(typeof filter=="string")?function(item){return item.match(filter);}:filter,bind));}});Document.implement({newElement:function(tag,props){if(Browser.Engine.trident&&props){["name","type","checked"].each(function(attribute){if(!props[attribute]){return;}tag+=" "+attribute+'="'+props[attribute]+'"';if(attribute!="checked"){delete props[attribute];}});tag="<"+tag+">";}return document.id(this.createElement(tag)).set(props);},newTextNode:function(text){return this.createTextNode(text);},getDocument:function(){return this;},getWindow:function(){return this.window;},id:(function(){var types={string:function(id,nocash,doc){id=doc.getElementById(id);return(id)?types.element(id,nocash):null;},element:function(el,nocash){$uid(el);if(!nocash&&!el.$family&&!(/^object|embed$/i).test(el.tagName)){var proto=Element.Prototype;for(var p in proto){el[p]=proto[p];}}return el;},object:function(obj,nocash,doc){if(obj.toElement){return types.element(obj.toElement(doc),nocash);}return null;}};types.textnode=types.whitespace=types.window=types.document=$arguments(0);return function(el,nocash,doc){if(el&&el.$family&&el.uid){return el;}var type=$type(el);return(types[type])?types[type](el,nocash,doc||document):null;};})()});if(window.$==null){Window.implement({$:function(el,nc){return document.id(el,nc,this.document);}});}Window.implement({$$:function(selector){if(arguments.length==1&&typeof selector=="string"){return this.document.getElements(selector);}var elements=[];var args=Array.flatten(arguments);for(var i=0,l=args.length;i<l;i++){var item=args[i];switch($type(item)){case"element":elements.push(item);break;case"string":elements.extend(this.document.getElements(item,true));}}return new Elements(elements);},getDocument:function(){return this.document;},getWindow:function(){return this;}});Native.implement([Element,Document],{getElement:function(selector,nocash){return document.id(this.getElements(selector,true)[0]||null,nocash);},getElements:function(tags,nocash){tags=tags.split(",");var elements=[];var ddup=(tags.length>1);tags.each(function(tag){var partial=this.getElementsByTagName(tag.trim());(ddup)?elements.extend(partial):elements=partial;},this);return new Elements(elements,{ddup:ddup,cash:!nocash});}});(function(){var collected={},storage={};var props={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"};var get=function(uid){return(storage[uid]||(storage[uid]={}));};var clean=function(item,retain){if(!item){return;}var uid=item.uid;if(Browser.Engine.trident){if(item.clearAttributes){var clone=retain&&item.cloneNode(false);item.clearAttributes();if(clone){item.mergeAttributes(clone);}}else{if(item.removeEvents){item.removeEvents();}}if((/object/i).test(item.tagName)){for(var p in item){if(typeof item[p]=="function"){item[p]=$empty;}}Element.dispose(item);}}if(!uid){return;}collected[uid]=storage[uid]=null;};var purge=function(){Hash.each(collected,clean);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(clean);}if(window.CollectGarbage){CollectGarbage();}collected=storage=null;};var walk=function(element,walk,start,match,all,nocash){var el=element[start||walk];var elements=[];while(el){if(el.nodeType==1&&(!match||Element.match(el,match))){if(!all){return document.id(el,nocash);}elements.push(el);}el=el[walk];}return(all)?new Elements(elements,{ddup:false,cash:!nocash}):null;};var attributes={"html":"innerHTML","class":"className","for":"htmlFor","defaultValue":"defaultValue","text":(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"};var bools=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];var camels=["value","type","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"];bools=bools.associate(bools);Hash.extend(attributes,bools);Hash.extend(attributes,camels.associate(camels.map(String.toLowerCase)));var inserters={before:function(context,element){if(element.parentNode){element.parentNode.insertBefore(context,element);}},after:function(context,element){if(!element.parentNode){return;}var next=element.nextSibling;(next)?element.parentNode.insertBefore(context,next):element.parentNode.appendChild(context);},bottom:function(context,element){element.appendChild(context);},top:function(context,element){var first=element.firstChild;(first)?element.insertBefore(context,first):element.appendChild(context);}};inserters.inside=inserters.bottom;Hash.each(inserters,function(inserter,where){where=where.capitalize();Element.implement("inject"+where,function(el){inserter(this,document.id(el,true));return this;});Element.implement("grab"+where,function(el){inserter(document.id(el,true),this);return this;});});Element.implement({set:function(prop,value){switch($type(prop)){case"object":for(var p in prop){this.set(p,prop[p]);}break;case"string":var property=Element.Properties.get(prop);(property&&property.set)?property.set.apply(this,Array.slice(arguments,1)):this.setProperty(prop,value);}return this;},get:function(prop){var property=Element.Properties.get(prop);return(property&&property.get)?property.get.apply(this,Array.slice(arguments,1)):this.getProperty(prop);},erase:function(prop){var property=Element.Properties.get(prop);(property&&property.erase)?property.erase.apply(this):this.removeProperty(prop);return this;},setProperty:function(attribute,value){var key=attributes[attribute];if(value==undefined){return this.removeProperty(attribute);}if(key&&bools[attribute]){value=!!value;}(key)?this[key]=value:this.setAttribute(attribute,""+value);return this;},setProperties:function(attributes){for(var attribute in attributes){this.setProperty(attribute,attributes[attribute]);}return this;},getProperty:function(attribute){var key=attributes[attribute];var value=(key)?this[key]:this.getAttribute(attribute,2);return(bools[attribute])?!!value:(key)?value:value||null;},getProperties:function(){var args=$A(arguments);return args.map(this.getProperty,this).associate(args);},removeProperty:function(attribute){var key=attributes[attribute];(key)?this[key]=(key&&bools[attribute])?false:"":this.removeAttribute(attribute);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this;},hasClass:function(className){return this.className.contains(className," ");},addClass:function(className){if(!this.hasClass(className)){this.className=(this.className+" "+className).clean();}return this;},removeClass:function(className){this.className=this.className.replace(new RegExp("(^|\\s)"+className+"(?:\\s|$)"),"$1");return this;},toggleClass:function(className){return this.hasClass(className)?this.removeClass(className):this.addClass(className);},adopt:function(){Array.flatten(arguments).each(function(element){element=document.id(element,true);if(element){this.appendChild(element);}},this);return this;},appendText:function(text,where){return this.grab(this.getDocument().newTextNode(text),where);},grab:function(el,where){inserters[where||"bottom"](document.id(el,true),this);return this;},inject:function(el,where){inserters[where||"bottom"](this,document.id(el,true));return this;},replaces:function(el){el=document.id(el,true);el.parentNode.replaceChild(this,el);return this;},wraps:function(el,where){el=document.id(el,true);return this.replaces(el).grab(el,where);},getPrevious:function(match,nocash){return walk(this,"previousSibling",null,match,false,nocash);},getAllPrevious:function(match,nocash){return walk(this,"previousSibling",null,match,true,nocash);},getNext:function(match,nocash){return walk(this,"nextSibling",null,match,false,nocash);},getAllNext:function(match,nocash){return walk(this,"nextSibling",null,match,true,nocash);},getFirst:function(match,nocash){return walk(this,"nextSibling","firstChild",match,false,nocash);},getLast:function(match,nocash){return walk(this,"previousSibling","lastChild",match,false,nocash);},getParent:function(match,nocash){return walk(this,"parentNode",null,match,false,nocash);},getParents:function(match,nocash){return walk(this,"parentNode",null,match,true,nocash);},getSiblings:function(match,nocash){return this.getParent().getChildren(match,nocash).erase(this);},getChildren:function(match,nocash){return walk(this,"nextSibling","firstChild",match,true,nocash);},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument;},getElementById:function(id,nocash){var el=this.ownerDocument.getElementById(id);if(!el){return null;}for(var parent=el.parentNode;parent!=this;parent=parent.parentNode){if(!parent){return null;}}return document.id(el,nocash);},getSelected:function(){return new Elements($A(this.options).filter(function(option){return option.selected;}));},getComputedStyle:function(property){if(this.currentStyle){return this.currentStyle[property.camelCase()];}var computed=this.getDocument().defaultView.getComputedStyle(this,null);return(computed)?computed.getPropertyValue([property.hyphenate()]):null;},toQueryString:function(){var queryString=[];this.getElements("input, select, textarea",true).each(function(el){if(!el.name||el.disabled||el.type=="submit"||el.type=="reset"||el.type=="file"){return;}var value=(el.tagName.toLowerCase()=="select")?Element.getSelected(el).map(function(opt){return opt.value;}):((el.type=="radio"||el.type=="checkbox")&&!el.checked)?null:el.value;$splat(value).each(function(val){if(typeof val!="undefined"){queryString.push(el.name+"="+encodeURIComponent(val));}});});return queryString.join("&");},clone:function(contents,keepid){contents=contents!==false;var clone=this.cloneNode(contents);var clean=function(node,element){if(!keepid){node.removeAttribute("id");}if(Browser.Engine.trident){node.clearAttributes();node.mergeAttributes(element);node.removeAttribute("uid");if(node.options){var no=node.options,eo=element.options;for(var j=no.length;j--;){no[j].selected=eo[j].selected;}}}var prop=props[element.tagName.toLowerCase()];if(prop&&element[prop]){node[prop]=element[prop];}};if(contents){var ce=clone.getElementsByTagName("*"),te=this.getElementsByTagName("*");for(var i=ce.length;i--;){clean(ce[i],te[i]);}}clean(clone,this);return document.id(clone);},destroy:function(){Element.empty(this);Element.dispose(this);clean(this,true);return null;},empty:function(){$A(this.childNodes).each(function(node){Element.destroy(node);});return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this;},hasChild:function(el){el=document.id(el,true);if(!el){return false;}if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(el.tagName)).contains(el);}return(this.contains)?(this!=el&&this.contains(el)):!!(this.compareDocumentPosition(el)&16);},match:function(tag){return(!tag||(tag==this)||(Element.get(this,"tag")==tag));}});Native.implement([Element,Window,Document],{addListener:function(type,fn){if(type=="unload"){var old=fn,self=this;fn=function(){self.removeListener("unload",fn);old();};}else{collected[this.uid]=this;}if(this.addEventListener){this.addEventListener(type,fn,false);}else{this.attachEvent("on"+type,fn);}return this;},removeListener:function(type,fn){if(this.removeEventListener){this.removeEventListener(type,fn,false);}else{this.detachEvent("on"+type,fn);}return this;},retrieve:function(property,dflt){var storage=get(this.uid),prop=storage[property];if(dflt!=undefined&&prop==undefined){prop=storage[property]=dflt;}return $pick(prop);},store:function(property,value){var storage=get(this.uid);storage[property]=value;return this;},eliminate:function(property){var storage=get(this.uid);delete storage[property];return this;}});window.addListener("unload",purge);})();Element.Properties=new Hash;Element.Properties.style={set:function(style){this.style.cssText=style;},get:function(){return this.style.cssText;},erase:function(){this.style.cssText="";}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase();}};Element.Properties.html=(function(){var wrapper=document.createElement("div");var translations={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]};translations.thead=translations.tfoot=translations.tbody;var html={set:function(){var html=Array.flatten(arguments).join("");var wrap=Browser.Engine.trident&&translations[this.get("tag")];if(wrap){var first=wrapper;first.innerHTML=wrap[1]+html+wrap[2];for(var i=wrap[0];i--;){first=first.firstChild;}this.empty().adopt(first.childNodes);}else{this.innerHTML=html;}}};html.erase=html.set;return html;})();if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText;}var temp=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);var text=temp.innerText;temp.destroy();return text;}};}Element.Properties.events={set:function(events){this.addEvents(events);}};Native.implement([Element,Window,Document],{addEvent:function(type,fn){var events=this.retrieve("events",{});events[type]=events[type]||{"keys":[],"values":[]};if(events[type].keys.contains(fn)){return this;}events[type].keys.push(fn);var realType=type,custom=Element.Events.get(type),condition=fn,self=this;if(custom){if(custom.onAdd){custom.onAdd.call(this,fn);}if(custom.condition){condition=function(event){if(custom.condition.call(this,event)){return fn.call(this,event);}return true;};}realType=custom.base||realType;}var defn=function(){return fn.call(self);};var nativeEvent=Element.NativeEvents[realType];if(nativeEvent){if(nativeEvent==2){defn=function(event){event=new Event(event,self.getWindow());if(condition.call(self,event)===false){event.stop();}};}this.addListener(realType,defn);}events[type].values.push(defn);return this;},removeEvent:function(type,fn){var events=this.retrieve("events");if(!events||!events[type]){return this;}var pos=events[type].keys.indexOf(fn);if(pos==-1){return this;}events[type].keys.splice(pos,1);var value=events[type].values.splice(pos,1)[0];var custom=Element.Events.get(type);if(custom){if(custom.onRemove){custom.onRemove.call(this,fn);}type=custom.base||type;}return(Element.NativeEvents[type])?this.removeListener(type,value):this;},addEvents:function(events){for(var event in events){this.addEvent(event,events[event]);}return this;},removeEvents:function(events){var type;if($type(events)=="object"){for(type in events){this.removeEvent(type,events[type]);}return this;}var attached=this.retrieve("events");if(!attached){return this;}if(!events){for(type in attached){this.removeEvents(type);}this.eliminate("events");}else{if(attached[events]){while(attached[events].keys[0]){this.removeEvent(events,attached[events].keys[0]);}attached[events]=null;}}return this;},fireEvent:function(type,args,delay){var events=this.retrieve("events");if(!events||!events[type]){return this;}events[type].keys.each(function(fn){fn.create({"bind":this,"delay":delay,"arguments":args})();},this);return this;},cloneEvents:function(from,type){from=document.id(from);var fevents=from.retrieve("events");if(!fevents){return this;}if(!type){for(var evType in fevents){this.cloneEvents(from,evType);}}else{if(fevents[type]){fevents[type].keys.each(function(fn){this.addEvent(type,fn);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};(function(){var $check=function(event){var related=event.relatedTarget;if(related==undefined){return true;}if(related===false){return false;}return($type(this)!="document"&&related!=this&&related.prefix!="xul"&&!this.hasChild(related));};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:$check},mouseleave:{base:"mouseout",condition:$check},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}});})();Element.Properties.styles={set:function(styles){this.setStyles(styles);}};Element.Properties.opacity={set:function(opacity,novisibility){if(!novisibility){if(opacity==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden";}}else{if(this.style.visibility!="visible"){this.style.visibility="visible";}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1;}if(Browser.Engine.trident){this.style.filter=(opacity==1)?"":"alpha(opacity="+opacity*100+")";}this.style.opacity=opacity;this.store("opacity",opacity);},get:function(){return this.retrieve("opacity",1);}};Element.implement({setOpacity:function(value){return this.set("opacity",value,true);},getOpacity:function(){return this.get("opacity");},setStyle:function(property,value){switch(property){case"opacity":return this.set("opacity",parseFloat(value));case"float":property=(Browser.Engine.trident)?"styleFloat":"cssFloat";}property=property.camelCase();if($type(value)!="string"){var map=(Element.Styles.get(property)||"@").split(" ");value=$splat(value).map(function(val,i){if(!map[i]){return"";}return($type(val)=="number")?map[i].replace("@",Math.round(val)):val;}).join(" ");}else{if(value==String(Number(value))){value=Math.round(value);}}this.style[property]=value;return this;},getStyle:function(property){switch(property){case"opacity":return this.get("opacity");case"float":property=(Browser.Engine.trident)?"styleFloat":"cssFloat";}property=property.camelCase();var result=this.style[property];if(!$chk(result)){result=[];for(var style in Element.ShortStyles){if(property!=style){continue;}for(var s in Element.ShortStyles[style]){result.push(this.getStyle(s));}return result.join(" ");}result=this.getComputedStyle(property);}if(result){result=String(result);var color=result.match(/rgba?\([\d\s,]+\)/);if(color){result=result.replace(color[0],color[0].rgbToHex());}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(result,10)))){if(property.test(/^(height|width)$/)){var values=(property=="width")?["left","right"]:["top","bottom"],size=0;values.each(function(value){size+=this.getStyle("border-"+value+"-width").toInt()+this.getStyle("padding-"+value).toInt();},this);return this["offset"+property.capitalize()]-size+"px";}if((Browser.Engine.presto)&&String(result).test("px")){return result;}if(property.test(/(border(.+)Width|margin|padding)/)){return"0px";}}return result;},setStyles:function(styles){for(var style in styles){this.setStyle(style,styles[style]);}return this;},getStyles:function(){var result={};Array.flatten(arguments).each(function(key){result[key]=this.getStyle(key);},this);return result;}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@","zoom":"@",fontWeight:"@",textIndent:"@px",opacity:"@"});Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(direction){var Short=Element.ShortStyles;var All=Element.Styles;["margin","padding"].each(function(style){var sd=style+direction;Short[style][sd]=All[sd]="@px";});var bd="border"+direction;Short.border[bd]=All[bd]="@px @ rgb(@, @, @)";var bdw=bd+"Width",bds=bd+"Style",bdc=bd+"Color";Short[bd]={};Short.borderWidth[bdw]=Short[bd][bdw]=All[bdw]="@px";Short.borderStyle[bds]=Short[bd][bds]=All[bds]="@";Short.borderColor[bdc]=Short[bd][bdc]=All[bdc]="rgb(@, @, @)";});(function(){Element.implement({scrollTo:function(x,y){if(isBody(this)){this.getWindow().scrollTo(x,y);}else{this.scrollLeft=x;this.scrollTop=y;}return this;},getSize:function(){if(isBody(this)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight};},getScrollSize:function(){if(isBody(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(isBody(this)){return this.getWindow().getScroll();}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var element=this,position={x:0,y:0};while(element&&!isBody(element)){position.x+=element.scrollLeft;position.y+=element.scrollTop;element=element.parentNode;}return position;},getOffsetParent:function(){var element=this;if(isBody(element)){return null;}if(!Browser.Engine.trident){return element.offsetParent;}while((element=element.parentNode)&&!isBody(element)){if(styleString(element,"position")!="static"){return element;}}return null;},getOffsets:function(){if(this.getBoundingClientRect){var bound=this.getBoundingClientRect(),html=document.id(this.getDocument().documentElement),htmlScroll=html.getScroll(),elemScrolls=this.getScrolls(),elemScroll=this.getScroll(),isFixed=(styleString(this,"position")=="fixed");return{x:bound.left.toInt()+elemScrolls.x-elemScroll.x+((isFixed)?0:htmlScroll.x)-html.clientLeft,y:bound.top.toInt()+elemScrolls.y-elemScroll.y+((isFixed)?0:htmlScroll.y)-html.clientTop};}var element=this,position={x:0,y:0};if(isBody(this)){return position;}while(element&&!isBody(element)){position.x+=element.offsetLeft;position.y+=element.offsetTop;if(Browser.Engine.gecko){if(!borderBox(element)){position.x+=leftBorder(element);position.y+=topBorder(element);}var parent=element.parentNode;if(parent&&styleString(parent,"overflow")!="visible"){position.x+=leftBorder(parent);position.y+=topBorder(parent);}}else{if(element!=this&&Browser.Engine.webkit){position.x+=leftBorder(element);position.y+=topBorder(element);}}element=element.offsetParent;}if(Browser.Engine.gecko&&!borderBox(this)){position.x-=leftBorder(this);position.y-=topBorder(this);}return position;},getPosition:function(relative){if(isBody(this)){return{x:0,y:0};}var offset=this.getOffsets(),scroll=this.getScrolls();var position={x:offset.x-scroll.x,y:offset.y-scroll.y};var relativePosition=(relative&&(relative=document.id(relative)))?relative.getPosition():{x:0,y:0};return{x:position.x-relativePosition.x,y:position.y-relativePosition.y};},getCoordinates:function(element){if(isBody(this)){return this.getWindow().getCoordinates();}var position=this.getPosition(element),size=this.getSize();var obj={left:position.x,top:position.y,width:size.x,height:size.y};obj.right=obj.left+obj.width;obj.bottom=obj.top+obj.height;return obj;},computePosition:function(obj){return{left:obj.x-styleNumber(this,"margin-left"),top:obj.y-styleNumber(this,"margin-top")};},setPosition:function(obj){return this.setStyles(this.computePosition(obj));}});Native.implement([Document,Window],{getSize:function(){if(Browser.Engine.presto||Browser.Engine.webkit){var win=this.getWindow();return{x:win.innerWidth,y:win.innerHeight};}var doc=getCompatElement(this);return{x:doc.clientWidth,y:doc.clientHeight};},getScroll:function(){var win=this.getWindow(),doc=getCompatElement(this);return{x:win.pageXOffset||doc.scrollLeft,y:win.pageYOffset||doc.scrollTop};},getScrollSize:function(){var doc=getCompatElement(this),min=this.getSize();return{x:Math.max(doc.scrollWidth,min.x),y:Math.max(doc.scrollHeight,min.y)};},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var size=this.getSize();return{top:0,left:0,bottom:size.y,right:size.x,height:size.y,width:size.x};}});var styleString=Element.getComputedStyle;function styleNumber(element,style){return styleString(element,style).toInt()||0;}function borderBox(element){return styleString(element,"-moz-box-sizing")=="border-box";}function topBorder(element){return styleNumber(element,"border-top-width");}function leftBorder(element){return styleNumber(element,"border-left-width");}function isBody(element){return(/^(?:body|html)$/i).test(element.tagName);}function getCompatElement(element){var doc=element.getDocument();return(!doc.compatMode||doc.compatMode=="CSS1Compat")?doc.html:doc.body;}})();Element.alias("setPosition","position");Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y;},getWidth:function(){return this.getSize().x;},getScrollTop:function(){return this.getScroll().y;},getScrollLeft:function(){return this.getScroll().x;},getScrollHeight:function(){return this.getScrollSize().y;},getScrollWidth:function(){return this.getScrollSize().x;},getTop:function(){return this.getPosition().y;},getLeft:function(){return this.getPosition().x;}});Native.implement([Document,Element],{getElements:function(expression,nocash){expression=expression.split(",");var items,local={};for(var i=0,l=expression.length;i<l;i++){var selector=expression[i],elements=Selectors.Utils.search(this,selector,local);if(i!=0&&elements.item){elements=$A(elements);}items=(i==0)?elements:(items.item)?$A(items).concat(elements):items.concat(elements);}return new Elements(items,{ddup:(expression.length>1),cash:!nocash});}});Element.implement({match:function(selector){if(!selector||(selector==this)){return true;}var tagid=Selectors.Utils.parseTagAndID(selector);var tag=tagid[0],id=tagid[1];if(!Selectors.Filters.byID(this,id)||!Selectors.Filters.byTag(this,tag)){return false;}var parsed=Selectors.Utils.parseSelector(selector);return(parsed)?Selectors.Utils.filter(this,parsed,{}):true;}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)};Selectors.Utils={chk:function(item,uniques){if(!uniques){return true;}var uid=$uid(item);if(!uniques[uid]){return uniques[uid]=true;}return false;},parseNthArgument:function(argument){if(Selectors.Cache.nth[argument]){return Selectors.Cache.nth[argument];}var parsed=argument.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!parsed){return false;}var inta=parseInt(parsed[1],10);var a=(inta||inta===0)?inta:1;var special=parsed[2]||false;var b=parseInt(parsed[3],10)||0;if(a!=0){b--;while(b<1){b+=a;}while(b>=a){b-=a;}}else{a=b;special="index";}switch(special){case"n":parsed={a:a,b:b,special:"n"};break;case"odd":parsed={a:2,b:0,special:"n"};break;case"even":parsed={a:2,b:1,special:"n"};break;case"first":parsed={a:0,special:"index"};break;case"last":parsed={special:"last-child"};break;case"only":parsed={special:"only-child"};break;default:parsed={a:(a-1),special:"index"};}return Selectors.Cache.nth[argument]=parsed;},parseSelector:function(selector){if(Selectors.Cache.parsed[selector]){return Selectors.Cache.parsed[selector];}var m,parsed={classes:[],pseudos:[],attributes:[]};while((m=Selectors.RegExps.combined.exec(selector))){var cn=m[1],an=m[2],ao=m[3],av=m[5],pn=m[6],pa=m[7];if(cn){parsed.classes.push(cn);}else{if(pn){var parser=Selectors.Pseudo.get(pn);if(parser){parsed.pseudos.push({parser:parser,argument:pa});}else{parsed.attributes.push({name:pn,operator:"=",value:pa});}}else{if(an){parsed.attributes.push({name:an,operator:ao,value:av});}}}}if(!parsed.classes.length){delete parsed.classes;}if(!parsed.attributes.length){delete parsed.attributes;}if(!parsed.pseudos.length){delete parsed.pseudos;}if(!parsed.classes&&!parsed.attributes&&!parsed.pseudos){parsed=null;}return Selectors.Cache.parsed[selector]=parsed;},parseTagAndID:function(selector){var tag=selector.match(Selectors.RegExps.tag);var id=selector.match(Selectors.RegExps.id);return[(tag)?tag[1]:"*",(id)?id[1]:false];},filter:function(item,parsed,local){var i;if(parsed.classes){for(i=parsed.classes.length;i--;i){var cn=parsed.classes[i];if(!Selectors.Filters.byClass(item,cn)){return false;}}}if(parsed.attributes){for(i=parsed.attributes.length;i--;i){var att=parsed.attributes[i];if(!Selectors.Filters.byAttribute(item,att.name,att.operator,att.value)){return false;}}}if(parsed.pseudos){for(i=parsed.pseudos.length;i--;i){var psd=parsed.pseudos[i];if(!Selectors.Filters.byPseudo(item,psd.parser,psd.argument,local)){return false;}}}return true;},getByTagAndID:function(ctx,tag,id){if(id){var item=(ctx.getElementById)?ctx.getElementById(id,true):Element.getElementById(ctx,id,true);return(item&&Selectors.Filters.byTag(item,tag))?[item]:[];}else{return ctx.getElementsByTagName(tag);}},search:function(self,expression,local){var splitters=[];var selectors=expression.trim().replace(Selectors.RegExps.splitter,function(m0,m1,m2){splitters.push(m1);return":)"+m2;}).split(":)");var items,filtered,item;for(var i=0,l=selectors.length;i<l;i++){var selector=selectors[i];if(i==0&&Selectors.RegExps.quick.test(selector)){items=self.getElementsByTagName(selector);continue;}var splitter=splitters[i-1];var tagid=Selectors.Utils.parseTagAndID(selector);var tag=tagid[0],id=tagid[1];if(i==0){items=Selectors.Utils.getByTagAndID(self,tag,id);}else{var uniques={},found=[];for(var j=0,k=items.length;j<k;j++){found=Selectors.Getters[splitter](found,items[j],tag,id,uniques);}items=found;}var parsed=Selectors.Utils.parseSelector(selector);if(parsed){filtered=[];for(var m=0,n=items.length;m<n;m++){item=items[m];if(Selectors.Utils.filter(item,parsed,local)){filtered.push(item);}}items=filtered;}}return items;}};Selectors.Getters={" ":function(found,self,tag,id,uniques){var items=Selectors.Utils.getByTagAndID(self,tag,id);for(var i=0,l=items.length;i<l;i++){var item=items[i];if(Selectors.Utils.chk(item,uniques)){found.push(item);}}return found;},">":function(found,self,tag,id,uniques){var children=Selectors.Utils.getByTagAndID(self,tag,id);for(var i=0,l=children.length;i<l;i++){var child=children[i];if(child.parentNode==self&&Selectors.Utils.chk(child,uniques)){found.push(child);}}return found;},"+":function(found,self,tag,id,uniques){while((self=self.nextSibling)){if(self.nodeType==1){if(Selectors.Utils.chk(self,uniques)&&Selectors.Filters.byTag(self,tag)&&Selectors.Filters.byID(self,id)){found.push(self);}break;}}return found;},"~":function(found,self,tag,id,uniques){while((self=self.nextSibling)){if(self.nodeType==1){if(!Selectors.Utils.chk(self,uniques)){break;}if(Selectors.Filters.byTag(self,tag)&&Selectors.Filters.byID(self,id)){found.push(self);}}}return found;}};Selectors.Filters={byTag:function(self,tag){return(tag=="*"||(self.tagName&&self.tagName.toLowerCase()==tag));},byID:function(self,id){return(!id||(self.id&&self.id==id));},byClass:function(self,klass){return(self.className&&self.className.contains&&self.className.contains(klass," "));},byPseudo:function(self,parser,argument,local){return parser.call(self,argument,local);},byAttribute:function(self,name,operator,value){var result=Element.prototype.getProperty.call(self,name);if(!result){return(operator=="!=");}if(!operator||value==undefined){return true;}switch(operator){case"=":return(result==value);case"*=":return(result.contains(value));case"^=":return(result.substr(0,value.length)==value);case"$=":return(result.substr(result.length-value.length)==value);case"!=":return(result!=value);case"~=":return result.contains(value," ");case"|=":return result.contains(value,"-");}return false;}};Selectors.Pseudo=new Hash({checked:function(){return this.checked;},empty:function(){return !(this.innerText||this.textContent||"").length;},not:function(selector){return !Element.match(this,selector);},contains:function(text){return(this.innerText||this.textContent||"").contains(text);},"first-child":function(){return Selectors.Pseudo.index.call(this,0);},"last-child":function(){var element=this;while((element=element.nextSibling)){if(element.nodeType==1){return false;}}return true;},"only-child":function(){var prev=this;while((prev=prev.previousSibling)){if(prev.nodeType==1){return false;}}var next=this;while((next=next.nextSibling)){if(next.nodeType==1){return false;}}return true;},"nth-child":function(argument,local){argument=(argument==undefined)?"n":argument;var parsed=Selectors.Utils.parseNthArgument(argument);if(parsed.special!="n"){return Selectors.Pseudo[parsed.special].call(this,parsed.a,local);}var count=0;local.positions=local.positions||{};var uid=$uid(this);if(!local.positions[uid]){var self=this;while((self=self.previousSibling)){if(self.nodeType!=1){continue;}count++;var position=local.positions[$uid(self)];if(position!=undefined){count=position+count;break;}}local.positions[uid]=count;}return(local.positions[uid]%parsed.a==parsed.b);},index:function(index){var element=this,count=0;while((element=element.previousSibling)){if(element.nodeType==1&&++count>index){return false;}}return(count==index);},even:function(argument,local){return Selectors.Pseudo["nth-child"].call(this,"2n+1",local);},odd:function(argument,local){return Selectors.Pseudo["nth-child"].call(this,"2n",local);},selected:function(){return this.selected;},enabled:function(){return(this.disabled===false);}});Element.Events.domready={onAdd:function(fn){if(Browser.loaded){fn.call(this);}}};(function(){var domready=function(){if(Browser.loaded){return;}Browser.loaded=true;window.fireEvent("domready");document.fireEvent("domready");};window.addEvent("load",domready);if(Browser.Engine.trident){var temp=document.createElement("div");(function(){($try(function(){temp.doScroll();return document.id(temp).inject(document.body).set("html","temp").dispose();}))?domready():arguments.callee.delay(50);})();}else{if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(["loaded","complete"].contains(document.readyState))?domready():arguments.callee.delay(50);})();}else{document.addEvent("DOMContentLoaded",domready);}}})();var JSON=new Hash(this.JSON&&{stringify:JSON.stringify,parse:JSON.parse}).extend({$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(chr){return JSON.$specialChars[chr]||"\\u00"+Math.floor(chr.charCodeAt()/16).toString(16)+(chr.charCodeAt()%16).toString(16);},encode:function(obj){switch($type(obj)){case"string":return'"'+obj.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(obj.map(JSON.encode).clean())+"]";case"object":case"hash":var string=[];Hash.each(obj,function(value,key){var json=JSON.encode(value);if(json){string.push(JSON.encode(key)+":"+json);}});return"{"+string+"}";case"number":case"boolean":return String(obj);case false:return"null";}return null;},decode:function(string,secure){if($type(string)!="string"||!string.length){return null;}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null;}return eval("("+string+")");}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this);}});var Cookie=new Class({Implements:Options,options:{path:false,domain:false,duration:false,secure:false,document:document},initialize:function(key,options){this.key=key;this.setOptions(options);},write:function(value){value=encodeURIComponent(value);if(this.options.domain){value+="; domain="+this.options.domain;}if(this.options.path){value+="; path="+this.options.path;}if(this.options.duration){var date=new Date();date.setTime(date.getTime()+this.options.duration*24*60*60*1000);value+="; expires="+date.toGMTString();}if(this.options.secure){value+="; secure";}this.options.document.cookie=this.key+"="+value;return this;},read:function(){var value=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");return(value)?decodeURIComponent(value[1]):null;},dispose:function(){new Cookie(this.key,$merge(this.options,{duration:-1})).write("");return this;}});Cookie.write=function(key,value,options){return new Cookie(key,options).write(value);};Cookie.read=function(key){return new Cookie(key).read();};Cookie.dispose=function(key,options){return new Cookie(key,options).dispose();};var Swiff=new Class({Implements:[Options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"transparent",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object;},initialize:function(path,options){this.instance="Swiff_"+$time();this.setOptions(options);options=this.options;var id=this.id=options.id||this.instance;var container=document.id(options.container);Swiff.CallBacks[this.instance]={};var params=options.params,vars=options.vars,callBacks=options.callBacks;var properties=$extend({height:options.height,width:options.width},options.properties);var self=this;for(var callBack in callBacks){Swiff.CallBacks[this.instance][callBack]=(function(option){return function(){return option.apply(self.object,arguments);};})(callBacks[callBack]);vars[callBack]="Swiff.CallBacks."+this.instance+"."+callBack;}params.flashVars=Hash.toQueryString(vars);if(Browser.Engine.trident){properties.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";params.movie=path;}else{properties.type="application/x-shockwave-flash";properties.data=path;}var build='<object id="'+id+'"';for(var property in properties){build+=" "+property+'="'+properties[property]+'"';}build+=">";for(var param in params){if(params[param]){build+='<param name="'+param+'" value="'+params[param]+'" />';}}build+="</object>";this.object=((container)?container.empty():new Element("div")).set("html",build).firstChild;},replaces:function(element){element=document.id(element,true);element.parentNode.replaceChild(this.toElement(),element);return this;},inject:function(element){document.id(element,true).appendChild(this.toElement());return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].extend(arguments));}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction('<invoke name="'+fn+'" returntype="javascript">'+__flash__argumentsToXML(arguments,2)+"</invoke>");return eval(rs);};var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(options){this.subject=this.subject||this;this.setOptions(options);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var wait=this.options.wait;if(wait===false){this.options.link="cancel";}},getTransition:function(){return function(p){return -(Math.cos(Math.PI*p)-1)/2;};},step:function(){var time=$time();if(time<this.time+this.options.duration){var delta=this.transition((time-this.time)/this.options.duration);this.set(this.compute(this.from,this.to,delta));}else{this.set(this.compute(this.from,this.to,1));this.complete();}},set:function(now){return now;},compute:function(from,to,delta){return Fx.compute(from,to,delta);},check:function(){if(!this.timer){return true;}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false;}return false;},start:function(from,to){if(!this.check(from,to)){return this;}this.from=from;this.to=to;this.time=0;this.transition=this.getTransition();this.startTimer();this.onStart();return this;},complete:function(){if(this.stopTimer()){this.onComplete();}return this;},cancel:function(){if(this.stopTimer()){this.onCancel();}return this;},onStart:function(){this.fireEvent("start",this.subject);},onComplete:function(){this.fireEvent("complete",this.subject);if(!this.callChain()){this.fireEvent("chainComplete",this.subject);}},onCancel:function(){this.fireEvent("cancel",this.subject).clearChain();},pause:function(){this.stopTimer();return this;},resume:function(){this.startTimer();return this;},stopTimer:function(){if(!this.timer){return false;}this.time=$time()-this.time;this.timer=$clear(this.timer);return true;},startTimer:function(){if(this.timer){return false;}this.time=$time()-this.time;this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);return true;}});Fx.compute=function(from,to,delta){return(to-from)*delta+from;};Fx.Durations={"short":250,"normal":500,"long":1000};Fx.CSS=new Class({Extends:Fx,prepare:function(element,property,values){values=$splat(values);var values1=values[1];if(!$chk(values1)){values[1]=values[0];values[0]=element.getStyle(property);}var parsed=values.map(this.parse);return{from:parsed[0],to:parsed[1]};},parse:function(value){value=$lambda(value)();value=(typeof value=="string")?value.split(" "):$splat(value);return value.map(function(val){val=String(val);var found=false;Fx.CSS.Parsers.each(function(parser,key){if(found){return;}var parsed=parser.parse(val);if($chk(parsed)){found={value:parsed,parser:parser};}});found=found||{value:val,parser:Fx.CSS.Parsers.String};return found;});},compute:function(from,to,delta){var computed=[];(Math.min(from.length,to.length)).times(function(i){computed.push({value:from[i].parser.compute(from[i].value,to[i].value,delta),parser:from[i].parser});});computed.$family={name:"fx:css:value"};return computed;},serve:function(value,unit){if($type(value)!="fx:css:value"){value=this.parse(value);}var returned=[];value.each(function(bit){returned=returned.concat(bit.parser.serve(bit.value,unit));});return returned;},render:function(element,property,value,unit){element.setStyle(property,this.serve(value,unit));},search:function(selector){if(Fx.CSS.Cache[selector]){return Fx.CSS.Cache[selector];}var to={};Array.each(document.styleSheets,function(sheet,j){var href=sheet.href;if(href&&href.contains("://")&&!href.contains(document.domain)){return;}var rules=sheet.rules||sheet.cssRules;Array.each(rules,function(rule,i){if(!rule.style){return;}var selectorText=(rule.selectorText)?rule.selectorText.replace(/^\w+/,function(m){return m.toLowerCase();}):null;if(!selectorText||!selectorText.test("^"+selector+"$")){return;}Element.Styles.each(function(value,style){if(!rule.style[style]||Element.ShortStyles[style]){return;}value=String(rule.style[style]);to[style]=(value.test(/^rgb/))?value.rgbToHex():value;});});});return Fx.CSS.Cache[selector]=to;}});Fx.CSS.Cache={};Fx.CSS.Parsers=new Hash({Color:{parse:function(value){if(value.match(/^#[0-9a-f]{3,6}$/i)){return value.hexToRgb(true);}return((value=value.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[value[1],value[2],value[3]]:false;},compute:function(from,to,delta){return from.map(function(value,i){return Math.round(Fx.compute(from[i],to[i],delta));});},serve:function(value){return value.map(Number);}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(value,unit){return(unit)?value+unit:value;}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}});Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(element,options){this.element=this.subject=document.id(element);this.parent(options);},set:function(property,now){if(arguments.length==1){now=property;property=this.property||this.options.property;}this.render(this.element,property,now,this.options.unit);return this;},start:function(property,from,to){if(!this.check(property,from,to)){return this;}var args=Array.flatten(arguments);this.property=this.options.property||args.shift();var parsed=this.prepare(this.element,this.property,args);return this.parent(parsed.from,parsed.to);}});Element.Properties.tween={set:function(options){var tween=this.retrieve("tween");if(tween){tween.cancel();}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},options));},get:function(options){if(options||!this.retrieve("tween")){if(options||!this.retrieve("tween:options")){this.set("tween",options);}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options")));}return this.retrieve("tween");}};Element.implement({tween:function(property,from,to){this.get("tween").start(arguments);return this;},fade:function(how){var fade=this.get("tween"),o="opacity",toggle;how=$pick(how,"toggle");switch(how){case"in":fade.start(o,1);break;case"out":fade.start(o,0);break;case"show":fade.set(o,1);break;case"hide":fade.set(o,0);break;case"toggle":var flag=this.retrieve("fade:flag",this.get("opacity")==1);fade.start(o,(flag)?0:1);this.store("fade:flag",!flag);toggle=true;break;default:fade.start(o,arguments);}if(!toggle){this.eliminate("fade:flag");}return this;},highlight:function(start,end){if(!end){end=this.retrieve("highlight:original",this.getStyle("background-color"));end=(end=="transparent")?"#fff":end;}var tween=this.get("tween");tween.start("background-color",start||"#ffff88",end).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original"));tween.callChain();}.bind(this));return this;}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(element,options){this.element=this.subject=document.id(element);this.parent(options);},set:function(now){if(typeof now=="string"){now=this.search(now);}for(var p in now){this.render(this.element,p,now[p],this.options.unit);}return this;},compute:function(from,to,delta){var now={};for(var p in from){now[p]=this.parent(from[p],to[p],delta);}return now;},start:function(properties){if(!this.check(properties)){return this;}if(typeof properties=="string"){properties=this.search(properties);}var from={},to={};for(var p in properties){var parsed=this.prepare(this.element,p,properties[p]);from[p]=parsed.from;to[p]=parsed.to;}return this.parent(from,to);}});Element.Properties.morph={set:function(options){var morph=this.retrieve("morph");if(morph){morph.cancel();}return this.eliminate("morph").store("morph:options",$extend({link:"cancel"},options));},get:function(options){if(options||!this.retrieve("morph")){if(options||!this.retrieve("morph:options")){this.set("morph",options);}this.store("morph",new Fx.Morph(this,this.retrieve("morph:options")));}return this.retrieve("morph");}};Element.implement({morph:function(props){this.get("morph").start(props);return this;}});Fx.implement({getTransition:function(){var trans=this.options.transition||Fx.Transitions.Sine.easeInOut;if(typeof trans=="string"){var data=trans.split(":");trans=Fx.Transitions;trans=trans[data[0]]||trans[data[0].capitalize()];if(data[1]){trans=trans["ease"+data[1].capitalize()+(data[2]?data[2].capitalize():"")];}}return trans;}});Fx.Transition=function(transition,params){params=$splat(params);return $extend(transition,{easeIn:function(pos){return transition(pos,params);},easeOut:function(pos){return 1-transition(1-pos,params);},easeInOut:function(pos){return(pos<=0.5)?transition(2*pos,params)/2:(2-transition(2*(1-pos),params))/2;}});};Fx.Transitions=new Hash({linear:$arguments(0)});Fx.Transitions.extend=function(transitions){for(var transition in transitions){Fx.Transitions[transition]=new Fx.Transition(transitions[transition]);}};Fx.Transitions.extend({Pow:function(p,x){return Math.pow(p,x[0]||6);},Expo:function(p){return Math.pow(2,8*(p-1));},Circ:function(p){return 1-Math.sin(Math.acos(p));},Sine:function(p){return 1-Math.sin((1-p)*Math.PI/2);},Back:function(p,x){x=x[0]||1.618;return Math.pow(p,2)*((x+1)*p-x);},Bounce:function(p){var value;for(var a=0,b=1;1;a+=b,b/=2){if(p>=(7-4*a)/11){value=b*b-Math.pow((11-6*a-11*p)/4,2);break;}}return value;},Elastic:function(p,x){return Math.pow(2,10*--p)*Math.cos(20*p*Math.PI*(x[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(transition,i){Fx.Transitions[transition]=new Fx.Transition(function(p){return Math.pow(p,[i+2]);});});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest","Accept":"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,noCache:false},initialize:function(options){this.xhr=new Browser.Request();this.setOptions(options);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers);},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return;}this.running=false;this.status=0;$try(function(){this.status=this.xhr.status;}.bind(this));this.xhr.onreadystatechange=$empty;if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML};this.success(this.response.text,this.response.xml);}else{this.response={text:null,xml:null};this.failure();}},isSuccess:function(){return((this.status>=200)&&(this.status<300));},processScripts:function(text){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(text);}return text.stripScripts(this.options.evalScripts);},success:function(text,xml){this.onSuccess(this.processScripts(text),xml);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain();},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},setHeader:function(name,value){this.headers.set(name,value);return this;},getHeader:function(name){return $try(function(){return this.xhr.getResponseHeader(name);}.bind(this));},check:function(){if(!this.running){return true;}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false;}return false;},send:function(options){if(!this.check(options)){return this;}this.running=true;var type=$type(options);if(type=="string"||type=="element"){options={data:options};}var old=this.options;options=$extend({data:old.data,url:old.url,method:old.method},options);var data=options.data,url=String(options.url),method=options.method.toLowerCase();switch($type(data)){case"element":data=document.id(data).toQueryString();break;case"object":case"hash":data=Hash.toQueryString(data);}if(this.options.format){var format="format="+this.options.format;data=(data)?format+"&"+data:format;}if(this.options.emulation&&!["get","post"].contains(method)){var _method="_method="+method;data=(data)?_method+"&"+data:_method;method="post";}if(this.options.urlEncoded&&method=="post"){var encoding=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers.set("Content-type","application/x-www-form-urlencoded"+encoding);}if(this.options.noCache){var noCache="noCache="+new Date().getTime();data=(data)?noCache+"&"+data:noCache;}var trimPosition=url.lastIndexOf("/");if(trimPosition>-1&&(trimPosition=url.indexOf("#"))>-1){url=url.substr(0,trimPosition);}if(data&&method=="get"){url=url+(url.contains("?")?"&":"?")+data;data=null;}this.xhr.open(method.toUpperCase(),url,this.options.async);this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(value,key){try{this.xhr.setRequestHeader(key,value);}catch(e){this.fireEvent("exception",[key,value]);}},this);this.fireEvent("request");this.xhr.send(data);if(!this.options.async){this.onStateChange();}return this;},cancel:function(){if(!this.running){return this;}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});(function(){var methods={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(method){methods[method]=function(){var params=Array.link(arguments,{url:String.type,data:$defined});return this.send($extend(params,{method:method}));};});Request.implement(methods);})();Element.Properties.send={set:function(options){var send=this.retrieve("send");if(send){send.cancel();}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},options));},get:function(options){if(options||!this.retrieve("send")){if(options||!this.retrieve("send:options")){this.set("send",options);}this.store("send",new Request(this.retrieve("send:options")));}return this.retrieve("send");}};Element.implement({send:function(url){var sender=this.get("send");sender.send({data:this,url:url||sender.options.url});return this;}});Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false},processHTML:function(text){var match=text.match(/<body[^>]*>([\s\S]*?)<\/body>/i);text=(match)?match[1]:text;var container=new Element("div");return $try(function(){var root="<root>"+text+"</root>",doc;if(Browser.Engine.trident){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async=false;doc.loadXML(root);}else{doc=new DOMParser().parseFromString(root,"text/xml");}root=doc.getElementsByTagName("root")[0];if(!root){return null;}for(var i=0,k=root.childNodes.length;i<k;i++){var child=Element.clone(root.childNodes[i],true,true);if(child){container.grab(child);}}return container;})||container.set("html",text);},success:function(text){var options=this.options,response=this.response;response.html=text.stripScripts(function(script){response.javascript=script;});var temp=this.processHTML(response.html);response.tree=temp.childNodes;response.elements=temp.getElements("*");if(options.filter){response.tree=response.elements.filter(options.filter);}if(options.update){document.id(options.update).empty().set("html",response.html);}else{if(options.append){document.id(options.append).adopt(temp.getChildren());}}if(options.evalScripts){$exec(response.javascript);}this.onSuccess(response.tree,response.elements,response.html,response.javascript);}});Element.Properties.load={set:function(options){var load=this.retrieve("load");if(load){load.cancel();}return this.eliminate("load").store("load:options",$extend({data:this,link:"cancel",update:this,method:"get"},options));},get:function(options){if(options||!this.retrieve("load")){if(options||!this.retrieve("load:options")){this.set("load",options);}this.store("load",new Request.HTML(this.retrieve("load:options")));}return this.retrieve("load");}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Object.type,url:String.type}));return this;}});Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(options){this.parent(options);this.headers.extend({"Accept":"application/json","X-Request":"JSON"});},success:function(text){this.response.json=JSON.decode(text,this.options.secure);this.onSuccess(this.response.json,text);}});MooTools.More={"version":"1.2.4.2","build":"bd5a93c0913cce25917c48cbdacde568e15e02ef"};(function(){var data={language:"en-US",languages:{"en-US":{}},cascades:["en-US"]};var cascaded;MooTools.lang=new Events();$extend(MooTools.lang,{setLanguage:function(lang){if(!data.languages[lang]){return this;}data.language=lang;this.load();this.fireEvent("langChange",lang);return this;},load:function(){var langs=this.cascade(this.getCurrentLanguage());cascaded={};$each(langs,function(set,setName){cascaded[setName]=this.lambda(set);},this);},getCurrentLanguage:function(){return data.language;},addLanguage:function(lang){data.languages[lang]=data.languages[lang]||{};return this;},cascade:function(lang){var cascades=(data.languages[lang]||{}).cascades||[];cascades.combine(data.cascades);cascades.erase(lang).push(lang);var langs=cascades.map(function(lng){return data.languages[lng];},this);return $merge.apply(this,langs);},lambda:function(set){(set||{}).get=function(key,args){return $lambda(set[key]).apply(this,$splat(args));};return set;},get:function(set,key,args){if(cascaded&&cascaded[set]){return(key?cascaded[set].get(key,args):cascaded[set]);}},set:function(lang,set,members){this.addLanguage(lang);langData=data.languages[lang];if(!langData[set]){langData[set]={};}$extend(langData[set],members);if(lang==this.getCurrentLanguage()){this.load();this.fireEvent("langChange",lang);}return this;},list:function(){return Hash.getKeys(data.languages);}});})();(function(){var global=this;var log=function(){if(global.console&&console.log){try{console.log.apply(console,arguments);}catch(e){console.log(Array.slice(arguments));}}else{Log.logged.push(arguments);}return this;};var disabled=function(){this.logged.push(arguments);return this;};this.Log=new Class({logged:[],log:disabled,resetLog:function(){this.logged.empty();return this;},enableLog:function(){this.log=log;this.logged.each(function(args){this.log.apply(this,args);},this);return this.resetLog();},disableLog:function(){this.log=disabled;return this;}});Log.extend(new Log).enableLog();Log.logger=function(){return this.log.apply(this,arguments);};})();Class.Mutators.Binds=function(binds){return binds;};Class.Mutators.initialize=function(initialize){return function(){$splat(this.Binds).each(function(name){var original=this[name];if(original){this[name]=original.bind(this);}},this);return initialize.apply(this,arguments);};};Class.Occlude=new Class({occlude:function(property,element){element=document.id(element||this.element);var instance=element.retrieve(property||this.property);if(instance&&!$defined(this.occluded)){return this.occluded=instance;}this.occluded=false;element.store(property||this.property,this);return this.occluded;}});(function(){var wait={wait:function(duration){return this.chain(function(){this.callChain.delay($pick(duration,500),this);}.bind(this));}};Chain.implement(wait);if(window.Fx){Fx.implement(wait);["Css","Tween","Elements"].each(function(cls){if(Fx[cls]){Fx[cls].implement(wait);}});}Element.implement({chains:function(effects){$splat($pick(effects,["tween","morph","reveal"])).each(function(effect){effect=this.get(effect);if(!effect){return;}effect.setOptions({link:"chain"});},this);return this;},pauseFx:function(duration,effect){this.chains(effect).get($pick(effect,"tween")).wait(duration);return this;}});})();(function(){var Date=this.Date;if(!Date.now){Date.now=$time;}Date.Methods={ms:"Milliseconds",year:"FullYear",min:"Minutes",mo:"Month",sec:"Seconds",hr:"Hours"};["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds","Time","TimezoneOffset","Week","Timezone","GMTOffset","DayOfYear","LastMonth","LastDayOfMonth","UTCDate","UTCDay","UTCFullYear","AMPM","Ordinal","UTCHours","UTCMilliseconds","UTCMinutes","UTCMonth","UTCSeconds"].each(function(method){Date.Methods[method.toLowerCase()]=method;});var pad=function(what,length){return new Array(length-String(what).length+1).join("0")+what;};Date.implement({set:function(prop,value){switch($type(prop)){case"object":for(var p in prop){this.set(p,prop[p]);}break;case"string":prop=prop.toLowerCase();var m=Date.Methods;if(m[prop]){this["set"+m[prop]](value);}}return this;},get:function(prop){prop=prop.toLowerCase();var m=Date.Methods;if(m[prop]){return this["get"+m[prop]]();}return null;},clone:function(){return new Date(this.get("time"));},increment:function(interval,times){interval=interval||"day";times=$pick(times,1);switch(interval){case"year":return this.increment("month",times*12);case"month":var d=this.get("date");this.set("date",1).set("mo",this.get("mo")+times);return this.set("date",d.min(this.get("lastdayofmonth")));case"week":return this.increment("day",times*7);case"day":return this.set("date",this.get("date")+times);}if(!Date.units[interval]){throw new Error(interval+" is not a supported interval");}return this.set("time",this.get("time")+times*Date.units[interval]());},decrement:function(interval,times){return this.increment(interval,-1*$pick(times,1));},isLeapYear:function(){return Date.isLeapYear(this.get("year"));},clearTime:function(){return this.set({hr:0,min:0,sec:0,ms:0});},diff:function(date,resolution){if($type(date)=="string"){date=Date.parse(date);}return((date-this)/Date.units[resolution||"day"](3,3)).toInt();},getLastDayOfMonth:function(){return Date.daysInMonth(this.get("mo"),this.get("year"));},getDayOfYear:function(){return(Date.UTC(this.get("year"),this.get("mo"),this.get("date")+1)-Date.UTC(this.get("year"),0,1))/Date.units.day();},getWeek:function(){return(this.get("dayofyear")/7).ceil();},getOrdinal:function(day){return Date.getMsg("ordinal",day||this.get("date"));},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3");},getGMTOffset:function(){var off=this.get("timezoneOffset");return((off>0)?"-":"+")+pad((off.abs()/60).floor(),2)+pad(off%60,2);},setAMPM:function(ampm){ampm=ampm.toUpperCase();var hr=this.get("hr");if(hr>11&&ampm=="AM"){return this.decrement("hour",12);}else{if(hr<12&&ampm=="PM"){return this.increment("hour",12);}}return this;},getAMPM:function(){return(this.get("hr")<12)?"AM":"PM";},parse:function(str){this.set("time",Date.parse(str));return this;},isValid:function(date){return !!(date||this).valueOf();},format:function(f){if(!this.isValid()){return"invalid date";}f=f||"%x %X";f=formats[f.toLowerCase()]||f;var d=this;return f.replace(/%([a-z%])/gi,function($0,$1){switch($1){case"a":return Date.getMsg("days")[d.get("day")].substr(0,3);case"A":return Date.getMsg("days")[d.get("day")];case"b":return Date.getMsg("months")[d.get("month")].substr(0,3);case"B":return Date.getMsg("months")[d.get("month")];case"c":return d.toString();case"d":return pad(d.get("date"),2);case"D":return d.get("date");case"H":return pad(d.get("hr"),2);case"I":return((d.get("hr")%12)||12);case"j":return pad(d.get("dayofyear"),3);case"m":return pad((d.get("mo")+1),2);case"M":return pad(d.get("min"),2);case"o":return d.get("ordinal");case"p":return Date.getMsg(d.get("ampm"));case"S":return pad(d.get("seconds"),2);case"U":return pad(d.get("week"),2);case"w":return d.get("day");case"x":return d.format(Date.getMsg("shortDate"));case"X":return d.format(Date.getMsg("shortTime"));case"y":return d.get("year").toString().substr(2);case"Y":return d.get("year");case"T":return d.get("GMTOffset");case"Z":return d.get("Timezone");}return $1;});},toISOString:function(){return this.format("iso8601");}});Date.alias("toISOString","toJSON");Date.alias("diff","compare");Date.alias("format","strftime");var formats={db:"%Y-%m-%d %H:%M:%S",compact:"%Y%m%dT%H%M%S",iso8601:"%Y-%m-%dT%H:%M:%S%T",rfc822:"%a, %d %b %Y %H:%M:%S %Z","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M"};var parsePatterns=[];var nativeParse=Date.parse;var parseWord=function(type,word,num){var ret=-1;var translated=Date.getMsg(type+"s");switch($type(word)){case"object":ret=translated[word.get(type)];break;case"number":ret=translated[month-1];if(!ret){throw new Error("Invalid "+type+" index: "+index);}break;case"string":var match=translated.filter(function(name){return this.test(name);},new RegExp("^"+word,"i"));if(!match.length){throw new Error("Invalid "+type+" string");}if(match.length>1){throw new Error("Ambiguous "+type);}ret=match[0];}return(num)?translated.indexOf(ret):ret;};Date.extend({getMsg:function(key,args){return MooTools.lang.get("Date",key,args);},units:{ms:$lambda(1),second:$lambda(1000),minute:$lambda(60000),hour:$lambda(3600000),day:$lambda(86400000),week:$lambda(608400000),month:function(month,year){var d=new Date;return Date.daysInMonth($pick(month,d.get("mo")),$pick(year,d.get("year")))*86400000;},year:function(year){year=year||new Date().get("year");return Date.isLeapYear(year)?31622400000:31536000000;}},daysInMonth:function(month,year){return[31,Date.isLeapYear(year)?29:28,31,30,31,30,31,31,30,31,30,31][month];},isLeapYear:function(year){return((year%4===0)&&(year%100!==0))||(year%400===0);},parse:function(from){var t=$type(from);if(t=="number"){return new Date(from);}if(t!="string"){return from;}from=from.clean();if(!from.length){return null;}var parsed;parsePatterns.some(function(pattern){var bits=pattern.re.exec(from);return(bits)?(parsed=pattern.handler(bits)):false;});return parsed||new Date(nativeParse(from));},parseDay:function(day,num){return parseWord("day",day,num);},parseMonth:function(month,num){return parseWord("month",month,num);},parseUTC:function(value){var localDate=new Date(value);var utcSeconds=Date.UTC(localDate.get("year"),localDate.get("mo"),localDate.get("date"),localDate.get("hr"),localDate.get("min"),localDate.get("sec"));return new Date(utcSeconds);},orderIndex:function(unit){return Date.getMsg("dateOrder").indexOf(unit)+1;},defineFormat:function(name,format){formats[name]=format;},defineFormats:function(formats){for(var name in formats){Date.defineFormat(name,formats[name]);}},parsePatterns:parsePatterns,defineParser:function(pattern){parsePatterns.push((pattern.re&&pattern.handler)?pattern:build(pattern));},defineParsers:function(){Array.flatten(arguments).each(Date.defineParser);},define2DigitYearStart:function(year){startYear=year%100;startCentury=year-startYear;}});var startCentury=1900;var startYear=70;var regexOf=function(type){return new RegExp("(?:"+Date.getMsg(type).map(function(name){return name.substr(0,3);}).join("|")+")[a-z]*");};var replacers=function(key){switch(key){case"x":return((Date.orderIndex("month")==1)?"%m[.-/]%d":"%d[.-/]%m")+"([.-/]%y)?";case"X":return"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%T?";}return null;};var keys={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\d/,s:/\d+/,o:/[a-z]*/,p:/[ap]\.?m\.?/,y:/\d{2}|\d{4}/,Y:/\d{4}/,T:/Z|[+-]\d{2}(?::?\d{2})?/};keys.m=keys.I;keys.S=keys.M;var currentLanguage;var recompile=function(language){currentLanguage=language;keys.a=keys.A=regexOf("days");keys.b=keys.B=regexOf("months");parsePatterns.each(function(pattern,i){if(pattern.format){parsePatterns[i]=build(pattern.format);}});};var build=function(format){if(!currentLanguage){return{format:format};}var parsed=[];var re=(format.source||format).replace(/%([a-z])/gi,function($0,$1){return replacers($1)||$0;}).replace(/\((?!\?)/g,"(?:").replace(/ (?!\?|\*)/g,",? ").replace(/%([a-z%])/gi,function($0,$1){var p=keys[$1];if(!p){return $1;}parsed.push($1);return"("+p.source+")";}).replace(/\[a-z\]/gi,"[a-z\\u00c0-\\uffff]");return{format:format,re:new RegExp("^"+re+"$","i"),handler:function(bits){bits=bits.slice(1).associate(parsed);var date=new Date().clearTime();if("d" in bits){handle.call(date,"d",1);}if("m" in bits){handle.call(date,"m",1);}for(var key in bits){handle.call(date,key,bits[key]);}return date;}};};var handle=function(key,value){if(!value){return this;}switch(key){case"a":case"A":return this.set("day",Date.parseDay(value,true));case"b":case"B":return this.set("mo",Date.parseMonth(value,true));case"d":return this.set("date",value);case"H":case"I":return this.set("hr",value);case"m":return this.set("mo",value-1);case"M":return this.set("min",value);case"p":return this.set("ampm",value.replace(/\./g,""));case"S":return this.set("sec",value);case"s":return this.set("ms",("0."+value)*1000);case"w":return this.set("day",value);case"Y":return this.set("year",value);case"y":value=+value;if(value<100){value+=startCentury+(value<startYear?100:0);}return this.set("year",value);case"T":if(value=="Z"){value="+00";}var offset=value.match(/([+-])(\d{2}):?(\d{2})?/);offset=(offset[1]+"1")*(offset[2]*60+(+offset[3]||0))+this.getTimezoneOffset();return this.set("time",this-offset*60000);}return this;};Date.defineParsers("%Y([-./]%m([-./]%d((T| )%X)?)?)?","%Y%m%d(T%H(%M%S?)?)?","%x( %X)?","%d%o( %b( %Y)?)?( %X)?","%b( %d%o)?( %Y)?( %X)?","%Y %b( %d%o( %X)?)?","%o %b %d %X %T %Y");MooTools.lang.addEvent("langChange",function(language){if(MooTools.lang.get("Date")){recompile(language);}}).fireEvent("langChange",MooTools.lang.getCurrentLanguage());})();Date.implement({timeDiffInWords:function(relative_to){return Date.distanceOfTimeInWords(this,relative_to||new Date);},timeDiff:function(to,joiner){if(to==null){to=new Date;}var delta=((to-this)/1000).toInt();if(!delta){return"0s";}var durations={s:60,m:60,h:24,d:365,y:0};var duration,vals=[];for(var step in durations){if(!delta){break;}if((duration=durations[step])){vals.unshift((delta%duration)+step);delta=(delta/duration).toInt();}else{vals.unshift(delta+step);}}return vals.join(joiner||":");}});Date.alias("timeDiffInWords","timeAgoInWords");Date.extend({distanceOfTimeInWords:function(from,to){return Date.getTimePhrase(((to-from)/1000).toInt());},getTimePhrase:function(delta){var suffix=(delta<0)?"Until":"Ago";if(delta<0){delta*=-1;}var units={minute:60,hour:60,day:24,week:7,month:52/12,year:12,eon:Infinity};var msg="lessThanMinute";for(var unit in units){var interval=units[unit];if(delta<1.5*interval){if(delta>0.75*interval){msg=unit;}break;}delta/=interval;msg=unit+"s";}return Date.getMsg(msg+suffix).substitute({delta:delta.round()});}});Date.defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(bits){var d=new Date().clearTime();switch(bits[0]){case"tom":return d.increment();case"yes":return d.decrement();default:return d;}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(bits){var d=new Date().clearTime();var day=d.getDay();var newDay=Date.parseDay(bits[2],true);var addDays=newDay-day;if(newDay<=day){addDays+=7;}if(bits[1]=="last"){addDays-=7;}return d.set("date",d.getDate()+addDays);}});Hash.implement({getFromPath:function(notation){var source=this.getClean();notation.replace(/\[([^\]]+)\]|\.([^.[]+)|[^[.]+/g,function(match){if(!source){return null;}var prop=arguments[2]||arguments[1]||arguments[0];source=(prop in source)?source[prop]:null;return match;});return source;},cleanValues:function(method){method=method||$defined;this.each(function(v,k){if(!method(v)){this.erase(k);}},this);return this;},run:function(){var args=arguments;this.each(function(v,k){if($type(v)=="function"){v.run(args);}});}});Element.implement({tidy:function(){this.set("value",this.get("value").tidy());},getTextInRange:function(start,end){return this.get("value").substring(start,end);},getSelectedText:function(){if(this.setSelectionRange){return this.getTextInRange(this.getSelectionStart(),this.getSelectionEnd());}return document.selection.createRange().text;},getSelectedRange:function(){if($defined(this.selectionStart)){return{start:this.selectionStart,end:this.selectionEnd};}var pos={start:0,end:0};var range=this.getDocument().selection.createRange();if(!range||range.parentElement()!=this){return pos;}var dup=range.duplicate();if(this.type=="text"){pos.start=0-dup.moveStart("character",-100000);pos.end=pos.start+range.text.length;}else{var value=this.get("value");var offset=value.length;dup.moveToElementText(this);dup.setEndPoint("StartToEnd",range);if(dup.text.length){offset-=value.match(/[\n\r]*$/)[0].length;}pos.end=offset-dup.text.length;dup.setEndPoint("StartToStart",range);pos.start=offset-dup.text.length;}return pos;},getSelectionStart:function(){return this.getSelectedRange().start;},getSelectionEnd:function(){return this.getSelectedRange().end;},setCaretPosition:function(pos){if(pos=="end"){pos=this.get("value").length;}this.selectRange(pos,pos);return this;},getCaretPosition:function(){return this.getSelectedRange().start;},selectRange:function(start,end){if(this.setSelectionRange){this.focus();this.setSelectionRange(start,end);}else{var value=this.get("value");var diff=value.substr(start,end-start).replace(/\r/g,"").length;start=value.substr(0,start).replace(/\r/g,"").length;var range=this.createTextRange();range.collapse(true);range.moveEnd("character",start+diff);range.moveStart("character",start);range.select();}return this;},insertAtCursor:function(value,select){var pos=this.getSelectedRange();var text=this.get("value");this.set("value",text.substring(0,pos.start)+value+text.substring(pos.end,text.length));if($pick(select,true)){this.selectRange(pos.start,pos.start+value.length);}else{this.setCaretPosition(pos.start+value.length);}return this;},insertAroundCursor:function(options,select){options=$extend({before:"",defaultMiddle:"",after:""},options);var value=this.getSelectedText()||options.defaultMiddle;var pos=this.getSelectedRange();var text=this.get("value");if(pos.start==pos.end){this.set("value",text.substring(0,pos.start)+options.before+value+options.after+text.substring(pos.end,text.length));this.selectRange(pos.start+options.before.length,pos.end+options.before.length+value.length);}else{var current=text.substring(pos.start,pos.end);this.set("value",text.substring(0,pos.start)+options.before+current+options.after+text.substring(pos.end,text.length));var selStart=pos.start+options.before.length;if($pick(select,true)){this.selectRange(selStart,selStart+current.length);}else{this.setCaretPosition(selStart+text.length);}}return this;}});(function(){var match=/(.*?):relay\(([^)]+)\)$/,combinators=/[+>~\s]/,splitType=function(type){var bits=type.match(match);return !bits?{event:type}:{event:bits[1],selector:bits[2]};},check=function(e,selector){var t=e.target;if(combinators.test(selector=selector.trim())){var els=this.getElements(selector);for(var i=els.length;i--;){var el=els[i];if(t==el||el.hasChild(t)){return el;}}}else{for(;t&&t!=this;t=t.parentNode){if(Element.match(t,selector)){return document.id(t);}}}return null;};var oldAddEvent=Element.prototype.addEvent,oldRemoveEvent=Element.prototype.removeEvent;Element.implement({addEvent:function(type,fn){var splitted=splitType(type);if(splitted.selector){var monitors=this.retrieve("$moo:delegateMonitors",{});if(!monitors[type]){var monitor=function(e){var el=check.call(this,e,splitted.selector);if(el){this.fireEvent(type,[e,el],0,el);}}.bind(this);monitors[type]=monitor;oldAddEvent.call(this,splitted.event,monitor);}}return oldAddEvent.apply(this,arguments);},removeEvent:function(type,fn){var splitted=splitType(type);if(splitted.selector){var events=this.retrieve("events");if(!events||!events[type]||(fn&&!events[type].keys.contains(fn))){return this;}if(fn){oldRemoveEvent.apply(this,[type,fn]);}else{oldRemoveEvent.apply(this,type);}events=this.retrieve("events");if(events&&events[type]&&events[type].length==0){var monitors=this.retrieve("$moo:delegateMonitors",{});oldRemoveEvent.apply(this,[splitted.event,monitors[type]]);delete monitors[type];}return this;}return oldRemoveEvent.apply(this,arguments);},fireEvent:function(type,args,delay,bind){var events=this.retrieve("events");if(!events||!events[type]){return this;}events[type].keys.each(function(fn){fn.create({bind:bind||this,delay:delay,arguments:args})();},this);return this;}});})();Element.implement({measure:function(fn){var vis=function(el){return !!(!el||el.offsetHeight||el.offsetWidth);};if(vis(this)){return fn.apply(this);}var parent=this.getParent(),restorers=[],toMeasure=[];while(!vis(parent)&&parent!=document.body){toMeasure.push(parent.expose());parent=parent.getParent();}var restore=this.expose();var result=fn.apply(this);restore();toMeasure.each(function(restore){restore();});return result;},expose:function(){if(this.getStyle("display")!="none"){return $empty;}var before=this.style.cssText;this.setStyles({display:"block",position:"absolute",visibility:"hidden"});return function(){this.style.cssText=before;}.bind(this);},getDimensions:function(options){options=$merge({computeSize:false},options);var dim={};var getSize=function(el,options){return(options.computeSize)?el.getComputedSize(options):el.getSize();};var parent=this.getParent("body");if(parent&&this.getStyle("display")=="none"){dim=this.measure(function(){return getSize(this,options);});}else{if(parent){try{dim=getSize(this,options);}catch(e){}}else{dim={x:0,y:0};}}return $chk(dim.x)?$extend(dim,{width:dim.x,height:dim.y}):$extend(dim,{x:dim.width,y:dim.height});},getComputedSize:function(options){options=$merge({styles:["padding","border"],plains:{height:["top","bottom"],width:["left","right"]},mode:"both"},options);var size={width:0,height:0};switch(options.mode){case"vertical":delete size.width;delete options.plains.width;break;case"horizontal":delete size.height;delete options.plains.height;break;}var getStyles=[];$each(options.plains,function(plain,key){plain.each(function(edge){options.styles.each(function(style){getStyles.push((style=="border")?style+"-"+edge+"-"+"width":style+"-"+edge);});});});var styles={};getStyles.each(function(style){styles[style]=this.getComputedStyle(style);},this);var subtracted=[];$each(options.plains,function(plain,key){var capitalized=key.capitalize();size["total"+capitalized]=size["computed"+capitalized]=0;plain.each(function(edge){size["computed"+edge.capitalize()]=0;getStyles.each(function(style,i){if(style.test(edge)){styles[style]=styles[style].toInt()||0;size["total"+capitalized]=size["total"+capitalized]+styles[style];size["computed"+edge.capitalize()]=size["computed"+edge.capitalize()]+styles[style];}if(style.test(edge)&&key!=style&&(style.test("border")||style.test("padding"))&&!subtracted.contains(style)){subtracted.push(style);size["computed"+capitalized]=size["computed"+capitalized]-styles[style];}});});});["Width","Height"].each(function(value){var lower=value.toLowerCase();if(!$chk(size[lower])){return;}size[lower]=size[lower]+this["offset"+value]+size["computed"+value];size["total"+value]=size[lower]+size["total"+value];delete size["computed"+value];},this);return $extend(styles,size);}});(function(){var original=Element.prototype.position;Element.implement({position:function(options){if(options&&($defined(options.x)||$defined(options.y))){return original?original.apply(this,arguments):this;}$each(options||{},function(v,k){if(!$defined(v)){delete options[k];}});options=$merge({relativeTo:document.body,position:{x:"center",y:"center"},edge:false,offset:{x:0,y:0},returnPos:false,relFixedPosition:false,ignoreMargins:false,ignoreScroll:false,allowNegative:false},options);var parentOffset={x:0,y:0},parentPositioned=false;var offsetParent=this.measure(function(){return document.id(this.getOffsetParent());});if(offsetParent&&offsetParent!=this.getDocument().body){parentOffset=offsetParent.measure(function(){return this.getPosition();});parentPositioned=offsetParent!=document.id(options.relativeTo);options.offset.x=options.offset.x-parentOffset.x;options.offset.y=options.offset.y-parentOffset.y;}var fixValue=function(option){if($type(option)!="string"){return option;}option=option.toLowerCase();var val={};if(option.test("left")){val.x="left";}else{if(option.test("right")){val.x="right";}else{val.x="center";}}if(option.test("upper")||option.test("top")){val.y="top";}else{if(option.test("bottom")){val.y="bottom";}else{val.y="center";}}return val;};options.edge=fixValue(options.edge);options.position=fixValue(options.position);if(!options.edge){if(options.position.x=="center"&&options.position.y=="center"){options.edge={x:"center",y:"center"};}else{options.edge={x:"left",y:"top"};}}this.setStyle("position","absolute");var rel=document.id(options.relativeTo)||document.body,calc=rel==document.body?window.getScroll():rel.getPosition(),top=calc.y,left=calc.x;var scrolls=rel.getScrolls();top+=scrolls.y;left+=scrolls.x;var dim=this.getDimensions({computeSize:true,styles:["padding","border","margin"]});var pos={},prefY=options.offset.y,prefX=options.offset.x,winSize=window.getSize();switch(options.position.x){case"left":pos.x=left+prefX;break;case"right":pos.x=left+prefX+rel.offsetWidth;break;default:pos.x=left+((rel==document.body?winSize.x:rel.offsetWidth)/2)+prefX;break;}switch(options.position.y){case"top":pos.y=top+prefY;break;case"bottom":pos.y=top+prefY+rel.offsetHeight;break;default:pos.y=top+((rel==document.body?winSize.y:rel.offsetHeight)/2)+prefY;break;}if(options.edge){var edgeOffset={};switch(options.edge.x){case"left":edgeOffset.x=0;break;case"right":edgeOffset.x=-dim.x-dim.computedRight-dim.computedLeft;break;default:edgeOffset.x=-(dim.totalWidth/2);break;}switch(options.edge.y){case"top":edgeOffset.y=0;break;case"bottom":edgeOffset.y=-dim.y-dim.computedTop-dim.computedBottom;break;default:edgeOffset.y=-(dim.totalHeight/2);break;}pos.x+=edgeOffset.x;pos.y+=edgeOffset.y;}pos={left:((pos.x>=0||parentPositioned||options.allowNegative)?pos.x:0).toInt(),top:((pos.y>=0||parentPositioned||options.allowNegative)?pos.y:0).toInt()};var xy={left:"x",top:"y"};["minimum","maximum"].each(function(minmax){["left","top"].each(function(lr){var val=options[minmax]?options[minmax][xy[lr]]:null;if(val!=null&&pos[lr]<val){pos[lr]=val;}});});if(rel.getStyle("position")=="fixed"||options.relFixedPosition){var winScroll=window.getScroll();pos.top+=winScroll.y;pos.left+=winScroll.x;}if(options.ignoreScroll){var relScroll=rel.getScroll();pos.top-=relScroll.y;pos.left-=relScroll.x;}if(options.ignoreMargins){pos.left+=(options.edge.x=="right"?dim["margin-right"]:options.edge.x=="center"?-dim["margin-left"]+((dim["margin-right"]+dim["margin-left"])/2):-dim["margin-left"]);pos.top+=(options.edge.y=="bottom"?dim["margin-bottom"]:options.edge.y=="center"?-dim["margin-top"]+((dim["margin-bottom"]+dim["margin-top"])/2):-dim["margin-top"]);}pos.left=Math.ceil(pos.left);pos.top=Math.ceil(pos.top);if(options.returnPos){return pos;}else{this.setStyles(pos);}return this;}});})();Element.implement({isDisplayed:function(){return this.getStyle("display")!="none";},isVisible:function(){var w=this.offsetWidth,h=this.offsetHeight;return(w==0&&h==0)?false:(w>0&&h>0)?true:this.isDisplayed();},toggle:function(){return this[this.isDisplayed()?"hide":"show"]();},hide:function(){var d;try{if((d=this.getStyle("display"))=="none"){d=null;}}catch(e){}return this.store("originalDisplay",d||"block").setStyle("display","none");},show:function(display){return this.setStyle("display",display||this.retrieve("originalDisplay")||"block");},swapClass:function(remove,add){return this.removeClass(remove).addClass(add);}});Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(elements,options){this.elements=this.subject=$$(elements);this.parent(options);},compute:function(from,to,delta){var now={};for(var i in from){var iFrom=from[i],iTo=to[i],iNow=now[i]={};for(var p in iFrom){iNow[p]=this.parent(iFrom[p],iTo[p],delta);}}return now;},set:function(now){for(var i in now){var iNow=now[i];for(var p in iNow){this.render(this.elements[i],p,iNow[p],this.options.unit);}}return this;},start:function(obj){if(!this.check(obj)){return this;}var from={},to={};for(var i in obj){var iProps=obj[i],iFrom=from[i]={},iTo=to[i]={};for(var p in iProps){var parsed=this.prepare(this.elements[i],p,iProps[p]);iFrom[p]=parsed.from;iTo[p]=parsed.to;}}return this.parent(from,to);}});Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(element,options){this.element=this.subject=document.id(element);this.parent(options);var cancel=this.cancel.bind(this,false);if($type(this.element)!="element"){this.element=document.id(this.element.getDocument().body);}var stopper=this.element;if(this.options.wheelStops){this.addEvent("start",function(){stopper.addEvent("mousewheel",cancel);},true);this.addEvent("complete",function(){stopper.removeEvent("mousewheel",cancel);},true);}},set:function(){var now=Array.flatten(arguments);if(Browser.Engine.gecko){now=[Math.round(now[0]),Math.round(now[1])];}this.element.scrollTo(now[0],now[1]);},compute:function(from,to,delta){return[0,1].map(function(i){return Fx.compute(from[i],to[i],delta);});},start:function(x,y){if(!this.check(x,y)){return this;}var scrollSize=this.element.getScrollSize(),scroll=this.element.getScroll(),values={x:x,y:y};for(var z in values){var max=scrollSize[z];if($chk(values[z])){values[z]=($type(values[z])=="number")?values[z]:max;}else{values[z]=scroll[z];}values[z]+=this.options.offset[z];}return this.parent([scroll.x,scroll.y],[values.x,values.y]);},toTop:function(){return this.start(false,0);},toLeft:function(){return this.start(0,false);},toRight:function(){return this.start("right",false);},toBottom:function(){return this.start(false,"bottom");},toElement:function(el){var position=document.id(el).getPosition(this.element);return this.start(position.x,position.y);},scrollIntoView:function(el,axes,offset){axes=axes?$splat(axes):["x","y"];var to={};el=document.id(el);var pos=el.getPosition(this.element);var size=el.getSize();var scroll=this.element.getScroll();var containerSize=this.element.getSize();var edge={x:pos.x+size.x,y:pos.y+size.y};["x","y"].each(function(axis){if(axes.contains(axis)){if(edge[axis]>scroll[axis]+containerSize[axis]){to[axis]=edge[axis]-containerSize[axis];}if(pos[axis]<scroll[axis]){to[axis]=pos[axis];}}if(to[axis]==null){to[axis]=scroll[axis];}if(offset&&offset[axis]){to[axis]=to[axis]+offset[axis];}},this);if(to.x!=scroll.x||to.y!=scroll.y){this.start(to.x,to.y);}return this;},scrollToCenter:function(el,axes,offset){axes=axes?$splat(axes):["x","y"];el=$(el);var to={},pos=el.getPosition(this.element),size=el.getSize(),scroll=this.element.getScroll(),containerSize=this.element.getSize(),edge={x:pos.x+size.x,y:pos.y+size.y};["x","y"].each(function(axis){if(axes.contains(axis)){to[axis]=pos[axis]-(containerSize[axis]-size[axis])/2;}if(to[axis]==null){to[axis]=scroll[axis];}if(offset&&offset[axis]){to[axis]=to[axis]+offset[axis];}},this);if(to.x!=scroll.x||to.y!=scroll.y){this.start(to.x,to.y);}return this;}});Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical",hideOverflow:true},initialize:function(element,options){this.addEvent("complete",function(){this.open=(this.wrapper["offset"+this.layout.capitalize()]!=0);if(this.open&&Browser.Engine.webkit419){this.element.dispose().inject(this.wrapper);}},true);this.element=this.subject=document.id(element);this.parent(options);var wrapper=this.element.retrieve("wrapper");var styles=this.element.getStyles("margin","position","overflow");if(this.options.hideOverflow){styles=$extend(styles,{overflow:"hidden"});}this.wrapper=wrapper||new Element("div",{styles:styles}).wraps(this.element);this.element.store("wrapper",this.wrapper).setStyle("margin",0);this.now=[];this.open=true;},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight;},horizontal:function(){this.margin="margin-left";this.layout="width";this.offset=this.element.offsetWidth;},set:function(now){this.element.setStyle(this.margin,now[0]);this.wrapper.setStyle(this.layout,now[1]);return this;},compute:function(from,to,delta){return[0,1].map(function(i){return Fx.compute(from[i],to[i],delta);});},start:function(how,mode){if(!this.check(how,mode)){return this;}this[mode||this.options.mode]();var margin=this.element.getStyle(this.margin).toInt();var layout=this.wrapper.getStyle(this.layout).toInt();var caseIn=[[margin,layout],[0,this.offset]];var caseOut=[[margin,layout],[-this.offset,0]];var start;switch(how){case"in":start=caseIn;break;case"out":start=caseOut;break;case"toggle":start=(layout==0)?caseIn:caseOut;}return this.parent(start[0],start[1]);},slideIn:function(mode){return this.start("in",mode);},slideOut:function(mode){return this.start("out",mode);},hide:function(mode){this[mode||this.options.mode]();this.open=false;return this.set([-this.offset,0]);},show:function(mode){this[mode||this.options.mode]();this.open=true;return this.set([0,this.offset]);},toggle:function(mode){return this.start("toggle",mode);}});Element.Properties.slide={set:function(options){var slide=this.retrieve("slide");if(slide){slide.cancel();}return this.eliminate("slide").store("slide:options",$extend({link:"cancel"},options));},get:function(options){if(options||!this.retrieve("slide")){if(options||!this.retrieve("slide:options")){this.set("slide",options);}this.store("slide",new Fx.Slide(this,this.retrieve("slide:options")));}return this.retrieve("slide");}};Element.implement({slide:function(how,mode){how=how||"toggle";var slide=this.get("slide"),toggle;switch(how){case"hide":slide.hide(mode);break;case"show":slide.show(mode);break;case"toggle":var flag=this.retrieve("slide:flag",slide.open);slide[flag?"slideOut":"slideIn"](mode);this.store("slide:flag",!flag);toggle=true;break;default:slide.start(how,mode);}if(!toggle){this.eliminate("slide:flag");}return this;}});var SmoothScroll=Fx.SmoothScroll=new Class({Extends:Fx.Scroll,initialize:function(options,context){context=context||document;this.doc=context.getDocument();var win=context.getWindow();this.parent(this.doc,options);this.links=$$(this.options.links||this.doc.links);var location=win.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(link){if(link.href.indexOf(location)!=0){return;}var anchor=link.href.substr(location.length);if(anchor){this.useLink(link,anchor);}},this);if(!Browser.Engine.webkit419){this.addEvent("complete",function(){win.location.hash=this.anchor;},true);}},useLink:function(link,anchor){var el;link.addEvent("click",function(event){if(el!==false&&!el){el=document.id(anchor)||this.doc.getElement("a[name="+anchor+"]");}if(el){event.preventDefault();this.anchor=anchor;this.toElement(el).chain(function(){this.fireEvent("scrolledTo",[link,el]);}.bind(this));link.blur();}}.bind(this));}});Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:"vertical"},initialize:function(elements,options){this.parent(elements,options);this.elements.each(function(el){if(el.getStyle("position")=="static"){el.setStyle("position","relative");}});this.setDefaultOrder();},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(el,index){return index;});},sort:function(newOrder){if($type(newOrder)!="array"){return false;}var top=0,left=0,next={},zero={},vert=this.options.mode=="vertical";var current=this.elements.map(function(el,index){var size=el.getComputedSize({styles:["border","padding","margin"]});var val;if(vert){val={top:top,margin:size["margin-top"],height:size.totalHeight};top+=val.height-size["margin-top"];}else{val={left:left,margin:size["margin-left"],width:size.totalWidth};left+=val.width;}var plain=vert?"top":"left";zero[index]={};var start=el.getStyle(plain).toInt();zero[index][plain]=start||0;return val;},this);this.set(zero);newOrder=newOrder.map(function(i){return i.toInt();});if(newOrder.length!=this.elements.length){this.currentOrder.each(function(index){if(!newOrder.contains(index)){newOrder.push(index);}});if(newOrder.length>this.elements.length){newOrder.splice(this.elements.length-1,newOrder.length-this.elements.length);}}var margin=top=left=0;newOrder.each(function(item,index){var newPos={};if(vert){newPos.top=top-current[item].top-margin;top+=current[item].height;}else{newPos.left=left-current[item].left;left+=current[item].width;}margin=margin+current[item].margin;next[item]=newPos;},this);var mapped={};$A(newOrder).sort().each(function(index){mapped[index]=next[index];});this.start(mapped);this.currentOrder=newOrder;return this;},rearrangeDOM:function(newOrder){newOrder=newOrder||this.currentOrder;var parent=this.elements[0].getParent();var rearranged=[];this.elements.setStyle("opacity",0);newOrder.each(function(index){rearranged.push(this.elements[index].inject(parent).setStyles({top:0,left:0}));},this);this.elements.setStyle("opacity",1);this.elements=$$(rearranged);this.setDefaultOrder();return this;},getDefaultOrder:function(){return this.elements.map(function(el,index){return index;});},forward:function(){return this.sort(this.getDefaultOrder());},backward:function(){return this.sort(this.getDefaultOrder().reverse());},reverse:function(){return this.sort(this.currentOrder.reverse());},sortByElements:function(elements){return this.sort(elements.map(function(el){return this.elements.indexOf(el);},this));},swap:function(one,two){if($type(one)=="element"){one=this.elements.indexOf(one);}if($type(two)=="element"){two=this.elements.indexOf(two);}var newOrder=$A(this.currentOrder);newOrder[this.currentOrder.indexOf(one)]=two;newOrder[this.currentOrder.indexOf(two)]=one;return this.sort(newOrder);}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,stopPropagation:false,modifiers:{x:"left",y:"top"}},initialize:function(){var params=Array.link(arguments,{"options":Object.type,"element":$defined});this.element=document.id(params.element);this.document=this.element.getDocument();this.setOptions(params.options||{});var htype=$type(this.options.handle);this.handles=((htype=="array"||htype=="collection")?$$(this.options.handle):document.id(this.options.handle))||this.element;this.mouse={"now":{},"pos":{}};this.value={"start":{},"now":{}};this.selection=(Browser.Engine.trident)?"selectstart":"mousedown";this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:$lambda(false)};this.attach();},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this;},detach:function(){this.handles.removeEvent("mousedown",this.bound.start);return this;},start:function(event){if(event.rightClick){return;}if(this.options.preventDefault){event.preventDefault();}if(this.options.stopPropagation){event.stopPropagation();}this.mouse.start=event.page;this.fireEvent("beforeStart",this.element);var limit=this.options.limit;this.limit={x:[],y:[]};for(var z in this.options.modifiers){if(!this.options.modifiers[z]){continue;}if(this.options.style){this.value.now[z]=this.element.getStyle(this.options.modifiers[z]).toInt();}else{this.value.now[z]=this.element[this.options.modifiers[z]];}if(this.options.invert){this.value.now[z]*=-1;}this.mouse.pos[z]=event.page[z]-this.value.now[z];if(limit&&limit[z]){for(var i=2;i--;i){if($chk(limit[z][i])){this.limit[z][i]=$lambda(limit[z][i])();}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid};}this.document.addEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});this.document.addEvent(this.selection,this.bound.eventStop);},check:function(event){if(this.options.preventDefault){event.preventDefault();}var distance=Math.round(Math.sqrt(Math.pow(event.page.x-this.mouse.start.x,2)+Math.pow(event.page.y-this.mouse.start.y,2)));if(distance>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent("start",[this.element,event]).fireEvent("snap",this.element);}},drag:function(event){if(this.options.preventDefault){event.preventDefault();}this.mouse.now=event.page;for(var z in this.options.modifiers){if(!this.options.modifiers[z]){continue;}this.value.now[z]=this.mouse.now[z]-this.mouse.pos[z];if(this.options.invert){this.value.now[z]*=-1;}if(this.options.limit&&this.limit[z]){if($chk(this.limit[z][1])&&(this.value.now[z]>this.limit[z][1])){this.value.now[z]=this.limit[z][1];}else{if($chk(this.limit[z][0])&&(this.value.now[z]<this.limit[z][0])){this.value.now[z]=this.limit[z][0];}}}if(this.options.grid[z]){this.value.now[z]-=((this.value.now[z]-(this.limit[z][0]||0))%this.options.grid[z]);}if(this.options.style){this.element.setStyle(this.options.modifiers[z],this.value.now[z]+this.options.unit);}else{this.element[this.options.modifiers[z]]=this.value.now[z];}}this.fireEvent("drag",[this.element,event]);},cancel:function(event){this.document.removeEvent("mousemove",this.bound.check);this.document.removeEvent("mouseup",this.bound.cancel);if(event){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element);}},stop:function(event){this.document.removeEvent(this.selection,this.bound.eventStop);this.document.removeEvent("mousemove",this.bound.drag);this.document.removeEvent("mouseup",this.bound.stop);if(event){this.fireEvent("complete",[this.element,event]);}}});Element.implement({makeResizable:function(options){var drag=new Drag(this,$merge({modifiers:{x:"width",y:"height"}},options));this.store("resizer",drag);return drag.addEvent("drag",function(){this.fireEvent("resize",drag);}.bind(this));}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false,precalculate:false,includeMargins:true,checkDroppables:true},initialize:function(element,options){this.parent(element,options);element=this.element;this.droppables=$$(this.options.droppables);this.container=document.id(this.options.container);if(this.container&&$type(this.container)!="element"){this.container=document.id(this.container.getDocument().body);}var styles=element.getStyles("left","right","position");if(styles.left=="auto"||styles.top=="auto"){element.setPosition(element.getPosition(element.getOffsetParent()));}if(styles.position=="static"){element.setStyle("position","absolute");}this.addEvent("start",this.checkDroppables,true);this.overed=null;},start:function(event){if(this.container){this.options.limit=this.calculateLimit();}if(this.options.precalculate){this.positions=this.droppables.map(function(el){return el.getCoordinates();});}this.parent(event);},calculateLimit:function(){var offsetParent=this.element.getOffsetParent(),containerCoordinates=this.container.getCoordinates(offsetParent),containerBorder={},elementMargin={},elementBorder={},containerMargin={},offsetParentPadding={};["top","right","bottom","left"].each(function(pad){containerBorder[pad]=this.container.getStyle("border-"+pad).toInt();elementBorder[pad]=this.element.getStyle("border-"+pad).toInt();elementMargin[pad]=this.element.getStyle("margin-"+pad).toInt();containerMargin[pad]=this.container.getStyle("margin-"+pad).toInt();offsetParentPadding[pad]=offsetParent.getStyle("padding-"+pad).toInt();},this);var width=this.element.offsetWidth+elementMargin.left+elementMargin.right,height=this.element.offsetHeight+elementMargin.top+elementMargin.bottom,left=0,top=0,right=containerCoordinates.right-containerBorder.right-width,bottom=containerCoordinates.bottom-containerBorder.bottom-height;if(this.options.includeMargins){left+=elementMargin.left;top+=elementMargin.top;}else{right+=elementMargin.right;bottom+=elementMargin.bottom;}if(this.element.getStyle("position")=="relative"){var coords=this.element.getCoordinates(offsetParent);coords.left-=this.element.getStyle("left").toInt();coords.top-=this.element.getStyle("top").toInt();left+=containerBorder.left-coords.left;top+=containerBorder.top-coords.top;right+=elementMargin.left-coords.left;bottom+=elementMargin.top-coords.top;if(this.container!=offsetParent){left+=containerMargin.left+offsetParentPadding.left;top+=(Browser.Engine.trident4?0:containerMargin.top)+offsetParentPadding.top;}}else{left-=elementMargin.left;top-=elementMargin.top;if(this.container==offsetParent){right-=containerBorder.left;bottom-=containerBorder.top;}else{left+=containerCoordinates.left+containerBorder.left;top+=containerCoordinates.top+containerBorder.top;}}return{x:[left,right],y:[top,bottom]};},checkAgainst:function(el,i){el=(this.positions)?this.positions[i]:el.getCoordinates();var now=this.mouse.now;return(now.x>el.left&&now.x<el.right&&now.y<el.bottom&&now.y>el.top);},checkDroppables:function(){var overed=this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=overed){if(this.overed){this.fireEvent("leave",[this.element,this.overed]);}if(overed){this.fireEvent("enter",[this.element,overed]);}this.overed=overed;}},drag:function(event){this.parent(event);if(this.options.checkDroppables&&this.droppables.length){this.checkDroppables();}},stop:function(event){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed,event]);this.overed=null;return this.parent(event);}});Element.implement({makeDraggable:function(options){var drag=new Drag.Move(this,options);this.store("dragger",drag);return drag;}});var Sortables=new Class({Implements:[Events,Options],options:{snap:4,opacity:1,clone:false,revert:false,handle:false,constrain:false},initialize:function(lists,options){this.setOptions(options);this.elements=[];this.lists=[];this.idle=true;this.addLists($$(document.id(lists)||lists));if(!this.options.clone){this.options.revert=false;}if(this.options.revert){this.effect=new Fx.Morph(null,$merge({duration:250,link:"cancel"},this.options.revert));}},attach:function(){this.addLists(this.lists);return this;},detach:function(){this.lists=this.removeLists(this.lists);return this;},addItems:function(){Array.flatten(arguments).each(function(element){this.elements.push(element);var start=element.retrieve("sortables:start",this.start.bindWithEvent(this,element));(this.options.handle?element.getElement(this.options.handle)||element:element).addEvent("mousedown",start);},this);return this;},addLists:function(){Array.flatten(arguments).each(function(list){this.lists.push(list);this.addItems(list.getChildren());},this);return this;},removeItems:function(){return $$(Array.flatten(arguments).map(function(element){this.elements.erase(element);var start=element.retrieve("sortables:start");(this.options.handle?element.getElement(this.options.handle)||element:element).removeEvent("mousedown",start);return element;},this));},removeLists:function(){return $$(Array.flatten(arguments).map(function(list){this.lists.erase(list);this.removeItems(list.getChildren());return list;},this));},getClone:function(event,element){if(!this.options.clone){return new Element("div").inject(document.body);}if($type(this.options.clone)=="function"){return this.options.clone.call(this,event,element,this.list);}return element.clone(true).setStyles({margin:"0px",position:"absolute",visibility:"hidden","width":element.getStyle("width")}).inject(this.list).setPosition(element.getPosition(element.getOffsetParent()));},getDroppables:function(){var droppables=this.list.getChildren();if(!this.options.constrain){droppables=this.lists.concat(droppables).erase(this.list);}return droppables.erase(this.clone).erase(this.element);},insert:function(dragging,element){var where="inside";if(this.lists.contains(element)){this.list=element;this.drag.droppables=this.getDroppables();}else{where=this.element.getAllPrevious().contains(element)?"before":"after";}this.element.inject(element,where);this.fireEvent("sort",[this.element,this.clone]);},start:function(event,element){if(!this.idle){return;}this.idle=false;this.element=element;this.opacity=element.get("opacity");this.list=element.getParent();this.clone=this.getClone(event,element);this.drag=new Drag.Move(this.clone,{snap:this.options.snap,container:this.options.constrain&&this.element.getParent(),droppables:this.getDroppables(),onSnap:function(){event.stop();this.clone.setStyle("visibility","visible");this.element.set("opacity",this.options.opacity||0);this.fireEvent("start",[this.element,this.clone]);}.bind(this),onEnter:this.insert.bind(this),onCancel:this.reset.bind(this),onComplete:this.end.bind(this)});this.clone.inject(this.element,"before");this.drag.start(event);},end:function(){this.drag.detach();this.element.set("opacity",this.opacity);if(this.effect){var dim=this.element.getStyles("width","height");var pos=this.clone.computePosition(this.element.getPosition(this.clone.offsetParent));this.effect.element=this.clone;this.effect.start({top:pos.top,left:pos.left,width:dim.width,height:dim.height,opacity:0.25}).chain(this.reset.bind(this));}else{this.reset();}},reset:function(){this.idle=true;this.clone.destroy();this.fireEvent("complete",this.element);},serialize:function(){var params=Array.link(arguments,{modifier:Function.type,index:$defined});var serial=this.lists.map(function(list){return list.getChildren().map(params.modifier||function(element){return element.get("id");},this);},this);var index=params.index;if(this.lists.length==1){index=0;}return $chk(index)&&index>=0&&index<this.lists.length?serial[index]:serial;}});var Asset={javascript:function(source,properties){properties=$extend({onload:$empty,document:document,check:$lambda(true)},properties);var script=new Element("script",{src:source,type:"text/javascript"});var load=properties.onload.bind(script),check=properties.check,doc=properties.document;delete properties.onload;delete properties.check;delete properties.document;script.addEvents({load:load,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){load();}}}).set(properties);if(Browser.Engine.webkit419){var checker=(function(){if(!$try(check)){return;}$clear(checker);load();}).periodical(50);}return script.inject(doc.head);},css:function(source,properties){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:source},properties)).inject(document.head);},image:function(source,properties){properties=$merge({onload:$empty,onabort:$empty,onerror:$empty},properties);var image=new Image();var element=document.id(image)||new Element("img");["load","abort","error"].each(function(name){var type="on"+name;var event=properties[type];delete properties[type];image[type]=function(){if(!image){return;}if(!element.parentNode){element.width=image.width;element.height=image.height;}image=image.onload=image.onabort=image.onerror=null;event.delay(1,element,element);element.fireEvent(name,element,1);};});image.src=element.src=source;if(image&&image.complete){image.onload.delay(1);}return element.set(properties);},images:function(sources,options){options=$merge({onComplete:$empty,onProgress:$empty,onError:$empty,properties:{}},options);sources=$splat(sources);var images=[];var counter=0;return new Elements(sources.map(function(source){return Asset.image(source,$extend(options.properties,{onload:function(){options.onProgress.call(this,counter,sources.indexOf(source));counter++;if(counter==sources.length){options.onComplete();}},onerror:function(){options.onError.call(this,counter,sources.indexOf(source));counter++;if(counter==sources.length){options.onComplete();}}}));}));}};var IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:"iframeShim",src:'javascript:false;document.write("");',display:false,zIndex:null,margin:0,offset:{x:0,y:0},browsers:(Browser.Engine.trident4||(Browser.Engine.gecko&&!Browser.Engine.gecko19&&Browser.Platform.mac))},property:"IframeShim",initialize:function(element,options){this.element=document.id(element);if(this.occlude()){return this.occluded;}this.setOptions(options);this.makeShim();return this;},makeShim:function(){if(this.options.browsers){var zIndex=this.element.getStyle("zIndex").toInt();if(!zIndex){zIndex=1;var pos=this.element.getStyle("position");if(pos=="static"||!pos){this.element.setStyle("position","relative");}this.element.setStyle("zIndex",zIndex);}zIndex=($chk(this.options.zIndex)&&zIndex>this.options.zIndex)?this.options.zIndex:zIndex-1;if(zIndex<0){zIndex=1;}this.shim=new Element("iframe",{src:this.options.src,scrolling:"no",frameborder:0,styles:{zIndex:zIndex,position:"absolute",border:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"},"class":this.options.className}).store("IframeShim",this);var inject=(function(){this.shim.inject(this.element,"after");this[this.options.display?"show":"hide"]();this.fireEvent("inject");}).bind(this);if(IframeShim.ready){window.addEvent("load",inject);}else{inject();}}else{this.position=this.hide=this.show=this.dispose=$lambda(this);}},position:function(){if(!IframeShim.ready||!this.shim){return this;}var size=this.element.measure(function(){return this.getSize();});if(this.options.margin!=undefined){size.x=size.x-(this.options.margin*2);size.y=size.y-(this.options.margin*2);this.options.offset.x+=this.options.margin;this.options.offset.y+=this.options.margin;}this.shim.set({width:size.x,height:size.y}).position({relativeTo:this.element,offset:this.options.offset});return this;},hide:function(){if(this.shim){this.shim.setStyle("display","none");}return this;},show:function(){if(this.shim){this.shim.setStyle("display","block");}return this.position();},dispose:function(){if(this.shim){this.shim.dispose();}return this;},destroy:function(){if(this.shim){this.shim.destroy();}return this;}});window.addEvent("load",function(){IframeShim.ready=true;});MooTools.lang.set("en-US","Date",{months:["January","February","March","April","May","June","July","August","September","October","November","December"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dateOrder:["month","date","year"],shortDate:"%m/%d/%Y",shortTime:"%I:%M%p",AM:"AM",PM:"PM",ordinal:function(dayOfMonth){return(dayOfMonth>3&&dayOfMonth<21)?"th":["th","st","nd","rd","th"][Math.min(dayOfMonth%10,4)];},lessThanMinuteAgo:"less than a minute ago",minuteAgo:"about a minute ago",minutesAgo:"{delta} minutes ago",hourAgo:"about an hour ago",hoursAgo:"about {delta} hours ago",dayAgo:"1 day ago",daysAgo:"{delta} days ago",weekAgo:"1 week ago",weeksAgo:"{delta} weeks ago",monthAgo:"1 month ago",monthsAgo:"{delta} months ago",yearAgo:"1 year ago",yearsAgo:"{delta} years ago",lessThanMinuteUntil:"less than a minute from now",minuteUntil:"about a minute from now",minutesUntil:"{delta} minutes from now",hourUntil:"about an hour from now",hoursUntil:"about {delta} hours from now",dayUntil:"1 day from now",daysUntil:"{delta} days from now",weekUntil:"1 week from now",weeksUntil:"{delta} weeks from now",monthUntil:"1 month from now",monthsUntil:"{delta} months from now",yearUntil:"1 year from now",yearsUntil:"{delta} years from now"});MooTools.lang.set("en-US","Form.Validator",{required:"This field is required.",minLength:"Please enter at least {minLength} characters (you entered {length} characters).",maxLength:"Please enter no more than {maxLength} characters (you entered {length} characters).",integer:"Please enter an integer in this field. Numbers with decimals (e.g. 1.25) are not permitted.",numeric:'Please enter only numeric values in this field (i.e. "1" or "1.1" or "-1" or "-1.1").',digits:"Please use numbers and punctuation only in this field (for example, a phone number with dashes or dots is permitted).",alpha:"Please use letters only (a-z) with in this field. No spaces or other characters are allowed.",alphanum:"Please use only letters (a-z) or numbers (0-9) only in this field. No spaces or other characters are allowed.",dateSuchAs:"Please enter a valid date such as {date}",dateInFormatMDY:'Please enter a valid date such as MM/DD/YYYY (i.e. "12/31/1999")',email:'Please enter a valid email address. For example "fred@domain.com".',url:"Please enter a valid URL such as http://www.google.com.",currencyDollar:"Please enter a valid $ amount. For example $100.00 .",oneRequired:"Please enter something for at least one of these inputs.",errorPrefix:"Error: ",warningPrefix:"Warning: ",noSpace:"There can be no spaces in this input.",reqChkByNode:"No items are selected.",requiredChk:"This field is required.",reqChkByName:"Please select a {label}.",match:"This field needs to match the {matchName} field",startDate:"the start date",endDate:"the end date",currendDate:"the current date",afterDate:"The date should be the same or after {label}.",beforeDate:"The date should be the same or before {label}.",startMonth:"Please select a start month",sameMonth:"These two dates must be in the same month - you must change one or the other.",creditcard:"The credit card number entered is invalid. Please check the number and try again. {length} digits entered."});var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(input){var output="";var chr1,chr2,chr3,enc1,enc2,enc3,enc4;var i=0;input=Base64._utf8_encode(input);while(i<input.length){chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64;}else{if(isNaN(chr3)){enc4=64;}}output=output+this._keyStr.charAt(enc1)+this._keyStr.charAt(enc2)+this._keyStr.charAt(enc3)+this._keyStr.charAt(enc4);}return output;},decode:function(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(i<input.length){enc1=this._keyStr.indexOf(input.charAt(i++));enc2=this._keyStr.indexOf(input.charAt(i++));enc3=this._keyStr.indexOf(input.charAt(i++));enc4=this._keyStr.indexOf(input.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64){output=output+String.fromCharCode(chr2);}if(enc4!=64){output=output+String.fromCharCode(chr3);}}output=Base64._utf8_decode(output);return output;},_utf8_encode:function(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c);}else{if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}}}return utftext;},_utf8_decode:function(utftext){var string="";var i=0;var c=c1=c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++;}else{if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}}return string;}};var CSS=new Class({local:{self:"CSS",limited:["dpi","border-radius"],_rule:""},options:{rules:{}},xhtml:{_style:null},initialize:function(options){this.local=$merge(this.local,this.options,options,this.xhtml);},destroy:function(){if(this.local._style){this.local._style.destroy();}},refresh:function(){var text="";Hash.each(this.local.rules,function(rule,selector){this.local._rule="";Hash.each(rule,this._glue,this);text+=(this.local._rule==""?"":selector+"\n{\n"+this.local._rule+"}\n");},this);this.destroy();this.local._style=new Element("style").set("type","text/css").inject(document.head);switch(Browser.Engine.name){case"trident":this.local._style.styleSheet.cssText=text;break;default:this.local._style.set("text",text);break;}return this;},_glue:function(value,property){if(this[Browser.Engine.name+"_"+property]){var pair;if(pair=this[Browser.Engine.name+"_"+property](value,property)){this.local._rule+="\t"+pair[0]+":"+pair[1]+";\n";}}else{if(!this.local.limited.contains(property)){this.local._rule+="\t"+property+":"+value+";\n";}}},add_prop:function(selector,property,value){var rules={};rules[selector]={};rules[selector][property]=value;return this.add_rules(rules);},add_rule:function(selector,properties){var rules={};rules[selector]=properties;return this.add_rules(rules);},add_rules:function(rules){this.local.rules=$merge(this.local.rules,rules);return this;},remove_prop:function(selector,property){delete this.local.rules[selector][property];return this;},remove_rule:function(selector){delete this.local.rules[selector];return this;},remove_rules:function(selectors){if(selectors){selectors.each(this.remove_rule,this);}else{this.local.rules={};}return this;},check_rule:function(selector){return $defined(this.local.rules[selector]);}});CSS.implement({"trident_opacity":function(value,property){return["filter","alpha(opacity="+(value*100)+")"];},"trident_dpi":function(value,property){if($defined(window.screen.deviceXDPI)){return["font-size",((96/window.screen.deviceXDPI)*value).round()+"%"];}else{return["font-size",value+"%"];}},"gecko_border-radius":function(value,property){return["-moz-"+property,value];},"webkit_border-radius":function(value,property){return["-webkit-"+property,value];}});var GeoHash={BITS:[16,8,4,2,1],BASE32:"0123456789bcdefghjkmnpqrstuvwxyz",NEIGHBORS:{right:{even:"bc01fg45238967deuvhjyznpkmstqrwx"},left:{even:"238967debc01fg45kmstqrwxuvhjyznp"},top:{even:"p0r21436x8zb9dcf5h7kjnmqesgutwvy"},bottom:{even:"14365h7k9dcfesgujnmqp0r2twvyx8zb"}},BORDERS:{right:{even:"bcfguvyz"},left:{even:"0145hjnp"},top:{even:"prxz"},bottom:{even:"028b"}},init:function(){GeoHash.NEIGHBORS.bottom.odd=GeoHash.NEIGHBORS.left.even,GeoHash.NEIGHBORS.top.odd=GeoHash.NEIGHBORS.right.even,GeoHash.NEIGHBORS.left.odd=GeoHash.NEIGHBORS.bottom.even,GeoHash.NEIGHBORS.right.odd=GeoHash.NEIGHBORS.top.even,GeoHash.BORDERS.bottom.odd=GeoHash.BORDERS.left.even;GeoHash.BORDERS.top.odd=GeoHash.BORDERS.right.even;GeoHash.BORDERS.left.odd=GeoHash.BORDERS.bottom.even;GeoHash.BORDERS.right.odd=GeoHash.BORDERS.top.even;},refine_interval:function(interval,cd,mask){if(cd&mask){interval[0]=(interval[0]+interval[1])/2;}else{interval[1]=(interval[0]+interval[1])/2;}},calculateAdjacent:function(srcHash,dir){srcHash=srcHash.toLowerCase();var lastChr=srcHash.charAt(srcHash.length-1);var type=(srcHash.length%2)?"odd":"even";var base=srcHash.substring(0,srcHash.length-1);if(GeoHash.BORDERS[dir][type].indexOf(lastChr)!=-1){base=GeoHash.calculateAdjacent(base,dir);}return base+GeoHash.BASE32[GeoHash.NEIGHBORS[dir][type].indexOf(lastChr)];},decodeGeoHash:function(geohash){var is_even=1;var lat=[];var lon=[];lat[0]=-90;lat[1]=90;lon[0]=-180;lon[1]=180;lat_err=90;lon_err=180;for(i=0;i<geohash.length;i++){c=geohash[i];cd=GeoHash.BASE32.indexOf(c);for(j=0;j<5;j++){mask=GeoHash.BITS[j];if(is_even){lon_err/=2;GeoHash.refine_interval(lon,cd,mask);}else{lat_err/=2;GeoHash.refine_interval(lat,cd,mask);}is_even=!is_even;}}lat[2]=(lat[0]+lat[1])/2;lon[2]=(lon[0]+lon[1])/2;return{lat:lat,lng:lon};},encodeGeoHash:function(latitude,longitude){var is_even=1;var i=0;var lat=[];var lon=[];var bit=0;var ch=0;var precision=12;geohash="";lat[0]=-90;lat[1]=90;lon[0]=-180;lon[1]=180;while(geohash.length<precision){if(is_even){mid=(lon[0]+lon[1])/2;if(longitude>mid){ch|=GeoHash.BITS[bit];lon[0]=mid;}else{lon[1]=mid;}}else{mid=(lat[0]+lat[1])/2;if(latitude>mid){ch|=GeoHash.BITS[bit];lat[0]=mid;}else{lat[1]=mid;}}is_even=!is_even;if(bit<4){bit++;}else{geohash+=GeoHash.BASE32[ch];bit=0;ch=0;}}return geohash;}};GeoHash.init();var HistoryManager=(function(){var HistoryManagerSingleton=new Class({initialize:function(){this._currentLocation=this._getHash();var historyManager=this;if(window.ie){this.addState=this._addStateIE;this._iframe=new Element("iframe",{src:"javascript:'<html></html>'",styles:{"position":"absolute","top":"-1000px"}}).inject(document.body).contentWindow;$justForIE=function(hash){historyManager._getHash=function(){return hash;};historyManager._monitorDefault.call(historyManager);location.hash=hash;};function waitForIframeLoad(){if(historyManager._iframe&&historyManager._iframe.document&&historyManager._iframe.document.body){if(!historyManager._iframe.document.body.innerHTML){historyManager.addState(historyManager._currentLocation,true);}}else{setTimeout(waitForIframeLoad,50);}}waitForIframeLoad();}else{if(window.webkit419){this._form=new Element("form",{method:"get"}).inject(document.body);this._historyCounter=history.length;this._stateHistory=[];this._stateHistory[history.length]=this._getHash();this.addState=this._addStateSafari;this._monitorSafari.periodical(250,this);}else{if(window.opera){this.addState=this._addStateDefault;$justForOpera=function(){historyManager._monitorDefault.call(historyManager);};new Element("img",{src:"javascript:location.href='javascript:$justForOpera();';",style:"position: absolute; top: -1000px;"}).inject(document.body);}else{this.addState=this._addStateDefault;this._monitorDefault.periodical(250,this);}}}},getCurrentLocation:function(){return this._currentLocation;},_getHash:function(){return location.href.split("#")[1]||"";},_addStateIE:function(hash,override){if(this._currentLocation==hash&&!override){return;}this._currentLocation=hash;this._iframe.document.write("<html><body onload=\"top.$justForIE('",hash,"');\">Loaded</body></html>");this._iframe.document.close();},_addStateSafari:function(hash){if(this._currentLocation==hash){return;}this._form.setProperty("action","#"+hash).submit();this._currentLocation=hash;this._stateHistory[history.length]=this._getHash();this._historyCounter=history.length;},_monitorSafari:function(){if(history.length!=this._historyCounter){this._historyCounter=history.length;this._currentLocation=this._stateHistory[history.length];this.fireEvent("onHistoryChange",[this._stateHistory[history.length]]);}},_addStateDefault:function(hash){if(this._currentLocation==hash){return;}location.hash="#"+hash;this._currentLocation=hash;},_monitorDefault:function(){var hash=this._getHash();if(hash!=this._currentLocation){this._currentLocation=hash;this.fireEvent("onHistoryChange",[hash]);}}});HistoryManagerSingleton.implement(new Events);var singleton;return function(){return singleton?singleton:singleton=new HistoryManagerSingleton();};})();var JSJAC_HAVEKEYS=true;var JSJAC_NKEYS=16;var JSJAC_INACTIVITY=300;var JSJAC_ERR_COUNT=10;var JSJAC_ALLOW_PLAIN=true;var JSJAC_CHECKQUEUEINTERVAL=500;var JSJAC_CHECKINQUEUEINTERVAL=500;var JSJACHBC_BOSH_VERSION="1.6";var JSJACHBC_USE_BOSH_VER=true;var JSJACHBC_MAX_HOLD=1;var JSJACHBC_MAX_WAIT=300;var JSJACHBC_MAXPAUSE=120;String.prototype.htmlEnc=function(){var str=this.replace(/&/g,"&amp;");str=str.replace(/</g,"&lt;");str=str.replace(/>/g,"&gt;");str=str.replace(/\"/g,"&quot;");str=str.replace(/\n/g,"<br />");return str;};Date.jab2date=function(ts){var date=new Date(Date.UTC(ts.substr(0,4),ts.substr(5,2)-1,ts.substr(8,2),ts.substr(11,2),ts.substr(14,2),ts.substr(17,2)));if(ts.substr(ts.length-6,1)!="Z"){var offset=new Date();offset.setTime(0);offset.setUTCHours(ts.substr(ts.length-5,2));offset.setUTCMinutes(ts.substr(ts.length-2,2));if(ts.substr(ts.length-6,1)=="+"){date.setTime(date.getTime()-offset.getTime());}else{if(ts.substr(ts.length-6,1)=="-"){date.setTime(date.getTime()+offset.getTime());}}}return date;};Date.hrTime=function(ts){return Date.jab2date(ts).toLocaleString();};Date.prototype.jabberDate=function(){var padZero=function(i){if(i<10){return"0"+i;}return i;};var jDate=this.getUTCFullYear()+"-";jDate+=padZero(this.getUTCMonth()+1)+"-";jDate+=padZero(this.getUTCDate())+"T";jDate+=padZero(this.getUTCHours())+":";jDate+=padZero(this.getUTCMinutes())+":";jDate+=padZero(this.getUTCSeconds())+"Z";return jDate;};Number.max=function(A,B){return(A>B)?A:B;};var hexcase=0;var b64pad="=";var chrsz=8;function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length*chrsz));}function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length*chrsz));}function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length*chrsz));}function hex_hmac_sha1(key,data){return binb2hex(core_hmac_sha1(key,data));}function b64_hmac_sha1(key,data){return binb2b64(core_hmac_sha1(key,data));}function str_hmac_sha1(key,data){return binb2str(core_hmac_sha1(key,data));}function sha1_vm_test(){return hex_sha1("abc")=="a9993e364706816aba3e25717850c26c9cd0d89d";}function core_sha1(x,len){x[len>>5]|=128<<(24-len%32);x[((len+64>>9)<<4)+15]=len;var w=Array(80);var a=1732584193;var b=-271733879;var c=-1732584194;var d=271733878;var e=-1009589776;for(var i=0;i<x.length;i+=16){var olda=a;var oldb=b;var oldc=c;var oldd=d;var olde=e;for(var j=0;j<80;j++){if(j<16){w[j]=x[i+j];}else{w[j]=rol(w[j-3]^w[j-8]^w[j-14]^w[j-16],1);}var t=safe_add(safe_add(rol(a,5),sha1_ft(j,b,c,d)),safe_add(safe_add(e,w[j]),sha1_kt(j)));e=d;d=c;c=rol(b,30);b=a;a=t;}a=safe_add(a,olda);b=safe_add(b,oldb);c=safe_add(c,oldc);d=safe_add(d,oldd);e=safe_add(e,olde);}return Array(a,b,c,d,e);}function sha1_ft(t,b,c,d){if(t<20){return(b&c)|((~b)&d);}if(t<40){return b^c^d;}if(t<60){return(b&c)|(b&d)|(c&d);}return b^c^d;}function sha1_kt(t){return(t<20)?1518500249:(t<40)?1859775393:(t<60)?-1894007588:-899497514;}function core_hmac_sha1(key,data){var bkey=str2binb(key);if(bkey.length>16){bkey=core_sha1(bkey,key.length*chrsz);}var ipad=Array(16),opad=Array(16);for(var i=0;i<16;i++){ipad[i]=bkey[i]^909522486;opad[i]=bkey[i]^1549556828;}var hash=core_sha1(ipad.concat(str2binb(data)),512+data.length*chrsz);return core_sha1(opad.concat(hash),512+160);}function rol(num,cnt){return(num<<cnt)|(num>>>(32-cnt));}function str2binb(str){var bin=Array();var mask=(1<<chrsz)-1;for(var i=0;i<str.length*chrsz;i+=chrsz){bin[i>>5]|=(str.charCodeAt(i/chrsz)&mask)<<(32-chrsz-i%32);}return bin;}function binb2str(bin){var str="";var mask=(1<<chrsz)-1;for(var i=0;i<bin.length*32;i+=chrsz){str+=String.fromCharCode((bin[i>>5]>>>(32-chrsz-i%32))&mask);}return str;}function binb2hex(binarray){var hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef";var str="";for(var i=0;i<binarray.length*4;i++){str+=hex_tab.charAt((binarray[i>>2]>>((3-i%4)*8+4))&15)+hex_tab.charAt((binarray[i>>2]>>((3-i%4)*8))&15);}return str;}function binb2b64(binarray){var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var str="";for(var i=0;i<binarray.length*4;i+=3){var triplet=(((binarray[i>>2]>>8*(3-i%4))&255)<<16)|(((binarray[i+1>>2]>>8*(3-(i+1)%4))&255)<<8)|((binarray[i+2>>2]>>8*(3-(i+2)%4))&255);for(var j=0;j<4;j++){if(i*8+j*6>binarray.length*32){str+=b64pad;}else{str+=tab.charAt((triplet>>6*(3-j))&63);}}}return str;}function hex_md5(s){return binl2hex(core_md5(str2binl(s),s.length*chrsz));}function b64_md5(s){return binl2b64(core_md5(str2binl(s),s.length*chrsz));}function str_md5(s){return binl2str(core_md5(str2binl(s),s.length*chrsz));}function hex_hmac_md5(key,data){return binl2hex(core_hmac_md5(key,data));}function b64_hmac_md5(key,data){return binl2b64(core_hmac_md5(key,data));}function str_hmac_md5(key,data){return binl2str(core_hmac_md5(key,data));}function md5_vm_test(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72";}function core_md5(x,len){x[len>>5]|=128<<((len)%32);x[(((len+64)>>>9)<<4)+14]=len;var a=1732584193;var b=-271733879;var c=-1732584194;var d=271733878;for(var i=0;i<x.length;i+=16){var olda=a;var oldb=b;var oldc=c;var oldd=d;a=md5_ff(a,b,c,d,x[i+0],7,-680876936);d=md5_ff(d,a,b,c,x[i+1],12,-389564586);c=md5_ff(c,d,a,b,x[i+2],17,606105819);b=md5_ff(b,c,d,a,x[i+3],22,-1044525330);a=md5_ff(a,b,c,d,x[i+4],7,-176418897);d=md5_ff(d,a,b,c,x[i+5],12,1200080426);c=md5_ff(c,d,a,b,x[i+6],17,-1473231341);b=md5_ff(b,c,d,a,x[i+7],22,-45705983);a=md5_ff(a,b,c,d,x[i+8],7,1770035416);d=md5_ff(d,a,b,c,x[i+9],12,-1958414417);c=md5_ff(c,d,a,b,x[i+10],17,-42063);b=md5_ff(b,c,d,a,x[i+11],22,-1990404162);a=md5_ff(a,b,c,d,x[i+12],7,1804603682);d=md5_ff(d,a,b,c,x[i+13],12,-40341101);c=md5_ff(c,d,a,b,x[i+14],17,-1502002290);b=md5_ff(b,c,d,a,x[i+15],22,1236535329);a=md5_gg(a,b,c,d,x[i+1],5,-165796510);d=md5_gg(d,a,b,c,x[i+6],9,-1069501632);c=md5_gg(c,d,a,b,x[i+11],14,643717713);b=md5_gg(b,c,d,a,x[i+0],20,-373897302);a=md5_gg(a,b,c,d,x[i+5],5,-701558691);d=md5_gg(d,a,b,c,x[i+10],9,38016083);c=md5_gg(c,d,a,b,x[i+15],14,-660478335);b=md5_gg(b,c,d,a,x[i+4],20,-405537848);a=md5_gg(a,b,c,d,x[i+9],5,568446438);d=md5_gg(d,a,b,c,x[i+14],9,-1019803690);c=md5_gg(c,d,a,b,x[i+3],14,-187363961);b=md5_gg(b,c,d,a,x[i+8],20,1163531501);a=md5_gg(a,b,c,d,x[i+13],5,-1444681467);d=md5_gg(d,a,b,c,x[i+2],9,-51403784);c=md5_gg(c,d,a,b,x[i+7],14,1735328473);b=md5_gg(b,c,d,a,x[i+12],20,-1926607734);a=md5_hh(a,b,c,d,x[i+5],4,-378558);d=md5_hh(d,a,b,c,x[i+8],11,-2022574463);c=md5_hh(c,d,a,b,x[i+11],16,1839030562);b=md5_hh(b,c,d,a,x[i+14],23,-35309556);a=md5_hh(a,b,c,d,x[i+1],4,-1530992060);d=md5_hh(d,a,b,c,x[i+4],11,1272893353);c=md5_hh(c,d,a,b,x[i+7],16,-155497632);b=md5_hh(b,c,d,a,x[i+10],23,-1094730640);a=md5_hh(a,b,c,d,x[i+13],4,681279174);d=md5_hh(d,a,b,c,x[i+0],11,-358537222);c=md5_hh(c,d,a,b,x[i+3],16,-722521979);b=md5_hh(b,c,d,a,x[i+6],23,76029189);a=md5_hh(a,b,c,d,x[i+9],4,-640364487);d=md5_hh(d,a,b,c,x[i+12],11,-421815835);c=md5_hh(c,d,a,b,x[i+15],16,530742520);b=md5_hh(b,c,d,a,x[i+2],23,-995338651);a=md5_ii(a,b,c,d,x[i+0],6,-198630844);d=md5_ii(d,a,b,c,x[i+7],10,1126891415);c=md5_ii(c,d,a,b,x[i+14],15,-1416354905);b=md5_ii(b,c,d,a,x[i+5],21,-57434055);a=md5_ii(a,b,c,d,x[i+12],6,1700485571);d=md5_ii(d,a,b,c,x[i+3],10,-1894986606);c=md5_ii(c,d,a,b,x[i+10],15,-1051523);b=md5_ii(b,c,d,a,x[i+1],21,-2054922799);a=md5_ii(a,b,c,d,x[i+8],6,1873313359);d=md5_ii(d,a,b,c,x[i+15],10,-30611744);c=md5_ii(c,d,a,b,x[i+6],15,-1560198380);b=md5_ii(b,c,d,a,x[i+13],21,1309151649);a=md5_ii(a,b,c,d,x[i+4],6,-145523070);d=md5_ii(d,a,b,c,x[i+11],10,-1120210379);c=md5_ii(c,d,a,b,x[i+2],15,718787259);b=md5_ii(b,c,d,a,x[i+9],21,-343485551);a=safe_add(a,olda);b=safe_add(b,oldb);c=safe_add(c,oldc);d=safe_add(d,oldd);}return Array(a,b,c,d);}function md5_cmn(q,a,b,x,s,t){return safe_add(bit_rol(safe_add(safe_add(a,q),safe_add(x,t)),s),b);}function md5_ff(a,b,c,d,x,s,t){return md5_cmn((b&c)|((~b)&d),a,b,x,s,t);}function md5_gg(a,b,c,d,x,s,t){return md5_cmn((b&d)|(c&(~d)),a,b,x,s,t);}function md5_hh(a,b,c,d,x,s,t){return md5_cmn(b^c^d,a,b,x,s,t);}function md5_ii(a,b,c,d,x,s,t){return md5_cmn(c^(b|(~d)),a,b,x,s,t);}function core_hmac_md5(key,data){var bkey=str2binl(key);if(bkey.length>16){bkey=core_md5(bkey,key.length*chrsz);}var ipad=Array(16),opad=Array(16);for(var i=0;i<16;i++){ipad[i]=bkey[i]^909522486;opad[i]=bkey[i]^1549556828;}var hash=core_md5(ipad.concat(str2binl(data)),512+data.length*chrsz);return core_md5(opad.concat(hash),512+128);}function safe_add(x,y){var lsw=(x&65535)+(y&65535);var msw=(x>>16)+(y>>16)+(lsw>>16);return(msw<<16)|(lsw&65535);}function bit_rol(num,cnt){return(num<<cnt)|(num>>>(32-cnt));}function str2binl(str){var bin=Array();var mask=(1<<chrsz)-1;for(var i=0;i<str.length*chrsz;i+=chrsz){bin[i>>5]|=(str.charCodeAt(i/chrsz)&mask)<<(i%32);}return bin;}function binl2str(bin){var str="";var mask=(1<<chrsz)-1;for(var i=0;i<bin.length*32;i+=chrsz){str+=String.fromCharCode((bin[i>>5]>>>(i%32))&mask);}return str;}function binl2hex(binarray){var hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef";var str="";for(var i=0;i<binarray.length*4;i++){str+=hex_tab.charAt((binarray[i>>2]>>((i%4)*8+4))&15)+hex_tab.charAt((binarray[i>>2]>>((i%4)*8))&15);}return str;}function binl2b64(binarray){var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var str="";for(var i=0;i<binarray.length*4;i+=3){var triplet=(((binarray[i>>2]>>8*(i%4))&255)<<16)|(((binarray[i+1>>2]>>8*((i+1)%4))&255)<<8)|((binarray[i+2>>2]>>8*((i+2)%4))&255);for(var j=0;j<4;j++){if(i*8+j*6>binarray.length*32){str+=b64pad;}else{str+=tab.charAt((triplet>>6*(3-j))&63);}}}return str;}function utf8t2d(t){t=t.replace(/\r\n/g,"\n");var d=new Array;var test=String.fromCharCode(237);if(test.charCodeAt(0)<0){for(var n=0;n<t.length;n++){var c=t.charCodeAt(n);if(c>0){d[d.length]=c;}else{d[d.length]=(((256+c)>>6)|192);d[d.length]=(((256+c)&63)|128);}}}else{for(var n=0;n<t.length;n++){var c=t.charCodeAt(n);if(c<128){d[d.length]=c;}else{if((c>127)&&(c<2048)){d[d.length]=((c>>6)|192);d[d.length]=((c&63)|128);}else{d[d.length]=((c>>12)|224);d[d.length]=(((c>>6)&63)|128);d[d.length]=((c&63)|128);}}}}return d;}function utf8d2t(d){var r=new Array;var i=0;while(i<d.length){if(d[i]<128){r[r.length]=String.fromCharCode(d[i]);i++;}else{if((d[i]>191)&&(d[i]<224)){r[r.length]=String.fromCharCode(((d[i]&31)<<6)|(d[i+1]&63));i+=2;}else{r[r.length]=String.fromCharCode(((d[i]&15)<<12)|((d[i+1]&63)<<6)|(d[i+2]&63));i+=3;}}}return r.join("");}function b64arrays(){var b64s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";b64=new Array();f64=new Array();for(var i=0;i<b64s.length;i++){b64[i]=b64s.charAt(i);f64[b64s.charAt(i)]=i;}}function b64d2t(d){var r=new Array;var i=0;var dl=d.length;if((dl%3)==1){d[d.length]=0;d[d.length]=0;}if((dl%3)==2){d[d.length]=0;}while(i<d.length){r[r.length]=b64[d[i]>>2];r[r.length]=b64[((d[i]&3)<<4)|(d[i+1]>>4)];r[r.length]=b64[((d[i+1]&15)<<2)|(d[i+2]>>6)];r[r.length]=b64[d[i+2]&63];i+=3;}if((dl%3)==1){r[r.length-1]=r[r.length-2]="=";}if((dl%3)==2){r[r.length-1]="=";}var t=r.join("");return t;}function b64t2d(t){var d=new Array;var i=0;t=t.replace(/\n|\r/g,"");t=t.replace(/=/g,"");while(i<t.length){d[d.length]=(f64[t.charAt(i)]<<2)|(f64[t.charAt(i+1)]>>4);d[d.length]=(((f64[t.charAt(i+1)]&15)<<4)|(f64[t.charAt(i+2)]>>2));d[d.length]=(((f64[t.charAt(i+2)]&3)<<6)|(f64[t.charAt(i+3)]));i+=4;}if(t.length%4==2){d=d.slice(0,d.length-2);}if(t.length%4==3){d=d.slice(0,d.length-1);}return d;}if(typeof(atob)=="undefined"||typeof(btoa)=="undefined"){b64arrays();}if(typeof(atob)=="undefined"){atob=function(s){return utf8d2t(b64t2d(s));};}if(typeof(btoa)=="undefined"){btoa=function(s){return b64d2t(utf8t2d(s));};}function cnonce(size){var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";var cnonce="";for(var i=0;i<size;i++){cnonce+=tab.charAt(Math.round(Math.random(new Date().getTime())*(tab.length-1)));}return cnonce;}function JSJaCJSON(){}JSJaCJSON.toString=function(obj){var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},s={array:function(x){var a=["["],b,f,i,l=x.length,v;for(i=0;i<l;i+=1){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){if(b){a[a.length]=",";}a[a.length]=v;b=true;}}}a[a.length]="]";return a.join("");},"boolean":function(x){return String(x);},"null":function(x){return"null";},number:function(x){return isFinite(x)?String(x):"null";},object:function(x){if(x){if(x instanceof Array){return s.array(x);}var a=["{"],b,f,i,v;for(i in x){if(x.hasOwnProperty(i)){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){if(b){a[a.length]=",";}a.push(s.string(i),":",v);b=true;}}}}a[a.length]="}";return a.join("");}return"null";},string:function(x){if(/["\\\x00-\x1f]/.test(x)){x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c;}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16);});}return'"'+x+'"';}};switch(typeof(obj)){case"object":return s.object(obj);case"array":return s.array(obj);}};JSJaCJSON.parse=function(str){try{return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(str.replace(/"(\\.|[^"\\])*"/g,"")))&&eval("("+str+")");}catch(e){return false;}};function XmlHttp(){}XmlHttp.create=function(){try{if(window.XMLHttpRequest){var req=new XMLHttpRequest();if(req.readyState==null){req.readyState=1;req.addEventListener("load",function(){req.readyState=4;if(typeof req.onreadystatechange=="function"){req.onreadystatechange();}},false);}return req;}if(window.ActiveXObject){return new ActiveXObject(XmlHttp.getPrefix()+".XmlHttp");}}catch(ex){}throw new Error("Your browser does not support XmlHttp objects");};XmlHttp.getPrefix=function(){if(XmlHttp.prefix){return XmlHttp.prefix;}var prefixes=["MSXML2","Microsoft","MSXML","MSXML3"];var o;for(var i=0;i<prefixes.length;i++){try{o=new ActiveXObject(prefixes[i]+".XmlHttp");return XmlHttp.prefix=prefixes[i];}catch(ex){}}throw new Error("Could not find an installed XML parser");};function XmlDocument(){}XmlDocument.create=function(name,ns){name=name||"foo";ns=ns||"";try{var doc;if(document.implementation&&document.implementation.createDocument){doc=document.implementation.createDocument(ns,name,null);if(doc.readyState==null){doc.readyState=1;doc.addEventListener("load",function(){doc.readyState=4;if(typeof doc.onreadystatechange=="function"){doc.onreadystatechange();}},false);}}else{if(window.ActiveXObject){doc=new ActiveXObject(XmlDocument.getPrefix()+".DomDocument");}}if(!doc.documentElement||doc.documentElement.tagName!=name||(doc.documentElement.namespaceURI&&doc.documentElement.namespaceURI!=ns)){try{if(ns!=""){doc.appendChild(doc.createElement(name)).setAttribute("xmlns",ns);}else{doc.appendChild(doc.createElement(name));}}catch(dex){doc=document.implementation.createDocument(ns,name,null);if(doc.documentElement==null){doc.appendChild(doc.createElement(name));}if(ns!=""&&doc.documentElement.getAttribute("xmlns")!=ns){doc.documentElement.setAttribute("xmlns",ns);}}}return doc;}catch(ex){alert(ex.name+": "+ex.message);}throw new Error("Your browser does not support XmlDocument objects");};XmlDocument.getPrefix=function(){if(XmlDocument.prefix){return XmlDocument.prefix;}var prefixes=["MSXML2","Microsoft","MSXML","MSXML3"];var o;for(var i=0;i<prefixes.length;i++){try{o=new ActiveXObject(prefixes[i]+".DomDocument");return XmlDocument.prefix=prefixes[i];}catch(ex){}}throw new Error("Could not find an installed XML parser");};if(typeof(Document)!="undefined"&&window.DOMParser){Document.prototype.loadXML=function(s){var doc2=(new DOMParser()).parseFromString(s,"text/xml");while(this.hasChildNodes()){this.removeChild(this.lastChild);}for(var i=0;i<doc2.childNodes.length;i++){this.appendChild(this.importNode(doc2.childNodes[i],true));}};}if(window.XMLSerializer&&window.Node&&Node.prototype&&Node.prototype.__defineGetter__){XMLDocument.prototype.__defineGetter__("xml",function(){return(new XMLSerializer()).serializeToString(this);});Document.prototype.__defineGetter__("xml",function(){return(new XMLSerializer()).serializeToString(this);});Node.prototype.__defineGetter__("xml",function(){return(new XMLSerializer()).serializeToString(this);});}var JSJaCBuilder={buildNode:function(doc,elementName){var element;if(arguments[2]){if(JSJaCBuilder._isStringOrNumber(arguments[2])||(arguments[2] instanceof Array)){element=doc.createElement(elementName);JSJaCBuilder._children(doc,element,arguments[2]);}else{if(arguments[2]["xmlns"]){try{element=doc.createElementNS(arguments[2]["xmlns"],elementName);}catch(e){element=doc.createElement(elementName);}}else{element=doc.createElement(elementName);}for(attr in arguments[2]){if(arguments[2].hasOwnProperty(attr)){if(attr=="xmlns"&&element.namespaceURI==attr){continue;}element.setAttribute(attr,arguments[2][attr]);}}}}else{element=doc.createElement(elementName);}if(arguments[3]){JSJaCBuilder._children(doc,element,arguments[3]);}return element;},_text:function(doc,text){return doc.createTextNode(text);},_children:function(doc,element,children){if(typeof children=="object"){for(var i in children){if(children.hasOwnProperty(i)){var e=children[i];if(typeof e=="object"){if(e instanceof Array){var node=JSJaCBuilder.buildNode(doc,e[0],e[1],e[2]);element.appendChild(node);}else{element.appendChild(e);}}else{if(JSJaCBuilder._isStringOrNumber(e)){element.appendChild(JSJaCBuilder._text(doc,e));}}}}}else{if(JSJaCBuilder._isStringOrNumber(children)){element.appendChild(JSJaCBuilder._text(doc,children));}}},_attributes:function(attributes){var attrs=[];for(attribute in attributes){if(attributes.hasOwnProperty(attribute)){attrs.push(attribute+'="'+attributes[attribute].toString().htmlEnc()+'"');}}return attrs.join(" ");},_isStringOrNumber:function(param){return(typeof param=="string"||typeof param=="number");}};var NS_DISCO_ITEMS="http://jabber.org/protocol/disco#items";var NS_DISCO_INFO="http://jabber.org/protocol/disco#info";var NS_VCARD="vcard-temp";var NS_AUTH="jabber:iq:auth";var NS_AUTH_ERROR="jabber:iq:auth:error";var NS_REGISTER="jabber:iq:register";var NS_SEARCH="jabber:iq:search";var NS_ROSTER="jabber:iq:roster";var NS_PRIVACY="jabber:iq:privacy";var NS_PRIVATE="jabber:iq:private";var NS_VERSION="jabber:iq:version";var NS_TIME="jabber:iq:time";var NS_LAST="jabber:iq:last";var NS_XDATA="jabber:x:data";var NS_IQDATA="jabber:iq:data";var NS_DELAY="jabber:x:delay";var NS_EXPIRE="jabber:x:expire";var NS_EVENT="jabber:x:event";var NS_XCONFERENCE="jabber:x:conference";var NS_STATS="http://jabber.org/protocol/stats";var NS_MUC="http://jabber.org/protocol/muc";var NS_MUC_USER="http://jabber.org/protocol/muc#user";var NS_MUC_ADMIN="http://jabber.org/protocol/muc#admin";var NS_MUC_OWNER="http://jabber.org/protocol/muc#owner";var NS_PUBSUB="http://jabber.org/protocol/pubsub";var NS_PUBSUB_EVENT="http://jabber.org/protocol/pubsub#event";var NS_PUBSUB_OWNER="http://jabber.org/protocol/pubsub#owner";var NS_PUBSUB_NMI="http://jabber.org/protocol/pubsub#node-meta-info";var NS_COMMANDS="http://jabber.org/protocol/commands";var NS_STREAM="http://etherx.jabber.org/streams";var NS_STANZAS="urn:ietf:params:xml:ns:xmpp-stanzas";var NS_STREAMS="urn:ietf:params:xml:ns:xmpp-streams";var NS_TLS="urn:ietf:params:xml:ns:xmpp-tls";var NS_SASL="urn:ietf:params:xml:ns:xmpp-sasl";var NS_SESSION="urn:ietf:params:xml:ns:xmpp-session";var NS_BIND="urn:ietf:params:xml:ns:xmpp-bind";var NS_FEATURE_IQAUTH="http://jabber.org/features/iq-auth";var NS_FEATURE_IQREGISTER="http://jabber.org/features/iq-register";var NS_FEATURE_COMPRESS="http://jabber.org/features/compress";var NS_COMPRESS="http://jabber.org/protocol/compress";function STANZA_ERROR(code,type,cond){if(window==this){return new STANZA_ERROR(code,type,cond);}this.code=code;this.type=type;this.cond=cond;}var ERR_BAD_REQUEST=STANZA_ERROR("400","modify","bad-request");var ERR_CONFLICT=STANZA_ERROR("409","cancel","conflict");var ERR_FEATURE_NOT_IMPLEMENTED=STANZA_ERROR("501","cancel","feature-not-implemented");var ERR_FORBIDDEN=STANZA_ERROR("403","auth","forbidden");var ERR_GONE=STANZA_ERROR("302","modify","gone");var ERR_INTERNAL_SERVER_ERROR=STANZA_ERROR("500","wait","internal-server-error");var ERR_ITEM_NOT_FOUND=STANZA_ERROR("404","cancel","item-not-found");var ERR_JID_MALFORMED=STANZA_ERROR("400","modify","jid-malformed");var ERR_NOT_ACCEPTABLE=STANZA_ERROR("406","modify","not-acceptable");var ERR_NOT_ALLOWED=STANZA_ERROR("405","cancel","not-allowed");var ERR_NOT_AUTHORIZED=STANZA_ERROR("401","auth","not-authorized");var ERR_PAYMENT_REQUIRED=STANZA_ERROR("402","auth","payment-required");var ERR_RECIPIENT_UNAVAILABLE=STANZA_ERROR("404","wait","recipient-unavailable");var ERR_REDIRECT=STANZA_ERROR("302","modify","redirect");var ERR_REGISTRATION_REQUIRED=STANZA_ERROR("407","auth","registration-required");var ERR_REMOTE_SERVER_NOT_FOUND=STANZA_ERROR("404","cancel","remote-server-not-found");var ERR_REMOTE_SERVER_TIMEOUT=STANZA_ERROR("504","wait","remote-server-timeout");var ERR_RESOURCE_CONSTRAINT=STANZA_ERROR("500","wait","resource-constraint");var ERR_SERVICE_UNAVAILABLE=STANZA_ERROR("503","cancel","service-unavailable");var ERR_SUBSCRIPTION_REQUIRED=STANZA_ERROR("407","auth","subscription-required");var ERR_UNEXPECTED_REQUEST=STANZA_ERROR("400","wait","unexpected-request");function JSJaCConnection(oArg){if(oArg&&oArg.oDbg&&oArg.oDbg.log){this.oDbg=oArg.oDbg;}else{this.oDbg=new Object();this.oDbg.log=function(){};}if(oArg&&oArg.httpbase){this._httpbase=oArg.httpbase;}if(oArg&&oArg.allow_plain){this.allow_plain=oArg.allow_plain;}else{this.allow_plain=JSJAC_ALLOW_PLAIN;}this._connected=false;this._events=new Array();this._keys=null;this._ID=0;this._inQ=new Array();this._pQueue=new Array();this._regIDs=new Array();this._req=new Array();this._status="intialized";this._errcnt=0;this._inactivity=JSJAC_INACTIVITY;this._sendRawCallbacks=new Array();if(oArg&&oArg.timerval){this.setPollInterval(oArg.timerval);}}JSJaCConnection.prototype.connect=function(oArg){this._setStatus("connecting");this.domain=oArg.domain||"localhost";this.username=oArg.username;this.resource=oArg.resource;this.pass=oArg.pass;this.register=oArg.register;this.authhost=oArg.authhost||this.domain;this.authtype=oArg.authtype||"sasl";if(oArg.xmllang&&oArg.xmllang!=""){this._xmllang=oArg.xmllang;}this.host=oArg.host||this.domain;this.port=oArg.port||5222;if(oArg.secure){this.secure="true";}else{this.secure="false";}if(oArg.wait){this._wait=oArg.wait;}this.jid=this.username+"@"+this.domain;this.fulljid=this.jid+"/"+this.resource;this._rid=Math.round(100000.5+(((900000.49999)-(100000.5))*Math.random()));var slot=this._getFreeSlot();this._req[slot]=this._setupRequest(true);var reqstr=this._getInitialRequestString();this.oDbg.log(reqstr,4);this._req[slot].r.onreadystatechange=JSJaC.bind(function(){if(this._req[slot].r.readyState==4){this.oDbg.log("async recv: "+this._req[slot].r.responseText,4);this._handleInitialResponse(slot);}},this);if(typeof(this._req[slot].r.onerror)!="undefined"){this._req[slot].r.onerror=JSJaC.bind(function(e){this.oDbg.log("XmlHttpRequest error",1);return false;},this);}this._req[slot].r.send(reqstr);};JSJaCConnection.prototype.connected=function(){return this._connected;};JSJaCConnection.prototype.disconnect=function(){this._setStatus("disconnecting");if(!this.connected()){return;}this._connected=false;clearInterval(this._interval);clearInterval(this._inQto);if(this._timeout){clearTimeout(this._timeout);}var slot=this._getFreeSlot();this._req[slot]=this._setupRequest(false);request=this._getRequestString(false,true);this.oDbg.log("Disconnecting: "+request,4);this._req[slot].r.send(request);try{JSJaCCookie.read("JSJaC_State").erase();}catch(e){}this.oDbg.log("Disconnected: "+this._req[slot].r.responseText,2);this._handleEvent("ondisconnect");};JSJaCConnection.prototype.getPollInterval=function(){return this._timerval;};JSJaCConnection.prototype.registerHandler=function(event){event=event.toLowerCase();var eArg={handler:arguments[arguments.length-1],childName:"*",childNS:"*",type:"*"};if(arguments.length>2){eArg.childName=arguments[1];}if(arguments.length>3){eArg.childNS=arguments[2];}if(arguments.length>4){eArg.type=arguments[3];}if(!this._events[event]){this._events[event]=new Array(eArg);}else{this._events[event]=this._events[event].concat(eArg);}this._events[event]=this._events[event].sort(function(a,b){var aRank=0;var bRank=0;with(a){if(type=="*"){aRank++;}if(childNS=="*"){aRank++;}if(childName=="*"){aRank++;}}with(b){if(type=="*"){bRank++;}if(childNS=="*"){bRank++;}if(childName=="*"){bRank++;}}if(aRank>bRank){return 1;}if(aRank<bRank){return -1;}return 0;});this.oDbg.log("registered handler for event '"+event+"'",2);};JSJaCConnection.prototype.unregisterHandler=function(event,handler){event=event.toLowerCase();if(!this._events[event]){return;}var arr=this._events[event],res=new Array();for(var i=0;i<arr.length;i++){if(arr[i].handler!=handler){res.push(arr[i]);}}if(arr.length!=res.length){this._events[event]=res;this.oDbg.log("unregistered handler for event '"+event+"'",2);}};JSJaCConnection.prototype.registerIQGet=function(childName,childNS,handler){this.registerHandler("iq",childName,childNS,"get",handler);};JSJaCConnection.prototype.registerIQSet=function(childName,childNS,handler){this.registerHandler("iq",childName,childNS,"set",handler);};JSJaCConnection.prototype.resume=function(){try{this._setStatus("resuming");var s=unescape(JSJaCCookie.read("JSJaC_State").getValue());this.oDbg.log("read cookie: "+s,2);var o=JSJaCJSON.parse(s);for(var i in o){if(o.hasOwnProperty(i)){this[i]=o[i];}}if(this._keys){this._keys2=new JSJaCKeys();var u=this._keys2._getSuspendVars();for(var i=0;i<u.length;i++){this._keys2[u[i]]=this._keys[u[i]];}this._keys=this._keys2;}try{JSJaCCookie.read("JSJaC_State").erase();}catch(e){}if(this._connected){this._handleEvent("onresume");setTimeout(JSJaC.bind(this._resume,this),this.getPollInterval());this._interval=setInterval(JSJaC.bind(this._checkQueue,this),JSJAC_CHECKQUEUEINTERVAL);this._inQto=setInterval(JSJaC.bind(this._checkInQ,this),JSJAC_CHECKINQUEUEINTERVAL);}return(this._connected===true);}catch(e){if(e.message){this.oDbg.log("Resume failed: "+e.message,1);}else{this.oDbg.log("Resume failed: "+e,1);}return false;}};JSJaCConnection.prototype.send=function(packet,cb,arg){if(!packet||!packet.pType){this.oDbg.log("no packet: "+packet,1);return false;}if(!this.connected()){return false;}if(cb){if(!packet.getID()){packet.setID("JSJaCID_"+this._ID++);}this._registerPID(packet.getID(),cb,arg);}try{this._handleEvent(packet.pType()+"_out",packet);this._handleEvent("packet_out",packet);this._pQueue=this._pQueue.concat(packet.xml());}catch(e){this.oDbg.log(e.toString(),1);return false;}return true;};JSJaCConnection.prototype.sendIQ=function(iq,handlers,arg){if(!iq||iq.pType()!="iq"){return false;}handlers=handlers||{};var error_handler=handlers.error_handler||function(aIq){this.oDbg.log(iq.xml(),1);};var result_handler=handlers.result_handler||function(aIq){this.oDbg.log(aIq.xml(),2);};var default_handler=handlers.default_handler||function(aIq){this.oDbg.log(aIq.xml(),2);};var iqHandler=function(aIq,arg){switch(aIq.getType()){case"error":error_handler(aIq);break;case"result":result_handler(aIq,arg);break;default:default_handler(aIq,arg);}};return this.send(iq,iqHandler,arg);};JSJaCConnection.prototype.setPollInterval=function(timerval){if(timerval&&!isNaN(timerval)){this._timerval=timerval;}return this._timerval;};JSJaCConnection.prototype.status=function(){return this._status;};JSJaCConnection.prototype.suspend=function(){clearTimeout(this._timeout);clearInterval(this._interval);clearInterval(this._inQto);this._suspend();var u=("_connected,_keys,_ID,_inQ,_pQueue,_regIDs,_errcnt,_inactivity,domain,username,resource,jid,fulljid,_sid,_httpbase,_timerval,_is_polling").split(",");u=u.concat(this._getSuspendVars());var s=new Object();for(var i=0;i<u.length;i++){if(!this[u[i]]){continue;}if(this[u[i]]._getSuspendVars){var uo=this[u[i]]._getSuspendVars();var o=new Object();for(var j=0;j<uo.length;j++){o[uo[j]]=this[u[i]][uo[j]];}}else{var o=this[u[i]];}s[u[i]]=o;}var c=new JSJaCCookie("JSJaC_State",escape(JSJaCJSON.toString(s)),this._inactivity);this.oDbg.log("writing cookie: "+unescape(c.value)+"\n(length:"+unescape(c.value).length+")",2);c.write();try{var c2=JSJaCCookie.read("JSJaC_State");if(c.value!=c2.value){this.oDbg.log("Suspend failed writing cookie.\nRead: "+unescape(JSJaCCookie.read("JSJaC_State")),1);c.erase();}this._connected=false;this._setStatus("suspending");}catch(e){this.oDbg.log("Failed reading cookie 'JSJaC_State': "+e.message);}};JSJaCConnection.prototype._abort=function(){clearTimeout(this._timeout);clearInterval(this._inQto);clearInterval(this._interval);this._connected=false;this._setStatus("aborted");this.oDbg.log("Disconnected.",1);this._handleEvent("ondisconnect");this._handleEvent("onerror",JSJaCError("500","cancel","service-unavailable"));};JSJaCConnection.prototype._checkInQ=function(){for(var i=0;i<this._inQ.length&&i<10;i++){var item=this._inQ[0];this._inQ=this._inQ.slice(1,this._inQ.length);var packet=JSJaCPacket.wrapNode(item);if(!packet){return;}this._handleEvent("packet_in",packet);if(packet.pType&&!this._handlePID(packet)){this._handleEvent(packet.pType()+"_in",packet);this._handleEvent(packet.pType(),packet);}}};JSJaCConnection.prototype._checkQueue=function(){if(this._pQueue.length!=0){this._process();}return true;};JSJaCConnection.prototype._doAuth=function(){if(this.has_sasl&&this.authtype=="nonsasl"){this.oDbg.log("Warning: SASL present but not used",1);}if(!this._doSASLAuth()&&!this._doLegacyAuth()){this.oDbg.log("Auth failed for authtype "+this.authtype,1);this.disconnect();return false;}return true;};JSJaCConnection.prototype._doInBandReg=function(){if(this.authtype=="saslanon"||this.authtype=="anonymous"){return;}var iq=new JSJaCIQ();iq.setType("set");iq.setID("reg1");iq.appendNode("query",{xmlns:"jabber:iq:register"},[["username",this.username],["password",this.pass]]);this.send(iq,this._doInBandRegDone);};JSJaCConnection.prototype._doInBandRegDone=function(iq){if(iq&&iq.getType()=="error"){this.oDbg.log("registration failed for "+this.username,0);this._handleEvent("onerror",iq.getChild("error"));return;}this.oDbg.log(this.username+" registered succesfully",0);this._doAuth();};JSJaCConnection.prototype._doLegacyAuth=function(){if(this.authtype!="nonsasl"&&this.authtype!="anonymous"){return false;}var iq=new JSJaCIQ();iq.setIQ(this.server,"get","auth1");iq.appendNode("query",{xmlns:"jabber:iq:auth"},[["username",this.username]]);this.send(iq,this._doLegacyAuth2);return true;};JSJaCConnection.prototype._doLegacyAuth2=function(iq){if(!iq||iq.getType()!="result"){if(iq&&iq.getType()=="error"){this._handleEvent("onerror",iq.getChild("error"));}this.disconnect();return;}var use_digest=(iq.getChild("digest")!=null);var iq=new JSJaCIQ();iq.setIQ(this.server,"set","auth2");query=iq.appendNode("query",{xmlns:"jabber:iq:auth"},[["username",this.username],["resource",this.resource]]);if(use_digest){query.appendChild(iq.buildNode("digest",hex_sha1(this.streamid+this.pass)));}else{if(this.allow_plain){query.appendChild(iq.buildNode("password",this.pass));}else{this.oDbg.log("no valid login mechanism found",1);this.disconnect();return false;}}this.send(iq,this._doLegacyAuthDone);};JSJaCConnection.prototype._doLegacyAuthDone=function(iq){if(iq.getType()!="result"){if(iq.getType()=="error"){this._handleEvent("onerror",iq.getChild("error"));}this.disconnect();}else{this._handleEvent("onconnect");}};JSJaCConnection.prototype._doSASLAuth=function(){if(this.authtype=="nonsasl"||this.authtype=="anonymous"){return false;}if(this.authtype=="saslanon"){if(this.mechs["ANONYMOUS"]){this.oDbg.log("SASL using mechanism 'ANONYMOUS'",2);return this._sendRaw("<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='ANONYMOUS'/>",this._doSASLAuthDone);}this.oDbg.log("SASL ANONYMOUS requested but not supported",1);}else{if(this.mechs["DIGEST-MD5"]){this.oDbg.log("SASL using mechanism 'DIGEST-MD5'",2);return this._sendRaw("<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='DIGEST-MD5'/>",this._doSASLAuthDigestMd5S1);}else{if(this.allow_plain&&this.mechs["PLAIN"]){this.oDbg.log("SASL using mechanism 'PLAIN'",2);var authStr=this.username+"@"+this.domain+String.fromCharCode(0)+this.username+String.fromCharCode(0)+this.pass;this.oDbg.log("authenticating with '"+authStr+"'",2);authStr=btoa(authStr);return this._sendRaw("<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>"+authStr+"</auth>",this._doSASLAuthDone);}}this.oDbg.log("No SASL mechanism applied",1);this.authtype="nonsasl";}return false;};JSJaCConnection.prototype._doSASLAuthDigestMd5S1=function(el){if(el.nodeName!="challenge"){this.oDbg.log("challenge missing",1);this._handleEvent("onerror",JSJaCError("401","auth","not-authorized"));this.disconnect();}else{var challenge=atob(el.firstChild.nodeValue);this.oDbg.log("got challenge: "+challenge,2);this._nonce=challenge.substring(challenge.indexOf("nonce=")+7);this._nonce=this._nonce.substring(0,this._nonce.indexOf('"'));this.oDbg.log("nonce: "+this._nonce,2);if(this._nonce==""||this._nonce.indexOf('"')!=-1){this.oDbg.log("nonce not valid, aborting",1);this.disconnect();return;}this._digest_uri="xmpp/";this._digest_uri+=this.domain;this._cnonce=cnonce(14);this._nc="00000001";var A1=str_md5(this.username+":"+this.domain+":"+this.pass)+":"+this._nonce+":"+this._cnonce;var A2="AUTHENTICATE:"+this._digest_uri;var response=hex_md5(hex_md5(A1)+":"+this._nonce+":"+this._nc+":"+this._cnonce+":auth:"+hex_md5(A2));var rPlain='username="'+this.username+'",realm="'+this.domain+'",nonce="'+this._nonce+'",cnonce="'+this._cnonce+'",nc="'+this._nc+'",qop=auth,digest-uri="'+this._digest_uri+'",response="'+response+'",charset=utf-8';this.oDbg.log("response: "+rPlain,2);this._sendRaw("<response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>"+binb2b64(str2binb(rPlain))+"</response>",this._doSASLAuthDigestMd5S2);}};JSJaCConnection.prototype._doSASLAuthDigestMd5S2=function(el){if(el.nodeName=="failure"){if(el.xml){this.oDbg.log("auth error: "+el.xml,1);}else{this.oDbg.log("auth error",1);}this._handleEvent("onerror",JSJaCError("401","auth","not-authorized"));this.disconnect();return;}var response=atob(el.firstChild.nodeValue);this.oDbg.log("response: "+response,2);var rspauth=response.substring(response.indexOf("rspauth=")+8);this.oDbg.log("rspauth: "+rspauth,2);var A1=str_md5(this.username+":"+this.domain+":"+this.pass)+":"+this._nonce+":"+this._cnonce;var A2=":"+this._digest_uri;var rsptest=hex_md5(hex_md5(A1)+":"+this._nonce+":"+this._nc+":"+this._cnonce+":auth:"+hex_md5(A2));this.oDbg.log("rsptest: "+rsptest,2);if(rsptest!=rspauth){this.oDbg.log("SASL Digest-MD5: server repsonse with wrong rspauth",1);this.disconnect();return;}if(el.nodeName=="success"){this._reInitStream(this.domain,this._doStreamBind);}else{this._sendRaw("<response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>",this._doSASLAuthDone);}};JSJaCConnection.prototype._doSASLAuthDone=function(el){if(el.nodeName!="success"){this.oDbg.log("auth failed",1);this._handleEvent("onerror",JSJaCError("401","auth","not-authorized"));this.disconnect();}else{this._reInitStream(this.domain,this._doStreamBind);}};JSJaCConnection.prototype._doStreamBind=function(){var iq=new JSJaCIQ();iq.setIQ(this.domain,"set","bind_1");iq.appendNode("bind",{xmlns:"urn:ietf:params:xml:ns:xmpp-bind"},[["resource",this.resource]]);this.oDbg.log(iq.xml());this.send(iq,this._doXMPPSess);};JSJaCConnection.prototype._doXMPPSess=function(iq){if(iq.getType()!="result"||iq.getType()=="error"){this.disconnect();if(iq.getType()=="error"){this._handleEvent("onerror",iq.getChild("error"));}return;}this.fulljid=iq.getChildVal("jid");this.jid=this.fulljid.substring(0,this.fulljid.lastIndexOf("/"));iq=new JSJaCIQ();iq.setIQ(this.domain,"set","sess_1");iq.appendNode("session",{xmlns:"urn:ietf:params:xml:ns:xmpp-session"},[]);this.oDbg.log(iq.xml());this.send(iq,this._doXMPPSessDone);};JSJaCConnection.prototype._doXMPPSessDone=function(iq){if(iq.getType()!="result"||iq.getType()=="error"){this.disconnect();if(iq.getType()=="error"){this._handleEvent("onerror",iq.getChild("error"));}return;}else{this._handleEvent("onconnect");}};JSJaCConnection.prototype._handleEvent=function(event,arg){event=event.toLowerCase();this.oDbg.log("incoming event '"+event+"'",3);if(!this._events[event]){return;}this.oDbg.log("handling event '"+event+"'",2);for(var i=0;i<this._events[event].length;i++){var aEvent=this._events[event][i];if(aEvent.handler){try{if(arg){if(arg.pType){if((!arg.getNode().hasChildNodes()&&aEvent.childName!="*")||(arg.getNode().hasChildNodes()&&!arg.getChild(aEvent.childName,aEvent.childNS))){continue;}if(aEvent.type!="*"&&arg.getType()!=aEvent.type){continue;}this.oDbg.log(aEvent.childName+"/"+aEvent.childNS+"/"+aEvent.type+" => match for handler "+aEvent.handler,3);}if(aEvent.handler.call(this,arg)){break;}}else{if(aEvent.handler.call(this)){break;}}}catch(e){this.oDbg.log(aEvent.handler+"\n>>>"+e.name+": "+e.message,1);}}}};JSJaCConnection.prototype._handlePID=function(aJSJaCPacket){if(!aJSJaCPacket.getID()){return false;}for(var i in this._regIDs){if(this._regIDs.hasOwnProperty(i)&&this._regIDs[i]&&i==aJSJaCPacket.getID()){var pID=aJSJaCPacket.getID();this.oDbg.log("handling "+pID,3);try{if(this._regIDs[i].cb.call(this,aJSJaCPacket,this._regIDs[i].arg)===false){return false;}else{this._unregisterPID(pID);return true;}}catch(e){this.oDbg.log(e.name+": "+e.message);this._unregisterPID(pID);return true;}}}return false;};JSJaCConnection.prototype._handleResponse=function(req){var rootEl=this._parseResponse(req);if(!rootEl){return;}for(var i=0;i<rootEl.childNodes.length;i++){if(this._sendRawCallbacks.length){var cb=this._sendRawCallbacks[0];this._sendRawCallbacks=this._sendRawCallbacks.slice(1,this._sendRawCallbacks.length);cb.fn.call(this,rootEl.childNodes.item(i),cb.arg);continue;}this._inQ=this._inQ.concat(rootEl.childNodes.item(i));}};JSJaCConnection.prototype._parseStreamFeatures=function(doc){if(!doc){this.oDbg.log("nothing to parse ... aborting",1);return false;}var errorTag;if(doc.getElementsByTagNameNS){errorTag=doc.getElementsByTagNameNS("http://etherx.jabber.org/streams","error").item(0);}else{var errors=doc.getElementsByTagName("error");for(var i=0;i<errors.length;i++){if(errors.item(i).namespaceURI=="http://etherx.jabber.org/streams"){errorTag=errors.item(i);break;}}}if(errorTag){this._setStatus("internal_server_error");clearTimeout(this._timeout);clearInterval(this._interval);clearInterval(this._inQto);this._handleEvent("onerror",JSJaCError("503","cancel","session-terminate"));this._connected=false;this.oDbg.log("Disconnected.",1);this._handleEvent("ondisconnect");return false;}this.mechs=new Object();var lMec1=doc.getElementsByTagName("mechanisms");this.has_sasl=false;for(var i=0;i<lMec1.length;i++){if(lMec1.item(i).getAttribute("xmlns")=="urn:ietf:params:xml:ns:xmpp-sasl"){this.has_sasl=true;var lMec2=lMec1.item(i).getElementsByTagName("mechanism");for(var j=0;j<lMec2.length;j++){this.mechs[lMec2.item(j).firstChild.nodeValue]=true;}break;}}if(this.has_sasl){this.oDbg.log("SASL detected",2);}else{this.authtype="nonsasl";this.oDbg.log("No support for SASL detected",2);}return true;};JSJaCConnection.prototype._process=function(timerval){if(!this.connected()){this.oDbg.log("Connection lost ...",1);if(this._interval){clearInterval(this._interval);}return;}this.setPollInterval(timerval);if(this._timeout){clearTimeout(this._timeout);}var slot=this._getFreeSlot();if(slot<0){return;}if(typeof(this._req[slot])!="undefined"&&typeof(this._req[slot].r)!="undefined"&&this._req[slot].r.readyState!=4){this.oDbg.log("Slot "+slot+" is not ready");return;}if(!this.isPolling()&&this._pQueue.length==0&&this._req[(slot+1)%2]&&this._req[(slot+1)%2].r.readyState!=4){this.oDbg.log("all slots busy, standby ...",2);return;}if(!this.isPolling()){this.oDbg.log("Found working slot at "+slot,2);}this._req[slot]=this._setupRequest(true);this._req[slot].r.onreadystatechange=JSJaC.bind(function(){if(!this.connected()){return;}if(this._req[slot].r.readyState==4){this._setStatus("processing");this.oDbg.log("async recv: "+this._req[slot].r.responseText,4);this._handleResponse(this._req[slot]);if(this._pQueue.length){this._timeout=setTimeout(JSJaC.bind(this._process,this),100);}else{this.oDbg.log("scheduling next poll in "+this.getPollInterval()+" msec",4);this._timeout=setTimeout(JSJaC.bind(this._process,this),this.getPollInterval());}}},this);try{this._req[slot].r.onerror=JSJaC.bind(function(){if(!this.connected()){return;}this._errcnt++;this.oDbg.log("XmlHttpRequest error ("+this._errcnt+")",1);if(this._errcnt>JSJAC_ERR_COUNT){this._abort();return false;}this._setStatus("onerror_fallback");setTimeout(JSJaC.bind(this._resume,this),this.getPollInterval());return false;},this);}catch(e){}var reqstr=this._getRequestString();if(typeof(this._rid)!="undefined"){this._req[slot].rid=this._rid;}this.oDbg.log("sending: "+reqstr,4);this._req[slot].r.send(reqstr);};JSJaCConnection.prototype._registerPID=function(pID,cb,arg){if(!pID||!cb){return false;}this._regIDs[pID]=new Object();this._regIDs[pID].cb=cb;if(arg){this._regIDs[pID].arg=arg;}this.oDbg.log("registered "+pID,3);return true;};JSJaCConnection.prototype._sendEmpty=function JSJaCSendEmpty(){var slot=this._getFreeSlot();this._req[slot]=this._setupRequest(true);this._req[slot].r.onreadystatechange=JSJaC.bind(function(){if(this._req[slot].r.readyState==4){this.oDbg.log("async recv: "+this._req[slot].r.responseText,4);this._getStreamID(slot);}},this);if(typeof(this._req[slot].r.onerror)!="undefined"){this._req[slot].r.onerror=JSJaC.bind(function(e){this.oDbg.log("XmlHttpRequest error",1);return false;},this);}var reqstr=this._getRequestString();this.oDbg.log("sending: "+reqstr,4);this._req[slot].r.send(reqstr);};JSJaCConnection.prototype._sendRaw=function(xml,cb,arg){if(cb){this._sendRawCallbacks.push({fn:cb,arg:arg});}this._pQueue.push(xml);this._process();return true;};JSJaCConnection.prototype._setStatus=function(status){if(!status||status==""){return;}if(status!=this._status){this._status=status;this._handleEvent("onstatuschanged",status);this._handleEvent("status_changed",status);}};JSJaCConnection.prototype._unregisterPID=function(pID){if(!this._regIDs[pID]){return false;}this._regIDs[pID]=null;this.oDbg.log("unregistered "+pID,3);return true;};function JSJaCConsoleLogger(level){this.level=level||4;this.start=function(){};this.log=function(msg,level){level=level||0;if(level>this.level){return;}if(typeof(console)=="undefined"){return;}try{switch(level){case 0:console.warn(msg);break;case 1:console.error(msg);break;case 2:console.info(msg);break;case 4:console.debug(msg);break;default:console.log(msg);break;}}catch(e){try{console.log(msg);}catch(e){}}};this.setLevel=function(level){this.level=level;return this;};this.getLevel=function(){return this.level;};}function JSJaCCookie(name,value,secs){if(window==this){return new JSJaCCookie(name,value,secs);}this.name=name;this.value=value;this.expires=secs;this.write=function(){if(this.secs){var date=new Date();date.setTime(date.getTime()+(this.secs*1000));var expires="; expires="+date.toGMTString();}else{var expires="";}document.cookie=this.getName()+"="+this.getValue()+expires+"; path=/";};this.erase=function(){var c=new JSJaCCookie(this.getName(),"",-1);c.write();};this.getName=function(){return this.name;};this.setName=function(name){this.name=name;return this;};this.getValue=function(){return this.value;};this.setValue=function(value){this.value=value;return this;};}JSJaCCookie.read=function(name){var nameEQ=name+"=";var ca=document.cookie.split(";");for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==" "){c=c.substring(1,c.length);}if(c.indexOf(nameEQ)==0){return new JSJaCCookie(name,c.substring(nameEQ.length,c.length));}}throw new JSJaCCookieException("Cookie not found");};JSJaCCookie.get=function(name){return JSJaCCookie.read(name).getValue();};JSJaCCookie.remove=function(name){JSJaCCookie.read(name).erase();};function JSJaCCookieException(msg){this.message=msg;this.name="CookieException";}function JSJaCError(code,type,condition){var xmldoc=XmlDocument.create("error","jsjac");xmldoc.documentElement.setAttribute("code",code);xmldoc.documentElement.setAttribute("type",type);xmldoc.documentElement.appendChild(xmldoc.createElement(condition)).setAttribute("xmlns","urn:ietf:params:xml:ns:xmpp-stanzas");return xmldoc.documentElement;}var JSJACJID_FORBIDDEN=['"'," ","&","'","/",":","<",">","@"];function JSJaCJID(jid){this._node="";this._domain="";this._resource="";if(typeof(jid)=="string"){if(jid.indexOf("@")!=-1){this.setNode(jid.substring(0,jid.indexOf("@")));jid=jid.substring(jid.indexOf("@")+1);}if(jid.indexOf("/")!=-1){this.setResource(jid.substring(jid.indexOf("/")+1));jid=jid.substring(0,jid.indexOf("/"));}this.setDomain(jid);}else{this.setNode(jid.node);this.setDomain(jid.domain);this.setResource(jid.resource);}}JSJaCJID.prototype.getNode=function(){return this._node;};JSJaCJID.prototype.getDomain=function(){return this._domain;};JSJaCJID.prototype.getResource=function(){return this._resource;};JSJaCJID.prototype.setNode=function(node){JSJaCJID._checkNodeName(node);this._node=node||"";return this;};JSJaCJID.prototype.setDomain=function(domain){if(!domain||domain==""){throw new JSJaCJIDInvalidException("domain name missing");}JSJaCJID._checkNodeName(domain);this._domain=domain;return this;};JSJaCJID.prototype.setResource=function(resource){this._resource=resource||"";return this;};JSJaCJID.prototype.toString=function(){var jid="";if(this.getNode()&&this.getNode()!=""){jid=this.getNode()+"@";}jid+=this.getDomain();if(this.getResource()&&this.getResource()!=""){jid+="/"+this.getResource();}return jid;};JSJaCJID.prototype.removeResource=function(){return this.setResource();};JSJaCJID.prototype.clone=function(){return new JSJaCJID(this.toString());};JSJaCJID.prototype.isEntity=function(jid){if(typeof jid=="string"){jid=(new JSJaCJID(jid));}jid.removeResource();return(this.clone().removeResource().toString()===jid.toString());};JSJaCJID._checkNodeName=function(nodeprep){if(!nodeprep||nodeprep==""){return;}for(var i=0;i<JSJACJID_FORBIDDEN.length;i++){if(nodeprep.indexOf(JSJACJID_FORBIDDEN[i])!=-1){throw new JSJaCJIDInvalidException("forbidden char in nodename: "+JSJACJID_FORBIDDEN[i]);}}};function JSJaCJIDInvalidException(message){this.message=message;this.name="JSJaCJIDInvalidException";}function JSJaCKeys(func,oDbg){var seed=Math.random();this._k=new Array();this._k[0]=seed.toString();if(oDbg){this.oDbg=oDbg;}else{this.oDbg={};this.oDbg.log=function(){};}if(func){for(var i=1;i<JSJAC_NKEYS;i++){this._k[i]=func(this._k[i-1]);oDbg.log(i+": "+this._k[i],4);}}this._indexAt=JSJAC_NKEYS-1;this.getKey=function(){return this._k[this._indexAt--];};this.lastKey=function(){return(this._indexAt==0);};this.size=function(){return this._k.length;};this._getSuspendVars=function(){return("_k,_indexAt").split(",");};}var JSJACPACKET_USE_XMLNS=true;function JSJaCPacket(name){this.name=name;if(typeof(JSJACPACKET_USE_XMLNS)!="undefined"&&JSJACPACKET_USE_XMLNS){this.doc=XmlDocument.create(name,"jabber:client");}else{this.doc=XmlDocument.create(name,"");}}JSJaCPacket.prototype.pType=function(){return this.name;};JSJaCPacket.prototype.getDoc=function(){return this.doc;};JSJaCPacket.prototype.getNode=function(){if(this.getDoc()&&this.getDoc().documentElement){return this.getDoc().documentElement;}else{return null;}};JSJaCPacket.prototype.setTo=function(to){if(!to||to==""){this.getNode().removeAttribute("to");}else{if(typeof(to)=="string"){this.getNode().setAttribute("to",to);}else{this.getNode().setAttribute("to",to.toString());}}return this;};JSJaCPacket.prototype.setFrom=function(from){if(!from||from==""){this.getNode().removeAttribute("from");}else{if(typeof(from)=="string"){this.getNode().setAttribute("from",from);}else{this.getNode().setAttribute("from",from.toString());}}return this;};JSJaCPacket.prototype.setID=function(id){if(!id||id==""){this.getNode().removeAttribute("id");}else{this.getNode().setAttribute("id",id);}return this;};JSJaCPacket.prototype.setType=function(type){if(!type||type==""){this.getNode().removeAttribute("type");}else{this.getNode().setAttribute("type",type);}return this;};JSJaCPacket.prototype.setXMLLang=function(xmllang){if(!xmllang||xmllang==""){this.getNode().removeAttribute("xml:lang");}else{this.getNode().setAttribute("xml:lang",xmllang);}return this;};JSJaCPacket.prototype.getTo=function(){return this.getNode().getAttribute("to");};JSJaCPacket.prototype.getFrom=function(){return this.getNode().getAttribute("from");};JSJaCPacket.prototype.getToJID=function(){return new JSJaCJID(this.getTo());};JSJaCPacket.prototype.getFromJID=function(){return new JSJaCJID(this.getFrom());};JSJaCPacket.prototype.getID=function(){return this.getNode().getAttribute("id");};JSJaCPacket.prototype.getType=function(){return this.getNode().getAttribute("type");};JSJaCPacket.prototype.getXMLLang=function(){return this.getNode().getAttribute("xml:lang");};JSJaCPacket.prototype.getXMLNS=function(){return this.getNode().namespaceURI;};JSJaCPacket.prototype.getChild=function(name,ns){if(!this.getNode()){return null;}name=name||"*";ns=ns||"*";if(this.getNode().getElementsByTagNameNS){return this.getNode().getElementsByTagNameNS(ns,name).item(0);}var nodes=this.getNode().getElementsByTagName(name);if(ns!="*"){for(var i=0;i<nodes.length;i++){if(nodes.item(i).namespaceURI==ns){return nodes.item(i);}}}else{return nodes.item(0);}return null;};JSJaCPacket.prototype.getChildVal=function(name,ns){var node=this.getChild(name,ns);if(node&&node.firstChild){return node.firstChild.nodeValue;}else{return"";}};JSJaCPacket.prototype.clone=function(){return JSJaCPacket.wrapNode(this.getNode());};JSJaCPacket.prototype.isError=function(){return(this.getType()=="error");};JSJaCPacket.prototype.errorReply=function(stanza_error){var rPacket=this.clone();rPacket.setTo(this.getFrom());rPacket.setFrom();rPacket.setType("error");rPacket.appendNode("error",{code:stanza_error.code,type:stanza_error.type},[[stanza_error.cond]]);return rPacket;};JSJaCPacket.prototype.xml=function(){if(this.getDoc().xml){return this.getDoc().xml;}var xml=(new XMLSerializer()).serializeToString(this.getNode());if(typeof(xml)!="undefined"){return xml;}return(new XMLSerializer()).serializeToString(this.doc);};JSJaCPacket.prototype._getAttribute=function(attr){return this.getNode().getAttribute(attr);};JSJaCPacket.prototype._replaceNode=function(aNode){for(var i=0;i<aNode.attributes.length;i++){if(aNode.attributes.item(i).nodeName!="xmlns"){this.getNode().setAttribute(aNode.attributes.item(i).nodeName,aNode.attributes.item(i).nodeValue);}}for(var i=0;i<aNode.childNodes.length;i++){if(this.getDoc().importNode){this.getNode().appendChild(this.getDoc().importNode(aNode.childNodes.item(i),true));}else{this.getNode().appendChild(aNode.childNodes.item(i).cloneNode(true));}}};JSJaCPacket.prototype._setChildNode=function(nodeName,nodeValue){var aNode=this.getChild(nodeName);var tNode=this.getDoc().createTextNode(nodeValue);if(aNode){try{aNode.replaceChild(tNode,aNode.firstChild);}catch(e){}}else{aNode=this.getNode().appendChild(this.getDoc().createElement(nodeName));aNode.appendChild(tNode);}return aNode;};JSJaCPacket.prototype.buildNode=function(elementName){return JSJaCBuilder.buildNode(this.getDoc(),elementName,arguments[1],arguments[2]);};JSJaCPacket.prototype.appendNode=function(element){if(typeof element=="object"){return this.getNode().appendChild(element);}else{return this.getNode().appendChild(this.buildNode(element,arguments[1],arguments[2]));}};function JSJaCPresence(){this.base=JSJaCPacket;this.base("presence");}JSJaCPresence.prototype=new JSJaCPacket;JSJaCPresence.prototype.setStatus=function(status){this._setChildNode("status",status);return this;};JSJaCPresence.prototype.setShow=function(show){if(show=="chat"||show=="away"||show=="xa"||show=="dnd"){this._setChildNode("show",show);}return this;};JSJaCPresence.prototype.setPriority=function(prio){this._setChildNode("priority",prio);return this;};JSJaCPresence.prototype.setPresence=function(show,status,prio){if(show){this.setShow(show);}if(status){this.setStatus(status);}if(prio){this.setPriority(prio);}return this;};JSJaCPresence.prototype.getStatus=function(){return this.getChildVal("status");};JSJaCPresence.prototype.getShow=function(){return this.getChildVal("show");};JSJaCPresence.prototype.getPriority=function(){return this.getChildVal("priority");};function JSJaCIQ(){this.base=JSJaCPacket;this.base("iq");}JSJaCIQ.prototype=new JSJaCPacket;JSJaCIQ.prototype.setIQ=function(to,type,id){if(to){this.setTo(to);}if(type){this.setType(type);}if(id){this.setID(id);}return this;};JSJaCIQ.prototype.setQuery=function(xmlns){var query;try{query=this.getDoc().createElementNS(xmlns,"query");}catch(e){query=this.getDoc().createElement("query");}if(query&&query.getAttribute("xmlns")!=xmlns){query.setAttribute("xmlns",xmlns);}this.getNode().appendChild(query);return query;};JSJaCIQ.prototype.getQuery=function(){return this.getNode().getElementsByTagName("query").item(0);};JSJaCIQ.prototype.getQueryXMLNS=function(){if(this.getQuery()){return this.getQuery().namespaceURI;}else{return null;}};JSJaCIQ.prototype.reply=function(payload){var rIQ=this.clone();rIQ.setTo(this.getFrom());rIQ.setType("result");if(payload){if(typeof payload=="string"){rIQ.getChild().appendChild(rIQ.getDoc().loadXML(payload));}else{if(payload.constructor==Array){var node=rIQ.getChild();for(var i=0;i<payload.length;i++){if(typeof payload[i]=="string"){node.appendChild(rIQ.getDoc().loadXML(payload[i]));}else{if(typeof payload[i]=="object"){node.appendChild(payload[i]);}}}}else{if(typeof payload=="object"){rIQ.getChild().appendChild(payload);}}}}return rIQ;};function JSJaCMessage(){this.base=JSJaCPacket;this.base("message");}JSJaCMessage.prototype=new JSJaCPacket;JSJaCMessage.prototype.setBody=function(body){this._setChildNode("body",body);return this;};JSJaCMessage.prototype.setSubject=function(subject){this._setChildNode("subject",subject);return this;};JSJaCMessage.prototype.setThread=function(thread){this._setChildNode("thread",thread);return this;};JSJaCMessage.prototype.getThread=function(){return this.getChildVal("thread");};JSJaCMessage.prototype.getBody=function(){return this.getChildVal("body");};JSJaCMessage.prototype.getSubject=function(){return this.getChildVal("subject");};JSJaCPacket.wrapNode=function(node){var aNode;switch(node.nodeName.toLowerCase()){case"presence":aNode=new JSJaCPresence();break;case"message":aNode=new JSJaCMessage();break;case"iq":aNode=new JSJaCIQ();break;default:return null;}aNode._replaceNode(node);return aNode;};function JSJaCHttpBindingConnection(oArg){this.base=JSJaCConnection;this.base(oArg);this._hold=JSJACHBC_MAX_HOLD;this._inactivity=0;this._last_requests=new Object();this._last_rid=0;this._min_polling=0;this._pause=0;this._wait=JSJACHBC_MAX_WAIT;}JSJaCHttpBindingConnection.prototype=new JSJaCConnection();JSJaCHttpBindingConnection.prototype.inherit=function(oArg){this.domain=oArg.domain||"localhost";this.username=oArg.username;this.resource=oArg.resource;this._sid=oArg.sid;this._rid=oArg.rid;this._min_polling=oArg.polling;this._inactivity=oArg.inactivity;this._setHold(oArg.requests-1);this.setPollInterval(this._timerval);if(oArg.wait){this._wait=oArg.wait;}this._connected=true;this._handleEvent("onconnect");this._interval=setInterval(JSJaC.bind(this._checkQueue,this),JSJAC_CHECKQUEUEINTERVAL);this._inQto=setInterval(JSJaC.bind(this._checkInQ,this),JSJAC_CHECKINQUEUEINTERVAL);this._timeout=setTimeout(JSJaC.bind(this._process,this),this.getPollInterval());};JSJaCHttpBindingConnection.prototype.setPollInterval=function(timerval){if(timerval&&!isNaN(timerval)){if(!this.isPolling()){this._timerval=100;}else{if(this._min_polling&&timerval<this._min_polling*1000){this._timerval=this._min_polling*1000;}else{if(this._inactivity&&timerval>this._inactivity*1000){this._timerval=this._inactivity*1000;}else{this._timerval=timerval;}}}}return this._timerval;};JSJaCHttpBindingConnection.prototype.isPolling=function(){return(this._hold==0);};JSJaCHttpBindingConnection.prototype._getFreeSlot=function(){for(var i=0;i<this._hold+1;i++){if(typeof(this._req[i])=="undefined"||typeof(this._req[i].r)=="undefined"||this._req[i].r.readyState==4){return i;}}return -1;};JSJaCHttpBindingConnection.prototype._getHold=function(){return this._hold;};JSJaCHttpBindingConnection.prototype._getRequestString=function(raw,last){raw=raw||"";var reqstr="";if(this._rid<=this._last_rid&&typeof(this._last_requests[this._rid])!="undefined"){reqstr=this._last_requests[this._rid].xml;}else{var xml="";while(this._pQueue.length){var curNode=this._pQueue[0];xml+=curNode;this._pQueue=this._pQueue.slice(1,this._pQueue.length);}reqstr="<body rid='"+this._rid+"' sid='"+this._sid+"' xmlns='http://jabber.org/protocol/httpbind' ";if(JSJAC_HAVEKEYS){reqstr+="key='"+this._keys.getKey()+"' ";if(this._keys.lastKey()){this._keys=new JSJaCKeys(hex_sha1,this.oDbg);reqstr+="newkey='"+this._keys.getKey()+"' ";}}if(last){reqstr+="type='terminate' ";}else{if(this._reinit){if(JSJACHBC_USE_BOSH_VER){reqstr+="xmpp:restart='true' ";}this._reinit=false;}}if(xml!=""||raw!=""){reqstr+=">"+raw+xml+"</body>";}else{reqstr+="/>";}this._last_requests[this._rid]=new Object();this._last_requests[this._rid].xml=reqstr;this._last_rid=this._rid;for(var i in this._last_requests){if(this._last_requests.hasOwnProperty(i)&&i<this._rid-this._hold){delete (this._last_requests[i]);}}}return reqstr;};JSJaCHttpBindingConnection.prototype._getInitialRequestString=function(){var reqstr="<body hold='"+this._hold+"' xmlns='http://jabber.org/protocol/httpbind' to='"+this.authhost+"' wait='"+this._wait+"' rid='"+this._rid+"'";if(this.host||this.port){reqstr+=" route='xmpp:"+this.host+":"+this.port+"'";}if(this.secure){reqstr+=" secure='"+this.secure+"'";}if(JSJAC_HAVEKEYS){this._keys=new JSJaCKeys(hex_sha1,this.oDbg);key=this._keys.getKey();reqstr+=" newkey='"+key+"'";}if(this._xmllang){reqstr+=" xml:lang='"+this._xmllang+"'";}if(JSJACHBC_USE_BOSH_VER){reqstr+=" ver='"+JSJACHBC_BOSH_VERSION+"'";reqstr+=" xmpp:xmlns='urn:xmpp:xbosh'";if(this.authtype=="sasl"||this.authtype=="saslanon"){reqstr+=" xmpp:version='1.0'";}}reqstr+="/>";return reqstr;};JSJaCHttpBindingConnection.prototype._getStreamID=function(slot){this.oDbg.log(this._req[slot].r.responseText,4);if(!this._req[slot].r.responseXML||!this._req[slot].r.responseXML.documentElement){this._handleEvent("onerror",JSJaCError("503","cancel","service-unavailable"));return;}var body=this._req[slot].r.responseXML.documentElement;if(body.getAttribute("authid")){this.streamid=body.getAttribute("authid");this.oDbg.log("got streamid: "+this.streamid,2);}else{this._timeout=setTimeout(JSJaC.bind(this._sendEmpty,this),this.getPollInterval());return;}this._timeout=setTimeout(JSJaC.bind(this._process,this),this.getPollInterval());if(!this._parseStreamFeatures(body)){return;}if(this.register){this._doInBandReg();}else{this._doAuth();}};JSJaCHttpBindingConnection.prototype._getSuspendVars=function(){return("host,port,secure,_rid,_last_rid,_wait,_min_polling,_inactivity,_hold,_last_requests,_pause").split(",");};JSJaCHttpBindingConnection.prototype._handleInitialResponse=function(slot){try{this.oDbg.log(this._req[slot].r.getAllResponseHeaders(),4);this.oDbg.log(this._req[slot].r.responseText,4);}catch(ex){this.oDbg.log("No response",4);}if(this._req[slot].r.status!=200||!this._req[slot].r.responseXML){this.oDbg.log("initial response broken (status: "+this._req[slot].r.status+")",1);this._handleEvent("onerror",JSJaCError("503","cancel","service-unavailable"));return;}var body=this._req[slot].r.responseXML.documentElement;if(!body||body.tagName!="body"||body.namespaceURI!="http://jabber.org/protocol/httpbind"){this.oDbg.log("no body element or incorrect body in initial response",1);this._handleEvent("onerror",JSJaCError("500","wait","internal-service-error"));return;}if(body.getAttribute("type")=="terminate"){this.oDbg.log("invalid response:\n"+this._req[slot].r.responseText,1);clearTimeout(this._timeout);this._connected=false;this.oDbg.log("Disconnected.",1);this._handleEvent("ondisconnect");this._handleEvent("onerror",JSJaCError("503","cancel","service-unavailable"));return;}this._sid=body.getAttribute("sid");this.oDbg.log("got sid: "+this._sid,2);if(body.getAttribute("polling")){this._min_polling=body.getAttribute("polling");}if(body.getAttribute("inactivity")){this._inactivity=body.getAttribute("inactivity");}if(body.getAttribute("requests")){this._setHold(body.getAttribute("requests")-1);}this.oDbg.log("set hold to "+this._getHold(),2);if(body.getAttribute("ver")){this._bosh_version=body.getAttribute("ver");}if(body.getAttribute("maxpause")){this._pause=Number.max(body.getAttribute("maxpause"),JSJACHBC_MAXPAUSE);}this.setPollInterval(this._timerval);this._connected=true;this._inQto=setInterval(JSJaC.bind(this._checkInQ,this),JSJAC_CHECKINQUEUEINTERVAL);this._interval=setInterval(JSJaC.bind(this._checkQueue,this),JSJAC_CHECKQUEUEINTERVAL);this._getStreamID(slot);};JSJaCHttpBindingConnection.prototype._parseResponse=function(req){if(!this.connected()||!req){return null;}var r=req.r;try{if(r.status==404||r.status==403){this._abort();return null;}if(r.status!=200||!r.responseXML){this._errcnt++;var errmsg="invalid response ("+r.status+"):\n"+r.getAllResponseHeaders()+"\n"+r.responseText;if(!r.responseXML){errmsg+="\nResponse failed to parse!";}this.oDbg.log(errmsg,1);if(this._errcnt>JSJAC_ERR_COUNT){this._abort();return null;}this.oDbg.log("repeating ("+this._errcnt+")",1);this._setStatus("proto_error_fallback");setTimeout(JSJaC.bind(this._resume,this),this.getPollInterval());return null;}}catch(e){this.oDbg.log("XMLHttpRequest error: status not available",1);this._errcnt++;if(this._errcnt>JSJAC_ERR_COUNT){this._abort();}else{this.oDbg.log("repeating ("+this._errcnt+")",1);this._setStatus("proto_error_fallback");setTimeout(JSJaC.bind(this._resume,this),this.getPollInterval());}return null;}var body=r.responseXML.documentElement;if(!body||body.tagName!="body"||body.namespaceURI!="http://jabber.org/protocol/httpbind"){this.oDbg.log("invalid response:\n"+r.responseText,1);clearTimeout(this._timeout);clearInterval(this._interval);clearInterval(this._inQto);this._connected=false;this.oDbg.log("Disconnected.",1);this._handleEvent("ondisconnect");this._setStatus("internal_server_error");this._handleEvent("onerror",JSJaCError("500","wait","internal-server-error"));return null;}if(typeof(req.rid)!="undefined"&&this._last_requests[req.rid]){if(this._last_requests[req.rid].handled){this.oDbg.log("already handled "+req.rid,2);return null;}else{this._last_requests[req.rid].handled=true;}}if(body.getAttribute("type")=="terminate"){this.oDbg.log("session terminated:\n"+r.responseText,1);clearTimeout(this._timeout);clearInterval(this._interval);clearInterval(this._inQto);if(body.getAttribute("condition")=="remote-stream-error"){if(body.getElementsByTagName("conflict").length>0){this._setStatus("session-terminate-conflict");}}this._handleEvent("onerror",JSJaCError("503","cancel",body.getAttribute("condition")));this._connected=false;this.oDbg.log("Disconnected.",1);this._handleEvent("ondisconnect");return null;}this._errcnt=0;return r.responseXML.documentElement;};JSJaCHttpBindingConnection.prototype._reInitStream=function(to,cb,arg){this._reinit=true;cb.call(this,arg);};JSJaCHttpBindingConnection.prototype._resume=function(){if(this._pause==0&&this._rid>=this._last_rid){this._rid=this._last_rid-1;}this._process();};JSJaCHttpBindingConnection.prototype._setHold=function(hold){if(!hold||isNaN(hold)||hold<0){hold=0;}else{if(hold>JSJACHBC_MAX_HOLD){hold=JSJACHBC_MAX_HOLD;}}this._hold=hold;return this._hold;};JSJaCHttpBindingConnection.prototype._setupRequest=function(async){var req=new Object();var r=XmlHttp.create();try{r.open("POST",this._httpbase,async);r.setRequestHeader("Content-Type","text/xml; charset=utf-8");}catch(e){this.oDbg.log(e,1);}req.r=r;this._rid++;req.rid=this._rid;return req;};JSJaCHttpBindingConnection.prototype._suspend=function(){if(this._pause==0){return;}var slot=this._getFreeSlot();this._req[slot]=this._setupRequest(false);var reqstr="<body pause='"+this._pause+"' xmlns='http://jabber.org/protocol/httpbind' sid='"+this._sid+"' rid='"+this._rid+"'";if(JSJAC_HAVEKEYS){reqstr+=" key='"+this._keys.getKey()+"'";if(this._keys.lastKey()){this._keys=new JSJaCKeys(hex_sha1,this.oDbg);reqstr+=" newkey='"+this._keys.getKey()+"'";}}reqstr+=">";while(this._pQueue.length){var curNode=this._pQueue[0];reqstr+=curNode;this._pQueue=this._pQueue.slice(1,this._pQueue.length);}reqstr+="</body>";this.oDbg.log("Disconnecting: "+reqstr,4);this._req[slot].r.send(reqstr);};function JSJaCHttpPollingConnection(oArg){this.base=JSJaCConnection;this.base(oArg);JSJACPACKET_USE_XMLNS=false;}JSJaCHttpPollingConnection.prototype=new JSJaCConnection();JSJaCHttpPollingConnection.prototype.isPolling=function(){return true;};JSJaCHttpPollingConnection.prototype._getFreeSlot=function(){if(typeof(this._req[0])=="undefined"||typeof(this._req[0].r)=="undefined"||this._req[0].r.readyState==4){return 0;}else{return -1;}};JSJaCHttpPollingConnection.prototype._getInitialRequestString=function(){var reqstr="0";if(JSJAC_HAVEKEYS){this._keys=new JSJaCKeys(b64_sha1,this.oDbg);key=this._keys.getKey();reqstr+=";"+key;}var streamto=this.domain;if(this.authhost){streamto=this.authhost;}reqstr+=",<stream:stream to='"+streamto+"' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'";if(this.authtype=="sasl"||this.authtype=="saslanon"){reqstr+=" version='1.0'";}reqstr+=">";return reqstr;};JSJaCHttpPollingConnection.prototype._getRequestString=function(raw,last){var reqstr=this._sid;if(JSJAC_HAVEKEYS){reqstr+=";"+this._keys.getKey();if(this._keys.lastKey()){this._keys=new JSJaCKeys(b64_sha1,this.oDbg);reqstr+=";"+this._keys.getKey();}}reqstr+=",";if(raw){reqstr+=raw;}while(this._pQueue.length){reqstr+=this._pQueue[0];this._pQueue=this._pQueue.slice(1,this._pQueue.length);}if(last){reqstr+="</stream:stream>";}return reqstr;};JSJaCHttpPollingConnection.prototype._getStreamID=function(){if(this._req[0].r.responseText==""){this.oDbg.log("waiting for stream id",2);this._timeout=setTimeout(JSJaC.bind(this._sendEmpty,this),1000);return;}this.oDbg.log(this._req[0].r.responseText,4);if(this._req[0].r.responseText.match(/id=[\'\"]([^\'\"]+)[\'\"]/)){this.streamid=RegExp.$1;}this.oDbg.log("got streamid: "+this.streamid,2);var doc;try{var response=this._req[0].r.responseText;if(!response.match(/<\/stream:stream>\s*$/)){response+="</stream:stream>";}doc=XmlDocument.create("doc");doc.loadXML(response);if(!this._parseStreamFeatures(doc)){return;}}catch(e){this.oDbg.log("loadXML: "+e.toString(),1);}this._connected=true;if(this.register){this._doInBandReg();}else{this._doAuth();}this._process(this._timerval);};JSJaCHttpPollingConnection.prototype._getSuspendVars=function(){return new Array();};JSJaCHttpPollingConnection.prototype._handleInitialResponse=function(){this.oDbg.log(this._req[0].r.getAllResponseHeaders(),4);var aPList=this._req[0].r.getResponseHeader("Set-Cookie");aPList=aPList.split(";");for(var i=0;i<aPList.length;i++){aArg=aPList[i].split("=");if(aArg[0]=="ID"){this._sid=aArg[1];}}this.oDbg.log("got sid: "+this._sid,2);this._connected=true;this._interval=setInterval(JSJaC.bind(this._checkQueue,this),JSJAC_CHECKQUEUEINTERVAL);this._inQto=setInterval(JSJaC.bind(this._checkInQ,this),JSJAC_CHECKINQUEUEINTERVAL);this._getStreamID();};JSJaCHttpPollingConnection.prototype._parseResponse=function(r){var req=r.r;if(!this.connected()){return null;}if(req.status!=200){this.oDbg.log("invalid response ("+req.status+"):"+req.responseText+"\n"+req.getAllResponseHeaders(),1);this._setStatus("internal_server_error");clearTimeout(this._timeout);clearInterval(this._interval);clearInterval(this._inQto);this._connected=false;this.oDbg.log("Disconnected.",1);this._handleEvent("ondisconnect");this._handleEvent("onerror",JSJaCError("503","cancel","service-unavailable"));return null;}this.oDbg.log(req.getAllResponseHeaders(),4);var sid,aPList=req.getResponseHeader("Set-Cookie");if(aPList==null){sid="-1:0";}else{aPList=aPList.split(";");var sid;for(var i=0;i<aPList.length;i++){var aArg=aPList[i].split("=");if(aArg[0]=="ID"){sid=aArg[1];}}}if(typeof(sid)!="undefined"&&sid.indexOf(":0")!=-1){switch(sid.substring(0,sid.indexOf(":0"))){case"0":this.oDbg.log("invalid response:"+req.responseText,1);break;case"-1":this.oDbg.log("Internal Server Error",1);break;case"-2":this.oDbg.log("Bad Request",1);break;case"-3":this.oDbg.log("Key Sequence Error",1);break;}this._setStatus("internal_server_error");clearTimeout(this._timeout);clearInterval(this._interval);clearInterval(this._inQto);this._handleEvent("onerror",JSJaCError("500","wait","internal-server-error"));this._connected=false;this.oDbg.log("Disconnected.",1);this._handleEvent("ondisconnect");return null;}if(!req.responseText||req.responseText==""){return null;}try{var response=req.responseText.replace(/\<\?xml.+\?\>/,"");if(response.match(/<stream:stream/)){response+="</stream:stream>";}var doc=JSJaCHttpPollingConnection._parseTree("<body>"+response+"</body>");if(!doc||doc.tagName=="parsererror"){this.oDbg.log("parsererror",1);doc=JSJaCHttpPollingConnection._parseTree("<stream:stream xmlns:stream='http://etherx.jabber.org/streams'>"+req.responseText);if(doc&&doc.tagName!="parsererror"){this.oDbg.log("stream closed",1);if(doc.getElementsByTagName("conflict").length>0){this._setStatus("session-terminate-conflict");}clearTimeout(this._timeout);clearInterval(this._interval);clearInterval(this._inQto);this._handleEvent("onerror",JSJaCError("503","cancel","session-terminate"));this._connected=false;this.oDbg.log("Disconnected.",1);this._handleEvent("ondisconnect");}else{this.oDbg.log("parsererror:"+doc,1);}return doc;}return doc;}catch(e){this.oDbg.log("parse error:"+e.message,1);}return null;};JSJaCHttpPollingConnection.prototype._reInitStream=function(to,cb,arg){this._sendRaw("<stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' to='"+to+"' version='1.0'>",cb,arg);};JSJaCHttpPollingConnection.prototype._resume=function(){this._process(this._timerval);};JSJaCHttpPollingConnection.prototype._setupRequest=function(async){var r=XmlHttp.create();try{r.open("POST",this._httpbase,async);if(r.overrideMimeType){r.overrideMimeType("text/plain; charset=utf-8");}r.setRequestHeader("Content-Type","application/x-www-form-urlencoded");}catch(e){this.oDbg.log(e,1);}var req=new Object();req.r=r;return req;};JSJaCHttpPollingConnection.prototype._suspend=function(){};JSJaCHttpPollingConnection._parseTree=function(s){try{var r=XmlDocument.create("body","foo");if(typeof(r.loadXML)!="undefined"){r.loadXML(s);return r.documentElement;}else{if(window.DOMParser){return(new DOMParser()).parseFromString(s,"text/xml").documentElement;}}}catch(e){}return null;};var JSJaC={Version:"1.3.1",require:function(libraryName){document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>');},load:function(){var includes=["xmlextras","jsextras","crypt","JSJaCConfig","JSJaCConstants","JSJaCCookie","JSJaCJSON","JSJaCJID","JSJaCBuilder","JSJaCPacket","JSJaCError","JSJaCKeys","JSJaCConnection","JSJaCHttpPollingConnection","JSJaCHttpBindingConnection","JSJaCConsoleLogger"];var scripts=document.getElementsByTagName("script");var path="./";for(var i=0;i<scripts.length;i++){if(scripts.item(i).src&&scripts.item(i).src.match(/JSJaC\.js$/)){path=scripts.item(i).src.replace(/JSJaC.js$/,"");break;}}for(var i=0;i<includes.length;i++){this.require(path+includes[i]+".js");}},bind:function(fn,obj,arg){return function(){if(arg){fn.apply(obj,arg);}else{fn.apply(obj);}};}};if(typeof JSJaCConnection=="undefined"){JSJaC.load();}MooTools.More={"version":"1.2.4.3","build":"6c664838ffa145382c063893d35455a624c13a50"};(function(){var data={language:"en-US",languages:{"en-US":{}},cascades:["en-US"]};var cascaded;MooTools.lang=new Events();$extend(MooTools.lang,{setLanguage:function(lang){if(!data.languages[lang]){return this;}data.language=lang;this.load();this.fireEvent("langChange",lang);return this;},load:function(){var langs=this.cascade(this.getCurrentLanguage());cascaded={};$each(langs,function(set,setName){cascaded[setName]=this.lambda(set);},this);},getCurrentLanguage:function(){return data.language;},addLanguage:function(lang){data.languages[lang]=data.languages[lang]||{};return this;},cascade:function(lang){var cascades=(data.languages[lang]||{}).cascades||[];cascades.combine(data.cascades);cascades.erase(lang).push(lang);var langs=cascades.map(function(lng){return data.languages[lng];},this);return $merge.apply(this,langs);},lambda:function(set){(set||{}).get=function(key,args){return $lambda(set[key]).apply(this,$splat(args));};return set;},get:function(set,key,args){if(cascaded&&cascaded[set]){return(key?cascaded[set].get(key,args):cascaded[set]);}},set:function(lang,set,members){this.addLanguage(lang);langData=data.languages[lang];if(!langData[set]){langData[set]={};}$extend(langData[set],members);if(lang==this.getCurrentLanguage()){this.load();this.fireEvent("langChange",lang);}return this;},list:function(){return Hash.getKeys(data.languages);}});})();(function(){var global=this;var log=function(){if(global.console&&console.log){try{console.log.apply(console,arguments);}catch(e){console.log(Array.slice(arguments));}}else{Log.logged.push(arguments);}return this;};var disabled=function(){this.logged.push(arguments);return this;};this.Log=new Class({logged:[],log:disabled,resetLog:function(){this.logged.empty();return this;},enableLog:function(){this.log=log;this.logged.each(function(args){this.log.apply(this,args);},this);return this.resetLog();},disableLog:function(){this.log=disabled;return this;}});Log.extend(new Log).enableLog();Log.logger=function(){return this.log.apply(this,arguments);};})();Array.implement({min:function(){return Math.min.apply(null,this);},max:function(){return Math.max.apply(null,this);},average:function(){return this.length?this.sum()/this.length:0;},sum:function(){var result=0,l=this.length;if(l){do{result+=this[--l];}while(l);}return result;},unique:function(){return[].combine(this);},shuffle:function(){for(var i=this.length;i&&--i;){var temp=this[i],r=Math.floor(Math.random()*(i+1));this[i]=this[r];this[r]=temp;}return this;}});(function(){var Date=this.Date;if(!Date.now){Date.now=$time;}Date.Methods={ms:"Milliseconds",year:"FullYear",min:"Minutes",mo:"Month",sec:"Seconds",hr:"Hours"};["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds","Time","TimezoneOffset","Week","Timezone","GMTOffset","DayOfYear","LastMonth","LastDayOfMonth","UTCDate","UTCDay","UTCFullYear","AMPM","Ordinal","UTCHours","UTCMilliseconds","UTCMinutes","UTCMonth","UTCSeconds"].each(function(method){Date.Methods[method.toLowerCase()]=method;});var pad=function(what,length){return new Array(length-String(what).length+1).join("0")+what;};Date.implement({set:function(prop,value){switch($type(prop)){case"object":for(var p in prop){this.set(p,prop[p]);}break;case"string":prop=prop.toLowerCase();var m=Date.Methods;if(m[prop]){this["set"+m[prop]](value);}}return this;},get:function(prop){prop=prop.toLowerCase();var m=Date.Methods;if(m[prop]){return this["get"+m[prop]]();}return null;},clone:function(){return new Date(this.get("time"));},increment:function(interval,times){interval=interval||"day";times=$pick(times,1);switch(interval){case"year":return this.increment("month",times*12);case"month":var d=this.get("date");this.set("date",1).set("mo",this.get("mo")+times);return this.set("date",d.min(this.get("lastdayofmonth")));case"week":return this.increment("day",times*7);case"day":return this.set("date",this.get("date")+times);}if(!Date.units[interval]){throw new Error(interval+" is not a supported interval");}return this.set("time",this.get("time")+times*Date.units[interval]());},decrement:function(interval,times){return this.increment(interval,-1*$pick(times,1));},isLeapYear:function(){return Date.isLeapYear(this.get("year"));},clearTime:function(){return this.set({hr:0,min:0,sec:0,ms:0});},diff:function(date,resolution){if($type(date)=="string"){date=Date.parse(date);}return((date-this)/Date.units[resolution||"day"](3,3)).toInt();},getLastDayOfMonth:function(){return Date.daysInMonth(this.get("mo"),this.get("year"));},getDayOfYear:function(){return(Date.UTC(this.get("year"),this.get("mo"),this.get("date")+1)-Date.UTC(this.get("year"),0,1))/Date.units.day();},getWeek:function(){return(this.get("dayofyear")/7).ceil();},getOrdinal:function(day){return Date.getMsg("ordinal",day||this.get("date"));},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3");},getGMTOffset:function(){var off=this.get("timezoneOffset");return((off>0)?"-":"+")+pad((off.abs()/60).floor(),2)+pad(off%60,2);},setAMPM:function(ampm){ampm=ampm.toUpperCase();var hr=this.get("hr");if(hr>11&&ampm=="AM"){return this.decrement("hour",12);}else{if(hr<12&&ampm=="PM"){return this.increment("hour",12);}}return this;},getAMPM:function(){return(this.get("hr")<12)?"AM":"PM";},parse:function(str){this.set("time",Date.parse(str));return this;},isValid:function(date){return !!(date||this).valueOf();},format:function(f){if(!this.isValid()){return"invalid date";}f=f||"%x %X";f=formats[f.toLowerCase()]||f;var d=this;return f.replace(/%([a-z%])/gi,function($0,$1){switch($1){case"a":return Date.getMsg("days")[d.get("day")].substr(0,3);case"A":return Date.getMsg("days")[d.get("day")];case"b":return Date.getMsg("months")[d.get("month")].substr(0,3);case"B":return Date.getMsg("months")[d.get("month")];case"c":return d.toString();case"d":return pad(d.get("date"),2);case"D":return d.get("date");case"H":return pad(d.get("hr"),2);case"I":return((d.get("hr")%12)||12);case"j":return pad(d.get("dayofyear"),3);case"m":return pad((d.get("mo")+1),2);case"M":return pad(d.get("min"),2);case"o":return d.get("ordinal");case"p":return Date.getMsg(d.get("ampm"));case"S":return pad(d.get("seconds"),2);case"U":return pad(d.get("week"),2);case"w":return d.get("day");case"x":return d.format(Date.getMsg("shortDate"));case"X":return d.format(Date.getMsg("shortTime"));case"y":return d.get("year").toString().substr(2);case"Y":return d.get("year");case"T":return d.get("GMTOffset");case"Z":return d.get("Timezone");}return $1;});},toISOString:function(){return this.format("iso8601");}});Date.alias("toISOString","toJSON");Date.alias("diff","compare");Date.alias("format","strftime");var formats={db:"%Y-%m-%d %H:%M:%S",compact:"%Y%m%dT%H%M%S",iso8601:"%Y-%m-%dT%H:%M:%S%T",rfc822:"%a, %d %b %Y %H:%M:%S %Z","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M"};var parsePatterns=[];var nativeParse=Date.parse;var parseWord=function(type,word,num){var ret=-1;var translated=Date.getMsg(type+"s");switch($type(word)){case"object":ret=translated[word.get(type)];break;case"number":ret=translated[month-1];if(!ret){throw new Error("Invalid "+type+" index: "+index);}break;case"string":var match=translated.filter(function(name){return this.test(name);},new RegExp("^"+word,"i"));if(!match.length){throw new Error("Invalid "+type+" string");}if(match.length>1){throw new Error("Ambiguous "+type);}ret=match[0];}return(num)?translated.indexOf(ret):ret;};Date.extend({getMsg:function(key,args){return MooTools.lang.get("Date",key,args);},units:{ms:$lambda(1),second:$lambda(1000),minute:$lambda(60000),hour:$lambda(3600000),day:$lambda(86400000),week:$lambda(608400000),month:function(month,year){var d=new Date;return Date.daysInMonth($pick(month,d.get("mo")),$pick(year,d.get("year")))*86400000;},year:function(year){year=year||new Date().get("year");return Date.isLeapYear(year)?31622400000:31536000000;}},daysInMonth:function(month,year){return[31,Date.isLeapYear(year)?29:28,31,30,31,30,31,31,30,31,30,31][month];},isLeapYear:function(year){return((year%4===0)&&(year%100!==0))||(year%400===0);},parse:function(from){var t=$type(from);if(t=="number"){return new Date(from);}if(t!="string"){return from;}from=from.clean();if(!from.length){return null;}var parsed;parsePatterns.some(function(pattern){var bits=pattern.re.exec(from);return(bits)?(parsed=pattern.handler(bits)):false;});return parsed||new Date(nativeParse(from));},parseDay:function(day,num){return parseWord("day",day,num);},parseMonth:function(month,num){return parseWord("month",month,num);},parseUTC:function(value){var localDate=new Date(value);var utcSeconds=Date.UTC(localDate.get("year"),localDate.get("mo"),localDate.get("date"),localDate.get("hr"),localDate.get("min"),localDate.get("sec"));return new Date(utcSeconds);},orderIndex:function(unit){return Date.getMsg("dateOrder").indexOf(unit)+1;},defineFormat:function(name,format){formats[name]=format;},defineFormats:function(formats){for(var name in formats){Date.defineFormat(name,formats[name]);}},parsePatterns:parsePatterns,defineParser:function(pattern){parsePatterns.push((pattern.re&&pattern.handler)?pattern:build(pattern));},defineParsers:function(){Array.flatten(arguments).each(Date.defineParser);},define2DigitYearStart:function(year){startYear=year%100;startCentury=year-startYear;}});var startCentury=1900;var startYear=70;var regexOf=function(type){return new RegExp("(?:"+Date.getMsg(type).map(function(name){return name.substr(0,3);}).join("|")+")[a-z]*");};var replacers=function(key){switch(key){case"x":return((Date.orderIndex("month")==1)?"%m[.-/]%d":"%d[.-/]%m")+"([.-/]%y)?";case"X":return"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%T?";}return null;};var keys={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\d/,s:/\d+/,o:/[a-z]*/,p:/[ap]\.?m\.?/,y:/\d{2}|\d{4}/,Y:/\d{4}/,T:/Z|[+-]\d{2}(?::?\d{2})?/};keys.m=keys.I;keys.S=keys.M;var currentLanguage;var recompile=function(language){currentLanguage=language;keys.a=keys.A=regexOf("days");keys.b=keys.B=regexOf("months");parsePatterns.each(function(pattern,i){if(pattern.format){parsePatterns[i]=build(pattern.format);}});};var build=function(format){if(!currentLanguage){return{format:format};}var parsed=[];var re=(format.source||format).replace(/%([a-z])/gi,function($0,$1){return replacers($1)||$0;}).replace(/\((?!\?)/g,"(?:").replace(/ (?!\?|\*)/g,",? ").replace(/%([a-z%])/gi,function($0,$1){var p=keys[$1];if(!p){return $1;}parsed.push($1);return"("+p.source+")";}).replace(/\[a-z\]/gi,"[a-z\\u00c0-\\uffff]");return{format:format,re:new RegExp("^"+re+"$","i"),handler:function(bits){bits=bits.slice(1).associate(parsed);var date=new Date().clearTime();if("d" in bits){handle.call(date,"d",1);}if("m" in bits||"b" in bits||"B" in bits){handle.call(date,"m",1);}for(var key in bits){handle.call(date,key,bits[key]);}return date;}};};var handle=function(key,value){if(!value){return this;}switch(key){case"a":case"A":return this.set("day",Date.parseDay(value,true));case"b":case"B":return this.set("mo",Date.parseMonth(value,true));case"d":return this.set("date",value);case"H":case"I":return this.set("hr",value);case"m":return this.set("mo",value-1);case"M":return this.set("min",value);case"p":return this.set("ampm",value.replace(/\./g,""));case"S":return this.set("sec",value);case"s":return this.set("ms",("0."+value)*1000);case"w":return this.set("day",value);case"Y":return this.set("year",value);case"y":value=+value;if(value<100){value+=startCentury+(value<startYear?100:0);}return this.set("year",value);case"T":if(value=="Z"){value="+00";}var offset=value.match(/([+-])(\d{2}):?(\d{2})?/);offset=(offset[1]+"1")*(offset[2]*60+(+offset[3]||0))+this.getTimezoneOffset();return this.set("time",this-offset*60000);}return this;};Date.defineParsers("%Y([-./]%m([-./]%d((T| )%X)?)?)?","%Y%m%d(T%H(%M%S?)?)?","%x( %X)?","%d%o( %b( %Y)?)?( %X)?","%b( %d%o)?( %Y)?( %X)?","%Y %b( %d%o( %X)?)?","%o %b %d %X %T %Y");MooTools.lang.addEvent("langChange",function(language){if(MooTools.lang.get("Date")){recompile(language);}}).fireEvent("langChange",MooTools.lang.getCurrentLanguage());})();Date.implement({timeDiffInWords:function(relative_to){return Date.distanceOfTimeInWords(this,relative_to||new Date);},timeDiff:function(to,joiner){if(to==null){to=new Date;}var delta=((to-this)/1000).toInt();if(!delta){return"0s";}var durations={s:60,m:60,h:24,d:365,y:0};var duration,vals=[];for(var step in durations){if(!delta){break;}if((duration=durations[step])){vals.unshift((delta%duration)+step);delta=(delta/duration).toInt();}else{vals.unshift(delta+step);}}return vals.join(joiner||":");}});Date.alias("timeDiffInWords","timeAgoInWords");Date.extend({distanceOfTimeInWords:function(from,to){return Date.getTimePhrase(((to-from)/1000).toInt());},getTimePhrase:function(delta){var suffix=(delta<0)?"Until":"Ago";if(delta<0){delta*=-1;}var units={minute:60,hour:60,day:24,week:7,month:52/12,year:12,eon:Infinity};var msg="lessThanMinute";for(var unit in units){var interval=units[unit];if(delta<1.5*interval){if(delta>0.75*interval){msg=unit;}break;}delta/=interval;msg=unit+"s";}return Date.getMsg(msg+suffix).substitute({delta:delta.round()});}});Date.defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(bits){var d=new Date().clearTime();switch(bits[0]){case"tom":return d.increment();case"yes":return d.decrement();default:return d;}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(bits){var d=new Date().clearTime();var day=d.getDay();var newDay=Date.parseDay(bits[2],true);var addDays=newDay-day;if(newDay<=day){addDays+=7;}if(bits[1]=="last"){addDays-=7;}return d.set("date",d.getDate()+addDays);}});Hash.implement({getFromPath:function(notation){var source=this.getClean();notation.replace(/\[([^\]]+)\]|\.([^.[]+)|[^[.]+/g,function(match){if(!source){return null;}var prop=arguments[2]||arguments[1]||arguments[0];source=(prop in source)?source[prop]:null;return match;});return source;},cleanValues:function(method){method=method||$defined;this.each(function(v,k){if(!method(v)){this.erase(k);}},this);return this;},run:function(){var args=arguments;this.each(function(v,k){if($type(v)=="function"){v.run(args);}});}});(function(){var special=["??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??"];var standard=["A","a","A","a","A","a","A","a","Ae","ae","A","a","A","a","A","a","C","c","C","c","C","c","D","d","D","d","E","e","E","e","E","e","E","e","E","e","E","e","G","g","I","i","I","i","I","i","I","i","L","l","L","l","L","l","N","n","N","n","N","n","O","o","O","o","O","o","O","o","Oe","oe","O","o","o","R","r","R","r","S","s","S","s","S","s","T","t","T","t","T","t","U","u","U","u","U","u","Ue","ue","U","u","Y","y","Y","y","Z","z","Z","z","Z","z","TH","th","DH","dh","ss","OE","oe","AE","ae","u"];var tidymap={"[\xa0\u2002\u2003\u2009]":" ","\xb7":"*","[\u2018\u2019]":"'","[\u201c\u201d]":'"',"\u2026":"...","\u2013":"-","\u2014":"--","\uFFFD":"&raquo;"};var getRegForTag=function(tag,contents){tag=tag||"";var regstr=contents?"<"+tag+"[^>]*>([\\s\\S]*?)</"+tag+">":"</?"+tag+"([^>]+)?>";reg=new RegExp(regstr,"gi");return reg;};String.implement({standardize:function(){var text=this;special.each(function(ch,i){text=text.replace(new RegExp(ch,"g"),standard[i]);});return text;},repeat:function(times){return new Array(times+1).join(this);},pad:function(length,str,dir){if(this.length>=length){return this;}var pad=(str==null?" ":""+str).repeat(length-this.length).substr(0,length-this.length);if(!dir||dir=="right"){return this+pad;}if(dir=="left"){return pad+this;}return pad.substr(0,(pad.length/2).floor())+this+pad.substr(0,(pad.length/2).ceil());},getTags:function(tag,contents){return this.match(getRegForTag(tag,contents))||[];},stripTags:function(tag,contents){return this.replace(getRegForTag(tag,contents),"");},tidy:function(){var txt=this.toString();$each(tidymap,function(value,key){txt=txt.replace(new RegExp(key,"g"),value);});return txt;}});})();(function(addEvent,removeEvent){var match=/(.*?):relay\(([^)]+)\)$/,combinators=/[+>~\s]/,splitType=function(type){var bits=type.match(match);return !bits?{event:type}:{event:bits[1],selector:bits[2]};},check=function(e,selector){var t=e.target;if(combinators.test(selector=selector.trim())){var els=this.getElements(selector);for(var i=els.length;i--;){var el=els[i];if(t==el||el.hasChild(t)){return el;}}}else{for(;t&&t!=this;t=t.parentNode){if(Element.match(t,selector)){return document.id(t);}}}return null;};Element.implement({addEvent:function(type,fn){var splitted=splitType(type);if(splitted.selector){var monitors=this.retrieve("$moo:delegateMonitors",{});if(!monitors[type]){var monitor=function(e){var el=check.call(this,e,splitted.selector);if(el){this.fireEvent(type,[e,el],0,el);}}.bind(this);monitors[type]=monitor;addEvent.call(this,splitted.event,monitor);}}return addEvent.apply(this,arguments);},removeEvent:function(type,fn){var splitted=splitType(type);if(splitted.selector){var events=this.retrieve("events");if(!events||!events[type]||(fn&&!events[type].keys.contains(fn))){return this;}if(fn){removeEvent.apply(this,[type,fn]);}else{removeEvent.apply(this,type);}events=this.retrieve("events");if(events&&events[type]&&events[type].keys.length==0){var monitors=this.retrieve("$moo:delegateMonitors",{});removeEvent.apply(this,[splitted.event,monitors[type]]);delete monitors[type];}return this;}return removeEvent.apply(this,arguments);},fireEvent:function(type,args,delay,bind){var events=this.retrieve("events");if(!events||!events[type]){return this;}events[type].keys.each(function(fn){fn.create({bind:bind||this,delay:delay,arguments:args})();},this);return this;}});})(Element.prototype.addEvent,Element.prototype.removeEvent);Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(elements,options){this.elements=this.subject=$$(elements);this.parent(options);},compute:function(from,to,delta){var now={};for(var i in from){var iFrom=from[i],iTo=to[i],iNow=now[i]={};for(var p in iFrom){iNow[p]=this.parent(iFrom[p],iTo[p],delta);}}return now;},set:function(now){for(var i in now){var iNow=now[i];for(var p in iNow){this.render(this.elements[i],p,iNow[p],this.options.unit);}}return this;},start:function(obj){if(!this.check(obj)){return this;}var from={},to={};for(var i in obj){var iProps=obj[i],iFrom=from[i]={},iTo=to[i]={};for(var p in iProps){var parsed=this.prepare(this.elements[i],p,iProps[p]);iFrom[p]=parsed.from;iTo[p]=parsed.to;}}return this.parent(from,to);}});Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(element,options){this.element=this.subject=document.id(element);this.parent(options);var cancel=this.cancel.bind(this,false);if($type(this.element)!="element"){this.element=document.id(this.element.getDocument().body);}var stopper=this.element;if(this.options.wheelStops){this.addEvent("start",function(){stopper.addEvent("mousewheel",cancel);},true);this.addEvent("complete",function(){stopper.removeEvent("mousewheel",cancel);},true);}},set:function(){var now=Array.flatten(arguments);if(Browser.Engine.gecko){now=[Math.round(now[0]),Math.round(now[1])];}this.element.scrollTo(now[0],now[1]);},compute:function(from,to,delta){return[0,1].map(function(i){return Fx.compute(from[i],to[i],delta);});},start:function(x,y){if(!this.check(x,y)){return this;}var scrollSize=this.element.getScrollSize(),scroll=this.element.getScroll(),values={x:x,y:y};for(var z in values){var max=scrollSize[z];if($chk(values[z])){values[z]=($type(values[z])=="number")?values[z]:max;}else{values[z]=scroll[z];}values[z]+=this.options.offset[z];}return this.parent([scroll.x,scroll.y],[values.x,values.y]);},toTop:function(){return this.start(false,0);},toLeft:function(){return this.start(0,false);},toRight:function(){return this.start("right",false);},toBottom:function(){return this.start(false,"bottom");},toElement:function(el){var position=document.id(el).getPosition(this.element);return this.start(position.x,position.y);},scrollIntoView:function(el,axes,offset){axes=axes?$splat(axes):["x","y"];var to={};el=document.id(el);var pos=el.getPosition(this.element);var size=el.getSize();var scroll=this.element.getScroll();var containerSize=this.element.getSize();var edge={x:pos.x+size.x,y:pos.y+size.y};["x","y"].each(function(axis){if(axes.contains(axis)){if(edge[axis]>scroll[axis]+containerSize[axis]){to[axis]=edge[axis]-containerSize[axis];}if(pos[axis]<scroll[axis]){to[axis]=pos[axis];}}if(to[axis]==null){to[axis]=scroll[axis];}if(offset&&offset[axis]){to[axis]=to[axis]+offset[axis];}},this);if(to.x!=scroll.x||to.y!=scroll.y){this.start(to.x,to.y);}return this;},scrollToCenter:function(el,axes,offset){axes=axes?$splat(axes):["x","y"];el=$(el);var to={},pos=el.getPosition(this.element),size=el.getSize(),scroll=this.element.getScroll(),containerSize=this.element.getSize(),edge={x:pos.x+size.x,y:pos.y+size.y};["x","y"].each(function(axis){if(axes.contains(axis)){to[axis]=pos[axis]-(containerSize[axis]-size[axis])/2;}if(to[axis]==null){to[axis]=scroll[axis];}if(offset&&offset[axis]){to[axis]=to[axis]+offset[axis];}},this);if(to.x!=scroll.x||to.y!=scroll.y){this.start(to.x,to.y);}return this;}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,stopPropagation:false,modifiers:{x:"left",y:"top"}},initialize:function(){var params=Array.link(arguments,{"options":Object.type,"element":$defined});this.element=document.id(params.element);this.document=this.element.getDocument();this.setOptions(params.options||{});var htype=$type(this.options.handle);this.handles=((htype=="array"||htype=="collection")?$$(this.options.handle):document.id(this.options.handle))||this.element;this.mouse={"now":{},"pos":{}};this.value={"start":{},"now":{}};this.selection=(Browser.Engine.trident)?"selectstart":"mousedown";this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:$lambda(false)};this.attach();},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this;},detach:function(){this.handles.removeEvent("mousedown",this.bound.start);return this;},start:function(event){if(event.rightClick){return;}if(this.options.preventDefault){event.preventDefault();}if(this.options.stopPropagation){event.stopPropagation();}this.mouse.start=event.page;this.fireEvent("beforeStart",this.element);var limit=this.options.limit;this.limit={x:[],y:[]};for(var z in this.options.modifiers){if(!this.options.modifiers[z]){continue;}if(this.options.style){this.value.now[z]=this.element.getStyle(this.options.modifiers[z]).toInt();}else{this.value.now[z]=this.element[this.options.modifiers[z]];}if(this.options.invert){this.value.now[z]*=-1;}this.mouse.pos[z]=event.page[z]-this.value.now[z];if(limit&&limit[z]){for(var i=2;i--;i){if($chk(limit[z][i])){this.limit[z][i]=$lambda(limit[z][i])();}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid};}this.document.addEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});this.document.addEvent(this.selection,this.bound.eventStop);},check:function(event){if(this.options.preventDefault){event.preventDefault();}var distance=Math.round(Math.sqrt(Math.pow(event.page.x-this.mouse.start.x,2)+Math.pow(event.page.y-this.mouse.start.y,2)));if(distance>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent("start",[this.element,event]).fireEvent("snap",this.element);}},drag:function(event){if(this.options.preventDefault){event.preventDefault();}this.mouse.now=event.page;for(var z in this.options.modifiers){if(!this.options.modifiers[z]){continue;}this.value.now[z]=this.mouse.now[z]-this.mouse.pos[z];if(this.options.invert){this.value.now[z]*=-1;}if(this.options.limit&&this.limit[z]){if($chk(this.limit[z][1])&&(this.value.now[z]>this.limit[z][1])){this.value.now[z]=this.limit[z][1];}else{if($chk(this.limit[z][0])&&(this.value.now[z]<this.limit[z][0])){this.value.now[z]=this.limit[z][0];}}}if(this.options.grid[z]){this.value.now[z]-=((this.value.now[z]-(this.limit[z][0]||0))%this.options.grid[z]);}if(this.options.style){this.element.setStyle(this.options.modifiers[z],this.value.now[z]+this.options.unit);}else{this.element[this.options.modifiers[z]]=this.value.now[z];}}this.fireEvent("drag",[this.element,event]);},cancel:function(event){this.document.removeEvent("mousemove",this.bound.check);this.document.removeEvent("mouseup",this.bound.cancel);if(event){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element);}},stop:function(event){this.document.removeEvent(this.selection,this.bound.eventStop);this.document.removeEvent("mousemove",this.bound.drag);this.document.removeEvent("mouseup",this.bound.stop);if(event){this.fireEvent("complete",[this.element,event]);}}});Element.implement({makeResizable:function(options){var drag=new Drag(this,$merge({modifiers:{x:"width",y:"height"}},options));this.store("resizer",drag);return drag.addEvent("drag",function(){this.fireEvent("resize",drag);}.bind(this));}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false,precalculate:false,includeMargins:true,checkDroppables:true},initialize:function(element,options){this.parent(element,options);element=this.element;this.droppables=$$(this.options.droppables);this.container=document.id(this.options.container);if(this.container&&$type(this.container)!="element"){this.container=document.id(this.container.getDocument().body);}var styles=element.getStyles("left","top","position");if(styles.left=="auto"||styles.top=="auto"){element.setPosition(element.getPosition(element.getOffsetParent()));}if(styles.position=="static"){element.setStyle("position","absolute");}this.addEvent("start",this.checkDroppables,true);this.overed=null;},start:function(event){if(this.container){this.options.limit=this.calculateLimit();}if(this.options.precalculate){this.positions=this.droppables.map(function(el){return el.getCoordinates();});}this.parent(event);},calculateLimit:function(){var offsetParent=this.element.getOffsetParent(),containerCoordinates=this.container.getCoordinates(offsetParent),containerBorder={},elementMargin={},elementBorder={},containerMargin={},offsetParentPadding={};["top","right","bottom","left"].each(function(pad){containerBorder[pad]=this.container.getStyle("border-"+pad).toInt();elementBorder[pad]=this.element.getStyle("border-"+pad).toInt();elementMargin[pad]=this.element.getStyle("margin-"+pad).toInt();containerMargin[pad]=this.container.getStyle("margin-"+pad).toInt();offsetParentPadding[pad]=offsetParent.getStyle("padding-"+pad).toInt();},this);var width=this.element.offsetWidth+elementMargin.left+elementMargin.right,height=this.element.offsetHeight+elementMargin.top+elementMargin.bottom,left=0,top=0,right=containerCoordinates.right-containerBorder.right-width,bottom=containerCoordinates.bottom-containerBorder.bottom-height;if(this.options.includeMargins){left+=elementMargin.left;top+=elementMargin.top;}else{right+=elementMargin.right;bottom+=elementMargin.bottom;}if(this.element.getStyle("position")=="relative"){var coords=this.element.getCoordinates(offsetParent);coords.left-=this.element.getStyle("left").toInt();coords.top-=this.element.getStyle("top").toInt();left+=containerBorder.left-coords.left;top+=containerBorder.top-coords.top;right+=elementMargin.left-coords.left;bottom+=elementMargin.top-coords.top;if(this.container!=offsetParent){left+=containerMargin.left+offsetParentPadding.left;top+=(Browser.Engine.trident4?0:containerMargin.top)+offsetParentPadding.top;}}else{left-=elementMargin.left;top-=elementMargin.top;if(this.container==offsetParent){right-=containerBorder.left;bottom-=containerBorder.top;}else{left+=containerCoordinates.left+containerBorder.left;top+=containerCoordinates.top+containerBorder.top;}}return{x:[left,right],y:[top,bottom]};},checkAgainst:function(el,i){el=(this.positions)?this.positions[i]:el.getCoordinates();var now=this.mouse.now;return(now.x>el.left&&now.x<el.right&&now.y<el.bottom&&now.y>el.top);},checkDroppables:function(){var overed=this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=overed){if(this.overed){this.fireEvent("leave",[this.element,this.overed]);}if(overed){this.fireEvent("enter",[this.element,overed]);}this.overed=overed;}},drag:function(event){this.parent(event);if(this.options.checkDroppables&&this.droppables.length){this.checkDroppables();}},stop:function(event){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed,event]);this.overed=null;return this.parent(event);}});Element.implement({makeDraggable:function(options){var drag=new Drag.Move(this,options);this.store("dragger",drag);return drag;}});Request.JSONP=new Class({Implements:[Chain,Events,Options,Log],options:{url:"",data:{},retries:0,timeout:0,link:"ignore",callbackKey:"callback",injectScript:document.head},initialize:function(options){this.setOptions(options);if(this.options.log){this.enableLog();}this.running=false;this.requests=0;this.triesRemaining=[];},check:function(){if(!this.running){return true;}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false;}return false;},send:function(options){if(!$chk(arguments[1])&&!this.check(options)){return this;}var type=$type(options),old=this.options,index=$chk(arguments[1])?arguments[1]:this.requests++;if(type=="string"||type=="element"){options={data:options};}options=$extend({data:old.data,url:old.url},options);if(!$chk(this.triesRemaining[index])){this.triesRemaining[index]=this.options.retries;}var remaining=this.triesRemaining[index];(function(){var script=this.getScript(options);this.log("JSONP retrieving script with url: "+script.get("src"));this.fireEvent("request",script);this.running=true;(function(){if(remaining){this.triesRemaining[index]=remaining-1;if(script){script.destroy();this.send(options,index).fireEvent("retry",this.triesRemaining[index]);}}else{if(script&&this.options.timeout){script.destroy();this.cancel().fireEvent("failure");}}}).delay(this.options.timeout,this);}).delay(Browser.Engine.trident?50:0,this);return this;},cancel:function(){if(!this.running){return this;}this.running=false;this.fireEvent("cancel");return this;},getScript:function(options){var index=Request.JSONP.counter,data;Request.JSONP.counter++;switch($type(options.data)){case"element":data=document.id(options.data).toQueryString();break;case"object":case"hash":data=Hash.toQueryString(options.data);}var src=options.url+(options.url.test("\\?")?"&":"?")+(options.callbackKey||this.options.callbackKey)+"=Request.JSONP.request_map.request_"+index+(data?"&"+data:"");if(src.length>2083){this.log("JSONP "+src+" will fail in Internet Explorer, which enforces a 2083 bytes length limit on URIs");}var script=new Element("script",{type:"text/javascript",src:src});Request.JSONP.request_map["request_"+index]=function(){this.success(arguments,script);}.bind(this);return script.inject(this.options.injectScript);},success:function(args,script){if(script){script.destroy();}this.running=false;this.log("JSONP successfully retrieved: ",args);this.fireEvent("complete",args).fireEvent("success",args).callChain();}});Request.JSONP.counter=0;Request.JSONP.request_map={};var Asset={javascript:function(source,properties){properties=$extend({onload:$empty,document:document,check:$lambda(true)},properties);if(properties.onLoad){properties.onload=properties.onLoad;}var script=new Element("script",{src:source,type:"text/javascript"});var load=properties.onload.bind(script),check=properties.check,doc=properties.document;delete properties.onload;delete properties.check;delete properties.document;script.addEvents({load:load,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){load();}}}).set(properties);if(Browser.Engine.webkit419){var checker=(function(){if(!$try(check)){return;}$clear(checker);load();}).periodical(50);}return script.inject(doc.head);},css:function(source,properties){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:source},properties)).inject(document.head);},image:function(source,properties){properties=$merge({onload:$empty,onabort:$empty,onerror:$empty},properties);var image=new Image();var element=document.id(image)||new Element("img");["load","abort","error"].each(function(name){var type="on"+name;var cap=name.capitalize();if(properties["on"+cap]){properties[type]=properties["on"+cap];}var event=properties[type];delete properties[type];image[type]=function(){if(!image){return;}if(!element.parentNode){element.width=image.width;element.height=image.height;}image=image.onload=image.onabort=image.onerror=null;event.delay(1,element,element);element.fireEvent(name,element,1);};});image.src=element.src=source;if(image&&image.complete){image.onload.delay(1);}return element.set(properties);},images:function(sources,options){options=$merge({onComplete:$empty,onProgress:$empty,onError:$empty,properties:{}},options);sources=$splat(sources);var images=[];var counter=0;return new Elements(sources.map(function(source){return Asset.image(source,$extend(options.properties,{onload:function(){options.onProgress.call(this,counter,sources.indexOf(source));counter++;if(counter==sources.length){options.onComplete();}},onerror:function(){options.onError.call(this,counter,sources.indexOf(source));counter++;if(counter==sources.length){options.onComplete();}}}));}));}};(function(){var Keyboard=this.Keyboard=new Class({Extends:Events,Implements:[Options,Log],options:{defaultEventType:"keydown",active:false,events:{},nonParsedEvents:["activate","deactivate","onactivate","ondeactivate","changed","onchanged"]},initialize:function(options){this.setOptions(options);this.setup();},setup:function(){this.addEvents(this.options.events);if(Keyboard.manager&&!this.manager){Keyboard.manager.manage(this);}if(this.options.active){this.activate();}},handle:function(event,type){if(event.preventKeyboardPropagation){return;}var bubbles=!!this.manager;if(bubbles&&this.activeKB){this.activeKB.handle(event,type);if(event.preventKeyboardPropagation){return;}}this.fireEvent(type,event);if(!bubbles&&this.activeKB){this.activeKB.handle(event,type);}},addEvent:function(type,fn,internal){return this.parent(Keyboard.parse(type,this.options.defaultEventType,this.options.nonParsedEvents),fn,internal);},removeEvent:function(type,fn){return this.parent(Keyboard.parse(type,this.options.defaultEventType,this.options.nonParsedEvents),fn);},toggleActive:function(){return this[this.active?"deactivate":"activate"]();},activate:function(instance){if(instance){if(instance!=this.activeKB){this.previous=this.activeKB;}this.activeKB=instance.fireEvent("activate");Keyboard.manager.fireEvent("changed");}else{if(this.manager){this.manager.activate(this);}}return this;},deactivate:function(instance){if(instance){if(instance===this.activeKB){this.activeKB=null;instance.fireEvent("deactivate");Keyboard.manager.fireEvent("changed");}}else{if(this.manager){this.manager.deactivate(this);}}return this;},relenquish:function(){if(this.previous){this.activate(this.previous);}},manage:function(instance){if(instance.manager){instance.manager.drop(instance);}this.instances.push(instance);instance.manager=this;if(!this.activeKB){this.activate(instance);}else{this._disable(instance);}},_disable:function(instance){if(this.activeKB==instance){this.activeKB=null;}},drop:function(instance){this._disable(instance);this.instances.erase(instance);},instances:[],trace:function(){Keyboard.trace(this);},each:function(fn){Keyboard.each(this,fn);}});var parsed={};var modifiers=["shift","control","alt","meta"];var regex=/^(?:shift|control|ctrl|alt|meta)$/;Keyboard.parse=function(type,eventType,ignore){if(ignore&&ignore.contains(type.toLowerCase())){return type;}type=type.toLowerCase().replace(/^(keyup|keydown):/,function($0,$1){eventType=$1;return"";});if(!parsed[type]){var key,mods={};type.split("+").each(function(part){if(regex.test(part)){mods[part]=true;}else{key=part;}});mods.control=mods.control||mods.ctrl;var keys=[];modifiers.each(function(mod){if(mods[mod]){keys.push(mod);}});if(key){keys.push(key);}parsed[type]=keys.join("+");}return eventType+":"+parsed[type];};Keyboard.each=function(keyboard,fn){var current=keyboard||Keyboard.manager;while(current){fn.run(current);current=current.activeKB;}};Keyboard.stop=function(event){event.preventKeyboardPropagation=true;};Keyboard.manager=new Keyboard({active:true});Keyboard.trace=function(keyboard){keyboard=keyboard||Keyboard.manager;keyboard.enableLog();keyboard.log("the following items have focus: ");Keyboard.each(keyboard,function(current){keyboard.log(document.id(current.widget)||current.wiget||current);});};var handler=function(event){var keys=[];modifiers.each(function(mod){if(event[mod]){keys.push(mod);}});if(!regex.test(event.key)){keys.push(event.key);}Keyboard.manager.handle(event,event.type+":"+keys.join("+"));};document.addEvents({"keyup":handler,"keydown":handler});Event.Keys.extend({"shift":16,"control":17,"alt":18,"capslock":20,"pageup":33,"pagedown":34,"end":35,"home":36,"numlock":144,"scrolllock":145,";":186,"=":187,",":188,"-":Browser.Engine.Gecko?109:189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222});})();(function(){var read=function(option,element){return(option)?($type(option)=="function"?option(element):element.get(option)):"";};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle("display","block");},onHide:function(){this.tip.setStyle("display","none");},title:"title",text:function(element){return element.get("rel")||element.get("href");},showDelay:100,hideDelay:100,className:"tip-wrap",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:false},initialize:function(){var params=Array.link(arguments,{options:Object.type,elements:$defined});this.setOptions(params.options);if(params.elements){this.attach(params.elements);}},toElement:function(){if(this.tip){return this.tip;}this.container=new Element("div",{"class":"tip"});return this.tip=new Element("div",{"class":this.options.className,styles:{position:"absolute",top:0,left:0}}).adopt(new Element("div",{"class":"tip-top"}),this.container,new Element("div",{"class":"tip-bottom"})).inject(document.body);},attach:function(elements){$$(elements).each(function(element){var title=read(this.options.title,element),text=read(this.options.text,element);element.erase("title").store("tip:native",title).retrieve("tip:title",title);element.retrieve("tip:text",text);this.fireEvent("attach",[element]);var events=["enter","leave"];if(!this.options.fixed){events.push("move");}events.each(function(value){var event=element.retrieve("tip:"+value);if(!event){event=this["element"+value.capitalize()].bindWithEvent(this,element);}element.store("tip:"+value,event).addEvent("mouse"+value,event);},this);},this);return this;},detach:function(elements){$$(elements).each(function(element){["enter","leave","move"].each(function(value){element.removeEvent("mouse"+value,element.retrieve("tip:"+value)).eliminate("tip:"+value);});this.fireEvent("detach",[element]);if(this.options.title=="title"){var original=element.retrieve("tip:native");if(original){element.set("title",original);}}},this);return this;},elementEnter:function(event,element){this.container.empty();["title","text"].each(function(value){var content=element.retrieve("tip:"+value);if(content){this.fill(new Element("div",{"class":"tip-"+value}).inject(this.container),content);}},this);$clear(this.timer);this.timer=(function(){this.show(this,element);this.position((this.options.fixed)?{page:element.getPosition()}:event);}).delay(this.options.showDelay,this);},elementLeave:function(event,element){$clear(this.timer);this.timer=this.hide.delay(this.options.hideDelay,this,element);this.fireForParent(event,element);},fireForParent:function(event,element){element=element.getParent();if(!element||element==document.body){return;}if(element.retrieve("tip:enter")){element.fireEvent("mouseenter",event);}else{this.fireForParent(event,element);}},elementMove:function(event,element){this.position(event);},position:function(event){if(!this.tip){document.id(this);}var size=window.getSize(),scroll=window.getScroll(),tip={x:this.tip.offsetWidth,y:this.tip.offsetHeight},props={x:"left",y:"top"},obj={};for(var z in props){obj[props[z]]=event.page[z]+this.options.offset[z];if((obj[props[z]]+tip[z]-scroll[z])>size[z]-this.options.windowPadding[z]){obj[props[z]]=event.page[z]-this.options.offset[z]-tip[z];}}this.tip.setStyles(obj);},fill:function(element,contents){if(typeof contents=="string"){element.set("html",contents);}else{element.adopt(contents);}},show:function(element){if(!this.tip){document.id(this);}this.fireEvent("show",[this.tip,element]);},hide:function(element){if(!this.tip){document.id(this);}this.fireEvent("hide",[this.tip,element]);}});})();MooTools.lang.set("en-US","Date",{months:["January","February","March","April","May","June","July","August","September","October","November","December"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dateOrder:["month","date","year"],shortDate:"%m/%d/%Y",shortTime:"%I:%M%p",AM:"AM",PM:"PM",ordinal:function(dayOfMonth){return(dayOfMonth>3&&dayOfMonth<21)?"th":["th","st","nd","rd","th"][Math.min(dayOfMonth%10,4)];},lessThanMinuteAgo:"less than a minute ago",minuteAgo:"about a minute ago",minutesAgo:"{delta} minutes ago",hourAgo:"about an hour ago",hoursAgo:"about {delta} hours ago",dayAgo:"1 day ago",daysAgo:"{delta} days ago",weekAgo:"1 week ago",weeksAgo:"{delta} weeks ago",monthAgo:"1 month ago",monthsAgo:"{delta} months ago",yearAgo:"1 year ago",yearsAgo:"{delta} years ago",lessThanMinuteUntil:"less than a minute from now",minuteUntil:"about a minute from now",minutesUntil:"{delta} minutes from now",hourUntil:"about an hour from now",hoursUntil:"about {delta} hours from now",dayUntil:"1 day from now",daysUntil:"{delta} days from now",weekUntil:"1 week from now",weeksUntil:"{delta} weeks from now",monthUntil:"1 month from now",monthsUntil:"{delta} months from now",yearUntil:"1 year from now",yearsUntil:"{delta} years from now"});
+
+
+
+var Base=new Class({initialize:function(){this.p=pipio;this.registerHandlers();if($defined(this.init)){var args=[];for(var i=0;i<arguments.length;i++){args.push(arguments[i]);}this.init.run(args,this);}},registerHandlers:function(){if($defined(this.EventHandlers)){for(var i=0;i<this.EventHandlers.length;i++){var event=this.EventHandlers[i];try{this.registerHandler(event,this[event].bind(this));}catch(e){Logger().log(event);}}}},registerHandler:function(eventName,func){this.p.registerHandler(eventName,func);},fireEvent:function(){var args=[];for(var i=0;i<arguments.length;i++){args.push(arguments[i]);}this.p.dispatchEvent.run(args,this.p);},call:function(app,name,params,callbackSuccess,callbackFail,form){this.p.call(app,name,params,callbackSuccess,callbackFail,form);},getPrivateUser:function(){return this.p.currentUser;},getCurrentLocation:function(){return this.p.currentLocation;},getLocation:function(username){return this.p.getLocation(username);},getLocations:function(){return this.p.locationsByUsername;},getProfile:function(username){return this.p.getProfile(username);},getSession:function(){return this.p.xmpp.clientName;},getGroups:function(){return this.p.groups;},getContacts:function(){return this.p.connsByUsername;},getContactRequests:function(){return this.p.requestsByUsername;},getContactsByGroup:function(group_id){return this.p.getContactsByGroup(group_id);},getContact:function(username){return this.p.getContact(username);},hasContact:function(username){return this.p.connsByUsername.has(username);},getRoom:function(username){return this.p.getRoom(username);},getRooms:function(){return this.p.roomsByUsername;},getGroup:function(group_id){return this.p.connections.getGroup(group_id);},getUser:function(username){if(username==this.p.currentUser.username){return this.p.currentUser;}else{return this.p.getUser(username);}},videoEnabled:function(){if(this.p.videoInUse){return false;}else{return this.p.videoEnabled;}},checkTimestamp:function(time){return this.p.checkTimestamp(time);},getAppById:function(appId){return this.p.getAppById(appId);},isLoggedIn:function(){return this.p.isLoggedIn();},getPageTitle:function(){return this.p.pageTitle;},getConnectionState:function(username){var state=0;if(this.p.connsByUsername.has(username)){state=1;}else{if(this.p.requestsByUsername.has(username)){state=2;}else{if(this.p.requestsOutByUsername.has(username)){state=3;}}}return state;}});var App=new Class({Extends:Base,initialize:function(app){this.parent();this.name=app.name;this.iconOptions=app.iconOptions;this.registerApis();this.displayName=app.displayName;this.appId=app.id;this.autoDock=app.autoDock||false;this.isStarted=false;this.isDocked=false;this.isExpanded=true;this.defaultMenu=undefined;this.defaultContent=undefined;this.menus=$H();this.contents=$H();this.navs=$H();},registerApis:function(){if($defined(this.requests)){this.requests.each(function(request){this.p.registerCall(this.name,request);},this);}},start:function(options){if(!this.isStarted){if($defined(this.parseOptions)&&$defined(options)){this.parseOptions(options);}this.createApp();this.onStart();this.isStarted=true;if(this.autoDock){this.dock();}}else{if(this.isStarted&&this.isDocked){this.switchDefault();}}if(!this.isLoggedIn()){this.dock();}this.switchDefault();},stop:function(){Logger().log("stopping app"+this.appId);if(this.isStarted){this.destroyApp();this.onStop();this.isStarted=false;this.isDocked=false;this.isExpanded=true;}},getDockIcon:function(){var icon=new Icon20(this.iconOptions);var el=new Element("div",{"class":"app_button has_submenu"}).adopt($(icon),$(this.alert));el.addEvent("click",this.switchDefault.bind(this));return el;},dock:function(){DomUtility.hide(this.navSection);this.undockSep=new Element("div",{"class":"nav_seperator"});this.undockNav=new Nav({displayName:"Undock",onClick:this.undock.bind(this),name:"undock"});this.undockSep.inject(this.navWrapper);$(this.undockNav).inject(this.navWrapper);this.dockButton=new Element("div",{"class":"app_button_wrapper"}).adopt(this.getDockIcon(),this.navWrapper);this.dockButton.inject("dock");this.isDocked=true;},undock:function(){if(!this.isLoggedIn()){this.switchDefault();return;}this.undockSep.destroy();$(this.undockNav).destroy();this.undockNav=null;this.navWrapper.inject(this.navSection);this.dockButton.destroy();DomUtility.show(this.navSection);this.isDocked=false;this.switchDefault();},switchDefault:function(){if($defined(this.defaultContent)){this.fireEvent("viewSwitch",this.appId,this.defaultContent,this.defaultMenu);}},menuAdd:function(menuName,menu){this.fireEvent("menuAdd",this.appId,menuName,menu);if(menu.isDefault){this.defaultMenu=menuName;}this.menus.set(menuName,menu);},menuClose:function(menuName){this.fireEvent("menuClose",this.appId,menuName);this.menus.erase(menuName);},contentAdd:function(contentName,content){this.fireEvent("contentAdd",this.appId,contentName,content);if(content.isDefault){this.defaultContent=contentName;}this.contents.set(contentName,content);},contentClose:function(contentName){this.fireEvent("contentClose",this.appId,contentName);this.contents.erase(contentName);},navAdd:function(nav){var navId=this.appId+"_"+nav.name;nav.navId=navId;if($defined(nav.parentName)){nav.parentId=this.appId+"_"+nav.parentName;}if(this.navs.has(navId)){Logger().log(navId+" nav exist, did not add");return;}if($defined(nav.parentId)){if(!this.navs.has(nav.parentId)){Logger().log(nav.parentId+" parent does not exist");return;}var parent=this.navs.get(nav.parentId);if(!parent.hasSubnavs){Logger().log(nav.parentId+" parent does not allow subnavs");return;}else{parent.addSubnav(nav);}}else{nav.parentId=this.appId;if(nav.bottom){$(nav).inject(this.bottomNav);}else{$(nav).inject(this.nav);}}this.navs.set(navId,nav);},navDelete:function(navName){var navId=this.appId+"_"+navName;if(!this.navs.has(navId)){return;}this.navs.get(navId).destroy();this.navs.erase(navId);},createAppAlert:function(){this.alert=new Alert();this.registerHandler("alertAdd",this.alertAdd.bind(this));this.registerHandler("alertClear",this.alertClear.bind(this));},alertAdd:function(navId){if(navId!=this.appId){return;}this.alert.increment();},alertClear:function(navId,count){if(navId!=this.appId){return;}if(!$defined(count)){var alerts=this.alert.clear();}else{this.alert.decrement(count);}},createApp:function(){this.navSection=new Element("div",{"class":"nav_section"});this.navHeader=new Element("div",{"class":"nav_header clip2"}).inject(this.navSection);this.navWrapper=new Element("div",{"class":"app_sub_menu sub_elements"}).inject(this.navSection);this.nav=new Element("div").inject(this.navWrapper);this.bottomNav=new Element("div").inject(this.navWrapper);this.navSection.inject("nav");this.icon=new Icon20(this.iconOptions);$(this.icon).inject(this.navHeader);this.headerName=new Element("div",{"class":"header_name text12 light","text":TextUtility.unescapeQuotes(this.displayName)}).inject(this.navHeader);this.closeButton=new Element("div",{"class":"button_nav right"}).adopt(new Element("div",{"class":"action close"})).inject(this.navHeader);this.closeButton.addEvent("click",this.stop.bind(this));this.dockButton=new Element("div",{"class":"button_nav right"}).adopt(new Element("div",{"class":"action dock"})).inject(this.navHeader);this.dockButton.addEvent("click",this.dock.bind(this));this.createAppAlert();if($defined(this.onCreate)){this.onCreate();}},destroyApp:function(){this.contents.each(function(content,contentName){this.contentClose(contentName);},this);this.contents.empty();this.menus.each(function(menu,menuName){this.menuClose(menuName);},this);this.menus.empty();this.navs.each(function(nav){nav.destroy();});this.navs.empty();this.navHeader.destroy();this.nav.destroy();this.navSection.destroy();if($defined(this.dockButton)){this.dockButton.destroy();}this.fireEvent("appClose",this.appId);if($defined(this.onDestroy)){this.onDestroy();}}});var AppInstance=new Class({Extends:Base,Implements:App,initialize:function(app,options){this.parent();this.appId=options.appId;this.parseOptions(options);this.name=app.name;this.registerApis();this.isStarted=false;this.isDocked=false;this.isExpanded=true;this.autoDock=app.autoDock||false;this.defaultMenu=undefined;this.defaultContent=undefined;this.menus=$H();this.contents=$H();this.navs=$H();},start:function(appId){this.appId=appId;if(!this.isStarted){this.appId=appId;this.createApp();this.onStart();this.isStarted=true;if(this.autoDock){this.dock();}}else{if(this.isStarted&&this.isDocked){this.switchDefault();}}if(!this.isLoggedIn()){this.dock();}this.switchDefault();}});var Content=new Class({Extends:Base,init:function(options){if(!$defined(options)){options={};}if($defined(this.onBeforeInit)){this.onBeforeInit(options);}this.className=$defined(options.className)?options.className:"";this.isDefault=options.isDefault||false;this.isOn=true;this.firstShow=true;this.bottomFuncCalled=false;this.atBottom=false;this.createContent();if($defined(this.onInit)){this.onInit();}},checkScroll:function(){var maxY=this.contentWrapper.getScrollSize().y;var bottomY=this.contentWrapper.getScroll().y+this.contentWrapper.getSize().y+300;Logger().log("checking scroll "+bottomY+"-"+maxY);if(bottomY>maxY&&!this.bottomFuncCalled&&!this.atBottom){this.bottomFuncCalled=true;this.bottomFunc();}},destroy:function(){if($defined(this.onDestroy)){this.onDestroy();}this.contentWrapper.destroy();},on:function(){this.isOn=true;DomUtility.show(this.contentWrapper);if($defined(this.scrollY)){this.scroll.set(0,this.scrollY);}if($defined(this.onShow)){if(this.firstShow){this.onShow(true);this.firstShow=false;}else{this.onShow(false);}}},off:function(){this.isOn=false;if($defined(this.onHide)){this.onHide();}if($defined(this.contentWrapper)){this.scrollY=this.contentWrapper.getScroll().y;}DomUtility.hide(this.contentWrapper);},createContent:function(){this.contentWrapper=new Element("div",{"class":"content_wrapper"});this.content=new Element("div",{"class":"content "+this.className}).inject(this.contentWrapper);if($defined(this.bottomFunc)){this.contentWrapper.addEvent("mousewheel",this.checkScroll.bind(this));}this.scroll=new Fx.Scroll(this.contentWrapper);},toElement:function(){return this.contentWrapper;}});var Album=new Class({initialize:function(options){this.className=options.className||"";this.id=options.id||"";this.displayName=options.displayName||"Album";this.albumPhotos=new $H();},addPhoto:function(id,thumb,src,caption){var photo=new Object();photo.id=id;photo.caption=caption;photo.thumb=thumb;photo.src=src;this.albumPhotos.set(id,photo);},getPhoto:function(id){return this.albumPhotos.get(id);},getAllPhotos:function(){return this.albumPhotos.getValues();},getSize:function(){return this.albumPhotos.getLength();},getNextPrevPhoto:function(id){var allIds=this.albumPhotos.getKeys();var index=allIds.indexOf(id);var photos=this.albumPhotos.getValues();var i=index;if(allIds.length<=index+1){i=-1;}var next=photos[i+1];i=index;if(index==0){i=allIds.length;}var prev=photos[i-1];return{prev:prev,next:next};},getIndex:function(id){var allIds=this.albumPhotos.getKeys();return allIds.indexOf(id);},nextPhoto:function(id){var allIds=this.albumPhotos.getKeys();var index=allIds.indexOf(id);var photos=this.albumPhotos.getValues();if(allIds.length<=index+1){index=-1;}return photos[index+1];},prevPhoto:function(id){var allIds=this.albumPhotos.getKeys();var index=allIds.indexOf(id);var photos=this.albumPhotos.getValues();if(index==0){index=allIds.length;}return photos[index-1];}});var Alert=new Class({initialize:function(){this.alerts=0;this.createAlert();},createAlert:function(){this.alert=new Element("div",{"class":"alert","text":"0","style":"display: none !important"});},hasAlerts:function(){return this.alerts>0;},update:function(){if(this.alerts<0){this.alerts=0;}this.alert.set("text",this.alerts);if(this.alerts==0){this.alert.setStyle("display","none !important");}else{this.alert.setStyle("display","");}},increment:function(x){if(!$defined(x)){this.alerts++;}else{this.alerts+=x;}this.update();},decrement:function(x){if(!$defined(x)){this.alerts--;}else{this.alerts-=x;}this.update();},clear:function(){var alerts=this.alerts;this.alerts=0;this.update();return alerts;},toElement:function(){return this.alert;},destroy:function(){this.alert.destroy();}});var ButtonMedium=new Class({initialize:function(options){this.displayName=options.displayName;this.className=options.className||"";this.action=options.action||undefined;this.disabled=options.disabled||false;this.createButton();},createButton:function(){this.button=new Element("div",{"class":"button_medium"});this.button.addClass(this.className);if($defined(this.action)){this.button.addClass("has_action");new Element("div",{"class":"action "+this.action}).inject(this.button);}this.button.appendText(TextUtility.unescapeQuotes(this.displayName));},showProgress:function(){this.button.addClass("progress");},hideProgress:function(){this.button.removeClass("progress");},toElement:function(){return this.button;}});var ButtonSmall=new Class({initialize:function(options){this.displayName=options.displayName;this.className=options.className||"";this.action=options.action||undefined;this.disabled=options.disabled||false;this.createButton();},createButton:function(){this.button=new Element("div",{"class":"button_small"});this.button.addClass(this.className);if($defined(this.action)){this.button.addClass("has_action");new Element("div",{"class":"action "+this.action}).inject(this.button);}this.button.appendText(TextUtility.unescapeQuotes(this.displayName));},showProgress:function(){this.button.addClass("progress");},hideProgress:function(){this.button.removeClass("progress");},toElement:function(){return this.button;}});var Icon=new Class({initialize:function(options){this.iconAction=options.iconAction||null;this.isUser=$defined(options.user);if(this.isUser){this.user=options.user;}else{this.iconName=options.iconName;if(this.iconName.contains("http://")){this.isClass=false;}else{this.isClass=true;}}this.createIcon();},createIcon:function(){this.icon=new Element("div",{"class":"icon_wrapper"});if(!this.isUser){if(this.isClass){this.icon.addClass("hasicon on "+this.iconName);this.icon.adopt(new Element("div",{"class":"icon"}));}else{this.icon.adopt(new Element("img",{"src":this.iconName,"style":"height: 16px; width: 16px;"}));}}else{this.icon.addClass("profile_pic_wrapper_16");this.icon.adopt(new Element("img",{"class":"profile_pic profile_pic_16_"+this.user.username,"src":this.user["profile_pic_16"]}),new Element("div",{"class":"online_status online_status_"+this.user.username}));}if($defined(this.iconAction)){this.addAction(this.iconAction);}},toElement:function(){return this.icon;},addAction:function(action){this.iconAction=action;if($defined(this.action)){this.action.destroy();}this.action=new Element("div",{"class":"icon_action "+this.iconAction}).inject(this.icon);}});var Icon20=new Class({initialize:function(options){this.iconAction=options.iconAction||null;this.isUser=$defined(options.user);if(this.isUser){this.user=options.user;}else{this.iconName=options.iconName;if(this.iconName.contains("http://")){this.isClass=false;}else{this.isClass=true;}}this.createIcon();},createIcon:function(){this.icon=new Element("div",{"class":"icon_wrapper"});if(!this.isUser){if(this.isClass){this.icon.addClass("hasicon on "+this.iconName);this.icon.adopt(new Element("div",{"class":"icon20"}));}else{this.icon.adopt(new Element("img",{"src":this.iconName,"style":"height: 20px; width: 20px;"}));}}else{this.icon.addClass("profile_pic_wrapper_16a");this.icon.adopt(new Element("img",{"class":"profile_pic profile_pic_16_"+this.user.username,"src":this.user["profile_pic_16"]}),new Element("div",{"class":"online_status online_status_"+this.user.username}));}if($defined(this.iconAction)){this.addAction(this.iconAction);}},toElement:function(){return this.icon;},addAction:function(action){this.iconAction=action;if($defined(this.action)){this.action.destroy();}this.action=new Element("div",{"class":"icon_action "+this.iconAction}).inject(this.icon);}});var InlineImage=new Class({initialize:function(attachment){this.attachment=attachment;this.imageWrapper=new Element("div",{"class":"thumbnail"});this.progress=new Element("div",{"class":"progress"}).inject(this.imageWrapper);this.image=new Asset.image(this.attachment.url,{title:this.attachment.filename,onload:this.photoLoaded.bind(this)});},photoLoaded:function(){this.progress.destroy();var imageW=this.image.width;var imageH=this.image.height;if(imageH>100){imageW=(100/imageH)*imageW;imageH=100;}this.image.setStyles({height:imageH+"px",width:imageW+"px"});this.imageWrapper.setStyle("width",imageW+"px");this.image.inject(this.imageWrapper);this.image.addEvent("click",pipio.dispatchEvent.bind(pipio,["showPhotoPopup",this.attachment]));},toElement:function(){return this.imageWrapper;}});var ItemLoader=new Class({initialize:function(options){this.items=$H();this.sortValues=$H();this.empty=true;this.highestId=0;this.lowestId=0;this.highestSortValue=0;this.lowestSortValue=0;this.idField=options.idField;this.sortField=options.sortField;this.sortAlpha=options.sortAlpha||false;this.sortAscending=$defined(options.sortAscending)?options.sortAscending:true;this.createElementFunc=options.createElementFunc;this.emptyEl=options.emptyEl||null;this.errorEl=options.errorEl||null;this.loadingEl=options.loadingEl||null;this.createLoader();},remove:function(id){if(!this.items.has(id)){return;}DomUtility.fadeOutDestroy(this.items.get(id));var sortKey=this.sortValues.keyOf(id);this.sortValues.erase(sortKey);this.items.erase(id);if(this.items.getLength()==0){this.empty=true;this.highestId=0;this.lowestId=0;this.highestSortValue=0;this.lowestSortValue=0;this.showEmpty();}},showEmpty:function(){if(!$defined(this.emptyEl)){return;}if(this.empty){DomUtility.show(this.emptyEl);}else{DomUtility.hide(this.emptyEl);}},showError:function(){if(!$defined(this.errorEl)){return;}if($defined(this.emptyEl)){DomUtility.hide(this.emptyEl);}if($defined(this.loadingEl)){DomUtility.hide(this.loadingEl);}DomUtility.show(this.errorEl);},hideError:function(){if($defined(this.errorEl)){DomUtility.hide(this.errorEl);}if(this.empty){this.showEmpty();}},showLoading:function(){if(!$defined(this.loadingEl)||!this.empty){return;}if($defined(this.emptyEl)){DomUtility.hide(this.emptyEl);}if($defined(this.errorEl)){DomUtility.hide(this.errorEl);}DomUtility.show(this.loadingEl);},hideLoading:function(){if($defined(this.loadingEl)){DomUtility.hide(this.loadingEl);}if(this.empty){this.showEmpty();}},process:function(data){var id=data[this.idField];var sortValue=data[this.sortField];if(this.items.has(id)){Logger().log("item "+id+" exists, do not insert");return;}var position=this.checkBoundary(sortValue,id);if(!position){position=this.findPosition(data);}if(typeof position=="object"){this.insertItem(data,"before",position);}else{this.insertItem(data,position);}},findPosition:function(data){var id=data[this.idField];var sortValue=data[this.sortField];if(this.empty){this.highestId=id;this.lowestId=id;this.highestSortValue=sortValue;this.lowestSortValue=sortValue;this.empty=false;return"top";}else{var sortValues=this.getSortValues();for(var i=0;i<sortValues.length;i++){if(this.sortAlpha){if(this.sortAscending){if(sortValue.toString()<sortValues[i].toString()){return this.items[this.sortValues[sortValues[i]]];}}else{if(sortValue.toString()>sortValues[i].toString()){return this.items[this.sortValues[sortValues[i]]];}}}else{if(this.sortAscending){if(parseInt(sortValue)<parseInt(sortValues[i])){return this.items[this.sortValues[sortValues[i]]];}}else{if(parseInt(sortValue)>parseInt(sortValues[i])){return this.items[this.sortValues[sortValues[i]]];}}}}}},getSortValues:function(){if(this.sortAlpha){if(this.sortAscending){return this.sortValues.getKeys().sort();}else{return this.sortValues.getKeys().sort().reverse();}}else{if(this.sortAscending){return this.sortValues.getKeys().sort(this.sortIntAsc);}else{return this.sortValues.getKeys().sort(this.sortIntDesc);}}},sortIntAsc:function(a,b){return a-b;},sortIntDesc:function(a,b){return b-a;},checkBoundary:function(sortValue,id){if(this.sortAlpha){if(this.empty){this.highestId=id;this.lowestId=id;this.highestSortValue=sortValue.toString();this.lowestSortValue=sortValue.toString();this.empty=false;return"top";}if(sortValue.toString()>this.highestSortValue.toString()){this.highestSortValue=sortValue.toString();this.highestId=id;return(this.sortAscending)?"bottom":"top";}else{if(sortValue.toString()<this.lowestSortValue.toString()){this.lowestSortValue=sortValue.toString();this.lowestId=id;return(this.sortAscending)?"top":"bottom";}else{return false;}}}else{if(this.empty){this.highestId=id;this.lowestId=id;this.highestSortValue=sortValue.toString();this.lowestSortValue=sortValue.toString();this.empty=false;return"top";}if(parseInt(sortValue)>parseInt(this.highestSortValue)){this.highestSortValue=parseInt(sortValue);this.highestId=id;return(this.sortAscending)?"bottom":"top";}else{if(parseInt(sortValue)<parseInt(this.lowestSortValue)){this.lowestSortValue=parseInt(sortValue);this.lowestId=id;return(this.sortAscending)?"top":"bottom";}else{return false;}}}},insertItem:function(data,position,beforeEl){var el=this.createElementFunc(data);var sortValue=data[this.sortField];var id=data[this.idField];this.items.set(id,el);this.sortValues.set(sortValue,id);if(position=="top"){el.inject(this.loader,"top");}else{if(position=="before"){el.inject(beforeEl,"before");}else{el.inject(this.loader,"bottom");}}this.empty=false;this.showEmpty();this.hideLoading();this.hideError();},createLoader:function(){this.loader=new Element("div",{});if($defined(this.emptyEl)){this.emptyEl.inject(this.loader);}if($defined(this.errorEl)){this.errorEl.inject(this.loader);DomUtility.hide(this.errorEl);}if($defined(this.loadingEl)){this.loadingEl.inject(this.loader);DomUtility.hide(this.loadingEl);}},count:function(){return this.items.getLength();},toElement:function(){return this.loader;}});function MarkerLight(latlng,opts){this.latlng=latlng;var size=26;var smallSize=20;if(!opts){opts={};}this.user_=opts.user;this.size_=opts.size||size;this.height_=opts.size||size;this.width_=opts.size||size;this.image_=UserUtility.getProfilePic(this.user_.user_hash,this.user_.user_id,this.size_);this.imageOver_=opts.imageOver;this.clicked_=0;this.divClass_="profile_pic_wrapper_"+this.size_;this.imgClass_="profile_pic profile_pic_"+this.size_+"_"+opts.user.username;this.divStyleClass_="online_status online_status_"+opts.user.username;}MarkerLight.prototype=new GOverlay();MarkerLight.prototype.initialize=function(map){var me=this;var div=document.createElement("div");div.className=me.divClass_;div.style.position="absolute";div.style.paddingLeft="0px";div.style.cursor="pointer";div.style.zIndex=1;var tip=new Element("div",{"class":"tooltip above_right","text":TextUtility.unescape(me.user_.fullname)}).adopt(new Element("div",{"class":"tip_corner"}));tip.inject(div);var img=document.createElement("img");img.src=me.image_;img.className=me.imgClass_;img.style.width=me.width_+"px";img.style.height=me.height_+"px";div.appendChild(img);var styleDiv=document.createElement("div");styleDiv.className=me.divStyleClass_;div.appendChild(styleDiv);GEvent.addDomListener(div,"click",function(event){me.clicked_=1;GEvent.trigger(me,"click");pipio.dispatchEvent("showUser",me.user_);});map.getPane(G_MAP_MARKER_PANE).appendChild(div);this.map_=map;this.div_=div;};MarkerLight.prototype.remove=function(){if($defined(this.div_.parentNode)){this.div_.parentNode.removeChild(this.div_);}};MarkerLight.prototype.copy=function(){var opts={};opts.color=this.color_;opts.height=this.height_;opts.width=this.width_;opts.image=this.image_;opts.imageOver=this.image_;return new MarkerLight(this.latlng,opts);};MarkerLight.prototype.redraw=function(force){if(!force){return;}var divPixel=this.map_.fromLatLngToDivPixel(this.latlng);this.div_.style.width=this.width_+"px";this.div_.style.left=(divPixel.x-Math.round(this.width_/2))+"px";this.div_.style.width=this.height_+"px";this.div_.style.top=(divPixel.y)-this.height_+"px";};MarkerLight.prototype.getZIndex=function(m){return GOverlay.getZIndex(marker.getPoint().lat())-m.clicked*10000;};MarkerLight.prototype.getPoint=function(){return this.latlng;};MarkerLight.prototype.setStyle=function(style){for(s in style){this.div_.style[s]=style[s];}};MarkerLight.prototype.setImage=function(image){this.div_.style.background='url("'+image+'")';};var Menu=new Class({Extends:Base,init:function(options){if($defined(this.onBeforeInit)){options=this.onBeforeInit(options);}this.displayName=options.displayName;this.className=$defined(options.className)?options.className:"";this.isDefault=options.isDefault||false;this.closeFunc=$defined(options.closeFunc)?options.closeFunc:null;this.firstShow=true;this.isOn=true;this.createMenu();if($defined(this.onInit)){this.onInit();}},on:function(){DomUtility.show(this.menu);if($defined(this.onShow)){if(this.firstShow){this.onShow(true);this.firstShow=false;}else{this.onShow(false);}}this.isOn=true;},off:function(){if($defined(this.onHide)){this.onHide();}DomUtility.hide(this.menu);this.isOn=false;},destroy:function(){if($defined(this.onDestroy)){this.onDestroy();}this.menu.destroy();},addSection:function(section){section.inject(this.menu);},createMenu:function(){this.title=new Element("div",{"class":"menu_text","text":TextUtility.unescapeQuotes(this.displayName)});this.menu=new Element("div",{"class":"menu "+this.className}).adopt(new Element("div",{"class":"menu_title text12 light"}).adopt(this.title));if($defined(this.closeFunc)){this.menu.addClass("closable");this.closeButton=new Element("div",{"class":"button_nav right"}).adopt(new Element("div",{"class":"action close"})).inject(this.title,"after");$(this.closeButton).addEvent("click",this.closeFunc);}},toElement:function(){return this.menu;}});var Nav=new Class({Extends:Base,EventHandlers:["contentSwitched","alertAdd","alertClear"],init:function(options){if($defined(this.onBeforeInit)){options=this.onBeforeInit(options);}this.name=options.name;this.iconOptions=$defined(options.iconOptions)?options.iconOptions:null;this.displayName=options.displayName;this.className=$defined(options.className)?options.className:"";this.parentName=options.parentName||undefined;if($defined(this.parentName)){this.className+=" sub1";}this.bottom=$defined(options.bottom)?options.bottom:false;this.hasSubnavs=$defined(options.hasSubnavs)?options.hasSubnavs:false;this.closable=$defined(options.closable)?options.closable:false;this.onClose=$defined(options.onClose)?options.onClose:undefined;this.defaultClosed=$defined(options.defaultClosed)?options.defaultClosed:false;this.onClick=$defined(options.onClick)?options.onClick:undefined;this.isExpanded=true;this.isOn=false;this.subnavEls=$H();this.createNav();if($defined(this.onInit)){this.onInit();}},alertAdd:function(navId){if(!$defined(this.navId)||!$defined(this.alert)){return;}if(navId!=this.navId){return;}if(this.isOn){return;}this.alert.increment();if($defined(this.parentId)){this.fireEvent("alertAdd",this.parentId);}},alertClear:function(navId,count){if(!$defined(this.navId)||!$defined(this.alert)){return;}if(navId!=this.navId){return;}if(!$defined(count)){var alerts=this.alert.clear();if($defined(this.parentId)){this.fireEvent("alertClear",this.parentId,alerts);}}else{this.alert.decrement(count);if($defined(this.parentId)){this.fireEvent("alertClear",this.parentId,count);}}},contentSwitched:function(navId){if(!$defined(this.navId)){return;}if(navId==this.navId){this.on();this.alertClear(this.navId);}else{if(navId!=this.navId&&this.isOn){this.off();}}},on:function(){this.nav.addClass("on");this.isOn=true;},off:function(){this.nav.removeClass("on");this.isOn=false;},click:function(){if($defined(this.onClick)){this.onClick();}},close:function(e){e.stopPropagation();if($defined(this.onClose)){this.onClose();}this.destroy();},toggleSubnav:function(e){e.stopPropagation();if(!this.isExpanded){this.expand();}else{this.collapse();}},expand:function(){if(!this.isExpanded&&this.hasSubnavs){DomUtility.expand(this.subnavs);this.pivot.removeClass("pivot_right");this.pivot.addClass("pivot_down");this.nav.removeClass("collapsed");this.isExpanded=true;if($defined(this.onExpand)){this.onExpand();}}},collapse:function(){if(this.isExpanded&&this.hasSubnavs){DomUtility.collapse(this.subnavs);this.pivot.removeClass("pivot_down");this.pivot.addClass("pivot_right");this.nav.addClass("collapsed");this.isExpanded=false;if($defined(this.onCollapse)){this.onCollapse();}}},toElement:function(){return this.navWrapper;},addSubnav:function(nav){if(nav.bottom){$(nav).inject(this.subnavBottomItems);}else{$(nav).inject(this.subnavItems);}this.subnavEls.set(nav.name,nav);},deleteSubnav:function(name){if(!this.subnavEls.has(name)){return;}this.subnavEls.get(name).destroy();this.subnavEls.erase(name);},hasSubnav:function(name){return this.subnavEls.has(name);},createNav:function(){this.navWrapper=new Element("div");this.nav=new Element("div",{"class":"nav"}).inject(this.navWrapper);this.nav.addEvent("click",this.click.bind(this));if(this.hasSubnavs){this.subnavItems=new Element("div");this.subnavBottomItems=new Element("div");this.subnavs=new Element("div",{"class":"sub_elements"}).adopt(this.subnavItems,this.subnavBottomItems).inject(this.navWrapper);this.nav.addClass("has_submenu");}this.nav.addClass(this.className);this.pivot=new Element("div",{"class":"action pivot_down"}).inject(this.nav);this.pivot.addEvent("click",this.toggleSubnav.bindWithEvent(this));if($defined(this.iconOptions)){this.icon=new Icon(this.iconOptions);$(this.icon).inject(this.nav);}else{this.nav.addClass("noicon");}this.alert=new Alert();$(this.alert).inject(this.nav);this.navName=new Element("div",{"class":"nav_name text12 light","text":TextUtility.unescapeQuotes(this.displayName)}).inject(this.nav);if(this.closable){this.closeButton=new Element("div",{"class":"action close"}).inject(this.nav);this.closeButton.addEvent("click",this.close.bindWithEvent(this));}if(this.defaultClosed){this.collapse();}},destroy:function(){if($defined(this.navWrapper)){this.navWrapper.destroy();}if($defined(this.alert)){this.alert.destroy();this.alert=null;}}});var ScrollBar=new Class({initialize:function(content,wrapper){this.content=$(content);this.wrapper=$(wrapper);this.disabled=false;this.createScrollbar();this.setupHandlers();},disable:function(){this.disabled=true;},enable:function(){this.disabled=false;},createScrollbar:function(){this.scrollbar=new Element("div",{"class":"scrollbar"});this.scrollbar.inject(this.wrapper);},dragOn:function(){this.wrapper.addClass("on");},dragOff:function(){this.wrapper.removeClass("on");},setupHandlers:function(){this.scrollHandleDrag=new Drag(this.scrollbar,{snap:0,limit:{"x":[0,0],"y":[0,this.getHandleYMax.bind(this)]},onStart:this.dragOn.bind(this),onDrag:this.handleDragHandler.bind(this),onComplete:this.dragOff.bind(this),onCancel:this.dragOff.bind(this)});this.contentScroller=new Fx.Scroll(this.content,{wheelStops:false});this.content.addEvent("mousewheel",this.scrollHandler.bindWithEvent(this));this.update.periodical(500,this,true);},update:function(){if(this.disabled){return;}var scrollH=this.content.getScrollSize().y;var h=this.content.getSize().y;if(scrollH>h){this.wrapper.addClass("scrolling");var contentScrollRatio=this.content.getScroll().y/this.getContentYMax();if(contentScrollRatio>1){contentScrollRatio=1;this.content.scrollTo(0,this.getContentYMax());}var handleY=this.getHandleYMax()*contentScrollRatio;this.scrollbar.setStyle("top",handleY);}else{this.wrapper.removeClass("scrolling");}},scrollHandler:function(e){if(this.disabled){return;}e=new Event(e);e.stopPropagation();if(e.wheel>0){this.scrollUp(name);}else{if(e.wheel<0){this.scrollDown(name);}}},scrollUp:function(){var scrollY=this.content.getScroll().y;if(scrollY==0){return;}scrollY-=30;if(scrollY<0){scrollY=0;}this.contentScroller.cancel();this.contentScroller.set(0,scrollY);this.update();},scrollDown:function(){var maxY=this.getContentYMax();if(maxY<0){maxY=0;}var scrollY=this.content.getScroll().y;if(scrollY>=maxY){return;}scrollY+=30;if(scrollY>maxY){scrollY=maxY;}this.contentScroller.cancel();this.contentScroller.set(0,scrollY);this.update();},handleDragHandler:function(){var handleY=this.scrollbar.getPosition(this.wrapper).y;var handleYMax=this.getHandleYMax();var contentY=this.getContentYMax()*(handleY/handleYMax);this.content.scrollTo(0,contentY);},getHandleYMax:function(){return this.wrapper.getSize().y-102;},getContentYMax:function(){return this.content.getScrollSize().y-this.content.getSize().y;}});var StreamLoader=new Class({initialize:function(options){this.items=$H();this.timestamps=$H();this.newestTimestamp=0;this.oldestTimestamp=0;this.newestId=0;this.oldestId=0;this.newestTimestampEl=null;this.empty=true;this.createElementFunc=options.createElementFunc;this.alertFunc=options.alertFunc;this.emptyEl=options.emptyEl||null;this.errorEl=options.errorEl||null;this.loadingEl=options.loadingEl||null;this.idField=options.idField||"item_id";this.dateField=options.dateField||"date_created";this.createLoader();},remove:function(id){if(!this.items.has(id)){return;}var el=this.items.get(id);var prev=el.getPrevious();var next=el.getNext();if(prev.hasClass("seperator")&&next.hasClass("seperator")){prev.destroy();}DomUtility.fadeOutDestroy(el);this.items.erase(id);if(this.items.getLength()==0){this.empty=true;this.showEmpty();}},process:function(data){var position=this.findPosition(data);if(!position){return;}this.insertItem(data,position);},showEmpty:function(){if(!$defined(this.emptyEl)){return;}if(this.empty){DomUtility.show(this.emptyEl);}else{DomUtility.hide(this.emptyEl);}},showError:function(){if(!$defined(this.errorEl)){return;}if($defined(this.emptyEl)){DomUtility.hide(this.emptyEl);}if($defined(this.loadingEl)){DomUtility.hide(this.loadingEl);}DomUtility.show(this.errorEl);},hideError:function(){if($defined(this.errorEl)){DomUtility.hide(this.errorEl);}if(this.empty){this.showEmpty();}},showLoading:function(){if(!$defined(this.loadingEl)||!this.empty){return;}if($defined(this.emptyEl)){DomUtility.hide(this.emptyEl);}if($defined(this.errorEl)){DomUtility.hide(this.errorEl);}DomUtility.show(this.loadingEl);},hideLoading:function(){if($defined(this.loadingEl)){DomUtility.hide(this.loadingEl);}if(this.empty){this.showEmpty();}},insertTimestamp:function(timestamp,position){var el=StreamItemUtility.createDateSeperatorItem(timestamp);el.inject(this.loader,position);if(position=="top"){this.newestTimestampEl=el;}},findPosition:function(data){var id=data[this.idField];var timestamp=this.getTimestamp(data[this.dateField]);if(this.empty){this.insertTimestamp(timestamp,"top");this.oldestTimestamp=timestamp;this.newestTimestamp=timestamp;this.newestId=id;this.oldestId=id;this.empty=false;return"top";}else{if(timestamp>=this.newestTimestamp&&id>this.newestId){if(!this.checkTimestampSameDay(this.newestTimestamp,timestamp)){this.insertTimestamp(timestamp,"top");}this.newestTimestamp=timestamp;this.newestId=id;return"top";}else{if(timestamp<=this.oldestTimestamp&&id<this.oldestId){if(!this.checkTimestampSameDay(this.oldestTimestamp,timestamp)){this.insertTimestamp(timestamp,"bottom");}this.oldestTimestamp=timestamp;this.oldestId=id;return"bottom";}else{return false;}}}},checkTimestampSameDay:function(ts1,ts2){var d1=DateUtility.convertFromTimestamp(ts1);var d2=DateUtility.convertFromTimestamp(ts2);return(d1.getDate()==d2.getDate()&&d1.getMonth()==d2.getMonth());},getTimestamp:function(dateValue){if(parseInt(dateValue)==dateValue){return dateValue;}return Date.parse(dateValue)/1000;},insertItem:function(data,position){var el=this.createElementFunc(data);var id=data[this.idField];var date=this.getTimestamp(data[this.dateField]);this.items.set(id,el);this.timestamps.set(id,date);if(position=="top"){el.inject(this.newestTimestampEl,"after");DomUtility.fadeIn(el,1000);}else{el.inject(this.loader,"bottom");}this.empty=false;this.showEmpty();this.hideLoading();this.hideError();if($defined(this.alertFunc)&&pipio.checkTimestamp(date)){this.alertFunc(data);}},createLoader:function(){this.loader=new Element("div",{});if($defined(this.emptyEl)){this.emptyEl.inject(this.loader);}if($defined(this.errorEl)){this.errorEl.inject(this.loader);DomUtility.hide(this.errorEl);}if($defined(this.loadingEl)){this.loadingEl.inject(this.loader);DomUtility.hide(this.loadingEl);}},toElement:function(){return this.loader;}});var Toggle=new Class({initialize:function(on){this.isOn=$defined(on)?on:false;this.toggle=new Element("div",{"class":"toggle"}).adopt(new Element("div",{"class":"handle"}),new Element("div",{"class":"toggle_text on","text":"on"}),new Element("div",{"class":"toggle_text off","text":"off"}));this.toggle.addEvent("click",this.switchToggle.bind(this));this.setOn();},switchToggle:function(){this.isOn=!this.isOn;this.setOn();},on:function(){this.isOn=true;this.setOn();},off:function(){this.isOn=false;this.setOn();},set:function(on){if(on){this.on();}else{this.off();}},setOn:function(){if(this.isOn){this.toggle.addClass("on");this.toggle.removeClass("off");}else{this.toggle.removeClass("on");this.toggle.addClass("off");}},toInt:function(){return(this.isOn)?1:0;},toElement:function(){return this.toggle;}});var Popup=new Class({Extends:Base,initialize:function(options){this.parent();var options=$defined(options)?options:{};this.navs=$H();this.contents=$H();this.contentSize=$defined(options.size)?options.size:{x:400,y:300};this.resizable=$defined(options.resizable)?options.resizable:true;this.dockable=$defined(options.dockable)?options.dockable:true;this.closable=$defined(options.closable)?options.closable:true;this.className=$defined(options.className)?options.className:undefined;this.noHide=$defined(options.noHide)?options.noHide:false;this.onClose=$defined(options.onClose)?options.onClose:undefined;this.hasTabs=false;this.isDocked=false;this.createPopup();},toElement:function(){return this.popup;},addContent:function(contentName,nav,content){if(this.contents.has(contentName)){return;}$(nav).inject(this.nav);$(content).inject(this.content);this.navs.set(contentName,nav);this.contents.set(contentName,content);nav.onClick=this.switchContent.bind(this,[contentName]);content.resizePopup=this.resizePopup.bind(this);if(nav.closable){nav.onClose=this.closeContent.bind(this,[contentName]);content.onClose=this.closeContent.bind(this,[contentName]);}this.checkTabs();this.switchContent(contentName);},closeContent:function(contentName){if(!this.contents.has(contentName)){return;}this.navs.get(contentName).destroy();this.contents.get(contentName).off();this.contents.get(contentName).close();this.navs.erase(contentName);this.contents.erase(contentName);if(this.contents.getLength()==0){this.close();return;}if(contentName==this.currentContent){this.currentContent=null;var last=this.contents.getKeys().pop();this.switchContent(last);}this.checkTabs();this.setTitle();},switchContent:function(contentName){if(!this.contents.has(contentName)){return;}if(this.isDocked){this.undock();}if(contentName==this.currentContent){return;}if($defined(this.currentContent)){this.navs.get(this.currentContent).off();this.contents.get(this.currentContent).off();}this.navs.get(contentName).on();this.contents.get(contentName).on();this.currentContent=contentName;this.setTitle();},setTitle:function(){var nav=this.navs.get(this.currentContent);var icon=new Icon20(nav.iconOptions);var titleText=new Element("div",{"class":"title_text","text":TextUtility.unescapeQuotes(nav.displayName)});this.titleIcon=$(icon).replaces(this.titleIcon);this.titleText=titleText.replaces(this.titleText);},getDockIcon:function(){var nav=this.navs.get(this.currentContent);var icon=new Icon20(nav.iconOptions);var el=new Element("div",{"class":"app_button has_submenu"}).adopt($(icon));el.addEvent("click",this.undock.bind(this));return el;},checkTabs:function(){if(this.contents.getLength()>1){this.popup.addClass("tabbed");this._checkBounds();this.hasTabs=true;}else{this.popup.removeClass("tabbed");this.hasTabs=false;}},resizePopup:function(x,y){var size={x:x,y:y+24};this.popup.setStyle("height",size.y+"px");this.popup.setStyle("width",size.x+"px");this._checkBounds();},reCenter:function(){var size={x:this.popup.getSize().x,y:this.popup.getSize().y};var pos={x:window.getSize().x/2-(size.x/2),y:window.getSize().y/2-(size.y/2)};if(pos.y<0){pos.y=0;}this.popup.setStyles({"top":pos.y+"px","left":pos.x+"px"});},createPopup:function(){this.size={x:this.contentSize.x,y:this.contentSize.y+24};var pos={x:window.getSize().x/2-(this.size.x/2),y:window.getSize().y/2-(this.size.y/2)};if(pos.y<0){pos.y=0;}this.popup=new Element("div",{"class":"popup","styles":{"height":this.size.y+"px","width":this.size.x+"px","top":pos.y+"px","left":pos.x+"px"}});if($defined(this.className)){this.popup.addClass(this.className);}this.title=new Element("div",{"class":"popup_title text12 light"}).inject(this.popup);this.nav=new Element("div",{"class":"app_sub_menu popup_tabs"}).inject(this.popup);this.content=new Element("div",{"class":"popup_content"}).inject(this.popup);this.dragBorder=new Element("div",{"class":"popup_drag","text":"Drag this window to move it"}).inject(this.popup);this.popup.inject("popups");DomUtility.fadeIn(this.popup);this.titleIcon=new Element("div").inject(this.title);this.titleText=new Element("div").inject(this.title);if(this.closable){this.closeButton=new Element("div",{"class":"button_nav right"}).adopt(new Element("div",{"class":"action close"})).inject(this.title);this.closeButton.addEvent("click",this.close.bind(this));}if(this.dockable){this.dockButton=new Element("div",{"class":"button_nav right"}).adopt(new Element("div",{"class":"action dock"})).inject(this.title);this.dockButton.addEvent("click",this.dock.bind(this));}this.drag=this.popup.makeDraggable({handle:this.title,onStart:this._startDrag.bind(this),onComplete:this._stopDrag.bind(this),onCancel:this._stopDrag.bind(this)});if(this.resizable){this.resizeHandle=new Element("div",{"class":"resize"}).inject(this.popup);this.popup.makeResizable({handle:this.resizeHandle,limit:{x:[400,800],y:[300,800]}});}this.popup.addEvent("mousedown",this._select.bind(this));this._select();this._checkBounds();if($defined(this.onCreate)){this.onCreate();}},close:function(){this.contents.each(function(content){content.close();});this.popup.destroy();if($defined(this.onClose)){this.onClose();}delete (this);},dock:function(){this.navs.get(this.currentContent).off();this.contents.get(this.currentContent).off();this.dockButton=new Element("div",{"class":"app_button_wrapper"}).adopt(this.getDockIcon(),this.nav);this.dockButton.inject("dock");DomUtility.fadeOut(this.popup);this.isDocked=true;},undock:function(){this.nav.inject(this.popup);this.dockButton.destroy();DomUtility.fadeIn(this.popup);this.navs.get(this.currentContent).on();this.contents.get(this.currentContent).on();this.isDocked=false;},_select:function(){this.popup.setStyle("z-index",DomUtility.getZ("popup"));},_startDrag:function(){if(this.noHide){return;}DomUtility.hide(this.nav);DomUtility.show(this.dragBorder);this.contents.get(this.currentContent).off();},_stopDrag:function(){if(!this.noHide){DomUtility.hide(this.dragBorder);DomUtility.show(this.nav);this.nav.set("style","");this.contents.get(this.currentContent).on();}this._checkBounds();},_checkBounds:function(){var pos=this.popup.getPosition();if(pos.x+this.popup.getSize().x>window.getSize().x){this.popup.setStyle("left",window.getSize().x-this.popup.getSize().x);}if(pos.y+this.popup.getSize().y>window.getSize().y){this.popup.setStyle("top",window.getSize().y-this.popup.getSize().y);}pos=this.popup.getPosition();if(pos.x<0){this.popup.setStyle("left",0);}if(pos.y<0){this.popup.setStyle("top",0);}}});var PopupContent=new Class({Extends:Base,init:function(options){if(!$defined(options)){options={};}if($defined(this.onBeforeInit)){options=this.onBeforeInit(options);}this.isOn=false;this.destroy=$defined(options.destroy)?options.destroy:true;this.createContent();if($defined(this.onInit)){this.onInit();}},on:function(){Logger().log("turning on content");DomUtility.show(this.content);if($defined(this.onShow)){this.onShow();}this.isOn=true;},off:function(){if($defined(this.onHide)){this.onHide();}DomUtility.hide(this.content);this.isOn=false;},close:function(destroy){if(this.destroy||destroy){this.content.destroy();}else{this.content.dispose();}},closeContent:function(){if($defined(this.onClose)){this.onClose();}},createContent:function(){this.content=new Element("div",{"class":this.className});this.off();},toElement:function(){return this.content;}});var AlertPopupContent=new Class({Extends:PopupContent,onBeforeInit:function(options){this.alertMessage=options.alertMessage;return options;},onInit:function(){new Element("div",{"class":"text_section centered light","text":TextUtility.unescape(this.alertMessage)}).inject(this.content);this.actionButton=new ButtonMedium({displayName:"Close",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.closeContent.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.actionButton)).inject(this.content);}});var ConfirmPopupContent=new Class({Extends:PopupContent,onBeforeInit:function(options){this.confirmMessage=options.confirmMessage;this.confirmFunc=options.confirmFunc;return options;},onInit:function(){new Element("div",{"class":"text_section centered light","text":TextUtility.unescape(this.confirmMessage)}).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Confirm",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.confirmFunc);$(this.actionButton).addEvent("click",this.progressClose.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.actionButton),$(this.closeButton)).inject(this.content);},progressClose:function(){this.actionButton.showProgress();this.closeContent.delay(1500,this);}});var RoomStatusBox=new Class({Extends:Base,EventHandlers:["roomMembershipUpdated","roomStatusUpdated","roomStatusCleared"],init:function(room){this.room=room;this.defaultStatus="has no current status";this.canPost=(this.room.status==1);this.createStatusBox();},createStatusBox:function(){this.box=ItemUtility.createPostBubble("post status_message haspic");ItemUtility.createProfilePic(this.room,32).inject(this.box);var buttonText="Write in "+this.room.room_name;this.writeButton=new Element("div",{"class":"button","text":TextUtility.unescape(buttonText)}).inject(this.box);this.writeButton.addEvent("click",this.fireEvent.bind(this,["roomShareBoxShow",this.room]));this.setPostButton();this.content=new Element("div",{"class":"post_content"}).inject(this.box);var header=new Element("div",{"class":"header"}).inject(this.content);StreamItemUtility.createStreamUserAction("status dark").inject(header);var creator=new Element("span",{"class":"user_name clickable","text":TextUtility.unescapeQuotes(this.room.room_name)}).inject(header);creator.addEvent("click",this.fireEvent.bind(this,["showRoom",this.room]));this.statusText=new Element("span",{"class":"status"}).inject(header);this.editButton=new Element("span",{"class":"edit_link","text":"update"});this.editButton.addEvent("click",this.fireEvent.bind(this,["showRoomStatusUpdatePopup",this.room]));this.clearButton=new Element("span",{"class":"edit_link","text":"clear"});this.clearButton.addEvent("click",this.clearStatus.bind(this));this.editSection=new Element("span").adopt($(this.editButton),$(this.clearButton)).inject(header);this.setEditButton();this.footer=StreamItemUtility.createStatusBoxFooter(this.room.status_message).inject(this.content);this.updateStatus();},roomMembershipUpdated:function(data){if(!$defined(data.username)||data.username!=this.room.username){return;}this.room.status=data.status;this.canPost=(this.room.status==1);this.setPostButton();},setEditButton:function(){if(this.canPost){DomUtility.show(this.editSection,"inline");}else{DomUtility.hide(this.editSection);}},setPostButton:function(){if(this.canPost){DomUtility.show(this.writeButton);}else{DomUtility.hide(this.writeButton);}},updateStatus:function(){this.isEmpty=(!$defined(this.room.status_message)||this.room.status_message.status.trim()=="");if(this.isEmpty){this.statusText.addClass("empty");this.statusText.set("text"," "+TextUtility.unescape(this.defaultStatus));DomUtility.hide(this.clearButton);}else{this.statusText.removeClass("empty");this.statusText.set("text"," "+TextUtility.unescape(this.room.status_message.status.trim()));DomUtility.show(this.clearButton,"inline");}this.footer.destroy();this.footer=StreamItemUtility.createStatusBoxFooter(this.room.status_message).inject(this.content);},clearStatus:function(){var params={username:this.room.username,body:"",res:this.getSession()};this.call("pipio","publish_roomstatus",params);this.roomStatusCleared({username:this.room.username});},roomStatusUpdated:function(data){if(!$defined(data.username)||data.username!=this.room.username){return;}this.room=this.getRoom(data.username);this.updateStatus();},roomStatusCleared:function(data){if(!$defined(data.username)||data.username!=this.room.username){return;}this.room.status_message.status="";this.room.status_message.creator=undefined;this.room.status_message.date_created=undefined;this.room.status_message.location=undefined;this.updateStatus();},toElement:function(){return this.box;}});var StatusBox=new Class({Extends:Base,EventHandlers:["userStatusUpdated","userStatusCleared","contactAdded","contactDeleted"],init:function(user){this.user=user;this.isSelf=this.user.user_id==this.getPrivateUser().user_id;this.defaultStatus="has no current status";this.canPost=$defined(this.getContact(this.user.username))||this.isSelf;this.createStatusBox();},createStatusBox:function(){this.box=ItemUtility.createPostBubble("post status_message haspic");ItemUtility.createProfilePic(this.user,32).inject(this.box);var buttonText=this.isSelf?"Write in Your Stream":"Write in "+this.user.first_name+"'s Stream";this.writeButton=new Element("div",{"class":"button","text":TextUtility.unescape(buttonText)}).inject(this.box);this.writeButton.addEvent("click",this.fireEvent.bind(this,["shareBoxShow",this.user]));this.setPostButton();this.content=new Element("div",{"class":"post_content"}).inject(this.box);var header=new Element("div",{"class":"header"}).inject(this.content);StreamItemUtility.createStreamUserAction("status dark").inject(header);var creator=new Element("span",{"class":"user_name clickable","text":TextUtility.unescapeQuotes(this.user.fullname)}).inject(header);creator.addEvent("click",this.fireEvent.bind(this,["showUser",this.user]));this.status=new Element("span",{"class":"status"}).inject(header);if(this.isSelf){this.editButton=new Element("span",{"class":"edit_link","text":"update"}).inject(header);this.editButton.addEvent("click",this.fireEvent.bind(this,["showStatusUpdatePopup"]));this.clearButton=new Element("span",{"class":"edit_link","text":"clear"}).inject(header);this.clearButton.addEvent("click",this.clearStatus.bind(this));}this.footer=StreamItemUtility.createStatusBoxFooter(this.user.status_message).inject(this.content);this.updateStatus();},contactAdded:function(user){if(this.user.username!=user.username){return;}this.canPost=true;this.setPostButton();},contactDeleted:function(username){if(this.user.username!=username){return;}this.canPost=false;this.setPostButton();},setPostButton:function(){if(this.canPost){DomUtility.show(this.writeButton);}else{DomUtility.hide(this.writeButton);}},updateStatus:function(){this.isEmpty=this.user.status_message.status.trim()=="";if(this.isEmpty){this.status.addClass("empty");this.status.set("text"," "+TextUtility.unescape(this.defaultStatus));if(this.isSelf){DomUtility.hide(this.clearButton);}}else{this.status.removeClass("empty");this.status.set("text"," "+TextUtility.unescape(this.user.status_message.status.trim()));if(this.isSelf){DomUtility.show(this.clearButton,"inline");}}this.footer.destroy();this.footer=StreamItemUtility.createStatusBoxFooter(this.user.status_message).inject(this.content);},clearStatus:function(){var params={body:"",res:this.getSession()};this.call("pipio","publish_status",params);this.userStatusCleared({username:this.user.username});},userStatusUpdated:function(data){if(!$defined(data.username)||data.username!=this.user.username){return;}this.user.status_message=data.status_message;this.updateStatus();},userStatusCleared:function(data){if(!$defined(data.username)||data.username!=this.user.username){return;}this.user.status_message.status="";this.user.status_message.date_created=undefined;this.user.status_message.location=undefined;this.updateStatus();},toElement:function(){return this.box;}});var AttachmentUtility={parseLinkAttachment:function(attachment){if($defined(attachment.processed)){return attachment;}attachment.processed=true;attachment.is_video=false;attachment.is_photo=false;if(attachment.url.contains("youtube.com")){var youtubeId=attachment.url.replace(/^[^v]+v.(.{11}).*/,"$1");if(youtubeId!=""){attachment.is_video=true;attachment.video_type="youtube";attachment.youtubeId=youtubeId;return attachment;}}else{if(attachment.url.contains("collegehumor.com/video:")){var vimeoId=attachment.url.split("collegehumor.com/video:")[1];if(vimeoId!=""){attachment.is_video=true;attachment.video_type="ch";attachment.vimeoId=vimeoId;return attachment;}}else{if(attachment.url.contains("vimeo.com/")){var vimeoId=attachment.url.split("vimeo.com/")[1];if(vimeoId!=""){attachment.is_video=true;attachment.video_type="vimeo";attachment.vimeoId=vimeoId;return attachment;}}else{if(attachment.url.contains("hulu.com")){attachment.is_video=true;attachment.video_type="hulu";return attachment;}else{if(attachment.url.contains("break.com")){attachment.is_video=true;attachment.video_type="break";return attachment;}else{if(DataUtility.validatePhotoFile(attachment.url)){attachment.is_photo=true;return attachment;}}}}}}return attachment;},parsePhotoAttachment:function(attachment){if($defined(attachment.processed)){return attachment;}attachment.processed=true;attachment.is_photo=true;return attachment;}};var DataUtility={photoExtensions:[".jpeg",".jpg",".gif",".png",".bmp"],validateUrl:function(url){var v=new RegExp();v.compile("^([A-Za-z]+://[A-Za-z0-9-_]+.[A-Za-z0-9-_%&?/.=,+~!:@()]+(#[A-Za-z0-9-_%&?/.=,+~!:@()]+)?)$");return v.test(url);},validatePhotoFile:function(filename){if(filename.substring(filename.length-5).toLowerCase()==".jpeg"){return true;}var ext=filename.substring(filename.length-4).toLowerCase();return DataUtility.photoExtensions.contains(ext);},getGeoString:function(location){if(!$defined(location)){return false;}var locationString=false;var locality=DataUtility.getGeoLocality(location);if(locality){locationString=locality;}var label=DataUtility.getGeoLabel(location);if(label){locationString=label+", "+locality;}return locationString;},getGeoLabel:function(location){if($defined(location.label)&&location.label!=""){return location.label;}else{return false;}},getGeoLocality:function(location){var local="";if(location.country_code=="US"){if($defined(location.region)&&$defined(location.city)&&location.region!=""&&location.city!=""){local=location.city+", "+location.region;}else{return false;}}else{if($defined(location.city)&&location.city!=""){local=location.city+", "+location.country;}else{if(location.city==""&&$defined(location.region)&&location.region!=""){local=location.region+", "+location.country;}else{if(!$defined(location.city)&&$defined(location.country)){local=location.country;}else{return false;}}}}return local;},getPipioUrl:function(url,hash){if($defined(hash)){return"/"+hash;}else{return url;}},getFacebookPhotoUrl:function(url){return url.replace("_s.jpg","_n.jpg");},sortUsers:function(a,b){return a.last_name.toLowerCase()<b.last_name.toLowerCase();},getCookie:function(c_name){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1){c_end=document.cookie.length;}return unescape(document.cookie.substring(c_start,c_end));}}return undefined;},getFileUrl:function(hash,file_id,filename){var serverId=file_id%16;return"http://files"+serverId.toString(16)+".pip.io/"+hash.substring(0,2)+"/"+hash.substring(2,3)+"/"+hash.substring(3,5)+"/"+hash.substring(5,8)+"/"+file_id+"/"+filename;}};var DateUtility={convertFromGMT:function(date){var offsetMils=date.getTimezoneOffset()*60*1000;date.setTime(date.getTime()-offsetMils);return date;},getTimestamp:function(ts,format){if(!$defined(format)){format="%B %D, %I:%M%p";}if(new Date().getTime()-ts.getTime()>86400000){return ts.format(format);}else{return ts.timeAgoInWords();}},convertFromTimestamp:function(ts){var date=new Date();date.setTime(ts*1000);return date;}};var DomUtility={toggle:function(id){if($(id).getStyle("display")=="none"){DomUtility.show(id);}else{DomUtility.hide(id);}},hide:function(id){if($(id)!=null){$(id).setStyle("display","none");}},show:function(id,display){if(!$defined(display)){display="block";}if($(id)!=null){$(id).setStyle("display",display);}},expand:function(id){var el=$(id);el.get("tween",{duration:150}).start("height",el.getScrollSize().y).chain(function(){el.setStyle("height","auto");});},collapse:function(id){var el=$(id);el.setStyle("height",el.getSize().y);el.get("tween",{duration:150}).start("height",0);},setHeight:function(id,h){var el=$(id);el.get("tween",{duration:150}).start("height",h);},expandFade:function(id,h){var el=$(id);el.setStyle("opacity",0);el.get("tween",{duration:150}).start("height",h).chain(function(){el.get("tween",{duration:800}).start("opacity",1);});},collapseFade:function(id){var el=$(id);el.get("tween",{duration:800}).start("opacity",0).chain(function(){el.get("tween",{duration:150}).start("height",0);});},fadeOut:function(id,destroy){var el=$(id);el.setStyle("opacity",1);el.get("tween",{duration:500}).start("opacity",0).chain(function(){if(destroy){el.destroy();}});},fadeOutDestroy:function(id){DomUtility.fadeOut(id,true);},fadeIn:function(id,duration){var el=$(id);duration=duration||500;el.setStyle("opacity",0);el.get("tween",{duration:duration}).start("opacity",1);},getZ:function(name){var zName=name+"Z";if(!$defined(window[zName])){window[zName]=200;}window[zName]++;return window[zName];},textareaAutoSize:function(el,min){min=$defined(min)?min:16;el=$(el);if(el.value.trim().length<30&&el.getSize().y>min){el.setStyle("height",min);return true;}if(el.getScrollSize().y>min&&el.getScrollSize().y>el.getSize().y){el.setStyle("height",el.getScrollSize().y);return true;}return false;}};var ItemUtility={createProfilePic:function(user,size){var picSize=(size=="16a")?16:size;if($defined(user.fullname)){var el=new Element("div",{"class":"shadowed profile_pic_wrapper_"+size}).adopt(new Element("img",{"class":"profile_pic profile_pic_"+picSize+"_"+user.username,"src":user["profile_pic_"+picSize],"title":TextUtility.unescape(user.fullname)}),new Element("div",{"class":"online_status online_status_"+user.username,"title":TextUtility.unescape(user.fullname)}));return el;}else{if($defined(user.room_name)){var el=new Element("div",{"class":"shadowed profile_pic_wrapper_"+size}).adopt(new Element("img",{"class":"profile_pic profile_pic_"+picSize+"_"+user.username,"src":user["profile_pic_"+picSize],"title":TextUtility.unescape(user.room_name)}),new Element("div",{"class":"online_status online_status_"+user.username,"title":TextUtility.unescape(user.room_name)}));return el;}}},createItemPic:function(url,size){var picSize=$defined(size)?size:32;var el=new Element("div",{"class":"shadowed profile_pic_wrapper_"+picSize}).adopt(new Element("img",{"class":"profile_pic profile_pic_"+picSize,"src":url}),new Element("div",{"class":"online_status"}));return el;},createChatPostItem:function(msg,user){var el=ItemUtility.createPostBubble("post chat haspic");if(!msg.outbound){user=msg.target;}ItemUtility.createProfilePic(user,20).inject(el);new Element("div",{"class":"post_content"}).adopt(new Element("div",{"class":"header","html":TextUtility.replaceUrls(TextUtility.cleanText(msg.msg))})).inject(el);return el;},createChatPostHeading:function(user,date){var el=new Element("div",{"class":"post chat heading"});var ts=$defined(date)?new Element("span",{"class":"timestamp","text":DateUtility.getTimestamp(date,"%B %D, %I:%M%p"),"ts":date,"ts_format":"%B %D, %I:%M%p"}):new Element("span");new Element("div",{"class":"post_content"}).adopt(new Element("div",{"class":"header"}).adopt(new Element("span",{"class":"user_name","text":TextUtility.unescapeQuotes(user.fullname)}),ts)).inject(el);return el;},createChatTypingHeading:function(user){var el=new Element("div",{"class":"post chat heading"});new Element("div",{"class":"post_content"}).adopt(new Element("div",{"class":"header"}).adopt(new Element("span",{"class":"user_name","text":TextUtility.unescapeQuotes(user.fullname)}),new Element("span",{"class":"status_text","text":"is typing"}))).inject(el);return el;},createPostBubble:function(className,nocorner){if(nocorner){var el=new Element("div",{"class":className}).adopt(new Element("div",{"class":"bubble"}).adopt(new Element("div",{"class":"bubble_inner"})));}else{var el=new Element("div",{"class":className}).adopt(new Element("div",{"class":"bubble"}).adopt(new Element("div",{"class":"bubble_inner"}),new Element("div",{"class":"corner"})));}return el;}};var Logger=(function(){var LoggerSingleton=new Class({initialize:function(){this._log=new Log();this._log.enableLog();},log:function(val){this._log.log(val);}});var singleton;return function(){return singleton?singleton:singleton=new LoggerSingleton();};})();var TextUtility={unescapeQuotes:function(val){if(!$defined(val)){return"";}val=val.toString();val=val.split("\\\\").join("\\");val=val.split("\\'").join("'");val=val.split('\\"').join('"');return val;},unescapeHtml:function(val){if(!$defined(val)){return"";}val=val.toString();val=val.split("&lt;").join("<");val=val.split("&gt;").join(">");val=val.split("&amp;").join("&");return val;},unescape:function(val){return TextUtility.unescapeQuotes(TextUtility.unescapeHtml(val));},escapeHtml:function(val){if(!$defined(val)){return"";}val=val.toString();val=val.split("<").join("&lt;");val=val.split(">").join("&gt;");return val;},stripHtml:function(val){if(!$defined(val)){return"";}val=val.toString();var re=/<\S[^><]*>/g;val.replace(re,"");return val;},cleanText:function(val){if(!$defined(val)){return"";}val=val.toString();val=TextUtility.unescapeQuotes(val);val=TextUtility.escapeHtml(val);return val;},pluralText:function(count,singular,plural){if(count==1){return count+" "+singular;}else{return count+" "+plural;}},replaceUrls:function(val){if(!$defined(val)){return"";}return val.replace(/([A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_%&\?\/.=,+~!:@()]+(#[A-Za-z0-9-_%&\?\/.=,+~!:@()]+)?)/g,'<a href="$1" target="_blank">$1</a>');},convertNewLine:function(val){if(!$defined(val)){return"";}val=val.toString();val=val.split("\n").join("<br/>");return val;}};String.format=function(text){if(arguments.length<=1){return text;}var tokenCount=arguments.length-2;for(var token=0;token<=tokenCount;token++){text=text.replace(new RegExp("\\{"+token+"\\}","gi"),arguments[token+1]);}return text;};var UserUtility={profilePicVersionSet:function(user_id,ver){if(!$defined(window.profilePicVer)){window.profilePicVer=new Hash();}window.profilePicVer.set(user_id,ver);},profilePicVersionGet:function(user_id){if(!$defined(window.profilePicVer)){return 0;}if(!window.profilePicVer.has(user_id)){return 0;}return window.profilePicVer.get(user_id);},getProfilePic:function(hash,user_id,size){if(!$defined(size)){size=26;}var serverId=user_id%16;var version=UserUtility.profilePicVersionGet(user_id);return"http://profilepics"+serverId.toString(16)+".pip.io/"+hash.substring(0,2)+"/"+hash.substring(2,3)+"/"+hash.substring(3,5)+"/"+user_id+"/"+size+".jpg?"+version;},processSource:function(source){if($defined(source.user_id)){return UserUtility.processUser(source);}else{if($defined(source.room_id)){return UserUtility.processRoom(source);}}},processRoom:function(room){var proom={};proom.username=room.username.toLowerCase();if($defined(room.about)){pipio.profileUpdated({username:room.username,about:room.about});}if($defined(pipio.getRoom(proom.username))){var existing=pipio.getRoom(proom.username);if($defined(room.about)){pipio.profileUpdated({username:proom.username,about:room.about});}if($defined(room.status_message)&&$defined(room.status_message.status)){if($defined(room.status_message.status)&&existing.status_message.status!=room.status_message.status){pipio.dispatchEvent("roomStatusUpdated",{username:room.username,status_message:room.status_message});existing.status_message=room.status_message;}}if($defined(room.is_public)){existing.is_public=parseInt(room.is_public);}if($defined(room.status)){existing.status=parseInt(room.status);}if($defined(room.subscribed)){existing.status=parseInt(room.subscribed);}return existing;}proom.status_message=$defined(room.status_message)?room.status_message:{status:""};proom.room_id=room.room_id;proom.room_name=room.room_name;proom.room_hash=room.room_hash;proom.date_created=room.date_created;proom.creator_id=$defined(room.creator_id)?room.creator_id:0;proom.creator=$defined(room.creator)?UserUtility.processUser(room.creator):null;proom.is_public=parseInt(room.is_public);proom.status=$defined(room.status)?parseInt(room.status):0;proom.subscribed=$defined(room.subscribed)?parseInt(room.subscribed):0;proom.about=$defined(room.about)?room.about:null;proom.profile_pic_16=UserUtility.getProfilePic(room.room_hash,room.room_id,16);proom.profile_pic_20=UserUtility.getProfilePic(room.room_hash,room.room_id,20);proom.profile_pic_26=UserUtility.getProfilePic(room.room_hash,room.room_id,26);proom.profile_pic_32=UserUtility.getProfilePic(room.room_hash,room.room_id,32);proom.profile_pic_42=UserUtility.getProfilePic(room.room_hash,room.room_id,42);proom.profile_pic_60=UserUtility.getProfilePic(room.room_hash,room.room_id,60);proom.profile_pic_100=UserUtility.getProfilePic(room.room_hash,room.room_id,100);proom.profile_pic_200=UserUtility.getProfilePic(room.room_hash,room.room_id,200);pipio.cacheRoom(proom);return proom;},processUser:function(user){var puser={};if(!$defined(user)||!$defined(user.username)){return;}puser.username=user.username.toLowerCase();if($defined(user.current_location)&&user.current_location!=""){pipio.locationUpdated({username:puser.username,location_enabled:$defined(user.location_enabled)?user.location_enabled:0,location:user.current_location});}if($defined(user.about)){pipio.profileUpdated({username:puser.username,about:user.about});}if($defined(pipio.getUser(puser.username))){var existing=pipio.getUser(puser.username);if($defined(user.status_message)&&$defined(user.status_message.status)){if($defined(user.status_message.status)&&existing.status_message.status!=user.status_message.status){pipio.dispatchEvent("userStatusUpdated",{username:user.username,status_message:user.status_message});existing.status_message=user.status_message;}}if($defined(user.location_enabled)){existing.location_enabled=user.location_enabled;}if($defined(user.is_public)){existing.is_public=user.is_public;}return existing;}puser.status_message=$defined(user.status_message)?user.status_message:{status:""};puser.first_name=user.first_name;puser.last_name=user.last_name;puser.fullname=user.first_name+" "+user.last_name;puser.user_hash=user.user_hash;puser.user_id=user.user_id;puser.group_id=$defined(user.group_id)?user.group_id:0;puser.about=$defined(user.about)?user.about:null;puser.is_public=user.is_public;puser.location_enabled=$defined(user.location_enabled)?user.location_enabled:0;puser.online=false;puser.show="";puser.video=false;puser.profile_pic_16=UserUtility.getProfilePic(user.user_hash,user.user_id,16);puser.profile_pic_20=UserUtility.getProfilePic(user.user_hash,user.user_id,20);puser.profile_pic_26=UserUtility.getProfilePic(user.user_hash,user.user_id,26);puser.profile_pic_32=UserUtility.getProfilePic(user.user_hash,user.user_id,32);puser.profile_pic_42=UserUtility.getProfilePic(user.user_hash,user.user_id,42);puser.profile_pic_60=UserUtility.getProfilePic(user.user_hash,user.user_id,60);puser.profile_pic_100=UserUtility.getProfilePic(user.user_hash,user.user_id,100);puser.profile_pic_200=UserUtility.getProfilePic(user.user_hash,user.user_id,200);pipio.cacheUser(puser);return puser;},updateStatusMessage:function(user,status_msg){var msgClass=".status_msg_"+user.username;$$(msgClass).each(function(el){el.set("text",TextUtility.unescapeQuotes(status_msg));});},getInstalledApps:function(){var apps=new Array();if($defined(user_data)){user_data.apps.each(function(app){apps[app.app_id]=app.external_user_id;},this);}return apps;}};var AlbumViewer=new Class({Extends:Base,EventHandlers:["userSwitched","viewAlbum"],init:function(){this.photos=$H();},userSwitched:function(){if(this.isLoggedIn()){this.userLoggedIn();}else{this.userLoggedOut();}},userLoggedIn:function(){},userLoggedOut:function(){},viewAlbum:function(album,photo,aid){var thumbSize=75;var w=600;var h=450;w+=2;h+=thumbSize+34;var albumPopup=new Popup({size:{x:w,y:h},resizable:false,dockable:true,closable:true,className:"albumViewer"});var nav=new Nav({iconOptions:{iconName:"photo"},displayName:album.displayName,closable:true});var content=new AlbumPopupContent({album:album,photo:photo,aid:aid,width:w,height:h,thumbSize:thumbSize});albumPopup.addContent("album",nav,content);}});var AlbumPopupContent=new Class({Extends:PopupContent,EventHandlers:["albumPicView"],onBeforeInit:function(options){this.album=options.album;this.curPhoto=options.photo;this.aid=options.aid;this.width=options.width;this.height=options.height;this.thumbSize=options.thumbSize;this.imageEls=$H();return options;},onInit:function(){var img=new Asset.image(this.curPhoto.src,{title:this.curPhoto.caption,onload:(function(image){this.picLoaded(image,this.curPhoto);}).bind(this)});this.nextImage;this.nextId;},picLoaded:function(image,photo){this.curImage=this.photoResize(image);var imgArea=new Element("div",{"class":"albumImage"}).adopt(this.curImage);imgArea.inject(this.content);this.nextLayer=new Element("div",{"class":"nav_image next nextLayer"});this.prevLayer=new Element("div",{"class":"nav_image previous prevLayer"});this.nextLayer.inject(imgArea);this.prevLayer.inject(imgArea);var nextL=this.nextLayer;var prevL=this.prevLayer;imgArea.addEvent("mouseover",function(){DomUtility.show(nextL);},this);imgArea.addEvent("mouseover",function(){DomUtility.show(prevL);},this);imgArea.addEvent("mouseout",function(){DomUtility.hide(nextL);},this);imgArea.addEvent("mouseout",function(){DomUtility.hide(prevL);},this);this.addNextPrevEvents(photo.id,this.aid);this.captionBox=new Element("div",{"class":"photoCaption","text":photo.caption}).inject(this.content);if($defined(photo.caption)&&photo.caption!=""){DomUtility.show(this.captionBox);}else{DomUtility.hide(this.captionBox);}var imgBarWidth=(this.thumbSize+10)*this.album.getSize();this.imageBarOuter=new Element("div",{"class":"imageBarOuter","styles":{"width":this.w-2}});this.imageBarOuter.inject(this.content);var imageBar=new Element("div",{"class":"imageBar","styles":{"width":imgBarWidth}});imageBar.inject(this.imageBarOuter);var curIndex;var photos=this.album.getAllPhotos();var pic,img,imgContainer;for(var i=0;i<this.album.getSize();i++){pic=photos[i];img=new Element("img",{"src":pic.thumb,"alt":pic.caption,"title":pic.caption});imgContainer=new Element("div",{"class":"imageInBar"}).adopt(img);imgContainer.inject(imageBar);this.imageEls.set(pic.id,imgContainer);if(pic.id==photo.id){imgContainer.addClass("photoHightlight");this.oldPic=pic;}imgContainer.addEvent("click",pipio.dispatchEvent.bind(this,["albumPicView",pic.id,this.aid]));}this.scrollToPic(photo.id);this.loadNextPic(photo.pid);},photoResize:function(image){var w=parseInt(image.get("width"));var h=parseInt(image.get("height"));var ratio=1;if(h>w){if(h>450){ratio=450/h;h=450;w=ratio*w;}}else{if(w>600){ratio=600/w;w=600;h=ratio*h;}}image.setStyle("height",h);image.setStyle("width",w);return image;},addNextPrevEvents:function(id,aid){var photos=this.album.getNextPrevPhoto(id);$(this.nextLayer).addEvent("click",pipio.dispatchEvent.bind(this,["albumPicView",photos.next.id,aid]));$(this.prevLayer).addEvent("click",pipio.dispatchEvent.bind(this,["albumPicView",photos.prev.id,aid]));},scrollToPic:function(id){var width=600;var index=this.album.getIndex(id);var x=index*(this.thumbSize+10);x=x-(600/2)+(this.thumbSize/2)+4;if(x<0){x=0;}var meh=this.imageEls.get(id).scrollLeft;$(this.imageBarOuter).scrollTo(x,0);},loadNextPic:function(pid){var nextPhoto=this.album.nextPhoto(pid);this.nextId=nextPhoto.id;var img=new Asset.image(nextPhoto.src,{onload:(function(image){this.nextImage=image;}).bind(this)});},albumPicView:function(pid){if($defined(pid[1])&&pid[1]==this.aid){pid=pid[0];if(pid==this.nextId){this.albumPicViewLoaded(this.nextImage,pid,this.aid);}else{var photo=this.album.getPhoto(pid);var img=new Asset.image(photo.src,{onload:(function(image){this.albumPicViewLoaded(image,pid,this.aid);}).bind(this)});}}},albumPicViewLoaded:function(image,pid,aid){var photo=this.album.getPhoto(pid);image=this.photoResize(image);var im=image.replaces($(this.curImage));this.curImage=im;this.captionBox.set("text",photo.caption);if($defined(photo.caption)&&photo.caption!=""){DomUtility.show(this.captionBox);}else{DomUtility.hide(this.captionBox);}this.nextLayer.removeEvents("click");this.prevLayer.removeEvents("click");this.addNextPrevEvents(pid,aid);this.imageEls.get(this.oldPic.id).removeClass("photoHighlight");this.imageEls.get(pid).addClass("photoHighlight");this.scrollToPic(pid);this.loadNextPic(pid);}});var Background=new Class({Extends:Base,EventHandlers:["userLoggedIn","userLoggedOut"],init:function(){this.clouds=new Array();this.stars=new Array();this.container=$("background");this.getBounds();this.setupSky();this.sunrise=6;this.sunset=19;this.moonrise=21;this.moonset=4;this.maxStars=30;this.starsStart=19;this.starsEnd=4;for(var i=0;i<6;i++){var cloud=this.createCloud().inject(this.container);this.clouds.push(cloud);}this.run();},setupSky:function(){this.sky=new Element("div",{"class":"sky"}).inject(this.container);this.sun=new Element("div",{"class":"celestial sun"}).inject(this.container);this.dusk=new Element("div",{"class":"sky_dusk"}).inject(this.container);this.moon=new Element("div",{"class":"celestial moon"}).inject(this.container);this.moveSky();},run:function(){this.step();this.anim=this.step.periodical(20000,this);},stop:function(){$clear(this.anim);},step:function(){this.moveClouds();this.moveSky();},getBounds:function(){this.xMin=-100;this.xMax=this.container.getSize().x;this.yMin=0;this.yMax=this.container.getSize().y-100;},userLoggedIn:function(){},userLoggedOut:function(){},setStars:function(){var time=this.getTime();if((time>this.starsStart||time<this.starsEnd)&&this.stars.length<this.maxStars){var star=this.createStar();star.inject(this.container);star.setStyles({"top":$random(1,this.yMax),"left":$random(1,this.xMax)});this.stars.push(star);}else{if(((time>this.starsEnd&&time<this.starsStart)&&this.stars.length>0)||this.stars.length==this.maxStars){this.removeStar();}}},removeStar:function(){if(this.stars.length==0){return;}var i=$random(0,this.stars.length-1);this.stars[i].destroy();this.stars.splice(i,1);},moveClouds:function(){var containerSize=this.container.getSize();this.clouds.each(function(item){var pos=item.getPosition();var speed=$random(2,6);if(pos.x+speed>this.xMax){item.setStyle("left",this.xMin);}else{item.get("tween",{duration:1000}).start("left",pos.x+speed);}},this);},createStar:function(){var star=new Element("div",{"class":"celestial stars star"+$random(1,4)});return star;},createCloud:function(){var cloud=new Element("div",{"class":"cloud cloud"+$random(1,6)});cloud.setStyle("left",$random(this.xMin,this.xMax));cloud.setStyle("top",$random(this.yMin,this.yMax));return cloud;},moveSky:function(){this.sky.setStyle("top",this.getSkyPosition());this.dusk.setStyle("bottom",this.getDuskPosition());this.moveSun();this.moveMoon();this.setStars();},moveSun:function(){var pos=this.getSunPosition();this.sun.setStyles({"top":pos.y+"%","left":pos.x+"%"});},moveMoon:function(){var pos=this.getMoonPosition();this.moon.setStyles({"top":pos.y+"%","left":pos.x+"%"});},getSkyPosition:function(){var skyMax=3000-this.container.getSize().y;var time=this.getTime();if(time>=1){time+=23;}else{time-=1;}return -Math.sin(((time)/24)*Math.PI)*Math.sin(((time)/24)*Math.PI)*skyMax;},getGroundOpacity:function(){var opacityMax=80;var time=this.getTime();if(time>=1){time+=23;}else{time-=1;}var dark=(1-Math.sin(((time)/24)*Math.PI))*opacityMax;return dark;},getDuskPosition:function(){var time=this.getTime();if(time>this.sunset-1&&time<this.sunset+1){time=(time-(this.sunset-1))/2;return -183+Math.sin((time)*Math.PI)*183;}else{return -183;}},getSunPosition:function(){var pos={x:90,y:100};var time=this.getTime();if(time>this.sunrise&&time<this.sunset){time=(time-this.sunrise)/(this.sunset-this.sunrise);pos.y=100-Math.sin(time*Math.PI)*100;pos.x=90-time*100;}return pos;},getMoonPosition:function(){var pos={x:90,y:100};var time=this.getTime();if(time<this.moonset){time+=24;}if(time>this.moonrise&&time<this.moonset+24){time=Math.abs((time-this.moonrise)/((this.moonset+24)-this.moonrise));pos.y=100-Math.sin(time*Math.PI)*100;pos.x=90-time*100;}return pos;},getTime:function(){var date=new Date();return date.getHours()+date.getMinutes()/60;}});var Chat=new Class({Extends:Base,EventHandlers:["userSwitched","chatStart","chatMsgReceived","chatTypingReceived"],init:function(){this.contents=$H();this.lastMsg=$H();},userSwitched:function(){if(this.isLoggedIn()){this.userLoggedIn();}else{this.userLoggedOut();}},userLoggedIn:function(){},userLoggedOut:function(){this.resetChatPopup();this.init();},chatStart:function(username,noSwitch){if(!$defined(this.popup)){this.createChatPopup();}var user=this.getContact(username);var content=this.addChatConvo(user);if(!$defined(noSwitch)){this.popup.switchContent(username);}return content;},chatTypingReceived:function(username){if(!this.contents.has(username)){return;}this.contents.get(username).showTyping();},chatMsgReceived:function(msg){var user=msg.target;var content=this.chatStart(user.username,true);if(!this.lastMsg.has(user.username)||this.lastMsg.get(user.username).outbound!=msg.outbound||new Date().getTime()-this.lastMsg.get(user.username).timestamp.getTime()>300000){var ts=msg.timestamp;if(this.lastMsg.has(user.username)&&msg.timestamp.getTime()-this.lastMsg.get(user.username).timestamp.getTime()<300000){ts=null;}var heading=(msg.outbound)?ItemUtility.createChatPostHeading(this.getPrivateUser(),ts):ItemUtility.createChatPostHeading(user,ts);content.insertChatItem(heading);}this.lastMsg.set(user.username,msg);var item=ItemUtility.createChatPostItem(msg,this.getPrivateUser());content.insertChatItem(item);},resetChatPopup:function(){if($defined(this.popup)){this.popup.close();}this.contents.each(function(content,key){content.close(true);this.contents.erase(key);},this);},createChatPopup:function(){this.popup=new ChatPopup({size:{x:400,y:350},resizable:false,className:"pipioChat",onClose:this.destroyChatPopup.bind(this)});},destroyChatPopup:function(){this.popup=null;this.isActive=false;},addChatConvo:function(user){if(this.contents.has(user.username)){var nav=new Nav({iconOptions:{user:user},displayName:user.fullname,closable:true});var content=this.contents.get(user.username);this.popup.addContent(user.username,nav,content);content.jumpToBottom();return content;}else{var nav=new Nav({iconOptions:{user:user},displayName:user.fullname,closable:true});var content=new ChatPopupContent({user:user});this.contents.set(user.username,content);this.popup.addContent(user.username,nav,content);return content;}}});Chat.implement({createChatPostItem:function(msg){var item=new Element("div",{"class":"post chat haspic"});}});var ChatPopup=new Class({Extends:Popup,setTitle:function(){if(this.hasTabs){var icon=new Icon20({iconName:"rooms"});var titleText=new Element("div",{"class":"title_text","text":this.contents.getLength()+" Chats"});}else{var nav=this.navs.get(this.currentContent);var icon=new Icon20(nav.iconOptions);var titleText=new Element("div",{"class":"title_text","text":"Chat with "+TextUtility.unescapeQuotes(nav.displayName)});}this.titleIcon=$(icon).replaces(this.titleIcon);this.titleText=titleText.replaces(this.titleText);}});var ChatPopupContent=new Class({Extends:PopupContent,onBeforeInit:function(options){options.destroy=false;this.user=options.user;return options;},onInit:function(){this.lastOutbound=null;this.typingSent=false;this.chatContent=new Element("div",{"class":"chatContent"}).inject(this.content);this.chatInput=new Element("textarea",{"maxlength":2000});this.chatInput.addEvent("keyup",this.chatInputKeyUp.bindWithEvent(this));new Element("div",{"class":"chatInput"}).adopt(new Element("div",{"class":"textarea_wrapper"}).adopt(this.chatInput)).inject(this.content);this.scroll=new Fx.Scroll(this.chatContent);},jumpToBottom:function(){this.scroll.set(0,this.chatContent.getScrollSize().y);},onShow:function(){if($defined(this.scrollY)){this.scroll.set(0,this.scrollY);}this.focus();var msg=this.user.first_name+" says...";this.fireEvent("titleMessageDelete",msg);},onHide:function(){if($defined(this.chatContent)){this.scrollY=this.chatContent.getScroll().y;}},focus:function(){this.chatInput.focus.delay(500,this.chatInput);},clearInput:function(){this.chatInput.value="";},chatInputKeyUp:function(e){if(e.key=="enter"){var msg=e.target.value.trim();if(msg==""){return;}this.fireEvent("sendIM",this.user,msg);this.resetTypingSent();this.clearInput();this.focus();}else{this.sendTyping();}DomUtility.textareaAutoSize(e.target,16);},insertChatItem:function(el){this.hideTyping();el.inject(this.chatContent);this.scroll.toBottom();if(!this.isOn){var msg=this.user.first_name+" says...";this.fireEvent("titleMessageAdd",msg);}},showTyping:function(){if($defined(this.typingHeading)){return;}this.typingHeading=ItemUtility.createChatTypingHeading(this.user);this.typingHeading.inject(this.chatContent);this.scroll.toBottom();this.hideTyping.delay(9000,this);},hideTyping:function(){if($defined(this.typingHeading)){this.typingHeading.destroy();this.typingHeading=null;}},sendTyping:function(){if(this.typingSent||!this.user.online){return;}this.typingSent=true;this.fireEvent("sendTyping",this.user);this.resetTypingSent.delay(6000,this);},resetTypingSent:function(){this.typingSent=false;}});var Invite=new Class({Extends:Base,EventHandlers:["userSwitched","searchUserShow","searchEmailShow","inviteUserShow"],userSwitched:function(){if(this.isLoggedIn()){this.userLoggedIn();}else{this.userLoggedOut();}},userLoggedIn:function(){},userLoggedOut:function(){},searchUserShow:function(){if($defined(this.searchUserPopup)){this.searchUserPopup._select();return;}this.createSearchUserPopup();},closeSearchUserPopup:function(){if($defined(this.searchUserPopup)){this.searchUserPopup.close();}},createSearchUserPopup:function(){this.searchUserPopup=new Popup({size:{x:350,y:110},resizable:false,dockable:false,className:"userSearch",onClose:this.destroySearchUserPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"search"},displayName:"Search for Users on Pip.io",closable:true});var content=new UserSearchPopupContent({});this.searchUserPopup.addContent("login",nav,content);},destroySearchUserPopup:function(){this.searchUserPopup=null;},searchEmailShow:function(){if($defined(this.searchEmailPopup)){this.searchEmailPopup._select();return;}this.createSearchEmailPopup();},closeSearchEmailPopup:function(){if($defined(this.searchEmailPopup)){this.searchEmailPopup.close();}},createSearchEmailPopup:function(){this.searchEmailPopup=new Popup({size:{x:350,y:140},resizable:false,dockable:false,className:"userSearch",onClose:this.destroySearchEmailPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"search"},displayName:"Search Contacts for Pip.io Users",closable:true});var content=new EmailSearchPopupContent({});this.searchEmailPopup.addContent("login",nav,content);},destroySearchEmailPopup:function(){this.searchEmailPopup=null;},inviteUserShow:function(email){if($defined(this.inviteUserPopup)){this.inviteUserPopup._select();return;}this.createInviteUserPopup(email);},closeInviteUserPopup:function(){if($defined(this.inviteUserPopup)){this.inviteUserPopup.close();}},createInviteUserPopup:function(email){this.inviteUserPopup=new Popup({size:{x:350,y:160},resizable:false,dockable:false,className:"userSearch",onClose:this.destroyInviteUserPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"users"},displayName:"Invite Friend to Join Pip.io",closable:true});var content=new UserInvitePopupContent({email:email});this.inviteUserPopup.addContent("login",nav,content);},destroyInviteUserPopup:function(){this.inviteUserPopup=null;}});var EmailSearchPopupContent=new Class({Extends:PopupContent,strings:{emailLabel:"Email:",passwordLabel:"Password:",userSearchMessage:"Search your email contacts for Pip.io users"},onInit:function(){new Element("div",{"class":"text_section centered light","text":this.strings.userSearchMessage}).inject(this.content);this.emailInput=new Element("input",{"type":"text","maxlength":"50"});this.emailInput.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));new Element("div",{"class":"input_section email"}).adopt(new Element("div",{"class":"label light","text":this.strings.emailLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.emailInput)).inject(this.content);this.passwordInput=new Element("input",{"type":"password","maxlength":"50"});this.passwordInput.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));new Element("div",{"class":"input_section email"}).adopt(new Element("div",{"class":"label light","text":this.strings.passwordLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.passwordInput)).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Search",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.search.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.actionButton),$(this.closeButton)).inject(this.content);},inputKeyUp:function(e){if(e.key=="enter"){if(this.passwordInput.value.trim()!=""&&this.emailInput.value.trim()!=""){this.search();}}},search:function(){var email_address=this.emailInput.value.trim();var password=this.passwordInput.value.trim();var params={email_address:email_address,password:password};this.call("contacts","search_email",params,this.searchSuccess.bind(this),this.searchFail.bind(this));this.actionButton.showProgress();},searchSuccess:function(data){this.actionButton.hideProgress();if(!$defined(data.users)&&!$defined(data.contacts)){return;}if(data.users.length==0&&data.contacts.length==0){var name="search_user";var title="No Results";var message="Your search returned no results";this.fireEvent("showAlert",name,title,message);}else{this.showResultsPopup(data.users,data.contacts);}},searchFail:function(status){this.actionButton.hideProgress();var name="search_user";var title="Error";var message=status.message;this.fireEvent("showAlert",name,title,message);},showResultsPopup:function(users,contacts){if($defined(this.resultsPopup)){this.resultsPopup.close();}this.createResultsPopup(users,contacts);},closeResultsPopup:function(){if($defined(this.resultsPopup)){this.resultsPopup.close();}},createResultsPopup:function(users,contacts){this.resultsPopup=new Popup({size:{x:350,y:400},resizable:false,dockable:false,className:"userSearch",onClose:this.destroyResultsPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"search"},displayName:"Search Results",closable:true});var content=new UserSearchResultPopupContent({users:users,contacts:contacts});this.resultsPopup.addContent("results",nav,content);},destroyResultsPopup:function(){this.resultsPopup=null;},onShow:function(){this.focus();},focus:function(){this.emailInput.focus.delay(500,this.emailInput);},onClose:function(){this.closeResultsPopup();}});var UserInvitePopupContent=new Class({Extends:PopupContent,strings:{emailLabel:"Email:",messageLabel:"Message:",defaultMessage:"Connect with me on Pip.io!"},onBeforeInit:function(options){this.email=options.email;return options;},onInit:function(){this.emailInput=new Element("input",{"type":"text","maxlength":"50","value":this.email});new Element("div",{"class":"input_section email"}).adopt(new Element("div",{"class":"label light","text":this.strings.emailLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.emailInput)).inject(this.content);this.messageInput=new Element("textarea",{"value":TextUtility.unescape(this.strings.defaultMessage)});new Element("div",{"class":"input_section email message"}).adopt(new Element("div",{"class":"label light","text":this.strings.messageLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.messageInput)).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Send Invite",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.sendInvite.bind(this));this.message=new Element("div",{"class":"message success"});this.actions=new Element("div",{"class":"actions"}).adopt(this.message,$(this.actionButton),$(this.closeButton)).inject(this.content);},sendInvite:function(){var email=this.emailInput.value.trim();var message=this.messageInput.value.trim();if(email==""){var name="invite_user";var title="Error";var message="Please enter an email address";this.fireEvent("showAlert",name,title,message);return;}var params={email:email,message:message};this.call("contacts","invite_create",params,this.sendInviteSuccess.bind(this),this.sendInviteFail.bind(this));this.actionButton.showProgress();this.message.empty();},sendInviteSuccess:function(){this.actionButton.hideProgress();this.emailInput.value="";this.message.set("text","Invite sent");},sendInviteFail:function(status){this.actionButton.hideProgress();var name="invite_user";var title="Error";var message=status.message;this.fireEvent("showAlert",name,title,message);}});var UserSearchPopupContent=new Class({Extends:PopupContent,strings:{userSearchMessage:"You can enter a name or email to search",errorMessage:"There was an error creating this group"},onInit:function(){new Element("div",{"class":"text_section centered light","text":this.strings.userSearchMessage}).inject(this.content);this.searchInput=new Element("input",{"type":"text","maxlength":"50"});this.searchInput.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"textarea_wrapper"}).adopt(this.searchInput)).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Search",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.search.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.actionButton),$(this.closeButton)).inject(this.content);},inputKeyUp:function(e){if(e.key=="enter"){if(this.searchInput.value.trim()!=""){this.search();}}},search:function(){var query=this.searchInput.value.trim();var params={query:query};this.call("contacts","search_user",params,this.searchSuccess.bind(this),this.searchFail.bind(this));this.actionButton.showProgress();},searchSuccess:function(data){this.actionButton.hideProgress();if(!$defined(data.users)&&!$defined(data.contacts)){return;}if(data.users.length==0&&data.contacts.length==0){var name="search_user";var title="No Results";var message="Your search returned no results";this.fireEvent("showAlert",name,title,message);}else{this.showResultsPopup(data.users,data.contacts);}},searchFail:function(status){this.actionButton.hideProgress();var name="search_user";var title="Error";var message=status.message;this.fireEvent("showAlert",name,title,message);},showResultsPopup:function(users,contacts){if($defined(this.resultsPopup)){this.resultsPopup.close();}this.createResultsPopup(users,contacts);},closeResultsPopup:function(){if($defined(this.resultsPopup)){this.resultsPopup.close();}},createResultsPopup:function(users,contacts){this.resultsPopup=new Popup({size:{x:350,y:400},resizable:false,dockable:false,className:"userSearch",onClose:this.destroyResultsPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"search"},displayName:"Search Results",closable:true});var content=new UserSearchResultPopupContent({users:users,contacts:contacts});this.resultsPopup.addContent("results",nav,content);},destroyResultsPopup:function(){this.resultsPopup=null;},onShow:function(){this.focus();},focus:function(){this.searchInput.focus.delay(500,this.searchInput);},onClose:function(){this.closeResultsPopup();}});var UserSearchResultPopupContent=new Class({Extends:PopupContent,strings:{searchResultMessage:"Search results"},onBeforeInit:function(options){this.users=options.users;this.contacts=options.contacts;return options;},onInit:function(){this.list=new Element("div",{"class":"itemList"}).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Close",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.closeButton)).inject(this.content);if(this.users.length>0){this.insertUsers();this.insertSeperator();}this.insertContacts();},insertContacts:function(){$H(this.contacts).each(function(name,email){this.insertContact(name,email);},this);},insertContact:function(name,email){var el=UserSearchUtility.createEmailItem(name,email);var button=new ButtonSmall({displayName:"Send Invite",className:"dark",action:"check"});$(button).inject(el);$(button).addEvent("click",this.fireEvent.bind(this,["inviteUserShow",email]));el.inject(this.list);},insertUsers:function(){this.users.each(function(user){user=UserUtility.processUser(user);this.insertUser(user);},this);},insertUser:function(user){var el=UserSearchUtility.createUserItem(user);if(!this.hasContact(user.username)){var button=new ButtonSmall({displayName:"Add Contact",className:"dark",action:"check"});$(button).inject(el);$(button).addEvent("click",this.contactRequest.bindWithEvent(this,[user.username,el]));}else{el.addClass("connected");}el.addEvent("click",this.fireEvent.bind(this,["showUser",user]));el.inject(this.list);},insertSeperator:function(){new Element("div",{"class":"listItem seperator"}).inject(this.list);},contactRequest:function(e,username,el){e.stopPropagation();this.fireEvent("connectionRequestCreate",username);el.addClass("invited");}});var UserSearchUtility={createUserItem:function(user){var el=new Element("div",{"class":"listItem user"});ItemUtility.createProfilePic(user,32).inject(el);var name=new Element("div",{"class":"listText text12 light","text":TextUtility.cleanText(user.fullname+" ("+user.username+")")}).inject(el);if($defined(user.about)&&$defined(user.about.bio)){new Element("div",{"class":"about_text text11 light3","text":TextUtility.cleanText(user.about.bio)}).inject(el);}new Element("div",{"class":"invited_text text11 success","text":"Request Sent"}).inject(el);new Element("div",{"class":"connected_text text11 success","text":"Connected"}).inject(el);return el;},createEmailItem:function(name,email){var el=new Element("div",{"class":"listItem"});var icon=new Icon20({iconName:"users"});$(icon).inject(el);new Element("div",{"class":"listText text12 light","text":TextUtility.cleanText(email)}).inject(el);var button=new ButtonSmall({displayName:"Invite",className:"dark",action:"check"});$(button).inject(el);new Element("div",{"class":"invited_text text11 success","text":"Invited"}).inject(el);return el;}};var Location=new Class({Extends:Base,EventHandlers:["showLocationEditPopup","showUsersMapPopup"],init:function(){},reset:function(){},userSwitched:function(){if(this.isLoggedIn()){this.userLoggedIn();}else{this.userLoggedOut();}},userLoggedIn:function(){},userLoggedOut:function(){this.closeLocationEditPopup();},showLocationEditPopup:function(){this.closeLocationEditPopup();this.createLocationEditPopup();},closeLocationEditPopup:function(){if($defined(this.locationEditPopup)){this.locationEditPopup.close();}},createLocationEditPopup:function(){this.locationEditPopup=new Popup({size:{x:350,y:110},resizable:false,dockable:false,closable:true,className:"locationSearch",onClose:(function(){this.locationEditPopup=null;}).bind(this)});var nav=new Nav({iconOptions:{iconName:"global"},displayName:"Edit Your Location",closable:true});var content=new UserLocationEditPopupContent({});content.resizePopup=this.locationEditPopup.resizePopup.bind(this.locationEditPopup);content.reCenter=this.locationEditPopup.reCenter.bind(this.locationEditPopup);this.locationEditPopup.addContent("edit_location",nav,content);},showUsersMapPopup:function(user){this.closeUsersMapPopup();this.createUsersMapPopup(user);},closeUsersMapPopup:function(){if($defined(this.usersMapPopup)){this.usersMapPopup.close();}},createUsersMapPopup:function(user){this.usersMapPopup=new Popup({size:{x:550,y:350},resizable:false,dockable:true,closable:true,className:"usersMap"});var nav=new Nav({iconOptions:{iconName:"location"},displayName:"Global Map",closable:true});var content=new UsersMapPopupContent({user:user,locations:this.getLocations()});this.usersMapPopup.addContent("users_maps",nav,content);}});var GlobalMapMenuSection=new Class({Extends:Base,EventHandlers:[],init:function(options){this.location=options.location;this.createMap();},createMap:function(){this.wrapper=new Element("div");this.updateMap();},updateMap:function(){this.wrapper.empty();if($defined(this.location)){this.mapWrapper=new Element("div",{"class":"gmap_content"});this.expandButton=new Element("div",{"class":"button_nav show"}).adopt(new Element("div",{"class":"action dock"}));var map=new Element("div",{"class":"map_section"}).adopt(new Element("div",{"class":"gmap"}).adopt(new Element("div",{"class":"gmap_border"}),this.mapWrapper));this.gmap=new GMap2(this.mapWrapper,{size:new GSize(156,156)});this.gmap.setCenter(new GLatLng(this.location.lat,this.location.lon),11);map.inject(this.wrapper);}this.updateLabel();},updateLabel:function(){if($defined(this.label)){this.label.destroy();}if($defined(this.location)){var locationLabel=DataUtility.getGeoLabel(this.location);var locationStr=DataUtility.getGeoLocality(this.location);if(locationLabel){locationStr=locationLabel+", "+locationStr;}this.label=new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Location: "}),new Element("span",{"html":TextUtility.unescape(locationStr)})).inject(this.wrapper,"top");}},toElement:function(){return this.wrapper;}});var UserMapMenuSection=new Class({Extends:Base,EventHandlers:["userLocationUpdated"],init:function(options){this.user=options.user;this.isSelf=this.user.user_id==this.getPrivateUser().user_id;this.location=this.getLocation(this.user.username);this.createMap();},createMap:function(){this.wrapper=new Element("div");this.updateMap();},updateMap:function(){this.wrapper.empty();if($defined(this.location)){this.mapWrapper=new Element("div",{"class":"gmap_content"});this.expandButton=new Element("div",{"class":"button_nav show"}).adopt(new Element("div",{"class":"action dock"}));this.expandButton.addEvent("click",this.fireEvent.bind(this,["showUsersMapPopup",this.user]));var map=new Element("div",{"class":"map_section"}).adopt(new Element("div",{"class":"gmap"}).adopt(new Element("div",{"class":"gmap_border"}),this.mapWrapper),this.expandButton);this.gmap=new GMap2(this.mapWrapper,{size:new GSize(156,156)});this.gmap.setCenter(new GLatLng(this.location.lat,this.location.lon),11);this.profilePic=ItemUtility.createProfilePic(this.user,60);this.marker=new Element("div",{"class":"map_marker"}).adopt(new Element("div",{"class":"profile_pic_wrapper"}).adopt(this.profilePic),new Element("div",{"class":"point_down"}),new Element("div",{"class":"spot"})).inject(map);map.inject(this.wrapper);}else{ItemUtility.createProfilePic(this.user,100).inject(this.wrapper);}this.updateLabel();},userLocationUpdated:function(username,location,location_enabled){if(username!=this.user.username){return;}this.user.location_enabled=location_enabled;this.location=$defined(location)?location:null;this.updateMap();},updateLabel:function(){if($defined(this.label)){this.label.destroy();}if($defined(this.location)){var locationLabel=DataUtility.getGeoLabel(this.location);var locationStr=DataUtility.getGeoLocality(this.location);if(locationLabel){locationStr=locationLabel+", "+locationStr;}this.label=new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Location: "}),new Element("span",{"html":TextUtility.unescape(locationStr)})).inject(this.wrapper,"top");}},toElement:function(){return this.wrapper;}});var LocationSearchResultPopupContent=new Class({Extends:PopupContent,strings:{searchResultMessage:"Search results"},onBeforeInit:function(options){this.locations=options.locations;this.locationSetFunc=options.locationSetFunc;return options;},onInit:function(){this.list=new Element("div",{"class":"itemList"}).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Close",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.closeButton)).inject(this.content);this.insertLocations();},insertLocations:function(){this.locations.each(function(location){this.insertLocation(location);},this);},insertLocation:function(location){var el=LocationSearchUtility.createLocationItem(location);var button=new ButtonSmall({displayName:"Set Location",className:"dark",action:"check"});$(button).inject(el);$(button).addEvent("click",this.setLocation.bind(this,location));el.inject(this.list);},setLocation:function(location){this.locationSetFunc(location);this.closeContent();}});var UserLocationEditPopupContent=new Class({Extends:PopupContent,strings:{locationSearchMessage:"Enter any address, city, or zip code",locationLabelLabel:"Location Name:"},onInit:function(){this.geocoder=new GClientGeocoder();this.searchTitle=new Element("div",{"class":"text_section centered light","text":this.strings.locationSearchMessage}).inject(this.content);this.searchInput=new Element("input",{"type":"text","maxlength":"50"});this.searchInput.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));this.searchInputSection=new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"textarea_wrapper"}).adopt(this.searchInput)).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Search",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.search.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.actionButton),$(this.closeButton)).inject(this.content);},inputKeyUp:function(e){if(e.key=="enter"){if(this.searchInput.value.trim()!=""){this.search();}}},search:function(){var query=this.searchInput.value.trim();this.geocoder.getLocations(query,this.searchSuccess.bind(this));this.actionButton.showProgress();},searchSuccess:function(data){this.actionButton.hideProgress();if(data.Status.code==200){this.places=[];data.Placemark.each(function(place){this.places.push(this.parseLocation(place));},this);this.createResultsPopup();}else{var name="search_location";var title="No Results";var message="Your search returned no results";this.fireEvent("showAlert",name,title,message);}},parseLocation:function(location){var place={};place.name=location.address;place.country_code=location.AddressDetails.Country.CountryNameCode;place.country=location.AddressDetails.Country.CountryName;place.region=$defined(location.AddressDetails.Country.AdministrativeArea)?location.AddressDetails.Country.AdministrativeArea.AdministrativeAreaName:null;if($defined(location.AddressDetails.Country.AdministrativeArea)&&$defined(location.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea)&&$defined(location.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality)){place.city=location.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.LocalityName;}else{if($defined(location.AddressDetails.Country.AddressLine)&&$defined(location.AddressDetails.Country.AddressLine[0])){place.city=location.AddressDetails.Country.AddressLine[0];}}if($defined(location.AddressDetails.Country.AdministrativeArea)&&$defined(location.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea)&&$defined(location.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality)&&$defined(location.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.Thoroughfare)){place.address=location.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.Thoroughfare.ThoroughfareName;}place.lat=location.Point.coordinates[1];place.lon=location.Point.coordinates[0];place.geohash=GeoHash.encodeGeoHash(place.lat,place.lon);return place;},locationSelect:function(location){DomUtility.hide(this.searchTitle);DomUtility.hide(this.searchInputSection);DomUtility.hide(this.actions);this.searchTitle=new Element("div",{"class":"text_section centered light","text":TextUtility.unescape(location.name)}).inject(this.content);this.labelInput=new Element("input",{"type":"text","maxlength":"50"});if($defined(location.address)){this.labelInput.value=location.address;}new Element("div",{"class":"input_section label"}).adopt(new Element("div",{"class":"label light","text":this.strings.locationLabelLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.labelInput)).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Save Location",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.locationSave.bind(this,[location]));this.actions=new Element("div",{"class":"actions"}).adopt($(this.actionButton),$(this.closeButton)).inject(this.content);},locationSave:function(location){var label=this.labelInput.value.trim();var params={"label":label,"country_code":location.country_code,"country":location.country,"city":$defined(location.city)?location.city:"","region":$defined(location.region)?location.region:"","lat":location.lat,"lon":location.lon,"geohash":location.geohash};this.call("pipio","user_location_save",params,this.locationSaveSuccess.bind(this),this.locationSaveFail.bind(this));this.actionButton.showProgress();},locationSaveSuccess:function(data){this.closeContent();},locationSaveFail:function(status){this.actionButton.hideProgress();},searchFail:function(status){this.actionButton.hideProgress();var name="search_user";var title="Error";var message=status.message;this.fireEvent("showAlert",name,title,message);},showResultsPopup:function(users,contacts){if($defined(this.resultsPopup)){this.resultsPopup.close();}this.createResultsPopup(users,contacts);},closeResultsPopup:function(){if($defined(this.resultsPopup)){this.resultsPopup.close();}},createResultsPopup:function(){this.resultsPopup=new Popup({size:{x:350,y:400},resizable:false,dockable:false,className:"locationSearch",onClose:this.destroyResultsPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"global"},displayName:"Location Search Results",closable:true});var content=new LocationSearchResultPopupContent({locations:this.places,locationSetFunc:this.locationSelect.bind(this)});this.resultsPopup.addContent("results",nav,content);},destroyResultsPopup:function(){this.resultsPopup=null;},onShow:function(){this.focus();},focus:function(){this.searchInput.focus.delay(500,this.searchInput);},onClose:function(){this.closeResultsPopup();}});var UsersMapPopupContent=new Class({Extends:PopupContent,EventHandlers:["userLocationUpdated"],onBeforeInit:function(options){this.user=options.user;this.locations=options.locations;this.users=$H();return options;},onInit:function(){this.createMap();this.showUser(this.user.username);this.locations.each(function(location,username){this.showUser(username);},this);},createMap:function(){this.mapWrapper=new Element("div",{"class":"gmap_content"});var map=new Element("div",{"class":"map_section"}).adopt(new Element("div",{"class":"gmap"}).adopt(new Element("div",{"class":"gmap_border"}),this.mapWrapper));this.gmap=new GMap2(this.mapWrapper,{size:new GSize(526,326)});var location=this.getLocation(this.user.username);this.gmap.setCenter(new GLatLng(location.lat,location.lon),11);this.gmap.enableScrollWheelZoom();this.gmap.enableContinuousZoom();this.gmap.addControl(new GLargeMapControl());this.gmap.addControl(new GMapTypeControl());var mt=this.gmap.getMapTypes();for(var i=0;i<mt.length;i++){mt[i].getMinimumResolution=$lambda(3);mt[i].getMaximumResolution=$lambda(14);}map.inject(this.content);},userLocationUpdated:function(username,location,location_enabled){if($defined(location)){this.showUser(username);}else{this.removeUser(username);}},showUser:function(username){var user=this.getUser(username);var location=this.getLocation(username);if(!$defined(user)||!$defined(location)){return;}if(this.users.has(username)){this.gmap.removeOverlay(this.users.get(username));}var loc=new GLatLng(location.lat,location.lon);var marker=new MarkerLight(loc,{size:26,user:user});this.gmap.addOverlay(marker);this.users.set(username,marker);},removeUser:function(username){if(!this.users.has(username)){return;}this.gmap.removeOverlay(this.users.get(username));}});var LocationSearchUtility={createLocationItem:function(location){var el=new Element("div",{"class":"listItem"});var icon=new Icon20({iconName:"location"});$(icon).inject(el);var name=new Element("div",{"class":"listText text12 light","text":TextUtility.cleanText(location.name)}).inject(el);return el;}};var Login=new Class({Extends:Base,EventHandlers:["userSwitched","loginShow","signupShow","logoutShow","passwordResetRequestShow"],userSwitched:function(){if(this.isLoggedIn()){this.userLoggedIn();}else{this.userLoggedOut();}},userLoggedIn:function(){this.closeLoginPopup();this.closePasswordResetRequestPopup();this.closePasswordResetPopup();this.closeSignupPopup();},userLoggedOut:function(){if(!this.checkCookie()){this.loginShow();}},checkCookie:function(){var destination=DataUtility.getCookie("destination");var token=DataUtility.getCookie("password_reset_token");var email=DataUtility.getCookie("password_reset_email");if(!$defined(destination)){return false;}if(destination=="password_reset"&&$defined(token)&&$defined(email)){this.passwordResetShow(token,email);return true;}else{if(destination=="signup"){var access_key=DataUtility.getCookie("invite_access_key");if(!$defined(access_key)){access_key="";}this.signupShow(access_key);return true;}else{if(destination=="email_block"){var token=DataUtility.getCookie("email_block_token");var email=DataUtility.getCookie("email_block_email");this.emailBlockShow(token,email);return true;}}}return false;},loginShow:function(){if($defined(this.loginPopup)){this.loginPopup._select();return;}this.createLoginPopup();},closeLoginPopup:function(){if($defined(this.loginPopup)){this.loginPopup.close();}},createLoginPopup:function(){this.loginPopup=new Popup({size:{x:350,y:226},resizable:false,dockable:false,className:"login",onClose:this.destroyLoginPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"power"},displayName:"Log In to Pip.io",closable:true});var content=new LoginPopupContent({});this.loginPopup.addContent("login",nav,content);},destroyLoginPopup:function(){this.loginPopup=null;},logoutShow:function(){if($defined(this.logoutPopup)){this.logoutPopup._select();return;}this.createLogoutPopup();},closeLogoutPopup:function(){if($defined(this.logoutPopup)){this.logoutPopup.close();}},createLogoutPopup:function(){this.logoutPopup=new Popup({size:{x:350,y:70},resizable:false,dockable:false,onClose:this.destroyLogoutPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"power"},displayName:"Log Out "+TextUtility.unescapeQuotes(this.getPrivateUser().fullname),closable:true});var content=new LogoutPopupContent({});this.logoutPopup.addContent("logout",nav,content);},destroyLogoutPopup:function(){this.logoutPopup=null;},passwordResetRequestShow:function(){if($defined(this.passwordResetRequestPopup)){this.passwordResetRequestPopup.close();}this.createPasswordResetRequestPopup();},closePasswordResetRequestPopup:function(){if($defined(this.passwordResetRequestPopup)){this.passwordResetRequestPopup.close();}},createPasswordResetRequestPopup:function(){this.passwordResetRequestPopup=new Popup({size:{x:350,y:112},resizable:false,dockable:false,className:"login",onClose:this.destroyPasswordResetRequestPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"pipio"},displayName:"Password Reset",closable:true});var content=new PasswordResetRequestPopupContent({});this.passwordResetRequestPopup.addContent("login",nav,content);},destroyPasswordResetRequestPopup:function(){this.passwordResetRequestPopup=null;},passwordResetShow:function(token,email){if($defined(this.passwordResetPopup)){this.passwordResetPopup.close();}this.createPasswordResetPopup(token,email);},closePasswordResetPopup:function(){if($defined(this.passwordResetPopup)){this.passwordResetPopup.close();}},createPasswordResetPopup:function(token,email){this.passwordResetPopup=new Popup({size:{x:350,y:142},resizable:false,dockable:false,className:"login",onClose:this.destroyPasswordResetPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"pipio"},displayName:"Password Reset",closable:true});var content=new PasswordResetPopupContent({token:token,email:email});this.passwordResetPopup.addContent("login",nav,content);},destroyPasswordResetPopup:function(){this.passwordResetPopup=null;},signupShow:function(access_key){if($defined(this.signupPopup)){this.signupPopup._select();return;}this.createSignupPopup(access_key);},closeSignupPopup:function(){if($defined(this.signupPopup)){this.signupPopup.close();}},createSignupPopup:function(access_key){this.signupPopup=new Popup({size:{x:350,y:366},resizable:false,dockable:false,className:"login",onClose:this.destroySignupPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"pipio"},displayName:"Sign Up for Pip.io",closable:true});if(!$defined(access_key)){access_key="";}var content=new SignupPopupContent({access_key:access_key});this.signupPopup.addContent("signup",nav,content);},destroySignupPopup:function(){this.signupPopup=null;},emailBlockShow:function(token,email){if($defined(this.emailBlockPopup)){this.emailBlockPopup.close();}this.createEmailBlockPopup(token,email);},closeEmailBlockPopup:function(){if($defined(this.signupPopup)){this.emailBlockPopup.close();}},createEmailBlockPopup:function(token,email){this.emailBlockPopup=new Popup({size:{x:350,y:110},resizable:false,dockable:false,className:"login",onClose:this.destroyEmailBlockPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"pipio"},displayName:"Email Settings",closable:true});var content=new EmailBlockPopupContent({token:token,email:email});this.emailBlockPopup.addContent("emailblock",nav,content);},destroyEmailBlockPopup:function(){this.emailBlockPopup=null;}});var EmailBlockPopupContent=new Class({Extends:PopupContent,strings:{emailBlockMessage:"Stop all Pip.io emails for:"},onBeforeInit:function(options){this.token=options.token;this.email=options.email;return options;},onInit:function(){new Element("div",{"class":"text_section centered light","text":TextUtility.unescape(this.strings.emailBlockMessage)}).inject(this.content);new Element("div",{"class":"text_section centered light","text":TextUtility.unescape(this.email)}).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Confirm",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.blockEmail.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.actionButton),$(this.closeButton)).inject(this.content);},blockEmail:function(){var params={"token":this.token,"email":this.email};this.call("pipio","email_block",params,this.resetRequestSuccess.bind(this),this.resetRequestFail.bind(this));this.actionButton.showProgress();},resetRequestSuccess:function(data){var name="email_block";var title="Email Block Successful";var message="You will no longer receive emails from Pip.io";this.fireEvent("showAlert",name,title,message);this.actionButton.hideProgress();this.closeContent();},resetRequestFail:function(){var name="email_block";var title="Email Block Failed";var message="There was an error processing your request. Please contact support@pip.io";this.fireEvent("showAlert",name,title,message);this.actionButton.hideProgress();}});var LoginPopupContent=new Class({Extends:PopupContent,strings:{loginMessage:"Log in to Pip.io",signupMessage:"Don't have an account? Sign up now!",usernameLabel:"Username or email:",passwordLabel:"Password:",rememberMeLabel:"Remember me:",errorMessage:"Incorrect login",forgotPasswordMessage:"Forgot your password?"},onInit:function(){new Element("div",{"class":"text_section centered light","text":this.strings.loginMessage}).inject(this.content);var signupMsg=new Element("div",{"class":"text_section centered short text11 light3 clickable","text":this.strings.signupMessage}).inject(this.content);signupMsg.addEvent("click",this.fireEvent.bind(this,["signupShow"]));this.usernameInput=new Element("input",{"type":"text","maxlength":"32"});this.usernameInput.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.usernameLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.usernameInput)).inject(this.content);this.passwordInput=new Element("input",{"type":"password","maxlength":"32"});this.passwordInput.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.passwordLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.passwordInput)).inject(this.content);this.rememberToggle=new Toggle(true);new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.rememberMeLabel}),$(this.rememberToggle)).inject(this.content);var forgotPasswordMsg=new Element("div",{"class":"text_section centered short text11 light3 clickable","text":this.strings.forgotPasswordMessage}).inject(this.content);forgotPasswordMsg.addEvent("click",this.fireEvent.bind(this,["passwordResetRequestShow"]));this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Log In",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.login.bind(this));this.message=new Element("div",{"class":"message error"});this.actions=new Element("div",{"class":"actions"}).adopt(this.message,$(this.actionButton),$(this.closeButton)).inject(this.content);},login:function(){var username=this.usernameInput.value.trim();var password=this.passwordInput.value.trim();var remember_me=this.rememberToggle.toInt();var params={"username":username,"password":password,"remember_me":remember_me};this.call("pipio","user_login",params,this.loginSuccess.bind(this),this.loginFail.bind(this));this.actionButton.showProgress();this.message.empty();},loginSuccess:function(data){this.fireEvent("userDataInit",data);this.actionButton.hideProgress();this.closeContent();},loginFail:function(){this.actionButton.hideProgress();this.message.set("text",this.strings.errorMessage);},inputKeyUp:function(e){if(e.key=="enter"){if(this.usernameInput.value.trim()!=""&&this.passwordInput.value.trim()!=""){this.login();}}},onShow:function(){this.focus();},focus:function(){this.usernameInput.focus.delay(500,this.usernameInput);}});var LogoutPopupContent=new Class({Extends:PopupContent,strings:{logoutMessage:"Are you sure you want to log out?"},onInit:function(){new Element("div",{"class":"text_section centered light","text":this.strings.logoutMessage}).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Log Out",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.logout.bind(this));this.message=new Element("div",{"class":"message"});this.actions=new Element("div",{"class":"actions"}).adopt(this.message,$(this.actionButton),$(this.closeButton)).inject(this.content);},logout:function(){this.call("pipio","user_logout",null,this.logoutSuccess.bind(this),this.logoutFail.bind(this));this.actionButton.showProgress();},logoutSuccess:function(data){this.fireEvent("userDataInit",data);this.actionButton.hideProgress();this.closeContent();},logoutFail:function(){this.actionButton.hideProgress();this.closeContent();}});var PasswordResetPopupContent=new Class({Extends:PopupContent,strings:{passwordResetMessage:"Reset Pip.io password for {0}",passwordLabel:"New password:",verifyPasswordLabel:"Verify password"},onBeforeInit:function(options){this.token=options.token;this.email=options.email;return options;},onInit:function(){new Element("div",{"class":"text_section centered light","text":String.format(this.strings.passwordResetMessage,TextUtility.unescape(this.email))}).inject(this.content);this.passwordInput=new Element("input",{"type":"password","maxlength":"32"});new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.passwordLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.passwordInput)).inject(this.content);this.verifyPasswordInput=new Element("input",{"type":"password","maxlength":"32"});new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.verifyPasswordLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.verifyPasswordInput)).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Set New Password",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.resetRequest.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.actionButton),$(this.closeButton)).inject(this.content);},resetRequest:function(){var new_password=this.passwordInput.value.trim();var verify_password=this.verifyPasswordInput.value.trim();if(new_password==""||verify_password==""){var name="reset_request";var title="Password Reset Request Failed";var message="Please enter a new password";this.fireEvent("showAlert",name,title,message);return;}if(new_password!=verify_password){var name="reset_request";var title="Password Reset Request Failed";var message="The passwords you entered do not match";this.fireEvent("showAlert",name,title,message);return;}var params={"token":this.token,"email":this.email,"new_password":new_password,"verify_password":verify_password};this.call("pipio","user_password_reset",params,this.resetRequestSuccess.bind(this),this.resetRequestFail.bind(this));this.actionButton.showProgress();},resetRequestSuccess:function(data){var name="reset_request";var title="Password Reset Successful";var message="Your Pip.io password has been successfully reset";this.fireEvent("loginShow");this.fireEvent("showAlert",name,title,message);this.actionButton.hideProgress();this.closeContent();},resetRequestFail:function(){var name="reset_request";var title="Password Reset Failed";var message="There was an error resetting your password. Please contact support@pip.io";this.fireEvent("showAlert",name,title,message);this.actionButton.hideProgress();},onShow:function(){this.focus();},focus:function(){this.passwordInput.focus.delay(500,this.passwordInput);}});var PasswordResetRequestPopupContent=new Class({Extends:PopupContent,strings:{passwordResetMessage:"Forgot your password to Pip.io?",usernameLabel:"Username or email:",forgotPasswordMessage:"Forgot your password?"},onInit:function(){new Element("div",{"class":"text_section centered light","text":this.strings.passwordResetMessage}).inject(this.content);this.usernameInput=new Element("input",{"type":"text","maxlength":"32"});this.usernameInput.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.usernameLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.usernameInput)).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Request Reset",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.resetRequest.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.actionButton),$(this.closeButton)).inject(this.content);},resetRequest:function(){var username=this.usernameInput.value.trim();if(username==""){var name="reset_request";var title="Password Reset Request Failed";var message="Please enter your username or email";this.fireEvent("showAlert",name,title,message);return;}var params={"username":username};this.call("pipio","user_password_resetrequest",params,this.resetRequestSuccess.bind(this),this.resetRequestFail.bind(this));this.actionButton.showProgress();},resetRequestSuccess:function(data){var name="reset_request";var title="Password Reset Request Sent";var message="Please check your email for directions to reset your password";this.fireEvent("showAlert",name,title,message);this.actionButton.hideProgress();this.closeContent();},resetRequestFail:function(){var name="reset_request";var title="Password Reset Request Failed";var message="We could not locate your account, please make sure the username or email you entered is correct";this.fireEvent("showAlert",name,title,message);this.actionButton.hideProgress();},inputKeyUp:function(e){if(e.key=="enter"){if(this.usernameInput.value.trim()!=""){this.resetRequest();}}},onShow:function(){this.focus();},focus:function(){this.usernameInput.focus.delay(500,this.usernameInput);}});var SignupPopupContent=new Class({Extends:PopupContent,strings:{signUpMessage:"Sign up for Pip.io",signUpDetailMessage:"It only takes a few seconds to create an account!",usernameLabel:"Username:",passwordLabel:"Password:",firstNameLabel:"First Name:",lastNameLabel:"Last Name:",emailLabel:"Email:",dobLabel:"Date of Birth:",inviteCodeLabel:"Invite Code:",inviteCodeMessage:"Leave this field blank if you do not have an invite code"},onBeforeInit:function(options){this.access_key=options.access_key;return options;},onInit:function(){new Element("div",{"class":"text_section centered light","text":this.strings.signUpMessage}).inject(this.content);new Element("div",{"class":"text_section centered light short text11 light3","text":this.strings.signUpDetailMessage}).inject(this.content);this.firstNameInput=new Element("input",{"type":"text","maxlength":"50"});new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.firstNameLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.firstNameInput)).inject(this.content);this.lastNameInput=new Element("input",{"type":"text","maxlength":"50"});new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.lastNameLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.lastNameInput)).inject(this.content);this.emailInput=new Element("input",{"type":"text","maxlength":"32"});new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.emailLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.emailInput)).inject(this.content);this.usernameInput=new Element("input",{"type":"text","maxlength":"32"});new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.usernameLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.usernameInput)).inject(this.content);this.passwordInput=new Element("input",{"type":"password","maxlength":"32"});new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.passwordLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.passwordInput)).inject(this.content);this.monthInput=new Element("input",{"type":"text","maxlength":"2","value":"MM"});this.dayInput=new Element("input",{"type":"text","maxlength":"2","value":"DD"});this.yearInput=new Element("input",{"type":"text","maxlength":"4","value":"YYYY"});this.monthInput.addEvent("click",this.clearField.bind(this,[this.monthInput,"MM"]));this.dayInput.addEvent("click",this.clearField.bind(this,[this.dayInput,"DD"]));this.yearInput.addEvent("click",this.clearField.bind(this,[this.yearInput,"YYYY"]));new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.dobLabel}),new Element("div",{"class":"textarea_wrapper month"}).adopt(this.monthInput),new Element("div",{"class":"textarea_wrapper day"}).adopt(this.dayInput),new Element("div",{"class":"textarea_wrapper year"}).adopt(this.yearInput)).inject(this.content);this.inviteCodeInput=new Element("input",{"type":"text","maxlength":"10","value":this.access_key});new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.inviteCodeLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.inviteCodeInput)).inject(this.content);new Element("div",{"class":"text_section centered light short text11 light3","text":this.strings.inviteCodeMessage}).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Sign Up",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.signup.bind(this));this.message=new Element("div",{"class":"message success"});this.actions=new Element("div",{"class":"actions"}).adopt(this.message,$(this.actionButton),$(this.closeButton)).inject(this.content);},clearField:function(el,def){if(el.value==def){el.value="";}},signup:function(){var first_name=this.firstNameInput.value.trim();var last_name=this.lastNameInput.value.trim();var username=this.usernameInput.value.trim();var password=this.passwordInput.value.trim();var email=this.emailInput.value.trim();var dob_month=this.monthInput.value.trim();var dob_day=this.dayInput.value.trim();var dob_year=this.yearInput.value.trim();var access_key=this.inviteCodeInput.value.trim();if(first_name==""||last_name==""){this.signupFail({message:"Please enter your name"});return;}if(email==""){this.signupFail({message:"Please enter your email"});return;}if(username==""){this.signupFail({message:"Please enter a username"});return;}if(password==""){this.signupFail({message:"Please enter a password"});return;}if(dob_month!=parseInt(dob_month)||dob_month<1||dob_month>12){this.signupFail({message:"Please enter a valid month"});return;}if(dob_day!=parseInt(dob_day)||dob_day<1||dob_day>31){this.signupFail({message:"Please enter a valid day"});return;}if(dob_year!=parseInt(dob_year)||dob_year<1900||dob_year>2010){this.signupFail({message:"Please enter a valid year"});return;}var params={"first_name":first_name,"last_name":last_name,"username":username,"password":password,"email":email,"dob_month":dob_month,"dob_day":dob_day,"dob_year":dob_year,"access_key":access_key};this.call("pipio","user_register",params,this.signupSuccess.bind(this),this.signupFail.bind(this));this.actionButton.showProgress();this.message.set("text","please wait...");},signupSuccess:function(data){this.fireEvent("userDataInit",data);this.actionButton.hideProgress();this.closeContent();this.message.set("success!");},signupFail:function(status){this.actionButton.hideProgress();var name="user_register";var title="Error";var message=status.message;this.message.empty();this.fireEvent("showAlert",name,title,message);},onShow:function(){this.focus();},focus:function(){this.firstNameInput.focus.delay(500,this.firstNameInput);}});var Notifications=new Class({Extends:Base,EventHandlers:["userSwitched","notificationAdd","titleMessageAdd","titleMessageDelete"],init:function(){this.notifications=$H();this.timers=$H();this.messages=[];this.messageTimer=0;this.createNotifications();},titleMessageAdd:function(message){if(this.messages.contains(message)){return;}this.messages.push(message);this.titleMessageCheck();},titleMessageDelete:function(message){if(this.messages.contains(message)){this.messages.erase(message);}this.titleMessageCheck();},titleMessageCheck:function(){if(this.messages.length>0&&this.messageTimer==0){this.messageTimer=this.titleMessageRotate.periodical(2000,this);}else{if(this.messages.length==0&&this.messageTimer!=0){$clear(this.messageTimer);document.title=this.getPageTitle();}}},titleMessageRotate:function(){if(this.messages.length==0){return;}if(!$defined(this.currentTitle)){this.currentTitle=this.getPageTitle();}if(this.getPageTitle()==this.currentTitle){var msg=this.messages.shift();this.messages.push(msg);document.title=msg;this.currentTitle=msg;}else{document.title=this.getPageTitle();this.currentTitle=this.getPageTitle();}},userSwitched:function(){if(this.isLoggedIn()){this.userLoggedIn();}else{this.userLoggedOut();}},userLoggedIn:function(){this.notifications=$H();},userLoggedOut:function(){this.closeAll();this.notifications=$H();},closeAll:function(){this.notifications.getKeys().each(function(name){this.close(name);},this);},close:function(name){if(!this.notifications.has(name)){return;}var notif=this.notifications.get(name);DomUtility.fadeOutDestroy($(notif));this.notifications.erase(name);$clear(this.timers.get(name));this.timers.erase(name);delete (notif);this.checkShow();},notificationAdd:function(name,notif){if(this.notifications.has(name)){return;}$(notif).inject(this.menu);DomUtility.fadeIn($(notif),1000);this.notifications.set(name,notif);notif.onClose=this.close.bind(this,name);var timer=this.close.delay(notif.timeout,this,[name]);this.timers.set(name,timer);this.checkShow();},checkShow:function(){if(this.notifications.getLength()>0){DomUtility.show(this.menu);}else{DomUtility.hide(this.menu);}},createNotifications:function(){this.menu=new Element("div",{"class":"menu flattop"});this.menu.inject("notifications");this.checkShow();}});var Notification=new Class({Extends:Base,init:function(options){if($defined(this.onBeforeInit)){options=this.onBeforeInit(options);}this.iconOptions=options.iconOptions;this.timeout=options.timeout||5000;this.hasActions=options.hasActions||false;this.createNotification();if($defined(this.onInit)){this.onInit();}},createNotification:function(){this.notif=new Element("div",{"class":"notification"});this.icon=new Icon20(this.iconOptions);$(this.icon).inject(this.notif);this.closeButton=new Element("div",{"class":"button_nav show"}).adopt(new Element("div",{"class":"action close"})).inject(this.notif);this.closeButton.addEvent("click",this.closeNotification.bind(this));this.getText().inject(this.notif);if(this.hasActions){this.actions=new Element("div",{"class":"actions"}).inject(this.notif);}},getText:function(){return new Element("div",{"class":"notification_text text11 light1"});},closeNotification:function(){if($defined(this.onClose)){this.onClose();}},toElement:function(){return this.notif;}});var Settings=new Class({Extends:Base,EventHandlers:["userSwitched","showSettings"],userSwitched:function(){if(this.isLoggedIn()){this.userLoggedIn();}else{this.userLoggedOut();}},userLoggedIn:function(){},userLoggedOut:function(){this.closeSettings();},showSettings:function(){this.closeSettings();this.settingsPopup=new Popup({size:{x:350,y:368},resizable:false,dockable:false,className:"settings",onClose:this.destroySettings.bind(this)});var nav=new Nav({iconOptions:{iconName:"settings"},displayName:"Pip.io Settings",closable:true});var content=new PipioSettingsPopupContent();this.settingsPopup.addContent("pipio_settings",nav,content);},closeSettings:function(){if($defined(this.settingsPopup)){this.settingsPopup.close();}},destroySettings:function(){this.settingsPopup=null;}});var EmailChangePopupContent=new Class({Extends:PopupContent,strings:{emailLabel:"Email:"},onInit:function(){this.emailInput=new Element("input",{"type":"text","maxlength":"200"});this.emailInput.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.emailLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.emailInput)).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Update Email",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.changeEmail.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.actionButton),$(this.closeButton)).inject(this.content);},inputKeyUp:function(e){if(e.key=="enter"){if(this.emailInput.value.trim()!=""){this.changeEmail();}}},changeEmail:function(){var email=this.emailInput.value.trim();var params={email:email};this.call("pipio","user_email_change",params,this.changeEmailSuccess.bind(this),this.changeEmailFail.bind(this));this.actionButton.showProgress();},changeEmailSuccess:function(){this.actionButton.hideProgress();this.closeContent();},changeEmailFail:function(status){this.actionButton.hideProgress();var name="email_change";var title="Error Updating Email";var message=status.message;this.fireEvent("showAlert",name,title,message);},onShow:function(){this.focus();},focus:function(){this.emailInput.focus.delay(500,this.emailInput);}});var PasswordChangePopupContent=new Class({Extends:PopupContent,strings:{passwordLabel:"Current Password:",newPasswordLabel:"New Password:",verifyPasswordLabel:"Verify Password:"},onInit:function(){this.passwordInput=new Element("input",{"type":"password","maxlength":"50"});new Element("div",{"class":"input_section passwordChange"}).adopt(new Element("div",{"class":"label light","text":this.strings.passwordLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.passwordInput)).inject(this.content);this.newPasswordInput=new Element("input",{"type":"password","maxlength":"50"});new Element("div",{"class":"input_section passwordChange"}).adopt(new Element("div",{"class":"label light","text":this.strings.newPasswordLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.newPasswordInput)).inject(this.content);this.verifyPasswordInput=new Element("input",{"type":"password","maxlength":"50"});new Element("div",{"class":"input_section passwordChange"}).adopt(new Element("div",{"class":"label light","text":this.strings.verifyPasswordLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.verifyPasswordInput)).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Change Password",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.changePassword.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.actionButton),$(this.closeButton)).inject(this.content);},changePassword:function(){var password=this.passwordInput.value.trim();var newPassword=this.newPasswordInput.value.trim();var verifyPassword=this.verifyPasswordInput.value.trim();var params={password:password,new_password:newPassword,verify_password:verifyPassword};this.call("pipio","user_password_change",params,this.changePasswordSuccess.bind(this),this.changePasswordFail.bind(this));this.actionButton.showProgress();},changePasswordSuccess:function(){this.actionButton.hideProgress();var name="email_change";var title="Password Changed";var message="Your Pip.io password has been updated";this.fireEvent("showAlert",name,title,message);this.closeContent();},changePasswordFail:function(status){this.actionButton.hideProgress();var name="email_change";var title="Error Updating Email";var message=status.message;this.fireEvent("showAlert",name,title,message);},onShow:function(){this.focus();},focus:function(){this.passwordInput.focus.delay(500,this.passwordInput);}});var PipioSettingsPopupContent=new Class({Extends:PopupContent,EventHandlers:["emailBlockUpdated","userEmailUpdated"],strings:{settingsMessage:"Change your Pip.io settings",accountSectionLabel:"Account Settings",emailSectionLabel:"Email Settings",generalEmailLabel:"Pip.io service updates:",postReplyEmailLabel:"Reply notifications:",targetedPostEmailLabel:"Targeted post notifications:",contactRequestEmailLabel:"Contact request notifications:",roomInviteEmailLabel:"Room invite notifications:"},onInit:function(){new Element("div",{"class":"text_section centered light","text":this.strings.settingsMessage}).inject(this.content);new Element("div",{"class":"text_section light","text":this.strings.accountSectionLabel}).inject(this.content);var emailChangeButton=new ButtonSmall({displayName:"Update Email",className:"dark",action:"edit"});$(emailChangeButton).addEvent("click",this.showEmailChangePopup.bind(this));this.emailLabel=new Element("div",{"class":"label light2","text":this.getPrivateUser().email});new Element("div",{"class":"input_section"}).adopt(this.emailLabel,$(emailChangeButton)).inject(this.content);var passwordChangeButton=new ButtonSmall({displayName:"Change Password",className:"dark",action:"lock"});$(passwordChangeButton).addEvent("click",this.showPasswordChangePopup.bind(this));new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light2","text":"**********"}),$(passwordChangeButton)).inject(this.content);new Element("div",{"class":"text_section light","text":this.strings.emailSectionLabel}).inject(this.content);this.generalEmailToggle=new Toggle(true);$(this.generalEmailToggle).addEvent("click",this.updateBlock.bind(this,[18,this.generalEmailToggle]));new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light2","text":this.strings.generalEmailLabel}),$(this.generalEmailToggle)).inject(this.content);this.postReplyEmailToggle=new Toggle(true);$(this.postReplyEmailToggle).addEvent("click",this.updateBlock.bind(this,[9,this.postReplyEmailToggle]));new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light2","text":this.strings.postReplyEmailLabel}),$(this.postReplyEmailToggle)).inject(this.content);this.targetedPostEmailToggle=new Toggle(true);$(this.targetedPostEmailToggle).addEvent("click",this.updateBlock.bind(this,[14,this.targetedPostEmailToggle]));new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light2","text":this.strings.targetedPostEmailLabel}),$(this.targetedPostEmailToggle)).inject(this.content);this.contactRequestEmailToggle=new Toggle(true);$(this.contactRequestEmailToggle).addEvent("click",this.updateBlock.bind(this,[5,this.contactRequestEmailToggle]));new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light2","text":this.strings.contactRequestEmailLabel}),$(this.contactRequestEmailToggle)).inject(this.content);this.roomInviteEmailToggle=new Toggle(true);$(this.roomInviteEmailToggle).addEvent("click",this.updateBlock.bind(this,[11,this.roomInviteEmailToggle]));new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light2","text":this.strings.roomInviteEmailLabel}),$(this.roomInviteEmailToggle)).inject(this.content);this.actionButton=new ButtonMedium({displayName:"Done",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.closeContent.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.actionButton)).inject(this.content);this.loadBlocks();},userEmailUpdated:function(data){if(!$defined(data.email)){return;}this.emailLabel.set("text",data.email);},loadBlocks:function(){this.call("pipio","emailblock_load",null,this.loadBlocksSuccess.bind(this));},loadBlocksSuccess:function(data){if(!$defined(data.blocks)){return;}data.blocks.each(function(block){this.updateBlockToggle(block.email_type,block.blocked);},this);},emailBlockUpdated:function(data){if(!$defined(data.email_type)||!$defined(data.blocked)){return;}this.updateBlockToggle(data.email_type,data.blocked);},updateBlockToggle:function(email_type,blocked){switch(email_type){case 5:this.contactRequestEmailToggle.set(blocked==0);break;case 9:this.postReplyEmailToggle.set(blocked==0);break;case 11:this.roomInviteEmailToggle.set(blocked==0);break;case 14:this.targetedPostEmailToggle.set(blocked==0);break;case 18:this.generalEmailToggle.set(blocked==0);break;}},updateBlock:function(email_type,toggle){var enabled=toggle.toInt();var blocked=(enabled==1)?0:1;var params={email_type:email_type,blocked:blocked};this.call("pipio","emailblock_update",params);},onClose:function(){this.closeEmailChangePopup();},showEmailChangePopup:function(){this.closeEmailChangePopup();this.emailChangePopup=new Popup({size:{x:350,y:74},resizable:false,dockable:false,className:"settings",onClose:this.destroyEmailChangePopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"settings"},displayName:"Update Your Email",closable:true});var content=new EmailChangePopupContent();this.emailChangePopup.addContent("pipio_settings",nav,content);},closeEmailChangePopup:function(){if($defined(this.emailChangePopup)){this.emailChangePopup.close();}},destroyEmailChangePopup:function(){this.emailChangePopup=null;},showPasswordChangePopup:function(){this.closePasswordChangePopup();this.passwordChangePopup=new Popup({size:{x:350,y:142},resizable:false,dockable:false,className:"settings",onClose:this.destroyPasswordChangePopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"settings"},displayName:"Change Your Password",closable:true});var content=new PasswordChangePopupContent();this.passwordChangePopup.addContent("pipio_settings",nav,content);},closePasswordChangePopup:function(){if($defined(this.passwordChangePopup)){this.passwordChangePopup.close();}},destroyPasswordChangePopup:function(){this.passwordChangePopup=null;}});var ShareBox=new Class({Extends:Base,EventHandlers:["userSwitched","shareBoxShow","replyShareBoxShow","forwardShareBoxShow","roomShareBoxShow"],init:function(){this.shareboxes=$H();},userSwitched:function(){if(!this.isLoggedIn()){this.userLoggedOut();}},userLoggedOut:function(){this.shareboxes.each(function(sharebox,key){sharebox.close();this.shareboxes.erase(key);},this);this.shareboxes=$H();},forwardShareBoxShow:function(forward_id,username,forward_body){if($defined(this.sharebox)){this.sharebox.close();}this.createForwardShareBox(forward_id,username,forward_body);},createForwardShareBox:function(forward_id,username,forward_body){this.sharebox=new Popup({size:{x:500,y:160},resizable:false,dockable:false,className:"sharebox",onClose:this.destroyShareBox.bind(this)});var displayName="Forward a Post";var nav=new Nav({iconOptions:{user:this.getPrivateUser()},displayName:displayName,closable:true});var forward_user=this.getUser(username);if(!$defined(forward_user)){forward_user=this.getRoom(username);}var content=new ShareBoxPopupContent({user:this.getPrivateUser(),forward_id:forward_id,forward_user:forward_user,forward_body:forward_body});this.sharebox.addContent("sharebox",nav,content);},replyShareBoxShow:function(reply_id){if($defined(this.sharebox)){this.sharebox.close();}this.createReplyShareBox(reply_id);},createReplyShareBox:function(reply_id){this.sharebox=new Popup({size:{x:500,y:160},resizable:false,dockable:false,className:"sharebox",onClose:this.destroyShareBox.bind(this)});var displayName="Reply to a Post";var nav=new Nav({iconOptions:{user:this.getPrivateUser()},displayName:displayName,closable:true});var content=new ShareBoxPopupContent({user:this.getPrivateUser(),reply_id:reply_id});this.sharebox.addContent("sharebox",nav,content);},shareBoxShow:function(user){if($defined(this.sharebox)){this.sharebox.close();}this.createShareBox(user);},createShareBox:function(user){this.sharebox=new Popup({size:{x:500,y:160},resizable:false,dockable:false,className:"sharebox",onClose:this.destroyShareBox.bind(this)});var displayName=(user.user_id==this.getPrivateUser().user_id)?"Write in Your Stream":"Write in "+user.first_name+"'s Stream";var nav=new Nav({iconOptions:{user:user},displayName:displayName,closable:true});var content=new ShareBoxPopupContent({user:user});this.sharebox.addContent("sharebox",nav,content);},destroyShareBox:function(name){this.sharebox=null;},roomShareBoxShow:function(room){if($defined(this.sharebox)){this.sharebox.close();}this.createRoomShareBox(room);},createRoomShareBox:function(room){this.sharebox=new Popup({size:{x:500,y:160},resizable:false,dockable:false,className:"sharebox",onClose:this.destroyShareBox.bind(this)});var displayName="Write in "+room.room_name+"'s Stream";var nav=new Nav({iconOptions:{user:room},displayName:displayName,closable:true});var content=new ShareBoxPopupContent({room:room});this.sharebox.addContent("sharebox",nav,content);}});var AttachLinkPopupContent=new Class({Extends:PopupContent,defaultText:"Please enter the URL below",errorText:"The URL you entered is invalid",validText:"Click attach to add this link to your post",onBeforeInit:function(options){this.attachFunc=options.attachFunc;return options;},onInit:function(){this.valid=false;this.url="";this.text=new Element("div",{"class":"help_text light","text":this.defaultText}).inject(this.content);this.input=new Element("input",{"type":"text","value":"http://","maxlength":200});this.input.addEvent("change",this.validate.bind(this));this.input.addEvent("keyup",this.validate.bindWithEvent(this));new Element("div",{"class":"textarea_wrapper"}).adopt(this.input).inject(this.content);this.attachButton=new ButtonMedium({displayName:"Attach",className:"dark",action:"check"});$(this.attachButton).addEvent("click",this.attach.bind(this));$(this.attachButton).inject(this.content);},onShow:function(){this.focus();},focus:function(){this.input.focus.delay(500,this.input);},validate:function(e){if(e&&e.key=="enter"){this.attach();return;}this.url=this.input.value.trim();if(DataUtility.validateUrl(this.url)){this.text.removeClass("error");this.text.addClass("success");this.text.set("text",this.validText);this.valid=true;}else{this.text.removeClass("success");this.text.addClass("error");this.text.set("text",this.errorText);this.valid=false;}},attach:function(){if(!this.valid){return;}var attachment={type:AttachmentType.Link,text:this.url,url:this.url};this.attachFunc(attachment);this.closeContent();}});var AttachPhotoPopupContent=new Class({Extends:PopupContent,defaultText:"Please choose a photo",errorText:"The file you selected is not a photo",validText:"Click attach to add this photo to your post",onBeforeInit:function(options){this.attachFunc=options.attachFunc;return options;},onInit:function(){this.valid=false;this.url="";this.text=new Element("div",{"class":"help_text light","text":this.defaultText}).inject(this.content);this.input=new Element("input",{"type":"text","value":"click to choose a file"});this.fileInput=new Element("input",{"type":"file","name":"file"});this.form=new Element("form").adopt(this.fileInput);this.fileInput.addEvent("change",this.validate.bind(this));new Element("div",{"class":"textarea_wrapper"}).adopt(this.input,this.form).inject(this.content);this.attachButton=new ButtonMedium({displayName:"Attach",className:"dark",action:"check"});$(this.attachButton).addEvent("click",this.attach.bind(this));$(this.attachButton).inject(this.content);},validate:function(){Logger().log("validating file");if(DataUtility.validatePhotoFile(this.fileInput.value)){this.text.removeClass("error");this.text.addClass("success");this.text.set("text",this.validText);this.input.value=this.fileInput.value;this.valid=true;}else{this.text.removeClass("success");this.text.addClass("error");this.text.set("text",this.errorText);this.input.value="click to choose a file";this.valid=false;}},attach:function(){if(!this.valid){return;}this.form.inject("hidden");var attachment={type:AttachmentType.Photo,text:this.fileInput.value};this.attachFunc(attachment,this.form);this.closeContent();}});var AttachmentType={None:0,Photo:1,Link:2};var ShareBoxPopupContent=new Class({Extends:PopupContent,onBeforeInit:function(options){if($defined(options.user)){this.user=options.user;this.isRoom=false;this.source_id=this.user.user_id;}else{this.user=options.room;this.isRoom=true;this.source_id=this.user.room_id;}this.reply_id=options.reply_id||0;this.source_type=(this.isRoom)?3:1;this.forward_id=options.forward_id||0;this.forward_user=options.forward_user;this.forward_body=options.forward_body;if(this.source_id!=this.getPrivateUser().user_id||!$defined(this.forward_user)){this.forward_id=0;}this.is_forward=this.forward_id!=0;this.is_reply=this.reply_id!=0;this.is_direct=this.source_id!=this.getPrivateUser().user_id;return options;},reset:function(){Logger().log("resetting");this.closeContactPickerPopup();this.closeAttachmentPopup();this.content.empty();this.onInit();},onInit:function(){this.targetContacts=$H();this.targetGroups=$H();this.targetContactEls=$H();this.targetGroupEls=$H();this.targetAllContacts=false;this.allContactsEl=null;this.formEl=null;this.isPublic=true;this.readyToPost=false;this.attachment={type:AttachmentType.None};this.channel_id=0;this.res=this.getSession();if(!this.is_direct&&!this.is_reply){this.privateButton=new ButtonSmall({displayName:"Private",className:"privacy red",action:"lock dark"});$(this.privateButton).addEvent("click",this.togglePrivacy.bind(this));$(this.privateButton).inject(this.content);this.publicButton=new ButtonSmall({displayName:"Public",className:"privacy green",action:"broadcast dark"});$(this.publicButton).addEvent("click",this.togglePrivacy.bind(this));$(this.publicButton).inject(this.content);this.addRecipientButton=new ButtonSmall({displayName:"Add Recipient",className:"dark",action:"status dark"});$(this.addRecipientButton).addEvent("click",this.showContactPickerPopup.bind(this));var selfRecip=new Element("div",{"class":"target self"});var icon=new Icon20({user:this.getPrivateUser()});$(icon).inject(selfRecip);selfRecip.adopt(new Element("div",{"class":"target_text text11 light","text":"Yourself"}));this.norecipients=new Element("div",{"class":"recipients","text":"Everyone can view this post"}).inject(this.content);this.recipients=new Element("div",{"class":"recipients"}).adopt(new Element("div",{"class":"target","text":"To: "}),selfRecip,$(this.addRecipientButton),new Element("div",{"style":"clear: both"})).inject(this.content);this.setPrivacyView();}else{if(this.is_direct){this.norecipients=new Element("div",{"class":"recipients","text":"Everyone can view this post"}).inject(this.content);}else{this.norecipients=new Element("div",{"class":"recipients","text":"All recipients of the original can view this post"}).inject(this.content);}}this.input=new Element("textarea",{"maxlength":2000});this.input.addEvent("keydown",this.inputKeyUp.bindWithEvent(this));new Element("div",{"class":"textarea_wrapper"}).adopt(this.input).inject(this.content);this.linkButton=new ButtonSmall({displayName:"Link",className:"dark",action:"link"});$(this.linkButton).addEvent("click",this.showAttachmentPopup.bind(this,["link"]));this.photoButton=new ButtonSmall({displayName:"Photo",className:"dark",action:"photo"});$(this.photoButton).addEvent("click",this.showAttachmentPopup.bind(this,["photo"]));this.fileButton=new ButtonSmall({displayName:"File",className:"dark",action:"file"});this.attachments=new Element("div",{"class":"attachments"}).inject(this.content);this.attachmentSelect=new Element("div").adopt(new Element("div",{"class":"attachment_text light","text":"Attach:"}),$(this.linkButton),$(this.photoButton)).inject(this.attachments);this.attachmentItems=new Element("div").inject(this.attachments);this.cancelButton=new ButtonMedium({displayName:"Close",className:"dark",action:"cross"});$(this.cancelButton).addEvent("click",this.closeContent.bind(this));this.updateButton=new ButtonMedium({displayName:"Post",className:"dark",action:"check"});$(this.updateButton).addEvent("click",this.post.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.updateButton),$(this.cancelButton)).inject(this.content);this.focus();if(this.forward_id!=0){this.attachForward();}},setPrivacyView:function(){if(this.isPublic){DomUtility.show(this.publicButton);DomUtility.hide(this.privateButton);DomUtility.show(this.norecipients);DomUtility.hide(this.recipients);}else{DomUtility.hide(this.publicButton);DomUtility.show(this.privateButton);DomUtility.hide(this.norecipients);DomUtility.show(this.recipients);}},togglePrivacy:function(){if(this.isPublic){this.showContactPickerPopup();}else{this.closeContactPickerPopup();}this.isPublic=!this.isPublic;this.setPrivacyView();},inputKeyUp:function(e){if(e.shift&&e.key=="enter"){e.preventDefault();this.post();}if(DomUtility.textareaAutoSize(e.target,40)){this.updateSize();}},updateSize:function(){var h=(this.isPublic)?this.norecipients.getSize().y:this.recipients.getSize().y;h+=this.input.getSize().y+10;h+=this.attachments.getSize().y+20;h+=this.actions.getSize().y+30;this.resizePopup(500,h);},parseTargets:function(){if(this.isPublic){return"";}var targets=[this.getPrivateUser().user_id];if(this.targetAllContacts){this.getContacts().each(function(user){targets.include(user.user_id);},this);return targets.join(",");}this.targetGroups.each(function(group){var contacts=this.getContactsByGroup(group.group_id);contacts.each(function(user){targets.include(user.user_id);},this);},this);this.targetContacts.each(function(user){targets.include(user.user_id);},this);return targets.join(",");},post:function(){var targets=this.parseTargets();var body=this.input.value.trim();var is_public=(this.isPublic)?1:0;Logger().log(targets);Logger().log(body);if(this.forward_id==0){if(body==""&&this.attachment.type==AttachmentType.None){this.fireEvent("showAlert","empty_post","Problem Posting","Please enter some content to post.");return;}var params={"body":body,"targets":targets,"source_id":this.source_id,"source_type":this.source_type,"reply_id":this.reply_id,"channel_id":this.channel_id,"is_public":is_public,"res":this.res,"attachment":JSON.encode(this.attachment)};this.call("home","publish",params,this.postSuccess.bind(this),this.postFail.bind(this),this.formEl);}else{var params={"body":body,"targets":targets,"source_id":this.source_id,"source_type":this.source_type,"forward_id":this.forward_id,"channel_id":this.channel_id,"is_public":is_public,"res":this.res};this.call("home","forward",params,this.postSuccess.bind(this),this.postFail.bind(this));}this.updateButton.showProgress();},postSuccess:function(){this.updateButton.hideProgress();this.closeContent();},postFail:function(){this.updateButton.hideProgress();},addAllContacts:function(){if(this.isPublic||$defined(this.allContactsEl)){return;}var el=ShareBoxUtility.createAllContactsItem();el.addEvent("click",this.removeAllContacts.bind(this));el.inject($(this.addRecipientButton),"before");this.allContactsEl=el;this.targetAllContacts=true;this.updateSize();},removeAllContacts:function(){if(!$defined(this.allContactsEl)){return;}this.allContactsEl.destroy();this.targetAllContacts=false;this.updateSize();},addTargetGroup:function(group){if(this.isPublic||this.targetGroupEls.has(group.group_id)){return;}var el=ShareBoxUtility.createGroupItem(group);el.addEvent("click",this.removeTargetGroup.bind(this,[group.group_id]));el.inject($(this.addRecipientButton),"before");this.targetGroupEls.set(group.group_id,el);this.targetGroups.set(group.group_id,group);this.updateSize();},removeTargetGroup:function(group_id){if(!this.targetGroupEls.has(group_id)){return;}this.targetGroupEls.get(group_id).destroy();this.targetGroupEls.erase(group_id);this.targetGroups.erase(group_id);this.updateSize();},addTargetContact:function(user){if(this.isPublic||this.targetContactEls.has(user.username)){return;}var el=ShareBoxUtility.createContactItem(user);el.addEvent("click",this.removeTargetContact.bind(this,[user.username]));el.inject($(this.addRecipientButton),"before");this.targetContactEls.set(user.username,el);this.targetContacts.set(user.username,user);this.updateSize();},removeTargetContact:function(username){if(!this.targetContactEls.has(username)){return;}this.targetContactEls.get(username).destroy();this.targetContactEls.erase(username);this.targetContacts.erase(username);this.updateSize();},showContactPickerPopup:function(){if($defined(this.contactPicker)){this.contactPicker._select();return;}this.createContactPickerPopup();},closeContactPickerPopup:function(){if($defined(this.contactPicker)){this.contactPicker.close();}},createContactPickerPopup:function(){this.contactPicker=new Popup({size:{x:200,y:350},resizable:false,dockable:false,className:"contactPicker",onClose:this.destroyContactPickerPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"users"},displayName:"Select Recipients",closable:true});var content=new ContactPickerPopupContent({groups:this.getGroups(),contacts:this.getContacts(),groupAddFunc:this.addTargetGroup.bind(this),contactAddFunc:this.addTargetContact.bind(this),allContactsAddFunc:this.addAllContacts.bind(this)});this.contactPicker.addContent("contactPicker",nav,content);},destroyContactPickerPopup:function(){this.contactPicker=null;},showAttachmentPopup:function(type){if($defined(this.attachmentPopup)){if(this.attachmentPopupType==type){this.attachmentPopup._select();return;}else{this.closeAttachmentPopup();}}this.createAttachmentPopup(type);},closeAttachmentPopup:function(){if($defined(this.attachmentPopup)){this.attachmentPopup.close();}},createAttachmentPopup:function(type){var popupClass;var typeName;switch(type){case"link":popupClass=AttachLinkPopupContent;typeName="Link";break;case"photo":popupClass=AttachPhotoPopupContent;typeName="Photo";break;}this.attachmentPopup=new Popup({size:{x:400,y:74},resizable:false,dockable:false,className:"attachments",onClose:this.destroyAttachmentPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:type},displayName:"Attach "+typeName,closable:true});var content=new popupClass({attachFunc:this.attachContent.bind(this)});this.attachmentPopupType=type;this.attachmentPopup.addContent("attachment",nav,content);},destroyAttachmentPopup:function(){this.attachmentPopup=null;this.attachmentPopupType=null;},attachForward:function(){DomUtility.show(this.attachmentItems);DomUtility.hide(this.attachmentSelect);var attachElement=ShareBoxUtility.createForwardAttachmentItem(this.forward_user,this.forward_body);attachElement.inject(this.attachmentItems);},attachContent:function(attachment,formEl){this.attachment=attachment;if($defined(formEl)){this.formEl=formEl;}Logger().log("attached "+this.formEl);DomUtility.show(this.attachmentItems);DomUtility.hide(this.attachmentSelect);var attachElement=ShareBoxUtility.createAttachmentItem(attachment);var removeButton=new ButtonSmall({displayName:"Remove",className:"dark",action:"cross"});$(removeButton).addEvent("click",this.removeAttachment.bind(this));$(removeButton).inject(attachElement);attachElement.inject(this.attachmentItems);},removeAttachment:function(){this.attachment=null;this.attachmentItems.empty();if($defined(this.formEl)){this.formEl.destroy();}this.formEl=null;DomUtility.hide(this.attachmentItems);DomUtility.show(this.attachmentSelect);this.forward_id=0;},onShow:function(){this.focus();},focus:function(){this.input.focus.delay(500,this.input);}});var ShareBoxUtility={createContactRoomInviteItem:function(user){var el=new Element("div",{"class":"listItem"});var icon=new Icon20({user:user});$(icon).inject(el);new Element("div",{"class":"listText text12 light","text":TextUtility.cleanText(user.fullname)}).inject(el);el.set("val1",user.fullname.toLowerCase());el.set("val2",user.last_name.toLowerCase());var button=new ButtonSmall({displayName:"Invite",className:"dark",action:"check"});$(button).inject(el);new Element("div",{"class":"invited_text text11 success","text":"Invited"}).inject(el);return el;},createContactPickerItem:function(user){var el=new Element("div",{"class":"listItem"});var icon=new Icon20({user:user});$(icon).inject(el);new Element("div",{"class":"listText text12 light","text":TextUtility.cleanText(user.fullname)}).inject(el);el.set("val1",user.fullname.toLowerCase());el.set("val2",user.last_name.toLowerCase());return el;},createGroupPickerItem:function(group){var el=new Element("div",{"class":"listItem"});var icon=new Icon20({iconName:"group"});$(icon).inject(el);new Element("div",{"class":"listText text12 light","text":TextUtility.cleanText(group.name)}).inject(el);el.set("val1",group.name.toLowerCase());return el;},createAllContactsPickerItem:function(){var el=new Element("div",{"class":"listItem"});var icon=new Icon20({iconName:"contacts"});$(icon).inject(el);new Element("div",{"class":"listText text12 light","text":"All Contacts"}).inject(el);el.set("val1","all contacts");return el;},createContactItem:function(user){var el=new Element("div",{"class":"target"});var icon=new Icon20({user:user});$(icon).inject(el);el.adopt(new Element("div",{"class":"target_text text11 light","text":TextUtility.cleanText(user.first_name)}),new Element("div",{"class":"action cross"}));return el;},createGroupItem:function(group){var el=new Element("div",{"class":"target"});var icon=new Icon20({iconName:"group"});$(icon).inject(el);el.adopt(new Element("div",{"class":"target_text text11 light","text":TextUtility.cleanText(group.name)}),new Element("div",{"class":"action cross"}));return el;},createAllContactsItem:function(){var el=new Element("div",{"class":"target"});var icon=new Icon20({iconName:"contacts"});$(icon).inject(el);el.adopt(new Element("div",{"class":"target_text text11 light","text":"All Contacts"}),new Element("div",{"class":"action cross"}));return el;},createForwardAttachmentItem:function(forward_user,forward_body){var el=new Element("div",{"class":"attachment"});var name=($defined(forward_user.user_id))?forward_user.fullname:forward_user.room_name;el.adopt(new Element("span",{"class":"indicator","html":"&raquo;"}),new Element("span",{"class":"attachment_title light2"}).adopt(new Element("span",{"text":"Forwarding: "}),new Element("span",{"class":"user_name","text":TextUtility.unescape(name)}),new Element("span",{"text":" "+TextUtility.unescape(forward_body)})));return el;},createAttachmentItem:function(attachment){var el=new Element("div",{"class":"attachment"});el.adopt(new Element("span",{"class":"indicator","html":"&raquo;"}),new Element("span",{"class":"attachment_title light2","text":attachment.text}));return el;}};var UI=new Class({Extends:Base,EventHandlers:["userSwitched","viewSwitch","menuAdd","contentAdd","menuClose","contentClose","appClose","showUser","showRoom","showConvo","showGlobal","showConfirmation","showAlert","showVideoPopup","showPhotoPopup","showPipioUpdatePopup","showSearchRoomPopup"],init:function(){this.historyManager=new HistoryManager();this.historyManager.addEvent("onHistoryChange",this.historyChanged.bind(this));this.history=$H();this.navScrollBar=new ScrollBar("nav","nav_wrapper");this.idleTimeout=10*60*1000;this.updateTimestamps.periodical(1000*90,this);this.menus=$H();this.contents=$H();this.confirms=$H();this.alerts=$H();this.reset();},reset:function(){this.currentMenu=null;this.currentContent=null;},userSwitched:function(){if(this.isLoggedIn()){this.userLoggedIn();}else{this.userLoggedOut();}},userLoggedIn:function(){this.reset();this.setCurrentUser();this.toggleHeader(true);},userLoggedOut:function(){this.reset();this.resetCurrentUser();this.toggleHeader(false);},appClose:function(app){this.contents.each(function(content,key){var appId=key.split("_",1)[0];if(appId==app){this.contentCloseKey(key);}},this);this.menus.each(function(menu,key){var appId=key.split("_",1)[0];if(appId==app){this.menuCloseKey(key);}},this);},viewSwitch:function(appId,contentName,menuName){var menuKey=appId+"_"+menuName;var contentKey=appId+"_"+contentName;if(!this.contents.has(contentKey)){Logger().log("content "+contentName+" not found!");return false;}if($defined(menuName)&&!this.menus.has(menuKey)){Logger().log("menu "+menuName+" not found!");return false;}if($defined(menuName)){this.contentSwitch(contentKey);this.menuSwitch(menuKey);$("content").addClass("hasmenu");}else{this.contentSwitch(contentKey);$("content").removeClass("hasmenu");}this.historyChange(appId,contentName,menuName);return true;},historyChange:function(appId,contentName,menuName){if(parseInt(appId)==appId){var app=this.getAppById(appId);if(!app){return;}var hash=app.name+"/"+contentName;this.history.set(hash,{appId:appId,contentName:contentName,menuName:menuName});this.historyManager.addState(hash);}else{var appParts=appId.split("_");var appName=appParts[0];var appParam=appParts[1];var hash=appName+"/"+appParam+"/"+contentName;this.history.set(hash,{appId:appId,contentName:contentName,menuName:menuName});this.historyManager.addState(hash);}},historyChanged:function(hash){Logger().log("historyChanged - "+hash);if(this.history.has(hash)){var state=this.history.get(hash);var found=this.viewSwitch(state.appId,state.contentName,state.menuName);if(!found){window.history.back();}}},menuAdd:function(appId,menuName,menu){var menuKey=appId+"_"+menuName;Logger().log("adding menu "+menuKey);if(this.menus.has(menuKey)){return;}$(menu).inject("menu_wrapper");menu.off();this.menus.set(menuKey,menu);},menuClose:function(appId,menuName){var menuKey=appId+"_"+menuName;this.menuCloseKey(menuKey);},menuCloseKey:function(key){if(!this.menus.has(key)){return;}if(key==this.currentMenu){this.currentMenu=null;}var menu=this.menus.get(key);menu.destroy();this.menus.erase(key);delete (menu);},contentAdd:function(appId,contentName,content){var contentKey=appId+"_"+contentName;Logger().log("adding content "+contentKey);if(this.contents.has(contentKey)){return;}$(content).inject("content_wrapper");content.off();this.contents.set(contentKey,content);},contentClose:function(appId,contentName){var contentKey=appId+"_"+contentName;this.contentCloseKey(contentKey);if(!$defined(this.currentContent)){window.history.back();}},contentCloseKey:function(key){Logger().log(key);if(!this.contents.has(key)){return;}if(key==this.currentContent){this.currentContent=null;}var content=this.contents.get(key);content.destroy();this.contents.erase(key);delete (content);},menuSwitch:function(menuKey){if(!this.menus.has(menuKey)){return;}if(menuKey==this.currentMenu){return;}if($defined(this.currentMenu)){this.menus.get(this.currentMenu).off();}this.menus.get(menuKey).on();this.currentMenu=menuKey;},contentSwitch:function(contentKey){if(!this.contents.has(contentKey)){return;}if(contentKey==this.currentContent){return;}if($defined(this.currentContent)){this.contents.get(this.currentContent).off();}this.contents.get(contentKey).on();this.fireEvent("contentSwitched",contentKey);this.currentContent=contentKey;},toggleHeader:function(loggedIn){if(loggedIn){DomUtility.show("self");$("header").get("tween").start("left",201).chain(function(){$("self").setStyle("z-index",6);$("header_loggedOut").get("tween").start("top",-36).chain(function(){$("header_loggedIn").get("tween").start("top",0);});});$("nav_wrapper").get("tween").start("left",0);$("content").get("tween").start("left",201);$("dock").inject("dock_loggedIn");}else{$("self").setStyle("z-index",4);$("header").get("tween").start("left",0).chain(function(){DomUtility.hide("self");$("header_loggedIn").get("tween").start("top",-36).chain(function(){$("header_loggedOut").get("tween").start("top",0);});});$("nav_wrapper").get("tween").start("left",-210);$("content").get("tween").start("left",0);$("dock").inject("dock_loggedOut");}},setCurrentUser:function(){$("self_name").set("text",this.getPrivateUser().fullname);$("self_profile_pic_26").set("src",this.getPrivateUser().profile_pic_26);$("self_profile_pic_26").addClass("profile_pic_26_"+this.getPrivateUser().username);$("self_online_status").addClass("online_status_"+this.getPrivateUser().username);},resetCurrentUser:function(){$("self_name").set("text","");$("self_profile_pic_26").set("src","");$("self_profile_pic_26").set("class","profile_pic");$("self_online_status").set("class","online_status");},showUser:function(user){var options={user:user};this.fireEvent("startAppInstance","user",user.username,options);},showRoom:function(room){var options={room:room};this.fireEvent("startAppInstance","room",room.username,options);},showGlobal:function(location){var options={location:location};var geohash=location.geohash.substring(0,6);this.fireEvent("startAppInstance","global",geohash,options);},showConvo:function(){},showConfirmation:function(name,title,message,confirmFunc){if(this.confirms.has(name)){this.confirms.get(name)._select();return;}this.createConfirmation(name,title,message,confirmFunc);},createConfirmation:function(name,title,message,confirmFunc){var popup=new Popup({size:{x:350,y:100},resizable:false,dockable:false,className:"confirm",onClose:this.destroyConfirmation.bind(this,[name])});var nav=new Nav({iconOptions:{iconName:"info"},displayName:title,closable:true});var content=new ConfirmPopupContent({confirmMessage:message,confirmFunc:confirmFunc});popup.addContent("confirm",nav,content);this.confirms.set(name,popup);},destroyConfirmation:function(name){this.confirms.erase(name);},showAlert:function(name,title,message){if(this.alerts.has(name)){this.alerts.get(name)._select();return;}this.createAlert(name,title,message);},createAlert:function(name,title,message){var popup=new Popup({size:{x:350,y:100},resizable:false,dockable:false,className:"confirm",onClose:this.destroyAlert.bind(this,[name])});var nav=new Nav({iconOptions:{iconName:"info"},displayName:title,closable:true});var content=new AlertPopupContent({alertMessage:message});popup.addContent("confirm",nav,content);this.alerts.set(name,popup);},destroyAlert:function(name){this.alerts.erase(name);},updateTimestamps:function(){$$(".timestamp").each(function(el){if($defined(el.get("ts"))){var ts=new Date(el.get("ts"));var format=el.get("ts_format");var timeStr=DateUtility.getTimestamp(ts,format);el.set("text",timeStr);}});}});UI.implement({showVideoPopup:function(attachment){switch(attachment.video_type){case"youtube":this.createYoutubePopup(attachment);break;case"vimeo":this.createVimeoPopup(attachment);break;case"ch":this.createChPopup(attachment);break;case"hulu":this.createHuluPopup(attachment);break;case"break":this.createBreakPopup(attachment);break;}},showPhotoPopup:function(attachment){this.createPhotoPopup(attachment);},createPhotoPopup:function(attachment){var popup=new Popup({size:{x:300,y:100},resizable:false,dockable:false,closable:true,className:"photoViewer"});var displayName=attachment.filename;var nav=new Nav({iconOptions:{iconName:"photo"},displayName:displayName,closable:true});var content=new PhotoPopupContent({attachment:attachment});content.resizePopup=popup.resizePopup.bind(popup);content.reCenter=popup.reCenter.bind(popup);popup.addContent("photo",nav,content);},createYoutubePopup:function(attachment){var popup=new Popup({size:{x:425,y:350},resizable:false,dockable:false,noHide:true,closable:true,className:"videoPlayer"});var displayName="Youtube Video";var nav=new Nav({iconOptions:{iconName:"youtube"},displayName:displayName,closable:true});var content=new YoutubePopupContent({attachment:attachment});popup.addContent("video",nav,content);},createVimeoPopup:function(attachment){var popup=new Popup({size:{x:425,y:350},resizable:false,dockable:false,noHide:true,closable:true,className:"videoPlayer"});var displayName="Vimeo Video";var nav=new Nav({iconOptions:{iconName:"tv"},displayName:displayName,closable:true});var content=new VimeoPopupContent({attachment:attachment});popup.addContent("video",nav,content);},createChPopup:function(attachment){var popup=new Popup({size:{x:425,y:350},resizable:false,dockable:false,noHide:true,closable:true,className:"videoPlayer"});var displayName="College Humor Video";var nav=new Nav({iconOptions:{iconName:"tv"},displayName:displayName,closable:true});var content=new ChPopupContent({attachment:attachment});popup.addContent("video",nav,content);},createBreakPopup:function(attachment){var popup=new Popup({size:{x:425,y:350},resizable:false,dockable:false,noHide:true,closable:true,className:"videoPlayer"});var displayName="Break.com Video";var nav=new Nav({iconOptions:{iconName:"tv"},displayName:displayName,closable:true});var content=new BreakPopupContent({attachment:attachment});popup.addContent("video",nav,content);},createHuluPopup:function(attachment){var popup=new Popup({size:{x:512,y:296},resizable:false,dockable:false,noHide:true,closable:true,className:"videoPlayer"});var displayName="Hulu Video";var nav=new Nav({iconOptions:{iconName:"tv"},displayName:displayName,closable:true});var content=new HuluPopupContent({attachment:attachment});popup.addContent("video",nav,content);},showPipioUpdatePopup:function(version){if($defined(this.updatePopup)){return;}this.updatePopup=popup=new Popup({size:{x:350,y:70},resizable:false,dockable:false,closable:false,className:"login"});var nav=new Nav({iconOptions:{iconName:"pipio"},displayName:"Pip.io Updated",closable:true});var content=new PipioUpdatePopupContent({version:version});this.updatePopup.addContent("update",nav,content);},showSearchRoomPopup:function(){this.closeSearchRoomPopup();this.createSearchRoomPopup();},closeSearchRoomPopup:function(){if($defined(this.searchRoomPopup)){this.searchRoomPopup.close();}},createSearchRoomPopup:function(){this.searchRoomPopup=new Popup({size:{x:350,y:110},resizable:false,dockable:false,className:"roomSearch",onClose:this.destroySearchRoomPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"search"},displayName:"Search for Rooms on Pip.io",closable:true});var content=new RoomSearchPopupContent({});this.searchRoomPopup.addContent("roomSearch",nav,content);},destroySearchRoomPopup:function(){this.searchRoomPopup=null;}});var BreakPopupContent=new Class({Extends:PopupContent,onBeforeInit:function(options){this.attachment=options.attachment;return options;},onInit:function(){this.call("home","parse_break_url",{url:this.attachment.url},this.parseSuccess.bind(this),this.parseFail.bind(this));},parseSuccess:function(data){var swf="http://embed.break.com/"+data.id;var vid=new Swiff(swf,{id:swf,width:425,height:350,params:{movie:swf,allowfullscreen:true}});vid.inject(this.content);},parseFail:function(){this.closeContent();}});var ChPopupContent=new Class({Extends:PopupContent,onBeforeInit:function(options){this.attachment=options.attachment;return options;},onInit:function(){var swf="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id="+this.attachment.vimeoId+"&autoplay=1&fullscreen=1";var vid=new Swiff(swf,{id:swf,width:425,height:350,params:{movie:swf,allowfullscreen:true}});vid.inject(this.content);}});var HuluPopupContent=new Class({Extends:PopupContent,onBeforeInit:function(options){this.attachment=options.attachment;return options;},onInit:function(){this.call("home","parse_hulu_url",{url:this.attachment.url},this.parseSuccess.bind(this),this.parseFail.bind(this));},parseSuccess:function(data){var swf="http://www.hulu.com/embed/"+data.id;var vid=new Swiff(swf,{id:swf,width:512,height:296,params:{movie:swf,allowfullscreen:true}});vid.inject(this.content);},parseFail:function(){this.closeContent();}});var PhotoPopupContent=new Class({Extends:PopupContent,strings:{loadingMessage:"Photo loading..."},onBeforeInit:function(options){this.attachment=options.attachment;return options;},onInit:function(){this.loadingMsg=new Element("div",{"class":"loading_message"}).adopt(new Element("div",{"class":"loading_text light","text":this.strings.loadingMessage}),new Element("div",{"class":"progress"})).inject(this.content);Logger().log(this.attachment.url);this.image=new Asset.image(this.attachment.url,{title:this.attachment.filename,onload:this.photoLoaded.bind(this)});},photoLoaded:function(){var imageW=this.image.width;var imageH=this.image.height;if(imageW>=imageH&&imageW>1000){imageH=(1000/imageW)*imageH;imageW=1000;}else{if(imageW<imageH&&imageH>1000){imageW=(1000/imageH)*imageW;imageH=1000;}}var w=imageW+20;var h=imageH+20;DomUtility.hide(this.loadingMsg);this.image.inject(this.content);this.resizePopup(w,h);this.reCenter();}});var PipioUpdatePopupContent=new Class({Extends:PopupContent,strings:{updateMessage:"A new version of Pip.io (v{0}) is available"},onBeforeInit:function(options){this.version=options.version;return options;},onInit:function(){new Element("div",{"class":"text_section centered light","text":String.format(this.strings.updateMessage,this.version)}).inject(this.content);this.actionButton=new ButtonMedium({displayName:"Reload",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.reload.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.actionButton)).inject(this.content);},reload:function(){this.actionButton.showProgress();window.location="/";}});var VimeoPopupContent=new Class({Extends:PopupContent,onBeforeInit:function(options){this.attachment=options.attachment;return options;},onInit:function(){var swf="http://vimeo.com/moogaloop.swf?clip_id="+this.attachment.vimeoId+"&autoplay=1&fullscreen=1";Logger().log(swf);var vid=new Swiff(swf,{id:swf,width:425,height:350,params:{movie:swf,allowfullscreen:true}});vid.inject(this.content);}});var YoutubePopupContent=new Class({Extends:PopupContent,onBeforeInit:function(options){this.attachment=options.attachment;return options;},onInit:function(){var swf="http://www.youtube.com/v/"+this.attachment.youtubeId+"&rel=1&autoplay=1";var vid=new Swiff(swf,{id:swf,width:425,height:350,params:{movie:swf,allowfullscreen:true}});vid.inject(this.content);}});var VideoChat=new Class({Extends:Base,EventHandlers:["userSwitched","videoChatStart","videoChatReset","videoChatEnd","videoChatRequestReceived","videoChatRequestAccepted","videoChatAccept"],init:function(){window.sim=new VideoChatInterface();this.callTimeout=0;this.createVideoChatPopup();},userSwitched:function(){if(this.isLoggedIn()){this.userLoggedIn();}else{this.userLoggedOut();}},userLoggedIn:function(){window.sim.ChatReady();},userLoggedOut:function(){window.sim.ChatNotReady();},videoChatStart:function(user){if(!this.videoEnabled()){var name="video_chat";var title="Unable to Start Video Conference";var message="Your system does not support video conferencing";this.fireEvent("showAlert",name,title,message);return;}if(window.sim.SwfState==window.sim.SwfReady){this.fireEvent("sendVideoChatInvite",user);window.sim.CallInitiate(this.getPrivateUser().username,user.username);this.callTimeout=this.videoChatEnd.delay(20000,this);this.showVideoChatPopup(user);}},videoChatAccept:function(user,stratusId){this.showVideoChatPopup(user);window.sim.CallAccept(stratusId,this.getPrivateUser().username,user.username);this.fireEvent("sendVideoChatAccept",user);},videoChatReset:function(){Logger().log("reset video chat");this.popup.close();this.fireEvent("videoChatEnable",true);this.fireEvent("videoInUse",false);this.fireEvent("selfPresenceUpdate");$clear(this.callTimeout);},videoChatEnd:function(){Logger().log("reset video chat");window.sim.CallEnd();this.popup.close();this.fireEvent("videoChatEnable",true);this.fireEvent("videoInUse",false);this.fireEvent("selfPresenceUpdate");$clear(this.callTimeout);},videoChatRequestAccepted:function(username,stratusId){$clear(this.callTimeout);window.sim.CallAccepted(stratusId,username);},videoChatRequestReceived:function(username,stratusId){var user=this.getContact(username);var notif=new VideoChatNotification({user:user,stratusId:stratusId});this.fireEvent("notificationAdd","videoChat_request_"+username,notif);window.sim.CallReceived(username);},showVideoChatPopup:function(user){this.popup.show(user);},createVideoChatPopup:function(){this.popup=new VideoChatPopup({size:{x:400,y:340},resizable:false,dockable:false,noHide:true,closable:false,className:"pipioVideoChat"});var nav=new Nav({iconOptions:{iconName:"video_chat"},displayName:"Video Conference",closable:true});var content=new VideoChatPopupContent({});this.popup.addContent("video_chat",nav,content);}});var VideoChatInterface=new Class({Extends:Base,EventHandlers:[],init:function(){this.flexApp=null;this.SwfState=null;this.SwfError=-1;this.SwfNotLoaded=0;this.SwfLoaded=1;this.SwfNotReady=2;this.SwfReady=3;this.SwfCalling=4;this.SwfRinging=5;this.SwfConnecting=6;this.SwfConnected=7;this.SwfDisconnecting=8;},CallInitiate:function(nearUsername,farUsername){if(this.SwfState==this.SwfReady){this.flexApp.AttachOutgoingStream(nearUsername);this.SwfState=this.SwfCalling;}},CallReceived:function(farUsername){if(this.SwfState==this.SwfReady){this.SwfState=this.SwfRinging;}},CallAccept:function(farID,nearUsername,farUsername){if(this.SwfState==this.SwfRinging){this.SwfState=this.SwfConnecting;this.flexApp.AttachIncomingStream(farID,farUsername);this.flexApp.AttachOutgoingStream(nearUsername);this.SwfState=this.SwfConnected;}},CallReject:function(farUsername){if(this.SwfState==this.SwfRinging){this.SwfState=this.SwfDisconnecting;this.SwfState=this.SwfReady;}},CallAccepted:function(farID,farUsername){if(this.SwfState==this.SwfCalling){this.SwfState=this.SwfConnecting;this.flexApp.AttachIncomingStream(farID,farUsername);this.SwfState=this.SwfConnected;}},CallRejected:function(farID,farUsername){if(this.SwfState==this.SwfCalling){this.SwfState=this.SwfReady;}},CallEnd:function(farUsername){if((this.SwfState==this.SwfCalling)||(this.SwfState==this.SwfConnected)||(this.SwfState==this.SwfConnecting)){this.SwfState=this.SwfDisconnecting;this.flexApp.ClientReset();this.SwfState=this.SwfReady;}},ClientReset:function(){if(this.SwfState>=this.SwfReady){this.CallEnd();}this.flexApp.ClientReset();},GetLog:function(logging){if(this.SwfState>=this.SwfLoaded){if(logging==null){logging=true;}return this.flexApp.GetLog(logging);}},GetFarID:function(){id="";if(this.SwfState>=this.SwfLoaded){id=this.flexApp.GetFarID();}return id;},GetNearID:function(){id="";if(this.SwfState>=this.SwfLoaded){id=this.flexApp.GetNearID();}return id;},SetSpeakerVolume:function(volume){if(this.SwfState!=this.SwfError){if(volume<0){volume=0;}else{if(volume>1){volume=1;}}this.flexApp.SetSpeakerVolume(volume);}},SetMicGain:function(gain){if(this.SwfState!=this.SwfError){if(gain<0){gain=0;}else{if(gain>100){gain=100;}}this.flexApp.SetMicGain(gain);}},AudioMute:function(){if(this.SwfState==this.SwfConnected){this.flexApp.AudioMute();}},AudioStart:function(){if(this.SwfState==this.SwfConnected){this.flexApp.AudioStart();}},AudioToggle:function(){if(this.SwfState==this.SwfConnected){this.flexApp.AudioToggle();}},VideoPause:function(){if(this.SwfState==this.SwfConnected){this.flexApp.VideoPause();}},VideoStart:function(){if(this.SwfState==this.SwfConnected){this.flexApp.VideoStart();}},VideoToggle:function(){if(this.SwfState==this.SwfConnected){this.flexApp.VideoToggle();}},LoginError:function(){this.SwfState=this.SwfError;Logger().log("LoginError()");},LoginNotConnected:function(){this.SwfState=this.SwfNotReady;Logger().log("LoginNotConnected()");},LoginConnecting:function(){this.SwfState=this.SwfNotReady;Logger().log("LoginConnecting()");},LoginConnected:function(){this.SwfState=this.SwfReady;Logger().log("LoginConnected()");Logger().log("Got Stratus ID of "+this.GetNearID());},LoginDisconnecting:function(){this.SwfState=this.SwfNotReady;$("loginstate").fireEvent("burn","LoginDisconnecting()");},ChatError:function(){this.SwfState=this.SwfError;Logger().log("ChatError()");},ChatNotReady:function(){this.SwfState=this.SwfNotReady;Logger().log("ChatNotReady()");},ChatReady:function(){this.SwfState=this.SwfReady;Logger().log("ChatReady()");},ChatInitiated:function(){this.SwfState=this.SwfCalling;Logger().log("ChatInitiated()");},ChatEstablished:function(){this.SwfState=this.SwfConnected;Logger().log("ChatEstablished()");},AudioError:function(){this.SwfState=this.SwfError;Logger().log("AudioError()");},AudioNotReady:function(){this.SwfState=this.SwfNotReady;Logger().log("AudioNotReady()");},AudioReady:function(){Logger().log("AudioReady()");},AudioTransmitting:function(){Logger().log("AudioTransmitting()");},AudioPaused:function(){Logger().log("AudioPaused()");},VideoError:function(){this.SwfState=this.SwfError;Logger().log("VideoError()");},VideoNotReady:function(){this.SwfState=this.SwfNotReady;Logger().log("VideoNotReady()");},VideoReady:function(){Logger().log("VideoReady()");Logger().log("Camera found.");this.fireEvent("videoChatReset");},VideoTransmitting:function(){Logger().log("VideoTransmitting()");},VideoPaused:function(){Logger().log("VideoPaused()");},LogChanged:function(){},VideoChatLoaded:function(){this.SwfState=this.SwfLoaded;this.flexApp=$("videochat");},SpeakerVolumeChanged:function(){},MicGainChanged:function(){}});var VideoChatNotification=new Class({Extends:Notification,onBeforeInit:function(options){this.user=options.user;this.stratusId=options.stratusId;options.iconOptions={user:this.user};options.timeout=15000;options.hasActions=true;return options;},onInit:function(){this.acceptButton=new ButtonSmall({displayName:"Accept",className:"dark",action:"check"});this.ignoreButton=new ButtonSmall({displayName:"Ignore",className:"dark",action:"cross"});$(this.ignoreButton).addEvent("click",this.closeNotification.bind(this));$(this.acceptButton).addEvent("click",this.fireEvent.bind(this,["videoChatAccept",this.user,this.stratusId]));$(this.acceptButton).addEvent("click",this.closeNotification.bind(this));$(this.acceptButton).inject(this.actions);$(this.ignoreButton).inject(this.actions);},getText:function(){var el=new Element("div",{"class":"notification_text text11 light1"}).adopt(new Element("span",{"text":this.user.fullname})).appendText(" invited you to a video conference.");return el;}});var VideoChatPopup=new Class({Extends:Popup,onCreate:function(){this.shown=true;this.close();},close:function(){if(!this.shown){return;}this.left=this.popup.getStyle("left");this.popup.setStyle("left","-5000px");this.shown=false;},show:function(user){if(this.shown){return;}this.setTitleCustom(user);this.popup.setStyle("left",this.left);this.shown=true;this._select();},setTitleCustom:function(user){var nav=this.navs.get(this.currentContent);var icon=new Icon20({user:user});var titleText=new Element("div",{"class":"title_text","text":TextUtility.unescapeQuotes("Video Conference with "+user.fullname)});this.titleIcon=$(icon).replaces(this.titleIcon);this.titleText=titleText.replaces(this.titleText);},resetSwf:function(){this.contents.get(this.currentContent).resetSwf();}});var VideoChatPopupContent=new Class({Extends:PopupContent,onBeforeInit:function(options){options.destroy=false;return options;},onInit:function(){this.videochatWrapper=new Element("div",{"id":"videochatWrapper"}).inject(this.content);this.actions=new Element("div",{"class":"actions"}).inject(this.content);this.endButton=new ButtonMedium({displayName:"End Conference",className:"dark",action:"cross"});$(this.endButton).inject(this.actions);$(this.endButton).addEvent("click",this.fireEvent.bind(this,["videoChatEnd"]));},onShow:function(){this.resetSwf();},resetSwf:function(){var flashvars={bridgeName:"videochat"};var params={menu:"false",allowscriptaccess:"always",play:"true",quality:"high",flashvars:"bridgeName=videochat",allowFullScreen:"true",wmode:"window"};var attributes={id:"videochat",name:"videochat"};swfobject.embedSWF("/swf/VideoChat.swf","videochatWrapper","400","300","10.0.0","expressInstall.swf",flashvars,params,attributes);},onHide:function(){}});var Appstore=new Class({Extends:App,onStart:function(){this.setupNav();},onStop:function(){},userLoggedIn:function(){},userLoggedOut:function(){this.stop();}});Appstore.implement({requests:[{name:"apps_get_all",url:"/api/apps/app/get_all"},{name:"app_create",params:["name","type","likes","state"],url:"/api/apps/app/create"},{name:"app_update",params:["app_id","name","type","likes","state"],url:"/api/apps/app/update"},{name:"app_likes_increment",params:["app_id"],url:"/api/apps/app/increment"},{name:"app_likes_decrement",params:["app_id"],url:"/api/apps/app/decrement"}]});Appstore.implement({setupNav:function(){this.navAdd(new Nav({iconOptions:{iconName:"updates"},displayName:"All Applications",name:"apps",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"apps","apps"])}));var menu=new AppstoreMenu({isDefault:true,closeFunc:this.stop.bind(this)});this.menuAdd("apps",menu);var content=new AppstoreContent({isDefault:true});this.contentAdd("apps",content);}});var AppstoreContent=new Class({Extends:Content,EventHandlers:["appInstalled","appUninstalled"],onBeforeInit:function(options){return options;},onInit:function(){this.loaded=false;this.loader=new ItemLoader({idField:"app_id",sortField:"name",sortAlpha:true,createElementFunc:AppstoreItemUtility.createAppstoreItem,emptyEl:new Element("div",{"class":"post empty","text":"There are no apps to install"}),loadingEl:new Element("div",{"class":"post empty","text":"Applications loading..."})});$(this.loader).inject(this.content);this.appsInstalled=UserUtility.getInstalledApps();},onShow:function(first){if(first){this.call("appstore","apps_get_all",null,this.loadAppsSuccess.bind(this),null);}this.loader.showLoading();},onHide:function(){},loadAppsSuccess:function(data){this.loader.hideLoading();if(!$defined(data.apps)||data.apps.length==0){}data.apps.each(function(app){if($defined(this.appsInstalled[app.app_id])){app.installed=true;}else{app.installed=false;}this.loader.process(app);},this);},appInstalled:function(data){if(!$defined(data.app_id)){return;}if($defined($("appstore_item_"+data.app_id))){$("appstore_item_"+data.app_id).addClass("installed");$("appstore_item_"+data.app_id).removeClass("uninstalled");}},appUninstalled:function(data){if(!$defined(data.app_id)){return;}if($defined($("appstore_item_"+data.app_id))){$("appstore_item_"+data.app_id).removeClass("installed");$("appstore_item_"+data.app_id).addClass("uninstalled");}}});var AppstoreMenu=new Class({Extends:Menu,EventHandlers:[],onBeforeInit:function(options){options.displayName="Pip.io App Store";return options;},onInit:function(){var appstoreText="You can install apps on your Pip.io account to add additional features. More apps are coming very soon!";var appstoreText2="If you're a developer and interested in creating an app for the Pip.io platform, please contact developers@pip.io";new Element("div",{"class":"text_section light1","text":TextUtility.unescape(appstoreText)}).inject(this.menu);new Element("div",{"class":"text_section light1 text11","text":TextUtility.unescape(appstoreText2)}).inject(this.menu);}});var AppstoreItemUtility={createAppstoreItem:function(app){var el=ItemUtility.createPostBubble("post app",true);el.set("id","appstore_item_"+app.app_id);var installMethod=app.name+"Install";var uninstallMethod=app.name+"Uninstall";new Element("img",{"class":"app_icon","src":app.info.icon}).inject(el);new Element("div",{"class":"description","text":TextUtility.unescape(app.info.description)}).inject(el);var appname=new Element("div",{"class":"user_name clickable","text":TextUtility.unescape(app.display_name)}).inject(el);if(app.type==3){var installButton=new ButtonMedium({displayName:"Coming Soon!",action:"goto dark"});new Element("div",{"class":"actions"}).adopt($(installButton)).inject(el);}else{var uninstallButton=new ButtonMedium({className:"uninstall",displayName:"Uninstall Application",action:"goto dark"});$(uninstallButton).addEvent("click",pipio.dispatchEvent.bind(pipio,[uninstallMethod,app]));var installButton=new ButtonMedium({className:"install",displayName:"Install Application",action:"goto dark"});$(installButton).addEvent("click",pipio.dispatchEvent.bind(pipio,[installMethod,app]));if(app.installed){el.addClass("installed");}else{el.addClass("uninstalled");}new Element("div",{"class":"actions"}).adopt($(installButton),$(uninstallButton)).inject(el);}return el;}};var Contacts=new Class({Extends:App,EventHandlers:["userSwitched","userStatusUpdated","userStatusCleared","userOnline","userOffline","userPresenceReceived","selfPresenceReceived","selfPresenceUpdate","userVideoEnabled","showStatusUpdatePopup","userProfilePicUpdated","xmppConnected","xmppConnecting","xmppDisconnected","contactAdded","contactGroupAdded","contactDeleted","contactGroupDeleted","contactGroupMoved","contactRequestAdded","contactRequestDeleted","connectionRequestAccept","connectionRequestDelete","connectionRequestCreate","connectionDelete","userSubscribe","userUnsubscribe","showGroupPickerPopup","showCreateGroupPopup"],onStart:function(){this.setupNav();},onStop:function(){},userSwitched:function(){if(this.isLoggedIn()){this.userLoggedIn();}else{this.userLoggedOut();}},userLoggedIn:function(){this.start();this.initBuddylist();},userLoggedOut:function(){this.stop();},onCreate:function(){this.minButtonAction=new Element("div",{"class":"action pivot_up"});this.minButton=new Element("div",{"class":"button_nav"}).adopt(this.minButtonAction).inject("self");this.minButton.addEvent("click",this.toggleNav.bind(this));this.navHeader.destroy();this.connecting=new Element("div",{"class":"connect_state"}).adopt(new Element("div",{"class":"connect_text light2","text":"Connecting to Pip.io..."}),new Element("div",{"class":"progress"})).inject("nav");DomUtility.hide(this.navSection);},onDestroy:function(){this.connecting.destroy();},toggleNav:function(){if(!this.isExpanded){this.expand();}else{this.collapse();}},expand:function(){if(!this.isExpanded){DomUtility.expand(this.navWrapper);this.minButtonAction.addClass("pivot_up");this.minButtonAction.removeClass("pivot_down");this.isExpanded=true;}},collapse:function(){if(this.isExpanded){DomUtility.collapse(this.navWrapper);this.minButtonAction.addClass("pivot_down");this.minButtonAction.removeClass("pivot_up");this.isExpanded=false;}},xmppConnected:function(){DomUtility.show(this.navSection);DomUtility.hide(this.connecting);},xmppDisconnected:function(){DomUtility.show(this.connecting);DomUtility.hide(this.navSection);},xmppConnecting:function(){DomUtility.show(this.connecting);DomUtility.hide(this.navSection);},connectionDelete:function(username){this.call("contacts","connection_delete",{username:username},null,null);},connectionRequestCreate:function(username){this.call("contacts","connection_request_create",{username:username},null,null);},connectionRequestAccept:function(username){this.call("contacts","connection_request_accept",{username:username},null,null);},connectionRequestDelete:function(username){this.call("contacts","connection_request_delete",{username:username},null,null);},userSubscribe:function(username){this.call("contacts","user_subscribe",{username:username},null,null);},userUnsubscribe:function(username){this.call("contacts","user_unsubscribe",{username:username},null,null);},userProfilePicUpdated:function(data){if(!$defined(data.username)){return;}var user=this.getUser(data.username);var user_id=user.user_id;var username=user.username;var version=UserUtility.profilePicVersionGet(user_id);version++;UserUtility.profilePicVersionSet(user_id,version);user.profile_pic_16=user.profile_pic_16.split("?")[0]+"?"+version;user.profile_pic_20=user.profile_pic_20.split("?")[0]+"?"+version;user.profile_pic_26=user.profile_pic_26.split("?")[0]+"?"+version;user.profile_pic_32=user.profile_pic_32.split("?")[0]+"?"+version;user.profile_pic_42=user.profile_pic_42.split("?")[0]+"?"+version;user.profile_pic_60=user.profile_pic_60.split("?")[0]+"?"+version;user.profile_pic_100=user.profile_pic_100.split("?")[0]+"?"+version;user.profile_pic_200=user.profile_pic_200.split("?")[0]+"?"+version;$$(".profile_pic_16_"+username).each(function(el){el.set("src",user.profile_pic_16);});$$(".profile_pic_20_"+username).each(function(el){el.set("src",user.profile_pic_20);});$$(".profile_pic_60_"+username).each(function(el){el.set("src",user.profile_pic_60);});$$(".profile_pic_26_"+username).each(function(el){el.set("src",user.profile_pic_26);});$$(".profile_pic_32_"+username).each(function(el){el.set("src",user.profile_pic_32);});$$(".profile_pic_42_"+username).each(function(el){el.set("src",user.profile_pic_42);});$$(".profile_pic_100_"+username).each(function(el){el.set("src",user.profile_pic_100);});$$(".profile_pic_200_"+username).each(function(el){el.set("src",user.profile_pic_200);});},destroyApp:function(){this.contents.each(function(content){content.destroy();});this.contents.empty();this.menus.each(function(menu){menu.destroy();});this.menus.empty();this.navs.each(function(nav){nav.destroy();});this.navs.empty();this.navHeader.destroy();this.nav.destroy();this.navSection.destroy();this.fireEvent("appClose",this.appId);if($defined(this.onDestroy)){this.onDestroy();}}});Contacts.implement({initBuddylist:function(){this.contacts=$H();this.contactRequests=$H();this.groups=$H();this.css=new CSS();this.getGroups().each(function(group){this.groupAdd(group);},this);this.getContacts().each(function(user){this.contactAdd(user);},this);this.getContactRequests().each(function(user){this.contactRequestAdd(user);},this);},contactAdded:function(user){if(this.contacts.has(user.username)){return;}this.contactAdd(user);},contactDeleted:function(username){this.contactDelete(username);},contactRequestAdded:function(user){if(this.contactRequests.has(user.username)){return;}this.contactRequestAdd(user);},contactRequestDeleted:function(username){if(!this.contactRequests.has(username)){return;}this.contactRequestDelete(username);},contactGroupAdded:function(group){if(this.groups.has(group.group_id)){return;}this.groupAdd(group);},contactGroupDeleted:function(group){if(!this.groups.has(group.group_id)){return;}this.groupDelete(group);},contactGroupMoved:function(user){this.contactDelete(user.username);Logger().log("contactGroupMoved "+user.username+" group_id "+user.group_id);this.contactAdd(user);},selfPresenceUpdate:function(show){if($defined(show)&&this.getPrivateUser().show==show){return;}if($defined(show)){this.getPrivateUser().show=show;}this.p.xmpp.updateSelfPresence(this.getPrivateUser().show,true);},userVideoEnabled:function(username,videoEnabled){if(this.contacts.has(username)){this.contacts.get(username).videoEnabled(videoEnabled);}},userStatusUpdated:function(data){if($defined(this.contacts)&&this.contacts.has(data.username)){this.contacts.get(data.username).statusMsgUpdated(data.status_message.status);}},userStatusCleared:function(data){if($defined(this.contacts)&&this.contacts.has(data.username)){this.contacts.get(data.username).statusMsgUpdated("");}},userOnline:function(username){if(this.contacts.has(username)){var user=this.getContact(username);if(user.status_message.status==""){this.contacts.get(username).online(false);}else{this.contacts.get(username).online(true);}if(!user.online){user.online=true;}}},userOffline:function(username){if(this.contacts.has(username)){this.contacts.get(username).offline();var user=this.getContact(username);if(user.online){user.online=false;}}},userPresenceReceived:function(username,show,online){if(online){this.userOnline(username);if(show==""){this.setUserOnlineClass(username);}else{if(show=="away"){this.setUserAwayClass(username);}else{if(show=="xa"){this.setUserIdleClass(username);}else{if(show=="dnd"){this.userOffline(username);this.setUserOfflineClass(username);}}}}}else{this.userOffline(username);this.setUserOfflineClass(username);}this.getContact(username).show=show;},selfPresenceReceived:function(show,online){if(online){if(show==""){this.setUserOnlineClass(this.getPrivateUser().username);}else{if(show=="away"){this.setUserAwayClass(this.getPrivateUser().username);}else{if(show=="xa"){this.setUserIdleClass(this.getPrivateUser().username);}else{if(show=="dnd"){this.setUserOfflineClass(this.getPrivateUser().username);}}}}}else{this.setUserOfflineClass(this.getPrivateUser().username);}},setUserOnlineClass:function(username){this.css.add_rule(".online_status_"+username,{"border-color":"#42a409 !important"}).refresh();},setUserIdleClass:function(username){this.css.add_rule(".online_status_"+username,{"border-color":"#cc8513 !important"}).refresh();},setUserAwayClass:function(username){this.css.add_rule(".online_status_"+username,{"border-color":"#b0191f !important"}).refresh();},setUserOfflineClass:function(username){this.css.remove_rule(".online_status_"+username);this.css.refresh();}});Contacts.implement({requests:[{name:"connection_group_create",params:["name"],url:"/api/user/connection/group/create"},{name:"connection_group_delete",params:["group_id"],url:"/api/user/connection/group/delete"},{name:"connection_group_move",params:["username","group_id"],url:"/api/user/connection/group/move"},{name:"connection_delete",params:["username"],url:"/api/user/connection/delete"},{name:"connection_request_create",params:["username"],url:"/api/user/connection/request/create"},{name:"connection_request_accept",params:["username"],url:"/api/user/connection/request/accept"},{name:"connection_request_delete",params:["username"],url:"/api/user/connection/request/delete"},{name:"user_subscribe",params:["username"],url:"/api/user/stream/subscribe"},{name:"user_unsubscribe",params:["username"],url:"/api/user/stream/unsubscribe"},{name:"search_user",params:["query"],url:"/api/user/search/user"},{name:"search_email",params:["email_address","password"],url:"/api/user/search/email"},{name:"invite_create",params:["email","message"],url:"/api/user/invite/create"}]});Contacts.implement({setupNav:function(){this.navAdd(new Nav({iconOptions:{iconName:"contacts",iconAction:"add"},hasSubnavs:true,onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"contact_requests","contact_requests"]),displayName:"Contact Requests",defaultClosed:true,name:"requests"}));var contactRequestsMenu=new ContactRequestsMenu({displayName:"Contact Requests"});this.menuAdd("contact_requests",contactRequestsMenu);var content=new ContactRequestsContent();this.contentAdd("contact_requests",content);this.navAdd(new Nav({iconOptions:{iconName:"search"},displayName:"Search Users...",onClick:this.fireEvent.bind(this,["searchUserShow"]),name:"search_user",bottom:true}));this.navAdd(new Nav({iconOptions:{iconName:"contacts",iconAction:"add"},displayName:"Create New Group...",onClick:this.fireEvent.bind(this,["showCreateGroupPopup"]),name:"new_group",bottom:true}));},groupAdd:function(group){var groupNav=new GroupNav({group:group,onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"group_"+group.group_id,"menu_"+group.group_id])});this.navAdd(groupNav);this.groups.set(group.group_id,groupNav);if(group.group_id!=0){var groupMenu=new GroupMenu({displayName:group.name,group:group});}else{var groupMenu=new GroupMenu({displayName:group.name,group:group,unsorted:true});}this.menuAdd("menu_"+group.group_id,groupMenu);var content=new GroupContent({group:group});this.contentAdd("group_"+group.group_id,content);},groupDelete:function(group){this.navDelete("group_"+group.group_id);this.menuClose("menu_"+group.group_id);this.contentClose("group_"+group.group_id);},contactAdd:function(user){var contactNav=new ContactNav({user:user});this.navAdd(contactNav);this.contacts.set(user.username,contactNav);},contactDelete:function(username){if(!this.contacts.has(username)){return;}this.contacts.get(username).destroy();this.navDelete("contact_"+username);this.contacts.erase(username);},contactRequestAdd:function(user){var contactNav=new ContactRequestNav({user:user});this.navAdd(contactNav);this.contactRequests.set(user.username,contactNav);this.fireEvent("alertAdd","1_requests");},contactRequestDelete:function(username){if(!this.contactRequests.has(username)){return;}Logger().log("deleting contact request nav "+username);this.contactRequests.get(username).destroy();this.contactRequests.erase(username);this.navDelete("contact_request_"+username);this.fireEvent("alertClear","1_requests",1);},showStatusUpdatePopup:function(){if($defined(this.statusUpdatePopup)){this.statusUpdatePopup.close();}this.createStatusUpdatePopup();},createStatusUpdatePopup:function(){this.statusUpdatePopup=new Popup({size:{x:350,y:100},resizable:false,dockable:false,className:"statusUpdate",onClose:this.destroyStatusUpdatePopup.bind(this)});var nav=new Nav({iconOptions:{user:this.getPrivateUser()},displayName:"Update Your Status",closable:true});var content=new StatusUpdatePopupContent({user:this.getPrivateUser()});this.statusUpdatePopup.addContent("status_update",nav,content);},destroyStatusUpdatePopup:function(){this.statusUpdatePopup=null;},showGroupPickerPopup:function(user){if($defined(this.groupPickerPopup)){this.groupPickerPopup.close();}this.createGroupPickerPopup(user);},createGroupPickerPopup:function(user){this.groupPickerPopup=new Popup({size:{x:200,y:250},resizable:false,dockable:false,className:"groupPicker",onClose:this.destroyGroupPickerPopup.bind(this)});var nav=new Nav({iconOptions:{user:user},displayName:"Edit "+TextUtility.unescape(user.fullname),closable:true});var content=new GroupPickerPopupContent({user:user});this.groupPickerPopup.addContent("group_picker",nav,content);},destroyGroupPickerPopup:function(){this.groupPickerPopup=null;},showCreateGroupPopup:function(){if($defined(this.createGroupPopup)){this.createGroupPopup.close();}this.createCreateGroupPopup();},createCreateGroupPopup:function(){this.createGroupPopup=new Popup({size:{x:350,y:74},resizable:false,dockable:false,className:"createGroup",onClose:this.destroyCreateGroupPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"contacts",iconAction:"add"},displayName:"Create New Group",closable:true});var content=new CreateGroupPopupContent({});this.createGroupPopup.addContent("create_group",nav,content);},destroyCreateGroupPopup:function(){this.createGroupPopup=null;}});var ContactRequestsContent=new Class({Extends:Content,EventHandlers:["contactRequestAdded","contactRequestDeleted"],onInit:function(){this.loaded=false;this.loader=new ItemLoader({idField:"username",sortField:"last_name",sortAlpha:true,createElementFunc:ContactItemUtility.createContactRequestItem,emptyEl:new Element("div",{"class":"post empty","text":"You do not have any contact requests"})});$(this.loader).inject(this.content);},onShow:function(first){if(first){this.populateContacts();}},onHide:function(){},populateContacts:function(){var contacts=this.getContactRequests();contacts.each(function(user){this.loader.process(user);},this);this.loaded=true;},contactRequestAdded:function(user){this.loader.process(user);},contactRequestDeleted:function(username){this.loader.remove(username);}});var GroupContent=new Class({Extends:Content,EventHandlers:["contactAdded","contactDeleted","contactGroupMoved"],onBeforeInit:function(options){this.group=options.group;return options;},onInit:function(){this.loaded=false;this.loader=new ItemLoader({idField:"user_id",sortField:"last_name",sortAlpha:true,createElementFunc:ContactItemUtility.createContactItem,emptyEl:new Element("div",{"class":"post empty","text":"There are no contacts in this group"})});$(this.loader).inject(this.content);},onShow:function(first){if(first){this.populateContacts();}},onHide:function(){},populateContacts:function(){var contacts=this.group.users;contacts.each(function(user){this.loader.process(user);},this);this.loaded=true;},contactAdded:function(user){if(!this.loaded||user.group_id!=this.group.group_id){return;}this.loader.process(user);},contactDeleted:function(username,group_id){if(!this.loaded||group_id!=this.group.group_id){return;}var user=this.getUser(username);this.loader.remove(user.user_id);},contactGroupMoved:function(user){if(user.group_id==this.group.group_id){this.loader.process(user);}else{this.loader.remove(user.user_id);}}});var ContactRequestsMenu=new Class({Extends:Menu,strings:{contactRequestsText:"These users requested to add you as their contact"},onInit:function(){new Element("div",{"class":"text_section light1","text":this.strings.contactRequestsText}).inject(this.menu);}});var GroupMenu=new Class({Extends:Menu,strings:{groupMenuText:'These are contacts in your group "{0}"',unsortedGroupMenuText:"These are contacts that have not been added to a group"},onBeforeInit:function(options){this.group=options.group;this.unsorted=options.unsorted||false;return options;},onInit:function(){if(this.unsorted){new Element("div",{"class":"text_section light1","text":String.format(this.strings.unsortedGroupMenuText)}).inject(this.menu);}else{new Element("div",{"class":"text_section light1","text":String.format(this.strings.groupMenuText,TextUtility.unescape(this.group.name))}).inject(this.menu);}if(!this.unsorted){this.deleteButton=new ButtonMedium({displayName:"Delete Group",className:"dark",action:"cross"});var name="groupDelete_"+this.group.group_id;var title="Delete "+this.group.name;var message="Are you sure you want to delete the group "+this.group.name+"?";var func=this.deleteGroup.bind(this);$(this.deleteButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["showConfirmation",name,title,message,func]));new Element("div",{"class":"button_section"}).adopt($(this.deleteButton)).inject(this.menu);}},deleteGroup:function(){var params={group_id:this.group.group_id};this.call("contacts","connection_group_delete",params,this.deleteGroupSuccess.bind(this),this.deleteGroupFail.bind(this));this.deleteButton.showProgress();},deleteGroupSuccess:function(data){this.deleteButton.hideProgress();},deleteGroupFail:function(){this.deleteButton.hideProgress();}});var ContactNav=new Class({Extends:Nav,onBeforeInit:function(options){this.user=options.user;this.isOnline=false;options.name="contact_"+this.user.username;options.iconOptions={user:this.user};options.onClick=this.fireEvent.bind(this,["chatStart",this.user.username]);options.displayName=this.user.fullname;options.className="contact";options.parentName="group_"+this.user.group_id;return options;},onInit:function(){$(this.icon).destroy();this.icon=new Icon20(this.iconOptions);$(this.icon).inject(this.nav);$(this.icon).addEvent("click",this.openUser.bindWithEvent(this));this.videoChatIcon=new Icon({iconName:"video_chat"});$(this.videoChatIcon).inject(this.nav);$(this.videoChatIcon).addEvent("click",this.videoChatStart.bindWithEvent(this));var statusMsg=($defined(this.user.status_message)&&$defined(this.user.status_message.status))?this.user.status_message.status:"";this.statusMsg=new Element("div",{"class":"status_msg status_msg_"+this.user.username,"text":TextUtility.unescape(statusMsg)}).inject(this.nav);if(this.user.online){if(statusMsg==""){this.online(false);}else{this.online(true);}}},statusMsgUpdated:function(statusMsg){this.statusMsg.set("text",TextUtility.unescape(statusMsg));if(this.isOnline){if(statusMsg==""){DomUtility.setHeight(this.nav,22);}else{DomUtility.setHeight(this.nav,36);}}},online:function(hasStatus){if(hasStatus){DomUtility.expandFade(this.nav,36);}else{DomUtility.expandFade(this.nav,22);}this.navWrapper.addClass("online");this.isOnline=true;},offline:function(){DomUtility.collapseFade(this.nav);this.navWrapper.removeClass("online");this.isOnline=false;},videoEnabled:function(enabled){if(enabled){this.nav.addClass("videoEnabled");}else{this.nav.removeClass("videoEnabled");}},openUser:function(e){e.stopPropagation();this.fireEvent("showUser",this.user);},videoChatStart:function(e){e.stopPropagation();this.fireEvent("videoChatStart",this.user);}});var ContactRequestNav=new Class({Extends:Nav,onBeforeInit:function(options){this.user=options.user;options.name="contact_request_"+this.user.username;options.iconOptions={user:this.user};options.onClick=this.fireEvent.bind(this,["showUser",this.user]);options.displayName=this.user.fullname;options.className="contact request";options.parentName="requests";return options;},onInit:function(){$(this.icon).destroy();this.icon=new Icon20(this.iconOptions);$(this.icon).inject(this.nav);}});var GroupNav=new Class({Extends:Nav,onBeforeInit:function(options){this.group=options.group;options.name="group_"+this.group.group_id;options.iconOptions={iconName:"contacts"};options.displayName=this.group.name;options.className="group_nav";options.hasSubnavs=true;return options;},onInit:function(){this.onlineCount=new Element("div",{"class":"online_count text11 light2"}).inject(this.nav);DomUtility.hide(this.onlineCount);},onExpand:function(){this.hideOnlineCount();},onCollapse:function(){this.showOnlineCount();},showOnlineCount:function(){this.onlineCount.set("text",this.getOnlineCount());DomUtility.show(this.onlineCount);},hideOnlineCount:function(){DomUtility.hide(this.onlineCount);},getOnlineCount:function(){return this.subnavItems.getChildren(".online").length+"/"+this.subnavItems.getChildren().length;}});var SubscribersNav=new Class({Extends:Nav,onBeforeInit:function(options){this.users=$H();options.name="subscribers";options.iconOptions={iconName:"broadcast"};options.displayName="Subscribers";options.className="subscribers_nav";options.hasSubnavs=true;return options;},onInit:function(){this.clear=new Element("div",{"style":"clear: both"});this.list=new Element("div",{"class":"menu_list"}).adopt(this.clear).inject(this.subnavs);},addUsers:function(users){$splat(users).each(function(user){user=UserUtility.processUser(user);if(!this.users.has(user.username)){var pic=ItemUtility.createProfilePic(user,"16a");pic.addEvent("click",this.fireEvent.bind(this,["showUser",user]));pic.inject(this.clear,"before");this.users.set(user.username,pic);}},this);},removeUser:function(username){if(!this.users.has(username)){return;}this.users.get(username).destroy();this.users.erase(username);}});var SubscriptionsNav=new Class({Extends:Nav,onBeforeInit:function(options){this.users=$H();options.name="subscriptions";options.iconOptions={iconName:"broadcast"};options.displayName="Subscriptions";options.className="subscribers_nav";options.hasSubnavs=true;return options;},onInit:function(){this.clear=new Element("div",{"style":"clear: both"});this.list=new Element("div",{"class":"menu_list"}).adopt(this.clear).inject(this.subnavs);},addUsers:function(users){$splat(users).each(function(user){user=UserUtility.processSource(user);if(!this.users.has(user.username)){var pic=ItemUtility.createProfilePic(user,"16a");if($defined(user.user_id)){pic.addEvent("click",this.fireEvent.bind(this,["showUser",user]));}else{if($defined(user.room_id)){pic.addEvent("click",this.fireEvent.bind(this,["showRoom",user]));}}pic.inject(this.clear,"before");this.users.set(user.username,pic);}},this);},removeUser:function(username){if(!this.users.has(username)){return;}this.users.get(username).destroy();this.users.erase(username);}});var ContactPickerPopupContent=new Class({Extends:PopupContent,onBeforeInit:function(options){this.contacts=options.contacts;this.contactAddFunc=options.contactAddFunc;this.hasGroups=options.hasGroups||true;if(this.hasGroups){this.groups=options.groups;this.groupAddFunc=options.groupAddFunc;}this.hasAllContacts=options.hasAllContacts||true;if(this.hasAllContacts){this.allContactsAddFunc=options.allContactsAddFunc;}return options;},onInit:function(){this.css=new CSS();this.input=new Element("input",{"type":"text","maxlength":50});this.input.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));new Element("div",{"class":"textarea_wrapper"}).adopt(this.input).inject(this.content);this.list=new Element("div",{"class":"itemList"}).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Close",className:"dark",action:"cross"});new Element("div",{"class":"actions"}).adopt($(this.closeButton)).inject(this.content);$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.insertContacts();this.scroll=new Fx.Scroll(this.list);},insertContacts:function(){if(this.hasAllContacts){var el=ShareBoxUtility.createAllContactsPickerItem();el.addEvent("click",this.addAllContacts.bind(this,[el]));el.inject(this.list);this.insertSeperator();}if(this.hasGroups){this.groups.each(function(group){var el=ShareBoxUtility.createGroupPickerItem(group);el.addEvent("click",this.addGroup.bind(this,[group,el]));el.inject(this.list);},this);this.insertSeperator();}this.contacts.getValues().sort(DataUtility.sortUsers).each(function(user){var el=ShareBoxUtility.createContactPickerItem(user);el.addEvent("click",this.addContact.bind(this,[user,el]));el.inject(this.list);},this);},insertSeperator:function(){new Element("div",{"class":"listItem seperator"}).inject(this.list);},addAllContacts:function(el){this.allContactsAddFunc();el.destroy();this.closeContent();},addContact:function(user,el){this.contactAddFunc(user);el.destroy();},addGroup:function(group,el){this.groupAddFunc(group);el.destroy();},inputKeyUp:function(e){if(e.key=="esc"){e.target.value="";}var val=e.target.value.trim().toLowerCase();if(val.length<2){this.list.removeClass("search");return;}this.list.addClass("search");if($defined(this.lastSelector)){this.css.remove_rule(this.lastSelector);}var selector=".listItem[val1^='"+val+"'], .listItem[val2^='"+val+"']";this.css.add_rule(selector,{"display":"block !important"}).refresh();this.lastSelector=selector;},focus:function(){this.input.focus.delay(500,this.input);},onClose:function(){if($defined(this.lastSelector)){this.css.remove_rule(this.lastSelector).refresh();}},onShow:function(){if($defined(this.scrollY)){this.scroll.set(0,this.scrollY);}this.focus();},onHide:function(){if($defined(this.list)){this.scrollY=this.list.getScroll().y;}}});var CreateGroupPopupContent=new Class({Extends:PopupContent,strings:{groupNameLabel:"Group Name:",errorMessage:"There was an error creating this group"},onInit:function(){this.groupNameInput=new Element("input",{"type":"text","maxlength":"32"});this.groupNameInput.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.groupNameLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.groupNameInput)).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Create Group",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.createGroup.bind(this));this.message=new Element("div",{"class":"message error"});this.actions=new Element("div",{"class":"actions"}).adopt(this.message,$(this.actionButton),$(this.closeButton)).inject(this.content);},inputKeyUp:function(e){if(e.key=="enter"){if(this.groupNameInput.value.trim()!=""){this.createGroup();}}},createGroup:function(){var name=this.groupNameInput.value.trim();var params={name:name};this.call("contacts","connection_group_create",params,this.createGroupSuccess.bind(this),this.createGroupFail.bind(this));this.actionButton.showProgress();},createGroupSuccess:function(){this.actionButton.hideProgress();this.closeContent();},createGroupFail:function(){this.actionButton.hideProgress();this.closeContent();},onShow:function(){this.focus();},focus:function(){this.groupNameInput.focus.delay(500,this.groupNameInput);}});var GroupPickerPopupContent=new Class({Extends:PopupContent,onBeforeInit:function(options){this.user=options.user;return options;},onInit:function(){this.list=new Element("div",{"class":"itemList"}).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Close",className:"dark",action:"cross"});new Element("div",{"class":"actions"}).adopt($(this.closeButton)).inject(this.content);$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.insertGroups();},insertGroups:function(){var groups=this.getGroups();groups.each(function(group){var el=ShareBoxUtility.createGroupPickerItem(group);if(this.user.group_id==group.group_id){el.addClass("on");this.selectedEl=el;}else{el.addEvent("click",this.groupMove.bind(this,[group,el]));}el.inject(this.list);},this);},groupMove:function(group,el){var params={username:this.user.username,group_id:group.group_id};this.call("contacts","connection_group_move",params,this.groupMoveSucess.bind(this),this.groupMoveFail.bind(this));this.selectedEl.removeClass("on");new Element("div",{"class":"progress"}).inject(el);},groupMoveSucess:function(data){this.closeContent();},groupMoveFail:function(){this.closeContent();}});var StatusUpdatePopupContent=new Class({Extends:PopupContent,onInit:function(){this.statusInput=new Element("textarea",{"maxlength":500});this.statusInput.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));new Element("div",{"class":"textarea_wrapper"}).adopt(this.statusInput).inject(this.content);this.cancelButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.cancelButton).addEvent("click",this.closeContent.bind(this));this.updateButton=new ButtonMedium({displayName:"Update Status",className:"dark",action:"check"});$(this.updateButton).addEvent("click",this.updateStatus.bind(this));new Element("div",{"class":"actions"}).adopt($(this.updateButton),$(this.cancelButton)).inject(this.content);},onShow:function(){this.focus();},focus:function(){this.statusInput.focus.delay(500,this.statusInput);},inputKeyUp:function(e){if(e.key=="enter"){var msg=e.target.value.trim();if(msg==""){return;}this.updateStatus();}},updateStatus:function(){var params={username:"",body:this.statusInput.value.trim(),res:this.getSession()};this.call("pipio","publish_status",params,this.updateStatusSuccess.bind(this),this.updateStatusFail.bind(this));this.updateButton.showProgress();},updateStatusSuccess:function(){this.closeContent();},updateStatusFail:function(){alert("There was an error updating your status!");}});var ContactItemUtility={createContactItem:function(user){var el=ItemUtility.createPostBubble("post contact",true);ItemUtility.createProfilePic(user,60).inject(el);var header=new Element("div",{"class":"heading"}).inject(el);var username=new Element("span",{"class":"user_name clickable","text":TextUtility.unescape(user.fullname)}).inject(header);username.addEvent("click",pipio.dispatchEvent.bind(pipio,["showUser",user]));var status=new Element("span",{"class":"status status_msg_"+user.username}).inject(header);if(user.status_message.status.trim()!=""){status.set("text"," "+TextUtility.unescape(user.status_message.status.trim()));}var viewButton=new ButtonMedium({displayName:"View Profile",action:"goto dark"});$(viewButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["showUser",user]));var editButton=new ButtonMedium({displayName:"Edit Group",action:"status dark"});$(editButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["showGroupPickerPopup",user]));var deleteButton=new ButtonMedium({displayName:"Delete Contact",action:"cross"});var name="contactDelete_"+user.username;var title="Delete "+user.fullname;var message="Are you sure you want to delete "+user.fullname+" from your contacts?";var func=pipio.dispatchEvent.bind(pipio,["connectionDelete",user.username]);$(deleteButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["showConfirmation",name,title,message,func]));new Element("div",{"class":"actions"}).adopt($(viewButton),$(editButton),$(deleteButton)).inject(el);return el;},createContactRequestItem:function(user){var el=ItemUtility.createPostBubble("post contact",true);ItemUtility.createProfilePic(user,60).inject(el);var header=new Element("div",{"class":"heading"}).inject(el);var username=new Element("span",{"class":"user_name clickable","text":TextUtility.unescape(user.fullname)}).inject(header);username.addEvent("click",pipio.dispatchEvent.bind(pipio,["showUser",user]));var status=new Element("span",{"class":"status status_msg_"+user.username}).inject(header);if(user.status_message.status.trim()!=""){status.set("text"," "+TextUtility.unescape(user.status_message.status.trim()));}var viewButton=new ButtonMedium({displayName:"View Profile",action:"goto dark"});$(viewButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["showUser",user]));var acceptButton=new ButtonMedium({displayName:"Accept Request",action:"check"});$(acceptButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["connectionRequestAccept",user.username]));var deleteButton=new ButtonMedium({displayName:"Delete Request",action:"cross"});$(deleteButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["connectionRequestDelete",user.username]));new Element("div",{"class":"actions"}).adopt($(viewButton),$(acceptButton),$(deleteButton)).inject(el);return el;},createRoomMemberItemFactory:function(room,isAdmin){return function(user){return ContactItemUtility.createRoomMemberItem.run([user,room,isAdmin]);};},createRoomMemberItem:function(user,room,isAdmin){var el=ItemUtility.createPostBubble("post contact",true);ItemUtility.createProfilePic(user,60).inject(el);var header=new Element("div",{"class":"heading"}).inject(el);var username=new Element("span",{"class":"user_name clickable","text":TextUtility.unescape(user.fullname)}).inject(header);username.addEvent("click",pipio.dispatchEvent.bind(pipio,["showUser",user]));var status=new Element("span",{"class":"status status_msg_"+user.username}).inject(header);if(user.status_message.status.trim()!=""){status.set("text"," "+TextUtility.unescape(user.status_message.status.trim()));}if(isAdmin&&user.user_id!=pipio.currentUser.user_id){var viewButton=new ButtonMedium({displayName:"View Profile",action:"goto dark"});$(viewButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["showUser",user]));var removeButton=new ButtonMedium({displayName:"Remove Member",action:"cross"});$(removeButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["feedRoomKick",user.username,room.username]));new Element("div",{"class":"actions"}).adopt($(viewButton),$(removeButton)).inject(el);}else{var viewButton=new ButtonMedium({displayName:"View Profile",action:"goto dark"});$(viewButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["showUser",user]));new Element("div",{"class":"actions"}).adopt($(viewButton)).inject(el);}return el;},createRoomSubscriberItem:function(user){var el=ItemUtility.createPostBubble("post contact",true);ItemUtility.createProfilePic(user,60).inject(el);var header=new Element("div",{"class":"heading"}).inject(el);var username=new Element("span",{"class":"user_name clickable","text":TextUtility.unescape(user.fullname)}).inject(header);username.addEvent("click",pipio.dispatchEvent.bind(pipio,["showUser",user]));var status=new Element("span",{"class":"status status_msg_"+user.username}).inject(header);if(user.status_message.status.trim()!=""){status.set("text"," "+TextUtility.unescape(user.status_message.status.trim()));}var viewButton=new ButtonMedium({displayName:"View Profile",action:"goto dark"});$(viewButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["showUser",user]));new Element("div",{"class":"actions"}).adopt($(viewButton)).inject(el);return el;},createRoomRequestItemFactory:function(room){return function(user){return ContactItemUtility.createRoomRequestItem.run([user,room]);};},createRoomRequestItem:function(user,room){var el=ItemUtility.createPostBubble("post contact",true);ItemUtility.createProfilePic(user,60).inject(el);var header=new Element("div",{"class":"heading"}).inject(el);var username=new Element("span",{"class":"user_name clickable","text":TextUtility.unescape(user.fullname)}).inject(header);username.addEvent("click",pipio.dispatchEvent.bind(pipio,["showUser",user]));var status=new Element("span",{"class":"status status_msg_"+user.username}).inject(header);if(user.status_message.status.trim()!=""){status.set("text"," "+TextUtility.unescape(user.status_message.status.trim()));}var viewButton=new ButtonMedium({displayName:"View Profile",action:"goto dark"});$(viewButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["showUser",user]));var removeButton=new ButtonMedium({displayName:"Reject Member",action:"cross"});$(removeButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["feedRoomRequestDelete",user.username,room.username]));var acceptButton=new ButtonMedium({displayName:"Accept Member",action:"check"});$(acceptButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["feedRoomRequestAccept",user.username,room.username]));new Element("div",{"class":"actions"}).adopt($(viewButton),$(removeButton),$(acceptButton)).inject(el);return el;}};var Facebook=new Class({Extends:App,EventHandlers:["facebookInstall","facebookUninstall","facebookShowUserFeed","facebookShowUserAlbums","facebookTaggedPhotos","userSwitched"],parseOptions:function(options){this.settings=options.settings;},userSwitched:function(){if(!this.isLoggedIn()){this.userLoggedOut();}},userLoggedOut:function(){FB.Connect.logout();this.stop();},onStart:function(){this.appId=5;FB_RequireFeatures(["Connect"],function(){FB.Facebook.init("d29a9328a49d798da896066499c0d9d8","/xd_receiver.htm",{"forceBrowserPopupForLogin":true,"doNotUseCachedConnectState":true});});this.appsInstalled=UserUtility.getInstalledApps();if($defined(this.appsInstalled[this.appId])){this.external_user_id=this.appsInstalled[this.appId];}this.setupNav();this.albums=$H();},onStop:function(){},userLoggedIn:function(){},userLoggedOut:function(){this.stop();},facebookInstall:function(){this.facebookInstallPopup=new Popup({size:{x:350,y:80},resizable:false,dockable:false,className:"appInstall",onClose:this.destroyFacebookInstallPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"facebook"},displayName:"Install Facebook",closable:true});var content=new FacebookInstallPopupContent({});this.facebookInstallPopup.addContent("facebook_install",nav,content);},destroyFacebookInstallPopup:function(){this.facebookInstallPopup=null;},facebookUninstall:function(app){this.call("facebook","facebook_disable",null,this.facebookUninstallSuccess.bind(this),null);},facebookUninstallSuccess:function(data){this.stop();},facebookShowUserFeed:function(user){this.userAdd(user);},facebookShowUserAlbums:function(user){this.userAlbumsAdd(user);},facebookTaggedPhotos:function(uid){var newAlbum=new Album({id:uid});this.albums.set(uid,newAlbum);var params={user_id:uid,aid:""};this.call("facebook","facebook_photos",params,this.facebookTaggedPhotosSuccess.bind(this),this.facebookTaggedPhotosFail.bind(this));},facebookTaggedPhotosSuccess:function(data){if(!$defined(data.photos)){return;}var album=this.albums.get(data.uid);data.photos.each(function(photo){album.addPhoto(photo.pid,photo.src,photo.src_big,photo.caption);photo.auid=photo.uid;},this);var photo=album.getPhoto(data.photos[0].pid);this.fireEvent("viewAlbum",album,photo,data.uid);},facebookTaggedPhotosFail:function(data){}});Facebook.implement({requests:[{name:"facebook_enable",params:["sync_posts","session_key","uid"],url:"/api/app/facebook/account/enable"},{name:"facebook_disable",url:"/api/app/facebook/account/disable"},{name:"facebook_friends_info",params:["uid","limit","sort_field","number"],url:"/api/app/facebook/friends/info"},{name:"facebook_newsfeed_load",params:["start_time","end_time"],url:"/api/app/facebook/newsfeed/load"},{name:"facebook_user_show",params:["user_id"],url:"/api/app/facebook/user/profile_load"},{name:"facebook_user_feed",params:["user_id","start_time","end_time"],url:"/api/app/facebook/user/newsfeed_load"},{name:"facebook_settings_update",params:["key","value"],url:"/api/app/facebook/settings/update"},{name:"facebook_albums",params:["user_id","num_photos"],url:"/api/app/facebook/albums/get"},{name:"facebook_photos",params:["user_id","aid"],url:"/api/app/facebook/photos/get"},{name:"facebook_notification_send",params:["user_id","message"],url:"/api/app/facebook/notification/send"},{name:"facebook_post_text",params:["body","post_id","target_id"],url:"/api/app/facebook/text/item_create"},{name:"facebook_post_link",params:["body","url","post_id","target_id"],url:"/api/app/facebook/link/item_create"},{name:"facebook_post_photo",params:["body","photo","post_id","target_id"],url:"/api/app/facebook/photo/item_create",multipart:true},{name:"facebook_comments",params:["post_id"],url:"/api/app/facebook/comments/get"},{name:"facebook_feed_delete",params:["post_id","created_time"],url:"/api/app/facebook/item/delete"},{name:"facebook_settings_get",url:"/api/app/facebook/settings/get"},{name:"facebook_contacts_list",params:["uid","limit","sort_field","number"],url:"/api/app/facebook/friends/info"},{name:"facebook_post_like",params:["post_id","like_count"],url:"/api/app/facebook/like"},{name:"facebook_post_unlike",params:["post_id","like_count"],url:"/api/app/facebook/unlike"}]});Facebook.implement({setupNav:function(){this.users=$H();this.fb_albums=$H();this.navAdd(new Nav({iconOptions:{iconName:"updates"},displayName:"News Feed",name:"updates",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"updates","fb_self_menu"])}));this.navAdd(new Nav({iconOptions:{iconName:"profile_pic"},displayName:"My Wall",name:"wall",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"wall","fb_self_menu"])}));this.navAdd(new Nav({iconOptions:{iconName:"profile_pic"},displayName:"Friends",name:"friends",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"friends","fb_self_menu"])}));this.navAdd(new Nav({iconOptions:{iconName:"photo"},displayName:"My Albums",name:"albums",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"albums","fb_self_menu"])}));var user=this.getPrivateUser();var fbSelfMenu=new FacebookSelfMenu({user:user,isDefault:true,uid:this.settings.uid,closeFunc:this.stop.bind(this)});this.menuAdd("fb_self_menu",fbSelfMenu);var content=new FacebookFeedContent({isDefault:true});this.contentAdd("updates",content);var friendsContent=new FacebookFriendContent({user:user,uid:this.settings.uid});this.contentAdd("friends",friendsContent);var wallContent=new FacebookWallContent({user:user,uid:this.settings.uid});this.contentAdd("wall",wallContent);var albumsContent=new FacebookAlbumContent({uid:this.settings.uid});this.contentAdd("albums",albumsContent);},userClose:function(uid){if(!this.users.has(uid)){return;}this.users.get(uid).destroy();this.navDelete(uid);this.users.erase(uid);this.menuClose(uid);this.contentClose(uid);if(this.users.getLength()==0){this.navDelete("users");this.usersNav=null;}},userAdd:function(user){if(!$defined(this.usersNav)){this.usersNav=new Nav({iconOptions:{iconName:"users"},hasSubnavs:true,displayName:"Users",name:"users"});this.navAdd(this.usersNav);}var nav=new Nav({iconOptions:{iconName:user.pic},displayName:user.username,closable:true,name:user.uid,parentName:"users",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,user.uid,user.uid])});this.navAdd(nav);this.users.set(user.uid,nav);var userContent=new FacebookUserContent({uid:user.uid});this.contentAdd(user.uid,userContent);var fbUserMenu=new FacebookUserMenu({user:user,uid:user.uid,closeFunc:this.userClose.bind(this,[user.uid])});this.menuAdd(user.uid,fbUserMenu);this.fireEvent("viewSwitch",this.appId,user.uid,user.uid);},albumClose:function(uid){if(!this.fb_albums.has(uid)){return;}this.fb_albums.get(uid).destroy();this.navDelete(uid+"_albums");this.fb_albums.erase(uid);this.menuClose(uid+"_albums");this.contentClose(uid+"_albums");if(this.fb_albums.getLength()==0){this.navDelete("albums");this.userAlbumNav=null;}},userAlbumsAdd:function(user){if(!$defined(this.userAlbumNav)){this.usersAlbumNav=new Nav({iconOptions:{iconName:"photo"},hasSubnavs:true,displayName:"Albums",name:"fb_albums"});this.navAdd(this.usersAlbumNav);}var nav=new Nav({iconOptions:{iconName:user.pic_square},displayName:user.name,closable:true,name:user.uid+"_albums",parentName:"fb_albums",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,user.uid+"_albums",user.uid])});this.navAdd(nav);this.fb_albums.set(user.uid,nav);var userAlbumContent=new FacebookAlbumContent({uid:user.uid});this.contentAdd(user.uid+"_albums",userAlbumContent);var fbUserMenu=new FacebookUserMenu({user:user,uid:user.uid,closeFunc:this.albumClose.bind(this,[user.uid])});this.menuAdd(user.uid+"_albums",fbUserMenu);this.fireEvent("viewSwitch",this.appId,user.uid+"_albums",user.uid);}});var FacebookAlbumContent=new Class({Extends:Content,EventHandlers:["facebookAlbumView"],onBeforeInit:function(options){this.uid=options.uid;options.displayName="Facebook Albums";return options;},onInit:function(){this.albums=$H();this.albumsLoader=new ItemLoader({idField:"aid",sortField:"modified_major",createElementFunc:FacebookAlbumUtility.createFacebookAlbumItem,emptyEl:new Element("div",{"class":"post empty","text":"There are no albums here"}),errorEl:new Element("div",{"class":"post empty","text":"You are not able to view these albums"})});$(this.albumsLoader).inject(this.content);},onShow:function(first){if(first){this.getFacebookAlbums();}},onHide:function(){},getFacebookAlbums:function(){var params={user_id:this.uid};this.call("facebook","facebook_albums",params,this.facebookGetAlbumsSuccess.bind(this),this.facebookGetAlbumsFail.bind(this));},facebookGetAlbumsSuccess:function(data){if($defined(data.albums)){data.albums.albums.each(function(album){var pid=album.cover_pid;album.coverSrc=data.albums.sources[pid];this.albumsLoader.process(album);},this);}},facebookGetAlbumsFail:function(data){this.albumsLoader.showError();},facebookAlbumView:function(album){var newAlbum=new Album({id:album.aid});this.albums.set(album.aid,newAlbum);var params={user_id:"",aid:album.aid};this.call("facebook","facebook_photos",params,this.facebookAlbumViewSuccess.bind(this),null);},facebookAlbumViewSuccess:function(data){if(!$defined(data.photos)){return;}var album=this.albums.get(data.aid);data.photos.each(function(photo){album.addPhoto(photo.pid,photo.src,photo.src_big,photo.caption);photo.auid=photo.aid;},this);var photo=album.getPhoto(data.photos[0].pid);this.fireEvent("viewAlbum",album,photo,data.aid);}});var FacebookFeedContent=new Class({Extends:Content,EventHandlers:["facebookItemDelete","facebookItemLike","facebookCommentsShow","facebookSelfData","facebookCommentsUpdated","facebookFeed"],onInit:function(){this.loader=new ItemLoader({idField:"post_id",sortField:"created_time",sortAscending:false,createElementFunc:FacebookFeedItemUtility.createFacebookFeedItem,emptyEl:new Element("div",{"class":"post empty","text":"You have no updates"})});$(this.loader).inject(this.content);this.comments=new Hash();this.commentLoaders=new Hash();this.posts=new Hash();},onShow:function(first){if(first){this.startPoll();}},onHide:function(){},facebookSelfData:function(user){this.statusBox=new FacebookStatusBox(user,true);$(this.statusBox).inject(this.content,"top");},startPoll:function(){if(!$defined(this.pollTimer)){this.pollTimer=this.facebookFeed.periodical(55*1000,this);this.facebookFeed();}},facebookFeed:function(){var startTime=this.loader.lowestSortValue;var params={start_time:startTime,end_time:0};this.call("facebook","facebook_newsfeed_load",params,this.loadMoreSuccess.bind(this),null);},loadMore:function(){var endTime=this.loader.lowestSortValue;var startTime=parseInt(endTime)-259200;var params={start_time:startTime,end_time:endTime};this.call("facebook","facebook_newsfeed_load",params,this.loadMoreSuccess.bind(this),null);},loadMoreSuccess:function(data){if(!$defined(data)||data.length==0){this.atBottom=true;return;}data.each(function(item){this.loader.process(item);this.processComments(item);},this);this.bottomFuncCalled=false;},processComments:function(item){if(this.posts.has(item.post_id)){if(this.posts.get(item.post_id)!=item.comment_count){$$(".comments_"+item.post_id).each(function(el){var commentText=TextUtility.pluralText(item.comment_count,"Comment","Comments");el.set("comments",item.comment_count);el.empty();el.adopt(new Element("div",{"class":"action convo"}));el.appendText(commentText);});}var likePost=$$(".likes_"+item.post_id);if($defined(likePost[0])){var likesCount=parseInt(likePost[0].get("likes"));if(likesCount!=parseInt(item.like_count)){this.facebookItemLikeSuccess({post_id:item.post_id,liked:item.user_likes,like_count:item.like_count});}}}else{this.posts.set(item.post_id,item.comment_count);}},bottomFunc:function(){Logger().log("facebook content bottom");this.loadMore();},facebookItemDelete:function(post_id,created_time){var params={"post_id":post_id,"created_time":created_time};this.call("facebook","facebook_feed_delete",params,this.facebookItemDeleteSuccess.bind(this),null);},facebookItemDeleteSuccess:function(data){if(!$defined(data.post_id)){return;}this.loader.remove(data.post_id);},facebookItemLike:function(post_id,likeEl){var user_likes=parseInt(likeEl.get("is_liked"));var like_count=parseInt(likeEl.get("likes"));var params={"post_id":post_id,"like_count":like_count};if(parseInt(user_likes)==0){this.call("facebook","facebook_post_like",params,this.facebookItemLikeSuccess.bind(this),null);}else{this.call("facebook","facebook_post_unlike",params,this.facebookItemLikeSuccess.bind(this),null);}},facebookItemLikeSuccess:function(data){if(!$defined(data.post_id)){return;}$$(".likes_"+data.post_id).each(function(el){el.set("likes",data.like_count);if(data.liked!=-1){el.set("is_liked",data.liked);}el.empty();new Element("div",{"class":"text grey text11","text":data.like_count,"likes":data.like_count}).inject(el);if(data.like_count>0){el.addClass("other_liked");}else{el.removeClass("other_liked");}if(data.liked!=-1){if(data.liked==1){el.addClass("on");}else{el.removeClass("on");}}});},facebookCommentsShow:function(el,post_id){if(this.comments.has(post_id)){this.facebookCommentsHide(post_id);}else{this.comments.set(post_id,el);var commentsLoader=new ItemLoader({idField:"id",sortField:"time",sortAscending:true,createElementFunc:FacebookCommentItemUtility.createFacebookCommentItem});$(commentsLoader).inject(el,"after");this.commentLoaders.set(post_id,commentsLoader);var params={"post_id":post_id};this.call("facebook","facebook_comments",params,this.facebookCommentsSuccess.bind(this),null);}},facebookCommentsUpdated:function(post_id){var params={"post_id":post_id};this.call("facebook","facebook_comments",params,this.facebookCommentsSuccess.bind(this),null);},facebookCommentsHide:function(post_id){var loader=this.commentLoaders.get(post_id);loader.items.each(function(value,key){loader.remove(key);},this);this.commentLoaders.erase(post_id);this.comments.erase(post_id);},facebookCommentsSuccess:function(data){if(!$defined(data.post_id)){return;}var loader=this.commentLoaders.get(data.post_id);if(!$defined(data.comment_list)||data.comment_list.length==0){this.atBottom=true;return;}data.comment_list.each(function(item){loader.process(item);},this);this.bottomFuncCalled=false;}});var FacebookFriendContent=new Class({Extends:Content,EventHandlers:[],onBeforeInit:function(options){this.user=options.user;this.uid=options.uid;},onInit:function(){this.loader=new ItemLoader({idField:"uid",sortField:"last_name",createElementFunc:FacebookFriendItemUtility.createFacebookFriendItem,emptyEl:new Element("div",{"class":"post empty","text":"You have no friends!"})});$(this.loader).inject(this.content);},onShow:function(first){if(first){var params={"uid":this.uid,"limit":50,"sort_field":"last_name","number":""};this.call("facebook","facebook_friends_info",params,this.facebookFriendsSuccess.bind(this),null);}},onHide:function(){},facebookFriendsSuccess:function(data){if(!$defined(data)||data.length==0){return;}data.each(function(item){this.loader.process(item);},this);this.bottomFuncCalled=false;},bottomFunc:function(){var curBatch=this.loader.count();var nextBatch=curBatch+50;var params={"uid":this.uid,"limit":curBatch+","+nextBatch,"sort_field":"last_name","number":""};this.call("facebook","facebook_friends_info",params,this.facebookFriendsSuccess.bind(this),null);}});var FacebookUserContent=new Class({Extends:Content,EventHandlers:["facebookUserData"],onBeforeInit:function(options){this.uid=options.uid;this.name=options.username;options.displayName=options.username;return options;},onInit:function(){this.loader=new ItemLoader({idField:"post_id",sortField:"created_time",sortAscending:false,createElementFunc:FacebookFeedItemUtility.createFacebookFeedItem,emptyEl:new Element("div",{"class":"post empty","text":"This user has no updates"})});$(this.loader).inject(this.content);if($defined(this.uid)){this.startPoll();}},onShow:function(first){if(first){this.loadMore();}},onHide:function(){},startPoll:function(){if(!$defined(this.userPollTimer)){this.userPollTimer=this.fbUserFeed.periodical(55*1000,this);this.fbUserFeed();}},fbUserFeed:function(){var startTime=this.loader.lowestSortValue;var params={user_id:this.uid,start_time:startTime,end_time:0};this.call("facebook","facebook_user_feed",params,this.loadMoreSuccess.bind(this),null);},facebookUserData:function(user){if((user.uid!=this.uid)||($defined(this.statusBox))){return;}this.statusBox=new FacebookStatusBox(user,false);$(this.statusBox).inject(this.content,"top");},loadMore:function(){var endTime=this.loader.lowestSortValue;var startTime=parseInt(endTime)-259200;var params={user_id:this.uid,start_time:startTime,end_time:endTime};this.call("facebook","facebook_user_feed",params,this.loadMoreSuccess.bind(this),null);},loadMoreSuccess:function(data){if(!$defined(data.feed)||data.feed.length==0){this.atBottom=true;return;}data.feed.each(function(item){this.loader.process(item);},this);this.bottomFuncCalled=false;},bottomFunc:function(){Logger().log("facebook content bottom");this.loadMore();}});var FacebookWallContent=new Class({Extends:Content,EventHandlers:["facebookSelfData"],onBeforeInit:function(options){this.uid=options.uid;options.displayName=options.username;return options;},onInit:function(){this.loader=new ItemLoader({idField:"post_id",sortField:"created_time",sortAscending:false,createElementFunc:FacebookFeedItemUtility.createFacebookFeedItem,emptyEl:new Element("div",{"class":"post empty","text":"You have no updates"})});$(this.loader).inject(this.content);if($defined(this.uid)){this.startPoll();}},onShow:function(first){if(first){this.loadMore();}},onHide:function(){},startPoll:function(){if(!$defined(this.wallPollTimer)){this.wallPollTimer=this.fbUserFeed.periodical(55*1000,this);this.fbUserFeed();}},fbUserFeed:function(){var startTime=this.loader.lowestSortValue;var params={user_id:this.uid,start_time:startTime,end_time:0};this.call("facebook","facebook_user_feed",params,this.loadMoreSuccess.bind(this),null);},facebookSelfData:function(user){if($defined(this.statusBox)){return;}this.statusBox=new FacebookStatusBox(user,true);$(this.statusBox).inject(this.content,"top");},loadMore:function(){var endTime=this.loader.lowestSortValue;var startTime=parseInt(endTime)-259200;var params={user_id:this.uid,start_time:startTime,end_time:endTime};this.call("facebook","facebook_user_feed",params,this.loadMoreSuccess.bind(this),null);},loadMoreSuccess:function(data){if(!$defined(data.feed)||data.feed.length==0){this.atBottom=true;return;}data.feed.each(function(item){this.loader.process(item);},this);this.bottomFuncCalled=false;},bottomFunc:function(){Logger().log("facebook content bottom");this.loadMore();}});var FacebookShareBox=new Class({Extends:Base,EventHandlers:["userSwitched","facebookShareBoxShow","facebookCommentBoxShow"],init:function(){this.shareboxes=$H();},userSwitched:function(){if(!this.isLoggedIn()){this.userLoggedOut();}},userLoggedOut:function(){this.shareboxes.each(function(sharebox,key){sharebox.close();this.shareboxes.erase(key);},this);this.shareboxes=$H();},facebookShareBoxShow:function(user,isSelf){if($defined(this.sharebox)){this.sharebox.close();}this.createShareBox(user,isSelf);},createShareBox:function(user,isSelf){this.sharebox=new Popup({size:{x:500,y:100},resizable:false,dockable:false,className:"facebook sharebox",onClose:this.destroyShareBox.bind(this)});var displayName=(isSelf)?"Write in Your Facebook Feed":"Write on "+user.first_name+"'s Wall";var nav=new Nav({iconOptions:{iconName:user.pic_square},displayName:displayName,closable:true});var content=new FacebookShareBoxPopupContent({user:user,is_self:isSelf});this.sharebox.addContent("sharebox",nav,content);},facebookCommentBoxShow:function(post_id){if($defined(this.commentbox)){this.commentbox.close();}this.createCommentBox(post_id);},createCommentBox:function(post_id){this.sharebox=new Popup({size:{x:500,y:100},resizable:false,dockable:false,className:"facebook sharebox",onClose:this.destroyShareBox.bind(this)});var displayName="Comment on a post";var nav=new Nav({iconOptions:{iconName:"updates"},displayName:displayName,closable:true});var content=new FacebookShareBoxPopupContent({post_id:post_id,is_self:true});this.sharebox.addContent("sharebox",nav,content);},destroyShareBox:function(name){this.sharebox=null;}});var FacebookShareBoxPopupContent=new Class({Extends:PopupContent,onBeforeInit:function(options){this.user=options.user;this.post_id=options.post_id;if(!options.is_self){this.target_id=this.user.uid;}return options;},reset:function(){Logger().log("resetting");this.closeAttachmentPopup();this.content.empty();this.onInit();},onInit:function(){this.formEl=null;this.isPublic=true;this.readyToPost=false;this.input=new Element("textarea",{"maxlength":2000});this.input.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));new Element("div",{"class":"textarea_wrapper"}).adopt(this.input).inject(this.content);this.cancelButton=new ButtonMedium({displayName:"Close",className:"dark",action:"cross"});$(this.cancelButton).addEvent("click",this.closeContent.bind(this));this.updateButton=new ButtonMedium({displayName:"Post",className:"dark",action:"check"});$(this.updateButton).addEvent("click",this.post.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.updateButton),$(this.cancelButton)).inject(this.content);this.focus();},inputKeyUp:function(e){if(e.shift&&e.key=="enter"){e.preventDefault();this.post();}if(DomUtility.textareaAutoSize(e.target,40)){this.updateSize();}},updateSize:function(){var h=this.input.getSize().y+10;h+=this.actions.getSize().y+30;this.resizePopup(500,h);},post:function(){var body=this.input.value.trim();Logger().log(body);if(body==""&&this.attachment.type==AttachmentType.None){this.fireEvent("showAlert","empty_post","Problem Posting","Please enter some content to post.");return;}if(!$defined(this.post_id)){this.post_id="";}if(!$defined(this.target_id)){this.target_id=0;}var params={"body":body,"post_id":this.post_id,"target_id":this.target_id};this.call("facebook","facebook_post_text",params,this.postSuccess.bind(this),this.postFail.bind(this),this.formEl);this.updateButton.showProgress();},postSuccess:function(){this.updateButton.hideProgress();this.closeContent();if($defined(this.post_id)){this.fireEvent("facebookCommentsUpdated",this.post_id);}this.fireEvent("facebookFeed");},postFail:function(){this.updateButton.hideProgress();},onShow:function(){this.focus();},focus:function(){this.input.focus.delay(500,this.input);}});var FacebookStatusBox=new Class({Extends:Base,EventHandlers:[],init:function(user,isSelf){this.user=user;this.isSelf=isSelf;this.defaultStatus="has no current status";this.createStatusBox();},createStatusBox:function(){this.box=ItemUtility.createPostBubble("post status_message haspic");ItemUtility.createItemPic(this.user.pic_square).inject(this.box);var buttonText=this.isSelf?"Write in Your Feed":"Write on "+this.user.first_name+"'s Wall";this.writeButton=new Element("div",{"class":"button","text":TextUtility.unescape(buttonText)}).inject(this.box);this.writeButton.addEvent("click",this.fireEvent.bind(this,["facebookShareBoxShow",this.user,this.isSelf]));this.content=new Element("div",{"class":"post_content"}).inject(this.box);var header=new Element("div",{"class":"header"}).inject(this.content);var creator=new Element("span",{"class":"user_name","text":TextUtility.unescapeQuotes(this.user.name)}).inject(header);this.status=new Element("span",{"class":"status"}).inject(header);this.updateStatus();},updateStatus:function(){if($defined(this.user.status.message)&&this.user.status.message!=""){this.status.removeClass("empty");this.status.set("text"," "+TextUtility.unescape(this.user.status.message.trim()));}else{this.status.addClass("empty");this.status.set("text"," "+TextUtility.unescape(this.defaultStatus));}},toElement:function(){return this.box;}});var FacebookUserMenu=new Class({Extends:Menu,onBeforeInit:function(options){this.uid=options.user.uid;this.name=options.user.username;options.displayName=this.name;options.className="facebook";this.pic=options.user.pic;this.user=options.user;return options;},onInit:function(){this.aboutSection=new Element("div",{"class":"text_section light1"}).inject(this.menu);this.call("facebook","facebook_user_show",{user_id:this.uid},this.profileShowSuccess.bind(this),null);},profileShowSuccess:function(data){if(!$defined(data)||data==""){return;}this.user=data;if(data.pic_square==""){data.pic_square;}this.pic=new Element("div",{"class":"user_pic"}).inject(this.menu);ItemUtility.createItemPic(data.pic_square).inject(this.pic);var location="";if($defined(data.current_location.city)){location=data.current_location.city;if($defined(data.current_location.state)){location=location+", "+data.current_location.state;}}else{if($defined(data.current_location.state)){location=data.current_location.state;}else{if($defined(data.current_location.country)){location+=" "+data.current_location.country;}}}if(location!=""){this.locSection=new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Location: "}),new Element("span",{"text":location})).inject(this.menu);}if($defined(data.affiliations)&&data.affiliations.length>0){var networks="";for(var i=0;i<data.affiliations.length-1;i++){networks+=data.affiliations[i].name+", ";}networks+=data.affiliations[i].name;this.networksSection=new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Networks: "}),new Element("span",{"text":networks})).inject(this.menu);}if($defined(data.sex)&&data.sex!=""){this.genderSection=new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Gender: "}),new Element("span",{"text":data.sex})).inject(this.menu);}if($defined(data.birthday)&&data.birthday!=""){this.genderSection=new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Birthday: "}),new Element("span",{"text":data.birthday})).inject(this.menu);}if($defined(data.relationship_status)&&data.relationship_status!=""){this.relationSection=new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Relationship Status: "}),new Element("span",{"text":data.relationship_status})).inject(this.menu);}this.fireEvent("facebookUserData",data);}});var FacebookSelfMenu=new Class({Extends:Menu,onBeforeInit:function(options){this.appId=5;this.user=options.user;options.displayName=this.user.fullname;options.className="facebook";this.fb_uid=options.uid;return options;},onInit:function(){this.aboutSection=new Element("div",{"class":"text_section light1"}).inject(this.menu);this.call("facebook","facebook_user_show",{user_id:this.fb_uid},this.profileShowSuccess.bind(this),null);},profileShowSuccess:function(data){if(!$defined(data)||data==""){return;}this.user=data;if(data.pic_square==""){data.pic_square;}this.pic=new Element("div",{"class":"user_pic"}).inject(this.menu);ItemUtility.createItemPic(data.pic_square).inject(this.pic);var location="";if($defined(data.current_location.city)){location=data.current_location.city;if($defined(data.current_location.state)){location=location+", "+data.current_location.state;}}else{if($defined(data.current_location.state)){location=data.current_location.state;}else{if($defined(data.current_location.country)){location+=" "+data.current_location.country;}}}if(location!=""){this.locSection=new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Location: "}),new Element("span",{"text":location})).inject(this.menu);}if($defined(data.affiliations)&&data.affiliations.length>0){var networks="";for(var i=0;i<data.affiliations.length-1;i++){networks+=data.affiliations[i].name+", ";}networks+=data.affiliations[i].name;this.networksSection=new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Networks: "}),new Element("span",{"text":networks})).inject(this.menu);}if($defined(data.sex)&&data.sex!=""){this.genderSection=new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Gender: "}),new Element("span",{"text":data.sex})).inject(this.menu);}if($defined(data.birthday)&&data.birthday!=""){this.genderSection=new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Birthday: "}),new Element("span",{"text":data.birthday})).inject(this.menu);}if($defined(data.relationship_status)&&data.relationship_status!=""){this.relationSection=new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Relationship Status: "}),new Element("span",{"text":data.relationship_status})).inject(this.menu);}this.call("facebook","facebook_settings_get",{},this.settingsGetSuccess.bind(this),null);this.fireEvent("facebookSelfData",data);},settingsGetSuccess:function(data){if(!$defined(data.settings.sync_posts)){return;}this.sync_posts=data.settings.sync_posts;new Element("div",{"class":"nav_seperator"}).inject(this.menu);this.syncPosts=new Toggle(this.sync_posts==1);$(this.syncPosts).addEvent("click",this.syncToggle.bind(this));new Element("div",{"class":"toggle_section"}).adopt(new Element("div",{"class":"text light","text":"Sync Posts:"}),$(this.syncPosts)).inject(this.menu);},syncToggle:function(){var params={key:"sync_posts",value:this.syncPosts.toInt()};this.call("facebook","facebook_settings_update",params);}});var FacebookInstallPopupContent=new Class({Extends:PopupContent,strings:{postSyncLabel:"Sync posts to Facebook:",errorMessage:"There was an error connecting to Facebook"},onInit:function(){this.appId=5;FB_RequireFeatures(["Connect"],function(){FB.Facebook.init("d29a9328a49d798da896066499c0d9d8","/xd_receiver.htm",{"forceBrowserPopupForLogin":true,"doNotUseCachedConnectState":true});});this.syncPostsToggle=new Toggle(true);new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.postSyncLabel}),$(this.syncPostsToggle)).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Install Facebook",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.facebookConnect.bind(this));this.message=new Element("div",{"class":"message error"});this.actions=new Element("div",{"class":"actions"}).adopt(this.message,$(this.actionButton),$(this.closeButton)).inject(this.content);},facebookConnect:function(){FB.Connect.requireSession(this.facebookGetPermission.bind(this),this.facebookConnectFail.bind(this));},facebookGetPermission:function(){FB.Connect.showPermissionDialog("offline_access,publish_stream,read_stream,status_update,email,xmpp_login",this.facebookEnable.bind(this));},facebookEnable:function(){this.fb_session=FB.Facebook.apiClient.get_session();var sync=this.syncPostsToggle.toInt();var params={sync_posts:this.syncPostsToggle.toInt(),session_key:this.fb_session.session_key,uid:this.fb_session.uid};this.call("facebook","facebook_enable",params,this.facebookEnableSuccess.bind(this),null);},facebookEnableSuccess:function(){this.closeContent();},facebookConnectFail:function(){var name="facebook_connect";var title="Error Connecting to Facebook";var message=this.strings.errorMessage;this.fireEvent("showAlert",name,title,message);}});var FacebookAlbumUtility={createFacebookAlbumItem:function(album){var el=ItemUtility.createPostBubble("post album",true);var thumb=new Element("div",{"class":"cover"}).adopt(new Element("img",{"src":album.coverSrc,"alt":album.description,"title":album.description})).inject(el);thumb.addEvent("click",pipio.dispatchEvent.bind(pipio,["facebookAlbumView",album]));var title=new Element("div",{"class":"user_name clickable","text":TextUtility.unescape(album.name)});var header=new Element("div",{"class":"heading"}).adopt(title).inject(el);title.addEvent("click",pipio.dispatchEvent.bind(pipio,["facebookAlbumView",album]));var size=new Element("span",{"class":"size","text":TextUtility.pluralText(album.size,"Photo","Photos")}).inject(header);var location=new Element("span",{"class":"location"}).inject(header);if(album.location.trim()!=""){location.set("text"," | "+TextUtility.unescape(album.location.trim()));}var description=new Element("div",{"class":"description"}).inject(el);if(album.description.trim()!=""){description.set("text"," "+TextUtility.unescape(album.description.trim()));}var viewButton=new ButtonMedium({displayName:"View Album",action:"goto dark"});$(viewButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["facebookAlbumView",album]));new Element("div",{"class":"actions"}).adopt($(viewButton)).inject(el);return el;}};var FacebookCommentItemUtility={createFacebookCommentItem:function(item){var el=ItemUtility.createPostBubble("post haspic fbComment");ItemUtility.createItemPic(item.profile_pic).inject(el);var content=new Element("div",{"class":"post_content"}).inject(el);FacebookCommentItemUtility.createFacebookItemHeader(item).inject(content);FacebookCommentItemUtility.createFacebookItemFooter(item).inject(content);return el;},createFacebookItemHeader:function(item){var el=new Element("div",{"class":"header"});var user={username:item.name,uid:item.fromid,pic:item.profile_pic};var creatorName=new Element("span",{"class":"user_name clickable","text":TextUtility.unescapeQuotes(item.name)}).inject(el);creatorName.addEvent("click",pipio.dispatchEvent.bind(pipio,["facebookShowUserFeed",user]));if($defined(item.text)&&item.text!=""){new Element("span",{"html":" "+TextUtility.replaceUrls(TextUtility.stripHtml(TextUtility.unescape(item.text)))}).inject(el);}return el;},createFacebookItemFooter:function(item){var el=new Element("div",{"class":"footer"});if(!$defined(item.time)){return el;}var date=DateUtility.convertFromTimestamp(item.time);var ts=new Element("span",{"class":"timestamp","text":DateUtility.getTimestamp(date,"%B %D at %I:%M%p"),"ts":date,"ts_format":"%B %D at %I:%M%p"}).inject(el);return el;}};var FacebookFeedItemUtility={createFacebookFeedItem:function(item){var el=ItemUtility.createPostBubble("post haspic");ItemUtility.createItemPic(item.profile_pic).inject(el);var content=new Element("div",{"class":"post_content facebook"}).inject(el);FacebookFeedItemUtility.createFacebookItemHeader(item).inject(content);FacebookFeedItemUtility.createFacebookItemBody(item).inject(content);FacebookFeedItemUtility.createFacebookItemFooter(item,el).inject(content);FacebookFeedItemUtility.createFacebookItemActions(item).inject(el);return el;},createFacebookItemHeader:function(item){var el=new Element("div",{"class":"header"});var user={username:item.name,uid:item.actor_id,pic:item.profile_pic};var target={username:item.target_name,uid:item.target_id,pic:""};var creatorName=new Element("span",{"class":"user_name clickable","text":TextUtility.unescapeQuotes(item.name)}).inject(el);creatorName.addEvent("click",pipio.dispatchEvent.bind(pipio,["facebookShowUserFeed",user]));if(item.target_id>0){StreamItemUtility.createStreamUserAction("direct").inject(el);var targetName=new Element("span",{"class":"user_name clickable","text":TextUtility.unescapeQuotes(item.target_name)}).inject(el);targetName.addEvent("click",pipio.dispatchEvent.bind(pipio,["facebookShowUserFeed",target]));}if($defined(item.message)&&item.message!=""){new Element("span",{"html":" "+TextUtility.replaceUrls(TextUtility.stripHtml(TextUtility.unescape(item.message)))}).inject(el);}return el;},createFacebookItemBody:function(item){var el=new Element("div",{"class":"body"});var fbUrl;if(item.attachment!=""&&$defined(item.attachment.media)&&$defined(item.attachment.media.length)){for(var i=0,n=item.attachment.media.length;i<n;i++){if(item.attachment.media[i].type=="photo"){fbUrl=DataUtility.getFacebookPhotoUrl(item.attachment.media[i].src);}else{fbUrl=item.attachment.media[i].src;}var image=new Element("img",{"src":item.attachment.media[i].src,"class":"fbPhoto"}).inject(el);var attachment={url:fbUrl,filename:"Facebook Photo"};image.addEvent("click",pipio.dispatchEvent.bind(pipio,["showPhotoPopup",attachment]));}new Element("br",{}).inject(el);}if($defined(item.attachment.name)){new Element("a",{"href":item.attachment.href,"target":"_blank","text":item.attachment.name}).inject(el);new Element("br",{}).inject(el);}new Element("span",{"text":item.attachment.description}).inject(el);return el;},createFacebookItemFooter:function(item,postElement){var el=new Element("div",{"class":"footer foot_"+item.post_id});if(!$defined(item.date_created)){return el;}var date=DateUtility.convertFromTimestamp(item.created_time);var ts=new Element("span",{"class":"timestamp","text":DateUtility.getTimestamp(date,"%B %D at %I:%M%p"),"ts":date,"ts_format":"%B %D at %I:%M%p"}).inject(el);FacebookFeedItemUtility.createFacebookFooterActions(item,el,postElement);return el;},createFacebookFooterActions:function(item,el,postElement){var commentsAction=new Element("span",{"class":"footer_action has_action comments_"+item.post_id,"comments":item.comment_count}).adopt(new Element("div",{"class":"action convo"}));commentsAction.appendText(TextUtility.pluralText(item.comment_count,"Comment","Comments"));commentsAction.addEvent("click",pipio.dispatchEvent.bind(pipio,["facebookCommentsShow",postElement,item.post_id]));commentsAction.inject(el);var replyAction=FacebookFeedItemUtility.createFacebookFooterAction("reply","Comment",true);replyAction.addEvent("click",pipio.dispatchEvent.bind(pipio,["facebookCommentBoxShow",item.post_id]));replyAction.inject(el);},createFacebookItemActions:function(item){var el=new Element("div",{"class":"post_actions"});if(item.can_delete){var deleteAction=new Element("div",{"class":"post_action delete"}).inject(el);deleteAction.addEvent("click",pipio.dispatchEvent.bind(pipio,["facebookItemDelete",item.post_id,item.created_time]));}var likeAction=new Element("div",{"class":"post_action like likes_"+item.post_id,"is_liked":item.user_likes,"likes":item.like_count}).inject(el);likeAction.addEvent("click",pipio.dispatchEvent.bind(pipio,["facebookItemLike",item.post_id,likeAction]));new Element("div",{"class":"text grey text11","text":item.like_count,"likes":item.like_count}).inject(likeAction);if(item.like_count>0){likeAction.addClass("other_liked");}if(item.user_likes==1){likeAction.addClass("on");}return el;},createFacebookFooterAction:function(actionName,actionText,hide){var el=new Element("span",{"class":"footer_action has_action"}).adopt(new Element("div",{"class":"action "+actionName}));el.appendText(actionText);if(hide){el.addClass("hide");}return el;}};var FacebookFriendItemUtility={createFacebookFriendItem:function(user){var el=ItemUtility.createPostBubble("post contact",true);new Element("img",{"class":"profile_pic_wrapper_60 afb_profile_pic","src":user.pic}).inject(el);var username=new Element("div",{"class":"user_name clickable","text":TextUtility.unescape(user.username)});new Element("div",{"class":"heading"}).adopt(username).inject(el);username.addEvent("click",pipio.dispatchEvent.bind(pipio,["facebookShowUserFeed",user]));var viewButton=new ButtonMedium({displayName:"View Wall",action:"goto dark"});$(viewButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["facebookShowUserFeed",user]));new Element("div",{"class":"actions"}).adopt($(viewButton)).inject(el);return el;}};var Global=new Class({Extends:AppInstance,EventHandlers:["userSwitched"],parseOptions:function(options){this.location=options.location;this.displayName="global",this.appId="global_"+this.location.geohash;this.iconOptions={iconName:"location"};},userSwitched:function(){this.stop();},onStart:function(){this.setupNav();},onStop:function(){var params={geohashs:this.location.geohash,location:JSON.encode(this.location),zoom:4,subscribe:0};this.call("global","global_subscribe_delete",params);}});Global.implement({requests:[{name:"global_subscribe_add",params:["geohashs","location","zoom","subscribe"],url:"/api/pipio/global/subscribe/add"},{name:"global_subscribe_delete",params:["geohashs","location","zoom","subscribe"],url:"/api/pipio/global/subscribe/delete"}]});Global.implement({setupNav:function(){Logger().log("global setup");this.navAdd(new Nav({iconOptions:{iconName:"global"},displayName:"Updates",name:"updates",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"updates","global_menu"])}));var globalMenu=new GlobalMenu({location:this.location,isDefault:true,closeFunc:this.stop.bind(this)});this.menuAdd("global_menu",globalMenu);var content=new GlobalContent({isDefault:true,location:this.location});this.contentAdd("updates",content);}});var GlobalContent=new Class({Extends:Content,EventHandlers:["globalItemReceived"],onBeforeInit:function(options){this.location=options.location;},onInit:function(){this.loader=new StreamLoader({createElementFunc:StreamItemUtility.createUserStreamItem,emptyEl:new Element("div",{"class":"post empty","text":"This location has no updates"}),loadingEl:new Element("div",{"class":"post empty","text":"Updates loading..."})});$(this.loader).inject(this.content);},onShow:function(first){if(first){this.loadMore();}},onHide:function(){},globalItemReceived:function(data){if(data.item.geohash.substring(0,4)==this.location.geohash.substring(0,4)){this.loader.process(data.item);}},loadMore:function(){var params={geohash:this.location.geohash.substring(0,4),date_created:this.loader.oldestTimestamp,item_id:this.loader.oldestId};this.call("home","stream_global_load",params,this.loadMoreSuccess.bind(this),this.loadMoreFail.bind(this));this.loader.showLoading();},loadMoreSuccess:function(data){this.loader.hideLoading();if(this.loader.empty){var params={geohashs:this.location.geohash,location:JSON.encode(this.location),zoom:4,subscribe:0};this.call("global","global_subscribe_add",params);}if(!$defined(data.items)||data.items.length==0){this.atBottom=true;return;}data.items.each(function(item){this.loader.process(item);},this);this.bottomFuncCalled=false;},loadMoreFail:function(status){this.loader.hideLoading();if(status.code==2002){this.loader.showError();}},bottomFunc:function(){this.loadMore();}});var GlobalMenu=new Class({Extends:Menu,EventHandlers:[],onBeforeInit:function(options){this.location=options.location;var locationLabel=DataUtility.getGeoLabel(this.location);var locationStr=DataUtility.getGeoLocality(this.location);if(locationLabel){locationStr=locationLabel+", "+locationStr;}options.displayName=locationStr;return options;},onInit:function(){this.map=new GlobalMapMenuSection({location:this.location});$(this.map).inject(this.menu);new Element("div",{"class":"text_section light1 text11","text":"You are viewing updates near this location"}).inject(this.menu);}});var Home=new Class({Extends:App,EventHandlers:["userSwitched","streamItemReplyCountUpdated","streamItemDelete","userStreamItemLiked","streamItemLike","roomProfilePicUpdated","feedRoomKick","feedRoomRequestAccept","feedRoomRequestDelete","feedRoomAdded","feedRoomDeleted","feedRoomDelete","showCreateRoomPopup","showRoomInvitePopup","showRoomStatusUpdatePopup","showEditProfilePopup","showEditRoomProfilePopup","showConvo"],onStart:function(){this.setupNav();this.initRooms();this.convos=$H();},onStop:function(){},userSwitched:function(){if(this.isLoggedIn()){this.start();}else{this.stop();}},onCreate:function(){this.closeButton.destroy();$("app_button_2").addEvent("click",this.switchDefault.bind(this));},dock:function(){DomUtility.hide(this.navSection);$(this.alert).inject("app_button_2");$("app_button_2").addClass("has_submenu");this.navWrapper.inject("app_button_2","after");$("app_button_2").removeEvents("click");$("app_button_2").addEvent("click",this.undock.bind(this));this.isDocked=true;},undock:function(){this.navWrapper.inject(this.navSection);$("app_button_2").removeClass("has_submenu");$("app_button_2").removeEvents("click");$("app_button_2").addEvent("click",this.switchDefault.bind(this));DomUtility.show(this.navSection);this.isDocked=false;if($defined(this.defaultContent)){this.fireEvent("viewSwitch",this.appId,this.defaultContent,this.defaultMenu);}},streamItemReplyCountUpdated:function(data){if(!$defined(data.item_id)||!$defined(data.count)){return;}StreamItemUtility.updateReplyCount(data.item_id,data.count);},userStreamItemLiked:function(data){if(!$defined(data.item)||!$defined(data.username)){return;}if(data.username==this.getPrivateUser().username){StreamItemUtility.updateItemLiked(data.item.item_id,data.likes,data.is_liked);}else{StreamItemUtility.updateItemLiked(data.item.item_id,data.likes,-1);}},streamItemLike:function(item_id,el){this.call("home","stream_item_like",{item_id:item_id},null,null);var is_liked=parseInt(el.get("is_liked"));var likes=parseInt(el.get("likes"));if(is_liked==1){StreamItemUtility.updateItemLiked(item_id,likes-1,0);}else{StreamItemUtility.updateItemLiked(item_id,likes+1,1);}},streamItemDelete:function(item_id){var name="stream_item_delete";var title="Delete Post";var message="Are you sure you want to delete this post?";var func=this.streamItemDeleteCall.bind(this,[item_id]);this.fireEvent("showConfirmation",name,title,message,func);},streamItemDeleteCall:function(item_id){var params={item_id:item_id};this.call("home","delete",params,null,null);},showRoom:function(room){if(this.rooms.has(room.username)){this.fireEvent("viewSwitch",this.appId,"room_"+room.username,"room_"+room.username);}else{var options={room:room};this.fireEvent("startAppInstance","room",room.username,options);}},roomProfilePicUpdated:function(data){if(!$defined(data.username)){return;}var room=this.getRoom(data.username);var room_id=room.room_id;var username=room.username;var version=UserUtility.profilePicVersionGet(room_id);version++;UserUtility.profilePicVersionSet(room_id,version);room.profile_pic_16=room.profile_pic_16.split("?")[0]+"?"+version;room.profile_pic_20=room.profile_pic_20.split("?")[0]+"?"+version;room.profile_pic_26=room.profile_pic_26.split("?")[0]+"?"+version;room.profile_pic_32=room.profile_pic_32.split("?")[0]+"?"+version;room.profile_pic_42=room.profile_pic_42.split("?")[0]+"?"+version;room.profile_pic_60=room.profile_pic_60.split("?")[0]+"?"+version;room.profile_pic_100=room.profile_pic_100.split("?")[0]+"?"+version;room.profile_pic_200=room.profile_pic_200.split("?")[0]+"?"+version;$$(".profile_pic_16_"+username).each(function(el){el.set("src",room.profile_pic_16);});$$(".profile_pic_20_"+username).each(function(el){el.set("src",room.profile_pic_20);});$$(".profile_pic_60_"+username).each(function(el){el.set("src",room.profile_pic_60);});$$(".profile_pic_26_"+username).each(function(el){el.set("src",room.profile_pic_26);});$$(".profile_pic_32_"+username).each(function(el){el.set("src",room.profile_pic_32);});$$(".profile_pic_42_"+username).each(function(el){el.set("src",room.profile_pic_42);});$$(".profile_pic_100_"+username).each(function(el){el.set("src",room.profile_pic_100);});$$(".profile_pic_200_"+username).each(function(el){el.set("src",room.profile_pic_200);});}});Home.implement({requests:[{name:"stream_in_load",params:["date_created","item_id"],url:"/api/pipio/stream/in/load"},{name:"stream_user_load",params:["username","date_created","item_id"],url:"/api/pipio/stream/user/load"},{name:"public_stream_user_load",params:["username","date_created","item_id"],url:"/api/public/stream/user/load"},{name:"stream_room_load",params:["username","date_created","item_id"],url:"/api/pipio/stream/room/load"},{name:"public_stream_room_load",params:["username","date_created","item_id"],url:"/api/public/stream/room/load"},{name:"stream_convo_load",params:["convo_id","date_created","item_id"],url:"/api/pipio/stream/convo/load"},{name:"stream_likes_load",params:["username","date_created","item_id"],url:"/api/pipio/stream/likes/load"},{name:"stream_global_load",params:["geohash","date_created","item_id"],url:"/api/pipio/stream/global/load"},{name:"stream_item_like",params:["item_id"],url:"/api/pipio/stream/like"},{name:"publish",url:"/api/pipio/stream/publish",params:["body","targets","source_id","source_type","reply_id","channel_id","is_public","res","attachment"]},{name:"forward",url:"/api/pipio/stream/forward",params:["body","targets","source_id","source_type","forward_id","channel_id","is_public","res"]},{name:"delete",url:"/api/pipio/stream/delete",params:["item_id"]},{name:"parse_hulu_url",url:"/api/pipio/link/parse/hulu",params:["url"]},{name:"parse_break_url",url:"/api/pipio/link/parse/break",params:["url"]},{name:"room_create",url:"/api/pipio/room/create",params:["username","room_name","room_description","is_public"]},{name:"room_delete",url:"/api/pipio/room/delete",params:["username"]},{name:"room_leave",url:"/api/pipio/room/leave",params:["username"]},{name:"room_kick",url:"/api/pipio/room/kick",params:["username","room_username"]},{name:"room_subscribe",url:"/api/pipio/room/subscribe",params:["username"]},{name:"room_unsubscribe",url:"/api/pipio/room/unsubscribe",params:["username"]},{name:"room_request_create",url:"/api/pipio/room/request/create",params:["username"]},{name:"room_request_delete",url:"/api/pipio/room/request/delete",params:["username","room_username"]},{name:"room_request_accept",url:"/api/pipio/room/request/accept",params:["username","room_username"]},{name:"room_invite_create",url:"/api/pipio/room/invite/create",params:["username","room_username"]},{name:"room_invite_accept",url:"/api/pipio/room/invite/accept",params:["username"]},{name:"room_invite_delete",url:"/api/pipio/room/invite/delete",params:["username","room_username"]},{name:"room_info_load",url:"/api/pipio/room/info/load",params:["username"]},{name:"public_room_info_load",url:"/api/public/room/info/load",params:["username"]},{name:"public_user_info_load",url:"/api/public/user/info/load",params:["username"]},{name:"room_privacy_set",url:"/api/pipio/room/privacy/set",params:["username","is_public"]},{name:"room_profile_update",url:"/api/pipio/room/profile/update",params:["username","bio","url"]},{name:"room_search",url:"/api/pipio/room/search",params:["query"]}]});Home.implement({initRooms:function(){this.rooms=$H();this.roomInvites=$H();this.getRooms().each(function(room){this.roomAdd(room);},this);},feedRoomAdded:function(room){if(!this.rooms.has(room.username)){this.roomAdd(room);}},feedRoomKick:function(username,room_username){this.call("home","room_kick",{username:username,room_username:room_username},null,null);},feedRoomRequestAccept:function(username,room_username){this.call("home","room_request_accept",{username:username,room_username:room_username},null,null);},feedRoomRequestDelete:function(username,room_username){this.call("home","room_request_delete",{username:username,room_username:room_username},null,null);},feedRoomDelete:function(username){this.call("home","room_delete",{username:username},null,null);},feedRoomDeleted:function(username){if(!this.rooms.has(username)){return;}this.roomDelete(username);},showCreateRoomPopup:function(){if($defined(this.createRoomPopup)){this.createRoomPopup.close();}this.createCreateRoomPopup();},createCreateRoomPopup:function(){this.createRoomPopup=new Popup({size:{x:350,y:176},resizable:false,dockable:false,className:"createRoom",onClose:this.destroyCreateRoomPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"rooms",iconAction:"add"},displayName:"Create New Room",closable:true});var content=new CreateRoomPopupContent({});this.createRoomPopup.addContent("create_room",nav,content);},destroyCreateRoomPopup:function(){this.createRoomPopup=null;}});Home.implement({setupNav:function(){Logger().log("home setup");var homeNav=new Nav({iconOptions:{iconName:"updates"},displayName:"Updates",name:"updates",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"updates","self_menu"])});this.navAdd(homeNav);this.navAdd(new Nav({iconOptions:{iconName:"star"},displayName:"Favorites",name:"likes",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"likes","likes_menu"])}));this.navAdd(new Nav({iconOptions:{iconName:"rooms"},hasSubnavs:true,displayName:"Rooms",name:"rooms"}));this.navAdd(new Nav({iconOptions:{iconName:"search"},displayName:"Search Rooms...",onClick:this.fireEvent.bind(this,["showSearchRoomPopup"]),name:"find_room",parentName:"rooms",bottom:true}));this.navAdd(new Nav({iconOptions:{iconName:"rooms",iconAction:"add"},displayName:"Create New Room...",onClick:this.fireEvent.bind(this,["showCreateRoomPopup"]),name:"new_room",parentName:"rooms",bottom:true}));var selfMenu=new SelfMenu({user:this.getPrivateUser(),isDefault:true});this.menuAdd("self_menu",selfMenu);var content=new HomeContent({isDefault:true,navId:homeNav.navId});this.contentAdd("updates",content);var likesMenu=new LikesMenu({user:this.getPrivateUser()});this.menuAdd("likes_menu",likesMenu);var likesContent=new LikesContent({user:this.getPrivateUser()});this.contentAdd("likes",likesContent);},roomAdd:function(room){var nav=new Nav({iconOptions:{user:room},displayName:room.room_name,name:"room_"+room.username,parentName:"rooms",onClick:this.fireEvent.bind(this,["showRoom",room])});this.navAdd(nav);this.rooms.set(room.username,nav);},roomDelete:function(username){if(!this.rooms.has(username)){return;}this.rooms.get(username).destroy();this.navDelete("room_"+username);this.rooms.erase(username);this.menuClose("room_"+username);this.contentClose("room_"+username);},showRoomInvitePopup:function(room){if($defined(this.roomInvitePopup)){this.roomInvitePopup.close();}this.createRoomInvitePopup(room);},createRoomInvitePopup:function(room){this.roomInvitePopup=new Popup({size:{x:250,y:350},resizable:false,dockable:false,className:"roomInvite",onClose:this.destroyCreateRoomPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"rooms",iconAction:"add"},displayName:"Invite Users to "+room.room_name,closable:true});var content=new RoomInvitePopupContent({contacts:this.getContacts(),room:room});this.roomInvitePopup.addContent("create_room",nav,content);},destroyRoomInvitePopup:function(){this.roomInvitePopup=null;},showRoomStatusUpdatePopup:function(room){if($defined(this.roomStatusUpdatePopup)){this.roomStatusUpdatePopup.close();}this.createRoomStatusUpdatePopup(room);},createRoomStatusUpdatePopup:function(room){this.roomStatusUpdatePopup=new Popup({size:{x:350,y:100},resizable:false,dockable:false,className:"statusUpdate",onClose:this.destroyRoomStatusUpdatePopup.bind(this)});var nav=new Nav({iconOptions:{user:room},displayName:"Update Status for "+room.room_name,closable:true});var content=new RoomStatusUpdatePopupContent({room:room});this.roomStatusUpdatePopup.addContent("status_update",nav,content);},destroyRoomStatusUpdatePopup:function(){this.roomStatusUpdatePopup=null;},showConvo:function(convo_id){if(this.convos.has(convo_id)){this.convos.get(convo_id)._select();return;}this.createConvoPopup(convo_id);},createConvoPopup:function(convo_id){var popup=new Popup({size:{x:500,y:400},resizable:false,dockable:true,className:"convoViewer",onClose:this.destroyConvoPopup.bind(this,[convo_id])});var nav=new Nav({iconOptions:{iconName:"convo"},displayName:"View Conversation",closable:true});var content=new ConvoPopupContent({convo_id:convo_id});popup.addContent("convo",nav,content);this.convos.set(convo_id,popup);},destroyConvoPopup:function(convo_id){this.convos.erase(convo_id);},showEditProfilePopup:function(){if($defined(this.editProfilePopup)){this.editProfilePopup.close();}this.createEditProfilePopup();},createEditProfilePopup:function(room){this.editProfilePopup=new Popup({size:{x:350,y:200},resizable:false,dockable:false,className:"editProfile",onClose:this.destroyEditProfilePopup.bind(this)});var nav=new Nav({iconOptions:{user:this.getPrivateUser()},displayName:"Edit Your Profile",closable:true});var content=new EditProfilePopupContent({user:this.getPrivateUser()});this.editProfilePopup.addContent("edit_profile",nav,content);},destroyEditProfilePopup:function(){this.editProfilePopup=null;},showEditRoomProfilePopup:function(room){if($defined(this.editRoomProfilePopup)){this.editRoomProfilePopup.close();}this.createEditRoomProfilePopup(room);},createEditRoomProfilePopup:function(room){this.editRoomProfilePopup=new Popup({size:{x:350,y:140},resizable:false,dockable:false,className:"editProfile",onClose:this.destroyEditRoomProfilePopup.bind(this)});var nav=new Nav({iconOptions:{user:room},displayName:"Edit Room Profile",closable:true});var content=new RoomEditProfilePopupContent({room:room});this.editRoomProfilePopup.addContent("edit_room_profile",nav,content);},destroyEditRoomProfilePopup:function(){this.editRoomProfilePopup=null;}});var HomeContent=new Class({Extends:Content,EventHandlers:["streamItemReceived","streamItemDeleted"],onBeforeInit:function(options){this.navId=options.navId;return options;},onInit:function(){this.statusBox=new StatusBox(this.getPrivateUser());$(this.statusBox).inject(this.content);this.loader=new StreamLoader({createElementFunc:StreamItemUtility.createInStreamItem,emptyEl:new Element("div",{"class":"post empty","text":"You have no updates"}),loadingEl:new Element("div",{"class":"post empty","text":"Your updates loading..."}),alertFunc:this.alertCheck.bind(this)});$(this.loader).inject(this.content);},onShow:function(first){if(first){this.loadMore();}},onHide:function(){},streamItemReceived:function(data){if($defined(data.item)){this.loader.process(data.item);}Logger().log(JSON.encode(data.item.item_id));if(data.item.source_id!=this.getPrivateUser().user_id&&data.item.source_type==3){data.username=data.item.source.username;this.fireEvent("roomStreamItemReceived",data);}},alertCheck:function(item){if(item.creator_id!=this.getPrivateUser().user_id){this.fireEvent("alertAdd",this.navId);}},streamItemDeleted:function(data){if(!$defined(data.item_id)){return;}this.loader.remove(data.item_id);if($defined(data.source_id)&&data.source_id!=this.getPrivateUser().user_id){if(data.source_type==1){this.fireEvent("userStreamItemDeleted",data);}else{if(data.source_type==3){this.fireEvent("roomStreamItemDeleted",data);}}}},loadMore:function(){var params={date_created:this.loader.oldestTimestamp,item_id:this.loader.oldestId};this.call("home","stream_in_load",params,this.loadMoreSuccess.bind(this),null);this.loader.showLoading();},loadMoreSuccess:function(data){this.loader.hideLoading();if(!$defined(data.items)||data.items.length==0){this.atBottom=true;return;}data.items.each(function(item){this.loader.process(item);},this);this.bottomFuncCalled=false;},bottomFunc:function(){Logger().log("home content bottom");this.loadMore();}});var LikesContent=new Class({Extends:Content,EventHandlers:["userStreamItemLiked","streamItemLike"],onBeforeInit:function(options){this.user=options.user;},onInit:function(){var createFunc=StreamItemUtility.createLikesStreamItem;if(this.user.user_id==this.getPrivateUser().user_id){createFunc=StreamItemUtility.createSelfLikesStreamItem;}this.loader=new ItemLoader({createElementFunc:createFunc,idField:"item_id",sortField:"date_created",sortAscending:false,emptyEl:new Element("div",{"class":"post empty","text":TextUtility.unescape(this.user.fullname)+" has no favorites"}),emptyEl:new Element("div",{"class":"post empty","text":TextUtility.unescape(this.user.fullname)+"'s favorites loading..."}),errorEl:new Element("div",{"class":"post empty","text":TextUtility.unescape(this.user.fullname)+"'s stream is private"})});$(this.loader).inject(this.content);},onShow:function(first){if(first){this.loadMore();}},onHide:function(){},userStreamItemLiked:function(data){if($defined(data.item)&&data.username==this.user.username){if(data.is_liked==1){this.loader.process(data.item);}else{this.loader.remove(data.item.item_id);}}},streamItemLike:function(item_id,likes,is_liked){if(is_liked==1){this.loader.remove(item_id);}},loadMore:function(){var params={username:this.user.username,date_created:this.loader.oldestTimestamp,item_id:this.loader.oldestId};this.call("home","stream_likes_load",params,this.loadMoreSuccess.bind(this),this.loadMoreFail.bind(this));this.loader.showLoading();},loadMoreSuccess:function(data){this.loader.hideLoading();if(!$defined(data.items)||data.items.length==0){this.atBottom=true;return;}data.items.each(function(item){this.loader.process(item);},this);this.bottomFuncCalled=false;},loadMoreFail:function(status){this.loader.hideLoading();if(status.code==2002){this.loader.showError();}},bottomFunc:function(){this.loadMore();}});var ConvoPopupContent=new Class({Extends:PopupContent,EventHandlers:[],onBeforeInit:function(options){this.convo_id=options.convo_id;return options;},onInit:function(){this.convoWrapper=new Element("div",{"class":"convoWrapper"}).inject(this.content);this.loader=new ItemLoader({idField:"item_id",sortField:"date_created",createElementFunc:StreamItemUtility.createConvoStreamItem,emptyEl:new Element("div",{"class":"post empty","text":"This conversation is empty"}),loadingEl:new Element("div",{"class":"post empty","text":"Conversation loading..."})});this.convoWrapper.addEvent("mousewheel",this.checkScroll.bind(this));$(this.loader).inject(this.convoWrapper);this.scroll=new Fx.Scroll(this.convoWrapper);this.loadMore();},onShow:function(){if($defined(this.scrollY)){this.scroll.set(0,this.scrollY);}},onHide:function(){if($defined(this.convoWrapper)){this.scrollY=this.convoWrapper.getScroll().y;}},loadMore:function(){var params={convo_id:this.convo_id,date_created:this.loader.highestSortValue,item_id:this.loader.highestId};this.call("home","stream_convo_load",params,this.loadMoreSuccess.bind(this),null);this.loader.showLoading();},loadMoreSuccess:function(data){this.loader.hideLoading();if(!$defined(data.items)||data.items.length==0){this.atBottom=true;return;}data.items.each(function(item){this.loader.process(item);},this);this.bottomFuncCalled=false;},bottomFunc:function(){Logger().log("home content bottom");this.loadMore();},checkScroll:function(){var maxY=this.convoWrapper.getScrollSize().y;var bottomY=this.convoWrapper.getScroll().y+this.convoWrapper.getSize().y+100;if(bottomY>maxY&&!this.bottomFuncCalled&&!this.atBottom){this.bottomFuncCalled=true;this.bottomFunc();}}});var CreateRoomPopupContent=new Class({Extends:PopupContent,strings:{roomUsernameLabel:"Nickname:",roomNameLabel:"Room Name:",roomDescriptionLabel:"Description:",publicLabel:"Public:",errorMessage:"There was an error creating this room"},onInit:function(){this.roomUsernameInput=new Element("input",{"type":"text","maxlength":"32"});new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.roomUsernameLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.roomUsernameInput)).inject(this.content);this.roomNameInput=new Element("input",{"type":"text","maxlength":"32"});new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.roomNameLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.roomNameInput)).inject(this.content);this.roomDescriptionInput=new Element("input",{"type":"text","maxlength":"32"});new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.roomDescriptionLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.roomDescriptionInput)).inject(this.content);this.publicToggle=new Toggle(true);new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.publicLabel}),$(this.publicToggle)).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Create Room",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.createRoom.bind(this));this.message=new Element("div",{"class":"message error"});this.actions=new Element("div",{"class":"actions"}).adopt(this.message,$(this.actionButton),$(this.closeButton)).inject(this.content);},createRoom:function(){var username=this.roomUsernameInput.value.trim();var room_name=this.roomNameInput.value.trim();var room_description=this.roomDescriptionInput.value.trim();var is_public=this.publicToggle.toInt();var params={username:username,room_name:room_name,room_description:room_description,is_public:is_public};this.call("home","room_create",params,this.createRoomSuccess.bind(this),this.createRoomFail.bind(this));this.actionButton.showProgress();},createRoomSuccess:function(){this.actionButton.hideProgress();this.closeContent();},createRoomFail:function(status){this.actionButton.hideProgress();var name="create_room";var title="Error Creating Room";var message=status.message;this.fireEvent("showAlert",name,title,message);},onShow:function(){this.focus();},focus:function(){this.roomUsernameInput.focus.delay(500,this.roomUsernameInput);}});var EditProfilePopupContent=new Class({Extends:PopupContent,strings:{bioLabel:"Bio:",interestsLabel:"Interests:",urlLabel:"Website:"},onBeforeInit:function(options){this.user=options.user;return options;},onInit:function(){this.bioInput=new Element("textarea",{"maxlength":500});new Element("div",{"class":"input_section bio"}).adopt(new Element("div",{"class":"label light","text":this.strings.bioLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.bioInput)).inject(this.content);this.interestsInput=new Element("textarea",{"maxlength":500});new Element("div",{"class":"input_section bio"}).adopt(new Element("div",{"class":"label light","text":this.strings.interestsLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.interestsInput)).inject(this.content);this.urlInput=new Element("input",{"type":"text","maxlength":200});new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.urlLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.urlInput)).inject(this.content);var about=this.getProfile(this.user.username);if($defined(about)){if($defined(about.bio)){this.bioInput.set("text",about.bio);}if($defined(about.interests)){this.interestsInput.set("text",about.interests);}if($defined(about.url)){this.urlInput.value=about.url;}}this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Update",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.updateProfile.bind(this));this.message=new Element("div",{"class":"message error"});this.actions=new Element("div",{"class":"actions"}).adopt(this.message,$(this.actionButton),$(this.closeButton)).inject(this.content);},updateProfile:function(){var bio=this.bioInput.value.trim();var url=this.urlInput.value.trim();var interests=this.interestsInput.value.trim();var params={bio:bio,url:url,interests:interests};this.call("pipio","user_profile_update",params,this.updateProfileSuccess.bind(this),this.updateProfileFail.bind(this));this.actionButton.showProgress();this.message.empty();},updateProfileSuccess:function(data){this.actionButton.hideProgress();this.closeContent();},updateProfileFail:function(){this.actionButton.hideProgress();this.message.set("text",this.strings.errorMessage);},onShow:function(){this.focus();},focus:function(){this.bioInput.focus.delay(500,this.bioInput);}});var RoomInvitePopupContent=new Class({Extends:PopupContent,onBeforeInit:function(options){this.contacts=options.contacts;this.room=options.room;return options;},onInit:function(){this.css=new CSS();this.input=new Element("input",{"type":"text","maxlength":50});this.input.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));new Element("div",{"class":"textarea_wrapper"}).adopt(this.input).inject(this.content);this.list=new Element("div",{"class":"itemList"}).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Close",className:"dark",action:"cross"});new Element("div",{"class":"actions"}).adopt($(this.closeButton)).inject(this.content);$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.insertContacts();this.scroll=new Fx.Scroll(this.list);},insertContacts:function(){this.contacts.each(function(user){var el=ShareBoxUtility.createContactRoomInviteItem(user);el.addEvent("click",this.inviteUser.bind(this,[user,el]));el.inject(this.list);},this);},insertSeperator:function(){new Element("div",{"class":"listItem seperator"}).inject(this.list);},inviteUser:function(user,el){var params={username:user.username,room_username:this.room.username};this.call("home","room_invite_create",params,null,null);el.addClass("invited");},inputKeyUp:function(e){if(e.key=="esc"){e.target.value="";}var val=e.target.value.trim().toLowerCase();if(val.length<2){this.list.removeClass("search");return;}this.list.addClass("search");if($defined(this.lastSelector)){this.css.remove_rule(this.lastSelector);}var selector=".listItem[val1^='"+val+"'], .listItem[val2^='"+val+"']";this.css.add_rule(selector,{"display":"block !important"}).refresh();this.lastSelector=selector;},focus:function(){this.input.focus.delay(500,this.input);},onClose:function(){if($defined(this.lastSelector)){this.css.remove_rule(this.lastSelector).refresh();}},onShow:function(){if($defined(this.scrollY)){this.scroll.set(0,this.scrollY);}this.focus();},onHide:function(){if($defined(this.list)){this.scrollY=this.list.getScroll().y;}}});var RoomStatusUpdatePopupContent=new Class({Extends:PopupContent,onBeforeInit:function(options){this.room=options.room;return options;},onInit:function(){this.statusInput=new Element("textarea",{"maxlength":500});this.statusInput.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));new Element("div",{"class":"textarea_wrapper"}).adopt(this.statusInput).inject(this.content);this.cancelButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.cancelButton).addEvent("click",this.closeContent.bind(this));this.updateButton=new ButtonMedium({displayName:"Update Status",className:"dark",action:"check"});$(this.updateButton).addEvent("click",this.updateStatus.bind(this));new Element("div",{"class":"actions"}).adopt($(this.updateButton),$(this.cancelButton)).inject(this.content);},onShow:function(){this.focus();},focus:function(){this.statusInput.focus.delay(500,this.statusInput);},inputKeyUp:function(e){if(e.key=="enter"){var msg=e.target.value.trim();if(msg==""){return;}this.updateStatus();}},updateStatus:function(){var params={username:this.room.username,body:this.statusInput.value.trim(),res:this.getSession()};this.call("pipio","publish_roomstatus",params,this.updateStatusSuccess.bind(this),this.updateStatusFail.bind(this));this.updateButton.showProgress();},updateStatusSuccess:function(){this.closeContent();},updateStatusFail:function(){alert("There was an error updating your status!");}});var LikesMenu=new Class({Extends:Menu,EventHandlers:[],onBeforeInit:function(options){this.user=options.user;options.displayName=this.user.first_name+"'s Favorites";return options;},onInit:function(){this.aboutText=new Element("span");var likesText="These are posts "+this.user.first_name+" likes";this.aboutSection=new Element("div",{"class":"text_section light1","text":TextUtility.unescape(likesText)}).inject(this.menu);}});var SelfMenu=new Class({Extends:Menu,EventHandlers:["userLocationUpdated"],onBeforeInit:function(options){this.user=options.user;options.displayName=this.user.fullname;return options;},onInit:function(){this.map=new UserMapMenuSection({user:this.user});$(this.map).inject(this.menu);this.aboutSection=new UserProfileMenuSection({user:this.user});$(this.aboutSection).inject(this.menu);new Element("div",{"class":"nav_seperator"}).inject(this.menu);this.locationEnabled=new Toggle(this.user.location_enabled==1);$(this.locationEnabled).addEvent("click",this.locationToggle.bind(this));new Element("div",{"class":"toggle_section"}).adopt(new Element("div",{"class":"text light","text":"Location:"}),$(this.locationEnabled)).inject(this.menu);this.privacy=new Toggle(this.user.is_public==1);$(this.privacy).addEvent("click",this.privacyToggle.bind(this));new Element("div",{"class":"toggle_section"}).adopt(new Element("div",{"class":"text light","text":"Public:"}),$(this.privacy)).inject(this.menu);this.profilePicUploadButton=new ButtonMedium({displayName:"Change Picture",className:"dark",action:"photo"});this.fileInput=new Element("input",{"type":"file","name":"file"});this.form=new Element("form").adopt(this.fileInput);this.fileInput.addEvent("change",this.profilePicUpload.bind(this));this.profilePicUploadSection=new Element("div",{"class":"button_section"}).adopt($(this.profilePicUploadButton).adopt(this.form)).inject(this.menu);var editProfileButton=new ButtonMedium({displayName:"Edit Profile",className:"dark",action:"edit"});$(editProfileButton).addEvent("click",this.fireEvent.bind(this,["showEditProfilePopup"]));new Element("div",{"class":"button_section"}).adopt($(editProfileButton)).inject(this.menu);var editLocationButton=new ButtonMedium({displayName:"Edit Location",className:"dark",action:"global"});$(editLocationButton).addEvent("click",this.fireEvent.bind(this,["showLocationEditPopup"]));this.editLocationSection=new Element("div",{"class":"button_section"}).adopt($(editLocationButton)).inject(this.menu);if(this.user.location_enabled==0){DomUtility.hide(this.editLocationSection);}var searchUserButton=new ButtonMedium({displayName:"Find Friends",className:"dark",action:"search"});$(searchUserButton).addEvent("click",this.fireEvent.bind(this,["searchUserShow"]));new Element("div",{"class":"button_section"}).adopt($(searchUserButton)).inject(this.menu);var inviteUserButton=new ButtonMedium({displayName:"Invite Friends",className:"dark",action:"forward"});$(inviteUserButton).addEvent("click",this.fireEvent.bind(this,["inviteUserShow"]));new Element("div",{"class":"button_section"}).adopt($(inviteUserButton)).inject(this.menu);var searchContactButton=new ButtonMedium({displayName:"Search Contacts",className:"dark",action:"status"});$(searchContactButton).addEvent("click",this.fireEvent.bind(this,["searchEmailShow"]));new Element("div",{"class":"button_section"}).adopt($(searchContactButton)).inject(this.menu);},privacyToggle:function(){this.call("pipio","user_privacy_set",{is_public:this.privacy.toInt()});},userLocationUpdated:function(username,location,location_enabled){if(username!=this.user.username){return;}if(location_enabled==1){DomUtility.show(this.editLocationSection);}else{DomUtility.hide(this.editLocationSection);}},locationToggle:function(){this.call("pipio","user_location_enabled",{location_enabled:this.locationEnabled.toInt()});},resetForm:function(){this.profilePicUploadSection.empty();this.profilePicUploadButton=new ButtonMedium({displayName:"Change Picture",className:"dark",action:"photo"});this.fileInput=new Element("input",{"type":"file","name":"file"});this.form=new Element("form").adopt(this.fileInput);this.fileInput.addEvent("change",this.profilePicUpload.bind(this));this.profilePicUploadSection.adopt($(this.profilePicUploadButton).adopt(this.form));},profilePicUpload:function(){if(DataUtility.validatePhotoFile(this.fileInput.value)){this.call("pipio","user_profilepic_upload",{},this.profilePicUploadSuccess.bind(this),this.profilePicUploadFail.bind(this),this.form);this.profilePicUploadButton.showProgress();}},profilePicUploadSuccess:function(){this.profilePicUploadButton.hideProgress();this.resetForm();},profilePicUploadFail:function(){this.profilePicUploadButton.hideProgress();this.resetForm();}});var MemberRequestsNav=new Class({Extends:Nav,EventHandlers:[],onBeforeInit:function(options){this.room=options.room;this.users=$H();options.name="member_requests_"+this.room.username;options.iconOptions={iconName:"contacts",iconAction:"add"};options.displayName="Member Requests";options.className="members_nav";options.hasSubnavs=true;return options;},onInit:function(){this.clear=new Element("div",{"style":"clear: both"});this.list=new Element("div",{"class":"menu_list"}).adopt(this.clear).inject(this.subnavs);},addUsers:function(users){$splat(users).each(function(user){user=UserUtility.processUser(user);if(!this.users.has(user.username)){var pic=ItemUtility.createProfilePic(user,"16a");pic.addEvent("click",this.fireEvent.bind(this,["showUser",user]));pic.inject(this.clear,"before");this.users.set(user.username,pic);}},this);},removeUser:function(username){if(!this.users.has(username)){return;}this.users.get(username).destroy();this.users.erase(username);}});var MembersNav=new Class({Extends:Nav,onBeforeInit:function(options){this.room=options.room;this.users=$H();options.name="members_"+this.room.username;options.iconOptions={iconName:"contacts"};options.displayName="Members";options.className="members_nav";options.hasSubnavs=true;return options;},onInit:function(){this.clear=new Element("div",{"style":"clear: both"});this.list=new Element("div",{"class":"menu_list"}).adopt(this.clear).inject(this.subnavs);},addUsers:function(users){$splat(users).each(function(user){user=UserUtility.processUser(user);if(!this.users.has(user.username)){var pic=ItemUtility.createProfilePic(user,"16a");pic.addEvent("click",this.fireEvent.bind(this,["showUser",user]));pic.inject(this.clear,"before");this.users.set(user.username,pic);}},this);},removeUser:function(username){if(!this.users.has(username)){return;}this.users.get(username).destroy();this.users.erase(username);}});var StreamItemUtility={createDateSeperatorItem:function(ts){var date=DateUtility.convertFromTimestamp(ts);var timetext=date.format("%B %D");var el=new Element("div",{"class":"post seperator","ts":ts}).adopt(new Element("div",{"class":"seperator_text","text":timetext}));return el;},createSeperatorItem:function(str){var el=new Element("div",{"class":"post seperator"}).adopt(new Element("div",{"class":"seperator_text","text":TextUtility.unescape(str)}));return el;},createInStreamItem:function(item){return StreamItemUtility.createStreamItem(item,true,false);},createUserStreamItem:function(item){return StreamItemUtility.createStreamItem(item,false,false);},createSelfLikesStreamItem:function(item){return StreamItemUtility.createStreamItem(item,true,true);},createLikesStreamItem:function(item){return StreamItemUtility.createStreamItem(item,false,true);},createStreamItem:function(item,inbound,likes_stream){var el=ItemUtility.createPostBubble("post haspic");item.creator=UserUtility.processSource(item.creator);item.source=UserUtility.processSource(item.source);if($defined(item.post.reply_user)){item.post.reply_user=UserUtility.processSource(item.post.reply_user);}if($defined(item.post.convo_user)){item.post.convo_user=UserUtility.processSource(item.post.convo_user);}if($defined(item.post.forward_user)){item.post.forward_user=UserUtility.processSource(item.post.forward_user);}item.can_delete=false;if(!$defined(item.private_replies)){item.private_replies=0;}var user_id=pipio.currentUser.user_id;if(inbound){item.can_delete=true;}else{if(item.creator_id==user_id){item.can_delete=true;}}if(likes_stream){item.can_delete=false;}if(inbound){item.can_like=true;}else{item.can_like=false;}ItemUtility.createProfilePic(item.creator,32).inject(el);if(item.reply_id!=item.item_id&&$defined(item.post.reply_user)){ItemUtility.createProfilePic(item.post.reply_user,20).inject(el);el.addClass("reply");}if(item.source_id!=item.creator_id){ItemUtility.createProfilePic(item.source,20).inject(el);}var content=new Element("div",{"class":"post_content"}).inject(el);StreamItemUtility.createStreamItemPostActions(item).inject(el);StreamItemUtility.createStreamItemHeader(item).inject(content);var attachments=StreamItemUtility.createStreamItemAttachments(item);if(attachments){attachments.inject(content);}StreamItemUtility.createStreamItemFooter(item).inject(content);return el;},createConvoStreamItem:function(item){var el=ItemUtility.createPostBubble("post haspic");item.creator=UserUtility.processSource(item.creator);item.source=UserUtility.processSource(item.source);if($defined(item.post.reply_user)){item.post.reply_user=UserUtility.processSource(item.post.reply_user);}if($defined(item.post.convo_user)){item.post.convo_user=UserUtility.processSource(item.post.convo_user);}if($defined(item.post.forward_user)){item.post.forward_user=UserUtility.processSource(item.post.forward_user);}item.can_delete=false;ItemUtility.createProfilePic(item.creator,32).inject(el);if(item.reply_id!=item.item_id&&$defined(item.post.reply_user)){ItemUtility.createProfilePic(item.post.reply_user,20).inject(el);el.addClass("reply");}if(item.source_id!=item.creator_id){ItemUtility.createProfilePic(item.source,20).inject(el);}var content=new Element("div",{"class":"post_content"}).inject(el);StreamItemUtility.createStreamItemPostActions(item).inject(el);StreamItemUtility.createStreamItemHeader(item).inject(content);var attachments=StreamItemUtility.createStreamItemAttachments(item);if(attachments){attachments.inject(content);}StreamItemUtility.createConvoStreamItemFooter(item).inject(content);return el;},createStreamMemberRoomItem:function(item){return StreamItemUtility.createStreamRoomItem(item,true);},createStreamPublicRoomItem:function(item){return StreamItemUtility.createStreamRoomItem(item,false);},createStreamRoomItem:function(item,is_member){var el=ItemUtility.createPostBubble("post haspic");item.creator=UserUtility.processSource(item.creator);item.source=UserUtility.processSource(item.source);if($defined(item.post.reply_user)){item.post.reply_user=UserUtility.processSource(item.post.reply_user);}if($defined(item.post.convo_user)){item.post.convo_user=UserUtility.processSource(item.post.convo_user);}if($defined(item.post.forward_user)){item.post.forward_user=UserUtility.processSource(item.post.forward_user);}item.can_delete=false;if(!$defined(item.private_replies)){item.private_replies=0;}var user_id=pipio.currentUser.user_id;if(item.creator_id==user_id){item.can_delete=true;}if(is_member&&item.source_id==item.creator_id){item.can_delete=true;}ItemUtility.createProfilePic(item.creator,32).inject(el);if(item.reply_id!=item.item_id&&$defined(item.post.reply_user)){ItemUtility.createProfilePic(item.post.reply_user,20).inject(el);el.addClass("reply");}var content=new Element("div",{"class":"post_content"}).inject(el);StreamItemUtility.createStreamItemPostActions(item).inject(el);StreamItemUtility.createStreamRoomItemHeader(item).inject(content);var attachments=StreamItemUtility.createStreamItemAttachments(item);if(attachments){attachments.inject(content);}StreamItemUtility.createStreamItemFooter(item).inject(content);return el;},createStreamItemPostActions:function(item){var el=new Element("div",{"class":"post_actions"});if(item.can_delete){var deleteAction=new Element("div",{"class":"post_action delete"}).inject(el);deleteAction.addEvent("click",pipio.dispatchEvent.bind(pipio,["streamItemDelete",item.item_id]));}if(item.can_like){var likeAction=new Element("div",{"class":"post_action like likes_"+item.item_id,"is_liked":item.is_liked,"likes":item.likes}).inject(el);likeAction.addEvent("click",pipio.dispatchEvent.bind(pipio,["streamItemLike",item.item_id,likeAction]));new Element("div",{"class":"text grey text11","text":item.likes,"likes":item.likes}).inject(likeAction);if(item.likes>0){likeAction.addClass("other_liked");}if(item.is_liked==1){likeAction.addClass("on");}}return el;},createStreamRoomItemHeader:function(item){var el=new Element("div",{"class":"header"});var is_question=false;var creator_action="broadcast dark";if(item.is_public==0){creator_action="lock dark";}else{if(item.post_type==4){creator_action="status dark";}else{if(item.post_type==5){creator_action="question dark";is_question=true;}}}StreamItemUtility.createStreamUserAction(creator_action).inject(el);StreamItemUtility.createUsernameElement(item.creator).inject(el);if(is_question){new Element("span",{"class":"grey2","text":" asks "}).inject(el);}if(item.post_type==3){StreamItemUtility.createStreamUserAction("forward").inject(el);StreamItemUtility.createUsernameElement(item.post.forward_user).inject(el);}if(item.reply_id!=item.item_id){StreamItemUtility.createStreamUserAction("reply").inject(el);StreamItemUtility.createUsernameElement(item.post.reply_user).inject(el);}var body=new Element("span",{"html":" "+TextUtility.replaceUrls(TextUtility.convertNewLine(TextUtility.unescapeQuotes(item.post.body)))}).inject(el);if($defined(item.post.forward_body)&&item.post.forward_body!=""){body.appendText(" - "+TextUtility.replaceUrls(TextUtility.convertNewLine(TextUtility.unescape(item.post.forward_body))));}return el;},createUsernameElement:function(user){if($defined(user.user_id)){var el=new Element("span",{"class":"user_name clickable","text":TextUtility.unescapeQuotes(user.fullname)});el.addEvent("click",pipio.dispatchEvent.bind(pipio,["showUser",user]));return el;}else{if($defined(user.room_id)){var el=new Element("span",{"class":"user_name clickable","text":TextUtility.unescapeQuotes(user.room_name)});el.addEvent("click",pipio.dispatchEvent.bind(pipio,["showRoom",user]));return el;}}},createStreamItemHeader:function(item){var el=new Element("div",{"class":"header"});var is_question=false;var creator_action="broadcast dark";if(item.is_public==0){creator_action="lock dark";}else{if(item.post_type==4){creator_action="status dark";}else{if(item.post_type==5){creator_action="question dark";is_question=true;}}}StreamItemUtility.createStreamUserAction(creator_action).inject(el);if($defined(item.source.room_id)){StreamItemUtility.createUsernameElement(item.source).inject(el);new Element("span",{"class":"dark","text":": "}).inject(el);}StreamItemUtility.createUsernameElement(item.creator).inject(el);if(is_question){new Element("span",{"class":"dark","text":" asks "}).inject(el);}if(item.post_type==3){StreamItemUtility.createStreamUserAction("forward").inject(el);StreamItemUtility.createUsernameElement(item.post.forward_user).inject(el);}if(item.reply_id!=item.item_id){StreamItemUtility.createStreamUserAction("reply").inject(el);StreamItemUtility.createUsernameElement(item.post.reply_user).inject(el);}else{if(item.creator_id!=item.source_id&&!$defined(item.source.room_id)){StreamItemUtility.createStreamUserAction("direct").inject(el);StreamItemUtility.createUsernameElement(item.source).inject(el);}}var body=new Element("span",{"html":" "+TextUtility.replaceUrls(TextUtility.convertNewLine(TextUtility.unescapeQuotes(item.post.body)))}).inject(el);if($defined(item.post.forward_body)&&item.post.forward_body!=""){body.appendText(" - "+TextUtility.replaceUrls(TextUtility.convertNewLine(TextUtility.unescape(item.post.forward_body))));}return el;},createStreamItemAttachments:function(item){if(item.attachment_type==0){return false;}var el=new Element("div",{"class":"attachment"}).adopt(new Element("span",{"class":"indicator","html":"&raquo;"}));switch(item.attachment_type){case 1:var pipioUrl=DataUtility.getPipioUrl(null,item.attachment[0].hash);item.attachment[0]=AttachmentUtility.parsePhotoAttachment(item.attachment[0]);item.attachment[0].url=pipioUrl;new Element("a",{"target":"_blank","href":pipioUrl,"text":TextUtility.unescape(item.attachment[0].filename)}).inject(el);if(item.attachment[0].is_photo){el.addClass("has_thumbnail");var playButton=new ButtonSmall({displayName:"View Photo",action:"photo"});$(playButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["showPhotoPopup",item.attachment[0]]));$(playButton).inject(el);var thumb=new InlineImage(item.attachment[0]);$(thumb).inject(el);}break;case 2:var pipioUrl=DataUtility.getPipioUrl(item.attachment[0].url,item.attachment[0].hash);item.attachment[0]=AttachmentUtility.parseLinkAttachment(item.attachment[0]);new Element("a",{"target":"_blank","href":pipioUrl,"text":TextUtility.unescape(item.attachment[0].url)}).inject(el);if(item.attachment[0].is_video){var playButton=new ButtonSmall({displayName:"Play Video",action:"pivot_right dark"});$(playButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["showVideoPopup",item.attachment[0]]));$(playButton).inject(el);}else{if(item.attachment[0].is_photo){el.addClass("has_thumbnail");var playButton=new ButtonSmall({displayName:"View Photo",action:"photo"});$(playButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["showPhotoPopup",{filename:"Photo",url:item.attachment[0].url}]));$(playButton).inject(el);var thumb=new InlineImage({filename:"Photo",url:item.attachment[0].url});$(thumb).inject(el);}}break;}return new Element("div",{"class":"attachments"}).adopt(el);},createStreamItemFooter:function(item){var el=new Element("div",{"class":"footer"});if(!$defined(item.date_created)){return el;}var date=DateUtility.convertFromTimestamp(item.date_created);var ts=new Element("span",{"class":"timestamp","text":DateUtility.getTimestamp(date,"%B %D at %I:%M%p"),"ts":date,"ts_format":"%B %D at %I:%M%p"}).inject(el);if($defined(item.location)&&$defined(item.geohash)&&item.geohash!=""){var loc=DataUtility.getGeoString(item.location);if(loc){el.appendText(" from ");var location=new Element("span",{"class":"clickable","text":TextUtility.unescape(loc)}).inject(el);location.addEvent("click",pipio.dispatchEvent.bind(pipio,["showGlobal",item.location]));}}StreamItemUtility.createFooterActions(item,el);return el;},createConvoStreamItemFooter:function(item){var el=new Element("div",{"class":"footer"});if(!$defined(item.date_created)){return el;}var date=DateUtility.convertFromTimestamp(item.date_created);var ts=new Element("span",{"class":"timestamp","text":DateUtility.getTimestamp(date,"%B %D at %I:%M%p"),"ts":date,"ts_format":"%B %D at %I:%M%p"}).inject(el);if($defined(item.location)&&$defined(item.geohash)&&item.geohash!=""){var loc=DataUtility.getGeoString(item.location);if(loc){el.appendText(" from ");var location=new Element("span",{"class":"clickable","text":TextUtility.unescape(loc)}).inject(el);location.addEvent("click",pipio.dispatchEvent.bind(pipio,["showGlobal",item.location]));}}StreamItemUtility.createConvoFooterActions(item,el);return el;},createFooterActions:function(item,el){if(!pipio.isLoggedIn()){return;}if(item.convo_id!=item.item_id){var convoAction=StreamItemUtility.createFooterAction("convo","View Conversation",true);convoAction.addEvent("click",pipio.dispatchEvent.bind(pipio,["showConvo",item.convo_id]));convoAction.inject(el);}else{var convoAction=StreamItemUtility.createRepliesAction(item);convoAction.addEvent("click",pipio.dispatchEvent.bind(pipio,["showConvo",item.convo_id]));convoAction.inject(el);}var replyAction=StreamItemUtility.createFooterAction("reply","Reply",true);replyAction.addEvent("click",pipio.dispatchEvent.bind(pipio,["replyShareBoxShow",item.item_id]));replyAction.inject(el);if(item.is_public==1){var forward_id=(item.post_type==3&&item.forward_id!=0)?item.forward_id:item.item_id;var forwardAction=StreamItemUtility.createFooterAction("forward","Forward",true).inject(el);forwardAction.addEvent("click",pipio.dispatchEvent.bind(pipio,["forwardShareBoxShow",forward_id,item.creator.username,item.post.body]));}},createConvoFooterActions:function(item,el){var replyAction=StreamItemUtility.createFooterAction("reply","Reply",true);replyAction.addEvent("click",pipio.dispatchEvent.bind(pipio,["replyShareBoxShow",item.item_id]));replyAction.inject(el);if(item.is_public==1){var forward_id=(item.forward_id!=0)?item.forward_id:item.item_id;var forwardAction=StreamItemUtility.createFooterAction("forward","Forward",true).inject(el);forwardAction.addEvent("click",pipio.dispatchEvent.bind(pipio,["forwardShareBoxShow",forward_id,item.creator.username,item.post.body]));}},createRepliesAction:function(item){var repliesClass="replies_"+item.item_id;var replies=item.replies+item.private_replies;var el=new Element("span",{"class":"footer_action has_action "+repliesClass,"replies":replies}).adopt(new Element("div",{"class":"action convo"}));el.appendText(TextUtility.pluralText(replies,"Reply","Replies"));return el;},updateReplyCount:function(item_id,count){$$(".replies_"+item_id).each(function(el){var replies=parseInt(el.get("replies"))+count;el.set("replies",replies);el.empty();el.adopt(new Element("div",{"class":"action convo"}));el.appendText(TextUtility.pluralText(replies,"Reply","Replies"));});},updateItemLiked:function(item_id,likes,is_liked){Logger().log(item_id+"-"+likes+"-"+is_liked);$$(".likes_"+item_id).each(function(el){el.set("likes",likes);if(is_liked!=-1){el.set("is_liked",is_liked);}el.empty();new Element("div",{"class":"text grey text11","text":likes,"likes":likes}).inject(el);if(likes>0){el.addClass("other_liked");}else{el.removeClass("other_liked");}if(is_liked!=-1){if(is_liked==1){el.addClass("on");}else{el.removeClass("on");}}});},createFooterAction:function(actionName,actionText,hide){var el=new Element("span",{"class":"footer_action has_action"}).adopt(new Element("div",{"class":"action "+actionName}));el.appendText(actionText);if(hide){el.addClass("hide");}return el;},createStreamUserAction:function(user_action){var el=new Element("span",{"class":"user_action"}).adopt(new Element("div",{"class":"action "+user_action}));return el;},createStatusBoxFooter:function(status_message){var el=new Element("div",{"class":"footer"});if(!$defined(status_message)){return el;}if(!$defined(status_message.date_created)){return el;}var date=DateUtility.convertFromTimestamp(status_message.date_created);var ts=new Element("span",{"class":"timestamp","text":DateUtility.getTimestamp(date,"%B %D at %I:%M%p"),"ts":date,"ts_format":"%B %D at %I:%M%p"}).inject(el);if($defined(status_message.location)&&$defined(status_message.location.geohash)&&status_message.location.geohash!=""){var loc=DataUtility.getGeoString(status_message.location);if(loc){el.appendText(" from ");new Element("span",{"text":TextUtility.unescape(loc)}).inject(el);}}return el;}};var Room=new Class({Extends:AppInstance,EventHandlers:["roomClosed","userSwitched"],parseOptions:function(options){this.room=options.room;this.displayName=this.room.room_name;this.appId="room_"+this.room.username;this.iconOptions={user:this.room};},userSwitched:function(){this.stop();},onStart:function(){this.setupNav();},onStop:function(){},roomClosed:function(data){if(!$defined(data.username)||data.username!=this.room.username){return;}this.stop();}});Room.implement({setupNav:function(){Logger().log("home setup");this.navAdd(new Nav({iconOptions:{iconName:"updates"},displayName:"Updates",name:"updates",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"updates","room_menu"])}));var roomMenu=new RoomMenu({displayName:this.room.room_name,room:this.room,appId:this.appId,isDefault:true,closeFunc:this.stop.bind(this)});this.menuAdd("room_menu",roomMenu);var content=new RoomContent({isDefault:true,room:this.room});this.contentAdd("updates",content);var membersContent=new RoomMembersContent({room:this.room});this.contentAdd("room_members",membersContent);var subscribersContent=new RoomSubscribersContent({room:this.room});this.contentAdd("room_subscribers",subscribersContent);var requestsContent=new RoomRequestsContent({room:this.room});this.contentAdd("room_requests",requestsContent);}});var RoomContent=new Class({Extends:Content,EventHandlers:["streamItemReceived","roomStreamItemDeleted"],onBeforeInit:function(options){this.room=options.room;},onInit:function(){this.statusBox=new RoomStatusBox(this.room);$(this.statusBox).inject(this.content);this.loader=new StreamLoader({createElementFunc:StreamItemUtility.createStreamMemberRoomItem,emptyEl:new Element("div",{"class":"post empty","text":"This room has no updates"}),loadingEl:new Element("div",{"class":"post empty","text":"Room updates loading..."}),errorEl:new Element("div",{"class":"post empty","text":"This room is private"})});$(this.loader).inject(this.content);},onShow:function(first){if(first){this.loadMore();}},onHide:function(){},roomStreamItemReceived:function(data){if(!$defined(data.item)||!$defined(data.username)||data.username!=this.room.username){return;}Logger().log("roomItemRecevied, processing");this.loader.process(data.item);},streamItemReceived:function(data){if($defined(data.item)&&data.item.source.username==this.room.username){this.loader.process(data.item);}},roomStreamItemDeleted:function(data){if(!$defined(data.username)||data.username!=this.room.username){return;}this.loader.remove(data.item_id);},alertCheck:function(item){if(item.creator_id!=this.getPrivateUser().user_id){this.fireEvent("alertAdd","2_room_"+this.room.username);}},loadMore:function(){var params={username:this.room.username,date_created:this.loader.oldestTimestamp,item_id:this.loader.oldestId};if(this.isLoggedIn()){this.call("home","stream_room_load",params,this.loadMoreSuccess.bind(this),this.loadMoreFail.bind(this));}else{this.call("home","public_stream_room_load",params,this.loadMoreSuccess.bind(this),this.loadMoreFail.bind(this));}this.loader.showLoading();},loadMoreSuccess:function(data){this.loader.hideLoading();if(!$defined(data.items)||data.items.length==0){this.atBottom=true;return;}data.items.each(function(item){this.loader.process(item);},this);this.bottomFuncCalled=false;},loadMoreFail:function(status){if(status.code==2002){this.loader.showError();}},bottomFunc:function(){this.loadMore();}});var RoomMembersContent=new Class({Extends:Content,EventHandlers:["roomMemberAdded","roomMemberDeleted"],onBeforeInit:function(options){this.room=options.room;this.isCreator=this.room.creator_id==this.getPrivateUser().user_id;return options;},onInit:function(){this.statusBox=new RoomStatusBox(this.room);$(this.statusBox).inject(this.content);StreamItemUtility.createSeperatorItem("Members").inject(this.content);this.loader=new ItemLoader({idField:"user_id",sortField:"date_created",sortAscending:false,createElementFunc:ContactItemUtility.createRoomMemberItemFactory(this.room,this.isCreator),emptyEl:new Element("div",{"class":"post empty","text":"There are no members in this room"}),loadingEl:new Element("div",{"class":"post empty","text":"Room members loading..."})});$(this.loader).inject(this.content);},onShow:function(first){if(first){this.loadMore();}},onHide:function(){},loadMore:function(){var params={username:this.room.username,date_created:this.loader.lowestSortValue};this.call("pipio","room_members",params,this.loadMoreSuccess.bind(this),null);this.loader.showLoading();},loadMoreSuccess:function(data){this.loader.hideLoading();if(!$defined(data.members)||data.members.length==0){this.atBottom=true;return;}data.members.each(function(user){var user_copy=UserUtility.processUser(user);user_copy.date_created=user.date_created;this.loader.process(user_copy);},this);this.bottomFuncCalled=false;},bottomFunc:function(){this.loadMore();},roomMemberAdded:function(data){if(!$defined(data.room_username)||!$defined(data.user)||data.room_username!=this.room.username){return;}var user=UserUtility.processUser(data.user);user.date_created=new Date().getTime()/1000;this.loader.process(user);},roomMemberDeleted:function(data){if(!$defined(data.username)||!$defined(data.room_username)||data.room_username!=this.room.username){return;}if(!$defined(this.getUser(data.username))){return;}var user=this.getUser(data.username);this.loader.remove(user.user_id);}});var RoomRequestsContent=new Class({Extends:Content,EventHandlers:["roomMemberRequestDeleted","roomMemberRequestAdded","roomMemberAdded"],onBeforeInit:function(options){this.room=options.room;return options;},onInit:function(){this.statusBox=new RoomStatusBox(this.room);$(this.statusBox).inject(this.content);StreamItemUtility.createSeperatorItem("Membership Requests").inject(this.content);this.loader=new ItemLoader({idField:"user_id",sortField:"date_created",sortAscending:false,createElementFunc:ContactItemUtility.createRoomRequestItemFactory(this.room),emptyEl:new Element("div",{"class":"post empty","text":"There are no membership requests to this room"}),loadingEl:new Element("div",{"class":"post empty","text":"Room member requests loading..."})});$(this.loader).inject(this.content);},onShow:function(first){if(first){this.loadMore();}},onHide:function(){},loadMore:function(){var params={username:this.room.username,date_created:this.loader.lowestSortValue};this.call("pipio","room_requests",params,this.loadMoreSuccess.bind(this),null);this.loader.showLoading();},loadMoreSuccess:function(data){this.loader.hideLoading();if(!$defined(data.requests)||data.requests.length==0){this.atBottom=true;return;}data.requests.each(function(user){var user_copy=UserUtility.processUser(user);user_copy.date_created=user.date_created;this.loader.process(user_copy);},this);this.bottomFuncCalled=false;},bottomFunc:function(){this.loadMore();},roomMemberAdded:function(data){if(!$defined(data.room_username)||!$defined(data.user)||data.room_username!=this.room.username){return;}this.loader.remove(data.user.user_id);},roomMemberRequestDeleted:function(data){if(!$defined(data.room_username)||!$defined(data.username)||data.room_username!=this.room.username){return;}if(!$defined(this.getUser(data.username))){return;}var user=this.getUser(data.username);this.loader.remove(user.user_id);},roomMemberRequestAdded:function(data){if(!$defined(data.room_username)||!$defined(data.user)||data.room_username!=this.room.username){return;}var user=UserUtility.processUser(data.user);user.date_created=new Date().getTime()/1000;this.loader.process(user);}});var RoomSubscribersContent=new Class({Extends:Content,EventHandlers:["roomSubscriberAdded","roomSubscriberDeleted"],onBeforeInit:function(options){this.room=options.room;return options;},onInit:function(){this.statusBox=new RoomStatusBox(this.room);$(this.statusBox).inject(this.content);StreamItemUtility.createSeperatorItem("Subscribers").inject(this.content);this.loader=new ItemLoader({idField:"user_id",sortField:"date_created",sortAscending:false,createElementFunc:ContactItemUtility.createRoomSubscriberItem,emptyEl:new Element("div",{"class":"post empty","text":"There are no subscribers to this room"}),loadingEl:new Element("div",{"class":"post empty","text":"Room subscribers loading..."})});$(this.loader).inject(this.content);},onShow:function(first){if(first){this.loadMore();}},onHide:function(){},roomSubscriberAdded:function(data){if(!$defined(data.username)||!$defined(data.user)||data.username!=this.room.username){return;}var user=UserUtility.processUser(data.user);user.date_created=new Date().getTime()/1000;this.loader.process(user);},roomSubscriberDeleted:function(data){if(!$defined(data.username)||!$defined(data.room_username)||data.room_username!=this.room.username){return;}if(!$defined(this.getUser(data.username))){return;}var user=this.getUser(data.username);this.loader.remove(user.user_id);},loadMore:function(){var params={username:this.room.username,date_created:this.loader.lowestSortValue};this.call("pipio","room_subscribers",params,this.loadMoreSuccess.bind(this),null);this.loader.showLoading();},loadMoreSuccess:function(data){this.loader.hideLoading();if(!$defined(data.subscribers)||data.subscribers.length==0){this.atBottom=true;return;}data.subscribers.each(function(user){var user_copy=UserUtility.processUser(user);user_copy.date_created=user.date_created;this.loader.process(user_copy);},this);this.bottomFuncCalled=false;},bottomFunc:function(){this.loadMore();}});var RoomEditProfilePopupContent=new Class({Extends:PopupContent,strings:{bioLabel:"About:",urlLabel:"Website:"},onBeforeInit:function(options){this.room=options.room;return options;},onInit:function(){this.bioInput=new Element("textarea",{"maxlength":500});new Element("div",{"class":"input_section bio"}).adopt(new Element("div",{"class":"label light","text":this.strings.bioLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.bioInput)).inject(this.content);this.urlInput=new Element("input",{"type":"text","maxlength":200});new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.urlLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.urlInput)).inject(this.content);var about=this.getProfile(this.room.username);if($defined(about)){if($defined(about.bio)){this.bioInput.set("text",about.bio);}if($defined(about.url)){this.urlInput.value=about.url;}}this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Update",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.updateProfile.bind(this));this.message=new Element("div",{"class":"message error"});this.actions=new Element("div",{"class":"actions"}).adopt(this.message,$(this.actionButton),$(this.closeButton)).inject(this.content);},updateProfile:function(){var bio=this.bioInput.value.trim();var url=this.urlInput.value.trim();var params={username:this.room.username,bio:bio,url:url};this.call("home","room_profile_update",params,this.updateProfileSuccess.bind(this),this.updateProfileFail.bind(this));this.actionButton.showProgress();this.message.empty();},updateProfileSuccess:function(data){this.actionButton.hideProgress();this.closeContent();},updateProfileFail:function(){this.actionButton.hideProgress();this.message.set("text",this.strings.errorMessage);},onShow:function(){this.focus();},focus:function(){this.bioInput.focus.delay(500,this.bioInput);}});var RoomSearchPopupContent=new Class({Extends:PopupContent,strings:{roomSearchMessage:"Enter any terms to search for a room",errorMessage:"There was an error creating this group"},onInit:function(){new Element("div",{"class":"text_section centered light","text":this.strings.roomSearchMessage}).inject(this.content);this.searchInput=new Element("input",{"type":"text","maxlength":"50"});this.searchInput.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"textarea_wrapper"}).adopt(this.searchInput)).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Search",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.search.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.actionButton),$(this.closeButton)).inject(this.content);},inputKeyUp:function(e){if(e.key=="enter"){if(this.searchInput.value.trim()!=""){this.search();}}},search:function(){var query=this.searchInput.value.trim();var params={query:query};this.call("home","room_search",params,this.searchSuccess.bind(this),this.searchFail.bind(this));this.actionButton.showProgress();},searchSuccess:function(data){this.actionButton.hideProgress();if(!$defined(data.rooms)){return;}if(data.rooms.length==0){var name="room_search";var title="No Results";var message="Your search returned no results";this.fireEvent("showAlert",name,title,message);}else{this.showResultsPopup(data.rooms);}},searchFail:function(status){this.actionButton.hideProgress();var name="search_user";var title="Error";var message=status.message;this.fireEvent("showAlert",name,title,message);},showResultsPopup:function(rooms){if($defined(this.resultsPopup)){this.resultsPopup.close();}this.createResultsPopup(rooms);},closeResultsPopup:function(){if($defined(this.resultsPopup)){this.resultsPopup.close();}},createResultsPopup:function(rooms){this.resultsPopup=new Popup({size:{x:350,y:400},resizable:false,dockable:false,className:"roomSearch",onClose:this.destroyResultsPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"search"},displayName:"Search Results",closable:true});var content=new RoomSearchResultPopupContent({rooms:rooms});this.resultsPopup.addContent("results",nav,content);},destroyResultsPopup:function(){this.resultsPopup=null;},onShow:function(){this.focus();},focus:function(){this.searchInput.focus.delay(500,this.searchInput);},onClose:function(){this.closeResultsPopup();}});var RoomSearchResultPopupContent=new Class({Extends:PopupContent,strings:{searchResultMessage:"Search results"},onBeforeInit:function(options){this.rooms=options.rooms;return options;},onInit:function(){this.list=new Element("div",{"class":"itemList"}).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Close",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.closeButton)).inject(this.content);this.insertRooms();},insertRooms:function(){this.rooms.each(function(room){room=UserUtility.processRoom(room);this.insertRoom(room);},this);},insertRoom:function(room){var el=RoomItemUtility.createRoomItem(room);el.addEvent("click",this.fireEvent.bind(this,["showRoom",room]));el.inject(this.list);}});var RoomItemUtility={createRoomItem:function(room){var el=new Element("div",{"class":"listItem"});ItemUtility.createProfilePic(room,32).inject(el);new Element("div",{"class":"listText text12 light","text":TextUtility.cleanText(room.room_name+" ("+room.username+")")}).inject(el);if($defined(room.about)&&$defined(room.about.bio)){new Element("div",{"class":"about_text text11 light3","text":TextUtility.cleanText(room.about.bio)}).inject(el);}return el;}};var RoomConnectionMenuSection=new Class({Extends:Base,EventHandlers:["roomStreamSubscriptionAdded","roomStreamSubscriptionDeleted","roomMembershipUpdated"],init:function(options){this.room=this.getRoom(options.room.username);this.subscribed=parseInt(this.room.subscribed)==1;this.isCreator=this.room.creator_id==this.getPrivateUser().user_id;this.createSection();},createSection:function(){this.wrapper=new Element("div");this.generateSection();},setRoom:function(room){this.room=room;this.generateSection();},generateSection:function(){this.wrapper.empty();this.generateSubscriptionSection();if(this.isCreator){this.generatePrivacySection();new Element("div",{"class":"text_section light centered text11","text":"You are the creator"}).inject(this.wrapper);this.button=new ButtonMedium({displayName:"Close Room",className:"dark",action:"cross"});var name="roomDelete_"+this.room.username;var title="Close "+this.room.room_name;var message="Are you sure you want to close the room "+this.room.room_name+"?";var func=pipio.dispatchEvent.bind(pipio,["feedRoomDelete",this.room.username]);$(this.button).addEvent("click",pipio.dispatchEvent.bind(pipio,["showConfirmation",name,title,message,func]));new Element("div",{"class":"button_section"}).adopt($(this.button)).inject(this.wrapper);}else{switch(parseInt(this.room.status)){case 1:this.createConnectedSection();break;case 2:this.createRequestSection();break;case 3:this.createRequestOutSection();break;default:this.createNotConnectedSection();break;}}},createNotConnectedSection:function(){this.button=new ButtonMedium({displayName:"Join Room",className:"dark",action:"check"});var name="roomRequest_"+this.room.username;var title="Join "+this.room.room_name;var message="Send membership request to "+this.room.room_name+"?";var func=this.roomRequestCreate.bind(this);$(this.button).addEvent("click",pipio.dispatchEvent.bind(pipio,["showConfirmation",name,title,message,func]));new Element("div",{"class":"button_section"}).adopt($(this.button)).inject(this.wrapper);},createConnectedSection:function(){new Element("div",{"class":"text_section light centered text11","text":"You are a member"}).inject(this.wrapper);this.button=new ButtonMedium({displayName:"Leave Room",className:"dark",action:"cross"});var name="roomLeave_"+this.room.username;var title="Leave "+this.room.room_name;var message="Are you sure you want to leave "+this.room.room_name+"?";var func=this.roomMembershipDelete.bind(this);$(this.button).addEvent("click",pipio.dispatchEvent.bind(pipio,["showConfirmation",name,title,message,func]));new Element("div",{"class":"button_section"}).adopt($(this.button)).inject(this.wrapper);},createRequestSection:function(){this.button=new ButtonMedium({displayName:"Accept Membership",className:"dark",action:"check"});$(this.button).addEvent("click",this.roomInviteAccept.bind(this));new Element("div",{"class":"button_section"}).adopt($(this.button)).inject(this.wrapper);this.button2=new ButtonMedium({displayName:"Reject Membership",className:"dark",action:"cross"});$(this.button2).addEvent("click",this.roomInviteDelete.bind(this));new Element("div",{"class":"button_section"}).adopt($(this.button2)).inject(this.wrapper);},roomInviteAccept:function(){this.call("home","room_invite_accept",{username:this.room.username},null,null);this.button.showProgress();},roomInviteDelete:function(){var params={username:this.getPrivateUser().username,room_username:this.room.username};this.call("home","room_invite_delete",params,null,null);this.button2.showProgress();},createRequestOutSection:function(){new Element("div",{"class":"text_section light centered text11","text":"Membership request pending"}).inject(this.wrapper);},roomRequestCreate:function(){this.call("home","room_request_create",{username:this.room.username},null,null);this.button.showProgress();},roomMembershipDelete:function(){this.call("home","room_leave",{username:this.room.username},null,null);this.button.showProgress();},generateSubscriptionSection:function(){this.subscription=new Toggle(this.subscribed);$(this.subscription).addEvent("click",this.subscriptionToggle.bind(this));new Element("div",{"class":"toggle_section"}).adopt(new Element("div",{"class":"text light","text":"Subscribe:"}),$(this.subscription)).inject(this.wrapper);},generatePrivacySection:function(){this.privacy=new Toggle(this.room.is_public==1);$(this.privacy).addEvent("click",this.privacyToggle.bind(this));new Element("div",{"class":"toggle_section"}).adopt(new Element("div",{"class":"text light","text":"Public:"}),$(this.privacy)).inject(this.wrapper);},privacyToggle:function(){this.call("home","room_privacy_set",{username:this.room.username,is_public:this.privacy.toInt()});},subscriptionToggle:function(){Logger().log(this.subscribed);if(this.subscribed){this.streamUnsubscribe();}else{this.streamSubscribe();}},streamUnsubscribe:function(){this.subscription.off();this.call("home","room_unsubscribe",{username:this.room.username});},streamSubscribe:function(){this.subscription.on();this.call("home","room_subscribe",{username:this.room.username},null,this.streamSubscribeFail.bind(this));},streamSubscribeFail:function(status){if(status.code==2002){this.subscription.off();var name="subscription";var title="Error";var message=status.message;this.fireEvent("showAlert",name,title,message);}},roomPrivacyUpdated:function(data){if(!$defined(data.username)||data.username!=this.room.username,!$defined(data.is_public)){return;}if(data.is_public==1){this.privacy.on();}else{this.privacy.off();}},roomStreamSubscriptionAdded:function(data){if(!$defined(data.room)||data.room.username!=this.room.username){return;}this.subscribed=true;this.generateSection();},roomStreamSubscriptionDeleted:function(data){if(!$defined(data.username)||data.username!=this.room.username){return;}this.subscribed=false;this.generateSection();},roomMembershipUpdated:function(data){if(!$defined(data.username)||data.username!=this.room.username){return;}this.room.status=parseInt(data.status);this.generateSection();},toElement:function(){return this.wrapper;}});var RoomMenu=new Class({Extends:Menu,EventHandlers:["roomMemberAdded","roomMemberDeleted","roomSubscriberAdded","roomSubscriberDeleted","roomMemberRequestDeleted","roomMemberRequestAdded"],strings:{groupMenuText:'These are contacts in your group "{0}"',unsortedGroupMenuText:"These are contacts that have not been added to a group"},onBeforeInit:function(options){this.room=options.room;this.appId=options.appId;this.isCreator=this.room.creator_id==this.getPrivateUser().user_id;return options;},onInit:function(){ItemUtility.createProfilePic(this.room,100).inject(this.menu);this.aboutSection=new RoomProfileMenuSection({room:this.room});$(this.aboutSection).inject(this.menu);if(this.isLoggedIn()){this.connect=new RoomConnectionMenuSection({room:this.room});$(this.connect).inject(this.menu);if(this.isCreator){this.profilePicUploadButton=new ButtonMedium({displayName:"Change Picture",className:"dark",action:"photo"});this.fileInput=new Element("input",{"type":"file","name":"file"});this.form=new Element("form").adopt(this.fileInput);this.fileInput.addEvent("change",this.profilePicUpload.bind(this));this.profilePicUploadSection=new Element("div",{"class":"button_section"}).adopt($(this.profilePicUploadButton).adopt(this.form)).inject(this.menu);var editProfileButton=new ButtonMedium({displayName:"Edit Profile",className:"dark",action:"edit"});$(editProfileButton).addEvent("click",this.fireEvent.bind(this,["showEditRoomProfilePopup",this.room]));new Element("div",{"class":"button_section"}).adopt($(editProfileButton)).inject(this.menu);this.inviteButton=new ButtonMedium({displayName:"Invite Members",className:"dark",action:"forward"});$(this.inviteButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["showRoomInvitePopup",this.room]));new Element("div",{"class":"button_section"}).adopt($(this.inviteButton)).inject(this.menu);}}new Element("div",{"class":"nav_seperator"}).inject(this.menu);this.members=new MembersNav({room:this.room,appId:this.appId,onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"room_members","room_menu"])});$(this.members).inject(this.menu);this.subscribers=new SubscribersNav({user:this.room,appId:this.appId,onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"room_subscribers","room_menu"])});$(this.subscribers).inject(this.menu);if(this.isCreator){this.requests=new MemberRequestsNav({room:this.room,appId:this.appId,onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"room_requests","room_menu"])});$(this.requests).inject(this.menu);}},onShow:function(first){if(first){this.roomInfoLoad();}},roomInfoLoad:function(){if(this.isLoggedIn()){this.call("home","room_info_load",{username:this.room.username},this.roomInfoLoadSuccess.bind(this),null);}else{this.call("home","public_room_info_load",{username:this.room.username},this.roomInfoLoadSuccess.bind(this),null);}},roomMemberAdded:function(data){if(!$defined(data.room_username)||!$defined(data.user)||data.room_username!=this.room.username){return;}this.members.addUsers(data.user);this.requests.removeUser(data.user.username);},roomMemberDeleted:function(data){if(!$defined(data.username)||!$defined(data.room_username)||data.room_username!=this.room.username){return;}this.members.removeUser(data.username);},roomSubscriberAdded:function(data){if(!$defined(data.username)||!$defined(data.user)||data.username!=this.room.username){return;}this.subscribers.addUsers(data.user);},roomSubscriberDeleted:function(data){if(!$defined(data.username)||!$defined(data.room_username)||data.room_username!=this.room.username){return;}this.subscribers.removeUser(data.username);},roomMemberRequestDeleted:function(data){if(!$defined(data.room_username)||!$defined(data.username)||data.room_username!=this.room.username){return;}this.requests.removeUser(data.username);},roomMemberRequestAdded:function(data){if(!$defined(data.room_username)||!$defined(data.user)||data.room_username!=this.room.username){return;}this.requests.addUsers(data.user);},roomInfoLoadSuccess:function(data){if(!$defined(data.room)){return;}var room=UserUtility.processRoom(data.room);this.subscribers.addUsers(data.subscribers);this.members.addUsers(data.members);if($defined(data.requests)&&$defined(this.requests)){this.requests.addUsers(data.requests);}},profilePicUpload:function(){if(DataUtility.validatePhotoFile(this.fileInput.value)){this.call("pipio","room_profilepic_upload",{username:this.room.username},this.profilePicUploadSuccess.bind(this),this.profilePicUploadFail.bind(this),this.form);this.profilePicUploadButton.showProgress();}},profilePicUploadSuccess:function(){this.profilePicUploadButton.hideProgress();this.resetForm();},profilePicUploadFail:function(){this.profilePicUploadButton.hideProgress();this.resetForm();},resetForm:function(){this.profilePicUploadSection.empty();this.profilePicUploadButton=new ButtonMedium({displayName:"Change Picture",className:"dark",action:"photo"});this.fileInput=new Element("input",{"type":"file","name":"file"});this.form=new Element("form").adopt(this.fileInput);this.fileInput.addEvent("change",this.profilePicUpload.bind(this));this.profilePicUploadSection.adopt($(this.profilePicUploadButton).adopt(this.form));}});var RoomProfileMenuSection=new Class({Extends:Base,EventHandlers:["roomProfileUpdated"],init:function(options){this.room=options.room;this.createSection();},createSection:function(){this.wrapper=new Element("div");this.bioText=new Element("span");this.bioSection=new Element("div",{"class":"text_section light1 text11 edit_option"}).adopt(new Element("span",{"class":"bold","text":"About: "}),this.bioText).inject(this.wrapper);this.urlText=new Element("a",{"target":"_blank"});this.urlSection=new Element("div",{"class":"text_section light1 text11 nowrap edit_option"}).adopt(new Element("span",{"class":"bold","text":"Web: "}),this.urlText).inject(this.wrapper);this.roomProfileUpdated(this.room.username,this.getProfile(this.room.username));},roomProfileUpdated:function(username,about){if(username!=this.room.username){return;}if(!$defined(about)){DomUtility.hide(this.bioSection);DomUtility.hide(this.urlSection);return;}if(!$defined(about.bio)||about.bio==""){DomUtility.hide(this.bioSection);}else{this.bioText.set("text",TextUtility.unescape(about.bio));DomUtility.show(this.bioSection);}if(!$defined(about.url)||about.url==""){DomUtility.hide(this.urlSection);}else{this.urlText.set("text",TextUtility.unescape(about.url));this.urlText.set("href",about.url);DomUtility.show(this.urlSection);}},toElement:function(){return this.wrapper;}});var Rss=new Class({Extends:App,EventHandlers:["userSwitched","rssInstall","rssUninstall","rssFeedSubscribed","rssFeedUnsubscribed","showAddRssFeedPopup"],onStart:function(){this.setupNav();this.feeds=$H();this.loadSubscriptions();},onStop:function(){},userSwitched:function(){if(!this.isLoggedIn()){this.stop();}},loadSubscriptions:function(){this.call("rss","rss_subscriptions",null,this.loadSubscriptionsSuccess.bind(this),null);},loadSubscriptionsSuccess:function(data){if(!$defined(data.subscriptions)){return;}data.subscriptions.each(function(subscription){this.rssFeedAdd(subscription);},this);},rssFeedSubscribed:function(data){if(!$defined(data.subscription)){return;}this.rssFeedAdd(data.subscription);},rssFeedUnsubscribed:function(data){if(!$defined(data.atom_id)){return;}this.rssFeedDelete(data.atom_id);},rssUninstall:function(){this.call("rss","rss_uninstall",null,this.rssUninstallSuccess.bind(this),null);},rssUninstallSuccess:function(){this.stop();},rssInstall:function(){this.call("rss","rss_install",null,this.rssInstallSuccess.bind(this),null);},rssInstallSuccess:function(){this.start();}});Rss.implement({requests:[{name:"rss_subscriptions",url:"/api/app/rss/subscriptions"},{name:"rss_subscriptions_add",params:["feed_url"],url:"/api/app/rss/subscriptions/add"},{name:"rss_subscriptions_delete",params:["subscription_id"],url:"/api/app/rss/subscriptions/delete"},{name:"rss_feed",params:["atom_id","item_id"],url:"/api/app/rss/feed"},{name:"rss_feed_all",url:"/api/app/rss/feed/all"},{name:"rss_feed_subscribers",params:["atom_id"],url:"/api/app/rss/feed/subscribers"},{name:"rss_install",params:[],url:"/api/app/rss/install"},{name:"rss_uninstall",params:[],url:"/api/app/rss/uninstall"}]});Rss.implement({setupNav:function(){var homeNav=new Nav({iconOptions:{iconName:"updates"},displayName:"All News Updates",name:"updates",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"updates","rss_menu"])});this.navAdd(homeNav);this.navAdd(new Nav({iconOptions:{iconName:"rss"},hasSubnavs:true,displayName:"Feeds",name:"feeds"}));this.navAdd(new Nav({iconOptions:{iconName:"broadcast",iconAction:"add"},displayName:"Add New Feed...",onClick:this.showAddRssFeedPopup.bind(this),name:"new_feed",parentName:"feeds",bottom:true}));var rssMenu=new RssMenu({isDefault:true,closeFunc:this.stop.bind(this),navId:homeNav.navId});this.menuAdd("rss_menu",rssMenu);var content=new RssContent({isDefault:true});this.contentAdd("updates",content);},rssFeedAdd:function(feed){if(this.feeds.has(feed.atom_id)){return;}var nav=new Nav({iconOptions:{"iconName":"rss"},displayName:feed.title,name:"rss_"+feed.atom_id,parentName:"feeds",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"rss_"+feed.atom_id,"rss_"+feed.atom_id])});this.navAdd(nav);this.feeds.set(feed.atom_id,nav);var feedMenu=new RssFeedMenu({displayName:feed.title,feed:feed});this.menuAdd("rss_"+feed.atom_id,feedMenu);var content=new RssFeedContent({feed:feed});this.contentAdd("rss_"+feed.atom_id,content);},rssFeedDelete:function(atom_id){if(!this.feeds.has(atom_id)){return;}this.feeds.get(atom_id).destroy();this.navDelete("rss_"+atom_id);this.feeds.erase(atom_id);this.menuClose("rss_"+atom_id);this.contentClose("rss_"+atom_id);},showAddRssFeedPopup:function(){if($defined(this.addFeedPopup)){this.addFeedPopup.close();}this.createAddRssFeedPopup();},createAddRssFeedPopup:function(){this.addFeedPopup=new Popup({size:{x:350,y:94},resizable:false,dockable:false,className:"addFeed",onClose:this.destroyAddRssFeedPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"rss",iconAction:"add"},displayName:"Subscribe to a Feed",closable:true});var content=new AddRssFeedPopupContent({});this.addFeedPopup.addContent("add_feed",nav,content);},destroyAddRssFeedPopup:function(){this.addFeedPopup=null;}});var RssContent=new Class({Extends:Content,EventHandlers:["rssItemReceived"],onBeforeInit:function(options){this.feed=options.feed;this.sessionTimestamp=(new Date().getTime())/1000;return options;},onInit:function(){this.loader=new ItemLoader({createElementFunc:RssItemUtility.createRssAllItem,idField:"atom_item_id",sortField:"date_created",sortAscending:false,emptyEl:new Element("div",{"class":"post empty","text":"This feed has no items"}),loadingEl:new Element("div",{"class":"post empty","text":"Feed loading..."}),alertFunc:this.alertCheck.bind(this)});$(this.loader).inject(this.content);},alertCheck:function(item){if(item.date_created>this.sessionTimestamp){this.fireEvent("alertAdd",this.navId);}},onShow:function(first){if(first){this.loadMore();}},onHide:function(){},rssItemReceived:function(data){if($defined(data.item)){this.loader.process(data.item);}},loadMore:function(){var params={date_created:this.loader.lowestSortValue};this.call("rss","rss_feed_all",params,this.loadMoreSuccess.bind(this),null);this.loader.showLoading();},loadMoreSuccess:function(data){this.loader.hideLoading();if(!$defined(data.items)||data.items.length==0){this.atBottom=true;return;}data.items.each(function(item){item.feed=this.feed;this.loader.process(item);},this);this.bottomFuncCalled=false;},bottomFunc:function(){this.loadMore();}});var RssFeedContent=new Class({Extends:Content,EventHandlers:["rssItemReceived"],onBeforeInit:function(options){this.feed=options.feed;return options;},onInit:function(){this.loader=new ItemLoader({createElementFunc:RssItemUtility.createRssFeedItem,idField:"atom_item_id",sortField:"date_created",sortAscending:false,emptyEl:new Element("div",{"class":"post empty","text":"This feed has no items"}),loadingEl:new Element("div",{"class":"post empty","text":"Feed loading..."})});$(this.loader).inject(this.content);},onShow:function(first){if(first){this.loadMore();}},onHide:function(){},rssItemReceived:function(data){if($defined(data.item)&&data.item.atom_id==this.feed.atom_id){this.loader.process(data.item);}},loadMore:function(){var params={atom_id:this.feed.atom_id,date_created:this.loader.oldestTimestamp};this.call("rss","rss_feed",params,this.loadMoreSuccess.bind(this),null);this.loader.showLoading();},loadMoreSuccess:function(data){this.loader.hideLoading();if(!$defined(data.items)||data.items.length==0){this.atBottom=true;return;}data.items.each(function(item){item.feed=this.feed;this.loader.process(item);},this);this.bottomFuncCalled=false;},bottomFunc:function(){Logger().log("rss content bottom");}});var RssFeedMenu=new Class({Extends:Menu,onBeforeInit:function(options){this.feed=options.feed;return options;},onInit:function(){this.urlText=new Element("a",{"target":"_blank","href":this.feed.link,"text":TextUtility.unescape(this.feed.link)});new Element("div",{"class":"text_section nowrap text11 light1"}).adopt(new Element("span",{"class":"bold","text":"Web: "}),this.urlText).inject(this.menu);new Element("div",{"class":"text_section light1","text":TextUtility.unescape(this.feed.description)}).inject(this.menu);this.deleteButton=new ButtonMedium({displayName:"Unsubscribe",className:"dark",action:"cross"});var name="rssFeedUnsubscribe_"+this.feed.atom_id;var title="Unsubscribe "+this.feed.title;var message="Are you sure you want to unsubscribe from the feed "+this.feed.title+"?";var func=this.rssUnsubscribe.bind(this);$(this.deleteButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["showConfirmation",name,title,message,func]));new Element("div",{"class":"button_section"}).adopt($(this.deleteButton)).inject(this.menu);new Element("div",{"class":"nav_seperator"}).inject(this.menu);this.subscribers=new SubscribersNav({user:this.feed});$(this.subscribers).inject(this.menu);},onShow:function(first){if(first){this.subscribersLoad();}},subscribersLoad:function(){this.call("rss","rss_feed_subscribers",{atom_id:this.feed.atom_id},this.subscribersLoadSuccess.bind(this),null);},subscribersLoadSuccess:function(data){if(!$defined(data.subscribers)){return;}this.subscribers.addUsers(data.subscribers);},rssUnsubscribe:function(){var params={subscription_id:this.feed.subscription_id};this.call("rss","rss_subscriptions_delete",params,this.rssUnsubscribeSuccess.bind(this),this.rssUnsubscribeFail.bind(this));this.deleteButton.showProgress();},rssUnsubscribeSuccess:function(data){this.deleteButton.hideProgress();},rssUnsubscribeFail:function(){this.deleteButton.hideProgress();}});var RssMenu=new Class({Extends:Menu,onBeforeInit:function(options){options.displayName="News Reader";return options;},onInit:function(){new Element("div",{"class":"text_section light1","text":TextUtility.unescape("All updates from your subscriptions will be visible here")}).inject(this.menu);}});var AddRssFeedPopupContent=new Class({Extends:PopupContent,strings:{feedUrlLabel:"Feed URL:",errorMessage:"There was an error subscribing to this feed"},onInit:function(){this.feedUrlInput=new Element("textarea",{"maxlength":200});this.feedUrlInput.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.feedUrlLabel}),new Element("div",{"class":"textarea_wrapper"}).adopt(this.feedUrlInput)).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Subscribe",className:"dark",action:"check"});$(this.actionButton).addEvent("click",this.feedSubscribe.bind(this));this.message=new Element("div",{"class":"message success"});this.actions=new Element("div",{"class":"actions"}).adopt(this.message,$(this.actionButton),$(this.closeButton)).inject(this.content);},inputKeyUp:function(e){if(e.key=="enter"){if(this.feedUrlInput.value.trim()!=""){this.feedSubscribe();}}},feedSubscribe:function(){var url=this.feedUrlInput.value.trim();var params={feed_url:url};this.call("rss","rss_subscriptions_add",params,this.feedSubscribeSuccess.bind(this),this.feedSubscribeFail.bind(this));this.actionButton.showProgress();this.message.set("text","please wait...");},feedSubscribeSuccess:function(){this.actionButton.hideProgress();this.closeContent();},feedSubscribeFail:function(status){this.actionButton.hideProgress();var name="feed_subscribe";var title="Error Subscribing to Feed";var message=status.message;this.message.empty();this.fireEvent("showAlert",name,title,message);},onShow:function(){this.focus();},focus:function(){this.feedUrlInput.focus.delay(500,this.feedUrlInput);}});var RssItemUtility={createRssFeedItem:function(item){return RssItemUtility.createRssItem(item,false);},createRssAllItem:function(item){return RssItemUtility.createRssItem(item,true);},createRssItem:function(item,showFeed){var el=ItemUtility.createPostBubble("post haspic");ItemUtility.createItemPic("/images/v5/apps/rss/feed_icon.png").inject(el);var content=new Element("div",{"class":"post_content"}).inject(el);RssItemUtility.createRssItemHeader(item,showFeed).inject(content);RssItemUtility.createRssItemFooter(item,showFeed).inject(content);return el;},createRssItemHeader:function(item,showFeed){var el=new Element("div",{"class":"header"});new Element("span",{}).adopt(new Element("a",{"href":item.link,"class":"user_name clickable","text":TextUtility.unescape(item.title),"target":"_blank"})).inject(el);if($defined(item.summary)&&item.summary!=""){new Element("span",{"html":" "+TextUtility.replaceUrls(TextUtility.stripHtml(TextUtility.unescape(item.summary)))}).inject(el);}return el;},createRssItemFooter:function(item){var el=new Element("div",{"class":"footer"});if(!$defined(item.date_created)){return el;}var date=DateUtility.convertFromTimestamp(item.date_created);var ts=new Element("span",{"class":"timestamp","text":DateUtility.getTimestamp(date,"%B %D at %I:%M%p"),"ts":date,"ts_format":"%B %D at %I:%M%p"}).inject(el);return el;}};var Twitter=new Class({Extends:App,EventHandlers:["userSwitched","twitterInstall","twitterUninstall","showTwitterUser","twitterShowFollowing","twitterShowFollowers","showTwitterList","twitterListSubscribed","twitterListUnsubscribed","twitterListsLoaded","showTwitterSearchPopup","twitterSearch","twitterRetweet","twitterDelete","twitterSavedSearchesLoaded","twitterSavedSearchAdd","twitterSavedSearchDelete"],parseOptions:function(options){this.settings=options.settings;},onStart:function(){this.setupNav();},onStop:function(){},userSwitched:function(){if(!this.isLoggedIn()){this.userLoggedOut();}},userLoggedOut:function(){this.stop();},twitterInstall:function(){this.installPopup=new Popup({size:{x:350,y:80},resizable:false,dockable:false,className:"appInstall",onClose:this.destroyTwitterInstallPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"twitter"},displayName:"Install Twitter",closable:true});var content=new TwitterInstallPopupContent({});this.installPopup.addContent("install",nav,content);},destroyTwitterInstallPopup:function(){this.installPopup=null;},twitterUninstall:function(){this.call("twitter","twitter_uninstall",null,this.twitterUninstallSuccess.bind(this));},twitterUninstallSuccess:function(){this.stop();},twitterRetweet:function(id){var name="twitterRetweet_"+id;var title="Retweet an Update";var message="Retweet this update?";var func=this.twitterRetweetCall.bind(this,[id]);this.fireEvent("showConfirmation",name,title,message,func);},twitterRetweetCall:function(id){this.call("twitter","twitter_retweet",{id:id},this.twitterRetweetSuccess.bind(this));},twitterRetweetSuccess:function(data){},twitterDelete:function(id){var name="twitterDelete_"+id;var title="Delete Update";var message="Delete this update?";var func=this.twitterDeleteCall.bind(this,[id]);this.fireEvent("showConfirmation",name,title,message,func);},twitterDeleteCall:function(id){this.call("twitter","twitter_item_delete",{id:id},this.twitterDeleteSuccess.bind(this));},twitterDeleteSuccess:function(data){if(!$defined(data.id)){return;}TwitterItemUtility.deleteTwitterItem(data.id);}});Twitter.implement({requests:[{name:"twitter_auth_request",url:"/api/app/twitter/auth/request"},{name:"twitter_install",params:["sync_posts"],url:"/api/app/twitter/install"},{name:"twitter_uninstall",url:"/api/app/twitter/uninstall"},{name:"twitter_user_show",params:["screen_name"],url:"/api/app/twitter/user/show"},{name:"twitter_list_show",params:["screen_name","slug"],url:"/api/app/twitter/list/show"},{name:"twitter_self_show",params:["screen_name"],url:"/api/app/twitter/self/show"},{name:"twitter_home_timeline",params:["since_id","max_id"],url:"/api/app/twitter/home/timeline"},{name:"twitter_user_timeline",params:["username","since_id","max_id"],url:"/api/app/twitter/user/timeline"},{name:"twitter_lists_timeline",params:["screen_name","list_id","since_id","max_id"],url:"/api/app/twitter/lists/timeline"},{name:"twitter_mentions",params:["since_id","max_id","count","page"],url:"/api/app/twitter/mentions"},{name:"twitter_settings_update",params:["key","value"],url:"/api/app/twitter/settings/update"},{name:"twitter_follow",params:["screen_name"],url:"/api/app/twitter/follow"},{name:"twitter_unfollow",params:["screen_name"],url:"/api/app/twitter/unfollow"},{name:"twitter_settings_set",params:["key","value"],url:"/api/app/twitter/settings/update"},{name:"twitter_friends",params:["username","page"],url:"/api/app/twitter/friends"},{name:"twitter_followers",params:["username","page"],url:"/api/app/twitter/followers"},{name:"twitter_block",params:["screen_name"],url:"/api/app/twitter/block"},{name:"twitter_post_text",params:["body","post_id"],url:"/api/app/twitter/text/item_create"},{name:"twitter_search",params:["q","page"],url:"/api/app/twitter/search"},{name:"twitter_searches_create",params:["query"],url:"/api/app/twitter/searches/create"},{name:"twitter_searches_delete",params:["id"],url:"/api/app/twitter/searches/delete"},{name:"twitter_retweet",params:["id"],url:"/api/app/twitter/retweet"},{name:"twitter_item_delete",params:["id"],url:"/api/app/twitter/item/delete"},{name:"twitter_dm_inbox",url:"/api/app/twitter/dm/inbox"},{name:"twitter_dm_all",url:"/api/app/twitter/dm/all"},{name:"twitter_dm_delete",params:["id"],url:"/api/app/twitter/dm/delete"},{name:"twitter_dm_send",params:["recipient","message"],url:"/api/app/twitter/dm/send"},{name:"twitter_searches_saved",url:"/api/app/twitter/searches/saved"},{name:"twitter_trends",url:"/api/app/twitter/trends"},{name:"twitter_favorites",url:"/api/app/twitter/favorites"},{name:"twitter_favorites_create",params:["id","element_id"],url:"/api/app/twitter/favorites/create"},{name:"twitter_favorites_delete",params:["id","element_id"],url:"/api/app/twitter/favorites/delete"},{name:"twitter_lists",params:["screen_name"],url:"/api/app/twitter/lists"},{name:"twitter_lists_members",url:"/api/app/twitter/lists/members"},{name:"twitter_lists_create",params:["name","mode","description"],url:"/api/app/twitter/lists/create"},{name:"twitter_lists_delete",params:["list_id"],url:"/api/app/twitter/lists/delete"},{name:"twitter_lists_statuses",params:["screen_name","list_id","cursor","page"],url:"/api/app/twitter/lists/statuses"},{name:"twitter_lists_add_user",params:["list_id","id"],url:"/api/app/twitter/lists/add_user"},{name:"twitter_lists_get_users",params:["screen_name","list_id"],url:"/api/app/twitter/lists/get_users"},{name:"twitter_lists_delete_user",params:["list_id","id"],url:"/api/app/twitter/lists/delete_user"},{name:"twitter_lists_subscribe",params:["screen_name","list_id"],url:"/api/app/twitter/lists/subscribe"},{name:"twitter_lists_subscribers",params:["screen_name","list_id"],url:"/api/app/twitter/lists/subscribers"},{name:"twitter_lists_unsubscribe",params:["screen_name","list_id"],url:"/api/app/twitter/lists/unsubscribe"},{name:"twitter_lists_subscriptions",params:["screen_name"],url:"/api/app/twitter/lists/subscriptions"},{name:"twitter_lists_memberships",params:["screen_name"],url:"/api/app/twitter/lists/memberships"},{name:"twitter_post_link",params:["body","url","post_id"],url:"/api/app/twitter/link/item_create"},{name:"twitter_post_photo",params:["body","photo","post_id"],url:"/api/app/twitter/photo/item_create",multipart:true},]});Twitter.implement({twitterSavedSearchesLoaded:function(searches){this.saved_searches=$H();searches.each(function(search){this.saved_searches.set(search.id,search);},this);},twitterSavedSearchAdd:function(search){this.saved_searches.set(search.id,search);},twitterSavedSearchDelete:function(id){this.saved_searches.erase(id);},twitterSearch:function(query,search_id){if(!$defined(search_id)){search_id=0;}var search={query:query,id:search_id};if(this.searches.has(query)){this.fireEvent("viewSwitch",this.appId,"search_"+query,"search_"+query);return;}this.searchAdd(search);},searchAdd:function(search){if(!$defined(this.searchNav)){this.searchNav=new Nav({iconOptions:{iconName:"search"},hasSubnavs:true,displayName:"Searches",name:"searches"});this.navAdd(this.searchNav);}var nav=new Nav({displayName:search.query,closable:true,name:"search_"+search.query,parentName:"searches",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"search_"+search.query,"search_"+search.query])});this.navAdd(nav);this.searches.set(search.query,search);var content=new TwitterSearchContent({search:search,navId:nav.navId});this.contentAdd("search_"+search.query,content);var menu=new TwitterSearchMenu({search:search,searches:this.saved_searches,closable:true,closeFunc:this.searchClose.bind(this,search)});this.menuAdd("search_"+search.query,menu);this.fireEvent("viewSwitch",this.appId,"search_"+search.query,"search_"+search.query);},searchClose:function(search){Logger().log("attempting to close "+search.query);if(!this.searches.has(search.query)){return;}this.navDelete("search_"+search.query);this.menuClose("search_"+search.query);this.contentClose("search_"+search.query);this.searches.erase(search.query);if(this.searches.getLength()==0){this.navDelete("searches");this.searchNav=null;}}});Twitter.implement({setupNav:function(){this.searches=$H();this.users=$H();this.lists=$H();this.listSubs=$H();var homeNav=new Nav({iconOptions:{iconName:"updates"},displayName:"Home",name:"updates",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"updates","self_menu"])});this.navAdd(homeNav);var mentionsNav=new Nav({iconOptions:{iconName:"at"},displayName:this.settings.screen_name,name:"mentions",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"mentions","self_menu"])});this.navAdd(mentionsNav);var selfMenu=new TwitterSelfMenu({settings:this.settings,isDefault:true,closeFunc:this.stop.bind(this)});this.menuAdd("self_menu",selfMenu);var content=new TwitterHomeContent({settings:this.settings,isDefault:true,navId:homeNav.navId});this.contentAdd("updates",content);var mentionsContent=new TwitterMentionsContent({settings:this.settings,navId:mentionsNav.navId});this.contentAdd("mentions",mentionsContent);},showTwitterUser:function(screen_name){if(this.users.has(screen_name)){this.fireEvent("viewSwitch",this.appId,screen_name,screen_name);}else{this.call("twitter","twitter_user_show",{screen_name:screen_name},this.userLoaded.bind(this),null);return;}},showTwitterList:function(list_id){if(this.lists.has(list_id)){this.fireEvent("viewSwitch",this.appId,list_id,list_id);}else{var parts=list_id.split("/");this.call("twitter","twitter_list_show",{screen_name:parts[0],slug:parts[1]},this.listLoaded.bind(this),null);return;}},listLoaded:function(data){if(!$defined(data.list)){return;}data.list.following=false;this.listAdd(data.list);},userLoaded:function(data){this.userAdd(data);},twitterListSubscribed:function(list){list.following=true;if(list.following){if(!$defined(this.listsNav)){this.listsNav=new Nav({iconOptions:{iconName:"contacts"},hasSubnavs:true,displayName:"Lists",name:"lists"});this.navAdd(this.listsNav);}var nav=new Nav({iconOptions:{iconName:list.user.profile_image_url},displayName:list.user.screen_name+"/"+list.slug,closable:true,name:list.id,parentName:"lists",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,list.id,list.id]),onClose:this.listClose.bind(this,[list.id])});this.navAdd(nav);this.lists.set(list.id,nav);this.listSubs.set(list.id,list);}},twitterListUnsubscribed:function(list){if(this.listSubs.has(list.id)){this.lists.get(list.id).destroy();this.navDelete(list.id);this.lists.erase(list.id);this.listSubs.erase(list.id);}},twitterListsLoaded:function(data){data.lists.lists.each(function(list){list.following=true;this.listAdd(list);},this);data.list_subscriptions.lists.each(function(list){list.following=true;this.listAdd(list);},this);},userClose:function(screen_name){if(!this.users.has(screen_name)){return;}this.users.get(screen_name).destroy();this.navDelete(screen_name);this.users.erase(screen_name);this.menuClose(screen_name);this.contentClose(screen_name);if(this.users.getLength()==0){this.navDelete("users");this.usersNav=null;}},userAdd:function(user){if(!$defined(this.usersNav)){this.usersNav=new Nav({iconOptions:{iconName:"users"},hasSubnavs:true,displayName:"Users",name:"users"});this.navAdd(this.usersNav);}var nav=new Nav({iconOptions:{iconName:user.profile_image_url},displayName:user.screen_name,closable:true,name:user.screen_name,parentName:"users",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,user.screen_name,user.screen_name]),onClose:this.userClose.bind(this,[user.screen_name])});this.navAdd(nav);this.users.set(user.screen_name,nav);var content=new TwitterUserContent({screen_name:user.screen_name,navId:nav.navId});this.contentAdd(user.screen_name,content);var menu=new TwitterUserMenu({user:user,closable:true,closeFunc:this.userClose.bind(this,user.screen_name)});this.menuAdd(user.screen_name,menu);this.fireEvent("viewSwitch",this.appId,user.screen_name,user.screen_name);},twitterShowFollowing:function(screen_name){var content=new TwitterFollowingContent({screen_name:screen_name});this.contentAdd(screen_name+"_following",content);if(screen_name==this.settings.screen_name){this.fireEvent("viewSwitch",this.appId,screen_name+"_following","self_menu");}else{this.fireEvent("viewSwitch",this.appId,screen_name+"_following",screen_name);}},twitterShowFollowers:function(screen_name){var content=new TwitterFollowersContent({screen_name:screen_name});this.contentAdd(screen_name+"_followers",content);if(screen_name==this.settings.screen_name){this.fireEvent("viewSwitch",this.appId,screen_name+"_followers","self_menu");}else{this.fireEvent("viewSwitch",this.appId,screen_name+"_followers",screen_name);}},listAdd:function(list){if(list.following){if(!$defined(this.listsNav)){this.listsNav=new Nav({iconOptions:{iconName:"contacts"},hasSubnavs:true,displayName:"Lists",name:"lists"});this.navAdd(this.listsNav);}var nav=new Nav({iconOptions:{iconName:list.user.profile_image_url},displayName:list.user.screen_name+"/"+list.slug,closable:true,name:list.id,parentName:"lists",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,list.id,list.id]),onClose:this.listClose.bind(this,[list.id])});this.navAdd(nav);this.lists.set(list.id,nav);this.listSubs.set(list.id,list);}var content=new TwitterListContent({list:list,navId:nav.navId});this.contentAdd(list.id,content);var menu=new TwitterListMenu({list:list,closable:true,closeFunc:this.listClose.bind(this,list.id)});this.menuAdd(list.id,menu);if(!list.following){this.fireEvent("viewSwitch",this.appId,list.id,list.id);}},listClose:function(list_id){if(!this.listSubs.has(list_id)){this.menuClose(list_id);this.contentClose(list_id);}else{this.switchDefault();}},showTwitterSearchPopup:function(){if($defined(this.twitterSearchPopup)){this.twitterSearchPopup.close();}this.createTwitterSearchPopup();},createTwitterSearchPopup:function(){this.twitterSearchPopup=new Popup({size:{x:350,y:74},resizable:false,dockable:false,className:"twitterSearch",onClose:this.destroyTwitterSearchPopup.bind(this)});var nav=new Nav({iconOptions:{iconName:"twitter"},displayName:"Search Twitter",closable:true});var content=new TwitterSearchPopupContent({});this.twitterSearchPopup.addContent("twitter_search",nav,content);},destroyTwitterSearchPopup:function(){this.twitterSearchPopup=null;}});var TwitterFollowersContent=new Class({Extends:Content,EventHandlers:["twitterFollow","twitterUnfollow","twitterBlock"],onBeforeInit:function(options){this.screen_name=options.screen_name;},onInit:function(){this.loader=new ItemLoader({idField:"id",sortField:"name",createElementFunc:TwitterFollowsItemUtility.createTwitterFollowItem,emptyEl:new Element("div",{"class":"post empty","text":this.screen_name+" has no followers"}),loadingEl:new Element("div",{"class":"post empty","text":this.screen_name+"'s followers loading..."})});$(this.loader).inject(this.content);},onShow:function(first){if(first){var params={"username":this.screen_name,"page":-1};this.call("twitter","twitter_followers",params,this.twitterFollowersSuccess.bind(this),null);this.loader.showLoading();}},onHide:function(){},twitterFollowersSuccess:function(data){this.loader.hideLoading();if(!$defined(data.users)||data.users.length==0){return;}this.nextCursor=data.next_cursor;data.users.each(function(item){this.loader.process(item);},this);this.bottomFuncCalled=false;},bottomFunc:function(){var params={"username":this.screen_name,"page":this.nextCursor};this.call("twitter","twitter_followers",params,this.twitterFollowersSuccess.bind(this),null);},twitterFollow:function(screen_name){var params={screen_name:screen_name};this.call("twitter","twitter_follow",params,this.twitterFollowSuccess.bind(this),null);},twitterFollowSuccess:function(data){if(!$defined(data)){return;}},twitterUnfollow:function(screen_name){var params={screen_name:screen_name};this.call("twitter","twitter_unfollow",params,this.twitterUnfollowSuccess.bind(this),null);},twitterUnfollowSuccess:function(data){if(!$defined(data)){return;}this.loader.remove(data.id);},twitterBlock:function(screen_name){var answer=confirm("Blocking will prevent this user from following you. And you won't see their tweets in your timeline. Are you sure you want to block?");if(!answer){return;}var params={screen_name:screen_name};this.call("twitter","twitter_block",params,this.twitterBlockSuccess.bind(this),null);},twitterBlockSuccess:function(data){if(!$defined(data)){return;}this.loader.remove(data.id);}});var TwitterFollowingContent=new Class({Extends:Content,EventHandlers:["twitterFollow","twitterUnfollow","twitterBlock"],onBeforeInit:function(options){this.screen_name=options.screen_name;},onInit:function(){this.loader=new ItemLoader({idField:"id",sortField:"name",createElementFunc:TwitterFollowsItemUtility.createTwitterFollowItem,emptyEl:new Element("div",{"class":"post empty","text":this.screen_name+" has no friends"}),loadingEl:new Element("div",{"class":"post empty","text":this.screen_name+"'s friends loading..."})});$(this.loader).inject(this.content);},onShow:function(first){if(first){var params={"username":this.screen_name,"page":-1};this.call("twitter","twitter_friends",params,this.twitterFollowingSuccess.bind(this),null);this.loader.showLoading();}},onHide:function(){},twitterFollowingSuccess:function(data){this.loader.hideLoading();if(!$defined(data.users)||data.users.length==0){return;}this.nextCursor=data.next_cursor;data.users.each(function(item){this.loader.process(item);},this);this.bottomFuncCalled=false;},bottomFunc:function(){var params={"username":this.screen_name,"page":this.nextCursor};this.call("twitter","twitter_friends",params,this.twitterFollowingSuccess.bind(this),null);},twitterUnfollow:function(screen_name){var params={screen_name:screen_name};this.call("twitter","twitter_unfollow",params,this.twitterUnfollowSuccess.bind(this),null);},twitterUnfollowSuccess:function(data){if(!$defined(data)){return;}this.loader.remove(data.id);},twitterBlock:function(screen_name){var answer=confirm("Blocking will prevent this user from following you. And you won't see their tweets in your timeline. Are you sure you want to block?");if(!answer){return;}var params={screen_name:screen_name};this.call("twitter","twitter_block",params,this.twitterBlockSuccess.bind(this),null);},twitterBlockSuccess:function(data){if(!$defined(data)){return;}this.loader.remove(data.id);}});var TwitterHomeContent=new Class({Extends:Content,EventHandlers:["twitterUserLoaded","twitterHomeReload"],onBeforeInit:function(options){this.settings=options.settings;this.navId=options.navId;this.sessionTimestamp=(new Date().getTime())/1000;this.screen_name=options.settings.screen_name;return options;},onInit:function(){this.slowTimerDuration=60*1000*3;this.fastTimerDuration=60*1000*1;this.loader=new StreamLoader({idField:"id",dateField:"created_at",createElementFunc:TwitterItemUtility.createTwitterItem,emptyEl:new Element("div",{"class":"post empty","text":"You have no updates"}),alertFunc:this.alertCheck.bind(this)});$(this.loader).inject(this.content);},alertCheck:function(item){var ts=Date.parse(item.created_at)/1000;if(ts>this.sessionTimestamp){this.fireEvent("alertAdd",this.navId);}},onShow:function(first){if(first){this.loadMore();}this.updatePoll();},onHide:function(){this.updatePoll();},onDestroy:function(){$clear(this.pollTimer);},twitterHomeReload:function(){this.loadNew();},twitterUserLoaded:function(user){if($defined(this.statusBox)){return;}this.statusBox=new TwitterStatusBox(user,true);$(this.statusBox).inject(this.content,"top");},updatePoll:function(){if($defined(this.pollTimer)){$clear(this.pollTimer);}if(this.isOn){this.pollTimer=this.loadNew.periodical(this.fastTimerDuration,this);Logger().log("home on fast timer");}else{this.pollTimer=this.loadNew.periodical(this.slowTimerDuration,this);Logger().log("home on slow timer");}},loadNew:function(){var params={since_id:this.loader.newestId};this.call("twitter","twitter_home_timeline",params,this.loadNewSuccess.bind(this),this.loadMoreFail.bind(this));},loadMore:function(){var params={since_id:""};if(this.loader.oldestId!=0){params.max_id=this.loader.oldestId;}this.call("twitter","twitter_home_timeline",params,this.loadMoreSuccess.bind(this),this.loadMoreFail.bind(this));},loadNewSuccess:function(data){if(!$defined(data.items)||data.items.length==0){return;}data.items.each(function(item){this.loader.process(item);},this);},loadMoreSuccess:function(data){if(!$defined(data.items)||data.items.length==0){this.atBottom=true;return;}data.items.reverse().each(function(item){this.loader.process(item);},this);this.bottomFuncCalled=false;},loadMoreFail:function(status){},bottomFunc:function(){this.loadMore();}});var TwitterListContent=new Class({Extends:Content,EventHandlers:[],onBeforeInit:function(options){this.list=options.list;this.navId=options.navId;this.sessionTimestamp=(new Date().getTime())/1000;return options;},onInit:function(){this.slowTimerDuration=60*1000*5;this.fastTimerDuration=60*1000*2;this.loader=new StreamLoader({idField:"id",dateField:"created_at",createElementFunc:TwitterItemUtility.createTwitterItem,emptyEl:new Element("div",{"class":"post empty","text":"This list has no updates"}),loadingEl:new Element("div",{"class":"post empty","text":"Updates loading..."}),alertFunc:this.alertCheck.bind(this)});$(this.loader).inject(this.content);},alertCheck:function(item){var ts=Date.parse(item.created_at)/1000;if(ts>this.sessionTimestamp){this.fireEvent("alertAdd",this.navId);}},onShow:function(first){if(first){this.loadMore();}this.updatePoll();},onHide:function(){this.updatePoll();},onDestroy:function(){$clear(this.pollTimer);},updatePoll:function(){if($defined(this.pollTimer)){$clear(this.pollTimer);}if(this.isOn){this.pollTimer=this.loadNew.periodical(this.fastTimerDuration,this);}else{this.pollTimer=this.loadNew.periodical(this.slowTimerDuration,this);}},loadNew:function(){var params={screen_name:this.list.user.screen_name,list_id:this.list.id,since_id:this.loader.newestId};this.call("twitter","twitter_lists_timeline",params,this.loadNewSuccess.bind(this),this.loadMoreFail.bind(this));},loadMore:function(){var params={screen_name:this.list.user.screen_name,list_id:this.list.id,since_id:""};if(this.loader.oldestId!=0){params.max_id=this.loader.oldestId;}this.call("twitter","twitter_lists_timeline",params,this.loadMoreSuccess.bind(this),this.loadMoreFail.bind(this));this.loader.showLoading();},loadNewSuccess:function(data){if(!$defined(data.items)||data.items.length==0){return;}data.items.reverse().each(function(item){this.loader.process(item);},this);},loadMoreSuccess:function(data){this.loader.hideLoading();if(!$defined(data.items)||data.items.length==0){this.atBottom=true;return;}data.items.each(function(item){this.loader.process(item);},this);this.bottomFuncCalled=false;},loadMoreFail:function(status){this.loader.hideLoading();},bottomFunc:function(){this.loadMore();}});var TwitterMentionsContent=new Class({Extends:Content,EventHandlers:[],onBeforeInit:function(options){this.settings=options.settings;this.navId=options.navId;this.screen_name=options.screen_name;this.sessionTimestamp=(new Date().getTime())/1000;return options;},onInit:function(){this.slowTimerDuration=60*1000*5;this.fastTimerDuration=60*1000*2;this.loader=new StreamLoader({idField:"id",dateField:"created_at",createElementFunc:TwitterItemUtility.createTwitterItem,emptyEl:new Element("div",{"class":"post empty","text":"You have no mentions"}),loadingEl:new Element("div",{"class":"post empty","text":"Mentions loading..."}),alertFunc:this.alertCheck.bind(this)});$(this.loader).inject(this.content);},alertCheck:function(item){var ts=Date.parse(item.created_at)/1000;if(ts>this.sessionTimestamp){this.fireEvent("alertAdd",this.navId);}},onShow:function(first){if(first){this.loadMore();}this.updatePoll();},onHide:function(){this.updatePoll();},onDestroy:function(){$clear(this.pollTimer);},updatePoll:function(){if($defined(this.pollTimer)){$clear(this.pollTimer);}if(this.isOn){this.pollTimer=this.loadNew.periodical(this.fastTimerDuration,this);}else{this.pollTimer=this.loadNew.periodical(this.slowTimerDuration,this);}},loadNew:function(){var params={since_id:this.loader.newestId};this.call("twitter","twitter_mentions",params,this.loadNewSuccess.bind(this),this.loadMoreFail.bind(this));},loadMore:function(){var params={since_id:""};if(this.loader.oldestId!=0){params.max_id=this.loader.oldestId;}this.call("twitter","twitter_mentions",params,this.loadMoreSuccess.bind(this),this.loadMoreFail.bind(this));this.loader.showLoading();},loadNewSuccess:function(data){if(!$defined(data.items)||data.items.length==0){return;}data.items.each(function(item){this.loader.process(item);},this);},loadMoreSuccess:function(data){this.loader.hideLoading();if(!$defined(data.items)||data.items.length==0){this.atBottom=true;return;}data.items.reverse().each(function(item){this.loader.process(item);},this);this.bottomFuncCalled=false;},loadMoreFail:function(status){this.loader.hideLoading();},bottomFunc:function(){this.loadMore();}});var TwitterSearchContent=new Class({Extends:Content,EventHandlers:[],onBeforeInit:function(options){this.search=options.search;this.navId=options.navId;this.sessionTimestamp=(new Date().getTime())/1000;return options;},onInit:function(){this.slowTimerDuration=60*1000*2;this.fastTimerDuration=30*1000;this.loader=new StreamLoader({idField:"id",dateField:"created_at",createElementFunc:TwitterItemUtility.createTwitterSearchItem,emptyEl:new Element("div",{"class":"post empty","text":"No search results"}),loadingEl:new Element("div",{"class":"post empty","text":"Search results loading..."}),alertFunc:this.alertCheck.bind(this)});$(this.loader).inject(this.content);this.page=1;},alertCheck:function(item){var ts=Date.parse(item.created_at)/1000;if(ts>this.sessionTimestamp){this.fireEvent("alertAdd",this.navId);}},onShow:function(first){if(first){this.loadMore();}this.updatePoll();},onHide:function(){this.updatePoll();},onDestroy:function(){$clear(this.pollTimer);},updatePoll:function(){if($defined(this.pollTimer)){$clear(this.pollTimer);}if(this.isOn){this.pollTimer=this.loadNew.periodical(this.fastTimerDuration,this);}else{this.pollTimer=this.loadNew.periodical(this.slowTimerDuration,this);}},loadNew:function(){var params={since_id:this.loader.newestId,q:this.search.query};this.call("twitter","twitter_search",params,this.loadNewSuccess.bind(this),this.loadMoreFail.bind(this));},loadMore:function(){var params={since_id:"",q:this.search.query};if(this.loader.oldestId!=0){params.page=this.page++;}this.call("twitter","twitter_search",params,this.loadMoreSuccess.bind(this),this.loadMoreFail.bind(this));this.loader.showLoading();},loadNewSuccess:function(data){if(!$defined(data.items)||data.items.length==0){return;}data.items.reverse().each(function(item){this.loader.process(item);},this);},loadMoreSuccess:function(data){this.loader.hideLoading();if(!$defined(data.items)||data.items.length==0){this.atBottom=true;return;}data.items.each(function(item){this.loader.process(item);},this);this.bottomFuncCalled=false;},loadMoreFail:function(status){this.loader.hideLoading();},bottomFunc:function(){this.loadMore();}});var TwitterUserContent=new Class({Extends:Content,EventHandlers:["twitterUserLoaded"],onBeforeInit:function(options){this.navId=options.navId;this.screen_name=options.screen_name;this.sessionTimestamp=(new Date().getTime())/1000;},onInit:function(){this.slowTimerDuration=60*1000*5;this.fastTimerDuration=60*1000*2;this.loader=new StreamLoader({idField:"id",dateField:"created_at",createElementFunc:TwitterItemUtility.createTwitterItem,emptyEl:new Element("div",{"class":"post empty","text":TextUtility.unescape(this.screen_name)+" has no updates"}),loadingEl:new Element("div",{"class":"post empty","text":TextUtility.unescape(this.screen_name)+"'s updates loading..."}),alertFunc:this.alertCheck.bind(this)});$(this.loader).inject(this.content);},alertCheck:function(item){var ts=Date.parse(item.created_at)/1000;if(ts>this.sessionTimestamp){this.fireEvent("alertAdd",this.navId);}},onShow:function(first){if(first){this.loadMore();}this.updatePoll();},onHide:function(){this.updatePoll();},onDestroy:function(){$clear(this.pollTimer);},twitterUserLoaded:function(user){if($defined(this.statusBox)){return;}this.statusBox=new TwitterStatusBox(user,false);$(this.statusBox).inject(this.content,"top");},updatePoll:function(){if($defined(this.pollTimer)){$clear(this.pollTimer);}if(this.isOn){this.pollTimer=this.loadNew.periodical(this.fastTimerDuration,this);}else{this.pollTimer=this.loadNew.periodical(this.slowTimerDuration,this);}},loadNew:function(){var params={username:this.screen_name,since_id:this.loader.newestId};this.call("twitter","twitter_user_timeline",params,this.loadNewSuccess.bind(this),this.loadMoreFail.bind(this));},loadMore:function(){var params={username:this.screen_name,since_id:""};if(this.loader.oldestId!=0){params.max_id=this.loader.oldestId;}this.call("twitter","twitter_user_timeline",params,this.loadMoreSuccess.bind(this),this.loadMoreFail.bind(this));this.loader.showLoading();},loadNewSuccess:function(data){if(!$defined(data.items)||data.items.length==0){return;}data.items.each(function(item){this.loader.process(item);},this);},loadMoreSuccess:function(data){this.loader.hideLoading();if(!$defined(data.items)||data.items.length==0){this.atBottom=true;return;}data.items.reverse().each(function(item){this.loader.process(item);},this);this.bottomFuncCalled=false;},loadMoreFail:function(status){this.loader.hideLoading();},bottomFunc:function(){this.loadMore();}});var TwitterListMenu=new Class({Extends:Menu,EventHandlers:[],onBeforeInit:function(options){this.list=options.list;options.displayName=this.list.user.screen_name+"/"+this.list.slug;options.className="twitter";return options;},onInit:function(){this.userShowSuccess(this.list.user);},userShowSuccess:function(data){if(!$defined(data)){return;}this.profile=new Element("div",{"class":"user_profile"}).inject(this.menu);ItemUtility.createItemPic(data.profile_image_url).inject(this.profile);new Element("div",{"class":"screen_name text12 light","text":data.screen_name}).inject(this.profile);new Element("div",{"class":"tweets text11 light2","text":data.statuses_count+" tweets"}).inject(this.profile);new Element("div",{"class":"text_section light1 text11 nowrap"}).adopt(new Element("span",{"class":"bold","text":"Name: "}),new Element("span",{"text":TextUtility.unescape(data.name)})).inject(this.menu);if($defined(data.location)&&data.location!=""){new Element("div",{"class":"text_section light1 text11 nowrap"}).adopt(new Element("span",{"class":"bold","text":"Location: "}),new Element("span",{"text":TextUtility.unescape(data.location)})).inject(this.menu);}if($defined(data.url)&&data.url!=""){new Element("div",{"class":"text_section light1 text11 nowrap"}).adopt(new Element("span",{"class":"bold","text":"Web: "}),new Element("a",{"target":"_blank","href":data.url,"text":data.url})).inject(this.menu);}if($defined(data.description)&&data.description!=""){new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Bio: "}),new Element("span",{"text":TextUtility.unescape(data.description)})).inject(this.menu);}new Element("div",{"class":"nav_seperator"}).inject(this.menu);this.follow=new Toggle(this.list.following);$(this.follow).addEvent("click",this.followToggle.bind(this));new Element("div",{"class":"toggle_section"}).adopt(new Element("div",{"class":"text light","text":"Following list:"}),$(this.follow)).inject(this.menu);},followToggle:function(){if(this.follow.isOn){this.call("twitter","twitter_lists_subscribe",{screen_name:this.list.user.screen_name,list_id:this.list.id},this.subscribeSuccess.bind(this));}else{this.call("twitter","twitter_lists_unsubscribe",{screen_name:this.list.user.screen_name,list_id:this.list.id},this.unsubscribeSuccess.bind(this));}},subscribeSuccess:function(data){if(!$defined(data.list)){return;}this.fireEvent("twitterListSubscribed",this.list);},unsubscribeSuccess:function(data){if(!$defined(data.list)){return;}this.fireEvent("twitterListUnsubscribed",this.list);}});var TwitterSearchMenu=new Class({Extends:Menu,EventHandlers:["twitterSavedSearchAdd","twitterSavedSearchDelete"],onBeforeInit:function(options){this.search=options.search;this.searches=options.searches;options.displayName=this.search.query;options.className="twitter";return options;},onInit:function(){new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Query: "}),new Element("span",{"text":TextUtility.unescape(this.search.query)})).inject(this.menu);new Element("div",{"class":"nav_seperator"}).inject(this.menu);this.saved=new Toggle(this.search.id!=0);$(this.saved).addEvent("click",this.saveToggle.bind(this));new Element("div",{"class":"toggle_section"}).adopt(new Element("div",{"class":"text light","text":"Save Search:"}),$(this.saved)).inject(this.menu);this.searchButton=new ButtonMedium({displayName:"Search Twitter",className:"dark",action:"search"});$(this.searchButton).addEvent("click",this.fireEvent.bind(this,["showTwitterSearchPopup"]));this.searchSection=new Element("div",{"class":"button_section"}).adopt($(this.searchButton)).inject(this.menu);this.savedSearchesNav=new TwitterSavedSearchesNav({});$(this.savedSearchesNav).inject(this.menu);this.searches.each(function(search){this.twitterSavedSearchAdd(search);},this);},twitterSavedSearchAdd:function(search){this.savedSearchesNav.savedSearchAdd(search);},twitterSavedSearchDelete:function(id){this.savedSearchesNav.savedSearchDelete(id);},saveToggle:function(){if(this.saved.isOn){this.searchSave();}else{this.searchDelete();}},searchSave:function(){this.call("twitter","twitter_searches_create",{query:this.search.query},this.searchSaveSuccess.bind(this));},searchSaveSuccess:function(data){if(!$defined(data.id)){return;}var search={query:data.query,id:data.id};this.search.id=data.id;this.fireEvent("twitterSavedSearchAdd",search);},searchDelete:function(){this.call("twitter","twitter_searches_delete",{id:this.search.id},this.searchDeleteSuccess.bind(this));},searchDeleteSuccess:function(data){if(!$defined(data.id)){return;}this.search.id=0;this.fireEvent("twitterSavedSearchDelete",data.id);}});var TwitterSelfMenu=new Class({Extends:Menu,EventHandlers:["twitterSavedSearchAdd","twitterSavedSearchDelete"],onBeforeInit:function(options){this.settings=options.settings;this.screen_name=this.settings.screen_name;this.sync_posts=this.settings.sync_posts;options.displayName=this.settings.screen_name;options.className="twitter";return options;},onInit:function(){this.call("twitter","twitter_self_show",{screen_name:this.settings.screen_name},this.userShowSuccess.bind(this),null);},userShowSuccess:function(data){if(!$defined(data.user)){return;}var user=data.user;this.profile=new Element("div",{"class":"user_profile"}).inject(this.menu);ItemUtility.createItemPic(user.profile_image_url).inject(this.profile);new Element("div",{"class":"screen_name text12 light","text":user.screen_name}).inject(this.profile);new Element("div",{"class":"tweets text11 light2","text":user.statuses_count+" tweets"}).inject(this.profile);new Element("div",{"class":"text_section light1 text11 nowrap"}).adopt(new Element("span",{"class":"bold","text":"Name: "}),new Element("span",{"text":TextUtility.unescape(user.name)})).inject(this.menu);if($defined(user.location)&&user.location!=""){new Element("div",{"class":"text_section light1 text11 nowrap"}).adopt(new Element("span",{"class":"bold","text":"Location: "}),new Element("span",{"text":TextUtility.unescape(user.location)})).inject(this.menu);}if($defined(user.url)&&user.url!=""){new Element("div",{"class":"text_section light1 text11 nowrap"}).adopt(new Element("span",{"class":"bold","text":"Web: "}),new Element("a",{"target":"_blank","href":user.url,"text":user.url})).inject(this.menu);}if($defined(user.description)&&user.description!=""){new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Bio: "}),new Element("span",{"text":TextUtility.unescape(user.description)})).inject(this.menu);}var followers=new Element("span",{"class":"clickable","text":user.followers_count});followers.addEvent("click",pipio.dispatchEvent.bind(pipio,["twitterShowFollowers",user.screen_name]));new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Followers: "}),followers).inject(this.menu);var following=new Element("span",{"class":"clickable","text":user.friends_count});following.addEvent("click",pipio.dispatchEvent.bind(pipio,["twitterShowFollowing",user.screen_name]));new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Following: "}),following).inject(this.menu);new Element("div",{"class":"nav_seperator"}).inject(this.menu);this.syncPosts=new Toggle(this.sync_posts==1);$(this.syncPosts).addEvent("click",this.syncToggle.bind(this));new Element("div",{"class":"toggle_section"}).adopt(new Element("div",{"class":"text light","text":"Sync Posts:"}),$(this.syncPosts)).inject(this.menu);this.searchButton=new ButtonMedium({displayName:"Search Twitter",className:"dark",action:"search"});$(this.searchButton).addEvent("click",this.fireEvent.bind(this,["showTwitterSearchPopup"]));this.searchSection=new Element("div",{"class":"button_section"}).adopt($(this.searchButton)).inject(this.menu);this.savedSearchesNav=new TwitterSavedSearchesNav({});$(this.savedSearchesNav).inject(this.menu);this.fireEvent("twitterUserLoaded",data.user);this.fireEvent("twitterListsLoaded",data);this.fireEvent("twitterSavedSearchesLoaded",data.saved_searches);data.saved_searches.each(function(search){this.twitterSavedSearchAdd(search);},this);},syncToggle:function(){var params={key:"sync_posts",value:this.syncPosts.toInt()};this.call("twitter","twitter_settings_update",params);},twitterSavedSearchAdd:function(search){this.savedSearchesNav.savedSearchAdd(search);},twitterSavedSearchDelete:function(id){this.savedSearchesNav.savedSearchDelete(id);}});var TwitterUserMenu=new Class({Extends:Menu,EventHandlers:[],onBeforeInit:function(options){this.user=options.user;options.displayName=this.user.screen_name;options.className="twitter";return options;},onInit:function(){this.userShowSuccess(this.user);},userShowSuccess:function(data){if(!$defined(data)){return;}this.fireEvent("twitterUserLoaded",data);this.profile=new Element("div",{"class":"user_profile"}).inject(this.menu);ItemUtility.createItemPic(data.profile_image_url).inject(this.profile);new Element("div",{"class":"screen_name text12 light","text":data.screen_name}).inject(this.profile);new Element("div",{"class":"tweets text11 light2","text":data.statuses_count+" tweets"}).inject(this.profile);new Element("div",{"class":"text_section light1 text11 nowrap"}).adopt(new Element("span",{"class":"bold","text":"Name: "}),new Element("span",{"text":TextUtility.unescape(data.name)})).inject(this.menu);if($defined(data.location)&&data.location!=""){new Element("div",{"class":"text_section light1 text11 nowrap"}).adopt(new Element("span",{"class":"bold","text":"Location: "}),new Element("span",{"text":TextUtility.unescape(data.location)})).inject(this.menu);}if($defined(data.url)&&data.url!=""){new Element("div",{"class":"text_section light1 text11 nowrap"}).adopt(new Element("span",{"class":"bold","text":"Web: "}),new Element("a",{"target":"_blank","href":data.url,"text":data.url})).inject(this.menu);}if($defined(data.description)&&data.description!=""){new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Bio: "}),new Element("span",{"text":TextUtility.unescape(data.description)})).inject(this.menu);}var followers=new Element("span",{"class":"clickable","text":data.followers_count});followers.addEvent("click",pipio.dispatchEvent.bind(pipio,["twitterShowFollowers",data.screen_name]));new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Followers: "}),followers).inject(this.menu);var following=new Element("span",{"class":"clickable","text":data.friends_count});following.addEvent("click",pipio.dispatchEvent.bind(pipio,["twitterShowFollowing",data.screen_name]));new Element("div",{"class":"text_section light1 text11"}).adopt(new Element("span",{"class":"bold","text":"Following: "}),following).inject(this.menu);new Element("div",{"class":"nav_seperator"}).inject(this.menu);this.follow=new Toggle(data.following);$(this.follow).addEvent("click",this.followToggle.bind(this));new Element("div",{"class":"toggle_section"}).adopt(new Element("div",{"class":"text light","text":"Following:"}),$(this.follow)).inject(this.menu);},followToggle:function(){if(this.follow.isOn){this.call("twitter","twitter_follow",{screen_name:this.user.screen_name});}else{this.call("twitter","twitter_unfollow",{screen_name:this.user.screen_name});}}});var TwitterSavedSearchesNav=new Class({Extends:Nav,onBeforeInit:function(options){options.name="savedSearches";options.hasSubnavs=true;options.iconOptions={iconName:"search"};options.displayName="Saved Searches";return options;},onInit:function(){this.savedSearches=$H();this.updateNav();},savedSearchAdd:function(search){if(this.hasSubnav(search.query)){return;}var nav=new Nav({displayName:search.query,name:search.id,parentName:"savedSearches",onClick:this.fireEvent.bind(this,["twitterSearch",search.query,search.id])});this.addSubnav(nav);this.savedSearches.set(search.id,search);this.updateNav();},savedSearchDelete:function(id){this.deleteSubnav(id);this.savedSearches.erase(id);this.updateNav();},updateNav:function(){if(this.savedSearches.getLength()==0){DomUtility.hide(this.navWrapper);}else{DomUtility.show(this.navWrapper);}}});var TwitterInstallPopupContent=new Class({Extends:PopupContent,EventHandlers:["twitterOauthAccess"],strings:{postSyncLabel:"Sync posts to Twitter:",errorMessage:"There was an error connecting to Twitter"},onInit:function(){this.appId=5;this.syncPostsToggle=new Toggle(true);new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"label light","text":this.strings.postSyncLabel}),$(this.syncPostsToggle)).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Install Twitter",className:"dark",action:"check"});this.message=new Element("div",{"class":"message error"});this.actions=new Element("div",{"class":"actions"}).adopt(this.message,$(this.actionButton),$(this.closeButton)).inject(this.content);this.authRequest();},authRequest:function(){this.call("twitter","twitter_auth_request",null,this.authRequestSuccess.bind(this));},authRequestSuccess:function(data){if(!$defined(data.authorize_url)){return;}new Element("a",{"href":data.authorize_url,"target":"_blank"}).wraps(this.actionButton);},twitterOauthAccess:function(data){if(data.oauth!="success"){return;}var params={sync_posts:this.syncPostsToggle.toInt()};this.call("twitter","twitter_install",params,this.twitterInstallSuccess.bind(this));},twitterInstallSuccess:function(){this.closeContent();}});var TwitterRetweetPopupContent=new Class({Extends:PopupContent,strings:{},EventHandlers:[],onBeforeInit:function(options){this.post_id=options.post_id;return options;},onInit:function(){this.searchInput=new Element("input",{"type":"text","maxlength":"50"});this.searchInput.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));this.searchInputSection=new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"textarea_wrapper"}).adopt(this.searchInput)).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Search",className:"dark",action:"search"});$(this.actionButton).addEvent("click",this.search.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.actionButton),$(this.closeButton)).inject(this.content);},inputKeyUp:function(e){if(e.key=="enter"){if(this.searchInput.value.trim()!=""){this.search();}}},search:function(){var query=this.searchInput.value.trim();if(query!=""){this.fireEvent("twitterSearch",query);}this.closeContent();},onShow:function(){this.focus();},focus:function(){this.searchInput.focus.delay(500,this.searchInput);}});var TwitterSearchPopupContent=new Class({Extends:PopupContent,strings:{},EventHandlers:[],onInit:function(){this.searchInput=new Element("input",{"type":"text","maxlength":"50"});this.searchInput.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));this.searchInputSection=new Element("div",{"class":"input_section"}).adopt(new Element("div",{"class":"textarea_wrapper"}).adopt(this.searchInput)).inject(this.content);this.closeButton=new ButtonMedium({displayName:"Cancel",className:"dark",action:"cross"});$(this.closeButton).addEvent("click",this.closeContent.bind(this));this.actionButton=new ButtonMedium({displayName:"Search",className:"dark",action:"search"});$(this.actionButton).addEvent("click",this.search.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.actionButton),$(this.closeButton)).inject(this.content);},inputKeyUp:function(e){if(e.key=="enter"){if(this.searchInput.value.trim()!=""){this.search();}}},search:function(){var query=this.searchInput.value.trim();if(query!=""){this.fireEvent("twitterSearch",query);}this.closeContent();},onShow:function(){this.focus();},focus:function(){this.searchInput.focus.delay(500,this.searchInput);}});var TwitterShareBox=new Class({Extends:Base,EventHandlers:["userSwitched","twitterShareBoxShow"],init:function(){this.shareboxes=$H();},userSwitched:function(){if(!this.isLoggedIn()){this.userLoggedOut();}},userLoggedOut:function(){this.shareboxes.each(function(sharebox,key){sharebox.close();this.shareboxes.erase(key);},this);this.shareboxes=$H();},twitterShareBoxShow:function(user,isSelf,post_id){if($defined(this.sharebox)){this.sharebox.close();}this.createShareBox(user,isSelf,post_id);},createShareBox:function(user,isSelf,post_id){this.sharebox=new Popup({size:{x:500,y:100},resizable:false,dockable:false,className:"facebook sharebox",onClose:this.destroyShareBox.bind(this)});var displayName=(isSelf)?"Tweet":"Mention "+user.screen_name;if($defined(post_id)){displayName="Reply to "+user.screen_name;}var nav=new Nav({iconOptions:{iconName:user.profile_image_url},displayName:displayName,closable:true});var content=new TwitterShareBoxPopupContent({user:user,is_self:isSelf,post_id:post_id});this.sharebox.addContent("sharebox",nav,content);},destroyShareBox:function(name){this.sharebox=null;}});var TwitterShareBoxPopupContent=new Class({Extends:PopupContent,onBeforeInit:function(options){this.user=options.user;options.displayName=this.user.screen_name;this.post_id=($defined(options.post_id))?options.post_id:"";this.isSelf=options.is_self;return options;},reset:function(){Logger().log("resetting");this.closeAttachmentPopup();this.content.empty();this.onInit();},onInit:function(){this.formEl=null;this.isPublic=true;this.readyToPost=false;if(this.isSelf){this.input=new Element("textarea",{"maxlength":140});}else{this.input=new Element("textarea",{"maxlength":140,"value":"@"+this.user.screen_name+" "});}this.input.addEvent("keyup",this.inputKeyUp.bindWithEvent(this));new Element("div",{"class":"textarea_wrapper"}).adopt(this.input).inject(this.content);this.cancelButton=new ButtonMedium({displayName:"Close",className:"dark",action:"cross"});$(this.cancelButton).addEvent("click",this.closeContent.bind(this));this.updateButton=new ButtonMedium({displayName:"Post",className:"dark",action:"check"});$(this.updateButton).addEvent("click",this.post.bind(this));this.actions=new Element("div",{"class":"actions"}).adopt($(this.updateButton),$(this.cancelButton)).inject(this.content);this.focus();},inputKeyUp:function(e){if(e.shift&&e.key=="enter"){e.preventDefault();this.post();}if(DomUtility.textareaAutoSize(e.target,40)){this.updateSize();}},updateSize:function(){h+=this.input.getSize().y+10;h+=this.actions.getSize().y+30;this.resizePopup(500,h);},post:function(){var body=this.input.value.trim();if(body==""&&this.attachment.type==AttachmentType.None){this.fireEvent("showAlert","empty_post","Problem Posting","Please enter some content to post.");return;}var params={"body":body,"post_id":this.post_id};this.call("twitter","twitter_post_text",params,this.postSuccess.bind(this),this.postFail.bind(this),this.formEl);this.updateButton.showProgress();},postSuccess:function(){this.updateButton.hideProgress();this.fireEvent("twitterHomeReload");this.closeContent();},postFail:function(){this.updateButton.hideProgress();},onShow:function(){this.focus();},focus:function(){this.input.focus.delay(500,this.input);}});var TwitterStatusBox=new Class({Extends:Base,EventHandlers:[],init:function(user,isSelf){this.user=user;this.user.status.can_delete=1;this.isSelf=isSelf;this.defaultStatus="has no current status";this.createStatusBox();},createStatusBox:function(){this.box=ItemUtility.createPostBubble("post status_message haspic");ItemUtility.createItemPic(this.user.profile_image_url).inject(this.box);var buttonText=this.isSelf?"Tweet":"Mention "+this.user.screen_name;this.writeButton=new Element("div",{"class":"button","text":TextUtility.unescape(buttonText)}).inject(this.box);this.writeButton.addEvent("click",this.fireEvent.bind(this,["twitterShareBoxShow",this.user,this.isSelf]));this.content=new Element("div",{"class":"post_content"}).inject(this.box);var header=new Element("div",{"class":"header"}).inject(this.content);var creator=new Element("span",{"class":"user_name","text":TextUtility.unescapeQuotes(this.user.name)}).inject(header);this.status=new Element("span",{"class":"status"}).inject(header);TwitterItemUtility.createTwitterItemFooter(this.user.status).inject(this.content);this.updateStatus();},updateStatus:function(){if($defined(this.user.status.text)&&this.user.status.text!=""){this.status.removeClass("empty");this.status.set("html"," "+TwitterItemUtility.parseTwitterUsernames(TwitterItemUtility.parseTwitterLists(TextUtility.replaceUrls(TextUtility.convertNewLine(TextUtility.unescapeQuotes(this.user.status.text))))));}else{this.status.addClass("empty");this.status.set("text"," "+TextUtility.unescape(this.defaultStatus));}},toElement:function(){return this.box;}});var TwitterFollowsItemUtility={createTwitterFollowItem:function(user){var el=ItemUtility.createPostBubble("post contact",true);new Element("img",{"class":"profile_pic_wrapper_60 afb_profile_pic","src":user.profile_image_url}).inject(el);var username=new Element("div",{"class":"user_name clickable","text":TextUtility.unescape(user.screen_name)});new Element("div",{"class":"heading"}).adopt(username).inject(el);username.addEvent("click",pipio.dispatchEvent.bind(pipio,["showTwitterUser",user.screen_name]));var viewButton=new ButtonMedium({displayName:"View "+user.screen_name,action:"goto dark"});$(viewButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["showTwitterUser",user.screen_name]));if(user.following){var unfollowButton=new ButtonMedium({displayName:"Unfollow "+user.screen_name,action:"cross"});$(unfollowButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["twitterUnfollow",user.screen_name]));}var blockButton=new ButtonMedium({displayName:"Block "+user.screen_name,action:"goto dark"});$(blockButton).addEvent("click",pipio.dispatchEvent.bind(pipio,["twitterBlock",user.screen_name]));var buttons=new Element("div",{"class":"actions"}).adopt($(viewButton),$(blockButton)).inject(el);if($defined(unfollowButton)){buttons.adopt($(unfollowButton));}return el;}};var TwitterItemUtility={createTwitterSearchItem:function(item){var el=ItemUtility.createPostBubble("post haspic");ItemUtility.createItemPic(item.profile_image_url).inject(el);var content=new Element("div",{"class":"post_content"}).inject(el);TwitterItemUtility.createTwitterSearchItemHeader(item).inject(content);TwitterItemUtility.createTwitterSearchItemFooter(item).inject(content);TwitterItemUtility.createTwitterItemPostActions(item).inject(el);return el;},createTwitterSearchItemHeader:function(item){var el=new Element("div",{"class":"header"});TwitterItemUtility.createSearchUsernameElement(item.from_user).inject(el);var body=new Element("span",{"html":" "+TwitterItemUtility.parseTwitterUsernames(TwitterItemUtility.parseTwitterLists(TextUtility.replaceUrls(TextUtility.convertNewLine(TextUtility.unescapeQuotes(item.text)))))}).inject(el);return el;},createSearchUsernameElement:function(screen_name){var el=new Element("span",{"class":"user_name clickable","text":TextUtility.unescapeQuotes(screen_name)});el.addEvent("click",pipio.dispatchEvent.bind(pipio,["showTwitterUser",screen_name]));return el;},createTwitterSearchItemFooter:function(item){var el=new Element("div",{"class":"footer"});var date=DateUtility.convertFromTimestamp(Date.parse(item.created_at)/1000);var ts=new Element("span",{"class":"timestamp","text":DateUtility.getTimestamp(date,"%B %D at %I:%M%p"),"ts":date,"ts_format":"%B %D at %I:%M%p"}).inject(el);el.appendText(" from ");new Element("span",{"html":TwitterItemUtility.parseTwitterSource(TextUtility.unescapeHtml(item.source))}).inject(el);if($defined(item.to_user)){el.appendText(" in reply to ");var userEl=new Element("span",{"text":item.to_user});new Element("span").adopt(userEl).inject(el);userEl.addEvent("click",pipio.dispatchEvent.bind(pipio,["showTwitterUser",item.to_user]));}var reply=TwitterItemUtility.createFooterAction("reply","Reply",true).inject(el);var user={screen_name:item.from_user,profile_image_url:item.profile_image_url};reply.addEvent("click",pipio.dispatchEvent.bind(pipio,["twitterShareBoxShow",user,false,item.id]));var retweet=TwitterItemUtility.createFooterAction("forward","Retweet",true).inject(el);retweet.addEvent("click",pipio.dispatchEvent.bind(pipio,["twitterRetweet",item.id]));return el;},deleteTwitterItem:function(id){$$(".twitter_item_"+id).each(function(el){DomUtility.fadeOutDestroy(el);});},createTwitterItem:function(item){var el=ItemUtility.createPostBubble("post haspic twitter_item_"+item.id);ItemUtility.createItemPic(item.user.profile_image_url).inject(el);var content=new Element("div",{"class":"post_content"}).inject(el);TwitterItemUtility.createTwitterItemHeader(item).inject(content);TwitterItemUtility.createTwitterItemFooter(item).inject(content);TwitterItemUtility.createTwitterItemPostActions(item).inject(el);return el;},createTwitterItemPostActions:function(item){var el=new Element("div",{"class":"post_actions"});if($defined(item.can_delete)&&item.can_delete==1){var deleteAction=new Element("div",{"class":"post_action delete"}).inject(el);deleteAction.addEvent("click",pipio.dispatchEvent.bind(pipio,["twitterDelete",item.id]));}return el;},createTwitterItemHeader:function(item){var el=new Element("div",{"class":"header"});TwitterItemUtility.createUsernameElement(item.user).inject(el);var body=new Element("span",{"html":" "+TwitterItemUtility.parseTwitterUsernames(TwitterItemUtility.parseTwitterLists(TextUtility.replaceUrls(TextUtility.convertNewLine(TextUtility.unescapeQuotes(item.text)))))}).inject(el);return el;},createUsernameElement:function(user){var el=new Element("span",{"class":"user_name clickable","text":TextUtility.unescapeQuotes(user.screen_name)});el.addEvent("click",pipio.dispatchEvent.bind(pipio,["showTwitterUser",user.screen_name]));return el;},createTwitterItemFooter:function(item){var el=new Element("div",{"class":"footer"});var date=DateUtility.convertFromTimestamp(Date.parse(item.created_at)/1000);var ts=new Element("span",{"class":"timestamp","text":DateUtility.getTimestamp(date,"%B %D at %I:%M%p"),"ts":date,"ts_format":"%B %D at %I:%M%p"}).inject(el);el.appendText(" from ");new Element("span",{"html":TwitterItemUtility.parseTwitterSource(item.source)}).inject(el);if($defined(item.in_reply_to_status_id)){el.appendText(" in reply to ");new Element("span").adopt(new Element("a",{"target":"_blank","href":"http://twitter.com/"+item.in_reply_to_screen_name+"/status/"+item.in_reply_to_status_id,"text":item.in_reply_to_screen_name})).inject(el);}var is_self=$defined(item.can_delete)&&item.can_delete==1;if(!is_self){var reply=TwitterItemUtility.createFooterAction("reply","Reply",true).inject(el);reply.addEvent("click",pipio.dispatchEvent.bind(pipio,["twitterShareBoxShow",item.user,is_self,item.id]));var retweet=TwitterItemUtility.createFooterAction("forward","Retweet",true).inject(el);retweet.addEvent("click",pipio.dispatchEvent.bind(pipio,["twitterRetweet",item.id]));}return el;},createFooterAction:function(actionName,actionText,hide){var el=new Element("span",{"class":"footer_action has_action"}).adopt(new Element("div",{"class":"action "+actionName}));el.appendText(actionText);if(hide){el.addClass("hide");}return el;},parseTwitterLists:function(content){if(!$defined(content)){return"";}content=content.replace(/([^A-Za-z0-9'>\/_-])@([A-Za-z0-9_-]+\/[A-Za-z0-9_-]+)/gi,"$1<a href=\"#\" onclick=\"pipio.dispatchEvent('showTwitterList', '$2');return false;\">@$2</a>");content=content.replace(/^(@[A-Za-z0-9'>\/_-]+\/[A-Za-z0-9_-]+)\s/gi,"<a href=\"#\" onclick=\"pipio.dispatchEvent('showTwitterList', '$1');return false;\">@$1</a> ");return content;},parseTwitterUsernames:function(content){if(!$defined(content)){return"";}content=content.replace(/([^A-Za-z0-9'>\/_-])@([A-Za-z0-9_-]+)/gi,"$1<a href=\"#\" onclick=\"pipio.dispatchEvent('showTwitterUser', '$2');return false;\">@$2</a>");content=content.replace(/^@([A-Za-z0-9'>\/_-]+)\s/gi,"<a href=\"#\" onclick=\"pipio.dispatchEvent('showTwitterUser', '$1');return false;\">@$1</a> ");return content;},replaceTwitterHashes:function(content){if(!$defined(content)){return"";}content=content.replace(/([^A-Za-z0-9'>\/_-])(#[A-Za-z0-9_-]+)/gi,"$1<a href=\"#\" onclick=\"pipio.dispatchEvent('twitterSearchShow', '$2');\">$2</a>");content=content.replace(/^(#[A-Za-z0-9'>\/_-]+)\s/gi,"<a href=\"#\" onclick=\"pipio.dispatchEvent('twitterSearchShow', '$1');\">$1</a> ");return content;},parseTwitterSource:function(source){if(!$defined(source)){return"";}return source.replace(/<a href/g,'<a target="_blank" href');},replaceTwitterSearchSource:function(source){if(!$defined(source)){return"";}source=DomUtility.unescapeHtml(source);return source.replace(/<a href/g,'<a target="_blank" href');}};var User=new Class({Extends:AppInstance,EventHandlers:["userInfoLoaded","userSwitched"],parseOptions:function(options){this.user=options.user;this.displayName=this.user.fullname;this.appId="user_"+this.user.username;this.iconOptions={user:this.user};},userSwitched:function(){this.stop();},onStart:function(){this.setupNav();},onStop:function(){}});User.implement({requests:[{name:"info_load",params:["username"],url:"api/user/info/load"}]});User.implement({setupNav:function(){this.hasRooms=false;Logger().log("home setup");this.navAdd(new Nav({iconOptions:{iconName:"updates"},displayName:"Updates",name:"updates",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"updates","user_menu"])}));this.navAdd(new Nav({iconOptions:{iconName:"star"},displayName:"Favorites",name:"likes",onClick:this.fireEvent.bind(this,["viewSwitch",this.appId,"likes","likes_menu"])}));var userMenu=new UserMenu({user:this.user,isDefault:true,closeFunc:this.stop.bind(this)});this.menuAdd("user_menu",userMenu);var content=new UserContent({isDefault:true,user:this.user});this.contentAdd("updates",content);var likesMenu=new LikesMenu({user:this.user});this.menuAdd("likes_menu",likesMenu);var likesContent=new LikesContent({user:this.user});this.contentAdd("likes",likesContent);},roomAdd:function(room){if(!this.hasRooms){this.navAdd(new Nav({iconOptions:{iconName:"rooms"},hasSubnavs:true,displayName:"Rooms",name:"rooms"}));this.hasRooms=true;}var nav=new Nav({iconOptions:{iconName:"rooms"},displayName:room.room_name,name:"room_"+room.username,parentName:"rooms",onClick:this.fireEvent.bind(this,["showRoom",room])});this.navAdd(nav);},userInfoLoaded:function(data){if(!$defined(data.user)||data.user.username!=this.user.username){return;}data.rooms.each(function(room){room=UserUtility.processRoom(room);this.roomAdd(room);},this);}});var UserConnectionMenuSection=new Class({Extends:Base,EventHandlers:["contactAdded","contactDeleted","contactRequestAdded","contactRequestDeleted","contactRequestOutAdded","contactRequestOutDeleted","streamSubscriptionAdded","streamSubscriptionDeleted"],init:function(options){this.user=options.user;this.subscribed=false;this.isSelf=this.user.user_id==this.getPrivateUser().user_id;this.createSection();},createSection:function(){this.wrapper=new Element("div");this.generateSection();},contactAdded:function(user){if(this.user.username!=user.username){return;}this.generateSection();},contactDeleted:function(username){if(this.user.username!=username){return;}this.generateSection();},contactRequestAdded:function(user){if(this.user.username!=user.username){return;}this.generateSection();},contactRequestDeleted:function(username){if(this.user.username!=username){return;}this.generateSection();},contactRequestOutAdded:function(user){if(this.user.username!=user.username){return;}this.generateSection();},contactRequestOutDeleted:function(username){if(this.user.username!=username){return;}this.generateSection();},generateSection:function(){this.wrapper.empty();if(this.isSelf){new Element("div",{"class":"text_section light centered text11","text":"This is you"}).inject(this.wrapper);}else{this.generateSubscriptionSection();var connectionState=this.getConnectionState(this.user.username);switch(connectionState){case 0:this.createNotConnectedSection();break;case 1:this.createConnectedSection();break;case 2:this.createRequestSection();break;case 3:this.createRequestOutSection();break;}}},setSubscription:function(subscribed){this.subscribed=subscribed;this.generateSection();},generateSubscriptionSection:function(){this.subscription=new Toggle(this.subscribed);$(this.subscription).addEvent("click",this.subscriptionToggle.bind(this));new Element("div",{"class":"toggle_section"}).adopt(new Element("div",{"class":"text light","text":"Subscribe:"}),$(this.subscription)).inject(this.wrapper);},subscriptionToggle:function(){if(this.subscribed){this.streamUnsubscribe();}else{this.streamSubscribe();}},streamUnsubscribe:function(){this.subscription.off();this.fireEvent("userUnsubscribe",this.user.username);},streamSubscribe:function(){this.subscription.on();this.call("contacts","user_subscribe",{username:this.user.username},null,this.streamSubscribeFail.bind(this));},streamSubscribeFail:function(status){if(status.code==2002){this.subscription.off();var name="subscription";var title="Error";var message=status.message;this.fireEvent("showAlert",name,title,message);}},streamSubscriptionAdded:function(data){if(!$defined(data.user)||data.user.username!=this.user.username){return;}this.subscribed=true;this.generateSection();},streamSubscriptionDeleted:function(data){if(!$defined(data.username)||data.username!=this.user.username){return;}this.subscribed=false;this.generateSection();},createNotConnectedSection:function(){this.connectButton=new ButtonMedium({displayName:"Add Contact",className:"dark",action:"check"});$(this.connectButton).addEvent("click",this.sendContactRequest.bind(this));new Element("div",{"class":"button_section"}).adopt($(this.connectButton)).inject(this.wrapper);},createConnectedSection:function(){new Element("div",{"class":"text_section light centered text11","text":TextUtility.unescape(this.user.first_name)+" is your contact"}).inject(this.wrapper);},createRequestOutSection:function(){new Element("div",{"class":"text_section light centered text11","text":"Contact request pending"}).inject(this.wrapper);},createRequestSection:function(){var button=new ButtonMedium({displayName:"Accept Request",className:"dark",action:"check"});$(button).addEvent("click",this.fireEvent.bind(this,["connectionRequestAccept",this.user.username]));new Element("div",{"class":"button_section"}).adopt($(button)).inject(this.wrapper);},toElement:function(){return this.wrapper;},sendContactRequest:function(){this.fireEvent("connectionRequestCreate",this.user.username);this.connectButton.showProgress();}});var UserContent=new Class({Extends:Content,EventHandlers:["streamItemReceived","userStreamItemDeleted"],onBeforeInit:function(options){this.user=options.user;},onInit:function(){this.statusBox=new StatusBox(this.user);$(this.statusBox).inject(this.content);this.loader=new StreamLoader({createElementFunc:StreamItemUtility.createUserStreamItem,emptyEl:new Element("div",{"class":"post empty","text":TextUtility.unescape(this.user.fullname)+" has no updates"}),loadingEl:new Element("div",{"class":"post empty","text":TextUtility.unescape(this.user.fullname)+"'s updates loading..."}),errorEl:new Element("div",{"class":"post empty","text":TextUtility.unescape(this.user.fullname)+"'s stream is private"})});$(this.loader).inject(this.content);},onShow:function(first){if(first){this.loadMore();}},onHide:function(){},streamItemReceived:function(data){if($defined(data.item)&&data.item.source.username==this.user.username&&data.item.is_public==1){this.loader.process(data.item);}},userStreamItemDeleted:function(data){if(!$defined(data.username)||data.username!=this.room.username){return;}this.loader.remove(data.item_id);},loadMore:function(){var params={username:this.user.username,date_created:this.loader.oldestTimestamp,item_id:this.loader.oldestId};if(this.isLoggedIn()){this.call("home","stream_user_load",params,this.loadMoreSuccess.bind(this),this.loadMoreFail.bind(this));}else{this.call("home","public_stream_user_load",params,this.loadMoreSuccess.bind(this),this.loadMoreFail.bind(this));}this.loader.showLoading();},loadMoreSuccess:function(data){this.loader.hideLoading();if(!$defined(data.items)||data.items.length==0){this.atBottom=true;return;}data.items.each(function(item){this.loader.process(item);},this);this.bottomFuncCalled=false;},loadMoreFail:function(status){if(status.code==2002){this.loader.showError();}},bottomFunc:function(){this.loadMore();}});var UserMenu=new Class({Extends:Menu,EventHandlers:["userSubscriberAdded","userSubscriberDeleted","userSubscriptionAdded","userSubscriptionDeleted"],onBeforeInit:function(options){this.user=options.user;options.displayName=this.user.fullname;return options;},onInit:function(){this.map=new UserMapMenuSection({user:this.user});$(this.map).inject(this.menu);this.aboutSection=new UserProfileMenuSection({user:this.user});$(this.aboutSection).inject(this.menu);if(this.isLoggedIn()){this.connect=new UserConnectionMenuSection({user:this.user});$(this.connect).inject(this.menu);}new Element("div",{"class":"nav_seperator"}).inject(this.menu);this.subscriptions=new SubscriptionsNav({user:this.user});$(this.subscriptions).inject(this.menu);this.subscribers=new SubscribersNav({user:this.user});$(this.subscribers).inject(this.menu);},onShow:function(first){if(first){this.userInfoLoad();}},userInfoLoad:function(){if(this.isLoggedIn()){this.call("user","info_load",{username:this.user.username},this.userInfoLoadSuccess.bind(this),null);}else{this.call("home","public_user_info_load",{username:this.user.username},this.userInfoLoadSuccess.bind(this),null);}},userInfoLoadSuccess:function(data){if(!$defined(data.user)){return;}this.fireEvent("userInfoLoaded",data);Logger().log("processing user");var user=UserUtility.processUser(data.user);this.subscribers.addUsers(data.subscribers);this.subscriptions.addUsers(data.subscriptions);var subscribed=(data.subscription_id!=0);this.connect.setSubscription(subscribed);},userSubscriberAdded:function(data){if(!$defined(data.source_username)||!$defined(data.user)||data.source_username!=this.user.username){return;}this.subscribers.addUsers(data.user);},userSubscriberDeleted:function(data){if(!$defined(data.source_username)||!$defined(data.username)||data.source_username!=this.user.username){return;}this.subscribers.removeUser(data.username);},userSubscriptionAdded:function(data){if(!$defined(data.subscriber)||!$defined(data.user)||data.subscriber!=this.user.username){return;}this.subscriptions.addUsers(data.user);},userSubscriptionDeleted:function(data){if(!$defined(data.subscriber)||!$defined(data.username)||data.subscriber!=this.user.username){return;}this.subscriptions.removeUser(data.username);}});var UserProfileMenuSection=new Class({Extends:Base,EventHandlers:["userProfileUpdated"],init:function(options){this.user=options.user;this.isSelf=this.user.user_id==this.getPrivateUser().user_id;this.createSection();},createSection:function(){this.wrapper=new Element("div");this.bioText=new Element("span");this.bioSection=new Element("div",{"class":"text_section light1 text11 edit_option"}).adopt(new Element("span",{"class":"bold","text":"Bio: "}),this.bioText).inject(this.wrapper);this.interestsText=new Element("span");this.interestsSection=new Element("div",{"class":"text_section light1 text11 edit_option"}).adopt(new Element("span",{"class":"bold","text":"Interests: "}),this.interestsText).inject(this.wrapper);this.urlText=new Element("a",{"target":"_blank"});this.urlSection=new Element("div",{"class":"text_section light1 text11 nowrap edit_option"}).adopt(new Element("span",{"class":"bold","text":"Web: "}),this.urlText).inject(this.wrapper);this.userProfileUpdated(this.user.username,this.getProfile(this.user.username));},userProfileUpdated:function(username,about){if(username!=this.user.username){return;}if(!$defined(about)){DomUtility.hide(this.bioSection);DomUtility.hide(this.urlSection);DomUtility.hide(this.interestsSection);return;}if(!$defined(about.bio)||about.bio==""){DomUtility.hide(this.bioSection);}else{this.bioText.set("text",TextUtility.unescape(about.bio));DomUtility.show(this.bioSection);}if(!$defined(about.interests)||about.interests==""){DomUtility.hide(this.interestsSection);}else{this.interestsText.set("text",TextUtility.unescape(about.interests));DomUtility.show(this.interestsSection);}if(!$defined(about.url)||about.url==""){DomUtility.hide(this.urlSection);}else{this.urlText.set("text",TextUtility.unescape(about.url));this.urlText.set("href",about.url);DomUtility.show(this.urlSection);}},toElement:function(){return this.wrapper;}});var UserSubscribersContent=new Class({Extends:Content,EventHandlers:["userSubscriberAdded","userSubscriberDeleted"],onBeforeInit:function(options){this.user=options.user;return options;},onInit:function(){this.statusBox=new StatusBox(this.user);$(this.statusBox).inject(this.content);StreamItemUtility.createSeperatorItem("Subscribers").inject(this.content);this.loader=new ItemLoader({idField:"user_id",sortField:"date_created",sortAscending:false,createElementFunc:ContactItemUtility.createRoomSubscriberItem,emptyEl:new Element("div",{"class":"post empty","text":"This user has no subscribers"}),loadingEl:new Element("div",{"class":"post empty","text":"User subscribers loading..."})});$(this.loader).inject(this.content);},onShow:function(first){if(first){this.loadMore();}},onHide:function(){},userSubscriberAdded:function(data){if(!$defined(data.source_username)||!$defined(data.user)||data.source_username!=this.user.username){return;}var user=UserUtility.processUser(data.user);user.date_created=new Date().getTime()/1000;this.loader.process(user);},userSubscriberDeleted:function(data){if(!$defined(data.source_username)||!$defined(data.username)||data.source_username!=this.user.username){return;}if(!$defined(this.getUser(data.username))){return;}var user=this.getUser(data.username);this.loader.remove(user.user_id);},loadMore:function(){var params={username:this.room.username,date_created:this.loader.lowestSortValue};this.call("pipio","room_subscribers",params,this.loadMoreSuccess.bind(this),null);this.loader.showLoading();},loadMoreSuccess:function(data){this.loader.hideLoading();if(!$defined(data.subscribers)||data.subscribers.length==0){this.atBottom=true;return;}data.subscribers.each(function(user){var user_copy=UserUtility.processUser(user);user_copy.date_created=user.date_created;this.loader.process(user_copy);},this);this.bottomFuncCalled=false;},bottomFunc:function(){this.loadMore();}});var Pipio=new Class({Implements:Events,initialize:function(){this.version=pipio_version;this.versionTimer=0;this.initApi();this.initVideo();this.registerApis();this.eventHandlers=new Hash();this.pageTitle="Pip.io";this.loggedIn=false;window.addEvent("domready",this.initCore.bind(this));this.registerHandler("userDataInit",this.userDataInit.bind(this));this.registerHandler("videoChatEnable",this.videoChatEnable.bind(this));this.registerHandler("videoInUse",this.videoChatInUse.bind(this));this.registerHandler("startApp",this.startApp.bind(this));this.registerHandler("startAppInstance",this.startAppInstance.bind(this));this.registerHandler("appInstalled",this.appInstalled.bind(this));this.registerHandler("appUninstalled",this.appUninstalled.bind(this));},initCore:function(){this.xmpp=new Xmpp();this.initProfiles();this.initConnections();this.initConnectionEventHandlers();this.initModules();this.initApps();this.setSessionTimestamp();this.userDataInit();this.checkCookie();},checkCookie:function(){var destination=DataUtility.getCookie("destination");if(destination!="room"&&destination!="user"){return;}var userval=DataUtility.getCookie("user");var user=JSON.decode(userval);if($defined(user)){if(destination=="user"){user=UserUtility.processUser(user);this.dispatchEvent("showUser",user);}else{user=UserUtility.processRoom(user);this.dispatchEvent("showRoom",user);}}},initModules:function(){this.modules=new Pipio.modules(this);},initApps:function(){this.apps=new Pipio.apps(this);},setSessionTimestamp:function(){this.sessionTimestamp=new Date();},checkTimestamp:function(time){return time>this.sessionTimestamp.getTime()/1000;},userDataInit:function(data){if($defined(data)){user_data=data;}if(user_data.logged_in==1){this.userLoggedIn();}else{this.userLoggedOut();}},userLoggedIn:function(){this.initInstalledApps(user_data.apps);this.initProfiles();this.initLoggedInConnections();this.currentUser=UserUtility.processUser(user_data.user);this.currentUser.email=$defined(user_data.user.email)?user_data.user.email:undefined;this.loggedIn=true;if(!$defined(this.versionTimer)||this.versionTimer==0){$clear(this.versionTimer);}this.versionTimer=this.ping.periodical(1000*60*2,this);this.dispatchEvent("userSwitched");},userLoggedOut:function(){this.initInstalledApps();this.initProfiles();this.initLoggedOutConnections();this.currentUser={user_id:0};this.currentLocation=null;this.loggedIn=false;$clear(this.versionTimer);this.dispatchEvent("userSwitched");},isConnected:function(username){return this.connections.connsByUsername.has(username);},isRequestPending:function(user_id){return this.connections.requestsById.has(user_id)||this.connections.requestsOutById.has(user_id);},isLoggedIn:function(){return this.loggedIn;},dispatchEvent:function(){var eventName=arguments[0];var args=[];for(var i=1;i<arguments.length;i++){args.push(arguments[i]);}Logger().log("fired event "+eventName+" - "+args.join(","));this.fireEvent(eventName,args);},registerHandler:function(eventName,func){if(this.eventHandlers.has(eventName)){this.eventHandlers.get(eventName).push(func);this.addEvent(eventName,func);}else{this.eventHandlers.set(eventName,[func]);this.addEvent(eventName,func);}},getSession:function(){return this.xmpp.clientName;},ping:function(){this.call("pipio","ping",{},this.pong.bind(this));},pong:function(data){if(!$defined(data.v)){return;}if(this.version!=data.v){this.dispatchEvent("showPipioUpdatePopup",data.v);}}});Pipio.implement({initApi:function(){this.apiMethods=new Hash();},registerCall:function(app,call){var apiKey=app+"_"+call.name;this.apiMethods.set(apiKey,call);},call:function(app,name,params,callbackSuccess,callbackFail,form){var apiKey=app+"_"+name;if(!this.apiMethods.has(apiKey)){Logger().log("api call not found!");return;}var call=this.apiMethods.get(apiKey);var paramList=$defined(call.params)?call.params:[];var url=call.url;var method=$defined(call.method)?call.method:"post";var multipart=$defined(form);Logger().log("multipart "+multipart);var parsedParams=new Hash();paramList.each(function(paramName){parsedParams.set(paramName,params[paramName]);});if(!multipart){var req=new Request({method:method,url:url,onFailure:function(){var res={status:{code:6000,message:"request failed"}};if($defined(callbackFail)){callbackFail(res.status);}},onSuccess:function(response){var res=response;if(res.status==null){try{res=JSON.decode(response);}catch(err){res={status:{code:6000,message:"request failed"}};if($defined(callbackFail)){callbackFail(res.status);}}}if($defined(res)&&$defined(res.status)&&res.status.code==0){if($defined(callbackSuccess)){if($defined(res.data)){callbackSuccess(res.data);}else{callbackSuccess();}}}else{if(!$defined(res)||!$defined(res.status)){res={status:{code:6000,message:"request failed"}};}if($defined(callbackFail)){callbackFail(res.status);}}}});if(method=="post"){req.send(parsedParams.toQueryString());}else{req.send();}}else{var iframeId="postIframe"+$random(10000,99999);form.set("target",iframeId);form.set("action",url);form.set("method","post");form.set("enctype","multipart/form-data");parsedParams.each(function(val,name){new Element("input",{"type":"hidden","name":name,"value":val}).inject(form);},this);var iframe=new IFrame({"id":iframeId,"events":{load:function(){var response=window.frames[iframeId].document.body.innerHTML;if(response==""){return;}Logger().log(response);var res=JSON.decode(response);if($defined(res)&&$defined(res.status)&&res.status.code==0){if($defined(callbackSuccess)){if($defined(res.data)){callbackSuccess(res.data);}else{callbackSuccess();}}}else{if(!$defined(res)||!$defined(res.status)){res={status:{code:6000,message:"request failed"}};}if($defined(callbackSuccess)){callbackFail(res.status);}}}}});iframe.inject("hidden");form.submit();}}});Pipio.implement({moduleList:[{name:"ui",classRef:UI},{name:"login",classRef:Login},{name:"background",classRef:Background},{name:"chat",classRef:Chat},{name:"videochat",classRef:VideoChat},{name:"notifications",classRef:Notifications},{name:"sharebox",classRef:ShareBox},{name:"invite",classRef:Invite},{name:"settings",classRef:Settings},{name:"albumViewer",classRef:AlbumViewer},{name:"facebookSharebox",classRef:FacebookShareBox},{name:"twitterSharebox",classRef:TwitterShareBox},{name:"location",classRef:Location}],initModules:function(){this.modules=new Hash();this.moduleList.each(function(module){this.initModule(module.name,module.classRef);},this);},initModule:function(name,classRef){var o=new classRef();this.modules.set(name,o);}});Pipio.implement({initProfiles:function(){this.locationsByUsername=$H();this.profilesByUsername=$H();},locationUpdated:function(data){Logger().log("location updated called for "+data.username);if(!$defined(data.username)||!$defined(data.location_enabled)){return;}if($defined(this.getUser(data.username))){this.getUser(data.username).location_enabled=data.location_enabled;}if($defined(data.location)){this.locationsByUsername.set(data.username,data.location);}this.dispatchEvent("userLocationUpdated",data.username,data.location,data.location_enabled);},locationCleared:function(data){if(!$defined(data.username)){return;}this.locationsByUsername.erase(data.username);this.dispatchEvent("userLocationUpdated",data.username,null,0);},getLocation:function(username){if(this.locationsByUsername.has(username)){return this.locationsByUsername.get(username);}else{return null;}},profileUpdated:function(data){if(!$defined(data.username)||!$defined(data.about)){return;}this.profilesByUsername.set(data.username,data.about);if($defined(this.getUser(data.username))){this.dispatchEvent("userProfileUpdated",data.username,data.about);}else{if($defined(this.getRoom(data.username))){this.dispatchEvent("roomProfileUpdated",data.username,data.about);}}},getProfile:function(username){if(this.profilesByUsername.has(username)){return this.profilesByUsername.get(username);}else{return null;}}});Pipio.implement({initVideo:function(){this.videoEnabled=false;this.videoInUse=false;},videoChatEnable:function(enabled){this.videoEnabled=enabled;},videoChatInUse:function(inUse){if(!this.videoEnabled){return;}this.videoInUse=inUse;}});var Xmpp=new Class({Extends:Base,EventHandlers:["userSwitched","sendIM","sendTyping","sendVideoChatInvite","sendVideoChatAccept"],init:function(){this.newSession();this.domain="pip.io";this.userPresences=new Hash();this.roomsDomain="rooms.pip.io";this.multicastDomain="multicast.pip.io";this.pubsubDomain="pubsub.pip.io";var connArgs={httpbase:"/pipio-tubes",timerval:60*20};this.conn=new JSJaCHttpBindingConnection(connArgs);this.setupListeners();this.isConnecting=false;},userSwitched:function(){if(this.isLoggedIn()){this.userLoggedIn();}else{this.userLoggedOut();}},userLoggedIn:function(){this.newSession();this.fireEvent("xmppConnecting");this.connect.delay(1000,this);},userLoggedOut:function(){this.disconnect();},newSession:function(){this.sessionId=$random(1000,9999);this.clientName="pipio"+this.sessionId;},connect:function(){if(this.isConnecting){return;}if($defined(this.connectTimer)){$clear(this.connectTimer);}this.isConnecting=true;this.call("pipio","token_get",{},this.tokenGetSuccess.bind(this),this.tokenGetFail.bind(this));},disconnect:function(){this.isConnecting=false;this.updateSelfPresence("",false);this.conn.disconnect();this.fireEvent("xmppDisconnected");},tokenGetSuccess:function(data){Logger().log("xmpp token success - "+data.token+", connecting...");this.username=this.getPrivateUser().username;this.password=data.token;this.isConnecting=false;var args={domain:this.domain,username:this.username,resource:this.clientName,pass:this.password,register:false};this.conn.connect(args);},tokenGetFail:function(){this.isConnecting=false;this.connectTimer=this.connect.delay(10*1000,this);},updateSelfPresence:function(show,online){var pres=new JSJaCPresence();pres.setShow(show);var video=this.videoEnabled();if(video){pres.setPriority(10);}else{pres.setPriority(5);}if(online){pres.setType("");}else{pres.setType("unavailable");}var videoEnabled=(video)?1:0;var pip=pres.getDoc().createElementNS("http://pip.io/videochat","pip");pip.setAttribute("video",videoEnabled);pres.appendNode(pip);this.conn.send(pres);},userPresenceReceived:function(username,show,online,session,video){Logger().log(username+" "+show+" - "+session);var trueOnline=online;if(online){if(!this.userPresences.has(username)){this.userPresences.set(username,new Hash());}this.userPresences.get(username).set(session,video);}else{if(this.userPresences.has(username)){this.userPresences.get(username).erase(session);}if(this.userPresences.get(username).getLength()==0){this.userPresences.erase(username);}}if(this.userPresences.has(username)){trueOnline=true;}else{trueOnline=false;}Logger().log("firing "+username+" online-"+trueOnline+" show -"+show);this.fireEvent("userPresenceReceived",username,show,trueOnline);if(trueOnline){var videoEnabled=false;this.userPresences.get(username).each(function(videoExists){if(videoExists){videoEnabled=true;}});this.fireEvent("userVideoEnabled",username,videoEnabled);}},selfPresenceReceived:function(show,online){this.fireEvent("selfPresenceReceived",show,online);},sendVideoChatInvite:function(user){if(!$defined(user)){return;}if(!this.videoEnabled()){return;}var stratusId=sim.GetNearID();var userJID=new JSJaCJID(this.getJID(user));var aMsg=new JSJaCMessage();aMsg.setTo(userJID);aMsg.setBody(stratusId);aMsg.setType("videoChat");var success=this.conn.send(aMsg);this.fireEvent("videoInUse",true);this.fireEvent("selfPresenceUpdate");},sendVideoChatAccept:function(user){if(!$defined(user)){return;}if(!this.videoEnabled()){return;}var stratusId=sim.GetNearID();var userJID=new JSJaCJID(this.getJID(user));var aMsg=new JSJaCMessage();aMsg.setTo(userJID);aMsg.setBody(stratusId);aMsg.setType("videoChatAccept");var success=this.conn.send(aMsg);this.fireEvent("videoInUse",true);this.fireEvent("selfPresenceUpdate");},sendIM:function(user,msg){if(!$defined(user)||!$defined(msg)){return;}var userJID=new JSJaCJID(this.getJID(user));var aMsg=new JSJaCMessage();aMsg.setTo(userJID);aMsg.setBody(msg);aMsg.setType("chat");var success=this.conn.send(aMsg);if(success){var msg=this.buildMessage(user,true,msg,new Date());this.fireEvent("chatMsgReceived",msg);}},sendTyping:function(user){if(!$defined(user)){return;}var userJID=new JSJaCJID(this.getJID(user));var aMsg=new JSJaCMessage();aMsg.setTo(userJID);aMsg.setType("typing");var success=this.conn.send(aMsg);},buildMessage:function(target,outbound,msg,date){return{target:target,outbound:outbound,msg:msg,timestamp:date};},getBody:function(packet){var bodyNode=packet.getChild("body");if(!bodyNode){return"";}if(typeof(bodyNode.textContent)!="undefined"){return bodyNode.textContent;}return bodyNode.firstChild.nodeValue;},getItem:function(packet){var itemNode=packet.getChild("item");if(!itemNode){return"";}if(typeof(itemNode.textContent)!="undefined"){return itemNode.textContent;}return itemNode.firstChild.nodeValue;},handleMessage:function(packet){if(packet.getType()=="chat"){var timestamp=new Date();var x=packet.getChild("x");if($defined(x)){timestamp=DateUtility.convertFromGMT(Date.parse(x.getAttribute("stamp")));}var username=packet.getFromJID().getNode();var user=this.getContact(username);var msg=this.buildMessage(user,false,packet.getBody(),timestamp);this.fireEvent("chatMsgReceived",msg);}else{if(packet.getType()=="videoChat"){var username=packet.getFromJID().getNode();var stratusId=packet.getBody();this.fireEvent("videoChatRequestReceived",username,stratusId);}else{if(packet.getType()=="videoChatAccept"){var username=packet.getFromJID().getNode();var stratusId=packet.getBody();this.fireEvent("videoChatRequestAccepted",username,stratusId);}else{if(packet.getType()=="typing"){var username=packet.getFromJID().getNode();this.fireEvent("chatTypingReceived",username);}else{if(packet.getType()=="event"&&packet.getFromJID().getNode()=="server"){var msg=this.getBody(packet);var item=JSON.decode(msg);Logger().log("unicast/multicast received");if($defined(item.eventName)&&$defined(item.data)){this.fireEvent(item.eventName,item.data);}else{Logger().log("unknown event captured");}}else{if(packet.getChild("event")!=null){Logger().log("broadcast received");var msg=this.getItem(packet);if(msg!=""){var item=JSON.decode(msg);if($defined(item.eventName)&&$defined(item.data)){this.fireEvent(item.eventName,item.data);}else{Logger().log("unknown event captured");}}}}}}}}},handlePresence:function(packet){var jid=packet.getFromJID();var username=jid.getNode();var session=jid.getResource();if(jid.getDomain()==this.domain){Logger().log(username+" presence received");if(!packet.getType()){if(username==this.getPrivateUser().username){var show=packet.getShow();this.selfPresenceReceived(show,true);return;}var show=packet.getShow();var video=false;var pip=packet.getChild("pip","*");if(pip){if(pip.getAttribute("video")==1){video=true;}}this.userPresenceReceived(username,show,true,session,video);}else{if(packet.getType()=="unavailable"){var username=jid.getNode();if(username==this.getPrivateUser().username){return;}var session=jid.getResource();this.userPresenceReceived(username,"",false,session,false);}}}},handleConnected:function(){Logger().log("connected");this.isConnecting=false;this.fireEvent("xmppConnected");this.updateSelfPresence("",true,false);window.onunload=this.disconnect.bind(this);},handleDisconnected:function(){Logger().log("disconnected");this.isConnecting=false;this.fireEvent("xmppDisconnected");this.connectTimer=this.connect.delay(3000,this);},handleError:function(e){this.reconnect();Logger().log(e.xml());},handleInPacket:function(aJSJaCPacket){Logger().log("in");Logger().log("packet:"+aJSJaCPacket.xml());},handleOutPacket:function(aJSJaCPacket){Logger().log("out");Logger().log("packet:"+aJSJaCPacket.xml());},setupListeners:function(){this.conn.registerHandler("message",this.handleMessage.bind(this));this.conn.registerHandler("presence",this.handlePresence.bind(this));this.conn.registerHandler("onconnect",this.handleConnected.bind(this));this.conn.registerHandler("onerror",this.handleError.bind(this));this.conn.registerHandler("ondisconnect",this.handleDisconnected.bind(this));},getJID:function(user){if($defined(user)){return user.username+"@"+this.domain;}else{return this.username+"@"+this.domain;}}});Pipio.implement({appList:[{id:1,name:"contacts",displayName:"Contacts",iconOptions:{iconName:"pipio"},classRef:Contacts},{id:2,name:"home",displayName:"Home",iconOptions:{iconName:"pipio"},classRef:Home},{id:3,name:"appstore",displayName:"Pip.io App Store",iconOptions:{iconName:"applications"},classRef:Appstore,autoDock:true},{id:4,name:"rss",displayName:"News Reader",iconOptions:{iconName:"rss"},classRef:Rss,autoDock:true},{id:5,name:"facebook",displayName:"Facebook",iconOptions:{iconName:"facebook"},classRef:Facebook,autoDock:true},{id:6,name:"twitter",displayName:"Twitter",iconOptions:{iconName:"twitter"},classRef:Twitter,autoDock:true}],instanceAppList:{user:{name:"user",classRef:User,autoDock:true},room:{name:"room",classRef:Room,autoDock:true},global:{name:"global",classRef:Global,autoDock:true}},initApps:function(){this.apps=new Hash();this.appsById=$H();this.appInstances=new Hash();this.appList.each(function(app){this.initApp(app);},this);},initInstalledApps:function(apps){this.installedApps=$H();if(!$defined(apps)){return;}apps.each(function(app){this.installedApps.set(app.app_id,{settings:app.settings});},this);this.updateAppsMenu();},appInstalled:function(data){if(!$defined(data.app_id)){return;}this.installedApps.set(data.app_id,data);this.updateAppsMenu();var app=this.getAppById(data.app_id);this.startApp(app.name,{settings:data.settings});},appUninstalled:function(data){if(!$defined(data.app_id)){return;}this.installedApps.erase(data.app_id);this.updateAppsMenu();},updateAppsMenu:function(){DomUtility.hide("app_menu_item_4");DomUtility.hide("app_menu_item_5");DomUtility.hide("app_menu_item_6");DomUtility.show("no_apps");if(this.installedApps.getLength()>0){DomUtility.hide("no_apps");this.installedApps.each(function(app,appId){DomUtility.show("app_menu_item_"+appId);},this);}},getAppById:function(appId){if(this.appsById.has(appId)){return this.appsById.get(appId);}else{return false;}},initApp:function(app){var o=new app.classRef(app);this.apps.set(app.name,o);this.appsById.set(app.id,app);},startApp:function(appName,options){if(!this.apps.has(appName)){return;}var appId=this.apps.get(appName).appId;if(this.installedApps.has(appId)){this.apps.get(appName).start(this.installedApps.get(appId));}else{this.apps.get(appName).start(options);}},startAppInstance:function(appName,instanceName,options){if(!$defined(this.instanceAppList[appName])){return;}var appId=appName+"_"+instanceName;if(this.appInstances.has(appId)){this.appInstances.get(appId).start(appId);return;}var app=this.instanceAppList[appName];var o=new app.classRef(app,options);this.appInstances.set(appId,o);o.start(appId);}});Pipio.implement({initConnectionEventHandlers:function(){this.registerHandler("connectionGroupAdded",this.connectionGroupAdded.bind(this));this.registerHandler("connectionGroupDeleted",this.connectionGroupDeleted.bind(this));this.registerHandler("connectionGroupMoved",this.connectionGroupMoved.bind(this));this.registerHandler("connectionAdded",this.connectionAdded.bind(this));this.registerHandler("connectionDeleted",this.connectionDeleted.bind(this));this.registerHandler("connectionRequestAdded",this.connectionRequestAdded.bind(this));this.registerHandler("connectionRequestDeleted",this.connectionRequestDeleted.bind(this));this.registerHandler("connectionRequestOutAdded",this.connectionRequestOutAdded.bind(this));this.registerHandler("connectionRequestOutDeleted",this.connectionRequestOutDeleted.bind(this));this.registerHandler("roomAdded",this.roomAdded.bind(this));this.registerHandler("roomDeleted",this.roomDeleted.bind(this));this.registerHandler("roomClosed",this.roomDeleted.bind(this));this.registerHandler("roomMembershipUpdated",this.roomMembershipUpdated.bind(this));this.registerHandler("roomStreamSubscriptionDeleted",this.roomStreamSubscriptionDeleted.bind(this));this.registerHandler("roomStreamSubscriptionAdded",this.roomStreamSubscriptionAdded.bind(this));this.registerHandler("profileUpdated",this.profileUpdated.bind(this));this.registerHandler("locationUpdated",this.locationUpdated.bind(this));this.registerHandler("locationCleared",this.locationCleared.bind(this));},initConnections:function(){this.connsByUsername=$H();this.userCache=$H();this.groups=$H();this.requestsByUsername=$H();this.requestsOutByUsername=$H();this.roomsByUsername=$H();this.roomCache=$H();},initLoggedInConnections:function(){this.initConnections();this.processConnections();},initLoggedOutConnections:function(){this.initConnections();},userAboutUpdated:function(data){if(!$defined(data.username)){return;}if(this.connsByUsername.has(data.username)){this.connsByUsername.get(data.username).about=data.about;}if(this.userCache.has(data.username)){this.userCache.get(data.username).about=data.about;}},processConnections:function(){Logger().log("processing user connections");user_data.groups.each(function(group){this.processGroup(group);},this);var unsorted={group_id:0,name:"Unsorted"};this.processGroup(unsorted);user_data.connections.each(function(user){this.processConnection(user);},this);user_data.connection_requests.each(function(user){this.processConnectionRequest(user);},this);user_data.connection_requests_out.each(function(user){this.processConnectionRequestOut(user);},this);user_data.rooms.each(function(room){this.processRoom(room);},this);},processGroup:function(group){group.users=new Hash();this.groups.set(parseInt(group.group_id),group);return group;},processRoom:function(room){room=UserUtility.processRoom(room);this.roomsByUsername.set(room.username,room);return room;},processConnection:function(user){user=UserUtility.processUser(user);this.connsByUsername.set(user.username,user);var group=this.getGroup(user.group_id);this.addUserToGroup(user,group);return user;},processConnectionRequest:function(user){user=UserUtility.processUser(user);this.requestsByUsername.set(user.username,user);return user;},processConnectionRequestOut:function(user){Logger().log("procesing out request "+user.username);user=UserUtility.processUser(user);this.requestsOutByUsername.set(user.username,user);return user;},roomAdded:function(data){if(!$defined(data.room)){return;}var room=this.processRoom(data.room);this.dispatchEvent("feedRoomAdded",room);},roomDeleted:function(data){if(!$defined(data.username)){return;}this.roomsByUsername.erase(data.username);this.roomCache.erase(data.username);this.dispatchEvent("feedRoomDeleted",data.username);},roomMembershipUpdated:function(data){if(!$defined(data.username)||!this.roomsByUsername.has(data.username)){return;}this.roomsByUsername.get(data.username).status=data.status;},roomStreamSubscriptionAdded:function(data){if(!$defined(data.room)||!this.roomsByUsername.has(data.room.username)){return;}this.roomsByUsername.get(data.room.username).subscribed=1;},roomStreamSubscriptionDeleted:function(data){if(!$defined(data.username)||!this.roomsByUsername.has(data.username)){return;}this.roomsByUsername.get(data.username).subscribed=0;},connectionAdded:function(data){if(!$defined(data.user)){return;}var user=this.processConnection(data.user);this.dispatchEvent("contactAdded",user);if(this.requestsByUsername.has(user.username)){this.requestsByUsername.erase(user.username);this.dispatchEvent("contactRequestDeleted",user.username);}if(this.requestsOutByUsername.has(user.username)){this.requestsOutByUsername.erase(user.username);}},connectionDeleted:function(data){if(!$defined(data.username)){return;}var group=this.getGroup(data.group_id);group.users.erase(data.username);this.connsByUsername.erase(data.username);this.dispatchEvent("contactDeleted",data.username,data.group_id);},connectionRequestAdded:function(data){if(!$defined(data.user)){return;}var user=this.processConnectionRequest(data.user);this.dispatchEvent("contactRequestAdded",user);},connectionRequestDeleted:function(data){if(!$defined(data.username)){return;}this.requestsByUsername.erase(data.username);this.dispatchEvent("contactRequestDeleted",data.username);},connectionRequestOutAdded:function(data){if(!$defined(data.user)){return;}var user=this.processConnectionRequestOut(data.user);this.dispatchEvent("contactRequestOutAdded",user);},connectionRequestOutDeleted:function(data){if(!$defined(data.username)){return;}this.requestsOutByUsername.erase(data.username);this.dispatchEvent("contactRequestOutDeleted",data.username);},connectionGroupAdded:function(data){if(!$defined(data.group)){return;}var group=this.processGroup(data.group);this.fireEvent("contactGroupAdded",group);},connectionGroupDeleted:function(data){if(!$defined(data.group_id)||!this.groups.has(data.group_id)){return;}var group=this.getGroup(data.group_id);group.users.each(function(user){this.connectionGroupMoved({username:user.username,group_id:0,old_group_id:data.group_id});group.users.erase(user.username);},this);this.groups.erase(data.group_id);this.fireEvent("contactGroupDeleted",group);},connectionGroupMoved:function(data){if(!$defined(data.group_id)||!$defined(data.username)||!$defined(data.old_group_id)){return;}var user=this.getContact(data.username);user.group_id=data.group_id;this.fireEvent("contactGroupMoved",user);},addUserToGroup:function(user,group){if(!group.users.has(user.username)){group.users.set(user.username,user);}},getGroup:function(group_id){return this.groups.get(parseInt(group_id));},getContact:function(username){return this.connsByUsername.get(username);},getRoom:function(username){if(this.roomsByUsername.has(username)){return this.roomsByUsername.get(username);}else{if(this.roomCache.has(username)){return this.roomCache.get(username);}else{return null;}}},getContactsByGroup:function(group_id){if(!this.groups.has(group_id)){return;}var group=this.getGroup(group_id);return group.users;},getUser:function(username){if(this.userCache.has(username)){return this.userCache.get(username);}else{return null;}},cacheUser:function(user){this.userCache.set(user.username,user);},cacheRoom:function(room){this.roomCache.set(room.username,room);}});Pipio.implement({registerApis:function(){this.requests.each(function(request){this.registerCall("pipio",request);},this);},requests:[{name:"user_login",params:["username","password","remember_me"],url:"/api/auth/user/login"},{name:"user_logout",url:"/api/auth/user/logout"},{name:"user_register",params:["username","password","first_name","last_name","email","dob_month","dob_year","dob_day","access_key"],url:"/api/auth/user/register"},{name:"user_password_resetrequest",params:["username"],url:"/api/auth/user/password/resetrequest"},{name:"user_password_reset",params:["token","new_password","verify_password","email"],url:"/api/auth/user/password/reset"},{name:"user_privacy_set",params:["is_public"],url:"/api/user/privacy/set"},{name:"user_password_change",params:["password","new_password","verify_password"],url:"/api/user/password/change"},{name:"user_email_change",params:["email"],url:"/api/user/email/change"},{name:"user_location_enabled",params:["location_enabled"],url:"/api/user/location/enabled"},{name:"user_location_save",params:["label","country_code","country","city","region","lat","lon","geohash"],url:"/api/user/location/save"},{name:"token_get",url:"/api/user/token/get"},{name:"publish_status",url:"/api/pipio/stream/publish/status",params:["body","res"]},{name:"publish_roomstatus",url:"/api/pipio/stream/publish/roomstatus",params:["username","body","res"]},{name:"user_profilepic_upload",url:"/api/user/profilepic/upload",params:[]},{name:"room_profilepic_upload",url:"/api/pipio/room/profilepic/upload",params:["username"]},{name:"room_members",url:"/api/pipio/room/members",params:["username","date_created"]},{name:"room_subscribers",url:"/api/pipio/room/subscribers",params:["username","date_created"]},{name:"room_requests",url:"/api/pipio/room/requests",params:["username","date_created"]},{name:"email_block",url:"/api/auth/email/block",params:["token","email"]},{name:"user_profile_update",url:"/api/user/profile/update",params:["bio","url","interests"]},{name:"ping",params:[],url:"/api/user/session/ping"},{name:"emailblock_load",url:"/api/user/emailblock/load"},{name:"emailblock_update",params:["email_type","blocked"],url:"/api/user/emailblock/update"}]});
+
+
+
+
+ //initialize pipio core
+
+ var pipio_version = '1.0.8';
+ var user_data = {"logged_in":0};
+ var user_content = "blah";
+
+ //this outputs all templates
+ var templates = new Hash();
+
+ var pipio = new Pipio();
+
+
+
+
+
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+
+
+
+
+(function(){var aa="_gat",ba="_gaq",r=true,v=false,w=undefined,ca="4.6.5",x="length",y="cookie",A="location",B="&",C="=",D="__utma=",E="__utmb=",G="__utmc=",da="__utmk=",H="__utmv=",J="__utmz=",K="__utmx=",L="GASO=";var N=function(i){return w==i||"-"==i||""==i},ea=function(i){return i[x]>0&&" \n\r\t".indexOf(i)>-1},P=function(i,l,g){var t="-",k;if(!N(i)&&!N(l)&&!N(g)){k=i.indexOf(l);if(k>-1){g=i.indexOf(g,k);if(g<0)g=i[x];t=O(i,k+l.indexOf(C)+1,g)}}return t},Q=function(i){var l=v,g=0,t,k;if(!N(i)){l=r;for(t=0;t<i[x];t++){k=i.charAt(t);g+="."==k?1:0;l=l&&g<=1&&(0==t&&"-"==k||".0123456789".indexOf(k)>-1)}}return l},S=function(i,l){var g=encodeURIComponent;return g instanceof Function?l?encodeURI(i):g(i):escape(i)},
+T=function(i,l){var g=decodeURIComponent,t;i=i.split("+").join(" ");if(g instanceof Function)try{t=l?decodeURI(i):g(i)}catch(k){t=unescape(i)}else t=unescape(i);return t},U=function(i,l){return i.indexOf(l)>-1},V=function(i,l){i[i[x]]=l},W=function(i){return i.toLowerCase()},X=function(i,l){return i.split(l)},fa=function(i,l){return i.indexOf(l)},O=function(i,l,g){g=w==g?i[x]:g;return i.substring(l,g)},ga=function(i,l){return i.join(l)},ia=function(i){var l=1,g=0,t;if(!N(i)){l=0;for(t=i[x]-1;t>=0;t--){g=
+i.charCodeAt(t);l=(l<<6&268435455)+g+(g<<14);g=l&266338304;l=g!=0?l^g>>21:l}}return l},ja=function(){var i=window,l=w;if(i&&i.gaGlobal&&i.gaGlobal.hid)l=i.gaGlobal.hid;else{l=Y();i.gaGlobal=i.gaGlobal?i.gaGlobal:{};i.gaGlobal.hid=l}return l},Y=function(){return Math.round(Math.random()*2147483647)},Z={Ha:function(i,l){this.bb=i;this.nb=l},ib:v,_gasoDomain:w,_gasoCPath:w};Z.Gb=function(){function i(k){return new t(k[0],k[1])}function l(k){var p=[];k=k.split(",");var f;for(f=0;f<k.length;++f)p.push(i(k[f].split(":")));return p}var g=this,t=Z.Ha;g.Ia="utm_campaign";g.Ja="utm_content";g.Ka="utm_id";g.La="utm_medium";g.Ma="utm_nooverride";g.Na="utm_source";g.Oa="utm_term";g.Pa="gclid";g.ba=0;g.z=0;g.Ta=15768E6;g.sb=18E5;g.v=63072E6;g.ta=[];g.va=[];g.nc="cse";g.oc="q";g.ob=5;g.T=l("daum:q,eniro:search_word,naver:query,images.google:q,google:q,yahoo:p,msn:q,bing:q,aol:query,aol:encquery,lycos:query,ask:q,altavista:q,netscape:query,cnn:query,about:terms,mamma:query,alltheweb:q,voila:rdata,virgilio:qs,live:q,baidu:wd,alice:qs,yandex:text,najdi:q,aol:q,mama:query,seznam:q,search:q,wp:szukaj,onet:qt,szukacz:q,yam:k,pchome:q,kvasir:q,sesam:q,ozu:q,terra:query,mynet:q,ekolay:q,rambler:words");
+g.t=w;g.lb=v;g.h="/";g.U=100;g.oa="/__utm.gif";g.ga=1;g.ha=1;g.u="|";g.fa=1;g.da=1;g.Ra=1;g.b="auto";g.I=1;g.ra=1E3;g.Jc=10;g.Pb=10;g.Kc=0.2;g.o=w;g.a=document;g.e=window};Z.Hb=function(i){function l(d,a,j,c){var n="",s=0;n=P(d,"2"+a,";");if(!N(n)){d=n.indexOf("^"+j+".");if(d<0)return["",0];n=O(n,d+j[x]+2);if(n.indexOf("^")>0)n=n.split("^")[0];j=n.split(":");n=j[1];s=parseInt(j[0],10);if(!c&&s<p.r)n=""}if(N(n))n="";return[n,s]}function g(d,a){return"^"+ga([[a,d[1]].join("."),d[0]],":")}function t(d,a){f.a[y]=d+"; path="+f.h+"; "+a+p.fb()}function k(d){var a=new Date;d=new Date(a.getTime()+d);return"expires="+d.toGMTString()+"; "}var p=this,f=i;p.r=(new Date).getTime();
+var h=[D,E,G,J,H,K,L];p.k=function(){var d=f.a[y];return f.o?p.Wb(d,f.o):d};p.Wb=function(d,a){var j=[],c,n;for(c=0;c<h[x];c++){n=l(d,h[c],a)[0];N(n)||(j[j[x]]=h[c]+n+";")}return j.join("")};p.l=function(d,a,j){var c=j>0?k(j):"";if(f.o){a=p.kc(f.a[y],d,f.o,a,j);d="2"+d;c=j>0?k(f.v):""}t(d+a,c)};p.kc=function(d,a,j,c,n){var s="";n=n||f.v;c=g([c,p.r+n*1],j);s=P(d,"2"+a,";");if(!N(s)){d=g(l(d,a,j,r),j);s=ga(s.split(d),"");return s=c+s}return c};p.fb=function(){return N(f.b)?"":"domain="+f.b+";"}};Z.$=function(i){function l(b){b=b instanceof Array?b.join("."):"";return N(b)?"-":b}function g(b,e){var o=[];if(!N(b)){o=b.split(".");if(e)for(b=0;b<o[x];b++)Q(o[b])||(o[b]="-")}return o}function t(b,e,o){var m=c.M,q,u;for(q=0;q<m[x];q++){u=m[q][0];u+=N(e)?e:e+m[q][4];m[q][2](P(b,u,o))}}var k,p,f,h,d,a,j,c=this,n,s=i;c.j=new Z.Hb(i);c.kb=function(){return w==n||n==c.P()};c.k=function(){return c.j.k()};c.ma=function(){return d?d:"-"};c.vb=function(b){d=b};c.za=function(b){n=Q(b)?b*1:"-"};c.la=function(){return l(a)};
+c.Aa=function(b){a=g(b)};c.Vb=function(){c.j.l(H,"",-1)};c.lc=function(){return n?n:"-"};c.fb=function(){return N(s.b)?"":"domain="+s.b+";"};c.ja=function(){return l(k)};c.tb=function(b){k=g(b,1)};c.C=function(){return l(p)};c.ya=function(b){p=g(b,1)};c.ka=function(){return l(f)};c.ub=function(b){f=g(b,1)};c.na=function(){return l(h)};c.wb=function(b){h=g(b);for(b=0;b<h[x];b++)if(b<4&&!Q(h[b]))h[b]="-"};c.fc=function(){return j};c.Dc=function(b){j=b};c.Sb=function(){k=[];p=[];f=[];h=[];d=w;a=[];n=
+w};c.P=function(){var b="",e;for(e=0;e<c.M[x];e++)b+=c.M[e][1]();return ia(b)};c.ua=function(b){var e=c.k(),o=v;if(e){t(e,b,";");c.za(c.P());o=r}return o};c.zc=function(b){t(b,"",B);c.za(P(b,da,B))};c.Hc=function(){var b=c.M,e=[],o;for(o=0;o<b[x];o++)V(e,b[o][0]+b[o][1]());V(e,da+c.P());return e.join(B)};c.Nc=function(b,e){var o=c.M,m=s.h;c.ua(b);s.h=e;for(b=0;b<o[x];b++)N(o[b][1]())||o[b][3]();s.h=m};c.Cb=function(){c.j.l(D,c.ja(),s.v)};c.Ea=function(){c.j.l(E,c.C(),s.sb)};c.Db=function(){c.j.l(G,
+c.ka(),0)};c.Ga=function(){c.j.l(J,c.na(),s.Ta)};c.Eb=function(){c.j.l(K,c.ma(),s.v)};c.Fa=function(){c.j.l(H,c.la(),s.v)};c.Oc=function(){c.j.l(L,c.fc(),0)};c.M=[[D,c.ja,c.tb,c.Cb,"."],[E,c.C,c.ya,c.Ea,""],[G,c.ka,c.ub,c.Db,""],[K,c.ma,c.vb,c.Eb,""],[J,c.na,c.wb,c.Ga,"."],[H,c.la,c.Aa,c.Fa,"."]]};Z.Kb=function(i){var l=this,g=i,t=new Z.$(g),k=function(){},p=function(f){var h=(new Date).getTime(),d;d=(h-f[3])*(g.Kc/1E3);if(d>=1){f[2]=Math.min(Math.floor(f[2]*1+d),g.Pb);f[3]=h}return f};l.H=function(f,h,d,a,j,c){var n,s=g.I,b=g.a[A];t.ua(d);n=X(t.C(),".");if(n[1]<500||a){if(j)n=p(n);if(a||!j||n[2]>=1){if(!a&&j)n[2]=n[2]*1-1;n[1]=n[1]*1+1;f="?utmwv="+ca+"&utmn="+Y()+(N(b.hostname)?"":"&utmhn="+S(b.hostname))+(g.U==100?"":"&utmsp="+S(g.U))+f;if(0==s||2==s){a=2==s?k:c||k;l.$a(g.oa+f,a)}if(1==s||
+2==s){f=("https:"==b.protocol?"https://ssl.google-analytics.com/__utm.gif":"http://www.google-analytics.com/__utm.gif")+f+"&utmac="+h+"&utmcc="+l.ac(d);if(ka)f+="&gaq=1";l.$a(f,c)}}}t.ya(n.join("."));t.Ea()};l.$a=function(f,h){var d=new Image(1,1);d.src=f;d.onload=function(){d.onload=null;(h||k)()}};l.ac=function(f){var h=[],d=[D,J,H,K],a,j=t.k(),c;for(a=0;a<d[x];a++){c=P(j,d[a]+f,";");if(!N(c)){if(d[a]==H){c=X(c.split(f+".")[1],"|")[0];if(N(c))continue;c=f+"."+c}V(h,d[a]+c+";")}}return S(h.join("+"))}};Z.n=function(){var i=this;i.Y=[];i.hb=function(l){var g,t=i.Y,k;for(k=0;k<t.length;k++)g=l==t[k].q?t[k]:g;return g};i.Ob=function(l,g,t,k,p,f,h,d){var a=i.hb(l);if(w==a){a=new Z.n.Mb(l,g,t,k,p,f,h,d);V(i.Y,a)}else{a.Qa=g;a.Ab=t;a.zb=k;a.xb=p;a.Xa=f;a.yb=h;a.Za=d}return a}};Z.n.Lb=function(i,l,g,t,k,p){var f=this;f.Bb=i;f.Ba=l;f.D=g;f.Va=t;f.pb=k;f.qb=p;f.Ca=function(){return"&"+["utmt=item","tid="+S(f.Bb),"ipc="+S(f.Ba),"ipn="+S(f.D),"iva="+S(f.Va),"ipr="+S(f.pb),"iqt="+S(f.qb)].join("&utm")}};
+Z.n.Mb=function(i,l,g,t,k,p,f,h){var d=this;d.q=i;d.Qa=l;d.Ab=g;d.zb=t;d.xb=k;d.Xa=p;d.yb=f;d.Za=h;d.R=[];d.Nb=function(a,j,c,n,s){var b=d.gc(a),e=d.q;if(w==b)V(d.R,new Z.n.Lb(e,a,j,c,n,s));else{b.Bb=e;b.Ba=a;b.D=j;b.Va=c;b.pb=n;b.qb=s}};d.gc=function(a){var j,c=d.R,n;for(n=0;n<c.length;n++)j=a==c[n].Ba?c[n]:j;return j};d.Ca=function(){return"&"+["utmt=tran","id="+S(d.q),"st="+S(d.Qa),"to="+S(d.Ab),"tx="+S(d.zb),"sp="+S(d.xb),"ci="+S(d.Xa),"rg="+S(d.yb),"co="+S(d.Za)].join("&utmt")}};Z.Fb=function(i){function l(){var f,h,d;h="ShockwaveFlash";var a="$version",j=k.d?k.d.plugins:w;if(j&&j[x]>0)for(f=0;f<j[x]&&!d;f++){h=j[f];if(U(h.name,"Shockwave Flash"))d=h.description.split("Shockwave Flash ")[1]}else{h=h+"."+h;try{f=new ActiveXObject(h+".7");d=f.GetVariable(a)}catch(c){}if(!d)try{f=new ActiveXObject(h+".6");d="WIN 6,0,21,0";f.AllowScriptAccess="always";d=f.GetVariable(a)}catch(n){}if(!d)try{f=new ActiveXObject(h);d=f.GetVariable(a)}catch(s){}if(d){d=X(d.split(" ")[1],",");d=d[0]+
+"."+d[1]+" r"+d[2]}}return d?d:p}var g=i,t=g.e,k=this,p="-";k.V=t.screen;k.Sa=!k.V&&t.java?java.awt.Toolkit.getDefaultToolkit():w;k.d=t.navigator;k.W=p;k.xa=p;k.Wa=p;k.qa=p;k.pa=1;k.eb=p;k.bc=function(){var f;if(t.screen){k.W=k.V.width+"x"+k.V.height;k.xa=k.V.colorDepth+"-bit"}else if(k.Sa)try{f=k.Sa.getScreenSize();k.W=f.width+"x"+f.height}catch(h){}k.qa=W(k.d&&k.d.language?k.d.language:k.d&&k.d.browserLanguage?k.d.browserLanguage:p);k.pa=k.d&&k.d.javaEnabled()?1:0;k.eb=g.ha?l():p;k.Wa=S(g.a.characterSet?
+g.a.characterSet:g.a.charset?g.a.charset:p)};k.Ic=function(){return B+"utm"+["cs="+S(k.Wa),"sr="+k.W,"sc="+k.xa,"ul="+k.qa,"je="+k.pa,"fl="+S(k.eb)].join("&utm")};k.$b=function(){var f=g.a,h=t.history[x];f=k.d.appName+k.d.version+k.qa+k.d.platform+k.d.userAgent+k.pa+k.W+k.xa+(f[y]?f[y]:"")+(f.referrer?f.referrer:"");for(var d=f[x];h>0;)f+=h--^d++;return ia(f)}};Z.m=function(i,l,g,t){function k(d){var a="";d=W(d.split("://")[1]);if(U(d,"/")){d=d.split("/")[1];if(U(d,"?"))a=d.split("?")[0]}return a}function p(d){var a="";a=W(d.split("://")[1]);if(U(a,"/"))a=a.split("/")[0];return a}var f=t,h=this;h.c=i;h.rb=l;h.r=g;h.ic=function(d){var a=h.gb();return new Z.m.w(P(d,f.Ka+C,B),P(d,f.Na+C,B),P(d,f.Pa+C,B),h.Q(d,f.Ia,"(not set)"),h.Q(d,f.La,"(not set)"),h.Q(d,f.Oa,a&&!N(a.K)?T(a.K):w),h.Q(d,f.Ja,w))};h.jb=function(d){var a=p(d),j=k(d);if(U(a,"google")){d=d.split("?").join(B);
+if(U(d,B+f.oc+C))if(j==f.nc)return r}return v};h.gb=function(){var d,a=h.rb,j,c,n=f.T;if(!(N(a)||"0"==a||!U(a,"://")||h.jb(a))){d=p(a);for(j=0;j<n[x];j++){c=n[j];if(U(d,W(c.bb))){a=a.split("?").join(B);if(U(a,B+c.nb+C)){d=a.split(B+c.nb+C)[1];if(U(d,B))d=d.split(B)[0];return new Z.m.w(w,c.bb,w,"(organic)","organic",d,w)}}}}};h.Q=function(d,a,j){d=P(d,a+C,B);return j=!N(d)?T(d):!N(j)?j:"-"};h.uc=function(d){var a=f.ta,j=v,c;if(d&&"organic"==d.S){d=W(T(d.K));for(c=0;c<a[x];c++)j=j||W(a[c])==d}return j};
+h.hc=function(){var d="",a="";d=h.rb;if(!(N(d)||"0"==d||!U(d,"://")||h.jb(d))){d=d.split("://")[1];if(U(d,"/")){a=O(d,d.indexOf("/"));a=a.split("?")[0];d=W(d.split("/")[0])}if(0==d.indexOf("www."))d=O(d,4);return new Z.m.w(w,d,w,"(referral)","referral",w,a)}};h.Xb=function(d){var a="";if(f.ba){a=d&&d.hash?d.href.substring(d.href.indexOf("#")):"";a=""!=a?a+B:a}a+=d.search;return a};h.dc=function(){return new Z.m.w(w,"(direct)",w,"(direct)","(none)",w,w)};h.vc=function(d){var a=v,j,c=f.va;if(d&&"referral"==
+d.S){d=W(S(d.X));for(j=0;j<c[x];j++)a=a||U(d,W(c[j]))}return a};h.L=function(d){return w!=d&&d.mb()};h.cc=function(d,a){var j="",c="-",n,s=0,b,e,o=h.c;if(!d)return"";e=d.k();j=h.Xb(f.a[A]);if(f.z&&d.kb()){c=d.na();if(!N(c)&&!U(c,";")){d.Ga();return""}}c=P(e,J+o+".",";");n=h.ic(j);if(h.L(n)){j=P(j,f.Ma+C,B);if("1"==j&&!N(c))return""}if(!h.L(n)){n=h.gb();if(!N(c)&&h.uc(n))return""}if(!h.L(n)&&a){n=h.hc();if(!N(c)&&h.vc(n))return""}if(!h.L(n))if(N(c)&&a)n=h.dc();if(!h.L(n))return"";if(!N(c)){s=c.split(".");
+b=new Z.m.w;b.Zb(s.slice(4).join("."));b=W(b.Da())==W(n.Da());s=s[3]*1}if(!b||a){a=P(e,D+o+".",";");e=a.lastIndexOf(".");a=e>9?O(a,e+1)*1:0;s++;a=0==a?1:a;d.wb([o,h.r,a,s,n.Da()].join("."));d.Ga();return B+"utmcn=1"}else return B+"utmcr=1"}};
+Z.m.w=function(i,l,g,t,k,p,f){var h=this;h.q=i;h.X=l;h.ea=g;h.D=t;h.S=k;h.K=p;h.Ya=f;h.Da=function(){var d=[],a=[["cid",h.q],["csr",h.X],["gclid",h.ea],["ccn",h.D],["cmd",h.S],["ctr",h.K],["cct",h.Ya]],j,c;if(h.mb())for(j=0;j<a[x];j++)if(!N(a[j][1])){c=a[j][1].split("+").join("%20");c=c.split(" ").join("%20");V(d,"utm"+a[j][0]+C+c)}return d.join("|")};h.mb=function(){return!(N(h.q)&&N(h.X)&&N(h.ea))};h.Zb=function(d){var a=function(j){return T(P(d,"utm"+j+C,"|"))};h.q=a("cid");h.X=a("csr");h.ea=a("gclid");
+h.D=a("ccn");h.S=a("cmd");h.K=a("ctr");h.Ya=a("cct")}};Z.Ib=function(i,l,g,t){function k(j,c,n){var s;if(!N(n)){n=n.split(",");for(var b=0;b<n[x];b++){s=n[b];if(!N(s)){s=s.split(h);if(s[x]==4)c[s[0]]=[s[1],s[2],j]}}}}var p=this,f=l,h=C,d=i,a=t;p.O=g;p.sa="";p.p={};p.tc=function(){var j;j=X(P(p.O.k(),H+f+".",";"),f+".")[1];if(!N(j)){j=j.split("|");k(1,p.p,j[1]);p.sa=j[0];p.Z()}};p.Z=function(){p.Qb();var j=p.sa,c,n,s="";for(c in p.p)if((n=p.p[c])&&1===n[2])s+=c+h+n[0]+h+n[1]+h+1+",";N(s)||(j+="|"+s);if(N(j))p.O.Vb();else{p.O.Aa(f+"."+j);p.O.Fa()}};p.Ec=
+function(j){p.sa=j;p.Z()};p.Cc=function(j,c,n,s){if(1!=s&&2!=s&&3!=s)s=3;var b=v;if(c&&n&&j>0&&j<=d.ob){c=S(c);n=S(n);if(c[x]+n[x]<=64){p.p[j]=[c,n,s];p.Z();b=r}}return b};p.mc=function(j){if((j=p.p[j])&&1===j[2])return j[1]};p.Ub=function(j){var c=p.p;if(c[j]){delete c[j];p.Z()}};p.Qb=function(){a._clearKey(8);a._clearKey(9);a._clearKey(11);var j=p.p,c,n;for(n in j)if(c=j[n]){a._setKey(8,n,c[0]);a._setKey(9,n,c[1]);(c=c[2])&&3!=c&&a._setKey(11,n,""+c)}}};Z.N=function(){function i(m,q,u,z){if(w==f[m])f[m]={};if(w==f[m][q])f[m][q]=[];f[m][q][u]=z}function l(m,q){if(w!=f[m]&&w!=f[m][q]){f[m][q]=w;q=r;var u;for(u=0;u<a[x];u++)if(w!=f[m][a[u]]){q=v;break}if(q)f[m]=w}}function g(m){var q="",u=v,z,M;for(z=0;z<a[x];z++){M=m[a[z]];if(w!=M){if(u)q+=a[z];q+=t(M);u=v}else u=r}return q}function t(m){var q=[],u,z;for(z=0;z<m[x];z++)if(w!=m[z]){u="";if(z!=o&&w==m[z-1])u+=z.toString()+s;u+=k(m[z]);V(q,u)}return j+q.join(n)+c}function k(m){var q="",u,z,M;for(u=0;u<
+m[x];u++){z=m.charAt(u);M=e[z];q+=w!=M?M:z}return q}var p=this,f={},h="k",d="v",a=[h,d],j="(",c=")",n="*",s="!",b="'",e={};e[b]="'0";e[c]="'1";e[n]="'2";e[s]="'3";var o=1;p.qc=function(m){return w!=f[m]};p.G=function(){var m="",q;for(q in f)if(w!=f[q])m+=q.toString()+g(f[q]);return m};p.Ac=function(m){if(m==w)return p.G();var q=m.G(),u;for(u in f)if(w!=f[u]&&!m.qc(u))q+=u.toString()+g(f[u]);return q};p._setKey=function(m,q,u){if(typeof u!="string")return v;i(m,h,q,u);return r};p._setValue=function(m,
+q,u){if(typeof u!="number"&&(w==Number||!(u instanceof Number))||Math.round(u)!=u||u==NaN||u==Infinity)return v;i(m,d,q,u.toString());return r};p._getKey=function(m,q){return w!=f[m]&&w!=f[m][h]?f[m][h][q]:w};p._getValue=function(m,q){return w!=f[m]&&w!=f[m][d]?f[m][d][q]:w};p._clearKey=function(m){l(m,h)};p._clearValue=function(m){l(m,d)}};Z.Jb=function(i,l){var g=this;g.Qc=l;g.xc=i;g._trackEvent=function(t,k,p){return l._trackEvent(g.xc,t,k,p)}};Z.aa=function(i,l){function g(){if("auto"==c.b){var b=c.a.domain;if("www."==O(b,0,4))b=O(b,4);c.b=b}c.b=W(c.b)}function t(){var b=c.b,e=b.indexOf("www.google.")*b.indexOf(".google.")*b.indexOf("google.");return e||"/"!=c.h||b.indexOf("google.org")>-1}function k(b,e,o){if(N(b)||N(e)||N(o))return"-";b=P(b,D+a.c+".",e);if(!N(b)){b=b.split(".");b[5]=b[5]?b[5]*1+1:1;b[3]=b[4];b[4]=o;b=b.join(".")}return b}function p(){return"file:"!=c.a[A].protocol&&t()}function f(b){if(!b||""==b)return"";for(;ea(b.charAt(0));)b=
+O(b,1);for(;ea(b.charAt(b[x]-1));)b=O(b,0,b[x]-1);return b}function h(b,e,o,m){if(!N(b())){e(m?T(b()):b());U(b(),";")||o()}}function d(b){var e,o=""!=b&&c.a[A].host!=b;if(o)for(e=0;e<c.t[x];e++)o=o&&fa(W(b),W(c.t[e]))==-1;return o}var a=this,j=w,c=new Z.Gb,n=v,s=w;a.e=window;a.r=Math.round((new Date).getTime()/1E3);a.s=i||"UA-XXXXX-X";a.ab=c.a.referrer;a.ia=w;a.f=w;a.B=w;a.F=v;a.A=w;a.Ua="";a.g=w;a.cb=w;a.c=w;a.i=w;c.o=l?S(l):w;a.wc=function(){var b=v;if(a.B)b=a.B.match(/^[0-9a-z-_.]{10,1200}$/i);
+return b};a.jc=function(){return Y()^a.A.$b()&2147483647};a.ec=function(){if(!c.b||""==c.b||"none"==c.b){c.b="";return 1}g();return c.Ra?ia(c.b):1};a.Yb=function(b,e){if(N(b))b="-";else{e+=c.h&&"/"!=c.h?c.h:"";e=b.indexOf(e);b=e>=0&&e<=8?"0":"["==b.charAt(0)&&"]"==b.charAt(b[x]-1)?"-":b}return b};a.wa=function(b){var e="",o=c.a;e+=c.fa?a.A.Ic():"";e+=c.da?a.Ua:"";e+=c.ga&&!N(o.title)?"&utmdt="+S(o.title):"";e+="&utmhid="+ja()+"&utmr="+S(a.ia)+"&utmp="+S(a.Bc(b));return e};a.Bc=function(b){var e=c.a[A];
+return b=w!=b&&""!=b?S(b,r):S(e.pathname+e.search,r)};a.Lc=function(b){if(a.J()){var e="";if(a.g!=w&&a.g.G()[x]>0)e+="&utme="+S(a.g.G());e+=a.wa(b);j.H(e,a.s,a.c)}};a.Tb=function(){var b=new Z.$(c);return b.ua(a.c)?b.Hc():w};a._getLinkerUrl=function(b,e){var o=b.split("#"),m=b,q=a.Tb();if(q)if(e&&1>=o[x])m+="#"+q;else if(!e||1>=o[x])if(1>=o[x])m+=(U(b,"?")?B:"?")+q;else m=o[0]+(U(b,"?")?B:"?")+q+"#"+o[1];return m};a.Fc=function(){var b;if(a.wc()){a.i.Dc(a.B);a.i.Oc();Z._gasoDomain=c.b;Z._gasoCPath=
+c.h;b=c.a.createElement("script");b.type="text/javascript";b.id="_gasojs";b.src="https://www.google.com/analytics/reporting/overlay_js?gaso="+a.B+B+Y();c.a.getElementsByTagName("head")[0].appendChild(b)}};a.pc=function(){var b=a.r,e=a.i,o=e.k(),m=a.c+"",q=c.e,u=q?q.gaGlobal:w,z,M=U(o,D+m+"."),la=U(o,E+m),ma=U(o,G+m),F,I=[],R="",ha=v;o=N(o)?"":o;if(c.z){z=c.a[A]&&c.a[A].hash?c.a[A].href.substring(c.a[A].href.indexOf("#")):"";if(c.ba&&!N(z))R=z+B;R+=c.a[A].search;if(!N(R)&&U(R,D)){e.zc(R);e.kb()||e.Sb();
+F=e.ja()}h(e.ma,e.vb,e.Eb,true);h(e.la,e.Aa,e.Fa)}if(N(F))if(M)if(!la||!ma){F=k(o,";",b);a.F=r}else{F=P(o,D+m+".",";");I=X(P(o,E+m,";"),".")}else{F=ga([m,a.jc(),b,b,b,1],".");ha=a.F=r}else if(N(e.C())||N(e.ka())){F=k(R,B,b);a.F=r}else{I=X(e.C(),".");m=I[0]}F=F.split(".");if(q&&u&&u.dh==m&&!c.o){F[4]=u.sid?u.sid:F[4];if(ha){F[3]=u.sid?u.sid:F[4];if(u.vid){b=u.vid.split(".");F[1]=b[0];F[2]=b[1]}}}e.tb(F.join("."));I[0]=m;I[1]=I[1]?I[1]:0;I[2]=w!=I[2]?I[2]:c.Jc;I[3]=I[3]?I[3]:F[4];e.ya(I.join("."));
+e.ub(m);N(e.lc())||e.za(e.P());e.Cb();e.Ea();e.Db()};a.rc=function(){j=new Z.Kb(c)};a._initData=function(){var b;if(!n){if(!a.A){a.A=new Z.Fb(c);a.A.bc()}a.c=a.ec();a.i=new Z.$(c);a.g=new Z.N;s=new Z.Ib(c,a.c,a.i,a.g);a.rc()}if(p()){a.pc();s.tc()}if(!n){if(p()){a.ia=a.Yb(a.ab,c.a.domain);if(c.da){b=new Z.m(a.c,a.ia,a.r,c);a.Ua=b.cc(a.i,a.F)}}a.cb=new Z.N;n=r}Z.ib||a.sc()};a._visitCode=function(){a._initData();var b=P(a.i.k(),D+a.c+".",";");b=b.split(".");return b[x]<4?"":b[1]};a._cookiePathCopy=function(b){a._initData();
+a.i&&a.i.Nc(a.c,b)};a.sc=function(){var b=c.a[A].hash;if(b&&1==b.indexOf("gaso="))b=P(b,"gaso=",B);else b=(b=c.e.name)&&0<=b.indexOf("gaso=")?P(b,"gaso=",B):P(a.i.k(),L,";");if(b[x]>=10){a.B=b;a.Fc()}Z.ib=r};a.J=function(){return a._visitCode()%1E4<c.U*100};a.Gc=function(){var b,e,o=c.a.links;if(!c.lb){b=c.a.domain;if("www."==O(b,0,4))b=O(b,4);c.t.push("."+b)}for(b=0;b<o[x]&&(c.ra==-1||b<c.ra);b++){e=o[b];if(d(e.host))if(!e.gatcOnclick){e.gatcOnclick=e.onclick?e.onclick:a.yc;e.onclick=function(m){var q=
+!this.target||this.target=="_self"||this.target=="_top"||this.target=="_parent";q=q&&!a.Rb(m);a.Mc(m,this,q);return q?v:this.gatcOnclick?this.gatcOnclick(m):r}}}};a.yc=function(){};a._trackPageview=function(b){if(p()){a._initData();c.t&&a.Gc();a.Lc(b);a.F=v}};a._trackTrans=function(){var b=a.c,e=[],o,m,q;a._initData();if(a.f&&a.J()){for(o=0;o<a.f.Y[x];o++){m=a.f.Y[o];V(e,m.Ca());for(q=0;q<m.R[x];q++)V(e,m.R[q].Ca())}for(o=0;o<e[x];o++)j.H(e[o],a.s,b,r)}};a._setTrans=function(){var b=c.a,e,o,m;b=b.getElementById?
+b.getElementById("utmtrans"):b.utmform&&b.utmform.utmtrans?b.utmform.utmtrans:w;a._initData();if(b&&b.value){a.f=new Z.n;m=b.value.split("UTM:");c.u=!c.u||""==c.u?"|":c.u;for(b=0;b<m[x];b++){m[b]=f(m[b]);e=m[b].split(c.u);for(o=0;o<e[x];o++)e[o]=f(e[o]);if("T"==e[0])a._addTrans(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]);else"I"==e[0]&&a._addItem(e[1],e[2],e[3],e[4],e[5],e[6])}}};a._addTrans=function(b,e,o,m,q,u,z,M){a.f=a.f?a.f:new Z.n;return a.f.Ob(b,e,o,m,q,u,z,M)};a._addItem=function(b,e,o,m,q,u){var z;
+a.f=a.f?a.f:new Z.n;(z=a.f.hb(b))||(z=a._addTrans(b,"","","","","","",""));z.Nb(e,o,m,q,u)};a._setVar=function(b){if(b&&""!=b&&t()){a._initData();s.Ec(S(b));a.J()&&j.H("&utmt=var",a.s,a.c)}};a._setCustomVar=function(b,e,o,m){a._initData();return s.Cc(b,e,o,m)};a._deleteCustomVar=function(b){a._initData();s.Ub(b)};a._getVisitorCustomVar=function(b){a._initData();return s.mc(b)};a._setMaxCustomVariables=function(b){c.ob=b};a._link=function(b,e){if(c.z&&b){a._initData();c.a[A].href=a._getLinkerUrl(b,
+e)}};a._linkByPost=function(b,e){if(c.z&&b&&b.action){a._initData();b.action=a._getLinkerUrl(b.action,e)}};a._setXKey=function(b,e,o){a.g._setKey(b,e,o)};a._setXValue=function(b,e,o){a.g._setValue(b,e,o)};a._getXKey=function(b,e){return a.g._getKey(b,e)};a._getXValue=function(b,e){return a.g.getValue(b,e)};a._clearXKey=function(b){a.g._clearKey(b)};a._clearXValue=function(b){a.g._clearValue(b)};a._createXObj=function(){a._initData();return new Z.N};a._sendXEvent=function(b){var e="";a._initData();
+if(a.J()){e+="&utmt=event&utme="+S(a.g.Ac(b))+a.wa();j.H(e,a.s,a.c,v,r)}};a._createEventTracker=function(b){a._initData();return new Z.Jb(b,a)};a._trackEvent=function(b,e,o,m){var q=a.cb;if(w!=b&&w!=e&&""!=b&&""!=e){q._clearKey(5);q._clearValue(5);(b=q._setKey(5,1,b)&&q._setKey(5,2,e)&&(w==o||q._setKey(5,3,o))&&(w==m||q._setValue(5,1,m)))&&a._sendXEvent(q)}else b=v;return b};a.Mc=function(b,e,o){a._initData();if(a.J()){var m=new Z.N;m._setKey(6,1,e.href);var q=o?function(){a.db(b,e)}:w;j.H("&utmt=event&utme="+
+S(m.G())+a.wa(),a.s,a.c,v,r,q);if(o){var u=this;c.e.setTimeout(function(){u.db(b,e)},500)}}};a.db=function(b,e){if(!b)b=c.e.event;var o=r;if(e.gatcOnclick)o=e.gatcOnclick(b);if(o||typeof o=="undefined")if(!e.target||e.target=="_self")c.e[A]=e.href;else if(e.target=="_top")c.e.top.document[A]=e.href;else if(e.target=="_parent")c.e.parent.document[A]=e.href};a.Rb=function(b){if(!b)b=c.e.event;var e=b.shiftKey||b.ctrlKey||b.altKey;if(!e)if(b.modifiers&&c.e.Event)e=b.modifiers&c.e.Event.CONTROL_MASK||
+b.modifiers&c.e.Event.SHIFT_MASK||b.modifiers&c.e.Event.ALT_MASK;return e};a.Pc=function(){return c};a._setDomainName=function(b){c.b=b};a._addOrganic=function(b,e,o){c.T.splice(o?0:c.T.length,0,new Z.Ha(b,e))};a._clearOrganic=function(){c.T=[]};a._addIgnoredOrganic=function(b){V(c.ta,b)};a._clearIgnoredOrganic=function(){c.ta=[]};a._addIgnoredRef=function(b){V(c.va,b)};a._clearIgnoredRef=function(){c.va=[]};a._setAllowHash=function(b){c.Ra=b?1:0};a._setCampaignTrack=function(b){c.da=b?1:0};a._setClientInfo=
+function(b){c.fa=b?1:0};a._getClientInfo=function(){return c.fa};a._setCookiePath=function(b){c.h=b};a._setTransactionDelim=function(b){c.u=b};a._setCookieTimeout=function(b){a._setCampaignCookieTimeout(b*1E3)};a._setCampaignCookieTimeout=function(b){c.Ta=b};a._setDetectFlash=function(b){c.ha=b?1:0};a._getDetectFlash=function(){return c.ha};a._setDetectTitle=function(b){c.ga=b?1:0};a._getDetectTitle=function(){return c.ga};a._setLocalGifPath=function(b){c.oa=b};a._getLocalGifPath=function(){return c.oa};
+a._setLocalServerMode=function(){c.I=0};a._setRemoteServerMode=function(){c.I=1};a._setLocalRemoteServerMode=function(){c.I=2};a._getServiceMode=function(){return c.I};a._setSampleRate=function(b){c.U=b};a._setSessionTimeout=function(b){a._setSessionCookieTimeout(b*1E3)};a._setSessionCookieTimeout=function(b){c.sb=b};a._setAllowLinker=function(b){c.z=b?1:0};a._setAllowAnchor=function(b){c.ba=b?1:0};a._setCampNameKey=function(b){c.Ia=b};a._setCampContentKey=function(b){c.Ja=b};a._setCampIdKey=function(b){c.Ka=
+b};a._setCampMediumKey=function(b){c.La=b};a._setCampNOKey=function(b){c.Ma=b};a._setCampSourceKey=function(b){c.Na=b};a._setCampTermKey=function(b){c.Oa=b};a._setCampCIdKey=function(b){c.Pa=b};a._getAccount=function(){return a.s};a._setAccount=function(b){a.s=b};a._setNamespace=function(b){c.o=b?S(b):w};a._getVersion=function(){return ca};a._setAutoTrackOutbound=function(b){c.t=[];if(b)c.t=b};a._setTrackOutboundSubdomains=function(b){c.lb=b};a._setHrefExamineLimit=function(b){c.ra=b};a._setReferrerOverride=
+function(b){a.ab=b};a._setCookiePersistence=function(b){a._setVisitorCookieTimeout(b)};a._setVisitorCookieTimeout=function(b){c.v=b}};Z._getTracker=function(i,l){return new Z.aa(i,l)};var ka=v,$={ca:{},_createAsyncTracker:function(i,l){l=l||"";i=new Z.aa(i);$.ca[l]=i;ka=r;return i},_getAsyncTracker:function(i){i=i||"";var l=$.ca[i];if(!l){l=new Z.aa;$.ca[i]=l;ka=r}return l},push:function(){for(var i=arguments,l=0,g=0;g<i[x];g++)try{if(typeof i[g]==="function")i[g]();else{var t="",k=i[g][0],p=k.lastIndexOf(".");if(p>0){t=O(k,0,p);k=O(k,p+1)}var f=$._getAsyncTracker(t);f[k].apply(f,i[g].slice(1))}}catch(h){l++}return l}};window[aa]=Z;function na(){var i=window[ba],l=v;if(i&&typeof i.push=="function"){l=i.constructor==Array;if(!l)return}window[ba]=$;l&&$.push.apply($,i)}na();})()
+
+
+
+ try {
+ var pageTracker = _gat._getTracker("UA-8830181-1");
+ pageTracker._trackPageview();
+} catch(err) {}
+</script>
+
+
+<script id="twitch" type="x">
+/*
+
+ * Processing.js - John Resig (http://ejohn.org/)
+
+ * MIT Licensed
+
+ * http://ejohn.org/blog/processingjs/
+
+ *
+
+ * This is a port of the Processing Visualization Language.
+
+ * More information: http://processing.org/
+
+ */
+
+
+
+(function(){
+
+
+
+this.Processing = function Processing( aElement, aCode ) {
+
+ if ( typeof aElement == "string" )
+
+ aElement = document.getElementById( aElement );
+
+
+
+ var p = buildProcessing( aElement );
+
+
+
+ if ( aCode )
+
+ p.init( aCode );
+
+
+
+ return p;
+
+};
+
+
+
+function log() {
+
+ try {
+
+ console.log.apply( console, arguments );
+
+ } catch(e) {
+
+ try {
+
+ opera.postError.apply( opera, arguments );
+
+ } catch(e){}
+
+ }
+
+}
+
+
+
+var parse = Processing.parse = function parse( aCode, p ) {
+
+ // Angels weep at this parsing code :-(
+
+
+
+ // Remove end-of-line comments
+
+ aCode = aCode.replace(/\/\/ .*\n/g, "\n");
+
+
+
+ // Weird parsing errors with %
+
+ aCode = aCode.replace(/([^\s])%([^\s])/g, "$1 % $2");
+
+
+
+ // Simple convert a function-like thing to function
+
+ aCode = aCode.replace(/(?:static )?(\w+ )(\w+)\s*(\([^\)]*\)\s*{)/g, function(all, type, name, args) {
+
+ if ( name == "if" || name == "for" || name == "while" ) {
+
+ return all;
+
+ } else {
+
+ return "Processing." + name + " = function " + name + args;
+
+ }
+
+ });
+
+
+
+ // Force .length() to be .length
+
+ aCode = aCode.replace(/\.length\(\)/g, ".length");
+
+
+
+ // foo( int foo, float bar )
+
+ aCode = aCode.replace(/([\(,]\s*)(\w+)((?:\[\])+| )\s*(\w+\s*[\),])/g, "$1$4");
+
+ aCode = aCode.replace(/([\(,]\s*)(\w+)((?:\[\])+| )\s*(\w+\s*[\),])/g, "$1$4");
+
+
+
+ // float[] foo = new float[5];
+
+ aCode = aCode.replace(/new (\w+)((?:\[([^\]]*)\])+)/g, function(all, name, args) {
+
+ return "new ArrayList(" + args.slice(1,-1).split("][").join(", ") + ")";
+
+ });
+
+
+
+ aCode = aCode.replace(/(?:static )?\w+\[\]\s*(\w+)\[?\]?\s*=\s*{.*?};/g, function(all) {
+
+ return all.replace(/{/g, "[").replace(/}/g, "]");
+
+ });
+
+
+
+ // int|float foo;
+
+ var intFloat = /(\n\s*(?:int|float)(?:\[\])?(?:\s*|[^\(]*?,\s*))([a-z]\w*)(;|,)/i;
+
+ while ( intFloat.test(aCode) ) {
+
+ aCode = aCode.replace(new RegExp(intFloat), function(all, type, name, sep) {
+
+ return type + " " + name + " = 0" + sep;
+
+ });
+
+ }
+
+
+
+ // float foo = 5;
+
+ aCode = aCode.replace(/(?:static )?(\w+)((?:\[\])+| ) *(\w+)\[?\]?(\s*[=,;])/g, function(all, type, arr, name, sep) {
+
+ if ( type == "return" )
+
+ return all;
+
+ else
+
+ return "var " + name + sep;
+
+ });
+
+
+
+ // Fix Array[] foo = {...} to [...]
+
+ aCode = aCode.replace(/=\s*{((.|\s)*?)};/g, function(all,data) {
+
+ return "= [" + data.replace(/{/g, "[").replace(/}/g, "]") + "]";
+
+ });
+
+
+
+ // static { ... } blocks
+
+ aCode = aCode.replace(/static\s*{((.|\n)*?)}/g, function(all, init) {
+
+ // Convert the static definitons to variable assignments
+
+ //return init.replace(/\((.*?)\)/g, " = $1");
+
+ return init;
+
+ });
+
+
+
+ // super() is a reserved word
+
+ aCode = aCode.replace(/super\(/g, "superMethod(");
+
+
+
+ var classes = ["int", "float", "boolean", "string"];
+
+
+
+ function ClassReplace(all, name, extend, vars, last) {
+
+ classes.push( name );
+
+
+
+ var static = "";
+
+
+
+ vars = vars.replace(/final\s+var\s+(\w+\s*=\s*.*?;)/g, function(all,set) {
+
+ static += " " + name + "." + set;
+
+ return "";
+
+ });
+
+
+
+ // Move arguments up from constructor and wrap contents with
+
+ // a with(this), and unwrap constructor
+
+ return "function " + name + "() {with(this){\n " +
+
+ (extend ? "var __self=this;function superMethod(){extendClass(__self,arguments," + extend + ");}\n" : "") +
+
+ // Replace var foo = 0; with this.foo = 0;
+
+ // and force var foo; to become this.foo = null;
+
+ vars
+
+ .replace(/,\s?/g, ";\n this.")
+
+ .replace(/\b(var |final |public )+\s*/g, "this.")
+
+ .replace(/this.(\w+);/g, "this.$1 = null;") +
+
+ (extend ? "extendClass(this, " + extend + ");\n" : "") +
+
+ "<CLASS " + name + " " + static + ">" + (typeof last == "string" ? last : name + "(");
+
+ }
+
+
+
+ var matchClasses = /(?:public |abstract |static )*class (\w+)\s*(?:extends\s*(\w+)\s*)?{\s*((?:.|\n)*?)\b\1\s*\(/g;
+
+ var matchNoCon = /(?:public |abstract |static )*class (\w+)\s*(?:extends\s*(\w+)\s*)?{\s*((?:.|\n)*?)(Processing)/g;
+
+
+
+ aCode = aCode.replace(matchClasses, ClassReplace);
+
+ aCode = aCode.replace(matchNoCon, ClassReplace);
+
+
+
+ var matchClass = /<CLASS (\w+) (.*?)>/, m;
+
+
+
+ while ( (m = aCode.match( matchClass )) ) {
+
+ var left = RegExp.leftContext,
+
+ allRest = RegExp.rightContext,
+
+ rest = nextBrace(allRest),
+
+ className = m[1],
+
+ staticVars = m[2] || "";
+
+
+
+ allRest = allRest.slice( rest.length + 1 );
+
+
+
+ rest = rest.replace(new RegExp("\\b" + className + "\\(([^\\)]*?)\\)\\s*{", "g"), function(all, args) {
+
+ args = args.split(/,\s*?/);
+
+
+
+ if ( args[0].match(/^\s*$/) )
+
+ args.shift();
+
+
+
+ var fn = "if ( arguments.length == " + args.length + " ) {\n";
+
+
+
+ for ( var i = 0; i < args.length; i++ ) {
+
+ fn += " var " + args[i] + " = arguments[" + i + "];\n";
+
+ }
+
+
+
+ return fn;
+
+ });
+
+
+
+ // Fix class method names
+
+ // this.collide = function() { ... }
+
+ // and add closing } for with(this) ...
+
+ rest = rest.replace(/(?:public )?Processing.\w+ = function (\w+)\((.*?)\)/g, function(all, name, args) {
+
+ return "ADDMETHOD(this, '" + name + "', function(" + args + ")";
+
+ });
+
+
+
+ var matchMethod = /ADDMETHOD([\s\S]*?{)/, mc;
+
+ var methods = "";
+
+
+
+ while ( (mc = rest.match( matchMethod )) ) {
+
+ var prev = RegExp.leftContext,
+
+ allNext = RegExp.rightContext,
+
+ next = nextBrace(allNext);
+
+
+
+ methods += "addMethod" + mc[1] + next + "});"
+
+
+
+ rest = prev + allNext.slice( next.length + 1 );
+
+ }
+
+
+
+ rest = methods + rest;
+
+
+
+ aCode = left + rest + "\n}}" + staticVars + allRest;
+
+ }
+
+
+
+ // Do some tidying up, where necessary
+
+ aCode = aCode.replace(/Processing.\w+ = function addMethod/g, "addMethod");
+
+
+
+ function nextBrace( right ) {
+
+ var rest = right;
+
+ var position = 0;
+
+ var leftCount = 1, rightCount = 0;
+
+
+
+ while ( leftCount != rightCount ) {
+
+ var nextLeft = rest.indexOf("{");
+
+ var nextRight = rest.indexOf("}");
+
+
+
+ if ( nextLeft < nextRight && nextLeft != -1 ) {
+
+ leftCount++;
+
+ rest = rest.slice( nextLeft + 1 );
+
+ position += nextLeft + 1;
+
+ } else {
+
+ rightCount++;
+
+ rest = rest.slice( nextRight + 1 );
+
+ position += nextRight + 1;
+
+ }
+
+ }
+
+
+
+ return right.slice(0, position - 1);
+
+ }
+
+
+
+ // Handle (int) Casting
+
+ aCode = aCode.replace(/\(int\)/g, "0|");
+
+
+
+ // Remove Casting
+
+ aCode = aCode.replace(new RegExp("\\((" + classes.join("|") + ")(\\[\\])?\\)", "g"), "");
+
+
+
+ // Convert 3.0f to just 3.0
+
+ aCode = aCode.replace(/(\d+)f/g, "$1");
+
+
+
+ // Force numbers to exist
+
+ //aCode = aCode.replace(/([^.])(\w+)\s*\+=/g, "$1$2 = ($2||0) +");
+
+
+
+ // Force characters-as-bytes to work
+
+ aCode = aCode.replace(/('[a-zA-Z0-9]')/g, "$1.charCodeAt(0)");
+
+
+
+ // Convert #aaaaaa into color
+
+ aCode = aCode.replace(/#([a-f0-9]{6})/ig, function(m, hex){
+
+ var num = toNumbers(hex);
+
+ return "color(" + num[0] + "," + num[1] + "," + num[2] + ")";
+
+ });
+
+
+
+ function toNumbers( str ){
+
+ var ret = [];
+
+ str.replace(/(..)/g, function(str){
+
+ ret.push( parseInt( str, 16 ) );
+
+ });
+
+ return ret;
+
+ }
+
+
+
+//log(aCode);
+
+
+
+ return aCode;
+
+};
+
+
+
+function buildProcessing( curElement ){
+
+
+
+ var p = {};
+
+
+
+ // init
+
+ p.PI = Math.PI;
+
+ p.TWO_PI = 2 * p.PI;
+
+ p.HALF_PI = p.PI / 2;
+ p.QUARTER_PI = p.PI / 4;
+
+ p.P3D = 3;
+
+ p.CORNER = 0;
+
+ p.RADIUS = 1;
+
+ p.CENTER_RADIUS = 1;
+
+ p.CENTER = 2;
+
+ p.POLYGON = 2;
+
+ p.QUADS = 5;
+
+ p.TRIANGLES = 6;
+
+ p.POINTS = 7;
+
+ p.LINES = 8;
+
+ p.TRIANGLE_STRIP = 9;
+
+ p.TRIANGLE_FAN = 4;
+
+ p.QUAD_STRIP = 3;
+
+ p.CORNERS = 10;
+
+ p.CLOSE = true;
+
+ p.RGB = 1;
+
+ p.HSB = 2;
+
+
+
+ // mouseButton constants: values adjusted to come directly from e.which
+
+ p.LEFT = 1;
+
+ p.CENTER = 2;
+
+ p.RIGHT = 3;
+
+
+
+ // "Private" variables used to maintain state
+
+ var curContext = curElement.getContext("2d");
+
+ var doFill = true;
+
+ var doStroke = true;
+
+ var loopStarted = false;
+
+ var hasBackground = false;
+
+ var doLoop = true;
+
+ var looping = 0;
+
+ var curRectMode = p.CORNER;
+
+ var curEllipseMode = p.CENTER;
+
+ var inSetup = false;
+
+ var inDraw = false;
+
+ var curBackground = "rgba(204,204,204,1)";
+
+ var curFrameRate = 1000;
+
+ var curShape = p.POLYGON;
+
+ var curShapeCount = 0;
+
+ var curvePoints = [];
+
+ var curTightness = 0;
+
+ var opacityRange = 255;
+
+ var redRange = 255;
+
+ var greenRange = 255;
+
+ var blueRange = 255;
+
+ var pathOpen = false;
+
+ var mousePressed = false;
+
+ var keyPressed = false;
+
+ var firstX, firstY, secondX, secondY, prevX, prevY;
+
+ var curColorMode = p.RGB;
+
+ var curTint = -1;
+
+ var curTextSize = 12;
+
+ var curTextFont = "Arial";
+
+ var getLoaded = false;
+
+ var start = (new Date).getTime();
+
+
+
+ // Global vars for tracking mouse position
+
+ p.pmouseX = 0;
+
+ p.pmouseY = 0;
+
+ p.mouseX = 0;
+
+ p.mouseY = 0;
+
+ p.mouseButton = 0;
+
+
+
+ // Will be replaced by the user, most likely
+
+ p.mouseDragged = undefined;
+
+ p.mouseMoved = undefined;
+
+ p.mousePressed = undefined;
+
+ p.mouseReleased = undefined;
+
+ p.keyPressed = undefined;
+
+ p.keyReleased = undefined;
+
+ p.draw = undefined;
+
+ p.setup = undefined;
+
+
+
+ // The height/width of the canvas
+
+ p.width = curElement.width - 0;
+
+ p.height = curElement.height - 0;
+
+
+
+ // The current animation frame
+
+ p.frameCount = 0;
+
+
+
+ // In case I ever need to do HSV conversion:
+
+ // http://srufaculty.sru.edu/david.dailey/javascript/js/5rml.js
+
+ p.color = function color( aValue1, aValue2, aValue3, aValue4 ) {
+
+ var aColor = "";
+
+
+
+ if ( arguments.length == 3 ) {
+
+ aColor = p.color( aValue1, aValue2, aValue3, opacityRange );
+
+ } else if ( arguments.length == 4 ) {
+
+ var a = aValue4 / opacityRange;
+
+ a = isNaN(a) ? 1 : a;
+
+
+
+ if ( curColorMode == p.HSB ) {
+
+ var rgb = HSBtoRGB(aValue1, aValue2, aValue3);
+
+ var r = rgb[0], g = rgb[1], b = rgb[2];
+
+ } else {
+
+ var r = getColor(aValue1, redRange);
+
+ var g = getColor(aValue2, greenRange);
+
+ var b = getColor(aValue3, blueRange);
+
+ }
+
+
+
+ aColor = "rgba(" + r + "," + g + "," + b + "," + a + ")";
+
+ } else if ( typeof aValue1 == "string" ) {
+
+ aColor = aValue1;
+
+
+
+ if ( arguments.length == 2 ) {
+
+ var c = aColor.split(",");
+
+ c[3] = (aValue2 / opacityRange) + ")";
+
+ aColor = c.join(",");
+
+ }
+
+ } else if ( arguments.length == 2 ) {
+
+ aColor = p.color( aValue1, aValue1, aValue1, aValue2 );
+
+ } else if ( typeof aValue1 == "number" ) {
+
+ aColor = p.color( aValue1, aValue1, aValue1, opacityRange );
+
+ } else {
+
+ aColor = p.color( redRange, greenRange, blueRange, opacityRange );
+
+ }
+
+
+
+ // HSB conversion function from Mootools, MIT Licensed
+
+ function HSBtoRGB(h, s, b) {
+
+ h = (h / redRange) * 100;
+
+ s = (s / greenRange) * 100;
+
+ b = (b / blueRange) * 100;
+
+ if (s == 0){
+
+ return [b, b, b];
+
+ } else {
+
+ var hue = h % 360;
+
+ var f = hue % 60;
+
+ var br = Math.round(b / 100 * 255);
+
+ var p = Math.round((b * (100 - s)) / 10000 * 255);
+
+ var q = Math.round((b * (6000 - s * f)) / 600000 * 255);
+
+ var t = Math.round((b * (6000 - s * (60 - f))) / 600000 * 255);
+
+ switch (Math.floor(hue / 60)){
+
+ case 0: return [br, t, p];
+
+ case 1: return [q, br, p];
+
+ case 2: return [p, br, t];
+
+ case 3: return [p, q, br];
+
+ case 4: return [t, p, br];
+
+ case 5: return [br, p, q];
+
+ }
+
+ }
+
+ }
+
+
+
+ function getColor( aValue, range ) {
+
+ return Math.round(255 * (aValue / range));
+
+ }
+
+
+
+ return aColor;
+
+ }
+
+
+
+ p.nf = function( num, pad ) {
+
+ var str = "" + num;
+
+ while ( pad - str.length )
+
+ str = "0" + str;
+
+ return str;
+
+ };
+
+
+
+ p.AniSprite = function( prefix, frames ) {
+
+ this.images = [];
+
+ this.pos = 0;
+
+
+
+ for ( var i = 0; i < frames; i++ ) {
+
+ this.images.push( prefix + p.nf( i, ("" + frames).length ) + ".gif" );
+
+ }
+
+
+
+ this.display = function( x, y ) {
+
+ p.image( this.images[ this.pos ], x, y );
+
+
+
+ if ( ++this.pos >= frames )
+
+ this.pos = 0;
+
+ };
+
+
+
+ this.getWidth = function() {
+
+ return getImage(this.images[0]).width;
+
+ };
+
+
+
+ this.getHeight = function() {
+
+ return getImage(this.images[0]).height;
+
+ };
+
+ };
+
+
+
+ function buildImageObject( obj ) {
+
+ var pixels = obj.data;
+
+ var data = p.createImage( obj.width, obj.height );
+
+
+
+ if ( data.__defineGetter__ && data.__lookupGetter__ && !data.__lookupGetter__("pixels") ) {
+
+ var pixelsDone;
+
+ data.__defineGetter__("pixels", function() {
+
+ if ( pixelsDone )
+
+ return pixelsDone;
+
+
+
+ pixelsDone = [];
+
+
+
+ for ( var i = 0; i < pixels.length; i += 4 ) {
+
+ pixelsDone.push( p.color(pixels[i], pixels[i+1], pixels[i+2], pixels[i+3]) );
+
+ }
+
+
+
+ return pixelsDone;
+
+ });
+
+ } else {
+
+ data.pixels = [];
+
+
+
+ for ( var i = 0; i < pixels.length; i += 4 ) {
+
+ data.pixels.push( p.color(pixels[i], pixels[i+1], pixels[i+2], pixels[i+3]) );
+
+ }
+
+ }
+
+
+
+ return data;
+
+ }
+
+
+
+ p.createImage = function createImage( w, h, mode ) {
+
+ var data = {};
+
+ data.width = w;
+
+ data.height = h;
+
+ data.data = [];
+
+
+
+ if ( curContext.createImageData ) {
+
+ data = curContext.createImageData( w, h );
+
+ }
+
+
+
+ data.pixels = new Array( w * h );
+
+ data.get = function(x,y) {
+
+ return this.pixels[w*y+x];
+
+ };
+
+ data._mask = null;
+
+ data.mask = function(img) {
+
+ this._mask = img;
+
+ };
+
+ data.loadPixels = function(){};
+
+ data.updatePixels = function(){};
+
+
+
+ return data;
+
+ };
+
+
+
+ p.createGraphics = function createGraphics( w, h ) {
+
+ var canvas = document.createElement("canvas");
+
+ var ret = buildProcessing( canvas );
+
+ ret.size( w, h );
+
+ ret.canvas = canvas;
+
+ return ret;
+
+ };
+
+
+
+ p.beginDraw = function beginDraw(){};
+
+
+
+ p.endDraw = function endDraw(){};
+
+
+
+ p.tint = function tint( rgb, a ) {
+
+ curTint = a;
+
+ };
+
+
+
+ function getImage( img ) {
+
+ if ( typeof img == "string" ) {
+
+ return document.getElementById(img);
+
+ }
+
+
+
+ if ( img.img || img.canvas ) {
+
+ return img.img || img.canvas;
+
+ }
+
+
+
+ for ( var i = 0, l = img.pixels.length; i < l; i++ ) {
+
+ var pos = i * 4;
+
+ var c = (img.pixels[i] || "rgba(0,0,0,1)").slice(5,-1).split(",");
+
+ img.data[pos] = parseInt(c[0]);
+
+ img.data[pos+1] = parseInt(c[1]);
+
+ img.data[pos+2] = parseInt(c[2]);
+
+ img.data[pos+3] = parseFloat(c[3]) * 100;
+
+ }
+
+
+
+ var canvas = document.createElement("canvas")
+
+ canvas.width = img.width;
+
+ canvas.height = img.height;
+
+ var context = canvas.getContext("2d");
+
+ context.putImageData( img, 0, 0 );
+
+
+
+ img.canvas = canvas;
+
+
+
+ return canvas;
+
+ }
+
+
+
+ p.image = function image( img, x, y, w, h ) {
+
+ x = x || 0;
+
+ y = y || 0;
+
+
+
+ var obj = getImage(img);
+
+
+
+ if ( curTint >= 0 ) {
+
+ var oldAlpha = curContext.globalAlpha;
+
+ curContext.globalAlpha = curTint / opacityRange;
+
+ }
+
+
+
+ if ( arguments.length == 3 ) {
+
+ curContext.drawImage( obj, x, y );
+
+ } else {
+
+ curContext.drawImage( obj, x, y, w, h );
+
+ }
+
+
+
+ if ( curTint >= 0 ) {
+
+ curContext.globalAlpha = oldAlpha;
+
+ }
+
+
+
+ if ( img._mask ) {
+
+ var oldComposite = curContext.globalCompositeOperation;
+
+ curContext.globalCompositeOperation = "darker";
+
+ p.image( img._mask, x, y );
+
+ curContext.globalCompositeOperation = oldComposite;
+
+ }
+
+ };
+
+
+
+ p.exit = function exit() {
+
+ clearInterval(looping);
+
+ };
+
+
+
+ p.save = function save( file ){};
+
+
+
+ p.loadImage = function loadImage( file ) {
+
+ var img = document.getElementById(file);
+
+ if ( !img )
+
+ return;
+
+
+
+ var h = img.height, w = img.width;
+
+
+
+ var canvas = document.createElement("canvas");
+
+ canvas.width = w;
+
+ canvas.height = h;
+
+ var context = canvas.getContext("2d");
+
+
+
+ context.drawImage( img, 0, 0 );
+
+ var data = buildImageObject( context.getImageData( 0, 0, w, h ) );
+
+ data.img = img;
+
+ return data;
+
+ };
+
+
+
+ p.loadFont = function loadFont( name ) {
+
+ return {
+
+ name: name,
+
+ width: function( str ) {
+
+ if ( curContext.mozMeasureText )
+
+ return curContext.mozMeasureText( typeof str == "number" ?
+
+ String.fromCharCode( str ) :
+
+ str) / curTextSize;
+
+ else
+
+ return 0;
+
+ }
+
+ };
+
+ };
+
+
+
+ p.textFont = function textFont( name, size ) {
+
+ curTextFont = name;
+
+ p.textSize( size );
+
+ };
+
+
+
+ p.textSize = function textSize( size ) {
+
+ if ( size ) {
+
+ curTextSize = size;
+
+ }
+
+ };
+
+
+
+ p.textAlign = function textAlign(){};
+
+
+
+ p.text = function text( str, x, y ) {
+
+ if ( str && curContext.mozDrawText ) {
+
+ curContext.save();
+
+ curContext.mozTextStyle = curTextSize + "px " + curTextFont.name;
+
+ curContext.translate(x, y);
+
+ curContext.mozDrawText( typeof str == "number" ?
+
+ String.fromCharCode( str ) :
+
+ str );
+
+ curContext.restore();
+
+ }
+
+ };
+
+
+
+ p.char = function char( key ) {
+
+ return key;
+
+ };
+
+
+
+ p.println = function println(){};
+
+
+
+ p.map = function map( value, istart, istop, ostart, ostop ) {
+
+ return ostart + (ostop - ostart) * ((value - istart) / (istop - istart));
+
+ };
+
+
+
+ String.prototype.replaceAll = function(re, replace) {
+
+ return this.replace(new RegExp(re, "g"), replace);
+
+ };
+
+
+
+ p.Point = function Point( x, y ) {
+
+ this.x = x;
+
+ this.y = y;
+
+ this.copy = function() {
+
+ return new Point( x, y );
+
+ }
+
+ };
+
+
+
+ p.Random = function() {
+
+ var haveNextNextGaussian = false;
+
+ var nextNextGaussian;
+
+
+
+ this.nextGaussian = function() {
+
+ if (haveNextNextGaussian) {
+
+ haveNextNextGaussian = false;
+
+
+
+ return nextNextGaussian;
+
+ } else {
+
+ var v1, v2, s;
+
+ do {
+
+ v1 = 2 * p.random(1) - 1; // between -1.0 and 1.0
+
+ v2 = 2 * p.random(1) - 1; // between -1.0 and 1.0
+
+ s = v1 * v1 + v2 * v2;
+
+ } while (s >= 1 || s == 0);
+
+ var multiplier = Math.sqrt(-2 * Math.log(s)/s);
+
+ nextNextGaussian = v2 * multiplier;
+
+ haveNextNextGaussian = true;
+
+
+
+ return v1 * multiplier;
+
+ }
+
+ };
+
+ };
+
+
+
+ p.ArrayList = function ArrayList( size, size2, size3 ) {
+
+ var array = new Array( 0 | size );
+
+
+
+ if ( size2 ) {
+
+ for ( var i = 0; i < size; i++ ) {
+
+ array[i] = [];
+
+
+
+ for ( var j = 0; j < size2; j++ ) {
+
+ var a = array[i][j] = size3 ? new Array( size3 ) : 0;
+
+ for ( var k = 0; k < size3; k++ ) {
+
+ a[k] = 0;
+
+ }
+
+ }
+
+ }
+
+ } else {
+
+ for ( var i = 0; i < size; i++ ) {
+
+ array[i] = 0;
+
+ }
+
+ }
+
+
+
+ array.size = function() {
+
+ return this.length;
+
+ };
+
+ array.get = function( i ) {
+
+ return this[ i ];
+
+ };
+
+ array.remove = function( i ) {
+
+ return this.splice( i, 1 );
+
+ };
+
+ array.add = function( item ) {
+
+ return this.push( item );
+
+ };
+
+ array.clone = function() {
+
+ var a = new ArrayList( size );
+
+ for ( var i = 0; i < size; i++ ) {
+
+ a[ i ] = this[ i ];
+
+ }
+
+ return a;
+
+ };
+
+ array.isEmpty = function() {
+
+ return !this.length;
+
+ };
+
+ array.clear = function() {
+
+ this.length = 0;
+
+ };
+
+
+
+ return array;
+
+ };
+
+
+
+ p.colorMode = function colorMode( mode, range1, range2, range3, range4 ) {
+
+ curColorMode = mode;
+
+
+
+ if ( arguments.length >= 4 ) {
+
+ redRange = range1;
+
+ greenRange = range2;
+
+ blueRange = range3;
+
+ }
+
+
+
+ if ( arguments.length == 5 ) {
+
+ opacityRange = range4;
+
+ }
+
+
+
+ if ( arguments.length == 2 ) {
+
+ p.colorMode( mode, range1, range1, range1, range1 );
+
+ }
+
+ };
+
+
+
+ p.beginShape = function beginShape( type ) {
+
+ curShape = type;
+
+ curShapeCount = 0;
+
+ curvePoints = [];
+
+ };
+
+
+
+ p.endShape = function endShape( close ) {
+
+ if ( curShapeCount != 0 ) {
+
+ if ( close || doFill )
+
+ curContext.lineTo( firstX, firstY );
+
+
+
+ if ( doFill )
+
+ curContext.fill();
+
+
+
+ if ( doStroke )
+
+ curContext.stroke();
+
+
+
+ curContext.closePath();
+
+ curShapeCount = 0;
+
+ pathOpen = false;
+
+ }
+
+
+
+ if ( pathOpen ) {
+
+ if ( doFill )
+
+ curContext.fill();
+
+
+
+ if ( doStroke )
+
+ curContext.stroke();
+
+
+
+ curContext.closePath();
+
+ curShapeCount = 0;
+
+ pathOpen = false;
+
+ }
+
+ };
+
+
+
+ p.vertex = function vertex( x, y, x2, y2, x3, y3 ) {
+
+ if ( curShapeCount == 0 && curShape != p.POINTS ) {
+
+ pathOpen = true;
+
+ curContext.beginPath();
+
+ curContext.moveTo( x, y );
+
+ firstX = x;
+
+ firstY = y;
+
+ } else {
+
+ if ( curShape == p.POINTS ) {
+
+ p.point( x, y );
+
+ } else if ( arguments.length == 2 ) {
+
+ if ( curShape != p.QUAD_STRIP || curShapeCount != 2 )
+
+ curContext.lineTo( x, y );
+
+
+
+ if ( curShape == p.TRIANGLE_STRIP ) {
+
+ if ( curShapeCount == 2 ) {
+
+ // finish shape
+
+ p.endShape(p.CLOSE);
+
+ pathOpen = true;
+
+ curContext.beginPath();
+
+
+
+ // redraw last line to start next shape
+
+ curContext.moveTo( prevX, prevY );
+
+ curContext.lineTo( x, y );
+
+ curShapeCount = 1;
+
+ }
+
+ firstX = prevX;
+
+ firstY = prevY;
+
+ }
+
+
+
+ if ( curShape == p.TRIANGLE_FAN && curShapeCount == 2 ) {
+
+ // finish shape
+
+ p.endShape(p.CLOSE);
+
+ pathOpen = true;
+
+ curContext.beginPath();
+
+
+
+ // redraw last line to start next shape
+
+ curContext.moveTo( firstX, firstY );
+
+ curContext.lineTo( x, y );
+
+ curShapeCount = 1;
+
+ }
+
+
+
+ if ( curShape == p.QUAD_STRIP && curShapeCount == 3 ) {
+
+ // finish shape
+
+ curContext.lineTo( prevX, prevY );
+
+ p.endShape(p.CLOSE);
+
+ pathOpen = true;
+
+ curContext.beginPath();
+
+
+
+ // redraw lines to start next shape
+
+ curContext.moveTo( prevX, prevY );
+
+ curContext.lineTo( x, y );
+
+ curShapeCount = 1;
+
+ }
+
+
+
+ if ( curShape == p.QUAD_STRIP) {
+
+ firstX = secondX;
+
+ firstY = secondY;
+
+ secondX = prevX;
+
+ secondY = prevY;
+
+ }
+
+ } else if ( arguments.length == 4 ) {
+
+ if ( curShapeCount > 1 ) {
+
+ curContext.moveTo( prevX, prevY );
+
+ curContext.quadraticCurveTo( firstX, firstY, x, y );
+
+ curShapeCount = 1;
+
+ }
+
+ } else if ( arguments.length == 6 ) {
+
+ curContext.bezierCurveTo( x, y, x2, y2, x3, y3 );
+
+ curShapeCount = -1;
+
+ }
+
+ }
+
+
+
+ prevX = x;
+
+ prevY = y;
+
+ curShapeCount++;
+
+
+
+ if ( curShape == p.LINES && curShapeCount == 2 ||
+
+ (curShape == p.TRIANGLES) && curShapeCount == 3 ||
+
+ (curShape == p.QUADS) && curShapeCount == 4 ) {
+
+ p.endShape(p.CLOSE);
+
+ }
+
+ };
+
+
+
+ p.curveVertex = function( x, y, x2, y2 ) {
+
+ if ( curvePoints.length < 3 ) {
+
+ curvePoints.push([x,y]);
+
+ } else {
+
+ var b = [], s = 1 - curTightness;
+
+
+
+ /*
+
+ * Matrix to convert from Catmull-Rom to cubic Bezier
+
+ * where t = curTightness
+
+ * |0 1 0 0 |
+
+ * |(t-1)/6 1 (1-t)/6 0 |
+
+ * |0 (1-t)/6 1 (t-1)/6 |
+
+ * |0 0 0 0 |
+
+ */
+
+
+
+ curvePoints.push([x,y]);
+
+
+
+ b[0] = [curvePoints[1][0],curvePoints[1][1]];
+
+ b[1] = [curvePoints[1][0]+(s*curvePoints[2][0]-s*curvePoints[0][0])/6,curvePoints[1][1]+(s*curvePoints[2][1]-s*curvePoints[0][1])/6];
+
+ b[2] = [curvePoints[2][0]+(s*curvePoints[1][0]-s*curvePoints[3][0])/6,curvePoints[2][1]+(s*curvePoints[1][1]-s*curvePoints[3][1])/6];
+
+ b[3] = [curvePoints[2][0],curvePoints[2][1]];
+
+
+
+ if ( !pathOpen ) {
+
+ p.vertex( b[0][0], b[0][1] );
+
+ } else {
+
+ curShapeCount = 1;
+
+ }
+
+
+
+ p.vertex( b[1][0], b[1][1], b[2][0], b[2][1], b[3][0], b[3][1] );
+
+ curvePoints.shift();
+
+ }
+
+ };
+
+
+
+ p.curveTightness = function( tightness ) {
+
+ curTightness = tightness;
+
+ };
+
+
+
+ p.bezierVertex = p.vertex;
+
+
+
+ p.rectMode = function rectMode( aRectMode ) {
+
+ curRectMode = aRectMode;
+
+ };
+
+
+
+ p.imageMode = function(){};
+
+
+
+ p.ellipseMode = function ellipseMode( aEllipseMode ) {
+
+ curEllipseMode = aEllipseMode;
+
+ };
+
+
+
+ p.dist = function dist( x1, y1, x2, y2 ) {
+
+ return Math.sqrt( Math.pow( x2 - x1, 2 ) + Math.pow( y2 - y1, 2 ) );
+
+ };
+
+
+
+ p.year = function year() {
+
+ return (new Date).getYear() + 1900;
+
+ };
+
+
+
+ p.month = function month() {
+
+ return (new Date).getMonth();
+
+ };
+
+
+
+ p.day = function day() {
+
+ return (new Date).getDay();
+
+ };
+
+
+
+ p.hour = function hour() {
+
+ return (new Date).getHours();
+
+ };
+
+
+
+ p.minute = function minute() {
+
+ return (new Date).getMinutes();
+
+ };
+
+
+
+ p.second = function second() {
+
+ return (new Date).getSeconds();
+
+ };
+
+
+
+ p.millis = function millis() {
+
+ return (new Date).getTime() - start;
+
+ };
+
+
+
+ p.ortho = function ortho(){};
+
+
+
+ p.translate = function translate( x, y ) {
+
+ curContext.translate( x, y );
+
+ };
+
+
+
+ p.scale = function scale( x, y ) {
+
+ curContext.scale( x, y || x );
+
+ };
+
+
+
+ p.rotate = function rotate( aAngle ) {
+
+ curContext.rotate( aAngle );
+
+ };
+
+
+
+ p.pushMatrix = function pushMatrix() {
+
+ curContext.save();
+
+ };
+
+
+
+ p.popMatrix = function popMatrix() {
+
+ curContext.restore();
+
+ };
+
+
+
+ p.redraw = function redraw() {
+
+ if ( hasBackground ) {
+
+ p.background();
+
+ }
+
+
+
+ p.frameCount++;
+
+
+
+ inDraw = true;
+
+ p.pushMatrix();
+
+ p.draw();
+
+ p.popMatrix();
+
+ inDraw = false;
+
+ };
+
+
+
+ p.loop = function loop() {
+
+ if ( loopStarted )
+
+ return;
+
+
+
+ looping = setInterval(function() {
+
+ try {
+
+ p.redraw();
+
+ }
+
+ catch(e) {
+
+ clearInterval( looping );
+
+ throw e;
+
+ }
+
+ }, 1000 / curFrameRate );
+
+
+
+ loopStarted = true;
+
+ };
+
+
+
+ p.frameRate = function frameRate( aRate ) {
+
+ curFrameRate = aRate;
+
+ };
+
+
+
+ p.background = function background( img ) {
+
+ if ( arguments.length ) {
+
+ if ( img && img.img ) {
+
+ curBackground = img;
+
+ } else {
+
+ curBackground = p.color.apply( this, arguments );
+
+ }
+
+ }
+
+
+
+
+
+ if ( curBackground.img ) {
+
+ p.image( curBackground, 0, 0 );
+
+ } else {
+
+ var oldFill = curContext.fillStyle;
+
+ curContext.fillStyle = curBackground + "";
+
+ curContext.fillRect( 0, 0, p.width, p.height );
+
+ curContext.fillStyle = oldFill;
+
+ }
+
+ };
+
+
+
+ p.sq = function sq( aNumber ) {
+
+ return aNumber * aNumber;
+
+ };
+
+
+
+ p.sqrt = function sqrt( aNumber ) {
+
+ return Math.sqrt( aNumber );
+
+ };
+
+
+
+ p.int = function int( aNumber ) {
+
+ return Math.floor( aNumber );
+
+ };
+
+
+
+ p.min = function min( aNumber, aNumber2 ) {
+
+ return Math.min( aNumber, aNumber2 );
+
+ };
+
+
+
+ p.max = function max( aNumber, aNumber2 ) {
+
+ return Math.max( aNumber, aNumber2 );
+
+ };
+
+
+
+ p.ceil = function ceil( aNumber ) {
+
+ return Math.ceil( aNumber );
+
+ };
+
+
+
+ p.round = function round( aNumber ) {
+
+ return Math.round( aNumber );
+
+ };
+
+
+
+ p.floor = function floor( aNumber ) {
+
+ return Math.floor( aNumber );
+
+ };
+
+
+
+ p.float = function float( aNumber ) {
+
+ return typeof aNumber == "string" ?
+
+ p.float( aNumber.charCodeAt(0) ) :
+
+ parseFloat( aNumber );
+
+ };
+
+
+
+ p.byte = function byte( aNumber ) {
+
+ return aNumber || 0;
+
+ };
+
+
+
+ p.random = function random( aMin, aMax ) {
+
+ return arguments.length == 2 ?
+
+ aMin + (Math.random() * (aMax - aMin)) :
+
+ Math.random() * aMin;
+
+ };
+
+
+
+ // From: http://freespace.virgin.net/hugo.elias/models/m_perlin.htm
+
+ p.noise = function( x, y, z ) {
+
+ return arguments.length >= 2 ?
+
+ PerlinNoise_2D( x, y ) :
+
+ PerlinNoise_2D( x, x );
+
+ };
+
+
+
+ function Noise(x, y) {
+
+ var n = x + y * 57;
+
+ n = (n<<13) ^ n;
+
+ return Math.abs(1.0 - (((n * ((n * n * 15731) + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0));
+
+ };
+
+
+
+ function SmoothedNoise(x, y) {
+
+ var corners = ( Noise(x-1, y-1)+Noise(x+1, y-1)+Noise(x-1, y+1)+Noise(x+1, y+1) ) / 16;
+
+ var sides = ( Noise(x-1, y) +Noise(x+1, y) +Noise(x, y-1) +Noise(x, y+1) ) / 8;
+
+ var center = Noise(x, y) / 4;
+
+ return corners + sides + center;
+
+ };
+
+
+
+ function InterpolatedNoise(x, y) {
+
+ var integer_X = Math.floor(x);
+
+ var fractional_X = x - integer_X;
+
+
+
+ var integer_Y = Math.floor(y);
+
+ var fractional_Y = y - integer_Y;
+
+
+
+ var v1 = SmoothedNoise(integer_X, integer_Y);
+
+ var v2 = SmoothedNoise(integer_X + 1, integer_Y);
+
+ var v3 = SmoothedNoise(integer_X, integer_Y + 1);
+
+ var v4 = SmoothedNoise(integer_X + 1, integer_Y + 1);
+
+
+
+ var i1 = Interpolate(v1 , v2 , fractional_X);
+
+ var i2 = Interpolate(v3 , v4 , fractional_X);
+
+
+
+ return Interpolate(i1 , i2 , fractional_Y);
+
+ }
+
+
+
+ function PerlinNoise_2D(x, y) {
+
+ var total = 0;
+
+ var p = 0.25;
+
+ var n = 3;
+
+
+
+ for ( var i = 0; i <= n; i++ ) {
+
+ var frequency = Math.pow(2, i);
+
+ var amplitude = Math.pow(p, i);
+
+
+
+ total = total + InterpolatedNoise(x * frequency, y * frequency) * amplitude;
+
+ }
+
+
+
+ return total;
+
+ }
+
+
+
+ function Interpolate(a, b, x) {
+
+ var ft = x * p.PI;
+
+ var f = (1 - p.cos(ft)) * .5;
+
+ return a*(1-f) + b*f;
+
+ }
+
+
+
+ p.red = function( aColor ) {
+
+ return parseInt(aColor.slice(5));
+
+ };
+
+
+
+ p.green = function( aColor ) {
+
+ return parseInt(aColor.split(",")[1]);
+
+ };
+
+
+
+ p.blue = function( aColor ) {
+
+ return parseInt(aColor.split(",")[2]);
+
+ };
+
+
+
+ p.alpha = function( aColor ) {
+
+ return parseInt(aColor.split(",")[3]);
+
+ };
+
+
+
+ p.abs = function abs( aNumber ) {
+
+ return Math.abs( aNumber );
+
+ };
+
+
+
+ p.cos = function cos( aNumber ) {
+
+ return Math.cos( aNumber );
+
+ };
+
+
+
+ p.sin = function sin( aNumber ) {
+
+ return Math.sin( aNumber );
+
+ };
+
+
+
+ p.pow = function pow( aNumber, aExponent ) {
+
+ return Math.pow( aNumber, aExponent );
+
+ };
+
+
+
+ p.constrain = function constrain( aNumber, aMin, aMax ) {
+
+ return Math.min( Math.max( aNumber, aMin ), aMax );
+
+ };
+
+
+
+ p.sqrt = function sqrt( aNumber ) {
+
+ return Math.sqrt( aNumber );
+
+ };
+
+
+
+ p.atan2 = function atan2( aNumber, aNumber2 ) {
+
+ return Math.atan2( aNumber, aNumber2 );
+
+ };
+
+
+
+ p.radians = function radians( aAngle ) {
+
+ return ( aAngle / 180 ) * p.PI;
+
+ };
+
+
+
+ p.size = function size( aWidth, aHeight ) {
+
+ var fillStyle = curContext.fillStyle;
+
+ var strokeStyle = curContext.strokeStyle;
+
+
+
+ curElement.width = p.width = aWidth;
+
+ curElement.height = p.height = aHeight;
+
+
+
+ curContext.fillStyle = fillStyle;
+
+ curContext.strokeStyle = strokeStyle;
+
+ };
+
+
+
+ p.noStroke = function noStroke() {
+
+ doStroke = false;
+
+ };
+
+
+
+ p.noFill = function noFill() {
+
+ doFill = false;
+
+ };
+
+
+
+ p.smooth = function smooth(){};
+
+
+
+ p.noLoop = function noLoop() {
+
+ doLoop = false;
+
+ };
+
+
+
+ p.fill = function fill() {
+
+ doFill = true;
+
+ curContext.fillStyle = p.color.apply( this, arguments );
+
+ };
+
+
+
+ p.stroke = function stroke() {
+
+ doStroke = true;
+
+ curContext.strokeStyle = p.color.apply( this, arguments );
+
+ };
+
+
+
+ p.strokeWeight = function strokeWeight( w ) {
+
+ curContext.lineWidth = w;
+
+ };
+
+
+
+ p.point = function point( x, y ) {
+
+ var oldFill = curContext.fillStyle;
+
+ curContext.fillStyle = curContext.strokeStyle;
+
+ curContext.fillRect( Math.round( x ), Math.round( y ), 1, 1 );
+
+ curContext.fillStyle = oldFill;
+
+ };
+
+
+
+ p.get = function get( x, y ) {
+
+ if ( arguments.length == 0 ) {
+
+ var c = p.createGraphics( p.width, p.height );
+
+ c.image( curContext, 0, 0 );
+
+ return c;
+
+ }
+
+
+
+ if ( !getLoaded ) {
+
+ getLoaded = buildImageObject( curContext.getImageData(0, 0, p.width, p.height) );
+
+ }
+
+
+
+ return getLoaded.get( x, y );
+
+ };
+
+
+
+ p.set = function set( x, y, obj ) {
+
+ if ( obj && obj.img ) {
+
+ p.image( obj, x, y );
+
+ } else {
+
+ var oldFill = curContext.fillStyle;
+
+ var color = obj;
+
+ curContext.fillStyle = color;
+
+ curContext.fillRect( Math.round( x ), Math.round( y ), 1, 1 );
+
+ curContext.fillStyle = oldFill;
+
+ }
+
+ };
+
+
+
+ p.arc = function arc( x, y, width, height, start, stop ) {
+
+ if ( width <= 0 )
+
+ return;
+
+
+
+ if ( curEllipseMode == p.CORNER ) {
+
+ x += width / 2;
+
+ y += height / 2;
+
+ }
+
+
+
+ curContext.beginPath();
+
+
+
+ //curContext.moveTo( x, y );
+
+ curContext.arc( x, y, curEllipseMode == p.CENTER_RADIUS ? width : width/2, start, stop, false );
+
+
+
+ if ( doFill )
+
+ curContext.fill();
+
+
+
+ if ( doStroke )
+
+ curContext.stroke();
+
+
+
+ curContext.closePath();
+
+ };
+
+
+
+ p.line = function line( x1, y1, x2, y2 ) {
+
+ curContext.lineCap = "round";
+
+ curContext.beginPath();
+
+
+
+ curContext.moveTo( x1 || 0, y1 || 0 );
+
+ curContext.lineTo( x2 || 0, y2 || 0 );
+
+
+
+ curContext.stroke();
+
+
+
+ curContext.closePath();
+
+ };
+
+
+
+ p.bezier = function bezier( x1, y1, x2, y2, x3, y3, x4, y4 ) {
+
+ curContext.lineCap = "butt";
+
+ curContext.beginPath();
+
+
+
+ curContext.moveTo( x1, y1 );
+
+ curContext.bezierCurveTo( x2, y2, x3, y3, x4, y4 );
+
+
+
+ curContext.stroke();
+
+
+
+ curContext.closePath();
+
+ };
+
+
+
+ p.triangle = function triangle( x1, y1, x2, y2, x3, y3 ) {
+
+ p.beginShape();
+
+ p.vertex( x1, y1 );
+
+ p.vertex( x2, y2 );
+
+ p.vertex( x3, y3 );
+
+ p.endShape();
+
+ };
+
+
+
+ p.quad = function quad( x1, y1, x2, y2, x3, y3, x4, y4 ) {
+
+ p.beginShape();
+
+ p.vertex( x1, y1 );
+
+ p.vertex( x2, y2 );
+
+ p.vertex( x3, y3 );
+
+ p.vertex( x4, y4 );
+
+ p.endShape();
+
+ };
+
+
+
+ p.rect = function rect( x, y, width, height ) {
+
+ if ( width == 0 && height == 0 )
+
+ return;
+
+
+
+ curContext.beginPath();
+
+
+
+ var offsetStart = 0;
+
+ var offsetEnd = 0;
+
+
+
+ if ( curRectMode == p.CORNERS ) {
+
+ width -= x;
+
+ height -= y;
+
+ }
+
+
+
+ if ( curRectMode == p.RADIUS ) {
+
+ width *= 2;
+
+ height *= 2;
+
+ }
+
+
+
+ if ( curRectMode == p.CENTER || curRectMode == p.RADIUS ) {
+
+ x -= width / 2;
+
+ y -= height / 2;
+
+ }
+
+
+
+ curContext.rect(
+
+ Math.round( x ) - offsetStart,
+
+ Math.round( y ) - offsetStart,
+
+ Math.round( width ) + offsetEnd,
+
+ Math.round( height ) + offsetEnd
+
+ );
+
+
+
+ if ( doFill )
+
+ curContext.fill();
+
+
+
+ if ( doStroke )
+
+ curContext.stroke();
+
+
+
+ curContext.closePath();
+
+ };
+
+
+
+ p.ellipse = function ellipse( x, y, width, height ) {
+
+ x = x || 0;
+
+ y = y || 0;
+
+
+
+ if ( width <= 0 && height <= 0 )
+
+ return;
+
+
+
+ curContext.beginPath();
+
+
+
+ if ( curEllipseMode == p.RADIUS ) {
+
+ width *= 2;
+
+ height *= 2;
+
+ }
+
+
+
+ var offsetStart = 0;
+
+
+
+ // Shortcut for drawing a circle
+
+ if ( width == height )
+
+ curContext.arc( x - offsetStart, y - offsetStart, width / 2, 0, Math.PI * 2, false );
+
+
+
+ if ( doFill )
+
+ curContext.fill();
+
+
+
+ if ( doStroke )
+
+ curContext.stroke();
+
+
+
+ curContext.closePath();
+
+ };
+
+
+
+ p.link = function( href, target ) {
+
+ window.location = href;
+
+ };
+
+
+
+ p.loadPixels = function() {
+
+ p.pixels = buildImageObject( curContext.getImageData(0, 0, p.width, p.height) ).pixels;
+
+ };
+
+
+
+ p.updatePixels = function() {
+
+ var colors = /(\d+),(\d+),(\d+),(\d+)/;
+
+ var pixels = {};
+
+ pixels.width = p.width;
+
+ pixels.height = p.height;
+
+ pixels.data = [];
+
+
+
+ if ( curContext.createImageData ) {
+
+ pixels = curContext.createImageData( p.width, p.height );
+
+ }
+
+
+
+ var data = pixels.data;
+
+ var pos = 0;
+
+
+
+ for ( var i = 0, l = p.pixels.length; i < l; i++ ) {
+
+ var c = (p.pixels[i] || "rgba(0,0,0,1)").match(colors);
+
+ data[pos] = parseInt(c[1]);
+
+ data[pos+1] = parseInt(c[2]);
+
+ data[pos+2] = parseInt(c[3]);
+
+ data[pos+3] = parseFloat(c[4]) * 100;
+
+ pos += 4;
+
+ }
+
+
+
+ curContext.putImageData(pixels, 0, 0);
+
+ };
+
+
+
+ p.extendClass = function extendClass( obj, args, fn ) {
+
+ if ( arguments.length == 3 ) {
+
+ fn.apply( obj, args );
+
+ } else {
+
+ args.call( obj );
+
+ }
+
+ };
+
+
+
+ p.addMethod = function addMethod( object, name, fn ) {
+
+ if ( object[ name ] ) {
+
+ var args = fn.length;
+
+
+
+ var oldfn = object[ name ];
+
+ object[ name ] = function() {
+
+ if ( arguments.length == args )
+
+ return fn.apply( this, arguments );
+
+ else
+
+ return oldfn.apply( this, arguments );
+
+ };
+
+ } else {
+
+ object[ name ] = fn;
+
+ }
+
+ };
+
+
+
+ p.init = function init(code){
+
+ p.stroke( 0 );
+
+ p.fill( 255 );
+
+
+
+ // Canvas has trouble rendering single pixel stuff on whole-pixel
+
+ // counts, so we slightly offset it (this is super lame).
+
+ curContext.translate( 0.5, 0.5 );
+
+
+
+ if ( code ) {
+
+ (function(Processing){with (p){
+
+ eval(parse(code, p));
+
+ }})(p);
+
+ }
+
+
+
+ if ( p.setup ) {
+
+ inSetup = true;
+
+ p.setup();
+
+ }
+
+
+
+ inSetup = false;
+
+
+
+ if ( p.draw ) {
+
+ if ( !doLoop ) {
+
+ p.redraw();
+
+ } else {
+
+ p.loop();
+
+ }
+
+ }
+
+
+
+ attach( curElement, "mousemove", function(e) {
+
+ var scrollX = window.scrollX != null ? window.scrollX : window.pageXOffset;
+
+ var scrollY = window.scrollY != null ? window.scrollY : window.pageYOffset;
+
+ p.pmouseX = p.mouseX;
+
+ p.pmouseY = p.mouseY;
+
+ p.mouseX = e.clientX - curElement.offsetLeft + scrollX;
+
+ p.mouseY = e.clientY - curElement.offsetTop + scrollY;
+
+
+
+ if ( p.mouseMoved ) {
+
+ p.mouseMoved();
+
+ }
+
+
+
+ if ( mousePressed && p.mouseDragged ) {
+
+ p.mouseDragged();
+
+ }
+
+ });
+
+
+
+ attach( curElement, "mousedown", function(e) {
+
+ mousePressed = true;
+
+ p.mouseButton = e.which;
+
+
+
+ if ( typeof p.mousePressed == "function" ) {
+
+ p.mousePressed();
+
+ } else {
+
+ p.mousePressed = true;
+
+ }
+
+ });
+
+
+
+ attach( curElement, "contextmenu", function(e) {
+
+ e.preventDefault();
+
+ e.stopPropagation();
+
+ });
+
+
+
+ attach( curElement, "mouseup", function(e) {
+
+ mousePressed = false;
+
+
+
+ if ( typeof p.mousePressed != "function" ) {
+
+ p.mousePressed = false;
+
+ }
+
+
+
+ if ( p.mouseReleased ) {
+
+ p.mouseReleased();
+
+ }
+
+ });
+
+
+
+ attach( document, "keydown", function(e) {
+
+ keyPressed = true;
+
+
+
+ p.key = e.keyCode + 32;
+
+
+
+ if ( e.shiftKey ) {
+
+ p.key = String.fromCharCode(p.key).toUpperCase().charCodeAt(0);
+
+ }
+
+
+
+ if ( typeof p.keyPressed == "function" ) {
+
+ p.keyPressed();
+
+ } else {
+
+ p.keyPressed = true;
+
+ }
+
+ });
+
+
+
+ attach( document, "keyup", function(e) {
+
+ keyPressed = false;
+
+
+
+ if ( typeof p.keyPressed != "function" ) {
+
+ p.keyPressed = false;
+
+ }
+
+
+
+ if ( p.keyReleased ) {
+
+ p.keyReleased();
+
+ }
+
+ });
+
+
+
+ function attach(elem, type, fn) {
+
+ if ( elem.addEventListener )
+
+ elem.addEventListener( type, fn, false );
+
+ else
+
+ elem.attachEvent( "on" + type, fn );
+
+ }
+
+ };
+
+
+
+ return p;
+
+}
+
+
+
+})();
+
+
+
+/*
+
+ * This code searches for all the <script type="application/processing" target="canvasid">
+
+ * in your page and loads each script in the target canvas with the proper id.
+
+ * It is useful to smooth the process of adding Processing code in your page and starting
+
+ * the Processing.js engine.
+
+ */
+
+
+
+if ( window.addEventListener ) {
+
+ window.addEventListener("load", function() {
+
+ var scripts = document.getElementsByTagName("script");
+
+
+
+ for ( var i = 0; i < scripts.length; i++ ) {
+
+ if ( scripts[i].type == "application/processing" ) {
+
+ var src = scripts[i].src, canvas = scripts[i].nextSibling;
+
+
+
+ if ( src && src.indexOf("#") ) {
+
+ canvas = document.getElementById( src.substr( src.indexOf("#") + 1 ) );
+
+ } else {
+
+ while ( canvas && canvas.nodeName.toUpperCase() != "CANVAS" )
+
+ canvas = canvas.nextSibling;
+
+ }
+
+
+
+ if ( canvas ) {
+
+ Processing(canvas, scripts[i].textContent);
+
+ }
+
+ }
+
+ }
+
+ }, false);
+
+}
+</script>
+
+
+<script id="sunspider" type="x">
+// 3D Cube Rotation
+// http://www.speich.net/computer/moztesting/3d.htm
+// Created by Simon Speich
+
+var Q = new Array();
+var MTrans = new Array(); // transformation matrix
+var MQube = new Array(); // position information of qube
+var I = new Array(); // entity matrix
+var Origin = new Object();
+var Testing = new Object();
+var LoopTimer;
+
+var DisplArea = new Object();
+DisplArea.Width = 300;
+DisplArea.Height = 300;
+
+function DrawLine(From, To) {
+ var x1 = From.V[0];
+ var x2 = To.V[0];
+ var y1 = From.V[1];
+ var y2 = To.V[1];
+ var dx = Math.abs(x2 - x1);
+ var dy = Math.abs(y2 - y1);
+ var x = x1;
+ var y = y1;
+ var IncX1, IncY1;
+ var IncX2, IncY2;
+ var Den;
+ var Num;
+ var NumAdd;
+ var NumPix;
+
+ if (x2 >= x1) { IncX1 = 1; IncX2 = 1; }
+ else { IncX1 = -1; IncX2 = -1; }
+ if (y2 >= y1) { IncY1 = 1; IncY2 = 1; }
+ else { IncY1 = -1; IncY2 = -1; }
+ if (dx >= dy) {
+ IncX1 = 0;
+ IncY2 = 0;
+ Den = dx;
+ Num = dx / 2;
+ NumAdd = dy;
+ NumPix = dx;
+ }
+ else {
+ IncX2 = 0;
+ IncY1 = 0;
+ Den = dy;
+ Num = dy / 2;
+ NumAdd = dx;
+ NumPix = dy;
+ }
+
+ NumPix = Math.round(Q.LastPx + NumPix);
+
+ var i = Q.LastPx;
+ for (; i < NumPix; i++) {
+ Num += NumAdd;
+ if (Num >= Den) {
+ Num -= Den;
+ x += IncX1;
+ y += IncY1;
+ }
+ x += IncX2;
+ y += IncY2;
+ }
+ Q.LastPx = NumPix;
+}
+
+function CalcCross(V0, V1) {
+ var Cross = new Array();
+ Cross[0] = V0[1]*V1[2] - V0[2]*V1[1];
+ Cross[1] = V0[2]*V1[0] - V0[0]*V1[2];
+ Cross[2] = V0[0]*V1[1] - V0[1]*V1[0];
+ return Cross;
+}
+
+function CalcNormal(V0, V1, V2) {
+ var A = new Array(); var B = new Array();
+ for (var i = 0; i < 3; i++) {
+ A[i] = V0[i] - V1[i];
+ B[i] = V2[i] - V1[i];
+ }
+ A = CalcCross(A, B);
+ var Length = Math.sqrt(A[0]*A[0] + A[1]*A[1] + A[2]*A[2]);
+ for (var i = 0; i < 3; i++) A[i] = A[i] / Length;
+ A[3] = 1;
+ return A;
+}
+
+function CreateP(X,Y,Z) {
+ this.V = [X,Y,Z,1];
+}
+
+// multiplies two matrices
+function MMulti(M1, M2) {
+ var M = [[],[],[],[]];
+ var i = 0;
+ var j = 0;
+ for (; i < 4; i++) {
+ j = 0;
+ for (; j < 4; j++) M[i][j] = M1[i][0] * M2[0][j] + M1[i][1] * M2[1][j] + M1[i][2] * M2[2][j] + M1[i][3] * M2[3][j];
+ }
+ return M;
+}
+
+//multiplies matrix with vector
+function VMulti(M, V) {
+ var Vect = new Array();
+ var i = 0;
+ for (;i < 4; i++) Vect[i] = M[i][0] * V[0] + M[i][1] * V[1] + M[i][2] * V[2] + M[i][3] * V[3];
+ return Vect;
+}
+
+function VMulti2(M, V) {
+ var Vect = new Array();
+ var i = 0;
+ for (;i < 3; i++) Vect[i] = M[i][0] * V[0] + M[i][1] * V[1] + M[i][2] * V[2];
+ return Vect;
+}
+
+// add to matrices
+function MAdd(M1, M2) {
+ var M = [[],[],[],[]];
+ var i = 0;
+ var j = 0;
+ for (; i < 4; i++) {
+ j = 0;
+ for (; j < 4; j++) M[i][j] = M1[i][j] + M2[i][j];
+ }
+ return M;
+}
+
+function Translate(M, Dx, Dy, Dz) {
+ var T = [
+ [1,0,0,Dx],
+ [0,1,0,Dy],
+ [0,0,1,Dz],
+ [0,0,0,1]
+ ];
+ return MMulti(T, M);
+}
+
+function RotateX(M, Phi) {
+ var a = Phi;
+ a *= Math.PI / 180;
+ var Cos = Math.cos(a);
+ var Sin = Math.sin(a);
+ var R = [
+ [1,0,0,0],
+ [0,Cos,-Sin,0],
+ [0,Sin,Cos,0],
+ [0,0,0,1]
+ ];
+ return MMulti(R, M);
+}
+
+function RotateY(M, Phi) {
+ var a = Phi;
+ a *= Math.PI / 180;
+ var Cos = Math.cos(a);
+ var Sin = Math.sin(a);
+ var R = [
+ [Cos,0,Sin,0],
+ [0,1,0,0],
+ [-Sin,0,Cos,0],
+ [0,0,0,1]
+ ];
+ return MMulti(R, M);
+}
+
+function RotateZ(M, Phi) {
+ var a = Phi;
+ a *= Math.PI / 180;
+ var Cos = Math.cos(a);
+ var Sin = Math.sin(a);
+ var R = [
+ [Cos,-Sin,0,0],
+ [Sin,Cos,0,0],
+ [0,0,1,0],
+ [0,0,0,1]
+ ];
+ return MMulti(R, M);
+}
+
+function DrawQube() {
+ // calc current normals
+ var CurN = new Array();
+ var i = 5;
+ Q.LastPx = 0;
+ for (; i > -1; i--) CurN[i] = VMulti2(MQube, Q.Normal[i]);
+ if (CurN[0][2] < 0) {
+ if (!Q.Line[0]) { DrawLine(Q[0], Q[1]); Q.Line[0] = true; };
+ if (!Q.Line[1]) { DrawLine(Q[1], Q[2]); Q.Line[1] = true; };
+ if (!Q.Line[2]) { DrawLine(Q[2], Q[3]); Q.Line[2] = true; };
+ if (!Q.Line[3]) { DrawLine(Q[3], Q[0]); Q.Line[3] = true; };
+ }
+ if (CurN[1][2] < 0) {
+ if (!Q.Line[2]) { DrawLine(Q[3], Q[2]); Q.Line[2] = true; };
+ if (!Q.Line[9]) { DrawLine(Q[2], Q[6]); Q.Line[9] = true; };
+ if (!Q.Line[6]) { DrawLine(Q[6], Q[7]); Q.Line[6] = true; };
+ if (!Q.Line[10]) { DrawLine(Q[7], Q[3]); Q.Line[10] = true; };
+ }
+ if (CurN[2][2] < 0) {
+ if (!Q.Line[4]) { DrawLine(Q[4], Q[5]); Q.Line[4] = true; };
+ if (!Q.Line[5]) { DrawLine(Q[5], Q[6]); Q.Line[5] = true; };
+ if (!Q.Line[6]) { DrawLine(Q[6], Q[7]); Q.Line[6] = true; };
+ if (!Q.Line[7]) { DrawLine(Q[7], Q[4]); Q.Line[7] = true; };
+ }
+ if (CurN[3][2] < 0) {
+ if (!Q.Line[4]) { DrawLine(Q[4], Q[5]); Q.Line[4] = true; };
+ if (!Q.Line[8]) { DrawLine(Q[5], Q[1]); Q.Line[8] = true; };
+ if (!Q.Line[0]) { DrawLine(Q[1], Q[0]); Q.Line[0] = true; };
+ if (!Q.Line[11]) { DrawLine(Q[0], Q[4]); Q.Line[11] = true; };
+ }
+ if (CurN[4][2] < 0) {
+ if (!Q.Line[11]) { DrawLine(Q[4], Q[0]); Q.Line[11] = true; };
+ if (!Q.Line[3]) { DrawLine(Q[0], Q[3]); Q.Line[3] = true; };
+ if (!Q.Line[10]) { DrawLine(Q[3], Q[7]); Q.Line[10] = true; };
+ if (!Q.Line[7]) { DrawLine(Q[7], Q[4]); Q.Line[7] = true; };
+ }
+ if (CurN[5][2] < 0) {
+ if (!Q.Line[8]) { DrawLine(Q[1], Q[5]); Q.Line[8] = true; };
+ if (!Q.Line[5]) { DrawLine(Q[5], Q[6]); Q.Line[5] = true; };
+ if (!Q.Line[9]) { DrawLine(Q[6], Q[2]); Q.Line[9] = true; };
+ if (!Q.Line[1]) { DrawLine(Q[2], Q[1]); Q.Line[1] = true; };
+ }
+ Q.Line = [false,false,false,false,false,false,false,false,false,false,false,false];
+ Q.LastPx = 0;
+}
+
+function Loop() {
+ if (Testing.LoopCount > Testing.LoopMax) return;
+ var TestingStr = String(Testing.LoopCount);
+ while (TestingStr.length < 3) TestingStr = "0" + TestingStr;
+ MTrans = Translate(I, -Q[8].V[0], -Q[8].V[1], -Q[8].V[2]);
+ MTrans = RotateX(MTrans, 1);
+ MTrans = RotateY(MTrans, 3);
+ MTrans = RotateZ(MTrans, 5);
+ MTrans = Translate(MTrans, Q[8].V[0], Q[8].V[1], Q[8].V[2]);
+ MQube = MMulti(MTrans, MQube);
+ var i = 8;
+ for (; i > -1; i--) {
+ Q[i].V = VMulti(MTrans, Q[i].V);
+ }
+ DrawQube();
+ Testing.LoopCount++;
+ Loop();
+}
+
+function Init(CubeSize) {
+ // init/reset vars
+ Origin.V = [150,150,20,1];
+ Testing.LoopCount = 0;
+ Testing.LoopMax = 50;
+ Testing.TimeMax = 0;
+ Testing.TimeAvg = 0;
+ Testing.TimeMin = 0;
+ Testing.TimeTemp = 0;
+ Testing.TimeTotal = 0;
+ Testing.Init = false;
+
+ // transformation matrix
+ MTrans = [
+ [1,0,0,0],
+ [0,1,0,0],
+ [0,0,1,0],
+ [0,0,0,1]
+ ];
+
+ // position information of qube
+ MQube = [
+ [1,0,0,0],
+ [0,1,0,0],
+ [0,0,1,0],
+ [0,0,0,1]
+ ];
+
+ // entity matrix
+ I = [
+ [1,0,0,0],
+ [0,1,0,0],
+ [0,0,1,0],
+ [0,0,0,1]
+ ];
+
+ // create qube
+ Q[0] = new CreateP(-CubeSize,-CubeSize, CubeSize);
+ Q[1] = new CreateP(-CubeSize, CubeSize, CubeSize);
+ Q[2] = new CreateP( CubeSize, CubeSize, CubeSize);
+ Q[3] = new CreateP( CubeSize,-CubeSize, CubeSize);
+ Q[4] = new CreateP(-CubeSize,-CubeSize,-CubeSize);
+ Q[5] = new CreateP(-CubeSize, CubeSize,-CubeSize);
+ Q[6] = new CreateP( CubeSize, CubeSize,-CubeSize);
+ Q[7] = new CreateP( CubeSize,-CubeSize,-CubeSize);
+
+ // center of gravity
+ Q[8] = new CreateP(0, 0, 0);
+
+ // anti-clockwise edge check
+ Q.Edge = [[0,1,2],[3,2,6],[7,6,5],[4,5,1],[4,0,3],[1,5,6]];
+
+ // calculate squad normals
+ Q.Normal = new Array();
+ for (var i = 0; i < Q.Edge.length; i++) Q.Normal[i] = CalcNormal(Q[Q.Edge[i][0]].V, Q[Q.Edge[i][1]].V, Q[Q.Edge[i][2]].V);
+
+ // line drawn ?
+ Q.Line = [false,false,false,false,false,false,false,false,false,false,false,false];
+
+ // create line pixels
+ Q.NumPx = 9 * 2 * CubeSize;
+ for (var i = 0; i < Q.NumPx; i++) CreateP(0,0,0);
+
+ MTrans = Translate(MTrans, Origin.V[0], Origin.V[1], Origin.V[2]);
+ MQube = MMulti(MTrans, MQube);
+
+ var i = 0;
+ for (; i < 9; i++) {
+ Q[i].V = VMulti(MTrans, Q[i].V);
+ }
+ DrawQube();
+ Testing.Init = true;
+ Loop();
+}
+
+for ( var i = 20; i <= 160; i *= 2 ) {
+ Init(i);
+}
+
+Q = null;
+MTrans = null;
+MQube = null;
+I = null;
+Origin = null;
+Testing = null;
+LoopTime = null;
+DisplArea = null;
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+var loops = 15
+var nx = 120
+var nz = 120
+
+function morph(a, f) {
+ var PI2nx = Math.PI * 8/nx
+ var sin = Math.sin
+ var f30 = -(50 * sin(f*Math.PI*2))
+
+ for (var i = 0; i < nz; ++i) {
+ for (var j = 0; j < nx; ++j) {
+ a[3*(i*nx+j)+1] = sin((j-1) * PI2nx ) * -f30
+ }
+ }
+}
+
+
+var a = Array()
+for (var i=0; i < nx*nz*3; ++i)
+ a[i] = 0
+
+for (var i = 0; i < loops; ++i) {
+ morph(a, i/loops)
+}
+
+testOutput = 0;
+for (var i = 0; i < nx; i++)
+ testOutput += a[3*(i*nx+i)+1];
+a = null;
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+function createVector(x,y,z) {
+ return new Array(x,y,z);
+}
+
+function sqrLengthVector(self) {
+ return self[0] * self[0] + self[1] * self[1] + self[2] * self[2];
+}
+
+function lengthVector(self) {
+ return Math.sqrt(self[0] * self[0] + self[1] * self[1] + self[2] * self[2]);
+}
+
+function addVector(self, v) {
+ self[0] += v[0];
+ self[1] += v[1];
+ self[2] += v[2];
+ return self;
+}
+
+function subVector(self, v) {
+ self[0] -= v[0];
+ self[1] -= v[1];
+ self[2] -= v[2];
+ return self;
+}
+
+function scaleVector(self, scale) {
+ self[0] *= scale;
+ self[1] *= scale;
+ self[2] *= scale;
+ return self;
+}
+
+function normaliseVector(self) {
+ var len = Math.sqrt(self[0] * self[0] + self[1] * self[1] + self[2] * self[2]);
+ self[0] /= len;
+ self[1] /= len;
+ self[2] /= len;
+ return self;
+}
+
+function add(v1, v2) {
+ return new Array(v1[0] + v2[0], v1[1] + v2[1], v1[2] + v2[2]);
+}
+
+function sub(v1, v2) {
+ return new Array(v1[0] - v2[0], v1[1] - v2[1], v1[2] - v2[2]);
+}
+
+function scalev(v1, v2) {
+ return new Array(v1[0] * v2[0], v1[1] * v2[1], v1[2] * v2[2]);
+}
+
+function dot(v1, v2) {
+ return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
+}
+
+function scale(v, scale) {
+ return [v[0] * scale, v[1] * scale, v[2] * scale];
+}
+
+function cross(v1, v2) {
+ return [v1[1] * v2[2] - v1[2] * v2[1],
+ v1[2] * v2[0] - v1[0] * v2[2],
+ v1[0] * v2[1] - v1[1] * v2[0]];
+
+}
+
+function normalise(v) {
+ var len = lengthVector(v);
+ return [v[0] / len, v[1] / len, v[2] / len];
+}
+
+function transformMatrix(self, v) {
+ var vals = self;
+ var x = vals[0] * v[0] + vals[1] * v[1] + vals[2] * v[2] + vals[3];
+ var y = vals[4] * v[0] + vals[5] * v[1] + vals[6] * v[2] + vals[7];
+ var z = vals[8] * v[0] + vals[9] * v[1] + vals[10] * v[2] + vals[11];
+ return [x, y, z];
+}
+
+function invertMatrix(self) {
+ var temp = new Array(16);
+ var tx = -self[3];
+ var ty = -self[7];
+ var tz = -self[11];
+ for (h = 0; h < 3; h++)
+ for (v = 0; v < 3; v++)
+ temp[h + v * 4] = self[v + h * 4];
+ for (i = 0; i < 11; i++)
+ self[i] = temp[i];
+ self[3] = tx * self[0] + ty * self[1] + tz * self[2];
+ self[7] = tx * self[4] + ty * self[5] + tz * self[6];
+ self[11] = tx * self[8] + ty * self[9] + tz * self[10];
+ return self;
+}
+
+
+// Triangle intersection using barycentric coord method
+function Triangle(p1, p2, p3) {
+ var edge1 = sub(p3, p1);
+ var edge2 = sub(p2, p1);
+ var normal = cross(edge1, edge2);
+ if (Math.abs(normal[0]) > Math.abs(normal[1]))
+ if (Math.abs(normal[0]) > Math.abs(normal[2]))
+ this.axis = 0;
+ else
+ this.axis = 2;
+ else
+ if (Math.abs(normal[1]) > Math.abs(normal[2]))
+ this.axis = 1;
+ else
+ this.axis = 2;
+ var u = (this.axis + 1) % 3;
+ var v = (this.axis + 2) % 3;
+ var u1 = edge1[u];
+ var v1 = edge1[v];
+
+ var u2 = edge2[u];
+ var v2 = edge2[v];
+ this.normal = normalise(normal);
+ this.nu = normal[u] / normal[this.axis];
+ this.nv = normal[v] / normal[this.axis];
+ this.nd = dot(normal, p1) / normal[this.axis];
+ var det = u1 * v2 - v1 * u2;
+ this.eu = p1[u];
+ this.ev = p1[v];
+ this.nu1 = u1 / det;
+ this.nv1 = -v1 / det;
+ this.nu2 = v2 / det;
+ this.nv2 = -u2 / det;
+ this.material = [0.7, 0.7, 0.7];
+}
+
+Triangle.prototype.intersect = function(orig, dir, near, far) {
+ var u = (this.axis + 1) % 3;
+ var v = (this.axis + 2) % 3;
+ var d = dir[this.axis] + this.nu * dir[u] + this.nv * dir[v];
+ var t = (this.nd - orig[this.axis] - this.nu * orig[u] - this.nv * orig[v]) / d;
+ if (t < near || t > far)
+ return null;
+ var Pu = orig[u] + t * dir[u] - this.eu;
+ var Pv = orig[v] + t * dir[v] - this.ev;
+ var a2 = Pv * this.nu1 + Pu * this.nv1;
+ if (a2 < 0)
+ return null;
+ var a3 = Pu * this.nu2 + Pv * this.nv2;
+ if (a3 < 0)
+ return null;
+
+ if ((a2 + a3) > 1)
+ return null;
+ return t;
+}
+
+function Scene(a_triangles) {
+ this.triangles = a_triangles;
+ this.lights = [];
+ this.ambient = [0,0,0];
+ this.background = [0.8,0.8,1];
+}
+var zero = new Array(0,0,0);
+
+Scene.prototype.intersect = function(origin, dir, near, far) {
+ var closest = null;
+ for (i = 0; i < this.triangles.length; i++) {
+ var triangle = this.triangles[i];
+ var d = triangle.intersect(origin, dir, near, far);
+ if (d == null || d > far || d < near)
+ continue;
+ far = d;
+ closest = triangle;
+ }
+
+ if (!closest)
+ return [this.background[0],this.background[1],this.background[2]];
+
+ var normal = closest.normal;
+ var hit = add(origin, scale(dir, far));
+ if (dot(dir, normal) > 0)
+ normal = [-normal[0], -normal[1], -normal[2]];
+
+ var colour = null;
+ if (closest.shader) {
+ colour = closest.shader(closest, hit, dir);
+ } else {
+ colour = closest.material;
+ }
+
+ // do reflection
+ var reflected = null;
+ if (colour.reflection > 0.001) {
+ var reflection = addVector(scale(normal, -2*dot(dir, normal)), dir);
+ reflected = this.intersect(hit, reflection, 0.0001, 1000000);
+ if (colour.reflection >= 0.999999)
+ return reflected;
+ }
+
+ var l = [this.ambient[0], this.ambient[1], this.ambient[2]];
+ for (var i = 0; i < this.lights.length; i++) {
+ var light = this.lights[i];
+ var toLight = sub(light, hit);
+ var distance = lengthVector(toLight);
+ scaleVector(toLight, 1.0/distance);
+ distance -= 0.0001;
+ if (this.blocked(hit, toLight, distance))
+ continue;
+ var nl = dot(normal, toLight);
+ if (nl > 0)
+ addVector(l, scale(light.colour, nl));
+ }
+ l = scalev(l, colour);
+ if (reflected) {
+ l = addVector(scaleVector(l, 1 - colour.reflection), scaleVector(reflected, colour.reflection));
+ }
+ return l;
+}
+
+Scene.prototype.blocked = function(O, D, far) {
+ var near = 0.0001;
+ var closest = null;
+ for (i = 0; i < this.triangles.length; i++) {
+ var triangle = this.triangles[i];
+ var d = triangle.intersect(O, D, near, far);
+ if (d == null || d > far || d < near)
+ continue;
+ return true;
+ }
+
+ return false;
+}
+
+
+// this camera code is from notes i made ages ago, it is from *somewhere* -- i cannot remember where
+// that somewhere is
+function Camera(origin, lookat, up) {
+ var zaxis = normaliseVector(subVector(lookat, origin));
+ var xaxis = normaliseVector(cross(up, zaxis));
+ var yaxis = normaliseVector(cross(xaxis, subVector([0,0,0], zaxis)));
+ var m = new Array(16);
+ m[0] = xaxis[0]; m[1] = xaxis[1]; m[2] = xaxis[2];
+ m[4] = yaxis[0]; m[5] = yaxis[1]; m[6] = yaxis[2];
+ m[8] = zaxis[0]; m[9] = zaxis[1]; m[10] = zaxis[2];
+ invertMatrix(m);
+ m[3] = 0; m[7] = 0; m[11] = 0;
+ this.origin = origin;
+ this.directions = new Array(4);
+ this.directions[0] = normalise([-0.7, 0.7, 1]);
+ this.directions[1] = normalise([ 0.7, 0.7, 1]);
+ this.directions[2] = normalise([ 0.7, -0.7, 1]);
+ this.directions[3] = normalise([-0.7, -0.7, 1]);
+ this.directions[0] = transformMatrix(m, this.directions[0]);
+ this.directions[1] = transformMatrix(m, this.directions[1]);
+ this.directions[2] = transformMatrix(m, this.directions[2]);
+ this.directions[3] = transformMatrix(m, this.directions[3]);
+}
+
+Camera.prototype.generateRayPair = function(y) {
+ rays = new Array(new Object(), new Object());
+ rays[0].origin = this.origin;
+ rays[1].origin = this.origin;
+ rays[0].dir = addVector(scale(this.directions[0], y), scale(this.directions[3], 1 - y));
+ rays[1].dir = addVector(scale(this.directions[1], y), scale(this.directions[2], 1 - y));
+ return rays;
+}
+
+function renderRows(camera, scene, pixels, width, height, starty, stopy) {
+ for (var y = starty; y < stopy; y++) {
+ var rays = camera.generateRayPair(y / height);
+ for (var x = 0; x < width; x++) {
+ var xp = x / width;
+ var origin = addVector(scale(rays[0].origin, xp), scale(rays[1].origin, 1 - xp));
+ var dir = normaliseVector(addVector(scale(rays[0].dir, xp), scale(rays[1].dir, 1 - xp)));
+ var l = scene.intersect(origin, dir);
+ pixels[y][x] = l;
+ }
+ }
+}
+
+Camera.prototype.render = function(scene, pixels, width, height) {
+ var cam = this;
+ var row = 0;
+ renderRows(cam, scene, pixels, width, height, 0, height);
+}
+
+
+
+function raytraceScene()
+{
+ var startDate = new Date().getTime();
+ var numTriangles = 2 * 6;
+ var triangles = new Array();//numTriangles);
+ var tfl = createVector(-10, 10, -10);
+ var tfr = createVector( 10, 10, -10);
+ var tbl = createVector(-10, 10, 10);
+ var tbr = createVector( 10, 10, 10);
+ var bfl = createVector(-10, -10, -10);
+ var bfr = createVector( 10, -10, -10);
+ var bbl = createVector(-10, -10, 10);
+ var bbr = createVector( 10, -10, 10);
+
+ // cube!!!
+ // front
+ var i = 0;
+
+ triangles[i++] = new Triangle(tfl, tfr, bfr);
+ triangles[i++] = new Triangle(tfl, bfr, bfl);
+ // back
+ triangles[i++] = new Triangle(tbl, tbr, bbr);
+ triangles[i++] = new Triangle(tbl, bbr, bbl);
+ // triangles[i-1].material = [0.7,0.2,0.2];
+ // triangles[i-1].material.reflection = 0.8;
+ // left
+ triangles[i++] = new Triangle(tbl, tfl, bbl);
+ // triangles[i-1].reflection = 0.6;
+ triangles[i++] = new Triangle(tfl, bfl, bbl);
+ // triangles[i-1].reflection = 0.6;
+ // right
+ triangles[i++] = new Triangle(tbr, tfr, bbr);
+ triangles[i++] = new Triangle(tfr, bfr, bbr);
+ // top
+ triangles[i++] = new Triangle(tbl, tbr, tfr);
+ triangles[i++] = new Triangle(tbl, tfr, tfl);
+ // bottom
+ triangles[i++] = new Triangle(bbl, bbr, bfr);
+ triangles[i++] = new Triangle(bbl, bfr, bfl);
+
+ //Floor!!!!
+ var green = createVector(0.0, 0.4, 0.0);
+ var grey = createVector(0.4, 0.4, 0.4);
+ grey.reflection = 1.0;
+ var floorShader = function(tri, pos, view) {
+ var x = ((pos[0]/32) % 2 + 2) % 2;
+ var z = ((pos[2]/32 + 0.3) % 2 + 2) % 2;
+ if (x < 1 != z < 1) {
+ //in the real world we use the fresnel term...
+ // var angle = 1-dot(view, tri.normal);
+ // angle *= angle;
+ // angle *= angle;
+ // angle *= angle;
+ //grey.reflection = angle;
+ return grey;
+ } else
+ return green;
+ }
+ var ffl = createVector(-1000, -30, -1000);
+ var ffr = createVector( 1000, -30, -1000);
+ var fbl = createVector(-1000, -30, 1000);
+ var fbr = createVector( 1000, -30, 1000);
+ triangles[i++] = new Triangle(fbl, fbr, ffr);
+ triangles[i-1].shader = floorShader;
+ triangles[i++] = new Triangle(fbl, ffr, ffl);
+ triangles[i-1].shader = floorShader;
+
+ var _scene = new Scene(triangles);
+ _scene.lights[0] = createVector(20, 38, -22);
+ _scene.lights[0].colour = createVector(0.7, 0.3, 0.3);
+ _scene.lights[1] = createVector(-23, 40, 17);
+ _scene.lights[1].colour = createVector(0.7, 0.3, 0.3);
+ _scene.lights[2] = createVector(23, 20, 17);
+ _scene.lights[2].colour = createVector(0.7, 0.7, 0.7);
+ _scene.ambient = createVector(0.1, 0.1, 0.1);
+ // _scene.background = createVector(0.7, 0.7, 1.0);
+
+ var size = 30;
+ var pixels = new Array();
+ for (var y = 0; y < size; y++) {
+ pixels[y] = new Array();
+ for (var x = 0; x < size; x++) {
+ pixels[y][x] = 0;
+ }
+ }
+
+ var _camera = new Camera(createVector(-40, 40, 40), createVector(0, 0, 0), createVector(0, 1, 0));
+ _camera.render(_scene, pixels, size, size);
+
+ return pixels;
+}
+
+function arrayToCanvasCommands(pixels)
+{
+ var s = '<canvas id="renderCanvas" width="30px" height="30px"></canvas><scr' + 'ipt>\nvar pixels = [';
+ var size = 30;
+ for (var y = 0; y < size; y++) {
+ s += "[";
+ for (var x = 0; x < size; x++) {
+ s += "[" + pixels[y][x] + "],";
+ }
+ s+= "],";
+ }
+ s += '];\n var canvas = document.getElementById("renderCanvas").getContext("2d");\n\
+\n\
+\n\
+ var size = 30;\n\
+ canvas.fillStyle = "red";\n\
+ canvas.fillRect(0, 0, size, size);\n\
+ canvas.scale(1, -1);\n\
+ canvas.translate(0, -size);\n\
+\n\
+ if (!canvas.setFillColor)\n\
+ canvas.setFillColor = function(r, g, b, a) {\n\
+ this.fillStyle = "rgb("+[Math.floor(r * 255), Math.floor(g * 255), Math.floor(b * 255)]+")";\n\
+ }\n\
+\n\
+for (var y = 0; y < size; y++) {\n\
+ for (var x = 0; x < size; x++) {\n\
+ var l = pixels[y][x];\n\
+ canvas.setFillColor(l[0], l[1], l[2], 1);\n\
+ canvas.fillRect(x, y, 1, 1);\n\
+ }\n\
+}</scr' + 'ipt>';
+
+ return s;
+}
+
+testOutput = arrayToCanvasCommands(raytraceScene());
+/* The Great Computer Language Shootout
+ http://shootout.alioth.debian.org/
+ contributed by Isaac Gouy */
+
+function TreeNode(left,right,item){
+ this.left = left;
+ this.right = right;
+ this.item = item;
+}
+
+TreeNode.prototype.itemCheck = function(){
+ if (this.left==null) return this.item;
+ else return this.item + this.left.itemCheck() - this.right.itemCheck();
+}
+
+function bottomUpTree(item,depth){
+ if (depth>0){
+ return new TreeNode(
+ bottomUpTree(2*item-1, depth-1)
+ ,bottomUpTree(2*item, depth-1)
+ ,item
+ );
+ }
+ else {
+ return new TreeNode(null,null,item);
+ }
+}
+
+var ret;
+
+for ( var n = 4; n <= 7; n += 1 ) {
+ var minDepth = 4;
+ var maxDepth = Math.max(minDepth + 2, n);
+ var stretchDepth = maxDepth + 1;
+
+ var check = bottomUpTree(0,stretchDepth).itemCheck();
+
+ var longLivedTree = bottomUpTree(0,maxDepth);
+ for (var depth=minDepth; depth<=maxDepth; depth+=2){
+ var iterations = 1 << (maxDepth - depth + minDepth);
+
+ check = 0;
+ for (var i=1; i<=iterations; i++){
+ check += bottomUpTree(i,depth).itemCheck();
+ check += bottomUpTree(-i,depth).itemCheck();
+ }
+ }
+
+ ret = longLivedTree.itemCheck();
+}
+/* The Great Computer Language Shootout
+ http://shootout.alioth.debian.org/
+ contributed by Isaac Gouy */
+
+function fannkuch(n) {
+ var check = 0;
+ var perm = Array(n);
+ var perm1 = Array(n);
+ var count = Array(n);
+ var maxPerm = Array(n);
+ var maxFlipsCount = 0;
+ var m = n - 1;
+
+ for (var i = 0; i < n; i++) perm1[i] = i;
+ var r = n;
+
+ while (true) {
+ // write-out the first 30 permutations
+ if (check < 30){
+ var s = "";
+ for(var i=0; i<n; i++) s += (perm1[i]+1).toString();
+ check++;
+ }
+
+ while (r != 1) { count[r - 1] = r; r--; }
+ if (!(perm1[0] == 0 || perm1[m] == m)) {
+ for (var i = 0; i < n; i++) perm[i] = perm1[i];
+
+ var flipsCount = 0;
+ var k;
+
+ while (!((k = perm[0]) == 0)) {
+ var k2 = (k + 1) >> 1;
+ for (var i = 0; i < k2; i++) {
+ var temp = perm[i]; perm[i] = perm[k - i]; perm[k - i] = temp;
+ }
+ flipsCount++;
+ }
+
+ if (flipsCount > maxFlipsCount) {
+ maxFlipsCount = flipsCount;
+ for (var i = 0; i < n; i++) maxPerm[i] = perm1[i];
+ }
+ }
+
+ while (true) {
+ if (r == n) return maxFlipsCount;
+ var perm0 = perm1[0];
+ var i = 0;
+ while (i < r) {
+ var j = i + 1;
+ perm1[i] = perm1[j];
+ i = j;
+ }
+ perm1[r] = perm0;
+
+ count[r] = count[r] - 1;
+ if (count[r] > 0) break;
+ r++;
+ }
+ }
+}
+
+var n = 8;
+var ret = fannkuch(n);
+
+/* The Great Computer Language Shootout
+ http://shootout.alioth.debian.org/
+ contributed by Isaac Gouy */
+
+var PI = 3.141592653589793;
+var SOLAR_MASS = 4 * PI * PI;
+var DAYS_PER_YEAR = 365.24;
+
+function Body(x,y,z,vx,vy,vz,mass){
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ this.vx = vx;
+ this.vy = vy;
+ this.vz = vz;
+ this.mass = mass;
+}
+
+Body.prototype.offsetMomentum = function(px,py,pz) {
+ this.vx = -px / SOLAR_MASS;
+ this.vy = -py / SOLAR_MASS;
+ this.vz = -pz / SOLAR_MASS;
+ return this;
+}
+
+function Jupiter(){
+ return new Body(
+ 4.84143144246472090e+00,
+ -1.16032004402742839e+00,
+ -1.03622044471123109e-01,
+ 1.66007664274403694e-03 * DAYS_PER_YEAR,
+ 7.69901118419740425e-03 * DAYS_PER_YEAR,
+ -6.90460016972063023e-05 * DAYS_PER_YEAR,
+ 9.54791938424326609e-04 * SOLAR_MASS
+ );
+}
+
+function Saturn(){
+ return new Body(
+ 8.34336671824457987e+00,
+ 4.12479856412430479e+00,
+ -4.03523417114321381e-01,
+ -2.76742510726862411e-03 * DAYS_PER_YEAR,
+ 4.99852801234917238e-03 * DAYS_PER_YEAR,
+ 2.30417297573763929e-05 * DAYS_PER_YEAR,
+ 2.85885980666130812e-04 * SOLAR_MASS
+ );
+}
+
+function Uranus(){
+ return new Body(
+ 1.28943695621391310e+01,
+ -1.51111514016986312e+01,
+ -2.23307578892655734e-01,
+ 2.96460137564761618e-03 * DAYS_PER_YEAR,
+ 2.37847173959480950e-03 * DAYS_PER_YEAR,
+ -2.96589568540237556e-05 * DAYS_PER_YEAR,
+ 4.36624404335156298e-05 * SOLAR_MASS
+ );
+}
+
+function Neptune(){
+ return new Body(
+ 1.53796971148509165e+01,
+ -2.59193146099879641e+01,
+ 1.79258772950371181e-01,
+ 2.68067772490389322e-03 * DAYS_PER_YEAR,
+ 1.62824170038242295e-03 * DAYS_PER_YEAR,
+ -9.51592254519715870e-05 * DAYS_PER_YEAR,
+ 5.15138902046611451e-05 * SOLAR_MASS
+ );
+}
+
+function Sun(){
+ return new Body(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, SOLAR_MASS);
+}
+
+
+function NBodySystem(bodies){
+ this.bodies = bodies;
+ var px = 0.0;
+ var py = 0.0;
+ var pz = 0.0;
+ var size = this.bodies.length;
+ for (var i=0; i<size; i++){
+ var b = this.bodies[i];
+ var m = b.mass;
+ px += b.vx * m;
+ py += b.vy * m;
+ pz += b.vz * m;
+ }
+ this.bodies[0].offsetMomentum(px,py,pz);
+}
+
+NBodySystem.prototype.advance = function(dt){
+ var dx, dy, dz, distance, mag;
+ var size = this.bodies.length;
+
+ for (var i=0; i<size; i++) {
+ var bodyi = this.bodies[i];
+ for (var j=i+1; j<size; j++) {
+ var bodyj = this.bodies[j];
+ dx = bodyi.x - bodyj.x;
+ dy = bodyi.y - bodyj.y;
+ dz = bodyi.z - bodyj.z;
+
+ distance = Math.sqrt(dx*dx + dy*dy + dz*dz);
+ mag = dt / (distance * distance * distance);
+
+ bodyi.vx -= dx * bodyj.mass * mag;
+ bodyi.vy -= dy * bodyj.mass * mag;
+ bodyi.vz -= dz * bodyj.mass * mag;
+
+ bodyj.vx += dx * bodyi.mass * mag;
+ bodyj.vy += dy * bodyi.mass * mag;
+ bodyj.vz += dz * bodyi.mass * mag;
+ }
+ }
+
+ for (var i=0; i<size; i++) {
+ var body = this.bodies[i];
+ body.x += dt * body.vx;
+ body.y += dt * body.vy;
+ body.z += dt * body.vz;
+ }
+}
+
+NBodySystem.prototype.energy = function(){
+ var dx, dy, dz, distance;
+ var e = 0.0;
+ var size = this.bodies.length;
+
+ for (var i=0; i<size; i++) {
+ var bodyi = this.bodies[i];
+
+ e += 0.5 * bodyi.mass *
+ ( bodyi.vx * bodyi.vx
+ + bodyi.vy * bodyi.vy
+ + bodyi.vz * bodyi.vz );
+
+ for (var j=i+1; j<size; j++) {
+ var bodyj = this.bodies[j];
+ dx = bodyi.x - bodyj.x;
+ dy = bodyi.y - bodyj.y;
+ dz = bodyi.z - bodyj.z;
+
+ distance = Math.sqrt(dx*dx + dy*dy + dz*dz);
+ e -= (bodyi.mass * bodyj.mass) / distance;
+ }
+ }
+ return e;
+}
+
+var ret;
+
+for ( var n = 3; n <= 24; n *= 2 ) {
+ (function(){
+ var bodies = new NBodySystem( Array(
+ Sun(),Jupiter(),Saturn(),Uranus(),Neptune()
+ ));
+ var max = n * 100;
+
+ ret = bodies.energy();
+ for (var i=0; i<max; i++){
+ bodies.advance(0.01);
+ }
+ ret = bodies.energy();
+ })();
+}
+// The Great Computer Language Shootout
+// http://shootout.alioth.debian.org/
+//
+// modified by Isaac Gouy
+
+function pad(number,width){
+ var s = number.toString();
+ var prefixWidth = width - s.length;
+ if (prefixWidth>0){
+ for (var i=1; i<=prefixWidth; i++) s = " " + s;
+ }
+ return s;
+}
+
+function nsieve(m, isPrime){
+ var i, k, count;
+
+ for (i=2; i<=m; i++) { isPrime[i] = true; }
+ count = 0;
+
+ for (i=2; i<=m; i++){
+ if (isPrime[i]) {
+ for (k=i+i; k<=m; k+=i) isPrime[k] = false;
+ count++;
+ }
+ }
+ return count;
+}
+
+function sieve() {
+ for (var i = 1; i <= 3; i++ ) {
+ var m = (1<<i)*10000;
+ var flags = Array(m+1);
+ nsieve(m, flags);
+ }
+}
+
+sieve();
+// Copyright (c) 2004 by Arthur Langereis (arthur_ext at domain xfinitegames, tld com
+
+// 1 op = 6 ANDs, 3 SHRs, 3 SHLs, 4 assigns, 2 ADDs
+// O(1)
+function fast3bitlookup(b) {
+var c, bi3b = 0xE994; // 0b1110 1001 1001 0100; // 3 2 2 1 2 1 1 0
+c = 3 & (bi3b >> ((b << 1) & 14));
+c += 3 & (bi3b >> ((b >> 2) & 14));
+c += 3 & (bi3b >> ((b >> 5) & 6));
+return c;
+
+/*
+lir4,0xE994; 9 instructions, no memory access, minimal register dependence, 6 shifts, 2 adds, 1 inline assign
+rlwinmr5,r3,1,28,30
+rlwinmr6,r3,30,28,30
+rlwinmr7,r3,27,29,30
+rlwnmr8,r4,r5,30,31
+rlwnmr9,r4,r6,30,31
+rlwnmr10,r4,r7,30,31
+addr3,r8,r9
+addr3,r3,r10
+*/
+}
+
+
+function TimeFunc(func) {
+var x, y, t;
+for(var x=0; x<500; x++)
+for(var y=0; y<256; y++) func(y);
+}
+
+TimeFunc(fast3bitlookup);
+// Copyright (c) 2004 by Arthur Langereis (arthur_ext at domain xfinitegames, tld com)
+
+
+// 1 op = 2 assigns, 16 compare/branches, 8 ANDs, (0-8) ADDs, 8 SHLs
+// O(n)
+function bitsinbyte(b) {
+var m = 1, c = 0;
+while(m<0x100) {
+if(b & m) c++;
+m <<= 1;
+}
+return c;
+}
+
+function TimeFunc(func) {
+var x, y, t;
+for(var x=0; x<350; x++)
+for(var y=0; y<256; y++) func(y);
+}
+
+TimeFunc(bitsinbyte);
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+bitwiseAndValue = 4294967296;
+for (var i = 0; i < 600000; i++)
+ bitwiseAndValue = bitwiseAndValue & i;
+// The Great Computer Language Shootout
+// http://shootout.alioth.debian.org
+//
+// Contributed by Ian Osgood
+
+function pad(n,width) {
+ var s = n.toString();
+ while (s.length < width) s = ' ' + s;
+ return s;
+}
+
+function primes(isPrime, n) {
+ var i, count = 0, m = 10000<<n, size = m+31>>5;
+
+ for (i=0; i<size; i++) isPrime[i] = 0xffffffff;
+
+ for (i=2; i<m; i++)
+ if (isPrime[i>>5] & 1<<(i&31)) {
+ for (var j=i+i; j<m; j+=i)
+ isPrime[j>>5] &= ~(1<<(j&31));
+ count++;
+ }
+}
+
+function sieve() {
+ for (var i = 4; i <= 4; i++) {
+ var isPrime = new Array((10000<<i)+31>>5);
+ primes(isPrime, i);
+ }
+}
+
+sieve();
+// The Computer Language Shootout
+// http://shootout.alioth.debian.org/
+// contributed by Isaac Gouy
+
+function ack(m,n){
+ if (m==0) { return n+1; }
+ if (n==0) { return ack(m-1,1); }
+ return ack(m-1, ack(m,n-1) );
+}
+
+function fib(n) {
+ if (n < 2){ return 1; }
+ return fib(n-2) + fib(n-1);
+}
+
+function tak(x,y,z) {
+ if (y >= x) return z;
+ return tak(tak(x-1,y,z), tak(y-1,z,x), tak(z-1,x,y));
+}
+
+for ( var i = 3; i <= 5; i++ ) {
+ ack(3,i);
+ fib(17.0+i);
+ tak(3*i+3,2*i+2,i+1);
+}
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+/*
+ * AES Cipher function: encrypt 'input' with Rijndael algorithm
+ *
+ * takes byte-array 'input' (16 bytes)
+ * 2D byte-array key schedule 'w' (Nr+1 x Nb bytes)
+ *
+ * applies Nr rounds (10/12/14) using key schedule w for 'add round key' stage
+ *
+ * returns byte-array encrypted value (16 bytes)
+ */
+function Cipher(input, w) { // main Cipher function [§5.1]
+ var Nb = 4; // block size (in words): no of columns in state (fixed at 4 for AES)
+ var Nr = w.length/Nb - 1; // no of rounds: 10/12/14 for 128/192/256-bit keys
+
+ var state = [[],[],[],[]]; // initialise 4xNb byte-array 'state' with input [§3.4]
+ for (var i=0; i<4*Nb; i++) state[i%4][Math.floor(i/4)] = input[i];
+
+ state = AddRoundKey(state, w, 0, Nb);
+
+ for (var round=1; round<Nr; round++) {
+ state = SubBytes(state, Nb);
+ state = ShiftRows(state, Nb);
+ state = MixColumns(state, Nb);
+ state = AddRoundKey(state, w, round, Nb);
+ }
+
+ state = SubBytes(state, Nb);
+ state = ShiftRows(state, Nb);
+ state = AddRoundKey(state, w, Nr, Nb);
+
+ var output = new Array(4*Nb); // convert state to 1-d array before returning [§3.4]
+ for (var i=0; i<4*Nb; i++) output[i] = state[i%4][Math.floor(i/4)];
+ return output;
+}
+
+
+function SubBytes(s, Nb) { // apply SBox to state S [§5.1.1]
+ for (var r=0; r<4; r++) {
+ for (var c=0; c<Nb; c++) s[r][c] = Sbox[s[r][c]];
+ }
+ return s;
+}
+
+
+function ShiftRows(s, Nb) { // shift row r of state S left by r bytes [§5.1.2]
+ var t = new Array(4);
+ for (var r=1; r<4; r++) {
+ for (var c=0; c<4; c++) t[c] = s[r][(c+r)%Nb]; // shift into temp copy
+ for (var c=0; c<4; c++) s[r][c] = t[c]; // and copy back
+ } // note that this will work for Nb=4,5,6, but not 7,8 (always 4 for AES):
+ return s; // see fp.gladman.plus.com/cryptography_technology/rijndael/aes.spec.311.pdf
+}
+
+
+function MixColumns(s, Nb) { // combine bytes of each col of state S [§5.1.3]
+ for (var c=0; c<4; c++) {
+ var a = new Array(4); // 'a' is a copy of the current column from 's'
+ var b = new Array(4); // 'b' is a•{02} in GF(2^8)
+ for (var i=0; i<4; i++) {
+ a[i] = s[i][c];
+ b[i] = s[i][c]&0x80 ? s[i][c]<<1 ^ 0x011b : s[i][c]<<1;
+ }
+ // a[n] ^ b[n] is a•{03} in GF(2^8)
+ s[0][c] = b[0] ^ a[1] ^ b[1] ^ a[2] ^ a[3]; // 2*a0 + 3*a1 + a2 + a3
+ s[1][c] = a[0] ^ b[1] ^ a[2] ^ b[2] ^ a[3]; // a0 * 2*a1 + 3*a2 + a3
+ s[2][c] = a[0] ^ a[1] ^ b[2] ^ a[3] ^ b[3]; // a0 + a1 + 2*a2 + 3*a3
+ s[3][c] = a[0] ^ b[0] ^ a[1] ^ a[2] ^ b[3]; // 3*a0 + a1 + a2 + 2*a3
+ }
+ return s;
+}
+
+
+function AddRoundKey(state, w, rnd, Nb) { // xor Round Key into state S [§5.1.4]
+ for (var r=0; r<4; r++) {
+ for (var c=0; c<Nb; c++) state[r][c] ^= w[rnd*4+c][r];
+ }
+ return state;
+}
+
+
+function KeyExpansion(key) { // generate Key Schedule (byte-array Nr+1 x Nb) from Key [§5.2]
+ var Nb = 4; // block size (in words): no of columns in state (fixed at 4 for AES)
+ var Nk = key.length/4 // key length (in words): 4/6/8 for 128/192/256-bit keys
+ var Nr = Nk + 6; // no of rounds: 10/12/14 for 128/192/256-bit keys
+
+ var w = new Array(Nb*(Nr+1));
+ var temp = new Array(4);
+
+ for (var i=0; i<Nk; i++) {
+ var r = [key[4*i], key[4*i+1], key[4*i+2], key[4*i+3]];
+ w[i] = r;
+ }
+
+ for (var i=Nk; i<(Nb*(Nr+1)); i++) {
+ w[i] = new Array(4);
+ for (var t=0; t<4; t++) temp[t] = w[i-1][t];
+ if (i % Nk == 0) {
+ temp = SubWord(RotWord(temp));
+ for (var t=0; t<4; t++) temp[t] ^= Rcon[i/Nk][t];
+ } else if (Nk > 6 && i%Nk == 4) {
+ temp = SubWord(temp);
+ }
+ for (var t=0; t<4; t++) w[i][t] = w[i-Nk][t] ^ temp[t];
+ }
+
+ return w;
+}
+
+function SubWord(w) { // apply SBox to 4-byte word w
+ for (var i=0; i<4; i++) w[i] = Sbox[w[i]];
+ return w;
+}
+
+function RotWord(w) { // rotate 4-byte word w left by one byte
+ w[4] = w[0];
+ for (var i=0; i<4; i++) w[i] = w[i+1];
+ return w;
+}
+
+
+// Sbox is pre-computed multiplicative inverse in GF(2^8) used in SubBytes and KeyExpansion [§5.1.1]
+var Sbox = [0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5,0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76,
+ 0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0,0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0,
+ 0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc,0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15,
+ 0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a,0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75,
+ 0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0,0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84,
+ 0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b,0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf,
+ 0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85,0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8,
+ 0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5,0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2,
+ 0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17,0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73,
+ 0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88,0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb,
+ 0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c,0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79,
+ 0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9,0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08,
+ 0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6,0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a,
+ 0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e,0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e,
+ 0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94,0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf,
+ 0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68,0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16];
+
+// Rcon is Round Constant used for the Key Expansion [1st col is 2^(r-1) in GF(2^8)] [§5.2]
+var Rcon = [ [0x00, 0x00, 0x00, 0x00],
+ [0x01, 0x00, 0x00, 0x00],
+ [0x02, 0x00, 0x00, 0x00],
+ [0x04, 0x00, 0x00, 0x00],
+ [0x08, 0x00, 0x00, 0x00],
+ [0x10, 0x00, 0x00, 0x00],
+ [0x20, 0x00, 0x00, 0x00],
+ [0x40, 0x00, 0x00, 0x00],
+ [0x80, 0x00, 0x00, 0x00],
+ [0x1b, 0x00, 0x00, 0x00],
+ [0x36, 0x00, 0x00, 0x00] ];
+
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+/*
+ * Use AES to encrypt 'plaintext' with 'password' using 'nBits' key, in 'Counter' mode of operation
+ * - see http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf
+ * for each block
+ * - outputblock = cipher(counter, key)
+ * - cipherblock = plaintext xor outputblock
+ */
+function AESEncryptCtr(plaintext, password, nBits) {
+ if (!(nBits==128 || nBits==192 || nBits==256)) return ''; // standard allows 128/192/256 bit keys
+
+ // for this example script, generate the key by applying Cipher to 1st 16/24/32 chars of password;
+ // for real-world applications, a more secure approach would be to hash the password e.g. with SHA-1
+ var nBytes = nBits/8; // no bytes in key
+ var pwBytes = new Array(nBytes);
+ for (var i=0; i<nBytes; i++) pwBytes[i] = password.charCodeAt(i) & 0xff;
+ var key = Cipher(pwBytes, KeyExpansion(pwBytes));
+ key = key.concat(key.slice(0, nBytes-16)); // key is now 16/24/32 bytes long
+
+ // initialise counter block (NIST SP800-38A §B.2): millisecond time-stamp for nonce in 1st 8 bytes,
+ // block counter in 2nd 8 bytes
+ var blockSize = 16; // block size fixed at 16 bytes / 128 bits (Nb=4) for AES
+ var counterBlock = new Array(blockSize); // block size fixed at 16 bytes / 128 bits (Nb=4) for AES
+ var nonce = (new Date()).getTime(); // milliseconds since 1-Jan-1970
+
+ // encode nonce in two stages to cater for JavaScript 32-bit limit on bitwise ops
+ for (var i=0; i<4; i++) counterBlock[i] = (nonce >>> i*8) & 0xff;
+ for (var i=0; i<4; i++) counterBlock[i+4] = (nonce/0x100000000 >>> i*8) & 0xff;
+
+ // generate key schedule - an expansion of the key into distinct Key Rounds for each round
+ var keySchedule = KeyExpansion(key);
+
+ var blockCount = Math.ceil(plaintext.length/blockSize);
+ var ciphertext = new Array(blockCount); // ciphertext as array of strings
+
+ for (var b=0; b<blockCount; b++) {
+ // set counter (block #) in last 8 bytes of counter block (leaving nonce in 1st 8 bytes)
+ // again done in two stages for 32-bit ops
+ for (var c=0; c<4; c++) counterBlock[15-c] = (b >>> c*8) & 0xff;
+ for (var c=0; c<4; c++) counterBlock[15-c-4] = (b/0x100000000 >>> c*8)
+
+ var cipherCntr = Cipher(counterBlock, keySchedule); // -- encrypt counter block --
+
+ // calculate length of final block:
+ var blockLength = b<blockCount-1 ? blockSize : (plaintext.length-1)%blockSize+1;
+
+ var ct = '';
+ for (var i=0; i<blockLength; i++) { // -- xor plaintext with ciphered counter byte-by-byte --
+ var plaintextByte = plaintext.charCodeAt(b*blockSize+i);
+ var cipherByte = plaintextByte ^ cipherCntr[i];
+ ct += String.fromCharCode(cipherByte);
+ }
+ // ct is now ciphertext for this block
+
+ ciphertext[b] = escCtrlChars(ct); // escape troublesome characters in ciphertext
+ }
+
+ // convert the nonce to a string to go on the front of the ciphertext
+ var ctrTxt = '';
+ for (var i=0; i<8; i++) ctrTxt += String.fromCharCode(counterBlock[i]);
+ ctrTxt = escCtrlChars(ctrTxt);
+
+ // use '-' to separate blocks, use Array.join to concatenate arrays of strings for efficiency
+ return ctrTxt + '-' + ciphertext.join('-');
+}
+
+
+/*
+ * Use AES to decrypt 'ciphertext' with 'password' using 'nBits' key, in Counter mode of operation
+ *
+ * for each block
+ * - outputblock = cipher(counter, key)
+ * - cipherblock = plaintext xor outputblock
+ */
+function AESDecryptCtr(ciphertext, password, nBits) {
+ if (!(nBits==128 || nBits==192 || nBits==256)) return ''; // standard allows 128/192/256 bit keys
+
+ var nBytes = nBits/8; // no bytes in key
+ var pwBytes = new Array(nBytes);
+ for (var i=0; i<nBytes; i++) pwBytes[i] = password.charCodeAt(i) & 0xff;
+ var pwKeySchedule = KeyExpansion(pwBytes);
+ var key = Cipher(pwBytes, pwKeySchedule);
+ key = key.concat(key.slice(0, nBytes-16)); // key is now 16/24/32 bytes long
+
+ var keySchedule = KeyExpansion(key);
+
+ ciphertext = ciphertext.split('-'); // split ciphertext into array of block-length strings
+
+ // recover nonce from 1st element of ciphertext
+ var blockSize = 16; // block size fixed at 16 bytes / 128 bits (Nb=4) for AES
+ var counterBlock = new Array(blockSize);
+ var ctrTxt = unescCtrlChars(ciphertext[0]);
+ for (var i=0; i<8; i++) counterBlock[i] = ctrTxt.charCodeAt(i);
+
+ var plaintext = new Array(ciphertext.length-1);
+
+ for (var b=1; b<ciphertext.length; b++) {
+ // set counter (block #) in last 8 bytes of counter block (leaving nonce in 1st 8 bytes)
+ for (var c=0; c<4; c++) counterBlock[15-c] = ((b-1) >>> c*8) & 0xff;
+ for (var c=0; c<4; c++) counterBlock[15-c-4] = ((b/0x100000000-1) >>> c*8) & 0xff;
+
+ var cipherCntr = Cipher(counterBlock, keySchedule); // encrypt counter block
+
+ ciphertext[b] = unescCtrlChars(ciphertext[b]);
+
+ var pt = '';
+ for (var i=0; i<ciphertext[b].length; i++) {
+ // -- xor plaintext with ciphered counter byte-by-byte --
+ var ciphertextByte = ciphertext[b].charCodeAt(i);
+ var plaintextByte = ciphertextByte ^ cipherCntr[i];
+ pt += String.fromCharCode(plaintextByte);
+ }
+ // pt is now plaintext for this block
+
+ plaintext[b-1] = pt; // b-1 'cos no initial nonce block in plaintext
+ }
+
+ return plaintext.join('');
+}
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+function escCtrlChars(str) { // escape control chars which might cause problems handling ciphertext
+ return str.replace(/[\0\t\n\v\f\r\xa0'"!-]/g, function(c) { return '!' + c.charCodeAt(0) + '!'; });
+} // \xa0 to cater for bug in Firefox; include '-' to leave it free for use as a block marker
+
+function unescCtrlChars(str) { // unescape potentially problematic control characters
+ return str.replace(/!\d\d?\d?!/g, function(c) { return String.fromCharCode(c.slice(1,-1)); });
+}
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+/*
+ * if escCtrlChars()/unescCtrlChars() still gives problems, use encodeBase64()/decodeBase64() instead
+ */
+var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
+
+function encodeBase64(str) { // http://tools.ietf.org/html/rfc4648
+ var o1, o2, o3, h1, h2, h3, h4, bits, i=0, enc='';
+
+ str = encodeUTF8(str); // encode multi-byte chars into UTF-8 for byte-array
+
+ do { // pack three octets into four hexets
+ o1 = str.charCodeAt(i++);
+ o2 = str.charCodeAt(i++);
+ o3 = str.charCodeAt(i++);
+
+ bits = o1<<16 | o2<<8 | o3;
+
+ h1 = bits>>18 & 0x3f;
+ h2 = bits>>12 & 0x3f;
+ h3 = bits>>6 & 0x3f;
+ h4 = bits & 0x3f;
+
+ // end of string? index to '=' in b64
+ if (isNaN(o3)) h4 = 64;
+ if (isNaN(o2)) h3 = 64;
+
+ // use hexets to index into b64, and append result to encoded string
+ enc += b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
+ } while (i < str.length);
+
+ return enc;
+}
+
+function decodeBase64(str) {
+ var o1, o2, o3, h1, h2, h3, h4, bits, i=0, enc='';
+
+ do { // unpack four hexets into three octets using index points in b64
+ h1 = b64.indexOf(str.charAt(i++));
+ h2 = b64.indexOf(str.charAt(i++));
+ h3 = b64.indexOf(str.charAt(i++));
+ h4 = b64.indexOf(str.charAt(i++));
+
+ bits = h1<<18 | h2<<12 | h3<<6 | h4;
+
+ o1 = bits>>16 & 0xff;
+ o2 = bits>>8 & 0xff;
+ o3 = bits & 0xff;
+
+ if (h3 == 64) enc += String.fromCharCode(o1);
+ else if (h4 == 64) enc += String.fromCharCode(o1, o2);
+ else enc += String.fromCharCode(o1, o2, o3);
+ } while (i < str.length);
+
+ return decodeUTF8(enc); // decode UTF-8 byte-array back to Unicode
+}
+
+function encodeUTF8(str) { // encode multi-byte string into utf-8 multiple single-byte characters
+ str = str.replace(
+ /[\u0080-\u07ff]/g, // U+0080 - U+07FF = 2-byte chars
+ function(c) {
+ var cc = c.charCodeAt(0);
+ return String.fromCharCode(0xc0 | cc>>6, 0x80 | cc&0x3f); }
+ );
+ str = str.replace(
+ /[\u0800-\uffff]/g, // U+0800 - U+FFFF = 3-byte chars
+ function(c) {
+ var cc = c.charCodeAt(0);
+ return String.fromCharCode(0xe0 | cc>>12, 0x80 | cc>>6&0x3F, 0x80 | cc&0x3f); }
+ );
+ return str;
+}
+
+function decodeUTF8(str) { // decode utf-8 encoded string back into multi-byte characters
+ str = str.replace(
+ /[\u00c0-\u00df][\u0080-\u00bf]/g, // 2-byte chars
+ function(c) {
+ var cc = (c.charCodeAt(0)&0x1f)<<6 | c.charCodeAt(1)&0x3f;
+ return String.fromCharCode(cc); }
+ );
+ str = str.replace(
+ /[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g, // 3-byte chars
+ function(c) {
+ var cc = (c.charCodeAt(0)&0x0f)<<12 | (c.charCodeAt(1)&0x3f<<6) | c.charCodeAt(2)&0x3f;
+ return String.fromCharCode(cc); }
+ );
+ return str;
+}
+
+
+function byteArrayToHexStr(b) { // convert byte array to hex string for displaying test vectors
+ var s = '';
+ for (var i=0; i<b.length; i++) s += b[i].toString(16) + ' ';
+ return s;
+}
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+
+var plainText = "ROMEO: But, soft! what light through yonder window breaks?\n\
+It is the east, and Juliet is the sun.\n\
+Arise, fair sun, and kill the envious moon,\n\
+Who is already sick and pale with grief,\n\
+That thou her maid art far more fair than she:\n\
+Be not her maid, since she is envious;\n\
+Her vestal livery is but sick and green\n\
+And none but fools do wear it; cast it off.\n\
+It is my lady, O, it is my love!\n\
+O, that she knew she were!\n\
+She speaks yet she says nothing: what of that?\n\
+Her eye discourses; I will answer it.\n\
+I am too bold, 'tis not to me she speaks:\n\
+Two of the fairest stars in all the heaven,\n\
+Having some business, do entreat her eyes\n\
+To twinkle in their spheres till they return.\n\
+What if her eyes were there, they in her head?\n\
+The brightness of her cheek would shame those stars,\n\
+As daylight doth a lamp; her eyes in heaven\n\
+Would through the airy region stream so bright\n\
+That birds would sing and think it were not night.\n\
+See, how she leans her cheek upon her hand!\n\
+O, that I were a glove upon that hand,\n\
+That I might touch that cheek!\n\
+JULIET: Ay me!\n\
+ROMEO: She speaks:\n\
+O, speak again, bright angel! for thou art\n\
+As glorious to this night, being o'er my head\n\
+As is a winged messenger of heaven\n\
+Unto the white-upturned wondering eyes\n\
+Of mortals that fall back to gaze on him\n\
+When he bestrides the lazy-pacing clouds\n\
+And sails upon the bosom of the air.";
+
+var password = "O Romeo, Romeo! wherefore art thou Romeo?";
+
+var cipherText = AESEncryptCtr(plainText, password, 256);
+var decryptedText = AESDecryptCtr(cipherText, password, 256);
+/*
+ * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
+ * Digest Algorithm, as defined in RFC 1321.
+ * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
+ * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
+ * Distributed under the BSD License
+ * See http://pajhome.org.uk/crypt/md5 for more info.
+ */
+
+/*
+ * Configurable variables. You may need to tweak these to be compatible with
+ * the server-side, but the defaults work in most cases.
+ */
+var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
+var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
+var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
+
+/*
+ * These are the functions you'll usually want to call
+ * They take string arguments and return either hex or base-64 encoded strings
+ */
+function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
+function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
+function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
+function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
+function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
+function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }
+
+/*
+ * Perform a simple self-test to see if the VM is working
+ */
+function md5_vm_test()
+{
+ return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
+}
+
+/*
+ * Calculate the MD5 of an array of little-endian words, and a bit length
+ */
+function core_md5(x, len)
+{
+ /* append padding */
+ x[len >> 5] |= 0x80 << ((len) % 32);
+ x[(((len + 64) >>> 9) << 4) + 14] = len;
+
+ var a = 1732584193;
+ var b = -271733879;
+ var c = -1732584194;
+ var d = 271733878;
+
+ for(var i = 0; i < x.length; i += 16)
+ {
+ var olda = a;
+ var oldb = b;
+ var oldc = c;
+ var oldd = d;
+
+ a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
+ d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
+ c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
+ b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
+ a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
+ d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
+ c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
+ b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
+ a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
+ d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
+ c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
+ b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
+ a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
+ d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
+ c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
+ b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
+
+ a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
+ d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
+ c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
+ b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
+ a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
+ d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
+ c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
+ b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
+ a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
+ d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
+ c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
+ b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
+ a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
+ d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
+ c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
+ b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
+
+ a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
+ d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
+ c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
+ b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
+ a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
+ d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
+ c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
+ b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
+ a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
+ d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
+ c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
+ b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
+ a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
+ d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
+ c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
+ b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
+
+ a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
+ d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
+ c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
+ b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
+ a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
+ d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
+ c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
+ b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
+ a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
+ d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
+ c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
+ b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
+ a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
+ d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
+ c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
+ b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
+
+ a = safe_add(a, olda);
+ b = safe_add(b, oldb);
+ c = safe_add(c, oldc);
+ d = safe_add(d, oldd);
+ }
+ return Array(a, b, c, d);
+
+}
+
+/*
+ * These functions implement the four basic operations the algorithm uses.
+ */
+function md5_cmn(q, a, b, x, s, t)
+{
+ return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
+}
+function md5_ff(a, b, c, d, x, s, t)
+{
+ return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
+}
+function md5_gg(a, b, c, d, x, s, t)
+{
+ return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
+}
+function md5_hh(a, b, c, d, x, s, t)
+{
+ return md5_cmn(b ^ c ^ d, a, b, x, s, t);
+}
+function md5_ii(a, b, c, d, x, s, t)
+{
+ return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
+}
+
+/*
+ * Calculate the HMAC-MD5, of a key and some data
+ */
+function core_hmac_md5(key, data)
+{
+ var bkey = str2binl(key);
+ if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);
+
+ var ipad = Array(16), opad = Array(16);
+ for(var i = 0; i < 16; i++)
+ {
+ ipad[i] = bkey[i] ^ 0x36363636;
+ opad[i] = bkey[i] ^ 0x5C5C5C5C;
+ }
+
+ var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
+ return core_md5(opad.concat(hash), 512 + 128);
+}
+
+/*
+ * Add integers, wrapping at 2^32. This uses 16-bit operations internally
+ * to work around bugs in some JS interpreters.
+ */
+function safe_add(x, y)
+{
+ var lsw = (x & 0xFFFF) + (y & 0xFFFF);
+ var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+ return (msw << 16) | (lsw & 0xFFFF);
+}
+
+/*
+ * Bitwise rotate a 32-bit number to the left.
+ */
+function bit_rol(num, cnt)
+{
+ return (num << cnt) | (num >>> (32 - cnt));
+}
+
+/*
+ * Convert a string to an array of little-endian words
+ * If chrsz is ASCII, characters >255 have their hi-byte silently ignored.
+ */
+function str2binl(str)
+{
+ var bin = Array();
+ var mask = (1 << chrsz) - 1;
+ for(var i = 0; i < str.length * chrsz; i += chrsz)
+ bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
+ return bin;
+}
+
+/*
+ * Convert an array of little-endian words to a string
+ */
+function binl2str(bin)
+{
+ var str = "";
+ var mask = (1 << chrsz) - 1;
+ for(var i = 0; i < bin.length * 32; i += chrsz)
+ str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
+ return str;
+}
+
+/*
+ * Convert an array of little-endian words to a hex string.
+ */
+function binl2hex(binarray)
+{
+ var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
+ var str = "";
+ for(var i = 0; i < binarray.length * 4; i++)
+ {
+ str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
+ hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);
+ }
+ return str;
+}
+
+/*
+ * Convert an array of little-endian words to a base-64 string
+ */
+function binl2b64(binarray)
+{
+ var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+ var str = "";
+ for(var i = 0; i < binarray.length * 4; i += 3)
+ {
+ var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16)
+ | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
+ | ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
+ for(var j = 0; j < 4; j++)
+ {
+ if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
+ else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
+ }
+ }
+ return str;
+}
+
+var plainText = "Rebellious subjects, enemies to peace,\n\
+Profaners of this neighbour-stained steel,--\n\
+Will they not hear? What, ho! you men, you beasts,\n\
+That quench the fire of your pernicious rage\n\
+With purple fountains issuing from your veins,\n\
+On pain of torture, from those bloody hands\n\
+Throw your mistemper'd weapons to the ground,\n\
+And hear the sentence of your moved prince.\n\
+Three civil brawls, bred of an airy word,\n\
+By thee, old Capulet, and Montague,\n\
+Have thrice disturb'd the quiet of our streets,\n\
+And made Verona's ancient citizens\n\
+Cast by their grave beseeming ornaments,\n\
+To wield old partisans, in hands as old,\n\
+Canker'd with peace, to part your canker'd hate:\n\
+If ever you disturb our streets again,\n\
+Your lives shall pay the forfeit of the peace.\n\
+For this time, all the rest depart away:\n\
+You Capulet; shall go along with me:\n\
+And, Montague, come you this afternoon,\n\
+To know our further pleasure in this case,\n\
+To old Free-town, our common judgment-place.\n\
+Once more, on pain of death, all men depart."
+
+for (var i = 0; i <4; i++) {
+ plainText += plainText;
+}
+
+var md5Output = hex_md5(plainText);
+/*
+ * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
+ * in FIPS PUB 180-1
+ * Version 2.1a Copyright Paul Johnston 2000 - 2002.
+ * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
+ * Distributed under the BSD License
+ * See http://pajhome.org.uk/crypt/md5 for details.
+ */
+
+/*
+ * Configurable variables. You may need to tweak these to be compatible with
+ * the server-side, but the defaults work in most cases.
+ */
+var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
+var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
+var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
+
+/*
+ * These are the functions you'll usually want to call
+ * They take string arguments and return either hex or base-64 encoded strings
+ */
+function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
+function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
+function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}
+function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}
+function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}
+function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}
+
+/*
+ * Perform a simple self-test to see if the VM is working
+ */
+function sha1_vm_test()
+{
+ return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d";
+}
+
+/*
+ * Calculate the SHA-1 of an array of big-endian words, and a bit length
+ */
+function core_sha1(x, len)
+{
+ /* append padding */
+ x[len >> 5] |= 0x80 << (24 - len % 32);
+ x[((len + 64 >> 9) << 4) + 15] = len;
+
+ var w = Array(80);
+ var a = 1732584193;
+ var b = -271733879;
+ var c = -1732584194;
+ var d = 271733878;
+ var e = -1009589776;
+
+ for(var i = 0; i < x.length; i += 16)
+ {
+ var olda = a;
+ var oldb = b;
+ var oldc = c;
+ var oldd = d;
+ var olde = e;
+
+ for(var j = 0; j < 80; j++)
+ {
+ if(j < 16) w[j] = x[i + j];
+ else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
+ var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
+ safe_add(safe_add(e, w[j]), sha1_kt(j)));
+ e = d;
+ d = c;
+ c = rol(b, 30);
+ b = a;
+ a = t;
+ }
+
+ a = safe_add(a, olda);
+ b = safe_add(b, oldb);
+ c = safe_add(c, oldc);
+ d = safe_add(d, oldd);
+ e = safe_add(e, olde);
+ }
+ return Array(a, b, c, d, e);
+
+}
+
+/*
+ * Perform the appropriate triplet combination function for the current
+ * iteration
+ */
+function sha1_ft(t, b, c, d)
+{
+ if(t < 20) return (b & c) | ((~b) & d);
+ if(t < 40) return b ^ c ^ d;
+ if(t < 60) return (b & c) | (b & d) | (c & d);
+ return b ^ c ^ d;
+}
+
+/*
+ * Determine the appropriate additive constant for the current iteration
+ */
+function sha1_kt(t)
+{
+ return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :
+ (t < 60) ? -1894007588 : -899497514;
+}
+
+/*
+ * Calculate the HMAC-SHA1 of a key and some data
+ */
+function core_hmac_sha1(key, data)
+{
+ var bkey = str2binb(key);
+ if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);
+
+ var ipad = Array(16), opad = Array(16);
+ for(var i = 0; i < 16; i++)
+ {
+ ipad[i] = bkey[i] ^ 0x36363636;
+ opad[i] = bkey[i] ^ 0x5C5C5C5C;
+ }
+
+ var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
+ return core_sha1(opad.concat(hash), 512 + 160);
+}
+
+/*
+ * Add integers, wrapping at 2^32. This uses 16-bit operations internally
+ * to work around bugs in some JS interpreters.
+ */
+function safe_add(x, y)
+{
+ var lsw = (x & 0xFFFF) + (y & 0xFFFF);
+ var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+ return (msw << 16) | (lsw & 0xFFFF);
+}
+
+/*
+ * Bitwise rotate a 32-bit number to the left.
+ */
+function rol(num, cnt)
+{
+ return (num << cnt) | (num >>> (32 - cnt));
+}
+
+/*
+ * Convert an 8-bit or 16-bit string to an array of big-endian words
+ * In 8-bit function, characters >255 have their hi-byte silently ignored.
+ */
+function str2binb(str)
+{
+ var bin = Array();
+ var mask = (1 << chrsz) - 1;
+ for(var i = 0; i < str.length * chrsz; i += chrsz)
+ bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32);
+ return bin;
+}
+
+/*
+ * Convert an array of big-endian words to a string
+ */
+function binb2str(bin)
+{
+ var str = "";
+ var mask = (1 << chrsz) - 1;
+ for(var i = 0; i < bin.length * 32; i += chrsz)
+ str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask);
+ return str;
+}
+
+/*
+ * Convert an array of big-endian words to a hex string.
+ */
+function binb2hex(binarray)
+{
+ var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
+ var str = "";
+ for(var i = 0; i < binarray.length * 4; i++)
+ {
+ str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
+ hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);
+ }
+ return str;
+}
+
+/*
+ * Convert an array of big-endian words to a base-64 string
+ */
+function binb2b64(binarray)
+{
+ var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+ var str = "";
+ for(var i = 0; i < binarray.length * 4; i += 3)
+ {
+ var triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16)
+ | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 )
+ | ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
+ for(var j = 0; j < 4; j++)
+ {
+ if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
+ else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
+ }
+ }
+ return str;
+}
+
+
+var plainText = "Two households, both alike in dignity,\n\
+In fair Verona, where we lay our scene,\n\
+From ancient grudge break to new mutiny,\n\
+Where civil blood makes civil hands unclean.\n\
+From forth the fatal loins of these two foes\n\
+A pair of star-cross'd lovers take their life;\n\
+Whole misadventured piteous overthrows\n\
+Do with their death bury their parents' strife.\n\
+The fearful passage of their death-mark'd love,\n\
+And the continuance of their parents' rage,\n\
+Which, but their children's end, nought could remove,\n\
+Is now the two hours' traffic of our stage;\n\
+The which if you with patient ears attend,\n\
+What here shall miss, our toil shall strive to mend.";
+
+for (var i = 0; i <4; i++) {
+ plainText += plainText;
+}
+
+var sha1Output = hex_sha1(plainText);
+function arrayExists(array, x) {
+ for (var i = 0; i < array.length; i++) {
+ if (array[i] == x) return true;
+ }
+ return false;
+}
+
+Date.prototype.formatDate = function (input,time) {
+ // formatDate :
+ // a PHP date like function, for formatting date strings
+ // See: http://www.php.net/date
+ //
+ // input : format string
+ // time : epoch time (seconds, and optional)
+ //
+ // if time is not passed, formatting is based on
+ // the current "this" date object's set time.
+ //
+ // supported:
+ // a, A, B, d, D, F, g, G, h, H, i, j, l (lowercase L), L,
+ // m, M, n, O, r, s, S, t, U, w, W, y, Y, z
+ //
+ // unsupported:
+ // I (capital i), T, Z
+
+ var switches = ["a", "A", "B", "d", "D", "F", "g", "G", "h", "H",
+ "i", "j", "l", "L", "m", "M", "n", "O", "r", "s",
+ "S", "t", "U", "w", "W", "y", "Y", "z"];
+ var daysLong = ["Sunday", "Monday", "Tuesday", "Wednesday",
+ "Thursday", "Friday", "Saturday"];
+ var daysShort = ["Sun", "Mon", "Tue", "Wed",
+ "Thu", "Fri", "Sat"];
+ var monthsShort = ["Jan", "Feb", "Mar", "Apr",
+ "May", "Jun", "Jul", "Aug", "Sep",
+ "Oct", "Nov", "Dec"];
+ var monthsLong = ["January", "February", "March", "April",
+ "May", "June", "July", "August", "September",
+ "October", "November", "December"];
+ var daysSuffix = ["st", "nd", "rd", "th", "th", "th", "th", // 1st - 7th
+ "th", "th", "th", "th", "th", "th", "th", // 8th - 14th
+ "th", "th", "th", "th", "th", "th", "st", // 15th - 21st
+ "nd", "rd", "th", "th", "th", "th", "th", // 22nd - 28th
+ "th", "th", "st"]; // 29th - 31st
+
+ function a() {
+ // Lowercase Ante meridiem and Post meridiem
+ return self.getHours() > 11? "pm" : "am";
+ }
+ function A() {
+ // Uppercase Ante meridiem and Post meridiem
+ return self.getHours() > 11? "PM" : "AM";
+ }
+
+ function B(){
+ // Swatch internet time. code simply grabbed from ppk,
+ // since I was feeling lazy:
+ // http://www.xs4all.nl/~ppk/js/beat.html
+ var off = (self.getTimezoneOffset() + 60)*60;
+ var theSeconds = (self.getHours() * 3600) +
+ (self.getMinutes() * 60) +
+ self.getSeconds() + off;
+ var beat = Math.floor(theSeconds/86.4);
+ if (beat > 1000) beat -= 1000;
+ if (beat < 0) beat += 1000;
+ if ((""+beat).length == 1) beat = "00"+beat;
+ if ((""+beat).length == 2) beat = "0"+beat;
+ return beat;
+ }
+
+ function d() {
+ // Day of the month, 2 digits with leading zeros
+ return new String(self.getDate()).length == 1?
+ "0"+self.getDate() : self.getDate();
+ }
+ function D() {
+ // A textual representation of a day, three letters
+ return daysShort[self.getDay()];
+ }
+ function F() {
+ // A full textual representation of a month
+ return monthsLong[self.getMonth()];
+ }
+ function g() {
+ // 12-hour format of an hour without leading zeros
+ return self.getHours() > 12? self.getHours()-12 : self.getHours();
+ }
+ function G() {
+ // 24-hour format of an hour without leading zeros
+ return self.getHours();
+ }
+ function h() {
+ // 12-hour format of an hour with leading zeros
+ if (self.getHours() > 12) {
+ var s = new String(self.getHours()-12);
+ return s.length == 1?
+ "0"+ (self.getHours()-12) : self.getHours()-12;
+ } else {
+ var s = new String(self.getHours());
+ return s.length == 1?
+ "0"+self.getHours() : self.getHours();
+ }
+ }
+ function H() {
+ // 24-hour format of an hour with leading zeros
+ return new String(self.getHours()).length == 1?
+ "0"+self.getHours() : self.getHours();
+ }
+ function i() {
+ // Minutes with leading zeros
+ return new String(self.getMinutes()).length == 1?
+ "0"+self.getMinutes() : self.getMinutes();
+ }
+ function j() {
+ // Day of the month without leading zeros
+ return self.getDate();
+ }
+ function l() {
+ // A full textual representation of the day of the week
+ return daysLong[self.getDay()];
+ }
+ function L() {
+ // leap year or not. 1 if leap year, 0 if not.
+ // the logic should match iso's 8601 standard.
+ var y_ = Y();
+ if (
+ (y_ % 4 == 0 && y_ % 100 != 0) ||
+ (y_ % 4 == 0 && y_ % 100 == 0 && y_ % 400 == 0)
+ ) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+ function m() {
+ // Numeric representation of a month, with leading zeros
+ return self.getMonth() < 9?
+ "0"+(self.getMonth()+1) :
+ self.getMonth()+1;
+ }
+ function M() {
+ // A short textual representation of a month, three letters
+ return monthsShort[self.getMonth()];
+ }
+ function n() {
+ // Numeric representation of a month, without leading zeros
+ return self.getMonth()+1;
+ }
+ function O() {
+ // Difference to Greenwich time (GMT) in hours
+ var os = Math.abs(self.getTimezoneOffset());
+ var h = ""+Math.floor(os/60);
+ var m = ""+(os%60);
+ h.length == 1? h = "0"+h:1;
+ m.length == 1? m = "0"+m:1;
+ return self.getTimezoneOffset() < 0 ? "+"+h+m : "-"+h+m;
+ }
+ function r() {
+ // RFC 822 formatted date
+ var r; // result
+ // Thu , 21 Dec 2000
+ r = D() + ", " + j() + " " + M() + " " + Y() +
+ // 16 : 01 : 07 +0200
+ " " + H() + ":" + i() + ":" + s() + " " + O();
+ return r;
+ }
+ function S() {
+ // English ordinal suffix for the day of the month, 2 characters
+ return daysSuffix[self.getDate()-1];
+ }
+ function s() {
+ // Seconds, with leading zeros
+ return new String(self.getSeconds()).length == 1?
+ "0"+self.getSeconds() : self.getSeconds();
+ }
+ function t() {
+
+ // thanks to Matt Bannon for some much needed code-fixes here!
+ var daysinmonths = [null,31,28,31,30,31,30,31,31,30,31,30,31];
+ if (L()==1 && n()==2) return 29; // leap day
+ return daysinmonths[n()];
+ }
+ function U() {
+ // Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
+ return Math.round(self.getTime()/1000);
+ }
+ function W() {
+ // Weeknumber, as per ISO specification:
+ // http://www.cl.cam.ac.uk/~mgk25/iso-time.html
+
+ // if the day is three days before newyears eve,
+ // there's a chance it's "week 1" of next year.
+ // here we check for that.
+ var beforeNY = 364+L() - z();
+ var afterNY = z();
+ var weekday = w()!=0?w()-1:6; // makes sunday (0), into 6.
+ if (beforeNY <= 2 && weekday <= 2-beforeNY) {
+ return 1;
+ }
+ // similarly, if the day is within threedays of newyears
+ // there's a chance it belongs in the old year.
+ var ny = new Date("January 1 " + Y() + " 00:00:00");
+ var nyDay = ny.getDay()!=0?ny.getDay()-1:6;
+ if (
+ (afterNY <= 2) &&
+ (nyDay >=4) &&
+ (afterNY >= (6-nyDay))
+ ) {
+ // Since I'm not sure we can just always return 53,
+ // i call the function here again, using the last day
+ // of the previous year, as the date, and then just
+ // return that week.
+ var prevNY = new Date("December 31 " + (Y()-1) + " 00:00:00");
+ return prevNY.formatDate("W");
+ }
+
+ // week 1, is the week that has the first thursday in it.
+ // note that this value is not zero index.
+ if (nyDay <= 3) {
+ // first day of the year fell on a thursday, or earlier.
+ return 1 + Math.floor( ( z() + nyDay ) / 7 );
+ } else {
+ // first day of the year fell on a friday, or later.
+ return 1 + Math.floor( ( z() - ( 7 - nyDay ) ) / 7 );
+ }
+ }
+ function w() {
+ // Numeric representation of the day of the week
+ return self.getDay();
+ }
+
+ function Y() {
+ // A full numeric representation of a year, 4 digits
+
+ // we first check, if getFullYear is supported. if it
+ // is, we just use that. ppks code is nice, but wont
+ // work with dates outside 1900-2038, or something like that
+ if (self.getFullYear) {
+ var newDate = new Date("January 1 2001 00:00:00 +0000");
+ var x = newDate .getFullYear();
+ if (x == 2001) {
+ // i trust the method now
+ return self.getFullYear();
+ }
+ }
+ // else, do this:
+ // codes thanks to ppk:
+ // http://www.xs4all.nl/~ppk/js/introdate.html
+ var x = self.getYear();
+ var y = x % 100;
+ y += (y < 38) ? 2000 : 1900;
+ return y;
+ }
+ function y() {
+ // A two-digit representation of a year
+ var y = Y()+"";
+ return y.substring(y.length-2,y.length);
+ }
+ function z() {
+ // The day of the year, zero indexed! 0 through 366
+ var t = new Date("January 1 " + Y() + " 00:00:00");
+ var diff = self.getTime() - t.getTime();
+ return Math.floor(diff/1000/60/60/24);
+ }
+
+ var self = this;
+ if (time) {
+ // save time
+ var prevTime = self.getTime();
+ self.setTime(time);
+ }
+
+ var ia = input.split("");
+ var ij = 0;
+ while (ia[ij]) {
+ if (ia[ij] == "\\") {
+ // this is our way of allowing users to escape stuff
+ ia.splice(ij,1);
+ } else {
+ if (arrayExists(switches,ia[ij])) {
+ ia[ij] = eval(ia[ij] + "()");
+ }
+ }
+ ij++;
+ }
+ // reset time, back to what it was
+ if (prevTime) {
+ self.setTime(prevTime);
+ }
+ return ia.join("");
+}
+
+var date = new Date("1/1/2007 1:11:11");
+
+for (i = 0; i < 500; ++i) {
+ var shortFormat = date.formatDate("Y-m-d");
+ var longFormat = date.formatDate("l, F d, Y g:i:s A");
+ date.setTime(date.getTime() + 84266956);
+}
+
+/*
+ * Copyright (C) 2004 Baron Schwartz <baron at sequent dot org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation, version 2.1.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ */
+
+Date.parseFunctions = {count:0};
+Date.parseRegexes = [];
+Date.formatFunctions = {count:0};
+
+Date.prototype.dateFormat = function(format) {
+ if (Date.formatFunctions[format] == null) {
+ Date.createNewFormat(format);
+ }
+ var func = Date.formatFunctions[format];
+ return this[func]();
+}
+
+Date.createNewFormat = function(format) {
+ var funcName = "format" + Date.formatFunctions.count++;
+ Date.formatFunctions[format] = funcName;
+ var code = "Date.prototype." + funcName + " = function(){return ";
+ var special = false;
+ var ch = '';
+ for (var i = 0; i < format.length; ++i) {
+ ch = format.charAt(i);
+ if (!special && ch == "\\") {
+ special = true;
+ }
+ else if (special) {
+ special = false;
+ code += "'" + String.escape(ch) + "' + ";
+ }
+ else {
+ code += Date.getFormatCode(ch);
+ }
+ }
+ eval(code.substring(0, code.length - 3) + ";}");
+}
+
+Date.getFormatCode = function(character) {
+ switch (character) {
+ case "d":
+ return "String.leftPad(this.getDate(), 2, '0') + ";
+ case "D":
+ return "Date.dayNames[this.getDay()].substring(0, 3) + ";
+ case "j":
+ return "this.getDate() + ";
+ case "l":
+ return "Date.dayNames[this.getDay()] + ";
+ case "S":
+ return "this.getSuffix() + ";
+ case "w":
+ return "this.getDay() + ";
+ case "z":
+ return "this.getDayOfYear() + ";
+ case "W":
+ return "this.getWeekOfYear() + ";
+ case "F":
+ return "Date.monthNames[this.getMonth()] + ";
+ case "m":
+ return "String.leftPad(this.getMonth() + 1, 2, '0') + ";
+ case "M":
+ return "Date.monthNames[this.getMonth()].substring(0, 3) + ";
+ case "n":
+ return "(this.getMonth() + 1) + ";
+ case "t":
+ return "this.getDaysInMonth() + ";
+ case "L":
+ return "(this.isLeapYear() ? 1 : 0) + ";
+ case "Y":
+ return "this.getFullYear() + ";
+ case "y":
+ return "('' + this.getFullYear()).substring(2, 4) + ";
+ case "a":
+ return "(this.getHours() < 12 ? 'am' : 'pm') + ";
+ case "A":
+ return "(this.getHours() < 12 ? 'AM' : 'PM') + ";
+ case "g":
+ return "((this.getHours() %12) ? this.getHours() % 12 : 12) + ";
+ case "G":
+ return "this.getHours() + ";
+ case "h":
+ return "String.leftPad((this.getHours() %12) ? this.getHours() % 12 : 12, 2, '0') + ";
+ case "H":
+ return "String.leftPad(this.getHours(), 2, '0') + ";
+ case "i":
+ return "String.leftPad(this.getMinutes(), 2, '0') + ";
+ case "s":
+ return "String.leftPad(this.getSeconds(), 2, '0') + ";
+ case "O":
+ return "this.getGMTOffset() + ";
+ case "T":
+ return "this.getTimezone() + ";
+ case "Z":
+ return "(this.getTimezoneOffset() * -60) + ";
+ default:
+ return "'" + String.escape(character) + "' + ";
+ }
+}
+
+Date.parseDate = function(input, format) {
+ if (Date.parseFunctions[format] == null) {
+ Date.createParser(format);
+ }
+ var func = Date.parseFunctions[format];
+ return Date[func](input);
+}
+
+Date.createParser = function(format) {
+ var funcName = "parse" + Date.parseFunctions.count++;
+ var regexNum = Date.parseRegexes.length;
+ var currentGroup = 1;
+ Date.parseFunctions[format] = funcName;
+
+ var code = "Date." + funcName + " = function(input){\n"
+ + "var y = -1, m = -1, d = -1, h = -1, i = -1, s = -1;\n"
+ + "var d = new Date();\n"
+ + "y = d.getFullYear();\n"
+ + "m = d.getMonth();\n"
+ + "d = d.getDate();\n"
+ + "var results = input.match(Date.parseRegexes[" + regexNum + "]);\n"
+ + "if (results && results.length > 0) {"
+ var regex = "";
+
+ var special = false;
+ var ch = '';
+ for (var i = 0; i < format.length; ++i) {
+ ch = format.charAt(i);
+ if (!special && ch == "\\") {
+ special = true;
+ }
+ else if (special) {
+ special = false;
+ regex += String.escape(ch);
+ }
+ else {
+ obj = Date.formatCodeToRegex(ch, currentGroup);
+ currentGroup += obj.g;
+ regex += obj.s;
+ if (obj.g && obj.c) {
+ code += obj.c;
+ }
+ }
+ }
+
+ code += "if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n"
+ + "{return new Date(y, m, d, h, i, s);}\n"
+ + "else if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n"
+ + "{return new Date(y, m, d, h, i);}\n"
+ + "else if (y > 0 && m >= 0 && d > 0 && h >= 0)\n"
+ + "{return new Date(y, m, d, h);}\n"
+ + "else if (y > 0 && m >= 0 && d > 0)\n"
+ + "{return new Date(y, m, d);}\n"
+ + "else if (y > 0 && m >= 0)\n"
+ + "{return new Date(y, m);}\n"
+ + "else if (y > 0)\n"
+ + "{return new Date(y);}\n"
+ + "}return null;}";
+
+ Date.parseRegexes[regexNum] = new RegExp("^" + regex + "$");
+ eval(code);
+}
+
+Date.formatCodeToRegex = function(character, currentGroup) {
+ switch (character) {
+ case "D":
+ return {g:0,
+ c:null,
+ s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};
+ case "j":
+ case "d":
+ return {g:1,
+ c:"d = parseInt(results[" + currentGroup + "], 10);\n",
+ s:"(\\d{1,2})"};
+ case "l":
+ return {g:0,
+ c:null,
+ s:"(?:" + Date.dayNames.join("|") + ")"};
+ case "S":
+ return {g:0,
+ c:null,
+ s:"(?:st|nd|rd|th)"};
+ case "w":
+ return {g:0,
+ c:null,
+ s:"\\d"};
+ case "z":
+ return {g:0,
+ c:null,
+ s:"(?:\\d{1,3})"};
+ case "W":
+ return {g:0,
+ c:null,
+ s:"(?:\\d{2})"};
+ case "F":
+ return {g:1,
+ c:"m = parseInt(Date.monthNumbers[results[" + currentGroup + "].substring(0, 3)], 10);\n",
+ s:"(" + Date.monthNames.join("|") + ")"};
+ case "M":
+ return {g:1,
+ c:"m = parseInt(Date.monthNumbers[results[" + currentGroup + "]], 10);\n",
+ s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};
+ case "n":
+ case "m":
+ return {g:1,
+ c:"m = parseInt(results[" + currentGroup + "], 10) - 1;\n",
+ s:"(\\d{1,2})"};
+ case "t":
+ return {g:0,
+ c:null,
+ s:"\\d{1,2}"};
+ case "L":
+ return {g:0,
+ c:null,
+ s:"(?:1|0)"};
+ case "Y":
+ return {g:1,
+ c:"y = parseInt(results[" + currentGroup + "], 10);\n",
+ s:"(\\d{4})"};
+ case "y":
+ return {g:1,
+ c:"var ty = parseInt(results[" + currentGroup + "], 10);\n"
+ + "y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",
+ s:"(\\d{1,2})"};
+ case "a":
+ return {g:1,
+ c:"if (results[" + currentGroup + "] == 'am') {\n"
+ + "if (h == 12) { h = 0; }\n"
+ + "} else { if (h < 12) { h += 12; }}",
+ s:"(am|pm)"};
+ case "A":
+ return {g:1,
+ c:"if (results[" + currentGroup + "] == 'AM') {\n"
+ + "if (h == 12) { h = 0; }\n"
+ + "} else { if (h < 12) { h += 12; }}",
+ s:"(AM|PM)"};
+ case "g":
+ case "G":
+ case "h":
+ case "H":
+ return {g:1,
+ c:"h = parseInt(results[" + currentGroup + "], 10);\n",
+ s:"(\\d{1,2})"};
+ case "i":
+ return {g:1,
+ c:"i = parseInt(results[" + currentGroup + "], 10);\n",
+ s:"(\\d{2})"};
+ case "s":
+ return {g:1,
+ c:"s = parseInt(results[" + currentGroup + "], 10);\n",
+ s:"(\\d{2})"};
+ case "O":
+ return {g:0,
+ c:null,
+ s:"[+-]\\d{4}"};
+ case "T":
+ return {g:0,
+ c:null,
+ s:"[A-Z]{3}"};
+ case "Z":
+ return {g:0,
+ c:null,
+ s:"[+-]\\d{1,5}"};
+ default:
+ return {g:0,
+ c:null,
+ s:String.escape(character)};
+ }
+}
+
+Date.prototype.getTimezone = function() {
+ return this.toString().replace(
+ /^.*? ([A-Z]{3}) [0-9]{4}.*$/, "$1").replace(
+ /^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/, "$1$2$3");
+}
+
+Date.prototype.getGMTOffset = function() {
+ return (this.getTimezoneOffset() > 0 ? "-" : "+")
+ + String.leftPad(Math.floor(this.getTimezoneOffset() / 60), 2, "0")
+ + String.leftPad(this.getTimezoneOffset() % 60, 2, "0");
+}
+
+Date.prototype.getDayOfYear = function() {
+ var num = 0;
+ Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28;
+ for (var i = 0; i < this.getMonth(); ++i) {
+ num += Date.daysInMonth[i];
+ }
+ return num + this.getDate() - 1;
+}
+
+Date.prototype.getWeekOfYear = function() {
+ // Skip to Thursday of this week
+ var now = this.getDayOfYear() + (4 - this.getDay());
+ // Find the first Thursday of the year
+ var jan1 = new Date(this.getFullYear(), 0, 1);
+ var then = (7 - jan1.getDay() + 4);
+ document.write(then);
+ return String.leftPad(((now - then) / 7) + 1, 2, "0");
+}
+
+Date.prototype.isLeapYear = function() {
+ var year = this.getFullYear();
+ return ((year & 3) == 0 && (year % 100 || (year % 400 == 0 && year)));
+}
+
+Date.prototype.getFirstDayOfMonth = function() {
+ var day = (this.getDay() - (this.getDate() - 1)) % 7;
+ return (day < 0) ? (day + 7) : day;
+}
+
+Date.prototype.getLastDayOfMonth = function() {
+ var day = (this.getDay() + (Date.daysInMonth[this.getMonth()] - this.getDate())) % 7;
+ return (day < 0) ? (day + 7) : day;
+}
+
+Date.prototype.getDaysInMonth = function() {
+ Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28;
+ return Date.daysInMonth[this.getMonth()];
+}
+
+Date.prototype.getSuffix = function() {
+ switch (this.getDate()) {
+ case 1:
+ case 21:
+ case 31:
+ return "st";
+ case 2:
+ case 22:
+ return "nd";
+ case 3:
+ case 23:
+ return "rd";
+ default:
+ return "th";
+ }
+}
+
+String.escape = function(string) {
+ return string.replace(/('|\\)/g, "\\$1");
+}
+
+String.leftPad = function (val, size, ch) {
+ var result = new String(val);
+ if (ch == null) {
+ ch = " ";
+ }
+ while (result.length < size) {
+ result = ch + result;
+ }
+ return result;
+}
+
+Date.daysInMonth = [31,28,31,30,31,30,31,31,30,31,30,31];
+Date.monthNames =
+ ["January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December"];
+Date.dayNames =
+ ["Sunday",
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday"];
+Date.y2kYear = 50;
+Date.monthNumbers = {
+ Jan:0,
+ Feb:1,
+ Mar:2,
+ Apr:3,
+ May:4,
+ Jun:5,
+ Jul:6,
+ Aug:7,
+ Sep:8,
+ Oct:9,
+ Nov:10,
+ Dec:11};
+Date.patterns = {
+ ISO8601LongPattern:"Y-m-d H:i:s",
+ ISO8601ShortPattern:"Y-m-d",
+ ShortDatePattern: "n/j/Y",
+ LongDatePattern: "l, F d, Y",
+ FullDateTimePattern: "l, F d, Y g:i:s A",
+ MonthDayPattern: "F d",
+ ShortTimePattern: "g:i A",
+ LongTimePattern: "g:i:s A",
+ SortableDateTimePattern: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTimePattern: "Y-m-d H:i:sO",
+ YearMonthPattern: "F, Y"};
+
+var date = new Date("1/1/2007 1:11:11");
+
+for (i = 0; i < 4000; ++i) {
+ var shortFormat = date.dateFormat("Y-m-d");
+ var longFormat = date.dateFormat("l, F d, Y g:i:s A");
+ date.setTime(date.getTime() + 84266956);
+}
+/*
+ * Copyright (C) Rich Moore. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/////. Start CORDIC
+
+var AG_CONST = 0.6072529350;
+
+function FIXED(X)
+{
+ return X * 65536.0;
+}
+
+function FLOAT(X)
+{
+ return X / 65536.0;
+}
+
+function DEG2RAD(X)
+{
+ return 0.017453 * (X);
+}
+
+var Angles = [
+ FIXED(45.0), FIXED(26.565), FIXED(14.0362), FIXED(7.12502),
+ FIXED(3.57633), FIXED(1.78991), FIXED(0.895174), FIXED(0.447614),
+ FIXED(0.223811), FIXED(0.111906), FIXED(0.055953),
+ FIXED(0.027977)
+ ];
+
+
+function cordicsincos() {
+ var X;
+ var Y;
+ var TargetAngle;
+ var CurrAngle;
+ var Step;
+
+ X = FIXED(AG_CONST); /* AG_CONST * cos(0) */
+ Y = 0; /* AG_CONST * sin(0) */
+
+ TargetAngle = FIXED(28.027);
+ CurrAngle = 0;
+ for (Step = 0; Step < 12; Step++) {
+ var NewX;
+ if (TargetAngle > CurrAngle) {
+ NewX = X - (Y >> Step);
+ Y = (X >> Step) + Y;
+ X = NewX;
+ CurrAngle += Angles[Step];
+ } else {
+ NewX = X + (Y >> Step);
+ Y = -(X >> Step) + Y;
+ X = NewX;
+ CurrAngle -= Angles[Step];
+ }
+ }
+}
+
+///// End CORDIC
+
+function cordic( runs ) {
+ var start = new Date();
+
+ for ( var i = 0 ; i < runs ; i++ ) {
+ cordicsincos();
+ }
+
+ var end = new Date();
+
+ return end.getTime() - start.getTime();
+}
+
+cordic(25000);
+// The Computer Language Shootout
+// http://shootout.alioth.debian.org/
+// contributed by Isaac Gouy
+
+function partial(n){
+ var a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0.0;
+ var twothirds = 2.0/3.0;
+ var alt = -1.0;
+ var k2 = k3 = sk = ck = 0.0;
+
+ for (var k = 1; k <= n; k++){
+ k2 = k*k;
+ k3 = k2*k;
+ sk = Math.sin(k);
+ ck = Math.cos(k);
+ alt = -alt;
+
+ a1 += Math.pow(twothirds,k-1);
+ a2 += Math.pow(k,-0.5);
+ a3 += 1.0/(k*(k+1.0));
+ a4 += 1.0/(k3 * sk*sk);
+ a5 += 1.0/(k3 * ck*ck);
+ a6 += 1.0/k;
+ a7 += 1.0/k2;
+ a8 += alt/k;
+ a9 += alt/(2*k -1);
+ }
+}
+
+for (var i = 1024; i <= 16384; i *= 2) {
+ partial(i);
+}
+
+// The Great Computer Language Shootout
+// http://shootout.alioth.debian.org/
+//
+// contributed by Ian Osgood
+
+function A(i,j) {
+ return 1/((i+j)*(i+j+1)/2+i+1);
+}
+
+function Au(u,v) {
+ for (var i=0; i<u.length; ++i) {
+ var t = 0;
+ for (var j=0; j<u.length; ++j)
+ t += A(i,j) * u[j];
+ v[i] = t;
+ }
+}
+
+function Atu(u,v) {
+ for (var i=0; i<u.length; ++i) {
+ var t = 0;
+ for (var j=0; j<u.length; ++j)
+ t += A(j,i) * u[j];
+ v[i] = t;
+ }
+}
+
+function AtAu(u,v,w) {
+ Au(u,w);
+ Atu(w,v);
+}
+
+function spectralnorm(n) {
+ var i, u=[], v=[], w=[], vv=0, vBv=0;
+ for (i=0; i<n; ++i) {
+ u[i] = 1; v[i] = w[i] = 0;
+ }
+ for (i=0; i<10; ++i) {
+ AtAu(u,v,w);
+ AtAu(v,u,w);
+ }
+ for (i=0; i<n; ++i) {
+ vBv += u[i]*v[i];
+ vv += v[i]*v[i];
+ }
+ return Math.sqrt(vBv/vv);
+}
+
+for (var i = 6; i <= 48; i *= 2) {
+ spectralnorm(i);
+}
+// The Computer Language Shootout
+// http://shootout.alioth.debian.org/
+//
+// contributed by Jesse Millikan
+// Base on the Ruby version by jose fco. gonzalez
+
+var l;
+var dnaInput = ">ONE Homo sapiens alu\n\
+GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGA\n\
+TCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACT\n\
+AAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAG\n\
+GCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCG\n\
+CCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGT\n\
+GGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCA\n\
+GGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAA\n\
+TTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAG\n\
+AATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCA\n\
+GCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGT\n\
+AATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACC\n\
+AGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTG\n\
+GTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACC\n\
+CGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAG\n\
+AGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTT\n\
+TGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACA\n\
+TGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCT\n\
+GTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGG\n\
+TTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGT\n\
+CTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGG\n\
+CGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCG\n\
+TCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTA\n\
+CTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCG\n\
+AGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCG\n\
+GGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACC\n\
+TGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAA\n\
+TACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGA\n\
+GGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACT\n\
+GCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTC\n\
+ACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGT\n\
+TCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGC\n\
+CGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCG\n\
+CTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTG\n\
+GGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCC\n\
+CAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCT\n\
+GGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGC\n\
+GCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGA\n\
+GGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGA\n\
+GACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGA\n\
+GGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTG\n\
+AAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAAT\n\
+CCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCA\n\
+GTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAA\n\
+AAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGC\n\
+GGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCT\n\
+ACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGG\n\
+GAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATC\n\
+GCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGC\n\
+GGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGG\n\
+TCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAA\n\
+AAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAG\n\
+GAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACT\n\
+CCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCC\n\
+TGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAG\n\
+ACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGC\n\
+GTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGA\n\
+ACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGA\n\
+CAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCA\n\
+CTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCA\n\
+ACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCG\n\
+CCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGG\n\
+AGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTC\n\
+CGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCG\n\
+AGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACC\n\
+CCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAG\n\
+CTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAG\n\
+CCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGG\n\
+CCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATC\n\
+ACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAA\n\
+AAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGC\n\
+TGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCC\n\
+ACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGG\n\
+CTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGG\n\
+AGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATT\n\
+AGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAA\n\
+TCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGC\n\
+CTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAA\n\
+TCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAG\n\
+CCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGT\n\
+GGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCG\n\
+GGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAG\n\
+CGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTG\n\
+GGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATG\n\
+GTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGT\n\
+AATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTT\n\
+GCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCT\n\
+CAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCG\n\
+GGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTC\n\
+TCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACT\n\
+CGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAG\n\
+ATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGG\n\
+CGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTG\n\
+AGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATA\n\
+CAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGG\n\
+CAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGC\n\
+ACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCAC\n\
+GCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTC\n\
+GAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCG\n\
+GGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCT\n\
+TGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGG\n\
+CGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCA\n\
+GCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGG\n\
+CCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGC\n\
+GCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGG\n\
+CGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGA\n\
+CTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGG\n\
+CCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAA\n\
+ACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCC\n\
+CAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGT\n\
+GAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAA\n\
+AGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGG\n\
+ATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTAC\n\
+TAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGA\n\
+GGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGC\n\
+GCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGG\n\
+TGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTC\n\
+AGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAA\n\
+ATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGA\n\
+GAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCC\n\
+AGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTG\n\
+TAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGAC\n\
+CAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGT\n\
+GGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAAC\n\
+CCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACA\n\
+GAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACT\n\
+TTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAAC\n\
+ATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCC\n\
+TGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAG\n\
+GTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCG\n\
+TCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAG\n\
+GCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCC\n\
+GTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCT\n\
+ACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCC\n\
+GAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCC\n\
+GGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCAC\n\
+CTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAA\n\
+ATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTG\n\
+AGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCAC\n\
+TGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCT\n\
+CACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAG\n\
+TTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAG\n\
+CCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATC\n\
+GCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCT\n\
+GGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATC\n\
+CCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCC\n\
+TGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGG\n\
+CGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGG\n\
+AGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCG\n\
+AGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGG\n\
+AGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGT\n\
+GAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAA\n\
+TCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGC\n\
+AGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCA\n\
+AAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGG\n\
+CGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTC\n\
+TACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCG\n\
+GGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGAT\n\
+CGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCG\n\
+CGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAG\n\
+GTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACA\n\
+AAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCA\n\
+GGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCAC\n\
+TCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGC\n\
+CTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGA\n\
+GACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGG\n\
+CGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTG\n\
+AACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCG\n\
+ACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGC\n\
+ACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCC\n\
+AACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGC\n\
+GCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCG\n\
+GAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACT\n\
+CCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCC\n\
+GAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAAC\n\
+CCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCA\n\
+GCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGA\n\
+GCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAG\n\
+GCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGAT\n\
+CACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTA\n\
+AAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGG\n\
+CTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGC\n\
+CACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTG\n\
+GCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAG\n\
+GAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAAT\n\
+TAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGA\n\
+ATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAG\n\
+CCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTA\n\
+ATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCA\n\
+GCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGG\n\
+TGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCC\n\
+GGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGA\n\
+GCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTT\n\
+GGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACAT\n\
+GGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTG\n\
+TAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGT\n\
+TGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTC\n\
+TCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGC\n\
+GGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGT\n\
+CTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTAC\n\
+TCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGA\n\
+GATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGG\n\
+GCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCT\n\
+GAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAAT\n\
+ACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAG\n\
+GCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTG\n\
+CACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCA\n\
+CGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTT\n\
+CGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCC\n\
+GGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGC\n\
+TTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGG\n\
+GCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCC\n\
+AGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTG\n\
+GCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCG\n\
+CGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAG\n\
+GCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAG\n\
+ACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAG\n\
+GCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGA\n\
+AACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATC\n\
+CCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAG\n\
+TGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAA\n\
+AAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCG\n\
+GATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTA\n\
+CTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGG\n\
+AGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCG\n\
+CGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCG\n\
+GTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGT\n\
+CAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAA\n\
+AATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGG\n\
+AGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTC\n\
+CAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCT\n\
+GTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGA\n\
+CCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCG\n\
+TGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAA\n\
+CCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGAC\n\
+AGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCAC\n\
+TTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAA\n\
+CATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGC\n\
+CTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGA\n\
+GGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCC\n\
+GTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGA\n\
+GGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCC\n\
+CGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGC\n\
+TACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGC\n\
+CGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGC\n\
+CGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCA\n\
+CCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAA\n\
+AATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCT\n\
+GAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCA\n\
+CTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGC\n\
+TCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGA\n\
+GTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTA\n\
+GCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAAT\n\
+CGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCC\n\
+TGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAAT\n\
+CCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGC\n\
+CTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTG\n\
+GCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGG\n\
+GAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGC\n\
+GAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG\n\
+GAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGG\n\
+TGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTA\n\
+ATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTG\n\
+CAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTC\n\
+AAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGG\n\
+GCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCT\n\
+CTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTC\n\
+GGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGA\n\
+TCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGC\n\
+GCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGA\n\
+GGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATAC\n\
+AAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGC\n\
+AGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCA\n\
+CTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACG\n\
+CCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCG\n\
+AGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGG\n\
+GCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTT\n\
+GAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGC\n\
+GACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAG\n\
+CACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGC\n\
+CAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCG\n\
+CGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGC\n\
+GGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGAC\n\
+TCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGC\n\
+CGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAA\n\
+CCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCC\n\
+AGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTG\n\
+AGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA\n\
+GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGA\n\
+TCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACT\n\
+AAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAG\n\
+GCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCG\n\
+CCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGT\n\
+GGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCA\n\
+GGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAA\n\
+TTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAG\n\
+AATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCA\n\
+GCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGT\n\
+AATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACC\n\
+AGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTG\n\
+GTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACC\n\
+CGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAG\n\
+AGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTT\n\
+TGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACA\n\
+TGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCT\n\
+GTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGG\n\
+TTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGT\n\
+CTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGG\n\
+
+CGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCG\n\
+TCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTA\n\
+CTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCG\n\
+AGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCG\n\
+GGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACC\n\
+TGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAA\n\
+TACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGA\n\
+GGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACT\n\
+GCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTC\n\
+ACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGT\n\
+TCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGC\n\
+CGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCG\n\
+CTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTG\n\
+GGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCC\n\
+CAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCT\n\
+GGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGC\n\
+GCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGA\n\
+GGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGA\n\
+GACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGA\n\
+GGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTG\n\
+AAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAAT\n\
+CCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCA\n\
+GTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAA\n\
+AAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGC\n\
+GGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCT\n\
+ACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGG\n\
+GAGGCTGAGGCAGGAGAATC\n\
+>TWO IUB ambiguity codes\n\
+cttBtatcatatgctaKggNcataaaSatgtaaaDcDRtBggDtctttataattcBgtcg\n\
+tactDtDagcctatttSVHtHttKtgtHMaSattgWaHKHttttagacatWatgtRgaaa\n\
+NtactMcSMtYtcMgRtacttctWBacgaaatatagScDtttgaagacacatagtVgYgt\n\
+cattHWtMMWcStgttaggKtSgaYaaccWStcgBttgcgaMttBYatcWtgacaYcaga\n\
+gtaBDtRacttttcWatMttDBcatWtatcttactaBgaYtcttgttttttttYaaScYa\n\
+HgtgttNtSatcMtcVaaaStccRcctDaataataStcYtRDSaMtDttgttSagtRRca\n\
+tttHatSttMtWgtcgtatSSagactYaaattcaMtWatttaSgYttaRgKaRtccactt\n\
+tattRggaMcDaWaWagttttgacatgttctacaaaRaatataataaMttcgDacgaSSt\n\
+acaStYRctVaNMtMgtaggcKatcttttattaaaaagVWaHKYagtttttatttaacct\n\
+tacgtVtcVaattVMBcttaMtttaStgacttagattWWacVtgWYagWVRctDattBYt\n\
+gtttaagaagattattgacVatMaacattVctgtBSgaVtgWWggaKHaatKWcBScSWa\n\
+accRVacacaaactaccScattRatatKVtactatatttHttaagtttSKtRtacaaagt\n\
+RDttcaaaaWgcacatWaDgtDKacgaacaattacaRNWaatHtttStgttattaaMtgt\n\
+tgDcgtMgcatBtgcttcgcgaDWgagctgcgaggggVtaaScNatttacttaatgacag\n\
+cccccacatYScaMgtaggtYaNgttctgaMaacNaMRaacaaacaKctacatagYWctg\n\
+ttWaaataaaataRattagHacacaagcgKatacBttRttaagtatttccgatctHSaat\n\
+actcNttMaagtattMtgRtgaMgcataatHcMtaBSaRattagttgatHtMttaaKagg\n\
+YtaaBataSaVatactWtataVWgKgttaaaacagtgcgRatatacatVtHRtVYataSa\n\
+KtWaStVcNKHKttactatccctcatgWHatWaRcttactaggatctataDtDHBttata\n\
+aaaHgtacVtagaYttYaKcctattcttcttaataNDaaggaaaDYgcggctaaWSctBa\n\
+aNtgctggMBaKctaMVKagBaactaWaDaMaccYVtNtaHtVWtKgRtcaaNtYaNacg\n\
+gtttNattgVtttctgtBaWgtaattcaagtcaVWtactNggattctttaYtaaagccgc\n\
+tcttagHVggaYtgtNcDaVagctctctKgacgtatagYcctRYHDtgBattDaaDgccK\n\
+tcHaaStttMcctagtattgcRgWBaVatHaaaataYtgtttagMDMRtaataaggatMt\n\
+ttctWgtNtgtgaaaaMaatatRtttMtDgHHtgtcattttcWattRSHcVagaagtacg\n\
+ggtaKVattKYagactNaatgtttgKMMgYNtcccgSKttctaStatatNVataYHgtNa\n\
+BKRgNacaactgatttcctttaNcgatttctctataScaHtataRagtcRVttacDSDtt\n\
+aRtSatacHgtSKacYagttMHtWataggatgactNtatSaNctataVtttRNKtgRacc\n\
+tttYtatgttactttttcctttaaacatacaHactMacacggtWataMtBVacRaSaatc\n\
+cgtaBVttccagccBcttaRKtgtgcctttttRtgtcagcRttKtaaacKtaaatctcac\n\
+aattgcaNtSBaaccgggttattaaBcKatDagttactcttcattVtttHaaggctKKga\n\
+tacatcBggScagtVcacattttgaHaDSgHatRMaHWggtatatRgccDttcgtatcga\n\
+aacaHtaagttaRatgaVacttagattVKtaaYttaaatcaNatccRttRRaMScNaaaD\n\
+gttVHWgtcHaaHgacVaWtgttScactaagSgttatcttagggDtaccagWattWtRtg\n\
+ttHWHacgattBtgVcaYatcggttgagKcWtKKcaVtgaYgWctgYggVctgtHgaNcV\n\
+taBtWaaYatcDRaaRtSctgaHaYRttagatMatgcatttNattaDttaattgttctaa\n\
+ccctcccctagaWBtttHtBccttagaVaatMcBHagaVcWcagBVttcBtaYMccagat\n\
+gaaaaHctctaacgttagNWRtcggattNatcRaNHttcagtKttttgWatWttcSaNgg\n\
+gaWtactKKMaacatKatacNattgctWtatctaVgagctatgtRaHtYcWcttagccaa\n\
+tYttWttaWSSttaHcaaaaagVacVgtaVaRMgattaVcDactttcHHggHRtgNcctt\n\
+tYatcatKgctcctctatVcaaaaKaaaagtatatctgMtWtaaaacaStttMtcgactt\n\
+taSatcgDataaactaaacaagtaaVctaggaSccaatMVtaaSKNVattttgHccatca\n\
+cBVctgcaVatVttRtactgtVcaattHgtaaattaaattttYtatattaaRSgYtgBag\n\
+aHSBDgtagcacRHtYcBgtcacttacactaYcgctWtattgSHtSatcataaatataHt\n\
+cgtYaaMNgBaatttaRgaMaatatttBtttaaaHHKaatctgatWatYaacttMctctt\n\
+ttVctagctDaaagtaVaKaKRtaacBgtatccaaccactHHaagaagaaggaNaaatBW\n\
+attccgStaMSaMatBttgcatgRSacgttVVtaaDMtcSgVatWcaSatcttttVatag\n\
+ttactttacgatcaccNtaDVgSRcgVcgtgaacgaNtaNatatagtHtMgtHcMtagaa\n\
+attBgtataRaaaacaYKgtRccYtatgaagtaataKgtaaMttgaaRVatgcagaKStc\n\
+tHNaaatctBBtcttaYaBWHgtVtgacagcaRcataWctcaBcYacYgatDgtDHccta\n\
+aagacYRcaggattHaYgtKtaatgcVcaataMYacccatatcacgWDBtgaatcBaata\n\
+cKcttRaRtgatgaBDacggtaattaaYtataStgVHDtDctgactcaaatKtacaatgc\n\
+gYatBtRaDatHaactgtttatatDttttaaaKVccYcaaccNcBcgHaaVcattHctcg\n\
+attaaatBtatgcaaaaatYMctSactHatacgaWacattacMBgHttcgaatVaaaaca\n\
+BatatVtctgaaaaWtctRacgBMaatSgRgtgtcgactatcRtattaScctaStagKga\n\
+DcWgtYtDDWKRgRtHatRtggtcgaHgggcgtattaMgtcagccaBggWVcWctVaaat\n\
+tcgNaatcKWagcNaHtgaaaSaaagctcYctttRVtaaaatNtataaccKtaRgtttaM\n\
+tgtKaBtRtNaggaSattHatatWactcagtgtactaKctatttgRYYatKatgtccgtR\n\
+tttttatttaatatVgKtttgtatgtNtataRatWYNgtRtHggtaaKaYtKSDcatcKg\n\
+taaYatcSRctaVtSMWtVtRWHatttagataDtVggacagVcgKWagBgatBtaaagNc\n\
+aRtagcataBggactaacacRctKgttaatcctHgDgttKHHagttgttaatgHBtatHc\n\
+DaagtVaBaRccctVgtgDtacRHSctaagagcggWYaBtSaKtHBtaaactYacgNKBa\n\
+VYgtaacttagtVttcttaatgtBtatMtMtttaattaatBWccatRtttcatagVgMMt\n\
+agctStKctaMactacDNYgKYHgaWcgaHgagattacVgtttgtRaSttaWaVgataat\n\
+gtgtYtaStattattMtNgWtgttKaccaatagNYttattcgtatHcWtctaaaNVYKKt\n\
+tWtggcDtcgaagtNcagatacgcattaagaccWctgcagcttggNSgaNcHggatgtVt\n\
+catNtRaaBNcHVagagaaBtaaSggDaatWaatRccaVgggStctDaacataKttKatt\n\
+tggacYtattcSatcttagcaatgaVBMcttDattctYaaRgatgcattttNgVHtKcYR\n\
+aatRKctgtaaacRatVSagctgtWacBtKVatctgttttKcgtctaaDcaagtatcSat\n\
+aWVgcKKataWaYttcccSaatgaaaacccWgcRctWatNcWtBRttYaattataaNgac\n\
+acaatagtttVNtataNaYtaatRaVWKtBatKagtaatataDaNaaaaataMtaagaaS\n\
+tccBcaatNgaataWtHaNactgtcDtRcYaaVaaaaaDgtttRatctatgHtgttKtga\n\
+aNSgatactttcgagWaaatctKaaDaRttgtggKKagcDgataaattgSaacWaVtaNM\n\
+acKtcaDaaatttctRaaVcagNacaScRBatatctRatcctaNatWgRtcDcSaWSgtt\n\
+RtKaRtMtKaatgttBHcYaaBtgatSgaSWaScMgatNtctcctatttctYtatMatMt\n\
+RRtSaattaMtagaaaaStcgVgRttSVaScagtgDtttatcatcatacRcatatDctta\n\
+tcatVRtttataaHtattcYtcaaaatactttgVctagtaaYttagatagtSYacKaaac\n\
+gaaKtaaatagataatSatatgaaatSgKtaatVtttatcctgKHaatHattagaaccgt\n\
+YaaHactRcggSBNgtgctaaBagBttgtRttaaattYtVRaaaattgtaatVatttctc\n\
+ttcatgBcVgtgKgaHaaatattYatagWacNctgaaMcgaattStagWaSgtaaKagtt\n\
+ttaagaDgatKcctgtaHtcatggKttVDatcaaggtYcgccagNgtgcVttttagagat\n\
+gctaccacggggtNttttaSHaNtatNcctcatSaaVgtactgBHtagcaYggYVKNgta\n\
+KBcRttgaWatgaatVtagtcgattYgatgtaatttacDacSctgctaaaStttaWMagD\n\
+aaatcaVYctccgggcgaVtaaWtStaKMgDtttcaaMtVgBaatccagNaaatcYRMBg\n\
+gttWtaaScKttMWtYataRaDBMaDataatHBcacDaaKDactaMgagttDattaHatH\n\
+taYatDtattDcRNStgaatattSDttggtattaaNSYacttcDMgYgBatWtaMagact\n\
+VWttctttgYMaYaacRgHWaattgRtaagcattctMKVStatactacHVtatgatcBtV\n\
+NataaBttYtSttacKgggWgYDtgaVtYgatDaacattYgatggtRDaVDttNactaSa\n\
+MtgNttaacaaSaBStcDctaccacagacgcaHatMataWKYtaYattMcaMtgSttDag\n\
+cHacgatcaHttYaKHggagttccgatYcaatgatRaVRcaagatcagtatggScctata\n\
+ttaNtagcgacgtgKaaWaactSgagtMYtcttccaKtStaacggMtaagNttattatcg\n\
+tctaRcactctctDtaacWYtgaYaSaagaWtNtatttRacatgNaatgttattgWDDcN\n\
+aHcctgaaHacSgaataaRaataMHttatMtgaSDSKatatHHaNtacagtccaYatWtc\n\
+actaactatKDacSaStcggataHgYatagKtaatKagStaNgtatactatggRHacttg\n\
+tattatgtDVagDVaRctacMYattDgtttYgtctatggtKaRSttRccRtaaccttaga\n\
+gRatagSaaMaacgcaNtatgaaatcaRaagataatagatactcHaaYKBctccaagaRa\n\
+BaStNagataggcgaatgaMtagaatgtcaKttaaatgtaWcaBttaatRcggtgNcaca\n\
+aKtttScRtWtgcatagtttWYaagBttDKgcctttatMggNttattBtctagVtacata\n\
+aaYttacacaaRttcYtWttgHcaYYtaMgBaBatctNgcDtNttacgacDcgataaSat\n\
+YaSttWtcctatKaatgcagHaVaacgctgcatDtgttaSataaaaYSNttatagtaNYt\n\
+aDaaaNtggggacttaBggcHgcgtNtaaMcctggtVtaKcgNacNtatVaSWctWtgaW\n\
+cggNaBagctctgaYataMgaagatBSttctatacttgtgtKtaattttRagtDtacata\n\
+tatatgatNHVgBMtKtaKaNttDHaagatactHaccHtcatttaaagttVaMcNgHata\n\
+tKtaNtgYMccttatcaaNagctggacStttcNtggcaVtattactHaSttatgNMVatt\n\
+MMDtMactattattgWMSgtHBttStStgatatRaDaagattttctatMtaaaaaggtac\n\
+taaVttaSacNaatactgMttgacHaHRttgMacaaaatagttaatatWKRgacDgaRta\n\
+tatttattatcYttaWtgtBRtWatgHaaattHataagtVaDtWaVaWtgStcgtMSgaS\n\
+RgMKtaaataVacataatgtaSaatttagtcgaaHtaKaatgcacatcggRaggSKctDc\n\
+agtcSttcccStYtccRtctctYtcaaKcgagtaMttttcRaYDttgttatctaatcata\n\
+NctctgctatcaMatactataggDaHaaSttMtaDtcNatataattctMcStaaBYtaNa\n\
+gatgtaatHagagSttgWHVcttatKaYgDctcttggtgttMcRaVgSgggtagacaata\n\
+aDtaattSaDaNaHaBctattgNtaccaaRgaVtKNtaaYggHtaKKgHcatctWtctDt\n\
+ttctttggSDtNtaStagttataaacaattgcaBaBWggHgcaaaBtYgctaatgaaatW\n\
+cDcttHtcMtWWattBHatcatcaaatctKMagtDNatttWaBtHaaaNgMttaaStagt\n\
+tctctaatDtcRVaYttgttMtRtgtcaSaaYVgSWDRtaatagctcagDgcWWaaaBaa\n\
+RaBctgVgggNgDWStNaNBKcBctaaKtttDcttBaaggBttgaccatgaaaNgttttt\n\
+tttatctatgttataccaaDRaaSagtaVtDtcaWatBtacattaWacttaSgtattggD\n\
+gKaaatScaattacgWcagKHaaccaYcRcaRttaDttRtttHgaHVggcttBaRgtccc\n\
+tDatKaVtKtcRgYtaKttacgtatBtStaagcaattaagaRgBagSaattccSWYttta\n\
+ttVaataNctgHgttaaNBgcVYgtRtcccagWNaaaacaDNaBcaaaaRVtcWMgBagM\n\
+tttattacgDacttBtactatcattggaaatVccggttRttcatagttVYcatYaSHaHc\n\
+ttaaagcNWaHataaaRWtctVtRYtagHtaaaYMataHYtNBctNtKaatattStgaMc\n\
+BtRgctaKtgcScSttDgYatcVtggaaKtaagatWccHccgKYctaNNctacaWctttt\n\
+gcRtgtVcgaKttcMRHgctaHtVaataaDtatgKDcttatBtDttggNtacttttMtga\n\
+acRattaaNagaactcaaaBBVtcDtcgaStaDctgaaaSgttMaDtcgttcaccaaaag\n\
+gWtcKcgSMtcDtatgtttStaaBtatagDcatYatWtaaaBacaKgcaDatgRggaaYc\n\
+taRtccagattDaWtttggacBaVcHtHtaacDacYgtaatataMagaatgHMatcttat\n\
+acgtatttttatattacHactgttataMgStYaattYaccaattgagtcaaattaYtgta\n\
+tcatgMcaDcgggtcttDtKgcatgWRtataatatRacacNRBttcHtBgcRttgtgcgt\n\
+catacMtttBctatctBaatcattMttMYgattaaVYatgDaatVagtattDacaacDMa\n\
+tcMtHcccataagatgBggaccattVWtRtSacatgctcaaggggYtttDtaaNgNtaaB\n\
+atggaatgtctRtaBgBtcNYatatNRtagaacMgagSaSDDSaDcctRagtVWSHtVSR\n\
+ggaacaBVaccgtttaStagaacaMtactccagtttVctaaRaaHttNcttagcaattta\n\
+ttaatRtaaaatctaacDaBttggSagagctacHtaaRWgattcaaBtctRtSHaNtgta\n\
+cattVcaHaNaagtataccacaWtaRtaaVKgMYaWgttaKggKMtKcgWatcaDatYtK\n\
+SttgtacgaccNctSaattcDcatcttcaaaDKttacHtggttHggRRaRcaWacaMtBW\n\
+VHSHgaaMcKattgtaRWttScNattBBatYtaNRgcggaagacHSaattRtttcYgacc\n\
+BRccMacccKgatgaacttcgDgHcaaaaaRtatatDtatYVtttttHgSHaSaatagct\n\
+NYtaHYaVYttattNtttgaaaYtaKttWtctaNtgagaaaNctNDctaaHgttagDcRt\n\
+tatagccBaacgcaRBtRctRtggtaMYYttWtgataatcgaataattattataVaaaaa\n\
+ttacNRVYcaaMacNatRttcKatMctgaagactaattataaYgcKcaSYaatMNctcaa\n\
+cgtgatttttBacNtgatDccaattattKWWcattttatatatgatBcDtaaaagttgaa\n\
+VtaHtaHHtBtataRBgtgDtaataMttRtDgDcttattNtggtctatctaaBcatctaR\n\
+atgNacWtaatgaagtcMNaacNgHttatactaWgcNtaStaRgttaaHacccgaYStac\n\
+aaaatWggaYaWgaattattcMaactcBKaaaRVNcaNRDcYcgaBctKaacaaaaaSgc\n\
+tccYBBHYaVagaatagaaaacagYtctVccaMtcgtttVatcaatttDRtgWctagtac\n\
+RttMctgtDctttcKtWttttataaatgVttgBKtgtKWDaWagMtaaagaaattDVtag\n\
+gttacatcatttatgtcgMHaVcttaBtVRtcgtaYgBRHatttHgaBcKaYWaatcNSc\n\
+tagtaaaaatttacaatcactSWacgtaatgKttWattagttttNaggtctcaagtcact\n\
+attcttctaagKggaataMgtttcataagataaaaatagattatDgcBVHWgaBKttDgc\n\
+atRHaagcaYcRaattattatgtMatatattgHDtcaDtcaaaHctStattaatHaccga\n\
+cNattgatatattttgtgtDtRatagSacaMtcRtcattcccgacacSattgttKaWatt\n\
+NHcaacttccgtttSRtgtctgDcgctcaaMagVtBctBMcMcWtgtaacgactctcttR\n\
+ggRKSttgYtYatDccagttDgaKccacgVatWcataVaaagaataMgtgataaKYaaat\n\
+cHDaacgataYctRtcYatcgcaMgtNttaBttttgatttaRtStgcaacaaaataccVg\n\
+aaDgtVgDcStctatatttattaaaaRKDatagaaagaKaaYYcaYSgKStctccSttac\n\
+agtcNactttDVttagaaagMHttRaNcSaRaMgBttattggtttaRMggatggcKDgWR\n\
+tNaataataWKKacttcKWaaagNaBttaBatMHtccattaacttccccYtcBcYRtaga\n\
+ttaagctaaYBDttaNtgaaaccHcaRMtKtaaHMcNBttaNaNcVcgVttWNtDaBatg\n\
+ataaVtcWKcttRggWatcattgaRagHgaattNtatttctctattaattaatgaDaaMa\n\
+tacgttgggcHaYVaaNaDDttHtcaaHtcVVDgBVagcMacgtgttaaBRNtatRtcag\n\
+taagaggtttaagacaVaaggttaWatctccgtVtaDtcDatttccVatgtacNtttccg\n\
+tHttatKgScBatgtVgHtYcWagcaKtaMYaaHgtaattaSaHcgcagtWNaatNccNN\n\
+YcacgVaagaRacttctcattcccRtgtgtaattagcSttaaStWaMtctNNcSMacatt\n\
+ataaactaDgtatWgtagtttaagaaaattgtagtNagtcaataaatttgatMMYactaa\n\
+tatcggBWDtVcYttcDHtVttatacYaRgaMaacaStaatcRttttVtagaDtcacWat\n\
+ttWtgaaaagaaagNRacDtttStVatBaDNtaactatatcBSMcccaSttccggaMatg\n\
+attaaWatKMaBaBatttgataNctgttKtVaagtcagScgaaaDggaWgtgttttKtWt\n\
+atttHaatgtagttcactaaKMagttSYBtKtaYgaactcagagRtatagtVtatcaaaW\n\
+YagcgNtaDagtacNSaaYDgatBgtcgataacYDtaaactacagWDcYKaagtttatta\n\
+gcatcgagttKcatDaattgattatDtcagRtWSKtcgNtMaaaaacaMttKcaWcaaSV\n\
+MaaaccagMVtaMaDtMaHaBgaacataBBVtaatVYaNSWcSgNtDNaaKacacBttta\n\
+tKtgtttcaaHaMctcagtaacgtcgYtactDcgcctaNgagagcYgatattttaaattt\n\
+ccattttacatttDaaRctattttWctttacgtDatYtttcagacgcaaVttagtaaKaa\n\
+aRtgVtccataBggacttatttgtttaWNtgttVWtaWNVDaattgtatttBaagcBtaa\n\
+BttaaVatcHcaVgacattccNggtcgacKttaaaRtagRtctWagaYggtgMtataatM\n\
+tgaaRttattttgWcttNtDRRgMDKacagaaaaggaaaRStcccagtYccVattaNaaK\n\
+StNWtgacaVtagaagcttSaaDtcacaacgDYacWDYtgtttKatcVtgcMaDaSKStV\n\
+cgtagaaWaKaagtttcHaHgMgMtctataagBtKaaaKKcactggagRRttaagaBaaN\n\
+atVVcgRcKSttDaactagtSttSattgttgaaRYatggttVttaataaHttccaagDtg\n\
+atNWtaagHtgcYtaactRgcaatgMgtgtRaatRaNaacHKtagactactggaatttcg\n\
+ccataacgMctRgatgttaccctaHgtgWaYcactcacYaattcttaBtgacttaaacct\n\
+gYgaWatgBttcttVttcgttWttMcNYgtaaaatctYgMgaaattacNgaHgaacDVVM\n\
+tttggtHtctaaRgtacagacgHtVtaBMNBgattagcttaRcttacaHcRctgttcaaD\n\
+BggttKaacatgKtttYataVaNattccgMcgcgtagtRaVVaattaKaatggttRgaMc\n\
+agtatcWBttNtHagctaatctagaaNaaacaYBctatcgcVctBtgcaaagDgttVtga\n\
+HtactSNYtaaNccatgtgDacgaVtDcgKaRtacDcttgctaagggcagMDagggtBWR\n\
+tttSgccttttttaacgtcHctaVtVDtagatcaNMaVtcVacatHctDWNaataRgcgt\n\
+aVHaggtaaaaSgtttMtattDgBtctgatSgtRagagYtctSaKWaataMgattRKtaa\n\
+catttYcgtaacacattRWtBtcggtaaatMtaaacBatttctKagtcDtttgcBtKYYB\n\
+aKttctVttgttaDtgattttcttccacttgSaaacggaaaNDaattcYNNaWcgaaYat\n\
+tttMgcBtcatRtgtaaagatgaWtgaccaYBHgaatagataVVtHtttVgYBtMctaMt\n\
+cctgaDcYttgtccaaaRNtacagcMctKaaaggatttacatgtttaaWSaYaKttBtag\n\
+DacactagctMtttNaKtctttcNcSattNacttggaacaatDagtattRtgSHaataat\n\
+gccVgacccgatactatccctgtRctttgagaSgatcatatcgDcagWaaHSgctYYWta\n\
+tHttggttctttatVattatcgactaagtgtagcatVgtgHMtttgtttcgttaKattcM\n\
+atttgtttWcaaStNatgtHcaaaDtaagBaKBtRgaBgDtSagtatMtaacYaatYtVc\n\
+KatgtgcaacVaaaatactKcRgtaYtgtNgBBNcKtcttaccttKgaRaYcaNKtactt\n\
+tgagSBtgtRagaNgcaaaNcacagtVtttHWatgttaNatBgtttaatNgVtctgaata\n\
+tcaRtattcttttttttRaaKcRStctcggDgKagattaMaaaKtcaHacttaataataK\n\
+taRgDtKVBttttcgtKaggHHcatgttagHggttNctcgtatKKagVagRaaaggaaBt\n\
+NatttVKcRttaHctaHtcaaatgtaggHccaBataNaNaggttgcWaatctgatYcaaa\n\
+HaatWtaVgaaBttagtaagaKKtaaaKtRHatMaDBtBctagcatWtatttgWttVaaa\n\
+ScMNattRactttgtYtttaaaagtaagtMtaMaSttMBtatgaBtttaKtgaatgagYg\n\
+tNNacMtcNRacMMHcttWtgtRtctttaacaacattattcYaMagBaacYttMatcttK\n\
+cRMtgMNccattaRttNatHaHNaSaaHMacacaVaatacaKaSttHatattMtVatWga\n\
+ttttttaYctttKttHgScWaacgHtttcaVaaMgaacagNatcgttaacaaaaagtaca\n\
+HBNaattgttKtcttVttaaBtctgctacgBgcWtttcaggacacatMgacatcccagcg\n\
+gMgaVKaBattgacttaatgacacacaaaaaatRKaaBctacgtRaDcgtagcVBaacDS\n\
+BHaaaaSacatatacagacRNatcttNaaVtaaaataHattagtaaaaSWccgtatWatg\n\
+gDttaactattgcccatcttHaSgYataBttBaactattBtcHtgatcaataSttaBtat\n\
+KSHYttWggtcYtttBttaataccRgVatStaHaKagaatNtagRMNgtcttYaaSaact\n\
+cagDSgagaaYtMttDtMRVgWKWtgMaKtKaDttttgactatacataatcNtatNaHat\n\
+tVagacgYgatatatttttgtStWaaatctWaMgagaRttRatacgStgattcttaagaD\n\
+taWccaaatRcagcagaaNKagtaaDggcgccBtYtagSBMtactaaataMataBSacRM\n\
+gDgattMMgtcHtcaYDtRaDaacggttDaggcMtttatgttaNctaattaVacgaaMMt\n\
+aatDccSgtattgaRtWWaccaccgagtactMcgVNgctDctaMScatagcgtcaactat\n\
+acRacgHRttgctatttaatgaattataYKttgtaagWgtYttgcHgMtaMattWaWVta\n\
+RgcttgYgttBHtYataSccStBtgtagMgtDtggcVaaSBaatagDttgBgtctttctc\n\
+attttaNagtHKtaMWcYactVcgcgtatMVtttRacVagDaatcttgctBBcRDgcaac\n\
+KttgatSKtYtagBMagaRtcgBattHcBWcaactgatttaatttWDccatttatcgagS\n\
+KaWttataHactaHMttaatHtggaHtHagaatgtKtaaRactgtttMatacgatcaagD\n\
+gatKaDctataMggtHDtggHacctttRtatcttYattttgacttgaaSaataaatYcgB\n\
+aaaaccgNatVBttMacHaKaataagtatKgtcaagactcttaHttcggaattgttDtct\n\
+aaccHttttWaaatgaaatataaaWattccYDtKtaaaacggtgaggWVtctattagtga\n\
+ctattaagtMgtttaagcatttgSgaaatatccHaaggMaaaattttcWtatKctagDtY\n\
+tMcctagagHcactttactatacaaacattaacttaHatcVMYattYgVgtMttaaRtga\n\
+aataaDatcaHgtHHatKcDYaatcttMtNcgatYatgSaMaNtcttKcWataScKggta\n\
+tcttacgcttWaaagNatgMgHtctttNtaacVtgttcMaaRatccggggactcMtttaY\n\
+MtcWRgNctgNccKatcttgYDcMgattNYaRagatHaaHgKctcataRDttacatBatc\n\
+cattgDWttatttaWgtcggagaaaaatacaatacSNtgggtttccttacSMaagBatta\n\
+caMaNcactMttatgaRBacYcYtcaaaWtagctSaacttWgDMHgaggatgBVgcHaDt\n\
+ggaactttggtcNatNgtaKaBcccaNtaagttBaacagtatacDYttcctNgWgcgSMc\n\
+acatStctHatgRcNcgtacacaatRttMggaNKKggataaaSaYcMVcMgtaMaHtgat\n\
+tYMatYcggtcttcctHtcDccgtgRatcattgcgccgatatMaaYaataaYSggatagc\n\
+gcBtNtaaaScaKgttBgagVagttaKagagtatVaactaSacWactSaKatWccaKaaa\n\
+atBKgaaKtDMattttgtaaatcRctMatcaaMagMttDgVatggMaaWgttcgaWatga\n\
+aatttgRtYtattaWHKcRgctacatKttctaccaaHttRatctaYattaaWatVNccat\n\
+NgagtcKttKataStRaatatattcctRWatDctVagttYDgSBaatYgttttgtVaatt\n\
+taatagcagMatRaacttBctattgtMagagattaaactaMatVtHtaaatctRgaaaaa\n\
+aaatttWacaacaYccYDSaattMatgaccKtaBKWBattgtcaagcHKaagttMMtaat\n\
+ttcKcMagNaaKagattggMagaggtaatttYacatcWaaDgatMgKHacMacgcVaaca\n\
+DtaDatatYggttBcgtatgWgaSatttgtagaHYRVacaRtctHaaRtatgaactaata\n\
+tctSSBgggaaHMWtcaagatKgagtDaSatagttgattVRatNtctMtcSaagaSHaat\n\
+aNataataRaaRgattctttaataaagWaRHcYgcatgtWRcttgaaggaMcaataBRaa\n\
+ccagStaaacNtttcaatataYtaatatgHaDgcStcWttaacctaRgtYaRtataKtgM\n\
+ttttatgactaaaatttacYatcccRWtttHRtattaaatgtttatatttgttYaatMca\n\
+RcSVaaDatcgtaYMcatgtagacatgaaattgRtcaaYaaYtRBatKacttataccaNa\n\
+aattVaBtctggacaagKaaYaaatatWtMtatcYaaVNtcgHaactBaagKcHgtctac\n\
+aatWtaDtSgtaHcataHtactgataNctRgttMtDcDttatHtcgtacatcccaggStt\n\
+aBgtcacacWtccNMcNatMVaVgtccDYStatMaccDatggYaRKaaagataRatttHK\n\
+tSaaatDgataaacttaHgttgVBtcttVttHgDacgaKatgtatatNYataactctSat\n\
+atatattgcHRRYttStggaactHgttttYtttaWtatMcttttctatctDtagVHYgMR\n\
+BgtHttcctaatYRttKtaagatggaVRataKDctaMtKBNtMtHNtWtttYcVtattMc\n\
+gRaacMcctNSctcatttaaagDcaHtYccSgatgcaatYaaaaDcttcgtaWtaattct\n\
+cgttttScttggtaatctttYgtctaactKataHacctMctcttacHtKataacacagcN\n\
+RatgKatttttSaaatRYcgDttaMRcgaaattactMtgcgtaagcgttatBtttttaat\n\
+taagtNacatHgttcRgacKcBBtVgatKttcgaBaatactDRgtRtgaNacWtcacYtt\n\
+aaKcgttctHaKttaNaMgWgWaggtctRgaKgWttSttBtDcNtgtttacaaatYcDRt\n\
+gVtgcctattcNtctaaaDMNttttNtggctgagaVctDaacVtWccaagtaacacaNct\n\
+gaScattccDHcVBatcgatgtMtaatBgHaatDctMYgagaatgYWKcctaatNaStHa\n\
+aaKccgHgcgtYaaYtattgtStgtgcaaRtattaKatattagaWVtcaMtBagttatta\n\
+gNaWHcVgcaattttDcMtgtaRHVYtHtctgtaaaaHVtMKacatcgNaatttMatatg\n\
+ttgttactagWYtaRacgataKagYNKcattataNaRtgaacKaYgcaaYYacaNccHat\n\
+MatDcNgtHttRaWttagaaDcaaaaaatagggtKDtStaDaRtaVtHWKNtgtattVct\n\
+SVgRgataDaRaWataBgaagaaKtaataaYgDcaStaNgtaDaaggtattHaRaWMYaY\n\
+aWtggttHYgagVtgtgcttttcaaDKcagVcgttagacNaaWtagtaataDttctggtt\n\
+VcatcataaagtgKaaaNaMtaBBaattaatWaattgctHaVKaSgDaaVKaHtatatat\n\
+HatcatSBagNgHtatcHYMHgttDgtaHtBttWatcgtttaRaattgStKgSKNWKatc\n\
+agDtctcagatttctRtYtBatBgHHtKaWtgYBgacVVWaKtacKcDttKMaKaVcggt\n\
+gttataagaataaHaatattagtataatMHgttYgaRttagtaRtcaaVatacggtcMcg\n\
+agtaaRttacWgactKRYataaaagSattYaWgagatYagKagatgSaagKgttaatMgg\n\
+tataatgttWYttatgagaaacctNVataatHcccKtDctcctaatactggctHggaSag\n\
+gRtKHaWaattcgSatMatttagaggcYtctaMcgctcataSatatgRagacNaaDagga\n\
+VBagaYttKtacNaKgtSYtagttggaWcatcWttaatctatgaVtcgtgtMtatcaYcg\n\
+tRccaaYgDctgcMgtgtWgacWtgataacacgcgctBtgttaKtYDtatDcatcagKaV\n\
+MctaatcttgVcaaRgcRMtDcgattaHttcaNatgaatMtactacVgtRgatggaWttt\n\
+actaaKatgagSaaKggtaNtactVaYtaaKRagaacccacaMtaaMtKtatBcttgtaa\n\
+WBtMctaataaVcDaaYtcRHBtcgttNtaaHatttBNgRStVDattBatVtaagttaYa\n\
+tVattaagaBcacggtSgtVtatttaRattgatgtaHDKgcaatattKtggcctatgaWD\n\
+KRYcggattgRctatNgatacaatMNttctgtcRBYRaaaHctNYattcHtaWcaattct\n\
+BtMKtVgYataatMgYtcagcttMDataVtggRtKtgaatgccNcRttcaMtRgattaac\n\
+attRcagcctHtWMtgtDRagaKaBtgDttYaaaaKatKgatctVaaYaacWcgcatagB\n\
+VtaNtRtYRaggBaaBtgKgttacataagagcatgtRattccacttaccatRaaatgWgD\n\
+aMHaYVgVtaSctatcgKaatatattaDgacccYagtgtaYNaaatKcagtBRgagtcca\n\
+tgKgaaaccBgaagBtgSttWtacgatWHaYatcgatttRaaNRgcaNaKVacaNtDgat\n\
+tgHVaatcDaagcgtatgcNttaDataatcSataaKcaataaHWataBtttatBtcaKtK\n\
+tatagttaDgSaYctacaRatNtaWctSaatatttYaKaKtaccWtatcRagacttaYtt\n\
+VcKgSDcgagaagatccHtaattctSttatggtKYgtMaHagVaBRatttctgtRgtcta\n\
+tgggtaHKgtHacHtSYacgtacacHatacKaaBaVaccaDtatcSaataaHaagagaat\n\
+ScagactataaRttagcaaVcaHataKgDacatWccccaagcaBgagWatctaYttgaaa\n\
+tctVNcYtttWagHcgcgcDcVaaatgttKcHtNtcaatagtgtNRaactttttcaatgg\n\
+WgBcgDtgVgtttctacMtaaataaaRggaaacWaHttaRtNtgctaaRRtVBctYtVta\n\
+tDcattDtgaccYatagatYRKatNYKttNgcctagtaWtgaactaMVaacctgaStttc\n\
+tgaKVtaaVaRKDttVtVctaDNtataaaDtccccaagtWtcgatcactDgYaBcatcct\n\
+MtVtacDaaBtYtMaKNatNtcaNacgDatYcatcgcaRatWBgaacWttKttagYtaat\n\
+tcggttgSWttttDWctttacYtatatWtcatDtMgtBttgRtVDggttaacYtacgtac\n\
+atgaattgaaWcttMStaDgtatattgaDtcRBcattSgaaVBRgagccaaKtttcDgcg\n\
+aSMtatgWattaKttWtgDBMaggBBttBaatWttRtgcNtHcgttttHtKtcWtagHSt\n\
+aacagttgatatBtaWSaWggtaataaMttaKacDaatactcBttcaatatHttcBaaSa\n\
+aatYggtaRtatNtHcaatcaHtagVtgtattataNggaMtcttHtNagctaaaggtaga\n\
+YctMattNaMVNtcKtactBKcaHHcBttaSagaKacataYgctaKaYgttYcgacWVtt\n\
+WtSagcaacatcccHaccKtcttaacgaKttcacKtNtacHtatatRtaaatacactaBt\n\
+ttgaHaRttggttWtatYagcatYDatcggagagcWBataagRtacctataRKgtBgatg\n\
+aDatataSttagBaHtaatNtaDWcWtgtaattacagKttcNtMagtattaNgtctcgtc\n\
+ctcttBaHaKcKccgtRcaaYagSattaagtKataDatatatagtcDtaacaWHcaKttD\n\
+gaaRcgtgYttgtcatatNtatttttatggccHtgDtYHtWgttatYaacaattcaWtat\n\
+NgctcaaaSttRgctaatcaaatNatcgtttaBtNNVtgttataagcaaagattBacgtD\n\
+atttNatttaaaDcBgtaSKgacgtagataatttcHMVNttgttBtDtgtaWKaaRMcKM\n\
+tHtaVtagataWctccNNaSWtVaHatctcMgggDgtNHtDaDttatatVWttgttattt\n\
+aacctttcacaaggaSaDcggttttttatatVtctgVtaacaStDVaKactaMtttaSNa\n\
+gtgaaattaNacttSKctattcctctaSagKcaVttaagNaVcttaVaaRNaHaaHttat\n\
+gtHttgtgatMccaggtaDcgaccgtWgtWMtttaHcRtattgScctatttKtaaccaag\n\
+tYagaHgtWcHaatgccKNRtttagtMYSgaDatctgtgaWDtccMNcgHgcaaacNDaa\n\
+aRaStDWtcaaaaHKtaNBctagBtgtattaactaattttVctagaatggcWSatMaccc\n\
+ttHttaSgSgtgMRcatRVKtatctgaaaccDNatYgaaVHNgatMgHRtacttaaaRta\n\
+tStRtDtatDttYatattHggaBcttHgcgattgaKcKtttcRataMtcgaVttWacatN\n\
+catacctRataDDatVaWNcggttgaHtgtMacVtttaBHtgagVttMaataattatgtt\n\
+cttagtttgtgcDtSatttgBtcaacHattaaBagVWcgcaSYttMgcttacYKtVtatc\n\
+aYaKctgBatgcgggcYcaaaaacgNtctagKBtattatctttKtaVttatagtaYtRag\n\
+NtaYataaVtgaatatcHgcaaRataHtacacatgtaNtgtcgYatWMatttgaactacR\n\
+ctaWtWtatacaatctBatatgYtaagtatgtgtatSttactVatcttYtaBcKgRaSgg\n\
+RaaaaatgcagtaaaWgtaRgcgataatcBaataccgtatttttccatcNHtatWYgatH\n\
+SaaaDHttgctgtccHtggggcctaataatttttctatattYWtcattBtgBRcVttaVM\n\
+RSgctaatMagtYtttaaaaatBRtcBttcaaVtaacagctccSaaSttKNtHtKYcagc\n\
+agaaaccccRtttttaaDcDtaStatccaagcgctHtatcttaDRYgatDHtWcaaaBcW\n\
+gKWHttHataagHacgMNKttMKHccaYcatMVaacgttaKgYcaVaaBtacgcaacttt\n\
+MctaaHaatgtBatgagaSatgtatgSRgHgWaVWgataaatatttccKagVgataattW\n\
+aHNcYggaaatgctHtKtaDtctaaagtMaatVDVactWtSaaWaaMtaHtaSKtcBRaN\n\
+cttStggtBttacNagcatagRgtKtgcgaacaacBcgKaatgataagatgaaaattgta\n\
+ctgcgggtccHHWHaaNacaBttNKtKtcaaBatatgctaHNgtKcDWgtttatNgVDHg\n\
+accaacWctKaaggHttgaRgYaatHcaBacaatgagcaaattactgtaVaaYaDtagat\n\
+tgagNKggtggtgKtWKaatacagDRtatRaMRtgattDggtcaaYRtatttNtagaDtc\n\
+acaaSDctDtataatcgtactaHttatacaatYaacaaHttHatHtgcgatRRttNgcat\n\
+SVtacWWgaaggagtatVMaVaaattScDDKNcaYBYaDatHgtctatBagcaacaagaa\n\
+tgagaaRcataaKNaRtBDatcaaacgcattttttaaBtcSgtacaRggatgtMNaattg\n\
+gatatWtgagtattaaaVctgcaYMtatgatttttYgaHtgtcttaagWBttHttgtctt\n\
+attDtcgtatWtataataSgctaHagcDVcNtaatcaagtaBDaWaDgtttagYctaNcc\n\
+DtaKtaHcttaataacccaRKtacaVaatNgcWRaMgaattatgaBaaagattVYaHMDc\n\
+aDHtcRcgYtcttaaaWaaaVKgatacRtttRRKYgaatacaWVacVcRtatMacaBtac\n\
+tggMataaattttHggNagSctacHgtBagcgtcgtgattNtttgatSaaggMttctttc\n\
+ttNtYNagBtaaacaaatttMgaccttacataattgYtcgacBtVMctgStgMDtagtaR\n\
+ctHtatgttcatatVRNWataDKatWcgaaaaagttaaaagcacgHNacgtaatctttMR\n\
+tgacttttDacctataaacgaaatatgattagaactccSYtaBctttaataacWgaaaYa\n\
+tagatgWttcatKtNgatttttcaagHtaYgaaRaDaagtaggagcttatVtagtctttc\n\
+attaaaatcgKtattaRttacagVaDatgcatVgattgggtctttHVtagKaaRBtaHta\n\
+aggccccaaaaKatggtttaMWgtBtaaacttcactttKHtcgatctccctaYaBacMgt\n\
+cttBaBaNgcgaaacaatctagtHccHtKttcRtRVttccVctttcatacYagMVtMcag\n\
+aMaaacaataBctgYtaatRaaagattaaccatVRatHtaRagcgcaBcgDttStttttc\n\
+VtttaDtKgcaaWaaaaatSccMcVatgtKgtaKgcgatatgtagtSaaaDttatacaaa\n\
+catYaRRcVRHctKtcgacKttaaVctaDaatgttMggRcWaacttttHaDaKaDaBctg\n\
+taggcgtttaHBccatccattcNHtDaYtaataMttacggctNVaacDattgatatttta\n\
+cVttSaattacaaRtataNDgacVtgaacataVRttttaDtcaaacataYDBtttaatBa\n\
+DtttYDaDaMccMttNBttatatgagaaMgaNtattHccNataattcaHagtgaaggDga\n\
+tgtatatatgYatgaStcataaBStWacgtcccataRMaaDattggttaaattcMKtctM\n\
+acaBSactcggaatDDgatDgcWctaacaccgggaVcacWKVacggtaNatatacctMta\n\
+tgatagtgcaKagggVaDtgtaacttggagtcKatatcgMcttRaMagcattaBRaStct\n\
+YSggaHYtacaactMBaagDcaBDRaaacMYacaHaattagcattaaaHgcgctaaggSc\n\
+cKtgaaKtNaBtatDDcKBSaVtgatVYaagVtctSgMctacgttaacWaaattctSgtD\n\
+actaaStaaattgcagBBRVctaatatacctNttMcRggctttMttagacRaHcaBaacV\n\
+KgaataHttttMgYgattcYaNRgttMgcVaaacaVVcDHaatttgKtMYgtatBtVVct\n\
+WgVtatHtacaaHttcacgatagcagtaaNattBatatatttcVgaDagcggttMaagtc\n\
+ScHagaaatgcYNggcgtttttMtStggtRatctacttaaatVVtBacttHNttttaRca\n\
+aatcacagHgagagtMgatcSWaNRacagDtatactaaDKaSRtgattctccatSaaRtt\n\
+aaYctacacNtaRtaactggatgaccYtacactttaattaattgattYgttcagDtNKtt\n\
+agDttaaaaaaaBtttaaNaYWKMBaaaacVcBMtatWtgBatatgaacVtattMtYatM\n\
+NYDKNcKgDttDaVtaaaatgggatttctgtaaatWtctcWgtVVagtcgRgacttcccc\n\
+taDcacagcRcagagtgtWSatgtacatgttaaSttgtaaHcgatgggMagtgaacttat\n\
+RtttaVcaccaWaMgtactaatSSaHtcMgaaYtatcgaaggYgggcgtgaNDtgttMNg\n\
+aNDMtaattcgVttttaacatgVatgtWVMatatcaKgaaattcaBcctccWcttgaaWH\n\
+tWgHtcgNWgaRgctcBgSgaattgcaaHtgattgtgNagtDttHHgBttaaWcaaWagc\n\
+aSaHHtaaaVctRaaMagtaDaatHtDMtcVaWMtagSagcttHSattaacaaagtRacM\n\
+tRtctgttagcMtcaBatVKtKtKacgagaSNatSactgtatatcBctgagVtYactgta\n\
+aattaaaggcYgDHgtaacatSRDatMMccHatKgttaacgactKtgKagtcttcaaHRV\n\
+tccttKgtSataatttacaactggatDNgaacttcaRtVaagDcaWatcBctctHYatHa\n\
+DaaatttagYatSatccaWtttagaaatVaacBatHcatcgtacaatatcgcNYRcaata\n\
+YaRaYtgattVttgaatgaVaactcRcaNStgtgtattMtgaggtNttBaDRcgaaaagc\n\
+tNgBcWaWgtSaDcVtgVaatMKBtttcgtttctaaHctaaagYactgMtatBDtcStga\n\
+ccgtSDattYaataHctgggaYYttcggttaWaatctggtRagWMaDagtaacBccacta\n\
+cgHWMKaatgatWatcctgHcaBaSctVtcMtgtDttacctaVgatYcWaDRaaaaRtag\n\
+atcgaMagtggaRaWctctgMgcWttaagKBRtaaDaaWtctgtaagYMttactaHtaat\n\
+cttcataacggcacBtSgcgttNHtgtHccatgttttaaagtatcgaKtMttVcataYBB\n\
+aKtaMVaVgtattNDSataHcagtWMtaggtaSaaKgttgBtVtttgttatcatKcgHac\n\
+acRtctHatNVagSBgatgHtgaRaSgttRcctaacaaattDNttgacctaaYtBgaaaa\n\
+tagttattactcttttgatgtNNtVtgtatMgtcttRttcatttgatgacacttcHSaaa\n\
+ccaWWDtWagtaRDDVNacVaRatgttBccttaatHtgtaaacStcVNtcacaSRttcYa\n\
+gacagaMMttttgMcNttBcgWBtactgVtaRttctccaaYHBtaaagaBattaYacgat\n\
+ttacatctgtaaMKaRYtttttactaaVatWgctBtttDVttctggcDaHaggDaagtcg\n\
+aWcaagtagtWttHtgKtVataStccaMcWcaagataagatcactctHatgtcYgaKcat\n\
+cagatactaagNSStHcctRRNtattgtccttagttagMVgtatagactaactctVcaat\n\
+MctgtttgtgttgccttatWgtaBVtttctggMcaaKgDWtcgtaaYStgSactatttHg\n\
+atctgKagtagBtVacRaagRtMctatgggcaaaKaaaatacttcHctaRtgtDcttDat\n\
+taggaaatttcYHaRaaBttaatggcacKtgctHVcaDcaaaVDaaaVcgMttgtNagcg\n\
+taDWgtcgttaatDgKgagcSatatcSHtagtagttggtgtHaWtaHKtatagctgtVga\n\
+ttaBVaatgaataagtaatVatSttaHctttKtttgtagttaccttaatcgtagtcctgB\n\
+cgactatttVcMacHaaaggaatgDatggKtaHtgStatattaaSagctWcctccRtata\n\
+BaDYcgttgcNaagaggatRaaaYtaWgNtSMcaatttactaacatttaaWttHtatBat\n\
+tgtcgacaatNgattgcNgtMaaaKaBDattHacttggtRtttaYaacgVactBtaBaKt\n\
+gBttatgVttgtVttcaatcWcNctDBaaBgaDHacBttattNtgtDtatttVSaaacag\n\
+gatgcRatSgtaSaNtgBatagttcHBgcBBaaattaHgtDattatDaKaatBaaYaaMa\n\
+ataaataKtttYtagtBgMatNcatgtttgaNagtgttgtgKaNaSagtttgaSMaYBca\n\
+aaacDStagttVacaaaaactaaWttBaagtctgtgcgtMgtaattctcctacctcaNtt\n\
+taaccaaaaVtBcacataacaccccBcWMtatVtggaatgaWtcaaWaaaaaaaaWtDta\n\
+atatRcctDWtcctaccMtVVatKttaWaaKaaatataaagScHBagaggBaSMtaWaVt\n\
+atattactSaaaKNaactatNatccttgaYctattcaaaVgatttYHcRagattttaSat\n\
+aggttattcVtaaagaKgtattattKtRttNcggcRgtgtgtWYtaacHgKatKgatYta\n\
+cYagDtWcHBDctctgRaYKaYagcactKcacSaRtBttttBHKcMtNtcBatttatttt\n\
+tgSatVgaaagaWtcDtagDatatgMacaacRgatatatgtttgtKtNRaatatNatgYc\n\
+aHtgHataacKtgagtagtaacYttaNccaaatHcacaacaVDtagtaYtccagcattNt\n\
+acKtBtactaaagaBatVtKaaHBctgStgtBgtatgaSNtgDataaccctgtagcaBgt\n\
+gatcttaDataStgaMaccaSBBgWagtacKcgattgaDgNNaaaacacagtSatBacKD\n\
+gcgtataBKcatacactaSaatYtYcDaactHttcatRtttaatcaattataRtttgtaa\n\
+gMcgNttcatcBtYBagtNWNMtSHcattcRctttttRWgaKacKttgggagBcgttcgc\n\
+MaWHtaatactgtctctatttataVgtttaBScttttaBMaNaatMacactYtBMggtHa\n\
+cMagtaRtctgcatttaHtcaaaatttgagKtgNtactBacaHtcgtatttctMaSRagc\n\
+agttaatgtNtaaattgagagWcKtaNttagVtacgatttgaatttcgRtgtWcVatcgt\n\
+taaDVctgtttBWgaccagaaagtcSgtVtatagaBccttttcctaaattgHtatcggRa\n\
+ttttcaaggcYSKaagWaWtRactaaaacccBatMtttBaatYtaagaactSttcgaaSc\n\
+aatagtattgaccaagtgttttctaacatgtttNVaatcaaagagaaaNattaaRtttta\n\
+VaaaccgcaggNMtatattVctcaagaggaacgBgtttaacaagttcKcYaatatactaa\n\
+ccBaaaSggttcNtattctagttRtBacgScVctcaatttaatYtaaaaaaatgSaatga\n\
+tagaMBRatgRcMcgttgaWHtcaVYgaatYtaatctttYttatRaWtctgBtDcgatNa\n\
+tcKaBaDgatgtaNatWKctccgatattaacattNaaacDatgBgttctgtDtaaaMggt\n\
+gaBaSHataacgccSctaBtttaRBtcNHcDatcDcctagagtcRtaBgWttDRVHagat\n\
+tYatgtatcWtaHtttYcattWtaaagtctNgtStggRNcgcggagSSaaagaaaatYcH\n\
+DtcgctttaatgYcKBVSgtattRaYBaDaaatBgtatgaHtaaRaRgcaSWNtagatHa\n\
+acttNctBtcaccatctMcatattccaSatttgcgaDagDgtatYtaaaVDtaagtttWV\n\
+aagtagYatRttaagDcNgacKBcScagHtattatcDaDactaaaaaYgHttBcgaDttg\n\
+gataaaKSRcBMaBcgaBSttcWtgNBatRaccgattcatttataacggHVtaattcaca\n\
+agagVttaaRaatVVRKcgWtVgacctgDgYaaHaWtctttcacMagggatVgactagMa\n\
+aataKaaNWagKatagNaaWtaaaatttgaattttatttgctaaVgaHatBatcaaBWcB\n\
+gttcMatcgBaaNgttcgSNaggSaRtttgHtRtattaNttcDcatSaVttttcgaaaaa\n\
+ttgHatctaRaggSaNatMDaaatDcacgattttagaHgHaWtYgattaatHNSttatMS\n\
+gggNtcKtYatRggtttgtMWVtttaYtagcagBagHaYagttatatggtBacYcattaR\n\
+SataBatMtttaaatctHcaaaSaaaagttNSaaWcWRccRtKaagtBWtcaaattSttM\n\
+tattggaaaccttaacgttBtWatttatatWcDaatagattcctScacctaagggRaaYt\n\
+aNaatgVtBcttaaBaacaMVaaattatStYgRcctgtactatcMcVKatttcgSgatRH\n\
+MaaaHtagtaaHtVgcaaataatatcgKKtgccaatBNgaaWcVttgagttaKatagttc\n\
+aggKDatDtattgaKaVcaKtaataDataataHSaHcattagttaatRVYcNaHtaRcaa\n\
+ggtNHcgtcaaccaBaaagYtHWaaaRcKgaYaaDttgcWYtataRgaatatgtYtgcKt\n\
+aNttWacatYHctRaDtYtattcBttttatcSataYaYgttWaRagcacHMgtttHtYtt\n\
+YaatcggtatStttcgtRSattaaDaKMaatatactaNBaWgctacacYtgaYVgtgHta\n\
+aaRaaRgHtagtWattataaaSDaaWtgMattatcgaaaagtaYRSaWtSgNtBgagcRY\n\
+aMDtactaacttaWgtatctagacaagNtattHggataatYttYatcataDcgHgttBtt\n\
+ctttVttgccgaaWtaaaacgKgtatctaaaaaNtccDtaDatBMaMggaatNKtatBaa\n\
+atVtccRaHtaSacataHattgtttKVYattcataVaattWtcgtgMttcttKtgtctaa\n\
+cVtatctatatBRataactcgKatStatattcatHHRttKtccaacgtgggtgRgtgaMt\n\
+attattggctatcgtgacMtRcBDtcttgtactaatRHttttaagatcgVMDStattatY\n\
+BtttDttgtBtNttgRcMtYtgBacHaWaBaatDKctaagtgaaactaatgRaaKgatcc\n\
+aagNaaaatattaggWNtaagtatacttttKcgtcggSYtcttgRctataYcttatataa\n\
+agtatattaatttataVaacacaDHatctatttttKYVatHRactttaBHccaWagtact\n\
+BtcacgaVgcgttRtttttttSVgtSagtBaaattctgaHgactcttgMcattttagVta\n\
+agaattHctHtcaDaaNtaacRggWatagttcgtSttgaDatcNgNagctagDgatcNtt\n\
+KgttgtaDtctttRaaYStRatDtgMggactSttaDtagSaVtBDttgtDgccatcacaM\n\
+attaaaMtNacaVcgSWcVaaDatcaHaatgaattaMtatccVtctBtaattgtWattat\n\
+BRcWcaatgNNtactWYtDaKttaaatcactcagtRaaRgatggtKgcgccaaHgaggat\n\
+StattYcaNMtcaBttacttatgagDaNtaMgaaWtgtttcttctaHtMNgttatctaWW\n\
+atMtBtaaatagDVatgtBYtatcggcttaagacMRtaHScgatatYgRDtcattatSDa\n\
+HggaaataNgaWSRRaaaBaatagBattaDctttgHWNttacaataaaaaaatacggttt\n\
+gHgVtaHtWMttNtBtctagtMcgKMgHgYtataHaNagWtcaacYattaataYRgtaWK\n\
+gaBctataaccgatttaHaNBRaRaMtccggtNgacMtctcatttgcaattcWgMactta\n\
+caaDaaNtactWatVtttagccttMaatcagVaagtctVaaDaBtattaattaYtNaYtg\n\
+gattaKtaKctYaMtattYgatattataatKtVgDcttatatNBtcgttgtStttttMag\n\
+aggttaHYSttcKgtcKtDNtataagttataagSgttatDtRttattgttttSNggRtca\n\
+aKMNatgaatattgtBWtaMacctgggYgaSgaagYataagattacgagaatBtggtRcV\n\
+HtgYggaDgaYaKagWagctatagacgaaHgtWaNgacttHRatVaWacKYtgRVNgVcS\n\
+gRWctacatcKSactctgWYtBggtataagcttNRttVtgRcaWaaatDMatYattaact\n\
+ttcgaagRatSctgccttgcRKaccHtttSNVagtagHagBagttagaccaRtataBcca\n\
+taatSHatRtcHagacBWatagcaMtacaRtgtgaaBatctKRtScttccaNaatcNgta\n\
+atatWtcaMgactctBtWtaaNactHaaaaRctcgcatggctMcaaNtcagaaaaacaca\n\
+gtggggWttRttagtaagaVctVMtcgaatcttcMaaaHcaHBttcgattatgtcaDagc\n\
+YRtBtYcgacMgtDcagcgaNgttaataatagcagKYYtcgtaBtYctMaRtaRtDagaa\n\
+aacacatgYaBttgattattcgaaNttBctSataaMataWRgaHtttccgtDgaYtatgg\n\
+tDgHKgMtatttVtMtVagttaRatMattRagataaccctKctMtSttgaHagtcStcta\n\
+tttccSagatgttccacgaggYNttHRacgattcDatatDcataaaatBBttatcgaHtN\n\
+HaaatatDNaggctgaNcaaggagttBttMgRagVatBcRtaWgatgBtSgaKtcgHttt\n\
+gaatcaaDaHttcSBgHcagtVaaSttDcagccgttNBtgttHagYtattctttRWaaVt\n\
+SttcatatKaaRaaaNacaVtVctMtSDtDtRHRcgtaatgctcttaaatSacacaatcg\n\
+HattcaWcttaaaatHaaatcNctWttaNMcMtaKctVtcctaagYgatgatcYaaaRac\n\
+tctaRDaYagtaacgtDgaggaaatctcaaacatcaScttcKttNtaccatNtaNataca\n\
+tttHaaDHgcaDatMWaaBttcRggctMaagctVYcacgatcaDttatYtaatcKatWat\n\
+caatVYtNagatttgattgaYttttYgacttVtcKaRagaaaHVgDtaMatKYagagttN\n\
+atWttaccNtYtcDWgSatgaRgtMatgKtcgacaagWtacttaagtcgKtgatccttNc\n\
+ttatagMatHVggtagcgHctatagccctYttggtaattKNaacgaaYatatVctaataM\n\
+aaaYtgVtcKaYtaataacagaatHcacVagatYWHttagaaSMaatWtYtgtaaagNaa\n\
+acaVgaWtcacNWgataNttcaSagctMDaRttgNactaccgataMaaatgtttattDtc\n\
+aagacgctDHYYatggttcaagccNctccttcMctttagacBtaaWtaWVHggaaaaNat\n\
+ttaDtDtgctaaHHtMtatNtMtagtcatttgcaaaRatacagRHtatDNtgtDgaatVg\n\
+tVNtcaaatYBMaaaagcaKgtgatgatMgWWMaHttttMgMagatDtataaattaacca\n\
+actMtacataaattgRataatacgBtKtaataattRgtatDagDtcRDacctatRcagag\n\
+cSHatNtcaScNtttggacNtaaggaccgtgKNttgttNcttgaaRgYgRtNtcagttBc\n\
+ttttcHtKtgcttYaaNgYagtaaatgaatggWaMattBHtatctatSgtcYtgcHtaat\n\
+tHgaaMtHcagaaSatggtatgccaHBtYtcNattWtgtNgctttaggtttgtWatNtgH\n\
+tgcDttactttttttgcNtactKtWRaVcttcatagtgSNKaNccgaataaBttataata\n\
+YtSagctttaaatSttggctaaKSaatRccgWHgagDttaaatcatgagMtcgagtVtaD\n\
+ggaBtatttgDacataaacgtagYRagBWtgDStKDgatgaagttcattatttaKWcata\n\
+aatWRgatataRgttRacaaNKttNtKagaaYaStaactScattattaacgatttaaatg\n\
+DtaattagatHgaYataaactatggggatVHtgccgtNgatNYcaStRtagaccacWcaM\n\
+tatRagHgVactYtWHtcttcatgatWgagaKggagtatgaWtDtVtNaNtcgYYgtaaa\n\
+ctttaDtBactagtaDctatagtaatatttatatataacgHaaaRagKattSagttYtSt\n\
+>THREE Homo sapiens frequency\n\
+agagagacgatgaaaattaatcgtcaatacgctggcgaacactgagggggacccaatgct\n\
+cttctcggtctaaaaaggaatgtgtcagaaattggtcagttcaaaagtagaccggatctt\n\
+tgcggagaacaattcacggaacgtagcgttgggaaatatcctttctaccacacatcggat\n\
+tttcgccctctcccattatttattgtgttctcacatagaattattgtttagacatccctc\n\
+gttgtatggagagttgcccgagcgtaaaggcataatccatataccgccgggtgagtgacc\n\
+tgaaattgtttttagttgggatttcgctatggattagcttacacgaagagattctaatgg\n\
+tactataggataattataatgctgcgtggcgcagtacaccgttacaaacgtcgttcgcat\n\
+atgtggctaacacggtgaaaatacctacatcgtatttgcaatttcggtcgtttcatagag\n\
+cgcattgaattactcaaaaattatatatgttgattatttgattagactgcgtggaaagaa\n\
+ggggtactcaagccatttgtaaaagctgcatctcgcttaagtttgagagcttacattagt\n\
+ctatttcagtcttctaggaaatgtctgtgtgagtggttgtcgtccataggtcactggcat\n\
+atgcgattcatgacatgctaaactaagaaagtagattactattaccggcatgcctaatgc\n\
+gattgcactgctatgaaggtgcggacgtcgcgcccatgtagccctgataataccaatact\n\
+tacatttggtcagcaattctgacattatacctagcacccataaatttactcagacttgag\n\
+gacaggctcttggagtcgatcttctgtttgtatgcatgtgatcatatagatgaataagcg\n\
+atgcgactagttagggcatagtatagatctgtgtatacagttcagctgaacgtccgcgag\n\
+tggaagtacagctgagatctatcctaaaatgcaaccatatcgttcacacatgatatgaac\n\
+ccagggggaaacattgagttcagttaaattggcagcgaatcccccaagaagaaggcggag\n\
+tgacgttgaacgggcttatggtttttcagtacttcctccgtataagttgagcgaaatgta\n\
+aacagaataatcgttgtgttaacaacattaaaatcgcggaatatgatgagaatacacagt\n\
+gtgagcatttcacttgtaaaatatctttggtagaacttactttgctttaaatatgttaaa\n\
+ccgatctaataatctacaaaacggtagattttgcctagcacattgcgtccttctctattc\n\
+agatagaggcaatactcagaaggttttatccaaagcactgtgttgactaacctaagtttt\n\
+agtctaataatcatgattgattataggtgccgtggactacatgactcgtccacaaataat\n\
+acttagcagatcagcaattggccaagcacccgacttttatttaatggttgtgcaatagtc\n\
+cagattcgtattcgggactctttcaaataatagtttcctggcatctaagtaagaaaagct\n\
+cataaggaagcgatattatgacacgctcttccgccgctgttttgaaacttgagtattgct\n\
+cgtccgaaattgagggtcacttcaaaatttactgagaagacgaagatcgactaaagttaa\n\
+aatgctagtccacagttggtcaagttgaattcatccacgagttatatagctattttaatt\n\
+tatagtcgagtgtacaaaaaacatccacaataagatttatcttagaataacaacccccgt\n\
+atcatcgaaatcctccgttatggcctgactcctcgagcttatagcatttgtgctggcgct\n\
+cttgccaggaacttgctcgcgaggtggtgacgagtgagatgatcagtttcattatgatga\n\
+tacgattttatcgcgactagttaatcatcatagcaagtaaaatttgaattatgtcattat\n\
+catgctccattaacaggttatttaattgatactgacgaaattttttcacaatgggttttc\n\
+tagaatttaatatcagtaattgaagccttcataggggtcctactagtatcctacacgacg\n\
+caggtccgcagtatcctggagggacgtgttactgattaaaagggtcaaaggaatgaaggc\n\
+tcacaatgttacctgcttcaccatagtgagccgatgagttttacattagtactaaatccc\n\
+aaatcatactttacgatgaggcttgctagcgctaaagagaatacatacaccaccacatag\n\
+aattgttagcgatgatatcaaatagactcctggaagtgtcagggggaaactgttcaatat\n\
+ttcgtccacaggactgaccaggcatggaaaagactgacgttggaaactataccatctcac\n\
+gcccgacgcttcactaattgatgatccaaaaaatatagcccggattcctgattagcaaag\n\
+ggttcacagagaaagatattatcgacgtatatcccaaaaaacagacgtaatgtgcatctt\n\
+cgaatcgggatgaatacttgtatcataaaaatgtgacctctagtatacaggttaatgtta\n\
+gtgatacacaatactcgtgggccatgggttctcaaataaaatgtaatattgcgtcgatca\n\
+ctcacccacgtatttggtctaattatgttttatttagtgacaatccaatagataaccggt\n\
+cctattaagggctatatttttagcgaccacgcgtttaaacaaaggattgtatgtagatgg\n\
+taccagtttaattgccagtgggcaatcctaagcaaaatgagattctatcctaaagtttgg\n\
+gcttgatataagatttcggatgtatgggttttataatcgttggagagctcaatcatgagc\n\
+taatacatggatttcgctacctcaccgagagaccttgcatgaagaattctaaccaaaagt\n\
+ttaataggccggattggattgagttaattaagaccttgttcagtcatagtaaaaaccctt\n\
+aaattttaccgattgacaaagtgagcagtcgcaataccctatgcgaaacgcctcgatagt\n\
+gactaggtatacaaggtttttgagttcctttgaaatagttaactaatttaaaattaatta\n\
+acgacatggaaatcacagaacctaatgctttgtaggagttatttatgctgtttactgcct\n\
+ctacaaccctaataaagcagtcctaagaatgaaacgcatcttttagttcagaaagtggta\n\
+tccagggtggtcaatttaataaattcaacatcgggtctcaggatattcggtcatataatt\n\
+tattaagggctcttcgagtcttactctgagtgaaattggaaacagtcatccttttcgttg\n\
+tgaggcatcttacaccgctatcgatatacaatgcattccaccgcggtgtcccgtacacaa\n\
+ggaaacttgttaccttggggatataagaaaactcacacgtctcattattaaactgagtac\n\
+aatttttgcacgagaaagtaatgcaatacaatatgatgaaagccagctaatgaaaaggga\n\
+tggaacgcacctcggatctgttgcactggattaaaatccgattatttttaaaaatattca\n\
+gtgctagagcatatcaggtctacttttttatctggtatgtaaagcccacggagcgatagt\n\
+gagatccttacgactcaacgaaaagttataacataactcccgttagccaaagcccaatcc\n\
+cgattactgccctaccctaacgtctgccatctaaatatcgaacttgttatgatcaatgtg\n\
+actacctcccaccctttccccttcatttgttccactggggataagctagcgttttcagaa\n\
+tcaatgcaataagaatagccaattgtctcacttcatcagagctcttggcaattccaggcg\n\
+ctacgtggttctggaatatattcatttttcaaatagtaatacgtttagtgttgctattgt\n\
+ctacacgtttggatattacgttatgtgagcggacatcaatagttgtctaactctttagta\n\
+agccagagatagcactcttagcgaatggataccatcttccataagtttagttaatagtcc\n\
+gaaacaactgcttcgagcatatttgaacctccttgtaggcaaatagcctcttcaaagcaa\n\
+tcttactaatagatagagtttgttttaagggactactagaaatgggacaatcttaatagt\n\
+atgacctaaactgacatttaaagatatatccaggtggcaagcataaagatcattgcgcca\n\
+cctccaccgtgggattacttatcagtcgatatcctatatgctaagtttgcgacggcagaa\n\
+tacaaactaagctgagttgatgctaaccttacctatgataccccattggaccggttaaca\n\
+gccctacttattccaaataaaagaacttttatgctgtagaagctattatagtgatgcctg\n\
+gtaacttcagtatattaaaatgacacacatacgccatatagagctcctggaactttgaat\n\
+aatgagcgaacttcgaagttgaagagcaagaaaccatatgtcacggttgcctaaagcccg\n\
+gtaaccagacatgtgctatcattgatcattatcgaggttttcataaccttgacccattat\n\
+cggctgtgcgcggacaagtacttaaatcactagtttcttcacctgcttatcggtaagaaa\n\
+taaggttggcaaagaatcgcataagacggacgtagagccgcagcgttgtgcgagtccagg\n\
+tgcatgcgcagcaataggattttaaattttgttccatttttaatttagccgtaaggatgt\n\
+ccgtaaatgattgaaaattggattcaatctttgggcctatgctactggaacctgatcgac\n\
+aaaatttcaaacatacgttaactccgaaagaccgtatttttgcggctagaatagtcagtc\n\
+gcttggagccatataccttaccacttaaacgacgtgctcctgtagttgaaatataaacag\n\
+aacacaaagactaccgatcatatcaactgaagatctttgtaactttgaggcgaagcaccc\n\
+tcttcgagacaactaagagtaaagtaccgggcgccgcaaggagtcgattgggaccctaaa\n\
+tcttgacgaattgctaagaggctcagagctaccactgtaatttctctagagcccataata\n\
+aatgaacgatacatccgtaggtagcacctaagggattataatggaagccaaatgcagtta\n\
+ataatattatatactggcgtacacgattcgacggatctctcacatagtgattcacgaccc\n\
+ccccctttgattgacacagcgtcagcattttgcaagaacgatcttctgcatagggtgcgc\n\
+caccgtaaggatgacgtcgaagctacaactgggtataatttaccatgcttccctgatgct\n\
+gagtgcaatacactaagaatgagtttttaccccatatcaccagtatttgttctgttattg\n\
+cgaagaaatggctatgctgagttggcgactaaagtcacccatcctttttattaggtaacc\n\
+ccctcccttaaactaactgatttgctggagctgccctgcatacatatactttatcattta\n\
+tggacgtccgtgacgcttattatccaccatagtcgatatgctacacggattcattaatgg\n\
+atcgtaggagtttaagttatatttactaagatcggtctcggctactatcccgccttaccc\n\
+ggcgctatttacggccatttttaatatattgacggtaattattcctatggtttcgaccgc\n\
+acgtccttggacaagaaagaatggcaaaaaaaatgtaaaagaaaaaaaatattgagtccc\n\
+taccatcatataaaaaatatgtgatgagtaacttgacgaaatgttagtggttattaaaga\n\
+ctatctattacaccttttgttttctgtcgtagtatattaaagtctagaagccttacagga\n\
+aaatcagggttatacagccgatactccgcagcatgaatcatcgaggaggtgtcctaccat\n\
+cgcgccttgtaatcttgtctgtgtatactgtatttagaccttttatacaaagtaaatatc\n\
+tcggctttatgtgattgggaggggcctactcaaacatgatgacttgacctaataatcact\n\
+gtgcgggcgtcttatgactagctattccttgaaatccaccaccaaatggttaatatgtaa\n\
+aaactttgacgatgaaacaaggtgaatgtgtagttactttgtgtaattagctgcgtcgag\n\
+cattgcttgtaaaaccgtcaatcgcacacgttacttccataaaatttctacgaatacacc\n\
+cttcttaaaaaaaacgtaggaattcacgagtttaacaaacgataactgtataaagtggaa\n\
+gtccgaagaaagcagatgcccgaactactcgaagatgtttcgttttcttaaccatagggg\n\
+cttcttaatggcccactacgcacattttgttcaagcccgagagggacatccccattacgg\n\
+gagtattactaaaactgttccgtaatacgttcagcaagggatgaaaaaggccactgctca\n\
+agttattgacgtgggagtattacatcggaagcctgaatcccacactatgatggtctgtac\n\
+aggcctagggactgcgtctagacggtattaccggcttctaatcatacgatcgtgagtctt\n\
+aacgggaagtaaggctcacacctaccccaaaccatttatctatgtaagtataaaattgtg\n\
+cgtaagtgttcaaagtggacaataaagacgtggcaaaaacccccgcacataagccgcttt\n\
+agatttcacaaataccaatgcggttaaaaacatccttgagtcgtacatacaccatactcg\n\
+cgttaaacggatataacagaagataataaatccggatgtggagtcggtgtaactatagaa\n\
+agccaagtgaaataatgcttaccagtcatttagctatacggctttcatttcatgtcaaga\n\
+gggtggagtttgacctgtacagttgatatatcaccgatacttagaactcacctaaagcta\n\
+aaattgctcgcagcgtgtaatccgcatattacaaacaatagatgggattcattatacata\n\
+agacacgatgatctgctttttcaggttgcgagatgttgcctatcgtcaatcgagtcctgc\n\
+cttacaccacttaaacaaaagtattgacagggaacctattttcgaggtattatatagtcc\n\
+agcttgaatatcaatttgacagttaacctagtgaaaatcagtaagaggaaatacgccaca\n\
+ttctccagtgaaattctacgggttatcgtctagtccaactatcaattataactcacgaga\n\
+tataagtaaattctcgtacttggcctgatttttattatactttggatccttagtaaacag\n\
+gaagggagaaaccttcaacgaaaaacactggattttgttttactctcaaagctcttatat\n\
+gacggaaataccctgtcaagtcttaactttattactagactaatgaaatgggcttggggt\n\
+ggccagaatcatagtacaatttagcggatacactattcggactttcctatcggctgtctg\n\
+gttggataagtatggggactaataggctagacatacctatacttaaactatacaggcgtc\n\
+atctatctctgcaactttggagttccctgatgttctcccgccctttgggttcacatcttc\n\
+tataccgacacccctaataacgattagtttgtgggttagagtaaattaatacggttaata\n\
+ttaatgtatcgttgaaaagctggtgtcgccaataaggtaaccggctaggcagagtatatg\n\
+tcacgaagtataactaccctaatgataagctgtaggaataaaattaatgctgtctctaag\n\
+cgaagagatatttccgactctgttttaatgacgaatctcattacttctgacttgcaaatg\n\
+ttcaatatggcacggtttcacggcacctttgtgacgcatataatgaacttagaagattat\n\
+aacgacggaactttatatgataatccgttacgattaaagaatctgttaaatatcataatg\n\
+gcattcagttctagaccgtgcatcatggtaaacttactttctctgcatggcgacatacat\n\
+ttcgctattcaaattcgcgtgtggttacacccactcgcacctttggaatattaagagaag\n\
+atgatcagaaaatccattcgctcaatttttctgacgtacgtctaatttatcctaggagac\n\
+aaatcgttttatgtctctcacatttttgaagaaaggttcgagagacaatactcaggtcct\n\
+gaactgctagaagatactcggtggagcgtggcaacaatgaaaaactcgtgacataaatga\n\
+atgatacttttccaagttcagttaagtgaatatgtttaacatacccggcttttcgatctt\n\
+aagctgacgctggacgtgcgagtaatgtcagtctcttacatacactagtgactccaagtt\n\
+tcgtcaaaaacgccccctcccttctcgagcccactcacgctatgtattgacgcgaacttg\n\
+ttcgggatcagacttttcaggagttcggtcgcgtgtccctatgtgctaatatataagtta\n\
+gatcgcattagatgctaatctgaatacttatagacgaccttcaacgagaacgggtaccac\n\
+cttgaggctagagttaggtgtgaaacgacaggtagggacatataaaatttgagtgcggct\n\
+ttagttaagggtttaattacctactcaaacatcacgctcgcgcccttcgtacgtaatcga\n\
+ccatctagaggctaaggggactgtactaggtagtgattaatgatatcctagacgcacgtg\n\
+ccttagatcttcagactctgatggtccgcgatcaccgtaattgtagtcctccaactcgat\n\
+cactttgttggcgtcaaagaaattacgatatctaaatacttataatacaataaccaagga\n\
+tgagaatgactcatcgcgttggagttatattgcttgaagttctatggaatgaaagcacgt\n\
+tatctgccgtcccaatatctccagtgagctaattcattggacggtccactttgatcaatc\n\
+cccgaggagatgttcggacactttagtctgtaacacttagcgttgagaccacgaacaatt\n\
+gattactcagtcttgaaggtgttttccaaagttcattttaaataagactacgataggcct\n\
+ttcctattgatataaactacccggctctgttgttcgtgtgagtcgtacttctctgtgttt\n\
+ttctgattatagcaagattcgattcttagtgtaaacagcgatttttatttgacccgtcaa\n\
+tgagaagcgcataggatctaagcaaaattatcaagttgtgccacaaggtaagatctttcc\n\
+agttattgcaggtaggatgtatcccacgttgatagtatgaggtctgacgtcaactgtcta\n\
+ggagagttgaccgcgtgcgggtacaccggatttgcatcgatgttgagaacgcagaactcc\n\
+cactgtcgtggcggcgttcctgatatttagcaagaggcgttgataaagccctcatcatct\n\
+agatctcgacctcatctgccctcttgctccatcattttctacacagactactttcctatc\n\
+tacgttagtataattgctttctatcttagtatcatttagagcttctccgtcaacaggttc\n\
+gtgctattaaagttagtacgaaagggacaacttgtagcaacgcatttaatcggttttcga\n\
+ctacttcgcacaaaatcagataaagaagtttgtcattctattagacattgaattgcgcaa\n\
+ttgacttgtaccacttatgatcgaacactgaatcaagactgtgattaactaaaatagaca\n\
+agccactatatcaactaataaaaacgcccctggtggtcgaacatagttgactacaggata\n\
+attaattggactggagccattacattctctacaatcgtatcacttcccaagtagacaact\n\
+ttgaccttgtagtttcatgtacaaaaaaatgctttcgcaggagcacattggtagttcaat\n\
+agtttcatgggaacctcttgagccgtcttctgtgggtgtgttcggatagtaggtactgat\n\
+aaagtcgtgtcgctttcgatgagagggaattcaccggaaaacaccttggttaacaggata\n\
+gtctatgtaaacttcgagacatgtttaagagttaccagcttaatccacggtgctctacta\n\
+gtatcatcagctgtcttgcctcgcctagaaatatgcattctatcgttatcctatcaacgg\n\
+ttgccgtactgagcagccttattgtggaagagtaatatataaatgtagtcttgtctttac\n\
+gaagcagacgtaagtaataatgacttggaataccaaaactaaacatagtggattatcata\n\
+ctcaagaactctccagataaataacagtttttacgatacgtcaccaatgagcttaaagat\n\
+taggatcctcaaaactgatacaaacgctaattcatttgttattggatccagtatcagtta\n\
+aactgaatggagtgaagattgtagaatgttgttctggcctcgcatggggtctaggtgata\n\
+tacaatttctcatacttacacggtagtggaaatctgattctagcttcgtagctgactata\n\
+ctcaaggaaccactgctcaaggtaggagactagttccgaccctacagtcaaagtggccga\n\
+agcttaaactatagactagttgttaaatgctgatttcaagatatcatctatatacagttt\n\
+ggacaattatgtgtgcgaaactaaaattcatgctattcagatggatttcacttatgcctt\n\
+agaaacagatattgcccgagctcaatcaacagttttagccggaaacaatcgaagcatagg\n\
+gacaatgtatcttttcctaaattgccatgtgcagatttctgagtgtcacgaagcgcataa\n\
+tagaatcttgtgttgcctcaactcgttgaaaagtttaaaacaatcgcagcagtctttttg\n\
+gggtctactgtgtgtttgcaaaataactgaaagaaacgcttgaacaactctgaagtagct\n\
+cgagtactcattaaagtgtaacacattagtgaatatcggccaatgaaccaaacgcttccc\n\
+ggtacgctatctctctcatcgggaggcgatgtgcaggttatctacgaaagcatcccttta\n\
+cgttgagagtgtcgatgcatgaacctcattgtaacaatagcccagcaaattctcatacgt\n\
+gcctcagggtccgggcgtactcctccatggaagggcgcgcatctagtgttataccaactc\n\
+gctttttaactactatgctgtagttctacaggcatagtggccagtattttctaacttctc\n\
+tggatagatgctctcactcctcatccatcacggcttcagtttacgtcttacttgcttgtt\n\
+cagcaacggatggaggcattaagtatcttcactgttccctaaaattgctgttcaatatca\n\
+aagtaaggacgatacagggaaagctcaagcacactcattgaatactgccccagttgcaac\n\
+ctcacttaatctgacaaaaataatgactactctaagtgttgcggaagcagtctcttccac\n\
+gagcttgtctgtatcacttcgtataggcatgtaactcgatagacacgaacaccgagtgag\n\
+aaactatattcttgcttccgtgtgtgtgacaccaggtaattgatgcggatataagctgga\n\
+gatcactcacgcccacacaaggcgctgctacctctttattccaatgtgtaagaatttgct\n\
+aacttcatttctagaccgcagctttgcggtcataatttcacggtacggacccttgggtta\n\
+gagacttgataacacacttcgcagtttccaccgcgcacatgttttagtggcttctaacat\n\
+agaatttttgttgtgacataaagagtgcgtgggagacttgcccgaccgttaagccataat\n\
+caattgaaagccccgtgagtcacatctaattggttgtactgcgcatttagctatccttta\n\
+gctgactcgaagagattcgattcctaatataggttaattagatggctgccgcgcgaagta\n\
+aaacgtgaaaaacgtagtgcgcagatctgcataactcgcgcttaattacttatgagtagt\n\
+tccaagttcgctacgttatgagagagattggaattaagcaaatatgttttatggtgattt\n\
+tgggatgagaaggactgctaagtacggctactaaacaaatttctaaaaccgccatctacc\n\
+ttatcttggagacatttaagttgtatatgtcactagtctagcttttgtctgtgggacgcg\n\
+ttctcggaatgagggaaatgcaagagccgattcatcaaatgcttatctaagaaagtagtg\n\
+gactattacaccaagcacgaatgccagggaactgctttcttgctcaggacctcgcgacaa\n\
+ggtaccccgcataagtcctagaattacatttggtcagcaatgctgacatttgaccgtgaa\n\
+aacataattttaatcagaaggcagctcacccgcttgctctagatcttatctttgtatgaa\n\
+tgtcagaatttactgcaatatccgttccgaatagtgagggcttagtatagttctctgtat\n\
+acaggtcacatcaaactccccctgtcctagtacagctctgagctttaattaattgcatac\n\
+atttccttcaatcatcagatgaaaacaccgcgaatcatgctcttctcgtatagggcaaga\n\
+gaagcaacaaacaactagcccgactcacgttcatccgccgtatccttgttcagttcttac\n\
+tccgtattaggtcagcgaaatctaatcagaataatcggtcgcgtatcaaaattaaaatcc\n\
+cgcttgaggttgacaattaaaacgctgagcagttatcggctattagatagtggggtgaaa\n\
+gtaattggctggaattatgttaaaacgtgatattaagctaaaatacgctacttgttgccg\n\
+acctaattcagtcattcgatattcagttagagccaagaataacaagcttgtataaattga\n\
+acggggtgcactaaacgatgtgttactctaatattcagcttggagtatacctgaaggcga\n\
+attcatgtatcggccaataataagacgttgaagatcacaatttggactagcaaaagaagg\n\
+tgatttatgcgtggggattgagtccactgtacgagtacggtctctggaaaattataggtt\n\
+cagggaatataaggaagtaaagataattaccaagagatttttggtatcgctatgacccag\n\
+aggtgttctaacgtctgttttgatccgcagaatttctgcctcaatgcatatttgacggac\n\
+ttgaactagagcctctaaagttaaatggcgacgcaactgttcctaaacttcaattattac\n\
+tactctttttttcctagggtattgtagaggccagtggacaaaataaatcaaatttaagat\n\
+gtttcggacattaacatcccccgtagcatagaaatcatcagttatccaatctctcatcga\n\
+gcttttacaatttctgctggcgctatggacagcatatgccgcgagacctccgcaagactc\n\
+acttgatcactgtaagtatcttcattagaggttagagcctatagttaagctgctgaccta\n\
+gtaaaattggtattttctaattttattgctcaagttaaaggttagtgaagggataatgac\n\
+gttatttttgaacaatgggttgtattcaattttatatcacgaatggaacccttcattccc\n\
+ggcataatactagacgacacgaacaagctccgatctatcagccaggcacgtgttaaggtt\n\
+taattccggcaaaccaatgaagcatcaaaaggtgacctgatgcaacttagggtcacgatg\n\
+agtttttcaggactacttattacctattaataagttaacatgagccttcataccccgtaa\n\
+gacaatacatactccaccaattagaattctgagccatcttatctttttgtatcatcgaag\n\
+ggtatggccgaataggttaattagttactcctaacgtctctacaggcatgcatttgacgc\n\
+accttcgaaaatagtcaatctctcgccacacgcgtctagtatgcagcatcaaaaatatag\n\
+tccacggtttccggattaccaaacgcggcaaagagaaacattgtatcgacggagataact\n\
+taatacagaaggaaggggcatcttcgaatacggatgaataattctatctgtttattctga\n\
+catcttgttttcaggttaatcttacgcattcaaatgacgcctgccccatgcgtgcgcaat\n\
+tattttctaatattgacgagagcaatctcactccttttgggtctatttatgttttattga\n\
+ggcacaagcctatacagaacaggtactattaaggccgtgagtgtgagactcaaaccgtgg\n\
+aaacaaaggatgggttgttcttggtacaagttttagtgcatgtgggcaatccttaccaaa\n\
+atcagatgctatccttaactttgggctgcatttaagatggcggttggaggcctgtgagaa\n\
+tcctgcgtgtcatctttaatgaccgaattcatccatgtagattcagatcacacactcatt\n\
+ccttgatgttgtctaaacaaaagttgttgtggacgcattggagggagttaagtaacaact\n\
+tgggatcgcatacttataaaaattatatgttaaactttcacaaacgctgaagtccaaagt\n\
+aactagcccaaacgcctcgagagtcactaggtattaatggtgtttgagttcctgtgaaat\n\
+agtgttcgaaggtaaaatttatgtaccaaatcgaaagaacacttaataaggcttgcttgc\n\
+acggaggtatgatgtttactgactctacaaccctaattttccagtacgtacattcattcc\n\
+aataggttagttctcaaagtgctatacaggctcctcaattgatgatatgcttcagccgct\n\
+ctatggatattagctcattttatttaggaagcccgcttagaggcttactatgagggaaat\n\
+gccaaaatgtcatacttttcggtgtgtcccatatgacaccgctttacatagaatttgaat\n\
+taaaacgcgctctcccgttcactaccatacttggtaccgtgcgcatattacatatagata\n\
+taggatcattttttaaagctgtactaggtttgatcgacaatcttatgctatactatatga\n\
+tgtaaccctcataatcaataccgatcgtacgatcctagcataggtggcaagcgattttat\n\
+gccgattattgtgttaaatagtctgtgagtgtgattatcagggctacgttggtagagggg\n\
+ttgtatagacctcgcacacattgtgacatacttaacaatatacgaaaactgatataataa\n\
+atccccttacccaaacaccaatcccgttgaatcaactaccataacgtctcccatataaat\n\
+tgcctacttgtttgcataaatctgaatacataacaccattgcaccttcttgtgttccaat\n\
+cccgttaagattgccttgtcagatgatatgcaagaacaatagcatttgctagcaattatt\n\
+aacagctcttcgaattgcctccacataacgcgggagggtatattttaatttggcaaatac\n\
+taagtactgttggcgtcatatgctattaacggttggatattaagttatgtcagccgtaag\n\
+caagagtgggcgaaatattttgttacccagtgagagcactcttagagtttggatacaata\n\
+ggccatatgttgacttaagaggacgtaactacgccgtacaccattgttcaaccgacttct\n\
+tggcaaatagaatcgtattagcaatcttaagaatagagacacgttcgtgttagggtatac\n\
+tacaaatccgaaaatcttaagaggatcacctaaactgaaatttatacatatttcaacgtg\n\
+gatagatttaacataattcagccacctccaacctgggagtaattttcagtagatttacta\n\
+gatgattagtggcccaacgcacttgactatataagatctggggatcctaacctgacctat\n\
+gagacaaaattggaaacgttaacagcccttatgtgtacaaagaaaagtaagttgttgctg\n\
+ttcaacagatgatagtcatgacgcgtaacttcactatagtaaattgaaacaaatacgcaa\n\
+tttagacagaatggtacggtcatgaatgacagtaattcgaagtgctagaccaacttaaaa\n\
+taggtaaacgtgcccgaaaccccccttaacagaaagctgctatcatggtgcagtatcgac\n\
+gtgttcagaaacttgtaacttttgagcaggtccgagcacatggaagtatatcacgtgttt\n\
+ctgaaccggcttatccctaagatatatccgtcgcaaactttcgatttagtcccacgtaga\n\
+gcccaagcgttgtgcgactccacgtgcatgcccagaaatacgagtttaaatttggttaca\n\
+tggttaattttgaccgaagcatcgcactttatgattgataattggattcaatatgtcgcc\n\
+ctatgcgaatgcaacatgatccacaatttggctataagacgtttaatccgtatcacactt\n\
+tgtttgcggctagtatagtaacgcccgtgcaccaagagtcagtaacaattataagtactc\n\
+cgcaggtacttcaaatataaaaactaatcaaacacgacccatatgatcatctgaagatat\n\
+ttggaactttctcgacaaccaccctcgtactcaatacttacactaatcgacaggcacacg\n\
+caacgtgtacagtcgcaccatattgagtcaagatttgcttagtggcgatgagcgtacacg\n\
+cttatttctctagtcacaattagttatctacgagacatcacgagggagcaaataagcgat\n\
+gttatggctacacataggcacgtatgaatatgatataagccagttaaacagtcgaaccat\n\
+cgagcaaattctcatgcaccaacccacacgttgaggcacaaagagtaagctgtttgaatg\n\
+taacttcttctgctgagcgggccccaacgtaaggatcaactagaagagaaaactcggtat\n\
+tagtttaaatgcgtcacggagcatgagtgcatttcactaagaatgtctgtgtaaccaata\n\
+taacatctatttgttatctgattgcctacttatggctttgcggtcgtggcgactaatgtc\n\
+tccaatccttttgaggtcggtaccaactccctttaaattacgctgtgcaggctcatgcac\n\
+tgcatacatatacggtagcaggtagggacctcacgcacccttattataatcaatagtagt\n\
+tatcagtcaacgaggcaggaatgctgaggtcgaggtgttggtatattttctatgtgccgt\n\
+ctaggcgactatcacgcattaccaggcgagatttaagccaattttgaatatagtcaacgt\n\
+aatttttactatgggttccaccgaaacgccttgcacaactaagaatcccataaaatatcg\n\
+atatcaaataaaagattgtgtcaataccttcatatatattttttcggttgactaacgtga\n\
+actaaggttaggggttttgtatgtctatataggaaacagtttcttttctgtcctacttta\n\
+gtaaagtcttcaagccttactccaaaatcacggtgattaagccgttactcagcagcatga\n\
+ttctgcctgctcgggtcctaaaatccagccttgtaagagtcgctgtgtattagctaggga\n\
+gacctttgttaaaaaggatatatcgcggcgggatgtgagtgcgtggcgcatactcaatct\n\
+tcagctcgtgtcattataatatctctcccccacgcttttcactagatatgccgtgtaagc\n\
+aaacaccttatgcttaatttcgaaaatattggtacttgaaaaaagctgtaggggtactta\n\
+atgtctggtaggagatcaggagagaattgagtgtaaaaccgtaaagccctcacctgactt\n\
+catgtaaatggcttagaagactccatgatttaataaatactacgaaggaaagactggatc\n\
+taaagataactctagtaaggccaactcccttcaatgctgttgccagttataatccaagag\n\
+ctgtccttttctgaaccatagcggcttctgaagcgaactagaagcaaagttggttctagc\n\
+cagacagccacataccctgtacgggtgtattactaaaactggtccggtattagttcacca\n\
+agggaggaattaggcaaaggatctaggtatgcaagtcggagtattacatccctaccctga\n\
+atccatcaataggttcctctgtactggccttcgcaatgagtattcaaggttgtacagccg\n\
+tataataataagatagtgactatgaacgggaagtaacccgctcaccttccccaaaacatt\n\
+gttatatctaagtattaaagtctgccgtagtgttaatactcgaaaataaacaactggcaa\n\
+attacaccgcacttaagccgcttttgatttatatttttccaatgcgcttttaaaaataat\n\
+tcagtcctacatactaattaagacccttaaacggagatatcacaagttaagttttaacca\n\
+tctcgactaggtggaactatagatacccaactcaatttatcattacctgtaatgttccta\n\
+gaaggattgcatttcatgtcaagacggtggagtttcacagcgaaacttcagtgtgaacag\n\
+attctgagaaatcacctaaacctattagtcagagcacccggttagaaccagttgtcaaaa\n\
+aatagagcggttgcatgagacagaagtaacgatgagatccgttgtaacgttgagacatct\n\
+ggcctatcgtcaatacagtcctcccttaaaaatatttttaaatactaggcaaacccaaca\n\
+taggttagtcctatgtgatacgccacatggtatatcattttgtaacgttacctagggata\n\
+atcaggaagtggaattacgcaaaagtagacagtgaaatgcttagggttatagtctagtcc\n\
+aaagataaaggataaagcacgtcagagaactatattagccgaatgggaatcattgttagg\n\
+agactgtggatcatgtctaaaaagcaacgcagaaacagtcatcgaaaaaatctcgttttt\n\
+gtttgaatctaaaagagctttgatgaccgatagtacctgtatactagttactgtattacg\n\
+tgtctaatgatttcggattggggtccccagaatcagacgtcattgtagacgattcaagtt\n\
+taccaatttaatttcccagctctccttggagaactatcgccaataattgcagtcactttc\n\
+cttttctgaaacgataaagccgtcagagttctctgcaacgttggacttacctgaggttct\n\
+aacccactttcggttctaatagtagttaacgacacaacgaataacctttactgtggggct\n\
+ttcacgatattttttcgcttattattaatggttacgtcataagctggtgtccaaattaag\n\
+gttaccggcttcgcagagtagttgtatccaagtataacttccctaatcataagatcgagg\n\
+tagaaaattaatgctgtctctaaccgaacagatatgtcccactatgtggtatggacgttg\n\
+ctaattacttctgaagggaaattggtcattatggatacgtgtctaccatcaggtcggacg\n\
+cagatatggttctgtcttcagttgatccaccgttctttataggataataactgacgatta\n\
+aagattatggtaaatagattaagccaattctcttcttgtcagtgaagcatccttaactga\n\
+cttgctctgcagcccctcatacatttagctattcaaagtaccggctcgtttcaaactctc\n\
+ccacctttggaagaggttgtcaacttgataagtatatcatttacagcattttttcggacg\n\
+tacctctaatgtttcattgcagaaaattagttttttctatcgcacattttgcaagtaacg\n\
+ttagagacacaattatctgcgaatgaactgctagatctgacgaccgggagcctcgcaaat\n\
+atcaaaaaagactgacatatatcaaggagtcgttgacaagtgctggtaagtcaattggtt\n\
+tatctgtcccggcgtttcgatcttaagctgaccatgcacggcagagtaatgtcactctcg\n\
+ttcttacaagtctgtctccaagggtcggcaaaaaagacccctccattctcgagcccactc\n\
+acgatatgtagggacgacaacttgtgcggcttatgaattgtctggactgcgggcgagggt\n\
+ccatatctccgaagttagaagggacatacctttagatgataagatcaattcttattgacg\n\
+aaattcatccacaacggggaacaacttcaccctagacttacgtctgaaaagacacctagc\n\
+gtcttataaaaggtcagtgccccgtttcgtaaggctggaattacctacgcaaacttaaac\n\
+ctcgcgcccttccttacgtatcgacaagatagaggctatcgcgaatgtactacggaggca\n\
+tgaatcatatactagaaccaagtgcctgtgatattaacaagatgatccgacgcgagcacc\n\
+gtaattctaggcataaaactccagcaatttgggggccgaaaacaaatgacgttagctaat\n\
+taattatatgacatgatcaaaggaggtcaatcacgcatcgagttcgacgtatattcattg\n\
+aacttcgtgcgtttgaaagaaacttttatgaaggcaaaattgatcctgtctcctatttca\n\
+tgcgtacctcctagttgataattccccgagcagtggttaggacacttttgtcggtatcaa\n\
+gttccggtctcaaaacgtaaaattctgtaatctgtatggatggtctgtgaattagttaat\n\
+ttttatgaagtcgtcgagacgcagttcctattgatttattctaaacggagatgtgcttcg\n\
+tgggactcggaagtagatctgtgtttatgattattgctactttagatgctgactgttaac\n\
+tccgtgttgtttttcaaccgtatatcacaaccgaattggatagaacctatagtttcaagt\n\
+tctgccacaaggtatcatatttacagttagtgctggttgcttctttcaaacgtggtgagt\n\
+ttgtgctatcacgtcaacggtagagctcagtggaccgagtgcgcgttcaaccctgttcca\n\
+gagagggtgtgatagcacatataccacgctcgtcgaggcgttcatgatagtttgcaagag\n\
+ccggtgttaaacacatattattattgttatccaactaatcggacctatgcataaagcatt\n\
+gtctaaacagaataattgcctatatacggtagttttagtgatttatatcttagtatcagt\n\
+tagagcttcgaactcttcaggttcctcatatttaacgttcttcgaaagcgaaaacttcta\n\
+caaacgaatgtaagcggttttccaagtagtacctataaatcacagaaagatctgtctcag\n\
+tatagttgaaatggtattcagctagtgacgtgtaccaattatcatagttcactcaagcaa\n\
+gacgctcattaacgaatatagacaagacactatatcatataataaaaaagaacatggtgc\n\
+tcgaacatagttgaattcaccatattgaaggggaatgctgacatgtaattcgctactaga\n\
+cgatcaattccctacttgtcaaagttgaactggtacgttcttggaattaaatatgattgc\n\
+gctggaccaaattgcgacttcttgagtttcagggcaaacgattgagccggaggatgtccg\n\
+tctcttacctttcttgcttatgataaacgacggtccctgtacatcactgggaattctcag\n\
+caaaaataattgggtaaatcgagactcgatgtattcggccacaaaggtgttagacgttaa\n\
+agattattcaacggggcgataataggatcataaccggtatgcaagcgcattgaaagagcc\n\
+atgagatccttatccgataaacgctgcacggtatgtgcagccttattgtcgatcacgaat\n\
+ttataaatgtagtctgggctgtaagttgaagacctaagttataatgaagtgcaataccaa\n\
+atcgattcatagtggattatcagactcaagatatctcctgataaattacagttgttaaga\n\
+tacggataaaatgagatttaagattagcagcctctaatctgtttcaatcccgttggaatg\n\
+tggtatgcgatcaaggttaagttaaaatcaagcctgtcttcagtcttgattcttgttctg\n\
+ccatcgcatgcggtctacgtgagttaatatgtagcttacgttctagcttgtgctaatctg\n\
+agtatagattcgtagaggaatattatcaagcttccacgcctcaacgtacgtgtattggtc\n\
+acacaagacactaaaagtggaagtagcgtaaactatagtctagttgttaaatgctcagtt\n\
+cttgttatattcgatatactcttggctaatttatgtctgagtatataaaattaatgatat\n\
+taacttgcatttcacggatcccttagaaaaagattttgaccgagcgcattataaacggtt\n\
+acaccgaatcaatagaagcatacccaatagctttctttgaatttattgcctgcgcaactt\n\
+ggctgactctctagatccgaataattctatatggtcgtgacgaaactagttcattactgt\n\
+ttaaaatgccaacatgtcttttgggccgataatggctctttgcaaaattactcaatgata\n\
+cgattgatcaaagcggtagttgctagtggtagcatgtaagtctatcaaatgtctgattat\n\
+ccgaaaatcttccaaaagagtccacgtaccatatctatctcatagcgacgcgaggggaac\n\
+cttatctaactatcattccatttaccgggtgactctcgatgcaggatccgattgggataa\n\
+attgcccagaaatggctcattcctgactaagggtaaggccgttctcagcaagggaacccc\n\
+gcgaatctaggcttataccatctagattgttaactacttgcctgtagttctacagccata\n\
+ctggacagttgtttctaaatgatcgggattcatgctagcactcctctgaatgcaccgcgt\n\
+aagtttaactattacgtccgtgggcagataaggatggaggctgtatgtatcttaactgtt\n\
+acctaatatggctggtaattatcaaagtaaggaccttaatgccatagcgctagcaatcgc\n\
+tttgtatactgaccatgtgccaacctctcttaatctgtaaaatataatgtcttagctaac\n\
+tgtggacgatcatgtctctgcctagagcttcgctgtatcaattcctatagccagcgtact\n\
+agtgacacaacaacaccgtgtgagaaaagatattagtccttacgtctgtctctctacagc\n\
+ttattgatgaggattgaacatggacatatagctccccctcaaaagcagatgctacctctt\n\
+tattccattctcgaacatttgccgaacttaatttcgacaaacctgaggtcacgtcttaat\n\
+ttatcggtaacgtcacgtccctttgagactggataaatatattaccaggggccaacgagc\n\
+aattgttggaggcgcttctataatacaaggtgtcttgtcaaagaaagacggcgtgcgtct\n\
+cgtgcaactcacttaaccaatattaatgtgaaacccccctctctcacatcttatgcggtg\n\
+tactgccctggtacatttcctgtacaggactccaacagtgtagattcctaagatagctgt\n\
+tggagttgcctcacgccagatcgaaaaactgaataaactagtgagctgagctgcagaaat\n\
+accgcttaattacttatgactagttcaaagggacctacgtgatgtcagacattgcaagga\n\
+agaaattaggtttgtgcgtcattttggctggactagcactccttacttcccctactattc\n\
+aaatgtcgtaaacagcatgagacaggatcgtgctgacatttaaggtctattgggaacgag\n\
+gctacctttggtcgcgcgctcgcgttctccgaatgaccgaaatgcatgagcacagtatgc\n\
+aattgcttatagatctaaggtctggtcgttgaaaccaagcacgtaggcctgggaaatcag\n\
+ttcttcctcagcaactacacaaaagcgtccaagcattagtacttgtagtaaatgtccgaa\n\
+cctatgcgctcatttgaaagtcaaaaaatatttttaagcagtaggcacctaacccgattc\n\
+ctctacttagtagctttctttgattctcagaattgactgcaatatcactgcacaattctg\n\
+tgccattactagacttctctgtattaacgtctcatcttactaacactcgcctaggacaca\n\
+tctgagagtgaagtatttcaatacatttactgaaatcttcagttctaaaatccccgaata\n\
+aggctcttatcggtttggccaacacaagaaaaaaacttcttgcaccactcaccttcatac\n\
+gcaggagcctggggaacttagtaataactatttcggcagacaaagcttataacaagttgc\n\
+cggcgcgtataatatttaaaagaccccttgagctgctcaattaaaacgctcacctggtat\n\
+aggctattagatagtgccgtcttagtaaggggcgggaattatcggataaactgatatttt\n\
+gataaaataaccgacttgttcacgacataagtcactaaggagattttatctttctccaaa\n\
+gtatatcttccttggataatttcaaagcgctgcaatttaagttctgttactagtttatgc\n\
+tgctgggaggtgaccggaaggcgtagtaatctagaggcaaattataagaagttcatcata\n\
+tcattttcgactacaaaaacaaggtgttgtatgccggcgcattgtgtaaactggacgagt\n\
+accctagatggaaaattatacgttaagccaagatttcgatgtaatgataattacctacac\n\
+atttttgctatccataggaacaagagctgttctataggctcgtggcatacgaacatttgc\n\
+tgccgctatgaatattggaagctcttcaactacagactctattcttaattgccgtcgaaa\n\
+atgggccgaatcggctattattaatactcggtttttccgaggggattgttgtcgacagtc\n\
+gtaattattattaatattgatgttggtgaggtcatttaaatacaaccttgcagacaatga\n\
+ataagggatccaatctctcatactccttttacaattgctcatgcccctatgcaaacctta\n\
+tgccgccacacctccgcaactctctcttctgaactgtaagtagcttcattactggtttga\n\
+gactatactgaagctgatgacattctaaaatggctattttcgaatgtgattcataatgtt\n\
+tatcgtttgggatggcagaatcacgttatttttgatatagcccgggtattctattgtata\n\
+gaacgtatgctacaagtcattccccgaagaagactagaagtaaacaacatgcgaccatcg\n\
+ttaagccacgcaaggctgtagctttatttcccgataacctatcttccataaatagcggac\n\
+agcaggatactgacgctcaacatcagtggttatggtctaatttttaacttttaataaggt\n\
+aacttcagcaggcatacacagtaactctttaatttataatcaaattagaagtctgacact\n\
+tcttatatttttctatcatccaacgcgatcgcccattagcttattgtgttactaataacg\n\
+tatctaaaccaatccttttcaagctactgcctatattgtcaatatatacaaacaacagga\n\
+tagtaggctgcttaaaaaatattgtcaaccgtgtacgctttacaatacccggaaatcaca\n\
+aactttgtagacaacgagtgaaatttatacactacgaagggccagcgtacaagacccatg\n\
+aattaggcgatatgtttattctgacatattggtttatccttaatctgtcgctgtaaaatg\n\
+aagccgcccccatccctgcgaattttttttcgaagattcacgactgaaatataaatacgt\n\
+ttggctatatttatgttggagggaggcaatagcctttactgttaaccgaagatttagcca\n\
+gtgagtgtgacactaaaacactggaataaatgcaggcgttcttctgggtaaaaggtttag\n\
+tcaatctcgcctataagttcatatagctctggatataattatctggcccatgcatttatc\n\
+atggcgcttggtgccctgtgtgaagccggcctctcatattgaaggtccgaagtattccat\n\
+gtacattaagatcactctctcattcatgcatcttggcttaacaaatctggttgtccaagc\n\
+tttccaggcacgtatggtacaaattcggatcgaatacttataaaaatgatatgttaaact\n\
+gtctaaaacgctcatctacaaagtaaagtgcactaaccaatagagtctcaagaccgtgta\n\
+atgctggtgcactgaatgtgtaatacggttagaagggattagttatgttacaaatccatt\n\
+gaaaacttaagaagcattgcgtgctcggagggtgcatcttttatcaagagactaacatta\n\
+ttttcaacgacgtacatgctttacaatagggtacttatcaaacgccgagaaacgcgccta\n\
+tagtgatgttatgattatgacccgatatccattggaccgaattttatgtaggttcccagc\n\
+gtactcgcgtaatatctcggtattgccataatgtaatacttgtcggtctctcccagatga\n\
+aaaagcgttacagagtatttcaatgaaaaacagcgcgcaacgtcaatacctttaggggta\n\
+acggccgctgatttcatatagatatacgataagttggtatagctctactaggtggcatcc\n\
+acaatcgttgcatttactatagctggttacaatcataatctataccgttccttacatact\n\
+accatagcgggatagcgtttttttgccgttgattgggtttaagaggatgtcagtctcatt\n\
+atatccgattcggtgggagagccgttgttttcaaatcgcacactttgtgacataatgtac\n\
+aagataacaaaactgatataagatataaactgtcaatatcaccttgacacttgaatcaaa\n\
+gtaaattaactcgcaaatataatttgactaattgggtgcagatttctcaattaataaaaa\n\
+aatggcaccggatgggcttacaagccccttatcattcacttgtatcatgatttccaagaa\n\
+caatagaatttgctagcaagtatgaacagagattcgaattgcatccacagtacgccggag\n\
+cgtttattttaatgtggatatgacgatgtactgttggcggcatttgctagtaaccggtcc\n\
+ttatttacgtagcgcacacgtaagcatgtctgggagaaatatggtggtacaatctcagag\n\
+aaagattacagtttggtttaaataggacttatcgggtcggaagtggaacttaataagcag\n\
+tacacaattgggcaacagacgtcttgcctattacaataggattacaatgcgttagatttc\n\
+agacacgttcgtgtttggctattcgtcaattccctaaatagttagacgatcaactattat\n\
+caaagtgattctttgttcatcctccattcatgtaacagatggcacactacgcataacgcc\n\
+gaggaattttaacgagatttaagagagcagttcgggcacaacccacttgactttataaca\n\
+gctcggcagcataaacggtaatatgtgacaaatttccaaacgttataagaacgtatgtgt\n\
+acttagaaaactaagtggttcatgttcaacagatgtgacgcagcaagcctaacttatcta\n\
+ttggttttgctataaaagaacaaagttacacagaatcctaagggcttgtttcacacttat\n\
+gcctagtgcttcaccatcttaaaatagcgaaaccggcacgaatcaaaccttaaaacaatg\n\
+cgcagatattggtgatggtgactccgggtatgataatggtaactgttgaccagcgcccac\n\
+ctcatcgaagtatagaaagtggttaggataaggatgagaccgaacttatttccggccata\n\
+actttagattttctacctagtacacaacatcagggcggacacgaaaccgccatcacatca\n\
+tataccaggtttaatttgcttaatgggggaagtgtcaacgaaccttcgaactttagcagg\n\
+catatggccattatatatggccccagagcagaatgctacagcagacaaaatttggattta\n\
+tgtagtttaatacctatcaaacttggtgtgaccatacttgtctaacgacagtgcacaaag\n\
+tgtaagttacaattattactactcagcagcttctgcaatgataaaatcttatcatacacg\n\
+tcacatatgataatatctacttagggggaacgggctccacaacctacatagtactcaata\n\
+cttacactattcgacaggcacaccaaacctgtacagtcccaaaagattgagtcaactttg\n\
+cagtactgcagatcacagtaatagcttagttagcgagtcaaaattagttttctacgagac\n\
+tgcacgaccgtgcaaatttccgatgtgttggctacaaatagcaacgtatgaatttgtttg\n\
+aagccacgtaaactgtacaaccttagagataagtctcaggctactaaaaacacgttgtgg\n\
+cactaacaggatcatggttgattcttacttattcggctgaccggcccaataagtaacctt\n\
+caactagaacagaataatcgggagtagtttaattcagtcaaggtgcaggtctcattgtaa\n\
+ctaacaagctctgtgtaaccaagttaaaatcgttttcttagcggattccctacttatgga\n\
+tttgagctcgtccacaatattcgatacaagaagtttgtggtccgtaacaacgaaatttta\n\
+attacgctgtgcagcctcatccaaggaattaatagaaggttgatggtaggctccgaacgc\n\
+tccatgattataatcaagtggactgtgcagtaaacgaggaaggtatcctgacgtcgtggt\n\
+gttcgtttttgttatttgtgccctatacgagtagataaaccatgaacagcacagtgtgaa\n\
+cccatggttgattttaggctaccttatttttaatttccgttacacagaaacgaattccac\n\
+aactaacatgccattaatttttcgatatcttataaaagatggtcgaaattcattcattta\n\
+ttttttttcggttctcgaaagtcaactaagctgtcgcgttttgtttctctttagaggtaa\n\
+aagtggctttgatctcctacgtttggatactagtcaaccattactccatttgatccgtga\n\
+gtatcacctgtctaacatccagcattatgactcctcggcgaagaaaagacacacttctta\n\
+gagtcgatgtgtattagctagggacacagttgtttaatacgatagtgagcccagggaggg\n\
+cagtgcgtcccccagtagatttattcagctagtgtaagtataagatatctcacccacgag\n\
+gttcaagtgatatgcagtcttagaataatacttatcctgaatttcgatattatgggtact\n\
+tcaataatccgctagcgctactttatgtctcgttggacagcaggacacatggcagtctta\n\
+aacactaaagacatcacctgaatgaatgtaatgggattacaagaatcaatgaggtattat\n\
+atacgacgtaggaaactctggatatatacagtaatctagttacgccatcgcacttcattc\n\
+ctctggaaacttagaagacatcagctgtacgtggaggaaccagacccccgtatgtagcca\n\
+aatagaaccaaagttgcttatacaaacacacccaatgacaatggaccgctggagttcgta\n\
+aactcggaacgtagtactgcacaaacccagcatttagcaataggagctacgtatgcaact\n\
+cccacgtggtaataccttcaagctatcaatatataggtgcctagctaatcgcattcgcaa\n\
+gcagtattcaagcttgtaaaccagtataataattacagaggctctatgaaacccaacttt\n\
+ccagctaaaagtcccaattaaatggttatttcgtacttttaaagtcgcccgttctgttat\n\
+tacgcgaattgattctactccaaaattaaacacaaattatcaaccgtttcatttatattt\n\
+gtcaatgcagctgtttaaaataaggctctactaaattataattaagacacttattaccag\n\
+atttctctagttaagtttgaaccagctcgactaccgcgaaagatacattcccttctctat\n\
+ttttcagttcatctatgggtcagagaagcattgaatttattctattcaccctcgtcgttc\n\
+acagcgaatcgtcagtgtgatcagtgtatgagaaatatcctaaaccgtttagtcagacca\n\
+cacgcttagaacaagtggtctaaaaagactgccctggaaggagtaagaagtatacagctg\n\
+atccggtgtatccttcagtcatctgccctatactaattacacgacgcaaggaaaaatagg\n\
+tttattttctaggcaaacccttcataggtgactccgatgtgttacgaatcatgcttgaga\n\
+atgtgctatcgttaccgacggataataacgatctccaatgaaccaaatgtagaatgtcta\n\
+ttgattacccttttactattcgacttagagataggagatagaacctcagtgtactttttt\n\
+agccgaatgggaatctttgggaggtgaatggccataaggtcgtaaatccaaccctcttaa\n\
+agtcttccatattatatcgttgttcgtggaatcgataacagatttgttgacccatagtaa\n\
+atgtatactagtttatgttgtaagtgtagattgttttccgattgccgtccaaactttatg\n\
+tcgtaattgtagaccagtaaagttgaccaaggtaagtgcccagcgatcctgcgagatcga\n\
+tcgccaatttttccagtcactgtaagtgtaggtttagataaagccgtatgagttatatca\n\
+taagggcctcggaaagcagcttcgaaccaaagttcccttataatagtagtttaactataa\n\
+aagtatatactggtctgtcgccctttcacgatttgttttaccggtttatgaagcgttacg\n\
+tcattagagcggctccaatttaaggttaacggcttccatgtgtagttgtatacaaggata\n\
+acttaaagtatctgttcagcgagctagttaagttatcctcgatagaacacaactcagagg\n\
+tcccaagatcgggtttgcaacttgctaatttattctcaaggcaaattgggaattatcgat\n\
+acctgtataccataaggtcgctcgatgtgatgcttatgtcttctggtgatcctaccttag\n\
+ttagtgctgattaacggaacattaatgtttatcgttttgagatttagccaattctctgat\n\
+tctaactcaagatgccttatctgacgtgctatgcagcccctaagtattttacattgtaat\n\
+aggacacgctcctttaaaactcgccaaaaggtcgttgtggttctctactggttaactata\n\
+taatttacagctttgttgagctagttcctctttggtttaagtcctcaatattagttggtt\n\
+cgagcgataagttggctagttaccttagtcactatattagatccgaatgttatgcttcat\n\
+ctgaagaccgccaccctccaaaatttcttttaagactcacttattgcaaggtgtaggtga\n\
+attcggctcgtttctcaagtggtgtatctgtacacgagtttccatattttcatcaacagc\n\
+caccgcacacttatgtcactctaggtattaaaagtcgctctacaaggggacgcaattaag\n\
+aaacagacatgctagtcaaaaataaacatagcgaggcaccactaattcggccgcttatca\n\
+atgggatgctctgcgcgagacgcgccagagctcagtagttagttcggacatacatttact\n\
+tcagatgatcaattagttttctacaaatgcttactctaccccgaaaaaagtcaccagact\n\
+cttacgtctctttagtatccttccgtcttatataaggtcagtcccccgtttcggtaccct\n\
+ggaatttactaagaataatgaaacagcccccaaggacgtacgtttacaaatgatagacca\n\
+gatcgcctagcttattccgacgcatgttgcatagaattgaaccaacggaatgtgagagta\n\
+actagatgagccgaccacagcacccgtttgcgtcgcagaatacgcctgatagttcggcca\n\
+cgaaatcatatgtcctttgagtattaagtatttgtaatgatcaatcgagctcaagcaagc\n\
+ttacacttcctcggatattcagggaacttagtgcctttgaaagatacgttgatcaacgaa\n\
+aaattgataatggctcatatggaatgcctacctcatagtgctgaattaacacagcactgc\n\
+ggacctaacttttcgaggtttcaagttcacgtctcaaaacctaataggctggaatatgta\n\
+gggatcctcggtgaatttgtgattgggtttgttgtagtactgaccaagtgaatattcttt\n\
+ttttctaaaagcagatctgctgccgggcactacgaaggagatctctgtgtatcattattg\n\
+cttcttgacatgatgactcttaaatcactgtgggtgtgcaaaacgatagcacaacccaat\n\
+tcgatagtacatattgttgatacttcgcactaaaccgttcatatttaaaggttgtgctcc\n\
+ttccttcgttaaatactggtgacttggtcctatctactattagctagacctctggggaac\n\
+cacgcccccgtaaaacctgtgcaagagagggggtcatacatcttagacatcgcgcctcca\n\
+ccagggaagcattgggtgattgaccaggtgtgtaacaaatatgattattcttatactaat\n\
+attagcaaagatgcataatgatttgtattaaatgtataattgaattgataagggtctttt\n\
+agtcagtgatagagtagtataaggtagacattagaactcttaaccggacgcagatttttc\n\
+ggtcttagtaagccaattagtcgacaaaacaaggtaagagcggttactagtagtacctat\n\
+aatgcactgaatcttcggtcgaagtatagttctaatgctatgcagattgtgacggcgaca\n\
+aatgttcagacttatatcatgaaacaagctcttgtaagtattgacaaatgaaaagattga\n\
+atatttttaaatacaaaatgcgcctacttattaggggaattaaccagattgaaggccaat\n\
+cctcacatgtaatgagataatagacgataaatgaaattcttgtaatagttgaactgctac\n\
+gtgatgggtattatatatgattgagatcctccaattgccgacgtcttgtcttgatgccca\n\
+aaagattgtcaacgaggagctccctcgcgtacctgtcgtccgtatcataaacgacgcgac\n\
+atgtacagcactccgaagtataagcaataataatgcgggtaatccagactagatcttttc\n\
+ggactcaatgcggtttcacggtaaacatgattaataccggagagtagtcgagcttatcag\n\
+cgatgcaagcgaattcattgtgccaggagatacgttgcagataaaaccggcaacgtatgt\n\
+caacaagttttggcgatctcgttgtttgtattcgacgaggcgcgggaacttcaagaacta\n\
+tcgtatattcaagtccattaccttttagtttcagactggtggagctgactaaagttatat\n\
+catcattttgtacactggtttagttaacgataatttcagatttaacatgaccagacgata\n\
+atcgctgtatatccagttggaatgtggtttgccagaaaggttaacttataatcaagcctc\n\
+tcttcagtcttgattcgtcgtatcccatccattgcgctatacctcagtgtatttggagct\n\
+gtagttataccgtgtgctaagatcagtagacatgacgagagcaatattatctaccttaca\n\
+agcatcaacggacgtctagtcggaacaaaagactctaaaactcgaacttcaggttaatat\n\
+actatagttctgtattcagcagttattcttatattcgatattatcttgcctattggatgt\n\
+ctgactttagtatattaatcatagtatctgccatgtaaaggtgccagtactaaatctgtt\n\
+tcacagtgcgaattataaacggttacaaccattaaagacaacaagaccctatagctttat\n\
+ttgaattttgtcaatgcgcaacttggagctcgcgatacatcccaattagtctatagggtc\n\
+gggacgattctacggcatttctggttataatgacaacatggattgtggcccgagaatcgc\n\
+tctttcattaattaagcaatcattacagtcttataagcgctacttccgagtggtagcagg\n\
+taactcgatataaggtcgcatgagccgaatagcttaaaaaacaggccaccgaacattgat\n\
+agagaataccgaccacagcgcaacctttgattactttcattaaattgtacggctcactcg\n\
+acatcaagcttaagattgcgataatgtgaactcaaatggatcagtactgaagaaccgtaa\n\
+cccacttcgcagaaagcgtacccagagaagatacgctgttacaatatacagggtgaaatt\n\
+attgcctgttcttcgtaaccatttcgccaaacttggttagaaatgatagccattcatgat\n\
+agaaataagctgaatgataccagtatctttaactatgtagtcagggggaagataacgatg\n\
+gtccatgtatgtttctgatatgtgacagtattggccgcgtaatttgctaacgaagctact\n\
+taatgcctttgagcttcatatagatttctttaatcaaaatcggcaaaaagatagtatgag\n\
+ctataatatatgctagtagagaactctggaccatcatctatatgaatactgattcgagcg\n\
+tgcaattactttagcctgcgtactactgactctacaaaacactctgagataagtttgtag\n\
+tcagtaagtcgctctctataaaccttttggatgaccattgtacagccacttatagatccc\n\
+aataaatagcacaggagacagagtttttcaatgctcgatcatttgccgatagtattttcg\n\
+tctaacctcagggcacctattatttgatacctaacctaacggccctttcacaatggagaa\n\
+atatatgacatcgggacaaacacaaatggtgggtggccaggagatatgacatggtggcgt\n\
+ctctaagaaacacggactccctctaggcaaactcacgtaaccaattttaatgtcaaacaa\n\
+aacgctcgaaaagattttgccgtgtaatgacctggtacattgactggtcaggaatacatc\n\
+actgtagttgccgtagtgtcctgttggtgttccatcaagacacatcgtataacgcaattt\n\
+acgacggacatcagatcaagttatacagattatttaagtatcacgtgtgcattgggacat\n\
+aagggatctcacacatgccttggaacatttttgctttgtgccgctttttcgctgcactac\n\
+caatccttacttaccagtatattcaaaggtcgttaacagaatgagaaaggttagggctct\n\
+aagttatcgtcgattgggatagacgagacatttgcgagcgccctccacggatacgaatct\n\
+cccatatcaatgtgaactggatgctatgcagtttagttcttacgtctcctagtggtaaaa\n\
+atcaaagtagcactcgcatagcagttattcagaacctaatacacaaaaccgtcaaacatt\n\
+ttctaattctaggtatgggccgatcataggagctaaggtgaaactcataaatgttttgtt\n\
+agatctagcatcctaaaaagatgcatatactgagtagctggcgtgcattctctcaattgt\n\
+atcctttttaactgaactagtcggtcccatttcgtgactgagatctattaaccgataaga\n\
+ttaataacactcgcattcgtatcagctcagagtgaagtttttcaataatttgactgatat\n\
+attaacttctaaaataaccctttaagcctcggatccgtttcccaatcacatcaaaaattc\n\
+ttattccaactatctacggattaacaacgtgcatggggatcgtagtaagaacttgttccg\n\
+atcactttgagtatatcaagttgacggcccggttattattgaatagaaacattcacctgc\n\
+taaattaaataccgcacatcggatacccgatttcagagggccgtcttactaagggcaggc\n\
+tttgttcggtttaactgagatgttcattattttacagtatgcttcaactaatatgtaacg\n\
+aaggacagtggatctgtctccatagtagatcttcagtcgtgaatttcataccgctcctat\n\
+ttaagttcgcgttcgagttgttgatcatggcacgtgaaagcaacccctagtattctagac\n\
+gaaaattttttctagttcatctgataatttgccaattcaaaaacaaccgctggtttcccg\n\
+gcgcattctctaaaatggaagtcgaacctagagccattatttgtcggtaacccatgagtt\n\
+ccttcttttcagaagttaatacactgtggtcctatacagaggaaaaacagcggttatata\n\
+cgatcgtggcataacaacattggatcaagatagcaatttggctacctattctaattctca\n\
+ctagattcggtattccactacaatatcggcagattaggattggatgaataatcggtgttt\n\
+aagtccggttgcgtctccaatctcctaatttttattaatattgatcttggtgacctattg\n\
+taaataaaaacttcaagactttgaataacggtgaaaagatagaagactcatttgaaaatg\n\
+gatcatccacagatccaaacattagcaagacactaatccccaactagctattctgatcgc\n\
+gatcgtgctgcagtactcctgtcacaatagtctgttcatgatctaattctttttgggctt\n\
+tgttcgatggtgattcagaatctttatccggtcgcttccctgtagctactttgtggggat\n\
+attgcccggggattatagggttgagatcgtttcctaaaagtatttaaaccaagtagactt\n\
+caactaaactacatcagaacatcgtgaagacaccatacgcggtacctttatttaccgata\n\
+acatttcttcaagaaataccggtaagcagcataatgaccctaaacagctcggggtatcgt\n\
+cgtagttttaaattttatttaggttactgctcaaggaataaaaactaactatttaattta\n\
+taataatattacaaggctcacactgattagatttgtctataagacttcgcgatcccccat\n\
+taccggattgtcttaagaataaactagataaaccatgcattttctagataaggcctttag\n\
+tctaattagatacaaaaaacacgatagttgcatccttaatttattgtgtcaaacctggaa\n\
+ccttttaattacccgcaaatcactttatgtcgagactacctctgaaatttattatctacc\n\
+taccgcatgaggacttgaaccatcttgtaggagttatgtttattagctaagattcgttta\n\
+tcctgtagcggtccatgtatattcaacaagcaaaaagcactcagaattgtttttagttga\n\
+gtcaagactgatatataaataagtttccctagttttttcgtggtgggacgatattgaatt\n\
+gaatcttaaccgaagagtttcccactctgtcgcacaataatacacgccaatatttccagc\n\
+cctgcttatgccttaatcggttactcaatctcccattgaagttcattttgatctgcatag\n\
+aagtttcgggcccagccttttttctgccaccttcctccaagctctgtagacgcactctaa\n\
+gattgatgctcacatgtattaattctacattaacataaatatataagtcatgcatcttcg\n\
+agtaaaatatctggttctccaacatgtcctggcacgtatcgttataatgcccatacatgt\n\
+agtattaaaatgattgggttaactggatattaagatcatcgaaattgtaaagtcaaatta\n\
+acaatactgtctcaagaccgtgtattcctcgtgctcggaagggctattacgcttacttcc\n\
+gttttggtatcttaatatgactttcaaaaattaagttgcagtgagtcctacctgcgtgca\n\
+tcggttagcaagagtataaaagttgtttaaacgaactacttgctttacaataccggtcgt\n\
+atatatcgccgtgaatccagaagattgtcttctttggattatcaaccgagatcctgtgga\n\
+ccgatgttttgggaccttcacagaggactccaggtagagctcgcttttgcattaatctaa\n\
+gaattgtacctctctaaaagatctaaaacagtgaatgtgtatttcatggaaaaacacaga\n\
+gaaacgtaaattactttaggccgaaaggcacatgagttattatacatatacgagatggtg\n\
+gtatacatcgaattcggggcatacactatagttgcattgtatttagctgctttaaataat\n\
+atgatattaccttccttacataagacattaccggcataccctggttttcaacttgtgggg\n\
+ctttttgacgatcgcactctcatttgatccgagtagggcggtgacccctgcttttcaaat\n\
+acaaaaatttcgctatgaaggtaatagattacttttcgctgttatgatagaaacggtaaa\n\
+tttaaaattgaaacttctagaaaagtaaagtaacgagaaatgattttgtgaataatgcgg\n\
+tcatgattgcgcaagtaagaaaaaaaggcaaaaggatgcgcggaatagaaacttatcagt\n\
+cacgggtatcttgatttcattcttcttgtcaattgccgacataggatgaaatcagattcc\n\
+aatgcaatacacagtaacccccacccttgattgtaatgtcgatttgaagttgtacgcgtc\n\
+gacgaagtggatagtatacgggccttttgtacggtgcgatcaactatgaatctcggcgag\n\
+ttagatggtcgtacaatctcacacatagaggtcacttgcctgtaatgacgaattttcggc\n\
+taggtactcgaactttattagaagtaaaaatgtgggcaaaagaaggattccattttacaa\n\
+gacgattacaatgagttacatgtctctcaacgtagtctttccctagtagtctttgaacta\n\
+tttaggtactccagaaaattttagcaaagggtttctgtgtgaatccgccattcatgttta\n\
+tgatggaacaataagaataacgccctcgtatgttatcgacagtgaagtcagcagttcggc\n\
+caaaaacatattcaatttagtacagatccccagaagttaagctaagtgctctaaaatggc\n\
+ctaaacggttatcaaagtaggtctaattactatactaacgggtgcatcgtaataactgct\n\
+gtcgatgcaacactatatgatagtgtcgttttgctatatatgtacaatgtgacaaagaag\n\
+ccttagcgattcttgcaaacttaggacttcggattctcaatcttaaatgtccgaaaacgc\n\
+aaagattcaaaaatttaatctatgagcagatatgcctgatggtgactacgcgtatgttaa\n\
+ggctaaatgttgacaaccgcacacataatcgaactattgatagtcgggagcataaccagg\n\
+tgaacgtactttgttcacgacatttattgacatgttctaaatacgtctcaaaatcacggc\n\
+gcactagaaaacgcaatcaaatcattgtcctggtttaagggccgtaatgccggtagtgtc\n\
+aaacttcatgagaactttagctggcttttggccagtatttagggaccaagagcactagcc\n\
+ttaagctgaatattttgccatttatctactgttataactttaaaacttggtggcaccaga\n\
+cttgtcgatacacacgcatcaatctgtaacgtaaaaggtttactaagaacaagcgtagga\n\
+attgagtttatattatatttaaactaaaagatgatattagcttctgagggcgatagggct\n\
+ccaaatcataaagaggaatatattattacacgattagaaacccacaacatacctcgaatc\n\
+gcccaaaagtttgacgaaacttggcagtactccacatctcagtaatacagttgggagagt\n\
+ctcaaatgttgttttattactcaatgaaccaccctcataatttcactgctgttccattaa\n\
+atttgcaaacgatcatttgctttgaagaaacgtaaaatcgacaaaattacagataagtag\n\
+atgcataataaaaaaaactgctcgctataacacgatcatcgtgcattcttacttaggagc\n\
+atcacccgcacaataacgtaccttaaactacaacactattagaccgagtactgtaattca\n\
+cgaaagctcaagctcgcattgtaaagaacttgctctctcgtaaaatgtgataatagtttg\n\
+cggagaggattcaattattttccattgcacctactccactagattcgataaaagaaggtg\n\
+gtcctcccttaaaaagaaatgttaagtaacatcggaaccataagcaaagcatgtaagtga\n\
+accgtcatccttccctaagaaacataaaggtttttaataatgtcgactgtgaactataac\n\
+tgcatcctttcctgacctactccggttccttgttgttatttctgaacgagaccagtagat\n\
+aaacaatgtaaaccacagtgggtaccaatggtgcatgtgacgctaccgttgttttaagtg\n\
+cccgtacaaacataagaagtcataatcttacttgaaattaattttgccttttattttttt\n\
+tcaggctcgaaattaatgatttgttttttttgaccttctagttacgctaatatgcggtcg\n\
+cctgtggtttctattgagtcctataacgggatgggatctaatacgtttggttactagtaa\n\
+acaaggtataaatttgataccggagtatcaactgtataacatcaagctttatgactcata\n\
+cgcgaagtaatgacacaaggctttcaggagatcgcgagtacagagccactaaggggtgta\n\
+ttacgatagtgacaccaccgagcgcactcactccccaagtagatttatgatcctacgcta\n\
+agtattagatatataaccaaagaggttctagtcagtgcaactcttagaataataattagc\n\
+cggttttgcctttttaggcctaatgcaatattcagctagcccttatgtatctcgcgttcc\n\
+acagcaccactcatggcacgcgtttaaactaatcaaatataatctatgaatgttatgcca\n\
+gtacttgaataaatcaggttttttataagtccttgcatactctcgttatatactgttaga\n\
+gtcttaccccatagaaattctttcatctgcaaacttagaagaattctcagctacggggag\n\
+cataaagtccccaggatgttgacaaatacaacaaatgtggcttatacaaacactccatat\n\
+gaaaatcgaaccctcgtggtagttttagccgaaccttgtacggataaatccctccatttt\n\
+ccaatagcagatacctatcctactacctcgtggtattaaattaaagcttgaaatatagag\n\
+ctgcatagcttatccaattcccaagcacgagtctaccgtcgtaaccacgatttgatttac\n\
+agacgctagagcaaacccatctttaaacatataagtaaaaattaaagggtgagtgcgtac\n\
+gtgtttactagcaacttcgcttattaagacaattgtttataagccataattaaaaacata\n\
+tgttcaacaggttcattgatatttgtaattgcacaggtttttaataaggatctacgtaag\n\
+tataatgaacaaactttttaccagagttatattctgtactttgaaaatgctcctctaccg\n\
+ccttagagactttcaattagattttttgcagttaatctatgcgtaagtgaaccatgcaag\n\
+ggatgcgattcaaccgcctcgtgctaaccctatcgtctgtctcataactgtaggtctaat\n\
+ataattttcagttttcgaacacataaccctttgaaaatctgctatttaatgtctcacctg\n\
+catgcactatcttctatactgctcagaacggctatacgtcactatgctccaagtgacgat\n\
+ttaaacgaagcaaggaataataggtttattttagtgcaaaacaattaagtgcggactacg\n\
+tgctctttacaataagccttgtgattgggctataggttaagtcccatattaacgatctcc\n\
+aatgtacaaaatcgacaatcgctttgcattacccggttactagtcgaattacagatagct\n\
+gttagatactcactctaattttggacaacaatcccaatcttggggtcgtctatcgcctga\n\
+agctcgtaaatccttccatcttaaacgattacatattatagacttgttcggggtagagat\n\
+atcacagttgtgcaaacattgtaaatcgatactagtttatgttggtagtctagttgcttt\n\
+taccattccccgaaaaacttgatctactatttcgacaacagtaaacttgaactaggtaag\n\
+tgaaaacagagaatgcctcatagtgccactatttgtccactatatgtaagtgtagcttta\n\
+cataatccactatgactgagatcattacggcctaggaaagcagcgtagaaaaaaagggcc\n\
+cggatattacgactgtaactataaaactagttactggtagcgcgccatgtatagatttgt\n\
+tttaccggttgtggttgcgttaacgaatttcagccgcgaaaattgatccgttaaccagtc\n\
+catctcgacttctataaaacgataaagtaaagttgatgttcagcctccttcttatggttg\n\
+catcgagagtacactactcagtgggaaatagatcggggttcctacttcagattgtattat\n\
+ctaggcaattgccgattgtgccatacctggataaaataagctacctacatgtgatgctta\n\
+tctattatcgtcatactaccttagggtgtcctgttgaacgctacattaatctttagccgt\n\
+ttgagatgttccaatggataggagtctaacgcatgatgaagtttaggaaggcagagcatc\n\
+ccactaagtatgtgacagtgtatttcgaaacgagacgttataaatagaaaaaaggtcctt\n\
+ctggttctattctgctgaactattgaatggaaagattggttgacctacgtactatttgct\n\
+tgaagtcatcaatttgacggggtgagagacatatggtgcatactttacggactctatatt\n\
+ttagatcagaagcttagcagtcttctctacaccccctcacgacataattgcttttaagaa\n\
+tctatgtttgattcctctacgggaattcggatccgttcgcatgtgcggtttatctaaacc\n\
+aggggacatatgttcagctaaagcatacgaacactttgctaactagacgtatgtatagta\n\
+gctataaatcccgacgatatttacaaaaagaaatgagactcaaatatatacatagcgacc\n\
+ctacacttattcgcaccctgatctaggcgatcctagcacccacacccgaaagtgagcact\n\
+agtgtcttccgtattaaatttactgcagttgagattttagttgtctactaaggattactc\n\
+taacccgtaataaggatcaagactcggtactagctttactatcattccctatgtgttttc\n\
+ctaactcacaagggtacgtaccagcctatgtaattacaataatgataaagacacaaagga\n\
+agtaactttacaaatgagtctccagttacactagcttagtccctcccatcttgctttgaa\n\
+gtctaaatacgcaatctctgaggatatacagcagaagaacactcataacgttggagtcca\n\
+agaattagactcatagggcccccaacatttaatatgtactgtgagtttgaaggtgttcta\n\
+ttgttaattcctgctcttgatacatgacacgtactccgtgtttaaggcttcggactgact\n\
+ttctttcataagttgagcaacgaaaatttcagaatcgataagttggattcactaactaat\n\
+acggctgattgaaaactccactccggacctatatggtcgacctttatacgtaaccgatat\n\
+aaaacttataggctggtatatcgagccttcctagcgcaatttcggatggggtttcttcta\n\
+ctactcaacaacggaatagtctttgtttagtaaaccagagctcaggacgcccaatacgta\n\
+ggagagcgctgtggagcatgtgtcattatggactggagcactcttaaatcactctgcgtg\n\
+tgctaaacgatagatcataacatgtcctgagtaaattttcttgatacgtcgcaatatacc\n\
+gttattagttaaacgttctcatccgtcatgcgtgaaatacggctgtcgtgctcagatata\n\
+ctattagcgactcatctcgcctaacacgcacacgtataaactcggaatgactgccgctct\n\
+tacatattagaaatacagactacaccacggaagcattgggtcattctcaaccgctgtata\n\
+aaagatgattagtcttataataagattaccaaagaggcagaatcatgggtagtaaatcta\n\
+ttattcaagtgattaccgtcgtgtaggcagggagtgaggacgagatggtactcaggacaa\n\
+atattaaccggacgaagtggtttacgtcgtactttcactattagtagtaaatacaaggta\n\
+acaccggggaatagtactaaatataatgatatctatcttcgggagaacgagtcgtctatt\n\
+gctttgaacattctcaaggcgtaaaatgtgctgacttatagcatgatacaaccgattgtt\n\
+acttttgtctattcaaaagattgaatagttttttatacaaaagccgcatacttatgacgg\n\
+ctagtatacagtttcatcccctagcatcaatgctatggacagtattgaacttataggaaa\n\
+ttcttctaatagggcaaatccgtcgtgatgcctattttttttcagtcacatcctcaaatg\n\
+gcactagtattgtcgggatcccattaacaggctcaaccacgagctcacgcgaggacatgt\n\
+agtccgtatctttaacgaagcgacagcgacagaactcccatggataaccaattataaggc\n\
+ccgtaatcctctagacatcgtttaccaataaatccgctttctccgtaatcatgttgaata\n\
+ccccagagtagtccagatgataaccgatgaaacacaagtctttctcaatgcacttacggt\n\
+gaacttattaccgccaacgtagctcatcaaggttgcgacatctagttgtgtgtttgcgac\n\
+gagcccagcgaacttcatcaactttcgtatattcaacgccttgtaattttactttaagac\n\
+gcctggtgatgtagattcttagataatcagtttgttatcggctgtactttaccataattt\n\
+cacaggtttcaggtcaagaagattatagctgtatatacagttccatgctcggtgcacaga\n\
+aacgtgatcggataataatcaatcgcttatgtcgtctttaggcgtatccaatacatgccc\n\
+cgataccgcagtgtatttcgacatgtaggtataccgtcgcatttgagctcgagtcaggac\n\
+gtcagctagattagattccttaatagaatataccgacctctagtccgaactaaactatag\n\
+ataacgccaacttcaggttaattgtctagtcgtctgtttgcagatgggattcttagatga\n\
+gtgagtatcggccatattggttcgagcactttagtttttgatgcataggatatgcaatgt\n\
+atagctgaaagtactttatctgtttcaaactcacattgattaaaccggtaaacctttaaa\n\
+gactacaagaaaatattcagtgagggcaattttgtcaatcacaatcttccagctagagat\n\
+acttcacaatttgtcttgaggctacgcaacattagacggattttcgcgttttattgaaat\n\
+aatcgaggggcccaagagtatccatagttcattttgtaagatttctttacaggcttatta\n\
+cagcttcttcagactcctacatgcttacgagttatatgctagcatgtgaacaatagatta\n\
+atatacaggaaaacgtacattgagagagatgaccctacacagcgcaaccgttgagtactt\n\
+tcattaaagggtaacgctctcgagacagcatccttaagatggccttattgtcaaatcatt\n\
+tgcagaagtacgcaagatccctaaccaacgtagaagaatccctacaaacacatgagacgc\n\
+ggtgaaaatagacagggtgttagtattcaatcttcggagtatcaatttcgccaatcttgg\n\
+tgagaaagcataccctttcttcagagaaagaagatcaatcataacactatctttaacgag\n\
+gtacgcacgcgcatcattacctgcctccatggatctttaggatagcggaaagtattggca\n\
+gcgtattgtgatttcgttcctactttatcaatttcacattcatatacatgtcttttatca\n\
+aaatcgccaataagataggatgagctatattagatgctagtagagttcgcgccaacatca\n\
+tcgataggaatactcaggacagcgtgataggacttttcaatccctaatactctctataat\n\
+tataactctctcttaagtttggaggcagtaacgcgctctatataatcagtttgctgcacc\n\
+attcttcagcctctgatacatacaaataaattccacagcagtaagagggtttaattgaga\n\
+catcttgggaacttaggattttactctaacatcaccgaaacgattattggataccgtacc\n\
+taaacgaactttctcaaggcagtaatataggacatccgcaataacacaaatgctgcctcc\n\
+ccaggagttatgtcttcctggaggctatatcttacacccactcactataggcaaactaaa\n\
+gtttaaatgttgattgtctaaaaaaaagatagataagagttggccggcgtagcacatgcg\n\
+aaagtgaatcgtaagctataattctctggacttgaagttctgtcctgttcctctgcaaga\n\
+aacaaacttcctttaaagctatttacgacgcacatctcagcaagttataaacatgttgga\n\
+agtttctagtcggaattcccaaagaacggatctatctaatgcattcctacatttttcctg\n\
+tctgccgatggtgccatcctattcaaagaatttcttaaaagtagattaaatgggactttt\n\
+aacaatgagtaaccttacgcctctaagggttcctcgagtgccatacaccagtcaggtccg\n\
+agccacatacacggagaacattctaacatagcattctcaactcgatcatttgcaggttac\n\
+ttctttcctatcctagtgctaaaaatcatacttgcaatcccatagcacggattaagaacc\n\
+taagaaacaattcagtaaaacatgttcgaattcttggtatgggaacatcattgcagctat\n\
+ggtctaacgcattaatgtttgggtacatcttccatcatataaacaggaagagtctgacga\n\
+cagggagtgcttgcgatcatgtctatcattgtgaaatcaaattgtagctcacatgtcgtc\n\
+tatgagagcgtgtatccgataagatttagaaaaatagaagtcgtataagatctcactgaa\n\
+cttttgaatgaatgtgaagcatatatgatctgctttaataaaactttatccataggatac\n\
+gtttccaaatcaattcaataattattagtcaaaatagataaggatgaacaacctgaaggc\n\
+cgatcggacgtagaaagtggtcccatcactttgagttgatattgttgaaccacacgttat\n\
+tatggttttcaaacagtctcaggatattgtatatacagataatccgataccagttgtctg\n\
+acgcccctcttacgtaccccaccctttgtgacgtttaaagcagttgttcagtattttaaa\n\
+ctaggcggcaactaatttggaaagaagcacagtggatatgtctaaattcttgttattcag\n\
+gcctgaatttaatacaccgcatagttaacttcgcggtagagttgttcatcatgcctcctc\n\
+taagctaccacttctatgatacaccaatagttgttctacggaatctgataattggccaag\n\
+tcataaacttccgctgcgttcaacccccttgctcgaatatccaactcgaaaagacagcct\n\
+tttggtgtccggaacaaatcagttacttcttttctgatgttaattctctgtggtcagata\n\
+cagaccaaaaactccgcggatttaccatcctccaagaacaaatttgcatcaacatagcat\n\
+tttggctacatattctaagtctcaatagtttaggttttcaactacattatcccaacatta\n\
+ggattggaggaataatagctgggtaagtccccttgcgtctacaatcgactattttttatg\n\
+aatatgcttctgccgcacctatggttattaaaaaagtcatgactttgaagaaccctgaaa\n\
+agatagatgaatcaggtgtaatggcagcagccaaagagcatataattagcaacactctaa\n\
+gaacattatagatatgatgatagcgatcgtcatgatgttatccggtcacaatagtagctt\n\
+catcagctaattcgttttgccagtggtgacttgcgctggaagaatcgttatacggtccct\n\
+tccctcttgatacggtgggggcttattcaaccgcgtggattgggttgtcatacttgcatt\n\
+aaacgatgtaaaccatctagtagtcaactatactaaatcacaaaatagtgatcaatacat\n\
+acccgcttcatggttttaaccatttaattgattaaagatattccgctaagaaccattatc\n\
+tacctaaactgatcgccgtatcctagtagtttgaaatttgatgtaccgtaatgatcaacg\n\
+aagtaaaacgttatattgtatgtagaataataggtcttggagctaaatgatgtgattggt\n\
+agtgaagacttacccttacaactttaccggtttctcggaagaatatactagagaatcaat\n\
+gcatgggctacataagcactttagtctaatgagataaaaaatacacgagtcttccatcat\n\
+gaattttttgtcgaaaaactcgaacctggtaatttaaaccatatatctttatgtcgtcaa\n\
+taactctcatatgttttatataacttcccaatcacgacttgtaactgcttgttcgactga\n\
+gctgtttgagctatgaggccgggatccggttgagctacatctatttgctacaagaaaaat\n\
+gaaagcacatttgttgggagttctggctacactcatagagaaataagtggcccgagtggg\n\
+tgcggcctgcctccatattcaagtgtatcttaaaccaagtggttccaacgctcgcgctaa\n\
+agaattaaagcctttatttcctccacggagtagcccgtaatccggttcgaaagagaccat\n\
+tgaagttaattttcatatccagtgaagtttaggcacaagcatgtgttctgccacatgcct\n\
+caaagcgctcttcaaccaagatatgattcatcctaacttcgatgaatgcgtctgtaacat\n\
+aaatatagaaggaatgattcggcgagttaattttcgccttctccaacatggcatccctac\n\
+gttcgttataaggaccatacatgtaggttttaaaggtttgcggttaatcgatatttacat\n\
+catagaaattctatagtcaaatttacaagactctagatactcactcgttgcagccggcta\n\
+ggaagcgctttgtaccttacttcccttttcgttgcgtaatatgaatttcatatagtaagt\n\
+tcaaggcactcatacctccgtgaagagggtagatagactattaaagttgtttaatagtac\n\
+gtattgatggaaatgacccgtaggagatttaccactcaatccacaagattcgctgctgtg\n\
+cattatcaaaacagtgcatgtcgaaacatgggttgggtccttcaaacacgaatccaggta\n\
+gagatacctttgcaattttt\n";
+
+dnaInput = dnaInput + dnaInput + dnaInput;
+
+var ilen, clen,
+ seqs = [
+ /agggtaaa|tttaccct/ig,
+ /[cgt]gggtaaa|tttaccc[acg]/ig,
+ /a[act]ggtaaa|tttacc[agt]t/ig,
+ /ag[act]gtaaa|tttac[agt]ct/ig,
+ /agg[act]taaa|ttta[agt]cct/ig,
+ /aggg[acg]aaa|ttt[cgt]ccct/ig,
+ /agggt[cgt]aa|tt[acg]accct/ig,
+ /agggta[cgt]a|t[acg]taccct/ig,
+ /agggtaa[cgt]|[acg]ttaccct/ig],
+ subs = {
+ B: '(c|g|t)', D: '(a|g|t)', H: '(a|c|t)', K: '(g|t)',
+ M: '(a|c)', N: '(a|c|g|t)', R: '(a|g)', S: '(c|t)',
+ V: '(a|c|g)', W: '(a|t)', Y: '(c|t)' }
+
+ilen = dnaInput.length;
+
+// There is no in-place substitution
+dnaInput = dnaInput.replace(/>.*\n|\n/g,"")
+clen = dnaInput.length
+
+var dnaOutputString;
+
+for(i in seqs)
+ dnaOutputString += seqs[i].source + " " + (dnaInput.match(seqs[i]) || []).length + "\n";
+ // match returns null if no matches, so replace with empty
+
+for(k in subs)
+ dnaInput = dnaInput.replace(k, subs[k], "g")
+ // search string, replacement string, flags
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla XML-RPC Client component.
+ *
+ * The Initial Developer of the Original Code is
+ * Digital Creations 2, Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2000
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Martijn Pieters <mj@digicool.com> (original author)
+ * Samuel Sieb <samuel@sieb.net>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+// From: http://lxr.mozilla.org/mozilla/source/extensions/xml-rpc/src/nsXmlRpcClient.js#956
+
+/* Convert data (an array of integers) to a Base64 string. */
+var toBase64Table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
+var base64Pad = '=';
+
+function toBase64(data) {
+ var result = '';
+ var length = data.length;
+ var i;
+ // Convert every three bytes to 4 ascii characters.
+ for (i = 0; i < (length - 2); i += 3) {
+ result += toBase64Table[data[i] >> 2];
+ result += toBase64Table[((data[i] & 0x03) << 4) + (data[i+1] >> 4)];
+ result += toBase64Table[((data[i+1] & 0x0f) << 2) + (data[i+2] >> 6)];
+ result += toBase64Table[data[i+2] & 0x3f];
+ }
+
+ // Convert the remaining 1 or 2 bytes, pad out to 4 characters.
+ if (length%3) {
+ i = length - (length%3);
+ result += toBase64Table[data[i] >> 2];
+ if ((length%3) == 2) {
+ result += toBase64Table[((data[i] & 0x03) << 4) + (data[i+1] >> 4)];
+ result += toBase64Table[(data[i+1] & 0x0f) << 2];
+ result += base64Pad;
+ } else {
+ result += toBase64Table[(data[i] & 0x03) << 4];
+ result += base64Pad + base64Pad;
+ }
+ }
+
+ return result;
+}
+
+/* Convert Base64 data to a string */
+var toBinaryTable = [
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
+ 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1,
+ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
+ 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
+ -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
+ 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
+];
+
+function base64ToString(data) {
+ var result = '';
+ var leftbits = 0; // number of bits decoded, but yet to be appended
+ var leftdata = 0; // bits decoded, but yet to be appended
+
+ // Convert one by one.
+ for (var i = 0; i < data.length; i++) {
+ var c = toBinaryTable[data.charCodeAt(i) & 0x7f];
+ var padding = (data[i] == base64Pad);
+ // Skip illegal characters and whitespace
+ if (c == -1) continue;
+
+ // Collect data into leftdata, update bitcount
+ leftdata = (leftdata << 6) | c;
+ leftbits += 6;
+
+ // If we have 8 or more bits, append 8 bits to the result
+ if (leftbits >= 8) {
+ leftbits -= 8;
+ // Append if not padding.
+ if (!padding)
+ result += String.fromCharCode((leftdata >> leftbits) & 0xff);
+ leftdata &= (1 << leftbits) - 1;
+ }
+ }
+
+ // If there are any bits left, the base64 string was corrupted
+ if (leftbits)
+ throw Components.Exception('Corrupted base64 string');
+
+ return result;
+}
+
+var str = "";
+
+for ( var i = 0; i < 8192; i++ )
+ str += String.fromCharCode( (25 * Math.random()) + 97 );
+
+for ( var i = 8192; i <= 16384; i *= 2 ) {
+
+ var base64;
+
+ base64 = toBase64(str);
+ base64ToString(base64);
+
+ // Double the string
+ str += str;
+}
+
+toBinaryTable = null;
+// The Great Computer Language Shootout
+// http://shootout.alioth.debian.org
+//
+// Contributed by Ian Osgood
+
+var last = 42, A = 3877, C = 29573, M = 139968;
+
+function rand(max) {
+ last = (last * A + C) % M;
+ return max * last / M;
+}
+
+var ALU =
+ "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG" +
+ "GAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGA" +
+ "CCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAAT" +
+ "ACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCA" +
+ "GCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGG" +
+ "AGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCC" +
+ "AGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA";
+
+var IUB = {
+ a:0.27, c:0.12, g:0.12, t:0.27,
+ B:0.02, D:0.02, H:0.02, K:0.02,
+ M:0.02, N:0.02, R:0.02, S:0.02,
+ V:0.02, W:0.02, Y:0.02
+}
+
+var HomoSap = {
+ a: 0.3029549426680,
+ c: 0.1979883004921,
+ g: 0.1975473066391,
+ t: 0.3015094502008
+}
+
+function makeCumulative(table) {
+ var last = null;
+ for (var c in table) {
+ if (last) table[c] += table[last];
+ last = c;
+ }
+}
+
+function fastaRepeat(n, seq) {
+ var seqi = 0, lenOut = 60;
+ while (n>0) {
+ if (n<lenOut) lenOut = n;
+ if (seqi + lenOut < seq.length) {
+ ret = seq.substring(seqi, seqi+lenOut);
+ seqi += lenOut;
+ } else {
+ var s = seq.substring(seqi);
+ seqi = lenOut - s.length;
+ ret = s + seq.substring(0, seqi);
+ }
+ n -= lenOut;
+ }
+}
+
+function fastaRandom(n, table) {
+ var line = new Array(60);
+ makeCumulative(table);
+ while (n>0) {
+ if (n<line.length) line = new Array(n);
+ for (var i=0; i<line.length; i++) {
+ var r = rand(1);
+ for (var c in table) {
+ if (r < table[c]) {
+ line[i] = c;
+ break;
+ }
+ }
+ }
+ ret = line.join('');
+ n -= line.length;
+ }
+}
+
+var ret;
+
+var count = 7;
+ret = fastaRepeat(2*count*100000, ALU);
+ret = fastaRandom(3*count*1000, IUB);
+ret = fastaRandom(5*count*1000, HomoSap);
+
+
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ Portions from:
+ json.js
+ 2007-10-10
+
+ Public Domain
+*/
+
+// This test parses a JSON string giving tag names and popularity, and
+// generates html markup for a "tagcloud" view.
+
+if (!Object.prototype.toJSONString) {
+
+ Array.prototype.toJSONString = function (w) {
+ var a = [], // The array holding the partial texts.
+ i, // Loop counter.
+ l = this.length,
+ v; // The value to be stringified.
+
+ for (i = 0; i < l; i += 1) {
+ v = this[i];
+ switch (typeof v) {
+ case 'object':
+
+ if (v && typeof v.toJSONString === 'function') {
+ a.push(v.toJSONString(w));
+ } else {
+ a.push('null');
+ }
+ break;
+
+ case 'string':
+ case 'number':
+ case 'boolean':
+ a.push(v.toJSONString());
+ break;
+ default:
+ a.push('null');
+ }
+ }
+
+ return '[' + a.join(',') + ']';
+ };
+
+
+ Boolean.prototype.toJSONString = function () {
+ return String(this);
+ };
+
+
+ Date.prototype.toJSONString = function () {
+
+ function f(n) {
+
+ return n < 10 ? '0' + n : n;
+ }
+
+ return '"' + this.getUTCFullYear() + '-' +
+ f(this.getUTCMonth() + 1) + '-' +
+ f(this.getUTCDate()) + 'T' +
+ f(this.getUTCHours()) + ':' +
+ f(this.getUTCMinutes()) + ':' +
+ f(this.getUTCSeconds()) + 'Z"';
+ };
+
+
+ Number.prototype.toJSONString = function () {
+
+ return isFinite(this) ? String(this) : 'null';
+ };
+
+
+ Object.prototype.toJSONString = function (w) {
+ var a = [], // The array holding the partial texts.
+ k, // The current key.
+ i, // The loop counter.
+ v; // The current value.
+
+ if (w) {
+ for (i = 0; i < w.length; i += 1) {
+ k = w[i];
+ if (typeof k === 'string') {
+ v = this[k];
+ switch (typeof v) {
+ case 'object':
+
+ if (v) {
+ if (typeof v.toJSONString === 'function') {
+ a.push(k.toJSONString() + ':' +
+ v.toJSONString(w));
+ }
+ } else {
+ a.push(k.toJSONString() + ':null');
+ }
+ break;
+
+ case 'string':
+ case 'number':
+ case 'boolean':
+ a.push(k.toJSONString() + ':' + v.toJSONString());
+
+ }
+ }
+ }
+ } else {
+
+ for (k in this) {
+ if (typeof k === 'string' &&
+ Object.prototype.hasOwnProperty.apply(this, [k])) {
+ v = this[k];
+ switch (typeof v) {
+ case 'object':
+
+ if (v) {
+ if (typeof v.toJSONString === 'function') {
+ a.push(k.toJSONString() + ':' +
+ v.toJSONString());
+ }
+ } else {
+ a.push(k.toJSONString() + ':null');
+ }
+ break;
+
+ case 'string':
+ case 'number':
+ case 'boolean':
+ a.push(k.toJSONString() + ':' + v.toJSONString());
+
+ }
+ }
+ }
+ }
+
+ return '{' + a.join(',') + '}';
+ };
+
+
+ (function (s) {
+
+ var m = {
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '"' : '\\"',
+ '\\': '\\\\'
+ };
+
+
+ s.parseJSON = function (filter) {
+ var j;
+
+ function walk(k, v) {
+ var i, n;
+ if (v && typeof v === 'object') {
+ for (i in v) {
+ if (Object.prototype.hasOwnProperty.apply(v, [i])) {
+ n = walk(i, v[i]);
+ if (n !== undefined) {
+ v[i] = n;
+ }
+ }
+ }
+ }
+ return filter(k, v);
+ }
+
+ if (/^[\],:{}\s]*$/.test(this.replace(/\\./g, '@').
+ replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g, ']').
+ replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
+
+ j = eval('(' + this + ')');
+
+ return typeof filter === 'function' ? walk('', j) : j;
+ }
+
+ throw new SyntaxError('parseJSON');
+ };
+
+
+ s.toJSONString = function () {
+
+ if (/["\\\x00-\x1f]/.test(this)) {
+ return '"' + this.replace(/[\x00-\x1f\\"]/g, function (a) {
+ var c = m[a];
+ if (c) {
+ return c;
+ }
+ c = a.charCodeAt();
+ return '\\u00' + Math.floor(c / 16).toString(16) +
+ (c % 16).toString(16);
+ }) + '"';
+ }
+ return '"' + this + '"';
+ };
+ })(String.prototype);
+}
+
+var tagInfoJSON = '[\n {\n \"tag\": "titillation",\n \"popularity\": 4294967296\n },\n {\n \"tag\": "foamless",\n \"popularity\": 1257718401\n },\n {\n \"tag\": "snarler",\n \"popularity\": 613166183\n },\n {\n \"tag\": "multangularness",\n \"popularity\": 368304452\n },\n {\n \"tag\": "Fesapo unventurous",\n \"popularity\": 248026512\n },\n {\n \"tag\": "esthesioblast",\n \"popularity\": 179556755\n },\n {\n \"tag\": "echeneidoid",\n \"popularity\": 136641578\n },\n {\n \"tag\": "embryoctony",\n \"popularity\": 107852576\n },\n {\n \"tag\": "undilatory",\n \"popularity\": 87537981\n },\n {\n \"tag\": "predisregard",\n \"popularity\": 72630939\n },\n {\n \"tag\": "allergenic",\n \"popularity\": 61345190\n },\n {\n \"tag\": "uncloudy",\n \"popularity\": 52580571\n },\n {\n \"tag\": "unforeseeably",\n \"popularity\": 45628109\n },\n {\n \"tag\": "sturniform",\n \"popularity\": 40013489\n },\n {\n \"tag\": "anesthetize",\n \"popularity\": 35409226\n },\n {\n \"tag\": "ametabolia",\n \"popularity\": 31583050\n },\n {\n \"tag\": "angiopathy",\n \"popularity\": 28366350\n },\n {\n \"tag\": "sultanaship",\n \"popularity\": 25634218\n },\n {\n \"tag\": "Frenchwise",\n \"popularity\": 23292461\n },\n {\n \"tag\": "cerviconasal",\n \"popularity\": 21268909\n },\n {\n \"tag\": "mercurialness",\n \"popularity\": 19507481\n },\n {\n \"tag\": "glutelin venditate",\n \"popularity\": 17964042\n },\n {\n \"tag\": "acred overblack",\n \"popularity\": 16603454\n },\n {\n \"tag\": "Atik",\n \"popularity\": 15397451\n },\n {\n \"tag\": "puncturer",\n \"popularity\": 14323077\n },\n {\n \"tag\": "pukatea",\n \"popularity\": 13361525\n },\n {\n \"tag\": "suberize",\n \"popularity\": 12497261\n },\n {\n \"tag\": "Godfrey",\n \"popularity\": 11717365\n },\n {\n \"tag\": "tetraptote",\n \"popularity\": 11011011\n },\n {\n \"tag\": "lucidness",\n \"popularity\": 10369074\n },\n {\n \"tag\": "tartness",\n \"popularity\": 9783815\n },\n {\n \"tag\": "axfetch",\n \"popularity\": 9248634\n },\n {\n \"tag\": "preacquittal",\n \"popularity\": 8757877\n },\n {\n \"tag\": "matris",\n \"popularity\": 8306671\n },\n {\n \"tag\": "hyphenate",\n \"popularity\": 7890801\n },\n {\n \"tag\": "semifabulous",\n \"popularity\": 7506606\n },\n {\n \"tag\": "oppressiveness",\n \"popularity\": 7150890\n },\n {\n \"tag\": "Protococcales",\n \"popularity\": 6820856\n },\n {\n \"tag\": "unpreventive",\n \"popularity\": 6514045\n },\n {\n \"tag\": "Cordia",\n \"popularity\": 6228289\n },\n {\n \"tag\": "Wakamba leaflike",\n \"popularity\": 5961668\n },\n {\n \"tag\": "dacryoma",\n \"popularity\": 5712480\n },\n {\n \"tag\": "inguinal",\n \"popularity\": 5479211\n },\n {\n \"tag\": "responseless",\n \"popularity\": 5260507\n },\n {\n \"tag\": "supplementarily",\n \"popularity\": 5055158\n },\n {\n \"tag\": "emu",\n \"popularity\": 4862079\n },\n {\n \"tag\": "countermeet",\n \"popularity\": 4680292\n },\n {\n \"tag\": "purrer",\n \"popularity\": 4508918\n },\n {\n \"tag\": "Corallinaceae",\n \"popularity\": 4347162\n },\n {\n \"tag\": "speculum",\n \"popularity\": 4194304\n },\n {\n \"tag\": "crimpness",\n \"popularity\": 4049690\n },\n {\n \"tag\": "antidetonant",\n \"popularity\": 3912727\n },\n {\n \"tag\": "topeewallah",\n \"popularity\": 3782875\n },\n {\n \"tag\": "fidalgo ballant",\n \"popularity\": 3659640\n },\n {\n \"tag\": "utriculose",\n \"popularity\": 3542572\n },\n {\n \"tag\": "testata",\n \"popularity\": 3431259\n },\n {\n \"tag\": "beltmaking",\n \"popularity\": 3325322\n },\n {\n \"tag\": "necrotype",\n \"popularity\": 3224413\n },\n {\n \"tag\": "ovistic",\n \"popularity\": 3128215\n },\n {\n \"tag\": "swindlership",\n \"popularity\": 3036431\n },\n {\n \"tag\": "augustal",\n \"popularity\": 2948792\n },\n {\n \"tag\": "Titoist",\n \"popularity\": 2865047\n },\n {\n \"tag\": "trisoctahedral",\n \"popularity\": 2784963\n },\n {\n \"tag\": "sequestrator",\n \"popularity\": 2708327\n },\n {\n \"tag\": "sideburns",\n \"popularity\": 2634939\n },\n {\n \"tag\": "paraphrasia",\n \"popularity\": 2564616\n },\n {\n \"tag\": "graminology unbay",\n \"popularity\": 2497185\n },\n {\n \"tag\": "acaridomatium emargination",\n \"popularity\": 2432487\n },\n {\n \"tag\": "roofward",\n \"popularity\": 2370373\n },\n {\n \"tag\": "lauder",\n \"popularity\": 2310705\n },\n {\n \"tag\": "subjunctive",\n \"popularity\": 2253354\n },\n {\n \"tag\": "subelongate",\n \"popularity\": 2198199\n },\n {\n \"tag\": "guacimo",\n \"popularity\": 2145128\n },\n {\n \"tag\": "cockade",\n \"popularity\": 2094033\n },\n {\n \"tag\": "misgauge",\n \"popularity\": 2044818\n },\n {\n \"tag\": "unexpensive",\n \"popularity\": 1997388\n },\n {\n \"tag\": "chebel",\n \"popularity\": 1951657\n },\n {\n \"tag\": "unpursuing",\n \"popularity\": 1907543\n },\n {\n \"tag\": "kilobar",\n \"popularity\": 1864969\n },\n {\n \"tag\": "obsecration",\n \"popularity\": 1823863\n },\n {\n \"tag\": "nacarine",\n \"popularity\": 1784157\n },\n {\n \"tag\": "spirituosity",\n \"popularity\": 1745787\n },\n {\n \"tag\": "movableness deity",\n \"popularity\": 1708692\n },\n {\n \"tag\": "exostracism",\n \"popularity\": 1672816\n },\n {\n \"tag\": "archipterygium",\n \"popularity\": 1638104\n },\n {\n \"tag\": "monostrophic",\n \"popularity\": 1604506\n },\n {\n \"tag\": "gynecide",\n \"popularity\": 1571974\n },\n {\n \"tag\": "gladden",\n \"popularity\": 1540462\n },\n {\n \"tag\": "throughbred",\n \"popularity\": 1509927\n },\n {\n \"tag\": "groper",\n \"popularity\": 1480329\n },\n {\n \"tag\": "Xenosaurus",\n \"popularity\": 1451628\n },\n {\n \"tag\": "photoetcher",\n \"popularity\": 1423788\n },\n {\n \"tag\": "glucosid",\n \"popularity\": 1396775\n },\n {\n \"tag\": "Galtonian",\n \"popularity\": 1370555\n },\n {\n \"tag\": "mesosporic",\n \"popularity\": 1345097\n },\n {\n \"tag\": "theody",\n \"popularity\": 1320370\n },\n {\n \"tag\": "zaffer",\n \"popularity\": 1296348\n },\n {\n \"tag\": "probiology",\n \"popularity\": 1273003\n },\n {\n \"tag\": "rhizomic",\n \"popularity\": 1250308\n },\n {\n \"tag\": "superphosphate",\n \"popularity\": 1228240\n },\n {\n \"tag\": "Hippolytan",\n \"popularity\": 1206776\n },\n {\n \"tag\": "garget",\n \"popularity\": 1185892\n },\n {\n \"tag\": "diploplacula",\n \"popularity\": 1165568\n },\n {\n \"tag\": "orohydrographical",\n \"popularity\": 1145785\n },\n {\n \"tag\": "enhypostatize",\n \"popularity\": 1126521\n },\n {\n \"tag\": "polisman",\n \"popularity\": 1107759\n },\n {\n \"tag\": "acetometer",\n \"popularity\": 1089482\n },\n {\n \"tag\": "unsnatched",\n \"popularity\": 1071672\n },\n {\n \"tag\": "yabber",\n \"popularity\": 1054313\n },\n {\n \"tag\": "demiwolf",\n \"popularity\": 1037390\n },\n {\n \"tag\": "chromascope",\n \"popularity\": 1020888\n },\n {\n \"tag\": "seamanship",\n \"popularity\": 1004794\n },\n {\n \"tag\": "nonfenestrated",\n \"popularity\": 989092\n },\n {\n \"tag\": "hydrophytism",\n \"popularity\": 973771\n },\n {\n \"tag\": "dotter",\n \"popularity\": 958819\n },\n {\n \"tag\": "thermoperiodism",\n \"popularity\": 944222\n },\n {\n \"tag\": "unlawyerlike",\n \"popularity\": 929970\n },\n {\n \"tag\": "enantiomeride citywards",\n \"popularity\": 916052\n },\n {\n \"tag\": "unmetallurgical",\n \"popularity\": 902456\n },\n {\n \"tag\": "prickled",\n \"popularity\": 889174\n },\n {\n \"tag\": "strangerwise manioc",\n \"popularity\": 876195\n },\n {\n \"tag\": "incisorial",\n \"popularity\": 863510\n },\n {\n \"tag\": "irrationalize",\n \"popularity\": 851110\n },\n {\n \"tag\": "nasology",\n \"popularity\": 838987\n },\n {\n \"tag\": "fatuism",\n \"popularity\": 827131\n },\n {\n \"tag\": "Huk",\n \"popularity\": 815535\n },\n {\n \"tag\": "properispomenon",\n \"popularity\": 804192\n },\n {\n \"tag\": "unpummelled",\n \"popularity\": 793094\n },\n {\n \"tag\": "technographically",\n \"popularity\": 782233\n },\n {\n \"tag\": "underfurnish",\n \"popularity\": 771603\n },\n {\n \"tag\": "sinter",\n \"popularity\": 761198\n },\n {\n \"tag\": "lateroanterior",\n \"popularity\": 751010\n },\n {\n \"tag\": "nonpersonification",\n \"popularity\": 741034\n },\n {\n \"tag\": "Sitophilus",\n \"popularity\": 731264\n },\n {\n \"tag\": "unstudded overexerted",\n \"popularity\": 721694\n },\n {\n \"tag\": "tracheation",\n \"popularity\": 712318\n },\n {\n \"tag\": "thirteenth begloze",\n \"popularity\": 703131\n },\n {\n \"tag\": "bespice",\n \"popularity\": 694129\n },\n {\n \"tag\": "doppia",\n \"popularity\": 685305\n },\n {\n \"tag\": "unadorned",\n \"popularity\": 676656\n },\n {\n \"tag\": "dovelet engraff",\n \"popularity\": 668176\n },\n {\n \"tag\": "diphyozooid",\n \"popularity\": 659862\n },\n {\n \"tag\": "mure",\n \"popularity\": 651708\n },\n {\n \"tag\": "Tripitaka",\n \"popularity\": 643710\n },\n {\n \"tag\": "Billjim",\n \"popularity\": 635865\n },\n {\n \"tag\": "pyramidical",\n \"popularity\": 628169\n },\n {\n \"tag\": "circumlocutionist",\n \"popularity\": 620617\n },\n {\n \"tag\": "slapstick",\n \"popularity\": 613207\n },\n {\n \"tag\": "preobedience",\n \"popularity\": 605934\n },\n {\n \"tag\": "unfriarlike",\n \"popularity\": 598795\n },\n {\n \"tag\": "microchromosome",\n \"popularity\": 591786\n },\n {\n \"tag\": "Orphicism",\n \"popularity\": 584905\n },\n {\n \"tag\": "peel",\n \"popularity\": 578149\n },\n {\n \"tag\": "obediential",\n \"popularity\": 571514\n },\n {\n \"tag\": "Peripatidea",\n \"popularity\": 564997\n },\n {\n \"tag\": "undoubtful",\n \"popularity\": 558596\n },\n {\n \"tag\": "lodgeable",\n \"popularity\": 552307\n },\n {\n \"tag\": "pustulated woodchat",\n \"popularity\": 546129\n },\n {\n \"tag\": "antepast",\n \"popularity\": 540057\n },\n {\n \"tag\": "sagittoid matrimoniously",\n \"popularity\": 534091\n },\n {\n \"tag\": "Albizzia",\n \"popularity\": 528228\n },\n {\n \"tag\": "Elateridae unnewness",\n \"popularity\": 522464\n },\n {\n \"tag\": "convertingness",\n \"popularity\": 516798\n },\n {\n \"tag\": "Pelew",\n \"popularity\": 511228\n },\n {\n \"tag\": "recapitulation",\n \"popularity\": 505751\n },\n {\n \"tag\": "shack",\n \"popularity\": 500365\n },\n {\n \"tag\": "unmellowed",\n \"popularity\": 495069\n },\n {\n \"tag\": "pavis capering",\n \"popularity\": 489859\n },\n {\n \"tag\": "fanfare",\n \"popularity\": 484735\n },\n {\n \"tag\": "sole",\n \"popularity\": 479695\n },\n {\n \"tag\": "subarcuate",\n \"popularity\": 474735\n },\n {\n \"tag\": "multivious",\n \"popularity\": 469856\n },\n {\n \"tag\": "squandermania",\n \"popularity\": 465054\n },\n {\n \"tag\": "scintle",\n \"popularity\": 460329\n },\n {\n \"tag\": "hash chirognomic",\n \"popularity\": 455679\n },\n {\n \"tag\": "linseed",\n \"popularity\": 451101\n },\n {\n \"tag\": "redoubtable",\n \"popularity\": 446596\n },\n {\n \"tag\": "poachy reimpact",\n \"popularity\": 442160\n },\n {\n \"tag\": "limestone",\n \"popularity\": 437792\n },\n {\n \"tag\": "serranid",\n \"popularity\": 433492\n },\n {\n \"tag\": "pohna",\n \"popularity\": 429258\n },\n {\n \"tag\": "warwolf",\n \"popularity\": 425088\n },\n {\n \"tag\": "ruthenous",\n \"popularity\": 420981\n },\n {\n \"tag\": "dover",\n \"popularity\": 416935\n },\n {\n \"tag\": "deuteroalbumose",\n \"popularity\": 412950\n },\n {\n \"tag\": "pseudoprophetic",\n \"popularity\": 409025\n },\n {\n \"tag\": "dissoluteness",\n \"popularity\": 405157\n },\n {\n \"tag\": "preinvention",\n \"popularity\": 401347\n },\n {\n \"tag\": "swagbellied",\n \"popularity\": 397592\n },\n {\n \"tag\": "Ophidia",\n \"popularity\": 393892\n },\n {\n \"tag\": "equanimity",\n \"popularity\": 390245\n },\n {\n \"tag\": "troutful",\n \"popularity\": 386651\n },\n {\n \"tag\": "uke",\n \"popularity\": 383108\n },\n {\n \"tag\": "preacquaint",\n \"popularity\": 379616\n },\n {\n \"tag\": "shoq",\n \"popularity\": 376174\n },\n {\n \"tag\": "yox",\n \"popularity\": 372780\n },\n {\n \"tag\": "unelemental",\n \"popularity\": 369434\n },\n {\n \"tag\": "Yavapai",\n \"popularity\": 366134\n },\n {\n \"tag\": "joulean",\n \"popularity\": 362880\n },\n {\n \"tag\": "dracontine",\n \"popularity\": 359672\n },\n {\n \"tag\": "hardmouth",\n \"popularity\": 356507\n },\n {\n \"tag\": "sylvanize",\n \"popularity\": 353386\n },\n {\n \"tag\": "intraparenchymatous meadowbur",\n \"popularity\": 350308\n },\n {\n \"tag\": "uncharily",\n \"popularity\": 347271\n },\n {\n \"tag\": "redtab flexibly",\n \"popularity\": 344275\n },\n {\n \"tag\": "centervelic",\n \"popularity\": 341319\n },\n {\n \"tag\": "unravellable",\n \"popularity\": 338403\n },\n {\n \"tag\": "infortunately",\n \"popularity\": 335526\n },\n {\n \"tag\": "cannel",\n \"popularity\": 332687\n },\n {\n \"tag\": "oxyblepsia",\n \"popularity\": 329885\n },\n {\n \"tag\": "Damon",\n \"popularity\": 327120\n },\n {\n \"tag\": "etherin",\n \"popularity\": 324391\n },\n {\n \"tag\": "luminal",\n \"popularity\": 321697\n },\n {\n \"tag\": "interrogatorily presbyte",\n \"popularity\": 319038\n },\n {\n \"tag\": "hemiclastic",\n \"popularity\": 316414\n },\n {\n \"tag\": "poh flush",\n \"popularity\": 313823\n },\n {\n \"tag\": "Psoroptes",\n \"popularity\": 311265\n },\n {\n \"tag\": "dispirit",\n \"popularity\": 308740\n },\n {\n \"tag\": "nashgab",\n \"popularity\": 306246\n },\n {\n \"tag\": "Aphidiinae",\n \"popularity\": 303784\n },\n {\n \"tag\": "rhapsody nonconstruction",\n \"popularity\": 301353\n },\n {\n \"tag\": "Osmond",\n \"popularity\": 298952\n },\n {\n \"tag\": "Leonis",\n \"popularity\": 296581\n },\n {\n \"tag\": "Lemnian",\n \"popularity\": 294239\n },\n {\n \"tag\": "acetonic gnathonic",\n \"popularity\": 291926\n },\n {\n \"tag\": "surculus",\n \"popularity\": 289641\n },\n {\n \"tag\": "diagonally",\n \"popularity\": 287384\n },\n {\n \"tag\": "counterpenalty",\n \"popularity\": 285154\n },\n {\n \"tag\": "Eugenie",\n \"popularity\": 282952\n },\n {\n \"tag\": "hornbook",\n \"popularity\": 280776\n },\n {\n \"tag\": "miscoin",\n \"popularity\": 278626\n },\n {\n \"tag\": "admi",\n \"popularity\": 276501\n },\n {\n \"tag\": "Tarmac",\n \"popularity\": 274402\n },\n {\n \"tag\": "inexplicable",\n \"popularity\": 272328\n },\n {\n \"tag\": "rascallion",\n \"popularity\": 270278\n },\n {\n \"tag\": "dusterman",\n \"popularity\": 268252\n },\n {\n \"tag\": "osteostomous unhoroscopic",\n \"popularity\": 266250\n },\n {\n \"tag\": "spinibulbar",\n \"popularity\": 264271\n },\n {\n \"tag\": "phototelegraphically",\n \"popularity\": 262315\n },\n {\n \"tag\": "Manihot",\n \"popularity\": 260381\n },\n {\n \"tag\": "neighborhood",\n \"popularity\": 258470\n },\n {\n \"tag\": "Vincetoxicum",\n \"popularity\": 256581\n },\n {\n \"tag\": "khirka",\n \"popularity\": 254713\n },\n {\n \"tag\": "conscriptive",\n \"popularity\": 252866\n },\n {\n \"tag\": "synechthran",\n \"popularity\": 251040\n },\n {\n \"tag\": "Guttiferales",\n \"popularity\": 249235\n },\n {\n \"tag\": "roomful",\n \"popularity\": 247450\n },\n {\n \"tag\": "germinal",\n \"popularity\": 245685\n },\n {\n \"tag\": "untraitorous",\n \"popularity\": 243939\n },\n {\n \"tag\": "nondissenting",\n \"popularity\": 242213\n },\n {\n \"tag\": "amotion",\n \"popularity\": 240506\n },\n {\n \"tag\": "badious",\n \"popularity\": 238817\n },\n {\n \"tag\": "sumpit",\n \"popularity\": 237147\n },\n {\n \"tag\": "ectozoic",\n \"popularity\": 235496\n },\n {\n \"tag\": "elvet",\n \"popularity\": 233862\n },\n {\n \"tag\": "underclerk",\n \"popularity\": 232246\n },\n {\n \"tag\": "reticency",\n \"popularity\": 230647\n },\n {\n \"tag\": "neutroclusion",\n \"popularity\": 229065\n },\n {\n \"tag\": "unbelieving",\n \"popularity\": 227500\n },\n {\n \"tag\": "histogenetic",\n \"popularity\": 225952\n },\n {\n \"tag\": "dermamyiasis",\n \"popularity\": 224421\n },\n {\n \"tag\": "telenergy",\n \"popularity\": 222905\n },\n {\n \"tag\": "axiomatic",\n \"popularity\": 221406\n },\n {\n \"tag\": "undominoed",\n \"popularity\": 219922\n },\n {\n \"tag\": "periosteoma",\n \"popularity\": 218454\n },\n {\n \"tag\": "justiciaryship",\n \"popularity\": 217001\n },\n {\n \"tag\": "autoluminescence",\n \"popularity\": 215563\n },\n {\n \"tag\": "osmous",\n \"popularity\": 214140\n },\n {\n \"tag\": "borgh",\n \"popularity\": 212731\n },\n {\n \"tag\": "bedebt",\n \"popularity\": 211337\n },\n {\n \"tag\": "considerableness adenoidism",\n \"popularity\": 209957\n },\n {\n \"tag\": "sailorizing",\n \"popularity\": 208592\n },\n {\n \"tag\": "Montauk",\n \"popularity\": 207240\n },\n {\n \"tag\": "Bridget",\n \"popularity\": 205901\n },\n {\n \"tag\": "Gekkota",\n \"popularity\": 204577\n },\n {\n \"tag\": "subcorymbose",\n \"popularity\": 203265\n },\n {\n \"tag\": "undersap",\n \"popularity\": 201967\n },\n {\n \"tag\": "poikilothermic",\n \"popularity\": 200681\n },\n {\n \"tag\": "enneatical",\n \"popularity\": 199409\n },\n {\n \"tag\": "martinetism",\n \"popularity\": 198148\n },\n {\n \"tag\": "sustanedly",\n \"popularity\": 196901\n },\n {\n \"tag\": "declaration",\n \"popularity\": 195665\n },\n {\n \"tag\": "myringoplasty",\n \"popularity\": 194442\n },\n {\n \"tag\": "Ginkgo",\n \"popularity\": 193230\n },\n {\n \"tag\": "unrecurrent",\n \"popularity\": 192031\n },\n {\n \"tag\": "proprecedent",\n \"popularity\": 190843\n },\n {\n \"tag\": "roadman",\n \"popularity\": 189666\n },\n {\n \"tag\": "elemin",\n \"popularity\": 188501\n },\n {\n \"tag\": "maggot",\n \"popularity\": 187347\n },\n {\n \"tag\": "alitrunk",\n \"popularity\": 186204\n },\n {\n \"tag\": "introspection",\n \"popularity\": 185071\n },\n {\n \"tag\": "batiker",\n \"popularity\": 183950\n },\n {\n \"tag\": "backhatch oversettle",\n \"popularity\": 182839\n },\n {\n \"tag\": "thresherman",\n \"popularity\": 181738\n },\n {\n \"tag\": "protemperance",\n \"popularity\": 180648\n },\n {\n \"tag\": "undern",\n \"popularity\": 179568\n },\n {\n \"tag\": "tweeg",\n \"popularity\": 178498\n },\n {\n \"tag\": "crosspath",\n \"popularity\": 177438\n },\n {\n \"tag\": "Tangaridae",\n \"popularity\": 176388\n },\n {\n \"tag\": "scrutation",\n \"popularity\": 175348\n },\n {\n \"tag\": "piecemaker",\n \"popularity\": 174317\n },\n {\n \"tag\": "paster",\n \"popularity\": 173296\n },\n {\n \"tag\": "unpretendingness",\n \"popularity\": 172284\n },\n {\n \"tag\": "inframundane",\n \"popularity\": 171281\n },\n {\n \"tag\": "kiblah",\n \"popularity\": 170287\n },\n {\n \"tag\": "playwrighting",\n \"popularity\": 169302\n },\n {\n \"tag\": "gonepoiesis snowslip",\n \"popularity\": 168326\n },\n {\n \"tag\": "hoodwise",\n \"popularity\": 167359\n },\n {\n \"tag\": "postseason",\n \"popularity\": 166401\n },\n {\n \"tag\": "equivocality",\n \"popularity\": 165451\n },\n {\n \"tag\": "Opiliaceae nuclease",\n \"popularity\": 164509\n },\n {\n \"tag\": "sextipara",\n \"popularity\": 163576\n },\n {\n \"tag\": "weeper",\n \"popularity\": 162651\n },\n {\n \"tag\": "frambesia",\n \"popularity\": 161735\n },\n {\n \"tag\": "answerable",\n \"popularity\": 160826\n },\n {\n \"tag\": "Trichosporum",\n \"popularity\": 159925\n },\n {\n \"tag\": "cajuputol",\n \"popularity\": 159033\n },\n {\n \"tag\": "pleomorphous",\n \"popularity\": 158148\n },\n {\n \"tag\": "aculeolate",\n \"popularity\": 157270\n },\n {\n \"tag\": "wherever",\n \"popularity\": 156400\n },\n {\n \"tag\": "collapse",\n \"popularity\": 155538\n },\n {\n \"tag\": "porky",\n \"popularity\": 154683\n },\n {\n \"tag\": "perule",\n \"popularity\": 153836\n },\n {\n \"tag\": "Nevada",\n \"popularity\": 152996\n },\n {\n \"tag\": "conalbumin",\n \"popularity\": 152162\n },\n {\n \"tag\": "tsunami",\n \"popularity\": 151336\n },\n {\n \"tag\": "Gulf",\n \"popularity\": 150517\n },\n {\n \"tag\": "hertz",\n \"popularity\": 149705\n },\n {\n \"tag\": "limmock",\n \"popularity\": 148900\n },\n {\n \"tag\": "Tartarize",\n \"popularity\": 148101\n },\n {\n \"tag\": "entosphenoid",\n \"popularity\": 147310\n },\n {\n \"tag\": "ibis",\n \"popularity\": 146524\n },\n {\n \"tag\": "unyeaned",\n \"popularity\": 145746\n },\n {\n \"tag\": "tritural",\n \"popularity\": 144973\n },\n {\n \"tag\": "hundredary",\n \"popularity\": 144207\n },\n {\n \"tag\": "stolonlike",\n \"popularity\": 143448\n },\n {\n \"tag\": "chorister",\n \"popularity\": 142694\n },\n {\n \"tag\": "mismove",\n \"popularity\": 141947\n },\n {\n \"tag\": "Andine",\n \"popularity\": 141206\n },\n {\n \"tag\": "Annette proneur escribe",\n \"popularity\": 140471\n },\n {\n \"tag\": "exoperidium",\n \"popularity\": 139742\n },\n {\n \"tag\": "disedge",\n \"popularity\": 139019\n },\n {\n \"tag\": "hypochloruria",\n \"popularity\": 138302\n },\n {\n \"tag\": "prepupa",\n \"popularity\": 137590\n },\n {\n \"tag\": "assent",\n \"popularity\": 136884\n },\n {\n \"tag\": "hydrazobenzene",\n \"popularity\": 136184\n },\n {\n \"tag\": "emballonurid",\n \"popularity\": 135489\n },\n {\n \"tag\": "roselle",\n \"popularity\": 134800\n },\n {\n \"tag\": "unifiedly",\n \"popularity\": 134117\n },\n {\n \"tag\": "clang",\n \"popularity\": 133439\n },\n {\n \"tag\": "acetolytic",\n \"popularity\": 132766\n },\n {\n \"tag\": "cladodont",\n \"popularity\": 132098\n },\n {\n \"tag\": "recoast",\n \"popularity\": 131436\n },\n {\n \"tag\": "celebrated tydie Eocarboniferous",\n \"popularity\": 130779\n },\n {\n \"tag\": "superconsciousness",\n \"popularity\": 130127\n },\n {\n \"tag\": "soberness",\n \"popularity\": 129480\n },\n {\n \"tag\": "panoramist",\n \"popularity\": 128838\n },\n {\n \"tag\": "Orbitolina",\n \"popularity\": 128201\n },\n {\n \"tag\": "overlewd",\n \"popularity\": 127569\n },\n {\n \"tag\": "demiquaver",\n \"popularity\": 126942\n },\n {\n \"tag\": "kamelaukion",\n \"popularity\": 126319\n },\n {\n \"tag\": "flancard",\n \"popularity\": 125702\n },\n {\n \"tag\": "tricuspid",\n \"popularity\": 125089\n },\n {\n \"tag\": "bepelt",\n \"popularity\": 124480\n },\n {\n \"tag\": "decuplet",\n \"popularity\": 123877\n },\n {\n \"tag\": "Rockies",\n \"popularity\": 123278\n },\n {\n \"tag\": "unforgeability",\n \"popularity\": 122683\n },\n {\n \"tag\": "mocha",\n \"popularity\": 122093\n },\n {\n \"tag\": "scrunge",\n \"popularity\": 121507\n },\n {\n \"tag\": "delighter",\n \"popularity\": 120926\n },\n {\n \"tag\": "willey Microtinae",\n \"popularity\": 120349\n },\n {\n \"tag\": "unhuntable",\n \"popularity\": 119777\n },\n {\n \"tag\": "historically",\n \"popularity\": 119208\n },\n {\n \"tag\": "vicegerentship",\n \"popularity\": 118644\n },\n {\n \"tag\": "hemangiosarcoma",\n \"popularity\": 118084\n },\n {\n \"tag\": "harpago",\n \"popularity\": 117528\n },\n {\n \"tag\": "unionoid",\n \"popularity\": 116976\n },\n {\n \"tag\": "wiseman",\n \"popularity\": 116429\n },\n {\n \"tag\": "diclinism",\n \"popularity\": 115885\n },\n {\n \"tag\": "Maud",\n \"popularity\": 115345\n },\n {\n \"tag\": "scaphocephalism",\n \"popularity\": 114809\n },\n {\n \"tag\": "obtenebration",\n \"popularity\": 114277\n },\n {\n \"tag\": "cymar predreadnought",\n \"popularity\": 113749\n },\n {\n \"tag\": "discommend",\n \"popularity\": 113225\n },\n {\n \"tag\": "crude",\n \"popularity\": 112704\n },\n {\n \"tag\": "upflash",\n \"popularity\": 112187\n },\n {\n \"tag\": "saltimbank",\n \"popularity\": 111674\n },\n {\n \"tag\": "posthysterical",\n \"popularity\": 111165\n },\n {\n \"tag\": "trample",\n \"popularity\": 110659\n },\n {\n \"tag\": "ungirthed",\n \"popularity\": 110157\n },\n {\n \"tag\": "unshakable",\n \"popularity\": 109658\n },\n {\n \"tag\": "hepatocystic",\n \"popularity\": 109163\n },\n {\n \"tag\": "psammophyte",\n \"popularity\": 108671\n },\n {\n \"tag\": "millionfold",\n \"popularity\": 108183\n },\n {\n \"tag\": "outtaste",\n \"popularity\": 107698\n },\n {\n \"tag\": "poppycockish",\n \"popularity\": 107217\n },\n {\n \"tag\": "viduine",\n \"popularity\": 106739\n },\n {\n \"tag\": "pleasureman",\n \"popularity\": 106264\n },\n {\n \"tag\": "cholesterolemia",\n \"popularity\": 105792\n },\n {\n \"tag\": "hostlerwife",\n \"popularity\": 105324\n },\n {\n \"tag\": "figure undergrass",\n \"popularity\": 104859\n },\n {\n \"tag\": "bedrape",\n \"popularity\": 104398\n },\n {\n \"tag\": "nuttishness",\n \"popularity\": 103939\n },\n {\n \"tag\": "fow",\n \"popularity\": 103484\n },\n {\n \"tag\": "rachianesthesia",\n \"popularity\": 103031\n },\n {\n \"tag\": "recruitable",\n \"popularity\": 102582\n },\n {\n \"tag\": "semianatomical Oenotheraceae",\n \"popularity\": 102136\n },\n {\n \"tag\": "extracapsular",\n \"popularity\": 101693\n },\n {\n \"tag\": "unsigneted",\n \"popularity\": 101253\n },\n {\n \"tag\": "fissural",\n \"popularity\": 100816\n },\n {\n \"tag\": "ayous",\n \"popularity\": 100381\n },\n {\n \"tag\": "crestfallenness odontograph",\n \"popularity\": 99950\n },\n {\n \"tag\": "monopodium",\n \"popularity\": 99522\n },\n {\n \"tag\": "germfree",\n \"popularity\": 99096\n },\n {\n \"tag\": "dauphin",\n \"popularity\": 98673\n },\n {\n \"tag\": "nonagesimal",\n \"popularity\": 98254\n },\n {\n \"tag\": "waterchat",\n \"popularity\": 97836\n },\n {\n \"tag\": "Entelodon",\n \"popularity\": 97422\n },\n {\n \"tag\": "semischolastic",\n \"popularity\": 97010\n },\n {\n \"tag\": "somata",\n \"popularity\": 96602\n },\n {\n \"tag\": "expositorily",\n \"popularity\": 96195\n },\n {\n \"tag\": "bass",\n \"popularity\": 95792\n },\n {\n \"tag\": "calorimetry",\n \"popularity\": 95391\n },\n {\n \"tag\": "entireness",\n \"popularity\": 94993\n },\n {\n \"tag\": "ratline soppiness",\n \"popularity\": 94597\n },\n {\n \"tag\": "shor",\n \"popularity\": 94204\n },\n {\n \"tag\": "coprecipitation",\n \"popularity\": 93813\n },\n {\n \"tag\": "unblushingly",\n \"popularity\": 93425\n },\n {\n \"tag\": "macarize",\n \"popularity\": 93040\n },\n {\n \"tag\": "scruplesomeness",\n \"popularity\": 92657\n },\n {\n \"tag\": "offsaddle",\n \"popularity\": 92276\n },\n {\n \"tag\": "hypertragical",\n \"popularity\": 91898\n },\n {\n \"tag\": "uncassock loined",\n \"popularity\": 91522\n },\n {\n \"tag\": "interlobate",\n \"popularity\": 91149\n },\n {\n \"tag\": "releasor orrisroot stoloniferously",\n \"popularity\": 90778\n },\n {\n \"tag\": "elementoid",\n \"popularity\": 90410\n },\n {\n \"tag\": "Lentilla",\n \"popularity\": 90043\n },\n {\n \"tag\": "distressing",\n \"popularity\": 89679\n },\n {\n \"tag\": "hydrodrome",\n \"popularity\": 89318\n },\n {\n \"tag\": "Jeannette",\n \"popularity\": 88958\n },\n {\n \"tag\": "Kuli",\n \"popularity\": 88601\n },\n {\n \"tag\": "taxinomist",\n \"popularity\": 88246\n },\n {\n \"tag\": "southwestwardly",\n \"popularity\": 87894\n },\n {\n \"tag\": "polyparia",\n \"popularity\": 87543\n },\n {\n \"tag\": "exmeridian",\n \"popularity\": 87195\n },\n {\n \"tag\": "splenius regimentaled",\n \"popularity\": 86849\n },\n {\n \"tag\": "Sphaeropsidaceae",\n \"popularity\": 86505\n },\n {\n \"tag\": "unbegun",\n \"popularity\": 86163\n },\n {\n \"tag\": "something",\n \"popularity\": 85823\n },\n {\n \"tag\": "contaminable nonexpulsion",\n \"popularity\": 85486\n },\n {\n \"tag\": "douser",\n \"popularity\": 85150\n },\n {\n \"tag\": "prostrike",\n \"popularity\": 84817\n },\n {\n \"tag\": "worky",\n \"popularity\": 84485\n },\n {\n \"tag\": "folliful",\n \"popularity\": 84156\n },\n {\n \"tag\": "prioracy",\n \"popularity\": 83828\n },\n {\n \"tag\": "undermentioned",\n \"popularity\": 83503\n },\n {\n \"tag\": "Judaica",\n \"popularity\": 83179\n },\n {\n \"tag\": "multifarious",\n \"popularity\": 82858\n },\n {\n \"tag\": "poogye",\n \"popularity\": 82538\n },\n {\n \"tag\": "Sparganium",\n \"popularity\": 82221\n },\n {\n \"tag\": "thurrock",\n \"popularity\": 81905\n },\n {\n \"tag\": "outblush",\n \"popularity\": 81591\n },\n {\n \"tag\": "Strophanthus supraordination",\n \"popularity\": 81279\n },\n {\n \"tag\": "gingerroot",\n \"popularity\": 80969\n },\n {\n \"tag\": "unconscient",\n \"popularity\": 80661\n },\n {\n \"tag\": "unconstitutionally",\n \"popularity\": 80354\n },\n {\n \"tag\": "plaguily",\n \"popularity\": 80050\n },\n {\n \"tag\": "waterily equatorwards",\n \"popularity\": 79747\n },\n {\n \"tag\": "nondeposition",\n \"popularity\": 79446\n },\n {\n \"tag\": "dronishly",\n \"popularity\": 79147\n },\n {\n \"tag\": "gateado",\n \"popularity\": 78849\n },\n {\n \"tag\": "dislink",\n \"popularity\": 78553\n },\n {\n \"tag\": "Joceline",\n \"popularity\": 78259\n },\n {\n \"tag\": "amphiboliferous",\n \"popularity\": 77967\n },\n {\n \"tag\": "bushrope",\n \"popularity\": 77676\n },\n {\n \"tag\": "plumicorn sulphosalicylic",\n \"popularity\": 77387\n },\n {\n \"tag\": "nonefficiency",\n \"popularity\": 77100\n },\n {\n \"tag\": "hieroscopy",\n \"popularity\": 76815\n },\n {\n \"tag\": "causativeness",\n \"popularity\": 76531\n },\n {\n \"tag\": "swird paleoeremology",\n \"popularity\": 76249\n },\n {\n \"tag\": "camphoric",\n \"popularity\": 75968\n },\n {\n \"tag\": "retaining",\n \"popularity\": 75689\n },\n {\n \"tag\": "thyreoprotein",\n \"popularity\": 75411\n },\n {\n \"tag\": "carbona",\n \"popularity\": 75136\n },\n {\n \"tag\": "protectively",\n \"popularity\": 74861\n },\n {\n \"tag\": "mosasaur",\n \"popularity\": 74589\n },\n {\n \"tag\": "reciprocator",\n \"popularity\": 74317\n },\n {\n \"tag\": "detentive",\n \"popularity\": 74048\n },\n {\n \"tag\": "supravital",\n \"popularity\": 73780\n },\n {\n \"tag\": "Vespertilionidae",\n \"popularity\": 73513\n },\n {\n \"tag\": "parka",\n \"popularity\": 73248\n },\n {\n \"tag\": "pickaway",\n \"popularity\": 72984\n },\n {\n \"tag\": "oleaceous",\n \"popularity\": 72722\n },\n {\n \"tag\": "anticogitative",\n \"popularity\": 72462\n },\n {\n \"tag\": "woe",\n \"popularity\": 72203\n },\n {\n \"tag\": "skeuomorph",\n \"popularity\": 71945\n },\n {\n \"tag\": "helpmeet",\n \"popularity\": 71689\n },\n {\n \"tag\": "Hexactinellida brickmaking",\n \"popularity\": 71434\n },\n {\n \"tag\": "resink",\n \"popularity\": 71180\n },\n {\n \"tag\": "diluter",\n \"popularity\": 70928\n },\n {\n \"tag\": "micromicron",\n \"popularity\": 70677\n },\n {\n \"tag\": "parentage",\n \"popularity\": 70428\n },\n {\n \"tag\": "galactorrhoea",\n \"popularity\": 70180\n },\n {\n \"tag\": "gey",\n \"popularity\": 69934\n },\n {\n \"tag\": "gesticulatory",\n \"popularity\": 69689\n },\n {\n \"tag\": "wergil",\n \"popularity\": 69445\n },\n {\n \"tag\": "Lecanora",\n \"popularity\": 69202\n },\n {\n \"tag\": "malanders karst",\n \"popularity\": 68961\n },\n {\n \"tag\": "vibetoite",\n \"popularity\": 68721\n },\n {\n \"tag\": "unrequitedness",\n \"popularity\": 68483\n },\n {\n \"tag\": "outwash",\n \"popularity\": 68245\n },\n {\n \"tag\": "unsacred",\n \"popularity\": 68009\n },\n {\n \"tag\": "unabetted dividend",\n \"popularity\": 67775\n },\n {\n \"tag\": "untraveling",\n \"popularity\": 67541\n },\n {\n \"tag\": "thermobattery",\n \"popularity\": 67309\n },\n {\n \"tag\": "polypragmist",\n \"popularity\": 67078\n },\n {\n \"tag\": "irrefutableness",\n \"popularity\": 66848\n },\n {\n \"tag\": "remiges",\n \"popularity\": 66620\n },\n {\n \"tag\": "implode",\n \"popularity\": 66393\n },\n {\n \"tag\": "superfluousness",\n \"popularity\": 66166\n },\n {\n \"tag\": "croakily unalleviated",\n \"popularity\": 65942\n },\n {\n \"tag\": "edicule",\n \"popularity\": 65718\n },\n {\n \"tag\": "entophytous",\n \"popularity\": 65495\n },\n {\n \"tag\": "benefactorship Toryish",\n \"popularity\": 65274\n },\n {\n \"tag\": "pseudoamateurish",\n \"popularity\": 65054\n },\n {\n \"tag\": "flueless Iguanodontoidea snipnose",\n \"popularity\": 64835\n },\n {\n \"tag\": "zealotical Zamicrus interpole",\n \"popularity\": 64617\n },\n {\n \"tag\": "whereabout",\n \"popularity\": 64401\n },\n {\n \"tag\": "benzazide",\n \"popularity\": 64185\n },\n {\n \"tag\": "pokeweed",\n \"popularity\": 63971\n },\n {\n \"tag\": "calamitoid",\n \"popularity\": 63757\n },\n {\n \"tag\": "sporozoal",\n \"popularity\": 63545\n },\n {\n \"tag\": "physcioid Welshwoman",\n \"popularity\": 63334\n },\n {\n \"tag\": "wanting",\n \"popularity\": 63124\n },\n {\n \"tag\": "unencumbering",\n \"popularity\": 62915\n },\n {\n \"tag\": "Tupi",\n \"popularity\": 62707\n },\n {\n \"tag\": "potbank",\n \"popularity\": 62501\n },\n {\n \"tag\": "bulked",\n \"popularity\": 62295\n },\n {\n \"tag\": "uparise",\n \"popularity\": 62090\n },\n {\n \"tag\": "Sudra",\n \"popularity\": 61887\n },\n {\n \"tag\": "hyperscrupulosity",\n \"popularity\": 61684\n },\n {\n \"tag\": "subterraneously unmaid",\n \"popularity\": 61483\n },\n {\n \"tag\": "poisonousness",\n \"popularity\": 61282\n },\n {\n \"tag\": "phare",\n \"popularity\": 61083\n },\n {\n \"tag\": "dicynodont",\n \"popularity\": 60884\n },\n {\n \"tag\": "chewer",\n \"popularity\": 60687\n },\n {\n \"tag\": "uliginous",\n \"popularity\": 60490\n },\n {\n \"tag\": "tinman",\n \"popularity\": 60295\n },\n {\n \"tag\": "coconut",\n \"popularity\": 60100\n },\n {\n \"tag\": "phryganeoid",\n \"popularity\": 59907\n },\n {\n \"tag\": "bismillah",\n \"popularity\": 59714\n },\n {\n \"tag\": "tautomeric",\n \"popularity\": 59523\n },\n {\n \"tag\": "jerquer",\n \"popularity\": 59332\n },\n {\n \"tag\": "Dryopithecinae",\n \"popularity\": 59143\n },\n {\n \"tag\": "ghizite",\n \"popularity\": 58954\n },\n {\n \"tag\": "unliveable",\n \"popularity\": 58766\n },\n {\n \"tag\": "craftsmaster",\n \"popularity\": 58579\n },\n {\n \"tag\": "semiscenic",\n \"popularity\": 58394\n },\n {\n \"tag\": "danaid",\n \"popularity\": 58209\n },\n {\n \"tag\": "flawful",\n \"popularity\": 58025\n },\n {\n \"tag\": "risibleness",\n \"popularity\": 57841\n },\n {\n \"tag\": "Muscovite",\n \"popularity\": 57659\n },\n {\n \"tag\": "snaringly",\n \"popularity\": 57478\n },\n {\n \"tag\": "brilliantwise",\n \"popularity\": 57297\n },\n {\n \"tag\": "plebeity",\n \"popularity\": 57118\n },\n {\n \"tag\": "historicalness",\n \"popularity\": 56939\n },\n {\n \"tag\": "piecemeal",\n \"popularity\": 56761\n },\n {\n \"tag\": "maxillipedary",\n \"popularity\": 56584\n },\n {\n \"tag\": "Hypenantron",\n \"popularity\": 56408\n },\n {\n \"tag\": "quaintness avigate",\n \"popularity\": 56233\n },\n {\n \"tag\": "ave",\n \"popularity\": 56059\n },\n {\n \"tag\": "mediaevally",\n \"popularity\": 55885\n },\n {\n \"tag\": "brucite",\n \"popularity\": 55712\n },\n {\n \"tag\": "Schwendenerian",\n \"popularity\": 55541\n },\n {\n \"tag\": "julole",\n \"popularity\": 55370\n },\n {\n \"tag\": "palaeolith",\n \"popularity\": 55199\n },\n {\n \"tag\": "cotyledonary",\n \"popularity\": 55030\n },\n {\n \"tag\": "rond",\n \"popularity\": 54861\n },\n {\n \"tag\": "boomster tassoo",\n \"popularity\": 54694\n },\n {\n \"tag\": "cattishly",\n \"popularity\": 54527\n },\n {\n \"tag\": "tonguefence",\n \"popularity\": 54360\n },\n {\n \"tag\": "hexastylar triskele",\n \"popularity\": 54195\n },\n {\n \"tag\": "ariot",\n \"popularity\": 54030\n },\n {\n \"tag\": "intarsist",\n \"popularity\": 53867\n },\n {\n \"tag\": "Oscines",\n \"popularity\": 53704\n },\n {\n \"tag\": "Spaniolize",\n \"popularity\": 53541\n },\n {\n \"tag\": "smellfungus",\n \"popularity\": 53380\n },\n {\n \"tag\": "redisplay",\n \"popularity\": 53219\n },\n {\n \"tag\": "phosphene",\n \"popularity\": 53059\n },\n {\n \"tag\": "phycomycete",\n \"popularity\": 52900\n },\n {\n \"tag\": "prophetic",\n \"popularity\": 52741\n },\n {\n \"tag\": "overtrustful",\n \"popularity\": 52584\n },\n {\n \"tag\": "pinitol",\n \"popularity\": 52427\n },\n {\n \"tag\": "asthmatic",\n \"popularity\": 52270\n },\n {\n \"tag\": "convulsive",\n \"popularity\": 52115\n },\n {\n \"tag\": "draughtswoman",\n \"popularity\": 51960\n },\n {\n \"tag\": "unetymologizable",\n \"popularity\": 51806\n },\n {\n \"tag\": "centrarchoid",\n \"popularity\": 51652\n },\n {\n \"tag\": "mesioincisal",\n \"popularity\": 51500\n },\n {\n \"tag\": "transbaikal",\n \"popularity\": 51348\n },\n {\n \"tag\": "silveriness",\n \"popularity\": 51196\n },\n {\n \"tag\": "costotomy",\n \"popularity\": 51046\n },\n {\n \"tag\": "caracore",\n \"popularity\": 50896\n },\n {\n \"tag\": "depotentiation",\n \"popularity\": 50747\n },\n {\n \"tag\": "glossoepiglottidean",\n \"popularity\": 50598\n },\n {\n \"tag\": "upswell",\n \"popularity\": 50450\n },\n {\n \"tag\": "flecnodal",\n \"popularity\": 50303\n },\n {\n \"tag\": "coventrate",\n \"popularity\": 50157\n },\n {\n \"tag\": "duchesse",\n \"popularity\": 50011\n },\n {\n \"tag\": "excisemanship trophied",\n \"popularity\": 49866\n },\n {\n \"tag\": "cytinaceous",\n \"popularity\": 49721\n },\n {\n \"tag\": "assuringly",\n \"popularity\": 49577\n },\n {\n \"tag\": "unconducted upliftitis",\n \"popularity\": 49434\n },\n {\n \"tag\": "rachicentesis",\n \"popularity\": 49292\n },\n {\n \"tag\": "antiangular",\n \"popularity\": 49150\n },\n {\n \"tag\": "advisal",\n \"popularity\": 49008\n },\n {\n \"tag\": "birdcatcher",\n \"popularity\": 48868\n },\n {\n \"tag\": "secularistic",\n \"popularity\": 48728\n },\n {\n \"tag\": "grandeeism superinformal",\n \"popularity\": 48588\n },\n {\n \"tag\": "unapprehension",\n \"popularity\": 48449\n },\n {\n \"tag\": "excipulum",\n \"popularity\": 48311\n },\n {\n \"tag\": "decimole",\n \"popularity\": 48174\n },\n {\n \"tag\": "semidrachm",\n \"popularity\": 48037\n },\n {\n \"tag\": "uvulotome",\n \"popularity\": 47901\n },\n {\n \"tag\": "Lemaneaceae",\n \"popularity\": 47765\n },\n {\n \"tag\": "corrade",\n \"popularity\": 47630\n },\n {\n \"tag\": "Kuroshio",\n \"popularity\": 47495\n },\n {\n \"tag\": "Araliophyllum",\n \"popularity\": 47361\n },\n {\n \"tag\": "victoriousness cardiosphygmograph",\n \"popularity\": 47228\n },\n {\n \"tag\": "reinvent",\n \"popularity\": 47095\n },\n {\n \"tag\": "Macrotolagus",\n \"popularity\": 46963\n },\n {\n \"tag\": "strenuousness",\n \"popularity\": 46831\n },\n {\n \"tag\": "deviability",\n \"popularity\": 46700\n },\n {\n \"tag\": "phyllospondylous",\n \"popularity\": 46570\n },\n {\n \"tag\": "bisect rudderhole",\n \"popularity\": 46440\n },\n {\n \"tag\": "crownwork",\n \"popularity\": 46311\n },\n {\n \"tag\": "Ascalabota",\n \"popularity\": 46182\n },\n {\n \"tag\": "prostatomyomectomy",\n \"popularity\": 46054\n },\n {\n \"tag\": "neurosyphilis",\n \"popularity\": 45926\n },\n {\n \"tag\": "tabloid scraplet",\n \"popularity\": 45799\n },\n {\n \"tag\": "nonmedullated servility",\n \"popularity\": 45673\n },\n {\n \"tag\": "melopoeic practicalization",\n \"popularity\": 45547\n },\n {\n \"tag\": "nonrhythmic",\n \"popularity\": 45421\n },\n {\n \"tag\": "deplorer",\n \"popularity\": 45296\n },\n {\n \"tag\": "Ophion",\n \"popularity\": 45172\n },\n {\n \"tag\": "subprioress",\n \"popularity\": 45048\n },\n {\n \"tag\": "semiregular",\n \"popularity\": 44925\n },\n {\n \"tag\": "praelection",\n \"popularity\": 44802\n },\n {\n \"tag\": "discinct",\n \"popularity\": 44680\n },\n {\n \"tag\": "preplace",\n \"popularity\": 44558\n },\n {\n \"tag\": "paternoster",\n \"popularity\": 44437\n },\n {\n \"tag\": "suboccipital",\n \"popularity\": 44316\n },\n {\n \"tag\": "Teutophil",\n \"popularity\": 44196\n },\n {\n \"tag\": "tracheole",\n \"popularity\": 44076\n },\n {\n \"tag\": "subsmile",\n \"popularity\": 43957\n },\n {\n \"tag\": "nonapostatizing",\n \"popularity\": 43839\n },\n {\n \"tag\": "cleidotomy",\n \"popularity\": 43720\n },\n {\n \"tag\": "hingle",\n \"popularity\": 43603\n },\n {\n \"tag\": "jocoque",\n \"popularity\": 43486\n },\n {\n \"tag\": "trundler notidanian",\n \"popularity\": 43369\n },\n {\n \"tag\": "strangling misdaub",\n \"popularity\": 43253\n },\n {\n \"tag\": "noncancellable",\n \"popularity\": 43137\n },\n {\n \"tag\": "lavabo",\n \"popularity\": 43022\n },\n {\n \"tag\": "lanterloo",\n \"popularity\": 42907\n },\n {\n \"tag\": "uncitizenly",\n \"popularity\": 42793\n },\n {\n \"tag\": "autoturning",\n \"popularity\": 42679\n },\n {\n \"tag\": "Haganah",\n \"popularity\": 42566\n },\n {\n \"tag\": "Glecoma",\n \"popularity\": 42453\n },\n {\n \"tag\": "membered",\n \"popularity\": 42341\n },\n {\n \"tag\": "consuetudinal",\n \"popularity\": 42229\n },\n {\n \"tag\": "gatehouse",\n \"popularity\": 42117\n },\n {\n \"tag\": "tetherball",\n \"popularity\": 42006\n },\n {\n \"tag\": "counterrevolutionist numismatical",\n \"popularity\": 41896\n },\n {\n \"tag\": "pagehood plateiasmus",\n \"popularity\": 41786\n },\n {\n \"tag\": "pelterer",\n \"popularity\": 41676\n },\n {\n \"tag\": "splenemphraxis",\n \"popularity\": 41567\n },\n {\n \"tag\": "Crypturidae",\n \"popularity\": 41458\n },\n {\n \"tag\": "caboodle",\n \"popularity\": 41350\n },\n {\n \"tag\": "Filaria",\n \"popularity\": 41242\n },\n {\n \"tag\": "noninvincibility",\n \"popularity\": 41135\n },\n {\n \"tag\": "preadvertisement",\n \"popularity\": 41028\n },\n {\n \"tag\": "bathrobe",\n \"popularity\": 40921\n },\n {\n \"tag\": "nitrifier",\n \"popularity\": 40815\n },\n {\n \"tag\": "furthermore",\n \"popularity\": 40709\n },\n {\n \"tag\": "recrate",\n \"popularity\": 40604\n },\n {\n \"tag\": "inexist",\n \"popularity\": 40499\n },\n {\n \"tag\": "Mocoan",\n \"popularity\": 40395\n },\n {\n \"tag\": "forint",\n \"popularity\": 40291\n },\n {\n \"tag\": "cardiomyoliposis",\n \"popularity\": 40187\n },\n {\n \"tag\": "channeling",\n \"popularity\": 40084\n },\n {\n \"tag\": "quebrachine",\n \"popularity\": 39981\n },\n {\n \"tag\": "magistery",\n \"popularity\": 39879\n },\n {\n \"tag\": "koko",\n \"popularity\": 39777\n },\n {\n \"tag\": "nobilify",\n \"popularity\": 39676\n },\n {\n \"tag\": "articulate taprooted",\n \"popularity\": 39575\n },\n {\n \"tag\": "cardiotonic Nicaragua",\n \"popularity\": 39474\n },\n {\n \"tag\": "assertiveness",\n \"popularity\": 39374\n },\n {\n \"tag\": "springtail",\n \"popularity\": 39274\n },\n {\n \"tag\": "spontoon",\n \"popularity\": 39174\n },\n {\n \"tag\": "plesiobiosis",\n \"popularity\": 39075\n },\n {\n \"tag\": "rooinek",\n \"popularity\": 38976\n },\n {\n \"tag\": "hairif falsehood",\n \"popularity\": 38878\n },\n {\n \"tag\": "synodally",\n \"popularity\": 38780\n },\n {\n \"tag\": "biodynamics",\n \"popularity\": 38683\n },\n {\n \"tag\": "trickling",\n \"popularity\": 38585\n },\n {\n \"tag\": "oxfly daystar",\n \"popularity\": 38489\n },\n {\n \"tag\": "epicycloidal",\n \"popularity\": 38392\n },\n {\n \"tag\": "shorthand",\n \"popularity\": 38296\n },\n {\n \"tag\": "herpolhode",\n \"popularity\": 38201\n },\n {\n \"tag\": "polysynthesism",\n \"popularity\": 38105\n },\n {\n \"tag\": "cany",\n \"popularity\": 38010\n },\n {\n \"tag\": "sideage",\n \"popularity\": 37916\n },\n {\n \"tag\": "strainableness",\n \"popularity\": 37822\n },\n {\n \"tag\": "superformidable",\n \"popularity\": 37728\n },\n {\n \"tag\": "slendang",\n \"popularity\": 37634\n },\n {\n \"tag\": "impropriation",\n \"popularity\": 37541\n },\n {\n \"tag\": "ficklehearted",\n \"popularity\": 37449\n },\n {\n \"tag\": "wintrify",\n \"popularity\": 37356\n },\n {\n \"tag\": "geomorphogenist",\n \"popularity\": 37264\n },\n {\n \"tag\": "smuggleable",\n \"popularity\": 37173\n },\n {\n \"tag\": "delapsion",\n \"popularity\": 37081\n },\n {\n \"tag\": "projective",\n \"popularity\": 36990\n },\n {\n \"tag\": "unglue exfoliation",\n \"popularity\": 36900\n },\n {\n \"tag\": "Acerae",\n \"popularity\": 36810\n },\n {\n \"tag\": "unstaged",\n \"popularity\": 36720\n },\n {\n \"tag\": "ranal",\n \"popularity\": 36630\n },\n {\n \"tag\": "worrier",\n \"popularity\": 36541\n },\n {\n \"tag\": "unhid",\n \"popularity\": 36452\n },\n {\n \"tag\": "adequation",\n \"popularity\": 36363\n },\n {\n \"tag\": "strongylid Sokotri",\n \"popularity\": 36275\n },\n {\n \"tag\": "fumingly",\n \"popularity\": 36187\n },\n {\n \"tag\": "gynosporangium phaenogenetic",\n \"popularity\": 36100\n },\n {\n \"tag\": "uniunguiculate",\n \"popularity\": 36012\n },\n {\n \"tag\": "prudelike",\n \"popularity\": 35926\n },\n {\n \"tag\": "seminomata",\n \"popularity\": 35839\n },\n {\n \"tag\": "trinklet",\n \"popularity\": 35753\n },\n {\n \"tag\": "risorial",\n \"popularity\": 35667\n },\n {\n \"tag\": "pericardiocentesis",\n \"popularity\": 35581\n },\n {\n \"tag\": "filmist",\n \"popularity\": 35496\n },\n {\n \"tag\": "Nana",\n \"popularity\": 35411\n },\n {\n \"tag\": "cynipoid",\n \"popularity\": 35326\n },\n {\n \"tag\": "cteniform",\n \"popularity\": 35242\n },\n {\n \"tag\": "semiflex",\n \"popularity\": 35158\n },\n {\n \"tag\": "solstitially",\n \"popularity\": 35074\n },\n {\n \"tag\": "Algarsife",\n \"popularity\": 34991\n },\n {\n \"tag\": "noncriminal",\n \"popularity\": 34908\n },\n {\n \"tag\": "compassion",\n \"popularity\": 34825\n },\n {\n \"tag\": "Buddhic",\n \"popularity\": 34743\n },\n {\n \"tag\": "vellicative dactylically hotfoot",\n \"popularity\": 34661\n },\n {\n \"tag\": "chicory",\n \"popularity\": 34579\n },\n {\n \"tag\": "transperitoneally",\n \"popularity\": 34497\n },\n {\n \"tag\": "pennae",\n \"popularity\": 34416\n },\n {\n \"tag\": "Flamandize",\n \"popularity\": 34335\n },\n {\n \"tag\": "underviewer",\n \"popularity\": 34254\n },\n {\n \"tag\": "assoil",\n \"popularity\": 34174\n },\n {\n \"tag\": "saccharobacillus",\n \"popularity\": 34094\n },\n {\n \"tag\": "biacetylene",\n \"popularity\": 34014\n },\n {\n \"tag\": "mouchardism",\n \"popularity\": 33935\n },\n {\n \"tag\": "anisomeric",\n \"popularity\": 33856\n },\n {\n \"tag\": "digestive",\n \"popularity\": 33777\n },\n {\n \"tag\": "darlingly",\n \"popularity\": 33698\n },\n {\n \"tag\": "liman",\n \"popularity\": 33620\n },\n {\n \"tag\": "soldanrie",\n \"popularity\": 33542\n },\n {\n \"tag\": "sully",\n \"popularity\": 33464\n },\n {\n \"tag\": "brightsmith",\n \"popularity\": 33387\n },\n {\n \"tag\": "inwrap antiliturgist ureterocervical",\n \"popularity\": 33309\n },\n {\n \"tag\": "discommodity",\n \"popularity\": 33232\n },\n {\n \"tag\": "typical aggrandizer",\n \"popularity\": 33156\n },\n {\n \"tag\": "xenogeny",\n \"popularity\": 33079\n },\n {\n \"tag\": "uncountrified",\n \"popularity\": 33003\n },\n {\n \"tag\": "Podarge",\n \"popularity\": 32928\n },\n {\n \"tag\": "uninterviewed",\n \"popularity\": 32852\n },\n {\n \"tag\": "underprior",\n \"popularity\": 32777\n },\n {\n \"tag\": "leiomyomatous",\n \"popularity\": 32702\n },\n {\n \"tag\": "postdysenteric",\n \"popularity\": 32627\n },\n {\n \"tag\": "Fusicladium",\n \"popularity\": 32553\n },\n {\n \"tag\": "Dulcinea",\n \"popularity\": 32478\n },\n {\n \"tag\": "interspersion",\n \"popularity\": 32404\n },\n {\n \"tag\": "preobligate",\n \"popularity\": 32331\n },\n {\n \"tag\": "subaggregate",\n \"popularity\": 32257\n },\n {\n \"tag\": "grammarianism",\n \"popularity\": 32184\n },\n {\n \"tag\": "palikar",\n \"popularity\": 32111\n },\n {\n \"tag\": "facileness",\n \"popularity\": 32039\n },\n {\n \"tag\": "deuterofibrinose",\n \"popularity\": 31966\n },\n {\n \"tag\": "pseudesthesia",\n \"popularity\": 31894\n },\n {\n \"tag\": "sedimentary",\n \"popularity\": 31822\n },\n {\n \"tag\": "typewrite",\n \"popularity\": 31751\n },\n {\n \"tag\": "immemorable",\n \"popularity\": 31679\n },\n {\n \"tag\": "Myrtus",\n \"popularity\": 31608\n },\n {\n \"tag\": "hauchecornite",\n \"popularity\": 31537\n },\n {\n \"tag\": "galleylike",\n \"popularity\": 31467\n },\n {\n \"tag\": "thimber",\n \"popularity\": 31396\n },\n {\n \"tag\": "Hegelianism",\n \"popularity\": 31326\n },\n {\n \"tag\": "strig",\n \"popularity\": 31256\n },\n {\n \"tag\": "skyre",\n \"popularity\": 31187\n },\n {\n \"tag\": "eupepticism",\n \"popularity\": 31117\n },\n {\n \"tag\": "eponymism",\n \"popularity\": 31048\n },\n {\n \"tag\": "flunkeyhood",\n \"popularity\": 30979\n },\n {\n \"tag\": "Abama",\n \"popularity\": 30911\n },\n {\n \"tag\": "adiadochokinesis",\n \"popularity\": 30842\n },\n {\n \"tag\": "spendthrifty",\n \"popularity\": 30774\n },\n {\n \"tag\": "chalcedony",\n \"popularity\": 30706\n },\n {\n \"tag\": "authorism",\n \"popularity\": 30638\n },\n {\n \"tag\": "nasturtium",\n \"popularity\": 30571\n },\n {\n \"tag\": "Acanthocereus",\n \"popularity\": 30504\n },\n {\n \"tag\": "uncollapsible",\n \"popularity\": 30437\n },\n {\n \"tag\": "excursionist",\n \"popularity\": 30370\n },\n {\n \"tag\": "fogbow",\n \"popularity\": 30303\n },\n {\n \"tag\": "overlie",\n \"popularity\": 30237\n },\n {\n \"tag\": "velours",\n \"popularity\": 30171\n },\n {\n \"tag\": "zoodendria madrigal stagbush",\n \"popularity\": 30105\n },\n {\n \"tag\": "imi",\n \"popularity\": 30039\n },\n {\n \"tag\": "cojudge",\n \"popularity\": 29974\n },\n {\n \"tag\": "depurate argal",\n \"popularity\": 29909\n },\n {\n \"tag\": "unrecognition",\n \"popularity\": 29844\n },\n {\n \"tag\": "paunchful",\n \"popularity\": 29779\n },\n {\n \"tag\": "invalued",\n \"popularity\": 29714\n },\n {\n \"tag\": "probang",\n \"popularity\": 29650\n },\n {\n \"tag\": "chetvert",\n \"popularity\": 29586\n },\n {\n \"tag\": "enactable",\n \"popularity\": 29522\n },\n {\n \"tag\": "detoxicate adhibit",\n \"popularity\": 29458\n },\n {\n \"tag\": "kullaite",\n \"popularity\": 29395\n },\n {\n \"tag\": "undazzling",\n \"popularity\": 29332\n },\n {\n \"tag\": "excalation",\n \"popularity\": 29269\n },\n {\n \"tag\": "sievings",\n \"popularity\": 29206\n },\n {\n \"tag\": "disenthral",\n \"popularity\": 29143\n },\n {\n \"tag\": "disinterestedly",\n \"popularity\": 29081\n },\n {\n \"tag\": "stanner",\n \"popularity\": 29018\n },\n {\n \"tag\": "recapitulative",\n \"popularity\": 28956\n },\n {\n \"tag\": "objectivist",\n \"popularity\": 28895\n },\n {\n \"tag\": "hypermetropia",\n \"popularity\": 28833\n },\n {\n \"tag\": "incumbency",\n \"popularity\": 28772\n },\n {\n \"tag\": "protegee",\n \"popularity\": 28711\n },\n {\n \"tag\": "zealotic",\n \"popularity\": 28650\n },\n {\n \"tag\": "predebit",\n \"popularity\": 28589\n },\n {\n \"tag\": "cupolar",\n \"popularity\": 28528\n },\n {\n \"tag\": "unattributed",\n \"popularity\": 28468\n },\n {\n \"tag\": "louisine",\n \"popularity\": 28408\n },\n {\n \"tag\": "illustrate",\n \"popularity\": 28348\n },\n {\n \"tag\": "inofficiousness",\n \"popularity\": 28288\n },\n {\n \"tag\": "Americawards",\n \"popularity\": 28228\n },\n {\n \"tag\": "foreflap",\n \"popularity\": 28169\n },\n {\n \"tag\": "eruditeness",\n \"popularity\": 28110\n },\n {\n \"tag\": "copiopsia",\n \"popularity\": 28051\n },\n {\n \"tag\": "sporuliferous",\n \"popularity\": 27992\n },\n {\n \"tag\": "muttering",\n \"popularity\": 27934\n },\n {\n \"tag\": "prepsychology adrip",\n \"popularity\": 27875\n },\n {\n \"tag\": "unfriendly",\n \"popularity\": 27817\n },\n {\n \"tag\": "sulphanilic",\n \"popularity\": 27759\n },\n {\n \"tag\": "Coelococcus",\n \"popularity\": 27701\n },\n {\n \"tag\": "undoubtfulness",\n \"popularity\": 27643\n },\n {\n \"tag\": "flaringly",\n \"popularity\": 27586\n },\n {\n \"tag\": "unordain",\n \"popularity\": 27529\n },\n {\n \"tag\": "fratchety",\n \"popularity\": 27472\n },\n {\n \"tag\": "decadentism dolefully",\n \"popularity\": 27415\n },\n {\n \"tag\": "synthronus",\n \"popularity\": 27358\n },\n {\n \"tag\": "maiid",\n \"popularity\": 27301\n },\n {\n \"tag\": "rhinobyon",\n \"popularity\": 27245\n },\n {\n \"tag\": "Didynamia",\n \"popularity\": 27189\n },\n {\n \"tag\": "millionairedom",\n \"popularity\": 27133\n },\n {\n \"tag\": "mulierine",\n \"popularity\": 27077\n },\n {\n \"tag\": "Mayo",\n \"popularity\": 27021\n },\n {\n \"tag\": "perceivedness",\n \"popularity\": 26966\n },\n {\n \"tag\": "unadoration",\n \"popularity\": 26911\n },\n {\n \"tag\": "regraft",\n \"popularity\": 26856\n },\n {\n \"tag\": "witch",\n \"popularity\": 26801\n },\n {\n \"tag\": "ungrow",\n \"popularity\": 26746\n },\n {\n \"tag\": "glossopharyngeus",\n \"popularity\": 26691\n },\n {\n \"tag\": "unstirrable",\n \"popularity\": 26637\n },\n {\n \"tag\": "synodsman",\n \"popularity\": 26583\n },\n {\n \"tag\": "placentalian",\n \"popularity\": 26529\n },\n {\n \"tag\": "corpulently",\n \"popularity\": 26475\n },\n {\n \"tag\": "photochromoscope",\n \"popularity\": 26421\n },\n {\n \"tag\": "indusiate retinasphaltum chokestrap",\n \"popularity\": 26368\n },\n {\n \"tag\": "murdrum",\n \"popularity\": 26314\n },\n {\n \"tag\": "belatedness",\n \"popularity\": 26261\n },\n {\n \"tag\": "Cochin",\n \"popularity\": 26208\n },\n {\n \"tag\": "Leonist",\n \"popularity\": 26155\n },\n {\n \"tag\": "keeker confined",\n \"popularity\": 26102\n },\n {\n \"tag\": "unintellectual",\n \"popularity\": 26050\n },\n {\n \"tag\": "nymphaline bait",\n \"popularity\": 25997\n },\n {\n \"tag\": "sarcosporidiosis",\n \"popularity\": 25945\n },\n {\n \"tag\": "catawamptiously",\n \"popularity\": 25893\n },\n {\n \"tag\": "outshame",\n \"popularity\": 25841\n },\n {\n \"tag\": "animalism",\n \"popularity\": 25790\n },\n {\n \"tag\": "epithalamial",\n \"popularity\": 25738\n },\n {\n \"tag\": "ganner",\n \"popularity\": 25687\n },\n {\n \"tag\": "desilicify",\n \"popularity\": 25635\n },\n {\n \"tag\": "dandyism",\n \"popularity\": 25584\n },\n {\n \"tag\": "hyleg",\n \"popularity\": 25533\n },\n {\n \"tag\": "photophysical",\n \"popularity\": 25483\n },\n {\n \"tag\": "underload",\n \"popularity\": 25432\n },\n {\n \"tag\": "unintrusive",\n \"popularity\": 25382\n },\n {\n \"tag\": "succinamic",\n \"popularity\": 25331\n },\n {\n \"tag\": "matchy",\n \"popularity\": 25281\n },\n {\n \"tag\": "concordal",\n \"popularity\": 25231\n },\n {\n \"tag\": "exteriority",\n \"popularity\": 25181\n },\n {\n \"tag\": "sterculiad",\n \"popularity\": 25132\n },\n {\n \"tag\": "sulfoxylic",\n \"popularity\": 25082\n },\n {\n \"tag\": "oversubscription",\n \"popularity\": 25033\n },\n {\n \"tag\": "chiasmic",\n \"popularity\": 24984\n },\n {\n \"tag\": "pseudoparthenogenesis",\n \"popularity\": 24935\n },\n {\n \"tag\": "indorse",\n \"popularity\": 24886\n },\n {\n \"tag\": "Krishnaite",\n \"popularity\": 24837\n },\n {\n \"tag\": "calcinize",\n \"popularity\": 24788\n },\n {\n \"tag\": "rhodium",\n \"popularity\": 24740\n },\n {\n \"tag\": "tragopan",\n \"popularity\": 24692\n },\n {\n \"tag\": "overwhelmingly",\n \"popularity\": 24643\n },\n {\n \"tag\": "procidence accorporate",\n \"popularity\": 24595\n },\n {\n \"tag\": "polemize speelless",\n \"popularity\": 24548\n },\n {\n \"tag\": "radiocarpal goran",\n \"popularity\": 24500\n },\n {\n \"tag\": "counteroffer Pelodytes",\n \"popularity\": 24452\n },\n {\n \"tag\": "lionhearted",\n \"popularity\": 24405\n },\n {\n \"tag\": "paramastoid",\n \"popularity\": 24358\n },\n {\n \"tag\": "murine",\n \"popularity\": 24310\n },\n {\n \"tag\": "woodbined",\n \"popularity\": 24263\n },\n {\n \"tag\": "packthread",\n \"popularity\": 24217\n },\n {\n \"tag\": "citreous",\n \"popularity\": 24170\n },\n {\n \"tag\": "unfallaciously",\n \"popularity\": 24123\n },\n {\n \"tag\": "tentwork reincarnadine",\n \"popularity\": 24077\n },\n {\n \"tag\": "verminousness",\n \"popularity\": 24030\n },\n {\n \"tag\": "sillometer",\n \"popularity\": 23984\n },\n {\n \"tag\": "jointy",\n \"popularity\": 23938\n },\n {\n \"tag\": "streptolysin",\n \"popularity\": 23892\n },\n {\n \"tag\": "Florentinism",\n \"popularity\": 23847\n },\n {\n \"tag\": "monosomatous",\n \"popularity\": 23801\n },\n {\n \"tag\": "capsulociliary",\n \"popularity\": 23756\n },\n {\n \"tag\": "organum",\n \"popularity\": 23710\n },\n {\n \"tag\": "overtly",\n \"popularity\": 23665\n },\n {\n \"tag\": "ophthalmoscopical",\n \"popularity\": 23620\n },\n {\n \"tag\": "supposititiously",\n \"popularity\": 23575\n },\n {\n \"tag\": "radiochemistry",\n \"popularity\": 23530\n },\n {\n \"tag\": "flaxtail",\n \"popularity\": 23486\n },\n {\n \"tag\": "pretympanic",\n \"popularity\": 23441\n },\n {\n \"tag\": "auscultation",\n \"popularity\": 23397\n },\n {\n \"tag\": "hairdresser",\n \"popularity\": 23352\n },\n {\n \"tag\": "chaffless",\n \"popularity\": 23308\n },\n {\n \"tag\": "polioencephalitis",\n \"popularity\": 23264\n },\n {\n \"tag\": "axolotl",\n \"popularity\": 23220\n },\n {\n \"tag\": "smous",\n \"popularity\": 23177\n },\n {\n \"tag\": "morgen disenamour toothed",\n \"popularity\": 23133\n },\n {\n \"tag\": "chaiseless",\n \"popularity\": 23089\n },\n {\n \"tag\": "frugally",\n \"popularity\": 23046\n },\n {\n \"tag\": "combustive antievolutionist cinenegative",\n \"popularity\": 23003\n },\n {\n \"tag\": "malacolite",\n \"popularity\": 22960\n },\n {\n \"tag\": "borne",\n \"popularity\": 22917\n },\n {\n \"tag\": "mercaptole",\n \"popularity\": 22874\n },\n {\n \"tag\": "judicatory",\n \"popularity\": 22831\n },\n {\n \"tag\": "noctivagation",\n \"popularity\": 22789\n },\n {\n \"tag\": "synthete",\n \"popularity\": 22746\n },\n {\n \"tag\": "tomboyism",\n \"popularity\": 22704\n },\n {\n \"tag\": "serranoid",\n \"popularity\": 22661\n },\n {\n \"tag\": "impostorism",\n \"popularity\": 22619\n },\n {\n \"tag\": "flagellosis Talitha",\n \"popularity\": 22577\n },\n {\n \"tag\": "pseudoviscous",\n \"popularity\": 22535\n },\n {\n \"tag\": "Galleriidae",\n \"popularity\": 22494\n },\n {\n \"tag\": "undulation didelph Comintern",\n \"popularity\": 22452\n },\n {\n \"tag\": "triangulopyramidal",\n \"popularity\": 22411\n },\n {\n \"tag\": "middlings",\n \"popularity\": 22369\n },\n {\n \"tag\": "piperazin",\n \"popularity\": 22328\n },\n {\n \"tag\": "endostitis",\n \"popularity\": 22287\n },\n {\n \"tag\": "swordlike",\n \"popularity\": 22246\n },\n {\n \"tag\": "forthwith",\n \"popularity\": 22205\n },\n {\n \"tag\": "menaceful",\n \"popularity\": 22164\n },\n {\n \"tag\": "explantation defective",\n \"popularity\": 22123\n },\n {\n \"tag\": "arrear",\n \"popularity\": 22083\n },\n {\n \"tag\": "engraft",\n \"popularity\": 22042\n },\n {\n \"tag\": "revolunteer",\n \"popularity\": 22002\n },\n {\n \"tag\": "foliaceous",\n \"popularity\": 21962\n },\n {\n \"tag\": "pseudograph",\n \"popularity\": 21922\n },\n {\n \"tag\": "maenaite",\n \"popularity\": 21882\n },\n {\n \"tag\": "interfinger",\n \"popularity\": 21842\n },\n {\n \"tag\": "macroscopically",\n \"popularity\": 21802\n },\n {\n \"tag\": "bluewood",\n \"popularity\": 21762\n },\n {\n \"tag\": "chikara",\n \"popularity\": 21723\n },\n {\n \"tag\": "reprehension diazeuxis nickelous",\n \"popularity\": 21683\n },\n {\n \"tag\": "vacuation",\n \"popularity\": 21644\n },\n {\n \"tag\": "Sartish",\n \"popularity\": 21605\n },\n {\n \"tag\": "pseudogyny",\n \"popularity\": 21566\n },\n {\n \"tag\": "friedcake",\n \"popularity\": 21527\n },\n {\n \"tag\": "thraw",\n \"popularity\": 21488\n },\n {\n \"tag\": "bifid",\n \"popularity\": 21449\n },\n {\n \"tag\": "truthlessly",\n \"popularity\": 21411\n },\n {\n \"tag\": "lungy",\n \"popularity\": 21372\n },\n {\n \"tag\": "fluoborite",\n \"popularity\": 21334\n },\n {\n \"tag\": "anthropolithic",\n \"popularity\": 21295\n },\n {\n \"tag\": "coachee straw",\n \"popularity\": 21257\n },\n {\n \"tag\": "dehorner Grecize",\n \"popularity\": 21219\n },\n {\n \"tag\": "spondylopyosis",\n \"popularity\": 21181\n },\n {\n \"tag\": "institutionary",\n \"popularity\": 21143\n },\n {\n \"tag\": "agentry",\n \"popularity\": 21105\n },\n {\n \"tag\": "musing bietle",\n \"popularity\": 21068\n },\n {\n \"tag\": "cormophyte",\n \"popularity\": 21030\n },\n {\n \"tag\": "semielliptic",\n \"popularity\": 20993\n },\n {\n \"tag\": "ependytes",\n \"popularity\": 20955\n },\n {\n \"tag\": "coachmaster",\n \"popularity\": 20918\n },\n {\n \"tag\": "overexuberant",\n \"popularity\": 20881\n },\n {\n \"tag\": "selectable",\n \"popularity\": 20844\n },\n {\n \"tag\": "saclike",\n \"popularity\": 20807\n },\n {\n \"tag\": "mullion",\n \"popularity\": 20770\n },\n {\n \"tag\": "pantheonize prevalency",\n \"popularity\": 20733\n },\n {\n \"tag\": "trophosperm",\n \"popularity\": 20697\n },\n {\n \"tag\": "paraphrasist",\n \"popularity\": 20660\n },\n {\n \"tag\": "undercarry",\n \"popularity\": 20624\n },\n {\n \"tag\": "thallogenic",\n \"popularity\": 20587\n },\n {\n \"tag\": "bulgy forbid",\n \"popularity\": 20551\n },\n {\n \"tag\": "proliquor gratulatory",\n \"popularity\": 20515\n },\n {\n \"tag\": "booker",\n \"popularity\": 20479\n },\n {\n \"tag\": "wizen",\n \"popularity\": 20443\n },\n {\n \"tag\": "synchondrosially",\n \"popularity\": 20407\n },\n {\n \"tag\": "herbless",\n \"popularity\": 20371\n },\n {\n \"tag\": "arfvedsonite",\n \"popularity\": 20336\n },\n {\n \"tag\": "Neuroptera",\n \"popularity\": 20300\n },\n {\n \"tag\": "fingerstone",\n \"popularity\": 20265\n },\n {\n \"tag\": "Odontoglossae",\n \"popularity\": 20229\n },\n {\n \"tag\": "transmigrator",\n \"popularity\": 20194\n },\n {\n \"tag\": "Dehaites",\n \"popularity\": 20159\n },\n {\n \"tag\": "Molinist",\n \"popularity\": 20124\n },\n {\n \"tag\": "novelistic",\n \"popularity\": 20089\n },\n {\n \"tag\": "astelic",\n \"popularity\": 20054\n },\n {\n \"tag\": "pyelometry",\n \"popularity\": 20019\n },\n {\n \"tag\": "pigmentation",\n \"popularity\": 19984\n },\n {\n \"tag\": "epinaos",\n \"popularity\": 19950\n },\n {\n \"tag\": "outdare",\n \"popularity\": 19915\n },\n {\n \"tag\": "Funje philaristocracy",\n \"popularity\": 19881\n },\n {\n \"tag\": "keddah",\n \"popularity\": 19846\n },\n {\n \"tag\": "axoidean",\n \"popularity\": 19812\n },\n {\n \"tag\": "ovule",\n \"popularity\": 19778\n },\n {\n \"tag\": "solidify",\n \"popularity\": 19744\n },\n {\n \"tag\": "noncelestial",\n \"popularity\": 19710\n },\n {\n \"tag\": "overmultiplication",\n \"popularity\": 19676\n },\n {\n \"tag\": "hexatetrahedron",\n \"popularity\": 19642\n },\n {\n \"tag\": "pliciform",\n \"popularity\": 19609\n },\n {\n \"tag\": "zimbalon",\n \"popularity\": 19575\n },\n {\n \"tag\": "annexational",\n \"popularity\": 19542\n },\n {\n \"tag\": "eurhodol",\n \"popularity\": 19508\n },\n {\n \"tag\": "yark",\n \"popularity\": 19475\n },\n {\n \"tag\": "illegality nitroalizarin",\n \"popularity\": 19442\n },\n {\n \"tag\": "quadratum",\n \"popularity\": 19409\n },\n {\n \"tag\": "saccharine",\n \"popularity\": 19376\n },\n {\n \"tag\": "unemploy",\n \"popularity\": 19343\n },\n {\n \"tag\": "uniclinal unipotent",\n \"popularity\": 19310\n },\n {\n \"tag\": "turbo",\n \"popularity\": 19277\n },\n {\n \"tag\": "sybarism",\n \"popularity\": 19244\n },\n {\n \"tag\": "motacilline",\n \"popularity\": 19212\n },\n {\n \"tag\": "weaselly",\n \"popularity\": 19179\n },\n {\n \"tag\": "plastid",\n \"popularity\": 19147\n },\n {\n \"tag\": "wasting",\n \"popularity\": 19114\n },\n {\n \"tag\": "begrime fluting",\n \"popularity\": 19082\n },\n {\n \"tag\": "Nephilinae",\n \"popularity\": 19050\n },\n {\n \"tag\": "disregardance",\n \"popularity\": 19018\n },\n {\n \"tag\": "Shakerlike",\n \"popularity\": 18986\n },\n {\n \"tag\": "uniped",\n \"popularity\": 18954\n },\n {\n \"tag\": "knap",\n \"popularity\": 18922\n },\n {\n \"tag\": "electivism undergardener",\n \"popularity\": 18890\n },\n {\n \"tag\": "hulverheaded",\n \"popularity\": 18858\n },\n {\n \"tag\": "unruptured",\n \"popularity\": 18827\n },\n {\n \"tag\": "solemnize credently",\n \"popularity\": 18795\n },\n {\n \"tag\": "pentastomoid possessingly",\n \"popularity\": 18764\n },\n {\n \"tag\": "octose",\n \"popularity\": 18733\n },\n {\n \"tag\": "psithurism indefensibility",\n \"popularity\": 18701\n },\n {\n \"tag\": "torrentuous cyanometer subcrenate",\n \"popularity\": 18670\n },\n {\n \"tag\": "photoplaywright tapaculo",\n \"popularity\": 18639\n },\n {\n \"tag\": "univalence",\n \"popularity\": 18608\n },\n {\n \"tag\": "Porthetria",\n \"popularity\": 18577\n },\n {\n \"tag\": "funambulo",\n \"popularity\": 18546\n },\n {\n \"tag\": "pedion",\n \"popularity\": 18515\n },\n {\n \"tag\": "horticulturally",\n \"popularity\": 18485\n },\n {\n \"tag\": "marennin",\n \"popularity\": 18454\n },\n {\n \"tag\": "horselaugh",\n \"popularity\": 18423\n },\n {\n \"tag\": "semiexecutive",\n \"popularity\": 18393\n },\n {\n \"tag\": "Monopteridae",\n \"popularity\": 18363\n },\n {\n \"tag\": "commonable",\n \"popularity\": 18332\n },\n {\n \"tag\": "dreariment",\n \"popularity\": 18302\n },\n {\n \"tag\": "disbud",\n \"popularity\": 18272\n },\n {\n \"tag\": "monocled",\n \"popularity\": 18242\n },\n {\n \"tag\": "hurlbarrow",\n \"popularity\": 18212\n },\n {\n \"tag\": "opiateproof",\n \"popularity\": 18182\n },\n {\n \"tag\": "Fahrenheit",\n \"popularity\": 18152\n },\n {\n \"tag\": "writhed",\n \"popularity\": 18122\n },\n {\n \"tag\": "Volstead",\n \"popularity\": 18093\n },\n {\n \"tag\": "yesternight",\n \"popularity\": 18063\n },\n {\n \"tag\": "readmittance",\n \"popularity\": 18033\n },\n {\n \"tag\": "reiterable",\n \"popularity\": 18004\n },\n {\n \"tag\": "triquetral",\n \"popularity\": 17975\n },\n {\n \"tag\": "guillotinement",\n \"popularity\": 17945\n },\n {\n \"tag\": "repermission",\n \"popularity\": 17916\n },\n {\n \"tag\": "assishly",\n \"popularity\": 17887\n },\n {\n \"tag\": "daidle",\n \"popularity\": 17858\n },\n {\n \"tag\": "prismatoid",\n \"popularity\": 17829\n },\n {\n \"tag\": "irreptitious",\n \"popularity\": 17800\n },\n {\n \"tag\": "sourdeline",\n \"popularity\": 17771\n },\n {\n \"tag\": "Austrian",\n \"popularity\": 17742\n },\n {\n \"tag\": "psychorrhagic",\n \"popularity\": 17713\n },\n {\n \"tag\": "Monumbo",\n \"popularity\": 17685\n },\n {\n \"tag\": "cloiochoanitic",\n \"popularity\": 17656\n },\n {\n \"tag\": "hant",\n \"popularity\": 17628\n },\n {\n \"tag\": "roily pulldown",\n \"popularity\": 17599\n },\n {\n \"tag\": "recongratulation",\n \"popularity\": 17571\n },\n {\n \"tag\": "Peking",\n \"popularity\": 17543\n },\n {\n \"tag\": "erdvark",\n \"popularity\": 17514\n },\n {\n \"tag\": "antimnemonic",\n \"popularity\": 17486\n },\n {\n \"tag\": "noncapillarity",\n \"popularity\": 17458\n },\n {\n \"tag\": "irrepressive",\n \"popularity\": 17430\n },\n {\n \"tag\": "Petromyzontes",\n \"popularity\": 17402\n },\n {\n \"tag\": "piscatorially",\n \"popularity\": 17374\n },\n {\n \"tag\": "cholesterosis",\n \"popularity\": 17346\n },\n {\n \"tag\": "denunciate",\n \"popularity\": 17319\n },\n {\n \"tag\": "unmetalled",\n \"popularity\": 17291\n },\n {\n \"tag\": "Tigris enruin",\n \"popularity\": 17263\n },\n {\n \"tag\": "anaspalin",\n \"popularity\": 17236\n },\n {\n \"tag\": "monodromy",\n \"popularity\": 17208\n },\n {\n \"tag\": "Canichanan",\n \"popularity\": 17181\n },\n {\n \"tag\": "mesolabe",\n \"popularity\": 17154\n },\n {\n \"tag\": "trichothallic overcunningness",\n \"popularity\": 17127\n },\n {\n \"tag\": "spinsterishly",\n \"popularity\": 17099\n },\n {\n \"tag\": "sensilla",\n \"popularity\": 17072\n },\n {\n \"tag\": "wifelkin",\n \"popularity\": 17045\n },\n {\n \"tag\": "suppositionless",\n \"popularity\": 17018\n },\n {\n \"tag\": "irksomeness",\n \"popularity\": 16991\n },\n {\n \"tag\": "sanbenito",\n \"popularity\": 16964\n },\n {\n \"tag\": "nonstatement",\n \"popularity\": 16938\n },\n {\n \"tag\": "phenoloid",\n \"popularity\": 16911\n },\n {\n \"tag\": "Steinberger",\n \"popularity\": 16884\n },\n {\n \"tag\": "replicated boom",\n \"popularity\": 16858\n },\n {\n \"tag\": "sciomachiology",\n \"popularity\": 16831\n },\n {\n \"tag\": "starwise",\n \"popularity\": 16805\n },\n {\n \"tag\": "prerich",\n \"popularity\": 16778\n },\n {\n \"tag\": "unspawned",\n \"popularity\": 16752\n },\n {\n \"tag\": "unindentable",\n \"popularity\": 16726\n },\n {\n \"tag\": "stromatic",\n \"popularity\": 16700\n },\n {\n \"tag\": "fetishize",\n \"popularity\": 16673\n },\n {\n \"tag\": "dihydroxy",\n \"popularity\": 16647\n },\n {\n \"tag\": "precaudal",\n \"popularity\": 16621\n },\n {\n \"tag\": "Madagascar",\n \"popularity\": 16595\n },\n {\n \"tag\": "repinement",\n \"popularity\": 16570\n },\n {\n \"tag\": "noncathedral wenzel",\n \"popularity\": 16544\n },\n {\n \"tag\": "corollike",\n \"popularity\": 16518\n },\n {\n \"tag\": "pubes unamortization",\n \"popularity\": 16492\n },\n {\n \"tag\": "brickcroft",\n \"popularity\": 16467\n },\n {\n \"tag\": "intertrabecular",\n \"popularity\": 16441\n },\n {\n \"tag\": "formulaic",\n \"popularity\": 16416\n },\n {\n \"tag\": "arienzo",\n \"popularity\": 16390\n },\n {\n \"tag\": "Mazzinian",\n \"popularity\": 16365\n },\n {\n \"tag\": "wallowishly",\n \"popularity\": 16339\n },\n {\n \"tag\": "sysselman",\n \"popularity\": 16314\n },\n {\n \"tag\": "seligmannite",\n \"popularity\": 16289\n },\n {\n \"tag\": "harlequinery",\n \"popularity\": 16264\n },\n {\n \"tag\": "zucchetto",\n \"popularity\": 16239\n },\n {\n \"tag\": "malonyl",\n \"popularity\": 16214\n },\n {\n \"tag\": "patwari",\n \"popularity\": 16189\n },\n {\n \"tag\": "neoholmia venturesomeness",\n \"popularity\": 16164\n },\n {\n \"tag\": "Dehwar",\n \"popularity\": 16139\n },\n {\n \"tag\": "fetiferous",\n \"popularity\": 16114\n },\n {\n \"tag\": "chromatophore",\n \"popularity\": 16090\n },\n {\n \"tag\": "reregistration",\n \"popularity\": 16065\n },\n {\n \"tag\": "alienor",\n \"popularity\": 16040\n },\n {\n \"tag\": "Hexagynia",\n \"popularity\": 16016\n },\n {\n \"tag\": "cerebrotonia",\n \"popularity\": 15991\n },\n {\n \"tag\": "deedbox",\n \"popularity\": 15967\n },\n {\n \"tag\": "staab",\n \"popularity\": 15943\n },\n {\n \"tag\": "uratemia",\n \"popularity\": 15918\n },\n {\n \"tag\": "flaunt",\n \"popularity\": 15894\n },\n {\n \"tag\": "bogy",\n \"popularity\": 15870\n },\n {\n \"tag\": "subcartilaginous",\n \"popularity\": 15846\n },\n {\n \"tag\": "protonephridial",\n \"popularity\": 15822\n },\n {\n \"tag\": "Boswellia",\n \"popularity\": 15798\n },\n {\n \"tag\": "relaxant untiaraed protoepiphyte",\n \"popularity\": 15774\n },\n {\n \"tag\": "nesslerization",\n \"popularity\": 15750\n },\n {\n \"tag\": "precession",\n \"popularity\": 15726\n },\n {\n \"tag\": "peat",\n \"popularity\": 15702\n },\n {\n \"tag\": "unbit",\n \"popularity\": 15678\n },\n {\n \"tag\": "snailish",\n \"popularity\": 15655\n },\n {\n \"tag\": "porismatical",\n \"popularity\": 15631\n },\n {\n \"tag\": "hooflike",\n \"popularity\": 15608\n },\n {\n \"tag\": "resuppose phene cranic",\n \"popularity\": 15584\n },\n {\n \"tag\": "peptonization kipskin",\n \"popularity\": 15561\n },\n {\n \"tag\": "birdstone",\n \"popularity\": 15537\n },\n {\n \"tag\": "empty inferoanterior",\n \"popularity\": 15514\n },\n {\n \"tag\": "androtauric",\n \"popularity\": 15491\n },\n {\n \"tag\": "triamide",\n \"popularity\": 15467\n },\n {\n \"tag\": "showmanry",\n \"popularity\": 15444\n },\n {\n \"tag\": "doing",\n \"popularity\": 15421\n },\n {\n \"tag\": "bouchaleen",\n \"popularity\": 15398\n },\n {\n \"tag\": "precollude",\n \"popularity\": 15375\n },\n {\n \"tag\": "finger",\n \"popularity\": 15352\n },\n {\n \"tag\": "limnetic intermessenger",\n \"popularity\": 15329\n },\n {\n \"tag\": "uncharitable picrotoxic",\n \"popularity\": 15306\n },\n {\n \"tag\": "nationalizer Phasmidae",\n \"popularity\": 15283\n },\n {\n \"tag\": "laughingstock",\n \"popularity\": 15261\n },\n {\n \"tag\": "nondeferential",\n \"popularity\": 15238\n },\n {\n \"tag\": "uproariously",\n \"popularity\": 15215\n },\n {\n \"tag\": "manzanilla",\n \"popularity\": 15193\n },\n {\n \"tag\": "khahoon",\n \"popularity\": 15170\n },\n {\n \"tag\": "olericulturally longshanks",\n \"popularity\": 15148\n },\n {\n \"tag\": "enthusiastically methionic",\n \"popularity\": 15125\n },\n {\n \"tag\": "pobs",\n \"popularity\": 15103\n },\n {\n \"tag\": "tricarpellate",\n \"popularity\": 15081\n },\n {\n \"tag\": "souterrain",\n \"popularity\": 15058\n },\n {\n \"tag\": "tethelin",\n \"popularity\": 15036\n },\n {\n \"tag\": "tartle",\n \"popularity\": 15014\n },\n {\n \"tag\": "tidelike",\n \"popularity\": 14992\n },\n {\n \"tag\": "cosmoramic",\n \"popularity\": 14970\n },\n {\n \"tag\": "pretardiness",\n \"popularity\": 14948\n },\n {\n \"tag\": "insoul",\n \"popularity\": 14926\n },\n {\n \"tag\": "anthroxan",\n \"popularity\": 14904\n },\n {\n \"tag\": "jilter",\n \"popularity\": 14882\n },\n {\n \"tag\": "pectinibranchian trematode",\n \"popularity\": 14860\n },\n {\n \"tag\": "Renaissancist",\n \"popularity\": 14838\n },\n {\n \"tag\": "imaginant",\n \"popularity\": 14817\n },\n {\n \"tag\": "supercensure",\n \"popularity\": 14795\n },\n {\n \"tag\": "festilogy",\n \"popularity\": 14773\n },\n {\n \"tag\": "regression",\n \"popularity\": 14752\n },\n {\n \"tag\": "mesobregmate languorously",\n \"popularity\": 14730\n },\n {\n \"tag\": "unsupernaturalized",\n \"popularity\": 14709\n },\n {\n \"tag\": "boobyish",\n \"popularity\": 14687\n },\n {\n \"tag\": "scopolamine",\n \"popularity\": 14666\n },\n {\n \"tag\": "reamputation unchristianly",\n \"popularity\": 14645\n },\n {\n \"tag\": "cuneatic",\n \"popularity\": 14623\n },\n {\n \"tag\": "heathberry",\n \"popularity\": 14602\n },\n {\n \"tag\": "hate",\n \"popularity\": 14581\n },\n {\n \"tag\": "redeemableness",\n \"popularity\": 14560\n },\n {\n \"tag\": "damasse",\n \"popularity\": 14539\n },\n {\n \"tag\": "thrillsome",\n \"popularity\": 14518\n },\n {\n \"tag\": "disseverment",\n \"popularity\": 14497\n },\n {\n \"tag\": "underbishopric Ostyak",\n \"popularity\": 14476\n },\n {\n \"tag\": "Exoascales",\n \"popularity\": 14455\n },\n {\n \"tag\": "soiled",\n \"popularity\": 14434\n },\n {\n \"tag\": "Cain",\n \"popularity\": 14413\n },\n {\n \"tag\": "mismanageable arenae",\n \"popularity\": 14392\n },\n {\n \"tag\": "manducate unhinderably",\n \"popularity\": 14372\n },\n {\n \"tag\": "peregrin",\n \"popularity\": 14351\n },\n {\n \"tag\": "musicianly",\n \"popularity\": 14330\n },\n {\n \"tag\": "aln",\n \"popularity\": 14310\n },\n {\n \"tag\": "intercentrum",\n \"popularity\": 14289\n },\n {\n \"tag\": "roothold",\n \"popularity\": 14269\n },\n {\n \"tag\": "jane aneurism",\n \"popularity\": 14248\n },\n {\n \"tag\": "insinuatively forefeel phytolatrous",\n \"popularity\": 14228\n },\n {\n \"tag\": "kanchil",\n \"popularity\": 14208\n },\n {\n \"tag\": "Austrophile",\n \"popularity\": 14187\n },\n {\n \"tag\": "unterrorized",\n \"popularity\": 14167\n },\n {\n \"tag\": "admeasure",\n \"popularity\": 14147\n },\n {\n \"tag\": "electrodissolution",\n \"popularity\": 14127\n },\n {\n \"tag\": "unweddedly",\n \"popularity\": 14107\n },\n {\n \"tag\": "unannoying",\n \"popularity\": 14087\n },\n {\n \"tag\": "uningenuous",\n \"popularity\": 14067\n },\n {\n \"tag\": "omnibenevolent",\n \"popularity\": 14047\n },\n {\n \"tag\": "commissure",\n \"popularity\": 14027\n },\n {\n \"tag\": "tellureted",\n \"popularity\": 14007\n },\n {\n \"tag\": "suffragan",\n \"popularity\": 13987\n },\n {\n \"tag\": "sphaeriaceous",\n \"popularity\": 13967\n },\n {\n \"tag\": "unfearing",\n \"popularity\": 13947\n },\n {\n \"tag\": "stentoriousness precounsellor",\n \"popularity\": 13928\n },\n {\n \"tag\": "haemaspectroscope",\n \"popularity\": 13908\n },\n {\n \"tag\": "teras",\n \"popularity\": 13888\n },\n {\n \"tag\": "pulicine",\n \"popularity\": 13869\n },\n {\n \"tag\": "colicystopyelitis",\n \"popularity\": 13849\n },\n {\n \"tag\": "Physalia",\n \"popularity\": 13830\n },\n {\n \"tag\": "Saxicolidae",\n \"popularity\": 13810\n },\n {\n \"tag\": "peritonital",\n \"popularity\": 13791\n },\n {\n \"tag\": "dysphotic",\n \"popularity\": 13771\n },\n {\n \"tag\": "unabandoned",\n \"popularity\": 13752\n },\n {\n \"tag\": "rashful",\n \"popularity\": 13733\n },\n {\n \"tag\": "goodyness Manobo",\n \"popularity\": 13714\n },\n {\n \"tag\": "glaring",\n \"popularity\": 13694\n },\n {\n \"tag\": "horrorful",\n \"popularity\": 13675\n },\n {\n \"tag\": "intercepting",\n \"popularity\": 13656\n },\n {\n \"tag\": "semifine",\n \"popularity\": 13637\n },\n {\n \"tag\": "Gaypoo",\n \"popularity\": 13618\n },\n {\n \"tag\": "Metrosideros",\n \"popularity\": 13599\n },\n {\n \"tag\": "thoracicolumbar",\n \"popularity\": 13580\n },\n {\n \"tag\": "unserried",\n \"popularity\": 13561\n },\n {\n \"tag\": "keeperess cauterization",\n \"popularity\": 13542\n },\n {\n \"tag\": "administrant",\n \"popularity\": 13523\n },\n {\n \"tag\": "unpropitiatedness",\n \"popularity\": 13505\n },\n {\n \"tag\": "pensileness",\n \"popularity\": 13486\n },\n {\n \"tag\": "quinaldic unreceivable",\n \"popularity\": 13467\n },\n {\n \"tag\": "Carnaria",\n \"popularity\": 13448\n },\n {\n \"tag\": "azothionium wurrus",\n \"popularity\": 13430\n },\n {\n \"tag\": "mistresshood",\n \"popularity\": 13411\n },\n {\n \"tag\": "Savara",\n \"popularity\": 13393\n },\n {\n \"tag\": "dasyurine",\n \"popularity\": 13374\n },\n {\n \"tag\": "superideal",\n \"popularity\": 13356\n },\n {\n \"tag\": "Parisianize",\n \"popularity\": 13337\n },\n {\n \"tag\": "underearth",\n \"popularity\": 13319\n },\n {\n \"tag\": "athrogenic",\n \"popularity\": 13301\n },\n {\n \"tag\": "communicate",\n \"popularity\": 13282\n },\n {\n \"tag\": "denervation enworthed",\n \"popularity\": 13264\n },\n {\n \"tag\": "subbromide",\n \"popularity\": 13246\n },\n {\n \"tag\": "stenocoriasis",\n \"popularity\": 13228\n },\n {\n \"tag\": "facetiousness",\n \"popularity\": 13209\n },\n {\n \"tag\": "twaddling",\n \"popularity\": 13191\n },\n {\n \"tag\": "tetartoconid",\n \"popularity\": 13173\n },\n {\n \"tag\": "audiophile",\n \"popularity\": 13155\n },\n {\n \"tag\": "fustigate",\n \"popularity\": 13137\n },\n {\n \"tag\": "Sorbian cacophonia",\n \"popularity\": 13119\n },\n {\n \"tag\": "fondish",\n \"popularity\": 13101\n },\n {\n \"tag\": "endomastoiditis",\n \"popularity\": 13084\n },\n {\n \"tag\": "sniptious",\n \"popularity\": 13066\n },\n {\n \"tag\": "glochidiate",\n \"popularity\": 13048\n },\n {\n \"tag\": "polycarboxylic",\n \"popularity\": 13030\n },\n {\n \"tag\": "stamp",\n \"popularity\": 13012\n },\n {\n \"tag\": "tritonymph endotoxoid",\n \"popularity\": 12995\n },\n {\n \"tag\": "wolfskin",\n \"popularity\": 12977\n },\n {\n \"tag\": "oncosimeter",\n \"popularity\": 12959\n },\n {\n \"tag\": "outward",\n \"popularity\": 12942\n },\n {\n \"tag\": "circumscribed",\n \"popularity\": 12924\n },\n {\n \"tag\": "autohemolytic",\n \"popularity\": 12907\n },\n {\n \"tag\": "isorhamnose",\n \"popularity\": 12889\n },\n {\n \"tag\": "monarchomachic",\n \"popularity\": 12872\n },\n {\n \"tag\": "phaenomenon",\n \"popularity\": 12855\n },\n {\n \"tag\": "angiopressure",\n \"popularity\": 12837\n },\n {\n \"tag\": "similarize",\n \"popularity\": 12820\n },\n {\n \"tag\": "unseeable",\n \"popularity\": 12803\n },\n {\n \"tag\": "Toryize",\n \"popularity\": 12785\n },\n {\n \"tag\": "fruitling",\n \"popularity\": 12768\n },\n {\n \"tag\": "axle",\n \"popularity\": 12751\n },\n {\n \"tag\": "priestal cocked",\n \"popularity\": 12734\n },\n {\n \"tag\": "serotoxin",\n \"popularity\": 12717\n },\n {\n \"tag\": "unmovably",\n \"popularity\": 12700\n },\n {\n \"tag\": "darbha",\n \"popularity\": 12683\n },\n {\n \"tag\": "Mongolize",\n \"popularity\": 12666\n },\n {\n \"tag\": "clusteringly",\n \"popularity\": 12649\n },\n {\n \"tag\": "tendence",\n \"popularity\": 12632\n },\n {\n \"tag\": "foziness",\n \"popularity\": 12615\n },\n {\n \"tag\": "brickkiln lithify",\n \"popularity\": 12598\n },\n {\n \"tag\": "unpriest",\n \"popularity\": 12581\n },\n {\n \"tag\": "convincer",\n \"popularity\": 12564\n },\n {\n \"tag\": "mornlike",\n \"popularity\": 12548\n },\n {\n \"tag\": "overaddiction ostentatiousness",\n \"popularity\": 12531\n },\n {\n \"tag\": "diffusively moccasin pendom",\n \"popularity\": 12514\n },\n {\n \"tag\": "boose",\n \"popularity\": 12498\n },\n {\n \"tag\": "myonosus",\n \"popularity\": 12481\n },\n {\n \"tag\": "handsome",\n \"popularity\": 12464\n },\n {\n \"tag\": "paroxysmic",\n \"popularity\": 12448\n },\n {\n \"tag\": "Ulidian",\n \"popularity\": 12431\n },\n {\n \"tag\": "heartache",\n \"popularity\": 12415\n },\n {\n \"tag\": "torporize",\n \"popularity\": 12398\n },\n {\n \"tag\": "hippish",\n \"popularity\": 12382\n },\n {\n \"tag\": "stigmal militation",\n \"popularity\": 12366\n },\n {\n \"tag\": "matmaker",\n \"popularity\": 12349\n },\n {\n \"tag\": "marantaceous bivoluminous",\n \"popularity\": 12333\n },\n {\n \"tag\": "Uraniidae",\n \"popularity\": 12317\n },\n {\n \"tag\": "risper",\n \"popularity\": 12301\n },\n {\n \"tag\": "tintinnabulation",\n \"popularity\": 12284\n },\n {\n \"tag\": "tributorian",\n \"popularity\": 12268\n },\n {\n \"tag\": "ashamedly",\n \"popularity\": 12252\n },\n {\n \"tag\": "Macrourus",\n \"popularity\": 12236\n },\n {\n \"tag\": "Chora",\n \"popularity\": 12220\n },\n {\n \"tag\": "caul",\n \"popularity\": 12204\n },\n {\n \"tag\": "exsector",\n \"popularity\": 12188\n },\n {\n \"tag\": "acutish",\n \"popularity\": 12172\n },\n {\n \"tag\": "amphichrome",\n \"popularity\": 12156\n },\n {\n \"tag\": "guarder",\n \"popularity\": 12140\n },\n {\n \"tag\": "sculpturally",\n \"popularity\": 12124\n },\n {\n \"tag\": "benightmare",\n \"popularity\": 12108\n },\n {\n \"tag\": "chucky",\n \"popularity\": 12093\n },\n {\n \"tag\": "Venetian",\n \"popularity\": 12077\n },\n {\n \"tag\": "autotheater",\n \"popularity\": 12061\n },\n {\n \"tag\": "planarioid",\n \"popularity\": 12045\n },\n {\n \"tag\": "handkerchiefful",\n \"popularity\": 12030\n },\n {\n \"tag\": "fuliginousness potentize",\n \"popularity\": 12014\n },\n {\n \"tag\": "pantheum",\n \"popularity\": 11998\n },\n {\n \"tag\": "heavyweight",\n \"popularity\": 11983\n },\n {\n \"tag\": "unbrick",\n \"popularity\": 11967\n },\n {\n \"tag\": "duomachy",\n \"popularity\": 11952\n },\n {\n \"tag\": "polyphyodont",\n \"popularity\": 11936\n },\n {\n \"tag\": "hibernacle",\n \"popularity\": 11921\n },\n {\n \"tag\": "undistend",\n \"popularity\": 11905\n },\n {\n \"tag\": "hystericky",\n \"popularity\": 11890\n },\n {\n \"tag\": "paleolimnology",\n \"popularity\": 11875\n },\n {\n \"tag\": "cedarware",\n \"popularity\": 11859\n },\n {\n \"tag\": "overwrested",\n \"popularity\": 11844\n },\n {\n \"tag\": "Syriacism",\n \"popularity\": 11829\n },\n {\n \"tag\": "pretan",\n \"popularity\": 11813\n },\n {\n \"tag\": "formant",\n \"popularity\": 11798\n },\n {\n \"tag\": "pharmacopoeist Fedia",\n \"popularity\": 11783\n },\n {\n \"tag\": "exorcist eerisome",\n \"popularity\": 11768\n },\n {\n \"tag\": "separation",\n \"popularity\": 11753\n },\n {\n \"tag\": "infancy",\n \"popularity\": 11738\n },\n {\n \"tag\": "ecrasite",\n \"popularity\": 11723\n },\n {\n \"tag\": "propolize",\n \"popularity\": 11708\n },\n {\n \"tag\": "uncram phyllin",\n \"popularity\": 11693\n },\n {\n \"tag\": "thymopathy",\n \"popularity\": 11678\n },\n {\n \"tag\": "omniscient",\n \"popularity\": 11663\n },\n {\n \"tag\": "coussinet hazer",\n \"popularity\": 11648\n },\n {\n \"tag\": "contributiveness",\n \"popularity\": 11633\n },\n {\n \"tag\": "septifluous",\n \"popularity\": 11618\n },\n {\n \"tag\": "halfness",\n \"popularity\": 11603\n },\n {\n \"tag\": "tocher",\n \"popularity\": 11589\n },\n {\n \"tag\": "monotonist",\n \"popularity\": 11574\n },\n {\n \"tag\": "headchair",\n \"popularity\": 11559\n },\n {\n \"tag\": "everywhence",\n \"popularity\": 11544\n },\n {\n \"tag\": "gerate",\n \"popularity\": 11530\n },\n {\n \"tag\": "unrepellent",\n \"popularity\": 11515\n },\n {\n \"tag\": "inidoneous",\n \"popularity\": 11500\n },\n {\n \"tag\": "Rifi",\n \"popularity\": 11486\n },\n {\n \"tag\": "unstop",\n \"popularity\": 11471\n },\n {\n \"tag\": "conformer",\n \"popularity\": 11457\n },\n {\n \"tag\": "vivisectionally",\n \"popularity\": 11442\n },\n {\n \"tag\": "nonfinishing",\n \"popularity\": 11428\n },\n {\n \"tag\": "tyranness",\n \"popularity\": 11413\n },\n {\n \"tag\": "shepherdage havoc",\n \"popularity\": 11399\n },\n {\n \"tag\": "coronale",\n \"popularity\": 11385\n },\n {\n \"tag\": "airmarker",\n \"popularity\": 11370\n },\n {\n \"tag\": "subpanel",\n \"popularity\": 11356\n },\n {\n \"tag\": "conciliation",\n \"popularity\": 11342\n },\n {\n \"tag\": "supergun",\n \"popularity\": 11327\n },\n {\n \"tag\": "photoheliography",\n \"popularity\": 11313\n },\n {\n \"tag\": "cacosmia",\n \"popularity\": 11299\n },\n {\n \"tag\": "caressant",\n \"popularity\": 11285\n },\n {\n \"tag\": "swivet",\n \"popularity\": 11270\n },\n {\n \"tag\": "coddler",\n \"popularity\": 11256\n },\n {\n \"tag\": "rakehellish",\n \"popularity\": 11242\n },\n {\n \"tag\": "recohabitation",\n \"popularity\": 11228\n },\n {\n \"tag\": "postillator",\n \"popularity\": 11214\n },\n {\n \"tag\": "receipt",\n \"popularity\": 11200\n },\n {\n \"tag\": "nonconformistical",\n \"popularity\": 11186\n },\n {\n \"tag\": "unglorified",\n \"popularity\": 11172\n },\n {\n \"tag\": "unordinariness",\n \"popularity\": 11158\n },\n {\n \"tag\": "tetrahydroxy",\n \"popularity\": 11144\n },\n {\n \"tag\": "haploperistomic corporeity",\n \"popularity\": 11130\n },\n {\n \"tag\": "varical",\n \"popularity\": 11117\n },\n {\n \"tag\": "pilferment",\n \"popularity\": 11103\n },\n {\n \"tag\": "reverentially playcraft",\n \"popularity\": 11089\n },\n {\n \"tag\": "unretentive",\n \"popularity\": 11075\n },\n {\n \"tag\": "readiness",\n \"popularity\": 11061\n },\n {\n \"tag\": "thermomagnetism",\n \"popularity\": 11048\n },\n {\n \"tag\": "spotless",\n \"popularity\": 11034\n },\n {\n \"tag\": "semishrubby",\n \"popularity\": 11020\n },\n {\n \"tag\": "metrotomy",\n \"popularity\": 11007\n },\n {\n \"tag\": "hocker",\n \"popularity\": 10993\n },\n {\n \"tag\": "anecdotal",\n \"popularity\": 10979\n },\n {\n \"tag\": "tetrabelodont",\n \"popularity\": 10966\n },\n {\n \"tag\": "Ramillied",\n \"popularity\": 10952\n },\n {\n \"tag\": "sympatheticism",\n \"popularity\": 10939\n },\n {\n \"tag\": "kiskatom",\n \"popularity\": 10925\n },\n {\n \"tag\": "concyclically",\n \"popularity\": 10912\n },\n {\n \"tag\": "tunicless",\n \"popularity\": 10899\n },\n {\n \"tag\": "formalistic",\n \"popularity\": 10885\n },\n {\n \"tag\": "thermacogenesis",\n \"popularity\": 10872\n },\n {\n \"tag\": "multimotored",\n \"popularity\": 10858\n },\n {\n \"tag\": "inversive",\n \"popularity\": 10845\n },\n {\n \"tag\": "Jatki",\n \"popularity\": 10832\n },\n {\n \"tag\": "highest",\n \"popularity\": 10818\n },\n {\n \"tag\": "rubidic",\n \"popularity\": 10805\n },\n {\n \"tag\": "acranial",\n \"popularity\": 10792\n },\n {\n \"tag\": "pulvinulus",\n \"popularity\": 10779\n },\n {\n \"tag\": "nattiness",\n \"popularity\": 10766\n },\n {\n \"tag\": "antisimoniacal",\n \"popularity\": 10752\n },\n {\n \"tag\": "tetanize",\n \"popularity\": 10739\n },\n {\n \"tag\": "spectrophobia",\n \"popularity\": 10726\n },\n {\n \"tag\": "monopolitical",\n \"popularity\": 10713\n },\n {\n \"tag\": "teallite",\n \"popularity\": 10700\n },\n {\n \"tag\": "alicyclic interpellator",\n \"popularity\": 10687\n },\n {\n \"tag\": "nonsynthesized",\n \"popularity\": 10674\n },\n {\n \"tag\": "wheelwrighting",\n \"popularity\": 10661\n },\n {\n \"tag\": "pelliculate",\n \"popularity\": 10648\n },\n {\n \"tag\": "Euphyllopoda",\n \"popularity\": 10635\n },\n {\n \"tag\": "graver",\n \"popularity\": 10622\n },\n {\n \"tag\": "automorph",\n \"popularity\": 10609\n },\n {\n \"tag\": "underhanded",\n \"popularity\": 10597\n },\n {\n \"tag\": "causal",\n \"popularity\": 10584\n },\n {\n \"tag\": "odoom",\n \"popularity\": 10571\n },\n {\n \"tag\": "apodictical",\n \"popularity\": 10558\n },\n {\n \"tag\": "foundery",\n \"popularity\": 10545\n },\n {\n \"tag\": "unneighbored",\n \"popularity\": 10533\n },\n {\n \"tag\": "woolshearing",\n \"popularity\": 10520\n },\n {\n \"tag\": "boschveld",\n \"popularity\": 10507\n },\n {\n \"tag\": "unhardened lipopod",\n \"popularity\": 10495\n },\n {\n \"tag\": "unenriching",\n \"popularity\": 10482\n },\n {\n \"tag\": "spak",\n \"popularity\": 10469\n },\n {\n \"tag\": "yogasana",\n \"popularity\": 10457\n },\n {\n \"tag\": "depoetize",\n \"popularity\": 10444\n },\n {\n \"tag\": "parousiamania",\n \"popularity\": 10432\n },\n {\n \"tag\": "longlegs",\n \"popularity\": 10419\n },\n {\n \"tag\": "gelatinizability",\n \"popularity\": 10407\n },\n {\n \"tag\": "edeology",\n \"popularity\": 10394\n },\n {\n \"tag\": "sodwork",\n \"popularity\": 10382\n },\n {\n \"tag\": "somnambule",\n \"popularity\": 10369\n },\n {\n \"tag\": "antiquing",\n \"popularity\": 10357\n },\n {\n \"tag\": "intaker",\n \"popularity\": 10344\n },\n {\n \"tag\": "Gerberia",\n \"popularity\": 10332\n },\n {\n \"tag\": "preadmit",\n \"popularity\": 10320\n },\n {\n \"tag\": "bullhorn",\n \"popularity\": 10307\n },\n {\n \"tag\": "sororal",\n \"popularity\": 10295\n },\n {\n \"tag\": "phaeophyceous",\n \"popularity\": 10283\n },\n {\n \"tag\": "omphalopsychite",\n \"popularity\": 10271\n },\n {\n \"tag\": "substantious",\n \"popularity\": 10258\n },\n {\n \"tag\": "undemonstratively",\n \"popularity\": 10246\n },\n {\n \"tag\": "corallike blackit",\n \"popularity\": 10234\n },\n {\n \"tag\": "amoebous",\n \"popularity\": 10222\n },\n {\n \"tag\": "Polypodium",\n \"popularity\": 10210\n },\n {\n \"tag\": "blodite",\n \"popularity\": 10198\n },\n {\n \"tag\": "hordarian",\n \"popularity\": 10186\n },\n {\n \"tag\": "nonmoral",\n \"popularity\": 10174\n },\n {\n \"tag\": "dredgeful",\n \"popularity\": 10162\n },\n {\n \"tag\": "nourishingly",\n \"popularity\": 10150\n },\n {\n \"tag\": "seamy",\n \"popularity\": 10138\n },\n {\n \"tag\": "vara",\n \"popularity\": 10126\n },\n {\n \"tag\": "incorruptibleness",\n \"popularity\": 10114\n },\n {\n \"tag\": "manipulator",\n \"popularity\": 10102\n },\n {\n \"tag\": "chromodiascope uncountably",\n \"popularity\": 10090\n },\n {\n \"tag\": "typhemia",\n \"popularity\": 10078\n },\n {\n \"tag\": "Smalcaldic",\n \"popularity\": 10066\n },\n {\n \"tag\": "precontrive",\n \"popularity\": 10054\n },\n {\n \"tag\": "sowarry",\n \"popularity\": 10042\n },\n {\n \"tag\": "monopodic",\n \"popularity\": 10031\n },\n {\n \"tag\": "recodify",\n \"popularity\": 10019\n },\n {\n \"tag\": "phosphowolframic rimple",\n \"popularity\": 10007\n },\n {\n \"tag\": "triconch",\n \"popularity\": 9995\n },\n {\n \"tag\": "pycnodontoid",\n \"popularity\": 9984\n },\n {\n \"tag\": "bradyspermatism",\n \"popularity\": 9972\n },\n {\n \"tag\": "extensionist",\n \"popularity\": 9960\n },\n {\n \"tag\": "characterize",\n \"popularity\": 9949\n },\n {\n \"tag\": "anatreptic proteolytic",\n \"popularity\": 9937\n },\n {\n \"tag\": "waterboard",\n \"popularity\": 9925\n },\n {\n \"tag\": "allopathically",\n \"popularity\": 9914\n },\n {\n \"tag\": "arithmetician",\n \"popularity\": 9902\n },\n {\n \"tag\": "subsist",\n \"popularity\": 9891\n },\n {\n \"tag\": "Islamitish",\n \"popularity\": 9879\n },\n {\n \"tag\": "biddy",\n \"popularity\": 9868\n },\n {\n \"tag\": "reverberation",\n \"popularity\": 9856\n },\n {\n \"tag\": "Zaporogue",\n \"popularity\": 9845\n },\n {\n \"tag\": "soapberry",\n \"popularity\": 9833\n },\n {\n \"tag\": "physiognomics",\n \"popularity\": 9822\n },\n {\n \"tag\": "hospitalization",\n \"popularity\": 9810\n },\n {\n \"tag\": "dissembler",\n \"popularity\": 9799\n },\n {\n \"tag\": "festinate",\n \"popularity\": 9788\n },\n {\n \"tag\": "angiectopia",\n \"popularity\": 9776\n },\n {\n \"tag\": "Pulicidae",\n \"popularity\": 9765\n },\n {\n \"tag\": "beslimer",\n \"popularity\": 9754\n },\n {\n \"tag\": "nontreaty",\n \"popularity\": 9743\n },\n {\n \"tag\": "unhaggled",\n \"popularity\": 9731\n },\n {\n \"tag\": "catfall",\n \"popularity\": 9720\n },\n {\n \"tag\": "stola",\n \"popularity\": 9709\n },\n {\n \"tag\": "pataco",\n \"popularity\": 9698\n },\n {\n \"tag\": "ontologistic",\n \"popularity\": 9686\n },\n {\n \"tag\": "aerosphere",\n \"popularity\": 9675\n },\n {\n \"tag\": "deobstruent",\n \"popularity\": 9664\n },\n {\n \"tag\": "threepence",\n \"popularity\": 9653\n },\n {\n \"tag\": "cyprinoid",\n \"popularity\": 9642\n },\n {\n \"tag\": "overbank",\n \"popularity\": 9631\n },\n {\n \"tag\": "prostyle",\n \"popularity\": 9620\n },\n {\n \"tag\": "photoactivation",\n \"popularity\": 9609\n },\n {\n \"tag\": "homothetic",\n \"popularity\": 9598\n },\n {\n \"tag\": "roguedom",\n \"popularity\": 9587\n },\n {\n \"tag\": "underschool",\n \"popularity\": 9576\n },\n {\n \"tag\": "tractility",\n \"popularity\": 9565\n },\n {\n \"tag\": "gardenin",\n \"popularity\": 9554\n },\n {\n \"tag\": "Micromastictora",\n \"popularity\": 9543\n },\n {\n \"tag\": "gossypine",\n \"popularity\": 9532\n },\n {\n \"tag\": "amylodyspepsia",\n \"popularity\": 9521\n },\n {\n \"tag\": "Luciana",\n \"popularity\": 9510\n },\n {\n \"tag\": "meetly nonfisherman",\n \"popularity\": 9500\n },\n {\n \"tag\": "backhanded",\n \"popularity\": 9489\n },\n {\n \"tag\": "decrustation",\n \"popularity\": 9478\n },\n {\n \"tag\": "pinrail",\n \"popularity\": 9467\n },\n {\n \"tag\": "Mahori",\n \"popularity\": 9456\n },\n {\n \"tag\": "unsizable",\n \"popularity\": 9446\n },\n {\n \"tag\": "disawa",\n \"popularity\": 9435\n },\n {\n \"tag\": "launderability inconsidered",\n \"popularity\": 9424\n },\n {\n \"tag\": "unclassical",\n \"popularity\": 9414\n },\n {\n \"tag\": "inobtrusiveness",\n \"popularity\": 9403\n },\n {\n \"tag\": "sialogenous",\n \"popularity\": 9392\n },\n {\n \"tag\": "sulphonamide",\n \"popularity\": 9382\n },\n {\n \"tag\": "diluvion",\n \"popularity\": 9371\n },\n {\n \"tag\": "deuteranope",\n \"popularity\": 9361\n },\n {\n \"tag\": "addition",\n \"popularity\": 9350\n },\n {\n \"tag\": "bockeret",\n \"popularity\": 9339\n },\n {\n \"tag\": "unidentified",\n \"popularity\": 9329\n },\n {\n \"tag\": "caryatic",\n \"popularity\": 9318\n },\n {\n \"tag\": "misattribution",\n \"popularity\": 9308\n },\n {\n \"tag\": "outray",\n \"popularity\": 9297\n },\n {\n \"tag\": "areometrical",\n \"popularity\": 9287\n },\n {\n \"tag\": "antilogism",\n \"popularity\": 9277\n },\n {\n \"tag\": "inadjustable",\n \"popularity\": 9266\n },\n {\n \"tag\": "byssus",\n \"popularity\": 9256\n },\n {\n \"tag\": "trun",\n \"popularity\": 9245\n },\n {\n \"tag\": "thereology",\n \"popularity\": 9235\n },\n {\n \"tag\": "extort",\n \"popularity\": 9225\n },\n {\n \"tag\": "bumpkin",\n \"popularity\": 9214\n },\n {\n \"tag\": "sulphobenzide",\n \"popularity\": 9204\n },\n {\n \"tag\": "hydrogeology",\n \"popularity\": 9194\n },\n {\n \"tag\": "nidulariaceous",\n \"popularity\": 9183\n },\n {\n \"tag\": "propodiale",\n \"popularity\": 9173\n },\n {\n \"tag\": "fierily",\n \"popularity\": 9163\n },\n {\n \"tag\": "aerotonometry",\n \"popularity\": 9153\n },\n {\n \"tag\": "pelobatid oversuperstitious",\n \"popularity\": 9142\n },\n {\n \"tag\": "restringent",\n \"popularity\": 9132\n },\n {\n \"tag\": "tetrapodic",\n \"popularity\": 9122\n },\n {\n \"tag\": "heroicness Vendidad",\n \"popularity\": 9112\n },\n {\n \"tag\": "Sphingurus",\n \"popularity\": 9102\n },\n {\n \"tag\": "sclerote",\n \"popularity\": 9092\n },\n {\n \"tag\": "unkeyed",\n \"popularity\": 9082\n },\n {\n \"tag\": "superparliamentary",\n \"popularity\": 9072\n },\n {\n \"tag\": "hetericism",\n \"popularity\": 9061\n },\n {\n \"tag\": "hucklebone",\n \"popularity\": 9051\n },\n {\n \"tag\": "yojan",\n \"popularity\": 9041\n },\n {\n \"tag\": "bossed",\n \"popularity\": 9031\n },\n {\n \"tag\": "spiderwork",\n \"popularity\": 9021\n },\n {\n \"tag\": "millfeed dullery",\n \"popularity\": 9011\n },\n {\n \"tag\": "adnoun",\n \"popularity\": 9001\n },\n {\n \"tag\": "mesometric",\n \"popularity\": 8992\n },\n {\n \"tag\": "doublehandedness",\n \"popularity\": 8982\n },\n {\n \"tag\": "suppurant",\n \"popularity\": 8972\n },\n {\n \"tag\": "Berlinize",\n \"popularity\": 8962\n },\n {\n \"tag\": "sontag",\n \"popularity\": 8952\n },\n {\n \"tag\": "biplane",\n \"popularity\": 8942\n },\n {\n \"tag\": "insula",\n \"popularity\": 8932\n },\n {\n \"tag\": "unbrand",\n \"popularity\": 8922\n },\n {\n \"tag\": "Basilosaurus",\n \"popularity\": 8913\n },\n {\n \"tag\": "prenomination",\n \"popularity\": 8903\n },\n {\n \"tag\": "untextual",\n \"popularity\": 8893\n },\n {\n \"tag\": "coleslaw",\n \"popularity\": 8883\n },\n {\n \"tag\": "langsyne",\n \"popularity\": 8874\n },\n {\n \"tag\": "impede",\n \"popularity\": 8864\n },\n {\n \"tag\": "irrigator",\n \"popularity\": 8854\n },\n {\n \"tag\": "deflocculation",\n \"popularity\": 8844\n },\n {\n \"tag\": "narghile",\n \"popularity\": 8835\n },\n {\n \"tag\": "unguardedly ebenaceous",\n \"popularity\": 8825\n },\n {\n \"tag\": "conversantly subocular",\n \"popularity\": 8815\n },\n {\n \"tag\": "hydroponic",\n \"popularity\": 8806\n },\n {\n \"tag\": "anthropopsychism",\n \"popularity\": 8796\n },\n {\n \"tag\": "panoptic",\n \"popularity\": 8787\n },\n {\n \"tag\": "insufferable",\n \"popularity\": 8777\n },\n {\n \"tag\": "salema",\n \"popularity\": 8768\n },\n {\n \"tag\": "Myriapoda",\n \"popularity\": 8758\n },\n {\n \"tag\": "regarrison",\n \"popularity\": 8748\n },\n {\n \"tag\": "overlearned",\n \"popularity\": 8739\n },\n {\n \"tag\": "ultraroyalist conventical bureaucratical",\n \"popularity\": 8729\n },\n {\n \"tag\": "epicaridan",\n \"popularity\": 8720\n },\n {\n \"tag\": "poetastress",\n \"popularity\": 8711\n },\n {\n \"tag\": "monophthalmus",\n \"popularity\": 8701\n },\n {\n \"tag\": "simnel",\n \"popularity\": 8692\n },\n {\n \"tag\": "compotor",\n \"popularity\": 8682\n },\n {\n \"tag\": "hydrolase",\n \"popularity\": 8673\n },\n {\n \"tag\": "attemptless",\n \"popularity\": 8663\n },\n {\n \"tag\": "visceroptosis",\n \"popularity\": 8654\n },\n {\n \"tag\": "unpreparedly",\n \"popularity\": 8645\n },\n {\n \"tag\": "mastage",\n \"popularity\": 8635\n },\n {\n \"tag\": "preinfluence",\n \"popularity\": 8626\n },\n {\n \"tag\": "Siwan",\n \"popularity\": 8617\n },\n {\n \"tag\": "ceratotheca belvedere",\n \"popularity\": 8607\n },\n {\n \"tag\": "disenablement",\n \"popularity\": 8598\n },\n {\n \"tag\": "nine",\n \"popularity\": 8589\n },\n {\n \"tag\": "spellingdown abridgment",\n \"popularity\": 8580\n },\n {\n \"tag\": "twilightless",\n \"popularity\": 8571\n },\n {\n \"tag\": "overflow",\n \"popularity\": 8561\n },\n {\n \"tag\": "mismeasurement",\n \"popularity\": 8552\n },\n {\n \"tag\": "nawabship",\n \"popularity\": 8543\n },\n {\n \"tag\": "Phrynosoma",\n \"popularity\": 8534\n },\n {\n \"tag\": "unanticipatingly",\n \"popularity\": 8525\n },\n {\n \"tag\": "blankite",\n \"popularity\": 8516\n },\n {\n \"tag\": "role",\n \"popularity\": 8506\n },\n {\n \"tag\": "peperine edelweiss",\n \"popularity\": 8497\n },\n {\n \"tag\": "unhysterical",\n \"popularity\": 8488\n },\n {\n \"tag\": "attentiveness",\n \"popularity\": 8479\n },\n {\n \"tag\": "scintillant",\n \"popularity\": 8470\n },\n {\n \"tag\": "stenostomatous",\n \"popularity\": 8461\n },\n {\n \"tag\": "pectinite",\n \"popularity\": 8452\n },\n {\n \"tag\": "herring",\n \"popularity\": 8443\n },\n {\n \"tag\": "interroom",\n \"popularity\": 8434\n },\n {\n \"tag\": "laccol",\n \"popularity\": 8425\n },\n {\n \"tag\": "unpartably kylite",\n \"popularity\": 8416\n },\n {\n \"tag\": "spirivalve",\n \"popularity\": 8407\n },\n {\n \"tag\": "hoosegow",\n \"popularity\": 8398\n },\n {\n \"tag\": "doat",\n \"popularity\": 8389\n },\n {\n \"tag\": "amphibian",\n \"popularity\": 8380\n },\n {\n \"tag\": "exposit",\n \"popularity\": 8371\n },\n {\n \"tag\": "canopy",\n \"popularity\": 8363\n },\n {\n \"tag\": "houndlike",\n \"popularity\": 8354\n },\n {\n \"tag\": "spikebill",\n \"popularity\": 8345\n },\n {\n \"tag\": "wiseacre pyrotechnic",\n \"popularity\": 8336\n },\n {\n \"tag\": "confessingly woodman",\n \"popularity\": 8327\n },\n {\n \"tag\": "overside",\n \"popularity\": 8318\n },\n {\n \"tag\": "oftwhiles",\n \"popularity\": 8310\n },\n {\n \"tag\": "Musophagidae",\n \"popularity\": 8301\n },\n {\n \"tag\": "slumberer",\n \"popularity\": 8292\n },\n {\n \"tag\": "leiotrichy",\n \"popularity\": 8283\n },\n {\n \"tag\": "Mantispidae",\n \"popularity\": 8275\n },\n {\n \"tag\": "perceptually",\n \"popularity\": 8266\n },\n {\n \"tag\": "biller",\n \"popularity\": 8257\n },\n {\n \"tag\": "eudaemonical",\n \"popularity\": 8249\n },\n {\n \"tag\": "underfiend",\n \"popularity\": 8240\n },\n {\n \"tag\": "impartible",\n \"popularity\": 8231\n },\n {\n \"tag\": "saxicavous",\n \"popularity\": 8223\n },\n {\n \"tag\": "yapster",\n \"popularity\": 8214\n },\n {\n \"tag\": "aliseptal",\n \"popularity\": 8205\n },\n {\n \"tag\": "omniparient",\n \"popularity\": 8197\n },\n {\n \"tag\": "nishiki",\n \"popularity\": 8188\n },\n {\n \"tag\": "yuzluk",\n \"popularity\": 8180\n },\n {\n \"tag\": "solderer",\n \"popularity\": 8171\n },\n {\n \"tag\": "Pinna",\n \"popularity\": 8162\n },\n {\n \"tag\": "reinterfere",\n \"popularity\": 8154\n },\n {\n \"tag\": "superepic",\n \"popularity\": 8145\n },\n {\n \"tag\": "ronquil",\n \"popularity\": 8137\n },\n {\n \"tag\": "bratstvo",\n \"popularity\": 8128\n },\n {\n \"tag\": "Thea",\n \"popularity\": 8120\n },\n {\n \"tag\": "hermaphroditical",\n \"popularity\": 8111\n },\n {\n \"tag\": "enlief",\n \"popularity\": 8103\n },\n {\n \"tag\": "Jesuate",\n \"popularity\": 8095\n },\n {\n \"tag\": "gaysome",\n \"popularity\": 8086\n },\n {\n \"tag\": "iliohypogastric",\n \"popularity\": 8078\n },\n {\n \"tag\": "regardance",\n \"popularity\": 8069\n },\n {\n \"tag\": "cumulately",\n \"popularity\": 8061\n },\n {\n \"tag\": "haustorial nucleolocentrosome",\n \"popularity\": 8053\n },\n {\n \"tag\": "cosmocrat",\n \"popularity\": 8044\n },\n {\n \"tag\": "onyxitis",\n \"popularity\": 8036\n },\n {\n \"tag\": "Cabinda",\n \"popularity\": 8028\n },\n {\n \"tag\": "coresort",\n \"popularity\": 8019\n },\n {\n \"tag\": "drusy preformant",\n \"popularity\": 8011\n },\n {\n \"tag\": "piningly",\n \"popularity\": 8003\n },\n {\n \"tag\": "bootlessly",\n \"popularity\": 7994\n },\n {\n \"tag\": "talari",\n \"popularity\": 7986\n },\n {\n \"tag\": "amidoacetal",\n \"popularity\": 7978\n },\n {\n \"tag\": "pschent",\n \"popularity\": 7970\n },\n {\n \"tag\": "consumptional scarer titivate",\n \"popularity\": 7962\n },\n {\n \"tag\": "Anserinae",\n \"popularity\": 7953\n },\n {\n \"tag\": "flaunter",\n \"popularity\": 7945\n },\n {\n \"tag\": "reindeer",\n \"popularity\": 7937\n },\n {\n \"tag\": "disparage",\n \"popularity\": 7929\n },\n {\n \"tag\": "superheat",\n \"popularity\": 7921\n },\n {\n \"tag\": "Chromatium",\n \"popularity\": 7912\n },\n {\n \"tag\": "Tina",\n \"popularity\": 7904\n },\n {\n \"tag\": "rededicatory",\n \"popularity\": 7896\n },\n {\n \"tag\": "nontransient",\n \"popularity\": 7888\n },\n {\n \"tag\": "Phocaean brinkless",\n \"popularity\": 7880\n },\n {\n \"tag\": "ventriculose",\n \"popularity\": 7872\n },\n {\n \"tag\": "upplough",\n \"popularity\": 7864\n },\n {\n \"tag\": "succorless",\n \"popularity\": 7856\n },\n {\n \"tag\": "hayrake",\n \"popularity\": 7848\n },\n {\n \"tag\": "merriness amorphia",\n \"popularity\": 7840\n },\n {\n \"tag\": "merycism",\n \"popularity\": 7832\n },\n {\n \"tag\": "checkrow",\n \"popularity\": 7824\n },\n {\n \"tag\": "scry",\n \"popularity\": 7816\n },\n {\n \"tag\": "obvolve",\n \"popularity\": 7808\n },\n {\n \"tag\": "orchard",\n \"popularity\": 7800\n },\n {\n \"tag\": "isomerize",\n \"popularity\": 7792\n },\n {\n \"tag\": "competitrix",\n \"popularity\": 7784\n },\n {\n \"tag\": "unbannered",\n \"popularity\": 7776\n },\n {\n \"tag\": "undoctrined",\n \"popularity\": 7768\n },\n {\n \"tag\": "theologian",\n \"popularity\": 7760\n },\n {\n \"tag\": "nebby",\n \"popularity\": 7752\n },\n {\n \"tag\": "Cardiazol",\n \"popularity\": 7745\n },\n {\n \"tag\": "phagedenic",\n \"popularity\": 7737\n },\n {\n \"tag\": "nostalgic",\n \"popularity\": 7729\n },\n {\n \"tag\": "orthodoxy",\n \"popularity\": 7721\n },\n {\n \"tag\": "oversanguine",\n \"popularity\": 7713\n },\n {\n \"tag\": "lish",\n \"popularity\": 7705\n },\n {\n \"tag\": "ketogenic",\n \"popularity\": 7698\n },\n {\n \"tag\": "syndicalize",\n \"popularity\": 7690\n },\n {\n \"tag\": "leeftail",\n \"popularity\": 7682\n },\n {\n \"tag\": "bulbomedullary",\n \"popularity\": 7674\n },\n {\n \"tag\": "reletter",\n \"popularity\": 7667\n },\n {\n \"tag\": "bitterly",\n \"popularity\": 7659\n },\n {\n \"tag\": "participatory",\n \"popularity\": 7651\n },\n {\n \"tag\": "baldberry",\n \"popularity\": 7643\n },\n {\n \"tag\": "prowaterpower",\n \"popularity\": 7636\n },\n {\n \"tag\": "lexicographical",\n \"popularity\": 7628\n },\n {\n \"tag\": "Anisodactyli",\n \"popularity\": 7620\n },\n {\n \"tag\": "amphipodous",\n \"popularity\": 7613\n },\n {\n \"tag\": "triglandular",\n \"popularity\": 7605\n },\n {\n \"tag\": "xanthopsin",\n \"popularity\": 7597\n },\n {\n \"tag\": "indefinitude",\n \"popularity\": 7590\n },\n {\n \"tag\": "bookworm",\n \"popularity\": 7582\n },\n {\n \"tag\": "suffocative",\n \"popularity\": 7574\n },\n {\n \"tag\": "uncongested tyrant",\n \"popularity\": 7567\n },\n {\n \"tag\": "alow harmoniously Pamir",\n \"popularity\": 7559\n },\n {\n \"tag\": "monander",\n \"popularity\": 7552\n },\n {\n \"tag\": "bagatelle",\n \"popularity\": 7544\n },\n {\n \"tag\": "membranology",\n \"popularity\": 7537\n },\n {\n \"tag\": "parturifacient",\n \"popularity\": 7529\n },\n {\n \"tag\": "excitovascular",\n \"popularity\": 7522\n },\n {\n \"tag\": "homopolar",\n \"popularity\": 7514\n },\n {\n \"tag\": "phobiac",\n \"popularity\": 7507\n },\n {\n \"tag\": "clype",\n \"popularity\": 7499\n },\n {\n \"tag\": "unsubversive",\n \"popularity\": 7492\n },\n {\n \"tag\": "bostrychoidal scorpionwort",\n \"popularity\": 7484\n },\n {\n \"tag\": "biliteralism",\n \"popularity\": 7477\n },\n {\n \"tag\": "dentatocostate",\n \"popularity\": 7469\n },\n {\n \"tag\": "Pici",\n \"popularity\": 7462\n },\n {\n \"tag\": "sideritic",\n \"popularity\": 7454\n },\n {\n \"tag\": "syntaxis",\n \"popularity\": 7447\n },\n {\n \"tag\": "ingest",\n \"popularity\": 7440\n },\n {\n \"tag\": "rigmarolish",\n \"popularity\": 7432\n },\n {\n \"tag\": "ocreaceous",\n \"popularity\": 7425\n },\n {\n \"tag\": "hyperbrachyskelic",\n \"popularity\": 7418\n },\n {\n \"tag\": "basophobia",\n \"popularity\": 7410\n },\n {\n \"tag\": "substantialness",\n \"popularity\": 7403\n },\n {\n \"tag\": "agglutinoid",\n \"popularity\": 7396\n },\n {\n \"tag\": "longleaf",\n \"popularity\": 7388\n },\n {\n \"tag\": "electroengraving",\n \"popularity\": 7381\n },\n {\n \"tag\": "laparoenterotomy",\n \"popularity\": 7374\n },\n {\n \"tag\": "oxalylurea",\n \"popularity\": 7366\n },\n {\n \"tag\": "unattaintedly",\n \"popularity\": 7359\n },\n {\n \"tag\": "pennystone",\n \"popularity\": 7352\n },\n {\n \"tag\": "Plumbaginaceae",\n \"popularity\": 7345\n },\n {\n \"tag\": "horntip",\n \"popularity\": 7337\n },\n {\n \"tag\": "begrudge",\n \"popularity\": 7330\n },\n {\n \"tag\": "bechignoned",\n \"popularity\": 7323\n },\n {\n \"tag\": "hologonidium",\n \"popularity\": 7316\n },\n {\n \"tag\": "Pulian",\n \"popularity\": 7309\n },\n {\n \"tag\": "gratulation",\n \"popularity\": 7301\n },\n {\n \"tag\": "Sebright",\n \"popularity\": 7294\n },\n {\n \"tag\": "coinstantaneous emotionally",\n \"popularity\": 7287\n },\n {\n \"tag\": "thoracostracan",\n \"popularity\": 7280\n },\n {\n \"tag\": "saurodont",\n \"popularity\": 7273\n },\n {\n \"tag\": "coseat",\n \"popularity\": 7266\n },\n {\n \"tag\": "irascibility",\n \"popularity\": 7259\n },\n {\n \"tag\": "occlude",\n \"popularity\": 7251\n },\n {\n \"tag\": "metallurgist",\n \"popularity\": 7244\n },\n {\n \"tag\": "extraviolet",\n \"popularity\": 7237\n },\n {\n \"tag\": "clinic",\n \"popularity\": 7230\n },\n {\n \"tag\": "skater",\n \"popularity\": 7223\n },\n {\n \"tag\": "linguistic",\n \"popularity\": 7216\n },\n {\n \"tag\": "attacheship",\n \"popularity\": 7209\n },\n {\n \"tag\": "Rachianectes",\n \"popularity\": 7202\n },\n {\n \"tag\": "foliolose",\n \"popularity\": 7195\n },\n {\n \"tag\": "claudetite",\n \"popularity\": 7188\n },\n {\n \"tag\": "aphidian scratching",\n \"popularity\": 7181\n },\n {\n \"tag\": "Carida",\n \"popularity\": 7174\n },\n {\n \"tag\": "tiepin polymicroscope",\n \"popularity\": 7167\n },\n {\n \"tag\": "telpherage",\n \"popularity\": 7160\n },\n {\n \"tag\": "meek",\n \"popularity\": 7153\n },\n {\n \"tag\": "swiftness",\n \"popularity\": 7146\n },\n {\n \"tag\": "gentes",\n \"popularity\": 7139\n },\n {\n \"tag\": "uncommemorated",\n \"popularity\": 7132\n },\n {\n \"tag\": "Lazarus",\n \"popularity\": 7125\n },\n {\n \"tag\": "redivive",\n \"popularity\": 7119\n },\n {\n \"tag\": "nonfebrile",\n \"popularity\": 7112\n },\n {\n \"tag\": "nymphet",\n \"popularity\": 7105\n },\n {\n \"tag\": "areologically",\n \"popularity\": 7098\n },\n {\n \"tag\": "undonkey",\n \"popularity\": 7091\n },\n {\n \"tag\": "projecting",\n \"popularity\": 7084\n },\n {\n \"tag\": "pinnigrade",\n \"popularity\": 7077\n },\n {\n \"tag\": "butylation",\n \"popularity\": 7071\n },\n {\n \"tag\": "philologistic lenticle",\n \"popularity\": 7064\n },\n {\n \"tag\": "nooky",\n \"popularity\": 7057\n },\n {\n \"tag\": "incestuousness",\n \"popularity\": 7050\n },\n {\n \"tag\": "palingenetically",\n \"popularity\": 7043\n },\n {\n \"tag\": "mitochondria",\n \"popularity\": 7037\n },\n {\n \"tag\": "truthify",\n \"popularity\": 7030\n },\n {\n \"tag\": "titanyl",\n \"popularity\": 7023\n },\n {\n \"tag\": "bestride",\n \"popularity\": 7016\n },\n {\n \"tag\": "chende",\n \"popularity\": 7010\n },\n {\n \"tag\": "Chaucerian monophote",\n \"popularity\": 7003\n },\n {\n \"tag\": "cutback",\n \"popularity\": 6996\n },\n {\n \"tag\": "unpatiently",\n \"popularity\": 6989\n },\n {\n \"tag\": "subvitreous",\n \"popularity\": 6983\n },\n {\n \"tag\": "organizable",\n \"popularity\": 6976\n },\n {\n \"tag\": "anniverse uncomprehensible",\n \"popularity\": 6969\n },\n {\n \"tag\": "hyalescence",\n \"popularity\": 6963\n },\n {\n \"tag\": "amniochorial",\n \"popularity\": 6956\n },\n {\n \"tag\": "Corybantian",\n \"popularity\": 6949\n },\n {\n \"tag\": "genocide Scaphitidae",\n \"popularity\": 6943\n },\n {\n \"tag\": "accordionist",\n \"popularity\": 6936\n },\n {\n \"tag\": "becheck",\n \"popularity\": 6930\n },\n {\n \"tag\": "overproduce",\n \"popularity\": 6923\n },\n {\n \"tag\": "unmaniac frijolillo",\n \"popularity\": 6916\n },\n {\n \"tag\": "multisulcated",\n \"popularity\": 6910\n },\n {\n \"tag\": "wennebergite",\n \"popularity\": 6903\n },\n {\n \"tag\": "tautousious mowth",\n \"popularity\": 6897\n },\n {\n \"tag\": "marigold",\n \"popularity\": 6890\n },\n {\n \"tag\": "affray",\n \"popularity\": 6884\n },\n {\n \"tag\": "nonidolatrous",\n \"popularity\": 6877\n },\n {\n \"tag\": "aphrasia",\n \"popularity\": 6871\n },\n {\n \"tag\": "muddlingly",\n \"popularity\": 6864\n },\n {\n \"tag\": "clear",\n \"popularity\": 6858\n },\n {\n \"tag\": "Clitoria",\n \"popularity\": 6851\n },\n {\n \"tag\": "apportionment underwaist",\n \"popularity\": 6845\n },\n {\n \"tag\": "kodakist",\n \"popularity\": 6838\n },\n {\n \"tag\": "Momotidae",\n \"popularity\": 6832\n },\n {\n \"tag\": "cryptovalency",\n \"popularity\": 6825\n },\n {\n \"tag\": "floe",\n \"popularity\": 6819\n },\n {\n \"tag\": "aphagia",\n \"popularity\": 6812\n },\n {\n \"tag\": "brontograph",\n \"popularity\": 6806\n },\n {\n \"tag\": "tubulous",\n \"popularity\": 6799\n },\n {\n \"tag\": "unhorse",\n \"popularity\": 6793\n },\n {\n \"tag\": "chlordane",\n \"popularity\": 6787\n },\n {\n \"tag\": "colloquy brochan",\n \"popularity\": 6780\n },\n {\n \"tag\": "sloosh",\n \"popularity\": 6774\n },\n {\n \"tag\": "battered",\n \"popularity\": 6767\n },\n {\n \"tag\": "monocularity pluriguttulate",\n \"popularity\": 6761\n },\n {\n \"tag\": "chiastoneury",\n \"popularity\": 6755\n },\n {\n \"tag\": "Sanguinaria",\n \"popularity\": 6748\n },\n {\n \"tag\": "confessionary",\n \"popularity\": 6742\n },\n {\n \"tag\": "enzymic",\n \"popularity\": 6736\n },\n {\n \"tag\": "cord",\n \"popularity\": 6729\n },\n {\n \"tag\": "oviducal",\n \"popularity\": 6723\n },\n {\n \"tag\": "crozzle outsea",\n \"popularity\": 6717\n },\n {\n \"tag\": "balladical",\n \"popularity\": 6710\n },\n {\n \"tag\": "uncollectibleness",\n \"popularity\": 6704\n },\n {\n \"tag\": "predorsal",\n \"popularity\": 6698\n },\n {\n \"tag\": "reauthenticate",\n \"popularity\": 6692\n },\n {\n \"tag\": "ravissant",\n \"popularity\": 6685\n },\n {\n \"tag\": "advantageousness",\n \"popularity\": 6679\n },\n {\n \"tag\": "rung",\n \"popularity\": 6673\n },\n {\n \"tag\": "duncedom",\n \"popularity\": 6667\n },\n {\n \"tag\": "hematolite",\n \"popularity\": 6660\n },\n {\n \"tag\": "thisness",\n \"popularity\": 6654\n },\n {\n \"tag\": "mapau",\n \"popularity\": 6648\n },\n {\n \"tag\": "Hecatic",\n \"popularity\": 6642\n },\n {\n \"tag\": "meningoencephalocele",\n \"popularity\": 6636\n },\n {\n \"tag\": "confection sorra",\n \"popularity\": 6630\n },\n {\n \"tag\": "unsedate",\n \"popularity\": 6623\n },\n {\n \"tag\": "meningocerebritis",\n \"popularity\": 6617\n },\n {\n \"tag\": "biopsychological",\n \"popularity\": 6611\n },\n {\n \"tag\": "clavicithern",\n \"popularity\": 6605\n },\n {\n \"tag\": "resun",\n \"popularity\": 6599\n },\n {\n \"tag\": "bayamo",\n \"popularity\": 6593\n },\n {\n \"tag\": "seeableness",\n \"popularity\": 6587\n },\n {\n \"tag\": "hypsidolichocephalism",\n \"popularity\": 6581\n },\n {\n \"tag\": "salivous",\n \"popularity\": 6574\n },\n {\n \"tag\": "neumatize",\n \"popularity\": 6568\n },\n {\n \"tag\": "stree",\n \"popularity\": 6562\n },\n {\n \"tag\": "markshot",\n \"popularity\": 6556\n },\n {\n \"tag\": "phraseologically",\n \"popularity\": 6550\n },\n {\n \"tag\": "yealing",\n \"popularity\": 6544\n },\n {\n \"tag\": "puggy",\n \"popularity\": 6538\n },\n {\n \"tag\": "sexadecimal",\n \"popularity\": 6532\n },\n {\n \"tag\": "unofficerlike",\n \"popularity\": 6526\n },\n {\n \"tag\": "curiosa",\n \"popularity\": 6520\n },\n {\n \"tag\": "pedomotor",\n \"popularity\": 6514\n },\n {\n \"tag\": "astrally",\n \"popularity\": 6508\n },\n {\n \"tag\": "prosomatic",\n \"popularity\": 6502\n },\n {\n \"tag\": "bulletheaded",\n \"popularity\": 6496\n },\n {\n \"tag\": "fortuned",\n \"popularity\": 6490\n },\n {\n \"tag\": "pixy",\n \"popularity\": 6484\n },\n {\n \"tag\": "protectrix",\n \"popularity\": 6478\n },\n {\n \"tag\": "arthritical",\n \"popularity\": 6472\n },\n {\n \"tag\": "coction",\n \"popularity\": 6466\n },\n {\n \"tag\": "Anthropos",\n \"popularity\": 6460\n },\n {\n \"tag\": "runer",\n \"popularity\": 6454\n },\n {\n \"tag\": "prenotify",\n \"popularity\": 6449\n },\n {\n \"tag\": "microspheric gastroparalysis",\n \"popularity\": 6443\n },\n {\n \"tag\": "Jovicentrical",\n \"popularity\": 6437\n },\n {\n \"tag\": "ceratopsid",\n \"popularity\": 6431\n },\n {\n \"tag\": "Theodoric",\n \"popularity\": 6425\n },\n {\n \"tag\": "Pactolus",\n \"popularity\": 6419\n },\n {\n \"tag\": "spawning",\n \"popularity\": 6413\n },\n {\n \"tag\": "nonconfidential",\n \"popularity\": 6407\n },\n {\n \"tag\": "halotrichite infumate",\n \"popularity\": 6402\n },\n {\n \"tag\": "undiscriminatingly",\n \"popularity\": 6396\n },\n {\n \"tag\": "unexasperated",\n \"popularity\": 6390\n },\n {\n \"tag\": "isoeugenol",\n \"popularity\": 6384\n },\n {\n \"tag\": "pressboard",\n \"popularity\": 6378\n },\n {\n \"tag\": "unshrew",\n \"popularity\": 6372\n },\n {\n \"tag\": "huffingly",\n \"popularity\": 6367\n },\n {\n \"tag\": "wagaun",\n \"popularity\": 6361\n },\n {\n \"tag\": "squirt Philistine",\n \"popularity\": 6355\n },\n {\n \"tag\": "kryptic",\n \"popularity\": 6349\n },\n {\n \"tag\": "paraform",\n \"popularity\": 6344\n },\n {\n \"tag\": "preverify",\n \"popularity\": 6338\n },\n {\n \"tag\": "dalar",\n \"popularity\": 6332\n },\n {\n \"tag\": "interdictor appraisingly",\n \"popularity\": 6326\n },\n {\n \"tag\": "chipped",\n \"popularity\": 6321\n },\n {\n \"tag\": "Pteropoda",\n \"popularity\": 6315\n },\n {\n \"tag\": "Bohairic",\n \"popularity\": 6309\n },\n {\n \"tag\": "felting",\n \"popularity\": 6303\n },\n {\n \"tag\": "compurgatorial",\n \"popularity\": 6298\n },\n {\n \"tag\": "unclead",\n \"popularity\": 6292\n },\n {\n \"tag\": "stockish",\n \"popularity\": 6286\n },\n {\n \"tag\": "mulligatawny",\n \"popularity\": 6281\n },\n {\n \"tag\": "Monotheletism",\n \"popularity\": 6275\n },\n {\n \"tag\": "lutanist",\n \"popularity\": 6269\n },\n {\n \"tag\": "gluttonize",\n \"popularity\": 6264\n },\n {\n \"tag\": "hackneyed",\n \"popularity\": 6258\n },\n {\n \"tag\": "yield",\n \"popularity\": 6253\n },\n {\n \"tag\": "sulphonamido",\n \"popularity\": 6247\n },\n {\n \"tag\": "granulative",\n \"popularity\": 6241\n },\n {\n \"tag\": "swingy",\n \"popularity\": 6236\n },\n {\n \"tag\": "Desmidiales",\n \"popularity\": 6230\n },\n {\n \"tag\": "tootlish",\n \"popularity\": 6224\n },\n {\n \"tag\": "unsatisfiedly",\n \"popularity\": 6219\n },\n {\n \"tag\": "burucha",\n \"popularity\": 6213\n },\n {\n \"tag\": "premeditatingly",\n \"popularity\": 6208\n },\n {\n \"tag\": "cowrie",\n \"popularity\": 6202\n },\n {\n \"tag\": "pleurolysis",\n \"popularity\": 6197\n },\n {\n \"tag\": "nationalist",\n \"popularity\": 6191\n },\n {\n \"tag\": "Pholadacea",\n \"popularity\": 6186\n },\n {\n \"tag\": "anakrousis",\n \"popularity\": 6180\n },\n {\n \"tag\": "proctorial",\n \"popularity\": 6175\n },\n {\n \"tag\": "cavillation",\n \"popularity\": 6169\n },\n {\n \"tag\": "cervicobregmatic",\n \"popularity\": 6163\n },\n {\n \"tag\": "interspecific",\n \"popularity\": 6158\n },\n {\n \"tag\": "Teutonity",\n \"popularity\": 6152\n },\n {\n \"tag\": "snakeholing",\n \"popularity\": 6147\n },\n {\n \"tag\": "balcony",\n \"popularity\": 6142\n },\n {\n \"tag\": "latchless",\n \"popularity\": 6136\n },\n {\n \"tag\": "Mithraea",\n \"popularity\": 6131\n },\n {\n \"tag\": "pseudepigraph",\n \"popularity\": 6125\n },\n {\n \"tag\": "flosser",\n \"popularity\": 6120\n },\n {\n \"tag\": "kotyle",\n \"popularity\": 6114\n },\n {\n \"tag\": "outdo",\n \"popularity\": 6109\n },\n {\n \"tag\": "interclerical",\n \"popularity\": 6103\n },\n {\n \"tag\": "aurar",\n \"popularity\": 6098\n },\n {\n \"tag\": "apophyseal",\n \"popularity\": 6093\n },\n {\n \"tag\": "Miro",\n \"popularity\": 6087\n },\n {\n \"tag\": "Priscillian",\n \"popularity\": 6082\n },\n {\n \"tag\": "alluvia",\n \"popularity\": 6076\n },\n {\n \"tag\": "exordize",\n \"popularity\": 6071\n },\n {\n \"tag\": "breakage",\n \"popularity\": 6066\n },\n {\n \"tag\": "unclosable",\n \"popularity\": 6060\n },\n {\n \"tag\": "monocondylous",\n \"popularity\": 6055\n },\n {\n \"tag\": "dyarchy",\n \"popularity\": 6050\n },\n {\n \"tag\": "subchelate",\n \"popularity\": 6044\n },\n {\n \"tag\": "hearsay",\n \"popularity\": 6039\n },\n {\n \"tag\": "prestigiously",\n \"popularity\": 6034\n },\n {\n \"tag\": "unimuscular",\n \"popularity\": 6028\n },\n {\n \"tag\": "lingwort",\n \"popularity\": 6023\n },\n {\n \"tag\": "jealous",\n \"popularity\": 6018\n },\n {\n \"tag\": "artilleryman",\n \"popularity\": 6012\n },\n {\n \"tag\": "phantasmagorially",\n \"popularity\": 6007\n },\n {\n \"tag\": "stagnum",\n \"popularity\": 6002\n },\n {\n \"tag\": "organotropism shatteringly",\n \"popularity\": 5997\n },\n {\n \"tag\": "Mytilus Hebraist",\n \"popularity\": 5991\n },\n {\n \"tag\": "returf",\n \"popularity\": 5986\n },\n {\n \"tag\": "townfolk",\n \"popularity\": 5981\n },\n {\n \"tag\": "propitiative",\n \"popularity\": 5976\n },\n {\n \"tag\": "Anita unsullied",\n \"popularity\": 5970\n },\n {\n \"tag\": "bandoleered",\n \"popularity\": 5965\n },\n {\n \"tag\": "cubby",\n \"popularity\": 5960\n },\n {\n \"tag\": "Hexanchus",\n \"popularity\": 5955\n },\n {\n \"tag\": "circuminsular",\n \"popularity\": 5949\n },\n {\n \"tag\": "chamberletted eumycete",\n \"popularity\": 5944\n },\n {\n \"tag\": "secure",\n \"popularity\": 5939\n },\n {\n \"tag\": "Edwardean",\n \"popularity\": 5934\n },\n {\n \"tag\": "strenth",\n \"popularity\": 5929\n },\n {\n \"tag\": "exhaustless",\n \"popularity\": 5923\n },\n {\n \"tag\": "electioneerer",\n \"popularity\": 5918\n },\n {\n \"tag\": "estoile",\n \"popularity\": 5913\n },\n {\n \"tag\": "redden",\n \"popularity\": 5908\n },\n {\n \"tag\": "solicitee",\n \"popularity\": 5903\n },\n {\n \"tag\": "nonpatented",\n \"popularity\": 5898\n },\n {\n \"tag\": "lemming",\n \"popularity\": 5893\n },\n {\n \"tag\": "marled subalate",\n \"popularity\": 5887\n },\n {\n \"tag\": "premial horizonward",\n \"popularity\": 5882\n },\n {\n \"tag\": "nonrefueling",\n \"popularity\": 5877\n },\n {\n \"tag\": "rupturewort",\n \"popularity\": 5872\n },\n {\n \"tag\": "unfed",\n \"popularity\": 5867\n },\n {\n \"tag\": "empanelment",\n \"popularity\": 5862\n },\n {\n \"tag\": "isoosmosis",\n \"popularity\": 5857\n },\n {\n \"tag\": "jipijapa",\n \"popularity\": 5852\n },\n {\n \"tag\": "Fiji",\n \"popularity\": 5847\n },\n {\n \"tag\": "interferant",\n \"popularity\": 5842\n },\n {\n \"tag\": "reconstitution",\n \"popularity\": 5837\n },\n {\n \"tag\": "dockyardman",\n \"popularity\": 5832\n },\n {\n \"tag\": "dolichopodous",\n \"popularity\": 5826\n },\n {\n \"tag\": "whiteworm",\n \"popularity\": 5821\n },\n {\n \"tag\": "atheistically",\n \"popularity\": 5816\n },\n {\n \"tag\": "nonconcern",\n \"popularity\": 5811\n },\n {\n \"tag\": "scarabaeidoid",\n \"popularity\": 5806\n },\n {\n \"tag\": "triumviri",\n \"popularity\": 5801\n },\n {\n \"tag\": "rakit",\n \"popularity\": 5796\n },\n {\n \"tag\": "leecheater",\n \"popularity\": 5791\n },\n {\n \"tag\": "Arthrostraca",\n \"popularity\": 5786\n },\n {\n \"tag\": "upknit",\n \"popularity\": 5781\n },\n {\n \"tag\": "tymbalon",\n \"popularity\": 5776\n },\n {\n \"tag\": "inventurous",\n \"popularity\": 5771\n },\n {\n \"tag\": "perradiate",\n \"popularity\": 5766\n },\n {\n \"tag\": "seer",\n \"popularity\": 5762\n },\n {\n \"tag\": "Auricularia",\n \"popularity\": 5757\n },\n {\n \"tag\": "wettish exclusivity",\n \"popularity\": 5752\n },\n {\n \"tag\": "arteriosympathectomy",\n \"popularity\": 5747\n },\n {\n \"tag\": "tunlike",\n \"popularity\": 5742\n },\n {\n \"tag\": "cephalocercal",\n \"popularity\": 5737\n },\n {\n \"tag\": "meaninglessness",\n \"popularity\": 5732\n },\n {\n \"tag\": "fountful",\n \"popularity\": 5727\n },\n {\n \"tag\": "appraisement",\n \"popularity\": 5722\n },\n {\n \"tag\": "geniculated",\n \"popularity\": 5717\n },\n {\n \"tag\": "rotator",\n \"popularity\": 5712\n },\n {\n \"tag\": "foremarch biography",\n \"popularity\": 5707\n },\n {\n \"tag\": "arid",\n \"popularity\": 5703\n },\n {\n \"tag\": "inapprehensible",\n \"popularity\": 5698\n },\n {\n \"tag\": "chlorosulphonic",\n \"popularity\": 5693\n },\n {\n \"tag\": "braguette",\n \"popularity\": 5688\n },\n {\n \"tag\": "panophthalmitis",\n \"popularity\": 5683\n },\n {\n \"tag\": "pro objurgatorily",\n \"popularity\": 5678\n },\n {\n \"tag\": "zooplasty",\n \"popularity\": 5673\n },\n {\n \"tag\": "Terebratulidae",\n \"popularity\": 5669\n },\n {\n \"tag\": "Mahran",\n \"popularity\": 5664\n },\n {\n \"tag\": "anthologize merocele",\n \"popularity\": 5659\n },\n {\n \"tag\": "firecracker chiropractic",\n \"popularity\": 5654\n },\n {\n \"tag\": "tenorist",\n \"popularity\": 5649\n },\n {\n \"tag\": "amphitene",\n \"popularity\": 5645\n },\n {\n \"tag\": "silverbush toadstone",\n \"popularity\": 5640\n },\n {\n \"tag\": "entozoological",\n \"popularity\": 5635\n },\n {\n \"tag\": "trustlessness",\n \"popularity\": 5630\n },\n {\n \"tag\": "reassay",\n \"popularity\": 5625\n },\n {\n \"tag\": "chrysalides",\n \"popularity\": 5621\n },\n {\n \"tag\": "truncation",\n \"popularity\": 5616\n },\n {\n \"tag\": "unwavered mausoleal",\n \"popularity\": 5611\n },\n {\n \"tag\": "unserrated",\n \"popularity\": 5606\n },\n {\n \"tag\": "frampler",\n \"popularity\": 5602\n },\n {\n \"tag\": "celestial",\n \"popularity\": 5597\n },\n {\n \"tag\": "depreter",\n \"popularity\": 5592\n },\n {\n \"tag\": "retaliate",\n \"popularity\": 5588\n },\n {\n \"tag\": "decempunctate",\n \"popularity\": 5583\n },\n {\n \"tag\": "submitter",\n \"popularity\": 5578\n },\n {\n \"tag\": "phenothiazine",\n \"popularity\": 5573\n },\n {\n \"tag\": "hobbledehoyish",\n \"popularity\": 5569\n },\n {\n \"tag\": "erraticness",\n \"popularity\": 5564\n },\n {\n \"tag\": "ovariodysneuria",\n \"popularity\": 5559\n },\n {\n \"tag\": "puja",\n \"popularity\": 5555\n },\n {\n \"tag\": "cesspool",\n \"popularity\": 5550\n },\n {\n \"tag\": "sonation",\n \"popularity\": 5545\n },\n {\n \"tag\": "moggan",\n \"popularity\": 5541\n },\n {\n \"tag\": "overjutting",\n \"popularity\": 5536\n },\n {\n \"tag\": "cohobate",\n \"popularity\": 5531\n },\n {\n \"tag\": "Distoma",\n \"popularity\": 5527\n },\n {\n \"tag\": "Plectognathi",\n \"popularity\": 5522\n },\n {\n \"tag\": "dumple caliphate",\n \"popularity\": 5517\n },\n {\n \"tag\": "shiko",\n \"popularity\": 5513\n },\n {\n \"tag\": "downness",\n \"popularity\": 5508\n },\n {\n \"tag\": "whippletree",\n \"popularity\": 5504\n },\n {\n \"tag\": "nymphaeum",\n \"popularity\": 5499\n },\n {\n \"tag\": "there trest",\n \"popularity\": 5494\n },\n {\n \"tag\": "psychrometer",\n \"popularity\": 5490\n },\n {\n \"tag\": "pyelograph",\n \"popularity\": 5485\n },\n {\n \"tag\": "unsalvable",\n \"popularity\": 5481\n },\n {\n \"tag\": "bescreen",\n \"popularity\": 5476\n },\n {\n \"tag\": "cushy",\n \"popularity\": 5471\n },\n {\n \"tag\": "plicatolobate",\n \"popularity\": 5467\n },\n {\n \"tag\": "lakie",\n \"popularity\": 5462\n },\n {\n \"tag\": "anthropodeoxycholic",\n \"popularity\": 5458\n },\n {\n \"tag\": "resatisfaction",\n \"popularity\": 5453\n },\n {\n \"tag\": "unravelment unaccidental",\n \"popularity\": 5449\n },\n {\n \"tag\": "telewriter monogeneous",\n \"popularity\": 5444\n },\n {\n \"tag\": "unsabred",\n \"popularity\": 5440\n },\n {\n \"tag\": "startlingly",\n \"popularity\": 5435\n },\n {\n \"tag\": "Aralia",\n \"popularity\": 5431\n },\n {\n \"tag\": "alamonti",\n \"popularity\": 5426\n },\n {\n \"tag\": "Franklinization",\n \"popularity\": 5422\n },\n {\n \"tag\": "parliament",\n \"popularity\": 5417\n },\n {\n \"tag\": "schoolkeeper",\n \"popularity\": 5413\n },\n {\n \"tag\": "nonsociety",\n \"popularity\": 5408\n },\n {\n \"tag\": "parenthetic",\n \"popularity\": 5404\n },\n {\n \"tag\": "stog",\n \"popularity\": 5399\n },\n {\n \"tag\": "Pristipomidae",\n \"popularity\": 5395\n },\n {\n \"tag\": "exocarp",\n \"popularity\": 5390\n },\n {\n \"tag\": "monaxonial",\n \"popularity\": 5386\n },\n {\n \"tag\": "tramroad",\n \"popularity\": 5381\n },\n {\n \"tag\": "hookah",\n \"popularity\": 5377\n },\n {\n \"tag\": "saccharonic",\n \"popularity\": 5372\n },\n {\n \"tag\": "perimetrium",\n \"popularity\": 5368\n },\n {\n \"tag\": "libelluloid",\n \"popularity\": 5364\n },\n {\n \"tag\": "overrunningly",\n \"popularity\": 5359\n },\n {\n \"tag\": "untwister",\n \"popularity\": 5355\n },\n {\n \"tag\": "ninnyhammer",\n \"popularity\": 5350\n },\n {\n \"tag\": "metranate",\n \"popularity\": 5346\n },\n {\n \"tag\": "sarcoblast",\n \"popularity\": 5341\n },\n {\n \"tag\": "porkish",\n \"popularity\": 5337\n },\n {\n \"tag\": "chauvinistic",\n \"popularity\": 5333\n },\n {\n \"tag\": "sexagesimal",\n \"popularity\": 5328\n },\n {\n \"tag\": "hematogenic",\n \"popularity\": 5324\n },\n {\n \"tag\": "selfpreservatory",\n \"popularity\": 5320\n },\n {\n \"tag\": "myelauxe",\n \"popularity\": 5315\n },\n {\n \"tag\": "triply",\n \"popularity\": 5311\n },\n {\n \"tag\": "metaphysicous",\n \"popularity\": 5306\n },\n {\n \"tag\": "vitrinoid",\n \"popularity\": 5302\n },\n {\n \"tag\": "glabellae",\n \"popularity\": 5298\n },\n {\n \"tag\": "moonlighter",\n \"popularity\": 5293\n },\n {\n \"tag\": "monotheistically epexegetical",\n \"popularity\": 5289\n },\n {\n \"tag\": "pseudolateral",\n \"popularity\": 5285\n },\n {\n \"tag\": "heptamethylene",\n \"popularity\": 5280\n },\n {\n \"tag\": "salvadora",\n \"popularity\": 5276\n },\n {\n \"tag\": "unjovial diphenylthiourea",\n \"popularity\": 5272\n },\n {\n \"tag\": "thievishness",\n \"popularity\": 5268\n },\n {\n \"tag\": "unridable",\n \"popularity\": 5263\n },\n {\n \"tag\": "underhandedly",\n \"popularity\": 5259\n },\n {\n \"tag\": "fungiform",\n \"popularity\": 5255\n },\n {\n \"tag\": "scruffle",\n \"popularity\": 5250\n },\n {\n \"tag\": "preindisposition",\n \"popularity\": 5246\n },\n {\n \"tag\": "Amadis",\n \"popularity\": 5242\n },\n {\n \"tag\": "Culex",\n \"popularity\": 5238\n },\n {\n \"tag\": "churning",\n \"popularity\": 5233\n },\n {\n \"tag\": "imperite",\n \"popularity\": 5229\n },\n {\n \"tag\": "levorotation",\n \"popularity\": 5225\n },\n {\n \"tag\": "barbate",\n \"popularity\": 5221\n },\n {\n \"tag\": "knotwort",\n \"popularity\": 5216\n },\n {\n \"tag\": "gypsiferous",\n \"popularity\": 5212\n },\n {\n \"tag\": "tourmalinic",\n \"popularity\": 5208\n },\n {\n \"tag\": "helleboric",\n \"popularity\": 5204\n },\n {\n \"tag\": "pneumograph",\n \"popularity\": 5199\n },\n {\n \"tag\": "Peltigeraceae",\n \"popularity\": 5195\n },\n {\n \"tag\": "busine",\n \"popularity\": 5191\n },\n {\n \"tag\": "Ailuridae",\n \"popularity\": 5187\n },\n {\n \"tag\": "azotate",\n \"popularity\": 5183\n },\n {\n \"tag\": "unlikable",\n \"popularity\": 5178\n },\n {\n \"tag\": "sloyd",\n \"popularity\": 5174\n },\n {\n \"tag\": "biblioclasm",\n \"popularity\": 5170\n },\n {\n \"tag\": "Seres",\n \"popularity\": 5166\n },\n {\n \"tag\": "unaccurateness",\n \"popularity\": 5162\n },\n {\n \"tag\": "scrollwise",\n \"popularity\": 5157\n },\n {\n \"tag\": "flandowser",\n \"popularity\": 5153\n },\n {\n \"tag\": "unblackened",\n \"popularity\": 5149\n },\n {\n \"tag\": "schistosternia",\n \"popularity\": 5145\n },\n {\n \"tag\": "fuse",\n \"popularity\": 5141\n },\n {\n \"tag\": "narthecal",\n \"popularity\": 5137\n },\n {\n \"tag\": "Cueva",\n \"popularity\": 5133\n },\n {\n \"tag\": "appositeness",\n \"popularity\": 5128\n },\n {\n \"tag\": "proindustrial",\n \"popularity\": 5124\n },\n {\n \"tag\": "dermatorrhoea",\n \"popularity\": 5120\n },\n {\n \"tag\": "oxyurous tendential",\n \"popularity\": 5116\n },\n {\n \"tag\": "isopurpurin",\n \"popularity\": 5112\n },\n {\n \"tag\": "impose",\n \"popularity\": 5108\n },\n {\n \"tag\": "wordsmanship",\n \"popularity\": 5104\n },\n {\n \"tag\": "saturator",\n \"popularity\": 5100\n },\n {\n \"tag\": "Nordicity",\n \"popularity\": 5096\n },\n {\n \"tag\": "interaccuse",\n \"popularity\": 5092\n },\n {\n \"tag\": "acridinic",\n \"popularity\": 5087\n },\n {\n \"tag\": "scholion",\n \"popularity\": 5083\n },\n {\n \"tag\": "pseudoaconitine",\n \"popularity\": 5079\n },\n {\n \"tag\": "doctorial",\n \"popularity\": 5075\n },\n {\n \"tag\": "Etchimin",\n \"popularity\": 5071\n },\n {\n \"tag\": "oliviform",\n \"popularity\": 5067\n },\n {\n \"tag\": "Pele",\n \"popularity\": 5063\n },\n {\n \"tag\": "Chiromantis Progymnasium",\n \"popularity\": 5059\n },\n {\n \"tag\": "toxosis",\n \"popularity\": 5055\n },\n {\n \"tag\": "spadilla",\n \"popularity\": 5051\n },\n {\n \"tag\": "Actinopterygii",\n \"popularity\": 5047\n },\n {\n \"tag\": "untiring",\n \"popularity\": 5043\n },\n {\n \"tag\": "butyral",\n \"popularity\": 5039\n },\n {\n \"tag\": "Gymnoderinae",\n \"popularity\": 5035\n },\n {\n \"tag\": "testudo",\n \"popularity\": 5031\n },\n {\n \"tag\": "frigorify",\n \"popularity\": 5027\n },\n {\n \"tag\": "aliency",\n \"popularity\": 5023\n },\n {\n \"tag\": "jargon",\n \"popularity\": 5019\n },\n {\n \"tag\": "counterservice",\n \"popularity\": 5015\n },\n {\n \"tag\": "isostrychnine",\n \"popularity\": 5011\n },\n {\n \"tag\": "tellership",\n \"popularity\": 5007\n },\n {\n \"tag\": "miscegenetic",\n \"popularity\": 5003\n },\n {\n \"tag\": "sorcer",\n \"popularity\": 4999\n },\n {\n \"tag\": "tilewright",\n \"popularity\": 4995\n },\n {\n \"tag\": "cyanoplastid",\n \"popularity\": 4991\n },\n {\n \"tag\": "fluxionally",\n \"popularity\": 4987\n },\n {\n \"tag\": "proudhearted",\n \"popularity\": 4983\n },\n {\n \"tag\": "blithely",\n \"popularity\": 4979\n },\n {\n \"tag\": "jestproof",\n \"popularity\": 4975\n },\n {\n \"tag\": "jestwise",\n \"popularity\": 4971\n },\n {\n \"tag\": "nonassimilable",\n \"popularity\": 4967\n },\n {\n \"tag\": "compurgation",\n \"popularity\": 4964\n },\n {\n \"tag\": "unhate",\n \"popularity\": 4960\n },\n {\n \"tag\": "haplodonty",\n \"popularity\": 4956\n },\n {\n \"tag\": "cardholder",\n \"popularity\": 4952\n },\n {\n \"tag\": "rainlight megohmmeter overstout",\n \"popularity\": 4948\n },\n {\n \"tag\": "itchless",\n \"popularity\": 4944\n },\n {\n \"tag\": "begiggle",\n \"popularity\": 4940\n },\n {\n \"tag\": "chromatosphere",\n \"popularity\": 4936\n },\n {\n \"tag\": "typicality",\n \"popularity\": 4932\n },\n {\n \"tag\": "overgrown",\n \"popularity\": 4928\n },\n {\n \"tag\": "envolume",\n \"popularity\": 4925\n },\n {\n \"tag\": "pachycholia",\n \"popularity\": 4921\n },\n {\n \"tag\": "passageable",\n \"popularity\": 4917\n },\n {\n \"tag\": "pathopoiesis",\n \"popularity\": 4913\n },\n {\n \"tag\": "overbreak",\n \"popularity\": 4909\n },\n {\n \"tag\": "satyric",\n \"popularity\": 4905\n },\n {\n \"tag\": "unaudited",\n \"popularity\": 4901\n },\n {\n \"tag\": "whimble",\n \"popularity\": 4898\n },\n {\n \"tag\": "pressureless",\n \"popularity\": 4894\n },\n {\n \"tag\": "Selene",\n \"popularity\": 4890\n },\n {\n \"tag\": "slithery",\n \"popularity\": 4886\n },\n {\n \"tag\": "nondisfigurement",\n \"popularity\": 4882\n },\n {\n \"tag\": "overdelicious",\n \"popularity\": 4878\n },\n {\n \"tag\": "Perca",\n \"popularity\": 4875\n },\n {\n \"tag\": "Palladium",\n \"popularity\": 4871\n },\n {\n \"tag\": "insagacity",\n \"popularity\": 4867\n },\n {\n \"tag\": "peristoma",\n \"popularity\": 4863\n },\n {\n \"tag\": "uncreativeness",\n \"popularity\": 4859\n },\n {\n \"tag\": "incomparability surfboarding",\n \"popularity\": 4856\n },\n {\n \"tag\": "bacillar",\n \"popularity\": 4852\n },\n {\n \"tag\": "ulcerative",\n \"popularity\": 4848\n },\n {\n \"tag\": "stychomythia",\n \"popularity\": 4844\n },\n {\n \"tag\": "sesma somatics nonentry",\n \"popularity\": 4840\n },\n {\n \"tag\": "unsepulchred",\n \"popularity\": 4837\n },\n {\n \"tag\": "cephalanthium",\n \"popularity\": 4833\n },\n {\n \"tag\": "Asiaticization",\n \"popularity\": 4829\n },\n {\n \"tag\": "killeen",\n \"popularity\": 4825\n },\n {\n \"tag\": "Pseudococcus",\n \"popularity\": 4822\n },\n {\n \"tag\": "untractable",\n \"popularity\": 4818\n },\n {\n \"tag\": "apolegamic",\n \"popularity\": 4814\n },\n {\n \"tag\": "hyperpnea",\n \"popularity\": 4810\n },\n {\n \"tag\": "martyrolatry",\n \"popularity\": 4807\n },\n {\n \"tag\": "Sarmatic",\n \"popularity\": 4803\n },\n {\n \"tag\": "nonsurface",\n \"popularity\": 4799\n },\n {\n \"tag\": "adjoined",\n \"popularity\": 4796\n },\n {\n \"tag\": "vasiform",\n \"popularity\": 4792\n },\n {\n \"tag\": "tastelessness",\n \"popularity\": 4788\n },\n {\n \"tag\": "rumbo",\n \"popularity\": 4784\n },\n {\n \"tag\": "subdititious",\n \"popularity\": 4781\n },\n {\n \"tag\": "reparticipation",\n \"popularity\": 4777\n },\n {\n \"tag\": "Yorkshireism",\n \"popularity\": 4773\n },\n {\n \"tag\": "outcrow",\n \"popularity\": 4770\n },\n {\n \"tag\": "casserole",\n \"popularity\": 4766\n },\n {\n \"tag\": "semideltaic",\n \"popularity\": 4762\n },\n {\n \"tag\": "freemason",\n \"popularity\": 4759\n },\n {\n \"tag\": "catkin",\n \"popularity\": 4755\n },\n {\n \"tag\": "conscient",\n \"popularity\": 4751\n },\n {\n \"tag\": "reliably",\n \"popularity\": 4748\n },\n {\n \"tag\": "Telembi",\n \"popularity\": 4744\n },\n {\n \"tag\": "hide",\n \"popularity\": 4740\n },\n {\n \"tag\": "social",\n \"popularity\": 4737\n },\n {\n \"tag\": "ichneutic",\n \"popularity\": 4733\n },\n {\n \"tag\": "polypotome blouse pentagrammatic",\n \"popularity\": 4729\n },\n {\n \"tag\": "airdrome pesthole",\n \"popularity\": 4726\n },\n {\n \"tag\": "unportended",\n \"popularity\": 4722\n },\n {\n \"tag\": "sheerly",\n \"popularity\": 4719\n },\n {\n \"tag\": "acardiac",\n \"popularity\": 4715\n },\n {\n \"tag\": "fetor",\n \"popularity\": 4711\n },\n {\n \"tag\": "storax",\n \"popularity\": 4708\n },\n {\n \"tag\": "syndactylic",\n \"popularity\": 4704\n },\n {\n \"tag\": "otiatrics",\n \"popularity\": 4700\n },\n {\n \"tag\": "range",\n \"popularity\": 4697\n },\n {\n \"tag\": "branchway",\n \"popularity\": 4693\n },\n {\n \"tag\": "beatific",\n \"popularity\": 4690\n },\n {\n \"tag\": "Rugosa",\n \"popularity\": 4686\n },\n {\n \"tag\": "rafty",\n \"popularity\": 4682\n },\n {\n \"tag\": "gapy",\n \"popularity\": 4679\n },\n {\n \"tag\": "heterocercal",\n \"popularity\": 4675\n },\n {\n \"tag\": "actinopterygious",\n \"popularity\": 4672\n },\n {\n \"tag\": "glauconite",\n \"popularity\": 4668\n },\n {\n \"tag\": "limbless priest",\n \"popularity\": 4665\n },\n {\n \"tag\": "chrysene",\n \"popularity\": 4661\n },\n {\n \"tag\": "isentropic",\n \"popularity\": 4658\n },\n {\n \"tag\": "lairdess",\n \"popularity\": 4654\n },\n {\n \"tag\": "butterhead choliambic",\n \"popularity\": 4650\n },\n {\n \"tag\": "hexaseme",\n \"popularity\": 4647\n },\n {\n \"tag\": "treeify",\n \"popularity\": 4643\n },\n {\n \"tag\": "coronetted fructify",\n \"popularity\": 4640\n },\n {\n \"tag\": "admiralty",\n \"popularity\": 4636\n },\n {\n \"tag\": "Flosculariidae",\n \"popularity\": 4633\n },\n {\n \"tag\": "limaceous",\n \"popularity\": 4629\n },\n {\n \"tag\": "subterconscious",\n \"popularity\": 4626\n },\n {\n \"tag\": "stayless",\n \"popularity\": 4622\n },\n {\n \"tag\": "psha",\n \"popularity\": 4619\n },\n {\n \"tag\": "Mediterraneanize",\n \"popularity\": 4615\n },\n {\n \"tag\": "impenetrably",\n \"popularity\": 4612\n },\n {\n \"tag\": "Myrmeleonidae",\n \"popularity\": 4608\n },\n {\n \"tag\": "germander",\n \"popularity\": 4605\n },\n {\n \"tag\": "Buri",\n \"popularity\": 4601\n },\n {\n \"tag\": "papyrotamia",\n \"popularity\": 4598\n },\n {\n \"tag\": "Toxylon",\n \"popularity\": 4594\n },\n {\n \"tag\": "batatilla",\n \"popularity\": 4591\n },\n {\n \"tag\": "fabella assumer",\n \"popularity\": 4587\n },\n {\n \"tag\": "macromethod",\n \"popularity\": 4584\n },\n {\n \"tag\": "Blechnum",\n \"popularity\": 4580\n },\n {\n \"tag\": "pantography",\n \"popularity\": 4577\n },\n {\n \"tag\": "seminovel",\n \"popularity\": 4574\n },\n {\n \"tag\": "disembarrassment",\n \"popularity\": 4570\n },\n {\n \"tag\": "bushmaking",\n \"popularity\": 4567\n },\n {\n \"tag\": "neurosis",\n \"popularity\": 4563\n },\n {\n \"tag\": "Animalia",\n \"popularity\": 4560\n },\n {\n \"tag\": "Bernice",\n \"popularity\": 4556\n },\n {\n \"tag\": "wisen",\n \"popularity\": 4553\n },\n {\n \"tag\": "subhymenium",\n \"popularity\": 4549\n },\n {\n \"tag\": "esophagomycosis",\n \"popularity\": 4546\n },\n {\n \"tag\": "wireworks",\n \"popularity\": 4543\n },\n {\n \"tag\": "Sabellidae",\n \"popularity\": 4539\n },\n {\n \"tag\": "fustianish",\n \"popularity\": 4536\n },\n {\n \"tag\": "professively",\n \"popularity\": 4532\n },\n {\n \"tag\": "overcorruptly",\n \"popularity\": 4529\n },\n {\n \"tag\": "overcreep",\n \"popularity\": 4526\n },\n {\n \"tag\": "Castilloa",\n \"popularity\": 4522\n },\n {\n \"tag\": "forelady Georgie",\n \"popularity\": 4519\n },\n {\n \"tag\": "outsider",\n \"popularity\": 4515\n },\n {\n \"tag\": "Enukki",\n \"popularity\": 4512\n },\n {\n \"tag\": "gypsy",\n \"popularity\": 4509\n },\n {\n \"tag\": "Passamaquoddy",\n \"popularity\": 4505\n },\n {\n \"tag\": "reposit",\n \"popularity\": 4502\n },\n {\n \"tag\": "overtenderness",\n \"popularity\": 4499\n },\n {\n \"tag\": "keratome",\n \"popularity\": 4495\n },\n {\n \"tag\": "interclavicular hypermonosyllable Susanna",\n \"popularity\": 4492\n },\n {\n \"tag\": "mispropose",\n \"popularity\": 4489\n },\n {\n \"tag\": "Membranipora",\n \"popularity\": 4485\n },\n {\n \"tag\": "lampad",\n \"popularity\": 4482\n },\n {\n \"tag\": "header",\n \"popularity\": 4479\n },\n {\n \"tag\": "triseriate",\n \"popularity\": 4475\n },\n {\n \"tag\": "distrainment",\n \"popularity\": 4472\n },\n {\n \"tag\": "staphyloplastic",\n \"popularity\": 4469\n },\n {\n \"tag\": "outscour",\n \"popularity\": 4465\n },\n {\n \"tag\": "tallowmaking",\n \"popularity\": 4462\n },\n {\n \"tag\": "plugger",\n \"popularity\": 4459\n },\n {\n \"tag\": "fashionize",\n \"popularity\": 4455\n },\n {\n \"tag\": "puzzle",\n \"popularity\": 4452\n },\n {\n \"tag\": "imbrue",\n \"popularity\": 4449\n },\n {\n \"tag\": "osteoblast",\n \"popularity\": 4445\n },\n {\n \"tag\": "Hydrocores",\n \"popularity\": 4442\n },\n {\n \"tag\": "Lutra",\n \"popularity\": 4439\n },\n {\n \"tag\": "upridge scarfy",\n \"popularity\": 4435\n },\n {\n \"tag\": "ancon taffle",\n \"popularity\": 4432\n },\n {\n \"tag\": "impest",\n \"popularity\": 4429\n },\n {\n \"tag\": "uncollatedness",\n \"popularity\": 4426\n },\n {\n \"tag\": "hypersensitize",\n \"popularity\": 4422\n },\n {\n \"tag\": "autographically",\n \"popularity\": 4419\n },\n {\n \"tag\": "louther",\n \"popularity\": 4416\n },\n {\n \"tag\": "Ollie",\n \"popularity\": 4413\n },\n {\n \"tag\": "recompensate",\n \"popularity\": 4409\n },\n {\n \"tag\": "Shan",\n \"popularity\": 4406\n },\n {\n \"tag\": "brachycnemic",\n \"popularity\": 4403\n },\n {\n \"tag\": "Carinatae",\n \"popularity\": 4399\n },\n {\n \"tag\": "geotherm",\n \"popularity\": 4396\n },\n {\n \"tag\": "sawback",\n \"popularity\": 4393\n },\n {\n \"tag\": "Novatianist",\n \"popularity\": 4390\n },\n {\n \"tag\": "reapproach",\n \"popularity\": 4387\n },\n {\n \"tag\": "myelopoietic",\n \"popularity\": 4383\n },\n {\n \"tag\": "cyanin",\n \"popularity\": 4380\n },\n {\n \"tag\": "unsmutted",\n \"popularity\": 4377\n },\n {\n \"tag\": "nonpapist",\n \"popularity\": 4374\n },\n {\n \"tag\": "transbaikalian",\n \"popularity\": 4370\n },\n {\n \"tag\": "connately",\n \"popularity\": 4367\n },\n {\n \"tag\": "tenderize iterance",\n \"popularity\": 4364\n },\n {\n \"tag\": "hydrostatical",\n \"popularity\": 4361\n },\n {\n \"tag\": "unflag",\n \"popularity\": 4358\n },\n {\n \"tag\": "translate",\n \"popularity\": 4354\n },\n {\n \"tag\": "Scorzonera",\n \"popularity\": 4351\n },\n {\n \"tag\": "uncomforted",\n \"popularity\": 4348\n },\n {\n \"tag\": "risser varied",\n \"popularity\": 4345\n },\n {\n \"tag\": "plumbate",\n \"popularity\": 4342\n },\n {\n \"tag\": "Usneaceae",\n \"popularity\": 4338\n },\n {\n \"tag\": "fohat",\n \"popularity\": 4335\n },\n {\n \"tag\": "slagging",\n \"popularity\": 4332\n },\n {\n \"tag\": "superserious",\n \"popularity\": 4329\n },\n {\n \"tag\": "theocracy",\n \"popularity\": 4326\n },\n {\n \"tag\": "valonia",\n \"popularity\": 4323\n },\n {\n \"tag\": "Sapindales",\n \"popularity\": 4319\n },\n {\n \"tag\": "palaeozoologist",\n \"popularity\": 4316\n },\n {\n \"tag\": "yalb",\n \"popularity\": 4313\n },\n {\n \"tag\": "unviewed",\n \"popularity\": 4310\n },\n {\n \"tag\": "polyarteritis",\n \"popularity\": 4307\n },\n {\n \"tag\": "vectorial",\n \"popularity\": 4304\n },\n {\n \"tag\": "skimpingly",\n \"popularity\": 4301\n },\n {\n \"tag\": "athort",\n \"popularity\": 4297\n },\n {\n \"tag\": "tribofluorescence",\n \"popularity\": 4294\n },\n {\n \"tag\": "benzonitrol",\n \"popularity\": 4291\n },\n {\n \"tag\": "swiller subobtuse subjacency",\n \"popularity\": 4288\n },\n {\n \"tag\": "uncompassed",\n \"popularity\": 4285\n },\n {\n \"tag\": "cacochymia",\n \"popularity\": 4282\n },\n {\n \"tag\": "commensalist butadiene",\n \"popularity\": 4279\n },\n {\n \"tag\": "culpable",\n \"popularity\": 4276\n },\n {\n \"tag\": "contributive",\n \"popularity\": 4273\n },\n {\n \"tag\": "attemperately",\n \"popularity\": 4269\n },\n {\n \"tag\": "spelt",\n \"popularity\": 4266\n },\n {\n \"tag\": "exoneration",\n \"popularity\": 4263\n },\n {\n \"tag\": "antivivisectionist",\n \"popularity\": 4260\n },\n {\n \"tag\": "granitification",\n \"popularity\": 4257\n },\n {\n \"tag\": "palladize",\n \"popularity\": 4254\n },\n {\n \"tag\": "marksmanship",\n \"popularity\": 4251\n },\n {\n \"tag\": "bullydom",\n \"popularity\": 4248\n },\n {\n \"tag\": "spirality",\n \"popularity\": 4245\n },\n {\n \"tag\": "caliginous",\n \"popularity\": 4242\n },\n {\n \"tag\": "reportedly",\n \"popularity\": 4239\n },\n {\n \"tag\": "polyad",\n \"popularity\": 4236\n },\n {\n \"tag\": "arthroempyesis",\n \"popularity\": 4233\n },\n {\n \"tag\": "semibay facultatively",\n \"popularity\": 4229\n },\n {\n \"tag\": "metastatically",\n \"popularity\": 4226\n },\n {\n \"tag\": "prophetically",\n \"popularity\": 4223\n },\n {\n \"tag\": "Linguatula elapid",\n \"popularity\": 4220\n },\n {\n \"tag\": "pyknatom",\n \"popularity\": 4217\n },\n {\n \"tag\": "centimeter",\n \"popularity\": 4214\n },\n {\n \"tag\": "mensurate",\n \"popularity\": 4211\n },\n {\n \"tag\": "migraine",\n \"popularity\": 4208\n },\n {\n \"tag\": "pentagamist",\n \"popularity\": 4205\n },\n {\n \"tag\": "querken",\n \"popularity\": 4202\n },\n {\n \"tag\": "ambulance",\n \"popularity\": 4199\n },\n {\n \"tag\": "Stokavian",\n \"popularity\": 4196\n },\n {\n \"tag\": "malvasian",\n \"popularity\": 4193\n },\n {\n \"tag\": "uncouthsome",\n \"popularity\": 4190\n },\n {\n \"tag\": "readable",\n \"popularity\": 4187\n },\n {\n \"tag\": "enlodge",\n \"popularity\": 4184\n },\n {\n \"tag\": "plasterwise Appendiculariidae perspectograph",\n \"popularity\": 4181\n },\n {\n \"tag\": "inkweed",\n \"popularity\": 4178\n },\n {\n \"tag\": "streep",\n \"popularity\": 4175\n },\n {\n \"tag\": "diadelphian cultured",\n \"popularity\": 4172\n },\n {\n \"tag\": "hymenopterous",\n \"popularity\": 4169\n },\n {\n \"tag\": "unexorableness",\n \"popularity\": 4166\n },\n {\n \"tag\": "cascaron",\n \"popularity\": 4163\n },\n {\n \"tag\": "undaintiness",\n \"popularity\": 4160\n },\n {\n \"tag\": "Curtana",\n \"popularity\": 4157\n },\n {\n \"tag\": "scurvied",\n \"popularity\": 4154\n },\n {\n \"tag\": "molluscoidal",\n \"popularity\": 4151\n },\n {\n \"tag\": "yurt",\n \"popularity\": 4148\n },\n {\n \"tag\": "deciduitis",\n \"popularity\": 4145\n },\n {\n \"tag\": "creephole",\n \"popularity\": 4142\n },\n {\n \"tag\": "quatrefeuille",\n \"popularity\": 4139\n },\n {\n \"tag\": "bicapitate adenomatome",\n \"popularity\": 4136\n },\n {\n \"tag\": "damassin",\n \"popularity\": 4134\n },\n {\n \"tag\": "planching",\n \"popularity\": 4131\n },\n {\n \"tag\": "dashedly inferential",\n \"popularity\": 4128\n },\n {\n \"tag\": "lobe",\n \"popularity\": 4125\n },\n {\n \"tag\": "Hyrachyus",\n \"popularity\": 4122\n },\n {\n \"tag\": "knab",\n \"popularity\": 4119\n },\n {\n \"tag\": "discohexaster",\n \"popularity\": 4116\n },\n {\n \"tag\": "malign",\n \"popularity\": 4113\n },\n {\n \"tag\": "pedagoguism",\n \"popularity\": 4110\n },\n {\n \"tag\": "shrubbery",\n \"popularity\": 4107\n },\n {\n \"tag\": "undershrub",\n \"popularity\": 4104\n },\n {\n \"tag\": "bureaucrat",\n \"popularity\": 4101\n },\n {\n \"tag\": "pantaleon",\n \"popularity\": 4098\n },\n {\n \"tag\": "mesoventral",\n \"popularity\": 4096\n }]';
+
+var log2 = Math.log(2);
+var tagInfo = tagInfoJSON.parseJSON(function(a, b) { if (a == "popularity") { return Math.log(b) / log2; } else {return b; } });
+
+function makeTagCloud(tagInfo)
+{
+ var output = '<div class="tagCloud" style="width: 100%">';
+
+ tagInfo.sort(function(a, b) { if (a.tag < b.tag) { return -1; } else if (a.tag == b.tag) { return 0; } else return 1; });
+
+ for (var i = 0; i < tagInfo.length; i++) {
+ var tag = tagInfo[i].tag;
+
+ var validates = true;
+ for (var j = 0; j < tag.length; j++) {
+ var ch = tag.charCodeAt(j);
+ if (ch < 0x20 || ch >= 0x7f) {
+ validates = false;
+ break;
+ }
+ }
+
+ if (!validates)
+ continue;
+
+ var url = "http://example.com/tag/" + tag.replace(" ", "").toLowerCase();
+ var popularity = tagInfo[i].popularity;
+ var color = 'rgb(' + Math.floor(255 * (popularity - 12) / 20) + ', 0, 255)';
+ output += ' <a href="' + url + '" style="font-size: ' + popularity + 'px; color: ' + color + '">' + tag + '</a> \n';
+ }
+
+ output += '</div>';
+ output.replace(" ", "&nbsp;");
+
+ return output;
+}
+
+var tagcloud = makeTagCloud(tagInfo);
+tagInfo = null;
+// This test case unpacks the compressed code for the MochiKit,
+// jQuery, Dojo and Prototype JavaScript libraries.
+
+/***
+ MochiKit.MochiKit 1.3.1 : PACKED VERSION
+ THIS FILE IS AUTOMATICALLY GENERATED. If creating patches, please
+ diff against the source tree, not this file.
+
+ See <http://mochikit.com/> for documentation, downloads, license, etc.
+
+ (c) 2005 Bob Ippolito. All rights Reserved.
+***/
+
+for (var i = 0; i < 2; i++) {
+
+var decompressedMochiKit = function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('if(H(1q)!="L"){1q.2X("B.J")}if(H(B)=="L"){B={}}if(H(B.J)=="L"){B.J={}}B.J.1Y="1.3.1";B.J.1r="B.J";B.J.2l=G(7V,vR){if(7V===O){7V={}}R(u i=1;i<M.K;i++){u o=M[i];if(H(o)!="L"&&o!==O){R(u k in o){7V[k]=o[k]}}}F 7V};B.J.2l(B.J,{1K:G(){F"["+D.1r+" "+D.1Y+"]"},1l:G(){F D.1K()},4f:G(n){if(M.K===0){n=1}F G(){F n++}},4L:G(mw){u me=M.2U;if(M.K==1){me.1U=mw;F Y me()}},bg:G(vQ){u X=[];u m=B.J;u aw=m.1R(O,M);1M(aw.K){u o=aw.2P();if(o&&H(o)=="3n"&&H(o.K)=="2y"){R(u i=o.K-1;i>=0;i--){aw.e9(o[i])}}N{X.1c(o)}}F X},1R:G(7U,1i,av){if(!av){av=0}if(1i){u l=1i.K;if(H(l)!="2y"){if(H(B.15)!="L"){1i=B.15.2G(1i);l=1i.K}N{14 Y 3p("au 2E an at-as 3W B.15 2E ar")}}if(!7U){7U=[]}R(u i=av;i<l;i++){7U.1c(1i[i])}}F 7U},8Z:G(5g,1i){if(5g===O){5g={}}R(u i=1;i<M.K;i++){u o=M[i];if(H(o)!="L"&&o!==O){R(u k in o){u v=o[k];if(H(5g[k])=="3n"&&H(v)=="3n"){M.2U(5g[k],v)}N{5g[k]=v}}}}F 5g},lO:G(6c,1i){if(6c===O){6c={}}R(u i=1;i<M.K;i++){u o=M[i];R(u k in o){if(!(k in 6c)){6c[k]=o[k]}}}F 6c},lN:G(1i){u fj=[];R(u mv in 1i){fj.1c(mv)}F fj},lM:G(1i){u fh=[];u e;R(u fi in 1i){u v;1f{v=1i[fi]}1e(e){2V}fh.1c([fi,v])}F fh},jq:G(fg,ff,fe){fe.1U=Y B.J.5a(fg.1r+"."+ff);fg[ff]=fe},4i:{7L:G(a){F!!a},vP:G(a){F!a},eE:G(a){F a},2E:G(a){F~a},vO:G(a){F-a},vN:G(a,b){F a+b},vM:G(a,b){F a-b},4u:G(a,b){F a/b},vL:G(a,b){F a%b},vK:G(a,b){F a*b},3W:G(a,b){F a&b},or:G(a,b){F a|b},vJ:G(a,b){F a^b},vI:G(a,b){F a<<b},vH:G(a,b){F a>>b},vG:G(a,b){F a>>>b},eq:G(a,b){F a==b},ne:G(a,b){F a!=b},gt:G(a,b){F a>b},ge:G(a,b){F a>=b},lt:G(a,b){F a<b},le:G(a,b){F a<=b},vF:G(a,b){F B.J.2f(a,b)===0},vE:G(a,b){F B.J.2f(a,b)!==0},vD:G(a,b){F B.J.2f(a,b)==1},vC:G(a,b){F B.J.2f(a,b)!=-1},vB:G(a,b){F B.J.2f(a,b)==-1},vA:G(a,b){F B.J.2f(a,b)!=1},vz:G(a,b){F a&&b},vy:G(a,b){F a||b},vx:G(a,b){F b in a}},24:G(mu){F G(){F D[mu].1w(D,M)}},lL:G(mt){F G(a9){F a9[mt]}},66:G(){u fd={};R(u i=0;i<M.K;i++){u 6b=M[i];fd[6b]=6b}F G(){R(u i=0;i<M.K;i++){if(!(H(M[i])in fd)){F 1m}}F 1h}},lJ:G(){R(u i=0;i<M.K;i++){if(M[i]!==O){F 1m}}F 1h},lK:G(){R(u i=0;i<M.K;i++){u o=M[i];if(!(H(o)=="L"||o===O)){F 1m}}F 1h},lI:G(1i){F!B.J.7e.1w(D,M)},7e:G(1i){R(u i=0;i<M.K;i++){u o=M[i];if(!(o&&o.K)){F 1m}}F 1h},3A:G(){R(u i=0;i<M.K;i++){u o=M[i];u 6b=H(o);if((6b!="3n"&&!(6b=="G"&&H(o.vw)=="G"))||o===O||H(o.K)!="2y"){F 1m}}F 1h},eN:G(){R(u i=0;i<M.K;i++){u o=M[i];if(H(o)!="3n"||o===O||H(o.9P)!="G"){F 1m}}F 1h},lH:G(fn){if(fn===O){F B.J.1R(O,M,1)}u fc=[];R(u i=1;i<M.K;i++){fc.1c(fn(M[i]))}F fc},2r:G(fn,1g){u m=B.J;u 6a=B.15;u fb=m.3A;if(M.K<=2){if(!fb(1g)){if(6a){1g=6a.2G(1g);if(fn===O){F 1g}}N{14 Y 3p("au 2E an at-as 3W B.15 2E ar")}}if(fn===O){F m.1R(O,1g)}u 69=[];R(u i=0;i<1g.K;i++){69.1c(fn(1g[i]))}F 69}N{if(fn===O){fn=7o}u 7T=O;R(i=1;i<M.K;i++){if(!fb(M[i])){if(6a){F 6a.2G(6a.4c.1w(O,M))}N{14 Y 3p("au 2E an at-as 3W B.15 2E ar")}}u l=M[i].K;if(7T===O||7T>l){7T=l}}69=[];R(i=0;i<7T;i++){u fa=[];R(u j=1;j<M.K;j++){fa.1c(M[j][i])}69.1c(fn.1w(D,fa))}F 69}},lG:G(fn){u f9=[];if(fn===O){fn=B.J.4i.7L}R(u i=1;i<M.K;i++){u o=M[i];if(fn(o)){f9.1c(o)}}F f9},47:G(fn,1g,7S){u aq=[];u m=B.J;if(!m.3A(1g)){if(B.15){1g=B.15.2G(1g)}N{14 Y 3p("au 2E an at-as 3W B.15 2E ar")}}if(fn===O){fn=m.4i.7L}if(H(7o.1U.47)=="G"){F 7o.1U.47.cz(1g,fn,7S)}N{if(H(7S)=="L"||7S===O){R(u i=0;i<1g.K;i++){u o=1g[i];if(fn(o)){aq.1c(o)}}}N{R(i=0;i<1g.K;i++){o=1g[i];if(fn.cz(7S,o)){aq.1c(o)}}}}F aq},mq:G(7R){F G(){hd(M.K){3j 0:F 7R();3j 1:F 7R(M[0]);3j 2:F 7R(M[0],M[1]);3j 3:F 7R(M[0],M[1],M[2])}u f8=[];R(u i=0;i<M.K;i++){f8.1c("M["+i+"]")}F dB("(1A("+f8.2b(",")+"))")}},lv:G(mr,ms){u m=B.J;F m.1O.1w(D,m.1R([ms,mr],M,2))},1O:G(3c,4o){if(H(3c)=="1n"){3c=4o[3c]}u ao=3c.f5;u 5f=3c.am;u f6=3c.f7;u m=B.J;if(H(3c)=="G"&&H(3c.1w)=="L"){3c=m.mq(3c)}if(H(ao)!="G"){ao=3c}if(H(4o)!="L"){f6=4o}if(H(5f)=="L"){5f=[]}N{5f=5f.9T()}m.1R(5f,M,2);u 7Q=G(){u ap=M;u me=M.2U;if(me.am.K>0){ap=m.2o(me.am,ap)}u 4o=me.f7;if(!4o){4o=D}F me.f5.1w(4o,ap)};7Q.f7=f6;7Q.f5=ao;7Q.am=5f;F 7Q},lF:G(7P){u mp=B.J.1O;R(u k in 7P){u f4=7P[k];if(H(f4)=="G"){7P[k]=mp(f4,7P)}}},5u:G(mo,mn,ml,mk){B.J.ae.5M(mo,mn,ml,mk)},mj:{"5L":1h,"1n":1h,"2y":1h},2f:G(a,b){if(a==b){F 0}u f3=(H(a)=="L"||a===O);u f2=(H(b)=="L"||b===O);if(f3&&f2){F 0}N{if(f3){F-1}N{if(f2){F 1}}}u m=B.J;u f1=m.mj;if(!(H(a)in f1&&H(b)in f1)){1f{F m.ae.3C(a,b)}1e(e){if(e!=m.4d){14 e}}}if(a<b){F-1}N{if(a>b){F 1}}u f0=m.U;14 Y 3p(f0(a)+" 3W "+f0(b)+" 9v 2E be vv")},eM:G(a,b){F B.J.2f(a.9P(),b.9P())},eL:G(a,b){u mi=B.J.2f;u 7O=a.K;u al=0;if(7O>b.K){al=1;7O=b.K}N{if(7O<b.K){al=-1}}R(u i=0;i<7O;i++){u 4j=mi(a[i],b[i]);if(4j){F 4j}}F al},7M:G(mh,mg,mf,md){B.J.ad.5M(mh,mg,mf,md)},U:G(o){if(H(o)=="L"){F"L"}N{if(o===O){F"O"}}1f{if(H(o.1K)=="G"){F o.1K()}N{if(H(o.U)=="G"&&o.U!=M.2U){F o.U()}}F B.J.ad.3C(o)}1e(e){if(H(o.1r)=="1n"&&(o.1l==cZ.1U.1l||o.1l==vu.1U.1l)){F o.1r}}1f{u eZ=(o+"")}1e(e){F"["+H(o)+"]"}if(H(o)=="G"){o=eZ.23(/^\\s+/,"");u 5n=o.2A("{");if(5n!=-1){o=o.3H(0,5n)+"{...}"}}F eZ},eK:G(o){u m=B.J;F"["+m.2r(m.U,o).2b(", ")+"]"},ac:G(o){F("\\""+o.23(/(["\\\\])/g,"\\\\$1")+"\\"").23(/[\\f]/g,"\\\\f").23(/[\\b]/g,"\\\\b").23(/[\\n]/g,"\\\\n").23(/[\\t]/g,"\\\\t").23(/[\\r]/g,"\\\\r")},eJ:G(o){F o+""},ly:G(mc,mb,ma,m9){B.J.ab.5M(mc,mb,ma,m9)},lx:G(){F dB("("+M[0]+")")},lz:G(o){u 5e=H(o);if(5e=="L"){F"L"}N{if(5e=="2y"||5e=="5L"){F o+""}N{if(o===O){F"O"}}}u m=B.J;u eY=m.ac;if(5e=="1n"){F eY(o)}u me=M.2U;u 3S;if(H(o.m8)=="G"){3S=o.m8();if(o!==3S){F me(3S)}}if(H(o.m7)=="G"){3S=o.m7();if(o!==3S){F me(3S)}}if(5e!="G"&&H(o.K)=="2y"){u X=[];R(u i=0;i<o.K;i++){u 2i=me(o[i]);if(H(2i)!="1n"){2i="L"}X.1c(2i)}F"["+X.2b(", ")+"]"}1f{3S=m.ab.3C(o);F me(3S)}1e(e){if(e!=m.4d){14 e}}if(5e=="G"){F O}X=[];R(u k in o){u ak;if(H(k)=="2y"){ak="\\""+k+"\\""}N{if(H(k)=="1n"){ak=eY(k)}N{2V}}2i=me(o[k]);if(H(2i)!="1n"){2V}X.1c(ak+":"+2i)}F"{"+X.2b(", ")+"}"},lE:G(a,b){F(B.J.2f(a,b)===0)},lD:G(eX,4n){if(eX.K!=4n.K){F 1m}F(B.J.2f(eX,4n)===0)},2o:G(){u eW=[];u m6=B.J.1R;R(u i=0;i<M.K;i++){m6(eW,M[i])}F eW},eR:G(2h){u m=B.J;u eU=m.2f;if(M.K==1){F G(a,b){F eU(a[2h],b[2h])}}u eV=m.1R(O,M);F G(a,b){u aj=0;R(u i=0;(aj===0)&&(i<eV.K);i++){u 2h=eV[i];aj=eU(a[2h],b[2h])}F aj}},lC:G(2h){u m5=B.J.eR.1w(D,M);F G(a,b){F m5(b,a)}},2z:G(m4){u m=B.J;F m.1O.1w(D,m.1R([m4,L],M,1))},67:G(m0,1g){if(1g.K===0){F O}u ai=1g[0];u m3=B.J.2f;R(u i=1;i<1g.K;i++){u o=1g[i];if(m3(o,ai)==m0){ai=o}}F ai},lB:G(){F B.J.67(1,M)},lA:G(){F B.J.67(-1,M)},bi:G(1g,lY,lZ,3B){if(H(3B)=="L"||3B===O){3B=1g.K}R(u i=(lZ||0);i<3B;i++){if(1g[i]===lY){F i}}F-1},eO:G(1g,lW,lX,3B){if(H(3B)=="L"||3B===O){3B=1g.K}u 4j=B.J.2f;R(u i=(lX||0);i<3B;i++){if(4j(1g[i],lW)===0){F i}}F-1},d4:G(1j,lV){u ah=[1j];u lU=B.J.1R;1M(ah.K){u X=lV(ah.2P());if(X){lU(ah,X)}}},3f:G(ag){u 2w=ag.1r;if(H(2w)=="L"){2w=""}N{2w=2w+"."}R(u 1b in ag){u o=ag[1b];if(H(o)=="G"&&H(o.1r)=="L"){1f{o.1r=2w+1b}1e(e){}}}},dw:G(3s,68){if(H(B.S)!="L"&&M.K==1&&(H(3s)=="1n"||(H(3s.3T)!="L"&&3s.3T>0))){u kv=B.S.d5(3s);3s=kv[0];68=kv[1]}N{if(M.K==1){u o=3s;3s=[];68=[];R(u k in o){u v=o[k];if(H(v)!="G"){3s.1c(k);68.1c(v)}}}}u W=[];u lT=28.2a(3s.K,68.K);u eT=B.J.af;R(u i=0;i<lT;i++){v=68[i];if(H(v)!="L"&&v!==O){W.1c(eT(3s[i])+"="+eT(v))}}F W.2b("&")},lw:G(lS,lQ){u 7N=lS.23(/\\+/g,"%20").2R("&");u o={};u 5d;if(H(lR)!="L"){5d=lR}N{5d=vt}if(lQ){R(u i=0;i<7N.K;i++){u 2n=7N[i].2R("=");u 1b=5d(2n[0]);u 4n=o[1b];if(!(4n 2C 7o)){4n=[];o[1b]=4n}4n.1c(5d(2n[1]))}}N{R(i=0;i<7N.K;i++){2n=7N[i].2R("=");o[5d(2n[0])]=5d(2n[1])}}F o}});B.J.4a=G(){D.4m=[]};B.J.4a.1U={5M:G(1b,eS,3y,lP){if(lP){D.4m.e9([1b,eS,3y])}N{D.4m.1c([1b,eS,3y])}},3C:G(){R(u i=0;i<D.4m.K;i++){u 2n=D.4m[i];if(2n[1].1w(D,M)){F 2n[2].1w(D,M)}}14 B.J.4d},vs:G(1b){R(u i=0;i<D.4m.K;i++){u 2n=D.4m[i];if(2n[0]==1b){D.4m.4y(i,1);F 1h}}F 1m}};B.J.1z=["4f","4L","1R","2l","8Z","lO","lN","lM","5a","4i","24","lL","66","lo","ln","lK","lJ","lI","7e","3A","eN","lH","2r","lG","47","1O","lF","4d","4a","5u","2f","7M","U","lE","lD","2o","eR","lC","2z","lm","67","lp","eI","lB","lA","d4","ll","af","dw","lz","ly","lx","lw","eO","bi","bg","lv"];B.J.1W=["3f","ae","ad","ab","eM","eL","eK","ac","eJ"];B.J.2Y=G(lu,eP){if(H(B.eQ)=="L"){B.eQ=(B.3d||(H(1x)=="L"&&H(1q)=="L"))}if(!B.eQ){F}u 1p=eP.2k[":1p"];R(u i=0;i<1p.K;i++){lu[1p[i]]=eP[1p[i]]}};B.J.2d=G(){u m=D;m.vr=m.24;m.vq=m.eO;if(H(ls)!="L"){m.af=G(lr){F ls(lr).23(/\\\'/g,"%27")}}N{m.af=G(lq){F vp(lq).23(/\\+/g,"%2B").23(/\\"/g,"%22").W.23(/\\\'/g,"%27")}}m.5a=G(1b){D.43=1b;D.1b=1b};m.5a.1U=Y 2x();m.2l(m.5a.1U,{U:G(){if(D.43&&D.43!=D.1b){F D.1b+"("+m.U(D.43)+")"}N{F D.1b+"()"}},1l:m.24("U")});m.4d=Y m.5a("B.J.4d");m.lp=m.2z(m.67,1);m.eI=m.2z(m.67,-1);m.lo=m.66("G");m.ln=m.66("L");m.lm=m.2z(m.2l,O);m.ll=m.2z(m.2r,O);m.ae=Y m.4a();m.5u("vo",m.eN,m.eM);m.5u("ej",m.3A,m.eL);m.ad=Y m.4a();m.7M("ej",m.3A,m.eK);m.7M("1n",m.66("1n"),m.ac);m.7M("vn",m.66("2y","5L"),m.eJ);m.ab=Y m.4a();u 1p=m.2o(m.1z,m.1W);m.2k={":3e":m.2o(m.1W),":1p":1p};m.3f(D)};B.J.2d();if(!B.3d){2f=B.J.2f}B.J.2Y(D,B.J);if(H(1q)!="L"){1q.2X("B.15");1q.2M("B.J")}if(H(1x)!="L"){1x.26("B.J",[])}1f{if(H(B.J)=="L"){14""}}1e(e){14"B.15 3F on B.J!"}if(H(B.15)=="L"){B.15={}}B.15.1r="B.15";B.15.1Y="1.3.1";B.J.2l(B.15,{1K:G(){F"["+D.1r+" "+D.1Y+"]"},1l:G(){F D.1K()},9W:G(1b,lk,lj,lh){B.15.9Y.5M(1b,lk,lj,lh)},1Q:G(3R,lg){u I=B.15;if(M.K==2){F I.9Z(G(a){F a!=lg},3R)}if(H(3R.1a)=="G"){F 3R}N{if(H(3R.1Q)=="G"){F 3R.1Q()}}1f{F I.9Y.3C(3R)}1e(e){u m=B.J;if(e==m.4d){e=Y 3p(H(3R)+": "+m.U(3R)+" is 2E vm")}14 e}},eu:G(n){if(!n){n=0}u m=B.J;F{U:G(){F"eu("+n+")"},1l:m.24("U"),1a:m.4f(n)}},et:G(p){u I=B.15;u m=B.J;u 1g=[];u lf=I.1Q(p);F{U:G(){F"et(...)"},1l:m.24("U"),1a:G(){1f{u W=lf.1a();1g.1c(W);F W}1e(e){if(e!=I.25){14 e}if(1g.K===0){D.1a=G(){14 I.25}}N{u i=-1;D.1a=G(){i=(i+1)%1g.K;F 1g[i]}}F D.1a()}}}},7b:G(Q,n){u m=B.J;if(H(n)=="L"){F{U:G(){F"7b("+m.U(Q)+")"},1l:m.24("U"),1a:G(){F Q}}}F{U:G(){F"7b("+m.U(Q)+", "+n+")"},1l:m.24("U"),1a:G(){if(n<=0){14 B.15.25}n-=1;F Q}}},1a:G(ld){F ld.1a()},es:G(p,q){u m=B.J;u 1a=B.15.1a;u lc=m.2r(1Q,M);F{U:G(){F"es(...)"},1l:m.24("U"),1a:G(){F m.2r(1a,lc)}}},a1:G(3b,1V){u m=B.J;1V=B.15.1Q(1V);if(3b===O){3b=m.4i.7L}F{U:G(){F"a1(...)"},1l:m.24("U"),1a:G(){1M(1h){u W=1V.1a();if(3b(W)){F W}}F L}}},a0:G(3b,1V){u m=B.J;1V=B.15.1Q(1V);if(3b===O){3b=m.4i.7L}F{U:G(){F"a0(...)"},1l:m.24("U"),1a:G(){1M(1h){u W=1V.1a();if(!3b(W)){F W}}F L}}},er:G(1V){u I=B.15;u m=B.J;1V=I.1Q(1V);u 5c=0;u 2J=0;u 3a=1;u i=-1;if(M.K==2){2J=M[1]}N{if(M.K==3){5c=M[1];2J=M[2]}N{5c=M[1];2J=M[2];3a=M[3]}}F{U:G(){F"er("+["...",5c,2J,3a].2b(", ")+")"},1l:m.24("U"),1a:G(){u W;1M(i<5c){W=1V.1a();i++}if(5c>=2J){14 I.25}5c+=3a;F W}}},4c:G(aa,p,q){u m=B.J;u I=B.15;u lb=m.2r(I.1Q,m.1R(O,M,1));u 2r=m.2r;u 1a=I.1a;F{U:G(){F"4c(...)"},1l:m.24("U"),1a:G(){F aa.1w(D,2r(1a,lb))}}},ep:G(aa,1V,I){1V=B.15.1Q(1V);u m=B.J;F{U:G(){F"ep(...)"},1l:m.24("U"),1a:G(){F aa.1w(I,1V.1a())}}},55:G(p,q){u I=B.15;u m=B.J;if(M.K==1){F I.1Q(M[0])}u 64=m.2r(I.1Q,M);F{U:G(){F"55(...)"},1l:m.24("U"),1a:G(){1M(64.K>1){1f{F 64[0].1a()}1e(e){if(e!=I.25){14 e}64.2P()}}if(64.K==1){u a9=64.2P();D.1a=m.1O("1a",a9);F D.1a()}14 I.25}}},9Z:G(3b,1V){u I=B.15;1V=I.1Q(1V);F{U:G(){F"9Z(...)"},1l:B.J.24("U"),1a:G(){u W=1V.1a();if(!3b(W)){D.1a=G(){14 I.25};D.1a()}F W}}},eo:G(3b,1V){1V=B.15.1Q(1V);u m=B.J;u 1O=m.1O;F{"U":G(){F"eo(...)"},"1l":m.24("U"),"1a":G(){1M(1h){u W=1V.1a();if(!3b(W)){2K}}D.1a=1O("1a",1V);F W}}},a7:G(63,2u,la){2u.62[63]=-1;u m=B.J;u l9=m.eI;F{U:G(){F"en("+63+", ...)"},1l:m.24("U"),1a:G(){u W;u i=2u.62[63];if(i==2u.29){W=la.1a();2u.a8.1c(W);2u.29+=1;2u.62[63]+=1}N{W=2u.a8[i-2u.2a];2u.62[63]+=1;if(i==2u.2a&&l9(2u.62)!=2u.2a){2u.2a+=1;2u.a8.2P()}}F W}}},en:G(a6,n){u W=[];u 2u={"62":[],"a8":[],"29":-1,"2a":-1};if(M.K==1){n=2}u I=B.15;a6=I.1Q(a6);u a7=I.a7;R(u i=0;i<n;i++){W.1c(a7(i,2u,a6))}F W},2G:G(4l){u m=B.J;if(H(4l.9T)=="G"){F 4l.9T()}N{if(m.3A(4l)){F m.2o(4l)}}u I=B.15;4l=I.1Q(4l);u W=[];1f{1M(1h){W.1c(4l.1a())}}1e(e){if(e!=I.25){14 e}F W}F L},7H:G(fn,7K,l8){u i=0;u x=l8;u I=B.15;7K=I.1Q(7K);if(M.K<3){1f{x=7K.1a()}1e(e){if(e==I.25){e=Y 3p("7H() of vl vk vj no vi 3m")}14 e}i++}1f{1M(1h){x=fn(x,7K.1a())}}1e(e){if(e!=I.25){14 e}}F x},7I:G(){u 4k=0;u 2J=0;u 3a=1;if(M.K==1){2J=M[0]}N{if(M.K==2){4k=M[0];2J=M[1]}N{if(M.K==3){4k=M[0];2J=M[1];3a=M[2]}N{14 Y 3p("7I() vh 1, 2, or 3 M!")}}}if(3a===0){14 Y 3p("7I() 3a 5p 2E be 0")}F{1a:G(){if((3a>0&&4k>=2J)||(3a<0&&4k<=2J)){14 B.15.25}u W=4k;4k+=3a;F W},U:G(){F"7I("+[4k,2J,3a].2b(", ")+")"},1l:B.J.24("U")}},l0:G(a5,l7){u x=l7||0;u I=B.15;a5=I.1Q(a5);1f{1M(1h){x+=a5.1a()}}1e(e){if(e!=I.25){14 e}}F x},em:G(a4){u I=B.15;a4=I.1Q(a4);1f{1M(1h){a4.1a()}}1e(e){if(e!=I.25){14 e}}},9a:G(7J,1A,I){u m=B.J;if(M.K>2){1A=m.1O(1A,I)}if(m.3A(7J)){1f{R(u i=0;i<7J.K;i++){1A(7J[i])}}1e(e){if(e!=B.15.25){14 e}}}N{I=B.15;I.em(I.4c(1A,7J))}},kZ:G(l6,1A){u I=B.15;1f{I.a0(1A,l6).1a();F 1m}1e(e){if(e!=I.25){14 e}F 1h}},kY:G(l5,4j){u W=B.15.2G(l5);if(M.K==1){4j=B.J.2f}W.iz(4j);F W},kX:G(l4){u W=B.15.2G(l4);W.vg();F W},kW:G(l3,1A){u I=B.15;1f{I.a1(1A,l3).1a();F 1h}1e(e){if(e!=I.25){14 e}F 1m}},kV:G(1g,5b){if(B.J.3A(5b)){R(u i=0;i<5b.K;i++){1g.1c(5b[i])}}N{u I=B.15;5b=I.1Q(5b);1f{1M(1h){1g.1c(5b.1a())}}1e(e){if(e!=I.25){14 e}}}F 1g},ek:G(a3,eH){u m=B.J;u I=B.15;if(M.K<2){eH=m.4i.eE}a3=I.1Q(a3);u pk=L;u k=L;u v;G eF(){v=a3.1a();k=eH(v)}G l2(){u 7j=v;v=L;F 7j}u eG=1h;F{U:G(){F"ek(...)"},1a:G(){1M(k==pk){eF();if(eG){eG=1m;2K}}pk=k;F[k,{1a:G(){if(v==L){eF()}if(k!=pk){14 I.25}F l2()}}]}}},kU:G(a2,eD){u m=B.J;u I=B.15;if(M.K<2){eD=m.4i.eE}a2=I.1Q(a2);u ey=[];u eA=1h;u ez;1M(1h){1f{u eB=a2.1a();u 2h=eD(eB)}1e(e){if(e==I.25){2K}14 e}if(eA||2h!=ez){u eC=[];ey.1c([2h,eC])}eC.1c(eB);eA=1m;ez=2h}F ey},9X:G(ex){u i=0;F{U:G(){F"9X(...)"},1l:B.J.24("U"),1a:G(){if(i>=ex.K){14 B.15.25}F ex[i++]}}},eh:G(ew){F(ew&&H(ew.ei)=="G")},9V:G(l1){F{U:G(){F"9V(...)"},1l:B.J.24("U"),1a:G(){u W=l1.ei();if(W===O||W===L){14 B.15.25}F W}}}});B.15.1W=["9Y","9X","eh","9V",];B.15.1z=["25","9W","1Q","eu","et","7b","1a","es","a1","a0","er","4c","ep","55","9Z","eo","en","2G","7H","7I","l0","em","9a","kZ","kY","kX","kW","kV","ek","kU"];B.15.2d=G(){u m=B.J;D.25=Y m.5a("25");D.9Y=Y m.4a();D.9W("ej",m.3A,D.9X);D.9W("ei",D.eh,D.9V);D.2k={":3e":D.1z,":1p":m.2o(D.1z,D.1W)};m.3f(D)};B.15.2d();if(!B.3d){7H=B.15.7H}B.J.2Y(D,B.15);if(H(1q)!="L"){1q.2X("B.1H");1q.2M("B.J")}if(H(1x)!="L"){1x.26("B.J",[])}1f{if(H(B.J)=="L"){14""}}1e(e){14"B.1H 3F on B.J!"}if(H(B.1H)=="L"){B.1H={}}B.1H.1r="B.1H";B.1H.1Y="1.3.1";B.1H.1K=G(){F"["+D.1r+" "+D.1Y+"]"};B.1H.1l=G(){F D.1K()};B.1H.1z=["5C","49","7A","kR","2L","5Z","kG","ch","kE","kC"];B.1H.1W=["ef","e8","e7"];B.1H.49=G(1P,kT,3z){D.1P=1P;D.3N=kT;D.3z=3z;D.vf=Y 3Q()};B.1H.49.1U={U:G(){u m=B.J;F"49("+m.2r(m.U,[D.1P,D.3N,D.3z]).2b(", ")+")"},1l:B.J.24("U")};B.J.2l(B.1H,{ef:G(7F){u I=B.1H;if(H(7F)=="1n"){7F=I.5C[7F]}F G(1t){u 7G=1t.3N;if(H(7G)=="1n"){7G=I.5C[7G]}F 7G>=7F}},e8:G(){u kS=B.1H.49;R(u i=0;i<M.K;i++){if(!(M[i]2C kS)){F 1m}}F 1h},e7:G(a,b){F B.J.2f([a.3N,a.3z],[b.3N,b.3z])},kR:G(1t){cq("1P: "+1t.1P+"\\ve: "+1t.3N+"\\vd: "+1t.3z.2b(" "))}});B.1H.7A=G(7E){D.4f=0;if(H(7E)=="L"||7E===O){7E=-1}D.ec=7E;D.4h=[];D.7C={};D.e5=1m};B.1H.7A.1U={vc:G(){D.4h.4y(0,D.4h.K)},kK:G(1t){if(H(2O)!="L"&&2O.eg&&2O.eg.5Z){2O.eg.5Z(1t)}N{if(H(7h)!="L"&&7h.kQ){7h.kQ(1t)}N{if(H(5X)=="G"){5X(1t)}}}},kL:G(1t){R(u k in D.7C){u 2n=D.7C[k];if(2n.kO!=k||(2n[0]&&!2n[0](1t))){2V}2n[1](1t)}},hE:G(ee,7D,kP){if(H(7D)=="1n"){7D=B.1H.ef(7D)}u ed=[7D,kP];ed.kO=ee;D.7C[ee]=ed},c9:G(kN){gi D.7C[kN]},kH:G(kM,vb){u 1t=Y B.1H.49(D.4f,kM,B.J.1R(O,M,1));D.4h.1c(1t);D.kL(1t);if(D.e5){D.kK(1t.3N+": "+1t.3z.2b(" "))}D.4f+=1;1M(D.ec>=0&&D.4h.K>D.ec){D.4h.2P()}},c8:G(9U){u ea=0;if(!(H(9U)=="L"||9U===O)){ea=28.29(0,D.4h.K-9U)}F D.4h.9T(ea)},kJ:G(7B){if(H(7B)=="L"||7B===O){7B=30}u 9S=D.c8(7B);if(9S.K){u 1g=2r(G(m){F"\\n ["+m.1P+"] "+m.3N+": "+m.3z.2b(" ")},9S);1g.e9("va "+9S.K+" v9:");F 1g.2b("")}F""},v8:G(kI){if(H(B.1I)=="L"){cq(D.kJ())}N{B.1I.bY(kI||1m)}}};B.1H.2d=G(){D.5C={8M:40,8L:50,8K:30,8J:20,8I:10};u m=B.J;m.5u("49",D.e8,D.e7);u 61=m.2z;u e6=D.7A;u 60=e6.1U.kH;m.2l(D.7A.1U,{kF:61(60,"8I"),5Z:61(60,"8J"),dE:61(60,"8M"),kD:61(60,"8L"),kB:61(60,"8K")});u I=D;u 5Y=G(1b){F G(){I.2L[1b].1w(I.2L,M)}};D.5Z=5Y("5Z");D.kG=5Y("dE");D.ch=5Y("kF");D.kE=5Y("kD");D.kC=5Y("kB");D.2L=Y e6();D.2L.e5=1h;D.2k={":3e":D.1z,":1p":m.2o(D.1z,D.1W)};m.3f(D)};if(H(5X)=="L"&&H(2v)!="L"&&2v.kA&&H(kz)!="L"){5X=G(){5X.3G=M;u ev=2v.kA("v7");ev.v6("5X",1m,1h);kz(ev)}}B.1H.2d();B.J.2Y(D,B.1H);if(H(1q)!="L"){1q.2X("B.1D")}if(H(B)=="L"){B={}}if(H(B.1D)=="L"){B.1D={}}B.1D.1r="B.1D";B.1D.1Y="1.3.1";B.1D.1K=G(){F"["+D.1r+" "+D.1Y+"]"};B.1D.1l=G(){F D.1K()};B.1D.ks=G(1y){1y=1y+"";if(H(1y)!="1n"||1y.K===0){F O}u 7z=1y.2R("-");if(7z.K===0){F O}F Y 3Q(7z[0],7z[1]-1,7z[2])};B.1D.ky=/(\\d{4,})(?:-(\\d{1,2})(?:-(\\d{1,2})(?:[T ](\\d{1,2}):(\\d{1,2})(?::(\\d{1,2})(?:\\.(\\d+))?)?(?:(Z)|([+-])(\\d{1,2})(?::(\\d{1,2}))?)?)?)?)?/;B.1D.kr=G(1y){1y=1y+"";if(H(1y)!="1n"||1y.K===0){F O}u X=1y.3C(B.1D.ky);if(H(X)=="L"||X===O){F O}u 5W,7y,7x,9R,2a,9Q,7w;5W=3w(X[1],10);if(H(X[2])=="L"||X[2]===""){F Y 3Q(5W)}7y=3w(X[2],10)-1;7x=3w(X[3],10);if(H(X[4])=="L"||X[4]===""){F Y 3Q(5W,7y,7x)}9R=3w(X[4],10);2a=3w(X[5],10);9Q=(H(X[6])!="L"&&X[6]!=="")?3w(X[6],10):0;if(H(X[7])!="L"&&X[7]!==""){7w=28.ha(c5*4M("0."+X[7]))}N{7w=0}if((H(X[8])=="L"||X[8]==="")&&(H(X[9])=="L"||X[9]==="")){F Y 3Q(5W,7y,7x,9R,2a,9Q,7w)}u 58;if(H(X[9])!="L"&&X[9]!==""){58=3w(X[10],10)*v5;if(H(X[11])!="L"&&X[11]!==""){58+=3w(X[11],10)*kw}if(X[9]=="-"){58=-58}}N{58=0}F Y 3Q(3Q.v4(5W,7y,7x,9R,2a,9Q,7w)-58)};B.1D.dY=G(2g,kx){if(H(2g)=="L"||2g===O){F O}u hh=2g.v3();u mm=2g.v2();u ss=2g.v1();u 1g=[((kx&&(hh<10))?"0"+hh:hh),((mm<10)?"0"+mm:mm),((ss<10)?"0"+ss:ss)];F 1g.2b(":")};B.1D.kq=G(2g,7v){if(H(2g)=="L"||2g===O){F O}u ku=7v?"T":" ";u kt=7v?"Z":"";if(7v){2g=Y 3Q(2g.9P()+(2g.v0()*kw))}F B.1D.dX(2g)+ku+B.1D.dY(2g,7v)+kt};B.1D.dX=G(2g){if(H(2g)=="L"||2g===O){F O}u e4=B.1D.e3;F[2g.dZ(),e4(2g.e1()+1),e4(2g.e0())].2b("-")};B.1D.kp=G(d){d=d+"";if(H(d)!="1n"||d.K===0){F O}u a=d.2R("/");F Y 3Q(a[2],a[0]-1,a[1])};B.1D.e3=G(n){F(n>9)?n:"0"+n};B.1D.ko=G(d){if(H(d)=="L"||d===O){F O}u e2=B.1D.e3;F[e2(d.e1()+1),e2(d.e0()),d.dZ()].2b("/")};B.1D.kn=G(d){if(H(d)=="L"||d===O){F O}F[d.e1()+1,d.e0(),d.dZ()].2b("/")};B.1D.1z=["ks","kr","dY","kq","dX","kp","ko","kn"];B.1D.1W=[];B.1D.2k={":3e":B.1D.1z,":1p":B.1D.1z};B.1D.2d=G(){u 2w=D.1r+".";R(u k in D){u o=D[k];if(H(o)=="G"&&H(o.1r)=="L"){1f{o.1r=2w+k}1e(e){}}}};B.1D.2d();if(H(B.J)!="L"){B.J.2Y(D,B.1D)}N{(G(km,dW){if((H(1x)=="L"&&H(1q)=="L")||(H(B.3d)=="5L"&&B.3d)){u 1p=dW.2k[":1p"];R(u i=0;i<1p.K;i++){km[1p[i]]=dW[1p[i]]}}})(D,B.1D)}if(H(1q)!="L"){1q.2X("B.1s")}if(H(B)=="L"){B={}}if(H(B.1s)=="L"){B.1s={}}B.1s.1r="B.1s";B.1s.1Y="1.3.1";B.1s.1K=G(){F"["+D.1r+" "+D.1Y+"]"};B.1s.1l=G(){F D.1K()};B.1s.ke=G(kl,kk,kj,ki,kh,dV,kg,9N,kf){F G(1P){1P=4M(1P);if(H(1P)=="L"||1P===O||k8(1P)){F kl}u 9L=kk;u 9K=kj;if(1P<0){1P=-1P}N{9L=9L.23(/-/,"")}u me=M.2U;u 9M=B.1s.dJ(ki);if(kh){1P=1P*3k;9K=9M.9y+9K}1P=B.1s.dK(1P,dV);u 9O=1P.2R(/\\./);u 3r=9O[0];u 3P=(9O.K==1)?"":9O[1];u X="";1M(3r.K<kg){3r="0"+3r}if(9N){1M(3r.K>9N){u i=3r.K-9N;X=9M.9A+3r.2W(i,3r.K)+X;3r=3r.2W(0,i)}}X=3r+X;if(dV>0){1M(3P.K<kf){3P=3P+"0"}X=X+9M.9z+3P}F 9L+X+9K}};B.1s.k5=G(9J,9H,9G){if(H(9H)=="L"){9H=""}u 3q=9J.3C(/((?:[0#]+,)?[0#]+)(?:\\.([0#]+))?(%)?/);if(!3q){14 3p("uZ uY")}u 7u=9J.3H(0,3q.c6);u kd=9J.3H(3q.c6+3q[0].K);if(7u.uX(/-/)==-1){7u=7u+"-"}u 9I=3q[1];u 3P=(H(3q[2])=="1n"&&3q[2]!="")?3q[2]:"";u kc=(H(3q[3])=="1n"&&3q[3]!="");u dU=9I.2R(/,/);u 9F;if(H(9G)=="L"){9G="dG"}if(dU.K==1){9F=O}N{9F=dU[1].K}u ka=9I.K-9I.23(/0/g,"").K;u k9=3P.K-3P.23(/0/g,"").K;u kb=3P.K;u W=B.1s.ke(9H,7u,kd,9G,kc,kb,ka,9F,k9);u m=B.J;if(m){u fn=M.2U;u 3G=m.2o(M);W.U=G(){F[I.1r,"(",2r(m.U,3G).2b(", "),")"].2b("")}}F W};B.1s.dJ=G(4g){if(H(4g)=="L"||4g===O){4g="dG"}if(H(4g)=="1n"){u W=B.1s.5V[4g];if(H(W)=="1n"){W=M.2U(W);B.1s.5V[4g]=W}F W}N{F 4g}};B.1s.k4=G(dT,9E){if(9E){u X=dT/9E;if(!k8(X)){F B.1s.9B(dT/9E)}}F"0"};B.1s.9B=G(dS){u dR=(dS<0?"-":"");u s=28.8B(28.uW(dS)*3k).1l();if(s=="0"){F s}if(s.K<3){1M(s.3Z(s.K-1)=="0"){s=s.2W(0,s.K-1)}F dR+"0."+s}u 5E=dR+s.2W(0,s.K-2);u 7t=s.2W(s.K-2,s.K);if(7t=="uV"){F 5E}N{if(7t.3Z(1)=="0"){F 5E+"."+7t.3Z(0)}N{F 5E+"."+7t}}};B.1s.dI=G(1y,dQ){1y=1y+"";if(H(1y)!="1n"){F O}if(!dQ){F 1y.23(/^\\s+/,"")}N{F 1y.23(Y 8V("^["+dQ+"]+"),"")}};B.1s.dH=G(1y,dP){1y=1y+"";if(H(1y)!="1n"){F O}if(!dP){F 1y.23(/\\s+$/,"")}N{F 1y.23(Y 8V("["+dP+"]+$"),"")}};B.1s.k2=G(1y,dO){u I=B.1s;F I.dH(I.dI(1y,dO),dO)};B.1s.dL=G(9D,9C){9D=28.8B(9D*28.dN(10,9C));u X=(9D*28.dN(10,-9C)).6I(9C);if(X.3Z(0)=="."){X="0"+X}F X};B.1s.dK=G(k7,dM){F B.1s.dL(k7+0.5*28.dN(10,-dM),dM)};B.1s.k3=G(k6){F B.1s.9B(3k*k6)+"%"};B.1s.1z=["dL","dK","k5","dJ","k4","9B","k3","dI","dH","k2"];B.1s.5V={k1:{9A:",",9z:".",9y:"%"},uU:{9A:".",9z:",",9y:"%"},uT:{9A:" ",9z:",",9y:"%"},"dG":"k1"};B.1s.1W=[];B.1s.2k={":1p":B.1s.1z,":3e":B.1s.1z};B.1s.2d=G(){u 2w=D.1r+".";u k,v,o;R(k in D.5V){o=D.5V[k];if(H(o)=="3n"){o.U=G(){F D.1r};o.1r=2w+"5V."+k}}R(k in D){o=D[k];if(H(o)=="G"&&H(o.1r)=="L"){1f{o.1r=2w+k}1e(e){}}}};B.1s.2d();if(H(B.J)!="L"){B.J.2Y(D,B.1s)}N{(G(k0,dF){if((H(1x)=="L"&&H(1q)=="L")||(H(B.3d)=="5L"&&B.3d)){u 1p=dF.2k[":1p"];R(u i=0;i<1p.K;i++){k0[1p[i]]=dF[1p[i]]}}})(D,B.1s)}if(H(1q)!="L"){1q.2X("B.1k");1q.2M("B.J")}if(H(1x)!="L"){1x.26("B.J",[])}1f{if(H(B.J)=="L"){14""}}1e(e){14"B.1k 3F on B.J!"}if(H(B.1k)=="L"){B.1k={}}B.1k.1r="B.1k";B.1k.1Y="1.3.1";B.1k.1K=G(){F"["+D.1r+" "+D.1Y+"]"};B.1k.1l=G(){F D.1K()};B.1k.2t=G(jZ){D.55=[];D.id=D.7n();D.2H=-1;D.54=0;D.53=[O,O];D.7m=jZ;D.7l=1m;D.7r=1m};B.1k.2t.1U={U:G(){u 7s;if(D.2H==-1){7s="uS"}N{if(D.2H===0){7s="uR"}N{7s="dE"}}F"2t("+D.id+", "+7s+")"},1l:B.J.24("U"),7n:B.J.4f(),jY:G(){u I=B.1k;if(D.2H==-1){if(D.7m){D.7m(D)}N{D.7l=1h}if(D.2H==-1){D.52(Y I.di(D))}}N{if((D.2H===0)&&(D.53[0]2C I.2t)){D.53[0].jY()}}},jQ:G(){D.54++},jX:G(){D.54--;if((D.54===0)&&(D.2H>=0)){D.9u()}},jR:G(X){D.9x(X);D.jX()},9x:G(X){D.2H=((X 2C 2x)?1:0);D.53[D.2H]=X;D.9u()},dD:G(){if(D.2H!=-1){if(!D.7l){14 Y B.1k.dj(D)}D.7l=1m;F}},3o:G(X){D.dD();if(X 2C B.1k.2t){14 Y 2x("2t jW 9v aB be 7r if jV jU jT jS of a 3o")}D.9x(X)},52:G(X){D.dD();u I=B.1k;if(X 2C I.2t){14 Y 2x("2t jW 9v aB be 7r if jV jU jT jS of a 3o")}if(!(X 2C 2x)){X=Y I.9p(X)}D.9x(X)},jP:G(fn){if(M.K>1){fn=B.J.2z.1w(O,M)}F D.9w(fn,fn)},5Q:G(fn){if(M.K>1){fn=B.J.2z.1w(O,M)}F D.9w(fn,O)},jA:G(fn){if(M.K>1){fn=B.J.2z.1w(O,M)}F D.9w(O,fn)},9w:G(cb,eb){if(D.7r){14 Y 2x("uQ uP 9v 2E be re-uO")}D.55.1c([cb,eb]);if(D.2H>=0){D.9u()}F D},9u:G(){u dC=D.55;u 56=D.2H;u X=D.53[56];u I=D;u cb=O;1M(dC.K>0&&D.54===0){u 2n=dC.2P();u f=2n[56];if(f===O){2V}1f{X=f(X);56=((X 2C 2x)?1:0);if(X 2C B.1k.2t){cb=G(X){I.jR(X)};D.jQ()}}1e(3O){56=1;if(!(3O 2C 2x)){3O=Y B.1k.9p(3O)}X=3O}}D.2H=56;D.53[56]=X;if(cb&&D.54){X.jP(cb);X.7r=1h}}};B.J.2l(B.1k,{dk:G(){F dB("("+M[0].jN+")")},dp:G(uN){u d=Y B.1k.2t();d.3o.1w(d,M);F d},9q:G(uM){u d=Y B.1k.2t();d.52.1w(d,M);F d},do:G(){u I=M.2U;if(!I.7q){u dy=[G(){F Y 7q()},G(){F Y dA("jO.dz")},G(){F Y dA("uL.dz")},G(){F Y dA("jO.dz.4.0")},G(){14 Y B.1k.dh("uK uJ 2E uI 7q")}];R(u i=0;i<dy.K;i++){u 1A=dy[i];1f{I.7q=1A;F 1A()}1e(e){}}}F I.7q()},dx:G(){},jK:G(d){if(D.uH==4){1f{D.5T=O}1e(e){1f{D.5T=B.1k.dx}1e(e){}}u 5U=O;1f{5U=D.jm;if(!5U&&B.J.7e(D.jN)){5U=jM}}1e(e){}if(5U==hQ||5U==jM){d.3o(D)}N{u 3O=Y B.1k.dg(D,"uG uF");if(3O.2y){d.52(3O)}N{d.52(3O)}}}},jL:G(2s){1f{2s.5T=O}1e(e){1f{2s.5T=B.1k.dx}1e(e){}}2s.uE()},dl:G(2s,7p){if(H(7p)=="L"||7p===O){7p=""}u m=B.J;u I=B.1k;u d=Y I.2t(m.2z(I.jL,2s));1f{2s.5T=m.1O(I.jK,2s,d);2s.uD(7p)}1e(e){1f{2s.5T=O}1e(uC){}d.52(e)}F d},dn:G(5F){u I=B.1k;u 2s=I.do();if(M.K>1){u m=B.J;u qs=m.dw.1w(O,m.1R(O,M,1));if(qs){5F+="?"+qs}}2s.cp("uB",5F,1h);F I.dl(2s)},jv:G(5F){u I=B.1k;u d=I.dn.1w(I,M);d=d.5Q(I.dk);F d},dm:G(jJ,dv){u d=Y B.1k.2t();u m=B.J;if(H(dv)!="L"){d.5Q(G(){F dv})}u jI=uA(m.1O("3o",d),28.8B(jJ*c5));d.7m=G(){1f{uz(jI)}1e(e){}};F d},ju:G(jH,1A){u m=B.J;u jG=m.2z.1w(m,m.1R(O,M,1));F B.1k.dm(jH).5Q(G(X){F jG()})}});B.1k.5O=G(){D.5S=[];D.4e=1m;D.id=D.7n()};B.1k.5O.1U={bX:B.1k.5O,uy:G(){d=Y B.1k.2t();if(D.4e){D.5S.1c(d)}N{D.4e=1h;d.3o(D)}F d},jF:G(){if(!D.4e){14 3p("ux to jF an jE 5O")}D.4e=1m;if(D.5S.K>0){D.4e=1h;D.5S.2P().3o(D)}},7n:B.J.4f(),U:G(){u 9t;if(D.4e){9t="4e, "+D.5S.K+" 5S"}N{9t="jE"}F"5O("+D.id+", "+9t+")"},1l:B.J.24("U")};B.1k.7i=G(2G,du,jC,jB,jD){D.2G=2G;D.9r=Y 7o(D.2G.K);D.55=[];D.id=D.7n();D.2H=-1;D.54=0;D.53=[O,O];D.7m=jD;D.7l=1m;if(D.2G.K===0&&!du){D.3o(D.9r)}D.dr=0;D.jz=du;D.jy=jC;D.jx=jB;u 9s=0;B.J.2r(B.J.1O(G(d){d.5Q(B.J.1O(D.dt,D),9s,1h);d.jA(B.J.1O(D.dt,D),9s,1m);9s+=1},D),D.2G)};B.J.2l(B.1k.7i.1U,B.1k.2t.1U);B.J.2l(B.1k.7i.1U,{dt:G(ds,7k,5R){D.9r[ds]=[7k,5R];D.dr+=1;if(D.2H!==0){if(7k&&D.jz){D.3o([ds,5R])}N{if(!7k&&D.jy){D.52(5R)}N{if(D.dr==D.2G.K){D.3o(D.9r)}}}}if(!7k&&D.jx){5R=O}F 5R}});B.1k.jt=G(jw){u d=Y B.1k.7i(jw,1m,1h,1m);d.5Q(G(dq){u 7j=[];R(u i=0;i<dq.K;i++){7j.1c(dq[i][1])}F 7j});F d};B.1k.jr=G(1A){u I=B.1k;u 5P;1f{u r=1A.1w(O,B.J.1R([],M,1));if(r 2C I.2t){5P=r}N{if(r 2C 2x){5P=I.9q(r)}N{5P=I.dp(r)}}}1e(e){5P=I.9q(e)}F 5P};B.1k.1z=["dj","di","dh","9p","dg","2t","dp","9q","do","dn","jv","dm","ju","dl","5O","7i","jt","jr"];B.1k.1W=["dk"];B.1k.2d=G(){u m=B.J;u ne=m.2z(m.jq,D);ne("dj",G(jp){D.jo=jp});ne("di",G(jn){D.jo=jn});ne("dh",G(1t){D.43=1t});ne("9p",G(1t){D.43=1t});ne("dg",G(2s,1t){D.2s=2s;D.43=1t;1f{D.2y=2s.jm}1e(e){}});D.2k={":3e":D.1z,":1p":m.2o(D.1z,D.1W)};m.3f(D)};B.1k.2d();B.J.2Y(D,B.1k);if(H(1q)!="L"){1q.2X("B.S");1q.2M("B.15")}if(H(1x)!="L"){1x.26("B.15",[])}1f{if(H(B.15)=="L"){14""}}1e(e){14"B.S 3F on B.15!"}if(H(B.S)=="L"){B.S={}}B.S.1r="B.S";B.S.1Y="1.3.1";B.S.1K=G(){F"["+D.1r+" "+D.1Y+"]"};B.S.1l=G(){F D.1K()};B.S.1z=["d5","cr","b9","95","94","j3","9k","cX","cw","iT","iV","4X","9j","iQ","hS","cs","ia","i9","i8","i7","i6","i5","i4","hV","i3","i2","i1","cu","hW","ct","i0","hZ","hY","hX","P","io","il","ik","ij","cm","ih","ii","ig","ie","ic","cv","8d","A","6m","ib","1E","$","4q","aH","cO","cN","iM","5G","iK","9d","9e","iH","iD","9c","iB","cG","97","hU","hT","iw","jh","jb","j6","j5","jk","jl"];B.S.1W=["9b"];B.S.5N=G(w,h){D.w=w;D.h=h};B.S.5N.1U.U=G(){u U=B.J.U;F"{w: "+U(D.w)+", h: "+U(D.h)+"}"};B.S.5t=G(x,y){D.x=x;D.y=y};B.S.5t.1U.U=G(){u U=B.J.U;F"{x: "+U(D.x)+", y: "+U(D.y)+"}"};B.S.5t.1U.1l=G(){F D.U()};B.J.2l(B.S,{jl:G(Q,o){Q=B.S.1E(Q);B.S.4X(Q,{"1T":{"9o":o,"-hL-9o":o,"-uw-9o":o,"47":" uv(9o="+(o*3k)+")"}})},jk:G(){u d=Y B.S.5N();u w=B.S.3X;u b=B.S.1Z.5s;if(w.jj){d.w=w.jj;d.h=w.uu}N{if(b.dd.9n){d.w=b.dd.9n;d.h=b.dd.ji}N{if(b&&b.9n){d.w=b.9n;d.h=b.ji}}}F d},jh:G(Q){u I=B.S;if(H(Q.w)=="2y"||H(Q.h)=="2y"){F Y I.5N(Q.w||0,Q.h||0)}Q=I.1E(Q);if(!Q){F L}if(I.4q(Q,"3u")!="98"){F Y I.5N(Q.jg||0,Q.ci||0)}u s=Q.1T;u je=s.dc;u jf=s.6P;s.dc="fR";s.6P="j8";s.3u="";u jd=Q.jg;u jc=Q.ci;s.3u="98";s.6P=jf;s.dc=je;F Y I.5N(jd,jc)},jb:G(Q,4Z){u I=B.S;Q=I.1E(Q);if(!Q){F L}u c=Y I.5t(0,0);if(Q.x&&Q.y){c.x+=Q.x||0;c.y+=Q.y||0;F c}N{if(Q.3t===O||I.4q(Q,"3u")=="98"){F L}}u 51=O;u 2j=O;u d=B.S.1Z;u de=d.7Z;u b=d.5s;if(Q.ja){51=Q.ja();c.x+=51.2I+(de.6y||b.6y)-(de.8q||b.8q);c.y+=51.3D+(de.4C||b.4C)-(de.8p||b.8p)}N{if(d.j9){51=d.j9(Q);c.x+=51.x;c.y+=51.y}N{if(Q.8g){c.x+=Q.db;c.y+=Q.da;2j=Q.8g;if(2j!=Q){1M(2j){c.x+=2j.db;c.y+=2j.da;2j=2j.8g}}u ua=ut.us.8G();if((H(7h)!="L"&&4M(7h.ur())<9)||(ua.2A("uq")!=-1&&I.4q(Q,"6P")=="j8")){c.x-=b.db;c.y-=b.da}}}}if(H(4Z)!="L"){4Z=M.2U(4Z);if(4Z){c.x-=(4Z.x||0);c.y-=(4Z.y||0)}}if(Q.3t){2j=Q.3t}N{2j=O}1M(2j&&2j.j7!="uo"&&2j.j7!="co"){c.x-=2j.6y;c.y-=2j.4C;if(2j.3t){2j=2j.3t}N{2j=O}}F c},j6:G(Q,d9,7g){Q=B.S.1E(Q);if(H(7g)=="L"){7g="px"}B.S.4X(Q,{"1T":{"5A":d9.w+7g,"3V":d9.h+7g}})},j5:G(Q,d8,7f){Q=B.S.1E(Q);if(H(7f)=="L"){7f="px"}B.S.4X(Q,{"1T":{"2I":d8.x+7f,"3D":d8.y+7f}})},cr:G(){F B.S.3X},b9:G(){F B.S.1Z},95:G(2m,1A){u I=B.S;u d6=I.1Z;u d7=I.un;u W;1f{I.3X=2m;I.1Z=2m.2v;W=1A()}1e(e){I.3X=d7;I.1Z=d6;14 e}I.3X=d7;I.1Z=d6;F W},d5:G(Q){u 7d=[];u 7c=[];u m=B.J;u I=B.S;if(H(Q)=="L"||Q===O){Q=I.1Z}N{Q=I.1E(Q)}m.d4(Q,G(Q){u 1b=Q.1b;if(m.7e(1b)){u 4Y=Q.cD;if(4Y=="cv"&&(Q.1J=="um"||Q.1J=="uk")&&!Q.ip){F O}if(4Y=="ct"){if(Q.j4>=0){u 9m=Q.1S[Q.j4];7d.1c(1b);7c.1c((9m.3m)?9m.3m:9m.7X);F O}7d.1c(1b);7c.1c("");F O}if(4Y=="cu"||4Y=="P"||4Y=="8d"||4Y=="6m"){F Q.5h}7d.1c(1b);7c.1c(Q.3m||"");F O}F Q.5h});F[7d,7c]},94:G(1N,1A){u I=B.S;u d3=I.1Z;u W;1f{I.1Z=1N;W=1A()}1e(e){I.1Z=d3;14 e}I.1Z=d3;F W},j3:G(1b,j2,3y,j1){B.S.9b.5M(1b,j2,3y,j1)},9k:G(1j,7a){u im=B.15;u I=B.S;u 1Q=im.1Q;u iY=im.7b;u 4c=im.4c;u iX=I.9b;u iZ=I.9k;u iW=B.J.4d;1M(1h){if(H(1j)=="L"||1j===O){F O}if(H(1j.3T)!="L"&&1j.3T>0){F 1j}if(H(1j)=="2y"||H(1j)=="5L"){1j=1j.1l()}if(H(1j)=="1n"){F I.1Z.4S(1j)}if(H(1j.j0)=="G"){1j=1j.j0(7a);2V}if(H(1j)=="G"){1j=1j(7a);2V}u 9l=O;1f{9l=1Q(1j)}1e(e){}if(9l){F 4c(iZ,9l,iY(7a))}1f{1j=iX.3C(1j,7a);2V}1e(e){if(e!=iW){14 e}}F I.1Z.4S(1j.1l())}F L},iV:G(1j,79,iU){u o={};o[79]=iU;1f{F B.S.4X(1j,o)}1e(e){}F O},iT:G(1j,79){u I=B.S;u d2=I.4U.99[79];1j=I.1E(1j);1f{if(d2){F 1j[d2]}F 1j.fm(79)}1e(e){}F O},4X:G(1j,5K){u Q=1j;u I=B.S;if(H(1j)=="1n"){Q=I.1E(1j)}if(5K){u d0=B.J.8Z;if(I.4U.6X){R(u k in 5K){u v=5K[k];if(H(v)=="3n"&&H(Q[k])=="3n"){d0(Q[k],v)}N{if(k.2W(0,2)=="on"){if(H(v)=="1n"){v=Y cZ(v)}Q[k]=v}N{Q.4p(k,v)}}}}N{u iS=I.4U.99;R(k in 5K){v=5K[k];u d1=iS[k];if(k=="1T"&&H(v)=="1n"){Q.1T.3x=v}N{if(H(d1)=="1n"){Q[d1]=v}N{if(H(Q[k])=="3n"&&H(v)=="3n"){d0(Q[k],v)}N{if(k.2W(0,2)=="on"){if(H(v)=="1n"){v=Y cZ(v)}Q[k]=v}N{Q.4p(k,v)}}}}}}}F Q},9j:G(1j){u Q=1j;u I=B.S;if(H(1j)=="1n"){Q=I.1E(1j)}u 78=[I.9k(B.J.1R(O,M,1),Q)];u iR=B.J.2o;1M(78.K){u n=78.2P();if(H(n)=="L"||n===O){}N{if(H(n.3T)=="2y"){Q.2c(n)}N{78=iR(n,78)}}}F Q},iQ:G(1j){u Q=1j;u I=B.S;if(H(1j)=="1n"){Q=I.1E(1j);M[0]=Q}u cY;1M((cY=Q.6n)){Q.6S(cY)}if(M.K<2){F Q}N{F I.9j.1w(D,M)}},cX:G(1b,4b){u Q;u I=B.S;u m=B.J;if(H(4b)=="1n"||H(4b)=="2y"){u 3G=m.1R([1b,O],M,1);F M.2U.1w(D,3G)}if(H(1b)=="1n"){if(4b&&"1b"in 4b&&!I.4U.6X){1b=("<"+1b+" 1b=\\""+I.9c(4b.1b)+"\\">")}Q=I.1Z.2S(1b)}N{Q=1b}if(4b){I.4X(Q,4b)}if(M.K<=2){F Q}N{u 3G=m.1R([Q],M,2);F I.9j.1w(D,3G)}},cw:G(){u m=B.J;F m.2z.1w(D,m.1R([B.S.cX],M))},cs:G(5J,1d){u I=B.S;5J=I.1E(5J);u cW=5J.3t;if(1d){1d=I.1E(1d);cW.uj(1d,5J)}N{cW.6S(5J)}F 1d},1E:G(id){u I=B.S;if(M.K==1){F((H(id)=="1n")?I.1Z.hN(id):id)}N{F B.J.2r(I.1E,M)}},4q:G(iP,cV,cU){if(M.K==2){cU=cV}u I=B.S;u el=I.1E(iP);u 77=I.1Z;if(!el||el==77){F L}if(el.iO){F el.iO[cV]}if(H(77.5k)=="L"){F L}if(77.5k===O){F L}u 9i=77.5k.g4(el,O);if(H(9i)=="L"||9i===O){F L}F 9i.6q(cU)},aH:G(76,9g,4W){u I=B.S;if(H(76)=="L"||76===O){76="*"}if(H(4W)=="L"||4W===O){4W=I.1Z}4W=I.1E(4W);u 9h=(4W.fr(76)||I.1Z.1p);if(H(9g)=="L"||9g===O){F B.J.1R(O,9h)}u cR=[];R(u i=0;i<9h.K;i++){u cS=9h[i];u cT=cS.3M.2R(" ");R(u j=0;j<cT.K;j++){if(cT[j]==9g){cR.1c(cS);2K}}}F cR},iN:G(5I,9f){u W=G(){u cQ=M.2U.5H;R(u i=0;i<cQ.K;i++){if(cQ[i].1w(D,M)===1m){2K}}if(9f){1f{D[5I]=O}1e(e){}}};W.5H=[];F W},cO:G(cP,5I,1A,9f){u I=B.S;u 4V=cP[5I];u 75=4V;if(!(H(4V)=="G"&&H(4V.5H)=="3n"&&4V.5H!==O)){75=I.iN(5I,9f);if(H(4V)=="G"){75.5H.1c(4V)}cP[5I]=75}75.5H.1c(1A)},cN:G(1A){u I=B.S;I.cO(I.3X,"gh",1A,1h)},iM:G(74){u I=B.S;I.cN(G(){74=I.1E(74);if(74){74.ui()}})},5G:G(iL,cM){u I=B.S;u 1i=I.1E(iL);if(I.4U.6X){1i.4p("iq",cM)}N{1i.4p("3M",cM)}},iK:G(cL){u I=B.S;R(u i=1;i<M.K;i++){u 1i=I.1E(M[i]);if(!I.9d(1i,cL)){I.9e(1i,cL)}}},9d:G(iJ,73){u I=B.S;u 1i=I.1E(iJ);u 2F=1i.3M;if(2F.K===0){I.5G(1i,73);F 1h}if(2F==73){F 1m}u cK=1i.3M.2R(" ");R(u i=0;i<cK.K;i++){if(cK[i]==73){F 1m}}I.5G(1i,2F+" "+73);F 1h},9e:G(iI,cJ){u I=B.S;u 1i=I.1E(iI);u 2F=1i.3M;if(2F.K===0){F 1m}if(2F==cJ){I.5G(1i,"");F 1h}u 72=1i.3M.2R(" ");R(u i=0;i<72.K;i++){if(72[i]==cJ){72.4y(i,1);I.5G(1i,72.2b(" "));F 1h}}F 1m},iH:G(iG,iF,iE){u 1i=B.S.1E(iG);u X=B.S.9e(1i,iF);if(X){B.S.9d(1i,iE)}F X},iD:G(iC,uh){u 1i=B.S.1E(iC);u cI=1i.3M.2R(" ");R(u i=1;i<M.K;i++){u cH=1m;R(u j=0;j<cI.K;j++){if(cI[j]==M[i]){cH=1h;2K}}if(!cH){F 1m}}F 1h},9c:G(s){F s.23(/&/g,"&ug;").23(/"/g,"&uf;").23(/</g,"&lt;").23(/>/g,"&gt;")},iB:G(2q){F B.S.cG(2q).2b("")},cG:G(2q,1g){if(H(1g)=="L"||1g===O){1g=[]}u 70=[2q];u I=B.S;u cB=I.9c;u iA=I.4U;1M(70.K){2q=70.hP();if(H(2q)=="1n"){1g.1c(2q)}N{if(2q.3T==1){1g.1c("<"+2q.cD.8G());u 71=[];u cF=iA(2q);R(u i=0;i<cF.K;i++){u a=cF[i];71.1c([" ",a.1b,"=\\"",cB(a.3m),"\\""])}71.iz();R(i=0;i<71.K;i++){u cE=71[i];R(u j=0;j<cE.K;j++){1g.1c(cE[j])}}if(2q.ue()){1g.1c(">");70.1c("</"+2q.cD.8G()+">");u cC=2q.5h;R(i=cC.K-1;i>=0;i--){70.1c(cC[i])}}N{1g.1c("/>")}}N{if(2q.3T==3){1g.1c(cB(2q.iv))}}}}F 1g},97:G(ix,cA){u m=B.J;u iy=m.1R(O,M,1);B.15.9a(m.47(O,m.2r(B.S.1E,iy)),G(cA){cA.1T.3u=ix})},iw:G(1j,iu){u W=[];(G(1j){u cn=1j.5h;if(cn){R(u i=0;i<cn.K;i++){M.2U.cz(D,cn[i])}}u cy=1j.iv;if(H(cy)=="1n"){W.1c(cy)}})(B.S.1E(1j));if(iu){F W}N{F W.2b("")}},2d:G(2m){u m=B.J;D.1Z=2v;D.3X=2m;D.9b=Y m.4a();u 6Z=D.1Z.2S("cj");u 2T;if(6Z&&6Z.6Y&&6Z.6Y.K>0){u it=m.47;2T=G(1j){F it(2T.ir,1j.6Y)};2T.cx={};B.15.9a(6Z.6Y,G(a){2T.cx[a.1b]=a.3m});2T.ir=G(a){F(2T.cx[a.1b]!=a.3m)};2T.6X=1m;2T.99={"iq":"3M","ip":"ud","uc":"ub","R":"u9"}}N{2T=G(1j){F 1j.6Y};2T.6X=1h;2T.99={}}D.4U=2T;u 1C=D.cw;D.io=1C("ul");D.il=1C("ol");D.ik=1C("li");D.ij=1C("td");D.cm=1C("tr");D.ii=1C("u8");D.ih=1C("u7");D.ig=1C("u6");D.ie=1C("u5");D.ic=1C("th");D.cv=1C("ck");D.8d=1C("cj");D.A=1C("a");D.6m=1C("4u");D.ib=1C("u4");D.ia=1C("2e");D.i9=1C("tt");D.i8=1C("4O");D.i7=1C("h1");D.i6=1C("h2");D.i5=1C("h3");D.i4=1C("br");D.i3=1C("hr");D.i2=1C("u3");D.i1=1C("u2");D.cu=1C("u1");D.P=1C("p");D.ct=1C("u0");D.i0=1C("hJ");D.hZ=1C("tZ");D.hY=1C("tY");D.hX=1C("tX");D.hW=1C("tW");D.hV=1C("tV");D.hU=m.2z(D.97,"98");D.hT=m.2z(D.97,"8c");D.hS=D.cs;D.$=D.1E;D.2k={":3e":D.1z,":1p":m.2o(D.1z,D.1W)};m.3f(D)}});B.S.2d(((H(2O)=="L")?D:2O));if(!B.3d){95=B.S.95;94=B.S.94}B.J.2Y(D,B.S);if(H(1q)!="L"){1q.2X("B.1I");1q.2M("B.1H");1q.2M("B.J")}if(H(1x)!="L"){1x.26("B.1H",[]);1x.26("B.J",[])}1f{if(H(B.J)=="L"||H(B.1H)=="L"){14""}}1e(e){14"B.1I 3F on B.J 3W B.1H!"}if(H(B.1I)=="L"){B.1I={}}B.1I.1r="B.1I";B.1I.1Y="1.3.1";B.1I.1K=G(){F"["+D.1r+" "+D.1Y+"]"};B.1I.1l=G(){F D.1K()};B.1I.bY=G(6W){u m=B.1I;6W=!(!6W);if(m.3l&&m.3l.8Q!=6W){m.3l.hA();m.3l=O}if(!m.3l||m.3l.8P){m.3l=Y m.1I(6W,B.1H.2L)}F m.3l};B.1I.1I=G(4R,6V){if(H(6V)=="L"||6V===O){6V=B.1H.2L}D.2L=6V;u tU=B.J.2l;u c3=B.J.8Z;u 1O=B.J.1O;u hM=B.J.4L;u 2m=2O;u 6U="tT";if(H(B.S)!="L"){2m=B.S.cr()}if(!4R){u 5F=2m.tS.tR.2R("?")[0].23(/[:\\/.><&]/g,"hR");u 1b=6U+"hR"+5F;u 5D=2m.cp("",1b,"tQ,tP,3V=hQ");if(!5D){cq("tO tN to cp tM 2O tL to hP-up tK.");F L}5D.2v.fl("<!tJ co tI \\"-//tH//tG co 4.0 tF//tE\\" "+"\\"fq://fp.tD.fo/cm/tC/tB.tA\\">"+"<hO><5E><8Y>[B.1I]</8Y></5E>"+"<5s></5s></hO>");5D.2v.hG();5D.2v.8Y+=" "+2m.2v.8Y;2m=5D}u 1N=2m.2v;D.1N=1N;u 21=1N.hN(6U);u c4=!!21;if(21&&H(21.5B)!="L"){21.5B.2L=D.2L;21.5B.6K();F 21.5B}if(c4){u cl;1M((cl=21.6n)){21.6S(cl)}}N{21=1N.2S("4u");21.id=6U}21.5B=D;u 8T=1N.2S("ck");u 8S=1N.2S("ck");u 6O=1N.2S("2e");u 6N=1N.2S("2e");u 6M=1N.2S("2e");u 6L=1N.2S("2e");u 3L=1N.2S("4u");u 42=1N.2S("4u");u 8U=6U+"tz";D.8N=hM(D.8N);u 4T=[];u 6R=O;u cf=G(1t){u 6T=1t.3N;if(H(6T)=="2y"){6T=B.1H.5C[6T]}F 6T};u cd=G(1t){F 1t.3z.2b(" ")};u ca=1O(G(1t){u 8W=cf(1t);u 7X=cd(1t);u c=D.8N[8W];u p=1N.2S("cj");p.3M="B-49 B-5C-"+8W;p.1T.3x="ty: 2N; 4F-8X: -hL-4O-3y; 4F-8X: -o-4O-3y; 4F-8X: 4O-3y; 4F-8X: 4O-tx; hK-3y: 2K-hK; 3y-hJ: tw; 3U: "+c;p.2c(1N.4S(8W+": "+7X));42.2c(p);42.2c(1N.2S("br"));if(3L.ci>3L.hI){3L.4C=0}N{3L.4C=3L.hI}},D);u hD=G(1t){4T[4T.K]=1t;ca(1t)};u hF=G(){u cg,ce;1f{cg=Y 8V(8T.3m);ce=Y 8V(8S.3m)}1e(e){ch("2x in 47 tv: "+e.43);F O}F G(1t){F(cg.hH(cf(1t))&&ce.hH(cd(1t)))}};u cc=G(){1M(42.6n){42.6S(42.6n)}};u hB=G(){4T=[];cc()};u bZ=1O(G(){if(D.8P){F}D.8P=1h;if(B.1I.3l==D){B.1I.3l=O}D.2L.c9(8U);21.5B=O;if(4R){21.3t.6S(21)}N{D.2m.hG()}},D);u c7=G(){cc();R(u i=0;i<4T.K;i++){u 1t=4T[i];if(6R===O||6R(1t)){ca(1t)}}};D.6K=G(){6R=hF();c7();D.2L.c9(8U);D.2L.hE(8U,6R,hD)};u c0=1O(G(){4T=D.2L.c8();c7()},D);u c2=1O(G(6Q){6Q=6Q||2O.6D;2h=6Q.6w||6Q.8t;if(2h==13){D.6K()}},D);u 31="3u: 8c; z-c6: c5; 2I: 2N; 6f: 2N; 6P: tu; 5A: 3k%; he-3U: 4F; c1: "+D.8O;if(4R){31+="; 3V: ts; 3E-3D: fO 8a 8y"}N{31+="; 3V: 3k%;"}21.1T.3x=31;if(!c4){1N.5s.2c(21)}31={"3x":"5A: 33%; 3u: 8Q; c1: "+D.8O};c3(8T,{"3m":"8L|8M|8K|8J|8I","hC":c2,"1T":31});21.2c(8T);c3(8S,{"3m":".*","hC":c2,"1T":31});21.2c(8S);31="5A: 8%; 3u:8Q; c1: "+D.8O;6O.2c(1N.4S("tq"));6O.8R=1O("6K",D);6O.1T.3x=31;21.2c(6O);6N.2c(1N.4S("tp"));6N.8R=c0;6N.1T.3x=31;21.2c(6N);6M.2c(1N.4S("tn"));6M.8R=hB;6M.1T.3x=31;21.2c(6M);6L.2c(1N.4S("tm"));6L.8R=bZ;6L.1T.3x=31;21.2c(6L);3L.1T.3x="fS: tk; 5A: 3k%";42.1T.3x="5A: 3k%; 3V: "+(4R?"tj":"3k%");3L.2c(42);21.2c(3L);D.6K();c0();if(4R){D.2m=L}N{D.2m=2m}D.8Q=4R;D.hA=bZ;D.8P=1m;F D};B.1I.1I.1U={"8O":"ti tg,tf-te","8N":{"8M":"1v","8L":"gU","8K":"1F","8J":"8y","8I":"bx"}};B.1I.1W=["1I"];B.1I.1z=["bY"];B.1I.2d=G(){D.2k={":3e":D.1z,":1p":B.J.2o(D.1z,D.1W)};B.J.3f(D);B.1I.3l=O};B.1I.2d();B.J.2Y(D,B.1I);if(H(1q)!="L"){1q.2X("B.V");1q.2M("B.J")}if(H(1x)!="L"){1x.26("B.J",[])}1f{if(H(B.J)=="L"){14""}}1e(e){14"B.V 3F on B.J"}if(H(B.V)=="L"){B.V={}}B.V.1r="B.V";B.V.1Y="1.3.1";B.V.1K=G(){F"["+D.1r+" "+D.1Y+"]"};B.V.1l=G(){F D.1K()};B.V.V=G(1v,hz,1F,6J){if(H(6J)=="L"||6J===O){6J=1}D.1B={r:1v,g:hz,b:1F,a:6J}};B.V.V.1U={bX:B.V.V,tc:G(hy){u 1B=D.1B;u m=B.V;F m.V.3Y(1B.r,1B.g,1B.b,hy)},tb:G(1o){u 1G=D.41();1G.h=1o;u m=B.V;F m.V.4H(1G)},ta:G(hx){u 1G=D.41();1G.s=hx;u m=B.V;F m.V.4H(1G)},t9:G(hw){u 1G=D.41();1G.l=hw;u m=B.V;F m.V.4H(1G)},t8:G(hv){u 1G=D.41();1G.l=28.29(1G.l-hv,0);u m=B.V;F m.V.4H(1G)},t7:G(hu){u 1G=D.41();1G.l=28.2a(1G.l+hu,1);u m=B.V;F m.V.4H(1G)},fJ:G(ht,5z){if(H(5z)=="L"||5z===O){5z=0.5}u sf=1-5z;u s=D.1B;u d=ht.1B;u df=5z;F B.V.V.3Y((s.r*sf)+(d.r*df),(s.g*sf)+(d.g*df),(s.b*sf)+(d.b*df),(s.a*sf)+(d.a*df))},h4:G(hs){u a=D.6r();u b=hs.6r();F B.J.2f([a.r,a.g,a.b,a.a],[b.r,b.g,b.b,b.a])},hq:G(){F D.41().b>0.5},t6:G(){F(!D.hq())},t5:G(){u c=D.41();u 2Z=B.V.6F;u W=D.ho;if(!W){u 5y=(2Z(c.h,bF).6I(0)+","+2Z(c.s,3k).hp(4)+"%"+","+2Z(c.l,3k).hp(4)+"%");u a=c.a;if(a>=1){a=1;W="1G("+5y+")"}N{if(a<=0){a=0}W="t4("+5y+","+a+")"}D.ho=W}F W},hl:G(){u c=D.1B;u 2Z=B.V.6F;u W=D.hn;if(!W){u 5y=(2Z(c.r,3h).6I(0)+","+2Z(c.g,3h).6I(0)+","+2Z(c.b,3h).6I(0));if(c.a!=1){W="t3("+5y+","+c.a+")"}N{W="1B("+5y+")"}D.hn=W}F W},6r:G(){F B.J.4L(D.1B)},t2:G(){u m=B.V;u c=D.1B;u 2Z=B.V.6F;u W=D.hm;if(!W){W=("#"+m.6E(2Z(c.r,3h))+m.6E(2Z(c.g,3h))+m.6E(2Z(c.b,3h)));D.hm=W}F W},t1:G(){u 2Q=D.2Q;u c=D.1B;if(H(2Q)=="L"||2Q===O){2Q=B.V.bA(D.1B);D.2Q=2Q}F B.J.4L(2Q)},41:G(){u 1G=D.1G;u c=D.1B;if(H(1G)=="L"||1G===O){1G=B.V.bC(D.1B);D.1G=1G}F B.J.4L(1G)},1l:G(){F D.hl()},U:G(){u c=D.1B;u hk=[c.r,c.g,c.b,c.a];F D.bX.1r+"("+hk.2b(", ")+")"}};B.J.2l(B.V.V,{3Y:G(1v,bW,1F,8H){u hj=B.V.V;if(M.K==1){u 1B=1v;1v=1B.r;bW=1B.g;1F=1B.b;if(H(1B.a)=="L"){8H=L}N{8H=1B.a}}F Y hj(1v,bW,1F,8H)},4H:G(1o,t0,sZ,sY){u m=B.V;F m.V.3Y(m.bB.1w(m,M))},sX:G(1o,sW,sV,sU){u m=B.V;F m.V.3Y(m.bz.1w(m,M))},hi:G(1b){u 8F=B.V.V;if(1b.3Z(0)=="\\""){1b=1b.3H(1,1b.K-2)}u bV=8F.by[1b.8G()];if(H(bV)=="1n"){F 8F.bT(bV)}N{if(1b=="aP"){F 8F.sT()}}F O},8f:G(4Q){u I=B.V.V;u bU=4Q.3H(0,3);if(bU=="1B"){F I.h9(4Q)}N{if(bU=="1G"){F I.h8(4Q)}N{if(4Q.3Z(0)=="#"){F I.bT(4Q)}}}F I.hi(4Q)},bT:G(4P){if(4P.3Z(0)=="#"){4P=4P.2W(1)}u 8E=[];u i,5x;if(4P.K==3){R(i=0;i<3;i++){5x=4P.3H(i,1);8E.1c(3w(5x+5x,16)/3h)}}N{R(i=0;i<6;i+=2){5x=4P.3H(i,2);8E.1c(3w(5x,16)/3h)}}u bS=B.V.V;F bS.3Y.1w(bS,8E)},bG:G(4O,hf,hg,4N){if(4N.2A(4O)===0){4N=4N.2W(4N.2A("(",3)+1,4N.K-1)}u bR=4N.2R(/\\s*,\\s*/);u bP=[];R(u i=0;i<bR.K;i++){u c=bR[i];u 2i;u bQ=c.2W(c.K-3);if(c.3Z(c.K-1)=="%"){2i=0.bE*4M(c.2W(0,c.K-1))}N{if(bQ=="sS"){2i=4M(c)/bF}N{if(bQ=="sR"){2i=4M(c)/(28.sQ*2)}N{2i=hg[i]*4M(c)}}}bP.1c(2i)}F D[hf].1w(D,bP)},bN:G(Q,sP,sO){u d=B.S;u 2F=B.V.V;R(Q=d.1E(Q);Q;Q=Q.3t){u bO=d.4q.1w(d,M);if(!bO){2V}u 8D=2F.8f(bO);if(!8D){2K}if(8D.6r().a>0){F 8D}}F O},ba:G(Q){u 2F=B.V.V;F 2F.bN(Q,"aZ","he-3U")||2F.sN()},sM:G(Q){u 2F=B.V.V;F 2F.bN(Q,"3U","3U")||2F.sL()},sK:G(){F B.J.4L(B.V.V.by)}});B.J.2l(B.V,{6F:G(v,8C){v*=8C;if(v<0){F 0}N{if(v>8C){F 8C}N{F v}}},hc:G(n1,n2,1o){if(1o>6){1o-=6}N{if(1o<0){1o+=6}}u 2i;if(1o<1){2i=n1+(n2-n1)*1o}N{if(1o<3){2i=n2}N{if(1o<4){2i=n1+(n2-n1)*(4-1o)}N{2i=n1}}}F 2i},bz:G(1o,5w,3i,bM){if(M.K==1){u 2Q=1o;1o=2Q.h;5w=2Q.s;3i=2Q.v;bM=2Q.a}u 1v;u 3K;u 1F;if(5w===0){1v=0;3K=0;1F=0}N{u i=28.8B(1o*6);u f=(1o*6)-i;u p=3i*(1-5w);u q=3i*(1-(5w*f));u t=3i*(1-(5w*(1-f)));hd(i){3j 1:1v=q;3K=3i;1F=p;2K;3j 2:1v=p;3K=3i;1F=t;2K;3j 3:1v=p;3K=q;1F=3i;2K;3j 4:1v=t;3K=p;1F=3i;2K;3j 5:1v=3i;3K=p;1F=q;2K;3j 6:3j 0:1v=3i;3K=t;1F=p;2K}}F{r:1v,g:3K,b:1F,a:bM}},bB:G(1o,5v,3v,bL){if(M.K==1){u 1G=1o;1o=1G.h;5v=1G.s;3v=1G.l;bL=1G.a}u 1v;u 8A;u 1F;if(5v===0){1v=3v;8A=3v;1F=3v}N{u m2;if(3v<=0.5){m2=3v*(1+5v)}N{m2=3v+5v-(3v*5v)}u m1=(2*3v)-m2;u f=B.V.hc;u h6=1o*6;1v=f(m1,m2,h6+2);8A=f(m1,m2,h6);1F=f(m1,m2,h6-2)}F{r:1v,g:8A,b:1F,a:bL}},bA:G(1v,4K,1F,bK){if(M.K==1){u 1B=1v;1v=1B.r;4K=1B.g;1F=1B.b;bK=1B.a}u 29=28.29(28.29(1v,4K),1F);u 2a=28.2a(28.2a(1v,4K),1F);u 1o;u 8z;u hb=29;if(2a==29){1o=0;8z=0}N{u 6H=(29-2a);8z=6H/29;if(1v==29){1o=(4K-1F)/6H}N{if(4K==29){1o=2+((1F-1v)/6H)}N{1o=4+((1v-4K)/6H)}}1o/=6;if(1o<0){1o+=1}if(1o>1){1o-=1}}F{h:1o,s:8z,v:hb,a:bK}},bC:G(1v,4J,1F,bI){if(M.K==1){u 1B=1v;1v=1B.r;4J=1B.g;1F=1B.b;bI=1B.a}u 29=28.29(1v,28.29(4J,1F));u 2a=28.2a(1v,28.2a(4J,1F));u 1o;u 6G;u bJ=(29+2a)/2;u 4I=29-2a;if(4I===0){1o=0;6G=0}N{if(bJ<=0.5){6G=4I/(29+2a)}N{6G=4I/(2-29-2a)}if(1v==29){1o=(4J-1F)/4I}N{if(4J==29){1o=2+((1F-1v)/4I)}N{1o=4+((1v-4J)/4I)}}1o/=6;if(1o<0){1o+=1}if(1o>1){1o-=1}}F{h:1o,s:6G,l:bJ,a:bI}},6E:G(1P){1P=28.ha(1P);u bH=1P.1l(16);if(1P<16){F"0"+bH}F bH},2d:G(){u m=B.J;D.V.h9=m.1O(D.V.bG,D.V,"1B","3Y",[1/3h,1/3h,1/3h,1]);D.V.h8=m.1O(D.V.bG,D.V,"1G","4H",[1/bF,0.bE,0.bE,1]);u 4G=1/3;u bD={8y:[0,0,0],1F:[0,0,1],gY:[0.6,0.4,0.2],gX:[0,1,1],sJ:[4G,4G,4G],gR:[0.5,0.5,0.5],bx:[0,1,0],sI:[2*4G,2*4G,2*4G],gN:[1,0,1],gL:[1,0.5,0],gK:[0.5,0,0.5],1v:[1,0,0],aP:[0,0,0,0],4F:[1,1,1],gI:[1,1,0]};u h7=G(1b,r,g,b,a){u W=D.3Y(r,g,b,a);D[1b]=G(){F W};F W};R(u k in bD){u 1b=k+"V";u h5=m.2o([h7,D.V,1b],bD[k]);D.V[1b]=m.1O.1w(O,h5)}u h0=G(){R(u i=0;i<M.K;i++){if(!(M[i]2C V)){F 1m}}F 1h};u gZ=G(a,b){F a.h4(b)};m.3f(D);m.5u(D.V.1r,h0,gZ);D.2k={":3e":D.1z,":1p":m.2o(D.1z,D.1W)}}});B.V.1z=["V"];B.V.1W=["6F","bC","bB","bA","bz","6E"];B.V.2d();B.J.2Y(D,B.V);B.V.V.by={sH:"#sG",sF:"#sE",sD:"#gW",sC:"#sB",sA:"#sz",sy:"#sx",sw:"#sv",8y:"#su",st:"#sr",1F:"#sq",sp:"#so",gY:"#sn",sm:"#sl",sk:"#sj",si:"#sh",sg:"#se",sd:"#sc",sb:"#sa",s9:"#s8",s7:"#s6",gX:"#gW",s5:"#s4",s3:"#s2",s1:"#s0",rZ:"#gV",rY:"#rX",rW:"#gV",rV:"#rU",rT:"#rS",rR:"#rQ",rP:"#rO",rN:"#rM",gU:"#rL",rK:"#rJ",rI:"#rH",rG:"#rF",rE:"#gT",rD:"#gT",rC:"#rB",rA:"#rz",ry:"#rx",rw:"#rv",ru:"#gS",rt:"#gS",rs:"#rr",rq:"#rp",ro:"#rn",rm:"#rl",rk:"#gM",rj:"#ri",rh:"#rg",rf:"#rd",rc:"#rb",gR:"#gQ",bx:"#ra",r9:"#r8",r7:"#gQ",r6:"#r5",r4:"#r3",r2:"#r1",r0:"#qZ",qY:"#qX",qW:"#qV",qU:"#qT",qS:"#qR",qQ:"#qP",qO:"#qN",qM:"#qL",qK:"#qJ",qI:"#qH",qG:"#qF",qE:"#gP",qD:"#qC",qB:"#gP",qA:"#qz",qy:"#qx",qw:"#qv",qu:"#qt",qr:"#gO",qq:"#gO",qp:"#qo",qn:"#qm",ql:"#qk",qj:"#qi",qh:"#qg",gN:"#gM",qf:"#qe",qd:"#qc",qb:"#qa",q9:"#q8",q7:"#q6",q5:"#q4",q3:"#q2",q1:"#q0",pZ:"#pY",pX:"#pW",pV:"#pU",pT:"#pS",pR:"#pQ",pP:"#pO",pN:"#pM",pL:"#pK",pJ:"#pI",pH:"#pG",pF:"#pE",gL:"#pD",pC:"#pB",pA:"#pz",py:"#pw",pv:"#pu",pt:"#ps",pr:"#pq",pp:"#po",pn:"#pm",pl:"#pj",pi:"#ph",pg:"#pf",pe:"#pd",gK:"#pc",1v:"#pb",pa:"#p9",p8:"#p7",p6:"#p5",p4:"#p3",p2:"#p1",p0:"#oZ",oY:"#oX",oW:"#oV",oU:"#oT",oS:"#oR",oQ:"#oP",oO:"#gJ",oN:"#gJ",oM:"#oL",oK:"#oJ",oI:"#oH",oG:"#oF",oE:"#oD",oC:"#oB",oA:"#oz",oy:"#ox",ow:"#ov",ou:"#ot",4F:"#os",oq:"#op",gI:"#oo",om:"#ok"};if(H(1q)!="L"){1q.2X("B.1u");1q.2M("B.J");1q.2M("B.S")}if(H(1x)!="L"){1x.26("B.J",[]);1x.26("B.S",[])}1f{if(H(B.J)=="L"){14""}}1e(e){14"B.1u 3F on B.J!"}1f{if(H(B.S)=="L"){14""}}1e(e){14"B.1u 3F on B.S!"}if(H(B.1u)=="L"){B.1u={}}B.1u.1r="B.1u";B.1u.1Y="1.3.1";B.1u.4x=[];B.1u.bq=G(1d,e){D.1L=e||2O.6D;D.gH=1d};B.J.2l(B.1u.bq.1U,{1K:G(){u U=B.J.U;u 1y="{6D(): "+U(D.6D())+", 1d(): "+U(D.1d())+", 1J(): "+U(D.1J())+", 8x(): "+U(D.8x())+", 4E(): "+"{8w: "+U(D.4E().8w)+", 8v: "+U(D.4E().8v)+", 8u: "+U(D.4E().8u)+", 2P: "+U(D.4E().2P)+", bw: "+U(D.4E().bw)+"}";if(D.1J()&&D.1J().2A("2h")===0){1y+=", 2h(): {3J: "+U(D.2h().3J)+", 1n: "+U(D.2h().1n)+"}"}if(D.1J()&&(D.1J().2A("3I")===0||D.1J().2A("gE")!=-1||D.1J()=="gD")){1y+=", 3I(): {4D: "+U(D.3I().4D)+", 6A: "+U(D.3I().6A);if(D.1J()!="gC"){1y+=", 2e: {2I: "+U(D.3I().2e.2I)+", 6v: "+U(D.3I().2e.6v)+", 3g: "+U(D.3I().2e.3g)+"}}"}N{1y+="}"}}if(D.1J()=="gG"||D.1J()=="gF"){1y+=", 6C(): "+U(D.6C())}1y+="}";F 1y},1l:G(){F D.1K()},1d:G(){F D.gH},6D:G(){F D.1L},1J:G(){F D.1L.1J||L},8x:G(){F D.1L.8x||D.1L.oj},6C:G(){if(D.1J()=="gG"){F(D.1L.6C||D.1L.aW)}N{if(D.1J()=="gF"){F(D.1L.6C||D.1L.oi)}}F L},4E:G(){u m={};m.8w=D.1L.oh;m.8v=D.1L.og;m.8u=D.1L.oe||1m;m.2P=D.1L.od;m.bw=m.8w||m.8v||m.2P||m.8u;F m},2h:G(){u k={};if(D.1J()&&D.1J().2A("2h")===0){if(D.1J()=="oc"||D.1J()=="ob"){k.3J=D.1L.8t;k.1n=(B.1u.5r[k.3J]||"oa");F k}N{if(D.1J()=="o9"){k.3J=0;k.1n="";if(H(D.1L.6B)!="L"&&D.1L.6B!==0&&!B.1u.bv[D.1L.6B]){k.3J=D.1L.6B;k.1n=bu.bt(k.3J)}N{if(D.1L.8t&&H(D.1L.6B)=="L"){k.3J=D.1L.8t;k.1n=bu.bt(k.3J)}}F k}}}F L},3I:G(){u m={};u e=D.1L;if(D.1J()&&(D.1J().2A("3I")===0||D.1J().2A("gE")!=-1||D.1J()=="gD")){m.6A=Y B.S.5t(0,0);if(e.6z||e.6x){m.6A.x=(!e.6z||e.6z<0)?0:e.6z;m.6A.y=(!e.6x||e.6x<0)?0:e.6x}m.4D=Y B.S.5t(0,0);if(e.8s||e.8r){m.4D.x=(!e.8s||e.8s<0)?0:e.8s;m.4D.y=(!e.8r||e.8r<0)?0:e.8r}N{u de=B.S.1Z.7Z;u b=B.S.1Z.5s;m.4D.x=e.6z+(de.6y||b.6y)-(de.8q||b.8q);m.4D.y=e.6x+(de.4C||b.4C)-(de.8p||b.8p)}if(D.1J()!="gC"){m.2e={};m.2e.2I=1m;m.2e.3g=1m;m.2e.6v=1m;if(e.6w){m.2e.2I=(e.6w==1);m.2e.6v=(e.6w==2);m.2e.3g=(e.6w==3)}N{m.2e.2I=!!(e.2e&1);m.2e.3g=!!(e.2e&2);m.2e.6v=!!(e.2e&4)}}F m}F L},2J:G(){D.8o();D.8n()},8o:G(){if(D.1L.8o){D.1L.8o()}N{D.1L.o8=1h}},8n:G(){if(D.1L.8n){D.1L.8n()}N{D.1L.o7=1m}}});B.1u.bv={3:"gz",o6:"gA",o5:"gy",o4:"gx",o3:"gw",o2:"gv",o1:"gu",o0:"gs",nZ:"gr",nY:"gq",nX:"gp",nW:"go"};R(i=gB;i<=nV;i++){B.1u.bv[i]="gk"+(i-gB+1)}B.1u.5r={8:"nU",9:"nT",12:"gA",13:"gz",16:"nS",17:"nR",18:"nQ",19:"nP",20:"nO",27:"nN",32:"nM",33:"gy",34:"gx",35:"gw",36:"gv",37:"gu",38:"gs",39:"gr",40:"gq",44:"nL",45:"gp",46:"go",59:"gn",91:"nK",92:"nJ",93:"nI",nH:"nG",nF:"nE",nD:"nC-gm",nB:"nA",nz:"ny",nx:"nw",nv:"nu",nt:"gn",ns:"nr",nq:"np",nn:"nm-gm",nl:"nk",nj:"ni",nh:"ng",nf:"nd",nc:"nb",na:"n9",n8:"n7"};R(u i=48;i<=57;i++){B.1u.5r[i]="gl"+(i-48)}R(i=65;i<=90;i++){B.1u.5r[i]="gl"+bu.bt(i)}R(i=96;i<=n6;i++){B.1u.5r[i]="n5"+(i-96)}R(i=gj;i<=n4;i++){B.1u.5r[i]="gk"+(i-gj+1)}B.J.2l(B.1u,{1K:G(){F"["+D.1r+" "+D.1Y+"]"},1l:G(){F D.1K()},g7:G(){u I=B.1u;u bs=I.4x;R(u i=0;i<bs.K;i++){I.6t(bs[i])}gi I.4x;1f{2O.gh=L}1e(e){}1f{2O.g8=L}1e(e){}},gb:G(1d,1A,1i,gg){u E=B.1u.bq;if(!gg){F B.J.1O(1A,1i)}1i=1i||1d;if(H(1A)=="1n"){F G(gf){1i[1A].1w(1i,[Y E(1d,gf)])}}N{F G(gd){1A.1w(1i,[Y E(1d,gd)])}}},6s:G(1d,2D,5q,4B){1d=B.S.1E(1d);u I=B.1u;if(H(2D)!="1n"){14 Y 2x("\'2D\' 5p be a 1n")}u 1i=O;u 1A=O;if(H(4B)!="L"){1i=5q;1A=4B;if(H(4B)=="1n"){if(H(5q[4B])!="G"){14 Y 2x("\'bp\' 5p be a G on \'gc\'")}}N{if(H(4B)!="G"){14 Y 2x("\'bp\' 5p be a G or 1n")}}}N{if(H(5q)!="G"){14 Y 2x("\'gc\' 5p be a G if \'bp\' is 2E n3")}N{1A=5q}}if(H(1i)=="L"||1i===O){1i=1d}u bm=!!(1d.bo||1d.bn);u 8m=I.gb(1d,1A,1i,bm);if(1d.bo){1d.bo(2D.3H(2),8m,1m)}N{if(1d.bn){1d.bn(2D,8m)}}u bk=[1d,2D,8m,bm,5q,4B];I.4x.1c(bk);F bk},6t:G(6u){if(!6u[3]){F}u 1d=6u[0];u 2D=6u[1];u bj=6u[2];if(1d.ga){1d.ga(2D.3H(2),bj,1m)}N{if(1d.g9){1d.g9(2D,bj)}N{14 Y 2x("\'1d\' 5p be a S n0")}}},8j:G(bh){u I=B.1u;u 5o=I.4x;u m=B.J;if(M.K>1){u 1d=B.S.1E(M[0]);u 2D=M[1];u 1i=M[2];u 1A=M[3];R(u i=5o.K-1;i>=0;i--){u o=5o[i];if(o[0]===1d&&o[1]===2D&&o[4]===1i&&o[5]===1A){I.6t(o);5o.4y(i,1);F 1h}}}N{u 5n=m.bi(5o,bh);if(5n>=0){I.6t(bh);5o.4y(5n,1);F 1h}}F 1m},8i:G(1d,2D){1d=B.S.1E(1d);u m=B.J;u 8l=m.bg(m.1R(O,M,1));u I=B.1u;u bd=I.6t;u 4z=I.4x;if(8l.K===0){R(u i=4z.K-1;i>=0;i--){u 4A=4z[i];if(4A[0]===1d){bd(4A);4z.4y(i,1)}}}N{u bf={};R(u i=0;i<8l.K;i++){bf[8l[i]]=1h}R(u i=4z.K-1;i>=0;i--){u 4A=4z[i];if(4A[0]===1d&&4A[1]in bf){bd(4A);4z.4y(i,1)}}}},8h:G(1d,2D){u bc=B.1u.4x;1d=B.S.1E(1d);u 3G=B.J.1R(O,M,2);u 5m=[];R(u i=0;i<bc.K;i++){u 8k=bc[i];if(8k[0]===1d&&8k[1]===2D){1f{8k[2].1w(1d,3G)}1e(e){5m.1c(e)}}}if(5m.K==1){14 5m[0]}N{if(5m.K>1){u e=Y 2x("mZ bb mY in mX \'2D\', mW bb mV");e.bb=5m;14 e}}}});B.1u.1W=[];B.1u.1z=["6s","8j","8h","8i"];B.1u.2d=G(2m){u m=B.J;D.1Z=2v;D.3X=2m;1f{D.6s(2O,"g8",D.g7)}1e(e){}D.2k={":3e":D.1z,":1p":m.2o(D.1z,D.1W)};m.3f(D)};B.1u.2d(D);if(!B.3d){6s=B.1u.6s;8j=B.1u.8j;8i=B.1u.8i;8h=B.1u.8h}B.J.2Y(D,B.1u);if(H(1q)!="L"){1q.2X("B.1X");1q.2M("B.J");1q.2M("B.S");1q.2M("B.V")}if(H(1x)!="L"){1x.26("B.J",[]);1x.26("B.S",[]);1x.26("B.V",[])}1f{if(H(B.J)=="L"||H(B.S)=="L"||H(B.V)=="L"){14""}}1e(e){14"B.1X 3F on B.J, B.S 3W B.V!"}if(H(B.1X)=="L"){B.1X={}}B.1X.1r="B.1X";B.1X.1Y="1.3.1";B.1X.1K=G(){F"["+D.1r+" "+D.1Y+"]"};B.1X.1l=G(){F D.1K()};B.1X.aI=G(e,g6){e=B.S.1E(e);D.fN(g6);if(D.1S.fL){e=D.g5(e)}u 4w=D.1S.3U;u C=B.V.V;if(D.1S.3U=="aW"){4w=C.ba(e)}N{if(!(4w 2C C)){4w=C.8f(4w)}}D.82=(4w.6r().a<=0);u 5l=D.1S.aV;if(D.1S.aV=="fM"){5l=C.ba(e.8g)}N{if(!(5l 2C C)){5l=C.8f(5l)}}D.g3(e,4w,5l)};B.1X.aI.1U={g5:G(e){u mU=e.3t;u 1N=B.S.b9();if(H(1N.5k)=="L"||1N.5k===O){F e}u 4v=1N.5k.g4(e,O);if(H(4v)=="L"||4v===O){F e}u b8=B.S.6m({"1T":{3u:"8c",mT:4v.6q("6p-3D"),85:4v.6q("6p-3g"),mS:4v.6q("6p-6f"),86:4v.6q("6p-2I"),6p:"2N"}});b8.6o=e.6o;e.6o="";e.2c(b8);F e},g3:G(e,b7,8e){if(D.1S.3E){D.g2(e,8e)}if(D.fy()){D.fX(e,b7,8e)}if(D.fx()){D.fV(e,b7,8e)}},g2:G(el,g1){u b6="6l 8a "+D.aQ(g1);u g0="3E-2I: "+b6;u fZ="3E-3g: "+b6;u fY="1T=\'"+g0+";"+fZ+"\'";el.6o="<4u "+fY+">"+el.6o+"</4u>"},fX:G(el,fW,b5){u b4=D.b1(b5);R(u i=0;i<D.1S.89;i++){b4.2c(D.b0(fW,b5,i,"3D"))}el.1T.mR=0;el.mQ(b4,el.6n)},fV:G(el,fU,b3){u b2=D.b1(b3);R(u i=(D.1S.89-1);i>=0;i--){b2.2c(D.b0(fU,b3,i,"6f"))}el.1T.mP=0;el.2c(b2)},b1:G(fT){u 2q=B.S;F 2q.6m({1T:{aZ:fT.1l()}})},b0:G(aY,fQ,n,aX){u 6k=B.S.8d();u 2p=6k.1T;2p.aZ=aY.1l();2p.3u="8c";2p.3V="6l";2p.fS="fR";2p.mO="6l";u 8b=D.aQ(aY,fQ);if(D.1S.3E&&n===0){2p.mN="8a";2p.mM="6l";2p.84="2N";2p.83="2N";2p.mL="2N";2p.3V="2N";2p.fP=8b.1l()}N{if(8b){2p.fP=8b.1l();2p.mK="8a";2p.mJ="2N 6l"}}if(!D.1S.4r&&(n==(D.1S.89-1))){2p.3V="fO"}D.fI(6k,n,aX);D.fG(6k,n,aX);F 6k},fN:G(fK){D.1S={6g:"1p",3U:"aW",aV:"fM",5j:1h,3E:1m,4r:1m,fL:1m};B.J.2l(D.1S,fK);D.1S.89=(D.1S.4r?2:4)},aL:G(){u 88=D.1S.6g;if(D.6h(88,"1p","3D")){F""}u aU=(88.2A("tl")!=-1);u aT=(88.2A("tr")!=-1);if(aU&&aT){F""}if(aU){F"2I"}if(aT){F"3g"}F""},aK:G(){u 87=D.1S.6g;if(D.6h(87,"1p","6f")){F""}u aS=(87.2A("bl")!=-1);u aR=(87.2A("br")!=-1);if(aS&&aR){F""}if(aS){F"2I"}if(aR){F"3g"}F""},aQ:G(aN,aO){if(aN=="aP"){F aO}N{if(D.1S.3E){F D.1S.3E}N{if(D.1S.5j){F aO.fJ(aN)}}}F""},fI:G(el,n,fH){u 6j=D.fE(n)+"px";u aM=(fH=="3D"?D.aL():D.aK());u 4t=el.1T;if(aM=="2I"){4t.86=6j;4t.85="2N"}N{if(aM=="3g"){4t.85=6j;4t.86="2N"}N{4t.86=6j;4t.85=6j}}},fG:G(el,n,fF){u 6i=D.fz(n)+"px";u aJ=(fF=="3D"?D.aL():D.aK());u 4s=el.1T;if(aJ=="2I"){4s.84=6i;4s.83="2N"}N{if(aJ=="3g"){4s.83=6i;4s.84="2N"}N{4s.84=6i;4s.83=6i}}},fE:G(n){if(D.82){F 0}u o=D.1S;if(o.4r&&o.5j){u fD=[1,0];F fD[n]}N{if(o.4r){u fC=[2,1];F fC[n]}N{if(o.5j){u fB=[3,2,1,0];F fB[n]}N{u fA=[5,3,2,1];F fA[n]}}}},fz:G(n){u o=D.1S;u 5i;if(o.4r&&(o.5j||D.82)){F 1}N{if(o.4r){5i=[1,0]}N{if(o.5j){5i=[2,1,1,1]}N{if(o.3E){5i=[0,2,0,0]}N{if(D.82){5i=[5,3,2,1]}N{F 0}}}}}F 5i[n]},6h:G(1y){R(u i=1;i<M.K;i++){if(1y.2A(M[i])!=-1){F 1h}}F 1m},fy:G(){F D.6h(D.1S.6g,"1p","3D","tl","tr")},fx:G(){F D.6h(D.1S.6g,"1p","6f","bl","br")},mI:G(el){F(el.5h.K==1&&el.5h[0].3T==3)}};B.1X.aF=G(e,fw){Y B.1X.aI(e,fw)};B.1X.fs=G(fv,fu,ft){u aG=B.S.aH(fv,fu);R(u i=0;i<aG.K;i++){B.1X.aF(aG[i],ft)}};B.1X.V=B.V.V;B.1X.mH=B.S.4q;B.1X.2d=G(){u m=B.J;m.3f(D);D.2k={":3e":D.1z,":1p":m.2o(D.1z,D.1W)}};B.1X.1z=["aF","fs"];B.1X.1W=[];B.1X.2d();B.J.2Y(D,B.1X);if(H(B)=="L"){B={}}if(H(B.B)=="L"){B.B={}}B.B.1r="B.B";B.B.1Y="1.3.1";B.B.1K=G(){F"["+D.1r+" "+D.1Y+"]"};B.B.1l=G(){F D.1K()};B.B.aA=["J","15","1H","1D","1s","1k","S","1I","V","1u","1X"];if(H(1x)!="L"||H(1q)!="L"){if(H(1q)!="L"){1q.2X("B.B");1q.2M("B.*")}if(H(1x)!="L"){1x.26("B.J",[]);1x.26("B.15",[]);1x.26("B.1H",[]);1x.26("B.1D",[]);1x.26("B.1s",[]);1x.26("B.1k",[]);1x.26("B.S",[]);1x.26("B.1I",[]);1x.26("B.V",[]);1x.26("B.1u",[]);1x.26("B.1X",[])}(G(){u 6e=B.J.1R;u I=B.B;u aE=I.aA;u aD=[];u aC=[];u 81={};u i,k,m,1p;R(i=0;i<aE.K;i++){m=B[aE[i]];6e(aD,m.1z);6e(aC,m.1W);R(k in m.2k){81[k]=6e(81[k],m.2k[k])}1p=m.2k[":1p"];if(!1p){1p=6e(O,m.1z,m.1W)}u j;R(j=0;j<1p.K;j++){k=1p[j];I[k]=m[k]}}I.1z=aD;I.1W=aC;I.2k=81}())}N{if(H(B.3d)=="L"){B.3d=1h}(G(){u 80=2v.fr("7W");u ay="fq://fp.mG.fo/mF/mE/mD.is.aB.mC";u 2w=O;u ax=O;u az={};u i;R(i=0;i<80.K;i++){u 1d=80[i].fm("1d");if(!1d){2V}az[1d]=1h;if(1d.3C(/B.js$/)){2w=1d.2W(0,1d.mB("B.js"));ax=80[i]}}if(2w===O){F}u 6d=B.B.aA;R(u i=0;i<6d.K;i++){if(B[6d[i]]){2V}u 7Y=2w+6d[i]+".js";if(7Y in az){2V}if(2v.7Z&&2v.7Z.mA==ay){u s=2v.mz(ay,"7W");s.4p("id","my"+2w+6d[i]);s.4p("1d",7Y);s.4p("1J","mx/x-fk");ax.3t.2c(s)}N{2v.fl("<7W 1d=\\""+7Y+"\\" 1J=\\"7X/fk\\"></7W>")}}})()}',62,1976,'||||||||||||||||||||||||||||||var|||||||MochiKit||this||return|function|typeof|self|Base|length|undefined|arguments|else|null||elem|for|DOM||repr|Color|rval|res|new||||||throw|Iter|||||next|name|push|src|catch|try|lst|true|obj|node|Async|toString|false|string|hue|all|dojo|NAME|Format|msg|Signal|red|apply|JSAN|str|EXPORT|func|rgb|_425|DateTime|getElement|blue|hsl|Logging|LoggingPane|type|__repr__|_event|while|doc|bind|num|iter|extend|options|style|prototype|seq|EXPORT_OK|Visual|VERSION|_document||_434||replace|forwardCall|StopIteration|use||Math|max|min|join|appendChild|__new__|button|compare|date|key|val|_329|EXPORT_TAGS|update|win|pair|concat|_596|dom|map|req|Deferred|sync|document|base|Error|number|partial|indexOf||instanceof|sig|not|cls|list|fired|left|stop|break|logger|require|0px|window|shift|hsv|split|createElement|_423|callee|continue|substring|provide|_exportSymbols|ccc||_464|||||||||step|pred|_51|__compat__|common|nameFunctions|right|255|_517|case|100|_loggingPane|value|object|callback|TypeError|_251|_246|_113|parentNode|display|_522|parseInt|cssText|wrap|info|isArrayLike|end|match|top|border|depends|args|substr|mouse|code|_519|_443|className|level|err|frac|Date|_135|_85|nodeType|color|height|and|_window|fromRGB|charAt||asHSL|_444|message||||filter||LogMessage|AdapterRegistry|_366|imap|NotFound|locked|counter|_262|_messages|operator|cmp|_165|_161|pairs|arr|_52|setAttribute|computedStyle|compact|_614|_610|div|_576|_572|_observers|splice|_565|_566|_555|scrollTop|page|modifier|white|_541|fromHSL|_539|_535|_528|clone|parseFloat|_505|pre|_499|_497|_427|createTextNode|_446|attributeArray|_388|_379|updateNodeAttributes|_341|_326||box|errback|results|paused|chain|_285||ofs||NamedError|_175|_147|_122|_83|_54|_17|childNodes|_619|blend|defaultView|_574|_569|idx|_562|must|_554|_specialKeys|body|Coordinates|registerComparator|_521|_516|hex|mid|_478|width|loggingPane|LogLevel|nwin|head|url|setElementClass|callStack|path|dest|_359|boolean|register|Dimensions|DeferredLock|_313|addCallback|_310|waiting|onreadystatechange|_290|LOCALE|year|printfire|_214|log|_213|_211|pos|_155|_153||typeMatcher|listMinMax|_114|_40|itr|typ|_19|_634|_625|bottom|corners|_hasString|_612|_608|_595|1px|DIV|firstChild|innerHTML|padding|getPropertyValue|asRGB|connect|_disconnect|_559|middle|which|clientY|scrollLeft|clientX|client|charCode|relatedTarget|event|toColorPart|clampColorComponent|_537|_534|toFixed|_468|buildAndApplyFilter|_442|_441|_440|_439|position|_463|_447|removeChild|_449|uid|_428|_426|compliant|attributes|_422|_409|_412|_400|_395|_390|_389|_377|_375|_363|attr|ctx|repeat|_340|_339|isNotEmpty|_335|_333|opera|DeferredList|ret|_309|silentlyCancelled|canceller|_nextId|Array|_293|XMLHttpRequest|chained|_281|tail|_252|_225|msec|day|month|iso|Logger|_208|listeners|_200|_198|_194|_196|reduce|range|_169|_162|truth|registerRepr|_121|_70|_58|_56|_47|_45|_41|_13|_1|script|text|uri|documentElement|_630|_629|isTransparent|borderRightWidth|borderLeftWidth|marginRight|marginLeft|_602|_599|numSlices|solid|_597|block|SPAN|_579|fromString|offsetParent|signal|disconnectAll|disconnect|_570|_563|_557|preventDefault|stopPropagation|clientTop|clientLeft|pageY|pageX|keyCode|meta|ctrl|alt|target|black|_532|_524|floor|_513|_512|_500|_495|toLowerCase|_487|DEBUG|INFO|WARNING|FATAL|ERROR|colorTable|logFont|closed|inline|onclick|_438|_437|_445|RegExp|_452|space|title|updatetree|||||withDocument|withWindow||setDisplayForElement|none|renames|forEach|domConverters|escapeHTML|addElementClass|removeElementClass|once|_378|_380|_376|appendChildNodes|coerceToDOM|_355|opt|clientWidth|opacity|GenericError|fail|resultList|_307|_301|_fire|can|addCallbacks|_resback|percent|decimal|separator|twoDigitFloat|_274|_273|_264|_257|_250|_249|_254|_248|_243|_242|fmt|_240|_245|getTime|sec|hour|_209|slice|_206|iterateNextIter|registerIteratorFactory|arrayLikeIter|iteratorRegistry|takewhile|ifilterfalse|ifilter|_181|_176|_168|_166|_159|_tee|deque|arg|fun|jsonRegistry|reprString|reprRegistry|comparatorRegistry|urlEncode|_110|_108|cur|_95|_87|_71|im_preargs||_53|_57|_46|present|like|array|Argument|_15|_12|_632|_631|_633|SUBMODULES|only|_628|_627|_626|roundElement|_624|getElementsByTagAndClassName|_RoundCorners|_613|_whichSideBottom|_whichSideTop|_609|_605|_606|transparent|_borderColor|_604|_603|_601|_600|bgColor|fromElement|_594|_592|backgroundColor|_createCornerSlice|_createCorner|_590|_589|_587|_586|_581|_578|_577|currentDocument|fromBackground|errors|_568|_564||sigs|flattenArguments|_561|findIdentical|_560|_558||_556|attachEvent|addEventListener|funcOrStr|Event||_548|fromCharCode|String|_specialMacKeys|any|green|_namedColors|hsvToRGB|rgbToHSV|hslToRGB|rgbToHSL|_542|01|360|_fromColorString|_540|_536|_538|_529|_523|_518|fromComputedStyle|_511|_507|_508|_506|_501|fromHexString|_498|_496|_486|__class__|createLoggingPane|_459|_461|font|_462|_430|_435|1000|index|_460|getMessages|removeListener|_451||_457|_450|infore|_448|_456|logDebug|offsetHeight|span|input|_436|TR||HTML|open|alert|currentWindow|swapDOM|SELECT|FORM|INPUT|createDOMFunc|ignoreAttr|_421|call|_417|_410|_415|nodeName|_414|_413|emitHTML|good|_406|_399|_397|_393|_392|addLoadEvent|addToCallStack|_387|_386|_381|_382|_383|_373|_372|_369|createDOM|_365|Function|_360|_362|_358|_344|nodeWalk|formContents|_337|_338|_334|_332|offsetTop|offsetLeft|visibility|parentElement|||XMLHttpRequestError|BrowserComplianceError|CancelledError|AlreadyCalledError|evalJSONRequest|sendXMLHttpRequest|wait|doSimpleXMLHttpRequest|getXMLHttpRequest|succeed|_312|finishedCount|_308|_cbDeferred|_303|_297|queryString|_nothing|_289|XMLHTTP|ActiveXObject|eval|_284|_check|error|_279|default|rstrip|lstrip|formatLocale|roundToFixed|truncToFixed|_276|pow|_272|_271|_270|sign|_265|_263|tmp|_238|_232|toISODate|toISOTime|getFullYear|getDate|getMonth|_230|_padTwo|_228|useNativeConsole|_212|compareLogMessage|isLogMessage|unshift|_207||maxSize|_202|_199|logLevelAtLeast|console|hasIterateNext|iterateNext|arrayLike|groupby||exhaust|tee|dropwhile|applymap||islice|izip|cycle|count||_189|_188|_183|_185|_184|_186|_187|_182|identity|fetch|_180|_177|listMin|reprNumber|reprArrayLike|compareArrayLike|compareDateLike|isDateLike|findValue|_128|__export__|keyComparator|_124|_118|_93|_94|_90|_88|_84|_77|_68|_67|_66|_65|_60|im_func|_55|im_self|_48|_44|_42|_39|_36|_33|_27|_26|_25|_22|_24|_20|javascript|write|getAttribute||org|www|http|getElementsByTagName|roundClass|_623|_622|_621|_620|_isBottomRounded|_isTopRounded|_borderSize|_618|_617|_616|_615|_marginSize|_611|_setBorder|_607|_setMargin|blendedColor|_598|__unstable__wrapElement|fromParent|_setOptions|2px|borderColor|_593|hidden|overflow|_591|_588|_roundBottomCorners|_585|_roundTopCorners|_584|_583|_582|_580|_renderBorder|_roundCornersImpl|getComputedStyle|_doWrap|_571|_unloadCache|onunload|detachEvent|removeEventListener|_listener|objOrFunc|_552||_551|_549|onload|delete|112|KEY_F|KEY_|MINUS|KEY_SEMICOLON|KEY_DELETE|KEY_INSERT|KEY_ARROW_DOWN|KEY_ARROW_RIGHT|KEY_ARROW_UP||KEY_ARROW_LEFT|KEY_HOME|KEY_END|KEY_PAGE_DOWN|KEY_PAGE_UP|KEY_ENTER|KEY_NUM_PAD_CLEAR|63236|mousemove|contextmenu|click|mouseout|mouseover|_src|yellow|708090|purple|orange|ff00ff|magenta|778899|d3d3d3|808080|gray|696969|2f4f4f|darkred|a9a9a9|00ffff|cyan|brown|_547|_546||||compareRGB|_545||_543|fromHSLString|fromRGBString|round|_533|_hslValue|switch|background|_503|_504||fromName|_488|col|toRGBString|_hexString|_rgbString|_hslString|toPrecision|isLight||_481|_477|_476|_475|_474|_473|_469|_466|closePane|_458|onkeypress|_454|addListener|_455|close|test|scrollHeight|option|word|moz|_431|getElementById|html|pop|200|_|removeElement|showElement|hideElement|CANVAS|STRONG|FIELDSET|LEGEND|OPTGROUP|OPTION|TEXTAREA|LABEL|HR|BR|H3|H2|H1|PRE|TT|BUTTON|IMG|TH||TABLE||TFOOT|THEAD|TBODY|TD|LI|OL|||UL|checked|class|ignoreAttrFilter||_424|_419|nodeValue|scrapeText|_416|_418|sort|_411|toHTML|_404|hasElementClass|_403|_402|_401|swapElementClass|_398|_394|toggleElementClass|_391|focusOnLoad|_newCallStack|currentStyle|_371|replaceChildNodes|_364|_361|getNodeAttribute|_357|setNodeAttribute|_354|_352|_350|_353|toDOM|_346|_345|registerDOMConverter|selectedIndex|setElementPosition|setElementDimensions|tagName|absolute|getBoxObjectFor|getBoundingClientRect|elementPosition|_325|_324|_322|_323|offsetWidth|elementDimensions|clientHeight|innerWidth|getViewportDimensions|setOpacity|status|_317|deferred|_316|_newNamedError|maybeDeferred||gatherResults|callLater|loadJSONDoc|_311|consumeErrors|fireOnOneErrback|fireOnOneCallback|addErrback|_305|_304|_306|unlocked|release|_300|_299|_298|_296|_xhr_onreadystatechange|_xhr_canceller|304|responseText|Msxml2|addBoth|_pause|_continue|result|the|are|they|instances|_unpause|cancel|_280|_278|en_US|strip|percentFormat|twoDigitAverage|numberFormatter|_277|_275|isNaN|_259|_258|_260|_255|_253|_numberFormatter|_241|_239|_237|_236|_235|_234|_233|_231|toAmericanDate|toPaddedAmericanDate|americanDate|toISOTimestamp|isoTimestamp|isoDate|foot|sep||60000|_221|_isoRegexp|dispatchEvent|createEvent|warning|logWarning|fatal|logFatal|debug|logError|baseLog|_210|getMessageText|logToConsole|dispatchListeners|_204|_203|ident|_201|postError|alertListener|_197|_192|groupby_as_array|iextend|some|reversed|sorted|every|sum|_190|eat|_174|_173|_172|_171|_167|_163|_158|_157|_151|_144|_141||_139|_136|_134||_133|_132|zip|merge|isUndefined|isCallable|listMax|_131|_130|encodeURIComponent||_127|method|parseQueryString|evalJSON|registerJSON|serializeJSON|objMin|objMax|reverseKeyComparator|arrayEqual|objEqual|bindMethods|xfilter|xmap|isEmpty|isNull|isUndefinedOrNull|itemgetter|items|keys|setdefault|_126|_120|decodeURIComponent|_119|len|_109|_107|_104|_105|_101|_102|_98|||_100|_97|_96|_91|json|__json__|_82|_81|_80|_79|_76||_75|_74|_73|_69|_primitives|_64|_63||_62|_61|_59|_wrapDumbFunction|_49|_50|_31|_30|_21|_7|application|MochiKit_|createElementNS|namespaceURI|lastIndexOf|xul|there|gatekeeper|keymaster|mozilla|getElementsComputedStyle|_hasSingleTextChild|borderWidth|borderStyle|borderBottomWidth|borderTopWidth|borderTopStyle|fontSize|paddingBottom|insertBefore|paddingTop|marginBottom|marginTop|_575|property|see|handling|thrown|Multiple|element|||given|123|KEY_NUM_PAD_|105|KEY_APOSTROPHE|222|KEY_RIGHT_SQUARE_BRACKET|221|KEY_REVERSE_SOLIDUS|220|KEY_LEFT_SQUARE_BRACKET||219|KEY_GRAVE_ACCENT|192|KEY_SOLIDUS|191|KEY_FULL_STOP|190|KEY_HYPHEN|189||KEY_COMMA|188|KEY_EQUALS_SIGN|187|186|KEY_SCROLL_LOCK|145|KEY_NUM_LOCK|144|KEY_NUM_PAD_SOLIDUS|111|KEY_NUM_PAD_FULL_STOP|110|KEY_NUM_PAD_HYPHEN|109|KEY_NUM_PAD_PLUS_SIGN|107|KEY_NUM_PAD_ASTERISK|106|KEY_SELECT|KEY_WINDOWS_RIGHT|KEY_WINDOWS_LEFT|KEY_PRINT_SCREEN|KEY_SPACEBAR|KEY_ESCAPE|KEY_CAPS_LOCK|KEY_PAUSE|KEY_ALT|KEY_CTRL|KEY_SHIFT|KEY_TAB|KEY_BACKSPACE|63242|63272|63302|63233|63235|63232|63234|63273|63275|63277|63276|63289|returnValue|cancelBubble|keypress|KEY_UNKNOWN|keyup|keydown|shiftKey|metaKey||ctrlKey|altKey|toElement|srcElement|9acd32||yellowgreen||ffff00|f5f5f5|whitesmoke||ffffff|f5deb3|wheat|ee82ee|violet|40e0d0|turquoise|ff6347|tomato|d8bfd8|thistle|008080|teal|d2b48c|tan|4682b4|steelblue|00ff7f|springgreen|fffafa|snow|slategrey|slategray|6a5acd|slateblue|87ceeb|skyblue|c0c0c0|silver|a0522d|sienna|fff5ee|seashell|2e8b57|seagreen|f4a460|sandybrown|fa8072|salmon|8b4513|saddlebrown|4169e1|royalblue|bc8f8f|rosybrown|ff0000|800080|b0e0e6|powderblue|dda0dd|plum|ffc0cb|pink|cd853f||peru|ffdab9|peachpuff|ffefd5|papayawhip|db7093|palevioletred|afeeee|paleturquoise|98fb98|palegreen|eee8aa||palegoldenrod|da70d6|orchid|ff4500|orangered|ffa500|6b8e23|olivedrab|808000|olive|fdf5e6|oldlace|000080|navy|ffdead|navajowhite|ffe4b5|moccasin|ffe4e1|mistyrose|f5fffa|mintcream|191970|midnightblue|c71585|mediumvioletred|48d1cc|mediumturquoise|00fa9a|mediumspringgreen|7b68ee|mediumslateblue|3cb371|mediumseagreen|9370db|mediumpurple|ba55d3|mediumorchid|0000cd|mediumblue|66cdaa|mediumaquamarine|800000|maroon|faf0e6|linen|32cd32|limegreen|00ff00|lime|ffffe0|lightyellow|b0c4de|lightsteelblue|lightslategrey|lightslategray||87cefa|lightskyblue|20b2aa|lightseagreen|ffa07a|lightsalmon|ffb6c1|lightpink|lightgrey|90ee90|lightgreen|lightgray|fafad2|lightgoldenrodyellow|e0ffff|lightcyan|f08080|lightcoral|add8e6|lightblue|fffacd|lemonchiffon|7cfc00|lawngreen|fff0f5|lavenderblush|e6e6fa|lavender|f0e68c|khaki|fffff0|ivory|4b0082|indigo|cd5c5c|indianred|ff69b4|hotpink|f0fff0|honeydew|grey|adff2f|greenyellow|008000|daa520|goldenrod|ffd700||gold|f8f8ff|ghostwhite|dcdcdc|gainsboro|fuchsia|228b22|forestgreen|fffaf0|floralwhite|b22222|firebrick|1e90ff|dodgerblue|dimgrey|dimgray|00bfff|deepskyblue|ff1493|deeppink|9400d3|darkviolet|00ced1|darkturquoise|darkslategrey|darkslategray|483d8b|darkslateblue|8fbc8f|darkseagreen|e9967a|darksalmon|8b0000|9932cc|darkorchid|ff8c00|darkorange|556b2f|darkolivegreen|8b008b|darkmagenta|bdb76b|darkkhaki|darkgrey|006400|darkgreen|darkgray|b8860b|darkgoldenrod|008b8b|darkcyan|00008b|darkblue|dc143c|crimson|fff8dc|cornsilk|6495ed|cornflowerblue|ff7f50|coral|d2691e||chocolate|7fff00|chartreuse|5f9ea0|cadetblue|deb887|burlywood|a52a2a|8a2be2|blueviolet|0000ff|ffebcd||blanchedalmond|000000|ffe4c4|bisque|f5f5dc|beige|f0ffff|azure|7fffd4|aquamarine|aqua|faebd7|antiquewhite|f0f8ff|aliceblue|lightGray|darkGray|namedColors|blackColor|fromText|whiteColor|_510|_509|PI|rad|deg|transparentColor|_494|_493|_492|fromHSV|_491|_490|_489|asHSV|toHexString|rgba|hsla|toHSLString|isDark|lighterColorWithLevel|darkerColorWithLevel|colorWithLightness|colorWithSaturation|colorWithHue|colorWithAlpha||serif|sans|Verdana||8pt|8em|auto||Close|Clear||Load|Filter||10em||fixed|regex|emergency|line|margin|_Listener|dtd|loose|html4|w3|EN|Transitional|DTD|W3C|PUBLIC|DOCTYPE|blocking|due|debugging|able|Not|resizable|dependent|href|location|_MochiKit_LoggingPane|_429|canvas|strong|fieldset|legend|optgroup|select|form|textarea|label|img|table|tfoot|thead|tbody|htmlFor||useMap|usemap|defaultChecked|hasChildNodes|quot|amp|_405|focus|replaceChild|checkbox||radio|_win|BODY||safari|version|userAgent|navigator|innerHeight|alpha|khtml|Tried|acquire|clearTimeout|setTimeout|GET|ignore|send|abort|failed|Request|readyState|support|does|Browser|Microsoft|_288|_287|used|Deferreds|Chained|success|unfired|fr_FR|de_DE|00|abs|search|pattern|Invalid|getTimezoneOffset|getSeconds|getMinutes|getHours|UTC|3600000|initEvent|Events|debuggingBookmarklet|MESSAGES|LAST|_205|clear|ninfo|nlevel|timestamp|reverse|takes|initial|with|sequence|empty|iterable|numbers|dateLike|escape|find|forward|unregister|unescape|Object|compared|item|contains|logor|logand|cle|clt|cge|cgt|cne|ceq|zrshift|rshift|lshift|xor|mul|mod|sub|add|neg|lognot|_9|_2'.split('|'),0,{})
+
+
+/*
+ * jQuery 1.2.1 - New Wave Javascript
+ *
+ * Copyright (c) 2007 John Resig (jquery.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
+ * $Rev: 3353 $
+ */
+
+var decompressedJQuery = function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(G(){9(1m E!="W")H w=E;H E=18.15=G(a,b){I 6 7u E?6.5N(a,b):1u E(a,b)};9(1m $!="W")H D=$;18.$=E;H u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;E.1b=E.3A={5N:G(c,a){c=c||U;9(1m c=="1M"){H m=u.2S(c);9(m&&(m[1]||!a)){9(m[1])c=E.4D([m[1]],a);J{H b=U.3S(m[3]);9(b)9(b.22!=m[3])I E().1Y(c);J{6[0]=b;6.K=1;I 6}J c=[]}}J I 1u E(a).1Y(c)}J 9(E.1n(c))I 1u E(U)[E.1b.2d?"2d":"39"](c);I 6.6v(c.1c==1B&&c||(c.4c||c.K&&c!=18&&!c.1y&&c[0]!=W&&c[0].1y)&&E.2h(c)||[c])},4c:"1.2.1",7Y:G(){I 6.K},K:0,21:G(a){I a==W?E.2h(6):6[a]},2o:G(a){H b=E(a);b.4Y=6;I b},6v:G(a){6.K=0;1B.3A.1a.16(6,a);I 6},N:G(a,b){I E.N(6,a,b)},4I:G(a){H b=-1;6.N(G(i){9(6==a)b=i});I b},1x:G(f,d,e){H c=f;9(f.1c==3X)9(d==W)I 6.K&&E[e||"1x"](6[0],f)||W;J{c={};c[f]=d}I 6.N(G(a){L(H b 1i c)E.1x(e?6.R:6,b,E.1e(6,c[b],e,a,b))})},17:G(b,a){I 6.1x(b,a,"3C")},2g:G(e){9(1m e!="5i"&&e!=S)I 6.4n().3g(U.6F(e));H t="";E.N(e||6,G(){E.N(6.3j,G(){9(6.1y!=8)t+=6.1y!=1?6.6x:E.1b.2g([6])})});I t},5m:G(b){9(6[0])E(b,6[0].3H).6u().3d(6[0]).1X(G(){H a=6;1W(a.1w)a=a.1w;I a}).3g(6);I 6},8m:G(a){I 6.N(G(){E(6).6q().5m(a)})},8d:G(a){I 6.N(G(){E(6).5m(a)})},3g:G(){I 6.3z(1q,Q,1,G(a){6.58(a)})},6j:G(){I 6.3z(1q,Q,-1,G(a){6.3d(a,6.1w)})},6g:G(){I 6.3z(1q,P,1,G(a){6.12.3d(a,6)})},50:G(){I 6.3z(1q,P,-1,G(a){6.12.3d(a,6.2q)})},2D:G(){I 6.4Y||E([])},1Y:G(t){H b=E.1X(6,G(a){I E.1Y(t,a)});I 6.2o(/[^+>] [^+>]/.14(t)||t.1g("..")>-1?E.4V(b):b)},6u:G(e){H f=6.1X(G(){I 6.67?E(6.67)[0]:6.4R(Q)});H d=f.1Y("*").4O().N(G(){9(6[F]!=W)6[F]=S});9(e===Q)6.1Y("*").4O().N(G(i){H c=E.M(6,"2P");L(H a 1i c)L(H b 1i c[a])E.1j.1f(d[i],a,c[a][b],c[a][b].M)});I f},1E:G(t){I 6.2o(E.1n(t)&&E.2W(6,G(b,a){I t.16(b,[a])})||E.3m(t,6))},5V:G(t){I 6.2o(t.1c==3X&&E.3m(t,6,Q)||E.2W(6,G(a){I(t.1c==1B||t.4c)?E.2A(a,t)<0:a!=t}))},1f:G(t){I 6.2o(E.1R(6.21(),t.1c==3X?E(t).21():t.K!=W&&(!t.11||E.11(t,"2Y"))?t:[t]))},3t:G(a){I a?E.3m(a,6).K>0:P},7c:G(a){I 6.3t("."+a)},3i:G(b){9(b==W){9(6.K){H c=6[0];9(E.11(c,"24")){H e=c.4Z,a=[],Y=c.Y,2G=c.O=="24-2G";9(e<0)I S;L(H i=2G?e:0,33=2G?e+1:Y.K;i<33;i++){H d=Y[i];9(d.26){H b=E.V.1h&&!d.9V["1Q"].9L?d.2g:d.1Q;9(2G)I b;a.1a(b)}}I a}J I 6[0].1Q.1p(/\\r/g,"")}}J I 6.N(G(){9(b.1c==1B&&/4k|5j/.14(6.O))6.2Q=(E.2A(6.1Q,b)>=0||E.2A(6.2H,b)>=0);J 9(E.11(6,"24")){H a=b.1c==1B?b:[b];E("9h",6).N(G(){6.26=(E.2A(6.1Q,a)>=0||E.2A(6.2g,a)>=0)});9(!a.K)6.4Z=-1}J 6.1Q=b})},4o:G(a){I a==W?(6.K?6[0].3O:S):6.4n().3g(a)},6H:G(a){I 6.50(a).28()},6E:G(i){I 6.2J(i,i+1)},2J:G(){I 6.2o(1B.3A.2J.16(6,1q))},1X:G(b){I 6.2o(E.1X(6,G(a,i){I b.2O(a,i,a)}))},4O:G(){I 6.1f(6.4Y)},3z:G(f,d,g,e){H c=6.K>1,a;I 6.N(G(){9(!a){a=E.4D(f,6.3H);9(g<0)a.8U()}H b=6;9(d&&E.11(6,"1I")&&E.11(a[0],"4m"))b=6.4l("1K")[0]||6.58(U.5B("1K"));E.N(a,G(){H a=c?6.4R(Q):6;9(!5A(0,a))e.2O(b,a)})})}};G 5A(i,b){H a=E.11(b,"1J");9(a){9(b.3k)E.3G({1d:b.3k,3e:P,1V:"1J"});J E.5f(b.2g||b.6s||b.3O||"");9(b.12)b.12.3b(b)}J 9(b.1y==1)E("1J",b).N(5A);I a}E.1k=E.1b.1k=G(){H c=1q[0]||{},a=1,2c=1q.K,5e=P;9(c.1c==8o){5e=c;c=1q[1]||{}}9(2c==1){c=6;a=0}H b;L(;a<2c;a++)9((b=1q[a])!=S)L(H i 1i b){9(c==b[i])6r;9(5e&&1m b[i]==\'5i\'&&c[i])E.1k(c[i],b[i]);J 9(b[i]!=W)c[i]=b[i]}I c};H F="15"+(1u 3D()).3B(),6p=0,5c={};E.1k({8a:G(a){18.$=D;9(a)18.15=w;I E},1n:G(a){I!!a&&1m a!="1M"&&!a.11&&a.1c!=1B&&/G/i.14(a+"")},4a:G(a){I a.2V&&!a.1G||a.37&&a.3H&&!a.3H.1G},5f:G(a){a=E.36(a);9(a){9(18.6l)18.6l(a);J 9(E.V.1N)18.56(a,0);J 3w.2O(18,a)}},11:G(b,a){I b.11&&b.11.27()==a.27()},1L:{},M:G(c,d,b){c=c==18?5c:c;H a=c[F];9(!a)a=c[F]=++6p;9(d&&!E.1L[a])E.1L[a]={};9(b!=W)E.1L[a][d]=b;I d?E.1L[a][d]:a},30:G(c,b){c=c==18?5c:c;H a=c[F];9(b){9(E.1L[a]){2E E.1L[a][b];b="";L(b 1i E.1L[a])1T;9(!b)E.30(c)}}J{2a{2E c[F]}29(e){9(c.53)c.53(F)}2E E.1L[a]}},N:G(a,b,c){9(c){9(a.K==W)L(H i 1i a)b.16(a[i],c);J L(H i=0,48=a.K;i<48;i++)9(b.16(a[i],c)===P)1T}J{9(a.K==W)L(H i 1i a)b.2O(a[i],i,a[i]);J L(H i=0,48=a.K,3i=a[0];i<48&&b.2O(3i,i,3i)!==P;3i=a[++i]){}}I a},1e:G(c,b,d,e,a){9(E.1n(b))b=b.2O(c,[e]);H f=/z-?4I|7T-?7Q|1r|69|7P-?1H/i;I b&&b.1c==4W&&d=="3C"&&!f.14(a)?b+"2T":b},1o:{1f:G(b,c){E.N((c||"").2l(/\\s+/),G(i,a){9(!E.1o.3K(b.1o,a))b.1o+=(b.1o?" ":"")+a})},28:G(b,c){b.1o=c!=W?E.2W(b.1o.2l(/\\s+/),G(a){I!E.1o.3K(c,a)}).66(" "):""},3K:G(t,c){I E.2A(c,(t.1o||t).3s().2l(/\\s+/))>-1}},2k:G(e,o,f){L(H i 1i o){e.R["3r"+i]=e.R[i];e.R[i]=o[i]}f.16(e,[]);L(H i 1i o)e.R[i]=e.R["3r"+i]},17:G(e,p){9(p=="1H"||p=="2N"){H b={},42,41,d=["7J","7I","7G","7F"];E.N(d,G(){b["7C"+6]=0;b["7B"+6+"5Z"]=0});E.2k(e,b,G(){9(E(e).3t(\':3R\')){42=e.7A;41=e.7w}J{e=E(e.4R(Q)).1Y(":4k").5W("2Q").2D().17({4C:"1P",2X:"4F",19:"2Z",7o:"0",1S:"0"}).5R(e.12)[0];H a=E.17(e.12,"2X")||"3V";9(a=="3V")e.12.R.2X="7g";42=e.7e;41=e.7b;9(a=="3V")e.12.R.2X="3V";e.12.3b(e)}});I p=="1H"?42:41}I E.3C(e,p)},3C:G(h,j,i){H g,2w=[],2k=[];G 3n(a){9(!E.V.1N)I P;H b=U.3o.3Z(a,S);I!b||b.4y("3n")==""}9(j=="1r"&&E.V.1h){g=E.1x(h.R,"1r");I g==""?"1":g}9(j.1t(/4u/i))j=y;9(!i&&h.R[j])g=h.R[j];J 9(U.3o&&U.3o.3Z){9(j.1t(/4u/i))j="4u";j=j.1p(/([A-Z])/g,"-$1").2p();H d=U.3o.3Z(h,S);9(d&&!3n(h))g=d.4y(j);J{L(H a=h;a&&3n(a);a=a.12)2w.4w(a);L(a=0;a<2w.K;a++)9(3n(2w[a])){2k[a]=2w[a].R.19;2w[a].R.19="2Z"}g=j=="19"&&2k[2w.K-1]!=S?"2s":U.3o.3Z(h,S).4y(j)||"";L(a=0;a<2k.K;a++)9(2k[a]!=S)2w[a].R.19=2k[a]}9(j=="1r"&&g=="")g="1"}J 9(h.3Q){H f=j.1p(/\\-(\\w)/g,G(m,c){I c.27()});g=h.3Q[j]||h.3Q[f];9(!/^\\d+(2T)?$/i.14(g)&&/^\\d/.14(g)){H k=h.R.1S;H e=h.4v.1S;h.4v.1S=h.3Q.1S;h.R.1S=g||0;g=h.R.71+"2T";h.R.1S=k;h.4v.1S=e}}I g},4D:G(a,e){H r=[];e=e||U;E.N(a,G(i,d){9(!d)I;9(d.1c==4W)d=d.3s();9(1m d=="1M"){d=d.1p(/(<(\\w+)[^>]*?)\\/>/g,G(m,a,b){I b.1t(/^(70|6Z|6Y|9Q|4t|9N|9K|3a|9G|9E)$/i)?m:a+"></"+b+">"});H s=E.36(d).2p(),1s=e.5B("1s"),2x=[];H c=!s.1g("<9y")&&[1,"<24>","</24>"]||!s.1g("<9w")&&[1,"<6T>","</6T>"]||s.1t(/^<(9u|1K|9t|9r|9p)/)&&[1,"<1I>","</1I>"]||!s.1g("<4m")&&[2,"<1I><1K>","</1K></1I>"]||(!s.1g("<9m")||!s.1g("<9k"))&&[3,"<1I><1K><4m>","</4m></1K></1I>"]||!s.1g("<6Y")&&[2,"<1I><1K></1K><6L>","</6L></1I>"]||E.V.1h&&[1,"1s<1s>","</1s>"]||[0,"",""];1s.3O=c[1]+d+c[2];1W(c[0]--)1s=1s.5p;9(E.V.1h){9(!s.1g("<1I")&&s.1g("<1K")<0)2x=1s.1w&&1s.1w.3j;J 9(c[1]=="<1I>"&&s.1g("<1K")<0)2x=1s.3j;L(H n=2x.K-1;n>=0;--n)9(E.11(2x[n],"1K")&&!2x[n].3j.K)2x[n].12.3b(2x[n]);9(/^\\s/.14(d))1s.3d(e.6F(d.1t(/^\\s*/)[0]),1s.1w)}d=E.2h(1s.3j)}9(0===d.K&&(!E.11(d,"2Y")&&!E.11(d,"24")))I;9(d[0]==W||E.11(d,"2Y")||d.Y)r.1a(d);J r=E.1R(r,d)});I r},1x:G(c,d,a){H e=E.4a(c)?{}:E.5o;9(d=="26"&&E.V.1N)c.12.4Z;9(e[d]){9(a!=W)c[e[d]]=a;I c[e[d]]}J 9(E.V.1h&&d=="R")I E.1x(c.R,"9e",a);J 9(a==W&&E.V.1h&&E.11(c,"2Y")&&(d=="9d"||d=="9a"))I c.97(d).6x;J 9(c.37){9(a!=W){9(d=="O"&&E.11(c,"4t")&&c.12)6G"O 94 93\'t 92 91";c.90(d,a)}9(E.V.1h&&/6C|3k/.14(d)&&!E.4a(c))I c.4p(d,2);I c.4p(d)}J{9(d=="1r"&&E.V.1h){9(a!=W){c.69=1;c.1E=(c.1E||"").1p(/6O\\([^)]*\\)/,"")+(3I(a).3s()=="8S"?"":"6O(1r="+a*6A+")")}I c.1E?(3I(c.1E.1t(/1r=([^)]*)/)[1])/6A).3s():""}d=d.1p(/-([a-z])/8Q,G(z,b){I b.27()});9(a!=W)c[d]=a;I c[d]}},36:G(t){I(t||"").1p(/^\\s+|\\s+$/g,"")},2h:G(a){H r=[];9(1m a!="8P")L(H i=0,2c=a.K;i<2c;i++)r.1a(a[i]);J r=a.2J(0);I r},2A:G(b,a){L(H i=0,2c=a.K;i<2c;i++)9(a[i]==b)I i;I-1},1R:G(a,b){9(E.V.1h){L(H i=0;b[i];i++)9(b[i].1y!=8)a.1a(b[i])}J L(H i=0;b[i];i++)a.1a(b[i]);I a},4V:G(b){H r=[],2f={};2a{L(H i=0,6y=b.K;i<6y;i++){H a=E.M(b[i]);9(!2f[a]){2f[a]=Q;r.1a(b[i])}}}29(e){r=b}I r},2W:G(b,a,c){9(1m a=="1M")a=3w("P||G(a,i){I "+a+"}");H d=[];L(H i=0,4g=b.K;i<4g;i++)9(!c&&a(b[i],i)||c&&!a(b[i],i))d.1a(b[i]);I d},1X:G(c,b){9(1m b=="1M")b=3w("P||G(a){I "+b+"}");H d=[];L(H i=0,4g=c.K;i<4g;i++){H a=b(c[i],i);9(a!==S&&a!=W){9(a.1c!=1B)a=[a];d=d.8M(a)}}I d}});H v=8K.8I.2p();E.V={4s:(v.1t(/.+(?:8F|8E|8C|8B)[\\/: ]([\\d.]+)/)||[])[1],1N:/6w/.14(v),34:/34/.14(v),1h:/1h/.14(v)&&!/34/.14(v),35:/35/.14(v)&&!/(8z|6w)/.14(v)};H y=E.V.1h?"4h":"5h";E.1k({5g:!E.V.1h||U.8y=="8x",4h:E.V.1h?"4h":"5h",5o:{"L":"8w","8v":"1o","4u":y,5h:y,4h:y,3O:"3O",1o:"1o",1Q:"1Q",3c:"3c",2Q:"2Q",8u:"8t",26:"26",8s:"8r"}});E.N({1D:"a.12",8q:"15.4e(a,\'12\')",8p:"15.2I(a,2,\'2q\')",8n:"15.2I(a,2,\'4d\')",8l:"15.4e(a,\'2q\')",8k:"15.4e(a,\'4d\')",8j:"15.5d(a.12.1w,a)",8i:"15.5d(a.1w)",6q:"15.11(a,\'8h\')?a.8f||a.8e.U:15.2h(a.3j)"},G(i,n){E.1b[i]=G(a){H b=E.1X(6,n);9(a&&1m a=="1M")b=E.3m(a,b);I 6.2o(E.4V(b))}});E.N({5R:"3g",8c:"6j",3d:"6g",8b:"50",89:"6H"},G(i,n){E.1b[i]=G(){H a=1q;I 6.N(G(){L(H j=0,2c=a.K;j<2c;j++)E(a[j])[n](6)})}});E.N({5W:G(a){E.1x(6,a,"");6.53(a)},88:G(c){E.1o.1f(6,c)},87:G(c){E.1o.28(6,c)},86:G(c){E.1o[E.1o.3K(6,c)?"28":"1f"](6,c)},28:G(a){9(!a||E.1E(a,[6]).r.K){E.30(6);6.12.3b(6)}},4n:G(){E("*",6).N(G(){E.30(6)});1W(6.1w)6.3b(6.1w)}},G(i,n){E.1b[i]=G(){I 6.N(n,1q)}});E.N(["85","5Z"],G(i,a){H n=a.2p();E.1b[n]=G(h){I 6[0]==18?E.V.1N&&3y["84"+a]||E.5g&&38.33(U.2V["5a"+a],U.1G["5a"+a])||U.1G["5a"+a]:6[0]==U?38.33(U.1G["6n"+a],U.1G["6m"+a]):h==W?(6.K?E.17(6[0],n):S):6.17(n,h.1c==3X?h:h+"2T")}});H C=E.V.1N&&3x(E.V.4s)<83?"(?:[\\\\w*57-]|\\\\\\\\.)":"(?:[\\\\w\\82-\\81*57-]|\\\\\\\\.)",6k=1u 47("^>\\\\s*("+C+"+)"),6i=1u 47("^("+C+"+)(#)("+C+"+)"),6h=1u 47("^([#.]?)("+C+"*)");E.1k({55:{"":"m[2]==\'*\'||15.11(a,m[2])","#":"a.4p(\'22\')==m[2]",":":{80:"i<m[3]-0",7Z:"i>m[3]-0",2I:"m[3]-0==i",6E:"m[3]-0==i",3v:"i==0",3u:"i==r.K-1",6f:"i%2==0",6e:"i%2","3v-46":"a.12.4l(\'*\')[0]==a","3u-46":"15.2I(a.12.5p,1,\'4d\')==a","7X-46":"!15.2I(a.12.5p,2,\'4d\')",1D:"a.1w",4n:"!a.1w",7W:"(a.6s||a.7V||15(a).2g()||\'\').1g(m[3])>=0",3R:\'"1P"!=a.O&&15.17(a,"19")!="2s"&&15.17(a,"4C")!="1P"\',1P:\'"1P"==a.O||15.17(a,"19")=="2s"||15.17(a,"4C")=="1P"\',7U:"!a.3c",3c:"a.3c",2Q:"a.2Q",26:"a.26||15.1x(a,\'26\')",2g:"\'2g\'==a.O",4k:"\'4k\'==a.O",5j:"\'5j\'==a.O",54:"\'54\'==a.O",52:"\'52\'==a.O",51:"\'51\'==a.O",6d:"\'6d\'==a.O",6c:"\'6c\'==a.O",2r:\'"2r"==a.O||15.11(a,"2r")\',4t:"/4t|24|6b|2r/i.14(a.11)",3K:"15.1Y(m[3],a).K",7S:"/h\\\\d/i.14(a.11)",7R:"15.2W(15.32,G(1b){I a==1b.T;}).K"}},6a:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1u 47("^([:.#]*)("+C+"+)")],3m:G(a,c,b){H d,2b=[];1W(a&&a!=d){d=a;H f=E.1E(a,c,b);a=f.t.1p(/^\\s*,\\s*/,"");2b=b?c=f.r:E.1R(2b,f.r)}I 2b},1Y:G(t,o){9(1m t!="1M")I[t];9(o&&!o.1y)o=S;o=o||U;H d=[o],2f=[],3u;1W(t&&3u!=t){H r=[];3u=t;t=E.36(t);H l=P;H g=6k;H m=g.2S(t);9(m){H p=m[1].27();L(H i=0;d[i];i++)L(H c=d[i].1w;c;c=c.2q)9(c.1y==1&&(p=="*"||c.11.27()==p.27()))r.1a(c);d=r;t=t.1p(g,"");9(t.1g(" ")==0)6r;l=Q}J{g=/^([>+~])\\s*(\\w*)/i;9((m=g.2S(t))!=S){r=[];H p=m[2],1R={};m=m[1];L(H j=0,31=d.K;j<31;j++){H n=m=="~"||m=="+"?d[j].2q:d[j].1w;L(;n;n=n.2q)9(n.1y==1){H h=E.M(n);9(m=="~"&&1R[h])1T;9(!p||n.11.27()==p.27()){9(m=="~")1R[h]=Q;r.1a(n)}9(m=="+")1T}}d=r;t=E.36(t.1p(g,""));l=Q}}9(t&&!l){9(!t.1g(",")){9(o==d[0])d.44();2f=E.1R(2f,d);r=d=[o];t=" "+t.68(1,t.K)}J{H k=6i;H m=k.2S(t);9(m){m=[0,m[2],m[3],m[1]]}J{k=6h;m=k.2S(t)}m[2]=m[2].1p(/\\\\/g,"");H f=d[d.K-1];9(m[1]=="#"&&f&&f.3S&&!E.4a(f)){H q=f.3S(m[2]);9((E.V.1h||E.V.34)&&q&&1m q.22=="1M"&&q.22!=m[2])q=E(\'[@22="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.11(q,m[3]))?[q]:[]}J{L(H i=0;d[i];i++){H a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];9(a=="*"&&d[i].11.2p()=="5i")a="3a";r=E.1R(r,d[i].4l(a))}9(m[1]==".")r=E.4X(r,m[2]);9(m[1]=="#"){H e=[];L(H i=0;r[i];i++)9(r[i].4p("22")==m[2]){e=[r[i]];1T}r=e}d=r}t=t.1p(k,"")}}9(t){H b=E.1E(t,r);d=r=b.r;t=E.36(b.t)}}9(t)d=[];9(d&&o==d[0])d.44();2f=E.1R(2f,d);I 2f},4X:G(r,m,a){m=" "+m+" ";H c=[];L(H i=0;r[i];i++){H b=(" "+r[i].1o+" ").1g(m)>=0;9(!a&&b||a&&!b)c.1a(r[i])}I c},1E:G(t,r,h){H d;1W(t&&t!=d){d=t;H p=E.6a,m;L(H i=0;p[i];i++){m=p[i].2S(t);9(m){t=t.7O(m[0].K);m[2]=m[2].1p(/\\\\/g,"");1T}}9(!m)1T;9(m[1]==":"&&m[2]=="5V")r=E.1E(m[3],r,Q).r;J 9(m[1]==".")r=E.4X(r,m[2],h);J 9(m[1]=="["){H g=[],O=m[3];L(H i=0,31=r.K;i<31;i++){H a=r[i],z=a[E.5o[m[2]]||m[2]];9(z==S||/6C|3k|26/.14(m[2]))z=E.1x(a,m[2])||\'\';9((O==""&&!!z||O=="="&&z==m[5]||O=="!="&&z!=m[5]||O=="^="&&z&&!z.1g(m[5])||O=="$="&&z.68(z.K-m[5].K)==m[5]||(O=="*="||O=="~=")&&z.1g(m[5])>=0)^h)g.1a(a)}r=g}J 9(m[1]==":"&&m[2]=="2I-46"){H e={},g=[],14=/(\\d*)n\\+?(\\d*)/.2S(m[3]=="6f"&&"2n"||m[3]=="6e"&&"2n+1"||!/\\D/.14(m[3])&&"n+"+m[3]||m[3]),3v=(14[1]||1)-0,d=14[2]-0;L(H i=0,31=r.K;i<31;i++){H j=r[i],12=j.12,22=E.M(12);9(!e[22]){H c=1;L(H n=12.1w;n;n=n.2q)9(n.1y==1)n.4U=c++;e[22]=Q}H b=P;9(3v==1){9(d==0||j.4U==d)b=Q}J 9((j.4U+d)%3v==0)b=Q;9(b^h)g.1a(j)}r=g}J{H f=E.55[m[1]];9(1m f!="1M")f=E.55[m[1]][m[2]];f=3w("P||G(a,i){I "+f+"}");r=E.2W(r,f,h)}}I{r:r,t:t}},4e:G(b,c){H d=[];H a=b[c];1W(a&&a!=U){9(a.1y==1)d.1a(a);a=a[c]}I d},2I:G(a,e,c,b){e=e||1;H d=0;L(;a;a=a[c])9(a.1y==1&&++d==e)1T;I a},5d:G(n,a){H r=[];L(;n;n=n.2q){9(n.1y==1&&(!a||n!=a))r.1a(n)}I r}});E.1j={1f:G(g,e,c,h){9(E.V.1h&&g.4j!=W)g=18;9(!c.2u)c.2u=6.2u++;9(h!=W){H d=c;c=G(){I d.16(6,1q)};c.M=h;c.2u=d.2u}H i=e.2l(".");e=i[0];c.O=i[1];H b=E.M(g,"2P")||E.M(g,"2P",{});H f=E.M(g,"2t",G(){H a;9(1m E=="W"||E.1j.4T)I a;a=E.1j.2t.16(g,1q);I a});H j=b[e];9(!j){j=b[e]={};9(g.4S)g.4S(e,f,P);J g.7N("43"+e,f)}j[c.2u]=c;6.1Z[e]=Q},2u:1,1Z:{},28:G(d,c,b){H e=E.M(d,"2P"),2L,4I;9(1m c=="1M"){H a=c.2l(".");c=a[0]}9(e){9(c&&c.O){b=c.4Q;c=c.O}9(!c){L(c 1i e)6.28(d,c)}J 9(e[c]){9(b)2E e[c][b.2u];J L(b 1i e[c])9(!a[1]||e[c][b].O==a[1])2E e[c][b];L(2L 1i e[c])1T;9(!2L){9(d.4P)d.4P(c,E.M(d,"2t"),P);J d.7M("43"+c,E.M(d,"2t"));2L=S;2E e[c]}}L(2L 1i e)1T;9(!2L){E.30(d,"2P");E.30(d,"2t")}}},1F:G(d,b,e,c,f){b=E.2h(b||[]);9(!e){9(6.1Z[d])E("*").1f([18,U]).1F(d,b)}J{H a,2L,1b=E.1n(e[d]||S),4N=!b[0]||!b[0].2M;9(4N)b.4w(6.4M({O:d,2m:e}));b[0].O=d;9(E.1n(E.M(e,"2t")))a=E.M(e,"2t").16(e,b);9(!1b&&e["43"+d]&&e["43"+d].16(e,b)===P)a=P;9(4N)b.44();9(f&&f.16(e,b)===P)a=P;9(1b&&c!==P&&a!==P&&!(E.11(e,\'a\')&&d=="4L")){6.4T=Q;e[d]()}6.4T=P}I a},2t:G(d){H a;d=E.1j.4M(d||18.1j||{});H b=d.O.2l(".");d.O=b[0];H c=E.M(6,"2P")&&E.M(6,"2P")[d.O],3q=1B.3A.2J.2O(1q,1);3q.4w(d);L(H j 1i c){3q[0].4Q=c[j];3q[0].M=c[j].M;9(!b[1]||c[j].O==b[1]){H e=c[j].16(6,3q);9(a!==P)a=e;9(e===P){d.2M();d.3p()}}}9(E.V.1h)d.2m=d.2M=d.3p=d.4Q=d.M=S;I a},4M:G(c){H a=c;c=E.1k({},a);c.2M=G(){9(a.2M)a.2M();a.7L=P};c.3p=G(){9(a.3p)a.3p();a.7K=Q};9(!c.2m&&c.65)c.2m=c.65;9(E.V.1N&&c.2m.1y==3)c.2m=a.2m.12;9(!c.4K&&c.4J)c.4K=c.4J==c.2m?c.7H:c.4J;9(c.64==S&&c.63!=S){H e=U.2V,b=U.1G;c.64=c.63+(e&&e.2R||b.2R||0);c.7E=c.7D+(e&&e.2B||b.2B||0)}9(!c.3Y&&(c.61||c.60))c.3Y=c.61||c.60;9(!c.5F&&c.5D)c.5F=c.5D;9(!c.3Y&&c.2r)c.3Y=(c.2r&1?1:(c.2r&2?3:(c.2r&4?2:0)));I c}};E.1b.1k({3W:G(c,a,b){I c=="5Y"?6.2G(c,a,b):6.N(G(){E.1j.1f(6,c,b||a,b&&a)})},2G:G(d,b,c){I 6.N(G(){E.1j.1f(6,d,G(a){E(6).5X(a);I(c||b).16(6,1q)},c&&b)})},5X:G(a,b){I 6.N(G(){E.1j.28(6,a,b)})},1F:G(c,a,b){I 6.N(G(){E.1j.1F(c,a,6,Q,b)})},7x:G(c,a,b){9(6[0])I E.1j.1F(c,a,6[0],P,b)},25:G(){H a=1q;I 6.4L(G(e){6.4H=0==6.4H?1:0;e.2M();I a[6.4H].16(6,[e])||P})},7v:G(f,g){G 4G(e){H p=e.4K;1W(p&&p!=6)2a{p=p.12}29(e){p=6};9(p==6)I P;I(e.O=="4x"?f:g).16(6,[e])}I 6.4x(4G).5U(4G)},2d:G(f){5T();9(E.3T)f.16(U,[E]);J E.3l.1a(G(){I f.16(6,[E])});I 6}});E.1k({3T:P,3l:[],2d:G(){9(!E.3T){E.3T=Q;9(E.3l){E.N(E.3l,G(){6.16(U)});E.3l=S}9(E.V.35||E.V.34)U.4P("5S",E.2d,P);9(!18.7t.K)E(18).39(G(){E("#4E").28()})}}});E.N(("7s,7r,39,7q,6n,5Y,4L,7p,"+"7n,7m,7l,4x,5U,7k,24,"+"51,7j,7i,7h,3U").2l(","),G(i,o){E.1b[o]=G(f){I f?6.3W(o,f):6.1F(o)}});H x=P;G 5T(){9(x)I;x=Q;9(E.V.35||E.V.34)U.4S("5S",E.2d,P);J 9(E.V.1h){U.7f("<7d"+"7y 22=4E 7z=Q "+"3k=//:><\\/1J>");H a=U.3S("4E");9(a)a.62=G(){9(6.2C!="1l")I;E.2d()};a=S}J 9(E.V.1N)E.4B=4j(G(){9(U.2C=="5Q"||U.2C=="1l"){4A(E.4B);E.4B=S;E.2d()}},10);E.1j.1f(18,"39",E.2d)}E.1b.1k({39:G(g,d,c){9(E.1n(g))I 6.3W("39",g);H e=g.1g(" ");9(e>=0){H i=g.2J(e,g.K);g=g.2J(0,e)}c=c||G(){};H f="4z";9(d)9(E.1n(d)){c=d;d=S}J{d=E.3a(d);f="5P"}H h=6;E.3G({1d:g,O:f,M:d,1l:G(a,b){9(b=="1C"||b=="5O")h.4o(i?E("<1s/>").3g(a.40.1p(/<1J(.|\\s)*?\\/1J>/g,"")).1Y(i):a.40);56(G(){h.N(c,[a.40,b,a])},13)}});I 6},7a:G(){I E.3a(6.5M())},5M:G(){I 6.1X(G(){I E.11(6,"2Y")?E.2h(6.79):6}).1E(G(){I 6.2H&&!6.3c&&(6.2Q||/24|6b/i.14(6.11)||/2g|1P|52/i.14(6.O))}).1X(G(i,c){H b=E(6).3i();I b==S?S:b.1c==1B?E.1X(b,G(a,i){I{2H:c.2H,1Q:a}}):{2H:c.2H,1Q:b}}).21()}});E.N("5L,5K,6t,5J,5I,5H".2l(","),G(i,o){E.1b[o]=G(f){I 6.3W(o,f)}});H B=(1u 3D).3B();E.1k({21:G(d,b,a,c){9(E.1n(b)){a=b;b=S}I E.3G({O:"4z",1d:d,M:b,1C:a,1V:c})},78:G(b,a){I E.21(b,S,a,"1J")},77:G(c,b,a){I E.21(c,b,a,"45")},76:G(d,b,a,c){9(E.1n(b)){a=b;b={}}I E.3G({O:"5P",1d:d,M:b,1C:a,1V:c})},75:G(a){E.1k(E.59,a)},59:{1Z:Q,O:"4z",2z:0,5G:"74/x-73-2Y-72",6o:Q,3e:Q,M:S},49:{},3G:G(s){H f,2y=/=(\\?|%3F)/g,1v,M;s=E.1k(Q,s,E.1k(Q,{},E.59,s));9(s.M&&s.6o&&1m s.M!="1M")s.M=E.3a(s.M);9(s.1V=="4b"){9(s.O.2p()=="21"){9(!s.1d.1t(2y))s.1d+=(s.1d.1t(/\\?/)?"&":"?")+(s.4b||"5E")+"=?"}J 9(!s.M||!s.M.1t(2y))s.M=(s.M?s.M+"&":"")+(s.4b||"5E")+"=?";s.1V="45"}9(s.1V=="45"&&(s.M&&s.M.1t(2y)||s.1d.1t(2y))){f="4b"+B++;9(s.M)s.M=s.M.1p(2y,"="+f);s.1d=s.1d.1p(2y,"="+f);s.1V="1J";18[f]=G(a){M=a;1C();1l();18[f]=W;2a{2E 18[f]}29(e){}}}9(s.1V=="1J"&&s.1L==S)s.1L=P;9(s.1L===P&&s.O.2p()=="21")s.1d+=(s.1d.1t(/\\?/)?"&":"?")+"57="+(1u 3D()).3B();9(s.M&&s.O.2p()=="21"){s.1d+=(s.1d.1t(/\\?/)?"&":"?")+s.M;s.M=S}9(s.1Z&&!E.5b++)E.1j.1F("5L");9(!s.1d.1g("8g")&&s.1V=="1J"){H h=U.4l("9U")[0];H g=U.5B("1J");g.3k=s.1d;9(!f&&(s.1C||s.1l)){H j=P;g.9R=g.62=G(){9(!j&&(!6.2C||6.2C=="5Q"||6.2C=="1l")){j=Q;1C();1l();h.3b(g)}}}h.58(g);I}H k=P;H i=18.6X?1u 6X("9P.9O"):1u 6W();i.9M(s.O,s.1d,s.3e);9(s.M)i.5C("9J-9I",s.5G);9(s.5y)i.5C("9H-5x-9F",E.49[s.1d]||"9D, 9C 9B 9A 5v:5v:5v 9z");i.5C("X-9x-9v","6W");9(s.6U)s.6U(i);9(s.1Z)E.1j.1F("5H",[i,s]);H c=G(a){9(!k&&i&&(i.2C==4||a=="2z")){k=Q;9(d){4A(d);d=S}1v=a=="2z"&&"2z"||!E.6S(i)&&"3U"||s.5y&&E.6R(i,s.1d)&&"5O"||"1C";9(1v=="1C"){2a{M=E.6Q(i,s.1V)}29(e){1v="5k"}}9(1v=="1C"){H b;2a{b=i.5s("6P-5x")}29(e){}9(s.5y&&b)E.49[s.1d]=b;9(!f)1C()}J E.5r(s,i,1v);1l();9(s.3e)i=S}};9(s.3e){H d=4j(c,13);9(s.2z>0)56(G(){9(i){i.9q();9(!k)c("2z")}},s.2z)}2a{i.9o(s.M)}29(e){E.5r(s,i,S,e)}9(!s.3e)c();I i;G 1C(){9(s.1C)s.1C(M,1v);9(s.1Z)E.1j.1F("5I",[i,s])}G 1l(){9(s.1l)s.1l(i,1v);9(s.1Z)E.1j.1F("6t",[i,s]);9(s.1Z&&!--E.5b)E.1j.1F("5K")}},5r:G(s,a,b,e){9(s.3U)s.3U(a,b,e);9(s.1Z)E.1j.1F("5J",[a,s,e])},5b:0,6S:G(r){2a{I!r.1v&&9n.9l=="54:"||(r.1v>=6N&&r.1v<9j)||r.1v==6M||E.V.1N&&r.1v==W}29(e){}I P},6R:G(a,c){2a{H b=a.5s("6P-5x");I a.1v==6M||b==E.49[c]||E.V.1N&&a.1v==W}29(e){}I P},6Q:G(r,b){H c=r.5s("9i-O");H d=b=="6K"||!b&&c&&c.1g("6K")>=0;H a=d?r.9g:r.40;9(d&&a.2V.37=="5k")6G"5k";9(b=="1J")E.5f(a);9(b=="45")a=3w("("+a+")");I a},3a:G(a){H s=[];9(a.1c==1B||a.4c)E.N(a,G(){s.1a(3f(6.2H)+"="+3f(6.1Q))});J L(H j 1i a)9(a[j]&&a[j].1c==1B)E.N(a[j],G(){s.1a(3f(j)+"="+3f(6))});J s.1a(3f(j)+"="+3f(a[j]));I s.66("&").1p(/%20/g,"+")}});E.1b.1k({1A:G(b,a){I b?6.1U({1H:"1A",2N:"1A",1r:"1A"},b,a):6.1E(":1P").N(G(){6.R.19=6.3h?6.3h:"";9(E.17(6,"19")=="2s")6.R.19="2Z"}).2D()},1z:G(b,a){I b?6.1U({1H:"1z",2N:"1z",1r:"1z"},b,a):6.1E(":3R").N(G(){6.3h=6.3h||E.17(6,"19");9(6.3h=="2s")6.3h="2Z";6.R.19="2s"}).2D()},6J:E.1b.25,25:G(a,b){I E.1n(a)&&E.1n(b)?6.6J(a,b):a?6.1U({1H:"25",2N:"25",1r:"25"},a,b):6.N(G(){E(6)[E(6).3t(":1P")?"1A":"1z"]()})},9c:G(b,a){I 6.1U({1H:"1A"},b,a)},9b:G(b,a){I 6.1U({1H:"1z"},b,a)},99:G(b,a){I 6.1U({1H:"25"},b,a)},98:G(b,a){I 6.1U({1r:"1A"},b,a)},96:G(b,a){I 6.1U({1r:"1z"},b,a)},95:G(c,a,b){I 6.1U({1r:a},c,b)},1U:G(k,i,h,g){H j=E.6D(i,h,g);I 6[j.3L===P?"N":"3L"](G(){j=E.1k({},j);H f=E(6).3t(":1P"),3y=6;L(H p 1i k){9(k[p]=="1z"&&f||k[p]=="1A"&&!f)I E.1n(j.1l)&&j.1l.16(6);9(p=="1H"||p=="2N"){j.19=E.17(6,"19");j.2U=6.R.2U}}9(j.2U!=S)6.R.2U="1P";j.3M=E.1k({},k);E.N(k,G(c,a){H e=1u E.2j(3y,j,c);9(/25|1A|1z/.14(a))e[a=="25"?f?"1A":"1z":a](k);J{H b=a.3s().1t(/^([+-]=)?([\\d+-.]+)(.*)$/),1O=e.2b(Q)||0;9(b){H d=3I(b[2]),2i=b[3]||"2T";9(2i!="2T"){3y.R[c]=(d||1)+2i;1O=((d||1)/e.2b(Q))*1O;3y.R[c]=1O+2i}9(b[1])d=((b[1]=="-="?-1:1)*d)+1O;e.3N(1O,d,2i)}J e.3N(1O,a,"")}});I Q})},3L:G(a,b){9(E.1n(a)){b=a;a="2j"}9(!a||(1m a=="1M"&&!b))I A(6[0],a);I 6.N(G(){9(b.1c==1B)A(6,a,b);J{A(6,a).1a(b);9(A(6,a).K==1)b.16(6)}})},9f:G(){H a=E.32;I 6.N(G(){L(H i=0;i<a.K;i++)9(a[i].T==6)a.6I(i--,1)}).5n()}});H A=G(b,c,a){9(!b)I;H q=E.M(b,c+"3L");9(!q||a)q=E.M(b,c+"3L",a?E.2h(a):[]);I q};E.1b.5n=G(a){a=a||"2j";I 6.N(G(){H q=A(6,a);q.44();9(q.K)q[0].16(6)})};E.1k({6D:G(b,a,c){H d=b&&b.1c==8Z?b:{1l:c||!c&&a||E.1n(b)&&b,2e:b,3J:c&&a||a&&a.1c!=8Y&&a};d.2e=(d.2e&&d.2e.1c==4W?d.2e:{8X:8W,8V:6N}[d.2e])||8T;d.3r=d.1l;d.1l=G(){E(6).5n();9(E.1n(d.3r))d.3r.16(6)};I d},3J:{6B:G(p,n,b,a){I b+a*p},5q:G(p,n,b,a){I((-38.9s(p*38.8R)/2)+0.5)*a+b}},32:[],2j:G(b,c,a){6.Y=c;6.T=b;6.1e=a;9(!c.3P)c.3P={}}});E.2j.3A={4r:G(){9(6.Y.2F)6.Y.2F.16(6.T,[6.2v,6]);(E.2j.2F[6.1e]||E.2j.2F.6z)(6);9(6.1e=="1H"||6.1e=="2N")6.T.R.19="2Z"},2b:G(a){9(6.T[6.1e]!=S&&6.T.R[6.1e]==S)I 6.T[6.1e];H r=3I(E.3C(6.T,6.1e,a));I r&&r>-8O?r:3I(E.17(6.T,6.1e))||0},3N:G(c,b,e){6.5u=(1u 3D()).3B();6.1O=c;6.2D=b;6.2i=e||6.2i||"2T";6.2v=6.1O;6.4q=6.4i=0;6.4r();H f=6;G t(){I f.2F()}t.T=6.T;E.32.1a(t);9(E.32.K==1){H d=4j(G(){H a=E.32;L(H i=0;i<a.K;i++)9(!a[i]())a.6I(i--,1);9(!a.K)4A(d)},13)}},1A:G(){6.Y.3P[6.1e]=E.1x(6.T.R,6.1e);6.Y.1A=Q;6.3N(0,6.2b());9(6.1e=="2N"||6.1e=="1H")6.T.R[6.1e]="8N";E(6.T).1A()},1z:G(){6.Y.3P[6.1e]=E.1x(6.T.R,6.1e);6.Y.1z=Q;6.3N(6.2b(),0)},2F:G(){H t=(1u 3D()).3B();9(t>6.Y.2e+6.5u){6.2v=6.2D;6.4q=6.4i=1;6.4r();6.Y.3M[6.1e]=Q;H a=Q;L(H i 1i 6.Y.3M)9(6.Y.3M[i]!==Q)a=P;9(a){9(6.Y.19!=S){6.T.R.2U=6.Y.2U;6.T.R.19=6.Y.19;9(E.17(6.T,"19")=="2s")6.T.R.19="2Z"}9(6.Y.1z)6.T.R.19="2s";9(6.Y.1z||6.Y.1A)L(H p 1i 6.Y.3M)E.1x(6.T.R,p,6.Y.3P[p])}9(a&&E.1n(6.Y.1l))6.Y.1l.16(6.T);I P}J{H n=t-6.5u;6.4i=n/6.Y.2e;6.4q=E.3J[6.Y.3J||(E.3J.5q?"5q":"6B")](6.4i,n,0,1,6.Y.2e);6.2v=6.1O+((6.2D-6.1O)*6.4q);6.4r()}I Q}};E.2j.2F={2R:G(a){a.T.2R=a.2v},2B:G(a){a.T.2B=a.2v},1r:G(a){E.1x(a.T.R,"1r",a.2v)},6z:G(a){a.T.R[a.1e]=a.2v+a.2i}};E.1b.6m=G(){H c=0,3E=0,T=6[0],5t;9(T)8L(E.V){H b=E.17(T,"2X")=="4F",1D=T.12,23=T.23,2K=T.3H,4f=1N&&3x(4s)<8J;9(T.6V){5w=T.6V();1f(5w.1S+38.33(2K.2V.2R,2K.1G.2R),5w.3E+38.33(2K.2V.2B,2K.1G.2B));9(1h){H d=E("4o").17("8H");d=(d=="8G"||E.5g&&3x(4s)>=7)&&2||d;1f(-d,-d)}}J{1f(T.5l,T.5z);1W(23){1f(23.5l,23.5z);9(35&&/^t[d|h]$/i.14(1D.37)||!4f)d(23);9(4f&&!b&&E.17(23,"2X")=="4F")b=Q;23=23.23}1W(1D.37&&!/^1G|4o$/i.14(1D.37)){9(!/^8D|1I-9S.*$/i.14(E.17(1D,"19")))1f(-1D.2R,-1D.2B);9(35&&E.17(1D,"2U")!="3R")d(1D);1D=1D.12}9(4f&&b)1f(-2K.1G.5l,-2K.1G.5z)}5t={3E:3E,1S:c}}I 5t;G d(a){1f(E.17(a,"9T"),E.17(a,"8A"))}G 1f(l,t){c+=3x(l)||0;3E+=3x(t)||0}}})();',62,616,'||||||this|||if|||||||||||||||||||||||||||||||||function|var|return|else|length|for|data|each|type|false|true|style|null|elem|document|browser|undefined||options|||nodeName|parentNode||test|jQuery|apply|css|window|display|push|fn|constructor|url|prop|add|indexOf|msie|in|event|extend|complete|typeof|isFunction|className|replace|arguments|opacity|div|match|new|status|firstChild|attr|nodeType|hide|show|Array|success|parent|filter|trigger|body|height|table|script|tbody|cache|string|safari|start|hidden|value|merge|left|break|animate|dataType|while|map|find|global||get|id|offsetParent|select|toggle|selected|toUpperCase|remove|catch|try|cur|al|ready|duration|done|text|makeArray|unit|fx|swap|split|target||pushStack|toLowerCase|nextSibling|button|none|handle|guid|now|stack|tb|jsre|timeout|inArray|scrollTop|readyState|end|delete|step|one|name|nth|slice|doc|ret|preventDefault|width|call|events|checked|scrollLeft|exec|px|overflow|documentElement|grep|position|form|block|removeData|rl|timers|max|opera|mozilla|trim|tagName|Math|load|param|removeChild|disabled|insertBefore|async|encodeURIComponent|append|oldblock|val|childNodes|src|readyList|multiFilter|color|defaultView|stopPropagation|args|old|toString|is|last|first|eval|parseInt|self|domManip|prototype|getTime|curCSS|Date|top||ajax|ownerDocument|parseFloat|easing|has|queue|curAnim|custom|innerHTML|orig|currentStyle|visible|getElementById|isReady|error|static|bind|String|which|getComputedStyle|responseText|oWidth|oHeight|on|shift|json|child|RegExp|ol|lastModified|isXMLDoc|jsonp|jquery|previousSibling|dir|safari2|el|styleFloat|state|setInterval|radio|getElementsByTagName|tr|empty|html|getAttribute|pos|update|version|input|float|runtimeStyle|unshift|mouseover|getPropertyValue|GET|clearInterval|safariTimer|visibility|clean|__ie_init|absolute|handleHover|lastToggle|index|fromElement|relatedTarget|click|fix|evt|andSelf|removeEventListener|handler|cloneNode|addEventListener|triggered|nodeIndex|unique|Number|classFilter|prevObject|selectedIndex|after|submit|password|removeAttribute|file|expr|setTimeout|_|appendChild|ajaxSettings|client|active|win|sibling|deep|globalEval|boxModel|cssFloat|object|checkbox|parsererror|offsetLeft|wrapAll|dequeue|props|lastChild|swing|handleError|getResponseHeader|results|startTime|00|box|Modified|ifModified|offsetTop|evalScript|createElement|setRequestHeader|ctrlKey|callback|metaKey|contentType|ajaxSend|ajaxSuccess|ajaxError|ajaxStop|ajaxStart|serializeArray|init|notmodified|POST|loaded|appendTo|DOMContentLoaded|bindReady|mouseout|not|removeAttr|unbind|unload|Width|keyCode|charCode|onreadystatechange|clientX|pageX|srcElement|join|outerHTML|substr|zoom|parse|textarea|reset|image|odd|even|before|quickClass|quickID|prepend|quickChild|execScript|offset|scroll|processData|uuid|contents|continue|textContent|ajaxComplete|clone|setArray|webkit|nodeValue|fl|_default|100|linear|href|speed|eq|createTextNode|throw|replaceWith|splice|_toggle|xml|colgroup|304|200|alpha|Last|httpData|httpNotModified|httpSuccess|fieldset|beforeSend|getBoundingClientRect|XMLHttpRequest|ActiveXObject|col|br|abbr|pixelLeft|urlencoded|www|application|ajaxSetup|post|getJSON|getScript|elements|serialize|clientWidth|hasClass|scr|clientHeight|write|relative|keyup|keypress|keydown|change|mousemove|mouseup|mousedown|right|dblclick|resize|focus|blur|frames|instanceof|hover|offsetWidth|triggerHandler|ipt|defer|offsetHeight|border|padding|clientY|pageY|Left|Right|toElement|Bottom|Top|cancelBubble|returnValue|detachEvent|attachEvent|substring|line|weight|animated|header|font|enabled|innerText|contains|only|size|gt|lt|uFFFF|u0128|417|inner|Height|toggleClass|removeClass|addClass|replaceAll|noConflict|insertAfter|prependTo|wrap|contentWindow|contentDocument|http|iframe|children|siblings|prevAll|nextAll|wrapInner|prev|Boolean|next|parents|maxLength|maxlength|readOnly|readonly|class|htmlFor|CSS1Compat|compatMode|compatible|borderTopWidth|ie|ra|inline|it|rv|medium|borderWidth|userAgent|522|navigator|with|concat|1px|10000|array|ig|PI|NaN|400|reverse|fast|600|slow|Function|Object|setAttribute|changed|be|can|property|fadeTo|fadeOut|getAttributeNode|fadeIn|slideToggle|method|slideUp|slideDown|action|cssText|stop|responseXML|option|content|300|th|protocol|td|location|send|cap|abort|colg|cos|tfoot|thead|With|leg|Requested|opt|GMT|1970|Jan|01|Thu|area|Since|hr|If|Type|Content|meta|specified|open|link|XMLHTTP|Microsoft|img|onload|row|borderLeftWidth|head|attributes'.split('|'),0,{});
+
+/*
+ Copyright (c) 2004-2007, The Dojo Foundation
+ All Rights Reserved.
+
+ Licensed under the Academic Free License version 2.1 or above OR the
+ modified BSD license. For more information on Dojo licensing, see:
+
+ http://dojotoolkit.org/community/licensing.shtml
+*/
+
+/*
+ This is a compiled version of Dojo, built for deployment and not for
+ development. To get an editable version, please visit:
+
+ http://dojotoolkit.org
+
+ for documentation and information on getting the source.
+*/
+
+var decompressedDojo = function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('if(V z=="1k"){(B(){if(V D["1o"]=="1k"){D.1o={}}if((!D["1z"])||(!1z["ca"])){D.1z={}}A cn=["rA","rz","1K","ry","rx","9f","rw","rv","ru","rt","rs","rr","rq","ro","rn","rm"];A i=0,24;1s(24=cn[i++]){if(!1z[24]){1z[24]=B(){}}}if(V D["z"]=="1k"){D.z={}}z.1W=D;A d3={im:U,rl:U,rk:"",rj:"",ri:"",rh:K,rg:U};R(A 8z in d3){if(V 1o[8z]=="1k"){1o[8z]=d3[8z]}}A jK=["rf","rd","rc","rb"];A t;1s(t=jK.3a()){z["is"+t]=U}})();z.8h=1o.8h;z.cY={jJ:0,jI:9,jH:0,jG:"",jF:2V("$ra: r9 $".1f(/[0-9]+/)[0]),2i:B(){4G(z.cY){C jJ+"."+jI+"."+jH+jG+" ("+jF+")"}}};z.d1=B(jE,jD,1V){A 2h=1V||z.1W;R(A i=0,p;2h&&(p=jE[i]);i++){2h=(p in 2h?2h[p]:(jD?2h[p]={}:1k))}C 2h};z.88=B(jC,jA,jB){A d2=jC.1A("."),p=d2.8q(),M=z.d1(d2,K,jB);C(M&&p?(M[p]=jA):1k)};z.6q=B(jz,jy,jx){C z.d1(jz.1A("."),jy,jx)};z.r8=B(jw,M){C!!z.6q(jw,U,M)};z["3u"]=B(d0){C z.1W.3u?z.1W.3u(d0):3u(d0)};z.ia=B(jv,cZ,cX){A 8y="r7: "+jv;if(cZ){8y+=" "+cZ}if(cX){8y+=" -- r6 be r5 in cY: "+cX}1z.1K(8y)};z.r4=B(ju,cW){A cV="r3: "+ju+" -- r2 r1 4F r0 qZ qY.";if(cW){cV+=" "+cW}1z.1K(cV)};(B(){A cR={53:{},6p:0,1h:{},8k:{z:{1p:"z",1Z:"."},cU:{1p:"cU",1Z:"../qX/cU"},cT:{1p:"cT",1Z:"cT"}},cN:B(cS){A mp=D.8k;C jp(mp[cS]&&mp[cS].1Z)},jk:B(8x){A mp=D.8k;if(D.cN(8x)){C mp[8x].1Z}C 8x},8v:[],6t:U,56:[],8t:[],8u:U};R(A cQ in cR){z[cQ]=cR[cQ]}})();z.jg=B(8w,cP,cb){A 1g=(((8w.2s(0)=="/"||8w.1f(/^\\w+:/)))?"":D.51)+8w;if(1o.jt&&z.c8){1g+="?"+67(1o.jt).2f(/\\W+/g,"")}1u{C!cP?D.cO(1g,cb):D.jq(1g,cP,cb)}1y(e){1z.1K(e);C U}};z.cO=B(1g,cb){if(D.8v[1g]){C K}A 6u=D.iR(1g,K);if(!6u){C U}D.8v[1g]=K;D.8v.Y(1g);if(cb){6u="("+6u+")"}A jr=z["3u"](6u+"\\r\\n//@ qW="+1g);if(cb){cb(jr)}C K};z.jq=B(1g,jo,cb){A ok=U;1u{ok=D.cO(1g,cb)}1y(e){1z.1K("qV je ",1g," 4G 9f: ",e)}C jp(ok&&D.53[jo])};z.6m=B(){D.8u=K;D.6t=K;A 57=D.56;D.56=[];R(A x=0;x<57.G;x++){57[x]()}D.8u=U;if(z.6t&&z.6p==0&&D.56.G>0){z.8s()}};z.ck=B(){A 57=D.8t;1s(57.G){(57.8q())()}};z.qU=B(M,jn){A d=z;if(P.G==1){d.56.Y(M)}I{if(P.G>1){d.56.Y(B(){M[jn]()})}}if(d.6t&&d.6p==0&&!d.8u){d.8s()}};z.dW=B(M,jm){A d=z;if(P.G==1){d.8t.Y(M)}I{if(P.G>1){d.8t.Y(B(){M[jm]()})}}};z.iM=B(){if(D.6t){C}if(D.6p>0){1z.1K("qT qS in qR!");C}z.8s()};z.8s=B(){if(V 5c=="8b"||(1o["qQ"]&&z.2M)){5c("z.6m();",0)}I{z.6m()}};z.cF=B(jl){A 4v=jl.1A(".");R(A i=4v.G;i>0;i--){A 8r=4v.2w(0,i).22(".");if((i==1)&&!D.cN(8r)){4v[0]="../"+4v[0]}I{A cM=D.jk(8r);if(cM!=8r){4v.3S(0,i,cM);3f}}}C 4v};z.jj=U;z.8m=B(2T,qP,55){55=D.jj||55;A 54=D.53[2T];if(54){C 54}A cL=2T.1A(".");A 3L=D.cF(2T);A jh=((3L[0].2s(0)!="/")&&!3L[0].1f(/^\\w+:/));A ji=3L[3L.G-1];A 3m;if(ji=="*"){2T=cL.2w(0,-1).22(".");3L.8q();3m=3L.22("/")+"/"+(1o["qO"]||"qN")+".js";if(jh&&3m.2s(0)=="/"){3m=3m.2w(1)}}I{3m=3L.22("/")+".js";2T=cL.22(".")}A jf=(!55)?2T:L;A ok=D.jg(3m,jf);if((!ok)&&(!55)){2m S 1O("qM 3O 4E \'"+2T+"\'; 72 qL \'"+3m+"\'")}if((!55)&&(!D["qK"])){54=D.53[2T];if(!54){2m S 1O("qJ \'"+2T+"\' is 3O qI a8 je \'"+3m+"\'")}}C 54};z.8c=z.8m;z.1Q=B(cK){A cJ=cK+"";A 8p=cJ;A 6s=cK.1A(/\\./);if(6s[6s.G-1]=="*"){6s.8q();8p=6s.22(".")}A 8o=z.6q(8p,K);D.53[cJ]=8o;D.53[8p]=8o;C 8o};z.qH=B(8n){A jd=8n["qG"]||[];A cI=jd.3U(8n[z.j4]||8n["aY"]||[]);R(A x=0;x<cI.G;x++){A 8l=cI[x];if(8l.1P==4e){z.8m.14(z,8l)}I{z.8m(8l)}}};z.jb=B(jc,qF){if(jc===K){A cH=[];R(A i=1;i<P.G;i++){cH.Y(P[i])}z.8c.14(z,cH)}};z.qE=z.jb;z.io=B(cG,ja){D.8k[cG]={1p:cG,1Z:ja}};z.qD=B(qC,qB,qA,qz){z.8c("z.j9");z.j9.qy.14(z.qx,P)};(B(){A j7=S 9G("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\\\?([^#]*))?(#(.*))?$");A j6=S 9G("^((([^:]+:)?([^@]+))@)?([^:]*)(:([0-9]+))?$");z.4r=B(){A n=L;A 1V=P;A 1g=1V[0];R(A i=1;i<1V.G;i++){if(!1V[i]){6c}A 1t=S z.4r(1V[i]+"");A 4u=S z.4r(1g+"");if((1t.28=="")&&(!1t.4t)&&(!1t.3l)&&(!1t.1r)){if(1t.52!=n){4u.52=1t.52}1t=4u}I{if(!1t.4t){1t.4t=4u.4t;if(!1t.3l){1t.3l=4u.3l;if(1t.28.2s(0)!="/"){A j8=4u.28.21(0,4u.28.31("/")+1)+1t.28;A 1X=j8.1A("/");R(A j=0;j<1X.G;j++){if(1X[j]=="."){if(j==1X.G-1){1X[j]=""}I{1X.3S(j,1);j--}}I{if(j>0&&!(j==1&&1X[0]=="")&&1X[j]==".."&&1X[j-1]!=".."){if(j==(1X.G-1)){1X.3S(j,1);1X[j-1]=""}I{1X.3S(j-1,2);j-=2}}}}1t.28=1X.22("/")}}}}1g="";if(1t.4t){1g+=1t.4t+":"}if(1t.3l){1g+="//"+1t.3l}1g+=1t.28;if(1t.1r){1g+="?"+1t.1r}if(1t.52){1g+="#"+1t.52}}D.1g=1g.2i();A r=D.1g.1f(j7);D.4t=r[2]||(r[1]?"":n);D.3l=r[4]||(r[3]?"":n);D.28=r[5];D.1r=r[7]||(r[6]?"":n);D.52=r[9]||(r[8]?"":n);if(D.3l!=n){r=D.3l.1f(j6);D.8X=r[3]||n;D.8W=r[4]||n;D.qw=r[5];D.qv=r[7]||n}};z.4r.1C.2i=B(){C D.1g}})();z.qu=B(j5,2E){A 2B=z.cF(j5).22("/");if(!2B){C L}if(2B.31("/")!=2B.G-1){2B+="/"}A cE=2B.T(":");if(2B.2s(0)!="/"&&(cE==-1||cE>2B.T("/"))){2B=z.51+2B}C S z.4r(2B,2E)};if(V 26!="1k"){z.c8=K;z.j4="qt";(B(){A d=z;if(1q&&1q.4I){A 8j=1q.4I("ak");A j3=/z(\\.qs)?\\.js([\\?\\.]|$)/i;R(A i=0;i<8j.G;i++){A 4X=8j[i].5t("4X");if(!4X){6c}A m=4X.1f(j3);if(m){if(!1o["51"]){1o["51"]=4X.21(0,m.hK)}A cD=8j[i].5t("1o");if(cD){A cC=3u("({ "+cD+" })");R(A x in cC){1o[x]=cC[x]}}3f}}}d.51=1o["51"];A n=cq;A 8i=n.iL;A 4Z=n.qr;A 6r=2k(4Z);d.2M=(8i.T("qq")>=0)?6r:0;d.6B=(4Z.T("qo")>=0)||(4Z.T("j2")>=0)?6r:0;d.3o=(4Z.T("j2")>=0)?6r:0;A j1=8i.T("qn");d.gu=d.7B=((j1>=0)&&(!d.6B))?6r:0;d.j0=0;d.1l=0;d.iV=0;1u{if(d.7B){d.j0=2k(8i.1A("qm/")[1].1A(" ")[0])}if((1q.gx)&&(!d.2M)){d.1l=2k(4Z.1A("qk ")[1].1A(";")[0])}}1y(e){}if(z.1l&&(26.8f.cu==="9q:")){1o.iT=K}d.iX=B(){A 2A;A qj;A cB=d.6q("cz.cy");if(cB){C cB}if(V iZ!="1k"){2A=S iZ()}I{if(d.1l){1u{2A=S 9j("qi.qh")}1y(e){}}I{if(cq.qg["8Z/x-iY"]){2A=1q.a9("8b");2A.cA("Z","8Z/x-iY");2A.cA("3n",0);2A.cA("58",0);2A.1c.gq="7C";1q.5K.4c(2A)}}}if(!2A){C L}z.88("cz.cy.qf",2A);C z.6q("cz.cy")};A iW=d.iX();if(iW){d.iV=K}A cm=1q["aX"];d.qe=(cm=="aW")||(cm=="gr")||(d.1l<6);d.8h=1o.8h||(d.1l?n.qd:n.qc).1M();d.qb=1z.1K;d.cx=["iU.8g","em.8g","iU.8g.4.0"];d.9b=B(){A 4s=L;A cv=L;if(!z.1l||!1o.iT){1u{4s=S qa()}1y(e){}}if(!4s){R(A i=0;i<3;++i){A cw=z.cx[i];1u{4s=S 9j(cw)}1y(e){cv=e}if(4s){z.cx=[cw];3f}}}if(!4s){2m S 1O("8g 3O q9: "+cv)}C 4s};d.8Y=B(iS){A 4Y=iS.3N||0;C((4Y>=q8)&&(4Y<q7))||(4Y==q6)||(4Y==q5)||(!4Y&&(8f.cu=="9q:"||8f.cu=="q4:"))};A cs=1q.4I("q3");A iQ=(cs&&cs.G>0);d.iR=B(1g,iP){A 3K=D.9b();if(!iQ&&z.4r){1g=(S z.4r(26.8f,1g)).2i()}3K.dL("dD",1g,U);1u{3K.dI(L);if(!d.8Y(3K)){A 1G=1O("q2 4F 4E "+1g+" 3N:"+3K.3N);1G.3N=3K.3N;1G.2G=3K.2G;2m 1G}}1y(e){if(iP){C L}2m e}C 3K.2G}})();z.iO=U;z.6o=B(e){z.iO=K;A cr=(e&&e.Z)?e.Z.1M():"4E";if(P.2O.iN||(cr!="q1"&&cr!="4E")){C}P.2O.iN=K;if(V z["8e"]!="1k"){dX(z.8e);63 z.8e}if(z.6p==0){z.iM()}};if(1q.66){if(z.2M||(z.7B&&(1o["q0"]===K))){1q.66("pZ",z.6o,L)}26.66("4E",z.6o,L)}if(/(pY|pX)/i.6Z(cq.iL)){z.8e=dN(B(){if(/6m|iJ/.6Z(1q.6F)){z.6o()}},10)}(B(){A 3g=26;A 8d=B(cp,fp){A iK=3g[cp]||B(){};3g[cp]=B(){fp.14(3g,P);iK.14(3g,P)}};if(z.1l){1q.fJ("<iI"+"iH pW 4X=\\"//:\\" "+"pV=\\"if(D.6F==\'iJ\'){z.6o();}\\">"+"</iI"+"iH>");A co=K;8d("iG",B(){3g.5c(B(){co=U},0)});8d("pU",B(){if(co){z.ck()}});1u{1q.pT.2P("v","pS:pR-pQ-pP:pO");1q.pN().pM("v\\\\:*","pL:2E(#aY#pK)")}1y(e){}}I{8d("iG",B(){z.ck()})}})();z.pJ=B(){};z.1e=26["1q"]||L;z.3E=B(){C z.1e.3E||z.1e.4I("3E")[0]};z.ch=B(iF,iE){z.1W=iF;z.1e=iE};z.cf=B(4q,6n,iD){if((6n)&&((V 4q=="3c")||(4q 1N 67))){4q=6n[4q]}C(6n?4q.14(6n,iD||[]):4q())};z.pI=B(cj,iC,iB,iA){A cg;A iz=z.1W;A iy=z.1e;1u{z.ch(cj,cj.1q);cg=z.cf(iC,iB,iA)}ir{z.ch(iz,iy)}C cg};z.pH=B(ix,iw,iv,iu){A ce;A ip=z.1e;1u{z.1e=ix;ce=z.cf(iw,iv,iu)}ir{z.1e=ip}C ce};if(1o["cd"]){R(A cc in 1o["cd"]){z.io(cc,1o["cd"][cc])}}}if(1o.im){if(!1z.ca){z.8c("z.pG.ca")}}}if(!z.1h["z.X.c9"]){z.1h["z.X.c9"]=K;z.1Q("z.X.c9");z.1R=B(it){C(V it=="3c"||it 1N 67)};z.2l=B(it){C(it&&it 1N 4e||V it=="6a"||((V z["1H"]!="1k")&&(it 1N z.1H)))};if(z.c8&&z.3o){z.1Y=B(it){if((V(it)=="B")&&(it=="[8b 1H]")){C U}C(V it=="B"||it 1N bI)}}I{z.1Y=B(it){C(V it=="B"||it 1N bI)}}z.ib=B(it){if(V it=="1k"){C U}C(it===L||V it=="8b"||z.2l(it)||z.1Y(it))};z.pF=B(it){A d=z;if((!it)||(V it=="1k")){C U}if(d.1R(it)){C U}if(d.1Y(it)){C U}if(d.2l(it)){C K}if((it.5w)&&(it.5w.1M()=="3R")){C U}if(pE(it.G)){C K}C U};z.pD=B(it){if(!it){C U}C!z.1Y(it)&&/\\{\\s*\\[il 5h\\]\\s*\\}/.6Z(67(it))};z.c7=B(M,4W){A 8a={};R(A x in 4W){if((V 8a[x]=="1k")||(8a[x]!=4W[x])){M[x]=4W[x]}}if(z.1l){A p=4W.2i;if((V(p)=="B")&&(p!=M.2i)&&(p!=8a.2i)&&(p!="\\pC 2i() {\\n [il 5h]\\n}\\n")){M.2i=4W.2i}}C M};z.1x=B(M,pB){R(A i=1,l=P.G;i<l;i++){z.c7(M,P[i])}C M};z.4M=B(c6,pA){R(A i=1,l=P.G;i<l;i++){z.c7(c6.1C,P[i])}C c6};z.ig=B(c5,89){A ij=z.4d(P,2);A ik=z.1R(89);C B(){A ih=z.4d(P);A f=(ik?(c5||z.1W)[89]:89);C(f)&&(f.14(c5||D,ij.3U(ih)))}};z.2p=B(2z,3k){if(P.G>2){C z.ig.14(z,P)}if(!3k){3k=2z;2z=L}if(z.1R(3k)){2z=2z||z.1W;if(!2z[3k]){2m(["z.2p: ie[\\"",3k,"\\"] is L (ie=\\"",2z,"\\")"].22(""))}C B(){C 2z[3k].14(2z,P||[])}}I{C(!2z?3k:B(){C 3k.14(2z,P||[])})}};z.6j=B(M,c3){B c4(){};c4.1C=M;A c2=S c4();if(c3){z.1x(c2,c3)}C c2};z.7X=B(pz){A Q=[L];C z.2p.14(z,Q.3U(z.4d(P)))};z.4d=B(M,ic){A Q=[];R(A x=ic||0;x<M.G;x++){Q.Y(M[x])}C Q};z.c1=B(o){if(!o){C o}if(z.2l(o)){A r=[];R(A i=0;i<o.G;++i){r.Y(z.c1(o[i]))}C r}I{if(z.ib(o)){if(o.2t&&o.a7){C o.a7(K)}I{A r=S o.1P();R(A i in o){if(!(i in r)||r[i]!=o[i]){r[i]=z.c1(o[i])}}C r}}}C o};z.7g=B(2H){C 2H.2f(/^\\s\\s*/,"").2f(/\\s\\s*$/,"")}}if(!z.1h["z.X.2r"]){z.1h["z.X.2r"]=K;z.1Q("z.X.2r");z.2r=B(6l,4p,3j){if(z.1Y(3j)||(P.G>3)){z.ia("z.2r: R 9P \'"+6l+"\' py pw B as \'1P\' pv pu of as a pt i3.","","1.0");A c=3j;3j=P[3]||{};3j.1P=c}A dd=P.2O,4V=L;if(z.2l(4p)){4V=4p;4p=4V.3a()}if(4V){R(A i=0,m;i<4V.G;i++){m=4V[i];if(!m){2m("ps #"+i+" 4F pr of "+6l+" is L. pq\'s pp a po pl is 3O 6m.")}4p=dd.6j(4p,m)}}A i9=(3j||0).1P,6k=dd.6j(4p),fn;R(A i in 3j){if(z.1Y(fn=3j[i])&&(!0[i])){fn.i4=i}}z.4M(6k,{4o:6l,bY:i9,bZ:L},3j||0);6k.1C.1P=6k;C z.88(6l,6k)};z.1x(z.2r,{6j:B(c0,i8){A bp=(c0||0).1C,mp=(i8||0).1C;A 2S=z.2r.i7();z.1x(2S,{84:bp,1x:mp});if(c0){2S.1C=z.6j(bp)}z.4M(2S,z.2r.i6,mp||0,{bY:L});2S.1C.1P=2S;2S.1C.4o=(bp||0).4o+"pk"+(mp||0).4o;z.88(2S.1C.4o,2S);C 2S},i7:B(){C B(){D.i5(P)}},i6:{i5:B(86){A c=86.2O,s=c.84,ct=s&&s.1P,m=c.1x,87=m&&m.1P,a=86,ii,fn;if(a[0]){if((fn=a[0]["bZ"])){a=fn.14(D,a)||a}}if(fn=c.1C.bZ){a=fn.14(D,a)||a}if(ct&&ct.14){ct.14(D,a)}if(87&&87.14){87.14(D,a)}if(ii=c.1C.bY){ii.14(D,86)}},bX:B(85){A c=D.1P,p,m;1s(c){p=c.84;m=c.1x;if(m==85||(m 1N 85.1P)){C p}if(m&&(m=m.bX(85))){C m}c=p&&p.1P}},6h:B(83,82,bW,6i){A p=bW,c,m,f;do{c=p.1P;m=c.1x;if(m&&(m=D.6h(83,82,m,6i))){C m}if((f=p[83])&&(6i==(f==82))){C p}p=c.84}1s(p);C!6i&&(p=D.bX(bW))&&D.6h(83,82,p,6i)},bU:B(2R,4U,bV){A a=P;if(!z.1R(a[0])){bV=4U;4U=2R;2R=4U.2O.i4}A c=4U.2O,p=D.1P.1C,a=bV||4U,fn,mp;if(D[2R]!=c||p[2R]==c){mp=D.6h(2R,c,p,K);if(!mp){2m(D.4o+": 1p i3 (\\""+2R+"\\") 4F bU pj 1f 2O (2r.js)")}p=D.6h(2R,c,mp,U)}fn=p&&p[2R];if(!fn){1z.1K(mp.4o+": no bU \\""+2R+"\\" ph pg (2r.js)");C}C fn.14(D,a)}}})}if(!z.1h["z.X.2c"]){z.1h["z.X.2c"]=K;z.1Q("z.X.2c");z.3i={i2:B(){C B(){A ap=4e.1C,c=P.2O,ls=c.2b,t=c.5V;A r=t&&t.14(D,P);R(A i in ls){if(!(i in ap)){ls[i].14(D,P)}}C r}},2P:B(6g,bT,i1){6g=6g||z.1W;A f=6g[bT];if(!f||!f.2b){A d=z.3i.i2();d.5V=f;d.2b=[];f=6g[bT]=d}C f.2b.Y(i1)},3J:B(i0,hZ,bS){A f=(i0||z.1W)[hZ];if(f&&f.2b&&bS--){63 f.2b[bS]}}};z.2c=B(M,pd,pc,pa,p9){A a=P,F=[],i=0;F.Y(z.1R(a[0])?L:a[i++],a[i++]);A a1=a[i+1];F.Y(z.1R(a1)||z.1Y(a1)?a[i++]:L,a[i++]);R(A l=a.G;i<l;i++){F.Y(a[i])}C z.by.14(D,F)};z.by=B(M,bR,hY,hX){A l=z.3i,h=l.2P(M,bR,z.2p(hY,hX));C[M,bR,h,l]};z.p8=B(6f){if(6f&&6f[0]!==1k){z.bv.14(D,6f);63 6f[0]}};z.bv=B(M,hV,hU,hW){hW.3J(M,hV,hU)};z.80={};z.p7=B(bQ,hT,hS){C[bQ,z.3i.2P(z.80,bQ,z.2p(hT,hS))]};z.p6=B(81){if(81){z.3i.3J(z.80,81[0],81[1])}};z.hQ=B(hR,F){A f=z.80[hR];(f)&&(f.14(D,F||[]))};z.p5=B(hP,M,bP){A pf=B(){z.hQ(hP,P)};C(bP)?z.2c(M,bP,pf):z.2c(M,pf)}}if(!z.1h["z.X.30"]){z.1h["z.X.30"]=K;z.1Q("z.X.30");z.30=B(hO){D.bM=[];D.id=D.hN();D.2y=-1;D.3M=0;D.4R=[L,L];D.bO=hO;D.7Z=U};z.4M(z.30,{hN:(B(){A n=1;C B(){C n++}})(),4C:B(){if(D.2y==-1){if(D.bO){D.bO(D)}I{D.7Z=K}if(D.2y==-1){A 1G=S 1O("30 p4");1G.dY="4C";D.5i(1G)}}I{if((D.2y==0)&&(D.4R[0]1N z.30)){D.4R[0].4C()}}},7V:B(1v){D.2y=((1v 1N 1O)?1:0);D.4R[D.2y]=1v;D.7U()},bN:B(){if(D.2y!=-1){if(!D.7Z){2m S 1O("p3 p2!")}D.7Z=U;C}},dM:B(1v){D.bN();D.7V(1v)},5i:B(1v){D.bN();if(!(1v 1N 1O)){1v=S 1O(1v)}D.7V(1v)},9e:B(cb,4T){A 6e=z.2p(cb,4T);if(P.G>2){6e=z.7X(6e,P,2)}C D.5k(6e,6e)},ef:B(cb,4T){A 7Y=z.2p(cb,4T);if(P.G>2){7Y=z.7X(7Y,P,2)}C D.5k(7Y,L)},ed:B(cb,4T){A 7W=z.2p(cb,4T);if(P.G>2){7W=z.7X(7W,P,2)}C D.5k(L,7W)},5k:B(cb,eb){D.bM.Y([cb,eb]);if(D.2y>=0){D.7U()}C D},7U:B(){A bL=D.bM;A 4n=D.2y;A 1v=D.4R[4n];A 4S=D;A cb=L;1s((bL.G>0)&&(D.3M==0)){A f=bL.3a()[4n];if(!f){6c}1u{1v=f(1v);4n=((1v 1N 1O)?1:0);if(1v 1N z.30){cb=B(1v){4S.7V(1v);4S.3M--;if((4S.3M==0)&&(4S.2y>=0)){4S.7U()}};D.3M++}}1y(1G){1z.1K(1G);4n=1;1v=1G}}D.2y=4n;D.4R[4n]=1v;if((cb)&&(D.3M)){1v.9e(cb)}}})}if(!z.1h["z.X.2e"]){z.1h["z.X.2e"]=K;z.1Q("z.X.2e");z.5m=B(2e){1u{C 3u("("+2e+")")}1y(e){1z.1K(e);C 2e}};z.bK=B(2H){C("\\""+2H.2f(/(["\\\\])/g,"\\\\$1")+"\\"").2f(/[\\f]/g,"\\\\f").2f(/[\\b]/g,"\\\\b").2f(/[\\n]/g,"\\\\n").2f(/[\\t]/g,"\\\\t").2f(/[\\r]/g,"\\\\r")};z.hM="\\t";z.eq=B(it,4l,4P){4P=4P||"";A 4k=(4l?4P+z.hM:"");A 6b=(4l?"\\n":"");A 4Q=V(it);if(4Q=="1k"){C"1k"}I{if((4Q=="4J")||(4Q=="p1")){C it+""}I{if(it===L){C"L"}}}if(4Q=="3c"){C z.bK(it)}A 6d=P.2O;A 4m;if(V it.hL=="B"){4m=it.hL();if(it!==4m){C 6d(4m,4l,4k)}}if(V it.2e=="B"){4m=it.2e();if(it!==4m){C 6d(4m,4l,4k)}}if(z.2l(it)){A 1v=[];R(A i=0;i<it.G;i++){A 1U=6d(it[i],4l,4k);if(V(1U)!="3c"){1U="1k"}1v.Y(6b+4k+1U)}C"["+1v.22(", ")+6b+4P+"]"}if(4Q=="B"){C L}A bJ=[];R(A 1i in it){A 7T;if(V(1i)=="4J"){7T="\\""+1i+"\\""}I{if(V(1i)=="3c"){7T=z.bK(1i)}I{6c}}1U=6d(it[1i],4l,4k);if(V(1U)!="3c"){6c}bJ.Y(6b+4k+7T+": "+1U)}C"{"+bJ.22(", ")+6b+4P+"}"}}if(!z.1h["z.X.6a"]){z.1h["z.X.6a"]=K;z.1Q("z.X.6a");(B(){A 69=B(Q,M,cb){C[(z.1R(Q)?Q.1A(""):Q),(M||z.1W),(z.1R(cb)?(S bI("1m","hK","6a",cb)):cb)]};z.1x(z,{T:B(bH,hH,hI,hJ){A i=0,2q=1,1d=bH.G;if(hJ){i=1d-1;2q=1d=-1}R(i=hI||i;i!=1d;i+=2q){if(bH[i]==hH){C i}}C-1},31:B(hG,hF,hE){C z.T(hG,hF,hE,K)},1n:B(Q,hD,M){if(!Q||!Q.G){C}A 1I=69(Q,M,hD);Q=1I[0];R(A i=0,l=1I[0].G;i<l;i++){1I[2].2d(1I[1],Q[i],i,Q)}},bE:B(bF,Q,hC,M){A 1I=69(Q,M,hC);Q=1I[0];R(A i=0,l=Q.G;i<l;i++){A bG=!!1I[2].2d(1I[1],Q[i],i,Q);if(bF^bG){C bG}}C bF},ah:B(Q,hB,hA){C D.bE(K,Q,hB,hA)},ag:B(Q,hz,hy){C D.bE(U,Q,hz,hy)},23:B(Q,7t,M){A 1I=69(Q,M,7t);Q=1I[0];A bD=((P[3])?(S P[3]()):[]);R(A i=0;i<Q.G;++i){bD.Y(1I[2].2d(1I[1],Q[i],i,Q))}C bD},3T:B(Q,hx,M){A 1I=69(Q,M,hx);Q=1I[0];A bC=[];R(A i=0;i<Q.G;i++){if(1I[2].2d(1I[1],Q[i],i,Q)){bC.Y(Q[i])}}C bC}})})()}if(!z.1h["z.X.1J"]){z.1h["z.X.1J"]=K;z.1Q("z.X.1J");z.1J=B(bB){if(bB){D.hw(bB)}};z.1J.hp={p0:[0,0,0],oZ:[60,60,60],oY:[2j,2j,2j],oX:[1T,1T,1T],oW:[2j,0,0],oV:[1T,0,0],oU:[2j,0,2j],oT:[1T,0,1T],oS:[0,2j,0],oR:[0,1T,0],oQ:[2j,2j,0],oP:[1T,1T,0],oO:[0,0,2j],oN:[0,0,1T],oM:[0,2j,2j],oL:[0,1T,1T]};z.4M(z.1J,{r:1T,g:1T,b:1T,a:1,bz:B(r,g,b,a){A t=D;t.r=r;t.g=g;t.b=b;t.a=a},hw:B(2Q){A d=z;if(d.1R(2Q)){d.hq(2Q,D)}I{if(d.2l(2Q)){d.7P(2Q,D)}I{D.bz(2Q.r,2Q.g,2Q.b,2Q.a);if(!(2Q 1N d.1J)){D.7Q()}}}C D},7Q:B(){C D},oK:B(){A t=D;C[t.r,t.g,t.b]},oJ:B(){A t=D;C[t.r,t.g,t.b,t.a]},oI:B(){A Q=z.23(["r","g","b"],B(x){A s=D[x].2i(16);C s.G<2?"0"+s:s},D);C"#"+Q.22("")},8F:B(hv){A t=D,7S=t.r+", "+t.g+", "+t.b;C(hv?"hs("+7S+", "+t.a:"7S("+7S)+")"},2i:B(){C D.8F(K)}});z.d8=B(bA,1d,hu,M){A d=z,t=M||S z.1J();d.1n(["r","g","b","a"],B(x){t[x]=bA[x]+(1d[x]-bA[x])*hu;if(x!="a"){t[x]=2Y.oH(t[x])}});C t.7Q()};z.ho=B(ht,M){A m=ht.1M().1f(/^hs?\\(([\\s\\.,0-9]+)\\)/);C m&&z.7P(m[1].1A(/\\s*,\\s*/),M)};z.hn=B(4j,M){A d=z,t=M||S d.1J(),7R=(4j.G==4)?4:8,hr=(1<<7R)-1;4j=2V("oG"+4j.3b(1));if(2L(4j)){C L}d.1n(["b","g","r"],B(x){A c=4j&hr;4j>>=7R;t[x]=7R==4?17*c:c});t.a=1;C t};z.7P=B(a,M){A t=M||S z.1J();t.bz(2V(a[0]),2V(a[1]),2V(a[2]),2V(a[3]));if(2L(t.a)){t.a=1}C t.7Q()};z.hq=B(2H,M){A a=z.1J.hp[2H];C a&&z.7P(a,M)||z.ho(2H,M)||z.hn(2H,M)}}if(!z.1h["z.X"]){z.1h["z.X"]=K;z.1Q("z.X")}if(!z.1h["z.X.5Z"]){z.1h["z.X.5Z"]=K;z.1Q("z.X.5Z");(B(){A 1j=z.b2={2P:B(E,68,fp){if(!E){C}68=1j.4O(68);fp=1j.7G(68,fp);E.66(68,fp,U);C fp},3J:B(E,hm,hl){(E)&&(E.oF(1j.4O(hm),hl,U))},4O:B(1p){C(1p.2w(0,2)=="on"?1p.2w(2):1p)},7G:B(1p,fp){C(1p!="4b"?fp:B(e){C fp.2d(D,1j.4i(e,D))})},4i:B(H,oE){4w(H.Z){2X"4b":1j.7K(H);3f}C H},7K:B(H){H.oD=(H.3h?67.oC(H.3h):"")}};z.oB=B(H,hk){C 1j.4i(H,hk)};z.gY=B(H){H.7J();H.7I()};A 7O=z.3i;z.by=B(M,bx,hh,hg,hi){A hj=M&&(M.2t||M.oA||M.66);A bw=!hj?0:(!hi?1:2),l=[z.3i,1j,7O][bw];A h=l.2P(M,bx,z.2p(hh,hg));C[M,bx,h,bw]};z.bv=B(M,he,hd,hf){([z.3i,1j,7O][hf]).3J(M,he,hd)};z.5W={oz:8,gV:9,oy:12,ox:13,ow:16,ov:17,ou:18,gG:19,ot:20,os:27,or:32,b5:33,b4:34,gE:35,gF:36,b7:37,b9:38,b6:39,b8:40,gD:45,8S:46,oq:47,oo:91,om:92,ol:93,oj:96,oi:97,oh:98,og:99,oe:6D,od:oc,ob:oa,o9:o8,o7:o6,o5:o4,o3:bi,o2:o1,o0:nZ,nY:nX,nW:nV,nU:bk,gS:nT,gR:nS,gQ:nR,gP:nQ,gO:nP,gN:nO,gM:nN,gL:nM,gK:nL,gJ:nK,gI:nJ,gH:nI,nH:nG,nF:nE,nD:nC,gB:nB,gC:nA};if(z.1l){bf=B(e,5h){1u{C(e.3I=5h)}1y(e){C 0}};A 61=z.3i;if(!1o.nz){7O=61=z.gy={b3:[],2P:B(64,bu,hc){64=64||z.1W;A f=64[bu];if(!f||!f.2b){A d=z.gz();d.5V=f&&(7M.Y(f)-1);d.2b=[];f=64[bu]=d}C f.2b.Y(7M.Y(hc)-1)},3J:B(hb,ha,7N){A f=(hb||z.1W)[ha],l=f&&f.2b;if(f&&l&&7N--){63 7M[l[7N]];63 l[7N]}}};A 7M=61.b3}z.1x(1j,{2P:B(E,62,fp){if(!E){C}62=1j.4O(62);if(62=="h3"){A kd=E.bs;if(!kd||!kd.2b||!kd.h9){1j.2P(E,"bs",1j.h4);E.bs.h9=K}}C 61.2P(E,62,1j.7G(fp))},3J:B(E,h8,h7){61.3J(E,1j.4O(h8),h7)},4O:B(7L){C(7L.2w(0,2)!="on"?"on"+7L:7L)},ny:B(){},4i:B(H,4N){if(!H){A w=(4N)&&((4N.aD||4N.1q||4N).nx)||26;H=w.5Z}if(!H){C(H)}H.5V=H.br;H.bh=(4N||H.br);H.nw=H.nv;H.nu=H.nr;A bq=H.br,1e=(bq&&bq.aD)||1q;A bn=((z.1l<6)||(1e["aX"]=="aW"))?1e.3E:1e.5K;A bm=z.aB();H.nq=H.np+z.aH(bn.5I||0)-bm.x;H.nn=H.nm+(bn.5G||0)-bm.y;if(H.Z=="fk"){H.h6=H.nl}if(H.Z=="fj"){H.h6=H.nk}H.7I=1j.bc;H.7J=1j.ba;C 1j.h5(H)},h5:B(H){4w(H.Z){2X"4b":A c=("3h"in H?H.3h:H.3I);if(c==10){c=0;H.3I=13}I{if(c==13||c==27){c=0}I{if(c==3){c=99}}}H.3h=c;1j.7K(H);3f}C H},gZ:{bi:42,bk:47,h2:59,nj:43,ni:44,nh:45,ng:46,nf:47,60:96,h1:91,nb:92,na:93,h0:39},h4:B(H){A kp=H.bh.h3;if(!kp||!kp.2b){C}A k=H.3I;A bj=(k!=13)&&(k!=32)&&(k!=27)&&(k<48||k>90)&&(k<96||k>bk)&&(k<h2||k>60)&&(k<h1||k>h0);if(bj||H.5Y){A c=(bj?0:k);if(H.5Y){if(k==3||k==13){C}I{if(c>95&&c<bi){c-=48}I{if((!H.5X)&&(c>=65&&c<=90)){c+=32}I{c=1j.gZ[c]||c}}}}A 2x=1j.7H(H,{Z:"4b",2x:K,3h:c});kp.2d(H.bh,2x);H.bg=2x.bg;H.bd=2x.bd;bf(H,2x.3I)}},bc:B(){D.bg=K},ba:B(){D.n9=D.3I;if(D.5Y){bf(D,0)}D.bd=U}});z.gY=B(H){H=H||26.5Z;1j.bc.2d(H);1j.ba.2d(H)}}1j.7H=B(H,gX){A 2x=z.1x({},H,gX);1j.7K(2x);2x.7J=B(){H.7J()};2x.7I=B(){H.7I()};C 2x};if(z.2M){z.1x(1j,{4i:B(H,n8){4w(H.Z){2X"4b":A c=H.n7;if(c==3){c=99}c=((c<41)&&(!H.5X)?0:c);if((H.5Y)&&(!H.5X)&&(c>=65)&&(c<=90)){c+=32}C 1j.7H(H,{3h:c})}C H}})}if(z.3o){z.1x(1j,{4i:B(H,n6){4w(H.Z){2X"4b":A c=H.3h,s=H.5X,k=H.3I;k=k||gA[H.gW]||0;if(H.gW=="n5"){c=0}I{if((H.5Y)&&(c>0)&&(c<27)){c+=96}I{if(c==z.5W.gU){c=z.5W.gV;s=K}I{c=(c>=32&&c<gT?c:0)}}}C 1j.7H(H,{3h:c,5X:s,3I:k})}C H}});z.1x(z.5W,{gU:25,b9:gT,b8:n4,b7:n3,b6:n2,gS:n1,gR:n0,gQ:mZ,gP:mY,gO:mX,gN:mW,gM:mV,gL:mU,gK:mT,gJ:mS,gI:mR,gH:mQ,gG:mP,8S:mO,gF:mN,gE:mM,b5:mL,b4:mK,gD:mJ,mI:mH,gC:mG,gB:mF});A dk=z.5W,gA={"mE":dk.b9,"mD":dk.b8,"mC":dk.b7,"mB":dk.b6,"mA":dk.b5,"mz":dk.b4}}})();if(z.1l){z.gz=B(){C B(){A ap=4e.1C,h=z.gy.b3,c=P.2O,ls=c.2b,t=h[c.5V];A r=t&&t.14(D,P);R(A i in ls){if(!(i in ap)){h[ls[i]].14(D,P)}}C r}};z.b2.7G=B(fp){A f=z.b2.4i;C B(e){C fp.2d(D,f(e,D))}}}}if(!z.1h["z.X.b1"]){z.1h["z.X.b1"]=K;z.1Q("z.X.b1");1u{1q.my("mx",U,K)}1y(e){}if(z.1l||z.2M){z.1D=B(id,1e){if(z.1R(id)){A b0=(1e||z.1e);A 11=b0.gv(id);if((11)&&(11.gw.id.1Z==id)){C 11}I{A 5U=b0.gx[id];if(!5U){C}if(!5U.G){C 5U}A i=0;1s(11=5U[i++]){if(11.gw.id.1Z==id){C 11}}}}I{C id}}}I{z.1D=B(id,1e){if(z.1R(id)){C(1e||z.1e).gv(id)}I{C id}}}(B(){A 5T=L;z.mw=B(E){E=z.1D(E);1u{if(!5T){5T=1q.a9("mv")}5T.4c(E.1L?E.1L.fs(E):E);5T.9L=""}1y(e){}};z.mu=B(E,7F){1u{E=z.1D(E);7F=z.1D(7F);1s(E){if(E===7F){C K}E=E.1L}}1y(e){}C U};z.mt=B(E,5S){E=z.1D(E);if(z.gu){E.1c.ms=(5S)?"dg":"7C"}I{if(z.6B){E.1c.mr=(5S)?"8K":"7C"}I{if(z.1l){E.gs=(5S)?"":"on";z.1r("*",E).1n(B(gt){gt.gs=(5S)?"":"on"})}}}};A 5R=B(E,4h){4h.1L.mq(E,4h);C K};A aZ=B(E,4h){A pn=4h.1L;if(4h==pn.fm){pn.4c(E)}I{C 5R(E,4h.71)}C K};z.5E=B(E,2a,3H){if((!E)||(!2a)||(V 3H=="1k")){C U}E=z.1D(E);2a=z.1D(2a);if(V 3H=="4J"){A cn=2a.3W;if(((3H==0)&&(cn.G==0))||(cn.G==3H)){2a.4c(E);C K}if(3H==0){C 5R(E,2a.5A)}C aZ(E,cn[3H-1])}4w(3H.1M()){2X"mo":C 5R(E,2a);2X"a8":C aZ(E,2a);2X"9M":if(2a.5A){C 5R(E,2a.5A)}I{2a.4c(E);C K}3f;aY:2a.4c(E);C K}};z.aP="5g-3G";if(z.1l){A aV=1q.aX;z.aP=(aV=="aW")||(aV=="gr")||(z.1l<6)?"g5-3G":"5g-3G"}A 1E,dv=1q.mn;if(z.3o){1E=B(E){A s=dv.3F(E,L);if(!s&&E.1c){E.1c.gq="";s=dv.3F(E,L)}C s||{}}}I{if(z.1l){1E=B(E){C E.gn}}I{1E=B(E){C dv.3F(E,L)}}}z.3F=1E;if(!z.1l){z.4g=B(mm,gp){C 2k(gp)||0}}I{z.4g=B(go,2N){if(!2N){C 0}if(2N=="ml"){C 4}if(2N.2w&&(2N.2w(-2)=="px")){C 2k(2N)}4G(go){A gm=1c.2g;A gl=aU.2g;aU.2g=gn.2g;1u{1c.2g=2N;2N=1c.mk}1y(e){2N=0}1c.2g=gm;aU.2g=gl}C 2N}}z.ge=(z.1l?B(E){1u{C(E.mj.mi.2W/6D)}1y(e){C 1}}:B(E){C z.3F(E).2W});z.gf=(z.1l?B(E,7D){if(7D==1){E.1c.7E=E.1c.7E.2f(/gk:[^;]*;/i,"");if(E.gj.1M()=="gi"){z.1r("> gh",E).1n(B(i){i.1c.7E=i.1c.7E.2f(/gk:[^;]*;/i,"")})}}I{A o="mh(mg="+(7D*6D)+")";E.1c.3T=o}if(E.gj.1M()=="gi"){z.1r("> gh",E).1n(B(i){i.1c.3T=o})}C 7D}:B(E,gg){C E.1c.2W=gg});A 5Q={3n:K,58:K,2g:K,5J:K};A gd=B(E,Z,5P){Z=Z.1M();if(5Q[Z]===K){C z.4g(E,5P)}I{if(5Q[Z]===U){C 5P}I{if((Z.T("mf")>=0)||(Z.T("md")>=0)||(Z.T("3n")>=0)||(Z.T("58")>=0)||(Z.T("5q")>=0)||(Z.T("mc")>=0)||(Z.T("ma")>=0)){5Q[Z]=K;C z.4g(E,5P)}I{5Q[Z]=U;C 5P}}}};z.1c=B(E,5O,aT){A n=z.1D(E),F=P.G,op=(5O=="2W");if(F==3){C op?z.gf(n,aT):n.1c[5O]=aT}if(F==2&&op){C z.ge(n)}A s=z.3F(n);C(F==1)?s:gd(n,5O,s[5O])};z.7A=B(n,gc){A s=gc||1E(n),px=z.4g,l=px(n,s.m9),t=px(n,s.m8);C{l:l,t:t,w:l+px(n,s.m7),h:t+px(n,s.m6)}};z.5N=B(n,gb){A ne="7C",px=z.4g,s=gb||1E(n),bl=(s.m5!=ne?px(n,s.m4):0),bt=(s.m3!=ne?px(n,s.m2):0);C{l:bl,t:bt,w:bl+(s.m1!=ne?px(n,s.m0):0),h:bt+(s.lZ!=ne?px(n,s.lY):0)}};z.aN=B(n,ga){A s=ga||1E(n),p=z.7A(n,s),b=z.5N(n,s);C{l:p.l+b.l,t:p.t+b.t,w:p.w+b.w,h:p.h+b.h}};z.aM=B(n,g9){A s=g9||1E(n),px=z.4g,l=px(n,s.lX),t=px(n,s.lW),r=px(n,s.lV),b=px(n,s.lU);if(z.3o&&(s.ax!="fU")){r=l}C{l:l,t:t,w:l+r,h:t+b}};z.au=B(E,g8){A s=g8||1E(E),me=z.aM(E,s);A l=E.fT-me.l,t=E.fS-me.t;if(z.7B){A aS=2k(s.2g),aR=2k(s.5J);if(!2L(aS)&&!2L(aR)){l=aS,t=aR}I{A p=E.1L;if(p&&p.1c){A aQ=1E(p);if(aQ.lT!="lS"){A be=z.5N(p,aQ);l+=be.l,t+=be.t}}}}I{if(z.2M){A p=E.1L;if(p){A be=z.5N(p);l-=be.l,t-=be.t}}}C{l:l,t:t,w:E.6v+me.w,h:E.8D+me.h}};z.aK=B(E,g7){A s=g7||1E(E),pe=z.7A(E,s),be=z.5N(E,s),w=E.aF,h;if(!w){w=E.6v,h=E.8D}I{h=E.lR,be.w=be.h=0}if(z.2M){pe.l+=be.l;pe.t+=be.t}C{l:pe.l,t:pe.t,w:w-pe.w-be.w,h:h-pe.h-be.h}};z.lQ=B(E,g6){A s=g6||1E(E),pe=z.7A(E,s),cb=z.aK(E,s);C{l:cb.l-pe.l,t:cb.t-pe.t,w:cb.w+pe.w,h:cb.h+pe.h}};z.aL=B(E,l,t,w,h,u){u=u||"px";4G(E.1c){if(!2L(l)){2g=l+u}if(!2L(t)){5J=t+u}if(w>=0){3n=w+u}if(h>=0){58=h+u}}};z.aO=B(E){A n=E.5w;C(z.aP=="g5-3G")||(n=="lP")||(n=="lO")};z.fX=B(E,7z,7y,g4){A bb=z.aO(E);if(bb){A pb=z.aN(E,g4);if(7z>=0){7z+=pb.w}if(7y>=0){7y+=pb.h}}z.aL(E,g3,g3,7z,7y)};z.fY=B(E,g1,g0,5M,5L,g2){A s=g2||z.3F(E);A bb=z.aO(E),pb=bb?fZ:z.aN(E,s),mb=z.aM(E,s);if(5M>=0){5M=2Y.5q(5M-pb.w-mb.w,0)}if(5L>=0){5L=2Y.5q(5L-pb.h-mb.h,0)}z.aL(E,g1,g0,5M,5L)};A fZ={l:0,t:0,w:0,h:0};z.lN=B(E,3G){A n=z.1D(E),s=1E(n),b=3G;C!b?z.au(n,s):z.fY(n,b.l,b.t,b.w,b.h,s)};z.lM=B(E,3G){A n=z.1D(E),s=1E(n),b=3G;C!b?z.aK(n,s):z.fX(n,b.w,b.h,s)};A 5H=B(E,1a){if(!(E=(E||0).1L)){C 0}A 1U,aJ=0,2h=z.3E();1s(E&&E.1c){if(1E(E).ax=="lL"){C 0}1U=E[1a];if(1U){aJ+=1U-0;if(E==2h){3f}}E=E.1L}C aJ};z.fQ=B(){A 2h=z.3E();A 3g=z.1W;A de=z.1e.5K;C{y:(3g.lK||de.5G||2h.5G||0),x:(3g.lJ||z.aH(de.5I)||2h.5I||0)}};z.aG=B(){C V z.aI=="1k"?(z.aI=z.3F(z.3E()).lI=="lH"):z.aI};z.aB=B(){A de=z.1e.5K;if(z.1l>=7){C{x:de.aC().2g,y:de.aC().5J}}I{C{x:z.aG()||26.am==26?de.fW:de.6v-de.aF-de.fW,y:de.lG}}};z.aH=B(aE){if(z.1l&&!z.aG()){A de=z.1e.5K;C aE+de.aF-de.lF}C aE};z.fP=B(E,aw){A ay=E.aD;A J={x:0,y:0};A 7w=U;A db=z.3E();if(z.1l){A aA=E.aC();A az=z.aB();J.x=aA.2g-az.x;J.y=aA.5J-az.y}I{if(ay["fV"]){A bo=ay.fV(E);J.x=bo.x-5H(E,"5I");J.y=bo.y-5H(E,"5G")}I{if(E["fR"]){7w=K;A 7x;if(z.3o&&(1E(E).ax=="fU")&&(E.1L==db)){7x=db}I{7x=db.1L}if(E.1L!=db){A nd=E;if(z.2M){nd=db}J.x-=5H(nd,"5I");J.y-=5H(nd,"5G")}A 4f=E;do{A n=4f["fT"];if(!z.2M||n>0){J.x+=2L(n)?0:n}A m=4f["fS"];J.y+=2L(m)?0:m;4f=4f.fR}1s((4f!=7x)&&4f)}I{if(E["x"]&&E["y"]){J.x+=2L(E.x)?0:E.x;J.y+=2L(E.y)?0:E.y}}}}if(7w||aw){A av=z.fQ();A m=7w?(!aw?-1:0):1;J.y+=m*av.y;J.x+=m*av.x}C J};z.af=B(E,fO){A n=z.1D(E),s=1E(n),mb=z.au(n,s);A at=z.fP(n,fO);mb.x=at.x;mb.y=at.y;C mb}})();z.fL=B(E,fN){C((" "+E.3A+" ").T(" "+fN+" ")>=0)};z.7s=B(E,ar){A 7v=E.3A;if((" "+7v+" ").T(" "+ar+" ")<0){E.3A=7v+(7v?" ":"")+ar}};z.7r=B(E,fM){A t=z.7g((" "+E.3A+" ").2f(" "+fM+" "," "));if(E.3A!=t){E.3A=t}};z.lE=B(E,aq,7u){if(V 7u=="1k"){7u=!z.fL(E,aq)}z[7u?"7s":"7r"](E,aq)}}if(!z.1h["z.X.1H"]){z.1h["z.X.1H"]=K;z.1Q("z.X.1H");(B(){A d=z;z.1H=B(){A F=P;if((F.G==1)&&(V F[0]=="4J")){D.G=eK(F[0])}I{if(F.G){d.1n(F,B(i){D.Y(i)},D)}}};z.1H.1C=S 4e;if(d.1l){A fK=B(al){C("A a2 = am."+al+"; "+"A ap = 4e.1C; "+"A ao = a2.1C; "+"R(A x in ao){ ap[x] = ao[x]; } "+"am."+al+" = 4e; ")};A fI=fK("z.1H");A aj=26.lD();aj.1q.fJ("<ak>"+fI+"</ak>");aj.lC(1,1,1,1)}z.4M(z.1H,{T:B(fH,fG){C d.T(D,fH,fG)},31:B(lB,lA){A aa=d.4d(P);aa.ae(D);C d.31.14(d,aa)},ah:B(fF,fE){C d.ah(D,fF,fE)},ag:B(fD,fC){C d.ag(D,fD,fC)},1n:B(fB,fA){d.1n(D,fB,fA);C D},23:B(7t,M){C d.23(D,7t,M,d.1H)},af:B(){C d.23(D,d.af)},1c:B(lz,ly){A aa=d.4d(P);aa.ae(D[0]);A s=d.1c.14(d,aa);C(P.G>1)?D:s},lx:B(lw,lv){A aa=d.4d(P);aa.ae(L);A s=D.23(B(i){aa[0]=i;C d.1c.14(d,aa)});C(P.G>1)?D:s},7s:B(fz){C D.1n(B(i){z.7s(i,fz)})},7r:B(fy){C D.1n(B(i){z.7r(i,fy)})},5E:B(fw,7q){A 1m=d.1r(fw)[0];7q=7q||"72";R(A x=0;x<D.G;x++){d.5E(D[x],1m,7q)}C D},2c:B(fv,fu,ft){D.1n(B(1m){d.2c(1m,fv,fu,ft)});C D},lu:B(ad){A ac=(ad)?d.9t(D,ad):D;ac.1n(B(1m){if(1m["1L"]){1m.1L.fs(1m)}});C ac},lt:B(fr,fq){A 1m=D[0];C d.1r(fr).1n(B(ai){d.5E(ai,1m,(fq||"72"))})},1r:B(7p){7p=7p||"";A J=S d.1H();D.1n(B(1m){d.1r(7p,1m).1n(B(ab){if(V ab!="1k"){J.Y(ab)}})});C J},3T:B(fo){A 5F=D;A 1V=P;A r=S d.1H();A rp=B(t){if(V t!="1k"){r.Y(t)}};if(d.1R(fo)){5F=d.9t(D,1V[0]);if(1V.G==1){C 5F}d.1n(d.3T(5F,1V[1],1V[2]),rp);C r}d.1n(d.3T(5F,1V[0],1V[1]),rp);C r},lr:B(7o,7n){A 1S=d.1e.a9("lq");if(d.1R(7o)){1S.9L=7o}I{1S.4c(7o)}A ct=((7n=="9M")||(7n=="a8"))?"fm":"5A";D.1n(B(1m){A 24=1S.a7(K);1s(24[ct]){d.5E(24[ct],1m,7n)}});C D},7m:B(fl,F){A a5=[];F=F||{};D.1n(B(1m){A a6={E:1m};d.1x(a6,F);a5.Y(d[fl](a6))});C d.fx.lp(a5)},8I:B(F){C D.7m("8I",F)},8H:B(F){C D.7m("8H",F)},6y:B(F){C D.7m("6y",F)}});z.1n(["fk","lo","fj","fi","ln","lm","ll","fi","lk","lj","4b"],B(H){A a4="on"+H;z.1H.1C[a4]=B(a,b){C D.2c(a4,a,b)}})})()}if(!z.1h["z.X.1r"]){z.1h["z.X.1r"]=K;z.1Q("z.X.1r");(B(){A d=z;A 2I=B(q){C[q.T("#"),q.T("."),q.T("["),q.T(":")]};A a0=B(a3,fh){A ql=a3.G;A i=2I(a3);A 1d=ql;R(A x=fh;x<i.G;x++){if(i[x]>=0){if(i[x]<1d){1d=i[x]}}}C(1d<0)?ql:1d};A 6X=B(7l){A i=2I(7l);if(i[0]!=-1){C 7l.21(i[0]+1,a0(7l,1))}I{C""}};A 5r=B(7k){A 5D;A i=2I(7k);if((i[0]==0)||(i[1]==0)){5D=0}I{5D=a0(7k,0)}C((5D>0)?7k.3b(0,5D).1M():"*")};A fg=B(Q){A J=-1;R(A x=0;x<Q.G;x++){A 1S=Q[x];if(1S>=0){if((1S>J)||(J==-1)){J=1S}}}C J};A 9H=B(7i){A i=2I(7i);if(-1==i[1]){C""}A di=i[1]+1;A 7j=fg(i.2w(2));if(di<7j){C 7i.21(di,7j)}I{if(-1==7j){C 7i.3b(di)}I{C""}}};A f3=[{1i:"|=",1f:B(15,fe){C"[5z(3U(\' \',@"+15+",\' \'), \' "+fe+"-\')]"}},{1i:"~=",1f:B(15,fd){C"[5z(3U(\' \',@"+15+",\' \'), \' "+fd+" \')]"}},{1i:"^=",1f:B(15,fb){C"[li-4G(@"+15+", \'"+fb+"\')]"}},{1i:"*=",1f:B(15,fa){C"[5z(@"+15+", \'"+fa+"\')]"}},{1i:"$=",1f:B(15,9Z){C"[21(@"+15+", 3c-G(@"+15+")-"+(9Z.G-1)+")=\'"+9Z+"\']"}},{1i:"!=",1f:B(15,f9){C"[3O(@"+15+"=\'"+f9+"\')]"}},{1i:"=",1f:B(15,f8){C"[@"+15+"=\'"+f8+"\']"}}];A 9C=B(9Y,3Z,f7,f6){A 49;A i=2I(3Z);if(i[2]>=0){A 4L=3Z.T("]",i[2]);A 29=3Z.21(i[2]+1,4L);1s(29&&29.G){if(29.2s(0)=="@"){29=29.2w(1)}49=L;R(A x=0;x<9Y.G;x++){A 1S=9Y[x];A 7h=29.T(1S.1i);if(7h>=0){A 15=29.21(0,7h);A 4a=29.21(7h+1S.1i.G);if((4a.2s(0)=="\\"")||(4a.2s(0)=="\'")){4a=4a.21(1,4a.G-1)}49=1S.1f(d.7g(15),d.7g(4a));3f}}if((!49)&&(29.G)){49=f7(29)}if(49){f6(49)}29=L;A 7f=3Z.T("[",4L);if(0<=7f){4L=3Z.T("]",7f);if(0<=4L){29=3Z.21(7f+1,4L)}}}}};A f0=B(f5){A 4K=".";A 7e=f5.1A(" ");1s(7e.G){A 2K=7e.3a();A 7d;if(2K==">"){7d="/";2K=7e.3a()}I{7d="//"}A f4=5r(2K);4K+=7d+f4;A id=6X(2K);if(id.G){4K+="[@id=\'"+id+"\'][1]"}A cn=9H(2K);if(cn.G){A 9X=" ";if(cn.2s(cn.G-1)=="*"){9X="";cn=cn.3b(0,cn.G-1)}4K+="[5z(3U(\' \',@9P,\' \'), \' "+cn+9X+"\')]"}9C(f3,2K,B(f2){C"[@"+f2+"]"},B(f1){4K+=f1})}C 4K};A 7a={};A eC=B(28){if(7a[28]){C 7a[28]}A 1e=d.1e;A 9W=f0(28);A 4H=B(9V){A J=[];A 7b;1u{7b=1e.9x(9W,9V,L,lh.lg,L)}1y(e){1z.1K("lf in le:",9W,"lc:",9V);1z.1K(e)}A 7c=7b.eZ();1s(7c){J.Y(7c);7c=7b.eZ()}C J};C 7a[28]=4H};A 5x={};A 9B={};A 3y=B(79,78){if(!79){C 78}if(!78){C 79}C B(){C 79.14(26,P)&&78.14(26,P)}};A 75=B(9U,3Y,5B,2J){A 2v=2J+1;A 76=(3Y.G==2v);A 2K=3Y[2J];if(2K==">"){A 77=9U.3W;if(!77.G){C}2v++;76=(3Y.G==2v);A 4H=6O(3Y[2J+1]);R(A x=0,11;x<77.G,11=77[x];x++){if(4H(11)){if(76){5B.Y(11)}I{75(11,3Y,5B,2v)}}}}A 5C=6U(2K)(9U);if(76){1s(5C.G){5B.Y(5C.3a())}}I{1s(5C.G){75(5C.3a(),3Y,5B,2v)}}};A eE=B(9T,eY){A J=[];A x=9T.G-1,11;1s(11=9T[x--]){75(11,eY,J,0)}C J};A 6O=B(3D){if(5x[3D]){C 5x[3D]}A ff=L;A 9S=5r(3D);if(9S!="*"){ff=3y(ff,B(N){C((N.2t==1)&&(9S==N.5w.1M()))})}A 9R=6X(3D);if(9R.G){ff=3y(ff,B(N){C((N.2t==1)&&(N.id==9R))})}if(2Y.5q.14(D,2I(3D).2w(1))>=0){ff=3y(ff,9z(3D))}C 5x[3D]=ff};A 5y=B(E){A pn=E.1L;A 9Q=pn.3W;A 2v=-1;A 3C=pn.5A;if(!3C){C 2v}A ci=E["eW"];A cl=pn["eX"];if(((V cl=="4J")&&(cl!=9Q.G))||(V ci!="4J")){pn["eX"]=9Q.G;A 2J=1;do{if(3C===E){2v=2J}if(3C.2t==1){3C["eW"]=2J;2J++}3C=3C.71}1s(3C)}I{2v=ci}C 2v};A lb=0;A 3X=B(N,15){A 74="";if(15=="9P"){C N.3A||74}if(15=="R"){C N.la||74}C N.5t(15,2)||74};A eH=[{1i:"|=",1f:B(15,9O){A eV=" "+9O+"-";C B(N){A ea=" "+(N.5t(15,2)||"");C((ea==9O)||(ea.T(eV)==0))}}},{1i:"^=",1f:B(15,eU){C B(N){C(3X(N,15).T(eU)==0)}}},{1i:"*=",1f:B(15,eT){C B(N){C(3X(N,15).T(eT)>=0)}}},{1i:"~=",1f:B(15,eS){A 9N=" "+eS+" ";C B(N){A ea=" "+3X(N,15)+" ";C(ea.T(9N)>=0)}}},{1i:"$=",1f:B(15,73){A 9N=" "+73;C B(N){A ea=" "+3X(N,15);C(ea.31(73)==(ea.G-73.G))}}},{1i:"!=",1f:B(15,eR){C B(N){C(3X(N,15)!=eR)}}},{1i:"=",1f:B(15,eQ){C B(N){C(3X(N,15)==eQ)}}}];A 9E=[{1i:"9M-9K",1f:B(1p,l9){C B(N){if(N.2t!=1){C U}A fc=N.eP;1s(fc&&(fc.2t!=1)){fc=fc.eP}C(!fc)}}},{1i:"72-9K",1f:B(1p,l8){C B(N){if(N.2t!=1){C U}A nc=N.71;1s(nc&&(nc.2t!=1)){nc=nc.71}C(!nc)}}},{1i:"l7",1f:B(1p,l6){C B(N){A cn=N.3W;A eO=N.3W.G;R(A x=eO-1;x>=0;x--){A nt=cn[x].2t;if((nt==1)||(nt==3)){C U}}C K}}},{1i:"5z",1f:B(1p,eN){C B(N){C(N.9L.T(eN)>=0)}}},{1i:"3O",1f:B(1p,eM){A eL=6O(eM);C B(N){C(!eL(N))}}},{1i:"l5-9K",1f:B(1p,2u){A pi=eK;if(2u=="l4"){C B(N){C(((5y(N))%2)==1)}}I{if((2u=="2n")||(2u=="l3")){C B(N){C((5y(N)%2)==0)}}I{if(2u.T("l2+")==0){A 70=pi(2u.3b(3));C B(N){C(N.1L.3W[70-1]===N)}}I{if((2u.T("n+")>0)&&(2u.G>3)){A 9J=2u.1A("n+",2);A eJ=pi(9J[0]);A 2J=pi(9J[1]);C B(N){C((5y(N)%eJ)==2J)}}I{if(2u.T("n")==-1){A 70=pi(2u);C B(N){C(5y(N)==70)}}}}}}}}];A 9z=B(3e){A 9I=(9B[3e]||5x[3e]);if(9I){C 9I}A ff=L;A i=2I(3e);if(i[0]>=0){A 24=5r(3e);if(24!="*"){ff=3y(ff,B(N){C(N.5w.1M()==24)})}}A 5u;A 3B=9H(3e);if(3B.G){A 9F=3B.2s(3B.G-1)=="*";if(9F){3B=3B.3b(0,3B.G-1)}A re=S 9G("(?:^|\\\\s)"+3B+(9F?".*":"")+"(?:\\\\s|$)");ff=3y(ff,B(N){C re.6Z(N.3A)})}if(i[3]>=0){A 3z=3e.3b(i[3]+1);A 9D="";A 5v=3z.T("(");A 6Y=3z.31(")");if((0<=5v)&&(0<=6Y)&&(6Y>5v)){9D=3z.21(5v+1,6Y);3z=3z.3b(0,5v)}5u=L;R(A x=0;x<9E.G;x++){A 1S=9E[x];if(1S.1i==3z){5u=1S.1f(3z,9D);3f}}if(5u){ff=3y(ff,5u)}}A eG=(d.1l)?B(5s){A eI=5s.1M();C B(N){C N[5s]||N[eI]}}:B(5s){C B(N){C(N&&N.5t&&N.l1(5s))}};9C(eH,3e,eG,B(eF){ff=3y(ff,eF)});if(!ff){ff=B(){C K}}C 9B[3e]=ff};A 6W={};A 6U=B(3d,1B){A 9A=6W[3d];if(9A){C 9A}A i=2I(3d);A id=6X(3d);if(i[0]==0){C 6W[3d]=B(1B){C[d.1D(id)]}}A 9y=9z(3d);A 5p;if(i[0]>=0){5p=B(1B){A 11=d.1D(id);if(9y(11)){C[11]}}}I{A 3V;A 24=5r(3d);if(2Y.5q.14(D,2I(3d))==-1){5p=B(1B){A J=[];A 11,x=0,3V=1B.4I(24);1s(11=3V[x++]){J.Y(11)}C J}}I{5p=B(1B){A J=[];A 11,x=0,3V=1B.4I(24);1s(11=3V[x++]){if(9y(11)){J.Y(11)}}C J}}}C 6W[3d]=5p};A l0={};A 5o={">":B(1B){A J=[];A 11,x=0,3V=1B.3W;1s(11=3V[x++]){if(11.2t==1){J.Y(11)}}C J}};A 9w=B(6V){if(0>6V.T(" ")){C 6U(6V)}A eD=B(1B){A 6S=6V.1A(" ");A 6T;if(6S[0]==">"){6T=[1B]}I{6T=6U(6S.3a())(1B)}C eE(6T,6S)};C eD};A 9v=((1q["9x"]&&!d.3o)?B(3x){A 6R=3x.1A(" ");if((1q["9x"])&&(3x.T(":")==-1)&&((K))){if(((6R.G>2)&&(3x.T(">")==-1))||(6R.G>3)||(3x.T("[")>=0)||((1==6R.G)&&(0<=3x.T(".")))){C eC(3x)}}C 9w(3x)}:9w);A ey=B(3w){if(5o[3w]){C 5o[3w]}if(0>3w.T(",")){C 5o[3w]=9v(3w)}I{A eB=3w.1A(/\\s*,\\s*/);A 4H=B(1B){A eA=0;A J=[];A 6Q;1s(6Q=eB[eA++]){J=J.3U(9v(6Q,6Q.T(" "))(1B))}C J};C 5o[3w]=4H}};A 5n=0;A ez=B(Q){A J=S d.1H();if(!Q){C J}if(Q[0]){J.Y(Q[0])}if(Q.G<2){C J}5n++;Q[0]["9u"]=5n;R(A x=1,11;11=Q[x];x++){if(Q[x]["9u"]!=5n){J.Y(11)}11["9u"]=5n}C J};d.1r=B(6P,1B){if(V 6P!="3c"){C S d.1H(6P)}if(V 1B=="3c"){1B=d.1D(1B)}C ez(ey(6P)(1B||d.1e))};d.9t=B(ex,9s){A 9r=S d.1H();A ff=(9s)?6O(9s):B(){C K};R(A x=0,11;11=ex[x];x++){if(ff(11)){9r.Y(11)}}C 9r}})()}if(!z.1h["z.X.1b"]){z.1h["z.X.1b"]=K;z.1Q("z.X.1b");z.6K=B(ew){A J={};A iq="kZ[Z!=9q][Z!=kY][Z!=et][Z!=kX][Z!=kW], kV, kU";z.1r(iq,ew).3T(B(E){C(!E.kT)}).1n(B(1m){A 3v=1m.1p;A Z=(1m.Z||"").1M();if((Z=="kS")||(Z=="kR")){if(1m.kQ){J[3v]=1m.1Z}}I{if(1m.kP){A ev=J[3v]=[];z.1r("kO[kN]",1m).1n(B(eu){ev.Y(eu.1Z)})}I{J[3v]=1m.1Z;if(Z=="et"){J[3v+".x"]=J[3v+".y"]=J[3v].x=J[3v].y=0}}}});C J};z.9h=B(23){A ec=kM;A J="";A es={};R(A x in 23){if(23[x]!=es[x]){if(z.2l(23[x])){R(A y=0;y<23[x].G;y++){J+=ec(x)+"="+ec(23[x][y])+"&"}}I{J+=ec(x)+"="+ec(23[x])+"&"}}}if((J.G)&&(J.2s(J.G-1)=="&")){J=J.3b(0,J.G-1)}C J};z.kL=B(er){C z.9h(z.6K(er))};z.kK=B(ep){C z.eq(z.6K(ep))};z.kJ=B(2H){A J={};A qp=2H.1A("&");A dc=kI;z.1n(qp,B(1m){if(1m.G){A 9p=1m.1A("=");A 1p=dc(9p.3a());A 1U=dc(9p.22("="));if(z.1R(J[1p])){J[1p]=[J[1p]]}if(z.2l(J[1p])){J[1p].Y(1U)}I{J[1p]=1U}}});C J};z.e1=U;z.e6={"9g":B(1b){C 1b.2G},"2e":B(1b){if(!1o.eo){1z.1K("kH kG kF a kE of 9g/2e-6M-9m"+" 4F kD kC kB kA 4G en kz"+" (ky 1o.eo=K 4F kx kw D kv)")}C z.5m(1b.2G)},"2e-6M-ku":B(1b){A 6N=1b.2G;A 9o=6N.T("/*");A 9n=6N.31("*/");if((9o==-1)||(9n==-1)){C z.5m(1b.2G)}C z.5m(6N.21(9o+2,9n))},"2e-6M-9m":B(1b){A 6L=1b.2G;A 9l=6L.T("/*");A 9k=6L.31("*/");if((9l==-1)||(9k==-1)){1z.1K("kt en ks\'t 6M 9m!");C""}C z.5m(6L.21(9l+2,9k))},"kr":B(1b){C z.3u(1b.2G)},"kq":B(1b){if(z.1l&&!1b.el){z.1n(["ko","em","kn","km"],B(i){1u{A 1e=S 9j(kl[i]+".kk");1e.kj=U;1e.ki(1b.2G);C 1e}1y(e){}})}I{C 1b.el}}};(B(){z.e5=B(F,ej,ei,eh){A 2F={};2F.F=F;A 6J=L;if(F.3R){A 3R=z.1D(F.3R);A 9i=3R.kh("kg");2F.2E=F.2E||(9i?9i.1Z:L);6J=z.6K(3R)}I{2F.2E=F.2E}A 5l=[{}];if(6J){5l.Y(6J)}if(F.5g){5l.Y(F.5g)}if(F.ek){5l.Y({"z.ek":S 5d().8O()})}2F.1r=z.9h(z.1x.14(L,5l));2F.9d=F.9d||"9g";A d=S z.30(ej);d.5k(ei,B(eg){C eh(eg,d)});A ld=F.4E;if(ld&&z.1Y(ld)){d.ef(B(ee){C ld.2d(F,ee,2F)})}A 1G=F.9f;if(1G&&z.1Y(1G)){d.ed(B(e9){C 1G.2d(F,e9,2F)})}A 6I=F.kf;if(6I&&z.1Y(6I)){d.9e(B(e8){C 6I.2d(F,e8,2F)})}d.1F=2F;C d};A e4=B(O){O.e0=K;A 1b=O.1F.1b;if(V 1b.e7=="B"){1b.e7()}};A e3=B(O){C z.e6[O.1F.9d](O.1F.1b)};A e2=B(9c,O){1z.1K(9c);C 9c};A 3Q=B(F){A O=z.e5(F,e4,e3,e2);O.1F.1b=z.9b(O.1F.F);C O};A 5j=L;A 3t=[];A 94=B(){A dZ=(S 5d()).dU();if(!z.e1){z.1n(3t,B(4D,6H){if(!4D){C}A O=4D.O;1u{if(!O||O.e0||!4D.dT(O)){3t.3S(6H,1);C}if(4D.dR(O)){3t.3S(6H,1);4D.dP(O)}I{if(O.9a){if(O.9a+(O.1F.F.6G||0)<dZ){3t.3S(6H,1);A 1G=S 1O("6G ke");1G.dY="6G";O.5i(1G);O.4C()}}}}1y(e){1z.1K(e);O.5i(S 1O("kc!"))}})}if(!3t.G){dX(5j);5j=L;C}};z.dV=B(){1u{z.1n(3t,B(i){i.O.4C()})}1y(e){}};if(z.1l){z.dW(z.dV)}z.dH=B(O,dS,dQ,dO){if(O.1F.F.6G){O.9a=(S 5d()).dU()}3t.Y({O:O,dT:dS,dR:dQ,dP:dO});if(!5j){5j=dN(94,50)}94()};A dJ="8Z/x-kb-3R-ka";A dG=B(O){C O.1F.1b.6F};A dF=B(O){C 4==O.1F.1b.6F};A dE=B(O){if(z.8Y(O.1F.1b)){O.dM(O)}I{O.5i(S 1O("k9 k8 k7 5h:"+O.1F.1b.3N))}};A 3P=B(Z,O){A 3s=O.1F;A F=3s.F;3s.1b.dL(Z,3s.2E,(F.k6!==K),(F.8X?F.8X:1k),(F.8W?F.8W:1k));if(F.6E){R(A 5f in F.6E){if(5f.1M()==="5g-Z"&&!F.8V){F.8V=F.6E[5f]}I{3s.1b.dK(5f,F.6E[5f])}}}3s.1b.dK("k5-k4",(F.8V||dJ));1u{3s.1b.dI(3s.1r)}1y(e){O.4C()}z.dH(O,dG,dF,dE);C O};z.8T=B(4B){if(4B.1r.G){4B.2E+=(4B.2E.T("?")==-1?"?":"&")+4B.1r;4B.1r=L}};z.k3=B(F){A O=3Q(F);z.8T(O.1F);C 3P("dD",O)};z.k2=B(F){C 3P("dC",3Q(F))};z.k1=B(F){A O=3Q(F);O.1F.1r=F.k0;C 3P("dC",O)};z.jZ=B(F){C 3P("dA",3Q(F))};z.jY=B(F){A O=3Q(F);A dB=O.1F;if(F["8U"]){dB.1r=F.8U;F.8U=L}C 3P("dA",O)};z.jX=B(F){A O=3Q(F);z.8T(O.1F);C 3P("8S",O)};z.dz=B(jW){2m S 1O("z.dz 3O jV jU")}})()}if(!z.1h["z.X.fx"]){z.1h["z.X.fx"]=K;z.1Q("z.X.fx");z.dx=B(dy,1d){D.1w=dy;D.1d=1d;D.4x=B(n){C((D.1d-D.1w)*n)+D.1w}};z.2r("z.d6",L,{1P:B(F){z.1x(D,F);if(z.2l(D.2C)){D.2C=S z.dx(D.2C[0],D.2C[1])}},2C:L,8Q:jT,5a:L,4z:0,dj:10,du:L,6x:L,dt:L,8B:L,dh:L,ds:L,dr:L,dm:L,2D:U,2Z:U,4A:L,8N:L,3r:L,2o:0,4y:0,3q:B(H,F){if(D[H]){D[H].14(D,F||[])}C D},5b:B(dw,8R){if(8R){5e(D.3r);D.2D=D.2Z=U;D.2o=0}I{if(D.2D&&!D.2Z){C D}}D.3q("6x");A d=dw||D.du;if(d>0){5c(z.2p(D,B(){D.5b(L,8R)}),d);C D}D.4A=S 5d().8O();if(D.2Z){D.4A-=D.8Q*D.2o}D.8N=D.4A+D.8Q;D.2D=K;D.2Z=U;A 8P=D.2C.4x(D.2o);if(!D.2o){if(!D.4y){D.4y=D.4z}D.3q("dt",[8P])}D.3q("ds",[8P]);D.8M();C D},jS:B(){5e(D.3r);if(!D.2D){C D}D.2Z=K;D.3q("dr",[D.2C.4x(D.2o)]);C D},jR:B(dq,dp){5e(D.3r);D.2D=D.2Z=K;D.2o=dq*6D;if(dp){D.5b()}C D},jQ:B(dn){if(!D.3r){C}5e(D.3r);if(dn){D.2o=1}D.3q("dm",[D.2C.4x(D.2o)]);D.2D=D.2Z=U;C D},3N:B(){if(D.2D){C D.2Z?"3M":"jP"}C"jO"},8M:B(){5e(D.3r);if(D.2D){A dl=S 5d().8O();A 2q=(dl-D.4A)/(D.8N-D.4A);if(2q>=1){2q=1}D.2o=2q;if(D.5a){2q=D.5a(2q)}D.3q("8B",[D.2C.4x(2q)]);if(2q<1){D.3r=5c(z.2p(D,"8M"),D.dj)}I{D.2D=U;if(D.4z>0){D.4z--;D.5b(L,K)}I{if(D.4z==-1){D.5b(L,K)}I{if(D.4y){D.4z=D.4y;D.4y=0}}}D.2o=0;D.3q("dh")}}C D}});(B(){A df=B(E){if(z.1l){A ns=E.1c;if(!ns.8L.G&&z.1c(E,"8L")=="dg"){ns.8L="1"}if(!ns.3n.G&&z.1c(E,"3n")=="8K"){ns.3n="8K"}}};z.6C=B(F){if(V F.1d=="1k"){2m S 1O("z.6C jN an 1d 1Z")}F.E=z.1D(F.E);A 3p=z.1x({6w:{}},F);A 8J=(3p.6w.2W={});8J.1w=(V 3p.1w=="1k")?B(){C 2V(z.1c(3p.E,"2W"))}:3p.1w;8J.1d=3p.1d;A 2U=z.6y(3p);z.2c(2U,"6x",L,B(){df(3p.E)});C 2U};z.8I=B(F){C z.6C(z.1x({1d:1},F))};z.8H=B(F){C z.6C(z.1x({1d:0},F))};if(z.6B&&!z.3o){z.8E=B(n){C 2k("0.5")+((2Y.da((n+2k("1.5"))*2Y.d9))/2)}}I{z.8E=B(n){C 0.5+((2Y.da((n+1.5)*2Y.d9))/2)}}A d4=B(6A){D.8G=6A;R(A p in 6A){A 1a=6A[p];if(1a.1w 1N z.1J){1a.d7=S z.1J()}}D.4x=B(r){A J={};R(A p in D.8G){A 1a=D.8G[p];A 6z=L;if(1a.1w 1N z.1J){6z=z.d8(1a.1w,1a.1d,r,1a.d7).8F()}I{if(!z.2l(1a.1w)){6z=((1a.1d-1a.1w)*r)+1a.1w+(p!="2W"?1a.jM||"px":"")}}J[p]=6z}C J}};z.6y=B(F){F.E=z.1D(F.E);if(!F.5a){F.5a=z.8E}A 2U=S z.d6(F);z.2c(2U,"6x",2U,B(){A pm={};R(A p in D.6w){A 1a=pm[p]=z.1x({},D.6w[p]);if(z.1Y(1a.1w)){1a.1w=1a.1w()}if(z.1Y(1a.1d)){1a.1d=1a.1d()}A d5=(p.1M().T("jL")>=0);B 8C(E,p){4w(p){2X"58":C E.8D;2X"3n":C E.6v}A v=z.1c(E,p);C(p=="2W")?2V(v):2k(v)};if(V 1a.1d=="1k"){1a.1d=8C(D.E,p)}I{if(V 1a.1w=="1k"){1a.1w=8C(D.E,p)}}if(d5){1a.1w=S z.1J(1a.1w);1a.1d=S z.1J(1a.1d)}I{1a.1w=(p=="2W")?2V(1a.1w):2k(1a.1w)}}D.2C=S d4(pm)});z.2c(2U,"8B",2U,B(8A){R(A s in 8A){z.1c(D.E,s,8A[s])}});C 2U}})()}',62,1711,'|||||||||||||||||||||||||||||||||||dojo|var|function|return|this|node|args|length|evt|else|ret|true|null|obj|elem|dfd|arguments|arr|for|new|indexOf|false|typeof||_base|push|type||te|||apply|attr|||||prop|xhr|style|end|doc|match|uri|_hasResource|key|del|undefined|isIE|item|forEach|djConfig|name|document|query|while|_66|try|res|start|mixin|catch|console|split|root|prototype|byId|gcs|ioArgs|err|NodeList|_p|Color|debug|parentNode|toLowerCase|instanceof|Error|constructor|provide|isString|ta|255|val|_a|global|_69|isFunction|value||substring|join|map|tn||window||path|_343|_220|_listeners|connect|call|json|replace|left|_b|toString|128|parseFloat|isArray|throw||_percent|hitch|step|declare|charAt|nodeType|_3c3|nidx|slice|faux|fired|_c4|_7e|loc|curve|_active|url|_44c|responseText|str|_312|idx|tqp|isNaN|isOpera|_22d|callee|add|_18b|_f8|_e2|_41|anim|Number|opacity|case|Math|_paused|Deferred|lastIndexOf|||||||||shift|substr|string|_3e7|_3ce|break|_w|charCode|_listener|_d5|_c5|authority|_49|width|isSafari|_49e|fire|_timer|_47b|_465|eval|_in|_40c|_409|_362|_3d9|className|_3d5|_386|_37a|body|getComputedStyle|box|_221|keyCode|remove|_8d|_46|paused|status|not|_478|_461|form|splice|filter|concat|tret|childNodes|_38b|_367|_33d||||||||||_340|_348|keypress|appendChild|_toArray|Array|_2b0|_toPixelValue|ref|_fixEvent|_19f|_14c|_14a|_150|_141|declaredClass|_d4|_99|_Url|_83|scheme|_67|_3d|switch|getValue|_startRepeatCount|repeat|_startTime|_47e|cancel|tif|load|to|with|tf|getElementsByTagName|number|_34c|_342|extend|_1e3|_normalizeEventName|_14b|_14e|results|self|cbfn|_f9|_d8|_b2|src|_88|dav||baseUrl|fragment|_loadedModules|_44|_43|_loaders|mll|height||easing|play|setTimeout|Date|clearTimeout|hdr|content|code|errback|_464|addCallbacks|_450|fromJson|_413|_3fc|_3ee|max|_31e|cond|getAttribute|_3d4|obi|tagName|_360|_381|contains|firstChild|_368|_372|_320|place|_2fa|scrollTop|_299|scrollLeft|top|documentElement|_288|_287|_getBorderExtents|_23f|_23d|_239|_218|_216|_211|eles|target|keys|shiftKey|ctrlKey|event|192|iel|_1db|delete|_1cf||addEventListener|String|_1af|_157|array|_14d|continue|_14f|_137|_11f|_106|_findMethod|has|_delegate|_dc|_d3|loaded|_9a|_loadInit|_inFlightCount|getObject|tv|_4f|_postLoad|_2d|offsetWidth|properties|beforeBegin|animateProperty|_4ad|_4a6|isKhtml|_fade|100|headers|readyState|timeout|_469|_457|_44d|formToObject|_441|comment|_43d|_36f|_419|tp|_40a|_406|_407|_373|_403|_3e6|_31b|cbi|test|_3c7|nextSibling|last|_3a1|_38e|_365|_36b|ecn|_364|_363|_356|_35e|_35f|_34f|_34d|_349|trim|tci|_328|_32b|_31f|_31c|_anim|_300|_2ff|_2f5|_2e7|removeClass|addClass|func|_2c4|cls|_2a9|_2ae|_280|_27f|_getPadExtents|isMoz|none|_233|cssText|_214|_fixCallback|_synthesizeEvent|stopPropagation|preventDefault|_setKeyChar|_1e1|ieh|_1d7|_1be|colorFromArray|sanitize|bits|rgb|_156|_fire|_resback|_13d|partial|_13a|silentlyCancelled|_topics|_127|_f1|_f0|superclass|_ec|_e3|mct|setObject|_bf|_b3|object|require|_92|_khtmlTimer|location|XMLHTTP|locale|dua|_71|_modulePrefixes|_55|_loadModule|_51|_50|_4e|pop|_3f|_callLoaded|_unloaders|_loadNotifying|_loadedUrls|_27|_24|_1d|_5|_4b7|onAnimate|getStyle|offsetHeight|_defaultEasing|toCss|_properties|fadeOut|fadeIn|_49f|auto|zoom|_cycle|_endTime|valueOf|_494|duration|_492|DELETE|_ioAddQueryToUrl|putData|contentType|password|user|_isDocumentOk|application|||||_466||||||startTime|_xhrObj|_45f|handleAs|addBoth|error|text|objectToQuery|_44f|ActiveXObject|_443|_442|filtered|_43f|_43e|_437|file|tnl|_41c|_filterQueryResult|_zipIdx|_408|_402|evaluate|_3ed|_380|fHit|_361|_33b|_3da|_3ab|_3d6|RegExp|_327|_3cf|_3c9|child|innerHTML|first|tval|_391|class|pnc|_37e|_37c|_375|_366|_35c|_35a|_353|_33c|_336|_314|||_315|_oe|_307|_309|cloneNode|after|createElement||_2f8|_2ef|_2ee|unshift|coords|some|every||_2cb|script|_2c9|parent||a2p||_2c3|_2bd||abs|_getMarginBox|_2b3|_2a6|position|_2a7|_2ac|_2ab|_getIeDocumentElementOffset|getBoundingClientRect|ownerDocument|_2a3|clientWidth|_isBodyLtr|_fixIeBiDiScrollLeft|_bodyLtr|_29d|_getContentBox|_setBox|_getMarginExtents|_getPadBorderExtents|_usesBorderBox|boxModel|pcs|st|sl|_240|runtimeStyle|_dcm|BackCompat|compatMode|default|_21b|_d|html|_event_listener|handlers|PAGE_DOWN|PAGE_UP|RIGHT_ARROW|LEFT_ARROW|DOWN_ARROW|UP_ARROW|_preventDefault||_stopPropagation|returnValue||_trySetKeyCode|cancelBubble|currentTarget|106|_1ee|111||_1e8|_1e7|||se|srcElement|onkeydown||_1d0|_disconnect|lid|_1c0|_connect|_set|_195|_185|_183|_17d|_everyOrSome|_16b|_172|_15b|Function|_154|_escapeString|_140|chain|_check|canceller|_12d|_124|_11a|_10d|_107|inherited|_fa|_f2|_findMixin|_constructor|preamble|_de|clone|tmp|_c7|TMP|_be|_ba|_mixin|isBrowser|lang|firebug||param|modulePaths|_a7|_fireCallback|_a0|setContext||_9c|unloaded||||_96|_93|navigator|_90|_89||protocol|_84|_86|_XMLHTTP_PROGIDS|gears|google|setAttribute|_80|_77|cfg|_6f|_getModuleSymbols|_5a|_58|_53|_4d|_4c|_45|_40|_moduleHasPrefix|_loadUri|_28|_26|_21|_22|tests|doh|_20|_1f|_1c|version|_1b|_19|_getProp|_11|_4|_4a5|_4b3|_Animation|tempColor|blendColors|PI|sin|||||_49a|normal|onEnd||rate||curr|onStop|_497||_496|pct|onPause|onPlay|onBegin|delay||_491|_Line|_48b|wrapForm|PUT|_487|POST|GET|_476|_474|_472|_ioWatch|send|_471|setRequestHeader|open|callback|setInterval|_470|resHandle|_46f|ioCheck|_46e|validCheck|getTime|_ioCancelAll|addOnUnload|clearInterval|dojoType|now|canceled|_blockAsync|_45e|_45c|_459|_ioSetArgs|_contentHandlers|abort|_458|_456||||addErrback|_454|addCallback|_452|_44b|_44a|_449|preventCache|responseXML|Microsoft|JSON|usePlainJson|_431|toJson|_430|_42d|image|opt|ria|_421|_41b|_40b|_zip|_410|_40d|_357|sqf|_374|_3e5|_3df|_38f|clc|pred|parseInt|ntf|_3bf|_3bc|cnl|previousSibling|_3a9|_3a6|_39c|_399|_396|_392|__cachedIndex|__cachedLength|_376|iterateNext|_34a|_355|_354|_32c|_350|_34b|_33f|_33e|_33a|_338|_334|_332||_330|_32e||_322|_316|mousemove|mouseout|mouseover|_305|lastChild||_2f9||_2f2|_2f1|removeChild|_2ec|_2eb|_2ea|_2e6||_2e4|_2e2|_2d6|_2d5|_2d4|_2d3|_2d2|_2d1|_2cd|_2cc|scs|write|_2c8|hasClass|_2c0|_2bb|_2b5|_abs|_docScroll|offsetParent|offsetTop|offsetLeft|absolute|getBoxObjectFor|clientLeft|_setContentSize|_setMarginBox|_28d|_286|_285|_289|NaN|_281|border|_272|_26b|_260|_258|_253|_24c|_246|_23a|_getOpacity|_setOpacity|_238|td|tr|nodeName|FILTER|_22f|_22e|currentStyle|_22c|_22b|display|QuirksMode|unselectable|_217|isMozilla|getElementById|attributes|all|_ie_listener|_getIeDispatcher|_1fd|NUM_LOCK|SCROLL_LOCK|INSERT|END|HOME|PAUSE|F12|F11|F10|F9|F8|F7|F6|F5|F4|F3|F2|F1|63232|SHIFT_TAB|TAB|keyIdentifier|_1f3|stopEvent|_punctMap|222|219|186|onkeypress|_stealthKeyDown|_fixKeys|relatedTarget|_1e0|_1df|_stealthKeydown|_1d6|_1d5|_1d1|_1ca|_1c9|_1cb|_1c2|_1c1|_1c3|_1c4|_1bc|_1b3|_1b2|colorFromHex|colorFromRgb|named|colorFromString|mask|rgba|_19c|_197|_192|setColor|_180|_178|_177|_175|_174|_16d|_166|_164|_163|_162|_15c|_15d|_15e|index|__json__|toJsonIndentStr|_nextId|_12f|_12b|publish|_128|_126|_125|_122|_121|_123|_11c|_11b|_10c|_10b|_108|getDispatcher|argument|nom|_construct|_core|_makeCtor|_df|_db|deprecated|isObject|_cc||scope||_hitchArgs|_c2||pre|_c1|native|isDebug||registerModulePath|_a8||finally|||_a6|_a5|_a4|_a3|_a2|_a1|_9f|_9e|_9d|_9b|_98|_97|onbeforeunload|ipt|scr|complete|_95|userAgent|_modulesLoaded|initialized|_initFired|_8c|_8a|_getText|_87|ieForceActiveXXhr|Msxml2|isGears|_81|_gearsObject|googlegears|GearsFactory|isFF|_7d|Safari|_72|_name|_6c|ire|ore|_68|i18n|_5b|requireIf|_56|_52|loading|_4a|_loadPath|_47|_48|_global_omit_module_check|_getModulePrefix|_3c|_3a|_37|_30|Boolean|_loadUriAndCheck|_2e||cacheBust|_1e|_1a|_17|_16|_15|_14|_f|_10|_e|_9|_8|revision|flag|patch|minor|major|_6|color|units|needs|stopped|playing|stop|gotoPercent|pause|1000|implemented|yet|_48a|xhrDelete|rawXhrPut|xhrPut|postData|rawXhrPost|xhrPost|xhrGet|Type|Content|sync|response|http|bad|urlencoded|www|_watchInFlightError||exceeded|handle|action|getAttributeNode|loadXML|async|XMLDOM|prefixes|MSXML3|MSXML|MSXML2||xml|javascript|wasn|your|optional|message|off|turn|use|endpoints|issues|security|potential|avoid|mimetype|using|consider|please|decodeURIComponent|queryToObject|formToJson|formToQuery|encodeURIComponent|selected|option|multiple|checked|checkbox|radio|disabled|textarea|select|button|reset|submit|input|_3fb|hasAttribute|0n|even|odd|nth|_3b5|empty|_3b1|_3ad|htmlFor|_38a|under||exprssion|failure|ANY_TYPE|XPathResult|starts|keyup|keydown|mouseup|mousedown|blur|click|combine|span|addContent||adopt|orphan|_2de|_2dd|styles|_2da|_2d9|_2cf|_2ce|show|createPopup|toggleClass|scrollWidth|clientTop|ltr|direction|pageXOffset|pageYOffset|fixed|contentBox|marginBox|BUTTON|TABLE|_getBorderBox|clientHeight|visible|overflow|marginBottom|marginRight|marginTop|marginLeft|borderBottomWidth|borderBottomStyle|borderRightWidth|borderRightStyle|borderTopWidth|borderTopStyle|borderLeftWidth|borderLeftStyle|paddingBottom|paddingRight|paddingTop|paddingLeft|offset||min|padding||margin|Opacity|Alpha|alpha|filters|pixelLeft|medium|_22a|defaultView|before||insertBefore|KhtmlUserSelect|MozUserSelect|setSelectable|isDescendant|div|_destroyElement|BackgroundImageCache|execCommand|PageDown|PageUp|Right|Left|Down|Up|63289|63249|63248|PRINT_SCREEN|63302|63277|63276|63275|63273|63272|63250|63247|63246|63245|63244|63243|63242|63241|63240|63239|63238|63237|63236|63235|63234|63233|Enter|_1f9|which|_1f6|bubbledKeyCode|221|220||||191|190|189|188|187|toElement|fromElement|clientY|pageY||clientX|pageX|offsetY|||layerY|offsetX|layerX|parentWindow|_nop|_allow_leaks|145|144|126|F15|125|F14|124|F13|123|122|121|120|119|118|117|116|115|114|113|112|NUMPAD_DIVIDE|110|NUMPAD_PERIOD|109|NUMPAD_MINUS|108|NUMPAD_ENTER|107|NUMPAD_PLUS|NUMPAD_MULTIPLY|105|NUMPAD_9|104|NUMPAD_8|103|NUMPAD_7|102|NUMPAD_6|101|NUMPAD_5|NUMPAD_4||NUMPAD_3|NUMPAD_2|NUMPAD_1|NUMPAD_0||SELECT|RIGHT_WINDOW||LEFT_WINDOW||HELP|SPACE|ESCAPE|CAPS_LOCK|ALT|CTRL|SHIFT|ENTER|CLEAR|BACKSPACE|attachEvent|fixEvent|fromCharCode|keyChar|_1b9|removeEventListener|0x|round|toHex|toRgba|toRgb|aqua|teal|blue|navy|yellow|olive|lime|green|fuchsia|purple|red|maroon|white|gray|silver|black|boolean|called|already|Cancelled|connectPublisher|unsubscribe|subscribe|disconnect|_113|_112||_111|_110|||found|was||must|_|module|||required|likely|It|declaration|Mixin|separate|instead|property|initializer||pass|_c9|_bb|_b7|nfunction|isAlien|isFinite|isArrayLike|_firebug|withDoc|withGlobal|_writeIncludes|VML|behavior|addRule|createStyleSheet|vml|com|microsoft|schemas|urn|namespaces|onunload|onreadystatechange|defer|khtml|WebKit|DOMContentLoaded|enableMozDomContentLoaded|domcontentloaded|Unable|base|chrome|1223|304|300|200|available|XMLHttpRequest|_println|language|userLanguage|isQuirks|factory|mimeTypes|Factory|Gears|_7f|MSIE||Firefox|Gecko|Konqueror||Opera|appVersion|xd|browser|moduleUrl|port|host|hostenv|_requireLocalization|_5f|_5e|_5d|_5c|requireLocalization|requireAfterIf|_57|common|platformRequire|defined|symbol|_isXDomain|tried|Could|__package__|packageFileName|_42|useXDomain|flight|still|files|addOnLoad|failed|sourceURL|util|notice|without|change|subject|APIs|EXPERIMENTAL|experimental|removed|will|DEPRECATED|exists|10315|Rev|Mobile|Spidermonkey|Rhino||Browser|delayMozLoadingFix|preventBackButtonFix|libraryScriptUri|baseRelativePath|baseScriptUri|allowQueryConfig|warn|trace|timeEnd||time|profileEnd|profile|log|info|groupEnd|group|dirxml|dir|count|assert'.split('|'),0,{});
+
+
+/*
+
+Prototype 1.5 rc0
+ - Adapted from Ruby on Rails - http://dev.rubyonrails.org/browser/spinoffs/prototype/src
+ - By Lunarmedia, 06 August, 2006
+ - Available at (and packed with) JavascriptCompressor.com
+
+Please note this version is missing the selector.js component of the full Prototype library.
+You can get the compressed version of selector at JavascriptCompressor.com
+
+
+*/
+
+var decompressedPrototype = function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[(function(e){return d[e]})];e=(function(){return'\\w+'});c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('d T={4l:\'1.5.8P\',3E:\'(?:<3G.*?>)((\\n|\\r|.)*?)(?:<\\/3G>)\',2v:7(){},K:7(x){c x}};d 1b={17:7(){c 7(){6.1I.2n(6,N)}}};d 1e=z q();q.u=7(5d,O){G(d 1G 2M O){5d[1G]=O[1G]}c 5d};q.1U=7(U){1j{f(U==1v)c\'1v\';f(U==1L)c\'1L\';c U.1U?U.1U():U.2C()}1s(e){f(e 8R 9l)c\'...\';25 e}};7j.v.1d=7(){d 43=6,23=$A(N),U=23.8S();c 7(){c 43.2n(U,23.3s($A(N)))}};7j.v.8U=7(U){d 43=6;c 7(C){c 43.8V(U,C||1W.C)}};q.u(8Q.v,{8W:7(){d 4Z=6.2C(16);f(6<16)c\'0\'+4Z;c 4Z},5j:7(){c 6+1},8Y:7(o){$R(0,6,11).V(o);c 6}});d 6s={6j:7(){d 48;G(d i=0;i<N.t;i++){d 6L=N[i];1j{48=6L();1y}1s(e){}}c 48}};d 6Q=1b.17();6Q.v={1I:7(1a,1J){6.1a=1a;6.1J=1J;6.41=Y;6.2A()},2A:7(){5Z(6.2D.1d(6),6.1J*4z)},2D:7(){f(!6.41){1j{6.41=11;6.1a()}8Z{6.41=Y}}}};q.u(4b.v,{2T:7(1A,1z){d L=\'\',O=6,I;1z=N.90.52(1z);1H(O.t>0){f(I=O.I(1A)){L+=O.47(0,I.w);L+=(1z(I)||\'\').2C();O=O.47(I.w+I[0].t)}1D{L+=O,O=\'\'}}c L},92:7(1A,1z,3i){1z=6.2T.52(1z);3i=3i===1v?1:3i;c 6.2T(1A,7(I){f(--3i<0)c I[0];c 1z(I)})},93:7(1A,o){6.2T(1A,o);c 6},94:7(t,2S){t=t||30;2S=2S===1v?\'...\':2S;c 6.t>t?6.47(0,t-2S.t)+2S:6},9F:7(){c 6.2y(/^\\s+/,\'\').2y(/\\s+$/,\'\')},71:7(){c 6.2y(/<\\/?[^>]+>/7Y,\'\')},2Q:7(){c 6.2y(z 3O(T.3E,\'5P\'),\'\')},70:7(){d 6Y=z 3O(T.3E,\'5P\');d 5p=z 3O(T.3E,\'98\');c(6.I(6Y)||[]).1C(7(5o){c(5o.I(5p)||[\'\',\'\'])[1]})},3q:7(){c 6.70().1C(7(3G){c 4q(3G)})},9E:7(){d 1q=J.4Y(\'1q\');d 1Y=J.9D(6);1q.75(1Y);c 1q.3h},9c:7(){d 1q=J.4Y(\'1q\');1q.3h=6.71();c 1q.2z[0]?1q.2z[0].6q:\'\'},78:7(){d 7i=6.I(/^\\??(.*)$/)[1].3j(\'&\');c 7i.36({},7(5b,72){d 1i=72.3j(\'=\');5b[1i[0]]=1i[1];c 5b})},1Z:7(){c 6.3j(\'\')},3P:7(){d 2l=6.3j(\'-\');f(2l.t==1)c 2l[0];d 54=6.5g(\'-\')==0?2l[0].7e(0).3Y()+2l[0].7g(1):2l[0];G(d i=1,73=2l.t;i<73;i++){d s=2l[i];54+=s.7e(0).3Y()+s.7g(1)}c 54},1U:7(){c"\'"+6.2y(/\\\\/g,\'\\\\\\\\\').2y(/\'/g,\'\\\\\\\'\')+"\'"}});4b.v.2T.52=7(1z){f(2i 1z==\'7\')c 1z;d 2U=z 3n(1z);c 7(I){c 2U.7a(I)}};4b.v.9h=4b.v.78;d 3n=1b.17();3n.79=/(^|.|\\r|\\n)(#\\{(.*?)\\})/;3n.v={1I:7(2U,1A){6.2U=2U.2C();6.1A=1A||3n.79},7a:7(U){c 6.2U.2T(6.1A,7(I){d 53=I[1];f(53==\'\\\\\')c I[2];c 53+(U[I[3]]||\'\').2C()})}};d $1y=z q();d $49=z q();d 1p={V:7(o){d w=0;1j{6.2m(7(h){1j{o(h,w++)}1s(e){f(e!=$49)25 e}})}1s(e){f(e!=$1y)25 e}},9n:7(o){d L=11;6.V(7(h,w){L=L&&!!(o||T.K)(h,w);f(!L)25 $1y});c L},9o:7(o){d L=11;6.V(7(h,w){f(L=!!(o||T.K)(h,w))25 $1y});c L},3e:7(o){d P=[];6.V(7(h,w){P.W(o(h,w))});c P},7n:7(o){d L;6.V(7(h,w){f(o(h,w)){L=h;25 $1y}});c L},7o:7(o){d P=[];6.V(7(h,w){f(o(h,w))P.W(h)});c P},9p:7(1A,o){d P=[];6.V(7(h,w){d 7c=h.2C();f(7c.I(1A))P.W((o||T.K)(h,w))});c P},1M:7(U){d 51=Y;6.V(7(h){f(h==U){51=11;25 $1y}});c 51},36:7(45,o){6.V(7(h,w){45=o(45,h,w)});c 45},9q:7(1F){d 23=$A(N).47(1);c 6.3e(7(h){c h[1F].2n(h,23)})},9s:7(o){d L;6.V(7(h,w){h=(o||T.K)(h,w);f(L==1v||h>=L)L=h});c L},9u:7(o){d L;6.V(7(h,w){h=(o||T.K)(h,w);f(L==1v||h<L)L=h});c L},9v:7(o){d 50=[],58=[];6.V(7(h,w){((o||T.K)(h,w)?50:58).W(h)});c[50,58]},3r:7(1G){d P=[];6.V(7(h,w){P.W(h[1G])});c P},9x:7(o){d P=[];6.V(7(h,w){f(!o(h,w))P.W(h)});c P},9y:7(o){c 6.3e(7(h,w){c{h:h,59:o(h,w)}}).9z(7(18,3U){d a=18.59,b=3U.59;c a<b?-1:a>b?1:0}).3r(\'h\')},1Z:7(){c 6.3e(T.K)},9B:7(){d o=T.K,23=$A(N);f(2i 23.5e()==\'7\')o=23.9C();d 7l=[6].3s(23).1C($A);c 6.1C(7(h,w){c o(7l.3r(w))})},1U:7(){c\'#<1p:\'+6.1Z().1U()+\'>\'}};q.u(1p,{1C:1p.3e,5v:1p.7n,1k:1p.7o,8M:1p.1M,7p:1p.1Z});d $A=1E.7q=7(2R){f(!2R)c[];f(2R.1Z){c 2R.1Z()}1D{d P=[];G(d i=0;i<2R.t;i++)P.W(2R[i]);c P}};q.u(1E.v,1p);f(!1E.v.4d)1E.v.4d=1E.v.4m;q.u(1E.v,{2m:7(o){G(d i=0;i<6.t;i++)o(6[i])},5i:7(){6.t=0;c 6},7r:7(){c 6[0]},5e:7(){c 6[6.t-1]},7s:7(){c 6.1k(7(h){c h!=1v||h!=1L})},6J:7(){c 6.36([],7(6H,h){c 6H.3s(h&&h.5D==1E?h.6J():[h])})},5s:7(){d 4N=$A(N);c 6.1k(7(h){c!4N.1M(h)})},5g:7(U){G(d i=0;i<6.t;i++)f(6[i]==U)c i;c-1},4m:7(5h){c(5h!==Y?6:6.1Z()).4d()},1U:7(){c\'[\'+6.1C(q.1U).1N(\', \')+\']\'}});d 4h={2m:7(o){G(d 1O 2M 6){d h=6[1O];f(2i h==\'7\')49;d 1i=[1O,h];1i.1O=1O;1i.h=h;o(1i)}},7t:7(){c 6.3r(\'1O\')},4N:7(){c 6.3r(\'h\')},7u:7(2N){c $H(2N).36($H(6),7(4Q,1i){4Q[1i.1O]=1i.h;c 4Q})},7w:7(){c 6.1C(7(1i){c 1i.1C(4n).1N(\'=\')}).1N(\'&\')},1U:7(){c\'#<4h:{\'+6.1C(7(1i){c 1i.1C(q.1U).1N(\': \')}).1N(\', \')+\'}>\'}};7 $H(U){d 2N=q.u({},U||{});q.u(2N,1p);q.u(2N,4h);c 2N};3L=1b.17();q.u(3L.v,1p);q.u(3L.v,{1I:7(22,2x,2H){6.22=22;6.2x=2x;6.2H=2H},2m:7(o){d h=6.22;2q{o(h);h=h.5j()}1H(6.1M(h))},1M:7(h){f(h<6.22)c Y;f(6.2H)c h<6.2x;c h<=6.2x}});d $R=7(22,2x,2H){c z 3L(22,2x,2H)};d M={4w:7(){c 6s.6j(7(){c z 5C()},7(){c z 5n(\'7y.6d\')},7(){c z 5n(\'7z.6d\')})||Y},4s:0};M.2W={3b:[],2m:7(o){6.3b.2m(o)},69:7(4F){f(!6.1M(4F))6.3b.W(4F)},7A:7(5t){6.3b=6.3b.5s(5t)},3y:7(1a,26,E,2Z){6.V(7(3o){f(3o[1a]&&2i 3o[1a]==\'7\'){1j{3o[1a].2n(3o,[26,E,2Z])}1s(e){}}})}};q.u(M.2W,1p);M.2W.69({5G:7(){M.4s++},1B:7(){M.4s--}});M.44=7(){};M.44.v={4a:7(m){6.m={1F:\'4j\',4p:11,5H:\'5E/x-86-Q-7C\',28:\'\'};q.u(6.m,m||{})},3l:7(){c 6.E.32==1v||6.E.32==0||(6.E.32>=84&&6.E.32<7E)},7G:7(){c!6.3l()}};M.3t=1b.17();M.3t.5L=[\'7H\',\'80\',\'7I\',\'7J\',\'4t\'];M.3t.v=q.u(z M.44(),{1I:7(1l,m){6.E=M.4w();6.4a(m);6.26(1l)},26:7(1l){d 28=6.m.28||\'\';f(28.t>0)28+=\'&7K=\';1j{6.1l=1l;f(6.m.1F==\'7L\'&&28.t>0)6.1l+=(6.1l.I(/\\?/)?\'&\':\'?\')+28;M.2W.3y(\'5G\',6,6.E);6.E.7N(6.m.1F,6.1l,6.m.4p);f(6.m.4p){6.E.5T=6.5J.1d(6);2Y((7(){6.4r(1)}).1d(6),10)}6.5A();d 1c=6.m.5V?6.m.5V:28;6.E.7O(6.m.1F==\'4j\'?1c:1L)}1s(e){6.3p(e)}},5A:7(){d 1P=[\'X-7P-7Q\',\'5C\',\'X-T-4l\',T.4l,\'7R\',\'1Y/7m, 1Y/2e, 5E/5F, 1Y/5F, */*\'];f(6.m.1F==\'4j\'){1P.W(\'5Q-2g\',6.m.5H);f(6.E.7S)1P.W(\'7T\',\'7U\')}f(6.m.1P)1P.W.2n(1P,6.m.1P);G(d i=0;i<1P.t;i+=2)6.E.7V(1P[i],1P[i+1])},5J:7(){d 2F=6.E.2F;f(2F!=1)6.4r(6.E.2F)},4A:7(B){1j{c 6.E.7W(B)}1s(e){}},5M:7(){1j{c 4q(\'(\'+6.4A(\'X-7X\')+\')\')}1s(e){}},5R:7(){1j{c 4q(6.E.3F)}1s(e){6.3p(e)}},4r:7(2F){d C=M.3t.5L[2F];d E=6.E,2Z=6.5M();f(C==\'4t\'){1j{(6.m[\'2I\'+6.E.32]||6.m[\'2I\'+(6.3l()?\'81\':\'82\')]||T.2v)(E,2Z)}1s(e){6.3p(e)}f((6.4A(\'5Q-2g\')||\'\').I(/^1Y\\/7m/i))6.5R()}1j{(6.m[\'2I\'+C]||T.2v)(E,2Z);M.2W.3y(\'2I\'+C,6,E,2Z)}1s(e){6.3p(e)}f(C==\'4t\')6.E.5T=T.2v},3p:7(57){(6.m.5W||T.2v)(6,57);M.2W.3y(\'5W\',6,57)}});M.4C=1b.17();q.u(q.u(M.4C.v,M.3t.v),{1I:7(1w,1l,m){6.4x={3m:1w.3m?$(1w.3m):$(1w),3z:1w.3z?$(1w.3z):(1w.3m?1L:$(1w))};6.E=M.4w();6.4a(m);d 1B=6.m.1B||T.2v;6.m.1B=(7(E,U){6.5Y();1B(E,U)}).1d(6);6.26(1l)},5Y:7(){d 3A=6.3l()?6.4x.3m:6.4x.3z;d 3k=6.E.3F;f(!6.m.3q)3k=3k.2Q();f(3A){f(6.m.60){z 6.m.60(3A,3k)}1D{k.6h(3A,3k)}}f(6.3l()){f(6.1B)2Y(6.1B.1d(6),10)}}});M.61=1b.17();M.61.v=q.u(z M.44(),{1I:7(1w,1l,m){6.4a(m);6.1B=6.m.1B;6.1J=(6.m.1J||2);6.2s=(6.m.2s||1);6.4B={};6.1w=1w;6.1l=1l;6.22()},22:7(){6.m.1B=6.63.1d(6);6.2D()},7b:7(){6.4B.1B=1v;89(6.65);(6.1B||T.2v).2n(6,N)},63:7(26){f(6.m.2s){6.2s=(26.3F==6.64?6.2s*6.m.2s:1);6.64=26.3F}6.65=2Y(6.2D.1d(6),6.2s*6.1J*4z)},2D:7(){6.4B=z M.4C(6.1w,6.1l,6.m)}});7 $(){d P=[],4;G(d i=0;i<N.t;i++){4=N[i];f(2i 4==\'8c\')4=J.8d(4);P.W(k.u(4))}c P.t<2?P[0]:P};J.8f=7(1f,6a){d 6b=($(6a)||J.1c).4D(\'*\');c $A(6b).36([],7(12,4E){f(4E.1f.I(z 3O("(^|\\\\s)"+1f+"(\\\\s|$)")))12.W(k.u(4E));c 12})};f(!1W.k)d k=z q();k.u=7(4){f(!4)c;f(4X)c 4;f(!4.6e&&4.1h&&4!=1W){d 2a=k.3d,2r=k.u.2r;G(d 1G 2M 2a){d h=2a[1G];f(2i h==\'7\')4[1G]=2r.4W(h)}}4.6e=11;c 4};k.u.2r={4W:7(h){c 6[h]=6[h]||7(){c h.2n(1L,[6].3s($A(N)))}}};k.3d={4U:7(4){c $(4).l.2B!=\'3Q\'},6N:7(){G(d i=0;i<N.t;i++){d 4=$(N[i]);k[k.4U(4)?\'6f\':\'6w\'](4)}},6f:7(){G(d i=0;i<N.t;i++){d 4=$(N[i]);4.l.2B=\'3Q\'}},6w:7(){G(d i=0;i<N.t;i++){d 4=$(N[i]);4.l.2B=\'\'}},42:7(4){4=$(4);4.1X.8h(4)},6h:7(4,2e){$(4).3h=2e.2Q();2Y(7(){2e.3q()},10)},2y:7(4,2e){4=$(4);f(4.6k){4.6k=2e.2Q()}1D{d 1K=4.6R.6S();1K.56(4);4.1X.8i(1K.6T(2e.2Q()),4)}2Y(7(){2e.3q()},10)},8k:7(4){4=$(4);c 4.2k},3K:7(4){c z k.3S(4)},8l:7(4,1f){f(!(4=$(4)))c;c k.3K(4).1M(1f)},8m:7(4,1f){f(!(4=$(4)))c;c k.3K(4).7k(1f)},8n:7(4,1f){f(!(4=$(4)))c;c k.3K(4).42(1f)},8p:7(4){4=$(4);G(d i=0;i<4.2z.t;i++){d 3M=4.2z[i];f(3M.8q==3&&!/\\S/.4v(3M.6q))k.42(3M)}},8r:7(4){c $(4).3h.I(/^\\s*$/)},8s:7(4,3I){4=$(4),3I=$(3I);1H(4=4.1X)f(4==3I)c 11;c Y},6t:7(4){4=$(4);d x=4.x?4.x:4.2f,y=4.y?4.y:4.29;1W.6t(x,y)},1R:7(4,l){4=$(4);d h=4.l[l.3P()];f(!h){f(J.4J&&J.4J.6v){d 4L=J.4J.6v(4,1L);h=4L?4L.8v(l):1L}1D f(4.6x){h=4.6x[l.3P()]}}f(1W.6E&&[\'18\',\'1n\',\'3U\',\'6G\'].1M(l))f(k.1R(4,\'14\')==\'4G\')h=\'6y\';c h==\'6y\'?1L:h},8x:7(4,l){4=$(4);G(d B 2M l)4.l[B.3P()]=l[B]},8y:7(4){4=$(4);f(k.1R(4,\'2B\')!=\'3Q\')c{21:4.2p,24:4.2k};d 20=4.l;d 6B=20.4O;d 6A=20.14;20.4O=\'31\';20.14=\'2o\';20.2B=\'\';d 6C=4.6m;d 6D=4.6p;20.2B=\'3Q\';20.14=6A;20.4O=6B;c{21:6C,24:6D}},8z:7(4){4=$(4);d 4R=k.1R(4,\'14\');f(4R==\'4G\'||!4R){4.4T=11;4.l.14=\'3T\';f(1W.6E){4.l.1n=0;4.l.18=0}}},8A:7(4){4=$(4);f(4.4T){4.4T=1v;4.l.14=4.l.1n=4.l.18=4.l.6G=4.l.3U=\'\'}},8B:7(4){4=$(4);f(4.3c)c;4.3c=4.l.3V;f((k.1R(4,\'3V\')||\'4U\')!=\'31\')4.l.3V=\'31\'},8D:7(4){4=$(4);f(4.3c)c;4.l.3V=4.3c;4.3c=1v}};q.u(k,k.3d);d 4X=Y;f(!3W&&/3x|3w|3u/.4v(33.62)){d 3W={}};k.6K=7(2a){q.u(k.3d,2a||{});f(2i 3W!=\'1v\'){d 2a=k.3d,2r=k.u.2r;G(d 1G 2M 2a){d h=2a[1G];f(2i h==\'7\')3W.v[1G]=2r.4W(h)}4X=11}};k.6K();d 6M=z q();6M.2B=k.6N;1e.1g=7(3f){6.3f=3f};1e.1g.v={1I:7(4,2t){6.4=$(4);6.2t=2t.2Q();f(6.3f&&6.4.6O){1j{6.4.6O(6.3f,6.2t)}1s(e){d 1h=6.4.1h.2w();f(1h==\'4V\'||1h==\'8N\'){6.2X(6.6U())}1D{25 e}}}1D{6.1K=6.4.6R.6S();f(6.2V)6.2V();6.2X([6.1K.6T(6.2t)])}2Y(7(){2t.3q()},10)},6U:7(){d 1q=J.4Y(\'1q\');1q.3h=\'<6V><4V>\'+6.2t+\'</4V></6V>\';c $A(1q.2z[0].2z[0].2z)}};d 1g=z q();1g.6W=1b.17();1g.6W.v=q.u(z 1e.1g(\'96\'),{2V:7(){6.1K.97(6.4)},2X:7(2h){2h.V((7(2j){6.4.1X.55(2j,6.4)}).1d(6))}});1g.5m=1b.17();1g.5m.v=q.u(z 1e.1g(\'99\'),{2V:7(){6.1K.56(6.4);6.1K.74(11)},2X:7(2h){2h.4m(Y).V((7(2j){6.4.55(2j,6.4.9a)}).1d(6))}});1g.7h=1b.17();1g.7h.v=q.u(z 1e.1g(\'9d\'),{2V:7(){6.1K.56(6.4);6.1K.74(6.4)},2X:7(2h){2h.V((7(2j){6.4.75(2j)}).1d(6))}});1g.76=1b.17();1g.76.v=q.u(z 1e.1g(\'9i\'),{2V:7(){6.1K.9m(6.4)},2X:7(2h){2h.V((7(2j){6.4.1X.55(2j,6.4.9t)}).1d(6))}});k.3S=1b.17();k.3S.v={1I:7(4){6.4=$(4)},2m:7(o){6.4.1f.3j(/\\s+/).1k(7(B){c B.t>0}).2m(o)},5c:7(1f){6.4.1f=1f},7k:7(5a){f(6.1M(5a))c;6.5c(6.1Z().3s(5a).1N(\' \'))},42:7(4c){f(!6.1M(4c))c;6.5c(6.1k(7(1f){c 1f!=4c}).1N(\' \'))},2C:7(){c 6.1Z().1N(\' \')}};q.u(k.3S.v,1p);d 5I={5i:7(){G(d i=0;i<N.t;i++)$(N[i]).h=\'\'},4f:7(4){$(4).4f()},7v:7(){G(d i=0;i<N.t;i++)f($(N[i]).h==\'\')c Y;c 11},1k:7(4){$(4).1k()},5y:7(4){4=$(4);4.4f();f(4.1k)4.1k()}};d D={3a:7(Q){d 12=D.2L($(Q));d 4I=z 1E();G(d i=0;i<12.t;i++){d 4g=D.k.3a(12[i]);f(4g)4I.W(4g)}c 4I.1N(\'&\')},2L:7(Q){Q=$(Q);d 12=z 1E();G(d 1h 2M D.k.2E){d 4H=Q.4D(1h);G(d j=0;j<4H.t;j++)12.W(4H[j])}c 12},7x:7(Q,3N,B){Q=$(Q);d 3H=Q.4D(\'2u\');f(!3N&&!B)c 3H;d 4y=z 1E();G(d i=0;i<3H.t;i++){d 2u=3H[i];f((3N&&2u.2g!=3N)||(B&&2u.B!=B))49;4y.W(2u)}c 4y},7B:7(Q){d 12=D.2L(Q);G(d i=0;i<12.t;i++){d 4=12[i];4.7D();4.4o=\'11\'}},7F:7(Q){d 12=D.2L(Q);G(d i=0;i<12.t;i++){d 4=12[i];4.4o=\'\'}},5z:7(Q){c D.2L(Q).5v(7(4){c 4.2g!=\'31\'&&!4.4o&&[\'2u\',\'1k\',\'3J\'].1M(4.1h.2w())})},7M:7(Q){5I.5y(D.5z(Q))},5w:7(Q){$(Q).5w()}};D.k={3a:7(4){4=$(4);d 1F=4.1h.2w();d 1S=D.k.2E[1F](4);f(1S){d 1O=4n(1S[0]);f(1O.t==0)c;f(1S[1].5D!=1E)1S[1]=[1S[1]];c 1S[1].1C(7(h){c 1O+\'=\'+4n(h)}).1N(\'&\')}},1x:7(4){4=$(4);d 1F=4.1h.2w();d 1S=D.k.2E[1F](4);f(1S)c 1S[1]}};D.k.2E={2u:7(4){6c(4.2g.2w()){1r\'7Z\':1r\'31\':1r\'6l\':1r\'1Y\':c D.k.2E.3J(4);1r\'6g\':1r\'6i\':c D.k.2E.5O(4)}c Y},5O:7(4){f(4.83)c[4.B,4.h]},3J:7(4){c[4.B,4.h]},1k:7(4){c D.k.2E[4.2g==\'1k-6n\'?\'5S\':\'5X\'](4)},5S:7(4){d h=\'\',2b,w=4.85;f(w>=0){2b=4.m[w];h=2b.h||2b.1Y}c[4.B,h]},5X:7(4){d h=[];G(d i=0;i<4.t;i++){d 2b=4.m[i];f(2b.87)h.W(2b.h||2b.1Y)}c[4.B,h]}};d $F=D.k.1x;1e.3D=7(){};1e.3D.v={1I:7(4,1J,1a){6.1J=1J;6.4=$(4);6.1a=1a;6.2K=6.1x();6.2A()},2A:7(){5Z(6.2D.1d(6),6.1J*4z)},2D:7(){d h=6.1x();f(6.2K!=h){6.1a(6.4,h);6.2K=h}}};D.k.3C=1b.17();D.k.3C.v=q.u(z 1e.3D(),{1x:7(){c D.k.1x(6.4)}});D.3C=1b.17();D.3C.v=q.u(z 1e.3D(),{1x:7(){c D.3a(6.4)}});1e.2c=7(){};1e.2c.v={1I:7(4,1a){6.4=$(4);6.1a=1a;6.2K=6.1x();f(6.4.1h.2w()==\'Q\')6.67();1D 6.2A(6.4)},4K:7(){d h=6.1x();f(6.2K!=h){6.1a(6.4,h);6.2K=h}},67:7(){d 12=D.2L(6.4);G(d i=0;i<12.t;i++)6.2A(12[i])},2A:7(4){f(4.2g){6c(4.2g.2w()){1r\'6g\':1r\'6i\':1o.3B(4,\'8j\',6.4K.1d(6));1y;1r\'6l\':1r\'1Y\':1r\'3J\':1r\'1k-6n\':1r\'1k-8t\':1o.3B(4,\'8u\',6.4K.1d(6));1y}}}};D.k.2c=1b.17();D.k.2c.v=q.u(z 1e.2c(),{1x:7(){c D.k.1x(6.4)}});D.2c=1b.17();D.2c.v=q.u(z 1e.2c(),{1x:7(){c D.3a(6.4)}});f(!1W.1o){d 1o=z q()}q.u(1o,{8C:8,8F:9,8H:13,8I:27,8J:37,8L:38,8O:39,8T:40,8X:46,4:7(C){c C.Z||C.91},95:7(C){c(((C.6X)&&(C.6X==1))||((C.6Z)&&(C.6Z==1)))},9b:7(C){c C.9e||(C.9f+(J.3R.2G||J.1c.2G))},9g:7(C){c C.9j||(C.9k+(J.3R.2O||J.1c.2O))},7b:7(C){f(C.7d){C.7d();C.9r()}1D{C.48=Y;C.9w=11}},9A:7(C,1h){d 4=1o.4(C);1H(4.1X&&(!4.1h||(4.1h.3Y()!=1h.3Y())))4=4.1X;c 4},1T:Y,5u:7(4,B,1V,1u){f(!6.1T)6.1T=[];f(4.5f){6.1T.W([4,B,1V,1u]);4.5f(B,1V,1u)}1D f(4.4i){6.1T.W([4,B,1V,1u]);4.4i(\'2I\'+B,1V)}},66:7(){f(!1o.1T)c;G(d i=0;i<1o.1T.t;i++){1o.5N.2n(6,1o.1T[i]);1o.1T[i][0]=1L}1o.1T=Y},3B:7(4,B,1V,1u){d 4=$(4);1u=1u||Y;f(B==\'5U\'&&(33.4u.I(/3x|3w|3u/)||4.4i))B=\'5K\';6.5u(4,B,1V,1u)},5N:7(4,B,1V,1u){d 4=$(4);1u=1u||Y;f(B==\'5U\'&&(33.4u.I(/3x|3w|3u/)||4.4k))B=\'5K\';f(4.5x){4.5x(B,1V,1u)}1D f(4.4k){1j{4.4k(\'2I\'+B,1V)}1s(e){}}}});f(33.4u.I(/\\88\\b/))1o.3B(1W,\'8a\',1o.66,Y);d 2d={6o:Y,4P:7(){6.6z=1W.8e||J.3R.2G||J.1c.2G||0;6.6F=1W.8g||J.3R.2O||J.1c.2O||0},6u:7(4){d 19=0,15=0;2q{19+=4.2O||0;15+=4.2G||0;4=4.1X}1H(4);c[15,19]},35:7(4){d 19=0,15=0;2q{19+=4.29||0;15+=4.2f||0;4=4.1Q}1H(4);c[15,19]},68:7(4){d 19=0,15=0;2q{19+=4.29||0;15+=4.2f||0;4=4.1Q;f(4){p=k.1R(4,\'14\');f(p==\'3T\'||p==\'2o\')1y}}1H(4);c[15,19]},1Q:7(4){f(4.1Q)c 4.1Q;f(4==J.1c)c 4;1H((4=4.1X)&&4!=J.1c)f(k.1R(4,\'14\')!=\'4G\')c 4;c J.1c},8o:7(4,x,y){f(6.6o)c 6.6r(4,x,y);6.3g=x;6.34=y;6.1t=6.35(4);c(y>=6.1t[1]&&y<6.1t[1]+4.2k&&x>=6.1t[0]&&x<6.1t[0]+4.2p)},6r:7(4,x,y){d 4S=6.6u(4);6.3g=x+4S[0]-6.6z;6.34=y+4S[1]-6.6F;6.1t=6.35(4);c(6.34>=6.1t[1]&&6.34<6.1t[1]+4.2k&&6.3g>=6.1t[0]&&6.3g<6.1t[0]+4.2p)},8E:7(3Z,4){f(!3Z)c 0;f(3Z==\'8G\')c((6.1t[1]+4.2k)-6.34)/4.2k;f(3Z==\'8K\')c((6.1t[0]+4.2p)-6.3g)/4.2p},77:7(O,Z){O=$(O);Z=$(Z);Z.l.14=\'2o\';d 2P=6.35(O);Z.l.1n=2P[1]+\'1m\';Z.l.18=2P[0]+\'1m\';Z.l.21=O.2p+\'1m\';Z.l.24=O.2k+\'1m\'},4e:7(4M){d 19=0,15=0;d 4=4M;2q{19+=4.29||0;15+=4.2f||0;f(4.1Q==J.1c)f(k.1R(4,\'14\')==\'2o\')1y}1H(4=4.1Q);4=4M;2q{19-=4.2O||0;15-=4.2G||0}1H(4=4.1X);c[15,19]},77:7(O,Z){d m=q.u({5l:11,5r:11,5B:11,5q:11,29:0,2f:0},N[2]||{});O=$(O);d p=2d.4e(O);Z=$(Z);d 2J=[0,0];d 3v=1L;f(k.1R(Z,\'14\')==\'2o\'){3v=2d.1Q(Z);2J=2d.4e(3v)}f(3v==J.1c){2J[0]-=J.1c.2f;2J[1]-=J.1c.29}f(m.5l)Z.l.18=(p[0]-2J[0]+m.2f)+\'1m\';f(m.5r)Z.l.1n=(p[1]-2J[1]+m.29)+\'1m\';f(m.5B)Z.l.21=O.2p+\'1m\';f(m.5q)Z.l.24=O.2k+\'1m\'},8b:7(4){4=$(4);f(4.l.14==\'2o\')c;2d.4P();d 2P=2d.68(4);d 1n=2P[1];d 18=2P[0];d 21=4.6m;d 24=4.6p;4.6P=18-3X(4.l.18||0);4.6I=1n-3X(4.l.1n||0);4.5k=4.l.21;4.7f=4.l.24;4.l.14=\'2o\';4.l.1n=1n+\'1m\';4.l.18=18+\'1m\';4.l.21=21+\'1m\';4.l.24=24+\'1m\'},8w:7(4){4=$(4);f(4.l.14==\'3T\')c;2d.4P();4.l.14=\'3T\';d 1n=3X(4.l.1n||0)-(4.6I||0);d 18=3X(4.l.18||0)-(4.6P||0);4.l.1n=1n+\'1m\';4.l.18=18+\'1m\';4.l.24=4.7f;4.l.21=4.5k}};f(/3x|3w|3u/.4v(33.62)){2d.35=7(4){d 19=0,15=0;2q{19+=4.29||0;15+=4.2f||0;f(4.1Q==J.1c)f(k.1R(4,\'14\')==\'2o\')1y;4=4.1Q}1H(4);c[15,19]}};',62,600,'||||element||this|function|||||return|var||if||value|||Element|style|options||iterator||Object|||length|extend|prototype|index|||new||name|event|Form|transport||for||match|document||result|Ajax|arguments|source|results|form|||Prototype|object|each|push||false|target||true|elements||position|valueL||create|left|valueT|callback|Class|body|bind|Abstract|className|Insertion|tagName|pair|try|select|url|px|top|Event|Enumerable|div|case|catch|offset|useCapture|undefined|container|getValue|break|replacement|pattern|onComplete|map|else|Array|method|property|while|initialize|frequency|range|null|include|join|key|requestHeaders|offsetParent|getStyle|parameter|observers|inspect|observer|window|parentNode|text|toArray|els|width|start|args|height|throw|request||parameters|offsetTop|methods|opt|EventObserver|Position|html|offsetLeft|type|fragments|typeof|fragment|offsetHeight|oStringList|_each|apply|absolute|offsetWidth|do|cache|decay|content|input|emptyFunction|toLowerCase|end|replace|childNodes|registerCallback|display|toString|onTimerEvent|Serializers|readyState|scrollLeft|exclusive|on|delta|lastValue|getElements|in|hash|scrollTop|offsets|stripScripts|iterable|truncation|gsub|template|initializeRange|Responders|insertContent|setTimeout|json||hidden|status|navigator|ycomp|cumulativeOffset|inject||||serialize|responders|_overflow|Methods|collect|adjacency|xcomp|innerHTML|count|split|response|responseIsSuccess|success|Template|responder|dispatchException|evalScripts|pluck|concat|Request|KHTML|parent|Safari|Konqueror|dispatch|failure|receiver|observe|Observer|TimedObserver|ScriptFragment|responseText|script|inputs|ancestor|textarea|classNames|ObjectRange|node|typeName|RegExp|camelize|none|documentElement|ClassNames|relative|right|overflow|HTMLElement|parseFloat|toUpperCase|mode||currentlyExecuting|remove|__method|Base|memo||slice|returnValue|continue|setOptions|String|classNameToRemove|_reverse|page|focus|queryComponent|Hash|attachEvent|post|detachEvent|Version|reverse|encodeURIComponent|disabled|asynchronous|eval|respondToReadyState|activeRequestCount|Complete|appVersion|test|getTransport|containers|matchingInputs|1000|header|updater|Updater|getElementsByTagName|child|responderToAdd|static|tagElements|queryComponents|defaultView|onElementEvent|css|forElement|values|visibility|prepare|mergedHash|pos|offsetcache|_madePositioned|visible|tbody|findOrStore|_nativeExtensions|createElement|digits|trues|found|prepareReplacement|before|camelizedString|insertBefore|selectNodeContents|exception|falses|criteria|classNameToAdd|params|set|destination|last|addEventListener|indexOf|inline|clear|succ|_originalWidth|setLeft|Top|ActiveXObject|scriptTag|matchOne|setHeight|setTop|without|responderToRemove|_observeAndCache|find|reset|removeEventListener|activate|findFirstElement|setRequestHeaders|setWidth|XMLHttpRequest|constructor|application|xml|onCreate|contentType|Field|onStateChange|keydown|Events|evalJSON|stopObserving|inputSelector|img|Content|evalResponse|selectOne|onreadystatechange|keypress|postBody|onException|selectMany|updateContent|setInterval|insertion|PeriodicalUpdater|userAgent|updateComplete|lastText|timer|unloadCache|registerFormCallbacks|positionedOffset|register|parentElement|children|switch|XMLHTTP|_extended|hide|checkbox|update|radio|these|outerHTML|password|clientWidth|one|includeScrollOffsets|clientHeight|nodeValue|withinIncludingScrolloffsets|Try|scrollTo|realOffset|getComputedStyle|show|currentStyle|auto|deltaX|originalPosition|originalVisibility|originalWidth|originalHeight|opera|deltaY|bottom|array|_originalTop|flatten|addMethods|lambda|Toggle|toggle|insertAdjacentHTML|_originalLeft|PeriodicalExecuter|ownerDocument|createRange|createContextualFragment|contentFromAnonymousTable|table|Before|which|matchAll|button|extractScripts|stripTags|pairString|len|collapse|appendChild|After|clone|toQueryParams|Pattern|evaluate|stop|stringValue|preventDefault|charAt|_originalHeight|substring|Bottom|pairs|Function|add|collections|javascript|detect|findAll|entries|from|first|compact|keys|merge|present|toQueryString|getInputs|Msxml2|Microsoft|unregister|disable|urlencoded|blur|300|enable|responseIsFailure|Uninitialized|Loaded|Interactive|_|get|focusFirstElement|open|send|Requested|With|Accept|overrideMimeType|Connection|close|setRequestHeader|getResponseHeader|JSON|gi|submit|Loading|Success|Failure|checked|200|selectedIndex|www|selected|bMSIE|clearTimeout|unload|absolutize|string|getElementById|pageXOffset|getElementsByClassName|pageYOffset|removeChild|replaceChild|click|getHeight|hasClassName|addClassName|removeClassName|within|cleanWhitespace|nodeType|empty|childOf|multiple|change|getPropertyValue|relativize|setStyle|getDimensions|makePositioned|undoPositioned|makeClipping|KEY_BACKSPACE|undoClipping|overlap|KEY_TAB|vertical|KEY_RETURN|KEY_ESC|KEY_LEFT|horizontal|KEY_UP|member|tr|KEY_RIGHT|0_RC_0|Number|instanceof|shift|KEY_DOWN|bindAsEventListener|call|toColorPart|KEY_DELETE|times|finally|callee|srcElement|sub|scan|truncate|isLeftClick|beforeBegin|setStartBefore|im|afterBegin|firstChild|pointerX|unescapeHTML|beforeEnd|pageX|clientX|pointerY|parseQuery|afterEnd|pageY|clientY|RangeError|setStartAfter|all|any|grep|invoke|stopPropagation|max|nextSibling|min|partition|cancelBubble|reject|sortBy|sort|findElement|zip|pop|createTextNode|escapeHTML|strip'.split('|'),0,{})
+
+}letters = new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");
+numbers = new Array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26);
+colors = new Array("FF","CC","99","66","33","00");
+
+var endResult;
+
+function doTest()
+{
+ endResult = "";
+
+ // make up email address
+ for (var k=0;k<4000;k++)
+ {
+ name = makeName(6);
+ (k%2)?email=name+"@mac.com":email=name+"(at)mac.com";
+
+ // validate the email address
+ var pattern = /^[a-zA-Z0-9\-\._]+@[a-zA-Z0-9\-_]+(\.?[a-zA-Z0-9\-_]*)\.[a-zA-Z]{2,3}$/;
+
+ if(pattern.test(email))
+ {
+ var r = email + " appears to be a valid email address.";
+ addResult(r);
+ }
+ else
+ {
+ r = email + " does NOT appear to be a valid email address.";
+ addResult(r);
+ }
+ }
+
+ // make up ZIP codes
+ for (var s=0;s<4000;s++)
+ {
+ var zipGood = true;
+ var zip = makeNumber(4);
+ (s%2)?zip=zip+"xyz":zip=zip.concat("7");
+
+ // validate the zip code
+ for (var i = 0; i < zip.length; i++) {
+ var ch = zip.charAt(i);
+ if (ch < "0" || ch > "9") {
+ zipGood = false;
+ r = zip + " contains letters.";
+ addResult(r);
+ }
+ }
+ if (zipGood && zip.length>5)
+ {
+ zipGood = false;
+ r = zip + " is longer than five characters.";
+ addResult(r);
+ }
+ if (zipGood)
+ {
+ r = zip + " appears to be a valid ZIP code.";
+ addResult(r);
+ }
+ }
+}
+
+function makeName(n)
+{
+ var tmp = "";
+ for (var i=0;i<n;i++)
+ {
+ var l = Math.floor(26*Math.random());
+ tmp += letters[l];
+ }
+ return tmp;
+}
+
+function makeNumber(n)
+{
+ var tmp = "";
+ for (var i=0;i<n;i++)
+ {
+ var l = Math.floor(9*Math.random());
+ tmp = tmp.concat(l);
+ }
+ return tmp;
+}
+
+function addResult(r)
+{
+ endResult += "\n" + r;
+}
+
+doTest();
+</script>
+
+
+<script id="tetris" type="x">
+Tetris = (function() {
+
+
+
+var scale = 24;
+
+var width = 10;
+
+var height = 20;
+
+
+
+var speed = 1000;
+
+
+
+var $ = function(id) {return document.getElementById(id)};
+
+var dc = function(tag) {return document.createElement(tag)};
+
+
+
+var levels = [
+
+ {p:500, s:1000, bg:"sun.jpg"},
+
+ {p:1000, s:700, bg:"mercury.jpg"},
+
+ {p:2000, s:500, bg:"venus.jpg"},
+
+ {p:5000, s:400, bg:"earth.jpg"},
+
+ {p:10000, s:300, bg:"mars.jpg"},
+
+ {p:25000, s:200, bg:"jupiter.jpg"},
+
+ {p:50000, s:150, bg:"saturn.jpg"},
+
+ {p:100000, s:100, bg:"uranus.jpg"},
+
+ {p:250000, s:75, bg:"neptune.jpg"}
+
+];
+
+
+
+var game;
+
+var paused = false;
+
+var running = false;
+
+var activePiece;
+
+var activePieceType = -1;
+
+var nextPieceType = -1;
+
+var activeRot = 0;
+
+var field = [];
+
+var fieldRows = [];
+
+var level = 0;
+
+var score = 0;
+
+
+
+var lineScore = [30,120,270,520];
+
+var lines = 0;
+
+
+
+var curX = 0;
+
+var curY = 0;
+
+var timer = 0;
+
+
+
+
+
+function init() {
+
+ game = $("gamefield");
+
+
+
+ updateGameInfo();
+
+
+
+ registerEvents();
+
+
+
+ if (location.search) {
+
+ loadGame(decodeURIComponent(location.search.substring(1)));
+
+ } else {
+
+ splash();
+
+ }
+
+}
+
+
+
+function clearField() {
+
+ game.innerHTML = "";
+
+ fieldRows = [];
+
+ for (var y=0;y<height;y++) {
+
+ var row = dc("div");
+
+ row.style.position = "absolute";
+
+ row.style.top = y*scale+"px";
+
+ row.style.left = "0px";
+
+ row.style.width = width*scale+"px";
+
+ row.style.height = scale+"px";
+
+ fieldRows[y] = row;
+
+ game.appendChild(row);
+
+
+
+ field[y] = [];
+
+ for (var x=0;x<width;x++) {
+
+ field[y][x] = 0;
+
+ }
+
+ }
+
+}
+
+
+
+function splash() {
+
+}
+
+
+
+function registerEvents() {
+
+ addEvent(document, "keydown", onKeyDown);
+
+}
+
+
+
+function addEvent(el, event, handler) {
+
+ if (el.addEventListener)
+
+ el.addEventListener(event, handler, false);
+
+ else if (el.attachEvent)
+
+ el.attachEvent("on" + event, handler);
+
+}
+
+
+
+function onKeyDown(e) {
+
+ e = e || window.event;
+
+ var keyCode = e.which || e.keyCode;
+
+//console.log(keyCode);
+
+ switch (keyCode) {
+
+ case 13: // enter
+
+ dropPiece();
+
+ break;
+
+ case 32: // space
+
+ if (!running) {
+
+ startGame();
+
+ return;
+
+ }
+
+ case 38: // up
+
+ rotateActivePiece();
+
+ break;
+
+ case 39: // left
+
+ moveActivePiece(1, 0);
+
+ break;
+
+ case 37: // right
+
+ moveActivePiece(-1, 0);
+
+ break;
+
+ case 40: // down
+
+ moveActivePiece(0, 1);
+
+ break;
+
+ case 83 :
+
+ saveGame();
+
+ break;
+
+ /*
+
+ case 76:
+
+ loadGame("{f:\"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000033300000000300000\",p:{x:3,y:1,r:0,t:1}}");
+
+ break;
+
+ */
+
+ case 80:
+
+ togglePause();
+
+ default :
+
+ return false;
+
+ }
+
+ if (e.preventDefault)
+
+ e.preventDefault();
+
+ return true;
+
+}
+
+
+
+function dropPiece() {
+
+ for (var y=0;y<height;y++) {
+
+ if (!moveActivePiece(0, 1))
+
+ break;
+
+ }
+
+}
+
+
+
+function menu() {
+
+}
+
+
+
+
+
+
+
+function startGame() {
+
+ speed = levels[level].s;
+
+ clearField();
+
+ updateGameInfo();
+
+
+
+ //createPiece();
+
+ running = true;
+
+ nextCycle();
+
+}
+
+
+
+function cycle() {
+
+ if (running) {
+
+ if (!paused) {
+
+ if (!activePiece) {
+
+ activePieceType = nextPieceType > -1 ? nextPieceType : Math.floor(Math.random() * basePieces.length);
+
+ activePiece = createPiece(activePieceType);
+
+ activeRot = 0;
+
+ curX = Math.floor(width/2-2);
+
+ curY = 0;
+
+ rebuildPiece(activePiece, activePieceType, activeRot);
+
+ game.appendChild(activePiece);
+
+
+
+ if (!canMoveTo(curX, curY)) {
+
+ gameOver();
+
+ return;
+
+ }
+
+
+
+ nextPieceType = Math.floor(Math.random() * basePieces.length);
+
+ updateNextPiece();
+
+ moveActivePiece(0,0);
+
+ } else {
+
+ moveActivePiece(0,1);
+
+ }
+
+ }
+
+ nextCycle();
+
+ }
+
+}
+
+
+
+function nextCycle() {
+
+ clearTimeout(timer);
+
+ timer = setTimeout(cycle, speed);
+
+}
+
+
+
+function togglePause() {
+
+ paused = !paused;
+
+ if (paused) {
+
+ // show pause text
+
+ } else {
+
+ // hide pause text
+
+ }
+
+}
+
+
+
+function gameOver() {
+
+ running = false;
+
+ activePiece = null;
+
+}
+
+
+
+function rotateActivePiece() {
+
+ if (!activePiece) return;
+
+ if (paused || !running) return;
+
+
+
+ activeRot++;
+
+ if (activeRot > 3) activeRot = 0;
+
+ if (canMoveTo(curX, curY)) {
+
+ rebuildPiece(activePiece, activePieceType, activeRot);
+
+ } else {
+
+ activeRot--;
+
+ if (activeRot < 0) activeRot = 3;
+
+ }
+
+}
+
+
+
+function moveActivePiece(addX, addY) {
+
+ if (!activePiece) return;
+
+ if (paused || !running) return;
+
+
+
+ var newX = curX + addX;
+
+ var newY = curY + addY;
+
+ if (canMoveTo(newX, newY)) {
+
+ curX = newX;
+
+ curY = newY;
+
+ activePiece.style.left = curX*scale+"px";
+
+ activePiece.style.top = curY*scale+"px";
+
+ return true;
+
+ } else {
+
+ if (addY > 0) { // moving down
+
+ landPiece();
+
+ activePiece = null;
+
+ }
+
+ }
+
+ return false;
+
+}
+
+
+
+function landPiece() {
+
+ var pieceDesc = basePieces[activePieceType];
+
+ for (var i=0;i<pieceDesc.length;i++) {
+
+ for (var j=0;j<pieceDesc.length;j++) {
+
+ (function() {
+
+ if (pieceDesc[i][j]) {
+
+ var px = rotateX(j,i,pieceDesc.length,activeRot);
+
+ var py = rotateY(j,i,pieceDesc.length,activeRot);
+
+ var block = activePiece.blocks[py][px];
+
+ activePiece.removeChild(block);
+
+ fieldRows[curY+py].appendChild(block)
+
+ block.style.left = (curX+px)*scale+"px";
+
+ block.style.top = "0px";
+
+ field[curY + py][curX + px] = activePieceType+1;
+
+ }
+
+ })();
+
+ }
+
+ }
+
+ game.removeChild(activePiece);
+
+ setTimeout(checkRows, 50);
+
+ nextCycle();
+
+}
+
+
+
+function checkRows() {
+
+ var fullRows = [];
+
+ for (var y=0;y<height;y++) {
+
+ var rowFull = true;
+
+ for (var x=0;x<width;x++) {
+
+ if (!field[y][x])
+
+ rowFull = false;
+
+ }
+
+ if (rowFull) {
+
+ fullRows.push(y);
+
+ }
+
+ }
+
+
+
+ if (fullRows.length) {
+
+ score += lineScore[fullRows.length-1]*(level+1);
+
+ lines += fullRows.length;
+
+ updateGameInfo();
+
+ checkLevel();
+
+ }
+
+
+
+ for (var i=0;i<fullRows.length;i++) {
+
+ var copyField = [];
+
+ var copyRows = [];
+
+ for (var y=0;y<height;y++) {
+
+ copyField[y] = [];
+
+ copyRows[y] = fieldRows[y].innerHTML;
+
+ for (var x=0;x<width;x++) {
+
+ copyField[y][x] = field[y][x];
+
+ }
+
+ }
+
+
+
+ fieldRows[fullRows[i]].innerHTML = "";
+
+ for (var y=fullRows[i];y>=0;y--) {
+
+ fieldRows[y].innerHTML = copyRows[y-1]||"";
+
+ for (var x=0;x<width;x++) {
+
+ field[y][x] = y > 0 ? copyField[y-1][x] : 0;
+
+ }
+
+ }
+
+ }
+
+
+
+}
+
+
+
+function updateGameInfo() {
+
+ $("tetris-score-text").innerHTML = "Score: " + score;
+
+ $("tetris-lines-text").innerHTML = "Lines: " + lines;
+
+ $("tetris-level-text").innerHTML = "Level: " + (level+1);
+
+}
+
+
+
+function checkLevel() {
+
+ if (levels[level]) {
+
+ if (score >= levels[level].p) {
+
+ level++;
+
+ speed = levels[level].s;
+
+ updateGameInfo();
+
+ }
+
+ }
+
+}
+
+
+
+function canMoveTo(x,y) {
+
+ var pieceDesc = basePieces[activePieceType];
+
+ for (var i=0;i<pieceDesc.length;i++) {
+
+ for (var j=0;j<pieceDesc.length;j++) {
+
+ if (pieceDesc[i][j]) {
+
+ var px = rotateX(j,i,pieceDesc.length,activeRot);
+
+ var py = rotateY(j,i,pieceDesc.length,activeRot);
+
+ if (isBlocked(x+px, y+py))
+
+ return false;
+
+ }
+
+ }
+
+ }
+
+ return true;
+
+}
+
+
+
+function isBlocked(x,y) {
+
+ if (x < 0 || y < 0) return true;
+
+ if (x >= width || y >= height) return true;
+
+ return field[y][x];
+
+}
+
+
+
+function nextLevel() {
+
+}
+
+
+
+var basePieces = [
+
+ [
+
+ [0,1,0,0], // I
+
+ [0,1,0,0],
+
+ [0,1,0,0],
+
+ [0,1,0,0]
+
+ ],
+
+ [
+
+ [0,0,1], // J
+
+ [0,0,1],
+
+ [0,1,1]
+
+ ],
+
+ [
+
+ [1,1,1], // T
+
+ [0,1,0],
+
+ [0,0,0]
+
+ ],
+
+ [
+
+ [1,0,0], // L
+
+ [1,0,0],
+
+ [1,1,0]
+
+ ],
+
+ [
+
+ [1,1], // O
+
+ [1,1]
+
+ ],
+
+ [
+
+ [0,1,1], // Z
+
+ [1,1,0],
+
+ [0,0,0]
+
+ ],
+
+ [
+
+ [1,1,0], // S
+
+ [0,1,1],
+
+ [0,0,0]
+
+ ]
+
+];
+
+
+
+var pieceColors = ["#00f0f0", "#0000f0", "#a000f0", "#f0a000", "#f0f000", "#f00000", "#00f000"];
+
+
+
+function createPiece(pieceType) {
+
+
+
+
+
+
+
+ var pieceDesc = basePieces[pieceType];
+
+
+
+ var div = dc("div");
+
+ div.style.position = "absolute";
+
+ div.style.top = curY*scale + "px";
+
+ div.style.left = curX*scale + "px";
+
+ div.style.width = pieceDesc.length*scale + "px";
+
+ div.style.height = pieceDesc.length*scale + "px";
+
+
+
+ return div;
+
+}
+
+
+
+function updateNextPiece() {
+
+ var div = $("tetris-next-piece");
+
+ div.innerHTML = "";
+
+ var piece = createPiece(nextPieceType);
+
+ var rot = 0;
+
+ piece.style.left = "48px";
+
+ piece.style.top = "24px";
+
+ switch (nextPieceType) {
+
+ case 0:
+
+ rot = 1;
+
+ piece.style.top = "0px";
+
+ break;
+
+ case 2:
+
+ rot = 3;
+
+ break;
+
+ case 3:
+
+ case 4:
+
+ piece.style.left = "72px";
+
+ break;
+
+ case 5:
+
+ case 6:
+
+ rot = 1;
+
+ piece.style.left = "72px";
+
+ break;
+
+ default:
+
+ }
+
+ rebuildPiece(piece, nextPieceType, rot);
+
+ div.appendChild(piece);
+
+}
+
+
+
+function rebuildPiece(div, pieceType, rot) {
+
+ div.innerHTML = "";
+
+ var pieceDesc = basePieces[pieceType];
+
+ div.blocks = [];
+
+ for (var i=0;i<pieceDesc.length;i++)
+
+ div.blocks[i] = [];
+
+ for (var i=0;i<pieceDesc.length;i++) {
+
+ for (var j=0;j<pieceDesc.length;j++) {
+
+ if (pieceDesc[i][j]) {
+
+ var px = rotateX(j,i,pieceDesc.length, rot);
+
+ var py = rotateY(j,i,pieceDesc.length, rot);
+
+ var block = createBlock(pieceColors[pieceType],px,py,pieceDesc.length);
+
+ div.appendChild(block);
+
+ div.blocks[py][px] = block;
+
+ }
+
+ }
+
+ }
+
+}
+
+
+
+function rotateX(j,i,size, rot) {
+
+ switch (rot) {
+
+ case 0:
+
+ var px = j; break;
+
+ case 1:
+
+ var px = i; break;
+
+ case 2:
+
+ var px = (size-1)-j; break;
+
+ case 3:
+
+ var px = (size-1)-i; break;
+
+ }
+
+ return px;
+
+}
+
+
+
+function rotateY(j,i,size, rot) {
+
+ switch (rot) {
+
+ case 0:
+
+ var py = i; break;
+
+ case 1:
+
+ var py = (size-1)-j; break;
+
+ case 2:
+
+ var py = (size-1)-i; break;
+
+ case 3:
+
+ var py = j;break;
+
+ }
+
+ return py;
+
+}
+
+
+
+
+
+function createBlock(color,x,y) {
+
+ var div = dc("div");
+
+ div.className = "tetris-block";
+
+ div.style.backgroundColor = color;
+
+ div.style.borderColor = color;
+
+
+
+ div.style.left = x*scale + "px";
+
+ div.style.top = y*scale + "px";
+
+
+
+ return div;
+
+}
+
+
+
+function serialize() {
+
+ var fieldString = "\"";
+
+ for (var y=0;y<height;y++) {
+
+ for (var x=0;x<width;x++) {
+
+ fieldString += field[y][x];
+
+ }
+
+ }
+
+ fieldString += "\"";
+
+
+
+ var pieceString = "{"
+
+ + "x:"+curX+",y:"+curY+",r:"+activeRot+",t:"+activePieceType
+
+ + "}";
+
+
+
+ var gameString = "{"
+
+ + "f:" + fieldString + ","
+
+ + "p:" + pieceString + ","
+
+ + "n:" + nextPieceType + ","
+
+ + "s:" + score + ","
+
+ + "v:" + level + ","
+
+ + "l:" + lines
+
+ + "}";
+
+ return gameString;
+
+}
+
+
+
+function loadGame(gameString) {
+
+ clearField();
+
+ // TODO: Fix this.
+
+ var oldGame = eval("("+gameString+")");
+
+ var f = oldGame.f.split("");
+
+ var p = oldGame.p;
+
+ for (var y=0;y<height;y++) {
+
+ for (var x=0;x<width;x++) {
+
+ field[y][x] = parseInt(f.shift(),10);
+
+ if (field[y][x]) {
+
+ var block = createBlock(pieceColors[field[y][x]-1],x,0);
+
+ fieldRows[y].appendChild(block);
+
+ }
+
+ }
+
+ }
+
+
+
+ activeRot = p.r;
+
+ curX = p.x;
+
+ curY = p.y;
+
+ activePieceType = p.t;
+
+
+
+ nextPieceType = oldGame.n;
+
+ score = oldGame.s;
+
+ level = oldGame.v;
+
+ lines = oldGame.l;
+
+ speed = levels[level].s;
+
+
+
+ updateGameInfo();
+
+ updateNextPiece();
+
+
+
+ activePiece = createPiece(activePieceType);
+
+ rebuildPiece(activePiece, activePieceType, activeRot);
+
+ curY = p.y;
+
+ curX = p.x;
+
+
+
+ activePiece.style.top = curY*scale + "px";
+
+ activePiece.style.left = curX*scale + "px";
+
+ game.appendChild(activePiece);
+
+
+
+
+
+ if (!running) {
+
+ running = true;
+
+ nextCycle();
+
+ }
+
+}
+
+
+
+window.__json_callbacks = {};
+
+var jsonCallCount = 0;
+
+
+
+function callJSON(url, callback) {
+
+ jsonCallCount++;
+
+ var script = document.createElement("script");
+
+ window.__json_callbacks["fn_" + jsonCallCount] = function(response) {
+
+ document.body.removeChild(script);
+
+ if (callback)
+
+ callback(response);
+
+ }
+
+ script.setAttribute("type", "text/javascript");
+
+ document.body.appendChild(script);
+
+ script.src = url + "&callback=__json_callbacks.fn_" + jsonCallCount;
+
+}
+
+
+
+function saveGame() {
+
+ if (!running) return;
+
+
+
+ var wasPaused = paused;
+
+ paused = true;
+
+ var gameString = serialize();
+
+ var url = "http://www.nihilogic.dk/labs/tetris/?" + encodeURIComponent(gameString);
+
+ callJSON(
+
+ "http://json-tinyurl.appspot.com/?url=" + encodeURIComponent(url),
+
+ function(res) {
+
+ if (res.ok) {
+
+ prompt("Your game has been saved. Go to this URL to load the game whenever you please:", res.tinyurl);
+
+ } else {
+
+ alert("Oops. Something went wrong when trying to save the game!");
+
+ }
+
+ paused = wasPaused;
+
+ }
+
+ );
+
+}
+
+
+
+
+
+return init;
+
+
+
+})();
+
+
+
+Tetris();
+
+
+
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+
+
+
+(function(){var aa="_gat",ba="_gaq",r=true,v=false,w=undefined,ca="4.6.5",x="length",y="cookie",A="location",B="&",C="=",D="__utma=",E="__utmb=",G="__utmc=",da="__utmk=",H="__utmv=",J="__utmz=",K="__utmx=",L="GASO=";var N=function(i){return w==i||"-"==i||""==i},ea=function(i){return i[x]>0&&" \n\r\t".indexOf(i)>-1},P=function(i,l,g){var t="-",k;if(!N(i)&&!N(l)&&!N(g)){k=i.indexOf(l);if(k>-1){g=i.indexOf(g,k);if(g<0)g=i[x];t=O(i,k+l.indexOf(C)+1,g)}}return t},Q=function(i){var l=v,g=0,t,k;if(!N(i)){l=r;for(t=0;t<i[x];t++){k=i.charAt(t);g+="."==k?1:0;l=l&&g<=1&&(0==t&&"-"==k||".0123456789".indexOf(k)>-1)}}return l},S=function(i,l){var g=encodeURIComponent;return g instanceof Function?l?encodeURI(i):g(i):escape(i)},
+T=function(i,l){var g=decodeURIComponent,t;i=i.split("+").join(" ");if(g instanceof Function)try{t=l?decodeURI(i):g(i)}catch(k){t=unescape(i)}else t=unescape(i);return t},U=function(i,l){return i.indexOf(l)>-1},V=function(i,l){i[i[x]]=l},W=function(i){return i.toLowerCase()},X=function(i,l){return i.split(l)},fa=function(i,l){return i.indexOf(l)},O=function(i,l,g){g=w==g?i[x]:g;return i.substring(l,g)},ga=function(i,l){return i.join(l)},ia=function(i){var l=1,g=0,t;if(!N(i)){l=0;for(t=i[x]-1;t>=0;t--){g=
+i.charCodeAt(t);l=(l<<6&268435455)+g+(g<<14);g=l&266338304;l=g!=0?l^g>>21:l}}return l},ja=function(){var i=window,l=w;if(i&&i.gaGlobal&&i.gaGlobal.hid)l=i.gaGlobal.hid;else{l=Y();i.gaGlobal=i.gaGlobal?i.gaGlobal:{};i.gaGlobal.hid=l}return l},Y=function(){return Math.round(Math.random()*2147483647)},Z={Ha:function(i,l){this.bb=i;this.nb=l},ib:v,_gasoDomain:w,_gasoCPath:w};Z.Gb=function(){function i(k){return new t(k[0],k[1])}function l(k){var p=[];k=k.split(",");var f;for(f=0;f<k.length;++f)p.push(i(k[f].split(":")));return p}var g=this,t=Z.Ha;g.Ia="utm_campaign";g.Ja="utm_content";g.Ka="utm_id";g.La="utm_medium";g.Ma="utm_nooverride";g.Na="utm_source";g.Oa="utm_term";g.Pa="gclid";g.ba=0;g.z=0;g.Ta=15768E6;g.sb=18E5;g.v=63072E6;g.ta=[];g.va=[];g.nc="cse";g.oc="q";g.ob=5;g.T=l("daum:q,eniro:search_word,naver:query,images.google:q,google:q,yahoo:p,msn:q,bing:q,aol:query,aol:encquery,lycos:query,ask:q,altavista:q,netscape:query,cnn:query,about:terms,mamma:query,alltheweb:q,voila:rdata,virgilio:qs,live:q,baidu:wd,alice:qs,yandex:text,najdi:q,aol:q,mama:query,seznam:q,search:q,wp:szukaj,onet:qt,szukacz:q,yam:k,pchome:q,kvasir:q,sesam:q,ozu:q,terra:query,mynet:q,ekolay:q,rambler:words");
+g.t=w;g.lb=v;g.h="/";g.U=100;g.oa="/__utm.gif";g.ga=1;g.ha=1;g.u="|";g.fa=1;g.da=1;g.Ra=1;g.b="auto";g.I=1;g.ra=1E3;g.Jc=10;g.Pb=10;g.Kc=0.2;g.o=w;g.a=document;g.e=window};Z.Hb=function(i){function l(d,a,j,c){var n="",s=0;n=P(d,"2"+a,";");if(!N(n)){d=n.indexOf("^"+j+".");if(d<0)return["",0];n=O(n,d+j[x]+2);if(n.indexOf("^")>0)n=n.split("^")[0];j=n.split(":");n=j[1];s=parseInt(j[0],10);if(!c&&s<p.r)n=""}if(N(n))n="";return[n,s]}function g(d,a){return"^"+ga([[a,d[1]].join("."),d[0]],":")}function t(d,a){f.a[y]=d+"; path="+f.h+"; "+a+p.fb()}function k(d){var a=new Date;d=new Date(a.getTime()+d);return"expires="+d.toGMTString()+"; "}var p=this,f=i;p.r=(new Date).getTime();
+var h=[D,E,G,J,H,K,L];p.k=function(){var d=f.a[y];return f.o?p.Wb(d,f.o):d};p.Wb=function(d,a){var j=[],c,n;for(c=0;c<h[x];c++){n=l(d,h[c],a)[0];N(n)||(j[j[x]]=h[c]+n+";")}return j.join("")};p.l=function(d,a,j){var c=j>0?k(j):"";if(f.o){a=p.kc(f.a[y],d,f.o,a,j);d="2"+d;c=j>0?k(f.v):""}t(d+a,c)};p.kc=function(d,a,j,c,n){var s="";n=n||f.v;c=g([c,p.r+n*1],j);s=P(d,"2"+a,";");if(!N(s)){d=g(l(d,a,j,r),j);s=ga(s.split(d),"");return s=c+s}return c};p.fb=function(){return N(f.b)?"":"domain="+f.b+";"}};Z.$=function(i){function l(b){b=b instanceof Array?b.join("."):"";return N(b)?"-":b}function g(b,e){var o=[];if(!N(b)){o=b.split(".");if(e)for(b=0;b<o[x];b++)Q(o[b])||(o[b]="-")}return o}function t(b,e,o){var m=c.M,q,u;for(q=0;q<m[x];q++){u=m[q][0];u+=N(e)?e:e+m[q][4];m[q][2](P(b,u,o))}}var k,p,f,h,d,a,j,c=this,n,s=i;c.j=new Z.Hb(i);c.kb=function(){return w==n||n==c.P()};c.k=function(){return c.j.k()};c.ma=function(){return d?d:"-"};c.vb=function(b){d=b};c.za=function(b){n=Q(b)?b*1:"-"};c.la=function(){return l(a)};
+c.Aa=function(b){a=g(b)};c.Vb=function(){c.j.l(H,"",-1)};c.lc=function(){return n?n:"-"};c.fb=function(){return N(s.b)?"":"domain="+s.b+";"};c.ja=function(){return l(k)};c.tb=function(b){k=g(b,1)};c.C=function(){return l(p)};c.ya=function(b){p=g(b,1)};c.ka=function(){return l(f)};c.ub=function(b){f=g(b,1)};c.na=function(){return l(h)};c.wb=function(b){h=g(b);for(b=0;b<h[x];b++)if(b<4&&!Q(h[b]))h[b]="-"};c.fc=function(){return j};c.Dc=function(b){j=b};c.Sb=function(){k=[];p=[];f=[];h=[];d=w;a=[];n=
+w};c.P=function(){var b="",e;for(e=0;e<c.M[x];e++)b+=c.M[e][1]();return ia(b)};c.ua=function(b){var e=c.k(),o=v;if(e){t(e,b,";");c.za(c.P());o=r}return o};c.zc=function(b){t(b,"",B);c.za(P(b,da,B))};c.Hc=function(){var b=c.M,e=[],o;for(o=0;o<b[x];o++)V(e,b[o][0]+b[o][1]());V(e,da+c.P());return e.join(B)};c.Nc=function(b,e){var o=c.M,m=s.h;c.ua(b);s.h=e;for(b=0;b<o[x];b++)N(o[b][1]())||o[b][3]();s.h=m};c.Cb=function(){c.j.l(D,c.ja(),s.v)};c.Ea=function(){c.j.l(E,c.C(),s.sb)};c.Db=function(){c.j.l(G,
+c.ka(),0)};c.Ga=function(){c.j.l(J,c.na(),s.Ta)};c.Eb=function(){c.j.l(K,c.ma(),s.v)};c.Fa=function(){c.j.l(H,c.la(),s.v)};c.Oc=function(){c.j.l(L,c.fc(),0)};c.M=[[D,c.ja,c.tb,c.Cb,"."],[E,c.C,c.ya,c.Ea,""],[G,c.ka,c.ub,c.Db,""],[K,c.ma,c.vb,c.Eb,""],[J,c.na,c.wb,c.Ga,"."],[H,c.la,c.Aa,c.Fa,"."]]};Z.Kb=function(i){var l=this,g=i,t=new Z.$(g),k=function(){},p=function(f){var h=(new Date).getTime(),d;d=(h-f[3])*(g.Kc/1E3);if(d>=1){f[2]=Math.min(Math.floor(f[2]*1+d),g.Pb);f[3]=h}return f};l.H=function(f,h,d,a,j,c){var n,s=g.I,b=g.a[A];t.ua(d);n=X(t.C(),".");if(n[1]<500||a){if(j)n=p(n);if(a||!j||n[2]>=1){if(!a&&j)n[2]=n[2]*1-1;n[1]=n[1]*1+1;f="?utmwv="+ca+"&utmn="+Y()+(N(b.hostname)?"":"&utmhn="+S(b.hostname))+(g.U==100?"":"&utmsp="+S(g.U))+f;if(0==s||2==s){a=2==s?k:c||k;l.$a(g.oa+f,a)}if(1==s||
+2==s){f=("https:"==b.protocol?"https://ssl.google-analytics.com/__utm.gif":"http://www.google-analytics.com/__utm.gif")+f+"&utmac="+h+"&utmcc="+l.ac(d);if(ka)f+="&gaq=1";l.$a(f,c)}}}t.ya(n.join("."));t.Ea()};l.$a=function(f,h){var d=new Image(1,1);d.src=f;d.onload=function(){d.onload=null;(h||k)()}};l.ac=function(f){var h=[],d=[D,J,H,K],a,j=t.k(),c;for(a=0;a<d[x];a++){c=P(j,d[a]+f,";");if(!N(c)){if(d[a]==H){c=X(c.split(f+".")[1],"|")[0];if(N(c))continue;c=f+"."+c}V(h,d[a]+c+";")}}return S(h.join("+"))}};Z.n=function(){var i=this;i.Y=[];i.hb=function(l){var g,t=i.Y,k;for(k=0;k<t.length;k++)g=l==t[k].q?t[k]:g;return g};i.Ob=function(l,g,t,k,p,f,h,d){var a=i.hb(l);if(w==a){a=new Z.n.Mb(l,g,t,k,p,f,h,d);V(i.Y,a)}else{a.Qa=g;a.Ab=t;a.zb=k;a.xb=p;a.Xa=f;a.yb=h;a.Za=d}return a}};Z.n.Lb=function(i,l,g,t,k,p){var f=this;f.Bb=i;f.Ba=l;f.D=g;f.Va=t;f.pb=k;f.qb=p;f.Ca=function(){return"&"+["utmt=item","tid="+S(f.Bb),"ipc="+S(f.Ba),"ipn="+S(f.D),"iva="+S(f.Va),"ipr="+S(f.pb),"iqt="+S(f.qb)].join("&utm")}};
+Z.n.Mb=function(i,l,g,t,k,p,f,h){var d=this;d.q=i;d.Qa=l;d.Ab=g;d.zb=t;d.xb=k;d.Xa=p;d.yb=f;d.Za=h;d.R=[];d.Nb=function(a,j,c,n,s){var b=d.gc(a),e=d.q;if(w==b)V(d.R,new Z.n.Lb(e,a,j,c,n,s));else{b.Bb=e;b.Ba=a;b.D=j;b.Va=c;b.pb=n;b.qb=s}};d.gc=function(a){var j,c=d.R,n;for(n=0;n<c.length;n++)j=a==c[n].Ba?c[n]:j;return j};d.Ca=function(){return"&"+["utmt=tran","id="+S(d.q),"st="+S(d.Qa),"to="+S(d.Ab),"tx="+S(d.zb),"sp="+S(d.xb),"ci="+S(d.Xa),"rg="+S(d.yb),"co="+S(d.Za)].join("&utmt")}};Z.Fb=function(i){function l(){var f,h,d;h="ShockwaveFlash";var a="$version",j=k.d?k.d.plugins:w;if(j&&j[x]>0)for(f=0;f<j[x]&&!d;f++){h=j[f];if(U(h.name,"Shockwave Flash"))d=h.description.split("Shockwave Flash ")[1]}else{h=h+"."+h;try{f=new ActiveXObject(h+".7");d=f.GetVariable(a)}catch(c){}if(!d)try{f=new ActiveXObject(h+".6");d="WIN 6,0,21,0";f.AllowScriptAccess="always";d=f.GetVariable(a)}catch(n){}if(!d)try{f=new ActiveXObject(h);d=f.GetVariable(a)}catch(s){}if(d){d=X(d.split(" ")[1],",");d=d[0]+
+"."+d[1]+" r"+d[2]}}return d?d:p}var g=i,t=g.e,k=this,p="-";k.V=t.screen;k.Sa=!k.V&&t.java?java.awt.Toolkit.getDefaultToolkit():w;k.d=t.navigator;k.W=p;k.xa=p;k.Wa=p;k.qa=p;k.pa=1;k.eb=p;k.bc=function(){var f;if(t.screen){k.W=k.V.width+"x"+k.V.height;k.xa=k.V.colorDepth+"-bit"}else if(k.Sa)try{f=k.Sa.getScreenSize();k.W=f.width+"x"+f.height}catch(h){}k.qa=W(k.d&&k.d.language?k.d.language:k.d&&k.d.browserLanguage?k.d.browserLanguage:p);k.pa=k.d&&k.d.javaEnabled()?1:0;k.eb=g.ha?l():p;k.Wa=S(g.a.characterSet?
+g.a.characterSet:g.a.charset?g.a.charset:p)};k.Ic=function(){return B+"utm"+["cs="+S(k.Wa),"sr="+k.W,"sc="+k.xa,"ul="+k.qa,"je="+k.pa,"fl="+S(k.eb)].join("&utm")};k.$b=function(){var f=g.a,h=t.history[x];f=k.d.appName+k.d.version+k.qa+k.d.platform+k.d.userAgent+k.pa+k.W+k.xa+(f[y]?f[y]:"")+(f.referrer?f.referrer:"");for(var d=f[x];h>0;)f+=h--^d++;return ia(f)}};Z.m=function(i,l,g,t){function k(d){var a="";d=W(d.split("://")[1]);if(U(d,"/")){d=d.split("/")[1];if(U(d,"?"))a=d.split("?")[0]}return a}function p(d){var a="";a=W(d.split("://")[1]);if(U(a,"/"))a=a.split("/")[0];return a}var f=t,h=this;h.c=i;h.rb=l;h.r=g;h.ic=function(d){var a=h.gb();return new Z.m.w(P(d,f.Ka+C,B),P(d,f.Na+C,B),P(d,f.Pa+C,B),h.Q(d,f.Ia,"(not set)"),h.Q(d,f.La,"(not set)"),h.Q(d,f.Oa,a&&!N(a.K)?T(a.K):w),h.Q(d,f.Ja,w))};h.jb=function(d){var a=p(d),j=k(d);if(U(a,"google")){d=d.split("?").join(B);
+if(U(d,B+f.oc+C))if(j==f.nc)return r}return v};h.gb=function(){var d,a=h.rb,j,c,n=f.T;if(!(N(a)||"0"==a||!U(a,"://")||h.jb(a))){d=p(a);for(j=0;j<n[x];j++){c=n[j];if(U(d,W(c.bb))){a=a.split("?").join(B);if(U(a,B+c.nb+C)){d=a.split(B+c.nb+C)[1];if(U(d,B))d=d.split(B)[0];return new Z.m.w(w,c.bb,w,"(organic)","organic",d,w)}}}}};h.Q=function(d,a,j){d=P(d,a+C,B);return j=!N(d)?T(d):!N(j)?j:"-"};h.uc=function(d){var a=f.ta,j=v,c;if(d&&"organic"==d.S){d=W(T(d.K));for(c=0;c<a[x];c++)j=j||W(a[c])==d}return j};
+h.hc=function(){var d="",a="";d=h.rb;if(!(N(d)||"0"==d||!U(d,"://")||h.jb(d))){d=d.split("://")[1];if(U(d,"/")){a=O(d,d.indexOf("/"));a=a.split("?")[0];d=W(d.split("/")[0])}if(0==d.indexOf("www."))d=O(d,4);return new Z.m.w(w,d,w,"(referral)","referral",w,a)}};h.Xb=function(d){var a="";if(f.ba){a=d&&d.hash?d.href.substring(d.href.indexOf("#")):"";a=""!=a?a+B:a}a+=d.search;return a};h.dc=function(){return new Z.m.w(w,"(direct)",w,"(direct)","(none)",w,w)};h.vc=function(d){var a=v,j,c=f.va;if(d&&"referral"==
+d.S){d=W(S(d.X));for(j=0;j<c[x];j++)a=a||U(d,W(c[j]))}return a};h.L=function(d){return w!=d&&d.mb()};h.cc=function(d,a){var j="",c="-",n,s=0,b,e,o=h.c;if(!d)return"";e=d.k();j=h.Xb(f.a[A]);if(f.z&&d.kb()){c=d.na();if(!N(c)&&!U(c,";")){d.Ga();return""}}c=P(e,J+o+".",";");n=h.ic(j);if(h.L(n)){j=P(j,f.Ma+C,B);if("1"==j&&!N(c))return""}if(!h.L(n)){n=h.gb();if(!N(c)&&h.uc(n))return""}if(!h.L(n)&&a){n=h.hc();if(!N(c)&&h.vc(n))return""}if(!h.L(n))if(N(c)&&a)n=h.dc();if(!h.L(n))return"";if(!N(c)){s=c.split(".");
+b=new Z.m.w;b.Zb(s.slice(4).join("."));b=W(b.Da())==W(n.Da());s=s[3]*1}if(!b||a){a=P(e,D+o+".",";");e=a.lastIndexOf(".");a=e>9?O(a,e+1)*1:0;s++;a=0==a?1:a;d.wb([o,h.r,a,s,n.Da()].join("."));d.Ga();return B+"utmcn=1"}else return B+"utmcr=1"}};
+Z.m.w=function(i,l,g,t,k,p,f){var h=this;h.q=i;h.X=l;h.ea=g;h.D=t;h.S=k;h.K=p;h.Ya=f;h.Da=function(){var d=[],a=[["cid",h.q],["csr",h.X],["gclid",h.ea],["ccn",h.D],["cmd",h.S],["ctr",h.K],["cct",h.Ya]],j,c;if(h.mb())for(j=0;j<a[x];j++)if(!N(a[j][1])){c=a[j][1].split("+").join("%20");c=c.split(" ").join("%20");V(d,"utm"+a[j][0]+C+c)}return d.join("|")};h.mb=function(){return!(N(h.q)&&N(h.X)&&N(h.ea))};h.Zb=function(d){var a=function(j){return T(P(d,"utm"+j+C,"|"))};h.q=a("cid");h.X=a("csr");h.ea=a("gclid");
+h.D=a("ccn");h.S=a("cmd");h.K=a("ctr");h.Ya=a("cct")}};Z.Ib=function(i,l,g,t){function k(j,c,n){var s;if(!N(n)){n=n.split(",");for(var b=0;b<n[x];b++){s=n[b];if(!N(s)){s=s.split(h);if(s[x]==4)c[s[0]]=[s[1],s[2],j]}}}}var p=this,f=l,h=C,d=i,a=t;p.O=g;p.sa="";p.p={};p.tc=function(){var j;j=X(P(p.O.k(),H+f+".",";"),f+".")[1];if(!N(j)){j=j.split("|");k(1,p.p,j[1]);p.sa=j[0];p.Z()}};p.Z=function(){p.Qb();var j=p.sa,c,n,s="";for(c in p.p)if((n=p.p[c])&&1===n[2])s+=c+h+n[0]+h+n[1]+h+1+",";N(s)||(j+="|"+s);if(N(j))p.O.Vb();else{p.O.Aa(f+"."+j);p.O.Fa()}};p.Ec=
+function(j){p.sa=j;p.Z()};p.Cc=function(j,c,n,s){if(1!=s&&2!=s&&3!=s)s=3;var b=v;if(c&&n&&j>0&&j<=d.ob){c=S(c);n=S(n);if(c[x]+n[x]<=64){p.p[j]=[c,n,s];p.Z();b=r}}return b};p.mc=function(j){if((j=p.p[j])&&1===j[2])return j[1]};p.Ub=function(j){var c=p.p;if(c[j]){delete c[j];p.Z()}};p.Qb=function(){a._clearKey(8);a._clearKey(9);a._clearKey(11);var j=p.p,c,n;for(n in j)if(c=j[n]){a._setKey(8,n,c[0]);a._setKey(9,n,c[1]);(c=c[2])&&3!=c&&a._setKey(11,n,""+c)}}};Z.N=function(){function i(m,q,u,z){if(w==f[m])f[m]={};if(w==f[m][q])f[m][q]=[];f[m][q][u]=z}function l(m,q){if(w!=f[m]&&w!=f[m][q]){f[m][q]=w;q=r;var u;for(u=0;u<a[x];u++)if(w!=f[m][a[u]]){q=v;break}if(q)f[m]=w}}function g(m){var q="",u=v,z,M;for(z=0;z<a[x];z++){M=m[a[z]];if(w!=M){if(u)q+=a[z];q+=t(M);u=v}else u=r}return q}function t(m){var q=[],u,z;for(z=0;z<m[x];z++)if(w!=m[z]){u="";if(z!=o&&w==m[z-1])u+=z.toString()+s;u+=k(m[z]);V(q,u)}return j+q.join(n)+c}function k(m){var q="",u,z,M;for(u=0;u<
+m[x];u++){z=m.charAt(u);M=e[z];q+=w!=M?M:z}return q}var p=this,f={},h="k",d="v",a=[h,d],j="(",c=")",n="*",s="!",b="'",e={};e[b]="'0";e[c]="'1";e[n]="'2";e[s]="'3";var o=1;p.qc=function(m){return w!=f[m]};p.G=function(){var m="",q;for(q in f)if(w!=f[q])m+=q.toString()+g(f[q]);return m};p.Ac=function(m){if(m==w)return p.G();var q=m.G(),u;for(u in f)if(w!=f[u]&&!m.qc(u))q+=u.toString()+g(f[u]);return q};p._setKey=function(m,q,u){if(typeof u!="string")return v;i(m,h,q,u);return r};p._setValue=function(m,
+q,u){if(typeof u!="number"&&(w==Number||!(u instanceof Number))||Math.round(u)!=u||u==NaN||u==Infinity)return v;i(m,d,q,u.toString());return r};p._getKey=function(m,q){return w!=f[m]&&w!=f[m][h]?f[m][h][q]:w};p._getValue=function(m,q){return w!=f[m]&&w!=f[m][d]?f[m][d][q]:w};p._clearKey=function(m){l(m,h)};p._clearValue=function(m){l(m,d)}};Z.Jb=function(i,l){var g=this;g.Qc=l;g.xc=i;g._trackEvent=function(t,k,p){return l._trackEvent(g.xc,t,k,p)}};Z.aa=function(i,l){function g(){if("auto"==c.b){var b=c.a.domain;if("www."==O(b,0,4))b=O(b,4);c.b=b}c.b=W(c.b)}function t(){var b=c.b,e=b.indexOf("www.google.")*b.indexOf(".google.")*b.indexOf("google.");return e||"/"!=c.h||b.indexOf("google.org")>-1}function k(b,e,o){if(N(b)||N(e)||N(o))return"-";b=P(b,D+a.c+".",e);if(!N(b)){b=b.split(".");b[5]=b[5]?b[5]*1+1:1;b[3]=b[4];b[4]=o;b=b.join(".")}return b}function p(){return"file:"!=c.a[A].protocol&&t()}function f(b){if(!b||""==b)return"";for(;ea(b.charAt(0));)b=
+O(b,1);for(;ea(b.charAt(b[x]-1));)b=O(b,0,b[x]-1);return b}function h(b,e,o,m){if(!N(b())){e(m?T(b()):b());U(b(),";")||o()}}function d(b){var e,o=""!=b&&c.a[A].host!=b;if(o)for(e=0;e<c.t[x];e++)o=o&&fa(W(b),W(c.t[e]))==-1;return o}var a=this,j=w,c=new Z.Gb,n=v,s=w;a.e=window;a.r=Math.round((new Date).getTime()/1E3);a.s=i||"UA-XXXXX-X";a.ab=c.a.referrer;a.ia=w;a.f=w;a.B=w;a.F=v;a.A=w;a.Ua="";a.g=w;a.cb=w;a.c=w;a.i=w;c.o=l?S(l):w;a.wc=function(){var b=v;if(a.B)b=a.B.match(/^[0-9a-z-_.]{10,1200}$/i);
+return b};a.jc=function(){return Y()^a.A.$b()&2147483647};a.ec=function(){if(!c.b||""==c.b||"none"==c.b){c.b="";return 1}g();return c.Ra?ia(c.b):1};a.Yb=function(b,e){if(N(b))b="-";else{e+=c.h&&"/"!=c.h?c.h:"";e=b.indexOf(e);b=e>=0&&e<=8?"0":"["==b.charAt(0)&&"]"==b.charAt(b[x]-1)?"-":b}return b};a.wa=function(b){var e="",o=c.a;e+=c.fa?a.A.Ic():"";e+=c.da?a.Ua:"";e+=c.ga&&!N(o.title)?"&utmdt="+S(o.title):"";e+="&utmhid="+ja()+"&utmr="+S(a.ia)+"&utmp="+S(a.Bc(b));return e};a.Bc=function(b){var e=c.a[A];
+return b=w!=b&&""!=b?S(b,r):S(e.pathname+e.search,r)};a.Lc=function(b){if(a.J()){var e="";if(a.g!=w&&a.g.G()[x]>0)e+="&utme="+S(a.g.G());e+=a.wa(b);j.H(e,a.s,a.c)}};a.Tb=function(){var b=new Z.$(c);return b.ua(a.c)?b.Hc():w};a._getLinkerUrl=function(b,e){var o=b.split("#"),m=b,q=a.Tb();if(q)if(e&&1>=o[x])m+="#"+q;else if(!e||1>=o[x])if(1>=o[x])m+=(U(b,"?")?B:"?")+q;else m=o[0]+(U(b,"?")?B:"?")+q+"#"+o[1];return m};a.Fc=function(){var b;if(a.wc()){a.i.Dc(a.B);a.i.Oc();Z._gasoDomain=c.b;Z._gasoCPath=
+c.h;b=c.a.createElement("script");b.type="text/javascript";b.id="_gasojs";b.src="https://www.google.com/analytics/reporting/overlay_js?gaso="+a.B+B+Y();c.a.getElementsByTagName("head")[0].appendChild(b)}};a.pc=function(){var b=a.r,e=a.i,o=e.k(),m=a.c+"",q=c.e,u=q?q.gaGlobal:w,z,M=U(o,D+m+"."),la=U(o,E+m),ma=U(o,G+m),F,I=[],R="",ha=v;o=N(o)?"":o;if(c.z){z=c.a[A]&&c.a[A].hash?c.a[A].href.substring(c.a[A].href.indexOf("#")):"";if(c.ba&&!N(z))R=z+B;R+=c.a[A].search;if(!N(R)&&U(R,D)){e.zc(R);e.kb()||e.Sb();
+F=e.ja()}h(e.ma,e.vb,e.Eb,true);h(e.la,e.Aa,e.Fa)}if(N(F))if(M)if(!la||!ma){F=k(o,";",b);a.F=r}else{F=P(o,D+m+".",";");I=X(P(o,E+m,";"),".")}else{F=ga([m,a.jc(),b,b,b,1],".");ha=a.F=r}else if(N(e.C())||N(e.ka())){F=k(R,B,b);a.F=r}else{I=X(e.C(),".");m=I[0]}F=F.split(".");if(q&&u&&u.dh==m&&!c.o){F[4]=u.sid?u.sid:F[4];if(ha){F[3]=u.sid?u.sid:F[4];if(u.vid){b=u.vid.split(".");F[1]=b[0];F[2]=b[1]}}}e.tb(F.join("."));I[0]=m;I[1]=I[1]?I[1]:0;I[2]=w!=I[2]?I[2]:c.Jc;I[3]=I[3]?I[3]:F[4];e.ya(I.join("."));
+e.ub(m);N(e.lc())||e.za(e.P());e.Cb();e.Ea();e.Db()};a.rc=function(){j=new Z.Kb(c)};a._initData=function(){var b;if(!n){if(!a.A){a.A=new Z.Fb(c);a.A.bc()}a.c=a.ec();a.i=new Z.$(c);a.g=new Z.N;s=new Z.Ib(c,a.c,a.i,a.g);a.rc()}if(p()){a.pc();s.tc()}if(!n){if(p()){a.ia=a.Yb(a.ab,c.a.domain);if(c.da){b=new Z.m(a.c,a.ia,a.r,c);a.Ua=b.cc(a.i,a.F)}}a.cb=new Z.N;n=r}Z.ib||a.sc()};a._visitCode=function(){a._initData();var b=P(a.i.k(),D+a.c+".",";");b=b.split(".");return b[x]<4?"":b[1]};a._cookiePathCopy=function(b){a._initData();
+a.i&&a.i.Nc(a.c,b)};a.sc=function(){var b=c.a[A].hash;if(b&&1==b.indexOf("gaso="))b=P(b,"gaso=",B);else b=(b=c.e.name)&&0<=b.indexOf("gaso=")?P(b,"gaso=",B):P(a.i.k(),L,";");if(b[x]>=10){a.B=b;a.Fc()}Z.ib=r};a.J=function(){return a._visitCode()%1E4<c.U*100};a.Gc=function(){var b,e,o=c.a.links;if(!c.lb){b=c.a.domain;if("www."==O(b,0,4))b=O(b,4);c.t.push("."+b)}for(b=0;b<o[x]&&(c.ra==-1||b<c.ra);b++){e=o[b];if(d(e.host))if(!e.gatcOnclick){e.gatcOnclick=e.onclick?e.onclick:a.yc;e.onclick=function(m){var q=
+!this.target||this.target=="_self"||this.target=="_top"||this.target=="_parent";q=q&&!a.Rb(m);a.Mc(m,this,q);return q?v:this.gatcOnclick?this.gatcOnclick(m):r}}}};a.yc=function(){};a._trackPageview=function(b){if(p()){a._initData();c.t&&a.Gc();a.Lc(b);a.F=v}};a._trackTrans=function(){var b=a.c,e=[],o,m,q;a._initData();if(a.f&&a.J()){for(o=0;o<a.f.Y[x];o++){m=a.f.Y[o];V(e,m.Ca());for(q=0;q<m.R[x];q++)V(e,m.R[q].Ca())}for(o=0;o<e[x];o++)j.H(e[o],a.s,b,r)}};a._setTrans=function(){var b=c.a,e,o,m;b=b.getElementById?
+b.getElementById("utmtrans"):b.utmform&&b.utmform.utmtrans?b.utmform.utmtrans:w;a._initData();if(b&&b.value){a.f=new Z.n;m=b.value.split("UTM:");c.u=!c.u||""==c.u?"|":c.u;for(b=0;b<m[x];b++){m[b]=f(m[b]);e=m[b].split(c.u);for(o=0;o<e[x];o++)e[o]=f(e[o]);if("T"==e[0])a._addTrans(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]);else"I"==e[0]&&a._addItem(e[1],e[2],e[3],e[4],e[5],e[6])}}};a._addTrans=function(b,e,o,m,q,u,z,M){a.f=a.f?a.f:new Z.n;return a.f.Ob(b,e,o,m,q,u,z,M)};a._addItem=function(b,e,o,m,q,u){var z;
+a.f=a.f?a.f:new Z.n;(z=a.f.hb(b))||(z=a._addTrans(b,"","","","","","",""));z.Nb(e,o,m,q,u)};a._setVar=function(b){if(b&&""!=b&&t()){a._initData();s.Ec(S(b));a.J()&&j.H("&utmt=var",a.s,a.c)}};a._setCustomVar=function(b,e,o,m){a._initData();return s.Cc(b,e,o,m)};a._deleteCustomVar=function(b){a._initData();s.Ub(b)};a._getVisitorCustomVar=function(b){a._initData();return s.mc(b)};a._setMaxCustomVariables=function(b){c.ob=b};a._link=function(b,e){if(c.z&&b){a._initData();c.a[A].href=a._getLinkerUrl(b,
+e)}};a._linkByPost=function(b,e){if(c.z&&b&&b.action){a._initData();b.action=a._getLinkerUrl(b.action,e)}};a._setXKey=function(b,e,o){a.g._setKey(b,e,o)};a._setXValue=function(b,e,o){a.g._setValue(b,e,o)};a._getXKey=function(b,e){return a.g._getKey(b,e)};a._getXValue=function(b,e){return a.g.getValue(b,e)};a._clearXKey=function(b){a.g._clearKey(b)};a._clearXValue=function(b){a.g._clearValue(b)};a._createXObj=function(){a._initData();return new Z.N};a._sendXEvent=function(b){var e="";a._initData();
+if(a.J()){e+="&utmt=event&utme="+S(a.g.Ac(b))+a.wa();j.H(e,a.s,a.c,v,r)}};a._createEventTracker=function(b){a._initData();return new Z.Jb(b,a)};a._trackEvent=function(b,e,o,m){var q=a.cb;if(w!=b&&w!=e&&""!=b&&""!=e){q._clearKey(5);q._clearValue(5);(b=q._setKey(5,1,b)&&q._setKey(5,2,e)&&(w==o||q._setKey(5,3,o))&&(w==m||q._setValue(5,1,m)))&&a._sendXEvent(q)}else b=v;return b};a.Mc=function(b,e,o){a._initData();if(a.J()){var m=new Z.N;m._setKey(6,1,e.href);var q=o?function(){a.db(b,e)}:w;j.H("&utmt=event&utme="+
+S(m.G())+a.wa(),a.s,a.c,v,r,q);if(o){var u=this;c.e.setTimeout(function(){u.db(b,e)},500)}}};a.db=function(b,e){if(!b)b=c.e.event;var o=r;if(e.gatcOnclick)o=e.gatcOnclick(b);if(o||typeof o=="undefined")if(!e.target||e.target=="_self")c.e[A]=e.href;else if(e.target=="_top")c.e.top.document[A]=e.href;else if(e.target=="_parent")c.e.parent.document[A]=e.href};a.Rb=function(b){if(!b)b=c.e.event;var e=b.shiftKey||b.ctrlKey||b.altKey;if(!e)if(b.modifiers&&c.e.Event)e=b.modifiers&c.e.Event.CONTROL_MASK||
+b.modifiers&c.e.Event.SHIFT_MASK||b.modifiers&c.e.Event.ALT_MASK;return e};a.Pc=function(){return c};a._setDomainName=function(b){c.b=b};a._addOrganic=function(b,e,o){c.T.splice(o?0:c.T.length,0,new Z.Ha(b,e))};a._clearOrganic=function(){c.T=[]};a._addIgnoredOrganic=function(b){V(c.ta,b)};a._clearIgnoredOrganic=function(){c.ta=[]};a._addIgnoredRef=function(b){V(c.va,b)};a._clearIgnoredRef=function(){c.va=[]};a._setAllowHash=function(b){c.Ra=b?1:0};a._setCampaignTrack=function(b){c.da=b?1:0};a._setClientInfo=
+function(b){c.fa=b?1:0};a._getClientInfo=function(){return c.fa};a._setCookiePath=function(b){c.h=b};a._setTransactionDelim=function(b){c.u=b};a._setCookieTimeout=function(b){a._setCampaignCookieTimeout(b*1E3)};a._setCampaignCookieTimeout=function(b){c.Ta=b};a._setDetectFlash=function(b){c.ha=b?1:0};a._getDetectFlash=function(){return c.ha};a._setDetectTitle=function(b){c.ga=b?1:0};a._getDetectTitle=function(){return c.ga};a._setLocalGifPath=function(b){c.oa=b};a._getLocalGifPath=function(){return c.oa};
+a._setLocalServerMode=function(){c.I=0};a._setRemoteServerMode=function(){c.I=1};a._setLocalRemoteServerMode=function(){c.I=2};a._getServiceMode=function(){return c.I};a._setSampleRate=function(b){c.U=b};a._setSessionTimeout=function(b){a._setSessionCookieTimeout(b*1E3)};a._setSessionCookieTimeout=function(b){c.sb=b};a._setAllowLinker=function(b){c.z=b?1:0};a._setAllowAnchor=function(b){c.ba=b?1:0};a._setCampNameKey=function(b){c.Ia=b};a._setCampContentKey=function(b){c.Ja=b};a._setCampIdKey=function(b){c.Ka=
+b};a._setCampMediumKey=function(b){c.La=b};a._setCampNOKey=function(b){c.Ma=b};a._setCampSourceKey=function(b){c.Na=b};a._setCampTermKey=function(b){c.Oa=b};a._setCampCIdKey=function(b){c.Pa=b};a._getAccount=function(){return a.s};a._setAccount=function(b){a.s=b};a._setNamespace=function(b){c.o=b?S(b):w};a._getVersion=function(){return ca};a._setAutoTrackOutbound=function(b){c.t=[];if(b)c.t=b};a._setTrackOutboundSubdomains=function(b){c.lb=b};a._setHrefExamineLimit=function(b){c.ra=b};a._setReferrerOverride=
+function(b){a.ab=b};a._setCookiePersistence=function(b){a._setVisitorCookieTimeout(b)};a._setVisitorCookieTimeout=function(b){c.v=b}};Z._getTracker=function(i,l){return new Z.aa(i,l)};var ka=v,$={ca:{},_createAsyncTracker:function(i,l){l=l||"";i=new Z.aa(i);$.ca[l]=i;ka=r;return i},_getAsyncTracker:function(i){i=i||"";var l=$.ca[i];if(!l){l=new Z.aa;$.ca[i]=l;ka=r}return l},push:function(){for(var i=arguments,l=0,g=0;g<i[x];g++)try{if(typeof i[g]==="function")i[g]();else{var t="",k=i[g][0],p=k.lastIndexOf(".");if(p>0){t=O(k,0,p);k=O(k,p+1)}var f=$._getAsyncTracker(t);f[k].apply(f,i[g].slice(1))}}catch(h){l++}return l}};window[aa]=Z;function na(){var i=window[ba],l=v;if(i&&typeof i.push=="function"){l=i.constructor==Array;if(!l)return}window[ba]=$;l&&$.push.apply($,i)}na();})()
+
+
+
+var pageTracker = _gat._getTracker("UA-3940914-2");
+pageTracker._initData();
+pageTracker._trackPageview();
+
+
+
+if(!(htr('hittail_ok'))){htc=document.referrer;htz=htl(document.location.href);if(htz!=htl(htc)&&(htc!='')){if(htw(htc)){kw=htq(htc);htAdt=htAdTk(document.location.href);document.write('<img src="http://tracking.hittail.com/mlt.png?ref='+escape(htc)+'&kw='+kw+'&eng='+htm(htc)+'&p='+htF(htc)+'&n='+htn(kw)+'&adt='+htAdt+'" width="1" height="1"/>');}}hty('hittail_ok','1','','/',document.domain,'');}function htw(hte){var htd=true;var htj=new Array("http://private.","http://internal.","http://intranet.","login=","/login","login.","logon=","/logon","logon.","/signin","signin=","signin.","signon","/admin/","mail.","/mail/","/email/","webmail","mailbox","https://","cache:","http://www.blogger.com","http://localhost","http://client.","http://docs.","http://timebase.","http://www2.blogger.","http://www.typepad.com/t/app/","http://www.typepad.com/t/comments","http://blockedReferrer");for(i=0;i<htj.length;i++){if(hte.search(htj[i])> -1){htd=false;return htd;}}var htE=/https?:\/\/(www\.|\d+\.)?hittail\.com/;var hto=/https?:\/\/(www\.|\d+\.)?mylongtail\.com/;if(hte.search(htE)> -1||hte.search(hto)> -1){htd=false;}return htd;};function htk(hta){return unescape(hta.replace(/\+/g," "));};function htm(url){var htH=/(http:\/\/)([^\/]*?)(\/)/;htH.test(url);hti=RegExp.$2;return hti;};function htq(url){var htG=/(\?|&|&amp;|;){1}(q|p|query|t|w|search|as_q|wd){1}=(.[^&=]*)=?/i;htG.test(url);kw=htk(RegExp.$3);if(kw.indexOf('cache:')>=0||kw.indexOf('http://')>=0||kw.indexOf('invocationType')>=0|| !isNaN(kw)){kw='';}else{kw=htD(kw);}return kw;};function htD(hta){hta=hta.replace(/[^\w #\.\-^\u00c0-\u00ff]/g,'');return hta;};function htF(url){p=0;htI=/\.google\./;if(htI.test(url)){htJ=/google(.*?)(start=)([0-9]+)/;htJ.test(url);p=RegExp.$3;if(p!=''){p=p/10;}else{p=1;}}if(p==0||p==''){hts=/\.yahoo\./;if(hts.test(url)){htt=/yahoo(.*?)b=([0-9]+)/;htt.test(url);p=RegExp.$2;if(p!=''){p=(p-1)/10+1;}else{p=1;}}}if(p==0||p==''){htg=/msn|live\.com/;if(htg.test(url)){htp=/msn|live\.com(.*?)(\?|&)first=([0-9]+)/;htp.test(url);p=RegExp.$3;if(p!=''){p=(p-1)/10+1;}else{p=1;}}}if(p==0||p==''){htg=/ask\.com/;if(htg.test(url)){htB=/ask(.*?)(\?|&)page=([0-9]+)/;htB.test(url);p=RegExp.$3;if(p!=''){p=(p-1)/10;}else{p=1;}}}return p;};function htn(hta){hta=hta.replace(/^\s+|\s+$/g,'');var htv=hta.split(/\s/);w=htv.length;return w;};function hty(name,value,expires,htf,domain,hth){var htx=name+"="+escape(value)+((htf)?"; htf="+htf:"")+((domain)?"; domain="+domain:"")+((hth)?"; hth":"");document.cookie=htx;};function htr(name){var dc=document.cookie;var prefix=name+"=";var htb=dc.indexOf("; "+prefix);if(htb== -1){htb=dc.indexOf(prefix);if(htb!=0)return null;}else htb+=2;var end=document.cookie.indexOf(";",htb);if(end== -1)end=dc.length;return unescape(dc.substring(htb+prefix.length,end));};function htl(url){var htb,end;htb=url.indexOf('//')+2;if(url.indexOf('/',8)){end=url.indexOf('/',8);}else{end=url.length}return url.substring(htb,end);};function htAdTk(url)
+
+{if ( (url.indexOf('gclid') > 0) || (url.indexOf('ysmkey') > 0) || (url.indexOf('OVRAW') > 0) || (url.indexOf('OVKEY') > 0) ){ad = 1;}else{ad = 0;}return ad;}
+
+
+</script>
+
+
+<script id="twitter" type="x">
+//<![CDATA[
+var matches,url,path,domain;url=document.location.toString();try{domain=url.match(/https?:\/\/[^\/]+/);if(matches=url.match(/(.+?)#(.+)/)){url=matches[1];path=matches[2];if(path){var arr=path.split(/\?/);path=arr[0];var params=arr[1];path=path.replace(/^\//,"");var redirect_url=[domain,path].join("/");if(params){redirect_url=[redirect_url,params].join("?")}document.location=redirect_url}}}catch(err){};
+//]]>
+
+
+
+//<![CDATA[
+var page={};var onCondition=function(D,C,A,B){D=D;A=A?Math.min(A,5):5;B=B||100;if(D()){C()}else{if(A>1){setTimeout(function(){onCondition(D,C,A-1,B)},B)}}};
+//]]>
+
+
+
+//<![CDATA[
+if (window.top !== window.self) {document.write = "";window.top.location = window.self.location; setTimeout(function(){document.body.innerHTML='';},1);window.self.onload=function(evt){document.body.innerHTML='';};}
+//]]>
+
+
+
+ function showFlashNotice() {
+ var notification = (new InfoNotification());
+ notification.setMessage("Your account has been confirmed. Thanks!");
+
+
+ notification.show();
+ }
+
+ if (window.attachEvent) {
+ window.attachEvent('onload', showFlashNotice)
+ } else {
+ window.addEventListener('load', showFlashNotice, false);
+ }
+
+/*
+ * jQuery JavaScript Library v1.3
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-01-13 12:50:31 -0500 (Tue, 13 Jan 2009)
+ * Revision: 6104
+ */
+(function(){var l=this,g,x=l.jQuery,o=l.$,n=l.jQuery=l.$=function(D,E){return new n.fn.init(D,E)},C=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;n.fn=n.prototype={init:function(D,G){D=D||document;if(D.nodeType){this[0]=D;this.length=1;this.context=D;return this}if(typeof D==="string"){var F=C.exec(D);if(F&&(F[1]||!G)){if(F[1]){D=n.clean([F[1]],G)}else{var H=document.getElementById(F[3]);if(H){if(H.id!=F[3]){return n().find(D)}var E=n(H);E.context=document;E.selector=D;return E}D=[]}}else{return n(G).find(D)}}else{if(n.isFunction(D)){return n(document).ready(D)}}if(D.selector&&D.context){this.selector=D.selector;this.context=D.context}return this.setArray(n.makeArray(D))},selector:"",jquery:"1.3",size:function(){return this.length},get:function(D){return D===g?n.makeArray(this):this[D]},pushStack:function(E,G,D){var F=n(E);F.prevObject=this;F.context=this.context;if(G==="find"){F.selector=this.selector+(this.selector?" ":"")+D}else{if(G){F.selector=this.selector+"."+G+"("+D+")"}}return F},setArray:function(D){this.length=0;Array.prototype.push.apply(this,D);return this},each:function(E,D){return n.each(this,E,D)},index:function(D){return n.inArray(D&&D.jquery?D[0]:D,this)},attr:function(E,G,F){var D=E;if(typeof E==="string"){if(G===g){return this[0]&&n[F||"attr"](this[0],E)}else{D={};D[E]=G}}return this.each(function(H){for(E in D){n.attr(F?this.style:this,E,n.prop(this,D[E],F,H,E))}})},css:function(D,E){if((D=="width"||D=="height")&&parseFloat(E)<0){E=g}return this.attr(D,E,"curCSS")},text:function(E){if(typeof E!=="object"&&E!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(E))}var D="";n.each(E||this,function(){n.each(this.childNodes,function(){if(this.nodeType!=8){D+=this.nodeType!=1?this.nodeValue:n.fn.text([this])}})});return D},wrapAll:function(D){if(this[0]){var E=n(D,this[0].ownerDocument).clone();if(this[0].parentNode){E.insertBefore(this[0])}E.map(function(){var F=this;while(F.firstChild){F=F.firstChild}return F}).append(this)}return this},wrapInner:function(D){return this.each(function(){n(this).contents().wrapAll(D)})},wrap:function(D){return this.each(function(){n(this).wrapAll(D)})},append:function(){return this.domManip(arguments,true,function(D){if(this.nodeType==1){this.appendChild(D)}})},prepend:function(){return this.domManip(arguments,true,function(D){if(this.nodeType==1){this.insertBefore(D,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(D){this.parentNode.insertBefore(D,this)})},after:function(){return this.domManip(arguments,false,function(D){this.parentNode.insertBefore(D,this.nextSibling)})},end:function(){return this.prevObject||n([])},push:[].push,find:function(D){if(this.length===1&&!/,/.test(D)){var F=this.pushStack([],"find",D);F.length=0;n.find(D,this[0],F);return F}else{var E=n.map(this,function(G){return n.find(D,G)});return this.pushStack(/[^+>] [^+>]/.test(D)?n.unique(E):E,"find",D)}},clone:function(E){var D=this.map(function(){if(!n.support.noCloneEvent&&!n.isXMLDoc(this)){var H=this.cloneNode(true),G=document.createElement("div");G.appendChild(H);return n.clean([G.innerHTML])[0]}else{return this.cloneNode(true)}});var F=D.find("*").andSelf().each(function(){if(this[h]!==g){this[h]=null}});if(E===true){this.find("*").andSelf().each(function(H){if(this.nodeType==3){return}var G=n.data(this,"events");for(var J in G){for(var I in G[J]){n.event.add(F[H],J,G[J][I],G[J][I].data)}}})}return D},filter:function(D){return this.pushStack(n.isFunction(D)&&n.grep(this,function(F,E){return D.call(F,E)})||n.multiFilter(D,n.grep(this,function(E){return E.nodeType===1})),"filter",D)},closest:function(D){var E=n.expr.match.POS.test(D)?n(D):null;return this.map(function(){var F=this;while(F&&F.ownerDocument){if(E?E.index(F)>-1:n(F).is(D)){return F}F=F.parentNode}})},not:function(D){if(typeof D==="string"){if(f.test(D)){return this.pushStack(n.multiFilter(D,this,true),"not",D)}else{D=n.multiFilter(D,this)}}var E=D.length&&D[D.length-1]!==g&&!D.nodeType;return this.filter(function(){return E?n.inArray(this,D)<0:this!=D})},add:function(D){return this.pushStack(n.unique(n.merge(this.get(),typeof D==="string"?n(D):n.makeArray(D))))},is:function(D){return !!D&&n.multiFilter(D,this).length>0},hasClass:function(D){return !!D&&this.is("."+D)},val:function(J){if(J===g){var D=this[0];if(D){if(n.nodeName(D,"option")){return(D.attributes.value||{}).specified?D.value:D.text}if(n.nodeName(D,"select")){var H=D.selectedIndex,K=[],L=D.options,G=D.type=="select-one";if(H<0){return null}for(var E=G?H:0,I=G?H+1:L.length;E<I;E++){var F=L[E];if(F.selected){J=n(F).val();if(G){return J}K.push(J)}}return K}return(D.value||"").replace(/\r/g,"")}return g}if(typeof J==="number"){J+=""}return this.each(function(){if(this.nodeType!=1){return}if(n.isArray(J)&&/radio|checkbox/.test(this.type)){this.checked=(n.inArray(this.value,J)>=0||n.inArray(this.name,J)>=0)}else{if(n.nodeName(this,"select")){var M=n.makeArray(J);n("option",this).each(function(){this.selected=(n.inArray(this.value,M)>=0||n.inArray(this.text,M)>=0)});if(!M.length){this.selectedIndex=-1}}else{this.value=J}}})},html:function(D){return D===g?(this[0]?this[0].innerHTML:null):this.empty().append(D)},replaceWith:function(D){return this.after(D).remove()},eq:function(D){return this.slice(D,+D+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(D){return this.pushStack(n.map(this,function(F,E){return D.call(F,E,F)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=n.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild,D=this.length>1?I.cloneNode(true):I;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),G>0?D.cloneNode(true):I)}}if(F){n.each(F,y)}}return this;function K(N,O){return M&&n.nodeName(N,"table")&&n.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};n.fn.init.prototype=n.fn;function y(D,E){if(E.src){n.ajax({url:E.src,async:false,dataType:"script"})}else{n.globalEval(E.text||E.textContent||E.innerHTML||"")}if(E.parentNode){E.parentNode.removeChild(E)}}function e(){return +new Date}n.extend=n.fn.extend=function(){var I=arguments[0]||{},G=1,H=arguments.length,D=false,F;if(typeof I==="boolean"){D=I;I=arguments[1]||{};G=2}if(typeof I!=="object"&&!n.isFunction(I)){I={}}if(H==G){I=this;--G}for(;G<H;G++){if((F=arguments[G])!=null){for(var E in F){var J=I[E],K=F[E];if(I===K){continue}if(D&&K&&typeof K==="object"&&!K.nodeType){I[E]=n.extend(D,J||(K.length!=null?[]:{}),K)}else{if(K!==g){I[E]=K}}}}}return I};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,p=document.defaultView||{},r=Object.prototype.toString;n.extend({noConflict:function(D){l.$=o;if(D){l.jQuery=x}return n},isFunction:function(D){return r.call(D)==="[object Function]"},isArray:function(D){return r.call(D)==="[object Array]"},isXMLDoc:function(D){return D.documentElement&&!D.body||D.tagName&&D.ownerDocument&&!D.ownerDocument.body},globalEval:function(F){F=n.trim(F);if(F){var E=document.getElementsByTagName("head")[0]||document.documentElement,D=document.createElement("script");D.type="text/javascript";if(n.support.scriptEval){D.appendChild(document.createTextNode(F))}else{D.text=F}E.insertBefore(D,E.firstChild);E.removeChild(D)}},nodeName:function(E,D){return E.nodeName&&E.nodeName.toUpperCase()==D.toUpperCase()},each:function(F,J,E){var D,G=0,H=F.length;if(E){if(H===g){for(D in F){if(J.apply(F[D],E)===false){break}}}else{for(;G<H;){if(J.apply(F[G++],E)===false){break}}}}else{if(H===g){for(D in F){if(J.call(F[D],D,F[D])===false){break}}}else{for(var I=F[0];G<H&&J.call(I,G,I)!==false;I=F[++G]){}}}return F},prop:function(G,H,F,E,D){if(n.isFunction(H)){H=H.call(G,E)}return typeof H==="number"&&F=="curCSS"&&!b.test(D)?H+"px":H},className:{add:function(D,E){n.each((E||"").split(/\s+/),function(F,G){if(D.nodeType==1&&!n.className.has(D.className,G)){D.className+=(D.className?" ":"")+G}})},remove:function(D,E){if(D.nodeType==1){D.className=E!==g?n.grep(D.className.split(/\s+/),function(F){return !n.className.has(E,F)}).join(" "):""}},has:function(E,D){return n.inArray(D,(E.className||E).toString().split(/\s+/))>-1}},swap:function(G,F,H){var D={};for(var E in F){D[E]=G.style[E];G.style[E]=F[E]}H.call(G);for(var E in F){G.style[E]=D[E]}},css:function(F,D,H){if(D=="width"||D=="height"){var J,E={position:"absolute",visibility:"hidden",display:"block"},I=D=="width"?["Left","Right"]:["Top","Bottom"];function G(){J=D=="width"?F.offsetWidth:F.offsetHeight;var L=0,K=0;n.each(I,function(){L+=parseFloat(n.curCSS(F,"padding"+this,true))||0;K+=parseFloat(n.curCSS(F,"border"+this+"Width",true))||0});J-=Math.round(L+K)}if(n(F).is(":visible")){G()}else{n.swap(F,E,G)}return Math.max(0,J)}return n.curCSS(F,D,H)},curCSS:function(H,E,F){var K,D=H.style;if(E=="opacity"&&!n.support.opacity){K=n.attr(D,"opacity");return K==""?"1":K}if(E.match(/float/i)){E=v}if(!F&&D&&D[E]){K=D[E]}else{if(p.getComputedStyle){if(E.match(/float/i)){E="float"}E=E.replace(/([A-Z])/g,"-$1").toLowerCase();var L=p.getComputedStyle(H,null);if(L){K=L.getPropertyValue(E)}if(E=="opacity"&&K==""){K="1"}}else{if(H.currentStyle){var I=E.replace(/\-(\w)/g,function(M,N){return N.toUpperCase()});K=H.currentStyle[E]||H.currentStyle[I];if(!/^\d+(px)?$/i.test(K)&&/^\d/.test(K)){var G=D.left,J=H.runtimeStyle.left;H.runtimeStyle.left=H.currentStyle.left;D.left=K||0;K=D.pixelLeft+"px";D.left=G;H.runtimeStyle.left=J}}}}return K},clean:function(E,J,H){J=J||document;if(typeof J.createElement==="undefined"){J=J.ownerDocument||J[0]&&J[0].ownerDocument||document}if(!H&&E.length===1&&typeof E[0]==="string"){var G=/^<(\w+)\s*\/?>$/.exec(E[0]);if(G){return[J.createElement(G[1])]}}var F=[],D=[],K=J.createElement("div");n.each(E,function(O,Q){if(typeof Q==="number"){Q+=""}if(!Q){return}if(typeof Q==="string"){Q=Q.replace(/(<(\w+)[^>]*?)\/>/g,function(S,T,R){return R.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?S:T+"></"+R+">"});var N=n.trim(Q).toLowerCase();var P=!N.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!N.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||N.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!N.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!N.indexOf("<td")||!N.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!N.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!n.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];K.innerHTML=P[1]+Q+P[2];while(P[0]--){K=K.lastChild}if(!n.support.tbody){var M=!N.indexOf("<table")&&N.indexOf("<tbody")<0?K.firstChild&&K.firstChild.childNodes:P[1]=="<table>"&&N.indexOf("<tbody")<0?K.childNodes:[];for(var L=M.length-1;L>=0;--L){if(n.nodeName(M[L],"tbody")&&!M[L].childNodes.length){M[L].parentNode.removeChild(M[L])}}}if(!n.support.leadingWhitespace&&/^\s/.test(Q)){K.insertBefore(J.createTextNode(Q.match(/^\s*/)[0]),K.firstChild)}Q=n.makeArray(K.childNodes)}if(Q.nodeType){F.push(Q)}else{F=n.merge(F,Q)}});if(H){for(var I=0;F[I];I++){if(n.nodeName(F[I],"script")&&(!F[I].type||F[I].type.toLowerCase()==="text/javascript")){D.push(F[I].parentNode?F[I].parentNode.removeChild(F[I]):F[I])}else{if(F[I].nodeType===1){F.splice.apply(F,[I+1,0].concat(n.makeArray(F[I].getElementsByTagName("script"))))}H.appendChild(F[I])}}return D}return F},attr:function(I,F,J){if(!I||I.nodeType==3||I.nodeType==8){return g}var G=!n.isXMLDoc(I),K=J!==g;F=G&&n.props[F]||F;if(I.tagName){var E=/href|src|style/.test(F);if(F=="selected"&&I.parentNode){I.parentNode.selectedIndex}if(F in I&&G&&!E){if(K){if(F=="type"&&n.nodeName(I,"input")&&I.parentNode){throw"type property can't be changed"}I[F]=J}if(n.nodeName(I,"form")&&I.getAttributeNode(F)){return I.getAttributeNode(F).nodeValue}if(F=="tabIndex"){var H=I.getAttributeNode("tabIndex");return H&&H.specified?H.value:I.nodeName.match(/^(a|area|button|input|object|select|textarea)$/i)?0:g}return I[F]}if(!n.support.style&&G&&F=="style"){return n.attr(I.style,"cssText",J)}if(K){I.setAttribute(F,""+J)}var D=!n.support.hrefNormalized&&G&&E?I.getAttribute(F,2):I.getAttribute(F);return D===null?g:D}if(!n.support.opacity&&F=="opacity"){if(K){I.zoom=1;I.filter=(I.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(J)+""=="NaN"?"":"alpha(opacity="+J*100+")")}return I.filter&&I.filter.indexOf("opacity=")>=0?(parseFloat(I.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}F=F.replace(/-([a-z])/ig,function(L,M){return M.toUpperCase()});if(K){I[F]=J}return I[F]},trim:function(D){return(D||"").replace(/^\s+|\s+$/g,"")},makeArray:function(F){var D=[];if(F!=null){var E=F.length;if(E==null||typeof F==="string"||n.isFunction(F)||F.setInterval){D[0]=F}else{while(E){D[--E]=F[E]}}}return D},inArray:function(F,G){for(var D=0,E=G.length;D<E;D++){if(G[D]===F){return D}}return -1},merge:function(G,D){var E=0,F,H=G.length;if(!n.support.getAll){while((F=D[E++])!=null){if(F.nodeType!=8){G[H++]=F}}}else{while((F=D[E++])!=null){G[H++]=F}}return G},unique:function(J){var E=[],D={};try{for(var F=0,G=J.length;F<G;F++){var I=n.data(J[F]);if(!D[I]){D[I]=true;E.push(J[F])}}}catch(H){E=J}return E},grep:function(E,I,D){var F=[];for(var G=0,H=E.length;G<H;G++){if(!D!=!I(E[G],G)){F.push(E[G])}}return F},map:function(D,I){var E=[];for(var F=0,G=D.length;F<G;F++){var H=I(D[F],F);if(H!=null){E[E.length]=H}}return E.concat.apply([],E)}});var B=navigator.userAgent.toLowerCase();n.browser={version:(B.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(B),opera:/opera/.test(B),msie:/msie/.test(B)&&!/opera/.test(B),mozilla:/mozilla/.test(B)&&!/(compatible|webkit)/.test(B)};n.each({parent:function(D){return D.parentNode},parents:function(D){return n.dir(D,"parentNode")},next:function(D){return n.nth(D,2,"nextSibling")},prev:function(D){return n.nth(D,2,"previousSibling")},nextAll:function(D){return n.dir(D,"nextSibling")},prevAll:function(D){return n.dir(D,"previousSibling")},siblings:function(D){return n.sibling(D.parentNode.firstChild,D)},children:function(D){return n.sibling(D.firstChild)},contents:function(D){return n.nodeName(D,"iframe")?D.contentDocument||D.contentWindow.document:n.makeArray(D.childNodes)}},function(D,E){n.fn[D]=function(F){var G=n.map(this,E);if(F&&typeof F=="string"){G=n.multiFilter(F,G)}return this.pushStack(n.unique(G),D,F)}});n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(D,E){n.fn[D]=function(){var F=arguments;return this.each(function(){for(var G=0,H=F.length;G<H;G++){n(F[G])[E](this)}})}});n.each({removeAttr:function(D){n.attr(this,D,"");if(this.nodeType==1){this.removeAttribute(D)}},addClass:function(D){n.className.add(this,D)},removeClass:function(D){n.className.remove(this,D)},toggleClass:function(E,D){if(typeof D!=="boolean"){D=!n.className.has(this,E)}n.className[D?"add":"remove"](this,E)},remove:function(D){if(!D||n.filter(D,[this]).length){n("*",this).add([this]).each(function(){n.event.remove(this);n.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){n(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(D,E){n.fn[D]=function(){return this.each(E,arguments)}});function j(D,E){return D[0]&&parseInt(n.curCSS(D[0],E,true),10)||0}var h="jQuery"+e(),u=0,z={};n.extend({cache:{},data:function(E,D,F){E=E==l?z:E;var G=E[h];if(!G){G=E[h]=++u}if(D&&!n.cache[G]){n.cache[G]={}}if(F!==g){n.cache[G][D]=F}return D?n.cache[G][D]:G},removeData:function(E,D){E=E==l?z:E;var G=E[h];if(D){if(n.cache[G]){delete n.cache[G][D];D="";for(D in n.cache[G]){break}if(!D){n.removeData(E)}}}else{try{delete E[h]}catch(F){if(E.removeAttribute){E.removeAttribute(h)}}delete n.cache[G]}},queue:function(E,D,G){if(E){D=(D||"fx")+"queue";var F=n.data(E,D);if(!F||n.isArray(G)){F=n.data(E,D,n.makeArray(G))}else{if(G){F.push(G)}}}return F},dequeue:function(G,F){var D=n.queue(G,F),E=D.shift();if(!F||F==="fx"){E=D[0]}if(E!==g){E.call(G)}}});n.fn.extend({data:function(D,F){var G=D.split(".");G[1]=G[1]?"."+G[1]:"";if(F===g){var E=this.triggerHandler("getData"+G[1]+"!",[G[0]]);if(E===g&&this.length){E=n.data(this[0],D)}return E===g&&G[1]?this.data(G[0]):E}else{return this.trigger("setData"+G[1]+"!",[G[0],F]).each(function(){n.data(this,D,F)})}},removeData:function(D){return this.each(function(){n.removeData(this,D)})},queue:function(D,E){if(typeof D!=="string"){E=D;D="fx"}if(E===g){return n.queue(this[0],D)}return this.each(function(){var F=n.queue(this,D,E);if(D=="fx"&&F.length==1){F[0].call(this)}})},dequeue:function(D){return this.each(function(){n.dequeue(this,D)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.1
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){var N=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|[^[\]]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,I=0,F=Object.prototype.toString;var E=function(ae,S,aa,V){aa=aa||[];S=S||document;if(S.nodeType!==1&&S.nodeType!==9){return[]}if(!ae||typeof ae!=="string"){return aa}var ab=[],ac,Y,ah,ag,Z,R,Q=true;N.lastIndex=0;while((ac=N.exec(ae))!==null){ab.push(ac[1]);if(ac[2]){R=RegExp.rightContext;break}}if(ab.length>1&&G.match.POS.exec(ae)){if(ab.length===2&&G.relative[ab[0]]){var U="",X;while((X=G.match.POS.exec(ae))){U+=X[0];ae=ae.replace(G.match.POS,"")}Y=E.filter(U,E(/\s$/.test(ae)?ae+"*":ae,S))}else{Y=G.relative[ab[0]]?[S]:E(ab.shift(),S);while(ab.length){var P=[];ae=ab.shift();if(G.relative[ae]){ae+=ab.shift()}for(var af=0,ad=Y.length;af<ad;af++){E(ae,Y[af],P)}Y=P}}}else{var ai=V?{expr:ab.pop(),set:D(V)}:E.find(ab.pop(),ab.length===1&&S.parentNode?S.parentNode:S);Y=E.filter(ai.expr,ai.set);if(ab.length>0){ah=D(Y)}else{Q=false}while(ab.length){var T=ab.pop(),W=T;if(!G.relative[T]){T=""}else{W=ab.pop()}if(W==null){W=S}G.relative[T](ah,W,M(S))}}if(!ah){ah=Y}if(!ah){throw"Syntax error, unrecognized expression: "+(T||ae)}if(F.call(ah)==="[object Array]"){if(!Q){aa.push.apply(aa,ah)}else{if(S.nodeType===1){for(var af=0;ah[af]!=null;af++){if(ah[af]&&(ah[af]===true||ah[af].nodeType===1&&H(S,ah[af]))){aa.push(Y[af])}}}else{for(var af=0;ah[af]!=null;af++){if(ah[af]&&ah[af].nodeType===1){aa.push(Y[af])}}}}}else{D(ah,aa)}if(R){E(R,S,aa,V)}return aa};E.matches=function(P,Q){return E(P,null,null,Q)};E.find=function(V,S){var W,Q;if(!V){return[]}for(var R=0,P=G.order.length;R<P;R++){var T=G.order[R],Q;if((Q=G.match[T].exec(V))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){Q[1]=(Q[1]||"").replace(/\\/g,"");W=G.find[T](Q,S);if(W!=null){V=V.replace(G.match[T],"");break}}}}if(!W){W=S.getElementsByTagName("*")}return{set:W,expr:V}};E.filter=function(S,ac,ad,T){var Q=S,Y=[],ah=ac,V,ab;while(S&&ac.length){for(var U in G.filter){if((V=G.match[U].exec(S))!=null){var Z=G.filter[U],R=null,X=0,aa,ag;ab=false;if(ah==Y){Y=[]}if(G.preFilter[U]){V=G.preFilter[U](V,ah,ad,Y,T);if(!V){ab=aa=true}else{if(V===true){continue}else{if(V[0]===true){R=[];var W=null,af;for(var ae=0;(af=ah[ae])!==g;ae++){if(af&&W!==af){R.push(af);W=af}}}}}}if(V){for(var ae=0;(ag=ah[ae])!==g;ae++){if(ag){if(R&&ag!=R[X]){X++}aa=Z(ag,V,X,R);var P=T^!!aa;if(ad&&aa!=null){if(P){ab=true}else{ah[ae]=false}}else{if(P){Y.push(ag);ab=true}}}}}if(aa!==g){if(!ad){ah=Y}S=S.replace(G.match[U],"");if(!ab){return[]}break}}}S=S.replace(/\s*,\s*/,"");if(S==Q){if(ab==null){throw"Syntax error, unrecognized expression: "+S}else{break}}Q=S}return ah};var G=E.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(P){return P.getAttribute("href")}},relative:{"+":function(T,Q){for(var R=0,P=T.length;R<P;R++){var S=T[R];if(S){var U=S.previousSibling;while(U&&U.nodeType!==1){U=U.previousSibling}T[R]=typeof Q==="string"?U||false:U===Q}}if(typeof Q==="string"){E.filter(Q,T,true)}},">":function(U,Q,V){if(typeof Q==="string"&&!/\W/.test(Q)){Q=V?Q:Q.toUpperCase();for(var R=0,P=U.length;R<P;R++){var T=U[R];if(T){var S=T.parentNode;U[R]=S.nodeName===Q?S:false}}}else{for(var R=0,P=U.length;R<P;R++){var T=U[R];if(T){U[R]=typeof Q==="string"?T.parentNode:T.parentNode===Q}}if(typeof Q==="string"){E.filter(Q,U,true)}}},"":function(S,Q,U){var R="done"+(I++),P=O;if(!Q.match(/\W/)){var T=Q=U?Q:Q.toUpperCase();P=L}P("parentNode",Q,R,S,T,U)},"~":function(S,Q,U){var R="done"+(I++),P=O;if(typeof Q==="string"&&!Q.match(/\W/)){var T=Q=U?Q:Q.toUpperCase();P=L}P("previousSibling",Q,R,S,T,U)}},find:{ID:function(Q,R){if(R.getElementById){var P=R.getElementById(Q[1]);return P?[P]:[]}},NAME:function(P,Q){return Q.getElementsByName?Q.getElementsByName(P[1]):null},TAG:function(P,Q){return Q.getElementsByTagName(P[1])}},preFilter:{CLASS:function(S,Q,R,P,U){S=" "+S[1].replace(/\\/g,"")+" ";for(var T=0;Q[T];T++){if(U^(" "+Q[T].className+" ").indexOf(S)>=0){if(!R){P.push(Q[T])}}else{if(R){Q[T]=false}}}return false},ID:function(P){return P[1].replace(/\\/g,"")},TAG:function(Q,P){for(var R=0;!P[R];R++){}return M(P[R])?Q[1]:Q[1].toUpperCase()},CHILD:function(P){if(P[1]=="nth"){var Q=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(P[2]=="even"&&"2n"||P[2]=="odd"&&"2n+1"||!/\D/.test(P[2])&&"0n+"+P[2]||P[2]);P[2]=(Q[1]+(Q[2]||1))-0;P[3]=Q[3]-0}P[0]="done"+(I++);return P},ATTR:function(Q){var P=Q[1];if(G.attrMap[P]){Q[1]=G.attrMap[P]}if(Q[2]==="~="){Q[4]=" "+Q[4]+" "}return Q},PSEUDO:function(T,Q,R,P,U){if(T[1]==="not"){if(T[3].match(N).length>1){T[3]=E(T[3],null,null,Q)}else{var S=E.filter(T[3],Q,R,true^U);if(!R){P.push.apply(P,S)}return false}}else{if(G.match.POS.test(T[0])){return true}}return T},POS:function(P){P.unshift(true);return P}},filters:{enabled:function(P){return P.disabled===false&&P.type!=="hidden"},disabled:function(P){return P.disabled===true},checked:function(P){return P.checked===true},selected:function(P){P.parentNode.selectedIndex;return P.selected===true},parent:function(P){return !!P.firstChild},empty:function(P){return !P.firstChild},has:function(R,Q,P){return !!E(P[3],R).length},header:function(P){return/h\d/i.test(P.nodeName)},text:function(P){return"text"===P.type},radio:function(P){return"radio"===P.type},checkbox:function(P){return"checkbox"===P.type},file:function(P){return"file"===P.type},password:function(P){return"password"===P.type},submit:function(P){return"submit"===P.type},image:function(P){return"image"===P.type},reset:function(P){return"reset"===P.type},button:function(P){return"button"===P.type||P.nodeName.toUpperCase()==="BUTTON"},input:function(P){return/input|select|textarea|button/i.test(P.nodeName)}},setFilters:{first:function(Q,P){return P===0},last:function(R,Q,P,S){return Q===S.length-1},even:function(Q,P){return P%2===0},odd:function(Q,P){return P%2===1},lt:function(R,Q,P){return Q<P[3]-0},gt:function(R,Q,P){return Q>P[3]-0},nth:function(R,Q,P){return P[3]-0==Q},eq:function(R,Q,P){return P[3]-0==Q}},filter:{CHILD:function(P,S){var V=S[1],W=P.parentNode;var U="child"+W.childNodes.length;if(W&&(!W[U]||!P.nodeIndex)){var T=1;for(var Q=W.firstChild;Q;Q=Q.nextSibling){if(Q.nodeType==1){Q.nodeIndex=T++}}W[U]=T-1}if(V=="first"){return P.nodeIndex==1}else{if(V=="last"){return P.nodeIndex==W[U]}else{if(V=="only"){return W[U]==1}else{if(V=="nth"){var Y=false,R=S[2],X=S[3];if(R==1&&X==0){return true}if(R==0){if(P.nodeIndex==X){Y=true}}else{if((P.nodeIndex-X)%R==0&&(P.nodeIndex-X)/R>=0){Y=true}}return Y}}}}},PSEUDO:function(V,R,S,W){var Q=R[1],T=G.filters[Q];if(T){return T(V,S,R,W)}else{if(Q==="contains"){return(V.textContent||V.innerText||"").indexOf(R[3])>=0}else{if(Q==="not"){var U=R[3];for(var S=0,P=U.length;S<P;S++){if(U[S]===V){return false}}return true}}}},ID:function(Q,P){return Q.nodeType===1&&Q.getAttribute("id")===P},TAG:function(Q,P){return(P==="*"&&Q.nodeType===1)||Q.nodeName===P},CLASS:function(Q,P){return P.test(Q.className)},ATTR:function(T,R){var P=G.attrHandle[R[1]]?G.attrHandle[R[1]](T):T[R[1]]||T.getAttribute(R[1]),U=P+"",S=R[2],Q=R[4];return P==null?false:S==="="?U===Q:S==="*="?U.indexOf(Q)>=0:S==="~="?(" "+U+" ").indexOf(Q)>=0:!R[4]?P:S==="!="?U!=Q:S==="^="?U.indexOf(Q)===0:S==="$="?U.substr(U.length-Q.length)===Q:S==="|="?U===Q||U.substr(0,Q.length+1)===Q+"-":false},POS:function(T,Q,R,U){var P=Q[2],S=G.setFilters[P];if(S){return S(T,R,Q,U)}}}};for(var K in G.match){G.match[K]=RegExp(G.match[K].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var D=function(Q,P){Q=Array.prototype.slice.call(Q);if(P){P.push.apply(P,Q);return P}return Q};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(J){D=function(T,S){var Q=S||[];if(F.call(T)==="[object Array]"){Array.prototype.push.apply(Q,T)}else{if(typeof T.length==="number"){for(var R=0,P=T.length;R<P;R++){Q.push(T[R])}}else{for(var R=0;T[R];R++){Q.push(T[R])}}}return Q}}(function(){var Q=document.createElement("form"),R="script"+(new Date).getTime();Q.innerHTML="<input name='"+R+"'/>";var P=document.documentElement;P.insertBefore(Q,P.firstChild);if(!!document.getElementById(R)){G.find.ID=function(T,U){if(U.getElementById){var S=U.getElementById(T[1]);return S?S.id===T[1]||S.getAttributeNode&&S.getAttributeNode("id").nodeValue===T[1]?[S]:g:[]}};G.filter.ID=function(U,S){var T=U.getAttributeNode&&U.getAttributeNode("id");return U.nodeType===1&&T&&T.nodeValue===S}}P.removeChild(Q)})();(function(){var P=document.createElement("div");P.appendChild(document.createComment(""));if(P.getElementsByTagName("*").length>0){G.find.TAG=function(Q,U){var T=U.getElementsByTagName(Q[1]);if(Q[1]==="*"){var S=[];for(var R=0;T[R];R++){if(T[R].nodeType===1){S.push(T[R])}}T=S}return T}}P.innerHTML="<a href='#'></a>";if(P.firstChild.getAttribute("href")!=="#"){G.attrHandle.href=function(Q){return Q.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var P=E;E=function(T,S,Q,R){S=S||document;if(!R&&S.nodeType===9){try{return D(S.querySelectorAll(T),Q)}catch(U){}}return P(T,S,Q,R)};E.find=P.find;E.filter=P.filter;E.selectors=P.selectors;E.matches=P.matches})()}if(document.documentElement.getElementsByClassName){G.order.splice(1,0,"CLASS");G.find.CLASS=function(P,Q){return Q.getElementsByClassName(P[1])}}function L(Q,W,V,Z,X,Y){for(var T=0,R=Z.length;T<R;T++){var P=Z[T];if(P){P=P[Q];var U=false;while(P&&P.nodeType){var S=P[V];if(S){U=Z[S];break}if(P.nodeType===1&&!Y){P[V]=T}if(P.nodeName===W){U=P;break}P=P[Q]}Z[T]=U}}}function O(Q,V,U,Y,W,X){for(var S=0,R=Y.length;S<R;S++){var P=Y[S];if(P){P=P[Q];var T=false;while(P&&P.nodeType){if(P[U]){T=Y[P[U]];break}if(P.nodeType===1){if(!X){P[U]=S}if(typeof V!=="string"){if(P===V){T=true;break}}else{if(E.filter(V,[P]).length>0){T=P;break}}}P=P[Q]}Y[S]=T}}}var H=document.compareDocumentPosition?function(Q,P){return Q.compareDocumentPosition(P)&16}:function(Q,P){return Q!==P&&(Q.contains?Q.contains(P):true)};var M=function(P){return P.documentElement&&!P.body||P.tagName&&P.ownerDocument&&!P.ownerDocument.body};n.find=E;n.filter=E.filter;n.expr=E.selectors;n.expr[":"]=n.expr.filters;E.selectors.filters.hidden=function(P){return"hidden"===P.type||n.css(P,"display")==="none"||n.css(P,"visibility")==="hidden"};E.selectors.filters.visible=function(P){return"hidden"!==P.type&&n.css(P,"display")!=="none"&&n.css(P,"visibility")!=="hidden"};E.selectors.filters.animated=function(P){return n.grep(n.timers,function(Q){return P===Q.elem}).length};n.multiFilter=function(R,P,Q){if(Q){R=":not("+R+")"}return E.matches(R,P)};n.dir=function(R,Q){var P=[],S=R[Q];while(S&&S!=document){if(S.nodeType==1){P.push(S)}S=S[Q]}return P};n.nth=function(T,P,R,S){P=P||1;var Q=0;for(;T;T=T[R]){if(T.nodeType==1&&++Q==P){break}}return T};n.sibling=function(R,Q){var P=[];for(;R;R=R.nextSibling){if(R.nodeType==1&&R!=Q){P.push(R)}}return P};return;l.Sizzle=E})();n.event={add:function(H,E,G,J){if(H.nodeType==3||H.nodeType==8){return}if(H.setInterval&&H!=l){H=l}if(!G.guid){G.guid=this.guid++}if(J!==g){var F=G;G=this.proxy(F);G.data=J}var D=n.data(H,"events")||n.data(H,"events",{}),I=n.data(H,"handle")||n.data(H,"handle",function(){return typeof n!=="undefined"&&!n.event.triggered?n.event.handle.apply(arguments.callee.elem,arguments):g});I.elem=H;n.each(E.split(/\s+/),function(L,M){var N=M.split(".");M=N.shift();G.type=N.slice().sort().join(".");var K=D[M];if(n.event.specialAll[M]){n.event.specialAll[M].setup.call(H,J,N)}if(!K){K=D[M]={};if(!n.event.special[M]||n.event.special[M].setup.call(H,J,N)===false){if(H.addEventListener){H.addEventListener(M,I,false)}else{if(H.attachEvent){H.attachEvent("on"+M,I)}}}}K[G.guid]=G;n.event.global[M]=true});H=null},guid:1,global:{},remove:function(J,G,I){if(J.nodeType==3||J.nodeType==8){return}var F=n.data(J,"events"),E,D;if(F){if(G===g||(typeof G==="string"&&G.charAt(0)==".")){for(var H in F){this.remove(J,H+(G||""))}}else{if(G.type){I=G.handler;G=G.type}n.each(G.split(/\s+/),function(L,N){var P=N.split(".");N=P.shift();var M=RegExp("(^|\\.)"+P.slice().sort().join(".*\\.")+"(\\.|$)");if(F[N]){if(I){delete F[N][I.guid]}else{for(var O in F[N]){if(M.test(F[N][O].type)){delete F[N][O]}}}if(n.event.specialAll[N]){n.event.specialAll[N].teardown.call(J,P)}for(E in F[N]){break}if(!E){if(!n.event.special[N]||n.event.special[N].teardown.call(J,P)===false){if(J.removeEventListener){J.removeEventListener(N,n.data(J,"handle"),false)}else{if(J.detachEvent){J.detachEvent("on"+N,n.data(J,"handle"))}}}E=null;delete F[N]}}})}for(E in F){break}if(!E){var K=n.data(J,"handle");if(K){K.elem=null}n.removeData(J,"events");n.removeData(J,"handle")}}},trigger:function(H,J,G,D){var F=H.type||H;if(!D){H=typeof H==="object"?H[h]?H:n.extend(n.Event(F),H):n.Event(F);if(F.indexOf("!")>=0){H.type=F=F.slice(0,-1);H.exclusive=true}if(!G){H.stopPropagation();if(this.global[F]){n.each(n.cache,function(){if(this.events&&this.events[F]){n.event.trigger(H,J,this.handle.elem)}})}}if(!G||G.nodeType==3||G.nodeType==8){return g}H.result=g;H.target=G;J=n.makeArray(J);J.unshift(H)}H.currentTarget=G;var I=n.data(G,"handle");if(I){I.apply(G,J)}if((!G[F]||(n.nodeName(G,"a")&&F=="click"))&&G["on"+F]&&G["on"+F].apply(G,J)===false){H.result=false}if(!D&&G[F]&&!H.isDefaultPrevented()&&!(n.nodeName(G,"a")&&F=="click")){this.triggered=true;try{G[F]()}catch(K){}}this.triggered=false;if(!H.isPropagationStopped()){var E=G.parentNode||G.ownerDocument;if(E){n.event.trigger(H,J,E,true)}}},handle:function(J){var I,D;J=arguments[0]=n.event.fix(J||l.event);var K=J.type.split(".");J.type=K.shift();I=!K.length&&!J.exclusive;var H=RegExp("(^|\\.)"+K.slice().sort().join(".*\\.")+"(\\.|$)");D=(n.data(this,"events")||{})[J.type];for(var F in D){var G=D[F];if(I||H.test(G.type)){J.handler=G;J.data=G.data;var E=G.apply(this,arguments);if(E!==g){J.result=E;if(E===false){J.preventDefault();J.stopPropagation()}}if(J.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(G){if(G[h]){return G}var E=G;G=n.Event(E);for(var F=this.props.length,I;F;){I=this.props[--F];G[I]=E[I]}if(!G.target){G.target=G.srcElement||document}if(G.target.nodeType==3){G.target=G.target.parentNode}if(!G.relatedTarget&&G.fromElement){G.relatedTarget=G.fromElement==G.target?G.toElement:G.fromElement}if(G.pageX==null&&G.clientX!=null){var H=document.documentElement,D=document.body;G.pageX=G.clientX+(H&&H.scrollLeft||D&&D.scrollLeft||0)-(H.clientLeft||0);G.pageY=G.clientY+(H&&H.scrollTop||D&&D.scrollTop||0)-(H.clientTop||0)}if(!G.which&&((G.charCode||G.charCode===0)?G.charCode:G.keyCode)){G.which=G.charCode||G.keyCode}if(!G.metaKey&&G.ctrlKey){G.metaKey=G.ctrlKey}if(!G.which&&G.button){G.which=(G.button&1?1:(G.button&2?3:(G.button&4?2:0)))}return G},proxy:function(E,D){D=D||function(){return E.apply(this,arguments)};D.guid=E.guid=E.guid||D.guid||this.guid++;return D},special:{ready:{setup:A,teardown:function(){}}},specialAll:{live:{setup:function(D,E){n.event.add(this,E[0],c)},teardown:function(F){if(F.length){var D=0,E=RegExp("(^|\\.)"+F[0]+"(\\.|$)");n.each((n.data(this,"events").live||{}),function(){if(E.test(this.type)){D++}});if(D<1){n.event.remove(this,F[0],c)}}}}}};n.Event=function(D){if(!this.preventDefault){return new n.Event(D)}if(D&&D.type){this.originalEvent=D;this.type=D.type;this.timeStamp=D.timeStamp}else{this.type=D}if(!this.timeStamp){this.timeStamp=e()}this[h]=true};function k(){return false}function t(){return true}n.Event.prototype={preventDefault:function(){this.isDefaultPrevented=t;var D=this.originalEvent;if(!D){return}if(D.preventDefault){D.preventDefault()}D.returnValue=false},stopPropagation:function(){this.isPropagationStopped=t;var D=this.originalEvent;if(!D){return}if(D.stopPropagation){D.stopPropagation()}D.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=t;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(E){var D=E.relatedTarget;while(D&&D!=this){try{D=D.parentNode}catch(F){D=this}}if(D!=this){E.type=E.data;n.event.handle.apply(this,arguments)}};n.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(E,D){n.event.special[D]={setup:function(){n.event.add(this,E,a,D)},teardown:function(){n.event.remove(this,E,a)}}});n.fn.extend({bind:function(E,F,D){return E=="unload"?this.one(E,F,D):this.each(function(){n.event.add(this,E,D||F,D&&F)})},one:function(F,G,E){var D=n.event.proxy(E||G,function(H){n(this).unbind(H,D);return(E||G).apply(this,arguments)});return this.each(function(){n.event.add(this,F,D,E&&G)})},unbind:function(E,D){return this.each(function(){n.event.remove(this,E,D)})},trigger:function(D,E){return this.each(function(){n.event.trigger(D,E,this)})},triggerHandler:function(D,F){if(this[0]){var E=n.Event(D);E.preventDefault();E.stopPropagation();n.event.trigger(E,F,this[0]);return E.result}},toggle:function(F){var D=arguments,E=1;while(E<D.length){n.event.proxy(F,D[E++])}return this.click(n.event.proxy(F,function(G){this.lastToggle=(this.lastToggle||0)%E;G.preventDefault();return D[this.lastToggle++].apply(this,arguments)||false}))},hover:function(D,E){return this.mouseenter(D).mouseleave(E)},ready:function(D){A();if(n.isReady){D.call(document,n)}else{n.readyList.push(D)}return this},live:function(F,E){var D=n.event.proxy(E);D.guid+=this.selector+F;n(document).bind(i(F,this.selector),this.selector,D);return this},die:function(E,D){n(document).unbind(i(E,this.selector),D?{guid:D.guid+this.selector+E}:null);return this}});function c(G){var D=RegExp("(^|\\.)"+G.type+"(\\.|$)"),F=true,E=[];n.each(n.data(this,"events").live||[],function(H,I){if(D.test(I.type)){var J=n(G.target).closest(I.data)[0];if(J){E.push({elem:J,fn:I})}}});n.each(E,function(){if(!G.isImmediatePropagationStopped()&&this.fn.call(this.elem,G,this.fn.data)===false){F=false}});return F}function i(E,D){return["live",E,D.replace(/\./g,"`").replace(/ /g,"|")].join(".")}n.extend({isReady:false,readyList:[],ready:function(){if(!n.isReady){n.isReady=true;if(n.readyList){n.each(n.readyList,function(){this.call(document,n)});n.readyList=null}n(document).triggerHandler("ready")}}});var w=false;function A(){if(w){return}w=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);n.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);n.ready()}});if(document.documentElement.doScroll&&!l.frameElement){(function(){if(n.isReady){return}try{document.documentElement.doScroll("left")}catch(D){setTimeout(arguments.callee,0);return}n.ready()})()}}}n.event.add(l,"load",n.ready)}n.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(E,D){n.fn[D]=function(F){return F?this.bind(D,F):this.trigger(D)}});n(l).bind("unload",function(){for(var D in n.cache){if(D!=1&&n.cache[D].handle){n.event.remove(n.cache[D].handle.elem)}}});(function(){n.support={};var E=document.documentElement,F=document.createElement("script"),J=document.createElement("div"),I="script"+(new Date).getTime();J.style.display="none";J.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var G=J.getElementsByTagName("*"),D=J.getElementsByTagName("a")[0];if(!G||!G.length||!D){return}n.support={leadingWhitespace:J.firstChild.nodeType==3,tbody:!J.getElementsByTagName("tbody").length,objectAll:!!J.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!J.getElementsByTagName("link").length,style:/red/.test(D.getAttribute("style")),hrefNormalized:D.getAttribute("href")==="/a",opacity:D.style.opacity==="0.5",cssFloat:!!D.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};F.type="text/javascript";try{F.appendChild(document.createTextNode("window."+I+"=1;"))}catch(H){}E.insertBefore(F,E.firstChild);if(l[I]){n.support.scriptEval=true;delete l[I]}E.removeChild(F);if(J.attachEvent&&J.fireEvent){J.attachEvent("onclick",function(){n.support.noCloneEvent=false;J.detachEvent("onclick",arguments.callee)});J.cloneNode(true).fireEvent("onclick")}n(function(){var K=document.createElement("div");K.style.width="1px";K.style.paddingLeft="1px";document.body.appendChild(K);n.boxModel=n.support.boxModel=K.offsetWidth===2;document.body.removeChild(K)})})();var v=n.support.cssFloat?"cssFloat":"styleFloat";n.props={"for":"htmlFor","class":"className","float":v,cssFloat:v,styleFloat:v,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};n.fn.extend({_load:n.fn.load,load:function(F,I,J){if(typeof F!=="string"){return this._load(F)}var H=F.indexOf(" ");if(H>=0){var D=F.slice(H,F.length);F=F.slice(0,H)}var G="GET";if(I){if(n.isFunction(I)){J=I;I=null}else{if(typeof I==="object"){I=n.param(I);G="POST"}}}var E=this;n.ajax({url:F,type:G,dataType:"html",data:I,complete:function(L,K){if(K=="success"||K=="notmodified"){E.html(D?n("<div/>").append(L.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(D):L.responseText)}if(J){E.each(J,[L.responseText,K,L])}}});return this},serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?n.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(D,E){var F=n(this).val();return F==null?null:n.isArray(F)?n.map(F,function(H,G){return{name:E.name,value:H}}):{name:E.name,value:F}}).get()}});n.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(D,E){n.fn[E]=function(F){return this.bind(E,F)}});var q=e();n.extend({get:function(D,F,G,E){if(n.isFunction(F)){G=F;F=null}return n.ajax({type:"GET",url:D,data:F,success:G,dataType:E})},getScript:function(D,E){return n.get(D,null,E,"script")},getJSON:function(D,E,F){return n.get(D,E,F,"json")},post:function(D,F,G,E){if(n.isFunction(F)){G=F;F={}}return n.ajax({type:"POST",url:D,data:F,success:G,dataType:E})},ajaxSetup:function(D){n.extend(n.ajaxSettings,D)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(L){L=n.extend(true,L,n.extend(true,{},n.ajaxSettings,L));var V,E=/=\?(&|$)/g,Q,U,F=L.type.toUpperCase();if(L.data&&L.processData&&typeof L.data!=="string"){L.data=n.param(L.data)}if(L.dataType=="jsonp"){if(F=="GET"){if(!L.url.match(E)){L.url+=(L.url.match(/\?/)?"&":"?")+(L.jsonp||"callback")+"=?"}}else{if(!L.data||!L.data.match(E)){L.data=(L.data?L.data+"&":"")+(L.jsonp||"callback")+"=?"}}L.dataType="json"}if(L.dataType=="json"&&(L.data&&L.data.match(E)||L.url.match(E))){V="jsonp"+q++;if(L.data){L.data=(L.data+"").replace(E,"="+V+"$1")}L.url=L.url.replace(E,"="+V+"$1");L.dataType="script";l[V]=function(W){U=W;H();K();l[V]=g;try{delete l[V]}catch(X){}if(G){G.removeChild(S)}}}if(L.dataType=="script"&&L.cache==null){L.cache=false}if(L.cache===false&&F=="GET"){var D=e();var T=L.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+D+"$2");L.url=T+((T==L.url)?(L.url.match(/\?/)?"&":"?")+"_="+D:"")}if(L.data&&F=="GET"){L.url+=(L.url.match(/\?/)?"&":"?")+L.data;L.data=null}if(L.global&&!n.active++){n.event.trigger("ajaxStart")}var P=/^(\w+:)?\/\/([^\/?#]+)/.exec(L.url);if(L.dataType=="script"&&F=="GET"&&P&&(P[1]&&P[1]!=location.protocol||P[2]!=location.host)){var G=document.getElementsByTagName("head")[0];var S=document.createElement("script");S.src=L.url;if(L.scriptCharset){S.charset=L.scriptCharset}if(!V){var N=false;S.onload=S.onreadystatechange=function(){if(!N&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){N=true;H();K();G.removeChild(S)}}}G.appendChild(S);return g}var J=false;var I=L.xhr();if(L.username){I.open(F,L.url,L.async,L.username,L.password)}else{I.open(F,L.url,L.async)}try{if(L.data){I.setRequestHeader("Content-Type",L.contentType)}if(L.ifModified){I.setRequestHeader("If-Modified-Since",n.lastModified[L.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}I.setRequestHeader("X-Requested-With","XMLHttpRequest");I.setRequestHeader("Accept",L.dataType&&L.accepts[L.dataType]?L.accepts[L.dataType]+", */*":L.accepts._default)}catch(R){}if(L.beforeSend&&L.beforeSend(I,L)===false){if(L.global&&!--n.active){n.event.trigger("ajaxStop")}I.abort();return false}if(L.global){n.event.trigger("ajaxSend",[I,L])}var M=function(W){if(I.readyState==0){if(O){clearInterval(O);O=null;if(L.global&&!--n.active){n.event.trigger("ajaxStop")}}}else{if(!J&&I&&(I.readyState==4||W=="timeout")){J=true;if(O){clearInterval(O);O=null}Q=W=="timeout"?"timeout":!n.httpSuccess(I)?"error":L.ifModified&&n.httpNotModified(I,L.url)?"notmodified":"success";if(Q=="success"){try{U=n.httpData(I,L.dataType,L)}catch(Y){Q="parsererror"}}if(Q=="success"){var X;try{X=I.getResponseHeader("Last-Modified")}catch(Y){}if(L.ifModified&&X){n.lastModified[L.url]=X}if(!V){H()}}else{n.handleError(L,I,Q)}K();if(L.async){I=null}}}};if(L.async){var O=setInterval(M,13);if(L.timeout>0){setTimeout(function(){if(I){if(!J){M("timeout")}if(I){I.abort()}}},L.timeout)}}try{I.send(L.data)}catch(R){n.handleError(L,I,null,R)}if(!L.async){M()}function H(){if(L.success){L.success(U,Q)}if(L.global){n.event.trigger("ajaxSuccess",[I,L])}}function K(){if(L.complete){L.complete(I,Q)}if(L.global){n.event.trigger("ajaxComplete",[I,L])}if(L.global&&!--n.active){n.event.trigger("ajaxStop")}}return I},handleError:function(E,G,D,F){if(E.error){E.error(G,D,F)}if(E.global){n.event.trigger("ajaxError",[G,E,F])}},active:0,httpSuccess:function(E){try{return !E.status&&location.protocol=="file:"||(E.status>=200&&E.status<300)||E.status==304||E.status==1223}catch(D){}return false},httpNotModified:function(F,D){try{var G=F.getResponseHeader("Last-Modified");return F.status==304||G==n.lastModified[D]}catch(E){}return false},httpData:function(I,G,F){var E=I.getResponseHeader("content-type"),D=G=="xml"||!G&&E&&E.indexOf("xml")>=0,H=D?I.responseXML:I.responseText;if(D&&H.documentElement.tagName=="parsererror"){throw"parsererror"}if(F&&F.dataFilter){H=F.dataFilter(H,G)}if(typeof H==="string"){if(G=="script"){n.globalEval(H)}if(G=="json"){H=l["eval"]("("+H+")")}}return H},param:function(D){var F=[];function G(H,I){F[F.length]=encodeURIComponent(H)+"="+encodeURIComponent(I)}if(n.isArray(D)||D.jquery){n.each(D,function(){G(this.name,this.value)})}else{for(var E in D){if(n.isArray(D[E])){n.each(D[E],function(){G(E,this)})}else{G(E,n.isFunction(D[E])?D[E]():D[E])}}}return F.join("&").replace(/%20/g,"+")}});var m={},d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function s(E,D){var F={};n.each(d.concat.apply([],d.slice(0,D)),function(){F[this]=E});return F}n.fn.extend({show:function(I,K){if(I){return this.animate(s("show",3),I,K)}else{for(var G=0,E=this.length;G<E;G++){var D=n.data(this[G],"olddisplay");this[G].style.display=D||"";if(n.css(this[G],"display")==="none"){var F=this[G].tagName,J;if(m[F]){J=m[F]}else{var H=n("<"+F+" />").appendTo("body");J=H.css("display");if(J==="none"){J="block"}H.remove();m[F]=J}this[G].style.display=n.data(this[G],"olddisplay",J)}}return this}},hide:function(G,H){if(G){return this.animate(s("hide",3),G,H)}else{for(var F=0,E=this.length;F<E;F++){var D=n.data(this[F],"olddisplay");if(!D&&D!=="none"){n.data(this[F],"olddisplay",n.css(this[F],"display"))}this[F].style.display="none"}return this}},_toggle:n.fn.toggle,toggle:function(F,E){var D=typeof F==="boolean";return n.isFunction(F)&&n.isFunction(E)?this._toggle.apply(this,arguments):F==null||D?this.each(function(){var G=D?F:n(this).is(":hidden");n(this)[G?"show":"hide"]()}):this.animate(s("toggle",3),F,E)},fadeTo:function(D,F,E){return this.animate({opacity:F},D,E)},animate:function(H,E,G,F){var D=n.speed(E,G,F);return this[D.queue===false?"each":"queue"](function(){var J=n.extend({},D),L,K=this.nodeType==1&&n(this).is(":hidden"),I=this;for(L in H){if(H[L]=="hide"&&K||H[L]=="show"&&!K){return J.complete.call(this)}if((L=="height"||L=="width")&&this.style){J.display=n.css(this,"display");J.overflow=this.style.overflow}}if(J.overflow!=null){this.style.overflow="hidden"}J.curAnim=n.extend({},H);n.each(H,function(N,R){var Q=new n.fx(I,J,N);if(/toggle|show|hide/.test(R)){Q[R=="toggle"?K?"show":"hide":R](H)}else{var P=R.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),S=Q.cur(true)||0;if(P){var M=parseFloat(P[2]),O=P[3]||"px";if(O!="px"){I.style[N]=(M||1)+O;S=((M||1)/Q.cur(true))*S;I.style[N]=S+O}if(P[1]){M=((P[1]=="-="?-1:1)*M)+S}Q.custom(S,M,O)}else{Q.custom(S,R,"")}}});return true})},stop:function(E,D){var F=n.timers;if(E){this.queue([])}this.each(function(){for(var G=F.length-1;G>=0;G--){if(F[G].elem==this){if(D){F[G](true)}F.splice(G,1)}}});if(!D){this.dequeue()}return this}});n.each({slideDown:s("show",1),slideUp:s("hide",1),slideToggle:s("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(D,E){n.fn[D]=function(F,G){return this.animate(E,F,G)}});n.extend({speed:function(F,G,E){var D=typeof F==="object"?F:{complete:E||!E&&G||n.isFunction(F)&&F,duration:F,easing:E&&G||G&&!n.isFunction(G)&&G};D.duration=n.fx.off?0:typeof D.duration==="number"?D.duration:n.fx.speeds[D.duration]||n.fx.speeds._default;D.old=D.complete;D.complete=function(){if(D.queue!==false){n(this).dequeue()}if(n.isFunction(D.old)){D.old.call(this)}};return D},easing:{linear:function(F,G,D,E){return D+E*F},swing:function(F,G,D,E){return((-Math.cos(F*Math.PI)/2)+0.5)*E+D}},timers:[],timerId:null,fx:function(E,D,F){this.options=D;this.elem=E;this.prop=F;if(!D.orig){D.orig={}}}});n.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(n.fx.step[this.prop]||n.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(E){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var D=parseFloat(n.css(this.elem,this.prop,E));return D&&D>-10000?D:parseFloat(n.curCSS(this.elem,this.prop))||0},custom:function(H,G,F){this.startTime=e();this.start=H;this.end=G;this.unit=F||this.unit||"px";this.now=this.start;this.pos=this.state=0;var D=this;function E(I){return D.step(I)}E.elem=this.elem;n.timers.push(E);if(E()&&n.timerId==null){n.timerId=setInterval(function(){var J=n.timers;for(var I=0;I<J.length;I++){if(!J[I]()){J.splice(I--,1)}}if(!J.length){clearInterval(n.timerId);n.timerId=null}},13)}},show:function(){this.options.orig[this.prop]=n.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());n(this.elem).show()},hide:function(){this.options.orig[this.prop]=n.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(G){var F=e();if(G||F>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var D=true;for(var E in this.options.curAnim){if(this.options.curAnim[E]!==true){D=false}}if(D){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(n.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){n(this.elem).hide()}if(this.options.hide||this.options.show){for(var H in this.options.curAnim){n.attr(this.elem.style,H,this.options.orig[H])}}}if(D){this.options.complete.call(this.elem)}return false}else{var I=F-this.startTime;this.state=I/this.options.duration;this.pos=n.easing[this.options.easing||(n.easing.swing?"swing":"linear")](this.state,I,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};n.extend(n.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(D){n.attr(D.elem.style,"opacity",D.now)},_default:function(D){if(D.elem.style&&D.elem.style[D.prop]!=null){D.elem.style[D.prop]=D.now+D.unit}else{D.elem[D.prop]=D.now}}}});if(document.documentElement.getBoundingClientRect){n.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return n.offset.bodyOffset(this[0])}var F=this[0].getBoundingClientRect(),I=this[0].ownerDocument,E=I.body,D=I.documentElement,K=D.clientTop||E.clientTop||0,J=D.clientLeft||E.clientLeft||0,H=F.top+(self.pageYOffset||n.boxModel&&D.scrollTop||E.scrollTop)-K,G=F.left+(self.pageXOffset||n.boxModel&&D.scrollLeft||E.scrollLeft)-J;return{top:H,left:G}}}else{n.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return n.offset.bodyOffset(this[0])}n.offset.initialized||n.offset.initialize();var I=this[0],F=I.offsetParent,E=I,N=I.ownerDocument,L,G=N.documentElement,J=N.body,K=N.defaultView,D=K.getComputedStyle(I,null),M=I.offsetTop,H=I.offsetLeft;while((I=I.parentNode)&&I!==J&&I!==G){L=K.getComputedStyle(I,null);M-=I.scrollTop,H-=I.scrollLeft;if(I===F){M+=I.offsetTop,H+=I.offsetLeft;if(n.offset.doesNotAddBorder&&!(n.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(I.tagName))){M+=parseInt(L.borderTopWidth,10)||0,H+=parseInt(L.borderLeftWidth,10)||0}E=F,F=I.offsetParent}if(n.offset.subtractsBorderForOverflowNotVisible&&L.overflow!=="visible"){M+=parseInt(L.borderTopWidth,10)||0,H+=parseInt(L.borderLeftWidth,10)||0}D=L}if(D.position==="relative"||D.position==="static"){M+=J.offsetTop,H+=J.offsetLeft}if(D.position==="fixed"){M+=Math.max(G.scrollTop,J.scrollTop),H+=Math.max(G.scrollLeft,J.scrollLeft)}return{top:M,left:H}}}n.offset={initialize:function(){if(this.initialized){return}var K=document.body,E=document.createElement("div"),G,F,M,H,L,D,I=K.style.marginTop,J='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"cellpadding="0"cellspacing="0"><tr><td></td></tr></table>';L={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(D in L){E.style[D]=L[D]}E.innerHTML=J;K.insertBefore(E,K.firstChild);G=E.firstChild,F=G.firstChild,H=G.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(F.offsetTop!==5);this.doesAddBorderForTableAndCells=(H.offsetTop===5);G.style.overflow="hidden",G.style.position="relative";this.subtractsBorderForOverflowNotVisible=(F.offsetTop===-5);K.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(K.offsetTop===0);K.style.marginTop=I;K.removeChild(E);this.initialized=true},bodyOffset:function(D){n.offset.initialized||n.offset.initialize();var F=D.offsetTop,E=D.offsetLeft;if(n.offset.doesNotIncludeMarginInBodyOffset){F+=parseInt(n.curCSS(D,"marginTop",true),10)||0,E+=parseInt(n.curCSS(D,"marginLeft",true),10)||0}return{top:F,left:E}}};n.fn.extend({position:function(){var H=0,G=0,E;if(this[0]){var F=this.offsetParent(),I=this.offset(),D=/^body|html$/i.test(F[0].tagName)?{top:0,left:0}:F.offset();I.top-=j(this,"marginTop");I.left-=j(this,"marginLeft");D.top+=j(F,"borderTopWidth");D.left+=j(F,"borderLeftWidth");E={top:I.top-D.top,left:I.left-D.left}}return E},offsetParent:function(){var D=this[0].offsetParent||document.body;while(D&&(!/^body|html$/i.test(D.tagName)&&n.css(D,"position")=="static")){D=D.offsetParent}return n(D)}});n.each(["Left","Top"],function(E,D){var F="scroll"+D;n.fn[F]=function(G){if(!this[0]){return null}return G!==g?this.each(function(){this==l||this==document?l.scrollTo(!E?G:n(l).scrollLeft(),E?G:n(l).scrollTop()):this[F]=G}):this[0]==l||this[0]==document?self[E?"pageYOffset":"pageXOffset"]||n.boxModel&&document.documentElement[F]||document.body[F]:this[0][F]}});n.each(["Height","Width"],function(G,E){var D=G?"Left":"Top",F=G?"Right":"Bottom";n.fn["inner"+E]=function(){return this[E.toLowerCase()]()+j(this,"padding"+D)+j(this,"padding"+F)};n.fn["outer"+E]=function(I){return this["inner"+E]()+j(this,"border"+D+"Width")+j(this,"border"+F+"Width")+(I?j(this,"margin"+D)+j(this,"margin"+F):0)};var H=E.toLowerCase();n.fn[H]=function(I){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+E]||document.body["client"+E]:this[0]==document?Math.max(document.documentElement["client"+E],document.body["scroll"+E],document.documentElement["scroll"+E],document.body["offset"+E],document.documentElement["offset"+E]):I===g?(this.length?n.css(this[0],H):null):this.css(H,typeof I==="string"?I:I+"px")}})})();
+
+if(!Array.forEach){Array.prototype.forEach=function(D,E){var C=E||window;for(var B=0,A=this.length;B<A;++B){D.call(C,this[B],B,this)}};Array.prototype.map=function(E,F){var D=F||window;var A=[];for(var C=0,B=this.length;C<B;++C){A.push(E.call(D,this[C],C,this))}return A};Array.prototype.filter=function(E,F){var D=F||window;var A=[];for(var C=0,B=this.length;C<B;++C){if(!E.call(D,this[C],C,this)){continue}A.push(this[C])}return A};Array.prototype.every=function(D,E){var C=E||window;for(var B=0,A=this.length;B<A;++B){if(!D.call(C,this[B],B,this)){return false}}return true};Array.prototype.indexOf=function(B,C){var C=C||0;for(var A=0;A<this.length;++A){if(this[A]===B){return A}}return -1}}Array.prototype.contains=function(A){if(Array.contains){return this.contains(A)}return this.indexOf(A)>-1};Array.prototype.insert=function(A){if(!this.contains(A)){this.push(A)}};if(!Array.remove){Array.remove=function(D,C,B){var A=D.slice((B||C)+1||D.length);D.length=C<0?D.length+C:C;return D.push.apply(D,A)}}Function.prototype.method=function(A,B){this.prototype[A]=B;return this};Function.prototype.augmentProto=function(A){for(key in A){this.prototype[key]=A[key]}return this};Function.prototype.pBind=function(B){var A=this;return function(){return A.apply(B,arguments)}};Function.prototype.widget=function(){this.prototype.bind=function(B,A){this.$root.bind(B,A);return this};this.prototype.trigger=function(A,B){this.$root.trigger(A,B)};this.prototype.find=function(A){return this.$root.find(A)};return this};String.prototype.toCamel=function(){return this.replace(/[-_\s]\D/gi,function(A){return A.charAt(A.length-1).toUpperCase()})};String.prototype.escapeHTML=function(){return this.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")};window.twttr=window.twttr||{};twttr.augmentObject=function(B,C){for(var A in C){B[A]=C[A]}return B};twttr.augmentObject(twttr,{namespaceOf:function(A){return twttr.is.object(A)?A:window},merge:function(){var C=arguments;var F=arguments[arguments.length-1];var B=false;if(twttr.is.nil(C[0])||!twttr.is.def(C[0])){if(C.length<2){return{}}[].shift.call(C);return this.merge.apply(this,C)}if(twttr.is.bool(F)){B=F;[].pop.call(C)}for(var E=0,A=C.length-1;E<A;E++){for(var D in C[E+1]){if(B&&C[0][D]&&twttr.is.object(C[0][D])&&!twttr.is.fn(C[0][D])&&twttr.is.object(C[E+1][D])&&!twttr.is.fn(C[E+1][D])){this.merge(C[0][D],C[E+1][D])}else{C[0][D]=C[E+1][D]}}}return C[0]},extend:function(B,C){var A=function(){};A.prototype=C.prototype;B.prototype=new A();B.prototype.constructor=B;B.uber=C.prototype;if(C.prototype.constructor==Object.prototype.constructor){C.prototype.constructor=C}},klass:function(A,B){return twttr.magic(A,B)},augmentAndExtend:function(B,C,D){var A=twttr.namespaceOf(B);A[C]=function(){A[C].uber.constructor.apply(this,arguments)};twttr.extend(A[C],D);return A[C]},auxo:function(C,D,B){var A=twttr.is.object(B)?B:twttr;return twttr.augmentAndExtend(A,C,D)},augmentString:function(C,A){var B=window;C.split(".").forEach(function(F,E,D){B=B[F]=B[F]||(twttr.is.def(D[E+1])?{}:A)});return B},magic:function(B,A){if(twttr.is.string(B)){return twttr.augmentString(B,A)}else{return twttr.augmentObject(B,A)}},inspect:function(B){console.clear();var C=$(B);var H=C.data("events");var A=0;var G=0;var E=[];var D=[];for(key in H){E.push(key);A++;D.push("\n*******************\n");D.push("Events for "+key+"\n\n");for(fn in H[key]){var F=H[key][fn];G++;D.push(F.toString()+"\n")}}console.log("************* Summary *************");console.log("for target",C);console.log(A+" types of events",E);console.log(G,"Total Event Listeners");console.log("Event listeners assigned to target");console.log(D.join(" "))},is:{bool:function(A){return typeof A==="boolean"},nil:function(A){return A===null},def:function(A){return !(typeof A==="undefined")},number:function(A){return typeof A==="number"&&isFinite(A)},fn:function(A){return typeof A==="function"},array:function(A){return A?this.number(A.length)&&this.fn(A.splice):false},string:function(A){return typeof A==="string"},blank:function(A){return A===""},falsy:function(A){return A===false||A===null||A===undefined},object:function(A){return(A&&(typeof A==="object"||this.fn(A)))||false}},widget:function(A){A.prototype.bind=function(C,B){this.$element.bind(C,B)}}});if(!window.console){var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];window.console={};for(var i=0;i<names.length;++i){window.console[names[i]]=function(){}}}function _(C,A){if(twttr.i18n){var B=twttr.i18n[C];if(B){C=B}}return replaceParams(C,A)}function replaceParams(B,A){if(A){for(var C in A){B=B.replace(new RegExp("\\%\\{"+C+"\\}","gi"),A[C])}}return B}var h=function(){var A=$("<div/>");return function(B){return B?A.text(B).html().replace(/\"/gi,"&quot;"):B}}();function unh(A){return A?A.replace(/&(amp;)+/g,"&").replace(/&[a-z]+;/gi,function(B){if(unh.HTML_ESCAPE_TOKENS[B]){return unh.HTML_ESCAPE_TOKENS[B]}return B}):A}window.unh.HTML_ESCAPE_TOKENS={"&lt;":"<","&gt;":">","&quot;":'"'};function addSlashes(A){return A.replace(/\'/g,"\\'").replace(/\"/g,'\\"')}var reverseString=function(A){return A?A.split("").reverse().join(""):A};var numberWithDelimiter=function(B,A,C){A=A?A:",";C=C?C:".";parts=(""+B).split(".");parts[0]=reverseString(reverseString(parts[0]).replace(/(\d\d\d)/g,"$1"+A));if(parts[0][0]==A){parts[0]=parts[0].substring(1)}return parts.join(C)};var timeAgo=function(C){if(!C){return false}var H=new Date();var G=new Date(C);if(document.all){G=Date.parse(C.replace(/( \+)/," UTC$1"))}var D=H-G;var B=1000,F=B*60,A=F*60;if(isNaN(D)||D<0){return false}var E=-1;$.each([5,10,20],function(){if(D<this*B){E=this;return false}});if(E!=-1){return _("less than %{time} seconds ago",{time:E})}if(D<B*40){return _("half a minute ago")}if(D<F){return _("less than a minute ago")}if(D<B*90){return _("1 minute ago")}if(D<F*45){return _("%{time} minutes ago",{time:Math.round(D/F)})}if(D<F*90){return _("about 1 hour ago")}if(D<A*24){return _("about %{time} hours ago",{time:Math.round(D/A)})}return false};var updateTimeAgo=function(){$(".timestamp").each(function(){var B=$(this);var A=timeAgo(B.meta().time);if(A&&B.find("*").length==0){B.html(A)}});$(".timestamp-title").each(function(){var B=$(this);var A=timeAgo(B.meta().time);if(A){B.attr("title",A)}})};var DEBUG=false;$.extend({log:function(A){if(window.console){console.log(A)}},debug:function(A){if(DEBUG){console.log(A)}},inspect:function(B){var A="{\n";for(var C in B){A+="\t"+C+": "+B[C]+"\n"}A+="}";console.log(A);return A}});(function(){if(document.all){if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var A=new Number(RegExp.$1);if(A>=8){$.browser.msie8=true}else{if(A>=7){$.browser.msie7=true}else{$.browser.msie6=true}}}}})();var _tmp={};twttr.augmentObject(twttr,{templates:{},timeouts:{},wait:function(){var A={};twttr.clearWait=function(B){if(twttr.is.def(A[B])){clearTimeout(B);delete A[B]}};return function(E,C){var B="TIMER_"+(new Date()).getTime();var D=setTimeout(function(){if(!twttr.is.def(A[B])){return }E()},C);A[B]=D;return B}}(),processJson:function(json){if(typeof (json)=="object"){var evals=[];$.each(json,function(selector,content){var c=selector.charAt(0);if(c=="$"){evals.push(content)}else{if(c=="!"){var notification=window[selector.substring(1)+"Notification"];if(notification){(new notification()).setMessage(content).show()}}else{var $contentPadded=$("<div></div>").html(content);var $content=$(selector,$contentPadded);if($content.length==1){$(selector).replaceWith($content)}else{$(selector).html(content)}$(selector).show()}}});$.each(evals,function(index,js){if(js){eval(js)}})}},googleAnalytics:function(A){if(window.pageTracker){window.pageTracker._trackEvent("Ajax","refresh",A,null)}},trackPageView:function(C,B,D){if(window.pageTracker){var A;if(C){A=C.toString();if(B){A="/search/tweets/"+encodeURIComponent(h(page.query))}if(D){A=A+D}window.pageTracker._trackPageview(A)}else{window.pageTracker._trackPageview()}}},fadeAndReplace:function(A,B){$(A).fadeOut("medium",function(){$(A).html(B)});$(A).fadeIn("medium")},error:function(A){alert(A?A:_("Whoops! Something went wrong. Please refresh the page and try again!"))},loading:function(){$("#loader").fadeIn(200)},loaded:function(){$("#loader").fadeOut(200)},updateLocation:function(A,E){if(!E){E=document}if(A){var D=A.replace(/^https?:\/\/.+?\//,"").replace(/#/gi,"%23").replace(/\s/gi,"+");var C=D.replace(/[^\w\d_-].*$/,"");var B=(C.length>0)?$(E).find("#"+C):[];if(B.length>0){B.get(0).id=C+"_tmp_for_update_location"}E.location.hash=D;if(B.length>0){B.get(0).id=C}}},NON_CHAR_KEY_CODES:[8,9,16,17,18,19,20,27,33,34,35,36,37,38,39,40,45,46,91,92,93],isNonCharKeyCode:function(A){return $.inArray(A.keyCode,twttr.NON_CHAR_KEY_CODES)!=-1||((A.ctrlKey||A.metaKey)&&$.inArray(A.keyCode,[67,88])!=-1)}});$.extend($.expr[":"],{onthepage:"($(elem).is(':visible') && $(elem).parents(':hidden').length == 0)"});jQuery.fn.move=function(A){var B=$(this).html();$(this).remove();$(A).html(B)};jQuery.fn.meta=function(){var B={type:"attr",name:"data"};var C=$(this);if(C.length==1){return C.metadata(B)}else{var A=[];C.each(function(){A.push($(this).metadata(B))});return A}};jQuery.fn.visible=function(A){$(this).each(function(){$(this).css("visibility",A?"visible":"hidden")})};jQuery.fn.isLoading=function(){$(this).addClass("loading")};$.fn.isLoaded=function(){$(this).removeClass("loading")};$.fn.replace_text=function(C,B){var A=$(this).html();if(A){$(this).html(A.replace(C,B))}};var pluralize=function(C,B,A){return C==1?B:A};var setDocumentTitle=function(A){document.title=unh(A)||""};var addCountToDocumentTitle=function(A){document.title=(A?"("+numberWithDelimiter(A)+") ":"")+document.title.replace(/\([^)]*[0-9]\)\s+/gi,"")};var getCurrentUserScreenName=function(){return page.user_screenname||$('meta[name="session-user-screen_name"]:first').get(0).content};var sessionUserIsPageUser=function(){try{return $('meta[name="session-user-screen_name"]:first').get(0).content==$('meta[name="page-user-screen_name"]:first').get(0).content}catch(A){return false}};$.fn.focusEnd=function(){return this.each(function(){var A=this;if(A.style.display!="none"){if($.browser.msie){A.focus();var B=A.createTextRange();B.collapse(false);B.select()}else{A.setSelectionRange(A.value.length,A.value.length);A.focus()}}})};$.fn.focusFirstTextField=function(){return this.find("input[type=text]:visible:enabled:first").focus().length>0},$.fn.focusFirstTextArea=function(){return this.find("textarea:visible:enabled:first").focus().length>0};$.fn.focusFirstTexttarget=function(){return this.focusFirstTextField()||this.focusFirstTextArea()};$.fn.maxLength=function(A){return this.each(function(){$(this).keydown(function(B){return this.value.length<=A||twttr.isNonCharKeyCode(B)})})};$.fn.replaceClass=function(B,A){return this.each(function(){var C=$(this);if(C.hasClass(B)){C.removeClass(B).addClass(A)}else{if(C.hasClass(A)){C.removeClass(A).addClass(B)}}})};$.fn.isSelectAll=function(A){return this.each(function(){var B=$(this);if(typeof (A)=="string"){var D=$(A).find("input[type=checkbox]")}else{var D=A}function C(){var E=true;D.each(function(){if(!this.checked){E=false;return false}});B.get(0).checked=E}B.click(function(){var E=B.get(0).checked;D.each(function(){this.checked=E});$(this).trigger("select-all-changed",E)});D.click(function(){C();$(this).trigger("checkbox-changed",this.checked)})})};function bodytarget(){return $("body")}twttr.klass("twttr.Observer",function(){this.fns=[]}).method("listen",function(A){this.fns.push(A)}).method("unlisten",function(A){this.fns=this.fns.filter(function(B){if(B!==A){return B}})}).method("trigger",function(C,B){var A=B||window;this.fns.forEach(function(D){D.call(A,C)})});twttr.klass("twttr.User",function(A){this.screen_name=A}).method("update",function(B,A){twttr.tweeters[this.screen_name][B]=A;return this}).method("updateAll",function(B){for(var A in B){twttr.tweeters[this.screen_name][A]=B[A]}return this}).method("data",function(B){var A=twttr.tweeters[this.screen_name];return B?A[B]:A});twttr.augmentString("twttr.Tweeter",{UserFetchTimeout:5000,UserFetchUrl:"/users/show",_bail:false,_requesting:false,bail:function(){this._bail=true},isRequesting:function(){return this._requesting},getCurrentUser:function(A){return this.findById(page.sessionUserId,A)},find:function(F,C,G){var B,A;var D=this;if(twttr.is.fn(C)){B=window;A=C}else{B=C;A=G}var E=twttr.is.def(F.screen_name)?F.screen_name.toLowerCase():null;if(E&&twttr.tweeters[E]){A.call(B,new twttr.User(E),true);return true}else{$.ajax({url:this.UserFetchUrl,type:"GET",data:F,dataType:"json",timeout:this.UserFetchTimeout,beforeSend:function(){D._requesting=true},success:function(K){D._requesting=false;var H=K.user;if(H){var I={};var J=H.screen_name.toLowerCase();I[J]=H;twttr.Tweeter.merge(I,true);if(D._bail){D._bail=false;return false}A.call(B,new twttr.User(J),false)}else{if(D._bail){D._bail=false;return false}A.call(B,null,false)}},error:function(H){D._requesting=false;if(D._bail){D._bail=false;return false}A.call(B,null,false)}});return false}},findByScreenName:function(B,A,C){return this.find({screen_name:B,hovercard:true},A,C)},findById:function(D,A,C){var B=twttr._birdtags[D];if(twttr.is.def(B)){this.findByScreenName(B,A,C)}else{this.find({user_id:D,hovercard:true},A,C)}},merge:function(){twttr.tweeters={};twttr._birdtags={};return function(D,A){var D=D||{};if(A){twttr.merge(twttr.tweeters,D,true)}else{var C=twttr.merge(D,twttr.tweeters,true);twttr.merge(twttr.tweeters,C,true)}for(var B in twttr.tweeters){twttr._birdtags[twttr.tweeters[B].user_id]=B}}}()});twttr.loadTemplate=function(A,B){if(twttr.templates[A]){return twttr.templates[A]}B=B||function(){};$.get("/mustaches/"+A+".html",null,function(D){var C={templates:{}};C.templates[A]=D;twttr.merge(twttr,C,true);B(twttr.templates)},"html")};twttr.loadTemplates=function(A,B){B=B||function(){};A.forEach(function(D,C){twttr.loadTemplate(D,function(E){var F=A.every(function(G){return twttr.is.def(E[G])});if(F){B(twttr.templates)}})})};twttr.SimplePositioner={setPosition:function(C,G,E){var D={inline:false,direction:null,offsets:{inline:{top:0,left:0},below:{top:0,left:0},above:{top:0,left:0}}};var F=twttr.merge({},D,E,true);var B=C instanceof jQuery?C:$(C);var A=G instanceof jQuery?G:$(G);var H=A.offset();this._opts=F;if(!F.inline){switch(F.direction){case"above":this._positionAbove(B,A,H,F.offsets.above);break;case"below":this._positionBelow(B,A,H,F.offsets.below);break;default:if((H.top-$(document).scrollTop())>(F.itemHeight||B.height())){this._positionAbove(B,A,H,F.offsets.above)}else{this._positionBelow(B,A,H,F.offsets.below)}break}}else{this._positionInline(B,A,H,F.offsets.inline);B.css("left",H.left+F.offsets.inline.left)}},_positionAbove:function(C,B,H,A){$("body").addClass("loading-hoverer-above");C.addClass("position_above").removeClass("position_below").removeClass("position_inline");var G=Math.round(H.top+A.top);var F=$("body");var E=parseInt(F.css("padding-top"));G+=E>0?12:0;var D=F.outerHeight()-G-B.height();C.css({bottom:D,left:this._getLeftPosition(C,B,H)+A.left})},_positionBelow:function(A,C,D,E){var B=Math.round(D.top+C.height()+E.top);A.addClass("position_below").removeClass("position_above").removeClass("position_inline");A.css({top:B,left:this._getLeftPosition(A,C,D)+E.left})},_positionInline:function(A,B,D,C){A.css("top",D.top+C.top).addClass("position_inline").removeClass("position_below").removeClass("position_above")},_getLeftPosition:function(A,B,C){return Math.round(C.left+(B.width()/2))}};var updateCount=function(A,F,D){try{var E=$(A);var C=parseInt(E.html().replace(/[^0-9]/g,""))+F;return setCount(A,C,D)}catch(B){return false}};var setCount=function(A,C,D){try{var E=$(A);if(D){E.fadeOut(D,function(){E.html(numberWithDelimiter(C)).fadeIn(D)})}else{E.html(numberWithDelimiter(C))}return C}catch(B){return false}};var updateFollowingCount=function(A){return updateCount("#following_count",A)};var updateFollowersCount=function(A){return updateCount("#follower_count",A)};twttr.forbiddenAccess={decider:function(A){twttr.forbiddenAccess.unauthed(A)},unauthed:function(req){var message;try{message=eval("("+req.responseText+")").error}catch(err){}if(!message){if(req.status==403){message=_("You are not authorized to perform this operation.")}}if(message){new ShortNotification().setMessage(message).show()}},revoked:function(){window.location.reload()}};twttr.isReplyOnlyTweet=function(A){var B=/^\@([a-zA-Z0-9_]{1,20})\s*$/;if(A.match(B)){return true}return false};$.fn.isAlertBox=function(){return this.each(function(){var A=$(this);A.find("a").click(function(){var B=$(this).attr("href");$.ajax({type:"POST",dataType:"text",data:{authenticity_token:twttr.form_authenticity_token},url:"/account/clear_user_alert",success:function(){A.slideUp("fast");window.location=B}});return false})})};$.fn.isUpdateForm=function(){return this.each(function(){var O=$(this);var H=O.find("textarea").isCharCounter();var A=O.find("#tweeting_button, #update-submit");var B=O.find("label.doing");var J=O.find(".char-counter");var F=/^\s*@(\w+)\W+/;var D=/^\s*[dD][mM]?\s+(?:(\w+)\W+)?/;var I=O.find(".places-nearby");var E;var N=false;function M(){var P=H.val();if(twttr.isReplyOnlyTweet(P)){location.href=RegExp.$1;return false}if(P.length>140){alert(_("That tweet is over 140 characters!"));return false}else{if(P.replace(/s\*/g,"")==""){return false}else{A.addClass("btn-disabled").attr("disabled",true);return true}}}A.bind("click",function(Q){var P=$(this);Q.preventDefault();if(!P.hasClass("btn-disabled")){P.closest("form").submit()}});function K(P){if(twttr.is.def(P.users)){twttr.Tweeter.merge(P.users,true)}A.removeClass("btn-disabled").removeAttr("disabled");var Q=P.text;if(P.messageForFlash){(new ShortNotification()).setMessage(P.messageForFlash).show()}else{if(P.errorForFlash){(new InfoNotification()).setMessage(P.errorForFlash).show()}else{if($("body").attr("id")!="home"){(new ShortNotification()).setMessage(_("Your status has been updated!")).show()}else{if(P.status_li){$("#timeline tr.hentry:first").removeClass("latest-status");$.Timeline.prepend(P.status_li)}}setCount("#update_count",P.status_count,250);if(P.latest_status){updateTimeAgo();$("#latest_status").html(P.latest_status).isCurrentStatus(true)}}}H.val("").focusEnd();$("#in_reply_to_status_id").val("");$("#in_reply_to").val("");C("");H.trigger("change");J.removeClass("loading");if(document.all){J.text("140")}else{J.css("color","#ccc")}}function C(Q){var P;if(P=Q.match(D)){B.html(P[1]?_("Direct message %{person}:",{person:P[1]}):_("Direct message:"));A.val(_("send"))}else{if(P=Q.match(F)){B.html(_("Reply to %{screen_name}:",{screen_name:P[1]}));A.val(_("reply"))}else{B.html(_("What’s happening?"));A.val(_("update"))}}}H.bind("keyup blur focus",function(){C($(this).val())});O.submit(function(){if(M()){twttr.googleAnalytics("/status/update/refresh");var T=H.val();E={authenticity_token:twttr.form_authenticity_token,status:T,twttr:true};var Q=window.location.href;if($("body").attr("id")=="home"&&((Q.indexOf("page=")==-1)||Q.match(/page=1(?!\d)/))){E.return_rendered_status=true}var P=$("#in_reply_to_status_id").val();var S;if(P&&(S=T.match(F))){if(S[1]==$("#in_reply_to").val()){E.in_reply_to_status_id=P}}var R=$("#source").val();if(R){E.source=R}E.lat=$("#lat").val();E["long"]=$("#long").val();E.place_id=$("#place_id").val();G(E)}return false});function G(P){$.ajax({type:"POST",dataType:"json",url:"/status/update",data:P,beforeSend:function(){J.addClass("loading");if(document.all){J.html("&nbsp;&nbsp;&nbsp;&nbsp;")}else{J.css("color","transparent")}},success:K,error:twttr.forbiddenAccess.decider})}try{H.focusEnd()}catch(L){}})};$.fn.isLocationTrends=function(){var A=$("div#trends").meta()["global_id"];return this.each(function(){var I=$(this);var G=$("#location_menu");var B=$("#change_location");var L=$("#trends .trends-links");var E=new twttr.AttachedDialog($("#tt_menu span"),{content:$("#local_trends"),width:"545px",gravity:"east",weight:"top",modal:false});$(document).click(function(N){var M=$(N.target);if(E.opened&&!M.parents(".modal, .trends-links li").length){E.close()}});E.find("#location_done").click(function(){E.close();B.removeClass("active");if(!F()){D(A)}});var K=false;if($("#local_trends_notice").length){setTimeout(function(){(K=new twttr.AttachedDialog($("#tt_menu span"),{content:$("#local_trends_notice").parent(),width:"186px",gravity:"east",weight:"top",openonload:true,closeButton:true,modal:false})).bind("close",function(){D(A);return false}).open();K.find("#location_notice_set").click(function(){D(A);K.close();E.open();return false})},500)}function H(P){E.find("a.active-parent").removeClass("active-parent");var M=$(P).attr("parents");if(M){var N=M.split(" ");for(var O=0;O<N.length;O++){$("."+N[O]).addClass("active-parent")}}}function F(){return G.find("em")}function D(M){if(!M){M=0}$.ajax({type:"POST",url:"/users/update_trend_location_id",data:{authenticity_token:twttr.form_authenticity_token,trend_location_id:M},success:function(){L.append($("<em></em>").append(M))}});return false}B.click(function(){E.toggle();if(K){K.close()}B.toggleClass("active");return false});E.find("a").click(function(){var M=$(this);var N=M.attr("id").replace("trend_loc_","");E.find(".active").removeClass("active");E.find("#trend_loc_"+N).parent().addClass("active");H(M);if(N){$.ajax({type:"GET",dataType:"json",url:"/users/location_trends",data:{twttr:true,trend_location_id:N},beforeSend:function(){$("#trends_loading").show()},success:function(O){L.hide();L.fadeIn();$("#trends_loading").hide();if(O){var P=[];L.html("");$.each(O.trends,function(){var Q=this;var T=Q.name;var S=$('<a class="search_link" href="/search?q='+encodeURIComponent(Q.query)+'"name="'+T+'" title="'+T+'">'+T+"</a>");S.isSearchLink();var R=Q.description;if(R){L.append($("<li></li>").append(S).append($("<em></em>").append(R)))}else{L.append($("<li></li>").append(S))}});G.html(O.location["name"]);loadTrendDescriptions();D(O.location["id"])}else{}},error:function(O){$.debug("error: "+O.responseText)},complete:function(){$("#trends_loading").hide()}})}return false});var C=F();if(C){var J=$("#trend_loc_"+C);J.parent().addClass("active");H(J)}})};$.fn.isDirectMessageForm=function(){return this.each(function(){var L=$(this);var D=L.find("textarea").isCharCounter();var B=/^\s*[dD][mM]?\s+([A-Za-z0-9]{1,20})[^A-Za-z0-9]/;var F=L.find("select");var A=L.find("#dm-submit");var E=L.find(".char-counter");var G="";L.find("input[type=submit]").attr("disabled","disabled").addClass("btn-disabled");try{D.focusEnd()}catch(I){}function C(N){if(F.val()){return }if((matches=N.match(B))&&matches[1]&&(G!=matches[1])){var M=true;F.find("option").each(function(){if(this.innerHTML.toLowerCase()==matches[1].toLowerCase()){F.val(this.value);M=false;return false}});if(M){F.append(_('<option value="%{screen_name}">%{screen_name}</option>',{screen_name:matches[1]}));F.val(matches[1])}G=matches[1]}}A.click(function(M){var P=D.val();var N=P.match(B);var O=F.find("option[value="+F.val()+"]");if(N&&N[1]&&N[1].toLowerCase()==O.text().toLowerCase()){D.val(P.replace(B,""))}return true});F.change(function(M){D.trigger("update",M)});D.bind("keyup blur focus",function(M){C($(this).val());D.trigger("update",M)});function H(M){(new ShortNotification()).setMessage(M.messageForFlash).show();if($("body").attr("id")=="sent"){$.Timeline.prepend(M.direct_message_li)}D.val("");F.val("");G="";D.trigger("change");E.removeClass("loading");if(document.all){E.text("140")}else{E.css("color","#ccc")}}if(F.length>0){function J(){if(F.length&&(F.find("option").length==0)){$.ajax({type:"GET",dataType:"json",url:"/direct_messages/recipients_list",data:{twttr:true},success:function(N){if(N){var M=[];$.each(N,function(){var O=this;if((O.length>1)&&O[0]&&O[1]){M.push('<option value="'+O[0]+'">'+O[1]+"</option>")}});F.html('<option value="" selected="selected"></option>'+M.join(""))}},error:function(M){$.debug("error: "+M.responseText)}})}}var K=$("body").attr("id");if(K=="direct_messages"||K=="inbox"||K=="sent"){J()}L.bind("loadrecipients",null,function(M){J()});L.submit(function(){twttr.googleAnalytics("/direct_messages/create/refresh");var N=D.val();var M={authenticity_token:twttr.form_authenticity_token,text:N,"user[id]":F.val(),twttr:true};$.ajax({type:"POST",dataType:"json",url:"/direct_messages/create",data:M,beforeSend:function(){E.addClass("loading");if(document.all){E.text("")}else{E.css("color","transparent")}},success:H,error:twttr.forbiddenAccess.decider});return false})}})};$.fn.isTimelineTabLink=function(){return this.each(function(){var A=$(this);A.click(function(B){document.body.id=A.meta().dispatch_action}).bind("loading",null,function(B){A.parent("li").addClass("loading")}).bind("loaded",null,function(B){A.parent("li").removeClass("loading")}).bind("aborted",null,function(B){A.parent("li").removeClass("loading")})})};$.fn.isEmbeddedMediaExpander=function(){return this.livequery(function(){var A=$(this);var B=A.parent().find(".embedded_media");A.click(function(){B.slideToggle("normal",function(){if(A.hasClass("embedded_media_icon_active")){A.removeClass("embedded_media_icon_active")}else{A.addClass("embedded_media_icon_active")}})})})};$.fn.isCharCounter=function(){return this.each(function(){var A=true;var F=$(this);var J=F.closest("form");var E=J.find(".char-counter");var H=J.find("#tweeting_button, #update-submit, #dm-submit");var D=J.find("select");function C(){H.addClass("btn-disabled").attr("disabled","disabled");A=true}function G(){if(A){H.removeClass("btn-disabled").removeAttr("disabled");A=false}}function B(){var L=F.val();var K=L.length;E.html(""+(140-K));if(K<=0){E.css("color","#cccccc");C()}else{if(K<=140&&(D.length==0||D.val())){G()}else{C()}if(K>130){E.css("color","#d40d12")}else{if(K>120){E.css("color","#5c0002")}else{E.css("color","#cccccc")}}}}var I="blur focus change "+($.browser.mozilla?"paste input":"keyup");F.bind(I,function(K){B()});D.change(function(K){B()});F.focus()})};$.fn.isCurrentStatus=function(A){return this.each(function(){var F=$(this);var I=$("#latest_status");var C=F.find("#latest_text");var E=C.find(".status-text");var D=$(this).parent("#update_notifications");var H=I.find("strong");$("#latest_text_full, #latest_text").click(function(){$("#latest_text_full, #latest_text").toggle()});C.css("color","transparent");var B=$("#latest_text_full .status-text").text();$("#latest_text .status-text").html("<strong>"+_("Latest: ")+"</strong>").append(B.escapeHTML());C.css("color","");if(A){var G=I.find("span, strong");G.each(function(){$(this).data("old_color",$(this).css("color")).animate({color:"#333"},500)});clearTimeout(twttr.timeouts.latest_status_timeout);twttr.timeouts.latest_status_timeout=setTimeout(function(){G.each(function(){$(this).animate({color:$(this).data("old_color")},1500,function(){$(this).css("color","")})})},1500)}})};function initializeTimeline(){$.Statuses.initialize($("#timeline"))}function getListItemFromChild(A){return A.parents(".hentry:first")}function getStatusIdFromListItem(B){var A=/status_(.*)/i.exec(B.attr("id"));return(A)?A[1]:null}function getScreenNameFromListItem(B){var A=/u-([A-Za-z0-9_]+)/i.exec(B.attr("class"));return(A)?A[1]:null}function getShareIdFromListItem(B){var A=/(.)* s-([\d]+)(.)*/i.exec(B.attr("class"));return(A)?A[2]:getStatusIdFromListItem(B)}function timelineRefresh(D,A){var C=$("#results_update");if(C.length==0){return }if(!D||(("home,replies,inbox".indexOf(D)==-1)&&!D.match(/^\/?list/))){return }if(!A){A=($("#results_update").attr("href").replace(/^\//,"")||window.location.hash.replace(/^#/,"")||D).replace(/^([^\/])/,"/$1")}A=A.replace(/\/?list\//,"/");var B=$("#new_results_notification").meta().timeline;$("#new_results_notification").data("count",0);if(page.timelineRefresher){if(page.timelineRefresher.dispatchAction==D){return }else{page.timelineRefresher.stop()}}page.newResults=null;page.timelineRefresher=new Occasionally(B.delay*1000,B.max_delay*1000,function(){var E=false;if($("ol#timeline").length){$.ajax({method:"GET",dataType:"json",url:A,data:{since_id:getMaxStatusIdFromTimeline(),refresh:true},success:function(F){processTimelineRefresh(F,D)},error:function(){if(page.timelineRefresher){page.timelineRefresher.stop();page.timelineRefresher=null}}})}},function(){return page.newResults},B.decay);page.timelineRefresher.dispatchAction=D;page.timelineRefresher.start()}function getMaxStatusIdFromTimeline(){var A=0;$("ol#timeline > li").each(function(){var B=parseInt(this.id.replace(/^[A-Z_]+/gi,""));if(A<B){A=B}});return A}function processTimelineRefresh(J,D){if(twttr.is.def(J.users)){twttr.Tweeter.merge(J.users)}var G=$("#new_results_notification").meta().timeline;var K=$("<div>"+J["#timeline"]+"</div>");var A=$("#content ol#timeline");K.find("#timeline > li").each(function(){if(A.find("li#"+this.id).length){$(this).remove()}});var F=K.find("ol > li");var C=F.length;var E=($("#new_results_notification").data("count")||0)+C;if(C){A.prepend(F.addClass("buffered"));K.remove();A.find("li.buffered:gt("+(G.max_refresh_size-1)+")").remove();var B={results_count:numberWithDelimiter(E),username:getCurrentUserScreenName()};var H=$("#results_update").is(":visible")?"":' style="display:none;"';var I='<a id="results_update" class="minor-notification" href="/'+D+'" accesskey="n"'+H+">";if(D=="inbox"){I+=((E==1)?_("1 new message."):_("%{results_count} new messages.",B))}else{if(D=="replies"){I+=((E==1)?_("1 new mention of @%{username}.",B):_("%{results_count} new mentions of @%{username}.",B))}else{I+=((E==1)?_("1 new tweet."):_("%{results_count} new tweets.",B))}}I+="</a>";$("#results_update").replaceWith(I);$("#results_update").click(function(){$("#content ol#timeline > li.buffered").addClass("unbuffered").removeClass("buffered");if($("#new_results_notification").data("count")>G.max_refresh_size){$("#content ol#timeline > li:not(.unbuffered)").remove();var M=$("#content ol#timeline > li").attr("id").replace(/^[^0-9]+/,"");var L=($("#results_update").attr("href")||window.location.hash||D).replace(/^([^\/])/,"/$1")+"?max_id="+M+"&page=3&twttr=true";$("#pagination").html('<div id="#pagination"><a id="more" class="round more" rel="next" href="'+L+'">'+_("more")+"</a></div>")}else{$("#content ol#timeline > li.last-on-refresh").removeClass("last-on-refresh");$("#content ol#timeline > li.unbuffered:last").addClass("last-on-refresh")}updateTimeAgo();$("#content ol#timeline > li.unbuffered").removeClass("unbuffered");$("#results_update").hide();addCountToDocumentTitle();$.Timeline.triggerPageHeightChangedEvent();$("#new_results_notification").data("count",0);return false});$("#new_results_notification").data("count",E);$("#results_update:hidden").slideDown("normal",function(){$.Timeline.triggerPageHeightChangedEvent();var L=$(this);if(twttr.is.def(twttr.HOVERCARD)){twttr.HOVERCARD.reposition(L.get(0).offsetHeight+parseInt(L.css("margin-top")))}});addCountToDocumentTitle(E)}else{K.remove()}page.newResults=(C>0)}$(document).ready(function(){$().Page();twttr.setDefaultBucket();initializeTimeline();$("#pagination #more").isMoreButton();$("body").bind("ajaxSuccess",twttr.setupRetweetTips);twttr.setupRetweetTips();$("span.byline a").tipsy({gravity:"n"})});twttr.augmentObject(twttr,{RETWEETING_BACKGROUND_COLOR:"#ffffe5",_bucket:null,setDefaultBucket:function(){this._bucket=parseInt(page.sessionUserId)%2},getBucket:function(){return this._bucket},setBucket:function(A){this._bucket=A},applyTipsy:function(A,C,B){if(!A.data("tipsy_applied")){A.data("tipsy_applied",true);A.attr("title",A.attr("title")+C);A.tipsy(B)}},isRetweetTimeline:function(){return !!(location.hash&&location.hash.match(/retweet/))},setupRetweetTips:function(){$("span.status-body span.shared-content a.screen-name, div.shared-by-avatar-tiles a.profile-pic img.photo").each(function(){var A=$(this);if(A.data("tipsy_applied")||!twttr.isRetweetTimeline()){return }var B="left-align";var C="";if($("body#home").length>0&&!A.hasClass("you")){var C=_('<div class="retweet_tip_tip">Tip: To hide/show retweets from this user, click on their username and look for the retweet setting <div class="retweet-icon"></div></div>');B+=" retweet-tooltip"}twttr.applyTipsy(A,C,{gravity:"l",hideTimeout:10000,additionalCSSClass:B})});$("span.big-retweet-icon").each(function(){if($("body#profile").length==0){twttr.applyTipsy($(this),"",{gravity:"s",hideTimeout:10000})}else{$(this).attr("title","")}})},getStatusBodyParent:function(A){return A.parents(".status-body").parent()},setRetweetingStyles:function(B,E,D){var A=getListItemFromChild(B);var C=twttr.getStatusBodyParent(B);C.append("<span class='retweeting loading'>"+E+"</span>");A.addClass("no-hover");if($("body.status").length==0){A.css("background-color",twttr.RETWEETING_BACKGROUND_COLOR)}},unsetRetweetingStyles:function(B){var A=getListItemFromChild(B);var C=twttr.getStatusBodyParent(B);A.removeClass("no-hover");C.find(".retweeting.loading").remove()},animateStatusReplacement:function(B,D){var C=getListItemFromChild(B);var F=$(D.status_li);F.hide();C.after(F);if(C.hasClass("latest-status")){F.addClass("latest-status")}var A=F.height();var E=C.height();F.remove().show().height(E);if($("body.status").length==0){F.css("background-color",twttr.RETWEETING_BACKGROUND_COLOR)}C.replaceWith(F);if(A!=E){F.animate({height:A},500,function(){F.css("height",null);twttr.animateStatusColorChange(F)})}else{twttr.animateStatusColorChange(F)}if(D.latest_status){$("#latest_status").html(D.latest_status).isCurrentStatus(true)}},animateStatusColorChange:function(A){A.animate({backgroundColor:"#FFF"},1500,function(){A.css("background-color",null)})}});$.fn.Page=function(){var A=$('meta[name="session-user-screen_name"]:first').get(0);var D=$('meta[name="page-user-screen_name"]:first').get(0);var B=$('meta[name="session-userid"]:first').get(0);var C=A&&D&&A.content==D.content;if(typeof (page)=="undefined"){page={}}page=$.extend(page,{timeline:null,sessionUserScreenName:(A?A.content:null),sessionUserId:(B?B.content:null),pageUserScreenName:(D?D.content:null),loggedIn:$('meta[name="session-loggedin"][content="y"]').length>0,hideUnfavorited:C,isTimelineChange:false,currentTimelineChange:{},$oldTimelineLink:""})};$.Statuses={initialize:function(A){if(page.loggedIn){var B=$(A).find(".hentry");$.each($.Statuses.actions,function(){var C=this;C.apply(B)})}},actions:{isTweet:function(){this.livequery(function(){var A=$("body#show.status").length>0;var B=$("body#profile").length>0;if(!A&&!B){var C=$(this).find("a.hashtag");C.isSearchLink(SEARCH_CALLBACKS.hashtagLink)}})},isHoverable:function(){if($("body.ie,body.ie6").get(0)){this.livequery(function(){var A=$(this);A.hover(function(){A.addClass("hover")},function(){A.removeClass("hover")})})}},isFavoriteable:function(){this.find(".fav-action").live("click",function(){var D=$(this);if(D.hasClass("blocked")){return false}var B=D.parents(".hentry:first");var E=B.attr("id").replace(/status_/,"");var C=D.hasClass("fav")?"destroy":"create";twttr.googleAnalytics("/favorites/"+C+"/refresh/"+E);function A(){var F=D.hasClass("fav");D.removeClass(F?"fav":"non-fav").addClass(F?"non-fav":"fav").attr("title",(F?_("favorite this tweet"):_("un-favorite this tweet")))}$.ajax({type:"POST",dataType:"json",url:"/favorites/"+C+"/"+E,data:{authenticity_token:twttr.form_authenticity_token},beforeSend:function(){A();D.addClass("blocked")},complete:function(){D.removeClass("blocked")}});return false})},isReplyable:function(){this.find(".reply").live("click",function(){var E=$(this);var C=E.parents(".hentry:first");var G=C.attr("id").replace(/status_/,"");var A=C.attr("class").match(/u-([A-Za-z0-9_]+)/);var B=A[1];if(!B){alert(_("Whoops! Something went wrong. Please refresh the page and try again!"));return }if(C.hasClass("direct_message")){var F=$("#text");twttr.googleAnalytics("/direct_messages/reply/"+B+"/"+G);var D=$("#direct_message_user_id");if(!D.find("option[text='"+B+"']").attr("selected",true).length){D.append('<option value="'+B+'" selected="selected">'+B+"</option>")}F.trigger("update");$("#text").focusEnd()}else{if(C.hasClass("status")||C.hasClass("share")){var F=$("#status");twttr.googleAnalytics("/reply/"+B+"/"+G);if(F.size()){F.val("@"+B+" "+F.val().replace(RegExp("@"+B+" ?","i"),"")).trigger("update");$("#status").focusEnd();$("#in_reply_to_status_id").val(G);$("#in_reply_to").val(B);window.scroll(0,0)}else{window.location=E.find("a").attr("href");return false}}}window.scroll(0,0);return false})},isRetweetable:function(){this.find(".retweet-link").live("click",function(A){new RetweetInlineForm().show({targetNode:$(this)});A.preventDefault()})},isDeleteable:function(){this.find(".del").live("click",function(D){var C=$(this);var A=C.parents(".hentry:first");var F=A.attr("id").replace(/[^\d]*/,"");var E=A.hasClass("latest-status");var B;if(A.hasClass("direct_message")){B="/direct_messages/destroy"}else{B="/status/destroy"}if(confirm(_("Sure you want to delete this tweet? There is NO undo!"))){twttr.googleAnalytics(B+"/refresh/"+F);$.ajax({type:"POST",url:B+"/"+F,data:{authenticity_token:twttr.form_authenticity_token,latest_status:E},dataType:(B=="/status/destroy"?"json":null),beforeSend:function(){A.fadeOut(500);updateCount("#update_count",-1,250)},success:function(G){A.remove();if(B=="/status/destroy"){if(E){twttr.processJson(G);updateLatest()}}setCount("#update_count",G.status_count)},error:function(){A.fadeIn(0);(new InfoNotification()).setMessage(_("Whoops! Something went wrong. Please try again!")).show()}})}D.preventDefault()})},isUndoable:function(){this.find(".undo").live("click",function(){var C=$(this);var B=C.parents(".hentry:first");var A=B.attr("id").replace(/status_/,"");$.ajax({type:"POST",url:"/statuses/"+A+"/retweet",data:{_method:"delete",authenticity_token:twttr.form_authenticity_token,controller_name:page.controller_name,action_name:page.action_name,user_screenname:page.pageUserScreenName},dataType:"json",beforeSend:function(){C.attr("title","").removeClass("undo");twttr.setRetweetingStyles(C,_("Undoing..."))},success:function(D){if(D.status_li){twttr.animateStatusReplacement(C,D)}else{B.fadeOut(500,function(){var E=$("ol#timeline .hentry:visible:first");if(!E.hasClass("share")){E.addClass("latest-status")}})}(new InfoNotification()).setMessage(_("Your followers will no longer see the tweet as retweeted by you.")).show()},complete:function(){twttr.unsetRetweetingStyles(B)}});return false})},isMappable:function(){this.find(".geo_pin").live("click",function(){var B=jQuery(this);var A=B.next();var C=B.position();A.css({left:C.left-25,bottom:C.top+20});A.show();A.find(".map_close").click(function(){A.hide();return false})})}}};$.Timeline={prepend:function(A){$("#timeline").prepend(A);$.Timeline.triggerTimelineChanged()},append:function(A){$("#timeline").append(A);$.Timeline.triggerTimelineChanged()},registerTimelineEvent:function(A){$("body").bind("timeline-changed",A)},unregisterTimelineEvent:function(A){$("body").unbind("timeline-changed",A)},triggerTimelineChanged:function(){$("body").trigger("timeline-changed")},registerPageHeightChangedEvent:function(A){$("body").bind("page-height-changed",A)},unregisterPageHeightChangedEvent:function(A){$("body").unbind("page-height-changed",A)},triggerPageHeightChangedEvent:function(){$("body").trigger("page-height-changed")}};function basicMoreButtonHandler(A){return function(){var C=$(this);C.blur();if(C.hasClass("loading")){return false}var B=C.attr("href");var D=$("#more").text();$.ajax(jQuery.extend({type:"GET",url:B,dataType:"json"},A));return false}}$.fn.isMoreButton=function(){return this.live("click",basicMoreButtonHandler({beforeSend:function(){$("#timeline li:last-child").addClass("last-on-page");$("#more").addClass("loading").html("")},success:function(A){updateTimeAgo();if(twttr.is.def(A.users)){twttr.Tweeter.merge(A.users)}$("#timeline").append($(A["#timeline"]).find(".hentry"));$("#pagination").html(A["#pagination"]);if(window.onPageChange){onPageChange()}$.Timeline.triggerTimelineChanged()},error:function(){$("#timeline li:last-child").removeClass("last-on-page");$("#more").removeClass("loading").text(_("more"));(new ShortNotification()).setMessage(_("Whoops! Something went wrong. Please try again!")).show()}}))};$(function(){var request=function(data,success){return function(){var self=this;var $this=$(this);var notification=(new ProgressNotification()).setProgressMessage($this.attr("progress")).setCompletedMessage($this.attr("completed"));$.ajax({type:$this.attr("method"),dataType:"json",url:$this.attr("href")||$this.attr("action"),data:data.apply(self),success:function(){notification.done();if(success){success.apply(self)}},beforeSend:function(){twttr.loading();notification.show()},complete:twttr.loaded});return false}};$("form.restful").livequery("submit",request(function(){return $(this).serializeArray()},function(){$(this).trigger("submitted")}));$("a.restful").livequery("click",request(function(){return eval("("+$(this).attr("data")+")")}))});function updateLatest(){var A=$("#latest_status");if(A.length){A.isCurrentStatus(true)}$("#timeline li:first").addClass("latest-status")}function setTitleAndHeading(C){var K=$("#timeline_heading h1");var I=$("#timeline_heading h2");var C=C||$("body").attr("id");var A=h(page.query);var D=getCurrentUserScreenName();if(!twttr.titles_and_headings){var H={user:D,name:page.user_fullname};twttr.titles_and_headings={home:{title:_("Home"),heading:_("Home")},replies:{title:("@"+D),heading:_("Tweets mentioning @%{user}",H)},favorites:{title:_("Your Favorites"),heading:_("Your Favorites")},inbox:{title:_("Direct Messages"),heading:_("Direct messages sent only to you")},direct_messages:{title:_("Direct Messages"),heading:_("Direct messages sent only to you")},sent:{title:_("Sent Direct Messages"),heading:_("Direct messages you've sent")},retweets_by_others:{title:_("Retweets",H),heading:"&nbsp;"},profile_favorites:{title:_("%{user}'s Favorites",H),heading:_("%{user}'s Favorites",H)},profile:{title:_("%{name} (%{user}) on Twitter",H),heading:null}}}var E;if(C=="search"){E={title:_("Search - %{query}",{query:page.query})};var B=$("#side #saved_searches ul.sidebar-menu li.active");var J;if(B.length){var F=B.attr("id").replace("ss_","");J='<a href="/saved_searches/destroy/'+F+'" title="'+A+'" class="delete-search-link">'+_("Remove this saved search")+"</a></label>"}else{J='<a href="/saved_searches/create" class="save-search-link" title="'+A+'">'+_("Save this search")}J="<label>"+J+"</a></label>";if(page.searchResults){E.heading=J+_("Real-time results for <b>%{query}</b>",{query:A})}else{E.heading=J+_("No results for <b>%{query}</b>",{query:A})}}else{E=twttr.titles_and_headings[C]}if(E){var G=(C=="profile")?"":"Twitter / ";setDocumentTitle(G+E.title);I.remove();if(E.heading){K.html(E.heading);K.parent("div").show()}else{K.parent("div").hide()}if(C=="search"){K.find(".save-search-link").isSaveSearchLink().end().find(".delete-search-link").isRemoveSearchLink()}}}$.fn.isSaveSearchLink=function(){return this.each(function(){var A=$(this);var B=$("#saved_searches");var C=B.find("ul.sidebar-menu");A.click(function(){if(C.find("li").length>=10){(new InfoNotification()).setMessage(_("You can only save ten searches. To remove a saved search, select the search and click <strong>remove this saved search</strong>.")).show();return false}var E=A.attr("title");var D=$('<li><a href="/search?q='+encodeURIComponent(E)+'" class="search-link" title="'+h(E)+'"><span>'+h(E)+"</span></a></li>");D.find("a").isSearchLink(SEARCH_CALLBACKS.savedSearchLink);D.fadeOut(1,function(){C.append(D);D.fadeIn(100)});if(B.hasClass("collapsed")){B.trigger("expand")}B.fadeIn();$("#side ul.sidebar-menu li").removeClass("active");$("#side #custom_search").removeClass("active");D.addClass("active");$.ajax({type:"POST",dataType:"json",url:"/saved_searches/create",data:{q:E,authenticity_token:twttr.form_authenticity_token,twttr:true},beforeSend:function(){A.replaceWith('<span class="loading">'+_("Save this search")+"</span>")},success:function(F){D.attr("id","ss_"+F.id);setTitleAndHeading("search")},error:function(F){(new InfoNotification()).setMessage(F.responseText).show();D.remove()}});return false})})};$.fn.isRemoveSearchLink=function(){return this.each(function(){var A=$(this);var C=A.attr("title");var B=A.attr("href");A.click(function(){var D=$("#side #saved_searches li a[title='"+C+"']").parent("li");D.fadeOut(100,function(){D.remove();var E=$("#saved_searches ul.sidebar-menu a");if(E.length==0){$("#saved_searches").hide()}setTitleAndHeading("search");$("#side #custom_search").addClass("active")});$.ajax({type:"POST",url:B,data:{authenticity_token:twttr.form_authenticity_token,twttr:true},beforeSend:function(){A.replaceWith('<span class="loading">'+_("Remove this saved search")+"</span>")},error:function(){(new InfoNotification()).setMessage(_("Whoops! Something went wrong. Please refresh the page and try again!")).show()}});return false})})};function initializePage(A){if(("home,search".indexOf(A)==-1)&&($("body#list_show").length==0)){twttr.updateLocation(A)}initializeSidebar();$("#side form#sidebar_search").isSearchForm();$("#side .collapsible").isCollapsibleMenu();onPageChange(true);timelineRefresh(A);$(".saved-search-links li a").isSearchLink(SEARCH_CALLBACKS.savedSearchLink);$(".trends-links li a").isSearchLink(SEARCH_CALLBACKS.trendLink);$("#dm_tabs a, #retweet_tabs a").isTimelineTabLink();$("div.bulletin").isBulletin();$("ul.sidebar-menu a").isSidebarTab()}function initializeSidebar(){if($("#side ul.sidebar-menu li.active").length==0){var B=$("body").attr("id");var A=null;if(B=="search"){B=page.query;if(B){var C=$.grep($("#side ul.sidebar-menu li a"),function(D){return $(D).attr("title")==page.query})[0];if(C){A=$(C).parent("li")}else{$("#side #custom_search").addClass("active")}}}else{if(B){if(B=="sent"||B=="inbox"){B="direct_messages"}A=$("#side ul.sidebar-menu li#"+B+"_tab")}}if(A&&A.length){$(A.get(0)).addClass("active")}}}$.fn.isCollapsibleMenu=function(){function A(){var B=[];$("#side .collapsible").each(function(){var C=$(this);var E=C.find("h2.sidebar-title").attr("id");if(E){E=E.replace("_menu","")}else{return true}var D=C.hasClass("collapsed")?"C":"O";B.push(E+D)});$.cookie("menus",B.join("_"))}return this.each(function(){var D=$(this);var B=D.find("h2.sidebar-title");function F(G){$.ajax({type:"GET",url:G,dataType:"html",beforeSend:function(){D.addClass("loading")},success:function(H){D.find(".sidebar-menu").remove();B.after(H);C()},complete:function(){D.removeClass("loading")}})}function C(){var G=D.find(".sidebar-menu");D.find("#friends_view_all").fadeIn();G.slideDown(100,function(){D.removeClass("collapsed");A()})}function E(){var G=D.find(".sidebar-menu");D.find("a.xref").fadeOut(100);D.find("div#friends_view_all").fadeOut(100);G.slideUp(100,function(){D.addClass("collapsed");A()})}D.bind("expand",function(){C()});D.bind("collapse",function(){E()});B.click(function(H){if(H.target.nodeName.toLowerCase()=="a"){return true}var G=D.find("a.fetch-contents");if(D.hasClass("collapsed")){D.find("a.xref").fadeIn(100);if(G.length){F(G.attr("href"));G.remove()}else{C()}}else{E()}})})};$.fn.isSidebarTab=function(){return this.each(function(){var A=$(this);A.bind("click",function(){A.trigger("active")}).bind("active",null,function(B){if(A.parents("#side").length>0){$(window).scrollTop(0);$("#side ul.sidebar-menu li, #trends_list li").removeClass("active");$("#side #custom_search").removeClass("active");A.parent("li").addClass("active")}}).bind("loading",null,function(B){A.parent("li").addClass("loading")}).bind("loaded",null,function(B){A.parent("li").removeClass("loading")}).bind("aborted",null,function(B){A.parent("li").removeClass("loading")})})};$.fn.isInPageLink=function(A){return this.each(function(){var B=$(this);var C=B.meta();var D=C.dispatch_action;B.click(function(G){var E=G.srcElement||G.originalTarget||G.target;if(E.tagName.toLowerCase()=="em"){G.stopImmediatePropagation();return true}if($.browser.msie){this.hideFocus=true}var F=B.attr("href");page.query="";if(page.isTimelineChange){page.currentTimelineChange.abort();page.$oldTimelineLink.trigger("aborted")}page.currentTimelineChange=$.ajax({type:"GET",url:F,dataType:"json",beforeSend:function(){page.isTimelineChange=true;B.trigger("loading");page.$oldTimelineLink=B},success:function(H){if(twttr.is.def(H.users)){twttr.Tweeter.merge(H.users)}twttr.processJson(H);twttr.updateLocation(D=="list"?"/list"+F:F);if(D){page.action_name=D;$("body").attr("id",D);if(D=="direct_messages"||D=="inbox"||D=="sent"){$("#direct_message_form").trigger("loadrecipients")}}if(page.timelineRefresher){page.timelineRefresher.stop();page.timelineRefresher=null}addCountToDocumentTitle();timelineRefresh(D,F);$.Timeline.triggerPageHeightChangedEvent()},complete:function(H){$("#sidebar_search_q").val("").blur();onPageChange();$("body").addClass("replyable");B.trigger("loaded");page.isTimelineChange=false;if(A){A(B)}}});return false})})};function reloadTimeline(B){var A=(window.location.hash||B).toString().replace(/^#?([^\/])/,"/$1").replace(/^\/?list/,"");page.currentTimelineChange=$.ajax({type:"GET",url:A,dataType:"json",beforeSend:function(){page.isTimelineChange=true},success:function(C){if(twttr.is.def(C.users)){twttr.Tweeter.merge(C.users)}twttr.processJson(C);if(page.timelineRefresher){page.timelineRefresher.stop();page.timelineRefresher=null}addCountToDocumentTitle();timelineRefresh(B,A)},error:function(){(new InfoNotification()).setMessage(_("Whoops! Something went wrong. Please refresh the page and try again!")).show()},complete:function(){$("#sidebar_search_q").val("").blur();onPageChange();$("body").addClass("replyable");initializeTimeline();$("#timeline").removeClass("loading");page.isTimelineChange=false;if(B.match(/\/?list\//)){var C=$(".lists-links a[href="+h(A)+"]");$("#side ul.sidebar-menu li, #trends_list li").removeClass("active");$("#side #custom_search").removeClass("active");if(C.length){C.parent("li").addClass("active");setTimelineForListInPageLink(C)}}}})}$.fn.isBulletin=function(){return this.each(function(){var A=$(this);var B=A.find("a.close, a.hide");B.click(function(){A.fadeOut();return false})})};$.fn.isBrowserUpgradeBulletin=function(A){return this.each(function(){var B=$(this);B.find("a.close, a.hide").click(function(){$.cookie(A+"_upgrade","y")})})};$.fn.isDeviceFailBulletin=function(){return this.each(function(){var A=$(this);var B=A.find("a.hide-fail-notice, a.close, a.hide");var C=B.attr("id").replace("hide_device_","");B.click(function(){$.ajax({type:"POST",dataType:"text",url:"/devices/update/"+C,data:{authenticity_token:twttr.form_authenticity_token,"device[fail_alert]":"0",twttr:true},success:function(D){if(D.match(/success/)){A.fadeOut(200)}else{twttr.error()}},beforeSend:null,complete:null});return false})})};$.fn.isBouncingEmailBulletin=function(){return this.each(function(){var A=$(this);A.find("a.close, a.hide").click(function(){$.ajax({type:"POST",dataType:"text",url:"/bouncers/reset",data:{authenticity_token:twttr.form_authenticity_token,twttr:true},beforeSend:null,complete:function(){(new InfoNotification()).setMessage(_("Your email notifications should resume shortly.")).show()}});return false})})};$.fn.isNotificationSetting=function(){return this.each(function(){var B=$(this);var A=B.attr("id").replace("notify_on_","").replace("notify_off_","");B.click(function(){var C=B.attr("value");$.ajax({type:"POST",dataType:"text",url:"/friendships/device_"+C+"/"+A,data:{authenticity_token:twttr.form_authenticity_token,twttr:true},success:function(D){if(D.match(/success/)){$(".follow-control").trigger("refresh",["notify_"+(C=="follow"?"on":"off")])}else{twttr.error()}}})})})};$.fn.isNudgable=function(){return this.each(function(){var A=$(this);A.click(function(){var B=A.parents("form");B.find("input[name=authenticity_token]").val(twttr.form_authenticity_token);B.submit();return false})})};$.fn.isSlugField=function(B,A){return this.bind("keyup",function(){var C=slug($(this).val());if(B){B.val(C)}if(A){A.text(C)}})};var slug=function(A){return A.toLowerCase().replace(/[^a-z0-9]/g,"-").replace(/-+/g,"-").replace(/^[_-]+|[_-]+$/g,"")};$.fn.isDeleteButton=function(A){if(!confirm(A)){return false}};$.fn.disable=function(){$(this).attr("disabled","disabled").addClass("disabled")};$.fn.enable=function(){$(this).removeAttr("disabled").removeClass("disabled")};$.fn.textAreaSizeLimiter=function(C){var D=$(this);var A=C.maxLength;var B=C.infoMessageSelector;var E=D.parents("form").find("input[type=submit]");D.keyup(function(){var F=D.val().length;if(F>A){E.attr("disabled","DISABLED").removeClass("btn").addClass("dbtn");$(B).show()}else{E.removeAttr("disabled").removeClass("dbtn").addClass("btn");$(B).hide()}})};$.fn.isPasswordStrengthField=function(A,B){return this.each(function(){if(!A){return }if(!B){B={}}var H=$(this);var J=$(A);J.append('<span class="pstrength-text"></span>');var F=J.find(".pstrength-text");function E(K){J.children().each(function(){var L=$(this);if(L.hasClass("pstrength-text")){if(K){L.show()}else{L.hide()}}else{if(K){L.hide()}else{L.show()}}})}function I(K){var M=0;var L=B.minlength?B.minlength:6;if(K.length<L){return{score:K.length,message:_("Too short"),className:"password-invalid"}}if(B.username){var N=(typeof (B.username)=="function")?B.username():B.username;if(N&&(K.toLowerCase()==N.toLowerCase())){return{score:0,message:_("Too obvious"),className:"password-invalid"}}}if($.inArray(K.toLowerCase(),twttr.BANNED_PASSWORDS)!=-1){return{score:0,message:_("Too obvious"),className:"password-invalid"}}M+=K.length*4;M+=(D(1,K).length-K.length)*1;M+=(D(2,K).length-K.length)*1;M+=(D(3,K).length-K.length)*1;M+=(D(4,K).length-K.length)*1;if(K.match(/(.*[0-9].*[0-9].*[0-9])/)){M+=5}if(K.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)){M+=5}if(K.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)){M+=10}if(K.match(/([a-zA-Z])/)&&K.match(/([0-9])/)){M+=15}if(K.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&K.match(/([0-9])/)){M+=15}if(K.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&K.match(/([a-zA-Z])/)){M+=15}if(K.match(/^\w+$/)||K.match(/^\d+$/)){M-=10}if(M<0){M=0}if(M>100){M=100}if(M<34){return{score:M,message:_("Weak"),className:"password-weak"}}if(M<50){return{score:M,message:_("Good"),className:"password-good"}}if(M<75){return{score:M,message:_("Strong"),className:"password-strong"}}return{score:M,message:_("Very Strong"),className:"password-verystrong"}}function D(L,O){var K="";for(var N=0;N<O.length;N++){var P=true;for(var M=0;M<L&&(M+N+L)<O.length;M++){P=P&&(O.charAt(M+N)==O.charAt(M+N+L))}if(M<L){P=false}if(P){N+=L-1;P=false}else{K+=O.charAt(N)}}return K}function C(K){if(K&&J.hasClass(K)){return false}J.removeClass("password-weak").removeClass("password-good").removeClass("password-strong").removeClass("password-verystrong").removeClass("password-invalid");return true}function G(){var L=H.val();if(L.length==0){C();E(false)}else{if(L.length){E(true)}}if(L.length>0){var K=I(L);F.html(K.message);if(C(K.className)){J.addClass(K.className)}}}H.bind("show-password-meter",function(){J.show()});H.bind("hide-password-meter",function(){J.hide()});H.keyup(function(){G()});H.blur(function(){if(this.value.length==0){C();H.trigger("hide-password-meter")}});if(H.val()){G();J.show()}})};$.fn.isOAuthApplication=function(){return this.each(function(){var C=$(this);var B=C.attr("id").replace("oauth_application_","");var A=C.find(".revoke-access");A.click(function(){$.ajax({type:"POST",dataType:"json",url:"/oauth/revoke",data:{authenticity_token:twttr.form_authenticity_token,token:B,twttr:true},success:function(D){if(D.revoked){C.addClass("revoked")}else{C.removeClass("revoked")}A.text(D.label)}});return false})})};$.fn.screenName=function(){return $(this).find(".screen-name").text()||page.sessionUserScreenName};$.fn.userId=function(){var A;if(A=$(this).attr("id")){return A.replace("user_","")}else{return page.sessionUserId}};twttr.klass("twttr.MinimumDelayCallback",function(A){this.waitUntil=twttr.getTimeMillis()+A}).method("delay",function(C){var A=twttr.getTimeMillis();var B=this.waitUntil-A;if(B>0){setTimeout(function(){this.delay(C)}.pBind(this),B)}else{C.apply()}});twttr.augmentObject(twttr,{getTimeMillis:function(){return new Date().getTime()}});jQuery.fn.pulsate=function(F,C){var D=$(this);var E=1;var A=function(){E=E+0.5;var G=E>F?function(){}:B;D.fadeIn(C,G)};var B=function(){E=E+0.5;D.fadeOut(C,A)};B()};$("html").keypress(function(C){var B=C.charCode?C.charCode:C.keyCode?C.keyCode:0;var A=$(C.target);if(A&&A.hasClass("a-btn")&&B==32){A.click();C.preventDefault()}});$("#status_update_form").isUpdateForm();twttr.ajaxSetup=function(){$.ajaxSetup({data:{twttr:true,authenticity_token:twttr.form_authenticity_token}})};var searchSummize=function(E,B,F,A){page.query=E;var D=$("body#search #timeline li.search_result").attr("id");if(D&&page.retainTimeline){page.maxId=D.substring(7)}else{page.maxId=null}var C={q:page.query,rpp:20,maxId:page.maxId,callback:F||window.SEARCH_CALLBACKS.summize,layout:"none"};if(A){C.page=A}$("#side #q").val(E);B.trigger("loading");return $.ajax({url:page.summizeSearchUrl,data:C,dataType:"script",cache:false,complete:function(){$("#side #primary_nav li").removeClass("active");$("body").attr("id","search");var H="";if($("body.front").length){H=$("#trends_list li.active").length?"front/trends":"front/custom_search"}else{var G=$("#side li.active a.search-link").parents("div#trends, div#saved_searches");H=G.length==0?$("#side div#custom_search.active").attr("id"):G.attr("id")}twttr.trackPageView($("body").attr("id"),(page.query&&page.query.length>0?page.query:null),"/"+H+(!page.retainTimeline?"/ajax":"/ajax/more"));B.trigger("loaded");page.retainTimeline=null;page.isTimelineChange=false}})};var sponsoredSearch=function(A){if(page.showSS){$.ajax({url:"/timeline/garuda_search",data:{query:page.query,authenticity_token:twttr.form_authenticity_token},type:"post",dataType:"html",success:function(B){clearTimelineIfNewSearch();$("#timeline").prepend(B);processSummizeInternal(A)},error:function(){clearTimelineIfNewSearch();processSummizeInternal(A)}})}else{clearTimelineIfNewSearch();processSummizeInternal(A)}};var processSummize=function(A){var B=getPageNumAndUrl(A)[0];if(B==2){sponsoredSearch(A)}else{clearTimelineIfNewSearch();processSummizeInternal(A)}};var clearTimelineIfNewSearch=function(){var A=(page.query!="");if(A){if(!page.retainTimeline){$("#timeline").empty();$("#pagination").empty();$("#content .no-results").remove();$("#results_update").hide()}}};var getPageNumAndUrl=function(A){var E=$(A);var B=1;var D;var C=E.find(".paginator a.next");if(C.length){D=C.attr("href");D.match(/\?.*page=([0-9]+)/gi);B=RegExp.$1;B=B?parseInt(B):1}return[B,D]};var processSummizeInternal=function(B){var J=page.trendDescriptions[page.query];if(J){$("#trend_info").hide();$("#trend_description span").text(_("%{trend} is a popular topic on Twitter right now.",{trend:J[0]}));$("#trend_description p").html(J[1]);$("#trend_description").show()}else{$("#trend_description").hide();$("#trend_info").show()}var H=$(B);var M=$(".homepage #timeline").length;var C=M&&!$(".homepage #timeline li").length;var F=$("#timeline");var L=(page.query!="");$("body").attr("id","search");var E=getPageNumAndUrl(B)[1];var D=[];if(L){D=renderResultsFromSummize(H,F,M)}$("#container, #side_base").show();F.find(".msgtxt a").each(twttr.appendClassesToSearchResults);F.find(".msgtxt").prev().addClass("tweet-url screen-name");F.find("span.vcard a").addClass("tweet-url profile-pic");F.find(".search_result").find(".status-body a,.vcard a").each(function(){var P=$(this);var N=P.attr("href");if(N.match(/^\/search\?q=([^&]+)/)){P.removeAttr("target");var O=decodeURIComponent(RegExp.$1);P.attr("title",O);P.isSearchLink(O.match(/^#/)?SEARCH_CALLBACKS.hashtagLink:SEARCH_CALLBACKS.inResultsLink)}else{if(N.match(/^https?:\/\/twitter\.com/)){P.removeAttr("target")}}});if(page.searchResults=(D.length>0&&L)){if(!M){enfavoriteSummize(D)}page.maxId=D[0];if(E){$("#pagination").empty().html('<a id="search_more" class="round more" rel="next" href="'+E+'">'+_("more")+"</a>").find("a").isSearchMoreButton(M)}else{$("#pagination").empty().html('<p class="no-more-tweets">'+_("Older tweets are temporarily unavailable.")+"</p>")}}else{var I=[_("Try a more general search."),_("Try using different words.")];var K='<div class="no-results">'+_("Suggestions:")+"<ol>";for(var G=0;G<I.length;G++){K+="<li>"+_(I[G])+"</li>"}K+="</ol></div>";setTimeout(function(){$("#timeline_heading").after(K)},1)}twttr.updateLocation("search?q="+encodeURIComponent(page.query));initializeSidebar();var A=$("#sidebar_search_q, #home_search_q");if(A.val()!=page.query){A.val(page.query);A.css("color","#000")}onPageChange(C);$("#side #rssfeed a.search-rss").attr("href","http://search.twitter.com/search.atom?q="+h(encodeURIComponent(page.query)));summizeRefresh()};if(!window.SEARCH_CALLBACKS){window.SEARCH_CALLBACKS={summize:"processSummize",load:"pageLoadSearch",searchLink:"processSearchLink",trendLink:"processTrendLink",savedSearchLink:"processSavedSearchLink",searchForm:"processSearchForm",hashtagLink:"processHashtagLink",inResultsLink:"processInResultsLink",more:"processSearchMore",refresh:"processSearchRefresh"};$.each(window.SEARCH_CALLBACKS,function(){window[this]=window.processSummize})}function renderResultsFromSummize(C,B,A){var D=[];C.find(".result").each(function(){var J=$(this);J.find(".location,.thread,.to_av,p.clearleft,.expand,#share").remove();var F=$(J.find(".avatar").get(0));F.replaceWith('<span class="thumb vcard author">'+F.html()+"</span>");var L=$(J.find(".info").get(0));var M,G,E;L.find("a.lit").each(function(){E=$(this).attr("href");var P=E.match(/\/(\w+)\/statuses\/(\d+)/);M=P[2];D.push(M);G=P[1]});var H=L.find(".source").remove();L.find("a").remove();L.html('<a href="'+E+'">'+L.html()+"</a>");L.append(H);var O='<span class="meta entry-meta">'+L.html().replace(/\u00B7/g,"")+"</span>";L.remove();var N=$(J.find(".msg").get(0));N.replaceWith(($.browser.msie6?'<img src="http://s.twimg.com/a/1267135446/images/white.png" width="1" height="50" align="left">':"")+N.html().replace(/a>\s*:\s*<span/,"a> <span")+O);var K=J.html();if(!A){K='<span class="actions"><div><a href="#" class="fav-action non-fav" id="status_star_'+M+'"> &nbsp; </a></div></span>'+K;K+='<ul class="actions-hover"><li><span class="reply"><span class="reply-icon icon"></span><a href="/home?status=@'+G+"%20&in_reply_to_status_id="+M+"&in_reply_to="+G+'">Reply</a></span></li><li><span class="retweet-link"><span class="retweet-icon icon"></span><a href="#" title="Retweet">Retweet</a></span></li></ul>'}var I=$('<li class="hentry status search_result u-'+G+'" id="status_'+M+'"><span class="status-body">'+K+"</span></li>");B.append(I)});return D}function enfavoriteSummize(A){if(page.loggedIn&&A.length>0){$timeline=$("#timeline");$.ajax({type:"POST",dataType:"json",url:"/favourings/intersect_for_search",data:{authenticity_token:twttr.form_authenticity_token,"status_id[]":A,twttr:true},beforeSend:null,success:function(B){$.map(B,function(C){$timeline.find("#status_"+C+" .non-fav").addClass("fav").removeClass("non-fav")})},complete:null})}}function summizeRefresh(){if(page.timelineRefresher){page.timelineRefresher.stop();page.timelineRefresher=null;addCountToDocumentTitle()}var B=$("#results_update");B.data("count",0);var A=$("#new_results_notification").meta().search;if(page.summizeRefresher||$("#results_update").length==0){return }page.newResults=null;page.summizeRefresher=new Occasionally(A.delay*1000,A.max_delay*1000,function(){var C=false;$.ajax({dataType:"script",url:page.summizeSearchUrl,data:{q:page.query,since_id:page.maxId,refresh:true,callback:"processSummizeRefresh"},cache:false,callback:null})},function(){return page.newResults},A.decay);page.summizeRefresher.start()}function processSummizeRefresh(B){if(decodeURIComponent(B.query).replace(/\+/g," ")==page.query&&B.total){page.maxId=B.max_id;var C=page.summizeRefreshResults=(page.summizeRefreshResults||0)+B.total;var A=$("#results_update").is(":visible")?"":' style="display:none;"';var D='<a id="results_update" class="minor-notification"'+A+">";D+=(C==1)?_("1 more tweet since you started searching."):_("%{results_count} more tweets since you started searching.",{results_count:numberWithDelimiter(C)});D+="</a>";$("#results_update").replaceWith(D);$("#results_update:hidden").slideDown();$("#results_update").attr("title",page.query).attr("href","/search?q="+encodeURIComponent(h(page.query))).isSearchLink(SEARCH_CALLBACKS.refresh).click(function(){addCountToDocumentTitle();return false});if(C){addCountToDocumentTitle(C)}page.newResults=true}else{page.newResults=false}}$.fn.isSearchMoreButton=function(A){return this.each(function(){var B=$(this);B.click(function(){B.blur();var D=B.attr("href");D.match(/\?.*page=([0-9]+)/gi);var C=RegExp.$1;page.retainTimeline=true;$("#timeline li:last-child").addClass("last-on-page");searchSummize(page.query,B,SEARCH_CALLBACKS.more,C);B.addClass("loading").html("");return false})})};function onPageChange(A){var C=$("body").attr("id");setTitleAndHeading(C);if(!A){if(page.summizeRefresher){page.summizeRefresher.stop();page.summizeRefresher=null;page.summizeRefreshResults=null}if(!page.retainTimeline){$("#results_update").hide()}$(".no-results").remove();$("#new_results_count").html("0")}$(".in-page-link").isInPageLink();$(".in-page-list-link").isListInPageLink();try{$(".in-page-list-label").isListInPageLabel();$(".in-page-label").isInPageLabel()}catch(B){}if(C=="list"||C=="list_show"){C=(window.location.hash||window.location.pathname).replace(/^#/,"").replace(/^([^\/])/,"/$1");if(C.indexOf("/list")!=0){C="/list"+C}}twttr.trackPageView(C,(page.query&&page.query.length>0?page.query:null),A?null:"/ajax")}$.fn.isSearchLink=function(A){return this.each(function(){var B=$(this);B.click(function(C){C.preventDefault();if($.browser.msie){this.hideFocus=true}if(page.isTimelineChange&&page.currentTimelineChange){page.currentTimelineChange.abort();page.$oldTimelineLink.trigger("aborted");page.isTimelineChange=false}page.isTimelineChange=true;page.currentTimelineChange=searchSummize(B.attr("name")?B.attr("name"):B.attr("title"),B,A);if(B.parents("#side").length>0){$("#side ul.sidebar-menu li").removeClass("active");B.parent("li").addClass("active")}$("#trends_list li.active a").removeClass("active")})})};$.fn.isSearchForm=function(){return this.each(function(){var B=$(this);var A=$(B.find('input[type="text"]')[0]);var C=B.find("#sidebar_search_submit");A.Watermark(_("Search")).focus(function(){A.select();return true});C.click(function(){B.submit()});B.submit(function(){var D=A.val();if(D!=""){C.addClass("loading");searchSummize(D,B,SEARCH_CALLBACKS.searchForm)}$("#side ul.sidebar-menu li").removeClass("active");$("#side #custom_search").addClass("active");return false});B.bind("loaded",null,function(D){C.removeClass("loading")})})};function loadTrendDescriptions(){$("#trends a").each(function(){var A=$(this);var C=A.parent().find("em");if(C.length){var B=A.text();var D=C.text().replace(new RegExp(B.replace(/([^\w])/gi,"\\$1"),"gi"),"<strong>"+B+"</strong>");page.trendDescriptions[A.attr("title")]=[B,D]}})}$(document).ready(function(){$("#tweet_search_submit").click(function(){$("#tweet_search").submit()});$("#content #trend_description img").tipsy({gravity:"s"});page.trendDescriptions={};loadTrendDescriptions();if($("body").attr("id")=="search"){onCondition(function(){return page.summizeResults},function(){window[SEARCH_CALLBACKS.summize](page.summizeResults)})}});twttr.appendClassesToSearchResults=function(){var A=$(this);A.addClass("tweet-url");if(A.text().match(/^@/)){A.addClass("username")}else{if(A.text().match(/^#/)){A.addClass("hashtag")}else{A.addClass("web")}}};var LIST_PUBLIC_MODE="public";var LIST_PRIVATE_MODE="private";var LIST_MAX_NAME_LENGTH=25;var LIST_MAX_DESCRIPTION_LENGTH=100;var numeric_mode=function(A){switch(A){case"public":return 0;case"private":return 1;default:return 0}};var updateListFollowersCount=function(A){return updateCount("#subscribers_tab .stat-count",A)};var updateListFollowingCount=function(A){return updateCount("#members_tab .stat-count",A)};var fadeUserOnListUnfollow=function(A){A.fadeOut("medium",function(){A.remove()})};var onListMembersPage=function(A){return $("body").hasClass("lists_members")&&$('.list-header h2 a[href="'+A.uri+'"]').length==1};var linkToList=function(A,B){A.dispatch_action="list";return'<li><a class="list_'+A.id+'" href="'+A.uri+'" data="'+h(JSON.stringify(A))+'">'+(B?"<em />":"")+"<span>"+listDisplayName(A)+"</span></a></li>"};var listDisplayName=function(A){return(page.sessionUserScreenName&&page.sessionUserScreenName==A.user?h(A.slug):"<b>@</b>"+h(A.user)+"/<wbr/>"+h(A.slug))+lockIconForList(A)};var lockIconForList=function(A){return(A.mode==LIST_PRIVATE_MODE)?'<span class="lock-icon" title="Private List"></span>':""};var findListIndexBySlug=function(A,B){return jQuery.map(A,function(D,C){if(D.slug==B){return C}else{return null}})};$.fn.isUserListMenu=function(){var A=$("#list_menu");return this.one("click",function(){var D=$(this);var E=D.parents(".user");var C={};$.map(E.meta().lists,function(F){C[F.slug]=true});$("body").click();D.addClass("clicked").after(A.html());var B=D.siblings("ul");if(B.find("li:not(.new-list)").size()>=twttr.ListPerUserLimit){B.find(".new-list").remove()}B.find("li").each(function(){var F=$(this);if(F.hasClass("new-list")){F.isNewListLink()}else{F.isUserListItem(C[F.find('input[type="checkbox"]').meta().slug])}});$("html").one("click",function(){D.removeClass("clicked").blur().siblings("ul").remove().end().isUserListMenu();return false});return false})};$.fn.isUserListItem=function(D){var A=function(I,H,F,G){I.show();H.hide();var E=(G=="POST");H.attr("checked",E);F.unbind("click.checkbox");F.bind("click.while-processing",function(){return false})};var C=function(H,G,F,E){H.hide();G.show();F.unbind("click.while-processing");F.bind("click.checkbox",function(I){B.call(this,F,G,H,E);return false})};var B=function(M,F,I,L){var H=L?"DELETE":"POST";var G=M.parents(".user");var K=G.attr("id").replace("user_","");var J={authenticity_token:twttr.form_authenticity_token,twttr:true};var E=M.find('input[type="checkbox"]').meta().uri+"/members";if(H=="POST"){J["member[id]"]=K}else{E+="/"+K}$.ajax({type:H,dataType:"json",url:E,data:J,beforeSend:function(){A(I,F,M,H)},complete:function(){C(I,F,M,L)},success:function(N){L=(H=="POST");F.attr("checked",L);if(H=="POST"){addListToUser(G,N);if(onListMembersPage(N)){updateListFollowingCount(1)}}else{removeListFromUser(G,N);if(onListMembersPage(N)){fadeUserOnListUnfollow(G);updateListFollowingCount(-1)}}},error:function(){F.attr("checked",L)}})};return this.each(function(){var E=$(this);var F=E.find('input[type="checkbox"]');var H=E.find(".loading-spinner");var G=false;if(D){G=F.attr("checked",true)}E.bind("click.checkbox",function(I){B.call(this,E,F,H,G);return false})})};$.fn.isNewListLink=function(){return this.click(function(){var A=$(this).parents(".user");if(A.length==0){A=null}$(this).parent(".ul").remove();openListDialog(true,{userObject:A});return false})};$.fn.isEditListLink=function(){return this.click(function(){openListDialog(false,$(this).meta());return false})};var openListDialog=function(D,F){if(!F){F={}}var G=$("#list_dialog");var B=$(G.html());var A=new twttr.dialog(false,{closeButton:true,content:B,heading:$($("#list_dialog_header").html()),modal:true,width:"405px"});A.bind("close",function(){A.$root.remove()});var E="";A.$root.addClass("list-dialog");if(D){A.$root.addClass("create-list-dialog")}else{E=F.description;A.$root.addClass("update-list-dialog").find('input[type="submit"]').val(_("Update list")).end().find(".list-name").val(F.name).end().find(".list-slug-title-and-slug").show().end().find(".list-description").val(E).end().find(".list-link span").text(F.slug).end().find('input[name="list[mode]"][value="'+numeric_mode(F.mode)+'"]').attr("checked",true);var C=A.find(".private-warning");A.find('input[name="list[mode]"]').change(function(){if(this.value==numeric_mode(LIST_PRIVATE_MODE)&&this.checked){C.show()}else{C.hide()}})}$(".list-description",A.$root).maxLength(LIST_MAX_DESCRIPTION_LENGTH-2);A.find(".list-name").focus();A.$root.isListDialog(D,F,A);A.open()};$.fn.isListDialog=function(C,A,B){return this.each(function(){var G=$(this);var F=A.userObject;var D=G.find("form");D.find(".list-name").one("keyup",function(){console.log("keyup");$(this).siblings(".list-slug-title-and-slug").show()}).isSlugField(D.find(".list-slug-field"),D.find(".list-link span"));if(F){D.find(".list-member-id").val(F.userId())}var E=$(this).find('input[type="submit"]');D.submit(function(I){var H=D.serialize();if(!C){H+="&"+$('<input type="hidden" name="_method" value="PUT" />').serialize()}$.ajax({type:"POST",dataType:"json",url:C?D.attr("action"):A.uri,data:H,beforeSend:function(){E.attr("disabled","disabled")},success:function(J){B.close();B.$root.remove();if(C){addListToMenu(J);if(F){addListToUser(F,J)}addListToLists(J);(new ShortNotification()).setMessage(_("Yay! Your list was created.")).show()}else{window.location=J.uri}},error:function(J){(new InfoNotification()).setMessage(J.responseText).show()},complete:function(){E.removeAttr("disabled","disabled")}});I.preventDefault()})})};$.fn.isDestroyListLink=function(){return this.click(function(D){var C=$(this);var A=C.next("form");var B=A.attr("action");if(confirm(_("Are sure you want to delete this list? There is NO undo!"))){$.ajax({url:B,type:"POST",dataType:"json",data:{_method:"delete",authenticity_token:twttr.form_authenticity_token,twttr:true},beforeSend:function(){C.disable()},success:function(){document.location="/"},error:function(){C.enable()}})}return false})};$.fn.isSubscribeListLink=function(){return this.click(function(B){var A=$(this);$.ajax({url:A.attr("href"),type:"POST",dataType:"json",data:{authenticity_token:twttr.form_authenticity_token,twttr:true},beforeSend:function(){A.disable()},complete:function(){A.enable()},success:function(){A.parents(".list").addClass("subscriber");updateListFollowersCount(1)},error:function(){A.parents(".list").removeClass("subscriber")}});return false})};$.fn.isUnsubscribeListLink=function(){return this.click(function(B){var A=$(this);$.ajax({url:A.attr("href"),type:"POST",dataType:"json",data:{_method:"delete",authenticity_token:twttr.form_authenticity_token,twttr:true},success:function(){A.parents(".list").removeClass("subscriber");var C=$("#lists_subscribers #follow_grid #user_"+page.sessionUserId);fadeUserOnListUnfollow(C);updateListFollowersCount(-1)},error:function(){A.parents(".list").addClass("subscriber")}});B.preventDefault()})};$.fn.isListInPageLink=function(){return this.each(function(){var A=$(this);A.isInPageLink(setTimelineForListInPageLink)})};var setTimelineForListInPageLink=function(A){$("#timeline_heading").show();var E=$("#timeline_heading h1");var D=$("#timeline_heading h2");var C=A.meta();var B=h(C.uri);var F=listDisplayName(C);D.remove();E.html(F);E.after('<h2 class="list-subheading"><p class="list-numbers"><a href="'+B+'/members">'+_("Following:")+" <span>"+h(C.member_count)+"</span></a>"+(C.mode==LIST_PRIVATE_MODE?"":'<a href="'+B+'/subscribers">'+_("Followers:")+" <span>"+h(C.subscriber_count)+"</span></a>")+'</p><p class="list-link"><a href="'+B+'">'+_("View list page")+"<span> ›</span></a></p></h2>");if(C.member_count==0){$("#timeline_heading h2").append($(C.user==page.sessionUserScreenName?"#list_no_members_owner":"#list_no_members").html())}setDocumentTitle("Twitter / "+C.full_name)};var addListToUser=function(B,A){return B.each(function(){if(findListIndexBySlug(B.meta().lists,A.slug).length==0){B.meta().lists.push(A);if(B.find(".list-tags").length>0){B.find(".list-tags-outer:hidden").show();B.find(".list-tags").append(linkToList(A))}}})};var removeListFromUser=function(B,A){$.each(findListIndexBySlug(B.meta().lists,A.slug),function(){Array.remove(B.meta().lists,this);B.find(".list-tags .list_"+A.id).each(function(){$(this).parent("li").remove()});if(B.meta().lists.length==0){B.find(".list-tags-outer:visible").hide()}})};var addListToMenu=function(B){var A=$("#list_menu");A.find(".new-list").before('<li><img class="loading-spinner" src="http://s.twimg.com/a/1267135446/images/spinner.gif" style="display: none;" alt="waiting" title="waiting" height="14" width="14"/><input type="checkbox" id="list_'+B.id+'" data="'+h(JSON.stringify(B))+'" /> <label for="list_'+B.id+'">'+h(B.name)+lockIconForList(B)+"</label></li>")};var isInPageLists=function(){return $("#side_lists.in-page-lists").length==1};var addListToLists=function(C){var B=isInPageLists();var A=$("ul.lists-links").siblings(".no-lists").remove().end().append(linkToList(C,B)).find(".list_"+C.id);if(B){A.addClass("in-page-list-link").isListInPageLink().isSidebarTab().click()}};var bindAdminListActions=function(){$("#admin_list a.destroy-list").isDestroyListLink();$("#admin_list a.edit-list").isEditListLink()};var isMoreButton=function(){$("#lists_pagination #more").live("click",basicMoreButtonHandler({beforeSend:function(){$("#more").addClass("loading").html("")},success:function(A){$("#lists_table tbody").append($(A["#lists"]));$("#lists_pagination").html(A["#pagination"])},error:function(){$("#more").removeClass("loading").text(_("more"));(new ShortNotification()).setMessage(_("Whoops! Something went wrong. Please try again!")).show()}}))};$.fn.equals=function(A){return this.length==1&&A.length==1&&this.get(0)==A.get(0)};$.fn.hasParent=function(A){return jQuery.inArray(A[0],this.parents())>-1};function InlineForm(A){this.initialize(A)}jQuery.extend(InlineForm.prototype,{defaultOptions:{title:"",submitBtnValue:"",showCancel:true,closeOnOutsideClick:true,formClass:"",timelineChangedEvents:false,pageHeightChangedEvents:false},overrideDefaultOptions:{},initialize:function(A){this.options=jQuery.extend({},this.defaultOptions);jQuery.extend(this.options,this.overrideDefaultOptions);jQuery.extend(this.options,A);this.$form=$('<div class="inline-form '+this.options.formClass+'"></div>');this.$buttonParent=$('<div class="inline-form-buttons"></div>');this.$button=$('<button type="button" class="btn">'+this.options.submitBtnValue+"</button>");if(this.options.showCancel){this.$cancel=$('<span class="cancel">&nbsp;</span>')}this.$form_inner=$('<div class="inline-form-inner"></div>');this.$input=$('<textarea class="inline-form-input"></textarea>');this.$inputsPrompt=$('<div class="inline-inputs-prompt"></div>');this.$title=$('<div class="title">'+this.options.title+"</div>");this.$body=$('<div class="body">'+(this.options.body||"")+"</div>");this.initEvents()},initEvents:function(){this.buttonEvent=this.submitForm.pBind(this);this.closeEvent=this.close.pBind(this);this.outsideClickEvent=this.destroyFromEvent.pBind(this);this.timelineEvent=this.timelineEvent.pBind(this);if(this.options.timelineChangedEvents){$.Timeline.registerTimelineEvent(this.timelineEvent)}if(this.options.pageHeightChangedEvents){this.pageHeightChangedEvent=this.pageHeightChangedEvent.pBind(this);$.Timeline.registerPageHeightChangedEvent(this.pageHeightChangedEvent)}},addEvents:function(){this.$button.click(this.buttonEvent);if(this.options.showCancel){this.$cancel.click(this.closeEvent)}if(this.options.closeOnOutsideClick){$(window).click(this.outsideClickEvent)}},removeEvents:function(){this.$button.unbind("click",this.buttonEvent);if(this.options.showCancel){this.$cancel.unbind("click",this.closeEvent)}if(this.options.closeOnOutsideClick){$(window).unbind("click",this.outsideClickEvent)}if(this.options.timelineChangedEvents){$.Timeline.unregisterTimelineEvent(this.timelineEvent)}$.Timeline.unregisterPageHeightChangedEvent(this.pageHeightChangedEvent)},onSendError:function(A){if(this.sendNotification){this.sendNotification.cancel()}(new InfoNotification()).setMessage(_("Whoops! Something went wrong. Please refresh the page and try again!")).show();this.close()},onSendSuccess:function(A){},formAction:function(){},timelineEvent:function(){},pageHeightChangedEvent:function(){this.positionForm()},postData:function(){},beforePost:function(){},onComplete:function(){},submitForm:function(){this.$button.disable();var A={authenticity_token:twttr.form_authenticity_token};jQuery.extend(A,this.postData());if(this.progressNotificationText){this.sendNotification=(new ProgressNotification()).setProgressMessage(this.progressNotificationText).setCompletedMessage(_("Ok, done.")).show()}this.beforePost();$.ajax({type:"POST",dataType:"json",dataFilter:function(B){if(!jQuery.trim(B)){return null}return B},url:this.formAction(),data:A,error:function(B){this.onSendError(B)}.pBind(this),success:function(B){this.onSendSuccess(B);this.close();if(this.sendNotification){this.sendNotification.done()}}.pBind(this),beforeSend:twttr.loading,complete:function(){twttr.loaded();this.onComplete()}.pBind(this)})},arrange:function(){var A=$('<div class="inline-form-inputs"></div>');if(this.options.showCancel){this.$buttonParent.append(this.$cancel)}this.$buttonParent.append(this.$button);this.$form_inner.append(A.append(this.$title).append(this.$body).append(this.$inputsPrompt).append(this.$input)).append(this.$buttonParent);this.$form.append(this.$form_inner);this.$form.hide();this.baseElement().append(this.$form)},baseElement:function(){return this.$parentNode||$(document.body)},show:function(A){this.addEvents();this.$targetNode=A.targetNode;this.$parentNode=A.parentNode;this.positionForm();this.arrange();this.$form.fadeIn(100);this.currentlyShown=true;this.afterShow()},afterShow:function(){},positionForm:function(){if(this.$targetNode&&this.$targetNode.width()>0){var C=this.position();var B=C[0];var A=C[1];this.$form.css("top",B).css("left",A)}else{this.close()}},close:function(){this.removeEvents();this.$form.remove();this.currentlyShown=false;this.afterClose()},afterClose:function(){},destroyFromEvent:function(B){var A=$(B.target);if(A.equals(this.$targetNode)||jQuery.inArray(this.$targetNode.get(0),A.parents())!=-1||A.equals(this.$form)||A.hasParent(this.$form)){return }this.close()},position:function(){var A=this.$targetNode.offset();return[A.top,A.left]}});RetweetInlineForm=function(){var A=_("Yes");var B=_("Retweet to your followers?");this.initialize({title:B,submitBtnValue:A})};RetweetInlineForm.prototype=new InlineForm();jQuery.extend(RetweetInlineForm.prototype,{overrideDefaultOptions:{formClass:"retweet-dlg",pageHeightChangedEvents:true},formAction:function(){var B=getListItemFromChild(this.$targetNode);var A=getStatusIdFromListItem(B);return"/statuses/"+A+"/retweet"},postData:function(){return{controller_name:page.controller_name,action_name:page.action_name}},beforePost:function(){this.close();twttr.setRetweetingStyles(this.$targetNode,_("Updating..."))},onSendSuccess:function(A){twttr.animateStatusReplacement(this.$targetNode,A)},onComplete:function(){twttr.unsetRetweetingStyles(this.$targetNode)},afterShow:function(){getListItemFromChild(this.$targetNode).addClass("perma-hover");this.$targetNode.find("a").blur()},afterClose:function(){getListItemFromChild(this.$targetNode).removeClass("perma-hover")},position:function(){var A=this.$targetNode.offset();return[parseInt(A.top)+20,parseInt(A.left)-220]}});RetweetContextDlgForm=function(){var B=_("Close");var C=_("Wondering who this is?");var A=_('Someone you follow thought this was worth retweeting, which is why you are seeing it in your Home timeline. <a target="_blank" href="http://help.twitter.com/forums/10711/entries/77606">Learn more</a>.');this.initialize({title:C,body:A,submitBtnValue:B})};RetweetContextDlgForm.prototype=new InlineForm();jQuery.extend(RetweetContextDlgForm.prototype,{overrideDefaultOptions:{showCancel:false,closeOnOutsideClick:false,formClass:"retweet-ctx-dlg",timelineChangedEvents:true},formAction:function(){return"/users/"+page.sessionUserId},postData:function(){return{_method:"put","user[has_dismissed_retweet_contextual_dialog]":"1"}},position:function(){return[this.$parentNode.height(),-9]},timelineEvent:function(){if(!this.currentlyShown){this.showIfElementExists()}},afterShow:function(){this.$targetNode.css("z-index","300");var A=parseInt($.cookie("retweet_contextual_count"))||0;if(A<5){$.cookie("retweet_contextual_count",A+1)}else{this.close();this.submitForm();$.cookie("retweet_contextual_count",null)}},afterClose:function(){this.$targetNode.css("z-index",null)},showIfElementExists:function(){var A=$(".rt-dlg");if(A.length){this.show({targetNode:A,parentNode:A})}}});$(document).ready(function(){new RetweetContextDlgForm().showIfElementExists()});$(document).ready(function(){try{var A="share-text-active";$(".status").each(function(){var E=$(this);var C=E.find(".retweet-link");var D=E.find(".share-text");C.hover(function(){D.addClass(A)},function(){D.removeClass(A)})})}catch(B){}});(function(){jQuery.inherits=function(A,C){function B(){}B.prototype=C.prototype;A.prototype=new B();A.prototype.constructor=A}})();(function(){jQuery.fn.equals=function(A){return this.get(0)==A.get(0)}})();(function(){jQuery.fn.hasParent=function(A){var B=false;this.parents().map(function(){if($(this).equals(A)){B=true}});return B}})();function Notification(B){this.$bar=jQuery('<div class="notification-bar"></div>');this.$barContainer=jQuery('<div class="notification-bar-container"></div>');this.$barContents=jQuery('<div class="notification-bar-contents"></div>');this.$barBackground=jQuery('<div class="notification-bar-bkg"></div>');this.$message=jQuery('<div class="message"></div>');this.$bar.hide();this.$barBackground.hide();var A=this;this.$bar.click(function(C){A.removeAfterEvent(C)});this.className=B}Notification.SLIDE_SPEED_IN_MS=300;Notification.prototype.remove=function(){var A=this;this.slideUp(function(){A.$bar.remove();A.$barBackground.remove();window.clearTimeout(A.timeout)})};Notification.prototype.removeAfterEvent=function(B){var A=$(B.target);if(A.get(0).nodeName.toLowerCase()=="a"&&A.hasParent(this.$message)){return }this.remove()};Notification.prototype.setMessage=function(A){this.msg=A;return this};Notification.prototype.show=function(){this.$message.addClass(this.className).html(this.msg);this.$barContainer.append(this.$barBackground).append(this.$bar.append(this.$barContents.append(this.$message)));jQuery("#notifications").append(this.$barContainer);this.$barBackground.height(this.$bar.height());this.showBar();if(this.onShow){this.onShow()}return this};Notification.prototype.removeInMilliseconds=function(){var A=this;this.timeout=window.setTimeout(function(){A.remove()},A.timeoutInMilliseconds)};Notification.prototype.showBar=function(){this.$bar.show();this.$barBackground.show()};Notification.prototype.onShow=function(){this.removeInMilliseconds()};Notification.prototype.slideUp=function(A){this.$bar.slideUp(Notification.SLIDE_SPEED_IN_MS);this.$barBackground.slideUp(Notification.SLIDE_SPEED_IN_MS,A)};function ShortNotification(){Notification.call(this,"message-info");this.timeoutInMilliseconds=3000}jQuery.inherits(ShortNotification,Notification);ShortNotification.prototype.showBar=function(){this.$bar.slideDown(Notification.SLIDE_SPEED_IN_MS);this.$barBackground.slideDown(Notification.SLIDE_SPEED_IN_MS)};function InfoNotification(){Notification.call(this,"message-info");this.timeoutInMilliseconds=6000}jQuery.inherits(InfoNotification,Notification);InfoNotification.prototype.showBar=function(){this.$bar.slideDown(Notification.SLIDE_SPEED_IN_MS);this.$barBackground.slideDown(Notification.SLIDE_SPEED_IN_MS)};function ProgressNotification(){Notification.call(this,"message-progress");this.timeoutInMilliseconds=1000}jQuery.inherits(ProgressNotification,Notification);ProgressNotification.prototype.setProgressMessage=function(A){return this.setMessage(A)};ProgressNotification.prototype.setCompletedMessage=function(A){this.completedMsg=A;return this};ProgressNotification.prototype.onShow=function(){};ProgressNotification.prototype.cancel=function(){this.timeoutInMilliseconds=0;this.removeInMilliseconds()};ProgressNotification.prototype.done=function(){this.$message.addClass("message-progress-done").removeClass(this.className).html(this.completedMsg);this.removeInMilliseconds()};function ErrorNotification(){Notification.call(this,"message-error");this.timeoutInMilliseconds=8000}jQuery.inherits(ErrorNotification,Notification);function Occasionally(A,D,C,B,E){this.interval=A;this.maxDecayTime=D;this.job=C;this.decayCallback=B;this.timesRun=0;this.decayRate=1;this.decayMultiplier=E||1.25;this.maxRequests=360}Occasionally.prototype.start=function(){this.stop();this.run()};Occasionally.prototype.stop=function(){if(this.worker){window.clearTimeout(this.worker)}};Occasionally.prototype.run=function(){var A=this;this.decayRate=this.decayCallback()?Math.max(1,this.decayRate/this.decayMultiplier):this.decayRate*this.decayMultiplier;var B=this.interval*this.decayRate;B=(B>=this.maxDecayTime)?this.maxDecayTime:B;this.worker=window.setTimeout(function(){A.execute()},Math.floor(B))};Occasionally.prototype.execute=function(){this.job();if(++this.timesRun<this.maxRequests){this.run()}};twttr.countClick=function(){var A=twttr.createTrackingParameters(this);twttr.asyncClickCount(A)};twttr.asyncClickCount=function(A){(new Image()).src="/abacus?"+$.param(A)};twttr.createTrackingParameters=function(F){var B=$(F);var A=function(){var K=B.attr("class");var I=["hashtag","profile-pic","screen-name","username","web"];for(var J in I){if(K.indexOf(I[J])!==-1){return I[J]}}}();var E=B.closest(".status").find(".meta").children("a").get(0).href.split("/");var G=E[E.length-1];var H=$('meta[name="session-userid"]');var D=H.attr("content")||-1;var C=twttr.form_authenticity_token||$('input[name="authenticity_token"]').attr("value");return{url:F.href,linkType:A,tweetId:G,userId:D,authenticity_token:C,time:(new Date).getTime()}};$(document).ready(function(){var A=$("#content a.tweet-url");A.live("mousedown",twttr.countClick)});/*
+ http://www.JSON.org/json2.js
+ 2009-09-21
+
+ Public Domain.
+
+ NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+
+ See http://www.JSON.org/js.html
+
+ This file creates a global JSON object containing two methods: stringify
+ and parse.
+
+ JSON.stringify(value, replacer, space)
+ value any JavaScript value, usually an object or array.
+
+ replacer an optional parameter that determines how object
+ values are stringified for objects. It can be a
+ function or an array of strings.
+
+ space an optional parameter that specifies the indentation
+ of nested structures. If it is omitted, the text will
+ be packed without extra whitespace. If it is a number,
+ it will specify the number of spaces to indent at each
+ level. If it is a string (such as '\t' or '&nbsp;'),
+ it contains the characters used to indent at each level.
+
+ This method produces a JSON text from a JavaScript value.
+
+ When an object value is found, if the object contains a toJSON
+ method, its toJSON method will be called and the result will be
+ stringified. A toJSON method does not serialize: it returns the
+ value represented by the name/value pair that should be serialized,
+ or undefined if nothing should be serialized. The toJSON method
+ will be passed the key associated with the value, and this will be
+ bound to the value
+
+ For example, this would serialize Dates as ISO strings.
+
+ Date.prototype.toJSON = function (key) {
+ function f(n) {
+ // Format integers to have at least two digits.
+ return n < 10 ? '0' + n : n;
+ }
+
+ return this.getUTCFullYear() + '-' +
+ f(this.getUTCMonth() + 1) + '-' +
+ f(this.getUTCDate()) + 'T' +
+ f(this.getUTCHours()) + ':' +
+ f(this.getUTCMinutes()) + ':' +
+ f(this.getUTCSeconds()) + 'Z';
+ };
+
+ You can provide an optional replacer method. It will be passed the
+ key and value of each member, with this bound to the containing
+ object. The value that is returned from your method will be
+ serialized. If your method returns undefined, then the member will
+ be excluded from the serialization.
+
+ If the replacer parameter is an array of strings, then it will be
+ used to select the members to be serialized. It filters the results
+ such that only members with keys listed in the replacer array are
+ stringified.
+
+ Values that do not have JSON representations, such as undefined or
+ functions, will not be serialized. Such values in objects will be
+ dropped; in arrays they will be replaced with null. You can use
+ a replacer function to replace those with JSON values.
+ JSON.stringify(undefined) returns undefined.
+
+ The optional space parameter produces a stringification of the
+ value that is filled with line breaks and indentation to make it
+ easier to read.
+
+ If the space parameter is a non-empty string, then that string will
+ be used for indentation. If the space parameter is a number, then
+ the indentation will be that many spaces.
+
+ Example:
+
+ text = JSON.stringify(['e', {pluribus: 'unum'}]);
+ // text is '["e",{"pluribus":"unum"}]'
+
+
+ text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
+ // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
+
+ text = JSON.stringify([new Date()], function (key, value) {
+ return this[key] instanceof Date ?
+ 'Date(' + this[key] + ')' : value;
+ });
+ // text is '["Date(---current time---)"]'
+
+
+ JSON.parse(text, reviver)
+ This method parses a JSON text to produce an object or array.
+ It can throw a SyntaxError exception.
+
+ The optional reviver parameter is a function that can filter and
+ transform the results. It receives each of the keys and values,
+ and its return value is used instead of the original value.
+ If it returns what it received, then the structure is not modified.
+ If it returns undefined then the member is deleted.
+
+ Example:
+
+ // Parse the text. Values that look like ISO date strings will
+ // be converted to Date objects.
+
+ myData = JSON.parse(text, function (key, value) {
+ var a;
+ if (typeof value === 'string') {
+ a =
+/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
+ if (a) {
+ return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+ +a[5], +a[6]));
+ }
+ }
+ return value;
+ });
+
+ myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
+ var d;
+ if (typeof value === 'string' &&
+ value.slice(0, 5) === 'Date(' &&
+ value.slice(-1) === ')') {
+ d = new Date(value.slice(5, -1));
+ if (d) {
+ return d;
+ }
+ }
+ return value;
+ });
+
+
+ This is a reference implementation. You are free to copy, modify, or
+ redistribute.
+
+ This code should be minified before deployment.
+ See http://javascript.crockford.com/jsmin.html
+
+ USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
+ NOT CONTROL.
+*/
+
+/*jslint evil: true */
+
+/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
+ call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
+ getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
+ lastIndex, length, parse, prototype, push, replace, slice, stringify,
+ test, toJSON, toString, valueOf
+*/
+
+
+// Create a JSON object only if one does not already exist. We create the
+// methods in a closure to avoid creating global variables.
+
+if (!this.JSON) {
+ this.JSON = {};
+}
+
+(function () {
+
+ function f(n) {
+ // Format integers to have at least two digits.
+ return n < 10 ? '0' + n : n;
+ }
+
+ if (typeof Date.prototype.toJSON !== 'function') {
+
+ Date.prototype.toJSON = function (key) {
+
+ return isFinite(this.valueOf()) ?
+ this.getUTCFullYear() + '-' +
+ f(this.getUTCMonth() + 1) + '-' +
+ f(this.getUTCDate()) + 'T' +
+ f(this.getUTCHours()) + ':' +
+ f(this.getUTCMinutes()) + ':' +
+ f(this.getUTCSeconds()) + 'Z' : null;
+ };
+
+ String.prototype.toJSON =
+ Number.prototype.toJSON =
+ Boolean.prototype.toJSON = function (key) {
+ return this.valueOf();
+ };
+ }
+
+ var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ gap,
+ indent,
+ meta = { // table of character substitutions
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '"' : '\\"',
+ '\\': '\\\\'
+ },
+ rep;
+
+
+ function quote(string) {
+
+// If the string contains no control characters, no quote characters, and no
+// backslash characters, then we can safely slap some quotes around it.
+// Otherwise we must also replace the offending characters with safe escape
+// sequences.
+
+ escapable.lastIndex = 0;
+ return escapable.test(string) ?
+ '"' + string.replace(escapable, function (a) {
+ var c = meta[a];
+ return typeof c === 'string' ? c :
+ '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ }) + '"' :
+ '"' + string + '"';
+ }
+
+
+ function str(key, holder) {
+
+// Produce a string from holder[key].
+
+ var i, // The loop counter.
+ k, // The member key.
+ v, // The member value.
+ length,
+ mind = gap,
+ partial,
+ value = holder[key];
+
+// If the value has a toJSON method, call it to obtain a replacement value.
+
+ if (value && typeof value === 'object' &&
+ typeof value.toJSON === 'function') {
+ value = value.toJSON(key);
+ }
+
+// If we were called with a replacer function, then call the replacer to
+// obtain a replacement value.
+
+ if (typeof rep === 'function') {
+ value = rep.call(holder, key, value);
+ }
+
+// What happens next depends on the value's type.
+
+ switch (typeof value) {
+ case 'string':
+ return quote(value);
+
+ case 'number':
+
+// JSON numbers must be finite. Encode non-finite numbers as null.
+
+ return isFinite(value) ? String(value) : 'null';
+
+ case 'boolean':
+ case 'null':
+
+// If the value is a boolean or null, convert it to a string. Note:
+// typeof null does not produce 'null'. The case is included here in
+// the remote chance that this gets fixed someday.
+
+ return String(value);
+
+// If the type is 'object', we might be dealing with an object or an array or
+// null.
+
+ case 'object':
+
+// Due to a specification blunder in ECMAScript, typeof null is 'object',
+// so watch out for that case.
+
+ if (!value) {
+ return 'null';
+ }
+
+// Make an array to hold the partial results of stringifying this object value.
+
+ gap += indent;
+ partial = [];
+
+// Is the value an array?
+
+ if (Object.prototype.toString.apply(value) === '[object Array]') {
+
+// The value is an array. Stringify every element. Use null as a placeholder
+// for non-JSON values.
+
+ length = value.length;
+ for (i = 0; i < length; i += 1) {
+ partial[i] = str(i, value) || 'null';
+ }
+
+// Join all of the elements together, separated with commas, and wrap them in
+// brackets.
+
+ v = partial.length === 0 ? '[]' :
+ gap ? '[\n' + gap +
+ partial.join(',\n' + gap) + '\n' +
+ mind + ']' :
+ '[' + partial.join(',') + ']';
+ gap = mind;
+ return v;
+ }
+
+// If the replacer is an array, use it to select the members to be stringified.
+
+ if (rep && typeof rep === 'object') {
+ length = rep.length;
+ for (i = 0; i < length; i += 1) {
+ k = rep[i];
+ if (typeof k === 'string') {
+ v = str(k, value);
+ if (v) {
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
+ }
+ }
+ }
+ } else {
+
+// Otherwise, iterate through all of the keys in the object.
+
+ for (k in value) {
+ if (Object.hasOwnProperty.call(value, k)) {
+ v = str(k, value);
+ if (v) {
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
+ }
+ }
+ }
+ }
+
+// Join all of the member texts together, separated with commas,
+// and wrap them in braces.
+
+ v = partial.length === 0 ? '{}' :
+ gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
+ mind + '}' : '{' + partial.join(',') + '}';
+ gap = mind;
+ return v;
+ }
+ }
+
+// If the JSON object does not yet have a stringify method, give it one.
+
+ if (typeof JSON.stringify !== 'function') {
+ JSON.stringify = function (value, replacer, space) {
+
+// The stringify method takes a value and an optional replacer, and an optional
+// space parameter, and returns a JSON text. The replacer can be a function
+// that can replace values, or an array of strings that will select the keys.
+// A default replacer method can be provided. Use of the space parameter can
+// produce text that is more easily readable.
+
+ var i;
+ gap = '';
+ indent = '';
+
+// If the space parameter is a number, make an indent string containing that
+// many spaces.
+
+ if (typeof space === 'number') {
+ for (i = 0; i < space; i += 1) {
+ indent += ' ';
+ }
+
+// If the space parameter is a string, it will be used as the indent string.
+
+ } else if (typeof space === 'string') {
+ indent = space;
+ }
+
+// If there is a replacer, it must be a function or an array.
+// Otherwise, throw an error.
+
+ rep = replacer;
+ if (replacer && typeof replacer !== 'function' &&
+ (typeof replacer !== 'object' ||
+ typeof replacer.length !== 'number')) {
+ throw new Error('JSON.stringify');
+ }
+
+// Make a fake root object containing our value under the key of ''.
+// Return the result of stringifying the value.
+
+ return str('', {'': value});
+ };
+ }
+
+
+// If the JSON object does not yet have a parse method, give it one.
+
+ if (typeof JSON.parse !== 'function') {
+ JSON.parse = function (text, reviver) {
+
+// The parse method takes a text and an optional reviver function, and returns
+// a JavaScript value if the text is a valid JSON text.
+
+ var j;
+
+ function walk(holder, key) {
+
+// The walk method is used to recursively walk the resulting structure so
+// that modifications can be made.
+
+ var k, v, value = holder[key];
+ if (value && typeof value === 'object') {
+ for (k in value) {
+ if (Object.hasOwnProperty.call(value, k)) {
+ v = walk(value, k);
+ if (v !== undefined) {
+ value[k] = v;
+ } else {
+ delete value[k];
+ }
+ }
+ }
+ }
+ return reviver.call(holder, key, value);
+ }
+
+
+// Parsing happens in four stages. In the first stage, we replace certain
+// Unicode characters with escape sequences. JavaScript handles many characters
+// incorrectly, either silently deleting them, or treating them as line endings.
+
+ cx.lastIndex = 0;
+ if (cx.test(text)) {
+ text = text.replace(cx, function (a) {
+ return '\\u' +
+ ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ });
+ }
+
+// In the second stage, we run the text against regular expressions that look
+// for non-JSON patterns. We are especially concerned with '()' and 'new'
+// because they can cause invocation, and '=' because it can cause mutation.
+// But just to be safe, we want to reject all unexpected forms.
+
+// We split the second stage into 4 regexp operations in order to work around
+// crippling inefficiencies in IE's and Safari's regexp engines. First we
+// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
+// replace all simple value tokens with ']' characters. Third, we delete all
+// open brackets that follow a colon or comma or that begin the text. Finally,
+// we look to see that the remaining characters are only whitespace or ']' or
+// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
+
+ if (/^[\],:{}\s]*$/.
+test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
+replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
+replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
+
+// In the third stage we use the eval function to compile the text into a
+// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
+// in JavaScript: it can begin a block or an object literal. We wrap the text
+// in parens to eliminate the ambiguity.
+
+ j = eval('(' + text + ')');
+
+// In the optional fourth stage, we recursively walk the new structure, passing
+// each name/value pair to a reviver function for possible transformation.
+
+ return typeof reviver === 'function' ?
+ walk({'': j}, '') : j;
+ }
+
+// If the text is not JSON parseable, then a SyntaxError is thrown.
+
+ throw new SyntaxError('JSON.parse');
+ };
+ }
+}());
+function scribe(A,C,B){B=B||{};if(window.DARKMODE_SCRIBE){return this}if(typeof (A)=="function"){A=A.call(this)}var D={log:JSON.stringify(A)};if(B.filter){D.filter=B.filter}if(C){D.category=C}(new Image()).src="/scribe?"+$.param($.extend(D,{ts:(new Date()).getTime()}))}(function(A){A.extend(A.fn,{scribe:function(C,E,D){var B=this;D=D||{};this[(D.clientEvent||"mousedown")](function(F){window.scribe.call(this,C,E,D)});return this}})})(jQuery);twttr.position={relativeTo:function(I,H,A){var F,G;A=(A||{});F=G=H.offset();G.gravity=A.gravity;G.weight=A.weight;var D={height:H.height(),width:H.width()};var C={height:$(window).height(),width:$(window).width()};var E={height:$("body").height(),width:$("body").width()};var B={height:I.height(),width:I.width()};if(!G.gravity){G.gravity="vertical"}if("vertical,north,south".indexOf(G.gravity)!=-1){if("right,left,center".indexOf(G.weight)==-1){G.weight=(F.left>C.width/2)?"right":"left"}if(G.gravity=="vertical"){G.gravity=((F.top+B.height)>($(window).scrollTop()+C.height))?"south":"north"}if(G.weight=="right"){G.left=F.left-B.width+D.width}else{if(G.weight=="center"){G.left=F.left-(B.width/2)}}G.top=(G.gravity=="north")?(G.top+D.height):(G.top-B.height)}if("horizontal,east,west".indexOf(G.gravity)!=-1){if("top,bottom,center".indexOf(G.weight)==-1){if((F.top-(B.height/2))<0){G.weight="top"}else{if((F.top+(B.height/2))>Math.max(C.height,E.height)){G.weight="bottom"}else{G.weight="center"}}}if(G.gravity=="horizontal"){G.gravity=((F.left+(D.width/2))>C.width/2)?"east":"west"}if(G.weight=="center"){G.top=G.top+(D.height/2)-(B.height/2)}else{if(G.weight=="bottom"){G.top=G.top-B.height}}G.left=(G.gravity=="west")?(F.left+D.width):(F.left-B.width)}return G},center:function(A){var C=$(window);var B={top:parseInt((C.height()-A.height())/2),left:parseInt((C.width()-A.width())/2)};if($("body.ie6").length){B.top+=C.scrollTop();B.left+=C.scrollLeft()}return B}};twttr.klass("twttr.dialog",function(A,B){this.opts=B;this.$trigger=A;this.$heading=B.heading?$(B.heading):false;this.$footer=B.footer?$(B.footer):false;this.$content=$(B.content);this.createShell();this.bindEvents()}).widget().method("getHeaderHTML",function(){if(this.$heading&&this.$heading.length){return"<h2><span>"+this.$heading.html()+"</span>"+(this.opts.closeButton?'<a href="#" class="modal-close">&times;</a>':"")+"</h2>"}else{return(this.opts.closeButton?'<span class="no-heading"><a href="#" class="modal-close right">&times;</a></span>':"")}}).method("getShellHTML",function(){var A=(this.opts.modal===false);return['<div class="twttr-dialog'+(this.opts.cssClass?" "+this.opts.cssClass:"")+'" style="display: none;">','<div class="hanging"'+(this.opts.zIndex?' style="z-index: '+this.opts.zIndex+' !important;"':"")+">",'<div class="modal">','<div class="modal-inner">',this.getHeaderHTML(),'<div class="modal-content"> </div>',"</div>","</div>","</div>",(A?"":'<div class="modal-overlay"></div>'),"</div>"].join("")}).method("createShell",function(){var C=this;this.$root=$(this.getShellHTML());if(this.opts.width){this.find(".hanging").css({width:this.opts.width})}var D=this.$content.parent().length?this.$content.parent():$(document.body);this.$content.move(this.find(".modal-content"));if(this.$footer.length){this.find(".modal-content").after('<div class="footer"></div>');this.$footer.move(this.find(".footer"))}if(this.opts.renderInline){D.append(this.$root)}else{$(document.body).append(this.$root)}if(this.opts.fixed===false){this.find(".hanging").css({position:"absolute"})}var B=this.$root.find(".modal-submit");if(B.length>0){if(C.opts.noajax){B.bind("click",function(E){B.closest("form").submit()});return }var A=C.opts.ajax.complete;B.bind("click",function(F){F.preventDefault();B.attr("disabled",true);B.addClass("dbtn").removeClass("btn");var E=$(this).closest("form");$.ajax($.extend((C.opts.ajax||{}),{type:E.attr("method"),url:E.attr("action"),data:E.serialize(),complete:function(G){B.attr("disabled",false);B.addClass("btn").removeClass("dbtn");if(A){A(G)}}}))})}}).method("bindEvents",function(){var A=this;if(this.$trigger&&!this.opts.openonload){this.$trigger.click(function(B){B.preventDefault();A.open()})}else{if(this.opts.openonload){A.open()}}this.find(".modal-close").click(function(B){B.preventDefault();A.close()});if(this.find(".modal-close").length){$(document).keydown(function(B){if(B.which==27){B.preventDefault();A.close()}})}if(this.opts.popup){$(document).click(function(B){if(A.opened&&!$(B.target).parents(".modal").length){A.close()}})}}).method("windowHeight",function(){return $(window).height()}).method("scrollTop",function(){return $(window).scrollTop()}).method("open",function(){this.$root.fadeIn("fast");var A=this.find(".hanging");var B=this.center(A);if(this.opts.top){B.top=this.opts.top}if(this.opts.left){B.left=this.opts.left}if(this.opts.maxTop){B.top=Math.min(B.top,this.opts.maxTop)}if(this.opts.maxLeft){B.left=Math.min(B.left,this.opts.maxLeft)}A.css({top:B.top,left:B.left});this.$root.trigger("open");this.opened=true;if(this.windowHeight()<A.outerHeight()){A.css("position","absolute");A.css("top",this.scrollTop()+"px")}this.$root.find("input[type=text]:first").focus()}).method("close",function(){this.$root.fadeOut("fast");this.opened=false;this.$root.trigger("close")}).method("toggle",function(){this.opened?this.close():this.open()});twttr.augmentObject(twttr.dialog.prototype,twttr.position);twttr.auxo("AttachedDialog",twttr.dialog).method("open",function(){this.$root.addClass("attached");this.$root.fadeIn("fast");this.opened=true;if(!this.positioned){var A=this.find(".hanging");var D=this.relativeTo(this.find(".hanging"),this.$trigger,this.opts);if(this.opts.offsetX){D.left+=this.opts.offsetX}if(this.opts.offsetY){D.top+=this.opts.offsetY}twttr.augmentObject(this.opts,D);var B=this.opts.gravity;if(B&&("horizontal,vertical".indexOf(B)==-1)){if("north,south".indexOf(B)==-1){var C=parseInt(this.find(".hanging").height());this.find(".modal-inner").prepend('<div class="'+B+'" style="height:'+C+'px;"></div>');D.left+=this.nudge(B);D.top+=this.nudge(this.opts.weight)}else{this.find(".modal")[(B=="north"?"before":"after")]('<div class="'+B+'"></div>');D.top+=this.nudge(B);D.left+=this.nudge(this.opts.weight)}}this.find(".hanging").css({top:D.top,left:D.left});if(this.opts.weight&&this.opts.weight!="auto"){this.find(".hanging").addClass("weight-"+this.opts.weight)}if(this.opts.modal){this.find(".modal-overlay").height(Math.max($(window).height(),$("body").height())+25)}this.positioned=true}}).method("nudge",function(A){return(twttr.AttachedDialog.offsets[A]||0)});twttr.AttachedDialog.offsets={top:-15,bottom:30,east:-10,west:10,south:-10,north:4};/*
+ * Copyright (c) 2007 Josh Bush (digitalbush.com)
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * Version: Beta 1
+ * Release: 2007-06-01
+ */
+(function($) {
+ var map=new Array();
+ $.Watermark = {
+ ShowAll:function(){
+ for (var i=0;i<map.length;i++){
+ if(map[i].obj.val()==""){
+ map[i].obj.val(map[i].text);
+ map[i].obj.css("color",map[i].WatermarkColor);
+ }else{
+ map[i].obj.css("color",map[i].DefaultColor);
+ }
+ }
+ },
+ HideAll:function(){
+ for (var i=0;i<map.length;i++){
+ if(map[i].obj.val()==map[i].text)
+ map[i].obj.val("");
+ }
+ }
+ }
+
+ $.fn.Watermark = function(text,color) {
+ if(!color)
+ color="#aaa";
+ return this.each(
+ function(){
+ var input=$(this);
+ var defaultColor=input.css("color");
+ map[map.length]={text:text,obj:input,DefaultColor:defaultColor,WatermarkColor:color};
+ function clearMessage(){
+ if(input.val()==text)
+ input.val("");
+ input.css("color",defaultColor);
+ }
+
+ function insertMessage(){
+ if(input.val().length==0 || input.val()==text){
+ input.val(text);
+ input.css("color",color);
+ }else
+ input.css("color",defaultColor);
+ }
+
+ input.focus(clearMessage);
+ input.blur(insertMessage);
+ input.change(insertMessage);
+
+ insertMessage();
+ }
+ );
+ };
+})(jQuery);
+/*
+ * Cookie plugin
+ *
+ * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ */
+jQuery.cookie = function(name, value, options) {
+ if (typeof value != 'undefined') { // name and value given, set cookie
+ options = options || {};
+ if (value === null) {
+ value = '';
+ options.expires = -1;
+ }
+ var expires = '';
+ if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
+ var date;
+ if (typeof options.expires == 'number') {
+ date = new Date();
+ date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
+ } else {
+ date = options.expires;
+ }
+ expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
+ }
+ // CAUTION: Needed to parenthesize options.path and options.domain
+ // in the following expressions, otherwise they evaluate to undefined
+ // in the packed version for some reason...
+ var path = options.path ? '; path=' + (options.path) : '';
+ var domain = options.domain ? '; domain=' + (options.domain) : '';
+ var secure = options.secure ? '; secure' : '';
+ document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
+ } else { // only name given, get cookie
+ var cookieValue = null;
+ if (document.cookie && document.cookie != '') {
+ var cookies = document.cookie.split(';');
+ for (var i = 0; i < cookies.length; i++) {
+ var cookie = jQuery.trim(cookies[i]);
+ // Does this cookie string begin with the name we want?
+ if (cookie.substring(0, name.length + 1) == (name + '=')) {
+ cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
+ break;
+ }
+ }
+ }
+ return cookieValue;
+ }
+};
+/*
+ * jQuery Color Animations
+ * Copyright 2007 John Resig
+ * Released under the MIT and GPL licenses.
+ */
+
+(function(jQuery){
+
+ // We override the animation for all of these color styles
+ jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor', 'borderColor'], function(i,attr){
+ jQuery.fx.step[attr] = function(fx){
+ if ( fx.state == 0 ) {
+ fx.start = getColor( fx.elem, attr );
+ fx.end = getRGB( fx.end );
+ }
+
+ fx.elem.style[attr] = "rgb(" + [
+ Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
+ Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
+ Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
+ ].join(",") + ")";
+ }
+ });
+
+ // Color Conversion functions from highlightFade
+ // By Blair Mitchelmore
+ // http://jquery.offput.ca/highlightFade/
+
+ // Parse strings looking for color tuples [255,255,255]
+ function getRGB(color) {
+ var result;
+
+ // Check if we're already dealing with an array of colors
+ if ( color && color.constructor == Array && color.length == 3 )
+ return color;
+
+ // Look for rgb(num,num,num)
+ if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
+ return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];
+
+ // Look for rgb(num%,num%,num%)
+ if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
+ return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
+
+ // Look for #a0b1c2
+ if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
+ return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
+
+ // Look for #fff
+ if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
+ return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
+
+ // Otherwise, we're most likely dealing with a named color
+ return colors[jQuery.trim(color).toLowerCase()];
+ }
+
+ function getColor(elem, attr) {
+ var color;
+
+ do {
+ color = jQuery.curCSS(elem, attr);
+
+ // Keep going until we find an element that has color, or we hit the body
+ if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
+ break;
+
+ attr = "backgroundColor";
+ } while ( elem = elem.parentNode );
+
+ return getRGB(color);
+ };
+
+ // Some named colors to work with
+ // From Interface by Stefan Petre
+ // http://interface.eyecon.ro/
+
+ var colors = {
+ aqua:[0,255,255],
+ azure:[240,255,255],
+ beige:[245,245,220],
+ black:[0,0,0],
+ blue:[0,0,255],
+ brown:[165,42,42],
+ cyan:[0,255,255],
+ darkblue:[0,0,139],
+ darkcyan:[0,139,139],
+ darkgrey:[169,169,169],
+ darkgreen:[0,100,0],
+ darkkhaki:[189,183,107],
+ darkmagenta:[139,0,139],
+ darkolivegreen:[85,107,47],
+ darkorange:[255,140,0],
+ darkorchid:[153,50,204],
+ darkred:[139,0,0],
+ darksalmon:[233,150,122],
+ darkviolet:[148,0,211],
+ fuchsia:[255,0,255],
+ gold:[255,215,0],
+ green:[0,128,0],
+ indigo:[75,0,130],
+ khaki:[240,230,140],
+ lightblue:[173,216,230],
+ lightcyan:[224,255,255],
+ lightgreen:[144,238,144],
+ lightgrey:[211,211,211],
+ lightpink:[255,182,193],
+ lightyellow:[255,255,224],
+ lime:[0,255,0],
+ magenta:[255,0,255],
+ maroon:[128,0,0],
+ navy:[0,0,128],
+ olive:[128,128,0],
+ orange:[255,165,0],
+ pink:[255,192,203],
+ purple:[128,0,128],
+ violet:[128,0,128],
+ red:[255,0,0],
+ silver:[192,192,192],
+ white:[255,255,255],
+ yellow:[255,255,0]
+ };
+
+})(jQuery);
+/* Copyright (c) 2008 Brandon Aaron (http://brandonaaron.net)
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
+ *
+ * Version: 1.0.3
+ * Requires jQuery 1.1.3+
+ * Docs: http://docs.jquery.com/Plugins/livequery
+ */
+
+(function($) {
+
+$.extend($.fn, {
+ livequery: function(type, fn, fn2) {
+ var self = this, q;
+
+ // Handle different call patterns
+ if ($.isFunction(type))
+ fn2 = fn, fn = type, type = undefined;
+
+ // See if Live Query already exists
+ $.each( $.livequery.queries, function(i, query) {
+ if ( self.selector == query.selector && self.context == query.context &&
+ type == query.type && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) )
+ // Found the query, exit the each loop
+ return (q = query) && false;
+ });
+
+ // Create new Live Query if it wasn't found
+ q = q || new $.livequery(this.selector, this.context, type, fn, fn2);
+
+ // Make sure it is running
+ q.stopped = false;
+
+ // Run it immediately for the first time
+ q.run();
+
+ // Contnue the chain
+ return this;
+ },
+
+ expire: function(type, fn, fn2) {
+ var self = this;
+
+ // Handle different call patterns
+ if ($.isFunction(type))
+ fn2 = fn, fn = type, type = undefined;
+
+ // Find the Live Query based on arguments and stop it
+ $.each( $.livequery.queries, function(i, query) {
+ if ( self.selector == query.selector && self.context == query.context &&
+ (!type || type == query.type) && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) && !this.stopped )
+ $.livequery.stop(query.id);
+ });
+
+ // Continue the chain
+ return this;
+ }
+});
+
+$.livequery = function(selector, context, type, fn, fn2) {
+ this.selector = selector;
+ this.context = context || document;
+ this.type = type;
+ this.fn = fn;
+ this.fn2 = fn2;
+ this.elements = [];
+ this.stopped = false;
+
+ // The id is the index of the Live Query in $.livequery.queries
+ this.id = $.livequery.queries.push(this)-1;
+
+ // Mark the functions for matching later on
+ fn.$lqguid = fn.$lqguid || $.livequery.guid++;
+ if (fn2) fn2.$lqguid = fn2.$lqguid || $.livequery.guid++;
+
+ // Return the Live Query
+ return this;
+};
+
+$.livequery.prototype = {
+ stop: function() {
+ var query = this;
+
+ if ( this.type )
+ // Unbind all bound events
+ this.elements.unbind(this.type, this.fn);
+ else if (this.fn2)
+ // Call the second function for all matched elements
+ this.elements.each(function(i, el) {
+ query.fn2.apply(el);
+ });
+
+ // Clear out matched elements
+ this.elements = [];
+
+ // Stop the Live Query from running until restarted
+ this.stopped = true;
+ },
+
+ run: function() {
+ // Short-circuit if stopped
+ if ( this.stopped ) return;
+ var query = this;
+
+ var oEls = this.elements,
+ els = $(this.selector, this.context),
+ nEls = els.not(oEls);
+
+ // Set elements to the latest set of matched elements
+ this.elements = els;
+
+ if (this.type) {
+ // Bind events to newly matched elements
+ nEls.bind(this.type, this.fn);
+
+ // Unbind events to elements no longer matched
+ if (oEls.length > 0)
+ $.each(oEls, function(i, el) {
+ if ( $.inArray(el, els) < 0 )
+ $.event.remove(el, query.type, query.fn);
+ });
+ }
+ else {
+ // Call the first function for newly matched elements
+ nEls.each(function() {
+ query.fn.apply(this);
+ });
+
+ // Call the second function for elements no longer matched
+ if ( this.fn2 && oEls.length > 0 )
+ $.each(oEls, function(i, el) {
+ if ( $.inArray(el, els) < 0 )
+ query.fn2.apply(el);
+ });
+ }
+ }
+};
+
+$.extend($.livequery, {
+ guid: 0,
+ queries: [],
+ queue: [],
+ running: false,
+ timeout: null,
+
+ checkQueue: function() {
+ if ( $.livequery.running && $.livequery.queue.length ) {
+ var length = $.livequery.queue.length;
+ // Run each Live Query currently in the queue
+ while ( length-- )
+ $.livequery.queries[ $.livequery.queue.shift() ].run();
+ }
+ },
+
+ pause: function() {
+ // Don't run anymore Live Queries until restarted
+ $.livequery.running = false;
+ },
+
+ play: function() {
+ // Restart Live Queries
+ $.livequery.running = true;
+ // Request a run of the Live Queries
+ $.livequery.run();
+ },
+
+ registerPlugin: function() {
+ $.each( arguments, function(i,n) {
+ // Short-circuit if the method doesn't exist
+ if (!$.fn[n]) return;
+
+ // Save a reference to the original method
+ var old = $.fn[n];
+
+ // Create a new method
+ $.fn[n] = function() {
+ // Call the original method
+ var r = old.apply(this, arguments);
+
+ // Request a run of the Live Queries
+ $.livequery.run();
+
+ // Return the original methods result
+ return r;
+ }
+ });
+ },
+
+ run: function(id) {
+ if (id != undefined) {
+ // Put the particular Live Query in the queue if it doesn't already exist
+ if ( $.inArray(id, $.livequery.queue) < 0 )
+ $.livequery.queue.push( id );
+ }
+ else
+ // Put each Live Query in the queue if it doesn't already exist
+ $.each( $.livequery.queries, function(id) {
+ if ( $.inArray(id, $.livequery.queue) < 0 )
+ $.livequery.queue.push( id );
+ });
+
+ // Clear timeout if it already exists
+ if ($.livequery.timeout) clearTimeout($.livequery.timeout);
+ // Create a timeout to check the queue and actually run the Live Queries
+ $.livequery.timeout = setTimeout($.livequery.checkQueue, 20);
+ },
+
+ stop: function(id) {
+ if (id != undefined)
+ // Stop are particular Live Query
+ $.livequery.queries[ id ].stop();
+ else
+ // Stop all Live Queries
+ $.each( $.livequery.queries, function(id) {
+ $.livequery.queries[ id ].stop();
+ });
+ }
+});
+
+// Register core DOM manipulation methods
+$.livequery.registerPlugin('append', 'prepend', 'after', 'before', 'wrap', 'attr', 'removeAttr', 'addClass', 'removeClass', 'toggleClass', 'empty', 'remove');
+
+// Run Live Queries when the Document is ready
+$(function() { $.livequery.play(); });
+
+
+// Save a reference to the original init method
+var init = $.prototype.init;
+
+// Create a new init method that exposes two new properties: selector and context
+$.prototype.init = function(a,c) {
+ // Call the original init and save the result
+ var r = init.apply(this, arguments);
+
+ // Copy over properties if they exist already
+ if (a && a.selector)
+ r.context = a.context, r.selector = a.selector;
+
+ // Set properties
+ if ( typeof a == 'string' )
+ r.context = c || document, r.selector = a;
+
+ // Return the result
+ return r;
+};
+
+// Give the init function the jQuery prototype for later instantiation (needed after Rev 4091)
+$.prototype.init.prototype = $.prototype;
+
+})(jQuery);/*
+ * Metadata - jQuery plugin for parsing metadata from elements
+ *
+ * Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * Revision: $Id: jquery.metadata.js 3640 2007-10-11 18:34:38Z pmclanahan $
+ *
+ */
+
+/**
+ * Sets the type of metadata to use. Metadata is encoded in JSON, and each property
+ * in the JSON will become a property of the element itself.
+ *
+ * There are four supported types of metadata storage:
+ *
+ * attr: Inside an attribute. The name parameter indicates *which* attribute.
+ *
+ * class: Inside the class attribute, wrapped in curly braces: { }
+ *
+ * elem: Inside a child element (e.g. a script tag). The
+ * name parameter indicates *which* element.
+ * html5: Values are stored in data-* attributes.
+ *
+ * The metadata for an element is loaded the first time the element is accessed via jQuery.
+ *
+ * As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
+ * matched by expr, then redefine the metadata type and run another $(expr) for other elements.
+ *
+ * @name $.metadata.setType
+ *
+ * @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p>
+ * @before $.metadata.setType("class")
+ * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
+ * @desc Reads metadata from the class attribute
+ *
+ * @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p>
+ * @before $.metadata.setType("attr", "data")
+ * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
+ * @desc Reads metadata from a "data" attribute
+ *
+ * @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}<\/script>This is a p</p>
+ * @before $.metadata.setType("elem", "script")
+ * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
+ * @desc Reads metadata from a nested script element
+ *
+ * @example <p id="one" class="some_class" data-item_id="1" data-item_label="Label">This is a p</p>
+ * @before $.metadata.setType("html5")
+ * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
+ * @desc Reads metadata from a series of data-* attributes
+ *
+ * @param String type The encoding type
+ * @param String name The name of the attribute to be used to get metadata (optional)
+ * @cat Plugins/Metadata
+ * @descr Sets the type of encoding to be used when loading metadata for the first time
+ * @type undefined
+ * @see metadata()
+ */
+
+(function($) {
+
+$.extend({
+ metadata : {
+ defaults : {
+ type: 'class',
+ name: 'metadata',
+ cre: /({.*})/,
+ single: 'metadata'
+ },
+ setType: function( type, name ){
+ this.defaults.type = type;
+ this.defaults.name = name;
+ },
+ get: function( elem, opts ){
+ var settings = $.extend({},this.defaults,opts);
+ // check for empty string in single property
+ if ( !settings.single.length ) settings.single = 'metadata';
+
+ var data = $.data(elem, settings.single);
+ // returned cached data if it already exists
+ if ( data ) return data;
+
+ data = "{}";
+
+ var getData = function(data) {
+ if(typeof data != "string") return data;
+
+ if( data.indexOf('{') < 0 ) {
+ data = eval("(" + data + ")");
+ }
+ }
+
+ var getObject = function(data) {
+ if(typeof data != "string") return data;
+
+ data = eval("(" + data + ")");
+ return data;
+ }
+
+ if ( settings.type == "html5" ) {
+ var object = {};
+ $( elem.attributes ).each(function() {
+ var name = this.nodeName;
+ if(name.match(/^data-/)) name = name.replace(/^data-/, '');
+ else return true;
+ object[name] = getObject(this.nodeValue);
+ });
+ } else {
+ if ( settings.type == "class" ) {
+ var m = settings.cre.exec( elem.className );
+ if ( m )
+ data = m[1];
+ } else if ( settings.type == "elem" ) {
+ if( !elem.getElementsByTagName ) return;
+ var e = elem.getElementsByTagName(settings.name);
+ if ( e.length )
+ data = $.trim(e[0].innerHTML);
+ } else if ( elem.getAttribute != undefined ) {
+ var attr = elem.getAttribute( settings.name );
+ if ( attr )
+ data = attr;
+ }
+ object = getObject(data.indexOf("{") < 0 ? "{" + data + "}" : data);
+ }
+
+ $.data( elem, settings.single, object );
+ return object;
+ }
+ }
+});
+
+/**
+ * Returns the metadata object for the first member of the jQuery object.
+ *
+ * @name metadata
+ * @descr Returns element's metadata object
+ * @param Object opts An object contianing settings to override the defaults
+ * @type jQuery
+ * @cat Plugins/Metadata
+ */
+$.fn.metadata = function( opts ){
+ return $.metadata.get( this[0], opts );
+};
+
+})(jQuery);//Licensed under The MIT License
+//Copyright (c) 2008 Jason Frame (jason@onehackoranother.com)
+
+
+(function($) {
+ $.fn.tipsy = function(opts) {
+
+ opts = $.extend({fade: false, gravity: 'n'}, opts || {});
+ // ...Added by andy@twitter.com 20090717
+ if(!opts['offsetTop']) { opts['offsetTop'] = 0; }
+ if(!opts['offsetLeft']) { opts['offsetLeft'] = 0; }
+ if(!opts['header']) { opts['header'] = ''; }
+ if(!opts['footer']) { opts['footer'] = ''; }
+ if(!opts['hideTimeout']) { opts['hideTimeout'] = 100; }
+ if(!opts['showTimeout']) { opts['hideTimeout'] = 0; }
+ if(!opts['additionalCSSClass']) { opts['additionalCSSClass'] = ''; }
+ var showTimeoutKey = false;
+ // ...Added by andy@twitter.com 20090717
+ var tip = null, cancelHide = false;
+ this.hover(function() {
+
+ // ...Added by andy@twitter.com 20090717
+ var linkText = $(this).text();
+ var header = opts['header'].replace('%{link}', linkText);
+ var footer = opts['footer'].replace('%{link}', linkText);
+ // ...Added by andy@twitter.com 20090717
+
+ $.data(this, 'cancel.tipsy', true);
+
+ var tip = $.data(this, 'active.tipsy');
+ if (!tip) {
+ $('.tipsy').hide();
+ tip = $('<div class="tipsy '+ opts['additionalCSSClass'] +'"><div class="tipsy-inner">' + header + $(this).attr('title') + footer + '</div></div>');
+ tip.css({position: 'absolute', zIndex: 100000});
+ $(this).attr('title', '');
+ $.data(this, 'active.tipsy', tip);
+ // Added by rael@twitter.com 20090628...
+ } else if ($(this).attr('title') != '') {
+ tip.find('.tipsy-inner').html($(this).attr('title'));
+ $(this).attr('title', '');
+ // ...Added by rael@twitter.com 20090628
+ }
+
+ var pos = $.extend({}, $(this).offset(), {width: this.offsetWidth, height: this.offsetHeight});
+ // ...Added by andy@twitter.com 20090717
+ pos.top = pos.top + opts['offsetTop'];
+ pos.left = pos.left + opts['offsetLeft'];
+
+ // remove open tips if timeout to fade
+ $('.tipsy').hide();
+ // ...Added by andy@twitter.com 20090717
+ tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).appendTo(document.body);
+ var actualWidth = tip[0].offsetWidth, actualHeight = tip[0].offsetHeight;
+
+ switch (opts.gravity.charAt(0)) {
+ case 'n':
+ tip.css({top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}).addClass('tipsy-north');
+ break;
+ case 'l':
+ //left north align
+ tip.css({top: pos.top + pos.height, left: pos.left + pos.width / 2 - 18}).addClass('tipsy-north');
+ break;
+ case 's':
+ tip.css({top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}).addClass('tipsy-south');
+ break;
+ case 'e':
+ tip.css({top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}).addClass('tipsy-east');
+ break;
+ case 'w':
+ tip.css({top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}).addClass('tipsy-west');
+ break;
+ }
+ // ...Added by andy@twitter.com 20090717
+ function show() {
+ if (opts.fade) {
+ tip.css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: 1});
+ } else {
+ tip.css({visibility: 'visible'});
+ }
+ }
+ if(opts['showTimeout']) {
+ showTimeoutKey = setTimeout(show, opts['showTimeout']);
+ } else {
+ show();
+ }
+ }, function() {
+ clearTimeout(showTimeoutKey);
+ // ...Added by andy@twitter.com 20090717
+ $.data(this, 'cancel.tipsy', false);
+ var self = this;
+ setTimeout(function() {
+ if ($.data(this, 'cancel.tipsy')) return;
+ var tip = $.data(self, 'active.tipsy');
+ if (opts.fade) {
+ tip.stop().fadeOut(function() { $(this).remove(); });
+ } else {
+ tip.remove();
+ }
+ }, opts['hideTimeout']);
+ });
+
+ };
+})(jQuery);
+/*
+ * jQuery Form Plugin
+ * version: 2.36 (07-NOV-2009)
+ * @requires jQuery v1.2.6 or later
+ *
+ * Examples and documentation at: http://malsup.com/jquery/form/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ */
+;(function($) {
+
+/*
+ Usage Note:
+ -----------
+ Do not use both ajaxSubmit and ajaxForm on the same form. These
+ functions are intended to be exclusive. Use ajaxSubmit if you want
+ to bind your own submit handler to the form. For example,
+
+ $(document).ready(function() {
+ $('#myForm').bind('submit', function() {
+ $(this).ajaxSubmit({
+ target: '#output'
+ });
+ return false; // <-- important!
+ });
+ });
+
+ Use ajaxForm when you want the plugin to manage all the event binding
+ for you. For example,
+
+ $(document).ready(function() {
+ $('#myForm').ajaxForm({
+ target: '#output'
+ });
+ });
+
+ When using ajaxForm, the ajaxSubmit function will be invoked for you
+ at the appropriate time.
+*/
+
+/**
+ * ajaxSubmit() provides a mechanism for immediately submitting
+ * an HTML form using AJAX.
+ */
+$.fn.ajaxSubmit = function(options) {
+ // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
+ if (!this.length) {
+ log('ajaxSubmit: skipping submit process - no element selected');
+ return this;
+ }
+
+ if (typeof options == 'function')
+ options = { success: options };
+
+ var url = $.trim(this.attr('action'));
+ if (url) {
+ // clean url (don't include hash vaue)
+ url = (url.match(/^([^#]+)/)||[])[1];
+ }
+ url = url || window.location.href || '';
+
+ options = $.extend({
+ url: url,
+ type: this.attr('method') || 'GET',
+ iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
+ }, options || {});
+
+ // hook for manipulating the form data before it is extracted;
+ // convenient for use with rich editors like tinyMCE or FCKEditor
+ var veto = {};
+ this.trigger('form-pre-serialize', [this, options, veto]);
+ if (veto.veto) {
+ log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
+ return this;
+ }
+
+ // provide opportunity to alter form data before it is serialized
+ if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
+ log('ajaxSubmit: submit aborted via beforeSerialize callback');
+ return this;
+ }
+
+ var a = this.formToArray(options.semantic);
+ if (options.data) {
+ options.extraData = options.data;
+ for (var n in options.data) {
+ if(options.data[n] instanceof Array) {
+ for (var k in options.data[n])
+ a.push( { name: n, value: options.data[n][k] } );
+ }
+ else
+ a.push( { name: n, value: options.data[n] } );
+ }
+ }
+
+ // give pre-submit callback an opportunity to abort the submit
+ if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
+ log('ajaxSubmit: submit aborted via beforeSubmit callback');
+ return this;
+ }
+
+ // fire vetoable 'validate' event
+ this.trigger('form-submit-validate', [a, this, options, veto]);
+ if (veto.veto) {
+ log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
+ return this;
+ }
+
+ var q = $.param(a);
+
+ if (options.type.toUpperCase() == 'GET') {
+ options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
+ options.data = null; // data is null for 'get'
+ }
+ else
+ options.data = q; // data is the query string for 'post'
+
+ var $form = this, callbacks = [];
+ if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
+ if (options.clearForm) callbacks.push(function() { $form.clearForm(); });
+
+ // perform a load on the target only if dataType is not provided
+ if (!options.dataType && options.target) {
+ var oldSuccess = options.success || function(){};
+ callbacks.push(function(data) {
+ $(options.target).html(data).each(oldSuccess, arguments);
+ });
+ }
+ else if (options.success)
+ callbacks.push(options.success);
+
+ options.success = function(data, status) {
+ for (var i=0, max=callbacks.length; i < max; i++)
+ callbacks[i].apply(options, [data, status, $form]);
+ };
+
+ // are there files to upload?
+ var files = $('input:file', this).fieldValue();
+ var found = false;
+ for (var j=0; j < files.length; j++)
+ if (files[j])
+ found = true;
+
+ var multipart = false;
+// var mp = 'multipart/form-data';
+// multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
+
+ // options.iframe allows user to force iframe mode
+ // 06-NOV-09: now defaulting to iframe mode if file input is detected
+ if ((files.length && options.iframe !== false) || options.iframe || found || multipart) {
+ // hack to fix Safari hang (thanks to Tim Molendijk for this)
+ // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
+ if (options.closeKeepAlive)
+ $.get(options.closeKeepAlive, fileUpload);
+ else
+ fileUpload();
+ }
+ else
+ $.ajax(options);
+
+ // fire 'notify' event
+ this.trigger('form-submit-notify', [this, options]);
+ return this;
+
+
+ // private function for handling file uploads (hat tip to YAHOO!)
+ function fileUpload() {
+ var form = $form[0];
+
+ if ($(':input[name=submit]', form).length) {
+ alert('Error: Form elements must not be named "submit".');
+ return;
+ }
+
+ var opts = $.extend({}, $.ajaxSettings, options);
+ var s = $.extend(true, {}, $.extend(true, {}, $.ajaxSettings), opts);
+
+ var id = 'jqFormIO' + (new Date().getTime());
+ var $io = $('<iframe id="' + id + '" name="' + id + '" src="'+ opts.iframeSrc +'" />');
+ var io = $io[0];
+
+ $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
+
+ var xhr = { // mock object
+ aborted: 0,
+ responseText: null,
+ responseXML: null,
+ status: 0,
+ statusText: 'n/a',
+ getAllResponseHeaders: function() {},
+ getResponseHeader: function() {},
+ setRequestHeader: function() {},
+ abort: function() {
+ this.aborted = 1;
+ $io.attr('src', opts.iframeSrc); // abort op in progress
+ }
+ };
+
+ var g = opts.global;
+ // trigger ajax global events so that activity/block indicators work like normal
+ if (g && ! $.active++) $.event.trigger("ajaxStart");
+ if (g) $.event.trigger("ajaxSend", [xhr, opts]);
+
+ if (s.beforeSend && s.beforeSend(xhr, s) === false) {
+ s.global && $.active--;
+ return;
+ }
+ if (xhr.aborted)
+ return;
+
+ var cbInvoked = 0;
+ var timedOut = 0;
+
+ // add submitting element to data if we know it
+ var sub = form.clk;
+ if (sub) {
+ var n = sub.name;
+ if (n && !sub.disabled) {
+ options.extraData = options.extraData || {};
+ options.extraData[n] = sub.value;
+ if (sub.type == "image") {
+ options.extraData[name+'.x'] = form.clk_x;
+ options.extraData[name+'.y'] = form.clk_y;
+ }
+ }
+ }
+
+ // take a breath so that pending repaints get some cpu time before the upload starts
+ setTimeout(function() {
+ // make sure form attrs are set
+ var t = $form.attr('target'), a = $form.attr('action');
+
+ // update form attrs in IE friendly way
+ form.setAttribute('target',id);
+ if (form.getAttribute('method') != 'POST')
+ form.setAttribute('method', 'POST');
+ if (form.getAttribute('action') != opts.url)
+ form.setAttribute('action', opts.url);
+
+ // ie borks in some cases when setting encoding
+ if (! options.skipEncodingOverride) {
+ $form.attr({
+ encoding: 'multipart/form-data',
+ enctype: 'multipart/form-data'
+ });
+ }
+
+ // support timout
+ if (opts.timeout)
+ setTimeout(function() { timedOut = true; cb(); }, opts.timeout);
+
+ // add "extra" data to form if provided in options
+ var extraInputs = [];
+ try {
+ if (options.extraData)
+ for (var n in options.extraData)
+ extraInputs.push(
+ $('<input type="hidden" name="'+n+'" value="'+options.extraData[n]+'" />')
+ .appendTo(form)[0]);
+
+ // add iframe to doc and submit the form
+ $io.appendTo('body');
+ io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
+ form.submit();
+ }
+ finally {
+ // reset attrs and remove "extra" input elements
+ form.setAttribute('action',a);
+ t ? form.setAttribute('target', t) : $form.removeAttr('target');
+ $(extraInputs).remove();
+ }
+ }, 10);
+
+ var domCheckCount = 50;
+
+ function cb() {
+ if (cbInvoked++) return;
+
+ io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
+
+ var ok = true;
+ try {
+ if (timedOut) throw 'timeout';
+ // extract the server response from the iframe
+ var data, doc;
+
+ doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
+
+ var isXml = opts.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
+ log('isXml='+isXml);
+ if (!isXml && (doc.body == null || doc.body.innerHTML == '')) {
+ if (--domCheckCount) {
+ // in some browsers (Opera) the iframe DOM is not always traversable when
+ // the onload callback fires, so we loop a bit to accommodate
+ cbInvoked = 0;
+ setTimeout(cb, 100);
+ return;
+ }
+ log('Could not access iframe DOM after 50 tries.');
+ return;
+ }
+
+ xhr.responseText = doc.body ? doc.body.innerHTML : null;
+ xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
+ xhr.getResponseHeader = function(header){
+ var headers = {'content-type': opts.dataType};
+ return headers[header];
+ };
+
+ if (opts.dataType == 'json' || opts.dataType == 'script') {
+ // see if user embedded response in textarea
+ var ta = doc.getElementsByTagName('textarea')[0];
+ if (ta)
+ xhr.responseText = ta.value;
+ else {
+ // account for browsers injecting pre around json response
+ var pre = doc.getElementsByTagName('pre')[0];
+ if (pre)
+ xhr.responseText = pre.innerHTML;
+ }
+ }
+ else if (opts.dataType == 'xml' && !xhr.responseXML && xhr.responseText != null) {
+ xhr.responseXML = toXml(xhr.responseText);
+ }
+ data = $.httpData(xhr, opts.dataType);
+ }
+ catch(e){
+ ok = false;
+ $.handleError(opts, xhr, 'error', e);
+ }
+
+ // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
+ if (ok) {
+ opts.success(data, 'success');
+ if (g) $.event.trigger("ajaxSuccess", [xhr, opts]);
+ }
+ if (g) $.event.trigger("ajaxComplete", [xhr, opts]);
+ if (g && ! --$.active) $.event.trigger("ajaxStop");
+ if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error');
+
+ // clean up
+ setTimeout(function() {
+ $io.remove();
+ xhr.responseXML = null;
+ }, 100);
+ };
+
+ function toXml(s, doc) {
+ if (window.ActiveXObject) {
+ doc = new ActiveXObject('Microsoft.XMLDOM');
+ doc.async = 'false';
+ doc.loadXML(s);
+ }
+ else
+ doc = (new DOMParser()).parseFromString(s, 'text/xml');
+ return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;
+ };
+ };
+};
+
+/**
+ * ajaxForm() provides a mechanism for fully automating form submission.
+ *
+ * The advantages of using this method instead of ajaxSubmit() are:
+ *
+ * 1: This method will include coordinates for <input type="image" /> elements (if the element
+ * is used to submit the form).
+ * 2. This method will include the submit element's name/value data (for the element that was
+ * used to submit the form).
+ * 3. This method binds the submit() method to the form for you.
+ *
+ * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely
+ * passes the options argument along after properly binding events for submit elements and
+ * the form itself.
+ */
+$.fn.ajaxForm = function(options) {
+ return this.ajaxFormUnbind().bind('submit.form-plugin', function() {
+ $(this).ajaxSubmit(options);
+ return false;
+ }).bind('click.form-plugin', function(e) {
+ var target = e.target;
+ var $el = $(target);
+ if (!($el.is(":submit,input:image"))) {
+ // is this a child element of the submit el? (ex: a span within a button)
+ var t = $el.closest(':submit');
+ if (t.length == 0)
+ return;
+ target = t[0];
+ }
+ var form = this;
+ form.clk = target;
+ if (target.type == 'image') {
+ if (e.offsetX != undefined) {
+ form.clk_x = e.offsetX;
+ form.clk_y = e.offsetY;
+ } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
+ var offset = $el.offset();
+ form.clk_x = e.pageX - offset.left;
+ form.clk_y = e.pageY - offset.top;
+ } else {
+ form.clk_x = e.pageX - target.offsetLeft;
+ form.clk_y = e.pageY - target.offsetTop;
+ }
+ }
+ // clear form vars
+ setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
+ });
+};
+
+// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
+$.fn.ajaxFormUnbind = function() {
+ return this.unbind('submit.form-plugin click.form-plugin');
+};
+
+/**
+ * formToArray() gathers form element data into an array of objects that can
+ * be passed to any of the following ajax functions: $.get, $.post, or load.
+ * Each object in the array has both a 'name' and 'value' property. An example of
+ * an array for a simple login form might be:
+ *
+ * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
+ *
+ * It is this array that is passed to pre-submit callback functions provided to the
+ * ajaxSubmit() and ajaxForm() methods.
+ */
+$.fn.formToArray = function(semantic) {
+ var a = [];
+ if (this.length == 0) return a;
+
+ var form = this[0];
+ var els = semantic ? form.getElementsByTagName('*') : form.elements;
+ if (!els) return a;
+ for(var i=0, max=els.length; i < max; i++) {
+ var el = els[i];
+ var n = el.name;
+ if (!n) continue;
+
+ if (semantic && form.clk && el.type == "image") {
+ // handle image inputs on the fly when semantic == true
+ if(!el.disabled && form.clk == el) {
+ a.push({name: n, value: $(el).val()});
+ a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+ }
+ continue;
+ }
+
+ var v = $.fieldValue(el, true);
+ if (v && v.constructor == Array) {
+ for(var j=0, jmax=v.length; j < jmax; j++)
+ a.push({name: n, value: v[j]});
+ }
+ else if (v !== null && typeof v != 'undefined')
+ a.push({name: n, value: v});
+ }
+
+ if (!semantic && form.clk) {
+ // input type=='image' are not found in elements array! handle it here
+ var $input = $(form.clk), input = $input[0], n = input.name;
+ if (n && !input.disabled && input.type == 'image') {
+ a.push({name: n, value: $input.val()});
+ a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+ }
+ }
+ return a;
+};
+
+/**
+ * Serializes form data into a 'submittable' string. This method will return a string
+ * in the format: name1=value1&amp;name2=value2
+ */
+$.fn.formSerialize = function(semantic) {
+ //hand off to jQuery.param for proper encoding
+ return $.param(this.formToArray(semantic));
+};
+
+/**
+ * Serializes all field elements in the jQuery object into a query string.
+ * This method will return a string in the format: name1=value1&amp;name2=value2
+ */
+$.fn.fieldSerialize = function(successful) {
+ var a = [];
+ this.each(function() {
+ var n = this.name;
+ if (!n) return;
+ var v = $.fieldValue(this, successful);
+ if (v && v.constructor == Array) {
+ for (var i=0,max=v.length; i < max; i++)
+ a.push({name: n, value: v[i]});
+ }
+ else if (v !== null && typeof v != 'undefined')
+ a.push({name: this.name, value: v});
+ });
+ //hand off to jQuery.param for proper encoding
+ return $.param(a);
+};
+
+/**
+ * Returns the value(s) of the element in the matched set. For example, consider the following form:
+ *
+ * <form><fieldset>
+ * <input name="A" type="text" />
+ * <input name="A" type="text" />
+ * <input name="B" type="checkbox" value="B1" />
+ * <input name="B" type="checkbox" value="B2"/>
+ * <input name="C" type="radio" value="C1" />
+ * <input name="C" type="radio" value="C2" />
+ * </fieldset></form>
+ *
+ * var v = $(':text').fieldValue();
+ * // if no values are entered into the text inputs
+ * v == ['','']
+ * // if values entered into the text inputs are 'foo' and 'bar'
+ * v == ['foo','bar']
+ *
+ * var v = $(':checkbox').fieldValue();
+ * // if neither checkbox is checked
+ * v === undefined
+ * // if both checkboxes are checked
+ * v == ['B1', 'B2']
+ *
+ * var v = $(':radio').fieldValue();
+ * // if neither radio is checked
+ * v === undefined
+ * // if first radio is checked
+ * v == ['C1']
+ *
+ * The successful argument controls whether or not the field element must be 'successful'
+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true. If this value is false the value(s)
+ * for each element is returned.
+ *
+ * Note: This method *always* returns an array. If no valid value can be determined the
+ * array will be empty, otherwise it will contain one or more values.
+ */
+$.fn.fieldValue = function(successful) {
+ for (var val=[], i=0, max=this.length; i < max; i++) {
+ var el = this[i];
+ var v = $.fieldValue(el, successful);
+ if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
+ continue;
+ v.constructor == Array ? $.merge(val, v) : val.push(v);
+ }
+ return val;
+};
+
+/**
+ * Returns the value of the field element.
+ */
+$.fieldValue = function(el, successful) {
+ var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
+ if (typeof successful == 'undefined') successful = true;
+
+ if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
+ (t == 'checkbox' || t == 'radio') && !el.checked ||
+ (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
+ tag == 'select' && el.selectedIndex == -1))
+ return null;
+
+ if (tag == 'select') {
+ var index = el.selectedIndex;
+ if (index < 0) return null;
+ var a = [], ops = el.options;
+ var one = (t == 'select-one');
+ var max = (one ? index+1 : ops.length);
+ for(var i=(one ? index : 0); i < max; i++) {
+ var op = ops[i];
+ if (op.selected) {
+ var v = op.value;
+ if (!v) // extra pain for IE...
+ v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;
+ if (one) return v;
+ a.push(v);
+ }
+ }
+ return a;
+ }
+ return el.value;
+};
+
+/**
+ * Clears the form data. Takes the following actions on the form's input fields:
+ * - input text fields will have their 'value' property set to the empty string
+ * - select elements will have their 'selectedIndex' property set to -1
+ * - checkbox and radio inputs will have their 'checked' property set to false
+ * - inputs of type submit, button, reset, and hidden will *not* be effected
+ * - button elements will *not* be effected
+ */
+$.fn.clearForm = function() {
+ return this.each(function() {
+ $('input,select,textarea', this).clearFields();
+ });
+};
+
+/**
+ * Clears the selected form elements.
+ */
+$.fn.clearFields = $.fn.clearInputs = function() {
+ return this.each(function() {
+ var t = this.type, tag = this.tagName.toLowerCase();
+ if (t == 'text' || t == 'password' || tag == 'textarea')
+ this.value = '';
+ else if (t == 'checkbox' || t == 'radio')
+ this.checked = false;
+ else if (tag == 'select')
+ this.selectedIndex = -1;
+ });
+};
+
+/**
+ * Resets the form data. Causes all form elements to be reset to their original value.
+ */
+$.fn.resetForm = function() {
+ return this.each(function() {
+ // guard against an input with the name of 'reset'
+ // note that IE reports the reset function as an 'object'
+ if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
+ this.reset();
+ });
+};
+
+/**
+ * Enables or disables any matching elements.
+ */
+$.fn.enable = function(b) {
+ if (b == undefined) b = true;
+ return this.each(function() {
+ this.disabled = !b;
+ });
+};
+
+/**
+ * Checks/unchecks any matching checkboxes or radio buttons and
+ * selects/deselects and matching option elements.
+ */
+$.fn.selected = function(select) {
+ if (select == undefined) select = true;
+ return this.each(function() {
+ var t = this.type;
+ if (t == 'checkbox' || t == 'radio')
+ this.checked = select;
+ else if (this.tagName.toLowerCase() == 'option') {
+ var $sel = $(this).parent('select');
+ if (select && $sel[0] && $sel[0].type == 'select-one') {
+ // deselect all other options
+ $sel.find('option').selected(false);
+ }
+ this.selected = select;
+ }
+ });
+};
+
+// helper fn for console logging
+// set $.fn.ajaxSubmit.debug to true to enable debug logging
+function log() {
+ if ($.fn.ajaxSubmit.debug && window.console && window.console.log)
+ window.console.log('[jquery.form] ' + Array.prototype.join.call(arguments,''));
+};
+
+})(jQuery);
+
+//Licensed under The MIT License
+//Copyright (c) 2008 Jason Frame (jason@onehackoranother.com)
+(function($){$.fn.tipsy=function(g){g=$.extend({fade:false,gravity:'n'},g||{});if(!g['offsetTop']){g['offsetTop']=0}if(!g['offsetLeft']){g['offsetLeft']=0}if(!g['header']){g['header']=''}if(!g['footer']){g['footer']=''}if(!g['hideTimeout']){g['hideTimeout']=100}if(!g['showTimeout']){g['hideTimeout']=0}if(!g['additionalCSSClass']){g['additionalCSSClass']=''}var h=false;var i=null,cancelHide=false;this.hover(function(){var a=$(this).text();var b=g['header'].replace('%{link}',a);var c=g['footer'].replace('%{link}',a);$.data(this,'cancel.tipsy',true);var d=$.data(this,'active.tipsy');if(!d){$('.tipsy').hide();d=$('<div class="tipsy '+g['additionalCSSClass']+'"><div class="tipsy-inner">'+b+$(this).attr('title')+c+'</div></div>');d.css({position:'absolute',zIndex:100000});$(this).attr('title','');$.data(this,'active.tipsy',d)}else if($(this).attr('title')!=''){d.find('.tipsy-inner').html($(this).attr('title'));$(this).attr('title','')}var e=$.extend({},$(this).offset(),{width:this.offsetWidth,height:this.offsetHeight});e.top=e.top+g['offsetTop'];e.left=e.left+g['offsetLeft'];$('.tipsy').hide();d.remove().css({top:0,left:0,visibility:'hidden',display:'block'}).appendTo(document.body);var f=d[0].offsetWidth,actualHeight=d[0].offsetHeight;switch(g.gravity.charAt(0)){case'n':d.css({top:e.top+e.height,left:e.left+e.width/2-f/2}).addClass('tipsy-north');break;case'l':d.css({top:e.top+e.height,left:e.left+e.width/2-18}).addClass('tipsy-north');break;case's':d.css({top:e.top-actualHeight,left:e.left+e.width/2-f/2}).addClass('tipsy-south');break;case'e':d.css({top:e.top+e.height/2-actualHeight/2,left:e.left-f}).addClass('tipsy-east');break;case'w':d.css({top:e.top+e.height/2-actualHeight/2,left:e.left+e.width}).addClass('tipsy-west');break}function show(){if(g.fade){d.css({opacity:0,display:'block',visibility:'visible'}).animate({opacity:1})}else{d.css({visibility:'visible'})}}if(g['showTimeout']){h=setTimeout(show,g['showTimeout'])}else{show()}},function(){clearTimeout(h);$.data(this,'cancel.tipsy',false);var b=this;setTimeout(function(){if($.data(this,'cancel.tipsy'))return;var a=$.data(b,'active.tipsy');if(g.fade){a.stop().fadeOut(function(){$(this).remove()})}else{a.remove()}},g['hideTimeout'])})}})(jQuery);
+
+/*
+ Shamless port of http://github.com/defunkt/mustache
+ by Jan Lehnardt <jan@apache.org>, Alexander Lang <alex@upstream-berlin.com>,
+ Sebastian Cohnen <sebastian.cohnen@googlemail.com>
+
+ Thanks @defunkt for the awesome code.
+
+ See http://github.com/defunkt/mustache for more info.
+*/
+
+var Mustache = function() {
+ var Renderer = function() {};
+
+ Renderer.prototype = {
+ otag: "{{",
+ ctag: "}}",
+
+ render: function(template, context, partials) {
+ // fail fast
+ if (template.indexOf(this.otag) == -1) {
+ return template;
+ }
+
+ var html = this.render_section(template, context, partials);
+ html = this.render_i18n(html);
+ return this.render_tags(html, context, partials);
+ },
+
+ /*
+ Tries to find a partial in the global scope and render it
+ */
+ render_partial: function(name, context, partials) {
+ if(typeof(context[name]) != "object") {
+ throw({message: "subcontext for '" + name + "' is not an object"});
+ }
+ if(!partials || !partials[name]) {
+ throw({message: "unknown_partial"});
+ }
+ return this.render(partials[name], context[name], partials);
+ },
+
+ /*
+ Renders boolean and enumerable sections
+ */
+ render_section: function(template, context, partials) {
+ var hasConditional = (template.indexOf(this.otag + "#") == -1)
+ var hasNegation = (template.indexOf(this.otag + "!") == -1)
+ if(!hasConditional && !hasNegation) {
+ return template;
+ }
+ var that = this;
+
+ // CSW - Added "+?" so it finds the tighest bound, not the widest
+ var regex = new RegExp(this.otag + "(\\#|\\~)(.+)" + this.ctag +
+ "\\s*([\\s\\S]+?)" + this.otag + "\\/\\2" + this.ctag + "\\s*", "mg");
+
+ // for each {{#foo}}{{/foo}} section do...
+ // and will also render negated sections with {{~foo}}{{/foo}}
+ return template.replace(regex, function(match, operation, name, content) {
+ var value = that.find(name, context);
+ if(that.is_array(value)) { // Enumerable, Let's loop!
+ return that.map(value, function(row) {
+ return that.render(content, that.merge(context,
+ that.create_context(row)), partials);
+ }).join('');
+ } else if(operation == "#" && !twttr.is.falsy(value)) { // boolean section
+ return that.render(content, context, partials);
+ } else if(operation == "~" && twttr.is.falsy(value)) {
+ return that.render(content, context, partials);
+ } else {
+ return "";
+ }
+ });
+ },
+
+ render_i18n: function(html) {
+ if (html.indexOf(this.otag + "_i") == -1) {
+ return html;
+ }
+ var that = this;
+ var regex = new RegExp(this.otag + "\\_i" + this.ctag +
+ "\\s*([\\s\\S]+?)" + this.otag + "\\/i" + this.ctag + "\\s*", "mg");
+ // for each {{_i}}{{/i}} section do...
+ return html.replace(regex, function(match, content) {
+ return _(content);
+ });
+ },
+
+ /*
+ Replace {{foo}} and friends with values from our view
+ */
+ render_tags: function(template, context, partials) {
+ var lines = template.split("\n");
+
+ var new_regex = function() {
+ return new RegExp(that.otag + "(=|!|<|\\{)?([^\/#]+?)\\1?" +
+ that.ctag + "+", "g");
+ };
+
+ // tit for tat
+ var that = this;
+
+ var regex = new_regex();
+ for (var i=0; i < lines.length; i++) {
+ lines[i] = lines[i].replace(regex, function (match, operator, name) {
+ switch(operator) {
+ case "!": // ignore comments
+ return match;
+ case "=": // set new delimiters, rebuild the replace regexp
+ that.set_delimiters(name);
+ regex = new_regex();
+ // redo the line in order to get tags with the new delimiters
+ // on the same line
+ i--;
+ return "";
+ case "<": // render partial
+ return that.render_partial(name, context, partials);
+ case "{": // the triple mustache is unescaped
+ var value = that.find(name, context);
+ return twttr.is.def(value) ? value : "";
+ default: // escape the value
+ var value = that.find(name, context);
+ return twttr.is.def(value) ? that.escape(value) : "";
+ }
+ },this);
+ };
+ return lines.join("\n");
+ },
+
+ set_delimiters: function(delimiters) {
+ var dels = delimiters.split(" ");
+ this.otag = this.escape_regex(dels[0]);
+ this.ctag = this.escape_regex(dels[1]);
+ },
+
+ escape_regex: function(text) {
+ // thank you Simon Willison
+ if(!arguments.callee.sRE) {
+ var specials = [
+ '/', '.', '*', '+', '?', '|',
+ '(', ')', '[', ']', '{', '}', '\\'
+ ];
+ arguments.callee.sRE = new RegExp(
+ '(\\' + specials.join('|\\') + ')', 'g'
+ );
+ }
+ return text.replace(arguments.callee.sRE, '\\$1');
+ },
+
+ /*
+ find `name` in current `context`. That is find me a value
+ from the view object
+ */
+ find: function(name, context) {
+ name = this.trim(name);
+ if (twttr.is.def(context) && typeof context[name] === "function") {
+ return context[name].apply(context);
+ }
+ if (context && context[name] !== undefined && context[name] !== null) {
+ return context[name];
+ } else {
+ return undefined;
+ }
+ },
+
+ i18n: function(name, context) {
+ console.log("i18n", name, context);
+ return _(this.trim(name));
+ },
+
+ // Utility methods
+
+ /*
+ Does away with nasty characters
+ */
+ escape: function(s) {
+ return s.toString().replace(/[&"<>\\]/g, function(s) {
+ switch(s) {
+ case "&": return "&amp;";
+ case "\\": return "\\\\";;
+ case '"': return '\"';;
+ case "<": return "&lt;";
+ case ">": return "&gt;";
+ default: return s;
+ }
+ });
+ },
+
+ /*
+ Merges all properties of object `b` into object `a`.
+ `b.property` overwrites a.property`
+ */
+ merge: function(a, b) {
+ var _new = {};
+ for(var name in a) {
+ if(a.hasOwnProperty(name)) {
+ _new[name] = a[name];
+ }
+ };
+ for(var name in b) {
+ if(b.hasOwnProperty(name)) {
+ _new[name] = b[name];
+ }
+ };
+ return _new;
+ },
+
+ create_context: function(_context) {
+ if(this.is_object(_context)) {
+ return _context;
+ } else {
+ return {'.': _context};
+ }
+ },
+
+ is_object: function(a) {
+ return a && typeof a == 'object'
+ },
+
+ /*
+ Thanks Doug Crockford
+ JavaScript — The Good Parts lists an alternative that works better with
+ frames. Frames can suck it, we use the simple version.
+ */
+ is_array: function(a) {
+ return (a &&
+ typeof a === 'object' &&
+ a.constructor === Array);
+ },
+
+ /*
+ Gets rid of leading and trailing whitespace
+ */
+ trim: function(s) {
+ return s.replace(/^\s*|\s*$/g, '');
+ },
+
+ /*
+ Why, why, why? Because IE. Cry, cry cry.
+ */
+ map: function(array, fn) {
+ if (typeof array.map == "function") {
+ return array.map(fn)
+ } else {
+ var r = [];
+ var l = array.length;
+ for(i=0;i<l;i++) {
+ r.push(fn(array[i]));
+ }
+ return r;
+ }
+ }
+ };
+
+ return({
+ name: "mustache.js",
+ version: "0.1",
+
+ /*
+ Turns a template and view into HTML
+ */
+ to_html: function(template, view, partials) {
+ return new Renderer().render(template, view, partials);
+ }
+ });
+}();
+
+
+
+(function(A){A.fn.dismissable=function(B){var D=A(this);var C={authenticity_token:twttr.form_authenticity_token,_method:"put"};C["user["+B.userAttribute+"]"]="1";D.find("a.dismiss").click(function(){D.hide();A.ajax({type:"POST",url:B.userUrl,data:C});return false});return this}})(jQuery);
+
+
+
+//<![CDATA[
+ page.summizeSearchUrl = 'http://integratedsearch.twitter.com/search.html';
+ page.query = '';
+ page.locale = 'en';
+
+ page.controller_name = 'TimelineController';
+ page.action_name = 'home';
+ twttr.form_authenticity_token = 'a96df982cd10e7cbdaaa0f2de38e43023d08d2de';
+ $.ajaxSetup({ data: { authenticity_token: 'a96df982cd10e7cbdaaa0f2de38e43023d08d2de' } });
+
+ // FIXME: Reconcile with the kinds on the Status model.
+ twttr.statusKinds = {
+ UPDATE: 1,
+ SHARE: 2
+ };
+ twttr.ListPerUserLimit = 20;
+
+
+//]]>
+
+
+
+//<![CDATA[
+
+ $( function () {
+ $('#latest_status').isCurrentStatus(); $('#direct_message_form').isDirectMessageForm();
+ $('.new-list').isNewListLink();
+ $('#local_trends').isLocationTrends();
+ $('.new-list-banner').isNewListLink();
+ initializePage('home');
+ $('.embedded_media_icon').isEmbeddedMediaExpander();
+ $('#user_alert_bulletin').isAlertBox();
+
+
+ });
+
+//]]>
+
+
+
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+
+
+
+
+(function(){var aa="_gat",ba="_gaq",r=true,v=false,w=undefined,ca="4.6.5",x="length",y="cookie",A="location",B="&",C="=",D="__utma=",E="__utmb=",G="__utmc=",da="__utmk=",H="__utmv=",J="__utmz=",K="__utmx=",L="GASO=";var N=function(i){return w==i||"-"==i||""==i},ea=function(i){return i[x]>0&&" \n\r\t".indexOf(i)>-1},P=function(i,l,g){var t="-",k;if(!N(i)&&!N(l)&&!N(g)){k=i.indexOf(l);if(k>-1){g=i.indexOf(g,k);if(g<0)g=i[x];t=O(i,k+l.indexOf(C)+1,g)}}return t},Q=function(i){var l=v,g=0,t,k;if(!N(i)){l=r;for(t=0;t<i[x];t++){k=i.charAt(t);g+="."==k?1:0;l=l&&g<=1&&(0==t&&"-"==k||".0123456789".indexOf(k)>-1)}}return l},S=function(i,l){var g=encodeURIComponent;return g instanceof Function?l?encodeURI(i):g(i):escape(i)},
+T=function(i,l){var g=decodeURIComponent,t;i=i.split("+").join(" ");if(g instanceof Function)try{t=l?decodeURI(i):g(i)}catch(k){t=unescape(i)}else t=unescape(i);return t},U=function(i,l){return i.indexOf(l)>-1},V=function(i,l){i[i[x]]=l},W=function(i){return i.toLowerCase()},X=function(i,l){return i.split(l)},fa=function(i,l){return i.indexOf(l)},O=function(i,l,g){g=w==g?i[x]:g;return i.substring(l,g)},ga=function(i,l){return i.join(l)},ia=function(i){var l=1,g=0,t;if(!N(i)){l=0;for(t=i[x]-1;t>=0;t--){g=
+i.charCodeAt(t);l=(l<<6&268435455)+g+(g<<14);g=l&266338304;l=g!=0?l^g>>21:l}}return l},ja=function(){var i=window,l=w;if(i&&i.gaGlobal&&i.gaGlobal.hid)l=i.gaGlobal.hid;else{l=Y();i.gaGlobal=i.gaGlobal?i.gaGlobal:{};i.gaGlobal.hid=l}return l},Y=function(){return Math.round(Math.random()*2147483647)},Z={Ha:function(i,l){this.bb=i;this.nb=l},ib:v,_gasoDomain:w,_gasoCPath:w};Z.Gb=function(){function i(k){return new t(k[0],k[1])}function l(k){var p=[];k=k.split(",");var f;for(f=0;f<k.length;++f)p.push(i(k[f].split(":")));return p}var g=this,t=Z.Ha;g.Ia="utm_campaign";g.Ja="utm_content";g.Ka="utm_id";g.La="utm_medium";g.Ma="utm_nooverride";g.Na="utm_source";g.Oa="utm_term";g.Pa="gclid";g.ba=0;g.z=0;g.Ta=15768E6;g.sb=18E5;g.v=63072E6;g.ta=[];g.va=[];g.nc="cse";g.oc="q";g.ob=5;g.T=l("daum:q,eniro:search_word,naver:query,images.google:q,google:q,yahoo:p,msn:q,bing:q,aol:query,aol:encquery,lycos:query,ask:q,altavista:q,netscape:query,cnn:query,about:terms,mamma:query,alltheweb:q,voila:rdata,virgilio:qs,live:q,baidu:wd,alice:qs,yandex:text,najdi:q,aol:q,mama:query,seznam:q,search:q,wp:szukaj,onet:qt,szukacz:q,yam:k,pchome:q,kvasir:q,sesam:q,ozu:q,terra:query,mynet:q,ekolay:q,rambler:words");
+g.t=w;g.lb=v;g.h="/";g.U=100;g.oa="/__utm.gif";g.ga=1;g.ha=1;g.u="|";g.fa=1;g.da=1;g.Ra=1;g.b="auto";g.I=1;g.ra=1E3;g.Jc=10;g.Pb=10;g.Kc=0.2;g.o=w;g.a=document;g.e=window};Z.Hb=function(i){function l(d,a,j,c){var n="",s=0;n=P(d,"2"+a,";");if(!N(n)){d=n.indexOf("^"+j+".");if(d<0)return["",0];n=O(n,d+j[x]+2);if(n.indexOf("^")>0)n=n.split("^")[0];j=n.split(":");n=j[1];s=parseInt(j[0],10);if(!c&&s<p.r)n=""}if(N(n))n="";return[n,s]}function g(d,a){return"^"+ga([[a,d[1]].join("."),d[0]],":")}function t(d,a){f.a[y]=d+"; path="+f.h+"; "+a+p.fb()}function k(d){var a=new Date;d=new Date(a.getTime()+d);return"expires="+d.toGMTString()+"; "}var p=this,f=i;p.r=(new Date).getTime();
+var h=[D,E,G,J,H,K,L];p.k=function(){var d=f.a[y];return f.o?p.Wb(d,f.o):d};p.Wb=function(d,a){var j=[],c,n;for(c=0;c<h[x];c++){n=l(d,h[c],a)[0];N(n)||(j[j[x]]=h[c]+n+";")}return j.join("")};p.l=function(d,a,j){var c=j>0?k(j):"";if(f.o){a=p.kc(f.a[y],d,f.o,a,j);d="2"+d;c=j>0?k(f.v):""}t(d+a,c)};p.kc=function(d,a,j,c,n){var s="";n=n||f.v;c=g([c,p.r+n*1],j);s=P(d,"2"+a,";");if(!N(s)){d=g(l(d,a,j,r),j);s=ga(s.split(d),"");return s=c+s}return c};p.fb=function(){return N(f.b)?"":"domain="+f.b+";"}};Z.$=function(i){function l(b){b=b instanceof Array?b.join("."):"";return N(b)?"-":b}function g(b,e){var o=[];if(!N(b)){o=b.split(".");if(e)for(b=0;b<o[x];b++)Q(o[b])||(o[b]="-")}return o}function t(b,e,o){var m=c.M,q,u;for(q=0;q<m[x];q++){u=m[q][0];u+=N(e)?e:e+m[q][4];m[q][2](P(b,u,o))}}var k,p,f,h,d,a,j,c=this,n,s=i;c.j=new Z.Hb(i);c.kb=function(){return w==n||n==c.P()};c.k=function(){return c.j.k()};c.ma=function(){return d?d:"-"};c.vb=function(b){d=b};c.za=function(b){n=Q(b)?b*1:"-"};c.la=function(){return l(a)};
+c.Aa=function(b){a=g(b)};c.Vb=function(){c.j.l(H,"",-1)};c.lc=function(){return n?n:"-"};c.fb=function(){return N(s.b)?"":"domain="+s.b+";"};c.ja=function(){return l(k)};c.tb=function(b){k=g(b,1)};c.C=function(){return l(p)};c.ya=function(b){p=g(b,1)};c.ka=function(){return l(f)};c.ub=function(b){f=g(b,1)};c.na=function(){return l(h)};c.wb=function(b){h=g(b);for(b=0;b<h[x];b++)if(b<4&&!Q(h[b]))h[b]="-"};c.fc=function(){return j};c.Dc=function(b){j=b};c.Sb=function(){k=[];p=[];f=[];h=[];d=w;a=[];n=
+w};c.P=function(){var b="",e;for(e=0;e<c.M[x];e++)b+=c.M[e][1]();return ia(b)};c.ua=function(b){var e=c.k(),o=v;if(e){t(e,b,";");c.za(c.P());o=r}return o};c.zc=function(b){t(b,"",B);c.za(P(b,da,B))};c.Hc=function(){var b=c.M,e=[],o;for(o=0;o<b[x];o++)V(e,b[o][0]+b[o][1]());V(e,da+c.P());return e.join(B)};c.Nc=function(b,e){var o=c.M,m=s.h;c.ua(b);s.h=e;for(b=0;b<o[x];b++)N(o[b][1]())||o[b][3]();s.h=m};c.Cb=function(){c.j.l(D,c.ja(),s.v)};c.Ea=function(){c.j.l(E,c.C(),s.sb)};c.Db=function(){c.j.l(G,
+c.ka(),0)};c.Ga=function(){c.j.l(J,c.na(),s.Ta)};c.Eb=function(){c.j.l(K,c.ma(),s.v)};c.Fa=function(){c.j.l(H,c.la(),s.v)};c.Oc=function(){c.j.l(L,c.fc(),0)};c.M=[[D,c.ja,c.tb,c.Cb,"."],[E,c.C,c.ya,c.Ea,""],[G,c.ka,c.ub,c.Db,""],[K,c.ma,c.vb,c.Eb,""],[J,c.na,c.wb,c.Ga,"."],[H,c.la,c.Aa,c.Fa,"."]]};Z.Kb=function(i){var l=this,g=i,t=new Z.$(g),k=function(){},p=function(f){var h=(new Date).getTime(),d;d=(h-f[3])*(g.Kc/1E3);if(d>=1){f[2]=Math.min(Math.floor(f[2]*1+d),g.Pb);f[3]=h}return f};l.H=function(f,h,d,a,j,c){var n,s=g.I,b=g.a[A];t.ua(d);n=X(t.C(),".");if(n[1]<500||a){if(j)n=p(n);if(a||!j||n[2]>=1){if(!a&&j)n[2]=n[2]*1-1;n[1]=n[1]*1+1;f="?utmwv="+ca+"&utmn="+Y()+(N(b.hostname)?"":"&utmhn="+S(b.hostname))+(g.U==100?"":"&utmsp="+S(g.U))+f;if(0==s||2==s){a=2==s?k:c||k;l.$a(g.oa+f,a)}if(1==s||
+2==s){f=("https:"==b.protocol?"https://ssl.google-analytics.com/__utm.gif":"http://www.google-analytics.com/__utm.gif")+f+"&utmac="+h+"&utmcc="+l.ac(d);if(ka)f+="&gaq=1";l.$a(f,c)}}}t.ya(n.join("."));t.Ea()};l.$a=function(f,h){var d=new Image(1,1);d.src=f;d.onload=function(){d.onload=null;(h||k)()}};l.ac=function(f){var h=[],d=[D,J,H,K],a,j=t.k(),c;for(a=0;a<d[x];a++){c=P(j,d[a]+f,";");if(!N(c)){if(d[a]==H){c=X(c.split(f+".")[1],"|")[0];if(N(c))continue;c=f+"."+c}V(h,d[a]+c+";")}}return S(h.join("+"))}};Z.n=function(){var i=this;i.Y=[];i.hb=function(l){var g,t=i.Y,k;for(k=0;k<t.length;k++)g=l==t[k].q?t[k]:g;return g};i.Ob=function(l,g,t,k,p,f,h,d){var a=i.hb(l);if(w==a){a=new Z.n.Mb(l,g,t,k,p,f,h,d);V(i.Y,a)}else{a.Qa=g;a.Ab=t;a.zb=k;a.xb=p;a.Xa=f;a.yb=h;a.Za=d}return a}};Z.n.Lb=function(i,l,g,t,k,p){var f=this;f.Bb=i;f.Ba=l;f.D=g;f.Va=t;f.pb=k;f.qb=p;f.Ca=function(){return"&"+["utmt=item","tid="+S(f.Bb),"ipc="+S(f.Ba),"ipn="+S(f.D),"iva="+S(f.Va),"ipr="+S(f.pb),"iqt="+S(f.qb)].join("&utm")}};
+Z.n.Mb=function(i,l,g,t,k,p,f,h){var d=this;d.q=i;d.Qa=l;d.Ab=g;d.zb=t;d.xb=k;d.Xa=p;d.yb=f;d.Za=h;d.R=[];d.Nb=function(a,j,c,n,s){var b=d.gc(a),e=d.q;if(w==b)V(d.R,new Z.n.Lb(e,a,j,c,n,s));else{b.Bb=e;b.Ba=a;b.D=j;b.Va=c;b.pb=n;b.qb=s}};d.gc=function(a){var j,c=d.R,n;for(n=0;n<c.length;n++)j=a==c[n].Ba?c[n]:j;return j};d.Ca=function(){return"&"+["utmt=tran","id="+S(d.q),"st="+S(d.Qa),"to="+S(d.Ab),"tx="+S(d.zb),"sp="+S(d.xb),"ci="+S(d.Xa),"rg="+S(d.yb),"co="+S(d.Za)].join("&utmt")}};Z.Fb=function(i){function l(){var f,h,d;h="ShockwaveFlash";var a="$version",j=k.d?k.d.plugins:w;if(j&&j[x]>0)for(f=0;f<j[x]&&!d;f++){h=j[f];if(U(h.name,"Shockwave Flash"))d=h.description.split("Shockwave Flash ")[1]}else{h=h+"."+h;try{f=new ActiveXObject(h+".7");d=f.GetVariable(a)}catch(c){}if(!d)try{f=new ActiveXObject(h+".6");d="WIN 6,0,21,0";f.AllowScriptAccess="always";d=f.GetVariable(a)}catch(n){}if(!d)try{f=new ActiveXObject(h);d=f.GetVariable(a)}catch(s){}if(d){d=X(d.split(" ")[1],",");d=d[0]+
+"."+d[1]+" r"+d[2]}}return d?d:p}var g=i,t=g.e,k=this,p="-";k.V=t.screen;k.Sa=!k.V&&t.java?java.awt.Toolkit.getDefaultToolkit():w;k.d=t.navigator;k.W=p;k.xa=p;k.Wa=p;k.qa=p;k.pa=1;k.eb=p;k.bc=function(){var f;if(t.screen){k.W=k.V.width+"x"+k.V.height;k.xa=k.V.colorDepth+"-bit"}else if(k.Sa)try{f=k.Sa.getScreenSize();k.W=f.width+"x"+f.height}catch(h){}k.qa=W(k.d&&k.d.language?k.d.language:k.d&&k.d.browserLanguage?k.d.browserLanguage:p);k.pa=k.d&&k.d.javaEnabled()?1:0;k.eb=g.ha?l():p;k.Wa=S(g.a.characterSet?
+g.a.characterSet:g.a.charset?g.a.charset:p)};k.Ic=function(){return B+"utm"+["cs="+S(k.Wa),"sr="+k.W,"sc="+k.xa,"ul="+k.qa,"je="+k.pa,"fl="+S(k.eb)].join("&utm")};k.$b=function(){var f=g.a,h=t.history[x];f=k.d.appName+k.d.version+k.qa+k.d.platform+k.d.userAgent+k.pa+k.W+k.xa+(f[y]?f[y]:"")+(f.referrer?f.referrer:"");for(var d=f[x];h>0;)f+=h--^d++;return ia(f)}};Z.m=function(i,l,g,t){function k(d){var a="";d=W(d.split("://")[1]);if(U(d,"/")){d=d.split("/")[1];if(U(d,"?"))a=d.split("?")[0]}return a}function p(d){var a="";a=W(d.split("://")[1]);if(U(a,"/"))a=a.split("/")[0];return a}var f=t,h=this;h.c=i;h.rb=l;h.r=g;h.ic=function(d){var a=h.gb();return new Z.m.w(P(d,f.Ka+C,B),P(d,f.Na+C,B),P(d,f.Pa+C,B),h.Q(d,f.Ia,"(not set)"),h.Q(d,f.La,"(not set)"),h.Q(d,f.Oa,a&&!N(a.K)?T(a.K):w),h.Q(d,f.Ja,w))};h.jb=function(d){var a=p(d),j=k(d);if(U(a,"google")){d=d.split("?").join(B);
+if(U(d,B+f.oc+C))if(j==f.nc)return r}return v};h.gb=function(){var d,a=h.rb,j,c,n=f.T;if(!(N(a)||"0"==a||!U(a,"://")||h.jb(a))){d=p(a);for(j=0;j<n[x];j++){c=n[j];if(U(d,W(c.bb))){a=a.split("?").join(B);if(U(a,B+c.nb+C)){d=a.split(B+c.nb+C)[1];if(U(d,B))d=d.split(B)[0];return new Z.m.w(w,c.bb,w,"(organic)","organic",d,w)}}}}};h.Q=function(d,a,j){d=P(d,a+C,B);return j=!N(d)?T(d):!N(j)?j:"-"};h.uc=function(d){var a=f.ta,j=v,c;if(d&&"organic"==d.S){d=W(T(d.K));for(c=0;c<a[x];c++)j=j||W(a[c])==d}return j};
+h.hc=function(){var d="",a="";d=h.rb;if(!(N(d)||"0"==d||!U(d,"://")||h.jb(d))){d=d.split("://")[1];if(U(d,"/")){a=O(d,d.indexOf("/"));a=a.split("?")[0];d=W(d.split("/")[0])}if(0==d.indexOf("www."))d=O(d,4);return new Z.m.w(w,d,w,"(referral)","referral",w,a)}};h.Xb=function(d){var a="";if(f.ba){a=d&&d.hash?d.href.substring(d.href.indexOf("#")):"";a=""!=a?a+B:a}a+=d.search;return a};h.dc=function(){return new Z.m.w(w,"(direct)",w,"(direct)","(none)",w,w)};h.vc=function(d){var a=v,j,c=f.va;if(d&&"referral"==
+d.S){d=W(S(d.X));for(j=0;j<c[x];j++)a=a||U(d,W(c[j]))}return a};h.L=function(d){return w!=d&&d.mb()};h.cc=function(d,a){var j="",c="-",n,s=0,b,e,o=h.c;if(!d)return"";e=d.k();j=h.Xb(f.a[A]);if(f.z&&d.kb()){c=d.na();if(!N(c)&&!U(c,";")){d.Ga();return""}}c=P(e,J+o+".",";");n=h.ic(j);if(h.L(n)){j=P(j,f.Ma+C,B);if("1"==j&&!N(c))return""}if(!h.L(n)){n=h.gb();if(!N(c)&&h.uc(n))return""}if(!h.L(n)&&a){n=h.hc();if(!N(c)&&h.vc(n))return""}if(!h.L(n))if(N(c)&&a)n=h.dc();if(!h.L(n))return"";if(!N(c)){s=c.split(".");
+b=new Z.m.w;b.Zb(s.slice(4).join("."));b=W(b.Da())==W(n.Da());s=s[3]*1}if(!b||a){a=P(e,D+o+".",";");e=a.lastIndexOf(".");a=e>9?O(a,e+1)*1:0;s++;a=0==a?1:a;d.wb([o,h.r,a,s,n.Da()].join("."));d.Ga();return B+"utmcn=1"}else return B+"utmcr=1"}};
+Z.m.w=function(i,l,g,t,k,p,f){var h=this;h.q=i;h.X=l;h.ea=g;h.D=t;h.S=k;h.K=p;h.Ya=f;h.Da=function(){var d=[],a=[["cid",h.q],["csr",h.X],["gclid",h.ea],["ccn",h.D],["cmd",h.S],["ctr",h.K],["cct",h.Ya]],j,c;if(h.mb())for(j=0;j<a[x];j++)if(!N(a[j][1])){c=a[j][1].split("+").join("%20");c=c.split(" ").join("%20");V(d,"utm"+a[j][0]+C+c)}return d.join("|")};h.mb=function(){return!(N(h.q)&&N(h.X)&&N(h.ea))};h.Zb=function(d){var a=function(j){return T(P(d,"utm"+j+C,"|"))};h.q=a("cid");h.X=a("csr");h.ea=a("gclid");
+h.D=a("ccn");h.S=a("cmd");h.K=a("ctr");h.Ya=a("cct")}};Z.Ib=function(i,l,g,t){function k(j,c,n){var s;if(!N(n)){n=n.split(",");for(var b=0;b<n[x];b++){s=n[b];if(!N(s)){s=s.split(h);if(s[x]==4)c[s[0]]=[s[1],s[2],j]}}}}var p=this,f=l,h=C,d=i,a=t;p.O=g;p.sa="";p.p={};p.tc=function(){var j;j=X(P(p.O.k(),H+f+".",";"),f+".")[1];if(!N(j)){j=j.split("|");k(1,p.p,j[1]);p.sa=j[0];p.Z()}};p.Z=function(){p.Qb();var j=p.sa,c,n,s="";for(c in p.p)if((n=p.p[c])&&1===n[2])s+=c+h+n[0]+h+n[1]+h+1+",";N(s)||(j+="|"+s);if(N(j))p.O.Vb();else{p.O.Aa(f+"."+j);p.O.Fa()}};p.Ec=
+function(j){p.sa=j;p.Z()};p.Cc=function(j,c,n,s){if(1!=s&&2!=s&&3!=s)s=3;var b=v;if(c&&n&&j>0&&j<=d.ob){c=S(c);n=S(n);if(c[x]+n[x]<=64){p.p[j]=[c,n,s];p.Z();b=r}}return b};p.mc=function(j){if((j=p.p[j])&&1===j[2])return j[1]};p.Ub=function(j){var c=p.p;if(c[j]){delete c[j];p.Z()}};p.Qb=function(){a._clearKey(8);a._clearKey(9);a._clearKey(11);var j=p.p,c,n;for(n in j)if(c=j[n]){a._setKey(8,n,c[0]);a._setKey(9,n,c[1]);(c=c[2])&&3!=c&&a._setKey(11,n,""+c)}}};Z.N=function(){function i(m,q,u,z){if(w==f[m])f[m]={};if(w==f[m][q])f[m][q]=[];f[m][q][u]=z}function l(m,q){if(w!=f[m]&&w!=f[m][q]){f[m][q]=w;q=r;var u;for(u=0;u<a[x];u++)if(w!=f[m][a[u]]){q=v;break}if(q)f[m]=w}}function g(m){var q="",u=v,z,M;for(z=0;z<a[x];z++){M=m[a[z]];if(w!=M){if(u)q+=a[z];q+=t(M);u=v}else u=r}return q}function t(m){var q=[],u,z;for(z=0;z<m[x];z++)if(w!=m[z]){u="";if(z!=o&&w==m[z-1])u+=z.toString()+s;u+=k(m[z]);V(q,u)}return j+q.join(n)+c}function k(m){var q="",u,z,M;for(u=0;u<
+m[x];u++){z=m.charAt(u);M=e[z];q+=w!=M?M:z}return q}var p=this,f={},h="k",d="v",a=[h,d],j="(",c=")",n="*",s="!",b="'",e={};e[b]="'0";e[c]="'1";e[n]="'2";e[s]="'3";var o=1;p.qc=function(m){return w!=f[m]};p.G=function(){var m="",q;for(q in f)if(w!=f[q])m+=q.toString()+g(f[q]);return m};p.Ac=function(m){if(m==w)return p.G();var q=m.G(),u;for(u in f)if(w!=f[u]&&!m.qc(u))q+=u.toString()+g(f[u]);return q};p._setKey=function(m,q,u){if(typeof u!="string")return v;i(m,h,q,u);return r};p._setValue=function(m,
+q,u){if(typeof u!="number"&&(w==Number||!(u instanceof Number))||Math.round(u)!=u||u==NaN||u==Infinity)return v;i(m,d,q,u.toString());return r};p._getKey=function(m,q){return w!=f[m]&&w!=f[m][h]?f[m][h][q]:w};p._getValue=function(m,q){return w!=f[m]&&w!=f[m][d]?f[m][d][q]:w};p._clearKey=function(m){l(m,h)};p._clearValue=function(m){l(m,d)}};Z.Jb=function(i,l){var g=this;g.Qc=l;g.xc=i;g._trackEvent=function(t,k,p){return l._trackEvent(g.xc,t,k,p)}};Z.aa=function(i,l){function g(){if("auto"==c.b){var b=c.a.domain;if("www."==O(b,0,4))b=O(b,4);c.b=b}c.b=W(c.b)}function t(){var b=c.b,e=b.indexOf("www.google.")*b.indexOf(".google.")*b.indexOf("google.");return e||"/"!=c.h||b.indexOf("google.org")>-1}function k(b,e,o){if(N(b)||N(e)||N(o))return"-";b=P(b,D+a.c+".",e);if(!N(b)){b=b.split(".");b[5]=b[5]?b[5]*1+1:1;b[3]=b[4];b[4]=o;b=b.join(".")}return b}function p(){return"file:"!=c.a[A].protocol&&t()}function f(b){if(!b||""==b)return"";for(;ea(b.charAt(0));)b=
+O(b,1);for(;ea(b.charAt(b[x]-1));)b=O(b,0,b[x]-1);return b}function h(b,e,o,m){if(!N(b())){e(m?T(b()):b());U(b(),";")||o()}}function d(b){var e,o=""!=b&&c.a[A].host!=b;if(o)for(e=0;e<c.t[x];e++)o=o&&fa(W(b),W(c.t[e]))==-1;return o}var a=this,j=w,c=new Z.Gb,n=v,s=w;a.e=window;a.r=Math.round((new Date).getTime()/1E3);a.s=i||"UA-XXXXX-X";a.ab=c.a.referrer;a.ia=w;a.f=w;a.B=w;a.F=v;a.A=w;a.Ua="";a.g=w;a.cb=w;a.c=w;a.i=w;c.o=l?S(l):w;a.wc=function(){var b=v;if(a.B)b=a.B.match(/^[0-9a-z-_.]{10,1200}$/i);
+return b};a.jc=function(){return Y()^a.A.$b()&2147483647};a.ec=function(){if(!c.b||""==c.b||"none"==c.b){c.b="";return 1}g();return c.Ra?ia(c.b):1};a.Yb=function(b,e){if(N(b))b="-";else{e+=c.h&&"/"!=c.h?c.h:"";e=b.indexOf(e);b=e>=0&&e<=8?"0":"["==b.charAt(0)&&"]"==b.charAt(b[x]-1)?"-":b}return b};a.wa=function(b){var e="",o=c.a;e+=c.fa?a.A.Ic():"";e+=c.da?a.Ua:"";e+=c.ga&&!N(o.title)?"&utmdt="+S(o.title):"";e+="&utmhid="+ja()+"&utmr="+S(a.ia)+"&utmp="+S(a.Bc(b));return e};a.Bc=function(b){var e=c.a[A];
+return b=w!=b&&""!=b?S(b,r):S(e.pathname+e.search,r)};a.Lc=function(b){if(a.J()){var e="";if(a.g!=w&&a.g.G()[x]>0)e+="&utme="+S(a.g.G());e+=a.wa(b);j.H(e,a.s,a.c)}};a.Tb=function(){var b=new Z.$(c);return b.ua(a.c)?b.Hc():w};a._getLinkerUrl=function(b,e){var o=b.split("#"),m=b,q=a.Tb();if(q)if(e&&1>=o[x])m+="#"+q;else if(!e||1>=o[x])if(1>=o[x])m+=(U(b,"?")?B:"?")+q;else m=o[0]+(U(b,"?")?B:"?")+q+"#"+o[1];return m};a.Fc=function(){var b;if(a.wc()){a.i.Dc(a.B);a.i.Oc();Z._gasoDomain=c.b;Z._gasoCPath=
+c.h;b=c.a.createElement("script");b.type="text/javascript";b.id="_gasojs";b.src="https://www.google.com/analytics/reporting/overlay_js?gaso="+a.B+B+Y();c.a.getElementsByTagName("head")[0].appendChild(b)}};a.pc=function(){var b=a.r,e=a.i,o=e.k(),m=a.c+"",q=c.e,u=q?q.gaGlobal:w,z,M=U(o,D+m+"."),la=U(o,E+m),ma=U(o,G+m),F,I=[],R="",ha=v;o=N(o)?"":o;if(c.z){z=c.a[A]&&c.a[A].hash?c.a[A].href.substring(c.a[A].href.indexOf("#")):"";if(c.ba&&!N(z))R=z+B;R+=c.a[A].search;if(!N(R)&&U(R,D)){e.zc(R);e.kb()||e.Sb();
+F=e.ja()}h(e.ma,e.vb,e.Eb,true);h(e.la,e.Aa,e.Fa)}if(N(F))if(M)if(!la||!ma){F=k(o,";",b);a.F=r}else{F=P(o,D+m+".",";");I=X(P(o,E+m,";"),".")}else{F=ga([m,a.jc(),b,b,b,1],".");ha=a.F=r}else if(N(e.C())||N(e.ka())){F=k(R,B,b);a.F=r}else{I=X(e.C(),".");m=I[0]}F=F.split(".");if(q&&u&&u.dh==m&&!c.o){F[4]=u.sid?u.sid:F[4];if(ha){F[3]=u.sid?u.sid:F[4];if(u.vid){b=u.vid.split(".");F[1]=b[0];F[2]=b[1]}}}e.tb(F.join("."));I[0]=m;I[1]=I[1]?I[1]:0;I[2]=w!=I[2]?I[2]:c.Jc;I[3]=I[3]?I[3]:F[4];e.ya(I.join("."));
+e.ub(m);N(e.lc())||e.za(e.P());e.Cb();e.Ea();e.Db()};a.rc=function(){j=new Z.Kb(c)};a._initData=function(){var b;if(!n){if(!a.A){a.A=new Z.Fb(c);a.A.bc()}a.c=a.ec();a.i=new Z.$(c);a.g=new Z.N;s=new Z.Ib(c,a.c,a.i,a.g);a.rc()}if(p()){a.pc();s.tc()}if(!n){if(p()){a.ia=a.Yb(a.ab,c.a.domain);if(c.da){b=new Z.m(a.c,a.ia,a.r,c);a.Ua=b.cc(a.i,a.F)}}a.cb=new Z.N;n=r}Z.ib||a.sc()};a._visitCode=function(){a._initData();var b=P(a.i.k(),D+a.c+".",";");b=b.split(".");return b[x]<4?"":b[1]};a._cookiePathCopy=function(b){a._initData();
+a.i&&a.i.Nc(a.c,b)};a.sc=function(){var b=c.a[A].hash;if(b&&1==b.indexOf("gaso="))b=P(b,"gaso=",B);else b=(b=c.e.name)&&0<=b.indexOf("gaso=")?P(b,"gaso=",B):P(a.i.k(),L,";");if(b[x]>=10){a.B=b;a.Fc()}Z.ib=r};a.J=function(){return a._visitCode()%1E4<c.U*100};a.Gc=function(){var b,e,o=c.a.links;if(!c.lb){b=c.a.domain;if("www."==O(b,0,4))b=O(b,4);c.t.push("."+b)}for(b=0;b<o[x]&&(c.ra==-1||b<c.ra);b++){e=o[b];if(d(e.host))if(!e.gatcOnclick){e.gatcOnclick=e.onclick?e.onclick:a.yc;e.onclick=function(m){var q=
+!this.target||this.target=="_self"||this.target=="_top"||this.target=="_parent";q=q&&!a.Rb(m);a.Mc(m,this,q);return q?v:this.gatcOnclick?this.gatcOnclick(m):r}}}};a.yc=function(){};a._trackPageview=function(b){if(p()){a._initData();c.t&&a.Gc();a.Lc(b);a.F=v}};a._trackTrans=function(){var b=a.c,e=[],o,m,q;a._initData();if(a.f&&a.J()){for(o=0;o<a.f.Y[x];o++){m=a.f.Y[o];V(e,m.Ca());for(q=0;q<m.R[x];q++)V(e,m.R[q].Ca())}for(o=0;o<e[x];o++)j.H(e[o],a.s,b,r)}};a._setTrans=function(){var b=c.a,e,o,m;b=b.getElementById?
+b.getElementById("utmtrans"):b.utmform&&b.utmform.utmtrans?b.utmform.utmtrans:w;a._initData();if(b&&b.value){a.f=new Z.n;m=b.value.split("UTM:");c.u=!c.u||""==c.u?"|":c.u;for(b=0;b<m[x];b++){m[b]=f(m[b]);e=m[b].split(c.u);for(o=0;o<e[x];o++)e[o]=f(e[o]);if("T"==e[0])a._addTrans(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]);else"I"==e[0]&&a._addItem(e[1],e[2],e[3],e[4],e[5],e[6])}}};a._addTrans=function(b,e,o,m,q,u,z,M){a.f=a.f?a.f:new Z.n;return a.f.Ob(b,e,o,m,q,u,z,M)};a._addItem=function(b,e,o,m,q,u){var z;
+a.f=a.f?a.f:new Z.n;(z=a.f.hb(b))||(z=a._addTrans(b,"","","","","","",""));z.Nb(e,o,m,q,u)};a._setVar=function(b){if(b&&""!=b&&t()){a._initData();s.Ec(S(b));a.J()&&j.H("&utmt=var",a.s,a.c)}};a._setCustomVar=function(b,e,o,m){a._initData();return s.Cc(b,e,o,m)};a._deleteCustomVar=function(b){a._initData();s.Ub(b)};a._getVisitorCustomVar=function(b){a._initData();return s.mc(b)};a._setMaxCustomVariables=function(b){c.ob=b};a._link=function(b,e){if(c.z&&b){a._initData();c.a[A].href=a._getLinkerUrl(b,
+e)}};a._linkByPost=function(b,e){if(c.z&&b&&b.action){a._initData();b.action=a._getLinkerUrl(b.action,e)}};a._setXKey=function(b,e,o){a.g._setKey(b,e,o)};a._setXValue=function(b,e,o){a.g._setValue(b,e,o)};a._getXKey=function(b,e){return a.g._getKey(b,e)};a._getXValue=function(b,e){return a.g.getValue(b,e)};a._clearXKey=function(b){a.g._clearKey(b)};a._clearXValue=function(b){a.g._clearValue(b)};a._createXObj=function(){a._initData();return new Z.N};a._sendXEvent=function(b){var e="";a._initData();
+if(a.J()){e+="&utmt=event&utme="+S(a.g.Ac(b))+a.wa();j.H(e,a.s,a.c,v,r)}};a._createEventTracker=function(b){a._initData();return new Z.Jb(b,a)};a._trackEvent=function(b,e,o,m){var q=a.cb;if(w!=b&&w!=e&&""!=b&&""!=e){q._clearKey(5);q._clearValue(5);(b=q._setKey(5,1,b)&&q._setKey(5,2,e)&&(w==o||q._setKey(5,3,o))&&(w==m||q._setValue(5,1,m)))&&a._sendXEvent(q)}else b=v;return b};a.Mc=function(b,e,o){a._initData();if(a.J()){var m=new Z.N;m._setKey(6,1,e.href);var q=o?function(){a.db(b,e)}:w;j.H("&utmt=event&utme="+
+S(m.G())+a.wa(),a.s,a.c,v,r,q);if(o){var u=this;c.e.setTimeout(function(){u.db(b,e)},500)}}};a.db=function(b,e){if(!b)b=c.e.event;var o=r;if(e.gatcOnclick)o=e.gatcOnclick(b);if(o||typeof o=="undefined")if(!e.target||e.target=="_self")c.e[A]=e.href;else if(e.target=="_top")c.e.top.document[A]=e.href;else if(e.target=="_parent")c.e.parent.document[A]=e.href};a.Rb=function(b){if(!b)b=c.e.event;var e=b.shiftKey||b.ctrlKey||b.altKey;if(!e)if(b.modifiers&&c.e.Event)e=b.modifiers&c.e.Event.CONTROL_MASK||
+b.modifiers&c.e.Event.SHIFT_MASK||b.modifiers&c.e.Event.ALT_MASK;return e};a.Pc=function(){return c};a._setDomainName=function(b){c.b=b};a._addOrganic=function(b,e,o){c.T.splice(o?0:c.T.length,0,new Z.Ha(b,e))};a._clearOrganic=function(){c.T=[]};a._addIgnoredOrganic=function(b){V(c.ta,b)};a._clearIgnoredOrganic=function(){c.ta=[]};a._addIgnoredRef=function(b){V(c.va,b)};a._clearIgnoredRef=function(){c.va=[]};a._setAllowHash=function(b){c.Ra=b?1:0};a._setCampaignTrack=function(b){c.da=b?1:0};a._setClientInfo=
+function(b){c.fa=b?1:0};a._getClientInfo=function(){return c.fa};a._setCookiePath=function(b){c.h=b};a._setTransactionDelim=function(b){c.u=b};a._setCookieTimeout=function(b){a._setCampaignCookieTimeout(b*1E3)};a._setCampaignCookieTimeout=function(b){c.Ta=b};a._setDetectFlash=function(b){c.ha=b?1:0};a._getDetectFlash=function(){return c.ha};a._setDetectTitle=function(b){c.ga=b?1:0};a._getDetectTitle=function(){return c.ga};a._setLocalGifPath=function(b){c.oa=b};a._getLocalGifPath=function(){return c.oa};
+a._setLocalServerMode=function(){c.I=0};a._setRemoteServerMode=function(){c.I=1};a._setLocalRemoteServerMode=function(){c.I=2};a._getServiceMode=function(){return c.I};a._setSampleRate=function(b){c.U=b};a._setSessionTimeout=function(b){a._setSessionCookieTimeout(b*1E3)};a._setSessionCookieTimeout=function(b){c.sb=b};a._setAllowLinker=function(b){c.z=b?1:0};a._setAllowAnchor=function(b){c.ba=b?1:0};a._setCampNameKey=function(b){c.Ia=b};a._setCampContentKey=function(b){c.Ja=b};a._setCampIdKey=function(b){c.Ka=
+b};a._setCampMediumKey=function(b){c.La=b};a._setCampNOKey=function(b){c.Ma=b};a._setCampSourceKey=function(b){c.Na=b};a._setCampTermKey=function(b){c.Oa=b};a._setCampCIdKey=function(b){c.Pa=b};a._getAccount=function(){return a.s};a._setAccount=function(b){a.s=b};a._setNamespace=function(b){c.o=b?S(b):w};a._getVersion=function(){return ca};a._setAutoTrackOutbound=function(b){c.t=[];if(b)c.t=b};a._setTrackOutboundSubdomains=function(b){c.lb=b};a._setHrefExamineLimit=function(b){c.ra=b};a._setReferrerOverride=
+function(b){a.ab=b};a._setCookiePersistence=function(b){a._setVisitorCookieTimeout(b)};a._setVisitorCookieTimeout=function(b){c.v=b}};Z._getTracker=function(i,l){return new Z.aa(i,l)};var ka=v,$={ca:{},_createAsyncTracker:function(i,l){l=l||"";i=new Z.aa(i);$.ca[l]=i;ka=r;return i},_getAsyncTracker:function(i){i=i||"";var l=$.ca[i];if(!l){l=new Z.aa;$.ca[i]=l;ka=r}return l},push:function(){for(var i=arguments,l=0,g=0;g<i[x];g++)try{if(typeof i[g]==="function")i[g]();else{var t="",k=i[g][0],p=k.lastIndexOf(".");if(p>0){t=O(k,0,p);k=O(k,p+1)}var f=$._getAsyncTracker(t);f[k].apply(f,i[g].slice(1))}}catch(h){l++}return l}};window[aa]=Z;function na(){var i=window[ba],l=v;if(i&&typeof i.push=="function"){l=i.constructor==Array;if(!l)return}window[ba]=$;l&&$.push.apply($,i)}na();})()
+
+ try {
+ var pageTracker = _gat._getTracker("UA-30775-6");
+ pageTracker._setDomainName("twitter.com");
+ pageTracker._setVar('Logged In');
+ pageTracker._setVar('lang: en');
+ pageTracker._initData();
+ pageTracker._trackPageview('/home');
+ } catch(err) { }
+</script>
+
+
+<script id="v8" type="x">
+// Copyright 2008 Google Inc. All Rights Reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+// Simple framework for running the benchmark suites and
+// computing a score based on the timing measurements.
+
+
+// A benchmark has a name (string) and a function that will be run to
+// do the performance measurement.
+function Benchmark(name, run) {
+ this.name = name;
+ this.run = run;
+}
+
+
+// Benchmark results hold the benchmark and the measured time used to
+// run the benchmark. The benchmark score is computed later once a
+// full benchmark suite has run to completion.
+function BenchmarkResult(benchmark, time) {
+ this.benchmark = benchmark;
+ this.time = time;
+}
+
+
+// Automatically convert results to numbers. Used by the geometric
+// mean computation.
+BenchmarkResult.prototype.valueOf = function() {
+ return this.time;
+}
+
+
+// Suites of benchmarks consist of a name and the set of benchmarks in
+// addition to the reference timing that the final score will be based
+// on. This way, all scores are relative to a reference run and higher
+// scores implies better performance.
+function BenchmarkSuite(name, reference, benchmarks) {
+ this.name = name;
+ this.reference = reference;
+ this.benchmarks = benchmarks;
+ BenchmarkSuite.suites.push(this);
+}
+
+
+// Keep track of all declared benchmark suites.
+BenchmarkSuite.suites = [];
+
+
+// Scores are not comparable across versions. Bump the version if
+// you're making changes that will affect that scores, e.g. if you add
+// a new benchmark or change an existing one.
+BenchmarkSuite.version = '1';
+
+
+// Runs all registered benchmark suites and optionally yields between
+// each individual benchmark to avoid running for too long in the
+// context of browsers. Once done, the final score is reported to the
+// runner.
+BenchmarkSuite.RunSuites = function(runner) {
+ var continuation = null;
+ var suites = BenchmarkSuite.suites;
+ var length = suites.length;
+ BenchmarkSuite.scores = [];
+ var index = 0;
+ function RunStep() {
+ while (continuation || index < length) {
+ if (continuation) {
+ continuation = continuation();
+ } else {
+ var suite = suites[index++];
+ if (runner.NotifyStart) runner.NotifyStart(suite.name);
+ continuation = suite.RunStep(runner);
+ }
+ if (continuation && typeof window != 'undefined' && window.setTimeout) {
+ window.setTimeout(RunStep, 100);
+ return;
+ }
+ }
+ if (runner.NotifyScore) {
+ var score = BenchmarkSuite.GeometricMean(BenchmarkSuite.scores);
+ runner.NotifyScore(Math.round(100 * score));
+ }
+ }
+ RunStep();
+}
+
+
+// Counts the total number of registered benchmarks. Useful for
+// showing progress as a percentage.
+BenchmarkSuite.CountBenchmarks = function() {
+ var result = 0;
+ var suites = BenchmarkSuite.suites;
+ for (var i = 0; i < suites.length; i++) {
+ result += suites[i].benchmarks.length;
+ }
+ return result;
+}
+
+
+// Computes the geometric mean of a set of numbers.
+BenchmarkSuite.GeometricMean = function(numbers) {
+ var log = 0;
+ for (var i = 0; i < numbers.length; i++) {
+ log += Math.log(numbers[i]);
+ }
+ return Math.pow(Math.E, log / numbers.length);
+}
+
+
+// Notifies the runner that we're done running a single benchmark in
+// the benchmark suite. This can be useful to report progress.
+BenchmarkSuite.prototype.NotifyStep = function(result) {
+ this.results.push(result);
+ if (this.runner.NotifyStep) this.runner.NotifyStep(result.benchmark.name);
+}
+
+
+// Notifies the runner that we're done with running a suite and that
+// we have a result which can be reported to the user if needed.
+BenchmarkSuite.prototype.NotifyResult = function() {
+ var mean = BenchmarkSuite.GeometricMean(this.results);
+ var score = this.reference / mean;
+ BenchmarkSuite.scores.push(score);
+ if (this.runner.NotifyResult) {
+ this.runner.NotifyResult(this.name, Math.round(100 * score));
+ }
+}
+
+
+// Runs a single benchmark for at least a second and computes the
+// average time it takes to run a single iteration.
+BenchmarkSuite.prototype.RunSingle = function(benchmark) {
+ var elapsed = 0;
+ var start = new Date();
+ for (var n = 0; elapsed < 1000; n++) {
+ benchmark.run();
+ elapsed = new Date() - start;
+ }
+ var usec = (elapsed * 1000) / n;
+ this.NotifyStep(new BenchmarkResult(benchmark, usec));
+}
+
+
+// This function starts running a suite, but stops between each
+// individual benchmark in the suite and returns a continuation
+// function which can be invoked to run the next benchmark. Once the
+// last benchmark has been executed, null is returned.
+BenchmarkSuite.prototype.RunStep = function(runner) {
+ this.results = [];
+ this.runner = runner;
+ var length = this.benchmarks.length;
+ var index = 0;
+ var suite = this;
+ function RunNext() {
+ if (index < length) {
+ suite.RunSingle(suite.benchmarks[index++]);
+ return RunNext;
+ }
+ suite.NotifyResult();
+ return null;
+ }
+ return RunNext();
+}
+/*
+ * Copyright (c) 2003-2005 Tom Wu
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
+ * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * In addition, the following condition applies:
+ *
+ * All redistributions must retain an intact copy of this copyright notice
+ * and disclaimer.
+ */
+
+
+// The code has been adapted for use as a benchmark by Google.
+var Crypto = new BenchmarkSuite('Crypto', 203037, [
+ new Benchmark("Encrypt", encrypt),
+ new Benchmark("Decrypt", decrypt)
+]);
+
+
+// Basic JavaScript BN library - subset useful for RSA encryption.
+
+// Bits per digit
+var dbits;
+var BI_DB;
+var BI_DM;
+var BI_DV;
+
+var BI_FP;
+var BI_FV;
+var BI_F1;
+var BI_F2;
+
+// JavaScript engine analysis
+var canary = 0xdeadbeefcafe;
+var j_lm = ((canary&0xffffff)==0xefcafe);
+
+// (public) Constructor
+function BigInteger(a,b,c) {
+ this.array = new Array();
+ if(a != null)
+ if("number" == typeof a) this.fromNumber(a,b,c);
+ else if(b == null && "string" != typeof a) this.fromString(a,256);
+ else this.fromString(a,b);
+}
+
+// return new, unset BigInteger
+function nbi() { return new BigInteger(null); }
+
+// am: Compute w_j += (x*this_i), propagate carries,
+// c is initial carry, returns final carry.
+// c < 3*dvalue, x < 2*dvalue, this_i < dvalue
+// We need to select the fastest one that works in this environment.
+
+// am1: use a single mult and divide to get the high bits,
+// max digit bits should be 26 because
+// max internal value = 2*dvalue^2-2*dvalue (< 2^53)
+function am1(i,x,w,j,c,n) {
+ var this_array = this.array;
+ var w_array = w.array;
+ while(--n >= 0) {
+ var v = x*this_array[i++]+w_array[j]+c;
+ c = Math.floor(v/0x4000000);
+ w_array[j++] = v&0x3ffffff;
+ }
+ return c;
+}
+
+// am2 avoids a big mult-and-extract completely.
+// Max digit bits should be <= 30 because we do bitwise ops
+// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
+function am2(i,x,w,j,c,n) {
+ var this_array = this.array;
+ var w_array = w.array;
+ var xl = x&0x7fff, xh = x>>15;
+ while(--n >= 0) {
+ var l = this_array[i]&0x7fff;
+ var h = this_array[i++]>>15;
+ var m = xh*l+h*xl;
+ l = xl*l+((m&0x7fff)<<15)+w_array[j]+(c&0x3fffffff);
+ c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);
+ w_array[j++] = l&0x3fffffff;
+ }
+ return c;
+}
+
+// Alternately, set max digit bits to 28 since some
+// browsers slow down when dealing with 32-bit numbers.
+function am3(i,x,w,j,c,n) {
+ var this_array = this.array;
+ var w_array = w.array;
+
+ var xl = x&0x3fff, xh = x>>14;
+ while(--n >= 0) {
+ var l = this_array[i]&0x3fff;
+ var h = this_array[i++]>>14;
+ var m = xh*l+h*xl;
+ l = xl*l+((m&0x3fff)<<14)+w_array[j]+c;
+ c = (l>>28)+(m>>14)+xh*h;
+ w_array[j++] = l&0xfffffff;
+ }
+ return c;
+}
+
+// This is tailored to VMs with 2-bit tagging. It makes sure
+// that all the computations stay within the 29 bits available.
+function am4(i,x,w,j,c,n) {
+ var this_array = this.array;
+ var w_array = w.array;
+
+ var xl = x&0x1fff, xh = x>>13;
+ while(--n >= 0) {
+ var l = this_array[i]&0x1fff;
+ var h = this_array[i++]>>13;
+ var m = xh*l+h*xl;
+ l = xl*l+((m&0x1fff)<<13)+w_array[j]+c;
+ c = (l>>26)+(m>>13)+xh*h;
+ w_array[j++] = l&0x3ffffff;
+ }
+ return c;
+}
+
+// am3/28 is best for SM, Rhino, but am4/26 is best for v8.
+// Kestrel (Opera 9.5) gets its best result with am4/26.
+// IE7 does 9% better with am3/28 than with am4/26.
+// Firefox (SM) gets 10% faster with am3/28 than with am4/26.
+
+setupEngine = function(fn, bits) {
+ BigInteger.prototype.am = fn;
+ dbits = bits;
+
+ BI_DB = dbits;
+ BI_DM = ((1<<dbits)-1);
+ BI_DV = (1<<dbits);
+
+ BI_FP = 52;
+ BI_FV = Math.pow(2,BI_FP);
+ BI_F1 = BI_FP-dbits;
+ BI_F2 = 2*dbits-BI_FP;
+}
+
+
+// Digit conversions
+var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
+var BI_RC = new Array();
+var rr,vv;
+rr = "0".charCodeAt(0);
+for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
+rr = "a".charCodeAt(0);
+for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
+rr = "A".charCodeAt(0);
+for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
+
+function int2char(n) { return BI_RM.charAt(n); }
+function intAt(s,i) {
+ var c = BI_RC[s.charCodeAt(i)];
+ return (c==null)?-1:c;
+}
+
+// (protected) copy this to r
+function bnpCopyTo(r) {
+ var this_array = this.array;
+ var r_array = r.array;
+
+ for(var i = this.t-1; i >= 0; --i) r_array[i] = this_array[i];
+ r.t = this.t;
+ r.s = this.s;
+}
+
+// (protected) set from integer value x, -DV <= x < DV
+function bnpFromInt(x) {
+ var this_array = this.array;
+ this.t = 1;
+ this.s = (x<0)?-1:0;
+ if(x > 0) this_array[0] = x;
+ else if(x < -1) this_array[0] = x+DV;
+ else this.t = 0;
+}
+
+// return bigint initialized to value
+function nbv(i) { var r = nbi(); r.fromInt(i); return r; }
+
+// (protected) set from string and radix
+function bnpFromString(s,b) {
+ var this_array = this.array;
+ var k;
+ if(b == 16) k = 4;
+ else if(b == 8) k = 3;
+ else if(b == 256) k = 8; // byte array
+ else if(b == 2) k = 1;
+ else if(b == 32) k = 5;
+ else if(b == 4) k = 2;
+ else { this.fromRadix(s,b); return; }
+ this.t = 0;
+ this.s = 0;
+ var i = s.length, mi = false, sh = 0;
+ while(--i >= 0) {
+ var x = (k==8)?s[i]&0xff:intAt(s,i);
+ if(x < 0) {
+ if(s.charAt(i) == "-") mi = true;
+ continue;
+ }
+ mi = false;
+ if(sh == 0)
+ this_array[this.t++] = x;
+ else if(sh+k > BI_DB) {
+ this_array[this.t-1] |= (x&((1<<(BI_DB-sh))-1))<<sh;
+ this_array[this.t++] = (x>>(BI_DB-sh));
+ }
+ else
+ this_array[this.t-1] |= x<<sh;
+ sh += k;
+ if(sh >= BI_DB) sh -= BI_DB;
+ }
+ if(k == 8 && (s[0]&0x80) != 0) {
+ this.s = -1;
+ if(sh > 0) this_array[this.t-1] |= ((1<<(BI_DB-sh))-1)<<sh;
+ }
+ this.clamp();
+ if(mi) BigInteger.ZERO.subTo(this,this);
+}
+
+// (protected) clamp off excess high words
+function bnpClamp() {
+ var this_array = this.array;
+ var c = this.s&BI_DM;
+ while(this.t > 0 && this_array[this.t-1] == c) --this.t;
+}
+
+// (public) return string representation in given radix
+function bnToString(b) {
+ var this_array = this.array;
+ if(this.s < 0) return "-"+this.negate().toString(b);
+ var k;
+ if(b == 16) k = 4;
+ else if(b == 8) k = 3;
+ else if(b == 2) k = 1;
+ else if(b == 32) k = 5;
+ else if(b == 4) k = 2;
+ else return this.toRadix(b);
+ var km = (1<<k)-1, d, m = false, r = "", i = this.t;
+ var p = BI_DB-(i*BI_DB)%k;
+ if(i-- > 0) {
+ if(p < BI_DB && (d = this_array[i]>>p) > 0) { m = true; r = int2char(d); }
+ while(i >= 0) {
+ if(p < k) {
+ d = (this_array[i]&((1<<p)-1))<<(k-p);
+ d |= this_array[--i]>>(p+=BI_DB-k);
+ }
+ else {
+ d = (this_array[i]>>(p-=k))&km;
+ if(p <= 0) { p += BI_DB; --i; }
+ }
+ if(d > 0) m = true;
+ if(m) r += int2char(d);
+ }
+ }
+ return m?r:"0";
+}
+
+// (public) -this
+function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
+
+// (public) |this|
+function bnAbs() { return (this.s<0)?this.negate():this; }
+
+// (public) return + if this > a, - if this < a, 0 if equal
+function bnCompareTo(a) {
+ var this_array = this.array;
+ var a_array = a.array;
+
+ var r = this.s-a.s;
+ if(r != 0) return r;
+ var i = this.t;
+ r = i-a.t;
+ if(r != 0) return r;
+ while(--i >= 0) if((r=this_array[i]-a_array[i]) != 0) return r;
+ return 0;
+}
+
+// returns bit length of the integer x
+function nbits(x) {
+ var r = 1, t;
+ if((t=x>>>16) != 0) { x = t; r += 16; }
+ if((t=x>>8) != 0) { x = t; r += 8; }
+ if((t=x>>4) != 0) { x = t; r += 4; }
+ if((t=x>>2) != 0) { x = t; r += 2; }
+ if((t=x>>1) != 0) { x = t; r += 1; }
+ return r;
+}
+
+// (public) return the number of bits in "this"
+function bnBitLength() {
+ var this_array = this.array;
+ if(this.t <= 0) return 0;
+ return BI_DB*(this.t-1)+nbits(this_array[this.t-1]^(this.s&BI_DM));
+}
+
+// (protected) r = this << n*DB
+function bnpDLShiftTo(n,r) {
+ var this_array = this.array;
+ var r_array = r.array;
+ var i;
+ for(i = this.t-1; i >= 0; --i) r_array[i+n] = this_array[i];
+ for(i = n-1; i >= 0; --i) r_array[i] = 0;
+ r.t = this.t+n;
+ r.s = this.s;
+}
+
+// (protected) r = this >> n*DB
+function bnpDRShiftTo(n,r) {
+ var this_array = this.array;
+ var r_array = r.array;
+ for(var i = n; i < this.t; ++i) r_array[i-n] = this_array[i];
+ r.t = Math.max(this.t-n,0);
+ r.s = this.s;
+}
+
+// (protected) r = this << n
+function bnpLShiftTo(n,r) {
+ var this_array = this.array;
+ var r_array = r.array;
+ var bs = n%BI_DB;
+ var cbs = BI_DB-bs;
+ var bm = (1<<cbs)-1;
+ var ds = Math.floor(n/BI_DB), c = (this.s<<bs)&BI_DM, i;
+ for(i = this.t-1; i >= 0; --i) {
+ r_array[i+ds+1] = (this_array[i]>>cbs)|c;
+ c = (this_array[i]&bm)<<bs;
+ }
+ for(i = ds-1; i >= 0; --i) r_array[i] = 0;
+ r_array[ds] = c;
+ r.t = this.t+ds+1;
+ r.s = this.s;
+ r.clamp();
+}
+
+// (protected) r = this >> n
+function bnpRShiftTo(n,r) {
+ var this_array = this.array;
+ var r_array = r.array;
+ r.s = this.s;
+ var ds = Math.floor(n/BI_DB);
+ if(ds >= this.t) { r.t = 0; return; }
+ var bs = n%BI_DB;
+ var cbs = BI_DB-bs;
+ var bm = (1<<bs)-1;
+ r_array[0] = this_array[ds]>>bs;
+ for(var i = ds+1; i < this.t; ++i) {
+ r_array[i-ds-1] |= (this_array[i]&bm)<<cbs;
+ r_array[i-ds] = this_array[i]>>bs;
+ }
+ if(bs > 0) r_array[this.t-ds-1] |= (this.s&bm)<<cbs;
+ r.t = this.t-ds;
+ r.clamp();
+}
+
+// (protected) r = this - a
+function bnpSubTo(a,r) {
+ var this_array = this.array;
+ var r_array = r.array;
+ var a_array = a.array;
+ var i = 0, c = 0, m = Math.min(a.t,this.t);
+ while(i < m) {
+ c += this_array[i]-a_array[i];
+ r_array[i++] = c&BI_DM;
+ c >>= BI_DB;
+ }
+ if(a.t < this.t) {
+ c -= a.s;
+ while(i < this.t) {
+ c += this_array[i];
+ r_array[i++] = c&BI_DM;
+ c >>= BI_DB;
+ }
+ c += this.s;
+ }
+ else {
+ c += this.s;
+ while(i < a.t) {
+ c -= a_array[i];
+ r_array[i++] = c&BI_DM;
+ c >>= BI_DB;
+ }
+ c -= a.s;
+ }
+ r.s = (c<0)?-1:0;
+ if(c < -1) r_array[i++] = BI_DV+c;
+ else if(c > 0) r_array[i++] = c;
+ r.t = i;
+ r.clamp();
+}
+
+// (protected) r = this * a, r != this,a (HAC 14.12)
+// "this" should be the larger one if appropriate.
+function bnpMultiplyTo(a,r) {
+ var this_array = this.array;
+ var r_array = r.array;
+ var x = this.abs(), y = a.abs();
+ var y_array = y.array;
+
+ var i = x.t;
+ r.t = i+y.t;
+ while(--i >= 0) r_array[i] = 0;
+ for(i = 0; i < y.t; ++i) r_array[i+x.t] = x.am(0,y_array[i],r,i,0,x.t);
+ r.s = 0;
+ r.clamp();
+ if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
+}
+
+// (protected) r = this^2, r != this (HAC 14.16)
+function bnpSquareTo(r) {
+ var x = this.abs();
+ var x_array = x.array;
+ var r_array = r.array;
+
+ var i = r.t = 2*x.t;
+ while(--i >= 0) r_array[i] = 0;
+ for(i = 0; i < x.t-1; ++i) {
+ var c = x.am(i,x_array[i],r,2*i,0,1);
+ if((r_array[i+x.t]+=x.am(i+1,2*x_array[i],r,2*i+1,c,x.t-i-1)) >= BI_DV) {
+ r_array[i+x.t] -= BI_DV;
+ r_array[i+x.t+1] = 1;
+ }
+ }
+ if(r.t > 0) r_array[r.t-1] += x.am(i,x_array[i],r,2*i,0,1);
+ r.s = 0;
+ r.clamp();
+}
+
+// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
+// r != q, this != m. q or r may be null.
+function bnpDivRemTo(m,q,r) {
+ var pm = m.abs();
+ if(pm.t <= 0) return;
+ var pt = this.abs();
+ if(pt.t < pm.t) {
+ if(q != null) q.fromInt(0);
+ if(r != null) this.copyTo(r);
+ return;
+ }
+ if(r == null) r = nbi();
+ var y = nbi(), ts = this.s, ms = m.s;
+ var pm_array = pm.array;
+ var nsh = BI_DB-nbits(pm_array[pm.t-1]); // normalize modulus
+ if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
+ else { pm.copyTo(y); pt.copyTo(r); }
+ var ys = y.t;
+
+ var y_array = y.array;
+ var y0 = y_array[ys-1];
+ if(y0 == 0) return;
+ var yt = y0*(1<<BI_F1)+((ys>1)?y_array[ys-2]>>BI_F2:0);
+ var d1 = BI_FV/yt, d2 = (1<<BI_F1)/yt, e = 1<<BI_F2;
+ var i = r.t, j = i-ys, t = (q==null)?nbi():q;
+ y.dlShiftTo(j,t);
+
+ var r_array = r.array;
+ if(r.compareTo(t) >= 0) {
+ r_array[r.t++] = 1;
+ r.subTo(t,r);
+ }
+ BigInteger.ONE.dlShiftTo(ys,t);
+ t.subTo(y,y); // "negative" y so we can replace sub with am later
+ while(y.t < ys) y_array[y.t++] = 0;
+ while(--j >= 0) {
+ // Estimate quotient digit
+ var qd = (r_array[--i]==y0)?BI_DM:Math.floor(r_array[i]*d1+(r_array[i-1]+e)*d2);
+ if((r_array[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out
+ y.dlShiftTo(j,t);
+ r.subTo(t,r);
+ while(r_array[i] < --qd) r.subTo(t,r);
+ }
+ }
+ if(q != null) {
+ r.drShiftTo(ys,q);
+ if(ts != ms) BigInteger.ZERO.subTo(q,q);
+ }
+ r.t = ys;
+ r.clamp();
+ if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder
+ if(ts < 0) BigInteger.ZERO.subTo(r,r);
+}
+
+// (public) this mod a
+function bnMod(a) {
+ var r = nbi();
+ this.abs().divRemTo(a,null,r);
+ if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
+ return r;
+}
+
+// Modular reduction using "classic" algorithm
+function Classic(m) { this.m = m; }
+function cConvert(x) {
+ if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
+ else return x;
+}
+function cRevert(x) { return x; }
+function cReduce(x) { x.divRemTo(this.m,null,x); }
+function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
+
+Classic.prototype.convert = cConvert;
+Classic.prototype.revert = cRevert;
+Classic.prototype.reduce = cReduce;
+Classic.prototype.mulTo = cMulTo;
+Classic.prototype.sqrTo = cSqrTo;
+
+// (protected) return "-1/this % 2^DB"; useful for Mont. reduction
+// justification:
+// xy == 1 (mod m)
+// xy = 1+km
+// xy(2-xy) = (1+km)(1-km)
+// x[y(2-xy)] = 1-k^2m^2
+// x[y(2-xy)] == 1 (mod m^2)
+// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
+// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
+// JS multiply "overflows" differently from C/C++, so care is needed here.
+function bnpInvDigit() {
+ var this_array = this.array;
+ if(this.t < 1) return 0;
+ var x = this_array[0];
+ if((x&1) == 0) return 0;
+ var y = x&3; // y == 1/x mod 2^2
+ y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4
+ y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8
+ y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16
+ // last step - calculate inverse mod DV directly;
+ // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
+ y = (y*(2-x*y%BI_DV))%BI_DV; // y == 1/x mod 2^dbits
+ // we really want the negative inverse, and -DV < y < DV
+ return (y>0)?BI_DV-y:-y;
+}
+
+// Montgomery reduction
+function Montgomery(m) {
+ this.m = m;
+ this.mp = m.invDigit();
+ this.mpl = this.mp&0x7fff;
+ this.mph = this.mp>>15;
+ this.um = (1<<(BI_DB-15))-1;
+ this.mt2 = 2*m.t;
+}
+
+// xR mod m
+function montConvert(x) {
+ var r = nbi();
+ x.abs().dlShiftTo(this.m.t,r);
+ r.divRemTo(this.m,null,r);
+ if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
+ return r;
+}
+
+// x/R mod m
+function montRevert(x) {
+ var r = nbi();
+ x.copyTo(r);
+ this.reduce(r);
+ return r;
+}
+
+// x = x/R mod m (HAC 14.32)
+function montReduce(x) {
+ var x_array = x.array;
+ while(x.t <= this.mt2) // pad x so am has enough room later
+ x_array[x.t++] = 0;
+ for(var i = 0; i < this.m.t; ++i) {
+ // faster way of calculating u0 = x[i]*mp mod DV
+ var j = x_array[i]&0x7fff;
+ var u0 = (j*this.mpl+(((j*this.mph+(x_array[i]>>15)*this.mpl)&this.um)<<15))&BI_DM;
+ // use am to combine the multiply-shift-add into one call
+ j = i+this.m.t;
+ x_array[j] += this.m.am(0,u0,x,i,0,this.m.t);
+ // propagate carry
+ while(x_array[j] >= BI_DV) { x_array[j] -= BI_DV; x_array[++j]++; }
+ }
+ x.clamp();
+ x.drShiftTo(this.m.t,x);
+ if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
+}
+
+// r = "x^2/R mod m"; x != r
+function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
+
+// r = "xy/R mod m"; x,y != r
+function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+
+Montgomery.prototype.convert = montConvert;
+Montgomery.prototype.revert = montRevert;
+Montgomery.prototype.reduce = montReduce;
+Montgomery.prototype.mulTo = montMulTo;
+Montgomery.prototype.sqrTo = montSqrTo;
+
+// (protected) true iff this is even
+function bnpIsEven() {
+ var this_array = this.array;
+ return ((this.t>0)?(this_array[0]&1):this.s) == 0;
+}
+
+// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
+function bnpExp(e,z) {
+ if(e > 0xffffffff || e < 1) return BigInteger.ONE;
+ var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
+ g.copyTo(r);
+ while(--i >= 0) {
+ z.sqrTo(r,r2);
+ if((e&(1<<i)) > 0) z.mulTo(r2,g,r);
+ else { var t = r; r = r2; r2 = t; }
+ }
+ return z.revert(r);
+}
+
+// (public) this^e % m, 0 <= e < 2^32
+function bnModPowInt(e,m) {
+ var z;
+ if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
+ return this.exp(e,z);
+}
+
+// protected
+BigInteger.prototype.copyTo = bnpCopyTo;
+BigInteger.prototype.fromInt = bnpFromInt;
+BigInteger.prototype.fromString = bnpFromString;
+BigInteger.prototype.clamp = bnpClamp;
+BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
+BigInteger.prototype.drShiftTo = bnpDRShiftTo;
+BigInteger.prototype.lShiftTo = bnpLShiftTo;
+BigInteger.prototype.rShiftTo = bnpRShiftTo;
+BigInteger.prototype.subTo = bnpSubTo;
+BigInteger.prototype.multiplyTo = bnpMultiplyTo;
+BigInteger.prototype.squareTo = bnpSquareTo;
+BigInteger.prototype.divRemTo = bnpDivRemTo;
+BigInteger.prototype.invDigit = bnpInvDigit;
+BigInteger.prototype.isEven = bnpIsEven;
+BigInteger.prototype.exp = bnpExp;
+
+// public
+BigInteger.prototype.toString = bnToString;
+BigInteger.prototype.negate = bnNegate;
+BigInteger.prototype.abs = bnAbs;
+BigInteger.prototype.compareTo = bnCompareTo;
+BigInteger.prototype.bitLength = bnBitLength;
+BigInteger.prototype.mod = bnMod;
+BigInteger.prototype.modPowInt = bnModPowInt;
+
+// "constants"
+BigInteger.ZERO = nbv(0);
+BigInteger.ONE = nbv(1);
+// Copyright (c) 2005 Tom Wu
+// All Rights Reserved.
+// See "LICENSE" for details.
+
+// Extended JavaScript BN functions, required for RSA private ops.
+
+// (public)
+function bnClone() { var r = nbi(); this.copyTo(r); return r; }
+
+// (public) return value as integer
+function bnIntValue() {
+ var this_array = this.array;
+ if(this.s < 0) {
+ if(this.t == 1) return this_array[0]-BI_DV;
+ else if(this.t == 0) return -1;
+ }
+ else if(this.t == 1) return this_array[0];
+ else if(this.t == 0) return 0;
+ // assumes 16 < DB < 32
+ return ((this_array[1]&((1<<(32-BI_DB))-1))<<BI_DB)|this_array[0];
+}
+
+// (public) return value as byte
+function bnByteValue() {
+ var this_array = this.array;
+ return (this.t==0)?this.s:(this_array[0]<<24)>>24;
+}
+
+// (public) return value as short (assumes DB>=16)
+function bnShortValue() {
+ var this_array = this.array;
+ return (this.t==0)?this.s:(this_array[0]<<16)>>16;
+}
+
+// (protected) return x s.t. r^x < DV
+function bnpChunkSize(r) { return Math.floor(Math.LN2*BI_DB/Math.log(r)); }
+
+// (public) 0 if this == 0, 1 if this > 0
+function bnSigNum() {
+ var this_array = this.array;
+ if(this.s < 0) return -1;
+ else if(this.t <= 0 || (this.t == 1 && this_array[0] <= 0)) return 0;
+ else return 1;
+}
+
+// (protected) convert to radix string
+function bnpToRadix(b) {
+ if(b == null) b = 10;
+ if(this.signum() == 0 || b < 2 || b > 36) return "0";
+ var cs = this.chunkSize(b);
+ var a = Math.pow(b,cs);
+ var d = nbv(a), y = nbi(), z = nbi(), r = "";
+ this.divRemTo(d,y,z);
+ while(y.signum() > 0) {
+ r = (a+z.intValue()).toString(b).substr(1) + r;
+ y.divRemTo(d,y,z);
+ }
+ return z.intValue().toString(b) + r;
+}
+
+// (protected) convert from radix string
+function bnpFromRadix(s,b) {
+ this.fromInt(0);
+ if(b == null) b = 10;
+ var cs = this.chunkSize(b);
+ var d = Math.pow(b,cs), mi = false, j = 0, w = 0;
+ for(var i = 0; i < s.length; ++i) {
+ var x = intAt(s,i);
+ if(x < 0) {
+ if(s.charAt(i) == "-" && this.signum() == 0) mi = true;
+ continue;
+ }
+ w = b*w+x;
+ if(++j >= cs) {
+ this.dMultiply(d);
+ this.dAddOffset(w,0);
+ j = 0;
+ w = 0;
+ }
+ }
+ if(j > 0) {
+ this.dMultiply(Math.pow(b,j));
+ this.dAddOffset(w,0);
+ }
+ if(mi) BigInteger.ZERO.subTo(this,this);
+}
+
+// (protected) alternate constructor
+function bnpFromNumber(a,b,c) {
+ if("number" == typeof b) {
+ // new BigInteger(int,int,RNG)
+ if(a < 2) this.fromInt(1);
+ else {
+ this.fromNumber(a,c);
+ if(!this.testBit(a-1)) // force MSB set
+ this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);
+ if(this.isEven()) this.dAddOffset(1,0); // force odd
+ while(!this.isProbablePrime(b)) {
+ this.dAddOffset(2,0);
+ if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);
+ }
+ }
+ }
+ else {
+ // new BigInteger(int,RNG)
+ var x = new Array(), t = a&7;
+ x.length = (a>>3)+1;
+ b.nextBytes(x);
+ if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0;
+ this.fromString(x,256);
+ }
+}
+
+// (public) convert to bigendian byte array
+function bnToByteArray() {
+ var this_array = this.array;
+ var i = this.t, r = new Array();
+ r[0] = this.s;
+ var p = BI_DB-(i*BI_DB)%8, d, k = 0;
+ if(i-- > 0) {
+ if(p < BI_DB && (d = this_array[i]>>p) != (this.s&BI_DM)>>p)
+ r[k++] = d|(this.s<<(BI_DB-p));
+ while(i >= 0) {
+ if(p < 8) {
+ d = (this_array[i]&((1<<p)-1))<<(8-p);
+ d |= this_array[--i]>>(p+=BI_DB-8);
+ }
+ else {
+ d = (this_array[i]>>(p-=8))&0xff;
+ if(p <= 0) { p += BI_DB; --i; }
+ }
+ if((d&0x80) != 0) d |= -256;
+ if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;
+ if(k > 0 || d != this.s) r[k++] = d;
+ }
+ }
+ return r;
+}
+
+function bnEquals(a) { return(this.compareTo(a)==0); }
+function bnMin(a) { return(this.compareTo(a)<0)?this:a; }
+function bnMax(a) { return(this.compareTo(a)>0)?this:a; }
+
+// (protected) r = this op a (bitwise)
+function bnpBitwiseTo(a,op,r) {
+ var this_array = this.array;
+ var a_array = a.array;
+ var r_array = r.array;
+ var i, f, m = Math.min(a.t,this.t);
+ for(i = 0; i < m; ++i) r_array[i] = op(this_array[i],a_array[i]);
+ if(a.t < this.t) {
+ f = a.s&BI_DM;
+ for(i = m; i < this.t; ++i) r_array[i] = op(this_array[i],f);
+ r.t = this.t;
+ }
+ else {
+ f = this.s&BI_DM;
+ for(i = m; i < a.t; ++i) r_array[i] = op(f,a_array[i]);
+ r.t = a.t;
+ }
+ r.s = op(this.s,a.s);
+ r.clamp();
+}
+
+// (public) this & a
+function op_and(x,y) { return x&y; }
+function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }
+
+// (public) this | a
+function op_or(x,y) { return x|y; }
+function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }
+
+// (public) this ^ a
+function op_xor(x,y) { return x^y; }
+function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }
+
+// (public) this & ~a
+function op_andnot(x,y) { return x&~y; }
+function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }
+
+// (public) ~this
+function bnNot() {
+ var this_array = this.array;
+ var r = nbi();
+ var r_array = r.array;
+
+ for(var i = 0; i < this.t; ++i) r_array[i] = BI_DM&~this_array[i];
+ r.t = this.t;
+ r.s = ~this.s;
+ return r;
+}
+
+// (public) this << n
+function bnShiftLeft(n) {
+ var r = nbi();
+ if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);
+ return r;
+}
+
+// (public) this >> n
+function bnShiftRight(n) {
+ var r = nbi();
+ if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);
+ return r;
+}
+
+// return index of lowest 1-bit in x, x < 2^31
+function lbit(x) {
+ if(x == 0) return -1;
+ var r = 0;
+ if((x&0xffff) == 0) { x >>= 16; r += 16; }
+ if((x&0xff) == 0) { x >>= 8; r += 8; }
+ if((x&0xf) == 0) { x >>= 4; r += 4; }
+ if((x&3) == 0) { x >>= 2; r += 2; }
+ if((x&1) == 0) ++r;
+ return r;
+}
+
+// (public) returns index of lowest 1-bit (or -1 if none)
+function bnGetLowestSetBit() {
+ var this_array = this.array;
+ for(var i = 0; i < this.t; ++i)
+ if(this_array[i] != 0) return i*BI_DB+lbit(this_array[i]);
+ if(this.s < 0) return this.t*BI_DB;
+ return -1;
+}
+
+// return number of 1 bits in x
+function cbit(x) {
+ var r = 0;
+ while(x != 0) { x &= x-1; ++r; }
+ return r;
+}
+
+// (public) return number of set bits
+function bnBitCount() {
+ var r = 0, x = this.s&BI_DM;
+ for(var i = 0; i < this.t; ++i) r += cbit(this_array[i]^x);
+ return r;
+}
+
+// (public) true iff nth bit is set
+function bnTestBit(n) {
+ var this_array = this.array;
+ var j = Math.floor(n/BI_DB);
+ if(j >= this.t) return(this.s!=0);
+ return((this_array[j]&(1<<(n%BI_DB)))!=0);
+}
+
+// (protected) this op (1<<n)
+function bnpChangeBit(n,op) {
+ var r = BigInteger.ONE.shiftLeft(n);
+ this.bitwiseTo(r,op,r);
+ return r;
+}
+
+// (public) this | (1<<n)
+function bnSetBit(n) { return this.changeBit(n,op_or); }
+
+// (public) this & ~(1<<n)
+function bnClearBit(n) { return this.changeBit(n,op_andnot); }
+
+// (public) this ^ (1<<n)
+function bnFlipBit(n) { return this.changeBit(n,op_xor); }
+
+// (protected) r = this + a
+function bnpAddTo(a,r) {
+ var this_array = this.array;
+ var a_array = a.array;
+ var r_array = r.array;
+ var i = 0, c = 0, m = Math.min(a.t,this.t);
+ while(i < m) {
+ c += this_array[i]+a_array[i];
+ r_array[i++] = c&BI_DM;
+ c >>= BI_DB;
+ }
+ if(a.t < this.t) {
+ c += a.s;
+ while(i < this.t) {
+ c += this_array[i];
+ r_array[i++] = c&BI_DM;
+ c >>= BI_DB;
+ }
+ c += this.s;
+ }
+ else {
+ c += this.s;
+ while(i < a.t) {
+ c += a_array[i];
+ r_array[i++] = c&BI_DM;
+ c >>= BI_DB;
+ }
+ c += a.s;
+ }
+ r.s = (c<0)?-1:0;
+ if(c > 0) r_array[i++] = c;
+ else if(c < -1) r_array[i++] = BI_DV+c;
+ r.t = i;
+ r.clamp();
+}
+
+// (public) this + a
+function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }
+
+// (public) this - a
+function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }
+
+// (public) this * a
+function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }
+
+// (public) this / a
+function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }
+
+// (public) this % a
+function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }
+
+// (public) [this/a,this%a]
+function bnDivideAndRemainder(a) {
+ var q = nbi(), r = nbi();
+ this.divRemTo(a,q,r);
+ return new Array(q,r);
+}
+
+// (protected) this *= n, this >= 0, 1 < n < DV
+function bnpDMultiply(n) {
+ var this_array = this.array;
+ this_array[this.t] = this.am(0,n-1,this,0,0,this.t);
+ ++this.t;
+ this.clamp();
+}
+
+// (protected) this += n << w words, this >= 0
+function bnpDAddOffset(n,w) {
+ var this_array = this.array;
+ while(this.t <= w) this_array[this.t++] = 0;
+ this_array[w] += n;
+ while(this_array[w] >= BI_DV) {
+ this_array[w] -= BI_DV;
+ if(++w >= this.t) this_array[this.t++] = 0;
+ ++this_array[w];
+ }
+}
+
+// A "null" reducer
+function NullExp() {}
+function nNop(x) { return x; }
+function nMulTo(x,y,r) { x.multiplyTo(y,r); }
+function nSqrTo(x,r) { x.squareTo(r); }
+
+NullExp.prototype.convert = nNop;
+NullExp.prototype.revert = nNop;
+NullExp.prototype.mulTo = nMulTo;
+NullExp.prototype.sqrTo = nSqrTo;
+
+// (public) this^e
+function bnPow(e) { return this.exp(e,new NullExp()); }
+
+// (protected) r = lower n words of "this * a", a.t <= n
+// "this" should be the larger one if appropriate.
+function bnpMultiplyLowerTo(a,n,r) {
+ var r_array = r.array;
+ var a_array = a.array;
+ var i = Math.min(this.t+a.t,n);
+ r.s = 0; // assumes a,this >= 0
+ r.t = i;
+ while(i > 0) r_array[--i] = 0;
+ var j;
+ for(j = r.t-this.t; i < j; ++i) r_array[i+this.t] = this.am(0,a_array[i],r,i,0,this.t);
+ for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a_array[i],r,i,0,n-i);
+ r.clamp();
+}
+
+// (protected) r = "this * a" without lower n words, n > 0
+// "this" should be the larger one if appropriate.
+function bnpMultiplyUpperTo(a,n,r) {
+ var r_array = r.array;
+ var a_array = a.array;
+ --n;
+ var i = r.t = this.t+a.t-n;
+ r.s = 0; // assumes a,this >= 0
+ while(--i >= 0) r_array[i] = 0;
+ for(i = Math.max(n-this.t,0); i < a.t; ++i)
+ r_array[this.t+i-n] = this.am(n-i,a_array[i],r,0,0,this.t+i-n);
+ r.clamp();
+ r.drShiftTo(1,r);
+}
+
+// Barrett modular reduction
+function Barrett(m) {
+ // setup Barrett
+ this.r2 = nbi();
+ this.q3 = nbi();
+ BigInteger.ONE.dlShiftTo(2*m.t,this.r2);
+ this.mu = this.r2.divide(m);
+ this.m = m;
+}
+
+function barrettConvert(x) {
+ if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);
+ else if(x.compareTo(this.m) < 0) return x;
+ else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }
+}
+
+function barrettRevert(x) { return x; }
+
+// x = x mod m (HAC 14.42)
+function barrettReduce(x) {
+ x.drShiftTo(this.m.t-1,this.r2);
+ if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }
+ this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);
+ this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);
+ while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);
+ x.subTo(this.r2,x);
+ while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
+}
+
+// r = x^2 mod m; x != r
+function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
+
+// r = x*y mod m; x,y != r
+function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+
+Barrett.prototype.convert = barrettConvert;
+Barrett.prototype.revert = barrettRevert;
+Barrett.prototype.reduce = barrettReduce;
+Barrett.prototype.mulTo = barrettMulTo;
+Barrett.prototype.sqrTo = barrettSqrTo;
+
+// (public) this^e % m (HAC 14.85)
+function bnModPow(e,m) {
+ var e_array = e.array;
+ var i = e.bitLength(), k, r = nbv(1), z;
+ if(i <= 0) return r;
+ else if(i < 18) k = 1;
+ else if(i < 48) k = 3;
+ else if(i < 144) k = 4;
+ else if(i < 768) k = 5;
+ else k = 6;
+ if(i < 8)
+ z = new Classic(m);
+ else if(m.isEven())
+ z = new Barrett(m);
+ else
+ z = new Montgomery(m);
+
+ // precomputation
+ var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;
+ g[1] = z.convert(this);
+ if(k > 1) {
+ var g2 = nbi();
+ z.sqrTo(g[1],g2);
+ while(n <= km) {
+ g[n] = nbi();
+ z.mulTo(g2,g[n-2],g[n]);
+ n += 2;
+ }
+ }
+
+ var j = e.t-1, w, is1 = true, r2 = nbi(), t;
+ i = nbits(e_array[j])-1;
+ while(j >= 0) {
+ if(i >= k1) w = (e_array[j]>>(i-k1))&km;
+ else {
+ w = (e_array[j]&((1<<(i+1))-1))<<(k1-i);
+ if(j > 0) w |= e_array[j-1]>>(BI_DB+i-k1);
+ }
+
+ n = k;
+ while((w&1) == 0) { w >>= 1; --n; }
+ if((i -= n) < 0) { i += BI_DB; --j; }
+ if(is1) { // ret == 1, don't bother squaring or multiplying it
+ g[w].copyTo(r);
+ is1 = false;
+ }
+ else {
+ while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }
+ if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }
+ z.mulTo(r2,g[w],r);
+ }
+
+ while(j >= 0 && (e_array[j]&(1<<i)) == 0) {
+ z.sqrTo(r,r2); t = r; r = r2; r2 = t;
+ if(--i < 0) { i = BI_DB-1; --j; }
+ }
+ }
+ return z.revert(r);
+}
+
+// (public) gcd(this,a) (HAC 14.54)
+function bnGCD(a) {
+ var x = (this.s<0)?this.negate():this.clone();
+ var y = (a.s<0)?a.negate():a.clone();
+ if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }
+ var i = x.getLowestSetBit(), g = y.getLowestSetBit();
+ if(g < 0) return x;
+ if(i < g) g = i;
+ if(g > 0) {
+ x.rShiftTo(g,x);
+ y.rShiftTo(g,y);
+ }
+ while(x.signum() > 0) {
+ if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);
+ if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);
+ if(x.compareTo(y) >= 0) {
+ x.subTo(y,x);
+ x.rShiftTo(1,x);
+ }
+ else {
+ y.subTo(x,y);
+ y.rShiftTo(1,y);
+ }
+ }
+ if(g > 0) y.lShiftTo(g,y);
+ return y;
+}
+
+// (protected) this % n, n < 2^26
+function bnpModInt(n) {
+ var this_array = this.array;
+ if(n <= 0) return 0;
+ var d = BI_DV%n, r = (this.s<0)?n-1:0;
+ if(this.t > 0)
+ if(d == 0) r = this_array[0]%n;
+ else for(var i = this.t-1; i >= 0; --i) r = (d*r+this_array[i])%n;
+ return r;
+}
+
+// (public) 1/this % m (HAC 14.61)
+function bnModInverse(m) {
+ var ac = m.isEven();
+ if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
+ var u = m.clone(), v = this.clone();
+ var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);
+ while(u.signum() != 0) {
+ while(u.isEven()) {
+ u.rShiftTo(1,u);
+ if(ac) {
+ if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }
+ a.rShiftTo(1,a);
+ }
+ else if(!b.isEven()) b.subTo(m,b);
+ b.rShiftTo(1,b);
+ }
+ while(v.isEven()) {
+ v.rShiftTo(1,v);
+ if(ac) {
+ if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }
+ c.rShiftTo(1,c);
+ }
+ else if(!d.isEven()) d.subTo(m,d);
+ d.rShiftTo(1,d);
+ }
+ if(u.compareTo(v) >= 0) {
+ u.subTo(v,u);
+ if(ac) a.subTo(c,a);
+ b.subTo(d,b);
+ }
+ else {
+ v.subTo(u,v);
+ if(ac) c.subTo(a,c);
+ d.subTo(b,d);
+ }
+ }
+ if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;
+ if(d.compareTo(m) >= 0) return d.subtract(m);
+ if(d.signum() < 0) d.addTo(m,d); else return d;
+ if(d.signum() < 0) return d.add(m); else return d;
+}
+
+var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509];
+var lplim = (1<<26)/lowprimes[lowprimes.length-1];
+
+// (public) test primality with certainty >= 1-.5^t
+function bnIsProbablePrime(t) {
+ var i, x = this.abs();
+ var x_array = x.array;
+ if(x.t == 1 && x_array[0] <= lowprimes[lowprimes.length-1]) {
+ for(i = 0; i < lowprimes.length; ++i)
+ if(x_array[0] == lowprimes[i]) return true;
+ return false;
+ }
+ if(x.isEven()) return false;
+ i = 1;
+ while(i < lowprimes.length) {
+ var m = lowprimes[i], j = i+1;
+ while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];
+ m = x.modInt(m);
+ while(i < j) if(m%lowprimes[i++] == 0) return false;
+ }
+ return x.millerRabin(t);
+}
+
+// (protected) true if probably prime (HAC 4.24, Miller-Rabin)
+function bnpMillerRabin(t) {
+ var n1 = this.subtract(BigInteger.ONE);
+ var k = n1.getLowestSetBit();
+ if(k <= 0) return false;
+ var r = n1.shiftRight(k);
+ t = (t+1)>>1;
+ if(t > lowprimes.length) t = lowprimes.length;
+ var a = nbi();
+ for(var i = 0; i < t; ++i) {
+ a.fromInt(lowprimes[i]);
+ var y = a.modPow(r,this);
+ if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
+ var j = 1;
+ while(j++ < k && y.compareTo(n1) != 0) {
+ y = y.modPowInt(2,this);
+ if(y.compareTo(BigInteger.ONE) == 0) return false;
+ }
+ if(y.compareTo(n1) != 0) return false;
+ }
+ }
+ return true;
+}
+
+// protected
+BigInteger.prototype.chunkSize = bnpChunkSize;
+BigInteger.prototype.toRadix = bnpToRadix;
+BigInteger.prototype.fromRadix = bnpFromRadix;
+BigInteger.prototype.fromNumber = bnpFromNumber;
+BigInteger.prototype.bitwiseTo = bnpBitwiseTo;
+BigInteger.prototype.changeBit = bnpChangeBit;
+BigInteger.prototype.addTo = bnpAddTo;
+BigInteger.prototype.dMultiply = bnpDMultiply;
+BigInteger.prototype.dAddOffset = bnpDAddOffset;
+BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;
+BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;
+BigInteger.prototype.modInt = bnpModInt;
+BigInteger.prototype.millerRabin = bnpMillerRabin;
+
+// public
+BigInteger.prototype.clone = bnClone;
+BigInteger.prototype.intValue = bnIntValue;
+BigInteger.prototype.byteValue = bnByteValue;
+BigInteger.prototype.shortValue = bnShortValue;
+BigInteger.prototype.signum = bnSigNum;
+BigInteger.prototype.toByteArray = bnToByteArray;
+BigInteger.prototype.equals = bnEquals;
+BigInteger.prototype.min = bnMin;
+BigInteger.prototype.max = bnMax;
+BigInteger.prototype.and = bnAnd;
+BigInteger.prototype.or = bnOr;
+BigInteger.prototype.xor = bnXor;
+BigInteger.prototype.andNot = bnAndNot;
+BigInteger.prototype.not = bnNot;
+BigInteger.prototype.shiftLeft = bnShiftLeft;
+BigInteger.prototype.shiftRight = bnShiftRight;
+BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;
+BigInteger.prototype.bitCount = bnBitCount;
+BigInteger.prototype.testBit = bnTestBit;
+BigInteger.prototype.setBit = bnSetBit;
+BigInteger.prototype.clearBit = bnClearBit;
+BigInteger.prototype.flipBit = bnFlipBit;
+BigInteger.prototype.add = bnAdd;
+BigInteger.prototype.subtract = bnSubtract;
+BigInteger.prototype.multiply = bnMultiply;
+BigInteger.prototype.divide = bnDivide;
+BigInteger.prototype.remainder = bnRemainder;
+BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;
+BigInteger.prototype.modPow = bnModPow;
+BigInteger.prototype.modInverse = bnModInverse;
+BigInteger.prototype.pow = bnPow;
+BigInteger.prototype.gcd = bnGCD;
+BigInteger.prototype.isProbablePrime = bnIsProbablePrime;
+
+// BigInteger interfaces not implemented in jsbn:
+
+// BigInteger(int signum, byte[] magnitude)
+// double doubleValue()
+// float floatValue()
+// int hashCode()
+// long longValue()
+// static BigInteger valueOf(long val)
+// prng4.js - uses Arcfour as a PRNG
+
+function Arcfour() {
+ this.i = 0;
+ this.j = 0;
+ this.S = new Array();
+}
+
+// Initialize arcfour context from key, an array of ints, each from [0..255]
+function ARC4init(key) {
+ var i, j, t;
+ for(i = 0; i < 256; ++i)
+ this.S[i] = i;
+ j = 0;
+ for(i = 0; i < 256; ++i) {
+ j = (j + this.S[i] + key[i % key.length]) & 255;
+ t = this.S[i];
+ this.S[i] = this.S[j];
+ this.S[j] = t;
+ }
+ this.i = 0;
+ this.j = 0;
+}
+
+function ARC4next() {
+ var t;
+ this.i = (this.i + 1) & 255;
+ this.j = (this.j + this.S[this.i]) & 255;
+ t = this.S[this.i];
+ this.S[this.i] = this.S[this.j];
+ this.S[this.j] = t;
+ return this.S[(t + this.S[this.i]) & 255];
+}
+
+Arcfour.prototype.init = ARC4init;
+Arcfour.prototype.next = ARC4next;
+
+// Plug in your RNG constructor here
+function prng_newstate() {
+ return new Arcfour();
+}
+
+// Pool size must be a multiple of 4 and greater than 32.
+// An array of bytes the size of the pool will be passed to init()
+var rng_psize = 256;
+// Random number generator - requires a PRNG backend, e.g. prng4.js
+
+// For best results, put code like
+// <body onClick='rng_seed_time();' onKeyPress='rng_seed_time();'>
+// in your main HTML document.
+
+var rng_state;
+var rng_pool;
+var rng_pptr;
+
+// Mix in a 32-bit integer into the pool
+function rng_seed_int(x) {
+ rng_pool[rng_pptr++] ^= x & 255;
+ rng_pool[rng_pptr++] ^= (x >> 8) & 255;
+ rng_pool[rng_pptr++] ^= (x >> 16) & 255;
+ rng_pool[rng_pptr++] ^= (x >> 24) & 255;
+ if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;
+}
+
+// Mix in the current time (w/milliseconds) into the pool
+function rng_seed_time() {
+ rng_seed_int(new Date().getTime());
+}
+
+// Initialize the pool with junk if needed.
+if(rng_pool == null) {
+ rng_pool = new Array();
+ rng_pptr = 0;
+ var t;
+ while(rng_pptr < rng_psize) { // extract some randomness from Math.random()
+ t = Math.floor(65536 * Math.random());
+ rng_pool[rng_pptr++] = t >>> 8;
+ rng_pool[rng_pptr++] = t & 255;
+ }
+ rng_pptr = 0;
+ rng_seed_time();
+ //rng_seed_int(window.screenX);
+ //rng_seed_int(window.screenY);
+}
+
+function rng_get_byte() {
+ if(rng_state == null) {
+ rng_seed_time();
+ rng_state = prng_newstate();
+ rng_state.init(rng_pool);
+ for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
+ rng_pool[rng_pptr] = 0;
+ rng_pptr = 0;
+ //rng_pool = null;
+ }
+ // TODO: allow reseeding after first request
+ return rng_state.next();
+}
+
+function rng_get_bytes(ba) {
+ var i;
+ for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();
+}
+
+function SecureRandom() {}
+
+SecureRandom.prototype.nextBytes = rng_get_bytes;
+// Depends on jsbn.js and rng.js
+
+// convert a (hex) string to a bignum object
+function parseBigInt(str,r) {
+ return new BigInteger(str,r);
+}
+
+function linebrk(s,n) {
+ var ret = "";
+ var i = 0;
+ while(i + n < s.length) {
+ ret += s.substring(i,i+n) + "\n";
+ i += n;
+ }
+ return ret + s.substring(i,s.length);
+}
+
+function byte2Hex(b) {
+ if(b < 0x10)
+ return "0" + b.toString(16);
+ else
+ return b.toString(16);
+}
+
+// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint
+function pkcs1pad2(s,n) {
+ if(n < s.length + 11) {
+ alert("Message too long for RSA");
+ return null;
+ }
+ var ba = new Array();
+ var i = s.length - 1;
+ while(i >= 0 && n > 0) ba[--n] = s.charCodeAt(i--);
+ ba[--n] = 0;
+ var rng = new SecureRandom();
+ var x = new Array();
+ while(n > 2) { // random non-zero pad
+ x[0] = 0;
+ while(x[0] == 0) rng.nextBytes(x);
+ ba[--n] = x[0];
+ }
+ ba[--n] = 2;
+ ba[--n] = 0;
+ return new BigInteger(ba);
+}
+
+// "empty" RSA key constructor
+function RSAKey() {
+ this.n = null;
+ this.e = 0;
+ this.d = null;
+ this.p = null;
+ this.q = null;
+ this.dmp1 = null;
+ this.dmq1 = null;
+ this.coeff = null;
+}
+
+// Set the public key fields N and e from hex strings
+function RSASetPublic(N,E) {
+ if(N != null && E != null && N.length > 0 && E.length > 0) {
+ this.n = parseBigInt(N,16);
+ this.e = parseInt(E,16);
+ }
+ else
+ alert("Invalid RSA public key");
+}
+
+// Perform raw public operation on "x": return x^e (mod n)
+function RSADoPublic(x) {
+ return x.modPowInt(this.e, this.n);
+}
+
+// Return the PKCS#1 RSA encryption of "text" as an even-length hex string
+function RSAEncrypt(text) {
+ var m = pkcs1pad2(text,(this.n.bitLength()+7)>>3);
+ if(m == null) return null;
+ var c = this.doPublic(m);
+ if(c == null) return null;
+ var h = c.toString(16);
+ if((h.length & 1) == 0) return h; else return "0" + h;
+}
+
+// Return the PKCS#1 RSA encryption of "text" as a Base64-encoded string
+//function RSAEncryptB64(text) {
+// var h = this.encrypt(text);
+// if(h) return hex2b64(h); else return null;
+//}
+
+// protected
+RSAKey.prototype.doPublic = RSADoPublic;
+
+// public
+RSAKey.prototype.setPublic = RSASetPublic;
+RSAKey.prototype.encrypt = RSAEncrypt;
+//RSAKey.prototype.encrypt_b64 = RSAEncryptB64;
+// Depends on rsa.js and jsbn2.js
+
+// Undo PKCS#1 (type 2, random) padding and, if valid, return the plaintext
+function pkcs1unpad2(d,n) {
+ var b = d.toByteArray();
+ var i = 0;
+ while(i < b.length && b[i] == 0) ++i;
+ if(b.length-i != n-1 || b[i] != 2)
+ return null;
+ ++i;
+ while(b[i] != 0)
+ if(++i >= b.length) return null;
+ var ret = "";
+ while(++i < b.length)
+ ret += String.fromCharCode(b[i]);
+ return ret;
+}
+
+// Set the private key fields N, e, and d from hex strings
+function RSASetPrivate(N,E,D) {
+ if(N != null && E != null && N.length > 0 && E.length > 0) {
+ this.n = parseBigInt(N,16);
+ this.e = parseInt(E,16);
+ this.d = parseBigInt(D,16);
+ }
+ else
+ alert("Invalid RSA private key");
+}
+
+// Set the private key fields N, e, d and CRT params from hex strings
+function RSASetPrivateEx(N,E,D,P,Q,DP,DQ,C) {
+ if(N != null && E != null && N.length > 0 && E.length > 0) {
+ this.n = parseBigInt(N,16);
+ this.e = parseInt(E,16);
+ this.d = parseBigInt(D,16);
+ this.p = parseBigInt(P,16);
+ this.q = parseBigInt(Q,16);
+ this.dmp1 = parseBigInt(DP,16);
+ this.dmq1 = parseBigInt(DQ,16);
+ this.coeff = parseBigInt(C,16);
+ }
+ else
+ alert("Invalid RSA private key");
+}
+
+// Generate a new random private key B bits long, using public expt E
+function RSAGenerate(B,E) {
+ var rng = new SecureRandom();
+ var qs = B>>1;
+ this.e = parseInt(E,16);
+ var ee = new BigInteger(E,16);
+ for(;;) {
+ for(;;) {
+ this.p = new BigInteger(B-qs,1,rng);
+ if(this.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.p.isProbablePrime(10)) break;
+ }
+ for(;;) {
+ this.q = new BigInteger(qs,1,rng);
+ if(this.q.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.q.isProbablePrime(10)) break;
+ }
+ if(this.p.compareTo(this.q) <= 0) {
+ var t = this.p;
+ this.p = this.q;
+ this.q = t;
+ }
+ var p1 = this.p.subtract(BigInteger.ONE);
+ var q1 = this.q.subtract(BigInteger.ONE);
+ var phi = p1.multiply(q1);
+ if(phi.gcd(ee).compareTo(BigInteger.ONE) == 0) {
+ this.n = this.p.multiply(this.q);
+ this.d = ee.modInverse(phi);
+ this.dmp1 = this.d.mod(p1);
+ this.dmq1 = this.d.mod(q1);
+ this.coeff = this.q.modInverse(this.p);
+ break;
+ }
+ }
+}
+
+// Perform raw private operation on "x": return x^d (mod n)
+function RSADoPrivate(x) {
+ if(this.p == null || this.q == null)
+ return x.modPow(this.d, this.n);
+
+ // TODO: re-calculate any missing CRT params
+ var xp = x.mod(this.p).modPow(this.dmp1, this.p);
+ var xq = x.mod(this.q).modPow(this.dmq1, this.q);
+
+ while(xp.compareTo(xq) < 0)
+ xp = xp.add(this.p);
+ return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);
+}
+
+// Return the PKCS#1 RSA decryption of "ctext".
+// "ctext" is an even-length hex string and the output is a plain string.
+function RSADecrypt(ctext) {
+ var c = parseBigInt(ctext, 16);
+ var m = this.doPrivate(c);
+ if(m == null) return null;
+ return pkcs1unpad2(m, (this.n.bitLength()+7)>>3);
+}
+
+// Return the PKCS#1 RSA decryption of "ctext".
+// "ctext" is a Base64-encoded string and the output is a plain string.
+//function RSAB64Decrypt(ctext) {
+// var h = b64tohex(ctext);
+// if(h) return this.decrypt(h); else return null;
+//}
+
+// protected
+RSAKey.prototype.doPrivate = RSADoPrivate;
+
+// public
+RSAKey.prototype.setPrivate = RSASetPrivate;
+RSAKey.prototype.setPrivateEx = RSASetPrivateEx;
+RSAKey.prototype.generate = RSAGenerate;
+RSAKey.prototype.decrypt = RSADecrypt;
+//RSAKey.prototype.b64_decrypt = RSAB64Decrypt;
+
+
+nValue="a5261939975948bb7a58dffe5ff54e65f0498f9175f5a09288810b8975871e99af3b5dd94057b0fc07535f5f97444504fa35169d461d0d30cf0192e307727c065168c788771c561a9400fb49175e9e6aa4e23fe11af69e9412dd23b0cb6684c4c2429bce139e848ab26d0829073351f4acd36074eafd036a5eb83359d2a698d3";
+eValue="10001";
+dValue="8e9912f6d3645894e8d38cb58c0db81ff516cf4c7e5a14c7f1eddb1459d2cded4d8d293fc97aee6aefb861859c8b6a3d1dfe710463e1f9ddc72048c09751971c4a580aa51eb523357a3cc48d31cfad1d4a165066ed92d4748fb6571211da5cb14bc11b6e2df7c1a559e6d5ac1cd5c94703a22891464fba23d0d965086277a161";
+pValue="d090ce58a92c75233a6486cb0a9209bf3583b64f540c76f5294bb97d285eed33aec220bde14b2417951178ac152ceab6da7090905b478195498b352048f15e7d";
+qValue="cab575dc652bb66df15a0359609d51d1db184750c00c6698b90ef3465c99655103edbf0d54c56aec0ce3c4d22592338092a126a0cc49f65a4a30d222b411e58f";
+dmp1Value="1a24bca8e273df2f0e47c199bbf678604e7df7215480c77c8db39f49b000ce2cf7500038acfff5433b7d582a01f1826e6f4d42e1c57f5e1fef7b12aabc59fd25";
+dmq1Value="3d06982efbbe47339e1f6d36b1216b8a741d410b0c662f54f7118b27b9a4ec9d914337eb39841d8666f3034408cf94f5b62f11c402fc994fe15a05493150d9fd";
+coeffValue="3a3e731acd8960b7ff9eb81a7ff93bd1cfa74cbd56987db58b4594fb09c09084db1734c8143f98b602b981aaa9243ca28deb69b5b280ee8dcee0fd2625e53250";
+
+setupEngine(am3, 28);
+
+var RSA = new RSAKey();
+var TEXT = "The quick brown fox jumped over the extremely lazy frogs!";
+
+RSA.setPublic(nValue, eValue);
+RSA.setPrivateEx(nValue, eValue, dValue, pValue, qValue, dmp1Value, dmq1Value, coeffValue);
+
+function encrypt() {
+ return RSA.encrypt(TEXT);
+}
+
+function decrypt() {
+ return RSA.decrypt(TEXT);
+}
+// Copyright 2008 Google Inc. All Rights Reserved.
+// Copyright 1996 John Maloney and Mario Wolczko.
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+// This implementation of the DeltaBlue benchmark is derived
+// from the Smalltalk implementation by John Maloney and Mario
+// Wolczko. Some parts have been translated directly, whereas
+// others have been modified more aggresively to make it feel
+// more like a JavaScript program.
+
+
+var DeltaBlue = new BenchmarkSuite('DeltaBlue', 71104, [
+ new Benchmark('DeltaBlue', deltaBlue)
+]);
+
+
+/**
+ * A JavaScript implementation of the DeltaBlue constrain-solving
+ * algorithm, as described in:
+ *
+ * "The DeltaBlue Algorithm: An Incremental Constraint Hierarchy Solver"
+ * Bjorn N. Freeman-Benson and John Maloney
+ * January 1990 Communications of the ACM,
+ * also available as University of Washington TR 89-08-06.
+ *
+ * Beware: this benchmark is written in a grotesque style where
+ * the constraint model is built by side-effects from constructors.
+ * I've kept it this way to avoid deviating too much from the original
+ * implementation.
+ */
+
+
+/* --- O b j e c t M o d e l --- */
+
+Object.prototype.inherits = function (shuper) {
+ function Inheriter() { }
+ Inheriter.prototype = shuper.prototype;
+ this.prototype = new Inheriter();
+ this.superConstructor = shuper;
+}
+
+function OrderedCollection() {
+ this.elms = new Array();
+}
+
+OrderedCollection.prototype.add = function (elm) {
+ this.elms.push(elm);
+}
+
+OrderedCollection.prototype.at = function (index) {
+ return this.elms[index];
+}
+
+OrderedCollection.prototype.size = function () {
+ return this.elms.length;
+}
+
+OrderedCollection.prototype.removeFirst = function () {
+ return this.elms.pop();
+}
+
+OrderedCollection.prototype.remove = function (elm) {
+ var index = 0, skipped = 0;
+ for (var i = 0; i < this.elms.length; i++) {
+ var value = this.elms[i];
+ if (value != elm) {
+ this.elms[index] = value;
+ index++;
+ } else {
+ skipped++;
+ }
+ }
+ for (var i = 0; i < skipped; i++)
+ this.elms.pop();
+}
+
+/* --- *
+ * S t r e n g t h
+ * --- */
+
+/**
+ * Strengths are used to measure the relative importance of constraints.
+ * New strengths may be inserted in the strength hierarchy without
+ * disrupting current constraints. Strengths cannot be created outside
+ * this class, so pointer comparison can be used for value comparison.
+ */
+function Strength(strengthValue, name) {
+ this.strengthValue = strengthValue;
+ this.name = name;
+}
+
+Strength.stronger = function (s1, s2) {
+ return s1.strengthValue < s2.strengthValue;
+}
+
+Strength.weaker = function (s1, s2) {
+ return s1.strengthValue > s2.strengthValue;
+}
+
+Strength.weakestOf = function (s1, s2) {
+ return this.weaker(s1, s2) ? s1 : s2;
+}
+
+Strength.strongest = function (s1, s2) {
+ return this.stronger(s1, s2) ? s1 : s2;
+}
+
+Strength.prototype.nextWeaker = function () {
+ switch (this.strengthValue) {
+ case 0: return Strength.WEAKEST;
+ case 1: return Strength.WEAK_DEFAULT;
+ case 2: return Strength.NORMAL;
+ case 3: return Strength.STRONG_DEFAULT;
+ case 4: return Strength.PREFERRED;
+ case 5: return Strength.REQUIRED;
+ }
+}
+
+// Strength constants.
+Strength.REQUIRED = new Strength(0, "required");
+Strength.STONG_PREFERRED = new Strength(1, "strongPreferred");
+Strength.PREFERRED = new Strength(2, "preferred");
+Strength.STRONG_DEFAULT = new Strength(3, "strongDefault");
+Strength.NORMAL = new Strength(4, "normal");
+Strength.WEAK_DEFAULT = new Strength(5, "weakDefault");
+Strength.WEAKEST = new Strength(6, "weakest");
+
+/* --- *
+ * C o n s t r a i n t
+ * --- */
+
+/**
+ * An abstract class representing a system-maintainable relationship
+ * (or "constraint") between a set of variables. A constraint supplies
+ * a strength instance variable; concrete subclasses provide a means
+ * of storing the constrained variables and other information required
+ * to represent a constraint.
+ */
+function Constraint(strength) {
+ this.strength = strength;
+}
+
+/**
+ * Activate this constraint and attempt to satisfy it.
+ */
+Constraint.prototype.addConstraint = function () {
+ this.addToGraph();
+ planner.incrementalAdd(this);
+}
+
+/**
+ * Attempt to find a way to enforce this constraint. If successful,
+ * record the solution, perhaps modifying the current dataflow
+ * graph. Answer the constraint that this constraint overrides, if
+ * there is one, or nil, if there isn't.
+ * Assume: I am not already satisfied.
+ */
+Constraint.prototype.satisfy = function (mark) {
+ this.chooseMethod(mark);
+ if (!this.isSatisfied()) {
+ if (this.strength == Strength.REQUIRED)
+ alert("Could not satisfy a required constraint!");
+ return null;
+ }
+ this.markInputs(mark);
+ var out = this.output();
+ var overridden = out.determinedBy;
+ if (overridden != null) overridden.markUnsatisfied();
+ out.determinedBy = this;
+ if (!planner.addPropagate(this, mark))
+ alert("Cycle encountered");
+ out.mark = mark;
+ return overridden;
+}
+
+Constraint.prototype.destroyConstraint = function () {
+ if (this.isSatisfied()) planner.incrementalRemove(this);
+ else this.removeFromGraph();
+}
+
+/**
+ * Normal constraints are not input constraints. An input constraint
+ * is one that depends on external state, such as the mouse, the
+ * keybord, a clock, or some arbitraty piece of imperative code.
+ */
+Constraint.prototype.isInput = function () {
+ return false;
+}
+
+/* --- *
+ * U n a r y C o n s t r a i n t
+ * --- */
+
+/**
+ * Abstract superclass for constraints having a single possible output
+ * variable.
+ */
+function UnaryConstraint(v, strength) {
+ UnaryConstraint.superConstructor.call(this, strength);
+ this.myOutput = v;
+ this.satisfied = false;
+ this.addConstraint();
+}
+
+UnaryConstraint.inherits(Constraint);
+
+/**
+ * Adds this constraint to the constraint graph
+ */
+UnaryConstraint.prototype.addToGraph = function () {
+ this.myOutput.addConstraint(this);
+ this.satisfied = false;
+}
+
+/**
+ * Decides if this constraint can be satisfied and records that
+ * decision.
+ */
+UnaryConstraint.prototype.chooseMethod = function (mark) {
+ this.satisfied = (this.myOutput.mark != mark)
+ && Strength.stronger(this.strength, this.myOutput.walkStrength);
+}
+
+/**
+ * Returns true if this constraint is satisfied in the current solution.
+ */
+UnaryConstraint.prototype.isSatisfied = function () {
+ return this.satisfied;
+}
+
+UnaryConstraint.prototype.markInputs = function (mark) {
+ // has no inputs
+}
+
+/**
+ * Returns the current output variable.
+ */
+UnaryConstraint.prototype.output = function () {
+ return this.myOutput;
+}
+
+/**
+ * Calculate the walkabout strength, the stay flag, and, if it is
+ * 'stay', the value for the current output of this constraint. Assume
+ * this constraint is satisfied.
+ */
+UnaryConstraint.prototype.recalculate = function () {
+ this.myOutput.walkStrength = this.strength;
+ this.myOutput.stay = !this.isInput();
+ if (this.myOutput.stay) this.execute(); // Stay optimization
+}
+
+/**
+ * Records that this constraint is unsatisfied
+ */
+UnaryConstraint.prototype.markUnsatisfied = function () {
+ this.satisfied = false;
+}
+
+UnaryConstraint.prototype.inputsKnown = function () {
+ return true;
+}
+
+UnaryConstraint.prototype.removeFromGraph = function () {
+ if (this.myOutput != null) this.myOutput.removeConstraint(this);
+ this.satisfied = false;
+}
+
+/* --- *
+ * S t a y C o n s t r a i n t
+ * --- */
+
+/**
+ * Variables that should, with some level of preference, stay the same.
+ * Planners may exploit the fact that instances, if satisfied, will not
+ * change their output during plan execution. This is called "stay
+ * optimization".
+ */
+function StayConstraint(v, str) {
+ StayConstraint.superConstructor.call(this, v, str);
+}
+
+StayConstraint.inherits(UnaryConstraint);
+
+StayConstraint.prototype.execute = function () {
+ // Stay constraints do nothing
+}
+
+/* --- *
+ * E d i t C o n s t r a i n t
+ * --- */
+
+/**
+ * A unary input constraint used to mark a variable that the client
+ * wishes to change.
+ */
+function EditConstraint(v, str) {
+ EditConstraint.superConstructor.call(this, v, str);
+}
+
+EditConstraint.inherits(UnaryConstraint);
+
+/**
+ * Edits indicate that a variable is to be changed by imperative code.
+ */
+EditConstraint.prototype.isInput = function () {
+ return true;
+}
+
+EditConstraint.prototype.execute = function () {
+ // Edit constraints do nothing
+}
+
+/* --- *
+ * B i n a r y C o n s t r a i n t
+ * --- */
+
+var Direction = new Object();
+Direction.NONE = 0;
+Direction.FORWARD = 1;
+Direction.BACKWARD = -1;
+
+/**
+ * Abstract superclass for constraints having two possible output
+ * variables.
+ */
+function BinaryConstraint(var1, var2, strength) {
+ BinaryConstraint.superConstructor.call(this, strength);
+ this.v1 = var1;
+ this.v2 = var2;
+ this.direction = Direction.NONE;
+ this.addConstraint();
+}
+
+BinaryConstraint.inherits(Constraint);
+
+/**
+ * Decides if this constratint can be satisfied and which way it
+ * should flow based on the relative strength of the variables related,
+ * and record that decision.
+ */
+BinaryConstraint.prototype.chooseMethod = function (mark) {
+ if (this.v1.mark == mark) {
+ this.direction = (this.v1.mark != mark && Strength.stronger(this.strength, this.v2.walkStrength))
+ ? Direction.FORWARD
+ : Direction.NONE;
+ }
+ if (this.v2.mark == mark) {
+ this.direction = (this.v1.mark != mark && Strength.stronger(this.strength, this.v1.walkStrength))
+ ? Direction.BACKWARD
+ : Direction.NONE;
+ }
+ if (Strength.weaker(this.v1.walkStrength, this.v2.walkStrength)) {
+ this.direction = Strength.stronger(this.strength, this.v1.walkStrength)
+ ? Direction.BACKWARD
+ : Direction.NONE;
+ } else {
+ this.direction = Strength.stronger(this.strength, this.v2.walkStrength)
+ ? Direction.FORWARD
+ : Direction.BACKWARD
+ }
+}
+
+/**
+ * Add this constraint to the constraint graph
+ */
+BinaryConstraint.prototype.addToGraph = function () {
+ this.v1.addConstraint(this);
+ this.v2.addConstraint(this);
+ this.direction = Direction.NONE;
+}
+
+/**
+ * Answer true if this constraint is satisfied in the current solution.
+ */
+BinaryConstraint.prototype.isSatisfied = function () {
+ return this.direction != Direction.NONE;
+}
+
+/**
+ * Mark the input variable with the given mark.
+ */
+BinaryConstraint.prototype.markInputs = function (mark) {
+ this.input().mark = mark;
+}
+
+/**
+ * Returns the current input variable
+ */
+BinaryConstraint.prototype.input = function () {
+ return (this.direction == Direction.FORWARD) ? this.v1 : this.v2;
+}
+
+/**
+ * Returns the current output variable
+ */
+BinaryConstraint.prototype.output = function () {
+ return (this.direction == Direction.FORWARD) ? this.v2 : this.v1;
+}
+
+/**
+ * Calculate the walkabout strength, the stay flag, and, if it is
+ * 'stay', the value for the current output of this
+ * constraint. Assume this constraint is satisfied.
+ */
+BinaryConstraint.prototype.recalculate = function () {
+ var ihn = this.input(), out = this.output();
+ out.walkStrength = Strength.weakestOf(this.strength, ihn.walkStrength);
+ out.stay = ihn.stay;
+ if (out.stay) this.execute();
+}
+
+/**
+ * Record the fact that this constraint is unsatisfied.
+ */
+BinaryConstraint.prototype.markUnsatisfied = function () {
+ this.direction = Direction.NONE;
+}
+
+BinaryConstraint.prototype.inputsKnown = function (mark) {
+ var i = this.input();
+ return i.mark == mark || i.stay || i.determinedBy == null;
+}
+
+BinaryConstraint.prototype.removeFromGraph = function () {
+ if (this.v1 != null) this.v1.removeConstraint(this);
+ if (this.v2 != null) this.v2.removeConstraint(this);
+ this.direction = Direction.NONE;
+}
+
+/* --- *
+ * S c a l e C o n s t r a i n t
+ * --- */
+
+/**
+ * Relates two variables by the linear scaling relationship: "v2 =
+ * (v1 * scale) + offset". Either v1 or v2 may be changed to maintain
+ * this relationship but the scale factor and offset are considered
+ * read-only.
+ */
+function ScaleConstraint(src, scale, offset, dest, strength) {
+ this.direction = Direction.NONE;
+ this.scale = scale;
+ this.offset = offset;
+ ScaleConstraint.superConstructor.call(this, src, dest, strength);
+}
+
+ScaleConstraint.inherits(BinaryConstraint);
+
+/**
+ * Adds this constraint to the constraint graph.
+ */
+ScaleConstraint.prototype.addToGraph = function () {
+ ScaleConstraint.superConstructor.prototype.addToGraph.call(this);
+ this.scale.addConstraint(this);
+ this.offset.addConstraint(this);
+}
+
+ScaleConstraint.prototype.removeFromGraph = function () {
+ ScaleConstraint.superConstructor.prototype.removeFromGraph.call(this);
+ if (this.scale != null) this.scale.removeConstraint(this);
+ if (this.offset != null) this.offset.removeConstraint(this);
+}
+
+ScaleConstraint.prototype.markInputs = function (mark) {
+ ScaleConstraint.superConstructor.prototype.markInputs.call(this, mark);
+ this.scale.mark = this.offset.mark = mark;
+}
+
+/**
+ * Enforce this constraint. Assume that it is satisfied.
+ */
+ScaleConstraint.prototype.execute = function () {
+ if (this.direction == Direction.FORWARD) {
+ this.v2.value = this.v1.value * this.scale.value + this.offset.value;
+ } else {
+ this.v1.value = (this.v2.value - this.offset.value) / this.scale.value;
+ }
+}
+
+/**
+ * Calculate the walkabout strength, the stay flag, and, if it is
+ * 'stay', the value for the current output of this constraint. Assume
+ * this constraint is satisfied.
+ */
+ScaleConstraint.prototype.recalculate = function () {
+ var ihn = this.input(), out = this.output();
+ out.walkStrength = Strength.weakestOf(this.strength, ihn.walkStrength);
+ out.stay = ihn.stay && this.scale.stay && this.offset.stay;
+ if (out.stay) this.execute();
+}
+
+/* --- *
+ * E q u a l i t y C o n s t r a i n t
+ * --- */
+
+/**
+ * Constrains two variables to have the same value.
+ */
+function EqualityConstraint(var1, var2, strength) {
+ EqualityConstraint.superConstructor.call(this, var1, var2, strength);
+}
+
+EqualityConstraint.inherits(BinaryConstraint);
+
+/**
+ * Enforce this constraint. Assume that it is satisfied.
+ */
+EqualityConstraint.prototype.execute = function () {
+ this.output().value = this.input().value;
+}
+
+/* --- *
+ * V a r i a b l e
+ * --- */
+
+/**
+ * A constrained variable. In addition to its value, it maintain the
+ * structure of the constraint graph, the current dataflow graph, and
+ * various parameters of interest to the DeltaBlue incremental
+ * constraint solver.
+ **/
+function Variable(name, initialValue) {
+ this.value = initialValue || 0;
+ this.constraints = new OrderedCollection();
+ this.determinedBy = null;
+ this.mark = 0;
+ this.walkStrength = Strength.WEAKEST;
+ this.stay = true;
+ this.name = name;
+}
+
+/**
+ * Add the given constraint to the set of all constraints that refer
+ * this variable.
+ */
+Variable.prototype.addConstraint = function (c) {
+ this.constraints.add(c);
+}
+
+/**
+ * Removes all traces of c from this variable.
+ */
+Variable.prototype.removeConstraint = function (c) {
+ this.constraints.remove(c);
+ if (this.determinedBy == c) this.determinedBy = null;
+}
+
+/* --- *
+ * P l a n n e r
+ * --- */
+
+/**
+ * The DeltaBlue planner
+ */
+function Planner() {
+ this.currentMark = 0;
+}
+
+/**
+ * Attempt to satisfy the given constraint and, if successful,
+ * incrementally update the dataflow graph. Details: If satifying
+ * the constraint is successful, it may override a weaker constraint
+ * on its output. The algorithm attempts to resatisfy that
+ * constraint using some other method. This process is repeated
+ * until either a) it reaches a variable that was not previously
+ * determined by any constraint or b) it reaches a constraint that
+ * is too weak to be satisfied using any of its methods. The
+ * variables of constraints that have been processed are marked with
+ * a unique mark value so that we know where we've been. This allows
+ * the algorithm to avoid getting into an infinite loop even if the
+ * constraint graph has an inadvertent cycle.
+ */
+Planner.prototype.incrementalAdd = function (c) {
+ var mark = this.newMark();
+ var overridden = c.satisfy(mark);
+ while (overridden != null)
+ overridden = overridden.satisfy(mark);
+}
+
+/**
+ * Entry point for retracting a constraint. Remove the given
+ * constraint and incrementally update the dataflow graph.
+ * Details: Retracting the given constraint may allow some currently
+ * unsatisfiable downstream constraint to be satisfied. We therefore collect
+ * a list of unsatisfied downstream constraints and attempt to
+ * satisfy each one in turn. This list is traversed by constraint
+ * strength, strongest first, as a heuristic for avoiding
+ * unnecessarily adding and then overriding weak constraints.
+ * Assume: c is satisfied.
+ */
+Planner.prototype.incrementalRemove = function (c) {
+ var out = c.output();
+ c.markUnsatisfied();
+ c.removeFromGraph();
+ var unsatisfied = this.removePropagateFrom(out);
+ var strength = Strength.REQUIRED;
+ do {
+ for (var i = 0; i < unsatisfied.size(); i++) {
+ var u = unsatisfied.at(i);
+ if (u.strength == strength)
+ this.incrementalAdd(u);
+ }
+ strength = strength.nextWeaker();
+ } while (strength != Strength.WEAKEST);
+}
+
+/**
+ * Select a previously unused mark value.
+ */
+Planner.prototype.newMark = function () {
+ return ++this.currentMark;
+}
+
+/**
+ * Extract a plan for resatisfaction starting from the given source
+ * constraints, usually a set of input constraints. This method
+ * assumes that stay optimization is desired; the plan will contain
+ * only constraints whose output variables are not stay. Constraints
+ * that do no computation, such as stay and edit constraints, are
+ * not included in the plan.
+ * Details: The outputs of a constraint are marked when it is added
+ * to the plan under construction. A constraint may be appended to
+ * the plan when all its input variables are known. A variable is
+ * known if either a) the variable is marked (indicating that has
+ * been computed by a constraint appearing earlier in the plan), b)
+ * the variable is 'stay' (i.e. it is a constant at plan execution
+ * time), or c) the variable is not determined by any
+ * constraint. The last provision is for past states of history
+ * variables, which are not stay but which are also not computed by
+ * any constraint.
+ * Assume: sources are all satisfied.
+ */
+Planner.prototype.makePlan = function (sources) {
+ var mark = this.newMark();
+ var plan = new Plan();
+ var todo = sources;
+ while (todo.size() > 0) {
+ var c = todo.removeFirst();
+ if (c.output().mark != mark && c.inputsKnown(mark)) {
+ plan.addConstraint(c);
+ c.output().mark = mark;
+ this.addConstraintsConsumingTo(c.output(), todo);
+ }
+ }
+ return plan;
+}
+
+/**
+ * Extract a plan for resatisfying starting from the output of the
+ * given constraints, usually a set of input constraints.
+ */
+Planner.prototype.extractPlanFromConstraints = function (constraints) {
+ var sources = new OrderedCollection();
+ for (var i = 0; i < constraints.size(); i++) {
+ var c = constraints.at(i);
+ if (c.isInput() && c.isSatisfied())
+ // not in plan already and eligible for inclusion
+ sources.add(c);
+ }
+ return this.makePlan(sources);
+}
+
+/**
+ * Recompute the walkabout strengths and stay flags of all variables
+ * downstream of the given constraint and recompute the actual
+ * values of all variables whose stay flag is true. If a cycle is
+ * detected, remove the given constraint and answer
+ * false. Otherwise, answer true.
+ * Details: Cycles are detected when a marked variable is
+ * encountered downstream of the given constraint. The sender is
+ * assumed to have marked the inputs of the given constraint with
+ * the given mark. Thus, encountering a marked node downstream of
+ * the output constraint means that there is a path from the
+ * constraint's output to one of its inputs.
+ */
+Planner.prototype.addPropagate = function (c, mark) {
+ var todo = new OrderedCollection();
+ todo.add(c);
+ while (todo.size() > 0) {
+ var d = todo.removeFirst();
+ if (d.output().mark == mark) {
+ this.incrementalRemove(c);
+ return false;
+ }
+ d.recalculate();
+ this.addConstraintsConsumingTo(d.output(), todo);
+ }
+ return true;
+}
+
+
+/**
+ * Update the walkabout strengths and stay flags of all variables
+ * downstream of the given constraint. Answer a collection of
+ * unsatisfied constraints sorted in order of decreasing strength.
+ */
+Planner.prototype.removePropagateFrom = function (out) {
+ out.determinedBy = null;
+ out.walkStrength = Strength.WEAKEST;
+ out.stay = true;
+ var unsatisfied = new OrderedCollection();
+ var todo = new OrderedCollection();
+ todo.add(out);
+ while (todo.size() > 0) {
+ var v = todo.removeFirst();
+ for (var i = 0; i < v.constraints.size(); i++) {
+ var c = v.constraints.at(i);
+ if (!c.isSatisfied())
+ unsatisfied.add(c);
+ }
+ var determining = v.determinedBy;
+ for (var i = 0; i < v.constraints.size(); i++) {
+ var next = v.constraints.at(i);
+ if (next != determining && next.isSatisfied()) {
+ next.recalculate();
+ todo.add(next.output());
+ }
+ }
+ }
+ return unsatisfied;
+}
+
+Planner.prototype.addConstraintsConsumingTo = function (v, coll) {
+ var determining = v.determinedBy;
+ var cc = v.constraints;
+ for (var i = 0; i < cc.size(); i++) {
+ var c = cc.at(i);
+ if (c != determining && c.isSatisfied())
+ coll.add(c);
+ }
+}
+
+/* --- *
+ * P l a n
+ * --- */
+
+/**
+ * A Plan is an ordered list of constraints to be executed in sequence
+ * to resatisfy all currently satisfiable constraints in the face of
+ * one or more changing inputs.
+ */
+function Plan() {
+ this.v = new OrderedCollection();
+}
+
+Plan.prototype.addConstraint = function (c) {
+ this.v.add(c);
+}
+
+Plan.prototype.size = function () {
+ return this.v.size();
+}
+
+Plan.prototype.constraintAt = function (index) {
+ return this.v.at(index);
+}
+
+Plan.prototype.execute = function () {
+ for (var i = 0; i < this.size(); i++) {
+ var c = this.constraintAt(i);
+ c.execute();
+ }
+}
+
+/* --- *
+ * M a i n
+ * --- */
+
+/**
+ * This is the standard DeltaBlue benchmark. A long chain of equality
+ * constraints is constructed with a stay constraint on one end. An
+ * edit constraint is then added to the opposite end and the time is
+ * measured for adding and removing this constraint, and extracting
+ * and executing a constraint satisfaction plan. There are two cases.
+ * In case 1, the added constraint is stronger than the stay
+ * constraint and values must propagate down the entire length of the
+ * chain. In case 2, the added constraint is weaker than the stay
+ * constraint so it cannot be accomodated. The cost in this case is,
+ * of course, very low. Typical situations lie somewhere between these
+ * two extremes.
+ */
+function chainTest(n) {
+ planner = new Planner();
+ var prev = null, first = null, last = null;
+
+ // Build chain of n equality constraints
+ for (var i = 0; i <= n; i++) {
+ var name = "v" + i;
+ var v = new Variable(name);
+ if (prev != null)
+ new EqualityConstraint(prev, v, Strength.REQUIRED);
+ if (i == 0) first = v;
+ if (i == n) last = v;
+ prev = v;
+ }
+
+ new StayConstraint(last, Strength.STRONG_DEFAULT);
+ var edit = new EditConstraint(first, Strength.PREFERRED);
+ var edits = new OrderedCollection();
+ edits.add(edit);
+ var plan = planner.extractPlanFromConstraints(edits);
+ for (var i = 0; i < 100; i++) {
+ first.value = i;
+ plan.execute();
+ if (last.value != i)
+ alert("Chain test failed.");
+ }
+}
+
+/**
+ * This test constructs a two sets of variables related to each
+ * other by a simple linear transformation (scale and offset). The
+ * time is measured to change a variable on either side of the
+ * mapping and to change the scale and offset factors.
+ */
+function projectionTest(n) {
+ planner = new Planner();
+ var scale = new Variable("scale", 10);
+ var offset = new Variable("offset", 1000);
+ var src = null, dst = null;
+
+ var dests = new OrderedCollection();
+ for (var i = 0; i < n; i++) {
+ src = new Variable("src" + i, i);
+ dst = new Variable("dst" + i, i);
+ dests.add(dst);
+ new StayConstraint(src, Strength.NORMAL);
+ new ScaleConstraint(src, scale, offset, dst, Strength.REQUIRED);
+ }
+
+ change(src, 17);
+ if (dst.value != 1170) alert("Projection 1 failed");
+ change(dst, 1050);
+ if (src.value != 5) alert("Projection 2 failed");
+ change(scale, 5);
+ for (var i = 0; i < n - 1; i++) {
+ if (dests.at(i).value != i * 5 + 1000)
+ alert("Projection 3 failed");
+ }
+ change(offset, 2000);
+ for (var i = 0; i < n - 1; i++) {
+ if (dests.at(i).value != i * 5 + 2000)
+ alert("Projection 4 failed");
+ }
+}
+
+function change(v, newValue) {
+ var edit = new EditConstraint(v, Strength.PREFERRED);
+ var edits = new OrderedCollection();
+ edits.add(edit);
+ var plan = planner.extractPlanFromConstraints(edits);
+ for (var i = 0; i < 10; i++) {
+ v.value = newValue;
+ plan.execute();
+ }
+ edit.destroyConstraint();
+}
+
+// Global variable holding the current planner.
+var planner = null;
+
+function deltaBlue() {
+ chainTest(100);
+ projectionTest(100);
+}
+// This file is automatically generated by scheme2js, except for the
+// benchmark harness code at the beginning and end of the file.
+
+var EarleyBoyer = new BenchmarkSuite('EarleyBoyer', 765819, [
+ new Benchmark("Earley", function () { BgL_earleyzd2benchmarkzd2(); }),
+ new Benchmark("Boyer", function () { BgL_nboyerzd2benchmarkzd2(); })
+]);
+
+
+/************* GENERATED FILE - DO NOT EDIT *************/
+/************* GENERATED FILE - DO NOT EDIT *************/
+/************* GENERATED FILE - DO NOT EDIT *************/
+/************* GENERATED FILE - DO NOT EDIT *************/
+/************* GENERATED FILE - DO NOT EDIT *************/
+/************* GENERATED FILE - DO NOT EDIT *************/
+/************* GENERATED FILE - DO NOT EDIT *************/
+/************* GENERATED FILE - DO NOT EDIT *************/
+/*
+ * To use write/prints/... the default-output port has to be set first.
+ * Simply setting SC_DEFAULT_OUT and SC_ERROR_OUT to the desired values
+ * should do the trick.
+ * In the following example the std-out and error-port are redirected to
+ * a DIV.
+function initRuntime() {
+ function escapeHTML(s) {
+ var tmp = s;
+ tmp = tmp.replace(/&/g, "&amp;");
+ tmp = tmp.replace(/</g, "&lt;");
+ tmp = tmp.replace(/>/g, "&gt;");
+ tmp = tmp.replace(/ /g, "&nbsp;");
+ tmp = tmp.replace(/\n/g, "<br />");
+ tmp = tmp.replace(/\t/g, "&nbsp;&nbsp;&nbsp;&nbsp");
+ return tmp;
+
+ }
+
+ document.write("<div id='stdout'></div>");
+ SC_DEFAULT_OUT = new sc_GenericOutputPort(
+ function(s) {
+ var stdout = document.getElementById('stdout');
+ stdout.innerHTML = stdout.innerHTML + escapeHTML(s);
+ });
+ SC_ERROR_OUT = SC_DEFAULT_OUT;
+}
+*/
+
+
+function sc_print_debug() {
+ sc_print.apply(null, arguments);
+}
+/*** META ((export *js*)) */
+var sc_JS_GLOBALS = this;
+
+var __sc_LINE=-1;
+var __sc_FILE="";
+
+/*** META ((export #t)) */
+function sc_alert() {
+ var len = arguments.length;
+ var s = "";
+ var i;
+
+ for( i = 0; i < len; i++ ) {
+ s += sc_toDisplayString(arguments[ i ]);
+ }
+
+ return alert( s );
+}
+
+/*** META ((export #t)) */
+function sc_typeof( x ) {
+ return typeof x;
+}
+
+/*** META ((export #t)) */
+function sc_error() {
+ var a = [sc_jsstring2symbol("*error*")];
+ for (var i = 0; i < arguments.length; i++) {
+ a[i+1] = arguments[i];
+ }
+ throw a;
+}
+
+/*** META ((export #t)
+ (peephole (prefix "throw ")))
+*/
+function sc_raise(obj) {
+ throw obj;
+}
+
+/*** META ((export with-handler-lambda)) */
+function sc_withHandlerLambda(handler, body) {
+ try {
+ return body();
+ } catch(e) {
+ if (!e._internalException)
+ return handler(e);
+ else
+ throw e;
+ }
+}
+
+var sc_properties = new Object();
+
+/*** META ((export #t)) */
+function sc_putpropBang(sym, key, val) {
+ var ht = sc_properties[sym];
+ if (!ht) {
+ ht = new Object();
+ sc_properties[sym] = ht;
+ }
+ ht[key] = val;
+}
+
+/*** META ((export #t)) */
+function sc_getprop(sym, key) {
+ var ht = sc_properties[sym];
+ if (ht) {
+ if (key in ht)
+ return ht[key];
+ else
+ return false;
+ } else
+ return false;
+}
+
+/*** META ((export #t)) */
+function sc_rempropBang(sym, key) {
+ var ht = sc_properties[sym];
+ if (ht)
+ delete ht[key];
+}
+
+/*** META ((export #t)) */
+function sc_any2String(o) {
+ return jsstring2string(sc_toDisplayString(o));
+}
+
+/*** META ((export #t)
+ (peephole (infix 2 2 "==="))
+ (type bool))
+*/
+function sc_isEqv(o1, o2) {
+ return (o1 === o2);
+}
+
+/*** META ((export #t)
+ (peephole (infix 2 2 "==="))
+ (type bool))
+*/
+function sc_isEq(o1, o2) {
+ return (o1 === o2);
+}
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isNumber(n) {
+ return (typeof n === "number");
+}
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isComplex(n) {
+ return sc_isNumber(n);
+}
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isReal(n) {
+ return sc_isNumber(n);
+}
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isRational(n) {
+ return sc_isReal(n);
+}
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isInteger(n) {
+ return (parseInt(n) === n);
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix ", false")))
+*/
+// we don't have exact numbers...
+function sc_isExact(n) {
+ return false;
+}
+
+/*** META ((export #t)
+ (peephole (postfix ", true"))
+ (type bool))
+*/
+function sc_isInexact(n) {
+ return true;
+}
+
+/*** META ((export = =fx =fl)
+ (type bool)
+ (peephole (infix 2 2 "===")))
+*/
+function sc_equal(x) {
+ for (var i = 1; i < arguments.length; i++)
+ if (x !== arguments[i])
+ return false;
+ return true;
+}
+
+/*** META ((export < <fx <fl)
+ (type bool)
+ (peephole (infix 2 2 "<")))
+*/
+function sc_less(x) {
+ for (var i = 1; i < arguments.length; i++) {
+ if (x >= arguments[i])
+ return false;
+ x = arguments[i];
+ }
+ return true;
+}
+
+/*** META ((export > >fx >fl)
+ (type bool)
+ (peephole (infix 2 2 ">")))
+*/
+function sc_greater(x, y) {
+ for (var i = 1; i < arguments.length; i++) {
+ if (x <= arguments[i])
+ return false;
+ x = arguments[i];
+ }
+ return true;
+}
+
+/*** META ((export <= <=fx <=fl)
+ (type bool)
+ (peephole (infix 2 2 "<=")))
+*/
+function sc_lessEqual(x, y) {
+ for (var i = 1; i < arguments.length; i++) {
+ if (x > arguments[i])
+ return false;
+ x = arguments[i];
+ }
+ return true;
+}
+
+/*** META ((export >= >=fl >=fx)
+ (type bool)
+ (peephole (infix 2 2 ">=")))
+*/
+function sc_greaterEqual(x, y) {
+ for (var i = 1; i < arguments.length; i++) {
+ if (x < arguments[i])
+ return false;
+ x = arguments[i];
+ }
+ return true;
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix "=== 0")))
+*/
+function sc_isZero(x) {
+ return (x === 0);
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix "> 0")))
+*/
+function sc_isPositive(x) {
+ return (x > 0);
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix "< 0")))
+*/
+function sc_isNegative(x) {
+ return (x < 0);
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix "%2===1")))
+*/
+function sc_isOdd(x) {
+ return (x % 2 === 1);
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix "%2===0")))
+*/
+function sc_isEven(x) {
+ return (x % 2 === 0);
+}
+
+/*** META ((export #t)) */
+var sc_max = Math.max;
+/*** META ((export #t)) */
+var sc_min = Math.min;
+
+/*** META ((export + +fx +fl)
+ (peephole (infix 0 #f "+" "0")))
+*/
+function sc_plus() {
+ var sum = 0;
+ for (var i = 0; i < arguments.length; i++)
+ sum += arguments[i];
+ return sum;
+}
+
+/*** META ((export * *fx *fl)
+ (peephole (infix 0 #f "*" "1")))
+*/
+function sc_multi() {
+ var product = 1;
+ for (var i = 0; i < arguments.length; i++)
+ product *= arguments[i];
+ return product;
+}
+
+/*** META ((export - -fx -fl)
+ (peephole (minus)))
+*/
+function sc_minus(x) {
+ if (arguments.length === 1)
+ return -x;
+ else {
+ var res = x;
+ for (var i = 1; i < arguments.length; i++)
+ res -= arguments[i];
+ return res;
+ }
+}
+
+/*** META ((export / /fl)
+ (peephole (div)))
+*/
+function sc_div(x) {
+ if (arguments.length === 1)
+ return 1/x;
+ else {
+ var res = x;
+ for (var i = 1; i < arguments.length; i++)
+ res /= arguments[i];
+ return res;
+ }
+}
+
+/*** META ((export #t)) */
+var sc_abs = Math.abs;
+
+/*** META ((export quotient /fx)
+ (peephole (hole 2 "parseInt(" x "/" y ")")))
+*/
+function sc_quotient(x, y) {
+ return parseInt(x / y);
+}
+
+/*** META ((export #t)
+ (peephole (infix 2 2 "%")))
+*/
+function sc_remainder(x, y) {
+ return x % y;
+}
+
+/*** META ((export #t)
+ (peephole (modulo)))
+*/
+function sc_modulo(x, y) {
+ var remainder = x % y;
+ // if they don't have the same sign
+ if ((remainder * y) < 0)
+ return remainder + y;
+ else
+ return remainder;
+}
+
+function sc_euclid_gcd(a, b) {
+ var temp;
+ if (a === 0) return b;
+ if (b === 0) return a;
+ if (a < 0) {a = -a;};
+ if (b < 0) {b = -b;};
+ if (b > a) {temp = a; a = b; b = temp;};
+ while (true) {
+ a %= b;
+ if(a === 0) {return b;};
+ b %= a;
+ if(b === 0) {return a;};
+ };
+ return b;
+}
+
+/*** META ((export #t)) */
+function sc_gcd() {
+ var gcd = 0;
+ for (var i = 0; i < arguments.length; i++)
+ gcd = sc_euclid_gcd(gcd, arguments[i]);
+ return gcd;
+}
+
+/*** META ((export #t)) */
+function sc_lcm() {
+ var lcm = 1;
+ for (var i = 0; i < arguments.length; i++) {
+ var f = Math.round(arguments[i] / sc_euclid_gcd(arguments[i], lcm));
+ lcm *= Math.abs(f);
+ }
+ return lcm;
+}
+
+// LIMITATION: numerator and denominator don't make sense in floating point world.
+//var SC_MAX_DECIMALS = 1000000
+//
+// function sc_numerator(x) {
+// var rounded = Math.round(x * SC_MAX_DECIMALS);
+// return Math.round(rounded / sc_euclid_gcd(rounded, SC_MAX_DECIMALS));
+// }
+
+// function sc_denominator(x) {
+// var rounded = Math.round(x * SC_MAX_DECIMALS);
+// return Math.round(SC_MAX_DECIMALS / sc_euclid_gcd(rounded, SC_MAX_DECIMALS));
+// }
+
+/*** META ((export #t)) */
+var sc_floor = Math.floor;
+/*** META ((export #t)) */
+var sc_ceiling = Math.ceil;
+/*** META ((export #t)) */
+var sc_truncate = parseInt;
+/*** META ((export #t)) */
+var sc_round = Math.round;
+
+// LIMITATION: sc_rationalize doesn't make sense in a floating point world.
+
+/*** META ((export #t)) */
+var sc_exp = Math.exp;
+/*** META ((export #t)) */
+var sc_log = Math.log;
+/*** META ((export #t)) */
+var sc_sin = Math.sin;
+/*** META ((export #t)) */
+var sc_cos = Math.cos;
+/*** META ((export #t)) */
+var sc_tan = Math.tan;
+/*** META ((export #t)) */
+var sc_asin = Math.asin;
+/*** META ((export #t)) */
+var sc_acos = Math.acos;
+/*** META ((export #t)) */
+var sc_atan = Math.atan;
+
+/*** META ((export #t)) */
+var sc_sqrt = Math.sqrt;
+/*** META ((export #t)) */
+var sc_expt = Math.pow;
+
+// LIMITATION: we don't have complex numbers.
+// LIMITATION: the following functions are hence not implemented.
+// LIMITATION: make-rectangular, make-polar, real-part, imag-part, magnitude, angle
+// LIMITATION: 2 argument atan
+
+/*** META ((export #t)
+ (peephole (id)))
+*/
+function sc_exact2inexact(x) {
+ return x;
+}
+
+/*** META ((export #t)
+ (peephole (id)))
+*/
+function sc_inexact2exact(x) {
+ return x;
+}
+
+function sc_number2jsstring(x, radix) {
+ if (radix)
+ return x.toString(radix);
+ else
+ return x.toString();
+}
+
+function sc_jsstring2number(s, radix) {
+ if (s === "") return false;
+
+ if (radix) {
+ var t = parseInt(s, radix);
+ if (!t && t !== 0) return false;
+ // verify that each char is in range. (parseInt ignores leading
+ // white and trailing chars)
+ var allowedChars = "01234567890abcdefghijklmnopqrstuvwxyz".substring(0, radix+1);
+ if ((new RegExp("^["+allowedChars+"]*$", "i")).test(s))
+ return t;
+ else return false;
+ } else {
+ var t = +s; // does not ignore trailing chars.
+ if (!t && t !== 0) return false;
+ // simply verify that first char is not whitespace.
+ var c = s.charAt(0);
+ // if +c is 0, but the char is not "0", then we have a whitespace.
+ if (+c === 0 && c !== "0") return false;
+ return t;
+ }
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (not)))
+*/
+function sc_not(b) {
+ return b === false;
+}
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isBoolean(b) {
+ return (b === true) || (b === false);
+}
+
+function sc_Pair(car, cdr) {
+ this.car = car;
+ this.cdr = cdr;
+}
+
+sc_Pair.prototype.toString = function() {
+ return sc_toDisplayString(this);
+};
+sc_Pair.prototype.sc_toWriteOrDisplayString = function(writeOrDisplay) {
+ var current = this;
+
+ var res = "(";
+
+ while(true) {
+ res += writeOrDisplay(current.car);
+ if (sc_isPair(current.cdr)) {
+ res += " ";
+ current = current.cdr;
+ } else if (current.cdr !== null) {
+ res += " . " + writeOrDisplay(current.cdr);
+ break;
+ } else // current.cdr == null
+ break;
+ }
+
+ res += ")";
+
+ return res;
+};
+sc_Pair.prototype.sc_toDisplayString = function() {
+ return this.sc_toWriteOrDisplayString(sc_toDisplayString);
+};
+sc_Pair.prototype.sc_toWriteString = function() {
+ return this.sc_toWriteOrDisplayString(sc_toWriteString);
+};
+// sc_Pair.prototype.sc_toWriteCircleString in IO.js
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix " instanceof sc_Pair")))
+*/
+function sc_isPair(p) {
+ return (p instanceof sc_Pair);
+}
+
+function sc_isPairEqual(p1, p2, comp) {
+ return (comp(p1.car, p2.car) && comp(p1.cdr, p2.cdr));
+}
+
+/*** META ((export #t)
+ (peephole (hole 2 "new sc_Pair(" car ", " cdr ")")))
+*/
+function sc_cons(car, cdr) {
+ return new sc_Pair(car, cdr);
+}
+
+/*** META ((export cons*)) */
+function sc_consStar() {
+ var res = arguments[arguments.length - 1];
+ for (var i = arguments.length-2; i >= 0; i--)
+ res = new sc_Pair(arguments[i], res);
+ return res;
+}
+
+/*** META ((export #t)
+ (peephole (postfix ".car")))
+*/
+function sc_car(p) {
+ return p.car;
+}
+
+/*** META ((export #t)
+ (peephole (postfix ".cdr")))
+*/
+function sc_cdr(p) {
+ return p.cdr;
+}
+
+/*** META ((export #t)
+ (peephole (hole 2 p ".car = " val)))
+*/
+function sc_setCarBang(p, val) {
+ p.car = val;
+}
+
+/*** META ((export #t)
+ (peephole (hole 2 p ".cdr = " val)))
+*/
+function sc_setCdrBang(p, val) {
+ p.cdr = val;
+}
+
+/*** META ((export #t)
+ (peephole (postfix ".car.car")))
+*/
+function sc_caar(p) { return p.car.car; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.car")))
+*/
+function sc_cadr(p) { return p.cdr.car; }
+/*** META ((export #t)
+ (peephole (postfix ".car.cdr")))
+*/
+function sc_cdar(p) { return p.car.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.cdr")))
+*/
+function sc_cddr(p) { return p.cdr.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".car.car.car")))
+*/
+function sc_caaar(p) { return p.car.car.car; }
+/*** META ((export #t)
+ (peephole (postfix ".car.cdr.car")))
+*/
+function sc_cadar(p) { return p.car.cdr.car; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.car.car")))
+*/
+function sc_caadr(p) { return p.cdr.car.car; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.cdr.car")))
+*/
+function sc_caddr(p) { return p.cdr.cdr.car; }
+/*** META ((export #t)
+ (peephole (postfix ".car.car.cdr")))
+*/
+function sc_cdaar(p) { return p.car.car.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.car.cdr")))
+*/
+function sc_cdadr(p) { return p.cdr.car.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".car.cdr.cdr")))
+*/
+function sc_cddar(p) { return p.car.cdr.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.cdr.cdr")))
+*/
+function sc_cdddr(p) { return p.cdr.cdr.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".car.car.car.car")))
+*/
+function sc_caaaar(p) { return p.car.car.car.car; }
+/*** META ((export #t)
+ (peephole (postfix ".car.cdr.car.car")))
+*/
+function sc_caadar(p) { return p.car.cdr.car.car; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.car.car.car")))
+*/
+function sc_caaadr(p) { return p.cdr.car.car.car; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.cdr.car.car")))
+*/
+function sc_caaddr(p) { return p.cdr.cdr.car.car; }
+/*** META ((export #t)
+ (peephole (postfix ".car.car.car.cdr")))
+*/
+function sc_cdaaar(p) { return p.car.car.car.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".car.cdr.car.cdr")))
+*/
+function sc_cdadar(p) { return p.car.cdr.car.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.car.car.cdr")))
+*/
+function sc_cdaadr(p) { return p.cdr.car.car.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.cdr.car.cdr")))
+*/
+function sc_cdaddr(p) { return p.cdr.cdr.car.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".car.car.cdr.car")))
+*/
+function sc_cadaar(p) { return p.car.car.cdr.car; }
+/*** META ((export #t)
+ (peephole (postfix ".car.cdr.cdr.car")))
+*/
+function sc_caddar(p) { return p.car.cdr.cdr.car; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.car.cdr.car")))
+*/
+function sc_cadadr(p) { return p.cdr.car.cdr.car; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.cdr.cdr.car")))
+*/
+function sc_cadddr(p) { return p.cdr.cdr.cdr.car; }
+/*** META ((export #t)
+ (peephole (postfix ".car.car.cdr.cdr")))
+*/
+function sc_cddaar(p) { return p.car.car.cdr.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".car.cdr.cdr.cdr")))
+*/
+function sc_cdddar(p) { return p.car.cdr.cdr.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.car.cdr.cdr")))
+*/
+function sc_cddadr(p) { return p.cdr.car.cdr.cdr; }
+/*** META ((export #t)
+ (peephole (postfix ".cdr.cdr.cdr.cdr")))
+*/
+function sc_cddddr(p) { return p.cdr.cdr.cdr.cdr; }
+
+/*** META ((export #t)) */
+function sc_lastPair(l) {
+ if (!sc_isPair(l)) sc_error("sc_lastPair: pair expected");
+ var res = l;
+ var cdr = l.cdr;
+ while (sc_isPair(cdr)) {
+ res = cdr;
+ cdr = res.cdr;
+ }
+ return res;
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix " === null")))
+*/
+function sc_isNull(o) {
+ return (o === null);
+}
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isList(o) {
+ var rabbit;
+ var turtle;
+
+ var rabbit = o;
+ var turtle = o;
+ while (true) {
+ if (rabbit === null ||
+ (rabbit instanceof sc_Pair && rabbit.cdr === null))
+ return true; // end of list
+ else if ((rabbit instanceof sc_Pair) &&
+ (rabbit.cdr instanceof sc_Pair)) {
+ rabbit = rabbit.cdr.cdr;
+ turtle = turtle.cdr;
+ if (rabbit === turtle) return false; // cycle
+ } else
+ return false; // not pair
+ }
+}
+
+/*** META ((export #t)) */
+function sc_list() {
+ var res = null;
+ var a = arguments;
+ for (var i = a.length-1; i >= 0; i--)
+ res = new sc_Pair(a[i], res);
+ return res;
+}
+
+/*** META ((export #t)) */
+function sc_iota(num, init) {
+ var res = null;
+ if (!init) init = 0;
+ for (var i = num - 1; i >= 0; i--)
+ res = new sc_Pair(i + init, res);
+ return res;
+}
+
+/*** META ((export #t)) */
+function sc_makeList(nbEls, fill) {
+ var res = null;
+ for (var i = 0; i < nbEls; i++)
+ res = new sc_Pair(fill, res);
+ return res;
+}
+
+/*** META ((export #t)) */
+function sc_length(l) {
+ var res = 0;
+ while (l !== null) {
+ res++;
+ l = l.cdr;
+ }
+ return res;
+}
+
+/*** META ((export #t)) */
+function sc_remq(o, l) {
+ var dummy = { cdr : null };
+ var tail = dummy;
+ while (l !== null) {
+ if (l.car !== o) {
+ tail.cdr = sc_cons(l.car, null);
+ tail = tail.cdr;
+ }
+ l = l.cdr;
+ }
+ return dummy.cdr;
+}
+
+/*** META ((export #t)) */
+function sc_remqBang(o, l) {
+ var dummy = { cdr : null };
+ var tail = dummy;
+ var needsAssig = true;
+ while (l !== null) {
+ if (l.car === o) {
+ needsAssig = true;
+ } else {
+ if (needsAssig) {
+ tail.cdr = l;
+ needsAssig = false;
+ }
+ tail = l;
+ }
+ l = l.cdr;
+ }
+ tail.cdr = null;
+ return dummy.cdr;
+}
+
+/*** META ((export #t)) */
+function sc_delete(o, l) {
+ var dummy = { cdr : null };
+ var tail = dummy;
+ while (l !== null) {
+ if (!sc_isEqual(l.car, o)) {
+ tail.cdr = sc_cons(l.car, null);
+ tail = tail.cdr;
+ }
+ l = l.cdr;
+ }
+ return dummy.cdr;
+}
+
+/*** META ((export #t)) */
+function sc_deleteBang(o, l) {
+ var dummy = { cdr : null };
+ var tail = dummy;
+ var needsAssig = true;
+ while (l !== null) {
+ if (sc_isEqual(l.car, o)) {
+ needsAssig = true;
+ } else {
+ if (needsAssig) {
+ tail.cdr = l;
+ needsAssig = false;
+ }
+ tail = l;
+ }
+ l = l.cdr;
+ }
+ tail.cdr = null;
+ return dummy.cdr;
+}
+
+function sc_reverseAppendBang(l1, l2) {
+ var res = l2;
+ while (l1 !== null) {
+ var tmp = res;
+ res = l1;
+ l1 = l1.cdr;
+ res.cdr = tmp;
+ }
+ return res;
+}
+
+function sc_dualAppend(l1, l2) {
+ if (l1 === null) return l2;
+ if (l2 === null) return l1;
+ var rev = sc_reverse(l1);
+ return sc_reverseAppendBang(rev, l2);
+}
+
+/*** META ((export #t)) */
+function sc_append() {
+ if (arguments.length === 0)
+ return null;
+ var res = arguments[arguments.length - 1];
+ for (var i = arguments.length - 2; i >= 0; i--)
+ res = sc_dualAppend(arguments[i], res);
+ return res;
+}
+
+function sc_dualAppendBang(l1, l2) {
+ if (l1 === null) return l2;
+ if (l2 === null) return l1;
+ var tmp = l1;
+ while (tmp.cdr !== null) tmp=tmp.cdr;
+ tmp.cdr = l2;
+ return l1;
+}
+
+/*** META ((export #t)) */
+function sc_appendBang() {
+ var res = null;
+ for (var i = 0; i < arguments.length; i++)
+ res = sc_dualAppendBang(res, arguments[i]);
+ return res;
+}
+
+/*** META ((export #t)) */
+function sc_reverse(l1) {
+ var res = null;
+ while (l1 !== null) {
+ res = sc_cons(l1.car, res);
+ l1 = l1.cdr;
+ }
+ return res;
+}
+
+/*** META ((export #t)) */
+function sc_reverseBang(l) {
+ return sc_reverseAppendBang(l, null);
+}
+
+/*** META ((export #t)) */
+function sc_listTail(l, k) {
+ var res = l;
+ for (var i = 0; i < k; i++) {
+ res = res.cdr;
+ }
+ return res;
+}
+
+/*** META ((export #t)) */
+function sc_listRef(l, k) {
+ return sc_listTail(l, k).car;
+}
+
+/* // unoptimized generic versions
+function sc_memX(o, l, comp) {
+ while (l != null) {
+ if (comp(l.car, o))
+ return l;
+ l = l.cdr;
+ }
+ return false;
+}
+function sc_memq(o, l) { return sc_memX(o, l, sc_isEq); }
+function sc_memv(o, l) { return sc_memX(o, l, sc_isEqv); }
+function sc_member(o, l) { return sc_memX(o, l, sc_isEqual); }
+*/
+
+/* optimized versions */
+/*** META ((export #t)) */
+function sc_memq(o, l) {
+ while (l !== null) {
+ if (l.car === o)
+ return l;
+ l = l.cdr;
+ }
+ return false;
+}
+/*** META ((export #t)) */
+function sc_memv(o, l) {
+ while (l !== null) {
+ if (l.car === o)
+ return l;
+ l = l.cdr;
+ }
+ return false;
+}
+/*** META ((export #t)) */
+function sc_member(o, l) {
+ while (l !== null) {
+ if (sc_isEqual(l.car,o))
+ return l;
+ l = l.cdr;
+ }
+ return false;
+}
+
+/* // generic unoptimized versions
+function sc_assX(o, al, comp) {
+ while (al != null) {
+ if (comp(al.car.car, o))
+ return al.car;
+ al = al.cdr;
+ }
+ return false;
+}
+function sc_assq(o, al) { return sc_assX(o, al, sc_isEq); }
+function sc_assv(o, al) { return sc_assX(o, al, sc_isEqv); }
+function sc_assoc(o, al) { return sc_assX(o, al, sc_isEqual); }
+*/
+// optimized versions
+/*** META ((export #t)) */
+function sc_assq(o, al) {
+ while (al !== null) {
+ if (al.car.car === o)
+ return al.car;
+ al = al.cdr;
+ }
+ return false;
+}
+/*** META ((export #t)) */
+function sc_assv(o, al) {
+ while (al !== null) {
+ if (al.car.car === o)
+ return al.car;
+ al = al.cdr;
+ }
+ return false;
+}
+/*** META ((export #t)) */
+function sc_assoc(o, al) {
+ while (al !== null) {
+ if (sc_isEqual(al.car.car, o))
+ return al.car;
+ al = al.cdr;
+ }
+ return false;
+}
+
+/* can be used for mutable strings and characters */
+function sc_isCharStringEqual(cs1, cs2) { return cs1.val === cs2.val; }
+function sc_isCharStringLess(cs1, cs2) { return cs1.val < cs2.val; }
+function sc_isCharStringGreater(cs1, cs2) { return cs1.val > cs2.val; }
+function sc_isCharStringLessEqual(cs1, cs2) { return cs1.val <= cs2.val; }
+function sc_isCharStringGreaterEqual(cs1, cs2) { return cs1.val >= cs2.val; }
+function sc_isCharStringCIEqual(cs1, cs2)
+ { return cs1.val.toLowerCase() === cs2.val.toLowerCase(); }
+function sc_isCharStringCILess(cs1, cs2)
+ { return cs1.val.toLowerCase() < cs2.val.toLowerCase(); }
+function sc_isCharStringCIGreater(cs1, cs2)
+ { return cs1.val.toLowerCase() > cs2.val.toLowerCase(); }
+function sc_isCharStringCILessEqual(cs1, cs2)
+ { return cs1.val.toLowerCase() <= cs2.val.toLowerCase(); }
+function sc_isCharStringCIGreaterEqual(cs1, cs2)
+ { return cs1.val.toLowerCase() >= cs2.val.toLowerCase(); }
+
+
+
+
+function sc_Char(c) {
+ var cached = sc_Char.lazy[c];
+ if (cached)
+ return cached;
+ this.val = c;
+ sc_Char.lazy[c] = this;
+ // add return, so FF does not complain.
+ return undefined;
+}
+sc_Char.lazy = new Object();
+// thanks to Eric
+sc_Char.char2readable = {
+ "\000": "#\\null",
+ "\007": "#\\bell",
+ "\010": "#\\backspace",
+ "\011": "#\\tab",
+ "\012": "#\\newline",
+ "\014": "#\\page",
+ "\015": "#\\return",
+ "\033": "#\\escape",
+ "\040": "#\\space",
+ "\177": "#\\delete",
+
+ /* poeticless names */
+ "\001": "#\\soh",
+ "\002": "#\\stx",
+ "\003": "#\\etx",
+ "\004": "#\\eot",
+ "\005": "#\\enq",
+ "\006": "#\\ack",
+
+ "\013": "#\\vt",
+ "\016": "#\\so",
+ "\017": "#\\si",
+
+ "\020": "#\\dle",
+ "\021": "#\\dc1",
+ "\022": "#\\dc2",
+ "\023": "#\\dc3",
+ "\024": "#\\dc4",
+ "\025": "#\\nak",
+ "\026": "#\\syn",
+ "\027": "#\\etb",
+
+ "\030": "#\\can",
+ "\031": "#\\em",
+ "\032": "#\\sub",
+ "\033": "#\\esc",
+ "\034": "#\\fs",
+ "\035": "#\\gs",
+ "\036": "#\\rs",
+ "\037": "#\\us"};
+
+sc_Char.readable2char = {
+ "null": "\000",
+ "bell": "\007",
+ "backspace": "\010",
+ "tab": "\011",
+ "newline": "\012",
+ "page": "\014",
+ "return": "\015",
+ "escape": "\033",
+ "space": "\040",
+ "delete": "\000",
+ "soh": "\001",
+ "stx": "\002",
+ "etx": "\003",
+ "eot": "\004",
+ "enq": "\005",
+ "ack": "\006",
+ "bel": "\007",
+ "bs": "\010",
+ "ht": "\011",
+ "nl": "\012",
+ "vt": "\013",
+ "np": "\014",
+ "cr": "\015",
+ "so": "\016",
+ "si": "\017",
+ "dle": "\020",
+ "dc1": "\021",
+ "dc2": "\022",
+ "dc3": "\023",
+ "dc4": "\024",
+ "nak": "\025",
+ "syn": "\026",
+ "etb": "\027",
+ "can": "\030",
+ "em": "\031",
+ "sub": "\032",
+ "esc": "\033",
+ "fs": "\034",
+ "gs": "\035",
+ "rs": "\036",
+ "us": "\037",
+ "sp": "\040",
+ "del": "\177"};
+
+sc_Char.prototype.toString = function() {
+ return this.val;
+};
+// sc_toDisplayString == toString
+sc_Char.prototype.sc_toWriteString = function() {
+ var entry = sc_Char.char2readable[this.val];
+ if (entry)
+ return entry;
+ else
+ return "#\\" + this.val;
+};
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix "instanceof sc_Char")))
+*/
+function sc_isChar(c) {
+ return (c instanceof sc_Char);
+}
+
+/*** META ((export char=?)
+ (type bool)
+ (peephole (hole 2 c1 ".val === " c2 ".val")))
+*/
+var sc_isCharEqual = sc_isCharStringEqual;
+/*** META ((export char<?)
+ (type bool)
+ (peephole (hole 2 c1 ".val < " c2 ".val")))
+*/
+var sc_isCharLess = sc_isCharStringLess;
+/*** META ((export char>?)
+ (type bool)
+ (peephole (hole 2 c1 ".val > " c2 ".val")))
+*/
+var sc_isCharGreater = sc_isCharStringGreater;
+/*** META ((export char<=?)
+ (type bool)
+ (peephole (hole 2 c1 ".val <= " c2 ".val")))
+*/
+var sc_isCharLessEqual = sc_isCharStringLessEqual;
+/*** META ((export char>=?)
+ (type bool)
+ (peephole (hole 2 c1 ".val >= " c2 ".val")))
+*/
+var sc_isCharGreaterEqual = sc_isCharStringGreaterEqual;
+/*** META ((export char-ci=?)
+ (type bool)
+ (peephole (hole 2 c1 ".val.toLowerCase() === " c2 ".val.toLowerCase()")))
+*/
+var sc_isCharCIEqual = sc_isCharStringCIEqual;
+/*** META ((export char-ci<?)
+ (type bool)
+ (peephole (hole 2 c1 ".val.toLowerCase() < " c2 ".val.toLowerCase()")))
+*/
+var sc_isCharCILess = sc_isCharStringCILess;
+/*** META ((export char-ci>?)
+ (type bool)
+ (peephole (hole 2 c1 ".val.toLowerCase() > " c2 ".val.toLowerCase()")))
+*/
+var sc_isCharCIGreater = sc_isCharStringCIGreater;
+/*** META ((export char-ci<=?)
+ (type bool)
+ (peephole (hole 2 c1 ".val.toLowerCase() <= " c2 ".val.toLowerCase()")))
+*/
+var sc_isCharCILessEqual = sc_isCharStringCILessEqual;
+/*** META ((export char-ci>=?)
+ (type bool)
+ (peephole (hole 2 c1 ".val.toLowerCase() >= " c2 ".val.toLowerCase()")))
+*/
+var sc_isCharCIGreaterEqual = sc_isCharStringCIGreaterEqual;
+
+var SC_NUMBER_CLASS = "0123456789";
+var SC_WHITESPACE_CLASS = ' \r\n\t\f';
+var SC_LOWER_CLASS = 'abcdefghijklmnopqrstuvwxyz';
+var SC_UPPER_CLASS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+
+function sc_isCharOfClass(c, cl) { return (cl.indexOf(c) != -1); }
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isCharAlphabetic(c)
+ { return sc_isCharOfClass(c.val, SC_LOWER_CLASS) ||
+ sc_isCharOfClass(c.val, SC_UPPER_CLASS); }
+/*** META ((export #t)
+ (type bool)
+ (peephole (hole 1 "SC_NUMBER_CLASS.indexOf(" c ".val) != -1")))
+*/
+function sc_isCharNumeric(c)
+ { return sc_isCharOfClass(c.val, SC_NUMBER_CLASS); }
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isCharWhitespace(c) {
+ var tmp = c.val;
+ return tmp === " " || tmp === "\r" || tmp === "\n" || tmp === "\t" || tmp === "\f";
+}
+/*** META ((export #t)
+ (type bool)
+ (peephole (hole 1 "SC_UPPER_CLASS.indexOf(" c ".val) != -1")))
+*/
+function sc_isCharUpperCase(c)
+ { return sc_isCharOfClass(c.val, SC_UPPER_CLASS); }
+/*** META ((export #t)
+ (type bool)
+ (peephole (hole 1 "SC_LOWER_CLASS.indexOf(" c ".val) != -1")))
+*/
+function sc_isCharLowerCase(c)
+ { return sc_isCharOfClass(c.val, SC_LOWER_CLASS); }
+
+/*** META ((export #t)
+ (peephole (postfix ".val.charCodeAt(0)")))
+*/
+function sc_char2integer(c)
+ { return c.val.charCodeAt(0); }
+/*** META ((export #t)
+ (peephole (hole 1 "new sc_Char(String.fromCharCode(" n "))")))
+*/
+function sc_integer2char(n)
+ { return new sc_Char(String.fromCharCode(n)); }
+
+/*** META ((export #t)
+ (peephole (hole 1 "new sc_Char(" c ".val.toUpperCase())")))
+*/
+function sc_charUpcase(c)
+ { return new sc_Char(c.val.toUpperCase()); }
+/*** META ((export #t)
+ (peephole (hole 1 "new sc_Char(" c ".val.toLowerCase())")))
+*/
+function sc_charDowncase(c)
+ { return new sc_Char(c.val.toLowerCase()); }
+
+function sc_makeJSStringOfLength(k, c) {
+ var fill;
+ if (c === undefined)
+ fill = " ";
+ else
+ fill = c;
+ var res = "";
+ var len = 1;
+ // every round doubles the size of fill.
+ while (k >= len) {
+ if (k & len)
+ res = res.concat(fill);
+ fill = fill.concat(fill);
+ len *= 2;
+ }
+ return res;
+}
+
+function sc_makejsString(k, c) {
+ var fill;
+ if (c)
+ fill = c.val;
+ else
+ fill = " ";
+ return sc_makeJSStringOfLength(k, fill);
+}
+
+function sc_jsstring2list(s) {
+ var res = null;
+ for (var i = s.length - 1; i >= 0; i--)
+ res = sc_cons(new sc_Char(s.charAt(i)), res);
+ return res;
+}
+
+function sc_list2jsstring(l) {
+ var a = new Array();
+ while(l !== null) {
+ a.push(l.car.val);
+ l = l.cdr;
+ }
+ return "".concat.apply("", a);
+}
+
+var sc_Vector = Array;
+
+sc_Vector.prototype.sc_toWriteOrDisplayString = function(writeOrDisplay) {
+ if (this.length === 0) return "#()";
+
+ var res = "#(" + writeOrDisplay(this[0]);
+ for (var i = 1; i < this.length; i++)
+ res += " " + writeOrDisplay(this[i]);
+ res += ")";
+ return res;
+};
+sc_Vector.prototype.sc_toDisplayString = function() {
+ return this.sc_toWriteOrDisplayString(sc_toDisplayString);
+};
+sc_Vector.prototype.sc_toWriteString = function() {
+ return this.sc_toWriteOrDisplayString(sc_toWriteString);
+};
+
+/*** META ((export vector? array?)
+ (type bool)
+ (peephole (postfix " instanceof sc_Vector")))
+*/
+function sc_isVector(v) {
+ return (v instanceof sc_Vector);
+}
+
+// only applies to vectors
+function sc_isVectorEqual(v1, v2, comp) {
+ if (v1.length !== v2.length) return false;
+ for (var i = 0; i < v1.length; i++)
+ if (!comp(v1[i], v2[i])) return false;
+ return true;
+}
+
+/*** META ((export make-vector make-array)) */
+function sc_makeVector(size, fill) {
+ var a = new sc_Vector(size);
+ if (fill !== undefined)
+ sc_vectorFillBang(a, fill);
+ return a;
+}
+
+/*** META ((export vector array)
+ (peephole (vector)))
+*/
+function sc_vector() {
+ var a = new sc_Vector();
+ for (var i = 0; i < arguments.length; i++)
+ a.push(arguments[i]);
+ return a;
+}
+
+/*** META ((export vector-length array-length)
+ (peephole (postfix ".length")))
+*/
+function sc_vectorLength(v) {
+ return v.length;
+}
+
+/*** META ((export vector-ref array-ref)
+ (peephole (hole 2 v "[" pos "]")))
+*/
+function sc_vectorRef(v, pos) {
+ return v[pos];
+}
+
+/*** META ((export vector-set! array-set!)
+ (peephole (hole 3 v "[" pos "] = " val)))
+*/
+function sc_vectorSetBang(v, pos, val) {
+ v[pos] = val;
+}
+
+/*** META ((export vector->list array->list)) */
+function sc_vector2list(a) {
+ var res = null;
+ for (var i = a.length-1; i >= 0; i--)
+ res = sc_cons(a[i], res);
+ return res;
+}
+
+/*** META ((export list->vector list->array)) */
+function sc_list2vector(l) {
+ var a = new sc_Vector();
+ while(l !== null) {
+ a.push(l.car);
+ l = l.cdr;
+ }
+ return a;
+}
+
+/*** META ((export vector-fill! array-fill!)) */
+function sc_vectorFillBang(a, fill) {
+ for (var i = 0; i < a.length; i++)
+ a[i] = fill;
+}
+
+
+/*** META ((export #t)) */
+function sc_copyVector(a, len) {
+ if (len <= a.length)
+ return a.slice(0, len);
+ else {
+ var tmp = a.concat();
+ tmp.length = len;
+ return tmp;
+ }
+}
+
+/*** META ((export #t)
+ (peephole (hole 3 a ".slice(" start "," end ")")))
+*/
+function sc_vectorCopy(a, start, end) {
+ return a.slice(start, end);
+}
+
+/*** META ((export #t)) */
+function sc_vectorCopyBang(target, tstart, source, sstart, send) {
+ if (!sstart) sstart = 0;
+ if (!send) send = source.length;
+
+ // if target == source we don't want to overwrite not yet copied elements.
+ if (tstart <= sstart) {
+ for (var i = tstart, j = sstart; j < send; i++, j++) {
+ target[i] = source[j];
+ }
+ } else {
+ var diff = send - sstart;
+ for (var i = tstart + diff - 1, j = send - 1;
+ j >= sstart;
+ i--, j--) {
+ target[i] = source[j];
+ }
+ }
+ return target;
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (hole 1 "typeof " o " === 'function'")))
+*/
+function sc_isProcedure(o) {
+ return (typeof o === "function");
+}
+
+/*** META ((export #t)) */
+function sc_apply(proc) {
+ var args = new Array();
+ // first part of arguments are not in list-form.
+ for (var i = 1; i < arguments.length - 1; i++)
+ args.push(arguments[i]);
+ var l = arguments[arguments.length - 1];
+ while (l !== null) {
+ args.push(l.car);
+ l = l.cdr;
+ }
+ return proc.apply(null, args);
+}
+
+/*** META ((export #t)) */
+function sc_map(proc, l1) {
+ if (l1 === undefined)
+ return null;
+ // else
+ var nbApplyArgs = arguments.length - 1;
+ var applyArgs = new Array(nbApplyArgs);
+ var revres = null;
+ while (l1 !== null) {
+ for (var i = 0; i < nbApplyArgs; i++) {
+ applyArgs[i] = arguments[i + 1].car;
+ arguments[i + 1] = arguments[i + 1].cdr;
+ }
+ revres = sc_cons(proc.apply(null, applyArgs), revres);
+ }
+ return sc_reverseAppendBang(revres, null);
+}
+
+/*** META ((export #t)) */
+function sc_mapBang(proc, l1) {
+ if (l1 === undefined)
+ return null;
+ // else
+ var l1_orig = l1;
+ var nbApplyArgs = arguments.length - 1;
+ var applyArgs = new Array(nbApplyArgs);
+ while (l1 !== null) {
+ var tmp = l1;
+ for (var i = 0; i < nbApplyArgs; i++) {
+ applyArgs[i] = arguments[i + 1].car;
+ arguments[i + 1] = arguments[i + 1].cdr;
+ }
+ tmp.car = proc.apply(null, applyArgs);
+ }
+ return l1_orig;
+}
+
+/*** META ((export #t)) */
+function sc_forEach(proc, l1) {
+ if (l1 === undefined)
+ return undefined;
+ // else
+ var nbApplyArgs = arguments.length - 1;
+ var applyArgs = new Array(nbApplyArgs);
+ while (l1 !== null) {
+ for (var i = 0; i < nbApplyArgs; i++) {
+ applyArgs[i] = arguments[i + 1].car;
+ arguments[i + 1] = arguments[i + 1].cdr;
+ }
+ proc.apply(null, applyArgs);
+ }
+ // add return so FF does not complain.
+ return undefined;
+}
+
+/*** META ((export #t)) */
+function sc_filter(proc, l1) {
+ var dummy = { cdr : null };
+ var tail = dummy;
+ while (l1 !== null) {
+ if (proc(l1.car) !== false) {
+ tail.cdr = sc_cons(l1.car, null);
+ tail = tail.cdr;
+ }
+ l1 = l1.cdr;
+ }
+ return dummy.cdr;
+}
+
+/*** META ((export #t)) */
+function sc_filterBang(proc, l1) {
+ var head = sc_cons("dummy", l1);
+ var it = head;
+ var next = l1;
+ while (next !== null) {
+ if (proc(next.car) !== false) {
+ it.cdr = next
+ it = next;
+ }
+ next = next.cdr;
+ }
+ it.cdr = null;
+ return head.cdr;
+}
+
+function sc_filterMap1(proc, l1) {
+ var revres = null;
+ while (l1 !== null) {
+ var tmp = proc(l1.car)
+ if (tmp !== false) revres = sc_cons(tmp, revres);
+ l1 = l1.cdr;
+ }
+ return sc_reverseAppendBang(revres, null);
+}
+function sc_filterMap2(proc, l1, l2) {
+ var revres = null;
+ while (l1 !== null) {
+ var tmp = proc(l1.car, l2.car);
+ if(tmp !== false) revres = sc_cons(tmp, revres);
+ l1 = l1.cdr;
+ l2 = l2.cdr
+ }
+ return sc_reverseAppendBang(revres, null);
+}
+
+/*** META ((export #t)) */
+function sc_filterMap(proc, l1, l2, l3) {
+ if (l2 === undefined)
+ return sc_filterMap1(proc, l1);
+ else if (l3 === undefined)
+ return sc_filterMap2(proc, l1, l2);
+ // else
+ var nbApplyArgs = arguments.length - 1;
+ var applyArgs = new Array(nbApplyArgs);
+ var revres = null;
+ while (l1 !== null) {
+ for (var i = 0; i < nbApplyArgs; i++) {
+ applyArgs[i] = arguments[i + 1].car;
+ arguments[i + 1] = arguments[i + 1].cdr;
+ }
+ var tmp = proc.apply(null, applyArgs);
+ if(tmp !== false) revres = sc_cons(tmp, revres);
+ }
+ return sc_reverseAppendBang(revres, null);
+}
+
+/*** META ((export #t)) */
+function sc_any(proc, l) {
+ var revres = null;
+ while (l !== null) {
+ var tmp = proc(l.car);
+ if(tmp !== false) return tmp;
+ l = l.cdr;
+ }
+ return false;
+}
+
+/*** META ((export any?)
+ (peephole (hole 2 "sc_any(" proc "," l ") !== false")))
+*/
+function sc_anyPred(proc, l) {
+ return sc_any(proc, l)!== false;
+}
+
+/*** META ((export #t)) */
+function sc_every(proc, l) {
+ var revres = null;
+ var tmp = true;
+ while (l !== null) {
+ tmp = proc(l.car);
+ if (tmp === false) return false;
+ l = l.cdr;
+ }
+ return tmp;
+}
+
+/*** META ((export every?)
+ (peephole (hole 2 "sc_every(" proc "," l ") !== false")))
+*/
+function sc_everyPred(proc, l) {
+ var tmp = sc_every(proc, l);
+ if (tmp !== false) return true;
+ return false;
+}
+
+/*** META ((export #t)
+ (peephole (postfix "()")))
+*/
+function sc_force(o) {
+ return o();
+}
+
+/*** META ((export #t)) */
+function sc_makePromise(proc) {
+ var isResultReady = false;
+ var result = undefined;
+ return function() {
+ if (!isResultReady) {
+ var tmp = proc();
+ if (!isResultReady) {
+ isResultReady = true;
+ result = tmp;
+ }
+ }
+ return result;
+ };
+}
+
+function sc_Values(values) {
+ this.values = values;
+}
+
+/*** META ((export #t)
+ (peephole (values)))
+*/
+function sc_values() {
+ if (arguments.length === 1)
+ return arguments[0];
+ else
+ return new sc_Values(arguments);
+}
+
+/*** META ((export #t)) */
+function sc_callWithValues(producer, consumer) {
+ var produced = producer();
+ if (produced instanceof sc_Values)
+ return consumer.apply(null, produced.values);
+ else
+ return consumer(produced);
+}
+
+/*** META ((export #t)) */
+function sc_dynamicWind(before, thunk, after) {
+ before();
+ try {
+ var res = thunk();
+ return res;
+ } finally {
+ after();
+ }
+}
+
+
+// TODO: eval/scheme-report-environment/null-environment/interaction-environment
+
+// LIMITATION: 'load' doesn't exist without files.
+// LIMITATION: transcript-on/transcript-off doesn't exist without files.
+
+
+function sc_Struct(name) {
+ this.name = name;
+}
+sc_Struct.prototype.sc_toDisplayString = function() {
+ return "#<struct" + sc_hash(this) + ">";
+};
+sc_Struct.prototype.sc_toWriteString = sc_Struct.prototype.sc_toDisplayString;
+
+/*** META ((export #t)
+ (peephole (hole 1 "new sc_Struct(" name ")")))
+*/
+function sc_makeStruct(name) {
+ return new sc_Struct(name);
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix " instanceof sc_Struct")))
+*/
+function sc_isStruct(o) {
+ return (o instanceof sc_Struct);
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (hole 2 "(" 1 " instanceof sc_Struct) && ( " 1 ".name === " 0 ")")))
+*/
+function sc_isStructNamed(name, s) {
+ return ((s instanceof sc_Struct) && (s.name === name));
+}
+
+/*** META ((export struct-field)
+ (peephole (hole 3 0 "[" 2 "]")))
+*/
+function sc_getStructField(s, name, field) {
+ return s[field];
+}
+
+/*** META ((export struct-field-set!)
+ (peephole (hole 4 0 "[" 2 "] = " 3)))
+*/
+function sc_setStructFieldBang(s, name, field, val) {
+ s[field] = val;
+}
+
+/*** META ((export #t)
+ (peephole (prefix "~")))
+*/
+function sc_bitNot(x) {
+ return ~x;
+}
+
+/*** META ((export #t)
+ (peephole (infix 2 2 "&")))
+*/
+function sc_bitAnd(x, y) {
+ return x & y;
+}
+
+/*** META ((export #t)
+ (peephole (infix 2 2 "|")))
+*/
+function sc_bitOr(x, y) {
+ return x | y;
+}
+
+/*** META ((export #t)
+ (peephole (infix 2 2 "^")))
+*/
+function sc_bitXor(x, y) {
+ return x ^ y;
+}
+
+/*** META ((export #t)
+ (peephole (infix 2 2 "<<")))
+*/
+function sc_bitLsh(x, y) {
+ return x << y;
+}
+
+/*** META ((export #t)
+ (peephole (infix 2 2 ">>")))
+*/
+function sc_bitRsh(x, y) {
+ return x >> y;
+}
+
+/*** META ((export #t)
+ (peephole (infix 2 2 ">>>")))
+*/
+function sc_bitUrsh(x, y) {
+ return x >>> y;
+}
+
+/*** META ((export js-field js-property)
+ (peephole (hole 2 o "[" field "]")))
+*/
+function sc_jsField(o, field) {
+ return o[field];
+}
+
+/*** META ((export js-field-set! js-property-set!)
+ (peephole (hole 3 o "[" field "] = " val)))
+*/
+function sc_setJsFieldBang(o, field, val) {
+ return o[field] = val;
+}
+
+/*** META ((export js-field-delete! js-property-delete!)
+ (peephole (hole 2 "delete" o "[" field "]")))
+*/
+function sc_deleteJsFieldBang(o, field) {
+ delete o[field];
+}
+
+/*** META ((export #t)
+ (peephole (jsCall)))
+*/
+function sc_jsCall(o, fun) {
+ var args = new Array();
+ for (var i = 2; i < arguments.length; i++)
+ args[i-2] = arguments[i];
+ return fun.apply(o, args);
+}
+
+/*** META ((export #t)
+ (peephole (jsMethodCall)))
+*/
+function sc_jsMethodCall(o, field) {
+ var args = new Array();
+ for (var i = 2; i < arguments.length; i++)
+ args[i-2] = arguments[i];
+ return o[field].apply(o, args);
+}
+
+/*** META ((export new js-new)
+ (peephole (jsNew)))
+*/
+function sc_jsNew(c) {
+ var evalStr = "new c(";
+ evalStr +=arguments.length > 1? "arguments[1]": "";
+ for (var i = 2; i < arguments.length; i++)
+ evalStr += ", arguments[" + i + "]";
+ evalStr +=")";
+ return eval(evalStr);
+}
+
+// ======================== RegExp ====================
+/*** META ((export #t)) */
+function sc_pregexp(re) {
+ return new RegExp(sc_string2jsstring(re));
+}
+
+/*** META ((export #t)) */
+function sc_pregexpMatch(re, s) {
+ var reg = (re instanceof RegExp) ? re : sc_pregexp(re);
+ var tmp = reg.exec(sc_string2jsstring(s));
+
+ if (tmp == null) return false;
+
+ var res = null;
+ for (var i = tmp.length-1; i >= 0; i--) {
+ if (tmp[i] !== null) {
+ res = sc_cons(sc_jsstring2string(tmp[i]), res);
+ } else {
+ res = sc_cons(false, res);
+ }
+ }
+ return res;
+}
+
+/*** META ((export #t)) */
+function sc_pregexpReplace(re, s1, s2) {
+ var reg;
+ var jss1 = sc_string2jsstring(s1);
+ var jss2 = sc_string2jsstring(s2);
+
+ if (re instanceof RegExp) {
+ if (re.global)
+ reg = re;
+ else
+ reg = new RegExp(re.source);
+ } else {
+ reg = new RegExp(sc_string2jsstring(re));
+ }
+
+ return jss1.replace(reg, jss2);
+}
+
+/*** META ((export pregexp-replace*)) */
+function sc_pregexpReplaceAll(re, s1, s2) {
+ var reg;
+ var jss1 = sc_string2jsstring(s1);
+ var jss2 = sc_string2jsstring(s2);
+
+ if (re instanceof RegExp) {
+ if (re.global)
+ reg = re;
+ else
+ reg = new RegExp(re.source, "g");
+ } else {
+ reg = new RegExp(sc_string2jsstring(re), "g");
+ }
+
+ return jss1.replace(reg, jss2);
+}
+
+/*** META ((export #t)) */
+function sc_pregexpSplit(re, s) {
+ var reg = ((re instanceof RegExp) ?
+ re :
+ new RegExp(sc_string2jsstring(re)));
+ var jss = sc_string2jsstring(s);
+ var tmp = jss.split(reg);
+
+ if (tmp == null) return false;
+
+ return sc_vector2list(tmp);
+}
+
+
+/* =========================================================================== */
+/* Other library stuff */
+/* =========================================================================== */
+
+/*** META ((export #t)
+ (peephole (hole 1 "Math.floor(Math.random()*" 'n ")")))
+*/
+function sc_random(n) {
+ return Math.floor(Math.random()*n);
+}
+
+/*** META ((export current-date)
+ (peephole (hole 0 "new Date()")))
+*/
+function sc_currentDate() {
+ return new Date();
+}
+
+function sc_Hashtable() {
+}
+sc_Hashtable.prototype.toString = function() {
+ return "#{%hashtable}";
+};
+// sc_toWriteString == sc_toDisplayString == toString
+
+function sc_HashtableElement(key, val) {
+ this.key = key;
+ this.val = val;
+}
+
+/*** META ((export #t)
+ (peephole (hole 0 "new sc_Hashtable()")))
+*/
+function sc_makeHashtable() {
+ return new sc_Hashtable();
+}
+
+/*** META ((export #t)) */
+function sc_hashtablePutBang(ht, key, val) {
+ var hash = sc_hash(key);
+ ht[hash] = new sc_HashtableElement(key, val);
+}
+
+/*** META ((export #t)) */
+function sc_hashtableGet(ht, key) {
+ var hash = sc_hash(key);
+ if (hash in ht)
+ return ht[hash].val;
+ else
+ return false;
+}
+
+/*** META ((export #t)) */
+function sc_hashtableForEach(ht, f) {
+ for (var v in ht) {
+ if (ht[v] instanceof sc_HashtableElement)
+ f(ht[v].key, ht[v].val);
+ }
+}
+
+/*** META ((export hashtable-contains?)
+ (peephole (hole 2 "sc_hash(" 1 ") in " 0)))
+*/
+function sc_hashtableContains(ht, key) {
+ var hash = sc_hash(key);
+ if (hash in ht)
+ return true;
+ else
+ return false;
+}
+
+var SC_HASH_COUNTER = 0;
+
+function sc_hash(o) {
+ if (o === null)
+ return "null";
+ else if (o === undefined)
+ return "undefined";
+ else if (o === true)
+ return "true";
+ else if (o === false)
+ return "false";
+ else if (typeof o === "number")
+ return "num-" + o;
+ else if (typeof o === "string")
+ return "jsstr-" + o;
+ else if (o.sc_getHash)
+ return o.sc_getHash();
+ else
+ return sc_counterHash.call(o);
+}
+function sc_counterHash() {
+ if (!this.sc_hash) {
+ this.sc_hash = "hash-" + SC_HASH_COUNTER;
+ SC_HASH_COUNTER++;
+ }
+ return this.sc_hash;
+}
+
+function sc_Trampoline(args, maxTailCalls) {
+ this['__trampoline return__'] = true;
+ this.args = args;
+ this.MAX_TAIL_CALLs = maxTailCalls;
+}
+// TODO: call/cc stuff
+sc_Trampoline.prototype.restart = function() {
+ var o = this;
+ while (true) {
+ // set both globals.
+ SC_TAIL_OBJECT.calls = o.MAX_TAIL_CALLs-1;
+ var fun = o.args.callee;
+ var res = fun.apply(SC_TAIL_OBJECT, o.args);
+ if (res instanceof sc_Trampoline)
+ o = res;
+ else
+ return res;
+ }
+}
+
+/*** META ((export bind-exit-lambda)) */
+function sc_bindExitLambda(proc) {
+ var escape_obj = new sc_BindExitException();
+ var escape = function(res) {
+ escape_obj.res = res;
+ throw escape_obj;
+ };
+ try {
+ return proc(escape);
+ } catch(e) {
+ if (e === escape_obj) {
+ return e.res;
+ }
+ throw e;
+ }
+}
+function sc_BindExitException() {
+ this._internalException = true;
+}
+
+var SC_SCM2JS_GLOBALS = new Object();
+
+// default tail-call depth.
+// normally the program should set it again. but just in case...
+var SC_TAIL_OBJECT = new Object();
+SC_SCM2JS_GLOBALS.TAIL_OBJECT = SC_TAIL_OBJECT;
+// ======================== I/O =======================
+
+/*------------------------------------------------------------------*/
+
+function sc_EOF() {
+}
+var SC_EOF_OBJECT = new sc_EOF();
+
+function sc_Port() {
+}
+
+/* --------------- Input ports -------------------------------------*/
+
+function sc_InputPort() {
+}
+sc_InputPort.prototype = new sc_Port();
+
+sc_InputPort.prototype.peekChar = function() {
+ if (!("peeked" in this))
+ this.peeked = this.getNextChar();
+ return this.peeked;
+}
+sc_InputPort.prototype.readChar = function() {
+ var tmp = this.peekChar();
+ delete this.peeked;
+ return tmp;
+}
+sc_InputPort.prototype.isCharReady = function() {
+ return true;
+}
+sc_InputPort.prototype.close = function() {
+ // do nothing
+}
+
+/* .............. String port ..........................*/
+function sc_ErrorInputPort() {
+};
+sc_ErrorInputPort.prototype = new sc_InputPort();
+sc_ErrorInputPort.prototype.getNextChar = function() {
+ throw "can't read from error-port.";
+};
+sc_ErrorInputPort.prototype.isCharReady = function() {
+ return false;
+};
+
+
+/* .............. String port ..........................*/
+
+function sc_StringInputPort(jsStr) {
+ // we are going to do some charAts on the str.
+ // instead of recreating all the time a String-object, we
+ // create one in the beginning. (not sure, if this is really an optim)
+ this.str = new String(jsStr);
+ this.pos = 0;
+}
+sc_StringInputPort.prototype = new sc_InputPort();
+sc_StringInputPort.prototype.getNextChar = function() {
+ if (this.pos >= this.str.length)
+ return SC_EOF_OBJECT;
+ return this.str.charAt(this.pos++);
+};
+
+/* ------------- Read and other lib-funs -------------------------------*/
+function sc_Token(type, val, pos) {
+ this.type = type;
+ this.val = val;
+ this.pos = pos;
+}
+sc_Token.EOF = 0/*EOF*/;
+sc_Token.OPEN_PAR = 1/*OPEN_PAR*/;
+sc_Token.CLOSE_PAR = 2/*CLOSE_PAR*/;
+sc_Token.OPEN_BRACE = 3/*OPEN_BRACE*/;
+sc_Token.CLOSE_BRACE = 4/*CLOSE_BRACE*/;
+sc_Token.OPEN_BRACKET = 5/*OPEN_BRACKET*/;
+sc_Token.CLOSE_BRACKET = 6/*CLOSE_BRACKET*/;
+sc_Token.WHITESPACE = 7/*WHITESPACE*/;
+sc_Token.QUOTE = 8/*QUOTE*/;
+sc_Token.ID = 9/*ID*/;
+sc_Token.DOT = 10/*DOT*/;
+sc_Token.STRING = 11/*STRING*/;
+sc_Token.NUMBER = 12/*NUMBER*/;
+sc_Token.ERROR = 13/*ERROR*/;
+sc_Token.VECTOR_BEGIN = 14/*VECTOR_BEGIN*/;
+sc_Token.TRUE = 15/*TRUE*/;
+sc_Token.FALSE = 16/*FALSE*/;
+sc_Token.UNSPECIFIED = 17/*UNSPECIFIED*/;
+sc_Token.REFERENCE = 18/*REFERENCE*/;
+sc_Token.STORE = 19/*STORE*/;
+sc_Token.CHAR = 20/*CHAR*/;
+
+var SC_ID_CLASS = SC_LOWER_CLASS + SC_UPPER_CLASS + "!$%*+-./:<=>?@^_~";
+function sc_Tokenizer(port) {
+ this.port = port;
+}
+sc_Tokenizer.prototype.peekToken = function() {
+ if (this.peeked)
+ return this.peeked;
+ var newToken = this.nextToken();
+ this.peeked = newToken;
+ return newToken;
+};
+sc_Tokenizer.prototype.readToken = function() {
+ var tmp = this.peekToken();
+ delete this.peeked;
+ return tmp;
+};
+sc_Tokenizer.prototype.nextToken = function() {
+ var port = this.port;
+
+ function isNumberChar(c) {
+ return (c >= "0" && c <= "9");
+ };
+ function isIdOrNumberChar(c) {
+ return SC_ID_CLASS.indexOf(c) != -1 || // ID-char
+ (c >= "0" && c <= "9");
+ }
+ function isWhitespace(c) {
+ return c === " " || c === "\r" || c === "\n" || c === "\t" || c === "\f";
+ };
+ function isWhitespaceOrEOF(c) {
+ return isWhitespace(c) || c === SC_EOF_OBJECT;
+ };
+
+ function readString() {
+ res = "";
+ while (true) {
+ var c = port.readChar();
+ switch (c) {
+ case '"':
+ return new sc_Token(11/*STRING*/, res);
+ case "\\":
+ var tmp = port.readChar();
+ switch (tmp) {
+ case '0': res += "\0"; break;
+ case 'a': res += "\a"; break;
+ case 'b': res += "\b"; break;
+ case 'f': res += "\f"; break;
+ case 'n': res += "\n"; break;
+ case 'r': res += "\r"; break;
+ case 't': res += "\t"; break;
+ case 'v': res += "\v"; break;
+ case '"': res += '"'; break;
+ case '\\': res += '\\'; break;
+ case 'x':
+ /* hexa-number */
+ var nb = 0;
+ while (true) {
+ var hexC = port.peekChar();
+ if (hexC >= '0' && hexC <= '9') {
+ port.readChar();
+ nb = nb * 16 + hexC.charCodeAt(0) - '0'.charCodeAt(0);
+ } else if (hexC >= 'a' && hexC <= 'f') {
+ port.readChar();
+ nb = nb * 16 + hexC.charCodeAt(0) - 'a'.charCodeAt(0);
+ } else if (hexC >= 'A' && hexC <= 'F') {
+ port.readChar();
+ nb = nb * 16 + hexC.charCodeAt(0) - 'A'.charCodeAt(0);
+ } else {
+ // next char isn't part of hex.
+ res += String.fromCharCode(nb);
+ break;
+ }
+ }
+ break;
+ default:
+ if (tmp === SC_EOF_OBJECT) {
+ return new sc_Token(13/*ERROR*/, "unclosed string-literal" + res);
+ }
+ res += tmp;
+ }
+ break;
+ default:
+ if (c === SC_EOF_OBJECT) {
+ return new sc_Token(13/*ERROR*/, "unclosed string-literal" + res);
+ }
+ res += c;
+ }
+ }
+ };
+ function readIdOrNumber(firstChar) {
+ var res = firstChar;
+ while (isIdOrNumberChar(port.peekChar()))
+ res += port.readChar();
+ if (isNaN(res))
+ return new sc_Token(9/*ID*/, res);
+ else
+ return new sc_Token(12/*NUMBER*/, res - 0);
+ };
+
+ function skipWhitespaceAndComments() {
+ var done = false;
+ while (!done) {
+ done = true;
+ while (isWhitespace(port.peekChar()))
+ port.readChar();
+ if (port.peekChar() === ';') {
+ port.readChar();
+ done = false;
+ while (true) {
+ curChar = port.readChar();
+ if (curChar === SC_EOF_OBJECT ||
+ curChar === '\n')
+ break;
+ }
+ }
+ }
+ };
+
+ function readDot() {
+ if (isWhitespace(port.peekChar()))
+ return new sc_Token(10/*DOT*/);
+ else
+ return readIdOrNumber(".");
+ };
+
+ function readSharp() {
+ var c = port.readChar();
+ if (isWhitespace(c))
+ return new sc_Token(13/*ERROR*/, "bad #-pattern0.");
+
+ // reference
+ if (isNumberChar(c)) {
+ var nb = c - 0;
+ while (isNumberChar(port.peekChar()))
+ nb = nb*10 + (port.readChar() - 0);
+ switch (port.readChar()) {
+ case '#':
+ return new sc_Token(18/*REFERENCE*/, nb);
+ case '=':
+ return new sc_Token(19/*STORE*/, nb);
+ default:
+ return new sc_Token(13/*ERROR*/, "bad #-pattern1." + nb);
+ }
+ }
+
+ if (c === "(")
+ return new sc_Token(14/*VECTOR_BEGIN*/);
+
+ if (c === "\\") { // character
+ var tmp = ""
+ while (!isWhitespaceOrEOF(port.peekChar()))
+ tmp += port.readChar();
+ switch (tmp.length) {
+ case 0: // it's escaping a whitespace char:
+ if (sc_isEOFObject(port.peekChar))
+ return new sc_Token(13/*ERROR*/, "bad #-pattern2.");
+ else
+ return new sc_Token(20/*CHAR*/, port.readChar());
+ case 1:
+ return new sc_Token(20/*CHAR*/, tmp);
+ default:
+ var entry = sc_Char.readable2char[tmp.toLowerCase()];
+ if (entry)
+ return new sc_Token(20/*CHAR*/, entry);
+ else
+ return new sc_Token(13/*ERROR*/, "unknown character description: #\\" + tmp);
+ }
+ }
+
+ // some constants (#t, #f, #unspecified)
+ var res;
+ var needing;
+ switch (c) {
+ case 't': res = new sc_Token(15/*TRUE*/, true); needing = ""; break;
+ case 'f': res = new sc_Token(16/*FALSE*/, false); needing = ""; break;
+ case 'u': res = new sc_Token(17/*UNSPECIFIED*/, undefined); needing = "nspecified"; break;
+ default:
+ return new sc_Token(13/*ERROR*/, "bad #-pattern3: " + c);
+ }
+ while(true) {
+ c = port.peekChar();
+ if ((isWhitespaceOrEOF(c) || c === ')') &&
+ needing == "")
+ return res;
+ else if (isWhitespace(c) || needing == "")
+ return new sc_Token(13/*ERROR*/, "bad #-pattern4 " + c + " " + needing);
+ else if (needing.charAt(0) == c) {
+ port.readChar(); // consume
+ needing = needing.slice(1);
+ } else
+ return new sc_Token(13/*ERROR*/, "bad #-pattern5");
+ }
+
+ };
+
+ skipWhitespaceAndComments();
+ var curChar = port.readChar();
+ if (curChar === SC_EOF_OBJECT)
+ return new sc_Token(0/*EOF*/, curChar);
+ switch (curChar)
+ {
+ case " ":
+ case "\n":
+ case "\t":
+ return readWhitespace();
+ case "(":
+ return new sc_Token(1/*OPEN_PAR*/);
+ case ")":
+ return new sc_Token(2/*CLOSE_PAR*/);
+ case "{":
+ return new sc_Token(3/*OPEN_BRACE*/);
+ case "}":
+ return new sc_Token(4/*CLOSE_BRACE*/);
+ case "[":
+ return new sc_Token(5/*OPEN_BRACKET*/);
+ case "]":
+ return new sc_Token(6/*CLOSE_BRACKET*/);
+ case "'":
+ return new sc_Token(8/*QUOTE*/);
+ case "#":
+ return readSharp();
+ case ".":
+ return readDot();
+ case '"':
+ return readString();
+ default:
+ if (isIdOrNumberChar(curChar))
+ return readIdOrNumber(curChar);
+ throw "unexpected character: " + curChar;
+ }
+};
+
+function sc_Reader(tokenizer) {
+ this.tokenizer = tokenizer;
+ this.backref = new Array();
+}
+sc_Reader.prototype.read = function() {
+ function readList(listBeginType) {
+ function matchesPeer(open, close) {
+ return open === 1/*OPEN_PAR*/ && close === 2/*CLOSE_PAR*/
+ || open === 3/*OPEN_BRACE*/ && close === 4/*CLOSE_BRACE*/
+ || open === 5/*OPEN_BRACKET*/ && close === 6/*CLOSE_BRACKET*/;
+ };
+ var res = null;
+
+ while (true) {
+ var token = tokenizer.peekToken();
+
+ switch (token.type) {
+ case 2/*CLOSE_PAR*/:
+ case 4/*CLOSE_BRACE*/:
+ case 6/*CLOSE_BRACKET*/:
+ if (matchesPeer(listBeginType, token.type)) {
+ tokenizer.readToken(); // consume token
+ return sc_reverseBang(res);
+ } else
+ throw "closing par doesn't match: " + listBeginType
+ + " " + listEndType;
+
+ case 0/*EOF*/:
+ throw "unexpected end of file";
+
+ case 10/*DOT*/:
+ tokenizer.readToken(); // consume token
+ var cdr = this.read();
+ var par = tokenizer.readToken();
+ if (!matchesPeer(listBeginType, par.type))
+ throw "closing par doesn't match: " + listBeginType
+ + " " + par.type;
+ else
+ return sc_reverseAppendBang(res, cdr);
+
+
+ default:
+ res = sc_cons(this.read(), res);
+ }
+ }
+ };
+ function readQuote() {
+ return sc_cons("quote", sc_cons(this.read(), null));
+ };
+ function readVector() {
+ // opening-parenthesis is already consumed
+ var a = new Array();
+ while (true) {
+ var token = tokenizer.peekToken();
+ switch (token.type) {
+ case 2/*CLOSE_PAR*/:
+ tokenizer.readToken();
+ return a;
+
+ default:
+ a.push(this.read());
+ }
+ }
+ };
+
+ function storeRefence(nb) {
+ var tmp = this.read();
+ this.backref[nb] = tmp;
+ return tmp;
+ };
+
+ function readReference(nb) {
+ if (nb in this.backref)
+ return this.backref[nb];
+ else
+ throw "bad reference: " + nb;
+ };
+
+ var tokenizer = this.tokenizer;
+
+ var token = tokenizer.readToken();
+
+ // handle error
+ if (token.type === 13/*ERROR*/)
+ throw token.val;
+
+ switch (token.type) {
+ case 1/*OPEN_PAR*/:
+ case 3/*OPEN_BRACE*/:
+ case 5/*OPEN_BRACKET*/:
+ return readList.call(this, token.type);
+ case 8/*QUOTE*/:
+ return readQuote.call(this);
+ case 11/*STRING*/:
+ return sc_jsstring2string(token.val);
+ case 20/*CHAR*/:
+ return new sc_Char(token.val);
+ case 14/*VECTOR_BEGIN*/:
+ return readVector.call(this);
+ case 18/*REFERENCE*/:
+ return readReference.call(this, token.val);
+ case 19/*STORE*/:
+ return storeRefence.call(this, token.val);
+ case 9/*ID*/:
+ return sc_jsstring2symbol(token.val);
+ case 0/*EOF*/:
+ case 12/*NUMBER*/:
+ case 15/*TRUE*/:
+ case 16/*FALSE*/:
+ case 17/*UNSPECIFIED*/:
+ return token.val;
+ default:
+ throw "unexpected token " + token.type + " " + token.val;
+ }
+};
+
+/*** META ((export #t)) */
+function sc_read(port) {
+ if (port === undefined) // we assume the port hasn't been given.
+ port = SC_DEFAULT_IN; // THREAD: shared var...
+ var reader = new sc_Reader(new sc_Tokenizer(port));
+ return reader.read();
+}
+/*** META ((export #t)) */
+function sc_readChar(port) {
+ if (port === undefined) // we assume the port hasn't been given.
+ port = SC_DEFAULT_IN; // THREAD: shared var...
+ var t = port.readChar();
+ return t === SC_EOF_OBJECT? t: new sc_Char(t);
+}
+/*** META ((export #t)) */
+function sc_peekChar(port) {
+ if (port === undefined) // we assume the port hasn't been given.
+ port = SC_DEFAULT_IN; // THREAD: shared var...
+ var t = port.peekChar();
+ return t === SC_EOF_OBJECT? t: new sc_Char(t);
+}
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isCharReady(port) {
+ if (port === undefined) // we assume the port hasn't been given.
+ port = SC_DEFAULT_IN; // THREAD: shared var...
+ return port.isCharReady();
+}
+/*** META ((export #t)
+ (peephole (postfix ".close()")))
+*/
+function sc_closeInputPort(p) {
+ return p.close();
+}
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix " instanceof sc_InputPort")))
+*/
+function sc_isInputPort(o) {
+ return (o instanceof sc_InputPort);
+}
+
+/*** META ((export eof-object?)
+ (type bool)
+ (peephole (postfix " === SC_EOF_OBJECT")))
+*/
+function sc_isEOFObject(o) {
+ return o === SC_EOF_OBJECT;
+}
+
+/*** META ((export #t)
+ (peephole (hole 0 "SC_DEFAULT_IN")))
+*/
+function sc_currentInputPort() {
+ return SC_DEFAULT_IN;
+}
+
+/* ------------ file operations are not supported -----------*/
+/*** META ((export #t)) */
+function sc_callWithInputFile(s, proc) {
+ throw "can't open " + s;
+}
+
+/*** META ((export #t)) */
+function sc_callWithOutputFile(s, proc) {
+ throw "can't open " + s;
+}
+
+/*** META ((export #t)) */
+function sc_withInputFromFile(s, thunk) {
+ throw "can't open " + s;
+}
+
+/*** META ((export #t)) */
+function sc_withOutputToFile(s, thunk) {
+ throw "can't open " + s;
+}
+
+/*** META ((export #t)) */
+function sc_openInputFile(s) {
+ throw "can't open " + s;
+}
+
+/*** META ((export #t)) */
+function sc_openOutputFile(s) {
+ throw "can't open " + s;
+}
+
+/* ----------------------------------------------------------------------------*/
+/*** META ((export #t)) */
+function sc_basename(p) {
+ var i = p.lastIndexOf('/');
+
+ if(i >= 0)
+ return p.substring(i + 1, p.length);
+ else
+ return '';
+}
+
+/*** META ((export #t)) */
+function sc_dirname(p) {
+ var i = p.lastIndexOf('/');
+
+ if(i >= 0)
+ return p.substring(0, i);
+ else
+ return '';
+}
+
+/* ----------------------------------------------------------------------------*/
+
+/*** META ((export #t)) */
+function sc_withInputFromPort(p, thunk) {
+ try {
+ var tmp = SC_DEFAULT_IN; // THREAD: shared var.
+ SC_DEFAULT_IN = p;
+ return thunk();
+ } finally {
+ SC_DEFAULT_IN = tmp;
+ }
+}
+
+/*** META ((export #t)) */
+function sc_withInputFromString(s, thunk) {
+ return sc_withInputFromPort(new sc_StringInputPort(sc_string2jsstring(s)), thunk);
+}
+
+/*** META ((export #t)) */
+function sc_withOutputToPort(p, thunk) {
+ try {
+ var tmp = SC_DEFAULT_OUT; // THREAD: shared var.
+ SC_DEFAULT_OUT = p;
+ return thunk();
+ } finally {
+ SC_DEFAULT_OUT = tmp;
+ }
+}
+
+/*** META ((export #t)) */
+function sc_withOutputToString(thunk) {
+ var p = new sc_StringOutputPort();
+ sc_withOutputToPort(p, thunk);
+ return p.close();
+}
+
+/*** META ((export #t)) */
+function sc_withOutputToProcedure(proc, thunk) {
+ var t = function(s) { proc(sc_jsstring2string(s)); };
+ return sc_withOutputToPort(new sc_GenericOutputPort(t), thunk);
+}
+
+/*** META ((export #t)
+ (peephole (hole 0 "new sc_StringOutputPort()")))
+*/
+function sc_openOutputString() {
+ return new sc_StringOutputPort();
+}
+
+/*** META ((export #t)) */
+function sc_openInputString(str) {
+ return new sc_StringInputPort(sc_string2jsstring(str));
+}
+
+/* ----------------------------------------------------------------------------*/
+
+function sc_OutputPort() {
+}
+sc_OutputPort.prototype = new sc_Port();
+sc_OutputPort.prototype.appendJSString = function(obj) {
+ /* do nothing */
+}
+sc_OutputPort.prototype.close = function() {
+ /* do nothing */
+}
+
+function sc_StringOutputPort() {
+ this.res = "";
+}
+sc_StringOutputPort.prototype = new sc_OutputPort();
+sc_StringOutputPort.prototype.appendJSString = function(s) {
+ this.res += s;
+}
+sc_StringOutputPort.prototype.close = function() {
+ return sc_jsstring2string(this.res);
+}
+
+/*** META ((export #t)) */
+function sc_getOutputString(sp) {
+ return sc_jsstring2string(sp.res);
+}
+
+
+function sc_ErrorOutputPort() {
+}
+sc_ErrorOutputPort.prototype = new sc_OutputPort();
+sc_ErrorOutputPort.prototype.appendJSString = function(s) {
+ throw "don't write on ErrorPort!";
+}
+sc_ErrorOutputPort.prototype.close = function() {
+ /* do nothing */
+}
+
+function sc_GenericOutputPort(appendJSString, close) {
+ this.appendJSString = appendJSString;
+ if (close)
+ this.close = close;
+}
+sc_GenericOutputPort.prototype = new sc_OutputPort();
+
+/*** META ((export #t)
+ (type bool)
+ (peephole (postfix " instanceof sc_OutputPort")))
+*/
+function sc_isOutputPort(o) {
+ return (o instanceof sc_OutputPort);
+}
+
+/*** META ((export #t)
+ (peephole (postfix ".close()")))
+*/
+function sc_closeOutputPort(p) {
+ return p.close();
+}
+
+/* ------------------ write ---------------------------------------------------*/
+
+/*** META ((export #t)) */
+function sc_write(o, p) {
+ if (p === undefined) // we assume not given
+ p = SC_DEFAULT_OUT;
+ p.appendJSString(sc_toWriteString(o));
+}
+
+function sc_toWriteString(o) {
+ if (o === null)
+ return "()";
+ else if (o === true)
+ return "#t";
+ else if (o === false)
+ return "#f";
+ else if (o === undefined)
+ return "#unspecified";
+ else if (typeof o === 'function')
+ return "#<procedure " + sc_hash(o) + ">";
+ else if (o.sc_toWriteString)
+ return o.sc_toWriteString();
+ else
+ return o.toString();
+}
+
+function sc_escapeWriteString(s) {
+ var res = "";
+ var j = 0;
+ for (i = 0; i < s.length; i++) {
+ switch (s.charAt(i)) {
+ case "\0": res += s.substring(j, i) + "\\0"; j = i + 1; break;
+ case "\b": res += s.substring(j, i) + "\\b"; j = i + 1; break;
+ case "\f": res += s.substring(j, i) + "\\f"; j = i + 1; break;
+ case "\n": res += s.substring(j, i) + "\\n"; j = i + 1; break;
+ case "\r": res += s.substring(j, i) + "\\r"; j = i + 1; break;
+ case "\t": res += s.substring(j, i) + "\\t"; j = i + 1; break;
+ case "\v": res += s.substring(j, i) + "\\v"; j = i + 1; break;
+ case '"': res += s.substring(j, i) + '\\"'; j = i + 1; break;
+ case "\\": res += s.substring(j, i) + "\\\\"; j = i + 1; break;
+ default:
+ var c = s.charAt(i);
+ if ("\a" !== "a" && c == "\a") {
+ res += s.substring(j, i) + "\\a"; j = i + 1; continue;
+ }
+ if ("\v" !== "v" && c == "\v") {
+ res += s.substring(j, i) + "\\v"; j = i + 1; continue;
+ }
+ //if (s.charAt(i) < ' ' || s.charCodeAt(i) > 127) {
+ // CARE: Manuel is this OK with HOP?
+ if (s.charAt(i) < ' ') {
+ /* non printable character and special chars */
+ res += s.substring(j, i) + "\\x" + s.charCodeAt(i).toString(16);
+ j = i + 1;
+ }
+ // else just let i increase...
+ }
+ }
+ res += s.substring(j, i);
+ return res;
+}
+
+/* ------------------ display ---------------------------------------------------*/
+
+/*** META ((export #t)) */
+function sc_display(o, p) {
+ if (p === undefined) // we assume not given
+ p = SC_DEFAULT_OUT;
+ p.appendJSString(sc_toDisplayString(o));
+}
+
+function sc_toDisplayString(o) {
+ if (o === null)
+ return "()";
+ else if (o === true)
+ return "#t";
+ else if (o === false)
+ return "#f";
+ else if (o === undefined)
+ return "#unspecified";
+ else if (typeof o === 'function')
+ return "#<procedure " + sc_hash(o) + ">";
+ else if (o.sc_toDisplayString)
+ return o.sc_toDisplayString();
+ else
+ return o.toString();
+}
+
+/* ------------------ newline ---------------------------------------------------*/
+
+/*** META ((export #t)) */
+function sc_newline(p) {
+ if (p === undefined) // we assume not given
+ p = SC_DEFAULT_OUT;
+ p.appendJSString("\n");
+}
+
+/* ------------------ write-char ---------------------------------------------------*/
+
+/*** META ((export #t)) */
+function sc_writeChar(c, p) {
+ if (p === undefined) // we assume not given
+ p = SC_DEFAULT_OUT;
+ p.appendJSString(c.val);
+}
+
+/* ------------------ write-circle ---------------------------------------------------*/
+
+/*** META ((export #t)) */
+function sc_writeCircle(o, p) {
+ if (p === undefined) // we assume not given
+ p = SC_DEFAULT_OUT;
+ p.appendJSString(sc_toWriteCircleString(o));
+}
+
+function sc_toWriteCircleString(o) {
+ var symb = sc_gensym("writeCircle");
+ var nbPointer = new Object();
+ nbPointer.nb = 0;
+ sc_prepWriteCircle(o, symb, nbPointer);
+ return sc_genToWriteCircleString(o, symb);
+}
+
+function sc_prepWriteCircle(o, symb, nbPointer) {
+ // TODO sc_Struct
+ if (o instanceof sc_Pair ||
+ o instanceof sc_Vector) {
+ if (o[symb] !== undefined) {
+ // not the first visit.
+ o[symb]++;
+ // unless there is already a number, assign one.
+ if (!o[symb + "nb"]) o[symb + "nb"] = nbPointer.nb++;
+ return;
+ }
+ o[symb] = 0;
+ if (o instanceof sc_Pair) {
+ sc_prepWriteCircle(o.car, symb, nbPointer);
+ sc_prepWriteCircle(o.cdr, symb, nbPointer);
+ } else {
+ for (var i = 0; i < o.length; i++)
+ sc_prepWriteCircle(o[i], symb, nbPointer);
+ }
+ }
+}
+
+function sc_genToWriteCircleString(o, symb) {
+ if (!(o instanceof sc_Pair ||
+ o instanceof sc_Vector))
+ return sc_toWriteString(o);
+ return o.sc_toWriteCircleString(symb);
+}
+sc_Pair.prototype.sc_toWriteCircleString = function(symb, inList) {
+ if (this[symb + "use"]) { // use-flag is set. Just use it.
+ var nb = this[symb + "nb"];
+ if (this[symb]-- === 0) { // if we are the last use. remove all fields.
+ delete this[symb];
+ delete this[symb + "nb"];
+ delete this[symb + "use"];
+ }
+ if (inList)
+ return '. #' + nb + '#';
+ else
+ return '#' + nb + '#';
+ }
+ if (this[symb]-- === 0) { // if we are the last use. remove all fields.
+ delete this[symb];
+ delete this[symb + "nb"];
+ delete this[symb + "use"];
+ }
+
+ var res = "";
+
+ if (this[symb] !== undefined) { // implies > 0
+ this[symb + "use"] = true;
+ if (inList)
+ res += '. #' + this[symb + "nb"] + '=';
+ else
+ res += '#' + this[symb + "nb"] + '=';
+ inList = false;
+ }
+
+ if (!inList)
+ res += "(";
+
+ // print car
+ res += sc_genToWriteCircleString(this.car, symb);
+
+ if (sc_isPair(this.cdr)) {
+ res += " " + this.cdr.sc_toWriteCircleString(symb, true);
+ } else if (this.cdr !== null) {
+ res += " . " + sc_genToWriteCircleString(this.cdr, symb);
+ }
+ if (!inList)
+ res += ")";
+ return res;
+};
+sc_Vector.prototype.sc_toWriteCircleString = function(symb) {
+ if (this[symb + "use"]) { // use-flag is set. Just use it.
+ var nb = this[symb + "nb"];
+ if (this[symb]-- === 0) { // if we are the last use. remove all fields.
+ delete this[symb];
+ delete this[symb + "nb"];
+ delete this[symb + "use"];
+ }
+ return '#' + nb + '#';
+ }
+ if (this[symb]-- === 0) { // if we are the last use. remove all fields.
+ delete this[symb];
+ delete this[symb + "nb"];
+ delete this[symb + "use"];
+ }
+
+ var res = "";
+ if (this[symb] !== undefined) { // implies > 0
+ this[symb + "use"] = true;
+ res += '#' + this[symb + "nb"] + '=';
+ }
+ res += "#(";
+ for (var i = 0; i < this.length; i++) {
+ res += sc_genToWriteCircleString(this[i], symb);
+ if (i < this.length - 1) res += " ";
+ }
+ res += ")";
+ return res;
+};
+
+
+/* ------------------ print ---------------------------------------------------*/
+
+/*** META ((export #t)) */
+function sc_print(s) {
+ if (arguments.length === 1) {
+ sc_display(s);
+ sc_newline();
+ }
+ else {
+ for (var i = 0; i < arguments.length; i++)
+ sc_display(arguments[i]);
+ sc_newline();
+ }
+}
+
+/* ------------------ format ---------------------------------------------------*/
+/*** META ((export #t)) */
+function sc_format(s, args) {
+ var len = s.length;
+ var p = new sc_StringOutputPort();
+ var i = 0, j = 1;
+
+ while( i < len ) {
+ var i2 = s.indexOf("~", i);
+
+ if (i2 == -1) {
+ p.appendJSString( s.substring( i, len ) );
+ return p.close();
+ } else {
+ if (i2 > i) {
+ if (i2 == (len - 1)) {
+ p.appendJSString(s.substring(i, len));
+ return p.close();
+ } else {
+ p.appendJSString(s.substring(i, i2));
+ i = i2;
+ }
+ }
+
+ switch(s.charCodeAt(i2 + 1)) {
+ case 65:
+ case 97:
+ // a
+ sc_display(arguments[j], p);
+ i += 2; j++;
+ break;
+
+ case 83:
+ case 115:
+ // s
+ sc_write(arguments[j], p);
+ i += 2; j++;
+ break;
+
+ case 86:
+ case 118:
+ // v
+ sc_display(arguments[j], p);
+ p.appendJSString("\n");
+ i += 2; j++;
+ break;
+
+ case 67:
+ case 99:
+ // c
+ p.appendJSString(String.fromCharCode(arguments[j]));
+ i += 2; j++;
+ break;
+
+ case 88:
+ case 120:
+ // x
+ p.appendJSString(arguments[j].toString(6));
+ i += 2; j++;
+ break;
+
+ case 79:
+ case 111:
+ // o
+ p.appendJSString(arguments[j].toString(8));
+ i += 2; j++;
+ break;
+
+ case 66:
+ case 98:
+ // b
+ p.appendJSString(arguments[j].toString(2));
+ i += 2; j++;
+ break;
+
+ case 37:
+ case 110:
+ // %, n
+ p.appendJSString("\n");
+ i += 2; break;
+
+ case 114:
+ // r
+ p.appendJSString("\r");
+ i += 2; break;
+
+ case 126:
+ // ~
+ p.appendJSString("~");
+ i += 2; break;
+
+ default:
+ sc_error( "format: illegal ~"
+ + String.fromCharCode(s.charCodeAt(i2 + 1))
+ + " sequence" );
+ return "";
+ }
+ }
+ }
+
+ return p.close();
+}
+
+/* ------------------ global ports ---------------------------------------------------*/
+
+var SC_DEFAULT_IN = new sc_ErrorInputPort();
+var SC_DEFAULT_OUT = new sc_ErrorOutputPort();
+var SC_ERROR_OUT = new sc_ErrorOutputPort();
+
+var sc_SYMBOL_PREFIX = "\u1E9C";
+var sc_KEYWORD_PREFIX = "\u1E9D";
+
+/*** META ((export #t)
+ (peephole (id))) */
+function sc_jsstring2string(s) {
+ return s;
+}
+
+/*** META ((export #t)
+ (peephole (prefix "'\\u1E9C' +")))
+*/
+function sc_jsstring2symbol(s) {
+ return sc_SYMBOL_PREFIX + s;
+}
+
+/*** META ((export #t)
+ (peephole (id)))
+*/
+function sc_string2jsstring(s) {
+ return s;
+}
+
+/*** META ((export #t)
+ (peephole (symbol2jsstring_immutable)))
+*/
+function sc_symbol2jsstring(s) {
+ return s.slice(1);
+}
+
+/*** META ((export #t)
+ (peephole (postfix ".slice(1)")))
+*/
+function sc_keyword2jsstring(k) {
+ return k.slice(1);
+}
+
+/*** META ((export #t)
+ (peephole (prefix "'\\u1E9D' +")))
+*/
+function sc_jsstring2keyword(s) {
+ return sc_KEYWORD_PREFIX + s;
+}
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isKeyword(s) {
+ return (typeof s === "string") &&
+ (s.charAt(0) === sc_KEYWORD_PREFIX);
+}
+
+
+/*** META ((export #t)) */
+var sc_gensym = function() {
+ var counter = 1000;
+ return function(sym) {
+ counter++;
+ if (!sym) sym = sc_SYMBOL_PREFIX;
+ return sym + "s" + counter + "~" + "^sC-GeNsYm ";
+ };
+}();
+
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isEqual(o1, o2) {
+ return ((o1 === o2) ||
+ (sc_isPair(o1) && sc_isPair(o2)
+ && sc_isPairEqual(o1, o2, sc_isEqual)) ||
+ (sc_isVector(o1) && sc_isVector(o2)
+ && sc_isVectorEqual(o1, o2, sc_isEqual)));
+}
+
+/*** META ((export number->symbol integer->symbol)) */
+function sc_number2symbol(x, radix) {
+ return sc_SYMBOL_PREFIX + sc_number2jsstring(x, radix);
+}
+
+/*** META ((export number->string integer->string)) */
+var sc_number2string = sc_number2jsstring;
+
+/*** META ((export #t)) */
+function sc_symbol2number(s, radix) {
+ return sc_jsstring2number(s.slice(1), radix);
+}
+
+/*** META ((export #t)) */
+var sc_string2number = sc_jsstring2number;
+
+/*** META ((export #t)
+ (peephole (prefix "+" s)))
+ ;; peephole will only apply if no radix is given.
+*/
+function sc_string2integer(s, radix) {
+ if (!radix) return +s;
+ return parseInt(s, radix);
+}
+
+/*** META ((export #t)
+ (peephole (prefix "+")))
+*/
+function sc_string2real(s) {
+ return +s;
+}
+
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isSymbol(s) {
+ return (typeof s === "string") &&
+ (s.charAt(0) === sc_SYMBOL_PREFIX);
+}
+
+/*** META ((export #t)
+ (peephole (symbol2string_immutable)))
+*/
+function sc_symbol2string(s) {
+ return s.slice(1);
+}
+
+/*** META ((export #t)
+ (peephole (prefix "'\\u1E9C' +")))
+*/
+function sc_string2symbol(s) {
+ return sc_SYMBOL_PREFIX + s;
+}
+
+/*** META ((export symbol-append)
+ (peephole (symbolAppend_immutable)))
+*/
+function sc_symbolAppend() {
+ var res = sc_SYMBOL_PREFIX;
+ for (var i = 0; i < arguments.length; i++)
+ res += arguments[i].slice(1);
+ return res;
+}
+
+/*** META ((export #t)
+ (peephole (postfix ".val")))
+*/
+function sc_char2string(c) { return c.val; }
+
+/*** META ((export #t)
+ (peephole (hole 1 "'\\u1E9C' + " c ".val")))
+*/
+function sc_char2symbol(c) { return sc_SYMBOL_PREFIX + c.val; }
+
+/*** META ((export #t)
+ (type bool))
+*/
+function sc_isString(s) {
+ return (typeof s === "string") &&
+ (s.charAt(0) !== sc_SYMBOL_PREFIX);
+}
+
+/*** META ((export #t)) */
+var sc_makeString = sc_makejsString;
+
+
+/*** META ((export #t)) */
+function sc_string() {
+ for (var i = 0; i < arguments.length; i++)
+ arguments[i] = arguments[i].val;
+ return "".concat.apply("", arguments);
+}
+
+/*** META ((export #t)
+ (peephole (postfix ".length")))
+*/
+function sc_stringLength(s) { return s.length; }
+
+/*** META ((export #t)) */
+function sc_stringRef(s, k) {
+ return new sc_Char(s.charAt(k));
+}
+
+/* there's no stringSet in the immutable version
+function sc_stringSet(s, k, c)
+*/
+
+
+/*** META ((export string=?)
+ (type bool)
+ (peephole (hole 2 str1 " === " str2)))
+*/
+function sc_isStringEqual(s1, s2) {
+ return s1 === s2;
+}
+/*** META ((export string<?)
+ (type bool)
+ (peephole (hole 2 str1 " < " str2)))
+*/
+function sc_isStringLess(s1, s2) {
+ return s1 < s2;
+}
+/*** META ((export string>?)
+ (type bool)
+ (peephole (hole 2 str1 " > " str2)))
+*/
+function sc_isStringGreater(s1, s2) {
+ return s1 > s2;
+}
+/*** META ((export string<=?)
+ (type bool)
+ (peephole (hole 2 str1 " <= " str2)))
+*/
+function sc_isStringLessEqual(s1, s2) {
+ return s1 <= s2;
+}
+/*** META ((export string>=?)
+ (type bool)
+ (peephole (hole 2 str1 " >= " str2)))
+*/
+function sc_isStringGreaterEqual(s1, s2) {
+ return s1 >= s2;
+}
+/*** META ((export string-ci=?)
+ (type bool)
+ (peephole (hole 2 str1 ".toLowerCase() === " str2 ".toLowerCase()")))
+*/
+function sc_isStringCIEqual(s1, s2) {
+ return s1.toLowerCase() === s2.toLowerCase();
+}
+/*** META ((export string-ci<?)
+ (type bool)
+ (peephole (hole 2 str1 ".toLowerCase() < " str2 ".toLowerCase()")))
+*/
+function sc_isStringCILess(s1, s2) {
+ return s1.toLowerCase() < s2.toLowerCase();
+}
+/*** META ((export string-ci>?)
+ (type bool)
+ (peephole (hole 2 str1 ".toLowerCase() > " str2 ".toLowerCase()")))
+*/
+function sc_isStringCIGreater(s1, s2) {
+ return s1.toLowerCase() > s2.toLowerCase();
+}
+/*** META ((export string-ci<=?)
+ (type bool)
+ (peephole (hole 2 str1 ".toLowerCase() <= " str2 ".toLowerCase()")))
+*/
+function sc_isStringCILessEqual(s1, s2) {
+ return s1.toLowerCase() <= s2.toLowerCase();
+}
+/*** META ((export string-ci>=?)
+ (type bool)
+ (peephole (hole 2 str1 ".toLowerCase() >= " str2 ".toLowerCase()")))
+*/
+function sc_isStringCIGreaterEqual(s1, s2) {
+ return s1.toLowerCase() >= s2.toLowerCase();
+}
+
+/*** META ((export #t)
+ (peephole (hole 3 s ".substring(" start ", " end ")")))
+*/
+function sc_substring(s, start, end) {
+ return s.substring(start, end);
+}
+
+/*** META ((export #t))
+*/
+function sc_isSubstring_at(s1, s2, i) {
+ return s2 == s1.substring(i, i+ s2.length);
+}
+
+/*** META ((export #t)
+ (peephole (infix 0 #f "+" "''")))
+*/
+function sc_stringAppend() {
+ return "".concat.apply("", arguments);
+}
+
+/*** META ((export #t)) */
+var sc_string2list = sc_jsstring2list;
+
+/*** META ((export #t)) */
+var sc_list2string = sc_list2jsstring;
+
+/*** META ((export #t)
+ (peephole (id)))
+*/
+function sc_stringCopy(s) {
+ return s;
+}
+
+/* there's no string-fill in the immutable version
+function sc_stringFill(s, c)
+*/
+
+/*** META ((export #t)
+ (peephole (postfix ".slice(1)")))
+*/
+function sc_keyword2string(o) {
+ return o.slice(1);
+}
+
+/*** META ((export #t)
+ (peephole (prefix "'\\u1E9D' +")))
+*/
+function sc_string2keyword(o) {
+ return sc_KEYWORD_PREFIX + o;
+}
+
+String.prototype.sc_toDisplayString = function() {
+ if (this.charAt(0) === sc_SYMBOL_PREFIX)
+ // TODO: care for symbols with spaces (escape-chars symbols).
+ return this.slice(1);
+ else if (this.charAt(0) === sc_KEYWORD_PREFIX)
+ return ":" + this.slice(1);
+ else
+ return this.toString();
+};
+
+String.prototype.sc_toWriteString = function() {
+ if (this.charAt(0) === sc_SYMBOL_PREFIX)
+ // TODO: care for symbols with spaces (escape-chars symbols).
+ return this.slice(1);
+ else if (this.charAt(0) === sc_KEYWORD_PREFIX)
+ return ":" + this.slice(1);
+ else
+ return '"' + sc_escapeWriteString(this) + '"';
+};
+/* Exported Variables */
+var BgL_testzd2boyerzd2;
+var BgL_nboyerzd2benchmarkzd2;
+var BgL_setupzd2boyerzd2;
+/* End Exports */
+
+var translate_term_nboyer;
+var translate_args_nboyer;
+var untranslate_term_nboyer;
+var BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer;
+var BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer;
+var translate_alist_nboyer;
+var apply_subst_nboyer;
+var apply_subst_lst_nboyer;
+var tautologyp_nboyer;
+var if_constructor_nboyer;
+var rewrite_count_nboyer;
+var rewrite_nboyer;
+var rewrite_args_nboyer;
+var unify_subst_nboyer;
+var one_way_unify1_nboyer;
+var false_term_nboyer;
+var true_term_nboyer;
+var trans_of_implies1_nboyer;
+var is_term_equal_nboyer;
+var is_term_member_nboyer;
+var const_nboyer;
+var sc_const_3_nboyer;
+var sc_const_4_nboyer;
+{
+ (sc_const_4_nboyer = (new sc_Pair("\u1E9Cimplies",(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cu",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cu",(new sc_Pair("\u1E9Cw",null)))))),null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cw",null)))))),null)))))));
+ (sc_const_3_nboyer = sc_list((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccompile",(new sc_Pair("\u1E9Cform",null)))),(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair((new sc_Pair("\u1E9Ccodegen",(new sc_Pair((new sc_Pair("\u1E9Coptimize",(new sc_Pair("\u1E9Cform",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ceqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreaterp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clesseqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatereqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cboolean",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ciff",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ceven1",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Codd",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccountps-",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Cpred",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccountps-loop",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Cpred",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfact-",(new sc_Pair("\u1E9Ci",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfact-loop",(new sc_Pair("\u1E9Ci",(new sc_Pair((1),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse-",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Creverse-loop",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdivides",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cassume-true",(new sc_Pair("\u1E9Cvar",(new sc_Pair("\u1E9Calist",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cvar",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))),(new sc_Pair("\u1E9Calist",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cassume-false",(new sc_Pair("\u1E9Cvar",(new sc_Pair("\u1E9Calist",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cvar",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))),(new sc_Pair("\u1E9Calist",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctautology-checker",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ctautologyp",(new sc_Pair((new sc_Pair("\u1E9Cnormalize",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfalsify",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfalsify1",(new sc_Pair((new sc_Pair("\u1E9Cnormalize",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cprime",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))),null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cprime1",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Cx",null)))),null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair("\u1E9Cp",(new sc_Pair("\u1E9Cq",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cq",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair("\u1E9Cp",(new sc_Pair("\u1E9Cq",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cq",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair("\u1E9Cp",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cp",(new sc_Pair("\u1E9Cq",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cq",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))))),(new sc_Pair("\u1E9Cd",(new sc_Pair("\u1E9Ce",null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cd",(new sc_Pair("\u1E9Ce",null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cd",(new sc_Pair("\u1E9Ce",null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Ca",null)))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cb",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cc",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair("\u1E9Ca",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair((new sc_Pair("\u1E9Cplus-fringe",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Ca",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cexec",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cpds",(new sc_Pair("\u1E9Cenvrn",null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cexec",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cexec",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cpds",(new sc_Pair("\u1E9Cenvrn",null)))))))),(new sc_Pair("\u1E9Cenvrn",null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmc-flatten",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Cy",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cb",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cy",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Cintersect",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Ck",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Ck",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Ck",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),(new sc_Pair("\u1E9Ck",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse-loop",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Cy",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse-loop",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccount-list",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Csort-lp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Ccount-list",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccount-list",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cbig-plus1",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair("\u1E9Ci",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cbig-plus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cbase",null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Ci",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cj",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cj",(new sc_Pair((1),null)))))),null)))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cpower-rep",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Ci",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cbig-plus",(new sc_Pair((new sc_Pair("\u1E9Cpower-rep",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cpower-rep",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair("\u1E9Cbase",null)))))))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair("\u1E9Cb",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Ca",null)))),null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cy",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cy",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cw",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cw",(new sc_Pair("\u1E9Cx",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cb",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cy",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cz",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cvalue",(new sc_Pair((new sc_Pair("\u1E9Cnormalize",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cvalue",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnlistp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair((new sc_Pair("\u1E9Cgopher",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csamefringe",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatest-factor",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatest-factor",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((1),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((1),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair((new sc_Pair("\u1E9Cgreatest-factor",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes-list",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Ctimes-list",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ctimes-list",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cprime-list",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cprime-list",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cprime-list",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cw",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cz",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cw",(new sc_Pair((1),null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatereqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((1),null)))))),(new sc_Pair(sc_list("\u1E9Cand", (new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))), (new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cb",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))), (new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Ca",null)))), (new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cb",null)))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Ca",null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cl",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cl",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cl",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csort2",(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cl",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Csort2",(new sc_Pair("\u1E9Cl",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdsort",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Csort2",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx1",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx2",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx3",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx4",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx5",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx6",(new sc_Pair("\u1E9Cx7",null)))))),null)))))),null)))))),null)))))),null)))))),null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((6),(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cx7",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((2),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((2),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair("\u1E9Cy",(new sc_Pair((2),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csigma",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Ci",null)))),null)))))),(new sc_Pair((2),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cy",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cx",null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cz",null)))),null)))))),null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair("\u1E9Ca",null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cy",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Ci",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clast",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Clast",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Ca",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Ccar",(new sc_Pair((new sc_Pair("\u1E9Clast",(new sc_Pair("\u1E9Ca",null)))),null)))),(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair("\u1E9Cb",null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),(new sc_Pair("\u1E9Cz",null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cassignment",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cassignedp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cassignment",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cassignment",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cb",null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccar",(new sc_Pair((new sc_Pair("\u1E9Cgopher",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccar",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair((new sc_Pair("\u1E9Ccdr",(new sc_Pair((new sc_Pair("\u1E9Cgopher",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccdr",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cget",(new sc_Pair("\u1E9Cj",(new sc_Pair((new sc_Pair("\u1E9Cset",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cval",(new sc_Pair("\u1E9Cmem",null)))))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Ceqp",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair("\u1E9Cval",(new sc_Pair((new sc_Pair("\u1E9Cget",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Cmem",null)))))),null)))))))),null))))))));
+ (const_nboyer = (new sc_Pair((new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cf",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cc",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cf",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cd",null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cf",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cu",(new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cw",(new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cb",null)))),null)))))),null)))))))),null)))))))))));
+ BgL_nboyerzd2benchmarkzd2 = function() {
+ var args = null;
+ for (var sc_tmp = arguments.length - 1; sc_tmp >= 0; sc_tmp--) {
+ args = sc_cons(arguments[sc_tmp], args);
+ }
+ var n;
+ return ((n = ((args === null)?(0):(args.car))), (BgL_setupzd2boyerzd2()), (BgL_runzd2benchmarkzd2(("nboyer"+(sc_number2string(n))), (1), function() {
+ return (BgL_testzd2boyerzd2(n));
+ }, function(rewrites) {
+ if ((sc_isNumber(rewrites)))
+ switch (n) {
+ case (0):
+ return (rewrites===(95024));
+ break;
+ case (1):
+ return (rewrites===(591777));
+ break;
+ case (2):
+ return (rewrites===(1813975));
+ break;
+ case (3):
+ return (rewrites===(5375678));
+ break;
+ case (4):
+
+ return (rewrites===(16445406));
+ break;
+ case (5):
+ return (rewrites===(51507739));
+ break;
+ default:
+ return true;
+ break;
+ }
+ else
+ return false;
+ })));
+ };
+ BgL_setupzd2boyerzd2 = function() {
+ return true;
+ };
+ BgL_testzd2boyerzd2 = function() {
+ return true;
+ };
+ translate_term_nboyer = function(term) {
+ var lst;
+ return (!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), ((lst = (term.cdr)), ((lst === null)?null:(new sc_Pair((translate_term_nboyer((lst.car))), (translate_args_nboyer((lst.cdr))))))))));
+ };
+ translate_args_nboyer = function(lst) {
+ var sc_lst_5;
+ var term;
+ return ((lst === null)?null:(new sc_Pair(((term = (lst.car)), (!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), (translate_args_nboyer((term.cdr))))))), ((sc_lst_5 = (lst.cdr)), ((sc_lst_5 === null)?null:(new sc_Pair((translate_term_nboyer((sc_lst_5.car))), (translate_args_nboyer((sc_lst_5.cdr))))))))));
+ };
+ untranslate_term_nboyer = function(term) {
+ var optrOpnd;
+ var tail1131;
+ var L1127;
+ var falseHead1130;
+ var symbol_record;
+ if (!(term instanceof sc_Pair))
+ return term;
+ else
+ {
+ (falseHead1130 = (new sc_Pair(null, null)));
+ (L1127 = (term.cdr));
+ (tail1131 = falseHead1130);
+ while (!(L1127 === null)) {
+ {
+ (tail1131.cdr = (new sc_Pair((untranslate_term_nboyer((L1127.car))), null)));
+ (tail1131 = (tail1131.cdr));
+ (L1127 = (L1127.cdr));
+ }
+ }
+ (optrOpnd = (falseHead1130.cdr));
+ return (new sc_Pair(((symbol_record = (term.car)), (symbol_record[(0)])), optrOpnd));
+ }
+ };
+ BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer = function(sym) {
+ var r;
+ var x;
+ return ((x = (sc_assq(sym, BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer))), ((x!== false)?(x.cdr):((r = [sym, null]), (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = (new sc_Pair((new sc_Pair(sym, r)), BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer))), r)));
+ };
+ (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = null);
+ translate_alist_nboyer = function(alist) {
+ var sc_alist_6;
+ var term;
+ return ((alist === null)?null:(new sc_Pair((new sc_Pair((alist.car.car), ((term = (alist.car.cdr)), (!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), (translate_args_nboyer((term.cdr))))))))), ((sc_alist_6 = (alist.cdr)), ((sc_alist_6 === null)?null:(new sc_Pair((new sc_Pair((sc_alist_6.car.car), (translate_term_nboyer((sc_alist_6.car.cdr))))), (translate_alist_nboyer((sc_alist_6.cdr))))))))));
+ };
+ apply_subst_nboyer = function(alist, term) {
+ var lst;
+ var temp_temp;
+ return (!(term instanceof sc_Pair)?((temp_temp = (sc_assq(term, alist))), ((temp_temp!== false)?(temp_temp.cdr):term)):(new sc_Pair((term.car), ((lst = (term.cdr)), ((lst === null)?null:(new sc_Pair((apply_subst_nboyer(alist, (lst.car))), (apply_subst_lst_nboyer(alist, (lst.cdr))))))))));
+ };
+ apply_subst_lst_nboyer = function(alist, lst) {
+ var sc_lst_7;
+ return ((lst === null)?null:(new sc_Pair((apply_subst_nboyer(alist, (lst.car))), ((sc_lst_7 = (lst.cdr)), ((sc_lst_7 === null)?null:(new sc_Pair((apply_subst_nboyer(alist, (sc_lst_7.car))), (apply_subst_lst_nboyer(alist, (sc_lst_7.cdr))))))))));
+ };
+ tautologyp_nboyer = function(sc_x_11, true_lst, false_lst) {
+ var tmp1125;
+ var x;
+ var tmp1126;
+ var sc_x_8;
+ var sc_tmp1125_9;
+ var sc_tmp1126_10;
+ var sc_x_11;
+ var true_lst;
+ var false_lst;
+ while (true) {
+ if ((((sc_tmp1126_10 = (is_term_equal_nboyer(sc_x_11, true_term_nboyer))), ((sc_tmp1126_10!== false)?sc_tmp1126_10:(is_term_member_nboyer(sc_x_11, true_lst))))!== false))
+ return true;
+ else
+ if ((((sc_tmp1125_9 = (is_term_equal_nboyer(sc_x_11, false_term_nboyer))), ((sc_tmp1125_9!== false)?sc_tmp1125_9:(is_term_member_nboyer(sc_x_11, false_lst))))!== false))
+ return false;
+ else
+ if (!(sc_x_11 instanceof sc_Pair))
+ return false;
+ else
+ if (((sc_x_11.car)===if_constructor_nboyer))
+ if ((((sc_x_8 = (sc_x_11.cdr.car)), (tmp1126 = (is_term_equal_nboyer(sc_x_8, true_term_nboyer))), ((tmp1126!== false)?tmp1126:(is_term_member_nboyer(sc_x_8, true_lst))))!== false))
+ (sc_x_11 = (sc_x_11.cdr.cdr.car));
+ else
+ if ((((x = (sc_x_11.cdr.car)), (tmp1125 = (is_term_equal_nboyer(x, false_term_nboyer))), ((tmp1125!== false)?tmp1125:(is_term_member_nboyer(x, false_lst))))!== false))
+ (sc_x_11 = (sc_x_11.cdr.cdr.cdr.car));
+ else
+ if (((tautologyp_nboyer((sc_x_11.cdr.cdr.car), (new sc_Pair((sc_x_11.cdr.car), true_lst)), false_lst))!== false))
+ {
+ (false_lst = (new sc_Pair((sc_x_11.cdr.car), false_lst)));
+ (sc_x_11 = (sc_x_11.cdr.cdr.cdr.car));
+ }
+ else
+ return false;
+ else
+ return false;
+ }
+ };
+ (if_constructor_nboyer = "\u1E9C*");
+ (rewrite_count_nboyer = (0));
+ rewrite_nboyer = function(term) {
+ var term2;
+ var sc_term_12;
+ var lst;
+ var symbol_record;
+ var sc_lst_13;
+ {
+ (++rewrite_count_nboyer);
+ if (!(term instanceof sc_Pair))
+ return term;
+ else
+ {
+ (sc_term_12 = (new sc_Pair((term.car), ((sc_lst_13 = (term.cdr)), ((sc_lst_13 === null)?null:(new sc_Pair((rewrite_nboyer((sc_lst_13.car))), (rewrite_args_nboyer((sc_lst_13.cdr))))))))));
+ (lst = ((symbol_record = (term.car)), (symbol_record[(1)])));
+ while (true) {
+ if ((lst === null))
+ return sc_term_12;
+ else
+ if ((((term2 = ((lst.car).cdr.car)), (unify_subst_nboyer = null), (one_way_unify1_nboyer(sc_term_12, term2)))!== false))
+ return (rewrite_nboyer((apply_subst_nboyer(unify_subst_nboyer, ((lst.car).cdr.cdr.car)))));
+ else
+ (lst = (lst.cdr));
+ }
+ }
+ }
+ };
+ rewrite_args_nboyer = function(lst) {
+ var sc_lst_14;
+ return ((lst === null)?null:(new sc_Pair((rewrite_nboyer((lst.car))), ((sc_lst_14 = (lst.cdr)), ((sc_lst_14 === null)?null:(new sc_Pair((rewrite_nboyer((sc_lst_14.car))), (rewrite_args_nboyer((sc_lst_14.cdr))))))))));
+ };
+ (unify_subst_nboyer = "\u1E9C*");
+ one_way_unify1_nboyer = function(term1, term2) {
+ var lst1;
+ var lst2;
+ var temp_temp;
+ if (!(term2 instanceof sc_Pair))
+ {
+ (temp_temp = (sc_assq(term2, unify_subst_nboyer)));
+ if ((temp_temp!== false))
+ return (is_term_equal_nboyer(term1, (temp_temp.cdr)));
+ else
+ if ((sc_isNumber(term2)))
+ return (sc_isEqual(term1, term2));
+ else
+ {
+ (unify_subst_nboyer = (new sc_Pair((new sc_Pair(term2, term1)), unify_subst_nboyer)));
+ return true;
+ }
+ }
+ else
+ if (!(term1 instanceof sc_Pair))
+ return false;
+ else
+ if (((term1.car)===(term2.car)))
+ {
+ (lst1 = (term1.cdr));
+ (lst2 = (term2.cdr));
+ while (true) {
+ if ((lst1 === null))
+ return (lst2 === null);
+ else
+ if ((lst2 === null))
+ return false;
+ else
+ if (((one_way_unify1_nboyer((lst1.car), (lst2.car)))!== false))
+ {
+ (lst1 = (lst1.cdr));
+ (lst2 = (lst2.cdr));
+ }
+ else
+ return false;
+ }
+ }
+ else
+ return false;
+ };
+ (false_term_nboyer = "\u1E9C*");
+ (true_term_nboyer = "\u1E9C*");
+ trans_of_implies1_nboyer = function(n) {
+ var sc_n_15;
+ return ((sc_isEqual(n, (1)))?(sc_list("\u1E9Cimplies", (0), (1))):(sc_list("\u1E9Cand", (sc_list("\u1E9Cimplies", (n-(1)), n)), ((sc_n_15 = (n-(1))), ((sc_isEqual(sc_n_15, (1)))?(sc_list("\u1E9Cimplies", (0), (1))):(sc_list("\u1E9Cand", (sc_list("\u1E9Cimplies", (sc_n_15-(1)), sc_n_15)), (trans_of_implies1_nboyer((sc_n_15-(1)))))))))));
+ };
+ is_term_equal_nboyer = function(x, y) {
+ var lst1;
+ var lst2;
+ var r2;
+ var r1;
+ if ((x instanceof sc_Pair))
+ if ((y instanceof sc_Pair))
+ if ((((r1 = (x.car)), (r2 = (y.car)), (r1===r2))!== false))
+ {
+ (lst1 = (x.cdr));
+ (lst2 = (y.cdr));
+ while (true) {
+ if ((lst1 === null))
+ return (lst2 === null);
+ else
+ if ((lst2 === null))
+ return false;
+ else
+ if (((is_term_equal_nboyer((lst1.car), (lst2.car)))!== false))
+ {
+ (lst1 = (lst1.cdr));
+ (lst2 = (lst2.cdr));
+ }
+ else
+ return false;
+ }
+ }
+ else
+ return false;
+ else
+ return false;
+ else
+ return (sc_isEqual(x, y));
+ };
+ is_term_member_nboyer = function(x, lst) {
+ var x;
+ var lst;
+ while (true) {
+ if ((lst === null))
+ return false;
+ else
+ if (((is_term_equal_nboyer(x, (lst.car)))!== false))
+ return true;
+ else
+ (lst = (lst.cdr));
+ }
+ };
+ BgL_setupzd2boyerzd2 = function() {
+ var symbol_record;
+ var value;
+ var BgL_sc_symbolzd2record_16zd2;
+ var sym;
+ var sc_sym_17;
+ var term;
+ var lst;
+ var sc_term_18;
+ var sc_term_19;
+ {
+ (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = null);
+ (if_constructor_nboyer = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer("\u1E9Cif")));
+ (false_term_nboyer = ((sc_term_19 = (new sc_Pair("\u1E9Cf",null))), (!(sc_term_19 instanceof sc_Pair)?sc_term_19:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((sc_term_19.car))), (translate_args_nboyer((sc_term_19.cdr))))))));
+ (true_term_nboyer = ((sc_term_18 = (new sc_Pair("\u1E9Ct",null))), (!(sc_term_18 instanceof sc_Pair)?sc_term_18:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((sc_term_18.car))), (translate_args_nboyer((sc_term_18.cdr))))))));
+ (lst = sc_const_3_nboyer);
+ while (!(lst === null)) {
+ {
+ (term = (lst.car));
+ if (((term instanceof sc_Pair)&&(((term.car)==="\u1E9Cequal")&&((term.cdr.car) instanceof sc_Pair))))
+ {
+ (sc_sym_17 = ((term.cdr.car).car));
+ (value = (new sc_Pair((!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), (translate_args_nboyer((term.cdr)))))), ((sym = ((term.cdr.car).car)), (BgL_sc_symbolzd2record_16zd2 = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer(sym))), (BgL_sc_symbolzd2record_16zd2[(1)])))));
+ (symbol_record = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer(sc_sym_17)));
+ (symbol_record[(1)] = value);
+ }
+ else
+ (sc_error("ADD-LEMMA did not like term: ", term));
+ (lst = (lst.cdr));
+ }
+ }
+ return true;
+ }
+ };
+ BgL_testzd2boyerzd2 = function(n) {
+ var optrOpnd;
+ var term;
+ var sc_n_20;
+ var answer;
+ var sc_term_21;
+ var sc_term_22;
+ {
+ (rewrite_count_nboyer = (0));
+ (term = sc_const_4_nboyer);
+ (sc_n_20 = n);
+ while (!(sc_n_20=== 0)) {
+ {
+ (term = (sc_list("\u1E9Cor", term, (new sc_Pair("\u1E9Cf",null)))));
+ (--sc_n_20);
+ }
+ }
+ (sc_term_22 = term);
+ if (!(sc_term_22 instanceof sc_Pair))
+ (optrOpnd = sc_term_22);
+ else
+ (optrOpnd = (new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((sc_term_22.car))), (translate_args_nboyer((sc_term_22.cdr))))));
+ (sc_term_21 = (apply_subst_nboyer(((const_nboyer === null)?null:(new sc_Pair((new sc_Pair((const_nboyer.car.car), (translate_term_nboyer((const_nboyer.car.cdr))))), (translate_alist_nboyer((const_nboyer.cdr)))))), optrOpnd)));
+ (answer = (tautologyp_nboyer((rewrite_nboyer(sc_term_21)), null, null)));
+ (sc_write(rewrite_count_nboyer));
+ (sc_display(" rewrites"));
+ (sc_newline());
+ if ((answer!== false))
+ return rewrite_count_nboyer;
+ else
+ return false;
+ }
+ };
+}
+/* Exported Variables */
+var BgL_parsezd2ze3nbzd2treesze3;
+var BgL_earleyzd2benchmarkzd2;
+var BgL_parsezd2ze3parsedzf3zc2;
+var test;
+var BgL_parsezd2ze3treesz31;
+var BgL_makezd2parserzd2;
+/* End Exports */
+
+var const_earley;
+{
+ (const_earley = (new sc_Pair((new sc_Pair("\u1E9Cs",(new sc_Pair((new sc_Pair("\u1E9Ca",null)),(new sc_Pair((new sc_Pair("\u1E9Cs",(new sc_Pair("\u1E9Cs",null)))),null)))))),null)));
+ BgL_makezd2parserzd2 = function(grammar, lexer) {
+ var i;
+ var parser_descr;
+ var def_loop;
+ var nb_nts;
+ var names;
+ var steps;
+ var predictors;
+ var enders;
+ var starters;
+ var nts;
+ var sc_names_1;
+ var sc_steps_2;
+ var sc_predictors_3;
+ var sc_enders_4;
+ var sc_starters_5;
+ var nb_confs;
+ var BgL_sc_defzd2loop_6zd2;
+ var BgL_sc_nbzd2nts_7zd2;
+ var sc_nts_8;
+ var BgL_sc_defzd2loop_9zd2;
+ var ind;
+ {
+ ind = function(nt, sc_nts_10) {
+ var i;
+ {
+ (i = ((sc_nts_10.length)-(1)));
+ while (true) {
+ if ((i>=(0)))
+ if ((sc_isEqual((sc_nts_10[i]), nt)))
+ return i;
+ else
+ (--i);
+ else
+ return false;
+ }
+ }
+ };
+ (sc_nts_8 = ((BgL_sc_defzd2loop_9zd2 = function(defs, sc_nts_11) {
+ var rule_loop;
+ var head;
+ var def;
+ return ((defs instanceof sc_Pair)?((def = (defs.car)), (head = (def.car)), (rule_loop = function(rules, sc_nts_12) {
+ var nt;
+ var l;
+ var sc_nts_13;
+ var rule;
+ if ((rules instanceof sc_Pair))
+ {
+ (rule = (rules.car));
+ (l = rule);
+ (sc_nts_13 = sc_nts_12);
+ while ((l instanceof sc_Pair)) {
+ {
+ (nt = (l.car));
+ (l = (l.cdr));
+ (sc_nts_13 = (((sc_member(nt, sc_nts_13))!== false)?sc_nts_13:(new sc_Pair(nt, sc_nts_13))));
+ }
+ }
+ return (rule_loop((rules.cdr), sc_nts_13));
+ }
+ else
+ return (BgL_sc_defzd2loop_9zd2((defs.cdr), sc_nts_12));
+ }), (rule_loop((def.cdr), (((sc_member(head, sc_nts_11))!== false)?sc_nts_11:(new sc_Pair(head, sc_nts_11)))))):(sc_list2vector((sc_reverse(sc_nts_11)))));
+ }), (BgL_sc_defzd2loop_9zd2(grammar, null))));
+ (BgL_sc_nbzd2nts_7zd2 = (sc_nts_8.length));
+ (nb_confs = (((BgL_sc_defzd2loop_6zd2 = function(defs, BgL_sc_nbzd2confs_14zd2) {
+ var rule_loop;
+ var def;
+ return ((defs instanceof sc_Pair)?((def = (defs.car)), (rule_loop = function(rules, BgL_sc_nbzd2confs_15zd2) {
+ var l;
+ var BgL_sc_nbzd2confs_16zd2;
+ var rule;
+ if ((rules instanceof sc_Pair))
+ {
+ (rule = (rules.car));
+ (l = rule);
+ (BgL_sc_nbzd2confs_16zd2 = BgL_sc_nbzd2confs_15zd2);
+ while ((l instanceof sc_Pair)) {
+ {
+ (l = (l.cdr));
+ (++BgL_sc_nbzd2confs_16zd2);
+ }
+ }
+ return (rule_loop((rules.cdr), (BgL_sc_nbzd2confs_16zd2+(1))));
+ }
+ else
+ return (BgL_sc_defzd2loop_6zd2((defs.cdr), BgL_sc_nbzd2confs_15zd2));
+ }), (rule_loop((def.cdr), BgL_sc_nbzd2confs_14zd2))):BgL_sc_nbzd2confs_14zd2);
+ }), (BgL_sc_defzd2loop_6zd2(grammar, (0))))+BgL_sc_nbzd2nts_7zd2));
+ (sc_starters_5 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null)));
+ (sc_enders_4 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null)));
+ (sc_predictors_3 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null)));
+ (sc_steps_2 = (sc_makeVector(nb_confs, false)));
+ (sc_names_1 = (sc_makeVector(nb_confs, false)));
+ (nts = sc_nts_8);
+ (starters = sc_starters_5);
+ (enders = sc_enders_4);
+ (predictors = sc_predictors_3);
+ (steps = sc_steps_2);
+ (names = sc_names_1);
+ (nb_nts = (sc_nts_8.length));
+ (i = (nb_nts-(1)));
+ while ((i>=(0))) {
+ {
+ (sc_steps_2[i] = (i-nb_nts));
+ (sc_names_1[i] = (sc_list((sc_nts_8[i]), (0))));
+ (sc_enders_4[i] = (sc_list(i)));
+ (--i);
+ }
+ }
+ def_loop = function(defs, conf) {
+ var rule_loop;
+ var head;
+ var def;
+ return ((defs instanceof sc_Pair)?((def = (defs.car)), (head = (def.car)), (rule_loop = function(rules, conf, rule_num) {
+ var i;
+ var sc_i_17;
+ var nt;
+ var l;
+ var sc_conf_18;
+ var sc_i_19;
+ var rule;
+ if ((rules instanceof sc_Pair))
+ {
+ (rule = (rules.car));
+ (names[conf] = (sc_list(head, rule_num)));
+ (sc_i_19 = (ind(head, nts)));
+ (starters[sc_i_19] = (new sc_Pair(conf, (starters[sc_i_19]))));
+ (l = rule);
+ (sc_conf_18 = conf);
+ while ((l instanceof sc_Pair)) {
+ {
+ (nt = (l.car));
+ (steps[sc_conf_18] = (ind(nt, nts)));
+ (sc_i_17 = (ind(nt, nts)));
+ (predictors[sc_i_17] = (new sc_Pair(sc_conf_18, (predictors[sc_i_17]))));
+ (l = (l.cdr));
+ (++sc_conf_18);
+ }
+ }
+ (steps[sc_conf_18] = ((ind(head, nts))-nb_nts));
+ (i = (ind(head, nts)));
+ (enders[i] = (new sc_Pair(sc_conf_18, (enders[i]))));
+ return (rule_loop((rules.cdr), (sc_conf_18+(1)), (rule_num+(1))));
+ }
+ else
+ return (def_loop((defs.cdr), conf));
+ }), (rule_loop((def.cdr), conf, (1)))):undefined);
+ };
+ (def_loop(grammar, (sc_nts_8.length)));
+ (parser_descr = [lexer, sc_nts_8, sc_starters_5, sc_enders_4, sc_predictors_3, sc_steps_2, sc_names_1]);
+ return function(input) {
+ var optrOpnd;
+ var sc_optrOpnd_20;
+ var sc_optrOpnd_21;
+ var sc_optrOpnd_22;
+ var loop1;
+ var BgL_sc_stateza2_23za2;
+ var toks;
+ var BgL_sc_nbzd2nts_24zd2;
+ var sc_steps_25;
+ var sc_enders_26;
+ var state_num;
+ var BgL_sc_statesza2_27za2;
+ var states;
+ var i;
+ var conf;
+ var l;
+ var tok_nts;
+ var sc_i_28;
+ var sc_i_29;
+ var l1;
+ var l2;
+ var tok;
+ var tail1129;
+ var L1125;
+ var goal_enders;
+ var BgL_sc_statesza2_30za2;
+ var BgL_sc_nbzd2nts_31zd2;
+ var BgL_sc_nbzd2confs_32zd2;
+ var nb_toks;
+ var goal_starters;
+ var sc_states_33;
+ var BgL_sc_nbzd2confs_34zd2;
+ var BgL_sc_nbzd2toks_35zd2;
+ var sc_toks_36;
+ var falseHead1128;
+ var sc_names_37;
+ var sc_steps_38;
+ var sc_predictors_39;
+ var sc_enders_40;
+ var sc_starters_41;
+ var sc_nts_42;
+ var lexer;
+ var sc_ind_43;
+ var make_states;
+ var BgL_sc_confzd2setzd2getza2_44za2;
+ var conf_set_merge_new_bang;
+ var conf_set_adjoin;
+ var BgL_sc_confzd2setzd2adjoinza2_45za2;
+ var BgL_sc_confzd2setzd2adjoinza2za2_46z00;
+ var conf_set_union;
+ var forw;
+ var is_parsed;
+ var deriv_trees;
+ var BgL_sc_derivzd2treesza2_47z70;
+ var nb_deriv_trees;
+ var BgL_sc_nbzd2derivzd2treesza2_48za2;
+ {
+ sc_ind_43 = function(nt, sc_nts_49) {
+ var i;
+ {
+ (i = ((sc_nts_49.length)-(1)));
+ while (true) {
+ if ((i>=(0)))
+ if ((sc_isEqual((sc_nts_49[i]), nt)))
+ return i;
+ else
+ (--i);
+ else
+ return false;
+ }
+ }
+ };
+ make_states = function(BgL_sc_nbzd2toks_50zd2, BgL_sc_nbzd2confs_51zd2) {
+ var v;
+ var i;
+ var sc_states_52;
+ {
+ (sc_states_52 = (sc_makeVector((BgL_sc_nbzd2toks_50zd2+(1)), false)));
+ (i = BgL_sc_nbzd2toks_50zd2);
+ while ((i>=(0))) {
+ {
+ (v = (sc_makeVector((BgL_sc_nbzd2confs_51zd2+(1)), false)));
+ (v[(0)] = (-1));
+ (sc_states_52[i] = v);
+ (--i);
+ }
+ }
+ return sc_states_52;
+ }
+ };
+ BgL_sc_confzd2setzd2getza2_44za2 = function(state, BgL_sc_statezd2num_53zd2, sc_conf_54) {
+ var conf_set;
+ var BgL_sc_confzd2set_55zd2;
+ return ((BgL_sc_confzd2set_55zd2 = (state[(sc_conf_54+(1))])), ((BgL_sc_confzd2set_55zd2!== false)?BgL_sc_confzd2set_55zd2:((conf_set = (sc_makeVector((BgL_sc_statezd2num_53zd2+(6)), false))), (conf_set[(1)] = (-3)), (conf_set[(2)] = (-1)), (conf_set[(3)] = (-1)), (conf_set[(4)] = (-1)), (state[(sc_conf_54+(1))] = conf_set), conf_set)));
+ };
+ conf_set_merge_new_bang = function(conf_set) {
+ return ((conf_set[((conf_set[(1)])+(5))] = (conf_set[(4)])), (conf_set[(1)] = (conf_set[(3)])), (conf_set[(3)] = (-1)), (conf_set[(4)] = (-1)));
+ };
+ conf_set_adjoin = function(state, conf_set, sc_conf_56, i) {
+ var tail;
+ return ((tail = (conf_set[(3)])), (conf_set[(i+(5))] = (-1)), (conf_set[(tail+(5))] = i), (conf_set[(3)] = i), ((tail<(0))?((conf_set[(0)] = (state[(0)])), (state[(0)] = sc_conf_56)):undefined));
+ };
+ BgL_sc_confzd2setzd2adjoinza2_45za2 = function(sc_states_57, BgL_sc_statezd2num_58zd2, l, i) {
+ var conf_set;
+ var sc_conf_59;
+ var l1;
+ var state;
+ {
+ (state = (sc_states_57[BgL_sc_statezd2num_58zd2]));
+ (l1 = l);
+ while ((l1 instanceof sc_Pair)) {
+ {
+ (sc_conf_59 = (l1.car));
+ (conf_set = (BgL_sc_confzd2setzd2getza2_44za2(state, BgL_sc_statezd2num_58zd2, sc_conf_59)));
+ if (((conf_set[(i+(5))])=== false))
+ {
+ (conf_set_adjoin(state, conf_set, sc_conf_59, i));
+ (l1 = (l1.cdr));
+ }
+ else
+ (l1 = (l1.cdr));
+ }
+ }
+ return undefined;
+ }
+ };
+ BgL_sc_confzd2setzd2adjoinza2za2_46z00 = function(sc_states_60, BgL_sc_statesza2_61za2, BgL_sc_statezd2num_62zd2, sc_conf_63, i) {
+ var BgL_sc_confzd2setza2_64z70;
+ var BgL_sc_stateza2_65za2;
+ var conf_set;
+ var state;
+ return ((state = (sc_states_60[BgL_sc_statezd2num_62zd2])), ((((conf_set = (state[(sc_conf_63+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)?((BgL_sc_stateza2_65za2 = (BgL_sc_statesza2_61za2[BgL_sc_statezd2num_62zd2])), (BgL_sc_confzd2setza2_64z70 = (BgL_sc_confzd2setzd2getza2_44za2(BgL_sc_stateza2_65za2, BgL_sc_statezd2num_62zd2, sc_conf_63))), (((BgL_sc_confzd2setza2_64z70[(i+(5))])=== false)?(conf_set_adjoin(BgL_sc_stateza2_65za2, BgL_sc_confzd2setza2_64z70, sc_conf_63, i)):undefined), true):false));
+ };
+ conf_set_union = function(state, conf_set, sc_conf_66, other_set) {
+ var i;
+ {
+ (i = (other_set[(2)]));
+ while ((i>=(0))) {
+ if (((conf_set[(i+(5))])=== false))
+ {
+ (conf_set_adjoin(state, conf_set, sc_conf_66, i));
+ (i = (other_set[(i+(5))]));
+ }
+ else
+ (i = (other_set[(i+(5))]));
+ }
+ return undefined;
+ }
+ };
+ forw = function(sc_states_67, BgL_sc_statezd2num_68zd2, sc_starters_69, sc_enders_70, sc_predictors_71, sc_steps_72, sc_nts_73) {
+ var next_set;
+ var next;
+ var conf_set;
+ var ender;
+ var l;
+ var starter_set;
+ var starter;
+ var sc_l_74;
+ var sc_loop1_75;
+ var head;
+ var BgL_sc_confzd2set_76zd2;
+ var BgL_sc_statezd2num_77zd2;
+ var state;
+ var sc_states_78;
+ var preds;
+ var BgL_sc_confzd2set_79zd2;
+ var step;
+ var sc_conf_80;
+ var BgL_sc_nbzd2nts_81zd2;
+ var sc_state_82;
+ {
+ (sc_state_82 = (sc_states_67[BgL_sc_statezd2num_68zd2]));
+ (BgL_sc_nbzd2nts_81zd2 = (sc_nts_73.length));
+ while (true) {
+ {
+ (sc_conf_80 = (sc_state_82[(0)]));
+ if ((sc_conf_80>=(0)))
+ {
+ (step = (sc_steps_72[sc_conf_80]));
+ (BgL_sc_confzd2set_79zd2 = (sc_state_82[(sc_conf_80+(1))]));
+ (head = (BgL_sc_confzd2set_79zd2[(4)]));
+ (sc_state_82[(0)] = (BgL_sc_confzd2set_79zd2[(0)]));
+ (conf_set_merge_new_bang(BgL_sc_confzd2set_79zd2));
+ if ((step>=(0)))
+ {
+ (sc_l_74 = (sc_starters_69[step]));
+ while ((sc_l_74 instanceof sc_Pair)) {
+ {
+ (starter = (sc_l_74.car));
+ (starter_set = (BgL_sc_confzd2setzd2getza2_44za2(sc_state_82, BgL_sc_statezd2num_68zd2, starter)));
+ if (((starter_set[(BgL_sc_statezd2num_68zd2+(5))])=== false))
+ {
+ (conf_set_adjoin(sc_state_82, starter_set, starter, BgL_sc_statezd2num_68zd2));
+ (sc_l_74 = (sc_l_74.cdr));
+ }
+ else
+ (sc_l_74 = (sc_l_74.cdr));
+ }
+ }
+ (l = (sc_enders_70[step]));
+ while ((l instanceof sc_Pair)) {
+ {
+ (ender = (l.car));
+ if ((((conf_set = (sc_state_82[(ender+(1))])), ((conf_set!== false)?(conf_set[(BgL_sc_statezd2num_68zd2+(5))]):false))!== false))
+ {
+ (next = (sc_conf_80+(1)));
+ (next_set = (BgL_sc_confzd2setzd2getza2_44za2(sc_state_82, BgL_sc_statezd2num_68zd2, next)));
+ (conf_set_union(sc_state_82, next_set, next, BgL_sc_confzd2set_79zd2));
+ (l = (l.cdr));
+ }
+ else
+ (l = (l.cdr));
+ }
+ }
+ }
+ else
+ {
+ (preds = (sc_predictors_71[(step+BgL_sc_nbzd2nts_81zd2)]));
+ (sc_states_78 = sc_states_67);
+ (state = sc_state_82);
+ (BgL_sc_statezd2num_77zd2 = BgL_sc_statezd2num_68zd2);
+ (BgL_sc_confzd2set_76zd2 = BgL_sc_confzd2set_79zd2);
+ sc_loop1_75 = function(l) {
+ var sc_state_83;
+ var BgL_sc_nextzd2set_84zd2;
+ var sc_next_85;
+ var pred_set;
+ var i;
+ var pred;
+ if ((l instanceof sc_Pair))
+ {
+ (pred = (l.car));
+ (i = head);
+ while ((i>=(0))) {
+ {
+ (pred_set = ((sc_state_83 = (sc_states_78[i])), (sc_state_83[(pred+(1))])));
+ if ((pred_set!== false))
+ {
+ (sc_next_85 = (pred+(1)));
+ (BgL_sc_nextzd2set_84zd2 = (BgL_sc_confzd2setzd2getza2_44za2(state, BgL_sc_statezd2num_77zd2, sc_next_85)));
+ (conf_set_union(state, BgL_sc_nextzd2set_84zd2, sc_next_85, pred_set));
+ }
+ (i = (BgL_sc_confzd2set_76zd2[(i+(5))]));
+ }
+ }
+ return (sc_loop1_75((l.cdr)));
+ }
+ else
+ return undefined;
+ };
+ (sc_loop1_75(preds));
+ }
+ }
+ else
+ return undefined;
+ }
+ }
+ }
+ };
+ is_parsed = function(nt, i, j, sc_nts_86, sc_enders_87, sc_states_88) {
+ var conf_set;
+ var state;
+ var sc_conf_89;
+ var l;
+ var BgL_sc_ntza2_90za2;
+ {
+ (BgL_sc_ntza2_90za2 = (sc_ind_43(nt, sc_nts_86)));
+ if ((BgL_sc_ntza2_90za2!== false))
+ {
+ (sc_nts_86.length);
+ (l = (sc_enders_87[BgL_sc_ntza2_90za2]));
+ while (true) {
+ if ((l instanceof sc_Pair))
+ {
+ (sc_conf_89 = (l.car));
+ if ((((state = (sc_states_88[j])), (conf_set = (state[(sc_conf_89+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))
+ return true;
+ else
+ (l = (l.cdr));
+ }
+ else
+ return false;
+ }
+ }
+ else
+ return false;
+ }
+ };
+ deriv_trees = function(sc_conf_91, i, j, sc_enders_92, sc_steps_93, sc_names_94, sc_toks_95, sc_states_96, BgL_sc_nbzd2nts_97zd2) {
+ var sc_loop1_98;
+ var prev;
+ var name;
+ return ((name = (sc_names_94[sc_conf_91])), ((name!== false)?((sc_conf_91<BgL_sc_nbzd2nts_97zd2)?(sc_list((sc_list(name, ((sc_toks_95[i]).car))))):(sc_list((sc_list(name))))):((prev = (sc_conf_91-(1))), (sc_loop1_98 = function(l1, l2) {
+ var loop2;
+ var ender_set;
+ var state;
+ var ender;
+ var l1;
+ var l2;
+ while (true) {
+ if ((l1 instanceof sc_Pair))
+ {
+ (ender = (l1.car));
+ (ender_set = ((state = (sc_states_96[j])), (state[(ender+(1))])));
+ if ((ender_set!== false))
+ {
+ loop2 = function(k, l2) {
+ var loop3;
+ var ender_trees;
+ var prev_trees;
+ var conf_set;
+ var sc_state_99;
+ var k;
+ var l2;
+ while (true) {
+ if ((k>=(0)))
+ if (((k>=i)&&(((sc_state_99 = (sc_states_96[k])), (conf_set = (sc_state_99[(prev+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)))
+ {
+ (prev_trees = (deriv_trees(prev, i, k, sc_enders_92, sc_steps_93, sc_names_94, sc_toks_95, sc_states_96, BgL_sc_nbzd2nts_97zd2)));
+ (ender_trees = (deriv_trees(ender, k, j, sc_enders_92, sc_steps_93, sc_names_94, sc_toks_95, sc_states_96, BgL_sc_nbzd2nts_97zd2)));
+ loop3 = function(l3, l2) {
+ var l4;
+ var sc_l2_100;
+ var ender_tree;
+ if ((l3 instanceof sc_Pair))
+ {
+ (ender_tree = (sc_list((l3.car))));
+ (l4 = prev_trees);
+ (sc_l2_100 = l2);
+ while ((l4 instanceof sc_Pair)) {
+ {
+ (sc_l2_100 = (new sc_Pair((sc_append((l4.car), ender_tree)), sc_l2_100)));
+ (l4 = (l4.cdr));
+ }
+ }
+ return (loop3((l3.cdr), sc_l2_100));
+ }
+ else
+ return (loop2((ender_set[(k+(5))]), l2));
+ };
+ return (loop3(ender_trees, l2));
+ }
+ else
+ (k = (ender_set[(k+(5))]));
+ else
+ return (sc_loop1_98((l1.cdr), l2));
+ }
+ };
+ return (loop2((ender_set[(2)]), l2));
+ }
+ else
+ (l1 = (l1.cdr));
+ }
+ else
+ return l2;
+ }
+ }), (sc_loop1_98((sc_enders_92[(sc_steps_93[prev])]), null)))));
+ };
+ BgL_sc_derivzd2treesza2_47z70 = function(nt, i, j, sc_nts_101, sc_enders_102, sc_steps_103, sc_names_104, sc_toks_105, sc_states_106) {
+ var conf_set;
+ var state;
+ var sc_conf_107;
+ var l;
+ var trees;
+ var BgL_sc_nbzd2nts_108zd2;
+ var BgL_sc_ntza2_109za2;
+ {
+ (BgL_sc_ntza2_109za2 = (sc_ind_43(nt, sc_nts_101)));
+ if ((BgL_sc_ntza2_109za2!== false))
+ {
+ (BgL_sc_nbzd2nts_108zd2 = (sc_nts_101.length));
+ (l = (sc_enders_102[BgL_sc_ntza2_109za2]));
+ (trees = null);
+ while ((l instanceof sc_Pair)) {
+ {
+ (sc_conf_107 = (l.car));
+ if ((((state = (sc_states_106[j])), (conf_set = (state[(sc_conf_107+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))
+ {
+ (l = (l.cdr));
+ (trees = (sc_append((deriv_trees(sc_conf_107, i, j, sc_enders_102, sc_steps_103, sc_names_104, sc_toks_105, sc_states_106, BgL_sc_nbzd2nts_108zd2)), trees)));
+ }
+ else
+ (l = (l.cdr));
+ }
+ }
+ return trees;
+ }
+ else
+ return false;
+ }
+ };
+ nb_deriv_trees = function(sc_conf_110, i, j, sc_enders_111, sc_steps_112, sc_toks_113, sc_states_114, BgL_sc_nbzd2nts_115zd2) {
+ var sc_loop1_116;
+ var tmp1124;
+ var prev;
+ return ((prev = (sc_conf_110-(1))), ((((tmp1124 = (sc_conf_110<BgL_sc_nbzd2nts_115zd2)), ((tmp1124!== false)?tmp1124:((sc_steps_112[prev])<(0))))!== false)?(1):((sc_loop1_116 = function(l, sc_n_118) {
+ var nb_ender_trees;
+ var nb_prev_trees;
+ var conf_set;
+ var state;
+ var k;
+ var n;
+ var ender_set;
+ var sc_state_117;
+ var ender;
+ var l;
+ var sc_n_118;
+ while (true) {
+ if ((l instanceof sc_Pair))
+ {
+ (ender = (l.car));
+ (ender_set = ((sc_state_117 = (sc_states_114[j])), (sc_state_117[(ender+(1))])));
+ if ((ender_set!== false))
+ {
+ (k = (ender_set[(2)]));
+ (n = sc_n_118);
+ while ((k>=(0))) {
+ if (((k>=i)&&(((state = (sc_states_114[k])), (conf_set = (state[(prev+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)))
+ {
+ (nb_prev_trees = (nb_deriv_trees(prev, i, k, sc_enders_111, sc_steps_112, sc_toks_113, sc_states_114, BgL_sc_nbzd2nts_115zd2)));
+ (nb_ender_trees = (nb_deriv_trees(ender, k, j, sc_enders_111, sc_steps_112, sc_toks_113, sc_states_114, BgL_sc_nbzd2nts_115zd2)));
+ (k = (ender_set[(k+(5))]));
+ (n +=(nb_prev_trees*nb_ender_trees));
+ }
+ else
+ (k = (ender_set[(k+(5))]));
+ }
+ return (sc_loop1_116((l.cdr), n));
+ }
+ else
+ (l = (l.cdr));
+ }
+ else
+ return sc_n_118;
+ }
+ }), (sc_loop1_116((sc_enders_111[(sc_steps_112[prev])]), (0))))));
+ };
+ BgL_sc_nbzd2derivzd2treesza2_48za2 = function(nt, i, j, sc_nts_119, sc_enders_120, sc_steps_121, sc_toks_122, sc_states_123) {
+ var conf_set;
+ var state;
+ var sc_conf_124;
+ var l;
+ var nb_trees;
+ var BgL_sc_nbzd2nts_125zd2;
+ var BgL_sc_ntza2_126za2;
+ {
+ (BgL_sc_ntza2_126za2 = (sc_ind_43(nt, sc_nts_119)));
+ if ((BgL_sc_ntza2_126za2!== false))
+ {
+ (BgL_sc_nbzd2nts_125zd2 = (sc_nts_119.length));
+ (l = (sc_enders_120[BgL_sc_ntza2_126za2]));
+ (nb_trees = (0));
+ while ((l instanceof sc_Pair)) {
+ {
+ (sc_conf_124 = (l.car));
+ if ((((state = (sc_states_123[j])), (conf_set = (state[(sc_conf_124+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))
+ {
+ (l = (l.cdr));
+ (nb_trees = ((nb_deriv_trees(sc_conf_124, i, j, sc_enders_120, sc_steps_121, sc_toks_122, sc_states_123, BgL_sc_nbzd2nts_125zd2))+nb_trees));
+ }
+ else
+ (l = (l.cdr));
+ }
+ }
+ return nb_trees;
+ }
+ else
+ return false;
+ }
+ };
+ (lexer = (parser_descr[(0)]));
+ (sc_nts_42 = (parser_descr[(1)]));
+ (sc_starters_41 = (parser_descr[(2)]));
+ (sc_enders_40 = (parser_descr[(3)]));
+ (sc_predictors_39 = (parser_descr[(4)]));
+ (sc_steps_38 = (parser_descr[(5)]));
+ (sc_names_37 = (parser_descr[(6)]));
+ (falseHead1128 = (new sc_Pair(null, null)));
+ (L1125 = (lexer(input)));
+ (tail1129 = falseHead1128);
+ while (!(L1125 === null)) {
+ {
+ (tok = (L1125.car));
+ (l1 = (tok.cdr));
+ (l2 = null);
+ while ((l1 instanceof sc_Pair)) {
+ {
+ (sc_i_29 = (sc_ind_43((l1.car), sc_nts_42)));
+ if ((sc_i_29!== false))
+ {
+ (l1 = (l1.cdr));
+ (l2 = (new sc_Pair(sc_i_29, l2)));
+ }
+ else
+ (l1 = (l1.cdr));
+ }
+ }
+ (sc_optrOpnd_22 = (new sc_Pair((tok.car), (sc_reverse(l2)))));
+ (sc_optrOpnd_21 = (new sc_Pair(sc_optrOpnd_22, null)));
+ (tail1129.cdr = sc_optrOpnd_21);
+ (tail1129 = (tail1129.cdr));
+ (L1125 = (L1125.cdr));
+ }
+ }
+ (sc_optrOpnd_20 = (falseHead1128.cdr));
+ (sc_toks_36 = (sc_list2vector(sc_optrOpnd_20)));
+ (BgL_sc_nbzd2toks_35zd2 = (sc_toks_36.length));
+ (BgL_sc_nbzd2confs_34zd2 = (sc_steps_38.length));
+ (sc_states_33 = (make_states(BgL_sc_nbzd2toks_35zd2, BgL_sc_nbzd2confs_34zd2)));
+ (goal_starters = (sc_starters_41[(0)]));
+ (BgL_sc_confzd2setzd2adjoinza2_45za2(sc_states_33, (0), goal_starters, (0)));
+ (forw(sc_states_33, (0), sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_nts_42));
+ (sc_i_28 = (0));
+ while ((sc_i_28<BgL_sc_nbzd2toks_35zd2)) {
+ {
+ (tok_nts = ((sc_toks_36[sc_i_28]).cdr));
+ (BgL_sc_confzd2setzd2adjoinza2_45za2(sc_states_33, (sc_i_28+(1)), tok_nts, sc_i_28));
+ (forw(sc_states_33, (sc_i_28+(1)), sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_nts_42));
+ (++sc_i_28);
+ }
+ }
+ (nb_toks = (sc_toks_36.length));
+ (BgL_sc_nbzd2confs_32zd2 = (sc_steps_38.length));
+ (BgL_sc_nbzd2nts_31zd2 = (sc_nts_42.length));
+ (BgL_sc_statesza2_30za2 = (make_states(nb_toks, BgL_sc_nbzd2confs_32zd2)));
+ (goal_enders = (sc_enders_40[(0)]));
+ (l = goal_enders);
+ while ((l instanceof sc_Pair)) {
+ {
+ (conf = (l.car));
+ (BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_33, BgL_sc_statesza2_30za2, nb_toks, conf, (0)));
+ (l = (l.cdr));
+ }
+ }
+ (i = nb_toks);
+ while ((i>=(0))) {
+ {
+ (states = sc_states_33);
+ (BgL_sc_statesza2_27za2 = BgL_sc_statesza2_30za2);
+ (state_num = i);
+
+ (sc_enders_26 = sc_enders_40);
+ (sc_steps_25 = sc_steps_38);
+ (BgL_sc_nbzd2nts_24zd2 = BgL_sc_nbzd2nts_31zd2);
+ (toks = sc_toks_36);
+ (BgL_sc_stateza2_23za2 = (BgL_sc_statesza2_30za2[i]));
+ loop1 = function() {
+ var sc_loop1_127;
+ var prev;
+ var BgL_sc_statesza2_128za2;
+ var sc_states_129;
+ var j;
+ var i;
+ var sc_i_130;
+ var head;
+ var conf_set;
+ var sc_conf_131;
+ {
+ (sc_conf_131 = (BgL_sc_stateza2_23za2[(0)]));
+ if ((sc_conf_131>=(0)))
+ {
+ (conf_set = (BgL_sc_stateza2_23za2[(sc_conf_131+(1))]));
+ (head = (conf_set[(4)]));
+ (BgL_sc_stateza2_23za2[(0)] = (conf_set[(0)]));
+ (conf_set_merge_new_bang(conf_set));
+ (sc_i_130 = head);
+ while ((sc_i_130>=(0))) {
+ {
+ (i = sc_i_130);
+ (j = state_num);
+ (sc_states_129 = states);
+ (BgL_sc_statesza2_128za2 = BgL_sc_statesza2_27za2);
+ (prev = (sc_conf_131-(1)));
+ if (((sc_conf_131>=BgL_sc_nbzd2nts_24zd2)&&((sc_steps_25[prev])>=(0))))
+ {
+ sc_loop1_127 = function(l) {
+ var k;
+ var ender_set;
+ var state;
+ var ender;
+ var l;
+ while (true) {
+ if ((l instanceof sc_Pair))
+ {
+ (ender = (l.car));
+ (ender_set = ((state = (sc_states_129[j])), (state[(ender+(1))])));
+ if ((ender_set!== false))
+ {
+ (k = (ender_set[(2)]));
+ while ((k>=(0))) {
+ {
+ if ((k>=i))
+ if (((BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_129, BgL_sc_statesza2_128za2, k, prev, i))!== false))
+ (BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_129, BgL_sc_statesza2_128za2, j, ender, k));
+ (k = (ender_set[(k+(5))]));
+ }
+ }
+ return (sc_loop1_127((l.cdr)));
+ }
+ else
+ (l = (l.cdr));
+ }
+ else
+ return undefined;
+ }
+ };
+ (sc_loop1_127((sc_enders_26[(sc_steps_25[prev])])));
+ }
+ (sc_i_130 = (conf_set[(sc_i_130+(5))]));
+ }
+ }
+ return (loop1());
+ }
+ else
+ return undefined;
+ }
+ };
+ (loop1());
+ (--i);
+ }
+ }
+ (optrOpnd = BgL_sc_statesza2_30za2);
+ return [sc_nts_42, sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_names_37, sc_toks_36, optrOpnd, is_parsed, BgL_sc_derivzd2treesza2_47z70, BgL_sc_nbzd2derivzd2treesza2_48za2];
+ }
+ };
+ }
+ };
+ BgL_parsezd2ze3parsedzf3zc2 = function(parse, nt, i, j) {
+ var is_parsed;
+ var states;
+ var enders;
+ var nts;
+ return ((nts = (parse[(0)])), (enders = (parse[(2)])), (states = (parse[(7)])), (is_parsed = (parse[(8)])), (is_parsed(nt, i, j, nts, enders, states)));
+ };
+ BgL_parsezd2ze3treesz31 = function(parse, nt, i, j) {
+ var BgL_sc_derivzd2treesza2_132z70;
+ var states;
+ var toks;
+ var names;
+ var steps;
+ var enders;
+ var nts;
+ return ((nts = (parse[(0)])), (enders = (parse[(2)])), (steps = (parse[(4)])), (names = (parse[(5)])), (toks = (parse[(6)])), (states = (parse[(7)])), (BgL_sc_derivzd2treesza2_132z70 = (parse[(9)])), (BgL_sc_derivzd2treesza2_132z70(nt, i, j, nts, enders, steps, names, toks, states)));
+ };
+ BgL_parsezd2ze3nbzd2treesze3 = function(parse, nt, i, j) {
+ var BgL_sc_nbzd2derivzd2treesza2_133za2;
+ var states;
+ var toks;
+ var steps;
+ var enders;
+ var nts;
+ return ((nts = (parse[(0)])), (enders = (parse[(2)])), (steps = (parse[(4)])), (toks = (parse[(6)])), (states = (parse[(7)])), (BgL_sc_nbzd2derivzd2treesza2_133za2 = (parse[(10)])), (BgL_sc_nbzd2derivzd2treesza2_133za2(nt, i, j, nts, enders, steps, toks, states)));
+ };
+ test = function(k) {
+ var x;
+ var p;
+ return ((p = (BgL_makezd2parserzd2(const_earley, function(l) {
+ var sc_x_134;
+ var tail1134;
+ var L1130;
+ var falseHead1133;
+ {
+ (falseHead1133 = (new sc_Pair(null, null)));
+ (tail1134 = falseHead1133);
+ (L1130 = l);
+ while (!(L1130 === null)) {
+ {
+ (tail1134.cdr = (new sc_Pair(((sc_x_134 = (L1130.car)), (sc_list(sc_x_134, sc_x_134))), null)));
+ (tail1134 = (tail1134.cdr));
+ (L1130 = (L1130.cdr));
+ }
+ }
+ return (falseHead1133.cdr);
+ }
+ }))), (x = (p((sc_vector2list((sc_makeVector(k, "\u1E9Ca"))))))), (sc_length((BgL_parsezd2ze3treesz31(x, "\u1E9Cs", (0), k)))));
+ };
+ BgL_earleyzd2benchmarkzd2 = function() {
+ var args = null;
+ for (var sc_tmp = arguments.length - 1; sc_tmp >= 0; sc_tmp--) {
+ args = sc_cons(arguments[sc_tmp], args);
+ }
+ var k;
+ return ((k = ((args === null)?(7):(args.car))), (BgL_runzd2benchmarkzd2("earley", (1), function() {
+ return (test(k));
+ }, function(result) {
+ return ((sc_display(result)), (sc_newline()), true);
+ })));
+ };
+}
+
+
+/************* END OF GENERATED CODE *************/
+// Invoke this function to run a benchmark.
+// The first argument is a string identifying the benchmark.
+// The second argument is the number of times to run the benchmark.
+// The third argument is a function that runs the benchmark.
+// The fourth argument is a unary function that warns if the result
+// returned by the benchmark is incorrect.
+//
+// Example:
+// RunBenchmark("new Array()",
+// 1,
+// function () { new Array(1000000); }
+// function (v) {
+// return (v instanceof Array) && (v.length == 1000000);
+// });
+
+SC_DEFAULT_OUT = new sc_GenericOutputPort(function(s) {});
+SC_ERROR_OUT = SC_DEFAULT_OUT;
+
+function RunBenchmark(name, count, run, warn) {
+ for (var n = 0; n < count; ++n) {
+ result = run();
+ }
+}
+
+var BgL_runzd2benchmarkzd2 = RunBenchmark;
+
+// The ray tracer code in this file is written by Adam Burmister. It
+// is available in its original form from:
+//
+// http://labs.flog.nz.co/raytracer/
+//
+// It has been modified slightly by Google to work as a standalone
+// benchmark, but the all the computational code remains
+// untouched. This file also contains a copy of the Prototype
+// JavaScript framework which is used by the ray tracer.
+
+var RayTrace = new BenchmarkSuite('RayTrace', 932666, [
+ new Benchmark('RayTrace', renderScene)
+]);
+
+
+// Create dummy objects if we're not running in a browser.
+if (typeof document == 'undefined') {
+ document = { };
+ window = { opera: null };
+ navigator = { userAgent: null, appVersion: "" };
+}
+
+
+// ------------------------------------------------------------------------
+// ------------------------------------------------------------------------
+
+
+/* Prototype JavaScript framework, version 1.5.0
+ * (c) 2005-2007 Sam Stephenson
+ *
+ * Prototype is freely distributable under the terms of an MIT-style license.
+ * For details, see the Prototype web site: http://prototype.conio.net/
+ *
+/*--------------------------------------------------------------------------*/
+
+//--------------------
+var Prototype = {
+ Version: '1.5.0',
+ BrowserFeatures: {
+ XPath: !!document.evaluate
+ },
+
+ ScriptFragment: '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',
+ emptyFunction: function() {},
+ K: function(x) { return x }
+}
+
+var Class = {
+ create: function() {
+ return function() {
+ this.initialize.apply(this, arguments);
+ }
+ }
+}
+
+var Abstract = new Object();
+
+Object.extend = function(destination, source) {
+ for (var property in source) {
+ destination[property] = source[property];
+ }
+ return destination;
+}
+
+Object.extend(Object, {
+ inspect: function(object) {
+ try {
+ if (object === undefined) return 'undefined';
+ if (object === null) return 'null';
+ return object.inspect ? object.inspect() : object.toString();
+ } catch (e) {
+ if (e instanceof RangeError) return '...';
+ throw e;
+ }
+ },
+
+ keys: function(object) {
+ var keys = [];
+ for (var property in object)
+ keys.push(property);
+ return keys;
+ },
+
+ values: function(object) {
+ var values = [];
+ for (var property in object)
+ values.push(object[property]);
+ return values;
+ },
+
+ clone: function(object) {
+ return Object.extend({}, object);
+ }
+});
+
+Function.prototype.bind = function() {
+ var __method = this, args = $A(arguments), object = args.shift();
+ return function() {
+ return __method.apply(object, args.concat($A(arguments)));
+ }
+}
+
+Function.prototype.bindAsEventListener = function(object) {
+ var __method = this, args = $A(arguments), object = args.shift();
+ return function(event) {
+ return __method.apply(object, [( event || window.event)].concat(args).concat($A(arguments)));
+ }
+}
+
+Object.extend(Number.prototype, {
+ toColorPart: function() {
+ var digits = this.toString(16);
+ if (this < 16) return '0' + digits;
+ return digits;
+ },
+
+ succ: function() {
+ return this + 1;
+ },
+
+ times: function(iterator) {
+ $R(0, this, true).each(iterator);
+ return this;
+ }
+});
+
+var Try = {
+ these: function() {
+ var returnValue;
+
+ for (var i = 0, length = arguments.length; i < length; i++) {
+ var lambda = arguments[i];
+ try {
+ returnValue = lambda();
+ break;
+ } catch (e) {}
+ }
+
+ return returnValue;
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+var PeriodicalExecuter = Class.create();
+PeriodicalExecuter.prototype = {
+ initialize: function(callback, frequency) {
+ this.callback = callback;
+ this.frequency = frequency;
+ this.currentlyExecuting = false;
+
+ this.registerCallback();
+ },
+
+ registerCallback: function() {
+ this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+ },
+
+ stop: function() {
+ if (!this.timer) return;
+ clearInterval(this.timer);
+ this.timer = null;
+ },
+
+ onTimerEvent: function() {
+ if (!this.currentlyExecuting) {
+ try {
+ this.currentlyExecuting = true;
+ this.callback(this);
+ } finally {
+ this.currentlyExecuting = false;
+ }
+ }
+ }
+}
+String.interpret = function(value){
+ return value == null ? '' : String(value);
+}
+
+Object.extend(String.prototype, {
+ gsub: function(pattern, replacement) {
+ var result = '', source = this, match;
+ replacement = arguments.callee.prepareReplacement(replacement);
+
+ while (source.length > 0) {
+ if (match = source.match(pattern)) {
+ result += source.slice(0, match.index);
+ result += String.interpret(replacement(match));
+ source = source.slice(match.index + match[0].length);
+ } else {
+ result += source, source = '';
+ }
+ }
+ return result;
+ },
+
+ sub: function(pattern, replacement, count) {
+ replacement = this.gsub.prepareReplacement(replacement);
+ count = count === undefined ? 1 : count;
+
+ return this.gsub(pattern, function(match) {
+ if (--count < 0) return match[0];
+ return replacement(match);
+ });
+ },
+
+ scan: function(pattern, iterator) {
+ this.gsub(pattern, iterator);
+ return this;
+ },
+
+ truncate: function(length, truncation) {
+ length = length || 30;
+ truncation = truncation === undefined ? '...' : truncation;
+ return this.length > length ?
+ this.slice(0, length - truncation.length) + truncation : this;
+ },
+
+ strip: function() {
+ return this.replace(/^\s+/, '').replace(/\s+$/, '');
+ },
+
+ stripTags: function() {
+ return this.replace(/<\/?[^>]+>/gi, '');
+ },
+
+ stripScripts: function() {
+ return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
+ },
+
+ extractScripts: function() {
+ var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
+ var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
+ return (this.match(matchAll) || []).map(function(scriptTag) {
+ return (scriptTag.match(matchOne) || ['', ''])[1];
+ });
+ },
+
+ evalScripts: function() {
+ return this.extractScripts().map(function(script) { return eval(script) });
+ },
+
+ escapeHTML: function() {
+ var div = document.createElement('div');
+ var text = document.createTextNode(this);
+ div.appendChild(text);
+ return div.innerHTML;
+ },
+
+ unescapeHTML: function() {
+ var div = document.createElement('div');
+ div.innerHTML = this.stripTags();
+ return div.childNodes[0] ? (div.childNodes.length > 1 ?
+ $A(div.childNodes).inject('',function(memo,node){ return memo+node.nodeValue }) :
+ div.childNodes[0].nodeValue) : '';
+ },
+
+ toQueryParams: function(separator) {
+ var match = this.strip().match(/([^?#]*)(#.*)?$/);
+ if (!match) return {};
+
+ return match[1].split(separator || '&').inject({}, function(hash, pair) {
+ if ((pair = pair.split('='))[0]) {
+ var name = decodeURIComponent(pair[0]);
+ var value = pair[1] ? decodeURIComponent(pair[1]) : undefined;
+
+ if (hash[name] !== undefined) {
+ if (hash[name].constructor != Array)
+ hash[name] = [hash[name]];
+ if (value) hash[name].push(value);
+ }
+ else hash[name] = value;
+ }
+ return hash;
+ });
+ },
+
+ toArray: function() {
+ return this.split('');
+ },
+
+ succ: function() {
+ return this.slice(0, this.length - 1) +
+ String.fromCharCode(this.charCodeAt(this.length - 1) + 1);
+ },
+
+ camelize: function() {
+ var parts = this.split('-'), len = parts.length;
+ if (len == 1) return parts[0];
+
+ var camelized = this.charAt(0) == '-'
+ ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1)
+ : parts[0];
+
+ for (var i = 1; i < len; i++)
+ camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1);
+
+ return camelized;
+ },
+
+ capitalize: function(){
+ return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
+ },
+
+ underscore: function() {
+ return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase();
+ },
+
+ dasherize: function() {
+ return this.gsub(/_/,'-');
+ },
+
+ inspect: function(useDoubleQuotes) {
+ var escapedString = this.replace(/\\/g, '\\\\');
+ if (useDoubleQuotes)
+ return '"' + escapedString.replace(/"/g, '\\"') + '"';
+ else
+ return "'" + escapedString.replace(/'/g, '\\\'') + "'";
+ }
+});
+
+String.prototype.gsub.prepareReplacement = function(replacement) {
+ if (typeof replacement == 'function') return replacement;
+ var template = new Template(replacement);
+ return function(match) { return template.evaluate(match) };
+}
+
+String.prototype.parseQuery = String.prototype.toQueryParams;
+
+var Template = Class.create();
+Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
+Template.prototype = {
+ initialize: function(template, pattern) {
+ this.template = template.toString();
+ this.pattern = pattern || Template.Pattern;
+ },
+
+ evaluate: function(object) {
+ return this.template.gsub(this.pattern, function(match) {
+ var before = match[1];
+ if (before == '\\') return match[2];
+ return before + String.interpret(object[match[3]]);
+ });
+ }
+}
+
+var $break = new Object();
+var $continue = new Object();
+
+var Enumerable = {
+ each: function(iterator) {
+ var index = 0;
+ try {
+ this._each(function(value) {
+ try {
+ iterator(value, index++);
+ } catch (e) {
+ if (e != $continue) throw e;
+ }
+ });
+ } catch (e) {
+ if (e != $break) throw e;
+ }
+ return this;
+ },
+
+ eachSlice: function(number, iterator) {
+ var index = -number, slices = [], array = this.toArray();
+ while ((index += number) < array.length)
+ slices.push(array.slice(index, index+number));
+ return slices.map(iterator);
+ },
+
+ all: function(iterator) {
+ var result = true;
+ this.each(function(value, index) {
+ result = result && !!(iterator || Prototype.K)(value, index);
+ if (!result) throw $break;
+ });
+ return result;
+ },
+
+ any: function(iterator) {
+ var result = false;
+ this.each(function(value, index) {
+ if (result = !!(iterator || Prototype.K)(value, index))
+ throw $break;
+ });
+ return result;
+ },
+
+ collect: function(iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ results.push((iterator || Prototype.K)(value, index));
+ });
+ return results;
+ },
+
+ detect: function(iterator) {
+ var result;
+ this.each(function(value, index) {
+ if (iterator(value, index)) {
+ result = value;
+ throw $break;
+ }
+ });
+ return result;
+ },
+
+ findAll: function(iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ if (iterator(value, index))
+ results.push(value);
+ });
+ return results;
+ },
+
+ grep: function(pattern, iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ var stringValue = value.toString();
+ if (stringValue.match(pattern))
+ results.push((iterator || Prototype.K)(value, index));
+ })
+ return results;
+ },
+
+ include: function(object) {
+ var found = false;
+ this.each(function(value) {
+ if (value == object) {
+ found = true;
+ throw $break;
+ }
+ });
+ return found;
+ },
+
+ inGroupsOf: function(number, fillWith) {
+ fillWith = fillWith === undefined ? null : fillWith;
+ return this.eachSlice(number, function(slice) {
+ while(slice.length < number) slice.push(fillWith);
+ return slice;
+ });
+ },
+
+ inject: function(memo, iterator) {
+ this.each(function(value, index) {
+ memo = iterator(memo, value, index);
+ });
+ return memo;
+ },
+
+ invoke: function(method) {
+ var args = $A(arguments).slice(1);
+ return this.map(function(value) {
+ return value[method].apply(value, args);
+ });
+ },
+
+ max: function(iterator) {
+ var result;
+ this.each(function(value, index) {
+ value = (iterator || Prototype.K)(value, index);
+ if (result == undefined || value >= result)
+ result = value;
+ });
+ return result;
+ },
+
+ min: function(iterator) {
+ var result;
+ this.each(function(value, index) {
+ value = (iterator || Prototype.K)(value, index);
+ if (result == undefined || value < result)
+ result = value;
+ });
+ return result;
+ },
+
+ partition: function(iterator) {
+ var trues = [], falses = [];
+ this.each(function(value, index) {
+ ((iterator || Prototype.K)(value, index) ?
+ trues : falses).push(value);
+ });
+ return [trues, falses];
+ },
+
+ pluck: function(property) {
+ var results = [];
+ this.each(function(value, index) {
+ results.push(value[property]);
+ });
+ return results;
+ },
+
+ reject: function(iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ if (!iterator(value, index))
+ results.push(value);
+ });
+ return results;
+ },
+
+ sortBy: function(iterator) {
+ return this.map(function(value, index) {
+ return {value: value, criteria: iterator(value, index)};
+ }).sort(function(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }).pluck('value');
+ },
+
+ toArray: function() {
+ return this.map();
+ },
+
+ zip: function() {
+ var iterator = Prototype.K, args = $A(arguments);
+ if (typeof args.last() == 'function')
+ iterator = args.pop();
+
+ var collections = [this].concat(args).map($A);
+ return this.map(function(value, index) {
+ return iterator(collections.pluck(index));
+ });
+ },
+
+ size: function() {
+ return this.toArray().length;
+ },
+
+ inspect: function() {
+ return '#<Enumerable:' + this.toArray().inspect() + '>';
+ }
+}
+
+Object.extend(Enumerable, {
+ map: Enumerable.collect,
+ find: Enumerable.detect,
+ select: Enumerable.findAll,
+ member: Enumerable.include,
+ entries: Enumerable.toArray
+});
+var $A = Array.from = function(iterable) {
+ if (!iterable) return [];
+ if (iterable.toArray) {
+ return iterable.toArray();
+ } else {
+ var results = [];
+ for (var i = 0, length = iterable.length; i < length; i++)
+ results.push(iterable[i]);
+ return results;
+ }
+}
+
+Object.extend(Array.prototype, Enumerable);
+
+if (!Array.prototype._reverse)
+ Array.prototype._reverse = Array.prototype.reverse;
+
+Object.extend(Array.prototype, {
+ _each: function(iterator) {
+ for (var i = 0, length = this.length; i < length; i++)
+ iterator(this[i]);
+ },
+
+ clear: function() {
+ this.length = 0;
+ return this;
+ },
+
+ first: function() {
+ return this[0];
+ },
+
+ last: function() {
+ return this[this.length - 1];
+ },
+
+ compact: function() {
+ return this.select(function(value) {
+ return value != null;
+ });
+ },
+
+ flatten: function() {
+ return this.inject([], function(array, value) {
+ return array.concat(value && value.constructor == Array ?
+ value.flatten() : [value]);
+ });
+ },
+
+ without: function() {
+ var values = $A(arguments);
+ return this.select(function(value) {
+ return !values.include(value);
+ });
+ },
+
+ indexOf: function(object) {
+ for (var i = 0, length = this.length; i < length; i++)
+ if (this[i] == object) return i;
+ return -1;
+ },
+
+ reverse: function(inline) {
+ return (inline !== false ? this : this.toArray())._reverse();
+ },
+
+ reduce: function() {
+ return this.length > 1 ? this : this[0];
+ },
+
+ uniq: function() {
+ return this.inject([], function(array, value) {
+ return array.include(value) ? array : array.concat([value]);
+ });
+ },
+
+ clone: function() {
+ return [].concat(this);
+ },
+
+ size: function() {
+ return this.length;
+ },
+
+ inspect: function() {
+ return '[' + this.map(Object.inspect).join(', ') + ']';
+ }
+});
+
+Array.prototype.toArray = Array.prototype.clone;
+
+function $w(string){
+ string = string.strip();
+ return string ? string.split(/\s+/) : [];
+}
+
+if(window.opera){
+ Array.prototype.concat = function(){
+ var array = [];
+ for(var i = 0, length = this.length; i < length; i++) array.push(this[i]);
+ for(var i = 0, length = arguments.length; i < length; i++) {
+ if(arguments[i].constructor == Array) {
+ for(var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++)
+ array.push(arguments[i][j]);
+ } else {
+ array.push(arguments[i]);
+ }
+ }
+ return array;
+ }
+}
+var Hash = function(obj) {
+ Object.extend(this, obj || {});
+};
+
+Object.extend(Hash, {
+ toQueryString: function(obj) {
+ var parts = [];
+
+ this.prototype._each.call(obj, function(pair) {
+ if (!pair.key) return;
+
+ if (pair.value && pair.value.constructor == Array) {
+ var values = pair.value.compact();
+ if (values.length < 2) pair.value = values.reduce();
+ else {
+ key = encodeURIComponent(pair.key);
+ values.each(function(value) {
+ value = value != undefined ? encodeURIComponent(value) : '';
+ parts.push(key + '=' + encodeURIComponent(value));
+ });
+ return;
+ }
+ }
+ if (pair.value == undefined) pair[1] = '';
+ parts.push(pair.map(encodeURIComponent).join('='));
+ });
+
+ return parts.join('&');
+ }
+});
+
+Object.extend(Hash.prototype, Enumerable);
+Object.extend(Hash.prototype, {
+ _each: function(iterator) {
+ for (var key in this) {
+ var value = this[key];
+ if (value && value == Hash.prototype[key]) continue;
+
+ var pair = [key, value];
+ pair.key = key;
+ pair.value = value;
+ iterator(pair);
+ }
+ },
+
+ keys: function() {
+ return this.pluck('key');
+ },
+
+ values: function() {
+ return this.pluck('value');
+ },
+
+ merge: function(hash) {
+ return $H(hash).inject(this, function(mergedHash, pair) {
+ mergedHash[pair.key] = pair.value;
+ return mergedHash;
+ });
+ },
+
+ remove: function() {
+ var result;
+ for(var i = 0, length = arguments.length; i < length; i++) {
+ var value = this[arguments[i]];
+ if (value !== undefined){
+ if (result === undefined) result = value;
+ else {
+ if (result.constructor != Array) result = [result];
+ result.push(value)
+ }
+ }
+ delete this[arguments[i]];
+ }
+ return result;
+ },
+
+ toQueryString: function() {
+ return Hash.toQueryString(this);
+ },
+
+ inspect: function() {
+ return '#<Hash:{' + this.map(function(pair) {
+ return pair.map(Object.inspect).join(': ');
+ }).join(', ') + '}>';
+ }
+});
+
+function $H(object) {
+ if (object && object.constructor == Hash) return object;
+ return new Hash(object);
+};
+ObjectRange = Class.create();
+Object.extend(ObjectRange.prototype, Enumerable);
+Object.extend(ObjectRange.prototype, {
+ initialize: function(start, end, exclusive) {
+ this.start = start;
+ this.end = end;
+ this.exclusive = exclusive;
+ },
+
+ _each: function(iterator) {
+ var value = this.start;
+ while (this.include(value)) {
+ iterator(value);
+ value = value.succ();
+ }
+ },
+
+ include: function(value) {
+ if (value < this.start)
+ return false;
+ if (this.exclusive)
+ return value < this.end;
+ return value <= this.end;
+ }
+});
+
+var $R = function(start, end, exclusive) {
+ return new ObjectRange(start, end, exclusive);
+}
+
+var Ajax = {
+ getTransport: function() {
+ return Try.these(
+ function() {return new XMLHttpRequest()},
+ function() {return new ActiveXObject('Msxml2.XMLHTTP')},
+ function() {return new ActiveXObject('Microsoft.XMLHTTP')}
+ ) || false;
+ },
+
+ activeRequestCount: 0
+}
+
+Ajax.Responders = {
+ responders: [],
+
+ _each: function(iterator) {
+ this.responders._each(iterator);
+ },
+
+ register: function(responder) {
+ if (!this.include(responder))
+ this.responders.push(responder);
+ },
+
+ unregister: function(responder) {
+ this.responders = this.responders.without(responder);
+ },
+
+ dispatch: function(callback, request, transport, json) {
+ this.each(function(responder) {
+ if (typeof responder[callback] == 'function') {
+ try {
+ responder[callback].apply(responder, [request, transport, json]);
+ } catch (e) {}
+ }
+ });
+ }
+};
+
+Object.extend(Ajax.Responders, Enumerable);
+
+Ajax.Responders.register({
+ onCreate: function() {
+ Ajax.activeRequestCount++;
+ },
+ onComplete: function() {
+ Ajax.activeRequestCount--;
+ }
+});
+
+Ajax.Base = function() {};
+Ajax.Base.prototype = {
+ setOptions: function(options) {
+ this.options = {
+ method: 'post',
+ asynchronous: true,
+ contentType: 'application/x-www-form-urlencoded',
+ encoding: 'UTF-8',
+ parameters: ''
+ }
+ Object.extend(this.options, options || {});
+
+ this.options.method = this.options.method.toLowerCase();
+ if (typeof this.options.parameters == 'string')
+ this.options.parameters = this.options.parameters.toQueryParams();
+ }
+}
+
+Ajax.Request = Class.create();
+Ajax.Request.Events =
+ ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
+
+Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
+ _complete: false,
+
+ initialize: function(url, options) {
+ this.transport = Ajax.getTransport();
+ this.setOptions(options);
+ this.request(url);
+ },
+
+ request: function(url) {
+ this.url = url;
+ this.method = this.options.method;
+ var params = this.options.parameters;
+
+ if (!['get', 'post'].include(this.method)) {
+ // simulate other verbs over post
+ params['_method'] = this.method;
+ this.method = 'post';
+ }
+
+ params = Hash.toQueryString(params);
+ if (params && /Konqueror|Safari|KHTML/.test(navigator.userAgent)) params += '&_='
+
+ // when GET, append parameters to URL
+ if (this.method == 'get' && params)
+ this.url += (this.url.indexOf('?') > -1 ? '&' : '?') + params;
+
+ try {
+ Ajax.Responders.dispatch('onCreate', this, this.transport);
+
+ this.transport.open(this.method.toUpperCase(), this.url,
+ this.options.asynchronous);
+
+ if (this.options.asynchronous)
+ setTimeout(function() { this.respondToReadyState(1) }.bind(this), 10);
+
+ this.transport.onreadystatechange = this.onStateChange.bind(this);
+ this.setRequestHeaders();
+
+ var body = this.method == 'post' ? (this.options.postBody || params) : null;
+
+ this.transport.send(body);
+
+ /* Force Firefox to handle ready state 4 for synchronous requests */
+ if (!this.options.asynchronous && this.transport.overrideMimeType)
+ this.onStateChange();
+
+ }
+ catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ onStateChange: function() {
+ var readyState = this.transport.readyState;
+ if (readyState > 1 && !((readyState == 4) && this._complete))
+ this.respondToReadyState(this.transport.readyState);
+ },
+
+ setRequestHeaders: function() {
+ var headers = {
+ 'X-Requested-With': 'XMLHttpRequest',
+ 'X-Prototype-Version': Prototype.Version,
+ 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
+ };
+
+ if (this.method == 'post') {
+ headers['Content-type'] = this.options.contentType +
+ (this.options.encoding ? '; charset=' + this.options.encoding : '');
+
+ /* Force "Connection: close" for older Mozilla browsers to work
+ * around a bug where XMLHttpRequest sends an incorrect
+ * Content-length header. See Mozilla Bugzilla #246651.
+ */
+ if (this.transport.overrideMimeType &&
+ (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
+ headers['Connection'] = 'close';
+ }
+
+ // user-defined headers
+ if (typeof this.options.requestHeaders == 'object') {
+ var extras = this.options.requestHeaders;
+
+ if (typeof extras.push == 'function')
+ for (var i = 0, length = extras.length; i < length; i += 2)
+ headers[extras[i]] = extras[i+1];
+ else
+ $H(extras).each(function(pair) { headers[pair.key] = pair.value });
+ }
+
+ for (var name in headers)
+ this.transport.setRequestHeader(name, headers[name]);
+ },
+
+ success: function() {
+ return !this.transport.status
+ || (this.transport.status >= 200 && this.transport.status < 300);
+ },
+
+ respondToReadyState: function(readyState) {
+ var state = Ajax.Request.Events[readyState];
+ var transport = this.transport, json = this.evalJSON();
+
+ if (state == 'Complete') {
+ try {
+ this._complete = true;
+ (this.options['on' + this.transport.status]
+ || this.options['on' + (this.success() ? 'Success' : 'Failure')]
+ || Prototype.emptyFunction)(transport, json);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ if ((this.getHeader('Content-type') || 'text/javascript').strip().
+ match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i))
+ this.evalResponse();
+ }
+
+ try {
+ (this.options['on' + state] || Prototype.emptyFunction)(transport, json);
+ Ajax.Responders.dispatch('on' + state, this, transport, json);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ if (state == 'Complete') {
+ // avoid memory leak in MSIE: clean up
+ this.transport.onreadystatechange = Prototype.emptyFunction;
+ }
+ },
+
+ getHeader: function(name) {
+ try {
+ return this.transport.getResponseHeader(name);
+ } catch (e) { return null }
+ },
+
+ evalJSON: function() {
+ try {
+ var json = this.getHeader('X-JSON');
+ return json ? eval('(' + json + ')') : null;
+ } catch (e) { return null }
+ },
+
+ evalResponse: function() {
+ try {
+ return eval(this.transport.responseText);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ dispatchException: function(exception) {
+ (this.options.onException || Prototype.emptyFunction)(this, exception);
+ Ajax.Responders.dispatch('onException', this, exception);
+ }
+});
+
+Ajax.Updater = Class.create();
+
+Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), {
+ initialize: function(container, url, options) {
+ this.container = {
+ success: (container.success || container),
+ failure: (container.failure || (container.success ? null : container))
+ }
+
+ this.transport = Ajax.getTransport();
+ this.setOptions(options);
+
+ var onComplete = this.options.onComplete || Prototype.emptyFunction;
+ this.options.onComplete = (function(transport, param) {
+ this.updateContent();
+ onComplete(transport, param);
+ }).bind(this);
+
+ this.request(url);
+ },
+
+ updateContent: function() {
+ var receiver = this.container[this.success() ? 'success' : 'failure'];
+ var response = this.transport.responseText;
+
+ if (!this.options.evalScripts) response = response.stripScripts();
+
+ if (receiver = $(receiver)) {
+ if (this.options.insertion)
+ new this.options.insertion(receiver, response);
+ else
+ receiver.update(response);
+ }
+
+ if (this.success()) {
+ if (this.onComplete)
+ setTimeout(this.onComplete.bind(this), 10);
+ }
+ }
+});
+
+Ajax.PeriodicalUpdater = Class.create();
+Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), {
+ initialize: function(container, url, options) {
+ this.setOptions(options);
+ this.onComplete = this.options.onComplete;
+
+ this.frequency = (this.options.frequency || 2);
+ this.decay = (this.options.decay || 1);
+
+ this.updater = {};
+ this.container = container;
+ this.url = url;
+
+ this.start();
+ },
+
+ start: function() {
+ this.options.onComplete = this.updateComplete.bind(this);
+ this.onTimerEvent();
+ },
+
+ stop: function() {
+ this.updater.options.onComplete = undefined;
+ clearTimeout(this.timer);
+ (this.onComplete || Prototype.emptyFunction).apply(this, arguments);
+ },
+
+ updateComplete: function(request) {
+ if (this.options.decay) {
+ this.decay = (request.responseText == this.lastText ?
+ this.decay * this.options.decay : 1);
+
+ this.lastText = request.responseText;
+ }
+ this.timer = setTimeout(this.onTimerEvent.bind(this),
+ this.decay * this.frequency * 1000);
+ },
+
+ onTimerEvent: function() {
+ this.updater = new Ajax.Updater(this.container, this.url, this.options);
+ }
+});
+function $(element) {
+ if (arguments.length > 1) {
+ for (var i = 0, elements = [], length = arguments.length; i < length; i++)
+ elements.push($(arguments[i]));
+ return elements;
+ }
+ if (typeof element == 'string')
+ element = document.getElementById(element);
+ return Element.extend(element);
+}
+
+if (Prototype.BrowserFeatures.XPath) {
+ document._getElementsByXPath = function(expression, parentElement) {
+ var results = [];
+ var query = document.evaluate(expression, $(parentElement) || document,
+ null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
+ for (var i = 0, length = query.snapshotLength; i < length; i++)
+ results.push(query.snapshotItem(i));
+ return results;
+ };
+}
+
+document.getElementsByClassName = function(className, parentElement) {
+ if (Prototype.BrowserFeatures.XPath) {
+ var q = ".//*[contains(concat(' ', @class, ' '), ' " + className + " ')]";
+ return document._getElementsByXPath(q, parentElement);
+ } else {
+ var children = ($(parentElement) || document.body).getElementsByTagName('*');
+ var elements = [], child;
+ for (var i = 0, length = children.length; i < length; i++) {
+ child = children[i];
+ if (Element.hasClassName(child, className))
+ elements.push(Element.extend(child));
+ }
+ return elements;
+ }
+};
+
+/*--------------------------------------------------------------------------*/
+
+if (!window.Element)
+ var Element = new Object();
+
+Element.extend = function(element) {
+ if (!element || _nativeExtensions || element.nodeType == 3) return element;
+
+ if (!element._extended && element.tagName && element != window) {
+ var methods = Object.clone(Element.Methods), cache = Element.extend.cache;
+
+ if (element.tagName == 'FORM')
+ Object.extend(methods, Form.Methods);
+ if (['INPUT', 'TEXTAREA', 'SELECT'].include(element.tagName))
+ Object.extend(methods, Form.Element.Methods);
+
+ Object.extend(methods, Element.Methods.Simulated);
+
+ for (var property in methods) {
+ var value = methods[property];
+ if (typeof value == 'function' && !(property in element))
+ element[property] = cache.findOrStore(value);
+ }
+ }
+
+ element._extended = true;
+ return element;
+};
+
+Element.extend.cache = {
+ findOrStore: function(value) {
+ return this[value] = this[value] || function() {
+ return value.apply(null, [this].concat($A(arguments)));
+ }
+ }
+};
+
+Element.Methods = {
+ visible: function(element) {
+ return $(element).style.display != 'none';
+ },
+
+ toggle: function(element) {
+ element = $(element);
+ Element[Element.visible(element) ? 'hide' : 'show'](element);
+ return element;
+ },
+
+ hide: function(element) {
+ $(element).style.display = 'none';
+ return element;
+ },
+
+ show: function(element) {
+ $(element).style.display = '';
+ return element;
+ },
+
+ remove: function(element) {
+ element = $(element);
+ element.parentNode.removeChild(element);
+ return element;
+ },
+
+ update: function(element, html) {
+ html = typeof html == 'undefined' ? '' : html.toString();
+ $(element).innerHTML = html.stripScripts();
+ setTimeout(function() {html.evalScripts()}, 10);
+ return element;
+ },
+
+ replace: function(element, html) {
+ element = $(element);
+ html = typeof html == 'undefined' ? '' : html.toString();
+ if (element.outerHTML) {
+ element.outerHTML = html.stripScripts();
+ } else {
+ var range = element.ownerDocument.createRange();
+ range.selectNodeContents(element);
+ element.parentNode.replaceChild(
+ range.createContextualFragment(html.stripScripts()), element);
+ }
+ setTimeout(function() {html.evalScripts()}, 10);
+ return element;
+ },
+
+ inspect: function(element) {
+ element = $(element);
+ var result = '<' + element.tagName.toLowerCase();
+ $H({'id': 'id', 'className': 'class'}).each(function(pair) {
+ var property = pair.first(), attribute = pair.last();
+ var value = (element[property] || '').toString();
+ if (value) result += ' ' + attribute + '=' + value.inspect(true);
+ });
+ return result + '>';
+ },
+
+ recursivelyCollect: function(element, property) {
+ element = $(element);
+ var elements = [];
+ while (element = element[property])
+ if (element.nodeType == 1)
+ elements.push(Element.extend(element));
+ return elements;
+ },
+
+ ancestors: function(element) {
+ return $(element).recursivelyCollect('parentNode');
+ },
+
+ descendants: function(element) {
+ return $A($(element).getElementsByTagName('*'));
+ },
+
+ immediateDescendants: function(element) {
+ if (!(element = $(element).firstChild)) return [];
+ while (element && element.nodeType != 1) element = element.nextSibling;
+ if (element) return [element].concat($(element).nextSiblings());
+ return [];
+ },
+
+ previousSiblings: function(element) {
+ return $(element).recursivelyCollect('previousSibling');
+ },
+
+ nextSiblings: function(element) {
+ return $(element).recursivelyCollect('nextSibling');
+ },
+
+ siblings: function(element) {
+ element = $(element);
+ return element.previousSiblings().reverse().concat(element.nextSiblings());
+ },
+
+ match: function(element, selector) {
+ if (typeof selector == 'string')
+ selector = new Selector(selector);
+ return selector.match($(element));
+ },
+
+ up: function(element, expression, index) {
+ return Selector.findElement($(element).ancestors(), expression, index);
+ },
+
+ down: function(element, expression, index) {
+ return Selector.findElement($(element).descendants(), expression, index);
+ },
+
+ previous: function(element, expression, index) {
+ return Selector.findElement($(element).previousSiblings(), expression, index);
+ },
+
+ next: function(element, expression, index) {
+ return Selector.findElement($(element).nextSiblings(), expression, index);
+ },
+
+ getElementsBySelector: function() {
+ var args = $A(arguments), element = $(args.shift());
+ return Selector.findChildElements(element, args);
+ },
+
+ getElementsByClassName: function(element, className) {
+ return document.getElementsByClassName(className, element);
+ },
+
+ readAttribute: function(element, name) {
+ element = $(element);
+ if (document.all && !window.opera) {
+ var t = Element._attributeTranslations;
+ if (t.values[name]) return t.values[name](element, name);
+ if (t.names[name]) name = t.names[name];
+ var attribute = element.attributes[name];
+ if(attribute) return attribute.nodeValue;
+ }
+ return element.getAttribute(name);
+ },
+
+ getHeight: function(element) {
+ return $(element).getDimensions().height;
+ },
+
+ getWidth: function(element) {
+ return $(element).getDimensions().width;
+ },
+
+ classNames: function(element) {
+ return new Element.ClassNames(element);
+ },
+
+ hasClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ var elementClassName = element.className;
+ if (elementClassName.length == 0) return false;
+ if (elementClassName == className ||
+ elementClassName.match(new RegExp("(^|\\s)" + className + "(\\s|$)")))
+ return true;
+ return false;
+ },
+
+ addClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ Element.classNames(element).add(className);
+ return element;
+ },
+
+ removeClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ Element.classNames(element).remove(className);
+ return element;
+ },
+
+ toggleClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ Element.classNames(element)[element.hasClassName(className) ? 'remove' : 'add'](className);
+ return element;
+ },
+
+ observe: function() {
+ Event.observe.apply(Event, arguments);
+ return $A(arguments).first();
+ },
+
+ stopObserving: function() {
+ Event.stopObserving.apply(Event, arguments);
+ return $A(arguments).first();
+ },
+
+ // removes whitespace-only text node children
+ cleanWhitespace: function(element) {
+ element = $(element);
+ var node = element.firstChild;
+ while (node) {
+ var nextNode = node.nextSibling;
+ if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
+ element.removeChild(node);
+ node = nextNode;
+ }
+ return element;
+ },
+
+ empty: function(element) {
+ return $(element).innerHTML.match(/^\s*$/);
+ },
+
+ descendantOf: function(element, ancestor) {
+ element = $(element), ancestor = $(ancestor);
+ while (element = element.parentNode)
+ if (element == ancestor) return true;
+ return false;
+ },
+
+ scrollTo: function(element) {
+ element = $(element);
+ var pos = Position.cumulativeOffset(element);
+ window.scrollTo(pos[0], pos[1]);
+ return element;
+ },
+
+ getStyle: function(element, style) {
+ element = $(element);
+ if (['float','cssFloat'].include(style))
+ style = (typeof element.style.styleFloat != 'undefined' ? 'styleFloat' : 'cssFloat');
+ style = style.camelize();
+ var value = element.style[style];
+ if (!value) {
+ if (document.defaultView && document.defaultView.getComputedStyle) {
+ var css = document.defaultView.getComputedStyle(element, null);
+ value = css ? css[style] : null;
+ } else if (element.currentStyle) {
+ value = element.currentStyle[style];
+ }
+ }
+
+ if((value == 'auto') && ['width','height'].include(style) && (element.getStyle('display') != 'none'))
+ value = element['offset'+style.capitalize()] + 'px';
+
+ if (window.opera && ['left', 'top', 'right', 'bottom'].include(style))
+ if (Element.getStyle(element, 'position') == 'static') value = 'auto';
+ if(style == 'opacity') {
+ if(value) return parseFloat(value);
+ if(value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))
+ if(value[1]) return parseFloat(value[1]) / 100;
+ return 1.0;
+ }
+ return value == 'auto' ? null : value;
+ },
+
+ setStyle: function(element, style) {
+ element = $(element);
+ for (var name in style) {
+ var value = style[name];
+ if(name == 'opacity') {
+ if (value == 1) {
+ value = (/Gecko/.test(navigator.userAgent) &&
+ !/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ? 0.999999 : 1.0;
+ if(/MSIE/.test(navigator.userAgent) && !window.opera)
+ element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'');
+ } else if(value == '') {
+ if(/MSIE/.test(navigator.userAgent) && !window.opera)
+ element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'');
+ } else {
+ if(value < 0.00001) value = 0;
+ if(/MSIE/.test(navigator.userAgent) && !window.opera)
+ element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'') +
+ 'alpha(opacity='+value*100+')';
+ }
+ } else if(['float','cssFloat'].include(name)) name = (typeof element.style.styleFloat != 'undefined') ? 'styleFloat' : 'cssFloat';
+ element.style[name.camelize()] = value;
+ }
+ return element;
+ },
+
+ getDimensions: function(element) {
+ element = $(element);
+ var display = $(element).getStyle('display');
+ if (display != 'none' && display != null) // Safari bug
+ return {width: element.offsetWidth, height: element.offsetHeight};
+
+ // All *Width and *Height properties give 0 on elements with display none,
+ // so enable the element temporarily
+ var els = element.style;
+ var originalVisibility = els.visibility;
+ var originalPosition = els.position;
+ var originalDisplay = els.display;
+ els.visibility = 'hidden';
+ els.position = 'absolute';
+ els.display = 'block';
+ var originalWidth = element.clientWidth;
+ var originalHeight = element.clientHeight;
+ els.display = originalDisplay;
+ els.position = originalPosition;
+ els.visibility = originalVisibility;
+ return {width: originalWidth, height: originalHeight};
+ },
+
+ makePositioned: function(element) {
+ element = $(element);
+ var pos = Element.getStyle(element, 'position');
+ if (pos == 'static' || !pos) {
+ element._madePositioned = true;
+ element.style.position = 'relative';
+ // Opera returns the offset relative to the positioning context, when an
+ // element is position relative but top and left have not been defined
+ if (window.opera) {
+ element.style.top = 0;
+ element.style.left = 0;
+ }
+ }
+ return element;
+ },
+
+ undoPositioned: function(element) {
+ element = $(element);
+ if (element._madePositioned) {
+ element._madePositioned = undefined;
+ element.style.position =
+ element.style.top =
+ element.style.left =
+ element.style.bottom =
+ element.style.right = '';
+ }
+ return element;
+ },
+
+ makeClipping: function(element) {
+ element = $(element);
+ if (element._overflow) return element;
+ element._overflow = element.style.overflow || 'auto';
+ if ((Element.getStyle(element, 'overflow') || 'visible') != 'hidden')
+ element.style.overflow = 'hidden';
+ return element;
+ },
+
+ undoClipping: function(element) {
+ element = $(element);
+ if (!element._overflow) return element;
+ element.style.overflow = element._overflow == 'auto' ? '' : element._overflow;
+ element._overflow = null;
+ return element;
+ }
+};
+
+Object.extend(Element.Methods, {childOf: Element.Methods.descendantOf});
+
+Element._attributeTranslations = {};
+
+Element._attributeTranslations.names = {
+ colspan: "colSpan",
+ rowspan: "rowSpan",
+ valign: "vAlign",
+ datetime: "dateTime",
+ accesskey: "accessKey",
+ tabindex: "tabIndex",
+ enctype: "encType",
+ maxlength: "maxLength",
+ readonly: "readOnly",
+ longdesc: "longDesc"
+};
+
+Element._attributeTranslations.values = {
+ _getAttr: function(element, attribute) {
+ return element.getAttribute(attribute, 2);
+ },
+
+ _flag: function(element, attribute) {
+ return $(element).hasAttribute(attribute) ? attribute : null;
+ },
+
+ style: function(element) {
+ return element.style.cssText.toLowerCase();
+ },
+
+ title: function(element) {
+ var node = element.getAttributeNode('title');
+ return node.specified ? node.nodeValue : null;
+ }
+};
+
+Object.extend(Element._attributeTranslations.values, {
+ href: Element._attributeTranslations.values._getAttr,
+ src: Element._attributeTranslations.values._getAttr,
+ disabled: Element._attributeTranslations.values._flag,
+ checked: Element._attributeTranslations.values._flag,
+ readonly: Element._attributeTranslations.values._flag,
+ multiple: Element._attributeTranslations.values._flag
+});
+
+Element.Methods.Simulated = {
+ hasAttribute: function(element, attribute) {
+ var t = Element._attributeTranslations;
+ attribute = t.names[attribute] || attribute;
+ return $(element).getAttributeNode(attribute).specified;
+ }
+};
+
+// IE is missing .innerHTML support for TABLE-related elements
+if (document.all && !window.opera){
+ Element.Methods.update = function(element, html) {
+ element = $(element);
+ html = typeof html == 'undefined' ? '' : html.toString();
+ var tagName = element.tagName.toUpperCase();
+ if (['THEAD','TBODY','TR','TD'].include(tagName)) {
+ var div = document.createElement('div');
+ switch (tagName) {
+ case 'THEAD':
+ case 'TBODY':
+ div.innerHTML = '<table><tbody>' + html.stripScripts() + '</tbody></table>';
+ depth = 2;
+ break;
+ case 'TR':
+ div.innerHTML = '<table><tbody><tr>' + html.stripScripts() + '</tr></tbody></table>';
+ depth = 3;
+ break;
+ case 'TD':
+ div.innerHTML = '<table><tbody><tr><td>' + html.stripScripts() + '</td></tr></tbody></table>';
+ depth = 4;
+ }
+ $A(element.childNodes).each(function(node){
+ element.removeChild(node)
+ });
+ depth.times(function(){ div = div.firstChild });
+
+ $A(div.childNodes).each(
+ function(node){ element.appendChild(node) });
+ } else {
+ element.innerHTML = html.stripScripts();
+ }
+ setTimeout(function() {html.evalScripts()}, 10);
+ return element;
+ }
+};
+
+Object.extend(Element, Element.Methods);
+
+var _nativeExtensions = false;
+
+if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))
+ ['', 'Form', 'Input', 'TextArea', 'Select'].each(function(tag) {
+ var className = 'HTML' + tag + 'Element';
+ if(window[className]) return;
+ var klass = window[className] = {};
+ klass.prototype = document.createElement(tag ? tag.toLowerCase() : 'div').__proto__;
+ });
+
+Element.addMethods = function(methods) {
+ Object.extend(Element.Methods, methods || {});
+
+ function copy(methods, destination, onlyIfAbsent) {
+ onlyIfAbsent = onlyIfAbsent || false;
+ var cache = Element.extend.cache;
+ for (var property in methods) {
+ var value = methods[property];
+ if (!onlyIfAbsent || !(property in destination))
+ destination[property] = cache.findOrStore(value);
+ }
+ }
+
+ if (typeof HTMLElement != 'undefined') {
+ copy(Element.Methods, HTMLElement.prototype);
+ copy(Element.Methods.Simulated, HTMLElement.prototype, true);
+ copy(Form.Methods, HTMLFormElement.prototype);
+ [HTMLInputElement, HTMLTextAreaElement, HTMLSelectElement].each(function(klass) {
+ copy(Form.Element.Methods, klass.prototype);
+ });
+ _nativeExtensions = true;
+ }
+}
+
+var Toggle = new Object();
+Toggle.display = Element.toggle;
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.Insertion = function(adjacency) {
+ this.adjacency = adjacency;
+}
+
+Abstract.Insertion.prototype = {
+ initialize: function(element, content) {
+ this.element = $(element);
+ this.content = content.stripScripts();
+
+ if (this.adjacency && this.element.insertAdjacentHTML) {
+ try {
+ this.element.insertAdjacentHTML(this.adjacency, this.content);
+ } catch (e) {
+ var tagName = this.element.tagName.toUpperCase();
+ if (['TBODY', 'TR'].include(tagName)) {
+ this.insertContent(this.contentFromAnonymousTable());
+ } else {
+ throw e;
+ }
+ }
+ } else {
+ this.range = this.element.ownerDocument.createRange();
+ if (this.initializeRange) this.initializeRange();
+ this.insertContent([this.range.createContextualFragment(this.content)]);
+ }
+
+ setTimeout(function() {content.evalScripts()}, 10);
+ },
+
+ contentFromAnonymousTable: function() {
+ var div = document.createElement('div');
+ div.innerHTML = '<table><tbody>' + this.content + '</tbody></table>';
+ return $A(div.childNodes[0].childNodes[0].childNodes);
+ }
+}
+
+var Insertion = new Object();
+
+Insertion.Before = Class.create();
+Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), {
+ initializeRange: function() {
+ this.range.setStartBefore(this.element);
+ },
+
+ insertContent: function(fragments) {
+ fragments.each((function(fragment) {
+ this.element.parentNode.insertBefore(fragment, this.element);
+ }).bind(this));
+ }
+});
+
+Insertion.Top = Class.create();
+Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), {
+ initializeRange: function() {
+ this.range.selectNodeContents(this.element);
+ this.range.collapse(true);
+ },
+
+ insertContent: function(fragments) {
+ fragments.reverse(false).each((function(fragment) {
+ this.element.insertBefore(fragment, this.element.firstChild);
+ }).bind(this));
+ }
+});
+
+Insertion.Bottom = Class.create();
+Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), {
+ initializeRange: function() {
+ this.range.selectNodeContents(this.element);
+ this.range.collapse(this.element);
+ },
+
+ insertContent: function(fragments) {
+ fragments.each((function(fragment) {
+ this.element.appendChild(fragment);
+ }).bind(this));
+ }
+});
+
+Insertion.After = Class.create();
+Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), {
+ initializeRange: function() {
+ this.range.setStartAfter(this.element);
+ },
+
+ insertContent: function(fragments) {
+ fragments.each((function(fragment) {
+ this.element.parentNode.insertBefore(fragment,
+ this.element.nextSibling);
+ }).bind(this));
+ }
+});
+
+/*--------------------------------------------------------------------------*/
+
+Element.ClassNames = Class.create();
+Element.ClassNames.prototype = {
+ initialize: function(element) {
+ this.element = $(element);
+ },
+
+ _each: function(iterator) {
+ this.element.className.split(/\s+/).select(function(name) {
+ return name.length > 0;
+ })._each(iterator);
+ },
+
+ set: function(className) {
+ this.element.className = className;
+ },
+
+ add: function(classNameToAdd) {
+ if (this.include(classNameToAdd)) return;
+ this.set($A(this).concat(classNameToAdd).join(' '));
+ },
+
+ remove: function(classNameToRemove) {
+ if (!this.include(classNameToRemove)) return;
+ this.set($A(this).without(classNameToRemove).join(' '));
+ },
+
+ toString: function() {
+ return $A(this).join(' ');
+ }
+};
+
+Object.extend(Element.ClassNames.prototype, Enumerable);
+var Selector = Class.create();
+Selector.prototype = {
+ initialize: function(expression) {
+ this.params = {classNames: []};
+ this.expression = expression.toString().strip();
+ this.parseExpression();
+ this.compileMatcher();
+ },
+
+ parseExpression: function() {
+ function abort(message) { throw 'Parse error in selector: ' + message; }
+
+ if (this.expression == '') abort('empty expression');
+
+ var params = this.params, expr = this.expression, match, modifier, clause, rest;
+ while (match = expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)) {
+ params.attributes = params.attributes || [];
+ params.attributes.push({name: match[2], operator: match[3], value: match[4] || match[5] || ''});
+ expr = match[1];
+ }
+
+ if (expr == '*') return this.params.wildcard = true;
+
+ while (match = expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)) {
+ modifier = match[1], clause = match[2], rest = match[3];
+ switch (modifier) {
+ case '#': params.id = clause; break;
+ case '.': params.classNames.push(clause); break;
+ case '':
+ case undefined: params.tagName = clause.toUpperCase(); break;
+ default: abort(expr.inspect());
+ }
+ expr = rest;
+ }
+
+ if (expr.length > 0) abort(expr.inspect());
+ },
+
+ buildMatchExpression: function() {
+ var params = this.params, conditions = [], clause;
+
+ if (params.wildcard)
+ conditions.push('true');
+ if (clause = params.id)
+ conditions.push('element.readAttribute("id") == ' + clause.inspect());
+ if (clause = params.tagName)
+ conditions.push('element.tagName.toUpperCase() == ' + clause.inspect());
+ if ((clause = params.classNames).length > 0)
+ for (var i = 0, length = clause.length; i < length; i++)
+ conditions.push('element.hasClassName(' + clause[i].inspect() + ')');
+ if (clause = params.attributes) {
+ clause.each(function(attribute) {
+ var value = 'element.readAttribute(' + attribute.name.inspect() + ')';
+ var splitValueBy = function(delimiter) {
+ return value + ' && ' + value + '.split(' + delimiter.inspect() + ')';
+ }
+
+ switch (attribute.operator) {
+ case '=': conditions.push(value + ' == ' + attribute.value.inspect()); break;
+ case '~=': conditions.push(splitValueBy(' ') + '.include(' + attribute.value.inspect() + ')'); break;
+ case '|=': conditions.push(
+ splitValueBy('-') + '.first().toUpperCase() == ' + attribute.value.toUpperCase().inspect()
+ ); break;
+ case '!=': conditions.push(value + ' != ' + attribute.value.inspect()); break;
+ case '':
+ case undefined: conditions.push('element.hasAttribute(' + attribute.name.inspect() + ')'); break;
+ default: throw 'Unknown operator ' + attribute.operator + ' in selector';
+ }
+ });
+ }
+
+ return conditions.join(' && ');
+ },
+
+ compileMatcher: function() {
+ this.match = new Function('element', 'if (!element.tagName) return false; \
+ element = $(element); \
+ return ' + this.buildMatchExpression());
+ },
+
+ findElements: function(scope) {
+ var element;
+
+ if (element = $(this.params.id))
+ if (this.match(element))
+ if (!scope || Element.childOf(element, scope))
+ return [element];
+
+ scope = (scope || document).getElementsByTagName(this.params.tagName || '*');
+
+ var results = [];
+ for (var i = 0, length = scope.length; i < length; i++)
+ if (this.match(element = scope[i]))
+ results.push(Element.extend(element));
+
+ return results;
+ },
+
+ toString: function() {
+ return this.expression;
+ }
+}
+
+Object.extend(Selector, {
+ matchElements: function(elements, expression) {
+ var selector = new Selector(expression);
+ return elements.select(selector.match.bind(selector)).map(Element.extend);
+ },
+
+ findElement: function(elements, expression, index) {
+ if (typeof expression == 'number') index = expression, expression = false;
+ return Selector.matchElements(elements, expression || '*')[index || 0];
+ },
+
+ findChildElements: function(element, expressions) {
+ return expressions.map(function(expression) {
+ return expression.match(/[^\s"]+(?:"[^"]*"[^\s"]+)*/g).inject([null], function(results, expr) {
+ var selector = new Selector(expr);
+ return results.inject([], function(elements, result) {
+ return elements.concat(selector.findElements(result || element));
+ });
+ });
+ }).flatten();
+ }
+});
+
+function $$() {
+ return Selector.findChildElements(document, $A(arguments));
+}
+var Form = {
+ reset: function(form) {
+ $(form).reset();
+ return form;
+ },
+
+ serializeElements: function(elements, getHash) {
+ var data = elements.inject({}, function(result, element) {
+ if (!element.disabled && element.name) {
+ var key = element.name, value = $(element).getValue();
+ if (value != undefined) {
+ if (result[key]) {
+ if (result[key].constructor != Array) result[key] = [result[key]];
+ result[key].push(value);
+ }
+ else result[key] = value;
+ }
+ }
+ return result;
+ });
+
+ return getHash ? data : Hash.toQueryString(data);
+ }
+};
+
+Form.Methods = {
+ serialize: function(form, getHash) {
+ return Form.serializeElements(Form.getElements(form), getHash);
+ },
+
+ getElements: function(form) {
+ return $A($(form).getElementsByTagName('*')).inject([],
+ function(elements, child) {
+ if (Form.Element.Serializers[child.tagName.toLowerCase()])
+ elements.push(Element.extend(child));
+ return elements;
+ }
+ );
+ },
+
+ getInputs: function(form, typeName, name) {
+ form = $(form);
+ var inputs = form.getElementsByTagName('input');
+
+ if (!typeName && !name) return $A(inputs).map(Element.extend);
+
+ for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) {
+ var input = inputs[i];
+ if ((typeName && input.type != typeName) || (name && input.name != name))
+ continue;
+ matchingInputs.push(Element.extend(input));
+ }
+
+ return matchingInputs;
+ },
+
+ disable: function(form) {
+ form = $(form);
+ form.getElements().each(function(element) {
+ element.blur();
+ element.disabled = 'true';
+ });
+ return form;
+ },
+
+ enable: function(form) {
+ form = $(form);
+ form.getElements().each(function(element) {
+ element.disabled = '';
+ });
+ return form;
+ },
+
+ findFirstElement: function(form) {
+ return $(form).getElements().find(function(element) {
+ return element.type != 'hidden' && !element.disabled &&
+ ['input', 'select', 'textarea'].include(element.tagName.toLowerCase());
+ });
+ },
+
+ focusFirstElement: function(form) {
+ form = $(form);
+ form.findFirstElement().activate();
+ return form;
+ }
+}
+
+Object.extend(Form, Form.Methods);
+
+/*--------------------------------------------------------------------------*/
+
+Form.Element = {
+ focus: function(element) {
+ $(element).focus();
+ return element;
+ },
+
+ select: function(element) {
+ $(element).select();
+ return element;
+ }
+}
+
+Form.Element.Methods = {
+ serialize: function(element) {
+ element = $(element);
+ if (!element.disabled && element.name) {
+ var value = element.getValue();
+ if (value != undefined) {
+ var pair = {};
+ pair[element.name] = value;
+ return Hash.toQueryString(pair);
+ }
+ }
+ return '';
+ },
+
+ getValue: function(element) {
+ element = $(element);
+ var method = element.tagName.toLowerCase();
+ return Form.Element.Serializers[method](element);
+ },
+
+ clear: function(element) {
+ $(element).value = '';
+ return element;
+ },
+
+ present: function(element) {
+ return $(element).value != '';
+ },
+
+ activate: function(element) {
+ element = $(element);
+ element.focus();
+ if (element.select && ( element.tagName.toLowerCase() != 'input' ||
+ !['button', 'reset', 'submit'].include(element.type) ) )
+ element.select();
+ return element;
+ },
+
+ disable: function(element) {
+ element = $(element);
+ element.disabled = true;
+ return element;
+ },
+
+ enable: function(element) {
+ element = $(element);
+ element.blur();
+ element.disabled = false;
+ return element;
+ }
+}
+
+Object.extend(Form.Element, Form.Element.Methods);
+var Field = Form.Element;
+var $F = Form.Element.getValue;
+
+/*--------------------------------------------------------------------------*/
+
+Form.Element.Serializers = {
+ input: function(element) {
+ switch (element.type.toLowerCase()) {
+ case 'checkbox':
+ case 'radio':
+ return Form.Element.Serializers.inputSelector(element);
+ default:
+ return Form.Element.Serializers.textarea(element);
+ }
+ },
+
+ inputSelector: function(element) {
+ return element.checked ? element.value : null;
+ },
+
+ textarea: function(element) {
+ return element.value;
+ },
+
+ select: function(element) {
+ return this[element.type == 'select-one' ?
+ 'selectOne' : 'selectMany'](element);
+ },
+
+ selectOne: function(element) {
+ var index = element.selectedIndex;
+ return index >= 0 ? this.optionValue(element.options[index]) : null;
+ },
+
+ selectMany: function(element) {
+ var values, length = element.length;
+ if (!length) return null;
+
+ for (var i = 0, values = []; i < length; i++) {
+ var opt = element.options[i];
+ if (opt.selected) values.push(this.optionValue(opt));
+ }
+ return values;
+ },
+
+ optionValue: function(opt) {
+ // extend element because hasAttribute may not be native
+ return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text;
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.TimedObserver = function() {}
+Abstract.TimedObserver.prototype = {
+ initialize: function(element, frequency, callback) {
+ this.frequency = frequency;
+ this.element = $(element);
+ this.callback = callback;
+
+ this.lastValue = this.getValue();
+ this.registerCallback();
+ },
+
+ registerCallback: function() {
+ setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+ },
+
+ onTimerEvent: function() {
+ var value = this.getValue();
+ var changed = ('string' == typeof this.lastValue && 'string' == typeof value
+ ? this.lastValue != value : String(this.lastValue) != String(value));
+ if (changed) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ }
+}
+
+Form.Element.Observer = Class.create();
+Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.Observer = Class.create();
+Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.EventObserver = function() {}
+Abstract.EventObserver.prototype = {
+ initialize: function(element, callback) {
+ this.element = $(element);
+ this.callback = callback;
+
+ this.lastValue = this.getValue();
+ if (this.element.tagName.toLowerCase() == 'form')
+ this.registerFormCallbacks();
+ else
+ this.registerCallback(this.element);
+ },
+
+ onElementEvent: function() {
+ var value = this.getValue();
+ if (this.lastValue != value) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ },
+
+ registerFormCallbacks: function() {
+ Form.getElements(this.element).each(this.registerCallback.bind(this));
+ },
+
+ registerCallback: function(element) {
+ if (element.type) {
+ switch (element.type.toLowerCase()) {
+ case 'checkbox':
+ case 'radio':
+ Event.observe(element, 'click', this.onElementEvent.bind(this));
+ break;
+ default:
+ Event.observe(element, 'change', this.onElementEvent.bind(this));
+ break;
+ }
+ }
+ }
+}
+
+Form.Element.EventObserver = Class.create();
+Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.EventObserver = Class.create();
+Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+if (!window.Event) {
+ var Event = new Object();
+}
+
+Object.extend(Event, {
+ KEY_BACKSPACE: 8,
+ KEY_TAB: 9,
+ KEY_RETURN: 13,
+ KEY_ESC: 27,
+ KEY_LEFT: 37,
+ KEY_UP: 38,
+ KEY_RIGHT: 39,
+ KEY_DOWN: 40,
+ KEY_DELETE: 46,
+ KEY_HOME: 36,
+ KEY_END: 35,
+ KEY_PAGEUP: 33,
+ KEY_PAGEDOWN: 34,
+
+ element: function(event) {
+ return event.target || event.srcElement;
+ },
+
+ isLeftClick: function(event) {
+ return (((event.which) && (event.which == 1)) ||
+ ((event.button) && (event.button == 1)));
+ },
+
+ pointerX: function(event) {
+ return event.pageX || (event.clientX +
+ (document.documentElement.scrollLeft || document.body.scrollLeft));
+ },
+
+ pointerY: function(event) {
+ return event.pageY || (event.clientY +
+ (document.documentElement.scrollTop || document.body.scrollTop));
+ },
+
+ stop: function(event) {
+ if (event.preventDefault) {
+ event.preventDefault();
+ event.stopPropagation();
+ } else {
+ event.returnValue = false;
+ event.cancelBubble = true;
+ }
+ },
+
+ // find the first node with the given tagName, starting from the
+ // node the event was triggered on; traverses the DOM upwards
+ findElement: function(event, tagName) {
+ var element = Event.element(event);
+ while (element.parentNode && (!element.tagName ||
+ (element.tagName.toUpperCase() != tagName.toUpperCase())))
+ element = element.parentNode;
+ return element;
+ },
+
+ observers: false,
+
+ _observeAndCache: function(element, name, observer, useCapture) {
+ if (!this.observers) this.observers = [];
+ if (element.addEventListener) {
+ this.observers.push([element, name, observer, useCapture]);
+ element.addEventListener(name, observer, useCapture);
+ } else if (element.attachEvent) {
+ this.observers.push([element, name, observer, useCapture]);
+ element.attachEvent('on' + name, observer);
+ }
+ },
+
+ unloadCache: function() {
+ if (!Event.observers) return;
+ for (var i = 0, length = Event.observers.length; i < length; i++) {
+ Event.stopObserving.apply(this, Event.observers[i]);
+ Event.observers[i][0] = null;
+ }
+ Event.observers = false;
+ },
+
+ observe: function(element, name, observer, useCapture) {
+ element = $(element);
+ useCapture = useCapture || false;
+
+ if (name == 'keypress' &&
+ (navigator.appVersion.match(/Konqueror|Safari|KHTML/)
+ || element.attachEvent))
+ name = 'keydown';
+
+ Event._observeAndCache(element, name, observer, useCapture);
+ },
+
+ stopObserving: function(element, name, observer, useCapture) {
+ element = $(element);
+ useCapture = useCapture || false;
+
+ if (name == 'keypress' &&
+ (navigator.appVersion.match(/Konqueror|Safari|KHTML/)
+ || element.detachEvent))
+ name = 'keydown';
+
+ if (element.removeEventListener) {
+ element.removeEventListener(name, observer, useCapture);
+ } else if (element.detachEvent) {
+ try {
+ element.detachEvent('on' + name, observer);
+ } catch (e) {}
+ }
+ }
+});
+
+/* prevent memory leaks in IE */
+if (navigator.appVersion.match(/\bMSIE\b/))
+ Event.observe(window, 'unload', Event.unloadCache, false);
+var Position = {
+ // set to true if needed, warning: firefox performance problems
+ // NOT neeeded for page scrolling, only if draggable contained in
+ // scrollable elements
+ includeScrollOffsets: false,
+
+ // must be called before calling withinIncludingScrolloffset, every time the
+ // page is scrolled
+ prepare: function() {
+ this.deltaX = window.pageXOffset
+ || document.documentElement.scrollLeft
+ || document.body.scrollLeft
+ || 0;
+ this.deltaY = window.pageYOffset
+ || document.documentElement.scrollTop
+ || document.body.scrollTop
+ || 0;
+ },
+
+ realOffset: function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.scrollTop || 0;
+ valueL += element.scrollLeft || 0;
+ element = element.parentNode;
+ } while (element);
+ return [valueL, valueT];
+ },
+
+ cumulativeOffset: function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ element = element.offsetParent;
+ } while (element);
+ return [valueL, valueT];
+ },
+
+ positionedOffset: function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ element = element.offsetParent;
+ if (element) {
+ if(element.tagName=='BODY') break;
+ var p = Element.getStyle(element, 'position');
+ if (p == 'relative' || p == 'absolute') break;
+ }
+ } while (element);
+ return [valueL, valueT];
+ },
+
+ offsetParent: function(element) {
+ if (element.offsetParent) return element.offsetParent;
+ if (element == document.body) return element;
+
+ while ((element = element.parentNode) && element != document.body)
+ if (Element.getStyle(element, 'position') != 'static')
+ return element;
+
+ return document.body;
+ },
+
+ // caches x/y coordinate pair to use with overlap
+ within: function(element, x, y) {
+ if (this.includeScrollOffsets)
+ return this.withinIncludingScrolloffsets(element, x, y);
+ this.xcomp = x;
+ this.ycomp = y;
+ this.offset = this.cumulativeOffset(element);
+
+ return (y >= this.offset[1] &&
+ y < this.offset[1] + element.offsetHeight &&
+ x >= this.offset[0] &&
+ x < this.offset[0] + element.offsetWidth);
+ },
+
+ withinIncludingScrolloffsets: function(element, x, y) {
+ var offsetcache = this.realOffset(element);
+
+ this.xcomp = x + offsetcache[0] - this.deltaX;
+ this.ycomp = y + offsetcache[1] - this.deltaY;
+ this.offset = this.cumulativeOffset(element);
+
+ return (this.ycomp >= this.offset[1] &&
+ this.ycomp < this.offset[1] + element.offsetHeight &&
+ this.xcomp >= this.offset[0] &&
+ this.xcomp < this.offset[0] + element.offsetWidth);
+ },
+
+ // within must be called directly before
+ overlap: function(mode, element) {
+ if (!mode) return 0;
+ if (mode == 'vertical')
+ return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
+ element.offsetHeight;
+ if (mode == 'horizontal')
+ return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
+ element.offsetWidth;
+ },
+
+ page: function(forElement) {
+ var valueT = 0, valueL = 0;
+
+ var element = forElement;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+
+ // Safari fix
+ if (element.offsetParent==document.body)
+ if (Element.getStyle(element,'position')=='absolute') break;
+
+ } while (element = element.offsetParent);
+
+ element = forElement;
+ do {
+ if (!window.opera || element.tagName=='BODY') {
+ valueT -= element.scrollTop || 0;
+ valueL -= element.scrollLeft || 0;
+ }
+ } while (element = element.parentNode);
+
+ return [valueL, valueT];
+ },
+
+ clone: function(source, target) {
+ var options = Object.extend({
+ setLeft: true,
+ setTop: true,
+ setWidth: true,
+ setHeight: true,
+ offsetTop: 0,
+ offsetLeft: 0
+ }, arguments[2] || {})
+
+ // find page position of source
+ source = $(source);
+ var p = Position.page(source);
+
+ // find coordinate system to use
+ target = $(target);
+ var delta = [0, 0];
+ var parent = null;
+ // delta [0,0] will do fine with position: fixed elements,
+ // position:absolute needs offsetParent deltas
+
+ if (Element.getStyle(target,'position') == 'absolute') {
+ parent = Position.offsetParent(target);
+ delta = Position.page(parent);
+ }
+
+ // correct by body offsets (fixes Safari)
+ if (parent == document.body) {
+ delta[0] -= document.body.offsetLeft;
+ delta[1] -= document.body.offsetTop;
+ }
+
+ // set position
+ if(options.setLeft) target.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px';
+ if(options.setTop) target.style.top = (p[1] - delta[1] + options.offsetTop) + 'px';
+ if(options.setWidth) target.style.width = source.offsetWidth + 'px';
+ if(options.setHeight) target.style.height = source.offsetHeight + 'px';
+ },
+
+ absolutize: function(element) {
+ element = $(element);
+ if (element.style.position == 'absolute') return;
+ Position.prepare();
+
+ var offsets = Position.positionedOffset(element);
+ var top = offsets[1];
+ var left = offsets[0];
+ var width = element.clientWidth;
+ var height = element.clientHeight;
+
+ element._originalLeft = left - parseFloat(element.style.left || 0);
+ element._originalTop = top - parseFloat(element.style.top || 0);
+ element._originalWidth = element.style.width;
+ element._originalHeight = element.style.height;
+
+ element.style.position = 'absolute';
+ element.style.top = top + 'px';
+ element.style.left = left + 'px';
+ element.style.width = width + 'px';
+ element.style.height = height + 'px';
+ },
+
+ relativize: function(element) {
+ element = $(element);
+ if (element.style.position == 'relative') return;
+ Position.prepare();
+
+ element.style.position = 'relative';
+ var top = parseFloat(element.style.top || 0) - (element._originalTop || 0);
+ var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);
+
+ element.style.top = top + 'px';
+ element.style.left = left + 'px';
+ element.style.height = element._originalHeight;
+ element.style.width = element._originalWidth;
+ }
+}
+
+// Safari returns margins on body which is incorrect if the child is absolutely
+// positioned. For performance reasons, redefine Position.cumulativeOffset for
+// KHTML/WebKit only.
+if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) {
+ Position.cumulativeOffset = function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ if (element.offsetParent == document.body)
+ if (Element.getStyle(element, 'position') == 'absolute') break;
+
+ element = element.offsetParent;
+ } while (element);
+
+ return [valueL, valueT];
+ }
+}
+
+Element.addMethods();
+
+
+// ------------------------------------------------------------------------
+// ------------------------------------------------------------------------
+
+// The rest of this file is the actual ray tracer written by Adam
+// Burmister. It's a concatenation of the following files:
+//
+// flog/color.js
+// flog/light.js
+// flog/vector.js
+// flog/ray.js
+// flog/scene.js
+// flog/material/basematerial.js
+// flog/material/solid.js
+// flog/material/chessboard.js
+// flog/shape/baseshape.js
+// flog/shape/sphere.js
+// flog/shape/plane.js
+// flog/intersectioninfo.js
+// flog/camera.js
+// flog/background.js
+// flog/engine.js
+
+
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Color = Class.create();
+
+Flog.RayTracer.Color.prototype = {
+ red : 0.0,
+ green : 0.0,
+ blue : 0.0,
+
+ initialize : function(r, g, b) {
+ if(!r) r = 0.0;
+ if(!g) g = 0.0;
+ if(!b) b = 0.0;
+
+ this.red = r;
+ this.green = g;
+ this.blue = b;
+ },
+
+ add : function(c1, c2){
+ var result = new Flog.RayTracer.Color(0,0,0);
+
+ result.red = c1.red + c2.red;
+ result.green = c1.green + c2.green;
+ result.blue = c1.blue + c2.blue;
+
+ return result;
+ },
+
+ addScalar: function(c1, s){
+ var result = new Flog.RayTracer.Color(0,0,0);
+
+ result.red = c1.red + s;
+ result.green = c1.green + s;
+ result.blue = c1.blue + s;
+
+ result.limit();
+
+ return result;
+ },
+
+ subtract: function(c1, c2){
+ var result = new Flog.RayTracer.Color(0,0,0);
+
+ result.red = c1.red - c2.red;
+ result.green = c1.green - c2.green;
+ result.blue = c1.blue - c2.blue;
+
+ return result;
+ },
+
+ multiply : function(c1, c2) {
+ var result = new Flog.RayTracer.Color(0,0,0);
+
+ result.red = c1.red * c2.red;
+ result.green = c1.green * c2.green;
+ result.blue = c1.blue * c2.blue;
+
+ return result;
+ },
+
+ multiplyScalar : function(c1, f) {
+ var result = new Flog.RayTracer.Color(0,0,0);
+
+ result.red = c1.red * f;
+ result.green = c1.green * f;
+ result.blue = c1.blue * f;
+
+ return result;
+ },
+
+ divideFactor : function(c1, f) {
+ var result = new Flog.RayTracer.Color(0,0,0);
+
+ result.red = c1.red / f;
+ result.green = c1.green / f;
+ result.blue = c1.blue / f;
+
+ return result;
+ },
+
+ limit: function(){
+ this.red = (this.red > 0.0) ? ( (this.red > 1.0) ? 1.0 : this.red ) : 0.0;
+ this.green = (this.green > 0.0) ? ( (this.green > 1.0) ? 1.0 : this.green ) : 0.0;
+ this.blue = (this.blue > 0.0) ? ( (this.blue > 1.0) ? 1.0 : this.blue ) : 0.0;
+ },
+
+ distance : function(color) {
+ var d = Math.abs(this.red - color.red) + Math.abs(this.green - color.green) + Math.abs(this.blue - color.blue);
+ return d;
+ },
+
+ blend: function(c1, c2, w){
+ var result = new Flog.RayTracer.Color(0,0,0);
+ result = Flog.RayTracer.Color.prototype.add(
+ Flog.RayTracer.Color.prototype.multiplyScalar(c1, 1 - w),
+ Flog.RayTracer.Color.prototype.multiplyScalar(c2, w)
+ );
+ return result;
+ },
+
+ toString : function () {
+ var r = Math.floor(this.red*255);
+ var g = Math.floor(this.green*255);
+ var b = Math.floor(this.blue*255);
+
+ return "rgb("+ r +","+ g +","+ b +")";
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Light = Class.create();
+
+Flog.RayTracer.Light.prototype = {
+ position: null,
+ color: null,
+ intensity: 10.0,
+
+ initialize : function(pos, color, intensity) {
+ this.position = pos;
+ this.color = color;
+ this.intensity = (intensity ? intensity : 10.0);
+ },
+
+ getIntensity: function(distance){
+ if(distance >= intensity) return 0;
+
+ return Math.pow((intensity - distance) / strength, 0.2);
+ },
+
+ toString : function () {
+ return 'Light [' + this.position.x + ',' + this.position.y + ',' + this.position.z + ']';
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Vector = Class.create();
+
+Flog.RayTracer.Vector.prototype = {
+ x : 0.0,
+ y : 0.0,
+ z : 0.0,
+
+ initialize : function(x, y, z) {
+ this.x = (x ? x : 0);
+ this.y = (y ? y : 0);
+ this.z = (z ? z : 0);
+ },
+
+ copy: function(vector){
+ this.x = vector.x;
+ this.y = vector.y;
+ this.z = vector.z;
+ },
+
+ normalize : function() {
+ var m = this.magnitude();
+ return new Flog.RayTracer.Vector(this.x / m, this.y / m, this.z / m);
+ },
+
+ magnitude : function() {
+ return Math.sqrt((this.x * this.x) + (this.y * this.y) + (this.z * this.z));
+ },
+
+ cross : function(w) {
+ return new Flog.RayTracer.Vector(
+ -this.z * w.y + this.y * w.z,
+ this.z * w.x - this.x * w.z,
+ -this.y * w.x + this.x * w.y);
+ },
+
+ dot : function(w) {
+ return this.x * w.x + this.y * w.y + this.z * w.z;
+ },
+
+ add : function(v, w) {
+ return new Flog.RayTracer.Vector(w.x + v.x, w.y + v.y, w.z + v.z);
+ },
+
+ subtract : function(v, w) {
+ if(!w || !v) throw 'Vectors must be defined [' + v + ',' + w + ']';
+ return new Flog.RayTracer.Vector(v.x - w.x, v.y - w.y, v.z - w.z);
+ },
+
+ multiplyVector : function(v, w) {
+ return new Flog.RayTracer.Vector(v.x * w.x, v.y * w.y, v.z * w.z);
+ },
+
+ multiplyScalar : function(v, w) {
+ return new Flog.RayTracer.Vector(v.x * w, v.y * w, v.z * w);
+ },
+
+ toString : function () {
+ return 'Vector [' + this.x + ',' + this.y + ',' + this.z + ']';
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Ray = Class.create();
+
+Flog.RayTracer.Ray.prototype = {
+ position : null,
+ direction : null,
+ initialize : function(pos, dir) {
+ this.position = pos;
+ this.direction = dir;
+ },
+
+ toString : function () {
+ return 'Ray [' + this.position + ',' + this.direction + ']';
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Scene = Class.create();
+
+Flog.RayTracer.Scene.prototype = {
+ camera : null,
+ shapes : [],
+ lights : [],
+ background : null,
+
+ initialize : function() {
+ this.camera = new Flog.RayTracer.Camera(
+ new Flog.RayTracer.Vector(0,0,-5),
+ new Flog.RayTracer.Vector(0,0,1),
+ new Flog.RayTracer.Vector(0,1,0)
+ );
+ this.shapes = new Array();
+ this.lights = new Array();
+ this.background = new Flog.RayTracer.Background(new Flog.RayTracer.Color(0,0,0.5), 0.2);
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+if(typeof(Flog.RayTracer.Material) == 'undefined') Flog.RayTracer.Material = {};
+
+Flog.RayTracer.Material.BaseMaterial = Class.create();
+
+Flog.RayTracer.Material.BaseMaterial.prototype = {
+
+ gloss: 2.0, // [0...infinity] 0 = matt
+ transparency: 0.0, // 0=opaque
+ reflection: 0.0, // [0...infinity] 0 = no reflection
+ refraction: 0.50,
+ hasTexture: false,
+
+ initialize : function() {
+
+ },
+
+ getColor: function(u, v){
+
+ },
+
+ wrapUp: function(t){
+ t = t % 2.0;
+ if(t < -1) t += 2.0;
+ if(t >= 1) t -= 2.0;
+ return t;
+ },
+
+ toString : function () {
+ return 'Material [gloss=' + this.gloss + ', transparency=' + this.transparency + ', hasTexture=' + this.hasTexture +']';
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Material.Solid = Class.create();
+
+Flog.RayTracer.Material.Solid.prototype = Object.extend(
+ new Flog.RayTracer.Material.BaseMaterial(), {
+ initialize : function(color, reflection, refraction, transparency, gloss) {
+ this.color = color;
+ this.reflection = reflection;
+ this.transparency = transparency;
+ this.gloss = gloss;
+ this.hasTexture = false;
+ },
+
+ getColor: function(u, v){
+ return this.color;
+ },
+
+ toString : function () {
+ return 'SolidMaterial [gloss=' + this.gloss + ', transparency=' + this.transparency + ', hasTexture=' + this.hasTexture +']';
+ }
+ }
+);
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Material.Chessboard = Class.create();
+
+Flog.RayTracer.Material.Chessboard.prototype = Object.extend(
+ new Flog.RayTracer.Material.BaseMaterial(), {
+ colorEven: null,
+ colorOdd: null,
+ density: 0.5,
+
+ initialize : function(colorEven, colorOdd, reflection, transparency, gloss, density) {
+ this.colorEven = colorEven;
+ this.colorOdd = colorOdd;
+ this.reflection = reflection;
+ this.transparency = transparency;
+ this.gloss = gloss;
+ this.density = density;
+ this.hasTexture = true;
+ },
+
+ getColor: function(u, v){
+ var t = this.wrapUp(u * this.density) * this.wrapUp(v * this.density);
+
+ if(t < 0.0)
+ return this.colorEven;
+ else
+ return this.colorOdd;
+ },
+
+ toString : function () {
+ return 'ChessMaterial [gloss=' + this.gloss + ', transparency=' + this.transparency + ', hasTexture=' + this.hasTexture +']';
+ }
+ }
+);
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+if(typeof(Flog.RayTracer.Shape) == 'undefined') Flog.RayTracer.Shape = {};
+
+Flog.RayTracer.Shape.BaseShape = Class.create();
+
+Flog.RayTracer.Shape.BaseShape.prototype = {
+ position: null,
+ material: null,
+
+ initialize : function() {
+ this.position = new Vector(0,0,0);
+ this.material = new Flog.RayTracer.Material.SolidMaterial(
+ new Flog.RayTracer.Color(1,0,1),
+ 0,
+ 0,
+ 0
+ );
+ },
+
+ toString : function () {
+ return 'Material [gloss=' + this.gloss + ', transparency=' + this.transparency + ', hasTexture=' + this.hasTexture +']';
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+if(typeof(Flog.RayTracer.Shape) == 'undefined') Flog.RayTracer.Shape = {};
+
+Flog.RayTracer.Shape.Sphere = Class.create();
+
+Flog.RayTracer.Shape.Sphere.prototype = {
+ initialize : function(pos, radius, material) {
+ this.radius = radius;
+ this.position = pos;
+ this.material = material;
+ },
+
+ intersect: function(ray){
+ var info = new Flog.RayTracer.IntersectionInfo();
+ info.shape = this;
+
+ var dst = Flog.RayTracer.Vector.prototype.subtract(ray.position, this.position);
+
+ var B = dst.dot(ray.direction);
+ var C = dst.dot(dst) - (this.radius * this.radius);
+ var D = (B * B) - C;
+
+ if(D > 0){ // intersection!
+ info.isHit = true;
+ info.distance = (-B) - Math.sqrt(D);
+ info.position = Flog.RayTracer.Vector.prototype.add(
+ ray.position,
+ Flog.RayTracer.Vector.prototype.multiplyScalar(
+ ray.direction,
+ info.distance
+ )
+ );
+ info.normal = Flog.RayTracer.Vector.prototype.subtract(
+ info.position,
+ this.position
+ ).normalize();
+
+ info.color = this.material.getColor(0,0);
+ } else {
+ info.isHit = false;
+ }
+ return info;
+ },
+
+ toString : function () {
+ return 'Sphere [position=' + this.position + ', radius=' + this.radius + ']';
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+if(typeof(Flog.RayTracer.Shape) == 'undefined') Flog.RayTracer.Shape = {};
+
+Flog.RayTracer.Shape.Plane = Class.create();
+
+Flog.RayTracer.Shape.Plane.prototype = {
+ d: 0.0,
+
+ initialize : function(pos, d, material) {
+ this.position = pos;
+ this.d = d;
+ this.material = material;
+ },
+
+ intersect: function(ray){
+ var info = new Flog.RayTracer.IntersectionInfo();
+
+ var Vd = this.position.dot(ray.direction);
+ if(Vd == 0) return info; // no intersection
+
+ var t = -(this.position.dot(ray.position) + this.d) / Vd;
+ if(t <= 0) return info;
+
+ info.shape = this;
+ info.isHit = true;
+ info.position = Flog.RayTracer.Vector.prototype.add(
+ ray.position,
+ Flog.RayTracer.Vector.prototype.multiplyScalar(
+ ray.direction,
+ t
+ )
+ );
+ info.normal = this.position;
+ info.distance = t;
+
+ if(this.material.hasTexture){
+ var vU = new Flog.RayTracer.Vector(this.position.y, this.position.z, -this.position.x);
+ var vV = vU.cross(this.position);
+ var u = info.position.dot(vU);
+ var v = info.position.dot(vV);
+ info.color = this.material.getColor(u,v);
+ } else {
+ info.color = this.material.getColor(0,0);
+ }
+
+ return info;
+ },
+
+ toString : function () {
+ return 'Plane [' + this.position + ', d=' + this.d + ']';
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.IntersectionInfo = Class.create();
+
+Flog.RayTracer.IntersectionInfo.prototype = {
+ isHit: false,
+ hitCount: 0,
+ shape: null,
+ position: null,
+ normal: null,
+ color: null,
+ distance: null,
+
+ initialize : function() {
+ this.color = new Flog.RayTracer.Color(0,0,0);
+ },
+
+ toString : function () {
+ return 'Intersection [' + this.position + ']';
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Camera = Class.create();
+
+Flog.RayTracer.Camera.prototype = {
+ position: null,
+ lookAt: null,
+ equator: null,
+ up: null,
+ screen: null,
+
+ initialize : function(pos, lookAt, up) {
+ this.position = pos;
+ this.lookAt = lookAt;
+ this.up = up;
+ this.equator = lookAt.normalize().cross(this.up);
+ this.screen = Flog.RayTracer.Vector.prototype.add(this.position, this.lookAt);
+ },
+
+ getRay: function(vx, vy){
+ var pos = Flog.RayTracer.Vector.prototype.subtract(
+ this.screen,
+ Flog.RayTracer.Vector.prototype.subtract(
+ Flog.RayTracer.Vector.prototype.multiplyScalar(this.equator, vx),
+ Flog.RayTracer.Vector.prototype.multiplyScalar(this.up, vy)
+ )
+ );
+ pos.y = pos.y * -1;
+ var dir = Flog.RayTracer.Vector.prototype.subtract(
+ pos,
+ this.position
+ );
+
+ var ray = new Flog.RayTracer.Ray(pos, dir.normalize());
+
+ return ray;
+ },
+
+ toString : function () {
+ return 'Ray []';
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Background = Class.create();
+
+Flog.RayTracer.Background.prototype = {
+ color : null,
+ ambience : 0.0,
+
+ initialize : function(color, ambience) {
+ this.color = color;
+ this.ambience = ambience;
+ }
+}
+/* Fake a Flog.* namespace */
+if(typeof(Flog) == 'undefined') var Flog = {};
+if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {};
+
+Flog.RayTracer.Engine = Class.create();
+
+Flog.RayTracer.Engine.prototype = {
+ canvas: null, /* 2d context we can render to */
+
+ initialize: function(options){
+ this.options = Object.extend({
+ canvasHeight: 100,
+ canvasWidth: 100,
+ pixelWidth: 2,
+ pixelHeight: 2,
+ renderDiffuse: false,
+ renderShadows: false,
+ renderHighlights: false,
+ renderReflections: false,
+ rayDepth: 2
+ }, options || {});
+
+ this.options.canvasHeight /= this.options.pixelHeight;
+ this.options.canvasWidth /= this.options.pixelWidth;
+
+ /* TODO: dynamically include other scripts */
+ },
+
+ setPixel: function(x, y, color){
+ var pxW, pxH;
+ pxW = this.options.pixelWidth;
+ pxH = this.options.pixelHeight;
+
+ if (this.canvas) {
+ this.canvas.fillStyle = color.toString();
+ this.canvas.fillRect (x * pxW, y * pxH, pxW, pxH);
+ } else {
+ // print(x * pxW, y * pxH, pxW, pxH);
+ }
+ },
+
+ renderScene: function(scene, canvas){
+ /* Get canvas */
+ if (canvas) {
+ this.canvas = canvas.getContext("2d");
+ } else {
+ this.canvas = null;
+ }
+
+ var canvasHeight = this.options.canvasHeight;
+ var canvasWidth = this.options.canvasWidth;
+
+ for(var y=0; y < canvasHeight; y++){
+ for(var x=0; x < canvasWidth; x++){
+ var yp = y * 1.0 / canvasHeight * 2 - 1;
+ var xp = x * 1.0 / canvasWidth * 2 - 1;
+
+ var ray = scene.camera.getRay(xp, yp);
+
+ var color = this.getPixelColor(ray, scene);
+
+ this.setPixel(x, y, color);
+ }
+ }
+ },
+
+ getPixelColor: function(ray, scene){
+ var info = this.testIntersection(ray, scene, null);
+ if(info.isHit){
+ var color = this.rayTrace(info, ray, scene, 0);
+ return color;
+ }
+ return scene.background.color;
+ },
+
+ testIntersection: function(ray, scene, exclude){
+ var hits = 0;
+ var best = new Flog.RayTracer.IntersectionInfo();
+ best.distance = 2000;
+
+ for(var i=0; i<scene.shapes.length; i++){
+ var shape = scene.shapes[i];
+
+ if(shape != exclude){
+ var info = shape.intersect(ray);
+ if(info.isHit && info.distance >= 0 && info.distance < best.distance){
+ best = info;
+ hits++;
+ }
+ }
+ }
+ best.hitCount = hits;
+ return best;
+ },
+
+ getReflectionRay: function(P,N,V){
+ var c1 = -N.dot(V);
+ var R1 = Flog.RayTracer.Vector.prototype.add(
+ Flog.RayTracer.Vector.prototype.multiplyScalar(N, 2*c1),
+ V
+ );
+ return new Flog.RayTracer.Ray(P, R1);
+ },
+
+ rayTrace: function(info, ray, scene, depth){
+ // Calc ambient
+ var color = Flog.RayTracer.Color.prototype.multiplyScalar(info.color, scene.background.ambience);
+ var oldColor = color;
+ var shininess = Math.pow(10, info.shape.material.gloss + 1);
+
+ for(var i=0; i<scene.lights.length; i++){
+ var light = scene.lights[i];
+
+ // Calc diffuse lighting
+ var v = Flog.RayTracer.Vector.prototype.subtract(
+ light.position,
+ info.position
+ ).normalize();
+
+ if(this.options.renderDiffuse){
+ var L = v.dot(info.normal);
+ if(L > 0.0){
+ color = Flog.RayTracer.Color.prototype.add(
+ color,
+ Flog.RayTracer.Color.prototype.multiply(
+ info.color,
+ Flog.RayTracer.Color.prototype.multiplyScalar(
+ light.color,
+ L
+ )
+
+ )
+ );
+ }
+ }
+
+ // The greater the depth the more accurate the colours, but
+ // this is exponentially (!) expensive
+ if(depth <= this.options.rayDepth){
+ // calculate reflection ray
+ if(this.options.renderReflections && info.shape.material.reflection > 0)
+ {
+ var reflectionRay = this.getReflectionRay(info.position, info.normal, ray.direction);
+ var refl = this.testIntersection(reflectionRay, scene, info.shape);
+
+ if (refl.isHit && refl.distance > 0){
+ refl.color = this.rayTrace(refl, reflectionRay, scene, depth + 1);
+ } else {
+ refl.color = scene.background.color;
+ }
+
+ color = Flog.RayTracer.Color.prototype.blend(
+ color,
+ refl.color,
+ info.shape.material.reflection
+ );
+ }
+
+ // Refraction
+ /* TODO */
+ }
+
+ /* Render shadows and highlights */
+
+ var shadowInfo = new Flog.RayTracer.IntersectionInfo();
+
+ if(this.options.renderShadows){
+ var shadowRay = new Flog.RayTracer.Ray(info.position, v);
+
+ shadowInfo = this.testIntersection(shadowRay, scene, info.shape);
+ if(shadowInfo.isHit && shadowInfo.shape != info.shape /*&& shadowInfo.shape.type != 'PLANE'*/){
+ var vA = Flog.RayTracer.Color.prototype.multiplyScalar(color, 0.5);
+ var dB = (0.5 * Math.pow(shadowInfo.shape.material.transparency, 0.5));
+ color = Flog.RayTracer.Color.prototype.addScalar(vA,dB);
+ }
+ }
+
+ // Phong specular highlights
+ if(this.options.renderHighlights && !shadowInfo.isHit && info.shape.material.gloss > 0){
+ var Lv = Flog.RayTracer.Vector.prototype.subtract(
+ info.shape.position,
+ light.position
+ ).normalize();
+
+ var E = Flog.RayTracer.Vector.prototype.subtract(
+ scene.camera.position,
+ info.shape.position
+ ).normalize();
+
+ var H = Flog.RayTracer.Vector.prototype.subtract(
+ E,
+ Lv
+ ).normalize();
+
+ var glossWeight = Math.pow(Math.max(info.normal.dot(H), 0), shininess);
+ color = Flog.RayTracer.Color.prototype.add(
+ Flog.RayTracer.Color.prototype.multiplyScalar(light.color, glossWeight),
+ color
+ );
+ }
+ }
+ color.limit();
+ return color;
+ }
+};
+
+
+function renderScene(){
+ var scene = new Flog.RayTracer.Scene();
+
+ scene.camera = new Flog.RayTracer.Camera(
+ new Flog.RayTracer.Vector(0, 0, -15),
+ new Flog.RayTracer.Vector(-0.2, 0, 5),
+ new Flog.RayTracer.Vector(0, 1, 0)
+ );
+
+ scene.background = new Flog.RayTracer.Background(
+ new Flog.RayTracer.Color(0.5, 0.5, 0.5),
+ 0.4
+ );
+
+ var sphere = new Flog.RayTracer.Shape.Sphere(
+ new Flog.RayTracer.Vector(-1.5, 1.5, 2),
+ 1.5,
+ new Flog.RayTracer.Material.Solid(
+ new Flog.RayTracer.Color(0,0.5,0.5),
+ 0.3,
+ 0.0,
+ 0.0,
+ 2.0
+ )
+ );
+
+ var sphere1 = new Flog.RayTracer.Shape.Sphere(
+ new Flog.RayTracer.Vector(1, 0.25, 1),
+ 0.5,
+ new Flog.RayTracer.Material.Solid(
+ new Flog.RayTracer.Color(0.9,0.9,0.9),
+ 0.1,
+ 0.0,
+ 0.0,
+ 1.5
+ )
+ );
+
+ var plane = new Flog.RayTracer.Shape.Plane(
+ new Flog.RayTracer.Vector(0.1, 0.9, -0.5).normalize(),
+ 1.2,
+ new Flog.RayTracer.Material.Chessboard(
+ new Flog.RayTracer.Color(1,1,1),
+ new Flog.RayTracer.Color(0,0,0),
+ 0.2,
+ 0.0,
+ 1.0,
+ 0.7
+ )
+ );
+
+ scene.shapes.push(plane);
+ scene.shapes.push(sphere);
+ scene.shapes.push(sphere1);
+
+ var light = new Flog.RayTracer.Light(
+ new Flog.RayTracer.Vector(5, 10, -1),
+ new Flog.RayTracer.Color(0.8, 0.8, 0.8)
+ );
+
+ var light1 = new Flog.RayTracer.Light(
+ new Flog.RayTracer.Vector(-3, 5, -15),
+ new Flog.RayTracer.Color(0.8, 0.8, 0.8),
+ 100
+ );
+
+ scene.lights.push(light);
+ scene.lights.push(light1);
+
+ var imageWidth = 100; // $F('imageWidth');
+ var imageHeight = 100; // $F('imageHeight');
+ var pixelSize = "5,5".split(','); // $F('pixelSize').split(',');
+ var renderDiffuse = true; // $F('renderDiffuse');
+ var renderShadows = true; // $F('renderShadows');
+ var renderHighlights = true; // $F('renderHighlights');
+ var renderReflections = true; // $F('renderReflections');
+ var rayDepth = 2;//$F('rayDepth');
+
+ var raytracer = new Flog.RayTracer.Engine(
+ {
+ canvasWidth: imageWidth,
+ canvasHeight: imageHeight,
+ pixelWidth: pixelSize[0],
+ pixelHeight: pixelSize[1],
+ "renderDiffuse": renderDiffuse,
+ "renderHighlights": renderHighlights,
+ "renderShadows": renderShadows,
+ "renderReflections": renderReflections,
+ "rayDepth": rayDepth
+ }
+ );
+
+ raytracer.renderScene(scene, null, 0);
+}
+
+// Copyright 2007 Google Inc. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+// This is a JavaScript implementation of the Richards
+// benchmark from:
+//
+// http://www.cl.cam.ac.uk/~mr10/Bench.html
+//
+// The benchmark was originally implemented in BCPL by
+// Martin Richards.
+
+
+var Richards = new BenchmarkSuite('Richards', 34886, [
+ new Benchmark("Richards", runRichards)
+]);
+
+
+/**
+ * The Richards benchmark simulates the task dispatcher of an
+ * operating system.
+ **/
+function runRichards() {
+ var scheduler = new Scheduler();
+ scheduler.addIdleTask(ID_IDLE, 0, null, COUNT);
+
+ var queue = new Packet(null, ID_WORKER, KIND_WORK);
+ queue = new Packet(queue, ID_WORKER, KIND_WORK);
+ scheduler.addWorkerTask(ID_WORKER, 1000, queue);
+
+ queue = new Packet(null, ID_DEVICE_A, KIND_DEVICE);
+ queue = new Packet(queue, ID_DEVICE_A, KIND_DEVICE);
+ queue = new Packet(queue, ID_DEVICE_A, KIND_DEVICE);
+ scheduler.addHandlerTask(ID_HANDLER_A, 2000, queue);
+
+ queue = new Packet(null, ID_DEVICE_B, KIND_DEVICE);
+ queue = new Packet(queue, ID_DEVICE_B, KIND_DEVICE);
+ queue = new Packet(queue, ID_DEVICE_B, KIND_DEVICE);
+ scheduler.addHandlerTask(ID_HANDLER_B, 3000, queue);
+
+ scheduler.addDeviceTask(ID_DEVICE_A, 4000, null);
+
+ scheduler.addDeviceTask(ID_DEVICE_B, 5000, null);
+
+ scheduler.schedule();
+
+ if (scheduler.queueCount != EXPECTED_QUEUE_COUNT ||
+ scheduler.holdCount != EXPECTED_HOLD_COUNT) {
+ var msg =
+ "Error during execution: queueCount = " + scheduler.queueCount +
+ ", holdCount = " + scheduler.holdCount + ".";
+ print(msg);
+ }
+}
+
+var COUNT = 1000;
+
+/**
+ * These two constants specify how many times a packet is queued and
+ * how many times a task is put on hold in a correct run of richards.
+ * They don't have any meaning a such but are characteristic of a
+ * correct run so if the actual queue or hold count is different from
+ * the expected there must be a bug in the implementation.
+ **/
+var EXPECTED_QUEUE_COUNT = 2322;
+var EXPECTED_HOLD_COUNT = 928;
+
+
+/**
+ * A scheduler can be used to schedule a set of tasks based on their relative
+ * priorities. Scheduling is done by maintaining a list of task control blocks
+ * which holds tasks and the data queue they are processing.
+ * @constructor
+ */
+function Scheduler() {
+ this.queueCount = 0;
+ this.holdCount = 0;
+ this.blocks = new Array(NUMBER_OF_IDS);
+ this.list = null;
+ this.currentTcb = null;
+ this.currentId = null;
+}
+
+var ID_IDLE = 0;
+var ID_WORKER = 1;
+var ID_HANDLER_A = 2;
+var ID_HANDLER_B = 3;
+var ID_DEVICE_A = 4;
+var ID_DEVICE_B = 5;
+var NUMBER_OF_IDS = 6;
+
+var KIND_DEVICE = 0;
+var KIND_WORK = 1;
+
+/**
+ * Add an idle task to this scheduler.
+ * @param {int} id the identity of the task
+ * @param {int} priority the task's priority
+ * @param {Packet} queue the queue of work to be processed by the task
+ * @param {int} count the number of times to schedule the task
+ */
+Scheduler.prototype.addIdleTask = function (id, priority, queue, count) {
+ this.addRunningTask(id, priority, queue, new IdleTask(this, 1, count));
+};
+
+/**
+ * Add a work task to this scheduler.
+ * @param {int} id the identity of the task
+ * @param {int} priority the task's priority
+ * @param {Packet} queue the queue of work to be processed by the task
+ */
+Scheduler.prototype.addWorkerTask = function (id, priority, queue) {
+ this.addTask(id, priority, queue, new WorkerTask(this, ID_HANDLER_A, 0));
+};
+
+/**
+ * Add a handler task to this scheduler.
+ * @param {int} id the identity of the task
+ * @param {int} priority the task's priority
+ * @param {Packet} queue the queue of work to be processed by the task
+ */
+Scheduler.prototype.addHandlerTask = function (id, priority, queue) {
+ this.addTask(id, priority, queue, new HandlerTask(this));
+};
+
+/**
+ * Add a handler task to this scheduler.
+ * @param {int} id the identity of the task
+ * @param {int} priority the task's priority
+ * @param {Packet} queue the queue of work to be processed by the task
+ */
+Scheduler.prototype.addDeviceTask = function (id, priority, queue) {
+ this.addTask(id, priority, queue, new DeviceTask(this))
+};
+
+/**
+ * Add the specified task and mark it as running.
+ * @param {int} id the identity of the task
+ * @param {int} priority the task's priority
+ * @param {Packet} queue the queue of work to be processed by the task
+ * @param {Task} task the task to add
+ */
+Scheduler.prototype.addRunningTask = function (id, priority, queue, task) {
+ this.addTask(id, priority, queue, task);
+ this.currentTcb.setRunning();
+};
+
+/**
+ * Add the specified task to this scheduler.
+ * @param {int} id the identity of the task
+ * @param {int} priority the task's priority
+ * @param {Packet} queue the queue of work to be processed by the task
+ * @param {Task} task the task to add
+ */
+Scheduler.prototype.addTask = function (id, priority, queue, task) {
+ this.currentTcb = new TaskControlBlock(this.list, id, priority, queue, task);
+ this.list = this.currentTcb;
+ this.blocks[id] = this.currentTcb;
+};
+
+/**
+ * Execute the tasks managed by this scheduler.
+ */
+Scheduler.prototype.schedule = function () {
+ this.currentTcb = this.list;
+ while (this.currentTcb != null) {
+ if (this.currentTcb.isHeldOrSuspended()) {
+ this.currentTcb = this.currentTcb.link;
+ } else {
+ this.currentId = this.currentTcb.id;
+ this.currentTcb = this.currentTcb.run();
+ }
+ }
+};
+
+/**
+ * Release a task that is currently blocked and return the next block to run.
+ * @param {int} id the id of the task to suspend
+ */
+Scheduler.prototype.release = function (id) {
+ var tcb = this.blocks[id];
+ if (tcb == null) return tcb;
+ tcb.markAsNotHeld();
+ if (tcb.priority > this.currentTcb.priority) {
+ return tcb;
+ } else {
+ return this.currentTcb;
+ }
+};
+
+/**
+ * Block the currently executing task and return the next task control block
+ * to run. The blocked task will not be made runnable until it is explicitly
+ * released, even if new work is added to it.
+ */
+Scheduler.prototype.holdCurrent = function () {
+ this.holdCount++;
+ this.currentTcb.markAsHeld();
+ return this.currentTcb.link;
+};
+
+/**
+ * Suspend the currently executing task and return the next task control block
+ * to run. If new work is added to the suspended task it will be made runnable.
+ */
+Scheduler.prototype.suspendCurrent = function () {
+ this.currentTcb.markAsSuspended();
+ return this.currentTcb;
+};
+
+/**
+ * Add the specified packet to the end of the worklist used by the task
+ * associated with the packet and make the task runnable if it is currently
+ * suspended.
+ * @param {Packet} packet the packet to add
+ */
+Scheduler.prototype.queue = function (packet) {
+ var t = this.blocks[packet.id];
+ if (t == null) return t;
+ this.queueCount++;
+ packet.link = null;
+ packet.id = this.currentId;
+ return t.checkPriorityAdd(this.currentTcb, packet);
+};
+
+/**
+ * A task control block manages a task and the queue of work packages associated
+ * with it.
+ * @param {TaskControlBlock} link the preceding block in the linked block list
+ * @param {int} id the id of this block
+ * @param {int} priority the priority of this block
+ * @param {Packet} queue the queue of packages to be processed by the task
+ * @param {Task} task the task
+ * @constructor
+ */
+function TaskControlBlock(link, id, priority, queue, task) {
+ this.link = link;
+ this.id = id;
+ this.priority = priority;
+ this.queue = queue;
+ this.task = task;
+ if (queue == null) {
+ this.state = STATE_SUSPENDED;
+ } else {
+ this.state = STATE_SUSPENDED_RUNNABLE;
+ }
+}
+
+/**
+ * The task is running and is currently scheduled.
+ */
+var STATE_RUNNING = 0;
+
+/**
+ * The task has packets left to process.
+ */
+var STATE_RUNNABLE = 1;
+
+/**
+ * The task is not currently running. The task is not blocked as such and may
+* be started by the scheduler.
+ */
+var STATE_SUSPENDED = 2;
+
+/**
+ * The task is blocked and cannot be run until it is explicitly released.
+ */
+var STATE_HELD = 4;
+
+var STATE_SUSPENDED_RUNNABLE = STATE_SUSPENDED | STATE_RUNNABLE;
+var STATE_NOT_HELD = ~STATE_HELD;
+
+TaskControlBlock.prototype.setRunning = function () {
+ this.state = STATE_RUNNING;
+};
+
+TaskControlBlock.prototype.markAsNotHeld = function () {
+ this.state = this.state & STATE_NOT_HELD;
+};
+
+TaskControlBlock.prototype.markAsHeld = function () {
+ this.state = this.state | STATE_HELD;
+};
+
+TaskControlBlock.prototype.isHeldOrSuspended = function () {
+ return (this.state & STATE_HELD) != 0 || (this.state == STATE_SUSPENDED);
+};
+
+TaskControlBlock.prototype.markAsSuspended = function () {
+ this.state = this.state | STATE_SUSPENDED;
+};
+
+TaskControlBlock.prototype.markAsRunnable = function () {
+ this.state = this.state | STATE_RUNNABLE;
+};
+
+/**
+ * Runs this task, if it is ready to be run, and returns the next task to run.
+ */
+TaskControlBlock.prototype.run = function () {
+ var packet;
+ if (this.state == STATE_SUSPENDED_RUNNABLE) {
+ packet = this.queue;
+ this.queue = packet.link;
+ if (this.queue == null) {
+ this.state = STATE_RUNNING;
+ } else {
+ this.state = STATE_RUNNABLE;
+ }
+ } else {
+ packet = null;
+ }
+ return this.task.run(packet);
+};
+
+/**
+ * Adds a packet to the worklist of this block's task, marks this as runnable if
+ * necessary, and returns the next runnable object to run (the one
+ * with the highest priority).
+ */
+TaskControlBlock.prototype.checkPriorityAdd = function (task, packet) {
+ if (this.queue == null) {
+ this.queue = packet;
+ this.markAsRunnable();
+ if (this.priority > task.priority) return this;
+ } else {
+ this.queue = packet.addTo(this.queue);
+ }
+ return task;
+};
+
+TaskControlBlock.prototype.toString = function () {
+ return "tcb { " + this.task + "@" + this.state + " }";
+};
+
+/**
+ * An idle task doesn't do any work itself but cycles control between the two
+ * device tasks.
+ * @param {Scheduler} scheduler the scheduler that manages this task
+ * @param {int} v1 a seed value that controls how the device tasks are scheduled
+ * @param {int} count the number of times this task should be scheduled
+ * @constructor
+ */
+function IdleTask(scheduler, v1, count) {
+ this.scheduler = scheduler;
+ this.v1 = v1;
+ this.count = count;
+}
+
+IdleTask.prototype.run = function (packet) {
+ this.count--;
+ if (this.count == 0) return this.scheduler.holdCurrent();
+ if ((this.v1 & 1) == 0) {
+ this.v1 = this.v1 >> 1;
+ return this.scheduler.release(ID_DEVICE_A);
+ } else {
+ this.v1 = (this.v1 >> 1) ^ 0xD008;
+ return this.scheduler.release(ID_DEVICE_B);
+ }
+};
+
+IdleTask.prototype.toString = function () {
+ return "IdleTask"
+};
+
+/**
+ * A task that suspends itself after each time it has been run to simulate
+ * waiting for data from an external device.
+ * @param {Scheduler} scheduler the scheduler that manages this task
+ * @constructor
+ */
+function DeviceTask(scheduler) {
+ this.scheduler = scheduler;
+ this.v1 = null;
+}
+
+DeviceTask.prototype.run = function (packet) {
+ if (packet == null) {
+ if (this.v1 == null) return this.scheduler.suspendCurrent();
+ var v = this.v1;
+ this.v1 = null;
+ return this.scheduler.queue(v);
+ } else {
+ this.v1 = packet;
+ return this.scheduler.holdCurrent();
+ }
+};
+
+DeviceTask.prototype.toString = function () {
+ return "DeviceTask";
+};
+
+/**
+ * A task that manipulates work packets.
+ * @param {Scheduler} scheduler the scheduler that manages this task
+ * @param {int} v1 a seed used to specify how work packets are manipulated
+ * @param {int} v2 another seed used to specify how work packets are manipulated
+ * @constructor
+ */
+function WorkerTask(scheduler, v1, v2) {
+ this.scheduler = scheduler;
+ this.v1 = v1;
+ this.v2 = v2;
+}
+
+WorkerTask.prototype.run = function (packet) {
+ if (packet == null) {
+ return this.scheduler.suspendCurrent();
+ } else {
+ if (this.v1 == ID_HANDLER_A) {
+ this.v1 = ID_HANDLER_B;
+ } else {
+ this.v1 = ID_HANDLER_A;
+ }
+ packet.id = this.v1;
+ packet.a1 = 0;
+ for (var i = 0; i < DATA_SIZE; i++) {
+ this.v2++;
+ if (this.v2 > 26) this.v2 = 1;
+ packet.a2[i] = this.v2;
+ }
+ return this.scheduler.queue(packet);
+ }
+};
+
+WorkerTask.prototype.toString = function () {
+ return "WorkerTask";
+};
+
+/**
+ * A task that manipulates work packets and then suspends itself.
+ * @param {Scheduler} scheduler the scheduler that manages this task
+ * @constructor
+ */
+function HandlerTask(scheduler) {
+ this.scheduler = scheduler;
+ this.v1 = null;
+ this.v2 = null;
+}
+
+HandlerTask.prototype.run = function (packet) {
+ if (packet != null) {
+ if (packet.kind == KIND_WORK) {
+ this.v1 = packet.addTo(this.v1);
+ } else {
+ this.v2 = packet.addTo(this.v2);
+ }
+ }
+ if (this.v1 != null) {
+ var count = this.v1.a1;
+ var v;
+ if (count < DATA_SIZE) {
+ if (this.v2 != null) {
+ v = this.v2;
+ this.v2 = this.v2.link;
+ v.a1 = this.v1.a2[count];
+ this.v1.a1 = count + 1;
+ return this.scheduler.queue(v);
+ }
+ } else {
+ v = this.v1;
+ this.v1 = this.v1.link;
+ return this.scheduler.queue(v);
+ }
+ }
+ return this.scheduler.suspendCurrent();
+};
+
+HandlerTask.prototype.toString = function () {
+ return "HandlerTask";
+};
+
+/* --- *
+ * P a c k e t
+ * --- */
+
+var DATA_SIZE = 4;
+
+/**
+ * A simple package of data that is manipulated by the tasks. The exact layout
+ * of the payload data carried by a packet is not importaint, and neither is the
+ * nature of the work performed on packets by the tasks.
+ *
+ * Besides carrying data, packets form linked lists and are hence used both as
+ * data and worklists.
+ * @param {Packet} link the tail of the linked list of packets
+ * @param {int} id an ID for this packet
+ * @param {int} kind the type of this packet
+ * @constructor
+ */
+function Packet(link, id, kind) {
+ this.link = link;
+ this.id = id;
+ this.kind = kind;
+ this.a1 = 0;
+ this.a2 = new Array(DATA_SIZE);
+}
+
+/**
+ * Add this packet to the end of a worklist, and return the worklist.
+ * @param {Packet} queue the worklist to add this packet to
+ */
+Packet.prototype.addTo = function (queue) {
+ this.link = null;
+ if (queue == null) return this;
+ var peek, next = queue;
+ while ((peek = next.link) != null)
+ next = peek;
+ next.link = this;
+ return queue;
+};
+
+Packet.prototype.toString = function () {
+ return "Packet";
+};
+// Copyright 2008 Google Inc. All Rights Reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+load('base.js');
+load('crypto.js');
+
+function PrintResult(name, result) {
+ print(name + ': ' + result);
+}
+
+
+function PrintScore(score) {
+ print('----');
+ print('Score: ' + score);
+}
+
+
+BenchmarkSuite.RunSuites({ NotifyResult: PrintResult,
+ NotifyScore: PrintScore });
+// Copyright 2008 Google Inc. All Rights Reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+load('base.js');
+load('deltablue.js');
+
+function PrintResult(name, result) {
+ print(name + ': ' + result);
+}
+
+
+function PrintScore(score) {
+ print('----');
+ print('Score: ' + score);
+}
+
+
+BenchmarkSuite.RunSuites({ NotifyResult: PrintResult,
+ NotifyScore: PrintScore });
+// Copyright 2008 Google Inc. All Rights Reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+load('base.js');
+load('earley-boyer.js');
+
+function PrintResult(name, result) {
+ print(name + ': ' + result);
+}
+
+
+function PrintScore(score) {
+ print('----');
+ print('Score: ' + score);
+}
+
+
+BenchmarkSuite.RunSuites({ NotifyResult: PrintResult,
+ NotifyScore: PrintScore });
+// Copyright 2008 Google Inc. All Rights Reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+load('base.js');
+load('richards.js');
+load('deltablue.js');
+load('crypto.js');
+load('raytrace.js');
+load('earley-boyer.js');
+
+
+function PrintResult(name, result) {
+ print(name + ': ' + result);
+}
+
+
+function PrintScore(score) {
+ print('----');
+ print('Score: ' + score);
+}
+
+
+BenchmarkSuite.RunSuites({ NotifyResult: PrintResult,
+ NotifyScore: PrintScore });
+// Copyright 2008 Google Inc. All Rights Reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+load('base.js');
+load('raytrace.js');
+
+function PrintResult(name, result) {
+ print(name + ': ' + result);
+}
+
+
+function PrintScore(score) {
+ print('----');
+ print('Score: ' + score);
+}
+
+
+BenchmarkSuite.RunSuites({ NotifyResult: PrintResult,
+ NotifyScore: PrintScore });
+// Copyright 2008 Google Inc. All Rights Reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+load('base.js');
+load('richards.js');
+
+function PrintResult(name, result) {
+ print(name + ': ' + result);
+}
+
+
+function PrintScore(score) {
+ print('----');
+ print('Score: ' + score);
+}
+
+
+BenchmarkSuite.RunSuites({ NotifyResult: PrintResult,
+ NotifyScore: PrintScore });
+</script>
+
+
+<script id="yui" id="x">
+/*
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 3.0.0
+build: 1549
+*/
+(function(){var I={},B=new Date().getTime(),A,E,H=function(){if(window.addEventListener){return function(M,L,K,J){M.addEventListener(L,K,(!!J));};}else{if(window.attachEvent){return function(L,K,J){L.attachEvent("on"+K,J);};}else{return function(){};}}}(),F=function(){if(window.removeEventListener){return function(M,L,K,J){M.removeEventListener(L,K,!!J);};}else{if(window.detachEvent){return function(L,K,J){L.detachEvent("on"+K,J);};}else{return function(){};}}}(),D=function(){YUI.Env.windowLoaded=true;YUI.Env.DOMReady=true;F(window,"load",D);},C={"io.xdrReady":1,"io.xdrResponse":1},G=Array.prototype.slice;if(typeof YUI==="undefined"||!YUI){YUI=function(O,N,M,L,J){var K=this,R=arguments,Q,P=R.length;if(!(K instanceof YUI)){return new YUI(O,N,M,L,J);}else{K._init();for(Q=0;Q<P;Q++){K._config(R[Q]);}K._setup();return K;}};}YUI.prototype={_config:function(N){N=N||{};var O=this.config,L,K,J,M;M=O.modules;for(L in N){if(M&&L=="modules"){J=N[L];for(K in J){if(J.hasOwnProperty(K)){M[K]=J[K];}}}else{if(L=="win"){O[L]=N[L].contentWindow||N[L];O.doc=O[L].document;}else{O[L]=N[L];}}}},_init:function(){var J="3.0.0",K=this;if(J.indexOf("@")>-1){J="test";}K.version=J;K.Env={mods:{},cdn:"http://yui.yahooapis.com/"+J+"/build/",bootstrapped:false,_idx:0,_used:{},_attached:{},_yidx:0,_uidx:0,_loaded:{}};K.Env._loaded[J]={};if(YUI.Env){K.Env._yidx=(++YUI.Env._yidx);K.Env._guidp=("yui_"+J+"-"+K.Env._yidx+"-"+B).replace(/\./g,"_");K.id=K.stamp(K);I[K.id]=K;}K.constructor=YUI;K.config={win:window||{},doc:document,debug:true,useBrowserConsole:true,throwFail:true,bootstrap:true,fetchCSS:true,base:function(){var L,M,O,N;M=document.getElementsByTagName("script");for(O=0;O<M.length;O=O+1){N=M[O].src.match(/^(.*)yui\/yui[\.\-].*js(\?.*)?$/);L=N&&N[1];if(L){break;}}return L||K.Env.cdn;}(),loaderPath:"loader/loader-min.js"};},_setup:function(J){this.use("yui-base");},applyTo:function(P,O,L){if(!(O in C)){this.log(O+": applyTo not allowed","warn","yui");return null;}var K=I[P],N,J,M;if(K){N=O.split(".");J=K;for(M=0;M<N.length;M=M+1){J=J[N[M]];if(!J){this.log("applyTo not found: "+O,"warn","yui");}}return J.apply(K,L);}return null;},add:function(K,M,J,L){YUI.Env.mods[K]={name:K,fn:M,version:J,details:L||{}};return this;},_attach:function(K,O){var T=YUI.Env.mods,L=this.Env._attached,Q,P=K.length,M,N,R,S,J;for(Q=0;Q<P;Q=Q+1){M=K[Q];N=T[M];if(!L[M]&&N){L[M]=true;R=N.details;S=R.requires;J=R.use;if(S){this._attach(this.Array(S));}if(N.fn){N.fn(this);}if(J){this._attach(this.Array(J));}}}},use:function(){if(this._loading){this._useQueue=this._useQueue||new this.Queue();this._useQueue.add(G.call(arguments,0));return this;}var K=this,U=G.call(arguments,0),Z=YUI.Env.mods,b=K.Env._used,V,O=U[0],M=false,X=U[U.length-1],W=K.config.bootstrap,P,R,N,Q=[],J=[],S=K.config.fetchCSS,T=function(d){if(b[d]){return;}var Y=Z[d],c,e,a;if(Y){b[d]=true;e=Y.details.requires;a=Y.details.use;}else{if(!YUI.Env._loaded[K.version][d]){Q.push(d);}else{b[d]=true;}}if(e){if(K.Lang.isString(e)){T(e);}else{for(c=0;c<e.length;c=c+1){T(e[c]);}}}J.push(d);},L;if(typeof X==="function"){U.pop();}else{X=null;}L=function(Y){Y=Y||{success:true,msg:"not dynamic"};if(X){X(K,Y);}if(K.fire){K.fire("yui:load",K,Y);}K._loading=false;if(K._useQueue&&K._useQueue.size()&&!K._loading){K.use.apply(K,K._useQueue.next());}};if(O==="*"){U=[];for(P in Z){if(Z.hasOwnProperty(P)){U.push(P);}}if(X){U.push(X);}return K.use.apply(K,U);}if(K.Loader){M=true;V=new K.Loader(K.config);V.require(U);V.ignoreRegistered=true;V.allowRollup=false;V.calculate(null,(S)?null:"js");U=V.sorted;}N=U.length;for(R=0;R<N;R=R+1){T(U[R]);}N=Q.length;if(N){Q=K.Object.keys(K.Array.hash(Q));}if(W&&N&&K.Loader){K._loading=true;V=new K.Loader(K.config);V.onSuccess=L;V.onFailure=L;V.onTimeout=L;V.context=K;V.attaching=U;V.require((S)?Q:U);V.insert(null,(S)?null:"js");}else{if(W&&N&&K.Get&&!K.Env.bootstrapped){K._loading=true;U=K.Array(arguments,0,true);K.Get.script(K.config.base+K.config.loaderPath,{onEnd:function(){K._loading=false;K.Env.bootstrapped=true;K._attach(["loader"]);K.use.apply(K,U);}});return K;}else{if(N){}K._attach(J);L();}}return K;},namespace:function(){var J=arguments,N=null,L,K,M;for(L=0;L<J.length;L=L+1){M=(""+J[L]).split(".");N=this;for(K=(M[0]=="YAHOO")?1:0;K<M.length;K=K+1){N[M[K]]=N[M[K]]||{};N=N[M[K]];}}return N;},log:function(){},error:function(K,J){if(this.config.throwFail){throw (J||new Error(K));}else{this.message(K,"error");}return this;},guid:function(J){var K=this.Env._guidp+(++this.Env._uidx);return(J)?(J+K):K;},stamp:function(L,M){if(!L){return L;}var J=(typeof L==="string")?L:L._yuid;if(!J){J=this.guid();if(!M){try{L._yuid=J;}catch(K){J=null;}}}return J;}};A=YUI.prototype;for(E in A){YUI[E]=A[E];}YUI._init();H(window,"load",D);YUI.Env.add=H;YUI.Env.remove=F;})();YUI.add("yui-base",function(B){function A(){this._init();this.add.apply(this,arguments);}A.prototype={_init:function(){this._q=[];},next:function(){return this._q.shift();},add:function(){B.Array.each(B.Array(arguments,0,true),function(C){this._q.push(C);},this);return this;},size:function(){return this._q.length;}};B.Queue=A;(function(){B.Lang=B.Lang||{};var R=B.Lang,G="array",I="boolean",D="date",M="error",S="function",H="number",K="null",F="object",O="regexp",N="string",C=Object.prototype.toString,P="undefined",E={"undefined":P,"number":H,"boolean":I,"string":N,"[object Function]":S,"[object RegExp]":O,"[object Array]":G,"[object Date]":D,"[object Error]":M},J=/^\s+|\s+$/g,Q="";R.isArray=function(L){return R.type(L)===G;};R.isBoolean=function(L){return typeof L===I;};R.isFunction=function(L){return R.type(L)===S;};R.isDate=function(L){return R.type(L)===D;};R.isNull=function(L){return L===null;};R.isNumber=function(L){return typeof L===H&&isFinite(L);};R.isObject=function(T,L){return(T&&(typeof T===F||(!L&&R.isFunction(T))))||false;};R.isString=function(L){return typeof L===N;};R.isUndefined=function(L){return typeof L===P;};R.trim=function(L){try{return L.replace(J,Q);}catch(T){return L;}};R.isValue=function(T){var L=R.type(T);
+switch(L){case H:return isFinite(T);case K:case P:return false;default:return !!(L);}};R.type=function(L){return E[typeof L]||E[C.call(L)]||(L?F:K);};})();(function(){var C=B.Lang,D=Array.prototype,E=function(M,J,L){var I=(L)?2:B.Array.test(M),H,G,F;if(I){try{return D.slice.call(M,J||0);}catch(K){F=[];for(H=0,G=M.length;H<G;H=H+1){F.push(M[H]);}return F;}}else{return[M];}};B.Array=E;E.test=function(H){var F=0;if(C.isObject(H)){if(C.isArray(H)){F=1;}else{try{if("length" in H&&!("tagName" in H)&&!("alert" in H)&&(!B.Lang.isFunction(H.size)||H.size()>1)){F=2;}}catch(G){}}}return F;};E.each=(D.forEach)?function(F,G,H){D.forEach.call(F||[],G,H||B);return B;}:function(G,I,J){var F=(G&&G.length)||0,H;for(H=0;H<F;H=H+1){I.call(J||B,G[H],H,G);}return B;};E.hash=function(H,G){var K={},F=H.length,J=G&&G.length,I;for(I=0;I<F;I=I+1){K[H[I]]=(J&&J>I)?G[I]:true;}return K;};E.indexOf=(D.indexOf)?function(F,G){return D.indexOf.call(F,G);}:function(F,H){for(var G=0;G<F.length;G=G+1){if(F[G]===H){return G;}}return -1;};E.numericSort=function(G,F){return(G-F);};E.some=(D.some)?function(F,G,H){return D.some.call(F,G,H);}:function(G,I,J){var F=G.length,H;for(H=0;H<F;H=H+1){if(I.call(J,G[H],H,G)){return true;}}return false;};})();(function(){var D=B.Lang,C="__",E=function(H,G){var F=G.toString;if(D.isFunction(F)&&F!=Object.prototype.toString){H.toString=F;}};B.merge=function(){var G=arguments,I={},H,F=G.length;for(H=0;H<F;H=H+1){B.mix(I,G[H],true);}return I;};B.mix=function(F,O,H,N,L,M){if(!O||!F){return F||B;}if(L){switch(L){case 1:return B.mix(F.prototype,O.prototype,H,N,0,M);case 2:B.mix(F.prototype,O.prototype,H,N,0,M);break;case 3:return B.mix(F,O.prototype,H,N,0,M);case 4:return B.mix(F.prototype,O,H,N,0,M);default:}}var K=M&&D.isArray(F),J,I,G;if(N&&N.length){for(J=0,I=N.length;J<I;++J){G=N[J];if(G in O){if(M&&D.isObject(F[G],true)){B.mix(F[G],O[G]);}else{if(!K&&(H||!(G in F))){F[G]=O[G];}else{if(K){F.push(O[G]);}}}}}}else{for(J in O){if(M&&D.isObject(F[J],true)){B.mix(F[J],O[J]);}else{if(!K&&(H||!(J in F))){F[J]=O[J];}else{if(K){F.push(O[J]);}}}}if(B.UA.ie){E(F,O);}}return F;};B.cached=function(H,F,G){F=F||{};return function(L,K){var J=(K)?Array.prototype.join.call(arguments,C):L,I=F[J];if(!(J in F)||(G&&F[J]==G)){F[J]=H.apply(H,arguments);}return F[J];};};})();(function(){B.Object=function(H){var G=function(){};G.prototype=H;return new G();};var E=B.Object,D=undefined,C=function(J,I){var H=(I===2),F=(H)?0:[],G;for(G in J){if(H){F++;}else{if(J.hasOwnProperty(G)){F.push((I)?J[G]:G);}}}return F;};E.keys=function(F){return C(F);};E.values=function(F){return C(F,1);};E.size=function(F){return C(F,2);};E.hasKey=function(G,F){return(F in G);};E.hasValue=function(G,F){return(B.Array.indexOf(E.values(G),F)>-1);};E.owns=function(G,F){return(G.hasOwnProperty(F));};E.each=function(J,I,K,H){var G=K||B,F;for(F in J){if(H||J.hasOwnProperty(F)){I.call(G,J[F],F,J);}}return B;};E.getValue=function(J,I){var H=B.Array(I),F=H.length,G;for(G=0;J!==D&&G<F;G=G+1){J=J[H[G]];}return J;};E.setValue=function(L,J,K){var I=B.Array(J),H=I.length-1,F,G=L;if(H>=0){for(F=0;G!==D&&F<H;F=F+1){G=G[I[F]];}if(G!==D){G[I[F]]=K;}else{return D;}}return L;};})();B.UA=function(){var F=function(J){var K=0;return parseFloat(J.replace(/\./g,function(){return(K++==1)?"":".";}));},I=navigator,H={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:I.cajaVersion,secure:false,os:null},E=I&&I.userAgent,G=B.config.win.location,D=G&&G.href,C;H.secure=D&&(D.toLowerCase().indexOf("https")===0);if(E){if((/windows|win32/i).test(E)){H.os="windows";}else{if((/macintosh/i).test(E)){H.os="macintosh";}}if((/KHTML/).test(E)){H.webkit=1;}C=E.match(/AppleWebKit\/([^\s]*)/);if(C&&C[1]){H.webkit=F(C[1]);if(/ Mobile\//.test(E)){H.mobile="Apple";}else{C=E.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/);if(C){H.mobile=C[0];}}C=E.match(/AdobeAIR\/([^\s]*)/);if(C){H.air=C[0];}}if(!H.webkit){C=E.match(/Opera[\s\/]([^\s]*)/);if(C&&C[1]){H.opera=F(C[1]);C=E.match(/Opera Mini[^;]*/);if(C){H.mobile=C[0];}}else{C=E.match(/MSIE\s([^;]*)/);if(C&&C[1]){H.ie=F(C[1]);}else{C=E.match(/Gecko\/([^\s]*)/);if(C){H.gecko=1;C=E.match(/rv:([^\s\)]*)/);if(C&&C[1]){H.gecko=F(C[1]);}}}}}}return H;}();(function(){var F=["yui-base"],D,I=B.config,H=YUI.Env.mods,G,E;B.use.apply(B,F);if(I.core){D=I.core;}else{D=[];G=["get","loader","yui-log","yui-later"];for(E=0;E<G.length;E++){if(H[G[E]]){D.push(G[E]);}}}B.use.apply(B,D);})();},"3.0.0");YUI.add("get",function(A){(function(){var C=A.UA,B=A.Lang,E="text/javascript",F="text/css",D="stylesheet";A.Get=function(){var M={},K=0,U=false,W=function(a,X,b){var Y=b||A.config.win,c=Y.document,e=c.createElement(a),Z;for(Z in X){if(X[Z]&&X.hasOwnProperty(Z)){e.setAttribute(Z,X[Z]);}}return e;},T=function(Y,Z,X){var a={id:A.guid(),type:F,rel:D,href:Y};if(X){A.mix(a,X);}return W("link",a,Z);},S=function(Y,Z,X){var a={id:A.guid(),type:E,src:Y};if(X){A.mix(a,X);}return W("script",a,Z);},N=function(c){var X=M[c],Y,a,g,e,j,b,Z,f;if(X){Y=X.nodes;a=Y.length;g=X.win.document;e=g.getElementsByTagName("head")[0];if(X.insertBefore){j=L(X.insertBefore,c);if(j){e=j.parentNode;}}for(b=0;b<a;b=b+1){Z=Y[b];if(Z.clearAttributes){Z.clearAttributes();}else{for(f in Z){delete Z[f];}}e.removeChild(Z);}}X.nodes=[];},P=function(Y,Z,X){return{tId:Y.tId,win:Y.win,data:Y.data,nodes:Y.nodes,msg:Z,statusText:X,purge:function(){N(this.tId);}};},O=function(b,a,X){var Y=M[b],Z;if(Y&&Y.onEnd){Z=Y.context||Y;Y.onEnd.call(Z,P(Y,a,X));}},V=function(a,Z){var X=M[a],Y;if(X.timer){clearTimeout(X.timer);}if(X.onFailure){Y=X.context||X;X.onFailure.call(Y,P(X,Z));}O(a,Z,"failure");},L=function(X,a){var Y=M[a],Z=(B.isString(X))?Y.win.document.getElementById(X):X;if(!Z){V(a,"target node not found: "+X);}return Z;},I=function(a){var X=M[a],Z,Y;if(X.timer){clearTimeout(X.timer);}X.finished=true;if(X.aborted){Z="transaction "+a+" was aborted";V(a,Z);return;}if(X.onSuccess){Y=X.context||X;X.onSuccess.call(Y,P(X));}O(a,Z,"OK");},Q=function(Z){var X=M[Z],Y;if(X.onTimeout){Y=X.context||X;X.onTimeout.call(Y,P(X));
+}O(Z,"timeout","timeout");},H=function(Z,c){var Y=M[Z],b,g,f,e,a,X,i;if(Y.timer){clearTimeout(Y.timer);}if(Y.aborted){b="transaction "+Z+" was aborted";V(Z,b);return;}if(c){Y.url.shift();if(Y.varName){Y.varName.shift();}}else{Y.url=(B.isString(Y.url))?[Y.url]:Y.url;if(Y.varName){Y.varName=(B.isString(Y.varName))?[Y.varName]:Y.varName;}}g=Y.win;f=g.document;e=f.getElementsByTagName("head")[0];if(Y.url.length===0){I(Z);return;}X=Y.url[0];if(!X){Y.url.shift();return H(Z);}if(Y.timeout){Y.timer=setTimeout(function(){Q(Z);},Y.timeout);}if(Y.type==="script"){a=S(X,g,Y.attributes);}else{a=T(X,g,Y.attributes);}J(Y.type,a,Z,X,g,Y.url.length);Y.nodes.push(a);if(Y.insertBefore){i=L(Y.insertBefore,Z);if(i){i.parentNode.insertBefore(a,i);}}else{e.appendChild(a);}if((C.webkit||C.gecko)&&Y.type==="css"){H(Z,X);}},G=function(){if(U){return;}U=true;var X,Y;for(X in M){if(M.hasOwnProperty(X)){Y=M[X];if(Y.autopurge&&Y.finished){N(Y.tId);delete M[X];}}}U=false;},R=function(Y,X,Z){Z=Z||{};var c="q"+(K++),a,b=Z.purgethreshold||A.Get.PURGE_THRESH;if(K%b===0){G();}M[c]=A.merge(Z,{tId:c,type:Y,url:X,finished:false,nodes:[]});a=M[c];a.win=a.win||A.config.win;a.context=a.context||a;a.autopurge=("autopurge" in a)?a.autopurge:(Y==="script")?true:false;if(Z.charset){a.attributes=a.attributes||{};a.attributes.charset=Z.charset;}setTimeout(function(){H(c);},0);return{tId:c};},J=function(Z,e,d,Y,c,b,X){var a=X||H;if(C.ie){e.onreadystatechange=function(){var f=this.readyState;if("loaded"===f||"complete"===f){e.onreadystatechange=null;a(d,Y);}};}else{if(C.webkit){if(Z==="script"){e.addEventListener("load",function(){a(d,Y);});}}else{e.onload=function(){a(d,Y);};e.onerror=function(f){V(d,f+": "+Y);};}}};return{PURGE_THRESH:20,_finalize:function(X){setTimeout(function(){I(X);},0);},abort:function(Y){var Z=(B.isString(Y))?Y:Y.tId,X=M[Z];if(X){X.aborted=true;}},script:function(X,Y){return R("script",X,Y);},css:function(X,Y){return R("css",X,Y);}};}();})();},"3.0.0");YUI.add("yui-log",function(A){(function(){var D=A,F="yui:log",B="undefined",C={debug:1,info:1,warn:1,error:1},E;D.log=function(I,Q,G,O){var H=D,P=H.config,K=false,N,L,J,M;if(P.debug){if(G){N=P.logExclude;L=P.logInclude;if(L&&!(G in L)){K=1;}else{if(N&&(G in N)){K=1;}}}if(!K){if(P.useBrowserConsole){J=(G)?G+": "+I:I;if(typeof console!=B&&console.log){M=(Q&&console[Q]&&(Q in C))?Q:"log";console[M](J);}else{if(typeof opera!=B){opera.postError(J);}}}if(H.fire&&!O){if(!E){H.publish(F,{broadcast:2,emitFacade:1});E=1;}H.fire(F,{msg:I,cat:Q,src:G});}}}return H;};D.message=function(){return D.log.apply(D,arguments);};})();},"3.0.0",{requires:["yui-base"]});YUI.add("yui-later",function(A){(function(){var B=A.Lang,C=function(K,E,L,G,H){K=K||0;E=E||{};var F=L,J=A.Array(G),I,D;if(B.isString(L)){F=E[L];}if(!F){}I=function(){F.apply(E,J);};D=(H)?setInterval(I,K):setTimeout(I,K);return{id:D,interval:H,cancel:function(){if(this.interval){clearInterval(D);}else{clearTimeout(D);}}};};A.later=C;B.later=C;})();},"3.0.0",{requires:["yui-base"]});YUI.add("yui",function(A){},"3.0.0",{use:["yui-base","get","yui-log","yui-later"]});
+</script>
+
+
+<script id="zimbra" type="x">
+ appContextPath = "/zimbra";
+ appCurrentSkin = "sand";
+ appExtension = ".zgz";
+ appDevMode = false;
+
+
+
+if(!window.com_zimbra_email){com_zimbra_email={}
+}com_zimbra_email.addToFilter="Add to Filter";
+com_zimbra_email.advancedSearch="Advanced Search";
+com_zimbra_email.goToUrl="Go to URL";
+com_zimbra_email.newContact="New Contact";
+com_zimbra_email.newEmail="New Email";
+com_zimbra_email.newFilter="New Filter";
+com_zimbra_email.newIM="New IM";
+com_zimbra_email.search="Search";
+if(!window.com_zimbra_date){com_zimbra_date={}
+}com_zimbra_date.appointmentNewTitle="New Appointment";
+com_zimbra_date.boundaryFalse="false";
+com_zimbra_date.boundaryTrue="true";
+com_zimbra_date["format1.boundary"]="true";
+com_zimbra_date["format1.pattern"]="(today|tonight|this morning)";
+com_zimbra_date["format1.rule"]="now";
+com_zimbra_date["format10.boundary"]="true";
+com_zimbra_date["format10.pattern"]="{monthname}.? {datenum}(st|nd|rd|th)?";
+com_zimbra_date["format10.rule"]="now month={monthname},{datenum}";
+com_zimbra_date["format11.boundary"]="true";
+com_zimbra_date["format11.pattern"]="{dayname}, {datenum} {monthname} {yearnum}";
+com_zimbra_date["format11.rule"]="{yearnum}-01-01 month={monthname},{datenum}";
+com_zimbra_date["format12.boundary"]="true";
+com_zimbra_date["format12.pattern"]="{datenum} {monthname} {yearnum}";
+com_zimbra_date["format12.rule"]="{yearnum}-01-01 month={monthname},{datenum}";
+com_zimbra_date["format13.boundary"]="true";
+com_zimbra_date["format13.pattern"]="{monthnum}/{datenum}/{yearnum}";
+com_zimbra_date["format13.rule"]="{yearnum}-{monthnum}-{datenum}";
+com_zimbra_date["format14.boundary"]="true";
+com_zimbra_date["format14.pattern"]="{yearnum}-{monthnum}-{datenum}";
+com_zimbra_date["format14.rule"]="{yearnum}-{monthnum}-{datenum}";
+com_zimbra_date["format15.boundary"]="true";
+com_zimbra_date["format15.pattern"]="{monthname} {yearnum}";
+com_zimbra_date["format15.rule"]="now month={monthname},1";
+com_zimbra_date["format16.boundary"]="true";
+com_zimbra_date["format16.pattern"]="{dayname}";
+com_zimbra_date["format16.rule"]="now +1 {dayname}";
+com_zimbra_date["format17.boundary"]="true";
+com_zimbra_date["format17.pattern"]="{datenum}(st|nd|rd|th)? {monthname}?,? {yearnum}";
+com_zimbra_date["format17.rule"]="{yearnum}-01-01 month={monthname},{datenum}";
+com_zimbra_date["format18.boundary"]="true";
+com_zimbra_date["format18.pattern"]="{dayname}, {monthname} {datenum}";
+com_zimbra_date["format18.rule"]="now month={monthname},{datenum}";
+com_zimbra_date["format19.boundary"]="true";
+com_zimbra_date["format19.pattern"]="###";
+com_zimbra_date["format19.rule"]="###";
+com_zimbra_date["format2.boundary"]="true";
+com_zimbra_date["format2.pattern"]="tomorrow";
+com_zimbra_date["format2.rule"]="now +1 day";
+com_zimbra_date["format20.boundary"]="true";
+com_zimbra_date["format20.pattern"]="###";
+com_zimbra_date["format20.rule"]="###";
+com_zimbra_date["format21.boundary"]="true";
+com_zimbra_date["format21.pattern"]="###";
+com_zimbra_date["format21.rule"]="###";
+com_zimbra_date["format22.boundary"]="true";
+com_zimbra_date["format22.pattern"]="###";
+com_zimbra_date["format22.rule"]="###";
+com_zimbra_date["format23.boundary"]="true";
+com_zimbra_date["format23.pattern"]="###";
+com_zimbra_date["format23.rule"]="###";
+com_zimbra_date["format24.boundary"]="true";
+com_zimbra_date["format24.pattern"]="###";
+com_zimbra_date["format24.rule"]="###";
+com_zimbra_date["format25.boundary"]="true";
+com_zimbra_date["format25.pattern"]="###";
+com_zimbra_date["format25.rule"]="###";
+com_zimbra_date["format26.boundary"]="true";
+com_zimbra_date["format26.pattern"]="###";
+com_zimbra_date["format26.rule"]="###";
+com_zimbra_date["format27.boundary"]="true";
+com_zimbra_date["format27.pattern"]="###";
+com_zimbra_date["format27.rule"]="###";
+com_zimbra_date["format28.boundary"]="true";
+com_zimbra_date["format28.pattern"]="###";
+com_zimbra_date["format28.rule"]="###";
+com_zimbra_date["format29.boundary"]="true";
+com_zimbra_date["format29.pattern"]="###";
+com_zimbra_date["format29.rule"]="###";
+com_zimbra_date["format3.boundary"]="true";
+com_zimbra_date["format3.pattern"]="yesterday";
+com_zimbra_date["format3.rule"]="now -1 day";
+com_zimbra_date["format30.boundary"]="true";
+com_zimbra_date["format30.pattern"]="###";
+com_zimbra_date["format30.rule"]="###";
+com_zimbra_date["format4.boundary"]="true";
+com_zimbra_date["format4.pattern"]="(this|next) {dayname}";
+com_zimbra_date["format4.rule"]="now +1 {dayname}";
+com_zimbra_date["format5.boundary"]="true";
+com_zimbra_date["format5.pattern"]="last {dayname}";
+com_zimbra_date["format5.rule"]="now -1 {dayname}";
+com_zimbra_date["format6.boundary"]="true";
+com_zimbra_date["format6.pattern"]="{weekord} {dayname} (of|in) {monthname}";
+com_zimbra_date["format6.rule"]="now date=1 +1 {monthname} {weekord} {dayname}";
+com_zimbra_date["format7.boundary"]="true";
+com_zimbra_date["format7.pattern"]="{weekord} {dayname}";
+com_zimbra_date["format7.rule"]="now {weekord} {dayname}";
+com_zimbra_date["format8.boundary"]="true";
+com_zimbra_date["format8.pattern"]="{datenum}(st|nd|rd|th) (of|in) {monthname}";
+com_zimbra_date["format8.rule"]="now month={monthname},{datenum}";
+com_zimbra_date["format9.boundary"]="true";
+com_zimbra_date["format9.pattern"]="{monthname}.? {datenum}(st|nd|rd|th)?, {yearnum}";
+com_zimbra_date["format9.rule"]="{yearnum}-01-01 month={monthname},{datenum}";
+com_zimbra_date.searchForMessages="Search for mail messages";
+com_zimbra_date.viewDay="Day";
+if(!window.com_zimbra_phone){com_zimbra_phone={}
+}com_zimbra_phone.addToContacts="Add To Contacts";
+com_zimbra_phone.search="Search";
+com_zimbra_phone.skypeCall="Skype Call";
+if(!window.com_zimbra_local){com_zimbra_local={}
+}com_zimbra_local.address="Address:";
+com_zimbra_local.changeLocation="Change Location by Zip Code";
+com_zimbra_local.coordsNotFound="Could not find coordinates for the given zip code.";
+com_zimbra_local.csgNetworkError="Could not detect your location <br> from provided zip using csgnetwork service. <br> Enter your location manually.";
+com_zimbra_local.enterAddress="Yahoo! Maps: Enter Address";
+com_zimbra_local.errorLoadingAPI="Error loading Yahoo! API";
+com_zimbra_local.latitude="Latitude";
+com_zimbra_local.local="Local";
+com_zimbra_local.localSearchBtnLabel="Local";
+com_zimbra_local.localSearchBtnTooltip="Run Y! Local search";
+com_zimbra_local.longitude="Longitude";
+com_zimbra_local.manualLocation="Manual Location";
+com_zimbra_local.maxMindError="Could not auto detect your location <br> using max mind service at this time. <br> Enter your location manually.";
+com_zimbra_local.menuItemChangeLocation="Change Location";
+com_zimbra_local.menuItemChangeLocationByZip="Change Location By Zip";
+com_zimbra_local.menuItemMyLocation="My Location";
+com_zimbra_local.menuItemPreferences="Preferences";
+com_zimbra_local.menuItemSearch="Search";
+com_zimbra_local.menuItemSearchAddress="Search Address";
+com_zimbra_local.menuItemTraffic="Traffic";
+com_zimbra_local.menuItemUpcoming="Upcoming";
+com_zimbra_local.msgBody="Hi,\nYour friend has shared you this Yahoo Map {0}. \n\nPlease access it @ \n\n";
+com_zimbra_local.msgFooter="\n\nThis email was sent to you by a user on Yahoo Maps (maps.yahoo.com).";
+com_zimbra_local.msgSubject="{0} sent this Yahoo Maps.";
+com_zimbra_local.panelTooltip="Yahoo! Local. Right click for more options ";
+com_zimbra_local.searchFor="Search for:";
+com_zimbra_local.searchYahooLocal="Search Yahoo! Local";
+com_zimbra_local.trafficTooltip="Search for Local Traffic";
+com_zimbra_local.upcomingTooltip="Search for Local Events";
+com_zimbra_local.ygeoLocalError="Could not detect your location <br> from provided zip using Yahoo! Geo-Local service. <br> Enter your location manually.";
+com_zimbra_local.ygeoapiURL="http://local.yahooapis.com/MapsService/V1/geocode";
+com_zimbra_local.zipCode="Zip Code:";
+com_zimbra_local.zipCodeInvalid="Zipcode invalid.";
+if(!window.com_zimbra_ymemoticons){com_zimbra_ymemoticons={}
+}com_zimbra_ymemoticons.preferences="Preferences";
+com_zimbra_ymemoticons.temporarilyDisableInMail="Temporarily disable in Mail";
+com_zimbra_ymemoticons.yahooEmoticons="Yahoo! Emoticons";
+function Com_Zimbra_Email(){}Com_Zimbra_Email.prototype=new ZmZimletBase();
+Com_Zimbra_Email.prototype.constructor=Com_Zimbra_Email;
+Com_Zimbra_Email.IM_NEW_IM="im new im";
+Com_Zimbra_Email.IM_NEW_BUDDY="im new buddy";
+Com_Zimbra_Email.NEW_FILTER="__new__";
+Com_Zimbra_Email.prototype.init=function(){if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)){this._composeTooltipHint=ZmMsg.leftClickComposeHint+"<br>"+ZmMsg.rightClickHint;
+this._newTooltipHint=ZmMsg.leftClickNewContactHint+"<br>"+ZmMsg.rightClickHint;
+if(appCtxt.get(ZmSetting.IM_ENABLED)){this._presenceCache=[]
+}}else{this._newTooltipHint=ZmMsg.leftClickComposeHint+"<br>"+ZmMsg.rightClickHint
+}this._yahooSocialEnabled=this.getBoolConfig("yahooSocialEnabled")
+};
+Com_Zimbra_Email.prototype._getRoster=function(){if(!this._roster&&appCtxt.get(ZmSetting.IM_ENABLED)&&!(!appCtxt.get(ZmSetting.IM_PREF_AUTO_LOGIN)&&!appCtxt.getApp(ZmApp.IM).hasRoster())){this._roster=AjxDispatcher.run("GetRoster");
+var A=this._roster.getRosterItemList();
+A.addChangeListener(new AjxListener(this,this._rosterChangeListener))
+}return this._roster
+};
+Com_Zimbra_Email.prototype._rosterChangeListener=function(I){if(I.event!=ZmEvent.E_MODIFY){return
+}var H=I.getDetail("fields");
+var D=ZmRosterItem.F_PRESENCE in H;
+if(D){var B=I.getItems();
+var F={};
+for(var G=B.length;
+--G>=0;
+){var J=B[G];
+F[J.getAddress()]=J
+}var A=this._presenceCache;
+for(var G=A.length;
+--G>=0;
+){var C=A[G];
+var J=F[C.im_addr];
+if(J){var E=document.getElementById(C.img_id);
+if(E){AjxImg.setImage(E,J.getPresence().getIcon(),true)
+}else{}}}}};
+Com_Zimbra_Email.prototype._getHtmlContent=function(D,H,C,A,B){if(C instanceof AjxEmailAddress){var G=appCtxt.getApp(ZmApp.CONTACTS);
+var E=G&&G.getContactByEmail(C.address);
+var F=this._getBuddy(E,C.address);
+if(G&&!E&&E!==null){var I=new AjxCallback(this,this._handleResponseGetContact,[D,H,C,B]);
+G.getContactByEmail(C.address,I)
+}return this._updateHtmlContent(D,H,C,E,F)
+}else{D[H++]=AjxStringUtil.htmlEncode(C);
+return H
+}};
+Com_Zimbra_Email.prototype._updateHtmlContent=function(F,L,E,G,J,B){var H;
+if(J){var D=J.getPresence();
+var I=Dwt.getNextId();
+var C=[AjxStringUtil.htmlEncode(J.getDisplayName())," ",AjxImg.getImageHtml(D.getIcon(),"display: inline; padding: 1px 8px;","id="+I)];
+H=C.join("");
+var A={contact:G,buddy:J,im_addr:J.getAddress(),img_id:I};
+this._presenceCache.push(A);
+if(this._presenceCache.length>50){this._presenceCache.splice(0,1)
+}this._getRoster()
+}else{if(G){H=AjxStringUtil.htmlEncode(G.getFullName());
+if(!H){H=AjxStringUtil.htmlEncode(E.toString())
+}}else{H=AjxStringUtil.htmlEncode(E.toString())
+}}if(B){var K=document.getElementById(B);
+if(K){K.innerHTML=H
+}}else{F[L++]=H;
+return L
+}};
+Com_Zimbra_Email.prototype._handleResponseGetContact=function(D,B,F,E,A){if(A){var C=this._getBuddy(A,F.address);
+this._updateHtmlContent(D,B,F,A,C,E)
+}};
+Com_Zimbra_Email.prototype._getBuddy=function(A,B){if(appCtxt.isChildWindow){return
+}var C;
+if(appCtxt.get(ZmSetting.IM_ENABLED)&&!(!appCtxt.get(ZmSetting.IM_PREF_AUTO_LOGIN)&&!appCtxt.getApp(ZmApp.IM).hasRoster())){C=A&&A.getBuddy();
+if(!C){C=AjxDispatcher.run("GetRoster").getRosterItem(B)
+}}return C
+};
+Com_Zimbra_Email.prototype.toolTipPoppedUp=function(C,L,M,B){var K=(L instanceof AjxEmailAddress)?L.address:L;
+if(this.isMailToLink(K)){K=(this.parseMailToLink(K)).to||K
+}var A;
+var D=false;
+if(this._yahooSocialEnabled){var H=K.split("@");
+var G=(H.length>0)?H[1]:null;
+D=(G&&G=="yahoo.com")
+}var I=AjxDispatcher.run("GetContacts");
+var J=I?I.getContactByEmail(K):null;
+if(J){var F=D?this._getYahooHint():this._composeTooltipHint;
+A=J.getToolTip(K,false,F)
+}else{var F=D?this._getYahooHint():this._newTooltipHint;
+var E={addrstr:K.toString(),hint:F};
+A=AjxTemplate.expand("abook.Contacts#TooltipNotInAddrBook",E)
+}B.innerHTML=A
+};
+Com_Zimbra_Email.prototype.createFilterMenu=function(A){if(this._filterMenu){return
+}this._newFilterMenuItem=A.getOp("ADDTOFILTER");
+this._filterMenu=new ZmPopupMenu(A);
+this._newFilterMenuItem.setMenu(this._filterMenu);
+this._rules=AjxDispatcher.run("GetFilterRules");
+this._rules.addChangeListener(new AjxListener(this,this._rulesChangeListener));
+this._resetFilterMenu()
+};
+Com_Zimbra_Email.prototype._resetFilterMenu=function(){var A=this._filterMenu.getItems();
+while(A.length>0){this._filterMenu.removeChild(A[0])
+}this._rules.loadRules(false,new AjxCallback(this,this._populateFiltersMenu))
+};
+Com_Zimbra_Email.prototype._populateFiltersMenu=function(B){var C=B.getResponse();
+var D=this._filterMenu;
+var E=new DwtMenuItem({parent:D});
+E.setText(this.getMessage("newFilter"));
+E.setImage("Plus");
+E.setData(Dwt.KEY_OBJECT,Com_Zimbra_Email.NEW_FILTER);
+E.addSelectionListener(new AjxListener(this,this._filterItemSelectionListener));
+if(C.size()){D.createSeparator()
+}for(var A=0;
+A<C.size();
+A++){this._addFilter(D,C.get(A))
+}};
+Com_Zimbra_Email.prototype._rulesChangeListener=function(A){if(A.type!=ZmEvent.S_FILTER){return
+}if(!A.handled){this._resetFilterMenu();
+A.handled=true
+}};
+Com_Zimbra_Email.prototype._filterItemSelectionListener=function(B){var A=B.item;
+var C=true;
+var E=A.getData(Dwt.KEY_OBJECT);
+if(E==Com_Zimbra_Email.NEW_FILTER){C=false;
+E=new ZmFilterRule();
+E.addAction(ZmFilterRule.A_KEEP)
+}var F=this._getAddress(this._actionObject);
+if(AjxUtil.isString(F)&&this.isMailToLink(F)){F=(this.parseMailToLink(F)).to||F
+}var D=ZmFilterRule.C_HEADER_VALUE[ZmFilterRule.C_FROM];
+E.addCondition(ZmFilterRule.TEST_HEADER,ZmFilterRule.OP_IS,F,D);
+appCtxt.getFilterRuleDialog().popup(E,C)
+};
+Com_Zimbra_Email.prototype._addFilter=function(D,C,B){var A=new DwtMenuItem({parent:D,index:B});
+A.setText(AjxStringUtil.clipByLength(C.name,20));
+A.setData(Dwt.KEY_OBJECT,C);
+A.addSelectionListener(new AjxListener(this,this._filterItemSelectionListener))
+};
+Com_Zimbra_Email.prototype.getActionMenu=function(D,I,B){var G=ZmZimletBase.prototype.getActionMenu.call(this,D,I,B);
+if(appCtxt.get(ZmSetting.FILTERS_ENABLED)&&G.getOp("ADDTOFILTER")){this.createFilterMenu(G)
+}var F=(D instanceof AjxEmailAddress)?D.getAddress():D;
+if(this.isMailToLink(F)){F=(this.parseMailToLink(F)).to||F
+}if(!appCtxt.get(ZmSetting.CONTACTS_ENABLED)){if(G.getOp("NEWCONTACT")){G.removeOp("NEWCONTACT")
+}}var A=G.getOp("NEWIM");
+if(A){if(!appCtxt.get(ZmSetting.IM_ENABLED)){G.removeOp("NEWIM")
+}else{var C=D instanceof AjxEmailAddress?D:new AjxEmailAddress(D);
+ZmImApp.updateImMenuItemByAddress(A,C)
+}}if(G.getOp("SEARCH")&&!appCtxt.get(ZmSetting.SEARCH_ENABLED)){ZmOperation.removeOperation(G,"SEARCH",G._menuItems)
+}if(G.getOp("SEARCHBUILDER")&&!appCtxt.get(ZmSetting.BROWSE_ENABLED)){ZmOperation.removeOperation(G,"SEARCHBUILDER",G._menuItems)
+}if(G.getOp("ADDTOFILTER")&&!appCtxt.get(ZmSetting.FILTERS_ENABLED)){ZmOperation.removeOperation(G,"ADDTOFILTER",G._menuItems)
+}var H=appCtxt.getApp(ZmApp.CONTACTS);
+var E=H&&H.getContactByEmail(D.address);
+if(E){ZmOperation.setOperation(G,"NEWCONTACT",ZmOperation.EDIT_CONTACT)
+}else{if(H&&!E&&E!==null){G.getOp("NEWCONTACT").setText(ZmMsg.loading);
+var J=new AjxCallback(this,this._handleResponseGetContact1,[G]);
+H.getContactByEmail(F,J)
+}else{ZmOperation.setOperation(G,"NEWCONTACT",ZmOperation.NEW_CONTACT,ZmMsg.AB_ADD_CONTACT)
+}}return G
+};
+Com_Zimbra_Email.prototype._handleResponseGetContact1=function(D,A){var B=A?ZmOperation.EDIT_CONTACT:ZmOperation.NEW_CONTACT;
+var C=A?null:ZmMsg.AB_ADD_CONTACT;
+ZmOperation.setOperation(D,"NEWCONTACT",B,C)
+};
+Com_Zimbra_Email.prototype.isMailToLink=function(A){return(!!(A.search(/mailto/i)!=-1))
+};
+Com_Zimbra_Email.prototype.parseMailToLink=function(C){var B={};
+var A=C.match(/\bsubject=([^&]+)/);
+B.subject=A?decodeURIComponent(A[1]):null;
+A=C.match(/\bto\:([^&]+)/);
+if(!A){A=C.match(/\bmailto\:([^\?]+)/i)
+}B.to=A?decodeURIComponent(A[1]):null;
+A=C.match(/\bbody=([^&]+)/);
+B.body=A?decodeURIComponent(A[1]):null;
+return B
+};
+Com_Zimbra_Email.prototype.clicked=function(A,I,J,H){var G=(I instanceof AjxEmailAddress)?I.address:I;
+if(this._yahooSocialEnabled){var B=G.split("@");
+var C=(B.length>0)?B[1]:null;
+if(C&&C=="yahoo.com"){var F="http://profiles.yahoo.com/"+B[0];
+window.open(F,"_blank");
+return
+}}var D=AjxDispatcher.run("GetContacts");
+var E=D?D.getContactByEmail(G):null;
+if(E||D==null||(AjxUtil.isString(G)&&this.isMailToLink(G))){this._actionObject=null;
+this._composeListener(H,G)
+}else{this._actionObject=I;
+this._contactListener(true)
+}};
+Com_Zimbra_Email.prototype.menuItemSelected=function(C,B,A){switch(C){case"SEARCH":this._searchListener();
+break;
+case"SEARCHBUILDER":this._browseListener();
+break;
+case"NEWEMAIL":this._composeListener(A);
+break;
+case"NEWIM":this._newImListener(A);
+break;
+case"NEWCONTACT":this._contactListener(true);
+break;
+case"ADDTOFILTER":this._filterListener();
+break;
+case"GOTOURL":this._goToUrlListener();
+break
+}};
+Com_Zimbra_Email.prototype._getYahooHint=function(){var B=[];
+var A=0;
+B[A++]="<center><table border=0><tr><td valign=top><div class='ImgWebSearch'></div></td><td>";
+B[A++]=ZmMsg.leftClickYahoohint;
+B[A++]="<div class='TooltipHint'>";
+B[A++]=ZmMsg.rightClickHint;
+B[A++]="</div></td></tr></table></center>";
+return B.join("")
+};
+Com_Zimbra_Email.prototype._getAddress=function(A){return(A.constructor==AjxEmailAddress)?A.address:A
+};
+Com_Zimbra_Email.prototype._contactListener=function(B){var A=new AjxCallback(this,this._handleLoadContact,[B]);
+AjxDispatcher.require(["ContactsCore","Contacts"],false,A,null,true)
+};
+Com_Zimbra_Email.prototype._newImListener=function(A){ZmImApp.getImMenuItemListener().handleEvent(A)
+};
+Com_Zimbra_Email.prototype._getActionedContact=function(B){var A;
+var C=this._actionObject;
+if(this._actionObject){if(this._actionObject instanceof ZmContact){A=this._actionObject
+}else{if(AjxUtil.isString(this._actionObject)){C=this._getAddress(this._actionObject);
+if(this.isMailToLink(C)){C=(this.parseMailToLink(C)).to||C
+}A=AjxDispatcher.run("GetContacts").getContactByEmail(C)
+}else{A=AjxDispatcher.run("GetContacts").getContactByEmail(this._actionObject.address)
+}}}if(A==null&&B){A=new ZmContact(null);
+A.initFromEmail(C)
+}return A
+};
+Com_Zimbra_Email.prototype._handleLoadContact=function(B){var A=this._getActionedContact(true);
+if(window.parentAppCtxt){var C=window.parentAppCtxt.getApp(ZmApp.CONTACTS);
+C.getContactController().show(A,B)
+}else{AjxDispatcher.run("GetContactController").show(A,B)
+}};
+Com_Zimbra_Email.prototype._composeListener=function(B,E){E=(this._actionObject)?this._getAddress(this._actionObject):E;
+if(!E){E=""
+}var D={};
+var A=(!appCtxt.get(ZmSetting.NEW_WINDOW_COMPOSE)&&B&&B.shiftKey)||(appCtxt.get(ZmSetting.NEW_WINDOW_COMPOSE)&&B&&!B.shiftKey);
+if(this.isMailToLink(E)){var C=this.parseMailToLink(E);
+D.toOverride=C.to;
+D.subjOverride=C.subject;
+D.extraBodyText=C.body;
+E=C.to||E
+}D.action=ZmOperation.NEW_MESSAGE;
+D.inNewWindow=A;
+if(!D.toOverride){D.toOverride=E+AjxEmailAddress.SEPARATOR
+}AjxDispatcher.run("Compose",D)
+};
+Com_Zimbra_Email.prototype._browseListener=function(){var A=this._getAddress(this._actionObject);
+if(this.isMailToLink(A)){A=(this.parseMailToLink(A)).to||A
+}appCtxt.getSearchController().fromBrowse(A)
+};
+Com_Zimbra_Email.prototype._searchListener=function(){var A=this._getAddress(this._actionObject);
+if(this.isMailToLink(A)){A=(this.parseMailToLink(A)).to||A
+}appCtxt.getSearchController().fromSearch(this._getAddress(A))
+};
+Com_Zimbra_Email.prototype._filterListener=function(){var A=new AjxCallback(this,this._handleLoadFilter);
+AjxDispatcher.require(["PreferencesCore","Preferences"],false,A,null,true)
+};
+Com_Zimbra_Email.prototype._handleLoadFilter=function(){appCtxt.getAppViewMgr().popView(true,ZmId.VIEW_LOADING);
+var B=new ZmFilterRule();
+var C=this._getAddress(this._actionObject);
+if(AjxUtil.isString(C)&&this.isMailToLink(C)){C=(this.parseMailToLink(C)).to||C
+}var A=ZmFilterRule.C_HEADER_VALUE[ZmFilterRule.C_FROM];
+B.addCondition(ZmFilterRule.TEST_HEADER,ZmFilterRule.OP_IS,C,A);
+B.addAction(ZmFilterRule.A_KEEP);
+appCtxt.getFilterRuleDialog().popup(B)
+};
+Com_Zimbra_Email.prototype._goToUrlListener=function(){var D=this._getAddress(this._actionObject);
+if(AjxUtil.isString(D)&&this.isMailToLink(D)){D=(this.parseMailToLink(D)).to||D
+}var C=D.split("@");
+if(C.length){var B=C[C.length-1];
+var A=B.split(".");
+this._actionUrl="http://"+((A.length<=2)?"www."+B:B)
+}if(this._actionUrl){window.open(this._actionUrl,"_blank")
+}else{this.displayStatusMessage(ZmMsg.errorCreateUrl)
+}};
+Com_Zimbra_Date=function(A){if(arguments.length==1){this._generateRegex(A)
+}};
+Com_Zimbra_Date.prototype=new ZmZimletBase();
+Com_Zimbra_Date.prototype.constructor=Com_Zimbra_Date;
+Com_Zimbra_Date.prototype.TYPE=ZmObjectManager.DATE;
+Com_Zimbra_Date.validate=function(A,D,B){if(A<1||A>31){return false
+}if(D<0||D>11){return false
+}if((D==3||D==5||D==8||D==10)&&A==31){return false
+}if(B&&D==1){var C=(B%4==0&&(B%100!=0||B%400==0));
+if(A>29||(A==29&&!C)){return false
+}}return true
+};
+Com_Zimbra_Date.prototype.getCurrentDate=function(A){var B=this[ZmObjectManager.ATTR_CURRENT_DATE];
+return B?B:new Date()
+};
+Com_Zimbra_Date.prototype.init=function(){Com_Zimbra_Date.prototype._zimletContext=this._zimletContext;
+Com_Zimbra_Date.prototype._className="Object";
+this._initDateObjectHandlers()
+};
+Com_Zimbra_Date.prototype.getActionMenu=function(C,B,A){if(this._zimletContext._contentActionMenu instanceof AjxCallback){this._zimletContext._contentActionMenu=this._zimletContext._contentActionMenu.run()
+}Com_Zimbra_Date._actionObject=C;
+Com_Zimbra_Date._actionSpan=B;
+Com_Zimbra_Date._actionContext=A;
+return this._zimletContext._contentActionMenu
+};
+Com_Zimbra_Date.prototype.menuItemSelected=function(A){switch(A){case"DAYVIEW":this._dayViewListener();
+break;
+case"NEWAPPT":this._newApptListener();
+break;
+case"SEARCHMAIL":this._searchMailListener();
+break
+}};
+Com_Zimbra_Date.prototype.toolTipPoppedUp=function(C,D,B,A){if(appCtxt.isChildWindow){var E=this.getOpenerApp(ZmApp.CALENDAR);
+if(E){A.innerHTML=E.getDateToolTip(B?B.date:new Date())
+}}else{var F=AjxDispatcher.run("GetCalController");
+A.innerHTML=F.getDayToolTipText(B?B.date:new Date())
+}};
+Com_Zimbra_Date.prototype.getOpenerApp=function(C){var B=window.opener;
+var A=B?B.appCtxt:null;
+var D=A?A.getApp(C):null;
+return D
+};
+Com_Zimbra_Date.prototype.clicked=function(E,F,D,C){if(appCtxt.isChildWindow){var G=this.getOpenerApp(ZmApp.CALENDAR);
+if(G){G.showDayView(D.date);
+window.opener.focus();
+window.close()
+}}else{var B=AjxDispatcher.run("GetCalController");
+var A=B.getMiniCalendar();
+B.setDate(D.date,0,A.getForceRollOver());
+if(!B._viewVisible){B.show(ZmId.VIEW_CAL_DAY)
+}}};
+Com_Zimbra_Date.prototype.match=function(L,J){if(!Com_Zimbra_Date.PATTERNS){return null
+}var E,A,H,K,C,D;
+for(D=0;
+D<Com_Zimbra_Date.REGEXES.length;
+D++){K=Com_Zimbra_Date.REGEXES[D];
+K.lastIndex=J;
+C=K.exec(L);
+if(C&&C[0]&&(!E||C[0].length>E[0].length)){E=C;
+H=Com_Zimbra_Date.RULES[D];
+A=K.mapping
+}}if(!E){return null
+}try{var F,I;
+for(D in A){F=A[D];
+I=E[D];
+H=H.replace(new RegExp("\\{"+F+"\\}","gi"),I)
+}var B=new Date(this.getCurrentDate().getTime());
+E.context={rule:H,date:AjxDateUtil.calculate(H,B),monthOnly:0,valid:true};
+return E
+}catch(G){if(window.console&&window.console.log){console.log(G)
+}return null
+}};
+Com_Zimbra_Date.prototype._initDateObjectHandlers=function(){if(!appCtxt.get(ZmSetting.CALENDAR_ENABLED)){return
+}Com_Zimbra_Date.MAPPINGS={datenum:"(0[1-9]|[1-9]|[1-2][0-9]|3[0-1])",dayname:"("+AjxDateUtil.S_DAYNAME+")",weekord:"("+AjxDateUtil.S_WEEKORD+")",monthnum:"(0[1-9]|[1-9]|1[0-2])",monthname:"("+AjxDateUtil.S_MONTHNAME+")",yearnum:"(\\d{2}|[1-9]\\d{2,3})",number:"(\\d+)"};
+Com_Zimbra_Date.PATTERNS=[];
+Com_Zimbra_Date.RULES=[];
+Com_Zimbra_Date.REGEXES=[];
+var B,D;
+for(B=1;
+D=this.getMessage("format"+B+".pattern");
+B++){if(D.match(/^\?\?\?+/)){break
+}if(D.match(/^###+/)){break
+}if(D.match(/^#/)){continue
+}Com_Zimbra_Date.PATTERNS.push(D);
+Com_Zimbra_Date.RULES.push(this.getMessage("format"+B+".rule"))
+}for(B=0;
+B<Com_Zimbra_Date.DEFAULT_FORMATS.length;
+B++){Com_Zimbra_Date.PATTERNS.push(Com_Zimbra_Date.DEFAULT_FORMATS[B]);
+Com_Zimbra_Date.RULES.push(Com_Zimbra_Date.DEFAULT_FORMATS[++B])
+}var E,C;
+var A=this.getMessage("boundaryTrue");
+for(B=0;
+B<Com_Zimbra_Date.PATTERNS.length;
+B++){D=Com_Zimbra_Date.PATTERNS[B];
+D=D.replace(/\s+/g,"\\s+");
+D=D.replace(/\(([^\)]+)\)/g,"(?:$1)");
+Com_Zimbra_Date.__replaceKeyword_group=1;
+Com_Zimbra_Date.__replaceKeyword_mapping={};
+D=D.replace(/\{([a-z]+)\}/g,Com_Zimbra_Date.__replaceKeyword);
+E=this.getMessage("format"+B+".boundary");
+if(E==null||E==A){D="\\b"+D+"\\b"
+}C=new RegExp(D,"gi");
+C.mapping=Com_Zimbra_Date.__replaceKeyword_mapping;
+Com_Zimbra_Date.REGEXES.push(C)
+}ZmObjectManager.registerHandler(this,ZmObjectManager.DATE,this._zimletContext.priority)
+};
+Com_Zimbra_Date.prototype._dayViewListener=function(){var A=new AjxCallback(this,this._handleLoadDayView);
+AjxDispatcher.require(["CalendarCore","Calendar","CalendarAppt"],false,A,null,true)
+};
+Com_Zimbra_Date.prototype._handleLoadDayView=function(){var B=appCtxt.getApp(ZmApp.CALENDAR);
+B.activate(true);
+var A=B.getCalController();
+A.show(ZmId.VIEW_CAL_DAY);
+A.setDate(Com_Zimbra_Date._actionContext.date)
+};
+Com_Zimbra_Date.prototype._newApptListener=function(){var A=new AjxCallback(this,this._handleLoadNewAppt);
+AjxDispatcher.require(["CalendarCore","Calendar","CalendarAppt"],false,A,null,true)
+};
+Com_Zimbra_Date.prototype._handleLoadNewAppt=function(){appCtxt.getAppViewMgr().popView(true,ZmId.VIEW_LOADING);
+AjxDispatcher.run("GetCalController").newAppointmentHelper(Com_Zimbra_Date._actionContext.date)
+};
+Com_Zimbra_Date.prototype._searchMailListener=function(){appCtxt.getSearchController().dateSearch(Com_Zimbra_Date._actionContext.date)
+};
+Com_Zimbra_Date.__replaceKeyword_mapping=null;
+Com_Zimbra_Date.__replaceKeyword_group=-1;
+Com_Zimbra_Date.__replaceKeyword=function(A,B){var D=Com_Zimbra_Date.MAPPINGS;
+B=B.toLowerCase();
+if(!D[B]){return A
+}var C=Com_Zimbra_Date.__replaceKeyword_mapping;
+var E=Com_Zimbra_Date.__replaceKeyword_group++;
+C[E++]=B;
+return D[B]
+};
+Com_Zimbra_Date.DEFAULT_FORMATS=["Brooke Ellen Henrikson","2009-10-17T10:20:00Z","Nicholas Mateo Damon","2008-07-18T17:35:00Z","Shyar Parag Shah","2008-07-16T04:51:00Z","Diego Isaac Comfort","2006-12-08T20:05:00Z","Nila Dharmaraj","2006-03-19T16:30:00Z","Nikhil Dharmaraj","2001-08-22T20:00:00Z"];
+function Com_Zimbra_Url(){}Com_Zimbra_Url.prototype=new ZmZimletBase();
+Com_Zimbra_Url.prototype.constructor=Com_Zimbra_Url;
+Com_Zimbra_Url.prototype.init=function(){this._disablePreview=this.getBoolConfig("disablePreview",true);
+this._alexaId=this.getConfig("alexaThumbnailId");
+if(this._alexaId){this._alexaId=AjxStringUtil.trim(this._alexaId);
+this._alexaKey=AjxStringUtil.trim(this.getConfig("alexaThumbnailKey"))
+}Com_Zimbra_Url.REGEXES=[];
+var A=this.getConfig("ZIMLET_CONFIG_REGEX_VALUE");
+if(A){var B=new RegExp(A,"gi");
+if(B){Com_Zimbra_Url.REGEXES.push(B)
+}}if(/^\s*true\s*$/i.test(this.getConfig("supportUNC"))){A=this.getConfig("ZIMLET_UNC_REGEX_VALUE");
+var B=new RegExp(A,"gi");
+if(B){Com_Zimbra_Url.REGEXES.push(B)
+}}};
+Com_Zimbra_Url.THUMB_URL="http://images.websnapr.com/?url=";
+Com_Zimbra_Url.THUMB_SIZE='width="200" height="150"';
+Com_Zimbra_Url.prototype.match=function(B,G){for(var D=0;
+D<Com_Zimbra_Url.REGEXES.length;
+D++){var E=Com_Zimbra_Url.REGEXES[D];
+E.lastIndex=G;
+var A=E.exec(B);
+if(!A){continue
+}var F=A[0].charAt(A[0].length-1);
+if(F=="."||F==","||F=="!"){var C={index:A.index};
+C[0]=A[0].substring(0,A[0].length-1);
+return C
+}else{return A
+}}};
+Com_Zimbra_Url.prototype._getHtmlContent=function(F,I,E,A){var G=E.replace(/\"/g,'"').replace(/^\s+|\s+$/g,"");
+if(G.substr(0,4)=="www."){G="http://"+G
+}G=G.replace(/\\/g,"/");
+if(G.indexOf("\\\\")==0||G.indexOf("//")==0){E.isUNC=true;
+G="file://"+G
+}var H="<a target='_blank' href='"+G;
+if(G.split(/[\?#]/)[0]==(""+window.location).split(/[\?#]/)[0]){var D=G.substr(G.indexOf("?"));
+if(D){var C=AjxStringUtil.parseQueryString(G);
+if(C){var B=C.app;
+if(B&&B.length>0){B=B.toUpperCase();
+if(appCtxt.getApp(ZmApp[B])){H="<a href='javascript:top.appCtxt.getAppController().activateApp(top.ZmApp."+B+", null, null);"
+}}}}}F[I++]=H;
+F[I++]="'>";
+F[I++]=AjxStringUtil.htmlEncode(E);
+F[I++]="</a>";
+return I
+};
+Com_Zimbra_Url.prototype.toolTipPoppedUp=function(D,E,C,B){var A=E.replace(/^\s+|\s+$/g,"");
+if(/^\s*true\s*$/i.test(this.getConfig("stripUrls"))){A=A.replace(/[?#].*$/,"")
+}A=A.replace(/\\/g,"/");
+if(A.indexOf("\\\\")==0||A.indexOf("//")==0){A="file://"+A
+}if(this._disablePreview||A.indexOf("file://")==0){this._showUrlThumbnail(A,B)
+}else{if(this._alexaId){this._showAlexaThumbnail(A,B)
+}else{(new Image()).src=this.getResource("blank_pixel.gif");
+this._showFreeThumbnail(A,B)
+}}};
+Com_Zimbra_Url.prototype.clicked=function(){var A=DwtShell.getShell(window).getToolTip();
+if(A){A.popdown()
+}return true
+};
+Com_Zimbra_Url.prototype._showUrlThumbnail=function(B,A){A.innerHTML="<b>URL:</b> "+decodeURI(B)
+};
+Com_Zimbra_Url.prototype._showFreeThumbnail=function(B,A){var D=[];
+var C=0;
+D[C++]="<img src='";
+D[C++]=this.getResource("blank_pixel.gif");
+D[C++]="' ";
+D[C++]=Com_Zimbra_Url.THUMB_SIZE;
+D[C++]=" style='background: url(";
+D[C++]='"';
+D[C++]=Com_Zimbra_Url.THUMB_URL;
+D[C++]=B;
+D[C++]='"';
+D[C++]=")'/>";
+A.innerHTML=D.join("")
+};
+Com_Zimbra_Url.ALEXA_THUMBNAIL_CACHE={};
+Com_Zimbra_Url.ALEXA_CACHE_EXPIRES=10*60*1000;
+Com_Zimbra_Url.prototype._showAlexaThumbnail=function(A,C){C.innerHTML=["<table style='width: 200px; height: 150px; border-collapse: collapse' cellspacing='0' cellpadding='0'><tr><td align='center'>",ZmMsg.fetchingAlexaThumbnail,"</td></tr></table>"].join("");
+var F=Com_Zimbra_Url.ALEXA_THUMBNAIL_CACHE[A];
+if(F){var L=new Date().getTime()-F.timestamp;
+if(L<Com_Zimbra_Url.ALEXA_CACHE_EXPIRES){var H=["<img src='",F.img,"' />"].join("");
+C.firstChild.rows[0].cells[0].innerHTML=H;
+return
+}else{delete Com_Zimbra_Url.ALEXA_THUMBNAIL_CACHE[A]
+}}var B=new Date(),E=Com_Zimbra_Url.zeroPad;
+var I=E(B.getUTCFullYear(),4)+"-"+E(B.getUTCMonth()+1,2)+"-"+E(B.getUTCDate(),2)+"T"+E(B.getUTCHours(),2)+":"+E(B.getUTCMinutes(),2)+":"+E(B.getUTCSeconds(),2)+".000Z";
+var D=this._computeAlexaSignature(I);
+var J={Service:"AlexaSiteThumbnail",Action:"Thumbnail",AWSAccessKeyId:this._alexaId,Timestamp:I,Signature:D,Size:"Large",Url:A};
+var K=[];
+for(var G in J){K.push(G+"="+AjxStringUtil.urlComponentEncode(J[G]))
+}K="http://ast.amazonaws.com/xino/?"+K.join("&");
+this.sendRequest(null,K,null,new AjxCallback(this,this._alexaDataIn,[C,A,K]),true)
+};
+Com_Zimbra_Url.prototype._computeAlexaSignature=function(A){return AjxSHA1.b64_hmac_sha1(this._alexaKey,"AlexaSiteThumbnailThumbnail"+A)+"="
+};
+Com_Zimbra_Url.prototype._alexaDataIn=function(D,C,G,A){var B=AjxXmlDoc.createFromDom(A.xml);
+var F=B.toJSObject(true,false,true);
+F=F.Response;
+if(F.ResponseStatus.StatusCode=="Success"){if(F.ThumbnailResult.Thumbnail.Exists=="true"){var E=["<img src='",F.ThumbnailResult.Thumbnail,"' />"].join("");
+D.firstChild.rows[0].cells[0].innerHTML=E;
+Com_Zimbra_Url.ALEXA_THUMBNAIL_CACHE[C]={img:F.ThumbnailResult.Thumbnail,timestamp:new Date().getTime()}
+}else{this._showFreeThumbnail(C,D)
+}}else{this._showFreeThumbnail(C,D)
+}};
+Com_Zimbra_Url.zeroPad=function(C,B){var A=""+C;
+while(A.length<B){A="0"+A
+}return A
+};
+function Com_Zimbra_Phone(){}Com_Zimbra_Phone.prototype=new ZmZimletBase();
+Com_Zimbra_Phone.prototype.constructor=Com_Zimbra_Phone;
+Com_Zimbra_Phone.prototype.match=function(C,H){var B=this.regexps;
+var E=null;
+for(var F=0;
+F<B.length;
+++F){var G=B[F];
+G.lastIndex=H;
+var A=G.exec(C);
+if(A&&(E==null||A.index<E.index)){if(G.useParen){for(var D=1;
+D<G.useParen;
+++D){A.index+=A[D].length
+}A[0]=A[G.useParen]
+}if(!/^000/.test(A[0])){E=A
+}}}return E
+};
+Com_Zimbra_Phone.prototype.init=function(){var B=[];
+var F=this.xmlObj().contentObject.matchOn[0];
+var A=F.regex;
+for(var D=0;
+D<A.length;
+++D){F=A[D];
+var C=F.attrs;
+if(!C){C="ig"
+}var E=new RegExp(F._content,C);
+if(F.paren!=null){E.useParen=parseInt(F.paren)
+}B.push(E)
+}this.regexps=B
+};
+Com_Zimbra_Phone.prototype._getHtmlContent=function(D,A,B,C){var E=Com_Zimbra_Phone.getCallToLink(B);
+D[A++]=['<a href="',E,'" onclick="window.top.Com_Zimbra_Phone.unsetOnbeforeunload()">',AjxStringUtil.htmlEncode(B),"</a>"].join("");
+return A
+};
+Com_Zimbra_Phone.prototype.toolTipPoppedUp=function(D,E,B,A){var C={contentObjText:E};
+A.innerHTML=AjxTemplate.expand("com_zimbra_phone.templates.Phone#Tooltip",C)
+};
+Com_Zimbra_Phone.prototype.menuItemSelected=function(A){switch(A){case"SEARCH":this._searchListener();
+break;
+case"ADDCONTACT":this._contactListener();
+break;
+case"CALL":this._callListener();
+break
+}};
+Com_Zimbra_Phone.prototype._searchListener=function(){appCtxt.getSearchController().search({query:this._actionObject})
+};
+Com_Zimbra_Phone.prototype._contactListener=function(){var A=new ZmContact(null);
+A.initFromPhone(this._actionObject,this.getConfig("defaultContactField"));
+AjxDispatcher.run("GetContactController").show(A)
+};
+Com_Zimbra_Phone.prototype._callListener=function(){var A=Com_Zimbra_Phone.getCallToLink(this._actionObject.toString());
+Com_Zimbra_Phone.unsetOnbeforeunload();
+window.location=A
+};
+Com_Zimbra_Phone.resetOnbeforeunload=function(){window.onbeforeunload=ZmZimbraMail._confirmExitMethod
+};
+Com_Zimbra_Phone.unsetOnbeforeunload=function(){window.onbeforeunload=null;
+this._timerObj=new AjxTimedAction(null,Com_Zimbra_Phone.resetOnbeforeunload);
+AjxTimedAction.scheduleAction(this._timerObj,3000)
+};
+Com_Zimbra_Phone.getCallToLink=function(B){if(!B){return""
+}var A=AjxStringUtil.trim(B,true);
+if(!/^(?:\+|00)/.test(A)){A="+1"+A
+}return"callto:"+A
+};
+AjxTemplate.register("com_zimbra_phone.templates.Phone#Tooltip",function(B,F,E,A){var D=Boolean(A);
+E=(typeof E=="string"?{id:E}:E)||{};
+A=A||[];
+var C=A.length;
+A[C++]="<table cellpadding=2 cellspacing=0 border=0><tr valign='center'><td>";
+A[C++]=AjxImg.getImageHtml("Telephone");
+A[C++]="</td><td><b><div style='white-space:nowrap'>";
+A[C++]=ZmMsg.phone;
+A[C++]=":</div></b></td><td><div style='white-space:nowrap'>";
+A[C++]=AjxStringUtil.htmlEncode(E.contentObjText);
+A[C++]="</div></td></tr></table>";
+return D?A.length:A.join("")
+},{id:"Tooltip"},true);
+AjxPackage.define("com_zimbra_phone.templates.Phone");
+AjxTemplate.register("com_zimbra_phone.templates.Phone",AjxTemplate.getTemplate("com_zimbra_phone.templates.Phone#Tooltip"),AjxTemplate.getParams("com_zimbra_phone.templates.Phone#Tooltip"));
+function Com_Zimbra_Wikipedia(){}Com_Zimbra_Wikipedia.prototype=new ZmZimletBase();
+Com_Zimbra_Wikipedia.prototype.constructor=Com_Zimbra_Wikipedia;
+Com_Zimbra_Wikipedia.prototype.init=function(){};
+Com_Zimbra_Wikipedia.prototype.doubleClicked=function(){this.singleClicked()
+};
+Com_Zimbra_Wikipedia.prototype.singleClicked=function(){var E=[{label:"Search",name:"search",type:"string",value:"",minLength:4,maxLength:100}];
+if(!this._dlg_propertyEditor){var B=new DwtComposite(this.getShell());
+this._propertyEditor=new DwtPropertyEditor(B,true);
+var A=this._propertyEditor;
+A.initProperties(E);
+var D={title:"Search Wikipedia",view:B};
+this._dlg_propertyEditor=this._createDialog(D);
+var C=this._dlg_propertyEditor;
+A.setFixedLabelWidth();
+A.setFixedFieldWidth();
+C.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,function(){if(!A.validateData()){return
+}this._doSearch()
+}))
+}this._dlg_propertyEditor.popup()
+};
+Com_Zimbra_Wikipedia.prototype._doSearch=function(){this._dlg_propertyEditor.popdown();
+this._displaySearchResult(this._propertyEditor.getProperties().search);
+this._dlg_propertyEditor.dispose();
+this._dlg_propertyEditor=null
+};
+Com_Zimbra_Wikipedia.prototype._displaySearchResult=function(B){var C=["toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600"];
+C=C.join(",");
+var A="http://www.wikipedia.org/search-redirect.php?language=en&go=Go&search="+AjxStringUtil.urlEncode(B);
+window.open(A,"Wikipedia",C)
+};
+Com_Zimbra_Local=function(){};
+Com_Zimbra_Local.prototype=new ZmZimletBase;
+Com_Zimbra_Local.prototype.constructor=Com_Zimbra_Local;
+Com_Zimbra_Local.prototype.toString=function(){return"Com_Zimbra_Local"
+};
+Com_Zimbra_Local.prototype.init=function(){this._controller=new YahooLocalController(this);
+if(window.skin&&!skin.searchLocal){skin.searchLocal=AjxCallback.simpleClosure(this._controller.searchLocal,this._controller)
+}if(appCtxt.get(ZmSetting.WEB_SEARCH_ENABLED)){var A=document.getElementById("skin_search_local_button");
+if(!A){this.addLocalSearchToolBar((new AjxListener(this,this._localSearchListener)))
+}else{Dwt.setVisible(A,true)
+}}YahooMaps.loadExternalResources()
+};
+Com_Zimbra_Local.prototype.addLocalSearchToolBar=function(C){var B=this._searchToolBar=appCtxt.getSearchController().getSearchToolbar();
+var D=document.getElementById(B._htmlElId+"_searchMenuButton");
+var E=D.parentNode.insertCell(D.cellIndex+2);
+E.id=B._htmlElId+"_searchLocal";
+E.className="ZmSearchToolbarCell";
+var A=B._addButton({tdId:"_searchLocal",lbl:this.getMessage("localSearchBtnLabel"),icon:"WebSearch",tooltip:this.getMessage("localSearchBtnTooltip"),buttonId:ZmId.LOCAL_SEARCH_BUTTON});
+A.addSelectionListener(C)
+};
+Com_Zimbra_Local.prototype._localSearchListener=function(A){var B=AjxStringUtil.trim(this._searchToolBar.getSearchFieldValue());
+if(B&&B.length){this._controller.searchLocal(B)
+}};
+Com_Zimbra_Local.prototype.menuItemSelected=function(A){switch(A){case"MY_LOCATION":this._controller.markMe();
+break;
+case"SEARCH":this._controller.searchQuery();
+break;
+case"SEARCH_ADDR":this._controller.searchAddress();
+break;
+case"TRAFFIC":this._controller.searchTraffic();
+break;
+case"UPCOMING":this._controller.searchUpcoming();
+break;
+case"MANUAL_LOCAION":this._controller.changeLocation();
+break;
+case"MANULA_LOCATION_ZIP":this._controller.changeLocationByZip();
+break;
+case"PREFERENCES":this.createPropertyEditor();
+break;
+default:this.createPropertyEditor();
+break
+}};
+Com_Zimbra_Local.prototype.singleClicked=function(){this._controller.searchQuery()
+};
+YahooLocalController=function(A){if(arguments.length==0){return
+}ZmController.call(this,appCtxt.getShell());
+ZmOperation.registerOp("TRAFFIC",{image:"YLogo"});
+ZmOperation.registerOp("UPCOMING",{image:"ULogo"});
+this._listeners={};
+this._listeners[ZmOperation.TRAFFIC]=new AjxListener(this,this._trafficListener);
+this._listeners[ZmOperation.CANCEL]=new AjxListener(this,this._cancelListener);
+this._listeners[ZmOperation.SEND]=new AjxListener(this,this._sendListener);
+this._listeners[ZmOperation.UPCOMING]=new AjxListener(this,this._upcomingListener);
+this._listeners[ZmOperation.SEARCH]=new AjxListener(this,this.searchAddress);
+this._zimlet=A;
+this._searchOkListener=new AjxListener(this,this._handleSearchListener);
+this._searchAddrOkListener=new AjxListener(this,this._handleSearchAddrListener);
+this._changeLocationOkListener=new AjxListener(this,this._handleChangeLocationListener)
+};
+YahooLocalController.prototype=new ZmController;
+YahooLocalController.prototype.constructor=YahooLocalController;
+YahooLocalController.prototype.getLocal=function(){if(typeof (geoip_country_code)=="undefined"||!AjxUtil.isFunction(geoip_country_code)){return
+}if(!this._ylocal){this._countryCode=geoip_country_code();
+this._countryName=geoip_country_name();
+this._city=geoip_city();
+this._region=geoip_region();
+this._latitude=geoip_latitude();
+this._longitude=geoip_longitude();
+this._ylocal={countryCode:this._countryCode,countryName:this._countryName,city:this._city,region:this._region,latitude:this._latitude,longitude:this._longitude};
+this._ylocalTmp={countryCode:this._countryCode,countryName:this._countryName,city:this._city,region:this._region,latitude:this._latitude,longitude:this._longitude}
+}var A=this._zimlet.getUserProperty("manuallocation");
+if(A&&A.match(/true/i)){this._ylocalTmp.latitude=this._zimlet.getUserProperty("latitude");
+this._ylocalTmp.longitude=this._zimlet.getUserProperty("longitude");
+return this._ylocalTmp
+}return this._ylocal
+};
+YahooLocalController.prototype.setLocation=function(A,B,C){this._zimlet.setUserProperty("manuallocation","true");
+this._zimlet.setUserProperty("latitude",A);
+this._zimlet.setUserProperty("longitude",B);
+this._zimlet.saveUserProperties(C)
+};
+YahooLocalController.prototype.searchLocal=function(A){this._getGeoIP(new AjxCallback(this,this._handleSearchLocal,A))
+};
+YahooLocalController.prototype._handleSearchLocal=function(B){var A=this._setDefaultView(this._curr_lat,this._curr_lon);
+if(A){this.getMapsView().searchLocal({query:B,defaultLat:A.latitude,defaultLon:A.longitude})
+}else{this._showErrorLoadingAPI()
+}};
+YahooLocalController.prototype.searchQuery=function(){var B=this._zimlet.getMessage("searchYahooLocal");
+var A=this._zimlet.getMessage("searchFor");
+this._showInputDialog(B,A,this._searchOkListener)
+};
+YahooLocalController.prototype.searchAddress=function(A){var C=this._zimlet.getMessage("enterAddress");
+var B=this._zimlet.getMessage("address");
+this._showInputDialog(C,B,this._searchAddrOkListener)
+};
+YahooLocalController.prototype.changeLocationByZip=function(A){var C=this._zimlet.getMessage("changeLocation");
+var B=this._zimlet.getMessage("zipCode");
+this._showInputDialog(C,B,this._changeLocationOkListener)
+};
+YahooLocalController.prototype.searchUpcoming=function(){this._getGeoIP(new AjxCallback(this,this._handleSearchUpcoming))
+};
+YahooLocalController.prototype._handleSearchUpcoming=function(){var A=this._setDefaultView(this._curr_lat,this._curr_lon);
+if(A){this.getMapsView().searchUpcoming({latitude:A.latitude,longitude:A.longitude})
+}else{this._showErrorLoadingAPI()
+}};
+YahooLocalController.prototype.searchTraffic=function(){this._getGeoIP(new AjxCallback(this,this._handleSearchTraffic))
+};
+YahooLocalController.prototype._handleSearchTraffic=function(){var A=this._setDefaultView(this._curr_lat,this._curr_lon);
+if(A){this.getMapsView().searchTraffic({latitude:A.latitude,longitude:A.longitude})
+}else{this._showErrorLoadingAPI()
+}};
+YahooLocalController.prototype.markMe=function(){this._getGeoIP(new AjxCallback(this,this._handleMarkMe))
+};
+YahooLocalController.prototype._handleMarkMe=function(){var C;
+var D;
+if(AjxUtil.isFunction(geoip_latitude)&&AjxUtil.isFunction(geoip_longitude)){C=geoip_latitude();
+D=geoip_longitude();
+this._curr_lat=C;
+this._curr_lon=D
+}var B=this._setDefaultView(this._curr_lat,this._curr_lon);
+if(B){var E=B?B.latitude:null;
+var A=B?B.longitude:null;
+this.getMapsView().markMe(E,A)
+}else{this._showErrorLoadingAPI()
+}};
+YahooLocalController.prototype.displayAddress=function(A){this.setView({clean:true,typeControl:true,panControl:false,zoomControl:"long",zoomLevel:6,defaultLocation:A});
+this.getMapsView().markAddr({defaultLocation:A})
+};
+YahooLocalController.prototype.changeLocation=function(A){this._getGeoIP(new AjxCallback(this,this._handleChangeLocation,A))
+};
+YahooLocalController.prototype._handleChangeLocation=function(B){var A=this._setDefaultView(45,45);
+if(A){this.getMapsView().changeLocation({latitude:A.latitude,longitude:A.longitude})
+}else{this._showErrorLoadingAPI()
+}};
+ZmId.VIEW_YMAPS="YAHOOMAPS";
+YahooLocalController.prototype.getMapsView=function(){if(!this._mapsView){this._mapsView=new YahooMaps(appCtxt.getShell(),this)
+}return this._mapsView
+};
+YahooLocalController.prototype.setView=function(A){this._initializeToolBar();
+this._toolbar.enableAll(true);
+this._createMapView(A);
+this.showView(A)
+};
+YahooLocalController.prototype.showView=function(A){this._mapsView.prepareMap(A);
+appCtxt.getAppViewMgr().pushView(ZmId.VIEW_YMAPS);
+appCtxt.getAppViewMgr()._fitToContainer([ZmAppViewMgr.C_APP_CONTENT])
+};
+YahooLocalController.prototype.hideView=function(){appCtxt.getAppViewMgr().popView(true,ZmId.VIEW_YMAPS)
+};
+YahooLocalController.prototype._createView=function(){var A={};
+A[ZmAppViewMgr.C_TOOLBAR_TOP]=this._toolbar;
+A[ZmAppViewMgr.C_APP_CONTENT]=this._mapsView;
+appCtxt.getAppViewMgr().createView({viewId:ZmId.VIEW_YMAPS,elements:A})
+};
+YahooLocalController.prototype._createMapView=function(A){if(this._mapsView){return
+}this.getMapsView();
+this._createView()
+};
+YahooLocalController.prototype._initializeToolBar=function(){if(this._toolbar){return
+}var D=[ZmOperation.SEND,ZmOperation.UPCOMING,ZmOperation.TRAFFIC,ZmOperation.SEARCH,ZmOperation.CANCEL];
+this._toolbar=new ZmButtonToolBar({parent:appCtxt.getShell(),buttons:D,className:"ZmAppToolBar ImgSkin_Toolbar"});
+for(var C=0;
+C<this._toolbar.opList.length;
+C++){var B=this._toolbar.opList[C];
+if(B==ZmOperation.UPCOMING){var A=this._toolbar.getOp(B);
+A.setText(this._zimlet.getMessage("menuItemUpcoming"));
+A.setToolTipContent(this._zimlet.getMessage("upcomingTooltip"))
+}else{if(B==ZmOperation.TRAFFIC){var A=this._toolbar.getOp(B);
+A.setText(this._zimlet.getMessage("menuItemTraffic"));
+A.setToolTipContent(this._zimlet.getMessage("trafficTooltip"))
+}}if(this._listeners[B]){this._toolbar.addSelectionListener(B,this._listeners[B])
+}}};
+YahooLocalController.prototype._showInputDialog=function(E,D,C){if(!this._inputDialog){this._inputDialog=new ZmDialog({parent:appCtxt.getShell()});
+var B=[];
+var A=0;
+B[A++]="<table cellpadding=2 cellspacing=2><tr><td class='ZmFieldLabelRight' id='";
+B[A++]=this._inputDialog._htmlElId;
+B[A++]="_label'></td><td><input type='text' size=20 maxlength=255 id='";
+B[A++]=this._inputDialog._htmlElId;
+B[A++]="_input'></td></tr></table>";
+this._inputDialog.setContent(B.join(""));
+this._inputEl=document.getElementById(this._inputDialog._htmlElId+"_input");
+this._inputLabel=document.getElementById(this._inputDialog._htmlElId+"_label")
+}this._inputDialog.setTitle(E);
+this._inputDialog.setButtonListener(DwtDialog.OK_BUTTON,C);
+this._inputDialog.setEnterListener(C);
+this._inputEl.value="";
+this._inputLabel.innerHTML=D;
+this._inputDialog.popup();
+this._inputEl.focus()
+};
+YahooLocalController.prototype._setDefaultView=function(E,D){if(E==45&&D==45){zoomLevel=14
+}else{zoomLevel=8
+}var C=this.getLocal();
+var H=this._zimlet.getUserProperty("latitude");
+var B=this._zimlet.getUserProperty("longitude");
+if((!H||!B)&&(!C||(C&&(!C.latitude||!C.longitude)))&&(!E&&!D)){var A=this._zimlet.getUserProperty("manuallocation");
+if(!A||A.match(/false/i)){var F=this._zimlet.getMessage("maxMindError");
+var G=new YLocalDialog(appCtxt._shell,null,this._zimlet,F,true);
+G.popup();
+return
+}}if(!C){this._zimlet._ylocal={countryCode:"",countryName:"",city:"",region:"",latitude:E||H,longitude:D||B};
+C=this._zimlet._ylocal
+}if(C){C.latitude=E||C.latitude;
+C.longitude=D||C.longitude;
+this.setView({clean:true,typeControl:true,panControl:false,zoomControl:"long",zoomLevel:zoomLevel,defaultLat:C.latitude,defaultLon:C.longitude})
+}return C
+};
+YahooLocalController.prototype._getGeoIP=function(D){geoip_country_code=null;
+var B="http://j.maxmind.com/app/geoip.js";
+var C=new AjxCallback(this,this._handleGetIP,D);
+var A=ZmZimletBase.PROXY+AjxStringUtil.urlComponentEncode(B);
+AjxRpc.invoke(null,A,null,C,true,5000)
+};
+YahooLocalController.prototype._handleGetIP=function(callback,result){if(result&&result.success&&result.text){AjxPackage.eval(result.text)
+}if(callback){callback.run()
+}};
+YahooLocalController.prototype._showErrorLoadingAPI=function(){var A=appCtxt.getMsgDialog();
+var B=this._zimlet.getMessage("errorLoadingAPI");
+A.setMessage(B,DwtMessageDialog.CRITICAL_STYLE);
+A.popup()
+};
+YahooLocalController.prototype.selectLocation=function(A){this.messageDlg.popdown();
+this._dlg_propertyEditor=new YLocalDialog(appCtxt._shell,null,this._zimlet,A);
+this._dlg_propertyEditor.popup()
+};
+YahooLocalController.prototype._locateLocation=function(){var B=this._textObj1.getValue();
+var A=this._textObj2.getValue();
+this._zimlet.setUserProperty("latitude",B);
+this._zimlet.setUserProperty("longitude",A);
+this._curr_lat=B;
+this._curr_lon=A;
+this._zimlet._controller._dlg_propertyEditor.popdown();
+this._zimlet._controller._handleSearchLocal()
+};
+YahooLocalController.prototype._getMessageDlg=function(A){this.messageDlg=new DwtDialog(appCtxt.getShell(),null,"Confirmation",[DwtDialog.OK_BUTTON]);
+this.messageDlg.setContent(A);
+return this.messageDlg
+};
+YahooLocalController.prototype._handleSearchListener=function(){var A=AjxStringUtil.trim(this._inputEl.value);
+if(A.length){this._inputDialog.popdown();
+this.searchLocal(A)
+}};
+YahooLocalController.prototype._handleSearchAddrListener=function(){var A=AjxStringUtil.trim(this._inputEl.value);
+if(A.length){this._inputDialog.popdown();
+this.displayAddress(A)
+}};
+YahooLocalController.prototype._handleChangeLocationListener=function(){var A=AjxStringUtil.trim(this._inputEl.value);
+if(A.length){this._inputDialog.popdown();
+this._getLatLonForZip(A)
+}};
+YahooLocalController.prototype._getLatLonForZip=function(D){var C=this._zimlet.getConfig("ydnAPPID");
+var B=this._zimlet.getMessage("ygeoapiURL");
+B+="?appid="+C+"&zip="+D;
+var A=ZmZimletBase.PROXY+AjxStringUtil.urlComponentEncode(B);
+var E=new AjxCallback(this,this._handleLatLonForZip,D);
+AjxRpc.invoke(null,A,null,E,true,5000)
+};
+YahooLocalController.prototype._handleLatLonForZip=function(B,A){if(!A||(A&&!A.success)){var E=this._zimlet.getMessage("ygeoLocalError");
+var F=new YLocalDialog(appCtxt._shell,null,this._zimlet,E,false);
+F.popup();
+return
+}if(A.text.match(/Error/i)){appCtxt.setStatusMsg(this._zimlet.getMessage("zipCodeInvalid"),ZmStatusView.LEVEL_CRITICAL);
+return
+}var C=AjxStringUtil.trim((A.text.match(/<Latitude>.*(\-?[.\w]+)<\/Latitude>/ig))[0].replace(/<\/?[^>]+>|Latitude/gi,""));
+var D=AjxStringUtil.trim((A.text.match(/<Longitude>.*(\-?[.\w]+)<\/Longitude>/ig))[0].replace(/<\/?[^>]+>|Longitude/gi,""));
+if(!(C&&D)){appCtxt.setStatusMsg(this._zimlet.getMessage("coordsNotFound"),ZmStatusView.LEVEL_CRITICAL);
+return
+}this.setLanLongAndChangeLocation(C,D,3)
+};
+YahooLocalController.prototype.setLanLongAndChangeLocation=function(D,A,C){var B={clean:true,typeControl:true,panControl:false,zoomControl:"long",zoomLevel:C||6,defaultLat:D,defaultLon:A};
+this._zimlet._controller.setView(B);
+this._zimlet._controller.getMapsView().changeLocation({latitude:D,longitude:A});
+this._curr_lat=D;
+this._curr_lon=A
+};
+YahooLocalController.prototype._sendListener=function(D){var F=this._mapsView.getState();
+var B=["http://maps.yahoo.com/#tt=",F.query,"&lon=",F.lon,"&lat=",F.lat,"&mag=",F.zoom,"&mvt=m&tp=1"].join("");
+var A=this._zimlet.getMessage("msgBody").replace("{0}",F.query?"("+F.query+")":"");
+var H=this._zimlet.getMessage("msgFooter");
+var C=this._zimlet.getMessage("msgSubject").replace("{0}",appCtxt.get(ZmSetting.USERNAME));
+this._zimlet.getMessage("maxMindError");
+if(appCtxt.get(ZmSetting.HTML_COMPOSE_ENABLED)&&appCtxt.get(ZmSetting.COMPOSE_AS_FORMAT)==ZmSetting.COMPOSE_HTML){A=AjxStringUtil.nl2br(A);
+H=AjxStringUtil.nl2br(H)
+}var E={action:ZmOperation.NEW_MESSAGE,subjOverride:C,extraBodyText:(A+B+H),inNewWindow:appCtxt.get(ZmSetting.NEW_WINDOW_COMPOSE)};
+var G=AjxDispatcher.run("GetComposeController");
+G.doAction(E)
+};
+YahooLocalController.prototype._upcomingListener=function(A){this.searchUpcoming()
+};
+YahooLocalController.prototype._trafficListener=function(A){this.searchTraffic()
+};
+YahooLocalController.prototype._cancelListener=function(A){this.hideView()
+};
+YahooMaps=function(B,A){if(arguments.length==0){return
+}DwtComposite.call(this,{parent:B,className:"YahooMap",posStyle:Dwt.ABSOLUTE_STYLE,id:"YahooMap"});
+this._controller=A;
+this.getMap();
+this.addSearchLocalListener();
+this.addTrafficSearchListener()
+};
+YahooMaps.prototype=new DwtComposite;
+YahooMaps.prototype.constructor=new YahooMaps;
+YahooMaps.APPID="ZimbraMail";
+YahooMaps.VERSION="3.7";
+YahooMaps.DEFAULT_ZOOMLEVEL=5;
+YahooMaps.QUERY_RESULTS=10;
+YahooMaps.DEFAULT_TRAFFICRADIUS=10;
+YahooMaps.LOC_MARKER_IMAGE="http://us.i1.yimg.com/us.yimg.com/i/us/tr/fc/map/nightlife_bubble_w.png";
+YahooMaps.prototype.prepareMap=function(C){var B=this.getMap();
+if(C.clean){B.removeMarkersAll()
+}if(C.panControl){B.addPanControl()
+}else{B.addPanControl();
+B.removePanControl()
+}if(C.zoomControl){if(C.zoomControl=="long"){B.addZoomLong()
+}else{B.addZoomShort()
+}}else{B.removeZoomControl()
+}if(C.zoomScale){B.addZoomScale()
+}else{B.removeZoomScale()
+}if(C.typeControl){B.addTypeControl()
+}if(C.defaultLat&&C.defaultLon){var A=this.getGeoPoint(C.defaultLat,C.defaultLon);
+B.drawZoomAndCenter(A);
+this.setLocMarker(C.defaultLat,C.defaultLon,"You are here.",YahooMaps.LOC_MARKER_IMAGE)
+}else{if(C.defaultLocation){B.drawZoomAndCenter(C.defaultLocation)
+}}B.setZoomLevel(C.zoomLevel||YahooMaps.DEFAULT_ZOOMLEVEL)
+};
+YahooMaps.prototype.searchLocal=function(C){if(!C.query){return
+}var B=this.getMap();
+var A=(C.defaultLat&&C.defaultLon)?this.getGeoPoint(C.defaultLat,C.defaultLon):B.getCenterLatLon();
+C.radius=C.radius||YahooMaps.DEFAULT_RADIUS;
+C.nresults=C.nresults||YahooMaps.QUERY_RESULTS;
+B.searchLocal(A,C.query,C.radius,C.nresults);
+this._searchQuery=C.query;
+this._searchLat=C.defaultLat;
+this._searchLon=C.defaultLon
+};
+YahooMaps.prototype.addSearchLocalListener=function(){var A=this;
+function B(F){if(!F.Data){return
+}var H=A.getMap();
+for(var E in F.Data.ITEMS){var D=F.Data.ITEMS[E];
+if(D.TITLE){var G=A.constructLocalResult(D);
+var C=A.getMarker(A.getGeoPoint(D.LATITUDE,D.LONGITUDE),G);
+H.addOverlay(C)
+}}}YEvent.Capture(this.getMap(),EventsList.onEndLocalSearch,B)
+};
+YahooMaps.prototype.constructLocalResult=function(B){var C=[];
+var A=0;
+C[A++]="<div class='YMapAddress'>";
+C[A++]="<div style='font-weight:bold;'><a target='_blank' href='";
+C[A++]=B.BUSINESSURL;
+C[A++]="'>";
+C[A++]=B.TITLE;
+C[A++]="</a></div>";
+C[A++]="<div style='font-style:italic;'>";
+C[A++]=B.ADDRESS;
+C[A++]=",";
+C[A++]=B.CITY;
+C[A++]=",";
+C[A++]=B.STATE;
+C[A++]="</div>";
+if(B.PHONE){C[A++]="<div><img width='16' hight='16' src='";
+C[A++]=this.getResource("phone.gif");
+C[A++]="'>";
+C[A++]=B.PHONE;
+C[A++]="</div>"
+}C[A++]="<div>";
+C[A++]=B.DISTANCE;
+C[A++]=" miles away!</div>";
+var D=B.RATING.AVERAGERATING;
+if(!isNaN(D)){C[A++]="<div>";
+var E=1;
+while(E<=D){C[A++]="<img width='16' height='16' src='";
+C[A++]=this.getResource("star_on.gif");
+C[A++]="'>";
+E++
+}while(E<=5){C[A++]="<img width='16' height='16' src='";
+C[A++]=this.getResource("star_off.gif");
+C[A++]="'>";
+E++
+}C[A++]="</div>"
+}var F=B.TITLE.replace("'","");
+var G=B.ADDRESS.replace("'","");
+C[A++]='<div><a href="#" onclick="YahooMaps._addContact({';
+C[A++]=" title:'";
+C[A++]=F;
+C[A++]="', addr:'";
+C[A++]=G;
+C[A++]="', city:'";
+C[A++]=B.CITY;
+C[A++]="', state:'";
+C[A++]=B.STATE;
+C[A++]="', phone:'";
+C[A++]=B.PHONE;
+C[A++]="', bizurl:'";
+C[A++]=B.BUSINESSURL;
+C[A++]="', url:'";
+C[A++]=B.URL;
+C[A++]="'});\">+Contact</a>";
+if(appCtxt.getZimletMgr().zimletExists("com_zimbra_asterisk")){C[A++]="&nbsp;|&nbsp;<a href='#' onclick=\"YahooMaps._phoneCall('";
+C[A++]=B.PHONE;
+C[A++]="');\">Call</a>"
+}if(appCtxt.getZimletMgr().zimletExists("com_zimbra_sms")){C[A++]="&nbsp;|&nbsp;<a href='#' onclick=\"YahooMaps._sendSMS({";
+C[A++]=" title:'";
+C[A++]=F;
+C[A++]="', addr:'";
+C[A++]=G;
+C[A++]="', city:'";
+C[A++]=B.CITY;
+C[A++]="', state:'";
+C[A++]=B.STATE;
+C[A++]="', phone:'";
+C[A++]=B.PHONE;
+C[A++]="', bizurl:'";
+C[A++]=B.BUSINESSURL;
+C[A++]="', url:'";
+C[A++]=B.URL;
+C[A++]="'});\">SMS</a>"
+}C[A++]='&nbsp;|&nbsp;<a href="#" onclick="YahooMaps._sendLocalResult({';
+C[A++]=" title:'";
+C[A++]=F;
+C[A++]="', addr:'";
+C[A++]=G;
+C[A++]="', city:'";
+C[A++]=B.CITY;
+C[A++]="', state:'";
+C[A++]=B.STATE;
+C[A++]="', phone:'";
+C[A++]=B.PHONE;
+C[A++]="', bizurl:'";
+C[A++]=B.BUSINESSURL;
+C[A++]="', url:'";
+C[A++]=B.URL;
+C[A++]="'});\">Email</a>";
+C[A++]="</div>";
+C[A++]="<div><a href='"+B.URL+"' target='_blank'>more >></a></div>";
+C[A++]="</div>";
+return C.join("")
+};
+YahooMaps._sendLocalResult=function(D){var B=appCtxt.get(ZmSetting.USERNAME)+" shared an address using Yahoo! Local";
+var C=[D.title,"\n",D.addr,"\n",D.city,",",D.state,"\n","Phone:",D.phone,"\n","Business URL:",D.bizurl,"\n","For Reviews & more info view ",D.url,"\n"].join("");
+var A=C+"\n\n\n\nThis email was sent to you by a user on Yahoo Local (local.yahoo.com).";
+if(appCtxt.get(ZmSetting.HTML_COMPOSE_ENABLED)&&appCtxt.get(ZmSetting.COMPOSE_AS_FORMAT)==ZmSetting.COMPOSE_HTML){A=AjxStringUtil.nl2br(A)
+}var D={action:ZmOperation.NEW_MESSAGE,subjOverride:B,extraBodyText:A};
+var E=AjxDispatcher.run("GetComposeController");
+E.doAction(D)
+};
+YahooMaps._sendSMS=function(D){var C=appCtxt.getZimletMgr().getZimletsHash();
+var B=C?C.com_zimbra_sms:null;
+if(B){var A=[D.title,"\n",D.addr,"\n",D.city,",",D.state,"\n","Phone:",D.phone,"\n","Business URL:",D.bizurl,"\n","For Reviews & more info view ",D.url,"\n"].join("");
+A=A+"\n\nYahoo! Local (local.yahoo.com)";
+B.callHandler("singleClicked",[D.phone,A])
+}};
+YahooMaps._phoneCall=function(A){var C=appCtxt.getZimletMgr().getZimletsHash();
+var B=C?C.com_zimbra_asterisk:null;
+if(B){B.callHandler("setupCall",[A])
+}};
+YahooMaps._addContact=function(B){var A=new AjxCallback(YahooMaps._handleLoadContact,B);
+AjxDispatcher.require(["ContactsCore","Contacts"],false,A,null,true)
+};
+YahooMaps._handleLoadContact=function(B){var A=new ZmContact();
+if(B.title){A.setAttr(ZmContact.F_firstName,B.title);
+A.setAttr(ZmContact.F_company,B.title)
+}if(B.addr){A.setAttr(ZmContact.F_workStreet,B.addr)
+}if(B.city){A.setAttr(ZmContact.F_workCity,B.city)
+}if(B.state){A.setAttr(ZmContact.F_workCountry,B.state)
+}if(B.phone){A.setAttr(ZmContact.F_workPhone,B.phone)
+}if(B.bizurl){A.setAttr(ZmContact.F_workURL,B.bizurl)
+}AjxDispatcher.run("GetContactController").show(A)
+};
+YahooMaps.prototype.getState=function(){return{query:this._searchQuery,lat:this._searchLat,lon:this._searchLon,zoom:YahooMaps.DEFAULT_ZOOMLEVEL}
+};
+YahooMaps.prototype.searchUpcoming=function(A){A.callback=new AjxCallback(this,this._processUpcomingResponse);
+this.getUpcoming().searchEvents(A)
+};
+YahooMaps.prototype._processUpcomingResponse=function(D){if(!D){return
+}var F=this.getMap();
+for(var C=0;
+C<D.length;
+C++){var E=D[C];
+if(E.name){var B=this._constructEventResult(E);
+var A=this.getMarker(this.getGeoPoint(E.latitude,E.longitude),B);
+F.addOverlay(A)
+}}};
+YahooMaps.prototype._constructEventResult=function(D){var C=[];
+var A=0;
+C[A++]="<div class='YMapAddress'>";
+C[A++]="<div style='font-weight:bold;'><a href='"+D.url+"' target='_blank'>"+D.name+"</a></div>";
+C[A++]="<div style='font-weight:italic;'> When:"+D.start_date+","+D.start_time+" </div>";
+C[A++]="<div style='font-weight:italic;'>Venue: "+D.venue_name+"</div>";
+C[A++]="<div style='font-style:italic;'>"+D.venue_address+","+D.venue_city+","+D.venue_state_name+"</div>";
+C[A++]="<div>"+D.distance+" miles away!</div";
+var B=D.name.replace("'","");
+var E=D.venue_address.replace("'","");
+C[A++]='<div><a href="#" onclick="YahooMaps._addAppt({name:\''+B+"',addr:'"+E+"',city:'"+D.venue_city+"',state:'"+D.venue_state_name+"',startdate:'"+D.start_date+"',starttime:'"+D.start_time+"',enddate:'"+D.end_date+"',endtime:'"+D.end_time+"',bizurl:'"+D.url+"',url:'http://upcoming.yahoo.com/event/"+D.id+"/'});\">+Calendar</a>";
+C[A++]='&nbsp;|&nbsp;<a href="#" onclick="YahooMaps._sendEvent({name:\''+B+"',addr:'"+E+"',city:'"+D.venue_city+"',state:'"+D.venue_state_name+"',startdate:'"+D.start_date+"',starttime:'"+D.start_time+"',enddate:'"+D.end_date+"',endtime:'"+D.end_time+"',bizurl:'"+D.url+"',url:'http://upcoming.yahoo.com/event/"+D.id+"/'});\">Email</a>";
+C[A++]="</div>";
+C[A++]="<div><a target='_blank' href='http://upcoming.yahoo.com/event/"+D.id+"/'>more >></a></div>";
+C[A++]="</div>";
+return C.join("")
+};
+YahooMaps._addAppt=function(D){var C=AjxDispatcher.run("GetApptComposeController");
+var B=new ZmAppt();
+B.setName(D.name);
+var F=YahooMaps._isValidTime(D.starttime);
+var A=YahooMaps._isValidTime(D.starttEnd);
+if(F){B.setStartDate(YahooMaps._parseDate(D.startdate,D.starttime))
+}else{B.setStartDate(YahooMaps._parseDate(D.startdate))
+}if(!A&&F&&(D.startdate==D.enddate||!D.enddate)){B.setEndDate(YahooMaps._parseDate(D.startdate,D.starttime,1))
+}else{if(!(A&&F)){B.setEndDate(YahooMaps._parseDate(D.enddate))
+}else{B.setEndDate(YahooMaps._parseDate(D.enddate,D.starttime,1))
+}}var E=["Direction:\n\n",D.addr,"\n",D.city,",",D.state,"\n\nBusiness URL:",D.bizurl,"\n","For reviews & more info visit ",D.url,"\n"].join("");
+B.setTextNotes((D.description||"")+E);
+C.show(B)
+};
+YahooMaps._parseDate=function(C,D,A){if(C){var B=C.split("-")
+}if(D){var E=D.split(":")
+}if(E&&A){return(new Date(B[0],B[1]-1,B[2],parseInt(E[0])+A,E[1],E[2]))
+}else{if(E&&!A){return(new Date(B[0],B[1]-1,B[2],E[0],E[1],E[2]))
+}else{if(C){return(new Date(B[0],B[1]-1,B[2]))
+}}}return null
+};
+YahooMaps._isValidTime=function(A){if(A){return A.split(":").length>1?true:false
+}return false
+};
+YahooMaps._sendEvent=function(D){var A=appCtxt.get(ZmSetting.USERNAME)+" shared an event using Yahoo! Local";
+var B=[D.name,"\n",D.addr,"\n",D.city,",",D.state,"\n","Business URL:",D.bizurl,"\n","For Reviews & more info view ",D.url,"\n"].join("");
+var F="\n\nThis email was sent to you by a user on Upcoming (upcoming.com).";
+var C="Hi,\n\n"+B+F;
+if(appCtxt.get(ZmSetting.HTML_COMPOSE_ENABLED)&&appCtxt.get(ZmSetting.COMPOSE_AS_FORMAT)==ZmSetting.COMPOSE_HTML){C=AjxStringUtil.nl2br(C)
+}var D={action:ZmOperation.NEW_MESSAGE,subjOverride:A,extraBodyText:C};
+var E=AjxDispatcher.run("GetComposeController");
+E.doAction(D)
+};
+YahooMaps.prototype.addTrafficSearchListener=function(){var A=this;
+function B(F){if(!F.Data){return
+}var G=A.getMap();
+for(a in F.Data.ITEMS){var D=F.Data.ITEMS[a];
+if(D.TITLE){var E=A._constructTrafficResult(D);
+var C=A.getMarker(A.getGeoPoint(D.LATITUDE,D.LONGITUDE),E);
+G.addOverlay(C)
+}}}YEvent.Capture(this.getMap(),EventsList.onEndTrafficSearch,B)
+};
+YahooMaps.prototype._constructTrafficResult=function(B){var C=[];
+var A=0;
+C[A++]="<div>";
+C[A++]=B.TITLE;
+C[A++]="</div>";
+C[A++]='<div><a href="#" onclick="YahooMaps._sendTrafficResult({';
+C[A++]=" title:'";
+C[A++]=B.TITLE.replace("'","");
+C[A++]="'";
+C[A++]='});">Email</a>';
+C[A++]="</div>";
+return C.join("")
+};
+YahooMaps._sendTrafficResult=function(C){var A=appCtxt.get(ZmSetting.USERNAME)+" shared a traffic info. using Yahoo! Local";
+var B=C.title;
+if(appCtxt.get(ZmSetting.HTML_COMPOSE_ENABLED)&&appCtxt.get(ZmSetting.COMPOSE_AS_FORMAT)==ZmSetting.COMPOSE_HTML){B=AjxStringUtil.nl2br(B)
+}var C={action:ZmOperation.NEW_MESSAGE,subjOverride:A,extraBodyText:B};
+var D=AjxDispatcher.run("GetComposeController");
+D.doAction(C)
+};
+YahooMaps.prototype.searchTraffic=function(C){var B=this.getMap();
+var A=this.getGeoPoint(C.latitude,C.longitude);
+C.radius=C.radius||YahooMaps.DEFAULT_TRAFFICRADIUS;
+B.searchTraffic(A,C.radius)
+};
+YahooMaps.prototype.changeLocation=function(C){if(C.latitude&&C.longitude){this.setLocMarker(C.latitude,C.longitude,"<b>You are here!</b><br>Please select your new location to make it your default location",YahooMaps.LOC_MARKER_IMAGE);
+YEvent.Capture(this.getMap(),EventsList.MouseClick,B)
+}var A=this;
+function B(D,F){A.getMap().removeMarkersAll();
+var E=A.setLocMarker(F.Lat,F.Lon,"<b>Click here to make this your default location.</b><br>Or, Please select a new location.",YahooMaps.LOC_MARKER_IMAGE);
+YEvent.Capture(E,EventsList.MouseClick,G);
+function G(I,H){YEvent.Remove(A.getMap(),EventsList.MouseClick,B);
+A._controller.setLocation(F.Lat,F.Lon);
+A.markMe(F.Lat,F.Lon)
+}}if(C.newLatitude&&C.newLongitude){B(null,{Lat:C.newLatitude,Lon:C.newLongitude})
+}};
+YahooMaps.prototype.markMe=function(A,B){this.setLocMarker(A,B,"You are here!",YahooMaps.LOC_MARKER_IMAGE)
+};
+YahooMaps.prototype.markAddr=function(C){this.getMap().drawZoomAndCenter(C.defaultLocation);
+var B=this.getMap().getCenterLatLon();
+var A=this.getMarker(this.getGeoPoint(B.LAT,B.LON),C.defaultLocation);
+this.getMap().addOverlay(A)
+};
+YahooMaps.prototype.getMap=function(){if(!this._map){try{this._map=new YMap(this.getHtmlElement())
+}catch(A){alert("Unable to load map. YMap missing.");
+return
+}}return this._map
+};
+YahooMaps.prototype.getGeoPoint=function(A,B){return(new YGeoPoint(A,B))
+};
+YahooMaps.prototype.getMarker=function(B,E,D){var A=new YMarker(B);
+if(D){var C=new YImage();
+D=ZmZimletBase.PROXY+AjxStringUtil.urlComponentEncode(D);
+C.src=D;
+A.changeImage(C)
+}A.addAutoExpand(E);
+return A
+};
+YahooMaps.prototype.getUpcoming=function(){if(!this._upcoming){this._upcoming=new UpComingEvents()
+}return this._upcoming
+};
+YahooMaps.prototype.setLocMarker=function(C,E,D,B){var A=this.getMarker(this.getGeoPoint(C,E),D,B);
+this.getMap().addOverlay(A);
+return A
+};
+YahooMaps.prototype.mark=function(B){var A=this.getMarker(this.getGeoPoint(B.latitude,B.longitude),B.text||"",B.imgsrc);
+this.getMap().addOverlay(A);
+return A
+};
+YahooMaps.prototype.getResource=function(A){return this._controller._zimlet.getResource(A)
+};
+YahooMaps._loadYAPI=function(A){var B=document.createElement("script");
+B.setAttribute("type","text/javascript");
+B.setAttribute("src",(ZmZimletBase.PROXY+AjxStringUtil.urlComponentEncode(A)));
+if(AjxEnv.isSafari||AjxEnv.isWebKitBased){document.body.appendChild(B)
+}else{document.getElementsByTagName("head").item(0).appendChild(B)
+}};
+YahooMaps._loadYMapsAPI=function(B){var C=new AjxCallback(YahooMaps._postLoadYMapsAPI);
+var A=ZmZimletBase.PROXY+AjxStringUtil.urlComponentEncode(B);
+AjxRpc.invoke(null,A,null,C,true)
+};
+YahooMaps._postLoadYMapsAPI=function(result){var js=result.text;
+js=js.replace(/<!--.*-->/,"")+"function _ywjs(inc){YahooMaps._loadYAPI(inc)};";
+try{AjxPackage.eval(js)
+}catch(ex){alert("Failed to load Yahoo! Maps API.")
+}};
+YahooMaps.loadExternalResources=function(){YahooMaps._loadYMapsAPI("http://api.maps.yahoo.com/ajaxymap?v="+YahooMaps.VERSION+"&appid="+YahooMaps.APPID)
+};
+UpComingEvents=function(){};
+UpComingEvents.DEFAULT_RADIUS=50;
+UpComingEvents.prototype.searchEvents=function(F){var B=["api_key=ae7d801cfb&method=event.search"];
+if(F.query){B.push("search_text="+F.query)
+}if(F.latitude&&F.longitude){B.push("location="+F.latitude+","+F.longitude)
+}B.push("radius="+(F.radius||UpComingEvents.DEFAULT_RADIUS));
+if(F.mindate){B.push("min_date="+F.mindate)
+}else{var D=new Date();
+var E=["min_date=",D.getFullYear(),"-",(D.getMonth()<9)?("0"+(D.getMonth()+1)):(D.getMonth()+1),"-",(D.getDate()<10)?("0"+D.getDate()):(D.getDate())];
+B.push(E.join(""))
+}if(F.page){B.push("page="+F.page)
+}var C="http://upcoming.yahooapis.com/services/rest/?"+B.join("&");
+var A=ZmZimletBase.PROXY+AjxStringUtil.urlComponentEncode(C);
+var G=new AjxCallback(this,this._processSearchEventsResponse,F.callback);
+AjxRpc.invoke(B,A,null,G,true)
+};
+UpComingEvents.prototype._processSearchEventsResponse=function(C,A){var B=this.xmlToObject(A).event;
+B=B.length?B:[B];
+if(C){C.run(B)
+}};
+UpComingEvents.prototype.xmlToObject=function(A){try{var C=new AjxXmlDoc.createFromDom(A.xml).toJSObject(true,false,true)
+}catch(B){}return C
+};
+YLocalDialog=function(B,D,C,F,A){D=D||"YSymbolsDialog";
+this._zimlet=C;
+var E="Select Option";
+DwtDialog.call(this,{parent:B,className:D,title:E});
+this._createSearchHtml(F,A)
+};
+YLocalDialog.prototype=new DwtDialog;
+YLocalDialog.prototype.constructor=YLocalDialog;
+YLocalDialog.prototype._lookupCallback;
+YLocalDialog.prototype._createSearchHtml=function(G,C){this._textObj1=new DwtInputField(this);
+this._textObj2=new DwtInputField(this);
+this._lableObj=new DwtButton(this);
+var D=document.createElement("TABLE");
+D.border=0;
+D.cellPadding=0;
+D.cellSpacing=4;
+var F;
+var A;
+if(G){F=D.insertRow(-1);
+A=F.insertCell(-1);
+A.colSpan=2;
+A.innerHTML=G;
+F=D.insertRow(-1);
+A=F.insertCell(-1);
+A.colSpan=2;
+A.align="center";
+A.innerHTML="<hr>"
+}if(C){this._textZip=new DwtInputField(this);
+F=D.insertRow(-1);
+A=F.insertCell(-1);
+A.innerHTML="Zip:";
+A=F.insertCell(-1);
+A.appendChild(this._textZip.getHtmlElement());
+F=D.insertRow(-1);
+A=F.insertCell(-1);
+A.colSpan=2;
+A.align="center";
+A.innerHTML="<b>or</b>"
+}F=D.insertRow(-1);
+A=F.insertCell(-1);
+A.colSpan=2;
+A.innerHTML="Enter Latitude and Longitude";
+F=D.insertRow(-1);
+A=F.insertCell(-1);
+A.innerHTML="Latitude:";
+A=F.insertCell(-1);
+A.appendChild(this._textObj1.getHtmlElement());
+F=D.insertRow(-1);
+A=F.insertCell(-1);
+A.innerHTML="Longitude:";
+A=F.insertCell(-1);
+A.appendChild(this._textObj2.getHtmlElement());
+F=D.insertRow(-1);
+A=F.insertCell(-1);
+A.colSpan=2;
+A.align="center";
+A.innerHTML="<b>or</b>";
+F=D.insertRow(-1);
+A=F.insertCell(-1);
+A.colSpan=2;
+var E={latitude:45,longitude:45};
+A.appendChild(this._lableObj.getHtmlElement());
+YLocalDialog.gInstance=this;
+A.innerHTML="<a href='#' onclick='changeLocation()'>Click here</a> to select location on map";
+var B=this._getContentDiv();
+B.appendChild(D)
+};
+YLocalDialog.gInstance;
+changeLocation=function(){var A=YLocalDialog.gInstance;
+A.popdown();
+A._zimlet._controller.changeLocation({latitude:45,longitude:45})
+};
+YLocalDialog.prototype.changeLocationByZip=function(){var B=AjxStringUtil.trim((result.text.match(/<td><b>Latitude<\/b><\/td><td>.*(\-?[.\w]+)<\/td>/ig))[0].replace(/<\/?[^>]+>|Latitude/gi,""));
+var C=AjxStringUtil.trim((result.text.match(/<td><b>Longitude<\/b><\/td><td>.*(\-?[.\w]+)<\/td>/ig))[0].replace(/<\/?[^>]+>|Longitude/gi,""));
+if(!(B&&C)){appCtxt.setStatusMsg(this._zimlet.getMessage("coordsNotFound"),ZmStatusView.LEVEL_CRITICAL);
+return
+}var A=this.getLocal();
+this.setView({clean:true,typeControl:true,panControl:false,zoomControl:"long",zoomLevel:3,defaultLat:B,defaultLon:C});
+this.getMapsView().changeLocation({latitude:A.latitude,longitude:A.longitude,newLatitude:B,newLongitude:C})
+};
+YLocalDialog.prototype.popup=function(A,B){this._lookupCallback=B;
+this.setTitle("Select Option");
+this.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,this.okButtonListener));
+this.setButtonEnabled(DwtDialog.OK_BUTTON,true);
+this.setButtonEnabled(DwtDialog.CANCEL_BUTTON,true);
+DwtDialog.prototype.popup.call(this)
+};
+YLocalDialog.prototype.popdown=function(){ZmDialog.prototype.popdown.call(this)
+};
+YLocalDialog.prototype.okButtonListener=function(){if(this._textZip&&this._textZip.getValue()!=""){this._zimlet._controller._getLatLonForZip(this._textZip.getValue())
+}else{this._zimlet._controller.setLanLongAndChangeLocation(this._textObj1.getValue(),this._textObj2.getValue())
+}DwtDialog.prototype.popdown.call(this)
+};
+function Com_Zimbra_YMEmoticons(){this.re=Com_Zimbra_YMEmoticons.REGEXP;
+this.hash=Com_Zimbra_YMEmoticons.SMILEYS;
+this._isEnabled=true
+}Com_Zimbra_YMEmoticons.prototype=new ZmZimletBase;
+Com_Zimbra_YMEmoticons.prototype.constructor=Com_Zimbra_YMEmoticons;
+Com_Zimbra_YMEmoticons.prototype.createComposeButton=function(B){var C=B.parent;
+var A=new YMEmoticonsPickerButton({parent:B,className:"ZToolbarButton"},true);
+A.dontStealFocus();
+A.setToolTipContent(ZmMsg.emoticons);
+A.setEmoticon(":)");
+A.addSelectionListener(new AjxListener(this,this._composeToolbarSmileyListener,[C]))
+};
+Com_Zimbra_YMEmoticons.prototype.on_htmlEditor_createToolbar2=function(B,A){this.createComposeButton(A)
+};
+Com_Zimbra_YMEmoticons.prototype.onFindMsgObjects=function(B,A){if(!this.enableInMail){this.enableInMail=Boolean(this.getUserProperty("yemoticons_enableInMail"))
+}if(B.folderId==ZmOrganizer.ID_CHATS){A.addHandler(this);
+A.sortHandlers();
+A.__hasSmileysHandler=true
+}else{if(!A.__hasSmileysHandler&&this._isEnabled&&this.enableInMail){A.addHandler(this);
+A.sortHandlers();
+A.__hasSmileysHandler=true
+}if(A.__hasSmileysHandler&&(!this._isEnabled||!this.enableInMail)){A.removeHandler(this);
+A.sortHandlers();
+A.__hasSmileysHandler=false
+}}};
+Com_Zimbra_YMEmoticons.prototype.match=function(B,D){this.re.lastIndex=D;
+var A=this.re.exec(B);
+if(A){A.context=this.hash[A[1].toLowerCase()];
+var C=new Image();
+C.src=A.context.src;
+A.context.img=C
+}return A
+};
+Com_Zimbra_YMEmoticons.prototype.generateSpan=function(C,A,F,E,B){var D=B.height/2;
+C[A++]=["<span style='height:",B.height,";width:",B.width,";padding:",D,"px ",B.width,"px ",D,"px 0; background:url(",B.img.src,") no-repeat 0 50%;'",' title="',AjxStringUtil.xmlAttrEncode(B.text)," - ",AjxStringUtil.xmlAttrEncode(B.alt),'"',"></span>"].join("");
+return A
+};
+Com_Zimbra_YMEmoticons.prototype.onNewChatWidget=function(D){var C=D.getObjectManager();
+C.addHandler(this);
+C.sortHandlers();
+var A=D.getEditor().getBasicToolBar();
+var B=new YMEmoticonsPickerButton({parent:A,className:"ZToolbarButton",index:0});
+
+B.dontStealFocus();
+B.setToolTipContent(ZmMsg.emoticons);
+B.setData(ZmLiteHtmlEditor._VALUE,ZmLiteHtmlEditor.SMILEY);
+B.setEmoticon(":)");
+B.addSelectionListener(new AjxListener(this,this._smileyListener,[D]));
+A.addSeparator(null,1)
+};
+Com_Zimbra_YMEmoticons.prototype._smileyListener=function(B,A){this._composeToolbarSmileyListener(B.getEditor(),A)
+};
+Com_Zimbra_YMEmoticons.prototype._composeToolbarSmileyListener=function(A,C){if(!A){return
+}var B=C.item.getSelectedSmiley();
+if(B){A.insertText(B.text);
+A.focus()
+}};
+Com_Zimbra_YMEmoticons.prototype.menuItemSelected=function(A){switch(A){case"YE_TEMP_DISABLE":this.temporarilyDisable();
+break;
+case"YE_PREFERENCES":this._showPreferenceDlg();
+break
+}};
+Com_Zimbra_YMEmoticons.prototype.doubleClicked=function(){this.singleClicked()
+};
+Com_Zimbra_YMEmoticons.prototype.singleClicked=function(){this._showPreferenceDlg()
+};
+Com_Zimbra_YMEmoticons.prototype.temporarilyDisable=function(){this._isEnabled=false;
+var A=[ZmToast.FADE_IN,ZmToast.PAUSE,ZmToast.FADE_OUT];
+appCtxt.getAppController().setStatusMsg("Emoticons Temporarily Disabled",ZmStatusView.LEVEL_INFO,null,A)
+};
+Com_Zimbra_YMEmoticons.prototype._showPreferenceDlg=function(){if(this._preferenceDialog){this._preferenceDialog.popup();
+return
+}this._preferenceView=new DwtComposite(this.getShell());
+this._preferenceView.getHtmlElement().style.overflow="auto";
+this._preferenceView.getHtmlElement().innerHTML=this._createPrefView();
+this._preferenceDialog=this._createDialog({title:"Yahoo! Emoticons Preferences",view:this._preferenceView,standardButtons:[DwtDialog.OK_BUTTON]});
+this._preferenceDialog.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,this._okPreferenceBtnListener));
+if(!this.enableInMail){this.enableInMail=Boolean(this.getUserProperty("yemoticons_enableInMail"))
+}document.getElementById("yemoticons_enableInMail_div").checked=this.enableInMail;
+this._preferenceDialog.popup()
+};
+Com_Zimbra_YMEmoticons.prototype._createPrefView=function(){return["<div class='ymemoticonsPrefDialog'>","<input id='yemoticons_enableInMail_div' type='checkbox'/>Enable Emoticons In Mail","</div>"].join("")
+};
+Com_Zimbra_YMEmoticons.prototype._okPreferenceBtnListener=function(){this._preferenceDialog.popdown();
+var B=document.getElementById("yemoticons_enableInMail_div").checked;
+if(B!=this.enableInMail){this.setUserProperty("yemoticons_enableInMail",B,true);
+this.enableInMail=B;
+var A=B?"Enabled":"Disabled";
+var C=[ZmToast.FADE_IN,ZmToast.PAUSE,ZmToast.FADE_OUT];
+appCtxt.getAppController().setStatusMsg(["Emoticons ",A," In Mail"].join(""),ZmStatusView.LEVEL_INFO,null,C)
+}};
+Com_Zimbra_YMEmoticons.REGEXP=/(>:D<|#:-S|O:-\)|<:-P|:-SS|<\):\)|:-\?\?|3:-O|:\(\|\)|@};-|\*\*==|\(~~\)|\*-:\)|\[-O<|:\)>-|\\:D\x2f|\^:\)\^|;;\)|:-\x2f|:\x22>|:-\*|=\(\(|:-O|B-\)|:-S|>:\)|:\(\(|:\)\)|\x2f:\)|=\)\)|:-B|:-c|:\)\]|~X\(|:-h|:-t|8->|I-\)|8-\||L-\)|:-&|:-\$|\[-\(|:O\)|8-}|\(:\||=P~|:-\?|#-o|=D>|@-\)|:\^o|:-w|:-<|>:P|:o3|%-\(|:@\)|~:>|%%-|~O\)|8-X|=:\)|>-\)|:-L|\$-\)|:-\x22|b-\(|\[-X|>:\x2f|;\)\)|:-@|:-j|\(\*\)|o->|o=>|o-\+|\(%\)|:\)|:\(|;\)|:D|:x|:P|X\(|:>|:\||=;)/ig;
+Com_Zimbra_YMEmoticons.SMILEYS={":)":{width:18,alt:"happy",src:"/service/zimlet/com_zimbra_ymemoticons/img/1.gif",text:":)",regexp:":\\)",height:18},":(":{width:18,alt:"sad",src:"/service/zimlet/com_zimbra_ymemoticons/img/2.gif",text:":(",regexp:":\\(",height:18},"(~~)":{width:17,alt:"pumpkin",src:"/service/zimlet/com_zimbra_ymemoticons/img/56.gif",text:"(~~)",regexp:"\\(~~\\)",height:18},"~o)":{width:18,alt:"coffee",src:"/service/zimlet/com_zimbra_ymemoticons/img/57.gif",text:"~O)",regexp:"~O\\)",height:18},':">':{width:18,alt:"blushing",src:"/service/zimlet/com_zimbra_ymemoticons/img/9.gif",text:':">',regexp:":\\x22>",height:18},"[-(":{width:18,alt:"not talking",src:"/service/zimlet/com_zimbra_ymemoticons/img/33.gif",text:"[-(",regexp:"\\[-\\(",height:18},">:d<":{width:42,alt:"big hug",src:"/service/zimlet/com_zimbra_ymemoticons/img/6.gif",text:">:D<",regexp:">:D<",height:18},"#-o":{width:24,alt:"d'oh",src:"/service/zimlet/com_zimbra_ymemoticons/img/40.gif",text:"#-o",regexp:"#-o",height:18},"[-x":{width:22,alt:"shame on you",src:"/service/zimlet/com_zimbra_ymemoticons/img/68.gif",text:"[-X",regexp:"\\[-X",height:18},":-t":{width:30,alt:"time out",src:"/service/zimlet/com_zimbra_ymemoticons/img/104.gif",text:":-t",regexp:":-t",height:18},":(|)":{width:21,alt:"monkey",src:"/service/zimlet/com_zimbra_ymemoticons/img/51.gif",text:":(|)",regexp:":\\(\\|\\)",height:18},":o)":{width:28,alt:"clown",src:"/service/zimlet/com_zimbra_ymemoticons/img/34.gif",text:":O)",regexp:":O\\)",height:18},"i-)":{width:21,alt:"sleepy",src:"/service/zimlet/com_zimbra_ymemoticons/img/28.gif",text:"I-)",regexp:"I-\\)",height:18},";;)":{width:18,alt:"batting eyelashes",src:"/service/zimlet/com_zimbra_ymemoticons/img/5.gif",text:";;)",regexp:";;\\)",height:18},":^o":{width:18,alt:"liar",src:"/service/zimlet/com_zimbra_ymemoticons/img/44.gif",text:":^o",regexp:":\\^o",height:18},"<:-p":{width:38,alt:"party",src:"/service/zimlet/com_zimbra_ymemoticons/img/36.gif",text:"<:-P",regexp:"<:-P",height:18},"x(":{width:34,alt:"angry",src:"/service/zimlet/com_zimbra_ymemoticons/img/14.gif",text:"X(",regexp:"X\\(",height:18},":-/":{width:20,alt:"confused",src:"/service/zimlet/com_zimbra_ymemoticons/img/7.gif",text:":-/",regexp:":-\\x2f",height:18},"#:-s":{width:34,alt:"whew!",src:"/service/zimlet/com_zimbra_ymemoticons/img/18.gif",text:"#:-S",regexp:"#:-S",height:18},"8->":{width:23,alt:"daydreaming",src:"/service/zimlet/com_zimbra_ymemoticons/img/105.gif",text:"8->",regexp:"8->",height:18},":d":{width:18,alt:"big grin",src:"/service/zimlet/com_zimbra_ymemoticons/img/4.gif",text:":D",regexp:":D",height:18},"\\:d/":{width:26,alt:"dancing",src:"/service/zimlet/com_zimbra_ymemoticons/img/69.gif",text:"\\:D/",regexp:"\\\\:D\\x2f",height:18},":-b":{width:24,alt:"nerd",src:"/service/zimlet/com_zimbra_ymemoticons/img/26.gif",text:":-B",regexp:":-B",height:18},":-@":{width:36,alt:"chatterbox",src:"/service/zimlet/com_zimbra_ymemoticons/img/76.gif",text:":-@",regexp:":-@",height:18},":-h":{width:28,alt:"wave",src:"/service/zimlet/com_zimbra_ymemoticons/img/103.gif",text:":-h",regexp:":-h",height:18},":-c":{width:28,alt:"call me",src:"/service/zimlet/com_zimbra_ymemoticons/img/101.gif",text:":-c",regexp:":-c",height:18},"=p~":{width:18,alt:"drooling",src:"/service/zimlet/com_zimbra_ymemoticons/img/38.gif",text:"=P~",regexp:"=P~",height:18},"(:|":{width:18,alt:"yawn",src:"/service/zimlet/com_zimbra_ymemoticons/img/37.gif",text:"(:|",regexp:"\\(:\\|",height:18},":-o":{width:18,alt:"surprise",src:"/service/zimlet/com_zimbra_ymemoticons/img/13.gif",text:":-O",regexp:":-O",height:18},"o->":{width:18,alt:"hiro",src:"/service/zimlet/com_zimbra_ymemoticons/img/72.gif",text:"o->",regexp:"o->",height:18},":))":{width:18,alt:"laughing",src:"/service/zimlet/com_zimbra_ymemoticons/img/21.gif",text:":))",regexp:":\\)\\)",height:18},"/:)":{width:18,alt:"raised eyebrow",src:"/service/zimlet/com_zimbra_ymemoticons/img/23.gif",text:"/:)",regexp:"\\x2f:\\)",height:18},"*-:)":{width:30,alt:"idea",src:"/service/zimlet/com_zimbra_ymemoticons/img/58.gif",text:"*-:)",regexp:"\\*-:\\)",height:18},":)]":{width:31,alt:"on the phone",src:"/service/zimlet/com_zimbra_ymemoticons/img/100.gif",text:":)]",regexp:":\\)\\]",height:18},":-ss":{width:36,alt:"nailbiting",src:"/service/zimlet/com_zimbra_ymemoticons/img/42.gif",text:":-SS",regexp:":-SS",height:18},"(%)":{width:18,alt:"yin yang",src:"/service/zimlet/com_zimbra_ymemoticons/img/75.gif",text:"(%)",regexp:"\\(%\\)",height:18},":-*":{width:18,alt:"kiss",src:"/service/zimlet/com_zimbra_ymemoticons/img/11.gif",text:":-*",regexp:":-\\*",height:18},"~x(":{width:44,alt:"at wits' end",src:"/service/zimlet/com_zimbra_ymemoticons/img/102.gif",text:"~X(",regexp:"~X\\(",height:18},"o=>":{width:18,alt:"billy",src:"/service/zimlet/com_zimbra_ymemoticons/img/73.gif",text:"o=>",regexp:"o=>",height:18},":-??":{width:40,alt:"I don't know",src:"/service/zimlet/com_zimbra_ymemoticons/img/106.gif",text:":-??",regexp:":-\\?\\?",height:18},"@-)":{width:18,alt:"hypnotized",src:"/service/zimlet/com_zimbra_ymemoticons/img/43.gif",text:"@-)",regexp:"@-\\)",height:18},"3:-o":{width:18,alt:"cow",src:"/service/zimlet/com_zimbra_ymemoticons/img/50.gif",text:"3:-O",regexp:"3:-O",height:18},"=d>":{width:18,alt:"applause",src:"/service/zimlet/com_zimbra_ymemoticons/img/41.gif",text:"=D>",regexp:"=D>",height:18},":-w":{width:23,alt:"waiting",src:"/service/zimlet/com_zimbra_ymemoticons/img/45.gif",text:":-w",regexp:":-w",height:18},":x":{width:18,alt:"love struck",src:"/service/zimlet/com_zimbra_ymemoticons/img/8.gif",text:":x",regexp:":x",height:18},":-$":{width:18,alt:"don't tell anyone",src:"/service/zimlet/com_zimbra_ymemoticons/img/32.gif",text:":-$",regexp:":-\\$",height:18},"~:>":{width:18,alt:"chicken",src:"/service/zimlet/com_zimbra_ymemoticons/img/52.gif",text:"~:>",regexp:"~:>",height:18},"=:)":{width:20,alt:"bug",src:"/service/zimlet/com_zimbra_ymemoticons/img/60.gif",text:"=:)",regexp:"=:\\)",height:18},"(*)":{width:18,alt:"star",src:"/service/zimlet/com_zimbra_ymemoticons/img/79.gif",text:"(*)",regexp:"\\(\\*\\)",height:18},":|":{width:18,alt:"straight face",src:"/service/zimlet/com_zimbra_ymemoticons/img/22.gif",text:":|",regexp:":\\|",height:18},":((":{width:22,alt:"crying",src:"/service/zimlet/com_zimbra_ymemoticons/img/20.gif",text:":((",regexp:":\\(\\(",height:18},"8-x":{width:18,alt:"skull",src:"/service/zimlet/com_zimbra_ymemoticons/img/59.gif",text:"8-X",regexp:"8-X",height:18},"o:-)":{width:30,alt:"angel",src:"/service/zimlet/com_zimbra_ymemoticons/img/25.gif",text:"O:-)",regexp:"O:-\\)",height:18},">:p":{width:18,alt:"phbbbbt",src:"/service/zimlet/com_zimbra_ymemoticons/img/47.gif",text:">:P",regexp:">:P",height:18},">-)":{width:18,alt:"alien",src:"/service/zimlet/com_zimbra_ymemoticons/img/61.gif",text:">-)",regexp:">-\\)",height:18},"=((":{width:18,alt:"broken heart",src:"/service/zimlet/com_zimbra_ymemoticons/img/12.gif",text:"=((",regexp:"=\\(\\(",height:18},"l-)":{width:24,alt:"loser",src:"/service/zimlet/com_zimbra_ymemoticons/img/30.gif",text:"L-)",regexp:"L-\\)",height:18},":@)":{width:18,alt:"pig",src:"/service/zimlet/com_zimbra_ymemoticons/img/49.gif",text:":@)",regexp:":@\\)",height:18},">:/":{width:23,alt:"bring it on",src:"/service/zimlet/com_zimbra_ymemoticons/img/70.gif",text:">:/",regexp:">:\\x2f",height:18},"b-(":{width:18,alt:"feeling beat up",src:"/service/zimlet/com_zimbra_ymemoticons/img/66.gif",text:"b-(",regexp:"b-\\(",height:18},"$-)":{width:18,alt:"money eyes",src:"/service/zimlet/com_zimbra_ymemoticons/img/64.gif",text:"$-)",regexp:"\\$-\\)",height:18},":-?":{width:18,alt:"thinking",src:"/service/zimlet/com_zimbra_ymemoticons/img/39.gif",text:":-?",regexp:":-\\?",height:18},":)>-":{width:22,alt:"peace sign",src:"/service/zimlet/com_zimbra_ymemoticons/img/67.gif",text:":)>-",regexp:":\\)>-",height:18},":-j":{width:26,alt:"oh go on",src:"/service/zimlet/com_zimbra_ymemoticons/img/78.gif",text:":-j",regexp:":-j",height:18},"%%-":{width:18,alt:"good luck",src:"/service/zimlet/com_zimbra_ymemoticons/img/54.gif",text:"%%-",regexp:"%%-",height:18},"%-(":{width:52,alt:"not listening",src:"/service/zimlet/com_zimbra_ymemoticons/img/107.gif",text:"%-(",regexp:"%-\\(",height:18},":p":{width:18,alt:"tongue",src:"/service/zimlet/com_zimbra_ymemoticons/img/10.gif",text:":P",regexp:":P",height:18},"^:)^":{width:32,alt:"not worthy",src:"/service/zimlet/com_zimbra_ymemoticons/img/77.gif",text:"^:)^",regexp:"\\^:\\)\\^",height:18},':-"':{width:22,alt:"whistling",src:"/service/zimlet/com_zimbra_ymemoticons/img/65.gif",text:':-"',regexp:":-\\x22",height:18},":-<":{width:24,alt:"sigh",src:"/service/zimlet/com_zimbra_ymemoticons/img/46.gif",text:":-<",regexp:":-<",height:18},":o3":{width:31,alt:"puppy dog eyes",src:"/service/zimlet/com_zimbra_ymemoticons/img/108.gif",text:":o3",regexp:":o3",height:18},">:)":{width:18,alt:"devil",src:"/service/zimlet/com_zimbra_ymemoticons/img/19.gif",text:">:)",regexp:">:\\)",height:18},"=;":{width:18,alt:"talk to the hand",src:"/service/zimlet/com_zimbra_ymemoticons/img/27.gif",text:"=;",regexp:"=;",height:18},"8-|":{width:18,alt:"rolling eyes",src:"/service/zimlet/com_zimbra_ymemoticons/img/29.gif",text:"8-|",regexp:"8-\\|",height:18},"**==":{width:25,alt:"flag",src:"/service/zimlet/com_zimbra_ymemoticons/img/55.gif",text:"**==",regexp:"\\*\\*==",height:18},"o-+":{width:18,alt:"april",src:"/service/zimlet/com_zimbra_ymemoticons/img/74.gif",text:"o-+",regexp:"o-+",height:18},"8-}":{width:24,alt:"silly",src:"/service/zimlet/com_zimbra_ymemoticons/img/35.gif",text:"8-}",regexp:"8-}",height:18},"=))":{width:30,alt:"rolling on the floor",src:"/service/zimlet/com_zimbra_ymemoticons/img/24.gif",text:"=))",regexp:"=\\)\\)",height:18},":-l":{width:18,alt:"frustrated",src:"/service/zimlet/com_zimbra_ymemoticons/img/62.gif",text:":-L",regexp:":-L",height:18},"b-)":{width:18,alt:"cool",src:"/service/zimlet/com_zimbra_ymemoticons/img/16.gif",text:"B-)",regexp:"B-\\)",height:18},";)":{width:18,alt:"winking",src:"/service/zimlet/com_zimbra_ymemoticons/img/3.gif",text:";)",regexp:";\\)",height:18},":>":{width:18,alt:"smug",src:"/service/zimlet/com_zimbra_ymemoticons/img/15.gif",text:":>",regexp:":>",height:18},":-&":{width:18,alt:"sick",src:"/service/zimlet/com_zimbra_ymemoticons/img/31.gif",text:":-&",regexp:":-&",height:18},"<):)":{width:18,alt:"cowboy",src:"/service/zimlet/com_zimbra_ymemoticons/img/48.gif",text:"<):)",regexp:"<\\):\\)",height:18},":-s":{width:18,alt:"worried",src:"/service/zimlet/com_zimbra_ymemoticons/img/17.gif",text:":-S",regexp:":-S",height:18},";))":{width:18,alt:"hee hee",src:"/service/zimlet/com_zimbra_ymemoticons/img/71.gif",text:";))",regexp:";\\)\\)",height:18},"[-o<":{width:18,alt:"praying",src:"/service/zimlet/com_zimbra_ymemoticons/img/63.gif",text:"[-O<",regexp:"\\[-O<",height:18},"@};-":{width:18,alt:"rose",src:"/service/zimlet/com_zimbra_ymemoticons/img/53.gif",text:"@};-",regexp:"@};-",height:18}};
+YMEmoticonsPickerButton=function(B,A){if(arguments.length==0){return
+}B.actionTiming=DwtButton.ACTION_MOUSEUP;
+DwtToolBarButton.call(this,B);
+this.setEmoticon();
+if(A&&A==true){this.setMenu(new AjxCallback(this,this._createMenu),false,false,false)
+}else{this.setMenu(new AjxCallback(this,this._createMenu),false,false,true)
+}};
+YMEmoticonsPickerButton.prototype=new DwtToolBarButton;
+YMEmoticonsPickerButton.prototype.constructor=YMEmoticonsPickerButton;
+YMEmoticonsPickerButton.prototype._createMenu=function(){var A=new DwtMenu({parent:this,style:DwtMenu.GENERIC_WIDGET_STYLE});
+this._picker=new YMEmoticonsPicker(A,null,null);
+this._picker.addSelectionListener(new AjxListener(this,this._smileyPicked));
+return A
+};
+YMEmoticonsPickerButton.prototype.setEmoticon=function(B){var A=B?YMEmoticonsPicker.SMILEYS[B]:YMEmoticonsPicker.getDefaultSmiley();
+if(A){this._smileyButtonDiv.src=A.src;
+this._smiley=A
+}};
+YMEmoticonsPickerButton.prototype._createHtmlFromTemplate=function(B,C){DwtButton.prototype._createHtmlFromTemplate.call(this,B,C);
+var D=Dwt.getNextId();
+var A="<div unselectable><img width='18' src='' id='"+D+"_smiley'></div>";
+this.setText(A);
+this._smileyButtonDiv=document.getElementById(D+"_smiley");
+delete D
+};
+YMEmoticonsPickerButton.prototype.getSmiley=function(A){return this._picker.getSmiley(A)
+};
+YMEmoticonsPickerButton.prototype.getSelectedSmiley=function(){return this._smiley
+};
+YMEmoticonsPickerButton.prototype._smileyPicked=function(A){var C=A.detail;
+this.setEmoticon(C);
+if(this.isListenerRegistered(DwtEvent.SELECTION)){var B=DwtShell.selectionEvent;
+B.item=this;
+this.notifyListeners(DwtEvent.SELECTION,B)
+}};
+YMEmoticonsPicker=function(C,B,A){if(arguments.length==0){return
+}B=B||"DwtColorPicker";
+DwtControl.call(this,{parent:C,className:B,posStyle:A});
+this._createEmoticonsPicker(C)
+};
+YMEmoticonsPicker.prototype=new DwtControl;
+YMEmoticonsPicker.prototype.constructor=YMEmoticonsPicker;
+YMEmoticonsPicker.SMILEYS=Com_Zimbra_YMEmoticons.SMILEYS;
+YMEmoticonsPicker.getDefaultSmiley=function(){for(var A in YMEmoticonsPicker.SMILEYS){return YMEmoticonsPicker.SMILEYS[A]
+}return null
+};
+YMEmoticonsPicker.prototype.getDefaultSmiley=YMEmoticonsPicker.getDefaultSmiley;
+YMEmoticonsPicker.prototype._createEmoticonsPicker=function(A){this._createEmoticonsTable();
+this._registerHandlers()
+};
+YMEmoticonsPicker.prototype.addSelectionListener=function(A){this.addListener(DwtEvent.SELECTION,A)
+};
+YMEmoticonsPicker.prototype.removeSelectionListener=function(A){this.removeListener(DwtEvent.SELECTION,A)
+};
+YMEmoticonsPicker.prototype.dispose=function(){if(this._disposed){return
+}Dwt.disassociateElementFromObject(this.getHtmlElement().firstChild,this);
+DwtControl.prototype.dispose.call(this)
+};
+YMEmoticonsPicker.prototype.getSmiley=function(A){return YMEmoticonsPicker.SMILEYS[A]
+};
+YMEmoticonsPicker.EMOTICONS_PER_ROW=11;
+YMEmoticonsPicker.prototype._createEmoticonsTable=function(){var G=0;
+var D=[];
+var A=0;
+var E=0;
+var H=0;
+var B=0;
+var I=0;
+for(var C in YMEmoticonsPicker.SMILEYS){if(A!=0&&!(A%YMEmoticonsPicker.EMOTICONS_PER_ROW)){D[G++]="</tr><tr>";
+if(E>H){H=E
+}E=0
+}B=YMEmoticonsPicker.SMILEYS[C].width;
+I=YMEmoticonsPicker.SMILEYS[C].height;
+D[G++]=['<td style=\'background-color:#FFFFFF;\' align="center" valign="middle" id=\'',C,"' >"].join("");
+D[G++]=["<img height='",I,"' width='",B,"' src='",YMEmoticonsPicker.SMILEYS[C].src,"'"," title='",YMEmoticonsPicker.SMILEYS[C].alt," ",YMEmoticonsPicker.SMILEYS[C].text,"'"," />"].join("");
+D[G++]="</td>";
+A++;
+E=E+B
+}D[G++]="</table>";
+var F=["<table cellpadding='2' cellspacing='3' border='0' align='center' width='",H,"px'><tr>"].join("");
+this.getHtmlElement().innerHTML=[F,D.join("")].join("");
+if(AjxEnv.isFirefox1_5up&&!AjxEnv.isFirefox3up){this.setSize("480px",Dwt.DEFAULT)
+}};
+YMEmoticonsPicker.prototype._registerHandlers=function(){var F=this.getHtmlElement().firstChild;
+Dwt.associateElementWithObject(F,this);
+var G=F.rows;
+var H=G.length;
+for(var D=0;
+D<H;
+D++){var C=G[D].cells;
+var E=C.length;
+for(var B=0;
+B<E;
+B++){var A=C[B];
+Dwt.setHandler(A,DwtEvent.ONMOUSEDOWN,YMEmoticonsPicker._mouseDownHdlr);
+Dwt.setHandler(A,DwtEvent.ONMOUSEUP,YMEmoticonsPicker._mouseUpHdlr)
+}}};
+YMEmoticonsPicker._mouseDownHdlr=function(B){var A=DwtShell.mouseEvent;
+A.setFromDhtmlEvent(B,true);
+var C=A.target;
+if(C.nodeName.toLowerCase()=="img"){C=C.parentNode
+}A.dwtObj._downTdId=C.id;
+A._stopPropagation=true;
+A._returnValue=false;
+A.setToDhtmlEvent(B);
+return false
+};
+YMEmoticonsPicker._mouseUpHdlr=function(C){var B=DwtShell.mouseEvent;
+B.setFromDhtmlEvent(C,true);
+var F=B.dwtObj;
+var E=B.target;
+if(E.nodeName.toLowerCase()=="img"){E=E.parentNode
+}if(F._downTdId==E.id){var A=YMEmoticonsPicker.SMILEYS[E.id];
+if(A){if(F.isListenerRegistered(DwtEvent.SELECTION)){var D=DwtShell.selectionEvent;
+DwtUiEvent.copy(D,B);
+D.item=F;
+D.detail=E.id;
+F.notifyListeners(DwtEvent.SELECTION,D)
+}}if(F.parent instanceof DwtMenu){DwtMenu.closeActiveMenu()
+}}B._stopPropagation=true;
+B._returnValue=false;
+B.setToDhtmlEvent(C);
+return false
+};
+function Com_Zimbra_Gtranslator(){}Com_Zimbra_Gtranslator.prototype=new ZmZimletBase();
+Com_Zimbra_Gtranslator.prototype.constructor=Com_Zimbra_Gtranslator;
+Com_Zimbra_Gtranslator.URL="http://translate.google.com/translate_t";
+Com_Zimbra_Gtranslator.prototype.doDrop=function(A){this._zmObject=A;
+this._isUserInput=false;
+if(!this._gTranslatorDialog){this._initialize()
+}this._contentDIV.innerHTML=AjxStringUtil.nl2br(this._zmObject.body);
+this._contentTA.style.visibility="hidden";
+this._contentDIV.style.visibility="visible";
+this._langSelect.setSelected(0);
+this._gTranslatorDialog.popup()
+};
+Com_Zimbra_Gtranslator.prototype.doubleClicked=function(A){this._isUserInput=true;
+if(!this._gTranslatorDialog){this._initialize()
+}this._contentTA.value="";
+this._contentDIV.style.visibility="hidden";
+this._contentTA.style.visibility="visible";
+this._contentTA.focus();
+this._gTranslatorDialog.popup()
+};
+Com_Zimbra_Gtranslator.prototype._makeRequest=function(F,E){var A=[];
+var D=0;
+A[D++]="text=";
+A[D++]=AjxStringUtil.urlEncode(E);
+A[D++]="&langpair=";
+A[D++]=AjxStringUtil.urlEncode(F||"en|de");
+A[D++]="&hl=en&ie=UTF8";
+var B={"User-Agent":navigator.userAgent,"Content-Type":"application/x-www-form-urlencoded",Referrer:"http://translate.google.com/translate_t"};
+var C=ZmZimletBase.PROXY+AjxStringUtil.urlEncode(Com_Zimbra_Gtranslator.URL);
+AjxRpc.invoke(A.join(""),C,B,new AjxCallback(this,this._resultCallback))
+};
+Com_Zimbra_Gtranslator.prototype._initialize=function(){this._parentView=new DwtComposite(this.getShell());
+this._parentView.setSize("440","175");
+this._languages=[{value:"en|de",label:"English to German"},{value:"en|es",label:"English to Spanish"},{value:"en|fr",label:"English to French"},{value:"en|it",label:"English to Italian"},{value:"en|pt",label:"English to Portuguese"},{value:"en|ja",label:"English to Japanese BETA"},{value:"en|ko",label:"English to Korean BETA"},{value:"en|zh-CN",label:"English to Chinese (Simplified) BETA"},{value:"de|en",label:"German to English"},{value:"de|fr",label:"German to French"},{value:"es|en",label:"Spanish to English"},{value:"fr|en",label:"French to English"},{value:"fr|de",label:"French to German"},{value:"it|en",label:"Italian to English"},{value:"pt|en",label:"Portuguese to English"},{value:"ja|en",label:"Japanese to English BETA"},{value:"ko|en",label:"Korean to English BETA"},{value:"zh-CN|en",label:"Chinese (Simplified) to English BETA"}];
+var D=Dwt.getNextId();
+var C=Dwt.getNextId();
+var F=document.createElement("div");
+var B=[];
+var A=0;
+B[A++]="<table border=0 width=100%><tr>";
+B[A++]="<td width=100% id='";
+B[A++]=D;
+B[A++]="'></td><td id='";
+B[A++]=C;
+B[A++]="'></td></tr></table>";
+F.innerHTML=B.join("");
+this._parentView.getHtmlElement().appendChild(F);
+this._langSelect=new DwtSelect({parent:this._parentView});
+this._langSelect.reparentHtmlElement(D);
+for(A=0;
+A<this._languages.length;
+A++){var E=this._languages[A];
+this._langSelect.addOption(E.label,A==0,E.value)
+}this._translateButton=new DwtButton({parent:this._parentView});
+this._translateButton.reparentHtmlElement(C);
+this._translateButton.setText("Translate");
+this._translateButton.addSelectionListener(new AjxListener(this,this._translateListener));
+this._contentTA=document.createElement("TEXTAREA");
+this._contentTA.style.height="140px";
+this._contentTA.style.width="435px";
+this._contentTA.style.padding="3px";
+this._contentTA.style.position="absolute";
+this._parentView.getHtmlElement().appendChild(this._contentTA);
+this._contentDIV=document.createElement("DIV");
+this._contentDIV.style.height="140px";
+this._contentDIV.style.width="435px";
+this._contentDIV.style.backgroundColor="#FFFFFF";
+this._contentDIV.style.padding="3px";
+this._contentDIV.style.position="absolute";
+this._contentDIV.style.overflow="auto";
+this._parentView.getHtmlElement().appendChild(this._contentDIV);
+this._gTranslatorDialog=this._createDialog({title:"Google Translator",view:this._parentView});
+this._gTranslatorDialog.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,this._gTranslatorDialogOkListener))
+};
+Com_Zimbra_Gtranslator.prototype._populate=function(C){var A=C.success?C.text:null;
+var B=A?A.indexOf("<div id=result_box"):null;
+var D=B?Dwt.parseHtmlFragment(A.substring(B)):null;
+if(this._isUserInput){this._contentTA.style.visibility="hidden";
+this._contentDIV.style.visibility="visible"
+}this._contentDIV.innerHTML=D?D.innerHTML:"An error occurred attempting to translate this message."
+};
+Com_Zimbra_Gtranslator.prototype._gTranslatorDialogOkListener=function(A){this._gTranslatorDialog.popdown()
+};
+Com_Zimbra_Gtranslator.prototype._translateListener=function(A){var B=this._isUserInput?this._contentTA.value:this._zmObject.body;
+this._makeRequest(this._langSelect.getValue(),B)
+};
+Com_Zimbra_Gtranslator.prototype._resultCallback=function(A){this._populate(A);
+if(!this._gTranslatorDialog.isPoppedUp()){this._gTranslatorDialog.popup()
+}};
+function Com_Zimbra_YMaps(){}Com_Zimbra_YMaps.prototype=new ZmZimletBase();
+Com_Zimbra_YMaps.prototype.constructor=Com_Zimbra_YMaps;
+Com_Zimbra_YMaps.prototype.init=function(){if(ZmAssistant&&ZmAssistant.register){ZmAssistant.register(new Com_Zimbra_YMaps_Asst())
+}};
+Com_Zimbra_YMaps.URL="http://api.local.yahoo.com/MapsService/V1/mapImage?appid=ZimbraMail&zoom=4&image_height=245&image_width=345&location=";
+Com_Zimbra_YMaps.CACHE=[];
+Com_Zimbra_YMaps.prototype.doubleClicked=function(){this.singleClicked()
+};
+Com_Zimbra_YMaps.prototype.clicked=function(E,D,C,B){var A="http://maps.yahoo.com/maps_result?addr=";
+var F=D.replace("\n"," ").replace("\r"," ");
+B=window.open(A+escape(F))
+};
+Com_Zimbra_YMaps.prototype.singleClicked=function(){var E=[{label:"Address",name:"address",type:"string",minLength:2,maxLength:200}];
+if(!this._dlg_propertyEditor){var B=new DwtComposite(this.getShell());
+var A=this._propertyEditor=new DwtPropertyEditor(B,true);
+A.initProperties(E);
+var D={title:"Yahoo Maps: Enter Address",view:B};
+this._dlg_propertyEditor=this._createDialog(D);
+var C=this._dlg_propertyEditor;
+A.setFixedLabelWidth();
+A.setFixedFieldWidth();
+C.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,function(){if(!A.validateData()){return
+}this._getDisplayCustomMap()
+}))
+}this._dlg_propertyEditor.popup()
+};
+Com_Zimbra_YMaps.prototype._getDisplayCustomMap=function(){this._dlg_propertyEditor.popdown();
+this._displayDialogMap(this._propertyEditor.getProperties().address);
+this._dlg_propertyEditor.dispose();
+this._dlg_propertyEditor=null
+};
+Com_Zimbra_YMaps.prototype._displayDialogMap=function(B){var A=new DwtComposite(this.getShell());
+var D={view:A,title:"Yahoo Map",standardButtons:[DwtDialog.OK_BUTTON]};
+var C=this._createDialog(D);
+C.popup();
+C.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,function(){C.popdown();
+C.dispose()
+}));
+var E=document.createElement("div");
+A.getHtmlElement().appendChild(E);
+this.toolTipPoppedUp(null,B,null,E)
+};
+Com_Zimbra_YMaps.prototype.toolTipPoppedUp=function(D,E,C,B){B.innerHTML=['<center><img width="345" height="245" id="',ZmZimletBase.encodeId(E),'" src="',this.getResource("blank_pixel.gif"),'"/></center>'].join("");
+if(Com_Zimbra_YMaps.CACHE[E+"img"]){Com_Zimbra_YMaps._displayImage(Com_Zimbra_YMaps.CACHE[E+"img"],E)
+}else{var A=ZmZimletBase.PROXY+AjxStringUtil.urlComponentEncode(Com_Zimbra_YMaps.URL+AjxStringUtil.urlComponentEncode(E));
+AjxRpc.invoke(null,A,null,new AjxCallback(this,Com_Zimbra_YMaps._callback,E),true)
+}};
+Com_Zimbra_YMaps._displayImage=function(A,C){var B=document.getElementById(ZmZimletBase.encodeId(C));
+B.style.backgroundImage="url("+A+")";
+if(!Com_Zimbra_YMaps.CACHE[C+"img"]){Com_Zimbra_YMaps.CACHE[C+"img"]=A
+}};
+Com_Zimbra_YMaps._callback=function(D,A){var C=A.text;
+var B=C.substring(C.indexOf("http://gws"),C.indexOf("</Result>"));
+B=ZmZimletBase.PROXY+AjxStringUtil.urlComponentEncode(B);
+Com_Zimbra_YMaps._displayImage(B,D)
+};
+function Com_Zimbra_YMaps_Asst(){ZmAssistant.call(this,"Yahoo Maps","map","Map an address using Yahoo Maps")
+}Com_Zimbra_YMaps_Asst.prototype=new ZmAssistant();
+Com_Zimbra_YMaps_Asst.prototype.constructor=Com_Zimbra_YMaps_Asst;
+Com_Zimbra_YMaps_Asst.prototype.okHandler=function(C){var B=appCtxt.getZimletMgr();
+var A=B?B._ZIMLETS_BY_ID.com_zimbra_ymaps:null;
+if(A&&this._address){A.handlerObject.toolTipPoppedUp(null,this._address,null,C.getAssistantDiv())
+}return false
+};
+Com_Zimbra_YMaps_Asst.prototype.handle=function(B,D,A){this._address=A;
+var C=A.length>0;
+B._setOkButton("Map",true,C)
+};
+function com_zimbra_bugz(){}com_zimbra_bugz.prototype=new ZmZimletBase();
+com_zimbra_bugz.prototype.constructor=com_zimbra_bugz;
+com_zimbra_bugz.prototype.generateSpan=function(F,J,E,D,A){var I=this.xmlObj("contentObject");
+var B=I&&I.onClick&&I.onClick.actionUrl;
+if(B){var H=this._createContentObj(E,A);
+var G=[];
+this._getHtmlContent(G,0,E,A,D);
+var C={id:D,className:this.getClassName(E),href:this._zimletContext.makeURL(B,H),text:G};
+F[J++]=AjxTemplate.expand("com_zimbra_bugz.templates.Bugz#Bugz_link",C)
+}return J
+};
+ZmZimletBase.prototype.clicked=function(B,D,A,C){C._stopPropagation=false
+};
+AjxTemplate.register("com_zimbra_bugz.templates.Bugz#Bugz_link",function(B,F,E,A){var D=Boolean(A);
+E=(typeof E=="string"?{id:E}:E)||{};
+A=A||[];
+var C=A.length;
+A[C++]='<a target="_blank" id=\'';
+A[C++]=E.id;
+A[C++]="' href='";
+A[C++]=E.href;
+A[C++]="' class='";
+A[C++]=E.className;
+A[C++]="'>";
+A[C++]=E.text;
+A[C++]="</a>";
+return D?A.length:A.join("")
+},{id:"Bugz_link"},true);
+AjxPackage.define("com_zimbra_bugz.templates.Bugz");
+AjxTemplate.register("com_zimbra_bugz.templates.Bugz",AjxTemplate.getTemplate("com_zimbra_bugz.templates.Bugz#Bugz_link"),AjxTemplate.getParams("com_zimbra_bugz.templates.Bugz#Bugz_link"));
+
+
+
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. */ YAHOO.util.Dom=new function(){this.get=function(el){if(typeof el=='string'){el=document.getElementById(el);}return el;};this.getStyle=function(el,property){var value=null;var dv=document.defaultView;el=this.get(el);if(property=='opacity'&&el.filters){value=1;try{value=el.filters.item('DXImageTransform.Microsoft.Alpha').opacity/100;}catch(e){try{value=el.filters.item('alpha').opacity/100;}catch(e){}}}else if(el.style[property]){value=el.style[property];}else if(el.currentStyle&&el.currentStyle[property]){value=el.currentStyle[property];}else if(dv&&dv.getComputedStyle){var converted='';for(i=0,len=property.length;i<len;++i){if(property.charAt(i)==property.charAt(i).toUpperCase()){converted=converted+'-'+property.charAt(i).toLowerCase();}else{converted=converted+property.charAt(i);}}if(dv.getComputedStyle(el,'').getPropertyValue(converted)){value=dv.getComputedStyle(el,'').getPropertyValue(converted);}}return value;};this.setStyle=function(el,property,val){el=this.get(el);switch(property){case'opacity':if(el.filters){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle.hasLayout){el.style.zoom=1;}}else{el.style.opacity=val;el.style['-moz-opacity']=val;el.style['-khtml-opacity']=val;}break;default:el.style[property]=val;}};this.getXY=function(el){el=this.get(el);if(el.parentNode===null||this.getStyle(el,'display')=='none'){return false;}var parent=null;var pos=[];var box;if(el.getBoundingClientRect){box=el.getBoundingClientRect();var scrollTop=document.documentElement.scrollTop||document.body.scrollTop;var scrollLeft=document.documentElement.scrollLeft||document.body.scrollLeft;return[box.left+scrollLeft,box.top+scrollTop];}else if(document.getBoxObjectFor){box=document.getBoxObjectFor(el);pos=[box.x,box.y];}else{pos=[el.offsetLeft,el.offsetTop];parent=el.offsetParent;if(parent!=el){while(parent){pos[0]+=parent.offsetLeft;pos[1]+=parent.offsetTop;parent=parent.offsetParent;}}var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1||(ua.indexOf('safari')!=-1&&this.getStyle(el,'position')=='absolute')){pos[0]-=document.body.offsetLeft;pos[1]-=document.body.offsetTop;}}if(el.parentNode){parent=el.parentNode;}else{parent=null;}while(parent&&parent.tagName!='BODY'&&parent.tagName!='HTML'){pos[0]-=parent.scrollLeft;pos[1]-=parent.scrollTop;if(parent.parentNode){parent=parent.parentNode;}else{parent=null;}}return pos;};this.getX=function(el){return this.getXY(el)[0];};this.getY=function(el){return this.getXY(el)[1];};this.setXY=function(el,pos,noRetry){el=this.get(el);var pageXY=YAHOO.util.Dom.getXY(el);if(pageXY===false){return false;}if(this.getStyle(el,'position')=='static'){this.setStyle(el,'position','relative');}var delta=[parseInt(YAHOO.util.Dom.getStyle(el,'left'),10),parseInt(YAHOO.util.Dom.getStyle(el,'top'),10)];if(isNaN(delta[0])){delta[0]=0;}if(isNaN(delta[1])){delta[1]=0;}if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}var newXY=this.getXY(el);if(!noRetry&&(newXY[0]!=pos[0]||newXY[1]!=pos[1])){this.setXY(el,pos,true);}return true;};this.setX=function(el,x){return this.setXY(el,[x,null]);};this.setY=function(el,y){return this.setXY(el,[null,y]);};this.getRegion=function(el){el=this.get(el);return new YAHOO.util.Region.getRegion(el);};this.getClientWidth=function(){return(document.documentElement.offsetWidth||document.body.offsetWidth);};this.getClientHeight=function(){return(self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight);};this.getElementsByClassName=function(className,tag,root){root=root||document;tag=tag||'*';var nodes=[];var elements=root.getElementsByTagName(tag);var re=new RegExp('(^|\\s)'+className+'(\\s|$)');for(var i=0,len=elements.length;i<len;++i){if(re.test(elements[i]['className'])){nodes[nodes.length]=elements[i];}}return nodes;};this.hasClass=function(el,className){el=this.get(el);var re=new RegExp('(^|\\s)'+className+'(\\s|$)');return re.test(el['className']);};this.addClass=function(el,className){if(this.hasClass(el,className)){return false;}el=this.get(el);el['className']=[el['className'],className].join(' ');return true;};this.removeClass=function(el,className){if(!this.hasClass(el,className)){return false;}el=this.get(el);var re=new RegExp('(^|\\s)'+className+'(\\s|$)');var c=el['className'];el['className']=c.replace(re,'');return true;};};YAHOO.util.Region=function(t,r,b,l){this.top=t;this.right=r;this.bottom=b;this.left=l;};YAHOO.util.Region.prototype.contains=function(region){return(region.left>=this.left&&region.right<=this.right&&region.top>=this.top&&region.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+" t: "+this.top+", r: "+this.right+", b: "+this.bottom+", l: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){this.x=x;this.y=y;this.top=y;this.right=x;this.bottom=y;this.left=x;};YAHOO.util.Point.prototype=new YAHOO.util.Region();
+
+
+
+/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */YAHOO.util.CustomEvent=function(_1,_2){this.type=_1;this.scope=_2||window;this.subscribers=[];if(YAHOO.util["Event"]){YAHOO.util.Event.regCE(this);}};YAHOO.util.CustomEvent.prototype={subscribe:function(fn,_4,_5){this.subscribers.push(new YAHOO.util.Subscriber(fn,_4,_5));},unsubscribe:function(fn,_6){var _7=false;for(var i=0;i<this.subscribers.length;++i){var s=this.subscribers[i];if(s&&s.contains(fn,_6)){this._delete(i);_7=true;}}return _7;},fire:function(){for(var i=0;i<this.subscribers.length;++i){var s=this.subscribers[i];if(s){var _10=(s.override)?s.obj:this.scope;s.fn.call(_10,this.type,arguments,s.obj);}}},unsubscribeAll:function(){for(var i=0;i<this.subscribers.length;++i){this._delete(i);}},_delete:function(_11){var s=this.subscribers[_11];if(s){delete s.fn;delete s.obj;}delete this.subscribers[_11];}};YAHOO.util.Subscriber=function(fn,obj,_13){this.fn=fn;this.obj=obj||null;this.override=(_13);};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){return (this.fn==fn&&this.obj==obj);};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var _14=false;var _15=[];var _16=[];var _17=[];var _18=[];var _19=[];var _20=[];var _21=0;var _22=[];return {POLL_RETRYS:200,POLL_INTERVAL:50,EL:0,TYPE:1,FN:2,WFN:3,SCOPE:3,ADJ_SCOPE:4,isSafari:(/Safari|Konqueror|KHTML/gi).test(navigator.userAgent),isIE:(!this.isSafari&&!navigator.userAgent.match(/opera/gi)&&navigator.userAgent.match(/msie/gi)),addDelayedListener:function(el,_24,fn,_25,_26){_16[_16.length]=[el,_24,fn,_25,_26];if(_14){_21=this.POLL_RETRYS;this.startTimeout(0);}},startTimeout:function(_27){var i=(_27||_27===0)?_27:this.POLL_INTERVAL;this.timeout=setTimeout("YAHOO.util.Event._tryPreloadAttach()",i);},onAvailable:function(_28,_29,_30,_31){_22.push({id:_28,fn:_29,obj:_30,override:_31});_21=this.POLL_RETRYS;this.startTimeout(0);},addListener:function(el,_32,fn,_33,_34){if(this._isValidCollection(el)){var ok=true;for(var i=0;i<el.length;++i){ok=(this.on(el[i],_32,fn,_33,_34)&&ok);}return ok;}else{if(typeof el=="string"){var oEl=this.getEl(el);if(_14&&oEl){el=oEl;}else{this.addDelayedListener(el,_32,fn,_33,_34);return true;}}}if(!el){return false;}if("unload"==_32&&_33!==this){_17[_17.length]=[el,_32,fn,_33,_34];return true;}var _37=(_34)?_33:el;var _38=function(e){return fn.call(_37,YAHOO.util.Event.getEvent(e),_33);};var li=[el,_32,fn,_38,_37];var _41=_15.length;_15[_41]=li;if(this.useLegacyEvent(el,_32)){var _42=this.getLegacyIndex(el,_32);if(_42==-1){_42=_19.length;_19[_42]=[el,_32,el["on"+_32]];_20[_42]=[];el["on"+_32]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),_42);};}_20[_42].push(_41);}else{if(el.addEventListener){el.addEventListener(_32,_38,false);}else{if(el.attachEvent){el.attachEvent("on"+_32,_38);}}}return true;},fireLegacyEvent:function(e,_43){var ok=true;var le=_20[_43];for(i=0;i<le.length;++i){var _45=le[i];if(_45){var li=_15[_45];if(li&&li[this.WFN]){var _46=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(_46,e);ok=(ok&&ret);}else{delete le[i];}}}return ok;},getLegacyIndex:function(el,_48){for(var i=0;i<_19.length;++i){var le=_19[i];if(le&&le[0]==el&&le[1]==_48){return i;}}return -1;},useLegacyEvent:function(el,_49){return ((!el.addEventListener&&!el.attachEvent)||(_49=="click"&&this.isSafari));},removeListener:function(el,_50,fn){if(typeof el=="string"){el=this.getEl(el);}else{if(this._isValidCollection(el)){var ok=true;for(var i=0;i<el.length;++i){ok=(this.removeListener(el[i],_50,fn)&&ok);}return ok;}}var _51=null;var _52=this._getCacheIndex(el,_50,fn);if(_52>=0){_51=_15[_52];}if(!el||!_51){return false;}if(el.removeEventListener){el.removeEventListener(_50,_51[this.WFN],false);}else{if(el.detachEvent){el.detachEvent("on"+_50,_51[this.WFN]);}}delete _15[_52][this.WFN];delete _15[_52][this.FN];delete _15[_52];return true;},getTarget:function(ev,_54){var t=ev.target||ev.srcElement;if(_54&&t&&"#text"==t.nodeName){return t.parentNode;}else{return t;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}return y;},getXY:function(ev){return [this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else{if(ev.type=="mouseover"){t=ev.fromElement;}}}return t;},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(e){return t;}}return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}c=c.caller;}}return ev;},getCharCode:function(ev){return ev.charCode||(ev.type=="keypress")?ev.keyCode:0;},_getCacheIndex:function(el,_59,fn){for(var i=0;i<_15.length;++i){var li=_15[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==_59){return i;}}return -1;},_isValidCollection:function(o){return (o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){for(i in this.elCache){delete this.elCache[i];}},regCE:function(ce){_18.push(ce);},_load:function(e){_14=true;},_tryPreloadAttach:function(){if(this.locked){return false;}this.locked=true;var _63=!_14;if(!_63){_63=(_21>0);}var _64=[];for(var i=0;i<_16.length;++i){var d=_16[i];if(d){var el=this.getEl(d[this.EL]);if(el){this.on(el,d[this.TYPE],d[this.FN],d[this.SCOPE],d[this.ADJ_SCOPE]);delete _16[i];}else{_64.push(d);}}}_16=_64;notAvail=[];for(i=0;i<_22.length;++i){var _66=_22[i];if(_66){el=this.getEl(_66.id);if(el){var _67=(_66.override)?_66.obj:el;_66.fn.call(_67,_66.obj);delete _22[i];}else{notAvail.push(_66);}}}_21=(_64.length===0&&notAvail.length===0)?0:_21-1;if(_63){this.startTimeout();}this.locked=false;},_unload:function(e,me){for(var i=0;i<_17.length;++i){var l=_17[i];if(l){var _70=(l[this.ADJ_SCOPE])?l[this.SCOPE]:window;l[this.FN].call(_70,this.getEvent(e),l[this.SCOPE]);}}if(_15&&_15.length>0){for(i=0;i<_15.length;++i){l=_15[i];if(l){this.removeListener(l[this.EL],l[this.TYPE],l[this.FN]);}}this.clearCache();}for(i=0;i<_18.length;++i){_18[i].unsubscribeAll();delete _18[i];}for(i=0;i<_19.length;++i){delete _19[i][0];delete _19[i];}},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement;db=document.body;if(dd&&dd.scrollTop){return [dd.scrollTop,dd.scrollLeft];}else{if(db){return [db.scrollTop,db.scrollLeft];}else{return [0,0];}}}};}();YAHOO.util.Event.on=YAHOO.util.Event.addListener;if(document&&document.body){YAHOO.util.Event._load();}else{YAHOO.util.Event.on(window,"load",YAHOO.util.Event._load,YAHOO.util.Event,true);}YAHOO.util.Event.on(window,"unload",YAHOO.util.Event._unload,YAHOO.util.Event,true);YAHOO.util.Event._tryPreloadAttach();}
+
+
+
+/* Test build: dragdrop.20060522-1 Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt */ YAHOO.util.DragDrop=function(id,_2){if(id){this.init(id,_2);}};YAHOO.util.DragDrop.prototype={id:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=this.DDM.getElement(this.id);}return this._domRef;},getDragEl:function(){return this.DDM.getElement(this.dragElId);},init:function(id,_6){this.initTarget(id,_6);YAHOO.util.Event.addListener(this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,_7){this.DDM=YAHOO.util.DDM;this.padding=[0,0,0,0];this.groups={};this.id=id;this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.handleElId=id;YAHOO.util.Event.onAvailable(id,this.handleOnAvailable,this,true);this.addToGroup((_7)?_7:"default");},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(_8,_9,_10,_11){if(!_9&&0!==_9){this.padding=[_8,_8,_8,_8];}else{if(!_10&&0!==_10){this.padding=[_8,_9,_8,_9];}else{this.padding=[_8,_9,_10,_11];}}},setInitPosition:function(_12,_13){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}var dx=_12||0;var dy=_13||0;var p=YAHOO.util.Dom.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||YAHOO.util.Dom.getXY(this.getEl());this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(_19){this.groups[_19]=true;this.DDM.regDragDrop(this,_19);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){YAHOO.util.Event.addListener(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);},unreg:function(){YAHOO.util.Event.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return (this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var EU=YAHOO.util.Event;var _22=e.which||e.button;if(this.primaryButtonOnly&&_22>1){return;}if(this.isLocked()){return;}this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(EU.getPageX(e),EU.getPageY(e));if(this.DDM.isOverTarget(pt,this)){var _24=EU.getTarget(e);if(this.isValidHandleChild(_24)&&(this.id==this.handleElId||this.DDM.handleWasClicked(_24,this.id))){this.setStartPosition();this.b4MouseDown(e);this.onMouseDown(e);this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}}},addInvalidHandleType:function(_25){var _26=_25.toUpperCase();this.invalidHandleTypes[_26]=_26;},addInvalidHandleId:function(id){this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(_27){this.invalidHandleClasses.push(_27);},removeInvalidHandleType:function(_28){var _29=_28.toUpperCase();delete this.invalidHandleTypes[_29];},removeInvalidHandleId:function(id){delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(_30){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==_30){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(_32){var _33=true;var n=(_32.nodeName=="#text")?_32.parentNode:_32;_33=_33&&!this.invalidHandleTypes[n.nodeName];_33=_33&&!this.invalidHandleIds[n.id];for(var i=0,len=this.invalidHandleClasses.length;_33&&i<len;++i){_33=!YAHOO.util.Dom.hasClass(n,this.invalidHandleClasses[i]);}return _33;},setXTicks:function(_35,_36){this.xTicks=[];this.xTickSize=_36;var _37={};for(var i=this.initPageX;i>=this.minX;i=i-_36){if(!_37[i]){this.xTicks[this.xTicks.length]=i;_37[i]=true;}}for(i=this.initPageX;i<=this.maxX;i=i+_36){if(!_37[i]){this.xTicks[this.xTicks.length]=i;_37[i]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(_38,_39){this.yTicks=[];this.yTickSize=_39;var _40={};for(var i=this.initPageY;i>=this.minY;i=i-_39){if(!_40[i]){this.yTicks[this.yTicks.length]=i;_40[i]=true;}}for(i=this.initPageY;i<=this.maxY;i=i+_39){if(!_40[i]){this.yTicks[this.yTicks.length]=i;_40[i]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(_41,_42,_43){this.leftConstraint=_41;this.rightConstraint=_42;this.minX=this.initPageX-_41;this.maxX=this.initPageX+_42;if(_43){this.setXTicks(this.initPageX,_43);}this.constrainX=true;},setYConstraint:function(iUp,_45,_46){this.topConstraint=iUp;this.bottomConstraint=_45;this.minY=this.initPageY-iUp;this.maxY=this.initPageY+_45;if(_46){this.setYTicks(this.initPageY,_46);}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,_48){if(!_48){return val;}else{if(_48[0]>=val){return _48[0];}else{for(var i=0,len=_48.length;i<len;++i){var _49=i+1;if(_48[_49]&&_48[_49]>=val){var _50=val-_48[i];var _51=_48[_49]-val;return (_51>_50)?_48[i]:_48[_49];}}return _48[_48.length-1];}}},toString:function(val,_52){return ("YAHOO.util.DragDrop {"+this.id+"}");}};if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=new function(){this.ids={};this.handleIds={};this.dragCurrent=null;this.dragOvers={};this.deltaX=0;this.deltaY=0;this.preventDefault=true;this.stopPropagation=true;this.initalized=false;this.locked=false;this.init=function(){};this.POINT=0;this.INTERSECT=1;this.mode=this.POINT;this._execOnAll=function(_53,_54){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;}oDD[_53].apply(oDD,_54);}}};this._onLoad=function(){var EU=YAHOO.util.Event;EU.on(document,"mouseup",this.handleMouseUp,this,true);EU.on(document,"mousemove",this.handleMouseMove,this,true);EU.on(window,"unload",this._onUnload,this,true);EU.on(window,"resize",this._onResize,this,true);this.initalized=true;};this._onResize=function(e){this._execOnAll("resetConstraints",[]);};this.lock=function(){this.locked=true;};this.unlock=function(){this.locked=false;};this.isLocked=function(){return this.locked;};this.locationCache={};this.useCache=true;this.clickPixelThresh=3;this.clickTimeThresh=1000;this.dragThreshMet=false;this.clickTimeout=null;this.startX=0;this.startY=0;this.regDragDrop=function(oDD,_56){if(!this.initialized){this.init();}if(!this.ids[_56]){this.ids[_56]={};}this.ids[_56][oDD.id]=oDD;};this._remove=function(oDD){for(var g in oDD.groups){if(g&&this.ids[g][oDD.id]){delete this.ids[g][oDD.id];}}delete this.handleIds[oDD.id];};this.regHandle=function(_58,_59){if(!this.handleIds[_58]){this.handleIds[_58]={};}this.handleIds[_58][_59]=_59;};this.isDragDrop=function(id){return (this.getDDById(id))?true:false;};this.getRelated=function(_60,_61){var _62=[];for(var i in _60.groups){for(j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;}if(!_61||dd.isTarget){_62[_62.length]=dd;}}}return _62;};this.isLegalTarget=function(oDD,_64){var _65=this.getRelated(oDD);for(var i=0,len=_65.length;i<len;++i){if(_65[i].id==_64.id){return true;}}return false;};this.isTypeOfDD=function(oDD){return (oDD&&oDD.__ygDragDrop);};this.isHandle=function(_66,_67){return (this.handleIds[_66]&&this.handleIds[_66][_67]);};this.getDDById=function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id];}}return null;};this.handleMouseDown=function(e,oDD){this.currentTarget=YAHOO.util.Event.getTarget(e);this.dragCurrent=oDD;var el=oDD.getEl();this.startX=YAHOO.util.Event.getPageX(e);this.startY=YAHOO.util.Event.getPageY(e);this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX,DDM.startY);},this.clickTimeThresh);};this.startDrag=function(x,y){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(x,y);this.dragCurrent.startDrag(x,y);}this.dragThreshMet=true;};this.handleMouseUp=function(e){if(!this.dragCurrent){return;}clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(e,true);}else{}this.stopDrag(e);this.stopEvent(e);};this.stopEvent=function(e){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(e);}if(this.preventDefault){YAHOO.util.Event.preventDefault(e);}};this.stopDrag=function(e){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e);}this.dragCurrent.onMouseUp(e);}this.dragCurrent=null;this.dragOvers={};};this.handleMouseMove=function(e){if(!this.dragCurrent){return;}if(YAHOO.util.Event.isIE&&!e.button){this.stopEvent(e);return this.handleMouseUp(e);}if(!this.dragThreshMet){var _69=Math.abs(this.startX-YAHOO.util.Event.getPageX(e));var _70=Math.abs(this.startY-YAHOO.util.Event.getPageY(e));if(_69>this.clickPixelThresh||_70>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);this.fireEvents(e,false);}this.stopEvent(e);};this.fireEvents=function(e,_71){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;}var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);var pt=new YAHOO.util.Point(x,y);var _73=[];var _74=[];var _75=[];var _76=[];var _77=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}if(!this.isOverTarget(pt,ddo,this.mode)){_74.push(ddo);}_73[i]=true;delete this.dragOvers[i];}for(var _79 in dc.groups){if("string"!=typeof _79){continue;}for(i in this.ids[_79]){var oDD=this.ids[_79][i];if(!this.isTypeOfDD(oDD)){continue;}if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode)){if(_71){_76.push(oDD);}else{if(!_73[oDD.id]){_77.push(oDD);}else{_75.push(oDD);}this.dragOvers[oDD.id]=oDD;}}}}}if(this.mode){if(_74.length){dc.b4DragOut(e,_74);dc.onDragOut(e,_74);}if(_77.length){dc.onDragEnter(e,_77);}if(_75.length){dc.b4DragOver(e,_75);dc.onDragOver(e,_75);}if(_76.length){dc.b4DragDrop(e,_76);dc.onDragDrop(e,_76);}}else{var len=0;for(i=0,len=_74.length;i<len;++i){dc.b4DragOut(e,_74[i].id);dc.onDragOut(e,_74[i].id);}for(i=0,len=_77.length;i<len;++i){dc.onDragEnter(e,_77[i].id);}for(i=0,len=_75.length;i<len;++i){dc.b4DragOver(e,_75[i].id);dc.onDragOver(e,_75[i].id);}for(i=0,len=_76.length;i<len;++i){dc.b4DragDrop(e,_76[i].id);dc.onDragDrop(e,_76[i].id);}}};this.getBestMatch=function(dds){var _82=null;var len=dds.length;if(len==1){_82=dds[0];}else{for(var i=0;i<len;++i){var dd=dds[i];if(dd.cursorIsOver){_82=dd;break;}else{if(!_82||_82.overlap.getArea()<dd.overlap.getArea()){_82=dd;}}}}return _82;};this.refreshCache=function(_83){for(sGroup in _83){if("string"!=typeof sGroup){continue;}for(i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(this.isTypeOfDD(oDD)){var loc=this.getLocation(oDD);if(loc){this.locationCache[oDD.id]=loc;}else{delete this.locationCache[oDD.id];oDD.unreg();}}}}};this.verifyEl=function(el){try{if(el){var _85=el.offsetParent;if(_85){return true;}}}catch(e){}return false;};this.getLocation=function(oDD){if(!this.isTypeOfDD(oDD)){return null;}var el=oDD.getEl();if(!this.verifyEl(el)){return null;}var _86=YAHOO.util.Dom.getXY(el);x1=_86[0];x2=x1+el.offsetWidth;y1=_86[1];y2=y1+el.offsetHeight;var t=y1-oDD.padding[0];var r=x2+oDD.padding[1];var b=y2+oDD.padding[2];var l=x1-oDD.padding[3];return new YAHOO.util.Region(t,r,b,l);};this.isOverTarget=function(pt,_91,_92){var loc=this.locationCache[_91.id];if(!loc||!this.useCache){loc=this.getLocation(_91);this.locationCache[_91.id]=loc;}_91.cursorIsOver=loc.contains(pt);_91.overlap=null;if(_92){var el=this.dragCurrent.getDragEl();var x=pt.x-this.dragCurrent.deltaX;var y=pt.y-this.dragCurrent.deltaY;var _93=new YAHOO.util.Region(y,x+el.offsetWidth,y+el.offsetHeight,x);var _94=_93.intersect(loc);if(_94){_91.overlap=_94;return true;}else{return false;}}else{return _91.cursorIsOver;}};this._onUnload=function(e,me){this.unregAll();};this.unregAll=function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);for(i in this.elementCache){delete this.elementCache[i];}this.elementCache={};this.ids={};};this.elementCache={};this.getElWrapper=function(id){var _96=this.elementCache[id];if(!_96||!_96.el){_96=this.elementCache[id]=new this.ElementWrapper(document.getElementById(id));}return _96;};this.getElement=function(id){return document.getElementById(id);};this.getCss=function(id){var css=null;var el=document.getElementById(id);if(el){css=el.style;}return css;};this.ElementWrapper=function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;};this.getPosX=function(el){return YAHOO.util.Dom.getX(el);};this.getPosY=function(el){return YAHOO.util.Dom.getY(el);};this.swapNode=function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else{var p=n2.parentNode;var s=n2.nextSibling;n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}};this.getScroll=function(){var t,l;if(document.documentElement&&document.documentElement.scrollTop){t=document.documentElement.scrollTop;l=document.documentElement.scrollLeft;}else{if(document.body){t=document.body.scrollTop;l=document.body.scrollLeft;}}return {top:t,left:l};};this.getStyle=function(el,_101){return YAHOO.util.Dom.getStyle(el,_101);};this.getScrollTop=function(){return this.getScroll().top;};this.getScrollLeft=function(){return this.getScroll().left;};this.moveToEl=function(_102,_103){var _104=YAHOO.util.Dom.getXY(_103);YAHOO.util.Dom.setXY(_102,_104);};this.getClientHeight=function(){return (window.innerHeight)?window.innerHeight:(document.documentElement&&document.documentElement.clientHeight)?document.documentElement.clientHeight:document.body.offsetHeight;};this.getClientWidth=function(){return (window.innerWidth)?window.innerWidth:(document.documentElement&&document.documentElement.clientWidth)?document.documentElement.clientWidth:document.body.offsetWidth;};this.numericSort=function(a,b){return (a-b);};this._timeoutCount=0;this._addListeners=function(){if(YAHOO.util.Event&&document){this._onLoad();}else{if(this._timeoutCount>1000){}else{var DDM=YAHOO.util.DDM;setTimeout(function(){DDM._addListeners();},10);if(document&&document.body){this._timeoutCount+=1;}}}};this.handleWasClicked=function(node,id){if(this.isHandle(id,node.id)){return true;}else{var p=node.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}}return false;};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}YAHOO.util.DD=function(id,_107){if(id){this.init(id,_107);}};YAHOO.util.DD.prototype=new YAHOO.util.DragDrop();YAHOO.util.DD.prototype.scroll=true;YAHOO.util.DD.prototype.autoOffset=function(_108,_109){var el=this.getEl();var _110=YAHOO.util.Dom.getXY(el);var x=_108-_110[0];var y=_109-_110[1];this.setDelta(x,y);};YAHOO.util.DD.prototype.setDelta=function(_111,_112){this.deltaX=_111;this.deltaY=_112;};YAHOO.util.DD.prototype.setDragElPos=function(_113,_114){var el=this.getDragEl();this.alignElWithMouse(el,_113,_114);};YAHOO.util.DD.prototype.alignElWithMouse=function(el,_115,_116){var _117=this.getTargetCoord(_115,_116);var _118=[_117.x,_117.y];YAHOO.util.Dom.setXY(el,_118);this.cachePosition(_117.x,_117.y);this.autoScroll(_117.x,_117.y,el.offsetHeight,el.offsetWidth);};YAHOO.util.DD.prototype.cachePosition=function(_119,_120){if(_119){this.lastPageX=_119;this.lastPageY=_120;}else{var _121=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=_121[0];this.lastPageY=_121[1];}};YAHOO.util.DD.prototype.autoScroll=function(x,y,h,w){if(this.scroll){var _124=this.DDM.getClientHeight();var _125=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var _129=w+x;var _130=(_124+st-y-this.deltaY);var _131=(_125+sl-x-this.deltaX);var _132=40;var _133=(document.all)?80:30;if(bot>_124&&_130<_132){window.scrollTo(sl,st+_133);}if(y<st&&st>0&&y-st<_132){window.scrollTo(sl,st-_133);}if(_129>_125&&_131<_132){window.scrollTo(sl+_133,st);}if(x<sl&&sl>0&&x-sl<_132){window.scrollTo(sl-_133,st);}}};YAHOO.util.DD.prototype.getTargetCoord=function(_134,_135){var x=_134-this.deltaX;var y=_135-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}if(x>this.maxX){x=this.maxX;}}if(this.constrainY){if(y<this.minY){y=this.minY;}if(y>this.maxY){y=this.maxY;}}x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return {x:x,y:y};};YAHOO.util.DD.prototype.b4MouseDown=function(e){this.autoOffset(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));};YAHOO.util.DD.prototype.b4Drag=function(e){this.setDragElPos(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));};YAHOO.util.DDProxy=function(id,_136){if(id){this.forceCssPosition=false;this.init(id,_136);this.initFrame();}};YAHOO.util.DDProxy.prototype=new YAHOO.util.DD();YAHOO.util.DDProxy.frameDiv=null;YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.util.DDProxy.prototype.borderWidth=2;YAHOO.util.DDProxy.prototype.resizeFrame=true;YAHOO.util.DDProxy.prototype.centerFrame=false;YAHOO.util.DDProxy.createFrame=function(){var self=YAHOO.util.DDProxy;var body=document.body;if(!body||!body.firstChild){setTimeout(self.createFrame,50);return;}if(!self.frameDiv){self.frameDiv=document.createElement("div");self.frameDiv.id=self.dragElId;var s=self.frameDiv.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;body.insertBefore(self.frameDiv,body.firstChild);}};YAHOO.util.DDProxy.prototype.initFrame=function(){YAHOO.util.DDProxy.createFrame();this.setDragElId(YAHOO.util.DDProxy.dragElId);this.useAbsMath=true;};YAHOO.util.DDProxy.prototype.showFrame=function(_139,_140){var el=this.getEl();var s=this.getDragEl().style;if(this.resizeFrame){s.width=(parseInt(el.offsetWidth,10)-(2*this.borderWidth))+"px";s.height=(parseInt(el.offsetHeight,10)-(2*this.borderWidth))+"px";}if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.width,10)/2));}this.setDragElPos(_139,_140);s.visibility="";};YAHOO.util.DDProxy.prototype.b4MouseDown=function(e){var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.autoOffset(x,y);this.setDragElPos(x,y);};YAHOO.util.DDProxy.prototype.b4StartDrag=function(x,y){this.showFrame(x,y);};YAHOO.util.DDProxy.prototype.b4EndDrag=function(e){var s=this.getDragEl().style;s.visibility="hidden";};YAHOO.util.DDProxy.prototype.endDrag=function(e){var lel=this.getEl();var del=this.getDragEl();del.style.visibility="";lel.style.visibility="hidden";YAHOO.util.DDM.moveToEl(lel,del);del.style.visibility="hidden";lel.style.visibility="";};YAHOO.util.DDTarget=function(id,_143){if(id){this.initTarget(id,_143);}};YAHOO.util.DDTarget.prototype=new YAHOO.util.DragDrop();
+
+
+
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. */ YAHOO.util.Anim=function(el,attributes,duration,method){if(el){this.init(el,attributes,duration,method);}};YAHOO.util.Anim.prototype={doMethod:function(attribute,start,end){return this.method(this.currentFrame,start,end-start,this.totalFrames);},setAttribute:function(attribute,val,unit){YAHOO.util.Dom.setStyle(this.getEl(),attribute,val+unit);},getAttribute:function(attribute){return parseFloat(YAHOO.util.Dom.getStyle(this.getEl(),attribute));},defaultUnit:'px',defaultUnits:{opacity:' '},init:function(el,attributes,duration,method){var isAnimated=false;var startTime=null;var endTime=null;var actualFrames=0;var defaultValues={};el=YAHOO.util.Dom.get(el);this.attributes=attributes||{};this.duration=duration||1;this.method=method||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;this.getEl=function(){return el;};this.setDefault=function(attribute,val){if(val.constructor!=Array&&(val=='auto'||isNaN(val))){switch(attribute){case'width':val=el.clientWidth||el.offsetWidth;break;case'height':val=el.clientHeight||el.offsetHeight;break;case'left':if(YAHOO.util.Dom.getStyle(el,'position')=='absolute'){val=el.offsetLeft;}else{val=0;}break;case'top':if(YAHOO.util.Dom.getStyle(el,'position')=='absolute'){val=el.offsetTop;}else{val=0;}break;default:val=0;}}defaultValues[attribute]=val;};this.getDefault=function(attribute){return defaultValues[attribute];};this.isAnimated=function(){return isAnimated;};this.getStartTime=function(){return startTime;};this.animate=function(){if(this.isAnimated()){return false;}this.onStart.fire();this._onStart.fire();this.totalFrames=(this.useSeconds)?Math.ceil(YAHOO.util.AnimMgr.fps*this.duration):this.duration;YAHOO.util.AnimMgr.registerElement(this);var attributes=this.attributes;var el=this.getEl();var val;for(var attribute in attributes){val=this.getAttribute(attribute);this.setDefault(attribute,val);}isAnimated=true;actualFrames=0;startTime=new Date();};this.stop=function(){if(!this.isAnimated()){return false;}this.currentFrame=0;endTime=new Date();var data={time:endTime,duration:endTime-startTime,frames:actualFrames,fps:actualFrames/this.duration};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};var onTween=function(){var start;var end=null;var val;var unit;var attributes=this['attributes'];for(var attribute in attributes){unit=attributes[attribute]['unit']||this.defaultUnits[attribute]||this.defaultUnit;if(typeof attributes[attribute]['from']!='undefined'){start=attributes[attribute]['from'];}else{start=this.getDefault(attribute);}if(typeof attributes[attribute]['to']!='undefined'){end=attributes[attribute]['to'];}else if(typeof attributes[attribute]['by']!='undefined'){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+attributes[attribute]['by'][i];}}else{end=start+attributes[attribute]['by'];}}if(end!==null&&typeof end!='undefined'){val=this.doMethod(attribute,start,end);if((attribute=='width'||attribute=='height'||attribute=='opacity')&&val<0){val=0;}this.setAttribute(attribute,val,unit);}}actualFrames+=1;};this._onStart=new YAHOO.util.CustomEvent('_onStart',this);this.onStart=new YAHOO.util.CustomEvent('start',this);this.onTween=new YAHOO.util.CustomEvent('tween',this);this._onTween=new YAHOO.util.CustomEvent('_tween',this);this.onComplete=new YAHOO.util.CustomEvent('complete',this);this._onTween.subscribe(onTween);}};YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=200;this.delay=1;this.registerElement=function(tween){if(tween.isAnimated()){return false;}queue[queue.length]=tween;tweenCount+=1;this.start();};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween){clearInterval(thread);for(var i=0,len=queue.length;i<len;++i){if(queue[i].isAnimated()){queue[i].stop();}}queue=[];thread=null;tweenCount=0;}else{tween.stop();tweenCount-=1;if(tweenCount<=0){this.stop();}}};this.run=function(){for(var i=0,len=queue.length;i<len;++i){var tween=queue[i];if(!tween||!tween.isAnimated()){continue;}if(tween.currentFrame<tween.totalFrames||tween.totalFrames===null){tween.currentFrame+=1;if(tween.useSeconds){correctFrame(tween);}tween.onTween.fire();tween._onTween.fire();}else{YAHOO.util.AnimMgr.stop(tween);}}};var correctFrame=function(tween){var frames=tween.totalFrames;var frame=tween.currentFrame;var expected=(tween.currentFrame*tween.duration*1000/tween.totalFrames);var elapsed=(new Date()-tween.getStartTime());var tweak=0;if(elapsed<tween.duration*1000){tweak=Math.round((elapsed/expected-1)*tween.currentFrame);}else{tweak=frames-(frame+1);}if(tweak>0&&isFinite(tweak)){if(tween.currentFrame+tweak>=frames){tweak=frames-(frame+1);}tween.currentFrame+=tweak;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(points,t){var n=points.length;var tmp=[];for(var i=0;i<n;++i){tmp[i]=[points[i][0],points[i][1]];}for(var j=1;j<n;++j){for(i=0;i<n-j;++i){tmp[i][0]=(1-t)*tmp[i][0]+t*tmp[parseInt(i+1,10)][0];tmp[i][1]=(1-t)*tmp[i][1]+t*tmp[parseInt(i+1,10)][1];}}return[tmp[0][0],tmp[0][1]];};};YAHOO.util.Easing=new function(){this.easeNone=function(t,b,c,d){return b+c*(t/=d);};this.easeIn=function(t,b,c,d){return b+c*((t/=d)*t*t);};this.easeOut=function(t,b,c,d){var ts=(t/=d)*t;var tc=ts*t;return b+c*(tc+-3*ts+3*t);};this.easeBoth=function(t,b,c,d){var ts=(t/=d)*t;var tc=ts*t;return b+c*(-2*tc+3*ts);};this.backIn=function(t,b,c,d){var ts=(t/=d)*t;var tc=ts*t;return b+c*(-3.4005*tc*ts+10.2*ts*ts+-6.2*tc+0.4*ts);};this.backOut=function(t,b,c,d){var ts=(t/=d)*t;var tc=ts*t;return b+c*(8.292*tc*ts+-21.88*ts*ts+22.08*tc+-12.69*ts+5.1975*t);};this.backBoth=function(t,b,c,d){var ts=(t/=d)*t;var tc=ts*t;return b+c*(0.402*tc*ts+-2.1525*ts*ts+-3.2*tc+8*ts+-2.05*t);};};YAHOO.util.Motion=function(el,attributes,duration,method){if(el){this.initMotion(el,attributes,duration,method);}};YAHOO.util.Motion.prototype=new YAHOO.util.Anim();YAHOO.util.Motion.prototype.defaultUnits.points='px';YAHOO.util.Motion.prototype.doMethod=function(attribute,start,end){var val=null;if(attribute=='points'){var translatedPoints=this.getTranslatedPoints();var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;if(translatedPoints){val=YAHOO.util.Bezier.getPosition(translatedPoints,t);}}else{val=this.method(this.currentFrame,start,end-start,this.totalFrames);}return val;};YAHOO.util.Motion.prototype.getAttribute=function(attribute){var val=null;if(attribute=='points'){val=[this.getAttribute('left'),this.getAttribute('top')];if(isNaN(val[0])){val[0]=0;}if(isNaN(val[1])){val[1]=0;}}else{val=parseFloat(YAHOO.util.Dom.getStyle(this.getEl(),attribute));}return val;};YAHOO.util.Motion.prototype.setAttribute=function(attribute,val,unit){if(attribute=='points'){YAHOO.util.Dom.setStyle(this.getEl(),'left',val[0]+unit);YAHOO.util.Dom.setStyle(this.getEl(),'top',val[1]+unit);}else{YAHOO.util.Dom.setStyle(this.getEl(),attribute,val+unit);}};YAHOO.util.Motion.prototype.initMotion=function(el,attributes,duration,method){YAHOO.util.Anim.call(this,el,attributes,duration,method);attributes=attributes||{};attributes.points=attributes.points||{};attributes.points.control=attributes.points.control||[];this.attributes=attributes;var start;var end=null;var translatedPoints=null;this.getTranslatedPoints=function(){return translatedPoints;};var translateValues=function(val,self){var pageXY=YAHOO.util.Dom.getXY(self.getEl());val=[val[0]-pageXY[0]+start[0],val[1]-pageXY[1]+start[1]];return val;};var onStart=function(){start=this.getAttribute('points');var attributes=this.attributes;var control=attributes['points']['control']||[];if(control.length>0&&control[0].constructor!=Array){control=[control];}if(YAHOO.util.Dom.getStyle(this.getEl(),'position')=='static'){YAHOO.util.Dom.setStyle(this.getEl(),'position','relative');}if(typeof attributes['points']['from']!='undefined'){YAHOO.util.Dom.setXY(this.getEl(),attributes['points']['from']);start=this.getAttribute('points');}else if((start[0]===0||start[1]===0)){YAHOO.util.Dom.setXY(this.getEl(),YAHOO.util.Dom.getXY(this.getEl()));start=this.getAttribute('points');}var i,len;if(typeof attributes['points']['to']!='undefined'){end=translateValues(attributes['points']['to'],this);for(i=0,len=control.length;i<len;++i){control[i]=translateValues(control[i],this);}}else if(typeof attributes['points']['by']!='undefined'){end=[start[0]+attributes['points']['by'][0],start[1]+attributes['points']['by'][1]];for(i=0,len=control.length;i<len;++i){control[i]=[start[0]+control[i][0],start[1]+control[i][1]];}}if(end){translatedPoints=[start];if(control.length>0){translatedPoints=translatedPoints.concat(control);}translatedPoints[translatedPoints.length]=end;}};this._onStart.subscribe(onStart);};YAHOO.util.Scroll=function(el,attributes,duration,method){if(el){YAHOO.util.Anim.call(this,el,attributes,duration,method);}};YAHOO.util.Scroll.prototype=new YAHOO.util.Anim();YAHOO.util.Scroll.prototype.defaultUnits.scroll=' ';YAHOO.util.Scroll.prototype.doMethod=function(attribute,start,end){var val=null;if(attribute=='scroll'){val=[this.method(this.currentFrame,start[0],end[0]-start[0],this.totalFrames),this.method(this.currentFrame,start[1],end[1]-start[1],this.totalFrames)];}else{val=this.method(this.currentFrame,start,end-start,this.totalFrames);}return val;};YAHOO.util.Scroll.prototype.getAttribute=function(attribute){var val=null;var el=this.getEl();if(attribute=='scroll'){val=[el.scrollLeft,el.scrollTop];}else{val=parseFloat(YAHOO.util.Dom.getStyle(el,attribute));}return val;};YAHOO.util.Scroll.prototype.setAttribute=function(attribute,val,unit){var el=this.getEl();if(attribute=='scroll'){el.scrollLeft=val[0];el.scrollTop=val[1];}else{YAHOO.util.Dom.setStyle(el,attribute,val+unit);}};
+
+
+
+/*
+Copyright (c) 2008 Yahoo! Inc. All rights reserved. - version 3.8.2.7
+*/
+function YahooMapsAPIAjax(){var YMapConfig=new function(){this._list=["locale","imgPrefixURL","statURL","geoCoder","geoRSS","localSearch","trafficSearch","tileReg","tileSat","tileHyb","tileRegMono","tileSatMono","copySat","copyHyb","copyReg","copyText","unitMetersText","unitKmText","unitFtText","unitMilesText","tileSize","tileXY","radiusKm","milesKm","nauticalKm","milesDeg360","radPerDeg","maxZoom","mapsSite"];var getYear=function(){return new Date().getFullYear();};var regVer=4.3;var satVer=1.9;var _defaults={locale:"en_US",imgPrefixURL:"http://l.yimg.com/a/i/us/map/aj/",statURL:"http://geo.yahoo.com/p?",polyLine:"http://api.maps.yahoo.com/ajax/pl?",geoCoder:"http://api.maps.yahoo.com/ajax/geocode?",geoRSS:"http://api.maps.yahoo.com/ajax/georss?",localSearch:"http://api.maps.yahoo.com/ajax/locsrch?",trafficSearch:"http://api.maps.yahoo.com/ajax/trfsrch?",tileReg:["http://maps.yimg.com/hx/tl?v="+regVer+"&","http://maps1.yimg.com/hx/tl?v="+regVer+"&","http://maps2.yimg.com/hx/tl?v="+regVer+"&","http://maps3.yimg.com/hx/tl?v="+regVer+"&"],tileHyb:["http://maps.yimg.com/hx/tl?v="+regVer+"&t=h&","http://maps1.yimg.com/hx/tl?v="+regVer+"&t=h&","http://maps2.yimg.com/hx/tl?v="+regVer+"&t=h&","http://maps3.yimg.com/hx/tl?v="+regVer+"&t=h&"],tileRegMono:["http://maps.yimg.com/hx/ximg?v="+regVer+"&f=g&","http://maps1.yimg.com/hx/ximg?v="+regVer+"&f=g&","http://maps2.yimg.com/hx/ximg?v="+regVer+"&f=g&","http://maps3.yimg.com/hx/ximg?v="+regVer+"&f=g&"],tileSat:["http://maps.yimg.com/ae/ximg?v="+satVer+"&t=a&s=256&","http://maps1.yimg.com/ae/ximg?v="+satVer+"&t=a&s=256&","http://maps2.yimg.com/ae/ximg?v="+satVer+"&t=a&s=256&","http://maps3.yimg.com/ae/ximg?v="+satVer+"&t=a&s=256&"],tileSatMono:["http://maps.yimg.com/ae/ximg?v="+satVer+"&t=a&s=256&f=jg&","http://maps1.yimg.com/ae/ximg?v="+satVer+"&t=a&s=256&f=jg&","http://maps2.yimg.com/ae/ximg?v="+satVer+"&t=a&s=256&f=jg&","http://maps3.yimg.com/ae/ximg?v="+satVer+"&t=a&s=256&f=jg&"],copySat:{service:"http://api.maps.yahoo.com/ajax/copy?v=1.8&m=2"},copyReg:{service:"http://tile.maps.yahoo.com/copyright?t=png&color=black&aa=-1&"},copyHyb:{service:"http://tile.maps.yahoo.com/copyright?t=png&color=white&aa=-1&"},copyText:"&copy;"+getYear()+" Yahoo! Inc.",unitMetersText:"m",unitKmText:"km",unitFtText:"ft",unitMilesText:"mi",tileSize:256,tileXY:256,radiusKm:6366.707,milesKm:0.621371192,nauticalKm:0.539956803,milesDeg360:39999960,radPerDeg:(Math.PI/180),maxZoom:18,mapsSite:"http://maps.yahoo.com"};this.set=function(l,v){if(l&&v){this[l]=v;return ;}for(var i=0;i<this._list.length;i++){if(l[this._list[i]]){this[this._list[i]]=l[this._list[i]];}}};this.set(_defaults);this.marker1=this.imgPrefixURL+"markerf19824.png";this.marker2=this.imgPrefixURL+"star.gif";this.marker9=this.imgPrefixURL+"cpx.gif";this.ylogo=this.imgPrefixURL+"yahoo20091203.png";};YMapConfig.isValidLocale=function(l){var i={"de-DE":true,"DE":true,"es-ES":true,"ES":true,"fr-FR":true,"FR":true,"it-IT":true,"IT":true,"en-GB":true,"UK":true,"en-US":true,"US":true,"fr-CA":true,"en-CA":true,"en-IN":true,"IN":true};return(i[l]);};YMapConfig.setLocale=function(l){if(this.isValidLocale){this.locale=l;}};YMapConfig.setRegTile=function(l){this.tileReg=l;};YMapConfig.setSatTile=function(l){this.tileSat=l;};YMapConfig.setHybTile=function(l){this.tileHyb=l;};YMapConfig.setRegMonoTile=function(l){this.tileRegMono=l;};YMapConfig.setSatMonoTile=function(l){this.tileSatMono=l;};YMapConfig.get=function(l){var c={};for(var i=0;i<this._list.length;i++){c[this._list[i]]=this[this._list[i]];}if(l){return this[l];}return c;};YMapConfig.getProperties=function(){return this._list;};YMapConfig.getLocale=function(l){return this.locale;};var YGeoPoint=function(a,b){this.Lat=parseFloat(a)||0;this.Lon=parseFloat(b)||0;};YGeoPoint.prototype.greater=function(p){if(p&&p.valid){return(this.Lat>p.Lat&&this.Lon>p.Lon);}return false;};YGeoPoint.prototype.equal=function(p){if(p&&p.valid){return(this.Lat==p.Lat&&this.Lon==p.Lon);}return false;};YGeoPoint.prototype.valid=function(){return true;};YGeoPoint.prototype.getRad=function(){return new YGeoPoint(this.Lat*Math.PI/180,this.Lon*Math.PI/180);};YGeoPoint.prototype.distance=function(p,u){if(!p){return ;}var a=this.pointDiff(p);var _do=new Object();var p1r=this.getRad();var p2r=p.getRad();var _b=Math.acos(Math.cos(p1r.Lat)*Math.cos(p1r.Lon)*Math.cos(p2r.Lat)*Math.cos(p2r.Lon)+Math.cos(p1r.Lat)*Math.sin(p1r.Lon)*Math.cos(p2r.Lat)*Math.sin(p2r.Lon)+Math.sin(p1r.Lat)*Math.sin(p2r.Lat));_do.kilometers=YMapConfig.radiusKm*_b;_do.miles=YMapConfig.milesKm*_do.kilometers;_do.nautical=YMapConfig.nauticalKm*_do.kilometers;_do.degrees=Math.sqrt(a.Lat*a.Lat+a.Lon*a.Lon);if(u){_do.pixels=_do.kilometers/u.kilometers;}return _do;};YGeoPoint.prototype.pointDiff=function(p){if(!p){return ;}var _l=this.Lat-p.Lat;var _g=p.Lon-this.Lon;return(new YGeoPoint(_l,_g));};YGeoPoint.prototype.middle=function(p){var _a=(this.Lat+p.Lat)/2;var _b=(this.Lon+p.Lon)/2;return(new YGeoPoint(_a,_b));};YGeoPoint.prototype.setgeobox=function(_b){this.LatMax=(this.Lat>_b.Lat)?this.Lat:_b.Lat;this.LatMin=(this.Lat>_b.Lat)?_b.Lat:this.Lat;this.LonMax=(this.Lon>_b.Lon)?this.Lon:_b.Lon;this.LonMin=(this.Lon>_b.Lon)?_b.Lon:this.Lon;this.min=new YGeoPoint((this.Lat>_b.Lat)?_b.Lat:this.Lat,(this.Lon>_b.Lon)?_b.Lon:this.Lon);this.max=new YGeoPoint((this.Lat>_b.Lat)?this.Lat:_b.Lat,(this.Lon>_b.Lon)?this.Lon:_b.Lon);};var YCoordPoint=function(x,y){this.x=parseFloat(x)||0;this.y=parseFloat(y)||0;this._xpos="left";this._ypos="top";};YCoordPoint.prototype.equal=function(p){if(p&&p.valid){return(this.x==p.x&&this.y==p.y);}return false;};YCoordPoint.prototype.translate=function(_a,_b){this._xpos=_a;this._ypos=_b;};YCoordPoint.prototype.valid=function(){return true;};YCoordPoint.prototype.distance=function(p){var a=this.pointDiff(p);return Math.sqrt(a.x*a.x+a.y*a.y);};YCoordPoint.prototype.pointDiff=function(p){var _x=p.x-this.x;var _y=this.y-p.y;return(new YCoordPoint(_x,_y));};var YSize=function(w,h){this.width=parseInt(w)||0;this.height=parseInt(h)||0;};YSize.prototype.hasSmallerSide=function(_s){return(this.width<_s.width||this.height<_s.height);};YSize.prototype.valid=function(){return true;};YSize.prototype.area=function(_s){if(_s){return _s.width*_s.height;}return this.width*this.height;};var YImage=function(a,b,c,d){this.src=a||YMapConfig.marker1;this.size=b||new YSize(30,33);this.offsetSmartWindow=c||new YCoordPoint(-1,-1);this.offset=d||new YCoordPoint(0,0);this.yitype=true;};var TileXY=function(tx,ty,x,y){this.tx=tx||0;this.ty=ty||0;this.x=parseInt(x,10)||0;this.y=parseInt(y,10)||0;};var Annotation=function(t,d,l){this.title=t;this.description=d;this.link=l;this.valid=true;};var MapDistance=function(n,t){this.distance=n;this.type=t||"miles";this.valid=true;};function Projection(p_level,clat,tilew,tileh){this.init(p_level,clat,tilew,tileh);}Projection.prototype.init=function(p_level,clat,tilew,tileh){if(p_level<1){this.level_=1;}else{if(p_level>YMapConfig.maxZoom){this.level_=YMapConfig.maxZoom;}else{this.level_=p_level;}}this.tile_w_=tilew;this.tile_h_=tileh;this.status_=1;this.isok=isok;this.tile_width=tile_width;this.pixel_width=pixel_width;this.tile_height=tile_height;this.pixel_height=pixel_height;this.mpp=mpp;this.level=level;this.tile_size=tile_size;this.scaleKm=scaleKm;this.scaleMiles=scaleMiles;this.scaleFeet=scaleFeet;this.pix_to_tile=pix_to_tile;};function pix_to_tile(xp,yp){var _txy=new TileXY();var ypos=Math.abs(yp);_txy.tx=Math.floor(xp/this.tile_w_);_txy.x=xp%this.tile_w_;_txy.ty=Math.floor(ypos/this.tile_h_);_txy.y=ypos%this.tile_h_;if(yp<0){_txy.ty=-_txy.ty;var y=ypos%this.tile_h_;if(y&&y>0){_txy.ty--;_txy.y=this.tile_h_-_txy.y;}}return _txy;}function tile_width(){return this.ntiles_w_;}function pixel_width(){return this.ntiles_w_*this.tile_w_;}function tile_height(){return this.ntiles_h_;}function pixel_height(){return this.ntiles_h_*this.tile_h_;}function mpp(){return this.meters_per_pixel_;}function level(){return this.level_;}function tile_size(){return this.tile_w_;}function isok(){return this.status_==1;}function scaleKm(km,clat){return(this.scaleMeters(km*1000,clat));}function scaleMiles(miles,clat){return(this.scaleMeters(miles*1609.344,clat));}function scaleFeet(feet,clat){return(this.scaleMeters(feet/3.282,clat));}function sinh(x){ret=Math.exp(x);ret=(ret-1/ret)/2;return ret;}function MercatorProjection(p_level,tilew,tileh){tileh=tilew=YMapConfig.tileXY;this.init(p_level,0,tilew,tileh);this.circum_px=1<<(26-this.level_);this.ntiles_w_=this.circum_px/this.tile_w_;this.ntiles_h_=this.circum_px/this.tile_h_;this.meters_per_pixel_=YMapConfig.milesDeg360/this.circum_px;this.x_per_lon_=this.circum_px/360;this.ll_to_xy=ll_to_xy;this.xy_to_ll=xy_to_ll;this.mpp_m=mpp_m;this.scaleMeters=scaleMeters;this.ll_to_pxy=ll_to_pxy;this.pxy_to_ll=pxy_to_ll;}MercatorProjection.prototype=new Projection();MercatorProjection.prototype.constructor=MercatorProjection;MercatorProjection.superclass=Projection.prototype;MercatorProjection.prototype._returnCoordPoint=function(l,t,x,y){return new YCoordPoint(l+x,t+YMapConfig.tileXY-y);};function xy_to_ll(col,row,x,y){var x_pixel=col*this.tile_w_+x;var y_pixel=row*this.tile_h_+y;return(this.pxy_to_ll(x_pixel,y_pixel));}function ll_to_xy(_g){var _txy=new TileXY();var _cp=this.ll_to_pxy(_g.Lat,_g.Lon);if(this.isok()){_txy=this.pix_to_tile(_cp.x,_cp.y);}return _txy;}function ll_to_pxy(lat,lon){var _cp=new YCoordPoint();var alon=lon+180;var ltmp=Math.abs(alon)%360;if(alon<0){alon=360-ltmp;}if(alon>360){alon=ltmp;}var alat=Math.abs(lat);if(alat>90){alat=90;}alat*=YMapConfig.radPerDeg;_cp.x=parseInt(alon*this.x_per_lon_);ytemp=Math.log(Math.tan(alat)+1/Math.cos(alat))/Math.PI;_cp.y=parseInt(ytemp*this.pixel_height())/2;if(lat<0){_cp.y=-_cp.y;}this.status_=1;return _cp;}function pxy_to_ll(x_pixel,y_pixel){var gp=new YGeoPoint();this.status_=0;var alon=x_pixel/this.x_per_lon_;var ltmp=Math.abs(alon)%360;if(alon<0){alon=360-ltmp;}if(alon>360){alon=ltmp;}gp.Lon=alon-180;var alat=(y_pixel/(this.pixel_height()/2))*Math.PI;alat=Math.atan(sinh(alat))/YMapConfig.radPerDeg;if(alat<-90){alat=-90;}if(alat>90){alat=90;}gp.Lat=alat;this.status_=1;return gp;}function mpp_m(clat){return(this.meters_per_pixel_*Math.cos(clat*YMapConfig.radPerDeg));}function scaleMeters(meters,clat){return(parseInt(meters/this.mpp_m(clat)+0.5));}var YUtility=new function(){};var trackTr=null;var trackCache=[];var trackDl=3000;function trackDelay(o,t,c){return(function(){if(t=="pan_ob"){o.resetXY();}YUtility.tracker(o,t);clearTimeout(trackTr);trackTr=null;});}var markerTr=null;function checkMarkerAdded(o,t){return(function(){if(o){var mc=o.getMarkerCount();YUtility.tracker(o,t);clearTimeout(markerTr);markerTr=null;}});}YUtility.trackKey=function(o,z){var _c="_";return"xy"+o.tx+_c+o.ty+_c+z;};YUtility.tracker=function(o,operation){var cpt=o.getCenterLatLon();if(!cpt){return ;}var maptype=o.getCurrentMapType();var size=o.getContainerSize();var zoom=o.getZoomLevel();var dw=screen&&screen.width?screen.width:0;var dh=screen&&screen.height?screen.height:0;var width=size.width;var height=size.height;var _dsopkey="";var txy=o.getTXY();var key=YUtility.trackKey(txy,zoom);var cached=(trackCache[key])?1:0;if(operation=="zoom_ob"){_dsopkey="ds_zmtr";}if(operation=="start"){_dsopkey="ds_initr";}if(operation=="pan_ob"){_dsopkey="ds_pantr";}var _img=document.createElement("img");_img.width=_img.height="1px";_img.style.visibility="hidden";_img.id="ymaptrk"+operation;var _mvt="m";var _nvq="n";if(maptype==YAHOO_MAP_SAT){_mvt="s";_nvq="";}if(maptype==YAHOO_MAP_HYB){_mvt="h";}var nmkr=o.getMarkerCount();var _l="s=97199103";_l+="&oper="+operation;_l+="&z_lvl="+zoom;_l+="&mvt="+_mvt;_l+="&nloc="+nmkr;_l+="&appid="+YMAPPID;_l+="&cached="+cached;_l+="&swpx="+dw;_l+="&shpx="+dh;_l+="&wpx="+width;_l+="&hpx="+height;_l+="&lat="+cpt.Lat;_l+="&lon="+cpt.Lon;_l+="&i_api=1";_l+="&apptype=ajax";_l+="&locale="+YMapConfig.getLocale();_l+="&testid=M077";_l+="&i_trf=0";_l+="&d_s="+_nvq;_l+="&ds_i="+_nvq;_l+="&ds_maptr="+_nvq;if(_dsopkey){_l+="&"+_dsopkey+"="+_nvq;}_img.src=YMapConfig.statURL+_l;_img.onload=function(){YUtility.removeNode(_img);};YUtility.appendNode(o.dom,_img);if(operation=="zoom_ob"||operation=="pan"||operation=="start"){trackCache[key]=zoom;}};YUtility._xyKey=function(x,y,z,t){var _z=z||0;var _t=t||0;var _c="_";return"xy"+x+_c+y+_c+_z+_c+_t;};YUtility.getByID=function(id){return document.getElementById(id);};YUtility.getByTag=function(tag){return document.getElementsByTagName(tag);};YUtility.getRandomID=function(){var r="yid"+Math.random().toString();return(r.replace(/\./g,""));};YUtility.removeNode=function(_n){var o=(_n&&_n.dom)?_n.dom:_n;if(typeof o==="object"){try{YUtility.deleak(o);var n=o.parentNode.removeChild(o);n=null;}catch(x){}}};var _selectOnCache=[];YUtility.setDefaultSelectStyle=function(_c){if(YUtility.browser.id==0){_c.unselectable="on";if(_c.nodeName=="IMG"){_c.galleryImg="no";}}else{if(YUtility.browser.id==1){YUtility.setStyle(_c,"MozUserSelect","none");}}};var _nodeCache={};YUtility.cloneNode=function(_e,_p){var _c=null;var _k=_e+_p;var _n=_nodeCache[_k];if(!_n){_c=_nodeCache[_k]=YUtility.createNode(_e);}else{_c=_n.cloneNode(true);}YUtility.setDefaultSelectStyle(_c);return _c;};YUtility.createNode=function(_e,_id){var _c=document.createElement(_e);if(_id){_c.id=_id;}YUtility.setDefaultSelectStyle(_c);return _c;};YUtility.appendNode=function(_s,_n){if(!_n||!_s){return ;}var _c=(_n.dom)?_n.dom:_n;var _p=(_s.dom)?_s.dom:_s;if(!_c.parentNode){_p.appendChild(_c);return ;}if(_c.parentNode&&_c.parentNode.nodeType>3){_p.appendChild(_c);return ;}};YUtility.deleak=function(o){var a,i,l,n;a=(o)?o.attributes:null;if(a){l=a.length;for(i=0;i<l;i+=1){if(!a[i]){continue;}n=a[i].name;if(typeof o[n]==="function"){o[n]=null;}}}if(o){a=o.childNodes;}if(a){l=a.length;for(i=0;i<l;i+=1){YUtility.deleak(o.childNodes[i]);}}};YUtility.dynamicSNode=function(i,r){var shead=YUtility.getByTag("head");var snode=YUtility.getByID(i);if(snode){YUtility.removeNode(snode);}snode=YUtility.createNode("script");snode.type="text/javascript";snode.src=r;snode.id=i;YUtility.appendNode(shead[0],snode);};YUtility.getSize=function(_e){var d=YAHOO.util.Dom.getRegion(_e);var s=(d.getArea())?(new YSize((d.right-d.left),(d.bottom-d.top))):(new YSize(0,0));return s;};YUtility.setStyle=function(e,k,v){if(!e){return ;}var _e=(e.dom)?e.dom:e;if(typeof k=="object"){for(var t in k){if(typeof k[t]!="function"){_e.style[t]=k[t];}}}else{_e.style[k]=v;}};YUtility.browser=new function(){var _n={ie:0,moz:1,saf:2,opr:3,oth:9};var _o={win:0,mac:1,oth:3};var ua=navigator.userAgent.toLowerCase();this.os=3;if(/windows/.test(ua)){this.os=0;}else{if(/mac/.test(ua)){this.os=1;}}this.id=9;if(/opera/.test(ua)){this.id=3;}else{if(/safari/.test(ua)){this.id=2;}else{if(/gecko/.test(ua)){this.id=1;}else{if(typeof document.all!="undefined"){this.id=0;}}}}};YUtility.getInt=function(_n){var n=parseInt(_n);return(isNaN(n)?0:n);};YUtility.alphaLoad=function(_n,_t){var _clr=YMapConfig.marker9;var _typ=(_t)?"crop":"scale";var _p=(_n.dom)?_n.dom:_n;if(YUtility.browser.id){return ;}else{if(_p&&_p.nodeName=="IMG"){var _ie="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_p.src+"', sizingMethod="+_typ+")";YUtility.setStyle(_p,"filter",_ie);_p.src=_clr;}}};YUtility.alphaImg2=function(_ni){if(YUtility.browser.id){return ;}return"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_ni+"', sizingMethod=crop)";};YUtility.alphaImg=function(_ni,_t,_oi){if(YUtility.browser.id){return ;}var _typ=(_t)?"crop":"scale";if(_oi){_oi.src=YMapConfig.marker9;}return"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_ni+"', sizingMethod="+_typ+")";};var _subscriber=function(fn,obj,cast){this.fn=fn;this.obj=obj||null;this.override=(cast);this._muted=false;};_subscriber.prototype.contains=function(fn,obj){return(this.fn==fn&&this.obj==obj);};var _captureEvent=function(_t,_s){this.type=_t;this.scope=_s;this.subscribers=[];};_captureEvent.prototype=new YAHOO.util.CustomEvent;_captureEvent.prototype.trigger=function(_e,_o){for(var i in this.subscribers){var _s=this.subscribers[i];if(_s){var scope=(_s.override)?_s.obj:this.scope;if(_s.fn&&!_s._muted){_s.fn.call(scope,_e,_o);}}}};_captureEvent.prototype.subscribe=function(fn,obj,cast){this.subscribers.push(new _subscriber(fn,obj,cast));};var _eventObject=function(_a,_b,_c){this._elem=_a;this._type=_b;this._func=_c;};var YEvent=new function(){this._cache=[];};YEvent.Capture=function(_a,_b,_c,_d,_p){if(!_a||!_b||!_c){return ;}var el=(_a.dom)?_a.dom:(_a.id?_a.id:_a);if(_a.Events&&_a.Events[_b]&&!_p){_a.Events[_b].subscribe(_c,(_d?_d:_a),true);}else{YAHOO.util.Event.addListener(el,(_p?_p:_b),_c,(_d?_d:_a),true);}if(_a.id){if(!this._cache[_a.id]){this._cache[_a.id]=[];}if(!this._cache[_a.id][_b]){this._cache[_a.id][_b]=[];}this._cache[_a.id][_b].push([(_p?_p:_b),_c]);}};YEvent.Remove=function(_a,_b,_c,_p){if(!_a||!_b||!_c){return ;}if(_a.Events&&_a.Events[_b]&&!_p){_a.Events[_b].unsubscribe(_c,_a);}else{var el=(_a.dom)?_a.dom:(_a.id?_a.id:_a);YAHOO.util.Event.removeListener(el,(_p?_p:_b),_c);}};YEvent.ClearAll=function(_a){if(!_a){return ;}var el=(_a.dom)?_a.dom:(_a.id?_a.id:_a);for(var etype in _a.Events){for(var i in this._cache[_a.id][etype]){YAHOO.util.Event.removeListener(el,this._cache[_a.id][etype][i][0],this._cache[_a.id][etype][i][1]);if(_a.Events[etype].unsubscribe){_a.Events[etype].unsubscribe(this._cache[_a.id][etype][i][1],_a);}delete this._cache[_a.id][etype][i];}delete _a.Events[etype];}};YEvent.isCaptureSet=function(_a,_t){for(var _e in _a.Events){if(_e==_t&&_a.Events[_e].subscribers.length){return true;}}return false;};YEvent.stopDefault=function(_e){if(!_e){return ;}YAHOO.util.Event.preventDefault(_e);};YEvent.stopPropag=function(_e){if(!_e){return ;}YAHOO.util.Event.stopPropagation(_e);};YEvent.stopEvent=function(_e){if(!_e){return ;}YAHOO.util.Event.stopEvent(_e);};var EventsList=new function(){};EventsList.unload="unload";EventsList.wheel=(YUtility.browser.id)?"DOMMouseScroll":"mousewheel";EventsList.resize="resize";EventsList.click="click";EventsList.dblclick="dblclick";EventsList.mover="mouseover";EventsList.mout="mouseout";EventsList.mdown="mousedown";EventsList.mup="mouseup";EventsList.mmv="mousemove";EventsList.kdown="keydown";EventsList.kup="keyup";EventsList.MouseClick="MouseClick";EventsList.MouseDoubleClick="MouseDoubleClick";EventsList.MouseOver="MouseOver";EventsList.MouseOut="MouseOut";EventsList.MouseDown="MouseDown";EventsList.MouseUp="MouseUp";EventsList.MouseMove="MouseMove";EventsList.KeyDown="KeyDown";EventsList.KeyUp="KeyUp";EventsList.MouseUp="MouseUp";EventsList.MouseDown="MouseDown";EventsList.polylineAdded="polylineAdded";EventsList.polylineRemoved="polylineRemoved";EventsList.endPanOB="endPanOB";EventsList.endMapDraw="endMapDraw";EventsList.zoomAdded="zoomAdded";EventsList.MapTypeControlAdded="MapTypeControlAdded";EventsList.miniAdded="miniAdded";EventsList.startPan="startPan";EventsList.endPan="endPan";EventsList.onPan="onPan";EventsList.startAutoPan="startAutoPan";EventsList.endAutoPan="endAutoPan";EventsList.changeZoom="changeZoom";EventsList.changeMapType="changeMapType";EventsList.openSmartWindow="openSmartWindow";EventsList.closeSmartWindow="closeSmartWindow";EventsList.closeSmartWindowClick="closeSmartWindowClick";EventsList.openExpanded="openExpanded";EventsList.closeExpanded="closeExpanded";EventsList.onStartGeoCode="onStartGeoCode";EventsList.onEndGeoCode="onEndGeoCode";EventsList.onStartGeoRSS="onStartGeoRSS";EventsList.onEndGeoRSS="onEndGeoRSS";EventsList.onEndLocalSearch="onEndLocalSearch";EventsList.onEndTrafficSearch="onEndTrafficSearch";var Overlay=function(_p,_n){this._defaults(_p,_n);};Overlay.prototype.setMapObject=function(_m){this._map=_m;};Overlay.prototype._defaults2=function(a,b){this.YGeoPoint=a;this.id="hello";this.dom=YUtility.createNode("div");};Overlay.prototype._defaults=function(a,b){if(!a){return ;}if(a.Lat){this.YGeoPoint=a;}else{if(a.x){this.YCoordPoint=a;}}this.id=(b&&b.id)?b.id:YUtility.getRandomID();if(b){this.dom=(b.dom)?b.dom:b;}else{this._container();}this._setBaseElStyle();this._setBaseEvents();this._setImage();this._setOffset();};Overlay.prototype._setImage=function(i){if(i){this._image=i;}else{this._image=new YImage();}};Overlay.prototype._destroy=function(u){if(!u){YEvent.ClearAll(this);}if(this.dom){YUtility.removeNode(this.dom);}this.dom=null;};Overlay.prototype._setBaseElStyle=function(_n){if(this.dom){YUtility.setStyle(this.dom,"position","absolute");}};Overlay.prototype._setBaseEvents=function(){this.Events={};this.Events.MouseClick=new _captureEvent(EventsList.MouseClick,this);this.Events.MouseOver=new _captureEvent(EventsList.MouseOver,this);this.Events.MouseMove=new _captureEvent(EventsList.MouseMove,this);this.Events.MouseOut=new _captureEvent(EventsList.MouseOut,this);this.Events.MouseDoubleClick=new _captureEvent(EventsList.MouseDoubleClick,this);this.Events.MouseUp=new _captureEvent(EventsList.MouseUp,this);this.Events.MouseDown=new _captureEvent(EventsList.MouseDown,this);YEvent.Capture(this,EventsList.MouseClick,this._MouseClickRun,null,EventsList.click);YEvent.Capture(this,EventsList.MouseMove,this._MouseMoveRun,null,EventsList.mmv);YEvent.Capture(this,EventsList.MouseOver,this._MouseOverRun,null,EventsList.mover);YEvent.Capture(this,EventsList.MouseOut,this._MouseOutRun,null,EventsList.mout);YEvent.Capture(this,EventsList.MouseDoubleClick,this._MouseDoubleClickRun,null,EventsList.dblclick);YEvent.Capture(this,EventsList.MouseUp,this._MouseUpRun,null,EventsList.mup);YEvent.Capture(this,EventsList.MouseDown,this._MouseDownRun,null,EventsList.mdown);};Overlay.prototype._setOffset=function(o){this.setOffset(new YCoordPoint(0,0));};Overlay.prototype._MouseClickRun=function(_e){this.Events.MouseClick.trigger(new _eO(this));};Overlay.prototype._MouseMoveRun=function(_e){this.Events.MouseMove.trigger(new _eO(this));};Overlay.prototype._MouseOverRun=function(_e){this.Events.MouseOver.trigger(new _eO(this));};Overlay.prototype._MouseOutRun=function(_e){this.Events.MouseOut.trigger(new _eO(this));};Overlay.prototype._MouseDoubleClickRun=function(_e){this.Events.MouseDoubleClick.trigger(new _eO(this));};Overlay.prototype._MouseUpRun=function(_e){this.Events.MouseUp.trigger(new _eO(this));};Overlay.prototype._MouseDownRun=function(_e){this.Events.MouseDown.trigger(new _eO(this));};Overlay.prototype.assignCoordPoint=function(){if(this.YCoordPoint){var _xC=this.YCoordPoint._xpos;var _yC=this.YCoordPoint._ypos;var _s={};_s[_xC]=this.YCoordPoint.x+"px";_s[_yC]=this.YCoordPoint.y+"px";YUtility.setStyle(this,_s);}};Overlay.prototype._updateX=function(n){var t=this._xy;this._xy=new YCoordPoint(t.x+n,t.y);if(this._map){this._xybr=new YCoordPoint(this._xy.x+parseFloat(this._map.subContainer.style.left),this._xy.y+parseFloat(this._map.subContainer.style.top));}};Overlay.prototype.setOffset=function(c){if(c&&c.valid){this.offset=c;this._image.size=new YSize(0,0);this._image.offset=new YCoordPoint(0,0);}};Overlay.prototype.setGeoXYPoint=function(){var _xybr=this._map._ll2xy(this.YGeoPoint);var offx=this.offset.x+this._image.offset.x;var offy=this.offset.y+this._image.offset.y;this._xybr=new YCoordPoint(_xybr.x+offx,(_xybr.y-this._image.size.height+offy));var _xy=this._map._ll2xy(this.YGeoPoint,1);this._xy=new YCoordPoint(_xy.x+offx,(_xy.y-this._image.size.height+offy));var absPos=this._xy.x+_xy._xscpos;var intPos=parseInt(absPos/this._map.MP.circum_px);var left_buffer=500;if(absPos>this._map.YSize.width){this._xy.x=this._xy.x-(intPos)*this._map.MP.circum_px;}else{if(absPos<0-left_buffer){this._xy.x=this._xy.x-(intPos-1)*this._map.MP.circum_px;}}if(!this._hidden){this.unhide();}};Overlay.prototype.calculatePosition=function(_z){this.MP=new MercatorProjection(_z);return this.MP.ll_to_xy(this.YGeoPoint);};Overlay.prototype.setYGeoPoint=function(_p){this.YGeoPoint=new YGeoPoint(_p.Lat,_p.Lon);this.setGeoXYPoint(this._z,this._posTbl);};Overlay.prototype.hide=function(_i){if(!_i){this._hidden=true;}this.dom.style.left=this.dom.style.top="-9500px";this.dom.style.zIndex=-9999;};Overlay.prototype.ishidden=function(){return this._hidden;};Overlay.prototype.unhide=function(){this._hidden=false;if(this._xy){this.dom.style.left=this._xy.x+"px";this.dom.style.top=this._xy.y+"px";this.dom.style.zIndex=2;}};Overlay.prototype.getCoordPoint=function(){var x=YUtility.getInt(this.dom.style.left);var y=YUtility.getInt(this.dom.style.top);return new YCoordPoint(x,y);};Overlay.prototype._container=function(_n){this.dom=YUtility.createNode("div");if(_n){YUtility.appendNode(this.dom,_n);}};Overlay.prototype._setpos=function(c){this.YCoordPoint=c;};var Control=function(){this.dom=null;};Control.prototype=new Overlay;var logoSearch=function(c,mapObj){this._map=mapObj;this._setpos(c);this._setContainer();this._defaults(this.YCoordPoint,this.dom);this.id="ylocalsearch";this._markers=[];};logoSearch.prototype=new Control;logoSearch.prototype._setContainer=function(){this._imgUrl={logo:YMapConfig.imgPrefixURL+"sl_ylogo.gif",close:YMapConfig.imgPrefixURL+"x.gif",mapic:YMapConfig.imgPrefixURL+"sl_ic.gif",copy:YMapConfig.imgPrefixURL+"sl_cp_06.gif",submit:YMapConfig.imgPrefixURL+"sl_bt_go.gif",bg:YMapConfig.imgPrefixURL+"sl_bk.png",bg50:YMapConfig.imgPrefixURL+"sl_bk_50.png",bg80:YMapConfig.imgPrefixURL+"sl_bk_80.png",marker:YMapConfig.imgPrefixURL+"sl_mrk2.gif"};this._attr={max:{width:{to:205},height:{to:165}},min:{width:{to:90},height:{to:40}},offset:{width:{to:90},height:{to:50}}};this._duration=0.7;this.dom=YUtility.createNode("div");var _mb="0px";var _mr="0px";if(!YUtility.browser.id){_mb="-4px";_mr="-1px";}var _sd={position:"absolute",marginBottom:_mb,marginRight:_mr,width:"90px",height:"40px"};YUtility.setStyle(this.dom,_sd);this.i2=YUtility.createNode("img");this.i2.src=this._imgUrl.bg50;YUtility.alphaLoad(this.i2);var i3=YUtility.createNode("img");i3.src=this._imgUrl.logo;var _ltp="14px";if(!YUtility.browser.id){_ltp="12px";}var _si3={position:"absolute",top:_ltp,left:"15px",cursor:"pointer"};YUtility.setStyle(i3,_si3);var i4=YUtility.createNode("img");i4.src=this._imgUrl.copy;var _crb="2px";if(!YUtility.browser.id){_crb="5px";}var _si4={position:"absolute",bottom:_crb,right:"1px"};YUtility.setStyle(i4,_si4);var dd=YUtility.createNode("div");var _str_dd='<img src="'+this._imgUrl.mapic+'"> Get driving directions, live traffic and more on the new Yahoo! Maps: <a href="'+YMapConfig.mapsSite+'">Go to Yahoo! Maps Now</a>.';dd.innerHTML=_str_dd;var _sdd={position:"absolute",fontSize:"11",fontFamily:"tahoma",top:"95px",left:"20px"};YUtility.setStyle(dd,_sdd);YUtility.appendNode(this.dom,this.i2);YUtility.appendNode(this.dom,i3);YUtility.appendNode(this.dom,i4);YUtility.appendNode(this.dom,dd);this._setform();};logoSearch.prototype.init=function(){};logoSearch.prototype._MouseDoubleClickRun=function(_e){YEvent.stopEvent(_e);};logoSearch.prototype._MouseOverRun=function(){if(this._bigon){return ;}this._animate(this.i2,this._attr.offset,0.1);this._animate(this.dom,this._attr.offset,0.1);this.i2.src=this._imgUrl.bg80;YUtility.alphaLoad(this.i2);};logoSearch.prototype._MouseOutRun=function(){if(this._bigon){return ;}this._animate(this.i2,this._attr.min,0.1);this._animate(this.dom,this._attr.min,0.1);this.i2.src=this._imgUrl.bg50;YUtility.alphaLoad(this.i2);};logoSearch.prototype._MouseClickRun=function(){if(this._bigon){return ;}YUtility.appendNode(this.dom,this._form);this._animate(this.i2,this._attr.max,this._duration,YAHOO.util.Easing.backOut);this._animate(this.dom,this._attr.max,this._duration,YAHOO.util.Easing.backOut);this.cx=YUtility.createNode("img");this.cx.src=this._imgUrl.close;var _scx={position:"absolute",cursor:"pointer",top:"12px",right:"4px"};YUtility.setStyle(this.cx,_scx);YEvent.Capture(this.cx,EventsList.MouseClick,this._closeit,this,"click");YUtility.appendNode(this.dom,this.cx);this._form.style.visibility="visible";this._bigon=true;};logoSearch.prototype._setform=function(){this._form=YUtility.createNode("form");var _sform={position:"absolute",width:"185px",verticalAlign:"bottom",top:"28px",left:"15px"};YUtility.setStyle(this._form,_sform);var _str={legend:"Find businesses and events here on Yahoo! Local",example:" e.g. restaurants, dentists",copy:'<img src="'+this._imgUrl.copy+'">',clear:"Clear"};var lp=YUtility.createNode("div");var _slp={width:"180px",height:"30px"};YUtility.setStyle(lp,_slp);var limg=YUtility.createNode("img");limg.src=this._imgUrl.marker;var _slimg={position:"absolute",top:"5px",left:"2px"};YUtility.setStyle(limg,_slimg);var lc=YUtility.createNode("div");var _slc={position:"absolute",top:"5px",left:"25px",fontSize:"11",fontFamily:"tahoma"};YUtility.setStyle(lc,_slc);lc.innerHTML=_str.legend;YUtility.appendNode(lp,limg);YUtility.appendNode(lp,lc);this._i=YUtility.createNode("input");this._i.type="text";this._i.value=_str.example;var _si={position:"absolute",top:"32px",left:"4px",width:"140px",color:"#999",fontSize:"11",fontFamily:"tahoma"};YUtility.setStyle(this._i,_si);var s=YUtility.createNode("input");s.type="image";s.src=this._imgUrl.submit;var _ss={position:"absolute",width:"28px",height:"21px",top:"30px",right:"10px"};YUtility.setStyle(s,_ss);this._nC=YUtility.createNode("span");this._nC.innerHTML=_str.clear;var _sn={position:"absolute",cursor:"pointer",fontSize:"9",fontFamily:"verdana",color:"#03f",top:"50px",left:"3px"};YUtility.setStyle(this._nC,_sn);this._n0=YUtility.createNode("span");this._n0.innerHTML="No results";var _sn0={visibility:"hidden",position:"absolute",fontSize:"9",fontFamily:"verdana",color:"red",top:"50px",left:"50px"};YUtility.setStyle(this._n0,_sn0);YUtility.appendNode(this._form,lp);YUtility.appendNode(this._form,s);YUtility.appendNode(this._form,this._i);YUtility.appendNode(this._form,this._nC);YUtility.appendNode(this._form,this._n0);var that=this;this._i.onclick=function(){if(that._i.value==_str.example){that._i.value="";}if(YUtility.browser.id){that._i.focus();}else{that._i.select();}};};logoSearch.prototype._closeit=function(){this._animate(this.i2,this._attr.min,this._duration,YAHOO.util.Easing.backOut);this._animate(this.dom,this._attr.min,this._duration,YAHOO.util.Easing.backOut);YUtility.removeNode(this.cx);this._form.style.visibility="hidden";this._i.blur();this._bigon=false;};logoSearch.prototype._animate=function(iob,attr,duration,aniType){var anim=new YAHOO.util.Anim(iob,attr,duration,aniType);anim.animate();};var Polyline=function(a,c,w,t){if(!a||!a.length){return ;}this._path=a;this._color=c||"navy";this._weight=parseInt(w)||6;this._alpha=t||"0.7";this._segs=new Array;this.cPath();this.polyline=true;this._defaults(this._path[0]);this.id=YUtility.getRandomID();};Polyline.prototype=new Overlay;Polyline.prototype._MouseClickRun=function(_e){if(this._map){var _tr=YAHOO.util.Event.getTarget(_e);var _xy=YAHOO.util.Event.getXY(_e);var _dp=YAHOO.util.Dom.getXY(this.dom);var _ep=new YCoordPoint(_xy[0]-_dp[0],_xy[1]-_dp[1]);var _ll=this._map._xy2ll(_ep);var dfc=_ll.distance(this._map.YGeoPoint,this._map.getUnitsPerPixel());if(dfc.pixels>this._map.YSize.width){return ;}var _ce=(new _eO(this._map,this._map.YGeoPoint,{previous:this._map.zoomLevelPrev,current:this._map.zoomLevel}));this._map.Events.MouseClick.trigger(_ce,_ll);}this.Events.MouseClick.trigger(new _eO(this));};Polyline.prototype.setGeoXYPoint=function(_z,_a,_t){if(_t==2){return ;}for(var s in this._segs){if(this._segs[s]._ygpto){var gp1=this._segs[s]._ygpfrom;var gp2=this._segs[s]._ygpto;var pa=this._map._ll2xy(gp1,1);var pb=this._map._ll2xy(gp2,1);if(!pa.x||!pa.y||!pb.x||!pb.y){return ;}this._setFromTo(this._segs[s],pa,pb);if(!this._segs[s]._added){this.dom.style.zIndex=1;YUtility.appendNode(this.dom,this._segs[s]);this._segs[s]._added=true;}}}};Polyline.prototype._setFromTo=function(o,a,b){if(!YUtility.browser.id){o.from=a.x+","+a.y;o.to=b.x+","+b.y;return ;}var minx=(a.x>b.x)?b.x:a.x;var miny=(a.y>b.y)?b.y:a.y;if(YUtility.browser.id&&this._svg){var mx=Math.abs(a.x-b.x)+this._weight*2;var my=Math.abs(a.y-b.y)+this._weight*2;mx=(mx>my)?mx:my;minx-=this._weight;miny-=this._weight;o.style.left=minx+"px";o.style.top=miny+"px";o.style.position="absolute";o.setAttribute("viewBox",minx+" "+miny+" "+mx+" "+mx);o.setAttribute("width",mx+"px");o.setAttribute("height",mx+"px");if(!o._yline){o._yline=document.createElementNS("http://www.w3.org/2000/svg","line");o._yline.setAttribute("stroke-linecap","round");o._yline.setAttribute("stroke-linejoin","round");o._yline.setAttribute("stroke-width",this._weight+"px");o._yline.setAttribute("stroke-opacity",this._alpha);o._yline.setAttribute("stroke",this._color);YUtility.appendNode(o,o._yline);}o._yline.setAttribute("x1",a.x);o._yline.setAttribute("y1",a.y);o._yline.setAttribute("x2",b.x);o._yline.setAttribute("y2",b.y);return ;}o.src=YMapConfig.polyLine+"x="+a.x+"|"+a.y+"&y="+b.x+"|"+b.y;if(YUtility.browser.id){YUtility.setStyle(o,"cursor","move");YUtility.setStyle(o,"visibility","hidden");o.onload=function(){YUtility.setStyle(o,"visibility","visible");};}o.style.position="absolute";o.style.left=minx;o.style.top=miny;};Polyline.prototype.cPath=function(){this._plength=this._path.length;for(var i=0;i<this._plength;i++){var s1=i;var s2=(i+1<this._plength)?i+1:i;if(s1==s2){continue;}if(this._path[i]&&this._path[i].valid){var v=this.cSeg(this._path[s2],this._path[s1]);if(v){this._segs.push(v);}}}};Polyline.prototype.cSeg=function(a,b){var _l=_s=[];if(!YUtility.browser.id){_l=document.createElement("v:line");_l.strokecolor=this._color;_l.strokeweight=this._weight+"px";_s=document.createElement("v:stroke");_s.opacity=this._alpha;_s.endcap="round";YUtility.appendNode(_l,_s);}if(YUtility.browser.id){_l=document.createElementNS("http://www.w3.org/2000/svg","svg");if(_l.x&&_l.y){YUtility.setStyle(_l,"cursor","move");this._svg=true;}else{_l=YUtility.createNode("img");}}_l._ygpfrom=a;_l._ygpto=b;return _l;};Polyline.prototype._destroy=function(){if(this.dom){for(var s in this._segs){this._segs[s]=null;}this.dom=null;}};var TypeControl=function(c,t){this._setpos(c);this._types=(t)?t:[YAHOO_MAP_REG,YAHOO_MAP_SAT,YAHOO_MAP_HYB];this._bobj=[];this.id=YUtility.getRandomID();this._defaults(this.YCoordPoint,this.dom);this._setobj();};TypeControl.prototype=new Control;TypeControl.prototype.setControl=function(t,c,s){if(typeof c=="object"){if(c.yitype){var _t;if(!YUtility.browser.id){_t=YUtility.createNode("div");_t._iefix=YUtility.createNode("img");_t.style.filter=YUtility.alphaImg2(c.src)+" alpha(opacity=80)";_t._iefix.src=c.src;}else{_t=YUtility.createNode("img");_t.src=c.src;_t.style.opacity=0.8;}_t.style.width=c.size.width+"px";_t.style.height=c.size.height+"px";c=_t;}YUtility.appendNode(this._bobj[t],c);}else{this._bobj[t].innerHTML=c;}this._bobj[t].YSize=s;this._bobj[t].YObj=c;};TypeControl.prototype._setbobj=function(t){var obj=YUtility.createNode("div");var f;if(t==YAHOO_MAP_REG){f=this._runMapRegTypeClick;}if(t==YAHOO_MAP_SAT){f=this._runMapSatTypeClick;}if(t==YAHOO_MAP_HYB){f=this._runMapHybTypeClick;}YEvent.Capture(obj,EventsList.MouseClick,f,this,EventsList.click);YEvent.Capture(obj,EventsList.MouseDoubleClick,this._runSilentDoubleClick,this,EventsList.dblclick);this._bobj[t]=obj;};TypeControl.prototype._setobj=function(){var _curs=(!YUtility.browser.id)?"hand":"pointer";var _ss={cursor:_curs,borderColor:"white",borderStyle:"solid",borderWidth:"0px",padding:"1px"};for(var i=0;i<this._types.length;i++){var t=this._types[i];this._setbobj(t);YUtility.appendNode(this.dom,this._bobj[t]);YUtility.setStyle(this._bobj[t],_ss);}};TypeControl.prototype.setVertical=function(){for(var i=0;i<this._types.length;i++){var t=this._types[i];YUtility.setStyle(this._bobj[t],"position","relative");YUtility.setStyle(this._bobj[t],"left","0px");}};TypeControl.prototype.setHorizontal=function(){var _x=0;var _p=2;for(var i=0;i<this._types.length;i++){var t=this._types[i];var n=(this._bobj[t].YSize)?this._bobj[t].YSize.width:0;YUtility.setStyle(this._bobj[t],"position","absolute");YUtility.setStyle(this._bobj[t],"top","0px");YUtility.setStyle(this._bobj[t],"left",_x+"px");_x+=n+_p;}};TypeControl.prototype._MouseClickRun=function(_e){YEvent.stopEvent(_e);var _tr=YAHOO.util.Event.getTarget(_e);if(_tr._pw){this._map.smoothPan(new YCoordPoint(200,0));}if(_tr._pn){this._map.smoothPan(new YCoordPoint(0,200));}if(_tr._pe){this._map.smoothPan(new YCoordPoint(-200,0));}if(_tr._ps){this._map.smoothPan(new YCoordPoint(0,-200));}var _tr=YAHOO.util.Event.getTarget(_e);};TypeControl.prototype._MouseDoubleClickRun=function(_e){YEvent.stopEvent(_e);};TypeControl.prototype._runMapRegTypeClick=function(_e){YEvent.stopEvent(_e);this._map.setMapType(YAHOO_MAP_REG);var _ce=new _eO(this);this._map.Events.changeMapType.trigger(_ce);};TypeControl.prototype._runMapHybTypeClick=function(_e){YEvent.stopEvent(_e);this._map.setMapType(YAHOO_MAP_HYB);var _ce=new _eO(this);this._map.Events.changeMapType.trigger(_ce);};TypeControl.prototype._runMapSatTypeClick=function(_e){YEvent.stopEvent(_e);this._map.setMapType(YAHOO_MAP_SAT);var _ce=new _eO(this);this._map.Events.changeMapType.trigger(_ce);};TypeControl.prototype._runSilentDoubleClick=function(_e){YEvent.stopEvent(_e);};var ZoomControl=function(z,c,s){this._zoom=this._i1prevz=z;this._short=s?s:false;this._setpos(c);if(this._short){this._setobjShort(z);}else{this._setobjLong(z);}this._defaults(this.YCoordPoint,this.dom);this.setMinMax();this.id=YUtility.getRandomID();};ZoomControl.prototype=new Control;ZoomControl.prototype._setobjLong=function(z){var _si1={position:"absolute",zIndex:1,top:"9px",width:"19px",height:"19px"};var _si2={position:"absolute",width:"19px",height:"74px"};this._i1=YUtility.createNode("img");this._i1._zkn=true;var _i2=YUtility.createNode("img");this._i1.src=YMapConfig.imgPrefixURL+"zkn16.png";_i2.src=YMapConfig.imgPrefixURL+"zbg16.png";YUtility.setStyle(this._i1,_si1);YUtility.setStyle(_i2,_si2);YUtility.alphaLoad(this._i1);YUtility.alphaLoad(_i2);this.dom=YUtility.createNode("div");var _s={width:"19px",height:"74px"};_s[this.YCoordPoint._xpos]=this.YCoordPoint.x;_s[this.YCoordPoint._ypos]=this.YCoordPoint.y;YUtility.setStyle(this.dom,_s);this._limYmin=9;this._limYmax=45;this._limYdlt=this._limYmax-this._limYmin;YUtility.appendNode(this.dom,this._i1);YUtility.appendNode(this.dom,_i2);};ZoomControl.prototype._setobjShort=function(z){var _si1={position:"absolute",top:"0px",left:"1px",width:"17px",height:"15px"};var _si2={position:"absolute",top:"17px",left:"0px",width:"19px",height:"16px"};var _i1=YUtility.createNode("img");_i1._zout=true;var _i2=YUtility.createNode("img");_i2._zin=true;_i1.src=YMapConfig.imgPrefixURL+"zco16.png";_i2.src=YMapConfig.imgPrefixURL+"zci16.png";YUtility.setStyle(_i1,_si1);YUtility.setStyle(_i2,_si2);YUtility.alphaLoad(_i1);YUtility.alphaLoad(_i2);this.dom=YUtility.createNode("div");var _s={width:"19px",height:"32px"};_s[this.YCoordPoint._xpos]=this.YCoordPoint.x;_s[this.YCoordPoint._ypos]=this.YCoordPoint.y;YUtility.setStyle(this.dom,_s);YUtility.appendNode(this.dom,_i1);YUtility.appendNode(this.dom,_i2);};ZoomControl.prototype.zoomIn=function(){this._knobZtoY(this._zoom-1);};ZoomControl.prototype.zoomOut=function(){this._knobZtoY(this._zoom+1);};ZoomControl.prototype._MouseDownRun=function(_e){YEvent.stopEvent(_e);YEvent.Capture(document,EventsList.MouseUp,this._knobMouseUp,this,EventsList.mup);YEvent.Capture(document,EventsList.MouseMove,this._knobMouseMove,this,EventsList.mmv);this._initY=YAHOO.util.Event.getPageY(_e);this._posY=this._getY()-this._limYmin;};ZoomControl.prototype._MouseMoveRun=function(_e){var y=YAHOO.util.Event.getPageY(_e);var ps=YAHOO.util.Dom.getXY(this.dom);var d=y-ps[1];var _tr=YAHOO.util.Event.getTarget(_e);var _curs=(!YUtility.browser.id)?"hand":"pointer";_tr.style.cursor="default";if(_tr._zkn){_tr.style.cursor=_curs;}if(d>=0&&d<=15||_tr._zout){_tr.style.cursor=_curs;}if(d>=59&&d<=74||_tr._zin){_tr.style.cursor=_curs;}};ZoomControl.prototype._knobMouseUp=function(_e){YEvent.Remove(document,EventsList.mup,this._knobMouseUp);YEvent.Remove(document,EventsList.mmv,this._knobMouseMove);this._knobYtoZ(this._getY());};ZoomControl.prototype._knobYtoZ=function(y){if(this._i1prevy==y){return ;}var r=this._getR();var z;var delta_zoom=Math.floor(Math.abs(y-this._i1prevy)/r);if(this._i1prevy>y){z=Math.ceil(this._i1prevz+delta_zoom);if(z==this._i1prevz){z+=1;}}if(this._i1prevy<y){z=Math.ceil(this._i1prevz-delta_zoom);if(z==this._i1prevz){z-=1;}if(!z){z=this._minz;}}z=this._validZoom(z);this._knobZtoY(z);};ZoomControl.prototype._validZoom=function(z){if(z<=this._minz){return this._minz;}if(z>=this._maxz){return this._maxz;}return z;};ZoomControl.prototype._changeZoomLevel=function(z){if(this._i1prevz!=z){if(this._map){this._map.setZoomLevel(z);this._zoom=z;}}};ZoomControl.prototype._knobZtoY=function(z){z=this._validZoom(z);if(!this._difz){return ;}this.updateZoomLevel(z);this._changeZoomLevel(z);this._i1prevy=this._getY();this._i1prevz=z;};ZoomControl.prototype.updateZoomLevel=function(z){var r=this._getR();var y=this._limYdlt-r*(z-this._minz);if(z>=this._maxz){y=0;}if(z<=this._minz){y=this._limYdlt;}this._adjY(y);this._zoom=z;};ZoomControl.prototype._knobMouseMove=function(_e){var relPos=(YAHOO.util.Event.getPageY(_e)-this._initY/1+this._posY);if(relPos<0){relPos=0;}if(relPos>this._limYdlt){relPos=this._limYdlt;}this._adjY(relPos);};ZoomControl.prototype.setMinMax=function(m,x){this._minz=m||1;this._maxz=x||17;this._difz=Math.abs(this._maxz-this._minz);this._knobZtoY(this._zoom);};ZoomControl.prototype._getR=function(){return this._limYdlt/(this._difz+1);};ZoomControl.prototype._adjY=function(y){if(y>this._limYdlt){y=this._limYdlt;}if(y<0){y=0;}if(this._i1){this._i1.style.top=(y+this._limYmin)+"px";}};ZoomControl.prototype._getY=function(){if(this._i1){return parseInt(this._i1.style.top);}return 0;};ZoomControl.prototype._adjustOpacity=function(i){var _v=i?15:75;this.dom.style.filter="alpha(opacity="+_v+")";this.dom.style.opacity=_v/100;};ZoomControl.prototype._MouseClickRun=function(_e){YEvent.stopEvent(_e);var y=YAHOO.util.Event.getPageY(_e);var ps=YAHOO.util.Dom.getXY(this.dom);var d=y-ps[1];var _tr=YAHOO.util.Event.getTarget(_e);if(d>=0&&d<=15||_tr._zout){this.zoomOut();}if(d>=59&&d<=74||_tr._zin){this.zoomIn();}var _tr=YAHOO.util.Event.getTarget(_e);};ZoomControl.prototype._MouseOverRun=function(_e){YEvent.stopEvent(_e);};ZoomControl.prototype._MouseOutRun=function(_e){YEvent.stopEvent(_e);};ZoomControl.prototype._MouseDoubleClickRun=function(_e){YEvent.stopEvent(_e);};var PanControl=function(c){this._setpos(c);this._setobj();this._defaults(this.YCoordPoint,this.dom);this.id=YUtility.getRandomID();};PanControl.prototype=new Control;PanControl.prototype._setobj=function(){var _curs=(!YUtility.browser.id)?"hand":"pointer";var _s1={position:"absolute",cursor:_curs,top:"16px",left:"0px",width:"19px",height:"19px"};var _s2={position:"absolute",cursor:_curs,top:"0px",left:"13px",width:"19px",height:"19px"};var _s3={position:"absolute",cursor:_curs,top:"16px",right:"0px",width:"19px",height:"19px"};var _s4={position:"absolute",cursor:_curs,bottom:"0px",left:"13px",width:"19px",height:"19px"};var _i1=YUtility.createNode("img");var _i2=YUtility.createNode("img");var _i3=YUtility.createNode("img");var _i4=YUtility.createNode("img");_i1._pw=true;_i2._pn=true;_i3._pe=true;_i4._ps=true;_i1.src=YMapConfig.imgPrefixURL+"pw16.png";_i2.src=YMapConfig.imgPrefixURL+"pn16.png";_i3.src=YMapConfig.imgPrefixURL+"pe16.png";_i4.src=YMapConfig.imgPrefixURL+"ps16.png";YUtility.setStyle(_i1,_s1);YUtility.setStyle(_i2,_s2);YUtility.setStyle(_i3,_s3);YUtility.setStyle(_i4,_s4);YUtility.alphaLoad(_i1);YUtility.alphaLoad(_i2);YUtility.alphaLoad(_i3);YUtility.alphaLoad(_i4);this.dom=YUtility.createNode("div");var _s={width:"44px",height:"50px"};_s[this.YCoordPoint._xpos]=this.YCoordPoint.x;_s[this.YCoordPoint._ypos]=this.YCoordPoint.y;YUtility.setStyle(this.dom,_s);YUtility.appendNode(this.dom,_i1);YUtility.appendNode(this.dom,_i2);YUtility.appendNode(this.dom,_i3);YUtility.appendNode(this.dom,_i4);};PanControl.prototype._MouseClickRun=function(_e){YEvent.stopEvent(_e);var _tr=YAHOO.util.Event.getTarget(_e);if(_tr._pw){this._map.smoothPan(new YCoordPoint(200,0));}if(_tr._pn){this._map.smoothPan(new YCoordPoint(0,200));}if(_tr._pe){this._map.smoothPan(new YCoordPoint(-200,0));}if(_tr._ps){this._map.smoothPan(new YCoordPoint(0,-200));}var _tr=YAHOO.util.Event.getTarget(_e);};PanControl.prototype._MouseDoubleClickRun=function(_e){YEvent.stopEvent(_e);};var MiniControl=function(z,c){this._setobj(z);this._setpos(c);this._defaults(this.YCoordPoint,this.dom);this.id=YUtility.getRandomID();};MiniControl.prototype=new Control;MiniControl.prototype._setobj=function(){};var Scale=function(z,u,r,c){this._zr=r;this._setunits(z,u);this._setobj(z);this._setpos(c);this._defaults(this.YCoordPoint,this.dom);this.id="yscale";};Scale.prototype=new Overlay();Scale.prototype._setunits=function(z,u){var _zsl_zsr=8;this._un=u||0;this._km=(this._zr[z-1])?this._zr[z-1][2][0]:0;this._mi=(this._zr[z-1])?this._zr[z-1][2][1]:0;this.pkm=YUtility.getInt(1/this._un.kilometers*this._km-_zsl_zsr)+"px";this.pmi=YUtility.getInt(1/this._un.miles*this._mi-_zsl_zsr)+"px";this.ukm=(this._km<0.5)?Math.ceil(this._km*1000)+YMapConfig.unitMetersText:this._km+YMapConfig.unitKmText;this.umi=(this._mi<0.5)?Math.ceil(this._mi*5280)+YMapConfig.unitFtText:this._mi+YMapConfig.unitMilesText;};Scale.prototype._setpos=function(c){var p=new YCoordPoint(1,12);p.translate("left","bottom");this.YCoordPoint=c?c:p;};Scale.prototype._setobj=function(z){var _cs={width:"4px",height:"8px"};var _zsl1=YUtility.createNode("img");_zsl1.src=YMapConfig.imgPrefixURL+"zsl.gif";YUtility.setStyle(_zsl1,_cs);var _zsl2=YUtility.createNode("img");_zsl2.src=YMapConfig.imgPrefixURL+"zsl.gif";YUtility.setStyle(_zsl2,_cs);var _zsr1=YUtility.createNode("img");_zsr1.src=YMapConfig.imgPrefixURL+"zsr.gif";YUtility.setStyle(_zsr1,_cs);var _zsr2=YUtility.createNode("img");_zsr2.src=YMapConfig.imgPrefixURL+"zsr.gif";YUtility.setStyle(_zsr2,_cs);this.dom=YUtility.createNode("div");this.dom.align="left";var _s={bottom:"12px",left:"1px",zIndex:3,font:"normal 9px verdana"};YUtility.setStyle(this.dom,_s);this._skmm=YUtility.createNode("img");this._skmm.src=YMapConfig.imgPrefixURL+"zs.gif?v=1";this._skmm.style.width=this.pkm;this._skmm.style.height="8px";this._skmm._kml=true;this._km=YUtility.createNode("span");this._km.innerHTML=this.ukm;this._km.style.position="relative";this._km.style.top="-1px";this._km._kmt=true;this._smim=YUtility.createNode("img");this._smim.src=YMapConfig.imgPrefixURL+"zs.gif?v=1";this._smim.style.width=this.pmi;this._smim.style.height="8px";this._smim._mil=true;this._mi=YUtility.createNode("span");this._mi.innerHTML=this.umi;this._mi.style.position="relative";this._mi.style.top="-1px";this._mi._mit=true;var _br=YUtility.cloneNode("br");YUtility.appendNode(this.dom,_zsl1);YUtility.appendNode(this.dom,this._skmm);YUtility.appendNode(this.dom,_zsr1);YUtility.appendNode(this.dom,this._km);YUtility.appendNode(this.dom,_br);YUtility.appendNode(this.dom,_zsl2);YUtility.appendNode(this.dom,this._smim);YUtility.appendNode(this.dom,_zsr2);YUtility.appendNode(this.dom,this._mi);};Scale.prototype.update=function(z,u,t){this._setunits(z,u);for(var i=0;i<this.dom.childNodes.length;i++){if(this.dom.childNodes[i]._kml){this.dom.childNodes[i].style.width=this.pkm;}if(this.dom.childNodes[i]._kmt){this.dom.childNodes[i].innerHTML=this.ukm;}if(this.dom.childNodes[i]._mil){this.dom.childNodes[i].style.width=this.pmi;}if(this.dom.childNodes[i]._mit){this.dom.childNodes[i].innerHTML=this.umi;}if(t==YAHOO_MAP_SAT||t==YAHOO_MAP_HYB){this.dom.childNodes[i].style.color="#fff";}else{this.dom.childNodes[i].style.color="#000";}}};var CustomOverlay=function(a,b){this._defaults(a,b);};CustomOverlay.prototype=new Overlay();CustomOverlay.prototype.constructor=CustomOverlay;CustomOverlay.prototype.superclass=Overlay.prototype;var CM=function(a){if(!a){return ;}var im,id;for(var i=1;i<arguments.length;i++){if(typeof arguments[i]=="object"){im=arguments[i];}if(typeof arguments[i]=="string"){id=arguments[i];}}this.id=id||"ymarker"+YUtility.getRandomID();this._hidden=false;this._disableAutoContain=false;this._autoExpand=false;var my=YUtility.createNode("img");my.src=YMapConfig.marker1;my.src=im.src;my.style.zIndex=5;my.id=this.id;this._setCustomEvents();this._defaults(a,my);};CM.prototype=new Overlay;CM.prototype.constructor=CustomOverlay;CM.prototype.superclass=Overlay.prototype;CM.prototype._setCustomEvents=function(){this.Events.openSmartWindow=new _captureEvent(EventsList.openSmartWindow,this);this.Events.closeSmartWindow=new _captureEvent(EventsList.closeSmartWindow,this);this.Events.openExpanded=new _captureEvent(EventsList.openExpanded,this);this.Events.closeExpanded=new _captureEvent(EventsList.closeExpanded,this);YEvent.Capture(this,EventsList.openSmartWindow,this._openSmartWindowRun);YEvent.Capture(this,EventsList.closeSmartWindow,this._closeSmartWindowRun);YEvent.Capture(this,EventsList.openExpanded,this._openExpandedRun);YEvent.Capture(this,EventsList.closeExpanded,this._closeExpandedRun);};var Marker=function(gp){var im,id;if(!gp){return ;}for(var i=1;i<arguments.length;i++){if(typeof arguments[i]=="object"){im=arguments[i];}if(typeof arguments[i]=="string"){id=arguments[i];}}this.id=id||"ymarker"+YUtility.getRandomID();this.YGeoPoint=new YGeoPoint(gp.Lat,gp.Lon);this._hidden=false;this._disableAutoContain=false;this._autoExpand=false;if(im){this._image=im;}else{this._image=new YImage();}this._createMarkerDom();this._defineEvents();this._registerEvents();if(typeof (gp)=="string"){this.Address=gp;}};Marker.prototype._destroy=function(u){if(this.aedom){YUtility.removeNode(this.aedom);}if(this.swdom){YUtility.removeNode(this.swdom.dom);this.swdom.dom=null;}if(this.imgdom){YUtility.removeNode(this.imgdom);}this.aedom=null;this.swdom=null;this.imgdom=null;if(this.dom){YUtility.removeNode(this.dom);}this.dom=null;};Marker.prototype.setMapObject=function(_m){this._map=_m;if(this.Address){this._map._startGeoCode(this.Address,12,this.id);}};Marker.prototype.setYGeoPoint=function(_p){this.YGeoPoint=new YGeoPoint(_p.Lat,_p.Lon);this.setGeoXYPoint();};Marker.prototype.setAnnotation=function(o){this._annotate=o;};Marker.prototype.getAnnotation=function(){return this._annotate;};Marker.prototype._updateX=function(n){var t=this._xy;this._xy=new YCoordPoint(t.x+n,t.y);if(this._map){this._xybr=new YCoordPoint(this._xy.x+parseFloat(this._map.subContainer.style.left),this._xy.y+parseFloat(this._map.subContainer.style.top));}};Marker.prototype.setGeoXYPoint=function(){var _xybr=this._map._ll2xy(this.YGeoPoint);this._xybr=new YCoordPoint(_xybr.x+this._image.offset.x,(_xybr.y-this._image.size.height+this._image.offset.y));var _xy=this._map._ll2xy(this.YGeoPoint,1);this._xy=new YCoordPoint(_xy.x+this._image.offset.x,(_xy.y-this._image.size.height+this._image.offset.y));if(this._map&&this._map.MP){var absPos=this._xy.x+_xy._xscpos;var intPos=parseInt(absPos/this._map.MP.circum_px);if(absPos>this._map.YSize.width){this._xy.x=this._xy.x-(intPos)*this._map.MP.circum_px;}else{if(absPos<0){this._xy.x=this._xy.x-(intPos-1)*this._map.MP.circum_px;}}}if(!this._hidden){this.unhide();}};Marker.prototype.hide=function(_i){if(!_i){this._hidden=true;}this.dom.style.left=this.dom.style.top="-9500px";this.dom.style.zIndex=-9999;};Marker.prototype.ishidden=function(){return this._hidden;};Marker.prototype.unhide=function(){this._hidden=false;if(this._xy){this.dom.style.left=this._xy.x+"px";this.dom.style.top=this._xy.y+"px";if(this.swdom){this.dom.style.zIndex=888;}else{this.dom.style.zIndex=2;}}};Marker.prototype._defineEvents=function(){this.Events={};this.Events.openSmartWindow=new _captureEvent(EventsList.openSmartWindow,this);this.Events.closeSmartWindow=new _captureEvent(EventsList.closeSmartWindow,this);this.Events.closeSmartWindowClick=new _captureEvent(EventsList.closeSmartWindowClick,this);this.Events.openExpanded=new _captureEvent(EventsList.openExpanded,this);this.Events.closeExpanded=new _captureEvent(EventsList.closeExpanded,this);this.Events.MouseClick=new _captureEvent(EventsList.MouseClick,this);this.Events.MouseOver=new _captureEvent(EventsList.MouseOver,this);this.Events.MouseOut=new _captureEvent(EventsList.MouseOut,this);this.Events.MouseDoubleClick=new _captureEvent(EventsList.MouseDoubleClick,this);this.Events.MouseUp=new _captureEvent(EventsList.MouseUp,this);};Marker.prototype._registerEvents=function(){YEvent.Capture(this,EventsList.openSmartWindow,this._openSmartWindowRun);YEvent.Capture(this,EventsList.openExpanded,this._openExpandedRun);YEvent.Capture(this,EventsList.closeExpanded,this._closeExpandedRun);YEvent.Capture(this,EventsList.MouseClick,this._MouseClickRun,null,EventsList.click);YEvent.Capture(this,EventsList.MouseOver,this._MouseOverRun,null,EventsList.mover);YEvent.Capture(this,EventsList.MouseOut,this._MouseOutRun,null,EventsList.mout);YEvent.Capture(this,EventsList.MouseDoubleClick,this._MouseDoubleClickRun,null,EventsList.dblclick);YEvent.Capture(this,EventsList.MouseUp,this._MouseUpRun,null,EventsList.mup);};Marker.prototype._MouseClickRun=function(_e){if(YUtility.browser.id!=2){YEvent.stopEvent(_e);}var _ce=new _eO(this);this.Events.MouseClick.trigger(_ce);};Marker.prototype._MouseOverRun=function(_e){YEvent.stopEvent(_e);if(this._autoExpand){if(_expCache._exmid){if(this.id!=_expCache._exmid){_expCache._destroy();}}if(!this.swdom){_expCache.dom.style.zIndex=4;_expCache.setContent(this._expContent);_expCache.setColor(this.swColor);_expCache._exmid=this.id;YUtility.appendNode(this.dom,_expCache.dom);var _ce=(new _eO(this));this.Events.openExpanded.trigger(_ce);}}if(this.swdom){this.dom.style.zIndex=888;}else{this.dom.style.zIndex=3;}var _ce=new _eO(this);this.Events.MouseOver.trigger(_ce);};Marker.prototype._MouseOutRun=function(_e){YEvent.stopEvent(_e);var _ce=new _eO(this);this.Events.MouseOut.trigger(_ce);if(this.swdom){this.dom.style.zIndex=888;}else{if(!this._autoExpand&&!this.swdom){this.dom.style.zIndex=2;}}};Marker.prototype._MouseDoubleClickRun=function(_e){YEvent.stopEvent(_e);var _ce=new _eO(this);this.Events.MouseDoubleClick.trigger(_ce);};Marker.prototype._MouseUpRun=function(_e){var _ce=new _eO(this);this.Events.MouseUp.trigger(_ce);};Marker.prototype._openExpandedRun=function(e){if(!this.swdom){this.dom.style.zIndex=3;_expCache.dom.style.zIndex=4;}};Marker.prototype._closeExpandedRun=function(e){if(this.swdom){this.dom.style.zIndex=888;}else{this.dom.style.zIndex=2;}};Marker.prototype._openSmartWindowRun=function(e){for(var m in this._map._mTb){if(m!=e.thisObj.id){if(this._map._mTb[m].swdom){this._map._mTb[m].closeSmartWindow();}}}};Marker.prototype._closeSmartWindowRun=function(e){if(_nodeCache.divsw){delete _nodeCache.divsw;}};Marker.prototype.disableAutoContain=function(){this._disableAutoContain=true;};Marker.prototype.enableAutoContain=function(){this._disableAutoContain=false;};Marker.prototype.changeImage=function(_o){if(YUtility.browser.id==0){this.imgdom.style.filter=YUtility.alphaImg(_o.src);}else{this.imgdom.src=_o.src;}if(_o.size.width){this.imgdom.style.width=_o.size.width;}if(_o.size.height){this.imgdom.style.height=_o.size.height;}};Marker.prototype._createMarkerDom=function(){this.dom=YUtility.createNode("div");this.dom.id=this.id;this.dom.align="left";var _s={position:"absolute",zIndex:2,width:this._image.size.width+"px",height:this._image.size.height+"px"};YUtility.setStyle(this.dom,_s);this.imgdom=YUtility.createNode("img");this.imgdom.id="ymi"+this.id;YUtility.setStyle(this.imgdom,_s);if(!YUtility.browser.id){YUtility.setStyle(this.imgdom,"filter",YUtility.alphaImg(this._image.src,"image",this.imgdom));}else{this.imgdom.src=this._image.src;}YUtility.appendNode(this.dom,this.imgdom);};Marker.prototype.getElement=function(){return this.dom;};Marker.prototype.getCoordPoint=function(){var x=YUtility.getInt(this.dom.style.left);var y=YUtility.getInt(this.dom.style.top);return new YCoordPoint(x,y);};Marker.prototype.setSmartWindowColor=function(_c){var _ac={orange:"org",f19824:"org",blue:"blu",lightblue:"lbl","71a4c1":"lbl",violet:"blv",brown:"brn",green:"grn",black:"blk",grey:"gry",lightgreen:"lgn",a7cc25:"lgn",maroon:"mar",ocre:"ocr",purple:"ple"};this.swColor=_ac["org"];if(_ac[_c]){this.swColor=_ac[_c];}};Marker.prototype.reLabel=function(nl){if(this._domLabel){this._domLabel.innerHTML=nl;}};Marker.prototype.closeSmartWindow=function(_e){if(this.swdom){this.swdom._destroy();this.swdom.dom=null;this._marker=null;this.swdom=null;var _ce=new _eO(this);this.Events.closeSmartWindow.trigger(_ce);}};var _expCache=null;Marker.prototype.openAutoExpand=function(_c){if(this._autoExpand){if(!this.swdom){this.dom.style.zIndex=3;_expCache.dom.style.zIndex=4;_expCache.setContent(this._expContent);_expCache.setColor(this.swColor);_expCache._exmid=this.id;YUtility.appendNode(this.dom,_expCache.dom);var _ce=new _eO(this);this.Events.openExpanded.trigger(_ce);}}};Marker.prototype.closeAutoExpand=function(_c){if(this._autoExpand){_expCache._destroy();}};Marker.prototype.addAutoExpand=function(_c){this._autoExpand=true;this._expContent=_c;if(!_expCache){_expCache=new SmartWindow(this,_c,this._image,this.swColor,"swae"+this.id,true);_expCache.dom.style.width="160px";if(!YUtility.browser.id){_expCache.dom.style.cursor="hand";}if(YUtility.browser.id){_expCache.dom.style.cursor="pointer";}}};Marker.prototype.openSmartWindow=function(_c){if(_expCache){if(_expCache._exmid){_expCache._destroy();}}if(this.swdom){return ;}this.swdom=new SmartWindow(this,_c,this._image,this.swColor,this.id);YUtility.appendNode(this.dom,this.swdom.dom);this.dom.style.zIndex=888;this.swdom.dom.style.zIndex=888;if(!this._map){return ;}this.containSmartWindow();YEvent.Capture(this.swdom.dom._swclid,EventsList.MouseClick,this._runXcloser,this,"click");var _ce=new _eO(this);this.Events.openSmartWindow.trigger(_ce);};Marker.prototype.updateSmartWindow=function(_c){if(this.swdom&&this.swdom.setContent){this.swdom.setContent(_c);YEvent.Capture(this.swdom.dom._swclid,EventsList.MouseClick,this._runXcloser,this,"click");}};Marker.prototype._runXcloser=function(_e){YEvent.stopEvent(_e);this.closeSmartWindow();var _ce=new _eO(this);this.Events.closeSmartWindowClick.trigger(_ce);};var SmartWindow=function(_mrk,_c,_io,_clr,id,_ae){this._marker=_mrk;this._aeon=(_ae)?true:false;this._swid="ysmw"+((id)?id:"");if(this._aeon){this._swid="ysmwexp";}this._clids="clw"+this._swid;this._createNode();this.setColor(_clr);this.setContent(_c);this.setPosition(_io);this.id=this._swid;this._defineEvents();this._registerEvents();};SmartWindow.prototype._defineEvents=function(){this.Events={};this.Events.MouseClick=new _captureEvent(EventsList.MouseClick,this);this.Events.MouseOver=new _captureEvent(EventsList.MouseOver,this);this.Events.MouseOut=new _captureEvent(EventsList.MouseOut,this);this.Events.MouseDoubleClick=new _captureEvent(EventsList.MouseDoubleClick,this);this.Events.MouseUp=new _captureEvent(EventsList.MouseUp,this);this.Events.MouseDown=new _captureEvent(EventsList.MouseDown,this);};SmartWindow.prototype._registerEvents=function(){YEvent.Capture(this,EventsList.MouseClick,this._MouseClickRun,null,EventsList.click);YEvent.Capture(this,EventsList.MouseOver,this._MouseOverRun,null,EventsList.mover);YEvent.Capture(this,EventsList.MouseOut,this._MouseOutRun,null,EventsList.mout);YEvent.Capture(this,EventsList.MouseDoubleClick,this._MouseDoubleClickRun,null,EventsList.dblclick);YEvent.Capture(this,EventsList.MouseUp,this._MouseUpRun,null,EventsList.mup);YEvent.Capture(this,EventsList.MouseDown,this._MouseDownRun,null,EventsList.mdown);};SmartWindow.prototype._MouseClickRun=function(_e){if(YUtility.browser.id!=2){YEvent.stopPropag(_e);}if(this._aeon){var marker=this._marker._map._mTb[this._exmid];if(marker){var _ce=new _eO(marker);marker.Events.MouseClick.trigger(_ce);}}};SmartWindow.prototype._MouseOverRun=function(_e){YEvent.stopEvent(_e);};SmartWindow.prototype._MouseOutRun=function(_e){YEvent.stopEvent(_e);if(_expCache){_expCache._destroy();}};SmartWindow.prototype._MouseDoubleClickRun=function(_e){YEvent.stopEvent(_e);};SmartWindow.prototype._MouseUpRun=function(_e){};SmartWindow.prototype._MouseDownRun=function(_e){YEvent.stopEvent(_e);};SmartWindow.prototype._createNode=function(){this.dom=YUtility.createNode("div");this.dom.id=this._swid;this.dom._swclid=this._clids;};SmartWindow.prototype._destroy=function(_w){if(this.dom.parentNode&&this.dom.parentNode.style){this.dom.parentNode.style.zIndex=2;}if(this._exmid){if(this._marker._map){var marker=this._marker._map._mTb[this._exmid];var _ce=new _eO(marker);if(marker){marker.Events.closeExpanded.trigger(_ce);}this._exmid=null;}}else{}if(!this._aeon){YEvent.ClearAll(this);}YUtility.removeNode(this.dom);};SmartWindow.prototype._hide=function(){YUtility.setStyle(this.dom,"zIndex",-10);};SmartWindow.prototype._show=function(){YUtility.setStyle(this.dom,"zIndex",99);};SmartWindow.prototype.setPosition=function(o){if(!o){return ;}var _x=o.offsetSmartWindow.x+"px";var _y=o.offsetSmartWindow.y+"px";var _so={"position":"absolute","left":_x,"bottom":_y};YUtility.setStyle(this.dom,_so);};SmartWindow.prototype._combine=function(){this.dom.innerHTML=this._sc+this._data+this._ec;};SmartWindow.prototype.setContent=function(_c){if(!_c){return ;}this._data=_c;if(_c.nodeValue){this._data=_c.nodeValue;}this._combine();};SmartWindow.prototype.setColor=function(_clr){var w=new _sw(_clr,this._clids,this._aeon);this._sc=w._sc;this._ec=w._ec;this._combine();};var _sw=function(_clr,_clids,ae){var _s,_sw,_ne,_se,_e,_nw,_n,_w;var _swi=YMapConfig.imgPrefixURL;var _col=(_clr)?_clr:"org";var _cls=_swi+"x.gif";if(!YUtility.browser.id){_s="filter:"+YUtility.alphaImg(_swi+_col+"_s.png");_sw="filter:"+YUtility.alphaImg(_swi+_col+"_sw.png");_ne="filter:"+YUtility.alphaImg(_swi+_col+"_ne.png");_se="filter:"+YUtility.alphaImg(_swi+_col+"_se.png");_e="filter:"+YUtility.alphaImg(_swi+_col+"_e.png");_nw="filter:"+YUtility.alphaImg(_swi+_col+"_nw.png");_n="filter:"+YUtility.alphaImg(_swi+_col+"_n.png");_w="filter:"+YUtility.alphaImg(_swi+_col+"_w.png");}else{_nw="background:url("+_swi+_col+"_nw.png) bottom no-repeat;";_n="background:url("+_swi+_col+"_n.png) bottom repeat-x;";_ne="background:url("+_swi+_col+"_ne.png) bottom left no-repeat;";_sw="background:url("+_swi+_col+"_sw.png);";_s="background:url("+_swi+_col+"_s.png) repeat-x;";_se="background:url("+_swi+_col+"_se.png) no-repeat;";_e="background:url("+_swi+_col+"_e.png) repeat-y;";_w="background:url("+_swi+_col+"_w.png) repeat-y;";}var _x="";var _spid="yswid";var _stla="margin-top: -0.1em;";if(!ae){var _als='style="position:relative;top:0.05em;right:0.05em;cursor:pointer;border:none;"';_x='<img id="'+_clids+'" '+_als+' src="'+_cls+'" alt="" width="12" height="12 border="0">';_spid="ysaeid";if(YUtility.browser.id){_stla="margin-top: -1.0em;margin-right: 1.0em;";}else{_stla="margin-top: -0.8em;margin-right: 1.0em;";}}this._sc='<div><table cellspacing="0" cellpadding="0" border="0"><tr style="line-height:6px"><td style="line-height:6px; '+_nw+'">&nbsp;</td><td style="line-height:6px; '+_n+'"></td><td style="line-height:6px; '+_ne+'"></td></tr><tr><td style="'+_w+'"></td> <td align=right valign=top bgcolor="#ffffff">'+_x+'<div id="'+_spid+'" style="text-align:left;'+_stla+'">';this._ec='</div></td><td style="'+_e+'">&nbsp;&nbsp;&nbsp;</td></tr><tr style="height:16px;"><td style="height:16px; '+_sw+'"></td><td style="height:16px; '+_s+'"></td><td style="height:16px; '+_se+'"></td></tr </table></div>';YEvent.Capture(_spid,EventsList.MouseOut,function(_e){YEvent.stopPropag(_e);},null,"mouseout");};Marker.prototype.containSmartWindow=function(){var _x=_y=0;var _ws;if(this.swdom){_ws=YUtility.getSize(this.swdom.dom);if(!this.swdom.dom.style.width){this.swdom.dom.style.width="160px";}}else{if(_expCache){_ws=YUtility.getSize(_expCache.dom);}else{return ;}}var _mp=this._map._ll2xy(this.YGeoPoint);if(this._xybr){_mp=new YCoordPoint(this._xybr.x,this._xybr.y+this._image.size.height);}var _mvbx=_ws.width;var _mvby=_ws.height;var cmX=this._image.size.width+this._image.offsetSmartWindow.x;var cmY=this._image.size.height+this._image.offsetSmartWindow.y;var nx=_mvbx-(this._map.YSize.width-_mp.x);var ny=_mp.y-_mvby;var _off=0;if(_mp.x<_off){_x=cmX-_mp.x;}else{if(nx>0){_x=-(nx+cmX);}}if(ny<_off){_y=-(ny-cmY);}else{if(_mp.y>this._map.YSize.height){_y=this._map.YSize.height-_mp.y-cmY;}}if(this.correctLogoSearch){var _wls=205;var _hls=165;var _xlse=this._map.YSize.width-_wls;var _ylse=this._map.YSize.height-_hls;var _xuc=_mp.x+_ws.width;var _yuc=_mp.y-_ws.height;var _xd=_xlse-_xuc;var _yd=_ylse-_yuc;if(_xd<0){_x=_xd+_x;}if(_yd<0){_y=_yd+_y;}}if(!this._disableAutoContain){this._map.smoothPan(new YCoordPoint(_x,_y));}};Marker.prototype.addLabel=function(cin){if(this._domLabel){return ;}var o=YUtility.createNode("div");o.style.position="absolute";o.style.fontWeight="bold";o.style.textAlign="center";o.style.width="20px";o.style.height="20px";o.onmouseover=function(){o.style.cursor="default";};o.style.zIndex=2;o.innerHTML=cin;this._domLabel=o;YUtility.setDefaultSelectStyle(o);YUtility.appendNode(this.dom,this._domLabel);};Marker.prototype.calculatePosition=function(z){this.MP=new MercatorProjection(z);return this.MP.ll_to_xy(this.YGeoPoint);};var GeoCode=function(a,m){if(!m){return ;}this.GeoAddress=a||false;this.Obj=m;this.getPoint=GeoCode.getPoint;};GeoCode.prototype.set=function(s,t,id){var mID=(id)?id:"map";var qtype=(t)?t:99;var rnd=YUtility.getRandomID();var _id="ygeocodenode:"+rnd;if(s){var req=YMapConfig.geoCoder;req+="appid="+YMAPPID+"&qs="+escape(s)+"&qt="+qtype;req+="&mid="+this.Obj.id;req+="&id="+mID+"&r="+rnd;YUtility.dynamicSNode(_id,req);}};GeoCode.getPoint=function(s,t){if(s&&s.GeoMID){_GTab[s.GeoMID]._endGeoCode(s,t);}};var GeoRSS=function(a){this.GeoRSS=a||false;this.Obj=null;};GeoRSS.prototype.set=function(s,m,t){this.Obj=m;var rnd=YUtility.getRandomID();var _id="ygeorssnode:"+rnd;if(s){var req=YMapConfig.geoRSS;req+="appid="+YMAPPID+"&xml="+escape(s)+"&r="+YUtility.getRandomID()+"&mid="+this.Obj.id+"&t="+t;YUtility.dynamicSNode(_id,req);}};GeoRSS.get=function(s,m,t){if(s&&m){_GTab[m]._endGeoRSS(s,t);}};var GeoSearch=function(s,t,m,r,q,n){this.GeoSearch=s||false;this.id=m;this._q=q||"*";this.set(s,t,r,n);};GeoSearch.prototype.set=function(s,t,r,n){var rnd=YUtility.getRandomID();var rid=(t==1)?"ygeolocsrch:"+rnd:"ygeotrfsrch"+rnd;var req;if(s){req=(t==1)?YMapConfig.localSearch:YMapConfig.trafficSearch;req+="appid="+YMAPPID+"&ll="+(s)+"&rr="+YUtility.getRandomID()+"&mid="+this.id+"&t="+t;req+=((t==1)?"&q="+this._q:"");req+=(r?"&r="+r:"");req+=(n?"&n="+n:"");YUtility.dynamicSNode(rid,req);}};GeoSearch.get=function(s,m,t){if(s&&m){_GTab[m]._endGeoSearch(s,t);}};var Template=function(p,d){this._p=p;this._d=d;};Template.prototype.process=function(mu){var im=new YImage();if(this._d.BASEICON){im.src=this._d.BASEICON.src;var w=this._d.BASEICON.width?this._d.BASEICON.width:10;var h=this._d.BASEICON.height?this._d.BASEICON.height:15;im.size=new YSize(w,h);im.offsetSmartWindow=new YCoordPoint(0,h);}var mrk=new YMarker(this._p,im);var csy=this._d.YMAPS_CITYSTATE?this._d.YMAPS_CITYSTATE:"";var zip=this._d.YMAPS_ZIP?this._d.YMAPS_ZIP:"";var ao={title:this._d.TITLE,link:this._d.LINK,description:this._d.DESCRIPTION};mrk.setAnnotation(ao);var sw=new Object();sw.title=this._d.TITLE?"<b>"+this._d.TITLE+"</b><br/>":"";sw.address=this._d.YMAPS_ADDRESS?this._d.YMAPS_ADDRESS+"<br/>":"";sw.city_state=csy?csy+"<br/>":"";sw.phone=this._d.YMAPS_PHONENUMBER?this._d.YMAPS_PHONENUMBER+"<br/>":"";sw.description=(this._d.DESCRIPTION)?"<div style='width:200px;'>"+this._d.DESCRIPTION+"</div><br/>":"";sw.link=this._d.LINK?"<a href='"+this._d.LINK+"' target='_blank'>":"";sw.lnam=sw.link?sw.title+"</a>":"";sw.eimgTitle=sw.eimg="";if(this._d.YMAPS_EXTRAIMAGE){sw.eimgTitle=this._d.YMAPS_EXTRAIMAGE.TITLE?this._d.YMAPS_EXTRAIMAGE.TITLE:"";sw.eimg=this._d.YMAPS_EXTRAIMAGE.URL?'<br/><img src="'+this._d.YMAPS_EXTRAIMAGE.URL+'" border=0 title="'+sw.eimgTitle+'">':"";}sw.itmurl=this._d.YMAPS_ITEMURL?'<iframe src="'+this._d.YMAPS_ITEMURL+'"></iframe>':"";sw.dirt='<a href="http://maps.yahoo.com/dd?taddr='+escape(this._d.YMAPS_ADDRESS)+"&tlt="+this._d.GEO_LAT+"&tln="+this._d.GEO_LONG+"&tname="+this._d.TITLE+"&tcsz="+escape(csy)+" "+zip+'+&terr=12" target=_blank>To here</a>';sw.dirf='<a href="http://maps.yahoo.com/dd?newaddr='+escape(this._d.YMAPS_ADDRESS)+"&slt="+this._d.GEO_LAT+"&sln="+this._d.GEO_LONG+"&name="+this._d.TITLE+"&csz="+escape(csy)+" "+zip+'&oerr=12" target=_blank>From here</a>';sw.dirline=(csy||zip)?"Directions: "+sw.dirt+" - "+sw.dirf:"";var ht='<div style=\'margin: 0 3px 2px 3px;\'><font face="verdana,geneva,sans-serif" size="-2">'+sw.title+sw.address+sw.city_state+sw.phone+sw.description+sw.link+sw.lnam+sw.dirline+sw.eimg+sw.itmurl+"</font></div>";YEvent.Capture(mrk,EventsList.MouseClick,function(){this.openSmartWindow(ht);});return mrk;};var _eO=function(o,p,z){this.thisObj=o;this.YGeoPoint=p;this.zoomObj=z;};function eventObjectGeoRSS(m,u,d){this.ThisMap=m;this.URL=u;this.Data=d||null;this.success=(d&&d.success)?d.success:0;}function eventObjectGeoCode(m,a,g,s){this.ThisMap=m;this.Address=a;this.GeoPoint=g||null;this.success=s||0;}var _setBounds=function(tx,ty,bx,by){this.bL=tx-bx;this.bR=tx+bx;this.bT=ty+by;this.bB=ty-by;};_setBounds.prototype={abL:function(){this.pbL=this.bL;this.bL--;},abR:function(){this.pbR=this.bR;this.bR++;},abT:function(){this.pbT=this.bT;this.bT++;},abB:function(){this.pbB=this.bB;this.bB--;},sbL:function(){this.bL++;},sbR:function(){this.bR--;},sbT:function(){this.bT--;},sbB:function(){this.bB++;},inB:function(x,y){if(x>=this.bL&&x<=this.bR){if(y<=this.bT&&y>=this.bB){return true;}}return false;}};var _GTab={};YAHOO_MAP_REG="YAHOO_MAP";YAHOO_MAP_SAT="YAHOO_SAT";YAHOO_MAP_HYB="YAHOO_HYB";var Map=function(_c,_t,_s){try{if(typeof _c=="string"){_c=document.getElementById(_c);}this.YSize=this._getContainerSize(_c,_s);}catch(x){throw ("Y!Map.Error "+x+", no container object!");}this._defaultStart();this._setParentContainer(_c);this._defineEvents();this._registerEvents();this.setMapType(_t);this._tileCache=[];this._posTbl=[];this._vueTbl=[];this._mTb=[];this._pTb=[];this._totalX=this._totalY=0;this._myTX=this._myTY=0;_GTab[this.id]=this;};Map.prototype={resetXY:function(){this._totalX=this._totalY=0;},getProjection:function(zm){return(zm&&zm!=this.zoomLevel)?(new MercatorProjection(zm)):this.MP;},getTXY:function(){return this._txy;},getTileInfo:function(gp,zm){var mo;mo=(zm&&zm!=this.zoomLevel)?(new MercatorProjection(zm)):this.MP;var txy=mo.ll_to_xy(gp);var tll=mo.xy_to_ll(txy.tx,txy.ty,0,0);var pointpxy=mo.ll_to_pxy(gp.Lat,gp.Lon);var tilepxy=mo.ll_to_pxy(tll.Lat,tll.Lon);return{xy:txy,ll:tll,cp:{x:pointpxy.x-tilepxy.x,y:tilepxy.y-pointpxy.y}};},getTileFill:function(){var b=this.getBounds();var t=this.getTileInfo(b.min);var fx=this._xyFill.width*2+1;var fy=this._xyFill.height*2+1;return{x:t.xy.tx,y:t.xy.ty,nx:fx,ny:fy};},setAnnotation:function(o){this._annotate=o;},getAnnotation:function(){return this._annotate;},getElement:function(){return this.dom;},exportFormat:function(t){if(t!="GEORSS"){return ;}var mt=this.getMarkerIDs();var pt=this.getPolylineIDs();var ma=this.getAnnotation();var cp=this.YGeoPoint;var _s='<?xml version="1.0"?>';_s+='<rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:ymaps="http://api.maps.yahoo.com/Maps/V2/AnnotatedMaps.xsd">';_s+="<channel>";var _e="</channel>";_e+="</rss>";if(ma&&ma.valid){if(ma.title){_s+="<title>"+ma.title+"</title>";}if(ma.description){_s+="<description>"+ma.description+"</description>";}if(ma.link){_s+="<link>"+ma.link+"</link>";}}var _1s="<item>";var _1e="</item>";var _m="";for(var i=0;i<pt.length;i++){var o=this.getPolylineObject(pt[i]);_m+=_1s;var ln="";for(var j=0;j<o._plength;j++){ln+=o._path[j].Lat+","+o._path[j].Lon+((j!=o._plength-1)?" ":"");}if(ln){_m+="<geo:line>"+ln+"</geo:line>";}if(o._color){_m+="<linecolor>"+o._color+"</linecolor>";}if(o._weight){_m+="<linewidth>"+o._weight+"</linewidth>";}if(o._alpha){_m+="<linealpha>"+o._alpha+"</linealpha>";}_m+=_1e;}for(var i=0;i<mt.length;i++){_m+=_1s;var o=this.getMarkerObject(mt[i]);var ga=o.getAnnotation();if(ga){if(ga.title){_m+="<title><![CDATA["+ga.title+"]]></title>";}if(ga.link){_m+="<link>"+ga.link+"</link>";}if(ga.description){_m+="<description><![CDATA["+ga.description+"]]></description>";}}if(o._image.src){}_m+="<geo:lat>"+o.YGeoPoint.Lat+"</geo:lat>";_m+="<geo:long>"+o.YGeoPoint.Lon+"</geo:long>";_m+=_1e;}var _rss=_s+_m+_e;return _rss;},_defaultStart:function(){this._mapType=YAHOO_MAP_REG;this.setZoomRange(1,17);this.zoomLevelPrev=null;this._disableDrag=false;this._txy=new YCoordPoint();},_setMapTypeHigh:function(_i){var _t=(_i)?_i:this._mapType;var _k=(this._ctrlType)?this._ctrlType.id:null;if(!_k){return ;}var _tps=this._ctrlType._types;for(var i=0;i<_tps.length;i++){var _ik=_tps[i];var _obj=this._ctrlType._bobj[_ik].YObj;if(!YUtility.browser.id){this._ctrlType._bobj[_ik].YObj.style.filter=YUtility.alphaImg2(_obj._iefix.src)+" alpha(opacity=80)";}else{this._ctrlType._bobj[_ik].style.opacity=0.8;}this._ctrlType._bobj[_ik].style.borderWidth="0px";if(_t==_ik){if(!YUtility.browser.id){this._ctrlType._bobj[_ik].YObj.style.filter=YUtility.alphaImg2(_obj._iefix.src)+" alpha(opacity=99)";}else{this._ctrlType._bobj[_ik].style.opacity=1;}this._ctrlType._bobj[_ik].style.borderWidth="0.1px";}}},setMapType:function(_t){if(!_t||this._mapType==_t){return ;}this._mapType=_t;this._setMapTypeHigh();if(this.YGeoPoint){this.drawZoomAndCenter(this.YGeoPoint,this.zoomLevel);}},getMapTypes:function(){var _t=[YAHOO_MAP_REG,YAHOO_MAP_SAT,YAHOO_MAP_HYB];return _t;},getCurrentMapType:function(){return this._mapType;},addTypeControl:function(_t,_a,_c){for(var i=0;i<arguments.length;i++){var o=arguments[i];if(typeof o=="object"){if(o.valid){_c=o;}else{_t=o;}}if(typeof o=="string"){_a=o;}}if(!_c){_c=new YCoordPoint(110,5);_c.translate("right","top");}this._typeControlPosition=_c;this._ctrlType=new TypeControl(this._typeControlPosition,_t);var _dc={YAHOO_MAP:YMapConfig.imgPrefixURL+"med_map.png?v=1.3",YAHOO_SAT:YMapConfig.imgPrefixURL+"med_sat.png?v=1.3",YAHOO_HYB:YMapConfig.imgPrefixURL+"med_hyb.png?v=1.3"};for(var i=0;i<this._ctrlType._types.length;i++){var dt=this._ctrlType._types[i];this._ctrlType.setControl(dt,new YImage(_dc[dt],new YSize(33,17)),new YSize(33,17));}this._ctrlType.setHorizontal();if(_a=="v"){this._ctrlType.setVertical();}this.addOverlay(this._ctrlType);var _ce=new _eO(this,this.YGeoPoint);this.Events.MapTypeControlAdded.trigger(_ce);},addNavigatorControl:function(c){if(!c){c=new YCoordPoint(5,5);c.translate("right","bottom");}this._miniPosition=c;if(!this._miniObj){this._miniObj=new MiniControl(this.zoomLevel,this._miniPosition);this.addOverlay(this._miniObj);var _ce=(new _eO(this,this.YGeoPoint,{previous:this.zoomLevelPrev,current:this.zoomLevel}));this.Events.miniAdded.trigger(_ce);}},_showMini:function(){},addZoomLong:function(c){this._zoomType=false;this._createZoomControl(c);},addZoomShort:function(c){this._zoomType=true;this._createZoomControl(c);},_createZoomControl:function(c){if(!c){c=new YCoordPoint(5,5);}this._zoomPosition=c;if(!this.zoomLevel){YEvent.Capture(this,EventsList.endMapDraw,this._updateZoomLevel);}else{this._updateZoomLevel();}},_updateZoomLevel:function(){if(!this._ctrlZoom){this._ctrlZoom=new ZoomControl(this.zoomLevel,this._zoomPosition,this._zoomType);this.addOverlay(this._ctrlZoom);var _ce=(new _eO(this,this.YGeoPoint,{previous:this.zoomLevelPrev,current:this.zoomLevel}));this.Events.zoomAdded.trigger(_ce);}},removeZoomControl:function(){this.removeOverlay(this._ctrlZoom.id);this._ctrlZoom=null;this._zoomON=false;},setZoomLevel:function(z){if(this.isValidZoomLevel(z)){if(Math.abs(z-this.zoomLevel)){this._setZoomLevel(YUtility.getInt(z));}}},_setZoomLevel:function(z,p){this.zoomLevelPrev=p||this.zoomLevel;this.drawZoomAndCenter(this.YGeoPoint,z);},setZoomRange:function(min,max){this._zoomMin=min;this._zoomMax=max;YEvent.Capture(this,EventsList.zoomAdded,this._updateZoomRange);},_updateZoomRange:function(){if(this._ctrlZoom){this._ctrlZoom.setMinMax(this._zoomMin,this._zoomMax);}},getZoomValidLevels:function(){return this.vZoom;},isValidZoomLevel:function(z){if(this._zr[YUtility.getInt(z)-1]&&z>=this._zoomMin&&z<=this._zoomMax){return true;}return false;},addPanControl:function(c){if(!c){c=new YCoordPoint(25,5);}this._panPosition=c;if(!this._ctrlPan){this._ctrlPan=new PanControl(this._panPosition);this.addOverlay(this._ctrlPan);}},removePanControl:function(){this.removeOverlay(this._ctrlPan.id);this._ctrlPan=null;},_processLogoSearch:function(e){var sti=["sl_st05.gif","sl_st1.gif","sl_st15.gif","sl_st2.gif","sl_st25.gif","sl_st3.gif","sl_st35.gif","sl_st4.gif","sl_st45.gif","sl_rst.gif"];var setupMarker=function(p,l){var im=new YImage(YMapConfig.imgPrefixURL+"smarker71a4c2.png",new YSize(23,32),new YCoordPoint(0,0));var _idm=l.PHONE.replace(/[\(\)\s]/g,"");var m=new YMarker(p,im,"ymrkloc"+_idm);m.correctLogoSearch=true;var iar=YMapConfig.imgPrefixURL+"sl_earr.gif";var etx='<div style="font:10 tahoma;">'+l.TITLE+"<img src="+iar+"></div>";m.setSmartWindowColor("71a4c1");m.addAutoExpand(etx);var _br="<br>";var ets='<div style="font:10 tahoma;width:130px;height:auto;"><b>'+l.TITLE+"</b>"+_br;if(l.PHONE){ets+=l.PHONE+_br;}if(l.ADDRESS){ets+=l.ADDRESS+_br;}if(l.CITY){ets+=l.CITY+", "+l.STATE+_br;}if(l.RATING&&l.RATING.AVERAGERATING){var si=isNaN(l.RATING.AVERAGERATING)?"":l.RATING.AVERAGERATING;var _imc;if(si<1){_imc=sti[0];}if(si==1){_imc=sti[1];}if(si>1&&si<2){_imc=sti[2];}if(si==2){_imc=sti[3];}if(si>2&&si<3){_imc=sti[4];}if(si==3){_imc=sti[5];}if(si>3&&si<4){_imc=sti[6];}if(si==4){_imc=sti[7];}if(si>4&&si<5){_imc=sti[8];}if(si==5){_imc=sti[9];}var im=(si)?"<img src="+YMapConfig.imgPrefixURL+_imc+">":"";ets+=im;if(YUtility.getInt(l.RATING.TOTALREVIEWS)){ets+=" ("+l.RATING.TOTALREVIEWS+")";}ets+=" <a href="+l.URL+" target=_blank>Rate it</a>";ets+="<br>";}var _dd=YMapConfig.mapsSite+"/dd?";var _addr=l.ADDRESS;var _city=l.CITY+","+l.STATE;var _ddt=_dd+"tname="+escape(l.TITLE)+"&taddr="+escape(_addr)+"&tcsz="+_city;var _ddf=_dd+"name="+escape(l.TITLE)+"&newaddr="+escape(_addr)+"&csz="+_city;ets+="<a href="+_ddt+" target=_blank>Directions To</a>";ets+=" | ";ets+="<a href="+_ddf+" target=_blank>From</a>";ets+="<br>";ets+="<a href="+l.URL+" target=_blank>More Info</a>";ets+="<br>";ets+="</div>";YEvent.Capture(m,EventsList.MouseClick,function(e){m.openSmartWindow(ets);});return m;};var _p=[];var nres=e.Data.ITEMS.length;this._nls._n0.style.visibility="visible";this._nls._n0.innerHTML=nres+((nres==1)?" result":" results");if(e.Data){for(var a in e.Data.ITEMS){var l=e.Data.ITEMS[a];if(l.TITLE){var p=new YGeoPoint(l.LATITUDE,l.LONGITUDE);_p.push(p);var m=setupMarker(p,l);this._nls._markers.push(m);this.addOverlay(m);}}}},disableLogoSearch:function(){this.removeOverlay("ylocalsearch");this._ylogo2();},enableLogoSearch:function(){this.removeOverlay("ycopy2");this.removeOverlay("ylogo");this._ylogo();},_ylogo:function(){if(this._coordTable["ylocalsearch"]||this._coordTable["ylogo"]){return ;}if(this.YSize.width<245||this.YSize.height<205){this.disableLogoSearch();return ;}var cp=new YCoordPoint(0,0);cp.translate("right","bottom");this._nls=new logoSearch(cp);YEvent.Capture(this,EventsList.onEndLocalSearch,this._processLogoSearch);var that=this;this._nls._form.onsubmit=function(){var bds=that.getBoundsLatLon();var npt1=new YGeoPoint(that.YGeoPoint.Lat,bds.max.Lon);var npt2=new YGeoPoint(bds.max.Lat,that.YGeoPoint.Lon);var dst1=that.YGeoPoint.distance(npt1);var dst2=that.YGeoPoint.distance(npt2);var dst=(dst1.miles>dst2.miles)?dst2.miles:dst1.miles;var nres=10;that.searchLocal(that.YGeoPoint,that._nls._i.value,(dst),nres);return false;};this._nls._form.onmousedown=function(){that.disableDragMap();};this._nls._form.onmouseup=function(){that.enableDragMap();};this._nls._nC.onclick=function(){that._nls._i.value="";that._nls._n0.innerHTML="";for(var m=0;m<that._nls._markers.length;m++){that.removeOverlay(that._nls._markers[m]);}};this._nls._i.tabIndex=999;this.addOverlay(this._nls);},_ylogo2:function(){if(this._disableLogo){return ;}var _l=YUtility.createNode("img");var _s={position:"absolute",width:"71px",height:"13px",zIndex:3};_l.src=YMapConfig.ylogo;YUtility.setStyle(_l,_s);var _p=new YCoordPoint(1,12);_p.translate("right","bottom");var _ol=new YCustomOverlay(_p,_l);_ol.id="ylogo";this.addOverlay(_ol);this._ycpyr();},_datacopy:function(w){var _id="ycopy1";if(this._coordTable[_id]){return ;}var _sc={position:"absolute",zIndex:3,cursor:"default",fontSize:"9px",width:"230px",height:"10px",fontFamily:"verdana",color:"#000",fontWeight:200,textAlign:"left"};var _l1=YUtility.createNode("div");if(typeof YMapConfig.copyReg=="object"){_l1._cimg=YUtility.createNode("img");if(w){_l1._cimg.src=YMapConfig.copyHyb.service+"&x="+this._txy.tx+"&y="+this._txy.ty+"&z="+this.zoomLevel+"&top="+this._xyFill.width/2+"&left="+this._xyFill.height/2;}else{_l1._cimg.src=YMapConfig.copyReg.service+"&x="+this._txy.tx+"&y="+this._txy.ty+"&z="+this.zoomLevel+"&top="+this._xyFill.width/2+"&left="+this._xyFill.height/2;}YUtility.alphaLoad(_l1._cimg);YUtility.appendNode(_l1,_l1._cimg);YUtility.setStyle(_l1._cimg,_sc);}else{_l1.innerHTML=YMapConfig.copyReg;}YUtility.setStyle(_l1,_sc);var _p1;if(w){YUtility.setStyle(_l1,"color","#fff");_p1=new YCoordPoint(202,0);}else{_p1=new YCoordPoint(1,0);}_p1.translate("left","bottom");var _ovcpy1=new YCustomOverlay(_p1,_l1);_ovcpy1.id=_id;this.addOverlay(_ovcpy1);},_satcopy:function(np){var _id="ycopy3";if(this._coordTable[_id]){return ;}var _sc={position:"absolute",zIndex:3,cursor:"default",height:"10px",width:"200px",textAlign:"left"};var _l3=YUtility.cloneNode("img",_id);if(typeof YMapConfig.copySat=="object"){_l3.src=YMapConfig.copySat.service+"&x="+this._txy.tx+"&y="+this._txy.ty+"&z="+this.zoomLevel+"&ew=1&ns=1";}YUtility.setStyle(_l3,_sc);YUtility.setStyle(_l3,"filter",YUtility.alphaImg(_l3.src));var _p3=(np)?np:new YCoordPoint(1,0);_p3.translate("left","bottom");var _ovcpy3=new YCustomOverlay(_p3,_l3);_ovcpy3.id=_id;this.addOverlay(_ovcpy3);},disableCopyright:function(){this._disableCopy=true;},_ycopy:function(){if(this._disableCopy){return ;}var _sc={position:"absolute",zIndex:3,cursor:"default",textAlign:"left"};if(this._mapType==YAHOO_MAP_REG){this.removeOverlay("ycopy1");this._datacopy();this.removeOverlay("ycopy3");}else{if(this._mapType==YAHOO_MAP_SAT){this.removeOverlay("ycopy3");this._satcopy();this.removeOverlay("ycopy1");}else{if(this._mapType==YAHOO_MAP_HYB){this.removeOverlay("ycopy1");this._datacopy(1);this.removeOverlay("ycopy3");this._satcopy();}}}},_ycpyr:function(){var _sc={position:"absolute",zIndex:3,fontSize:"7pt",fontStyle:"normal",fontFamily:"verdana",color:"#000",cursor:"default",textAlign:"right"};var c2id="ycopy2";if(!this._coordTable[c2id]){var _l2=YUtility.createNode("div");_l2.innerHTML=YMapConfig.copyText;YUtility.setStyle(_l2,_sc);var _p2=new YCoordPoint(1,1);_p2.translate("right","bottom");var _ol2=new YCustomOverlay(_p2,_l2);_ol2.id=c2id;this.addOverlay(_ol2);}},removeYLogo:function(){this._disableLogo=true;this.removeOverlay("ylogo");},removeYCopy:function(){this._disableCopy=true;this.removeOverlay("ycopy1");this.removeOverlay("ycopy2");this.removeOverlay("ycopy3");},_yscale:function(){if(this._zoomScaleDisabled){return ;}this.addZoomScale();},addZoomScale:function(){if(!this._ovMapScale){this._ovMapScale=new Scale(this.zoomLevel,this.getUnitsPerPixel(),this._zr);this.addOverlay(this._ovMapScale);}this._zoomScaleDisabled=false;},removeZoomScale:function(){if(this._ovMapScale){this.removeOverlay(this._ovMapScale.id);this._ovMapScale=null;}this._zoomScaleDisabled=true;},_defineEvents:function(){this.Events={};this.Events.endPan=new _captureEvent(EventsList.endPan,this);this.Events.endAutoPan=new _captureEvent(EventsList.endAutoPan,this);this.Events.startPan=new _captureEvent(EventsList.startPan,this);this.Events.startAutoPan=new _captureEvent(EventsList.startAutoPan,this);this.Events.onPan=new _captureEvent(EventsList.onPan,this);this.Events.changeZoom=new _captureEvent(EventsList.changeZoom,this);this.Events.changeMapType=new _captureEvent(EventsList.changeMapType,this);this.Events.onStartGeoCode=new _captureEvent(EventsList.onStartGeoCode,this);this.Events.onEndGeoCode=new _captureEvent(EventsList.onEndGeoCode,this);this.Events.onStartGeoRSS=new _captureEvent(EventsList.onStartGeoRSS,this);this.Events.onEndGeoRSS=new _captureEvent(EventsList.onEndGeoRSS,this);this.Events.onEndTrafficSearch=new _captureEvent(EventsList.onEndTrafficSearch,this);this.Events.onEndLocalSearch=new _captureEvent(EventsList.onEndLocalSearch,this);this.Events.endPanOB=new _captureEvent(EventsList.endPanOB,this);this.Events.endMapDraw=new _captureEvent(EventsList.endMapDraw,this);this.Events.zoomAdded=new _captureEvent(EventsList.zoomAdded,this);this.Events.MapTypeControlAdded=new _captureEvent(EventsList.MapTypeControlAdded,this);this.Events.miniAdded=new _captureEvent(EventsList.miniAdded,this);this.Events.polylineAdded=new _captureEvent(EventsList.polylineAdded,this);this.Events.polylineRemoved=new _captureEvent(EventsList.polylineRemoved,this);this.Events.MouseClick=new _captureEvent(EventsList.MouseClick,this);this.Events.MouseUp=new _captureEvent(EventsList.MouseUp,this);this.Events.MouseDoubleClick=new _captureEvent(EventsList.MouseDoubleClick,this);this.Events.MouseOver=new _captureEvent(EventsList.MouseOver,this);this.Events.MouseOut=new _captureEvent(EventsList.MouseOut,this);this.Events.MouseDown=new _captureEvent(EventsList.MouseDown,this);this._endPan=true;this.keyTypes={};this.keyTypes.zoomIn=1;this.keyTypes.zoomOut=2;this.keyTypes.panN=3;this.keyTypes.panS=4;this.keyTypes.panW=5;this.keyTypes.panE=6;this.keyTypes.panNW=7;this.keyTypes.panNE=8;this.keyTypes.panSW=9;this.keyTypes.panSE=10;this.Events.KeyDown=new _captureEvent(EventsList.KeyDown,this);this.Events.KeyUp=new _captureEvent(EventsList.KeyUp,this);},_registerEvents:function(){YEvent.Capture(window,EventsList.resize,this._onResizeRun,this);YEvent.Capture(window,EventsList.unload,this._runUnload,this);YEvent.Capture(this,EventsList.wheel,this._runWheel);YEvent.Capture(this,EventsList.endPanOB,this._endPanOBRun);YEvent.Capture(this,EventsList.endMapDraw,this._endMapDrawRun);YEvent.Capture(this,EventsList.zoomAdded,this._zoomAddedRun);YEvent.Capture(this,EventsList.MapTypeControlAdded,this._MapTypeControlAddedRun);YEvent.Capture(this,EventsList.miniAdded,this._miniAddedRun);YEvent.Capture(this,EventsList.endPan,this._runendPan);YEvent.Capture(this,EventsList.endAutoPan,this._runendPan);YEvent.Capture(this,EventsList.startPan,this._runstartPan);YEvent.Capture(this,EventsList.onPan,this._runonPan);YEvent.Capture(this,EventsList.changeZoom,this._runchangeZoom);YEvent.Capture(this,EventsList.changeMapType,this._changeMapTypeRun);YEvent.Capture(this,EventsList.polylineAdded,this._polylineAddedRun);YEvent.Capture(this,EventsList.polylineRemoved,this._polylineRemovedRun);YEvent.Capture(this,EventsList.MouseClick,this._MouseClickRun,null,EventsList.click);YEvent.Capture(this,EventsList.MouseUp,this._MouseUpRun,null,EventsList.mup);YEvent.Capture(this,EventsList.MouseDoubleClick,this._DoubleClickRun,null,EventsList.dblclick);YEvent.Capture(this,EventsList.MouseDown,this._MouseDownRun,null,EventsList.mdown);YEvent.Capture(this,EventsList.MouseOver,this._MouseOverRun,null,EventsList.mover);YEvent.Capture(this,EventsList.MouseOut,this._MouseOutRun,null,EventsList.mout);YEvent.Capture(this,EventsList.MouseDoubleClick,this._dc2pan);YEvent.Capture(document,EventsList.KeyDown,this._runkeyDown,this,EventsList.kdown);YEvent.Capture(document,EventsList.KeyUp,this._runkeyUp,this,EventsList.kup);YEvent.Capture(this,EventsList.KeyDown,this._keyZoom);YEvent.Capture(this,EventsList.KeyDown,this._keyPan);YEvent.Capture(this,EventsList.KeyDown,this._keyType);},_changeMapTypeRun:function(_e){},_polylineAddedRun:function(_e){},_polylineRemovedRun:function(_e){},_MapTypeControlAddedRun:function(_e){this._setMapTypeHigh();},_miniAddedRun:function(_e){this._miniON=true;},_zoomAddedRun:function(_e){this._zoomON=true;},_panAddedRun:function(_e){this._panON=true;},_startGeoCode:function(_a,_t,_id){var _n=new GeoCode(_a,this);_n.set(_n.GeoAddress,_t,_id);var _ce=new eventObjectGeoCode(this,_a);this.Events.onStartGeoCode.trigger(_ce);},_endGeoCode:function(_e,_t){if(_t==10){this.drawZoomAndCenter(_e.GeoPoint,this.zoomLevel);}if(_t==11){this.addMarker(_e.GeoPoint);}if(_t==12){if(this._mTb[_e.GeoID]){this._mTb[_e.GeoID].setYGeoPoint(_e.GeoPoint);this._mTb[_e.GeoID].setGeoXYPoint(this.zoomLevel,this._posTbl);}}var gp=new YGeoPoint(_e.GeoPoint.Lat,_e.GeoPoint.Lon);var _ce=new eventObjectGeoCode(this,_e.GeoAddress,gp,_e.success);this.Events.onEndGeoCode.trigger(_ce);},_startGeoSearch:function(_g,_t,_r,_q,_n){if(!_g){if(!this.YGeoPoint){return ;}_i=this.YGeoPoint.Lat+"|"+this.YGeoPoint.Lon;}else{_i=_g.Lat+"|"+_g.Lon;}var r=new GeoSearch(_i,_t,this.id,_r,_q,_n);},_endGeoSearch:function(_e,_t){var _ce=new eventObjectGeoRSS(this,_e.URL,_e);if(_t==1){this.Events.onEndLocalSearch.trigger(_ce);}if(_t==2){this.Events.onEndTrafficSearch.trigger(_ce);}},_startGeoRSS:function(_o,_t){_o.set(_o.GeoRSS,this,_t);var _ce=new eventObjectGeoRSS(this,_o);this.Events.onStartGeoRSS.trigger(_ce);},_endGeoRSS:function(_e,_t){if(_t==1){var _c=this.getBoxGeoCenter(_e.GEOBOX.MIN,_e.GEOBOX.MAX);var _z=this.getZoomLevel(_e.GEOBOX.MIN,_e.GEOBOX.MAX);this.drawZoomAndCenter(_c,_z);for(var o in _e.ITEMS){var i=_e.ITEMS[o];if(i.YGEORSS&&i.GEO_LINE){var p=[];for(var l in i.GEO_LINE){if(i.GEO_LINE[l].GEO_LAT){p.push(new YGeoPoint(i.GEO_LINE[l].GEO_LAT,i.GEO_LINE[l].GEO_LON));}}var lc=(i.LINECOLOR)?i.LINECOLOR:null;var lw=(i.LINEWIDTH)?i.LINEWIDTH:null;var la=(i.LINEALPHA)?i.LINEALPHA:null;var pl=new YPolyline(p,lc,lw,la);this.addOverlay(pl);}else{if(i.YGEORSS){var p=new YGeoPoint(i.GEO_LAT,i.GEO_LONG);var t=new Template(p,i);var m=t.process();this.addOverlay(m);}}}}if(_t==2){}var _ce=new eventObjectGeoRSS(this,_e.URL,_e);this.Events.onEndGeoRSS.trigger(_ce);},_endPanOBRun:function(e){},_endMapDrawRun:function(_e){if(this._zoomON==true&&this._ctrlZoom){this._ctrlZoom.updateZoomLevel(this.zoomLevel);}if(this._disableDrag==true){this.disableDragMap();}this._yscale();if(this._miniON==true){this._showMini();}if(this._ovMapScale){this._ovMapScale.update(this.zoomLevel,this.getUnitsPerPixel(),this._mapType);}this._ylogo2();this._ycopy();},_runUnload:function(_e){this._clearView(1);},_runWheel:function(_e){if(this._disableKeys){return ;}var _d;if(_e.detail){_d=YUtility.getInt(_e.detail)*(-40);}if(_e.wheelDelta){_d=_e.wheelDelta;}if(_d>=120){this.setZoomLevel(this.zoomLevel-1);}else{this.setZoomLevel(this.zoomLevel+1);}},_getKeyType:function(_k){var zkp="61";var zkm="109";if(!YUtility.browser.id){zkp="187";zkm="189";}var _ks={"45":this.keyTypes.zoomOut,"107":this.keyTypes.zoomIn,"46":this.keyTypes.zoomIn,"38":this.keyTypes.panN,"40":this.keyTypes.panS,"37":this.keyTypes.panW,"39":this.keyTypes.panE,"36":this.keyTypes.panNW,"33":this.keyTypes.zoomOut,"35":this.keyTypes.panSW,"34":this.keyTypes.zoomIn,"_":""};_ks[zkm]=this.keyTypes.zoomOut;_ks[zkp]=this.keyTypes.zoomIn;if(_ks[_k]){return _ks[_k];}return false;},_keyZoom:function(_e,_k){if(this._disableKeys){return ;}if(this._getKeyType(_k)==this.keyTypes.zoomIn){this.setZoomLevel(this.zoomLevel-1);}else{if(this._getKeyType(_k)==this.keyTypes.zoomOut){this.setZoomLevel(this.zoomLevel+1);}}},_keyType:function(_e,_k){if(this._disableKeys){return ;}},_keyPan:function(_e,_k){if(this._disableKeys){return ;}var x=40;var y=40;if(this._disableDrag==true){return ;}if(this._getKeyType(_k)==this.keyTypes.panN){this.smoothPan(new YCoordPoint(0,y));}else{if(this._getKeyType(_k)==this.keyTypes.panS){this.smoothPan(new YCoordPoint(0,-y));}else{if(this._getKeyType(_k)==this.keyTypes.panW){this.smoothPan(new YCoordPoint(x,0));}else{if(this._getKeyType(_k)==this.keyTypes.panE){this.smoothPan(new YCoordPoint(-x,0));}else{if(this._getKeyType(_k)==this.keyTypes.panNW){this.smoothPan(new YCoordPoint(x,y));}else{if(this._getKeyType(_k)==this.keyTypes.panNE){this.smoothPan(new YCoordPoint(-x,y));}else{if(this._getKeyType(_k)==this.keyTypes.panSW){this.smoothPan(new YCoordPoint(x,-y));}else{if(this._getKeyType(_k)==this.keyTypes.panSE){this.smoothPan(new YCoordPoint(-x,-y));}}}}}}}}},_runkeyDown:function(_e){var _key=_e.keyCode;var _ce=(new _eO(this,this.YGeoPoint,{previous:this.zoomLevelPrev,current:this.zoomLevel}));this.Events.KeyDown.trigger(_ce,_key);},_runkeyUp:function(_e){var _key=_e.keyCode;var _ce=(new _eO(this,this.YGeoPoint,{previous:this.zoomLevelPrev,current:this.zoomLevel}));this.Events.KeyUp.trigger(_ce,_key);},_MouseOverRun:function(_e){var _ll=this._getEvGP(_e);var _ce=(new _eO(this,this.YGeoPoint,{previous:this.zoomLevelPrev,current:this.zoomLevel}));this.Events.MouseOver.trigger(_ce,_ll);},_MouseOutRun:function(_e){var _ll=this._getEvGP(_e);var pt=this._ll2xy(_ll);if(pt.x<5||pt.x>=(this.YSize.width-5)||pt.y<5||pt.y>=(this.YSize.height-30)){var _ce=(new _eO(this,this.YGeoPoint,{previous:this.zoomLevelPrev,current:this.zoomLevel}));this.Events.MouseOut.trigger(_ce,_ll);}if(!pt.x||!pt.y){var _ce=(new _eO(this,this.YGeoPoint,{previous:this.zoomLevelPrev,current:this.zoomLevel}));this.Events.MouseOut.trigger(_ce,_ll);}},_MouseDownRun:function(_e){var _ll=this._getEvGP(_e);var tr=this._getEtrg(_e);if(!YUtility.browser.id){YUtility.setStyle(tr,"cursor","http://l.yimg.com/a/i/us/map/aj/iegrb.png");}else{YUtility.setStyle(tr,"cursor","-moz-grabbing");}var _ce=(new _eO(this,this.YGeoPoint,{previous:this.zoomLevelPrev,current:this.zoomLevel}));this.Events.MouseDown.trigger(_ce,_ll);},_MouseUpRun:function(_e){var tr=this._getEtrg(_e);YUtility.setStyle(tr,"cursor","pointer");if(this._endPan){if(this.Events.MouseClick){}}else{if(this.Events.MouseClick){}}var _ll=this._getEvGP(_e);var _ce=(new _eO(this,this.YGeoPoint,{previous:this.zoomLevelPrev,current:this.zoomLevel}));this.Events.MouseUp.trigger(_ce,_ll);},_MouseClickRun:function(_e){this.setFocus();if(YUtility.browser.id!=2){YEvent.stopPropag(_e);}if(!this.YCoordPoint){return ;}var _ll=this._getEvGP(_e);var dfc=_ll.distance(this.YGeoPoint,this.getUnitsPerPixel());if(dfc.pixels>this.YSize.width){return ;}var _ce=(new _eO(this,this.YGeoPoint,{previous:this.zoomLevelPrev,current:this.zoomLevel}));this.Events.MouseClick.trigger(_ce,_ll);this.dragOn=false;},_runstartPan:function(_e){this._endPan=false;},_runonPan:function(_e){},_runendPan:function(_e){this._endPan=true;this._adjustOverlay(2);this._cleanTileCache(true);if(Math.abs(this._myTX)>this.YSize.width/2||Math.abs(this._myTY)>this.YSize.height/2){this.Events.endPanOB.trigger();this._myTX=this._myTY=0;}if(this.YSize.hasSmallerSide(new YSize(Math.abs(this._totalX),Math.abs(this._totalY)))){var f=trackDelay(this,"pan_ob",this.YGeoPoint);if(!trackTr){trackTr=setTimeout(f,trackDl);}if(this._mapType==YAHOO_MAP_SAT||this._mapType==YAHOO_MAP_HYB){var src=YMapConfig.copySat.service+"&x="+this._txy.tx+"&y="+this._txy.ty+"&z="+this.zoomLevel+"&ew=1&ns=1";if(this._coordTable["ycopy3"]){if(!YUtility.browser.id){this._coordTable["ycopy3"].dom.style.filter=YUtility.alphaImg(src);}else{this._coordTable["ycopy3"].dom.src=src;}}}if(this._mapType==YAHOO_MAP_HYB){if(typeof YMapConfig.copyHyb=="object"){var src=YMapConfig.copyHyb.service+"&x="+this._txy.tx+"&y="+this._txy.ty+"&z="+this.zoomLevel+"&top="+this._xyFill.width/2+"&left="+this._xyFill.height/2;if(this._coordTable["ycopy1"]){if(!YUtility.browser.id){this._coordTable["ycopy1"].dom._cimg.style.filter=YUtility.alphaImg(src);}else{this._coordTable["ycopy1"].dom._cimg.src=src;}}}}else{if(this._mapType==YAHOO_MAP_REG){if(typeof YMapConfig.copyReg=="object"){var src=YMapConfig.copyReg.service+"&x="+this._txy.tx+"&y="+this._txy.ty+"&z="+this.zoomLevel+"&top="+this._xyFill.width/2+"&left="+this._xyFill.height/2;if(this._coordTable["ycopy1"]){if(!YUtility.browser.id){this._coordTable["ycopy1"].dom._cimg.style.filter=YUtility.alphaImg(src);}else{this._coordTable["ycopy1"].dom._cimg.src=src;}}}}}}else{YUtility.tracker(this,"pan");}},_runchangeZoom:function(e){if(this._ctrlZoom){this._ctrlZoom.updateZoomLevel(this.zoomLevel);}},_getEvCP:function(_e){var xy=YAHOO.util.Event.getXY(_e);var ps=YAHOO.util.Dom.getXY(this.dom);var ax=xy[0]-ps[0];var ay=xy[1]-ps[1];var np=new YCoordPoint(ax,ay);var _cx=this.YSize.width/2;var _cy=this.YSize.height/2;var dx=_cx-np.x;var dy=_cy-np.y;var cp=new YCoordPoint(dx,dy);return cp;},_getEtrg:function(_e){return YAHOO.util.Event.getTarget(_e);},_getEvXY:function(_e){var _tr=YAHOO.util.Event.getTarget(_e);var _xy=YAHOO.util.Event.getXY(_e);var _dp=YAHOO.util.Dom.getXY(this.dom);var _ep=new YCoordPoint(_xy[0]-_dp[0],_xy[1]-_dp[1]);if(!this.YCoordPoint){return ;}var dx=this.YCoordPoint.x-_ep.x;var dy=this.YCoordPoint.y-_ep.y;var otx=this._txy.x;var oty=this._txy.y;var tdx=this._txy.tx-_tr.tx;var tdy=this._txy.ty-_tr.ty;var ntx=otx-(dx-tdx*YMapConfig.tileXY);var nty=oty+(dy+tdy*YMapConfig.tileXY);return(new TileXY(_tr.tx,_tr.ty,ntx,nty));},_getEvGP:function(_e){var _txy=this._getEvXY(_e);if(!this.MP){return ;}var _ll=this.MP.xy_to_ll(_txy.tx,_txy.ty,_txy.x,_txy.y);return _ll;},_adjustOverlay:function(t){for(var m in this._mTb){if(this._mTb[m].setGeoXYPoint){this._mTb[m].setGeoXYPoint(this.zoomLevel,this._posTbl,t);}}if(t!=2){for(var p in this._pTb){if(this._pTb[p].setGeoXYPoint){this._pTb[p].setGeoXYPoint(this.zoomLevel,this._posTbl,t);}}}},handleSizeChange:function(_e){this._onResizeRun(_e);},_onResizeRun:function(_e){YEvent.stopEvent(_e);if(!this.YSize){return ;}this._adjustOnResize(YUtility.getSize(this.dom));},disablePanOnDoubleClick:function(){YEvent.Remove(this,EventsList.MouseDoubleClick,this._dc2pan);},_dc2pan:function(_e,_ll){if(_ll&&_ll.Lat==0&&_ll.Lon==-180){return ;}this.setZoomLevel(this.zoomLevel-1);this.panToLatLon(_ll);},_DoubleClickRun:function(_e){YEvent.stopEvent(_e);if(this._disableDrag){return ;}var _ll=this._getEvGP(_e);var _ce=(new _eO(this,this.YGeoPoint,{previous:this.zoomLevelPrev,current:this.zoomLevel}));this.Events.MouseDoubleClick.trigger(_ce,_ll);},vZoom:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],_zr:[[1,"1",[0.1,0.0473484848]],[2,"st",[0.125,0.1]],[3,"3",[0.25,0.2]],[4,"city",[0.5,0.5]],[5,"5",[1,1]],[6,"6",[2,2]],[7,"7",[5,3]],[8,"state",[10,7]],[9,"9",[20,15]],[10,"10",[30,25]],[11,"11",[75,50]],[12,"12",[150,100]],[13,"13",[300,200]],[14,"14",[600,400]],[15,"15",[1000,750]],[16,"16",[2000,1500]],[17,"17",[5000,3000]],[18,"18",[5000,3000]]],_lct:function(x,y){var _a=this._txy.x-this.YSize.width/2+x;var _b=this._txy.y+this.YSize.height/2-y;return new YCoordPoint(_a,_b);},_xy2ll:function(_c,_t){var _p=this._lct(_c.x,_c.y);return this.MP.xy_to_ll(this._txy.tx,this._txy.ty,_p.x,_p.y);},_getSubContainerXY:function(){return(new YCoordPoint(YUtility.getInt(this.subContainer.style.left),YUtility.getInt(this.subContainer.style.top)));},_ll2xy:function(gp,op){if(this.MP){var v=this.MP.ll_to_xy(gp);var k=YUtility._xyKey(v.tx,v.ty,this.zoomLevel,this._mapType);var scxy=this._getSubContainerXY();var pos=null;if(this._posTbl[k]){pos=this._posTbl[k];}else{if(this._vueTbl[k]){pos=this._vueTbl[k];}else{var cT=this.MP.ll_to_xy(this.YGeoPoint);var cK=YUtility._xyKey(cT.tx,cT.ty,this.zoomLevel,this._mapType);var cP=this._posTbl[cK];if(!cP){return false;}var xN=cP.tx-v.tx;var yN=cP.ty-v.ty;var xP=cP.x-YMapConfig.tileXY*xN;var yP=cP.y+YMapConfig.tileXY*yN;pos=new TileXY(v.tx,v.ty,xP,yP);}}if(pos){var xm=YUtility.getInt(pos.x)+((op==1)?0:scxy.x);var ym=YUtility.getInt(pos.y)+((op==1)?0:scxy.y);var rv=this.MP._returnCoordPoint(xm,ym,v.x,v.y);if(op==1){rv._xscpos=scxy.x;}else{rv.x%=this.MP.circum_px;}return rv;}}return false;},checkMax:function(u,r){var max={YAHOO_MAP:YMapConfig.tileReg.length,YAHOO_SAT:YMapConfig.tileSat.length,YAHOO_HYB:YMapConfig.tileHyb.length};return((r>max[u]-1)?max[u]-1:r);},setTileServer:function(_u,r){var pos=this.checkMax(_u,r);var _s={YAHOO_MAP:YMapConfig.tileReg[pos],YAHOO_SAT:YMapConfig.tileSat[pos],YAHOO_HYB:YMapConfig.tileHyb[pos]};this.tileServer=_u||YMapConfig.tileReg[pos];if(_s[_u]){this.tileServer=_s[_u];}},_setParentContainer:function(_c){this.id=_c.id=(_c.id)?_c.id:"ymapid"+YUtility.getRandomID();this._setYMapOn(_c);var _s={position:"relative",overflow:"hidden",background:"#f1f1f1"};YUtility.setStyle(_c,_s);this.dom=_c;this.dom.tabIndex=2;if(!this.subContainer){this._setSubContainer();}this._setTileXY();},setFocus:function(){this.dom.focus();},_setSubContainer:function(_p){this.subContainer=YUtility.createNode("div");this._setCanvas();var _s1={position:"absolute",zIndex:0,left:"0px",top:"0px"};YUtility.setStyle(this.subContainer,_s1);YUtility.appendNode(this.dom,this.subContainer);},getCoordPoint:function(){return(new YCoordPoint(this.subContainer.style.left,this.subContainer.style.top));},_setYMapOn:function(_c){_c._ymapset=true;},_setCanvas:function(){if(!YUtility.browser.id){if(!document._ymapset){document.namespaces.add("v","urn:schemas-microsoft-com:vml","#default#VML");}document._ymapset=1;}},_setTileXY:function(){var _x=Math.ceil(((YMapConfig.tileXY*Math.ceil(this.YSize.width/YMapConfig.tileXY))/YMapConfig.tileXY)/2);var _y=Math.ceil(((YMapConfig.tileXY*Math.ceil(this.YSize.height/YMapConfig.tileXY))/YMapConfig.tileXY)/2);this._xyFill=new YSize(_x,_y);},_getContainerSize:function(_c,_s){if(_s){this.setContainerSize(_c,_s);return _s;}return this._sizeCheck(YUtility.getSize(_c),_c);},_sizeCheck:function(_s,_c){var _dYSize=new YSize(400,400);if(!_s.width||!_s.height){_s.width=_s.height=_dYSize.width;this.setContainerSize(_c,_dYSize);return _s;}return _s;},setContainerSize:function(_c,_s){var _wh={"width":_s.width+"px","height":_s.height+"px"};YUtility.setStyle(_c,_wh);},_addTile:function(_n,_k,_m){YUtility.appendNode(this.subContainer,_n);},_ipA:function(o,k,i){k=k||(YUtility._xyKey(o.tx,o.ty,this.zoomLevel,this._mapType));if(i){this._vueTbl[k]=new TileXY(o.tx,o.ty,o.x,o.y);}else{this._posTbl[k]=new TileXY(o.tx,o.ty,o.x,o.y);}},_getSrc:function(x,y){var _ru=this.tileServer+"x="+x+"&y="+y+"&z="+this.zoomLevel;return _ru;},_browserTile:function(_t,_o){var _s={position:"absolute",padding:"0px",cursor:"pointer",margin:"0px",width:YMapConfig.tileSize+"px",height:YMapConfig.tileSize+"px",zIndex:0,left:_o.x+"px",top:_o.y+"px"};YUtility.setStyle(_t,_s);YUtility.setStyle(_t,"cursor","pointer");_t.tx=_o.tx;_t.ty=_o.ty;if(YUtility.browser.id){YUtility.setStyle(_t,"visibility","hidden");_t.onload=function(){YUtility.setStyle(_t,"visibility","visible");};}},_tileRandom:0,_getTile:function(_o){var _k=YUtility._xyKey(_o.tx,_o.ty,this.zoomLevel,this._mapType);this._ipA(_o,_k);if(this._mapType==YAHOO_MAP_HYB){var _k1=YUtility._xyKey(_o.tx,_o.ty,this.zoomLevel,YAHOO_MAP_SAT);this.__loadTiles(_o,_k1,YAHOO_MAP_SAT);var _k2=YUtility._xyKey(_o.tx,_o.ty,this.zoomLevel,YAHOO_MAP_HYB);this.__loadTiles(_o,_k2,YAHOO_MAP_HYB);}else{var _k3=YUtility._xyKey(_o.tx,_o.ty,this.zoomLevel,this._mapType);this.__loadTiles(_o,_k3,this._mapType);}this._tileRandom++;if(this._tileRandom==4){this._tileRandom=0;}},__loadTiles:function(_o,_k,_m){this.setTileServer(_m,this._tileRandom);var _f=this.MP.xy_to_ll(_o.tx,_o.ty,128,128);var _r=this.MP.ll_to_xy(_f);if(_r.tx!=_o.tx){var kv=YUtility._xyKey(_r.tx,_o.ty,this.zoomLevel,this._mapType);this._ipA(new TileXY(_r.tx,_o.ty,_o.x,_o.y),kv,1);}if(!this._tileCache[_k]){var _t;if(!YUtility.browser.id){_t=YUtility.createNode("div");var url=this._getSrc(_r.tx,_o.ty);_t._iefix=YUtility.createNode("img");_t._iefix.onload=function(){_t.style.filter=YUtility.alphaImg2(url);};_t._iefix.src=url;}else{_t=YUtility.createNode("img");_t.src=this._getSrc(_r.tx,_o.ty);}this._browserTile(_t,_o);this._tileCache[_k]=_o;if(_m==YAHOO_MAP_HYB){this._tileCache[_k]._h=_t;}else{this._tileCache[_k]._t=_t;}this._addTile(_t,_k,_m);}},_callTiles:function(_f){var _cx=parseInt(this.YSize.width/2-this._txy.x,10);var _cy=parseInt(this.YSize.height/2-YMapConfig.tileXY+this._txy.y,10);var _cxy=new YCoordPoint(_cx,_cy);if(_f){var ckey=YUtility._xyKey(this._txy.tx,this._txy.ty,this.zoomLevel,this._mapType);_cxy=this._posTbl[ckey];}for(var xI=0;xI<=this._xyFill.width;xI++){for(var yI=0;yI<=this._xyFill.height;yI++){var tx=this._txy.tx+xI;var ty=this._txy.ty+yI;var key=YUtility._xyKey(tx,ty,this.zoomLevel,this._mapType);if(this._tileCache[key]){continue;}this._getTile(new TileXY(tx,ty,_cxy.x+(xI*YMapConfig.tileXY),_cxy.y+(-yI*YMapConfig.tileXY)));}}for(var xI=-this._xyFill.width;xI<=this._xyFill.width;xI++){for(var yI=-this._xyFill.height;yI<=this._xyFill.height;yI++){var tx=this._txy.tx+xI;var ty=this._txy.ty+yI;var key=YUtility._xyKey(tx,ty,this.zoomLevel,this._mapType);if(this._tileCache[key]){continue;}this._getTile(new TileXY(tx,ty,_cxy.x+(xI*YMapConfig.tileXY),_cxy.y+(-yI*YMapConfig.tileXY)));}}},_cleanTileCache:function(partial){for(var i in this._tileCache){if(partial&&this.bO.inB(this._tileCache[i].tx,this._tileCache[i].ty)&&this._tileCache[i]._t){continue;}if(this._tileCache[i]._h){if(this._tileCache[i]._h._iefix){this._tileCache[i]._h._iefix=null;}YUtility.removeNode(this._tileCache[i]._h);}if(this._tileCache[i]._t){if(this._tileCache[i]._t._iefix){this._tileCache[i]._t._iefix=null;}YUtility.removeNode(this._tileCache[i]._t);}delete this._tileCache[i];}},_clearView:function(u){if(u&&YUtility.browser.id){return ;}if(!u){for(var m in this._mTb){if(this._mTb[m].setGeoXYPoint){this._mTb[m].setGeoXYPoint();}}}else{for(var m in this._mTb){if(this._mTb[m]._destroy){this._mTb[m]._destroy(1);}}for(var p in this._pTb){if(this._pTb[p].setGeoXYPoint){this._pTb[p]._destroy();}}}this._cleanTileCache();for(var p in this._posTbl){if(this._posTbl[p].tx){delete this._posTbl[p];}}},_adjustSubContPos:function(_c){var _s={left:_c.x+"px",top:_c.y+"px"};if(this.subContainer){YUtility.setStyle(this.subContainer,_s);}},_setProjection:function(){this.MP=new MercatorProjection(this.zoomLevel,YMapConfig.tileXY);this._txy=this.MP.ll_to_xy(this.YGeoPoint);this.YCoordPoint=new YCoordPoint(this.YSize.width/2,this.YSize.height/2);},_draw:function(){if(!this.YGeoPoint){return ;}this._adjustSubContPos(new YCoordPoint(0,0));this._clearView();this._setProjection();this.bO=new _setBounds(this._txy.tx,this._txy.ty,this._xyFill.width,this._xyFill.height);this._callTiles();this._adjustOverlay(1);this._updateGeoBox();},_updateGeoBox:function(){var bSW=this.MP.xy_to_ll(this._txy.tx,this._txy.ty,this._txy.x+this.YSize.width/2,this._txy.y-this.YSize.height/2);var bNE=this.MP.xy_to_ll(this._txy.tx,this._txy.ty,this._txy.x-this.YSize.width/2,this._txy.y+this.YSize.height/2);if(this.MP.circum_px<=this.YSize.width){bSW.Lon=-180;bNE.Lon=180;}bSW.setgeobox(bNE);this._geoBox=bSW;},_gLC:function(){this.bO.abL();for(var tb=this.bO.bB;tb<=this.bO.bT;tb++){var key=YUtility._xyKey(this.bO.pbL,tb,this.zoomLevel,this._mapType);if(this._posTbl[key]){this._getTile(new TileXY(this.bO.bL,tb,this._posTbl[key].x-YMapConfig.tileXY,this._posTbl[key].y));}}this.bO.sbR();},_gRC:function(){this.bO.abR();for(var tb=this.bO.bB;tb<=this.bO.bT;tb++){var key=YUtility._xyKey(this.bO.pbR,tb,this.zoomLevel,this._mapType);if(this._posTbl[key]){this._getTile(new TileXY(this.bO.bR,tb,this._posTbl[key].x+YMapConfig.tileXY,this._posTbl[key].y));}}this.bO.sbL();},_gTR:function(){this.bO.abT();for(var tb=this.bO.bL;tb<=this.bO.bR;tb++){var key=YUtility._xyKey(tb,this.bO.pbT,this.zoomLevel,this._mapType);if(this._posTbl[key]){this._getTile(new TileXY(tb,this.bO.bT,this._posTbl[key].x,this._posTbl[key].y-YMapConfig.tileXY));}}this.bO.sbB();},_gBR:function(){this.bO.abB();for(var tb=this.bO.bL;tb<=this.bO.bR;tb++){var key=YUtility._xyKey(tb,this.bO.pbB,this.zoomLevel,this._mapType);if(this._posTbl[key]){this._getTile(new TileXY(tb,this.bO.bB,this._posTbl[key].x,this._posTbl[key].y+YMapConfig.tileXY));}}this.bO.sbT();},_pan:function(iX,iY,_r){var _x=YUtility.getInt(iX);var _y=YUtility.getInt(iY);if(!_x&&!_y||!this.bO){return ;}var t=this.subContainer;var pL=YUtility.getInt(t.style.left)+_x;var pT=YUtility.getInt(t.style.top)+_y;t.style.left=(pL)+"px";t.style.top=(pT)+"px";var nR,nB,nL,nT;var kR=YUtility._xyKey(this.bO.bR,this.bO.bT,this.zoomLevel,this._mapType);var kB=YUtility._xyKey(this.bO.bL,this.bO.bB,this.zoomLevel,this._mapType);if(this._posTbl[kR]){nR=this._posTbl[kR].x;}if(this._posTbl[kB]){nB=this._posTbl[kB].y;}if(this._posTbl[kB]){nL=this._posTbl[kB].x;}if(this._posTbl[kR]){nT=this._posTbl[kR].y;}if((nL+pL)>-YMapConfig.tileXY){this._gLC();}if((nR+pL)<this.YSize.width){this._gRC();}if((nT+pT)>-YMapConfig.tileXY){this._gTR();}if((nB+pT)<this.YSize.height){this._gBR();}this._panUpdate(_x,_y,_r);this._totalX+=_x;this._totalY+=_y;this._myTX+=_x;this._myTY+=_y;},_panUpdate:function(x,y,_r){if(!x&&!y){return ;}var _x=x;var _y=y;if(_r){_x=0;_y=0;}this._txy.tx=this._txy.tx-_x/YMapConfig.tileXY;this._txy.ty=this._txy.ty+_y/YMapConfig.tileXY;this.YGeoPoint=this.MP.xy_to_ll(this._txy.tx,this._txy.ty,this._txy.x,this._txy.y);this._updateGeoBox();},_drag:function(){if(!this._dragObject){this._dragObject=new YAHOO.util.DDProxy(this.dom.id);this._dragObject.scroll=false;}var that=this;var ox,oy;that._dragObject.onDrag=function(_e){YEvent.stopDefault(_e);that.dragOn=true;var _ex=_e.clientX;var _ey=_e.clientY;if(YUtility.browser.id==0||YUtility.browser.id==4){_ex=_ex+(document.compatMode=="BackCompat"?document.body.scrollLeft:document.documentElement.scrollLeft);_ey=_ey+(document.compatMode=="BackCompat"?document.body.scrollTop:document.documentElement.scrollTop);}else{_ex=_ex+window.pageXOffset;_ey=_ey+window.pageYOffset;}var pos={x:_ex-ox,y:_ey-oy};ox=_ex;oy=_ey;with(that){_pan(pos.x,pos.y);var _ce=(new _eO(that,YGeoPoint,{previous:zoomLevelPrev,current:zoomLevel}));Events.onPan.trigger(_ce);}};that._dragObject.endDrag=function(_e){with(that){var _ce=(new _eO(that,YGeoPoint,{previous:zoomLevelPrev,current:zoomLevel}));Events.endPan.trigger(_ce);}};that._dragObject.b4StartDrag=function(_e){};that._dragObject.startDrag=function(_ex,_ey){ox=_ex;oy=_ey;with(that){var _ce=(new _eO(that,YGeoPoint,{previous:zoomLevelPrev,current:zoomLevel}));Events.startPan.trigger(_ce);}};},isZoomChanged:function(z){var c=this.zoomLevel;var p=z?z:this.zoomLevelPrev;return(p&&Math.abs(p-c));},startSet:false,drawZoomAndCenter:function(o,z){var otype="draw";this.zoomLevel=this.isValidZoomLevel(z)?YUtility.getInt(z):5;if(!this.zoomLevelPrev){otype="start";this.zoomLevelPrev=this.zoomLevel;}if(typeof (o)=="string"){this._startGeoCode(o,10);}else{if(o){this.YGeoPoint=new YGeoPoint(o.Lat,o.Lon);this._draw();this._drag();var _ce=(new _eO(this,this.YGeoPoint,{previous:this.zoomLevelPrev,current:this.zoomLevel}));if(this.isZoomChanged()){this.Events.changeZoom.trigger(_ce);otype="zoom_ob";}else{otype=this.startSet?"draw":"start";}this.Events.endMapDraw.trigger(_ce);if(!this._disableTrack){if(otype=="zoom_ob"){var f=trackDelay(this,otype,this.YGeoPoint);if(!trackTr){trackTr=setTimeout(f,trackDl);}}else{if(otype=="start"){this.startSet=true;}YUtility.tracker(this,otype);}}}}this.zoomLevelPrev=this.zoomLevel;},dragOn:false,panToLatLon:function(geo,z){if(this.dragOn){return ;}var _zoom=z?z:this.zoomLevel;var _lldiff=geo.pointDiff(this.YGeoPoint);var _units=this.getUnitsPerPixel(_zoom);var _xdiff=Math.ceil(_lldiff.Lon/_units.longitude);var _ydiff=Math.ceil(_lldiff.Lat/_units.latitude);var _panMax=1.5;if(this.isZoomChanged(z)||(Math.abs(_xdiff)>this.YSize.width*_panMax||Math.abs(_ydiff)>this.YSize.height*_panMax)){this.drawZoomAndCenter(geo,_zoom);}else{this.smoothPan(new YCoordPoint(_xdiff,_ydiff));}},smoothPan:function(_cp,f){var attributes={};var _f=(f)?f:10;var _anm=new YAHOO.util.Motion(this.subContainer,attributes,_f,YAHOO.util.Easing.easeNone);_anm.useSeconds=false;var that=this;_anm.onStart.subscribe(function(){with(that){var _ce=(new _eO(that,YGeoPoint,{previous:zoomLevelPrev,current:zoomLevel}));Events.startAutoPan.trigger(_ce);}});_anm.onTween.subscribe(function(){with(that){var _ce=(new _eO(that,YGeoPoint,{previous:zoomLevelPrev,current:zoomLevel}));_pan(_cp.x/_f,_cp.y/_f);Events.onPan.trigger(_ce);}});_anm.onComplete.subscribe(function(){with(that){var _ce=(new _eO(that,YGeoPoint,{previous:zoomLevelPrev,current:zoomLevel}));Events.endAutoPan.trigger(_ce);}});_anm.animate();},_pointPan:function(_cp){this.smoothPan(_cp);},_smoothPan:function(_cp){this.smoothPan(_cp);},addOverlay:function(o){if(!o){throw ("Error: attempting to add invalid overlay object!");}if(o.YGeoPoint){o.setMapObject(this);o.setGeoXYPoint(this.zoomLevel,this._posTbl);if(o.polyline&&!this._pTb[o.id]){YUtility.appendNode(this.subContainer,o);this._pTb[o.id]=o;var _ce=new _eO(this,this.YGeoPoint);this.Events.polylineAdded.trigger(_ce);}else{if(!this._mTb[o.id]){YUtility.appendNode(this.subContainer,o);this._mTb[o.id]=o;if(!markerTr){var f=checkMarkerAdded(this,"poi");markerTr=setTimeout(f,trackDl);}}}}else{if(o.YCoordPoint){o.setMapObject(this);o.assignCoordPoint();if(!this._coordTable){this._coordTable=[];}if(!this._coordTable[o.id]){YUtility.appendNode(this,o);}this._coordTable[o.id]=o;}else{if(o.GeoRSS){this._startGeoRSS(o,1);return ;}}}YUtility.alphaLoad(o);},processGeoRSS:function(o){this._startGeoRSS(o,2);},searchLocal:function(g,q,r,n){this._startGeoSearch(g,1,r,q,n);},searchTraffic:function(g,r){this._startGeoSearch(g,2,r);},removeOverlay:function(o){if(o&&o.dom){if(o.polyline){var _ce=new _eO(this,this.YGeoPoint);this.Events.polylineRemoved.trigger(_ce);delete this._pTb[o.id];}YUtility.removeNode(o.dom);delete this._mTb[o.id];}else{if(typeof (o)=="string"){if(this._coordTable[o]){var _obj=this._coordTable[o];YUtility.removeNode(_obj.dom);delete this._coordTable[o];}}}},addXY:function(_cp){var m=document.createElement("img");m.id="xypt"+Math.random();m.src=YMapConfig.marker2;var _s={"position":"absolute","left":_cp.x,"top":_cp.y,"zIndex":3};YUtility.setStyle(m,_s);YUtility.appendNode(this.dom,m);},getEventsList:function(){return EventsList;},convertLatLonXY:function(gp){return this._ll2xy(gp);},convertXYLatLon:function(cpt){return this._xy2ll(cpt);},removeFromMap:function(id){YUtility.removeNode(YUtility.getByID(id));},addMarker:function(a,b){if(typeof (a)=="string"){this._startGeoCode(a,11);}else{this.addOverlay(new Marker(a,b));}},getZoomFromDegreePerPixel:function(degppx,uppx){return Math.ceil(1+Math.log(degppx/(uppx))/Math.log(2));},getZoomLevel:function(gpa,gpb,cs){var _a,_b;if(typeof (gpa)=="object"&&gpa.distance){var w=this.YSize.width;var up=this.getUnitsPerPixel();var upn=(gpa.distance*2)/w;return this.getZoomFromDegreePerPixel(upn,this.getUnitsPerPixel(1).miles);}if(gpa&&!gpb){var _o=this.getGeoBox(gpa);_a=_o.min;_b=_o.max;}else{_a=gpa;_b=gpb;}if(_a&&_b){var tcs=this.YSize;if(cs){tcs=cs;}if(_a&&!_a.setgeobox){_a=new YGeoPoint(_a.Lat,_a.Lon);_b=new YGeoPoint(_b.Lat,_b.Lon);}_a.setgeobox(_b);var c1=this.getBoxGeoCenter(_a,_b);if(!this.YGeoPoint){this.YGeoPoint=new YGeoPoint(c1.Lat,c1.Lon);}var lnpx=(_a.LonMax-_a.LonMin)/(tcs.width-tcs.height/10);var ltpx=(_a.LatMax-_a.LatMin)/(tcs.height-tcs.width/10);if(!lnpx){return 1;}var zmlon=this.getZoomFromDegreePerPixel(lnpx,this.getUnitsPerPixel(1).longitude);var zmlat=this.getZoomFromDegreePerPixel(ltpx,this.getUnitsPerPixel(1).latitude);var rz=(zmlon>zmlat)?zmlon:zmlat;return Math.abs(rz);}return parseInt(this.zoomLevel,10);},getBestZoomAndCenter:function(a){var z=this.getZoomLevel(a);var c=this.getCenterGeoPoint(a);return{zoomLevel:z,YGeoPoint:c};},getGeoBox:function(a){var o={};o.max=o.min=new YGeoPoint();if(!a.length){return o;}o.min=new YGeoPoint(a[0].Lat,a[0].Lon);o.max=new YGeoPoint(a[0].Lat,a[0].Lon);for(var k in a){var n=a[k];if(n.Lat<o.min.Lat){o.min.Lat=n.Lat;}if(n.Lat>o.max.Lat){o.max.Lat=n.Lat;}if(n.Lon<o.min.Lon){o.min.Lon=n.Lon;}if(n.Lon>o.max.Lon){o.max.Lon=n.Lon;}}return o;},getCenterGeoPoint:function(a){return this.getCenterPoint(a);},getCenterPoint:function(a){var _o=this.getGeoBox(a);var _c=(_o)?this.getBoxGeoCenter(_o.min,_o.max):new YGeoPoint();return _c;},getGeoBoxCenter:function(a,b){return this.getBoxGeoCenter(a,b);},getBoxGeoCenter:function(a,b){var _a=(a.Lat+b.Lat)/2;var _b=(a.Lon+b.Lon)/2;return(new YGeoPoint(_a,_b));},getFixedOverlayIDs:function(){var a=[];for(var p in this._coordTable){if(this._coordTable[p].YCoordPoint){a.push(p);}}return a;},getPolylineIDs:function(){var a=[];for(var p in this._pTb){if(this._pTb[p].YGeoPoint){a.push(p);}}return a;},getPolylineObject:function(k){return this._pTb[k];},getMarkerById:function(k){return this._mTb[k];},getMarkerObject:function(k){return this._mTb[k];},hideAllMarkers:function(){for(var k in this._mTb){var o=this._mTb[k];if(o.YGeoPoint){if(!o.ishidden()){o.hide();o.selective=true;}}}},unhideAllMarkers:function(){for(var k in this._mTb){var o=this._mTb[k];if(o.YGeoPoint&&o.selective){if(o.ishidden()){o.unhide();}}}},isMarkerInView:function(o){if(!o||!o.YGeoPoint){return false;}var p=this.convertLatLonXY(o.YGeoPoint);return(p.x>0&&p.x<this.YSize.width&&p.y>0&&p.y<this.YSize.height);},getMarkerCount:function(){var c=0;for(var m in this._mTb){var o=this._mTb[m];if(o.YGeoPoint&&!o.ishidden()){if(this.isMarkerInView(o)){c++;}}}return c;},getMarkerIDs:function(){var a=[];for(var m in this._mTb){if(this._mTb[m].YGeoPoint){a.push(m);}}return a;},getMarkerTable:function(){return this._mTb;},removeMarkersAll:function(){if(_expCache){_expCache._destroy();_expCache=null;}for(var m in this._mTb){if(this._mTb[m]._destroy){this._mTb[m]._destroy();delete this._mTb[m];}}if(this._mTb.length){return false;}return true;},removeMarker:function(m){if(this._mTb[m]&&this._mTb[m]._destroy){this._mTb[m]._destroy();delete this._mTb[m];return true;}return false;},getOuterRadius:function(){return(YUtility.getInt(this.YSize.width>this.YSize.height?this.YSize.width:this.YSize.height))/2;},getInnerRadius:function(){return(YUtility.getInt(this.YSize.width>this.YSize.height?this.YSize.height:this.YSize.width))/2;},_adjustOnResize:function(_ns){var _pYSize=this.YSize;this.YSize=_ns;var _dx=(this.YSize.width-_pYSize.width)/2;var _dy=(this.YSize.height-_pYSize.height)/2;if(!_dx&&!_dy){return ;}this._setTileXY();this._updateGeoBox();this._setProjection();this.bO=new _setBounds(this._txy.tx,this._txy.ty,this._xyFill.width,this._xyFill.height);this._callTiles(true);this._pan(_dx,_dy,false);},resizeTo:function(ys){if(ys){this._adjustOnResize(this._getContainerSize(this.dom,ys));}},moveByXY:function(cpt){this._pan(cpt.x,cpt.y);},smoothMoveByXY:function(cpt,f){this.smoothPan(cpt,f?f:1);},panToXY:function(np){var op=new YCoordPoint(this.YSize.width/2,this.YSize.height/2);for(var i=1;i<arguments.length;i++){if(typeof arguments[i]=="object"){op=arguments[i];}}var xd=Math.floor(op.x-np.x);var yd=Math.floor(op.y-np.y);this.smoothPan(new YCoordPoint(-xd,-yd));},getBounds:function(){return this._geoBox;},getBoundsLatLon:function(){return this._geoBox;},getPortSize:function(){return this.YSize;},getContainerSize:function(){return this.YSize;},getCenterLatLon:function(){return this.YGeoPoint;},getUnitsPerPixel:function(z){var zm=z||this.zoomLevel;var mp=new MercatorProjection(zm);var km=(this.YGeoPoint)?mp.mpp_m(this.YGeoPoint.Lat)/1000:0;var mi=(this.YGeoPoint)?mp.mpp_m(this.YGeoPoint.Lat)/1609.344:0;var lonppx=1/mp.x_per_lon_;var latppx=lonppx*0.794370211280205;return{miles:mi,kilometers:km,latitude:latppx,longitude:lonppx};},showSmartWindow:function(gp,cin,id){if(!gp||!cin){return ;}var im=new YImage();im.src=YMapConfig.marker9;im.size=new YSize(0,0);im.offsetSmartWindow=new YCoordPoint(0,0);var marker=new Marker(gp,id,im);this.addOverlay(marker);marker.openSmartWindow(cin);},isDragMapEnabled:function(){return !this._disableDrag;},disableDragMap:function(){if(this._dragObject){this._dragObject.lock();}this._disableDrag=true;for(var i in this._tileCache){if(this._tileCache[i]._t){YUtility.setStyle(this._tileCache[i]._t,"cursor","default");}}},enableDragMap:function(){if(this._dragObject){this._dragObject.unlock();}this._disableDrag=false;for(var i in this._tileCache){if(this._tileCache[i]._t){YUtility.setStyle(this._tileCache[i]._t,"cursor","move");}}},enableKeyControls:function(){this.setFocus();this._disableKeys=false;},disableKeyControls:function(){this._disableKeys=true;},disableTracking:function(){this._disableTrack=true;},enableTracking:function(){this._disableTrack=false;},geoCodeAddress:function(s){this._startGeoCode(s);},__end:function(){}};YUtility.containerResize=function(panelElId,handleElId,sGroup){if(handleElId){this.init(panelElId,sGroup);this.handleElId=handleElId;this.setHandleElId(handleElId);}};YUtility.containerResize.prototype=new YAHOO.util.DragDrop();YUtility.containerResize.prototype.onMouseDown=function(e){var panel=this.getEl();this.startWidth=panel.offsetWidth;this.startHeight=panel.offsetHeight;this.startPos=[YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e)];};YUtility.containerResize.prototype.onDrag=function(e){var newPos=[YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e)];var offsetX=newPos[0]-this.startPos[0];var offsetY=newPos[1]-this.startPos[1];var newWidth=Math.max(this.startWidth+offsetX,10);var newHeight=Math.max(this.startHeight+offsetY,10);var panel=this.getEl();panel.style.width=newWidth+"px";panel.style.height=newHeight+"px";};var Debug=function(i){this.id=i||"ymapdebug";this._count=0;this.initSize(new YSize(200,200));this.initPos(new YCoordPoint(10,10));};Debug.prototype.initPos=function(yc){this._x=yc.x;this._y=yc.y;};Debug.prototype.initSize=function(ys){this._w=ys.width;this._h=ys.height;};Debug.prototype.print=function(inp){this._count=0;if(!this._p){this._p=document.getElementById(this.id);this._p=YUtility.createNode("div");this._p.id=this.id;this._p.style.position="absolute";this._p.style.background="#EEEEEE";this._p.style.filter="alpha(opacity=1)";this._p.style.opacity=1;this._p.style.width=this._w;this._p.style.height=this._h;this._p.style.left=this._x;this._p.style.top=this._y;this._p.style.zIndex=999;this._p.style.borderStyle="solid";if(!YUtility.browser.id){this._p.style.overflow="auto";}var _h=YUtility.createNode("div","yloghd");var hs={backgroundColor:"#EEE000",position:"absolute",overflow:"visible",zIndex:999,bottom:-5,right:-5,width:15,height:15};YUtility.setStyle(_h,hs);var _l=YUtility.createNode("div");_l.style.borderWidth="1px";_l.style.padding="1px";_l.style.borderStyle="solid";var _c=YUtility.createNode("img","ylogx");_c.src=YMapConfig.imgPrefixURL+"x.gif";_c.style.position="absolute";_c.style.right="3px";_c.style.top="3px";YEvent.Capture(_c,EventsList.MouseClick,this._MouseClickRun,this,"click");var _t=YUtility.createNode("div");_t.innerHTML="<b>Yahoo! Maps API Logger</b>";_t.style.background="#EEE000";_t.style.width="98%";_t.style.paddingLeft="3px";YUtility.appendNode(_t,_c);YUtility.appendNode(this._p,_t);YUtility.appendNode(this._p,_l);YUtility.appendNode(this._p,_h);YUtility.appendNode(document.body,this._p);if(!this._o){this._o=YUtility.createNode("div","ylogmn");if(YUtility.browser.id){this._o.style.height="90%";}this._o.style.background="#EEEEEE";this._o.style.filter="alpha(opacity=75)";this._o.style.opacity=0.75;if(YUtility.browser.id){this._o.style.overflow="auto";}YUtility.appendNode(this._p,this._o);}}if(YUtility.browser.id){var _d=new YAHOO.util.DD(this._p.id);var _r=new YUtility.containerResize(this.id,"yloghd");}else{var _r=new YUtility.containerResize(this.id,"yloghd");var _d=new YAHOO.util.DD(this._p.id);}YEvent.Capture(this._o,EventsList.MouseDown,function(_e){YEvent.stopPropag(_e);},null,"mousedown");var t=typeof inp;if(this._o){this._o.innerHTML+="<div>";if(t=="object"||t=="array"){for(var o in inp){this._o.innerHTML+=this._count+". <b>"+o+"</b> :: "+inp[o]+"<br>";this._count++;}}else{this._o.innerHTML+=this._count+". "+inp;this._count++;}this._o.innerHTML+="</div>";}};Debug.prototype._MouseClickRun=function(){this.hide();};Debug.prototype.hide=function(){this._p.style.visibility="hidden";};Debug.prototype.write=function(inp){this.print(inp);};function Exporter(o){var _E=o||window;_E.YMapConfig=YMapConfig;_E.YOverlay=Overlay;_E.YAnnotation=Annotation;_E.YMapTypeControl=TypeControl;_E.YMapDistance=MapDistance;_E.YCoordPoint=YCoordPoint;_E.YGeoPoint=YGeoPoint;_E.YImage=YImage;_E.YSize=YSize;_E.YEvent=YEvent;_E.YMarker=Marker;_E.YPolyline=Polyline;_E.YSmartWindow=SmartWindow;_E.YCustomOverlay=CustomOverlay;_E.YUtility=YUtility;_E.YGeoCode=GeoCode;_E.YGeoRSS=GeoRSS;_E.YGeoSearch=GeoSearch;_E.YMap=Map;_E.EventsList=EventsList;_E.YLog=new Debug("ymaplog");}Exporter();}YahooMapsAPIAjax();
+
+
+
+if(!window.I18nMsg){I18nMsg={}
+}I18nMsg.currencyCode="USD";
+I18nMsg.currencySymbol="$";
+I18nMsg.eraAD="AD";
+I18nMsg.eraBC="BC";
+I18nMsg.firstDayOfWeek="1";
+I18nMsg.formatDateFull="EEEE, MMMM d, yyyy";
+I18nMsg.formatDateLong="MMMM d, yyyy";
+I18nMsg.formatDateMedium="MMM d, yyyy";
+I18nMsg.formatDateShort="M/d/yy";
+I18nMsg.formatDateTime="{0} {1}";
+I18nMsg.formatNumber="#,##0.###";
+I18nMsg.formatNumberCurrency="\u00a4#,##0.00;(\u00a4#,##0.00)";
+I18nMsg.formatNumberInteger="#,##0";
+I18nMsg.formatNumberPercent="#,##0%";
+I18nMsg.formatTimeFull="h:mm:ss a z";
+I18nMsg.formatTimeLong="h:mm:ss a z";
+I18nMsg.formatTimeMedium="h:mm:ss a";
+I18nMsg.formatTimeShort="h:mm a";
+I18nMsg.monthAprLong="April";
+I18nMsg.monthAprMedium="Apr";
+I18nMsg.monthAugLong="August";
+I18nMsg.monthAugMedium="Aug";
+I18nMsg.monthDecLong="December";
+I18nMsg.monthDecMedium="Dec";
+I18nMsg.monthFebLong="February";
+I18nMsg.monthFebMedium="Feb";
+I18nMsg.monthJanLong="January";
+I18nMsg.monthJanMedium="Jan";
+I18nMsg.monthJulLong="July";
+I18nMsg.monthJulMedium="Jul";
+I18nMsg.monthJunLong="June";
+I18nMsg.monthJunMedium="Jun";
+I18nMsg.monthMarLong="March";
+I18nMsg.monthMarMedium="Mar";
+I18nMsg.monthMayLong="May";
+I18nMsg.monthMayMedium="May";
+I18nMsg.monthNovLong="November";
+I18nMsg.monthNovMedium="Nov";
+I18nMsg.monthOctLong="October";
+I18nMsg.monthOctMedium="Oct";
+I18nMsg.monthSepLong="September";
+I18nMsg.monthSepMedium="Sep";
+I18nMsg.numberInfinity="\u221e";
+I18nMsg.numberNaN="\ufffd";
+I18nMsg.numberSeparatorDecimal=".";
+I18nMsg.numberSeparatorGrouping=",";
+I18nMsg.numberSeparatorMoneyDecimal=".";
+I18nMsg.numberSignMinus="-";
+I18nMsg.numberSignPerMill="\u2030";
+I18nMsg.numberSignPercent="%";
+I18nMsg.numberZero="0";
+I18nMsg.periodAm="AM";
+I18nMsg.periodPm="PM";
+I18nMsg.weekdayFriLong="Friday";
+I18nMsg.weekdayFriMedium="Fri";
+I18nMsg.weekdayMonLong="Monday";
+I18nMsg.weekdayMonMedium="Mon";
+I18nMsg.weekdaySatLong="Saturday";
+I18nMsg.weekdaySatMedium="Sat";
+I18nMsg.weekdaySunLong="Sunday";
+I18nMsg.weekdaySunMedium="Sun";
+I18nMsg.weekdayThuLong="Thursday";
+I18nMsg.weekdayThuMedium="Thu";
+I18nMsg.weekdayTueLong="Tuesday";
+I18nMsg.weekdayTueMedium="Tue";
+I18nMsg.weekdayWedLong="Wednesday";
+I18nMsg.weekdayWedMedium="Wed";
+if(!window.AjxMsg){AjxMsg={}
+}AjxMsg["Africa/Algiers"]="GMT +01:00 West Central Africa";
+AjxMsg["Africa/Cairo"]="GMT +02:00 Egypt";
+AjxMsg["Africa/Casablanca"]="GMT +00:00 Casablanca";
+AjxMsg["Africa/Harare"]="GMT +02:00 Harare / Pretoria";
+AjxMsg["Africa/Monrovia"]="GMT +00:00 Monrovia";
+AjxMsg["Africa/Nairobi"]="GMT +03:00 Nairobi";
+AjxMsg["Africa/Windhoek"]="GMT +01:00 Namibia";
+AjxMsg["America/Anchorage"]="GMT -09:00 Alaska";
+AjxMsg["America/Argentina/Buenos_Aires"]="GMT -03:00 Argentina";
+AjxMsg["America/Bogota"]="GMT -05:00 Colombia";
+AjxMsg["America/Caracas"]="GMT -04:30 Caracas";
+AjxMsg["America/Chicago"]="GMT -06:00 US/Canada Central";
+AjxMsg["America/Chihuahua"]="GMT -07:00 Chihuahua / La Paz / Mazatlan";
+AjxMsg["America/Denver"]="GMT -07:00 US/Canada Mountain";
+AjxMsg["America/Godthab"]="GMT -03:00 Greenland";
+AjxMsg["America/Guatemala"]="GMT -06:00 Central America";
+AjxMsg["America/Guyana"]="GMT -04:00 Georgetown";
+AjxMsg["America/Halifax"]="GMT -04:00 Atlantic Time (Canada)";
+AjxMsg["America/Indiana/Indianapolis"]="GMT -05:00 Indiana (East)";
+AjxMsg["America/La_Paz"]="GMT -04:00 La Paz";
+AjxMsg["America/Los_Angeles"]="GMT -08:00 US/Canada Pacific";
+AjxMsg["America/Manaus"]="GMT -04:00 Manaus";
+AjxMsg["America/Mexico_City"]="GMT -06:00 Guadalajara / Mexico City / Monterrey";
+AjxMsg["America/Montevideo"]="GMT -03:00 Montevideo";
+AjxMsg["America/New_York"]="GMT -05:00 US/Canada Eastern";
+AjxMsg["America/Phoenix"]="GMT -07:00 Arizona";
+AjxMsg["America/Regina"]="GMT -06:00 Saskatchewan";
+AjxMsg["America/Santiago"]="GMT -04:00 Pacific South America";
+AjxMsg["America/Sao_Paulo"]="GMT -03:00 Brasilia";
+AjxMsg["America/St_Johns"]="GMT -03:30 Newfoundland";
+AjxMsg["America/Tijuana"]="GMT -08:00 Tijuana / Baja California";
+AjxMsg["Asia/Amman"]="GMT +02:00 Jordan";
+AjxMsg["Asia/Baghdad"]="GMT +03:00 Iraq";
+AjxMsg["Asia/Baku"]="GMT +04:00 Baku";
+AjxMsg["Asia/Bangkok"]="GMT +07:00 Bangkok, Hanoi, Jakarta";
+AjxMsg["Asia/Beirut"]="GMT +02:00 Beirut";
+AjxMsg["Asia/Colombo"]="GMT +05:30 Sri Jayawardenepura";
+AjxMsg["Asia/Dhaka"]="GMT +06:00 Astana / Dhaka";
+AjxMsg["Asia/Hong_Kong"]="GMT +08:00 Beijing / Chongqing / Hong Kong / Urumqi";
+AjxMsg["Asia/Irkutsk"]="GMT +08:00 Irkutsk, Ulaan Bataar";
+AjxMsg["Asia/Jerusalem"]="GMT +02:00 Jerusalem";
+AjxMsg["Asia/Kabul"]="GMT +04:30 Kabul";
+AjxMsg["Asia/Karachi"]="GMT +05:00 Islamabad / Karachi";
+AjxMsg["Asia/Katmandu"]="GMT +05:45 Kathmandu";
+AjxMsg["Asia/Kolkata"]="GMT +05:30 Chennai, Kolkata, Mumbai, New Delhi";
+AjxMsg["Asia/Krasnoyarsk"]="GMT +07:00 Krasnoyarsk";
+AjxMsg["Asia/Kuala_Lumpur"]="GMT +08:00 Kuala Lumpur / Singapore";
+AjxMsg["Asia/Kuwait"]="GMT +03:00 Kuwait / Riyadh";
+AjxMsg["Asia/Magadan"]="GMT +11:00 Magadan, Solomon Is., New Caledonia";
+AjxMsg["Asia/Muscat"]="GMT +04:00 Abu Dhabi / Muscat";
+AjxMsg["Asia/Novosibirsk"]="GMT +06:00 Almaty, Novosibirsk";
+AjxMsg["Asia/Rangoon"]="GMT +06:30 Rangoon";
+AjxMsg["Asia/Seoul"]="GMT +09:00 Korea";
+AjxMsg["Asia/Taipei"]="GMT +08:00 China, Taiwan";
+AjxMsg["Asia/Tashkent"]="GMT +05:00 Tashkent";
+AjxMsg["Asia/Tbilisi"]="GMT +04:00 Tbilisi";
+AjxMsg["Asia/Tehran"]="GMT +03:30 Tehran";
+AjxMsg["Asia/Tokyo"]="GMT +09:00 Japan";
+AjxMsg["Asia/Vladivostok"]="GMT +10:00 Vladivostok";
+AjxMsg["Asia/Yakutsk"]="GMT +09:00 Yakutsk";
+AjxMsg["Asia/Yekaterinburg"]="GMT +05:00 Yekaterinburg";
+AjxMsg["Asia/Yerevan"]="GMT +04:00 Yerevan";
+AjxMsg["Atlantic/Azores"]="GMT -01:00 Azores";
+AjxMsg["Atlantic/Cape_Verde"]="GMT -01:00 Cape Verde Is.";
+AjxMsg["Atlantic/South_Georgia"]="GMT -02:00 Mid-Atlantic";
+AjxMsg["Australia/Adelaide"]="GMT +09:30 Adelaide (CT)";
+AjxMsg["Australia/Brisbane"]="GMT +10:00 Brisbane";
+AjxMsg["Australia/Darwin"]="GMT +09:30 Darwin";
+AjxMsg["Australia/Hobart"]="GMT +10:00 Hobart";
+AjxMsg["Australia/Perth"]="GMT +08:00 Perth";
+AjxMsg["Australia/Sydney"]="GMT +10:00 Canberra / Melbourne / Sydney";
+AjxMsg["Etc/GMT+12"]="GMT -12:00 Dateline";
+AjxMsg["Europe/Athens"]="GMT +02:00 Athens, Beirut, Bucharest, Istanbul";
+AjxMsg["Europe/Belgrade"]="GMT +01:00 Belgrade / Bratislava / Budapest / Ljubljana / Prague";
+AjxMsg["Europe/Berlin"]="GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna";
+AjxMsg["Europe/Brussels"]="GMT +01:00 Brussels / Copenhagen / Madrid / Paris";
+AjxMsg["Europe/Helsinki"]="GMT +02:00 Helsinki / Kyiv / Riga / Sofia / Tallinn / Vilnius";
+AjxMsg["Europe/London"]="GMT +00:00 GMT Britain, Ireland, Portugal";
+AjxMsg["Europe/Minsk"]="GMT +02:00 Minsk";
+AjxMsg["Europe/Moscow"]="GMT +03:00 Moscow, St. Petersburg, Volgograd";
+AjxMsg["Europe/Warsaw"]="GMT +01:00 Sarajevo / Skopje / Warsaw / Zagreb";
+AjxMsg["Pacific/Auckland"]="GMT +12:00 New Zealand";
+AjxMsg["Pacific/Fiji"]="GMT +12:00 Fiji";
+AjxMsg["Pacific/Guam"]="GMT +10:00 Guam / Port Moresby";
+AjxMsg["Pacific/Honolulu"]="GMT -10:00 Hawaii";
+AjxMsg["Pacific/Midway"]="GMT -11:00 Midway Island / Samoa";
+AjxMsg["Pacific/Tongatapu"]="GMT +13:00 Nuku'alofa";
+AjxMsg.XfnumberLessThanMin="Value must be greater than or equal to {0}.";
+AjxMsg._close="Close";
+AjxMsg._finish="Finish";
+AjxMsg._next="Next";
+AjxMsg._prev="Previous";
+AjxMsg.add="Add";
+AjxMsg.addAll="Add All";
+AjxMsg.ago="ago";
+AjxMsg["calc.dayname.friday"]="fri|friday";
+AjxMsg["calc.dayname.monday"]="mon|monday";
+AjxMsg["calc.dayname.saturday"]="sat|saturday";
+AjxMsg["calc.dayname.sunday"]="sun|sunday";
+AjxMsg["calc.dayname.thursday"]="thu|thur|thurs|thursday";
+AjxMsg["calc.dayname.tuesday"]="tue|tues|tuesday";
+AjxMsg["calc.dayname.wednesday"]="wed|wednesday";
+AjxMsg["calc.monthname.april"]="apr|april";
+AjxMsg["calc.monthname.august"]="aug|august";
+AjxMsg["calc.monthname.december"]="dec|december";
+AjxMsg["calc.monthname.february"]="feb|february";
+AjxMsg["calc.monthname.january"]="jan|january";
+AjxMsg["calc.monthname.july"]="jul|july";
+AjxMsg["calc.monthname.june"]="jun|june";
+AjxMsg["calc.monthname.march"]="mar|march";
+AjxMsg["calc.monthname.may"]="may";
+AjxMsg["calc.monthname.november"]="nov|november";
+AjxMsg["calc.monthname.october"]="oct|october";
+AjxMsg["calc.monthname.september"]="sep|september";
+AjxMsg["calc.ordinal.fifth"]="5th|fifth";
+AjxMsg["calc.ordinal.first"]="1st|first";
+AjxMsg["calc.ordinal.fourth"]="4th|fourth";
+AjxMsg["calc.ordinal.last"]="last";
+AjxMsg["calc.ordinal.second"]="2nd|second";
+AjxMsg["calc.ordinal.third"]="3rd|third";
+AjxMsg.calendarWeekTitle="W";
+AjxMsg.cancel="Cancel";
+AjxMsg.cancelRequest="Cancel Request";
+AjxMsg.confirmTitle="Confirmation";
+AjxMsg.criticalMsg="Critical";
+AjxMsg.dateParsing2DigitStartYear="1936";
+AjxMsg.day="day";
+AjxMsg.days="days";
+AjxMsg.detail="Detail";
+AjxMsg.didNotMatchChoice="Value '{0}' did not match any values for this type.";
+AjxMsg.dismiss="Dismiss";
+AjxMsg["fontFamilyBase1.css"]="arial, helvetica, sans-serif";
+AjxMsg["fontFamilyBase1.display"]="Arial";
+AjxMsg["fontFamilyBase10.css"]="###";
+AjxMsg["fontFamilyBase10.display"]="###";
+AjxMsg["fontFamilyBase2.css"]="bookman old style, new york, times, serif";
+AjxMsg["fontFamilyBase2.display"]="Bookman Old Style";
+AjxMsg["fontFamilyBase3.css"]="Courier New, courier, monaco, monospace, sans-serif";
+AjxMsg["fontFamilyBase3.display"]="Courier New";
+AjxMsg["fontFamilyBase4.css"]="garamond, new york, times, serif";
+AjxMsg["fontFamilyBase4.display"]="Garamond";
+AjxMsg["fontFamilyBase5.css"]="lucida console, sans-serif";
+AjxMsg["fontFamilyBase5.display"]="Lucida Console";
+AjxMsg["fontFamilyBase6.css"]="symbol";
+AjxMsg["fontFamilyBase6.display"]="Symbol";
+AjxMsg["fontFamilyBase7.css"]="tahoma, new york, times, serif";
+AjxMsg["fontFamilyBase7.display"]="Tahoma";
+AjxMsg["fontFamilyBase8.css"]="times new roman, new york, times, serif";
+AjxMsg["fontFamilyBase8.display"]="Times New Roman";
+AjxMsg["fontFamilyBase9.css"]="verdana, helvetica, sans-serif";
+AjxMsg["fontFamilyBase9.display"]="Verdana";
+AjxMsg["fontFamilyIntl1.css"]="###";
+AjxMsg["fontFamilyIntl1.display"]="###";
+AjxMsg["fontFamilyIntl10.css"]="###";
+AjxMsg["fontFamilyIntl10.display"]="###";
+AjxMsg["fontFamilyIntl2.css"]="###";
+AjxMsg["fontFamilyIntl2.display"]="###";
+AjxMsg["fontFamilyIntl3.css"]="###";
+AjxMsg["fontFamilyIntl3.display"]="###";
+AjxMsg["fontFamilyIntl4.css"]="###";
+AjxMsg["fontFamilyIntl4.display"]="###";
+AjxMsg["fontFamilyIntl5.css"]="###";
+AjxMsg["fontFamilyIntl5.display"]="###";
+AjxMsg["fontFamilyIntl6.css"]="###";
+AjxMsg["fontFamilyIntl6.display"]="###";
+AjxMsg["fontFamilyIntl7.css"]="###";
+AjxMsg["fontFamilyIntl7.display"]="###";
+AjxMsg["fontFamilyIntl8.css"]="###";
+AjxMsg["fontFamilyIntl8.display"]="###";
+AjxMsg["fontFamilyIntl9.css"]="###";
+AjxMsg["fontFamilyIntl9.display"]="###";
+AjxMsg.formatCalDate="EEE, MMM d";
+AjxMsg.formatCalDateFull="EEEE, MMMM d, yyyy";
+AjxMsg.formatCalDateLong="EEEE, MMMM d";
+AjxMsg.formatCalDay="M/d ";
+AjxMsg.formatCalHour="{0,choice,0#Midnight|1#{1,time,h a}|12#Noon|13#{1,time,h a}|24#Midnight}";
+AjxMsg.formatCalMonth="MMMM yyyy";
+AjxMsg.formatDateMediumNoYear="MMM dd ";
+AjxMsg.formatShortCalMonth="MMM yyyy";
+AjxMsg.formatSizeAndUnits="{0} {1}";
+AjxMsg.formatWordyDate="EEE, M/d/yy, h:mm a";
+AjxMsg.formatWordyDateToday="'Today,' h:mm a";
+AjxMsg.formatWordyDateYesterday="'Yesterday,' h:mm a";
+AjxMsg.hour="hour";
+AjxMsg.hours="hours";
+AjxMsg.infoMsg="Informational";
+AjxMsg.invalidDateString='Date value must be entered in the form: MM/DD/YYYY or "today", "yesterday" or "tomorrow".';
+AjxMsg.invalidDatetimeString="Date format not understood.";
+AjxMsg.invalidEmailAddr="Value is not a valid email address.";
+AjxMsg.invalidTimeString="Time value must be entered in the form: HH:MM[:SS] [AM|PM]";
+AjxMsg.listSeparator=", ";
+AjxMsg.listSeparatorLast=" and ";
+AjxMsg.loading="Loading...";
+AjxMsg.minute="minute";
+AjxMsg.minutes="minutes";
+AjxMsg.month="month";
+AjxMsg.monthAprShort="A";
+AjxMsg.monthAugShort="A";
+AjxMsg.monthDecShort="D";
+AjxMsg.monthFebShort="F";
+AjxMsg.monthJanShort="J";
+AjxMsg.monthJulShort="J";
+AjxMsg.monthJunShort="J";
+AjxMsg.monthMarShort="M";
+AjxMsg.monthMayShort="M";
+AjxMsg.monthNovShort="N";
+AjxMsg.monthOctShort="O";
+AjxMsg.monthSepShort="S";
+AjxMsg.months="months";
+AjxMsg.no="No";
+AjxMsg.noResults="No results found.";
+AjxMsg.notANumber="Value must be a number.";
+AjxMsg.notAString="Value must be a text string.";
+AjxMsg.notAnInteger="Value must be an integer.";
+AjxMsg.numberFractionExceeded="Fractional digits exceeds total of {0}.";
+AjxMsg.numberLessThanEqualMin="Value must be greater than {0}.";
+AjxMsg.numberLessThanMin="Value must be greater than or equal to {0}.";
+AjxMsg.numberMoreThanEqualMax="Value must be less than {0}.";
+AjxMsg.numberMoreThanMax="Value must be less than or equal to {0}.";
+AjxMsg.numberMustBeNon0Percent="Value must be a percentage between 1 and 100";
+AjxMsg.numberTotalExceeded="Whole digits exceeds total of {0}.";
+AjxMsg.ok="OK";
+AjxMsg.percentageString="{0}%";
+AjxMsg.remove="Remove";
+AjxMsg.removeAll="Remove All";
+AjxMsg.second="second";
+AjxMsg.seconds="seconds";
+AjxMsg.select="Select";
+AjxMsg.setColor="Set";
+AjxMsg.showPassword="Show password";
+AjxMsg.sizeBytes="B";
+AjxMsg.sizeGigaBytes="GB";
+AjxMsg.sizeKiloBytes="KB";
+AjxMsg.sizeMegaBytes="MB";
+AjxMsg.stringLenWrong="Value must be exactly {0} characters long.";
+AjxMsg.stringMismatch="Value did not match valid values.";
+AjxMsg.stringTooLong="Value must be no more than {0} characters long.";
+AjxMsg.stringTooShort="Value must be at least {0} characters long.";
+AjxMsg["timezoneNameAuto-DetectedLong"]="Auto-Detected";
+AjxMsg["timezoneNameAuto-DetectedShort"]="Auto";
+AjxMsg.today="today";
+AjxMsg.tomorrow="tomorrow";
+AjxMsg.valueIsRequired="Value is required";
+AjxMsg.warningMsg="Warning";
+AjxMsg.week="week";
+AjxMsg.weekdayFriShort="F";
+AjxMsg.weekdayMonShort="M";
+AjxMsg.weekdaySatShort="S";
+AjxMsg.weekdaySunShort="S";
+AjxMsg.weekdayThuShort="T";
+AjxMsg.weekdayTueShort="T";
+AjxMsg.weekdayWedShort="W";
+AjxMsg.weeks="weeks";
+AjxMsg.workInProgress="Work In Progress";
+AjxMsg.xFnumberMoreThanMax="Value must be less than or equal to {0}.";
+AjxMsg.xformDateTimeFormat="{0,date} at {0,time}";
+AjxMsg.xformFontColor="Font Color";
+AjxMsg.xformRepeatAdd="+";
+AjxMsg.xformRepeatRemove="-";
+AjxMsg.year="year";
+AjxMsg.years="years";
+AjxMsg.yes="Yes";
+AjxMsg.yesterday="yesterday";
+if(!window.ZMsg){ZMsg={}
+}ZMsg.BAD_JSON_RESPONSE="A network error has occurred.";
+ZMsg.CSFE_SVC_ERROR="A network service error has occurred.";
+ZMsg.EMPTY_RESPONSE="Cannot connect to server.";
+ZMsg.NETWORK_ERROR="A network error has occurred.";
+ZMsg.SOAP_ERROR="A network error has occurred.";
+ZMsg["account.ACCT_NO_SUCH_TAG"]="No such tag exists.";
+ZMsg["account.AUTH_FAILED"]="The username or password is incorrect. Verify that CAPS LOCK is not on, and then retype the current username and password.";
+ZMsg["account.CHANGE_PASSWORD"]="Your password is no longer valid. Please choose a new password.";
+ZMsg["account.INVALID_PASSWORD"]="You have entered an invalid password.";
+ZMsg["account.INVALID_PREF_NAME"]="Invalid preference name.";
+ZMsg["account.INVALID_PREF_VALUE"]="Invalid preference value.";
+ZMsg["account.MAINTENANCE_MODE"]="This account is currently in maintenance mode.";
+ZMsg["account.NO_SUCH_ACCOUNT"]="No such account exists.";
+ZMsg["account.NO_SUCH_SAVED_SEARCH"]="No such saved search exists.";
+ZMsg["account.PASSWORD_CHANGE_TOO_SOON"]="Password cannot be changed too soon.";
+ZMsg["account.PASSWORD_LOCKED"]="Password locked. User not allowed to change password. Please contact your System Administrator.";
+ZMsg["account.PASSWORD_RECENTLY_USED"]="The password you submitted has recently been used. Please choose a different password.";
+ZMsg["account.TOO_MANY_IDENTITIES"]="The identity could not be created because you have exceeded your identity quota.";
+ZMsg.errorEmptyResponse="Received empty response from server";
+ZMsg.errorMaintenanceMode="The account is in maintenance mode";
+ZMsg["formatter.INVALID_FORMAT"]='Invalid file format for file "{0}".';
+ZMsg["formatter.INVALID_TYPE"]='Folder "{1}" cannot contain items of type "{0}".';
+ZMsg["formatter.MISMATCHED_META"]='Meta information for item "{0}" does not match content.';
+ZMsg["formatter.MISMATCHED_SIZE"]='Size of ignored item "{0}" does not match.';
+ZMsg["formatter.MISMATCHED_TYPE"]='Cannot overwrite item "{0}" of different type.';
+ZMsg["formatter.MISSING_BLOB"]='Content for item "{0}" is missing.';
+ZMsg["formatter.MISSING_META"]='Meta information for item "{0}" is missing.';
+ZMsg["formatter.MISSING_VCARD_FIELDS"]='Contact item "{0}" does not contain any fields.';
+ZMsg["formatter.UNKNOWN_ERROR"]='Unknown error for item "{0}": {1}';
+ZMsg["im.Banned"]="You have been banned from the room.";
+ZMsg["im.INVALID_ADDRESS"]="The address is invalid.";
+ZMsg["im.MaxUsers"]="The room has reached capacity.";
+ZMsg["im.MustUseReservedRoomnick"]="You must use a reserved nickname.";
+ZMsg["im.NicknameConflict"]="Someone else is already using your nickname.";
+ZMsg["im.NoSuchRoom"]="No such room.";
+ZMsg["im.NotAMember"]="The room is invite-only, and you aren't a member.";
+ZMsg["im.NotAllowed"]="You are not allowed to create the room.";
+ZMsg["im.PasswordRequired"]="A password is required to enter the room.";
+ZMsg["im.Unknown"]="Unknown error.";
+ZMsg["im.forbidden"]="Forbidden.";
+ZMsg["im.internal_server_error"]="An internal server error occurred.";
+ZMsg["im.item_not_found"]="The user was not found. The message may not have been sent.";
+ZMsg["im.jid_malformed"]="The address is invalid.";
+ZMsg["im.not_acceptable"]="The message is not acceptable.";
+ZMsg["im.not_allowed"]="You are not allowed to send a message to the intended recipient.";
+ZMsg["im.payment_required"]="Payment required.";
+ZMsg["im.recipient_unavailable"]="The recipient is unavailable.";
+ZMsg["im.redirect"]="The user is at a different address.";
+ZMsg["im.remote_server_not_found"]="The remote server could not be found.";
+ZMsg["im.remote_server_timeout"]="The connection to the remote server timed out.";
+ZMsg["im.resource_constraint"]="The system is busy.";
+ZMsg["im.service_unavailable"]="Messages are not accepted by the service.";
+ZMsg["im.undefined_condition"]="An undefined error occurred. ";
+ZMsg["im.unknown_error"]="An unknown error occurred.";
+ZMsg["mail.ALREADY_EXISTS"]="An object with that name already exists.";
+ZMsg["mail.INVALID_NAME"]='Sorry, "{0}" is not a valid name. It contains at least one invalid character.';
+ZMsg["mail.MAIL_UNABLE_TO_IMPORT_APPOINTMENTS"]="Unable to import. The chosen file may be invalid.";
+ZMsg["mail.MAIL_UNABLE_TO_IMPORT_CONTACTS"]="Unable to import. The chosen file may be invalid.";
+ZMsg["mail.MAINTENANCE"]="This account is currently in maintenance mode.";
+ZMsg["mail.MESSAGE_TOO_BIG"]="This message cannot be sent because it has exceeded the maximum allowed size.";
+ZMsg["mail.MODIFY_CONFLICT"]="Item version number conflict. Another version was added between edit and save.";
+ZMsg["mail.NO_SUCH_CONV"]="No such conversation exists.";
+ZMsg["mail.NO_SUCH_FOLDER"]="No such folder exists.";
+ZMsg["mail.NO_SUCH_ITEM"]='Item "{0}" does not exist.';
+ZMsg["mail.NO_SUCH_MSG"]="No such message exists.";
+ZMsg["mail.NO_SUCH_PART"]="No such message part exists.";
+ZMsg["mail.NO_SUCH_TAG"]="No such tag exists.";
+ZMsg["mail.QUERY_PARSE_ERROR"]="Unable to parse the search query.";
+ZMsg["mail.QUOTA_EXCEEDED"]="Your message could not be sent because you have exceeded your mail quota.";
+ZMsg["mail.SEND_ABORTED_ADDRESS_FAILURE"]="Could not send message due to invalid address(es)";
+ZMsg["mail.SEND_FAILURE"]="Could not send message: {0}";
+ZMsg["mail.TOO_MANY_CONTACTS"]="Contact could not be created because you have exceeded your contact quota.";
+ZMsg["mail.TOO_MANY_QUERY_TERMS_EXPANDED"]="Please be more specific in your search criteria.";
+ZMsg["mail.TOO_MANY_TAGS"]="A tag could not be created because you have exceeded the limit.";
+ZMsg["offline.ONLINE_ONLY_OP"]="You must be online to use this feature. Please check your network connection and try again.";
+ZMsg["service.ALREADY_IN_PROGRESS"]="Operation already in progress.";
+ZMsg["service.AUTH_EXPIRED"]="Your session has expired. Please login again.";
+ZMsg["service.AUTH_REQUIRED"]="Authentication Required";
+ZMsg["service.FAILURE"]="A network service error has occurred.";
+ZMsg["service.INTERRUPTED"]="The operation has been interrupted";
+ZMsg["service.INVALID_REQUEST"]="An invalid request was made.";
+ZMsg["service.NON_READONLY_OPERATION_DENIED"]="The server is in read-only mode.";
+ZMsg["service.NOT_IN_PROGRESS"]="Operation not in progress.";
+ZMsg["service.NO_SPELL_CHECK_URL"]="No spell check server defined.";
+ZMsg["service.PARSE_ERROR"]="A parsing error has occurred.";
+ZMsg["service.PERM_DENIED"]="Permission denied.";
+ZMsg["service.PROXY_ERROR"]="Proxy error.";
+ZMsg["service.RESOURCE_UNREACHABLE"]="Resource unreachable.";
+ZMsg["service.TEMPORARILY_UNAVAILABLE"]="Service temporarily unavailable.";
+ZMsg["service.TOO_MANY_HOPS"]="Too many hops between servers.";
+ZMsg["service.UNKNOWN_DOCUMENT"]="Server error (unknown command sent to server).";
+ZMsg["service.WRONG_HOST"]="Request was sent to the wrong server.";
+ZMsg.unknownError="An unknown error ({0}) has occurred.";
+ZMsg["voice.UNABLE_TO_DELETE_VOICEMAIL"]="Unable to delete voice mail.";
+ZMsg["voice.UNABLE_TO_EMPTY_VOICEMAIL_TRASH"]="Unable to empty voice mail trash.";
+ZMsg["voice.UNABLE_TO_FORWARD_VOICEMAIL"]="Your email could not be forwarded at this time. Please try again later.";
+ZMsg["voice.UNABLE_TO_MODIFY_CALL_FEATURES"]="We are temporarily unable to forward calls. We apologize for this inconvenience.";
+ZMsg["voice.UNABLE_TO_MODIFY_VOICEMAIL_PREFS"]="An error occurred while attempting to update your voice mail preferences. Please try again.";
+ZMsg["voice.UNABLE_TO_MODIFY_VOICEMAIL_STATUS"]="Unable to modify voice mail status. ";
+ZMsg["voice.UNABLE_TO_RETRIEVE_CALLLOGS"]="We are currently unable to display call records. We apologize for this inconvenience.";
+ZMsg["voice.UNABLE_TO_RETRIEVE_CALL_FEATURES"]="Unable to retrieve call features.";
+ZMsg["voice.UNABLE_TO_RETRIEVE_PROFILE_SUMMARY"]="The system is currently unable to complete your request. We apologize for this inconvenience.";
+ZMsg["voice.UNABLE_TO_RETRIEVE_VOICEMAIL_CONTENT"]="Unable to retrieve voice mail content.";
+ZMsg["voice.UNABLE_TO_RETRIEVE_VOICEMAIL_FOLDER"]="We are temporarily unable to display voice mail records.";
+ZMsg["voice.UNABLE_TO_RETRIEVE_VOICEMAIL_PREFS"]="Unable to retrieve voice mail preferences.";
+ZMsg["voice.UNABLE_TO_RETRIEVE_VOICEMAIL_SUMMARY"]="Unable to retrieve voice mail summary.";
+ZMsg["voice.UNABLE_TO_UNDELETE_VOICEMAIL"]="Unable to undelete voice mail.";
+ZMsg["voice.UNABLE_TO_UPDATE_CALL_FEATURES"]="We are temporarily unable to forward calls. We apologize for this inconvenience.";
+ZMsg["zclient.CLIENT_ERROR"]="A network service error has occurred (zclient).";
+ZMsg["zclient.IO_ERROR"]="A network service error has occurred (zclient/io).";
+ZMsg["ztaglib.TAG_EXCEPTION"]="A client error occurred. Please try again.";
+if(!window.ZmMsg){ZmMsg={}
+}ZmMsg.AB_ADDR_HOME="Home Address";
+ZmMsg.AB_ADDR_OTHER="Other Address";
+ZmMsg.AB_ADDR_WORK="Work Address";
+ZmMsg.AB_ADD_CONTACT="Add To Contacts";
+ZmMsg.AB_EDIT_CONTACT="Edit Contact";
+ZmMsg.AB_EDIT_GROUP="Edit Group";
+ZmMsg.AB_FIELD_URL="Web Page";
+ZmMsg.AB_FIELD_anniversary="Anniversary";
+ZmMsg.AB_FIELD_assistantPhone="Assistant Phone";
+ZmMsg.AB_FIELD_attachment="Attachment";
+ZmMsg.AB_FIELD_birthday="Birthday";
+ZmMsg.AB_FIELD_callbackPhone="Callback";
+ZmMsg.AB_FIELD_carPhone="Car";
+ZmMsg.AB_FIELD_city="City";
+ZmMsg.AB_FIELD_company="Company";
+ZmMsg.AB_FIELD_companyPhone="Company Phone";
+ZmMsg.AB_FIELD_country="Country/Region";
+ZmMsg.AB_FIELD_custom="Custom";
+ZmMsg.AB_FIELD_department="Department";
+ZmMsg.AB_FIELD_email="Email";
+ZmMsg.AB_FIELD_email2="Email 2";
+ZmMsg.AB_FIELD_email3="Email 3";
+ZmMsg.AB_FIELD_firstName="First";
+ZmMsg.AB_FIELD_fullName="Full Name";
+ZmMsg.AB_FIELD_fullNameLabel="Full Name:";
+ZmMsg.AB_FIELD_homeCity="Home City";
+ZmMsg.AB_FIELD_homeCountry="Home Country/Region";
+ZmMsg.AB_FIELD_homeFax="Home Fax";
+ZmMsg.AB_FIELD_homePhone="Home Phone";
+ZmMsg.AB_FIELD_homePhone2="Home Phone 2";
+ZmMsg.AB_FIELD_homePostalCode="Home Postal Code";
+ZmMsg.AB_FIELD_homeState="Home State/Province";
+ZmMsg.AB_FIELD_homeStreet="Home Street";
+ZmMsg.AB_FIELD_homeURL="Home Web Page";
+ZmMsg.AB_FIELD_imAddress="IM Address";
+ZmMsg.AB_FIELD_imAddress1="IM Address";
+ZmMsg.AB_FIELD_imAddress2="IM Address 2";
+ZmMsg.AB_FIELD_imAddress3="IM Address 3";
+ZmMsg.AB_FIELD_image="Image";
+ZmMsg.AB_FIELD_jobTitle="Job Title";
+ZmMsg.AB_FIELD_lastName="Last";
+ZmMsg.AB_FIELD_maidenName="Maiden";
+ZmMsg.AB_FIELD_middleName="Middle";
+ZmMsg.AB_FIELD_mobilePhone="Mobile";
+ZmMsg.AB_FIELD_nickname="Nickname";
+ZmMsg.AB_FIELD_otherCity="Other City";
+ZmMsg.AB_FIELD_otherCountry="Other Country/Region";
+ZmMsg.AB_FIELD_otherFax="Other Fax";
+ZmMsg.AB_FIELD_otherPhone="Other Phone";
+ZmMsg.AB_FIELD_otherPostalCode="Other Postal Code";
+ZmMsg.AB_FIELD_otherState="Other State/Province";
+ZmMsg.AB_FIELD_otherStreet="Other Street";
+ZmMsg.AB_FIELD_otherURL="Other Web Page";
+ZmMsg.AB_FIELD_pager="Pager";
+ZmMsg.AB_FIELD_postalCode="Postal Code";
+ZmMsg.AB_FIELD_prefix="Prefix";
+ZmMsg.AB_FIELD_state="State/Province";
+ZmMsg.AB_FIELD_street="Street";
+ZmMsg.AB_FIELD_suffix="Suffix";
+ZmMsg.AB_FIELD_workAltPhone="Work Alternate";
+ZmMsg.AB_FIELD_workCity="Work City";
+ZmMsg.AB_FIELD_workCountry="Work Country/Region";
+ZmMsg.AB_FIELD_workFax="Work Fax";
+ZmMsg.AB_FIELD_workMobile="Work Mobile";
+ZmMsg.AB_FIELD_workPhone="Work Phone";
+ZmMsg.AB_FIELD_workPhone2="Work Phone 2";
+ZmMsg.AB_FIELD_workPostalCode="Work Postal Code";
+ZmMsg.AB_FIELD_workState="Work State/Province";
+ZmMsg.AB_FIELD_workStreet="Work Street";
+ZmMsg.AB_FIELD_workURL="Work Web Page";
+ZmMsg.AB_FILE_AS_company="Company";
+ZmMsg.AB_FILE_AS_companyFirstLast="Company (First Last)";
+ZmMsg.AB_FILE_AS_companyLastFirst="Company (Last, First)";
+ZmMsg.AB_FILE_AS_firstLast="First Last";
+ZmMsg.AB_FILE_AS_firstLastCompany="First Last (Company)";
+ZmMsg.AB_FILE_AS_lastFirst="Last, First";
+ZmMsg.AB_FILE_AS_lastFirstCompany="Last, First (Company)";
+ZmMsg.AB_HOME_URL="Home URL";
+ZmMsg.AB_MOVE_CONTACT="Move Contact";
+ZmMsg.AB_MOVE_CONTACTS="Move Contacts";
+ZmMsg.AB_OTHER_URL="Other URL";
+ZmMsg.AB_TAG_CONTACT="Tag Contact";
+ZmMsg.AB_TAG_CONTACTS="Tag Contacts";
+ZmMsg.AB_TAG_GROUP="Tag Group";
+ZmMsg.AB_WORK_URL="Work URL";
+ZmMsg.ALT_ERROR="Error";
+ZmMsg.ASST_APPT_HELP='The appointment assistant allows you to quickly create a new appointment without switching context from what you are currently doing.<br><br><b>Examples:</b><br><ul><li>lunch with Dave next friday 11am - 1pm<li>"Linux Conference" April 5th April 10th [San Francisco]</ul>';
+ZmMsg.ASST_APPT_location="[enclose location in brackets]";
+ZmMsg.ASST_APPT_notes="(enclose notes in parenthesis)";
+ZmMsg.ASST_APPT_subject='"enclose subject in quotes or just type"';
+ZmMsg.ASST_CALENDAR_HELP="The calendar assistant allows you to quickly go to a specific date and calender view.<br><br><b>Examples:</b><br><ul><li>August 8th<li>next friday<li>December 2009 month<li>Jan 5th, 2008 week</ul>";
+ZmMsg.ASST_CMD_APPOINTMENT="appointment";
+ZmMsg.ASST_CMD_CALENDAR="calendar";
+ZmMsg.ASST_CMD_CALL="call";
+ZmMsg.ASST_CMD_CONTACT="contact";
+ZmMsg.ASST_CMD_MAIL="mail";
+ZmMsg.ASST_CMD_SUM_APPOINTMENT="Create a new appointment";
+ZmMsg.ASST_CMD_SUM_CALENDAR="Go to a specific date in the calendar";
+ZmMsg.ASST_CMD_SUM_CONTACT="Create a new contact";
+ZmMsg.ASST_CMD_SUM_MAIL="Send an email message";
+ZmMsg.ASST_CMD_SUM_TASK="Create a new task";
+ZmMsg.ASST_CMD_TASK="task";
+ZmMsg.ASST_CONTACT_HELP="The contact assistant allows you to quickly create a new contact without switching context from what you are currently doing.<br><br><b>Examples:</b><br><ul><li>John Doe john@doe.com www.doe.com (123) 456-6789<li>l:Doe f:John e:john@doe.com hu: http://www.doe.com hf: (123) 456-6789<li>c:zimbra [1500 fashion island blvd; san mateo; ca; 94404]</ul><br><b>Available fields:</b><br><br>";
+ZmMsg.ASST_CONTACT_LONG_assistantPhone="assistantPhone";
+ZmMsg.ASST_CONTACT_LONG_callbackPhone="callbackPhone";
+ZmMsg.ASST_CONTACT_LONG_carPhone="carPhone";
+ZmMsg.ASST_CONTACT_LONG_company="company";
+ZmMsg.ASST_CONTACT_LONG_companyPhone="companyPhone";
+ZmMsg.ASST_CONTACT_LONG_email="email";
+ZmMsg.ASST_CONTACT_LONG_email2="email2";
+ZmMsg.ASST_CONTACT_LONG_email3="email3";
+ZmMsg.ASST_CONTACT_LONG_firstName="firstName";
+ZmMsg.ASST_CONTACT_LONG_homeAddress="homeAddress";
+ZmMsg.ASST_CONTACT_LONG_homeCity="homeCity";
+ZmMsg.ASST_CONTACT_LONG_homeCountry="homeCountry";
+ZmMsg.ASST_CONTACT_LONG_homeFax="homeFax";
+ZmMsg.ASST_CONTACT_LONG_homePhone="homePhone";
+ZmMsg.ASST_CONTACT_LONG_homePhone2="homePhone2";
+ZmMsg.ASST_CONTACT_LONG_homePostalCode="homePostalCode";
+ZmMsg.ASST_CONTACT_LONG_homeState="homeState";
+ZmMsg.ASST_CONTACT_LONG_homeStreet="homeStreet";
+ZmMsg.ASST_CONTACT_LONG_homeURL="homeURL";
+ZmMsg.ASST_CONTACT_LONG_jobTitle="jobTitle";
+ZmMsg.ASST_CONTACT_LONG_lastName="lastName";
+ZmMsg.ASST_CONTACT_LONG_middleName="middleName";
+ZmMsg.ASST_CONTACT_LONG_mobilePhone="mobilePhone";
+ZmMsg.ASST_CONTACT_LONG_notes="notes";
+ZmMsg.ASST_CONTACT_LONG_otherAddress="otherAddress";
+ZmMsg.ASST_CONTACT_LONG_otherCity="otherCity";
+ZmMsg.ASST_CONTACT_LONG_otherCountry="otherCountry";
+ZmMsg.ASST_CONTACT_LONG_otherFax="otherFax";
+ZmMsg.ASST_CONTACT_LONG_otherPhone="otherPhone";
+ZmMsg.ASST_CONTACT_LONG_otherPostalCode="otherPostalCode";
+ZmMsg.ASST_CONTACT_LONG_otherState="otherState";
+ZmMsg.ASST_CONTACT_LONG_otherStreet="otherStreet";
+ZmMsg.ASST_CONTACT_LONG_otherURL="otherURL";
+ZmMsg.ASST_CONTACT_LONG_pager="pager";
+ZmMsg.ASST_CONTACT_LONG_workAddress="workAddress";
+ZmMsg.ASST_CONTACT_LONG_workCity="workCity";
+ZmMsg.ASST_CONTACT_LONG_workCountry="workCountry";
+ZmMsg.ASST_CONTACT_LONG_workFax="workFax";
+ZmMsg.ASST_CONTACT_LONG_workPhone="workPhone";
+ZmMsg.ASST_CONTACT_LONG_workPhone2="workPhone2";
+ZmMsg.ASST_CONTACT_LONG_workPostalCode="workPostalCode";
+ZmMsg.ASST_CONTACT_LONG_workState="workState";
+ZmMsg.ASST_CONTACT_LONG_workStreet="workStreet";
+ZmMsg.ASST_CONTACT_LONG_workURL="workURL";
+ZmMsg.ASST_CONTACT_SHORT_assistantPhone="a";
+ZmMsg.ASST_CONTACT_SHORT_callbackPhone="cb";
+ZmMsg.ASST_CONTACT_SHORT_carPhone="ca";
+ZmMsg.ASST_CONTACT_SHORT_company="c";
+ZmMsg.ASST_CONTACT_SHORT_companyPhone="cp";
+ZmMsg.ASST_CONTACT_SHORT_email="e";
+ZmMsg.ASST_CONTACT_SHORT_email2="e2";
+ZmMsg.ASST_CONTACT_SHORT_email3="e3";
+ZmMsg.ASST_CONTACT_SHORT_firstName="fn";
+ZmMsg.ASST_CONTACT_SHORT_homeAddress="ha";
+ZmMsg.ASST_CONTACT_SHORT_homeCity="hc";
+ZmMsg.ASST_CONTACT_SHORT_homeCountry="co";
+ZmMsg.ASST_CONTACT_SHORT_homeFax="hf";
+ZmMsg.ASST_CONTACT_SHORT_homePhone="hp";
+ZmMsg.ASST_CONTACT_SHORT_homePhone2="hp2";
+ZmMsg.ASST_CONTACT_SHORT_homePostalCode="hz";
+ZmMsg.ASST_CONTACT_SHORT_homeState="st";
+ZmMsg.ASST_CONTACT_SHORT_homeStreet="hs";
+ZmMsg.ASST_CONTACT_SHORT_homeURL="hu";
+ZmMsg.ASST_CONTACT_SHORT_jobTitle="t";
+ZmMsg.ASST_CONTACT_SHORT_lastName="ln";
+ZmMsg.ASST_CONTACT_SHORT_middleName="mn";
+ZmMsg.ASST_CONTACT_SHORT_mobilePhone="m";
+ZmMsg.ASST_CONTACT_SHORT_notes="n";
+ZmMsg.ASST_CONTACT_SHORT_otherAddress="oa";
+ZmMsg.ASST_CONTACT_SHORT_otherCity="oc";
+ZmMsg.ASST_CONTACT_SHORT_otherCountry="oco";
+ZmMsg.ASST_CONTACT_SHORT_otherFax="of";
+ZmMsg.ASST_CONTACT_SHORT_otherPhone="op";
+ZmMsg.ASST_CONTACT_SHORT_otherPostalCode="oz";
+ZmMsg.ASST_CONTACT_SHORT_otherState="ost";
+ZmMsg.ASST_CONTACT_SHORT_otherStreet="os";
+ZmMsg.ASST_CONTACT_SHORT_otherURL="ou";
+ZmMsg.ASST_CONTACT_SHORT_pager="p";
+ZmMsg.ASST_CONTACT_SHORT_workAddress="wa";
+ZmMsg.ASST_CONTACT_SHORT_workCity="wc";
+ZmMsg.ASST_CONTACT_SHORT_workCountry="wco";
+ZmMsg.ASST_CONTACT_SHORT_workFax="f";
+ZmMsg.ASST_CONTACT_SHORT_workPhone="wp";
+ZmMsg.ASST_CONTACT_SHORT_workPhone2="wp2";
+ZmMsg.ASST_CONTACT_SHORT_workPostalCode="wz";
+ZmMsg.ASST_CONTACT_SHORT_workState="wst";
+ZmMsg.ASST_CONTACT_SHORT_workStreet="ws";
+ZmMsg.ASST_CONTACT_SHORT_workURL="wu";
+ZmMsg.ASST_CONTACT_address="[street; city; state; zip; country]";
+ZmMsg.ASST_CONTACT_email="type an email address";
+ZmMsg.ASST_CONTACT_fullName="type to enter fullname";
+ZmMsg.ASST_CONTACT_notes="(enclose notes in parenthesis)";
+ZmMsg.ASST_CONTACT_phone="type a phone number";
+ZmMsg.ASST_CONTACT_url="type a URL";
+ZmMsg.ASST_HELP="The assistant provides a quick way to interact with the system via the keyboard.<br><br>Available commands:<br><br>";
+ZmMsg.ASST_MAIL_HELP='The mail assistant allows you to quickly send a new mail message without switching context from what you are currently doing.<br><br><b>Examples:</b><br><ul><li>"call me" to:john@doe.com body: call me about the quote<li>subject: monday is good to:john@doe.com cc:jan@doe.com</ul>';
+ZmMsg.ASST_MAIL_body="type body: followed by the body (must be last)";
+ZmMsg.ASST_MAIL_subject='"enclose subject in quotes"';
+ZmMsg.ASST_MAIL_to="type to: followed by adddresses";
+ZmMsg.ASST_TASK_HELP='The TASK assistant allows you to quickly create a new TASK without switching context from what you are currently doing.<br><br><b>Examples:</b><br><ul><li>lunch with Dave next friday <li>"Soccer practice" April 5th April 10th [San Francisco]</ul>';
+ZmMsg.ASST_availableCommands="available commands:";
+ZmMsg.ASST_no_match="(no commands match)";
+ZmMsg.COLUMN_WIDTH_ACTIONS_SH="180";
+ZmMsg.COLUMN_WIDTH_ACTIVE="50";
+ZmMsg.COLUMN_WIDTH_CAPACITY_NA="50";
+ZmMsg.COLUMN_WIDTH_CONTACT_NA="150";
+ZmMsg.COLUMN_WIDTH_DATE="75";
+ZmMsg.COLUMN_WIDTH_DATE_CAL="105";
+ZmMsg.COLUMN_WIDTH_DATE_CALL="180";
+ZmMsg.COLUMN_WIDTH_DATE_DLV="80";
+ZmMsg.COLUMN_WIDTH_DATE_DUE_TLV="110";
+ZmMsg.COLUMN_WIDTH_FBSTATUS_NA="80";
+ZmMsg.COLUMN_WIDTH_FOLDER="47";
+ZmMsg.COLUMN_WIDTH_FOLDER_CAL="100";
+ZmMsg.COLUMN_WIDTH_FOLDER_CN="20";
+ZmMsg.COLUMN_WIDTH_FOLDER_DLV="100";
+ZmMsg.COLUMN_WIDTH_FOLDER_FLV="120";
+ZmMsg.COLUMN_WIDTH_FOLDER_NA="160";
+ZmMsg.COLUMN_WIDTH_FOLDER_SH="150";
+ZmMsg.COLUMN_WIDTH_FROM_CALL="190";
+ZmMsg.COLUMN_WIDTH_FROM_CLV="145";
+ZmMsg.COLUMN_WIDTH_FROM_MLV="105";
+ZmMsg.COLUMN_WIDTH_HOME_PHONE_NA="100";
+ZmMsg.COLUMN_WIDTH_ID_MDL="250";
+ZmMsg.COLUMN_WIDTH_ITEM_COUNT="120";
+ZmMsg.COLUMN_WIDTH_LOCATION_CAL="175";
+ZmMsg.COLUMN_WIDTH_NAME_ACC="170";
+ZmMsg.COLUMN_WIDTH_NAME_CN="100";
+ZmMsg.COLUMN_WIDTH_NAME_NA="150";
+ZmMsg.COLUMN_WIDTH_NOTES_NA="30";
+ZmMsg.COLUMN_WIDTH_OWNER_DLV="80";
+ZmMsg.COLUMN_WIDTH_OWNER_SH="180";
+ZmMsg.COLUMN_WIDTH_PCOMPLETE_TLV="75";
+ZmMsg.COLUMN_WIDTH_PROTOCOL_MDL="100";
+ZmMsg.COLUMN_WIDTH_PROVISIONABLE_MDL="75";
+ZmMsg.COLUMN_WIDTH_ROLE_SH="50";
+ZmMsg.COLUMN_WIDTH_SIZE="45";
+ZmMsg.COLUMN_WIDTH_SIZE_DLV="45";
+ZmMsg.COLUMN_WIDTH_STATUS_ACC="80";
+ZmMsg.COLUMN_WIDTH_STATUS_CAL="80";
+ZmMsg.COLUMN_WIDTH_STATUS_MDL="150";
+ZmMsg.COLUMN_WIDTH_STATUS_TLV="110";
+ZmMsg.COLUMN_WIDTH_TYPE_ACC="85";
+ZmMsg.COLUMN_WIDTH_TYPE_CN="20";
+ZmMsg.COLUMN_WIDTH_TYPE_DLV="80";
+ZmMsg.COLUMN_WIDTH_TYPE_SH="60";
+ZmMsg.COLUMN_WIDTH_WITH_SH="180";
+ZmMsg.COLUMN_WIDTH_WORK_PHONE_NA="100";
+ZmMsg.CRLF="\r\n";
+ZmMsg.CRLF2="\r\n\r\n";
+ZmMsg.DASHES="-----";
+ZmMsg.GAL="Global Address List";
+ZmMsg.P_TIME_LAST_4_HOURS="last 4 hours";
+ZmMsg.P_TIME_LAST_HOUR="last hour";
+ZmMsg.P_TIME_LAST_MONTH="last month";
+ZmMsg.P_TIME_LAST_WEEK="last week";
+ZmMsg.P_TIME_LAST_YEAR="last year";
+ZmMsg.P_TIME_THIS_MONTH="this month";
+ZmMsg.P_TIME_THIS_WEEK="this week";
+ZmMsg.P_TIME_THIS_YEAR="this year";
+ZmMsg.P_TIME_TITLE="Time";
+ZmMsg.P_TIME_TODAY="today";
+ZmMsg.P_TIME_YESTERDAY="yesterday";
+ZmMsg._export="Export";
+ZmMsg._import="Import";
+ZmMsg._name="Name";
+ZmMsg._new="New";
+ZmMsg._private="Private";
+ZmMsg._public="Public";
+ZmMsg.above="Above";
+ZmMsg.aboveQuotedText="Above included messages";
+ZmMsg.accept="Accept";
+ZmMsg.acceptShare="Accept Share";
+ZmMsg.acceptShareDetails='They have granted you the <b>{0}</b> role, which means:<div style="margin-left:15px;margin-bottom:3px;margin-top:3px;">{1}</div>';
+ZmMsg.acceptShareDetailsAdmin="<li>You can <b>View</b> and <b>Edit</b> items in the folder.<li>You can <b>Add</b> and <b>Remove</b> items to/from the folder.<li>You can <b>Accept</b> and <b>Decline</b> workflow actions for the folder.<li>You can <b>Administer</b> the folder as if it were your own (i.e. share with another user).";
+ZmMsg.acceptShareDetailsManager="<li>You can <b>View</b> and <b>Edit</b> items in the folder.<li>You can <b>Add</b> and <b>Remove</b> items to/from the folder.<li>You can <b>Accept</b> and <b>Decline</b> workflow actions for the folder.";
+ZmMsg.acceptShareDetailsNone="<li>You cannot do anything to items in the folder.";
+ZmMsg.acceptShareDetailsViewer="<li>You can <b>View</b> items in the folder.";
+ZmMsg.acceptShareHeader="<b>{0}</b> has shared their <b>{1}</b> folder with you.";
+ZmMsg.acceptShareQuestion="Do you want to accept this share?";
+ZmMsg.accepted="Accepted";
+ZmMsg.account="Account";
+ZmMsg.accountChangePortLabel="Change {0} port";
+ZmMsg.accountChangeRestart="Would you like to reload the application now to show the new account changes? (Otherwise, the account changes will appear the next time you log in.)";
+ZmMsg.accountDefault="Primary Account";
+ZmMsg.accountDeleteAfterDownload="Delete messages on the server after downloading them";
+ZmMsg.accountDeleteFolder='<b>Do you want to delete the folder "{0}"?</b><p>The folder and all messages contained in the folder will be moved to the Trash.';
+ZmMsg.accountDownloadToFolder="Folder: {0}";
+ZmMsg.accountDownloadToInbox="Inbox";
+ZmMsg.accountDownloadToLabel="Download messages to:";
+ZmMsg.accountFromPrompt="Messages sent from this account have the following settings:";
+ZmMsg.accountHeaderExternal="External Account Settings";
+ZmMsg.accountHeaderPrimary="Primary Account Settings";
+ZmMsg.accountInactiveContent="This account could not be activated. Please verify the account settings.";
+ZmMsg.accountInactiveTitle="Inactive Account";
+ZmMsg.accountLabel="Account:";
+ZmMsg.accountName="Account Name";
+ZmMsg.accountNameLabel="Account Name:";
+ZmMsg.accountNameReserved='Account name "{0}" is reserved. Please choose a different name.';
+ZmMsg.accountPersonaInstructions="Use personas to quickly change many settings when sending email messages. For example, if you sometimes send email in a particular role at work, create a persona for that role.";
+ZmMsg.accountPersonaLabel="Persona Name:";
+ZmMsg.accountPersonaUseLabel="Use this persona:";
+ZmMsg.accountPortDefault="({0,number} is the default)";
+ZmMsg.accountReplyTo='Set the "Reply-to" field of email messages to:';
+ZmMsg.accountServerLabel="Email Server:";
+ZmMsg.accountSettings="Account Settings";
+ZmMsg.accountSubHeader="{0}";
+ZmMsg.accountTest="Test Settings";
+ZmMsg.accountTestErrorMissingInfo="You must specify the username, server, and password.";
+ZmMsg.accountTypeImap="IMAP";
+ZmMsg.accountTypeLabel="Account type:";
+ZmMsg.accountTypePersona="Persona";
+ZmMsg.accountTypePop="POP";
+ZmMsg.accountTypePrimary="Primary";
+ZmMsg.accountTypeSecondary="Secondary";
+ZmMsg.accountUseSSL="Use an encrypted connection (SSL) when accessing this server";
+ZmMsg.accountUsernameLabel="Username of Account:";
+ZmMsg.accounts="Accounts";
+ZmMsg.action="Action";
+ZmMsg.actionLabel="Action:";
+ZmMsg.actions="Actions";
+ZmMsg.active="Active";
+ZmMsg.add="Add";
+ZmMsg.addAll="Add All";
+ZmMsg.addAttachment="Add Attachment";
+ZmMsg.addAttachments="Add Attachments";
+ZmMsg.addDocuments="Upload Files";
+ZmMsg.addDocumentsTT="Upload one or more files to this notebook";
+ZmMsg.addExternalAccount="Add External Account";
+ZmMsg.addFilter="Add Filter";
+ZmMsg.addImg="Add Image";
+ZmMsg.addLabel="Add:";
+ZmMsg.addMembers="Add Members to this Group";
+ZmMsg.addMoreAttachments="Add More Attachments";
+ZmMsg.addNewPhoto="Add New Photo";
+ZmMsg.addPersona="Add Persona";
+ZmMsg.addPhoto="Add Photo";
+ZmMsg.addRemoteAppts="Synchronize appointments from remote calendar";
+ZmMsg.addRemoteTasks="Synchronize tasks from remote service (i.e. iCal)";
+ZmMsg.addSearch="Add a search to the current query.";
+ZmMsg.addShare="Add Share...";
+ZmMsg.addSignature="Add Signature";
+ZmMsg.addToAddrBook="add to address book";
+ZmMsg.addToBriefcase="Briefcase";
+ZmMsg.addToBriefcaseTitle="Add to Briefcase";
+ZmMsg.addToExistingContact="Add to Existing Contact";
+ZmMsg.addToNewContact="Add to New Contact";
+ZmMsg.added="Added:";
+ZmMsg.address="Address";
+ZmMsg.addressBook="Address Book";
+ZmMsg.addressBookLabel="Address Book:";
+ZmMsg.addressBooks="Address Books";
+ZmMsg.addressHint="Address (jsmith@address.com)";
+ZmMsg.addressIn="Address in";
+ZmMsg.addressLabel="Address:";
+ZmMsg.adminLinkLabel="Domain Admin";
+ZmMsg.adobePdfDocument="Adobe PDF";
+ZmMsg.adobePsDocument="Adobe Postscript";
+ZmMsg.advanced="Advanced";
+ZmMsg.advancedSearch="Advanced Search";
+ZmMsg.advancedSearchTooltip="Open / close advanced search";
+ZmMsg.advancedSettings="Advanced settings";
+ZmMsg.advancedSettingsLabel="Advanced Settings:";
+ZmMsg.after="After";
+ZmMsg.afterLc="after";
+ZmMsg.afterReload="Setting will take effect after a reload";
+ZmMsg.agenda="Agenda";
+ZmMsg.aleError="Can't deserialize component";
+ZmMsg.align="Align";
+ZmMsg.alignment="Alignment";
+ZmMsg.all="All";
+ZmMsg.allAccounts="All Accounts";
+ZmMsg.allAttendees="All Attendees";
+ZmMsg.allConditions="All conditions";
+ZmMsg.allDay="All day";
+ZmMsg.allDayEvent="All day event";
+ZmMsg.allFolders="All folders";
+ZmMsg.allMail="All Mail";
+ZmMsg.allPageSelected="{0} items selected. To select all search results, use Shift-click.";
+ZmMsg.allRemindersAreSnoozed="All Reminders are snoozed";
+ZmMsg.allSearchSelected="All search results selected, including those not yet loaded.";
+ZmMsg.allTags="All Tags";
+ZmMsg.allowMultipleLocations="Allow multiple locations";
+ZmMsg.almostSupportedBrowserTip='Please note that because you are running an unsupported browser, your user experience may be affected, and all functionality may not be available.<p><a href="javascript:;" onclick="{0}">Click here to continue.</a> <br />';
+ZmMsg.alphabet="All,123,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z";
+ZmMsg.alwaysShowMiniCal="Always show the mini-calendar";
+ZmMsg.andMore="And more...";
+ZmMsg.answeredCalls="Answered Calls";
+ZmMsg.anyAtt="Any Attachment";
+ZmMsg.anyCondition="Any condition";
+ZmMsg.anyTime="Any Time";
+ZmMsg.anywhere="Anywhere";
+ZmMsg.aol="AOL";
+ZmMsg.appExitWarning="Doing so will terminate Zimbra Collaboration Suite, and you will lose your unsaved changes";
+ZmMsg.appUnknown='The "{0}" application is not available or disabled.';
+ZmMsg.application="Application";
+ZmMsg.applicationDocument="Application Document";
+ZmMsg.applySignature="Apply signature:";
+ZmMsg.appointment="Appointment";
+ZmMsg.appointmentEditTitle="Edit Appointment";
+ZmMsg.appointmentNewTitle="New Appointment";
+ZmMsg.appointmentReminder="Appointment Reminder";
+ZmMsg.appointments="Appointments";
+ZmMsg.apptAttendees="Attendees for this appointment";
+ZmMsg.apptBlobMissing="The selected appointment no longer exists. Please delete the entire appointment series.";
+ZmMsg.apptCanceled="The following meeting has been cancelled:";
+ZmMsg.apptCreated="Appointment Created";
+ZmMsg.apptCreating="Creating Appointments";
+ZmMsg.apptDateTime="{0,date,short}, {1,time,short}";
+ZmMsg.apptDateTimeAllDay="{0,date,short}, all day";
+ZmMsg.apptDetails="Appointment Details";
+ZmMsg.apptExceptionNote="This is an exception to the series.";
+ZmMsg.apptInstance="Instance";
+ZmMsg.apptInstanceCanceled="A single instance of the following meeting has been cancelled:";
+ZmMsg.apptInstanceModified="A single instance of the following meeting has been modified:";
+ZmMsg.apptIsPrivate="This appointment is private and cannot be opened.";
+ZmMsg.apptLocations="Location(s) for this appointment";
+ZmMsg.apptModified="The following meeting has been modified:";
+ZmMsg.apptModifiedStamp="[MODIFIED]";
+ZmMsg.apptNew="The following is a new meeting request:";
+ZmMsg.apptOutOfDate="The selected appointment has been changed or no longer exists.";
+ZmMsg.apptPastDueReminderLabel="Show reminders for past-due meetings";
+ZmMsg.apptRemindNDaysBefore="{0,number} {0,choice,0#days|1#day|2#days} before";
+ZmMsg.apptRemindNHoursBefore="{0,number} {0,choice,0#hours|1#hour|2#hours} before";
+ZmMsg.apptRemindNMinutesBefore="{0,number} {0,choice,0#minutes|1#minute|2#minutes} before";
+ZmMsg.apptRemindNWeeksBefore="{0,number} {0,choice,0#weeks|1#week|2#weeks} before";
+ZmMsg.apptRemindNever="Never";
+ZmMsg.apptReminderLabel="Show reminders:";
+ZmMsg.apptReminders="Appointment Reminder(s)";
+ZmMsg.apptResources="Resources for this appointment";
+ZmMsg.apptSendErrorAbort="Invite not sent; one or more addresses were not accepted.";
+ZmMsg.apptSendErrorInvalidAddresses="Rejected addresses: {0}";
+ZmMsg.apptSendErrorPartial="Invite not sent to the following rejected addresses: {0}";
+ZmMsg.apptSendErrorUnsentAddresses="Invite NOT sent to: {0}";
+ZmMsg.apptSeries="Series";
+ZmMsg.apptTimeAllDay="{0,date}";
+ZmMsg.apptTimeAllDayMulti="From {0,date} to {1,date}";
+ZmMsg.apptTimeInstance="{0,date} from {0,time,short} to {1,time,short} {2}";
+ZmMsg.apptTimeInstanceMulti="From {0,date} {0,time,short} to {1,date} {1,time,short} {2}";
+ZmMsg.apptsImportedResult="{0,number} {0,choice,0#Appointments|1#Appointment|2#Appointments} Imported";
+ZmMsg.archiveHint='<a href="javascript:;" onclick="{0}">Create a new folder here</a> for archiving messages,<br>or you can drag-n-drop an entire folder under "Local Folders".';
+ZmMsg.arrange="Arrange";
+ZmMsg.arrangedBy="Arranged by: {0}";
+ZmMsg.asFlagged="As flagged";
+ZmMsg.asRead="As read";
+ZmMsg.ascending="Ascending";
+ZmMsg.askCancel="The server appears to be slow to respond, and may be unavailable. Press the button to cancel your request.";
+ZmMsg.askDeleteFilter='Delete filter "{0}"?';
+ZmMsg.askDeleteTag='Delete tag "{0}"?';
+ZmMsg.askLeaveCompose="Cancel compose? (If you cancel, your message will not be saved.)";
+ZmMsg.askSaveAutosavedDraft="The message has been autosaved. Do you want to keep it?";
+ZmMsg.askSaveDraft="Save current message as draft?";
+ZmMsg.askToSave="Do you want to save changes?";
+ZmMsg.at="@";
+ZmMsg.atBottomOfMessage="Below included messages";
+ZmMsg.atStartTime="at the start time";
+ZmMsg.attach="Attach";
+ZmMsg.attachClearUploadMessage="Clear or Upload attachments before changing tabs";
+ZmMsg.attachFile="Attach File(s)";
+ZmMsg.attachFileNo="Attach File {0}:";
+ZmMsg.attachMultiMsgs="Forward Conversations";
+ZmMsg.attachSelectMessage="Select at least one file to attach";
+ZmMsg.attachingFiles="Attaching File(s)";
+ZmMsg.attachingFilesDone="Finished Attaching File(s)";
+ZmMsg.attachingFilesError="Error while Attaching File(s)";
+ZmMsg.attachment="Attachment";
+ZmMsg.attachmentConfirmRemove="Are you sure you want to permanently remove this attachment?";
+ZmMsg.attachmentConfirmRemoveAll="Are you sure you want to permanently remove all attachments?";
+ZmMsg.attachmentTooltip="Attach one or more files to the message";
+ZmMsg.attachments="Attachments";
+ZmMsg.attachmentsLabel="Attachments:";
+ZmMsg.attendeeListChanged="You have made changes to the attendees list:";
+ZmMsg.attendeeStatusLabel="Status:";
+ZmMsg.attendees="Attendees";
+ZmMsg.attendeesLabel="Attendees:";
+ZmMsg.audio="Audio";
+ZmMsg.audioVideo="Audio/Video";
+ZmMsg.authChanged="Another user has logged in on this computer. You will need to login again to continue.";
+ZmMsg.authFailure='Authentication failed with account "{0}".<br>Please go to Account Setup for more information.';
+ZmMsg.authorLabel="Author:";
+ZmMsg.auto="Auto";
+ZmMsg.autoAddContacts='Add new contacts to "Emailed Contacts"';
+ZmMsg.autoAddInvites="Automatically add received appointments to calendar";
+ZmMsg.autoPick="AutoPick";
+ZmMsg.autoSaveDrafts="Automatically save drafts of messages while you are composing";
+ZmMsg.autocomplete="Autocomplete";
+ZmMsg.autocompleteFailed="Autocomplete failed";
+ZmMsg.autocompleteNotReady="Contacts Not Loaded, Yet";
+ZmMsg.autocompleteShare="Always use this account during autocomplete";
+ZmMsg.autocompleteSharedAddrBooks="Include addresses in shared address books";
+ZmMsg.autocompleteWaiting="Autocompleting...";
+ZmMsg.automaticSignature="Automatically on all messages";
+ZmMsg.awayMessage="Away message";
+ZmMsg.awayMessageEnabled="Send auto-reply message:";
+ZmMsg.b="B";
+ZmMsg.back="Back";
+ZmMsg.badTargetFolder="You cannot move the folder to the selected destination folder.";
+ZmMsg.badTargetFolderItems="You cannot move items to the selected destination folder.";
+ZmMsg.badUsername="Your username must be a valid email address.";
+ZmMsg.basic="Basic";
+ZmMsg.basicSearch="Basic Search";
+ZmMsg.bcc="Bcc";
+ZmMsg.bccLabel="Bcc:";
+ZmMsg.before="Before";
+ZmMsg.beforeLc="before";
+ZmMsg.below="Below";
+ZmMsg.beta="[beta]";
+ZmMsg.betaIM="[IM beta]";
+ZmMsg.blackListLabel="Block messages from:";
+ZmMsg.blue="Blue";
+ZmMsg.body="Body";
+ZmMsg.bodyTemplate="Body template";
+ZmMsg.borderColor="Border Color";
+ZmMsg.borderColorLabel="Border Color:";
+ZmMsg.borderStyle="Border Style";
+
+ZmMsg.borderStyleDashed="Dashed";
+ZmMsg.borderStyleDotted="Dotted";
+ZmMsg.borderStyleDouble="Double";
+ZmMsg.borderStyleGroove="Groove";
+ZmMsg.borderStyleInset="Inset";
+ZmMsg.borderStyleLabel="Border Style:";
+ZmMsg.borderStyleOutset="Outset";
+ZmMsg.borderStyleRidge="Ridge";
+ZmMsg.borderStyleSolid="Solid";
+ZmMsg.borderThickness="Border Thickness:";
+ZmMsg.borderWidth="Border Width:";
+ZmMsg.bothNewPasswordsMustMatch="Both new passwords must match.";
+ZmMsg.bottom="Bottom";
+ZmMsg.briefcase="Briefcase";
+ZmMsg.briefcaseCreateNewDocument="Create New Document";
+ZmMsg.briefcaseCreateNewPresentation="Create New Presentation";
+ZmMsg.briefcaseCreateNewSpreadsheet="Create New Spreadsheet";
+ZmMsg.briefcaseFileProps="File Properties";
+ZmMsg.briefcasePropModified="Modified";
+ZmMsg.briefcasePropName="Name";
+ZmMsg.briefcasePropSize="Size";
+ZmMsg.briefcasePropTags="Tags";
+ZmMsg.brokenHeart="broken heart";
+ZmMsg.browse="Browse...";
+ZmMsg.browserPlusDisabled="BrowserPlus is disabled";
+ZmMsg.browserPlusMissing="This feature requires Yahoo! BrowserPlus. <a target='_blank' href='http://browserplus.yahoo.com/install'>Click here</a> to download and install it.";
+ZmMsg.buddies="Buddies";
+ZmMsg.buddy="Buddy";
+ZmMsg.buddyInvitation="Buddy Invitation";
+ZmMsg.buddyList="Buddy List";
+ZmMsg.building="Building";
+ZmMsg.bulletedList="Bulleted List";
+ZmMsg.busy="Busy";
+ZmMsg.byAttachment="By Attachment";
+ZmMsg.byConversation="By Conversation";
+ZmMsg.byFolder="By Folder";
+ZmMsg.byMessage="By Message";
+ZmMsg.bySender="By Sender";
+ZmMsg.byTag="By Tag";
+ZmMsg.byTime="By Time";
+ZmMsg.byType="By Type";
+ZmMsg.bytes="bytes";
+ZmMsg.calAssistDefaultView="day, work week, week, month";
+ZmMsg.calFeedInvalid="Appointments could not be retrieved. Make sure the following URL is a valid ICAL feed: {0}";
+ZmMsg.calPerms="Permissions";
+ZmMsg.calPermsNote="<b>Note:</b> Users provided below must be on this mail system ({0}). You may use the full email address, or just the username.";
+ZmMsg.calRefreshTooltip="Refresh Calendar Views";
+ZmMsg.calViewDay="Day View";
+ZmMsg.calViewList="List View";
+ZmMsg.calViewMonth="Month View";
+ZmMsg.calViewSchedule="Schedule View";
+ZmMsg.calViewWeek="7 Day Week View";
+ZmMsg.calViewWorkWeek="Work Week View";
+ZmMsg.calendar="Calendar";
+ZmMsg.calendarAppointment="Calendar Appointment";
+ZmMsg.calendarFirstDayOfWeek="First day of the week";
+ZmMsg.calendarInitialApptVisibility="Default appointment visibility:";
+ZmMsg.calendarInitialView="Initial calendar view";
+ZmMsg.calendarInvite="Calendar Invite";
+ZmMsg.calendarLabel="Calendar:";
+ZmMsg.calendarStartWeekLabel="Start week on:";
+ZmMsg.calendars="Calendars";
+ZmMsg.call="Call";
+ZmMsg.callForwardingDescription="Forward <b>all</b> calls to:";
+ZmMsg.callForwardingError="The call forwarding number is invalid";
+ZmMsg.callForwardingLabel="Call Forwarding:";
+ZmMsg.callForwardingSameNumberError="The call forwarding number may not be the same as the phone number you are managing.";
+ZmMsg.callManager="Call Manager";
+ZmMsg.callManagerTooltip="Go to the Call Manager";
+ZmMsg.callNumber="Call {0}";
+ZmMsg.callSettings="Call Settings";
+ZmMsg.caller="Caller";
+ZmMsg.callingPartyCallerIdFormat="{0}&nbsp;&nbsp;{1}";
+ZmMsg.callingPartyFormat="{0} ({1})&nbsp;&nbsp;{2}";
+ZmMsg.calls="Calls";
+ZmMsg.cancel="Cancel";
+ZmMsg.cancelInstance="Cancel Instance";
+ZmMsg.cancelSendMsgWarning="Important: Your message may not have been sent. You will be returned to the message. You can click Send again, and if the message was sent, the recipient will not receive a duplicate message. Note, if the message is modified before resending, the recipient may receive both messages.";
+ZmMsg.cancelTooltip="Return to previous view";
+ZmMsg.cancelled="Cancelled";
+ZmMsg.capacity="Capacity";
+ZmMsg.caption="Caption:";
+ZmMsg.cardMessage="Card Message:";
+ZmMsg.cardViewE="E";
+ZmMsg.cardViewE2="E2";
+ZmMsg.cardViewE3="E3";
+ZmMsg.cardViewF="F";
+ZmMsg.cardViewH="H";
+ZmMsg.cardViewM="M";
+ZmMsg.cardViewW="W";
+ZmMsg.cardViewW2="W2";
+ZmMsg.caseSensitive="Case Sensitive";
+ZmMsg.cc="Cc";
+ZmMsg.ccLabel="Cc:";
+ZmMsg.cell="Cell";
+ZmMsg.cellPadding="Padding Within Cells:";
+ZmMsg.cellProperties="Cell Properties";
+ZmMsg.cellRange="Cell Range";
+ZmMsg.cellSpacing="Space Around Cells:";
+ZmMsg.center="Center";
+ZmMsg.changeEditorMode="Change format";
+ZmMsg.changePassword="Change Password";
+ZmMsg.changeTime="Change Time";
+ZmMsg.chat="Chat";
+ZmMsg.chatWith="Chat with {0}";
+ZmMsg.chats="Chats";
+ZmMsg.checkAgain="Check again";
+ZmMsg.checkAll="Check All";
+ZmMsg.checkAllFeed="Reload All Feeds";
+ZmMsg.checkCalls="Get Calls";
+ZmMsg.checkCallsTooltip="Get new calls";
+ZmMsg.checkExternalMail="Get External Mail";
+ZmMsg.checkFeed="Load Feed";
+ZmMsg.checkForConflict="Check for Conflict";
+ZmMsg.checkMail="Get Mail";
+ZmMsg.checkMailPrefDefault="Run my default search";
+ZmMsg.checkMailPrefLabel="When I click Get Mail:";
+ZmMsg.checkMailPrefUpdate="Update my current view";
+ZmMsg.checkRssTooltip="Check for new RSS feed";
+ZmMsg.checkVoicemail="Get Voice Mail";
+ZmMsg.checkVoicemailTooltip="Get new voice mail messages";
+ZmMsg.chooseAddrBook="Choose Address Book";
+ZmMsg.chooseAddrBookToExport="Choose an address book to export:";
+ZmMsg.chooseAddrBookToImport="Choose an address book to import to:";
+ZmMsg.chooseClient="Which version would you like to use?";
+ZmMsg.chooseDate="Choose date";
+ZmMsg.chooseFolder="Choose Folder";
+ZmMsg.chooseFolderToFilter="Choose folders to apply filter to:";
+ZmMsg.chooseIdentity="Choose an identity to send the mail";
+ZmMsg.chooseSearchType="Choose which types of items are returned by your search";
+ZmMsg.chooseSignature="Choose a signature to use";
+ZmMsg.chooseTag="Choose Tag";
+ZmMsg.chooserDescription="Type in the box to filter the list. Tab to change focus. Arrow keys can be used to navigate within the list.";
+ZmMsg.clear="Clear";
+ZmMsg.clearAdvSearch="Clear Advanced Search";
+ZmMsg.clearAll="Clear All";
+ZmMsg.clearText="Clear text";
+ZmMsg.clickToAdd="Click to add";
+ZmMsg.clickToDrawABorder="Click to draw a border:";
+ZmMsg.clientAdvanced="Advanced (Ajax)";
+ZmMsg.clientLoginNotice='<a target="_new" href="http://www.zimbra.com">Zimbra</a> :: the leader in open source messaging and collaboration :: <a target="_new" href="http://www.zimbra.com/blog">Zimbra Blog</a> <a target="_new" href="http://wiki.zimbra.com">Zimbra Wiki</a>';
+ZmMsg.clientMobile="Mobile";
+ZmMsg.clientPreferred="Default";
+ZmMsg.clientStandard="Standard (HTML)";
+ZmMsg.clientType="Client Type:";
+ZmMsg.clientUnsupported="Note that your web browser or display does not fully support the Advanced version. We strongly recommend that you use the Standard client.";
+ZmMsg.clientWhatsThisMessage='<center style="margin-bottom:3px;"><b>Client Types:</b></center>\t<b>Advanced</b> offers the full set of Web collaboration features. This Web Client works best with newer browsers and faster Internet connections. <br><br><b>Standard</b> is recommended when Internet connections are slow, when using older browsers, or for easier accessibility. <br><br><b>Mobile</b> is recommended for mobile devices. <br><br>To set <b>Default</b> to be your preferred client type, change the login options in your Preferences, General tab after you log in.';
+ZmMsg.close="Close";
+ZmMsg.closeSearchBuilder="Close Advanced Search";
+ZmMsg.closeTooltip="Return to previous view";
+ZmMsg.clown="clown";
+ZmMsg.code="Code";
+ZmMsg.collapsedBorders="Collapsed Borders";
+ZmMsg.colorLabel="Color:";
+ZmMsg.columnBrowserView="Column Browser View";
+ZmMsg.compBadAddresses="<p>The following addresses appear to be invalid: {0}</p><p>Send anyway?</p>";
+ZmMsg.compBadAttendees="<p>The following attendees appear to be invalid: {0}</p><p>Save anyway?</p>";
+ZmMsg.compSubjectMissing="No subject. Send anyway?";
+ZmMsg.company="Company";
+ZmMsg.complete="Complete";
+ZmMsg.completed="Completed";
+ZmMsg.compose="Compose";
+ZmMsg.composeAsHTML="As HTML";
+ZmMsg.composeAsText="As Text";
+ZmMsg.composeDisabled="You currently have not configured any account for composing messages.";
+ZmMsg.composeInNewWin="Always compose in new window";
+ZmMsg.composeLabel="Compose:";
+ZmMsg.composeMessages="Compose messages:";
+ZmMsg.composeMoreOptions="Additional composing options can be set on the <a href='#Prefs.Accounts' onclick='skin.gotoPrefs(\"ACCOUNTS\");return false'>Accounts Page</a>";
+ZmMsg.composeOptions="Change format";
+ZmMsg.composeReplyEmail="When replying to an email:";
+ZmMsg.composeReplyLabel="Reply / Reply All:";
+ZmMsg.composeUsing="Default editor";
+ZmMsg.composing="Composing";
+ZmMsg.composingMessages="Composing Messages";
+ZmMsg.confidential="Confidential";
+ZmMsg.configureWithAdmin="Configure with Admin Console";
+ZmMsg.confirm="Confirm";
+ZmMsg.confirmCancelAppt="Are you sure you want to delete this appointment?";
+ZmMsg.confirmCancelApptFutureInstances="cancel only the selected instance and everything after";
+ZmMsg.confirmCancelApptInst="Are you sure you want to delete this meeting instance?";
+ZmMsg.confirmCancelApptList="Are you sure you want to delete these appointments?";
+ZmMsg.confirmCancelApptReply="Do you want to edit the appointment cancellation message?";
+ZmMsg.confirmCancelApptSeries="Are you sure you want to delete this recurring appointment?";
+ZmMsg.confirmCancelApptWholeSeries="cancel the entire series";
+ZmMsg.confirmCancelTask="Are you sure you want to permanently delete the selected task(s)?";
+ZmMsg.confirmDeleteCalendar='Are you sure you want to permanently delete the "{0}" calendar?';
+ZmMsg.confirmDeleteContact="Are you sure you want to delete this contact?";
+ZmMsg.confirmDeleteFolder='Are you sure you want to permanently delete the "{0}" folder?';
+ZmMsg.confirmDeleteItem='Are you sure you want to delete "{0}"?';
+ZmMsg.confirmDeleteItemList="Are you sure you want to delete the selected items?";
+ZmMsg.confirmDeleteMissingFolder='The shared folder "{0}" is no longer accessible. Would you like to delete it?';
+ZmMsg.confirmDeleteNotebook='Are you sure you want to permanently delete the "{0}" notebook?';
+ZmMsg.confirmDeleteRule="Are you sure you want to delete this rule?";
+ZmMsg.confirmDeleteRules="Are you sure you want to delete these rules?";
+ZmMsg.confirmDeleteSavedSearch='Are you sure you want to delete the "{0}" saved search?';
+ZmMsg.confirmDeleteTaskFolder='Are you sure you want to permanently delete the "{0}" task list?';
+ZmMsg.confirmDisplayAddresss="<b>Recipients:</b>";
+ZmMsg.confirmEmptyFolder='Are you sure you want to permanently delete everything within the "{0}" folder?';
+ZmMsg.confirmEmptyTrashFolder="This action will delete all items in both the Email and Address Book trash folders. Are you sure that you want to permanently delete everything in the trash folder?";
+ZmMsg.confirmExistingContacts="<b>Recipients already in your contacts:</b>";
+ZmMsg.confirmExitPreferences="Would you like to save your changes?";
+ZmMsg.confirmExitPreferencesChangeAcct="Save your changes before switching accounts?";
+ZmMsg.confirmFilterDetailsSave="Your filter rule is incomplete. Do you want to continue saving locally?";
+ZmMsg.confirmModifyApptReply="Do you want to edit the appointment modification message?";
+ZmMsg.confirmNewAddresses="<b>Recipients not in your address book:</b>";
+ZmMsg.confirmNewAddressesCheck="(check the contacts you want to add)";
+ZmMsg.confirmPasswordHasWhitespace="The confirm password field has whitespace. Please correct this, and resubmit your change request.";
+ZmMsg.confirmRemovePopAccount='<b>Are you sure you want to remove the account "{0}"?</b><p><b>Note:</b> Account will not be removed until you save the preferences.';
+ZmMsg.confirmSummary="Message Sent: {0}";
+ZmMsg.confirmed="Confirmed";
+ZmMsg.contact="Contact";
+ZmMsg.contactCreated="Contact Created";
+ZmMsg.contactList="List";
+ZmMsg.contactPickerHint="Type recipient's name here.";
+ZmMsg.contactSaved="Contact Saved";
+ZmMsg.contacts="Contacts";
+ZmMsg.contactsImportedResult="{0,number} {0,choice,0#Contacts|1#Contact|2#Contacts} Imported";
+ZmMsg.contains="contains";
+ZmMsg.content="Content";
+ZmMsg.convCountTooltip="Total Messages in Conversation";
+ZmMsg.convOrderAscending="Expand conversations from old to new";
+ZmMsg.convOrderDescending="Expand conversations from new to old";
+ZmMsg.conversation="Conversation";
+ZmMsg.conversations="Conversations";
+ZmMsg.convertCamelCase="Convert all CamelCase words to links";
+ZmMsg.convertCamelCaseMsg="This will convert all CamelCase words into wiki links. Continue?";
+ZmMsg.copy="Copy";
+ZmMsg.count="Count";
+ZmMsg.createAppt="Create Appointment";
+ZmMsg.createNewAddrBook="Create New Address Book";
+ZmMsg.createNewAppt="Create New Appointment";
+ZmMsg.createNewBriefcaseItem="Create New Briefcase Folder";
+ZmMsg.createNewCalendar="Create New Calendar";
+ZmMsg.createNewContact="Create New Contact";
+ZmMsg.createNewFolder="Create New Folder";
+ZmMsg.createNewMsg="Create New Message";
+ZmMsg.createNewNotebook="Create New Notebook";
+ZmMsg.createNewPage="Create New Page";
+ZmMsg.createNewRosterItem="Create New Buddy";
+ZmMsg.createNewSection="Create New Notebook";
+ZmMsg.createNewTag="Create New Tag";
+ZmMsg.createNewTask="Create New Task";
+ZmMsg.createNewTaskFolder="Create New Task List";
+ZmMsg.createNewTaskHint="Click here to add a new Task";
+ZmMsg.createSlideShow="Create Slide Show";
+ZmMsg.createTask="Create Task";
+ZmMsg.created="Created";
+ZmMsg.createdOn="Created On";
+ZmMsg.createdOnLabel="Created on:";
+ZmMsg.creator="Creator";
+ZmMsg.crying="crying";
+ZmMsg.currency="Currency";
+ZmMsg.custom="Custom";
+ZmMsg.customRepeat="Custom Repeat";
+ZmMsg.customize="Customize";
+ZmMsg.customizeSettings="Customize settings";
+ZmMsg.cut="Cut";
+ZmMsg.cyan="Cyan";
+ZmMsg.daily="Daily";
+ZmMsg.dataSourceFailureDescription="Retrieving messages for the following external {0,choice,1#account has|2#accounts have} failed:";
+ZmMsg.dataSourceFailureInstructions="<b>The failed accounts will not update until the problem(s) have been resolved. Click OK to go to account preferences.</b>";
+ZmMsg.dataSourceFailureItem="<ul><li>{0} (failing since {1,date,short} {1,time,short})<br><font color=red><b>Error: {2}</b></font></li></ul>";
+ZmMsg.dataSourceFailureItem_noDate="<ul><li>{0}<br><font color=red><b>Error: {1}</b></font></li></ul>";
+ZmMsg.dataSourceFailureTitle="External Account Failure";
+ZmMsg.dataSourceLoadFailure='Account "{0}" Failed';
+ZmMsg.dataSourceLoadSuccess='Account "{0}" Loaded';
+ZmMsg.dataSourceTestFailure="Failed";
+ZmMsg.dataSourceTestSuccess="Success";
+ZmMsg.dataTypesHint="Include all folders from the following applications:";
+ZmMsg.dataTypesLabel="Data types:";
+ZmMsg.date="Date";
+ZmMsg.dateDue="Due Date";
+ZmMsg.dateDueLabel="Due Date:";
+ZmMsg.dateLabel="Date:";
+ZmMsg.declineShare="Decline Share";
+ZmMsg.declineShareConfirm="Are you sure you want to decline the {1} share from {0}?";
+ZmMsg.declined="Declined";
+ZmMsg.dedupeAll="Ignore message";
+ZmMsg.dedupeMoveToInbox="Move the sent message to Inbox";
+ZmMsg.dedupeNone="Place in Inbox";
+ZmMsg.dedupeSecondCopy="Place in Inbox if I'm in To: or Cc:";
+ZmMsg.def="Default";
+ZmMsg.defLabel="Default:";
+ZmMsg.defaultAccountName="DEFAULT";
+ZmMsg.defaultCalendarTimezone="Default timezone for new appointments";
+ZmMsg.defaultFontSettings="Default font settings (HTML compose)";
+ZmMsg.defaultIdentity="Default Identity";
+ZmMsg.defaultIdentityName="DEFAULT";
+ZmMsg.defaultInviteReplyAcceptInstanceMessage="I will attend on {0,date,full}.\r\n\r\n";
+ZmMsg.defaultInviteReplyAcceptMessage="Yes, I will attend.\r\n\r\n";
+ZmMsg.defaultInviteReplyCancelInstanceMessage="I will attend on {0,date,full}.\r\n\r\n";
+ZmMsg.defaultInviteReplyCancelMessage="Yes, I will attend.\r\n\r\n";
+ZmMsg.defaultInviteReplyDeclineInstanceMessage="I won''t attend on {0,date,full}.\r\n\r\n";
+ZmMsg.defaultInviteReplyDeclineMessage="No, I won''t attend.\r\n\r\n";
+ZmMsg.defaultInviteReplyNewTimeMessage="I would like to propose a time change.\r\n\r\n";
+ZmMsg.defaultInviteReplyResourceAcceptInstanceMessage="The resource has been scheduled on {0,date,full}.\r\n\r\n";
+ZmMsg.defaultInviteReplyResourceAcceptMessage="The resource has been scheduled.\r\n\r\n";
+ZmMsg.defaultInviteReplyResourceDeclineInstanceMessage="The resource could not be scheduled on {0,date,full}.\r\n\r\n";
+ZmMsg.defaultInviteReplyResourceDeclineMessage="The resource could not be scheduled.\r\n\r\n";
+ZmMsg.defaultInviteReplyResourceTentativeInstanceMessage="The resource might be scheduled on {0,date,full}.\r\n\r\n";
+ZmMsg.defaultInviteReplyResourceTentativeMessage="The resource might be scheduled.\r\n\r\n";
+ZmMsg.defaultInviteReplyTentativeInstanceMessage="I might attend on {0,date,full}.\r\n\r\n";
+ZmMsg.defaultInviteReplyTentativeMessage="I might attend.\r\n\r\n";
+ZmMsg.defaultPageName="Page";
+ZmMsg.defaultPort="(Default is {0})";
+ZmMsg.defaultViewLabel="Default View:";
+ZmMsg.defaultsPageRestore="Page Reverted";
+ZmMsg.defaultsRestored="Defaults Restored. Please Save Changes";
+ZmMsg.deferred="Deferred";
+ZmMsg.defualtTimezone="Default Timezone:";
+ZmMsg.del="Delete";
+ZmMsg.delAll="Delete All";
+ZmMsg.delConv="Delete Conversation";
+ZmMsg.delMsg="Delete Selected Message(s)";
+ZmMsg.deleteApptInstance="Delete Instance";
+ZmMsg.deleteApptListQuestion="Would you like to delete the instances or series of each appointment?";
+ZmMsg.deleteApptQuestion="Would you like to delete only this instance or the series?";
+ZmMsg.deleteApptSeries="Delete Series";
+ZmMsg.deleteCell="Delete Cell";
+ZmMsg.deleteColumn="Delete Column";
+ZmMsg.deleteGroupError="The group cannot be deleted because it still contains buddies.";
+ZmMsg.deleteInstance="Delete this instance";
+ZmMsg.deleteInstances="Delete the instances";
+ZmMsg.deleteInviteOnReply="Delete invite on reply";
+ZmMsg.deleteInviteOnReplyLabel="After responding to an invitation:";
+ZmMsg.deletePermanentTooltip="Delete selected item(s) permanently";
+ZmMsg.deleteReadonly="You have selected one or more appointments which are read only. These appointments cannot be deleted.";
+ZmMsg.deleteRecurringItem="Delete Recurring Item(s)";
+ZmMsg.deleteRow="Delete Row";
+ZmMsg.deleteSeries="Delete the series";
+ZmMsg.deleteTable="Delete Table";
+ZmMsg.deleteTooltip="Move selected item(s) to Trash";
+ZmMsg.deny="Deny";
+ZmMsg.descending="Descending";
+ZmMsg.description="Description";
+ZmMsg.destinationLabel="Destination:";
+ZmMsg.detach="Open in a separate window";
+ZmMsg.detachAnyway="You will have to reattach your file(s). Open in new window anyway?";
+ZmMsg.detachTT="Launch in a separate window";
+ZmMsg.detachTooltip="Compose in a separate window";
+ZmMsg.detailView="Detail View";
+ZmMsg.detailedCards="Card";
+ZmMsg.details="Details";
+ZmMsg.devil="devil";
+ZmMsg.directionLabel="Direction:";
+ZmMsg.discard="Discard";
+ZmMsg.dismiss="Dismiss";
+ZmMsg.dismissAll="Dismiss All";
+ZmMsg.display="Display";
+ZmMsg.displayAsHTML="As HTML (when possible)";
+ZmMsg.displayAsText="As Text";
+ZmMsg.displayCalendar="Choose how the calendar is displayed";
+ZmMsg.displayContacts="Choose how contacts are displayed";
+ZmMsg.displayContactsLabel="Display contacts per page:";
+ZmMsg.displayExternalImages="Display Images";
+ZmMsg.displayFormatLabel="Display format:";
+ZmMsg.displayIM="Choose how IM chats are displayed";
+ZmMsg.displayLabel="Display:";
+ZmMsg.displayMail="Display Mail:";
+ZmMsg.displayMailToolTip="Choose how mail is displayed";
+ZmMsg.displayMessages="Displaying Messages";
+ZmMsg.dndTooltip="Tip: drag and drop files from your desktop to add attachments to this message.";
+ZmMsg.document="Document";
+ZmMsg.documentName="Document Name";
+ZmMsg.documents="Documents";
+ZmMsg.domain="Domain";
+ZmMsg.domainPart="domain part";
+ZmMsg.domains="Domains";
+ZmMsg.done="Done";
+ZmMsg.dontInclude="Don't include original message";
+ZmMsg.dontNotifyOrganizer="Don't notify organizer";
+ZmMsg.dontNotifyOrganizerLabel="Don't Notify Organizer";
+ZmMsg.downLabel="Down";
+ZmMsg.download="Download";
+ZmMsg.downloadAll="Download all attachments";
+ZmMsg.downloadVoicemail="Download";
+ZmMsg.downloadVoicemailTooltip="Download the selected voice mail message";
+ZmMsg.draft="Draft";
+ZmMsg.draftSaved="Draft Saved";
+ZmMsg.draftSavedAuto="Draft Autosaved at {0}";
+ZmMsg.drafts="Drafts";
+ZmMsg.dueDate="Due Date";
+ZmMsg.duplicateAttendee="Attendee {0} is already added";
+ZmMsg.duration="Duration";
+ZmMsg.durationDays="{0} - {1}";
+ZmMsg.durationHours="{0} - {1}";
+ZmMsg.durationLabel="Duration:";
+ZmMsg.durationMultiDays="{0} {1} - {2} {3}";
+ZmMsg.edit="Edit";
+ZmMsg.editAll="Edit all";
+ZmMsg.editApptQuestion="Would you like to open only this instance or the series?";
+ZmMsg.editAsNew="Edit as New";
+ZmMsg.editContact="Edit Contact";
+ZmMsg.editFilter="Edit Filter";
+ZmMsg.editImg="Edit Image";
+ZmMsg.editNotebookChrome="Edit Template for Folder";
+ZmMsg.editNotebookFooter="Edit Footer for Folder";
+ZmMsg.editNotebookHeader="Edit Header for Folder";
+ZmMsg.editNotebookIndex="Edit Table of Contents";
+ZmMsg.editNotebookSideBar="Edit Side Bar for Folder";
+ZmMsg.editNotebookStyles="Edit Styles for Folder";
+ZmMsg.editProperties="Edit Properties";
+ZmMsg.editPropertiesTooltip="Edit the selected item's properties";
+ZmMsg.editReply="Edit Reply";
+ZmMsg.editRosterItem="Edit Buddy";
+ZmMsg.editTooltip="Edit the selected item";
+ZmMsg.editValue="Edit Value";
+ZmMsg.email="Email";
+ZmMsg.emailAddr="Email Address";
+ZmMsg.emailAddrHint="Email Address";
+ZmMsg.emailAddrLabel="Email address:";
+ZmMsg.emailAndIM="Email and Instant Messaging";
+ZmMsg.emailDeleteSchedule="Scheduled Email Deletion";
+ZmMsg.emailDeleteScheduleInboxRead="Inbox (Read):";
+ZmMsg.emailDeleteScheduleInboxUnread="Inbox (Unread):";
+ZmMsg.emailDeleteScheduleJunk="Junk:";
+ZmMsg.emailDeleteScheduleSent="Sent Email:";
+ZmMsg.emailDeleteScheduleTrash="Trash:";
+ZmMsg.emailLabel="Email:";
+ZmMsg.emailNotificationDescription="Send an email notification to:";
+ZmMsg.emailNotificationError="The email notification address is invalid";
+ZmMsg.emailNotificationLabel="Email Notification:";
+ZmMsg.emailedContacts="Emailed Contacts";
+ZmMsg.emoticons="Emoticons";
+ZmMsg.empty="Empty";
+ZmMsg.emptyCell="Empty Cell";
+ZmMsg.emptyContact="Empty Contact Not Saved";
+ZmMsg.emptyContactSave="Contact must have at least one field set.";
+ZmMsg.emptyDocName="Document must have a file name.";
+ZmMsg.emptyFolder="Empty Folder";
+ZmMsg.emptyGroup="Empty Group Not Saved";
+ZmMsg.emptyJunk="Empty Junk";
+ZmMsg.emptyTrash="Empty Trash";
+ZmMsg.enableAppleICalDelegation="Enable delegation for Apple iCal CalDAV client";
+ZmMsg.end="End";
+ZmMsg.endDate="End Date";
+ZmMsg.endLabel="End:";
+ZmMsg.endOn="End On:";
+ZmMsg.endTime="End Time";
+ZmMsg.endTimeLabel="End Time:";
+ZmMsg.enrichedText="Enriched Text";
+ZmMsg.enterAddrBelow="Or enter addresses below (comma separated)";
+ZmMsg.enterAddresses="Enter addresses on separate lines";
+ZmMsg.enterCommand="Enter Command:";
+ZmMsg.enterEmailAddress="enter email address";
+ZmMsg.enterEmailAddressOrDomain="enter email address or domain";
+ZmMsg.enterNewPassword="Please enter a new password and re-enter it in the confirmation field.";
+ZmMsg.enterUsername="Please enter your username and password.";
+ZmMsg.entireAddress="entire address";
+ZmMsg.error="error";
+ZmMsg.errorAlreadyExists='A folder with name "{0}" already exists.';
+ZmMsg.errorApplication="An unknown application error has occurred.";
+ZmMsg.errorAttachment="Attachment error: {0}<br>Unable to upload attachment.";
+ZmMsg.errorAttachmentRemove="Unable to remove attachment.";
+ZmMsg.errorAttachmentTooBig="Attachment size is too big.";
+ZmMsg.errorBrowserUnsupported="We have detected that you are running <b>{0} {1}</b>,which is an unsupported browser for the Zimbra Collaboration Suite. The Zimbra Collaboration Suite is supported on:<br /><ul><li>IE 6.0+</li><li>Mozilla 1.4+</li><li>Netscape 7.1+</li><li>Firefox 1.0+</li><li>Safari 1.3+ (BETA)</li></ul><br />";
+ZmMsg.errorCalendarParse="There is an error in the syntax of your query. Correct the syntax and run your query again.";
+ZmMsg.errorCalendarSettingAfterCreate="Calendar was created successfully but an error occurred setting properties.";
+ZmMsg.errorCannotDeleteFolder="Only empty folders can be deleted for this account. Please delete all messages in this folder first.";
+ZmMsg.errorCannotRename='Cannot rename folder "{0}".';
+ZmMsg.errorCap="Error";
+ZmMsg.errorContact="If the problem persists, please contact your System Administrator.";
+ZmMsg.errorCookiesDisabled="Oops! It appears your browser does not allow cookies. You need to enable cookies in order to use the Zimbra Collaboration Suite.";
+ZmMsg.errorCreateContact="Unable to Create Contact";
+ZmMsg.errorCreateFile="Unable to Create File";
+ZmMsg.errorCreateGroup="Unable to Create Group";
+ZmMsg.errorCreateUrl="Unable to create URL from email.";
+ZmMsg.errorDate="You have entered an invalid date.";
+ZmMsg.errorDefaultIdentityName='The name "{0}" is not allowed.';
+ZmMsg.errorDeletePopFolder='Unable to delete folder because it is associated to the POP account named "{1}".<p>In order to delete this folder, change the destination folder for the POP account or delete the POP account.';
+ZmMsg.errorDuplicateName="Name is not unique.";
+ZmMsg.errorEndByDate="End by date cannot be before start date.";
+ZmMsg.errorFileAlreadyExists='A file with name "{0}" already exists.';
+ZmMsg.errorGeneric="Could not complete operation.";
+ZmMsg.errorGettingAppts="Error Getting Appointments";
+ZmMsg.errorGroupName="Group Name is a required field.";
+ZmMsg.errorHtmlSignatureTooLong="HTML Signature exceeds maximum length of {0,number} ( it includes the html tags ).";
+ZmMsg.errorIdentityAlreadyExists='An identity with name "{0}" already exists.';
+ZmMsg.errorImportNoContent="Import Error: file not found or file has no content.";
+ZmMsg.errorImportStatus="Import Error {0}";
+ZmMsg.errorImporting="An error occurred during the import";
+ZmMsg.errorInvalidDates="Invalid dates (make sure end date/time is after start date/time).";
+ZmMsg.errorInvalidEmail="Email format not understood.";
+ZmMsg.errorInvalidEmail2="Invalid email format found.";
+ZmMsg.errorInvalidFolder="Folder does not exist: {0}";
+ZmMsg.errorInvalidName='Sorry, "{0}" is not a valid name. It contains at least one invalid character.';
+ZmMsg.errorInvalidPageOrSectionName='A page or notebook with name "{0}" already exists.\nPlease select a different name.';
+ZmMsg.errorInvalidPass="New password does not meet the system's rules (i.e. length). Contact your System Administrator for more information.";
+ZmMsg.errorInvalidPhone="The phone number is invalid";
+ZmMsg.errorInvalidPrefName="Invalid preference name.";
+ZmMsg.errorInvalidPrefValue="Invalid preference value.";
+ZmMsg.errorInvalidSize="The size value is invalid.";
+ZmMsg.errorJavaScriptRequired='<font face=arial>JavaScript must be enabled in order for you to use the Zimbra advanced client. However, it seems JavaScript is either disabled or not supported by your browser. To use Zimbra, enable JavaScript by changing your browser options, then <a href="{0}">try again</a> or click <a href="{1}">here</a> to switch to the basic client which does not require JavaScript.<br><br><a target="_new" "href="http://www.zimbra.com">Zimbra</a> :: the leader in open source messaging and collaboration<br><a target="_new" href="http://www.zimbra.com/blog">Zimbra Blog</a> | <a target="_new" href="http://wiki.zimbra.com">Zimbra Wiki</a></font>';
+ZmMsg.errorLabel="Error:";
+ZmMsg.errorLessThanOne="Value must be greater than zero.";
+ZmMsg.errorMaintenanceMode="This account is currently in maintenance mode.";
+ZmMsg.errorMissingFwdAddr="A forwarding address is required if not saving local copy of messages.";
+ZmMsg.errorMissingGroup="Group Name and Group Members are required fields.";
+ZmMsg.errorMissingNotifyAddr="An address is required for notification.";
+ZmMsg.errorMissingRequired="Required fields not specified.";
+ZmMsg.errorMissingSubject="Subject is a required field.";
+ZmMsg.errorModifyContact="Unable to Modify Contact";
+ZmMsg.errorMoveAppt="Unable to move appointment.";
+ZmMsg.errorMovePopFolder='Unable to move folder because it is associated to the POP account named "{1}".<p>In order to move this folder, change the destination folder for the POP account or delete the POP account.';
+ZmMsg.errorMyCardDelete="My Card cannot be deleted.";
+ZmMsg.errorMyCardMove="My Card cannot be moved.";
+ZmMsg.errorNetwork="A network error has occurred.";
+ZmMsg.errorNoActiveX="You need to enable ActiveX controls in order to use the Zimbra Collaboration Suite.";
+ZmMsg.errorNoPhone="You need to enter a phone number to forward from.";
+ZmMsg.errorNoSuchConv="No such conversation exists.";
+ZmMsg.errorNoSuchFolder="No such folder exists.";
+ZmMsg.errorNoSuchMsg="No such message exists.";
+ZmMsg.errorNoSuchPart="No such message part exists.";
+ZmMsg.errorNoSuchSavedSearch="No such saved search exists.";
+ZmMsg.errorNoSuchTag="No such tag exists.";
+ZmMsg.errorNoWeekdayChecked="No weekday(s) checked.";
+ZmMsg.errorNotAllowedFile="Please attach allowed files ({0})";
+ZmMsg.errorNotAuthenticated="User not authenticated.";
+ZmMsg.errorNotImageFile="Please attach an image file (JPG, PNG, GIF)";
+ZmMsg.errorPassChange="Your password is no longer valid. Please choose a new password.";
+ZmMsg.errorPassChangeTooSoon="Password cannot be changed too soon.";
+ZmMsg.errorPassLocked="Password locked. User not allowed to change password. Please contact your System Administrator.";
+ZmMsg.errorPassRecentlyUsed="The password you submitted has recently been used. Please choose a different password.";
+ZmMsg.errorPermission="Permission denied.";
+ZmMsg.errorPermissionMsg="In order to view this, you must have appropriate permission.";
+ZmMsg.errorPermissionRequired="In order for the recipient to view the links, they must<br> have permission to view the contents of the containing folder. <p> <b>Do you want to send the links anyway?</b>";
+ZmMsg.errorPhoneNotUnique="The phone number is already in the list of numbers being forwarded.";
+ZmMsg.errorPrivateVoicemail="The selected voice mail message is private, so it can not be attached to an email message.";
+ZmMsg.errorQueryParse="Unable to parse the search query.";
+ZmMsg.errorQuotaExceeded="Could not attach the file(s) because you have exceeded your mail quota.";
+ZmMsg.errorReports="Error Reports";
+ZmMsg.errorSaving="Cannot save. You have errors that must be corrected.";
+ZmMsg.errorSavingAppt="Unable to save appointment.";
+ZmMsg.errorSavingPageNameRequired="Cannot save page. You must enter a name for the new page.";
+ZmMsg.errorSavingWithMessage="Cannot save. You have errors that must be corrected:<p>{0}";
+ZmMsg.errorSearchNotExpanded="Not all results were returned (too many results were found). Please be more specific in your search criteria.";
+ZmMsg.errorService="A network service error has occurred.";
+ZmMsg.errorSignatureTooLong="Signature exceeds maximum length of {0,number}.";
+ZmMsg.errorSubFolderNotAllowed="Subfolders under {0} are not allowed.";
+ZmMsg.errorTooManyContacts="Contact could not be created because you have exceeded your contact quota.";
+ZmMsg.errorTooManyIdentities="The identity could not be created because you have exceeded your identity quota.";
+ZmMsg.errorTryAgain="Please correct any errors and retry.";
+ZmMsg.errorUrlMissing="Please enter a valid URL.";
+ZmMsg.errorWhiteBlackListExceeded="You have reached your maximum limit for this list.";
+ZmMsg.event="Event";
+ZmMsg.everyDay="Every Day";
+ZmMsg.everyMonth="Every Month";
+ZmMsg.everyWeek="Every Week";
+ZmMsg.everyYear="Every Year";
+ZmMsg.exactMatch="matches exactly";
+ZmMsg.exampleEmailAddr="e.g. bob@example.com";
+ZmMsg.exampleEmailName="e.g. Bob Smith";
+ZmMsg.exampleFolderNames="folder name(s)";
+ZmMsg.exampleMailServer="e.g. mail.example.com";
+ZmMsg.excludeFromFreeBusy="Exclude this calendar when reporting free/busy times";
+ZmMsg.execute="Execute";
+ZmMsg.exists="exists";
+ZmMsg.exitDocNotSaved="Document is not saved.";
+ZmMsg.exitDocUnSavedChanges="Document may contain unsaved changes.";
+ZmMsg.expand="Expand";
+ZmMsg.expandAll="Expand All";
+ZmMsg.expandCollapse="Expand / Collapse";
+ZmMsg.explorerView="Explorer View";
+ZmMsg.exportEmptyName="No Data to Export";
+ZmMsg.exportErrorMissingFolder="Must specify folder to export.";
+ZmMsg.exportErrorRootNotAllowed="Not allowed to export from root folder for this type.";
+ZmMsg.exportFailed="Export failed.";
+ZmMsg.exportFilenamePrefixAllFolders="All";
+ZmMsg.exportIgnoreArchive="Ignore Local Folders";
+ZmMsg.exportLabel="Export:";
+ZmMsg.exportSkipMeta="Only export content files, exclude meta data";
+ZmMsg.exportSuccess="Export succeeded.";
+ZmMsg.exportToCSV="Export as .CSV File";
+ZmMsg.exportToCSVHint='You can export your contacts in the standard "Comma-Separated Values" (.csv) format, then import them into another contact manager program. See documentation in the other program for help in importing.';
+ZmMsg.exportToICS="Export as .ICS File";
+ZmMsg.exportToICSHint="You can export your appointments in the standard iCalendar (.ics) format, then import them into another calendar program. See documentation in the other program for help in importing.";
+ZmMsg.exportToTGZHint='All account data can be exported to a "Tar-GZipped" (.tgz) format which can be imported back into the system.';
+ZmMsg.expression="Expression";
+ZmMsg.externalAccess="Access from Other Mail Clients";
+ZmMsg.externalAccessPop="POP access:";
+ZmMsg.externalAccessPopCurrentValue="Current value is to only download mail that has arrived after {0,date,short} at {0,time,short}.";
+ZmMsg.externalAccessPopDownloadAll="Allow all mail, including old mail, to be downloaded";
+ZmMsg.externalAccessPopDownloadFromNow="Allow only mail from now to be downloaded";
+ZmMsg.externalAccessPopNotSet="Current value is to download all mail, including old mail.";
+ZmMsg.externalImages="External images are not displayed.";
+ZmMsg.extra="Extra";
+ZmMsg.fColorLabel="Color:";
+ZmMsg.fFamilyLabel="Font:";
+ZmMsg.fSizeLabel="Size:";
+ZmMsg.favIconUrl="/img/logo/favicon.ico";
+ZmMsg.fax="Fax";
+ZmMsg.feedInvalid="Content could not be retrieved. Make sure the following URL is an RSS/ATOM feed: {0}";
+ZmMsg.feedUnreachable="The following URL is not currently reachable: {0}";
+ZmMsg.fetchingAlexaThumbnail="Fetching<br />Thumbnail...";
+ZmMsg.fileAs="File As";
+ZmMsg.fileAsCompanyAsSecondaryOnly="({0})";
+ZmMsg.fileAsCompanyName="{1} ({0})";
+ZmMsg.fileAsFirstLast="{0} {1}";
+ZmMsg.fileAsLabel="File as:";
+ZmMsg.fileAsLastFirst="{1}, {0}";
+ZmMsg.fileAsNameAsSecondaryOnly="({0})";
+ZmMsg.fileAsNameCompany="{0} ({1})";
+ZmMsg.fileCreated="File Created";
+ZmMsg.fileIntoFolder="File into folder";
+ZmMsg.fileLabel="File:";
+ZmMsg.filename="Filename:";
+ZmMsg.files="Files";
+ZmMsg.filter="Filter";
+ZmMsg.filterActions="Perform the following actions:";
+ZmMsg.filterCondition="If {0,choice,0#any|1#all} of the following conditions are met:";
+ZmMsg.filterEdit="Edit Filter";
+ZmMsg.filterError="There was a problem parsing your filter rules:";
+ZmMsg.filterErrorAction='The action "{0}" is missing one or more values.';
+ZmMsg.filterErrorCondition='The condition "{0}" is missing one or more values.';
+ZmMsg.filterErrorIllegalCharacter='Filter values may not contain double-quote (") or backslash (\\)';
+ZmMsg.filterErrorNameExists="There is already a filter by that name.";
+ZmMsg.filterErrorNoName="The new filter needs a name.";
+ZmMsg.filterForwardActionWarning='One or more of the selected filters contains an action to "Forward To Address". This action cannot be run on existing filters and will be ignored.';
+ZmMsg.filterMoveDown="Move Down";
+ZmMsg.filterMoveUp="Move Up";
+ZmMsg.filterName="Filter Name";
+ZmMsg.filterNameLabel="Filter Name:";
+ZmMsg.filterRemove="Delete Filter";
+ZmMsg.filterRuleApplied="Filter run complete. {0} message(s) were affected.";
+ZmMsg.filterRuleChangesSavedImmediately="Note: Changes to filter rules are saved immediately.";
+ZmMsg.filterRules="Filters";
+ZmMsg.filterRun="Run Filter";
+ZmMsg.filtersSaved="Filters Saved";
+ZmMsg.find="Find";
+ZmMsg.findAttendees="Find Attendees";
+ZmMsg.findLabel="Find:";
+ZmMsg.findLocations="Find Locations";
+ZmMsg.findNReplaceTitle="Find and Replace";
+ZmMsg.findResources="Find Resources";
+ZmMsg.findShares="Find Shares";
+ZmMsg.findWhatLabel="Find what:";
+ZmMsg.finishLoading="Click here to finish loading this contact";
+ZmMsg.firstNameHint="First Name";
+ZmMsg.fixedCellWidth="Fixed Cell Width";
+ZmMsg.flag="Flag";
+ZmMsg.flagged="Flagged";
+ZmMsg.flags="Flags";
+ZmMsg.flashBrowser="Flash the browser title";
+ZmMsg.flashMailAppTab="Highlight the Mail tab";
+ZmMsg.floor="Floor";
+ZmMsg.folder="Folder";
+ZmMsg.folderLabel="Folder:";
+ZmMsg.folderLc="folder";
+ZmMsg.folderName="Folder name";
+ZmMsg.folderNameReserved="That folder name is reserved. Please use another name.";
+ZmMsg.folderNoLocation="You must select a location for the folder.";
+ZmMsg.folderNotify="Folder Notifications";
+ZmMsg.folderOrSearchNameExists="A folder or saved search with that name already exists. Please use another name.";
+ZmMsg.folderProperties="Folder Properties";
+ZmMsg.folderSharing="Sharing for this folder";
+ZmMsg.folderSize="Folder Size";
+ZmMsg.folderType="Folder type:";
+ZmMsg.folderUnread="{0} ({1})";
+ZmMsg.folders="Folders";
+ZmMsg.foldersLabel="Folders:";
+ZmMsg.foldersSearches="Folders and Saved Searches";
+ZmMsg.foldersShown="{0} {1} shown";
+ZmMsg.fontBackground="Font Background";
+ZmMsg.fontBackgroundLabel="Font Background:";
+ZmMsg.fontColor="Font Color";
+ZmMsg.fontColorLabel="Font Color:";
+ZmMsg.format="Format";
+ZmMsg.formatAsHtml="Format As HTML";
+ZmMsg.formatAsText="Format As Plain Text";
+ZmMsg.formatHtmlSource="HTML Source";
+ZmMsg.formatMediaWiki="MediaWiki Syntax";
+ZmMsg.formatNotSupported="Format not supported";
+ZmMsg.formatRichText="Rich Text";
+ZmMsg.formatTWiki="TWiki Syntax";
+ZmMsg.formatTooltip="Choose the format to compose in";
+ZmMsg.forward="Forward";
+ZmMsg.forwardAtt="Forward as Attachment";
+ZmMsg.forwardByEmail="Forward by Email";
+ZmMsg.forwardByEmailTooltip="Forward the selected voice mail message as an email attachment";
+ZmMsg.forwardCopyTo="Forward a copy to:";
+ZmMsg.forwardInclude="When forwarding:";
+ZmMsg.forwardInline="Forward Inline";
+ZmMsg.forwardInstance="Forward Instance";
+ZmMsg.forwardInvitesTo="Forward my invites to:";
+ZmMsg.forwardOptions="Change format, change how original is forwarded";
+ZmMsg.forwardSeries="Forward Series";
+ZmMsg.forwardTo="Forward to";
+ZmMsg.forwardToAddress="Forward to Address";
+ZmMsg.forwardTooltip="Forward the selected message";
+ZmMsg.forwardTooltipConv="Forward the most recent message in the conversation";
+ZmMsg.forwarded="Forwarded";
+ZmMsg.forwardedMessage="Forwarded Message";
+ZmMsg.forwardingEmail="When forwarding an email:";
+ZmMsg.forwardingLabel="Forward:";
+ZmMsg.fragment="Fragment";
+ZmMsg.fragmentIsEmpty="(This message is empty)";
+ZmMsg.free="Free";
+ZmMsg.freeBusyAllowAll="Allow both internal and external users to see my free/busy information";
+ZmMsg.freeBusyAllowLocal="Allow only internal users to see my free/busy information";
+ZmMsg.freeBusyAllowNone="Don't let anyone see my free/busy information";
+ZmMsg.freeBusyAllowSome="Allow only the following internal users to see my free/busy information:";
+ZmMsg.freeBusyLabel="Free / Busy:";
+ZmMsg.freeBusyLink="Mail Free & Busy link";
+ZmMsg.freeBusyLinkTooltip="Email Free & Busy link";
+ZmMsg.from="From";
+ZmMsg.fromDetail='Choose the name that appears in the "From" field of email messages';
+ZmMsg.fromLabel="From:";
+ZmMsg.fullname="{0} {1} {2} {4}";
+ZmMsg.fullnameMaiden="{0} {1} {2} ({3}) {4}";
+ZmMsg.fullnameMaidenSuffix="{0} {1} {2} ({3}) {4}, {5}";
+ZmMsg.fullnameSuffix="{0} {1} {2} {4}, {5}";
+ZmMsg.fw="Fw";
+ZmMsg.fwd="Fwd";
+ZmMsg.galAutocomplete="Include addresses in the Global Address List";
+ZmMsg.galAutocompleteFailure="GAL Auto-Complete Disabled";
+ZmMsg.galAutocompleteSession="GAL autocomplete has been temporarily disabled. Check to re-enable.";
+ZmMsg.galAutocompleteTimedOut="GAL Auto-Complete Timed Out";
+ZmMsg.galAutocompleteWaiting="Waiting for GAL...";
+ZmMsg.gb="GB";
+ZmMsg.general="General";
+ZmMsg.genericTextHint="Enter text";
+ZmMsg.gifImage="GIF Image";
+ZmMsg.global="Global";
+ZmMsg.globalInbox="Global Inbox";
+ZmMsg.gmail="Gmail";
+ZmMsg.goBack="Go back one page";
+ZmMsg.goForward="Go forward one page";
+ZmMsg.goToCalendar="Go to Calendar";
+ZmMsg.goToContacts="Go to Address Book";
+ZmMsg.goToDate="Go to date";
+ZmMsg.goToDocuments="Go to Documents";
+ZmMsg.goToFolder="Go to {0}";
+ZmMsg.goToHelp="Read online help documentation";
+ZmMsg.goToMail="Go to Mail";
+ZmMsg.goToOptions="View or edit your options";
+ZmMsg.goToPortal="Go to Welcome page";
+ZmMsg.goToTasks="Go to Tasks";
+ZmMsg.goToUrl="Go to {0}";
+ZmMsg.goToVoice="Go to Voice";
+ZmMsg.gotoBriefcase="Go to Briefcase";
+ZmMsg.grantFormText='To share a folder, choose the type and then press the "Share" button.';
+ZmMsg.granteeGone='<p>At least one user or group with whom the following items have been shared no longer exists:</p><ul>{0}</ul><p>Press OK to revoke those shares, or Cancel to exit. If you cancel, you can then revoke each share individually by clicking the "Revoke" link.</p>';
+ZmMsg.gray="Gray";
+ZmMsg.green="Green";
+ZmMsg.group="Contact Group";
+ZmMsg.groupBadAddresses="<p>The following addresses appear to be invalid: {0}</p><br>";
+ZmMsg.groupCreated="Group Created";
+ZmMsg.groupHint="Enter addresses on separate lines";
+ZmMsg.groupMailBy="Group mail by";
+ZmMsg.groupMembers="Group Members:";
+ZmMsg.groupMessagesLabel="Group mail by:";
+ZmMsg.groupNameLabel="Group Name:";
+ZmMsg.groupSaved="Group Saved";
+ZmMsg.happy="happy";
+ZmMsg.hardDeleteTooltip="Delete selected item(s)";
+ZmMsg.hasAlias="has alias";
+ZmMsg.header="Header";
+ZmMsg.headerNamed="Header Named";
+ZmMsg.heading1="Heading 1";
+ZmMsg.heading2="Heading 2";
+ZmMsg.heading3="Heading 3";
+ZmMsg.heading4="Heading 4";
+ZmMsg.heading5="Heading 5";
+ZmMsg.heading6="Heading 6";
+ZmMsg.heightLabel="Height:";
+ZmMsg.help="Help";
+ZmMsg.helpURI="/help/advanced/Zimbra_User_Help.htm";
+ZmMsg.hideBCC="Hide BCC";
+ZmMsg.hideDetails="Hide Details";
+ZmMsg.high="High";
+ZmMsg.highPriorityTooltip="This item has been marked as high priority";
+ZmMsg.hiliteObjects="Highlight objects.";
+ZmMsg.historyLabel="History";
+ZmMsg.home="Home";
+ZmMsg.horizRule="Horizontal Rule";
+ZmMsg.htmlDocument="HTML";
+ZmMsg.icon="Icon";
+ZmMsg.ics="ICS";
+ZmMsg.identities="Identities";
+ZmMsg.identitiesAdd="Add a new identity";
+ZmMsg.identitiesIntro="<b>Identities</b> group email settings together to allow you to quickly switch between different roles. For example, if you manage work and identity emails from the same account, you can have an identity for each that sets the signature, reply-to address, etc. When composing an email, a selector allows you to quickly switch between different identities.";
+ZmMsg.identitiesTab="Mail Identities";
+ZmMsg.identitiesUseDefault="Use same settings as Default Identity";
+ZmMsg.identityAdvanced="Advanced";
+ZmMsg.identityChangeWarning="Do you want to apply the changed settings? <br> <b>Any changes you have made to the message will be discarded.</b>";
+ZmMsg.identityInfoContent="Use mail identities to quickly customize Mail for different situations -- for example:<UL style='margin-top: 5px; margin-bottom: 5px;'><LI>To respond to mail from home or work using different addresses</LI><LI>To manage different roles in your job</LI></UL>You can always change the current identity when composing a message.";
+ZmMsg.identityInfoTitle="About Mail Identities:";
+ZmMsg.identityNameError="The identity name is invalid";
+ZmMsg.identityNameLabel="Identity name:";
+ZmMsg.identityTextExternal="{0} <{2}>";
+ZmMsg.identityTextPersona="{0} ({1} <{2}>)";
+ZmMsg.identityTextPrimary="{0} ({1} <{2}>)";
+ZmMsg.im="Instant Messaging";
+ZmMsg.imAccounts="Accounts";
+ZmMsg.imAddToBuddyList="Add {0} to your buddy list";
+ZmMsg.imAddress="Buddy Address";
+ZmMsg.imAddressLabel="Buddy Address:";
+ZmMsg.imAnonymousInfo="Make users of the room anonymous";
+ZmMsg.imAnonymousLabel="Anonymous:";
+ZmMsg.imAppTitle="IM [Beta]";
+ZmMsg.imArrivalLabel="When a message arrives:";
+ZmMsg.imBlock="Block";
+ZmMsg.imBootedYahoo="You have logged in to Yahoo! Messenger from another location.";
+ZmMsg.imBuddyArchive="View Chat Archive";
+ZmMsg.imChat="Chat";
+ZmMsg.imChatMultiWindow="Multiple Windows";
+ZmMsg.imChatTabbed="Tabbed Window";
+ZmMsg.imChatTitle="{0} ({1})";
+ZmMsg.imCloseAllChats="Close All Chats";
+ZmMsg.imCloseChat="Close This Chat";
+ZmMsg.imCloseOtherChats="Close Other Chats";
+ZmMsg.imCloseWindow="Close window";
+ZmMsg.imConference="Conference";
+ZmMsg.imConferenceRooms="Conference Rooms";
+ZmMsg.imConferences="Conferences";
+ZmMsg.imConfirmDeleteRosterItem="Are you sure you want to delete {0}?";
+ZmMsg.imCreateNewGroup="Create New Group";
+ZmMsg.imCustomStatusMsg="New Status Message...";
+ZmMsg.imEnteredChat="{0} has joined the conference";
+ZmMsg.imErrorYahooBuddy="Unable to add buddy from Yahoo! service.";
+ZmMsg.imErrorYahooBuddyLogin="Unable to add buddy from Yahoo! service because you are not logged in to Yahoo!. Do you want to log in to Yahoo!?";
+ZmMsg.imGateway="IM Service";
+ZmMsg.imGatewayDisconnectedHeader="You have been disconnected from Yahoo! Messenger because you signed in from another location.";
+ZmMsg.imGatewayLabel="IM Service:";
+ZmMsg.imGatewayLoggedInHeader="You are logged in to Yahoo! Messenger as <b>{0}</b>";
+ZmMsg.imGatewayNotLoggedInHeader="You are not logged in to Yahoo! Messenger. Login with your Yahoo! ID and password below.";
+ZmMsg.imGateway_aol="AOL";
+ZmMsg.imGateway_msn="MSN";
+ZmMsg.imGateway_xmpp="Zimbra (local)";
+ZmMsg.imGateway_yahoo="Yahoo!";
+ZmMsg.imGroupChat="Group Chat";
+ZmMsg.imGroupExists="A group with that name exists. Please use another name.";
+ZmMsg.imGroupItemTooltip="You have {1,number} {1,choice,0#buddies|1#buddy|2#buddies} in group {0}";
+ZmMsg.imGroupName="Group Name";
+ZmMsg.imGroups="Buddy Groups";
+ZmMsg.imGroupsLabel="Buddy Groups:";
+ZmMsg.imGwOfflineTooltip="You are not logged in to {0}. <BR/> Click here to log in.";
+ZmMsg.imGwOnlineTooltip="You are logged in to {0} as {1}. <BR/> Click here to log out.";
+ZmMsg.imIdle="Idle";
+ZmMsg.imInvitation="Invitation";
+ZmMsg.imInvitationFrom="Invitation from {0}";
+ZmMsg.imInviteNotification="<b>{0}</b> invites you to a conference";
+ZmMsg.imLabel="IM:";
+ZmMsg.imLeftChat="{0} has left the conference";
+ZmMsg.imLogOut="Log out";
+ZmMsg.imLoginDifferent="Log in as a different user";
+ZmMsg.imLoginLabel="Login:";
+ZmMsg.imLogoutYahoo="Log out of Yahoo! Messenger";
+ZmMsg.imMarkChatImportant='Mark this chat as "important"';
+ZmMsg.imMinimize="Minimize chat window";
+ZmMsg.imMinimizedLabel="[{0} chats]";
+ZmMsg.imName="Buddy Name";
+ZmMsg.imNameLabel="Buddy Name:";
+ZmMsg.imNewBuddy='Add "{0}" to Buddy List...';
+ZmMsg.imNewBuddyTooltip="Create a new buddy";
+ZmMsg.imNewChat="New Chat";
+ZmMsg.imNewChatName='Chat with "{0}"';
+ZmMsg.imNewConferenceRoom="Create a new conference room";
+ZmMsg.imNewConferenceRoomTitle="Create a new conference room";
+ZmMsg.imNewGroup="New Group";
+ZmMsg.imNewRosterItemToast='Added Buddy "{0}"';
+ZmMsg.imNoBuddies='Your buddy list is empty. <span class="FakeAnchor" onclick="{0}">Click here</span> or on the <span class="ImgNewContact inlineIcon FakeAnchor" onclick="{0}">&nbsp;&nbsp;&nbsp;&nbsp;</span> icon to create a buddy.';
+ZmMsg.imNotLoggedIn='You are not logged in to IM. <span class="FakeAnchor" onclick="{0}">Click here</span> to log in.';
+ZmMsg.imNotLoggedInPrefs='You must be logged in to IM before you can update IM accounts. <span class="FakeAnchor" onclick="{0}">Click here</span> to log in.';
+ZmMsg.imNotificationsLabel="Notifications:";
+ZmMsg.imPasswordExpired="Your Yahoo! Messenger session has expired. Please log in again.";
+ZmMsg.imPasswordFailed="The Yahoo! ID and password do not match.";
+ZmMsg.imPasswordFailedTitle="Login failed.";
+ZmMsg.imPasswordInfo="You may choose to password protect the room";
+ZmMsg.imPasswordMismatch="The passwords don't match.";
+ZmMsg.imPermanentInfo="Preserve the room after all users leave";
+ZmMsg.imPermanentLabel="Permanent:";
+ZmMsg.imPoweredBy="Instant Messaging Powered by";
+ZmMsg.imPrefAutoLogin="Automatically log in to instant messaging services";
+ZmMsg.imPrefIdleStatus="Set presence";
+ZmMsg.imPrefIdleStatusLabel="Set presence:";
+ZmMsg.imPrefIdleTimeout="Idle timeout";
+ZmMsg.imPrefIdleTimeoutLabel="Idle timeout:";
+ZmMsg.imPrefIdleTimeoutMinutes="{0,number} {0,choice,0#minutes|1#minute|2#minutes}";
+ZmMsg.imPrefInstantNotify="Enable instant notifications";
+ZmMsg.imPrefLogChats="Save chat history";
+ZmMsg.imPrefNotifyPresence="Display presence notifications";
+ZmMsg.imPrefNotifyStatus="Display notification when a buddy changes status";
+ZmMsg.imPrefReportIdle="Report idle status";
+ZmMsg.imPresence="Presence";
+ZmMsg.imReconnect="reconnect";
+ZmMsg.imReconnectCaps="Reconnect";
+
+ZmMsg.imRememberYahoo="Remember this Yahoo! ID";
+ZmMsg.imRemoveRosterItemToast='Removed Buddy "{0}"';
+ZmMsg.imRestore="Restore chat window";
+ZmMsg.imRoomNameLabel="Room Name:";
+ZmMsg.imRoomNameRequired="The room name is empty. It's required.";
+ZmMsg.imRoomPasswordFailed="The password is incorrect.";
+ZmMsg.imRoomPasswordRequired="A password is required to enter the room";
+ZmMsg.imRoomSettings="Settings for the room";
+ZmMsg.imScreenName="Screen name:";
+ZmMsg.imScreenNameHint="Screen Name";
+ZmMsg.imScreenNameMsn="MSN Passport:";
+ZmMsg.imScreenNameYahoo="Yahoo! ID:";
+ZmMsg.imSortListByName="Sort by Name";
+ZmMsg.imSortListByPresence="Sort by Status";
+ZmMsg.imStatusAway="away";
+ZmMsg.imStatusChat="available for chat";
+ZmMsg.imStatusDND="do not disturb";
+ZmMsg.imStatusExtAway="extended away";
+ZmMsg.imStatusGatewayOffline="Log in to {0}";
+ZmMsg.imStatusGatewayOnline="Logged into {0} as {1}";
+ZmMsg.imStatusInvisible="invisible";
+ZmMsg.imStatusOffline="offline";
+ZmMsg.imStatusOnline="online";
+ZmMsg.imStatusToast="{0} ({1})";
+ZmMsg.imStatusUnknown="unknown";
+ZmMsg.imSubscribeAuthRequest="<b>{0}</b> wants to add you as a buddy. Accept?";
+ZmMsg.imSubscribeAuthRequest_accept="Accept";
+ZmMsg.imSubscribeAuthRequest_acceptAndAdd="Accept and add";
+ZmMsg.imSubscribeAuthRequest_deny="Deny";
+ZmMsg.imSubscribeAuthRequest_doNothing="Do nothing";
+ZmMsg.imSubscribeAuthRequest_waiting="Waiting for {0} to accept your request";
+ZmMsg.imSystem="system message";
+ZmMsg.imToastGwOffline="You are now logged out of the {0} service";
+ZmMsg.imToastGwOnline="You are logged into the {0} service";
+ZmMsg.imToggleBlocked="Hide Blocked Buddies";
+ZmMsg.imToggleOffline="Hide Offline Buddies";
+ZmMsg.imUnblock="Unblock";
+ZmMsg.imYahooLoadError="The Yahoo! Messenger SDK appears to be unable to load. This might be caused by a slow internet connection. If you are using a Flash blocker, you need to add this page to its whitelist, then reload the page.";
+ZmMsg.imYahooLogin="Log in to Yahoo! Messenger";
+ZmMsg.imYahooMissingFlash="The Adobe Flash Player is required to connect to Yahoo! Messenger. <a target='_blank' href='http://www.adobe.com/go/getflashplayer/'>Click here</a> to download and install it. You will need to restart your browser after the installation is complete.";
+ZmMsg.image="Image";
+ZmMsg.images="Images";
+ZmMsg.imagesLabel="Images:";
+ZmMsg.importAdditionalWarnings="<i>{0,number} more {0,choice,1#warning|2#warnings} reported.</i>";
+ZmMsg.importAutoDetect="Auto-Detect";
+ZmMsg.importChoose="Choose a document to import";
+ZmMsg.importDocs="Import Document";
+ZmMsg.importErrorMissingFile="Must specify an import file.";
+ZmMsg.importErrorMissingFolder="Must specify destination folder.";
+ZmMsg.importErrorRootNotAllowed="Not allowed to import to root folder for this type.";
+ZmMsg.importErrorUpload="Error uploading file.";
+ZmMsg.importExport="Import / Export";
+ZmMsg.importExportTypeCSV="Contacts";
+ZmMsg.importExportTypeICS="Calendar";
+ZmMsg.importExportTypeTGZ="Account";
+ZmMsg.importFailed="Import Failed";
+ZmMsg.importFromCSV="Import .CSV File";
+ZmMsg.importFromCSVHint='If you are using another contact manager program, you can import your existing contacts by saving them in "Comma-Separated Values" (.csv) format. See documentation in that program for help saving in this format.';
+ZmMsg.importFromCSVLabel="CSV File:";
+ZmMsg.importFromICS="Import .ICS File";
+ZmMsg.importFromICSHint="If you are using another calendar program, you can import your existing appointments by saving them in iCalendar (.ics) format. See documentation in that program for help saving in this format.";
+ZmMsg.importFromICSLabel="ICS File:";
+ZmMsg.importFromTGZHint='You can import an account export file in a "Tar-GZipped" (.tgz) format.';
+ZmMsg.importLabel="Import:";
+ZmMsg.importResetWarning="If you reset the destination folder, all data and folders in the destination folder will be deleted.<p><b>If no destination folder is selected, this will delete <i>all</i> of the data and folders in your account.</b>";
+ZmMsg.importStarted="Import started.";
+ZmMsg.importSuccess="Import succeeded.";
+ZmMsg.importSuccessWithWarnings="Import completed with {0,choice,1#a warning|2#warnings}:<p>{1}";
+ZmMsg.importingContacts="Importing...";
+ZmMsg.inContacts="In Personal Address Book";
+ZmMsg.inGal="In Global Address List";
+ZmMsg.inProgress="In Progress";
+ZmMsg.inTime="in";
+ZmMsg.inbox="Inbox";
+ZmMsg.includeInBody="Include original message";
+ZmMsg.includeJunk="Also search Junk";
+ZmMsg.includeJunkFolder="Include Junk Folder in Searches";
+ZmMsg.includeMenuAttachment="Include Original As Attachment";
+ZmMsg.includeMenuNoPrefix="Include Original";
+ZmMsg.includeMenuNone="Don't Include Original Message";
+ZmMsg.includeMenuPrefix="Include Original With Prefix";
+ZmMsg.includeMenuPrefixFull="Include Original With Headers And Prefix";
+ZmMsg.includeMenuSmart="Include Last Message Only";
+ZmMsg.includeOriginalAsAttach="Include original message as an attachment";
+ZmMsg.includeOriginalInBody="Include original message in the body";
+ZmMsg.includePrefix="Include original message with the prefix below";
+ZmMsg.includePrefixFull="Include original message and headers with the prefix below";
+ZmMsg.includeTrash="Also search Trash";
+ZmMsg.includeTrashFolder="Include Trash Folder in Searches";
+ZmMsg.indent="Increase Indent";
+ZmMsg.indentTooltip="Indent";
+ZmMsg.inheritPerms="Sub-folders inherit permissions";
+ZmMsg.initialMailSearch="Initial mail search";
+ZmMsg.initialMailSearchLabel="Default Mail Search:";
+ZmMsg.initiallySearchGal="Initially search the Global Address List when using the contact picker";
+ZmMsg.inlineAttachmentOption="Show images in message body";
+ZmMsg.insertAttachment="Insert Files";
+ZmMsg.insertCell="Insert Cell";
+ZmMsg.insertColumn="Insert Column";
+ZmMsg.insertColumnAfter="Insert Column After";
+ZmMsg.insertColumnBefore="Insert Column Before";
+ZmMsg.insertFunction="Insert Function";
+ZmMsg.insertImage="Insert Images";
+ZmMsg.insertImageUrl="Insert Image via url";
+ZmMsg.insertLink="Insert Link";
+ZmMsg.insertObject="Insert Object";
+ZmMsg.insertRow="Insert Row";
+ZmMsg.insertRowAbove="Insert Row Above";
+ZmMsg.insertRowUnder="Insert Row Under";
+ZmMsg.insertSpreadsheet="Insert Spreadsheet";
+ZmMsg.insertTable="Insert Table";
+ZmMsg.invalidAttendees="Invalid attendees found:";
+ZmMsg.invalidAwayMessage="Away message must be at most {0} characters";
+ZmMsg.invalidEmail="{0} is not a valid email address";
+ZmMsg.invalidEmailAddress="Invalid email address";
+ZmMsg.invalidInitialSearch="Initial search must be at most {0} characters";
+ZmMsg.invalidPersonaName="Missing value for Persona Name";
+ZmMsg.invalidPollingInterval="Polling interval must be at least {0} minutes";
+ZmMsg.invalidPrefValue="A required value is either missing or invalid";
+ZmMsg.invalidSignature="Signature must be at most {0} characters";
+ZmMsg.inviteForwardingAddress="Address to forward invite to";
+ZmMsg.inviteOutOfDate="The meeting invitation has been changed or no longer exists.";
+ZmMsg.invitePermissionDenied="<p>You do not have permission to invite the following attendees to a meeting: <br> {0}</p><p>Save anyway?</p>";
+ZmMsg.invitees="Invitees";
+ZmMsg.invitesAllowAll="Allow both internal and external users to invite me to meetings";
+ZmMsg.invitesAllowLocal="Allow only internal users to invite me to meetings";
+ZmMsg.invitesAllowNone="Don't let anyone invite me to meetings";
+ZmMsg.invitesAllowSome="Allow only the following internal users to invite me to meetings:";
+ZmMsg.invitesLabel="Invites:";
+ZmMsg.isAfter="is after";
+ZmMsg.isBefore="is before";
+ZmMsg.isIn="in";
+ZmMsg.isOn="is on";
+ZmMsg.isRecurringAppt='"{0}" is a recurring appointment.';
+ZmMsg.isRecurringApptList="You have selected recurring appointments.";
+ZmMsg.isRecurringTask='"{0}" is a recurring task.';
+ZmMsg.isVisible="Is Visible";
+ZmMsg.itemCopied="{0,number} {0,choice,1#Item|2#Items} Copied";
+ZmMsg.itemCount="{0} {1}";
+ZmMsg.itemCount1="{0} of {1} {2}";
+ZmMsg.itemTemplate="Item template";
+ZmMsg.itemType="Item Type";
+ZmMsg.items="Items";
+ZmMsg.itemsProcessed="{0} {1} processed";
+ZmMsg.javaSource="Java Source Code";
+ZmMsg.jpegImage="JPEG Image";
+ZmMsg.junk="Junk";
+ZmMsg.junkMailOptions="Junk Mail Options";
+ZmMsg.junkTooltip="Mark selected item(s) as Junk";
+ZmMsg.kb="KB";
+ZmMsg.keepCopyInInbox="Keep a copy in my Inbox";
+ZmMsg.keepInInbox="Keep in Inbox";
+ZmMsg.key="Key";
+ZmMsg.keyboardShortcuts="Zimbra Keyboard Shortcuts";
+ZmMsg.kilobytes="kilobytes (KB)";
+ZmMsg["label@"]="@";
+ZmMsg.languageLabel="Language:";
+ZmMsg.larger="is larger than";
+ZmMsg.lastModified="Last Modified:";
+ZmMsg.lastMonth="Last Month";
+ZmMsg.lastSaved="Last Saved";
+ZmMsg.lastSync="Last Sync";
+ZmMsg.lastWeek="Last Week";
+ZmMsg.lastYear="Last Year";
+ZmMsg.layout="Layout";
+ZmMsg.left="Left";
+ZmMsg.leftClickComposeHint="Click to compose.";
+ZmMsg.leftClickNewContactHint="Click to add to Address Book.";
+ZmMsg.leftClickYahoohint="Click to visit user's Yahoo! profile";
+ZmMsg.licenseExpired="Your server's license has expired.";
+ZmMsg.lifetimeDurationDays="{0,number} {0,choice,0#Days|1#Day|2#Days}";
+ZmMsg.lifetimeDurationNever="Never";
+ZmMsg.linkProperties="Link Properties";
+ZmMsg.linkTarget="Link target";
+ZmMsg.linkTargetDesc="Enter the address of a web page:";
+ZmMsg.linkText="Link text";
+ZmMsg.linkTextDesc="Enter text visible for the link:";
+ZmMsg.linkTitleLabel="Link title:";
+ZmMsg.linkTitleOptionalLabel="Link title (optional):";
+ZmMsg.linkTo="Link to";
+ZmMsg.linkToNewIdentity="Link to new identity:";
+ZmMsg.linkUrlLabel="Link URL:";
+ZmMsg.list="List";
+ZmMsg.loading="Loading...";
+ZmMsg.localFolders="Local Folders";
+ZmMsg.localPart="local part";
+ZmMsg.localeChangeRestart="Would you like to reload the application now to show the new language? <br>(Otherwise, the new language will appear the next time you log in.)";
+ZmMsg.location="Location";
+ZmMsg.locationFormatCityCountry="{0}, {1}";
+ZmMsg.locationFormatCityStateCountry="{0}, {1} {2}";
+ZmMsg.locationLabel="Location:";
+ZmMsg.logOff="Log Out";
+ZmMsg.login="Log In";
+ZmMsg.loginAsDiff="Log in as a different user";
+ZmMsg.loginError="The username or password is incorrect. Verify that CAPS LOCK is not on, and then retype the current username and password";
+ZmMsg.loginHeader="Acme Corporation";
+ZmMsg.loginLabel="Login using:";
+ZmMsg.loginOptions="Login Options";
+ZmMsg.lostEmailNotification="The email notification will be turned off and the email address will be removed.";
+ZmMsg.low="Low";
+ZmMsg.lowPriorityTooltip="This item has been marked as low priority";
+ZmMsg.mail="Mail";
+ZmMsg.mailDeliveryDisabled="Don't keep a local copy of messages";
+ZmMsg.mailFolder="Mail Folder";
+ZmMsg.mailFolders="Mail Folders";
+ZmMsg.mailForwardingAddress="Address to forward mail to";
+ZmMsg.mailMessage="Mail Message";
+ZmMsg.mailNotifAddress="Address for new mail notifications";
+ZmMsg.mailNotifEnabled="Send a notification message to:";
+ZmMsg.mailPriorityTooltip="Set the priority of the message";
+ZmMsg.mailSendAddressFailure="Could not send message due to invalid address(es)";
+ZmMsg.mailSendFailure="Could not send message: {0}";
+ZmMsg.mailSignature="Mail Signature:";
+ZmMsg.makeLabel="{0}:";
+ZmMsg.mandatorySpellcheck="Mandatory spellcheck before sending a message.";
+ZmMsg.manualSignature='Manually via the "Add Signature" button';
+ZmMsg.mark="Mark";
+ZmMsg.markAllHeard="Mark All as Heard";
+ZmMsg.markAllRead="Mark All as Read";
+ZmMsg.markAs="Mark as:";
+ZmMsg.markAsHeard="Mark As Heard";
+ZmMsg.markAsRead="Mark As Read";
+ZmMsg.markAsUnheard="Mark As Unheard";
+ZmMsg.markAsUnread="Mark As Unread";
+ZmMsg.markedAsJunk="{0,number} {0,choice,1#Item|2#Items} Marked as Junk";
+ZmMsg.markedAsNotJunk="{0,number} {0,choice,1#Item|2#Items} Marked as Not Junk";
+ZmMsg.matches="matches wildcard condition";
+ZmMsg.mb="MB";
+ZmMsg.meeting="Meeting";
+ZmMsg.meetingStatus="Meeting Status";
+ZmMsg.meetingStatusUnknown="Could not find meeting details. Status for this slot is free.";
+ZmMsg.megabytes="megabytes (MB)";
+ZmMsg.mergeCell="Merge Cell";
+ZmMsg.mergeCells="Merge Cells";
+ZmMsg.message="Message";
+ZmMsg.messageArrivalLabel="When a message arrives:";
+ZmMsg.messageLabel="Message:";
+ZmMsg.messagePreviewLabel="Message Preview:";
+ZmMsg.messageReadLabel="When I read a message in the reading pane:";
+ZmMsg.messageReadNone="Do not mark it read";
+ZmMsg.messageReadNow="Mark it read immediately";
+ZmMsg.messageReadTime='Mark it read after <input id="{0}" type="text" size=4 /> seconds';
+ZmMsg.messageSent="Message Sent";
+ZmMsg.messageStatus="Message Status";
+ZmMsg.messageTooLarge="This message is too large to display properly.";
+ZmMsg.messageTruncated="[Message truncated]";
+ZmMsg.messages="Messages";
+ZmMsg.messagesReceiving="Receiving Messages";
+ZmMsg.messagesSentLabel="Sent Messages:";
+ZmMsg.method="Method";
+ZmMsg.middle="Middle";
+ZmMsg.mine="Mine";
+ZmMsg.minimumCapacity="Minimum Capacity";
+ZmMsg.minutes="minutes";
+ZmMsg.missedCalls="Missed Calls";
+ZmMsg.missingAwayMessage="Empty away message";
+ZmMsg.missingEmailAddress="Missing email address";
+ZmMsg.missingPlugin="Sorry, a required plugin is missing.";
+ZmMsg.missingPluginHelp="The QuickTime plugin is required to play voice mail messages. <a target='_blank' href='http://www.apple.com/quicktime/download/'>Click here</a> to download and install it. You will need to restart your browser after the installation is complete.";
+ZmMsg.missingPluginHelpIE="A plugin is required to play voice mail messages. <a target='_blank' href='http://www.microsoft.com/windows/windowsmedia/download/'>Click here</a> to download and install Windows Media Player, or <a target='_blank' href='http://www.apple.com/quicktime/download/'>click here</a> to download and install the QuickTime plugin. You will need to restart your browser after the installation is complete.";
+ZmMsg.misspelling="misspelling";
+ZmMsg.misspellings="misspellings";
+ZmMsg.misspellingsMessage="{0} misspellings found. Do you want to correct them?";
+ZmMsg.misspellingsResult="{0,number} {0,choice,0#Misspellings|1#Misspelling|2#Misspellings}";
+ZmMsg.mobile="Mobile";
+ZmMsg.mobileDevice="Device";
+ZmMsg.mobileDeviceChangesSavedImmediately="Note: Changes to mobile devices are saved immediately.";
+ZmMsg.mobileDeviceId="Device ID";
+ZmMsg.mobileDeviceWipeConfirm="Are you sure you want to wipe the contents of your lost or stolen device?";
+ZmMsg.mobileDevices="Mobile Devices";
+ZmMsg.mobileFirstReqReceived="Device registration";
+ZmMsg.mobileLastPolicyUpdate="Last policy update";
+ZmMsg.mobileProtocolVersion="Protocol version";
+ZmMsg.mobileProvisionable="Provisionable";
+ZmMsg.mobileRemoteWipeAck="Remote wipe confirmed";
+ZmMsg.mobileRemoteWipeReq="Remote wipe requested";
+ZmMsg.mobileResumeSync="Resume Sync";
+ZmMsg.mobileStatusNeedProvision="Needs provisioning";
+ZmMsg.mobileStatusOk="OK";
+ZmMsg.mobileStatusSuspended="Suspended";
+ZmMsg.mobileStatusWipe="Remote wipe requested";
+ZmMsg.mobileStatusWipeComplete="Remote wipe completed";
+ZmMsg.mobileSuspendSync="Suspend Sync";
+ZmMsg.mobileUserAgent="User agent";
+ZmMsg.mobileWipe="Wipe Device";
+ZmMsg.mobileWipeCancel="Cancel Wipe";
+ZmMsg.modified="Modified";
+ZmMsg.modifiedField="[MODIFIED]";
+ZmMsg.modifiedOnLabel="Modified on:";
+ZmMsg.modifier="Modifier";
+ZmMsg.modifyApptQuestion="Would you like to modify only this instance or the series?";
+ZmMsg.modifyInstance="Modify this instance";
+ZmMsg.modifyRecurringItem="Modify Recurring Item";
+ZmMsg.modifySearch="Modify Search";
+ZmMsg.modifySeries="Modify the series";
+ZmMsg.month="Month";
+ZmMsg.monthly="Monthly";
+ZmMsg.months="Months";
+ZmMsg.more="More...";
+ZmMsg.moreDetails="More Details...";
+ZmMsg.moreVoiceControlsLabel="Need more controls over your voice service?";
+ZmMsg.moreVoiceControlsText="Visit the Digital Voice Center";
+ZmMsg.mountAddrBook="Link to Shared Address Book";
+ZmMsg.mountBriefcase="Link to Shared Briefcase";
+ZmMsg.mountCalendar="Link to Shared Calendar";
+ZmMsg.mountFolder="Link to Shared Folder";
+ZmMsg.mountInstructions1="To link to an item that has been shared with you, enter the owner's email address and the location of the folder in their mailbox (e.g. Work/Projects):";
+ZmMsg.mountInstructions2="Properties of your new link:";
+ZmMsg.mountNotebook="Link to Shared Notebook";
+ZmMsg.mountSection="Link to Shared Notebook";
+ZmMsg.mountTaskFolder="Link to Shared Task List";
+ZmMsg.mountedSharesTitle="Folders shared with me that I have accepted";
+ZmMsg.move="Move";
+ZmMsg.moveAddrBook='Move Address Book "{0}"';
+ZmMsg.moveAppt="Move Appointment";
+ZmMsg.moveAppts="Move Appointments";
+ZmMsg.moveConversation="Move Conversation";
+ZmMsg.moveConversations="Move Conversations";
+ZmMsg.moveFolder='Move Folder "{0}"';
+ZmMsg.moveItem="Move Item";
+ZmMsg.moveItems="Move Items";
+ZmMsg.moveMessage="Move Message";
+ZmMsg.moveMessages="Move Messages";
+ZmMsg.moveReadonly="You have selected one or more appointments which are read only. These appointments cannot be moved.";
+ZmMsg.moveSearch='Move Saved Search "{0}"';
+ZmMsg.moveTask="Move Task";
+ZmMsg.moveTasks="Move Tasks";
+ZmMsg.moveToVoiceMail="Move back to Voice Mail folder";
+ZmMsg.moveTooltip="Move selected item(s)";
+ZmMsg.mp3Audio="MP3 Audio";
+ZmMsg.msDownload="Microsoft DLL";
+ZmMsg.msExcelDocument="Microsoft Excel";
+ZmMsg.msExchange="Microsoft Exchange";
+ZmMsg.msLive="Microsoft Live";
+ZmMsg.msPPTDocument="Microsoft PowerPoint";
+ZmMsg.msProjectDocument="Microsoft Project";
+ZmMsg.msVisioDocument="Microsoft Visio";
+ZmMsg.msWMV="Windows Media Video";
+ZmMsg.msWinmailDat="Microsoft Outlook (TNEF)";
+ZmMsg.msWordDocument="Microsoft Word";
+ZmMsg.msn="MSN";
+ZmMsg.multipartAlternative="Multipart Alternative";
+ZmMsg.multipartMixed="Multipart Mixed";
+ZmMsg.multipleAttachmentsTooltip="{0} attachments";
+ZmMsg.myCard="My Card";
+ZmMsg.myCardHome="Home";
+ZmMsg.myCardWork="Work";
+ZmMsg.myComputer="My Computer";
+ZmMsg.myContacts="My Contacts";
+ZmMsg.name="Name";
+ZmMsg.nameEmpty="You must specify a value for the name.";
+ZmMsg.nameHint="Name (John Smith)";
+ZmMsg.nameLabel="Name:";
+ZmMsg.nameTooLong="The name must be at most {0} characters long";
+ZmMsg.navText1="{0} - {1}";
+ZmMsg.navText2="{0} - {1} of {2}";
+ZmMsg.needsAction="Needs Action";
+ZmMsg.neverShow="never show";
+ZmMsg.neverSynced="This account has not been synced. Click Send/Receive to start sync.";
+ZmMsg.newAddrBook="New Address Book";
+ZmMsg.newAddrBookTooltip="Create a new address book";
+ZmMsg.newAllDayAppt="New All Day Appointment";
+ZmMsg.newAllDayApptTooltip="Create a new all day calendar appointment";
+ZmMsg.newAppt="New Appointment";
+ZmMsg.newApptTooltip="Create a new calendar appointment";
+ZmMsg.newBriefcase="New Briefcase";
+ZmMsg.newBriefcaseTooltip="Create a new briefcase";
+ZmMsg.newCalendar="New Calendar";
+ZmMsg.newCalendarTooltip="Create a new calendar";
+ZmMsg.newContact="New Contact";
+ZmMsg.newContactTooltip="Create a new contact";
+ZmMsg.newDocument="New Document";
+ZmMsg.newEmail="New Email";
+ZmMsg.newExternalAccount="New External Account {0,number}";
+ZmMsg.newFile="New File";
+ZmMsg.newFilter="New Filter";
+ZmMsg.newFolder="New Folder";
+ZmMsg.newFolderParent="Select where to place the new folder:";
+ZmMsg.newFolderTooltip="Create a new folder";
+ZmMsg.newGroup="New Contact Group";
+ZmMsg.newGroupTooltip="Create a new group";
+ZmMsg.newIM="New IM";
+ZmMsg.newIdentity="New Identity {0}";
+ZmMsg.newInstantMessage="New Instant Message";
+ZmMsg.newMail="New mail from: {0}";
+ZmMsg.newMailWithAccount="New mail from: {0} ({1})";
+ZmMsg.newMessage="New message";
+ZmMsg.newMessageFormat="New message format:";
+ZmMsg.newMessageTooltip="Compose a new message";
+ZmMsg.newName="New name";
+ZmMsg.newNotebook="New Notebook";
+ZmMsg.newNotebookTooltip="Create a new notebook";
+ZmMsg.newPage="New Page";
+ZmMsg.newPassword="New Password";
+ZmMsg.newPersona="New Persona {0,number}";
+ZmMsg.newPopAccountName="New Account {0}";
+ZmMsg.newPresentation="New Presentation";
+ZmMsg.newPresentationBeta="New Presentation [beta]";
+ZmMsg.newRosterItem="New Buddy";
+ZmMsg.newSearchParent="Select where to place the new saved search";
+ZmMsg.newSection="New Notebook";
+ZmMsg.newSpreadSheet="New Spreadsheet";
+ZmMsg.newSpreadSheetBeta="New Spreadsheet [beta]";
+ZmMsg.newStatusMessage="New Status Message";
+ZmMsg.newTag="New Tag";
+ZmMsg.newTagName="New Tag Name";
+ZmMsg.newTagTooltip="Create a new tag";
+ZmMsg.newTask="New Task";
+ZmMsg.newTaskFolder="New Task List";
+ZmMsg.newTaskFolderTooltip="Create a new task list";
+ZmMsg.newTaskTooltip="Create a new task";
+ZmMsg.newWinComposeExit="You can press Cancel to save as draft.";
+ZmMsg.newWindow="New Window";
+ZmMsg.next="Next";
+ZmMsg.nextConversation="Next Conversation";
+ZmMsg.nextDay="Next Day";
+ZmMsg.nextMessage="Next Message";
+ZmMsg.nextMonth="Next Month";
+ZmMsg.nextPage="Next Page";
+ZmMsg.nextWeek="Next Week";
+ZmMsg.nextWorkWeek="Next Work Week";
+ZmMsg.noAddresses="There must be at least one address in the To:, Cc:, or Bcc: fields";
+ZmMsg.noAppts="No Appointments";
+ZmMsg.noAtt="No Attachments";
+ZmMsg.noCallResults="No results found.";
+ZmMsg.noFreeSlotFound="No free time slots found with on selected week range";
+ZmMsg.noItems="No {0}";
+ZmMsg.noMisspellingsFound="Spelling Correct";
+ZmMsg.noName="<No Name>";
+ZmMsg.noShareDetailsFound="No share details found";
+ZmMsg.noSubject="<No Subject>";
+ZmMsg.noSuggestions="No Suggestions";
+ZmMsg.noTargetFolder="You must select a folder";
+ZmMsg.noVoiceMail="Voice mail is not available.";
+ZmMsg.noWhere="<No Where>";
+ZmMsg.none="None";
+ZmMsg.normal="Normal";
+ZmMsg.notAfter="not after";
+ZmMsg.notAvailable="Not Available";
+ZmMsg.notBefore="not before";
+ZmMsg.notContain="does not contain";
+ZmMsg.notExactMatch="does not match exactly";
+ZmMsg.notExist="does not exist";
+ZmMsg.notIn="not in";
+ZmMsg.notIs="is not";
+ZmMsg.notJunk="Not Junk";
+ZmMsg.notJunkTooltip="Mark selected item(s) as not Junk";
+ZmMsg.notMatch="does not match wildcard condition";
+ZmMsg.notOver="not over";
+ZmMsg.notSet="Not Set";
+ZmMsg.notStarted="Not Started";
+ZmMsg.notSyncing='This folder is currently not syncing.<br><a href="javascript:;" onclick="{0}">Click here to sync this folder</a>.';
+ZmMsg.notUnder="not under";
+ZmMsg.noteForward="Note: Forwarded message attached";
+ZmMsg.noteLabel="Note:";
+ZmMsg.notebook="Notebook";
+ZmMsg.notebookFileView="File List";
+ZmMsg.notebookLabel="Notebook:";
+ZmMsg.notebookPageLabel="A notebook page:";
+ZmMsg.notebookPageView="Page Browser";
+ZmMsg.notebookPersonalName="Notebook";
+ZmMsg.notebooks="Notebooks";
+ZmMsg.notes="Notes";
+ZmMsg.notesLabel="Notes:";
+ZmMsg.nothingToTag="The items you have selected cannot be tagged.";
+ZmMsg.notify="Notify";
+ZmMsg.notifyOrganizer="Notify organizer";
+ZmMsg.notifyOrganizerLabel="Notify Organizer";
+ZmMsg.number="Number";
+ZmMsg.numberOfCols="Number of Columns:";
+ZmMsg.numberOfMinutes="Number of minutes before an appointment to show reminder";
+ZmMsg.numberOfRows="Number of Rows:";
+ZmMsg.numberedList="Numbered List";
+ZmMsg.object="Object";
+ZmMsg.objects="Objects";
+ZmMsg.objectsNotDisplayed="Objects are not highlighted due to message size.";
+ZmMsg.off="Off";
+ZmMsg.offlineAllowMailTo="Use Zimbra Desktop as default mail application";
+ZmMsg.offlineQuota="Mailbox size: {0}";
+ZmMsg.ok="OK";
+ZmMsg.oldPasswordIsIncorrect="The old password you submitted is incorrect.";
+ZmMsg.on="On";
+ZmMsg.onBehalfOf="On Behalf Of";
+ZmMsg.onBehalfOfLabel="On Behalf Of:";
+ZmMsg.onLabel="On:";
+ZmMsg.onlyWholeNumbersError="Only whole numbers are accepted";
+ZmMsg.openAppointment="Open Appointment";
+ZmMsg.openApptInstance="Open Instance";
+ZmMsg.openApptSeries="Open Series";
+ZmMsg.openCalendar="Open Calendar";
+ZmMsg.openFile="Open";
+ZmMsg.openFileTooltip="Open this file";
+ZmMsg.openInstance="Open this instance";
+ZmMsg.openMailNewWin="Double-click opens message in new window";
+ZmMsg.openRecurringItem="Open Recurring Item";
+ZmMsg.openSearchBuilder="Open Advanced Search";
+ZmMsg.openSeries="Open the series";
+ZmMsg.options="Options";
+ZmMsg.optionsSaved="Preferences Saved";
+ZmMsg.or="or";
+ZmMsg.orPickAStyleBelow="Or pick a style below:";
+ZmMsg.orange="Orange";
+ZmMsg.orgChange='This will change the organizer to "{0}" and attendees will be notified. Continue?';
+ZmMsg.organizer="Organizer";
+ZmMsg.organizerLabel="Organizer:";
+ZmMsg.organizerNotification="Do you want to notify organizer?";
+
+ZmMsg.origMsg="Original Message";
+ZmMsg.originalFormat="Format of the original message";
+ZmMsg.other="Other";
+ZmMsg.otherLabel="Other:";
+ZmMsg.outOfOffice="Out of Office";
+ZmMsg.outRpcCache="Out of RPC cache";
+ZmMsg.outbox="Outbox";
+ZmMsg.outdent="Decrease Indent";
+ZmMsg["outlook-2000-csv"]="Outlook 2000 Contacts";
+ZmMsg["outlook-2003-csv"]="Outlook 2003 Contacts";
+ZmMsg["outlook-unknown-csv"]="Outlook Contacts";
+ZmMsg.over="over";
+ZmMsg.owner="Owner";
+ZmMsg.ownerLabel="Owner:";
+ZmMsg.pComplete="% Complete";
+ZmMsg.paddingHorizontal="Horizontal Padding:";
+ZmMsg.paddingVertical="Vertical Padding:";
+ZmMsg.page="Page";
+ZmMsg.pageLabel="Page:";
+ZmMsg.pageNameLabel="Page Name:";
+ZmMsg.pageNotFound='The page at the path "{0}" could not be found.';
+ZmMsg.pageSaved="Page Saved";
+ZmMsg.pages="Pages";
+ZmMsg.parentFolderLabel="Parent:";
+ZmMsg.participantStatus="Participant Status";
+ZmMsg.party="party";
+ZmMsg.password="Password";
+ZmMsg.passwordConfirmLabel="Confirm Password:";
+ZmMsg.passwordLabel="Password:";
+ZmMsg.paste="Paste";
+ZmMsg.path="Path";
+ZmMsg.pathLabel="Path:";
+ZmMsg.pattern="Pattern";
+ZmMsg.pause="Pause";
+ZmMsg.pendingSharesTitle="Folders that have been shared with me but not yet accepted";
+ZmMsg.percent="Percent";
+ZmMsg.percentComplete="Percent Complete";
+ZmMsg.permissions="Permissions:";
+ZmMsg.personaSettings="Persona Settings";
+ZmMsg.personaWhenInFolder="Replying to or forwarding messages in folder(s):";
+ZmMsg.personaWhenSentTo="When replying or forwarding messages sent to:";
+ZmMsg.personal="Personal";
+ZmMsg.personas="Personas";
+ZmMsg.phone="Phone";
+ZmMsg.phone2="Phone 2";
+ZmMsg.phoneLabel="Phone:";
+ZmMsg.phoneLabelAssistant="Assistant";
+ZmMsg.phoneLabelCallback="Callback";
+ZmMsg.phoneLabelCar="Car";
+ZmMsg.phoneLabelCompany="Company";
+ZmMsg.phoneLabelHome="Home";
+ZmMsg.phoneLabelHome2="Home 2";
+ZmMsg.phoneLabelHomeAlternate="Home Alternate";
+ZmMsg.phoneLabelHomeFax="Home Fax";
+ZmMsg.phoneLabelMobile="Mobile";
+ZmMsg.phoneLabelOther="Other";
+ZmMsg.phoneLabelOtherFax="Other Fax";
+ZmMsg.phoneLabelPager="Pager";
+ZmMsg.phoneLabelWork="Work";
+ZmMsg.phoneLabelWork2="Work 2";
+ZmMsg.phoneLabelWorkFax="Work Fax";
+ZmMsg.phoneNumberHint="Phone Number";
+ZmMsg.phoneNumbers="Phone Numbers";
+ZmMsg.pickADate="Pick a date";
+ZmMsg.pickATag="Pick a tag";
+ZmMsg.pink="Pink";
+ZmMsg.pixels="Pixels";
+ZmMsg.placeSignature="Place the signature:";
+ZmMsg.placed="Placed";
+ZmMsg.placedCalls="Placed Calls";
+ZmMsg.placementLabel="Placement:";
+ZmMsg.plainText="Plain Text";
+ZmMsg.play="Play";
+ZmMsg.playSound="Play a sound (requires QuickTime or Windows Media plugin)";
+ZmMsg.pleaseWaitHilitingObjects="Please wait, depending on the message size this might take a while.";
+ZmMsg.pngImage="PNG Image";
+ZmMsg.pollEveryNMinutes="{0,number} {0,choice,0#minutes|1#minute|2#minutes}";
+ZmMsg.pollNever="Never";
+ZmMsg.pollingInterval="Polling interval (minutes after which to check for new mail)";
+ZmMsg.pollingIntervalLabel="Check for new mail every:";
+ZmMsg.popAccountCreateNewIdentity="Create new identity for this account";
+ZmMsg.popAccountDownloadLabel="When downloading messages:";
+ZmMsg.popAccountDownloadLeave="Leave a copy on the POP server";
+ZmMsg.popAccountDownloadRemove="Remove from the POP server";
+ZmMsg.popAccountFolderLabel="Place messages in folder:";
+ZmMsg.popAccountFolderSelect="Select folder for POP messages:";
+ZmMsg.popAccountIdentityHelp="Create a new mail identity if you wish to respond to mail received from this account using the name of the account rather than your default Zimbra name.";
+ZmMsg.popAccountLinkForAddr="For messages sent to this email address";
+ZmMsg.popAccountLinkForFolder="For messages read or replied in this folder";
+ZmMsg.popAccountLinkLabel="Link identity:";
+ZmMsg.popAccountNameLabel="Account name:";
+ZmMsg.popAccountServerLabel="Incoming mail server:";
+ZmMsg.popAccountSettings="POP Account Settings";
+ZmMsg.popAccountTest="Test Account Settings";
+ZmMsg.popAccountTestFailure="Failed";
+ZmMsg.popAccountTestFailureMsg='Connection to POP account "{0}" failed. See details for error message from server.';
+ZmMsg.popAccountTestInProgress="Testing...";
+ZmMsg.popAccountTestNote="If you continue to save, account will be marked inactive.<br>Press Cancel to return to editing accounts.";
+ZmMsg.popAccountTestSuccess="Success";
+ZmMsg.popAccountTestSuccessMsg='Connection to POP account "{0}" succeeded.';
+ZmMsg.popAccountTestTitle="Test POP Accounts";
+ZmMsg.popAccountUseSSL="Use SSL to connect securely";
+ZmMsg.popAccounts="POP Accounts";
+ZmMsg.popAccountsInfo="You can retrieve email from your POP email accounts by setting up POP accounts here. To start: <ol><li> Click <b>Add</b> in the bottom of this page.<li> Enter the settings for your POP account.<li> Select a folder in which to place your messages.<li> Optionally, create a mail identity to customize replies to the POP account messages.</ol><p><strong>Note:</strong> To retrieve mail, click the <b>Get POP Mail</b> button in the folder from step 3.";
+ZmMsg.popAccountsInfoHeader="About POP Accounts";
+ZmMsg.popupBlocker="Oops! Browser is Blocking Popups";
+ZmMsg.portLabel="Port:";
+ZmMsg.portal="Home";
+ZmMsg.positiveNumberError="This must be a positive number.";
+ZmMsg.preferenceResetButtonLabel="Reset";
+ZmMsg.preferences="Preferences";
+ZmMsg.prefix="Prefix each included line with";
+ZmMsg.prefixLabel="Prefix:";
+ZmMsg.prefixTextWith="Prefix included messages with:";
+ZmMsg.preformatted="Preformatted";
+ZmMsg.presenceTooltip="Your current instant messaging status is: {0}";
+ZmMsg.presenceTooltipYahoo="You are logged in to Yahoo! Messenger as {0}. Your status is: {1}.";
+ZmMsg.presenceTooltipYahooLoggedOut="You are not logged in to Yahoo! Messenger.";
+ZmMsg.presentation="Presentation";
+ZmMsg.presentationName="Presentation Name";
+ZmMsg.presentations="Presentations";
+ZmMsg.preview="Preview";
+ZmMsg.previous="Previous";
+ZmMsg.previousConversation="Previous Conversation";
+ZmMsg.previousDay="Previous Day";
+ZmMsg.previousMessage="Previous Message";
+ZmMsg.previousMonth="Previous Month";
+ZmMsg.previousPage="Previous Page";
+ZmMsg.previousWeek="Previous Week";
+ZmMsg.previousWorkWeek="Previous Work Week";
+ZmMsg.print="Print";
+ZmMsg.printAddrBook="Print Address Book";
+ZmMsg.printCalendar="Print calendar";
+ZmMsg.printCallTooltip="Print call list";
+ZmMsg.printContact="Print selected contact(s)";
+ZmMsg.printDocument="Print document";
+ZmMsg.printMultiTooltip="Print selected item(s)";
+ZmMsg.printResults="Print Results";
+ZmMsg.printTask="Print selected task(s)";
+ZmMsg.printTaskFolder="Print Task Folder";
+ZmMsg.printTooltip="Print selected item";
+ZmMsg.printVoicemailTooltip="Print voice mail list";
+ZmMsg.priority="Priority";
+ZmMsg.priorityLabel="Priority:";
+ZmMsg.privatePermission="Allow user(s) to see my private appointments.";
+ZmMsg.progress="Progress";
+ZmMsg.properties="Properties";
+ZmMsg.pt="{0}pt";
+ZmMsg.ptstAccept="Accepted";
+ZmMsg.ptstDeclined="Declined";
+ZmMsg.ptstDeferred="Deferred";
+ZmMsg.ptstDelegated="Delegated";
+ZmMsg.ptstNeedsAction="Needs Action";
+ZmMsg.ptstTentative="Tentative";
+ZmMsg.ptstWaiting="Waiting";
+ZmMsg.purple="Purple";
+ZmMsg.quick="Quick";
+ZmMsg.quickAddAppt="QuickAdd Appointment";
+ZmMsg.quota="Quota";
+ZmMsg.quotaDescLimited="{0} of {1}";
+ZmMsg.quotaDescUnlimited="{0} of unlimited";
+ZmMsg.re="Re";
+ZmMsg.read="Read";
+ZmMsg.readReceipt="Read Receipt:";
+ZmMsg.readReceiptAddress="Read Receipt Address:";
+ZmMsg.readReceiptAlways="Always send a read receipt";
+ZmMsg.readReceiptAsk="Ask me";
+ZmMsg.readReceiptNever="Never send a read receipt";
+ZmMsg.readReceiptPref="When I receive a request for a read receipt";
+ZmMsg.readReceiptSend="The sender of this message has requested to be notified when you read this message.<br><br>Do you wish to notify the sender?";
+ZmMsg.readReceiptSent="A read receipt was sent for this message.";
+ZmMsg.readingPaneAtBottom="Reading Pane At The Bottom";
+ZmMsg.readingPaneOff="Reading Pane Off";
+ZmMsg.readingPaneOnRight="Reading Pane On The Right";
+ZmMsg.received="Received";
+ZmMsg.recurBlurb="{0} {2} {1}";
+ZmMsg.recurDailyEveryDay="Every day";
+ZmMsg.recurDailyEveryNumDays="Every {0,number,integer} days";
+ZmMsg.recurDailyEveryWeekday="Every weekday";
+ZmMsg.recurEndByDate="End by {0,date,medium}";
+ZmMsg.recurEndNone="No end date";
+ZmMsg.recurEndNumber="End after {0,number,integer} occurrence(s)";
+ZmMsg.recurMonthlyEveryNumMonthsDate="Day {0,number,integer} of every {1,number,integer} month(s)";
+ZmMsg.recurMonthlyEveryNumMonthsNumDay="The {0,choice,-1#last|1#first|2#second|3#third|4#fourth} {1,date,EEEE} of every {2,number,integer} month(s)";
+ZmMsg.recurMonthlyEveryNumMonthsWeekDays="The {0,choice,-1#last|1#first|2#second|3#third|4#fourth} {1,choice,-1#day|0#weekend|1#weekday} of every {2,number,integer} month(s)";
+ZmMsg.recurStart="Effective {0,date,medium}";
+ZmMsg.recurWeeklyEveryNumWeeksDate="Every {0,number,integer} weeks on {2}{1,list,date,EEEE}";
+ZmMsg.recurWeeklyEveryWeekday="Every {0,date,EEEE}";
+ZmMsg.recurYearlyEveryDate="Every year on {0,date,MMMM} {1,number,integer}";
+ZmMsg.recurYearlyEveryMonthNumDay="The {0,choice,-1#last|1#first|2#second|3#third|4#fourth} {1,date,EEEE} of every {2,date,MMMM}";
+ZmMsg.recurYearlyEveryMonthWeekDays="The {0,choice,-1#last|1#first|2#second|3#third|4#fourth} {1,choice,-1#day|0#weekend|1#weekday} of every {2,date,MMMM}";
+ZmMsg.recurrence="Recurrence";
+ZmMsg.recurrenceRuleDay="day";
+ZmMsg.recurrenceRuleWeekday="weekday";
+ZmMsg.recurrenceRuleWeekend="weekend day";
+ZmMsg.red="Red";
+ZmMsg.refresh="Refresh";
+ZmMsg.refreshFilters="Refresh Filters";
+ZmMsg.refreshTooltip="Refresh the selected item";
+ZmMsg.reload="Reload";
+ZmMsg.rememberMe="Remember me on this computer";
+ZmMsg.rememberMeMobile="Remember me";
+ZmMsg.reminder="Reminder";
+ZmMsg.reminderInDays="In {3,number,integer} {3,choice,1#day|2#days}.";
+ZmMsg.reminderInDaysHours="In {3,number,integer} {3,choice,1#day|2#days}, {4,number,integer} {4,choice,1#hour|2#hours}.";
+ZmMsg.reminderInHours="In {4,number,integer} {4,choice,1#hour|2#hours}.";
+ZmMsg.reminderInHoursMinutes="In {4,number,integer} {4,choice,1#hour|2#hours}, {5,number,integer} {5,choice,1#minute|2#minutes}.";
+ZmMsg.reminderInMinutes="In {5,number,integer} {5,choice,1#minute|2#minutes}.";
+ZmMsg.reminderInMonths="In {2,number,integer} {2,choice,1#month|2#months}.";
+ZmMsg.reminderInMonthsDays="In {2,number,integer} {2,choice,1#month|2#months}, {3,number,integer} {3,choice,1#day,2#days}.";
+ZmMsg.reminderInYears="In {1,number,integer} {1,choice,1#year|2#years}.";
+ZmMsg.reminderInYearsMonths="In {1,number,integer} {1,choice,1#year|2#years}, {2,number,integer} {2,choice,1#months|2#months}.";
+ZmMsg.reminderLabel="Reminder:";
+ZmMsg.reminderOverdueByDays="Overdue by {3,number,integer} {3,choice,1#day|2#days}.";
+ZmMsg.reminderOverdueByDaysHours="Overdue by {3,number,integer} {3,choice,1#day|2#days}, {4,number,integer} {4,choice,1#hour|2#hours}.";
+ZmMsg.reminderOverdueByHours="Overdue by {4,number,integer} {4,choice,1#hour|2#hours}.";
+ZmMsg.reminderOverdueByHoursMinutes="Overdue by {4,number,integer} {4,choice,1#hour|2#hours}, {5,number,integer} {5,choice,1#minute|2#minutes}.";
+ZmMsg.reminderOverdueByMinutes="Overdue by {5,number,integer} {5,choice,1#minute|2#minutes}.";
+ZmMsg.reminderOverdueByMonths="Overdue by {2,number,integer} {2,choice,1#month|2#months}.";
+ZmMsg.reminderOverdueByMonthsDays="Overdue by {2,number,integer} {2,choice,1#month|2#months}, {3,number,integer} {3,choice,1#day,2#days}.";
+ZmMsg.reminderOverdueByYears="Overdue by {1,number,integer} {1,choice,1#year|2#years}.";
+ZmMsg.reminderOverdueByYearsMonths="Overdue by {1,number,integer} {1,choice,1#year|2#years}, {2,number,integer} {2,choice,1#months|2#months}.";
+ZmMsg.reminderSnoozeMinutes="{0} {0,choice,1#minute|2#minutes}";
+ZmMsg.remove="Remove";
+ZmMsg.removeAddr="Remove {0}";
+ZmMsg.removeAll="Remove All";
+ZmMsg.removeAllAttachments="Remove all attachments";
+ZmMsg.removeDupesToSelf="When I receive a message originally sent by me";
+ZmMsg.removeDupesToSelfLabel="Messages from me:";
+ZmMsg.removePhoto="Remove Photo";
+ZmMsg.removeTag="Remove Tag";
+ZmMsg.removed="Removed:";
+ZmMsg.renameFolder="Rename Folder";
+ZmMsg.renameSearch="Rename Search";
+ZmMsg.renameTag="Rename Tag";
+ZmMsg.repeat="Repeat";
+ZmMsg.repeatLabel="Repeat:";
+ZmMsg.repeats="Repeats";
+ZmMsg.replace="Replace";
+ZmMsg.replaceAll="Replace All";
+ZmMsg.replaceAllMenu="Replace all ({0} occurrences)";
+ZmMsg.replaceWithLabel="Replace with:";
+ZmMsg.replied="Replied";
+ZmMsg.reply="Reply";
+ZmMsg.replyAccept="Accept";
+ZmMsg.replyAll="Reply to All";
+ZmMsg.replyAllTooltip="Reply to all recipients of the selected message";
+ZmMsg.replyAllTooltipConv="Reply to all recipients of the most recent message in the conversation";
+ZmMsg.replyByEmail="Reply by Email";
+ZmMsg.replyByEmailTooltip="Reply by email to the caller of the selected voice mail message";
+ZmMsg.replyDecline="Decline";
+ZmMsg.replyForwardFormat="Reply/Forward message format:";
+ZmMsg.replyForwardInSameFormat="Reply/Forward using format of the original message";
+ZmMsg.replyInclude="When replying:";
+ZmMsg.replyNewTime="Propose New Time";
+ZmMsg.replyOptions="Set reply mode, change format, change how original is forwarded";
+ZmMsg.replyPrefix="----- {0} wrote:\r\n";
+ZmMsg.replySender="Reply to Sender";
+ZmMsg.replyTentative="Tentative";
+ZmMsg.replyTo="Reply To";
+ZmMsg.replyToAddress="Reply-to address";
+ZmMsg.replyToAddressError="The reply to address field is not a valid email address";
+ZmMsg.replyToError="The reply to field is empty";
+ZmMsg.replyTooltip="Reply to the sender of the selected message";
+ZmMsg.replyTooltipConv="Reply to the sender of the most recent message in the conversation";
+ZmMsg.replyWithIdentity="When replying to or forwarding messages with this identity:";
+ZmMsg.report="Send Error Report";
+ZmMsg.reportSyncError="Unable to send report.";
+ZmMsg.reportSyncFailure="Report";
+ZmMsg.requestReadReceipt="Request Read Receipt";
+ZmMsg.requestResponses="Request Responses";
+ZmMsg.resend="Resend";
+ZmMsg.resentShareMessage="Share Notice Sent";
+ZmMsg.reset="Reset";
+ZmMsg.resolveDuplicateIgnore="Ignore";
+ZmMsg.resolveDuplicateModify="Modify";
+ZmMsg.resolveDuplicateReplace="Replace";
+ZmMsg.resolveDuplicateReset="Reset";
+ZmMsg.resolveDuplicatesLabel="Resolve duplicates:";
+ZmMsg.resourceConflictIgnore="Ignore Conflicts and Book";
+ZmMsg.resourceConflictInfo="The selected resources/location might already be scheduled on the following instances";
+ZmMsg.resourceConflictLabel="Conflicting Resources";
+ZmMsg.resources="Resources";
+ZmMsg.resourcesLabel="Resources:";
+ZmMsg.restoreDefaults="Restore Defaults";
+ZmMsg.restorePage="Undo Changes";
+ZmMsg.resumeEditing="Resume editing";
+ZmMsg.revert="Revert";
+ZmMsg.revertTimeChanges="Revert Time Changes";
+ZmMsg.revoke="Revoke";
+ZmMsg.revokeShare="Revoke Share";
+ZmMsg.revokeShareConfirm="Are you sure you want to revoke access for {0}?";
+ZmMsg.right="Right";
+ZmMsg.rightClickHint="Right-click for more options.";
+ZmMsg.role="Role";
+ZmMsg.roleLabel="Role:";
+ZmMsg.room="Room";
+ZmMsg.rootFolder="Root";
+ZmMsg.rosterItemAddressNoValue="You must specify an address.";
+ZmMsg.rotfl="rolling on the floor laughing";
+ZmMsg.rowProperties="Row Properties";
+ZmMsg.runSlideShow="Run Slide Show";
+ZmMsg.running="running";
+ZmMsg.save="Save";
+ZmMsg.saveConflict="Save Conflict";
+ZmMsg.saveConflictDesc="<b>{0}</b> already exists or has been changed.<br>What would you like to do?";
+ZmMsg.saveConflictDoc='Document with name "{0}" already exists. Please use a different name.';
+ZmMsg.saveConflictKeepMine="Keep My Copy";
+ZmMsg.saveConflictKeepMineDesc="Keep <b>my</b> copy of the file,<br>discarding their changes.";
+ZmMsg.saveConflictKeepTheirs="Keep Their Copy";
+ZmMsg.saveConflictKeepTheirsDesc="Keep <b>their</b> copy of the file,<br>discarding my changes.";
+ZmMsg.saveConflictPresentation='Presentation with name "{0}" already exists. Please use a different name.';
+ZmMsg.saveConflictSpreadsheet='Spreadsheet with name "{0}" already exists. Please use a different name.';
+ZmMsg.saveConflictViewTheirs="View Their File";
+ZmMsg.saveConflictViewTheirsDesc="View their file to see which to keep.<br>(Will open in a new window.)";
+ZmMsg.saveContactTooltip="Save the current contact";
+ZmMsg.saveCurrentSearch="Save the current search";
+ZmMsg.saveDraft="Save Draft";
+ZmMsg.saveDraftTooltip="Save message to Drafts folder";
+ZmMsg.saveFile="Download";
+ZmMsg.saveFileTooltip="Save this file to your computer";
+ZmMsg.saveIn="Save in";
+ZmMsg.savePrefs="Save current options";
+ZmMsg.saveSearch="Save Search";
+ZmMsg.saveSearchTooltip="Save the search";
+ZmMsg.saveToSent="Save a copy to Sent folder";
+ZmMsg.saveToSentNOT="Do not save sent messages";
+ZmMsg.savedAppointment="Appointment Saved";
+ZmMsg.savedDoc="Document Saved";
+ZmMsg.savedPresentation="Presentation Saved";
+ZmMsg.savedSearch="Saved Search";
+ZmMsg.savedSearches="Saved Searches";
+ZmMsg.savedSpreadsheet="Spreadsheet Saved";
+ZmMsg.schedule="Schedule";
+ZmMsg.search="Search";
+ZmMsg.searchAll="All Item Types";
+ZmMsg.searchAllAccounts="Search All Accounts";
+ZmMsg.searchAppts="Search Appointments";
+ZmMsg.searchBriefcase="Files";
+ZmMsg.searchBuilder="Advanced";
+ZmMsg.searchByAttachment="Search by attachment type";
+ZmMsg.searchByBasic="Search by address, subject, or content";
+ZmMsg.searchByCustom="Add text to the search query";
+ZmMsg.searchByDate="Search on, before, or after a certain date";
+ZmMsg.searchByDomain="Search by address domain";
+ZmMsg.searchByFlag="Search by message flag or status";
+ZmMsg.searchByFolder="Search by folder";
+ZmMsg.searchBySavedSearch="Invoke a saved search";
+ZmMsg.searchBySize="Search by size";
+ZmMsg.searchByTag="Search by tag";
+ZmMsg.searchByTime="Search by relative time/date";
+ZmMsg.searchByZimlet="Search by Zimlet";
+ZmMsg.searchCalendar="Calendar Appointments";
+ZmMsg.searchContacts="Contacts";
+ZmMsg.searchFilterHint="e.g. has:attachment";
+ZmMsg.searchFilterLabel="Search filter:";
+ZmMsg.searchForAny="Search for anything";
+ZmMsg.searchForAppts="Search for appointments";
+ZmMsg.searchForConvs="Search for mail conversations";
+ZmMsg.searchForFiles="Search for files";
+ZmMsg.searchForMessages="Search for mail messages";
+ZmMsg.searchForPages="Search for pages";
+ZmMsg.searchForVoicemails="Search for voice mails";
+ZmMsg.searchGALContacts="Global Address List";
+ZmMsg.searchIn="in:";
+ZmMsg.searchInput="Search";
+ZmMsg.searchLabel="Search:";
+ZmMsg.searchLanguageLabel="Search Language:";
+ZmMsg.searchMail="Email";
+ZmMsg.searchName="Name for the saved search";
+ZmMsg.searchNameEmpty="You must specify a value for the name of the saved search.";
+ZmMsg.searchNameExists="A saved search with that name exists. Please use another name.";
+ZmMsg.searchNoLocation="You must select a location for the saved search.";
+ZmMsg.searchNotebooks="Pages";
+ZmMsg.searchNotes="Notes";
+ZmMsg.searchPersonalContacts="Personal Contacts";
+ZmMsg.searchPersonalSharedContacts="Personal and Shared Contacts";
+ZmMsg.searchResults="Search results";
+ZmMsg.searchScope="Search Scope";
+ZmMsg.searchSettingsLabel="Search Settings:";
+ZmMsg.searchShared="Include Shared Items";
+ZmMsg.searchTasks="Search Tasks";
+ZmMsg.searchTooltip="Run the search";
+ZmMsg.searchVoicemails="Voice Mails";
+ZmMsg.searches="Searches";
+ZmMsg.seconds="seconds";
+ZmMsg.sections="Sections";
+ZmMsg.selectAdapt="Select based on whether I was moving up or down in the list";
+ZmMsg.selectAddresses="Select Addresses";
+ZmMsg.selectAfterDeleteLabel="After I move or delete a message:";
+ZmMsg.selectBuddyOrContact="Select Buddy or Contact";
+ZmMsg.selectContact="Select Contact";
+ZmMsg.selectIdentityWhen="Select this identity when:";
+ZmMsg.selectLanguage="Language";
+ZmMsg.selectNext="Select the next message";
+ZmMsg.selectPrevious="Select the previous message";
+ZmMsg.selectSearch="Select a saved search";
+ZmMsg.selectSkin="UI theme";
+ZmMsg.selectTimezone="Timezone";
+ZmMsg.selectTimezoneInfo="We are unable to identify the timezone in your area, please choose the timezone from list";
+ZmMsg.selectTimezoneLabel="Timezone:";
+ZmMsg.selectTimezoneTitle="Select Timezone ";
+ZmMsg.selection="Selection";
+ZmMsg.selectionColumn="Click to select all items on page. Shift-click to select all search results.";
+ZmMsg.selectiveCallForwardingDescription="Forward <b>only</b> the following numbers to:";
+ZmMsg.selectiveCallForwardingError="The selective call forwarding number is invalid";
+ZmMsg.selectiveCallForwardingFromError="There must be at least one number to forward calls from";
+ZmMsg.selectiveCallForwardingHeader="Forward Calls From";
+ZmMsg.selectiveCallForwardingLabel="Selective Call Forwarding:";
+ZmMsg.selectiveCallForwardingRules="(You may forward up to 12 numbers)";
+ZmMsg.sellEmail="You are not authorized to send email.";
+ZmMsg.send="Send";
+ZmMsg.sendAsAttachment="Send as attachment(s)";
+ZmMsg.sendBCCTo="Send BCC to:";
+ZmMsg.sendByEmail="Send by email";
+ZmMsg.sendComposedMailAboutShare="Compose email in new window";
+ZmMsg.sendErrorAbort="Message not sent; one or more addresses were not accepted.";
+ZmMsg.sendErrorInvalidAddresses="Rejected addresses: {0}";
+ZmMsg.sendErrorPartial="Message not sent to the following rejected addresses: {0}";
+ZmMsg.sendErrorUnsentAddresses="Message NOT sent to: {0}";
+ZmMsg.sendFile="Send file";
+ZmMsg.sendFrom="From:";
+ZmMsg.sendFromAddressError="The send from address field is not a valid email address";
+ZmMsg.sendFromError="The send from field is empty";
+ZmMsg.sendInvDeniedAutoReply="Send auto-reply to users who are denied from inviting me";
+ZmMsg.sendLink="Send link(s)";
+ZmMsg.sendMailAboutShareNote="<b>Note:</b> The standard message displays your name, the name of the shared item, permissions granted to the recipients, and login information, if necessary.";
+ZmMsg.sendNoMailAboutShare="Do not send mail about this share";
+ZmMsg.sendNotificationMail="Send Notification Mail";
+ZmMsg.sendNotificationMailWarning="Changes made will not be visible to attendees on disabling mail notification";
+ZmMsg.sendObo="Send this message on behalf of: {0}";
+ZmMsg.sendPageTT="Send page";
+ZmMsg.sendReceive="Send/Receive";
+ZmMsg.sendStandardMailAboutShare="Send standard message";
+ZmMsg.sendStandardMailAboutSharePlusNote="Add note to standard message";
+ZmMsg.sendTooltip="Send message";
+ZmMsg.sendUpdateTitle="Send Update to Attendees";
+ZmMsg.sendUpdatesAll="Send updates to all attendees.";
+ZmMsg.sendUpdatesNew="Send updates only to added or removed attendees.";
+ZmMsg.sendWithIdentity="Send messages with this identity:";
+ZmMsg.sender="Sender";
+ZmMsg.sent="Sent";
+ZmMsg.sentAt="Sent";
+ZmMsg.sentBy="Sent By";
+ZmMsg.sentByLabel="Sent By:";
+ZmMsg.separator="Separator";
+ZmMsg.sessionExpired="Your session has expired. Please login again.";
+ZmMsg.setPriority="Set the priority of the message";
+ZmMsg.setReplyTo="Reply-to:";
+ZmMsg.setStatus="Set Status";
+ZmMsg.settingsLabel="Settings:";
+ZmMsg.setup="Setup";
+ZmMsg.share="Share";
+ZmMsg.shareAFolder="Share A Folder";
+ZmMsg.shareAcceptedHtml='<h3>The following share has been accepted:</h3>\n<p>\n<table border="0">\n<tr><th align="left">Shared item:</th><td>{0}</td></tr>\n<tr><th align="left">Owner:</th><td>{2}</td></tr>\n</table>\n<p>\n<table border="0">\n<tr><th align="left">Grantee:</th><td>{3}</td></tr>\n<tr><th align="left">Role:</th><td>{4}</td></tr>\n<tr><th align="left">Allowed actions:</th><td>{5}</td>\n</tr>\n</table>';
+ZmMsg.shareAcceptedSubject="Share Accepted";
+ZmMsg.shareAcceptedText="The following share has been accepted:\n\nShared item: {0}\nOwner: {2}\n\nGrantee: {3}\nRole: {4}\nAllowed actions: {5}";
+ZmMsg.shareActionAdmin="Administer";
+ZmMsg.shareActionDelete="Remove";
+ZmMsg.shareActionInsert="Add";
+ZmMsg.shareActionNoAdmin="Administer Denied";
+ZmMsg.shareActionNoDelete="Remove Denied";
+ZmMsg.shareActionNoInsert="Add Denied";
+ZmMsg.shareActionNoRead="View Denied";
+ZmMsg.shareActionNoWorkflow="Accept Denied, Decline Denied";
+ZmMsg.shareActionNoWrite="Edit Denied";
+ZmMsg.shareActionNone="None";
+ZmMsg.shareActionRead="View";
+ZmMsg.shareActionWorkflow="Accept, Decline";
+ZmMsg.shareActionWrite="Edit";
+ZmMsg.shareAddrBook="Share Address Book";
+ZmMsg.shareCalendar="Share Calendar";
+ZmMsg.shareCreatedHtml='<h3>The following share has been created:</h3>\n<p>\n<table border="0">\n<tr><th align="left">Shared item:</th><td>{0} {1}</td></tr>\n<tr><th align="left">Owner:</th><td>{2}</td></tr>\n</table>\n</p>\n<table border="0">\n<tr><th align="left">Grantee:</th><td>{3}</td></tr>\n<tr><th align="left">Role:</th><td>{4}</td></tr>\n<tr><th align="left">Allowed actions:</th><td>{5}</td>\n</tr>\n</table>';
+ZmMsg.shareCreatedSubject="Share Created";
+ZmMsg.shareCreatedText="The following share has been created:\n\nShared item: {0} {1}\nOwner: {2}\n\nGrantee: {3}\nRole: {4}\nAllowed actions: {5}\n";
+ZmMsg.shareDeclinedHtml='<h3>The following share has been declined:</h3>\n<p>\n<table border="0">\n<tr><th align="left">Shared item:</th><td>{0}</td></tr>\n<tr><th align="left">Owner:</th><td>{2}</td></tr>\n</table>\n<p>\n<table border="0">\n<tr><th align="left">Grantee:</th><td>{3}</td></tr>\n<tr><th align="left">Role:</th><td>{4}</td></tr>\n<tr><th align="left">Allowed actions:</th><td>{5}</td>\n</tr>\n</table>';
+ZmMsg.shareDeclinedSubject="Share Declined";
+ZmMsg.shareDeclinedText="The following share has been declined:\n\nShared item: {0}\nOwner: {2}\n\nGrantee: {3}\nRole: {4}\nAllowed actions: {5}";
+ZmMsg.shareFolder="Share Folder";
+ZmMsg.shareFormText="Folders that have been shared with you are shown below. Once a folder has been shared with you, you must accept the share and provide a local name for the folder before it shows up in the overview. Folders that have been shared with you but which you have not accepted (if any) are shown in a separate list from shared folders that you have accepted. Folders may be shared with you in two different ways: they may be shared with a distribution list which includes you, or they may be shared with you directly by another user.";
+ZmMsg.shareModifiedHtml='<h3>The following share has been modified:</h3>\n<p>\n<table border="0">\n<tr><th align="left">Shared item:</th><td>{0} {1}</td></tr>\n<tr><th align="left">Owner:</th><td>{2}</td></tr>\n</table>\n<p>\n<table border="0">\n<tr><th align="left">Grantee:</th><td>{3}</td></tr>\n<tr><th align="left">Role:</th><td>{4} [MODIFIED]</td></tr>\n<tr><th align="left">Allowed actions:</th><td>{5} [MODIFIED]</td>\n</tr>\n</table>';
+ZmMsg.shareModifiedSubject="Share Modified";
+ZmMsg.shareModifiedText="The following share has been modified:\n\nShared item: {0} {1}\nOwner: {2}\n\nGrantee: {3}\nRole: {4} [MODIFIED]\nAllowed actions: {5} [MODIFIED]";
+ZmMsg.shareNameDefault="{0}''s {1}";
+ZmMsg.shareNotebook="Share Notebook";
+ZmMsg.shareNotesHtml='<p>\n<table border="0">\n<tr valign="top"><th align="left">Notes:</th><td>{0}</td></tr>\n</table>';
+ZmMsg.shareNotifyHtml='<h3>The following share item has been updated:</h3>\n<p>\n<table border="0">\n<tr><th align="left">Shared item:</th><td>{0}</td></tr>\n<tr><th align="left">Owner:</th><td>{2}</td></tr>\n</table>\n<p>\n<table border="0">\n<tr><th align="left">Grantee:</th><td>{3}</td></tr>\n<tr><th align="left">Role:</th><td>{4}</td></tr>\n<tr><th align="left">Allowed actions:</th><td>{5}</td>\n</tr>\n</table>';
+ZmMsg.shareNotifySubject="Share Item Updated";
+ZmMsg.shareNotifyText="The following shared item has been updated:\n\nShared item: {0}\nOwner: {2}\n\nGrantee: {3}\nRole: {4}\nAllowed actions: {5}";
+ZmMsg.shareProperties="Share Properties";
+ZmMsg.shareRevokedHtml='<h3>The following share has been revoked:</h3>\n\n<table border="0">\n<tr><th align="left">Shared item:</th><td>{0} {1}</td></tr>\n<tr><th align="left">Owner:</th><td>{2}</td></tr>\n</table>\n<p>\n<table border="0">\n<tr><th align="left">Revokee:</th><td>{3}</td></tr>\n</table>';
+ZmMsg.shareRevokedSubject="Share Revoked";
+ZmMsg.shareRevokedText="The following share has been revoked:\n\nShared item: {0} {1}\nOwner: {2}\n\nRevokee: {3}";
+ZmMsg.shareRoleAdmin="Admin";
+ZmMsg.shareRoleCustom="Custom";
+ZmMsg.shareRoleManager="Manager";
+ZmMsg.shareRoleNone="None";
+ZmMsg.shareRoleViewer="Viewer";
+ZmMsg.shareSection="Share Notebook";
+ZmMsg.shareTaskFolder="Share Task List";
+ZmMsg.shareTooltip="Share this item with another user";
+ZmMsg.shareUrlInfo="To allow others to access this item, direct them to this URL:";
+ZmMsg.shareWithAll="All authenticated users";
+ZmMsg.shareWithGuest="External guests (view only)";
+ZmMsg.shareWithGuestNotes="URL: {0}\nUsername: {1}\nPassword: {2}";
+ZmMsg.shareWithLabel="Share with:";
+ZmMsg.shareWithPublic="Public";
+ZmMsg.shareWithPublicLong="Public (view only, no password required)";
+ZmMsg.shareWithUserOrGroup="Internal users or groups";
+ZmMsg.sharedBySubject="{0} shared by {1}";
+ZmMsg.sharedFolderNotSupported="A file cannot be copied to shared folder";
+ZmMsg.sharing="Sharing";
+ZmMsg.sharingByMe="Folders shared by me";
+ZmMsg.sharingErrorOwnerMissing="Owner is a required field";
+ZmMsg.sharingErrorOwnerSelf="You cannot search for shares from yourself";
+ZmMsg.sharingFolder="Folder";
+ZmMsg.sharingFolderType="Type";
+ZmMsg.sharingGroup="Group";
+ZmMsg.sharingItem="Item";
+ZmMsg.sharingOwner="Owner";
+ZmMsg.sharingOwnerLabel="Owner:";
+ZmMsg.sharingRole="Role";
+ZmMsg.sharingWith="With";
+ZmMsg.sheet="Spreadsheets";
+ZmMsg.sheetTooltip="Spreadsheets";
+ZmMsg.shortcuts="Shortcuts";
+ZmMsg.shortcutsApp="Application Shortcuts";
+ZmMsg.shortcutsCurrent="Listed below are the keyboard shortcuts that are currently available, based on where you are in the application. To see a comprehensive list of all keyboard shortcuts, go to Preferences | Shortcuts.";
+ZmMsg.shortcutsSys="System Shortcuts";
+ZmMsg.shouldShowTimezone="Show timezone list in appointment view";
+ZmMsg.showAdvancedOptions="Show advanced options";
+ZmMsg.showAllItemTypes="Show All Item Types";
+ZmMsg.showAs="Show as:";
+ZmMsg.showBCC="Show BCC";
+ZmMsg.showDetails="Show Details";
+ZmMsg.showExternalImages="Download pictures automatically in HTML Email";
+ZmMsg.showFragments="Display snippets of messages in email list:";
+ZmMsg.showGlobalInbox="Show Global Inbox";
+ZmMsg.showGroupShares="Show folders shared with me through a distribution list";
+ZmMsg.showMessage="Show Message";
+ZmMsg.showNames="Show names from:";
+ZmMsg.showOnlyContacts="Show only Contacts";
+ZmMsg.showOnlyMail="Show only Mail Messages";
+ZmMsg.showOrig="Show Original";
+ZmMsg.showPassword="Show password";
+ZmMsg.showPopup="Show a popup notification";
+ZmMsg.showPopupBrowserPlus="Show a popup notification";
+ZmMsg.showPopupBrowserPlusLink="(requires <a target='_blank' href='http://browserplus.yahoo.com/'>Yahoo! BrowserPlus</a>)";
+ZmMsg.showPopupMac="Show a popup notification (requires Growl)";
+ZmMsg.showRemainingFolders="Show remaining {0}";
+ZmMsg.showRemainingFoldersTooltip="Click here to show {0} remaining {1}";
+ZmMsg.showSearchString="Show advanced search language in search toolbar";
+ZmMsg.showSelectionString="Display checkboxes to quickly select items in lists (requires refresh)";
+ZmMsg.showUserShares="Show folders shared with me by the following user:";
+ZmMsg.showWeekNumber="Show Calendar Week ";
+ZmMsg.signature="Signature";
+ZmMsg.signatureAttachLabel="Attach Signature:";
+ZmMsg.signatureDoNotAttach="Do Not Attach Signature";
+ZmMsg.signatureEnabled="Automatically attach my signature to every email I send";
+ZmMsg.signatureEnabledHelp="To only use this signature sometimes, uncheck the box above and use the <b>Add Signature</b> button in the email compose screen.";
+ZmMsg.signatureLabel="Signature:";
+ZmMsg.signatureMoreOptions="A default signature can be set on the <a href='#Prefs.Accounts' onclick='skin.gotoPrefs(\"ACCOUNTS\");return false'>Accounts Page</a>";
+ZmMsg.signatureNameLabel="Signature Name:";
+ZmMsg.signatureNameMissingRequired="Signature name is empty. It's required.";
+ZmMsg.signatureNewName="Signature #{0}";
+ZmMsg.signatureNote="Signatures with no name or content are discarded.";
+ZmMsg.signatureStyle="Place signature at bottom of entire message";
+ZmMsg.signatureValueMissingRequired="Signature value is empty. It's required.";
+ZmMsg.signatures="Signatures";
+ZmMsg.signaturesUsing="Using Signatures";
+ZmMsg.simple="Simple";
+ZmMsg.site="Site";
+ZmMsg.size="Size";
+ZmMsg.sizeLabel="Size:";
+ZmMsg.sizeToolTip="Size";
+ZmMsg.skinChangeRestart="Would you like to reload the application now to show the new theme? <br>(Otherwise, the new theme will appear the next time you log in.)";
+ZmMsg.skinDeletedError='Your current theme, "{0}", is not available. Please contact your system administrator.';
+ZmMsg.skinDeletedErrorTitle="Zimbra : Theme not available";
+ZmMsg.slide_insertAreaChart="Insert Area Chart";
+ZmMsg.slide_insertChart="Insert Chart";
+ZmMsg.slide_insertColumnChart="Insert Column Chart";
+ZmMsg.slide_insertDoughnutChart="Insert Doughnut Chart";
+ZmMsg.slide_insertFunnelChart="Insert Funnel Chart";
+ZmMsg.slide_insertPieChart="Insert Pie Chart";
+ZmMsg.slides_confirmDeleteSlide="Are you sure you want to delete this slide?";
+ZmMsg.slides_deleteSlide="Delete Slide";
+ZmMsg.slides_deleteTextBox="Delete Text Box";
+ZmMsg.slides_endSlideMsg="End of slide show. <br> Click to exit";
+ZmMsg.slides_imageURL="Image URL";
+ZmMsg.slides_insertSlide="Insert Slide";
+ZmMsg.slides_insertTextBox="Insert Text Box";
+ZmMsg.slides_launchSlideShow="Launch Slide Show";
+ZmMsg.slides_runSlideShow="Run";
+ZmMsg.slides_textBoxMessage="Click to enter text";
+ZmMsg.slides_themeBlue="Blue";
+ZmMsg.slides_themeBlueBand="Blue Band";
+ZmMsg.slides_themeDarkBlue="Dark Blue";
+ZmMsg.slides_themeDefault="Default";
+ZmMsg.slides_themeGreen="Green";
+ZmMsg.slides_themePurple="Purple";
+ZmMsg.slides_themes="Themes";
+ZmMsg.smaller="is smaller than";
+ZmMsg.smartInclude="Include last message only";
+ZmMsg.snooze="Snooze";
+ZmMsg.snoozeAll="Snooze all for:";
+ZmMsg.sortByDuration="Sort by Duration";
+ZmMsg.sortByFrom="Sort by From";
+ZmMsg.sortByLastSaved="Sort by Last Saved";
+ZmMsg.sortByReceived="Sort by Received";
+ZmMsg.sortBySent="Sort by Sent";
+ZmMsg.sortBySize="Sort by Size";
+ZmMsg.sortBySubject="Sort by Subject";
+ZmMsg.sortByTo="Sort by To";
+ZmMsg.sortOrder="Sort order";
+ZmMsg.source="Source";
+ZmMsg.sourceLabel="Source:";
+ZmMsg.specAtt="Specific Attachment";
+ZmMsg.specFile="Specific Filename";
+ZmMsg.spellCheck="Spell Check";
+ZmMsg.spellCheckFailed="Spell Check Failed. Do you want to send this message anyway?";
+ZmMsg.spellCheckTooltip="Check spelling";
+ZmMsg.spellCheckUnavailable="Spell Check Unavailable";
+ZmMsg.splashScreenAppName="Collaboration Suite";
+ZmMsg.splashScreenCompanyURL="http://www.zimbra.com";
+ZmMsg.splashScreenCopyright="Copyright \u00a9 2005-2009 Zimbra, Inc. 'Zimbra' and the Zimbra logos are trademarks of Zimbra, Inc.";
+ZmMsg.splashScreenLoading="Loading ...";
+ZmMsg.splashScreenOfflineName="Desktop";
+ZmMsg.splashScreenSwitch="If you are using a slow connection or an older computer, you may want to <a href='javascript:switchToStandardClient()'>switch to the Standard (HTML) version</a>.";
+ZmMsg.splashScreenVersion="Version";
+ZmMsg.splashScreenZimbraUrl="<a href='http://www.zimbra.com' target=_blank>http://www.zimbra.com</a>";
+ZmMsg.splitCell="Split Cell";
+ZmMsg.splitCells="Split Cells";
+ZmMsg.spreadSheet_func_PI="Constant PI";
+ZmMsg.spreadSheet_func_abs="Returns the absolute value of the argument";
+ZmMsg.spreadSheet_func_average="Computes the arithmetic average of several values";
+ZmMsg.spreadSheet_func_ceil="Returns the smallest integer bigger than the argument";
+ZmMsg.spreadSheet_func_concat="Concatenates multiple strings";
+ZmMsg.spreadSheet_func_cos="Returns the cosine of the argument";
+ZmMsg.spreadSheet_func_exp="Computes the exponential of the argument";
+ZmMsg.spreadSheet_func_floor="Returns the biggest integer smaller than the argument";
+ZmMsg.spreadSheet_func_if="Returns one of 2 values depending on the condition";
+ZmMsg.spreadSheet_func_join="Joins multiple strings with a given separator";
+ZmMsg.spreadSheet_func_len="Returns the length of the given string argument";
+ZmMsg.spreadSheet_func_log="Computes the natural logarithm of the argument";
+ZmMsg.spreadSheet_func_max="Returns the maximum of several values";
+ZmMsg.spreadSheet_func_min="Returns the minimum of several values";
+ZmMsg.spreadSheet_func_modulo="Computes the remainder of division of arg1 to arg2";
+ZmMsg.spreadSheet_func_multiply="Multiplies the values of given arguments";
+ZmMsg.spreadSheet_func_round="Rounds the argument to the nearest integer";
+ZmMsg.spreadSheet_func_sin="Returns the sine of the argument";
+ZmMsg.spreadSheet_func_sqrt="Computes the square root of the argument";
+ZmMsg.spreadSheet_func_sum="Computes the sum of given arguments";
+ZmMsg.spreadSheet_func_tan="Returns the tangent of the argument";
+ZmMsg.spreadSheet_msg_autoDecimals="Auto decimals";
+ZmMsg.spreadSheet_msg_autoType="Auto type";
+ZmMsg.spreadsheet="Spreadsheet";
+ZmMsg.spreadsheetName="Spreadsheet Name";
+ZmMsg.spreadsheetTitle="Zimbra Spreadsheet ";
+ZmMsg.spreadsheet_msg_numberOfDecimals="{0,choice,0#No decimals|1#{0} decimal|2#{0} decimals}";
+ZmMsg.start="Start";
+ZmMsg.startDate="Start Date";
+ZmMsg.startLabel="Start:";
+ZmMsg.startOn="Start On:";
+ZmMsg.startTime="Start Time";
+ZmMsg.startTimeLabel="Start Time:";
+ZmMsg.status="Status";
+ZmMsg.statusFree="Status: Free";
+ZmMsg.statusHistory="Status History";
+ZmMsg.statusLabel="Status:";
+ZmMsg.stickyWindow="Sticky Window";
+ZmMsg.stopEvaluation="Stop evaluation";
+ZmMsg.stopFilterProcessing="Do not process additional filters";
+ZmMsg.styleLabel="Style:";
+ZmMsg.subject="Subject";
+ZmMsg.subjectAccept="Accept";
+ZmMsg.subjectDecline="Decline";
+ZmMsg.subjectLabel="Subject:";
+ZmMsg.subjectNewTime="New Time Proposed";
+ZmMsg.subjectTentative="Tentative";
+ZmMsg.subscribeToFeed="Subscribe to RSS/ATOM feed";
+ZmMsg.subscript="Subscript";
+ZmMsg.sumCells="Sum cells";
+ZmMsg.summary="Summary:";
+ZmMsg.superscript="Superscript";
+ZmMsg.switchIncludeWarning="Text that you've added before the included content will be preserved, but text added after it will be lost. Continue?";
+ZmMsg.switchToHtml="Switching to html will discard some text formatting on switching back. Continue?";
+ZmMsg.switchToOfflineClientEx="<a href='http://www.zimbra.com/products/desktop.html' target='_blank'>Learn about the offline version</a>";
+ZmMsg.switchToText="Switching to text will discard all HTML formatting. Continue?";
+ZmMsg.sync="Sync";
+ZmMsg.syncOfflineFolderOff="Turn sync off";
+ZmMsg.syncOfflineFolderOn="Turn sync on";
+ZmMsg.syncTooltip="Synchronize mailbox with online server";
+ZmMsg.systemDefaults="System Defaults:";
+ZmMsg.tableAlignment="Table Alignment:";
+ZmMsg.tableOperations="Table Operations";
+ZmMsg.tableProperties="Table Properties";
+ZmMsg.tableSize="Table Size";
+ZmMsg.tableWidth="Table Width:";
+ZmMsg.tag="Tag";
+ZmMsg.tagAppt="Tag Appointment";
+ZmMsg.tagAppts="Tag Appointments";
+ZmMsg.tagColor="Tag Color";
+ZmMsg.tagConversation="Tag Conversation";
+ZmMsg.tagConversations="Tag Conversations";
+ZmMsg.tagFile="Tag File";
+ZmMsg.tagItem="Tag Item";
+ZmMsg.tagItems="Tag Items";
+ZmMsg.tagMessage="Tag Message";
+ZmMsg.tagMessages="Tag Messages";
+ZmMsg.tagName="Tag name";
+ZmMsg.tagNameEmpty="You must specify a value for the tag name.";
+ZmMsg.tagNameExists="A tag with that name exists. Please use another name. (Tag names are case-insensitive.)";
+ZmMsg.tagPage="Tag Page";
+ZmMsg.tagReadonly="You have selected one or more appointments which are read only or shared. These appointments cannot be tagged.";
+ZmMsg.tagSelectLocation="You must select a location for the tag.";
+ZmMsg.tagTask="Tag Task";
+ZmMsg.tagTasks="Tag Tasks";
+ZmMsg.tagTooltip="Tag selected item(s)";
+ZmMsg.tagWith="Tag with";
+ZmMsg.tags="Tags";
+ZmMsg.targetAddressBook="Select the destination address book.";
+ZmMsg.targetCalendar="Select the destination calendar.";
+ZmMsg.targetFolder="Select the destination folder.";
+ZmMsg.targetTag="Select a tag:";
+ZmMsg.task="Task";
+ZmMsg.taskFolder="Task List:";
+ZmMsg.taskPastDue="Task is past due.";
+ZmMsg.taskSaved="Task Saved";
+ZmMsg.tasks="Tasks";
+ZmMsg.tasksFolder="Task Folder";
+ZmMsg.template="Template";
+ZmMsg.tentative="Tentative";
+ZmMsg.testUrl="Test";
+ZmMsg.testUrlTooltip="Open this URL in new window";
+ZmMsg.text="Text";
+ZmMsg.textAlign="Text Alignment:";
+ZmMsg.textDocuments="Text Documents";
+ZmMsg.textFile="Text File";
+ZmMsg.textStyle="Text Style";
+ZmMsg.theirs="Theirs";
+ZmMsg["theme-bare"]="Bare";
+ZmMsg["theme-beach"]="Beach";
+ZmMsg["theme-bones"]="Bones";
+ZmMsg["theme-froggy"]="Froggy";
+ZmMsg["theme-harvest"]="Harvest";
+ZmMsg["theme-hotrod"]="Hot Rod";
+ZmMsg["theme-lavender"]="Lavender";
+ZmMsg["theme-lemongrass"]="Lemongrass";
+ZmMsg["theme-sand"]="Sand";
+ZmMsg["theme-sky"]="Sky";
+ZmMsg["theme-steel"]="Steel";
+ZmMsg["theme-vanilla"]="Vanilla";
+ZmMsg["theme-venice"]="Venice";
+ZmMsg["theme-waves"]="Waves";
+ZmMsg.themeLabel="Theme:";
+ZmMsg["thunderbird-csv"]="Thunderbird Contacts";
+ZmMsg.tiffImage="TIFF Image";
+ZmMsg.time="Time";
+ZmMsg.timezonePrefSaved="Timezone Preference Saved";
+ZmMsg.titleLabel="Title:";
+ZmMsg.to="To";
+ZmMsg.toCc="To / Cc";
+ZmMsg.toLabel="To:";
+ZmMsg.today="Today";
+ZmMsg.todayGoto="Go to Today";
+ZmMsg.todayTooltip="Show the calendar for today";
+ZmMsg.top="Top";
+ZmMsg.trash="Trash";
+ZmMsg.type="Type";
+ZmMsg.typeLabel="Type:";
+ZmMsg.typing="typing";
+ZmMsg.unableToGetPage="Unable to fetch page content";
+ZmMsg.unableToImportFile="Unable to import file";
+ZmMsg.unableToSavePage="Unable to save page";
+ZmMsg.undelete="Undelete";
+ZmMsg.under="under";
+ZmMsg.unflagged="Unflagged";
+ZmMsg.unitsLabel="Units:";
+ZmMsg.unknown="Unknown";
+ZmMsg.unknownBinaryType="Unknown Binary Type";
+ZmMsg.unknownError="An unknown error has occurred.";
+ZmMsg.unknownUser='Unknown user "{0}". Must specify a valid Zimbra user.';
+ZmMsg.unread="Unread";
+ZmMsg.unreadCount="{0} Unread";
+ZmMsg.unsupportedBrowserTip="To learn more about Zimbra and the Zimbra Collaboration Suite, visit <a href='http://www.zimbra.com'>www.zimbra.com</a> or send an email to <a href='mailto:info@zimbra.com'>info@zimbra.com</a>.\";";
+ZmMsg.untitled="Untitled";
+ZmMsg.upLabel="Up";
+ZmMsg.uploadAction="If a file already exists with the same name:";
+ZmMsg.uploadActionAsk="Ask Me";
+ZmMsg.uploadActionKeepMine="Replace With My File";
+ZmMsg.uploadActionKeepTheirs="Keep Existing File";
+ZmMsg.uploadChoose="Choose one or more files to upload:";
+ZmMsg.uploadConflict="Upload Conflict";
+ZmMsg.uploadConflictDesc="The following file(s) already exist on the server.<br>Which would you like to keep?";
+ZmMsg.uploadDocs="Upload Files";
+ZmMsg.uploadError="Upload error: {0}<br>Unable to upload the file.";
+ZmMsg.uploadErrorAccessDenied="Upload error: Access is denied<br>Unable to upload the file.";
+ZmMsg.uploadFileToBriefcase="Upload New File to Briefcase";
+ZmMsg.uploadImage="Upload Image";
+ZmMsg.uploadNewFile="Upload File";
+ZmMsg.url="URL";
+ZmMsg.urlLabel="URL:";
+ZmMsg.useQuickAdd="Use the QuickAdd dialog when creating new appointments";
+ZmMsg.useSignature="Use signature:";
+ZmMsg.userLabel="User:";
+ZmMsg.userUnknown="UNKNOWN USER";
+ZmMsg.username="Username";
+ZmMsg.usernameLabel="Username:";
+ZmMsg.validateRecurrence="Start date no longer fits the existing recurrence pattern.<br>Do you want to reset it to the nearest possible date?";
+ZmMsg.value="Value";
+ZmMsg.valueLabel="Value:";
+ZmMsg.versionChangeRestart="The server software has been updated. It is recommended that you reload your browser so that you are up to date.<br><br> Old version: {0}<br> New version: {1}<br><br> Would you like to reload the browser now? Warning: if you choose not to reload, there is a chance you will encounter errors.";
+ZmMsg.versionLabel="Version:";
+ZmMsg.verticalAlign="Vertical Align:";
+ZmMsg.video="Video";
+ZmMsg.view="View";
+ZmMsg.viewAllImages="View all images";
+ZmMsg.viewAppointment="Open";
+ZmMsg.viewAsHtml="view as html";
+ZmMsg.viewByDate="View by date:";
+ZmMsg.viewCalForDay="day";
+ZmMsg.viewCalForList="list";
+ZmMsg.viewCalForMonth="month";
+ZmMsg.viewCalForWeek="week";
+ZmMsg.viewCalForWorkWeek="work";
+ZmMsg.viewCalListTooltip="Show calendar as a list";
+ZmMsg.viewContacts="Default contact view";
+ZmMsg.viewDay="Day";
+ZmMsg.viewDayTooltip="Show calendar for the currently selected day";
+ZmMsg.viewEntireMessage="View entire message.";
+ZmMsg.viewFileAsHtml="View as HTML";
+ZmMsg.viewList="List";
+ZmMsg.viewMailAsHtml="View mail as HTML (when possible)";
+ZmMsg.viewMailAsHtmlLabel="Display HTML:";
+ZmMsg.viewMessage="To view a message, click on it.";
+ZmMsg.viewMonth="Month";
+ZmMsg.viewMonthTooltip="Show calendar for the currently selected month";
+ZmMsg.viewSchedule="Schedule";
+ZmMsg.viewScheduleTooltip="Show schedule view";
+ZmMsg.viewTheirs="View Theirs";
+ZmMsg.viewTooltip="Change view options";
+ZmMsg.viewWeek="Week";
+ZmMsg.viewWeekTooltip="Show calendar for the currently selected week";
+ZmMsg.viewWorkWeek="Work Week";
+ZmMsg.viewWorkWeekTooltip="Show calendar for the currently selected work week";
+ZmMsg.voice="Voice";
+ZmMsg.voiceMail="Voice Mail";
+ZmMsg.voicePageSizeDescription="Voice mail messages per page";
+ZmMsg.voicePageSizeLabel="Display:";
+ZmMsg.voicePrefsInstruction="Select the phone number you want to manage then select the options for that number.";
+ZmMsg.voicemailBodyHtml='<br><br><br><br>A voice customer has sent you a new voice mail message. You can listen to the voice mail by simply opening the attached file.<br>From: {0}&nbsp;&nbsp;|&nbsp;&nbsp;Duration: {1}&nbsp;&nbsp;|&nbsp;&nbsp;Received: {2}<br><br><a href="http://www.zimbra.com">http://www.zimbra.com</a>';
+ZmMsg.voicemailBodyText="\n\n\n\nA voice customer has sent you a new voice mail message. You can listen to the voice mail by simply opening the attached file.\nFrom: {0} | Duration: {1} | Received: {2}\n\nhttp://www.zimbra.com";
+ZmMsg.voicemailFolder="Voice Mail Folder";
+ZmMsg.voicemailForwardSubject="Listen to this voice mail I received";
+ZmMsg.voicemailMessages="Voice Mail Messages";
+ZmMsg.voicemailReplySubject="About your voice mail";
+ZmMsg.voicemails="Voice Mails";
+ZmMsg.volume="Volume";
+ZmMsg.waitingOn="Waiting on someone else";
+ZmMsg.waveAudio="WAV Audio";
+ZmMsg.webPageLabel="A web page (URL):";
+ZmMsg.week="Week";
+ZmMsg.weekday="weekday";
+ZmMsg.weekly="Weekly";
+ZmMsg.welcome="Welcome";
+ZmMsg.whatsThis="What's This?";
+ZmMsg.when="When";
+ZmMsg.whenInFolder="Replying to a message in folder(s):";
+ZmMsg.whenInFolderError="The select when in folder field is not a valid list of folder names";
+ZmMsg.whenInFolderHint="Enter folder names separated by commas or semi-colons";
+ZmMsg.whenLabel="When:";
+ZmMsg.whenReplyingToAddress="When replying to messages sent to this email address";
+ZmMsg.whenReplyingToFolder="When reading or replying to messages in this folder";
+ZmMsg.whenSentTo="Replying to a message sent to:";
+ZmMsg.whenSentToError="The select when replying to address field is not a valid list of email addresses";
+ZmMsg.whenSentToHint="Enter email addresses separated by commas or semi-colons";
+ZmMsg.whiteBlackNumUsed="{0} of {1} used.";
+ZmMsg.whiteListLabel="Allow messages from:";
+ZmMsg.width="Width";
+ZmMsg.widthLabel="Width:";
+ZmMsg.wikiChangeNameWarning="Warning: Changing the name will break any links that point to this page.";
+ZmMsg.wikiFragmentRecursion="Error: recursive fragment.";
+ZmMsg.wikiIncludeMissing="Error: missing inclusion page {0}.";
+ZmMsg.wikiIncludeRecursion="Error: recursive include of page {0}.";
+ZmMsg.wikiNoTitle="[Untitled]";
+ZmMsg.wikiPages="Pages";
+ZmMsg.wikiPagesHeader="Pages";
+ZmMsg.wikiPagesNotFound="(None)";
+ZmMsg.wikiSectionsHeader="Notebooks";
+ZmMsg.wikiSpecialPages="Special Pages";
+ZmMsg.wikiTemplatesMissing="<b>Error:</b> Document templates missing. Please notify administrator.";
+ZmMsg.wikiToc="Table of Contents";
+ZmMsg.wikiUserPages="Pages";
+ZmMsg.wikletColor="Color";
+ZmMsg.wikletColorTT="Insert page's notebook color";
+ZmMsg.wikletConfigureNone="This wiklet is not configurable";
+ZmMsg.wikletConfigureParams="Click to set wiklet parameters";
+ZmMsg.wikletConfigureValue="Click to set wiklet value";
+ZmMsg.wikletCreateDate="CreateDate";
+ZmMsg.wikletCreateDateTT="Insert page creation date";
+ZmMsg.wikletCreateTime="CreateTime";
+ZmMsg.wikletCreateTimeTT="Insert page creation time";
+ZmMsg.wikletCreator="Creator";
+ZmMsg.wikletCreatorTT="Insert page creator's name";
+ZmMsg.wikletDateFull="Full Date";
+ZmMsg.wikletDateLong="Long Date";
+ZmMsg.wikletDateMedium="Medium Date";
+ZmMsg.wikletDateShort="Short Date";
+ZmMsg.wikletDateTimeFull="Full Date and Time";
+ZmMsg.wikletDateTimeLong="Long Date and Time";
+ZmMsg.wikletDateTimeMedium="Medium Date and Time";
+ZmMsg.wikletDateTimeShort="Short Date and Time";
+ZmMsg.wikletFragment="Fragment";
+ZmMsg.wikletFragmentTT="Insert page fragment";
+ZmMsg.wikletIcon="Icon";
+ZmMsg.wikletIconTT="Insert item icon";
+ZmMsg.wikletId="ID";
+ZmMsg.wikletIdTT="Insert item ID";
+ZmMsg.wikletInclude="Include";
+ZmMsg.wikletIncludeInherit="Inherit";
+ZmMsg.wikletIncludeTT="Insert contents of another page into this one";
+ZmMsg.wikletInline="Inline";
+ZmMsg.wikletInlineTT="Insert contents of another page in current scope";
+ZmMsg.wikletModifier="Modifier";
+ZmMsg.wikletModifierTT="Insert last modifier's name";
+ZmMsg.wikletModifyDate="ModifyDate";
+ZmMsg.wikletModifyDateTT="Insert page modification date";
+ZmMsg.wikletModifyTime="ModifyTime";
+ZmMsg.wikletModifyTimeTT="Insert page modification time";
+ZmMsg.wikletMsg="Message";
+ZmMsg.wikletMsgTT="Insert string from message catalog";
+ZmMsg.wikletName="Name";
+ZmMsg.wikletNameTT="Insert current item's name";
+ZmMsg.wikletParams="Wiklet Parameters";
+ZmMsg.wikletPath="Path";
+ZmMsg.wikletPathMakeLinks="Links";
+ZmMsg.wikletPathTT="Insert path to this page";
+ZmMsg.wikletTags="Tags";
+ZmMsg.wikletTagsTT="Insert current items's tags";
+ZmMsg.wikletTimeFull="Full Time";
+ZmMsg.wikletTimeLong="Long Time";
+ZmMsg.wikletTimeMedium="Medium Time";
+ZmMsg.wikletTimeShort="Short Time";
+ZmMsg.wikletToc="TOC";
+ZmMsg.wikletTocTT="Insert table of contents";
+ZmMsg.wikletUrl="URL";
+ZmMsg.wikletUrlTT="Insert URL to item";
+ZmMsg.wikletVersion="Version";
+ZmMsg.wikletVersionTT="Insert page version";
+ZmMsg.work="Work";
+ZmMsg.workWeek="Work Week";
+ZmMsg.wrote="wrote";
+ZmMsg.xmlDocument="XML";
+ZmMsg.yahoo="Yahoo!";
+ZmMsg["yahoo-csv"]="Yahoo! Contacts";
+ZmMsg.yahooMail="Yahoo! Mail";
+ZmMsg.yearly="Yearly";
+ZmMsg.yellow="Yellow";
+ZmMsg.ysearchURL="http://us.search.yahoo.com";
+ZmMsg.zd_docCharts="Charts";
+ZmMsg.zd_docChartsTT="Click to create Charts";
+ZmMsg.zd_docElements="Document Elements";
+ZmMsg.zd_docElementsTT="Click to create Document Elements";
+ZmMsg.zd_docQuickInsertTT="Click to insert";
+ZmMsg.zd_docQuickTables="Quick Tables";
+ZmMsg.zd_docQuickTablesTT="Click to create Quick Tables";
+ZmMsg.zd_docSmartArt="SmartArt Graphics";
+ZmMsg.zd_docSmartArtTT="Click to create SmartArt Graphics";
+ZmMsg.zeroSizedAtts="Files of zero size and invalid path have been discarded.";
+ZmMsg["zimbra-csv"]="Account Contacts";
+ZmMsg["zimbra-ics"]="Account Calendar";
+ZmMsg["zimbra-tgz"]="Account Export";
+ZmMsg.zimbraAssistant="Zimbra Assistant";
+ZmMsg.zimbraAssistantWelcome="Welcome to Zimbra Assistant!";
+ZmMsg.zimbraExcelDocument="Spreadsheet";
+ZmMsg.zimbraLabel="Zimbra:";
+ZmMsg.zimbraLoginMetaDesc="Zimbra provides open source server and client software for messaging and collaboration. To find out more visit http://www.zimbra.com.";
+ZmMsg.zimbraLoginTitle="Zimbra Collaboration Suite Log In";
+ZmMsg.zimbraPPTDocument="Presentation";
+ZmMsg.zimbraTitle="Zimbra";
+ZmMsg.zimbraWordDocument="Document";
+ZmMsg.zimlet="Zimlet";
+ZmMsg.zimletChangeRestart="Would you like to reload the application now to apply the zimlet changes? <br>(Otherwise, the zimlet changes will appear the next time you log in.)";
+ZmMsg.zimletInitError='An error occurred while initializing the zimlet "{0}". Please notify administrator.';
+ZmMsg.zimletNotLoaded='The zimlet "{0}" is not yet loaded.';
+ZmMsg.zimletUnknown='The zimlet "{0}" is not defined.';
+ZmMsg.zimlets="Zimlets";
+ZmMsg.zimletsPrefsMsg="Zimlets are add-on applications that enhance the functionality of your client. This table allows you to enable or disable individual zimlets.";
+ZmMsg.zipFile="Zip File";
+if(!window.AjxKeys){AjxKeys={}
+}AjxKeys["button.Select.description"]="Press the button";
+AjxKeys["button.Select.display"]="Enter";
+AjxKeys["button.Select.keycode"]="13";
+AjxKeys["button.Select.sort"]="10010";
+AjxKeys["button.SubMenu.description"]="Display menu";
+AjxKeys["button.SubMenu.display"]="ArrowDown";
+AjxKeys["button.SubMenu.keycode"]="40";
+AjxKeys["button.SubMenu.sort"]="10020;";
+AjxKeys["button.description"]="Buttons";
+AjxKeys["button.sort"]="10000";
+AjxKeys["dialog.Cancel.description"]="Cancel changes";
+AjxKeys["dialog.Cancel.display"]="Esc";
+AjxKeys["dialog.Cancel.keycode"]="27";
+AjxKeys["dialog.Cancel.sort"]="40020";
+AjxKeys["dialog.Enter.description"]="Save changes";
+AjxKeys["dialog.Enter.display"]="Enter; Space";
+AjxKeys["dialog.Enter.keycode"]="13; 32";
+AjxKeys["dialog.Enter.sort"]="40010";
+AjxKeys["dialog.No.description"]='Respond "No"';
+AjxKeys["dialog.No.display"]="N";
+AjxKeys["dialog.No.keycode"]="78";
+AjxKeys["dialog.No.sort"]="40040";
+AjxKeys["dialog.Yes.description"]='Respond "Yes"';
+AjxKeys["dialog.Yes.display"]="Y";
+AjxKeys["dialog.Yes.keycode"]="89";
+AjxKeys["dialog.Yes.sort"]="40030";
+AjxKeys["dialog.description"]="Dialog Boxes";
+AjxKeys["dialog.sort"]="40000";
+AjxKeys["editor.Bold.description"]="Bold";
+AjxKeys["editor.Bold.display"]="Ctrl+B";
+AjxKeys["editor.Bold.keycode"]="Ctrl+66";
+AjxKeys["editor.Bold.sort"]="60010";
+AjxKeys["editor.CenterJustify.description"]="Align center";
+AjxKeys["editor.CenterJustify.display"]="Ctrl+E";
+AjxKeys["editor.CenterJustify.keycode"]="Ctrl+69";
+AjxKeys["editor.CenterJustify.sort"]="60070";
+AjxKeys["editor.Header1.description"]="Level 1 header";
+AjxKeys["editor.Header1.display"]="Ctrl+1";
+AjxKeys["editor.Header1.keycode"]="Ctrl+49";
+AjxKeys["editor.Header1.sort"]="60090";
+AjxKeys["editor.Header2.description"]="Level 2 header";
+AjxKeys["editor.Header2.display"]="Ctrl+2";
+AjxKeys["editor.Header2.keycode"]="Ctrl+50";
+AjxKeys["editor.Header2.sort"]="60100";
+AjxKeys["editor.Header3.description"]="Level 3 header";
+AjxKeys["editor.Header3.display"]="Ctrl+3";
+AjxKeys["editor.Header3.keycode"]="Ctrl+51";
+AjxKeys["editor.Header3.sort"]="60110";
+AjxKeys["editor.Header4.description"]="Level 4 header";
+AjxKeys["editor.Header4.display"]="Ctrl+4";
+AjxKeys["editor.Header4.keycode"]="Ctrl+52";
+AjxKeys["editor.Header4.sort"]="60120";
+AjxKeys["editor.Header5.description"]="Level 5 header";
+AjxKeys["editor.Header5.display"]="Ctrl+5";
+AjxKeys["editor.Header5.keycode"]="Ctrl+53";
+AjxKeys["editor.Header5.sort"]="60130";
+AjxKeys["editor.Header6.description"]="Level 6 header";
+AjxKeys["editor.Header6.display"]="Ctrl+6";
+AjxKeys["editor.Header6.keycode"]="Ctrl+54";
+AjxKeys["editor.Header6.sort"]="60140";
+AjxKeys["editor.Italic.description"]="Italics";
+AjxKeys["editor.Italic.display"]="Ctrl+I";
+AjxKeys["editor.Italic.keycode"]="Ctrl+73";
+AjxKeys["editor.Italic.sort"]="60020";
+AjxKeys["editor.LeftJustify.description"]="Align left";
+AjxKeys["editor.LeftJustify.display"]="Ctrl+L";
+AjxKeys["editor.LeftJustify.keycode"]="Ctrl+76";
+AjxKeys["editor.LeftJustify.sort"]="60050";
+AjxKeys["editor.RightJustify.description"]="Align right";
+AjxKeys["editor.RightJustify.display"]="Ctrl+R";
+AjxKeys["editor.RightJustify.keycode"]="Ctrl+82";
+AjxKeys["editor.RightJustify.sort"]="60060";
+AjxKeys["editor.Strikethru.description"]="Strikethrough";
+AjxKeys["editor.Strikethru.display"]="Ctrl+Shift+K";
+AjxKeys["editor.Strikethru.keycode"]="Ctrl+Shift+75";
+AjxKeys["editor.Strikethru.sort"]="60030";
+AjxKeys["editor.Underline.description"]="Underline";
+AjxKeys["editor.Underline.display"]="Ctrl+U";
+AjxKeys["editor.Underline.keycode"]="Ctrl+85";
+AjxKeys["editor.Underline.sort"]="60040";
+AjxKeys["editor.description"]="HTML Editor";
+AjxKeys["editor.sort"]="60000";
+AjxKeys["keys.alt.display"]="Alt";
+AjxKeys["keys.alt.keycode"]="18";
+AjxKeys["keys.ctrl.display"]="Ctrl";
+AjxKeys["keys.ctrl.keycode"]="17";
+AjxKeys["keys.meta.display"]="Meta";
+AjxKeys["keys.meta.keycode.mac"]="224";
+AjxKeys["keys.meta.keycode.win"]="91";
+AjxKeys["keys.shift.display"]="Shift";
+AjxKeys["keys.shift.keycode"]="16";
+AjxKeys["list.AddNext.description"]="Add next item";
+AjxKeys["list.AddNext.display"]="Shift+ArrowDown";
+AjxKeys["list.AddNext.keycode"]="Shift+40";
+AjxKeys["list.AddNext.repeat"]="true";
+AjxKeys["list.AddNext.sort"]="30090";
+AjxKeys["list.AddPrevious.description"]="Add previous item";
+AjxKeys["list.AddPrevious.display"]="Shift+ArrowUp";
+AjxKeys["list.AddPrevious.keycode"]="Shift+38";
+AjxKeys["list.AddPrevious.repeat"]="true";
+AjxKeys["list.AddPrevious.sort"]="30100";
+AjxKeys["list.ContextMenu.description"]="Show right-click menu";
+AjxKeys["list.ContextMenu.display"]=",; Ctrl+Enter";
+AjxKeys["list.ContextMenu.display.mac"]=",; Ctrl+M";
+AjxKeys["list.ContextMenu.keycode"]="188; Ctrl+13";
+AjxKeys["list.ContextMenu.keycode.mac"]="188; Ctrl+77";
+AjxKeys["list.ContextMenu.sort"]="30080";
+AjxKeys["list.DoubleClick.description"]="Double-click";
+AjxKeys["list.DoubleClick.display"]="Enter";
+AjxKeys["list.DoubleClick.keycode"]="13";
+AjxKeys["list.DoubleClick.sort"]="30070";
+AjxKeys["list.Next.description"]="Focus next item";
+AjxKeys["list.Next.display"]="Ctrl+ArrowDown";
+AjxKeys["list.Next.keycode"]="Ctrl+40";
+AjxKeys["list.Next.repeat"]="true";
+AjxKeys["list.Next.sort"]="30110";
+AjxKeys["list.Previous.description"]="Focus previous item";
+AjxKeys["list.Previous.display"]="Ctrl+ArrowUp";
+AjxKeys["list.Previous.keycode"]="Ctrl+38";
+AjxKeys["list.Previous.repeat"]="true";
+AjxKeys["list.Previous.sort"]="30120";
+AjxKeys["list.SelectAll.description"]="Select all";
+AjxKeys["list.SelectAll.display"]="Ctrl+A";
+AjxKeys["list.SelectAll.keycode"]="Ctrl+65";
+AjxKeys["list.SelectAll.sort"]="30030";
+AjxKeys["list.SelectCurrent.description"]="Select/Unselect";
+AjxKeys["list.SelectCurrent.display"]="Ctrl+`";
+AjxKeys["list.SelectCurrent.keycode"]="Ctrl+192";
+AjxKeys["list.SelectCurrent.sort"]="30060";
+AjxKeys["list.SelectFirst.description"]="Select first item";
+AjxKeys["list.SelectFirst.display"]="Home";
+AjxKeys["list.SelectFirst.display.mac"]="Home; Meta+ArrowUp";
+AjxKeys["list.SelectFirst.keycode"]="36";
+AjxKeys["list.SelectFirst.keycode.mac"]="36; Meta+38";
+AjxKeys["list.SelectFirst.sort"]="30040";
+AjxKeys["list.SelectLast.description"]="Select last item";
+AjxKeys["list.SelectLast.display"]="End";
+AjxKeys["list.SelectLast.display.mac"]="End; Meta+ArrowDown";
+AjxKeys["list.SelectLast.keycode"]="35";
+AjxKeys["list.SelectLast.keycode.mac"]="36; Meta+40";
+AjxKeys["list.SelectLast.sort"]="30050";
+AjxKeys["list.SelectNext.description"]="Select next item";
+AjxKeys["list.SelectNext.display"]="ArrowDown; Space; J";
+AjxKeys["list.SelectNext.keycode"]="40; 32; 74";
+AjxKeys["list.SelectNext.repeat"]="true";
+AjxKeys["list.SelectNext.sort"]="30010";
+AjxKeys["list.SelectPrevious.description"]="Select previous item";
+AjxKeys["list.SelectPrevious.display"]="ArrowUp; K";
+AjxKeys["list.SelectPrevious.keycode"]="38; 75";
+AjxKeys["list.SelectPrevious.repeat"]="true";
+AjxKeys["list.SelectPrevious.sort"]="30020";
+AjxKeys["list.description"]="Lists";
+AjxKeys["list.sort"]="30000";
+AjxKeys["menu.Cancel.description"]="Dismiss";
+AjxKeys["menu.Cancel.display"]="Esc";
+AjxKeys["menu.Cancel.keycode"]="27";
+AjxKeys["menu.Cancel.sort"]="20040";
+AjxKeys["menu.ParentMenu.description"]="Hide sub-menu";
+AjxKeys["menu.ParentMenu.display"]="ArrowLeft";
+AjxKeys["menu.ParentMenu.keycode"]="37";
+AjxKeys["menu.ParentMenu.sort"]="20060";
+AjxKeys["menu.Select.description"]="Select";
+AjxKeys["menu.Select.display"]="Enter";
+AjxKeys["menu.Select.keycode"]="13";
+AjxKeys["menu.Select.sort"]="20030";
+AjxKeys["menu.SelectNext.description"]="Next item";
+AjxKeys["menu.SelectNext.display"]="ArrowDown";
+AjxKeys["menu.SelectNext.keycode"]="40";
+AjxKeys["menu.SelectNext.repeat"]="true";
+AjxKeys["menu.SelectNext.sort"]="20010";
+AjxKeys["menu.SelectPrevious.description"]="Previous item";
+AjxKeys["menu.SelectPrevious.display"]="ArrowUp";
+AjxKeys["menu.SelectPrevious.keycode"]="38";
+AjxKeys["menu.SelectPrevious.repeat"]="true";
+AjxKeys["menu.SelectPrevious.sort"]="20020";
+AjxKeys["menu.SubMenu.description"]="Show sub-menu";
+AjxKeys["menu.SubMenu.display"]="ArrowRight";
+AjxKeys["menu.SubMenu.keycode"]="39";
+AjxKeys["menu.SubMenu.sort"]="20050";
+AjxKeys["menu.description"]="Pop-up Menus";
+AjxKeys["menu.sort"]="20000";
+AjxKeys["tabView.GoToTab.description"]="Go to tab [n]";
+AjxKeys["tabView.GoToTab.display"]="Ctrl+NNN";
+AjxKeys["tabView.GoToTab.keycode"]="Ctrl+NNN";
+AjxKeys["tabView.GoToTab.sort"]="110030";
+AjxKeys["tabView.NextTab.description"]="Next tab";
+AjxKeys["tabView.NextTab.display"]="Ctrl+J";
+AjxKeys["tabView.NextTab.keycode"]="Ctrl+74";
+AjxKeys["tabView.NextTab.sort"]="110010";
+AjxKeys["tabView.PreviousTab.description"]="Previous tab";
+AjxKeys["tabView.PreviousTab.display"]="Ctrl+K";
+AjxKeys["tabView.PreviousTab.keycode"]="Ctrl+75";
+AjxKeys["tabView.PreviousTab.sort"]="110020";
+AjxKeys["tabView.description"]="Tab Views";
+AjxKeys["tabView.sort"]="110000";
+AjxKeys["toolbarHorizontal.INHERIT"]="button";
+AjxKeys["toolbarHorizontal.Next.description"]="Next button";
+AjxKeys["toolbarHorizontal.Next.display"]="ArrowRight";
+AjxKeys["toolbarHorizontal.Next.keycode"]="39";
+AjxKeys["toolbarHorizontal.Next.sort"]="50010";
+AjxKeys["toolbarHorizontal.Previous.description"]="Previous button";
+AjxKeys["toolbarHorizontal.Previous.display"]="ArrowLeft";
+AjxKeys["toolbarHorizontal.Previous.keycode"]="37";
+AjxKeys["toolbarHorizontal.Previous.sort"]="50020";
+AjxKeys["toolbarHorizontal.description"]="Toolbars";
+AjxKeys["toolbarHorizontal.sort"]="50000";
+AjxKeys["toolbarVertical.INHERIT"]="button";
+AjxKeys["toolbarVertical.Next.description"]="Next button";
+AjxKeys["toolbarVertical.Next.display"]="ArrowDown";
+AjxKeys["toolbarVertical.Next.keycode"]="40";
+AjxKeys["toolbarVertical.Next.sort"]="51010";
+AjxKeys["toolbarVertical.Previous.description"]="Previous button";
+AjxKeys["toolbarVertical.Previous.display"]="ArrowUp";
+AjxKeys["toolbarVertical.Previous.keycode"]="38";
+AjxKeys["toolbarVertical.Previous.sort"]="51020";
+AjxKeys["toolbarVertical.description"]="Vertical Toolbars";
+AjxKeys["toolbarVertical.sort"]="51000";
+AjxKeys["tree.Collapse.description"]="Collapse";
+AjxKeys["tree.Collapse.display"]="ArrowLeft";
+AjxKeys["tree.Collapse.keycode"]="37";
+AjxKeys["tree.Collapse.sort"]="30540";
+AjxKeys["tree.ContextMenu.description"]="Show right-click menu";
+AjxKeys["tree.ContextMenu.display"]=",; Ctrl+Enter";
+AjxKeys["tree.ContextMenu.display.mac"]=",; Ctrl+M";
+AjxKeys["tree.ContextMenu.keycode"]="188; Ctrl+13";
+AjxKeys["tree.ContextMenu.keycode.mac"]="188; Ctrl+77";
+AjxKeys["tree.ContextMenu.sort"]="30550";
+AjxKeys["tree.Expand.description"]="Expand";
+AjxKeys["tree.Expand.display"]="ArrowRight";
+AjxKeys["tree.Expand.keycode"]="39";
+AjxKeys["tree.Expand.sort"]="30530";
+AjxKeys["tree.Next.description"]="Next item";
+AjxKeys["tree.Next.display"]="ArrowDown";
+AjxKeys["tree.Next.keycode"]="40";
+AjxKeys["tree.Next.repeat"]="true";
+AjxKeys["tree.Next.sort"]="30510";
+AjxKeys["tree.Previous.description"]="Previous item";
+AjxKeys["tree.Previous.display"]="ArrowUp";
+AjxKeys["tree.Previous.keycode"]="38";
+AjxKeys["tree.Previous.repeat"]="true";
+AjxKeys["tree.Previous.sort"]="30520";
+AjxKeys["tree.description"]="Trees";
+AjxKeys["tree.sort"]="30500";
+if(!window.ZmKeys){ZmKeys={}
+}ZmKeys["calendar.CalListView.description"]="List view";
+ZmKeys["calendar.CalListView.display"]="L; 9";
+ZmKeys["calendar.CalListView.keycode"]="76; 57";
+ZmKeys["calendar.CalListView.sort"]="70082";
+ZmKeys["calendar.Cancel.description"]="Close";
+ZmKeys["calendar.Cancel.display"]="Esc";
+ZmKeys["calendar.Cancel.keycode"]="27";
+ZmKeys["calendar.Cancel.sort"]="70100";
+ZmKeys["calendar.DayView.description"]="Day view";
+ZmKeys["calendar.DayView.display"]="D; 1";
+ZmKeys["calendar.DayView.keycode"]="68; 49";
+ZmKeys["calendar.DayView.sort"]="70050";
+ZmKeys["calendar.Edit.description"]="Edit appointment";
+ZmKeys["calendar.Edit.display"]="E";
+ZmKeys["calendar.Edit.keycode"]="69";
+ZmKeys["calendar.Edit.sort"]="70010";
+ZmKeys["calendar.INHERIT"]="global";
+ZmKeys["calendar.MonthView.description"]="Month view";
+ZmKeys["calendar.MonthView.display"]="M; 3";
+ZmKeys["calendar.MonthView.keycode"]="77; 51";
+ZmKeys["calendar.MonthView.sort"]="70080";
+ZmKeys["calendar.QuickAdd.description"]="Quick appointment creation";
+ZmKeys["calendar.QuickAdd.display"]="Q";
+ZmKeys["calendar.QuickAdd.keycode"]="81";
+ZmKeys["calendar.QuickAdd.sort"]="70020";
+ZmKeys["calendar.Refresh.description"]="Refresh";
+ZmKeys["calendar.Refresh.display"]="R";
+ZmKeys["calendar.Refresh.keycode"]="82";
+ZmKeys["calendar.Refresh.sort"]="70030";
+ZmKeys["calendar.ScheduleView.description"]="Scheduling view";
+ZmKeys["calendar.ScheduleView.display"]="S; 0";
+ZmKeys["calendar.ScheduleView.keycode"]="83; 48";
+ZmKeys["calendar.ScheduleView.sort"]="70090";
+ZmKeys["calendar.Today.description"]="Go to today";
+ZmKeys["calendar.Today.display"]="Y";
+ZmKeys["calendar.Today.keycode"]="89";
+ZmKeys["calendar.Today.sort"]="70040";
+ZmKeys["calendar.WeekView.description"]="Week view";
+ZmKeys["calendar.WeekView.display"]="W; 7";
+ZmKeys["calendar.WeekView.keycode"]="87; 55";
+ZmKeys["calendar.WeekView.sort"]="70060";
+ZmKeys["calendar.WorkWeekView.description"]="Work week view";
+ZmKeys["calendar.WorkWeekView.display"]="W,W; 5";
+ZmKeys["calendar.WorkWeekView.keycode"]="87,87; 53";
+ZmKeys["calendar.WorkWeekView.sort"]="70070";
+ZmKeys["calendar.description"]="Calendar";
+ZmKeys["calendar.sort"]="70000";
+ZmKeys["call.CallManager.description"]="Call Manager";
+ZmKeys["call.CallManager.display"]="C";
+ZmKeys["call.CallManager.keycode"]="67";
+ZmKeys["call.CallManager.sort"]="46050";
+ZmKeys["call.INHERIT"]="global";
+ZmKeys["call.Print.description"]="Print";
+ZmKeys["call.Print.display"]="P";
+ZmKeys["call.Print.keycode"]="80";
+ZmKeys["call.Print.sort"]="46010";
+ZmKeys["call.description"]="Call List View";
+ZmKeys["call.sort"]="46000";
+ZmKeys["compose.AddressPicker.description"]="Search for addresses";
+ZmKeys["compose.AddressPicker.display"]="Ctrl+G";
+ZmKeys["compose.AddressPicker.keycode"]="Ctrl+71";
+ZmKeys["compose.AddressPicker.sort"]="30050";
+ZmKeys["compose.Attachment.description"]="Add attachment";
+ZmKeys["compose.Attachment.display"]="Ctrl+M";
+ZmKeys["compose.Attachment.keycode"]="Ctrl+77";
+ZmKeys["compose.Attachment.sort"]="30040";
+ZmKeys["compose.Cancel.description"]="Cancel";
+ZmKeys["compose.Cancel.display"]="Esc";
+ZmKeys["compose.Cancel.keycode"]="27";
+ZmKeys["compose.Cancel.sort"]="30020";
+ZmKeys["compose.HtmlFormat.description"]="HTML/text format";
+ZmKeys["compose.HtmlFormat.display"]="Ctrl+H";
+ZmKeys["compose.HtmlFormat.keycode"]="Ctrl+72";
+ZmKeys["compose.HtmlFormat.sort"]="30060";
+ZmKeys["compose.NewWindow.description"]="Detach into new window";
+ZmKeys["compose.NewWindow.display"]="Ctrl+D";
+ZmKeys["compose.NewWindow.keycode"]="Ctrl+68";
+ZmKeys["compose.NewWindow.sort"]="30080";
+ZmKeys["compose.Save.description"]="Save draft";
+ZmKeys["compose.Save.display"]="Ctrl+S";
+ZmKeys["compose.Save.keycode"]="Ctrl+83";
+ZmKeys["compose.Save.sort"]="30030";
+ZmKeys["compose.Send.description"]="Send";
+ZmKeys["compose.Send.display"]="Ctrl+Enter";
+ZmKeys["compose.Send.keycode"]="Ctrl+13";
+ZmKeys["compose.Send.sort"]="30010";
+ZmKeys["compose.Shortcuts.description"]="Show shortcuts";
+ZmKeys["compose.Shortcuts.display"]="Ctrl+Q";
+ZmKeys["compose.Shortcuts.keycode"]="Ctrl+81";
+ZmKeys["compose.Shortcuts.sort"]="10270";
+ZmKeys["compose.Spellcheck.description"]="Spellcheck";
+ZmKeys["compose.Spellcheck.display"]="Alt+X";
+ZmKeys["compose.Spellcheck.display.mac"]="Ctrl+X";
+ZmKeys["compose.Spellcheck.keycode"]="Alt+88";
+ZmKeys["compose.Spellcheck.keycode.mac"]="Ctrl+88";
+ZmKeys["compose.Spellcheck.sort"]="30070";
+ZmKeys["compose.description"]="Compose";
+ZmKeys["compose.sort"]="30000";
+ZmKeys["contacts.Edit.description"]="Edit";
+ZmKeys["contacts.Edit.display"]="E";
+ZmKeys["contacts.Edit.keycode"]="69";
+ZmKeys["contacts.Edit.sort"]="50010";
+ZmKeys["contacts.INHERIT"]="global";
+ZmKeys["contacts.PrintAll.description"]="Print address book";
+ZmKeys["contacts.PrintAll.display"]="P,A";
+ZmKeys["contacts.PrintAll.keycode"]="80,65";
+ZmKeys["contacts.PrintAll.sort"]="50020";
+ZmKeys["contacts.description"]="Address Book";
+ZmKeys["contacts.sort"]="50000";
+ZmKeys["conversation.INHERIT"]="mail";
+ZmKeys["conversation.NextConversation.description"]="Next conversation";
+ZmKeys["conversation.NextConversation.display"]="Shift+ArrowRight";
+ZmKeys["conversation.NextConversation.keycode"]="Shift+39";
+ZmKeys["conversation.NextConversation.sort"]="40010";
+ZmKeys["conversation.PreviousConversation.description"]="Previous conversation";
+ZmKeys["conversation.PreviousConversation.display"]="Shift+ArrowLeft";
+ZmKeys["conversation.PreviousConversation.keycode"]="Shift+37";
+ZmKeys["conversation.PreviousConversation.sort"]="40020";
+ZmKeys["conversation.description"]="Conversation View";
+ZmKeys["conversation.sort"]="40000";
+ZmKeys["conversationList.CollapseAll.description"]="Collapse all conversations";
+ZmKeys["conversationList.CollapseAll.display"]="Ctrl+O";
+ZmKeys["conversationList.CollapseAll.keycode"]="Ctrl+79";
+ZmKeys["conversationList.CollapseAll.sort"]="25030";
+ZmKeys["conversationList.Expand.description"]="Expand/collapse conversation";
+ZmKeys["conversationList.Expand.display"]="O";
+ZmKeys["conversationList.Expand.keycode"]="79";
+ZmKeys["conversationList.Expand.sort"]="25010";
+ZmKeys["conversationList.ExpandAll.description"]="Expand all conversations";
+ZmKeys["conversationList.ExpandAll.display"]="Shift+O";
+ZmKeys["conversationList.ExpandAll.keycode"]="Shift+79";
+ZmKeys["conversationList.ExpandAll.sort"]="25020";
+ZmKeys["conversationList.FirstUnreadMsg.description"]="Select first unread message";
+ZmKeys["conversationList.FirstUnreadMsg.display"]="Shift+Ctrl+[";
+ZmKeys["conversationList.FirstUnreadMsg.keycode"]="Shift+Ctrl+219";
+ZmKeys["conversationList.FirstUnreadMsg.sort"]="25060";
+ZmKeys["conversationList.INHERIT"]="mail";
+ZmKeys["conversationList.LastUnreadMsg.description"]="Select last unread message";
+ZmKeys["conversationList.LastUnreadMsg.display"]="Shift+Ctrl+]";
+ZmKeys["conversationList.LastUnreadMsg.keycode"]="Shift+Ctrl+221";
+ZmKeys["conversationList.LastUnreadMsg.sort"]="25070";
+ZmKeys["conversationList.NextUnreadMsg.description"]="Select next unread message";
+ZmKeys["conversationList.NextUnreadMsg.display"]="Ctrl+]";
+ZmKeys["conversationList.NextUnreadMsg.keycode"]="Ctrl+221";
+ZmKeys["conversationList.NextUnreadMsg.sort"]="25050";
+ZmKeys["conversationList.PreviousUnreadMsg.description"]="Select previous unread message";
+ZmKeys["conversationList.PreviousUnreadMsg.display"]="Ctrl+[";
+ZmKeys["conversationList.PreviousUnreadMsg.keycode"]="Ctrl+219";
+ZmKeys["conversationList.PreviousUnreadMsg.sort"]="25040";
+ZmKeys["conversationList.description"]="Conversation List View";
+ZmKeys["conversationList.sort"]="25000";
+ZmKeys["editAppointment.Cancel.description"]="Cancel";
+ZmKeys["editAppointment.Cancel.display"]="Esc";
+ZmKeys["editAppointment.Cancel.keycode"]="27";
+ZmKeys["editAppointment.Cancel.sort"]="80020";
+ZmKeys["editAppointment.HtmlFormat.description"]="HTML/text format";
+ZmKeys["editAppointment.HtmlFormat.display"]="Ctrl+H";
+ZmKeys["editAppointment.HtmlFormat.keycode"]="Ctrl+72";
+ZmKeys["editAppointment.HtmlFormat.sort"]="80040";
+ZmKeys["editAppointment.INHERIT"]="tabView";
+ZmKeys["editAppointment.Save.description"]="Save";
+ZmKeys["editAppointment.Save.display"]="Ctrl+S";
+ZmKeys["editAppointment.Save.keycode"]="Ctrl+83";
+ZmKeys["editAppointment.Save.sort"]="80010";
+ZmKeys["editAppointment.Shortcuts.description"]="Show shortcuts";
+ZmKeys["editAppointment.Shortcuts.display"]="Ctrl+Q";
+ZmKeys["editAppointment.Shortcuts.keycode"]="Ctrl+81";
+ZmKeys["editAppointment.Shortcuts.sort"]="10270";
+ZmKeys["editAppointment.description"]="Edit Appointment";
+ZmKeys["editAppointment.sort"]="80000";
+ZmKeys["editContact.Cancel.description"]="Cancel";
+ZmKeys["editContact.Cancel.display"]="Esc";
+ZmKeys["editContact.Cancel.keycode"]="27";
+ZmKeys["editContact.Cancel.sort"]="60020";
+ZmKeys["editContact.Save.description"]="Save";
+ZmKeys["editContact.Save.display"]="Ctrl+S";
+ZmKeys["editContact.Save.keycode"]="Ctrl+83";
+ZmKeys["editContact.Save.sort"]="60010";
+ZmKeys["editContact.description"]="Edit Contact";
+ZmKeys["editContact.sort"]="60000";
+ZmKeys["editPage.Cancel.description"]="Cancel";
+ZmKeys["editPage.Cancel.display"]="Esc";
+ZmKeys["editPage.Cancel.keycode"]="27";
+ZmKeys["editPage.Cancel.sort"]="100060";
+ZmKeys["editPage.Save.description"]="Save";
+ZmKeys["editPage.Save.display"]="Ctrl+S";
+ZmKeys["editPage.Save.keycode"]="Ctrl+83";
+ZmKeys["editPage.Save.sort"]="100070";
+ZmKeys["editPage.Shortcuts.description"]="Show shortcuts";
+ZmKeys["editPage.Shortcuts.display"]="Ctrl+Q";
+ZmKeys["editPage.Shortcuts.keycode"]="Ctrl+81";
+ZmKeys["editPage.Shortcuts.sort"]="10270";
+ZmKeys["editPage.description"]="Edit Notebook Page";
+ZmKeys["editPage.sort"]="100050";
+ZmKeys["editTask.Cancel.description"]="Cancel";
+ZmKeys["editTask.Cancel.display"]="Esc";
+ZmKeys["editTask.Cancel.keycode"]="27";
+ZmKeys["editTask.Cancel.sort"]="106020";
+ZmKeys["editTask.Save.description"]="Save";
+ZmKeys["editTask.Save.display"]="Ctrl+S";
+ZmKeys["editTask.Save.keycode"]="Ctrl+83";
+ZmKeys["editTask.Save.sort"]="106010";
+ZmKeys["editTask.description"]="Edit Task";
+ZmKeys["editTask.sort"]="106000";
+ZmKeys["global.Assistant.description"]="Zimbra Assistant";
+ZmKeys["global.Assistant.display"]="`";
+ZmKeys["global.Assistant.keycode"]="192";
+ZmKeys["global.Assistant.sort"]="10230";
+ZmKeys["global.Cancel.description"]="Close";
+ZmKeys["global.Cancel.display"]="Esc";
+ZmKeys["global.Cancel.keycode"]="27";
+ZmKeys["global.Cancel.sort"]="10220";
+ZmKeys["global.Delete.description"]="Delete item(s)";
+ZmKeys["global.Delete.display"]="Del; Backspace";
+ZmKeys["global.Delete.keycode"]="8; 46";
+ZmKeys["global.Delete.sort"]="10210";
+ZmKeys["global.FocusContentPane.description"]="Focus content pane";
+ZmKeys["global.FocusContentPane.display"]="Ctrl+/";
+ZmKeys["global.FocusContentPane.keycode"]="Ctrl+191";
+ZmKeys["global.FocusContentPane.sort"]="10280";
+ZmKeys["global.FocusSearchBox.description"]="Focus search box";
+ZmKeys["global.FocusSearchBox.display"]="/";
+ZmKeys["global.FocusSearchBox.keycode"]="191";
+ZmKeys["global.FocusSearchBox.sort"]="10270";
+ZmKeys["global.FocusToolbar.description"]="Focus toolbar";
+ZmKeys["global.FocusToolbar.display"]="Ctrl+Y";
+ZmKeys["global.FocusToolbar.keycode"]="Ctrl+89";
+ZmKeys["global.FocusToolbar.sort"]="10275";
+ZmKeys["global.FocusWebSearchBox.description"]="Focus web search box";
+ZmKeys["global.FocusWebSearchBox.display"]="Alt+/";
+ZmKeys["global.FocusWebSearchBox.keycode"]="Alt+191";
+ZmKeys["global.FocusWebSearchBox.sort"]="10277";
+ZmKeys["global.GoToBriefcase.description"]="Go to Briefcase";
+ZmKeys["global.GoToBriefcase.display"]="G,B";
+ZmKeys["global.GoToBriefcase.keycode"]="71,66";
+ZmKeys["global.GoToBriefcase.sort"]="10070";
+ZmKeys["global.GoToCalendar.description"]="Go to Calendar";
+ZmKeys["global.GoToCalendar.display"]="G,C";
+ZmKeys["global.GoToCalendar.keycode"]="71,67";
+ZmKeys["global.GoToCalendar.sort"]="10030";
+ZmKeys["global.GoToContacts.description"]="Go to Contacts";
+ZmKeys["global.GoToContacts.display"]="G,A";
+ZmKeys["global.GoToContacts.keycode"]="71,65";
+ZmKeys["global.GoToContacts.sort"]="10020";
+ZmKeys["global.GoToMail.description"]="Go to Mail";
+ZmKeys["global.GoToMail.display"]="G,M";
+ZmKeys["global.GoToMail.keycode"]="71,77";
+ZmKeys["global.GoToMail.sort"]="10010";
+ZmKeys["global.GoToNotebook.description"]="Go to Documents";
+ZmKeys["global.GoToNotebook.display"]="G,D";
+ZmKeys["global.GoToNotebook.keycode"]="71,68";
+ZmKeys["global.GoToNotebook.sort"]="10060";
+ZmKeys["global.GoToOptions.description"]="Go to Preferences";
+ZmKeys["global.GoToOptions.display"]="G,P";
+ZmKeys["global.GoToOptions.keycode"]="71,80";
+ZmKeys["global.GoToOptions.sort"]="10050";
+ZmKeys["global.GoToTasks.description"]="Go to Tasks";
+ZmKeys["global.GoToTasks.display"]="G,T";
+ZmKeys["global.GoToTasks.keycode"]="71,84";
+ZmKeys["global.GoToTasks.sort"]="10035";
+ZmKeys["global.GoToVoice.description"]="Go to Voice";
+ZmKeys["global.GoToVoice.display"]="G,V";
+ZmKeys["global.GoToVoice.keycode"]="71,86";
+ZmKeys["global.GoToVoice.sort"]="10015";
+ZmKeys["global.Move.description"]="Move item(s)";
+ZmKeys["global.Move.display"]="M; M,M";
+ZmKeys["global.Move.keycode"]="77; 77,77";
+ZmKeys["global.Move.sort"]="10235";
+ZmKeys["global.New.description"]="New item";
+ZmKeys["global.New.display"]="N";
+ZmKeys["global.New.keycode"]="78";
+ZmKeys["global.New.sort"]="10070";
+ZmKeys["global.NewAppointment.description"]="New appointment";
+ZmKeys["global.NewAppointment.display"]="N,A";
+ZmKeys["global.NewAppointment.keycode"]="78,65";
+ZmKeys["global.NewAppointment.sort"]="10110";
+ZmKeys["global.NewCalendar.description"]="New calendar";
+ZmKeys["global.NewCalendar.display"]="N,L";
+ZmKeys["global.NewCalendar.keycode"]="78,76";
+ZmKeys["global.NewCalendar.sort"]="10120";
+ZmKeys["global.NewChat.description"]="New chat";
+ZmKeys["global.NewChat.display"]="N,H";
+ZmKeys["global.NewChat.keycode"]="78,72";
+ZmKeys["global.NewChat.sort"]="10117";
+ZmKeys["global.NewContact.description"]="New contact";
+ZmKeys["global.NewContact.display"]="N,C";
+ZmKeys["global.NewContact.keycode"]="78,67";
+ZmKeys["global.NewContact.sort"]="10100";
+ZmKeys["global.NewDocument.description"]="New document";
+ZmKeys["global.NewDocument.display"]="N,D";
+ZmKeys["global.NewDocument.keycode"]="78,68";
+ZmKeys["global.NewDocument.sort"]="10135";
+ZmKeys["global.NewFolder.description"]="New folder";
+ZmKeys["global.NewFolder.display"]="N,F";
+ZmKeys["global.NewFolder.keycode"]="78,70";
+ZmKeys["global.NewFolder.sort"]="10150";
+ZmKeys["global.NewMessage.description"]="Compose";
+ZmKeys["global.NewMessage.display"]="N,M; C";
+ZmKeys["global.NewMessage.keycode"]="78,77; 67";
+ZmKeys["global.NewMessage.sort"]="10080";
+ZmKeys["global.NewMessageWindow.description"]="Compose in new window";
+ZmKeys["global.NewMessageWindow.display"]="Shift+C";
+ZmKeys["global.NewMessageWindow.keycode"]="Shift+67";
+ZmKeys["global.NewMessageWindow.sort"]="10090";
+ZmKeys["global.NewNotebook.description"]="New notebook";
+ZmKeys["global.NewNotebook.display"]="N,W";
+ZmKeys["global.NewNotebook.keycode"]="78,87";
+ZmKeys["global.NewNotebook.sort"]="10140";
+ZmKeys["global.NewPage.description"]="New notebook page";
+ZmKeys["global.NewPage.display"]="N,P";
+ZmKeys["global.NewPage.keycode"]="78,80";
+ZmKeys["global.NewPage.sort"]="10130";
+ZmKeys["global.NewRosterItem.description"]="New buddy";
+ZmKeys["global.NewRosterItem.display"]="N,B";
+ZmKeys["global.NewRosterItem.keycode"]="78,66";
+ZmKeys["global.NewRosterItem.sort"]="10125";
+ZmKeys["global.NewTag.description"]="New tag";
+ZmKeys["global.NewTag.display"]="N,T";
+ZmKeys["global.NewTag.keycode"]="78,84";
+ZmKeys["global.NewTag.sort"]="10160";
+ZmKeys["global.NewTask.description"]="New task";
+ZmKeys["global.NewTask.display"]="N,K";
+ZmKeys["global.NewTask.keycode"]="78,75";
+ZmKeys["global.NewTask.sort"]="10115";
+ZmKeys["global.NextPage.description"]="Next page";
+ZmKeys["global.NextPage.display"]="Ctrl+ArrowRight";
+ZmKeys["global.NextPage.keycode"]="Ctrl+39";
+ZmKeys["global.NextPage.sort"]="10170";
+ZmKeys["global.PreviousPage.description"]="Previous page";
+ZmKeys["global.PreviousPage.display"]="Ctrl+ArrowLeft";
+ZmKeys["global.PreviousPage.keycode"]="Ctrl+37";
+ZmKeys["global.PreviousPage.sort"]="10180";
+ZmKeys["global.Print.description"]="Print";
+ZmKeys["global.Print.display"]="P";
+ZmKeys["global.Print.keycode"]="80";
+ZmKeys["global.Print.sort"]="10190";
+ZmKeys["global.SavedSearch.description"]="Run a saved search";
+ZmKeys["global.SavedSearch.display"]="S";
+ZmKeys["global.SavedSearch.keycode"]="83";
+ZmKeys["global.SavedSearch.sort"]="10260";
+ZmKeys["global.SelectAll.description"]="Select all search results";
+ZmKeys["global.SelectAll.display"]="Ctrl+Shift+A";
+ZmKeys["global.SelectAll.keycode"]="Ctrl+Shift+65";
+ZmKeys["global.SelectAll.sort"]="10270";
+ZmKeys["global.Shortcuts.description"]="Show shortcuts";
+ZmKeys["global.Shortcuts.display"]="Ctrl+Q;Shift+/";
+ZmKeys["global.Shortcuts.keycode"]="Ctrl+81;Shift+191";
+ZmKeys["global.Shortcuts.sort"]="10270";
+ZmKeys["global.Tag.description"]="Tag item(s)";
+ZmKeys["global.Tag.display"]="T";
+ZmKeys["global.Tag.keycode"]="84";
+ZmKeys["global.Tag.sort"]="10250";
+ZmKeys["global.Untag.description"]="Remove tags";
+ZmKeys["global.Untag.display"]="U";
+ZmKeys["global.Untag.keycode"]="85";
+ZmKeys["global.Untag.sort"]="10255";
+ZmKeys["global.Visit.description"]="Go to (visit) folder";
+ZmKeys["global.Visit.display"]="V";
+ZmKeys["global.Visit.keycode"]="86";
+ZmKeys["global.Visit.sort"]="10233";
+ZmKeys["global.VisitTag.description"]="Go to (visit) tag";
+ZmKeys["global.VisitTag.display"]="V,V";
+ZmKeys["global.VisitTag.keycode"]="86,86";
+ZmKeys["global.VisitTag.sort"]="10234";
+ZmKeys["global.description"]="All Applications";
+ZmKeys["global.sort"]="10000";
+ZmKeys["mail.DoubleClick.description"]="Open message";
+ZmKeys["mail.DoubleClick.display"]="Enter";
+ZmKeys["mail.DoubleClick.keycode"]="13";
+ZmKeys["mail.DoubleClick.sort"]="20060";
+ZmKeys["mail.FirstUnread.description"]="First unread";
+ZmKeys["mail.FirstUnread.display"]="Shift+[";
+ZmKeys["mail.FirstUnread.keycode"]="Shift+219";
+ZmKeys["mail.FirstUnread.sort"]="20194";
+ZmKeys["mail.Flag.description"]="Flag/Unflag messages";
+ZmKeys["mail.Flag.display"]="M,F";
+ZmKeys["mail.Flag.keycode"]="77,70";
+ZmKeys["mail.Flag.sort"]="20090";
+ZmKeys["mail.Forward.description"]="Forward message";
+ZmKeys["mail.Forward.display"]="F";
+ZmKeys["mail.Forward.keycode"]="70";
+ZmKeys["mail.Forward.sort"]="20170";
+ZmKeys["mail.GetMail.description"]="Get Mail";
+ZmKeys["mail.GetMail.display"]="=";
+ZmKeys["mail.GetMail.keycode"]="61; 187";
+ZmKeys["mail.GetMail.sort"]="20005";
+ZmKeys["mail.GoToDrafts.description"]="Drafts";
+ZmKeys["mail.GoToDrafts.display"]="V,D";
+ZmKeys["mail.GoToDrafts.keycode"]="86,68";
+ZmKeys["mail.GoToDrafts.sort"]="20020";
+ZmKeys["mail.GoToInbox.description"]="Inbox";
+ZmKeys["mail.GoToInbox.display"]="I; V,I";
+ZmKeys["mail.GoToInbox.keycode"]="73; 86,73";
+ZmKeys["mail.GoToInbox.sort"]="20010";
+ZmKeys["mail.GoToJunk.description"]="Junk";
+ZmKeys["mail.GoToJunk.display"]="V,J";
+ZmKeys["mail.GoToJunk.keycode"]="86,74";
+ZmKeys["mail.GoToJunk.sort"]="20025";
+ZmKeys["mail.GoToSent.description"]="Sent";
+ZmKeys["mail.GoToSent.display"]="V,S";
+ZmKeys["mail.GoToSent.keycode"]="86,83";
+ZmKeys["mail.GoToSent.sort"]="20030";
+ZmKeys["mail.GoToTrash.description"]="Trash";
+ZmKeys["mail.GoToTrash.display"]="V,T";
+ZmKeys["mail.GoToTrash.keycode"]="86,84";
+ZmKeys["mail.GoToTrash.sort"]="20040";
+ZmKeys["mail.INHERIT"]="global";
+ZmKeys["mail.LastUnread.description"]="Last unread";
+ZmKeys["mail.LastUnread.display"]="Shift+]";
+ZmKeys["mail.LastUnread.keycode"]="Shift+221";
+ZmKeys["mail.LastUnread.sort"]="20192";
+ZmKeys["mail.MarkRead.description"]="Mark read";
+ZmKeys["mail.MarkRead.display"]="M,R; Z";
+ZmKeys["mail.MarkRead.keycode"]="77,82; 90";
+ZmKeys["mail.MarkRead.sort"]="20070";
+ZmKeys["mail.MarkUnread.description"]="Mark unread";
+ZmKeys["mail.MarkUnread.display"]="M,U; X";
+ZmKeys["mail.MarkUnread.keycode"]="77,85; 88";
+ZmKeys["mail.MarkUnread.sort"]="20080";
+ZmKeys["mail.MoveToInbox.description"]="Move to Inbox";
+ZmKeys["mail.MoveToInbox.display"]=".,I";
+ZmKeys["mail.MoveToInbox.keycode"]="190,73";
+ZmKeys["mail.MoveToInbox.sort"]="20130";
+ZmKeys["mail.MoveToTrash.description"]="Move to Trash";
+ZmKeys["mail.MoveToTrash.display"]=".,T";
+ZmKeys["mail.MoveToTrash.keycode"]="190,84";
+ZmKeys["mail.MoveToTrash.sort"]="20110";
+ZmKeys["mail.NextUnread.description"]="Next unread";
+ZmKeys["mail.NextUnread.display"]="]";
+ZmKeys["mail.NextUnread.keycode"]="221";
+ZmKeys["mail.NextUnread.sort"]="20190";
+ZmKeys["mail.PreviousUnread.description"]="Previous unread";
+ZmKeys["mail.PreviousUnread.display"]="[";
+ZmKeys["mail.PreviousUnread.keycode"]="219";
+ZmKeys["mail.PreviousUnread.sort"]="20180";
+ZmKeys["mail.ReadingPaneAtBottom.description"]="Reading pane at bottom";
+ZmKeys["mail.ReadingPaneAtBottom.display"]="M,P,B";
+ZmKeys["mail.ReadingPaneAtBottom.keycode"]="77,80,66";
+ZmKeys["mail.ReadingPaneAtBottom.sort"]="20220";
+ZmKeys["mail.ReadingPaneOff.description"]="Turn off reading pane";
+ZmKeys["mail.ReadingPaneOff.display"]="M,P,O";
+ZmKeys["mail.ReadingPaneOff.keycode"]="77,80,79";
+ZmKeys["mail.ReadingPaneOff.sort"]="20226";
+ZmKeys["mail.ReadingPaneOnRight.description"]="Reading pane on right";
+ZmKeys["mail.ReadingPaneOnRight.display"]="M,P,R";
+ZmKeys["mail.ReadingPaneOnRight.keycode"]="77,80,82";
+ZmKeys["mail.ReadingPaneOnRight.sort"]="20223";
+ZmKeys["mail.Reply.description"]="Reply";
+ZmKeys["mail.Reply.display"]="R";
+ZmKeys["mail.Reply.keycode"]="82";
+ZmKeys["mail.Reply.sort"]="20150";
+ZmKeys["mail.ReplyAll.description"]="Reply all";
+ZmKeys["mail.ReplyAll.display"]="A";
+ZmKeys["mail.ReplyAll.keycode"]="65";
+ZmKeys["mail.ReplyAll.sort"]="20160";
+ZmKeys["mail.SelectNext.description"]="Select next item";
+ZmKeys["mail.SelectNext.display"]="Space; J";
+ZmKeys["mail.SelectNext.keycode"]="32; 74";
+ZmKeys["mail.SelectNext.repeat"]="true";
+ZmKeys["mail.SelectNext.sort"]="20172";
+ZmKeys["mail.SelectPrevious.description"]="Select previous item";
+ZmKeys["mail.SelectPrevious.display"]="K";
+ZmKeys["mail.SelectPrevious.keycode"]="75";
+ZmKeys["mail.SelectPrevious.repeat"]="true";
+ZmKeys["mail.SelectPrevious.sort"]="20174";
+ZmKeys["mail.ShowFragment.description"]="Show snippet";
+ZmKeys["mail.ShowFragment.display"]="Q";
+ZmKeys["mail.ShowFragment.keycode"]="81";
+ZmKeys["mail.ShowFragment.sort"]="20230";
+ZmKeys["mail.Spam.description"]="Mark as spam";
+ZmKeys["mail.Spam.display"]="M,J";
+ZmKeys["mail.Spam.keycode"]="77,74";
+ZmKeys["mail.Spam.sort"]="20100";
+ZmKeys["mail.ViewByConversation.description"]="Conversation view";
+ZmKeys["mail.ViewByConversation.display"]="V,C";
+ZmKeys["mail.ViewByConversation.keycode"]="86,67";
+ZmKeys["mail.ViewByConversation.sort"]="20200";
+ZmKeys["mail.ViewByMessage.description"]="Message view";
+ZmKeys["mail.ViewByMessage.display"]="V,M";
+ZmKeys["mail.ViewByMessage.keycode"]="86,77";
+ZmKeys["mail.ViewByMessage.sort"]="20210";
+ZmKeys["mail.description"]="Mail";
+ZmKeys["mail.sort"]="20000";
+ZmKeys["message.INHERIT"]="mail";
+ZmKeys["mixed.DoubleClick.display"]="O";
+ZmKeys["mixed.DoubleClick.keycode"]="79";
+ZmKeys["mixed.INHERIT"]="global";
+ZmKeys["notebook.Edit.description"]="Edit";
+ZmKeys["notebook.Edit.display"]="E";
+ZmKeys["notebook.Edit.keycode"]="69";
+ZmKeys["notebook.Edit.sort"]="100010";
+ZmKeys["notebook.INHERIT"]="global";
+ZmKeys["notebook.Refresh.description"]="Refresh";
+ZmKeys["notebook.Refresh.display"]="R";
+ZmKeys["notebook.Refresh.keycode"]="82";
+ZmKeys["notebook.Refresh.sort"]="100020";
+ZmKeys["notebook.description"]="Documents";
+ZmKeys["notebook.sort"]="100000";
+ZmKeys["options.INHERIT"]="global,tabView";
+ZmKeys["options.Save.description"]="Save";
+ZmKeys["options.Save.display"]="Ctrl+S";
+ZmKeys["options.Save.keycode"]="Ctrl+83";
+ZmKeys["options.Save.sort"]="90010";
+ZmKeys["options.description"]="Preferences";
+ZmKeys["options.sort"]="90000";
+ZmKeys["tasks.INHERIT"]="global";
+ZmKeys["tasks.MarkComplete.description"]="Mark completed";
+ZmKeys["tasks.MarkComplete.display"]="M,C";
+ZmKeys["tasks.MarkComplete.keycode"]="77,67";
+ZmKeys["tasks.MarkComplete.sort"]="105010";
+ZmKeys["tasks.MarkUncomplete.description"]="Mark not completed";
+ZmKeys["tasks.MarkUncomplete.display"]="M,U";
+ZmKeys["tasks.MarkUncomplete.keycode"]="77,85";
+ZmKeys["tasks.MarkUncomplete.sort"]="105020";
+ZmKeys["tasks.description"]="Tasks";
+ZmKeys["tasks.sort"]="105000";
+ZmKeys["voicemail.CallManager.description"]="Call Manager";
+ZmKeys["voicemail.CallManager.display"]="C";
+ZmKeys["voicemail.CallManager.keycode"]="67";
+ZmKeys["voicemail.CallManager.sort"]="45050";
+ZmKeys["voicemail.Download.description"]="Download message";
+ZmKeys["voicemail.Download.display"]="S";
+ZmKeys["voicemail.Download.keycode"]="83";
+ZmKeys["voicemail.Download.sort"]="45045";
+ZmKeys["voicemail.Forward.description"]="Forward as email";
+ZmKeys["voicemail.Forward.display"]="F";
+ZmKeys["voicemail.Forward.keycode"]="70";
+ZmKeys["voicemail.Forward.sort"]="45030";
+ZmKeys["voicemail.INHERIT"]="global";
+ZmKeys["voicemail.MarkHeard.description"]="Mark heard";
+ZmKeys["voicemail.MarkHeard.display"]="M,H";
+ZmKeys["voicemail.MarkHeard.keycode"]="77,72";
+ZmKeys["voicemail.MarkHeard.sort"]="45060";
+ZmKeys["voicemail.MarkUnheard.description"]="Mark unheard";
+ZmKeys["voicemail.MarkUnheard.display"]="M,U";
+ZmKeys["voicemail.MarkUnheard.keycode"]="77,85";
+ZmKeys["voicemail.MarkUnheard.sort"]="45070";
+ZmKeys["voicemail.Play.description"]="Play";
+ZmKeys["voicemail.Play.display"]="Enter";
+ZmKeys["voicemail.Play.keycode"]="13";
+ZmKeys["voicemail.Play.sort"]="45005";
+ZmKeys["voicemail.Print.description"]="Print";
+ZmKeys["voicemail.Print.display"]="P";
+ZmKeys["voicemail.Print.keycode"]="80";
+ZmKeys["voicemail.Print.sort"]="45010";
+ZmKeys["voicemail.Reply.description"]="Reply by email";
+ZmKeys["voicemail.Reply.display"]="R";
+ZmKeys["voicemail.Reply.keycode"]="82";
+ZmKeys["voicemail.Reply.sort"]="45020";
+ZmKeys["voicemail.description"]="Voice Mail View";
+ZmKeys["voicemail.sort"]="45000";
+
+
+
+if (!window.AjxImgData) AjxImgData = {};
+AjxImgData["ImgCalendarFolderOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgCalendarFolderOverlay.png"};
+AjxImgData["ImgContactsFolderOverlay"]={t:0,l:0,w:14,h:16,f:"@AppContextPath@/img/overlays/ImgContactsFolderOverlay.png"};
+AjxImgData["ImgEmailedContactsOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgEmailedContactsOverlay.png"};
+AjxImgData["ImgFolderOverlay"]={t:0,l:0,w:16,h:14,f:"@AppContextPath@/img/overlays/ImgFolderOverlay.png"};
+AjxImgData["ImgInboxOverlay"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/overlays/ImgInboxOverlay.png"};
+AjxImgData["ImgMailFolderOverlay"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/overlays/ImgMailFolderOverlay.png"};
+AjxImgData["ImgNotebookOverlay"]={t:0,l:0,w:16,h:15,f:"@AppContextPath@/img/overlays/ImgNotebookOverlay.png"};
+AjxImgData["ImgRSSOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgRSSOverlay.png"};
+AjxImgData["ImgSectionOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgSectionOverlay.png"};
+AjxImgData["ImgSentFolderOverlay"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/overlays/ImgSentFolderOverlay.png"};
+AjxImgData["ImgSharedCalendarFolderOverlay"]={t:0,l:0,w:16,h:15,f:"@AppContextPath@/img/overlays/ImgSharedCalendarFolderOverlay.png"};
+AjxImgData["ImgSharedContactsFolderOverlay"]={t:0,l:0,w:16,h:17,f:"@AppContextPath@/img/overlays/ImgSharedContactsFolderOverlay.png"};
+AjxImgData["ImgSharedMailFolderOverlay"]={t:0,l:0,w:16,h:17,f:"@AppContextPath@/img/overlays/ImgSharedMailFolderOverlay.png"};
+AjxImgData["ImgSharedNotebookOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgSharedNotebookOverlay.png"};
+AjxImgData["ImgSharedSectionOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgSharedSectionOverlay.png"};
+AjxImgData["ImgSharedTaskListOverlay"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/overlays/ImgSharedTaskListOverlay.png"};
+AjxImgData["ImgTagOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgTagOverlay.png"};
+AjxImgData["ImgTaskListOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgTaskListOverlay.png"};
+AjxImgData["ImgNotebookMask"]={t:-80,l:0,w:16,h:16,f:"@AppContextPath@/img/notes.gif"};
+AjxImgData["ImgSectionMask"]={t:-128,l:0,w:16,h:16,f:"@AppContextPath@/img/notes.gif"};
+AjxImgData["ImgSharedNotebookMask"]={t:-160,l:0,w:16,h:16,f:"@AppContextPath@/img/notes.gif"};
+AjxImgData["ImgSharedSectionMask"]={t:-208,l:0,w:16,h:16,f:"@AppContextPath@/img/notes.gif"};
+AjxImgData["ImgMailFolderMask"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/mail.gif"};
+AjxImgData["ImgRSSMask"]={t:-322,l:0,w:16,h:16,f:"@AppContextPath@/img/mail.gif"};
+AjxImgData["ImgSharedTaskListMask"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/tasks.gif"};
+AjxImgData["ImgTaskListMask"]={t:-114,l:0,w:16,h:16,f:"@AppContextPath@/img/tasks.gif"};
+AjxImgData["ImgCalendarFolderMask"]={t:-96,l:0,w:16,h:16,f:"@AppContextPath@/img/calendar.gif"};
+AjxImgData["ImgSharedCalendarFolderMask"]={t:-413,l:0,w:15,h:15,f:"@AppContextPath@/img/calendar.gif"};
+AjxImgData["ImgSharedContactsFolderMask"]={t:0,l:0,w:16,h:17,f:"@AppContextPath@/img/contacts.gif"};
+AjxImgData["ImgContactsFolderMask"]={t:-65,l:0,w:14,h:16,f:"@AppContextPath@/img/contacts.gif"};
+AjxImgData["ImgEmailedContactsMask"]={t:-113,l:0,w:16,h:16,f:"@AppContextPath@/img/contacts.gif"};
+AjxImgData["ImgInboxMask"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/startup.gif"};
+AjxImgData["ImgSentFolderMask"]={t:-18,l:0,w:16,h:18,f:"@AppContextPath@/img/startup.gif"};
+AjxImgData["ImgSharedMailFolderMask"]={t:-36,l:0,w:16,h:17,f:"@AppContextPath@/img/startup.gif"};
+AjxImgData["ImgTagMask"]={t:-1493,l:0,w:16,h:16,f:"@AppContextPath@/img/startup.gif"};
+AjxImgData["ImgFolderMask"]={t:-1701,l:0,w:16,h:14,f:"@AppContextPath@/img/startup.gif"};
+
+if (!window.AjxImgData) AjxImgData = {};
+
+document.write("<DIV style='display:none'>");
+for (var id in AjxImgData) {
+ var data = AjxImgData[id];
+ if (data.f) data.f = data.f.replace(/@AppContextPath@/,appContextPath);
+ document.write("<IMG id='",id,"' src='",data.d||data.f,"'>");
+}
+document.write("</DIV>");
+
+
+
+ function showCompanyUrl() {
+ window.open(ZmMsg.splashScreenCompanyURL, '_blank');
+ }
+
+
+
+
+document.write(ZmMsg.splashScreenAppName)
+
+
+
+document.write(ZmMsg.splashScreenLoading)
+
+
+
+document.write(ZmMsg.splashScreenSwitch)
+
+
+
+document.write(ZmMsg.splashScreenCopyright)
+
+
+
+ AjxEnv=function(){};
+AjxEnv._inited=false;
+AjxEnv.DEFAULT_LOCALE=window.navigator.userLanguage||window.navigator.language||window.navigator.systemLanguage;
+AjxEnv.reset=function(){
+AjxEnv.geckoDate=0;
+AjxEnv.mozVersion=-1;
+AjxEnv.webKitVersion=-1;
+AjxEnv.isMac=false;
+AjxEnv.isWindows=false;
+AjxEnv.isLinux=false;
+AjxEnv.isNav=false;
+AjxEnv.isIE=false;
+AjxEnv.isNav4=false;
+AjxEnv.trueNs=true;
+AjxEnv.isNav6=false;
+AjxEnv.isNav6up=false;
+AjxEnv.isNav7=false;
+AjxEnv.isIE3=false;
+AjxEnv.isIE4=false;
+AjxEnv.isIE4up=false;
+AjxEnv.isIE5=false;
+AjxEnv.isIE5_5=false;
+AjxEnv.isIE5up=false;
+AjxEnv.isIE5_5up=false;
+AjxEnv.isIE6=false;
+AjxEnv.isIE6up=false;
+AjxEnv.isIE7=false;
+AjxEnv.isIE7up=false;
+AjxEnv.isIE8=false;
+AjxEnv.isIE8up=false;
+AjxEnv.isNormalResolution=false;
+AjxEnv.ieScaleFactor=1;
+AjxEnv.isFirefox=false;
+AjxEnv.isFirefox1up=false;
+AjxEnv.isFirefox1_5up=false;
+AjxEnv.isFirefox3up=false;
+AjxEnv.isMozilla=false;
+AjxEnv.isMozilla1_4up=false;
+AjxEnv.isSafari=false;
+AjxEnv.isSafari2=false;
+AjxEnv.isSafari3=false;
+AjxEnv.isSafari4=false;
+AjxEnv.isSafari3up=false;
+AjxEnv.isCamino=false;
+AjxEnv.isChrome=false;
+AjxEnv.isGeckoBased=false;
+AjxEnv.isWebKitBased=false;
+AjxEnv.isOpera=false;
+AjxEnv.useTransparentPNGs=false;
+AjxEnv.is800x600orLower=screen&&(screen.width<=800&&screen.height<=600);
+AjxEnv.is1024x768orLower=screen&&(screen.width<=1024&&screen.height<=768)
+};
+AjxEnv.parseUA=function(){
+AjxEnv.reset();
+var n=navigator.userAgent.toLowerCase();
+var t=n.split(" ");
+var c=false;
+var o=false;
+var r=false;
+var e=false;
+var a=false;
+if(t!=null){
+var u;
+var l=-1;
+if((l=t[0].search(/^\s*mozilla\//))!=-1){
+e=true;
+AjxEnv.browserVersion=parseFloat(t[0].substring(l+8));
+AjxEnv.isNav=true
+}
+var s;
+for(var h=0;
+h<t.length;
+++h){
+s=t[h];
+if(s.indexOf("compatible")!=-1){
+a=true;
+AjxEnv.isNav=false
+}else{
+if((s.indexOf("opera"))!=-1){
+AjxEnv.isOpera=true;
+AjxEnv.isNav=false;
+u=parseFloat(t[h+1])
+}else{
+if((s.indexOf("spoofer"))!=-1){
+c=true;
+AjxEnv.isNav=false
+}else{
+if((s.indexOf("webtv"))!=-1){
+o=true;
+AjxEnv.isNav=false
+}else{
+if((s.indexOf("hotjava"))!=-1){
+r=true;
+AjxEnv.isNav=false
+}else{
+if((l=s.indexOf("msie"))!=-1){
+AjxEnv.isIE=true;
+u=parseFloat(t[h+1])
+}else{
+if((l=s.indexOf("gecko/"))!=-1){
+AjxEnv.isGeckoBased=true;
+AjxEnv.geckoDate=parseFloat(s.substr(l+6))
+}else{
+if((l=s.indexOf("applewebkit/"))!=-1){
+AjxEnv.isWebKitBased=true;
+AjxEnv.webKitVersion=parseFloat(s.substr(l+12))
+}else{
+if((l=s.indexOf("rv:"))!=-1){
+AjxEnv.mozVersion=parseFloat(s.substr(l+3));
+u=AjxEnv.mozVersion
+}else{
+if((l=s.indexOf("firefox/"))!=-1){
+AjxEnv.isFirefox=true;
+u=parseFloat(s.substr(l+8))
+}else{
+if((l=s.indexOf("prism"))!=-1){
+AjxEnv.isPrism=true
+}else{
+if((l=s.indexOf("camino/"))!=-1){
+AjxEnv.isCamino=true;
+u=parseFloat(s.substr(l+7))
+}else{
+if((l=s.indexOf("netscape6/"))!=-1){
+AjxEnv.trueNs=true;
+u=parseFloat(s.substr(l+10))
+}else{
+if((l=s.indexOf("netscape/"))!=-1){
+AjxEnv.trueNs=true;
+u=parseFloat(s.substr(l+9))
+}else{
+if((l=s.indexOf("safari/"))!=-1){
+AjxEnv.isSafari=true
+}else{
+if((l=s.indexOf("chrome/"))!=-1){
+AjxEnv.isChrome=true;
+u=parseFloat(s.substr(l+7))
+}else{
+if(l=s.indexOf("version/")!=-1){
+u=parseFloat(s.substr(l+7))
+}else{
+if(s.indexOf("windows")!=-1){
+AjxEnv.isWindows=true
+}else{
+if((s.indexOf("macintosh")!=-1)||(s.indexOf("mac_")!=-1)){
+AjxEnv.isMac=true
+}else{
+if(s.indexOf("linux")!=-1){
+AjxEnv.isLinux=true
+}}}}}}}}}}}}}}}}}}}}}
+AjxEnv.isNav=(e&&!c&&!a&&!AjxEnv.isOpera&&!o&&!r&&!AjxEnv.isSafari);
+AjxEnv.isIE=(AjxEnv.isIE&&!AjxEnv.isOpera);
+AjxEnv.isNav4=(AjxEnv.isNav&&(u==4)&&(!AjxEnv.isIE));
+AjxEnv.isNav6=(AjxEnv.isNav&&AjxEnv.trueNs&&(u>=6&&u<7));
+AjxEnv.isNav6up=(AjxEnv.isNav&&AjxEnv.trueNs&&(u>=6));
+AjxEnv.isNav7=(AjxEnv.isNav&&AjxEnv.trueNs&&(u>=7&&u<8));
+AjxEnv.isIE3=(AjxEnv.isIE&&u<4);
+AjxEnv.isIE4=(AjxEnv.isIE&&u>=4&&u<5);
+AjxEnv.isIE4up=(AjxEnv.isIE&&u>=4);
+AjxEnv.isIE5=(AjxEnv.isIE&&u>=5&&u<6);
+AjxEnv.isIE5_5=(AjxEnv.isIE&&u==5.5);
+AjxEnv.isIE5up=(AjxEnv.isIE&&u>=5);
+AjxEnv.isIE5_5up=(AjxEnv.isIE&&u>=5.5);
+AjxEnv.isIE6=(AjxEnv.isIE&&u>=6&&u<7);
+AjxEnv.isIE6up=(AjxEnv.isIE&&u>=6);
+AjxEnv.isIE7=(AjxEnv.isIE&&u>=7&&u<8);
+AjxEnv.isIE7up=(AjxEnv.isIE&&u>=7);
+AjxEnv.isIE8=(AjxEnv.isIE&&u>=8&&u<9);
+AjxEnv.isIE8up=(AjxEnv.isIE&&u>=8);
+AjxEnv.isMozilla=((AjxEnv.isNav&&AjxEnv.mozVersion&&AjxEnv.isGeckoBased&&(AjxEnv.geckoDate!=0)));
+AjxEnv.isMozilla1_4up=(AjxEnv.isMozilla&&(AjxEnv.mozVersion>=1.4));
+AjxEnv.isFirefox=((AjxEnv.isMozilla&&AjxEnv.isFirefox));
+AjxEnv.isFirefox1up=(AjxEnv.isFirefox&&u>=1);
+AjxEnv.isFirefox1_5up=(AjxEnv.isFirefox&&u>=1.5);
+AjxEnv.isFirefox2_0up=(AjxEnv.isFirefox&&u>=2);
+AjxEnv.isFirefox3up=(AjxEnv.isFirefox&&u>=3);
+AjxEnv.isSafari2=(AjxEnv.isSafari&&u>=2&&u<3);
+AjxEnv.isSafari3=(AjxEnv.isSafari&&u>=3&&u<4)||AjxEnv.isChrome;
+AjxEnv.isSafari4=(AjxEnv.isSafari&&u>=4);
+AjxEnv.isSafari3up=(AjxEnv.isSafari&&u>=3)||AjxEnv.isChrome;
+AjxEnv.browser="[unknown]";
+if(AjxEnv.isOpera){
+AjxEnv.browser="OPERA"
+}else{
+if(AjxEnv.isSafari3up){
+AjxEnv.browser="SAF3"
+}else{
+if(AjxEnv.isSafari){
+AjxEnv.browser="SAF"
+}else{
+if(AjxEnv.isCamino){
+AjxEnv.browser="CAM"
+}else{
+if(o){
+AjxEnv.browser="WEBTV"
+}else{
+if(r){
+AjxEnv.browser="HOTJAVA"
+}else{
+if(AjxEnv.isFirefox3up){
+AjxEnv.browser="FF3.0"
+}else{
+if(AjxEnv.isFirefox2_0up){
+AjxEnv.browser="FF2.0"
+}else{
+if(AjxEnv.isFirefox1_5up){
+AjxEnv.browser="FF1.5"
+}else{
+if(AjxEnv.isFirefox1up){
+AjxEnv.browser="FF1.0"
+}else{
+if(AjxEnv.isFirefox){
+AjxEnv.browser="FF"
+}else{
+if(AjxEnv.isPrism){
+AjxEnv.browser="PRISM"
+}else{
+if(AjxEnv.isNav7){
+AjxEnv.browser="NAV7"
+}else{
+if(AjxEnv.isNav6){
+AjxEnv.browser="NAV6"
+}else{
+if(AjxEnv.isNav4){
+AjxEnv.browser="NAV4"
+}else{
+if(AjxEnv.isIE8){
+AjxEnv.browser="IE8"
+}else{
+if(AjxEnv.isIE7){
+AjxEnv.browser="IE7"
+}else{
+if(AjxEnv.isIE6){
+AjxEnv.browser="IE6"
+}else{
+if(AjxEnv.isIE5){
+AjxEnv.browser="IE5"
+}else{
+if(AjxEnv.isIE4){
+AjxEnv.browser="IE4"
+}else{
+if(AjxEnv.isIE3){
+AjxEnv.browser="IE"
+}}}}}}}}}}}}}}}}}}}}}
+AjxEnv.platform="[unknown]";
+if(AjxEnv.isWindows){
+AjxEnv.platform="Win"
+}else{
+if(AjxEnv.isMac){
+AjxEnv.platform="Mac"
+}else{
+if(AjxEnv.isLinux){
+AjxEnv.platform="Linux"
+}}}}
+if(AjxEnv.isIE){
+AjxEnv.isNormalResolution=true;
+AjxEnv.ieScaleFactor=screen.deviceXDPI/screen.logicalXDPI;
+if(AjxEnv.ieScaleFactor>1){
+AjxEnv.isNormalResolution=false
+}}
+AjxEnv.useTransparentPNGs=!AjxEnv.isIE&&!AjxEnv.isLinux&&!AjxEnv.isSafari;
+AjxEnv._inited=!AjxEnv.isIE;
+if(AjxEnv.isSafari){
+var d=AjxEnv.getWebkitVersion();
+AjxEnv.isSafariNightly=(d&&d.is_nightly);
+AjxEnv.isSafari2=!AjxEnv.isSafari3&&!AjxEnv.isSafariNightly
+}};
+AjxEnv.getWebkitVersion=function(){
+var t;
+var o=new RegExp("\\(.*\\) AppleWebKit/(.*) \\((.*)");
+var s=o.exec(navigator.userAgent);
+if(s){
+var e=s[1];
+var n=e.split(".");
+var a=(e[e.length-1]=="+");
+var i=a?"+":parseInt(n[1]);
+if(isNaN(i)){
+i=""
+}
+t={
+major:parseInt(n[0]),minor:i,is_nightly:a}
+}
+return{
+major:t.major,minor:t.minor,is_nightly:t.is_nightly}
+};
+AjxEnv.parseUA();
+AjxCallback=function(a,t,e){
+if(arguments.length==0){
+return
+}
+if(typeof arguments[0]=="function"){
+this.obj=null;
+this.func=arguments[0];
+this.args=arguments[1]
+}else{
+this.obj=a;
+this.func=t;
+this.args=e
+}};
+AjxCallback.prototype.toString=function(){
+return"AjxCallback"
+};
+AjxCallback.NOP=new AjxCallback(function(){}
+);
+AjxCallback.prototype.run=function(){
+var e=[];
+if(typeof this.args!="undefined"){
+if(this.args instanceof Array){
+e=arguments.length>0?e.concat(this.args):this.args
+}else{
+e.push(this.args)
+}}
+for(var t=0;
+t<arguments.length;
+++t){
+e.push(arguments[t])
+}
+if(this.func){
+return this.func.apply(this.obj||window,e)
+}};
+AjxCallback.prototype.run1=function(t){
+var e=[];
+if(typeof this.args!="undefined"){
+if(this.args instanceof Array){
+e=arguments.length>0?e.concat(this.args):this.args
+}else{
+e.push(this.args)
+}}
+if(t&&t.length){
+for(var a=0;
+a<t.length;
+++a){
+e.push(t[a])
+}}
+if(this.func){
+return this.func.apply(this.obj||window,e)
+}};
+AjxCallback.simpleClosure=function(a,o){
+var e=[];
+for(var t=2;
+t<arguments.length;
+++t){
+e.push(arguments[t])
+}
+return function(){
+var s=[];
+for(var n=0;
+n<arguments.length;
+++n){
+s.push(arguments[n])
+}
+return a.apply(o||this,e.concat(s))
+}
+};
+AjxCallback.returnFalse=function(){
+return false
+};
+AjxCallback.isNull=function(e){
+return e==null
+};
+AjxLoader=function(){};
+AjxLoader.__createXHR;
+if(window.XMLHttpRequest){
+AjxLoader.__createXHR=function(){
+return new XMLHttpRequest()
+}
+}else{
+if(window.ActiveXObject){
+(function(){
+var t=["MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];
+for(var a=0;
+a<t.length;
+a++){
+try{
+new ActiveXObject(t[a]);
+AjxLoader.__createXHR=function(){
+return new ActiveXObject(t[a])
+};
+break
+}
+catch(o){}}}
+)()
+}}
+AjxLoader.load=function(a){
+var n=a;
+if(typeof a=="string"){
+n={
+url:a}
+}
+var o=AjxLoader.__createXHR();
+var i=Boolean(n.callback)?function(){
+AjxLoader._response(o,n.callback)
+}
+:null;
+var s=n.method||(n.content!=null?"POST":"GET");
+if(i){
+o.onreadystatechange=i
+}
+var t=n.async!=null?n.async:Boolean(i);
+o.open(s,n.url,t,n.userName,n.password);
+for(var e in n.headers){
+o.setRequestHeader(e,n.headers[e])
+}
+o.send(n.content||"");
+return o
+};
+AjxLoader._response=function(e,t){
+if(e.readyState==4){
+t.run(e)
+}};
+AjxPackage=function(){};
+AjxPackage.METHOD_XHR_SYNC="xhr-sync";
+AjxPackage.METHOD_XHR_ASYNC="xhr-async";
+AjxPackage.METHOD_SCRIPT_TAG="script-tag";
+AjxPackage.DEFAULT_SYNC=AjxPackage.METHOD_XHR_SYNC;
+AjxPackage.DEFAULT_ASYNC=AjxEnv.isIE?AjxPackage.METHOD_XHR_ASYNC:AjxPackage.METHOD_SCRIPT_TAG;
+AjxPackage._packages={};
+AjxPackage._extension=".js";
+AjxPackage.__depth=0;
+AjxPackage.__scripts=[];
+AjxPackage.__data={};
+AjxPackage.setBasePath=function(e){
+AjxPackage._basePath=e
+};
+AjxPackage.setExtension=function(e){
+AjxPackage._extension=e
+};
+AjxPackage.setQueryString=function(e){
+AjxPackage._queryString=e
+};
+AjxPackage.isDefined=function(e){
+return Boolean(AjxPackage._packages[e])
+};
+AjxPackage.define=function(e){
+AjxPackage.__log("DEFINE "+e,"font-weight:bold;font-style:italic");
+e=AjxPackage.__package2path(e);
+if(!AjxPackage._packages[e]){
+AjxPackage._packages[e]=true;
+return true
+}
+return false
+};
+AjxPackage.undefine=function(e){
+AjxPackage.__log("UNDEFINE "+e,"font-weight:bold;font-style:italic");
+e=AjxPackage.__package2path(e);
+if(AjxPackage._packages[e]){
+delete AjxPackage._packages[e]
+}};
+AjxPackage.require=function(a){
+var b=a;
+if(typeof a=="string"){
+b={
+name:a}
+}
+var s=b.name;
+if(s instanceof Array){
+if(!s.internal){
+s=[].concat(s);
+s.internal=true;
+b.name=s
+}
+var x=s.shift();
+if(s.length>0){
+var o=new Function();
+o.prototype=b;
+o.prototype.constructor=o;
+var n=new o();
+n.name=x;
+n.callback=new AjxCallback(null,AjxPackage.__requireNext,b);
+AjxPackage.require(n);
+return
+}
+b.name=x
+}
+var c=b.name;
+var x=AjxPackage.__package2path(c);
+var i=b.callback;
+if(typeof i=="function"){
+i=new AjxCallback(i)
+}
+var f=i?" (callback)":"";
+var y=AjxPackage._packages[x]?" LOADED":"";
+var d=AjxPackage.__scripts.length?" (async, queueing...)":"";
+AjxPackage.__log(['REQUIRE "',c,'"',f,y,d].join(""));
+var g=b.forceReload!=null?b.forceReload:false;
+if(AjxPackage._packages[x]&&!g){
+if(i){
+i.run()
+}
+return
+}
+var w=b.basePath||AjxPackage._basePath||window.contextPath;
+var h=b.extension||AjxPackage._extension;
+var t=b.queryString||AjxPackage._queryString;
+var k=[w,"/",x,h];
+if(t){
+k.push("?",t)
+}
+var m=k.join("");
+var e=b.method||(b.callback?AjxPackage.DEFAULT_ASYNC:AjxPackage.DEFAULT_SYNC);
+var l=e==AjxPackage.METHOD_XHR_SYNC||b.forceSync;
+var r=!l;
+var v={
+name:x,path:m,method:e,async:r,callback:i||AjxCallback.NOP,scripts:r?[]:null};
+if(l||AjxPackage.__scripts.length==0){
+AjxPackage.__doLoad(v)
+}else{
+var p=AjxPackage.__scripts[AjxPackage.__scripts.length-1];
+v.method=p.method;
+v.async=p.async;
+v.scripts=[];
+if(i){
+var u=AjxPackage.__scripts[0];
+u.callback=new AjxCallback(AjxPackage.__chainCallbacks,[u.callback,i]);
+v.callback=AjxCallback.NOP
+}
+p.scripts.push(v)
+}};
+AjxPackage.eval=function(text){
+if(window.execScript){
+window.execScript(text)
+}else{
+if(AjxEnv.isGeckoBased){
+window.eval(text)
+}else{
+var e=document.createElement("SCRIPT");
+var t=document.createTextNode(text);
+e.appendChild(t);
+var heads=document.getElementsByTagName("HEAD");
+if(heads.length==0){
+heads=[document.createElement("HEAD")];
+document.documentElement.appendChild(heads[0])
+}
+heads[0].appendChild(e)
+}}};
+AjxPackage.__package2path=function(e){
+return e.replace(/\./g,"/").replace(/\*$/,"__all__")
+};
+AjxPackage.__requireNext=function(t){
+var e=AjxCallback.simpleClosure(AjxPackage.require,null,t);
+setTimeout(e,AjxEnv.isIE?10:0)
+};
+AjxPackage.__doLoad=function(e){
+if(e.async){
+AjxPackage.__doAsyncLoad(e)
+}else{
+AjxPackage.__doXHR(e)
+}};
+AjxPackage.__doAsyncLoad=function(t,e){
+AjxPackage.__data[name]=t;
+if(e||AjxPackage.__scripts.length==0){
+AjxPackage.__scripts.push(t);
+if(t.method==AjxPackage.METHOD_SCRIPT_TAG){
+AjxPackage.__doScriptTag(t)
+}else{
+AjxPackage.__doXHR(t)
+}}else{
+var a=AjxPackage.__scripts[AjxPackage.__scripts.length-1];
+a.scripts.push(t)
+}};
+AjxPackage.__doScriptTag=function(i){
+var e=document.createElement("SCRIPT");
+e.type="text/javascript";
+e.src=i.path;
+if(AjxEnv.isIE){
+var t=AjxCallback.simpleClosure(AjxPackage.__onAsyncLoadIE,null,e);
+e.attachEvent("onreadystatechange",t)
+}else{
+var t=AjxCallback.simpleClosure(AjxPackage.__onAsyncLoad,null,i.name);
+e.addEventListener("load",t,true)
+}
+var a=document.getElementsByTagName("HEAD");
+if(!a||a.length==0){
+a=[document.createElement("HEAD")];
+document.documentElement.appendChild(a[0])
+}
+a[0].appendChild(e)
+};
+AjxPackage.__doXHR=function(a){
+var i=a.async?new AjxCallback(null,AjxPackage.__onXHR,[a]):null;
+var e={
+url:a.path,userName:a.userName,password:a.password,async:a.async,callback:i};
+var t=AjxLoader.load(e);
+if(!a.async){
+AjxPackage.__onXHR(a,t)
+}};
+AjxPackage.__onXHR=function(t,e){
+if(e.status==200||e.status==0){
+AjxPackage.__requireEval(e.responseText||"")
+}else{
+AjxPackage.__log("error: "+e.status,"background-color:red")
+}
+if(t.async){
+AjxPackage.__onAsyncLoad()
+}else{
+AjxPackage.__onLoad(t)
+}};
+AjxPackage.__onAsyncLoadIE=function(e){
+if(e.readyState=="loaded"){
+AjxPackage.__onAsyncLoad()
+}};
+AjxPackage.__onAsyncLoad=function(){
+var e;
+while(e=AjxPackage.__scripts.pop()){
+if(e.scripts.length){
+AjxPackage.__scripts.push(e);
+e=e.scripts.shift();
+AjxPackage.__scripts.push(e);
+AjxPackage.__doAsyncLoad(e,true);
+return
+}
+AjxPackage.__onLoad(e)
+}};
+AjxPackage.__onLoad=function(t){
+AjxPackage.define(t.name);
+if(t.callback){
+try{
+t.callback.run()
+}
+catch(a){
+AjxPackage.__log("error on callback: "+a,"color:red")
+}}};
+AjxPackage.__requireEval=function(text){
+AjxPackage.__depth++;
+try{
+AjxPackage.eval(text)
+}
+catch(e){
+AjxPackage.__log("error on eval: "+e,"color:red")
+}
+AjxPackage.__depth--
+};
+AjxPackage.__log=function(t,e){};
+AjxPackage.__alertStack=function(r){
+var e=[];
+if(r){
+e.push(r,"\n\n")
+}
+for(var s=AjxPackage.__scripts.length-1;
+s>=0;
+s--){
+var t=AjxPackage.__scripts[s];
+e.push(t.name," (",Boolean(t.callback),")","\n");
+if(t.scripts){
+for(var n=0;
+n<t.scripts.length;
+n++){
+var o=t.scripts[n];
+e.push(" ",o.name," (",Boolean(o.callback),")","\n")
+}}}
+alert(e.join(""))
+};
+AjxPackage.__chainCallbacks=function(t,e){
+if(t){
+t.run()
+}
+if(e){
+e.run()
+}};
+AjxTemplate=function(){};
+AjxTemplate._templates={};
+AjxTemplate._stack=[];
+AjxTemplate.setBasePath=function(e){
+AjxTemplate._basePath=e
+};
+AjxTemplate.setExtension=function(e){
+AjxTemplate._extension=e
+};
+AjxTemplate.register=function(t,a,i,e){
+if(!e&&AjxTemplate._templates[t]&&AjxTemplate._templates[t].authoritative){
+return
+}
+AjxTemplate._templates[t]={
+name:t,func:a,params:i||{}
+,authoritative:e}
+};
+AjxTemplate.getTemplate=function(e){
+var t=AjxTemplate._templates[e];
+return t&&t.func
+};
+AjxTemplate.getParams=function(e){
+var t=AjxTemplate._templates[e];
+return t&&t.params
+};
+AjxTemplate.expand=function(t,r,s){
+if(!AjxTemplate._templates[t]&&AjxTemplate.compile){
+var i=document.getElementById(t);
+if(i){
+var d=i.nodeName.toUpperCase()=="TEXTAREA";
+AjxTemplate.compile(t,true,true,d?i.value:i.innerHTML)
+}}
+var c=AjxTemplate.__name2Package(t);
+var a=t.replace(/^[^#]*#?/,"");
+if(a){
+t=[c,a].join("#")
+}
+AjxTemplate.require(c);
+var h=Boolean(s);
+s=s||[];
+var o=AjxTemplate.getTemplate(t);
+if(o){
+try{
+AjxTemplate._stack.push(c);
+var n=AjxTemplate.getParams(t);
+o(t,n,r,s)
+}
+catch(l){
+s.push(this.__formatError(t,l))
+}
+finally{
+AjxTemplate._stack.pop()
+}}else{
+s.push(this.__formatError(t,"template not found"))
+}
+return h?s.length:s.join("")
+};
+AjxTemplate.require=function(e){
+AjxPackage.require({
+name:AjxTemplate.__name2Package(e),basePath:AjxTemplate._basePath,extension:AjxTemplate._extension}
+);
+return AjxTemplate.getTemplate(e)!=null
+};
+AjxTemplate.setContent=function(a,e,i){
+if(typeof a=="string"){
+a=document.getElementById(a)
+}
+if(a==null){
+return
+}
+var t=AjxTemplate.expand(e,i);
+a.innerHTML=t
+};
+AjxTemplate.__name2Package=function(t){
+var e=t.replace(/#.*$/,"");
+if(t.match(/^#/)&&AjxTemplate._stack.length>0){
+e=AjxTemplate._stack[AjxTemplate._stack.length-1]
+}
+return e
+};
+AjxTemplate.__formatError=function(e,t){
+return"Error in template '"+e+"': "+t
+};
+AjxTemplate.compile=function(d,u,l,f){
+var e=AjxPackage.__package2path(d);
+var g=f!=null?f:AjxLoader.load(e).reponseText;
+var r=[],s=0,h=true;
+AjxTemplate.__RE_TEMPLATE.lastIndex=0;
+var o=AjxTemplate.__RE_TEMPLATE.exec(g);
+if(o){
+do{
+var p=AjxTemplate.__parseAttrs(o[1]);
+var c=o[2];
+if(p["xml:space"]!="preserve"){
+c=c.replace(AjxTemplate.__RE_GT_LINESEP_LT,"><").trim()
+}
+var n=d;
+var a=p.id;
+if(a&&(a.indexOf("#")!=-1||a.match(/^\//))){
+if(a.indexOf("#")==-1){
+a+="#"
+}
+n=a.replace(/#.*$/,"").replace(/^\//,"").replace(/\//g,".");
+a=a.replace(/^.*#/,"")
+}
+var t=a?n+"#"+a:n;
+var i=AjxTemplate.__convertLines(c);
+AjxTemplate.register(n,i,p,u);
+if(h&&l){
+AjxPackage.define(n)
+}
+if(h){
+h=false;
+AjxTemplate.register(n,i,p,u)
+}}
+while(o=AjxTemplate.__RE_TEMPLATE.exec(g))
+}else{
+if(l){
+AjxPackage.define(d)
+}
+var i=AjxTemplate.__convertLines(g);
+AjxTemplate.register(d,i,{}
+,u)
+}};
+AjxTemplate.__RE_REPLACE=new RegExp(["\\$\\{(.+?)\\}","<\\$=(.+?)\\$>","<\\$(.+?)\\$>"].join("|"),"mg");
+AjxTemplate.__RE_TEMPLATE=new RegExp("<template(.*?)>(.*?)</template>","mg");
+AjxTemplate.__RE_ATTR=new RegExp("\\s*(\\S+)\\s*=\\s*('[^']*'|\"[^\"]*\")","mg");
+AjxTemplate.__RE_PARAM_PART=new RegExp("([^\\(\\.]+)(\\(.*?\\))?\\.?","g");
+AjxTemplate.__RE_GT_LINESEP_LT=new RegExp([">","\\s*\\n+\\s*","<"].join(""),"mg");
+AjxTemplate.__convertLines=function(a){
+var t=[],r=0;
+t[r++]="\tvar _hasBuffer = Boolean(buffer);";
+t[r++]='\tdata = (typeof data == "string" ? { id: data } : data) || {};';
+t[r++]="\tbuffer = buffer || [];";
+t[r++]="\tvar _i = buffer.length;";
+t[r++]="\n";
+AjxTemplate.__RE_REPLACE.lastIndex=0;
+var e=AjxTemplate.__RE_REPLACE.exec(a);
+if(e){
+var o=0;
+do{
+var i=AjxTemplate.__RE_REPLACE.lastIndex-e[0].length;
+if(o<i){
+AjxTemplate.__printStringLines(t,a.substring(o,i))
+}
+var s=e[1];
+var n=e[2];
+if(s){
+r=AjxTemplate.__printDataLine(t,s)
+}else{
+if(n){
+r=AjxTemplate.__printBufferLine(t,n)
+}else{
+r=AjxTemplate.__printLine(t,"\t",e[3].replace(/\n/g,"\n\t"),"\n")
+}}
+o=AjxTemplate.__RE_REPLACE.lastIndex
+}
+while(e=AjxTemplate.__RE_REPLACE.exec(a));
+if(o<a.length){
+r=AjxTemplate.__printStringLines(t,a.substring(o))
+}}else{
+r=AjxTemplate.__printStringLines(t,a)
+}
+t[r++]="\n";
+t[r++]='\treturn _hasBuffer ? buffer.length : buffer.join("");';
+return new Function("name,params,data,buffer",t.join(""))
+};
+AjxTemplate.__parseAttrs=function(a){
+var t={}
+,e;
+AjxTemplate.__RE_ATTR.lastIndex=0;
+while(e=AjxTemplate.__RE_ATTR.exec(a)){
+var i=e[2];
+t[e[1]]=i.substring(1,i.length-1)
+}
+return t
+};
+AjxTemplate.__printLine=function(e,a){
+var o=e.length;
+for(var t=1;
+t<arguments.length;
+t++){
+e[o++]=arguments[t]
+}
+return o
+};
+AjxTemplate.__printStringLines=function(a,r){
+var l=a.length;
+for(var n=1;
+n<arguments.length;
+n++){
+var h=arguments[n];
+var t=h.split("\n");
+for(var o=0;
+o<t.length;
+o++){
+var e=t[o];
+l=AjxTemplate.__printStringLine(a,e,n<t.length-1?"\n":"")
+}}
+return l
+};
+AjxTemplate.__printStringLine=function(e,a){
+var o=e.length;
+e[o++]='\tbuffer[_i++] = "';
+for(var t=1;
+t<arguments.length;
+t++){
+o=AjxTemplate.__printEscaped(e,arguments[t])
+}
+e[o++]='";';
+return o
+};
+AjxTemplate.__printDataLine=function(t,a){
+var i=t.length,e;
+t[i++]="\tbuffer[_i++] = data";
+AjxTemplate.__RE_PARAM_PART.lastIndex=0;
+while(e=AjxTemplate.__RE_PARAM_PART.exec(a)){
+t[i++]='["';
+t[i++]=e[1];
+t[i++]='"]';
+if(e[2]!=null){
+t[i++]=e[2]
+}}
+t[i++]=";";
+return i
+};
+AjxTemplate.__printBufferLine=function(e,a){
+var o=e.length;
+e[o++]="\tbuffer[_i++] = ";
+for(var t=1;
+t<arguments.length;
+t++){
+e[o++]=arguments[t]
+}
+e[o++]=";";
+return o
+};
+AjxTemplate.__printEscaped=function(e,t){
+var a=e.length;
+e[a++]=t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace("\n","\\n").replace("\r","\\r").replace("\t","\\t");
+return a
+};
+AjxDispatcher=function(){};
+AjxDispatcher._registry={};
+AjxDispatcher._package={};
+AjxDispatcher._preLoad=[];
+AjxDispatcher._postLoad=[];
+AjxDispatcher._loadFunctionsEnabled=false;
+AjxDispatcher._timedAction=null;
+AjxDispatcher.addPackageLoadFunction=function(e,a){
+var t=AjxDispatcher._getPackageData(e);
+if(!t._loaded&&!AjxPackage.isDefined(e)){
+t.callback.push(a)
+}else{
+AjxTimedAction.scheduleAction(new AjxTimedAction(a,a.run),0)
+}};
+AjxDispatcher.addPreLoadFunction=function(e){
+AjxDispatcher._preLoad.push(e)
+};
+AjxDispatcher.addPostLoadFunction=function(e){
+AjxDispatcher._postLoad.push(e)
+};
+AjxDispatcher.setPackageLoadFunction=AjxDispatcher.addPackageLoadFunction;
+AjxDispatcher.setPreLoadFunction=AjxDispatcher.addPreLoadFunction;
+AjxDispatcher.setPostLoadFunction=AjxDispatcher.addPostLoadFunction;
+AjxDispatcher.enableLoadFunctions=function(e){
+AjxDispatcher._loadFunctionsEnabled=e
+};
+AjxDispatcher.loaded=function(e){
+var t=AjxDispatcher._getPackageData(e);
+return(t&&t._loaded)||AjxPackage.isDefined(e)
+};
+AjxDispatcher.setLoaded=function(t,e){
+var n=AjxDispatcher._getPackageData(t);
+n._loaded=e;
+if(e){
+var o=n.callback||[];
+for(var a=0;
+a<o.length;
+a++){
+o[a].run()
+}}};
+AjxDispatcher.registerMethod=function(a,e,t){
+AjxDispatcher._registry[a]={
+pkg:e,callback:t}
+};
+AjxDispatcher.run=function(o){
+if(!o){
+return
+}
+var e,a,t,l,h;
+if(typeof(o)=="string"){
+e=o;
+t=false;
+h=false
+}else{
+e=o.method;
+a=o.noLoad;
+l=o.callback;
+t=o.async!=null?o.async:Boolean(l);
+h=o.preLoadOk!=null?o.preLoadOk:(l!=null)
+}
+var c=AjxDispatcher._registry[e];
+if(!c){
+AjxPackage.__log("API method '"+e+"' not found");
+return
+}
+AjxPackage.__log("Run method: "+e);
+var r=c.pkg;
+var s=[];
+for(var n=1;
+n<arguments.length;
+++n){
+s.push(arguments[n])
+}
+if(l){
+s.push(l)
+}
+return AjxDispatcher.require(r,t,c.callback,s,h)
+};
+AjxDispatcher.require=function(n,a,h,s,r){
+if(!n){
+return
+}
+if(typeof(n)=="string"){
+n=[n]
+}
+var l=[];
+for(var o=0;
+o<n.length;
+o++){
+var t=n[o];
+if(!AjxDispatcher._getPackageData(t)._loaded){
+l.push(t)
+}}
+if(l.length==0){
+return AjxDispatcher._postLoadCallback(n,false,h,s)
+}else{
+var e=AjxDispatcher._preLoad;
+if(r&&AjxDispatcher._loadFunctionsEnabled&&e.length){
+AjxPackage.__log("pre-load function");
+AjxDispatcher._timedAction=new AjxCallback(null,AjxDispatcher._continueRequire,[l,a,h,s]);
+for(var o=0;
+o<e.length;
+o++){
+e[o].run()
+}
+window.setTimeout("AjxDispatcher._timedAction.run()",0)
+}else{
+return AjxDispatcher._continueRequire(l,a,h,s)
+}}};
+AjxDispatcher._continueRequire=function(s,e,c,r){
+var l=s.join(", ");
+AjxPackage.__log("------------------------------------- Loading package: "+l);
+if(window.console){
+console.log("------------------------------------- Loading package: "+l)
+}
+if(e&&c){
+var o=new AjxCallback(null,AjxDispatcher._postLoadCallback,[s,true,c,r]);
+AjxPackage.require({
+name:s,callback:o}
+)
+}else{
+var n=new Date();
+for(var a=0;
+a<s.length;
+a++){
+AjxPackage.require(s[a])
+}
+var h=new Date();
+var d=h.getTime()-n.getTime();
+AjxPackage.__log("LOAD TIME for "+l+": "+d);
+return AjxDispatcher._postLoadCallback(s,true,c,r)
+}};
+AjxDispatcher._postLoadCallback=function(r,n,l,h){
+for(var a=0;
+a<r.length;
+a++){
+AjxDispatcher._getPackageData(r[a])._loaded=true
+}
+for(var a=0;
+a<r.length;
+a++){
+var e=AjxDispatcher._getPackageData(r[a]);
+if(n&&e.callback.length&&!e.callbackDone){
+e.callbackDone=true;
+AjxPackage.__log("Running post-load package function for "+r[a]);
+var s=e.callback;
+for(var t=0;
+t<s.length;
+t++){
+s[t].run()
+}
+e.callback.length=0
+}}
+if(n){
+var o=AjxDispatcher._postLoad;
+if(AjxDispatcher._loadFunctionsEnabled&&o.length){
+for(var a=0;
+a<o.length;
+a++){
+o[a].run()
+}}}
+if(l){
+return l.run1(h)
+}};
+AjxDispatcher._getPackageData=function(e){
+if(!AjxDispatcher._package[e]){
+AjxDispatcher._package[e]={
+callback:[]}
+}
+return AjxDispatcher._package[e]
+};
+
+
+
+
+AjxPackage.setBasePath("/zimbra/js");
+AjxPackage.setExtension("_all.js.zgz");
+AjxPackage.setQueryString("v=091214175450");
+
+AjxTemplate.setBasePath("/zimbra/templates");
+AjxTemplate.setExtension(".template.js");
+
+
+
+ AjxEnv.DEFAULT_LOCALE = "en_US";
+
+ function switchToStandardClient() {
+ document.location = appContextPath + "/?client=standard";
+ }
+
+
+ var enforceMinDisplay = true;
+ var unsupported = (screen && (screen.width <= 800 && screen.height <= 600) && !false) || (AjxEnv.isSafari && !AjxEnv.isSafari3up);
+ if (enforceMinDisplay && unsupported) {
+ switchToStandardClient();
+ }
+
+
+
+
+/**
+ * DO NOT EDIT! This file is generated.
+ * <p>
+ * Any copy of this file checked into source control is merely for
+ * convenience and should not be edited in any way.
+ * <p>
+ * Generated at Sun Sep 26 17:55:17 PDT 2010
+ */
+AjxTimezoneData = {};
+
+AjxTimezoneData.TRANSITION_YEAR = 2010;
+
+AjxTimezoneData.TIMEZONE_RULES = [
+ { serverId: "Etc/GMT+12", clientId: "Etc/GMT+12", standard: { offset: -720, tzname: "GMT+12" } },
+ { serverId: "Pacific/Midway", clientId: "Pacific/Midway", standard: { offset: -660, tzname: "SST" } },
+ { serverId: "Pacific/Honolulu", clientId: "Pacific/Honolulu", standard: { offset: -600, tzname: "HST" } },
+ { serverId: "America/Anchorage", clientId: "America/Anchorage",
+ standard: { offset: -540, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 11, 7 ], tzname: "AKST" },
+ daylight: { offset: -480, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 14 ], tzname: "AKDT" }
+ },
+ { serverId: "America/Los_Angeles", clientId: "America/Los_Angeles",
+ standard: { offset: -480, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 11, 7 ], tzname: "PST" },
+ daylight: { offset: -420, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 14 ], tzname: "PDT" }
+ },
+ { serverId: "America/Tijuana", clientId: "America/Tijuana",
+ standard: { offset: -480, mon: 10, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "PST" },
+ daylight: { offset: -420, mon: 4, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 4, 4 ], tzname: "PDT" }
+ },
+ { serverId: "America/Chihuahua", clientId: "America/Chihuahua",
+ standard: { offset: -420, mon: 10, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "MST" },
+ daylight: { offset: -360, mon: 4, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 4, 4 ], tzname: "MDT" }
+ },
+ { serverId: "America/Denver", clientId: "America/Denver",
+ standard: { offset: -420, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 11, 7 ], tzname: "MST" },
+ daylight: { offset: -360, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 14 ], tzname: "MDT" }
+ },
+ { serverId: "America/Phoenix", clientId: "America/Phoenix", standard: { offset: -420, tzname: "MST" } },
+ { serverId: "America/Chicago", clientId: "America/Chicago",
+ standard: { offset: -360, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 11, 7 ], tzname: "CST" },
+ daylight: { offset: -300, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 14 ], tzname: "CDT" }
+ },
+ { serverId: "America/Guatemala", clientId: "America/Guatemala", standard: { offset: -360 } },
+ { serverId: "America/Mexico_City", clientId: "America/Mexico_City",
+ standard: { offset: -360, mon: 10, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "CST" },
+ daylight: { offset: -300, mon: 4, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 4, 4 ], tzname: "CDT" }
+ },
+ { serverId: "America/Regina", clientId: "America/Regina", standard: { offset: -360, tzname: "CST" } },
+ { serverId: "America/Bogota", clientId: "America/Bogota", standard: { offset: -300 } },
+ { serverId: "America/Indiana/Indianapolis", clientId: "America/Indiana/Indianapolis",
+ standard: { offset: -300, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 11, 7 ], tzname: "EST" },
+ daylight: { offset: -240, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 14 ], tzname: "EDT" }
+ },
+ { serverId: "America/New_York", clientId: "America/New_York",
+ standard: { offset: -300, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 11, 7 ], tzname: "EST" },
+ daylight: { offset: -240, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 14 ], tzname: "EDT" }
+ },
+ { serverId: "America/Caracas", clientId: "America/Caracas", standard: { offset: -270, tzname: "VET" } },
+ { serverId: "America/Guyana", clientId: "America/Guyana", standard: { offset: -240, tzname: "GYT" } },
+ { serverId: "America/Halifax", clientId: "America/Halifax",
+ standard: { offset: -240, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 11, 7 ], tzname: "AST" },
+ daylight: { offset: -180, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 14 ], tzname: "ADT" }
+ },
+ { serverId: "America/La_Paz", clientId: "America/La_Paz", standard: { offset: -240, tzname: "BOT" } },
+ { serverId: "America/Manaus", clientId: "America/Manaus", standard: { offset: -240, tzname: "AMT" } },
+ { serverId: "America/Santiago", clientId: "America/Santiago",
+ standard: { offset: -240, mon: 3, week: 3, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2010, 3, 21 ], tzname: "CLT" },
+ daylight: { offset: -180, mon: 10, week: 2, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2010, 10, 10 ], tzname: "CLST" }
+ },
+ { serverId: "America/St_Johns", clientId: "America/St_Johns",
+ standard: { offset: -210, mon: 11, week: 1, wkday: 1, hour: 0, min: 1, sec: 0, trans: [ 2010, 11, 7 ], tzname: "NST" },
+ daylight: { offset: -150, mon: 3, week: 2, wkday: 1, hour: 0, min: 1, sec: 0, trans: [ 2010, 3, 14 ], tzname: "NDT" }
+ },
+ { serverId: "America/Argentina/Buenos_Aires", clientId: "America/Argentina/Buenos_Aires", standard: { offset: -180 } },
+ { serverId: "America/Godthab", clientId: "America/Godthab",
+ standard: { offset: -180, mon: 10, week: -1, wkday: 1, hour: 1, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "WGT" },
+ daylight: { offset: -120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "WGST" }
+ },
+ { serverId: "America/Montevideo", clientId: "America/Montevideo",
+ standard: { offset: -180, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 14 ], tzname: "UYT" },
+ daylight: { offset: -120, mon: 10, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 10, 3 ], tzname: "UYST" }
+ },
+ { serverId: "America/Sao_Paulo", clientId: "America/Sao_Paulo",
+ standard: { offset: -180, mon: 2, week: 3, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2010, 2, 21 ], tzname: "BRT" },
+ daylight: { offset: -120, mon: 10, week: 3, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2010, 10, 17 ], tzname: "BRST" }
+ },
+ { serverId: "Atlantic/South_Georgia", clientId: "Atlantic/South_Georgia", standard: { offset: -120, tzname: "GST" } },
+ { serverId: "Atlantic/Azores", clientId: "Atlantic/Azores",
+ standard: { offset: -60, mon: 10, week: -1, wkday: 1, hour: 1, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "AZOT" },
+ daylight: { offset: 0, mon: 3, week: -1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "AZOST" }
+ },
+ { serverId: "Atlantic/Cape_Verde", clientId: "Atlantic/Cape_Verde", standard: { offset: -60, tzname: "CVT" } },
+ { serverId: "Africa/Casablanca", clientId: "Africa/Casablanca",
+ standard: { offset: 0, mon: 8, week: 3, wkday: 6, hour: 0, min: 0, sec: 0, trans: [ 2010, 8, 20 ], tzname: "WET" },
+ daylight: { offset: 60, mon: 6, week: 1, wkday: 2, hour: 0, min: 0, sec: 0, trans: [ 2010, 6, 7 ], tzname: "WEST" }
+ },
+ { serverId: "Africa/Monrovia", clientId: "Africa/Monrovia", standard: { offset: 0, tzname: "GMT" } },
+ { serverId: "Europe/London", clientId: "Europe/London",
+ standard: { offset: 0, mon: 10, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "GMT/BST" },
+ daylight: { offset: 60, mon: 3, week: -1, wkday: 1, hour: 1, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "GMT/BST" }
+ },
+ { serverId: "Africa/Algiers", clientId: "Africa/Algiers", standard: { offset: 60, tzname: "CET" } },
+ { serverId: "Africa/Windhoek", clientId: "Africa/Windhoek",
+ standard: { offset: 60, mon: 4, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 4, 4 ], tzname: "WAT" },
+ daylight: { offset: 120, mon: 9, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 9, 5 ], tzname: "WAST" }
+ },
+ { serverId: "Europe/Belgrade", clientId: "Europe/Belgrade",
+ standard: { offset: 60, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "CET" },
+ daylight: { offset: 120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "CEST" }
+ },
+ { serverId: "Europe/Berlin", clientId: "Europe/Berlin",
+ standard: { offset: 60, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "CET" },
+ daylight: { offset: 120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "CEST" }
+ },
+ { serverId: "Europe/Brussels", clientId: "Europe/Brussels",
+ standard: { offset: 60, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "CET" },
+ daylight: { offset: 120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "CEST" }
+ },
+ { serverId: "Europe/Warsaw", clientId: "Europe/Warsaw",
+ standard: { offset: 60, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "CET" },
+ daylight: { offset: 120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "CEST" }
+ },
+ { serverId: "Africa/Cairo", clientId: "Africa/Cairo",
+ standard: { offset: 120, mon: 8, week: 3, wkday: 5, hour: 0, min: 0, sec: 0, trans: [ 2010, 8, 19 ], tzname: "EET" },
+ daylight: { offset: 180, mon: 4, week: -1, wkday: 6, hour: 0, min: 0, sec: 0, trans: [ 2010, 4, 30 ], tzname: "EEST" }
+ },
+ { serverId: "Africa/Harare", clientId: "Africa/Harare", standard: { offset: 120, tzname: "CAT" } },
+ { serverId: "Asia/Amman", clientId: "Asia/Amman",
+ standard: { offset: 120, mon: 10, week: -1, wkday: 6, hour: 1, min: 0, sec: 0, trans: [ 2010, 10, 29 ], tzname: "EET" },
+ daylight: { offset: 180, mon: 3, week: -1, wkday: 5, hour: 23, min: 59, sec: 59, trans: [ 2010, 3, 25 ], tzname: "EEST" }
+ },
+ { serverId: "Asia/Beirut", clientId: "Asia/Beirut",
+ standard: { offset: 120, mon: 10, week: -1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "EET" },
+ daylight: { offset: 180, mon: 3, week: -1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "EEST" }
+ },
+ { serverId: "Asia/Jerusalem", clientId: "Asia/Jerusalem",
+ standard: { offset: 120, mon: 9, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 9, 26 ], tzname: "IST" },
+ daylight: { offset: 180, mon: 3, week: -1, wkday: 6, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 26 ], tzname: "IDT" }
+ },
+ { serverId: "Europe/Athens", clientId: "Europe/Athens",
+ standard: { offset: 120, mon: 10, week: -1, wkday: 1, hour: 4, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "EET" },
+ daylight: { offset: 180, mon: 3, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "EEST" }
+ },
+ { serverId: "Europe/Helsinki", clientId: "Europe/Helsinki",
+ standard: { offset: 120, mon: 10, week: -1, wkday: 1, hour: 4, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "EET" },
+ daylight: { offset: 180, mon: 3, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "EEST" }
+ },
+ { serverId: "Europe/Minsk", clientId: "Europe/Minsk",
+ standard: { offset: 120, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "EET" },
+ daylight: { offset: 180, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "EEST" }
+ },
+ { serverId: "Africa/Nairobi", clientId: "Africa/Nairobi", standard: { offset: 180, tzname: "EAT" } },
+ { serverId: "Asia/Baghdad", clientId: "Asia/Baghdad", standard: { offset: 180 } },
+ { serverId: "Asia/Kuwait", clientId: "Asia/Kuwait", standard: { offset: 180, tzname: "AST" } },
+ { serverId: "Europe/Moscow", clientId: "Europe/Moscow",
+ standard: { offset: 180, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "MSK/MSD" },
+ daylight: { offset: 240, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "MSK/MSD" }
+ },
+ { serverId: "Asia/Tehran", clientId: "Asia/Tehran",
+ standard: { offset: 210, mon: 9, week: 4, wkday: 3, hour: 0, min: 0, sec: 0, trans: [ 2010, 9, 28 ], tzname: "IRST" },
+ daylight: { offset: 270, mon: 3, week: 4, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "IRDT" }
+ },
+ { serverId: "Asia/Baku", clientId: "Asia/Baku",
+ standard: { offset: 240, mon: 10, week: -1, wkday: 1, hour: 5, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "AZT" },
+ daylight: { offset: 300, mon: 3, week: -1, wkday: 1, hour: 4, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "AZST" }
+ },
+ { serverId: "Asia/Muscat", clientId: "Asia/Muscat", standard: { offset: 240, tzname: "GST" } },
+ { serverId: "Asia/Tbilisi", clientId: "Asia/Tbilisi", standard: { offset: 240, tzname: "GET" } },
+ { serverId: "Asia/Yerevan", clientId: "Asia/Yerevan",
+ standard: { offset: 240, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "AMT" },
+ daylight: { offset: 300, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "AMST" }
+ },
+ { serverId: "Asia/Kabul", clientId: "Asia/Kabul", standard: { offset: 270, tzname: "AFT" } },
+ { serverId: "Asia/Karachi", clientId: "Asia/Karachi",
+ standard: { offset: 300, mon: 11, week: 1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2010, 11, 7 ], tzname: "PKT" },
+ daylight: { offset: 360, mon: 4, week: 3, wkday: 4, hour: 0, min: 0, sec: 0, trans: [ 2010, 4, 21 ], tzname: "PKST" }
+ },
+ { serverId: "Asia/Tashkent", clientId: "Asia/Tashkent", standard: { offset: 300, tzname: "UZT" } },
+ { serverId: "Asia/Yekaterinburg", clientId: "Asia/Yekaterinburg",
+ standard: { offset: 300, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "YEKT" },
+ daylight: { offset: 360, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "YEKST" }
+ },
+ { serverId: "Asia/Colombo", clientId: "Asia/Colombo", standard: { offset: 330, tzname: "IST" } },
+ { serverId: "Asia/Kolkata", clientId: "Asia/Kolkata", standard: { offset: 330, tzname: "IST" } },
+ { serverId: "Asia/Dhaka", clientId: "Asia/Dhaka", standard: { offset: 360, tzname: "BDT" } },
+ { serverId: "Asia/Novosibirsk", clientId: "Asia/Novosibirsk",
+ standard: { offset: 360, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "NOVT" },
+ daylight: { offset: 420, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "NOVST" }
+ },
+ { serverId: "Asia/Rangoon", clientId: "Asia/Rangoon", standard: { offset: 390, tzname: "MMT" } },
+ { serverId: "Asia/Bangkok", clientId: "Asia/Bangkok", standard: { offset: 420, tzname: "ICT" } },
+ { serverId: "Asia/Krasnoyarsk", clientId: "Asia/Krasnoyarsk",
+ standard: { offset: 420, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "KRAT" },
+ daylight: { offset: 480, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "KRAST" }
+ },
+ { serverId: "Asia/Hong_Kong", clientId: "Asia/Hong_Kong", standard: { offset: 480 } },
+ { serverId: "Asia/Irkutsk", clientId: "Asia/Irkutsk",
+ standard: { offset: 480, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "IRKT" },
+ daylight: { offset: 540, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "IRKST" }
+ },
+ { serverId: "Asia/Kuala_Lumpur", clientId: "Asia/Kuala_Lumpur", standard: { offset: 480, tzname: "MYT" } },
+ { serverId: "Asia/Taipei", clientId: "Asia/Taipei", standard: { offset: 480 } },
+ { serverId: "Australia/Perth", clientId: "Australia/Perth", standard: { offset: 480, tzname: "WST" } },
+ { serverId: "Asia/Seoul", clientId: "Asia/Seoul", standard: { offset: 540 } },
+ { serverId: "Asia/Tokyo", clientId: "Asia/Tokyo", standard: { offset: 540 } },
+ { serverId: "Asia/Yakutsk", clientId: "Asia/Yakutsk",
+ standard: { offset: 540, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "YAKT" },
+ daylight: { offset: 600, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "YAKST" }
+ },
+ { serverId: "Australia/Adelaide", clientId: "Australia/Adelaide",
+ standard: { offset: 570, mon: 4, week: 1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 4, 4 ], tzname: "CST" },
+ daylight: { offset: 630, mon: 10, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 10, 3 ], tzname: "CST" }
+ },
+ { serverId: "Australia/Darwin", clientId: "Australia/Darwin", standard: { offset: 570, tzname: "CST" } },
+ { serverId: "Asia/Vladivostok", clientId: "Asia/Vladivostok",
+ standard: { offset: 600, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "VLAT" },
+ daylight: { offset: 660, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "VLAST" }
+ },
+ { serverId: "Australia/Brisbane", clientId: "Australia/Brisbane", standard: { offset: 600, tzname: "EST" } },
+ { serverId: "Australia/Hobart", clientId: "Australia/Hobart",
+ standard: { offset: 600, mon: 4, week: 1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 4, 4 ], tzname: "EST" },
+ daylight: { offset: 660, mon: 10, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 10, 3 ], tzname: "EST" }
+ },
+ { serverId: "Australia/Sydney", clientId: "Australia/Sydney",
+ standard: { offset: 600, mon: 4, week: 1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 4, 4 ], tzname: "EST" },
+ daylight: { offset: 660, mon: 10, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 10, 3 ], tzname: "EST" }
+ },
+ { serverId: "Pacific/Guam", clientId: "Pacific/Guam", standard: { offset: 600, tzname: "ChST" } },
+ { serverId: "Asia/Magadan", clientId: "Asia/Magadan",
+ standard: { offset: 660, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 10, 31 ], tzname: "MAGT" },
+ daylight: { offset: 720, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 3, 28 ], tzname: "MAGST" }
+ },
+ { serverId: "Pacific/Auckland", clientId: "Pacific/Auckland",
+ standard: { offset: 720, mon: 4, week: 1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2010, 4, 4 ], tzname: "NZST" },
+ daylight: { offset: 780, mon: 9, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2010, 9, 26 ], tzname: "NZDT" }
+ },
+ { serverId: "Pacific/Fiji", clientId: "Pacific/Fiji", standard: { offset: 720 } },
+ { serverId: "Pacific/Tongatapu", clientId: "Pacific/Tongatapu", standard: { offset: 780 } }
+];
+
+
+
+
+/* Copyright (C) 2005-2009 Zimbra Inc. http://www.zimbra.com/ */
+if(AjxPackage.define("Startup1_1")){
+if(AjxPackage.define("ajax.core.AjxCore")){
+AjxCore=function(){};
+AjxCore._objectIds=[null];
+AjxCore.assignId=function(e){
+var t=AjxCore._objectIds.length;
+AjxCore._objectIds[t]=e;
+return t
+};
+AjxCore.unassignId=function(e){
+AjxCore._objectIds[e]=null
+};
+AjxCore.objectWithId=function(e){
+return AjxCore._objectIds[e]
+};
+AjxCore.addListener=function(a,e,t){
+a=AjxCore._getEventSource(a);
+var o=AjxCore._getListenerStruct(a,e,true);
+o.list[o.list.length]=t
+};
+AjxCore.setEventHandler=function(a,e,t){
+a=AjxCore._getEventSource(a);
+var o=AjxCore._getListenerStruct(a,e,true);
+o.single=t
+};
+AjxCore.removeListener=function(n,t,o){
+n=AjxCore._getEventSource(n);
+var s=AjxCore._getListenerStruct(n,t);
+if(s){
+var r=s.list;
+var e=r.length;
+for(var a=0;
+a<e;
+a++){
+if(r[a]==o){
+r[a]=null
+}}}};
+AjxCore.removeAllListeners=function(o,t){
+o=AjxCore._getEventSource(o);
+var n=AjxCore._getListenerStruct(o,t);
+if(n){
+var s=n.list;
+var e=s.length;
+for(var a=0;
+a<e;
+a++){
+s[a]=null
+}}
+AjxCore.unassignId(n.id)
+};
+AjxCore.notifyListeners=function(a,e,t){
+a=AjxCore._getEventSource(a);
+var o=AjxCore._getListenerStruct(a,e);
+if(o){
+a[e](t)
+}};
+AjxCore._getEventSource=function(e){
+if(typeof(e)=="string"){
+e=document.getElementById(e)
+}
+return e
+};
+AjxCore.getListenerStruct=function(t,e){
+return AjxCore._getListenerStruct(t,e)
+};
+AjxCore._getListenerStruct=function(a,e,t){
+var o=null;
+if(a[e]){
+var n=a[e]._lsListenerStructId;
+o=AjxCore.objectWithId(n)
+}else{
+if(t){
+o=AjxCore._setupListener(a,e)
+}}
+return o
+};
+AjxCore._setupListener=function(a,e,n){
+var o=new Object();
+o.list=new Array();
+o.single=null;
+var n=o.id=AjxCore.assignId(o);
+var t=AjxCore._createListenerClosure(n);
+a[e]=t;
+a[e]._lsListenerStructId=n;
+return o
+};
+AjxCore._createListenerClosure=function(id){
+var closure=function(arg1){
+var listenerStruct=AjxCore.objectWithId(id);
+var listenerList=listenerStruct.list;
+var len=listenerList.length;
+for(var i=0;
+i<len;
+i++){
+var callback=listenerList[i];
+if(callback){
+if(typeof(callback)=="string"){
+eval(callback)
+}else{
+if(callback.handleEvent){
+callback.handleEvent(arg1,this)
+}else{
+callback(arg1,this)
+}}}}
+if(listenerStruct.single){
+var callback=listenerStruct.single;
+if(typeof(callback)=="string"){
+eval(callback)
+}else{
+return callback.handleEvent?callback.handleEvent(arg1,this):callback(arg1,this)
+}}};
+return closure
+};
+AjxCore.addOnloadListener=function(e){
+if(window.onload&&(!window.onload._lsListenerStructId)){
+var t=window.onload;
+window.onload=null;
+AjxCore.addListener(window,"onload",t)
+}
+AjxCore.addListener(window,"onload",e)
+};
+AjxCore.addOnunloadListener=function(e){
+if(window.onunload&&(!window.onunload._lsListenerStructId)){
+var t=window.onunload;
+window.onunload=null;
+AjxCore.addListener(window,"onunload",t)
+}
+AjxCore.addListener(window,"onunload",e)
+}
+}
+if(AjxPackage.define("ajax.util.AjxUtil")){
+AjxUtil=function(){};
+AjxUtil.FLOAT_RE=/^[+\-]?((\d+(\.\d*)?)|((\d*\.)?\d+))([eE][+\-]?\d+)?$/;
+AjxUtil.NOTFLOAT_RE=/[^\d\.]/;
+AjxUtil.NOTINT_RE=/[^0-9]+/;
+AjxUtil.LIFETIME_FIELD=/^([0-9])+([dhms])?$/;
+AjxUtil.isSpecified=function(e){
+return((e!==void 0)&&(e!==null))
+};
+AjxUtil.isUndefined=function(e){
+return(e===void 0)
+};
+AjxUtil.isNull=function(e){
+return(e===null)
+};
+AjxUtil.isBoolean=function(e){
+return(typeof(e)=="boolean")
+};
+AjxUtil.isString=function(e){
+return(typeof(e)=="string")
+};
+AjxUtil.isNumber=function(e){
+return(typeof(e)=="number")
+};
+AjxUtil.isObject=function(e){
+return((typeof(e)=="object")&&(e!==null))
+};
+AjxUtil.isArray=function(e){
+return AjxUtil.isInstance(e,Array)
+};
+AjxUtil.isFunction=function(e){
+return(typeof(e)=="function")
+};
+AjxUtil.isDate=function(e){
+return AjxUtil.isInstance(e,Date)
+};
+AjxUtil.isLifeTime=function(e){
+return AjxUtil.LIFETIME_FIELD.test(e)
+};
+AjxUtil.isNumeric=function(e){
+return(!isNaN(parseFloat(e))&&AjxUtil.FLOAT_RE.test(e)&&!AjxUtil.NOTFLOAT_RE.test(e))
+};
+AjxUtil.isLong=function(e){
+return(AjxUtil.isNumeric(e)&&!AjxUtil.NOTINT_RE.test(e))
+};
+AjxUtil.isNonNegativeLong=function(e){
+return(AjxUtil.isNumeric(e)&&AjxUtil.isLong(e)&&(parseFloat(e)>=0))
+};
+AjxUtil.isInt=function(e){
+return(AjxUtil.isNumeric(e)&&!AjxUtil.NOTINT_RE.test(e))
+};
+AjxUtil.isPositiveInt=function(e){
+return(AjxUtil.isNumeric(e)&&AjxUtil.isInt(e)&&(parseInt(e)>0))
+};
+AjxUtil.isEmpty=function(e){
+return(AjxUtil.isNull(e)||AjxUtil.isUndefined(e)||(e==="")||(AjxUtil.isArray(e)&&(e.length==0)))
+};
+AjxUtil.IP_ADDRESS_RE=/^\d{1,3}(\.\d{1,3}){3}(\.\d{1,3}\.\d{1,3})?$/;
+AjxUtil.IP_ADDRESS_WITH_PORT_RE=/^\d{1,3}(\.\d{1,3}){3}(\.\d{1,3}\.\d{1,3})?:\d{1,5}$/;
+AjxUtil.SUBNET_RE=/^\d{1,3}(\.\d{1,3}){3}(\.\d{1,3}\.\d{1,3})?\/\d{1,2}$/;
+AjxUtil.DOMAIN_NAME_SHORT_RE=/^[A-Za-z0-9\-]{2,}$/;
+AjxUtil.DOMAIN_NAME_FULL_RE=/^[A-Za-z0-9\-]{1,}(\.[A-Za-z0-9\-]{2,}){1,}$/;
+AjxUtil.HOST_NAME_RE=/^[A-Za-z0-9\-]{2,}(\.[A-Za-z0-9\-]{1,})*(\.[A-Za-z0-9\-]{2,})*$/;
+AjxUtil.HOST_NAME_WITH_PORT_RE=/^[A-Za-z0-9\-]{2,}(\.[A-Za-z0-9\-]{2,})*:([0-9])+$/;
+AjxUtil.EMAIL_SHORT_RE=/^[^@\s]+$/;
+AjxUtil.EMAIL_FULL_RE=/^[^@\s]+@[A-Za-z0-9\-]{2,}(\.[A-Za-z0-9\-]{2,})+$/;
+AjxUtil.SHORT_URL_RE=/^[A-Za-z0-9]{2,}:\/\/[A-Za-z0-9\-]+(\.[A-Za-z0-9\-]+)*(:([0-9])+)*$/;
+AjxUtil.IP_SHORT_URL_RE=/^[A-Za-z0-9]{2,}:\/\/\d{1,3}(\.\d{1,3}){3}(\.\d{1,3}\.\d{1,3})?(:([0-9])+)*$/;
+AjxUtil.isIpAddress=function(e){
+return AjxUtil.IP_ADDR_RE.test(e)
+};
+AjxUtil.isDomain=function(e){
+return AjxUtil.DOMAIN_RE.test(e)
+};
+AjxUtil.isHostName=function(e){
+return AjxUtil.HOST_NAME_RE.test(e)
+};
+AjxUtil.isDomainName=function(t,e){
+return e?AjxUtil.DOMAIN_NAME_SHORT_RE.test(t):AjxUtil.DOMAIN_NAME_FULL_RE.test(t)
+};
+AjxUtil.isEmailAddress=function(t,e){
+return e?AjxUtil.EMAIL_SHORT_RE.test(t):AjxUtil.EMAIL_FULL_RE.test(t)
+};
+AjxUtil.isValidEmailNonReg=function(e){
+return((e.indexOf("@")>0)&&(e.lastIndexOf("@")==e.indexOf("@"))&&(e.indexOf(".@")<0))
+};
+AjxUtil.SIZE_GIGABYTES="GB";
+AjxUtil.SIZE_MEGABYTES="MB";
+AjxUtil.SIZE_KILOBYTES="KB";
+AjxUtil.SIZE_BYTES="B";
+AjxUtil.formatSize=function(n,o,s){
+if(o==null){
+o=true
+}
+if(s==null){
+s=20
+}
+var t=AjxMsg.sizeBytes;
+var a=AjxMsg.SIZE_BYTES;
+if(n>=1073741824){
+t=AjxMsg.sizeGigaBytes;
+a=AjxUtil.SIZE_GIGABYTES
+}else{
+if(n>=1048576){
+t=AjxMsg.sizeMegaBytes;
+a=AjxUtil.SIZE_MEGABYTES
+}else{
+if(n>1023){
+t=AjxMsg.sizeKiloBytes;
+a=AjxUtil.SIZE_KILOBYTES
+}}}
+var e=AjxUtil.formatSizeForUnits(n,a,o,s);
+return AjxMessageFormat.format(AjxMsg.formatSizeAndUnits,[e,t])
+};
+AjxUtil.formatSizeForUnits=function(o,t,e,s){
+if(t==null){
+t=AjxUtil.SIZE_BYTES
+}
+if(e==null){
+e=true
+}
+if(s==null){
+s=20
+}
+switch(t){
+case AjxUtil.SIZE_GIGABYTES:o/=1073741824;
+break;
+case AjxUtil.SIZE_MEGABYTES:o/=1048576;
+break;
+case AjxUtil.SIZE_KILOBYTES:o/=1024;
+break
+}
+var n=I18nMsg.formatNumber.replace(/\..*$/,"");
+n=n.replace(/,/,"");
+if(!e&&s){
+n=n+=".";
+for(var a=0;
+a<s;
+a++){
+n+="#"
+}}
+return AjxNumberFormat.format(n,o)
+};
+AjxUtil.parseSize=function(t,o){
+if(typeof t!=_STRING_){
+t=t.toString()
+}
+var n=parseFloat(t.replace(/^\s*/,""));
+var a=/[GMK]?B$/i;
+var e=a.exec(t);
+if(e){
+o=e[0].toUpperCase()
+}
+switch(o){
+case AjxUtil.SIZE_GIGABYTES:n*=1073741824;
+break;
+case AjxUtil.SIZE_MEGABYTES:n*=1048576;
+break;
+case AjxUtil.SIZE_KILOBYTES:n*=1024;
+break
+}
+return n
+};
+AjxUtil.isInstance=function(e,t){
+return !!(e&&e.constructor&&(e.constructor===t))
+};
+AjxUtil.assert=function(e,t){
+if(!e&&AjxUtil.onassert){
+AjxUtil.onassert(t)
+}};
+AjxUtil.onassert=function(t){
+var c=new Object();
+c.message=t;
+var d=new Array();
+if(AjxEnv.isIE5_5up){
+var o=arguments.caller;
+while(o){
+d[d.length]=o.callee;
+o=o.caller
+}}else{
+try{
+var o=arguments.callee.caller;
+while(o){
+d[d.length]=o;
+if(d.length>2){
+break
+}
+o=o.caller
+}}
+catch(h){}}
+c.stack=d;
+var r="";
+var a=170;
+for(var n=1;
+n<d.length;
+n++){
+if(n>1){
+r+="\n"
+}
+if(n<11){
+var s=d[n].toString();
+if(s.length>a){
+s=s.substr(0,a)+"...";
+s=s.replace(/\n/g,"")
+}
+r+=n+": "+s
+}else{
+r+="("+(d.length-11)+" frames follow)";
+break
+}}
+alert("assertion:\n\n"+t+"\n\n---- Call Stack ---\n"+r);
+throw c
+};
+AjxUtil.ELEMENT_NODE=1;
+AjxUtil.TEXT_NODE=3;
+AjxUtil.DOCUMENT_NODE=9;
+AjxUtil.getInnerText=function(e){
+if(AjxEnv.isIE){
+return e.innerText
+}
+function t(s){
+if(s){
+if(s.nodeType==3){
+return s.data
+}
+if(s.nodeType==1){
+if(/^br$/i.test(s.tagName)){
+return"\r\n"
+}
+var o="";
+for(var a=s.firstChild;
+a;
+a=a.nextSibling){
+o+=t(a)
+}
+return o
+}}
+return""
+}
+return t(e)
+};
+AjxUtil.createProxy=function(a,r){
+var n;
+var t=function(){};
+t.prototype=a;
+if(a instanceof Array){
+n=new Array();
+var o=a.length;
+for(var e=0;
+e<o;
+e++){
+n[e]=a[e]
+}}else{
+n=new t
+}
+if(r){
+for(var s in a){
+if(typeof a[s]=="object"&&a[s]!==null){
+n[s]=AjxUtil.createProxy(a[s],r-1)
+}}}
+n._object_=a;
+return n
+};
+AjxUtil.collapseList=function(a){
+var t=[];
+for(var e=0;
+e<a.length;
+e++){
+if(a[e]){
+t.push(a[e])
+}}
+return t
+};
+AjxUtil.arrayAsHash=function(r,o){
+var s={};
+var a=typeof o=="function"&&o;
+var n=o||true;
+for(var t=0;
+t<r.length;
+t++){
+var e=r[t];
+s[e]=a?a(e,s,t,r):n
+}
+return s
+};
+AjxUtil.arrayAdd=function(a,t,e){
+if(e==null||e<0||e>=a.length){
+a.push(t)
+}else{
+a.splice(e,0,t)
+}};
+AjxUtil.arrayRemove=function(a,t){
+for(var e=0;
+e<a.length;
+e++){
+if(a[e]==t){
+a.splice(e,1);
+return true
+}}
+return false
+};
+AjxUtil.indexOf=function(n,t,e){
+if(n){
+for(var a=0;
+a<n.length;
+a++){
+var o=n[a];
+if((e&&o===t)||(!e&&o==t)){
+return a
+}}}
+return -1
+};
+AjxUtil.keys=function(t,e){
+var a=[];
+for(var o in t){
+if(e&&!e(o,t)){
+continue
+}
+a.push(o)
+}
+return a
+};
+AjxUtil.values=function(a,t){
+var e=[];
+for(var o in a){
+if(t&&!t(o,a)){
+continue
+}
+e.push(a[o])
+}
+return e
+};
+AjxUtil.map=function(o,a){
+var e=new Array(o.length);
+for(var t=0;
+t<o.length;
+t++){
+e[t]=a?a(o[t]):o[t]
+}
+return e
+};
+AjxUtil.uniq=function(a){
+var e={};
+for(var t=0;
+t<a.length;
+t++){
+e[a[t]]=true
+}
+return AjxUtil.keys(e)
+};
+AjxUtil.concat=function(t){
+var a=[];
+for(var e=0;
+e<arguments.length;
+e++){
+a.push.apply(a,arguments[e])
+}
+return a
+};
+AjxUtil.union=function(e){
+var t=[];
+return AjxUtil.uniq(t.concat.apply(t,arguments))
+};
+AjxUtil.intersection=function(t){
+var o=AjxUtil.concat.apply(this,arguments);
+var e=AjxUtil.arrayAsHash(o,AjxUtil.__intersection_count);
+for(var a in e){
+if(e[a]==1){
+delete e[a]
+}}
+return AjxUtil.keys(e)
+};
+AjxUtil.__intersection_count=function(t,a,e,o){
+return a[t]!=null?a[t]+1:1
+};
+AjxUtil.complement=function(o,t){
+var a=AjxUtil.arrayAsHash(o);
+var e=AjxUtil.arrayAsHash(t);
+for(var n in e){
+if(n in a){
+delete e[n]
+}}
+return AjxUtil.keys(e)
+};
+AjxUtil.getFirstElement=function(n,o,a,t){
+for(var s=n.firstChild;
+s;
+s=s.nextSibling){
+if(s.nodeType!=AjxUtil.ELEMENT_NODE){
+continue
+}
+if(o&&s.nodeName!=o){
+continue
+}
+if(a){
+var e=s.getAttributeNode(a);
+if(e.nodeName!=a){
+continue
+}
+if(t&&e.nodeValue!=t){
+continue
+}}
+return s
+}
+return null
+};
+AjxUtil.formatUrl=function(s){
+s=s||{};
+var a=[];
+var o=0;
+if(!s.relative){
+var n=s.protocol||location.protocol;
+if(n.indexOf(":")==-1){
+n=n+":"
+}
+a[o++]=n;
+a[o++]="//";
+a[o++]=s.host||location.hostname;
+var t=Number(s.port||location.port);
+if(t&&((n==ZmSetting.PROTO_HTTP&&t!=ZmSetting.HTTP_DEFAULT_PORT)||(n==ZmSetting.PROTO_HTTPS&&t!=ZmSetting.HTTPS_DEFAULT_PORT))){
+a[o++]=":";
+a[o++]=t
+}}
+a[o++]=s.path||location.pathname;
+var e="";
+if(s.qsArgs){
+e=AjxStringUtil.queryStringSet(s.qsArgs,s.qsReset)
+}else{
+e=s.qsReset?"":location.search
+}
+a[o++]=e;
+return a.join("")
+};
+AjxUtil.byNumber=function(t,e){
+return Number(t)-Number(e)
+};
+AjxUtil.LOG={};
+AjxUtil.enableLogType=function(t,e){
+if(e){
+AjxUtil.LOG[t]=[];
+AjxUtil.LOG[t].push("Log type: "+t)
+}else{
+AjxUtil.LOG[t]=null
+}};
+AjxUtil.log=function(e,t){
+if(!AjxUtil.LOG[e]){
+return
+}
+AjxUtil.LOG[e].push(t)
+};
+AjxUtil.mergeArrays=function(h,n,e){
+if(!e){
+e=function(u,d){
+if(u>d){
+return 1
+}
+if(u<d){
+return -1
+}
+if(u==d){
+return 0
+}}
+}
+var c=[];
+var o=h.length;
+for(var t=0;
+t<o;
+t++){
+c.push(h[t])
+}
+var s=[];
+var a=n.length;
+for(var t=0;
+t<a;
+t++){
+s.push(n[t])
+}
+var r=[];
+while(c.length>0&&s.length>0){
+if(e(c[0],r[r.length-1])==0){
+c.shift();
+continue
+}
+if(e(s[0],r[r.length-1])==0){
+s.shift();
+continue
+}
+if(e(c[0],s[0])<0){
+r.push(c.shift())
+}else{
+if(e(c[0],s[0])==0){
+r.push(c.shift());
+s.shift()
+}else{
+r.push(s.shift())
+}}}
+while(c.length>0){
+if(e(c[0],r[r.length-1])==0){
+c.shift();
+continue
+}
+r.push(c.shift())
+}
+while(s.length>0){
+if(e(s[0],r[r.length-1])==0){
+s.shift();
+continue
+}
+r.push(s.shift())
+}
+return r
+};
+AjxUtil.arraySubstract=function(h,n,e){
+if(!e){
+e=function(u,d){
+if(u>d){
+return 1
+}
+if(u<d){
+return -1
+}
+if(u==d){
+return 0
+}}
+}
+var c=[];
+var o=h.length;
+for(var t=0;
+t<o;
+t++){
+c.push(h[t])
+}
+var s=[];
+var a=n.length;
+for(var t=0;
+t<a;
+t++){
+s.push(n[t])
+}
+s.sort(e);
+c.sort(e);
+var r=[];
+while(c.length>0&&s.length>0){
+if(e(c[0],s[0])==0){
+c.shift();
+s.shift();
+continue
+}
+if(e(c[0],s[0])<0){
+r.push(c.shift());
+continue
+}
+if(e(c[0],s[0])>0){
+s.shift();
+continue
+}}
+while(c.length>0){
+r.push(c.shift())
+}
+return r
+};
+AjxUtil.getHashKeys=function(a){
+var t=[];
+for(var e in a){
+t.push(e)
+}
+t.sort();
+return t
+};
+AjxUtil.arrayCompare=function(t,e){
+if((!t||!e)&&(t!=e)){
+return false
+}
+if(t.length!=e.length){
+return false
+}
+for(var a=0;
+a<t.length;
+a++){
+if(t[a]!=e[a]){
+return false
+}}
+return true
+};
+AjxUtil.hashCompare=function(n,o){
+var t=AjxUtil.getHashKeys(n);
+var e=AjxUtil.getHashKeys(o);
+if(!AjxUtil.arrayCompare(t,e)){
+return false
+}
+for(var a in t){
+if(n[a]!=o[a]){
+return false
+}}
+return true
+};
+AjxUtil.hashCopy=function(t){
+var a={};
+for(var e in t){
+a[e]=t[e]
+}
+return a
+};
+AjxUtil.toArray=function(e){
+return(e instanceof Array)?e:(e===undefined)?[]:[e]
+}
+}
+if(AjxPackage.define("ajax.core.AjxException")){
+AjxException=function(a,t,o,e){
+if(arguments.length==0){
+return
+}
+this.msg=a;
+this.code=t;
+this.method=o;
+this.detail=e
+};
+AjxException.prototype.toString=function(){
+return"AjxException"
+};
+AjxException.prototype.dump=function(){
+return"AjxException: msg="+this.msg+" code="+this.code+" method="+this.method+" detail="+this.detail
+};
+AjxException.INVALIDPARENT="AjxException.INVALIDPARENT";
+AjxException.INVALID_OP="AjxException.INVALID_OP";
+AjxException.INTERNAL_ERROR="AjxException.INTERNAL_ERROR";
+AjxException.INVALID_PARAM="AjxException.INVALID_PARAM";
+AjxException.UNIMPLEMENTED_METHOD="AjxException.UNIMPLEMENTED_METHOD";
+AjxException.NETWORK_ERROR="AjxException.NETWORK_ERROR";
+AjxException.OUT_OF_RPC_CACHE="AjxException.OUT_OF_RPC_CACHE";
+AjxException.UNSUPPORTED="AjxException.UNSUPPORTED";
+AjxException.UNKNOWN_ERROR="AjxException.UNKNOWN_ERROR";
+AjxException.CANCELED="AjxException.CANCELED"
+}
+if(AjxPackage.define("ajax.util.AjxCookie")){
+AjxCookie=function(){};
+AjxCookie.prototype.toString=function(){
+return"AjxCookie"
+};
+AjxCookie.getCookie=function(h,t){
+var c=t+"=";
+var o=c.length;
+var r=h.cookie.length;
+var a=h.cookie;
+var s=0;
+while(s<r){
+var n=s+o;
+if(a.substring(s,n)==c){
+var e=a.indexOf(";",n);
+if(e==-1){
+e=a.length
+}
+return unescape(a.substring(n,e))
+}
+s=a.indexOf(" ",s)+1;
+if(s==0){
+break
+}}
+return null
+};
+AjxCookie.setCookie=function(r,t,o,e,s,a,n){
+r.cookie=t+"="+escape(o)+((e)?"; expires="+e.toGMTString():"")+((s)?"; path="+s:"")+((a)?"; domain="+a:"")+((n)?"; secure":"")
+};
+AjxCookie.deleteCookie=function(o,e,a,t){
+o.cookie=e+"="+((a)?"; path="+a:"")+((t)?"; domain="+t:"")+"; expires=Fri, 31 Dec 1999 23:59:59 GMT"
+};
+AjxCookie.areCookiesEnabled=function(o){
+var e="ZM_COOKIE_TEST";
+var a="Zimbra";
+AjxCookie.setCookie(o,e,a);
+var t=AjxCookie.getCookie(o,e);
+AjxCookie.deleteCookie(o,e);
+return t==a
+}
+}
+if(AjxPackage.define("ajax.soap.AjxSoapException")){
+AjxSoapException=function(a,t,o,e){
+AjxException.call(this,a,t,o,e)
+};
+AjxSoapException.prototype.toString=function(){
+return"AjxSoapException"
+};
+AjxSoapException.prototype=new AjxException;
+AjxSoapException.prototype.constructor=AjxSoapException;
+AjxSoapException.INTERNAL_ERROR="INTERNAL_ERROR";
+AjxSoapException.INVALID_PDU="INVALID_PDU";
+AjxSoapException.ELEMENT_EXISTS="ELEMENT_EXISTS"
+}
+if(AjxPackage.define("ajax.soap.AjxSoapFault")){
+AjxSoapFault=function(t){
+if(arguments.length==0){
+return
+}
+var r=t.prefix;
+var s=r+":Code";
+var n=r+":Reason";
+var a=r+":Detail";
+var h=t.childNodes.length;
+for(var o=0;
+o<h;
+o++){
+var e=t.childNodes[o];
+if(e.nodeName==s){
+var c=e.firstChild.firstChild.nodeValue;
+if(c==(r+":VersionMismatch")){
+this.faultCode=AjxSoapFault.VERSION_MISMATCH
+}else{
+if(c==(r+":MustUnderstand")){
+this.faultCode=AjxSoapFault.MUST_UNDERSTAND
+}else{
+if(c==(r+":DataEncodingUnknown")){
+this.faultCode=AjxSoapFault.DATA_ENCODING_UNKNOWN
+}else{
+if(c==(r+":Sender")){
+this.faultCode=AjxSoapFault.SENDER
+}else{
+if(c==(r+":Receiver")){
+this.faultCode=AjxSoapFault.RECEIVER
+}else{
+this.faultCode=AjxSoapFault.UNKNOWN
+}}}}}}else{
+if(e.nodeName==n){
+this.reason=e.firstChild.firstChild.nodeValue
+}else{
+if(e.nodeName==a){
+this.errorCode=e.firstChild.firstChild.firstChild.nodeValue
+}}}}};
+AjxSoapFault.prototype.toString=function(){
+return"AjxSoapFault"
+};
+AjxSoapFault.SENDER=-1;
+AjxSoapFault.RECEIVER=-2;
+AjxSoapFault.VERSION_MISMATCH=-3;
+AjxSoapFault.MUST_UNDERSTAND=-4;
+AjxSoapFault.DATA_ENCODING_UNKNOWN=-5;
+AjxSoapFault.UNKNOWN=-6
+}
+if(AjxPackage.define("ajax.soap.AjxSoapDoc")){
+AjxSoapDoc=function(){
+this._soapURI=AjxSoapDoc._SOAP_URI
+};
+AjxSoapDoc.prototype.toString=function(){
+return"AjxSoapDoc"
+};
+AjxSoapDoc._SOAP_URI="http://www.w3.org/2003/05/soap-envelope";
+AjxSoapDoc._XMLNS_URI="http://www.w3.org/2000/xmlns";
+AjxSoapDoc.create=function(e,a,h,r){
+var s=new AjxSoapDoc();
+s._xmlDoc=AjxXmlDoc.create();
+var n=s._xmlDoc.getDoc();
+if(!r){
+r=AjxSoapDoc._SOAP_URI
+}
+s._soapURI=r;
+var t=n.createElementNS&&!AjxEnv.isSafari;
+var o=t?n.createElementNS(r,"soap:Envelope"):n.createElement("soap:Envelope");
+if(!t){
+o.setAttribute("xmlns:soap",r)
+}
+n.appendChild(o);
+var c=t?n.createElementNS(r,"soap:Body"):n.createElement("soap:Body");
+o.appendChild(c);
+s._methodEl=a&&t?n.createElementNS(a,e):n.createElement(e);
+if(a!=null&&!t){
+if(h==null){
+s._methodEl.setAttribute("xmlns",a)
+}else{
+s._methodEl.setAttribute("xmlns:"+h,a)
+}}
+c.appendChild(s._methodEl);
+return s
+};
+AjxSoapDoc.createFromDom=function(t){
+var e=new AjxSoapDoc();
+e._xmlDoc=AjxXmlDoc.createFromDom(t);
+e._methodEl=e._check(e._xmlDoc);
+return e
+};
+AjxSoapDoc.createFromXml=function(e){
+var t=new AjxSoapDoc();
+t._xmlDoc=AjxXmlDoc.createFromXml(e);
+t._methodEl=t._check(t._xmlDoc);
+return t
+};
+AjxSoapDoc.element2FaultObj=function(t){
+var e=t.firstChild;
+if(!AjxEnv.isSafari){
+if(e!=null&&e.namespaceURI!=AjxSoapDoc._SOAP_URI||e.nodeName!=(t.prefix+":Fault")){
+return null
+}}else{
+if(e!=null&&e.nodeName!=(t.prefix+":Fault")){
+return null
+}}
+return new AjxSoapFault(e)
+};
+AjxSoapDoc.prototype.setMethodAttribute=function(e,t){
+this._methodEl.setAttribute(e,t)
+};
+AjxSoapDoc.prototype.set=function(t,c,d,n){
+var h=this.getDoc();
+var e=h.createElementNS&&!AjxEnv.isSafari;
+var a=t?(n&&e?h.createElementNS(n,t):h.createElement(t)):h.createDocumentFragment();
+if(n&&!e){
+a.setAttribute("xmlns",n)
+}
+if(c!=null){
+if(typeof c=="object"){
+for(var r in c){
+var o=c[r];
+if(r.charAt(0)=="!"){
+a.setAttribute(r.substr(1),o)
+}else{
+if(o instanceof Array){
+for(var s=0;
+s<o.length;
+++s){
+this.set(r,o[s],a)
+}}else{
+this.set(r,o,a)
+}}}}else{
+a.appendChild(h.createTextNode(c))
+}}
+if(!d){
+d=this._methodEl
+}
+return d.appendChild(a)
+};
+AjxSoapDoc.prototype.getMethod=function(){
+return this._methodEl
+};
+AjxSoapDoc.prototype.createHeaderElement=function(){
+var a=this._xmlDoc.getDoc();
+var t=a.firstChild;
+var o=this.getHeader();
+if(o!=null){
+throw new AjxSoapException("SOAP header already exists",AjxSoapException.ELEMENT_EXISTS,"AjxSoapDoc.prototype.createHeaderElement")
+}
+var e=a.createElementNS&&!AjxEnv.isSafari;
+o=e?a.createElementNS(this._soapURI,"soap:Header"):a.createElement("soap:Header");
+t.insertBefore(o,t.firstChild);
+return o
+};
+AjxSoapDoc.prototype.getHeader=function(){
+var t=this._xmlDoc.getDoc();
+var e=AjxEnv.isIE?(t.getElementsByTagName(t.firstChild.prefix+":Header")):(t.getElementsByTagNameNS(this._soapURI,"Header"));
+return e?e[0]:null
+};
+AjxSoapDoc.prototype.getBody=function(){
+var t=this._xmlDoc.getDoc();
+var e=AjxEnv.isIE?(t.getElementsByTagName(t.firstChild.prefix+":Body")):(t.getElementsByTagNameNS(this._soapURI,"Body"));
+return e?e[0]:null
+};
+AjxSoapDoc.prototype.getByTagName=function(t){
+if(t.indexOf(":")==-1){
+t="soap:"+t
+}
+var e=this.getDoc().getElementsByTagName(t);
+if(e.length==1){
+return e[0]
+}else{
+if(e.length>0){
+return e
+}else{
+return null
+}}};
+AjxSoapDoc.prototype.ensureHeader=function(){
+return(this.getHeader()||this.createHeaderElement())
+};
+AjxSoapDoc.prototype.getDoc=function(){
+return this._xmlDoc.getDoc()
+};
+AjxSoapDoc.prototype.adoptNode=function(t){
+if(AjxEnv.isFirefox3up||!AjxEnv.isFirefox){
+try{
+var a=this.getDoc();
+if(a.adoptNode){
+return a.adoptNode(t,true)
+}}
+catch(e){}}
+return t.parentNode.removeChild(t)
+};
+AjxSoapDoc.prototype.getXml=function(){
+return AjxEnv.isSafari||AjxEnv.isOpera?(AjxXmlDoc.getXml(this._xmlDoc.getDoc())):AjxXmlDoc.replaceInvalidChars(this._xmlDoc.getDoc().xml)
+};
+AjxSoapDoc.prototype._check=function(t){
+var a=t.getDoc();
+if(a.childNodes.length!=1){
+throw new AjxSoapException("Invalid SOAP PDU",AjxSoapException.INVALID_PDU,"AjxSoapDoc.createFromXml:1")
+}
+var e=a.firstChild;
+if(!AjxEnv.isSafari){
+if(e.namespaceURI!=AjxSoapDoc._SOAP_URI||e.nodeName!=(e.prefix+":Envelope")||(e.childNodes.length<1||e.childNodes.length>2)){
+throw new AjxSoapException("Invalid SOAP PDU",AjxSoapException.INVALID_PDU,"AjxSoapDoc.createFromXml:2")
+}}else{
+if(e.nodeName!=(e.prefix+":Envelope")){
+throw new AjxSoapException("Invalid SOAP PDU",AjxSoapException.INVALID_PDU,"AjxSoapDoc.createFromXml:2")
+}}}
+}
+if(AjxPackage.define("ajax.net.AjxRpcRequest")){
+AjxRpcRequest=function(e){
+if(!AjxRpcRequest.__inited){
+AjxRpcRequest.__init()
+}
+this.id=e;
+this.__httpReq=AjxRpcRequest.__msxmlVers?(new ActiveXObject(AjxRpcRequest.__msxmlVers)):(new XMLHttpRequest())
+};
+AjxRpcRequest.TIMEDOUT=-1000;
+AjxRpcRequest.__inited=false;
+AjxRpcRequest.__msxmlVers=null;
+AjxRpcRequest.prototype.toString=function(){
+return"AjxRpcRequest"
+};
+AjxRpcRequest.prototype.invoke=function(a,t,s,d,h,r){
+var e=(d!=null);
+this.__httpReq.open((h)?"get":"post",t,e);
+if(e){
+if(r){
+var o=new AjxTimedAction(this,this.__handleTimeout,[d]);
+d._timedActionId=AjxTimedAction.scheduleAction(o,r)
+}
+var c=this;
+this.__httpReq.onreadystatechange=function(u){
+if(window.AjxRpcRequest){
+AjxRpcRequest.__handleResponse(c,d)
+}}
+}else{
+this.__httpReq.onreadystatechange=function(u){}
+}
+if(s){
+for(var n in s){
+this.__httpReq.setRequestHeader(n,s[n])
+}}
+this.__httpReq.send(a);
+if(e){
+return this.id
+}else{
+if(this.__httpReq.status==200||this.__httpReq.status==201){
+return{
+text:this.__httpReq.responseText,xml:this.__httpReq.responseXML,success:true}
+}else{
+return{
+text:this.__httpReq.responseText,xml:this.__httpReq.responseXML,success:false,status:this.__httpReq.status}
+}}};
+
+AjxRpcRequest.prototype.cancel=function(){
+AjxRpc.freeRpcCtxt(this);
+this.__httpReq.abort()
+};
+AjxRpcRequest.prototype.__handleTimeout=function(e){
+this.cancel();
+e.run({
+text:null,xml:null,success:false,status:AjxRpcRequest.TIMEDOUT}
+)
+};
+AjxRpcRequest.__handleResponse=function(a,o){
+if(!a||!a.__httpReq){
+a.cancel();
+o.run({
+text:null,xml:null,success:false,status:500}
+);
+return
+}
+if(a.__httpReq.readyState==4){
+if(o._timedActionId!==null){
+AjxTimedAction.cancelAction(o._timedActionId)
+}
+var e=500;
+try{
+e=a.__httpReq.status
+}
+catch(t){}
+if(e==200||e==201){
+o.run({
+text:a.__httpReq.responseText,xml:a.__httpReq.responseXML,success:true,reqId:a.id}
+)
+}else{
+o.run({
+text:a.__httpReq.responseText,xml:a.__httpReq.responseXML,success:false,status:e,reqId:a.id}
+)
+}
+a.cancel()
+}};
+AjxRpcRequest.__init=function(){
+if(!window.XMLHttpRequest&&window.ActiveXObject){
+var t=["MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];
+for(var o=0;
+o<t.length;
+o++){
+try{
+var e=new ActiveXObject(t[o]);
+AjxRpcRequest.__msxmlVers=t[o];
+break
+}
+catch(a){}}
+if(!AjxRpcRequest.__msxmlVers){
+throw new AjxException("MSXML not installed",AjxException.INTERNAL_ERROR,"AjxRpc._init")
+}}
+AjxRpcRequest.__inited=true
+}
+}
+if(AjxPackage.define("ajax.net.AjxRpc")){
+AjxRpc=function(){};
+AjxRpc.__rpcCache=[];
+AjxRpc.__rpcOutstanding={};
+AjxRpc.__RPC_CACHE_MAX=50;
+AjxRpc.__RPC_COUNT=0;
+AjxRpc.__RPC_REAP_AGE=300000;
+AjxRpc.invoke=function(a,t,s,u,d,c){
+var e=(u!=null);
+var n=AjxRpc.__getFreeRpcCtxt();
+try{
+var o=n.invoke(a,t,s,u,d,c)
+}
+catch(r){
+var h=new AjxException();
+h.method="AjxRpc.prototype._invoke";
+if(r instanceof Error){
+h.detail=r.message;
+h.code=AjxException.NETWORK_ERROR;
+h.msg="Network error"
+}else{
+h.detail=r.toString();
+h.code=AjxException.UNKNOWN_ERROR;
+h.msg="Unknown Error"
+}
+if(!e){
+AjxRpc.freeRpcCtxt(n)
+}
+throw h
+}
+if(!e){
+AjxRpc.freeRpcCtxt(n)
+}
+return o
+};
+AjxRpc.freeRpcCtxt=function(e){
+if(AjxRpc.__rpcOutstanding[e.id]){
+AjxRpc.__rpcCache.push(e);
+delete AjxRpc.__rpcOutstanding[e.id]
+}};
+AjxRpc.getRpcRequestById=function(e){
+return(AjxRpc.__rpcOutstanding[e])
+};
+AjxRpc.__getFreeRpcCtxt=function(){
+var e;
+if(AjxRpc.__rpcCache.length>0){
+e=AjxRpc.__rpcCache.pop()
+}else{
+if(AjxRpc.__RPC_COUNT<AjxRpc.__RPC_CACHE_MAX){
+var t="__RpcCtxt_"+AjxRpc.__RPC_COUNT;
+e=new AjxRpcRequest(t);
+AjxRpc.__RPC_COUNT++
+}else{
+e=AjxRpc.__reap();
+if(!e){
+throw new AjxException("Out of RPC cache",AjxException.OUT_OF_RPC_CACHE,"AjxRpc.__getFreeRpcCtxt")
+}}}
+AjxRpc.__rpcOutstanding[e.id]=e;
+e.timestamp=(new Date()).getTime();
+return e
+};
+AjxRpc.__reap=function(){
+var e;
+var a=(new Date()).getTime();
+for(var t in AjxRpc.__rpcOutstanding){
+e=AjxRpc.__rpcOutstanding[t];
+if(e.timestamp+AjxRpc.__RPC_REAP_AGE<a){
+e.cancel();
+delete AjxRpc.__rpcOutstanding[t];
+return e
+}}
+return null
+}
+}
+if(AjxPackage.define("ajax.util.AjxVector")){
+AjxVector=function(){
+this._array=new Array()
+};
+AjxVector.prototype.toString=function(n,t){
+if(t!==true){
+return this._array.join(n)
+}
+var o=new Array();
+for(var s=0;
+s<this._array.length;
+s++){
+var e=this._array[s];
+if(e!=undefined&&e!=null&&e!=""){
+o.push(e)
+}}
+return o.join(n)
+};
+AjxVector.fromArray=function(t){
+var e=new AjxVector();
+e._array.length=0;
+if(t instanceof Array){
+e._array=t
+}
+return e
+};
+AjxVector.prototype.size=function(){
+return this._array.length
+};
+AjxVector.prototype.add=function(a,e,t){
+if(t&&this.contains(a)){
+return
+}
+AjxUtil.arrayAdd(this._array,a,e)
+};
+AjxVector.prototype.addList=function(a){
+if(!a){
+return
+}
+if(a.length){
+this._array=this._array.concat(a)
+}else{
+if(a.size&&a.size()){
+if(AjxEnv.isIE&&(!(a._array instanceof Array))){
+var t=[];
+for(var e=0;
+e<a._array.length;
+e++){
+t.push(a._array[e])
+}
+a._array=t
+}
+this._array=this._array.concat(a._array)
+}}};
+AjxVector.prototype.remove=function(e){
+return AjxUtil.arrayRemove(this._array,e)
+};
+AjxVector.prototype.removeAt=function(t){
+if(t>=this._array.length||t<0){
+return null
+}
+var a=this._array.splice(t,1);
+var e=null;
+if(a){
+e=a[0]
+}
+return e
+};
+AjxVector.prototype.removeAll=function(){
+for(var e=0;
+e<this._array.length;
+e++){
+this._array[e]=null
+}
+this._array.length=0
+};
+AjxVector.prototype.removeLast=function(){
+return this._array.length>0?this._array.pop():null
+};
+AjxVector.prototype.reverse=function(){
+this._array.reverse()
+};
+AjxVector.prototype.replace=function(a,t){
+var e=this._array[a];
+this._array[a]=t;
+return e
+};
+AjxVector.prototype.replaceObject=function(a,e){
+for(var t=0;
+t<this._array.length;
+t++){
+if(this._array[t]==a){
+this._array[t]=e;
+return a
+}}
+return null
+};
+AjxVector.prototype.indexOf=function(t){
+if(t==null){
+return -1
+}
+for(var e=0;
+e<this._array.length;
+e++){
+if(this._array[e]==t){
+return e
+}}
+return -1
+};
+AjxVector.prototype.indexOfLike=function(o,a){
+var t=a.call(o);
+for(var e=0;
+e<this._array.length;
+e++){
+var n=a.call(this._array[e]);
+if(n==t){
+return e
+}}
+return -1
+};
+AjxVector.prototype.clone=function(){
+var e=new AjxVector();
+e.addList(this);
+return e
+};
+AjxVector.prototype.contains=function(t){
+for(var e=0;
+e<this._array.length;
+e++){
+if(this._array[e]==t){
+return true
+}}
+return false
+};
+AjxVector.prototype.containsLike=function(o,a){
+var t=a.call(o);
+for(var e=0;
+e<this._array.length;
+e++){
+var n=a.call(this._array[e]);
+if(n==t){
+return true
+}}
+return false
+};
+AjxVector.prototype.get=function(e){
+return e>=this._array.length||e<0?null:this._array[e]
+};
+AjxVector.prototype.getArray=function(){
+return this._array
+};
+AjxVector.prototype.getLast=function(){
+return this._array.length==0?null:this._array[this._array.length-1]
+};
+AjxVector.prototype.getNext=function(t){
+var e=this.indexOf(t);
+if(e==-1){
+return null
+}
+return this.get(++e)
+};
+AjxVector.prototype.getPrev=function(t){
+var e=this.indexOf(t);
+if(e==-1){
+return null
+}
+return this.get(--e)
+};
+AjxVector.prototype.sort=function(e){
+if(!e){
+e=AjxVector._defaultArrayComparator
+}
+this._array.sort(e)
+};
+AjxVector.prototype.binarySearch=function(s,r){
+if(!r){
+r=AjxVector._defaultArrayComparator
+}
+var a=0;
+var e=this._array;
+var o=e.length-1;
+while(true){
+if(o<a){
+return -1
+}
+var n=Math.floor((a+o)/2);
+var t=r(s,e[n]);
+if(t<0){
+o=n-1
+}else{
+if(t>0){
+a=n+1
+}else{
+return n
+}}}};
+AjxVector.prototype.merge=function(n,o){
+if(n<0){
+return
+}
+var s=o instanceof AjxVector?o.getArray():o;
+var e=this._array.length<(n+s.length)?this._array.length:n+s.length;
+if(n<this._array.length){
+var a=0;
+for(var t=n;
+t<e;
+t++){
+this._array[t]=s[a++]
+}
+if(a<s.length){
+this._array=this._array.concat(s.slice(a))
+}}else{
+this._array=this._array.concat(s)
+}};
+AjxVector._defaultArrayComparator=function(t,e){
+return t<e?-1:(t>e?1:0)
+};
+AjxVector.prototype.foreach=function(o,n){
+var e=this.size(),t=0,a;
+if(typeof o=="function"){
+while(--e>=0){
+o.call(n,this.get(t),t++)
+}}else{
+while(--e>=0){
+a=this.get(t++);
+if(a!=null){
+a[o].call(a)
+}}}};
+AjxVector.prototype.map=function(n,s){
+var e=[],t=this.size(),o;
+if(typeof n=="function"){
+while(--t>=0){
+e[t]=n.call(s,this.get(t),t)
+}}else{
+if(n instanceof AjxCallback){
+while(--t>=0){
+e[t]=n.run(this.get(t),t)
+}}else{
+while(--t>=0){
+o=this.get(t);
+if(o!=null){
+if(typeof o[n]=="function"){
+e.unshift(o[n].call(o))
+}else{
+e.unshift(o[n])
+}}}}}
+return AjxVector.fromArray(e)
+};
+AjxVector.prototype.join=function(e){
+return this._array.join(e)
+};
+AjxVector.prototype.sub=function(s,r){
+var t=[],e=this.size(),o=0,n;
+while(--e>=0){
+n=this.get(o++);
+if(!s.call(r,n,o)){
+t.push(n)
+}}
+return AjxVector.fromArray(t)
+}
+}
+if(AjxPackage.define("ajax.util.AjxStringUtil")){
+AjxStringUtil=function(){};
+AjxStringUtil.TRIM_RE=/^\s+|\s+$/g;
+AjxStringUtil.COMPRESS_RE=/\s+/g;
+AjxStringUtil.ELLIPSIS=" ... ";
+AjxStringUtil.makeString=function(e){
+return e?String(e):""
+};
+AjxStringUtil.capitalize=function(e){
+return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()
+};
+AjxStringUtil.toMixed=function(s,e,o){
+if(!s||(typeof s!="string")){
+return""
+}
+e=e||/\s+/;
+var a=s.split(e);
+var n=[];
+n.push(o?a[0].toLowerCase():a[0].substring(0,1).toUpperCase()+a[0].substring(1).toLowerCase());
+for(var t=1;
+t<a.length;
+t++){
+n.push(a[t].substring(0,1).toUpperCase()+a[t].substring(1).toLowerCase())
+}
+return n.join("")
+};
+AjxStringUtil.trim=function(n,e,o){
+if(!n){
+return""
+}
+var a=AjxStringUtil.TRIM_RE;
+var t=AjxStringUtil.COMPRESS_RE;
+if(o){
+a=new RegExp("^"+o+"+|"+o+"+$","g");
+t=new RegExp(o+"+","g")
+}else{
+o=" "
+}
+n=n.replace(a,"");
+if(e){
+n=n.replace(t,o)
+}
+return n
+};
+AjxStringUtil.repeat=function(o,e){
+var a="";
+for(var t=0;
+t<e;
+t++){
+a+=o
+}
+return a
+};
+AjxStringUtil.getUnitsFromSizeString=function(t){
+var a="px";
+if(typeof(t)=="string"){
+var e=Number(parseInt(t,10)).toString();
+if(t.length>e.length){
+a=t.substr(e.length,(t.length-e.length));
+if(!(a=="em"||a=="ex"||a=="px"||a=="in"||a=="cm"==a=="mm"||a=="pt"||a=="pc"||a=="%")){
+a="px"
+}}}
+return a
+};
+AjxStringUtil.split=function(d,o){
+if(!d){
+return[]
+}
+var s=0;
+o=o?o:",";
+var m=new Object();
+if(typeof o=="string"){
+m[o]=1
+}else{
+for(s=0;
+s<o.length;
+s++){
+m[o[s]]=1
+}}
+var e=false;
+var a=0;
+var t=0;
+var u;
+var r=[];
+var n=0;
+for(s=0;
+s<d.length;
+s++){
+var h=d.charAt(s);
+if(h=='"'){
+e=!e
+}else{
+if(h=="("){
+a++
+}else{
+if(h==")"){
+a--
+}else{
+if(m[h]){
+if(!e&&!a){
+u=d.substring(t,s);
+r[n++]=u;
+t=s+1
+}}}}}}
+u=d.substring(t,d.length);
+r[n++]=u;
+return r
+};
+AjxStringUtil.wordWrap=function(s){
+if(!(s&&s.text)){
+return""
+}
+var p=s.text;
+var d=s.len||80;
+var n=s.pre||"";
+d-=n.length;
+var u=s.eol||(s.htmlMode?"<br>":"\n");
+if(s.htmlMode){
+var g=p.split(AjxStringUtil.HTML_BR_RE);
+var a=[];
+if(g.length>0){
+for(var r=0;
+r<g.length;
+r++){
+a.push(g[r].replace(/(<div\s+[^>]*>)/gi,"$1"+n))
+}
+p=n+a.join(u+n)
+}
+return p
+}
+var h=[];
+var m=0;
+p=AjxStringUtil.trim(p,false);
+p=p.replace(/[ \t]+\n/g,"\n");
+if(s.compress){
+p=p.replace(/\b\n\b/g," ")
+}
+var f=p.length;
+for(var r=0,o=0,t=-1;
+r<f;
+r++){
+var e=p.charAt(r);
+if(e.match(/[ \t]/)){
+t=r
+}
+if(e=="\n"){
+h[m++]=n+p.substring(o,r);
+o=r+1;
+t=-1
+}
+if(r-o>=d){
+if(t==-1){
+if(s.breakOkay){
+h[m++]=n+p.substring(o,r);
+o=r;
+t=-1
+}}else{
+h[m++]=n+p.substring(o,t);
+o=t+1;
+t=-1
+}}}
+if(r>o){
+h[m++]=n+p.substring(o,r)
+}
+return h.join(u)+u
+};
+AjxStringUtil.IS_PRINT_CODE={};
+var print_codes=[32,48,49,50,51,52,53,54,55,56,57,59,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,96,97,98,99,100,101,102,103,104,105,106,107,109,110,111,186,187,188,189,190,191,192,219,220,221,222];
+var l=print_codes.length;
+for(var i=0;
+i<l;
+i++){
+AjxStringUtil.IS_PRINT_CODE[print_codes[i]]=true
+}
+AjxStringUtil.isPrintKey=function(e){
+return AjxStringUtil.IS_PRINT_CODE[e]
+};
+AjxStringUtil.SHIFT_CHAR={
+48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'};
+AjxStringUtil.shiftChar=function(e,t){
+return t?AjxStringUtil.SHIFT_CHAR[e]||String.fromCharCode(e):String.fromCharCode(e)
+};
+AjxStringUtil.diffPoint=function(o,a){
+if(!(o&&a)){
+return 0
+}
+var e=Math.min(o.length,a.length);
+var t=0;
+while(t<e&&(o.charAt(t)==a.charAt(t))){
+t++
+}
+return t
+};
+AjxStringUtil.resolve=function(t,e){
+return AjxMessageFormat.format(t,e)
+};
+AjxStringUtil.urlEncode=function(t){
+if(!t){
+return""
+}
+var e=window.encodeURL||window.encodeURI;
+return e(t)
+};
+AjxStringUtil.urlComponentEncode=function(t){
+if(!t){
+return""
+}
+var e=window.encodeURLComponent||window.encodeURIComponent;
+return e(t)
+};
+AjxStringUtil.ENCODE_MAP={
+">":"&gt;","<":"&lt;","&":"&amp;"};
+AjxStringUtil.htmlEncode=function(t,e){
+if(!t){
+return""
+}
+if(!AjxEnv.isSafari||AjxEnv.isSafariNightly){
+if(e){
+return t.replace(/[<>&]/g,function(a){
+return AjxStringUtil.ENCODE_MAP[a]
+}
+).replace(/ /g," &nbsp;")
+}else{
+return t.replace(/[<>&]/g,function(a){
+return AjxStringUtil.ENCODE_MAP[a]
+}
+)
+}}else{
+if(e){
+return t.replace(/[&]/g,"&amp;").replace(/ /g," &nbsp;").replace(/[<]/g,"&lt;").replace(/[>]/g,"&gt;")
+}else{
+return t.replace(/[&]/g,"&amp;").replace(/[<]/g,"&lt;").replace(/[>]/g,"&gt;")
+}}};
+AjxStringUtil.htmlDecode=function(t,e){
+if(e){
+t=t.replace(/&nbsp;/g," ")
+}
+return t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")
+};
+AjxStringUtil.stripTags=function(t,e){
+if(!t){
+return""
+}
+if(e){
+t=t.replace(/(<(\w+)[^>]*>).*(<\/\2[^>]*>)/,"$1$3")
+}
+return t.replace(/<\/?[^>]+>/gi,"")
+};
+AjxStringUtil.convertToHtml=function(e){
+if(!e){
+return""
+}
+e=e.replace(/&/mg,"&amp;").replace(/ /mg," &nbsp;").replace(/^ /mg,"&nbsp;").replace(/\t/mg,"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;").replace(/</mg,"&lt;").replace(/>/mg,"&gt;").replace(/\r?\n/mg,"<br>");
+return e
+};
+AjxStringUtil.SPACE_ENCODE_MAP={
+" ":"&nbsp;",">":"&gt;","<":"&lt;","&":"&amp;","\n":"<br>"};
+AjxStringUtil.htmlEncodeSpace=function(e){
+if(!e){
+return""
+}
+return e.replace(/[&]/g,"&amp;").replace(/ /g,"&nbsp;").replace(/[<]/g,"&lt;").replace(/[>]/g,"&gt;")
+};
+AjxStringUtil.nl2br=function(e){
+if(!e){
+return""
+}
+return e.replace(/^ /mg,"&nbsp;").replace(/\t/mg,"<span style='white-space:pre'>\t</span>").replace(/\n/g,"<br>")
+};
+AjxStringUtil.xmlEncode=function(e){
+if(e){
+e=""+e;
+return e.replace(/&/g,"&amp;").replace(/</g,"&lt;")
+}
+return""
+};
+AjxStringUtil.xmlDecode=function(e){
+return e?e.replace(/&amp;/g,"&").replace(/&lt;/g,"<"):""
+};
+AjxStringUtil.xmlAttrEncode=function(e){
+return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\x22/g,"&quot;").replace(/\x27/g,"&apos;"):""
+};
+AjxStringUtil.xmlAttrDecode=function(e){
+return e?e.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&apos;/g,"'"):""
+};
+AjxStringUtil.__RE_META={
+" ":" ","\n":"\\n","\r":"\\r","\t":"\\t"};
+AjxStringUtil.__reMetaEscape=function(t,e){
+return AjxStringUtil.__RE_META[e]||"\\"+e
+};
+AjxStringUtil.regExEscape=function(e){
+return e.replace(/(\W)/g,AjxStringUtil.__reMetaEscape)
+};
+AjxStringUtil._calcDIV=null;
+AjxStringUtil.calcDIV=function(){
+if(AjxStringUtil._calcDIV==null){
+AjxStringUtil._calcDIV=document.createElement("div");
+AjxStringUtil._calcDIV.style.zIndex=0;
+AjxStringUtil._calcDIV.style.position=DwtControl.ABSOLUTE_STYLE;
+AjxStringUtil._calcDIV.style.visibility="hidden";
+document.body.appendChild(AjxStringUtil._calcDIV)
+}
+return AjxStringUtil._calcDIV
+};
+AjxStringUtil.clip=function(e,s,n){
+var o=AjxStringUtil.calcDIV();
+if(arguments.length==3){
+o.className=n
+}
+o.innerHTML=e;
+if(o.offsetWidth<=s){
+return e
+}
+for(var a=e.length-1;
+a>0;
+a--){
+var t=e.substr(0,a);
+o.innerHTML=t+AjxStringUtil.ELLIPSIS;
+if(o.offsetWidth<=s){
+return t+AjxStringUtil.ELLIPSIS
+}}
+return e
+};
+AjxStringUtil.clipByLength=function(a,t){
+var e=a.length;
+return(e<=t)?a:[a.substr(0,t/2),"...",a.substring(e-((t/2)-3),e)].join("")
+};
+AjxStringUtil.wrap=function(s,r,h){
+var f=AjxStringUtil.calcDIV();
+if(arguments.length==3){
+f.className=h
+}
+var c="";
+var n="";
+var e=s.split("/n");
+for(var o=0;
+o<e.length;
+o++){
+if(o!=0){
+c+=n+"<br>";
+n=""
+}
+htmlRows=e[o].split("<br>");
+for(var u=0;
+u<htmlRows.length;
+u++){
+if(u!=0){
+c+=n+"<br>";
+n=""
+}
+words=htmlRows[u].split(" ");
+var m=0;
+while(m<words.length){
+f.innerHTML=n+" "+words[m];
+var a=f.offsetWidth;
+if(a>r){
+f.innerHTML=words[m];
+a=a-f.offsetWidth;
+if((a>=r)||(f.offsetWidth<=r)){
+c+=n+"<br>";
+n=""
+}else{
+var d=true;
+var t=0;
+while(d){
+t++;
+f.innerHTML=n+" "+words[m].substring(0,t);
+d=(f.offsetWidth<=r)
+}
+t--;
+c+=n+words[m].substring(0,t)+"<br>";
+words[m]=words[m].substr(t);
+n=""
+}}else{
+n+=" "+words[m];
+m++
+}}}}
+c+=n;
+return c
+};
+AjxStringUtil.MSG_SEP_RE=new RegExp("^\\s*--+\\s*(Original Message|Forwarded Message)\\s*--+","i");
+AjxStringUtil.SIG_RE=/^(- ?-+)|(__+)\r?$/;
+AjxStringUtil.COLON_RE=/\S+:$/;
+AjxStringUtil.PREFIX_RE=/^\s*(>|\|)/;
+AjxStringUtil.BRACKET_RE=/^\s*\[.+\]\s*$/;
+AjxStringUtil.LINE_RE=/^\s*_{30,}\s*$/;
+AjxStringUtil.BLANK_RE=/^\s*$/;
+AjxStringUtil.SPLIT_RE=/\r|\n|\r\n/;
+AjxStringUtil.HTML_BLANK_RE=/^\s*<br>\s*$/i;
+AjxStringUtil.HDR_RE=/^\s*\w+:/;
+AjxStringUtil.HTML_BR_RE=/<br\s*\/?>/gi;
+AjxStringUtil.HTML_BODY_RE=/<body(\s|>)/i;
+AjxStringUtil.getTopLevel=function(m,h,t){
+var e=/<br|<div/i.test(m);
+var c=e?AjxStringUtil.HTML_BR_RE:AjxStringUtil.SPLIT_RE;
+var h=e?"<br>":"\n";
+m=AjxStringUtil._trimBlankLines(m,c,h,e);
+var f=m.split(c);
+var s=f.length;
+var o=0,a=0;
+var n=[];
+var r=false;
+while(o<s){
+var u=r;
+var d=AjxStringUtil._linesToSkip(f,o,t);
+r=(d>0);
+if(u&&!r){
+a=o
+}else{
+if(!u&&r&&o>a){
+n.push(AjxStringUtil._trimBlankLines(f.slice(a,o).join(h),c,h,t)+h)
+}}
+o+=r?d:1
+}
+if(!r&&o>a){
+n.push(AjxStringUtil._trimBlankLines(f.slice(a,o).join(h),c,h,t)+h)
+}
+return n
+};
+AjxStringUtil._linesToSkip=function(c,a,e){
+var o=c.length;
+var h=0;
+var t=a;
+var d=e?AjxStringUtil.stripTags(c[a]):c[a];
+if(AjxStringUtil.MSG_SEP_RE.test(d)){
+h=o-a
+}else{
+if(AjxStringUtil.PREFIX_RE.test(d)){
+while(a<c.length&&(AjxStringUtil.PREFIX_RE.test(d)||AjxStringUtil.BLANK_RE.test(d))){
+a++;
+d=e?AjxStringUtil.stripTags(c[a]):c[a]
+}
+h=a-t
+}else{
+if(AjxStringUtil.COLON_RE.test(d)){
+var s=AjxStringUtil._nextNonBlankLineIndex(c,a+1,e);
+var r=(s==-1)?null:e?AjxStringUtil.stripTags(c[s]):c[s];
+if(r&&AjxStringUtil.PREFIX_RE.test(r)){
+h=s-a
+}else{
+if(s!=-1){
+s=AjxStringUtil._nextNonBlankLineIndex(c,s+1,e)
+}
+var n=(s==-1)?null:e?AjxStringUtil.stripTags(c[s]):c[s];
+if(n&&AjxStringUtil.BRACKET_RE.test(r)&&AjxStringUtil.PREFIX_RE.test(n)){
+h=s-a
+}}}else{
+if(AjxStringUtil.LINE_RE.test(d)){
+var s=AjxStringUtil._nextNonBlankLineIndex(c,a+1,e);
+var r=(s==-1)?null:e?AjxStringUtil.stripTags(c[s]):c[s];
+if(r&&AjxStringUtil.HDR_RE.test(r)){
+h=o-a
+}}else{
+if(AjxStringUtil.SIG_RE.test(d)){
+h=o-a
+}}}}}
+return h
+};
+AjxStringUtil._nextNonBlankLineIndex=function(e,t,a){
+while(t<e.length&&AjxStringUtil.BLANK_RE.test(a?AjxStringUtil.stripTags(e[t]):e[t])){
+t++
+}
+return((t<e.length)?t:-1)
+};
+AjxStringUtil._trimBlankLines=function(r,s,n,e){
+var c=r.split(s);
+var o=c.length;
+var h=e?AjxStringUtil.HTML_BLANK_RE:AjxStringUtil.BLANK_RE;
+var a=0;
+while(a<o&&h.test(c[a])){
+a++
+}
+var t=o;
+while(t>0&&h.test(c[t-1])){
+t--
+}
+if(a!=0||t!=o){
+r=c.slice(a,t).join(n)+n
+}
+if(e&&AjxStringUtil.HTML_BODY_RE.test(r)){
+r=r.replace(/<body\s*[^>]*>(<br\s*\/?>)+/i,"<body>");
+r=r.replace(/(<br\s*\/?>)+<\/body>/i,"</body>")
+}
+return r
+};
+AjxStringUtil._NO_LIST=0;
+AjxStringUtil._ORDERED_LIST=1;
+AjxStringUtil._UNORDERED_LIST=2;
+AjxStringUtil._INDENT=" ";
+AjxStringUtil._NON_WHITESPACE=/\S+/;
+AjxStringUtil._LF=/\n/;
+AjxStringUtil.convertHtml2Text=function(a){
+if(!a){
+return null
+}
+if(typeof a=="string"){
+var o=document.createElement("SPAN");
+o.innerHTML=a;
+a=o
+}
+var n=[];
+var t=0;
+var e={};
+this._traverse(a,n,t,AjxStringUtil._NO_LIST,0,0,e);
+return n.join("")
+};
+AjxStringUtil._traverse=function(e,m,d,c,r,n,s){
+var h=e.nodeName.toLowerCase();
+if(h=="#text"){
+if(e.nodeValue.search(AjxStringUtil._NON_WHITESPACE)!=-1){
+if(s.lastNode=="ol"||s.lastNode=="ul"){
+m[d++]="\n"
+}
+if(s.isPreformatted){
+m[d++]=AjxStringUtil.trim(e.nodeValue)+" "
+}else{
+m[d++]=AjxStringUtil.trim(e.nodeValue.replace(AjxStringUtil._LF," "),true)+" "
+}}}else{
+if(h=="p"){
+m[d++]="\n\n"
+}else{
+if(c==AjxStringUtil._NO_LIST&&(h=="br"||h=="hr")){
+m[d++]="\n"
+}else{
+if(h=="ol"||h=="ul"){
+m[d++]="\n";
+if(e.parentNode.nodeName.toLowerCase()!="li"&&s.lastNode!="br"&&s.lastNode!="hr"){
+m[d++]="\n"
+}
+c=(h=="ol")?AjxStringUtil._ORDERED_LIST:AjxStringUtil._UNORDERED_LIST;
+r++;
+n=0
+}else{
+if(h=="li"){
+for(var a=0;
+a<r;
+a++){
+m[d++]=AjxStringUtil._INDENT
+}
+if(c==AjxStringUtil._ORDERED_LIST){
+m[d++]=n+". "
+}else{
+m[d++]="\u2022 "
+}}else{
+if(h=="img"){
+if(e.alt&&e.alt!=""){
+m[d++]=e.alt
+}}else{
+if(h=="tr"&&e.parentNode.firstChild!=e){
+m[d++]="\n"
+}else{
+if(h=="td"&&e.parentNode.firstChild!=e){
+m[d++]="\t"
+}else{
+if(h=="div"){
+m[d++]="\n"
+}else{
+if(h=="blockquote"){
+m[d++]="\n\n"
+}else{
+if(h=="pre"){
+s.isPreformatted=true
+}else{
+if(h=="#comment"||h=="script"||h=="select"||h=="style"){
+return d
+}}}}}}}}}}}}
+var u=e.childNodes;
+var o=u.length;
+for(var a=0;
+a<o;
+a++){
+var t=u[a];
+if(t.nodeType==1&&t.tagName.toLowerCase()=="li"){
+n++
+}
+d=this._traverse(t,m,d,c,r,n,s)
+}
+if(h=="h1"||h=="h2"||h=="h3"||h=="h4"||h=="h5"||h=="h6"){
+m[d++]="\n";
+s.list=false
+}else{
+if(h=="pre"){
+s.isPreformatted=false
+}else{
+if(h=="li"){
+if(!s.list){
+m[d++]="\n"
+}
+s.list=false
+}else{
+if(h=="ol"||h=="ul"){
+s.list=true
+}else{
+if(h!="#text"){
+s.list=false
+}}}}}
+s.lastNode=h;
+return d
+};
+AjxStringUtil.queryStringSet=function(r,c){
+var h=c?"":location.search;
+if(h.indexOf("?")==0){
+h=h.substr(1)
+}
+var s=h.split("&");
+var a={};
+for(var o=0;
+o<s.length;
+o++){
+var n=s[o].split("=");
+a[n[0]]=n[1]
+}
+for(var e in r){
+a[e]=r[e]
+}
+var t=[];
+var o=0;
+for(var e in a){
+if(e){
+t[o++]=[e,a[e]].join("=")
+}}
+return"?"+t.join("&")
+};
+AjxStringUtil.queryStringRemove=function(e,a){
+e=e?e:"";
+if(e.indexOf("?")==0){
+e=e.substr(1)
+}
+var n=e.split("&");
+var t=[];
+for(var o=0;
+o<n.length;
+o++){
+if(n[o].indexOf(a)!=0){
+t.push(n[o])
+}}
+return"?"+t.join("&")
+};
+AjxStringUtil.getAsString=function(e){
+return !e?"":(typeof(e)=="object")?e.toString():e
+};
+AjxStringUtil.isWhitespace=function(e){
+return(e.charCodeAt(0)<=32)
+};
+AjxStringUtil.isDigit=function(t){
+var e=t.charCodeAt(0);
+return(e>=48&&e<=57)
+};
+AjxStringUtil.compareRight=function(n,t){
+var s=0;
+var h=0;
+var r=0;
+var o;
+var e;
+for(;
+(h<n.length||r<t.length);
+h++,r++){
+o=n.charAt(h);
+e=t.charAt(r);
+if(!AjxStringUtil.isDigit(o)&&!AjxStringUtil.isDigit(e)){
+return s
+}else{
+if(!AjxStringUtil.isDigit(o)){
+return -1
+}else{
+if(!AjxStringUtil.isDigit(e)){
+return +1
+}else{
+if(o<e){
+if(s==0){
+s=-1
+}}else{
+if(o>e){
+if(s==0){
+s=+1
+}}}}}}}};
+AjxStringUtil.natCompare=function(c,h){
+var r=0,n=0;
+var t=0,e=0;
+var s,o;
+while(r<c.length||n<h.length){
+t=e=0;
+s=c.charAt(r);
+o=h.charAt(n);
+while(AjxStringUtil.isWhitespace(s)||s=="0"){
+t=(s=="0")?(t+1):0;
+s=c.charAt(++r)
+}
+while(AjxStringUtil.isWhitespace(o)||o=="0"){
+e=(o=="0")?(e+1):0;
+o=h.charAt(++n)
+}
+if(AjxStringUtil.isDigit(s)&&AjxStringUtil.isDigit(o)){
+var d=AjxStringUtil.compareRight(c.substring(r),h.substring(n));
+if(d&&d!=0){
+return d
+}}
+if(s==0&&o==0){
+return t-e
+}
+if(s<o){
+return -1
+}else{
+if(s>o){
+return +1
+}}
+++r;
+++n
+}};
+AjxStringUtil.clipFile=function(s,t){
+var a=s.lastIndexOf(".");
+var e=a?(a+1):s.length;
+if(e<=t){
+return s
+}else{
+var n=s.substr(0,a);
+var o=s.substr(a+1,s.length-1);
+return[n.substr(0,t/2),"...",n.substring(e-((t/2)-3),e),".",(o?o:"")].join("")
+}};
+AjxStringUtil.URL_PARSE_RE=new RegExp("^(?:([^:/?#.]+):)?(?://)?(([^:/?#]*)(?::(\\d*))?)?((/(?:[^?#](?![^?#/]*\\.[^?#/.]+(?:[\\?#]|$)))*/?)?([^?#/]*))?(?:\\?([^#]*))?(?:#(.*))?");
+AjxStringUtil.parseURL=function(a){
+var n=["source","protocol","authority","domain","port","path","directoryPath","fileName","query","anchor"];
+var o=AjxStringUtil.URL_PARSE_RE.exec(a);
+var t={};
+for(var e=0;
+e<n.length;
+e++){
+t[n[e]]=(o[e]?o[e]:"")
+}
+if(t.directoryPath.length>0){
+t.directoryPath=t.directoryPath.replace(/\/?$/,"/")
+}
+return t
+};
+AjxStringUtil.parseQueryString=function(s){
+var a=s||(""+window.location);
+var t=a.indexOf("?");
+if(t==-1){
+return null
+}
+var e=a.substring(t+1).replace(/#.*$/,"");
+var n=e.split("&");
+var h={};
+for(var o=0;
+o<n.length;
+o++){
+var r=n[o].split("=");
+h[r[0]]=r[1]
+}
+return h
+};
+AjxStringUtil._SPECIAL_CHARS=/["\\\x00-\x1f]/g;
+AjxStringUtil._CHARS={
+"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};
+AjxStringUtil.objToString=function(n){
+var p=typeof n,h,c,r,s,m,f,d,e=[];
+var u=function(o){
+if(!AjxStringUtil._CHARS[o]){
+var t=o.charCodeAt();
+AjxStringUtil._CHARS[o]="\\u00"+Math.floor(t/16).toString(16)+(t%16).toString(16)
+}
+return AjxStringUtil._CHARS[o]
+};
+var g=function(t){
+return'"'+t.replace(AjxStringUtil._SPECIAL_CHARS,u)+'"'
+};
+if(p==="string"){
+return g(n)
+}
+if(p==="boolean"||n instanceof Boolean){
+return String(n)
+}
+if(p==="number"||n instanceof Number){
+return isFinite(n)?String(n):"null"
+}
+if(AjxUtil.isArray(n)||(p==="object"&&n.length)){
+for(h=e.length-1;
+h>=0;
+--h){
+if(e[h]===n){
+return"null"
+}}
+e[e.length]=n;
+d=[];
+for(h=n.length-1;
+h>=0;
+--h){
+d[h]=AjxStringUtil.objToString(n[h])
+}
+e.pop();
+return"["+d.join(",")+"]"
+}
+if(p==="object"&&n){
+for(h=e.length-1;
+h>=0;
+--h){
+if(e[h]===n){
+return"null"
+}}
+e[e.length]=n;
+d=[];
+r=0;
+for(s in n){
+if(typeof s==="string"&&n.hasOwnProperty(s)){
+m=n[s];
+f=typeof m;
+if(f!=="undefined"&&f!=="function"){
+d[r++]=g(s)+":"+AjxStringUtil.objToString(m)
+}}}
+e.pop();
+return"{"+d.join(",")+"}"
+}
+return"null"
+};
+AjxStringUtil.prettyPrint=function(o,a,e,t){
+AjxStringUtil._visited=new AjxVector();
+var n=AjxStringUtil._prettyPrint(o,a,e,t);
+AjxStringUtil._visited=null;
+return n
+};
+AjxStringUtil._visited=null;
+AjxStringUtil._prettyPrint=function(r,e,u,t){
+var p=0;
+var n=false;
+var w=false;
+if(arguments.length>4){
+p=arguments[4];
+n=arguments[5];
+w=arguments[6]
+}
+if(AjxUtil.isObject(r)){
+var d=r.toString();
+if(t&&t[d]){
+return"["+d+"]"
+}
+if(AjxStringUtil._visited.contains(r)){
+return"[visited object]"
+}else{
+AjxStringUtil._visited.add(r)
+}}
+var a=AjxStringUtil.repeat(" ",p);
+var g="";
+if(r===undefined){
+g+="[undefined]"
+}else{
+if(r===null){
+g+="[null]"
+}else{
+if(AjxUtil.isBoolean(r)){
+g+=r?"true":"false"
+}else{
+if(AjxUtil.isString(r)){
+g+='"'+AjxStringUtil._escapeForHTML(r)+'"'
+}else{
+if(AjxUtil.isNumber(r)){
+g+=r
+}else{
+if(AjxUtil.isObject(r)){
+var h=AjxUtil.isArray(r);
+if(w){
+g+=h?"[Array]":r.toString()
+}else{
+w=!e;
+var y=new Array();
+for(var s in r){
+y.push(s)
+}
+if(h){
+y.sort(function(k,v){
+return k-v
+}
+)
+}else{
+y.sort()
+}
+if(n){
+g+=h?"[":"{"
+}
+var c=y.length;
+for(var s=0;
+s<c;
+s++){
+var f=y[s];
+var o=r[f];
+var m=null;
+if(o==window||o==document||(!AjxEnv.isIE&&o instanceof Node)){
+m=o.toString()
+}
+if((typeof(o)=="function")){
+if(u){
+m="[function]"
+}else{
+continue
+}}
+if(s>0){
+g+=","
+}
+g+="\n"+a;
+if(m!=null){
+g+=f+": "+m
+}else{
+g+=f+": "+this._prettyPrint(o,e,u,t,p+2,true,w)
+}}
+if(s>0){
+g+="\n"+AjxStringUtil.repeat(" ",p-1)
+}
+if(n){
+g+=h?"]":"}"
+}}}}}}}}
+return g
+};
+AjxStringUtil._escapeForHTML=function(t){
+if(typeof(t)!="string"){
+return t
+}
+var e=t;
+e=e.replace(/\&/g,"&amp;");
+e=e.replace(/\</g,"&lt;");
+e=e.replace(/\>/g,"&gt;");
+e=e.replace(/\"/g,"&quot;");
+e=e.replace(/\xA0/g,"&nbsp;");
+return e
+}
+}
+if(AjxPackage.define("ajax.xml.AjxXmlDoc")){
+AjxXmlDoc=function(){
+if(!AjxXmlDoc._inited){
+AjxXmlDoc._init()
+}};
+AjxXmlDoc.prototype.toString=function(){
+return"AjxXmlDoc"
+};
+AjxXmlDoc.INVALID_CHARS_RE=/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/g;
+AjxXmlDoc.REC_AVOID_CHARS_RE=/[\u007F-\u0084\u0086-\u009F\uFDD0-\uFDDF]/g;
+AjxXmlDoc._inited=false;
+AjxXmlDoc._msxmlVers=null;
+AjxXmlDoc.create=function(){
+var t=new AjxXmlDoc();
+var e=null;
+if(AjxEnv.isIE){
+e=new ActiveXObject(AjxXmlDoc._msxmlVers);
+e.async=true;
+if(AjxXmlDoc._msxmlVers=="MSXML2.DOMDocument.4.0"){
+e.setProperty("SelectionLanguage","XPath");
+e.setProperty("SelectionNamespaces","xmlns:zimbra='urn:zimbra' xmlns:mail='urn:zimbraMail' xmlns:account='urn:zimbraAccount'")
+}}else{
+if(document.implementation&&document.implementation.createDocument){
+e=document.implementation.createDocument("","",null)
+}else{
+throw new AjxException("Unable to create new Doc",AjxException.INTERNAL_ERROR,"AjxXmlDoc.create")
+}}
+t._doc=e;
+return t
+};
+AjxXmlDoc.createFromDom=function(t){
+var e=new AjxXmlDoc();
+e._doc=t;
+return e
+};
+AjxXmlDoc.createFromXml=function(e){
+var t=AjxXmlDoc.create();
+t.loadFromString(e);
+return t
+};
+AjxXmlDoc.replaceInvalidChars=function(e){
+AjxXmlDoc.INVALID_CHARS_RE.lastIndex=0;
+return e.replace(AjxXmlDoc.INVALID_CHARS_RE,"?")
+};
+AjxXmlDoc.getXml=function(t){
+var e=new XMLSerializer();
+return AjxXmlDoc.replaceInvalidChars(e.serializeToString(t))
+};
+AjxXmlDoc.prototype.getDoc=function(){
+return this._doc
+};
+AjxXmlDoc.prototype.loadFromString=function(t){
+var e=this._doc;
+e.loadXML(t);
+if(AjxEnv.isIE){
+if(e.parseError.errorCode!=0){
+throw new AjxException(e.parseError.reason,AjxException.INVALID_PARAM,"AjxXmlDoc.loadFromString")
+}}};
+AjxXmlDoc.prototype.loadFromUrl=function(e){
+this._doc.load(e)
+};
+AjxXmlDoc.prototype.toJSObject=function(a,t,e){
+_node=function(){
+this.__msh_content=""
+};
+_node.prototype.toString=function(){
+return this.__msh_content
+};
+rec=function(c,d){
+var r={}
+,h,u;
+for(c=c.firstChild;
+c;
+c=c.nextSibling){
+if(c.nodeType==1){
+h=c.tagName;
+if(a){
+h=h.replace(/^.*?:/,"")
+}
+if(t){
+h=h.toLowerCase()
+}
+u=new _node();
+if(r[h]){
+if(r[h]==1){
+d[h]=[d[h]];
+r[h]=2
+}
+d[h].push(u)
+}else{
+d[h]=u;
+r[h]=1
+}
+if(e){
+if(c.attributes&&c.attributes.length){
+for(var s=0;
+s<c.attributes.length;
+s++){
+attr=c.attributes[s];
+u[attr.name]=AjxUtil.isNumeric(attr.value)?attr.value:String(attr.value)
+}}}
+rec(c,u)
+}else{
+if(c.nodeType==3){
+d.__msh_content+=c.nodeValue
+}}}};
+var n=new _node();
+rec(this._doc.documentElement,n);
+return n
+};
+AjxXmlDoc.prototype.getElementsByTagNameNS=function(t,e){
+var a=this.getDoc();
+return AjxEnv.isIE?a.getElementsByTagName(t+":"+e):a.getElementsByTagNameNS(t,e)
+};
+AjxXmlDoc.prototype.getFirstElementByTagNameNS=function(t,e){
+return this.getElementsByTagNameNS(t,e)[0]
+};
+AjxXmlDoc.prototype.getElementsByTagName=function(e){
+var t=this.getDoc();
+return t.getElementsByTagName(e)
+};
+AjxXmlDoc._init=function(){
+if(AjxEnv.isIE){
+var e=["MSXML4.DOMDocument","MSXML3.DOMDocument","MSXML2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XmlDom"];
+for(var a=0;
+a<e.length;
+a++){
+try{
+new ActiveXObject(e[a]);
+AjxXmlDoc._msxmlVers=e[a];
+break
+}
+catch(t){}}
+if(!AjxXmlDoc._msxmlVers){
+throw new AjxException("MSXML not installed",AjxException.INTERNAL_ERROR,"AjxXmlDoc._init")
+}}else{
+if(AjxEnv.isNav||AjxEnv.isOpera||AjxEnv.isSafari){
+Document.prototype.loadXML=function(c){
+var h=new DOMParser();
+var n=h.parseFromString(c,"text/xml");
+while(this.hasChildNodes()){
+this.removeChild(this.lastChild)
+}
+var o=n.childNodes.length;
+for(var s=0;
+s<o;
+s++){
+var r=this.importNode(n.childNodes[s],true);
+this.appendChild(r)
+}};
+if(AjxEnv.isNav){
+_NodeGetXml=function(){
+var o=new XMLSerializer();
+return o.serializeToString(this)
+};
+Node.prototype.__defineGetter__("xml",_NodeGetXml)
+}}}
+AjxXmlDoc._inited=true
+};
+AjxXmlDoc.prototype.set=function(e,o,t){
+var n=this._doc.createElement(e);
+if(o!=null){
+var a=this._doc.createTextNode("");
+n.appendChild(a);
+a.nodeValue=o
+}
+if(t==null){
+this.root.appendChild(n)
+}else{
+t.appendChild(n)
+}
+return n
+};
+AjxXmlDoc.prototype.getDocXml=function(){
+if(AjxEnv.isSafari){
+return AjxXmlDoc.getXml(this.getDoc())
+}else{
+return AjxXmlDoc.replaceInvalidChars(this.getDoc().xml)
+}};
+AjxXmlDoc.createRoot=function(a){
+var e=AjxXmlDoc.create();
+var t=e.getDoc();
+e.root=t.createElement(a);
+t.appendChild(e.root);
+return e
+};
+AjxXmlDoc.createElement=function(t,o){
+var e=AjxXmlDoc.create();
+var n=e.getDoc();
+e.root=n.createElement(t);
+if(o!=null){
+var a=n.createTextNode("");
+e.root.appendChild(a);
+a.nodeValue=o
+}
+n.appendChild(e.root);
+return e
+};
+AjxXmlDoc.prototype.appendChild=function(e){
+this.root.appendChild(e.root)
+}
+}
+if(AjxPackage.define("ajax.core.AjxImg")){
+AjxImg=function(){};
+AjxImg.prototype=new Object;
+AjxImg.prototype.constructor=null;
+AjxImg._VIEWPORT_ID="AjxImg_VP";
+AjxImg.DISABLED=true;
+AjxImg.RE_COLOR=/^(.*?),color=(.*)$/;
+AjxImg.setImage=function(a,g,f,o){
+var u,c=g.match(AjxImg.RE_COLOR);
+if(c){
+g=c&&c[1];
+u=c&&c[2]
+}
+var e=AjxImg.getClassForImage(g,o);
+if(f){
+a.className=e;
+return
+}
+var w=e+"Overlay";
+var n=e+"Mask";
+if(u&&window.AjxImgData&&AjxImgData[w]&&AjxImgData[n]){
+u=(u.match(/^\d$/)?ZmOrganizer.COLOR_VALUES[u]:u)||ZmOrganizer.COLOR_VALUES[ZmOrganizer.ORG_DEFAULT_COLOR];
+var y=AjxImgData[w],p=AjxImgData[n];
+if(AjxEnv.isIE){
+var v="";
+var s=["width:",y.w,";","height:",y.h,";"].join("");
+var k=["top:",p.t,";","left:",p.l,";"].join("");
+if(typeof document.documentMode!="undefined"){
+v=["clip:rect(",(-1*p.t)-1,"px, ",y.w-1,"px, ",(p.t*-1)+y.h-1,"px, ",y.l,"px);"].join("")
+}
+a.innerHTML=["<div style='position:relative;",s,"'>","<div style='overflow:hidden;position:relative;",s,"'>","<img src='",p.f,"' ","style='filter:mask(color=",u,");position:absolute;",k,v,"'>","</div>","<div class='",w,"' style='",s,";position:absolute;top:0;left:0'></div>","</div>"].join("");
+return
+}
+if(!y[u]){
+var h=y.w,r=y.h;
+var t=document.createElement("CANVAS");
+t.width=h;
+t.height=r;
+var d=t.getContext("2d");
+d.save();
+d.clearRect(0,0,h,r);
+d.save();
+d.drawImage(document.getElementById(n),p.l,p.t);
+d.globalCompositeOperation="source-out";
+d.fillStyle=u;
+d.fillRect(0,0,h,r);
+d.restore();
+d.drawImage(document.getElementById(w),y.l,y.t);
+d.restore();
+y[u]=t.toDataURL()
+}
+a.innerHTML=["<img src='",y[u],"'>"].join("");
+return
+}
+if(a.firstChild==null){
+a.innerHTML=e?"<div class='"+e+"'></div>":"<div></div>";
+return
+}
+a.firstChild.className=e
+};
+AjxImg.setDisabledImage=function(t,a,e){
+return AjxImg.setImage(t,a,e,true)
+};
+AjxImg.getClassForImage=function(a,t){
+var e="Img"+a;
+if(t){
+e+=" ZDisabledImage"
+}
+return e
+};
+AjxImg.getImageClass=function(e){
+return e.firstChild?e.firstChild.className:e.className
+};
+AjxImg.getImageElement=function(e){
+return e.firstChild?e.firstChild:e
+};
+AjxImg.getParentElement=function(e){
+return e.parentNode
+};
+AjxImg.getImageHtml=function(o,s,e,a){
+e=e||"";
+s=s?(["style='",s,"' "].join("")):"";
+var n=a?"<table style='display:inline' cellpadding=0 cellspacing=0 border=0><tr><td align=center valign=bottom>":"";
+var t=a?"</td></tr></table>":"";
+if(o){
+return[n,"<div class='","Img",o,"' ",s," ",e,"></div>",t].join("")
+}
+return[n,"<div ",s," ",e,"></div>",t].join("")
+};
+AjxImg.getImageSpanHtml=function(s,r,e,t){
+var n=AjxImg.getClassForImage(s);
+var o=[];
+var a=0;
+o[a++]="<span style='white-space:nowrap'>";
+o[a++]="<span class='";
+o[a++]=n;
+o[a++]=" inlineIcon'";
+o[a++]=r?([" style='",r,"' "].join("")):"";
+o[a++]=e?([" ",e].join("")):"";
+o[a++]=">&nbsp;&nbsp;&nbsp;</span>";
+o[a++]=(t||"");
+o[a++]="</span>";
+return o.join("")
+}
+}
+if(AjxPackage.define("ajax.core.AjxColor")){
+AjxColor=function(a,t,e){
+if(arguments.length==0){
+return
+}
+this.r=a;
+this.g=t;
+this.b=e
+};
+AjxColor.prototype.toString=function(){
+return AjxColor.color(this.r,this.g,this.b)
+};
+AjxColor.components=function(t){
+var e=AjxColor.__RE.exec(t);
+return e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:null
+};
+AjxColor.color=function(a,t,e){
+return["#",AjxColor.__pad(Number(Math.round(a)).toString(16),2),AjxColor.__pad(Number(Math.round(t)).toString(16),2),AjxColor.__pad(Number(Math.round(e)).toString(16),2)].join("")
+};
+AjxColor.lighten=function(e,a){
+var t=AjxColor.components(e);
+return t?AjxColor.color(AjxColor.__lighten(t[0],a),AjxColor.__lighten(t[1],a),AjxColor.__lighten(t[2],a)):""
+};
+AjxColor.darken=function(e,a){
+var t=AjxColor.components(e);
+return t?AjxColor.color(AjxColor.__darken(t[0],a),AjxColor.__darken(t[1],a),AjxColor.__darken(t[2],a)):""
+};
+AjxColor.deepen=function(e,a){
+var s=AjxColor.components(e);
+var t=0;
+for(var o=1;
+o<s.length;
+o++){
+if(s[o]>s[t]){
+t=o
+}}
+for(var o=0;
+o<s.length;
+o++){
+var n=s[o]/s[t];
+s[o]=Math.floor(s[o]*n*(a||1))
+}
+return AjxColor.color(s[0],s[1],s[2])
+};
+AjxColor.__RE=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i;
+AjxColor.__pad=function(n,a,o){
+if(!o){
+o="0"
+}
+var t=String(n);
+for(var e=t.length;
+e<a;
+e++){
+t=o+t
+}
+return t
+};
+AjxColor.__lighten=function(e,t){
+return Math.max(0,Math.min(255,e+(255-e)*t))
+};
+AjxColor.__darken=function(e,t){
+return Math.max(0,Math.min(255,e+(1-e)*t))
+}
+}
+if(AjxPackage.define("ajax.events.AjxEvent")){
+AjxEvent=function(){
+this.data=null
+};
+AjxEvent.HISTORY="HISTORY";
+AjxEvent.prototype.toString=function(){
+return"AjxEvent"
+}
+}
+if(AjxPackage.define("ajax.events.AjxEventMgr")){
+AjxEventMgr=function(){
+this._listeners=new Object()
+};
+AjxEventMgr.prototype.toString=function(){
+return"AjxEventMgr"
+};
+AjxEventMgr.prototype.addListener=function(t,a,e){
+var o=this._listeners[t];
+if(o==null){
+o=this._listeners[t]=new AjxVector()
+}
+if(!o.contains(a)){
+if(this._notifyingListeners){
+o=this._listeners[t]=o.clone()
+}
+o.add(a,e);
+return true
+}
+return false
+};
+AjxEventMgr.prototype.notifyListeners=function(o,r){
+this._notifyingListeners=true;
+var d=this._listeners[o];
+if(d!=null){
+var e=d.getArray();
+var n=d.size();
+var h=null;
+var u=null;
+for(var t=0;
+t<n;
+t++){
+u=e[t];
+if(!(u&&((u instanceof AjxListener)||(typeof u=="function")))){
+continue
+}
+h=u.handleEvent?u.handleEvent(r):u(r);
+if(h===false){
+break
+}}}
+this._notifyingListeners=false;
+return h
+};
+AjxEventMgr.prototype.isListenerRegistered=function(e){
+var t=this._listeners[e];
+return(t!=null&&t.size()>0)
+};
+AjxEventMgr.prototype.removeListener=function(e,t){
+var a=this._listeners[e];
+if(a!=null){
+if(this._notifyingListeners){
+a=this._listeners[e]=a.clone()
+}
+a.remove(t);
+return true
+}
+return false
+};
+AjxEventMgr.prototype.removeAll=function(e){
+var t=this._listeners[e];
+if(t!=null){
+if(this._notifyingListeners){
+t=this._listeners[e]=t.clone()
+}
+t.removeAll();
+return true
+}
+return false
+}
+}
+if(AjxPackage.define("ajax.util.AjxTimedAction")){
+AjxTimedAction=function(a,t,e){
+AjxCallback.call(this,a,t,e);
+this._tid=-1;
+this._id=-1;
+this._runResult=null
+};
+AjxTimedAction.prototype=new AjxCallback();
+AjxTimedAction.prototype.constructor=AjxTimedAction;
+AjxTimedAction.MAX_TIMEOUT=20*24*60*60*1000;
+AjxTimedAction.prototype.toString=function(){
+return"AjxTimedAction"
+};
+AjxTimedAction.prototype.getRunResult=function(){
+return this._runResult
+};
+AjxTimedAction._pendingActions={};
+AjxTimedAction._nextActionId=1;
+AjxTimedAction.scheduleAction=function(a,t){
+if(!a){
+return
+}
+if(a._tid&&a._tid!=-1){
+AjxTimedAction.cancelAction(a._id)
+}
+t=t||0;
+if(t>AjxTimedAction.MAX_TIMEOUT){
+if(window.DBG){}
+t=AjxTimedAction.MAX_TIMEOUT
+}
+var o=a._id=AjxTimedAction._nextActionId++;
+AjxTimedAction._pendingActions[o]=a;
+var e="AjxTimedAction._exec("+o+")";
+a._tid=window.setTimeout(e,t);
+return a._id
+};
+AjxTimedAction.cancelAction=function(t){
+var e=AjxTimedAction._pendingActions[t];
+if(e){
+window.clearTimeout(e._tid);
+delete AjxTimedAction._pendingActions[t];
+delete e._tid
+}};
+AjxTimedAction._exec=function(t){
+var e=AjxTimedAction._pendingActions[t];
+if(e){
+delete AjxTimedAction._pendingActions[t];
+delete e._tid;
+e._runResult=e.run()
+}}
+}
+if(AjxPackage.define("ajax.net.AjxInclude")){
+AjxInclude=function(o,s,n,a){
+var t=document.getElementsByTagName("head")[0];
+function e(h){
+if(AjxEnv.isIE&&h&&!/loaded|complete/.test(h.readyState)){
+return
+}
+if(h){
+h[AjxInclude.eventName]=null
+}
+var r=AjxInclude.dwhack_scripts.length>0?AjxInclude.dwhack_scripts:o;
+window.status="";
+if(r.length>0){
+var d=r.shift();
+var u=d;
+if(!/^((https?|ftps?):\x2f\x2f|\x2f)/.test(d)){
+if(s){
+d=s+d
+}
+if(cacheKillerVersion){
+d+="?v="+cacheKillerVersion
+}}else{
+if(a&&d.indexOf("/")!=0){
+d=a+AjxStringUtil.urlEncode(d)
+}}
+var h=document.createElement("script");
+var c=AjxCallback.simpleClosure(e,null,h);
+if(AjxEnv.isIE){
+h.attachEvent("onreadystatechange",c);
+h.attachEvent("onerror",c)
+}else{
+h.addEventListener("load",c,true);
+h.addEventListener("error",c,true)
+}
+h.type="text/javascript";
+h.src=d;
+window.status="Loading script: "+u;
+t.appendChild(h)
+}else{
+if(o.length==0){
+h=null;
+t=null;
+if(n){
+n.run()
+}}}}
+e(null)
+};
+AjxInclude.dwhack_scripts=[];
+document.write=document.writeln=function(){
+var e=[];
+for(var t=0;
+t<arguments.length;
+++t){
+e[t]=arguments[t]
+}
+var o=e.join("");
+if(/<script[^>]+src=([\x22\x27])(.*?)\1/i.test(o)){
+AjxInclude.dwhack_scripts.push(RegExp.$2)
+}};
+if(AjxEnv.isIE){
+AjxInclude._removeWriteln=function(){
+document.write=document.writeln=null;
+window.detachEvent("onunload",AjxInclude._removeWriteln)
+};
+window.attachEvent("onunload",AjxInclude._removeWriteln)
+}}
+
+if(AjxPackage.define("ajax.events.AjxListener")){
+AjxListener=function(t,a,e){
+AjxCallback.call(this,t,a,e)
+};
+AjxListener.prototype=new AjxCallback();
+AjxListener.prototype.constructor=AjxListener;
+AjxListener.prototype.toString=function(){
+return"AjxListener"
+};
+AjxListener.prototype.handleEvent=function(e){
+return this.run(e)
+}
+}
+if(AjxPackage.define("ajax.util.AjxText")){
+AjxFormat=function(e){
+this._pattern=e;
+this._segments=[]
+};
+AjxFormat.prototype.toString=function(){
+var t=[];
+t.push('pattern="',this._pattern,'"');
+if(this._segments.length>0){
+t.push(", segments={ ");
+for(var e=0;
+e<this._segments.length;
+e++){
+if(e>0){
+t.push(", ")
+}
+t.push(String(this._segments[e]))
+}
+t.push(" }")
+}
+return t.join("")
+};
+AjxFormat.prototype._pattern;
+AjxFormat.prototype._segments;
+AjxFormat.initialize=function(){
+AjxDateFormat.initialize();
+AjxNumberFormat.initialize()
+};
+AjxFormat.prototype.format=function(e){
+var a=[];
+for(var t=0;
+t<this._segments.length;
+t++){
+a.push(this._segments[t].format(e))
+}
+return a.join("")
+};
+AjxFormat.prototype.parse=function(o){
+var t=this._createParseObject();
+var e=0;
+for(var a=0;
+a<this._segments.length;
+a++){
+var n=this._segments[a];
+e=n.parse(t,o,e)
+}
+if(e<o.length){
+throw new AjxFormat.ParsingException(this,null,"input too long")
+}
+return t
+};
+AjxFormat.prototype.getSegments=function(){
+return this._segments
+};
+AjxFormat.prototype.toPattern=function(){
+return this._pattern
+};
+AjxFormat.prototype.clone=function(){
+return new this.constructor(this._pattern)
+};
+AjxFormat.prototype._createParseObject=function(e){
+throw new AjxFormat.ParsingException(this,null,"not implemented")
+};
+AjxFormat._zeroPad=function(n,r,t,h){
+n=typeof n=="string"?n:String(n);
+if(n.length>=r){
+return n
+}
+t=t||"0";
+var e=[];
+for(var o=n.length;
+o<r;
+o++){
+e.push(t)
+}
+e[h?"unshift":"push"](n);
+return e.join("")
+};
+AjxFormat.FormatException=function(t,e){
+this._format=t;
+this._message=e
+};
+AjxFormat.FormatException.prototype.toString=function(){
+return this._message
+};
+AjxFormat.FormatException.prototype._format;
+AjxFormat.FormatException.prototype._message;
+AjxFormat.FormattingException=function(a,t,e){
+AjxFormat.FormatException.call(this,a,e);
+this._segment=t
+};
+AjxFormat.FormattingException.prototype=new AjxFormat.FormatException;
+AjxFormat.FormattingException.prototype.constructor=AjxFormat.FormattingException;
+AjxFormat.FormattingException.prototype._segment;
+AjxFormat.ParsingException=function(a,t,e){
+AjxFormat.FormatException.call(this,a,e);
+this._segment=t
+};
+AjxFormat.ParsingException.prototype=new AjxFormat.FormatException;
+AjxFormat.ParsingException.prototype.constructor=AjxFormat.ParsingException;
+AjxFormat.ParsingException.prototype._segment;
+AjxFormat.Segment=function(t,e){
+this._parent=t;
+this._s=e
+};
+AjxFormat.Segment.prototype.toString=function(){
+return'segment: "'+this._s+'"'
+};
+AjxFormat.Segment.prototype._parent;
+AjxFormat.Segment.prototype._s;
+AjxFormat.Segment.prototype.format=function(e){
+return this._s
+};
+AjxFormat.Segment.prototype.parse=function(a,t,e){
+throw new AjxFormat.ParsingException(this._parent,this,"not implemented")
+};
+AjxFormat.Segment.prototype.getFormat=function(){
+return this._parent
+};
+AjxFormat.Segment.prototype.toSubPattern=function(){
+return this._s
+};
+AjxFormat.Segment.prototype._getFixedLength=function(){
+var e;
+if(this._index+1<this._parent._segments.length){
+var t=this._parent._segments[this._index+1];
+if(!(t instanceof AjxFormat.TextSegment)){
+e=this._s.length
+}}
+return e
+};
+AjxFormat.Segment._parseLiteral=function(o,a,e){
+if(a.length-e<o.length){
+throw new AjxFormat.ParsingException(this._parent,this,"input too short")
+}
+for(var t=0;
+t<o.length;
+t++){
+if(o.charAt(t)!=a.charAt(e+t)){
+throw new AjxFormat.ParsingException(this._parent,this,"input doesn't match")
+}}
+return e+o.length
+};
+AjxFormat.Segment._parseLiterals=function(a,h,m,t,g,c){
+for(var r=0;
+r<t.length;
+r++){
+try{
+var p=t[r];
+var n=AjxFormat.Segment._parseLiteral(p,g,c);
+if(h){
+var u=a||window;
+if(typeof h=="function"){
+h.call(u,r+m)
+}else{
+u[h]=r+m
+}}
+return n
+}
+catch(d){}}
+return -1
+};
+AjxFormat.Segment._parseInt=function(t,n,g,y,r,e,m){
+var h=e||y.length-r;
+var u=r;
+for(var a=0;
+a<h;
+a++){
+if(!y.charAt(r++).match(/\d/)){
+r--;
+break
+}}
+var d=r;
+if(u==d){
+throw new AjxFormat.ParsingException(this._parent,this,"number not present")
+}
+if(e&&d-u!=e){
+throw new AjxFormat.ParsingException(this._parent,this,"number too short")
+}
+var p=parseInt(y.substring(u,d),m||10);
+if(n){
+var c=t||window;
+if(typeof n=="function"){
+n.call(c,p+g)
+}else{
+c[n]=p+g
+}}
+return d
+};
+AjxDateFormat=function(s){
+AjxFormat.call(this,s);
+if(typeof s=="number"){
+switch(s){
+case AjxDateFormat.SHORT:s=I18nMsg.formatDateShort;
+break;
+case AjxDateFormat.MEDIUM:s=I18nMsg.formatDateMedium;
+break;
+case AjxDateFormat.LONG:s=I18nMsg.formatDateLong;
+break;
+case AjxDateFormat.FULL:s=I18nMsg.formatDateFull;
+break
+}}
+for(var a=0;
+a<s.length;
+a++){
+var h=s.charAt(a);
+if(h=="'"){
+var t=a+1;
+for(a++;
+a<s.length;
+a++){
+var h=s.charAt(a);
+if(h=="'"){
+if(a+1<s.length&&s.charAt(a+1)=="'"){
+s=s.substr(0,a)+s.substr(a+1)
+}else{
+break
+}}}
+if(a==s.length){}
+var e=a;
+var n=new AjxFormat.TextSegment(this,s.substring(t,e));
+this._segments.push(n);
+continue
+}
+var t=a;
+while(a<s.length){
+h=s.charAt(a);
+if(AjxDateFormat._META_CHARS.indexOf(h)!=-1||h=="'"){
+break
+}
+a++
+}
+var e=a;
+if(t!=e){
+var n=new AjxFormat.TextSegment(this,s.substring(t,e));
+this._segments.push(n);
+a--;
+continue
+}
+var t=a;
+while(++a<s.length){
+if(s.charAt(a)!=h){
+break
+}}
+var e=a--;
+var o=e-t;
+var r=s.substr(t,o);
+var n=null;
+switch(h){
+case"G":n=new AjxDateFormat.EraSegment(this,r);
+break;
+case"y":n=new AjxDateFormat.YearSegment(this,r);
+break;
+case"M":n=new AjxDateFormat.MonthSegment(this,r);
+break;
+case"w":n=new AjxDateFormat.WeekSegment(this,r);
+break;
+case"W":n=new AjxDateFormat.WeekSegment(this,r);
+break;
+case"D":n=new AjxDateFormat.DaySegment(this,r);
+break;
+case"d":n=new AjxDateFormat.DaySegment(this,r);
+break;
+case"F":n=new AjxDateFormat.WeekdaySegment(this,r);
+break;
+case"E":n=new AjxDateFormat.WeekdaySegment(this,r);
+break;
+case"a":n=new AjxDateFormat.AmPmSegment(this,r);
+break;
+case"H":n=new AjxDateFormat.HourSegment(this,r);
+break;
+case"k":n=new AjxDateFormat.HourSegment(this,r);
+break;
+case"K":n=new AjxDateFormat.HourSegment(this,r);
+break;
+case"h":n=new AjxDateFormat.HourSegment(this,r);
+break;
+case"m":n=new AjxDateFormat.MinuteSegment(this,r);
+break;
+case"s":n=new AjxDateFormat.SecondSegment(this,r);
+break;
+case"S":n=new AjxDateFormat.SecondSegment(this,r);
+break;
+case"z":n=new AjxDateFormat.TimezoneSegment(this,r);
+break;
+case"Z":n=new AjxDateFormat.TimezoneSegment(this,r);
+break
+}
+if(n!=null){
+n._index=this._segments.length;
+this._segments.push(n)
+}}};
+AjxDateFormat.prototype=new AjxFormat;
+AjxDateFormat.prototype.constructor=AjxDateFormat;
+AjxDateFormat.prototype.toString=function(){
+return"[AjxDateFormat: "+AjxFormat.prototype.toString.call(this)+"]"
+};
+AjxDateFormat.SHORT=0;
+AjxDateFormat.MEDIUM=1;
+AjxDateFormat.LONG=2;
+AjxDateFormat.FULL=3;
+AjxDateFormat.DEFAULT=AjxDateFormat.MEDIUM;
+AjxDateFormat._META_CHARS="GyMwWDdFEaHkKhmsSzZ";
+AjxDateFormat.getDateInstance=function(e){
+e=e!=null?e:AjxDateFormat.DEFAULT;
+if(!AjxDateFormat._DATE_FORMATTERS[e]){
+AjxDateFormat._DATE_FORMATTERS[e]=new AjxDateFormat(AjxDateFormat._dateFormats[e])
+}
+return AjxDateFormat._DATE_FORMATTERS[e]
+};
+AjxDateFormat.getTimeInstance=function(e){
+e=e!=null?e:AjxDateFormat.DEFAULT;
+if(!AjxDateFormat._TIME_FORMATTERS[e]){
+AjxDateFormat._TIME_FORMATTERS[e]=new AjxDateFormat(AjxDateFormat._timeFormats[e])
+}
+return AjxDateFormat._TIME_FORMATTERS[e]
+};
+AjxDateFormat.getDateTimeInstance=function(e,t){
+e=e!=null?e:AjxDateFormat.DEFAULT;
+t=t!=null?t:AjxDateFormat.DEFAULT;
+var o=e*10+t;
+if(!AjxDateFormat._DATETIME_FORMATTERS[o]){
+var n=I18nMsg.formatDateTime;
+var s=[AjxDateFormat._dateFormats[e],AjxDateFormat._timeFormats[t]];
+var a=AjxMessageFormat.format(n,s);
+AjxDateFormat._DATETIME_FORMATTERS[o]=new AjxDateFormat(a)
+}
+return AjxDateFormat._DATETIME_FORMATTERS[o]
+};
+AjxDateFormat.format=function(t,e){
+return new AjxDateFormat(t).format(e)
+};
+AjxDateFormat.parse=function(t,e){
+return new AjxDateFormat(t).parse(e)
+};
+AjxDateFormat.initialize=function(){
+AjxDateFormat._dateFormats=[I18nMsg.formatDateShort,I18nMsg.formatDateMedium,I18nMsg.formatDateLong,I18nMsg.formatDateFull];
+AjxDateFormat._timeFormats=[I18nMsg.formatTimeShort,I18nMsg.formatTimeMedium,I18nMsg.formatTimeLong,I18nMsg.formatTimeFull];
+AjxDateFormat._DATE_FORMATTERS={};
+AjxDateFormat._TIME_FORMATTERS={};
+AjxDateFormat._DATETIME_FORMATTERS={};
+AjxDateFormat.MonthSegment.initialize();
+AjxDateFormat.WeekdaySegment.initialize()
+};
+AjxDateFormat.prototype.parse=function(n){
+var o=null;
+try{
+o=AjxFormat.prototype.parse.call(this,n);
+var a=new Date(0,0,1,0,0,0,0);
+if(o.year!=null){
+a.setFullYear(o.year)
+}
+if(o.month!=null){
+a.setMonth(o.month)
+}
+if(o.dayofmonth!=null){
+a.setDate(o.dayofmonth)
+}else{
+if(o.dayofyear!=null){
+a.setMonth(0,o.dayofyear)
+}}
+if(o.hours!=null){
+a.setHours(o.hours)
+}
+if(o.minutes!=null){
+a.setMinutes(o.minutes)
+}
+if(o.seconds!=null){
+a.setSeconds(o.seconds)
+}
+if(o.milliseconds!=null){
+a.setMilliseconds(o.milliseconds)
+}
+if(o.ampm!=null){
+var t=a.getHours();
+if(t==12&&o.ampm==0){
+t=0
+}else{
+if(t!=12&&o.ampm==1){
+t+=12
+}}
+a.setHours(t)
+}
+o=a
+}
+catch(r){}
+return o
+};
+AjxDateFormat.prototype._createParseObject=function(){
+return{
+year:null,month:null,dayofmonth:null,dayofyear:null,hours:null,minutes:null,seconds:null,milliseconds:null,ampm:null,era:null,timezone:null}
+};
+AjxFormat.TextSegment=function(t,e){
+AjxFormat.Segment.call(this,t,e)
+};
+AjxFormat.TextSegment.prototype=new AjxFormat.Segment;
+AjxFormat.TextSegment.prototype.constructor=AjxFormat.TextSegment;
+AjxFormat.TextSegment.prototype.toString=function(){
+return'text: "'+this._s+'"'
+};
+AjxFormat.TextSegment.prototype.parse=function(a,t,e){
+return AjxFormat.Segment._parseLiteral(this._s,t,e)
+};
+AjxDateFormat.DateSegment=function(t,e){
+AjxFormat.Segment.call(this,t,e)
+};
+AjxDateFormat.DateSegment.prototype=new AjxFormat.Segment;
+AjxDateFormat.DateSegment.prototype.constructor=AjxDateFormat.DateSegment;
+AjxDateFormat.EraSegment=function(t,e){
+AjxDateFormat.DateSegment.call(this,t,e)
+};
+AjxDateFormat.EraSegment.prototype=new AjxDateFormat.DateSegment;
+AjxDateFormat.EraSegment.prototype.constructor=AjxDateFormat.EraSegment;
+AjxDateFormat.EraSegment.prototype.toString=function(){
+return'dateEra: "'+this._s+'"'
+};
+AjxDateFormat.EraSegment.prototype.format=function(e){
+return I18nMsg.eraAD
+};
+AjxDateFormat.YearSegment=function(t,e){
+AjxDateFormat.DateSegment.call(this,t,e)
+};
+AjxDateFormat.YearSegment.prototype=new AjxDateFormat.DateSegment;
+AjxDateFormat.YearSegment.prototype.constructor=AjxDateFormat.YearSegment;
+AjxDateFormat.YearSegment.prototype.toString=function(){
+return'dateYear: "'+this._s+'"'
+};
+AjxDateFormat.YearSegment.prototype.format=function(e){
+var t=String(e.getFullYear());
+return this._s.length<4?t.substr(t.length-2):AjxFormat._zeroPad(t,this._s.length)
+};
+AjxDateFormat.YearSegment.prototype.parse=function(a,d,n){
+var e=this._getFixedLength();
+var t=AjxFormat.Segment._parseInt(a,"year",0,d,n,e);
+if(t-n==2){
+if(!AjxDateFormat._2digitStartYear){
+AjxDateFormat._2digitStartYear=parseInt(AjxMsg.dateParsing2DigitStartYear)
+}
+var h=AjxDateFormat._2digitStartYear;
+var c=parseInt(d.substr(n,2),10);
+var o=(Math.floor(h/100)+(c<(h%100)?1:0))*100;
+var r=o+c;
+a.year=r
+}
+return t
+};
+AjxDateFormat.MonthSegment=function(t,e){
+AjxDateFormat.DateSegment.call(this,t,e)
+};
+AjxDateFormat.MonthSegment.prototype=new AjxDateFormat.DateSegment;
+AjxDateFormat.MonthSegment.prototype.constructor=AjxDateFormat.MonthSegment;
+AjxDateFormat.MonthSegment.prototype.toString=function(){
+return'dateMonth: "'+this._s+'"'
+};
+AjxDateFormat.MonthSegment.initialize=function(){
+AjxDateFormat.MonthSegment.MONTHS={};
+AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.SHORT]=[AjxMsg.monthJanShort,AjxMsg.monthFebShort,AjxMsg.monthMarShort,AjxMsg.monthAprShort,AjxMsg.monthMayShort,AjxMsg.monthJunShort,AjxMsg.monthJulShort,AjxMsg.monthAugShort,AjxMsg.monthSepShort,AjxMsg.monthOctShort,AjxMsg.monthNovShort,AjxMsg.monthDecShort];
+AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.MEDIUM]=[I18nMsg.monthJanMedium,I18nMsg.monthFebMedium,I18nMsg.monthMarMedium,I18nMsg.monthAprMedium,I18nMsg.monthMayMedium,I18nMsg.monthJunMedium,I18nMsg.monthJulMedium,I18nMsg.monthAugMedium,I18nMsg.monthSepMedium,I18nMsg.monthOctMedium,I18nMsg.monthNovMedium,I18nMsg.monthDecMedium];
+AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.LONG]=[I18nMsg.monthJanLong,I18nMsg.monthFebLong,I18nMsg.monthMarLong,I18nMsg.monthAprLong,I18nMsg.monthMayLong,I18nMsg.monthJunLong,I18nMsg.monthJulLong,I18nMsg.monthAugLong,I18nMsg.monthSepLong,I18nMsg.monthOctLong,I18nMsg.monthNovLong,I18nMsg.monthDecLong]
+};
+AjxDateFormat.MonthSegment.prototype.format=function(e){
+var t=e.getMonth();
+switch(this._s.length){
+case 1:return String(t+1);
+case 2:return AjxFormat._zeroPad(t+1,2);
+case 3:return AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.MEDIUM][t];
+case 5:return AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.SHORT][t]
+}
+return AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.LONG][t]
+};
+AjxDateFormat.MonthSegment.prototype.parse=function(a,n,t){
+var e;
+switch(this._s.length){
+case 3:e=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.MEDIUM];
+case 4:e=e||AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.LONG];
+case 5:e=e||AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.SHORT];
+var o=AjxFormat.Segment._parseLiterals(a,"month",0,e,n,t);
+if(o==-1){
+throw new AjxFormat.ParsingException(this._parent,this,"no match")
+}
+return o
+}
+var r=this._getFixedLength();
+return AjxFormat.Segment._parseInt(a,"month",-1,n,t,r)
+};
+AjxDateFormat.WeekSegment=function(t,e){
+AjxDateFormat.DateSegment.call(this,t,e)
+};
+AjxDateFormat.WeekSegment.prototype=new AjxDateFormat.DateSegment;
+AjxDateFormat.WeekSegment.prototype.constructor=AjxDateFormat.WeekSegment;
+AjxDateFormat.WeekSegment.prototype.toString=function(){
+return'weekMonth: "'+this._s+'"'
+};
+AjxDateFormat.WeekSegment.prototype.format=function(t){
+var o=t.getYear();
+var s=t.getMonth();
+var e=t.getDate();
+var r=/w/.test(this._s);
+var n=new Date(o,r?0:s,1);
+var a=0;
+while(true){
+a++;
+if(n.getMonth()>s||(n.getMonth()==s&&n.getDate()>=e)){
+break
+}
+n.setDate(n.getDate()+7)
+}
+return AjxFormat._zeroPad(a,this._s.length)
+};
+AjxDateFormat.WeekSegment.prototype.parse=function(t,a,e){
+var o=this._getFixedLength();
+return AjxFormat.Segment._parseInt(null,null,0,a,e,o)
+};
+AjxDateFormat.DaySegment=function(t,e){
+AjxDateFormat.DateSegment.call(this,t,e)
+};
+AjxDateFormat.DaySegment.prototype=new AjxDateFormat.DateSegment;
+AjxDateFormat.DaySegment.prototype.constructor=AjxDateFormat.DaySegment;
+AjxDateFormat.DaySegment.prototype.toString=function(){
+return'dateDay: "'+this._s+'"'
+};
+AjxDateFormat.DaySegment.prototype.format=function(t){
+var n=t.getMonth();
+var e=t.getDate();
+if(/D/.test(this._s)&&n>0){
+var a=t.getYear();
+do{
+var o=new Date(a,n,1);
+o.setDate(0);
+e+=o.getDate();
+n--
+}
+while(n>0)
+}
+return AjxFormat._zeroPad(e,this._s.length)
+};
+AjxDateFormat.DaySegment.prototype.parse=function(t,o,e){
+var n=this._getFixedLength();
+var a=/D/.test(this._s)?"dayofyear":"dayofmonth";
+return AjxFormat.Segment._parseInt(t,a,0,o,e,n)
+};
+AjxDateFormat.WeekdaySegment=function(t,e){
+AjxDateFormat.DateSegment.call(this,t,e)
+};
+AjxDateFormat.WeekdaySegment.prototype=new AjxDateFormat.DateSegment;
+AjxDateFormat.WeekdaySegment.prototype.constructor=AjxDateFormat.WeekdaySegment;
+AjxDateFormat.DaySegment.prototype.toString=function(){
+return'dateDay: "'+this._s+'"'
+};
+AjxDateFormat.WeekdaySegment.initialize=function(){
+AjxDateFormat.WeekdaySegment.WEEKDAYS={};
+AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.SHORT]=[AjxMsg.weekdaySunShort,AjxMsg.weekdayMonShort,AjxMsg.weekdayTueShort,AjxMsg.weekdayWedShort,AjxMsg.weekdayThuShort,AjxMsg.weekdayFriShort,AjxMsg.weekdaySatShort];
+AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.MEDIUM]=[I18nMsg.weekdaySunMedium,I18nMsg.weekdayMonMedium,I18nMsg.weekdayTueMedium,I18nMsg.weekdayWedMedium,I18nMsg.weekdayThuMedium,I18nMsg.weekdayFriMedium,I18nMsg.weekdaySatMedium];
+AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.LONG]=[I18nMsg.weekdaySunLong,I18nMsg.weekdayMonLong,I18nMsg.weekdayTueLong,I18nMsg.weekdayWedLong,I18nMsg.weekdayThuLong,I18nMsg.weekdayFriLong,I18nMsg.weekdaySatLong]
+};
+AjxDateFormat.WeekdaySegment.prototype.format=function(e){
+var a=e.getDay();
+if(/E/.test(this._s)){
+var t;
+switch(this._s.length){
+case 4:t=AjxDateFormat.LONG;
+break;
+case 5:t=AjxDateFormat.SHORT;
+break;
+default:t=AjxDateFormat.MEDIUM
+}
+return AjxDateFormat.WeekdaySegment.WEEKDAYS[t][a]
+}
+return AjxFormat._zeroPad(a,this._s.length)
+};
+AjxDateFormat.WeekdaySegment.prototype.parse=function(a,n,t){
+var e;
+switch(this._s.length){
+case 3:e=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.MEDIUM];
+case 4:e=e||AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.LONG];
+case 5:e=e||AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.SHORT];
+var o=AjxFormat.Segment._parseLiterals(null,null,0,e,n,t);
+if(o==-1){
+throw new AjxFormat.ParsingException(this._parent,this,"no match")
+}
+return o
+}
+var r=this._getFixedLength();
+return AjxFormat.Segment._parseInt(null,null,0,n,t,r)
+};
+AjxDateFormat.TimeSegment=function(t,e){
+AjxFormat.Segment.call(this,t,e)
+};
+AjxDateFormat.TimeSegment.prototype=new AjxFormat.Segment;
+AjxDateFormat.TimeSegment.prototype.constructor=AjxDateFormat.TimeSegment;
+AjxDateFormat.HourSegment=function(t,e){
+AjxFormat.Segment.call(this,t,e)
+};
+AjxDateFormat.HourSegment.prototype=new AjxDateFormat.TimeSegment;
+AjxDateFormat.HourSegment.prototype.constructor=AjxDateFormat.HourSegment;
+AjxDateFormat.HourSegment.prototype.toString=function(){
+return'timeHour: "'+this._s+'"'
+};
+AjxDateFormat.HourSegment.prototype.format=function(t){
+var e=t.getHours();
+if(e>12&&/[hK]/.test(this._s)){
+e-=12
+}else{
+if(e==0&&/[h]/.test(this._s)){
+e=12
+}}
+return AjxFormat._zeroPad(e,this._s.length)
+};
+AjxDateFormat.HourSegment.prototype.parse=function(t,a,e){
+var o=this._getFixedLength();
+return AjxFormat.Segment._parseInt(t,"hours",0,a,e,o)
+};
+AjxDateFormat.MinuteSegment=function(t,e){
+AjxFormat.Segment.call(this,t,e)
+};
+AjxDateFormat.MinuteSegment.prototype=new AjxDateFormat.TimeSegment;
+AjxDateFormat.MinuteSegment.prototype.constructor=AjxDateFormat.MinuteSegment;
+AjxDateFormat.MinuteSegment.prototype.toString=function(){
+return'timeMinute: "'+this._s+'"'
+};
+AjxDateFormat.MinuteSegment.prototype.format=function(e){
+var t=e.getMinutes();
+return AjxFormat._zeroPad(t,this._s.length)
+};
+AjxDateFormat.MinuteSegment.prototype.parse=function(t,a,e){
+var o=this._getFixedLength();
+return AjxFormat.Segment._parseInt(t,"minutes",0,a,e,o)
+};
+AjxDateFormat.SecondSegment=function(t,e){
+AjxFormat.Segment.call(this,t,e)
+};
+AjxDateFormat.SecondSegment.prototype=new AjxDateFormat.TimeSegment;
+AjxDateFormat.SecondSegment.prototype.constructor=AjxDateFormat.SecondSegment;
+AjxDateFormat.SecondSegment.prototype.toString=function(){
+return'timeSecond: "'+this._s+'"'
+};
+AjxDateFormat.SecondSegment.prototype.format=function(e){
+var t=/s/.test(this._s)?e.getSeconds():e.getMilliseconds();
+return AjxFormat._zeroPad(t,this._s.length)
+};
+AjxDateFormat.SecondSegment.prototype.parse=function(t,o,e){
+var n=this._getFixedLength();
+var a=/s/.test(this._s)?"seconds":"milliseconds";
+return AjxFormat.Segment._parseInt(t,a,0,o,e,n)
+};
+AjxDateFormat.AmPmSegment=function(t,e){
+AjxFormat.Segment.call(this,t,e)
+};
+AjxDateFormat.AmPmSegment.prototype=new AjxDateFormat.TimeSegment;
+AjxDateFormat.AmPmSegment.prototype.constructor=AjxDateFormat.AmPmSegment;
+AjxDateFormat.AmPmSegment.prototype.toString=function(){
+return'timeAmPm: "'+this._s+'"'
+};
+AjxDateFormat.AmPmSegment.prototype.format=function(t){
+var e=t.getHours();
+return e<12?I18nMsg.periodAm:I18nMsg.periodPm
+};
+AjxDateFormat.AmPmSegment.prototype.parse=function(t,o,e){
+var n=[I18nMsg.periodAm.toLowerCase(),I18nMsg.periodPm.toLowerCase(),I18nMsg.periodAm.toUpperCase(),I18nMsg.periodPm.toUpperCase()];
+var a=AjxFormat.Segment._parseLiterals(t,"ampm",0,n,o,e);
+if(a==-1){
+throw new AjxFormat.ParsingException(this._parent,this,"no match")
+}
+t.ampm=t.ampm%2;
+return a
+};
+AjxDateFormat.TimezoneSegment=function(t,e){
+AjxFormat.Segment.call(this,t,e)
+};
+AjxDateFormat.TimezoneSegment.prototype=new AjxDateFormat.TimeSegment;
+AjxDateFormat.TimezoneSegment.prototype.constructor=AjxDateFormat.TimezoneSegment;
+AjxDateFormat.TimezoneSegment.prototype.toString=function(){
+return'timeTimezone: "'+this._s+'"'
+};
+AjxDateFormat.TimezoneSegment.prototype.format=function(t){
+var e=t.timezone||AjxTimezone.DEFAULT;
+if(/Z/.test(this._s)){
+return AjxTimezone.getShortName(e)
+}
+return this._s.length<4?AjxTimezone.getMediumName(e):AjxTimezone.getLongName(e)
+};
+AjxMessageFormat=function(s){
+if(!s){
+return""
+}
+AjxFormat.call(this,s);
+for(var t=0;
+t<s.length;
+t++){
+var r=s.charAt(t);
+if(r=="'"){
+if(t+1<s.length&&s.charAt(t+1)=="'"){
+var a=new AjxFormat.TextSegment(this,"'");
+this._segments.push(a);
+t++;
+continue
+}
+var h=t+1;
+for(t++;
+t<s.length;
+t++){
+var r=s.charAt(t);
+if(r=="'"){
+if(t+1<s.length&&s.charAt(t+1)=="'"){
+s=s.substr(0,t)+s.substr(t+1)
+}else{
+break
+}}}
+if(t==s.length){}
+var n=t;
+var a=new AjxFormat.TextSegment(this,s.substring(h,n));
+this._segments.push(a);
+continue
+}
+var h=t;
+while(t<s.length){
+r=s.charAt(t);
+if(r=="{"||r=="'"){
+break
+}
+t++
+}
+var n=t;
+if(h!=n){
+var a=new AjxFormat.TextSegment(this,s.substring(h,n));
+this._segments.push(a);
+t--;
+continue
+}
+var h=t+1;
+var e=0;
+while(++t<s.length){
+var r=s.charAt(t);
+if(r=="{"){
+e++
+}else{
+if(r=="}"){
+if(e==0){
+break
+}
+e--
+}}}
+var n=t;
+var o=n-h;
+var d=s.substr(h,o);
+var a=new AjxMessageFormat.MessageSegment(this,d);
+if(a!=null){
+this._segments.push(a)
+}}};
+AjxMessageFormat.prototype=new AjxFormat;
+AjxMessageFormat.prototype.constructor=AjxMessageFormat;
+AjxMessageFormat.prototype.toString=function(){
+return"[AjxMessageFormat: "+AjxFormat.prototype.toString.call(this)+"]"
+};
+AjxMessageFormat.format=function(e,t){
+return new AjxMessageFormat(e).format(t)
+};
+AjxMessageFormat.prototype.format=function(e){
+if(!(e instanceof Array)){
+e=[e]
+}
+return AjxFormat.prototype.format.call(this,e)
+};
+AjxMessageFormat.prototype.getFormats=function(){
+var e=[];
+for(var t=0;
+t<this._segments.length;
+t++){
+var a=this._segments[t];
+if(a instanceof AjxMessageFormat.MessageSegment){
+e.push(a.getSegmentFormat())
+}}
+return e
+};
+AjxMessageFormat.prototype.getFormatsByArgumentIndex=function(){
+var e=[];
+for(var t=0;
+t<this._segments.length;
+t++){
+var a=this._segments[t];
+if(a instanceof AjxMessageFormat.MessageSegment){
+e[a.getIndex()]=a.getSegmentFormat()
+}}
+return e
+};
+AjxMessageFormat.MessageSegment=function(o,e){
+AjxFormat.Segment.call(this,o,e);
+var a=AjxMessageFormat.MessageSegment._split(e,",");
+this._index=Number(a[0]);
+this._type=a[1]||"string";
+this._style=a[2];
+if(this._type=="list"){
+this._isList=true;
+this._type=a[2]||"string";
+this._style=a[3]
+}
+switch(this._type){
+case"number":switch(this._style){
+case"integer":this._formatter=AjxNumberFormat.getIntegerInstance();
+break;
+case"currency":this._formatter=AjxNumberFormat.getCurrencyInstance();
+break;
+case"percent":this._formatter=AjxNumberFormat.getPercentInstance();
+break;
+default:this._formatter=this._style==null?AjxNumberFormat.getInstance():new AjxNumberFormat(this._style)
+}
+break;
+case"date":case"time":var t=this._type=="date"?AjxDateFormat.getDateInstance:AjxDateFormat.getTimeInstance;
+switch(this._style){
+case"short":this._formatter=t(AjxDateFormat.SHORT);
+break;
+case"medium":this._formatter=t(AjxDateFormat.MEDIUM);
+break;
+case"long":this._formatter=t(AjxDateFormat.LONG);
+break;
+case"full":this._formatter=t(AjxDateFormat.FULL);
+break;
+default:this._formatter=this._style==null?t(AjxDateFormat.DEFAULT):new AjxDateFormat(this._style)
+}
+break;
+case"choice":this._formatter=new AjxChoiceFormat(this._style);
+break
+}
+if(this._isList){
+this._formatter=new AjxListFormat(this._formatter)
+}};
+AjxMessageFormat.MessageSegment.prototype=new AjxFormat.Segment;
+AjxMessageFormat.MessageSegment.prototype.constructor=AjxMessageFormat.MessageSegment;
+AjxMessageFormat.MessageSegment.prototype.toString=function(){
+var e=['message: "',this._s,'", index: ',this._index];
+if(this._isList){
+e.push(", list: ",this._isList)
+}
+if(this._type){
+e.push(", type: ",this._type)
+}
+if(this._style){
+e.push(", style: ",this._style)
+}
+if(this._formatter){
+e.push(", formatter: ",this._formatter.toString())
+}
+return e.join("")
+};
+AjxMessageFormat.MessageSegment.prototype._index;
+AjxMessageFormat.MessageSegment.prototype._type;
+AjxMessageFormat.MessageSegment.prototype._style;
+AjxMessageFormat.MessageSegment.prototype._isList=false;
+AjxMessageFormat.MessageSegment.prototype._formatter;
+AjxMessageFormat.MessageSegment.prototype.format=function(t){
+var e=t[this._index];
+if(this._formatter instanceof AjxChoiceFormat){
+return this._formatter.format(t,this._index)
+}
+return this._formatter?this._formatter.format(e):String(e)
+};
+AjxMessageFormat.MessageSegment.prototype.getIndex=function(){
+return this._index
+};
+AjxMessageFormat.MessageSegment.prototype.getType=function(){
+return this._type
+};
+AjxMessageFormat.MessageSegment.prototype.getStyle=function(){
+return this._style
+};
+AjxMessageFormat.MessageSegment.prototype.getSegmentFormat=function(){
+return this._formatter
+};
+AjxMessageFormat.MessageSegment._split=function(o,e){
+var n=[];
+var a=0;
+var t;
+var r=0;
+for(t=0;
+t<o.length;
+t++){
+var h=o.charAt(t);
+if(h=="{"){
+r++
+}else{
+if(h=="}"){
+r--
+}else{
+if(h==e&&r==0){
+n.push(o.substring(a,t));
+a=t+1
+}}}}
+if(t>a){
+n.push(o.substring(a,t))
+}
+return n
+};
+AjxNumberFormat=function(y,w){
+AjxFormat.call(this,y);
+if(y==""){
+return
+}
+var a=y.split(/;/);
+var y=a[0];
+var p=0;
+var m=this.__parseStatic(y,p);
+p=m.offset;
+var s=m.text!="";
+if(s){
+this._segments.push(new AjxFormat.TextSegment(this,m.text))
+}
+var r=p;
+while(p<y.length&&AjxNumberFormat._META_CHARS.indexOf(y.charAt(p))!=-1){
+p++
+}
+var n=p;
+var t=y.substring(r,n);
+var v=t.indexOf("E");
+var d=v!=-1?t.substring(v+1):null;
+if(d){
+t=t.substring(0,v);
+this._showExponent=true
+}
+var u=t.indexOf(".");
+var k=u!=-1?t.substring(0,u):t;
+if(k){
+var x=k.lastIndexOf(",");
+if(x!=-1){
+this._groupingOffset=k.length-x-1
+}
+k=k.replace(/[^#0]/g,"");
+var c=k.indexOf("0");
+if(c!=-1){
+this._minIntDigits=k.length-c
+}
+this._maxIntDigits=k.length
+}
+var g=u!=-1?t.substring(u+1):null;
+if(g){
+var c=g.lastIndexOf("0");
+if(c!=-1){
+this._minFracDigits=c+1
+}
+this._maxFracDigits=g.replace(/[^#0]/g,"").length
+}
+this._segments.push(new AjxNumberFormat.NumberSegment(this,t));
+var m=this.__parseStatic(y,p);
+p=m.offset;
+if(m.text!=""){
+this._segments.push(new AjxFormat.TextSegment(this,m.text))
+}
+if(w){
+return
+}
+if(a.length>1){
+var y=a[1];
+this._negativeFormatter=new AjxNumberFormat(y,true)
+}else{
+var f=new AjxNumberFormat("");
+f._segments=f._segments.concat(this._segments);
+var h=s?1:0;
+var o=new AjxFormat.TextSegment(f,I18nMsg.numberSignMinus);
+f._segments.splice(h,0,o);
+this._negativeFormatter=f
+}};
+AjxNumberFormat.prototype=new AjxFormat;
+AjxNumberFormat.prototype.constructor=AjxNumberFormat;
+AjxNumberFormat.prototype.toString=function(){
+var e=["[AjxNumberFormat: ","formatter=",AjxFormat.prototype.toString.call(this)];
+if(this._negativeFormatter){
+e.push(", negativeFormatter=",this._negativeFormatter.toString())
+}
+e.push("]");
+return e.join("")
+};
+AjxNumberFormat._NUMBER="number";
+AjxNumberFormat._INTEGER="integer";
+AjxNumberFormat._CURRENCY="currency";
+AjxNumberFormat._PERCENT="percent";
+AjxNumberFormat._META_CHARS="0#.,E";
+AjxNumberFormat.prototype._groupingOffset=Number.MAX_VALUE;
+AjxNumberFormat.prototype._maxIntDigits;
+AjxNumberFormat.prototype._minIntDigits=1;
+AjxNumberFormat.prototype._maxFracDigits;
+AjxNumberFormat.prototype._minFracDigits;
+AjxNumberFormat.prototype._isCurrency=false;
+AjxNumberFormat.prototype._isPercent=false;
+AjxNumberFormat.prototype._isPerMille=false;
+AjxNumberFormat.prototype._showExponent=false;
+AjxNumberFormat.prototype._negativeFormatter;
+AjxNumberFormat.getInstance=function(){
+if(!AjxNumberFormat._FORMATTERS[AjxNumberFormat._NUMBER]){
+AjxNumberFormat._FORMATTERS[AjxNumberFormat._NUMBER]=new AjxNumberFormat(I18nMsg.formatNumber)
+}
+return AjxNumberFormat._FORMATTERS[AjxNumberFormat._NUMBER]
+};
+AjxNumberFormat.getNumberInstance=AjxNumberFormat.getInstance;
+AjxNumberFormat.getCurrencyInstance=function(){
+if(!AjxNumberFormat._FORMATTERS[AjxNumberFormat._CURRENCY]){
+AjxNumberFormat._FORMATTERS[AjxNumberFormat._CURRENCY]=new AjxNumberFormat(I18nMsg.formatNumberCurrency)
+}
+return AjxNumberFormat._FORMATTERS[AjxNumberFormat._CURRENCY]
+};
+AjxNumberFormat.getIntegerInstance=function(){
+if(!AjxNumberFormat._FORMATTERS[AjxNumberFormat._INTEGER]){
+AjxNumberFormat._FORMATTERS[AjxNumberFormat._INTEGER]=new AjxNumberFormat(I18nMsg.formatNumberInteger)
+}
+return AjxNumberFormat._FORMATTERS[AjxNumberFormat._INTEGER]
+};
+AjxNumberFormat.getPercentInstance=function(){
+if(!AjxNumberFormat._FORMATTERS[AjxNumberFormat._PERCENT]){
+AjxNumberFormat._FORMATTERS[AjxNumberFormat._PERCENT]=new AjxNumberFormat(I18nMsg.formatNumberPercent)
+}
+return AjxNumberFormat._FORMATTERS[AjxNumberFormat._PERCENT]
+};
+AjxNumberFormat.format=function(t,e){
+return new AjxNumberFormat(t).format(e)
+};
+AjxNumberFormat.initialize=function(){
+AjxNumberFormat._FORMATTERS={}
+};
+AjxNumberFormat.prototype.format=function(e){
+if(e<0&&this._negativeFormatter){
+return this._negativeFormatter.format(e)
+}
+return AjxFormat.prototype.format.call(this,e)
+};
+AjxNumberFormat.prototype.__parseStatic=function(a,t){
+var o=[];
+while(t<a.length){
+var r=a.charAt(t++);
+if(AjxNumberFormat._META_CHARS.indexOf(r)!=-1){
+t--;
+break
+}
+switch(r){
+case"'":var n=t;
+while(t<a.length&&a.charAt(t++)!="'"){}
+var e=t;
+r=e-n==0?"'":a.substring(n,e);
+break;
+case"%":r=I18nMsg.numberSignPercent;
+this._isPercent=true;
+break;
+case"\u2030":r=I18nMsg.numberSignPerMill;
+this._isPerMille=true;
+break;
+case"\u00a4":r=a.charAt(t)=="\u00a4"?I18nMsg.currencyCode:I18nMsg.currencySymbol;
+this._isCurrency=true;
+break
+}
+o.push(r)
+}
+return{
+text:o.join(""),offset:t}
+};
+AjxNumberFormat.NumberSegment=function(t,e){
+AjxFormat.Segment.call(this,t,e)
+};
+AjxNumberFormat.NumberSegment.prototype=new AjxFormat.Segment;
+AjxNumberFormat.NumberSegment.prototype.constructor=AjxNumberFormat.NumberSegment;
+AjxNumberFormat.NumberSegment.prototype.toString=function(){
+return'number: "'+this._s+'"'
+};
+AjxNumberFormat.NumberSegment.prototype.format=function(t){
+if(isNaN(t)){
+return I18nMsg.numberNaN
+}
+if(t===Number.NEGATIVE_INFINITY||t===Number.POSITIVE_INFINITY){
+return I18nMsg.numberInfinity
+}
+if(typeof t!="number"){
+t=Number(t)
+}
+t=Math.abs(t);
+if(this._parent._isPercent){
+t*=100
+}else{
+if(this._parent._isPerMille){
+t*=1000
+}}
+var e=this._parent._showExponent?t.toExponential(this._parent._maxFracDigits).toUpperCase().replace(/E\+/,"E"):t.toFixed(this._parent._maxFracDigits||0);
+e=this._normalize(e);
+return e
+};
+AjxNumberFormat.NumberSegment.prototype._normalize=function(r){
+var o=r.split(/[\.Ee]/);
+var h=o.shift();
+if(h.length<this._parent._minIntDigits){
+h=AjxFormat._zeroPad(h,this._parent._minIntDigits,I18nMsg.numberZero)
+}
+if(h.length>this._parent._groupingOffset){
+var t=[];
+var n=h.length-this._parent._groupingOffset;
+while(n>0){
+t.unshift(h.substr(n,this._parent._groupingOffset));
+t.unshift(I18nMsg.numberSeparatorGrouping);
+n-=this._parent._groupingOffset
+}
+t.unshift(h.substring(0,n+this._parent._groupingOffset));
+h=t.join("")
+}
+var c="0";
+var d;
+if(r.match(/\./)){
+c=o.shift()
+}else{
+if(r.match(/\e/)||r.match(/\E/)){
+d=o.shift()
+}}
+c=c.replace(/0+$/,"");
+if(c.length<this._parent._minFracDigits){
+c=AjxFormat._zeroPad(c,this._parent._minFracDigits,I18nMsg.numberZero,true)
+}
+var t=[h];
+if(c.length>0){
+var e=this._parent._isCurrency?I18nMsg.numberSeparatorMoneyDecimal:I18nMsg.numberSeparatorDecimal;
+t.push(e,c)
+}
+if(d){
+t.push("E",d.replace(/^\+/,""))
+}
+return t.join("")
+};
+AjxChoiceFormat=function(s){
+AjxFormat.call(this,s);
+var c=s.split("|");
+if(arguments.length==1){
+this._limits=new Array(c.length);
+this._lessThan=new Array(c.length);
+this._formats=new Array(c.length);
+var r=new RegExp("^([^#<\u2264]+)([#<\u2264])(.*)$");
+for(var a=0;
+a<c.length;
+a++){
+var t=c[a];
+var o=r.exec(t);
+var e=o[1];
+var n=o[2];
+var h=o[3];
+if(e=="\u221E"){
+this._limits[a]=Number.POSITIVE_INFINITY
+}else{
+if(e=="-\u221E"){
+this._limits[a]=Number.NEGATIVE_INFINITY
+}else{
+this._limits[a]=parseFloat(e)
+}}
+this._lessThan[a]=n=="#"||n=="\u2264";
+this._formats[a]=new AjxMessageFormat(h)
+}}else{
+this._limits=arguments[0];
+this._lessThan=new Array(arguments[0].length);
+this._formats=arguments[1];
+this._pattern=[];
+for(var a=0;
+a<this._formats.length;
+a++){
+if(a>0){
+this._pattern.push("|")
+}
+this._pattern.push(this._limits[a],"#",this._formats[a]);
+this._lessThan[a]=false;
+this._formats[a]=new AjxMessageFormat(this._formats[a])
+}
+this._pattern=this._pattern.join("")
+}};
+AjxChoiceFormat.prototype=new AjxFormat;
+AjxChoiceFormat.prototype.constructor=AjxChoiceFormat;
+AjxChoiceFormat.prototype.toString=function(){
+return["[AjxChoiceFormat: ","limits={ ",this._limits.join(", ")," }, ","formats={ ",this._formats.join(", ")," }, ","lessThan={ ",this._lessThan.join(", ")," }]"].join("")
+};
+AjxChoiceFormat.prototype._limits;
+AjxChoiceFormat.prototype._lessThan;
+AjxChoiceFormat.prototype._formats;
+AjxChoiceFormat.prototype.getLimits=function(){
+return this._limits
+};
+AjxChoiceFormat.prototype.getFormats=function(){
+return this._formats
+};
+AjxChoiceFormat.prototype.format=function(e,n){
+var o=e instanceof Array?e[n]:e;
+var c;
+if(isNaN(o)||o<this._limits[0]){
+c=this._formats[0]
+}else{
+for(var t=0;
+t<this._limits.length-1;
+t++){
+var h=this._limits[t];
+var r=this._limits[t+1];
+var d=o>=h;
+var s=this._lessThan[t+1]?o<r:o<=r;
+if(d&&s){
+c=this._formats[t];
+break
+}}
+if(!c){
+c=this._formats[this._formats.length-1]
+}}
+return c.format(e)
+};
+AjxListFormat=function(e,a,t){
+AjxFormat.call(this,e?e.toPattern():"");
+this._formatter=e;
+this._separator=a||AjxMsg.listSeparator;
+this._lastSeparator=t||AjxMsg.listSeparatorLast
+};
+AjxListFormat.prototype=new AjxFormat;
+AjxListFormat.prototype.constructor=AjxListFormat;
+AjxListFormat.prototype._formatter;
+AjxListFormat.prototype._separator;
+AjxListFormat.prototype._lastSeparator;
+AjxListFormat.prototype.format=function(o){
+o=o instanceof Array?o:[o];
+var a=[];
+for(var e=0;
+e<o.length;
+e++){
+if(e>0){
+a.push(e<o.length-1?this._separator:this._lastSeparator)
+}
+var t=o[e];
+a.push(this._formatter?this._formatter.format(t):String(t))
+}
+return a.join("")
+};
+AjxFormat.initialize()
+}
+if(AjxPackage.define("ajax.util.AjxDateUtil")){
+AjxDateUtil=function(){};
+AjxDateUtil.YEAR=1;
+AjxDateUtil.MONTH=2;
+AjxDateUtil.WEEK=3;
+AjxDateUtil.DAY=4;
+AjxDateUtil.TWO_WEEKS=5;
+AjxDateUtil.MSEC_PER_FIFTEEN_MINUTES=900000;
+AjxDateUtil.MSEC_PER_HALF_HOUR=1800000;
+AjxDateUtil.MSEC_PER_HOUR=3600000;
+AjxDateUtil.MSEC_PER_DAY=24*AjxDateUtil.MSEC_PER_HOUR;
+AjxDateUtil.WEEKDAY_SHORT=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.SHORT];
+AjxDateUtil.WEEKDAY_MEDIUM=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.MEDIUM];
+AjxDateUtil.WEEKDAY_LONG=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.LONG];
+AjxDateUtil.MONTH_SHORT=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.SHORT];
+AjxDateUtil.MONTH_MEDIUM=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.MEDIUM];
+AjxDateUtil.MONTH_LONG=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.LONG];
+AjxDateUtil._daysPerMonth={
+0:31,1:29,2:31,3:30,4:31,5:30,6:31,7:31,8:30,9:31,10:30,11:31};
+AjxDateUtil.WEEK_ONE_JAN_DATE=1;
+AjxDateUtil._init=function(){
+AjxDateUtil._dateFormat=AjxDateFormat.getDateInstance(AjxDateFormat.SHORT).clone();
+var e=AjxDateUtil._dateFormat.getSegments();
+for(var t=0;
+t<e.length;
+t++){
+if(e[t] instanceof AjxDateFormat.YearSegment){
+e[t]=new AjxDateFormat.YearSegment(AjxDateUtil._dateFormat,"yyyy")
+}}
+AjxDateUtil._dateTimeFormat=new AjxDateFormat(AjxDateUtil._dateFormat.toPattern()+" "+AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT));
+AjxDateUtil._dateFormatNoYear=new AjxDateFormat(AjxMsg.formatDateMediumNoYear)
+};
+AjxDateUtil._init();
+AjxDateUtil.validDate=function(n,e,o){
+var t=new Date(n,e,o);
+var a=n>999?t.getFullYear():t.getYear();
+return t.getMonth()==e&&t.getDate()==o&&a==n
+};
+AjxDateUtil.daysInMonth=function(a,e){
+var t=new Date(a,e,1,12);
+t.setMonth(t.getMonth()+1);
+t.setDate(t.getDate()-1);
+return t.getDate()
+};
+AjxDateUtil.isLeapYear=function(e){
+return(new Date(e,1,29)).getMonth()==1
+};
+AjxDateUtil.isLocale24Hour=function(){
+var t=AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT);
+var e=t._segments.length;
+for(var a=0;
+a<e;
+a++){
+if(t._segments[a]._s=="a"){
+return false
+}}
+return true
+};
+AjxDateUtil.roll=function(t,a,n){
+var o=t.getDate();
+if(a==AjxDateUtil.MONTH){
+t.setDate(1);
+t.setMonth(t.getMonth()+n);
+var e=AjxDateUtil.daysInMonth(t.getFullYear(),t.getMonth());
+t.setDate(Math.min(o,e))
+}else{
+if(a==AjxDateUtil.YEAR){
+t.setDate(1);
+t.setFullYear(t.getFullYear()+n);
+var e=AjxDateUtil.daysInMonth(t.getFullYear(),t.getMonth());
+t.setDate(Math.min(o,e))
+}else{
+if(a==AjxDateUtil.WEEK){
+t.setDate(t.getDate()+7*n)
+}else{
+if(a==AjxDateUtil.DAY){
+t.setDate(t.getDate()+n)
+}else{
+if(a==AjxDateUtil.TWO_WEEKS){
+t.setDate(t.getDate()+14*n)
+}else{
+return t
+}}}}}
+return t
+};
+AjxDateUtil.computeDateDelta=function(e){
+var t=(new Date()).getTime()-e;
+var a=AjxDateUtil.computeDuration(t);
+return a?(a+" "+AjxMsg.ago):null
+};
+AjxDateUtil.computeDuration=function(a,c){
+if(a<0){
+return null
+}
+var n=Math.floor(a/(AjxDateUtil.MSEC_PER_DAY*365));
+if(n!=0){
+a-=n*AjxDateUtil.MSEC_PER_DAY*365
+}
+var t=Math.floor(a/(AjxDateUtil.MSEC_PER_DAY*30.42));
+if(t>0){
+a-=Math.floor(t*AjxDateUtil.MSEC_PER_DAY*30.42)
+}
+var h=Math.floor(a/AjxDateUtil.MSEC_PER_DAY);
+if(h>0){
+a-=h*AjxDateUtil.MSEC_PER_DAY
+}
+var s=Math.floor(a/AjxDateUtil.MSEC_PER_HOUR);
+if(s>0){
+a-=s*AjxDateUtil.MSEC_PER_HOUR
+}
+var e=Math.floor(a/60000);
+if(e>0){
+a-=e*60000
+}
+var o=Math.floor(a/1000);
+var r=c?AjxDurationFormatConcise:AjxDurationFormatVerbose;
+if(n>0){
+return r.formatYears(n,t)
+}else{
+if(t>0){
+return r.formatMonths(t,h)
+}else{
+if(h>0){
+return r.formatDays(h,s)
+}else{
+if(s>0){
+return r.formatHours(s,e)
+}else{
+if(e>0){
+return r.formatMinutes(e,o)
+}else{
+return r.formatSeconds(o)
+}}}}}};
+AjxDateUtil.simpleComputeDateStr=function(t,a){
+var e=AjxDateUtil._dateFormat.format(t);
+return a?a+e:e
+};
+AjxDateUtil.simpleParseDateStr=function(e){
+return AjxDateUtil._dateFormat.parse(e)
+};
+AjxDateUtil.simpleComputeDateTimeStr=function(t,a){
+var e=AjxDateUtil._dateTimeFormat.format(t);
+return a?a+e:e
+};
+AjxDateUtil.simpleParseDateTimeStr=function(e){
+return AjxDateUtil._dateTimeFormat.parse(e)
+};
+AjxDateUtil.longComputeDateStr=function(e){
+var t=AjxDateFormat.getDateInstance(AjxDateFormat.FULL);
+return t.format(e)
+};
+AjxDateUtil.computeDateStr=function(a,t){
+if(t==null){
+return""
+}
+var e=new Date(t);
+if(a.getTime()-t<AjxDateUtil.MSEC_PER_DAY&&a.getDay()==e.getDay()){
+return AjxDateUtil.computeTimeString(e)
+}
+if(a.getFullYear()==e.getFullYear()){
+return AjxDateUtil._dateFormatNoYear.format(e)
+}
+return AjxDateUtil.simpleComputeDateStr(e)
+};
+AjxDateUtil.computeWordyDateStr=function(a,t){
+if(t==null){
+return""
+}
+var e=new Date(t);
+if(a.getTime()-t<AjxDateUtil.MSEC_PER_DAY&&a.getDay()==e.getDay()){
+if(!AjxDateUtil._wordyDateToday){
+AjxDateUtil._wordyDateToday=new AjxDateFormat(AjxMsg.formatWordyDateToday)
+}
+return AjxDateUtil._wordyDateToday.format(e)
+}else{
+if((a.getTime()-t)<(2*AjxDateUtil.MSEC_PER_DAY)&&(a.getDay()-1)==e.getDay()){
+if(!AjxDateUtil._wordyDateYesterday){
+AjxDateUtil._wordyDateYesterday=new AjxDateFormat(AjxMsg.formatWordyDateYesterday)
+}
+return AjxDateUtil._wordyDateYesterday.format(e)
+}else{
+if(!AjxDateUtil._wordyDate){
+AjxDateUtil._wordyDate=new AjxDateFormat(AjxMsg.formatWordyDate)
+}
+return AjxDateUtil._wordyDate.format(e)
+}}};
+AjxDateUtil.computeTimeString=function(e){
+var t=AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT);
+return t.format(e)
+};
+AjxDateUtil.computeDateTimeString=function(e){
+var t=AjxDateFormat.getDateTimeInstance(AjxDateFormat.LONG);
+return t.format(e)
+};
+AjxDateUtil._getHoursStr=function(t,a,e){
+var o=t.getHours();
+if(!e){
+o%=12;
+if(o==0){
+o=12
+}}
+return a?AjxDateUtil._pad(o):o
+};
+AjxDateUtil._getMinutesStr=function(e){
+return AjxDateUtil._pad(e.getMinutes())
+};
+AjxDateUtil._getSecondsStr=function(e){
+return AjxDateUtil._pad(e.getSeconds())
+};
+AjxDateUtil._getAMPM=function(t,a){
+var e=t.getHours();
+return(e<12)?(a?"AM":"am"):(a?"PM":"pm")
+};
+AjxDateUtil._getMonthName=function(e,t){
+return t?AjxDateUtil.MONTH_MEDIUM[e.getMonth()]:AjxDateUtil.MONTH_LONG[e.getMonth()]
+};
+AjxDateUtil._getMonth=function(e,a){
+var t=e.getMonth()+1;
+if(a){
+return AjxDateUtil._pad(t)
+}else{
+return t
+}};
+AjxDateUtil._getDate=function(e,t){
+var a=e.getDate();
+return t?AjxDateUtil._pad(a):a
+};
+AjxDateUtil._getWeekday=function(e){
+var t=e.getDay();
+return AjxDateUtil.WEEKDAY_LONG[t]
+};
+AjxDateUtil._getWeekdayMedium=function(e){
+var t=e.getDay();
+return AjxDateUtil.WEEKDAY_MEDIUM[t]
+};
+AjxDateUtil._getFullYear=function(e){
+return e.getFullYear()
+};
+AjxDateUtil.getFirstDayOfWeek=function(o,e){
+e=e||0;
+var t=o.getDay();
+var a=(t-e+7)%7;
+o.setDate(o.getDate()-a);
+return o
+};
+AjxDateUtil.getWeekNumber=function(n,t,h){
+t=t||0;
+h=h||AjxDateUtil.WEEK_ONE_JAN_DATE;
+n=n||new Date();
+n.setHours(12,0,0,0);
+var c=n,f,p;
+if(c.getDay()===t){
+f=c
+}else{
+f=AjxDateUtil.getFirstDayOfWeek(c,t)
+}
+var d=f.getFullYear(),a=f.getTime();
+p=new Date(f.getTime()+6*AjxDateUtil.MSEC_PER_DAY);
+var r;
+if(d!==p.getFullYear()&&p.getDate()>=h){
+r=1
+}else{
+var s=(new Date(d,0,h));
+s.setHours(12,0,0,0);
+var e=AjxDateUtil.getFirstDayOfWeek(s,t);
+var u=Math.round((c.getTime()-e.getTime())/AjxDateUtil.MSEC_PER_DAY);
+var m=u%7;
+var o=(u-m)/7;
+r=o+1
+}
+return r
+};
+AjxDateUtil.getTimeStr=function(e,a){
+var t=a;
+t=t.replace(/%d/g,AjxDateUtil._getDate(e,true));
+t=t.replace(/%D/g,AjxDateUtil._getDate(e,false));
+t=t.replace(/%w/g,AjxDateUtil._getWeekday(e));
+t=t.replace(/%M/g,AjxDateUtil._getMonthName(e));
+t=t.replace(/%t/g,AjxDateUtil._getMonthName(e,true));
+t=t.replace(/%n/g,AjxDateUtil._getMonth(e,true));
+t=t.replace(/%Y/g,AjxDateUtil._getFullYear(e));
+t=t.replace(/%h/g,AjxDateUtil._getHoursStr(e,false,false));
+t=t.replace(/%H/g,AjxDateUtil._getHoursStr(e,true,false));
+t=t.replace(/%m/g,AjxDateUtil._getMinutesStr(e));
+t=t.replace(/%s/g,AjxDateUtil._getSecondsStr(e));
+t=t.replace(/%P/g,AjxDateUtil._getAMPM(e,true));
+t=t.replace(/%p/g,AjxDateUtil._getAMPM(e,false));
+return t
+};
+AjxDateUtil.getRoundedMins=function(e,a){
+var t=e.getMinutes();
+if(t!=0&&a){
+t=(Math.ceil((t/a)))*a
+}
+return t
+};
+AjxDateUtil.roundTimeMins=function(t,o){
+var a=t.getMinutes();
+var e=t.getHours();
+if(a!=0&&o){
+a=(Math.ceil((a/o)))*o;
+if(a==60){
+a=0;
+e++
+}
+t.setMinutes(a);
+t.setHours(e)
+}
+return t
+};
+AjxDateUtil.isInRange=function(o,t,a,e){
+return(o<e&&t>a)
+};
+AjxDateUtil.getSimpleDateFormat=function(){
+return AjxDateUtil._dateFormat
+};
+AjxDateUtil.getServerDate=function(e){
+if(!AjxDateUtil._serverDateFormatter){
+AjxDateUtil._serverDateFormatter=new AjxDateFormat("yyyyMMdd")
+}
+return AjxDateUtil._serverDateFormatter.format(e)
+};
+AjxDateUtil.getServerDateTime=function(t,o){
+var e=t;
+var a=null;
+if(o){
+if(!AjxDateUtil._serverDateTimeFormatterUTC){
+AjxDateUtil._serverDateTimeFormatterUTC=new AjxDateFormat("yyyyMMdd'T'HHmmss'Z'")
+}
+a=AjxDateUtil._serverDateTimeFormatterUTC;
+e=new Date(t.getTime());
+e.setMinutes(e.getMinutes()+e.getTimezoneOffset())
+}else{
+if(!AjxDateUtil._serverDateTimeFormatter){
+AjxDateUtil._serverDateTimeFormatter=new AjxDateFormat("yyyyMMdd'T'HHmmss")
+}
+a=AjxDateUtil._serverDateTimeFormatter
+}
+return a.format(e)
+};
+AjxDateUtil.parseServerTime=function(o,e){
+if(o.charAt(8)=="T"){
+var a=parseInt(o.substr(9,2),10);
+var n=parseInt(o.substr(11,2),10);
+var t=parseInt(o.substr(13,2),10);
+if(o.charAt(15)=="Z"){
+n+=AjxTimezone.getOffset(AjxTimezone.DEFAULT,e)
+}
+e.setHours(a,n,t,0)
+}
+return e
+};
+AjxDateUtil.parseServerDateTime=function(t){
+if(t==null){
+return null
+}
+var a=new Date();
+var n=parseInt(t.substr(0,4),10);
+var o=parseInt(t.substr(4,2),10);
+var e=parseInt(t.substr(6,2),10);
+a.setFullYear(n);
+a.setMonth(o-1);
+a.setMonth(o-1);
+a.setDate(e);
+AjxDateUtil.parseServerTime(t,a);
+return a
+};
+AjxDateUtil._pad=function(e){
+return e<10?("0"+e):e
+};
+AjxDurationFormatVerbose=function(){};
+AjxDurationFormatVerbose.formatYears=function(a,e){
+var t=a+" ";
+t+=(a>1)?AjxMsg.years:AjxMsg.year;
+if(a<=3&&e>0){
+t+=" "+e;
+t+=" "+((e>1)?AjxMsg.months:AjxMsg.months)
+}
+return t
+};
+AjxDurationFormatVerbose.formatMonths=function(e,a){
+var t=e+" ";
+t+=(e>1)?AjxMsg.months:AjxMsg.month;
+if(e<=3&&a>0){
+t+=" "+a;
+t+=" "+((a>1)?AjxMsg.days:AjxMsg.day)
+}
+return t
+};
+AjxDurationFormatVerbose.formatDays=function(a,e){
+var t=a+" ";
+t+=(a>1)?AjxMsg.days:AjxMsg.day;
+if(a<=2&&e>0){
+t+=" "+e;
+t+=" "+((e>1)?AjxMsg.hours:AjxMsg.hour)
+}
+return t
+};
+AjxDurationFormatVerbose.formatHours=function(e,a){
+var t=e+" ";
+t+=(e>1)?AjxMsg.hours:AjxMsg.hour;
+if(e<5&&a>0){
+t+=" "+a;
+t+=" "+((a>1)?AjxMsg.minutes:AjxMsg.minute)
+}
+return t
+};
+AjxDurationFormatVerbose.formatMinutes=function(a,t){
+var e=a+" ";
+e+=((a>1)?AjxMsg.minutes:AjxMsg.minute);
+if(a<5&&t>0){
+e+=" "+t;
+e+=" "+((t>1)?AjxMsg.seconds:AjxMsg.second)
+}
+return e
+};
+AjxDurationFormatVerbose.formatSeconds=function(e){
+return(e+" "+((e>1)?AjxMsg.seconds:AjxMsg.second))
+};
+AjxDurationFormatConcise=function(){};
+AjxDurationFormatConcise.formatYears=function(t,e){
+return this._format(t,e)
+};
+AjxDurationFormatConcise.formatMonths=function(e,t){
+return this._format(e,t)
+};
+AjxDurationFormatConcise.formatDays=function(t,e){
+return this._format(t,e)
+};
+AjxDurationFormatConcise.formatHours=function(e,t){
+return this._format(e,t)
+};
+AjxDurationFormatConcise.formatMinutes=function(t,e){
+return this._format(t,e)
+};
+AjxDurationFormatConcise.formatSeconds=function(e){
+return this._format(0,e)
+};
+AjxDurationFormatConcise._format=function(o,t){
+var n=0;
+var e=[];
+e[n++]=o;
+e[n++]=":";
+if(t<10){
+e[n++]="0"
+}
+e[n++]=t;
+return e.join("")
+};
+AjxDateUtil.SUNDAY=0;
+AjxDateUtil.MONDAY=1;
+AjxDateUtil.TUESDAY=2;
+AjxDateUtil.WEDNESDAY=3;
+AjxDateUtil.THURSDAY=4;
+AjxDateUtil.FRIDAY=5;
+AjxDateUtil.SATURDAY=6;
+AjxDateUtil.getDateForNextDay=function(t,n,o){
+o=o||1;
+var a=new Date(t);
+for(var e=0;
+e<o;
+e++){
+a=AjxDateUtil._getDateForNextWeekday(a,n);
+if(e<o-1){
+a.setDate(a.getDate()+1)
+}}
+return a
+};
+AjxDateUtil.getDateForNextWorkWeekDay=function(t,o){
+o=o?o:1;
+var a=new Date(t);
+for(var e=0;
+e<o;
+e++){
+a=AjxDateUtil._getDateForNextWorkWeekday(a);
+if(e<o-1){
+a.setDate(a.getDate()+1)
+}}
+return a
+};
+AjxDateUtil.getDateForThisDay=function(e,a,t){
+if(t<0){
+return AjxDateUtil.getDateForPrevDay(e,a,-t)
+}else{
+return AjxDateUtil.getDateForNextDay(e,a,t)
+}};
+AjxDateUtil.getDateForThisWorkWeekDay=function(e,t){
+if(t<0){
+return AjxDateUtil.getDateForPrevWorkWeekDay(e,-t)
+}else{
+return AjxDateUtil.getDateForNextWorkWeekDay(e,t)
+}};
+AjxDateUtil.getDateForPrevDay=function(t,n,o){
+o=o||1;
+var a=new Date(t);
+for(var e=0;
+e<o;
+e++){
+a=AjxDateUtil._getDateForPrevWeekday(a,n);
+if(e<o-1){
+a.setDate(a.getDate()-1)
+}}
+return a
+};
+AjxDateUtil.getDateForPrevWorkWeekDay=function(t,o){
+o=o||1;
+var a=new Date(t);
+for(var e=0;
+e<o;
+e++){
+a=AjxDateUtil._getDateForPrevWorkWeekday(a);
+if(e<o-1){
+a.setDate(a.getDate()-1)
+}}
+return a
+};
+AjxDateUtil._getDateForNextWeekday=function(a,n){
+var e=new Date(a);
+var t=a.getDay();
+if(t==n){
+return e
+}
+var o=(n-t);
+if(o>0){
+e.setDate(a.getDate()+o)
+}else{
+e.setDate(a.getDate()+(7+o))
+}
+return e
+};
+AjxDateUtil._getDateForNextWorkWeekday=function(a){
+var e=new Date(a);
+var t=a.getDay();
+if(t==AjxDateUtil.SUNDAY){
+e.setDate(a.getDate()+1)
+}else{
+if(t==AjxDateUtil.SATURDAY){
+e.setDate(a.getDate()+2)
+}}
+return e
+};
+AjxDateUtil._getDateForPrevWeekday=function(a,n){
+var e=new Date(a);
+var t=a.getDay();
+if(t==n){
+return e
+}
+var o=(t-n);
+if(o>0){
+e.setDate(a.getDate()-o)
+}else{
+e.setDate(a.getDate()-(7+o))
+}
+return e
+};
+AjxDateUtil._getDateForPrevWorkWeekday=function(a){
+var e=new Date(a);
+var t=a.getDay();
+if(t==AjxDateUtil.SUNDAY){
+e.setDate(a.getDate()-2)
+}else{
+if(t==AjxDateUtil.SATURDAY){
+e.setDate(a.getDate()-1)
+}}
+return e
+};
+AjxDateUtil.calculate=function(f,n){
+if(!AjxDateUtil.__calculate_initialized){
+AjxDateUtil.__calculate_initialized=true;
+AjxDateUtil.__calculate_init()
+}
+var e=n||new Date;
+f=f.replace(/^\s*|\s*$/,"").replace(/\s*=\s*/g,"=").replace(/\s*,\s*/g,",");
+var p=f.split(/\s+/g);
+var y,r,o,h,u,d,g,t;
+for(var c=0;
+c<p.length;
+c++){
+y=p[c];
+if(y.match(AjxDateUtil.RE_COMMENT)){
+break
+}
+if(y.match(AjxDateUtil.RE_NOW)){
+n=new Date(e.getTime());
+continue
+}
+if(r=y.match(AjxDateUtil.RE_ADD_NUMBER)){
+o=r[1];
+h=AjxDateUtil.__calculate_parseInt(r[2]);
+u=p[++c];
+d=o=="+"?h:h*-1;
+AjxDateUtil.__calculate_add(n,u,d);
+continue
+}
+if(r=y.match(AjxDateUtil.RE_ADD_WEEKORD)){
+o=r[1];
+g=r[2];
+t=p[++c];
+d=o=="+"?h:h*-1;
+AjxDateUtil.__calculate_add_ordinal(n,u,d);
+continue
+}
+if(r=y.match(AjxDateUtil.RE_SET)){
+AjxDateUtil.__calculate_set(n,r[1],r[2]);
+continue
+}
+n=AjxDateFormat.parse("yyyyy-MM-dd",y);
+if(!n&&(n=AjxDateFormat.parse("yyyy-MM-dd'T'hh:mm:ss'Z'",y))){
+n.setMinutes(n.getMinutes()-n.getTimezoneOffset())
+}
+if(!n){
+n=AjxDateFormat.parse("yyyy-MM-dd'T'HH:mm:ss",y)
+}
+if(!n){
+throw'invalid date pattern: "'+y+'"'
+}}
+return n
+};
+AjxDateUtil.S_DAYNAME=[AjxMsg["calc.dayname.sunday"],AjxMsg["calc.dayname.monday"],AjxMsg["calc.dayname.tuesday"],AjxMsg["calc.dayname.wednesday"],AjxMsg["calc.dayname.thursday"],AjxMsg["calc.dayname.friday"],AjxMsg["calc.dayname.saturday"]].join("|");
+AjxDateUtil.S_MONTHNAME=[AjxMsg["calc.monthname.january"],AjxMsg["calc.monthname.february"],AjxMsg["calc.monthname.march"],AjxMsg["calc.monthname.april"],AjxMsg["calc.monthname.may"],AjxMsg["calc.monthname.june"],AjxMsg["calc.monthname.july"],AjxMsg["calc.monthname.august"],AjxMsg["calc.monthname.september"],AjxMsg["calc.monthname.october"],AjxMsg["calc.monthname.november"],AjxMsg["calc.monthname.december"]].join("|");
+AjxDateUtil.S_WEEKORD=[AjxMsg["calc.ordinal.first"],AjxMsg["calc.ordinal.second"],AjxMsg["calc.ordinal.third"],AjxMsg["calc.ordinal.fourth"],AjxMsg["calc.ordinal.fifth"],AjxMsg["calc.ordinal.last"]].join("|");
+AjxMsg["calc.now"]="now";
+AjxMsg["calc.date"]="date";
+AjxMsg["calc.duration.year"]="year|years";
+AjxMsg["calc.duration.month"]="month|months";
+AjxMsg["calc.duration.day"]="day|days";
+AjxMsg["calc.duration.hour"]="hour|hours";
+AjxMsg["calc.duration.minute"]="min|mins|minute|minutes";
+AjxMsg["calc.duration.second"]="sec|secs|second|seconds";
+AjxMsg["calc.duration.millisecond"]="milli|millis|millisecond|milliseconds";
+AjxDateUtil.S_DURATION=[AjxMsg["calc.duration.year"],AjxMsg["calc.duration.month"],AjxMsg["calc.duration.day"],AjxMsg["calc.duration.hour"],AjxMsg["calc.duration.minute"],AjxMsg["calc.duration.second"],AjxMsg["calc.duration.millisecond"]].join("|");
+AjxDateUtil.__calculate_init=function(){
+AjxDateUtil.WEEKDAYS={};
+var t=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];
+for(var o=0;
+o<t.length;
+o++){
+var n=AjxMsg["calc.dayname."+t[o]].split("|");
+for(var a=0;
+a<n.length;
+a++){
+AjxDateUtil.WEEKDAYS[n[a].toLowerCase()]=o
+}}
+AjxDateUtil.MONTHNAME2MONTHNUM={};
+var e=["january","february","march","april","may","june","july","august","september","october","november","december"];
+for(var o=0;
+o<e.length;
+o++){
+var s=AjxMsg["calc.monthname."+e[o]].split("|");
+for(var a=0;
+a<s.length;
+a++){
+AjxDateUtil.MONTHNAME2MONTHNUM[s[a].toLowerCase()]=o
+}}
+AjxDateUtil.RE_YEAR=new RegExp("^("+AjxMsg["calc.duration.year"]+")$","i");
+AjxDateUtil.RE_MONTH=new RegExp("^("+AjxMsg["calc.duration.month"]+")$","i");
+AjxDateUtil.RE_WEEK=new RegExp("^("+AjxMsg["calc.duration.week"]+")$","i");
+AjxDateUtil.RE_DAY=new RegExp("^("+AjxMsg["calc.duration.day"]+")$","i");
+AjxDateUtil.RE_HOUR=new RegExp("^("+AjxMsg["calc.duration.hour"]+")$","i");
+AjxDateUtil.RE_MINUTE=new RegExp("^("+AjxMsg["calc.duration.minute"]+")$","i");
+AjxDateUtil.RE_SECOND=new RegExp("^("+AjxMsg["calc.duration.second"]+")$","i");
+AjxDateUtil.RE_MILLISECOND=new RegExp("^("+AjxMsg["calc.duration.millisecond"]+")$","i");
+AjxDateUtil.RE_DATE=new RegExp("^("+AjxMsg["calc.date"]+")$","i");
+AjxDateUtil.RE_DAYNAME=new RegExp("^("+AjxDateUtil.S_DAYNAME+")$","i");
+AjxDateUtil.RE_MONTHNAME=new RegExp("^("+AjxDateUtil.S_MONTHNAME+")$","i");
+AjxDateUtil.RE_WEEKORD=new RegExp("^("+AjxDateUtil.S_WEEKORD+")$","i");
+AjxDateUtil.RE_COMMENT=/^#/;
+AjxDateUtil.RE_NOW=new RegExp("^("+AjxMsg["calc.now"]+")$","i");
+AjxDateUtil.RE_ADD_NUMBER=new RegExp("^([+\\-])(\\d+)$","i");
+AjxDateUtil.RE_ADD_WEEKORD=new RegExp("^([+\\-])("+AjxDateUtil.S_WEEKORD+")$","i");
+AjxDateUtil.RE_SET=new RegExp("^("+AjxDateUtil.S_DURATION+"|"+AjxMsg["calc.date"]+")=(.*)$","i")
+};
+AjxDateUtil.__calculate_normalizeFullWidthDigit=function(t){
+var e="0".charCodeAt(0)+t.charCodeAt(0)-"\uff10".charCodeAt(0);
+return String.fromCharCode(e)
+};
+AjxDateUtil.__calculate_replaceFullWidthDigit=function(e,t){
+return AjxDateUtil.__calculate_normalizeFullWidthDigit(t)
+};
+AjxDateUtil.__calculate_parseInt=function(e){
+e=e.replace(/([\uFF10-\uFF19])/g,AjxDateUtil.__calculate_normalizeFullWidthDigit);
+return parseInt(e,10)
+};
+AjxDateUtil.__calculate_add=function(a,n,o){
+if(n.match(AjxDateUtil.RE_YEAR)){
+a.setFullYear(a.getFullYear()+o);
+return
+}
+if(n.match(AjxDateUtil.RE_MONTH)){
+var s=a.getMonth();
+a.setMonth(s+o);
+if(Math.abs(s+o)%12!=a.getMonth()){
+a.setDate(0)
+}
+return
+}
+if(n.match(AjxDateUtil.RE_WEEK)){
+a.setDate(a.getDate()+o*7);
+return
+}
+if(n.match(AjxDateUtil.RE_DAY)){
+a.setDate(a.getDate()+o);
+return
+}
+if(n.match(AjxDateUtil.RE_HOUR)){
+a.setHours(a.getHours()+o);
+return
+}
+if(n.match(AjxDateUtil.RE_MINUTE)){
+a.setMinutes(a.getMinutes()+o);
+return
+}
+if(n.match(AjxDateUtil.RE_SECOND)){
+a.setSeconds(a.getSeconds()+o);
+return
+}
+if(n.match(AjxDateUtil.RE_MILLISECOND)){
+a.setMilliseconds(a.getMilliseconds()+o);
+return
+}
+if(n.match(AjxDateUtil.RE_MONTHNAME)){
+var e=AjxDateUtil.MONTHNAME2MONTHNUM[n.toLowerCase()];
+if(e<a.getMonth()){
+o+=o>0?0:1
+}else{
+if(e>a.getMonth()){
+o+=o>0?-1:0
+}}
+a.setFullYear(a.getFullYear()+o,e,1);
+return
+}
+if(n.match(AjxDateUtil.RE_DAYNAME)){
+var t=AjxDateUtil.WEEKDAYS[n.toLowerCase()];
+if(t<a.getDay()){
+o+=o>0?0:1
+}else{
+if(t>a.getDay()){
+o+=o>0?-1:0
+}}
+a.setDate(a.getDate()+(t-a.getDay())+7*o);
+return
+}
+throw"unknown type: "+n
+};
+AjxDateUtil.__calculate_add_ordinal=function(){
+throw"TODO: not implemented"
+};
+AjxDateUtil.__calculate_set=function(t,a,o){
+var e=o.split(/,/);
+if(a.match(AjxDateUtil.RE_YEAR)){
+e[0]=AjxDateUtil.__calculate_fullYear(e[0]);
+if(e[1]!=null){
+e[1]=AjxDateUtil.__calculate_month(e[1])
+}
+if(e[2]!=null){
+e[2]=parseInt(e[2],10)
+}
+t.setFullYear.apply(t,e);
+return
+}
+if(a.match(AjxDateUtil.RE_MONTH)){
+e[0]=AjxDateUtil.__calculate_month(e[0]);
+if(e[1]!=null){
+e[1]=parseInt(e[1],10)
+}
+t.setMonth.apply(t,e);
+return
+}
+if(a.match(AjxDateUtil.RE_DATE)){
+e[0]=parseInt(e[0],10);
+t.setDate.apply(t,e);
+return
+}
+if(a.match(AjxDateUtil.RE_HOUR)){
+e[0]=parseInt(e[0],10);
+if(e[1]!=null){
+e[1]=parseInt(e[1],10)
+}
+if(e[2]!=null){
+e[2]=parseInt(e[2],10)
+}
+if(e[3]!=null){
+e[3]=parseInt(e[3],10)
+}
+t.setHours.apply(t,e);
+return
+}
+if(a.match(AjxDateUtil.RE_MINUTE)){
+e[0]=parseInt(e[0],10);
+if(e[1]!=null){
+e[1]=parseInt(e[1],10)
+}
+if(e[2]!=null){
+e[2]=parseInt(e[2],10)
+}
+t.setMinutes.apply(t,e);
+return
+}
+if(a.match(AjxDateUtil.RE_SECOND)){
+e[0]=parseInt(e[0],10);
+if(e[1]!=null){
+e[1]=parseInt(e[1],10)
+}
+t.setSeconds.apply(t,e);
+return
+}
+if(a.match(AjxDateUtil.RE_MILLISECOND)){
+t.setMilliseconds.apply(t,e);
+return
+}
+throw"unknown type: "+a
+};
+AjxDateUtil.__calculate_fullYear=function(e){
+if(e.length==2){
+var t=new Date;
+t.setYear(parseInt(e,10));
+e=String(t.getFullYear()).substr(0,2)+e
+}
+return parseInt(e,10)
+};
+AjxDateUtil.__calculate_month=function(t){
+var e=AjxDateUtil.MONTHNAME2MONTHNUM[t.toLowerCase()];
+return e!=null?e:parseInt(t,10)-1
+};
+AjxDateUtil.__calculate_day=function(t){
+var e=AjxDateUtil.WEEKDAYS[t.toLowerCase()];
+return e!=null?e:parseInt(t,10)
+}
+}
+if(AjxPackage.define("ajax.util.AjxTimezoneData")){
+AjxTimezoneData={};
+AjxTimezoneData.TRANSITION_YEAR=2010;
+AjxTimezoneData.TIMEZONE_RULES=[{
+serverId:"Etc/GMT+12",clientId:"Etc/GMT+12",standard:{
+offset:-720,tzname:"GMT+12"}}
+,{
+serverId:"Pacific/Midway",clientId:"Pacific/Midway",standard:{
+offset:-660,tzname:"SST"}}
+,{
+serverId:"Pacific/Honolulu",clientId:"Pacific/Honolulu",standard:{
+offset:-600,tzname:"HST"}}
+,{
+serverId:"America/Anchorage",clientId:"America/Anchorage",standard:{
+offset:-540,mon:11,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2010,11,7],tzname:"AKST"}
+,daylight:{
+offset:-480,mon:3,week:2,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,14],tzname:"AKDT"}}
+,{
+serverId:"America/Los_Angeles",clientId:"America/Los_Angeles",standard:{
+offset:-480,mon:11,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2010,11,7],tzname:"PST"}
+,daylight:{
+offset:-420,mon:3,week:2,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,14],tzname:"PDT"}}
+,{
+serverId:"America/Tijuana",clientId:"America/Tijuana",standard:{
+offset:-480,mon:10,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,10,31],tzname:"PST"}
+,daylight:{
+offset:-420,mon:4,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2010,4,4],tzname:"PDT"}}
+,{
+serverId:"America/Chihuahua",clientId:"America/Chihuahua",standard:{
+offset:-420,mon:10,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,10,31],tzname:"MST"}
+,daylight:{
+offset:-360,mon:4,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2010,4,4],tzname:"MDT"}}
+,{
+serverId:"America/Denver",clientId:"America/Denver",standard:{
+offset:-420,mon:11,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2010,11,7],tzname:"MST"}
+,daylight:{
+offset:-360,mon:3,week:2,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,14],tzname:"MDT"}}
+,{
+serverId:"America/Phoenix",clientId:"America/Phoenix",standard:{
+offset:-420,tzname:"MST"}}
+,{
+serverId:"America/Chicago",clientId:"America/Chicago",standard:{
+offset:-360,mon:11,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2010,11,7],tzname:"CST"}
+,daylight:{
+offset:-300,mon:3,week:2,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,14],tzname:"CDT"}}
+,{
+serverId:"America/Guatemala",clientId:"America/Guatemala",standard:{
+offset:-360}}
+,{
+serverId:"America/Mexico_City",clientId:"America/Mexico_City",standard:{
+offset:-360,mon:10,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,10,31],tzname:"CST"}
+,daylight:{
+offset:-300,mon:4,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2010,4,4],tzname:"CDT"}}
+,{
+serverId:"America/Regina",clientId:"America/Regina",standard:{
+offset:-360,tzname:"CST"}}
+,{
+serverId:"America/Bogota",clientId:"America/Bogota",standard:{
+offset:-300}}
+,{
+serverId:"America/Indiana/Indianapolis",clientId:"America/Indiana/Indianapolis",standard:{
+offset:-300,mon:11,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2010,11,7],tzname:"EST"}
+,daylight:{
+offset:-240,mon:3,week:2,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,14],tzname:"EDT"}}
+,{
+serverId:"America/New_York",clientId:"America/New_York",standard:{
+offset:-300,mon:11,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2010,11,7],tzname:"EST"}
+,daylight:{
+offset:-240,mon:3,week:2,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,14],tzname:"EDT"}}
+,{
+serverId:"America/Caracas",clientId:"America/Caracas",standard:{
+offset:-270,tzname:"VET"}}
+,{
+serverId:"America/Guyana",clientId:"America/Guyana",standard:{
+offset:-240,tzname:"GYT"}}
+,{
+serverId:"America/Halifax",clientId:"America/Halifax",standard:{
+offset:-240,mon:11,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2010,11,7],tzname:"AST"}
+,daylight:{
+offset:-180,mon:3,week:2,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,14],tzname:"ADT"}}
+,{
+serverId:"America/La_Paz",clientId:"America/La_Paz",standard:{
+offset:-240,tzname:"BOT"}}
+,{
+serverId:"America/Manaus",clientId:"America/Manaus",standard:{
+offset:-240,tzname:"AMT"}}
+,{
+serverId:"America/Santiago",clientId:"America/Santiago",standard:{
+offset:-240,mon:3,week:3,wkday:1,hour:0,min:0,sec:0,trans:[2010,3,21],tzname:"CLT"}
+,daylight:{
+offset:-180,mon:10,week:2,wkday:1,hour:0,min:0,sec:0,trans:[2010,10,10],tzname:"CLST"}}
+,{
+serverId:"America/St_Johns",clientId:"America/St_Johns",standard:{
+offset:-210,mon:11,week:1,wkday:1,hour:0,min:1,sec:0,trans:[2010,11,7],tzname:"NST"}
+,daylight:{
+offset:-150,mon:3,week:2,wkday:1,hour:0,min:1,sec:0,trans:[2010,3,14],tzname:"NDT"}}
+,{
+serverId:"America/Argentina/Buenos_Aires",clientId:"America/Argentina/Buenos_Aires",standard:{
+offset:-180}}
+,{
+serverId:"America/Godthab",clientId:"America/Godthab",standard:{
+offset:-180,mon:10,week:-1,wkday:1,hour:1,min:0,sec:0,trans:[2010,10,31],tzname:"WGT"}
+,daylight:{
+offset:-120,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,28],tzname:"WGST"}}
+,{
+serverId:"America/Montevideo",clientId:"America/Montevideo",standard:{
+offset:-180,mon:3,week:2,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,14],tzname:"UYT"}
+,daylight:{
+offset:-120,mon:10,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2010,10,3],tzname:"UYST"}}
+,{
+serverId:"America/Sao_Paulo",clientId:"America/Sao_Paulo",standard:{
+offset:-180,mon:2,week:3,wkday:1,hour:0,min:0,sec:0,trans:[2010,2,21],tzname:"BRT"}
+,daylight:{
+offset:-120,mon:10,week:3,wkday:1,hour:0,min:0,sec:0,trans:[2010,10,17],tzname:"BRST"}}
+,{
+serverId:"Atlantic/South_Georgia",clientId:"Atlantic/South_Georgia",standard:{
+offset:-120,tzname:"GST"}}
+,{
+serverId:"Atlantic/Azores",clientId:"Atlantic/Azores",standard:{
+offset:-60,mon:10,week:-1,wkday:1,hour:1,min:0,sec:0,trans:[2010,10,31],tzname:"AZOT"}
+,daylight:{
+offset:0,mon:3,week:-1,wkday:1,hour:0,min:0,sec:0,trans:[2010,3,28],tzname:"AZOST"}}
+,{
+serverId:"Atlantic/Cape_Verde",clientId:"Atlantic/Cape_Verde",standard:{
+offset:-60,tzname:"CVT"}}
+,{
+serverId:"Africa/Casablanca",clientId:"Africa/Casablanca",standard:{
+offset:0,mon:8,week:3,wkday:6,hour:0,min:0,sec:0,trans:[2010,8,20],tzname:"WET"}
+,daylight:{
+offset:60,mon:6,week:1,wkday:2,hour:0,min:0,sec:0,trans:[2010,6,7],tzname:"WEST"}}
+,{
+serverId:"Africa/Monrovia",clientId:"Africa/Monrovia",standard:{
+offset:0,tzname:"GMT"}}
+,{
+serverId:"Europe/London",clientId:"Europe/London",standard:{
+offset:0,mon:10,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,10,31],tzname:"GMT/BST"}
+,daylight:{
+offset:60,mon:3,week:-1,wkday:1,hour:1,min:0,sec:0,trans:[2010,3,28],tzname:"GMT/BST"}}
+,{
+serverId:"Africa/Algiers",clientId:"Africa/Algiers",standard:{
+offset:60,tzname:"CET"}}
+,{
+serverId:"Africa/Windhoek",clientId:"Africa/Windhoek",standard:{
+offset:60,mon:4,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2010,4,4],tzname:"WAT"}
+,daylight:{
+offset:120,mon:9,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2010,9,5],tzname:"WAST"}}
+,{
+serverId:"Europe/Belgrade",clientId:"Europe/Belgrade",standard:{
+offset:60,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2010,10,31],tzname:"CET"}
+,daylight:{
+offset:120,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,28],tzname:"CEST"}}
+,{
+serverId:"Europe/Berlin",clientId:"Europe/Berlin",standard:{
+offset:60,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2010,10,31],tzname:"CET"}
+,daylight:{
+offset:120,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,28],tzname:"CEST"}}
+,{
+serverId:"Europe/Brussels",clientId:"Europe/Brussels",standard:{
+offset:60,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2010,10,31],tzname:"CET"}
+,daylight:{
+offset:120,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,28],tzname:"CEST"}}
+,{
+serverId:"Europe/Warsaw",clientId:"Europe/Warsaw",standard:{
+offset:60,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2010,10,31],tzname:"CET"}
+,daylight:{
+offset:120,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,28],tzname:"CEST"}}
+,{
+serverId:"Africa/Cairo",clientId:"Africa/Cairo",standard:{
+offset:120,mon:8,week:3,wkday:5,hour:0,min:0,sec:0,trans:[2010,8,19],tzname:"EET"}
+,daylight:{
+offset:180,mon:4,week:-1,wkday:6,hour:0,min:0,sec:0,trans:[2010,4,30],tzname:"EEST"}}
+,{
+serverId:"Africa/Harare",clientId:"Africa/Harare",standard:{
+offset:120,tzname:"CAT"}}
+,{
+serverId:"Asia/Amman",clientId:"Asia/Amman",standard:{
+offset:120,mon:10,week:-1,wkday:6,hour:1,min:0,sec:0,trans:[2010,10,29],tzname:"EET"}
+,daylight:{
+offset:180,mon:3,week:-1,wkday:5,hour:23,min:59,sec:59,trans:[2010,3,25],tzname:"EEST"}}
+,{
+serverId:"Asia/Beirut",clientId:"Asia/Beirut",standard:{
+offset:120,mon:10,week:-1,wkday:1,hour:0,min:0,sec:0,trans:[2010,10,31],tzname:"EET"}
+,daylight:{
+offset:180,mon:3,week:-1,wkday:1,hour:0,min:0,sec:0,trans:[2010,3,28],tzname:"EEST"}}
+,{
+serverId:"Asia/Jerusalem",clientId:"Asia/Jerusalem",standard:{
+offset:120,mon:9,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,9,26],tzname:"IST"}
+,daylight:{
+offset:180,mon:3,week:-1,wkday:6,hour:2,min:0,sec:0,trans:[2010,3,26],tzname:"IDT"}}
+,{
+serverId:"Europe/Athens",clientId:"Europe/Athens",standard:{
+offset:120,mon:10,week:-1,wkday:1,hour:4,min:0,sec:0,trans:[2010,10,31],tzname:"EET"}
+,daylight:{
+offset:180,mon:3,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2010,3,28],tzname:"EEST"}}
+,{
+serverId:"Europe/Helsinki",clientId:"Europe/Helsinki",standard:{
+offset:120,mon:10,week:-1,wkday:1,hour:4,min:0,sec:0,trans:[2010,10,31],tzname:"EET"}
+,daylight:{
+offset:180,mon:3,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2010,3,28],tzname:"EEST"}}
+,{
+serverId:"Europe/Minsk",clientId:"Europe/Minsk",standard:{
+offset:120,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2010,10,31],tzname:"EET"}
+,daylight:{
+offset:180,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,28],tzname:"EEST"}}
+,{
+serverId:"Africa/Nairobi",clientId:"Africa/Nairobi",standard:{
+offset:180,tzname:"EAT"}}
+,{
+serverId:"Asia/Baghdad",clientId:"Asia/Baghdad",standard:{
+offset:180}}
+,{
+serverId:"Asia/Kuwait",clientId:"Asia/Kuwait",standard:{
+offset:180,tzname:"AST"}}
+,{
+serverId:"Europe/Moscow",clientId:"Europe/Moscow",standard:{
+offset:180,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2010,10,31],tzname:"MSK/MSD"}
+,daylight:{
+offset:240,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,28],tzname:"MSK/MSD"}}
+,{
+serverId:"Asia/Tehran",clientId:"Asia/Tehran",standard:{
+offset:210,mon:9,week:4,wkday:3,hour:0,min:0,sec:0,trans:[2010,9,28],tzname:"IRST"}
+,daylight:{
+offset:270,mon:3,week:4,wkday:1,hour:0,min:0,sec:0,trans:[2010,3,28],tzname:"IRDT"}}
+,{
+serverId:"Asia/Baku",clientId:"Asia/Baku",standard:{
+offset:240,mon:10,week:-1,wkday:1,hour:5,min:0,sec:0,trans:[2010,10,31],tzname:"AZT"}
+,daylight:{
+offset:300,mon:3,week:-1,wkday:1,hour:4,min:0,sec:0,trans:[2010,3,28],tzname:"AZST"}}
+,{
+serverId:"Asia/Muscat",clientId:"Asia/Muscat",standard:{
+offset:240,tzname:"GST"}}
+,{
+serverId:"Asia/Tbilisi",clientId:"Asia/Tbilisi",standard:{
+offset:240,tzname:"GET"}}
+,{
+serverId:"Asia/Yerevan",clientId:"Asia/Yerevan",standard:{
+offset:240,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2010,10,31],tzname:"AMT"}
+,daylight:{
+offset:300,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,28],tzname:"AMST"}}
+,{
+serverId:"Asia/Kabul",clientId:"Asia/Kabul",standard:{
+offset:270,tzname:"AFT"}}
+,{
+serverId:"Asia/Karachi",clientId:"Asia/Karachi",standard:{
+offset:300,mon:11,week:1,wkday:1,hour:0,min:0,sec:0,trans:[2010,11,7],tzname:"PKT"}
+,daylight:{
+offset:360,mon:4,week:3,wkday:4,hour:0,min:0,sec:0,trans:[2010,4,21],tzname:"PKST"}}
+,{
+serverId:"Asia/Tashkent",clientId:"Asia/Tashkent",standard:{
+offset:300,tzname:"UZT"}}
+,{
+serverId:"Asia/Yekaterinburg",clientId:"Asia/Yekaterinburg",standard:{
+offset:300,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2010,10,31],tzname:"YEKT"}
+,daylight:{
+offset:360,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,28],tzname:"YEKST"}}
+,{
+serverId:"Asia/Colombo",clientId:"Asia/Colombo",standard:{
+offset:330,tzname:"IST"}}
+,{
+serverId:"Asia/Kolkata",clientId:"Asia/Kolkata",standard:{
+offset:330,tzname:"IST"}}
+,{
+serverId:"Asia/Dhaka",clientId:"Asia/Dhaka",standard:{
+offset:360,tzname:"BDT"}}
+,{
+serverId:"Asia/Novosibirsk",clientId:"Asia/Novosibirsk",standard:{
+offset:360,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2010,10,31],tzname:"NOVT"}
+,daylight:{
+offset:420,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,28],tzname:"NOVST"}}
+,{
+serverId:"Asia/Rangoon",clientId:"Asia/Rangoon",standard:{
+offset:390,tzname:"MMT"}}
+,{
+serverId:"Asia/Bangkok",clientId:"Asia/Bangkok",standard:{
+offset:420,tzname:"ICT"}}
+,{
+serverId:"Asia/Krasnoyarsk",clientId:"Asia/Krasnoyarsk",standard:{
+offset:420,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2010,10,31],tzname:"KRAT"}
+,daylight:{
+offset:480,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,28],tzname:"KRAST"}}
+,{
+serverId:"Asia/Hong_Kong",clientId:"Asia/Hong_Kong",standard:{
+offset:480}}
+,{
+serverId:"Asia/Irkutsk",clientId:"Asia/Irkutsk",standard:{
+offset:480,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2010,10,31],tzname:"IRKT"}
+,daylight:{
+offset:540,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,28],tzname:"IRKST"}}
+,{
+serverId:"Asia/Kuala_Lumpur",clientId:"Asia/Kuala_Lumpur",standard:{
+offset:480,tzname:"MYT"}}
+,{
+serverId:"Asia/Taipei",clientId:"Asia/Taipei",standard:{
+offset:480}}
+,{
+serverId:"Australia/Perth",clientId:"Australia/Perth",standard:{
+offset:480,tzname:"WST"}}
+,{
+serverId:"Asia/Seoul",clientId:"Asia/Seoul",standard:{
+offset:540}}
+,{
+serverId:"Asia/Tokyo",clientId:"Asia/Tokyo",standard:{
+offset:540}}
+,{
+serverId:"Asia/Yakutsk",clientId:"Asia/Yakutsk",standard:{
+offset:540,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2010,10,31],tzname:"YAKT"}
+,daylight:{
+offset:600,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,28],tzname:"YAKST"}}
+,{
+serverId:"Australia/Adelaide",clientId:"Australia/Adelaide",standard:{
+offset:570,mon:4,week:1,wkday:1,hour:3,min:0,sec:0,trans:[2010,4,4],tzname:"CST"}
+,daylight:{
+offset:630,mon:10,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2010,10,3],tzname:"CST"}}
+,{
+serverId:"Australia/Darwin",clientId:"Australia/Darwin",standard:{
+offset:570,tzname:"CST"}}
+,{
+serverId:"Asia/Vladivostok",clientId:"Asia/Vladivostok",standard:{
+offset:600,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2010,10,31],tzname:"VLAT"}
+,daylight:{
+offset:660,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,28],tzname:"VLAST"}}
+,{
+serverId:"Australia/Brisbane",clientId:"Australia/Brisbane",standard:{
+offset:600,tzname:"EST"}}
+,{
+serverId:"Australia/Hobart",clientId:"Australia/Hobart",standard:{
+offset:600,mon:4,week:1,wkday:1,hour:3,min:0,sec:0,trans:[2010,4,4],tzname:"EST"}
+,daylight:{
+offset:660,mon:10,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2010,10,3],tzname:"EST"}}
+,{
+serverId:"Australia/Sydney",clientId:"Australia/Sydney",standard:{
+offset:600,mon:4,week:1,wkday:1,hour:3,min:0,sec:0,trans:[2010,4,4],tzname:"EST"}
+,daylight:{
+offset:660,mon:10,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2010,10,3],tzname:"EST"}}
+,{
+serverId:"Pacific/Guam",clientId:"Pacific/Guam",standard:{
+offset:600,tzname:"ChST"}}
+,{
+serverId:"Asia/Magadan",clientId:"Asia/Magadan",standard:{
+offset:660,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2010,10,31],tzname:"MAGT"}
+,daylight:{
+offset:720,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,3,28],tzname:"MAGST"}}
+,{
+serverId:"Pacific/Auckland",clientId:"Pacific/Auckland",standard:{
+offset:720,mon:4,week:1,wkday:1,hour:3,min:0,sec:0,trans:[2010,4,4],tzname:"NZST"}
+,daylight:{
+offset:780,mon:9,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2010,9,26],tzname:"NZDT"}}
+,{
+serverId:"Pacific/Fiji",clientId:"Pacific/Fiji",standard:{
+offset:720}}
+,{
+serverId:"Pacific/Tongatapu",clientId:"Pacific/Tongatapu",standard:{
+offset:780}}
+]
+}
+if(AjxPackage.define("ajax.util.AjxTimezone")){
+AjxTimezone=function(){};
+AjxTimezone.getTransition=function(o,a){
+var t=[a||new Date().getFullYear(),o.mon,1];
+if(o.mday){
+t[2]=o.mday
+}else{
+if(o.wkday){
+var e=new Date(a,o.mon-1,1,o.hour,o.min,o.sec);
+if(o.week==-1){
+var s=new Date(new Date(e.getTime()).setMonth(o.mon,0));
+var n=s.getDate();
+var h=s.getDay()+1;
+var r=h>=o.wkday?h-o.wkday:7-o.wkday-h;
+t[2]=n-r
+}else{
+var h=e.getDay()+1;
+var r=o.wkday==h?1:0;
+t[2]=o.wkday+7*(o.week-r)-h+1
+}}}
+return t
+};
+AjxTimezone.createMDayTransition=function(e,a){
+if(e instanceof Date){
+a=a!=null?a:e.getTimezoneOffset();
+e=[e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds()]
+}
+var t={
+offset:a,trans:e};
+return AjxTimezone.addMDayTransition(t)
+};
+AjxTimezone.addMDayTransition=function(t){
+var e=t.trans;
+t.mon=e[1];
+t.mday=e[2];
+t.hour=e[3];
+t.min=e[4];
+t.sec=e[5];
+return t
+};
+AjxTimezone.createWkDayTransition=function(e,a){
+if(e instanceof Date){
+a=a!=null?a:e.getTimezoneOffset();
+e=[e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds()]
+}
+var t={
+offset:a,trans:e};
+return AjxTimezone.addWkDayTransition(t)
+};
+AjxTimezone.addWkDayTransition=function(n){
+var a=n.trans;
+var o=a[1];
+var h=a[2];
+var t=Math.floor((h-1)/7);
+var e=new Date(a[0],a[1]-1,a[2],12,0,0);
+var r=new Date(new Date(e.getTime()).setMonth(o-1,0)).getDate();
+var s=r-h<7;
+n.mon=o;
+n.week=s?-1:t+1;
+n.wkday=e.getDay()+1;
+n.hour=a[3];
+n.min=a[4];
+n.sec=a[5];
+return n
+};
+AjxTimezone.createTransitionDate=function(o){
+var e=new Date(AjxTimezoneData.TRANSITION_YEAR,o.mon-1,1,12,0,0);
+if(o.mday){
+e.setDate(o.mday)
+}else{
+if(o.week==-1){
+e.setMonth(e.getMonth()+1,0);
+for(var a=0;
+a<7;
+a++){
+if(e.getDay()+1==o.wkday){
+break
+}
+e.setDate(e.getDate()-1)
+}}else{
+for(var a=0;
+a<7;
+a++){
+if(e.getDay()+1==o.wkday){
+break
+}
+e.setDate(e.getDate()+1)
+}
+e.setDate(e.getDate()+7*(o.week-1))
+}}
+var t=[e.getFullYear(),e.getMonth()+1,e.getDate()];
+return t
+};
+AjxTimezone.getZonePreferences=function(){
+if(AjxTimezone._PREF_ZONE_DISPLAY){
+var a=AjxTimezone._PREF_ZONE_DISPLAY.length;
+var t=AjxTimezone.STANDARD_RULES.length+AjxTimezone.DAYLIGHT_RULES.length;
+if(a!=t){
+AjxTimezone._PREF_ZONE_DISPLAY=null
+}}
+if(!AjxTimezone._PREF_ZONE_DISPLAY){
+AjxTimezone._PREF_ZONE_DISPLAY=[];
+AjxTimezone.getAbbreviatedZoneChoices();
+for(var e=0;
+e<AjxTimezone._ABBR_ZONE_OPTIONS.length;
+e++){
+AjxTimezone._PREF_ZONE_DISPLAY.push(AjxTimezone._ABBR_ZONE_OPTIONS[e].displayValue)
+}}
+return AjxTimezone._PREF_ZONE_DISPLAY
+};
+AjxTimezone.getZonePreferencesOptions=function(){
+if(AjxTimezone._PREF_ZONE_OPTIONS){
+var a=AjxTimezone._PREF_ZONE_OPTIONS.length;
+var t=AjxTimezone.STANDARD_RULES.length+AjxTimezone.DAYLIGHT_RULES.length;
+if(a!=t){
+AjxTimezone._PREF_ZONE_OPTIONS=null
+}}
+if(!AjxTimezone._PREF_ZONE_OPTIONS){
+AjxTimezone._PREF_ZONE_OPTIONS=[];
+AjxTimezone.getAbbreviatedZoneChoices();
+for(var e=0;
+e<AjxTimezone._ABBR_ZONE_OPTIONS.length;
+e++){
+AjxTimezone._PREF_ZONE_OPTIONS.push(AjxTimezone._ABBR_ZONE_OPTIONS[e].serverid)
+}}
+return AjxTimezone._PREF_ZONE_OPTIONS
+};
+AjxTimezone.getServerId=function(e){
+return AjxTimezone._CLIENT2SERVER[e]||e
+};
+AjxTimezone.getClientId=function(e){
+return AjxTimezone._SERVER2CLIENT[e]||e
+};
+AjxTimezone.getShortName=function(e){
+var t=AjxTimezone.getRule(e);
+if(!t.shortName){
+t.shortName=["GMT",AjxTimezone._SHORT_NAMES[e]].join("")
+}
+return t.shortName
+};
+AjxTimezone.getMediumName=function(e){
+var t=AjxTimezone.getRule(e);
+if(!t.mediumName){
+t.mediumName=AjxMsg[e]||["(",AjxTimezone.getShortName(e),") ",e].join("")
+}
+return t.mediumName
+};
+AjxTimezone.getLongName=AjxTimezone.getMediumName;
+AjxTimezone.addRule=function(a){
+var t=a.serverId;
+var e=a.clientId;
+AjxTimezone._CLIENT2SERVER[e]=t;
+AjxTimezone._SERVER2CLIENT[t]=e;
+AjxTimezone._SHORT_NAMES[e]=AjxTimezone._generateShortName(a.standard.offset);
+AjxTimezone._CLIENT2RULE[e]=a;
+var o=a.daylight?AjxTimezone.DAYLIGHT_RULES:AjxTimezone.STANDARD_RULES;
+o.push(a)
+};
+AjxTimezone.getRule=function(e,o){
+var d=AjxTimezone._CLIENT2RULE[e];
+if(!d){
+e=AjxTimezone._SERVER2CLIENT[e];
+d=AjxTimezone._CLIENT2RULE[e]
+}
+if(!d&&o){
+var c=["standard","daylight"];
+var u=o.daylight?AjxTimezone.DAYLIGHT_RULES:AjxTimezone.STANDARD_RULES;
+for(var s=0;
+s<u.length;
+s++){
+d=u[s];
+var m=true;
+for(var n=0;
+n<c.length;
+n++){
+var t=c[n];
+var r=d[t];
+if(!r){
+continue
+}
+var h=false;
+for(var a in o[t]){
+if(o[t][a]!=r[a]){
+m=false;
+h=true;
+break
+}}
+if(h){
+break
+}}
+if(m){
+return d
+}}
+return null
+}
+return d
+};
+AjxTimezone.getOffset=function(e,n){
+var f=AjxTimezone.getRule(e||AjxTimezone.DEFAULT);
+if(f&&f.daylight){
+var u=n.getFullYear();
+var r=f.standard,t=f.daylight;
+var d=AjxTimezone.getTransition(r,u);
+var g=AjxTimezone.getTransition(t,u);
+var c=n.getMonth()+1,m=n.getDate();
+var s=d[1],p=d[2];
+var h=g[1],o=g[2];
+var a=false;
+if(h<s){
+a=c>h&&c<s;
+a=a||(c==h&&m>=o);
+a=a||(c==s&&m<p)
+}else{
+a=c<h||c>s;
+a=a||(c==h&&m<o);
+a=a||(c==s&&m>=p)
+}
+return a?t.offset:r.offset
+}
+return f?f.standard.offset:-(new Date().getTimezoneOffset())
+};
+AjxTimezone.guessMachineTimezone=function(){
+return AjxTimezone._guessMachineTimezone().clientId
+};
+AjxTimezone.getAbbreviatedZoneChoices=function(){
+if(AjxTimezone._ABBR_ZONE_OPTIONS){
+var n=AjxTimezone._ABBR_ZONE_OPTIONS.length;
+var o=AjxTimezone.STANDARD_RULES.length+AjxTimezone.DAYLIGHT_RULES.length;
+if(n!=o){
+AjxTimezone._ABBR_ZONE_OPTIONS=null
+}}
+if(!AjxTimezone._ABBR_ZONE_OPTIONS){
+AjxTimezone._ABBR_ZONE_OPTIONS=[];
+for(var e in AjxTimezone._CLIENT2SERVER){
+var s=AjxTimezone._CLIENT2RULE[e];
+var t=s.serverId;
+var a={
+displayValue:AjxTimezone.getMediumName(e),value:t,standard:s.standard,serverid:t,clientId:e};
+AjxTimezone._ABBR_ZONE_OPTIONS.push(a)
+}
+AjxTimezone._ABBR_ZONE_OPTIONS.sort(AjxTimezone._BY_OFFSET)
+}
+return AjxTimezone._ABBR_ZONE_OPTIONS
+};
+AjxTimezone.getMatchingTimezoneChoices=function(){
+if(AjxTimezone._MATCHING_ZONE_OPTIONS){
+var s=AjxTimezone._MATCHING_ZONE_OPTIONS.length;
+var n=AjxTimezone.STANDARD_RULES.length+AjxTimezone.DAYLIGHT_RULES.length;
+if(s!=n){
+AjxTimezone._MATCHING_ZONE_OPTIONS=null
+}}
+if(!AjxTimezone._MATCHING_ZONE_OPTIONS){
+AjxTimezone._MATCHING_ZONE_OPTIONS=[];
+for(var a in AjxTimezone.MATCHING_RULES){
+var r=AjxTimezone.MATCHING_RULES[a];
+var e=r.clientId;
+var t=r.serverId;
+if(e==AjxTimezone.AUTO_DETECTED){
+continue
+}
+var o={
+displayValue:AjxTimezone.getMediumName(e),value:t,standard:r.standard,serverid:t,clientId:e};
+AjxTimezone._MATCHING_ZONE_OPTIONS.push(o)
+}
+AjxTimezone._MATCHING_ZONE_OPTIONS.sort(AjxTimezone._BY_OFFSET)
+}
+return AjxTimezone._MATCHING_ZONE_OPTIONS
+};
+AjxTimezone._BY_OFFSET=function(a,t){
+var n=a.standard.offset-t.standard.offset;
+if(n==0){
+var e=a.serverId;
+var o=t.serverId;
+if(e<o){
+n=-1
+}else{
+if(e>o){
+n=1
+}}}
+return n
+};
+AjxTimezone.GMT="Europe/London";
+AjxTimezone.GMT_NO_DST="Africa/Casablanca";
+AjxTimezone.AUTO_DETECTED="Auto-Detected";
+AjxTimezone.DEFAULT;
+AjxTimezone.DEFAULT_RULE;
+AjxTimezone._CLIENT2SERVER={};
+AjxTimezone._SERVER2CLIENT={};
+AjxTimezone._SHORT_NAMES={};
+AjxTimezone._CLIENT2RULE={};
+AjxTimezone.STANDARD_RULES=[];
+AjxTimezone.DAYLIGHT_RULES=[];
+(function(){
+for(var e=0;
+e<AjxTimezoneData.TIMEZONE_RULES.length;
+e++){
+var t=AjxTimezoneData.TIMEZONE_RULES[e];
+var a=t.daylight?AjxTimezone.DAYLIGHT_RULES:AjxTimezone.STANDARD_RULES;
+a.push(t)
+}}
+)();
+AjxTimezone._guessMachineTimezone=function(p){
+var m=new Date(AjxTimezoneData.TRANSITION_YEAR,11,1,0,0,0);
+var k=new Date(AjxTimezoneData.TRANSITION_YEAR,5,1,0,0,0);
+var t=-m.getTimezoneOffset();
+var y=-k.getTimezoneOffset();
+AjxTimezone.MATCHING_RULES=[];
+AjxTimezone.TIMEZONE_CONFLICT=false;
+var d=[];
+var s={};
+var r=[];
+var g=false;
+if(y==t){
+var f=AjxTimezone.STANDARD_RULES;
+for(var w=0;
+w<f.length;
+++w){
+var h=f[w];
+if(h.standard.offset==y){
+if(!s[h.serverId]){
+d.push(h);
+s[h.serverId]=true
+}
+AjxTimezone.MATCHING_RULES.push(h)
+}}}else{
+var f=AjxTimezone.DAYLIGHT_RULES;
+var j=Math.max(t,y);
+var x=Math.min(t,y);
+var o=new Date();
+var v=-o.getTimezoneOffset();
+for(var w=0;
+w<f.length;
+++w){
+var h=f[w];
+if(h.standard.offset==x&&h.daylight.offset==j){
+var c=h.standard.trans;
+var u=h.daylight.trans;
+var n=new Date(c[0],c[1]-1,c[2]-1);
+var a=new Date(c[0],c[1]-1,c[2]+2);
+var e=new Date(u[0],u[1]-1,u[2]-1);
+var q=new Date(u[0],u[1]-1,u[2]+2);
+if(-a.getTimezoneOffset()==x&&-q.getTimezoneOffset()==j&&-n.getTimezoneOffset()==j&&-e.getTimezoneOffset()==x){
+if(!s[h.serverId]){
+d.push(h);
+s[h.serverId]=true
+}
+g=true
+}}
+if(h.standard.offset==v||h.daylight.offset==v){
+AjxTimezone.MATCHING_RULES.push(h)
+}}}
+if((d.length>0)&&p!=null){
+var f=d;
+for(var w in f){
+if(f[w].serverId==p){
+return f[w]
+}}}
+if(d.length>0){
+AjxTimezone.TIMEZONE_CONFLICT=(d.length>1);
+return d[0]
+}
+if((AjxTimezone.MATCHING_RULES.length>0)&&p!=null){
+var f=AjxTimezone.MATCHING_RULES;
+for(var w in f){
+if(f[w].serverId==p){
+return f[w]
+}}}
+return AjxTimezone._generateDefaultRule()
+};
+AjxTimezone._generateDefaultRule=function(){
+var d=0;
+var a=1;
+var o=2;
+var r=3;
+var n=4;
+function u(f,m,k,x){
+var g=m.getTime();
+var v=new Date();
+v.setTime(f.getTime());
+var w=new Date();
+w.setTime(v.getTime());
+var q=f.getTimezoneOffset()*-1;
+if(!x){
+x={
+clientId:AjxTimezone.AUTO_DETECTED,autoDetected:true}
+}
+while(v.getTime()<=g){
+if(k==d){
+v.setUTCMonth(v.getUTCMonth()+1)
+}else{
+if(k==a){
+v.setUTCDate(v.getUTCDate()+1)
+}else{
+if(k==o){
+v.setUTCHours(v.getUTCHours()+1)
+}else{
+if(k==r){
+v.setUTCMinutes(v.getUTCMinutes()+1)
+}else{
+if(k==n){
+v.setUTCSeconds(v.getUTCSeconds()+1)
+}else{
+return x
+}}}}}
+var p=v.getTimezoneOffset()*-1;
+if(p!=q){
+if(k<n){
+x=u(w,v,k+1,x)
+}else{
+var j=new Date();
+j.setUTCFullYear(w.getFullYear(),w.getMonth(),w.getDate());
+j.setUTCHours(w.getHours(),w.getMinutes(),w.getSeconds()+1);
+var y=x[q<p?"daylight":"standard"]={
+offset:p,trans:[j.getUTCFullYear(),j.getUTCMonth()+1,j.getUTCDate(),j.getUTCHours(),j.getUTCMinutes(),j.getUTCSeconds()]};
+AjxTimezone.addWkDayTransition(y);
+return x
+}}
+w.setTime(v.getTime());
+q=p
+}
+return x
+}
+var t=new Date();
+var e=new Date();
+var h=t.getFullYear();
+t.setUTCFullYear(h,t.getMonth(),t.getDate()-1);
+t.setUTCHours(0,0,0,0);
+e.setTime(t.getTime());
+e.setUTCFullYear(h+1,t.getMonth(),t.getDate()+1);
+var c=u(t,e,d);
+if(!c.daylight||!c.standard){
+c.standard={
+offset:t.getTimezoneOffset()*-1};
+delete c.daylight
+}
+c.serverId=["(GMT",AjxTimezone._generateShortName(c.standard.offset,true),") ",AjxTimezone.AUTO_DETECTED].join("");
+if(c.daylight&&c.daylight.offset<c.standard.offset){
+var s=c.daylight;
+c.daylight=c.standard;
+c.standard=s
+}
+return c
+};
+AjxTimezone._generateShortName=function(s,n){
+if(s==0){
+return""
+}
+var t=s<0?"-":"+";
+var a=Math.abs(s);
+var e=Math.floor(a/60);
+var o=a%60;
+e=e<10?"0"+e:e;
+o=o<10?"0"+o:o;
+return[t,e,n?".":"",o].join("")
+};
+AjxTimezone.DEFAULT_RULE=AjxTimezone._guessMachineTimezone();
+(function(){
+AjxTimezoneData.TIMEZONE_RULES.sort(AjxTimezone._BY_OFFSET);
+for(var e=0;
+e<AjxTimezoneData.TIMEZONE_RULES.length;
+e++){
+var t=AjxTimezoneData.TIMEZONE_RULES[e];
+AjxTimezone.addRule(t)
+}}
+)();
+AjxTimezone.DEFAULT=AjxTimezone.getClientId(AjxTimezone.DEFAULT_RULE.serverId)
+}
+if(AjxPackage.define("ajax.util.AjxEmailAddress")){
+AjxEmailAddress=function(e,o,t,a,n){
+this.address=e;
+this.name=this._setName(t);
+this.dispName=a;
+this.type=o||AjxEmailAddress.TO;
+this.isGroup=n;
+this.isAjxEmailAddress=true
+};
+AjxEmailAddress.FROM="FROM";
+AjxEmailAddress.TO="TO";
+AjxEmailAddress.CC="CC";
+AjxEmailAddress.BCC="BCC";
+AjxEmailAddress.REPLY_TO="REPLY_TO";
+AjxEmailAddress.SENDER="SENDER";
+AjxEmailAddress.READ_RECEIPT="READ_RECEIPT";
+AjxEmailAddress.TYPE_STRING={};
+AjxEmailAddress.TYPE_STRING[AjxEmailAddress.FROM]="from";
+AjxEmailAddress.TYPE_STRING[AjxEmailAddress.TO]="to";
+AjxEmailAddress.TYPE_STRING[AjxEmailAddress.CC]="cc";
+AjxEmailAddress.TYPE_STRING[AjxEmailAddress.BCC]="bcc";
+AjxEmailAddress.TYPE_STRING[AjxEmailAddress.REPLY_TO]="replyTo";
+AjxEmailAddress.TYPE_STRING[AjxEmailAddress.SENDER]="sender";
+AjxEmailAddress.TYPE_STRING[AjxEmailAddress.READ_RECEIPT]="readReceipt";
+AjxEmailAddress.fromSoapType={};
+AjxEmailAddress.fromSoapType.f=AjxEmailAddress.FROM;
+AjxEmailAddress.fromSoapType.t=AjxEmailAddress.TO;
+AjxEmailAddress.fromSoapType.c=AjxEmailAddress.CC;
+AjxEmailAddress.fromSoapType.b=AjxEmailAddress.BCC;
+AjxEmailAddress.fromSoapType.r=AjxEmailAddress.REPLY_TO;
+AjxEmailAddress.fromSoapType.s=AjxEmailAddress.SENDER;
+AjxEmailAddress.fromSoapType.n=AjxEmailAddress.READ_RECEIPT;
+AjxEmailAddress.toSoapType={};
+AjxEmailAddress.toSoapType[AjxEmailAddress.FROM]="f";
+AjxEmailAddress.toSoapType[AjxEmailAddress.TO]="t";
+AjxEmailAddress.toSoapType[AjxEmailAddress.CC]="c";
+AjxEmailAddress.toSoapType[AjxEmailAddress.BCC]="b";
+AjxEmailAddress.toSoapType[AjxEmailAddress.REPLY_TO]="r";
+AjxEmailAddress.toSoapType[AjxEmailAddress.SENDER]="s";
+AjxEmailAddress.toSoapType[AjxEmailAddress.READ_RECEIPT]="n";
+AjxEmailAddress.SEPARATOR="; ";
+AjxEmailAddress.DELIMS=[";",",","\n"," "];
+AjxEmailAddress.IS_DELIM={};
+for(var i=0;
+i<AjxEmailAddress.DELIMS.length;
+i++){
+AjxEmailAddress.IS_DELIM[AjxEmailAddress.DELIMS[i]]=true
+}
+AjxEmailAddress.addrAnglePat=/(\s*<(((\s*([^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+(\.[^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+)*)\s*)|(\s*"(([^\\"])|(\\([^\x0A\x0D])))+"\s*))\@((\s*([^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+(\.[^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+)*)\s*)|(\s*\[(\s*(([^\[\]\\])|(\\([^\x0A\x0D])))+)*\s*\]\s*)))>\s*)/;
+AjxEmailAddress.addrAngleQuotePat=/(\s*<'(((\s*([^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+(\.[^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+)*)\s*)|(\s*"(([^\\"])|(\\([^\x0A\x0D])))+"\s*))\@((\s*([^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+(\.[^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+)*)\s*)|(\s*\[(\s*(([^\[\]\\])|(\\([^\x0A\x0D])))+)*\s*\]\s*)))'>\s*)/;
+AjxEmailAddress.addrPat=/(((\s*([^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+(\.[^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+)*)\s*)|(\s*"(([^\\"])|(\\([^\x0A\x0D])))+"\s*))\@((\s*([^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+(\.[^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+)*)\s*)|(\s*\[(\s*(([^\[\]\\])|(\\([^\x0A\x0D])))+)*\s*\]\s*)))/;
+AjxEmailAddress.addrPat1=/(^|"|\s)(((\s*([^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+(\.[^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+)*)\s*)|(\s*"(([^\\"])|(\\([^\x0A\x0D])))+"\s*))\@((\s*([^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+(\.[^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+)*)\s*)|(\s*\[(\s*(([^\[\]\\])|(\\([^\x0A\x0D])))+)*\s*\]\s*)))/;
+AjxEmailAddress.accountPat=/((\s*([^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+(\.[^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+)*)\s*)|(\s*"(([^\\"])|(\\([^\x0A\x0D])))+"\s*))/;
+AjxEmailAddress.commentPat=/\((.*)\)/g;
+AjxEmailAddress.phrasePat=/(((\s*[^\x00-\x1F\x7F()<>\[\]:;@\"\s]+\s*)|(\s*"(([^\\"])|(\\([^\x0A\x0D])))+"\s*))+)/;
+AjxEmailAddress.boundAddrPat=/(\s*<?(((\s*([^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+(\.[^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+)*)\s*)|(\s*"(([^\\"])|(\\([^\x0A\x0D])))+"\s*))\@((\s*([^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+(\.[^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+)*)\s*)|(\s*\[(\s*(([^\[\]\\])|(\\([^\x0A\x0D])))+)*\s*\]\s*)))>?\s*)$/;
+AjxEmailAddress.parse=function(o){
+var n,e;
+var o=AjxStringUtil.trim(o);
+var t=AjxEmailAddress._prelimCheck(o);
+if(!(t&&o.match(AjxEmailAddress.addrPat))){
+return null
+}
+var a=o.match(AjxEmailAddress.addrAngleQuotePat)||o.match(AjxEmailAddress.addrAnglePat);
+if(a&&a.length){
+n=a[2];
+o=o.replace(AjxEmailAddress.addrAnglePat,"")
+}else{
+a=o.match(AjxEmailAddress.addrPat1);
+if(a&&a.length){
+n=o.match(AjxEmailAddress.addrPat);
+n=(n&&n.length&&n[0]!="")?AjxStringUtil.trim(n[0]):a[0];
+o=o.replace(AjxEmailAddress.addrPat,"")
+}}
+a=o.match(AjxEmailAddress.phrasePat);
+if(a){
+e=AjxStringUtil.trim(AjxStringUtil.trim(a[0]),false,'"')
+}
+return new AjxEmailAddress(n,null,e)
+};
+AjxEmailAddress.parseEmailString=function(a,u,m){
+var n=new AjxVector();
+var t=new AjxVector();
+var f=new AjxVector();
+var h=AjxEmailAddress.split(a);
+for(var r=0;
+r<h.length;
+r++){
+var c=AjxStringUtil.trim(h[r]);
+if(c){
+var d=AjxEmailAddress.parse(c);
+if(!d&&!m){
+var p=c;
+var s=p.match(AjxEmailAddress.addrAnglePat);
+if(s&&s.length){
+var e=p.replace(AjxEmailAddress.addrAnglePat,"");
+var o=['"',e,'" ',s[0]].join("");
+d=AjxEmailAddress.parse(o);
+if(d){
+d.name=e
+}}}
+if(d){
+d.type=u;
+
+n.add(d);
+f.add(d)
+}else{
+t.add(c);
+f.add(new AjxEmailAddress(c))
+}}}
+return{
+good:n,bad:t,all:f}
+};
+AjxEmailAddress.isValid=function(t){
+t=AjxStringUtil.trim(t);
+var e=AjxEmailAddress._prelimCheck(t);
+return(e&&(t.match(AjxEmailAddress.addrPat)!=null))
+};
+AjxEmailAddress._prelimCheck=function(a){
+var e=a.indexOf("@");
+var t=a.lastIndexOf(".");
+return((e!=-1)&&(t!=-1)&&(t>e))
+};
+AjxEmailAddress.split=function(g){
+g=AjxStringUtil.trim(g);
+var p=[];
+var y=0,m=0;
+var w="",s="";
+var r=false;
+while(y<g.length){
+var a=g.charAt(y);
+if((a=='"'||a=="(")&&w!="\\"){
+r=true;
+s=a;
+m=y;
+y++;
+while(r&&y<g.length){
+var a=g.charAt(y);
+if(((s=='"'&&a=='"')||(s=="("&&a==")"))&&(w!="\\")){
+p.push({
+start:m,end:y}
+);
+r=false
+}
+y++;
+w=a
+}}else{
+y++
+}
+w=a
+}
+if(p.length){
+AjxEmailAddress.IS_DELIM[" "]=false
+}
+m=0;
+var u=[];
+while(m<g.length){
+var t=g.substring(m,g.length);
+y=0;
+var n=t.length;
+while((n==t.length)&&(y<t.length)){
+var a=t.charAt(y);
+if(AjxEmailAddress.IS_DELIM[a]){
+var o=false;
+if(a!="\n"){
+for(var c=0;
+c<p.length;
+c++){
+var d=p[c];
+var e=m+y;
+o=(e>=d.start&&e<=d.end);
+if(o){
+break
+}}}
+if(!o){
+var h=true;
+var f=t.substring(0,y);
+if(a==","||a==" "){
+h=f.match(AjxEmailAddress.boundAddrPat)
+}
+if(h){
+u.push(f);
+n=y;
+m+=f.length+1
+}}
+a=g.charAt(m);
+while((m<g.length)&&AjxEmailAddress.IS_DELIM[a]){
+m++;
+a=g.charAt(m)
+}
+y++
+}else{
+y++
+}}
+if(n==t.length){
+u.push(t);
+m+=t.length+1
+}}
+AjxEmailAddress.IS_DELIM[" "]=true;
+return u
+};
+AjxEmailAddress.prototype.toString=function(){
+if(this.name&&!this.isGroup){
+var e=this.name.replace(/\\+"/g,'"');
+e=e.replace(/"/g,'\\"');
+return['"',e,'" <',this.address,">"].join("")
+}else{
+return this.address
+}};
+AjxEmailAddress.prototype.getAddress=function(){
+return this.address
+};
+AjxEmailAddress.prototype.setAddress=function(e){
+this.address=e
+};
+AjxEmailAddress.prototype.getType=function(){
+return this.type
+};
+AjxEmailAddress.prototype.setType=function(e){
+this.type=e
+};
+AjxEmailAddress.prototype.getTypeAsString=function(){
+return AjxEmailAddress.TYPE_STRING[this.type]
+};
+AjxEmailAddress.prototype.getName=function(){
+return this.name
+};
+AjxEmailAddress.prototype.getDispName=function(){
+return this.dispName
+};
+AjxEmailAddress.prototype.clone=function(){
+var e=new AjxEmailAddress(this.address,this.type,this.name,this.dispName);
+e.icon=this.icon;
+return e
+};
+AjxEmailAddress.copy=function(e){
+var t=new AjxEmailAddress(e.address,e.type,e.name,e.dispName);
+t.icon=e.icon;
+return t
+};
+AjxEmailAddress.prototype._setName=function(e){
+if(!e){
+return""
+}
+if(e&&e.charAt(0)=="'"&&e.charAt(e.length-1)=="'"){
+e=e.substring(1,e.length-1)
+}
+return e
+}
+}
+if(AjxPackage.define("ajax.util.AjxHistoryMgr")){
+AjxHistoryMgr=function(){
+this.currentLocation=null;
+this.listener=null;
+this.iframe=null;
+this.ignoreLocationChange=null;
+this.WAIT_TIME=AjxEnv.isIE?400:200;
+this.currentWaitTime=0;
+this.ieAtomicLocationChange=null;
+this._eventMgr=new AjxEventMgr();
+this._evt=new AjxEvent();
+this._initialize()
+};
+AjxHistoryMgr.BLANK_FILE="blankHistory.html";
+AjxHistoryMgr.IFRAME_ID="DhtmlHistoryFrame";
+AjxHistoryMgr.LOCATION_CHECK_INTERVAL=100;
+AjxHistoryMgr.prototype.addListener=function(e){
+return this._eventMgr.addListener(AjxEvent.HISTORY,e)
+};
+AjxHistoryMgr.prototype.removeListener=function(e){
+return this._eventMgr.removeListener(AjxEvent.HISTORY,e)
+};
+AjxHistoryMgr.prototype.add=function(a){
+var e=this;
+var t=function(){
+if(e.currentWaitTime>0){
+e.currentWaitTime=e.currentWaitTime-e.WAIT_TIME
+}
+a=e._removeHash(a);
+if(AjxEnv.isIE){
+if(document.getElementById(a)){
+throw new DwtException("AjxHistoryMgr: location has same ID as DOM element")
+}}
+e.ignoreLocationChange=true;
+this.ieAtomicLocationChange=true;
+e.currentLocation=a;
+window.location.hash=a;
+if(AjxEnv.isIE){
+e.iframe.src=AjxHistoryMgr.BLANK_FILE+"?"+a
+}
+this.ieAtomicLocationChange=false
+};
+window.setTimeout(t,this.currentWaitTime);
+this.currentWaitTime=this.currentWaitTime+e.WAIT_TIME
+};
+AjxHistoryMgr.prototype.getCurrentLocation=function(){
+return this._removeHash(window.location.hash)
+};
+AjxHistoryMgr.prototype._initialize=function(){
+var e=this.getCurrentLocation();
+this.currentLocation=e;
+if(AjxEnv.isIE){
+var n=[];
+var o=0;
+n[o++]="<iframe style='border: 0px; width: 1px; ";
+n[o++]="height: 1px; position: absolute; bottom: 0px; ";
+n[o++]="right: 0px; visibility: visible;' ";
+n[o++]="id='"+AjxHistoryMgr.IFRAME_ID+"' ";
+n[o++]="src='"+AjxHistoryMgr.BLANK_FILE+"?"+e+"'>";
+n[o++]="</iframe>";
+var s=document.createElement("div");
+document.body.appendChild(s);
+s.innerHTML=n.join("")
+}
+if(AjxEnv.isIE){
+this.iframe=document.getElementById(AjxHistoryMgr.IFRAME_ID)
+}
+var t=this;
+var a=function(){
+t._checkLocation()
+};
+setInterval(a,AjxHistoryMgr.LOCATION_CHECK_INTERVAL)
+};
+AjxHistoryMgr.prototype._checkLocation=function(){
+if(!AjxEnv.isIE&&this.ignoreLocationChange){
+this.ignoreLocationChange=false;
+return
+}
+if(!AjxEnv.isIE&&this.ieAtomicLocationChange){
+return
+}
+var e=this.getCurrentLocation();
+if(e==this.currentLocation){
+return
+}
+this.ieAtomicLocationChange=true;
+if(AjxEnv.isIE&&this._getIFrameHash()!=e){
+this.iframe.src=AjxHistoryMgr.BLANK_FILE+"?"+e
+}else{
+if(AjxEnv.isIE){
+return
+}}
+this.currentLocation=e;
+this.ieAtomicLocationChange=false;
+this._evt.data=e;
+this._eventMgr.notifyListeners(AjxEvent.HISTORY,this._evt)
+};
+AjxHistoryMgr.prototype._getIFrameHash=function(){
+var e=document.getElementById(AjxHistoryMgr.IFRAME_ID);
+var a=e.contentWindow.document;
+var t=new String(a.location.search);
+if(t.length==1&&t.charAt(0)=="?"){
+t=""
+}else{
+if(t.length>=2&&t.charAt(0)=="?"){
+t=t.substring(1)
+}}
+return t
+};
+AjxHistoryMgr.prototype._removeHash=function(e){
+if(e==null||e==undefined){
+return null
+}else{
+if(e==""){
+return""
+}else{
+if(e.length==1&&e.charAt(0)=="#"){
+return""
+}else{
+if(e.length>1&&e.charAt(0)=="#"){
+return e.substring(1)
+}else{
+return e
+}}}}};
+AjxHistoryMgr.prototype.iframeLoaded=function(e){
+if(this.ignoreLocationChange){
+this.ignoreLocationChange=false;
+return
+}
+var t=new String(e.search);
+if(t.length==1&&t.charAt(0)=="?"){
+t=""
+}else{
+if(t.length>=2&&t.charAt(0)=="?"){
+t=t.substring(1)
+}}
+window.location.hash=t;
+this._evt.data=t;
+this._eventMgr.notifyListeners(AjxEvent.HISTORY,this._evt)
+}
+}
+if(AjxPackage.define("ajax.xml.AjxSerializer")){
+AjxSerializer=function(){
+if(arguments.length==0){
+return
+}};
+AjxSerializer.prototype.serialize=function(e){
+throw"NOT IMPLEMENTED"
+};
+AjxJsonSerializer=function(e){
+AjxSerializer.call(this,null);
+this._minimize=Boolean(e)
+};
+AjxJsonSerializer.prototype=new AjxSerializer;
+AjxJsonSerializer.prototype.constructor=AjxJsonSerializer;
+AjxJsonSerializer.E_ATTRS="_attrs";
+AjxJsonSerializer.A_CONTENT="_content";
+AjxJsonSerializer.A_NAMESPACE="_jsns";
+AjxJsonSerializer.prototype.serialize=function(r){
+var t={};
+var p=0;
+var u=null;
+for(var o=r.firstChild;
+o;
+o=o.nextSibling){
+var m=o.nodeType;
+if(m==1){
+var e=o.nodeName;
+if(!t[e]){
+t[e]=[];
+p++
+}
+t[e].push(o);
+continue
+}
+if(m==3||m==4){
+if(!u){
+u=[]
+}
+u.push(o.nodeValue);
+continue
+}}
+var y={};
+var s=0;
+if(r.attributes){
+for(var c=0;
+c<r.attributes.length;
+c++){
+var d=r.attributes[c];
+var e=d.nodeName;
+var g=this.quote(d.nodeValue);
+if(t[e]){
+y[e]=g;
+s++
+}else{
+t[e]=g;
+p++
+}}}
+u=u&&u.join("");
+if(u&&u.match(/^\s*$/)){
+u=null
+}
+if(u){
+u=this.quote(u);
+if(s==0&&p==0){
+return u
+}}
+if(u==null&&p==0&&s==0){
+return"{}"
+}
+var f=["{"];
+if(u){
+f.push(this.quote(AjxJsonSerializer.A_CONTENT),":",u);
+if(s>0||p>0){
+f.push(",")
+}}
+if(s>0){
+f.push(this.quote(AjxJsonSerializer.E_ATTRS),": { ");
+var c=0;
+for(var e in y){
+if(c>0){
+f.push(",")
+}
+f.push(this.quote(e),":",y[e]);
+c++
+}
+f.push("}");
+if(p>0){
+f.push(", ")
+}}
+var h=0;
+for(var e in t){
+if(h>0){
+f.push(",")
+}
+var n=t[e];
+if(typeof n=="string"){
+f.push(this.quote(e),":",n);
+h++;
+continue
+}
+f.push(this.quote(e),":");
+if(!this._minimize||n.length>1){
+f.push("[")
+}
+for(var c=0;
+c<n.length;
+c++){
+if(c>0){
+f.push(",")
+}
+
+f.push(this.serialize(n[c]))
+}
+if(!this._minimize||n.length>1){
+f.push("]")
+}
+h++
+}
+f.push("}");
+return f.join("")
+};
+AjxJsonSerializer.prototype.quote=function(e){
+return['"',this.escape(e),'"'].join("")
+};
+AjxJsonSerializer.prototype.escape=function(e){
+return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n")
+}
+}
+if(AjxPackage.define("ajax.dwt.core.DwtId")){
+DwtId=function(){};
+DwtId.SEP="__";
+DwtId.WIDGET_LIST_VIEW="zl";
+DwtId.WIDGET_HDR="zlh";
+DwtId.WIDGET_HDR_TABLE="zlht";
+DwtId.WIDGET_HDR_ICON="zlhi";
+DwtId.WIDGET_HDR_LABEL="zlhl";
+DwtId.WIDGET_HDR_ARROW="zlha";
+DwtId.WIDGET_HDR_SASH="zlhs";
+DwtId.WIDGET_ITEM="zli";
+DwtId.WIDGET_ITEM_ROW="zlir";
+DwtId.WIDGET_ITEM_CELL="zlic";
+DwtId.WIDGET_ITEM_FIELD="zlif";
+DwtId.LIST_VIEW_HEADERS="headers";
+DwtId.LIST_VIEW_ROWS="rows";
+DwtId.IFRAME="iframe";
+DwtId.DND_PLUS_ID="z__roundPlus";
+DwtId._makeId=function(){
+var a=[];
+for(var t=0;
+t<arguments.length;
+t++){
+var e=arguments[t];
+if(e!=null&&e!=""){
+a.push(e)
+}}
+return a.join(DwtId.SEP)
+};
+DwtId.getListViewId=function(t,e){
+return DwtId._makeId(DwtId.WIDGET_LIST_VIEW,t,e)
+};
+DwtId.getListViewHdrId=function(t,e,a){
+return DwtId._makeId(t,e,a)
+};
+DwtId.getListViewItemId=function(t,e,o,a){
+return DwtId._makeId(t,e,o,a)
+};
+DwtId.getIframeId=function(e){
+return DwtId._makeId(e,DwtId.IFRAME)
+}
+}
+if(AjxPackage.define("ajax.dwt.core.Dwt")){
+Dwt=function(){};
+Dwt.STATIC_STYLE="static";
+Dwt.ABSOLUTE_STYLE="absolute";
+Dwt.RELATIVE_STYLE="relative";
+Dwt.FIXED_STYLE="fixed";
+Dwt.NO_REPEAT="no-repeat";
+Dwt.REPEAT="repeat";
+Dwt.REPEAT_X="repeat-x";
+Dwt.REPEAT_Y="repeat-y";
+Dwt.DISPLAY_INLINE="inline";
+Dwt.DISPLAY_BLOCK="block";
+Dwt.DISPLAY_NONE="none";
+Dwt.DISPLAY_TABLE_ROW=AjxEnv.isIE?Dwt.DISPLAY_BLOCK:"table-row";
+Dwt.DISPLAY_TABLE_CELL=AjxEnv.isIE?Dwt.DISPLAY_BLOCK:"table-cell";
+Dwt.CLIP=1;
+Dwt.VISIBLE=2;
+Dwt.SCROLL=3;
+Dwt.FIXED_SCROLL=4;
+Dwt.SCROLL_Y=5;
+Dwt.SCROLL_X=6;
+Dwt.Z_HIDDEN=100;
+Dwt.Z_CURTAIN=200;
+Dwt.Z_VIEW=300;
+Dwt.Z_MENU=500;
+Dwt.Z_VEIL=600;
+Dwt.Z_DIALOG=700;
+Dwt.Z_DIALOG_MENU=750;
+Dwt.Z_TOOLTIP=775;
+Dwt.Z_DND=800;
+Dwt.Z_BUSY=900;
+Dwt.Z_TOAST=950;
+Dwt.Z_SPLASH=1000;
+Dwt.DEFAULT=-123456789;
+Dwt.CLEAR=-20000;
+Dwt.LOC_NOWHERE=-10000;
+Dwt.DND_DROP_NONE=0;
+Dwt.DND_DROP_COPY=1;
+Dwt.DND_DROP_MOVE=2;
+Dwt.SCROLLBAR_WIDTH=22;
+Dwt.KEY_OBJECT="_object_";
+Dwt.KEY_ID="_id_";
+Dwt._Z_INC=1;
+Dwt.__nextId={};
+Dwt.getNextId=function(e){
+if(arguments.length==0){
+e="DWT"
+}
+if(!Dwt.__nextId[e]){
+Dwt.__nextId[e]=1
+}
+return e+Dwt.__nextId[e]++
+};
+Dwt.associateElementWithObject=function(a,e,t){
+a[t||"dwtObj"]=e.__internalId=AjxCore.assignId(e)
+};
+Dwt.disassociateElementFromObject=function(a,e,t){
+if(a){
+a.removeAttribute(t||"dwtObj")
+}
+if(e.__internalId){
+AjxCore.unassignId(e.__internalId)
+}};
+Dwt.getObjectFromElement=function(t,e){
+return AjxCore.objectWithId(t[e||"dwtObj"])
+};
+Dwt.findAncestor=function(t,e){
+while(t&&(Dwt.getAttr(t,e)==null)){
+t=t.parentNode
+}
+return t
+};
+Dwt.setHandler=function(a,t,e){
+if(t==DwtEvent.ONMOUSEWHEEL&&AjxEnv.isGeckoBased){
+Dwt.clearHandler(a,t)
+}
+a[t]=e;
+if(t==DwtEvent.ONMOUSEWHEEL&&AjxEnv.isGeckoBased){
+a.addEventListener("DOMMouseScroll",e,true)
+}};
+Dwt.clearHandler=function(a,t){
+if(t==DwtEvent.ONMOUSEWHEEL&&AjxEnv.isGeckoBased){
+if(a[t]){
+var e=a[t];
+a.removeEventListener("DOMMouseScroll",e,true)
+}}
+a[t]=null
+};
+Dwt.getBackgroundRepeat=function(e){
+return DwtCssStyle.getProperty(e,"background-repeat")
+};
+Dwt.setBackgroundRepeat=function(t,e){
+t.style.backgroundRepeat=e
+};
+Dwt.getBounds=function(n,a){
+var o=DwtPoint.tmp;
+Dwt.getLocation(n,o);
+var t=o.x;
+var e=o.y;
+Dwt.getSize(n,o);
+if(!a){
+return new DwtRectangle(t,e,o.x,o.y)
+}else{
+a.set(t,e,o.x,o.y);
+return a
+}};
+Dwt.setBounds=function(o,t,n,a,e){
+Dwt.setLocation(o,t,n);
+Dwt.setSize(o,a,e)
+};
+Dwt.getCursor=function(e){
+return DwtCssStyle.getProperty(e,"cursor")
+};
+Dwt.setCursor=function(t,e){
+t.style.cursor=e
+};
+Dwt.getLocation=function(t,e){
+var e=(e)?e:new DwtPoint(0,0);
+if(t.style.position==Dwt.ABSOLUTE_STYLE){
+e.set(parseInt(DwtCssStyle.getProperty(t,"left")),parseInt(DwtCssStyle.getProperty(t,"top")));
+return e
+}else{
+return Dwt.toWindow(t,0,0,null,null,e)
+}};
+Dwt.setLocation=function(a,t,o){
+var e=a.style.position;
+if(e!=Dwt.ABSOLUTE_STYLE&&e!=Dwt.RELATIVE_STYLE&&e!=Dwt.FIXED_STYLE){
+throw new DwtException("Static widgets may not be positioned",DwtException.INVALID_OP,"Dwt.setLocation")
+}
+if(t=Dwt.__checkPxVal(t)){
+a.style.left=t
+}
+if(o=Dwt.__checkPxVal(o)){
+a.style.top=o
+}};
+Dwt.getPosition=function(e){
+return e.style.position
+};
+Dwt.setPosition=function(t,e){
+t.style.position=e
+};
+Dwt.getScrollStyle=function(a){
+var o=DwtCssStyle.getProperty(a,"overflow");
+if(o=="hidden"){
+return Dwt.CLIP
+}else{
+if(o=="auto"){
+return Dwt.SCROLL
+}else{
+if(o=="scroll"){
+return Dwt.FIXED_SCROLL
+}else{
+var t=DwtCssStyle.getProperty(a,"overflowX");
+var e=DwtCssStyle.getProperty(a,"overflowY");
+if(o==""){
+if(t=="scroll"){
+return Dwt.SCROLL_X
+}else{
+if(e=="scroll"){
+return Dwt.SCROLL_Y
+}}}
+return Dwt.VISIBLE
+}}}};
+Dwt.setScrollStyle=function(t,e){
+if(e==Dwt.CLIP){
+t.style.overflow="hidden"
+}else{
+if(e==Dwt.SCROLL){
+t.style.overflow="auto"
+}else{
+if(e==Dwt.FIXED_SCROLL){
+t.style.overflow="scroll"
+}else{
+if(e==Dwt.SCROLL_Y){
+t.style.overflowX="hidden";
+t.style.overflowY="auto"
+}else{
+if(e==Dwt.SCROLL_X){
+t.style.overflowY="hidden";
+t.style.overflowX="auto"
+}else{
+t.style.overflow="visible"
+}}}}}};
+Dwt.getSize=function(a,e){
+var t;
+if(!e){
+t=new DwtPoint(0,0)
+}else{
+t=e;
+t.set(0,0)
+}
+if(!a){
+return t
+}
+t.x=a.offsetWidth;
+if(t.x!=null){
+t.y=a.offsetHeight
+}else{
+if(a.clip&&a.clip.width!=null){
+t.x=a.clip.width;
+t.y=a.clip.height;
+t.x=parseInt(t.x);
+t.y=parseInt(t.y)
+}else{
+if(a.style&&a.style.pixelWidth!=null){
+t.x=a.style.pixelWidth;
+t.y=a.style.pixelHeight;
+t.x=parseInt(t.x);
+t.y=parseInt(t.y)
+}}}
+return t
+};
+Dwt.setSize=function(a,t,e){
+if(!a.style){
+return
+}
+if(t==Dwt.CLEAR){
+a.style.width=null
+}else{
+if(t=Dwt.__checkPxVal(t,true)){
+a.style.width=t
+}}
+if(e==Dwt.CLEAR){
+a.style.height=null
+}else{
+if(e=Dwt.__checkPxVal(e,true)){
+a.style.height=e
+}}};
+Dwt.getHtmlExtent=function(e){
+var t=AjxStringUtil.calcDIV();
+t.innerHTML=e;
+return Dwt.getSize(t)
+};
+Dwt.toDocumentFragment=function(a,s){
+var n=AjxStringUtil.calcDIV();
+n.innerHTML=a;
+var t=document.createDocumentFragment();
+var e=s&&document.getElementById(s);
+if(e){
+t.appendChild(e)
+}else{
+for(var o=n.firstChild;
+o;
+o=n.firstChild){
+t.appendChild(o)
+}}
+return t
+};
+Dwt.getAttr=function(a,e,t){
+if(!t){
+return a&&a.tagName?(a.getAttribute(e)||a[e]):null
+}else{
+while(a){
+if(Dwt.getAttr(a,e)!=null){
+return a
+}
+a=a.parentNode
+}
+return null
+}};
+Dwt.getVisible=function(t){
+var e=DwtCssStyle.getProperty(t,"display");
+return(e!=Dwt.DISPLAY_NONE)
+};
+Dwt.setVisible=function(t,a){
+if(a){
+if(t.nodeName.match(/tr/i)){
+t.style.display=Dwt.DISPLAY_TABLE_ROW
+}else{
+if(t.nodeName.match(/td|th/i)){
+t.style.display=Dwt.DISPLAY_TABLE_CELL
+}else{
+t.style.display=t.getAttribute("x-display")||Dwt.DISPLAY_BLOCK
+}}}else{
+var e=DwtCssStyle.getComputedStyleObject(t).display;
+if(e!="none"){
+t.setAttribute("x-display",e)
+}
+t.style.display=Dwt.DISPLAY_NONE
+}};
+Dwt.getVisibility=function(t){
+var e=DwtCssStyle.getProperty(t,"visibility");
+return(e=="visible")
+};
+Dwt.setVisibility=function(e,t){
+e.style.visibility=t?"visible":"hidden"
+};
+Dwt.__MSIE_OPACITY_RE=/alpha\(opacity=(\d+)\)/;
+Dwt.getOpacity=function(a){
+if(AjxEnv.isIE){
+var t=a.style.filter;
+var e=Dwt.__MSIE_OPACITY_RE.exec(t)||[t,"100"];
+return Number(e[1])
+}
+return Number(a.style.opacity||1)*100
+};
+Dwt.setOpacity=function(t,e){
+if(AjxEnv.isIE){
+t.style.filter="alpha(opacity="+e+")"
+}else{
+t.style.opacity=e/100
+}};
+Dwt.getZIndex=function(e){
+return DwtCssStyle.getProperty(e,"z-index")
+};
+Dwt.setZIndex=function(t,e){
+t.style.zIndex=e
+};
+Dwt.getDisplay=function(e){
+DwtCssStyle.getProperty(e,"display")
+};
+Dwt.setDisplay=function(t,e){
+t.style.display=e
+};
+Dwt.getWindowSize=function(e){
+var t=(!e)?new DwtPoint(0,0):e;
+if(window.innerWidth){
+t.x=window.innerWidth;
+t.y=window.innerHeight
+}else{
+if(AjxEnv.isIE6CSS){
+t.x=document.body.parentElement.clientWidth;
+t.y=document.body.parentElement.clientHeight
+}else{
+if(document.body&&document.body.clientWidth){
+t.x=document.body.clientWidth;
+t.y=document.body.clientHeight
+}}}
+return t
+};
+Dwt.toWindow=function(o,r,s,d,h,c){
+var t;
+if(!c){
+t=new DwtPoint(r,s)
+}else{
+t=c;
+t.set(r,s)
+}
+var e=o;
+while(e&&e!=d){
+t.x+=e.offsetLeft-e.scrollLeft;
+t.y+=e.offsetTop;
+if(!h){
+var a=AjxEnv.isOpera?e.pageYOffset:e.scrollTop;
+if(a){
+t.y-=a
+}
+var n=e.parentNode;
+while(n!=e.offsetParent&&n!=d){
+a=AjxEnv.isOpera?n.pageYOffset:n.scrollTop;
+if(a){
+t.y-=a
+}
+n=n.parentNode
+}}
+e=e.offsetParent
+}
+return t
+};
+Dwt.getInsets=function(o){
+var t=DwtCssStyle.getComputedStyleObject(o);
+var a=parseInt(t.borderLeftWidth)||0;
+var h=parseInt(t.borderTopWidth)||0;
+var c=parseInt(t.borderRightWidth)||0;
+var s=parseInt(t.borderBottomWidth)||0;
+var n=parseInt(t.paddingLeft)||0;
+var d=parseInt(t.paddingTop)||0;
+var e=parseInt(t.paddingRight)||0;
+var r=parseInt(t.paddingBottom)||0;
+return{
+left:a+n,top:h+d,right:c+e,bottom:s+r}
+};
+Dwt.insetBounds=function(t,e){
+if(isNaN(t.x)||isNaN(e.left)){
+return t
+}
+t.x+=e.left;
+t.y+=e.top;
+t.width-=e.left+e.right;
+t.height-=e.top+e.bottom;
+return t
+};
+Dwt.setStatus=function(e){
+window.status=e
+};
+Dwt.getTitle=function(){
+return window.document.title
+};
+Dwt.setTitle=function(e){
+window.document.title=e
+};
+Dwt.getIframeDoc=function(e){
+if(e){
+return AjxEnv.isIE?e.contentWindow.document:e.contentDocument
+}
+return null
+};
+Dwt.getIframeWindow=function(e){
+return e.contentWindow
+};
+Dwt.parseHtmlFragment=function(o,a){
+if(!Dwt._div){
+Dwt._div=document.createElement("div")
+}
+if(a){
+o="<table style='table-layout:fixed'>"+o+"</table>"
+}
+Dwt._div.innerHTML=o;
+if(a){
+var e=document.createDocumentFragment();
+var n=Dwt._div.firstChild.rows;
+for(var t=n.length-1;
+t>=0;
+t--){
+e.appendChild(n[0])
+}
+return e.childNodes.length>1?e:e.firstChild
+}
+return Dwt._div.firstChild
+};
+Dwt.contains=function(a,t){
+var o=false;
+if(a.compareDocumentPosition){
+var e=a.compareDocumentPosition(t);
+if((e==(document.DOCUMENT_POSITION_CONTAINED_BY|document.DOCUMENT_POSITION_FOLLOWING))){
+o=true
+}}else{
+if(a.contains){
+o=a.contains(t)
+}}
+return o
+};
+Dwt.removeChildren=function(e){
+while(e.hasChildNodes()){
+e.removeChild(e.firstChild)
+}};
+Dwt.getCellIndex=function(t){
+if(AjxEnv.isOpera){
+if(t.tagName&&t.tagName.toLowerCase()=="td"){
+var a=t.parentNode.cells;
+var e=a.length;
+for(var o=0;
+o<e;
+o++){
+if(a[o]==t){
+return o
+}}}}else{
+return t.cellIndex
+}
+return -1
+};
+Dwt.delClass=function(a,e,o){
+if(a==null){
+return
+}
+if(typeof e=="string"){
+e=Dwt._DELCLASS_CACHE[e]||(Dwt._DELCLASS_CACHE[e]=new RegExp("\\b"+e+"\\b","ig"))
+}
+var t=a.className||"";
+t=t.replace(e," ");
+a.className=o?t+" "+o:t
+};
+Dwt._DELCLASS_CACHE={};
+Dwt.addClass=function(e,t){
+Dwt.delClass(e,t,t)
+};
+Dwt.condClass=function(o,n,t,e){
+if(!!n){
+if(e){
+Dwt.delClass(o,e)
+}
+Dwt.addClass(o,t)
+}else{
+Dwt.delClass(o,t);
+if(e){
+Dwt.addClass(o,e)
+}}};
+Dwt.setSelectionRange=function(a,o,e){
+if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
+a.setSelectionRange(o,e)
+}else{
+if(AjxEnv.isIE){
+var t=a.createTextRange();
+t.collapse(true);
+t.moveStart("character",o);
+t.moveEnd("character",e-o);
+t.select()
+}else{
+a.select()
+}}};
+Dwt.getSelectionStart=function(o){
+if(AjxEnv.isGeckoBased){
+return o.selectionStart
+}else{
+if(AjxEnv.isIE){
+var a=document.selection.createRange();
+var t=a.compareEndPoints("StartToEnd",a)==0;
+if(!t){
+a.collapse(true)
+}
+var e=a.getBookmark();
+return e.charCodeAt(2)-2
+}}
+return o.value.length
+};
+Dwt.getSelectionEnd=function(o){
+if(AjxEnv.isGeckoBased){
+return o.selectionEnd
+}else{
+if(AjxEnv.isIE){
+var a=document.selection.createRange();
+var t=a.compareEndPoints("StartToEnd",a)==0;
+if(!t){
+a.collapse(false)
+}
+var e=a.getBookmark();
+return e.charCodeAt(2)-2
+}}
+return o.value.length
+};
+Dwt.setSelectionText=function(t,n){
+var s=Dwt.getSelectionStart(t);
+var e=Dwt.getSelectionEnd(t);
+var o=t.value;
+var a=[o.substr(0,s),n,o.substr(e)].join("");
+if(typeof t.setValue=="function"){
+t.setValue(a)
+}else{
+t.value=a
+}
+Dwt.setSelectionRange(t,s,s+n.length)
+};
+Dwt.instanceOf=function(t,e){
+if(typeof t=="string"){
+return window[t]&&(t==e||window[t].prototype instanceof window[e])
+}
+return(window[e]&&t instanceof window[e])
+};
+Dwt.getParams=function(e,o){
+if(!(e&&e.length)){
+return
+}
+if(e.length>1||e[0]._eventMgr){
+var a={};
+for(var t=0;
+t<e.length;
+t++){
+a[o[t]]=e[t]
+}
+return a
+}else{
+if(e.length==1){
+return e[0]
+}else{
+return{}
+}}};
+Dwt.__checkPxVal=function(t,e){
+if(t==Dwt.DEFAULT){
+return false
+}
+if(e&&t<0&&t!=Dwt.LOC_NOWHERE){
+t=0
+}
+if(typeof(t)=="number"){
+t=t+"px"
+}
+return t
+};
+Dwt.byId=function(e){
+return(typeof e=="string"?document.getElementById(e):e)
+};
+Dwt.byTag=function(e){
+return document.getElementsByTagName(e)
+};
+Dwt.show=function(e){
+Dwt.setVisible(Dwt.byId(e),true)
+};
+Dwt.hide=function(e){
+Dwt.setVisible(Dwt.byId(e),false)
+};
+Dwt.toggle=function(t,e){
+t=Dwt.byId(t);
+if(e==null){
+e=(Dwt.getVisible(t)!=true)
+}
+Dwt.setVisible(t,e)
+};
+Dwt.setText=function(e,t){
+e.appendChild(document.createTextNode(t))
+};
+Dwt.populateText=function(){
+if(arguments.length==0){
+return
+}
+var a,e=0,t=arguments.length;
+while(e<t){
+a=document.getElementById(arguments[e]);
+if(a){
+Dwt.setText(a,arguments[e+1])
+}
+e+=2
+}};
+Dwt.setInnerHtml=function(t,e){
+t.innerHTML=e
+};
+Dwt.setFavIcon=function(r){
+if(AjxEnv.isIE){
+return
+}
+var e=null;
+if(Dwt._favIconId){
+e=document.getElementById(Dwt._favIconId)
+}else{
+var h=document.getElementsByTagName("head")[0];
+var t=h.getElementsByTagName("link");
+for(var o=0;
+o<t.length;
+o++){
+var s=t[o];
+if(s.rel.toUpperCase()=="SHORTCUT ICON"){
+if(!s.id){
+s.id=Dwt._favIconId=Dwt.getNextId()
+}
+e=s;
+break
+}}}
+if(e){
+e.href=r;
+var n=e.parentNode;
+n.removeChild(e);
+n.appendChild(e)
+}else{
+var a=document.createElement("link");
+a.id=Dwt._favIconId=Dwt.getNextId();
+a.rel="SHORTCUT ICON";
+a.href=r;
+h=h||document.getElementsByTagName("head")[0];
+h.appendChild(a)
+}}
+}
+if(AjxPackage.define("ajax.dwt.core.DwtException")){
+DwtException=function(a,t,o,e){
+if(arguments.length===0){
+return
+}
+AjxException.call(this,a,t,o,e)
+};
+DwtException.prototype=new AjxException();
+DwtException.prototype.constructor=DwtException;
+DwtException.prototype.toString=function(){
+return"DwtException"
+};
+DwtException.INVALIDPARENT=-1;
+DwtException.INVALID_OP=-2;
+DwtException.INTERNAL_ERROR=-3;
+DwtException.INVALID_PARAM=-4
+}
+if(AjxPackage.define("ajax.dwt.graphics.DwtCssStyle")){
+DwtCssStyle=function(){};
+DwtCssStyle.HOVER="hover";
+DwtCssStyle.ACTIVE="active";
+DwtCssStyle.SELECTED="selected";
+DwtCssStyle.DISABLED="disabled";
+DwtCssStyle.FOCUSED="focused";
+DwtCssStyle.ACTIONED="actioned";
+DwtCssStyle.MATCHED="matched";
+DwtCssStyle.DRAG_OVER="dragOver";
+DwtCssStyle.DROPPABLE="droppable";
+DwtCssStyle.NOT_DROPPABLE="notDroppable";
+DwtCssStyle.DRAG_PROXY="dragProxy";
+DwtCssStyle.LINUX="linux";
+DwtCssStyle.getProperty=function(t,a){
+var d;
+if(t.ownerDocument==null){
+for(var c=t.parentNode;
+c.parentNode!=null;
+c=c.parentNode){}
+var h=c
+}else{
+var h=t.ownerDocument
+}
+if(h.defaultView&&!AjxEnv.isSafari){
+var e=h.defaultView.getComputedStyle(t,"");
+d=e.getPropertyValue(a)
+}else{
+var r=a.split("-");
+var n="";
+var o;
+var s=r.length;
+for(o=0;
+o<s;
+o++){
+if(o!=0){
+n+=r[o].substring(0,1).toUpperCase()
+}else{
+n+=r[o].substring(0,1)
+}
+n+=r[o].substring(1)
+}
+if(t.currentStyle){
+d=t.currentStyle[n]
+}else{
+if(t.style){
+d=t.style[n]
+}}}
+return d
+};
+DwtCssStyle.getComputedStyleObject=function(o){
+if(o.ownerDocument==null){
+for(var t=o.parentNode;
+t.parentNode!=null;
+t=t.parentNode){}
+var a=t
+}else{
+var a=o.ownerDocument
+}
+if(a.defaultView){
+var e=a.defaultView.getComputedStyle(o,null);
+if(!e&&o.style){
+o.style.display="";
+e=a.defaultView.getComputedStyle(o,null)
+}
+return e||{}
+}else{
+if(o.currentStyle){
+return o.currentStyle
+}else{
+if(o.style){
+return o.style
+}}}};
+DwtCssStyle.removeProperty=function(t,a){
+if(a instanceof Array){
+for(var e=a.length;
+--e>=0;
+){
+DwtCssStyle.removeProperty(t,a[e])
+}}else{
+if(AjxEnv.isIE){
+t.style.removeAttribute(a,true)
+}else{
+a=a.replace(/([A-Z])/g,"-$1");
+t.style.removeProperty(a)
+}}}
+}
+if(AjxPackage.define("ajax.dwt.graphics.DwtPoint")){
+DwtPoint=function(e,t){
+this.x=e;
+this.y=t
+};
+DwtPoint.tmp=new DwtPoint(0,0);
+DwtPoint.prototype.toString=function(){
+return"DwtPoint"
+};
+DwtPoint.prototype.set=function(e,t){
+this.x=e;
+this.y=t
+}
+}
+if(AjxPackage.define("ajax.dwt.graphics.DwtRectangle")){
+DwtRectangle=function(t,o,a,e){
+this.x=t;
+this.y=o;
+this.width=a;
+this.height=e
+};
+DwtRectangle.prototype.toString=function(){
+return"DwtRectangle"
+};
+DwtRectangle.prototype.set=function(t,o,a,e){
+this.x=t;
+this.y=o
+}
+}
+if(AjxPackage.define("ajax.dwt.graphics.DwtUnits")){
+DwtUnits=function(){};
+DwtUnits.PIXEL_UNIT="px";
+DwtUnits.CM_UNIT="cm";
+DwtUnits.MM_UNIT="mm";
+DwtUnits.INCH_UNIT="in";
+DwtUnits.PCT_UNIT="%";
+DwtUnits.POINT="pt";
+DwtUnits.WIDTH_EM=AjxEnv.isIE?9:11;
+DwtUnits.WIDTH_SEP=AjxEnv.isIE?6:8;
+DwtUnits.WIDTH_ELLIPSIS=15
+}
+if(AjxPackage.define("ajax.dwt.events.DwtEvent")){
+DwtEvent=function(e){
+if(arguments.length==0){
+return
+}
+this.dwtObj=null
+};
+DwtEvent.prototype.toString=function(){
+return"DwtEvent"
+};
+DwtEvent.ONCHANGE="onchange";
+DwtEvent.ONCLICK="onclick";
+DwtEvent.ONCONTEXTMENU="oncontextmenu";
+DwtEvent.ONDBLCLICK="ondblclick";
+DwtEvent.ONFOCUS="onfocus";
+DwtEvent.ONBLUR="onblur";
+DwtEvent.ONKEYDOWN="onkeydown";
+DwtEvent.ONKEYPRESS="onkeypress";
+DwtEvent.ONKEYUP="onkeyup";
+DwtEvent.ONMOUSEDOWN="onmousedown";
+DwtEvent.ONMOUSEENTER="onmouseenter";
+DwtEvent.ONMOUSELEAVE="onmouseleave";
+DwtEvent.ONMOUSEMOVE="onmousemove";
+DwtEvent.ONMOUSEOUT="onmouseout";
+DwtEvent.ONMOUSEOVER="onmouseover";
+DwtEvent.ONMOUSEUP="onmouseup";
+DwtEvent.ONMOUSEWHEEL="onmousewheel";
+DwtEvent.ONSELECTSTART="onselectstart";
+DwtEvent.ONSCROLL="onscroll";
+DwtEvent.ACTION="ACTION";
+DwtEvent.CONTROL="CONTROL";
+DwtEvent.DATE_RANGE="DATE_RANGE";
+DwtEvent.DISPOSE="DISPOSE";
+DwtEvent.ENTER="ENTER";
+DwtEvent.HOVEROVER="HOVEROVER";
+DwtEvent.HOVEROUT="HOVEROUT";
+DwtEvent.POPDOWN="POPDOWN";
+DwtEvent.POPUP="POPUP";
+DwtEvent.SELECTION="SELECTION";
+DwtEvent.TREE="TREE";
+DwtEvent.STATE_CHANGE="STATE_CHANGE";
+DwtEvent.TAB="TAB";
+DwtEvent.XFORMS_READY="xforms-ready";
+DwtEvent.XFORMS_DISPLAY_UPDATED="xforms-display-updated";
+DwtEvent.XFORMS_VALUE_CHANGED="xforms-value-changed";
+DwtEvent.XFORMS_FORM_DIRTY_CHANGE="xforms-form-dirty-change";
+DwtEvent.XFORMS_CHOICES_CHANGED="xforms-choices-changed";
+DwtEvent.XFORMS_VALUE_ERROR="xforms-value-error";
+DwtEvent.XFORMS_INSTANCE_CHANGED="xforms-instance-cahnged";
+DwtEvent.KEY_EVENTS=[DwtEvent.ONKEYDOWN,DwtEvent.ONKEYPRESS,DwtEvent.ONKEYUP];
+DwtEvent.MOUSE_EVENTS=[DwtEvent.ONCONTEXTMENU,DwtEvent.ONDBLCLICK,DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEMOVE,DwtEvent.ONMOUSEUP,DwtEvent.ONSELECTSTART,DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT]
+}
+if(AjxPackage.define("ajax.dwt.events.DwtEventManager")){
+DwtEventManager=function(){};
+DwtEventManager._instance=new AjxEventMgr();
+DwtEventManager._domEventToDwtMap={
+ondblclick:DwtEvent.ONDBLCLICK,onmousedown:DwtEvent.ONMOUSEDOWN,onmouseup:DwtEvent.ONMOUSEUP,onmousemove:DwtEvent.ONMOUSEMOVE,onmouseout:DwtEvent.ONMOUSEOUT,onmouseover:DwtEvent.ONMOUSEOVER,onselectstart:DwtEvent.ONSELECTSTART,onchange:DwtEvent.ONCHANGE};
+DwtEventManager.addListener=function(e,t){
+DwtEventManager._instance.addListener(e,t)
+};
+DwtEventManager.notifyListeners=function(e,t){
+DwtEventManager._instance.notifyListeners(e,t)
+};
+DwtEventManager.removeListener=function(e,t){
+DwtEventManager._instance.removeListener(e,t)
+}
+}
+if(AjxPackage.define("ajax.dwt.events.DwtUiEvent")){
+DwtUiEvent=function(e){
+if(arguments.length==0){
+return
+}
+DwtEvent.call(this,true);
+this.reset()
+};
+DwtUiEvent.prototype=new DwtEvent;
+DwtUiEvent.prototype.constructor=DwtUiEvent;
+DwtUiEvent.prototype.toString=function(){
+return"DwtUiEvent"
+};
+DwtUiEvent.prototype.reset=function(){
+this.dwtObj=null;
+this.altKey=false;
+this.ctrlKey=false;
+this.metaKey=false;
+this.shiftKey=false;
+this.target=null;
+this.type=null;
+this.docX=-1;
+this.docY=-1;
+this.elementX=-1;
+this.elementY=-1;
+this.ersatz=false;
+this._stopPropagation=false;
+this._returnValue=true;
+this._dontCallPreventDefault=false
+};
+DwtUiEvent.getEvent=function(t,a){
+t=t||window.event;
+if(t){
+return t
+}
+if(a){
+var e=(a.ownerDocument||a.document||a).parentWindow;
+return e?e.event:null
+}};
+DwtUiEvent.getTarget=function(e,t){
+e=DwtUiEvent.getEvent(e);
+if(!e){
+return null
+}
+if(!t){
+if(e.target){
+return(e.target.nodeType==3)?e.target.parentNode:e.target
+}else{
+if(e.srcElement){
+return e.srcElement
+}}}else{
+if(e.relatedTarget){
+return e.relatedTarget
+}else{
+if(e.toElement){
+return e.toElement
+}else{
+if(e.fromElement){
+return e.fromElement
+}}}}
+return null
+};
+DwtUiEvent.getTargetWithProp=function(e,o,a){
+var t=DwtUiEvent.getTarget(e,a);
+while(t){
+if(Dwt.getAttr(t,o)!=null){
+return t
+}
+t=t.parentNode
+}
+return null
+};
+DwtUiEvent.getTargetWithProps=function(o,a){
+var n=DwtUiEvent.getTarget(o);
+while(n){
+var t=true;
+for(var e in a){
+var s=Dwt.getAttr(n,a[e]);
+if(s==null){
+n=n.parentNode;
+t=false;
+break
+}}
+if(t){
+return n
+}}
+return null
+};
+DwtUiEvent.copy=function(e,t){
+e.altKey=t.altKey;
+e.ctrlKey=t.ctrlKey;
+e.metaKey=t.metaKey;
+e.shiftKey=t.shiftKey;
+e.target=t.target;
+e.type=t.type;
+e.dwtObj=t.dwtObj;
+e.docX=t.docX;
+e.docY=t.docY;
+e.elementX=t.elementX;
+e.elementY=t.elementY;
+e.ersatz=t.ersatz;
+e._stopPropagation=t._stopPropagation;
+e._returnValue=t._returnValue
+};
+DwtUiEvent.prototype.setFromDhtmlEvent=function(t,a){
+t=DwtUiEvent.getEvent(t);
+if(!t){
+return
+}
+this.altKey=t.altKey;
+this.ctrlKey=t.ctrlKey;
+this.metaKey=t.metaKey;
+this.shiftKey=t.shiftKey;
+this.type=t.type;
+this.target=DwtUiEvent.getTarget(t);
+this.dwtObj=(a===true)?DwtControl.getTargetControl(t):a;
+if(t.pageX!=null){
+this.docX=t.pageX;
+this.docY=t.pageY
+}else{
+if(t.clientX!=null){
+this.docX=t.clientX+document.body.scrollLeft-document.body.clientLeft;
+this.docY=t.clientY+document.body.scrollTop-document.body.clientTop;
+if(document.body.parentElement){
+var e=document.body.parentElement;
+this.docX+=e.scrollLeft-e.clientLeft;
+this.docY+=e.scrollTop-e.clientTop
+}}}
+if(t.offsetX!=null){
+this.elementX=t.offsetX;
+this.elementY=t.offsetY
+}else{
+if(t.layerX!=null){
+this.elementX=t.layerX;
+this.elementY=t.layerY
+}else{
+this.elementX=Dwt.DEFAULT;
+this.elementY=Dwt.DEFAULT
+}}
+this.ersatz=false;
+return t
+};
+DwtUiEvent.prototype.setToDhtmlEvent=function(e){
+DwtUiEvent.setBehaviour(e,this._stopPropagation,this._returnValue,this._dontCallPreventDefault)
+};
+DwtUiEvent.setBehaviour=function(n,e,t,a){
+var o=DwtUiEvent.getEvent(n);
+DwtUiEvent.setDhtmlBehaviour(o,e,t,a)
+};
+DwtUiEvent.setDhtmlBehaviour=function(o,e,t,a){
+o=o||window.event;
+if(o.stopPropagation!=null){
+if(e){
+o.stopPropagation()
+}
+if(!t&&!a){
+o.preventDefault()
+}}else{
+o.returnValue=t;
+o.cancelBubble=e
+}};
+DwtUiEvent.getDwtObjFromEvent=function(e,a){
+var t=DwtUiEvent.getTargetWithProp(e,"dwtObj",a);
+return t?Dwt.getObjectFromElement(t):null
+};
+DwtUiEvent.getDwtObjWithProp=function(e,a){
+var t=DwtUiEvent.getTargetWithProps(e,["dwtObj",a]);
+return t?Dwt.getObjectFromElement(t):null
+}
+}
+if(AjxPackage.define("ajax.dwt.events.DwtDisposeEvent")){
+DwtDisposeEvent=function(e){
+if(arguments.length==0){
+return
+}
+DwtEvent.call(this,true)
+};
+DwtDisposeEvent.prototype=new DwtEvent;
+DwtDisposeEvent.prototype.constructor=DwtDisposeEvent;
+DwtDisposeEvent.prototype.toString=function(){
+return"DwtDisposeEvent"
+}
+}
+if(AjxPackage.define("ajax.dwt.events.DwtControlEvent")){
+DwtControlEvent=function(){
+this.reset()
+};
+DwtControlEvent.prototype=new DwtEvent;
+DwtControlEvent.prototype.constructor=DwtControlEvent;
+DwtControlEvent.RESIZE=1;
+DwtControlEvent.MOVE=2;
+DwtControlEvent.prototype.toString=function(){
+return"DwtControlEvent"
+};
+DwtControlEvent.prototype.reset=function(e){
+this.oldX=Dwt.DEFAULT;
+this.oldY=Dwt.DEFAULT;
+this.oldWidth=Dwt.DEFAULT;
+this.oldHeight=Dwt.DEFAULT;
+this.newX=Dwt.DEFAULT;
+this.newY=Dwt.DEFAULT;
+this.newWidth=Dwt.DEFAULT;
+this.newHeight=Dwt.DEFAULT;
+this.type=e||null
+}
+}
+if(AjxPackage.define("ajax.dwt.events.DwtFocusEvent")){
+DwtFocusEvent=function(e){
+if(arguments.length==0){
+return
+}
+DwtEvent.call(this,true);
+this.reset()
+};
+DwtFocusEvent.prototype=new DwtEvent;
+DwtFocusEvent.prototype.constructor=DwtFocusEvent;
+DwtFocusEvent.FOCUS=1;
+DwtFocusEvent.BLUR=2;
+DwtFocusEvent.prototype.toString=function(){
+return"DwtFocusEvent"
+};
+DwtFocusEvent.prototype.reset=function(){
+this.dwtObj=null;
+this.state=DwtFocusEvent.FOCUS
+}
+}
+if(AjxPackage.define("ajax.dwt.events.DwtKeyEvent")){
+DwtKeyEvent=function(){
+DwtUiEvent.call(this,true);
+this.reset(true)
+};
+DwtKeyEvent.KEY_END_OF_TEXT=3;
+DwtKeyEvent.KEY_TAB=9;
+DwtKeyEvent.KEY_RETURN=13;
+DwtKeyEvent.KEY_ENTER=13;
+DwtKeyEvent.KEY_ESCAPE=27;
+DwtKeyEvent.MAC_FF_CODE={};
+DwtKeyEvent.MAC_FF_CODE["~"]=192;
+DwtKeyEvent.MAC_FF_CODE["!"]=49;
+DwtKeyEvent.MAC_FF_CODE["@"]=50;
+DwtKeyEvent.MAC_FF_CODE["#"]=51;
+DwtKeyEvent.MAC_FF_CODE["$"]=52;
+DwtKeyEvent.MAC_FF_CODE["%"]=53;
+DwtKeyEvent.MAC_FF_CODE["^"]=54;
+DwtKeyEvent.MAC_FF_CODE["&"]=55;
+DwtKeyEvent.MAC_FF_CODE["*"]=56;
+DwtKeyEvent.MAC_FF_CODE["("]=57;
+DwtKeyEvent.MAC_FF_CODE[")"]=48;
+DwtKeyEvent.MAC_FF_CODE["-"]=189;
+DwtKeyEvent.MAC_FF_CODE._=189;
+DwtKeyEvent.MAC_FF_CODE["+"]=187;
+DwtKeyEvent.MAC_FF_CODE["|"]=220;
+DwtKeyEvent.MAC_FF_CODE[":"]=186;
+DwtKeyEvent.MAC_FF_CODE["<"]=188;
+DwtKeyEvent.MAC_FF_CODE[">"]=190;
+DwtKeyEvent.MAC_FF_CODE["?"]=191;
+DwtKeyEvent.prototype=new DwtUiEvent;
+DwtKeyEvent.prototype.constructor=DwtKeyEvent;
+DwtKeyEvent.prototype.toString=function(){
+return"DwtKeyEvent"
+};
+DwtKeyEvent.isKeyEvent=function(e){
+return(e.type.search(/^key/i)!=-1)
+};
+DwtKeyEvent.isKeyPressEvent=function(e){
+return(AjxEnv.isIE&&e.type=="keydown")||(e.type=="keypress")
+};
+DwtKeyEvent.prototype.reset=function(e){
+if(!e){
+DwtUiEvent.prototype.reset.call(this)
+}
+this.keyCode=0;
+this.charCode=0
+};
+DwtKeyEvent.prototype.isCommand=function(e){
+return AjxEnv.isMac&&this.metaKey||this.ctrlKey
+};
+DwtKeyEvent.prototype.setFromDhtmlEvent=function(e,t){
+e=DwtUiEvent.prototype.setFromDhtmlEvent.apply(this,arguments);
+this.charCode=e.charCode||e.keyCode;
+this.keyCode=e.keyCode
+};
+DwtKeyEvent.getCharCode=function(t){
+t=DwtUiEvent.getEvent(t);
+var e=AjxEnv.isSafari?t.keyCode:(t.charCode||t.keyCode);
+if(e==0&&AjxEnv.isMac&&AjxEnv.isGeckoBased&&t.type=="keyup"&&DwtKeyEvent._geckoCode){
+e=DwtKeyEvent._geckoCode
+}
+return e
+};
+DwtKeyEvent.copy=function(e,t){
+DwtUiEvent.copy(e,t);
+e.charCode=t.charCode;
+e.keyCode=t.keyCode
+};
+DwtKeyEvent.geckoCheck=function(t){
+t=DwtUiEvent.getEvent(t);
+if(t.type=="keypress"){
+DwtKeyEvent._geckoCode=null;
+if(AjxEnv.isMac&&AjxEnv.isGeckoBased){
+var e=String.fromCharCode(t.charCode);
+DwtKeyEvent._geckoCode=DwtKeyEvent.MAC_FF_CODE[e]
+}}}
+}
+if(AjxPackage.define("ajax.dwt.events.DwtMouseEvent")){
+DwtMouseEvent=function(){
+DwtUiEvent.call(this,true);
+this.reset(true)
+};
+DwtMouseEvent.prototype=new DwtUiEvent;
+DwtMouseEvent.prototype.constructor=DwtMouseEvent;
+DwtMouseEvent.prototype.toString=function(){
+return"DwtMouseEvent"
+};
+DwtMouseEvent.NONE=0;
+DwtMouseEvent.LEFT=1;
+DwtMouseEvent.MIDDLE=2;
+DwtMouseEvent.RIGHT=3;
+DwtMouseEvent.prototype.reset=function(e){
+if(!e){
+DwtUiEvent.prototype.reset.call(this)
+}
+this.button=0;
+this._populated=false
+};
+DwtMouseEvent.prototype.setFromDhtmlEvent=function(e,t){
+e=DwtUiEvent.prototype.setFromDhtmlEvent.apply(this,arguments);
+if(e.which){
+switch(e.which){
+case 1:this.button=DwtMouseEvent.LEFT;
+break;
+case 2:this.button=DwtMouseEvent.MIDDLE;
+break;
+case 3:this.button=DwtMouseEvent.RIGHT;
+break;
+default:this.button=DwtMouseEvent.NONE
+}}else{
+if(e.button){
+if((e.button&1)!=0){
+this.button=DwtMouseEvent.LEFT
+}else{
+if((e.button&2)!=0){
+this.button=DwtMouseEvent.RIGHT
+}else{
+if((e.button&4)!=0){
+this.button=DwtMouseEvent.MIDDLE
+}else{
+this.button=DwtMouseEvent.NONE
+}}}}}
+if(AjxEnv.isMac&&this.button){
+if(this.ctrlKey&&(this.button==DwtMouseEvent.LEFT||this.button==DwtMouseEvent.RIGHT)){
+this.button=DwtMouseEvent.RIGHT;
+this.ctrlKey=false
+}
+if(this.altKey){
+this.ctrlKey=true;
+this.altKey=false
+}}}
+}
+if(AjxPackage.define("ajax.dwt.events.DwtMouseEventCapture")){
+DwtMouseEventCapture=function(e){
+e=Dwt.getParams(arguments,DwtMouseEventCapture.PARAMS);
+this.targetObj=e.targetObj;
+this._id=e.id;
+this._mouseOverHdlr=e.mouseOverHdlr||DwtMouseEventCapture.emptyHdlr;
+this._mouseDownHdlr=e.mouseDownHdlr||DwtMouseEventCapture.emptyHdlr;
+this._mouseMoveHdlr=e.mouseMoveHdlr||DwtMouseEventCapture.emptyHdlr;
+this._mouseUpHdlr=e.mouseUpHdlr||DwtMouseEventCapture.emptyHdlr;
+this._mouseOutHdlr=e.mouseOutHdlr||DwtMouseEventCapture.emptyHdlr;
+this._mouseWheelHdlr=e.mouseWheelHdlr||DwtMouseEventCapture.emptyHdlr;
+this._hardCapture=(e.hardCapture!==false)
+};
+DwtMouseEventCapture.PARAMS=["targetObj","id","mouseOverHdlr","mouseDownHdlr","mouseMoveHdlr","mouseUpHdlr","mouseOutHdlr","mouseWheelHdlr","hardCapture"];
+DwtMouseEventCapture._capturing=false;
+DwtMouseEventCapture.getCaptureObj=function(){
+return window._mouseEventCaptureObj
+};
+DwtMouseEventCapture.getTargetObj=function(){
+return window._mouseEventCaptureObj?window._mouseEventCaptureObj.targetObj:null
+};
+DwtMouseEventCapture.getId=function(){
+return window._mouseEventCaptureObj?window._mouseEventCaptureObj._id:null
+};
+DwtMouseEventCapture.prototype.toString=function(){
+return"DwtMouseEventCapture"
+};
+DwtMouseEventCapture.prototype.capturing=function(){
+return DwtMouseEventCapture._capturing
+};
+DwtMouseEventCapture.prototype.capture=function(){
+if(window._mouseEventCaptureObj){
+window._mouseEventCaptureObj.release()
+}
+if(document.body!=null&&document.body.addEventListener!=null){
+document.body.addEventListener("mouseover",this._mouseOverHdlr,true);
+document.body.addEventListener("mousedown",this._mouseDownHdlr,true);
+document.body.addEventListener("mousemove",this._mouseMoveHdlr,true);
+document.body.addEventListener("mouseup",this._mouseUpHdlr,true);
+document.body.addEventListener("mouseout",this._mouseOutHdlr,true);
+document.body.addEventListener("DOMMouseScroll",this._mouseWheelHdlr,true)
+}else{
+this._savedMouseOverHdlr=document.onmouseover;
+this._savedMouseDownHdlr=document.onmousedown;
+this._savedMouseMoveHdlr=document.onmousemove;
+this._savedMouseUpHdlr=document.onmouseup;
+this._savedMouseOutHdlr=document.onmouseout;
+this._savedMouseWheelHdlr=document.onmousewheel;
+document.onmouseover=this._mouseOverHdlr;
+document.onmousedown=this._mouseDownHdlr;
+document.onmousemove=this._mouseMoveHdlr;
+document.onmouseup=this._mouseUpHdlr;
+document.onmouseout=this._mouseOutHdlr;
+document.onmousewheel=this._mouseWheelHdlr
+}
+if(this._hardCapture&&document.body&&document.body.setCapture){
+document.body.setCapture()
+}
+window._mouseEventCaptureObj=this;
+DwtMouseEventCapture._capturing=true
+};
+DwtMouseEventCapture.prototype.release=function(){
+if(window._mouseEventCaptureObj==null){
+return
+}
+var e=window._shellCaptureObj;
+if(document.body&&document.body.addEventListener){
+document.body.removeEventListener("mouseover",this._mouseOverHdlr,true);
+document.body.removeEventListener("mousedown",this._mouseDownHdlr,true);
+document.body.removeEventListener("mousemove",this._mouseMoveHdlr,true);
+document.body.removeEventListener("mouseup",this._mouseUpHdlr,true);
+document.body.removeEventListener("mouseout",this._mouseOutHdlr,true);
+document.body.removeEventListener("DOMMouseScroll",this._mouseWheelHdlr,true)
+}else{
+document.onmouseover=this._savedMouseOverHdlr;
+document.onmousedown=this._savedMouseDownHdlr;
+document.onmousemove=this._savedMouseMoveHdlr;
+document.onmouseup=this._savedMouseUpHdlr;
+
+document.onmouseout=this._savedMouseOutHdlr;
+document.onmousewheel=this._savedMouseWheelHdlr
+}
+if(this._hardCapture&&document.body&&document.body.releaseCapture){
+document.body.releaseCapture()
+}
+window._mouseEventCaptureObj=null;
+DwtMouseEventCapture._capturing=false
+};
+DwtMouseEventCapture.emptyHdlr=function(t){
+var a=DwtMouseEventCapture.getCaptureObj();
+var e=DwtShell.mouseEvent;
+e.setFromDhtmlEvent(t);
+if(a._hardCapture){
+e._stopPropagation=true;
+e._returnValue=false;
+e.setToDhtmlEvent(t);
+return false
+}else{
+e._stopPropagation=false;
+e._returnValue=true;
+e.setToDhtmlEvent(t);
+return true
+}}
+}
+if(AjxPackage.define("ajax.dwt.events.DwtListViewActionEvent")){
+DwtListViewActionEvent=function(){
+DwtMouseEvent.call(this);
+this.reset(true)
+};
+DwtListViewActionEvent.prototype=new DwtMouseEvent;
+DwtListViewActionEvent.prototype.constructor=DwtListViewActionEvent;
+DwtListViewActionEvent.prototype.toString=function(){
+return"DwtListViewActionEvent"
+};
+DwtListViewActionEvent.prototype.reset=function(e){
+if(!e){
+DwtMouseEvent.prototype.reset.call(this)
+}
+this.field=null;
+this.item=null;
+this.detail=null
+}
+}
+if(AjxPackage.define("ajax.dwt.events.DwtSelectionEvent")){
+DwtSelectionEvent=function(e){
+if(arguments.length==0){
+return
+}
+DwtUiEvent.call(this,true);
+this.reset(true)
+};
+DwtSelectionEvent.prototype=new DwtUiEvent;
+DwtSelectionEvent.prototype.constructor=DwtSelectionEvent;
+DwtSelectionEvent.prototype.toString=function(){
+return"DwtSelectionEvent"
+};
+DwtSelectionEvent.prototype.reset=function(e){
+if(!e){
+DwtUiEvent.prototype.reset.call(this)
+}
+this.button=0;
+this.detail=null;
+this.item=null
+}
+}
+if(AjxPackage.define("ajax.dwt.events.DwtHtmlEditorStateEvent")){
+DwtHtmlEditorStateEvent=function(e){
+if(arguments.length==0){
+return
+}
+DwtEvent.call(this,true);
+this.reset()
+};
+DwtHtmlEditorStateEvent.prototype=new DwtEvent;
+DwtHtmlEditorStateEvent.prototype.constructor=DwtHtmlEditorStateEvent;
+DwtHtmlEditorStateEvent.prototype.toString=function(){
+return"DwtHtmlEditorStateEvent"
+};
+DwtHtmlEditorStateEvent.prototype.reset=function(){
+this.isBold=null;
+this.isItalic=null;
+this.isUnderline=null;
+this.isStrikeThru=null;
+this.isSuperscript=null;
+this.isSubscript=null;
+this.isOrderedList=null;
+this.isNumberedList=null;
+this.fontName=null;
+this.fontSize=null;
+this.style=null;
+this.backgroundColor=null;
+this.color=null;
+this.justification=null;
+this.direction=null
+}
+}
+if(AjxPackage.define("ajax.dwt.events.DwtTreeEvent")){
+DwtTreeEvent=function(){
+DwtSelectionEvent.call(this,true)
+};
+DwtTreeEvent.prototype=new DwtSelectionEvent;
+DwtTreeEvent.prototype.constructor=DwtTreeEvent;
+DwtTreeEvent.prototype.toString=function(){
+return"DwtTreeEvent"
+};
+DwtTreeEvent.prototype.setFromDhtmlEvent=function(e,t){
+e=DwtSelectionEvent.prototype.setFromDhtmlEvent.apply(this,arguments)
+}
+}
+if(AjxPackage.define("ajax.dwt.events.DwtHoverEvent")){
+DwtHoverEvent=function(o,a,t,e,n){
+if(arguments.length==0){
+return
+}
+DwtEvent.call(this,true);
+this.type=o;
+this.delay=a;
+this.object=t;
+this.x=e||-1;
+this.y=n||-1
+};
+DwtHoverEvent.prototype=new DwtEvent;
+DwtHoverEvent.prototype.constructor=DwtHoverEvent;
+DwtHoverEvent.prototype.reset=function(){
+this.type=0;
+this.delay=0;
+this.object=null;
+this.x=-1;
+this.y=-1
+}
+}
+if(AjxPackage.define("ajax.dwt.keyboard.DwtTabGroupEvent")){
+DwtTabGroupEvent=function(){
+this.tabGroup=null;
+this.newFocusMember=null
+};
+DwtTabGroupEvent.prototype.toString=function(){
+return"DwtTabGroupEvent"
+};
+DwtTabGroupEvent.prototype.reset=function(){
+this.tabGroup=null;
+this.newFocusMember=null
+}
+}
+if(AjxPackage.define("ajax.dwt.keyboard.DwtKeyMap")){
+DwtKeyMap=function(e){
+if(e){
+return
+}
+this._map={};
+this._args={};
+this._checkedMap={};
+this._repeat={};
+this._load(this._map,AjxKeys);
+DwtKeyMap.MOD_ORDER[DwtKeyMap.ALT]=1;
+DwtKeyMap.MOD_ORDER[DwtKeyMap.CTRL]=2;
+DwtKeyMap.MOD_ORDER[DwtKeyMap.META]=3;
+DwtKeyMap.MOD_ORDER[DwtKeyMap.SHIFT]=4
+};
+DwtKeyMap.deserialize=function(e){
+alert("DwtKeyMap.deserialize: NOT IMPLEMENTED")
+};
+DwtKeyMap.serialize=function(e){
+alert("DwtKeyMap.serialize: NOT IMPLEMENTED")
+};
+DwtKeyMap.MAP_NAME={};
+DwtKeyMap.MAP_NAME.dialog="DwtDialog";
+DwtKeyMap.MAP_NAME.button="DwtButton";
+DwtKeyMap.MAP_NAME.list="DwtListView";
+DwtKeyMap.MAP_NAME.menu="DwtMenu";
+DwtKeyMap.MAP_NAME.editor="DwtHtmlEditor";
+DwtKeyMap.MAP_NAME.toolbar="DwtToolBar";
+DwtKeyMap.MAP_NAME.toolbarHorizontal="DwtToolBar-horiz";
+DwtKeyMap.MAP_NAME.toolbarVertical="DwtToolBar-vert";
+DwtKeyMap.MAP_NAME.tabView="DwtTabView";
+DwtKeyMap.MAP_NAME.tree="DwtTreeItem";
+DwtKeyMap.MAP_NAME_R={};
+(function(){
+for(var e in DwtKeyMap.MAP_NAME){
+DwtKeyMap.MAP_NAME_R[DwtKeyMap.MAP_NAME[e]]=e
+}}
+)();
+DwtKeyMap.IS_MODIFIER={};
+DwtKeyMap.MOD_ORDER={};
+DwtKeyMap.ARROW_DOWN="ArrowDown";
+DwtKeyMap.ARROW_LEFT="ArrowLeft";
+DwtKeyMap.ARROW_RIGHT="ArrowRight";
+DwtKeyMap.ARROW_UP="ArrowUp";
+DwtKeyMap.BACKSLASH="Backslash";
+DwtKeyMap.BACKSPACE="Backspace";
+DwtKeyMap.COMMA="Comma";
+DwtKeyMap.SEMICOLON="Semicolon";
+DwtKeyMap.DELETE="Del";
+DwtKeyMap.END="End";
+DwtKeyMap.ENTER="Enter";
+DwtKeyMap.ESC="Esc";
+DwtKeyMap.HOME="Home";
+DwtKeyMap.PAGE_DOWN="PgDown";
+DwtKeyMap.PAGE_UP="PgUp";
+DwtKeyMap.SPACE="Space";
+DwtKeyMap.TAB="Tab";
+DwtKeyMap.ACTION="ContextMenu";
+DwtKeyMap.SELECT_CURRENT="SelectCurrent";
+DwtKeyMap.ADD_SELECT_NEXT="AddNext";
+DwtKeyMap.ADD_SELECT_PREV="AddPrevious";
+DwtKeyMap.CANCEL="Cancel";
+DwtKeyMap.COLLAPSE="Collapse";
+DwtKeyMap.DBLCLICK="DoubleClick";
+DwtKeyMap.EXPAND="Expand";
+DwtKeyMap.GOTO_TAB="GoToTab";
+DwtKeyMap.HEADER1="Header1";
+DwtKeyMap.HEADER2="Header2";
+DwtKeyMap.HEADER3="Header3";
+DwtKeyMap.HEADER4="Header4";
+DwtKeyMap.HEADER5="Header5";
+DwtKeyMap.HEADER6="Header6";
+DwtKeyMap.JUSTIFY_CENTER="CenterJustify";
+DwtKeyMap.JUSTIFY_LEFT="LeftJustify";
+DwtKeyMap.JUSTIFY_RIGHT="RightJustify";
+DwtKeyMap.NEXT="Next";
+DwtKeyMap.NEXT_TAB="NextTab";
+DwtKeyMap.NO="No";
+DwtKeyMap.PARENTMENU="ParentMenu";
+DwtKeyMap.PREV="Previous";
+DwtKeyMap.PREV_TAB="PreviousTab";
+DwtKeyMap.SELECT_ALL="SelectAll";
+DwtKeyMap.SELECT="Select";
+DwtKeyMap.SELECT_FIRST="SelectFirst";
+DwtKeyMap.SELECT_LAST="SelectLast";
+DwtKeyMap.SELECT_NEXT="SelectNext";
+DwtKeyMap.SELECT_PREV="SelectPrevious";
+DwtKeyMap.SUBMENU="SubMenu";
+DwtKeyMap.SWITCH_MODE="SwitchMode";
+DwtKeyMap.TEXT_BOLD="Bold";
+DwtKeyMap.TEXT_ITALIC="Italic";
+DwtKeyMap.TEXT_UNDERLINE="Underline";
+DwtKeyMap.TEXT_STRIKETHRU="Strikethru";
+DwtKeyMap.YES="Yes";
+DwtKeyMap.GOTO_TAB_RE=new RegExp(DwtKeyMap.GOTO_TAB+"(\\d+)");
+DwtKeyMap.JOIN="+";
+DwtKeyMap.SEP=",";
+DwtKeyMap.INHERIT="INHERIT";
+DwtKeyMap.prototype.getMap=function(){
+return this._map
+};
+DwtKeyMap.prototype._load=function(q,d,g){
+g=g||{};
+var w=AjxEnv.platform.toLowerCase();
+for(var c in d){
+var f=c.split(".");
+var h=f[f.length-1];
+if(h=="win"||h=="mac"||h=="linux"){
+if(h==w){
+var k=f.slice(0,f.length-1).join(".");
+d[k]=d[c]
+}
+d[c]=null
+}}
+for(var c in d){
+var s=AjxStringUtil.trim(d[c]);
+if(!s||(typeof d[c]!="string")){
+continue
+}
+var f=c.split(".");
+var e=f[f.length-1];
+var a=(f.length==2);
+var y=a?null:f[1];
+if(f[0]=="keys"){
+this._processKeyDef(y,e,s);
+continue
+}
+if(e!=DwtKeyMap.INHERIT&&e!="keycode"){
+continue
+}
+var m=DwtKeyMap.MAP_NAME[f[0]]||g[f[0]];
+if((this._checkedMap[m]===false)||(!this._checkedMap[m]&&!this._checkMap(m))){
+continue
+}
+if(!q[m]){
+q[m]={}
+}
+if(!this._checkAction(m,y)){
+continue
+}
+var o=s.split(/\s*;\s*/);
+for(var v=0;
+v<o.length;
+v++){
+var j=this._canonicalize(o[v]);
+if(e==DwtKeyMap.INHERIT){
+var x=j.split(/\s*,\s*/);
+var t=[];
+for(var u=0;
+u<x.length;
+u++){
+t[u]=DwtKeyMap.MAP_NAME[x[u]]||g[x[u]]
+}
+q[m][f[1]]=t.join(",")
+}else{
+if(e=="keycode"){
+q[m][j]=y
+}}}
+var n=[f[0],y,"repeat"].join(".");
+var r=d[n];
+if(r&&r.toLowerCase()!="false"){
+if(!this._repeat[m]){
+this._repeat[m]={}
+}
+this._repeat[m][y]=true
+}}};
+DwtKeyMap.prototype._checkMap=function(t){
+var e=true;
+this._checkedMap[t]=e;
+return e
+};
+DwtKeyMap.prototype._checkAction=function(e,t){
+return true
+};
+DwtKeyMap.prototype._processKeyDef=function(e,a,t){
+if(!e||!a||!t){
+return
+}
+if(a=="display"){
+DwtKeyMap[e.toUpperCase()]=t
+}else{
+if(a=="keycode"){
+DwtKeyMap.IS_MODIFIER[t]=true
+}}};
+DwtKeyMap.prototype._canonicalize=function(r){
+var n=r.split(DwtKeyMap.SEP);
+var e=[];
+for(var a=0;
+a<n.length;
+a++){
+var t=n[a];
+var s=t.split(DwtKeyMap.JOIN);
+if(s.length>2){
+var o=s.slice(0,s.length-1);
+o.sort(function(u,c){
+var d=DwtKeyMap.MOD_ORDER[u]||0;
+var h=DwtKeyMap.MOD_ORDER[c]||0;
+return Number(d-h)
+}
+);
+o.push(s[s.length-1]);
+e.push(o.join(DwtKeyMap.JOIN))
+}else{
+e.push(t)
+}}
+return e.join(",")
+}
+}
+if(AjxPackage.define("ajax.dwt.keyboard.DwtKeyMapMgr")){
+DwtKeyMapMgr=function(a){
+var t=this._map=a.getMap();
+this._repeat=a._repeat;
+this._args=a._args;
+this._fsas={};
+for(var e in t){
+this._fsas[e]=DwtKeyMapMgr.__buildFSA({}
+,t[e],e)
+}};
+DwtKeyMapMgr.NOT_A_TERMINAL=-999;
+DwtKeyMapMgr.TAB_KEYCODE=9;
+DwtKeyMapMgr.prototype.toString=function(){
+return"DwtKeyMapMgr"
+};
+DwtKeyMapMgr.prototype.getActionCode=function(a,r,h){
+var e=this._fsas[r];
+if(!e){
+return null
+}
+var s=a.length;
+var d=e;
+var c;
+for(var t=0;
+t<s&&d;
+t++){
+c=a[t];
+if(!d||!d[c]){
+break
+}
+if(t<s-1){
+d=d[c].subMap
+}}
+if(d&&d[c]){
+var n=d[c];
+if(!n.subMap||h){
+var o=this.__getInheritedActionCode(a,e,h);
+return o==DwtKeyMapMgr.NOT_A_TERMINAL?DwtKeyMapMgr.NOT_A_TERMINAL:(n.actionCode||o)
+}else{
+return DwtKeyMapMgr.NOT_A_TERMINAL
+}}else{
+return this.__getInheritedActionCode(a,e,h)
+}};
+DwtKeyMapMgr.prototype.getAction=function(t,e){
+return this._map[t][e]
+};
+DwtKeyMapMgr.prototype.getKeySequences=function(t,a){
+var e=[];
+for(var o in this._map[t]){
+if(this._map[t][o]==a){
+e.push(o)
+}}
+return e
+};
+DwtKeyMapMgr.prototype.setMapping=function(t,e,a){
+this._map[t][e]=a
+};
+DwtKeyMapMgr.prototype.removeMapping=function(t,e){
+delete this._map[t][e]
+};
+DwtKeyMapMgr.prototype.replaceMapping=function(a,e,t){
+var o=this._map[a][e];
+if(!o){
+return
+}
+this.removeMapping(a,e);
+this.setMapping(a,t,o)
+};
+DwtKeyMapMgr.prototype.setArg=function(t,a,e){
+if(!this._args[t]){
+this._args[t]={}
+}
+this._args[t][a]=e
+};
+DwtKeyMapMgr.prototype.removeArg=function(e,t){
+delete this._args[e][t]
+};
+DwtKeyMapMgr.prototype.getArg=function(e,t){
+return this._args[e]?this._args[e][t]:null
+};
+DwtKeyMapMgr.prototype.reloadMap=function(e){
+this._fsas[e]=DwtKeyMapMgr.__buildFSA({}
+,this._map[e],e)
+};
+DwtKeyMapMgr.prototype.getAncestors=function(o,n){
+n=n||[];
+var e=this._fsas[o];
+var t=e&&e.inherit;
+if(t&&t.length){
+for(var a=0;
+a<t.length;
+a++){
+n.push(t[a]);
+n=this.getAncestors(t[a],n)
+}}
+return n
+};
+DwtKeyMapMgr.isInputElement=function(a){
+if(!a){
+return false
+}
+var t=a.ownerDocument?a.ownerDocument.designMode:null;
+if(t&&(t.toLowerCase()=="on")){
+return true
+}
+var e=a.tagName.toUpperCase();
+return(e=="INPUT"||e=="TEXTAREA")
+};
+DwtKeyMapMgr.prototype.repeats=function(t,e){
+return this._repeat[t]&&this._repeat[t][e]
+};
+DwtKeyMapMgr.__buildFSA=function(c,e,n){
+for(var a in e){
+if(a==DwtKeyMap.INHERIT){
+c.inherit=e[a].split(/\s*,\s*/);
+continue
+}
+var o=a.split(DwtKeyMap.SEP);
+var s=o.length;
+var h=c;
+for(var t=0;
+t<s;
+t++){
+var r=o[t];
+if(!h[r]){
+h[r]={}
+}
+if(t==s-1){
+h[r].actionCode=e[a]
+}else{
+if(!h[r].subMap){
+h[r].subMap={}
+}
+h=h[r].subMap
+}}}
+return c
+};
+DwtKeyMapMgr.prototype.__getInheritedActionCode=function(s,t,n){
+if(t.inherit&&t.inherit.length){
+var o=null;
+var e=t.inherit.length;
+for(var a=0;
+a<e;
+a++){
+o=this.getActionCode(s,t.inherit[a],n);
+if(o!=null){
+return o
+}}}
+return null
+};
+DwtKeyMapMgr.hasModifier=function(e){
+return(e.altKey||e.ctrlKey||e.metaKey)
+}
+}
+if(AjxPackage.define("ajax.dwt.keyboard.DwtKeyboardMgr")){
+DwtKeyboardMgr=function(e){
+DwtKeyboardMgr.__shell=e;
+this.__tabGrpStack=[];
+this.__defaultHandlerStack=[];
+this.__tabGroupChangeListenerObj=new AjxListener(this,this.__tabGrpChangeListener);
+this.__kbEventStatus=DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED;
+this.__keyTimeout=750;
+this.__currTabGroup=null;
+this.__currDefaultHandler=null
+};
+DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED=1;
+DwtKeyboardMgr.__KEYSEQ_HANDLED=2;
+DwtKeyboardMgr.__KEYSEQ_PENDING=3;
+DwtKeyboardMgr.__KEYSEQ_REPEAT=4;
+DwtKeyboardMgr.FOCUS_FIELD_ID="kbff";
+DwtKeyboardMgr.isPossibleInputShortcut=function(e){
+var t=DwtUiEvent.getTarget(e);
+return(!DwtKeyMap.IS_MODIFIER[e.keyCode]&&(e.keyCode==27||DwtKeyMapMgr.hasModifier(e))||(t&&t.nodeName.toUpperCase()=="INPUT"&&(e.keyCode==13||e.keyCode==3)))
+};
+DwtKeyboardMgr.prototype.toString=function(){
+return"DwtKeyboardMgr"
+};
+DwtKeyboardMgr.prototype.pushTabGroup=function(t){
+if(!this.__keyboardHandlingInited||!t){
+return
+}
+this.__tabGrpStack.push(t);
+this.__currTabGroup=t;
+var e=t.getFocusMember();
+if(!e){
+e=t.resetFocusMember(true)
+}
+if(!e){
+return
+}
+t.addFocusChangeListener(this.__tabGroupChangeListenerObj);
+this.grabFocus(e)
+};
+DwtKeyboardMgr.prototype.popTabGroup=function(r){
+if(!this.__keyboardHandlingInited){
+return
+}
+if(!r){
+return
+}
+if(this.__tabGrpStack.length<=1){
+return null
+}
+if(r&&this.__tabGrpStack[this.__tabGrpStack.length-1]!=r){
+var t=this.__tabGrpStack;
+var e=t.length;
+for(var s=e-1;
+s>=0;
+s--){
+if(r==t[s]){
+t[s].dump();
+break
+}}
+if(s<0){
+return null
+}else{
+if(s!=e-1){
+t.splice(s,1);
+return r
+}}}
+var r=this.__tabGrpStack.pop();
+r.removeFocusChangeListener(this.__tabGroupChangeListenerObj);
+var n=null;
+if(this.__tabGrpStack.length>0){
+n=this.__tabGrpStack[this.__tabGrpStack.length-1];
+var o=n.getFocusMember();
+if(!o){
+o=n.resetFocusMember(true)
+}
+if(o){
+this.grabFocus(o)
+}}
+this.__currTabGroup=n;
+return r
+};
+DwtKeyboardMgr.prototype.setTabGroup=function(t){
+if(!this.__enabled||!this.__keyboardHandlingInited){
+return
+}
+var e=this.popTabGroup();
+this.pushTabGroup(t);
+return e
+};
+DwtKeyboardMgr.prototype.pushDefaultHandler=function(e){
+if(!this.__enabled||!this.__keyboardHandlingInited||!e){
+return
+}
+this.__defaultHandlerStack.push(e);
+this.__currDefaultHandler=e
+};
+DwtKeyboardMgr.prototype.popDefaultHandler=function(){
+if(!this.__keyboardHandlingInited||(this.__defaultHandlerStack.length<=1)){
+return
+}
+var e=this.__defaultHandlerStack.pop();
+this.__currDefaultHandler=this.__defaultHandlerStack[this.__defaultHandlerStack.length-1];
+return e
+};
+DwtKeyboardMgr.prototype.grabFocus=function(e){
+if(!this.__enabled){
+return
+}
+if(!this.__keyboardHandlingInited){
+return
+}
+if(!e){
+return
+}
+if(this.__currTabGroup){
+this.__currTabGroup.setFocusMember(e,false,true)
+}
+this.__doGrabFocus(e)
+};
+DwtKeyboardMgr.prototype.getFocusObj=function(e){
+return this.__focusObj
+};
+DwtKeyboardMgr.prototype.dwtControlHasFocus=function(e){
+if(!this.__enabled){
+return false
+}
+if(!this.__keyboardHandlingInited){
+return false
+}
+return(this.__dwtCtrlHasFocus&&this.__focusObj==e)
+};
+DwtKeyboardMgr.prototype.registerDefaultKeyActionHandler=function(e){
+if(!this.__enabled){
+return
+}
+this.__defaultKeyActionHdlr=e
+};
+DwtKeyboardMgr.prototype.registerKeyMap=function(e){
+if(!this.__checkStatus()){
+return
+}
+this.__keyMapMgr=new DwtKeyMapMgr(e)
+};
+DwtKeyboardMgr.prototype.setKeyTimeout=function(e){
+this.__keyTimeout=e
+};
+DwtKeyboardMgr.prototype.clearKeySeq=function(){
+this.__killKeySeqTimedActionId=-1;
+this.__keySequence.length=0
+};
+DwtKeyboardMgr.prototype.enable=function(e){
+this.__enabled=e;
+if(e){
+this.__checkStatus();
+Dwt.setHandler(document,DwtEvent.ONKEYDOWN,DwtKeyboardMgr.__keyDownHdlr);
+Dwt.setHandler(document,DwtEvent.ONKEYUP,DwtKeyboardMgr.__keyUpHdlr);
+Dwt.setHandler(document,DwtEvent.ONKEYPRESS,DwtKeyboardMgr.__keyPressHdlr)
+}else{
+Dwt.clearHandler(document,DwtEvent.ONKEYDOWN);
+Dwt.clearHandler(document,DwtEvent.ONKEYUP);
+Dwt.clearHandler(document,DwtEvent.ONKEYPRESS)
+}};
+DwtKeyboardMgr.prototype.isEnabled=function(){
+return this.__enabled
+};
+DwtKeyboardMgr.prototype.__initKeyboardHandling=function(){
+var e=this._kbFocusField=document.createElement("textarea");
+e.id=DwtKeyboardMgr.FOCUS_FIELD_ID;
+e.tabIndex=0;
+e.style.position=Dwt.ABSOLUTE_STYLE;
+e.style.top=e.style.left=Dwt.LOC_NOWHERE;
+e.onblur=DwtKeyboardMgr.__onBlurHdlr;
+e.onfocus=DwtKeyboardMgr.__onFocusHdlr;
+document.body.appendChild(e);
+this.__killKeySeqTimedAction=new AjxTimedAction(this,this.__killKeySequenceAction);
+this.__killKeySeqTimedActionId=-1;
+this.__keySequence=[];
+this.__keyboardHandlingInited=true
+};
+DwtKeyboardMgr.prototype.__checkStatus=function(){
+if(!this.__enabled){
+return false
+}
+if(!this.__keyboardHandlingInited){
+this.__initKeyboardHandling()
+}
+return true
+};
+DwtKeyboardMgr.prototype.__doGrabFocus=function(e){
+if(!e){
+return
+}
+var o=(Dwt.instanceOf(e,"DwtInputField")||Dwt.instanceOf(e,"DwtHtmlEditor")||Dwt.instanceOf(e,"DwtCheckbox")||Dwt.instanceOf(e,"DwtRadioButton"));
+if(o||!(e instanceof DwtControl)){
+if(this.__focusObj instanceof DwtControl&&!this.__dwtInputCtrl){
+this.__oldFocusObj=this.__focusObj
+}
+this.__focusObj=e;
+this.__dwtInputCtrl=o;
+var a=o?e.getInputElement():e;
+if((!AjxEnv.isIE&&e.focus)||(AjxEnv.isIE&&e.focus&&!a.disabled&&Dwt.getVisible(a))){
+try{
+e.focus()
+}
+catch(t){}}}else{
+if(this.__dwtCtrlHasFocus&&(this.__focusObj instanceof DwtControl)){
+DwtKeyboardMgr.__onBlurHdlr();
+this.__dwtCtrlHasFocus=true
+}
+this.__focusObj=e;
+this.__dwtInputCtrl=false;
+if(this.__dwtCtrlHasFocus){
+DwtKeyboardMgr.__onFocusHdlr()
+}else{
+DwtKeyboardMgr.__onFocusHdlr();
+this._kbFocusField.focus()
+}}};
+DwtKeyboardMgr.__onFocusHdlr=function(t){
+var a=DwtKeyboardMgr.__shell.getKeyboardMgr();
+a.__dwtCtrlHasFocus=true;
+var e=a.__focusObj;
+if(e&&e.__doFocus){
+e.__doFocus()
+}};
+DwtKeyboardMgr.__onBlurHdlr=function(t){
+var a=DwtKeyboardMgr.__shell.getKeyboardMgr();
+var e=a.__oldFocusObj||a.__focusObj;
+if(e&&e.__doBlur){
+e.__doBlur()
+}
+a.__oldFocusObj=null;
+a.__dwtCtrlHasFocus=false
+};
+DwtKeyboardMgr.__keyUpHdlr=function(e){
+e=DwtUiEvent.getEvent(e);
+DwtKeyboardMgr.__keyCode=null;
+if(AjxEnv.isMac&&AjxEnv.isGeckoBased&&e.keyCode==0){
+return DwtKeyboardMgr.__keyDownHdlr(e)
+}else{
+return DwtKeyboardMgr.__handleKeyEvent(e)
+}};
+DwtKeyboardMgr.__keyPressHdlr=function(e){
+e=DwtUiEvent.getEvent(e);
+if(DwtKeyboardMgr.__keyCode&&AjxEnv.isGeckoBased){
+return DwtKeyboardMgr.__keyDownHdlr(e)
+}else{
+return DwtKeyboardMgr.__handleKeyEvent(e)
+}};
+DwtKeyboardMgr.__handleKeyEvent=function(e){
+if(DwtKeyboardMgr.__shell._blockInput){
+return false
+}
+if(e.type=="keypress"){
+DwtKeyEvent.geckoCheck(e)
+}
+e=DwtUiEvent.getEvent(e,this);
+var a=DwtKeyboardMgr.__shell.getKeyboardMgr();
+var t=DwtShell.keyEvent;
+t.setFromDhtmlEvent(e);
+if(a.__kbEventStatus!=DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED){
+return a.__processKeyEvent(e,t,false)
+}};
+DwtKeyboardMgr.__syncFocus=function(t,e){
+if((e!=t._kbFocusField)&&t.__dwtCtrlHasFocus){
+DwtKeyboardMgr.__onBlurHdlr()
+}
+if(!t.__dwtCtrlHasFocus){
+if((e!=t.__focusObj)&&!t.__dwtInputCtrl){
+if(t.__currTabGroup&&t.__currTabGroup.setFocusMember(e)){
+t.__focusObj=e;
+t.__oldFocusObj=null
+}else{
+return false
+}}}
+return true
+};
+DwtKeyboardMgr.__keyDownHdlr=function(r){
+if(DwtKeyboardMgr.__shell._blockInput){
+return false
+}
+r=DwtUiEvent.getEvent(r,this);
+var e=DwtKeyboardMgr.__shell.getKeyboardMgr();
+if(!e||!e.__checkStatus()){
+return false
+}
+var d=DwtShell.keyEvent;
+d.setFromDhtmlEvent(r);
+var c=DwtKeyboardMgr.__keyCode||DwtKeyEvent.getCharCode(r);
+var h=(DwtKeyboardMgr.__keyCode!=null);
+DwtKeyboardMgr.__shell.getToolTip().popdown();
+var o=DwtKeyboardMgr.__syncFocus(e,d.target);
+if(!o){}
+if(c==DwtKeyMapMgr.TAB_KEYCODE){
+if(e.__currTabGroup&&!DwtKeyMapMgr.hasModifier(d)){
+if(!DwtMenu.menuShowing()){
+if(o||e.__currTabGroup.getFocusMember()){
+if(!d.shiftKey){
+e.__currTabGroup.getNextFocusMember(true)
+}else{
+e.__currTabGroup.getPrevFocusMember(true)
+}}else{
+e.__currTabGroup.resetFocusMember(true)
+}}
+return e.__processKeyEvent(r,d,false,DwtKeyboardMgr.__KEYSEQ_HANDLED)
+}else{
+return e.__processKeyEvent(r,d,true,DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED)
+}}else{
+if(e.__currTabGroup&&!o&&AjxEnv.isGecko&&d.target instanceof HTMLHtmlElement){
+e.__currTabGroup.resetFocusMember(true)
+}}
+if(e.__dwtCtrlHasFocus){
+e._kbFocusField.value=""
+}
+if(DwtKeyMap.IS_MODIFIER[c]||(!e.__dwtCtrlHasFocus&&(e.__killKeySeqTimedActionId==-1)&&DwtKeyMapMgr.isInputElement(d.target)&&!DwtKeyboardMgr.isPossibleInputShortcut(d))){
+return e.__processKeyEvent(r,d,true,DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED)
+}
+if(e.__killKeySeqTimedActionId!=-1){
+AjxTimedAction.cancelAction(e.__killKeySeqTimedActionId);
+e.__killKeySeqTimedActionId=-1
+}
+var t=[];
+if(d.altKey){
+t.push(DwtKeyMap.ALT)
+}
+if(d.ctrlKey){
+t.push(DwtKeyMap.CTRL)
+}
+if(d.metaKey){
+t.push(DwtKeyMap.META)
+}
+if(d.shiftKey){
+t.push(DwtKeyMap.SHIFT)
+}
+t.push(c);
+e.__keySequence[e.__keySequence.length]=t.join(DwtKeyMap.JOIN);
+var s=DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED;
+var a=e.__focusObj;
+if(a&&(a.handleKeyAction)&&(e.__dwtCtrlHasFocus||e.__dwtInputCtrl||(a.hasFocus&&a.hasFocus()))){
+s=e.__dispatchKeyEvent(a,d,false,h);
+while((s==DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED)&&a.parent&&a.parent.getKeyMapName){
+a=a.parent;
+s=e.__dispatchKeyEvent(a,d,false,h)
+}}
+if((s==DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED)&&e.__currDefaultHandler&&!(e.__currTabGroup&&e.__currTabGroup.isDefaultHandlingBlocked())){
+s=e.__dispatchKeyEvent(e.__currDefaultHandler,d,false,h)
+}
+e.__kbEventStatus=s;
+var n=(s==DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED);
+if(s!=DwtKeyboardMgr.__KEYSEQ_PENDING){
+e.clearKeySeq()
+}
+if(s==DwtKeyboardMgr.__KEYSEQ_REPEAT){
+DwtKeyboardMgr.__keyCode=c
+}
+return e.__processKeyEvent(r,d,n)
+};
+DwtKeyboardMgr.prototype.__dispatchKeyEvent=function(s,r,o,a){
+if(s&&s.handleKeyEvent){
+var h=s.handleKeyEvent(r);
+return h?DwtKeyboardMgr.__KEYSEQ_HANDLED:DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED
+}
+var n=(s&&s.getKeyMapName)?s.getKeyMapName():null;
+if(!n){
+return DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED
+}
+var t=this.__keyMapMgr.getActionCode(this.__keySequence,n,o);
+if(t==DwtKeyMapMgr.NOT_A_TERMINAL){
+this.__hdlr=s;
+this.__mapName=n;
+this.__ev=r;
+this.__killKeySeqTimedActionId=AjxTimedAction.scheduleAction(this.__killKeySeqTimedAction,this.__keyTimeout);
+return DwtKeyboardMgr.__KEYSEQ_PENDING
+}else{
+if(t!=null){
+if(!s.handleKeyAction){
+return DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED
+}
+if(!a&&this.__keyMapMgr.repeats(n,t)){
+if(AjxEnv.isGeckoBased){
+return DwtKeyboardMgr.__KEYSEQ_REPEAT
+}else{
+var e=s.handleKeyAction(t,r);
+return e?DwtKeyboardMgr.__KEYSEQ_REPEAT:DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED
+}}
+var e=s.handleKeyAction(t,r);
+return e?DwtKeyboardMgr.__KEYSEQ_HANDLED:DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED
+}else{
+return DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED
+}}};
+DwtKeyboardMgr.prototype.__killKeySequenceAction=function(){
+this.__dispatchKeyEvent(this.__hdlr,this.__ev,true);
+this.clearKeySeq()
+};
+DwtKeyboardMgr.prototype.__tabGrpChangeListener=function(e){
+this.__doGrabFocus(e.newFocusMember)
+};
+DwtKeyboardMgr.prototype.__processKeyEvent=function(a,o,e,t){
+if(t){
+this.__kbEventStatus=t
+}
+o._stopPropagation=!e;
+o._returnValue=e;
+o.setToDhtmlEvent(a);
+return e
+}
+}
+if(AjxPackage.define("ajax.dwt.keyboard.DwtTabGroup")){
+DwtTabGroup=function(t,e){
+this.__members=new AjxVector();
+this.__parent=null;
+this.__name=t;
+this.__blockApplicationHandling=e;
+this.__currFocusMember=null;
+this.__evtMgr=new AjxEventMgr()
+};
+DwtTabGroup.NOT_ROOT_TABGROUP="NOT ROOT TAB GROUP";
+DwtTabGroup.__changeEvt=new DwtTabGroupEvent();
+DwtTabGroup.prototype.toString=function(){
+return"DwtTabGroup"
+};
+DwtTabGroup.prototype.getName=function(){
+return this.__name
+};
+DwtTabGroup.prototype.addFocusChangeListener=function(e){
+this.__checkRoot();
+this.__evtMgr.addListener(DwtEvent.STATE_CHANGE,e)
+};
+DwtTabGroup.prototype.removeFocusChangeListener=function(e){
+this.__checkRoot();
+this.__evtMgr.removeListener(DwtEvent.STATE_CHANGE,e)
+};
+DwtTabGroup.prototype.addMember=function(n,a){
+if(!n){
+return
+}
+var t=(n instanceof Array)?n:[n];
+for(var o=0,e=t.length;
+o<e;
+o++){
+this.__members.add(t[o],a);
+if(t[o] instanceof DwtTabGroup){
+t[o].newParent(this)
+}}};
+DwtTabGroup.prototype.addMemberAfter=function(e,t){
+this.addMember(e,this.__members.indexOf(t)+1)
+};
+DwtTabGroup.prototype.addMemberBefore=function(e,t){
+
+this.addMember(e,this.__members.indexOf(t))
+};
+DwtTabGroup.prototype.removeMember=function(a,e,t){
+return this.replaceMember(a,null,e,t)
+};
+DwtTabGroup.prototype.removeAllMembers=function(){
+this.__members.removeAll()
+};
+DwtTabGroup.prototype.replaceMember=function(n,s,c,r,e,o){
+var t=this.__getTabGroupForMember(n);
+if(!t){
+this.addMember(s);
+return null
+}
+var h=this.__getRootTabGroup();
+var a;
+if(e){
+a=e
+}else{
+if(h.__currFocusMember==n||((n instanceof DwtTabGroup)&&n.contains(h.__currFocusMember))){
+if(s){
+a=(s instanceof DwtTabGroup)?s.getFirstMember():s
+}else{
+a=this.__getPrevMember(n,c);
+if(!a){
+a=this.__getNextMember(n,c)
+}}}}
+if(a&&!o){
+h.__currFocusMember=a;
+if(!r){
+this.__notifyListeners(a)
+}}
+return s?this.__members.replaceObject(n,s):this.__members.remove(n)
+};
+DwtTabGroup.prototype.contains=function(e){
+return(Boolean(this.__getTabGroupForMember(e)))
+};
+DwtTabGroup.prototype.newParent=function(e){
+this.__parent=e
+};
+DwtTabGroup.prototype.getFirstMember=function(e){
+return this.__getLeftMostMember(e)
+};
+DwtTabGroup.prototype.getTabGroupMemberByName=function(t){
+var e=this.__members.getArray();
+for(var a=0;
+a<e.length;
+a++){
+var o=e[a];
+if(o instanceof DwtTabGroup&&o.getName()==t){
+return o
+}}};
+DwtTabGroup.prototype.getLastMember=function(e){
+return this.__getRightMostMember(e)
+};
+DwtTabGroup.prototype.getFocusMember=function(){
+this.__checkRoot();
+return this.__currFocusMember
+};
+DwtTabGroup.prototype.setFocusMember=function(o,e,t){
+this.__checkRoot();
+if(!this.__checkEnabled(o,e)){
+return false
+}
+var a=this.__getTabGroupForMember(o);
+if(a){
+this.__currFocusMember=o;
+if(!t){
+this.__notifyListeners(this.__currFocusMember)
+}
+return true
+}
+return false
+};
+DwtTabGroup.prototype.getNextFocusMember=function(e,t){
+this.__checkRoot();
+return this.__setFocusMember(true,e,t)
+};
+DwtTabGroup.prototype.getPrevFocusMember=function(e,t){
+this.__checkRoot();
+return this.__setFocusMember(false,e,t)
+};
+DwtTabGroup.prototype.resetFocusMember=function(t,a){
+this.__checkRoot();
+var e=this.__getLeftMostMember(t);
+if((e!=this.__currFocusMember)&&!a){
+this.__notifyListeners(this.__currFocusMember)
+}
+this.__currFocusMember=e;
+return this.__currFocusMember
+};
+DwtTabGroup.prototype.blockDefaultHandling=function(e){
+this.__blockDefaultHandling=blockDefaultHandling
+};
+DwtTabGroup.prototype.isDefaultHandlingBlocked=function(e){
+return this.__blockDefaultHandling
+};
+DwtTabGroup.prototype.dump=function(e){
+if(!window.AjxDebug&&window.DBG){
+return
+}
+this.__dump(this,e)
+};
+DwtTabGroup.prototype.size=function(){
+return this.__members.size()
+};
+DwtTabGroup.prototype.__getPrevMember=function(s,t){
+var e=this.__members.getArray();
+for(var o=this.__members.indexOf(s)-1;
+o>-1;
+o--){
+var n=e[o];
+if(!(n instanceof DwtTabGroup)){
+if(this.__checkEnabled(n,t)){
+return n
+}}else{
+n=n.__getRightMostMember(t);
+if(n&&this.__checkEnabled(n,t)){
+return n
+}}}
+return this.__parent?this.__parent.__getPrevMember(this,t):null
+};
+DwtTabGroup.prototype.__checkEnabled=function(t,e){
+if(!e){
+return true
+}
+if(!t||t.noTab){
+return false
+}
+if(t instanceof DwtControl){
+return(t.getEnabled()&&t.getVisible())
+}else{
+return !t.disabled&&Dwt.getVisible(t)
+}};
+DwtTabGroup.prototype.__getNextMember=function(r,t){
+var e=this.__members.getArray();
+var s=this.__members.size();
+for(var n=this.__members.indexOf(r)+1;
+n<s;
+n++){
+var o=e[n];
+if(!(o instanceof DwtTabGroup)){
+if(this.__checkEnabled(o,t)){
+return o
+}}else{
+o=o.__getLeftMostMember(t);
+if(o&&this.__checkEnabled(o,t)){
+return o
+}}}
+return this.__parent?this.__parent.__getNextMember(this,t):null
+};
+DwtTabGroup.prototype.__getRightMostMember=function(t){
+var e=this.__members.getArray();
+var n=null;
+for(var o=this.__members.size()-1;
+o>=0;
+o--){
+n=e[o];
+if(!(n instanceof DwtTabGroup)){
+if(this.__checkEnabled(n,t)){
+break
+}}else{
+n=n.__getRightMostMember(t);
+if(n&&this.__checkEnabled(n,t)){
+break
+}}}
+return(n&&this.__checkEnabled(n,t))?n:null
+};
+DwtTabGroup.prototype.__getLeftMostMember=function(t){
+var n=this.__members.size();
+var e=this.__members.getArray();
+var s=null;
+for(var o=0;
+o<n;
+o++){
+s=e[o];
+if(!(s instanceof DwtTabGroup)){
+if(this.__checkEnabled(s,t)){
+break
+}}else{
+s=s.__getLeftMostMember(t);
+if(s&&this.__checkEnabled(s,t)){
+break
+}}}
+return(s&&this.__checkEnabled(s,t))?s:null
+};
+DwtTabGroup.prototype.__notifyListeners=function(t){
+var a=this.__getRootTabGroup();
+if(a.__evtMgr){
+var e=DwtTabGroup.__changeEvt;
+e.reset();
+e.tabGroup=this;
+e.newFocusMember=t;
+a.__evtMgr.notifyListeners(DwtEvent.STATE_CHANGE,e)
+}};
+DwtTabGroup.prototype.__getRootTabGroup=function(){
+var e=this;
+while(e.__parent){
+e=e.__parent
+}
+return e
+};
+DwtTabGroup.prototype.__dump=function(n,t,h){
+h=h||0;
+var r="";
+for(var o=0;
+o<h;
+o++){
+r+="&nbsp;&nbsp;&nbsp;&nbsp;"
+}
+t=t||AjxDebug.DBG1;
+r+="&nbsp;&nbsp;&nbsp;&nbsp;";
+var s=n.__members.size();
+var e=n.__members.getArray();
+for(var o=0;
+o<s;
+o++){
+if(e[o] instanceof DwtTabGroup){
+n.__dump(e[o],t,h+1)
+}else{
+if(e[o].toString){}else{}}}};
+DwtTabGroup.prototype.__setFocusMember=function(n,t,a){
+if(!this.__currFocusMember){
+return this.resetFocusMember(t,a)
+}
+var o=this.__getTabGroupForMember(this.__currFocusMember);
+if(!o){
+return null
+}
+var e=(n)?o.__getNextMember(this.__currFocusMember,t):o.__getPrevMember(this.__currFocusMember,t);
+if(!e){
+e=(n)?this.__getLeftMostMember(t):this.__getRightMostMember(t);
+if(e==this.__currFocusMember){
+return null
+}}
+this.__currFocusMember=e;
+if(!a){
+this.__notifyListeners(this.__currFocusMember)
+}
+return this.__currFocusMember
+};
+DwtTabGroup.prototype.__getTabGroupForMember=function(s){
+if(!s){
+return null
+}
+var n=this.__members.size();
+var t=this.__members.getArray();
+var e;
+for(var o=0;
+o<n;
+o++){
+e=t[o];
+if(e==s){
+return this
+}else{
+if(e instanceof DwtTabGroup&&(e=e.__getTabGroupForMember(s))){
+return e
+}}}
+return null
+};
+DwtTabGroup.prototype.__checkRoot=function(){
+if(this.__parent){
+throw DwtTabGroup.NOT_ROOT_TABGROUP
+}}
+}
+if(AjxPackage.define("ajax.dwt.dnd.DwtDragEvent")){
+DwtDragEvent=function(){
+this.operation=null;
+this.srcControl=null;
+this.action=null;
+this.doIt=false;
+this.srcData=null
+};
+DwtDragEvent.DRAG_START=1;
+DwtDragEvent.SET_DATA=2;
+DwtDragEvent.DRAG_END=3;
+DwtDragEvent.DRAG_CANCEL=4
+}
+if(AjxPackage.define("ajax.dwt.dnd.DwtDragSource")){
+DwtDragSource=function(e){
+this.__supportedOps=e;
+this.__evtMgr=new AjxEventMgr()
+};
+DwtDragSource.__DRAG_LISTENER="DwtDragSource.__DRAG_LISTENER";
+DwtDragSource.__dragEvent=new DwtDragEvent();
+DwtDragSource.prototype.toString=function(){
+return"DwtDragSource"
+};
+DwtDragSource.prototype.addDragListener=function(e){
+this.__evtMgr.addListener(DwtDragSource.__DRAG_LISTENER,e)
+};
+DwtDragSource.prototype.removeDragListener=function(e){
+this.__evtMgr.removeListener(DwtDragSource.__DRAG_LISTENER,e)
+};
+DwtDragSource.prototype._beginDrag=function(e,t){
+if(!(this.__supportedOps&e)){
+return Dwt.DND_DROP_NONE
+}
+DwtDragSource.__dragEvent.operation=e;
+DwtDragSource.__dragEvent.srcControl=t;
+DwtDragSource.__dragEvent.action=DwtDragEvent.DRAG_START;
+DwtDragSource.__dragEvent.srcData=null;
+DwtDragSource.__dragEvent.doit=true;
+this.__evtMgr.notifyListeners(DwtDragSource.__DRAG_LISTENER,DwtDragSource.__dragEvent);
+return DwtDragSource.__dragEvent.operation
+};
+DwtDragSource.prototype._getData=function(){
+DwtDragSource.__dragEvent.action=DwtDragEvent.SET_DATA;
+this.__evtMgr.notifyListeners(DwtDragSource.__DRAG_LISTENER,DwtDragSource.__dragEvent);
+return DwtDragSource.__dragEvent.srcData
+};
+DwtDragSource.prototype._endDrag=function(){
+DwtDragSource.__dragEvent.action=DwtDragEvent.DRAG_END;
+DwtDragSource.__dragEvent.doit=false;
+this.__evtMgr.notifyListeners(DwtDragSource.__DRAG_LISTENER,DwtDragSource.__dragEvent);
+return DwtDragSource.__dragEvent.doit
+};
+DwtDragSource.prototype._cancelDrag=function(){
+DwtDragSource.__dragEvent.action=DwtDragEvent.DRAG_CANCEL;
+DwtDragSource.__dragEvent.doit=false;
+this.__evtMgr.notifyListeners(DwtDragSource.__DRAG_LISTENER,DwtDragSource.__dragEvent);
+return DwtDragSource.__dragEvent.doit
+}
+}
+if(AjxPackage.define("ajax.dwt.dnd.DwtDropEvent")){
+DwtDropEvent=function(){
+this.operation=null;
+this.targetControl=null;
+this.action=null;
+this.srcData=null;
+this.doIt=false
+};
+DwtDropEvent.DRAG_ENTER=1;
+DwtDropEvent.DRAG_LEAVE=2;
+DwtDropEvent.DRAG_OP_CHANGED=3;
+DwtDropEvent.DRAG_DROP=4
+}
+if(AjxPackage.define("ajax.dwt.dnd.DwtDropTarget")){
+DwtDropTarget=function(t){
+this._evtMgr=new AjxEventMgr();
+this.__hasMultiple=false;
+this._types={};
+if(typeof t=="string"){
+t=[t]
+}
+if(t&&t.length){
+for(var e=0;
+e<t.length;
+e++){
+this.addTransferType(t[e])
+}}};
+DwtDropTarget.__DROP_LISTENER="DwtDropTarget.__DROP_LISTENER";
+DwtDropTarget.__dropEvent=new DwtDropEvent();
+DwtDropTarget.prototype.toString=function(){
+return"DwtDropTarget"
+};
+DwtDropTarget.prototype.addDropListener=function(e){
+this._evtMgr.addListener(DwtDropTarget.__DROP_LISTENER,e)
+};
+DwtDropTarget.prototype.removeDropListener=function(e){
+this._evtMgr.removeListener(DwtDropTarget.__DROP_LISTENER,e)
+};
+DwtDropTarget.prototype.isValidTarget=function(t){
+if(t instanceof Array){
+var e=t.length;
+for(var a=0;
+a<e;
+a++){
+if(!this.__checkTarget(t[a])){
+return false
+}}
+return true
+}else{
+return this.__checkTarget(t)
+}};
+DwtDropTarget.prototype.markAsMultiple=function(){
+this.__hasMultiple=true
+};
+DwtDropTarget.prototype.hasMultipleTargets=function(){
+return this.__hasMultiple
+};
+DwtDropTarget.prototype.getTransferTypes=function(){
+return this._types
+};
+DwtDropTarget.prototype.addTransferType=function(e){
+this._types[e]=null
+};
+DwtDropTarget.prototype._dragEnter=function(e,a,n,t,o){
+DwtDropTarget.__dropEvent.operation=e;
+DwtDropTarget.__dropEvent.targetControl=a;
+DwtDropTarget.__dropEvent.action=DwtDropEvent.DRAG_ENTER;
+DwtDropTarget.__dropEvent.srcData=n;
+DwtDropTarget.__dropEvent.uiEvent=t;
+DwtDropTarget.__dropEvent.doIt=true;
+DwtDropTarget.__dropEvent.dndProxy=o;
+this._evtMgr.notifyListeners(DwtDropTarget.__DROP_LISTENER,DwtDropTarget.__dropEvent);
+return DwtDropTarget.__dropEvent.doIt
+};
+DwtDropTarget.prototype._dragLeave=function(){
+DwtDropTarget.__dropEvent.action=DwtDropEvent.DRAG_LEAVE;
+this._evtMgr.notifyListeners(DwtDropTarget.__DROP_LISTENER,DwtDropTarget.__dropEvent)
+};
+DwtDropTarget.prototype._dragOpChanged=function(e){
+DwtDropTarget.__dropEvent.operation=e;
+DwtDropTarget.__dropEvent.action=DwtDropEvent.DRAG_OP_CHANGED;
+this._evtMgr.notifyListeners(DwtDropTarget.__DROP_LISTENER,DwtDropTarget.__dropEvent);
+return DwtDropTarget.__dropEvent.doIt
+};
+DwtDropTarget.prototype._drop=function(t,e){
+DwtDropTarget.__dropEvent.action=DwtDropEvent.DRAG_DROP;
+DwtDropTarget.__dropEvent.srcData=t;
+DwtDropTarget.__dropEvent.uiEvent=e;
+this._evtMgr.notifyListeners(DwtDropTarget.__DROP_LISTENER,DwtDropTarget.__dropEvent);
+return DwtDropTarget.__dropEvent.doIt
+};
+DwtDropTarget.prototype.__checkTarget=function(item){
+if(this._types){
+for(var i in this._types){
+var ctor;
+if(this._types[i]){
+ctor=this._types[i]
+}else{
+ctor=this._types[i]=eval(i)
+}
+if(ctor&&(typeof ctor=="function")&&(item instanceof ctor)){
+return true
+}}
+return false
+}}
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtHoverMgr")){
+DwtHoverMgr=function(){
+this._hoverOverAction=new AjxTimedAction(this,this._notifyHoverOver);
+this._hoverOutAction=new AjxTimedAction(this,this._notifyHoverOut)
+};
+DwtHoverMgr.prototype._hoverObject;
+DwtHoverMgr.prototype._hoverOverDelay=750;
+DwtHoverMgr.prototype._hoverOverData;
+DwtHoverMgr.prototype._hoverOverAction;
+DwtHoverMgr.prototype._hoverOverActionId=-1;
+DwtHoverMgr.prototype._hoverOverListener;
+DwtHoverMgr.prototype._hoverOutDelay=50;
+DwtHoverMgr.prototype._hoverOutData;
+DwtHoverMgr.prototype._hoverOutAction;
+DwtHoverMgr.prototype._hoverOutActionId=-1;
+DwtHoverMgr.prototype._hoverOutListener;
+DwtHoverMgr.prototype._isHovering=false;
+DwtHoverMgr.prototype.setHoverObject=function(e){
+this._hoverObject=e
+};
+DwtHoverMgr.prototype.getHoverObject=function(){
+return this._hoverObject
+};
+DwtHoverMgr.prototype.reset=function(){
+this._hoverObject=null;
+this._hoverOverDelay=DwtHoverMgr.prototype._hoverOverDelay;
+this._hoverOverData=null;
+if(this._hoverOverActionId!=-1){
+AjxTimedAction.cancelAction(this._hoverOverActionId)
+}
+this._hoverOverActionId=-1;
+this._hoverOverListener=null;
+this._hoverOutDelay=DwtHoverMgr.prototype._hoverOutDelay;
+this._hoverOutData=null;
+if(this._hoverOutActionId!=-1){
+AjxTimedAction.cancelAction(this._hoverOutActionId);
+this._notifyHoverOut()
+}
+this._hoverOutActionId=-1;
+this._hoverOutListener=null
+};
+DwtHoverMgr.prototype.isHovering=function(){
+return this._isHovering
+};
+DwtHoverMgr.prototype.setHoverOverDelay=function(e){
+this._hoverOverDelay=e
+};
+DwtHoverMgr.prototype.setHoverOverData=function(e){
+this._hoverOverData=e
+};
+DwtHoverMgr.prototype.setHoverOverListener=function(e){
+this._hoverOverListener=e
+};
+DwtHoverMgr.prototype.setHoverOutDelay=function(e){
+this._hoverOutDelay=e
+};
+DwtHoverMgr.prototype.setHoverOutData=function(e){
+this._hoverOutData=e
+};
+DwtHoverMgr.prototype.setHoverOutListener=function(e){
+this._hoverOutListener=e
+};
+DwtHoverMgr.prototype.hoverOver=function(e,t){
+this._isHovering=true;
+if(this._hoverOverActionId!=-1){
+AjxTimedAction.cancelAction(this._hoverOverActionId)
+}
+this._hoverOverAction.args=[e,t];
+this._hoverOverActionId=AjxTimedAction.scheduleAction(this._hoverOverAction,this._hoverOverDelay)
+};
+DwtHoverMgr.prototype.hoverOut=function(){
+this._isHovering=false;
+if(this._hoverOverActionId!=-1){
+AjxTimedAction.cancelAction(this._hoverOverActionId)
+}
+if(this._hoverOutActionId==-1){
+if(this._hoverOutDelay>0){
+this._hoverOutActionId=AjxTimedAction.scheduleAction(this._hoverOutAction,this._hoverOutDelay)
+}else{
+this._notifyHoverOut()
+}}};
+DwtHoverMgr.prototype._notifyHoverOver=function(){
+this._hoverOverActionId=-1;
+if(this._hoverOverListener!=null){
+var e=this._hoverOverAction.args[0];
+var a=this._hoverOverAction.args[1];
+var t=new DwtHoverEvent(DwtEvent.HOVEROVER,this._hoverOverDelay,this._hoverOverData,e,a);
+this._hoverOverListener.handleEvent(t)
+}};
+DwtHoverMgr.prototype._notifyHoverOut=function(){
+this._hoverOutActionId=-1;
+if(this._hoverOutListener!=null){
+var e=new DwtHoverEvent(DwtEvent.HOVEROUT,this._hoverOutDelay,this._hoverOutData);
+this._hoverOutListener.handleEvent(e)
+}}
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtControl")){
+DwtControl=function(t){
+if(arguments.length==0){
+return
+}
+t=Dwt.getParams(arguments,DwtControl.PARAMS);
+var e=this.parent=t.parent;
+if(e&&!(e instanceof DwtComposite)){
+throw new DwtException("Parent must be a subclass of Composite",DwtException.INVALIDPARENT,"DwtControl")
+}
+this.shell=null;
+this._data={};
+this._eventMgr=new AjxEventMgr();
+this._disposed=false;
+if(!e){
+return
+}
+this._className=t.className||"DwtControl";
+this.__posStyle=t.posStyle;
+if(t.id){
+this._htmlElId=t.id
+}
+this.__index=t.index;
+this.__parentElement=t.parentElement;
+this._enabled=false;
+this._dragging=null;
+this._dndProxy=null;
+this._hasFocus=false;
+if(!t.deferred){
+this.__initCtrl()
+}
+this._hoverOverListener=new AjxListener(this,this.__handleHoverOver);
+this._hoverOutListener=new AjxListener(this,this.__handleHoverOut);
+this._dblClickIsolation=false;
+this._ignoreInternalOverOut=false;
+this.TEMPLATE=t.template||this.TEMPLATE
+};
+DwtControl.PARAMS=["parent","className","posStyle","deferred","id","index","template"];
+DwtControl.ALL_BY_ID={};
+DwtControl.prototype.toString=function(){
+return"DwtControl"
+};
+DwtControl.NORMAL="";
+DwtControl.ACTIVE="ZActive";
+DwtControl.FOCUSED="ZFocused";
+DwtControl.DISABLED="ZDisabled";
+DwtControl.HOVER="ZHover";
+DwtControl.SELECTED="ZSelected";
+DwtControl.DEFAULT="ZDefault";
+DwtControl.ERROR="ZError";
+DwtControl._RE_STATES=new RegExp("\\b("+[DwtControl.ACTIVE,DwtControl.FOCUSED,DwtControl.DISABLED,DwtControl.HOVER,DwtControl.SELECTED,DwtControl.DEFAULT,DwtControl.ERROR].join("|")+")\\b","g");
+DwtControl.STATIC_STYLE=Dwt.STATIC_STYLE;
+DwtControl.ABSOLUTE_STYLE=Dwt.ABSOLUTE_STYLE;
+DwtControl.RELATIVE_STYLE=Dwt.RELATIVE_STYLE;
+DwtControl.FIXED_STYLE=Dwt.FIXED_STYLE;
+DwtControl.CLIP=Dwt.CLIP;
+DwtControl.VISIBLE=Dwt.VISIBLE;
+DwtControl.SCROLL=Dwt.SCROLL;
+DwtControl.FIXED_SCROLL=Dwt.FIXED_SCROLL;
+DwtControl.DEFAULT=Dwt.DEFAULT;
+DwtControl._NO_DRAG=1;
+DwtControl._DRAGGING=2;
+DwtControl._DRAG_REJECTED=3;
+DwtControl.__DRAG_THRESHOLD=3;
+DwtControl.__TOOLTIP_THRESHOLD=5;
+DwtControl.__DND_HOVER_DELAY=750;
+DwtControl.__controlEvent=new DwtControlEvent();
+DwtControl.__DBL_CLICK_TIMEOUT=300;
+DwtControl.prototype._displayState="";
+DwtControl.prototype.addControlListener=function(e){
+this.addListener(DwtEvent.CONTROL,e)
+};
+DwtControl.prototype.removeControlListener=function(e){
+this.removeListener(DwtEvent.CONTROL,e)
+};
+DwtControl.prototype.addDisposeListener=function(e){
+this.addListener(DwtEvent.DISPOSE,e)
+};
+DwtControl.prototype.removeDisposeListener=function(e){
+this.removeListener(DwtEvent.DISPOSE,e)
+};
+DwtControl.prototype.addListener=function(t,a,e){
+return this._eventMgr.addListener(t,a,e)
+};
+DwtControl.prototype.removeListener=function(e,t){
+return this._eventMgr.removeListener(e,t)
+};
+DwtControl.prototype.removeAllListeners=function(e){
+return this._eventMgr.removeAll(e)
+};
+DwtControl.prototype.isListenerRegistered=function(e){
+return this._eventMgr.isListenerRegistered(e)
+};
+DwtControl.prototype.notifyListeners=function(e,t){
+return this._eventMgr.notifyListeners(e,t)
+};
+DwtControl.prototype.dispose=function(){
+if(this._disposed){
+return
+}
+if(this.parent!=null&&this.parent instanceof DwtComposite){
+this.parent.removeChild(this)
+}
+this._elRef=null;
+if(DwtControl.ALL_BY_ID){
+DwtControl.ALL_BY_ID[this._htmlElId]=null;
+delete DwtControl.ALL_BY_ID[this._htmlElId]
+}
+this._disposed=true;
+var e=new DwtDisposeEvent();
+e.dwtObj=this;
+this.notifyListeners(DwtEvent.DISPOSE,e)
+};
+DwtControl.prototype.getDocument=function(){
+return document
+};
+DwtControl.prototype.getTabGroupMember=function(){
+return this
+};
+DwtControl.prototype.getData=function(e){
+return this._data[e]
+};
+DwtControl.prototype.setData=function(e,t){
+this._data[e]=t
+};
+DwtControl.prototype.isDisposed=function(){
+return this._isDisposed
+};
+DwtControl.prototype.isInitialized=function(){
+return this.__ctrlInited
+};
+DwtControl.prototype.focus=function(){
+DwtShell.getShell(window).getKeyboardMgr().grabFocus(this)
+};
+DwtControl.prototype.hasFocus=function(){
+return this._hasFocus
+};
+DwtControl.prototype.handleKeyAction=function(e,t){
+return false
+};
+DwtControl.prototype.reparent=function(t,e){
+if(!this._checkState()){
+return
+}
+var a=this.getHtmlElement();
+this.parent.removeChild(this,true);
+DwtComposite._pendingElements[this._htmlElId]=a;
+t.addChild(this,e);
+this.parent=t
+};
+DwtControl.prototype.reparentHtmlElement=function(a,e){
+if(typeof a=="string"){
+a=document.getElementById(a)
+}
+if(!a){
+return
+}
+var t=this.getHtmlElement();
+if(e==null){
+a.appendChild(t)
+}else{
+if(typeof e=="object"){
+a.insertBefore(t,e)
+}else{
+if(a.childNodes[e]){
+a.insertBefore(t,a.childNodes[e])
+}else{
+a.appendChild(t)
+}}}};
+DwtControl.prototype.setHandler=function(t,e){
+if(!this._checkState()){
+return
+}
+var a=this.getHtmlElement();
+Dwt.setHandler(a,t,e)
+};
+DwtControl.prototype.clearHandler=function(e){
+if(!this._checkState()){
+return
+}
+var t=this.getHtmlElement();
+Dwt.clearHandler(t,e)
+};
+DwtControl.prototype.getBounds=function(){
+if(!this._checkState()){
+return
+}
+return Dwt.getBounds(this.getHtmlElement())
+};
+DwtControl.prototype.setBounds=function(a,s,o,t){
+if(!this._checkState()){
+return
+}
+var n=this.getHtmlElement();
+if(this.isListenerRegistered(DwtEvent.CONTROL)){
+this.__controlEvent.reset(DwtControlEvent.RESIZE|DwtControlEvent.MOVE);
+var e=Dwt.getBounds(n);
+this.__controlEvent.oldX=e.x;
+this.__controlEvent.oldY=e.y;
+this.__controlEvent.oldWidth=e.width;
+this.__controlEvent.oldHeight=e.height;
+this.setLocation(a,s);
+this.setSize(o,t);
+e=Dwt.getBounds(n);
+this.__controlEvent.newX=e.x;
+this.__controlEvent.newY=e.y;
+this.__controlEvent.newWidth=e.width;
+this.__controlEvent.newHeight=e.height;
+this.__controlEvent.requestedWidth=o;
+this.__controlEvent.requestedHeight=t;
+this.notifyListeners(DwtEvent.CONTROL,this.__controlEvent)
+}else{
+this.setLocation(a,s);
+this.setSize(o,t)
+}
+return this
+};
+DwtControl.prototype.getClassName=function(){
+return this._className
+};
+DwtControl.prototype.setClassName=function(t){
+if(!this._checkState()){
+return
+}
+this._className=t;
+var e=this.getHtmlElement();
+e.className=t;
+Dwt.addClass(e,this._displayState)
+};
+DwtControl.prototype.addClassName=function(e){
+Dwt.addClass(this.getHtmlElement(),e)
+};
+DwtControl.prototype.delClassName=function(e,t){
+Dwt.delClass(this.getHtmlElement(),e,t)
+};
+DwtControl.prototype.condClassName=function(a,e,t){
+Dwt.condClass(this.getHtmlElement(),a,e,t)
+};
+DwtControl.prototype.setDisplayState=function(o){
+if(!this._enabled){
+o=DwtControl.DISABLED
+}
+if(arguments.length>1){
+var e=[];
+for(var t=0;
+t<arguments.length;
+t++){
+e.push(arguments[t])
+}
+o=e.join(" ")
+}
+if(this._displayState!=o){
+this._displayState=o;
+Dwt.delClass(this.getHtmlElement(),DwtControl._RE_STATES,o)
+}};
+DwtControl.prototype.showAlert=function(e){
+if(e&&!this._alert){
+this.delClassName(null,"ZAlert")
+}else{
+if(!e&&this._alert){
+this.delClassName("ZAlert",null)
+}}
+this._alert=e
+};
+DwtControl.prototype.isAlertShown=function(){
+return this._alert
+};
+DwtControl.prototype._createHtmlFromTemplate=function(e,a){
+this.getHtmlElement().innerHTML=AjxTemplate.expand(e,a);
+var o=AjxTemplate.getParams(e);
+var t=o&&o["class"];
+if(t){
+t=[this._className,t].join(" ");
+this.setClassName(t)
+}};
+DwtControl.prototype.getCursor=function(){
+if(!this._checkState()){
+return
+}
+return Dwt.getCursor(this.getHtmlElement())
+};
+DwtControl.prototype.setCursor=function(e){
+if(!this._checkState()){
+return
+}
+Dwt.setCursor(this.getHtmlElement(),e)
+};
+DwtControl.prototype.getDragSource=function(){
+return this._dragSource
+};
+DwtControl.prototype.setDragSource=function(e){
+this._dragSource=e;
+if(e!=null&&this._ctrlCaptureObj==null){
+this._ctrlCaptureObj=new DwtMouseEventCapture({
+targetObj:this,id:"DwtControl",mouseOverHdlr:DwtControl.__mouseOverHdlr,mouseDownHdlr:DwtControl.__mouseDownHdlr,mouseMoveHdlr:DwtControl.__mouseMoveHdlr,mouseUpHdlr:DwtControl.__mouseUpHdlr,mouseOutHdlr:DwtControl.__mouseOutHdlr}
+);
+this._dndHoverAction=new AjxTimedAction(null,this.__dndDoHover)
+}};
+DwtControl.prototype.getDropTarget=function(){
+return this._dropTarget
+};
+DwtControl.prototype.setDropTarget=function(e){
+this._dropTarget=e
+};
+DwtControl.prototype.getEnabled=function(){
+if(!this._checkState()){
+return
+}
+return this._enabled
+};
+DwtControl.prototype.setEnabled=function(e,t){
+if(!this._checkState()){
+return
+}
+if(e!=this._enabled){
+this._enabled=e;
+this.setDisplayState(e?DwtControl.NORMAL:DwtControl.DISABLED);
+if(t){
+this.getHtmlElement().disabled=!e
+}}};
+DwtControl.prototype.getHTMLElId=function(){
+return this._htmlElId
+};
+DwtControl.prototype.getHtmlElement=function(){
+if(!this._checkState()){
+return
+}
+var e=this._elRef||document.getElementById(this._htmlElId);
+if(e==null){
+e=DwtComposite._pendingElements[this._htmlElId]
+}else{
+if(!e._rendered){
+delete DwtComposite._pendingElements[this._htmlElId];
+e._rendered=true
+}}
+return this._elRef=e
+};
+DwtControl.fromElement=function(e){
+return DwtControl.ALL_BY_ID&&DwtControl.ALL_BY_ID[e.id]
+};
+DwtControl.fromElementId=function(e){
+return DwtControl.ALL_BY_ID&&DwtControl.ALL_BY_ID[e]
+};
+DwtControl.findControl=function(t){
+while(t){
+try{
+if(t.id&&DwtControl.ALL_BY_ID&&DwtControl.ALL_BY_ID[t.id]){
+return DwtControl.ALL_BY_ID[t.id]
+}}
+catch(e){
+return null
+}
+t=t.parentNode
+}
+return null
+};
+DwtControl.getTargetControl=function(e,a){
+var t=DwtUiEvent.getTarget(e,a);
+return t?DwtControl.findControl(t):null
+};
+DwtControl.prototype.setHtmlElementId=function(t){
+if(this._disposed){
+return
+}
+if(this.__ctrlInited){
+var e=this.getHtmlElement();
+if(!e._rendered){
+delete DwtComposite._pendingElements[this._htmlElId];
+DwtComposite._pendingElements[t]=e
+}else{
+delete DwtControl.ALL_BY_ID[this._htmlElId];
+DwtControl.ALL_BY_ID[t]=this
+}
+e.id=t
+}
+this._htmlElId=t
+};
+DwtControl.prototype.getX=function(){
+if(!this._checkState()){
+return
+}
+return Dwt.getLocation(this.getHtmlElement()).x
+};
+DwtControl.prototype.getXW=function(){
+if(!this._checkState()){
+return
+}
+var e=this.getBounds();
+return e.x+e.width
+};
+DwtControl.prototype.getY=function(){
+if(!this._checkState()){
+return
+}
+return Dwt.getLocation(this.getHtmlElement()).y
+};
+DwtControl.prototype.getYH=function(){
+if(!this._checkState()){
+return
+}
+var e=this.getBounds();
+return e.y+e.height
+};
+DwtControl.prototype.getLocation=function(){
+if(!this._checkState()){
+return
+}
+return Dwt.getLocation(this.getHtmlElement())
+};
+DwtControl.prototype.setLocation=function(e,o){
+if(!this._checkState()){
+return
+}
+if(this.isListenerRegistered(DwtEvent.CONTROL)){
+var t=this.getHtmlElement();
+this.__controlEvent.reset(DwtControlEvent.MOVE);
+var a=Dwt.getLocation(t);
+this.__controlEvent.oldX=a.x;
+this.__controlEvent.oldY=a.y;
+Dwt.setLocation(t,e,o);
+a=Dwt.getLocation(t);
+this.__controlEvent.newX=a.x;
+this.__controlEvent.newY=a.y;
+this.notifyListeners(DwtEvent.CONTROL,this.__controlEvent)
+}else{
+Dwt.setLocation(this.getHtmlElement(),e,o)
+}
+return this
+};
+DwtControl.prototype.getScrollStyle=function(){
+if(!this._checkState()){
+return
+}
+return Dwt.getScrollStyle(this.getHtmlElement())
+};
+DwtControl.prototype.setScrollStyle=function(e){
+if(!this._checkState()){
+return
+}
+Dwt.setScrollStyle(this.getHtmlElement(),e)
+};
+DwtControl.prototype.setPosition=function(e){
+if(!this._checkState()){
+return
+}
+if(e==DwtControl.STATIC_STYLE||e==DwtControl.ABSOLUTE_STYLE||e==DwtControl.RELATIVE_STYLE){
+this.__posStyle=e;
+Dwt.setPosition(this.getHtmlElement(),e)
+}};
+DwtControl.prototype.getW=function(){
+if(!this._checkState()){
+return
+}
+return Dwt.getSize(this.getHtmlElement()).x
+};
+DwtControl.prototype.getH=function(){
+if(!this._checkState()){
+return
+}
+return Dwt.getSize(this.getHtmlElement()).y
+};
+DwtControl.prototype.getSize=function(){
+if(!this._checkState()){
+return
+}
+return Dwt.getSize(this.getHtmlElement())
+};
+DwtControl.prototype.setSize=function(t,e){
+if(!this._checkState()){
+return
+}
+if(this.isListenerRegistered(DwtEvent.CONTROL)){
+var o=this.getHtmlElement();
+this.__controlEvent.reset(DwtControlEvent.RESIZE);
+var a=Dwt.getSize(o);
+this.__controlEvent.oldWidth=a.x;
+this.__controlEvent.oldHeight=a.y;
+Dwt.setSize(o,t,e);
+a=Dwt.getSize(o);
+this.__controlEvent.newWidth=a.x;
+this.__controlEvent.newHeight=a.y;
+this.notifyListeners(DwtEvent.CONTROL,this.__controlEvent)
+}else{
+Dwt.setSize(this.getHtmlElement(),t,e)
+}
+return this
+};
+DwtControl.prototype.getToolTipContent=function(e){
+if(this._disposed){
+return
+}
+return this.__toolTipContent
+};
+DwtControl.prototype.setToolTipContent=function(e){
+if(this._disposed){
+return
+}
+this.__toolTipContent=e
+};
+DwtControl.prototype.getVisible=function(){
+if(!this._checkState()){
+return
+}
+return Dwt.getVisible(this.getHtmlElement())
+};
+DwtControl.prototype.setVisible=function(e){
+if(!this._checkState()){
+return
+}
+Dwt.setVisible(this.getHtmlElement(),e)
+};
+DwtControl.prototype.setVisibility=function(e){
+if(!this._checkState()){
+return
+}
+Dwt.setVisibility(this.getHtmlElement(),e)
+};
+DwtControl.prototype.getVisibility=function(){
+if(!this._checkState()){
+return
+}
+return Dwt.getVisiblility(this.getHtmlElement())
+};
+DwtControl.prototype.getZIndex=function(){
+if(!this._checkState()){
+return
+}
+return Dwt.getZIndex(this.getHtmlElement())
+};
+DwtControl.prototype.setZIndex=function(e){
+if(!this._checkState()){
+return
+}
+Dwt.setZIndex(this.getHtmlElement(),e)
+};
+DwtControl.prototype.zShow=function(e){
+this.setZIndex(e?Dwt.Z_VIEW:Dwt.Z_HIDDEN)
+};
+DwtControl.prototype.setDisplay=function(e){
+if(!this._checkState()){
+return
+}
+Dwt.setDisplay(this.getHtmlElement(),e)
+};
+DwtControl.prototype.preventSelection=function(e){
+return !this.__isInputEl(e)
+};
+DwtControl.prototype.preventContextMenu=function(e){
+return e?(!this.__isInputEl(e)):true
+};
+DwtControl.prototype.setContent=function(e){
+if(e){
+this.getHtmlElement().innerHTML=e
+}};
+DwtControl.prototype.clearContent=function(){
+this.getHtmlElement().innerHTML=""
+};
+DwtControl.prototype.appendElement=function(t){
+var e=AjxUtil.isString(t)?document.getElementById(t):t;
+if(e){
+e.appendChild(this.getHtmlElement(),e)
+}};
+DwtControl.prototype.replaceElement=function(o,e,n){
+var t=AjxUtil.isString(o)?document.getElementById(o):o;
+if(t){
+var a=this.getHtmlElement();
+t.parentNode.replaceChild(a,t);
+this._replaceElementHook(t,a,e,n)
+}};
+DwtControl.prototype._replaceElementHook=function(t,o,e,n){
+if((e==null||e)&&t.className){
+Dwt.addClass(o,t.className)
+}
+if(n==null||n){
+var a=t.getAttribute("style");
+if(a){
+o.setAttribute("style",[o.getAttribute("style"),a].join(";"))
+}}};
+DwtControl.prototype._blur=function(){};
+DwtControl.prototype._focus=function(){};
+DwtControl.prototype._focusByMouseUpEvent=function(e){
+if(this.getEnabled()){
+this.focus()
+}};
+DwtControl.prototype._focusByMouseDownEvent=function(e){
+this._focusByMouseUpEvent(e)
+};
+DwtControl.prototype._getDragProxy=function(e){
+return null
+};
+DwtControl.prototype._setDragProxyState=function(e){
+Dwt.condClass(this._dndProxy,e,DwtCssStyle.DROPPABLE,DwtCssStyle.NOT_DROPPABLE)
+};
+DwtControl.__junkIconId=0;
+DwtControl.prototype._destroyDragProxy=function(e){
+if(e){
+if(e.parentNode){
+e.parentNode.removeChild(e)
+}else{
+e.style.zIndex=-100;
+e.id="DwtJunkIcon"+DwtControl.__junkIconId++;
+e=null
+}}};
+DwtControl.prototype._isValidDragObject=function(e){
+return true
+};
+DwtControl.prototype._dragEnter=function(e){};
+DwtControl.prototype._dragOver=function(e){};
+DwtControl.prototype._dragHover=function(e){};
+DwtControl.prototype._dragLeave=function(e){};
+DwtControl.prototype._drop=function(e){};
+DwtControl.prototype._setKeyPressEventHdlr=function(e){
+this._setEventHdlrs([DwtEvent.ONKEYPRESS],e)
+};
+DwtControl.prototype._setMouseEventHdlrs=function(e){
+this._setEventHdlrs(DwtEvent.MOUSE_EVENTS,e)
+};
+DwtControl.prototype._setEventHdlrs=function(a,e){
+if(!this._checkState()){
+return
+}
+var o=this.getHtmlElement();
+for(var t=0;
+t<a.length;
+t++){
+if(e!==true){
+Dwt.setHandler(o,a[t],DwtControl.__HANDLER[a[t]])
+}else{
+Dwt.clearHandler(o,a[t])
+}}};
+DwtControl.prototype._setMouseEvents=function(){
+var e=[DwtEvent.ONCONTEXTMENU,DwtEvent.ONDBLCLICK,DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEMOVE,DwtEvent.ONMOUSEUP,DwtEvent.ONSELECTSTART];
+if(AjxEnv.isIE){
+e.push(DwtEvent.ONMOUSEENTER,DwtEvent.ONMOUSELEAVE)
+}else{
+e.push(DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT)
+}
+this._setEventHdlrs(e)
+};
+DwtControl.prototype._setMouseEvent=function(t,e){
+t.reset();
+e.ersatz=true;
+DwtUiEvent.copy(t,e);
+t.button=e.button
+};
+DwtControl.prototype._getStopPropagationValForMouseEv=function(e){
+return true
+};
+DwtControl.prototype._getEventReturnValForMouseEv=function(e){
+return false
+};
+DwtControl.prototype._checkState=function(){
+if(this._disposed){
+return false
+}
+if(!this.__ctrlInited){
+this.__initCtrl()
+}
+return true
+};
+DwtControl.prototype._position=function(o){
+this._checkState();
+var a=this.shell.getSize();
+var t=this.getSize();
+var e,n;
+if(!o){
+e=Math.round((a.x-t.x)/2);
+n=Math.round((a.y-t.y)/2)
+}else{
+e=o.x;
+n=o.y
+}
+if((e+t.x)>a.x){
+e=a.x-t.x
+}
+if((n+t.y)>a.y){
+n=a.y-t.y
+}
+this.setLocation(e,n)
+};
+DwtControl._scrollIntoView=function(a,t){
+var e=Dwt.toWindow(a,0,0,null,null,DwtPoint.tmp).y;
+var r=Dwt.toWindow(t,0,0,null,null,DwtPoint.tmp).y+t.scrollTop;
+var s=e-r;
+if(s<0){
+t.scrollTop+=s
+}else{
+var n=Dwt.getSize(t,DwtPoint.tmp).y;
+var o=Dwt.getSize(a,DwtPoint.tmp).y;
+s=(e+o)-(r+n);
+if(s>0){
+t.scrollTop+=s
+}}};
+DwtControl._dndScrollCallback=function(a,r){
+var t=a.container;
+if(!t){
+return
+}
+var u=r.dwtObj&&r.dwtObj._dndScrollId;
+if(r.type=="mouseup"||!u||(a.id&&u!=a.id)){
+if(t._dndScrollActionId!=-1){
+AjxTimedAction.cancelAction(t._dndScrollActionId);
+t._dndScrollActionId=-1
+}
+return
+}
+t._scrollAmt=0;
+if(t.clientHeight<t.scrollHeight){
+var o=Dwt.toWindow(t,0,0,null,null,DwtPoint.tmp).y;
+var m=o+t.scrollTop;
+var h=t.scrollTop;
+var c=r.docY-m;
+var n=(t.clientWidth<t.scrollWidth)?a.threshold+Dwt.SCROLLBAR_WIDTH:a.threshold;
+var s=(c<=n)?-1*a.amount:0;
+if(s==0){
+var e=Dwt.getSize(t,DwtPoint.tmp).y;
+var d=m+e;
+c=d-r.docY;
+s=(c<=n)?a.amount:0
+}
+t._scrollAmt=s;
+if(s){
+if(!t._dndScrollAction){
+t._dndScrollAction=new AjxTimedAction(null,DwtControl._dndScroll,[a]);
+t._dndScrollActionId=-1
+}
+if(t._dndScrollActionId==-1){
+t._dndScrollActionId=AjxTimedAction.scheduleAction(t._dndScrollAction,0)
+}}else{
+if(t._dndScrollActionId!=-1){
+AjxTimedAction.cancelAction(t._dndScrollActionId);
+t._dndScrollActionId=-1
+}}}};
+DwtControl._dndScroll=function(n){
+var t=n.container;
+var o=Dwt.toWindow(t,0,0,null,null,DwtPoint.tmp).y;
+var a=Dwt.getSize(t,DwtPoint.tmp).y;
+var e=t.scrollTop;
+if((t._scrollAmt<0&&e>0)||(t._scrollAmt>0&&(e+a<t.scrollHeight))){
+t.scrollTop+=t._scrollAmt;
+t._dndScrollActionId=AjxTimedAction.scheduleAction(t._dndScrollAction,n.interval)
+}};
+DwtControl.__keyPressHdlr=function(a){
+var o=o?o:DwtControl.getTargetControl(a);
+if(!o){
+return false
+}
+if(o.__hasToolTipContent()){
+var t=DwtShell.getShell(window);
+var e=t.getHoverMgr();
+e.setHoverOutListener(o._hoverOutListener);
+e.hoverOut();
+o.__tooltipClosed=false
+}};
+DwtControl.prototype.__hasToolTipContent=function(){
+if(this._disposed){
+return false
+}
+return Boolean(this.__toolTipContent||(this.getToolTipContent!=DwtControl.prototype.getToolTipContent))
+};
+DwtControl.prototype.__doBlur=function(){
+this._hasFocus=false;
+if(this.isListenerRegistered(DwtEvent.ONBLUR)){
+var e=DwtShell.focusEvent;
+e.dwtObj=this;
+e.state=DwtFocusEvent.BLUR;
+obj.notifyListeners(DwtEvent.ONBLUR,mouseEv)
+}
+this._blur()
+};
+DwtControl.prototype.__doFocus=function(){
+this._hasFocus=true;
+if(this.isListenerRegistered(DwtEvent.ONFOCUS)){
+var e=DwtShell.focusEvent;
+e.dwtObj=this;
+e.state=DwtFocusEvent.FOCUS;
+obj.notifyListeners(DwtEvent.ONFOCUS,mouseEv)
+}
+this._focus()
+};
+DwtControl.__dblClickHdlr=function(e){
+var t=DwtControl.getTargetControl(e);
+if(t&&t._dblClickIsolation){
+t._clickPending=false;
+AjxTimedAction.cancelAction(t._dblClickActionId)
+}
+return DwtControl.__mouseEvent(e,DwtEvent.ONDBLCLICK)
+};
+DwtControl.__mouseOverHdlr=function(s,n){
+var h=(DwtMouseEventCapture.getId()=="DwtControl")?DwtMouseEventCapture.getCaptureObj():null;
+if(h!=null){
+s=DwtUiEvent.getEvent(s);
+s._stopPropagation=true;
+return false
+}
+var r=DwtControl.getTargetControl(s);
+if(!r){
+return false
+}
+n=n||DwtEvent.ONMOUSEOVER;
+if((n==DwtEvent.ONMOUSEOVER)&&r._ignoreInternalOverOut){
+var e=DwtControl.getTargetControl(s,true);
+if(r==e){
+return false
+}}
+var o=DwtShell.mouseEvent;
+if(r._dragging==DwtControl._NO_DRAG){
+o.setFromDhtmlEvent(s,r);
+if(r.isListenerRegistered(n)){
+r.notifyListeners(n,o)
+}
+if(r.__hasToolTipContent()){
+var a=DwtShell.getShell(window);
+var t=a.getHoverMgr();
+if((!t.isHovering()||t.getHoverObject()!=r)&&!DwtMenu.menuShowing()){
+t.reset();
+t.setHoverObject(r);
+t.setHoverOverData(o);
+t.setHoverOverDelay(DwtToolTip.TOOLTIP_DELAY);
+t.setHoverOverListener(r._hoverOverListener);
+t.hoverOver(o.docX,o.docY)
+}}}
+o._stopPropagation=true;
+o._returnValue=false;
+o.setToDhtmlEvent(s);
+return false
+};
+DwtControl.__mouseEnterHdlr=function(e){
+return DwtControl.__mouseOverHdlr(e,DwtEvent.ONMOUSEENTER)
+};
+DwtControl.__mouseDownHdlr=function(n){
+var s=DwtControl.getTargetControl(n);
+if(!s){
+return false
+}
+n=DwtUiEvent.getEvent(n);
+s._focusByMouseDownEvent(n);
+if(s.__hasToolTipContent()){
+var a=DwtShell.getShell(window);
+var t=a.getHoverMgr();
+t.setHoverOutListener(s._hoverOutListener);
+t.hoverOut()
+}
+var o=DwtShell.mouseEvent;
+o.setFromDhtmlEvent(n,s);
+if(s._dragSource&&(o.button==DwtMouseEvent.LEFT)&&s._isValidDragObject(o)){
+try{
+s._ctrlCaptureObj.capture()
+}
+catch(e){}
+s._dragOp=(o.ctrlKey)?Dwt.DND_DROP_COPY:Dwt.DND_DROP_MOVE;
+s.__dragStartX=o.docX;
+s.__dragStartY=o.docY
+}
+return DwtControl.__mouseEvent(n,DwtEvent.ONMOUSEDOWN,s,o)
+};
+DwtControl.__mouseMoveHdlr=function(r){
+var n=(DwtMouseEventCapture.getId()=="DwtControl")?DwtMouseEventCapture.getCaptureObj():null;
+var o=n?n.targetObj:DwtControl.getTargetControl(r);
+if(!o){
+return false
+}
+if(o.__dndHoverActionId!=-1){
+AjxTimedAction.cancelAction(o.__dndHoverActionId);
+o.__dndHoverActionId=-1
+}
+var h=DwtShell.mouseEvent;
+h.setFromDhtmlEvent(r,n?true:o);
+if(h.docX<0||h.docY<0){
+h._stopPropagation=true;
+h._returnValue=false;
+h.setToDhtmlEvent(r);
+return false
+}
+if(o._dragSource==null||n==null||(o!=null&&o._dragging==DwtControl._NO_DRAG&&Math.abs(o.__dragStartX-h.docX)<DwtControl.__DRAG_THRESHOLD&&Math.abs(o.__dragStartY-h.docY)<DwtControl.__DRAG_THRESHOLD)){
+if(o.__hasToolTipContent()){
+var s=DwtShell.getShell(window);
+var e=s.getHoverMgr();
+if(!e.isHovering()&&!o.__tooltipClosed&&!DwtMenu.menuShowing()){
+e.hoverOver(h.docX,h.docY)
+}else{
+var a=o.__lastTooltipX?Math.abs(h.docX-o.__lastTooltipX):null;
+var t=o.__lastTooltipY?Math.abs(h.docY-o.__lastTooltipY):null;
+if((a!=null&&a>DwtControl.__TOOLTIP_THRESHOLD)||(t!=null&&t>DwtControl.__TOOLTIP_THRESHOLD)){
+e.setHoverOutListener(o._hoverOutListener);
+e.hoverOut();
+o.__tooltipClosed=true
+}}}
+return DwtControl.__mouseEvent(r,DwtEvent.ONMOUSEMOVE,o,h)
+}else{
+if(o._dragging==DwtControl._NO_DRAG){
+o._dragOp=o._dragSource._beginDrag(o._dragOp,o);
+if(o._dragOp!=Dwt.DND_DROP_NONE){
+o._dragging=DwtControl._DRAGGING;
+o._dndProxy=o._getDragProxy(o._dragOp);
+Dwt.addClass(o._dndProxy,"DwtDragProxy");
+if(o._dndProxy==null){
+o._dragging=DwtControl._DRAG_REJECTED
+}}else{
+o._dragging=DwtControl._DRAG_REJECTED
+}}
+if(o._dragging!=DwtControl._DRAG_REJECTED){
+var c=h.dwtObj;
+if(c){
+o._dndHoverAction.args=[c];
+o.__dndHoverActionId=AjxTimedAction.scheduleAction(o._dndHoverAction,DwtControl.__DND_HOVER_DELAY)
+}
+if(c&&c._dropTarget&&c!=o){
+if(c!=o.__lastDestDwtObj||c._dropTarget.hasMultipleTargets()){
+if(c._dropTarget._dragEnter(o._dragOp,c,o._dragSource._getData(),h,o._dndProxy)){
+o._setDragProxyState(true);
+o.__dropAllowed=true;
+c._dragEnter(h)
+}else{
+o._setDragProxyState(false);
+o.__dropAllowed=false
+}}else{
+if(o.__dropAllowed){
+c._dragOver(h)
+}}}else{
+o._setDragProxyState(false)
+}
+if(o.__lastDestDwtObj&&o.__lastDestDwtObj!=c&&o.__lastDestDwtObj._dropTarget&&o.__lastDestDwtObj!=o){
+if(c&&!c._dndScrollCallback&&o.__lastDestDwtObj._dndScrollCallback){
+o.__lastDestDwtObj._dndScrollCallback.run(h)
+}
+o.__lastDestDwtObj._dragLeave(h);
+o.__lastDestDwtObj._dropTarget._dragLeave()
+}
+o.__lastDestDwtObj=c;
+if((c!=o)&&c&&c._dndScrollCallback){
+c._dndScrollCallback.run(h)
+}
+Dwt.setLocation(o._dndProxy,h.docX+2,h.docY+2)
+}else{
+DwtControl.__mouseEvent(r,DwtEvent.ONMOUSEMOVE,o,h)
+}
+h._stopPropagation=true;
+h._returnValue=false;
+h.setToDhtmlEvent(r);
+return false
+}};
+DwtControl.__mouseUpHdlr=function(t){
+var n=(DwtMouseEventCapture.getId()=="DwtControl")?DwtMouseEventCapture.getCaptureObj():null;
+var o=n?n.targetObj:DwtControl.getTargetControl(t);
+if(!o){
+return false
+}
+if(o.__dndHoverActionId!=-1){
+AjxTimedAction.cancelAction(o.__dndHoverActionId);
+o.__dndHoverActionId=-1
+}
+var e=DwtShell.mouseEvent;
+e.setFromDhtmlEvent(t,n?true:o);
+if(!o._dragSource||!n){
+return DwtControl.__processMouseUpEvent(t,o,e)
+}else{
+n.release();
+if(o._dragging!=DwtControl._DRAGGING){
+o._dragging=DwtControl._NO_DRAG;
+return DwtControl.__processMouseUpEvent(t,o,e)
+}else{
+o.__lastDestDwtObj=null;
+var a=e.dwtObj;
+if(a&&a._dropTarget&&o.__dropAllowed&&a!=o){
+a._drop(e);
+a._dropTarget._drop(o._dragSource._getData(),e);
+o._dragSource._endDrag();
+o._destroyDragProxy(o._dndProxy);
+o._dragging=DwtControl._NO_DRAG
+}else{
+DwtControl.__badDrop(o,e)
+}
+if(a&&a._dndScrollCallback){
+a._dndScrollCallback.run(e)
+}
+e._stopPropagation=true;
+e._returnValue=false;
+e.setToDhtmlEvent(t);
+return false
+}}};
+DwtControl.__badDrop=function(a,t){
+a._dragSource._cancelDrag();
+a.__dragEndX=t.docX;
+a.__dragEndY=t.docY;
+if(a.__badDropAction==null){
+a.__badDropAction=new AjxTimedAction(a,a.__badDropEffect)
+}
+var e=(a.__dragEndY-a.__dragStartY)/(a.__dragEndX-a.__dragStartX);
+a.__badDropAction.args=[e,a.__dragStartY-(e*a.__dragStartX),(a.__dragStartX-a.__dragEndX<0)?-1:1];
+AjxTimedAction.scheduleAction(a.__badDropAction,0)
+};
+DwtControl.__processMouseUpEvent=function(a,o,t){
+if(o._dblClickIsolation&&t&&(t.button==DwtMouseEvent.LEFT)){
+if(o._clickPending){
+return false
+}else{
+o._clickPending=true;
+var e=new AjxTimedAction(null,DwtControl.__timedClick,[a,o,t]);
+o._dblClickActionId=AjxTimedAction.scheduleAction(e,DwtControl.__DBL_CLICK_TIMEOUT);
+DwtUiEvent.setBehaviour(a,true,false);
+o._st=new Date();
+return false
+}}else{
+o._clickPending=false;
+return DwtControl.__mouseEvent(a,DwtEvent.ONMOUSEUP,o,t)
+}};
+DwtControl.__timedClick=function(t,a,e){
+a._clickPending=false;
+DwtControl.__mouseEvent(t,DwtEvent.ONMOUSEUP,a,e)
+};
+DwtControl.__mouseOutHdlr=function(n,o){
+var s=DwtControl.getTargetControl(n);
+if(!s){
+return false
+}
+o=o||DwtEvent.ONMOUSEOUT;
+if((o==DwtEvent.ONMOUSEOUT)&&s._ignoreInternalOverOut){
+var e=DwtControl.getTargetControl(n,true);
+if(s==e){
+return false
+}}
+if(s.__hasToolTipContent()){
+var a=DwtShell.getShell(window);
+var t=a.getHoverMgr();
+t.setHoverOutListener(s._hoverOutListener);
+t.hoverOut();
+s.__tooltipClosed=false
+}
+return DwtControl.__mouseEvent(n,o||DwtEvent.ONMOUSEOUT,s)
+};
+DwtControl.__mouseLeaveHdlr=function(e){
+return DwtControl.__mouseOutHdlr(e,DwtEvent.ONMOUSELEAVE)
+};
+DwtControl.__mouseWheelHdlr=function(e){
+var t=DwtControl.getTargetControl(e);
+if(!t){
+return false
+}
+return DwtControl.__mouseEvent(e,DwtEvent.ONMOUSEWHEEL,t)
+};
+DwtControl.__selectStartHdlr=function(e){
+return DwtControl.__mouseEvent(e,DwtEvent.ONSELECTSTART)
+};
+DwtControl.__contextMenuHdlr=function(t){
+if(AjxEnv.isSafari){
+var a=DwtControl.getTargetControl(t);
+var e=a?a.preventContextMenu():true;
+if(e){
+DwtControl.__mouseEvent(t,DwtEvent.ONMOUSEDOWN);
+return DwtControl.__mouseEvent(t,DwtEvent.ONMOUSEUP)
+}}
+return DwtControl.__mouseEvent(t,DwtEvent.ONCONTEXTMENU)
+};
+DwtControl.__mouseEvent=function(o,t,n,a){
+var n=n?n:DwtControl.getTargetControl(o);
+if(!n){
+return false
+}
+if(!a){
+a=DwtShell.mouseEvent;
+a.setFromDhtmlEvent(o,n)
+}
+var e=a.target.tagName.toLowerCase();
+if(e!="input"&&e!="textarea"&&e!="a"){
+a._stopPropagation=true;
+a._returnValue=false
+}else{
+a._stopPropagation=false;
+a._returnValue=true
+}
+DwtEventManager.notifyListeners(t,a);
+if(n.isListenerRegistered&&n.isListenerRegistered(t)){
+n.notifyListeners(t,a)
+}
+a.setToDhtmlEvent(o);
+return a._returnValue
+};
+DwtControl.__HANDLER={};
+DwtControl.__HANDLER[DwtEvent.ONCONTEXTMENU]=DwtControl.__contextMenuHdlr;
+DwtControl.__HANDLER[DwtEvent.ONDBLCLICK]=DwtControl.__dblClickHdlr;
+DwtControl.__HANDLER[DwtEvent.ONMOUSEDOWN]=DwtControl.__mouseDownHdlr;
+DwtControl.__HANDLER[DwtEvent.ONMOUSEENTER]=DwtControl.__mouseEnterHdlr;
+DwtControl.__HANDLER[DwtEvent.ONMOUSELEAVE]=DwtControl.__mouseLeaveHdlr;
+DwtControl.__HANDLER[DwtEvent.ONMOUSEMOVE]=DwtControl.__mouseMoveHdlr;
+DwtControl.__HANDLER[DwtEvent.ONMOUSEOUT]=DwtControl.__mouseOutHdlr;
+DwtControl.__HANDLER[DwtEvent.ONMOUSEOVER]=DwtControl.__mouseOverHdlr;
+DwtControl.__HANDLER[DwtEvent.ONMOUSEUP]=DwtControl.__mouseUpHdlr;
+DwtControl.__HANDLER[DwtEvent.ONMOUSEWHEEL]=DwtControl.__mouseWheelHdlr;
+DwtControl.__HANDLER[DwtEvent.ONSELECTSTART]=DwtControl.__selectStartHdlr;
+DwtControl.__HANDLER[DwtEvent.ONKEYPRESS]=DwtControl.__keyPressHdlr;
+DwtControl.prototype.__initCtrl=function(){
+this.shell=this.parent.shell||this.parent;
+this._htmlElId=this.__internalId=this._htmlElId||Dwt.getNextId();
+var e=this._elRef=this._createElement(this._htmlElId);
+e.id=this._htmlElId;
+if(DwtControl.ALL_BY_ID){
+if(DwtControl.ALL_BY_ID[this._htmlElId]){
+this._htmlElId=e.id=this.__internalId=DwtId._makeId(this._htmlElId,Dwt.getNextId())
+}
+DwtControl.ALL_BY_ID[this._htmlElId]=this
+}
+DwtComposite._pendingElements[this._htmlElId]=e;
+if(this.__posStyle==null||this.__posStyle==DwtControl.STATIC_STYLE){
+e.style.position=DwtControl.STATIC_STYLE
+}else{
+e.style.position=this.__posStyle
+}
+e.className=this._className;
+e.style.overflow="visible";
+this._enabled=true;
+this.__controlEvent=DwtControl.__controlEvent;
+this._dragging=DwtControl._NO_DRAG;
+this.__ctrlInited=true;
+this.parent.addChild(this,this.__index)
+};
+DwtControl.prototype._createElement=function(e){
+return document.createElement("DIV")
+};
+DwtControl.prototype.__dndDoHover=function(e){
+e._dragHover()
+};
+DwtControl.prototype.__badDropEffect=function(e,n,a){
+var t=(Math.abs(e)<=1);
+var o=t?this.__dragStartX-this.__dragEndX:this.__dragStartY-this.__dragEndY;
+if(o*a>0&&!(this.__dragEndY==this.__dragStartY||this.__dragEndX==this.__dragStartX)){
+if(t){
+this.__dragEndX+=(30*a);
+this._dndProxy.style.top=e*this.__dragEndX+n;
+this._dndProxy.style.left=this.__dragEndX
+}else{
+this.__dragEndY+=(30*a);
+this._dndProxy.style.top=this.__dragEndY;
+this._dndProxy.style.left=(this.__dragEndY-n)/e
+}
+AjxTimedAction.scheduleAction(this.__badDropAction,0)
+}else{
+this._destroyDragProxy(this._dndProxy);
+this._dragging=DwtControl._NO_DRAG
+}};
+DwtControl.prototype.__handleHoverOver=function(o){
+if(this._eventMgr.isListenerRegistered(DwtEvent.HOVEROVER)){
+this._eventMgr.notifyListeners(DwtEvent.HOVEROVER,o)
+}
+var a=o&&o.object;
+var n=this.getToolTipContent(a);
+var t,s;
+if(!n){
+t=""
+}else{
+if(typeof(n)=="string"){
+t=n
+}else{
+if(n instanceof AjxCallback){
+s=n
+}else{
+if(typeof(n)=="object"){
+t=n.content;
+s=n.callback
+}}}}
+if(!t&&s&&n.loading){
+t=AjxMsg.loading
+}
+if(t){
+this.__showToolTip(o,t)
+}
+if(s){
+var e=new AjxCallback(this,this.__showToolTip,[o]);
+AjxTimedAction.scheduleAction(new AjxTimedAction(null,function(){
+s.run(e)
+}
+),0)
+}};
+DwtControl.prototype.__showToolTip=function(a,t){
+if(!t){
+return
+}
+var e=DwtShell.getShell(window);
+var o=e.getToolTip();
+o.setContent(t);
+o.popup(a.x,a.y);
+this.__lastTooltipX=a.x;
+this.__lastTooltipY=a.y;
+this.__tooltipClosed=false
+};
+DwtControl.prototype.__handleHoverOut=function(t){
+if(this._eventMgr.isListenerRegistered(DwtEvent.HOVEROUT)){
+this._eventMgr.notifyListeners(DwtEvent.HOVEROUT,t)
+}
+var e=DwtShell.getShell(window);
+var a=e.getToolTip();
+a.popdown();
+this.__lastTooltipX=null;
+this.__lastTooltipY=null
+};
+DwtControl.prototype.__isInputEl=function(a){
+var o=false;
+if(!a||!a.tagName){
+return o
+}
+var e=a.tagName.toLowerCase();
+var t=e=="input"?a.type.toLowerCase():null;
+if(e=="textarea"||(t&&(t=="text"||t=="password"))){
+o=true
+}
+return o
+};
+DwtControl.ON_UNLOAD=function(){
+var t=DwtControl.ALL_BY_ID,e;
+for(e in t){
+t[e]._elRef=null
+}
+DwtControl.ALL_BY_ID=null
+};
+if(AjxEnv.isIE){
+window.attachEvent("onunload",DwtControl.ON_UNLOAD)
+}else{
+window.addEventListener("unload",DwtControl.ON_UNLOAD,false)
+}}
+if(AjxPackage.define("ajax.dwt.widgets.DwtComposite")){
+DwtComposite=function(e){
+if(arguments.length==0){
+return
+}
+e=Dwt.getParams(arguments,DwtComposite.PARAMS);
+e.className=e.className||"DwtComposite";
+DwtControl.call(this,e);
+this._children=new AjxVector()
+};
+DwtComposite.PARAMS=DwtControl.PARAMS.concat();
+DwtComposite.prototype=new DwtControl;
+DwtComposite.prototype.constructor=DwtComposite;
+DwtComposite._pendingElements=new Object();
+DwtComposite.prototype.toString=function(){
+return"DwtComposite"
+};
+DwtComposite.prototype.dispose=function(){
+if(this._disposed){
+return
+}
+var e=this._children.getArray();
+while(e.length>0){
+e[0].dispose()
+}
+DwtControl.prototype.dispose.call(this)
+};
+DwtComposite.prototype.getChildren=function(){
+return this._children.getArray().slice(0)
+};
+DwtComposite.prototype.getNumChildren=function(){
+return this._children.size()
+};
+DwtComposite.prototype.removeChildren=function(){
+var e=this._children.getArray();
+while(e.length>0){
+e[0].dispose()
+}};
+DwtComposite.prototype.clear=function(){
+this.removeChildren();
+this.getHtmlElement().innerHTML=""
+};
+DwtComposite.prototype.addChild=function(a,e){
+this._children.add(a,e);
+var t=a.getHtmlElement();
+t.setAttribute("parentId",this._htmlElId);
+if(this instanceof DwtShell&&this.isVirtual()){
+document.body.appendChild(t)
+}else{
+a.reparentHtmlElement(a.__parentElement||this.getHtmlElement(),e);
+a.__parentElement=null
+}};
+DwtComposite.prototype.removeChild=function(a){
+if(a.isInitialized()){
+this._children.remove(a);
+var t=a.getHtmlElement();
+if(t){
+t.removeAttribute("parentId");
+if(t.parentNode){
+var e=t.parentNode.removeChild(t)
+}}}};
+DwtComposite.prototype._setAllowSelection=function(){
+if(!this._allowSelection){
+this._allowSelection=true;
+this.addListener(DwtEvent.ONMOUSEDOWN,new AjxListener(this,this._mouseDownListener));
+this.addListener(DwtEvent.ONCONTEXTMENU,new AjxListener(this,this._contextMenuListener))
+}};
+DwtComposite.prototype.preventSelection=function(e){
+return this._allowSelection?false:DwtControl.prototype.preventSelection.call(this,e)
+};
+DwtComposite.prototype.preventContextMenu=function(a){
+if(!this._allowSelection){
+return DwtControl.prototype.preventContextMenu.apply(this,arguments)
+}
+var e=a?(a.id.indexOf("OBJ_")==0):false;
+var t=false;
+if(document.selection){
+t=document.selection.type=="Text"
+}else{
+if(getSelection()){
+t=getSelection().toString().length>0
+}}
+return(t&&!e)?false:true
+};
+DwtComposite.prototype._focusByMouseUpEvent=function(){
+if(!this._allowSelection){
+DwtControl.prototype._focusByMouseUpEvent.apply(this,arguments)
+}};
+DwtComposite.prototype._mouseDownListener=function(e){
+if(e.button==DwtMouseEvent.LEFT){
+e._stopPropagation=true;
+e._returnValue=true
+}};
+DwtComposite.prototype._contextMenuListener=function(e){
+e._stopPropagation=false;
+e._returnValue=true
+}
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtShell")){
+DwtShell=function(n){
+if(window._dwtShellId){
+throw new DwtException("DwtShell already exists for window",DwtException.INVALID_OP,"DwtShell")
+}
+var a=n.className||"DwtShell";
+DwtComposite.call(this,{
+className:a}
+);
+this.__ctrlInited=true;
+document.body.style.margin=0;
+if(!n.docBodyScrollable){
+if(AjxEnv.isIE){
+document.body.onscroll=DwtShell.__onBodyScroll
+}
+document.body.style.overflow="hidden"
+}
+document.body.onselect=DwtShell._preventDefaultSelectPrt;
+document.body.onselectstart=DwtShell._preventDefaultSelectPrt;
+document.body.oncontextmenu=DwtShell._preventDefaultPrt;
+window.onresize=DwtShell._resizeHdlr;
+var o=document.createElement("div");
+this._htmlElId=window._dwtShellId=o.id=n.id||Dwt.getNextId();
+DwtControl.ALL_BY_ID[this._htmlElId]=this;
+o.className=a;
+o.style.width=o.style.height="100%";
+if(o.style.overflow){
+o.style.overflow=null
+}
+try{
+if(n.userShell){
+document.body.removeChild(n.userShell)
+}}
+catch(t){}
+document.body.appendChild(o);
+if(n.userShell){
+var e=new DwtControl({
+parent:this,posStyle:Dwt.ABSOLUTE_STYLE}
+);
+e.getHtmlElement().appendChild(n.userShell);
+e.setSize("100%","100%");
+e.zShow(true)
+}
+this.shell=this;
+this._createBusyOverlay(o);
+this._veilOverlay=document.createElement("div");
+this._veilOverlay.className=(!AjxEnv.isLinux)?"VeilOverlay":"VeilOverlay-linux";
+this._veilOverlay.style.position="absolute";
+this._veilOverlay.style.cursor=AjxEnv.isIE6up?"not-allowed":"wait";
+Dwt.setBounds(this._veilOverlay,0,0,"100%","100%");
+Dwt.setZIndex(this._veilOverlay,Dwt.Z_HIDDEN);
+this._veilOverlay.veilZ=new Array();
+this._veilOverlay.veilZ.push(Dwt.Z_HIDDEN);
+this._veilOverlay.dialogZ=new Array();
+this._veilOverlay.activeDialogs=new Array();
+this._veilOverlay.innerHTML="<table cellspacing=0 cellpadding=0 style='width:100%; height:100%'><tr><td>&nbsp;</td></tr></table>";
+o.appendChild(this._veilOverlay);
+if(n.useCurtain){
+this._curtainOverlay=document.createElement("div");
+this._curtainOverlay.className="CurtainOverlay";
+this._curtainOverlay.style.position="absolute";
+Dwt.setBounds(this._curtainOverlay,0,0,"100%","100%");
+Dwt.setZIndex(this._curtainOverlay,Dwt.Z_CURTAIN);
+this._curtainOverlay.innerHTML="<table cellspacing=0 cellpadding=0 style='width:100%; height:100%'><tr><td>&nbsp;</td></tr></table>";
+o.appendChild(this._curtainOverlay)
+}
+this._uiEvent=new DwtUiEvent(true);
+this._currWinSize=Dwt.getWindowSize();
+this._toolTip=new DwtToolTip(this);
+this._hoverMgr=new DwtHoverMgr();
+this._keyboardMgr=new DwtKeyboardMgr(this)
+};
+DwtShell.prototype=new DwtComposite;
+DwtShell.prototype.constructor=DwtShell;
+DwtShell.CANCEL_BUTTON=-1;
+DwtShell.controlEvent=new DwtControlEvent();
+DwtShell.focusEvent=new DwtFocusEvent();
+DwtShell.keyEvent=new DwtKeyEvent();
+DwtShell.mouseEvent=new DwtMouseEvent();
+DwtShell.selectionEvent=new DwtSelectionEvent(true);
+DwtShell.treeEvent=new DwtTreeEvent();
+DwtShell.prototype.toString=function(){
+return"DwtShell"
+};
+DwtShell.getShell=function(e){
+return DwtControl.fromElementId(e._dwtShellId)
+};
+DwtShell.prototype.getKeyboardMgr=function(){
+return this._keyboardMgr
+};
+DwtShell.prototype.setBusy=function(o,n,t,a,e){
+if(o){
+this._setBusyCount++
+}else{
+if(this._setBusyCount>0){
+this._setBusyCount--
+}}
+if(!this._setBusy&&(this._setBusyCount>0)){
+Dwt.setCursor(this._busyOverlay,"wait");
+Dwt.setVisible(this._busyOverlay,true);
+this._setBusy=this._blockInput=true
+}else{
+if(this._setBusy&&(this._setBusyCount<=0)){
+Dwt.setCursor(this._busyOverlay,"default");
+Dwt.setVisible(this._busyOverlay,false);
+this._setBusy=this._blockInput=false
+}}
+if(o&&t){
+if(a&&a>0){
+this._busyActionId[n]=AjxTimedAction.scheduleAction(this._busyTimedAction,a)
+}else{
+this._showBusyDialogAction(n)
+}
+this._cancelBusyCallback=e;
+if(this._busyDialog){
+this._busyDialog.setButtonEnabled(DwtShell.CANCEL_BUTTON,(e!=null))
+}}else{
+if(this._busyActionId[n]&&(this._busyActionId[n]!=-1)){
+AjxTimedAction.cancelAction(this._busyActionId[n]);
+this._busyActionId[n]=-1
+}
+if(this._busyDialog&&this._busyDialog.isPoppedUp){
+this._busyDialog.popdown()
+}}};
+DwtShell.prototype.getBusy=function(){
+return this._setBusy
+};
+DwtShell.prototype.setBusyDialogText=function(e){
+this._busyDialogText=e;
+if(this._busyDialogTxt){
+this._busyDialogTxt.innerHTML=(e)?e:""
+}};
+DwtShell.prototype.setBusyDialogTitle=function(e){
+this._busyDialogTitle=e;
+if(this._busyDialog){
+this._busyDialog.setTitle((e)?e:AjxMsg.workInProgress)
+}};
+DwtShell.prototype.getHoverMgr=function(){
+return this._hoverMgr
+};
+DwtShell.prototype.getToolTip=function(){
+return this._toolTip
+};
+DwtShell.prototype.getH=function(e){
+return(!this._virtual)?Dwt.getSize(this.getHtmlElement(),e).y:Dwt.getSize(document.body,e).y
+};
+DwtShell.prototype.getW=function(e){
+return(!this._virtual)?Dwt.getSize(this.getHtmlElement(),e).x:Dwt.getSize(document.body,e).x
+};
+DwtShell.prototype.getSize=function(e){
+return(!this._virtual)?Dwt.getSize(this.getHtmlElement(),e):Dwt.getSize(document.body,e)
+};
+DwtShell.prototype.getLocation=function(){
+return(!this._virtual)?Dwt.getLocation(this.getHtmlElement()):Dwt.getLocation(document.body)
+};
+DwtShell.prototype.getX=function(){
+return(!this._virtual)?Dwt.getLocation(this.getHtmlElement()).x:Dwt.getLocation(document.body).x
+};
+DwtShell.prototype.getY=function(){
+return(!this._virtual)?Dwt.getLocation(this.getHtmlElement()).y:Dwt.getLocation(document.body).y
+};
+DwtShell.prototype.getBounds=function(e){
+return(!this._virtual)?Dwt.getBounds(this.getHtmlElement(),e):Dwt.getBounds(document.body,e)
+};
+DwtShell.prototype.setVirtual=function(){
+this._virtual=true;
+this.setVisible(false)
+};
+DwtShell.prototype.addFocusListener=function(e){
+if(!this._hasFocusHandler){
+var t=document;
+if(typeof t.onfocusin!="undefined"){
+t.attachEvent("onfocusin",DwtShell.__focusHdlr)
+}else{
+window.addEventListener("focus",DwtShell.__focusHdlr,false)
+}
+this._hasFocusHandler=true
+}
+this.addListener(DwtEvent.ONFOCUS,e)
+};
+DwtShell.prototype.addBlurListener=function(e){
+if(!this._hasBlurHandler){
+var t=document;
+if(typeof t.onfocusout!="undefined"){
+t.attachEvent("onfocusout",DwtShell.__blurHdlr)
+}else{
+window.addEventListener("blur",DwtShell.__blurHdlr,false)
+}
+this._hasBlurHandler=true
+}
+this.addListener(DwtEvent.ONBLUR,e)
+};
+DwtShell.prototype.isVirtual=function(){
+return this._virtual
+};
+DwtShell.prototype._showBusyDialogAction=function(t){
+var e=this._getBusyDialog();
+e.popup();
+this._busyActionId[t]=-1
+};
+DwtShell.prototype._createBusyOverlay=function(e){
+this._busyOverlay=document.createElement("div");
+this._busyOverlay.className=(!AjxEnv.isLinux)?"BusyOverlay":"BusyOverlay-linux";
+this._busyOverlay.style.position="absolute";
+Dwt.setBounds(this._busyOverlay,0,0,"100%","100%");
+Dwt.setZIndex(this._busyOverlay,Dwt.Z_VEIL);
+this._busyOverlay.innerHTML="<table cellspacing=0 cellpadding=0 style='width:100%; height:100%'><tr><td>&nbsp;</td></tr></table>";
+e.appendChild(this._busyOverlay);
+Dwt.setVisible(this._busyOverlay,false);
+this._busyTimedAction=new AjxTimedAction(this,this._showBusyDialogAction);
+this._busyActionId={};
+this._setBusyCount=0;
+this._setBusy=false
+};
+DwtShell.prototype._getBusyDialog=function(a){
+if(!this._busyDialog){
+var o=new DwtDialog_ButtonDescriptor(DwtShell.CANCEL_BUTTON,AjxMsg.cancelRequest,DwtDialog.ALIGN_CENTER);
+this._busyDialog=new DwtDialog({
+parent:this,className:"DwtShellBusyDialog",title:AjxMsg.workInProgress,standardButtons:DwtDialog.NO_BUTTONS,extraButtons:[o],zIndex:Dwt.BUSY+10}
+);
+this._busyDialog.registerCallback(DwtShell.CANCEL_BUTTON,this._busyCancelButtonListener,this);
+var t=Dwt.getNextId();
+var e=["<table class='DialogContent'><tr>","<td><div class='WaitIcon'></div></td><td class='MsgText' id='",t,"'>&nbsp;</td>","</tr></table>"].join("");
+this._busyDialog.setContent(e);
+this._busyDialogTxt=document.getElementById(t);
+if(this._busyDialogText){
+this._busyDialogTxt.innerHTML=this._busyDialogText
+}
+if(this._busyDialogTitle){
+this._busyDialog.setTitle(this._busyDialogTitle)
+}
+this._busyDialog.setButtonEnabled(DwtShell.CANCEL_BUTTON,(this._cancelBusyCallback!=null))
+}
+return this._busyDialog
+};
+DwtShell.prototype._busyCancelButtonListener=function(e){
+this._cancelBusyCallback.run();
+if(this._busyDialog){
+this._busyDialog.popdown()
+}};
+DwtShell._preventDefaultSelectPrt=function(t){
+var e=DwtControl.fromElementId(window._dwtShellId)._uiEvent;
+e.setFromDhtmlEvent(t,true);
+if(e.dwtObj&&e.dwtObj instanceof DwtControl&&!e.dwtObj.preventSelection(e.target)){
+e._stopPropagation=false;
+e._returnValue=true
+}else{
+e._stopPropagation=true;
+e._returnValue=false
+}
+e.setToDhtmlEvent(t);
+return !e._stopPropagation
+};
+DwtShell._preventDefaultPrt=function(t){
+t=DwtUiEvent.getEvent(t);
+var a=t.target?t.target:t.srcElement;
+var e=DwtControl.fromElementId(window._dwtShellId)._uiEvent;
+e.setFromDhtmlEvent(t,true);
+e._stopPropagation=true;
+e._returnValue=false;
+if(e.dwtObj&&e.dwtObj instanceof DwtControl&&!e.dwtObj.preventContextMenu(e.target)){
+e._stopPropagation=false;
+e._returnValue=true
+}else{
+if(a!=null&&typeof(a)=="object"){
+if((a.tagName=="A"||a.tagName=="a")&&a.href){
+e._stopPropagation=false;
+e._returnValue=true
+}}}
+e.setToDhtmlEvent(t);
+return e._returnValue
+};
+DwtShell._resizeHdlr=function(a){
+var t=DwtControl.fromElementId(window._dwtShellId);
+if(t.isListenerRegistered(DwtEvent.CONTROL)){
+var e=DwtShell.controlEvent;
+e.reset();
+e.oldWidth=t._currWinSize.x;
+e.oldHeight=t._currWinSize.y;
+t._currWinSize=Dwt.getWindowSize();
+e.newWidth=t._currWinSize.x;
+e.newHeight=t._currWinSize.y;
+t.notifyListeners(DwtEvent.CONTROL,e)
+}else{
+t._currWinSize=Dwt.getWindowSize()
+}};
+DwtShell.__onBodyScroll=function(){
+document.body.scrollTop=0;
+document.body.scrollLeft=0
+};
+DwtShell.__focusHdlr=function(){
+var t=DwtShell.focusEvent;
+var e=DwtShell.getShell(window);
+t.dwtObj=e;
+t.state=DwtFocusEvent.FOCUS;
+e.notifyListeners(DwtEvent.ONFOCUS,t)
+};
+DwtShell.__blurHdlr=function(){
+var t=DwtShell.focusEvent;
+var e=DwtShell.getShell(window);
+t.dwtObj=e;
+t.state=DwtFocusEvent.BLUR;
+e.notifyListeners(DwtEvent.ONBLUR,t)
+}
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtLabel")){
+DwtLabel=function(e){
+if(arguments.length==0){
+return
+}
+e=Dwt.getParams(arguments,DwtLabel.PARAMS);
+e.className=e.className||"DwtLabel";
+DwtControl.call(this,e);
+this._style=e.style||(DwtLabel.IMAGE_LEFT|DwtLabel.ALIGN_CENTER);
+this._textBackground=null;
+this._textForeground=null;
+this._createHtml()
+};
+DwtLabel.PARAMS=["parent","style","className","posStyle","id","index"];
+DwtLabel.prototype=new DwtControl;
+DwtLabel.prototype.constructor=DwtLabel;
+DwtLabel.prototype.toString=function(){
+return"DwtLabel"
+};
+DwtLabel.IMAGE_LEFT=1;
+DwtLabel.IMAGE_RIGHT=2;
+DwtLabel.ALIGN_LEFT=4;
+DwtLabel.ALIGN_RIGHT=8;
+DwtLabel.ALIGN_CENTER=16;
+DwtLabel._LAST_STYLE=16;
+DwtLabel.prototype.TEMPLATE="dwt.Widgets#ZLabel";
+DwtLabel.prototype.dispose=function(){
+delete this._dropDownEl;
+delete this._iconEl;
+delete this._textEl;
+DwtControl.prototype.dispose.call(this)
+};
+DwtLabel.prototype.setEnabled=function(e){
+if(e!=this._enabled){
+DwtControl.prototype.setEnabled.call(this,e);
+this.__setImage(this.__imageInfo)
+}};
+DwtLabel.prototype.getImage=function(){
+return this.__imageInfo
+};
+DwtLabel.prototype.setImage=function(e){
+this.__imageInfo=e;
+this.__setImage(e)
+};
+DwtLabel.prototype.setDisabledImage=function(e){};
+DwtLabel.prototype.getText=function(){
+return(this.__text!=null)?this.__text:null
+};
+DwtLabel.prototype.setText=function(e){
+if(!this._textEl){
+return
+}
+if(e==null||e==""){
+this.__text=null;
+this._textEl.innerHTML=""
+}else{
+this.__text=e;
+this._textEl.innerHTML=e
+}};
+DwtLabel.prototype.setTextBackground=function(e){
+this._textBackground=e;
+if(this._textEl){
+this._textEl.style.backgroundColor=e
+}};
+DwtLabel.prototype.setTextForeground=function(e){
+this._textForeground=e;
+if(this._textEl){
+this._textEl.style.color=e
+}};
+DwtLabel.prototype.setAlign=function(e){
+this._style=e;
+this.__setImage(this.__imageInfo)
+};
+DwtLabel.prototype.isStyle=function(e){
+return this._style&e
+};
+DwtLabel.prototype._createHtml=function(e){
+var t={
+id:this._htmlElId};
+this._createHtmlFromTemplate(e||this.TEMPLATE,t)
+};
+DwtLabel.prototype._createHtmlFromTemplate=function(e,t){
+DwtControl.prototype._createHtmlFromTemplate.call(this,e,t);
+this._textEl=document.getElementById(t.id+"_title")
+};
+DwtLabel.prototype._getIconEl=function(){
+var e=(this._style&DwtLabel.IMAGE_RIGHT?"right":"left");
+return this._iconEl||(this._iconEl=document.getElementById(this._htmlElId+"_"+e+"_icon"))
+};
+DwtLabel.prototype.__setImage=function(t){
+var e=this._getIconEl();
+if(e){
+if(t){
+AjxImg.setImage(e,t,null,!this._enabled);
+var a=(this._style&DwtLabel.IMAGE_RIGHT?"ZHasRightIcon":"ZHasLeftIcon");
+Dwt.addClass(this.getHtmlElement(),a)
+}else{
+e.innerHTML=""
+}}}
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtListView")){
+DwtListView=function(t){
+if(arguments.length==0){
+return
+}
+t=Dwt.getParams(arguments,DwtListView.PARAMS);
+t.className=t.className||"DwtListView";
+DwtComposite.call(this,t);
+this._view=t.view||Dwt.getNextId();
+if(t.headerList){
+var e=this.getHtmlElement();
+this._listColDiv=document.createElement("div");
+this._listColDiv.id=DwtId.getListViewId(this._view,DwtId.LIST_VIEW_HEADERS);
+this._listColDiv.className="DwtListView-ColHeader";
+e.appendChild(this._listColDiv);
+this._listDiv=document.createElement("div");
+this._listDiv.id=DwtId.getListViewId(this._view,DwtId.LIST_VIEW_ROWS);
+this._listDiv.className="DwtListView-Rows";
+e.appendChild(this._listDiv);
+this._bSortAsc=false;
+this._currentColId=null;
+this.sortingEnabled=true
+}else{
+this.setScrollStyle(DwtControl.SCROLL)
+}
+this._setMouseEventHdlrs();
+this._listenerMouseOver=new AjxListener(this,this._mouseOverListener);
+this._listenerMouseOut=new AjxListener(this,this._mouseOutListener);
+this._listenerMouseDown=new AjxListener(this,this._mouseDownListener);
+this._listenerMouseUp=new AjxListener(this,this._mouseUpListener);
+this._listenerMouseMove=new AjxListener(this,this._mouseMoveListener);
+this._listenerDoubleClick=new AjxListener(this,this._doubleClickListener);
+this.addListener(DwtEvent.ONMOUSEOVER,this._listenerMouseOver);
+this.addListener(DwtEvent.ONMOUSEOUT,this._listenerMouseOut);
+this.addListener(DwtEvent.ONMOUSEDOWN,this._listenerMouseDown);
+this.addListener(DwtEvent.ONMOUSEUP,this._listenerMouseUp);
+this.addListener(DwtEvent.ONMOUSEMOVE,this._listenerMouseMove);
+this.addListener(DwtEvent.ONDBLCLICK,this._listenerDoubleClick);
+this._evtMgr=new AjxEventMgr();
+this._selectedItems=new AjxVector();
+this._selAnchor=null;
+this._kbAnchor=null;
+this._selEv=new DwtSelectionEvent(true);
+this._actionEv=new DwtListViewActionEvent(true);
+this._stateChangeEv=new DwtEvent(true);
+this._headerList=t.headerList;
+this._noMaximize=t.noMaximize;
+this._parentEl=this._headerList?this._listDiv:this.getHtmlElement();
+this._list=null;
+this.offset=0;
+this.headerColCreated=false;
+this.multiSelectEnabled=true;
+this.firstSelIndex=-1;
+this._data={};
+this._rowClass=[this._className,DwtListView.ROW_CLASS].join("");
+var a=this._normalClass=DwtListView.ROW_CLASS;
+this._selectedClass=[a,DwtCssStyle.SELECTED].join("-");
+this._disabledSelectedClass=[this._selectedClass,DwtCssStyle.DISABLED].join("-");
+this._kbFocusClass=[a,DwtCssStyle.FOCUSED].join("-");
+this._dndClass=[a,DwtCssStyle.DRAG_PROXY].join("-");
+this._rightClickClass=[this._selectedClass,DwtCssStyle.ACTIONED].join("-");
+this._styleRe=this._getStyleRegex()
+};
+DwtListView.prototype=new DwtComposite;
+DwtListView.prototype.constructor=DwtListView;
+DwtListView.PARAMS=["parent","className","posStyle","headerList","noMaximize"];
+DwtListView.ITEM_SELECTED=1;
+DwtListView.ITEM_DESELECTED=2;
+DwtListView.ITEM_DBL_CLICKED=3;
+DwtListView._LAST_REASON=3;
+DwtListView._TOOLTIP_DELAY=250;
+DwtListView.HEADERITEM_HEIGHT=24;
+DwtListView.TYPE_HEADER_ITEM="1";
+DwtListView.TYPE_LIST_ITEM="2";
+DwtListView.TYPE_HEADER_SASH="3";
+DwtListView.DEFAULT_LIMIT=25;
+DwtListView.MAX_REPLENISH_THRESHOLD=10;
+DwtListView.MIN_COLUMN_WIDTH=20;
+DwtListView.COL_MOVE_THRESHOLD=3;
+DwtListView.ROW_CLASS="Row";
+DwtListView.ROW_CLASS_ODD="RowEven";
+DwtListView.ROW_CLASS_EVEN="RowOdd";
+DwtListView._STYLE_CLASS="_sc";
+DwtListView._SELECTED_STYLE_CLASS="_ssc";
+DwtListView._SELECTED_DIS_STYLE_CLASS="_sdsc";
+DwtListView._KBFOCUS_CLASS="_kfc";
+DwtListView.prototype.toString=function(){
+return"DwtListView"
+};
+DwtListView.prototype.dispose=function(){
+this._listColDiv=null;
+this._listDiv=null;
+this._parentEl=null;
+this._clickDiv=null;
+this._selectedItems=null;
+DwtComposite.prototype.dispose.call(this)
+};
+DwtListView.prototype.setEnabled=function(e){
+DwtComposite.prototype.setEnabled.call(this,e);
+this.removeListener(DwtEvent.ONMOUSEOVER,this._listenerMouseOver);
+this.removeListener(DwtEvent.ONMOUSEOUT,this._listenerMouseOut);
+this.removeListener(DwtEvent.ONMOUSEDOWN,this._listenerMouseDown);
+this.removeListener(DwtEvent.ONMOUSEUP,this._listenerMouseUp);
+this.removeListener(DwtEvent.ONMOUSEMOVE,this._listenerMouseMove);
+this.removeListener(DwtEvent.ONDBLCLICK,this._listenerDoubleClick);
+if(e){
+this.addListener(DwtEvent.ONMOUSEOVER,this._listenerMouseOver);
+this.addListener(DwtEvent.ONMOUSEOUT,this._listenerMouseOut);
+this.addListener(DwtEvent.ONMOUSEDOWN,this._listenerMouseDown);
+this.addListener(DwtEvent.ONMOUSEUP,this._listenerMouseUp);
+this.addListener(DwtEvent.ONMOUSEMOVE,this._listenerMouseMove);
+this.addListener(DwtEvent.ONDBLCLICK,this._listenerDoubleClick)
+}
+var a=this.getSelectedItems();
+if(a){
+var o=a.getArray();
+for(var t=0;
+t<o.length;
+t++){
+Dwt.delClass(o[t],this._styleRe,e?this._selectedClass:this._disabledSelectedClass)
+}}};
+DwtListView.prototype.createHeaderHtml=function(u){
+if(!this._headerList||this.headerColCreated){
+return
+}
+this._headerHash={};
+this._headerIdHash={};
+var m=0;
+var p=[];
+p[m++]="<table id='";
+p[m++]=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_TABLE,this._view);
+p[m++]="' cellpadding=0 cellspacing=0 border=0 height=100%";
+p[m++]=this._noMaximize?">":" width=100%>";
+p[m++]="<tr>";
+var o=this._headerList.length;
+for(var s=0;
+s<o;
+s++){
+var c=this._headerList[s];
+var d=c._field;
+c._index=s;
+var t=c._id=DwtId.getListViewHdrId(DwtId.WIDGET_HDR,this._view,d);
+this._headerHash[d]=c;
+this._headerIdHash[t]=c;
+if(c._variable){
+this._variableHeaderCol=c
+}
+if(c._visible){
+m=this._createHeader(p,m,c,s,o,t,u)
+}}
+p[m++]="</tr></table>";
+this._listColDiv.innerHTML=p.join("");
+var e=0,h;
+for(var n=0;
+n<this._headerList.length;
+n++){
+var c=this._headerList[n];
+var f=document.getElementById(c._id);
+if(!f){
+continue
+}
+if(c._sortable&&c._field==u){
+f.className="DwtListView-Column DwtListView-ColumnActive"
+}
+if(c._resizeable){
+var r=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_SASH,this._view,c._field);
+var a=document.getElementById(r);
+if(a){
+this.associateItemWithElement(c,a,DwtListView.TYPE_HEADER_SASH,r,{
+index:n}
+)
+}
+e++;
+h=c
+}
+this.associateItemWithElement(c,f,DwtListView.TYPE_HEADER_ITEM,c._id,{
+index:n}
+)
+}
+if(e==1){
+h._resizeable=false
+}
+this.headerColCreated=true
+};
+DwtListView.prototype._createHeader=function(m,u,h,n,o,t,d){
+var c=h._field;
+m[u++]="<td id='";
+m[u++]=t;
+m[u++]="' class='";
+m[u++]=(t==this._currentColId)?"DwtListView-Column DwtListView-ColumnActive'":"DwtListView-Column'";
+if(h._width){
+m[u++]=" width=";
+m[u++]=h._width;
+if(h._widthUnits){
+m[u++]=h._widthUnits
+}}
+m[u++]=">";
+m[u++]="<div";
+var s=null;
+if(h._width&&h._width!="auto"){
+if(AjxEnv.isIE){
+s=h._width
+}else{
+s=h._width+2
+}
+if(h._widthUnits){
+s+=h._widthUnits
+}}
+if(!!s){
+m[u++]=" style='overflow: hidden; width: ";
+m[u++]=s;
+m[u++]="'>"
+}else{
+m[u++]=">"
+}
+m[u++]="<table border=0 cellpadding=0 cellspacing=0 width=100%><tr>";
+if(h._iconInfo){
+var r=["id='",DwtId.getListViewHdrId(DwtId.WIDGET_HDR_ICON,this._view,c),"'"].join("");
+m[u++]="<td><center>";
+m[u++]=AjxImg.getImageHtml(h._iconInfo,null,r);
+m[u++]="</center></td>"
+}
+if(h._label){
+m[u++]="<td id='";
+m[u++]=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_LABEL,this._view,c);
+m[u++]="' class='DwtListHeaderItem-label'>";
+m[u++]=h._label;
+m[u++]="</td>"
+}
+if(h._sortable&&!h._noSortArrow){
+var e=this._bSortAsc?"ColumnUpArrow":"ColumnDownArrow";
+m[u++]="<td align=right style='padding-right:2px' width=100% id='";
+m[u++]=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_ARROW,this._view,c);
+m[u++]="'>";
+var a=(c==d);
+m[u++]=AjxImg.getImageHtml(e,a?null:"visibility:hidden");
+m[u++]="</td>";
+if(a){
+this._currentColId=t
+}}
+if(n<(o-1)){
+m[u++]="<td width=4>";
+m[u++]="<table align=right border=0 cellpadding=0 cellspacing=0 width=2 height=100%><tr>";
+m[u++]="<td class='DwtListView-Sash'><div style='width: 1px; height: ";
+m[u++]=(DwtListView.HEADERITEM_HEIGHT-2);
+m[u++]="px; background-color: #8A8A8A'></div></td><td id='";
+m[u++]=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_SASH,this._view,c);
+m[u++]="' class='DwtListView-Sash'><div style='width: 1px; height: ";
+m[u++]=(DwtListView.HEADERITEM_HEIGHT-2);
+m[u++]="px; background-color: #FFFFFF'></div></td></tr></table>";
+m[u++]="</td>"
+}
+m[u++]="</tr></table>";
+m[u++]="</div></td>";
+return u
+};
+DwtListView.prototype.getItemIndex=function(a){
+var o=this._list;
+if(o){
+var e=o.size();
+for(var t=0;
+t<e;
+++t){
+if(o.get(t).id==a.id){
+return t
+}}}
+return null
+};
+DwtListView.prototype.setSize=function(t,e){
+DwtComposite.prototype.setSize.call(this,t,e);
+this._sizeChildren(e)
+};
+DwtListView.prototype.size=function(){
+return this._list?this._list.size():0
+};
+DwtListView.prototype.set=function(a,t,e){
+if(this._selectedItems){
+this._selectedItems.removeAll()
+}
+this._rightSelItem=null;
+this.sortingEnabled=true;
+this._resetList();
+this._list=a;
+this.setUI(t,e)
+};
+DwtListView.prototype.setUI=function(t,e){
+this.removeAll();
+this.createHeaderHtml(t);
+this._renderList(this._list,e)
+};
+DwtListView.prototype._renderList=function(r,s,a){
+if(r instanceof AjxVector&&r.size()){
+var t=new Date();
+var d=r.size();
+var h=[];
+for(var n=0;
+n<d;
+n++){
+var c=r.get(n);
+var e=this._createItemHtml(c,{
+now:t}
+,!a,n);
+if(e){
+if(e instanceof Array){
+for(var o=0;
+o<e.length;
+o++){
+this._addRow(e[o])
+}}else{
+if(e.tagName||a){
+this._addRow(e)
+}else{
+h.push(e)
+}}}}
+if(h.length){
+this._parentEl.innerHTML=h.join("")
+}}else{
+if(!s){
+this._setNoResultsHtml()
+}}};
+DwtListView.prototype.addItems=function(e){
+if(AjxUtil.isArray(e)){
+if(!this._list){
+this._list=new AjxVector()
+}
+if(this._list.size()==0){
+this._resetList()
+}
+this._renderList(AjxVector.fromArray(e),null,true);
+this._list.addList(e)
+}};
+DwtListView.prototype.addItem=function(n,t,a,o){
+if(!this._list){
+this._list=new AjxVector()
+}
+if(this._list.size()==0){
+this._resetList()
+}
+this._list.add(n,(o!=null)?o:t);
+var s=this._createItemHtml(n);
+if(s){
+if(s instanceof Array){
+for(var e=0;
+e<s.length;
+e++){
+this._addRow(s[e])
+}}else{
+this._addRow(s,t)
+}}
+if(!a&&this._evtMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
+this._evtMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv)
+}};
+DwtListView.prototype.removeItem=function(o,t){
+var e=this._getElFromItem(o);
+if(!e){
+return
+}
+var a=e.nextSibling;
+if(a){
+var n=Boolean(e.className&&(e.className.indexOf(DwtListView.ROW_CLASS_ODD)!=-1));
+while(a){
+n=!n;
+var s=n?DwtListView.ROW_CLASS_ODD:DwtListView.ROW_CLASS_EVEN;
+var r=n?DwtListView.ROW_CLASS_EVEN:DwtListView.ROW_CLASS_ODD;
+Dwt.delClass(a,s,r);
+a=a.nextSibling
+}}
+this._selectedItems.remove(e);
+if(this._rightSelItem==e){
+this._rightSelItem=null
+}
+if(this._kbAnchor==e){
+this._kbAnchor=null
+}
+this._parentEl.removeChild(e);
+if(this._list){
+this._list.remove(o)
+}
+var h=e.id;
+if(this._data[h]){
+this._data[h]=null;
+delete this._data[h]
+}
+if(!t&&this._evtMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
+this._evtMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv)
+}};
+DwtListView.prototype.redrawItem=function(o){
+var n=this._getElFromItem(o);
+if(n){
+var s=this._createItemHtml(o);
+n.parentNode.replaceChild(s,n);
+var a=this.getSelectedItems().getArray();
+for(var t=0;
+t<a.length;
+t++){
+var e=a[t];
+if(e===o){
+this.setSelectedItems([].concat(a));
+break
+}}}};
+DwtListView.prototype.addSelectionListener=function(e){
+this._evtMgr.addListener(DwtEvent.SELECTION,e)
+};
+DwtListView.prototype.removeSelectionListener=function(e){
+this._evtMgr.removeListener(DwtEvent.SELECTION,e)
+};
+DwtListView.prototype.addActionListener=function(e){
+this._evtMgr.addListener(DwtEvent.ACTION,e)
+};
+DwtListView.prototype.removeActionListener=function(e){
+this._evtMgr.removeListener(DwtEvent.ACTION,e)
+};
+DwtListView.prototype.addStateChangeListener=function(e){
+this._evtMgr.addListener(DwtEvent.STATE_CHANGE,e)
+};
+DwtListView.prototype.removeStateChangeListener=function(e){
+this._evtMgr.removeListener(DwtEvent.STATE_CHANGE,e)
+};
+DwtListView.prototype.removeAll=function(e){
+if(this._parentEl){
+this._parentEl.innerHTML=""
+}
+if(this._selectedItems){
+this._selectedItems.removeAll()
+}
+this._rightSelItem=this._selAnchor=this._kbAnchor=null;
+if(!e&&this._evtMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
+this._evtMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv)
+}};
+DwtListView.prototype.selectAll=function(){
+if(this._list&&this._list.size()){
+this.setSelectedItems(this._list.getArray())
+}};
+DwtListView.prototype.deselectAll=function(){
+var e=this._selectedItems.getArray();
+var o=this._selectedItems.size();
+for(var t=0;
+t<o;
+t++){
+Dwt.delClass(e[t],this._styleRe)
+}
+this._selectedItems.removeAll();
+this._rightSelItem=this._selAnchor=null;
+if(this._kbAnchor!=null&&this.hasFocus()){
+Dwt.addClass(this._kbAnchor,this._kbFocusClass)
+}};
+DwtListView.prototype.getDnDSelection=function(){
+if(this._dndSelection instanceof AjxVector){
+return this.getSelection()
+}else{
+return this.getItemFromElement(this._dndSelection)
+}};
+DwtListView.prototype.getSelection=function(){
+var t=[];
+if(this._rightSelItem){
+t.push(this.getItemFromElement(this._rightSelItem))
+}else{
+if(this._selectedItems){
+var e=this._selectedItems.getArray();
+var n=this._selectedItems.size();
+for(var o=0;
+o<n;
+o++){
+t[o]=this.getItemFromElement(e[o])
+}}}
+return t
+};
+DwtListView.prototype.getSelectedItems=function(){
+return this._selectedItems
+};
+DwtListView.prototype.setSelection=function(a,e){
+if(!a){
+return
+}
+var t=this._getElFromItem(a);
+if(t){
+if((this._selectedItems.size()==1)&&(this._selectedItems.get(0)==t)){
+return
+}
+this.deselectAll();
+this._unmarkKbAnchorElement(true);
+this._selectedItems.add(t);
+this._selAnchor=this._kbAnchor=t;
+Dwt.delClass(t,this._styleRe,this.getEnabled()?this._selectedClass:this._disabledSelectedClass);
+if(this.hasFocus()){
+Dwt.addClass(t,this._kbFocusClass)
+}
+this.firstSelIndex=(this._list&&this._list.size()>0)?this._list.indexOf(a):-1;
+this._scrollList(t);
+if(!e&&this._evtMgr.isListenerRegistered(DwtEvent.SELECTION)){
+var o=new DwtSelectionEvent(true);
+o.button=DwtMouseEvent.LEFT;
+o.target=t;
+o.item=this.getItemFromElement(t);
+o.detail=DwtListView.ITEM_SELECTED;
+o.ersatz=true;
+this._evtMgr.notifyListeners(DwtEvent.SELECTION,o)
+}}};
+DwtListView.prototype.setMultiSelection=function(e,n,a){
+if(n){
+this._selectedItems.remove(e);
+Dwt.delClass(e,this._styleRe);
+this._selEv.detail=DwtListView.ITEM_DESELECTED
+}else{
+this._selectedItems.add(e,null,true);
+Dwt.delClass(e,this._styleRe,this._selectedClass);
+this._selEv.detail=DwtListView.ITEM_SELECTED
+}
+if(this._kbAnchor&&this._kbAnchor!=e){
+var o=this._kbAnchor;
+var t=this._selectedClass;
+if(o.className.indexOf(t)!=-1){
+Dwt.delClass(o,this._styleRe,t)
+}else{
+Dwt.delClass(o,this._styleRe)
+}}
+this._selAnchor=this._kbAnchor=e;
+Dwt.addClass(this._kbAnchor,this._kbFocusClass)
+};
+DwtListView.prototype.setSelectedItems=function(a){
+this.deselectAll();
+var o=a.length;
+for(var e=0;
+e<o;
+++e){
+var t=this._getElFromItem(a[e]);
+if(t){
+Dwt.delClass(t,this._styleRe,this.getEnabled()?this._selectedClass:this._disabledSelectedClass);
+if(this._kbAnchor==t&&this.hasFocus()){
+Dwt.addClass(t,this._kbFocusClass)
+}
+this._selectedItems.add(t)
+}}};
+DwtListView.prototype.getSelectionCount=function(){
+return this._rightSelItem?1:this._selectedItems.size()
+};
+DwtListView.prototype.handleActionPopdown=function(){
+this._clearRightSel()
+};
+DwtListView.prototype.associateItemWithElement=function(o,t,a,s,n){
+s=s||this._getItemId(o);
+if(t){
+t.id=s
+}
+a=a||DwtListView.TYPE_LIST_ITEM;
+this._data[s]={
+item:o,id:s,type:a};
+if(n){
+for(var e in n){
+this._data[s][e]=n[e]
+}}
+return s
+};
+DwtListView.prototype.getItemFromElement=function(e){
+return this._getItemData(e,"item")
+};
+DwtListView.prototype.findItem=function(e){
+if(!e){
+return
+}
+var t=this.findItemDiv(e);
+return this._getItemData(t,"item")
+};
+DwtListView.prototype.findItemDiv=function(e){
+if(!e){
+return
+}
+while(e&&(e.id!=this._htmlElId)){
+if(e.id&&this._data[e.id]){
+return e
+}
+e=e.parentNode
+}
+return null
+};
+DwtListView.prototype.getTargetItem=function(e){
+return this.findItem(DwtUiEvent.getTarget(e))
+};
+DwtListView.prototype.getTargetItemDiv=function(e){
+return this.findItemDiv(DwtUiEvent.getTarget(e))
+};
+DwtListView.prototype.dragSelect=function(t){
+if(this._dragHighlight){
+var e=document.getElementById(this._dragHighlight);
+if(!t||t.id!=e.id){
+this._updateDragSelection(e,false)
+}}
+if(!t){
+return
+}
+if(this._getItemData(t,"type")!=DwtListView.TYPE_LIST_ITEM){
+return
+}
+if(t.id!=this._dragHighlight){
+this._dragHighlight=t.id;
+this._updateDragSelection(t,true)
+}};
+DwtListView.prototype.dragDeselect=function(t){
+if(this._dragHighlight){
+var e=document.getElementById(this._dragHighlight);
+this._updateDragSelection(e,false);
+this._dragHighlight=null
+}};
+DwtListView.prototype.scrollToTop=function(){
+this._listDiv.scrollTop=0
+};
+DwtListView.prototype.setSortByAsc=function(a,t){
+if(!this._headerList){
+return
+}
+this._bSortAsc=t;
+var o=null;
+for(var e=0;
+e<this._headerList.length;
+e++){
+if(this._headerList[e]._sortable&&this._headerList[e]._field==a){
+o=this._headerList[e]._id;
+break
+}}
+if(o){
+this._setSortedColStyle(o)
+}};
+DwtListView.prototype.getNewOffset=function(t){
+var e=this.getLimit();
+var a=t?(this.offset+e):(this.offset-e);
+return(a<0)?0:a
+};
+DwtListView.prototype.getLimit=function(){
+return DwtListView.DEFAULT_LIMIT
+};
+DwtListView.prototype.getReplenishThreshold=function(){
+return DwtListView.MAX_REPLENISH_THRESHOLD
+};
+DwtListView.prototype.getList=function(){
+return this._list
+};
+DwtListView.prototype.replenish=function(o){
+this._list.addList(o);
+var t=o.size();
+for(var e=0;
+e<t;
+e++){
+var a=o.get(e);
+var n=this._createItemHtml(a);
+if(n){
+this._addRow(n)
+}}};
+DwtListView.prototype.getKeyMapName=function(){
+return"DwtListView"
+};
+DwtListView.prototype.handleKeyAction=function(n,h){
+switch(n){
+case DwtKeyMap.SELECT:this._emulateSingleClick({
+target:this._kbAnchor,button:DwtMouseEvent.LEFT,kbNavEvent:true}
+);
+break;
+case DwtKeyMap.SELECT_CURRENT:this._emulateSingleClick({
+target:this._kbAnchor,button:DwtMouseEvent.LEFT,ctrlKey:true,kbNavEvent:true}
+);
+break;
+case DwtKeyMap.SELECT_NEXT:this._selectItem(true,false,true);
+break;
+case DwtKeyMap.SELECT_PREV:this._selectItem(false,false,true);
+break;
+case DwtKeyMap.ADD_SELECT_NEXT:this._selectItem(true,true,true);
+break;
+case DwtKeyMap.ADD_SELECT_PREV:this._selectItem(false,true,true);
+break;
+case DwtKeyMap.PREV:this._setKbFocusElement(false);
+break;
+case DwtKeyMap.NEXT:this._setKbFocusElement(true);
+break;
+case DwtKeyMap.DBLCLICK:if(!this._kbAnchor){
+break
+}
+var t=false;
+var d=this.getSelectedItems().getArray();
+for(var o=0;
+o<d.length;
+o++){
+if(d[o]==this._kbAnchor){
+t=true;
+break
+}}
+if(t){
+this.emulateDblClick(this.getItemFromElement(this._kbAnchor),true)
+}else{
+this._emulateSingleClick({
+target:this._kbAnchor,button:DwtMouseEvent.LEFT,kbNavEvent:true}
+)
+}
+break;
+case DwtKeyMap.SELECT_ALL:this.selectAll();
+break;
+case DwtKeyMap.SELECT_FIRST:case DwtKeyMap.SELECT_LAST:var u=(n==DwtKeyMap.SELECT_FIRST)?this._getFirstItem():this._getLastItem();
+if(u){
+this.setSelection(u);
+this._scrollList(this._kbAnchor)
+}
+break;
+case DwtKeyMap.ACTION:if(this._evtMgr.isListenerRegistered(DwtEvent.ACTION)){
+var e=Dwt.toWindow(this._kbAnchor,0,0);
+var m=Dwt.getSize(this._kbAnchor);
+var c=e.x+m.x/4;
+var r=e.y+m.y/2;
+this._emulateSingleClick({
+target:this._kbAnchor,button:DwtMouseEvent.RIGHT,docX:c,docY:r,kbNavEvent:true}
+)
+}
+break;
+default:return false
+}
+return true
+};
+DwtListView.prototype.setMultiSelect=function(e){
+this.multiSelectEnabled=e
+};
+DwtListView.prototype.isMultiSelectEnabled=function(){
+return this.multiSelectEnabled
+};
+DwtListView.prototype.setListDivHeight=function(a){
+if(this._listDiv&&this._listColDiv){
+var t=Dwt.getSize(this._listColDiv).y;
+var e=a-t;
+Dwt.setSize(this._listDiv,Dwt.DEFAULT,e)
+}};
+DwtListView.prototype._getStyleRegex=function(){
+return new RegExp("\\b("+[this._disabledSelectedClass,this._selectedClass,this._kbFocusClass,this._dndClass,this._rightClickClass].join("|")+")\\b","g")
+};
+DwtListView.prototype._addRow=function(h,t){
+if(!h||!this._parentEl){
+return
+}
+var e=this._parentEl.childNodes.length;
+var o=Boolean((t!=null?t:e)%2);
+var n=o?DwtListView.ROW_CLASS_ODD:DwtListView.ROW_CLASS_EVEN;
+var r=o?DwtListView.ROW_CLASS_EVEN:DwtListView.ROW_CLASS_ODD;
+Dwt.delClass(h,n,r);
+if(t!=null&&e>0&&t!=e){
+var s=this._parentEl.childNodes;
+this._parentEl.insertBefore(h,s[t]);
+var a=h.nextSibling;
+while(a){
+o=!o;
+n=o?DwtListView.ROW_CLASS_ODD:DwtListView.ROW_CLASS_EVEN;
+r=o?DwtListView.ROW_CLASS_EVEN:DwtListView.ROW_CLASS_ODD;
+Dwt.delClass(a,n,r);
+a=a.nextSibling
+}}else{
+this._parentEl.appendChild(h)
+}};
+DwtListView.prototype._createItemHtml=function(d,a,s,n){
+a=a||{};
+this._addParams(d,a,c,h);
+var e;
+var c=[];
+var h=0;
+if(s){
+h=this._getDivHtml(d,a,c,h,n)
+}else{
+e=a.div||this._getDiv(d,a)
+}
+h=this._getTable(c,h,a);
+h=this._getRow(c,h,d,a);
+var t=a.headerList||this._headerList;
+if(t&&t.length){
+for(var o=0;
+o<t.length;
+o++){
+if(!t[o]._visible){
+continue
+}
+var r=t[o]._field;
+h=this._getCell(c,h,d,r,o,a)
+}}else{
+h=this._getCell(c,h,d,null,null,a)
+}
+c[h++]="</tr></table>";
+if(s){
+c[h++]="</div>";
+return c.join("")
+}
+e.innerHTML=c.join("");
+return e
+};
+DwtListView.prototype._addParams=function(e,t){};
+DwtListView.prototype._getDiv=function(e,t){
+var o=document.createElement("div");
+if(t.isDragProxy&&AjxEnv.isMozilla){
+o.style.overflow="visible"
+}
+o.className=this._getDivClass(this._normalClass,e,t);
+if(t.isDragProxy){
+Dwt.setPosition(o,Dwt.ABSOLUTE_STYLE)
+}
+var a=t.isDragProxy?this._getItemId(e)+"_dnd":null;
+this.associateItemWithElement(e,o,null,a);
+return o
+};
+DwtListView.prototype._getDivHtml=function(n,s,t,e,o){
+t[e++]="<div class='";
+t[e++]=this._getDivClass(this._normalClass,n,s);
+t[e++]=" ";
+t[e++]=(o%2)?DwtListView.ROW_CLASS_EVEN:DwtListView.ROW_CLASS_ODD;
+t[e++]="'";
+var a=[];
+if(s.isDragProxy&&AjxEnv.isMozilla){
+a.push("overflow:visible")
+}
+if(s.isDragProxy){
+a.push("position:absolute")
+}
+if(a.length){
+t[e++]=" style='";
+t[e++]=a.join(";");
+t[e++]="'"
+}
+var r=s.isDragProxy?this._getItemId(n)+"_dnd":null;
+t[e++]=" id='";
+t[e++]=this.associateItemWithElement(n,null,null,r);
+t[e++]="'>";
+return e
+};
+DwtListView.prototype._getDivClass=function(t,e,a){
+return a.isDragProxy?([t," ",t,"-",DwtCssStyle.DRAG_PROXY].join("")):t
+};
+DwtListView.prototype._getTable=function(t,e,a){
+t[e++]="<table cellpadding=0 cellspacing=0 border=0 width=";
+t[e++]=!a.isDragProxy?"100%>":(this.getSize().x+">");
+return e
+};
+DwtListView.prototype._getRow=function(t,e,o,s){
+var n=this._getRowId(o,s)||Dwt.getNextId();
+var a=this._getRowClass(o,s);
+t[e++]=n?["<tr id='",n,"'"].join(""):"<tr";
+t[e++]=a?([" class='",a,"'>"].join("")):">";
+return e
+};
+DwtListView.prototype._getRowClass=function(e,t){
+return null
+};
+DwtListView.prototype._getRowId=function(e,t){
+return null
+};
+DwtListView.prototype._getCell=function(p,f,y,u,n,o){
+var a=this._getCellId(y,u,o);
+var m=a?[" id=","'",a,"'"].join(""):"";
+var t=this._getCellWidth(n,o);
+var h=t?([" width=",t].join("")):(" width='100%'");
+var c=this._getCellClass(y,u,o);
+var s=c?[" class=",c].join(""):"";
+var g=this._getCellAlign(n,o);
+var d=g?[" align=",g].join(""):"";
+var e=(this._getCellAttrText(y,u,o))||"";
+var r=[m,h,s,d,e].join(" ");
+p[f++]="<td";
+p[f++]=r?(" "+r):"";
+p[f++]=">";
+f=this._getCellContents(p,f,y,u,n,o);
+p[f++]="</td>";
+return f
+};
+DwtListView.prototype._getCellWidth=function(o,a){
+if(o==null){
+return null
+}
+var e=a.headerList||this._headerList;
+var t=e[o]._width;
+if(t){
+if(AjxEnv.isIE){
+return(t+2)
+}
+if(AjxEnv.isSafari){
+return(t+5)
+}
+return t
+}
+return null
+};
+DwtListView.prototype._getCellAlign=function(a,t){
+if(a==null){
+return null
+}
+var e=t.headerList||this._headerList;
+return e[a]._align
+};
+DwtListView.prototype._getCellId=function(e,t,a){
+return null
+};
+DwtListView.prototype._getCellClass=function(e,t,a){
+return null
+};
+DwtListView.prototype._getCellAttrText=function(e,t,a){
+return null
+};
+DwtListView.prototype._getCellContents=function(t,e,a,o,s,n){
+t[e++]=a.toString?a.toString():a;
+return e
+};
+DwtListView.prototype._getFieldId=function(e,t){
+return DwtId.getListViewItemId(DwtId.WIDGET_ITEM_FIELD,this._view,e.id,t)
+};
+DwtListView.prototype._getElement=function(e,t){
+return document.getElementById(this._getFieldId(e,t))
+};
+DwtListView.prototype._getDragProxy=function(o){
+var n=this.getDnDSelection();
+if(!n){
+return null
+}
+var r;
+var e;
+var t;
+this._dndImg=null;
+if(!(n instanceof Array)||n.length==1){
+var c=(n instanceof Array)?n[0]:n;
+r=this._createItemHtml(c,{
+now:new Date(),isDragProxy:true}
+);
+this._setItemData(r,"origClassName",r.className);
+Dwt.setPosition(r,Dwt.ABSOLUTE_STYLE);
+t="position:absolute;top:18;left:-11;visibility:hidden"
+}else{
+r=document.createElement("div");
+r.className="DragProxy";
+Dwt.setPosition(r,Dwt.ABSOLUTE_STYLE);
+AjxImg.setImage(r,"DndMultiYes_48");
+this._dndImg=r;
+e=document.createElement("div");
+Dwt.setPosition(e,Dwt.ABSOLUTE_STYLE);
+var h=this.allSelected?ZmMsg.all:n.length;
+e.innerHTML="<table><tr><td class='DragProxyTextLabel'>"+h+"</td></tr></table>";
+r.appendChild(e);
+t="position:absolute;top:30;left:0;visibility:hidden";
+Dwt.setBounds(r,Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE,43+32-16,36+32-20)
+}
+var a=AjxImg.getImageHtml("RoundPlus",t,"id="+DwtId.DND_PLUS_ID);
+if(!this._noDndPlusImage){
+r.appendChild(Dwt.parseHtmlFragment(a))
+}
+this.shell.getHtmlElement().appendChild(r);
+if(e){
+var s=Dwt.getSize(e);
+Dwt.setLocation(e,16+(32-s.x)/2,19+(32-s.y)/2)
+}
+Dwt.setZIndex(r,Dwt.Z_DND);
+
+return r
+};
+DwtListView.prototype._setDragProxyState=function(t){
+if(this._dndImg){
+AjxImg.setImage(this._dndImg,t?"DndMultiYes_48":"DndMultiNo_48")
+}else{
+if(this._dndProxy){
+var a=t?DwtCssStyle.DROPPABLE:DwtCssStyle.NOT_DROPPABLE;
+var e=this._getItemData(this._dndProxy,"origClassName");
+this._dndProxy.className=[e,a].join(" ")
+}}};
+DwtListView.prototype._setNoResultsHtml=function(){
+var t=document.createElement("div");
+var e={
+message:this._getNoResultsMessage(),type:this.type};
+t.innerHTML=AjxTemplate.expand("dwt.Widgets#DwtListView-NoResults",e);
+this._addRow(t)
+};
+DwtListView.prototype._getNoResultsMessage=function(){
+return AjxMsg.noResults
+};
+DwtListView.prototype._clearRightSel=function(){
+if(this._rightSelItem){
+Dwt.delClass(this._rightSelItem,this._styleRe);
+this._rightSelItem=null
+}};
+DwtListView.prototype._getItemId=function(e){
+return DwtId.getListViewItemId(DwtId.WIDGET_ITEM,this._view,(e&&e.id)?e.id:Dwt.getNextId())
+};
+DwtListView.prototype._getElFromItem=function(e){
+return Dwt.byId(this._getItemId(e))
+};
+DwtListView.prototype._getRowIndex=function(t){
+var o=this._getItemId(t);
+var a=this._parentEl.childNodes;
+for(var e=0;
+e<a.length;
+e++){
+if(a[e].id==o){
+return e
+}}
+return null
+};
+DwtListView.prototype._getItemData=function(e,a,o){
+o=o||(e?e.id:null);
+var t=this._data[o];
+return t?t[a]:null
+};
+DwtListView.prototype._setItemData=function(e,o,a,n){
+n=n||(e?e.id:null);
+var t=this._data[n];
+if(t){
+t[o]=a
+}};
+DwtListView.prototype._isValidDragObject=function(e){
+return(this.getTargetItemDiv(e)!=null)
+};
+DwtListView.prototype._updateDragSelection=function(t,e){
+if(!e){
+t.className=this._getItemData(t,"origClassName")
+}else{
+this._setItemData(t,"origClassName",t.className);
+Dwt.delClass(t,this._styleRe,this._dndClass)
+}};
+DwtListView.prototype._mouseOverAction=function(t,o){
+var e=this._getItemData(o,"type");
+if(e==DwtListView.TYPE_HEADER_ITEM){
+var a=this.getItemFromElement(o);
+if(a&&this.sortingEnabled&&a._sortable&&!this._headerClone){
+o.className="DwtListView-Column DwtListView-ColumnHover"
+}}else{
+if(e==DwtListView.TYPE_HEADER_SASH){
+o.style.cursor=AjxEnv.isIE?"col-resize":"e-resize"
+}}
+return true
+};
+DwtListView.prototype._mouseOutAction=function(t,a){
+var e=this._getItemData(a,"type");
+if(e==DwtListView.TYPE_HEADER_ITEM&&!this._headerClone){
+a.className=(a.id!=this._currentColId)?"DwtListView-Column":"DwtListView-Column DwtListView-ColumnActive"
+}else{
+if(e==DwtListView.TYPE_HEADER_SASH){
+a.style.cursor="auto"
+}}
+return true
+};
+DwtListView.prototype._mouseOverListener=function(e){
+var t=this.getTargetItemDiv(e);
+if(!t){
+return
+}
+this._mouseOverAction(e,t)
+};
+DwtListView.prototype._mouseOutListener=function(e){
+var t=this.getTargetItemDiv(e);
+if(!t){
+return
+}
+this.setToolTipContent(null);
+this._mouseOutAction(e,t)
+};
+DwtListView.prototype._mouseMoveListener=function(t){
+if(!this._clickDiv){
+return
+}
+var e=this._getItemData(this._clickDiv,"type");
+if(e==DwtListView.TYPE_HEADER_ITEM){
+this._handleColHeaderMove(t)
+}else{
+if(e==DwtListView.TYPE_HEADER_SASH){
+this._handleColHeaderResize(t)
+}}};
+DwtListView.prototype._mouseUpAction=function(e,t){
+return true
+};
+DwtListView.prototype._mouseDownListener=function(e){
+var t=this.getTargetItemDiv(e);
+if(!t){
+this._dndSelection=null
+}else{
+this._clickDiv=t;
+if(this._getItemData(t,"type")!=DwtListView.TYPE_LIST_ITEM){
+this._dndSelection=null
+}else{
+this._dndSelection=(this._selectedItems.contains(t))?this._selectedItems:t
+}}
+this._mouseDownAction(e,t)
+};
+DwtListView.prototype._mouseDownAction=function(e,t){
+return true
+};
+DwtListView.prototype._mouseUpListener=function(a){
+var s=this.getTargetItemDiv(a);
+var n=this._handleColHeaderDrop(a);
+var e=this._handleColSashDrop(a);
+if(!s||s!=this._clickDiv||n||e){
+delete this._clickDiv;
+return
+}
+delete this._clickDiv;
+var t=this._getItemData(s,"type");
+if(this._headerList&&t==DwtListView.TYPE_HEADER_ITEM){
+if(a.button==DwtMouseEvent.LEFT){
+this._columnClicked(s,a)
+}else{
+if(a.button==DwtMouseEvent.RIGHT){
+var o=this._getActionMenuForColHeader();
+if(o&&o instanceof DwtMenu){
+o.popup(0,a.docX,a.docY)
+}}}}else{
+if(t==DwtListView.TYPE_LIST_ITEM){
+if(a.button==DwtMouseEvent.LEFT||a.button==DwtMouseEvent.RIGHT){
+this._itemClicked(s,a)
+}}}};
+DwtListView.prototype._doubleClickAction=function(e,t){
+return true
+};
+DwtListView.prototype._doubleClickListener=function(t){
+var a=this.getTargetItemDiv(t);
+if(!a){
+return
+}
+var e=this._getItemData(a,"type");
+if(e==DwtListView.TYPE_LIST_ITEM){
+if(!this._doubleClickAction(t,a)){
+return
+}
+if(this._evtMgr.isListenerRegistered(DwtEvent.SELECTION)){
+DwtUiEvent.copy(this._selEv,t);
+this._selEv.item=this.getItemFromElement(a);
+this._selEv.detail=DwtListView.ITEM_DBL_CLICKED;
+this._evtMgr.notifyListeners(DwtEvent.SELECTION,this._selEv)
+}}};
+DwtListView.prototype.emulateDblClick=function(e,t){
+var o=document.getElementById(this._getItemId(e));
+if(o){
+var a=new DwtMouseEvent();
+this._setMouseEvent(a,{
+target:o,button:DwtMouseEvent.LEFT}
+);
+a.kbNavEvent=t;
+this._itemClicked(o,a);
+this._doubleClickListener(a)
+}};
+DwtListView.prototype._selectItem=function(a,e,o){
+if(!this.size()){
+return
+}
+var t=(this._kbAnchor)?this._getSiblingElement(this._kbAnchor,a):this._parentEl.firstChild;
+this._scrollList(t);
+this._emulateSingleClick({
+target:t,button:DwtMouseEvent.LEFT,shiftKey:e,kbNavEvent:o}
+)
+};
+DwtListView.prototype._getSiblingElement=function(e,a){
+if(!e){
+return null
+}
+var t=a?e.nextSibling:e.previousSibling;
+while(this._hasHiddenRows&&t&&!Dwt.getVisible(t)){
+t=a?t.nextSibling:t.previousSibling
+}
+return(!t||(this._hasHiddenRows&&!Dwt.getVisible(t)))?e:t
+};
+DwtListView.prototype._scrollList=function(e){
+DwtControl._scrollIntoView(e,e.parentNode)
+};
+DwtListView.prototype._emulateSingleClick=function(e){
+this._clickDiv=this.findItemDiv(e.target);
+var t=new DwtMouseEvent();
+this._setMouseEvent(t,e);
+t.kbNavEvent=e.kbNavEvent;
+this.notifyListeners(DwtEvent.ONMOUSEUP,t)
+};
+DwtListView.prototype._setKbFocusElement=function(e){
+if(!this._list){
+return
+}
+var a=this._kbAnchor;
+if(this._kbAnchor){
+this._kbAnchor=this._getSiblingElement(this._kbAnchor,e)
+}else{
+this._kbAnchor=this._parentEl.firstChild
+}
+if(this._kbAnchor!=a){
+if(a){
+var t=this._selectedClass;
+if(a.className.indexOf(t)!=-1){
+Dwt.delClass(a,this._styleRe,t)
+}else{
+Dwt.delClass(a,this._styleRe)
+}}
+Dwt.addClass(this._kbAnchor,this._kbFocusClass)
+}
+if(this._kbAnchor){
+this._scrollList(this._kbAnchor)
+}};
+DwtListView.prototype._itemSelected=function(e,a){
+if(this._allowLeftSelection(e,a,a&&a.button)){
+this._unmarkKbAnchorElement(true);
+this.deselectAll();
+this._selectedItems.add(e);
+this._selAnchor=this._kbAnchor=e;
+Dwt.delClass(e,this._styleRe,this._selectedClass);
+if(this.hasFocus()){
+Dwt.addClass(e,this._kbFocusClass)
+}
+var t=this.getItemFromElement(e);
+this.firstSelIndex=(this._list&&t)?this._list.indexOf(t):-1
+}};
+DwtListView.prototype._itemClicked=function(s,u){
+if(this._rightSelItem){
+Dwt.delClass(this._rightSelItem,this._styleRe);
+this._rightSelItem=null
+}
+var n=this._selectedItems.size();
+var a=this._selectedItems.contains(s);
+if((!u.shiftKey&&!u.ctrlKey)||!this.multiSelectEnabled){
+if(u.button==DwtMouseEvent.LEFT||u.button==DwtMouseEvent.RIGHT){
+this._selEv.detail=DwtListView.ITEM_SELECTED
+}
+if(u.button==DwtMouseEvent.LEFT){
+this._itemSelected(s,u)
+}else{
+if(u.button==DwtMouseEvent.RIGHT&&!a&&this._evtMgr.isListenerRegistered(DwtEvent.ACTION)){
+this._rightSelItem=s;
+Dwt.delClass(s,this._styleRe,this._rightClickClass);
+if(this._kbAnchor==s){
+Dwt.addClass(s,this._kbFocusClass)
+}}}}else{
+if(u.ctrlKey){
+this.setMultiSelection(s,a,u)
+}else{
+if(!this._selAnchor){
+return
+}
+var r=this._getChildren()||s.parentNode.childNodes;
+var c=r.length;
+var o;
+var e=0;
+for(var h=0;
+h<c;
+h++){
+o=r[h];
+if(o==this._rightSelItem){
+this._rightSelItem=null
+}
+if(o==s){
+e++
+}
+var t=this._selectedClass;
+if(o==this._selAnchor){
+e++;
+if(o.className.indexOf(t)==-1){
+this._selectedItems.add(o)
+}
+Dwt.delClass(o,this._styleRe,t);
+continue
+}
+if(e!=1&&o.className.indexOf(t)!=-1&&o!=s){
+Dwt.delClass(o,this._styleRe);
+this._selectedItems.remove(o)
+}else{
+if(e==1||o==s){
+if(o.className.indexOf(t)==-1){
+this._selectedItems.add(o)
+}
+Dwt.delClass(o,this._styleRe,t)
+}}}
+this._kbAnchor=s;
+Dwt.addClass(this._kbAnchor,this._kbFocusClass);
+var d=this._selectedItems.size();
+if(n<d){
+this._selEv.detail=DwtListView.ITEM_SELECTED
+}else{
+if(n>d){
+this._selEv.detail=DwtListView.ITEM_DESELECTED
+}else{
+return
+}}}}
+if(u.button==DwtMouseEvent.LEFT&&this._evtMgr.isListenerRegistered(DwtEvent.SELECTION)){
+if(this._setListEvent(u,this._selEv,s)){
+this._evtMgr.notifyListeners(DwtEvent.SELECTION,this._selEv)
+}}else{
+if(u.button==DwtMouseEvent.RIGHT&&this._evtMgr.isListenerRegistered(DwtEvent.ACTION)){
+if(this._setListEvent(u,this._actionEv,s)){
+this._evtMgr.notifyListeners(DwtEvent.ACTION,this._actionEv)
+}}}};
+DwtListView.prototype._setListEvent=function(t,a,e){
+DwtUiEvent.copy(a,t);
+a.kbNavEvent=t.kbNavEvent;
+a.item=this.findItem(e);
+return true
+};
+DwtListView.prototype._columnClicked=function(o,t){
+var n=this.getItemFromElement(o);
+if(!(n._sortable&&this.sortingEnabled)){
+return
+}
+var a=this.getList();
+var e=a?a.size():null;
+if(!e){
+return
+}
+this._bSortAsc=(n._id==this._currentColId)?!this._bSortAsc:this._getDefaultSortbyForCol(n);
+this._setSortedColStyle(n._id);
+if(e>=1){
+this._sortColumn(n,this._bSortAsc)
+}};
+DwtListView.prototype._sortColumn=function(e,t){};
+DwtListView.prototype._getActionMenuForColHeader=function(){
+return null
+};
+DwtListView.prototype._getDefaultSortbyForCol=function(e){
+return true
+};
+DwtListView.prototype._allowLeftSelection=function(t,a,e){
+return true
+};
+DwtListView.prototype._setSortedColStyle=function(e){
+if(this._currentColId&&(e!=this._currentColId)){
+var s=this._headerIdHash[this._currentColId];
+if(s&&!s._noSortArrow){
+var r=s._field;
+var h=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_ARROW,this._view,r);
+var o=document.getElementById(h);
+if(o&&o.firstChild){
+var t=(AjxImg._mode==AjxImg.SINGLE_IMG)?o.firstChild:o.firstChild.firstChild;
+if(t){
+t.style.visibility="hidden"
+}}}
+var d=document.getElementById(this._currentColId);
+if(d){
+d.className="DwtListView-Column"
+}}
+this._currentColId=e;
+var s=this._headerIdHash[this._currentColId];
+if(!s._noSortArrow){
+var r=s._field;
+var c=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_ARROW,this._view,r);
+var a=document.getElementById(c);
+if(a){
+AjxImg.setImage(a,this._bSortAsc?"ColumnUpArrow":"ColumnDownArrow");
+var t=(AjxImg._mode==AjxImg.SINGLE_IMG)?a.firstChild:a.firstChild.firstChild;
+if(t){
+t.style.visibility="visible"
+}}}
+var n=document.getElementById(e);
+if(n){
+n.className="DwtListView-Column DwtListView-ColumnActive"
+}};
+DwtListView.prototype._resetList=function(){
+if(this._list&&this._list.size()){
+this._list.removeAll()
+}
+this._resetListView()
+};
+DwtListView.prototype._resetListView=function(){
+var e;
+while(this._parentEl&&this._parentEl.hasChildNodes()){
+var e=this._parentEl.removeChild(this._parentEl.firstChild);
+this._data[e.id]=null
+}
+if(this._selectedItems){
+this._selectedItems.removeAll()
+}
+this._rightSelItem=null
+};
+DwtListView.prototype._destroyDragProxy=function(e){
+this._data[e.id]=null;
+DwtControl.prototype._destroyDragProxy.call(this,e)
+};
+DwtListView.prototype._handleColHeaderMove=function(r){
+if(!this._headerClone){
+if(!this._headerColX){
+this._headerColX=r.docX;
+return
+}else{
+var n=Math.abs(this._headerColX-r.docX);
+if(n<DwtListView.COL_MOVE_THRESHOLD){
+return
+}}
+this._headerClone=document.createElement("div");
+var u=Dwt.getSize(this._clickDiv);
+var t=AjxEnv.isIE?u.x:u.x-3;
+var d=AjxEnv.isIE?u.y:u.y-5;
+Dwt.setSize(this._headerClone,t,d);
+Dwt.setPosition(this._headerClone,Dwt.ABSOLUTE_STYLE);
+Dwt.setZIndex(this._headerClone,Dwt.Z_DND);
+Dwt.setLocation(this._headerClone,Dwt.DEFAULT,r.docY);
+this._headerClone.className=this._clickDiv.className+" DragProxy";
+this._headerClone.innerHTML=this._clickDiv.innerHTML;
+this._clickDiv.className="DwtListView-Column DwtListView-ColumnEmpty";
+this._headerClone.style.borderTop="1px solid #777777";
+var h=this._headerIdHash[this._clickDiv.id];
+var c=h._field;
+var o=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_LABEL,this._view,c);
+var a=document.getElementById(o);
+if(a){
+a.style.color="#FFFFFF"
+}
+this.shell.getHtmlElement().appendChild(this._headerClone)
+}else{
+var e=this.getTargetItemDiv(r);
+var s=this._getItemData(e,"type");
+if(s==DwtListView.TYPE_HEADER_ITEM){
+if(this._headerCloneTarget&&(this._headerCloneTarget==this._clickDiv)){
+this._headerCloneTarget=null
+}else{
+if(this._headerCloneTarget!=e){
+this._headerCloneTarget=e
+}}}else{
+this._headerCloneTarget=null
+}}
+if(this._headerClone){
+Dwt.setLocation(this._headerClone,r.docX+2)
+}};
+DwtListView.prototype._handleColHeaderResize=function(t){
+if(!this._headerSash){
+this._headerSash=document.createElement("div");
+Dwt.setSize(this._headerSash,Dwt.DEFAULT,this.getSize().y);
+Dwt.setPosition(this._headerSash,Dwt.ABSOLUTE_STYLE);
+Dwt.setZIndex(this._headerSash,Dwt.Z_DND);
+var a=this._getHeaderSashLocation();
+this._headerSashFudgeX=a.x;
+Dwt.setLocation(this._headerSash,Dwt.DEFAULT,a.y);
+this._headerSash.className="DwtListView-ColumnSash";
+this.getHtmlElement().appendChild(this._headerSash);
+this._headerSashX=t.docX
+}
+var e=this._getParentForColResize();
+var o=Dwt.toWindow(e.getHtmlElement(),0,0);
+Dwt.setLocation(this._headerSash,(t.docX-o.x)+this._headerSashFudgeX)
+};
+DwtListView.prototype._getHeaderSashLocation=function(){
+if(!this._tmpPoint){
+this._tmpPoint=new DwtPoint()
+}
+this._tmpPoint.x=0;
+this._tmpPoint.y=0;
+return this._tmpPoint
+};
+DwtListView.prototype._handleColHeaderDrop=function(h){
+this._headerColX=null;
+if(this._headerClone==null||h.button==DwtMouseEvent.RIGHT){
+return false
+}
+if(this._headerCloneTarget){
+var e=this._getItemData(this._clickDiv,"index");
+var a=this._getItemData(this._headerCloneTarget,"index");
+this._reIndexColumn(e,a)
+}
+this._clickDiv.className=(this._clickDiv.id!=this._currentColId)?"DwtListView-Column":"DwtListView-Column DwtListView-ColumnActive";
+var d=this._headerClone.parentNode;
+if(d){
+d.removeChild(this._headerClone)
+}
+delete this._headerClone;
+var s=this._data[this._clickDiv.id];
+if(s.type!=DwtListView.TYPE_HEADER_ITEM){
+var c=this._headerIdHash[this._currentColId];
+var r=c._sortable?c._field:null;
+this.headerColCreated=false;
+this.createHeaderHtml(r)
+}else{
+var c=this._headerIdHash[this._clickDiv.id];
+var o=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_LABEL,this._view,c._field);
+var t=document.getElementById(o);
+if(t){
+t.style.color="#000000"
+}}
+for(var n=0;
+n<this._headerList.length;
+n++){
+this._headerList[n]._width=this._calcRelativeWidth(n)
+}
+this._resetColWidth();
+return true
+};
+DwtListView.prototype._reIndexColumn=function(o,a){
+if(!this._headerList){
+return
+}
+var e=this._headerList.length;
+if(o<0||a<0||o>=e||a>=e||o==a){
+return
+}
+var t=this._headerList.splice(o,1);
+this._headerList.splice(a,0,t[0]);
+this._relayout()
+};
+DwtListView.prototype._handleColSashDrop=function(o){
+if(this._headerSash==null||o.button==DwtMouseEvent.RIGHT){
+return false
+}
+var a=this._headerSash.parentNode;
+if(a){
+a.removeChild(this._headerSash)
+}
+delete this._headerSash;
+for(var t=0;
+t<this._headerList.length;
+t++){
+this._headerList[t]._width=this._calcRelativeWidth(t)
+}
+var s=this._getItemData(this._clickDiv,"index");
+if(s==null){
+return false
+}
+var h=o.docX-this._headerSashX;
+var r=this._headerList[s];
+var n=this._variableHeaderCol;
+if(r==n){
+var e=this._getNextResizeableColumnIndex(n._index);
+if(e!=null){
+n=this._headerList[e]
+}else{
+return false
+}}else{
+if(!n){
+var e=this._getNextResizeableColumnIndex(r._index);
+if(e!=null){
+n=this._headerList[e]
+}else{
+return false
+}}}
+r._width=Math.max(r._width+h,DwtListView.MIN_COLUMN_WIDTH);
+n._width=Math.max(this._calcRelativeWidth(n._index)-h,DwtListView.MIN_COLUMN_WIDTH);
+var e=this._getNextResizeableColumnIndex(-1,[r._index,n._index]);
+if(e!=null){
+this._headerList[e]._width="auto"
+}
+this._relayout();
+this._resetColWidth();
+return true
+};
+DwtListView.prototype._calcRelativeWidth=function(a){
+var t=this._headerList[a];
+if(!t._width||(t._width&&t._width=="auto")){
+var e=document.getElementById(t._id);
+return(e)?(e.clientWidth-(AjxEnv.isIE?4:5)):null
+}
+return t._width
+};
+DwtListView.prototype._resetColWidth=function(){
+if(!this.headerColCreated){
+return
+}
+var s=this._getLastColumnIndex();
+if(s){
+var a=this._headerList[s];
+var t=document.getElementById(a._id);
+if(t){
+var r=t.firstChild;
+var e=16;
+var n=this._listColDiv.clientWidth;
+var o=this._listDiv.clientWidth;
+if(n!=o){
+t.style.width=r.style.width=(a._width!=null&&a._width!="auto")?(a._width+e):(t.clientWidth+e)
+}else{
+t.style.width=r.style.width=(a._width||"")
+}}}};
+DwtListView.prototype._getLastColumnIndex=function(){
+var t=null;
+if(this._headerList){
+var e=this._headerList.length-1;
+while(t==null&&e>=0){
+if(this._headerList[e]._visible){
+t=e
+}
+e--
+}}
+return t
+};
+DwtListView.prototype._getNextResizeableColumnIndex=function(o,e){
+e=e?AjxUtil.arrayAsHash(e):{};
+e[o]=true;
+if(this._headerList){
+for(var a=o+1;
+a<this._headerList.length;
+a++){
+var t=this._headerList[a];
+if(e[a]){
+continue
+}
+if(t._visible&&t._resizeable){
+return a
+}}
+for(var a=0;
+a<o;
+a++){
+if(e[a]){
+continue
+}
+var t=this._headerList[a];
+if(t._visible&&t._resizeable){
+return a
+}}}
+return null
+};
+DwtListView.prototype._relayout=function(){
+this.headerColCreated=false;
+var a=this._headerIdHash[this._currentColId];
+var e=(a&&a._sortable)?a._field:null;
+this.setUI(e);
+var t=this.getSelection()[0];
+this.setSelection(t,true)
+};
+DwtListView.prototype._getParentForColResize=function(){
+return this
+};
+DwtListView.prototype._sizeChildren=function(e){
+if(this.headerColCreated&&this._listDiv&&(e!=Dwt.DEFAULT)){
+Dwt.setSize(this._listDiv,Dwt.DEFAULT,e-DwtListView.HEADERITEM_HEIGHT);
+return true
+}else{
+return false
+}};
+DwtListView.prototype._getChildren=function(){
+return null
+};
+DwtListView.prototype._focus=function(){
+if(this.size()==0){
+return
+}
+if(this._kbAnchor){
+Dwt.addClass(this._kbAnchor,this._kbFocusClass)
+}else{
+this._setKbFocusElement()
+}};
+DwtListView.prototype._blur=function(){
+this._unmarkKbAnchorElement()
+};
+DwtListView.prototype._unmarkKbAnchorElement=function(e){
+if(this._kbAnchor){
+if(this._selectedItems.contains(this._kbAnchor)){
+Dwt.delClass(this._kbAnchor,this._styleRe,this._selectedClass)
+}else{
+Dwt.delClass(this._kbAnchor,this._styleRe)
+}}
+if(e){
+this._kbAnchor=null
+}};
+DwtListView.prototype._getFirstItem=function(){
+var e=this._list.getArray();
+if(e&&e.length>1){
+return e[0]
+}
+return null
+};
+DwtListView.prototype._getLastItem=function(){
+var e=this._list.getArray();
+if(e&&e.length>1){
+return e[e.length-1]
+}
+return null
+};
+DwtListHeaderItem=function(t){
+if(arguments.length==0){
+return
+}
+t=Dwt.getParams(arguments,DwtListView.PARAMS);
+this._field=t.field;
+this._label=t.text;
+this._iconInfo=t.icon;
+this._sortable=t.sortable;
+this._noSortArrow=t.noSortArrow;
+this._resizeable=t.resizeable;
+this._visible=(t.visible!==false);
+this._name=t.name||t.text;
+this._align=t.align;
+this._noRemove=t.noRemove;
+var e=parseInt(t.width);
+if(isNaN(e)||!e){
+this._width="auto";
+this._variable=true;
+this._resizeable=true
+}else{
+if(String(e)==String(t.width)){
+this._width=e
+}else{
+this._width=parseInt(String(t.width).substr(0,String(e).length));
+this._widthUnits=AjxStringUtil.getUnitsFromSizeString(t.width)
+}}};
+DwtListHeaderItem.PARAMS=["id","text","icon","width","sortable","resizeable","visible","name","align","noRemove","view"];
+DwtListHeaderItem.sortCompare=function(t,e){
+return t._index<e._index?-1:(t._index>e._index?1:0)
+};
+DwtListHeaderItem.prototype.toString=function(){
+return"DwtListHeaderItem"
+}
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtButton")){
+DwtButton=function(a){
+if(arguments.length==0){
+return
+}
+a=Dwt.getParams(arguments,DwtButton.PARAMS);
+a.className=a.className||"ZButton";
+DwtLabel.call(this,a);
+var t=a.parent;
+if(!t._hasSetMouseEvents||AjxEnv.isIE){
+this._setMouseEvents()
+}
+var e;
+if(t._hasSetMouseEvents){
+e=AjxEnv.isIE?[DwtEvent.ONMOUSEENTER,DwtEvent.ONMOUSELEAVE]:[]
+}else{
+e=AjxEnv.isIE?[DwtEvent.ONMOUSEENTER,DwtEvent.ONMOUSELEAVE]:[DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT];
+e=e.concat([DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP])
+}
+if(e&&e.length){
+this._setEventHdlrs(e)
+}
+this._listeners=a.listeners||DwtButton._listeners;
+this._addMouseListeners();
+this._ignoreInternalOverOut=true;
+this._dropDownEvtMgr=new AjxEventMgr();
+this._selected=false;
+this._actionTiming=a.actionTiming||DwtButton.ACTION_MOUSEUP;
+this.__preventMenuFocus=null
+};
+DwtButton.prototype=new DwtLabel;
+DwtButton.prototype.constructor=DwtButton;
+DwtButton.prototype.toString=function(){
+return"DwtButton"
+};
+DwtButton.PARAMS=["parent","style","className","posStyle","actionTiming","id","index","listeners"];
+DwtButton.TOGGLE_STYLE=DwtLabel._LAST_STYLE*2;
+DwtButton.ALWAYS_FLAT=DwtLabel._LAST_STYLE*4;
+DwtButton._LAST_STYLE=DwtButton.ALWAYS_FLAT;
+DwtButton.ACTION_MOUSEUP=1;
+DwtButton.ACTION_MOUSEDOWN=2;
+DwtButton.NOTIFY_WINDOW=500;
+DwtButton.prototype.TEMPLATE="dwt.Widgets#ZButton";
+DwtButton.prototype.dispose=function(){
+if((this._menu instanceof DwtMenu)&&(this._menu.parent==this)){
+this._menu.dispose();
+this._menu=null
+}
+DwtLabel.prototype.dispose.call(this)
+};
+DwtButton.prototype.addSelectionListener=function(t,e){
+this.addListener(DwtEvent.SELECTION,t,e);
+if(DwtControl.globalSelectionListener){
+this.addListener(DwtEvent.SELECTION,DwtControl.globalSelectionListener)
+}};
+DwtButton.prototype.removeSelectionListener=function(e){
+this.removeListener(DwtEvent.SELECTION,e)
+};
+DwtButton.prototype.removeSelectionListeners=function(){
+this.removeAllListeners(DwtEvent.SELECTION)
+};
+DwtButton.prototype.addDropDownSelectionListener=function(e){
+return this._dropDownEvtMgr.addListener(DwtEvent.SELECTION,e)
+};
+DwtButton.prototype.removeDropDownSelectionListener=function(e){
+this._dropDownEvtMgr.removeListener(DwtEvent.SELECTION,e)
+};
+DwtButton.prototype._dropDownImg="SelectPullDownArrow";
+DwtButton.prototype._dropDownDepImg="SelectPullDownArrow";
+DwtButton.prototype._dropDownHovImg="SelectPullDownArrowHover";
+DwtButton.prototype.setDropDownImages=function(t,a,o,e){
+this._dropDownImg=t;
+this._dropDownHovImg=o;
+this._dropDownDepImg=e
+};
+DwtButton.prototype._addEventListeners=function(a,t){
+for(var e=0;
+e<t.length;
+e++){
+this.addListener(event,a[event])
+}};
+DwtButton.prototype._removeEventListeners=function(a,t){
+for(var e=0;
+e<t.length;
+e++){
+this.removeListener(event,a[event])
+}};
+DwtButton.prototype._addMouseListeners=function(){
+var t=[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP];
+t=t.concat(AjxEnv.isIE?[DwtEvent.ONMOUSEENTER,DwtEvent.ONMOUSELEAVE]:[DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT]);
+for(var e=0;
+e<t.length;
+e++){
+this.addListener(t[e],this._listeners[t[e]])
+}};
+DwtButton.prototype._removeMouseListeners=function(){
+var t=[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP];
+t=t.concat(AjxEnv.isIE?[DwtEvent.ONMOUSEENTER,DwtEvent.ONMOUSELEAVE]:[DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT]);
+for(var e=0;
+e<t.length;
+e++){
+this.removeListener(t[e],this._listeners[t[e]])
+}};
+DwtButton.prototype.setDisplayState=function(t,e){
+if(this._selected&&t!=DwtControl.SELECTED&&!e){
+t=[DwtControl.SELECTED,t].join(" ")
+}
+DwtLabel.prototype.setDisplayState.call(this,t)
+};
+DwtButton.prototype.setEnabled=function(t){
+if(t!=this._enabled){
+DwtLabel.prototype.setEnabled.call(this,t);
+if(t){
+var a=(AjxEnv.isIE)?this.getHtmlElement().firstChild:null;
+if(a){
+var e=a.className;
+a.className="";
+a.className=e
+}
+this._addMouseListeners();
+if(this._menu){
+this._setDropDownCellMouseHandlers(true);
+if(this._dropDownEl){
+AjxImg.setImage(this._dropDownEl,this._dropDownImg)
+}}}else{
+this._removeMouseListeners();
+if(this._menu){
+this._setDropDownCellMouseHandlers(false);
+if(this._dropDownEl){
+AjxImg.setDisabledImage(this._dropDownEl,this._dropDownImg)
+}}}}};
+DwtButton.prototype.setImage=function(e){
+DwtLabel.prototype.setImage.call(this,e);
+this._setMinWidth()
+};
+DwtButton.prototype.setText=function(e){
+DwtLabel.prototype.setText.call(this,e);
+this._setMinWidth()
+};
+DwtButton.prototype._setMinWidth=function(){
+if(this.getText()!=null){
+Dwt.addClass(this.getHtmlElement(),"ZHasText")
+}else{
+Dwt.delClass(this.getHtmlElement(),"ZHasText")
+}};
+DwtButton.prototype.setHoverImage=function(e){
+this._hoverImageInfo=e
+};
+DwtButton.prototype.setMenu=function(n,a,o,t){
+this._menu=n;
+this._shouldToggleMenu=(a===true);
+this._followIconStyle=o;
+this._popupAbove=t;
+if(this._menu){
+if(this._dropDownEl){
+var e=(this._imageCell)?1:0;
+if(this._textCell){
+e++
+}
+Dwt.addClass(this.getHtmlElement(),"ZHasDropDown");
+AjxImg.setImage(this._dropDownEl,this._dropDownImg);
+if(this._enabled){
+this._setDropDownCellMouseHandlers(true)
+}
+if(!(this._menu instanceof AjxCallback)){
+this._menu.setAssociatedElementId(this._dropDownEl.id)
+}}
+if((this.__preventMenuFocus!=null)&&(this._menu instanceof DwtMenu)){
+this._menu.dontStealFocus(this.__preventMenuFocus)
+}}else{
+if(this._dropDownEl){
+Dwt.delClass(this.getHtmlElement(),"ZHasDropDown");
+this._dropDownEl.innerHTML=""
+}}};
+DwtButton.prototype._setDropDownCellMouseHandlers=function(e){
+this._dropDownEventsEnabled=e
+};
+DwtButton.prototype.getMenu=function(e){
+if(this._menu instanceof AjxCallback){
+if(e){
+return null
+}
+var t=this._menu;
+this.setMenu(t.run(this),this._shouldToggleMenu,this._followIconStyle,this._popupAbove);
+if((this.__preventMenuFocus!=null)&&(this._menu instanceof DwtMenu)){
+this._menu.dontStealFocus(this.__preventMenuFocus)
+}}
+if(this._menu){
+this.getHtmlElement().setAttribute("menuId",this._menu._htmlElId)
+}
+return this._menu
+};
+DwtButton.prototype.resetClassName=function(){
+this.setDisplayState(DwtControl.NORMAL)
+};
+DwtButton.prototype.setActionTiming=function(e){
+this._actionTiming=e
+};
+DwtButton.prototype.setHovered=function(e){
+this.setDisplayState(e?DwtControl.HOVER:DwtControl.NORMAL)
+};
+DwtButton.prototype.setEnabledImage=function(e){
+this._enabledImageInfo=e;
+this.setImage(e)
+};
+DwtButton.prototype.setDepressedImage=function(e){
+this._depressedImageInfo=e
+};
+DwtButton.prototype.setSelected=function(e){
+if(this._selected!=e){
+this._selected=e;
+this.setDisplayState(e?DwtControl.SELECTED:DwtControl.NORMAL)
+}};
+DwtButton.prototype.isToggled=function(){
+return this._selected
+};
+DwtButton.prototype.popup=function(o){
+o=o||this.getMenu();
+if(!o){
+return
+}
+var d=o.parent;
+var s=d.getBounds();
+var c=o.shell.getSize();
+var e=o.getSize();
+var u=d.getHtmlElement();
+var a=Dwt.toWindow(u,0,0);
+var t=(u.style.borderLeftWidth=="")?0:parseInt(u.style.borderLeftWidth);
+var h=a.x+t;
+h=((h+e.x)>=c.x)?c.x-e.x:h;
+var r;
+if(this._popupAbove){
+r=a.y-e.y
+}else{
+var n=(u.style.borderTopWidth=="")?0:parseInt(u.style.borderTopWidth);
+n+=(u.style.borderBottomWidth=="")?0:parseInt(u.style.borderBottomWidth);
+r=a.y+s.height+n
+}
+o.popup(0,h,r)
+};
+DwtButton.prototype.getKeyMapName=function(){
+return"DwtButton"
+};
+DwtButton.prototype.handleKeyAction=function(e,t){
+switch(e){
+case DwtKeyMap.SELECT:this._emulateSingleClick();
+break;
+case DwtKeyMap.SUBMENU:var a=this.getMenu();
+if(!a){
+return false
+}
+this._emulateDropDownClick();
+a.setSelectedItem(0);
+break
+}
+return true
+};
+DwtButton.prototype._emulateSingleClick=function(){
+this.trigger();
+var e=this.getHtmlElement();
+var t=Dwt.toWindow(e);
+var a=new DwtMouseEvent();
+this._setMouseEvent(a,{
+dwtObj:this,target:e,button:DwtMouseEvent.LEFT,docX:t.x,docY:t.y}
+);
+if(this._actionTiming==DwtButton.ACTION_MOUSEDOWN){
+this.notifyListeners(DwtEvent.ONMOUSEDOWN,a)
+}else{
+this.notifyListeners(DwtEvent.ONMOUSEUP,a)
+}};
+DwtButton.prototype._emulateDropDownClick=function(){
+var e=this._dropDownEl;
+if(!e){
+return
+}
+var t=Dwt.toWindow(e);
+var a=new DwtMouseEvent();
+this._setMouseEvent(a,{
+dwtObj:this,target:e,button:DwtMouseEvent.LEFT,docX:t.x,docY:t.y}
+);
+DwtButton._dropDownCellMouseDownHdlr(a)
+};
+DwtButton.prototype._focusByMouseUpEvent=function(){
+if(!(this.parent&&(this.parent instanceof DwtToolBar)&&this.parent.noFocus)){
+DwtShell.getShell(window).getKeyboardMgr().grabFocus(this.getTabGroupMember())
+}};
+DwtButton.prototype._focus=function(){
+this.setDisplayState(DwtControl.FOCUSED)
+};
+DwtButton.prototype._blur=function(){
+this.setDisplayState(DwtControl.NORMAL)
+};
+DwtButton.prototype._toggleMenu=function(){
+if(this._shouldToggleMenu){
+var e=this.getMenu();
+if(!e.isPoppedUp()){
+this.popup();
+this._menuUp=true
+}else{
+e.popdown();
+this._menuUp=false;
+this.deactivate()
+}}else{
+this.popup()
+}};
+DwtButton.prototype._isDropDownEvent=function(t){
+if(this._dropDownEventsEnabled&&this._dropDownEl){
+var e=t.docX;
+var a=Dwt.toWindow(this._dropDownEl,0,0,window).x;
+if(e>=a){
+return true
+}}
+return false
+};
+DwtButton.prototype.trigger=function(){
+if(this._depressedImageInfo){
+this.setImage(this._depressedImageInfo)
+}
+this.setDisplayState(DwtControl.ACTIVE,true);
+this.isActive=true
+};
+DwtButton.prototype.deactivate=function(){
+this._showHoverImage(true);
+if(this._style&DwtButton.TOGGLE_STYLE){
+this._selected=!this._selected
+}
+this.setDisplayState(DwtControl.HOVER)
+};
+DwtButton.prototype.dontStealFocus=function(e){
+if(e==null){
+e=true
+}
+if(this._menu instanceof DwtMenu){
+this._menu.dontStealFocus(e)
+}
+this.__preventMenuFocus=e
+};
+DwtButton.prototype._showHoverImage=function(t){
+if(this._hoverImageInfo){
+var e=this._getIconEl();
+var a=t?this._hoverImageInfo:this.__imageInfo;
+e.firstChild.className=AjxImg.getClassForImage(a)
+}};
+DwtButton.prototype._handleClick=function(t){
+if(this.isListenerRegistered(DwtEvent.SELECTION)){
+var e=(new Date()).getTime();
+if(!this._lastNotify||(e-this._lastNotify>DwtButton.NOTIFY_WINDOW)){
+var a=DwtShell.selectionEvent;
+DwtUiEvent.copy(a,t);
+a.item=this;
+a.detail=(typeof this.__detail=="undefined")?0:this.__detail;
+this.notifyListeners(DwtEvent.SELECTION,a);
+this._lastNotify=e
+}}else{
+if(this._menu){
+this._toggleMenu()
+}}};
+DwtButton.prototype._setMouseOutClassName=function(){
+this.setDisplayState(DwtControl.NORMAL)
+};
+DwtButton.prototype._createHtmlFromTemplate=function(e,t){
+DwtLabel.prototype._createHtmlFromTemplate.call(this,e,t);
+this._dropDownEl=document.getElementById(t.id+"_dropdown")
+};
+DwtButton._dropDownCellMouseDownHdlr=function(t){
+var a=DwtControl.getTargetControl(t);
+var e=DwtShell.mouseEvent;
+e.setFromDhtmlEvent(t,a);
+if(e.button==DwtMouseEvent.LEFT){
+if(this._depImg){
+AjxImg.setImage(this,this._depImg)
+}}
+e._stopPropagation=true;
+e._returnValue=false;
+e.setToDhtmlEvent(t);
+return false
+};
+DwtButton._dropDownCellMouseUpHdlr=function(t){
+var e=DwtShell.mouseEvent;
+e.setFromDhtmlEvent(t);
+if(e.button==DwtMouseEvent.LEFT){
+if(this._hovImg&&!this.noMenuBar){
+AjxImg.setImage(this,this._hovImg)
+}
+DwtEventManager.notifyListeners(DwtEvent.ONMOUSEDOWN,e);
+var o=DwtControl.getTargetControl(t);
+if(o){
+if(o.getMenu()&&o.getMenu().isPoppedUp()){
+o.getMenu().popdown()
+}else{
+if(o._menu instanceof AjxCallback){
+o.popup()
+}
+if(o._dropDownEvtMgr.isListenerRegistered(DwtEvent.SELECTION)){
+var a=DwtShell.selectionEvent;
+DwtUiEvent.copy(a,e);
+a.item=o;
+o._dropDownEvtMgr.notifyListeners(DwtEvent.SELECTION,a)
+}else{
+o._toggleMenu()
+}}}}
+e._stopPropagation=true;
+e._returnValue=false;
+e.setToDhtmlEvent(t);
+return false
+};
+DwtButton._mouseOverListener=function(t){
+var e=t.dwtObj;
+if(!e){
+return false
+}
+e._showHoverImage(true);
+e.setDisplayState(DwtControl.HOVER);
+var a=e._dropDownEl;
+if(e._menu&&a&&e._dropDownHovImg&&!e.noMenuBar&&e.isListenerRegistered(DwtEvent.SELECTION)){
+AjxImg.setImage(a,e._dropDownHovImg)
+}
+t._stopPropagation=true
+};
+DwtButton._mouseOutListener=function(t){
+var e=t.dwtObj;
+if(!e){
+return false
+}
+e._showHoverImage(false);
+e._setMouseOutClassName();
+e.isActive=false;
+var a=e._dropDownEl;
+if(e._menu&&a){
+AjxImg.setImage(a,e._dropDownImg)
+}};
+DwtButton._mouseDownListener=function(t){
+var e=t.dwtObj;
+if(!e){
+return false
+}
+if(e._isDropDownEvent(t)){
+return DwtButton._dropDownCellMouseDownHdlr(t)
+}
+if(t.button!=DwtMouseEvent.LEFT){
+return
+}
+var a=e._dropDownEl;
+if(e._menu&&a&&e._dropDownDepImg){
+AjxImg.setImage(a,e._dropDownDepImg)
+}
+switch(e._actionTiming){
+case DwtButton.ACTION_MOUSEDOWN:e.trigger();
+e._handleClick(t);
+break;
+case DwtButton.ACTION_MOUSEUP:e.trigger();
+break
+}};
+DwtButton._mouseUpListener=function(a){
+var e=a.dwtObj;
+if(!e){
+return false
+}
+if(e._isDropDownEvent(a)){
+return DwtButton._dropDownCellMouseUpHdlr(a)
+}
+if(a.button!=DwtMouseEvent.LEFT){
+return
+}
+var o=e._dropDownEl;
+if(e._menu&&o&&e._dropDownHovImg&&!e.noMenuBar){
+AjxImg.setImage(o,e._dropDownHovImg)
+}
+switch(e._actionTiming){
+case DwtButton.ACTION_MOUSEDOWN:e.deactivate();
+break;
+case DwtButton.ACTION_MOUSEUP:var t=e.getHtmlElement();
+if(e.isActive){
+e.deactivate();
+e._handleClick(a)
+}
+break
+}};
+DwtButton._listeners={};
+DwtButton._listeners[DwtEvent.ONMOUSEOVER]=new AjxListener(null,DwtButton._mouseOverListener);
+DwtButton._listeners[DwtEvent.ONMOUSEOUT]=new AjxListener(null,DwtButton._mouseOutListener);
+DwtButton._listeners[DwtEvent.ONMOUSEDOWN]=new AjxListener(null,DwtButton._mouseDownListener);
+DwtButton._listeners[DwtEvent.ONMOUSEUP]=new AjxListener(null,DwtButton._mouseUpListener);
+DwtButton._listeners[DwtEvent.ONMOUSEENTER]=new AjxListener(null,DwtButton._mouseOverListener);
+DwtButton._listeners[DwtEvent.ONMOUSELEAVE]=new AjxListener(null,DwtButton._mouseOutListener)
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtMenuItem")){
+DwtMenuItem=function(a){
+if(arguments.length==0){
+return
+}
+a=Dwt.getParams(arguments,DwtMenuItem.PARAMS);
+var t=a.parent;
+if(!(t instanceof DwtMenu)){
+throw new DwtException("Parent must be a DwtMenu object",DwtException.INVALIDPARENT,"DwtMenuItem")
+}
+var e=a.style=a.style||DwtMenuItem.NO_STYLE;
+if(t._style==DwtMenu.BAR_STYLE&&e!=DwtMenuItem.PUSH_STYLE){
+throw new DwtException("DwtMenuItemInit: invalid style",DwtException.INVALID_PARAM,"DwtMenuItem")
+}
+e&=~DwtLabel.IMAGE_RIGHT;
+e|=DwtButton.ALWAYS_FLAT|DwtLabel.IMAGE_LEFT;
+a.className=(e&DwtMenuItem.SEPARATOR_STYLE)?"ZMenuItemSeparator":(a.className||"ZMenuItem");
+a.listeners=DwtMenuItem._listeners;
+DwtButton.call(this,a);
+this.setDropDownImages("Cascade","Cascade","Cascade","Cascade");
+this._radioGroupId=a.radioGroupId;
+if(t._addItem){
+t._addItem(this,a.index)
+}
+if(!(e&DwtMenuItem.SEPARATOR_STYLE)){
+this.addSelectionListener(new AjxListener(this,this.__handleItemSelect))
+}};
+DwtMenuItem.PARAMS=["parent","style","radioGroupId","index","className","posStyle"];
+DwtMenuItem.prototype=new DwtButton;
+DwtMenuItem.prototype.constructor=DwtMenuItem;
+DwtMenuItem.prototype.toString=function(){
+return"DwtMenuItem"
+};
+DwtMenuItem.CHECKED=1;
+DwtMenuItem.UNCHECKED=2;
+DwtMenuItem.NO_STYLE=0;
+DwtMenuItem.CHECK_STYLE=DwtButton._LAST_STYLE*2;
+DwtMenuItem.RADIO_STYLE=DwtButton._LAST_STYLE*4;
+DwtMenuItem.SEPARATOR_STYLE=DwtButton._LAST_STYLE*8;
+DwtMenuItem.CASCADE_STYLE=DwtButton._LAST_STYLE*16;
+DwtMenuItem.PUSH_STYLE=DwtButton._LAST_STYLE*32;
+DwtMenuItem.SELECT_STYLE=DwtButton._LAST_STYLE*64;
+DwtMenuItem._LAST_STYLE=DwtMenuItem.SELECT_STYLE;
+DwtMenuItem._MENU_POPUP_DELAY=250;
+DwtMenuItem._MENU_POPDOWN_DELAY=250;
+DwtMenuItem.prototype.TEMPLATE="dwt.Widgets#ZMenuItem";
+DwtMenuItem.prototype.SEPARATOR_TEMPLATE="dwt.Widgets#ZMenuItemSeparator";
+DwtMenuItem.prototype.BLANK_CHECK_TEMPLATE="dwt.Widgets#ZMenuItemBlankCheck";
+DwtMenuItem.prototype.BLANK_ICON_TEMPLATE="dwt.Widgets#ZMenuItemBlankIcon";
+DwtMenuItem.prototype.BLANK_CASCADE_TEMPLATE="dwt.Widgets#ZMenuItemBlankCascade";
+DwtMenuItem.prototype.dispose=function(){
+delete this._checkEl;
+DwtButton.prototype.dispose.call(this)
+};
+DwtMenuItem.create=function(t){
+var e=new DwtMenuItem(t);
+if(t.imageInfo){
+e.setImage(t.imageInfo)
+}
+if(t.text){
+e.setText(t.text)
+}
+e.setEnabled(t.enabled!==false);
+return e
+};
+DwtMenuItem.prototype.getChecked=function(){
+return this._itemChecked
+};
+DwtMenuItem.prototype.setChecked=function(t,e){
+this._setChecked(t,null,e);
+this.parent._checkItemAdded(this)
+};
+DwtMenuItem.prototype.setImage=function(e){
+DwtButton.prototype.setImage.call(this,e);
+this.parent._iconItemAdded(this)
+};
+DwtMenuItem.prototype.setText=function(e){
+DwtButton.prototype.setText.call(this,e);
+if(this.parent.isPoppedUp()){
+this.parent.render()
+}};
+DwtMenuItem.prototype.setMenu=function(a,e,t){
+DwtButton.prototype.setMenu.call(this,a,e,t);
+this.parent._submenuItemAdded(this)
+};
+DwtMenuItem.prototype.setHoverDelay=function(e){
+this._hoverDelay=e
+};
+DwtMenuItem.prototype.setShortcut=function(e){
+if(e&&this._dropDownEl){
+this._dropDownEl.innerHTML=e
+}};
+DwtMenuItem.prototype._createHtml=function(e){
+var t=(this._style&DwtMenuItem.SEPARATOR_STYLE)?this.SEPARATOR_TEMPLATE:this.TEMPLATE;
+DwtButton.prototype._createHtml.call(this,e||t)
+};
+DwtMenuItem.prototype._createHtmlFromTemplate=function(e,t){
+DwtButton.prototype._createHtmlFromTemplate.call(this,e,t);
+this._checkEl=document.getElementById(t.id+"_check")
+};
+DwtMenuItem.prototype._setChecked=function(s,n,t){
+var e=this._style&DwtMenuItem.CHECK_STYLE;
+var o=this._style&DwtMenuItem.RADIO_STYLE;
+if((e||o)&&this._itemChecked!=s){
+this._itemChecked=s;
+if(this._checkEl){
+this._checkEl.innerHTML="";
+var a=s?(e?"MenuCheck":"MenuRadio"):"Blank_9";
+AjxImg.setImage(this._checkEl,a);
+if(s){
+if(o){
+this.parent._radioItemSelected(this,t)
+}}}}};
+DwtMenuItem.prototype._checkItemAdded=function(e){};
+DwtMenuItem.prototype._checkedItemsRemoved=function(){};
+DwtMenuItem.prototype._submenuItemAdded=function(){
+if(this._style&DwtMenuItem.SEPARATOR_STYLE){
+return
+}
+if(this._cascCell==null){
+this._cascCell=this._row.insertCell(-1);
+this._cascCell.noWrap=true;
+this._cascCell.style.width=DwtMenuItem._CASCADE_DIM;
+this._cascCell.style.height=(this._style!=DwtMenuItem.SEPARATOR_STYLE)?DwtMenuItem._CASCADE_DIM:DwtMenuItem._SEPAARATOR_DIM
+}};
+DwtMenuItem.prototype._submenuItemRemoved=function(){
+if(this._dropDownEl){
+this._dropDownEl.innerHTML=""
+}};
+DwtMenuItem.prototype._popupMenu=function(n,m){
+var e=this.getMenu();
+var t=this.parent.parent;
+var d=this.getBounds();
+var r=e.shell.getSize();
+var f=e.getSize();
+var u;
+var h;
+var o;
+var c;
+var a=t.getHtmlElement();
+if(t._style==DwtMenu.BAR_STYLE){
+o=(a.style.borderLeftWidth=="")?0:parseInt(a.style.borderLeftWidth);
+u=d.x+o;
+c=(a.style.borderTopWidth=="")?0:parseInt(a.style.borderTopWidth);
+c+=(a.style.borderBottomWidth=="")?0:parseInt(a.style.borderBottonWidth);
+h=d.y+d.height+c;
+u=((u+f.x)>=r.x)?u-(u+f.x-r.x):u
+}else{
+o=(a.style.borderLeftWidth=="")?0:parseInt(a.style.borderLeftWidth);
+o+=(a.style.borderRightWidth=="")?0:parseInt(a.style.borderRightWidth);
+u=d.x+d.width+o;
+c=(a.style.borderTopWidth=="")?0:parseInt(a.style.borderTopWidth);
+h=d.y+c;
+u=((u+f.x)>=r.x)?d.x-f.x-o:u
+}
+e.popup(n,u,h,m)
+};
+DwtMenuItem.prototype._popdownMenu=function(){
+var e=this.getMenu();
+if(e){
+e.popdown()
+}};
+DwtMenuItem.prototype._isMenuPoppedUp=function(){
+var e=this.getMenu();
+return(e&&e.isPoppedUp())
+};
+DwtMenuItem.prototype.__handleItemSelect=function(e){
+this.setDisplayState(DwtControl.NORMAL);
+if(this.isStyle(DwtMenuItem.CHECK_STYLE)){
+this._setChecked(!this._itemChecked,null,true);
+e.detail=this.getChecked()?DwtMenuItem.CHECKED:DwtMenuItem.UNCHECKED
+}else{
+if(this.isStyle(DwtMenuItem.RADIO_STYLE)){
+this._setChecked(true,true);
+this.parent._radioItemSelected(this,true);
+e.detail=this.getChecked()?DwtMenuItem.CHECKED:DwtMenuItem.UNCHECKED
+}else{
+if(this.isStyle(DwtMenuItem.PUSH_STYLE)){
+if(this._menu){
+if(this._isMenuPoppedUp()){
+DwtMenu.closeActiveMenu()
+}else{
+this._popupMenu()
+}}
+return
+}}}
+if(!this.isStyle(DwtMenuItem.CASCADE_STYLE)){
+if(!this._menu||!this._menu.isPoppedUp||!this._menu.isPoppedUp()){
+DwtMenu.closeActiveMenu()
+}}};
+DwtMenuItem._mouseOverListener=function(a){
+var e=a.dwtObj;
+if(!e){
+return false
+}
+var o=e.parent;
+if(o._hoveredItem){
+var t=new DwtMouseEvent();
+t.dwtObj=o._hoveredItem;
+DwtButton._mouseOutListener(t)
+}
+if(e._style&DwtMenuItem.SEPARATOR_STYLE){
+return false
+}
+DwtButton._mouseOverListener(a,e);
+o._hoveredItem=e;
+o._popdownSubmenus();
+if(e._menu&&!a.ersatz){
+e._popupMenu(e._hoverDelay)
+}};
+DwtMenuItem._mouseOutListener=function(a){
+var t=a.dwtObj;
+var e=t&&t.getMenu();
+if(e&&e.isPoppedUp()){
+return
+}
+DwtButton._mouseOutListener(a);
+if(t){
+t.parent._hoveredItem=null
+}};
+DwtMenuItem._listeners={};
+DwtMenuItem._listeners[DwtEvent.ONMOUSEOVER]=new AjxListener(null,DwtMenuItem._mouseOverListener);
+DwtMenuItem._listeners[DwtEvent.ONMOUSEOUT]=new AjxListener(null,DwtMenuItem._mouseOutListener);
+DwtMenuItem._listeners[DwtEvent.ONMOUSEDOWN]=new AjxListener(null,DwtButton._mouseDownListener);
+DwtMenuItem._listeners[DwtEvent.ONMOUSEUP]=new AjxListener(null,DwtButton._mouseUpListener);
+DwtMenuItem._listeners[DwtEvent.ONMOUSEENTER]=new AjxListener(null,DwtMenuItem._mouseOverListener);
+DwtMenuItem._listeners[DwtEvent.ONMOUSELEAVE]=new AjxListener(null,DwtButton._mouseOutListener)
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtMenu")){
+DwtMenu=function(n){
+if(arguments.length==0){
+return
+}
+n=Dwt.getParams(arguments,DwtMenu.PARAMS);
+this._origStyle=n.style;
+var a=n.parent;
+if(a){
+if(a instanceof DwtMenuItem||a instanceof DwtButton){
+if(n.style==DwtMenu.GENERIC_WIDGET_STYLE){
+this._style=n.style
+}else{
+this._style=DwtMenu.DROPDOWN_STYLE
+}}else{
+this._style=n.style||DwtMenu.POPUP_STYLE
+}
+if(!n.posStyle){
+n.posStyle=(this._style==DwtMenu.BAR_STYLE)?DwtControl.STATIC_STYLE:DwtControl.ABSOLUTE_STYLE
+}}
+n.className=n.className||"DwtMenu";
+this._cascade=n.cascade==null||n.cascade;
+n.parent=(a instanceof DwtShell)?a:a.shell;
+DwtComposite.call(this,n);
+this.parent=a;
+var e=(this._style==DwtMenu.POPUP_STYLE||this._style==DwtMenu.DROPDOWN_STYLE);
+if(e&&!this._cascade){
+this.setScrollStyle(DwtControl.SCROLL)
+}
+if(!a){
+return
+}
+var t=AjxEnv.isIE?[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP]:[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP,DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT];
+this._setEventHdlrs(t);
+this._hasSetMouseEvents=true;
+var o=this.getHtmlElement();
+if(n.posStyle!=DwtControl.STATIC_STYLE){
+Dwt.setLocation(o,Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE)
+}
+if(this._style!=DwtMenu.COLOR_PICKER_STYLE&&this._style!=DwtMenu.CALENDAR_PICKER_STYLE&&this._style!=DwtMenu.GENERIC_WIDGET_STYLE){
+this._table=document.createElement("table");
+this._table.border=this._table.cellPadding=this._table.cellSpacing=0;
+this._table.className="DwtMenuTable";
+o.appendChild(this._table);
+this._table.backgroundColor=DwtCssStyle.getProperty(o,"background-color")
+}
+if(n.style!=DwtMenu.BAR_STYLE){
+this.setZIndex(Dwt.Z_HIDDEN);
+this._isPoppedUp=false
+}else{
+DwtMenu._activeMenuIds.add(o.id,null,true);
+this._isPoppedUp=true
+}
+this._popdownAction=new AjxTimedAction(this,this._doPopdown);
+this._popdownActionId=-1;
+this._popupAction=new AjxTimedAction(this,this._doPopup);
+this._popupActionId=-1;
+if(AjxEnv.isIE){
+if((this.parent instanceof DwtMenuItem&&this.parent.parent._style==DwtMenu.BAR_STYLE)||!(this.parent instanceof DwtMenuItem)){
+this._outsideListener=new AjxListener(null,DwtMenu._outsideMouseDownListener)
+}}
+this._menuItemsHaveChecks=false;
+this._menuItemsHaveIcons=false;
+this._menuItemsWithSubmenus=0;
+this.__currentItem=null;
+this.__preventMenuFocus=false;
+this._menuCapObj=new DwtMouseEventCapture({
+targetObj:this,id:"DwtMenu",mouseDownHdlr:DwtMenu._capMouseDownHdlr,mouseWheelHdlr:DwtMenu._capMouseWheelHdlr,hardCapture:false}
+);
+this._tabGroup=new DwtTabGroup(this.toString(),true);
+this._tabGroup.addMember(this)
+};
+DwtMenu.PARAMS=["parent","style","className","posStyle","cascade"];
+DwtMenu.prototype=new DwtComposite;
+DwtMenu.prototype.constructor=DwtMenu;
+DwtMenu.prototype.toString=function(){
+return"DwtMenu"
+};
+DwtMenu.BAR_STYLE=1;
+DwtMenu.POPUP_STYLE=2;
+DwtMenu.DROPDOWN_STYLE=3;
+DwtMenu.COLOR_PICKER_STYLE=4;
+DwtMenu.CALENDAR_PICKER_STYLE=5;
+DwtMenu.GENERIC_WIDGET_STYLE=6;
+DwtMenu.HAS_ICON="ZHasIcon";
+DwtMenu.HAS_CHECK="ZHasCheck";
+DwtMenu.HAS_SUBMENU="ZHasSubMenu";
+DwtMenu._activeMenuUp=false;
+DwtMenu._activeMenuIds=new AjxVector();
+DwtMenu._activeMenus=new AjxVector();
+DwtMenu.prototype.dispose=function(){
+this._table=null;
+DwtComposite.prototype.dispose.call(this);
+if(!(this.parent instanceof DwtShell)){
+this.shell.removeChild(this)
+}};
+DwtMenu.prototype.addPopupListener=function(e){
+this.addListener(DwtEvent.POPUP,e)
+};
+DwtMenu.prototype.removePopupListener=function(e){
+this.removeListener(DwtEvent.POPUP,e)
+};
+DwtMenu.prototype.addPopdownListener=function(e){
+this.addListener(DwtEvent.POPDOWN,e)
+};
+DwtMenu.prototype.removePopdownListener=function(e){
+this.removeListener(DwtEvent.POPDOWN,e)
+};
+DwtMenu.prototype.getItem=function(e){
+return this._children.get(e)
+};
+DwtMenu.prototype.getItemById=function(a,n){
+var e=this.getItems();
+for(var t=0;
+t<e.length;
+t++){
+var o=e[t].getData(a);
+if(o==n){
+return e[t]
+}}
+return null
+};
+DwtMenu.prototype.getItemCount=function(){
+return this._children.size()
+};
+DwtMenu.prototype.getItems=function(){
+return this._children.getArray()
+};
+DwtMenu.prototype.getSelectedItem=function(n){
+var e=this._children.getArray();
+for(var o=0;
+o<e.length;
+o++){
+var t=e[o];
+if((n==null||(t._style&&n!=0))&&t.getChecked()){
+return t
+}}
+return null
+};
+DwtMenu.prototype.isPoppedUp=function(){
+return this._isPoppedUp
+};
+DwtMenu.prototype.popup=function(a,e,o,t){
+if(this._style==DwtMenu.BAR_STYLE){
+return
+}
+if(this._popdownActionId!=-1){
+AjxTimedAction.cancelAction(this._popdownActionId);
+this._popdownActionId=-1
+}else{
+if(this._isPoppedUp||(this._popupActionId!=-1&&a&&a>0)){
+return
+}else{
+if(this._popupActionId!=-1){
+AjxTimedAction.cancelAction(this._popupActionId);
+this._popupActionId=-1
+}}
+if(!a){
+this._doPopup(e,o,t)
+}else{
+this._popupAction.args=[e,o,t];
+this._popupActionId=AjxTimedAction.scheduleAction(this._popupAction,a)
+}}};
+DwtMenu.prototype.popdown=function(e){
+if(this._style==DwtMenu.BAR_STYLE){
+return
+}
+if(this._popupActionId!=-1){
+AjxTimedAction.cancelAction(this._popupActionId);
+this._popupActionId=-1
+}else{
+if(!this._isPoppedUp||this._popdownActionId!=-1){
+return
+}
+if(e==null||e==0){
+this._doPopdown()
+}else{
+this._popdownActionId=AjxTimedAction.scheduleAction(this._popdownAction,e)
+}}};
+DwtMenu.prototype.render=function(m,d){
+var p=this.shell.getSize();
+var q=this.getSize();
+p.y-=10+(AjxEnv.isIE?20:0);
+p.x-=28;
+var t=(this._style==DwtMenu.POPUP_STYLE||this._style==DwtMenu.DROPDOWN_STYLE);
+var w=this._cascade;
+if(t&&w){
+var z=p.y;
+var T=null;
+var u=this._table.rows;
+var a=u.length;
+var g=q.y;
+var c=z-25;
+for(var k=a-1;
+k>=0;
+k--){
+g-=Dwt.getSize(u[k]).y;
+if(g<c){
+break
+}}
+var h=k+1;
+for(var v=h;
+v<a;
+v++){
+var r=u[(v-h)%h];
+var e=r.insertCell(-1);
+e.className="DwtMenuCascadeCell";
+var s=u[v].cells[0].firstChild;
+while(s!=null){
+e.appendChild(s);
+s=s.nextSibling
+}}
+for(v=u.length-1;
+v>=h;
+v--){
+this._table.deleteRow(h)
+}
+var n=a%h;
+if(n>0){
+for(var v=n;
+v<h;
+v++){
+var r=u[v];
+var e=r.insertCell(-1);
+e.className="DwtMenuCascadeCell";
+e.empty=true;
+e.innerHTML="&nbsp;"
+}}
+q=this.getSize();
+if(T){
+d=T-q.y
+}}else{
+if(t&&!w){
+if(d+q.y>p.y){
+q.y=p.y-d
+}}}
+var O=m+q.x>=p.x?p.x-q.x:m;
+var T=t&&d+q.y>=p.y?p.y-q.y:d;
+this.setLocation(O,T);
+var A="auto";
+var o=(t&&w)||d+q.y<p.y-5?"auto":p.y-d-5;
+this.setSize(A,o);
+if((AjxEnv.isGeckoBased||AjxEnv.isSafari||(this._origStyle==DwtMenu.CALENDAR_PICKER_STYLE))&&this._table){
+var f=this.getHtmlElement();
+f.style.width=(q.x+(t&&!w?10:0))+"px"
+}};
+DwtMenu.prototype.getKeyMapName=function(){
+return"DwtMenu"
+};
+DwtMenu.prototype.handleKeyAction=function(e,t){
+switch(this._style){
+case DwtMenu.BAR_STYLE:case DwtMenu.POPUP_STYLE:case DwtMenu.DROPDOWN_STYLE:break;
+default:return false
+}
+switch(e){
+case DwtKeyMap.SELECT_NEXT:case DwtKeyMap.SELECT_PREV:this.setSelectedItem(e==DwtKeyMap.SELECT_NEXT);
+break;
+case DwtKeyMap.SELECT:if(this.__currentItem){
+this.__currentItem._emulateSingleClick()
+}
+break;
+case DwtKeyMap.SUBMENU:if(this.__currentItem&&this.__currentItem._menu){
+this.__currentItem._popupMenu(0,true)
+}
+break;
+case DwtKeyMap.PARENTMENU:if(this.parent instanceof DwtMenuItem){
+this.popdown(0)
+}
+break;
+case DwtKeyMap.CANCEL:if(this.__currentItem){
+var a=new DwtMouseEvent();
+this._setMouseEvent(a,{
+dwtObj:this.__currentItem}
+);
+this.notifyListeners(DwtEvent.ONMOUSEOUT,a);
+this.__currentItem=null
+}
+this.popdown(0);
+break;
+default:return false
+}
+return true
+};
+DwtMenu.prototype._focus=function(){};
+DwtMenu.prototype._blur=function(){};
+DwtMenu.prototype.setAssociatedObj=function(e){
+this._associatedObj=e
+};
+DwtMenu.prototype.setAssociatedElementId=function(e){
+this._associatedElId=e
+};
+DwtMenu.prototype.checkItem=function(s,n,a){
+var e=this._children.getArray();
+for(var t=0;
+t<e.length;
+t++){
+var o=e[t];
+if(!(o.isStyle(DwtMenuItem.CHECK_STYLE)||o.isStyle(DwtMenuItem.RADIO_STYLE))){
+continue
+}
+var r=o.getData(s);
+if(r==n){
+o.setChecked(true,a)
+}}};
+DwtMenu.prototype.setSelectedItem=function(t){
+var e=this.__currentItem;
+if(typeof(t)=="boolean"){
+e=!e?this._children.get(0):t?this._children.getNext(e):this._children.getPrev(e)
+}else{
+e=this._children.get(t)
+}
+while(e&&(e.isStyle(DwtMenuItem.SEPARATOR_STYLE)||!e.getEnabled()||!e.getVisible())){
+e=(t===false)?this._children.getPrev(e):this._children.getNext(e)
+}
+if(!e){
+return
+}
+var a=new DwtMouseEvent();
+if(this.__currentItem){
+this._setMouseEvent(a,{
+dwtObj:this.__currentItem}
+);
+this.__currentItem.notifyListeners(DwtEvent.ONMOUSEOUT,a)
+}
+this._setMouseEvent(a,{
+dwtObj:e}
+);
+e.notifyListeners(DwtEvent.ONMOUSEOVER,a);
+this.__currentItem=e
+};
+DwtMenu.prototype.clearExternallySelectedItems=function(){
+if(this._externallySelected!=null){
+this._externallySelected._deselect();
+this._externallySelected=null
+}};
+DwtMenu.prototype.removeChild=function(a){
+if(this._table){
+if(this._style==DwtMenu.BAR_STYLE){
+var e=a.getHtmlElement().parentNode;
+this._table.rows[0].deleteCell(Dwt.getCellIndex(e))
+}else{
+var t=a.getHtmlElement();
+if(t){
+this._table.deleteRow(t.parentNode.parentNode.rowIndex)
+}}}
+this._children.remove(a)
+};
+DwtMenu.prototype.addChild=function(e){
+DwtComposite.prototype.addChild.apply(this,arguments);
+if(Dwt.instanceOf(e,"DwtColorPicker")||Dwt.instanceOf(e,"DwtCalendar")||(this._style==DwtMenu.GENERIC_WIDGET_STYLE)){
+this._addItem(e)
+}};
+DwtMenu.prototype._addItem=function(o,t){
+if(this._style==DwtMenu.COLOR_PICKER_STYLE||this._style==DwtMenu.CALENDAR_PICKER_STYLE||this._style==DwtMenu.GENERIC_WIDGET_STYLE){
+return
+}
+var s;
+var e;
+if(this._style==DwtMenu.BAR_STYLE){
+var n=this._table.rows;
+s=(n.length!=0)?n[0]:this._table.insertRow(0);
+if(t==null||t>s.cells.length){
+t=n.cells.length
+}
+e=s.insertCell(t);
+e.align="center";
+e.vAlign="middle";
+var a=s.insertCell(-1);
+a.nowrap=true;
+a.width="7px"
+}else{
+if(o.isStyle&&(o.isStyle(DwtMenuItem.CHECK_STYLE)||o.isStyle(DwtMenuItem.RADIO_STYLE))){
+this._checkItemAdded()
+}
+if(t==null||t>this._table.rows.length){
+t=-1
+}
+s=this._table.insertRow(t);
+e=s.insertCell(0)
+}
+e.noWrap=true;
+e.appendChild(o.getHtmlElement())
+};
+DwtMenu.prototype._radioItemSelected=function(r,n){
+var t=r._radioGroupId;
+var s=this._children.size();
+var e=this._children.getArray();
+for(var o=0;
+o<s;
+o++){
+if(e[o]!=r&&e[o].isStyle(DwtMenuItem.RADIO_STYLE)&&e[o]._radioGroupId==t&&e[o]._itemChecked){
+e[o].setChecked(false,n);
+break
+}}};
+DwtMenu.prototype._menuHasCheckedItems=function(){
+return this._menuItemsHaveChecks
+};
+DwtMenu.prototype._menuHasItemsWithIcons=function(){
+return this._menuItemsHaveIcons
+};
+DwtMenu.prototype._menuHasSubmenus=function(){
+return(this._menuItemsWithSubmenus>0)
+};
+DwtMenu.prototype._iconItemAdded=function(e){
+if(!this._menuItemsHaveIcons){
+Dwt.addClass(this.getHtmlElement(),DwtMenu.HAS_ICON)
+}
+this._menuItemsHaveIcons=true
+};
+DwtMenu.prototype._checkItemAdded=function(e){
+if(!this._menuItemsHaveChecks){
+Dwt.addClass(this.getHtmlElement(),DwtMenu.HAS_CHECK)
+}
+this._menuItemsHaveChecks=true
+};
+DwtMenu.prototype._submenuItemAdded=function(){
+Dwt.addClass(this.getHtmlElement(),DwtMenu.HAS_SUBMENU);
+this._menuItemsWithSubmenus++
+};
+DwtMenu.prototype._submenuItemRemoved=function(){
+if(this._menuItemsWithSubmenus==1){
+var o=this._children.size();
+var e=this._children.getArray();
+for(var t=0;
+t<o;
+t++){
+e[t]._submenuItemRemoved()
+}}
+this._menuItemsWithSubmenus--;
+if(this._menuItemsWithSubmenus==0){
+Dwt.delClass(this.getHtmlElement(),DwtMenu.HAS_SUBMENU)
+}};
+DwtMenu.prototype._popdownSubmenus=function(){
+var o=this._children.size();
+var e=this._children.getArray();
+for(var t=0;
+t<o;
+t++){
+e[t]._popdownMenu()
+}};
+DwtMenu.prototype.dontStealFocus=function(e){
+if(e==null){
+e=true
+}
+this.__preventMenuFocus=!!e
+};
+DwtMenu.prototype._doPopup=function(e,r,n){
+this.render(e,r);
+var t=(this._style==DwtMenu.POPUP_STYLE||this._style==DwtMenu.DROPDOWN_STYLE);
+var a=this._cascade;
+this.setScrollStyle(t&&a?Dwt.CLIP:Dwt.SCROLL);
+this.notifyListeners(DwtEvent.POPUP,this);
+var o=this.shell.getToolTip();
+if(o){
+o.popdown()
+}
+var s=DwtBaseDialog.getActiveDialog()?Dwt.Z_DIALOG_MENU:Dwt.Z_MENU;
+this.setZIndex(s);
+this._popupActionId=-1;
+this._isPoppedUp=true;
+if(AjxEnv.isIE&&this._outsideListener){
+this.shell._setEventHdlrs([DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEWHEEL]);
+this.shell.addListener(DwtEvent.ONMOUSEDOWN,this._outsideListener);
+this.shell.addListener(DwtEvent.ONMOUSEWHEEL,this._outsideListener)
+}
+if(!DwtMenu._activeMenu){
+DwtMenu._activeMenu=this;
+DwtMenu._activeMenuUp=true;
+if(AjxEnv.isIE){
+DwtEventManager.addListener(DwtEvent.ONMOUSEDOWN,DwtMenu._outsideMouseDownListener);
+DwtEventManager.addListener(DwtEvent.ONMOUSEWHEEL,DwtMenu._outsideMouseDownListener)
+}}
+DwtMenu._activeMenuIds.add(this._htmlElId,null,true);
+DwtMenu._activeMenuIds.sort();
+DwtMenu._activeMenus.add(this,null,true);
+if(!this._menuCapObj.capturing()){
+this._menuCapObj.capture();
+this._capturing=true
+}else{
+this._capturing=false
+}
+if(!this.__preventMenuFocus){
+DwtShell.getShell(window).getKeyboardMgr().pushTabGroup(this._tabGroup)
+}
+if(n){
+this.handleKeyAction(DwtKeyMap.SELECT_NEXT)
+}};
+DwtMenu.prototype.getSize=function(e){
+if(this._table){
+return Dwt.getSize(this._table,e)
+}
+return DwtComposite.prototype.getSize.call(this,e)
+};
+DwtMenu.prototype._doPopdown=function(){
+var c=this._children.getArray();
+var m=this._children.size();
+for(var n=0;
+n<m;
+n++){
+if((c[n] instanceof DwtMenuItem)&&!(c[n].isStyle(DwtMenuItem.SEPARATOR_STYLE))){
+c[n]._popdownMenu()
+}}
+this.setZIndex(Dwt.Z_HIDDEN);
+this.setLocation(Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
+this.notifyListeners(DwtEvent.POPDOWN,this);
+if(AjxEnv.isIE&&this._outsideListener){
+this.shell._setEventHdlrs([DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEWHEEL],true);
+this.shell.removeListener(DwtEvent.ONMOUSEDOWN,this._outsideListener);
+this.shell.removeListener(DwtEvent.ONMOUSEWHEEL,this._outsideListener)
+}
+if(DwtMenu._activeMenu==this){
+DwtMenu._activeMenu=null;
+DwtMenu._activeMenuUp=false;
+if(AjxEnv.isIE){
+DwtEventManager.removeListener(DwtEvent.ONMOUSEDOWN,DwtMenu._outsideMouseDownListener);
+DwtEventManager.removeListener(DwtEvent.ONMOUSEWHEEL,DwtMenu._outsideMouseDownListener)
+}}
+DwtMenu._activeMenuIds.remove(this._htmlElId);
+DwtMenu._activeMenus.remove(this);
+this._popdownActionId=-1;
+this._isPoppedUp=false;
+if(this._capturing&&(DwtMouseEventCapture.getId()=="DwtMenu")){
+this._menuCapObj.release();
+this._capturing=false
+}
+if((this._style==DwtMenu.POPUP_STYLE||this._style==DwtMenu.DROPDOWN_STYLE)&&this._table.rows.length&&this._table.rows[0].cells.length){
+var t=this._table.rows[0].cells.length;
+var r=this._table.rows.length;
+for(var n=1;
+n<t;
+n++){
+for(var o=0;
+o<r;
+o++){
+var d=this._table.rows[o].cells[n];
+if(!d.empty){
+var e=d.firstChild;
+var u=this._table.insertRow(this._table.rows.length);
+var d=u.insertCell(0);
+while(e!=null){
+d.appendChild(e);
+e=e.nextSibling
+}}}}
+for(var o=0;
+o<r;
+o++){
+var u=this._table.rows[o];
+for(var n=u.cells.length-1;
+n>0;
+n--){
+u.deleteCell(n)
+}}}
+this.__currentItem=null;
+if(this._hoveredItem){
+var h=new DwtMouseEvent();
+h.dwtObj=this._hoveredItem;
+DwtButton._mouseOutListener(h)
+}
+DwtShell.getShell(window).getKeyboardMgr().popTabGroup(this._tabGroup)
+};
+DwtMenu.prototype._getActiveItem=function(){
+var e=this._children.getArray();
+var o=this._children.size();
+for(var t=0;
+t<o;
+t++){
+if(e[t]._isMenuPoppedUp()){
+return e[t]
+}}
+return null
+};
+DwtMenu._outsideMouseDownListener=function(a){
+if(DwtMenu._activeMenuUp){
+var n=DwtMenu._activeMenu;
+var e=DwtControl.getTargetControl(a);
+if(n._associatedObj&&n._associatedObj==e){
+return false
+}
+var s=n._htmlElId;
+var o=DwtUiEvent.getTarget(a);
+while(o!=null){
+if(o.id&&o.id!=""&&(o.id==s||o.id==n._associatedElId||DwtMenu._activeMenuIds.binarySearch(o.id)!=-1)){
+return false
+}
+o=o.parentNode
+}
+n.popdown();
+var t=null;
+do{
+t=DwtMenu._activeMenus.getLast();
+if(t!=null&&t instanceof DwtMenu){
+t.popdown()
+}}
+while(t!=null)
+}
+a._stopPropagation=false;
+a._returnValue=true;
+return true
+};
+DwtMenu._capMouseDownHdlr=function(t){
+var a=DwtMouseEventCapture.getTargetObj();
+var e=DwtShell.mouseEvent;
+e.setFromDhtmlEvent(t);
+DwtMenu._outsideMouseDownListener(e);
+DwtUiEvent.setBehaviour(t,false,true);
+return true
+};
+DwtMenu._capMouseWheelHdlr=function(e){
+return DwtMenu._capMouseDownHdlr(e)
+};
+DwtMenu.menuShowing=function(){
+return DwtMenu._activeMenuUp
+};
+DwtMenu.closeActiveMenu=function(){
+if(DwtMenu._activeMenuUp){
+DwtMenu._activeMenu.popdown()
+}}
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtInputField")){
+DwtInputField=function(h){
+if(arguments.length==0){
+return
+}
+this._origClassName=h.className?h.className:"DwtInputField";
+this._errorClassName=this._origClassName+"-Error";
+this._hintClassName=this._origClassName+"-hint";
+this._disabledClassName=this._origClassName+"-disabled";
+this._errorHintClassName=this._origClassName+"-errorhint";
+DwtComposite.call(this,h);
+this._inputEventHandlers={};
+this._type=h.type?h.type:DwtInputField.STRING;
+this._rows=h.rows?h.rows:1;
+this._size=h.size;
+this._errorIconStyle=h.errorIconStyle?h.errorIconStyle:h.validator?DwtInputField.ERROR_ICON_RIGHT:DwtInputField.ERROR_ICON_NONE;
+this._validationStyle=h.validationStyle?h.validationStyle:DwtInputField.ONEXIT_VALIDATION;
+this._hasError=false;
+this._hintIsVisible=false;
+this._hint=h.hint;
+var r=h.inputID||Dwt.getNextId();
+var s=Dwt.getNextId();
+var n=this.getHtmlElement();
+if(this._errorIconStyle==DwtInputField.ERROR_ICON_NONE){
+if(h.forceMultiRow||(h.rows&&h.rows>1)){
+var e=["<textarea id='",r,"' rows=",h.rows];
+var o=e.length;
+if(h.forceMultiRow||h.size){
+e[o++]=" cols=";
+e[o++]=h.size||1
+}
+if(h.wrap){
+e[o++]=" wrap=";
+e[o++]=h.wrap
+}
+e[o++]="></textarea>";
+n.innerHTML=e.join("")
+}else{
+n.innerHTML=["<input id='",r,"'>"].join("")
+}}else{
+var e=["<table cellspacing='0' cellpadding='0'><tr>"];
+var o=1;
+if(this._errorIconStyle==DwtInputField.ERROR_ICON_LEFT){
+e[o++]=["<td style='padding-right:2px;'id='",s,"'></td>"].join("")
+}
+e[o++]=["<td>","<input id='",r,"'>","</td>"].join("");
+if(this._errorIconStyle==DwtInputField.ERROR_ICON_RIGHT){
+e[o++]=["<td style='padding-left:2px;' id='",s,"'></td>"].join("")
+}
+e[o++]="</tr></table>";
+n.innerHTML=e.join("");
+if(this._errorIconStyle!=DwtInputField.ERROR_ICON_NONE){
+this._errorIconTd=document.getElementById(s);
+this._errorIconTd.vAlign="middle";
+this._errorIconTd.innerHTML=DwtInputField._NOERROR_ICON_HTML
+}}
+this._tabGroup=new DwtTabGroup(this._htmlElId);
+if(h.forceMultiRow||this._rows>1){
+this._inputField=document.getElementById(r);
+this._inputField.onkeyup=DwtInputField._keyUpHdlr;
+this._inputField.onblur=DwtInputField._blurHdlr;
+this._inputField.onfocus=DwtInputField._focusHdlr;
+if(h.size){
+this._inputField.size=h.size
+}
+if(h.maxLen){
+this._inputField.maxLength=this._maxLen=h.maxLen
+}
+this._inputField.value=h.initialValue||"";
+this._tabGroup.addMember(this._inputField)
+}else{
+var t=document.getElementById(r);
+var a=this.__createInputEl(h);
+if(AjxEnv.isCamino){
+t.parentNode.style.overflow="hidden"
+}
+t.parentNode.replaceChild(a,t)
+}
+this.setValidatorFunction(h.validatorCtxtObj,h.validator);
+this._setMouseEventHdlrs(false);
+this._setKeyPressEventHdlr(false);
+if(h.required!=null){
+this.setRequired(h.required)
+}};
+DwtInputField.prototype=new DwtComposite;
+DwtInputField.prototype.constructor=DwtInputField;
+DwtInputField.prototype.toString=function(){
+return"DwtInputField"
+};
+DwtInputField.ERROR_ICON_LEFT=1;
+DwtInputField.ERROR_ICON_RIGHT=2;
+DwtInputField.ERROR_ICON_NONE=3;
+DwtInputField.CONTINUAL_VALIDATION=1;
+DwtInputField.ONEXIT_VALIDATION=2;
+DwtInputField.MANUAL_VALIDATION=3;
+DwtInputField.NUMBER=1;
+DwtInputField.INTEGER=2;
+DwtInputField.FLOAT=3;
+DwtInputField.STRING=4;
+DwtInputField.PASSWORD=5;
+DwtInputField.DATE=6;
+DwtInputField._ERROR_ICON_HTML=AjxImg.getImageHtml("ClearSearch");
+DwtInputField._NOERROR_ICON_HTML=AjxImg.getImageHtml("Blank_9");
+DwtInputField.prototype.dispose=function(){
+this._errorIconTd=null;
+this._inputField=null;
+DwtComposite.prototype.dispose.call(this)
+};
+DwtInputField.prototype.getTabGroupMember=function(){
+return this._tabGroup
+};
+DwtInputField.prototype.setHandler=function(t,e){
+if(!this._checkState()){
+return
+}
+this._inputEventHandlers[t]=e;
+Dwt.setHandler(this.getInputElement(),t,e)
+};
+DwtInputField.prototype.setInputType=function(a){
+if(a!=this._type&&this._rows==1){
+this._type=a;
+if(AjxEnv.isIE){
+var e=this._inputField;
+var t=this.__createInputEl();
+e.parentNode.replaceChild(t,e)
+}else{
+this._inputField.type=this._type!=DwtInputField.PASSWORD?"text":"password"
+}}};
+DwtInputField.prototype.setValidatorFunction=function(t,e){
+if(e){
+this._validator=e;
+this._validatorObj=t
+}else{
+switch(this._type){
+case DwtInputField.NUMBER:this._validator=DwtInputField.validateNumber;
+break;
+case DwtInputField.INTEGER:this._validator=DwtInputField.validateInteger;
+break;
+case DwtInputField.FLOAT:this._validator=DwtInputField.validateFloat;
+break;
+case DwtInputField.STRING:case DwtInputField.PASSWORD:this._validator=DwtInputField.validateString;
+break;
+case DwtInputField.DATE:this._validator=DwtInputField.validateDate;
+break;
+default:this._validator=DwtInputField.validateAny
+}}};
+DwtInputField.prototype.setValidatorRegExp=function(e,t){
+this._validator=e;
+this._validatorObj=null;
+this._errorString=t||""
+};
+DwtInputField.prototype.setValidationCallback=function(e){
+this._validationCallback=e
+};
+DwtInputField.prototype.getInputElement=function(){
+return this._inputField
+};
+DwtInputField.prototype.getValue=function(){
+return this._hintIsVisible?"":this._inputField.value
+};
+DwtInputField.prototype.setValue=function(t,e){
+t=t||"";
+this._inputField.value=t;
+if(!e){
+t=this._validateInput(t);
+if(t!=null){
+this._inputField.value=t
+}}
+if(this._hintIsVisible&&t){
+this._hideHint(t)
+}else{
+if(!t){
+this._showHint()
+}}};
+DwtInputField.prototype.setHint=function(t){
+var e=this._hint;
+this._hint=t;
+if(this._hintIsVisible){
+this.getInputElement().value=t;
+if(!t){
+this._hintIsVisible=false;
+this._updateClassName()
+}}else{
+if(this._inputField.value==""){
+this._showHint()
+}}};
+DwtInputField.prototype.setValidNumberRange=function(t,e){
+this._minNumVal=t;
+this._maxNumVal=e;
+var a=this._validateInput(this.getValue());
+if(a!=null){
+this.setValue(a)
+}};
+DwtInputField.prototype.setValidStringLengths=function(t,e){
+this._minLen=t||0;
+if(e!=null){
+this._inputField.maxLength=e;
+this._maxLen=e
+}};
+DwtInputField.prototype.setNumberPrecision=function(e){
+this._decimals=e
+};
+DwtInputField.prototype.setReadOnly=function(e){
+this._inputField.setAttribute("readonly",(e==null?true:e))
+};
+DwtInputField.prototype.setRequired=function(t){
+var e=t==null?true:t;
+if(this._required!=e){
+this._required=e;
+this.validate()
+}};
+DwtInputField.prototype.getEnabled=function(){
+return !this.getInputElement().disabled
+};
+DwtInputField.prototype.setEnabled=function(e){
+DwtControl.prototype.setEnabled.call(this,e);
+this.getInputElement().disabled=!e;
+this._validateInput(this.getValue())
+};
+DwtInputField.prototype.focus=function(){
+if(this.getEnabled()){
+this._hasFocus=true;
+this.getInputElement().focus()
+}};
+DwtInputField.prototype.blur=function(){
+this.getInputElement().blur()
+};
+DwtInputField.prototype.setVisible=function(e){
+DwtComposite.prototype.setVisible.apply(this,arguments);
+Dwt.setVisible(this.getInputElement(),e)
+};
+DwtInputField.prototype.isValid=function(){
+if(!this.getEnabled()){
+return this.getValue()
+}
+try{
+if(typeof this._validator=="function"){
+return this._validatorObj?this._validator.call(this._validatorObj,this.getValue(),this):this._validator(this.getValue())
+}else{
+return this._validator.test(this._inputField.value)
+}}
+catch(e){
+if(typeof e=="string"){
+return null
+}else{
+throw e
+}}};
+DwtInputField.prototype.validate=function(){
+var e=this._validateInput(this.getValue());
+if(e!=null){
+this.setValue(e);
+return true
+}else{
+return false
+}};
+DwtInputField.validateNumber=function(e){
+var t=new Number(e);
+if(isNaN(t)||(Math.round(t)!=t)){
+throw AjxMsg.notAnInteger
+}
+return DwtInputField.validateFloat.call(this,e)
+};
+DwtInputField.validateInteger=function(e){
+var t=new Number(e);
+if(isNaN(t)||(Math.round(t)!=t)||(t.toString()!=e)){
+throw AjxMsg.notAnInteger
+}
+if(this._minNumVal&&e<this._minNumVal){
+throw AjxMessageFormat.format(AjxMsg.numberLessThanMin,this._minNumVal)
+}
+if(this._maxNumVal&&e>this._maxNumVal){
+throw AjxMessageFormat.format(AjxMsg.numberMoreThanMax,this._maxNumVal)
+}
+return e
+};
+DwtInputField.validateFloat=function(e){
+if(this._required&&e==""){
+throw AjxMsg.valueIsRequired
+}
+var o=new Number(e);
+if(isNaN(o)){
+throw AjxMsg.notANumber
+}
+if(this._minNumVal&&e<this._minNumVal){
+throw AjxMessageFormat.format(AjxMsg.numberLessThanMin,this._minNumVal)
+}
+if(this._maxNumVal&&e>this._maxNumVal){
+throw AjxMessageFormat.format(AjxMsg.numberMoreThanMax,this._maxNumVal)
+}
+if(this._decimals!=null){
+var t=o.toString();
+var a=t.indexOf(".");
+if(a==-1){
+a=t.length
+}
+e=o.toPrecision(a+this._decimals)
+}else{
+e=o.toString()
+}
+return e
+};
+DwtInputField.validateString=function(e){
+if(this._required&&e==""){
+throw AjxMsg.valueIsRequired
+}
+if(this._minLen!=null&&e.length<this._minLen){
+throw AjxMessageFormat.format(AjxMsg.stringTooShort,this._minLen)
+}
+if(this._maxLen!=null&&e.length>this._maxLen){
+throw AjxMessageFormat.format(AjxMsg.stringTooLong,this._maxLen)
+}
+return e
+};
+DwtInputField.validateDate=function(e){
+if(this._required&&e==""){
+throw AjxMsg.valueIsRequired
+}
+if(AjxDateUtil.simpleParseDateStr(e)==null){
+throw AjxMsg.invalidDatetimeString
+}
+return e
+};
+DwtInputField.validateEmail=function(e){
+if(this._required&&e==""){
+throw AjxMsg.valueIsRequired
+}
+if(!AjxEmailAddress.isValid(e)){
+throw AjxMsg.invalidEmailAddr
+}
+return e
+};
+DwtInputField.validateAny=function(e){
+if(this._required&&e==""){
+throw AjxMsg.valueIsRequired
+}
+return e
+};
+DwtInputField.prototype._validateRegExp=function(e){
+if(this._required&&e==""){
+throw AjxMsg.valueIsRequired
+}
+if(this._regExp&&!this._regExp.test(e)){
+throw this._errorString
+}
+return e
+};
+DwtInputField._keyUpHdlr=function(t){
+var e=DwtShell.keyEvent;
+e.setFromDhtmlEvent(t,true);
+var o=e.dwtObj;
+var a=e.keyCode;
+if(o.notifyListeners(DwtEvent.ONKEYUP,e)){
+return true
+}
+var n=null;
+if((a==13||a==9)&&o._validationStyle==DwtInputField.ONEXIT_VALIDATION){
+n=o._validateInput(o.getValue())
+}else{
+if(o._validationStyle==DwtInputField.CONTINUAL_VALIDATION){
+n=o._validateInput(o.getValue())
+}}
+if(n!=null&&n!=o.getValue()){
+o.setValue(n)
+}
+return true
+};
+DwtInputField._blurHdlr=function(e){
+var t=DwtControl.getTargetControl(e);
+if(t){
+t._hasFocus=false;
+if(t._validationStyle==DwtInputField.ONEXIT_VALIDATION){
+var a=t._validateInput(t.getValue());
+if(a!=null){
+t.setValue(a)
+}}
+if(!t._hintIsVisible&&t._hint){
+t._showHint()
+}}};
+DwtInputField._focusHdlr=function(e){
+var t=DwtControl.getTargetControl(e);
+if(t){
+DwtShell.getShell(window).getKeyboardMgr().grabFocus(t.getTabGroupMember());
+if(t._hintIsVisible){
+t._hideHint("")
+}}};
+DwtInputField.prototype._hideHint=function(e){
+this.getInputElement().value=e;
+this._hintIsVisible=false;
+this._updateClassName()
+};
+DwtInputField.prototype._showHint=function(){
+if(this._hint){
+var e=this.getInputElement();
+if(!e.value){
+e.value=this._hint;
+this._hintIsVisible=true;
+this._updateClassName()
+}}};
+DwtInputField.prototype._updateClassName=function(){
+var e;
+if(!this.getEnabled()){
+e=this._disabledClassName
+}else{
+if(this._hasError){
+if(this._hintIsVisible&&!this._hasFocus){
+e=this._errorHintClassName
+}else{
+e=this._errorClassName
+}}else{
+if(this._hintIsVisible&&!this._hasFocus){
+e=this._hintClassName
+}else{
+e=this._origClassName
+}}}
+this.getHtmlElement().className=e
+};
+DwtInputField.prototype._validateInput=function(a){
+var n=true;
+var o;
+var t;
+if(!this.getEnabled()){
+o=this.getValue()
+}else{
+try{
+if(typeof this._validator=="function"){
+o=a=this._validatorObj?this._validator.call(this._validatorObj,a,this):this._validator(a)
+}else{
+if(!this._validator.test(a)){
+t=this._errorString
+}}}
+catch(e){
+if(typeof e=="string"){
+t=e
+}else{
+throw e
+}}}
+if(t){
+this._hasError=true;
+if(this._errorIconTd){
+this._errorIconTd.innerHTML=DwtInputField._ERROR_ICON_HTML
+}
+this.setToolTipContent(t);
+n=false;
+o=null
+}else{
+this._hasError=false;
+if(this._errorIconTd){
+this._errorIconTd.innerHTML=DwtInputField._NOERROR_ICON_HTML
+}
+this.setToolTipContent(null);
+n=true
+}
+this._updateClassName();
+if(this._validationCallback){
+this._validationCallback.run(this,n,a)
+}
+return o
+};
+DwtInputField.prototype._focusByMouseUpEvent=function(){
+if(this.getEnabled()){
+this._hasFocus=true
+}};
+DwtInputField.prototype._replaceElementHook=function(t,a,e,o){
+a=this.getInputElement();
+DwtControl.prototype._replaceElementHook.call(this,t,a,e,o);
+if(t.id){
+a.id=t.id
+}
+if(t.size){
+a.size=t.size
+}
+if(t.title){
+this.setHint(t.title)
+}};
+DwtInputField.prototype.__createInputEl=function(r){
+var t=this._inputField;
+if(t){
+for(var n in this._inputEventHandlers){
+t.removeAttribute(n)
+}}
+var s=this._type!=DwtInputField.PASSWORD?"text":"password";
+var o=document.createElement(AjxEnv.isIE?["<INPUT type='",s,"'>"].join(""):"INPUT");
+if(!AjxEnv.isIE){
+o.type=s
+}
+this._inputField=o;
+var a=r?r.size:t.size;
+var e=r?r.maxLen:t.maxLength;
+o.autocomplete="off";
+if(a){
+o.size=a
+}
+if(e){
+o.maxLength=e
+}
+o.value=(r?r.initialValue:t.value)||"";
+o.readonly=t?t.readonly:false;
+o.onkeyup=DwtInputField._keyUpHdlr;
+o.onblur=DwtInputField._blurHdlr;
+o.onfocus=DwtInputField._focusHdlr;
+for(var n in this._inputEventHandlers){
+o[n]=this._inputEventHandlers[n]
+}
+this._tabGroup.removeAllMembers();
+this._tabGroup.addMember(o);
+return o
+}
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtBaseDialog")){
+DwtBaseDialog=function(t){
+if(arguments.length==0){
+return
+}
+t=Dwt.getParams(arguments,DwtBaseDialog.PARAMS);
+var e=t.parent;
+if(!(e instanceof DwtShell)){
+throw new DwtException("DwtBaseDialog parent must be a DwtShell",DwtException.INVALIDPARENT,"DwtDialog")
+}
+t.className=t.className||"DwtBaseDialog";
+t.posStyle=DwtControl.ABSOLUTE_STYLE;
+this._title=t.title||"";
+DwtComposite.call(this,t);
+this._shell=e;
+this._zIndex=t.zIndex||Dwt.Z_DIALOG;
+this._mode=t.mode||DwtBaseDialog.MODAL;
+this._loc=new DwtPoint();
+if(t.loc){
+this._loc.x=t.loc.x;
+this._loc.y=t.loc.y
+}else{
+this._loc.x=this._loc.y=Dwt.LOC_NOWHERE
+}
+this._tabGroup=new DwtTabGroup(this.toString(),true);
+this._dragHandleId=t.dragHandleId||this._htmlElId+"_handle";
+this._createHtml();
+this._initializeDragging(this._dragHandleId);
+if(t.view){
+this.setView(t.view)
+}
+this.setZIndex(Dwt.Z_HIDDEN);
+this._position(DwtBaseDialog.__nowhereLoc)
+};
+DwtBaseDialog.PARAMS=["parent","className","title","zIndex","mode","loc","view","dragHandleId"];
+DwtBaseDialog.prototype=new DwtComposite;
+DwtBaseDialog.prototype.constructor=DwtBaseDialog;
+DwtBaseDialog.prototype.toString=function(){
+return"DwtBaseDialog"
+};
+DwtBaseDialog.MODELESS=1;
+DwtBaseDialog.MODAL=2;
+DwtBaseDialog.__nowhereLoc=new DwtPoint(Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
+DwtBaseDialog.prototype.TEMPLATE="dwt.Widgets#DwtBaseDialog";
+DwtBaseDialog.prototype.CONTROLS_TEMPLATE=null;
+DwtBaseDialog.prototype.addPopupListener=function(e){
+this.addListener(DwtEvent.POPUP,e)
+};
+DwtBaseDialog.prototype.removePopupListener=function(e){
+this.removeListener(DwtEvent.POPUP,e)
+};
+DwtBaseDialog.prototype.addPopdownListener=function(e){
+this.addListener(DwtEvent.POPDOWN,e)
+};
+DwtBaseDialog.prototype.removePopdownListener=function(e){
+this.removeListener(DwtEvent.POPDOWN,e)
+};
+DwtBaseDialog.prototype.popup=function(t){
+if(this._poppedUp){
+return
+}
+this.cleanup(true);
+var e=this._zIndex;
+if(this._mode==DwtBaseDialog.MODAL){
+e=this._setModalEffect(e)
+}
+this._shell._veilOverlay.activeDialogs.push(this);
+if(t){
+this._loc.x=t.x;
+this._loc.y=t.y
+}
+this._position(t);
+this._resetTabFocus();
+this.setZIndex(e);
+this._poppedUp=true;
+var a=this._shell.getKeyboardMgr();
+a.pushTabGroup(this._tabGroup);
+a.pushDefaultHandler(this);
+this.notifyListeners(DwtEvent.POPUP,this)
+};
+DwtBaseDialog.prototype._resetTabFocus=function(){
+this._tabGroup.resetFocusMember(true)
+};
+DwtBaseDialog.prototype.focus=function(){
+if(this.isListenerRegistered(DwtEvent.ONFOCUS)){
+this.notifyListeners(DwtEvent.ONFOCUS)
+}else{
+if(this._focusElementId){
+var e=document.getElementById(this._focusElementId);
+if(e){
+e.focus()
+}}}};
+DwtBaseDialog.prototype.isPoppedUp=function(){
+return this._poppedUp
+};
+DwtBaseDialog.prototype.popdown=function(){
+if(this._poppedUp){
+this._poppedUp=false;
+this.cleanup(false);
+var e=this._zIndex;
+this.setZIndex(Dwt.Z_HIDDEN);
+this._position(DwtBaseDialog.__nowhereLoc);
+if(this._mode==DwtBaseDialog.MODAL){
+this._undoModality(e)
+}else{
+this._shell._veilOverlay.activeDialogs.pop()
+}
+var t=this._shell.getKeyboardMgr();
+t.popTabGroup(this._tabGroup);
+t.popDefaultHandler();
+this.notifyListeners(DwtEvent.POPDOWN,this)
+}};
+DwtBaseDialog.prototype.setView=function(e){
+this.reset();
+if(e){
+this._getContentDiv().appendChild(e.getHtmlElement())
+}};
+DwtBaseDialog.prototype.reset=function(){
+this._loc.x=this._loc.y=Dwt.LOC_NOWHERE
+};
+DwtBaseDialog.prototype.cleanup=function(t){
+var o=this._getInputFields();
+if(o){
+var e=o.length;
+for(var a=0;
+a<e;
+a++){
+o[a].disabled=!t;
+if(t){
+o[a].value=""
+}}}};
+DwtBaseDialog.prototype.setTitle=function(e){
+if(this._titleEl){
+this._titleEl.innerHTML=e||""
+}};
+DwtBaseDialog.prototype.setContent=function(t){
+var e=this._getContentDiv();
+if(e){
+e.innerHTML=t||""
+}};
+DwtBaseDialog.prototype._getContentDiv=function(){
+return this._contentEl
+};
+DwtBaseDialog.prototype.addEnterListener=function(e){
+this.addListener(DwtEvent.ENTER,e)
+};
+DwtBaseDialog.getActiveDialog=function(){
+var t=null;
+var a=DwtShell.getShell(window);
+if(a){
+var e=a._veilOverlay.activeDialogs.length;
+if(e>0){
+t=a._veilOverlay.activeDialogs[e-1]
+}}
+return t
+};
+DwtBaseDialog.prototype._initializeDragging=function(h){
+var r=document.getElementById(h);
+if(r){
+var s=DwtControl.fromElementId(window._dwtShellId);
+if(s){
+var e=Dwt.getSize(s.getHtmlElement());
+var a=document.getElementById(this._htmlElId);
+var c=this.getSize();
+var n=new AjxCallback(this,this._dragEnd);
+var o=new AjxCallback(this,this._duringDrag);
+var t=new AjxCallback(this,this._dragStart);
+DwtDraggable.init(r,a,0,document.body.offsetWidth-10,0,document.body.offsetHeight-10,t,o,n)
+}}};
+DwtBaseDialog.prototype._getContentHtml=function(){
+return""
+};
+DwtBaseDialog.prototype._createHtml=function(e){
+var t={
+id:this._htmlElId};
+this._createHtmlFromTemplate(e||this.TEMPLATE,t)
+};
+DwtBaseDialog.prototype._createHtmlFromTemplate=function(e,t){
+t.dragId=this._dragHandleId;
+t.title=this._title;
+t.icon="";
+t.closeIcon1="";
+t.closeIcon2="";
+t.controlsTemplateId=this.CONTROLS_TEMPLATE;
+DwtComposite.prototype._createHtmlFromTemplate.call(this,e,t);
+this._titleBarEl=document.getElementById(t.id+"_titlebar");
+this._titleEl=document.getElementById(t.id+"_title");
+this._contentEl=document.getElementById(t.id+"_content");
+this.setContent(this._getContentHtml())
+};
+DwtBaseDialog.prototype._setModalEffect=function(){
+var a=this._shell._veilOverlay.dialogZ;
+var o=null;
+var t,e;
+if(a.length){
+o=a[a.length-1]
+}
+if(o){
+t=o+2;
+e=o+1
+}else{
+t=this._zIndex;
+e=Dwt.Z_VEIL
+}
+this._shell._veilOverlay.veilZ.push(e);
+this._shell._veilOverlay.dialogZ.push(t);
+Dwt.setZIndex(this._shell._veilOverlay,e);
+return t
+};
+DwtBaseDialog.prototype._undoModality=function(a){
+var e=this._shell._veilOverlay.veilZ;
+e.pop();
+var t=e[e.length-1];
+Dwt.setZIndex(this._shell._veilOverlay,t);
+this._shell._veilOverlay.dialogZ.pop();
+this._shell._veilOverlay.activeDialogs.pop();
+if(this._shell._veilOverlay.activeDialogs.length>0){
+this._shell._veilOverlay.activeDialogs[0].focus()
+}};
+DwtBaseDialog.prototype._getInputFields=function(){};
+DwtBaseDialog.prototype._dragStart=function(e,t){
+if(AjxEnv.isNav){
+this._currSize=this.getSize();
+DwtDraggable.setDragBoundaries(DwtDraggable.dragEl,0,document.body.offsetWidth-this._currSize.x,0,document.body.offsetHeight-this._currSize.y)
+}};
+DwtBaseDialog.prototype._dragEnd=function(e,t){
+this._loc.x=e;
+this._loc.y=t
+};
+DwtBaseDialog.prototype._duringDrag=function(e,t){};
+DwtBaseDialog.prototype._doesContainElement=function(e){
+return Dwt.contains(this.getHtmlElement(),e)
+}
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtDialog")){
+DwtDialog=function(t){
+if(arguments.length==0){
+return
+}
+t=Dwt.getParams(arguments,DwtDialog.PARAMS);
+t.className=t.className||"DwtDialog";
+this._title=t.title=t.title||"";
+var a=t.standardButtons;
+var c=t.extraButtons;
+if(!a){
+a=[DwtDialog.OK_BUTTON,DwtDialog.CANCEL_BUTTON]
+}else{
+if(a==DwtDialog.NO_BUTTONS){
+a=null
+}else{
+if(a&&!a.length){
+a=[a]
+}}}
+this._buttonList=[];
+var u={};
+u[DwtDialog.ALIGN_LEFT]=[];
+u[DwtDialog.ALIGN_CENTER]=[];
+u[DwtDialog.ALIGN_RIGHT]=[];
+if(a||c){
+this._buttonDesc={};
+if(a&&a.length){
+this._initialEnterButtonId=this._enterButtonId=a[0];
+for(var o=0;
+o<a.length;
+o++){
+var h=a[o];
+this._buttonList.push(h);
+var r=DwtDialog.ALIGN[h];
+if(r){
+u[r].push(h)
+}
+this._buttonDesc[h]=new DwtDialog_ButtonDescriptor(h,AjxMsg[DwtDialog.MSG_KEY[h]],r)
+}
+this._resetCallbacks()
+}
+if(c&&c.length){
+if(!this._enterButtonId){
+this._initialEnterButtonId=this._enterButtonId=c[0]
+}
+for(var o=0;
+o<c.length;
+o++){
+var h=c[o].id;
+this._buttonList.push(h);
+var r=c[o].align;
+if(r){
+u[r].push(h)
+}
+this._buttonDesc[h]=c[o]
+}}}
+this._buttonElementId={};
+for(var o=0;
+o<this._buttonList.length;
+o++){
+this._buttonElementId[this._buttonList[o]]=Dwt.getNextId()
+}
+DwtBaseDialog.call(this,t);
+this._button={};
+for(var o=0;
+o<this._buttonList.length;
+o++){
+var h=this._buttonList[o];
+var d=this._button[h]=new DwtButton({
+parent:this}
+);
+d.setText(this._buttonDesc[h].label);
+d.buttonId=h;
+d.addSelectionListener(new AjxListener(this,this._buttonListener));
+var e=document.getElementById(this._buttonElementId[h]);
+if(e){
+e.appendChild(d.getHtmlElement())
+}}
+var s=u[DwtDialog.ALIGN_LEFT].concat(u[DwtDialog.ALIGN_CENTER],u[DwtDialog.ALIGN_RIGHT]);
+for(var o=0;
+o<s.length;
+o++){
+var n=this._button[s[o]];
+this._tabGroup.addMember(n)
+}};
+DwtDialog.PARAMS=["parent","className","title","standardButtons","extraButtons","zIndex","mode","loc"];
+DwtDialog.prototype=new DwtBaseDialog;
+DwtDialog.prototype.constructor=DwtDialog;
+DwtDialog.prototype.toString=function(){
+return"DwtDialog"
+};
+DwtDialog.ALIGN_LEFT=1;
+DwtDialog.ALIGN_RIGHT=2;
+DwtDialog.ALIGN_CENTER=3;
+DwtDialog.CANCEL_BUTTON=1;
+DwtDialog.OK_BUTTON=2;
+DwtDialog.DISMISS_BUTTON=3;
+DwtDialog.NO_BUTTON=4;
+DwtDialog.YES_BUTTON=5;
+DwtDialog.LAST_BUTTON=5;
+DwtDialog.NO_BUTTONS=256;
+DwtDialog.ALL_BUTTONS=[DwtDialog.CANCEL_BUTTON,DwtDialog.OK_BUTTON,DwtDialog.DISMISS_BUTTON,DwtDialog.NO_BUTTON,DwtDialog.YES_BUTTON];
+DwtDialog.MSG_KEY={};
+DwtDialog.MSG_KEY[DwtDialog.CANCEL_BUTTON]="cancel";
+DwtDialog.MSG_KEY[DwtDialog.OK_BUTTON]="ok";
+DwtDialog.MSG_KEY[DwtDialog.DISMISS_BUTTON]="dismiss";
+DwtDialog.MSG_KEY[DwtDialog.NO_BUTTON]="no";
+DwtDialog.MSG_KEY[DwtDialog.YES_BUTTON]="yes";
+DwtDialog.ALIGN={};
+DwtDialog.ALIGN[DwtDialog.CANCEL_BUTTON]=DwtDialog.ALIGN_RIGHT;
+DwtDialog.ALIGN[DwtDialog.OK_BUTTON]=DwtDialog.ALIGN_RIGHT;
+DwtDialog.ALIGN[DwtDialog.DISMISS_BUTTON]=DwtDialog.ALIGN_RIGHT;
+DwtDialog.ALIGN[DwtDialog.NO_BUTTON]=DwtDialog.ALIGN_RIGHT;
+DwtDialog.ALIGN[DwtDialog.YES_BUTTON]=DwtDialog.ALIGN_RIGHT;
+DwtDialog.MODELESS=DwtBaseDialog.MODELESS;
+DwtDialog.MODAL=DwtBaseDialog.MODAL;
+DwtDialog.prototype.CONTROLS_TEMPLATE="dwt.Widgets#DwtDialogControls";
+DwtDialog.prototype.popdown=function(){
+DwtBaseDialog.prototype.popdown.call(this);
+this.resetButtonStates()
+};
+DwtDialog.prototype.popup=function(e,t){
+this._focusButtonId=t;
+DwtBaseDialog.prototype.popup.call(this,e)
+};
+DwtDialog.prototype._resetTabFocus=function(){
+if(this._focusButtonId){
+var e=this.getButton(this._focusButtonId);
+this._tabGroup.setFocusMember(e,true)
+}else{
+DwtBaseDialog.prototype._resetTabFocus.call(this)
+}};
+DwtDialog.prototype.reset=function(){
+this._resetCallbacks();
+this.resetButtonStates();
+DwtBaseDialog.prototype.reset.call(this)
+};
+DwtDialog.prototype.resetButtonStates=function(){
+for(b in this._button){
+this._button[b].setEnabled(true);
+this._button[b].setHovered(false)
+}
+this.associateEnterWithButton(this._initialEnterButtonId)
+};
+DwtDialog.prototype.getButton=function(e){
+return this._button[e]
+};
+DwtDialog.prototype.setButtonEnabled=function(t,e){
+this._button[t].setEnabled(e)
+};
+DwtDialog.prototype.setButtonVisible=function(e,t){
+this._button[e].setVisible(t)
+};
+DwtDialog.prototype.getButtonEnabled=function(e){
+return this._button[e].getEnabled()
+};
+DwtDialog.prototype.registerCallback=function(t,a,o,e){
+this._buttonDesc[t].callback=(a instanceof AjxCallback)?a:(new AjxCallback(o,a,e))
+};
+DwtDialog.prototype.unregisterCallback=function(e){
+this._buttonDesc[e].callback=null
+};
+DwtDialog.prototype.setButtonListener=function(e,t){
+this._button[e].removeSelectionListeners();
+this._button[e].addSelectionListener(t)
+};
+DwtDialog.prototype.setEnterListener=function(e){
+this.removeAllListeners(DwtEvent.ENTER);
+this.addEnterListener(e)
+};
+DwtDialog.prototype.associateEnterWithButton=function(e){
+this._enterButtonId=e
+};
+DwtDialog.prototype.getKeyMapName=function(){
+return"DwtDialog"
+};
+DwtDialog.prototype.handleKeyAction=function(e,t){
+switch(e){
+case DwtKeyMap.ENTER:this.notifyListeners(DwtEvent.ENTER,t);
+break;
+case DwtKeyMap.CANCEL:var a=false;
+a=a||this._runCallbackForButtonId(DwtDialog.CANCEL_BUTTON);
+a=a||this._runCallbackForButtonId(DwtDialog.NO_BUTTON);
+a=a||this._runCallbackForButtonId(DwtDialog.DISMISS_BUTTON);
+this.popdown();
+return true;
+case DwtKeyMap.YES:if(this._buttonDesc[DwtDialog.YES_BUTTON]){
+this._runCallbackForButtonId(DwtDialog.YES_BUTTON)
+}
+break;
+case DwtKeyMap.NO:if(this._buttonDesc[DwtDialog.NO_BUTTON]){
+this._runCallbackForButtonId(DwtDialog.NO_BUTTON)
+}
+break;
+default:return false
+}
+return true
+};
+DwtDialog.prototype._createHtmlFromTemplate=function(a,n){
+DwtBaseDialog.prototype._createHtmlFromTemplate.call(this,a,n);
+var o=n.id+"_focus";
+if(document.getElementById(o)){
+this._focusElementId=o
+}
+this._buttonsEl=document.getElementById(n.id+"_buttons");
+if(this._buttonsEl){
+var t=[];
+var e=0;
+this._addButtonsHtml(t,e);
+this._buttonsEl.innerHTML=t.join("")
+}};
+DwtDialog.prototype._getButtonsContainerStartTemplate=function(){
+return"<table cellspacing='0' cellpadding='0' border='0' width='100%'><tr>"
+};
+DwtDialog.prototype._getButtonsAlignStartTemplate=function(){
+return"<td align=\"{0}\"><table cellspacing='5' cellpadding='0' border='0'><tr>"
+};
+DwtDialog.prototype._getButtonsAlignEndTemplate=function(){
+return"</tr></table></td>"
+};
+DwtDialog.prototype._getButtonsCellTemplate=function(){
+return'<td id="{0}"></td>'
+};
+DwtDialog.prototype._getButtonsContainerEndTemplate=function(){
+return"</tr></table>"
+};
+DwtDialog.prototype._addButtonsHtml=function(s,t){
+if(this._buttonList&&this._buttonList.length){
+var a=new Array();
+var e=new Array();
+var n=new Array();
+for(var o=0;
+o<this._buttonList.length;
+o++){
+var r=this._buttonList[o];
+switch(this._buttonDesc[r].align){
+case DwtDialog.ALIGN_RIGHT:e.push(r);
+break;
+case DwtDialog.ALIGN_LEFT:a.push(r);
+break;
+case DwtDialog.ALIGN_CENTER:n.push(r);
+break
+}}
+s[t++]=this._getButtonsContainerStartTemplate();
+if(a.length){
+s[t++]=AjxMessageFormat.format(this._getButtonsAlignStartTemplate(),["left"]);
+for(var o=0;
+o<a.length;
+o++){
+var r=a[o];
+var h=this._buttonDesc[r].cellTemplate?this._buttonDesc[r].cellTemplate:this._getButtonsCellTemplate();
+s[t++]=AjxMessageFormat.format(h,[this._buttonElementId[r]])
+}
+s[t++]=this._getButtonsAlignEndTemplate()
+}
+if(n.length){
+s[t++]=AjxMessageFormat.format(this._getButtonsAlignStartTemplate(),["center"]);
+for(var o=0;
+o<n.length;
+o++){
+var r=n[o];
+var h=this._buttonDesc[r].cellTemplate?this._buttonDesc[r].cellTemplate:this._getButtonsCellTemplate();
+s[t++]=AjxMessageFormat.format(h,[this._buttonElementId[r]])
+}
+s[t++]=this._getButtonsAlignEndTemplate()
+}
+if(e.length){
+s[t++]=AjxMessageFormat.format(this._getButtonsAlignStartTemplate(),["right"]);
+for(var o=0;
+o<e.length;
+o++){
+var r=e[o];
+var h=this._buttonDesc[r].cellTemplate?this._buttonDesc[r].cellTemplate:this._getButtonsCellTemplate();
+s[t++]=AjxMessageFormat.format(h,[this._buttonElementId[r]])
+}
+s[t++]=this._getButtonsAlignEndTemplate()
+}
+s[t++]=this._getButtonsContainerEndTemplate()
+}
+return t
+};
+DwtDialog.prototype._buttonListener=function(a,e){
+var o=DwtControl.getTargetControl(a);
+var t=(o&&o.buttonId)||this._enterButtonId;
+if(t){
+this._runCallbackForButtonId(t,e)
+}};
+DwtDialog.prototype._runCallbackForButtonId=function(o,e){
+var t=this._buttonDesc[o];
+var a=t&&t.callback;
+if(!a){
+return false
+}
+e=(e instanceof Array)?e:[e];
+a.run.apply(a,e);
+return true
+};
+DwtDialog.prototype._runEnterCallback=function(e){
+if(this._enterButtonId&&this.getButtonEnabled(this._enterButtonId)){
+this._runCallbackForButtonId(this._enterButtonId,e)
+}};
+DwtDialog.prototype._resetCallbacks=function(){
+if(this._buttonDesc){
+for(var e=0;
+e<DwtDialog.ALL_BUTTONS.length;
+e++){
+var t=DwtDialog.ALL_BUTTONS[e];
+if(this._buttonDesc[t]){
+this._buttonDesc[t].callback=new AjxCallback(this,this.popdown)
+}}}};
+DwtDialog_ButtonDescriptor=function(n,e,o,a,t){
+this.id=n;
+this.label=e;
+this.align=o;
+this.callback=a;
+this.cellTemplate=t
+}
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtSash")){
+DwtSash=function(a){
+a=Dwt.getParams(arguments,DwtSash.PARAMS);
+a.className=a.className||"DwtSash";
+a.posStyle=a.posStyle||DwtControl.ABSOLUTE_STYLE;
+DwtControl.call(this,a);
+var t=this.getHtmlElement();
+var e="dwt.Widgets#";
+if(!a.style||a.style!=DwtSash.HORIZONTAL_STYLE){
+this._style=DwtSash.VERTICAL_STYLE;
+t.style.cursor=AjxEnv.isIE?"row-resize":"s-resize";
+t.innerHTML=AjxTemplate.expand(e+"DwtVerticalSash")
+}else{
+this._style=DwtSash.HORIZONTAL_STYLE;
+t.style.cursor=AjxEnv.isIE?"col-resize":"w-resize";
+t.innerHTML=AjxTemplate.expand(e+"DwtHorizontalSash")
+}
+this._threshold=(a.threshold>0)?a.threshold:1;
+this._captureObj=new DwtMouseEventCapture({
+targetObj:this,id:"DwtSash",mouseOverHdlr:DwtSash._mouseOverHdlr,mouseDownHdlr:DwtSash._mouseDownHdlr,mouseMoveHdlr:DwtSash._mouseMoveHdlr,mouseUpHdlr:DwtSash._mouseUpHdlr,mouseOutHdlr:DwtSash._mouseOutHdlr}
+);
+this.setHandler(DwtEvent.ONMOUSEDOWN,DwtSash._mouseDownHdlr);
+this.setHandler(DwtEvent.ONMOUSEOVER,DwtSash._mouseOverHdlr);
+this.setHandler(DwtEvent.ONMOUSEOUT,DwtSash._mouseOutHdlr);
+this.setZIndex(Dwt.Z_VIEW)
+};
+DwtSash.PARAMS=["parent","style","className","threshold","posStyle"];
+DwtSash.prototype=new DwtControl;
+DwtSash.prototype.constructor=DwtSash;
+DwtSash.prototype.toString=function(){
+return"DwtSash"
+};
+DwtSash.HORIZONTAL_STYLE=1;
+DwtSash.VERTICAL_STYLE=2;
+DwtSash.prototype.registerCallback=function(e,t){
+this._callbackFunc=e;
+this._callbackObj=t
+};
+DwtSash._mouseOverHdlr=function(t){
+var e=DwtShell.mouseEvent;
+e.setFromDhtmlEvent(t);
+e._stopPropagation=true;
+e._returnValue=false;
+e.setToDhtmlEvent(t);
+return false
+};
+DwtSash._mouseDownHdlr=function(t){
+var e=DwtShell.mouseEvent;
+e.setFromDhtmlEvent(t,true);
+if(e.button!=DwtMouseEvent.LEFT){
+DwtUiEvent.setBehaviour(t,true,false);
+return false
+}
+DwtEventManager.notifyListeners(DwtEvent.ONMOUSEDOWN,e);
+var a=e.dwtObj;
+if(a._callbackFunc!=null){
+a._captureObj.capture();
+a._startCoord=(a._style==DwtSash.HORIZONTAL_STYLE)?e.docX:e.docY
+}
+e._stopPropagation=true;
+e._returnValue=false;
+e.setToDhtmlEvent(t);
+return false
+};
+DwtSash._mouseMoveHdlr=function(t){
+var e=DwtShell.mouseEvent;
+e.setFromDhtmlEvent(t);
+var o=0;
+var a=DwtMouseEventCapture.getTargetObj();
+if(a._style==DwtSash.HORIZONTAL_STYLE){
+if(e.docX>0&&e.docX!=a._startCoord){
+o=e.docX-a._startCoord
+}}else{
+if(e.docY>0&&e.docY!=a._startCoord){
+o=e.docY-a._startCoord
+}}
+if(Math.abs(o)>=a._threshold){
+if(a._callbackObj!=null){
+o=a._callbackFunc.call(a._callbackObj,o)
+}else{
+o=a._callbackFunc(o)
+}
+a._startCoord+=o;
+if(o!=0&&a.getHtmlElement().style.position==Dwt.ABSOLUTE_STYLE){
+if(a._style==DwtSash.HORIZONTAL_STYLE){
+a.setLocation(a.getLocation().x+o,Dwt.DEFAULT)
+}else{
+a.setLocation(Dwt.DEFAULT,a.getLocation().y+o)
+}}}
+e._stopPropagation=true;
+e._returnValue=false;
+e.setToDhtmlEvent(t);
+return false
+};
+DwtSash._mouseUpHdlr=function(t){
+var e=DwtShell.mouseEvent;
+e.setFromDhtmlEvent(t);
+if(e.button!=DwtMouseEvent.LEFT){
+DwtUiEvent.setBehaviour(t,true,false);
+return false
+}
+if(DwtMouseEventCapture.getTargetObj()._callbackFunc!=null){
+DwtMouseEventCapture.getCaptureObj().release()
+}
+e._stopPropagation=true;
+e._returnValue=false;
+e.setToDhtmlEvent(t);
+return false
+};
+DwtSash._mouseOutHdlr=function(t){
+var e=DwtShell.mouseEvent;
+e.setFromDhtmlEvent(t);
+e._stopPropagation=true;
+e._returnValue=false;
+e.setToDhtmlEvent(t);
+return false
+}
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtToolBar")){
+DwtToolBar=function(a){
+if(arguments.length==0){
+return
+}
+a=Dwt.getParams(arguments,DwtToolBar.PARAMS);
+a.className=a.className||"ZToolbar";
+DwtComposite.call(this,a);
+if(a.parent instanceof DwtToolBar){
+this._hasSetMouseEvents=a.parent._hasSetMouseEvents
+}
+if(a.handleMouse!==false&&!this._hasSetMouseEvents){
+var e=AjxEnv.isIE?[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP]:[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP,DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT];
+this._setEventHdlrs(e);
+this._hasSetMouseEvents=true
+}
+this._style=a.style||DwtToolBar.HORIZ_STYLE;
+this._items=[];
+this._createHtml();
+this._numFillers=0;
+this._curFocusIndex=0;
+var t=(this._style==DwtToolBar.HORIZ_STYLE)?"horiz":"vert";
+this._keyMapName=["DwtToolBar",t].join("-")
+};
+DwtToolBar.PARAMS=["parent","className","posStyle","style","index"];
+DwtToolBar.prototype=new DwtComposite;
+DwtToolBar.prototype.constructor=DwtToolBar;
+DwtToolBar.prototype.toString=function(){
+return"DwtToolBar"
+};
+DwtToolBar.HORIZ_STYLE=1;
+DwtToolBar.VERT_STYLE=2;
+DwtToolBar.ELEMENT=1;
+DwtToolBar.SPACER=2;
+DwtToolBar.SEPARATOR=3;
+DwtToolBar.FILLER=4;
+DwtToolBar.FIRST_ITEM="ZFirstItem";
+DwtToolBar.LAST_ITEM="ZLastItem";
+DwtToolBar.SELECTED_NEXT=DwtControl.SELECTED+"Next";
+DwtToolBar.SELECTED_PREV=DwtControl.SELECTED+"Prev";
+DwtToolBar._NEXT_PREV_RE=new RegExp("\\b"+[DwtToolBar.SELECTED_NEXT,DwtToolBar.SELECTED_PREV].join("|")+"\\b","g");
+DwtToolBar.prototype.TEMPLATE="dwt.Widgets#ZToolbar";
+DwtToolBar.prototype.ITEM_TEMPLATE="dwt.Widgets#ZToolbarItem";
+DwtToolBar.prototype.SEPARATOR_TEMPLATE="dwt.Widgets#ZToolbarSeparator";
+DwtToolBar.prototype.SPACER_TEMPLATE="dwt.Widgets#ZToolbarSpacer";
+DwtToolBar.prototype.FILLER_TEMPLATE="dwt.Widgets#ZToolbarFiller";
+DwtToolBar.__itemCount=0;
+DwtToolBar.prototype.dispose=function(){
+this._itemsEl=null;
+this._prefixEl=null;
+this._suffixEl=null;
+DwtComposite.prototype.dispose.call(this)
+};
+DwtToolBar.prototype.getItem=function(e){
+return this._children.get(e)
+};
+DwtToolBar.prototype.getItemCount=function(){
+return this._children.size()
+};
+DwtToolBar.prototype.getItems=function(){
+return this._children.getArray()
+};
+DwtToolBar.prototype.addSpacer=function(t,e){
+var a=this._createSpacerElement();
+this._addItem(DwtToolBar.SPACER,a,e);
+return a
+};
+DwtToolBar.prototype.addSeparator=function(a,e){
+var t=this._createSeparatorElement();
+this._addItem(DwtToolBar.SEPARATOR,t,e);
+return t
+};
+DwtToolBar.prototype.removeSeparator=function(e){
+this._removeItem(e)
+};
+DwtToolBar.prototype.addFiller=function(a,e){
+var t=this._createFillerElement();
+this._addItem(DwtToolBar.FILLER,t,e);
+return t
+};
+DwtToolBar.prototype.addChild=function(a,e){
+DwtComposite.prototype.addChild.apply(this,arguments);
+var t=this._createItemElement();
+t.appendChild(a.getHtmlElement());
+this._addItem(DwtToolBar.ELEMENT,t,e)
+};
+DwtToolBar.prototype.getKeyMapName=function(){
+return this._keyMapName
+};
+DwtToolBar.prototype.handleKeyAction=function(t,o){
+var a=this.getItem(this._curFocusIndex);
+var e=this.getItemCount();
+if(e<2){
+return true
+}
+switch(t){
+case DwtKeyMap.PREV:if(this._curFocusIndex>0){
+this._moveFocus(true)
+}
+break;
+case DwtKeyMap.NEXT:if(this._curFocusIndex<(e-1)){
+this._moveFocus()
+}
+break;
+default:if(a){
+return a.handleKeyAction(t,o)
+}}
+return true
+};
+DwtToolBar.prototype._createItemId=function(t){
+t=t||this._htmlElId;
+var e=[t,"item",++DwtToolBar.__itemCount].join("_");
+return e
+};
+DwtToolBar.prototype._createHtml=function(){
+var e={
+id:this._htmlElId};
+this._createHtmlFromTemplate(this.TEMPLATE,e);
+this._itemsEl=document.getElementById(e.id+"_items");
+this._prefixEl=document.getElementById(e.id+"_prefix");
+this._suffixEl=document.getElementById(e.id+"_suffix")
+};
+DwtToolBar.prototype._createItemElement=function(a){
+a=a||this.ITEM_TEMPLATE;
+var o={
+id:this._htmlElId,itemId:this._createItemId()};
+var t=AjxTemplate.expand(a,o);
+var e=AjxStringUtil.calcDIV();
+e.innerHTML=t;
+return e.firstChild.rows[0].cells[0]
+};
+DwtToolBar.prototype._createSpacerElement=function(e){
+return this._createItemElement(e||this.SPACER_TEMPLATE)
+};
+DwtToolBar.prototype._createSeparatorElement=function(e){
+return this._createItemElement(e||this.SEPARATOR_TEMPLATE)
+};
+DwtToolBar.prototype._createFillerElement=function(e){
+return this._createItemElement(e||this.FILLER_TEMPLATE)
+};
+DwtToolBar.prototype._addItem=function(o,a,t){
+var n=this._items[t]||this._suffixEl;
+var e=t||(typeof t=="number")?t:this._items.length;
+this._items.splice(e,0,a);
+this._itemsEl.insertBefore(a,n)
+};
+DwtToolBar.prototype._removeItem=function(t){
+for(var e=0;
+e<this._items.length;
+e++){
+if(this._items[e]==t){
+this._items.splice(e,1);
+this._itemsEl.removeChild(t);
+break
+}}};
+DwtToolBar.prototype._focus=function(e){
+if(!this._submenuKeySet){
+var a=this.shell.getKeyboardMgr();
+if(a.isEnabled()){
+var t=a.__keyMapMgr;
+if(t){
+if(this._style==DwtToolBar.HORIZ_STYLE){
+t.removeMapping("DwtButton","ArrowRight");
+t.setMapping("DwtButton","ArrowDown",DwtKeyMap.SUBMENU)
+}else{
+t.removeMapping("DwtButton","ArrowDown");
+t.setMapping("DwtButton","ArrowRight",DwtKeyMap.SUBMENU)
+}
+t.reloadMap("DwtButton")
+}}
+this._submenuKeySet=true
+}
+e=e?e:this._getFocusItem(this._curFocusIndex);
+if(e){
+e._hasFocus=true;
+e._focus()
+}else{
+this._moveFocus()
+}};
+DwtToolBar.prototype._blur=function(e){
+e=e?e:this._getFocusItem(this._curFocusIndex);
+if(e){
+e._hasFocus=false;
+e._blur()
+}};
+DwtToolBar.prototype._getFocusItem=function(e){
+var t=this.getItem(e);
+if(!t||(t instanceof DwtToolBar)){
+return null
+}
+if(t._noFocus){
+return null
+}
+if(t.getEnabled&&!t.getEnabled()){
+return null
+}
+if(t.getVisible&&!t.getVisible()){
+return null
+}
+return t
+};
+DwtToolBar.prototype._moveFocus=function(e){
+var t=this._curFocusIndex;
+var a=this.getItemCount()-1;
+var o=null;
+while(!o&&t>=0&&t<=a){
+t=e?t-1:t+1;
+o=this._getFocusItem(t)
+}
+if(o){
+this._blur();
+this._curFocusIndex=t;
+this._focus(o)
+}};
+DwtToolBar.prototype.__markPrevNext=function(r,s){
+var e=this.__getButtonIndex(r);
+var o=this.__getButtonAt(e-1);
+var t=this.__getButtonAt(e+1);
+if(s){
+if(o){
+Dwt.delClass(o.getHtmlElement(),DwtToolBar._NEXT_PREV_RE,DwtToolBar.SELECTED_PREV)
+}
+if(t){
+Dwt.delClass(t.getHtmlElement(),DwtToolBar._NEXT_PREV_RE,DwtToolBar.SELECTED_NEXT)
+}}else{
+if(o){
+Dwt.delClass(o.getHtmlElement(),DwtToolBar._NEXT_PREV_RE)
+}
+if(t){
+Dwt.delClass(t.getHtmlElement(),DwtToolBar._NEXT_PREV_RE)
+}}
+var n=this.__getButtonAt(0);
+if(n){
+Dwt.addClass(n.getHtmlElement(),DwtToolBar.FIRST_ITEM)
+}
+var a=this.__getButtonAt(this.getItemCount()-1);
+if(a){
+Dwt.addClass(a.getHtmlElement(),DwtToolBar.LAST_ITEM)
+}};
+DwtToolBar.prototype.__getButtonIndex=function(a){
+var t=0;
+for(var e in this._buttons){
+if(e==a){
+return t
+}
+t++
+}
+return -1
+};
+DwtToolBar.prototype.__getButtonAt=function(t){
+var a=0;
+for(var e in this._buttons){
+if(a==t){
+return this._buttons[e]
+}
+a++
+}
+return null
+};
+DwtToolBarButton=function(e){
+if(arguments.length==0){
+return
+}
+var e=Dwt.getParams(arguments,DwtToolBarButton.PARAMS);
+e.className=e.className||"ZToolbarButton";
+DwtButton.call(this,e)
+};
+DwtToolBarButton.PARAMS=["parent","style","className","posStyle","actionTiming","id","index"];
+DwtToolBarButton.prototype=new DwtButton;
+DwtToolBarButton.prototype.constructor=DwtToolBarButton;
+DwtToolBarButton.prototype.TEMPLATE="dwt.Widgets#ZToolbarButton"
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtToolTip")){
+DwtToolTip=function(a,o,t){
+if(arguments.length==0){
+return
+}
+this.shell=a;
+this._dialog=t;
+this._poppedUp=false;
+this._div=document.createElement("div");
+this._div.className=o||"DwtToolTip";
+this._div.style.position=DwtControl.ABSOLUTE_STYLE;
+this.shell.getHtmlElement().appendChild(this._div);
+Dwt.setZIndex(this._div,Dwt.Z_HIDDEN);
+Dwt.setLocation(this._div,Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
+var e="dwt.Widgets#"+this._borderStyle;
+this._div.innerHTML=AjxTemplate.expand(e,"tooltip");
+var n=AjxTemplate.getParams(e);
+this._borderWidth=Number(n.width);
+this._borderHeight=Number(n.height);
+this._contentDiv=document.getElementById("tooltipContents")
+};
+DwtToolTip.prototype.toString=function(){
+return"DwtToolTip"
+};
+DwtToolTip.TOOLTIP_DELAY=750;
+DwtToolTip.prototype._borderStyle="DwtToolTip";
+DwtToolTip.prototype.getContent=function(){
+return this._div.innerHTML
+};
+DwtToolTip.prototype.setContent=function(t,e){
+this._content=t;
+if(e){
+this._contentDiv.innerHTML=this._content
+}};
+DwtToolTip.prototype.popup=function(e,a,t){
+if(this._popupAction){
+AjxTimedAction.cancelAction(this._popupAction);
+this._popupAction=null
+}
+if(this._content!=null){
+if(!t){
+this._contentDiv.innerHTML=this._content
+}
+this._popupAction=new AjxTimedAction(this,this._positionElement,[e,a]);
+AjxTimedAction.scheduleAction(this._popupAction,5)
+}};
+DwtToolTip.prototype.popdown=function(){
+if(this._popupAction){
+AjxTimedAction.cancelAction(this._popupAction);
+this._popupAction=null
+}
+if(this._content!=null&&this._poppedUp){
+Dwt.setLocation(this._div,Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
+this._poppedUp=false
+}};
+DwtToolTip.prototype._positionElement=function(A,O){
+this._popupAction=null;
+var n=this._div;
+var f="tooltip";
+var T=this._dialog;
+var z=5;
+var d=8;
+var h=8;
+var e=document.getElementById(f+"TopPointer");
+e.style.display="block";
+var w=Dwt.getSize(e),x=w.x,a=w.y;
+var s=document.getElementById(f+"BottomPointer");
+s.style.display="block";
+w=Dwt.getSize(s),bottomPointerWidth=w.x,bottomPointerHeight=w.y;
+var q=e;
+var r=DwtShell.getShell(window).getSize(),D=r.x,p=r.y;
+var C=Dwt.getSize(n),j=C.x,u=C.y;
+var m=this._borderHeight,S=this._borderHeight,y=this._borderWidth,k=this._borderWidth;
+var B=A-j/2-d,W;
+var t,o,v;
+if(O+h+a-m+u<p-z){
+s.style.display="none";
+W=O+h+a-m;
+t=m-a;
+v=x;
+q=e
+}else{
+e.style.display="none";
+W=O-h-bottomPointerHeight+S-u;
+t=u-S;
+v=bottomPointerWidth;
+q=s
+}
+var c=document.getElementById(f+"Contents");
+if(j-y-k<v){
+c.width=v;
+c.style.width=String(v)+"px"
+}else{
+c.width="auto";
+c.style.width="auto"
+}
+if(B<z){
+B=z
+}else{
+if(B+j>D-z){
+B=D-z-j
+}}
+o=A-B-v/2;
+if(o+v>j-k){
+o=j-k-v
+}
+if(o<y){
+o=y
+}
+q.style.left=o;
+q.style.top=t;
+Dwt.setLocation(n,B,W);
+var g=T?T.getZIndex()+Dwt._Z_INC:Dwt.Z_TOOLTIP;
+Dwt.setZIndex(n,g);
+this._poppedUp=true
+}
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtTreeItem")){
+DwtTreeItem=function(t){
+if(arguments.length==0){
+return
+}
+t=Dwt.getParams(arguments,DwtTreeItem.PARAMS);
+var e=t.parent;
+if(e instanceof DwtTree){
+this._tree=e
+}else{
+if(e instanceof DwtTreeItem){
+this._tree=e._tree
+}else{
+throw new DwtException("DwtTreeItem parent must be a DwtTree or DwtTreeItem",DwtException.INVALIDPARENT,"DwtTreeItem")
+}}
+this._origClassName=t.className||"DwtTreeItem";
+this._textClassName=[this._origClassName,"Text"].join("-");
+this._selectedClassName=[this._origClassName,DwtCssStyle.SELECTED].join("-");
+this._selectedFocusedClassName=[this._origClassName,DwtCssStyle.SELECTED,DwtCssStyle.FOCUSED].join("-");
+this._actionedClassName=[this._origClassName,DwtCssStyle.ACTIONED].join("-");
+this._dragOverClassName=[this._origClassName,DwtCssStyle.DRAG_OVER].join("-");
+t.deferred=(t.deferred!==false);
+t.className=null;
+DwtComposite.call(this,t);
+this._imageInfoParam=t.imageInfo;
+this._extraInfo=t.extraInfo;
+this._textParam=t.text;
+this._deferred=t.deferred;
+this._expandNodeImage=t.expandNodeImage||"NodeExpanded";
+this._collapseNodeImage=t.collapseNodeImage||"NodeCollapsed";
+this._itemChecked=false;
+this._initialized=false;
+this._selectionEnabled=Boolean(t.selectable!==false);
+this._forceNotifySelection=Boolean(t.forceNotifySelection);
+this._actionEnabled=true;
+this._forceNotifyAction=Boolean(t.forceNotifyAction);
+this._dndScrollCallback=t.dndScrollCallback;
+this._dndScrollId=t.dndScrollId;
+if(this._tree.isCheckedStyle){
+this.enableSelection(false);
+this._selectedClassName=this._origClassName
+}
+if(t.singleClickAction){
+this._singleClickAction=true;
+this._selectedFocusedClassName=this._selectedClassName=this._textClassName;
+this._hoverClassName=[this._origClassName,DwtCssStyle.HOVER].join("-")
+}else{
+this._hoverClassName=this._textClassName
+}
+if(e instanceof DwtTree||(e._initialized&&(!e._deferred||e._expanded))){
+this._initialize(t.index)
+}else{
+e._addDeferredChild(this,t.index);
+this._index=t.index
+}};
+DwtTreeItem.PARAMS=["parent","index","text","imageInfo","deferred","className","posStyle","forceNotifySelection","forceNotifyAction"];
+DwtTreeItem.prototype=new DwtComposite;
+DwtTreeItem.prototype.constructor=DwtTreeItem;
+DwtTreeItem.prototype.TEMPLATE="dwt.Widgets#ZTreeItem";
+DwtTreeItem.prototype._checkBoxVisible=true;
+DwtTreeItem._NODECELL_DIM="16px";
+DwtTreeItem._processedMouseDown=false;
+DwtTreeItem.prototype.dispose=function(){
+this._itemDiv=null;
+this._nodeCell=null;
+this._checkBoxCell=null;
+this._checkedImg=null;
+this._checkBox=null;
+this._imageCell=null;
+this._textCell=null;
+this._childDiv=null;
+DwtComposite.prototype.dispose.call(this)
+};
+DwtTreeItem.prototype.toString=function(){
+return"DwtTreeItem"
+};
+DwtTreeItem.prototype.getChecked=function(){
+return this._itemChecked
+};
+DwtTreeItem.prototype.setChecked=function(e,t){
+if((this._itemChecked!=e)||t){
+this._itemChecked=e;
+if(this._checkBox!=null&&(this._checkBoxCell&&Dwt.getVisible(this._checkBoxCell))){
+Dwt.setVisible(this._checkedImg,e)
+}}};
+DwtTreeItem.prototype._handleCheckboxOnclick=function(e){
+this.setChecked(!Dwt.getVisible(this._checkedImg));
+e=e||window.event;
+e.item=this;
+this._tree._itemChecked(this,e)
+};
+DwtTreeItem.prototype.getExpanded=function(){
+return this._expanded
+};
+DwtTreeItem.prototype.setExpanded=function(t,s,n){
+if(t){
+var r=this.parent;
+while(r instanceof DwtTreeItem&&!r._expanded){
+r.setExpanded(true);
+r=r.parent
+}
+this._realizeDeferredChildren()
+}
+if(this.getNumChildren()){
+if(t&&s){
+if(!this._expanded){
+this._expand(t,null,n)
+}
+var e=this.getChildren();
+for(var o=0;
+o<e.length;
+o++){
+if(e[o] instanceof DwtTreeItem){
+e[o].setExpanded(t,s,n)
+}}}else{
+if(this._expanded!=t){
+this._expand(t,null,n)
+}}}};
+DwtTreeItem.prototype.getItemCount=function(){
+return this._children.size()
+};
+DwtTreeItem.prototype.getItems=function(){
+return this._children.getArray()
+};
+DwtTreeItem.prototype.getImage=function(){
+return this._imageInfo
+};
+DwtTreeItem.prototype.setImage=function(e){
+if(this._initialized){
+if(this._imageCell){
+AjxImg.setImage(this._imageCell,e)
+}
+
+this._imageInfo=e
+}else{
+this._imageInfoParam=e
+}};
+DwtTreeItem.prototype.setDndImage=function(e){
+this._dndImageInfo=e
+};
+DwtTreeItem.prototype.getSelected=function(){
+return this._selected
+};
+DwtTreeItem.prototype.getActioned=function(){
+return this._actioned
+};
+DwtTreeItem.prototype.getText=function(){
+return this._text
+};
+DwtTreeItem.prototype.setText=function(e){
+if(this._initialized){
+if(!e){
+e=""
+}
+this._text=this._textCell.innerHTML=e
+}else{
+this._textParam=e
+}};
+DwtTreeItem.prototype.setDndText=function(e){
+this._dndText=e
+};
+DwtTreeItem.prototype.showCheckBox=function(e){
+this._checkBoxVisible=e;
+if(this._checkBoxCell){
+Dwt.setVisible(this._checkBoxCell,e)
+}};
+DwtTreeItem.prototype.showExpansionIcon=function(e){
+if(this._nodeCell){
+Dwt.setVisible(this._nodeCell,e)
+}};
+DwtTreeItem.prototype.enableSelection=function(e){
+this._selectionEnabled=e;
+this._selectedClassName=e?this._origClassName+"-"+DwtCssStyle.SELECTED:this._origClassName
+};
+DwtTreeItem.prototype.enableAction=function(e){
+this._actionEnabled=e
+};
+DwtTreeItem.prototype.addSeparator=function(e){
+this._children.add((new DwtTreeItemSeparator(this)),e)
+};
+DwtTreeItem.prototype.setVisible=function(a,t,e){
+if(t&&!e){
+Dwt.setVisible(this._itemDiv,a)
+}else{
+if(e&&!t){
+Dwt.setVisible(this._childDiv,a)
+}else{
+DwtComposite.prototype.setVisible.call(this,a)
+}}};
+DwtTreeItem.prototype.removeChild=function(t){
+if(t._initialized){
+this._tree._deselect(t);
+if(this._childDiv){
+this._childDiv.removeChild(t.getHtmlElement())
+}}
+this._children.remove(t);
+if(this._children.size()==0){
+if(this._expanded){
+this._expanded=false
+}
+if(this._initialized&&this._nodeCell){
+AjxImg.setImage(this._nodeCell,"Blank_16");
+var e=AjxImg.getImageElement(this._nodeCell);
+if(e){
+Dwt.clearHandler(e,DwtEvent.ONMOUSEDOWN)
+}}}};
+DwtTreeItem.prototype.getKeyMapName=function(){
+return"DwtTreeItem"
+};
+DwtTreeItem.prototype.handleKeyAction=function(a,r){
+switch(a){
+case DwtKeyMap.NEXT:var n=this._tree._getNextTreeItem(true);
+if(n){
+n._tree.setSelection(n,false,true)
+}
+break;
+case DwtKeyMap.PREV:var n=this._tree._getNextTreeItem(false);
+if(n){
+n._tree.setSelection(n,false,true)
+}
+break;
+case DwtKeyMap.EXPAND:if(!this._expanded){
+this.setExpanded(true,false,true)
+}
+break;
+case DwtKeyMap.COLLAPSE:if(this._expanded){
+this.setExpanded(false,false,true)
+}
+break;
+case DwtKeyMap.ACTION:var c=this.getHtmlElement();
+var h=Dwt.toWindow(c,0,0);
+var o=this.getSize();
+var t=h.x+o.x/4;
+var e=h.y+o.y/2;
+this._gotMouseDownRight=true;
+this._emulateSingleClick({
+dwtObj:this,target:c,button:DwtMouseEvent.RIGHT,docX:t,docY:e,kbNavEvent:true}
+);
+break;
+default:return false
+}
+return true
+};
+DwtTreeItem.prototype.addNodeIconListeners=function(){
+var e=AjxImg.getImageElement(this._nodeCell);
+if(e){
+Dwt.setHandler(e,DwtEvent.ONMOUSEDOWN,DwtTreeItem._nodeIconMouseDownHdlr);
+Dwt.setHandler(e,DwtEvent.ONMOUSEUP,DwtTreeItem._nodeIconMouseUpHdlr)
+}};
+DwtTreeItem.prototype._initialize=function(e,o,a){
+this._checkState();
+if(AjxEnv.isIE){
+this._setEventHdlrs([DwtEvent.ONMOUSEENTER,DwtEvent.ONMOUSELEAVE])
+}
+if(AjxEnv.isSafari){
+this._setEventHdlrs([DwtEvent.ONCONTEXTMENU])
+}
+var t={
+id:this._htmlElId,divClassName:this._origClassName,isCheckedStyle:this._tree.isCheckedStyle,textClassName:this._textClassName};
+this._createHtmlFromTemplate(this.TEMPLATE,t);
+this.parent._addItem(this,e,o);
+this._itemDiv=document.getElementById(t.id+"_div");
+this._nodeCell=document.getElementById(t.id+"_nodeCell");
+this._checkBoxCell=document.getElementById(t.id+"_checkboxCell");
+this._checkBox=document.getElementById(t.id+"_checkbox");
+this._checkedImg=document.getElementById(t.id+"_checkboxImg");
+this._imageCell=document.getElementById(t.id+"_imageCell");
+this._textCell=document.getElementById(t.id+"_textCell");
+this._extraCell=document.getElementById(t.id+"_extraCell");
+if(this._nodeCell){
+this._nodeCell.style.width=this._nodeCell.style.height=DwtTreeItem._NODECELL_DIM;
+if(this._children.size()>0||a){
+AjxImg.setImage(this._nodeCell,this._collapseNodeImage);
+this.addNodeIconListeners()
+}}
+if(this._extraCell){
+AjxImg.setImage(this._extraCell,(this._extraInfo||"Blank_16"))
+}
+if(this._tree.isCheckedStyle&&this._checkBox){
+this._checkBox.onclick=AjxCallback.simpleClosure(this._handleCheckboxOnclick,this);
+this.showCheckBox(this._checkBoxVisible);
+this.setChecked(this._tree.isCheckedByDefault,true)
+}
+if(this._imageCell&&this._imageInfoParam){
+AjxImg.setImage(this._imageCell,this._imageInfoParam);
+this._imageInfo=this._imageInfoParam
+}
+if(this._textCell&&this._textParam){
+this._textCell.innerHTML=this._text=this._textParam
+}
+this._expanded=this._selected=this._actioned=false;
+this._gotMouseDownLeft=this._gotMouseDownRight=false;
+this._addMouseListeners();
+this._initialized=true
+};
+DwtTreeItem.prototype.setTreeItemColor=function(o){
+var s=this._htmlElId+"_table";
+var a=document.getElementById(s);
+var n=document.getElementById(this._htmlElId+"_div");
+var t=this.getHtmlElement();
+var e=this._origClassName+" "+o;
+if(n){
+n.className=e
+}else{
+if(t){
+t.className=o
+}}};
+DwtTreeItem.prototype._addMouseListeners=function(){
+var t=[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP,DwtEvent.ONDBLCLICK];
+if(AjxEnv.isIE){
+t.push(DwtEvent.ONMOUSEENTER,DwtEvent.ONMOUSELEAVE)
+}else{
+t.push(DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT)
+}
+if(AjxEnv.isSafari){
+t.push(DwtEvent.ONCONTEXTMENU)
+}
+for(var e=0;
+e<t.length;
+e++){
+this.addListener(t[e],DwtTreeItem._listeners[t[e]])
+}};
+DwtTreeItem.prototype._addDeferredChild=function(a,e){
+if(this._initialized&&this._children.size()==0){
+if(this._nodeCell){
+AjxImg.setImage(this._nodeCell,this._collapseNodeImage);
+var t=AjxImg.getImageElement(this._nodeCell);
+if(t){
+Dwt.setHandler(t,DwtEvent.ONMOUSEDOWN,DwtTreeItem._nodeIconMouseDownHdlr);
+Dwt.setHandler(t,DwtEvent.ONMOUSEUP,DwtTreeItem._nodeIconMouseUpHdlr)
+}}}
+this._children.add(a,e)
+};
+DwtTreeItem.prototype.addChild=function(e){};
+DwtTreeItem.prototype._addItem=function(a,t,s){
+if(!this._children.contains(a)){
+this._children.add(a,t)
+}
+if(this._childDiv==null){
+this._childDiv=document.createElement("div");
+this._childDiv.className=(this.parent!=this._tree)?"DwtTreeItemChildDiv":"DwtTreeItemLevel1ChildDiv";
+this.getHtmlElement().appendChild(this._childDiv);
+if(!this._expanded){
+this._childDiv.style.display="none"
+}}
+if(s&&this._nodeCell){
+if(AjxImg.getImageClass(this._nodeCell)==AjxImg.getClassForImage("Blank_16")){
+AjxImg.setImage(this._nodeCell,this._expanded?this._expandNodeImage:this._collapseNodeImage);
+var n=AjxImg.getImageElement(this._nodeCell);
+if(n){
+Dwt.setHandler(n,DwtEvent.ONMOUSEDOWN,DwtTreeItem._nodeIconMouseDownHdlr)
+}}}
+var e=this._childDiv;
+var o=e.childNodes.length;
+if(t==null||t>=o||o==0){
+e.appendChild(a.getHtmlElement())
+}else{
+e.insertBefore(a.getHtmlElement(),e.childNodes[t])
+}};
+DwtTreeItem.prototype.sort=function(e){
+this._children.sort(e);
+if(this._childDiv){
+this._setChildElOrder()
+}else{
+this._needsSort=true
+}};
+DwtTreeItem.prototype._setChildElOrder=function(e){
+var t=document.createDocumentFragment();
+this._children.foreach(function(o,a){
+t.appendChild(o.getHtmlElement());
+o._index=a
+}
+);
+this._childDiv.appendChild(t)
+};
+DwtTreeItem.prototype._getDragProxy=function(){
+var t=document.createElement("div");
+Dwt.setPosition(t,Dwt.ABSOLUTE_STYLE);
+var a=document.createElement("table");
+t.appendChild(a);
+a.cellSpacing=a.cellPadding=0;
+var o=a.insertRow(0);
+var e=0;
+var n=o.insertCell(e++);
+n.noWrap=true;
+if(this._dndImageInfo){
+AjxImg.setImage(n,this._dndImageInfo)
+}else{
+if(this._imageInfo){
+AjxImg.setImage(n,this._imageInfo)
+}}
+n=o.insertCell(e);
+n.noWrap=true;
+n.className=this._origClassName;
+if(this._dndText){
+n.innerHTML=this._dndText
+}else{
+if(this._text){
+n.innerHTML=this._text
+}}
+this.shell.getHtmlElement().appendChild(t);
+Dwt.setZIndex(t,Dwt.Z_DND);
+return t
+};
+DwtTreeItem.prototype._dragEnter=function(){
+this._preDragClassName=this._textCell.className;
+this._textCell.className=this._dragOverClassName
+};
+DwtTreeItem.prototype._dragHover=function(){
+if(this.getNumChildren()>0&&!this.getExpanded()){
+this.setExpanded(true)
+}};
+DwtTreeItem.prototype._dragLeave=function(e){
+if(this._preDragClassName){
+this._textCell.className=this._preDragClassName
+}};
+DwtTreeItem.prototype._drop=function(){
+if(this._preDragClassName){
+this._textCell.className=this._preDragClassName
+}};
+DwtTreeItem._nodeIconMouseDownHdlr=function(t){
+var a=DwtControl.getTargetControl(t);
+var e=DwtShell.mouseEvent;
+e.setFromDhtmlEvent(t,a);
+if(e.button==DwtMouseEvent.LEFT){
+a._expand(!a._expanded,e)
+}else{
+if(e.button==DwtMouseEvent.RIGHT){
+e.dwtObj._tree._itemActioned(e.dwtObj,e)
+}}
+e._stopPropagation=true;
+e._returnValue=false;
+e.setToDhtmlEvent(t);
+return false
+};
+DwtTreeItem._nodeIconMouseUpHdlr=function(t){
+var a=DwtControl.getTargetControl(t);
+var e=DwtShell.mouseEvent;
+e._stopPropagation=true;
+e._returnValue=false;
+e.setToDhtmlEvent(t);
+return false
+};
+DwtTreeItem.prototype._expand=function(t,a,e){
+if(!t){
+this._expanded=false;
+this._childDiv.style.display="none";
+if(this._nodeCell){
+AjxImg.setImage(this._nodeCell,this._collapseNodeImage)
+}
+this._tree._itemCollapsed(this,a,e)
+}else{
+this._realizeDeferredChildren();
+this._expanded=true;
+this._childDiv.style.display="block";
+if(this._nodeCell){
+AjxImg.setImage(this._nodeCell,this._expandNodeImage)
+}
+this._tree._itemExpanded(this,a,e)
+}};
+DwtTreeItem.prototype._realizeDeferredChildren=function(){
+var e=this._children.getArray();
+for(var t=0;
+t<e.length;
+t++){
+var o=e[t];
+if(!o._initialized){
+o._initialize(o._index,true)
+}else{
+if(o._isSeparator&&!o.div){
+var n=o.div=document.createElement("div");
+n.className="vSpace";
+this._childDiv.appendChild(n);
+o._initialized=true
+}}}
+if(this._needsSort){
+if(e.length){
+this._setChildElOrder()
+}
+delete this.__needsSort
+}};
+DwtTreeItem.prototype._isChildOf=function(e){
+var t=this.parent;
+while(t&&t!=this._tree){
+if(t==e){
+return true
+}
+t=t.parent
+}
+return false
+};
+DwtTreeItem.prototype._setSelected=function(e,t){
+if(this._selected!=e){
+this._selected=e;
+if(!this._initialized){
+this._initialize()
+}
+if(!this._itemDiv){
+return
+}
+if(e&&(this._selectionEnabled||this._forceNotifySelection)){
+this._itemDiv.className=this._selectedClassName;
+if(!t){
+this.focus()
+}
+return true
+}else{
+this._itemDiv.className=this._origClassName;
+return false
+}}};
+DwtTreeItem.prototype._setActioned=function(e){
+if(this._actioned!=e){
+this._actioned=e;
+if(!this._initialized){
+this._initialize()
+}
+if(!this._itemDiv){
+return
+}
+if(e&&(this._actionEnabled||this._forceNotifyAction)&&!this._selected&&!this){
+this._itemDiv.className=this._actionedClassName;
+return true
+}
+if(!e){
+if(!this._selected){
+this._itemDiv.className=this._origClassName
+}
+return false
+}}};
+DwtTreeItem.prototype._focus=function(){
+if(!this._itemDiv){
+return
+}
+if(this._selectionEnabled){
+this._itemDiv.className=this._selectedFocusedClassName
+}};
+DwtTreeItem.prototype._blur=function(){
+if(!this._itemDiv){
+return
+}
+this._itemDiv.className=this._selected?this._selectedClassName:this._origClassName
+};
+DwtTreeItem._mouseDownListener=function(e){
+var t=e.dwtObj;
+if(!t){
+return false
+}
+if(e.target==t._childDiv){
+return
+}
+if(e.button==DwtMouseEvent.LEFT&&(t._selectionEnabled||t._forceNotifySelection)){
+t._gotMouseDownLeft=true
+}else{
+if(e.button==DwtMouseEvent.RIGHT&&(t._actionEnabled||t._forceNotifyAction)){
+t._gotMouseDownRight=true
+}}};
+DwtTreeItem._mouseOutListener=function(e){
+var t=e.dwtObj;
+if(!t){
+return false
+}
+if(e.target==t._childDiv){
+return
+}
+t._gotMouseDownLeft=false;
+t._gotMouseDownRight=false;
+if(t._singleClickAction&&t._textCell){
+t._textCell.className=t._textClassName
+}};
+DwtTreeItem._mouseOverListener=function(e){
+var t=e.dwtObj;
+if(!t){
+return false
+}
+if(e.target==t._childDiv){
+return
+}
+if(t._singleClickAction&&t._textCell){
+t._textCell.className=t._hoverClassName
+}};
+DwtTreeItem._mouseUpListener=function(e){
+var t=e.dwtObj;
+if(!t){
+return false
+}
+if(e.target==t._childDiv){
+return
+}
+if(e.button==DwtMouseEvent.LEFT&&t._gotMouseDownLeft){
+t._tree._itemClicked(t,e)
+}else{
+if(e.button==DwtMouseEvent.RIGHT&&t._gotMouseDownRight){
+t._tree._itemActioned(t,e)
+}}};
+DwtTreeItem._doubleClickListener=function(t){
+var a=t.dwtObj;
+if(!a){
+return false
+}
+if(t.target==a._childDiv){
+return
+}
+var o=DwtControl.getTargetControl(t);
+var e=DwtShell.mouseEvent;
+e.setFromDhtmlEvent(t,o);
+if(e.button==DwtMouseEvent.LEFT||e.button==DwtMouseEvent.NONE){
+e.dwtObj._tree._itemDblClicked(e.dwtObj,e)
+}};
+DwtTreeItem._contextListener=function(t){
+if(AjxEnv.isSafari){
+var a=DwtControl.getTargetControl(t);
+var e=a?a.preventContextMenu():true;
+if(e){
+a.notifyListeners(DwtEvent.ONMOUSEDOWN,t);
+return a.notifyListeners(DwtEvent.ONMOUSEUP,t)
+}}};
+DwtTreeItem.prototype._emulateSingleClick=function(e){
+var t=new DwtMouseEvent();
+this._setMouseEvent(t,e);
+t.kbNavEvent=e.kbNavEvent;
+this.notifyListeners(DwtEvent.ONMOUSEUP,t)
+};
+DwtTreeItem._listeners={};
+DwtTreeItem._listeners[DwtEvent.ONMOUSEDOWN]=new AjxListener(null,DwtTreeItem._mouseDownListener);
+DwtTreeItem._listeners[DwtEvent.ONMOUSEOUT]=new AjxListener(null,DwtTreeItem._mouseOutListener);
+DwtTreeItem._listeners[DwtEvent.ONMOUSELEAVE]=new AjxListener(null,DwtTreeItem._mouseOutListener);
+DwtTreeItem._listeners[DwtEvent.ONMOUSEENTER]=new AjxListener(null,DwtTreeItem._mouseOverListener);
+DwtTreeItem._listeners[DwtEvent.ONMOUSEOVER]=new AjxListener(null,DwtTreeItem._mouseOverListener);
+DwtTreeItem._listeners[DwtEvent.ONMOUSEUP]=new AjxListener(null,DwtTreeItem._mouseUpListener);
+DwtTreeItem._listeners[DwtEvent.ONDBLCLICK]=new AjxListener(null,DwtTreeItem._doubleClickListener);
+DwtTreeItem._listeners[DwtEvent.ONCONTEXTMENU]=new AjxListener(null,DwtTreeItem._contextListener);
+DwtTreeItemSeparator=function(e){
+this.parent=e;
+this._isSeparator=true;
+this._initialized=true
+};
+DwtTreeItemSeparator.prototype.dispose=function(){
+DwtComposite.prototype.removeChild.call(this.parent,this)
+};
+DwtTreeItemSeparator.prototype.isInitialized=function(){
+return this._initialized
+};
+DwtTreeItemSeparator.prototype.getHtmlElement=function(){
+return this.div
+}
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtHeaderTreeItem")){
+DwtHeaderTreeItem=function(e){
+this.overview=e.overview;
+this._button=e.button;
+this._noNodeCell=e.noNodeCell;
+DwtTreeItem.call(this,e)
+};
+DwtHeaderTreeItem.prototype=new DwtTreeItem;
+DwtHeaderTreeItem.prototype.constructor=DwtHeaderTreeItem;
+DwtHeaderTreeItem.prototype.TEMPLATE="dwt.Widgets#ZHeaderTreeItem";
+DwtHeaderTreeItem.prototype.toString=function(){
+return"DwtHeaderTreeItem"
+};
+DwtHeaderTreeItem.prototype._createHtmlFromTemplate=function(e,t){
+t.noNodeCell=this._noNodeCell;
+DwtTreeItem.prototype._createHtmlFromTemplate.apply(this,arguments)
+};
+DwtHeaderTreeItem.prototype._initialize=function(){
+DwtTreeItem.prototype._initialize.apply(this,arguments);
+if(this._button){
+this._headerButtonId=this._htmlElId+"_headerButton";
+var t=document.getElementById(this._headerButtonId);
+if(t){
+t.className="Img"+this._button.image;
+t.onclick=AjxCallback.simpleClosure(this._onclickHandler,this);
+var e=new AjxListener(null,DwtHeaderTreeItem._mouseOverListener);
+var a=new AjxListener(null,DwtHeaderTreeItem._mouseOutListener);
+this.addListener(DwtEvent.ONMOUSEOVER,e);
+this.addListener(DwtEvent.ONMOUSEENTER,e);
+this.addListener(DwtEvent.ONMOUSEOUT,a);
+this.addListener(DwtEvent.ONMOUSELEAVE,a);
+this.addListener(DwtEvent.ONMOUSEUP,new AjxListener(null,DwtHeaderTreeItem._mouseUpListener))
+}}};
+DwtHeaderTreeItem.prototype._onclickHandler=function(t){
+var e=DwtShell.mouseEvent;
+e.setFromDhtmlEvent(t,this);
+this._button.callback.run(e)
+};
+DwtHeaderTreeItem._mouseOverListener=function(t){
+var a=t.dwtObj;
+var e=DwtUiEvent.getTarget(t);
+if(e&&(e.id==a._headerButtonId)){
+a.setToolTipContent(a._button.tooltip)
+}};
+DwtHeaderTreeItem._mouseOutListener=function(e){
+var t=e.dwtObj;
+t.setToolTipContent(null)
+};
+DwtHeaderTreeItem._mouseUpListener=function(t){
+
+var a=t.dwtObj;
+var e=t.target&&t.target.id;
+if(e&&(e==a._headerButtonId)){
+return
+}
+DwtTreeItem._mouseUpListener.apply(null,arguments)
+};
+DwtHeaderTreeItem.prototype._focusByMouseUpEvent=function(t){
+var e=t.target&&t.target.id;
+if(e&&(e==this._headerButtonId)){
+return
+}
+DwtTreeItem.prototype._focusByMouseUpEvent.apply(this,arguments)
+}
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtTree")){
+DwtTree=function(a){
+if(arguments.length==0){
+return
+}
+a=Dwt.getParams(arguments,DwtTree.PARAMS);
+a.className=a.className||"DwtTree";
+DwtComposite.call(this,a);
+var e=[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP,DwtEvent.ONDBLCLICK];
+if(!AjxEnv.isIE){
+e=e.concat([DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT])
+}
+this._setEventHdlrs(e);
+var t=a.style;
+if(!t){
+this._style=DwtTree.SINGLE_STYLE
+}else{
+if(t==DwtTree.CHECKEDITEM_STYLE){
+t|=DwtTree.SINGLE_STYLE
+}
+this._style=t
+}
+this.isCheckedStyle=((this._style&DwtTree.CHECKEDITEM_STYLE)!=0);
+this.isCheckedByDefault=a.isCheckedByDefault;
+this._selectedItems=new AjxVector();
+this._selEv=new DwtSelectionEvent(true)
+};
+DwtTree.PARAMS=["parent","style","className","posStyle"];
+DwtTree.prototype=new DwtComposite;
+DwtTree.prototype.constructor=DwtTree;
+DwtTree.prototype.toString=function(){
+return"DwtTree"
+};
+DwtTree.SINGLE_STYLE=1;
+DwtTree.MULTI_STYLE=2;
+DwtTree.CHECKEDITEM_STYLE=4;
+DwtTree.ITEM_SELECTED=0;
+DwtTree.ITEM_DESELECTED=1;
+DwtTree.ITEM_CHECKED=2;
+DwtTree.ITEM_ACTIONED=3;
+DwtTree.ITEM_DBL_CLICKED=4;
+DwtTree.ITEM_EXPANDED=1;
+DwtTree.ITEM_COLLAPSED=2;
+DwtTree.prototype.getStyle=function(){
+return this._style
+};
+DwtTree.prototype.addSelectionListener=function(e){
+this.addListener(DwtEvent.SELECTION,e);
+if(DwtControl.globalSelectionListener){
+this.addListener(DwtEvent.SELECTION,DwtControl.globalSelectionListener)
+}};
+DwtTree.prototype.removeSelectionListener=function(e){
+this.removeListener(DwtEvent.SELECTION,e)
+};
+DwtTree.prototype.addTreeListener=function(e){
+this.addListener(DwtEvent.TREE,e)
+};
+DwtTree.prototype.removeTreeListener=function(e){
+this.removeListener(DwtEvent.TREE,e)
+};
+DwtTree.prototype.getItemCount=function(){
+return this._children.size()
+};
+DwtTree.prototype.getItems=function(){
+return this._children.getArray()
+};
+DwtTree.prototype.deselectAll=function(){
+var e=this._selectedItems.getArray();
+var o=this._selectedItems.size();
+for(var t=0;
+t<o;
+t++){
+e[t]._setSelected(false)
+}
+if(o>0){
+this._notifyListeners(DwtEvent.SELECTION,this._selectedItems.getArray(),DwtTree.ITEM_DESELECTED,null,this._selEv)
+}
+this._selectedItems.removeAll()
+};
+DwtTree.prototype.getSelection=function(){
+return this._selectedItems.getArray()
+};
+DwtTree.prototype.setSelection=function(n,r,d,e){
+var c=this._selectedItems.getArray();
+var h=this._selectedItems.size();
+var u;
+var t=0;
+var s=false;
+for(var o=0;
+o<h;
+o++){
+if(c[o]==n){
+s=true
+}else{
+c[o]._setSelected(false);
+this._selectedItems.remove(c[o]);
+if(u==null){
+u=new Array()
+}
+u[t++]=c[o]
+}}
+if(u&&!r){
+this._notifyListeners(DwtEvent.SELECTION,u,DwtTree.ITEM_DESELECTED,null,this._selEv,d)
+}
+if(s){
+return
+}
+this._selectedItems.add(n);
+this._expandUp(n);
+if(n._setSelected(true,e)&&!r){
+this._notifyListeners(DwtEvent.SELECTION,[n],DwtTree.ITEM_SELECTED,null,this._selEv,d)
+}};
+DwtTree.prototype.getSelectionCount=function(){
+return this._selectedItems.size()
+};
+DwtTree.prototype.addChild=function(e){};
+DwtTree.prototype.addSeparator=function(){
+var e=document.createElement("div");
+e.className="vSpace";
+this.getHtmlElement().appendChild(e)
+};
+DwtTree.prototype._expandUp=function(t){
+var e=t.parent;
+while(e instanceof DwtTreeItem){
+e.setExpanded(true);
+e.setVisible(true);
+e=e.parent
+}};
+DwtTree.prototype._addItem=function(t,e){
+this._children.add(t,e);
+var o=this.getHtmlElement();
+var a=o.childNodes.length;
+if(e==null||e>a){
+o.appendChild(t.getHtmlElement())
+}else{
+o.insertBefore(t.getHtmlElement(),o.childNodes[e])
+}};
+DwtTree.prototype.sort=function(e){
+this._children.sort(e);
+var t=document.createDocumentFragment();
+this._children.foreach(function(o,a){
+t.appendChild(o.getHtmlElement());
+o._index=a
+}
+);
+this.getHtmlElement().appendChild(t)
+};
+DwtTree.prototype.removeChild=function(e){
+this._children.remove(e);
+this._selectedItems.remove(e);
+this.getHtmlElement().removeChild(e.getHtmlElement())
+};
+DwtTree.prototype._getNextTreeItem=function(n){
+var a=this.getSelection();
+var c=(a&&a.length)?a[0]:null;
+var e=null,h=-1;
+var r=this.getTreeItemList(true);
+if(c){
+for(var o=0,s=r.length;
+o<s;
+o++){
+var t=r[o];
+if(t==c){
+h=n?o+1:o-1;
+break
+}}
+e=r[h]
+}else{
+if(r&&r.length){
+e=n?r[0]:r[r.length-1]
+}}
+return e
+};
+DwtTree.prototype.getTreeItemList=function(e){
+return this._addToList([],e)
+};
+DwtTree.prototype._addToList=function(n,s,o){
+if(o&&!o._isSeparator&&(!s||(o.getVisible()&&o._selectionEnabled))){
+n.push(o)
+}
+if(!o||!s||o._expanded){
+var a=o||this;
+var t=a.getChildren?a.getChildren():[];
+for(var e=0;
+e<t.length;
+e++){
+this._addToList(n,s,t[e])
+}}
+return n
+};
+DwtTree.prototype._deselect=function(e){
+if(this._selectedItems.contains(e)){
+this._selectedItems.remove(e);
+e._setSelected(false);
+this._notifyListeners(DwtEvent.SELECTION,[e],DwtTree.ITEM_DESELECTED,null,this._selEv)
+}};
+DwtTree.prototype._itemActioned=function(t,e){
+if(this._actionedItem){
+this._actionedItem._setActioned(false);
+this._notifyListeners(DwtEvent.SELECTION,[this._actionedItem],DwtTree.ITEM_DESELECTED,e,this._selEv)
+}
+this._actionedItem=t;
+t._setActioned(true);
+this._notifyListeners(DwtEvent.SELECTION,[t],DwtTree.ITEM_ACTIONED,e,this._selEv)
+};
+DwtTree.prototype._itemChecked=function(t,e){
+this._notifyListeners(DwtEvent.SELECTION,[t],DwtTree.ITEM_CHECKED,e,this._selEv)
+};
+DwtTree.prototype._itemClicked=function(n,o){
+var t;
+var e=this._selectedItems.getArray();
+var s=this._selectedItems.size();
+if(this._style&DwtTree.SINGLE_STYLE||(!o.shiftKey&&!o.ctrlKey)){
+if(s>0){
+for(t=0;
+t<s;
+t++){
+e[t]._setSelected(false)
+}
+this._notifyListeners(DwtEvent.SELECTION,this._selectedItems.getArray(),DwtTree.ITEM_DESELECTED,o,this._selEv);
+this._selectedItems.removeAll()
+}
+this._selectedItems.add(n);
+if(n._setSelected(true)){
+this._notifyListeners(DwtEvent.SELECTION,[n],DwtTree.ITEM_SELECTED,o,this._selEv)
+}}else{
+if(o.ctrlKey){
+if(this._selectedItems.contains(n)){
+this._selectedItems.remove(n);
+n._setSelected(false);
+this._notifyListeners(DwtEvent.SELECTION,[n],DwtTree.ITEM_DESELECTED,o,this._selEv)
+}else{
+this._selectedItems.add(n);
+if(n._setSelected(true)){
+this._notifyListeners(DwtEvent.SELECTION,[n],DwtTree.ITEM_SELECTED,o,this._selEv)
+}}}else{}}};
+DwtTree.prototype._itemDblClicked=function(t,e){
+this._notifyListeners(DwtEvent.SELECTION,[t],DwtTree.ITEM_DBL_CLICKED,e,this._selEv)
+};
+DwtTree.prototype._itemExpanded=function(a,t,e){
+if(!e){
+this._notifyListeners(DwtEvent.TREE,[a],DwtTree.ITEM_EXPANDED,t,DwtShell.treeEvent)
+}};
+DwtTree.prototype._itemCollapsed=function(c,s,n){
+var o;
+if(!n){
+this._notifyListeners(DwtEvent.TREE,[c],DwtTree.ITEM_COLLAPSED,s,DwtShell.treeEvent)
+}
+var h=false;
+var r=this._selectedItems.getArray();
+var e=this._selectedItems.size();
+var d;
+var t=0;
+for(o=0;
+o<e;
+o++){
+if(r[o]._isChildOf(c)){
+h=true;
+if(d==null){
+d=new Array()
+}
+d[t++]=r[o];
+r[o]._setSelected(false);
+this._selectedItems.remove(r[o])
+}}
+if(d){
+this._notifyListeners(DwtEvent.SELECTION,d,DwtTree.ITEM_DESELECTED,s,this._selEv)
+}
+if(h&&!this._selectedItems.contains(c)){
+this._selectedItems.add(c);
+if(c._setSelected(true)){
+this._notifyListeners(DwtEvent.SELECTION,[c],DwtTree.ITEM_SELECTED,s,this._selEv)
+}}};
+DwtTree.prototype._notifyListeners=function(s,e,o,a,t,n){
+if(this.isListenerRegistered(s)){
+if(a){
+DwtUiEvent.copy(t,a)
+}
+t.items=e;
+if(e.length==1){
+t.item=e[0]
+}
+t.detail=o;
+t.kbNavEvent=n;
+this.notifyListeners(s,t)
+}}
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtText")){
+DwtText=function(e){
+if(arguments.length==0){
+return
+}
+e=Dwt.getParams(arguments,DwtText.PARAMS);
+e.className=e.className||"DwtText";
+DwtControl.call(this,e)
+};
+DwtText.PARAMS=["parent","className","posStyle"];
+DwtText.prototype=new DwtControl;
+DwtText.prototype.constructor=DwtText;
+DwtText.prototype.toString=function(){
+return"DwtText"
+};
+DwtText.prototype.getTabGroupMember=function(){
+return null
+};
+DwtText.prototype.setText=function(e){
+if(!this._textNode){
+this._textNode=document.createTextNode(e);
+this.getHtmlElement().appendChild(this._textNode)
+}else{
+this._textNode.data=e
+}};
+DwtText.prototype.getText=function(){
+return this._textNode?this._textNode.data:""
+};
+DwtText.prototype.getTextNode=function(){
+return this._textNode
+}
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtIframe")){
+DwtIframe=function(o){
+o.posStyle=o.posStyle||DwtControl.STATIC_STYLE;
+o.className=o.className||"DwtIframe";
+DwtControl.call(this,o);
+this._styles=o.styles;
+this._noscroll=o.noscroll;
+this._iframeID=o.id?DwtId.getIframeId(o.id):Dwt.getNextId();
+this._onLoadHandler=o.onload;
+this._processHtmlCallback=o.processHtmlCallback;
+this._hidden=o.hidden;
+this._createFrame(o.html);
+if(o.useKbMgmt){
+var t=this.getIframe();
+var e=Dwt.getIframeDoc(t);
+var a=AjxEnv.isIE?e:t.contentWindow;
+Dwt.setHandler(a,DwtEvent.ONKEYDOWN,DwtKeyboardMgr.__keyDownHdlr);
+Dwt.setHandler(a,DwtEvent.ONKEYUP,DwtKeyboardMgr.__keyUpHdlr);
+Dwt.setHandler(a,DwtEvent.ONKEYPRESS,DwtKeyboardMgr.__keyPressHdlr)
+}};
+DwtIframe.prototype=new DwtControl;
+DwtIframe.prototype.constructor=DwtIframe;
+DwtIframe.prototype.toString=function(){
+return"DwtIframe"
+};
+DwtIframe.prototype.getIframe=function(){
+return document.getElementById(this._iframeID)
+};
+DwtIframe.prototype.getDocument=function(){
+return this.getIframe().contentWindow.document
+};
+DwtIframe.prototype._rawEventHandler=function(r){
+var a=this.getIframe();
+var o=a.contentWindow;
+if(AjxEnv.isIE){
+r=o.event
+}
+var e;
+if(/mouse|context|click|select/i.test(r.type)){
+e=new DwtMouseEvent(true)
+}else{
+e=new DwtUiEvent(true)
+}
+e.setFromDhtmlEvent(r);
+if(r.type=="mousedown"&&DwtMenu&&DwtMenu._outsideMouseDownListener){
+DwtMenu._outsideMouseDownListener(r)
+}
+var n=e.type.toLowerCase();
+if(!/^on/.test(n)){
+n="on"+n
+}
+var s=this.getLocation();
+if(!AjxEnv.isIE){
+var h=o.document;
+var t=h.documentElement.scrollLeft||(h.body?h.body.scrollLeft:0);
+var u=h.documentElement.scrollTop||(h.body?h.body.scrollTop:0);
+s.x-=t;
+s.y-=u
+}
+e.docX+=s.x;
+e.docY+=s.y;
+e.elementX+=s.x;
+e.elementY+=s.y;
+var d=DwtMouseEventCapture.getCaptureObj();
+if(AjxEnv.isIE||AjxEnv.isSafari||!d){
+DwtEventManager.notifyListeners(n,e);
+this.parent.notifyListeners(n,e)
+}else{
+var c=document.createEvent("MouseEvents");
+c.initMouseEvent(r.type,true,true,document.defaultView,0,r.screenX,r.screenY,e.docX,e.docY,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.button,r.relatedTarget);
+document.body.dispatchEvent(c)
+}
+e.setToDhtmlEvent(r);
+return e._returnValue
+};
+DwtIframe._forwardEvents=[DwtEvent.ONCHANGE,DwtEvent.ONCLICK,DwtEvent.ONDBLCLICK,DwtEvent.ONFOCUS,DwtEvent.ONKEYDOWN,DwtEvent.ONKEYPRESS,DwtEvent.ONKEYUP,DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEENTER,DwtEvent.ONMOUSELEAVE,DwtEvent.ONMOUSEMOVE,DwtEvent.ONMOUSEOUT,DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEUP,DwtEvent.ONSELECTSTART];
+DwtIframe.prototype._createFrame=function(t){
+var e=this.getHTMLElId();
+function a(s){
+var n=document.getElementById(e);
+var o=DwtControl.findControl(n);
+return o._rawEventHandler(s)
+}
+(function(){
+var c,h=[],r=0,o;
+var s=document.getElementById(e);
+var n=DwtControl.findControl(s);
+h[r++]="<iframe";
+if(n._noscroll){
+h[r++]=" scrolling='no'"
+}
+if(n._hidden){
+h[r++]=" style='visibility:hidden'"
+}
+h[r++]=" frameborder='0' width='100%' id='";
+h[r++]=n._iframeID;
+h[r++]="' name='"+n._iframeID+"'";
+if(n._onLoadHandler){
+h[r++]=" onload='"+n._onLoadHandler+"'"
+}
+h[r++]=" src='javascript:\"\";' ></iframe>";
+n.setContent(h.join(""));
+t=t.replace(/(<style[^>]*>)[\s\t\u00A0]*((.|\n)*?)[\s\t\u00A0]*<\x2fstyle>/mgi,function(d,m,u){
+return m+u.replace(/@import.*?(;|[\s\t\u00A0]*$)/gi,"")+"</style>"
+}
+);
+c=n.getIframe();
+o=Dwt.getIframeDoc(c);
+o.open();
+if(n._styles){
+o.write(["<style type='text/css'>",n._styles,"</style>"].join(""))
+}
+o.write(t);
+o.close();
+if(n._processHtmlCallback){
+n._processHtmlCallback.run(o)
+}
+h=o.documentElement.style;
+h.margin=h.padding="0";
+if(o.body){
+o.body.style.margin="0"
+}
+h=DwtIframe._forwardEvents;
+if(!AjxEnv.isIE){
+o=c.contentWindow
+}
+for(r=h.length;
+--r>=0;
+){
+o[h[r]]=a
+}}
+)()
+};
+DwtIframe.prototype._resetEventHandlers=function(){
+var e=this;
+function t(a){
+return e._rawEventHandler(a)
+}
+(function(){
+var s,n=[],o=0,a;
+s=e.getIframe();
+a=Dwt.getIframeDoc(s);
+n=DwtIframe._forwardEvents;
+if(!AjxEnv.isIE){
+a=s.contentWindow
+}
+for(o=n.length;
+--o>=0;
+){
+a[n[o]]=t
+}}
+)()
+}
+}
+if(AjxPackage.define("ajax.dwt.widgets.DwtForm")){
+DwtForm=function(e){
+if(arguments.length==0){
+return
+}
+e=Dwt.getParams(arguments,DwtForm.PARAMS);
+e.className=e.className||"DwtForm";
+DwtComposite.apply(this,arguments);
+this.setScrollStyle(DwtControl.SCROLL);
+this._tabGroup=new DwtTabGroup(this._htmlElId);
+this._context={
+set:AjxCallback.simpleClosure(this.set,this),get:AjxCallback.simpleClosure(this.get,this)};
+this._dirty={};
+this._ignore={};
+this._invalid={};
+this.setModel(e.model);
+this.setForm(e.form);
+this.reset()
+};
+DwtForm.prototype=new DwtComposite;
+DwtForm.prototype.constructor=DwtForm;
+DwtForm.prototype.toString=function(){
+return"DwtForm"
+};
+DwtForm.PARAMS=DwtControl.PARAMS.concat("form","model");
+DwtForm.prototype.setValue=function(s,a,t){
+if(typeof s!="string"){
+s=String(s)
+}
+if(s.match(/\./)||s.match(/\[/)){
+var n=s.replace(/\[(\d+)\](\.)?/,".$1$2").split(".");
+var o=this.getControl(n[0]);
+if(Dwt.instanceOf(o,"DwtForm")){
+o.setValue(n.slice(1).join("."),a,t)
+}
+return
+}
+var e=this._items[s];
+if(!e){
+return
+}
+if(!t&&a==e.value){
+return
+}
+this._setModelValue(s,a);
+this._setControlValue(s,a)
+};
+DwtForm.prototype.getValue=function(s,e){
+if(typeof s!="string"){
+s=String(s)
+}
+if(s.match(/\./)||s.match(/\[/)){
+var n=s.replace(/\[(\d+)\](\.)?/,".$1$2").split(".");
+var o=this.getControl(n[0]);
+if(Dwt.instanceOf(o,"DwtForm")){
+return o.getValue(n.slice(1).join("."))
+}
+return null
+}
+var t=this._items[s];
+if(!t){
+return
+}
+if(t.getter){
+return this._call(t.getter)||e
+}
+var a=this._getControlValue(s)||t.value;
+return a||e
+};
+DwtForm.prototype.getControl=function(t){
+if(typeof t!="string"){
+t=String(t)
+}
+var e=this._items[t];
+return e&&e.control
+};
+DwtForm.prototype.isRelevant=function(e){
+return this.isVisible(e)&&this.isEnabled(e)
+};
+DwtForm.prototype.getTabGroupMember=function(){
+return this._tabGroup
+};
+DwtForm.prototype.setLabel=function(o,e){
+var t=this._items[o];
+if(!t){
+return
+}
+if(e==this.getLabel(o)){
+return
+}
+var a=t.control;
+if(!a){
+return
+}
+if(a.setLabel){
+a.setLabel(e);
+return
+}
+if(a.setText){
+a.setText(e);
+return
+}};
+DwtForm.prototype.getLabel=function(a){
+var e=this._items[a];
+var t=e&&e.control;
+if(t){
+if(t.getLabel){
+return t.getLabel()
+}
+if(t.getText){
+return t.getText()
+}}
+return""
+};
+DwtForm.prototype.setVisible=function(n,o){
+if(arguments.length==1){
+DwtComposite.prototype.setVisible.call(this,arguments[0]);
+return
+}
+var t=this._items[n];
+var a=t&&t.control;
+if(!a){
+return
+}
+if(a.setVisible){
+a.setVisible(o)
+}else{
+Dwt.setVisible(a,o)
+}
+var e=document.getElementById([this._htmlElId,n,"row"].join("_"));
+if(e){
+Dwt.setVisible(e,o)
+}};
+DwtForm.prototype.isVisible=function(a){
+if(arguments.length==0){
+return DwtComposite.prototype.isVisible.call(this)
+}
+var e=this._items[a];
+var t=e&&e.control;
+if(!t){
+return false
+}
+if(t.getVisible){
+return t.getVisible()
+}
+if(t.isVisible){
+return t.isVisible()
+}
+return Dwt.getVisible(t)
+};
+DwtForm.prototype.setEnabled=function(o,e){
+if(arguments.length==1){
+DwtComposite.prototype.setEnabled.call(this,arguments[0]);
+return
+}
+var t=this._items[o];
+var a=t&&t.control;
+if(!a){
+return
+}
+if(a.setEnabled){
+a.setEnabled(e)
+}else{
+a.disabled=!e
+}};
+DwtForm.prototype.isEnabled=function(a){
+if(arguments.length==0){
+return DwtComposite.prototype.isEnabled.call(this)
+}
+var e=this._items[a];
+var t=e&&e.control;
+if(!t){
+return false
+}
+if(t.isEnabled){
+return t.isEnabled()
+}
+if(t.getEnabled){
+return t.getEnabled()
+}
+return !t.disabled
+};
+DwtForm.prototype.setValid=function(t,e){
+if(typeof t=="boolean"){
+e=arguments[0];
+for(t in this._items){
+this.setValid(t,e)
+}
+return
+}
+if(e){
+delete this._invalid[t]
+}else{
+this._invalid[t]=true
+}};
+DwtForm.prototype.isValid=function(e){
+if(arguments.length==0){
+for(var e in this._invalid){
+return false
+}
+return true
+}
+return !(e in this._invalid)
+};
+DwtForm.prototype.getInvalidItems=function(){
+return AjxUtil.keys(this._invalid)
+};
+DwtForm.prototype.setDirty=function(o,t,e){
+if(typeof o=="boolean"){
+t=arguments[0];
+for(o in this._items){
+this.setDirty(o,t,true)
+}
+if(!e&&this._ondirty){
+this._call(this._ondirty,["*"])
+}
+return
+}
+if(t){
+this._dirty[o]=true
+}else{
+delete this._dirty[o]
+}
+if(!e&&this._ondirty){
+var a=this._items[o];
+if(!a.ignore||!this._call(a.ignore)){
+this._call(this._ondirty,[o])
+}}};
+DwtForm.prototype.isDirty=function(t){
+if(arguments.length==0){
+for(var t in this._dirty){
+var e=this._items[t];
+if(e.ignore&&this._call(e.ignore)){
+continue
+}
+return true
+}
+return false
+}
+var e=this._items[t];
+return e.ignore&&this._call(e.ignore)?false:t in this._dirty
+};
+DwtForm.prototype.getDirtyItems=function(){
+DwtForm.__acceptDirtyItem.form=this;
+return AjxUtil.keys(this._dirty,DwtForm.__acceptDirtyItem)
+};
+DwtForm.__acceptDirtyItem=function(a){
+var t=arguments.callee.form;
+var e=t._items[a];
+return !e.ignore||!t._call(e.ignore)
+};
+DwtForm.prototype.setIgnore=function(t,e){
+if(typeof t=="boolean"){
+this._ignore={};
+return
+}
+if(e){
+this._ignore[t]=true;
+return
+}
+delete this._ignore[t]
+};
+DwtForm.prototype.isIgnore=function(e){
+return e in this._ignore
+};
+DwtForm.prototype.set=function(t,e){
+this.setValue(t,e,true);
+this.update()
+};
+DwtForm.prototype.get=DwtForm.prototype.getValue;
+DwtForm.prototype.setModel=function(e,t){
+this._context.model=this.model=e
+};
+DwtForm.prototype.setForm=function(e){
+this._context.form=this.form=e;
+this._createHtml(e.template)
+};
+DwtForm.prototype.validate=function(o){
+if(arguments.length==0){
+this.setValid(true);
+for(var o in this._items){
+var t=this._items[o];
+try{
+this.setValid(t.validator?t.validator(this.getValue(o)):true)
+}
+catch(a){}}
+return this.isValid()
+}
+var t=this._items[o];
+if(!t){
+return true
+}
+try{
+this.setValid(t.validator?t.validator(this.getValue(o)):true)
+}
+catch(a){}
+return !(o in this._invalid)
+};
+DwtForm.prototype.reset=function(o){
+this._dirty={};
+this._ignore={};
+this._invalid={};
+for(var a in this._items){
+var t=this._items[a];
+if(t.control instanceof DwtForm){
+t.control.reset(o)
+}
+var e=this._items[a].def;
+if(!e){
+continue
+}
+this._initControl(e,o)
+}
+this.update();
+for(var a in this._items){
+var t=this._items[a];
+t.ovalue=t.value
+}
+this.setDirty(false);
+this.validate();
+if(this._onreset){
+this._call(this._onreset)
+}};
+DwtForm.prototype.update=function(){
+for(var t in this._items){
+var e=this._items[t];
+if(e.control instanceof DwtForm){
+e.control.update()
+}
+if(e.getter){
+this.setValue(t,this._call(e.getter))
+}}
+for(var t in this._items){
+var e=this._items[t];
+if(e.visible){
+this.setVisible(t,Boolean(this._call(e.visible)))
+}
+if(e.enabled){
+this.setEnabled(t,Boolean(this._call(e.enabled)))
+}
+if(e.ignore){
+this.setIgnore(t,Boolean(this._call(e.ignore)))
+}}
+if(this._onupdate){
+this._call(this._onupdate)
+}};
+DwtForm.prototype._setModelValue=function(o,a){
+var t=this._items[o];
+t.value=t.setter?this._call(t.setter,[a]):a;
+var e=!Boolean(this._call(t.equals,[t.value,t.ovalue]));
+this.setDirty(o,e);
+this.validate(o);
+return e
+};
+DwtForm.prototype._setControlValue=function(a,e){
+var t=this._items[a].control;
+if(t){
+if(t instanceof DwtCheckbox||t instanceof DwtRadioButton){
+t.setSelected(e);
+return
+}
+if(t instanceof DwtMenuItem&&t.isStyle(DwtMenuItem.CHECK_STYLE)){
+t.setChecked(e,true);
+return
+}
+if(t.setSelectedValue){
+t.setSelectedValue(e);
+return
+}
+if(t.setValue){
+t.setValue(e);
+return
+}
+if(t.setText&&!(t instanceof DwtButton)){
+t.setText(e);
+return
+}
+if(!(t instanceof DwtControl)){
+if(t.type=="checkbox"||t=="radio"){
+t.checked=e
+}else{
+t.value=e
+}
+return
+}}};
+DwtForm.prototype._getControlValue=function(t){
+var e=this._items[t].control;
+if(e){
+if(e instanceof DwtCheckbox||e instanceof DwtRadioButton){
+return e.isSelected()
+}
+if(e.getSelectedValue){
+return e.getSelectedValue()
+}
+if(e.getValue){
+return e.getValue()
+}
+if(e.getText&&!(e instanceof DwtButton)){
+return e.getText()
+}
+if(!(e instanceof DwtControl)){
+if(e.type=="checkbox"||e=="radio"){
+return e.checked
+}
+return e.value
+}}};
+DwtForm.prototype._deleteItem=function(e){
+delete this._items[e];
+delete this._dirty[e];
+delete this._invalid[e];
+delete this._ignore[e]
+};
+DwtForm.prototype._call=function(t,e){
+if(t){
+if(e){
+return t.apply(this,e)
+}
+return t.call(this)
+}};
+DwtForm.prototype._createHtml=function(e){
+this._createHtmlFromTemplate(e||this.TEMPLATE,{
+id:this._htmlElId}
+)
+};
+DwtForm.prototype._createHtmlFromTemplate=function(t,s){
+DwtComposite.prototype._createHtmlFromTemplate.apply(this,arguments);
+var a=[];
+this._items={};
+this._tabGroup.removeAllMembers();
+this._onupdate=null;
+this._onreset=null;
+this._ondirty=null;
+var e=this.form;
+if(e&&e.items){
+this._registerControls(e.items,null,a);
+this._onupdate=DwtForm.__makeFunc(e.onupdate);
+this._onreset=DwtForm.__makeFunc(e.onreset);
+this._ondirty=DwtForm.__makeFunc(e.ondirty)
+}
+var c=this.getHtmlElement().getElementsByTagName("A");
+for(var r=0;
+r<c.length;
+r++){
+var h=c[r];
+if(!h.href||h.getAttribute("notab")=="true"){
+continue
+}
+if(this._items[h.id]){
+continue
+}
+a.push({
+tabindex:h.getAttribute("tabindex")||Number.MAX_VALUE,control:h}
+)
+}
+a.sort(DwtForm.__byTabIndex);
+for(var r=0;
+r<a.length;
+r++){
+var n=a[r].control;
+var o=(n.getTabGroupMember&&n.getTabGroupMember())||n;
+this._tabGroup.addMember(o)
+}};
+DwtForm.prototype._registerControls=function(a,n,e,s,o,r){
+for(var t=0;
+t<a.length;
+t++){
+this._registerControl(a[t],n,e,s,o,r)
+}};
+DwtForm.prototype._registerControl=function(d,t,o,n,p,u){
+var e=d.id||[this._htmlElId,Dwt.getNextId()].join("_");
+var w=this._items[e]={
+id:e,def:d,parentDef:t,equals:DwtForm.__makeFunc(d.equals)||DwtForm.__equals,getter:DwtForm.__makeGetter(d),setter:DwtForm.__makeSetter(d),value:d.value,visible:DwtForm.__makeFunc(d.visible),enabled:DwtForm.__makeFunc(d.enabled),validator:DwtForm.__makeFunc(d.validator),ignore:DwtForm.__makeFunc(d.ignore),control:d.control};
+if(d.aka){
+this._items[e].aka=d.aka;
+this._items[d.aka]=w
+}
+var c=w.control;
+if(c){
+return c
+}
+p=p||this;
+var m=d.type=d.type||u;
+var h=document.getElementById([p._htmlElId,e].join("_"));
+if(Dwt.instanceOf(m,"DwtRadioButtonGroup")){
+c=new window[m]({}
+);
+w.control=c;
+var g={
+name:[p._htmlElId,e].join("_"),value:d.value};
+if(d.items){
+for(var r=0;
+r<d.items.length;
+r++){
+var s=d.items[r];
+var f=s.checked||s.value==d.value;
+var a=this._registerControl(s,d,o,g,p,"DwtRadioButton");
+a.setValue(s.value);
+this._items[s.id].value=f;
+c.addRadio(a.getInputElement().id,a,f);
+var y=DwtForm.__makeFunc(s.onclick||d.onclick);
+a.addSelectionListener(new AjxListener(this,this._radio2group2model,[s.id,e,y]));
+DwtForm.__hack_fixRadioButtonHandler(a)
+}}}else{
+if(m){
+if(Dwt.instanceOf(m,"DwtInputField")){
+w.value=w.value||""
+}
+if(Dwt.instanceOf(m,"DwtFormRows")){
+w.equals=DwtFormRows.__equals
+}
+if(h){
+c=w.control=this._createControl(d,t,o,n,p,u)
+}}else{
+if(h){
+this._attachElementHandlers(d,t,o,p,h);
+c=w.control=h;
+if(d.items){
+this._registerControls(d.items,d,o,null,p,null)
+}}}}
+if(h&&c instanceof DwtControl){
+c.replaceElement(h)
+}
+if(h&&c instanceof DwtInputField){
+c.getInputElement().id+="_input"
+}
+if(d.notab==null){
+d.notab=h&&h.getAttribute("notab")=="true"
+}
+if(o&&c&&!d.notab&&!(c instanceof DwtRadioButtonGroup)){
+o.push({
+tabindex:(h&&h.getAttribute("tabindex"))||Number.MAX_VALUE,control:c}
+)
+}
+if(c instanceof DwtListView){
+w.getter=w.getter||AjxCallback.simpleClosure(this.__list_getValue,this,e);
+w.setter=w.setter||AjxCallback.simpleClosure(this.__list_setValue,this,e)
+}
+return c
+};
+DwtForm.prototype._attachElementHandlers=function(r,a,o,d,s){
+var t=r.id;
+var e=s.nodeName.toLowerCase();
+var c=s.type;
+if(c=="checkbox"||c=="radio"){
+var h;
+if(c=="radio"){
+h=s.name;
+if(!this._items[h]){
+this._items[h]={
+id:h}
+}
+if(s.checked){
+this._items[h].value=s.value
+}}
+var m=s.onclick;
+var u=DwtForm.__makeFunc(r.onclick);
+s.onclick=AjxCallback.simpleClosure(this._htmlInput_checked,this,t,h,u,m)
+}else{
+if(e=="select"){
+var n=s.onchange;
+var u=DwtForm.__makeFunc(r.onchange);
+s.onchange=AjxCallback.simpleClosure(this._htmlSelect_selectedIndex,this,t,u,n)
+}else{
+if(e=="button"||e=="a"||c=="button"||c=="reset"||c=="submit"){
+var m=s.onclick;
+var u=DwtForm.__makeFunc(r.onclick);
+s.onclick=AjxCallback.simpleClosure(this._htmlElement,this,t,u,m)
+}else{
+if(e=="textarea"||e=="input"){
+var n=s.onchange;
+var u=DwtForm.__makeFunc(r.onchange);
+s.onchange=AjxCallback.simpleClosure(this._htmlInput_value,this,t,u,n)
+}}}}
+return s
+};
+DwtForm.prototype._createControl=function(u,c,C,B,f,h){
+var x=u.id||[this._htmlElId,Dwt.getNextId()].join("_");
+var n=u.type=u.type||h;
+B=B?AjxUtil.createProxy(B):{};
+B.id=B.id||[this._htmlElId,x].join("_");
+B.parent=f||this;
+B.template=u.template||B.template;
+B.className=u.className||B.className;
+var W=Dwt.instanceOf(n,"DwtRadioButton");
+var k=Dwt.instanceOf(n,"DwtCheckbox");
+if(W||k){
+B.name=u.name||B.name;
+B.checked=u.checked!=null?u.checked:B.checked
+}
+var m=Dwt.instanceOf(n,"DwtInputField");
+if(m){
+B.type=u.password?DwtInputField.PASSWORD:null;
+B.size=u.cols;
+B.rows=u.rows
+}
+var s=Dwt.instanceOf(n,"DwtTabViewPage");
+if(s){
+B.contentTemplate=u.template;
+delete u.template
+}
+B.formItemDef=u;
+if(u.params){
+for(var q in u.params){
+B[q]=u.params[q]
+}}
+var g=new window[n](B);
+if(g instanceof DwtSelect){
+var o=u.items;
+if(o){
+for(var O=0;
+O<o.length;
+O++){
+var v=o[O];
+v.displayValue=v.label||v.value;
+g.addOption(v)
+}}
+var t=DwtForm.__makeFunc(u.onchange);
+g.addChangeListener(new AjxListener(this,this._control2model,[x,t]))
+}else{
+if(g instanceof DwtButton||g instanceof DwtMenuItem){
+if(u.label){
+g.setText(u.label)
+}
+if(u.image){
+g.setImage(u.image)
+}
+if(u.menu){
+var a=Dwt.instanceOf(u.menu.type||"DwtMenu","DwtMenu");
+var e;
+if(a){
+e=this._registerControl(u.menu,u,null,null,g,"DwtMenu")
+}else{
+e=new DwtMenu({
+parent:g}
+);
+var A=Dwt.instanceOf(u.menu.type,"DwtCalendar")?DwtMenu.CALENDAR_PICKER_STYLE:DwtMenu.GENERIC_WIDGET_STYLE;
+this._registerControl(u.menu,u,null,{
+style:A}
+,e)
+}
+g.setMenu(e)
+}
+var T;
+if(f instanceof DwtToolBar||f instanceof DwtMenu){
+T=c.id
+}
+var t=DwtForm.__makeFunc(u.onclick||(c&&c.onclick));
+g.addSelectionListener(new AjxListener(this,this._item2parent,[x,T,t]))
+}else{
+if(g instanceof DwtCheckbox&&!(g instanceof DwtRadioButton)){
+var t=DwtForm.__makeFunc(u.onclick);
+g.addSelectionListener(new AjxListener(this,this._control2model,[x,t]))
+}else{
+if(g instanceof DwtInputField){
+var t=DwtForm.__makeFunc(u.onchange);
+var z=AjxCallback.simpleClosure(this._input2model2handler,this,x,t);
+g.setHandler(DwtEvent.ONKEYUP,z);
+g.setHint(u.hint)
+}else{
+if(g instanceof DwtListView){
+g.addSelectionListener(new AjxListener(this,this._handleListSelection,[x]))
+}else{
+if(g instanceof DwtMenu){
+if(u.items){
+var j=u.items;
+for(var O=0;
+O<j.length;
+O++){
+var w=j[O];
+if(w.type==DwtMenuItem.SEPARATOR_STYLE){
+new DwtMenuItem({
+parent:g,style:DwtMenuItem.SEPARATOR_STYLE}
+);
+continue
+}
+this._registerControl(w,u,null,null,g,"DwtMenuItem")
+}}}else{
+if(g instanceof DwtTabView){
+var d=u.items;
+if(d){
+this._registerControls(d,u,null,null,g,"DwtTabViewPage")
+}}else{
+if(g instanceof DwtTabViewPage&&f instanceof DwtTabView){
+var D=f.addTab(u.label,g);
+if(u.image){
+f.getTabButton(D).setImage(u.image)
+}
+if(u.items){
+this._registerControls(u.items,u,C,null,g)
+}}else{
+if(g instanceof DwtToolBar){
+var y=u.items;
+if(y){
+for(var O=0;
+O<y.length;
+O++){
+var r=y[O];
+if(r.type==DwtToolBar.SPACER){
+g.addSpacer(r.size);
+continue
+}
+if(r.type==DwtToolBar.SEPARATOR){
+g.addSeparator(r.className);
+continue
+}
+if(r.type==DwtToolBar.FILLER){
+g.addFiller(r.className);
+continue
+}
+this._registerControl(r,u,null,null,g,"DwtToolBarButton")
+}}}else{
+if(g instanceof DwtComposite){
+if(u.items){
+this._registerControls(u.items,u,C,null,g)
+}}}}}}}}}}}
+return g
+};
+DwtForm.prototype._initControl=function(e,o){
+var a=e.id;
+if(e.label){
+this.setLabel(a,e.label)
+}
+var t=this._items[a];
+if(o){
+t.ovalue=t.value
+}else{
+if(e.value){
+if(Dwt.instanceOf(e.type,"DwtRadioButton")){
+t.ovalue=t.value=t.control.isSelected()
+}else{
+this.setValue(a,e.value,true);
+t.ovalue=t.value
+}}else{
+t.ovalue=null
+}}
+if(typeof e.enabled=="boolean"){
+this.setEnabled(a,e.enabled)
+}
+if(typeof e.visible=="boolean"){
+this.setVisible(a,e.visible)
+}};
+DwtForm.prototype._htmlElement=function(o,a,t,e){
+if(a){
+this._call(a,[o])
+}
+if(t){
+t(e)
+}};
+DwtForm.prototype._htmlInput_checked=function(r,s,a,t,e){
+var n=this.getControl(r);
+var o=n.checked;
+this._setModelValue(r,o);
+if(s&&o){
+this._setModelValue(s,n.value)
+}
+this.update();
+this._htmlElement(r,a,t,e)
+};
+DwtForm.prototype._htmlInput_value=function(o,a,t,e){
+this._setModelValue(o,this.getControl(o).value);
+this.update();
+this._htmlElement(o,a,t,e)
+};
+DwtForm.prototype._htmlSelect_selectedIndex=function(n,o,a,t){
+var e=this.getControl(n);
+this._setModelValue(n,e.options[e.selectedIndex].value);
+this.update();
+this._htmlElement(n,o,a,t)
+};
+DwtForm.prototype._control2model=function(t,e){
+this._setModelValue(t,this._getControlValue(t));
+this.update();
+if(e){
+this._call(e,[t])
+}};
+DwtForm.prototype._radio2group2model=function(e,t,a){
+this._setModelValue(t,this.getControl(e).getValue());
+this._setModelValue(e,this._getControlValue(e));
+this.update();
+if(a){
+this._call(a,[e])
+}};
+DwtForm.prototype._input2model2handler=function(t,e){
+this._setModelValue(t,this._getControlValue(t));
+this.update();
+if(e){
+this._call(e,[t])
+}};
+DwtForm.prototype._item2parent=function(o,n,t){
+var a=this.getControl(o);
+var e=this._items[o].def;
+if(a instanceof DwtButtonColorPicker||(e.menu&&!e.onclick)){
+a._toggleMenu()
+}else{
+if(n){
+this._setModelValue(n,this._getControlValue(o)||o);
+this.update()
+}}
+if(t){
+this._call(t,[o])
+}};
+DwtForm.prototype._handleListSelection=function(t,e){
+this.update()
+};
+DwtForm.prototype.__list_getValue=function(e){
+return this.getControl(e).getSelection()
+};
+DwtForm.prototype.__list_setValue=function(t,e){
+this.getControl(t).setSelection(e)
+};
+DwtForm.__makeGetter=function(s){
+var t=s.getter;
+if(t){
+return DwtForm.__makeFunc(t)
+}
+var n=s.ref;
+if(!n){
+return null
+}
+var r=n.split(".");
+var e=["var context = this.model;",];
+for(var o=0;
+o<r.length;
+o++){
+var a=r[o];
+var h=DwtForm.__makeFuncName(a);
+if(o==r.length-1){
+break
+}
+e.push("context = context && (context.",h," ? context.",h,"() : context.",a,");")
+}
+e.push("var value = context ? (context.",h," ? context.",h,"() : context.",a,") : this._items.",a,".value;","return value !== undefined ? value : defaultValue;");
+return new Function("defaultValue",e.join(""))
+};
+DwtForm.__makeSetter=function(c){
+var o=c.setter;
+if(o){
+return DwtForm.__makeFunc(o)
+}
+var a=c.ref;
+if(!a){
+return null
+}
+var n=a.split(".");
+var h=["var context = this.model;",];
+for(var r=0;
+r<n.length;
+r++){
+var s=r==n.length-1;
+var e=n[r];
+var t=DwtForm.__makeFuncName(e,s?"set":"get");
+if(s){
+break
+}
+h.push("context = context && (context.",t," ? context.",t,"() : context.",e,");")
+}
+h.push("if (context) {","if (context.",t,") {","context.",t,"(value);","}","else {","context.",e," = value;","}","}");
+return new Function("value",h.join("\n"))
+};
+DwtForm.__makeFuncName=function(e,t){
+return[t||"get",e.substr(0,1).toUpperCase(),e.substr(1)].join("")
+};
+DwtForm.__makeFunc=function(t){
+if(t==null){
+return null
+}
+if(typeof t=="function"&&!(t instanceof RegExp)){
+return t
+}
+var e=["with (this._context) {","return (",t,");","}"].join("");
+return new Function(e)
+};
+DwtForm.__equals=function(t,e){
+return t==e
+};
+DwtForm.__byTabIndex=function(t,e){
+return t.tabindex-e.tabindex
+};
+DwtForm.__hack_fixRadioButtonHandler=function(t){
+var e=[t.getInputElement().onclick,DwtCheckbox.__handleClick];
+var a=function(o){
+for(var n=0;
+n<e.length;
+n++){
+var s=e[n];
+if(s){
+s(o)
+}}};
+Dwt.setHandler(t.getInputElement(),DwtEvent.ONCLICK,a)
+};
+DwtFormRows=function(a){
+if(arguments.length==0){
+return
+}
+this._itemDef=a.formItemDef||{};
+a.className=a.className||"DwtFormRows";
+DwtForm.call(this,{
+id:a.id,parent:a.parent,form:{}
+,template:this._itemDef.template}
+);
+this._rowsTabGroup=new DwtTabGroup(this._htmlElId);
+this._rowDef=this._itemDef.rowitem||{};
+this._equals=DwtForm.__makeFunc(this._rowDef.equals)||DwtForm.__equals;
+this._rowCount=0;
+this._minRows=this._itemDef.minrows||1;
+this._maxRows=this._itemDef.maxrows||Number.MAX_VALUE;
+if(this._itemDef.rowtemplate){
+this.ROW_TEMPLATE=this._itemDef.rowtemplate
+}
+var t=this._itemDef.items||[];
+for(var e=0;
+e<t.length;
+e++){
+this.addRow(t[e])
+}
+for(;
+e<this._minRows;
+e++){
+this.addRow()
+}
+this._onaddrow=DwtForm.__makeFunc(this._itemDef.onaddrow);
+this._onremoverow=DwtForm.__makeFunc(this._itemDef.onremoverow)
+};
+DwtFormRows.prototype=new DwtForm;
+DwtFormRows.prototype.constructor=DwtFormRows;
+DwtFormRows.prototype.toString=function(){
+return"DwtFormRows"
+};
+DwtFormRows.prototype.TEMPLATE="dwt.Widgets#DwtFormRows";
+DwtFormRows.prototype.ROW_TEMPLATE="dwt.Widgets#DwtFormRow";
+DwtFormRows.prototype.getTabGroupMember=function(){
+return this._rowsTabGroup
+};
+DwtFormRows.prototype.setValue=function(o){
+if(arguments.length>1){
+DwtForm.prototype.setValue.apply(this,arguments);
+return
+}
+var a=Math.max(o.length,this._minRows);
+for(var t=this._rowCount;
+t>a;
+t--){
+this.removeRow(t-1)
+}
+var e=Math.min(o.length,this._maxRows);
+for(var t=this._rowCount;
+t<e;
+t++){
+this.addRow()
+}
+for(var t=0;
+t<e;
+t++){
+this.setValue(String(t),o[t],true)
+}
+for(var t=o.length;
+t<this._rowCount;
+t++){
+this.setValue(String(t),null,true)
+}};
+DwtFormRows.prototype.getValue=function(){
+if(arguments.length>0){
+return DwtForm.prototype.getValue.apply(this,arguments)
+}
+var t=new Array(this._rowCount);
+for(var e=0;
+e<this._rowCount;
+e++){
+t[e]=this.getValue(String(e))
+}
+return t
+};
+DwtFormRows.prototype.getRowCount=function(){
+return this._rowCount
+};
+DwtFormRows.prototype.addRow=function(n,o){
+if(this._rowCount>=this._maxRows){
+return
+}
+n=n||(this._rowDef&&AjxUtil.createProxy(this._rowDef));
+if(!n){
+return
+}
+if(o==null){
+o=this._rowCount
+}
+for(var u=this._rowCount-1;
+u>=o;
+u--){
+var v=u,m=u+1;
+var f=this._items[v];
+f.aka=String(m);
+delete this._items[v];
+this._items[f.aka]=f;
+this._setControlIds(f.id,f.aka)
+}
+n.id=n.id||Dwt.getNextId();
+n.aka=String(o);
+this._rowCount++;
+var k={
+id:[this.getHTMLElId(),n.id].join("_")};
+var g=AjxTemplate.expand(this.ROW_TEMPLATE,k);
+var e=this._rowsEl;
+e.appendChild(Dwt.toDocumentFragment(g,k.id+"_row"));
+var y=e.lastChild;
+if(o!=this._rowCount-1){
+e.insertBefore(y,e.childNodes[o])
+}
+var w=[];
+var s=this._registerControl(n,null,w);
+var t=this._itemDef.additem?AjxUtil.createProxy(this._itemDef.additem):{
+image:"Add"};
+t.id=t.id||n.id+"_add";
+t.visible="this.getRowCount() < this.getMaxRows()";
+t.ignore=true;
+var d=this._registerControl(t,null,w,null,null,"DwtButton");
+if(!t.onclick){
+d.addSelectionListener(new AjxListener(this,this._handleAddRow,[n.id]))
+}
+var h=this._itemDef.removeitem?AjxUtil.createProxy(this._itemDef.removeitem):{
+image:"Remove"};
+h.id=h.id||n.id+"_remove";
+h.visible="this.getRowCount() > this.getMinRows()";
+h.ignore=true;
+var p=this._registerControl(h,null,w,null,null,"DwtButton");
+if(!h.onclick){
+p.addSelectionListener(new AjxListener(this,this._handleRemoveRow,[n.id]))
+}
+var f=this._items[n.id];
+f._rowEl=y;
+f._addId=t.id;
+f._removeId=h.id;
+this._setControlIds(f.id,o);
+var a=new DwtTabGroup(n.id);
+w.sort(DwtForm.__byTabIndex);
+for(var u=0;
+u<w.length;
+u++){
+var s=w[u].control;
+a.addMember(s.getTabGroupMember()||s)
+}
+if(o==this._rowCount-1){
+this._rowsTabGroup.addMember(a)
+}else{
+var r=this._items[String(o+1)];
+var c=this._rowsTabGroup.getTabGroupMemberByName(r.id);
+this._rowsTabGroup.addMemberBefore(a,c)
+}
+this.update();
+if(this._onaddrow){
+this._call(this._onaddrow,[o])
+}
+return s
+};
+DwtFormRows.prototype.removeRow=function(r){
+if(this._rowCount<=this._minRows){
+return
+}
+var d=this._items[r];
+if(d.control instanceof DwtControl){
+this.removeChild(d.control)
+}
+delete this._items[d.aka];
+this._deleteItem(d.id);
+var h=this._items[d._addId];
+if(h){
+this.removeChild(h.control);
+this._deleteItem(h.id)
+}
+var c=this._items[d._removeId];
+if(c){
+this.removeChild(c.control);
+this._deleteItem(c.id)
+}
+var s=Number(d.aka);
+for(var a=s+1;
+a<this._rowCount;
+a++){
+var n=a,t=a-1;
+this._items[t]=this._items[n];
+this._items[t].aka=String(t);
+this._setControlIds(this._items[t].id,this._items[t].aka)
+}
+this._deleteItem(String(--this._rowCount));
+var e=d._rowEl;
+e.parentNode.removeChild(e);
+delete d._rowEl;
+var o=this._rowsTabGroup.getTabGroupMemberByName(d.id);
+this._rowsTabGroup.removeMember(o);
+this.update();
+if(this._onremoverow){
+this._call(this._onremoverow,[Number(d.aka)])
+}};
+DwtFormRows.prototype.getMinRows=function(){
+return this._minRows
+};
+DwtFormRows.prototype.getMaxRows=function(){
+return this._maxRows
+};
+DwtFormRows.prototype.getRowCount=function(){
+return this._rowCount
+};
+DwtFormRows.prototype.getIndexForRowId=function(a){
+var t=this._rowsEl.childNodes;
+for(var e=0;
+e<t.length;
+e++){
+if(t[e].id==[this._htmlElId,a,"row"].join("_")){
+return e
+}}
+return -1
+};
+DwtFormRows.__equals=function(t,e){
+if(t===e){
+return true
+}
+if(!t||!e||t.length!=e.length){
+return false
+}
+for(var o=0;
+o<t.length;
+o++){
+if(!this._call(this._equals,[t[o],e[o]])){
+return false
+}}
+return true
+};
+DwtFormRows.prototype._setControlIds=function(n,e){
+var s=[this.getHTMLElId(),e].join("_");
+var o=this._items[n];
+this._setControlId(o&&o.control,s);
+var t=this._items[o._addId];
+this._setControlId(t&&t.control,s+"_add");
+var a=this._items[o._removeId];
+this._setControlId(a&&a.control,s+"_remove")
+};
+DwtFormRows.prototype._setControlId=function(e,t){
+if(!e){
+return
+}
+if(e instanceof DwtControl){
+e.setHtmlElementId(t)
+}else{
+e.id=t
+}};
+DwtFormRows.prototype._handleAddRow=function(t){
+var e=this.getIndexForRowId(t)+1;
+this.addRow(null,e)
+};
+DwtFormRows.prototype._handleRemoveRow=function(e){
+this.removeRow(e)
+};
+DwtFormRows.prototype._setModelValue=function(t,e){
+if(DwtForm.prototype._setModelValue.apply(this,arguments)){
+this.parent.setDirty(this._itemDef.id,true)
+}};
+DwtFormRows.prototype._createHtmlFromTemplate=function(e,t){
+DwtForm.prototype._createHtmlFromTemplate.apply(this,arguments);
+this._rowsEl=document.getElementById(this._htmlElId+"_rows")
+}
+}
+if(AjxPackage.define("zimbra.csfe.ZmBatchCommand")){
+ZmBatchCommand=function(e,t,a){
+this._onError=(e===false)?ZmBatchCommand.STOP:ZmBatchCommand.CONTINUE;
+this._accountName=t;
+this._useJson=a;
+this.curId=0;
+this._cmds=[];
+this._requests=[];
+this._respCallbacks=[];
+this._errorCallbacks=[]
+};
+ZmBatchCommand.prototype.toString=function(){
+return"ZmBatchCommand"
+};
+ZmBatchCommand.prototype._sensitive=false;
+ZmBatchCommand.STOP="stop";
+ZmBatchCommand.CONTINUE="continue";
+ZmBatchCommand.prototype.setSensitive=function(e){
+this._sensitive=this._sensitive||e
+};
+ZmBatchCommand.prototype.isSensitive=function(){
+return this._sensitive
+};
+ZmBatchCommand.prototype.add=function(e){
+this._cmds.push(e)
+};
+ZmBatchCommand.prototype.size=function(){
+return this.curId
+};
+ZmBatchCommand.prototype.run=function(m,r){
+for(var s=0;
+s<this._cmds.length;
+s++){
+var a=this._cmds[s];
+a.run(this);
+this.curId++
+}
+var o={
+sensitive:this._sensitive,asyncMode:true,callback:new AjxCallback(this,this._handleResponseRun,[m,r]),errorCallback:r,accountName:this._accountName};
+if(this._useJson){
+var f={
+BatchRequest:{
+_jsns:"urn:zimbra",onerror:this._onError}};
+var e=f.BatchRequest;
+var p=this.size();
+if(p&&this._requests.length){
+for(var s=0;
+s<p;
+s++){
+var n=this._requests[s];
+n.requestId=s;
+var u=ZmCsfeCommand.getMethodName(n);
+if(!e[u]){
+e[u]=[]
+}
+n[u].requestId=s;
+e[u].push(n[u])
+}
+o.jsonObj=f
+}}else{
+var c=AjxSoapDoc.create("BatchRequest","urn:zimbra");
+c.setMethodAttribute("onerror",this._onError);
+var p=this.size();
+if(p>0){
+for(var s=0;
+s<p;
+s++){
+var d=this._requests[s];
+var h=d.getMethod();
+h.setAttribute("requestId",s);
+var t=c.adoptNode(h);
+c.getMethod().appendChild(t)
+}
+o.soapDoc=c
+}}
+if(o.jsonObj||o.soapDoc){
+appCtxt.getAppController().sendRequest(o)
+}else{
+if(m){
+m.run()
+}}};
+ZmBatchCommand.prototype._handleResponseRun=function(c,n,u){
+var h=u.getResponse();
+if(!h.BatchResponse){
+return
+}
+var s=[];
+for(var e in h.BatchResponse){
+if(e.match(/^_/)){
+continue
+}
+var d=h.BatchResponse[e];
+for(var o=0;
+o<d.length;
+o++){
+s[d[o].requestId]={
+method:e,resp:d[o]}
+}}
+var t=[];
+for(var o=0;
+o<s.length;
+o++){
+var a=s[o];
+try{
+this._processResponse(a.method,a.resp)
+}
+catch(r){
+t.push(r);
+if(this._onError==ZmBatchCommand.STOP){
+break
+}}}
+if(t.length>0&&n){
+n.run.apply(n,t)
+}else{
+if(c){
+c.run(u)
+}}};
+ZmBatchCommand.prototype.addRequestParams=function(t,a,e){
+this._requests[this.curId]=t;
+this._respCallbacks[this.curId]=a;
+this._errorCallbacks[this.curId]=e
+};
+ZmBatchCommand.prototype.addNewRequestParams=function(t,a,e){
+this.addRequestParams(t,a,e);
+this.curId++
+};
+ZmBatchCommand.prototype._processResponse=function(r,n){
+var s=n.requestId;
+if(r=="Fault"){
+var t=ZmCsfeCommand.faultToEx(n,"ZmBatchCommand.prototype.run");
+if(this._errorCallbacks[s]){
+var o=this._errorCallbacks[s].run(t);
+if(!o){
+appCtxt.getAppController()._handleException(t)
+}}
+throw t
+}
+if(this._respCallbacks[s]){
+var a={};
+a[r]=n;
+var e=new ZmCsfeResult(a);
+this._respCallbacks[s].run(e,n)
+}}
+}
+if(AjxPackage.define("zimbra.csfe.ZmCsfeCommand")){
+ZmCsfeCommand=function(){};
+ZmCsfeCommand.prototype.toString=function(){
+return"ZmCsfeCommand"
+};
+ZmCsfeCommand._COOKIE_NAME="ZM_AUTH_TOKEN";
+ZmCsfeCommand.serverUri=null;
+ZmCsfeCommand._sessionId=null;
+ZmCsfeCommand.REAUTH="reauth";
+ZmCsfeCommand.RETRY="retry";
+ZmCsfeCommand.getAuthToken=function(){
+return AjxCookie.getCookie(document,ZmCsfeCommand._COOKIE_NAME)
+};
+ZmCsfeCommand.setCookieName=function(e){
+ZmCsfeCommand._COOKIE_NAME=e
+};
+ZmCsfeCommand.setServerUri=function(e){
+ZmCsfeCommand.serverUri=e
+};
+ZmCsfeCommand.setAuthToken=function(t,s,n,a){
+ZmCsfeCommand._curAuthToken=t;
+if(s!=null){
+var o=null;
+if(s>0){
+o=new Date();
+var e=parseInt(s);
+o.setTime(o.getTime()+e)
+}
+AjxCookie.setCookie(document,ZmCsfeCommand._COOKIE_NAME,t,o,"/",null,a)
+}else{
+AjxCookie.deleteCookie(document,ZmCsfeCommand._COOKIE_NAME,"/")
+}
+if(n){
+ZmCsfeCommand.setSessionId(n)
+}};
+ZmCsfeCommand.clearAuthToken=function(){
+AjxCookie.deleteCookie(document,ZmCsfeCommand._COOKIE_NAME,"/")
+};
+ZmCsfeCommand.getSessionId=function(){
+return ZmCsfeCommand._sessionId
+};
+ZmCsfeCommand.setSessionId=function(e){
+var t=(e!=null)?((e instanceof Array)?e[0].id:e.id):null;
+ZmCsfeCommand._sessionId=t?parseInt(t):null
+};
+ZmCsfeCommand.faultToEx=function(t,a){
+var o={
+msg:AjxStringUtil.getAsString(t.Reason.Text),code:AjxStringUtil.getAsString(t.Detail.Error.Code),method:(a?a.methodNameStr:null),detail:AjxStringUtil.getAsString(t.Code.Value),data:t.Detail.Error.a,trace:(t.Detail.Error.Trace||"")};
+var e;
+if(a){
+if(a.soapDoc){
+o.request=a.soapDoc.getXml()
+}else{
+if(a.jsonRequestObj){
+if(a.jsonRequestObj&&a.jsonRequestObj.Header&&a.jsonRequestObj.Header.context){
+a.jsonRequestObj.Header.context.authToken="(removed)"
+}
+o.request=AjxStringUtil.prettyPrint(a.jsonRequestObj,true)
+}}}
+return new ZmCsfeException(o)
+};
+ZmCsfeCommand.getMethodName=function(t){
+var e=(t&&t._methodEl&&t._methodEl.tagName)?t._methodEl.tagName:null;
+if(!e){
+for(var a in t){
+if(a.indexOf("Request")!=-1){
+e=a;
+break
+}}}
+return(e||"[unknown]")
+};
+ZmCsfeCommand.prototype.invoke=function(r){
+this.cancelled=false;
+if(!(r&&(r.soapDoc||r.jsonObj))){
+return
+}
+var e=ZmCsfeCommand.getRequestStr(r);
+var s;
+try{
+var n=(r.serverUri||ZmCsfeCommand.serverUri)+r.methodNameStr;
+this._st=new Date();
+var o={
+"Content-Type":"application/soap+xml; charset=utf-8"};
+if(AjxEnv.isIE6&&(location.protocol=="https:")){
+o.Connection="Close"
+}
+if(r.asyncMode){
+s=new AjxCallback(this,this._runCallback,[r]);
+this._rpcId=AjxRpc.invoke(e,n,o,s)
+}else{
+var t=AjxRpc.invoke(e,n,o);
+return(!r.returnXml)?(this._getResponseData(t,r)):t
+}}
+catch(a){
+this._handleException(a,r,s)
+}};
+ZmCsfeCommand.prototype.invokeRest=function(o){
+if(!(o&&o.restUri)){
+return
+}
+var a;
+try{
+this._st=new Date();
+if(o.asyncMode){
+a=new AjxCallback(this,this._runCallback,[o]);
+this._rpcId=AjxRpc.invoke(null,o.restUri,null,a,true)
+}else{
+var e=AjxRpc.invoke(null,o.restUri,null,null,true);
+return e.text
+}}
+catch(t){
+this._handleException(t,o,a)
+}};
+ZmCsfeCommand.prototype.cancel=function(){
+if(!this._rpcId){
+return
+}
+this.cancelled=true;
+var e=AjxRpc.getRpcRequestById(this._rpcId);
+if(e){
+e.cancel()
+}};
+ZmCsfeCommand.getRequestStr=function(e){
+return e.soapDoc?ZmCsfeCommand._getSoapRequestStr(e):ZmCsfeCommand._getJsonRequestStr(e)
+};
+ZmCsfeCommand._getJsonRequestStr=function(r){
+var n={
+Header:{}
+,Body:r.jsonObj};
+var t=n.Header.context={
+_jsns:"urn:zimbra"};
+var a=["ZimbraWebClient - ",AjxEnv.browser," (",AjxEnv.platform,")"].join("");
+t.userAgent={
+name:a};
+if(ZmCsfeCommand.clientVersion){
+t.userAgent.version=ZmCsfeCommand.clientVersion
+}
+if(r.noSession){
+t.nosession={}
+}else{
+var s=ZmCsfeCommand.getSessionId();
+if(s){
+t.session={
+_content:s,id:s}
+}else{
+t.session={}
+}}
+if(r.targetServer){
+t.targetServer={
+_content:r.targetServer}
+}
+if(r.highestNotifySeen){
+t.notify={
+seq:r.highestNotifySeen}
+}
+if(r.changeToken){
+t.change={
+token:r.changeToken,type:"new"}
+}
+if(!r.skipAuthCheck){
+if(r.accountId){
+t.account={
+_content:r.accountId,by:"id"}
+}else{
+if(r.accountName){
+t.account={
+_content:r.accountName,by:"name"}
+}}}
+if(r.useXml){
+t.format={
+type:"xml"}
+}
+r.methodNameStr=ZmCsfeCommand.getMethodName(r.jsonObj);
+if(!r.noAuthToken){
+var e=ZmCsfeCommand.getAuthToken();
+if(!e){
+throw new ZmCsfeException("AuthToken required",ZmCsfeException.NO_AUTH_TOKEN,r.methodNameStr)
+}
+if(ZmCsfeCommand._curAuthToken&&!r.skipAuthCheck&&(r.resend!=ZmCsfeCommand.REAUTH)&&(e!=ZmCsfeCommand._curAuthToken)){
+throw new ZmCsfeException("AuthToken has changed",ZmCsfeException.AUTH_TOKEN_CHANGED,r.methodNameStr)
+}
+t.authToken=ZmCsfeCommand._curAuthToken=e
+}
+if(window.DBG){
+var o=DBG._getTimeStamp()
+}
+r.jsonRequestObj=n;
+return AjxStringUtil.objToString(n)
+};
+ZmCsfeCommand._getSoapRequestStr=function(r){
+var m=r.soapDoc;
+if(!r.resend){
+var p=m.createHeaderElement();
+var n=m.set("context",null,p,"urn:zimbra");
+var t=m.set("userAgent",null,n);
+var a=["ZimbraWebClient - ",AjxEnv.browser," (",AjxEnv.platform,")"].join("");
+t.setAttribute("name",a);
+if(ZmCsfeCommand.clientVersion){
+t.setAttribute("version",ZmCsfeCommand.clientVersion)
+}
+if(r.noSession){
+m.set("nosession",null,n)
+}else{
+var h=ZmCsfeCommand.getSessionId();
+var c=m.set("session",null,n);
+if(h){
+c.setAttribute("id",h)
+}}
+if(r.targetServer){
+m.set("targetServer",r.targetServer,n)
+}
+if(r.highestNotifySeen){
+var g=m.set("notify",null,n);
+g.setAttribute("seq",r.highestNotifySeen)
+}
+if(r.changeToken){
+var d=m.set("change",null,n);
+d.setAttribute("token",r.changeToken);
+d.setAttribute("type","new")
+}
+if(!r.skipAuthCheck){
+if(r.accountId){
+var s=m.set("account",r.accountId,n);
+s.setAttribute("by","id")
+}else{
+if(r.accountName){
+var s=m.set("account",r.accountName,n);
+s.setAttribute("by","name")
+}}}
+if(!r.useXml){
+var o=m.set("format",null,n);
+o.setAttribute("type","js")
+}}
+r.methodNameStr=ZmCsfeCommand.getMethodName(m);
+if(!r.noAuthToken){
+var f=ZmCsfeCommand.getAuthToken();
+if(!f){
+throw new ZmCsfeException("AuthToken required",ZmCsfeException.NO_AUTH_TOKEN,r.methodNameStr)
+}
+if(ZmCsfeCommand._curAuthToken&&!r.skipAuthCheck&&(r.resend!=ZmCsfeCommand.REAUTH)&&(f!=ZmCsfeCommand._curAuthToken)){
+throw new ZmCsfeException("AuthToken has changed",ZmCsfeException.AUTH_TOKEN_CHANGED,r.methodNameStr)
+}
+ZmCsfeCommand._curAuthToken=f;
+if(r.resend==ZmCsfeCommand.REAUTH){
+var e=m.getDoc().getElementsByTagName("authToken");
+if(e&&e.length==1){
+e[0].firstChild.data=f
+}else{
+e=m.getDoc().getElementsByTagName("context");
+if(e&&e.length==1){
+m.set("authToken",f,e[0])
+}else{}}}else{
+if(!r.resend){
+m.set("authToken",f,n)
+}}}
+if(window.DBG){
+var u=DBG._getTimeStamp()
+}
+return m.getXml()
+};
+ZmCsfeCommand.prototype._runCallback=function(a,e){
+if(!e){
+return
+}
+if(this.cancelled&&a.skipCallbackIfCancelled){
+return
+}
+var t;
+if(e instanceof ZmCsfeResult){
+t=e
+}else{
+t=this._getResponseData(e,a)
+}
+this._en=new Date();
+if(a.callback){
+a.callback.run(t)
+}else{}};
+ZmCsfeCommand.prototype._getResponseData=function(response,params){
+this._en=new Date();
+var result=new ZmCsfeResult();
+var xmlResponse=false;
+var restResponse=Boolean(params.restUri);
+var respDoc=null;
+if(!response.success&&!response.xml&&(/<html/i.test(response.text))){
+var ex=new ZmCsfeException(null,ZmCsfeException.CSFE_SVC_ERROR,params.methodNameStr,"HTTP response status "+response.status);
+if(params.asyncMode){
+result.set(ex,true);
+return result
+}else{
+throw ex
+}}
+if(typeof(response.text)=="string"&&response.text.indexOf("{")==0){
+respDoc=response.text
+}else{
+if(!restResponse){
+try{
+xmlResponse=true;
+if(!(response.text||(response.xml&&(typeof response.xml)=="string"))){
+throw new ZmCsfeException(null,ZmCsfeException.EMPTY_RESPONSE,params.methodNameStr)
+}
+respDoc=(AjxEnv.isIE||response.xml==null)?AjxSoapDoc.createFromXml(response.text):AjxSoapDoc.createFromDom(response.xml)
+}
+catch(ex){
+if(params.asyncMode){
+result.set(ex,true);
+return result
+}else{
+throw ex
+}}
+if(!respDoc){
+var ex=new ZmCsfeException(null,ZmCsfeException.SOAP_ERROR,params.methodNameStr,"Bad XML response doc");
+if(params.asyncMode){
+result.set(ex,true);
+return result
+}else{
+throw ex
+}}}}
+var linkName="Response";
+if(respDoc&&respDoc.match){
+var m=respDoc.match(/\{"?Body"?:\{"?(\w+)"?:/);
+if(m&&m.length){
+linkName=m[1]
+}}
+if(window.DBG){
+var ts=DBG._getTimeStamp()
+}
+var obj=restResponse?response.text:{};
+if(xmlResponse){
+obj=respDoc._xmlDoc.toJSObject(true,false,true)
+}else{
+if(!restResponse){
+try{
+eval("obj="+respDoc)
+}
+catch(ex){
+if(ex.name=="SyntaxError"){
+ex=new ZmCsfeException(null,ZmCsfeException.BAD_JSON_RESPONSE,params.methodNameStr)
+}
+if(params.asyncMode){
+result.set(ex,true);
+return result
+}else{
+throw ex
+}}}}
+var fault=obj&&obj.Body&&obj.Body.Fault;
+if(fault){
+var ex=ZmCsfeCommand.faultToEx(fault,params);
+if(params.asyncMode){
+result.set(ex,true,obj.Header);
+return result
+}else{
+throw ex
+}}else{
+if(!response.success){
+var ex=new ZmCsfeException(null,ZmCsfeException.CSFE_SVC_ERROR,params.methodNameStr,"HTTP response status "+response.status);
+if(params.asyncMode){
+result.set(ex,true);
+return result
+}else{
+throw ex
+}}else{
+if(params.asyncMode){
+result.set(obj)
+}}}
+if(obj.Header&&obj.Header.context&&obj.Header.context.session){
+ZmCsfeCommand.setSessionId(obj.Header.context.session)
+}
+return params.asyncMode?result:obj
+};
+ZmCsfeCommand.prototype._handleException=function(e,a,o){
+if(!(e&&(e instanceof ZmCsfeException||e instanceof AjxSoapException||e instanceof AjxException))){
+var t=new ZmCsfeException();
+t.method=a.methodNameStr||a.restUri;
+t.detail=e?e.toString():"undefined exception";
+t.code=ZmCsfeException.UNKNOWN_ERROR;
+t.msg="Unknown Error";
+e=t
+}
+if(a.asyncMode){
+o.run(new ZmCsfeResult(e,true))
+}else{
+throw e
+}}
+}
+if(AjxPackage.define("zimbra.csfe.ZmCsfeException")){
+ZmCsfeException=function(o){
+o=Dwt.getParams(arguments,ZmCsfeException.PARAMS);
+AjxException.call(this,o.msg,o.code,o.method,o.detail);
+if(o.data){
+this.data={};
+for(var t=0;
+t<o.data.length;
+t++){
+var a=o.data[t];
+var e=a.n;
+if(!this.data[e]){
+this.data[e]=[]
+}
+this.data[e].push(a._content)
+}}
+this.trace=o.trace;
+this.request=o.request
+};
+ZmCsfeException.PARAMS=["msg","code","method","detail","data","trace"];
+ZmCsfeException.prototype=new AjxException;
+ZmCsfeException.prototype.constructor=ZmCsfeException;
+ZmCsfeException.prototype.toString=function(){
+return"ZmCsfeException"
+};
+ZmCsfeException.MAIL_SEND_ADDRESS_FAILURE_INVALID="invalid";
+ZmCsfeException.MAIL_SEND_ADDRESS_FAILURE_UNSENT="unsent";
+ZmCsfeException.getErrorMsg=function(t,e){
+var a=ZMsg[t];
+if(!a){
+ZmCsfeException._unknownFormat=ZmCsfeException._unknownFormat||new AjxMessageFormat(ZMsg.unknownError);
+return ZmCsfeException._unknownFormat.format(t)
+}
+this.msg=this.msg||a;
+return e?AjxMessageFormat.format(a,e):a
+};
+ZmCsfeException.prototype.getErrorMsg=function(e){
+return ZmCsfeException.getErrorMsg(this.code,e)
+};
+ZmCsfeException.prototype.getData=function(e){
+return this.data&&this.data[e]
+};
+ZmCsfeException.AUTH_TOKEN_CHANGED="AUTH_TOKEN_CHANGED";
+ZmCsfeException.BAD_JSON_RESPONSE="BAD_JSON_RESPONSE";
+ZmCsfeException.CSFE_SVC_ERROR="CSFE_SVC_ERROR";
+ZmCsfeException.EMPTY_RESPONSE="EMPTY_RESPONSE";
+ZmCsfeException.NETWORK_ERROR="NETWORK_ERROR";
+ZmCsfeException.NO_AUTH_TOKEN="NO_AUTH_TOKEN";
+ZmCsfeException.SOAP_ERROR="SOAP_ERROR";
+ZmCsfeException.LICENSE_ERROR="service.LICENSE_ERROR";
+ZmCsfeException.SVC_ALREADY_IN_PROGRESS="service.ALREADY_IN_PROGRESS";
+ZmCsfeException.SVC_AUTH_EXPIRED="service.AUTH_EXPIRED";
+ZmCsfeException.SVC_AUTH_REQUIRED="service.AUTH_REQUIRED";
+ZmCsfeException.SVC_FAILURE="service.FAILURE";
+ZmCsfeException.SVC_INVALID_REQUEST="service.INVALID_REQUEST";
+ZmCsfeException.SVC_PARSE_ERROR="service.PARSE_ERROR";
+ZmCsfeException.SVC_PERM_DENIED="service.PERM_DENIED";
+ZmCsfeException.SVC_RESOURCE_UNREACHABLE="service.RESOURCE_UNREACHABLE";
+ZmCsfeException.SVC_UNKNOWN_DOCUMENT="service.UNKNOWN_DOCUMENT";
+ZmCsfeException.SVC_TEMPORARILY_UNAVAILABLE="service.TEMPORARILY_UNAVAILABLE";
+ZmCsfeException.SVC_WRONG_HOST="service.WRONG_HOST";
+ZmCsfeException.ACCT_AUTH_FAILED="account.AUTH_FAILED";
+ZmCsfeException.ACCT_CHANGE_PASSWORD="account.CHANGE_PASSWORD";
+ZmCsfeException.ACCT_EXISTS="account.ACCOUNT_EXISTS";
+ZmCsfeException.ACCT_TOO_MANY_ACCOUNTS="account.TOO_MANY_ACCOUNTS";
+ZmCsfeException.ACCT_INVALID_ATTR_VALUE="account.INVALID_ATTR_VALUE";
+ZmCsfeException.ACCT_INVALID_PASSWORD="account.INVALID_PASSWORD";
+ZmCsfeException.ACCT_INVALID_PREF_NAME="account.INVALID_PREF_NAME";
+ZmCsfeException.ACCT_INVALID_PREF_VALUE="account.INVALID_PREF_VALUE";
+ZmCsfeException.ACCT_MAINTENANCE_MODE="account.MAINTENANCE_MODE";
+ZmCsfeException.ACCT_NO_SUCH_ACCOUNT="account.NO_SUCH_ACCOUNT";
+ZmCsfeException.ACCT_NO_SUCH_SAVED_SEARCH="account.NO_SUCH_SAVED_SEARCH";
+ZmCsfeException.ACCT_NO_SUCH_TAG="account.ACCT_NO_SUCH_TAG";
+ZmCsfeException.ACCT_PASS_CHANGE_TOO_SOON="account.PASSWORD_CHANGE_TOO_SOON";
+ZmCsfeException.ACCT_PASS_LOCKED="account.PASSWORD_LOCKED";
+ZmCsfeException.ACCT_PASS_RECENTLY_USED="account.PASSWORD_RECENTLY_USED";
+ZmCsfeException.COS_EXISTS="account.COS_EXISTS";
+ZmCsfeException.DISTRIBUTION_LIST_EXISTS="account.DISTRIBUTION_LIST_EXISTS";
+ZmCsfeException.DOMAIN_EXISTS="account.DOMAIN_EXISTS";
+ZmCsfeException.DOMAIN_NOT_EMPTY="account.DOMAIN_NOT_EMPTY";
+ZmCsfeException.IDENTITY_EXISTS="account.IDENTITY_EXISTS";
+ZmCsfeException.NO_SUCH_DISTRIBUTION_LIST="account.NO_SUCH_DISTRIBUTION_LIST";
+ZmCsfeException.NO_SUCH_DOMAIN="account.NO_SUCH_DOMAIN";
+ZmCsfeException.MAINTENANCE_MODE="account.MAINTENANCE_MODE";
+ZmCsfeException.TOO_MANY_IDENTITIES="account.TOO_MANY_IDENTITIES";
+ZmCsfeException.TOO_MANY_SEARCH_RESULTS="account.TOO_MANY_SEARCH_RESULTS";
+ZmCsfeException.NO_SUCH_COS="account.NO_SUCH_COS";
+ZmCsfeException.MAIL_ALREADY_EXISTS="mail.ALREADY_EXISTS";
+ZmCsfeException.MAIL_IMMUTABLE="mail.IMMUTABLE_OBJECT";
+ZmCsfeException.MAIL_INVALID_NAME="mail.INVALID_NAME";
+ZmCsfeException.MAIL_MAINTENANCE_MODE="mail.MAINTENANCE";
+ZmCsfeException.MAIL_MESSAGE_TOO_BIG="mail.MESSAGE_TOO_BIG";
+ZmCsfeException.MAIL_NO_SUCH_CONV="mail.NO_SUCH_CONV";
+ZmCsfeException.MAIL_NO_SUCH_FOLDER="mail.NO_SUCH_FOLDER";
+ZmCsfeException.MAIL_NO_SUCH_ITEM="mail.NO_SUCH_ITEM";
+ZmCsfeException.MAIL_NO_SUCH_MOUNTPOINT="mail.NO_SUCH_MOUNTPOINT";
+ZmCsfeException.MAIL_NO_SUCH_MSG="mail.NO_SUCH_MSG";
+ZmCsfeException.MAIL_NO_SUCH_PART="mail.NO_SUCH_PART";
+ZmCsfeException.MAIL_NO_SUCH_TAG="mail.NO_SUCH_TAG";
+ZmCsfeException.MAIL_QUERY_PARSE_ERROR="mail.QUERY_PARSE_ERROR";
+ZmCsfeException.MAIL_QUOTA_EXCEEDED="mail.QUOTA_EXCEEDED";
+ZmCsfeException.MAIL_SEND_ABORTED_ADDRESS_FAILURE="mail.SEND_ABORTED_ADDRESS_FAILURE";
+ZmCsfeException.MAIL_SEND_FAILURE="mail.SEND_FAILURE";
+ZmCsfeException.MAIL_TOO_MANY_CONTACTS="mail.TOO_MANY_CONTACTS";
+ZmCsfeException.MAIL_TOO_MANY_TERMS="mail.TOO_MANY_QUERY_TERMS_EXPANDED";
+ZmCsfeException.MAIL_UNABLE_TO_IMPORT_APPOINTMENTS="mail.MAIL_UNABLE_TO_IMPORT_APPOINTMENTS";
+ZmCsfeException.MAIL_UNABLE_TO_IMPORT_CONTACTS="mail.UNABLE_TO_IMPORT_CONTACTS";
+ZmCsfeException.MODIFY_CONFLICT="mail.MODIFY_CONFLICT";
+ZmCsfeException.TOO_MANY_TAGS="mail.TOO_MANY_TAGS";
+ZmCsfeException.OFFLINE_ONLINE_ONLY_OP="offline.ONLINE_ONLY_OP";
+ZmCsfeException.VOLUME_NO_SUCH_PATH="volume.NO_SUCH_PATH"
+}
+if(AjxPackage.define("zimbra.csfe.ZmCsfeResult")){
+ZmCsfeResult=function(e,t,a){
+this.set(e,t,a)
+};
+ZmCsfeResult.prototype.toString=function(){
+return"ZmCsfeResult"
+};
+ZmCsfeResult.prototype.set=function(e,t,a){
+this._data=e;
+this._isException=(t===true);
+this._header=a
+};
+ZmCsfeResult.prototype.getResponse=function(){
+if(this._isException){
+throw this._data
+}else{
+return this._data
+}};
+ZmCsfeResult.prototype.getException=function(){
+return this._isException?this._data:null
+};
+ZmCsfeResult.prototype.isException=function(){
+return this._isException
+};
+ZmCsfeResult.prototype.getHeader=function(){
+return this._header
+}
+}
+if(AjxPackage.define("zimbraMail.core.ZmId")){
+ZmId=function(){};
+ZmId.WIDGET="z";
+ZmId.WIDGET_VIEW="zv";
+ZmId.WIDGET_TOOLBAR="ztb";
+ZmId.WIDGET_BUTTON="zb";
+ZmId.WIDGET_INPUT="zi";
+ZmId.WIDGET_MENU="zm";
+ZmId.WIDGET_MENU_ITEM="zmi";
+ZmId.WIDGET_SELECT="zs";
+ZmId.WIDGET_OVERVIEW_CNTR="zovc";
+ZmId.WIDGET_OVERVIEW="zov";
+ZmId.WIDGET_TREE="zt";
+ZmId.WIDGET_TREE_ITEM_HDR="ztih";
+ZmId.WIDGET_TREE_ITEM="zti";
+ZmId.WIDGET_TAB="ztab";
+ZmId.SKIN_APP_BOTTOM_TOOLBAR="skin_container_app_bottom_toolbar";
+ZmId.SKIN_APP_CHOOSER="skin_container_app_chooser";
+ZmId.SKIN_APP_MAIN_FULL="skin_container_app_main_full";
+ZmId.SKIN_APP_MAIN="skin_container_app_main";
+ZmId.SKIN_APP_MAIN_ROW_FULL="skin_tr_main_full";
+ZmId.SKIN_APP_MAIN_ROW="skin_tr_main";
+ZmId.SKIN_APP_TOP_TOOLBAR="skin_container_app_top_toolbar";
+ZmId.SKIN_LINKS="skin_container_links";
+ZmId.SKIN_LOGO="skin_container_logo";
+ZmId.SKIN_QUOTA_INFO="skin_container_quota";
+ZmId.SKIN_SASH="skin_container_tree_app_sash";
+ZmId.SKIN_SEARCH_BUILDER="skin_container_search_builder";
+ZmId.SKIN_SEARCH_BUILDER_TOOLBAR="skin_container_search_builder_toolbar";
+ZmId.SKIN_SEARCH_BUILDER_TR="skin_tr_search_builder";
+ZmId.SKIN_SEARCH="skin_container_search";
+ZmId.SKIN_SHELL="skin_outer";
+ZmId.SKIN_SPACING_SEARCH="skin_spacing_search";
+ZmId.SKIN_SPLASH_SCREEN="skin_container_splash_screen";
+ZmId.SKIN_STATUS="skin_container_status";
+ZmId.SKIN_STATUS_ROW="skin_tr_status";
+ZmId.SKIN_TREE_FOOTER="skin_container_tree_footer";
+ZmId.SKIN_TREE="skin_container_tree";
+ZmId.SKIN_USER_INFO="skin_container_username";
+ZmId.SKIN_TASKBAR="skin_container_taskbar";
+ZmId.SKIN_FOOTER="skin_footer";
+ZmId.SKIN_AD="skin_adsrvc";
+ZmId.SHELL="z_shell";
+ZmId.LOADING_VIEW="z_loading";
+ZmId.MAIN_SASH="z_sash";
+ZmId.BANNER="z_banner";
+ZmId.SEARCH_TOOLBAR="ztb_search";
+ZmId.USER_NAME="z_userName";
+ZmId.USER_QUOTA="z_userQuota";
+ZmId.PRESENCE="z_presence";
+ZmId.TASKBAR="z_taskbar";
+ZmId.NEW_FOLDER_BUTTON="zb_newFolder";
+ZmId.STATUS_VIEW="z_status";
+ZmId.TOAST="z_toast";
+ZmId.APP_CHOOSER="ztb_appChooser";
+ZmId.getToolbarId=function(t,e){
+return DwtId._makeId(ZmId.WIDGET_TOOLBAR,t,e)
+};
+ZmId.TB_INVITE="Inv";
+ZmId.TB_NAV="Nav";
+ZmId.TB_SHARE="Shr";
+ZmId.getButtonId=function(t,a,e){
+return DwtId._makeId(ZmId.WIDGET_BUTTON,t,e,a)
+};
+ZmId.getMenuId=function(t,e){
+return DwtId._makeId(ZmId.WIDGET_MENU,t,e)
+};
+ZmId.MENU_PARTICIPANT="Par";
+ZmId.MENU_DRAFTS="Dra";
+ZmId.getMenuItemId=function(t,a,e){
+return DwtId._makeId(ZmId.WIDGET_MENU_ITEM,t,e,a)
+};
+ZmId.getOverviewContainerId=function(e){
+return DwtId._makeId(ZmId.WIDGET_OVERVIEW_CNTR,e)
+};
+ZmId.getOverviewId=function(e){
+return DwtId._makeId(ZmId.WIDGET_OVERVIEW,e)
+};
+ZmId.getTreeId=function(t,e){
+return DwtId._makeId(ZmId.WIDGET_TREE,t,e)
+};
+ZmId.getTreeItemId=function(a,t,e){
+if(!t&&!e){
+return
+}
+if(e){
+return DwtId._makeId(ZmId.WIDGET_TREE_ITEM_HDR,a,e)
+}else{
+return DwtId._makeId(ZmId.WIDGET_TREE_ITEM,a,t)
+}};
+ZmId.getViewId=function(e,t,a){
+var o=DwtId._makeId(ZmId.WIDGET_VIEW,a,e);
+return t?[o,t].join(""):o
+};
+ZmId.getComposeViewId=function(e){
+var t=DwtId._makeId(ZmId.WIDGET,ZmId.COMPOSE_VIEW);
+return e?[t,e].join(""):t
+};
+ZmId.getTabId=function(e,t){
+return DwtId._makeId(ZmId.WIDGET_TAB,e,t)
+};
+ZmId.getPrefPageId=function(e){
+return"PREF_PAGE_"+e
+};
+ZmId.SEARCH_INPUT="zi_search";
+ZmId.SEARCH="Search";
+ZmId.SEARCH_CUSTOM="CUSTOM";
+ZmId.SEARCH_MENU="MENU";
+ZmId.SEARCH_SEARCH="SEARCH";
+ZmId.SEARCH_SAVE="SAVE";
+ZmId.SEARCH_ADVANCED="ADV";
+ZmId.SEARCH_LOCAL="LOCAL";
+ZmId.SEARCH_ALL_ACCOUNTS="ALL_ACCOUNTS";
+ZmId.SEARCH_ANY="ANY";
+ZmId.SEARCH_GAL="GAL";
+ZmId.SEARCH_MAIL="MAIL";
+ZmId.SEARCH_SHARED="SHARED";
+ZmId.APP="App";
+ZmId.TREEITEM_INBOX="zti|Mail|2";
+ZmId.TREEITEM_JUNK="zti|Mail|4";
+ZmId.TREEITEM_SENT="zti|Mail|5";
+ZmId.TREEITEM_DRAFTS="zti|Mail|6";
+ZmId.TREEITEM_TRASH_MAIL="zti|Mail|3";
+ZmId.TREEITEM_TRASH_CONTACTS="zti|Contacts|3";
+ZmId.TREEITEM_CONTACTS="zti|Contacts|7";
+ZmId.TREEITEM_CALENDAR="zti|Calendar|10";
+ZmId.TREEITEM_NOTEBOOK="zti|Notebook|12";
+ZmId.TREEITEM_TASKS="zti|Tasks|15";
+ZmId.TREEITEM_BRIEFCASE="zti|Briefcase|16";
+ZmId.MV_HDR_TABLE="_hdrTable";
+ZmId.MV_HDR_TABLE_TOP_ROW="_hdrTableTopRow";
+ZmId.MV_CLOSE_BTN_CELL="_closeBtnCell";
+ZmId.MV_REPORT_BTN_CELL="_reportBtnCell";
+ZmId.MV_EXPAND_ROW="_expandRow";
+ZmId.MV_EXPAND_HDR="_expandHeader";
+ZmId.MV_ATT_LINKS="_attLinks";
+ZmId.MV_CONTACT_AREA="_contactArea";
+ZmId.MV_HIGHLIGHT_OBJ="_highlightObjects";
+ZmId.MV_DISPLAY_IMAGES="_displayImages";
+ZmId.MV_MSG_TRUNC="_msgTruncation";
+ZmId.MV_INFO_BAR="_infoBar";
+ZmId.MV_TAG_ROW="_tagRow";
+ZmId.MV_TAG_CELL="_tagCell";
+ZmId.MV_MSG_BODY="_body";
+ZmId.CMP_HEADER="_header";
+ZmId.CMP_FROM_SELECT="_from_select";
+ZmId.CMP_TO_ROW="_to_row";
+ZmId.CMP_TO_PICKER="_to_picker";
+ZmId.CMP_TO_INPUT="_to_control";
+ZmId.CMP_CC_ROW="_cc_row";
+ZmId.CMP_CC_PICKER="_cc_picker";
+ZmId.CMP_CC_INPUT="_cc_control";
+ZmId.CMP_BCC_ROW="_bcc_row";
+ZmId.CMP_BCC_PICKER="_bcc_picker";
+ZmId.CMP_BCC_INPUT="_bcc_control";
+ZmId.CMP_BCC_TOGGLE="_toggle_bcc";
+ZmId.CMP_OBO_CHECKBOX="_obo_checkbox";
+ZmId.CMP_OBO_LABEL="_obo_label";
+ZmId.CMP_OBO_ROW="_obo_row";
+ZmId.CMP_SUBJECT_ROW="_subject_row";
+ZmId.CMP_SUBJECT_INPUT="_subject_control";
+ZmId.CMP_IDENTITY_ROW="_identity_row";
+ZmId.CMP_IDENTITY_SELECT="_identity_control";
+ZmId.CMP_PRIORITY="_priority";
+ZmId.CMP_ATT_ROW="_attachments_row";
+ZmId.CMP_ATT_DIV="_attachments_div";
+ZmId.CMP_TO="TO";
+ZmId.CMP_CC="CC";
+ZmId.CMP_BCC="BCC";
+ZmId.APP_BRIEFCASE="Briefcase";
+ZmId.APP_CALENDAR="Calendar";
+ZmId.APP_CONTACTS="Contacts";
+ZmId.APP_IM="IM";
+ZmId.APP_MAIL="Mail";
+ZmId.APP_MIXED="Mixed";
+ZmId.APP_NOTEBOOK="Notebook";
+ZmId.APP_PORTAL="Portal";
+ZmId.APP_PREFERENCES="Options";
+ZmId.APP_TASKS="Tasks";
+ZmId.APP_VOICE="Voice";
+ZmId.VIEW_ACCOUNT="ACCT";
+ZmId.VIEW_APPOINTMENT="APPT";
+ZmId.VIEW_APPT_SCHEDULE="APPTS";
+ZmId.VIEW_BRIEFCASE="BC";
+ZmId.VIEW_BRIEFCASE_DETAIL="BCD";
+ZmId.VIEW_BRIEFCASE_COLUMN="BCC";
+ZmId.VIEW_BRIEFCASE_ICON="BCI";
+ZmId.VIEW_CAL="CAL";
+ZmId.VIEW_CAL_APPT="CLA";
+ZmId.VIEW_CAL_DAY="CLD";
+ZmId.VIEW_CAL_LIST="CLL";
+ZmId.VIEW_CAL_MONTH="CLM";
+
+ZmId.VIEW_CAL_SCHEDULE="CLS";
+ZmId.VIEW_CAL_WEEK="CLW";
+ZmId.VIEW_CAL_WORK_WEEK="CLWW";
+ZmId.VIEW_CALL_LIST="CLIST";
+ZmId.VIEW_COMPOSE="COMPOSE";
+ZmId.VIEW_CONTACT_CARDS="CNC";
+ZmId.VIEW_CONTACT_SIMPLE="CNS";
+ZmId.VIEW_CONTACT_SRC="CNSRC";
+ZmId.VIEW_CONTACT_TGT="CNTGT";
+ZmId.VIEW_CONTACT="CN";
+ZmId.VIEW_CONVLIST="CLV";
+ZmId.VIEW_CONV="CV";
+ZmId.VIEW_FILTER_RULES="FRV";
+ZmId.VIEW_GROUP="GRP";
+ZmId.VIEW_IM_CHAT_MEMBER_LIST="IMCML";
+ZmId.VIEW_IM_CHAT_MULTI_WINDOW="IMCMW";
+ZmId.VIEW_IM_CHAT_TAB="IMCT";
+ZmId.VIEW_LOADING="LOADING";
+ZmId.VIEW_MAIL_CONFIRM="MAILCONFIRM";
+ZmId.VIEW_MIXED="MX";
+ZmId.VIEW_MOBILE_DEVICES="MD";
+ZmId.VIEW_MSG="MSG";
+ZmId.VIEW_MY_CARD="MYC";
+ZmId.VIEW_NOTEBOOK_FILE="NBF";
+ZmId.VIEW_NOTEBOOK_PAGE_EDIT="NBPE";
+ZmId.VIEW_NOTEBOOK_PAGE="NBP";
+ZmId.VIEW_NOTEBOOK_PAGE_VERSION="NBPV";
+ZmId.VIEW_NOTEBOOK_SITE="NBS";
+ZmId.VIEW_PORTAL="PORTAL";
+ZmId.VIEW_PREF="PREF";
+ZmId.VIEW_SHARE_PENDING="SVP";
+ZmId.VIEW_SHARE_MOUNTED="SVM";
+ZmId.VIEW_SHARE_GRANTS="SVG";
+ZmId.VIEW_SHORTCUTS="SHORTCUTS";
+ZmId.VIEW_TASK="TKV";
+ZmId.VIEW_TASK_NOT_STARTED="TKVN";
+ZmId.VIEW_TASK_COMPLETED="TKVC";
+ZmId.VIEW_TASK_IN_PROGRESS="TKVI";
+ZmId.VIEW_TASK_WAITING="TKVW";
+ZmId.VIEW_TASK_DEFERRED="TKVD";
+ZmId.VIEW_TASK_ALL="TKVA";
+ZmId.VIEW_TASKEDIT="TKE";
+ZmId.VIEW_TASKLIST="TKL";
+ZmId.VIEW_TRAD="TV";
+ZmId.VIEW_VOICEMAIL="VM";
+ZmId.VIEW_ATTACHMENTS="AV";
+ZmId.ITEM_APPOINTMENT="APPT";
+ZmId.ITEM_ATT="ATT";
+ZmId.ITEM_BRIEFCASE="BRIEFCASE_ITEM";
+ZmId.ITEM_CALL="CALL";
+ZmId.ITEM_CHAT="CHAT";
+ZmId.ITEM_CONTACT="CONTACT";
+ZmId.ITEM_CONV="CONV";
+ZmId.ITEM_DATA_SOURCE="DATA_SOURCE";
+ZmId.ITEM_DOCUMENT="DOCUMENT";
+ZmId.ITEM_GROUP="GROUP";
+ZmId.ITEM_MSG="MSG";
+ZmId.ITEM_PAGE="PAGE";
+ZmId.ITEM_RESOURCE="RESOURCE";
+ZmId.ITEM_ROSTER="ROSTER_ITEM";
+ZmId.ITEM_TASK="TASK";
+ZmId.ITEM_VOICEMAIL="VOICEMAIL";
+ZmId.ORG_ADDRBOOK="ADDRBOOK";
+ZmId.ORG_BRIEFCASE="BRIEFCASE";
+ZmId.ORG_CALENDAR="CALENDAR";
+ZmId.ORG_FOLDER="FOLDER";
+ZmId.ORG_NOTEBOOK="NOTEBOOK";
+ZmId.ORG_ROSTER_TREE_ITEM="ROSTER_TREE_ITEM";
+ZmId.ORG_ROSTER_TREE_GROUP="ROSTER_TREE_GROUP";
+ZmId.ORG_SEARCH="SEARCH";
+ZmId.ORG_TAG="TAG";
+ZmId.ORG_TASKS="TASKS";
+ZmId.ORG_ZIMLET="ZIMLET";
+ZmId.ORG_PREF_PAGE="PREF_PAGE";
+ZmId.FLD_ACCOUNT="ac";
+ZmId.FLD_ATTACHMENT="at";
+ZmId.FLD_CAPACITY="cp";
+ZmId.FLD_COMPANY="co";
+ZmId.FLD_DATE="dt";
+ZmId.FLD_EMAIL="em";
+ZmId.FLD_EXPAND="ex";
+ZmId.FLD_FILE_TYPE="ft";
+ZmId.FLD_FLAG="fg";
+ZmId.FLD_FOLDER="fo";
+ZmId.FLD_FRAGMENT="fm";
+ZmId.FLD_FROM="fr";
+ZmId.FLD_HOME_PHONE="hp";
+ZmId.FLD_ID="id";
+ZmId.FLD_INDEX="ix";
+ZmId.FLD_ITEM_ROW="rw";
+ZmId.FLD_ITEM_ROW_3PANE="r3";
+ZmId.FLD_LOCATION="lo";
+ZmId.FLD_NAME="na";
+ZmId.FLD_NOTES="no";
+ZmId.FLD_PARTICIPANT="pa";
+ZmId.FLD_PCOMPLETE="pc";
+ZmId.FLD_PRIORITY="pr";
+ZmId.FLD_RECURRENCE="re";
+ZmId.FLD_SELECTION="se";
+ZmId.FLD_SELECTION_CELL="sec";
+ZmId.FLD_SIZE="sz";
+ZmId.FLD_SORTED_BY="sb";
+ZmId.FLD_STATUS="st";
+ZmId.FLD_SUBJECT="su";
+ZmId.FLD_TAG="tg";
+ZmId.FLD_TAG_CELL="tc";
+ZmId.FLD_TYPE="ty";
+ZmId.FLD_WORK_PHONE="wp";
+ZmId.OP_ADD_FILTER_RULE="ADD_FILTER_RULE";
+ZmId.OP_ADD_SIGNATURE="ADD_SIGNATURE";
+ZmId.OP_ATTACHMENT="ATTACHMENT";
+ZmId.OP_BROWSE="BROWSE";
+ZmId.OP_BROWSE_FOLDER="BROWSE_FOLDER";
+ZmId.OP_CALL="CALL";
+ZmId.OP_CALL_MANAGER="CALL_MANAGER";
+ZmId.OP_CAL_REFRESH="CAL_REFRESH";
+ZmId.OP_CAL_LIST_VIEW="CAL_LIST_VIEW";
+ZmId.OP_CAL_VIEW_MENU="CAL_VIEW_MENU";
+ZmId.OP_CANCEL="CANCEL";
+ZmId.OP_CHECK_ALL="CHECK_ALL";
+ZmId.OP_CHECK_CALLS="CHECK_CALLS";
+ZmId.OP_CHECK_MAIL="CHECK_MAIL";
+ZmId.OP_CHECK_VOICEMAIL="CHECK_VOICEMAIL";
+ZmId.OP_CLEAR_ALL="CLEAR_ALL";
+ZmId.OP_CLOSE="CLOSE";
+ZmId.OP_COMPOSE_FORMAT="COMPOSE_FORMAT";
+ZmId.OP_COMPOSE_OPTIONS="COMPOSE_OPTIONS";
+ZmId.OP_CONTACT="CONTACT";
+ZmId.OP_CREATE_APPT="CREATE_APPT";
+ZmId.OP_CREATE_TASK="CREATE_TASK";
+ZmId.OP_CREATE_SLIDE_SHOW="CREATE_SLIDE_SHOW";
+ZmId.OP_DAY_VIEW="DAY_VIEW";
+ZmId.OP_DELETE="DELETE";
+ZmId.OP_DELETE_APPT_INSTANCE="DELETE_INSTANCE";
+ZmId.OP_DELETE_APPT_SERIES="DELETE_SERIES";
+ZmId.OP_DELETE_CONV="DELETE_CONV";
+ZmId.OP_DELETE_MENU="DELETE_MENU";
+ZmId.OP_DELETE_MSG="DELETE_MSG";
+ZmId.OP_DETACH="DETACH";
+ZmId.OP_DETACH_WIN="DETACH_WIN";
+ZmId.OP_DETACH_COMPOSE="DETACH_COMPOSE";
+ZmId.OP_DOWNLOAD_VOICEMAIL="DOWNLOAD_VOICEMAIL";
+ZmId.OP_DRAFT="DRAFT";
+ZmId.OP_EDIT="EDIT";
+ZmId.OP_EDIT_CONTACT="EDIT_CONTACT";
+ZmId.OP_EDIT_FILTER_RULE="EDIT_FILTER_RULE";
+ZmId.OP_EDIT_NOTEBOOK_CHROME="EDIT_NOTEBOOK_CHROME";
+ZmId.OP_EDIT_NOTEBOOK_CHROME="EDIT_NOTEBOOK_CHROME";
+ZmId.OP_EDIT_NOTEBOOK_FOOTER="EDIT_NOTEBOOK_FOOTER";
+ZmId.OP_EDIT_NOTEBOOK_HEADER="EDIT_NOTEBOOK_HEADER";
+ZmId.OP_EDIT_NOTEBOOK_INDEX="EDIT_NOTEBOOK_INDEX";
+ZmId.OP_EDIT_NOTEBOOK_SIDE_BAR="EDIT_NOTEBOOK_SIDE_BAR";
+ZmId.OP_EDIT_PROPS="EDIT_PROPS";
+ZmId.OP_EDIT_REPLY_ACCEPT="EDIT_REPLY_ACCEPT";
+ZmId.OP_EDIT_REPLY_CANCEL="EDIT_REPLY_CANCEL";
+ZmId.OP_EDIT_REPLY_DECLINE="EDIT_REPLY_DECLINE";
+ZmId.OP_EDIT_REPLY_TENTATIVE="EDIT_REPLY_TENTATIVE";
+ZmId.OP_EMPTY_FOLDER="EMPTY_FOLDER";
+ZmId.OP_EXPAND="EXPAND";
+ZmId.OP_EXPAND_ALL="EXPAND_ALL";
+ZmId.OP_FORMAT_HTML="FORMAT_HTML";
+ZmId.OP_FORMAT_HTML_SOURCE="FORMAT_HTML_SOURCE";
+ZmId.OP_FORMAT_MEDIA_WIKI="FORMAT_MEDIA_WIKI";
+ZmId.OP_FORMAT_RICH_TEXT="FORMAT_RICH_TEXT";
+ZmId.OP_FORMAT_TEXT="FORMAT_TEXT";
+ZmId.OP_FORMAT_TWIKI="FORMAT_TWIKI";
+ZmId.OP_FORWARD="FORWARD";
+ZmId.OP_FORWARD_ATT="FORWARD_ATT";
+ZmId.OP_FORWARD_BY_EMAIL="FORWARD_BY_EMAIL";
+ZmId.OP_FORWARD_INLINE="FORWARD_INLINE";
+ZmId.OP_FORWARD_MENU="FORWARD_MENU";
+ZmId.OP_FORWARD_APPT="FORWARD_APPT";
+ZmId.OP_FORWARD_APPT_INSTANCE="FORWARD_APPT_INSTANCE";
+ZmId.OP_FORWARD_APPT_SERIES="FORWARD_APPT_SERIES";
+ZmId.OP_FREE_BUSY_LINK="FREE_BUSY_LINK";
+ZmId.OP_GO_TO_URL="GO_TO_URL";
+ZmId.OP_IM="IM";
+ZmId.OP_IMPORT_FILE="IMPORT_FILE";
+ZmId.OP_IM_ADD_TO_CONTACT="IM_ADD_TO_CONTACT";
+ZmId.OP_IM_BLOCK_BUDDY="IM_BLOCK_BUDDY";
+ZmId.OP_IM_BUDDY_ARCHIVE="IM_BUDDY_ARCHIVE";
+ZmId.OP_IM_BUDDY_LIST="IM_BUDDY_LIST";
+ZmId.OP_IM_CLOSE_ALL_CHATS="IM_CLOSE_ALL_CHATS";
+ZmId.OP_IM_CLOSE_OTHER_CHATS="IM_CLOSE_OTHER_CHATS";
+ZmId.OP_IM_CLOSE_CHAT="IM_CLOSE_CHATS";
+ZmId.OP_IM_CREATE_CONTACT="IM_CREATE_CONTACT";
+ZmId.OP_IM_EDIT_CONTACT="IM_EDIT_CONTACT";
+ZmId.OP_IM_HTML="IM_HTML";
+ZmId.OP_IM_DELETE_GROUP="IM_DELETE_GROUP";
+ZmId.OP_IM_INVITE="IM_INVITE";
+ZmId.OP_IM_NEW_CHAT="IM_NEW_CHAT";
+ZmId.OP_IM_PRESENCE_AWAY="IM_PRESENCE_AWAY";
+ZmId.OP_IM_PRESENCE_CHAT="IM_PRESENCE_CHAT";
+ZmId.OP_IM_PRESENCE_CUSTOM_MSG="IM_PRESENCE_CUSTOM_MSG";
+ZmId.OP_IM_PRESENCE_DND="IM_PRESENCE_DND";
+ZmId.OP_IM_PRESENCE_INVISIBLE="IM_PRESENCE_INVISIBLE";
+ZmId.OP_IM_PRESENCE_MENU="IM_PRESENCE_MENU";
+ZmId.OP_IM_PRESENCE_OFFLINE="IM_PRESENCE_OFFLINE";
+ZmId.OP_IM_PRESENCE_ONLINE="IM_PRESENCE_ONLINE";
+ZmId.OP_IM_PRESENCE_XA="IM_PRESENCE_XA";
+ZmId.OP_IM_LOGOUT_YAHOO="IM_LOGOUT_YAHOO";
+ZmId.OP_IM_PRESENCE_CUSTOM_MRU="IM_PRESENCE_CUSTOM_MRU";
+ZmId.OP_IM_PRESENCE_MENU="IM_PRESENCE_MENU";
+ZmId.OP_IM_SORT_BY_NAME="IM_SORT_BY_NAME";
+ZmId.OP_IM_SORT_BY_PRESENCE="IM_SORT_BY_PRESENCE";
+ZmId.OP_IM_TOGGLE_BLOCKED="IM_TOGGLE_BLOCKED";
+ZmId.OP_IM_TOGGLE_OFFLINE="IM_TOGGLE_OFFLINE";
+ZmId.OP_IM_UNBLOCK_BUDDY="IM_UNBLOCK_BUDDY";
+ZmId.OP_INC_ATTACHMENT="INC_ATTACHMENT";
+ZmId.OP_INC_NONE="INC_NONE";
+ZmId.OP_INC_NO_PREFIX="INC_NO_PREFIX";
+ZmId.OP_INC_PREFIX="INC_PREFIX";
+ZmId.OP_INC_PREFIX_FULL="INC_PREFIX_FULL";
+ZmId.OP_INC_SMART="INC_SMART";
+ZmId.OP_INVITE_REPLY_ACCEPT="INVITE_REPLY_ACCEPT";
+ZmId.OP_INVITE_REPLY_DECLINE="INVITE_REPLY_DECLINE";
+ZmId.OP_INVITE_REPLY_MENU="INVITE_REPLY_MENU";
+ZmId.OP_INVITE_REPLY_TENTATIVE="INVITE_REPLY_TENTATIVE";
+ZmId.OP_MARK_ALL_READ="MARK_ALL_READ";
+ZmId.OP_MARK_HEARD="MARK_HEARD";
+ZmId.OP_MARK_READ="MARK_READ";
+ZmId.OP_MARK_UNHEARD="MARK_UNHEARD";
+ZmId.OP_MARK_UNREAD="MARK_UNREAD";
+ZmId.OP_MOBILE_CANCEL_WIPE="MOBILE_CANCEL_WIPE";
+ZmId.OP_MOBILE_RESUME_SYNC="MOBILE_RESUME_SYNC";
+ZmId.OP_MOBILE_SUSPEND_SYNC="MOBILE_SUSPEND_SYNC";
+ZmId.OP_MOBILE_WIPE="MOBILE_WIPE";
+ZmId.OP_MONTH_VIEW="MONTH_VIEW";
+ZmId.OP_MOUNT_ADDRBOOK="MOUNT_ADDRBOOK";
+ZmId.OP_MOUNT_BRIEFCASE="MOUNT_BRIEFCASE";
+ZmId.OP_MOUNT_CALENDAR="MOUNT_CALENDAR";
+ZmId.OP_MOUNT_FOLDER="MOUNT_FOLDER";
+ZmId.OP_MOUNT_NOTEBOOK="MOUNT_NOTEBOOK";
+ZmId.OP_MOUNT_TASK_FOLDER="MOUNT_TASK_FOLDER";
+ZmId.OP_MOVE="MOVE";
+ZmId.OP_MOVE_DOWN_FILTER_RULE="MOVE_DOWN_FILTER_RULE";
+ZmId.OP_MOVE_UP_FILTER_RULE="MOVE_UP_FILTER_RULE";
+ZmId.OP_NEW_ADDRBOOK="NEW_ADDRBOOK";
+ZmId.OP_NEW_ALLDAY_APPT="NEW_ALLDAY_APPT";
+ZmId.OP_NEW_APPT="NEW_APPT";
+ZmId.OP_NEW_BRIEFCASEITEM="NEW_BRIEFCASEITEM";
+ZmId.OP_NEW_CALENDAR="NEW_CALENDAR";
+ZmId.OP_NEW_CONTACT="NEW_CONTACT";
+ZmId.OP_NEW_DOC="NEW_DOC";
+ZmId.OP_NEW_FILE="NEW_FILE";
+ZmId.OP_NEW_FOLDER="NEW_FOLDER";
+ZmId.OP_NEW_GROUP="NEW_GROUP";
+ZmId.OP_NEW_MENU="NEW_MENU";
+ZmId.OP_NEW_MESSAGE="NEW_MESSAGE";
+ZmId.OP_NEW_MESSAGE_WIN="NEW_MESSAGE_WIN";
+ZmId.OP_NEW_NOTEBOOK="NEW_NOTEBOOK";
+ZmId.OP_NEW_PAGE="NEW_PAGE";
+ZmId.OP_NEW_PRESENTATION="NEW_PRESENTATION";
+ZmId.OP_NEW_ROSTER_GROUP="NEW_ROSTER_GROUP";
+ZmId.OP_NEW_ROSTER_ITEM="NEW_ROSTER_ITEM";
+ZmId.OP_NEW_SPREADSHEET="NEW_SPREADSHEET";
+ZmId.OP_NEW_TAG="NEW_TAG";
+ZmId.OP_NEW_TASK="NEW_TASK";
+ZmId.OP_NOTIFY="NOTIFY";
+ZmId.OP_NEW_TASK_FOLDER="NEW_TASK_FOLDER";
+ZmId.OP_OPEN_APPT_INSTANCE="OPEN_APPT_INSTANCE";
+ZmId.OP_OPEN_APPT_SERIES="OPEN_APPT_SERIES";
+ZmId.OP_OPEN_FILE="OPEN_FILE";
+ZmId.OP_PAGE_BACK="PAGE_BACK";
+ZmId.OP_PAGE_FORWARD="PAGE_FORWARD";
+ZmId.OP_PAUSE_TOGGLE="PAUSE_TOGGLE";
+ZmId.OP_PRINT="PRINT";
+ZmId.OP_PRINT_ADDRBOOK="PRINT_ADDRBOOK";
+ZmId.OP_PRINT_CONTACT="PRINT_CONTACT";
+ZmId.OP_REFRESH="REFRESH";
+ZmId.OP_REMOVE_FILTER_RULE="REMOVE_FILTER_RULE";
+ZmId.OP_RENAME_FOLDER="RENAME_FOLDER";
+ZmId.OP_RENAME_SEARCH="RENAME_SEARCH";
+ZmId.OP_RENAME_TAG="RENAME_TAG";
+ZmId.OP_REPLY="REPLY";
+ZmId.OP_REPLY_ACCEPT="REPLY_ACCEPT";
+ZmId.OP_REPLY_ACCEPT_IGNORE="REPLY_ACCEPT_IGNORE";
+ZmId.OP_REPLY_ACCEPT_NOTIFY="REPLY_ACCEPT_NOTIFY";
+ZmId.OP_REPLY_ALL="REPLY_ALL";
+ZmId.OP_REPLY_BY_EMAIL="REPLY_BY_EMAIL";
+ZmId.OP_REPLY_CANCEL="REPLY_CANCEL";
+ZmId.OP_REPLY_CANCEL="REPLY_CANCEL";
+ZmId.OP_REPLY_DECLINE="REPLY_DECLINE";
+ZmId.OP_REPLY_DECLINE_IGNORE="REPLY_DECLINE_IGNORE";
+ZmId.OP_REPLY_DECLINE_NOTIFY="REPLY_DECLINE_NOTIFY";
+ZmId.OP_REPLY_MENU="REPLY_MENU";
+ZmId.OP_REPLY_MODIFY="REPLY_MODIFY";
+ZmId.OP_REPLY_MODIFY="REPLY_MODIFY";
+ZmId.OP_REPLY_NEW_TIME="REPLY_NEW_TIME";
+ZmId.OP_REPLY_NEW_TIME="REPLY_NEW_TIME";
+ZmId.OP_REPLY_TENTATIVE="REPLY_TENTATIVE";
+ZmId.OP_REPLY_TENTATIVE_IGNORE="REPLY_TENTATIVE_IGNORE";
+ZmId.OP_REPLY_TENTATIVE_NOTIFY="REPLY_TENTATIVE_NOTIFY";
+ZmId.OP_REPORT="REPORT";
+ZmId.OP_REQUEST_READ_RECEIPT="REQUEST_READ_RECEIPT";
+ZmId.OP_RESET="RESET";
+ZmId.OP_REVERT_PAGE="REVERT_PAGE";
+ZmId.OP_RUN_FILTER_RULE="RUN_FILTER_RULE";
+ZmId.OP_SAVE="SAVE";
+ZmId.OP_SAVE_DRAFT="SAVE_DRAFT";
+ZmId.OP_SAVE_FILE="SAVE_FILE";
+ZmId.OP_SCHEDULE_VIEW="SCHEDULE_VIEW";
+ZmId.OP_SEARCH="SEARCH";
+ZmId.OP_SEARCH_MAIL="SEARCH_MAIL";
+ZmId.OP_SEND="SEND";
+ZmId.OP_SEND_FILE="SEND_FILE";
+ZmId.OP_SEND_FILE_AS_ATT="SEND_FILE_AS_ATT";
+ZmId.OP_SEND_FILE_MENU="SEND_FILE_MENU";
+ZmId.OP_SEND_PAGE="SEND_PAGE";
+ZmId.OP_SHARE="SHARE";
+ZmId.OP_SHARE_ACCEPT="SHARE_ACCEPT";
+ZmId.OP_SHARE_ADDRBOOK="SHARE_ADDRBOOK";
+ZmId.OP_SHARE_BRIEFCASE="SHARE_BRIEFCASE";
+ZmId.OP_SHARE_CALENDAR="SHARE_CALENDAR";
+ZmId.OP_SHARE_DECLINE="SHARE_DECLINE";
+ZmId.OP_SHARE_FOLDER="SHARE_FOLDER";
+ZmId.OP_SHARE_NOTEBOOK="SHARE_NOTEBOOK";
+ZmId.OP_SHARE_TASKFOLDER="SHARE_TASKFOLDER";
+ZmId.OP_SHOW_ALL_ITEM_TYPES="SHOW_ALL_ITEM_TYPES";
+ZmId.OP_SHOW_BCC="SHOW_BCC";
+ZmId.OP_SHOW_ONLY_CONTACTS="SHOW_ONLY_CONTACTS";
+ZmId.OP_SHOW_ONLY_MAIL="SHOW_ONLY_MAIL";
+ZmId.OP_SHOW_ORIG="SHOW_ORIG";
+ZmId.OP_SPAM="SPAM";
+ZmId.OP_SPELL_CHECK="SPELL_CHECK";
+ZmId.OP_SYNC="SYNC";
+ZmId.OP_SYNC_OFFLINE_FOLDER="SYNC_OFFLINE_FOLDER";
+ZmId.OP_TAG="TAG";
+ZmId.OP_TAG_COLOR_MENU="TAG_COLOR_MENU";
+ZmId.OP_TAG_MENU="TAG_MENU";
+ZmId.OP_PRINT_TASK="PRINT_TASK";
+ZmId.OP_PRINT_TASKFOLDER="PRINT_TASKFOLDER";
+ZmId.OP_TEXT="TEXT";
+ZmId.OP_TODAY="TODAY";
+ZmId.OP_UNDELETE="UNDELETE";
+ZmId.OP_VIEW="VIEW";
+ZmId.OP_VIEW_APPOINTMENT="VIEW_APPOINTMENT";
+ZmId.OP_VIEW_APPT_INSTANCE="VIEW_APPT_INSTANCE";
+ZmId.OP_VIEW_APPT_SERIES="VIEW_APPT_SERIES";
+ZmId.OP_VIEW_BY_DATE="VIEW_BY_DATE";
+ZmId.OP_VIEW_FILE_AS_HTML="VIEW_FILE_AS_HTML";
+ZmId.OP_VIEW_MENU="VIEW_MENU";
+ZmId.OP_WEEK_VIEW="WEEK_VIEW";
+ZmId.OP_WORK_WEEK_VIEW="WORK_WEEK_VIEW";
+ZmId.OP_ZIMLET="ZIMLET";
+ZmId.OP_SYNC_ALL="SYNC_ALL"
+}
+if(AjxPackage.define("zimbraMail.share.model.events.ZmEvent")){
+ZmEvent=function(e){
+this.type=e;
+this.event=null;
+this.source=null;
+this.item=null;
+this._details={}
+};
+ZmEvent.L_MODIFY=1;
+ZmEvent.L_PICKER=2;
+ZmEvent.S_TAG="TAG";
+ZmEvent.S_PICKER="PICKER";
+ZmEvent.S_SEARCH="SEARCH";
+ZmEvent.S_SETTING="SETTING";
+ZmEvent.S_SETTINGS="SETTINGS";
+ZmEvent.S_MOUNTPOINT="MOUNTPOINT";
+ZmEvent.S_ZIMLET="ZIMLET";
+ZmEvent.E_CREATE="CREATE";
+ZmEvent.E_DELETE="DELETE";
+ZmEvent.E_MODIFY="MODIFY";
+ZmEvent.E_LOAD="LOAD";
+ZmEvent.E_REMOVE="REMOVE";
+ZmEvent.E_REMOVE_ALL="REMOVE ALL";
+ZmEvent.E_MOVE="MOVE";
+ZmEvent.E_FLAGS="FLAGS";
+ZmEvent.E_TAGS="TAGS";
+ZmEvent.E_ZIMLETS="ZIMLET";
+ZmEvent.prototype.toString=function(){
+return"ZmEvent"
+};
+ZmEvent.prototype.set=function(e,t){
+this.event=e;
+this.source=t;
+this.handled=false
+};
+ZmEvent.prototype.setDetail=function(t,e){
+this._details[t]=e
+};
+ZmEvent.prototype.getDetail=function(e){
+return this._details[e]
+};
+ZmEvent.prototype.getItems=function(){
+var e=this._details.items;
+return e?e:[]
+};
+ZmEvent.prototype.setDetails=function(e){
+this._details=e?e:{}
+};
+ZmEvent.prototype.getDetails=function(){
+return this._details
+}
+}
+if(AjxPackage.define("zimbraMail.share.model.events.ZmAppEvent")){
+ZmAppEvent=function(e){
+ZmEvent.call(this)
+};
+ZmAppEvent.prototype=new ZmEvent;
+ZmAppEvent.prototype.constructor=ZmAppEvent;
+ZmAppEvent.PRE_STARTUP="PRESTARTUP";
+ZmAppEvent.POST_STARTUP="POSTSTARTUP";
+ZmAppEvent.PRE_LAUNCH="PRELAUNCH";
+ZmAppEvent.POST_LAUNCH="POSTLAUNCH";
+ZmAppEvent.POST_RENDER="POSTRENDER";
+ZmAppEvent.ACTIVATE="ACTIVATE";
+ZmAppEvent.prototype.toString=function(){
+return"ZmAppEvent"
+}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmModel")){
+ZmModel=function(e){
+if(arguments.length==0){
+return
+}
+this._evt=new ZmEvent(e);
+this._evtMgr=new AjxEventMgr()
+};
+ZmModel.prototype.toString=function(){
+return"ZmModel"
+};
+ZmModel.prototype.addChangeListener=function(e){
+return this._evtMgr.addListener(ZmEvent.L_MODIFY,e)
+};
+ZmModel.prototype.removeChangeListener=function(e){
+return this._evtMgr.removeListener(ZmEvent.L_MODIFY,e)
+};
+ZmModel.prototype.removeAllChangeListeners=function(){
+return this._evtMgr.removeAll(ZmEvent.L_MODIFY)
+};
+ZmModel.prototype._notify=function(t,e){
+if(this._evtMgr.isListenerRegistered(ZmEvent.L_MODIFY)){
+this._evt.set(t,this);
+this._evt.setDetails(e);
+this._evtMgr.notifyListeners(ZmEvent.L_MODIFY,this._evt)
+}};
+ZmModel.notifyEach=function(o,a,t){
+if(!(o&&o.length)){
+return
+}
+for(var e=0;
+e<o.length;
+e++){
+o[e]._notify(a,t)
+}}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmSetting")){
+ZmSetting=function(t,e){
+if(arguments.length==0){
+return
+}
+ZmModel.call(this,ZmEvent.S_SETTING);
+this.id=t;
+this.name=e.name;
+this.type=e.type;
+this.dataType=e.dataType||ZmSetting.D_STRING;
+this.defaultValue=e.defaultValue;
+if(this.type==ZmSetting.T_METADATA){
+this.section=e.section
+}
+if(e.isGlobal){
+ZmSetting.IS_GLOBAL[t]=true
+}
+if(e.isImplicit){
+ZmSetting.IS_IMPLICIT[t]=true
+}
+if(this.dataType==ZmSetting.D_HASH){
+this.value={};
+this.defaultValue={}
+}else{
+if(this.dataType==ZmSetting.D_LIST){
+this.value=[];
+this.defaultValue=[]
+}else{
+this.value=null
+}}};
+ZmSetting.prototype=new ZmModel;
+ZmSetting.prototype.constructor=ZmSetting;
+ZmSetting.T_CONFIG="config";
+ZmSetting.T_COS="cos";
+ZmSetting.T_METADATA="meta";
+ZmSetting.T_PREF="pref";
+ZmSetting.T_PSEUDO="pseudo";
+ZmSetting.M_IMPLICIT="implicit";
+ZmSetting.M_OFFLINE="offline";
+ZmSetting.D_STRING="string";
+ZmSetting.D_INT="int";
+ZmSetting.D_BOOLEAN="boolean";
+ZmSetting.D_LDAP_TIME="ldap_time";
+ZmSetting.D_HASH="hash";
+ZmSetting.D_LIST="list";
+ZmSetting.D_NONE="NONE";
+ZmSetting.ACL_AUTH="all";
+ZmSetting.ACL_GROUP="grp";
+ZmSetting.ACL_NONE="none";
+ZmSetting.ACL_PUBLIC="pub";
+ZmSetting.ACL_USER="usr";
+ZmSetting.CAL_DAY="day";
+ZmSetting.CAL_LIST="list";
+ZmSetting.CAL_MONTH="month";
+ZmSetting.CAL_WEEK="week";
+ZmSetting.CAL_WORK_WEEK="workWeek";
+ZmSetting.CAL_SCHEDULE="schedule";
+ZmSetting.CAL_VISIBILITY_PRIV="private";
+ZmSetting.CAL_VISIBILITY_PUB="public";
+ZmSetting.CLIENT_ADVANCED="advanced";
+ZmSetting.CLIENT_STANDARD="standard";
+ZmSetting.COMPOSE_FONT_COLOR="#000000";
+ZmSetting.COMPOSE_FONT_FAM="Times New Roman";
+ZmSetting.COMPOSE_FONT_SIZE=AjxMessageFormat.format(ZmMsg.pt,"12");
+ZmSetting.COMPOSE_TEXT="text";
+ZmSetting.COMPOSE_HTML="html";
+ZmSetting.CV_CARDS="cards";
+ZmSetting.CV_LIST="list";
+ZmSetting.DEDUPE_NONE="dedupeNone";
+ZmSetting.DEDUPE_SECOND="secondCopyifOnToOrCC";
+ZmSetting.DEDUPE_INBOX="moveSentMessageToInbox";
+ZmSetting.DEDUPE_ALL="dedupeAll";
+ZmSetting.DELETE_SELECT_NEXT="next";
+ZmSetting.DELETE_SELECT_PREV="previous";
+ZmSetting.DELETE_SELECT_ADAPT="adaptive";
+ZmSetting.GETMAIL_ACTION_DEFAULT="default";
+ZmSetting.GETMAIL_ACTION_UPDATE="update";
+ZmSetting.GROUP_BY_CONV="conversation";
+ZmSetting.GROUP_BY_MESSAGE="message";
+ZmSetting.HTTP_DEFAULT_PORT=80;
+ZmSetting.HTTPS_DEFAULT_PORT=443;
+ZmSetting.INCLUDE_NONE="includeNone";
+ZmSetting.INCLUDE="includeBody";
+ZmSetting.INCLUDE_PREFIX="includeBodyWithPrefix";
+ZmSetting.INCLUDE_PREFIX_FULL="includeBodyAndHeadersWithPrefix";
+ZmSetting.INCLUDE_ATTACH="includeAsAttachment";
+ZmSetting.INCLUDE_SMART="includeSmart";
+ZmSetting.LICENSE_BAD="bad";
+ZmSetting.LICENSE_GOOD="good";
+ZmSetting.LICENSE_GRACE="inGracePeriod";
+ZmSetting.MARK_READ_NONE=-1;
+ZmSetting.MARK_READ_NOW=0;
+ZmSetting.MARK_READ_TIME=1;
+ZmSetting.PROTO_HTTP="http:";
+ZmSetting.PROTO_HTTPS="https:";
+ZmSetting.PROTO_MIXED="mixed:";
+ZmSetting.RIGHT_VIEW_FREE_BUSY="viewFreeBusy";
+ZmSetting.RIGHT_INVITE="invite";
+ZmSetting.RP_BOTTOM="bottom";
+ZmSetting.RP_OFF="off";
+ZmSetting.RP_RIGHT="right";
+ZmSetting.SIG_INTERNET="internet";
+ZmSetting.SIG_OUTLOOK="outlook";
+ZmSetting.LOCALE_NAME="LOCALE_NAME";
+ZmSetting.SKIN_NAME="SKIN_NAME";
+ZmSetting.BRIEFCASE_ENABLED="BRIEFCASE_ENABLED";
+ZmSetting.CALENDAR_ENABLED="CALENDAR_ENABLED";
+ZmSetting.CONTACTS_ENABLED="CONTACTS_ENABLED";
+ZmSetting.IM_ENABLED="IM_ENABLED";
+ZmSetting.MAIL_ENABLED="MAIL_ENABLED";
+ZmSetting.MIXED_VIEW_ENABLED="MIXED_VIEW_ENABLED";
+ZmSetting.NOTEBOOK_ENABLED="NOTEBOOK_ENABLED";
+ZmSetting.OPTIONS_ENABLED="OPTIONS_ENABLED";
+ZmSetting.PORTAL_ENABLED="PORTAL_ENABLED";
+ZmSetting.TASKS_ENABLED="TASKS_ENABLED";
+ZmSetting.VOICE_ENABLED="VOICE_ENABLED";
+ZmSetting.CALENDAR_UPSELL_ENABLED="CALENDAR_UPSELL_ENABLED";
+ZmSetting.CONTACTS_UPSELL_ENABLED="CONTACTS_UPSELL_ENABLED";
+ZmSetting.MAIL_UPSELL_ENABLED="MAIL_UPSELL_ENABLED";
+ZmSetting.VOICE_UPSELL_ENABLED="VOICE_UPSELL_ENABLED";
+ZmSetting.APPS_COOKIE="ZM_APPS";
+ZmSetting.APP_LETTER={};
+ZmSetting.APP_LETTER[ZmSetting.PORTAL_ENABLED]="p";
+ZmSetting.APP_LETTER[ZmSetting.MAIL_ENABLED]="m";
+ZmSetting.APP_LETTER[ZmSetting.CALENDAR_ENABLED]="c";
+ZmSetting.APP_LETTER[ZmSetting.CONTACTS_ENABLED]="a";
+ZmSetting.APP_LETTER[ZmSetting.OPTIONS_ENABLED]="o";
+ZmSetting.APP_LETTER[ZmSetting.IM_ENABLED]="i";
+ZmSetting.APP_LETTER[ZmSetting.NOTEBOOK_ENABLED]="n";
+ZmSetting.APP_LETTER[ZmSetting.BRIEFCASE_ENABLED]="b";
+ZmSetting.APP_LETTER[ZmSetting.TASKS_ENABLED]="t";
+ZmSetting.APP_LETTER[ZmSetting.MIXED_VIEW_ENABLED]="x";
+ZmSetting.APP_LETTER[ZmSetting.VOICE_ENABLED]="v";
+ZmSetting.IS_GLOBAL={};
+ZmSetting.IS_IMPLICIT={};
+ZmSetting.CHANGED_IMPLICIT={};
+ZmSetting.prototype.toString=function(){
+return this.name+": "+this.value
+};
+ZmSetting.prototype.getValue=function(t,a){
+var s=null;
+if(this.value!=null){
+s=t?this.value[t]:this.value
+}else{
+if(this.defaultValue!=null){
+s=t?this.defaultValue[t]:this.defaultValue
+}else{
+return null
+}}
+if(a){
+if(this.dataType==ZmSetting.D_BOOLEAN){
+s=s?"TRUE":"FALSE"
+}else{
+if(this.dataType==ZmSetting.D_HASH){
+var o=[];
+for(var t in s){
+o.push(t)
+}
+o.sort();
+var n=[];
+for(var e=0;
+e<o.length;
+e++){
+var t=o[e];
+n.push([t,s[t]].join(":"))
+}
+s=n.join(",")
+}else{
+if(this.dataType==ZmSetting.D_LIST){
+s=s.join(",")
+}}}}
+return s
+};
+ZmSetting.prototype.getDefaultValue=function(e){
+return e?this.defaultValue[e]:this.defaultValue
+};
+ZmSetting.prototype.setValue=function(s,r,n,o,c){
+var e=s;
+var t=Boolean(e!=this.value);
+if(this.dataType==ZmSetting.D_STRING){
+this.value=e
+}else{
+if(this.dataType==ZmSetting.D_INT){
+e=parseInt(s);
+if(isNaN(e)){
+e=s
+}
+t=Boolean(e!=this.value);
+this.value=e
+}else{
+if(this.dataType==ZmSetting.D_BOOLEAN){
+if(typeof(e)=="string"){
+e=(e.toLowerCase()==="true")
+}
+t=Boolean(e!=this.value);
+this.value=e
+}else{
+if(this.dataType==ZmSetting.D_LDAP_TIME){
+var h=(e.toLowerCase)?h=(e.toLowerCase()).charAt(e.length-1):null;
+var a=parseInt(e);
+if(h=="d"){
+e=a*24*60*60
+}else{
+if(h=="h"){
+e=a*60*60
+}else{
+if(h=="m"){
+e=a*60
+}else{
+e=a
+}}}
+t=Boolean(e!=this.value);
+this.value=e
+}else{
+if(this.dataType==ZmSetting.D_HASH){
+if(r){
+if(e){
+this.value[r]=e
+}else{
+delete this.value[r]
+}}else{
+this.value=e
+}
+t=true
+}else{
+if(this.dataType==ZmSetting.D_LIST){
+if(e instanceof Array){
+this.value=e
+}else{
+this.value.push(e)
+}
+t=true
+}}}}}}
+if(n){
+if(r){
+this.defaultValue[r]=this.value[r]
+}else{
+this.defaultValue=this.value
+}}
+if(ZmSetting.IS_IMPLICIT[this.id]&&t&&!c){
+ZmSetting.CHANGED_IMPLICIT[this.id]=true
+}
+if(!this.name&&!o){
+this._notify(ZmEvent.E_MODIFY,r)
+}};
+ZmSetting.prototype.notifyModify=function(e){
+if(this.id==ZmSetting.QUOTA_USED&&e._name=="mbx"&&e.s!=null){
+this.setValue(e.s);
+this._notify(ZmEvent.E_MODIFY)
+}}
+}
+if(AjxPackage.define("zimbraMail.core.ZmAppCtxt")){
+ZmAppCtxt=function(){
+this._trees={};
+this.accountList=new ZmAccountList();
+this.accountList.add(new ZmZimbraAccount(ZmAccountList.DEFAULT_ID,null,false));
+this.inStartup=false;
+this.currentRequestParams=null;
+this.rememberMe=null;
+this.userDomain="";
+this.isFamilyMbox=false;
+this.multiAccounts=false;
+this._evtMgr=new AjxEventMgr();
+this._itemCache={};
+this._itemCacheDeferred={}
+};
+ZmAppCtxt._ZIMLETS_EVENT="ZIMLETS";
+ZmAppCtxt.prototype.toString=function(){
+return"ZmAppCtxt"
+};
+ZmAppCtxt.prototype.setAppController=function(e){
+this._appController=e
+};
+ZmAppCtxt.prototype.getAppController=function(){
+return this._appController
+};
+ZmAppCtxt.prototype.getAppChooser=function(){
+return this._appController.getAppChooser()
+};
+ZmAppCtxt.prototype.setRequestMgr=function(e){
+this._requestMgr=e
+};
+ZmAppCtxt.prototype.getRequestMgr=function(){
+return this._requestMgr
+};
+ZmAppCtxt.prototype.setStatusMsg=function(e){
+e=Dwt.getParams(arguments,ZmStatusView.MSG_PARAMS);
+this._appController.setStatusMsg(e)
+};
+ZmAppCtxt.prototype.getSettings=function(e){
+var t=this.accountList;
+var o=e?e.id:t.activeAccount?t.activeAccount.id:ZmAccountList.DEFAULT_ID;
+var a=t.getAccount(o);
+return a&&a.settings
+};
+ZmAppCtxt.prototype.setSettings=function(e,t){
+var a=this.accountList;
+var n=t?t.id:a.activeAccount?a.activeAccount.id:ZmAccountList.DEFAULT_ID;
+var o=a.getAccount(n);
+if(o){
+o.settings=e
+}};
+ZmAppCtxt.prototype.getMetaData=function(){
+if(!this._metaData){
+this._metaData=new ZmMetaData()
+}
+return this._metaData
+};
+ZmAppCtxt.prototype.get=function(o,e,t){
+var a=(this.isOffline&&ZmSetting.IS_GLOBAL[o])?this.accountList.mainAccount:t;
+return this.getSettings(a).get(o,e)
+};
+ZmAppCtxt.prototype.set=function(h,s,t,o,e,n){
+var r=(this.isOffline&&ZmSetting.IS_GLOBAL[h])?this.accountList.mainAccount:n;
+var a=this.getSettings(r).getSetting(h);
+if(a){
+a.setValue(s,t,o,e)
+}};
+ZmAppCtxt.prototype.getApp=function(e){
+return this._appController.getApp(e)
+};
+ZmAppCtxt.prototype.getCurrentAppName=function(){
+var e=this.isChildWindow?parentAppCtxt:this;
+return e._appController.getActiveApp()
+};
+ZmAppCtxt.prototype.getCurrentApp=function(){
+return this.getApp(this.getCurrentAppName())
+};
+ZmAppCtxt.prototype.getAppViewMgr=function(){
+return this._appController.getAppViewMgr()
+};
+ZmAppCtxt.prototype.getClientCmdHandler=function(e){
+if(!this._clientCmdHandler){
+AjxDispatcher.require("Extras");
+this._clientCmdHandler=new ZmClientCmdHandler()
+}
+return this._clientCmdHandler
+};
+ZmAppCtxt.prototype.getSearchController=function(){
+if(!this._searchController){
+this._searchController=new ZmSearchController(this._shell)
+}
+return this._searchController
+};
+ZmAppCtxt.prototype.getOverviewController=function(){
+if(!this._overviewController){
+this._overviewController=new ZmOverviewController(this._shell)
+}
+return this._overviewController
+};
+ZmAppCtxt.prototype.getImportExportController=function(){
+if(!this._importExportController){
+AjxDispatcher.require("ImportExport");
+this._importExportController=new ZmImportExportController()
+}
+return this._importExportController
+};
+ZmAppCtxt.prototype.getLoginDialog=function(){
+if(!this._loginDialog){
+this._loginDialog=new ZmLoginDialog(this._shell)
+}
+return this._loginDialog
+};
+ZmAppCtxt.prototype.getMsgDialog=function(){
+if(!this._msgDialog){
+this._msgDialog=new DwtMessageDialog({
+parent:this._shell}
+)
+}
+return this._msgDialog
+};
+ZmAppCtxt.prototype.getYesNoMsgDialog=function(){
+if(!this._yesNoMsgDialog){
+this._yesNoMsgDialog=new DwtMessageDialog({
+parent:this._shell,buttons:[DwtDialog.YES_BUTTON,DwtDialog.NO_BUTTON]}
+)
+}
+return this._yesNoMsgDialog
+};
+ZmAppCtxt.prototype.getYesNoCancelMsgDialog=function(){
+if(!this._yesNoCancelMsgDialog){
+this._yesNoCancelMsgDialog=new DwtMessageDialog({
+parent:this._shell,buttons:[DwtDialog.YES_BUTTON,DwtDialog.NO_BUTTON,DwtDialog.CANCEL_BUTTON]}
+)
+}
+return this._yesNoCancelMsgDialog
+};
+ZmAppCtxt.prototype.getOkCancelMsgDialog=function(){
+if(!this._okCancelMsgDialog){
+this._okCancelMsgDialog=new DwtMessageDialog({
+parent:this._shell,buttons:[DwtDialog.OK_BUTTON,DwtDialog.CANCEL_BUTTON]}
+)
+}
+return this._okCancelMsgDialog
+};
+ZmAppCtxt.prototype.getCancelMsgDialog=function(){
+if(!this._cancelMsgDialog){
+this._cancelMsgDialog=new DwtMessageDialog({
+parent:this._shell,buttons:[DwtDialog.CANCEL_BUTTON]}
+)
+}
+return this._cancelMsgDialog
+};
+ZmAppCtxt.prototype.getErrorDialog=function(){
+if(!this._errorDialog){
+AjxDispatcher.require("Startup2");
+this._errorDialog=new ZmErrorDialog(this._shell,ZmMsg)
+}
+return this._errorDialog
+};
+ZmAppCtxt.prototype.getNewTagDialog=function(){
+if(!this._newTagDialog){
+this._newTagDialog=new ZmNewTagDialog(this._shell)
+}
+return this._newTagDialog
+};
+ZmAppCtxt.prototype.getRenameTagDialog=function(){
+if(!this._renameTagDialog){
+AjxDispatcher.require("Extras");
+this._renameTagDialog=new ZmRenameTagDialog(this._shell)
+}
+return this._renameTagDialog
+};
+ZmAppCtxt.prototype.getNewFolderDialog=function(){
+if(!this._newFolderDialog){
+this._newFolderDialog=new ZmNewFolderDialog(this._shell)
+}
+return this._newFolderDialog
+};
+ZmAppCtxt.prototype.getNewAddrBookDialog=function(){
+if(!this._newAddrBookDialog){
+AjxDispatcher.require("Contacts");
+this._newAddrBookDialog=new ZmNewAddrBookDialog(this._shell)
+}
+return this._newAddrBookDialog
+};
+ZmAppCtxt.prototype.getNewCalendarDialog=function(){
+if(!this._newCalendarDialog){
+AjxDispatcher.require(["CalendarCore","Calendar","CalendarAppt"]);
+this._newCalendarDialog=new ZmNewCalendarDialog(this._shell)
+}
+return this._newCalendarDialog
+};
+ZmAppCtxt.prototype.getNewNotebookDialog=function(){
+if(!this._newNotebookDialog){
+AjxDispatcher.require(["NotebookCore","Notebook"]);
+this._newNotebookDialog=new ZmNewNotebookDialog(this._shell)
+}
+return this._newNotebookDialog
+};
+ZmAppCtxt.prototype.getNewTaskFolderDialog=function(){
+if(!this._newTaskFolderDialog){
+AjxDispatcher.require(["TasksCore","Tasks"]);
+this._newTaskFolderDialog=new ZmNewTaskFolderDialog(this._shell)
+}
+return this._newTaskFolderDialog
+};
+ZmAppCtxt.prototype.getPageConflictDialog=function(){
+if(!this._pageConflictDialog){
+AjxDispatcher.require(["NotebookCore","Notebook"]);
+this._pageConflictDialog=new ZmPageConflictDialog(this._shell)
+}
+return this._pageConflictDialog
+};
+ZmAppCtxt.prototype.getDialog=function(){
+if(!this._dialog){
+this._dialog=new DwtDialog({
+parent:this._shell}
+)
+}
+return this._dialog
+};
+ZmAppCtxt.prototype.getNewSearchDialog=function(){
+if(!this._newSearchDialog){
+this._newSearchDialog=new ZmNewSearchDialog(this._shell)
+}
+return this._newSearchDialog
+};
+ZmAppCtxt.prototype.getRenameFolderDialog=function(){
+if(!this._renameFolderDialog){
+AjxDispatcher.require("Extras");
+this._renameFolderDialog=new ZmRenameFolderDialog(this._shell)
+}
+return this._renameFolderDialog
+};
+ZmAppCtxt.prototype.getChooseFolderDialog=function(){
+if(!this._chooseFolderDialog){
+AjxDispatcher.require("Extras");
+this._chooseFolderDialog=new ZmChooseFolderDialog(this._shell)
+}
+return this._chooseFolderDialog
+};
+ZmAppCtxt.prototype.getPickTagDialog=function(){
+if(!this._pickTagDialog){
+AjxDispatcher.require("Extras");
+this._pickTagDialog=new ZmPickTagDialog(this._shell)
+}
+return this._pickTagDialog
+};
+ZmAppCtxt.prototype.getFolderNotifyDialog=function(){
+if(!this._folderNotifyDialog){
+this._folderNotifyDialog=new ZmFolderNotifyDialog(this._shell)
+}
+return this._folderNotifyDialog
+};
+ZmAppCtxt.prototype.getFolderPropsDialog=function(){
+if(!this._folderPropsDialog){
+this._folderPropsDialog=new ZmFolderPropsDialog(this._shell)
+}
+return this._folderPropsDialog
+};
+ZmAppCtxt.prototype.getLinkPropsDialog=function(){
+if(!this._linkPropsDialog){
+AjxDispatcher.require("Share");
+this._linkPropsDialog=new ZmLinkPropsDialog(this._shell)
+}
+return this._linkPropsDialog
+};
+ZmAppCtxt.prototype.getSharePropsDialog=function(){
+if(!this._sharePropsDialog){
+AjxDispatcher.require("Share");
+this._sharePropsDialog=new ZmSharePropsDialog(this._shell)
+}
+return this._sharePropsDialog
+};
+ZmAppCtxt.prototype.getAcceptShareDialog=function(){
+if(!this._acceptShareDialog){
+AjxDispatcher.require("Share");
+this._acceptShareDialog=new ZmAcceptShareDialog(this._shell)
+}
+return this._acceptShareDialog
+};
+ZmAppCtxt.prototype.getDeclineShareDialog=function(){
+if(!this._declineShareDialog){
+AjxDispatcher.require("Share");
+this._declineShareDialog=new ZmDeclineShareDialog(this._shell)
+}
+return this._declineShareDialog
+};
+ZmAppCtxt.prototype.getRevokeShareDialog=function(){
+if(!this._revokeShareDialog){
+AjxDispatcher.require("Share");
+this._revokeShareDialog=new ZmRevokeShareDialog(this._shell)
+}
+return this._revokeShareDialog
+};
+ZmAppCtxt.prototype.getMountFolderDialog=function(){
+if(!this._mountFolderDialog){
+AjxDispatcher.require("Share");
+this._mountFolderDialog=new ZmMountFolderDialog(this._shell)
+}
+return this._mountFolderDialog
+};
+ZmAppCtxt.prototype.getTimezonePickerDialog=function(){
+if(!this._timezonePickerDialog){
+AjxDispatcher.require("Share");
+this._timezonePickerDialog=new ZmTimezonePicker(this._shell)
+}
+return this._timezonePickerDialog
+};
+ZmAppCtxt.prototype.getFilterRuleDialog=function(){
+if(!this._filterRuleDialog){
+AjxDispatcher.require(["PreferencesCore","Preferences"]);
+this._filterRuleDialog=new ZmFilterRuleDialog()
+}
+return this._filterRuleDialog
+};
+ZmAppCtxt.prototype.getConfirmationDialog=function(){
+if(!this._confirmDialog){
+this._confirmDialog=new DwtConfirmDialog(this._shell)
+}
+return this._confirmDialog
+};
+ZmAppCtxt.prototype.getUploadDialog=function(){
+if(!this._uploadDialog){
+AjxDispatcher.require(["NotebookCore","Notebook"]);
+this._uploadDialog=new ZmUploadDialog(this._shell)
+}
+return this._uploadDialog
+};
+ZmAppCtxt.prototype.getImportDialog=function(){
+if(!this._importDialog){
+AjxDispatcher.require(["NotebookCore","Notebook"]);
+this._importDialog=new ZmImportDialog(this._shell)
+}
+return this._importDialog
+};
+ZmAppCtxt.prototype.getAttachDialog=function(){
+if(!this._attachDialog){
+AjxDispatcher.require("Share");
+this._attachDialog=new ZmAttachDialog(this._shell);
+this.runAttachDialogCallbacks()
+}
+return this._attachDialog
+};
+ZmAppCtxt.prototype.runAttachDialogCallbacks=function(){
+while(this._attachDialogCallback&&this._attachDialogCallback.length>0){
+var e=this._attachDialogCallback.shift();
+if(e&&(e instanceof AjxCallback)){
+e.run(this._attachDialog)
+}}};
+ZmAppCtxt.prototype.addAttachmentDialogCallback=function(e){
+if(!this._attachDialogCallback){
+this._attachDialogCallback=[]
+}
+this._attachDialogCallback.push(e)
+};
+ZmAppCtxt.prototype.getUploadConflictDialog=function(){
+if(!this._uploadConflictDialog){
+AjxDispatcher.require(["NotebookCore","Notebook"]);
+this._uploadConflictDialog=new ZmUploadConflictDialog(this._shell)
+}
+return this._uploadConflictDialog
+};
+ZmAppCtxt.prototype.getNewBriefcaseDialog=function(){
+if(!this._newBriefcaseDialog){
+AjxDispatcher.require(["BriefcaseCore","Briefcase"]);
+this._newBriefcaseDialog=new ZmNewBriefcaseDialog(this._shell)
+}
+return this._newBriefcaseDialog
+};
+ZmAppCtxt.prototype.getReplaceDialog=function(){
+if(!this._replaceDialog){
+AjxDispatcher.require("Share");
+this._replaceDialog=new ZmFindnReplaceDialog(this._shell)
+}
+return this._replaceDialog
+};
+ZmAppCtxt.prototype.getRootTabGroup=function(){
+if(this.isChildWindow){
+if(!this._childWinTabGrp){
+this._childWinTabGrp=new DwtTabGroup("CHILD_WINDOW")
+}}else{
+if(!this._rootTabGrp){
+this._rootTabGrp=new DwtTabGroup("ROOT")
+}}
+return this.isChildWindow?this._childWinTabGrp:this._rootTabGrp
+};
+ZmAppCtxt.prototype.getShell=function(){
+return this._shell
+};
+ZmAppCtxt.prototype.setShell=function(e){
+this._shell=e
+};
+ZmAppCtxt.prototype.getActiveAccount=function(){
+return this.isChildWindow?parentAppCtxt.accountList.activeAccount:this.accountList.activeAccount
+};
+ZmAppCtxt.prototype.getIdentityCollection=function(t){
+var e=this.isChildWindow?window.opener:window;
+return e.AjxDispatcher.run("GetIdentityCollection",t)
+};
+ZmAppCtxt.prototype.getDataSourceCollection=function(t){
+var e=this.isChildWindow?window.opener:window;
+return e.AjxDispatcher.run("GetDataSourceCollection",t)
+};
+ZmAppCtxt.prototype.getSignatureCollection=function(t){
+var e=this.isChildWindow?window.opener:window;
+return e.AjxDispatcher.run("GetSignatureCollection",t)
+};
+ZmAppCtxt.prototype.getTree=function(e,t){
+if(this.isChildWindow){
+return parentAppCtxt.getTree(e,t)
+}
+var a=this.accountList;
+var n=t?t.id:a.activeAccount?a.activeAccount.id:ZmAccountList.DEFAULT_ID;
+var o=a.getAccount(n);
+return o&&o.trees[ZmOrganizer.TREE_TYPE[e]]
+};
+ZmAppCtxt.prototype.setTree=function(t,e,a){
+var o=this.accountList;
+var s=a?a.id:o.activeAccount?o.activeAccount.id:ZmAccountList.DEFAULT_ID;
+var n=this.accountList.getAccount(s);
+if(n){
+n.trees[t]=e
+}};
+ZmAppCtxt.prototype.getFolderTree=function(e){
+return this.getTree(ZmOrganizer.FOLDER,e)
+};
+ZmAppCtxt.prototype.getTagTree=function(e){
+return this.getTree(ZmOrganizer.TAG,e)
+};
+ZmAppCtxt.prototype.getZimletTree=function(e){
+return this.getTree(ZmOrganizer.ZIMLET,e)
+};
+ZmAppCtxt.prototype.getUsername=function(e){
+return this.get(ZmSetting.USERNAME,e)
+};
+ZmAppCtxt.prototype.getUserDomain=function(e){
+if(!this.userDomain){
+var a=this.getUsername(e);
+if(a){
+var t=a.split("@");
+this.userDomain=(t&&t.length)?t[1]:""
+}}
+return this.userDomain
+};
+ZmAppCtxt.prototype.getUploadFrameId=function(){
+if(!this._uploadManagerIframeId){
+var a=Dwt.getNextId();
+var e=["<iframe name='",a,"' id='",a,"' src='",(AjxEnv.isIE&&location.protocol=="https:")?appContextPath+"/public/blank.html":'javascript:""',"' style='position: absolute; top: 0; left: 0; visibility: hidden'></iframe>"];
+var t=document.createElement("div");
+t.innerHTML=e.join("");
+document.body.appendChild(t.firstChild);
+this._uploadManagerIframeId=a
+}
+return this._uploadManagerIframeId
+};
+ZmAppCtxt.prototype.getUploadManager=function(){
+if(!this._uploadManager){
+this._uploadManager=new AjxPost(this.getUploadFrameId())
+}
+return this._uploadManager
+};
+ZmAppCtxt.prototype.getCurrentSearch=function(){
+return this.getCurrentApp().currentSearch
+};
+ZmAppCtxt.prototype.getCurrentViewId=function(){
+return this.getAppViewMgr().getCurrentViewId()
+};
+ZmAppCtxt.prototype.getCurrentView=function(){
+return this.getAppViewMgr().getCurrentView()
+};
+ZmAppCtxt.prototype.getCurrentController=function(){
+var e=this.getCurrentView();
+return(e&&e.getController)?e.getController():null
+};
+ZmAppCtxt.prototype.setCurrentList=function(e){
+this._list=e
+};
+ZmAppCtxt.prototype.getCurrentList=function(){
+var e=this.getCurrentController();
+return(e&&e.getList)?e.getList():this._list?this._list:null
+};
+ZmAppCtxt.prototype.getNewWindow=function(r,s,e){
+var o=[];
+var n=0;
+o[n++]=document.location.protocol;
+o[n++]="//";
+o[n++]=location.hostname;
+o[n++]=(!location.port||location.port=="80")?"":(":"+location.port);
+o[n++]=appContextPath;
+o[n++]="/public/launchNewWindow.jsp?skin=";
+o[n++]=appCurrentSkin;
+o[n++]="&localeId=";
+o[n++]=AjxEnv.DEFAULT_LOCALE||"";
+if(r){
+o[n++]="&full=1"
+}
+if(appDevMode){
+o[n++]="&dev=1"
+}
+s=s||705;
+e=e||465;
+var a=["height=",e,",width=",s,",location=no,menubar=no,resizable=yes,scrollbars=no,status=yes,toolbar=no"].join("");
+var t=window.open(o.join(""),"_blank",a);
+if(!t){
+this.setStatusMsg(ZmMsg.popupBlocker,ZmStatusView.LEVEL_CRITICAL)
+}else{
+return this.getAppController().addChildWindow(t)
+}};
+ZmAppCtxt.prototype.cacheSet=function(e,t){
+this._itemCache[e]=t;
+delete this._itemCacheDeferred[e]
+};
+ZmAppCtxt.prototype.cacheSetDeferred=function(t,e){
+this._itemCache[t]=this._itemCacheDeferred;
+this._itemCacheDeferred[t]=e
+};
+ZmAppCtxt.prototype.cacheGet=function(t){
+var a=this._itemCache[t];
+if(a===this._itemCacheDeferred){
+var e=this._itemCacheDeferred[t];
+this.getApp(e).createDeferred();
+a=this._itemCache[t]
+}
+return a
+};
+ZmAppCtxt.prototype.cacheRemove=function(e){
+delete this._itemCache[e];
+delete this._itemCacheDeferred[e]
+};
+ZmAppCtxt.prototype.getById=function(e){
+return this.cacheGet(e)||(this.isChildWindow&&window.opener.appCtxt.getById(e))
+};
+ZmAppCtxt.prototype.getKeyboardMgr=function(){
+return this._shell.getKeyboardMgr()
+};
+ZmAppCtxt.prototype.getHistoryMgr=function(){
+if(!this._historyMgr){
+this._historyMgr=new AjxHistoryMgr()
+}
+return this._historyMgr
+};
+ZmAppCtxt.prototype.zimletsPresent=function(){
+return this._zimletsPresent
+};
+ZmAppCtxt.prototype.setZimletsPresent=function(e){
+this._zimletsPresent=e
+};
+ZmAppCtxt.prototype.getZimletMgr=function(){
+if(!this._zimletMgr){
+AjxDispatcher.require("Zimlet");
+this._zimletMgr=new ZmZimletMgr()
+}
+return this._zimletMgr
+};
+ZmAppCtxt.prototype.areZimletsLoaded=function(){
+return this._zimletsLoaded
+};
+ZmAppCtxt.prototype.addZimletsLoadedListener=function(t,e){
+if(!this._zimletsLoaded){
+return this._evtMgr.addListener(ZmAppCtxt._ZIMLETS_EVENT,t,e)
+}};
+ZmAppCtxt.prototype.allZimletsLoaded=function(){
+this._zimletsLoaded=true;
+if(this._zimletMgr&&!this.isChildWindow&&appCtxt.get(ZmSetting.PORTAL_ENABLED)){
+var e=this.getApp(ZmApp.PORTAL).getPortletMgr();
+if(e){
+e.allZimletsLoaded()
+}}
+if(this._evtMgr.isListenerRegistered(ZmAppCtxt._ZIMLETS_EVENT)){
+this._evtMgr.notifyListeners(ZmAppCtxt._ZIMLETS_EVENT,new ZmEvent());
+this._evtMgr.removeAll(ZmAppCtxt._ZIMLETS_EVENT)
+}};
+ZmAppCtxt.prototype.notifyZimlets=function(o,t,e){
+var a=this.isChildWindow?parentAppCtxt:this;
+if(e&&e.noChildWindow&&this.isChildWindow){
+return
+}
+if(!a.areZimletsLoaded()){
+if(e&&e.waitUntilLoaded){
+a.addZimletsLoadedListener(new AjxListener(this,this.notifyZimlets,[o,t]))
+}
+return
+}
+this.getZimletMgr().notifyZimlets(o,t)
+};
+ZmAppCtxt.prototype.getCalManager=function(){
+if(!this._calMgr){
+this._calMgr=new ZmCalMgr(this._shell)
+}
+return this._calMgr
+};
+ZmAppCtxt.prototype.getACL=function(e,n){
+var t=this.accountList;
+var o=e?e.id:t.activeAccount?t.activeAccount.id:ZmAccountList.DEFAULT_ID;
+var a=t.getAccount(o);
+return a&&a.acl
+};
+ZmAppCtxt.prototype.getShortcutHint=function(r,e){
+var s=null;
+r=r||"global";
+while(!s&&r){
+var o=[r,e,"display"].join(".");
+var s=AjxKeys[o]||ZmKeys[o];
+if(s){
+var a=s.split(/;\s*/);
+var n=a[0];
+if(!n){
+return null
+}
+n=n.replace(/\b[A-Z]\b/g,function(h){
+return h.toLowerCase()
+}
+);
+s=[" [",n.replace(",",""),"]"].join("")
+}else{
+var t=[r,"INHERIT"].join(".");
+r=AjxKeys[t]||ZmKeys[t]
+}}
+return s
+};
+ZmAppCtxt.prototype.getShortcutsPanel=function(){
+if(!this._shortcutsPanel){
+AjxDispatcher.require(["PreferencesCore","Preferences"]);
+var e=this.isChildWindow?ZmShortcutList.WINDOW_STYLE:ZmShortcutList.PANEL_STYLE;
+this._shortcutsPanel=new ZmShortcutsPanel(e)
+}
+return this._shortcutsPanel
+};
+ZmAppCtxt.prototype.getSkinHint=function(){
+if(arguments.length==0){
+return""
+}
+var a=skin&&skin.hints;
+if(!a){
+return""
+}
+for(var t=0;
+t<arguments.length;
+t++){
+var e=arguments[t];
+if(!a[e]){
+return""
+}
+a=a[e]
+}
+return a
+};
+ZmAppCtxt.prototype.getAutocompleter=function(){
+if(!this._autocompleter){
+this._autocompleter=new ZmAutocomplete()
+}
+return this._autocompleter
+};
+ZmAppCtxt.prototype.isMyAddress=function(o,a){
+if(a&&(o.indexOf("@")==-1)){
+o=[o,this.getUserDomain()].join("@")
+}
+if(o==this.get(ZmSetting.USERNAME)){
+return true
+}
+var e=this.get(ZmSetting.MAIL_ALIASES);
+if(e&&e.length){
+for(var t=0;
+t<e.length;
+t++){
+if(o==e[t]){
+return true
+}}}
+return false
+};
+ZmAppCtxt.prototype.getOverviewId=function(t,e){
+var a=(t instanceof Array)?t.join("_"):t;
+if(appCtxt.multiAccounts&&(e!==null)){
+e=e||appCtxt.getActiveAccount();
+a=[e.name,a].join(":")
+}
+return a
+}
+}
+if(AjxPackage.define("zimbraMail.core.ZmOperation")){
+ZmOperation=function(){};
+ZmOperation.NONE="NONE";
+ZmOperation.SEP="SEP";
+ZmOperation.SPACER="SPACER";
+ZmOperation.FILLER="FILLER";
+ZmOperation.DIS="Dis";
+ZmOperation.SETUP={};
+ZmOperation.SETUP[ZmOperation.NONE]={};
+ZmOperation.SETUP[ZmOperation.SEP]={};
+ZmOperation.SETUP[ZmOperation.SPACER]={};
+ZmOperation.SETUP[ZmOperation.FILLER]={};
+ZmOperation.SETTING={};
+ZmOperation.CALLBACK={};
+ZmOperation.registerOp=function(o,t,e,a){
+ZmOperation[o]=o;
+ZmOperation.SETUP[o]=t||{};
+if(e){
+ZmOperation.SETTING[o]=e
+}
+if(a){
+ZmOperation.CALLBACK[o]=a
+}};
+ZmOperation.KEY_ID="_opId";
+ZmOperation.MENUITEM_ID="_menuItemId";
+ZmOperation.NEW_ITEM_OPS=[];
+ZmOperation.NEW_ITEM_KEY={};
+ZmOperation.NEW_ORG_OPS=[];
+ZmOperation.NEW_ORG_KEY={};
+ZmOperation._operationDesc={};
+ZmOperation.initialize=function(){
+ZmOperation.registerOp(ZmId.OP_ATTACHMENT,{
+textKey:"addAttachment",tooltipKey:"attachmentTooltip",image:"Attachment",shortcut:ZmKeyMap.ATTACHMENT}
+);
+ZmOperation.registerOp(ZmId.OP_BROWSE,{
+textKey:"advancedSearch",image:"SearchBuilder",tooltipKey:"advancedSearchTooltip"}
+,ZmSetting.BROWSE_ENABLED);
+ZmOperation.registerOp(ZmId.OP_CALL,{
+image:"Telephone"}
+);
+ZmOperation.registerOp(ZmId.OP_CANCEL,{
+textKey:"cancel",tooltipKey:"cancelTooltip",image:"Cancel",shortcut:ZmKeyMap.CANCEL}
+);
+ZmOperation.registerOp(ZmId.OP_CHECK_ALL,{
+textKey:"checkAll",image:"Check"}
+);
+ZmOperation.registerOp(ZmId.OP_CLEAR_ALL,{
+textKey:"clearAll",image:"Cancel"}
+);
+ZmOperation.registerOp(ZmId.OP_CLOSE,{
+textKey:"close",tooltipKey:"closeTooltip",image:"Close",shortcut:ZmKeyMap.CANCEL}
+);
+ZmOperation.registerOp(ZmId.OP_COMPOSE_FORMAT,{
+textKey:"format",tooltipKey:"formatTooltip",image:"SwitchFormat",shortcut:ZmKeyMap.HTML_FORMAT}
+,ZmSetting.HTML_COMPOSE_ENABLED);
+ZmOperation.registerOp(ZmId.OP_DELETE,{
+textKey:"del",tooltipKey:"deleteTooltip",image:"Delete",shortcut:ZmKeyMap.DEL,textPrecedence:60}
+);
+ZmOperation.registerOp(ZmId.OP_DETACH,{
+tooltipKey:"detachTT",image:"OpenInNewWindow"}
+);
+ZmOperation.registerOp(ZmId.OP_DETACH_WIN,{
+textKey:"detachTT",tooltipKey:"detachTT",image:"OpenInNewWindow"}
+);
+ZmOperation.registerOp(ZmId.OP_EDIT,{
+textKey:"edit",tooltipKey:"editTooltip",image:"Edit",shortcut:ZmKeyMap.EDIT}
+);
+ZmOperation.registerOp(ZmId.OP_EDIT_PROPS,{
+textKey:"editProperties",tooltipKey:"editPropertiesTooltip",image:"Properties"}
+);
+ZmOperation.registerOp(ZmId.OP_EXPAND_ALL,{
+textKey:"expandAll",image:"Plus"}
+);
+ZmOperation.registerOp(ZmId.OP_EMPTY_FOLDER,{
+textKey:"emptyFolder",image:"EmptyFolder"}
+);
+ZmOperation.registerOp(ZmId.OP_FORMAT_HTML,{
+textKey:"formatAsHtml",image:"HtmlDoc"}
+,ZmSetting.HTML_COMPOSE_ENABLED);
+ZmOperation.registerOp(ZmId.OP_FORMAT_TEXT,{
+textKey:"formatAsText",image:"GenericDoc"}
+,ZmSetting.HTML_COMPOSE_ENABLED);
+ZmOperation.registerOp(ZmId.OP_GO_TO_URL,{
+image:"URL"}
+);
+ZmOperation.registerOp(ZmId.OP_MARK_ALL_READ,{
+textKey:"markAllRead",image:"ReadMessage"}
+);
+ZmOperation.registerOp(ZmId.OP_MOUNT_FOLDER,{
+textKey:"mountFolder",image:"Folder"}
+);
+ZmOperation.registerOp(ZmId.OP_MOVE,{
+textKey:"move",tooltipKey:"moveTooltip",image:"MoveToFolder",textPrecedence:40}
+);
+ZmOperation.registerOp(ZmId.OP_NEW_FOLDER,{
+textKey:"newFolder",tooltipKey:"newFolderTooltip",image:"NewFolder",shortcut:ZmKeyMap.NEW_FOLDER}
+,ZmSetting.USER_FOLDERS_ENABLED);
+ZmOperation.registerOp(ZmId.OP_NEW_MENU,{
+textKey:"_new",shortcut:ZmKeyMap.NEW,textPrecedence:100}
+,null,AjxCallback.simpleClosure(function(e){
+ZmOperation.addDeferredMenu(ZmOperation.addNewMenu,e)
+}
+));
+ZmOperation.registerOp(ZmId.OP_NEW_TAG,{
+textKey:"newTag",tooltipKey:"newTagTooltip",image:"NewTag",shortcut:ZmKeyMap.NEW_TAG}
+,ZmSetting.TAGGING_ENABLED);
+ZmOperation.registerOp(ZmId.OP_NOTIFY,{
+textKey:"notify",image:"Feedback"}
+);
+ZmOperation.registerOp(ZmId.OP_PAGE_BACK,{
+image:"LeftArrow",shortcut:ZmKeyMap.PREV_PAGE}
+);
+ZmOperation.registerOp(ZmId.OP_PAGE_FORWARD,{
+image:"RightArrow",shortcut:ZmKeyMap.NEXT_PAGE}
+);
+ZmOperation.registerOp(ZmId.OP_PRINT,{
+textKey:"print",tooltipKey:"printTooltip",image:"Print",shortcut:ZmKeyMap.PRINT,textPrecedence:30}
+,ZmSetting.PRINT_ENABLED);
+ZmOperation.registerOp(ZmId.OP_REFRESH,{
+textKey:"refresh",tooltipKey:"refreshTooltip"}
+);
+ZmOperation.registerOp(ZmId.OP_RENAME_FOLDER,{
+textKey:"renameFolder",image:"Rename"}
+);
+ZmOperation.registerOp(ZmId.OP_RENAME_SEARCH,{
+textKey:"renameSearch",image:"Rename"}
+);
+ZmOperation.registerOp(ZmId.OP_RENAME_TAG,{
+textKey:"renameTag",image:"Rename"}
+,ZmSetting.TAGGING_ENABLED);
+ZmOperation.registerOp(ZmId.OP_SAVE,{
+textKey:"save",image:"Save",shortcut:ZmKeyMap.SAVE}
+);
+ZmOperation.registerOp(ZmId.OP_SEARCH,{
+textKey:"search",image:"Search"}
+,ZmSetting.SEARCH_ENABLED);
+ZmOperation.registerOp(ZmId.OP_SEND,{
+textKey:"send",tooltipKey:"sendTooltip",image:"Send",shortcut:ZmKeyMap.SEND}
+);
+ZmOperation.registerOp(ZmId.OP_FREE_BUSY_LINK,{
+textKey:"freeBusyLink",tooltipKey:"freeBusyLinkTooltip",image:"Send"}
+);
+ZmOperation.registerOp(ZmId.OP_SHARE,{
+textKey:"share",tooltipKey:"shareTooltip"}
+,ZmSetting.SHARING_ENABLED);
+ZmOperation.registerOp(ZmId.OP_SHARE_ACCEPT,{
+textKey:"acceptShare",image:"Check"}
+,ZmSetting.SHARING_ENABLED);
+ZmOperation.registerOp(ZmId.OP_SHARE_DECLINE,{
+textKey:"declineShare",image:"Cancel"}
+,ZmSetting.SHARING_ENABLED);
+ZmOperation.registerOp(ZmId.OP_SHARE_FOLDER,{
+textKey:"shareFolder",image:"SharedMailFolder"}
+);
+ZmOperation.registerOp(ZmId.OP_SHOW_ALL_ITEM_TYPES,{
+textKey:"showAllItemTypes",image:"Globe"}
+);
+ZmOperation.registerOp(ZmId.OP_SPELL_CHECK,{
+textKey:"spellCheck",image:"SpellCheck",tooltipKey:"spellCheckTooltip",shortcut:ZmKeyMap.SPELLCHECK}
+,ZmSetting.SPELL_CHECK_ENABLED);
+ZmOperation.registerOp(ZmId.OP_SYNC,{
+textKey:"reload",image:"Refresh",shortcut:ZmKeyMap.REFRESH}
+);
+ZmOperation.registerOp(ZmId.OP_SYNC_ALL,{
+textKey:"checkAllFeed",image:"Refresh"}
+);
+ZmOperation.registerOp(ZmId.OP_SYNC_OFFLINE_FOLDER,{
+textKey:"syncOfflineFolderOff",image:"Refresh"}
+,ZmSetting.OFFLINE_ENABLED);
+ZmOperation.registerOp(ZmId.OP_TAG,null,ZmSetting.TAGGING_ENABLED);
+ZmOperation.registerOp(ZmId.OP_TAG_COLOR_MENU,{
+textKey:"tagColor",image:"TagStack"}
+,ZmSetting.TAGGING_ENABLED,AjxCallback.simpleClosure(function(e){
+ZmOperation.addDeferredMenu(ZmOperation.addColorMenu,e)
+}
+));
+ZmOperation.registerOp(ZmId.OP_TAG_MENU,{
+tooltipKey:"tagTooltip",image:"Tag"}
+,ZmSetting.TAGGING_ENABLED,AjxCallback.simpleClosure(function(e){
+ZmOperation.addDeferredMenu(ZmOperation.addTagMenu,e)
+}
+));
+ZmOperation.registerOp(ZmId.OP_TEXT);
+ZmOperation.registerOp(ZmId.OP_UNDELETE,{
+textKey:"undelete",tooltipKey:"undelete",image:"MoveToFolder"}
+);
+ZmOperation.registerOp(ZmId.OP_VIEW,{
+textKey:"view",image:"SplitView"}
+);
+ZmOperation.registerOp(ZmId.OP_VIEW_MENU,{
+tooltipKey:"viewTooltip",textKey:"view",image:"SplitPane",textPrecedence:80}
+);
+ZmOperation.registerOp(ZmId.OP_ZIMLET,{
+image:"ZimbraIcon"}
+);
+ZmOperation.NEW_ORG_OPS.push(ZmOperation.NEW_FOLDER,ZmOperation.NEW_TAG);
+ZmOperation.NEW_ORG_KEY[ZmOperation.NEW_FOLDER]="folder";
+ZmOperation.NEW_ORG_KEY[ZmOperation.NEW_TAG]="tag"
+};
+ZmOperation.createOperations=function(t,e,o){
+var a=new ZmOperation();
+return a._createOperations(t,e,o)
+};
+ZmOperation.prototype._createOperations=function(a,e,n){
+if(e==ZmOperation.NONE){
+e=null
+}
+n=n||{};
+var o={};
+if(e&&e.length){
+for(var t=0;
+t<e.length;
+t++){
+var s=e[t];
+ZmOperation.defineOperation(s,n[s]);
+ZmOperation.addOperation(a,s,o)
+}}
+return o
+};
+ZmOperation.defineOperation=function(m,u){
+var t=(u&&u.id)||(m&&m.id)||m||Dwt.getNextId();
+var a=(u&&u.textKey)||ZmOperation.getProp(m,"textKey");
+var f=a&&ZmMsg[a];
+var c=(u&&u.tooltipKey)||ZmOperation.getProp(m,"tooltipKey");
+var p=c&&ZmMsg[c];
+var n=ZmOperation.getProp(m,"image");
+var h=ZmOperation.getProp(m,"disImage");
+var d=(u&&(u.enabled!==false));
+var e=ZmOperation.getProp(m,"style");
+var s=ZmOperation.getProp(m,"shortcut");
+var o={
+id:t,text:f,image:n,disImage:h,enabled:d,tooltip:p,style:e,shortcut:s};
+if(u){
+for(var r in u){
+o[r]=u[r]
+}}
+ZmOperation._operationDesc[t]=o;
+return o
+};
+ZmOperation.getProp=function(o,a){
+var t=null;
+var e=ZmOperation.SETUP[o];
+if(e){
+t=e[a];
+if(!t&&(a=="disImage")&&e.image){
+t=e.image
+}}
+return t
+};
+ZmOperation.isSep=function(e){
+return(e==ZmOperation.SEP||e==ZmOperation.SPACER||e==ZmOperation.FILLER)
+};
+ZmOperation.addOperation=function(t,s,a,e){
+var o=ZmOperation._operationDesc[s]||ZmOperation.defineOperation(s);
+if(s==ZmOperation.SEP){
+if(t instanceof DwtMenu){
+t.createSeparator(e)
+}else{
+t.addSeparator(null,e)
+}}else{
+if(s==ZmOperation.SPACER){
+t.addSpacer(null,e)
+}else{
+if(s==ZmOperation.FILLER){
+t.addFiller(null,e)
+}else{
+if(e){
+o.index=e
+}
+a[s]=t.createOp(s,o)
+}}}
+var n=ZmOperation.CALLBACK[s];
+if(n){
+if(n.run){
+n.run(a[s])
+}else{
+n(a[s])
+}}};
+ZmOperation.addDeferredMenu=function(e,t){
+var a=new AjxCallback(null,e,t);
+t.setMenu(a)
+};
+ZmOperation.removeOperation=function(e,a,t){
+e.getOp(a).dispose();
+delete t[a]
+};
+ZmOperation.setOperation=function(t,s,e,n,o,a){
+var r=t.getOp(s);
+if(!r){
+return
+}
+r.setText(n?n:ZmMsg[ZmOperation.getProp(e,"textKey")]);
+r.setImage(o?o:ZmOperation.getProp(e,"image"))
+};
+ZmOperation.filterOperations=function(s){
+var o=[];
+if(!(s&&s.length)){
+return o
+}
+for(var t=0;
+t<s.length;
+t++){
+var r=s[t];
+if(!r){
+continue
+}
+var a=ZmOperation.SETTING[r];
+if(!a||appCtxt.get(a)){
+o.push(r)
+}}
+var e=[];
+var n=false;
+for(var t=0;
+t<o.length;
+t++){
+var r=o[t];
+if(r==ZmOperation.SEP||r==ZmOperation.SPACER){
+if(!n){
+e.push(r)
+}
+n=true
+}else{
+e.push(r);
+n=false
+}}
+if(e&&e.length){
+if(e[0]==ZmOperation.SEP||e[0]==ZmOperation.SPACER){
+e.shift()
+}
+var t=e.length-1;
+if(e[t]==ZmOperation.SEP||e[t]==ZmOperation.SPACER||e[t]==ZmOperation.FILLER){
+e.pop()
+}}
+return e
+};
+ZmOperation.addNewMenu=function(t){
+var o=ZmOperation.NEW_ITEM_OPS;
+o.push(ZmOperation.SEP);
+o=o.concat(ZmOperation.NEW_ORG_OPS);
+var s={};
+for(var e=0;
+e<o.length;
+e++){
+var r=o[e];
+var a=ZmOperation.NEW_ITEM_KEY[r]||ZmOperation.NEW_ORG_KEY[r];
+if(a){
+s[r]={
+textKey:a}
+}}
+var n=new ZmActionMenu({
+parent:t,menuItems:o,overrides:s}
+);
+t.setMenu(n);
+return n
+};
+ZmOperation.addTagMenu=function(e){
+var t=new ZmTagMenu(e);
+e.setMenu(t);
+return t
+};
+ZmOperation.addColorMenu=function(o){
+var s=new ZmPopupMenu(o);
+o.setMenu(s);
+var n=ZmTagTree.COLOR_LIST;
+for(var a=0;
+a<n.length;
+a++){
+var t=n[a];
+var e=s.createMenuItem(t,{
+image:ZmTag.COLOR_ICON[t],text:ZmOrganizer.COLOR_TEXT[t]}
+);
+e.setData(ZmOperation.MENUITEM_ID,t)
+}
+return s
+};
+ZmOperation.getToolTip=function(n,o,e){
+var t=ZmOperation._operationDesc[n]||ZmOperation.defineOperation(n);
+e=e||t.tooltip;
+var a=e&&t.shortcut&&appCtxt.getShortcutHint(o,t.shortcut);
+return a?[e,a].join(""):e
+}
+}
+if(AjxPackage.define("zimbraMail.core.ZmMimeTable")){
+ZmMimeTable=function(){};
+ZmMimeTable.APP="application";
+ZmMimeTable.APP_ADOBE_PDF="application/pdf";
+ZmMimeTable.APP_ADOBE_PS="application/postscript";
+ZmMimeTable.APP_APPLE_DOUBLE="application/applefile";
+ZmMimeTable.APP_EXE="application/exe";
+ZmMimeTable.APP_MS_DOWNLOAD="application/x-msdownload";
+ZmMimeTable.APP_MS_EXCEL="application/vnd.ms-excel";
+ZmMimeTable.APP_MS_PPT="application/vnd.ms-powerpoint";
+ZmMimeTable.APP_MS_PROJECT="application/vnd.ms-project";
+ZmMimeTable.APP_MS_TNEF="application/ms-tnef";
+ZmMimeTable.APP_MS_TNEF2="application/vnd.ms-tnef";
+ZmMimeTable.APP_MS_VISIO="application/vnd.visio";
+ZmMimeTable.APP_MS_WORD="application/msword";
+ZmMimeTable.APP_OCTET_STREAM="application/octet-stream";
+ZmMimeTable.APP_OPENXML_DOC="application/vnd.openxmlformats-officedocument.wordprocessingml.document";
+ZmMimeTable.APP_OPENXML_EXCEL="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
+ZmMimeTable.APP_OPENXML_PPT="application/vnd.openxmlformats-officedocument.presentationml.presentation";
+ZmMimeTable.APP_ZIMBRA_DOC="application/x-zimbra-doc";
+ZmMimeTable.APP_ZIMBRA_SLIDES="application/x-zimbra-slides";
+ZmMimeTable.APP_ZIMBRA_SPREADSHEET="application/x-zimbra-xls";
+ZmMimeTable.APP_ZIP="application/zip";
+ZmMimeTable.APP_ZIP2="application/x-zip-compressed";
+ZmMimeTable.AUDIO="audio";
+ZmMimeTable.AUDIO_WAV="audio/x-wav";
+ZmMimeTable.AUDIO_MP3="audio/mpeg";
+ZmMimeTable.IMG="image";
+ZmMimeTable.IMG_GIF="image/gif";
+ZmMimeTable.IMG_JPEG="image/jpeg";
+ZmMimeTable.IMG_PJPEG="image/pjpeg";
+ZmMimeTable.IMG_PNG="image/png";
+ZmMimeTable.IMG_TIFF="image/tiff";
+ZmMimeTable.MSG_RFC822="message/rfc822";
+ZmMimeTable.MULTI_ALT="multipart/alternative";
+ZmMimeTable.MULTI_MIXED="multipart/mixed";
+ZmMimeTable.MULTI_RELATED="multipart/related";
+ZmMimeTable.MULTI_APPLE_DBL="multipart/appledouble";
+ZmMimeTable.MULTI_DIGEST="multipart/digest";
+ZmMimeTable.TEXT="text";
+ZmMimeTable.TEXT_RTF="text/enriched";
+ZmMimeTable.TEXT_HTML="text/html";
+ZmMimeTable.TEXT_CAL="text/calendar";
+ZmMimeTable.TEXT_JAVA="text/x-java";
+ZmMimeTable.TEXT_VCARD="text/x-vcard";
+ZmMimeTable.TEXT_DIRECTORY="text/directory";
+ZmMimeTable.TEXT_PLAIN="text/plain";
+ZmMimeTable.TEXT_XML="text/xml";
+ZmMimeTable.VIDEO="video";
+ZmMimeTable.VIDEO_WMV="video/x-ms-wmv";
+ZmMimeTable.XML_ZIMBRA_SHARE="xml/x-zimbra-share";
+ZmMimeTable._table=new Object();
+ZmMimeTable._table[ZmMimeTable.APP]={
+desc:ZmMsg.unknownBinaryType,image:"ExeDoc",imageLarge:"ExeDoc_48"};
+ZmMimeTable._table[ZmMimeTable.APP_ADOBE_PDF]={
+desc:ZmMsg.adobePdfDocument,image:"PDFDoc",imageLarge:"PDFDoc_48"};
+ZmMimeTable._table[ZmMimeTable.APP_ADOBE_PS]={
+desc:ZmMsg.adobePsDocument,image:"GenericDoc",imageLarge:"GenericDoc_48"};
+ZmMimeTable._table[ZmMimeTable.APP_EXE]={
+desc:ZmMsg.application,image:"ExeDoc",imageLarge:"ExeDoc_48"};
+ZmMimeTable._table[ZmMimeTable.APP_MS_DOWNLOAD]={
+desc:ZmMsg.msDownload,image:"ExeDoc",imageLarge:"ExeDoc_48"};
+ZmMimeTable._table[ZmMimeTable.APP_MS_EXCEL]={
+desc:ZmMsg.msExcelDocument,image:"MSExcelDoc",imageLarge:"MSExcelDoc_48"};
+ZmMimeTable._table[ZmMimeTable.APP_MS_PPT]={
+desc:ZmMsg.msPPTDocument,image:"MSPowerpointDoc",imageLarge:"MSPowerpointDoc_48"};
+ZmMimeTable._table[ZmMimeTable.APP_MS_PROJECT]={
+desc:ZmMsg.msProjectDocument,image:"MSProjectDoc",imageLarge:"MSProjectDoc_48"};
+ZmMimeTable._table[ZmMimeTable.APP_MS_VISIO]={
+desc:ZmMsg.msVisioDocument,image:"MSVisioDoc",imageLarge:"MSVisioDoc_48"};
+ZmMimeTable._table[ZmMimeTable.APP_MS_WORD]={
+desc:ZmMsg.msWordDocument,image:"MSWordDoc",imageLarge:"MSWordDoc_48"};
+ZmMimeTable._table[ZmMimeTable.APP_OCTET_STREAM]={
+desc:ZmMsg.unknownBinaryType,image:"UnknownDoc",imageLarge:"UnknownDoc_48"};
+ZmMimeTable._table[ZmMimeTable.APP_OPENXML_DOC]={
+desc:ZmMsg.msWordDocument,image:"MSWordDoc",imageLarge:"MSWordDoc_48"};
+ZmMimeTable._table[ZmMimeTable.APP_OPENXML_EXCEL]={
+desc:ZmMsg.msExcelDocument,image:"MSExcelDoc",imageLarge:"MSExcelDoc_48"};
+ZmMimeTable._table[ZmMimeTable.APP_OPENXML_PPT]={
+desc:ZmMsg.msPPTDocument,image:"MSPowerpointDoc",imageLarge:"MSPowerpointDoc_48"};
+ZmMimeTable._table[ZmMimeTable.APP_ZIMBRA_DOC]={
+desc:ZmMsg.msWordDocument,image:"Doc",imageLarge:"Doc_48"};
+ZmMimeTable._table[ZmMimeTable.APP_ZIMBRA_SLIDES]={
+desc:ZmMsg.msPPTDocument,image:"Presentation",imageLarge:"Presentation_48"};
+ZmMimeTable._table[ZmMimeTable.APP_ZIMBRA_SPREADSHEET]={
+desc:ZmMsg.msExcelDocument,image:"ZSpreadSheet",imageLarge:"ZSpreadSheet_48"};
+ZmMimeTable._table[ZmMimeTable.APP_ZIP]={
+desc:ZmMsg.zipFile,image:"ZipDoc",imageLarge:"ZipDoc_48"};
+ZmMimeTable._table[ZmMimeTable.APP_ZIP2]={
+desc:ZmMsg.zipFile,image:"ZipDoc",imageLarge:"ZipDoc_48"};
+ZmMimeTable._table[ZmMimeTable.AUDIO]={
+desc:ZmMsg.audio,image:"AudioDoc",imageLarge:"Doc_48"};
+ZmMimeTable._table[ZmMimeTable.AUDIO_WAV]={
+desc:ZmMsg.waveAudio,image:"AudioDoc",imageLarge:"AudioDoc_48"};
+ZmMimeTable._table[ZmMimeTable.AUDIO_MP3]={
+desc:ZmMsg.mp3Audio,image:"AudioDoc",imageLarge:"AudioDoc_48"};
+ZmMimeTable._table[ZmMimeTable.VIDEO]={
+desc:ZmMsg.video,image:"VideoDoc",imageLarge:"VideoDoc_48"};
+ZmMimeTable._table[ZmMimeTable.VIDEO_WMV]={
+desc:ZmMsg.msWMV,image:"VideoDoc",imageLarge:"VideoDoc_48"};
+ZmMimeTable._table[ZmMimeTable.IMG]={
+desc:ZmMsg.image,image:"ImageDoc",imageLarge:"ImageDoc_48"};
+ZmMimeTable._table[ZmMimeTable.IMG_GIF]={
+desc:ZmMsg.gifImage,image:"ImageDoc",imageLarge:"ImageDoc_48"};
+ZmMimeTable._table[ZmMimeTable.IMG_JPEG]={
+desc:ZmMsg.jpegImage,image:"ImageDoc",imageLarge:"ImageDoc_48"};
+ZmMimeTable._table[ZmMimeTable.IMG_PNG]={
+desc:ZmMsg.pngImage,image:"ImageDoc",imageLarge:"ImageDoc_48"};
+ZmMimeTable._table[ZmMimeTable.IMG_TIFF]={
+desc:ZmMsg.tiffImage,image:"ImageDoc",imageLarge:"ImageDoc_48"};
+ZmMimeTable._table[ZmMimeTable.MSG_RFC822]={
+desc:ZmMsg.mailMessage,image:"MessageDoc",imageLarge:"MessageDoc_48"};
+ZmMimeTable._table[ZmMimeTable.TEXT]={
+desc:ZmMsg.textDocuments,image:"GenericDoc",imageLarge:"GenericDoc_48"};
+ZmMimeTable._table[ZmMimeTable.TEXT_RTF]={
+desc:ZmMsg.enrichedText,image:"GenericDoc",imageLarge:"GenericDoc_48"};
+ZmMimeTable._table[ZmMimeTable.TEXT_HTML]={
+desc:ZmMsg.htmlDocument,image:"HtmlDoc",imageLarge:"HtmlDoc_48"};
+ZmMimeTable._table[ZmMimeTable.TEXT_JAVA]={
+desc:ZmMsg.javaSource,image:"GenericDoc",imageLarge:"GenericDoc_48"};
+ZmMimeTable._table[ZmMimeTable.TEXT_PLAIN]={
+desc:ZmMsg.textFile,image:"GenericDoc",imageLarge:"GenericDoc_48"};
+ZmMimeTable._table[ZmMimeTable.TEXT_XML]={
+desc:ZmMsg.xmlDocument,image:"GenericDoc",imageLarge:"GenericDoc_48"};
+ZmMimeTable.getInfo=function(t,e){
+var a=ZmMimeTable._table[t];
+if(!a&&e){
+a=ZmMimeTable._table[t]={
+desc:t,image:"UnknownDoc",imageLarge:"UnknownDoc_48"}
+}
+if(a){
+if(!a.type){
+a.type=t
+}}else{
+var o=t.split("/")[0];
+if(o){
+a=ZmMimeTable._table[o]
+}}
+return a
+};
+ZmMimeTable.isIgnored=function(e){
+return(e==ZmMimeTable.MULTI_ALT||e==ZmMimeTable.MULTI_MIXED||e==ZmMimeTable.MULTI_RELATED||e==ZmMimeTable.MULTI_APPLE_DBL||e==ZmMimeTable.APP_MS_TNEF||e==ZmMimeTable.APP_MS_TNEF2)
+};
+ZmMimeTable.isRenderable=function(e){
+return(e==ZmMimeTable.TEXT_HTML||e==ZmMimeTable.TEXT_PLAIN||e==ZmMimeTable.IMG_JPEG||e==ZmMimeTable.IMG_GIF||e==ZmMimeTable.IMG_PNG)
+};
+ZmMimeTable.isRenderableImage=function(e){
+return(e==ZmMimeTable.IMG_JPEG||e==ZmMimeTable.IMG_GIF||e==ZmMimeTable.IMG_PNG)
+};
+ZmMimeTable.hasHtmlVersion=function(e){
+return(!(ZmMimeTable.isIgnored(e)||e.match(/^image/)||e.match(/^audio/)||e.match(/^video/)))
+}
+}};
+
+
+
+/* Copyright (C) 2005-2009 Zimbra Inc. http://www.zimbra.com/ */
+if(AjxPackage.define("Startup1_2")){
+if(AjxPackage.define("zimbraMail.share.model.ZmObjectHandler")){
+ZmObjectHandler=function(e,t){
+if(arguments.length>0){
+this.init(e,t)
+}};
+ZmObjectHandler.prototype.constructor=ZmObjectHandler;
+ZmObjectHandler.prototype.init=function(e,t){
+this._typeName=e;
+this._className=t?t:"Object"
+};
+ZmObjectHandler.prototype.toString=function(){
+if(!this._toString){
+var e=""+this.constructor;
+e=e.substring(0,e.indexOf("("));
+this._toString=e.substring("function ".length)
+}
+return this._toString
+};
+ZmObjectHandler.prototype.getTypeName=function(){
+return this._typeName
+};
+ZmObjectHandler.prototype.getClassName=function(t,e){
+return this._className
+};
+ZmObjectHandler.prototype.getHoveredClassName=function(a,t){
+var e=this.getClassName(a);
+if(this._cachedClassNameForHovered!==e){
+this._cachedClassNameForHovered=e;
+this._classNameHovered=e+"-"+DwtCssStyle.HOVER
+}
+return this._classNameHovered
+};
+ZmObjectHandler.prototype.getActiveClassName=function(a,t){
+var e=this.getClassName(a);
+if(this._cachedClassNameForActive!==e){
+this._cachedClassNameForActive=e;
+this._classNameActive=e+"-"+DwtCssStyle.ACTIVE
+}
+return this._classNameActive
+};
+ZmObjectHandler.prototype.findObject=function(e,t){
+if(t===0){
+this._lastMatch=null;
+this._noMatch=false
+}
+if(this._noMatch){
+return null
+}
+if(this._lastMatch&&this._lastMatch.index>=t){
+return this._lastMatch
+}
+this._lastMatch=this.match(e,t);
+this._noMatch=(this._lastMatch===null);
+return this._lastMatch
+};
+ZmObjectHandler.prototype.match=function(e,t){
+return null
+};
+ZmObjectHandler.prototype._getHtmlContent=function(a,e,n,t,o){
+a[e++]=AjxStringUtil.htmlEncode(n,true);
+return e
+};
+ZmObjectHandler.prototype.generateSpan=function(a,e,n,o,t){
+a[e++]="<span class='";
+a[e++]=this.getClassName(n);
+a[e++]="' id='";
+a[e++]=o;
+a[e++]="'>";
+e=this._getHtmlContent(a,e,n,t,o);
+a[e++]="</span>";
+return e
+};
+ZmObjectHandler.prototype.hasToolTipText=function(t,e){
+return true
+};
+ZmObjectHandler.prototype.getToolTipText=function(t,e){
+return AjxStringUtil.htmlEncode(t)
+};
+ZmObjectHandler.prototype.populateToolTip=function(t,e){};
+ZmObjectHandler.prototype.getActionMenu=function(a,t,e){
+return null
+};
+ZmObjectHandler.prototype.selected=function(o,t,a,e){
+return this.clicked(t,o,e,a)
+};
+ZmObjectHandler.prototype.clicked=function(t,o,e,a){};
+ZmObjectHandler.prototype.hoverOver=function(t,o,e,s){
+var a=DwtShell.getShell(window);
+var n=a.getToolTip();
+n.setContent(this.getToolTipText(t,o));
+n.popup(e,s);
+this.populateToolTip(t,o)
+};
+ZmObjectHandler.prototype.hoverOut=function(e,a){
+var t=DwtShell.getShell(window);
+var o=t.getToolTip();
+o.popdown()
+}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmObjectManager")){
+ZmObjectManager=function(t,e,a){
+this._selectCallback=e;
+this._uuid=Dwt.getNextId();
+this._objectIdPrefix="OBJ_PREFIX_";
+this._objectHandlers={};
+if(appCtxt.get(ZmSetting.MAIL_ENABLED)&&window.ZmImageAttachmentObjectHandler){
+this._imageAttachmentHandler=new ZmImageAttachmentObjectHandler()
+}
+if(!a){
+this.initialized=false;
+this._addAutoHandlers()
+}else{
+this.initialized=true
+}
+this.sortHandlers();
+this.reset();
+this.setView(t)
+};
+ZmObjectManager._TOOLTIP_DELAY=275;
+ZmObjectManager.EMAIL="email";
+ZmObjectManager.URL="url";
+ZmObjectManager.PHONE="phone";
+ZmObjectManager.DATE="date";
+ZmObjectManager.ADDRESS="address";
+ZmObjectManager.ATTR_CURRENT_DATE="currentDate";
+ZmObjectManager._autohandlers=[];
+ZmObjectManager.registerHandler=function(obj,type,priority){
+if(typeof obj=="string"){
+obj=eval(obj)
+}
+var c=ZmObjectManager._autohandlers;
+if(!obj.__registered){
+var id=c.push(obj);
+var i=id-1;
+if(type){
+c[i].useType=type
+}
+if(priority){
+c[i].usePrio=priority
+}
+obj.__registered=true
+}};
+ZmObjectManager.unregisterHandler=function(obj){
+if(typeof obj=="string"){
+obj=eval(obj)
+}
+var c=ZmObjectManager._autohandlers,i;
+for(i=c.length;
+--i>=0;
+){
+if(c[i]===obj){
+c.splice(i,1);
+break
+}}};
+ZmObjectManager.prototype.toString=function(){
+return"ZmObjectManager"
+};
+ZmObjectManager.prototype.getHandlers=function(){
+if(!this.initialized&&appCtxt.zimletsPresent()){
+var e=appCtxt.getZimletMgr();
+if(e.isLoaded()){
+this.initialized=true;
+var a=e.getContentZimlets();
+for(var t=0;
+t<a.length;
+t++){
+this.addHandler(a[t],a[t].type,a[t].prio)
+}}}
+return this._objectHandlers
+};
+ZmObjectManager.prototype.addHandler=function(a,t,e){
+t=t||(a.getTypeName()?a.getTypeName():"none");
+e=e?e:-1;
+a._prio=e;
+var o=this.getHandlers();
+if(!o[t]){
+o[t]=[]
+}
+o[t].push(a)
+};
+ZmObjectManager.prototype.removeHandler=function(a,t){
+t=t||(a.getTypeName()?a.getTypeName():"none");
+var n=this.getHandlers();
+if(n[t]){
+for(var e=0,o=n[t].length;
+e<o;
+e++){
+if(n[t][e]==a){
+n[t].splice(e,1);
+break
+}}}};
+ZmObjectManager.prototype.sortHandlers=function(){
+this._allObjectHandlers=[];
+var t=this.getHandlers();
+for(i in t){
+t[i].sort(ZmObjectManager.__byPriority);
+for(var e=0;
+e<t[i].length;
+e++){
+this._allObjectHandlers.push(t[i][e])
+}}
+this._allObjectHandlers.sort(ZmObjectManager.__byPriority)
+};
+ZmObjectManager.prototype._addAutoHandlers=function(){
+var s=ZmObjectManager._autohandlers,e,o,n;
+for(e=0;
+e<s.length;
+++e){
+o=s[e];
+var a=o;
+var t=o.TYPE;
+if(appCtxt.zimletsPresent()){
+if(!(o instanceof ZmZimletBase)){
+a=new o()
+}}
+if(o.useType){
+t=o.useType
+}
+if(o.usePrio){
+n=o.usePrio
+}
+this.addHandler(a,t,n)
+}};
+ZmObjectManager.prototype.reset=function(){
+this._objects={}
+};
+ZmObjectManager.prototype.setView=function(e){
+if(e!=null&&appCtxt.getZimletMgr().isLoaded()){
+e.addListener(DwtEvent.ONMOUSEOVER,new AjxListener(this,this._mouseOverListener));
+e.addListener(DwtEvent.ONMOUSEOUT,new AjxListener(this,this._mouseOutListener));
+e.addListener(DwtEvent.ONMOUSEDOWN,new AjxListener(this,this._mouseDownListener));
+e.addListener(DwtEvent.ONMOUSEUP,new AjxListener(this,this._mouseUpListener));
+e.addListener(DwtEvent.ONMOUSEMOVE,new AjxListener(this,this._mouseMoveListener));
+if(AjxEnv.isSafari){
+e.addListener(DwtEvent.ONCONTEXTMENU,new AjxListener(this,this._rightClickListener))
+}
+this._hoverOverListener=new AjxListener(this,this._handleHoverOver);
+this._hoverOutListener=new AjxListener(this,this._handleHoverOut)
+}
+this._view=e
+};
+ZmObjectManager.prototype.objectsCount=function(){
+return(appCtxt.zimletsPresent())?appCtxt.getZimletMgr().getContentZimlets().length:0
+};
+ZmObjectManager.prototype.getImageAttachmentHandler=function(){
+return this._imageAttachmentHandler
+};
+ZmObjectManager.prototype._getAjxEmailAddress=function(e){
+if(appCtxt.isChildWindow&&e.isAjxEmailAddress){
+e=AjxEmailAddress.copy(e)
+}
+return e
+};
+ZmObjectManager.prototype.findObjects=function(m,e,a,u){
+if(!m){
+return""
+}
+var r=[];
+var l=0;
+var h=m.length;
+var y=0;
+var o=this.getHandlers();
+while(true){
+var b=null;
+var f=h;
+var d=null;
+var g;
+var c;
+var s;
+var n=null;
+if(a){
+c=o[a];
+if(c){
+for(g=0;
+g<c.length;
+g++){
+n=c[g].findObject(m,y);
+if(!n){
+continue
+}
+if(n.index>=f){
+break
+}
+b=n;
+f=n.index;
+d=c[g]
+}}
+if(a=="email"||m instanceof AjxEmailAddress){
+if(d){
+m=this._getAjxEmailAddress(m);
+this.generateSpan(d,r,l,m,null)
+}else{
+r[l++]=AjxStringUtil.htmlEncode(m.toString())
+}
+return r.join("")
+}}else{
+for(var p=0;
+p<this._allObjectHandlers.length;
+p++){
+var t=this._allObjectHandlers[p];
+n=t.findObject(m,y);
+if(n&&n.index<f){
+b=n;
+f=n.index;
+d=t
+}}}
+if(!b){
+s=m.substring(y,h);
+if(e){
+r[l++]=AjxStringUtil.htmlEncode(s,!!u)
+}else{
+r[l++]=s
+}
+break
+}
+if(f>y){
+s=m.substring(y,f);
+if(e){
+r[l++]=AjxStringUtil.htmlEncode(s,!!u)
+}else{
+r[l++]=s
+}}
+if(d){
+l=this.generateSpan(d,r,l,b[0],b.context)
+}else{
+r[l++]=b[0]
+}
+y=b.index+(b.matchLength||b[0].length)
+}
+return r.join("")
+};
+ZmObjectManager.prototype.processObjectsInNode=function(s,n){
+var e=this;
+var a=s.createElement("div");
+s||(s=n.ownerDocument);
+var o=function(l,c){
+var u,m,h,p;
+switch(l.nodeType){
+case 1:l.normalize();
+u=l.tagName.toLowerCase();
+if(p==null){
+if(/^(img|a)$/.test(u)){
+if(u=="a"&&l.target&&(ZmMailMsgView._URL_RE.test(l.href)||ZmMailMsgView._MAILTO_RE.test(l.href))){
+var f=RegExp.$1;
+u=s.createElement("div");
+u.innerHTML=e.findObjects(AjxStringUtil.trim(RegExp.$1));
+u=u.firstChild;
+if(u.nodeType==3){
+return u.nextSibling
+}
+l.parentNode.insertBefore(u,l);
+u.innerHTML="";
+u.appendChild(l);
+return u.nextSibling
+}
+c=false
+}}else{
+l=p
+}
+if(parseFloat(l.style.textIndent)<0){
+l.style.textIndent=""
+}
+for(m=l.firstChild;
+m;
+m=o(m,c)){}
+return l.nextSibling;
+case 3:case 4:if(c&&/[^\s\xA0]/.test(l.data)){
+try{
+var v=null,y=null;
+if(!AjxEnv.isIE){
+var d=/^[\s\xA0]+/.exec(l.data);
+if(d){
+v=l;
+l=l.splitText(d[0].length)
+}
+d=/[\s\xA0]+$/.exec(l.data);
+if(d){
+y=l.splitText(l.data.length-d[0].length)
+}}
+u=a;
+var r=e.findObjects(l.data,true,null,false);
+var w=false;
+if(AjxEnv.isIE){
+u.innerHTML=["<pre>",r,"</pre>"].join("");
+w=true
+}else{
+u.innerHTML=r
+}
+if(v){
+u.insertBefore(v,u.firstChild)
+}
+if(y){
+u.appendChild(y)
+}
+v=l.parentNode;
+if(w){
+u=u.firstChild
+}
+while(u.firstChild){
+v.insertBefore(u.firstChild,l)
+}
+u=l.nextSibling;
+v.removeChild(l);
+return u
+}
+catch(g){}}}
+return l.nextSibling
+};
+for(var t=0;
+t<n.childNodes.length;
+t++){
+o(n.childNodes[t],true)
+}};
+ZmObjectManager.prototype.findObjectsInNode=function(a,t,n,s){
+var o=this,h=a.ownerDocument,l=h.createElement("div");
+if(!t){
+t=/^(script|link|object|iframe|applet)$/i
+}
+var e=function(u,m){
+var p,g,d,w;
+switch(u.nodeType){
+case 1:u.normalize();
+p=u.tagName.toLowerCase();
+if(s&&s.foreachElement){
+w=s.foreachElement(u,p,t,n)
+}
+if(w==null){
+if(/^(img|a)$/.test(p)){
+if(p=="a"&&u.target&&(ZmMailMsgView._URL_RE.test(u.href)||ZmMailMsgView._MAILTO_RE.test(u.href))){
+var y=RegExp.$1;
+p=h.createElement("div");
+p.innerHTML=o.findObjects(AjxStringUtil.trim(RegExp.$1));
+p=p.firstChild;
+if(p.nodeType==3){
+return p.nextSibling
+}
+u.parentNode.insertBefore(p,u);
+p.innerHTML="";
+p.appendChild(u);
+return p.nextSibling
+}
+m=false
+}else{
+if(t.test(p)||(n&&!n.test(p))){
+p=u.nextSibling;
+u.parentNode.removeChild(u);
+return p
+}}}else{
+u=w
+}
+if(AjxEnv.isIE){
+u.style.cssText=u.style.cssText
+}
+for(g=u.firstChild;
+g;
+g=e(g,m)){}
+return u.nextSibling;
+case 3:case 4:if(m&&/[^\s\xA0]/.test(u.data)){
+try{
+var q=null,k=null;
+if(!AjxEnv.isIE){
+var f=/^[\s\xA0]+/.exec(u.data);
+if(f){
+q=u;
+u=u.splitText(f[0].length)
+}
+f=/[\s\xA0]+$/.exec(u.data);
+if(f){
+k=u.splitText(u.data.length-f[0].length)
+}}
+p=l;
+var c=o.findObjects(u.data,true,null,false);
+var x=false;
+if(AjxEnv.isIE){
+p.innerHTML=["<pre>",c,"</pre>"].join("");
+x=true
+}else{
+p.innerHTML=c
+}
+if(q){
+p.insertBefore(q,p.firstChild)
+}
+if(k){
+p.appendChild(k)
+}
+q=u.parentNode;
+if(x){
+p=p.firstChild
+}
+while(p.firstChild){
+q.insertBefore(p.firstChild,u)
+}
+p=u.nextSibling;
+q.removeChild(u);
+return p
+}
+catch(v){}}}
+return u.nextSibling
+};
+var r=h.createDocumentFragment();
+while(a.firstChild){
+r.appendChild(a.firstChild);
+e(r.lastChild,true,this)
+}
+a.appendChild(r)
+};
+ZmObjectManager.prototype.findMatch=function(r,h){
+if(!r){
+return""
+}
+var a=r.length;
+var s=0;
+var l=null;
+var e=a;
+var c=null;
+var n;
+var u=null;
+if(h){
+var t=this.getHandlers()[h];
+if(t){
+for(n=0;
+n<t.length;
+n++){
+u=t[n].findObject(r,s);
+if(!u){
+continue
+}
+if(u.index>=e){
+break
+}
+l=u;
+e=u.index;
+c=t[n]
+}}}else{
+for(var o=0;
+o<this._allObjectHandlers.length;
+o++){
+var d=this._allObjectHandlers[o];
+u=d.findObject(r,s);
+if(u&&u.index<e){
+l=u;
+e=u.index;
+c=d
+}}}
+return l
+};
+ZmObjectManager.prototype.processHtmlNode=function(l,h,y,u){
+var w=l.ownerDocument;
+h=h!=null?h:true;
+var r=y instanceof RegExp?y:null;
+if(!r){
+y=y||["script","link","object","style","applet","iframe"];
+y=y instanceof Array?y:[y];
+r=new RegExp("^("+y.join("|")+")$","i")
+}
+var m=u instanceof RegExp?u:null;
+if(!m&&u){
+u=u instanceof Array?u:[u];
+m=new RegExp("^("+u.join("|")+")$","i")
+}
+var f,c,v;
+switch(l.nodeType){
+case 1:l.normalize();
+f=l.tagName.toLowerCase();
+if(/^(img|a)$/.test(f)){
+if(f=="a"&&(ZmMailMsgView._URL_RE.test(l.href)||ZmMailMsgView._MAILTO_RE.test(l.href))){
+var n=RegExp.$1;
+f=w.createElement("div");
+f.innerHTML=this.findObjects(AjxStringUtil.trim(RegExp.$1));
+f=f.firstChild;
+if(f.nodeType==3){
+return f.nextSibling
+}
+l.parentNode.insertBefore(f,l);
+f.innerHTML="";
+f.appendChild(l);
+return f.nextSibling
+}
+h=false
+}else{
+if(r.test(f)){
+f=l.nextSibling;
+l.parentNode.removeChild(l);
+return f
+}else{
+if(m&&m.test(f)){
+f=l.nextSibling;
+var e=w.createDocumentFragment();
+for(var o=l.firstChild;
+o;
+o=o.nextSibling){
+e.appendChild(o)
+}
+l.parentNode.replaceChild(e,l);
+return f
+}else{
+if(f=="style"){
+return l.nextSibling
+}}}}
+if(AjxEnv.isIE){
+l.style.cssText=l.style.cssText
+}
+var o=l.firstChild;
+while(o){
+o=this.processHtmlNode(o,h,r,m)
+}
+return l.nextSibling;
+case 3:case 4:if(h&&/[^\s\xA0]/.test(l.data)){
+try{
+var g=null,p=null;
+if(!AjxEnv.isIE){
+if(/^[\s\xA0]+/.test(l.data)){
+g=l;
+l=l.splitText(RegExp.lastMatch.length)
+}
+if(/[\s\xA0]+$/.test(l.data)){
+p=l.splitText(l.data.length-RegExp.lastMatch.length)
+}}
+f=w.createElement("div");
+var t=this.findObjects(l.data,true,null,false);
+var s=false;
+if(AjxEnv.isIE){
+f.innerHTML=["<pre>",t,"</pre>"].join("");
+s=true
+}else{
+f.innerHTML=t
+}
+if(g){
+f.insertBefore(g,f.firstChild)
+}
+if(p){
+f.appendChild(p)
+}
+g=l.parentNode;
+if(s){
+f=f.firstChild
+}
+while(f.firstChild){
+g.insertBefore(f.firstChild,l)
+}
+f=l.nextSibling;
+g.removeChild(l);
+return f
+}
+catch(d){}}}
+return l.nextSibling
+};
+ZmObjectManager.prototype.setHandlerAttr=function(o,t,n){
+var e=this.getHandlers()[o];
+if(e){
+for(var a=0;
+a<e.length;
+a++){
+e[a][t]=n
+}}};
+ZmObjectManager.prototype.generateSpan=function(o,a,e,n,t){
+var s=this._objectIdPrefix+Dwt.getNextId();
+this._objects[s]={
+object:n,handler:o,id:s,context:t};
+return o.generateSpan(a,e,n,s,t)
+};
+ZmObjectManager.prototype._findObjectSpan=function(t){
+while(t&&(!t.id||t.id.indexOf(this._objectIdPrefix)!==0)){
+t=t.parentNode
+}
+return t
+};
+ZmObjectManager.prototype._mouseOverListener=function(n){
+var o=this._findObjectSpan(n.target);
+if(!o){
+return false
+}
+var e=this._objects[o.id];
+if(!e){
+return false
+}
+o.className=e.handler.getHoveredClassName(e.object,e.context);
+if(e.handler.hasToolTipText()){
+var a=DwtShell.getShell(window);
+var t=a.getHoverMgr();
+if((!t.isHovering()||t.getHoverObject()!=e)&&!DwtMenu.menuShowing()){
+t.reset();
+t.setHoverOverDelay(ZmObjectManager._TOOLTIP_DELAY);
+t.setHoverObject(e);
+t.setHoverOverData(e);
+t.setHoverOverListener(this._hoverOverListener);
+t.hoverOver(n.docX,n.docY)
+}}
+n._returnValue=true;
+n._dontCallPreventDefault=true;
+return false
+};
+ZmObjectManager.prototype._mouseOutListener=function(n){
+var o=this._findObjectSpan(n.target);
+var e=o?this._objects[o.id]:null;
+if(e){
+o.className=e.handler.getClassName(e.object,e.context);
+var a=DwtShell.getShell(window);
+var t=a.getHoverMgr();
+t.setHoverOutDelay(0);
+t.setHoverOutData(e);
+t.setHoverOutListener(this._hoverOutListener);
+t.hoverOut()
+}
+return false
+};
+ZmObjectManager.prototype._mouseMoveListener=function(n){
+n._returnValue=true;
+n._dontCallPreventDefault=true;
+n._stopPropagation=true;
+var o=this._findObjectSpan(n.target);
+var e=o?this._objects[o.id]:null;
+if(e){
+var a=DwtShell.getShell(window);
+var t=a.getHoverMgr();
+if(!t.isHovering()){
+t.hoverOver(n.docX,n.docY)
+}}
+return false
+};
+ZmObjectManager.prototype._rightClickListener=function(e){
+e.button=DwtMouseEvent.RIGHT;
+return this._mouseDownListener(e)
+};
+ZmObjectManager.prototype._mouseDownListener=function(s){
+s._dontCallPreventDefault=true;
+s._returnValue=true;
+s._stopPropagation=false;
+var n=this._findObjectSpan(s.target);
+if(!n){
+return true
+}
+var t=this._objects[n.id];
+if(!t){
+return true
+}
+s._stopPropagation=true;
+var o=DwtShell.getShell(window);
+var a=o.getHoverMgr();
+a.setHoverOutDelay(0);
+a.setHoverOutData(t);
+a.setHoverOutListener(this._hoverOutListener);
+a.hoverOut();
+n.className=t.handler.getActiveClassName(t.object,t.context);
+if(s.button==DwtMouseEvent.RIGHT){
+var e=(this._view instanceof DwtDialog);
+var r=t.handler.getActionMenu(t.object,n,t.context,e);
+if(r){
+r.popup(0,s.docX,s.docY);
+s._dontCallPreventDefault=false;
+s._returnValue=false;
+s._stopPropagation=true;
+return true
+}}else{
+if(s.button==DwtMouseEvent.LEFT){
+if(this._selectCallback){
+this._selectCallback.run()
+}
+t.handler.selected(t.object,n,s,t.context);
+return true
+}}
+return false
+};
+ZmObjectManager.prototype._mouseUpListener=function(a){
+a._returnValue=true;
+a._dontCallPreventDefault=true;
+a._stopPropagation=true;
+var t=this._findObjectSpan(a.target);
+if(!t){
+return false
+}
+var e=this._objects[t.id];
+if(!e){
+return false
+}
+t.className=e.handler.getHoveredClassName(e.object,e.context);
+return false
+};
+ZmObjectManager.prototype._handleHoverOver=function(s){
+if(!(s&&s.object)){
+return
+}
+var n=this._findObjectSpan(s.target);
+var o=s.object.handler;
+var t=s.object.object;
+var a=s.object.context;
+var e=s.x;
+var r=s.y;
+o.hoverOver(t,a,e,r,n)
+};
+ZmObjectManager.prototype._handleHoverOut=function(n){
+if(!(n&&n.object)){
+return
+}
+var o=this._findObjectSpan(n.target);
+var a=n.object.handler;
+var e=n.object.object;
+var t=n.object.context;
+a.hoverOut(e,t,o)
+};
+ZmObjectManager.__byPriority=function(t,e){
+return(e._prio<t._prio)-(t._prio<e._prio)
+}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmSettings")){
+ZmSettings=function(e){
+ZmModel.call(this,ZmEvent.S_SETTINGS);
+this._settings={};
+this._nameToId={};
+this.getInfoResponse=null;
+if(!e){
+this.initialize()
+}};
+ZmSettings.prototype=new ZmModel;
+ZmSettings.prototype.constructor=ZmSettings;
+ZmSettings.prototype.registerSetting=function(a,t){
+ZmSetting[a]=a;
+var e=this._settings[a]=new ZmSetting(a,t);
+if(t.name){
+this._nameToId[t.name]=a
+}
+return e
+};
+ZmSettings.prototype.toString=function(){
+return"ZmSettings"
+};
+ZmSettings.prototype.initialize=function(){
+this._initialize();
+this._setDefaults();
+this.userSettingsLoaded=false;
+var e=new AjxListener(this,this._changeListener);
+this.getSetting(ZmSetting.QUOTA_USED).addChangeListener(e);
+this.getSetting(ZmSetting.POLLING_INTERVAL).addChangeListener(e);
+this.getSetting(ZmSetting.SKIN_NAME).addChangeListener(e);
+this.getSetting(ZmSetting.LOCALE_NAME).addChangeListener(e);
+this.getSetting(ZmSetting.SHORTCUTS).addChangeListener(e);
+this.getSetting(ZmSetting.CHILD_ACCTS_VISIBLE).addChangeListener(e)
+};
+ZmSettings.prototype.get=function(t,e){
+return(t&&this._settings[t])?this._settings[t].getValue(e):null
+};
+ZmSettings.prototype.getSetting=function(e){
+return this._settings[e]
+};
+ZmSettings.prototype.createFromJs=function(r){
+for(var a in r){
+var h=r[a];
+var o=this._settings[this._nameToId[a]];
+if(o){
+if(o.dataType==ZmSetting.D_HASH){
+var s=h.split(",");
+var n={};
+for(var t=0;
+t<s.length;
+t++){
+var e=s[t].split(":");
+n[e[0]]=e[1]
+}
+h=n
+}
+o.setValue(h,null,false,false,true);
+if(ZmSetting.IS_IMPLICIT[o.id]){
+o.origValue=o.getValue(null,false)
+}}else{}}};
+ZmSettings.prototype.getSettingByName=function(e){
+return this._nameToId[e]
+};
+ZmSettings.prototype.loadUserSettings=function(l,n,h,o,e,t){
+var s=[l,h,e];
+if(t){
+var r=AjxSoapDoc.create("GetInfoRequest","urn:zimbraAccount");
+var c=new AjxCallback(this,this._handleResponseLoadUserSettings,s);
+t.addNewRequestParams(r,c)
+}else{
+var a={
+soapDoc:(o?null:AjxSoapDoc.create("GetInfoRequest","urn:zimbraAccount")),accountName:h,asyncMode:true,callback:(new AjxCallback(this,this._handleResponseLoadUserSettings,s)),errorCallback:n,response:o};
+appCtxt.getAppController().sendRequest(a)
+}};
+ZmSettings.prototype._handleResponseLoadUserSettings=function(l,h,e,d){
+var o=this.getInfoResponse=d.getResponse().GetInfoResponse;
+if(o.name){
+this._settings[ZmSetting.USERNAME].setValue(o.name)
+}
+if(o.lifetime){
+this._settings[ZmSetting.TOKEN_LIFETIME].setValue(o.lifetime)
+}
+if(o.accessed){
+this._settings[ZmSetting.LAST_ACCESS].setValue(o.accessed)
+}
+if(o.prevSession){
+this._settings[ZmSetting.PREVIOUS_SESSION].setValue(o.prevSession)
+}
+if(o.recent){
+this._settings[ZmSetting.RECENT_MESSAGES].setValue(o.recent)
+}
+if(o.used){
+this._settings[ZmSetting.QUOTA_USED].setValue(o.used)
+}
+if(o.rest){
+this._settings[ZmSetting.REST_URL].setValue(o.rest)
+}
+if(o.license){
+this._settings[ZmSetting.LICENSE_STATUS].setValue(o.license.status)
+}
+if(o.prefs&&o.prefs._attrs){
+this.createFromJs(o.prefs._attrs)
+}
+if(o.attrs&&o.attrs._attrs){
+this.createFromJs(o.attrs._attrs)
+}
+if(e){
+for(var n in e){
+this.createFromJs(e[n])
+}}
+if(!h){
+appCtxt.accountList.createAccounts(this,o);
+if(appCtxt.isOffline&&AjxEnv.isPrism&&window.platform&&(AjxEnv.isMac||AjxEnv.isWindows)){
+var c=this._settings[ZmSetting.OFFLINE_SUPPORTS_MAILTO];
+if(c){
+c.setValue(true)
+
+}
+c=this._settings[ZmSetting.OFFLINE_SUPPORTS_DOCK_UPDATE];
+if(c){
+c.setValue(true)
+}
+c=this._settings[ZmSetting.OFFLINE_IS_MAILTO_HANDLER];
+try{
+if(c&&!window.platform.isRegisteredProtocolHandler("mailto")){
+c.setValue(false)
+}}
+catch(s){
+c=this._settings[ZmSetting.OFFLINE_SUPPORTS_MAILTO];
+c.setValue(false)
+}}}
+if(o.changePasswordURL){
+c=this._settings[ZmSetting.CHANGE_PASSWORD_URL];
+c.setValue(o.changePasswordURL)
+}
+if(o.publicURL){
+c=this._settings[ZmSetting.PUBLIC_URL];
+c.setValue(o.publicURL)
+}
+var c=this._settings[ZmSetting.REPLY_TO_ADDRESS];
+if(c){
+c.defaultValue=this.get(ZmSetting.USERNAME)
+}
+if(!this.get(ZmSetting.SEARCH_ENABLED)){
+c=this._settings[ZmSetting.BROWSE_ENABLED];
+if(c){
+c.setValue(false,null,true)
+}}
+if(this.get(ZmSetting.FORCE_CAL_OFF)){
+c=this._settings[ZmSetting.CALENDAR_ENABLED];
+if(c){
+c.setValue(false,null,true)
+}}
+if(!this.get(ZmSetting.OPTIONS_ENABLED)){
+c=this._settings[ZmSetting.FILTERS_ENABLED];
+if(c){
+c.setValue(false,null,true)
+}}
+if(!h){
+if(o.zimlets&&o.zimlets.zimlet){
+var a=o.zimlets.zimlet;
+for(var n=0;
+n<a.length;
+n++){
+var r=a[n];
+if(r.zimlet[0].name=="com_zimbra_usagetracker"){
+DwtControl.globalSelectionListener=new AjxListener(null,ZmZimbraMail.globalButtonListener);
+break
+}}
+var t=new AjxListener(this,function(){
+var u=new AjxCallback(this,this._loadZimlets,[o.zimlets.zimlet,o.props.prop]);
+AjxDispatcher.require("Zimlet",false,u)
+}
+);
+appCtxt.getAppController().addListener(ZmAppEvent.POST_STARTUP,t)
+}else{
+appCtxt.allZimletsLoaded()
+}}
+this.userSettingsLoaded=true;
+if(l){
+l.run(d)
+}};
+ZmSettings.prototype._loadZimlets=function(r,d){
+r=r||[];
+this.registerSetting("ZIMLETS",{
+type:ZmSetting.T_CONFIG,defaultValue:r,isGlobal:true}
+);
+this.registerSetting("USER_PROPS",{
+type:ZmSetting.T_CONFIG,defaultValue:d}
+);
+var o=[];
+var l=appCtxt.get(ZmSetting.CHECKED_ZIMLETS)||[];
+for(var s=0;
+s<r.length;
+s++){
+var m=r[s];
+var t=m.zimlet[0];
+if(!l||l.length<=0||(","+l.join(",")+",").indexOf(","+t.name+",")>=0){
+o.push(m)
+}}
+var a=appCtxt.getZimletMgr();
+a.loadZimlets(o,d);
+if(o&&o.length){
+var e=appCtxt.getCurrentApp();
+if(e){
+var p;
+if(appCtxt.multiAccounts){
+var h=e.getOverviewContainer().containerId;
+var f=ZmOrganizer.LABEL[ZmOrganizer.ZIMLET];
+var n=[h,f].join("_");
+p=appCtxt.getOverviewController().getOverview(n)
+}else{
+p=e.getOverview()
+}}
+if(p){
+p.setTreeView(ZmOrganizer.ZIMLET);
+if(appCtxt.multiAccounts&&a.getPanelZimlets().length==0){
+e.getOverviewContainer().removeZimletSection()
+}}
+if(appCtxt.get(ZmSetting.PORTAL_ENABLED)){
+var c=appCtxt.getApp(ZmApp.PORTAL).getPortletMgr();
+var u=c.createPortlets(true)
+}}};
+ZmSettings.prototype.loadPreferenceData=function(h){
+var r=new ZmBatchCommand(null,appCtxt.accountList.mainAccount.name);
+var s=AjxSoapDoc.create("GetAvailableSkinsRequest","urn:zimbraAccount");
+var n=new AjxCallback(this,this._handleResponseLoadAvailableSkins);
+r.addNewRequestParams(s,n);
+var e=AjxSoapDoc.create("GetAvailableLocalesRequest","urn:zimbraAccount");
+var o=new AjxCallback(this,this._handleResponseGetAllLocales);
+r.addNewRequestParams(e,o);
+var t=AjxSoapDoc.create("GetAvailableCsvFormatsRequest","urn:zimbraAccount");
+var a=new AjxCallback(this,this._handleResponseGetAvailableCsvFormats);
+r.addNewRequestParams(t,a);
+r.run(h)
+};
+ZmSettings.prototype._handleResponseLoadAvailableSkins=function(e){
+var n=e.getResponse().GetAvailableSkinsResponse;
+var o=n.skin;
+if(o&&o.length){
+var a=appCtxt.accountList.mainAccount.settings.getSetting(ZmSetting.AVAILABLE_SKINS);
+for(var t=0;
+t<o.length;
+t++){
+a.setValue(o[t].name)
+}}};
+ZmSettings.prototype._handleResponseGetAllLocales=function(a){
+var t=a._data.GetAvailableLocalesResponse.locale;
+if(t&&t.length){
+for(var o=0,n=t.length;
+o<n;
+o++){
+var e=t[o];
+e.id=e.id.replace(/^in/,"id");
+ZmLocale.create(e.id,e.name)
+}
+this.getSetting(ZmSetting.LOCALE_CHANGE_ENABLED).setValue(ZmLocale.hasChoices())
+}};
+ZmSettings.prototype._handleResponseGetAvailableCsvFormats=function(a){
+var t=a.getResponse().GetAvailableCsvFormatsResponse.csv;
+var n=appCtxt.accountList.mainAccount.settings.getSetting(ZmSetting.AVAILABLE_CSVFORMATS);
+if(t&&t.length){
+var e;
+for(var o=0;
+o<t.length;
+o++){
+n.setValue(t[o].name)
+}}};
+ZmSettings.prototype.save=function(d,f,o,a){
+if(!(d&&d.length)){
+return
+}
+var u=AjxSoapDoc.create("ModifyPrefsRequest","urn:zimbraAccount");
+var n=false;
+var t=[];
+for(var c=0;
+c<d.length;
+c++){
+var g=d[c];
+if(g.type==ZmSetting.T_METADATA){
+t.push(g);
+continue
+}else{
+if(g.type!=ZmSetting.T_PREF){
+continue
+}}
+if(!g.name){
+continue
+}
+if(g.dataType==ZmSetting.D_LIST){
+var m=g.getValue();
+if(m&&m.length){
+for(var r=0;
+r<m.length;
+r++){
+var s=u.set("pref",m[r]);
+s.setAttribute("name",g.name)
+}}else{
+var s=u.set("pref","");
+s.setAttribute("name",g.name)
+}}else{
+var m=g.getValue(null,true);
+var s=u.set("pref",m);
+s.setAttribute("name",g.name)
+}
+n=true
+}
+if(t.length>0){
+var l=new AjxCallback(this,this._handleResponseSaveMetaData,[t]);
+for(var c=0;
+c<t.length;
+c++){
+var h=t[c];
+appCtxt.getMetaData().set(h.section,h.name,h.value,o,l)
+}}
+if(n){
+var p;
+var e=false;
+if(f||o){
+p=new AjxCallback(this,this._handleResponseSave,[d,f]);
+e=true
+}
+if(o){
+o.addNewRequestParams(u,p)
+}else{
+appCtxt.getAppController().sendRequest({
+soapDoc:u,asyncMode:e,callback:p,accountName:a}
+)
+}}};
+ZmSettings.prototype._handleResponseSaveMetaData=function(o,e){
+for(var t=0;
+t<o.length;
+t++){
+var a=o[t];
+a.origValue=a.getValue(null,false);
+a._notify(ZmEvent.E_MODIFY)
+}};
+ZmSettings.prototype._handleResponseSave=function(o,s,e){
+var n=e.getResponse();
+if(n.ModifyPrefsResponse!=null){
+for(var t=0;
+t<o.length;
+t++){
+var a=o[t];
+a.origValue=a.getValue(null,false);
+a._notify(ZmEvent.E_MODIFY)
+}
+this._notify(ZmEvent.E_MODIFY,{
+settings:o}
+)
+}
+if(s){
+s.run(e)
+}};
+ZmSettings.prototype._setDefaults=function(){
+var e=AjxUtil.formatUrl({
+host:location.hostname,path:"/service/soap/",qsReset:true}
+);
+this._settings[ZmSetting.CSFE_SERVER_URI].setValue(e,null,false,true);
+e=AjxUtil.formatUrl({
+host:location.hostname,path:"/service/home/~/",qsReset:true,qsArgs:{
+auth:"co"}}
+);
+this._settings[ZmSetting.CSFE_MSG_FETCHER_URI].setValue(e,null,false,true);
+e=AjxUtil.formatUrl({
+host:location.hostname,path:"/service/upload",qsReset:true,qsArgs:{
+lbfums:""}}
+);
+this._settings[ZmSetting.CSFE_UPLOAD_URI].setValue(e,null,false,true);
+e=AjxUtil.formatUrl({
+host:location.hostname,path:"/service/upload",qsReset:true}
+);
+this._settings[ZmSetting.CSFE_ATTACHMENT_UPLOAD_URI].setValue(e,null,false,true);
+e=AjxUtil.formatUrl({
+host:location.hostname,path:"/service/home/~/",qsReset:true,qsArgs:{
+auth:"co",id:"{0}",fmt:"csv"}}
+);
+this._settings[ZmSetting.CSFE_EXPORT_URI].setValue(e,null,false,true);
+this._settings[ZmSetting.SORTING_PREF].setValue(ZmSearch.DATE_DESC,ZmId.VIEW_CONVLIST,true,true);
+this._settings[ZmSetting.SORTING_PREF].setValue(ZmSearch.DATE_DESC,ZmId.VIEW_CONV,true,true);
+this._settings[ZmSetting.SORTING_PREF].setValue(ZmSearch.DATE_DESC,ZmId.VIEW_TRAD,true,true);
+this._settings[ZmSetting.SORTING_PREF].setValue(ZmSearch.NAME_ASC,ZmId.VIEW_CONTACT_SRC,true,true);
+this._settings[ZmSetting.SORTING_PREF].setValue(ZmSearch.NAME_ASC,ZmId.VIEW_CONTACT_TGT,true,true);
+this._settings[ZmSetting.SORTING_PREF].setValue(ZmSearch.NAME_ASC,ZmId.VIEW_CONTACT_SIMPLE,true,true);
+this._settings[ZmSetting.SORTING_PREF].setValue(ZmSearch.NAME_ASC,ZmId.VIEW_CONTACT_CARDS,true,true);
+this._settings[ZmSetting.SORTING_PREF].setValue(ZmSearch.DATE_ASC,ZmId.VIEW_CAL,true,true);
+this._settings[ZmSetting.SORTING_PREF].setValue(ZmSearch.DUE_DATE_DESC,ZmId.VIEW_TASKLIST,true,true)
+};
+ZmSettings.prototype._initialize=function(){
+this.registerSetting("AC_TIMER_INTERVAL",{
+type:ZmSetting.T_CONFIG,dataType:ZmSetting.D_INT,defaultValue:300}
+);
+this.registerSetting("ASYNC_MODE",{
+type:ZmSetting.T_CONFIG,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("BRANCH",{
+type:ZmSetting.T_CONFIG,defaultValue:"main"}
+);
+this.registerSetting("CLIENT_DATETIME",{
+type:ZmSetting.T_CONFIG,defaultValue:"20091214-1754"}
+);
+this.registerSetting("CLIENT_RELEASE",{
+type:ZmSetting.T_CONFIG,defaultValue:"20091214174341"}
+);
+this.registerSetting("CLIENT_VERSION",{
+type:ZmSetting.T_CONFIG,defaultValue:"6.0.4_GA_2038.RHEL5_64"}
+);
+this.registerSetting("CONFIG_PATH",{
+type:ZmSetting.T_CONFIG,defaultValue:appContextPath+"/js/zimbraMail/config"}
+);
+this.registerSetting("CSFE_EXPORT_URI",{
+type:ZmSetting.T_CONFIG}
+);
+this.registerSetting("CSFE_MSG_FETCHER_URI",{
+type:ZmSetting.T_CONFIG}
+);
+this.registerSetting("CSFE_SERVER_URI",{
+type:ZmSetting.T_CONFIG}
+);
+this.registerSetting("CSFE_UPLOAD_URI",{
+type:ZmSetting.T_CONFIG}
+);
+this.registerSetting("CSFE_ATTACHMENT_UPLOAD_URI",{
+type:ZmSetting.T_CONFIG}
+);
+this.registerSetting("DEV",{
+type:ZmSetting.T_CONFIG,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("FORCE_CAL_OFF",{
+type:ZmSetting.T_CONFIG,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("HELP_URI",{
+type:ZmSetting.T_CONFIG,defaultValue:appContextPath+ZmMsg.helpURI}
+);
+this.registerSetting("HTTP_PORT",{
+type:ZmSetting.T_CONFIG,defaultValue:ZmSetting.HTTP_DEFAULT_PORT}
+);
+this.registerSetting("HTTPS_PORT",{
+type:ZmSetting.T_CONFIG,defaultValue:ZmSetting.HTTPS_DEFAULT_PORT}
+);
+this.registerSetting("INSTANT_NOTIFY_INTERVAL",{
+type:ZmSetting.T_CONFIG,dataType:ZmSetting.D_INT,defaultValue:500}
+);
+this.registerSetting("INSTANT_NOTIFY_TIMEOUT",{
+type:ZmSetting.T_CONFIG,dataType:ZmSetting.D_INT,defaultValue:300}
+);
+this.registerSetting("LOG_REQUEST",{
+type:ZmSetting.T_CONFIG,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("LOGO_URI",{
+type:ZmSetting.T_CONFIG,defaultValue:null}
+);
+this.registerSetting("PROTOCOL_MODE",{
+type:ZmSetting.T_CONFIG,defaultValue:ZmSetting.PROTO_HTTP}
+);
+this.registerSetting("SERVER_VERSION",{
+type:ZmSetting.T_CONFIG}
+);
+this.registerSetting("TIMEOUT",{
+type:ZmSetting.T_CONFIG,dataType:ZmSetting.D_INT,defaultValue:30}
+);
+this.registerSetting("USE_XML",{
+type:ZmSetting.T_CONFIG,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("CHANGE_PASSWORD_URL",{
+type:ZmSetting.T_CONFIG}
+);
+this.registerSetting("PUBLIC_URL",{
+type:ZmSetting.T_CONFIG}
+);
+this.registerSetting("ASSISTANT_ENABLED",{
+name:"zimbraFeatureZimbraAssistantEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("BRIEFCASE_ENABLED",{
+name:"zimbraFeatureBriefcasesEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("CALENDAR_ENABLED",{
+name:"zimbraFeatureCalendarEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("CALENDAR_UPSELL_ENABLED",{
+name:"zimbraFeatureCalendarUpsellEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("CALENDAR_UPSELL_URL",{
+name:"zimbraFeatureCalendarUpsellURL",type:ZmSetting.T_COS}
+);
+this.registerSetting("CONTACTS_ENABLED",{
+name:"zimbraFeatureContactsEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("CONTACTS_UPSELL_ENABLED",{
+name:"zimbraFeatureContactsUpsellEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("CONTACTS_UPSELL_URL",{
+name:"zimbraFeatureContactsUpsellURL",type:ZmSetting.T_COS}
+);
+this.registerSetting("IM_ENABLED",{
+name:"zimbraFeatureIMEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("IMPORT_EXPORT_ENABLED",{
+name:"zimbraFeatureImportExportFolderEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("MAIL_ENABLED",{
+name:"zimbraFeatureMailEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("MAIL_UPSELL_ENABLED",{
+name:"zimbraFeatureMailUpsellEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("MAIL_UPSELL_URL",{
+name:"zimbraFeatureMailUpsellURL",type:ZmSetting.T_COS}
+);
+this.registerSetting("NOTEBOOK_ENABLED",{
+name:"zimbraFeatureNotebookEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("OPTIONS_ENABLED",{
+name:"zimbraFeatureOptionsEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("PORTAL_ENABLED",{
+name:"zimbraFeaturePortalEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("TASKS_ENABLED",{
+name:"zimbraFeatureTasksEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("VOICE_ENABLED",{
+name:"zimbraFeatureVoiceEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("VOICE_UPSELL_ENABLED",{
+name:"zimbraFeatureVoiceUpsellEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("VOICE_UPSELL_URL",{
+name:"zimbraFeatureVoiceUpsellURL",type:ZmSetting.T_COS}
+);
+this.registerSetting("ATTACHMENTS_BLOCKED",{
+name:"zimbraAttachmentsBlocked",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("AVAILABLE_SKINS",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_LIST,isGlobal:true}
+);
+this.registerSetting("AVAILABLE_CSVFORMATS",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_LIST,isGlobal:true}
+);
+this.registerSetting("BROWSE_ENABLED",{
+name:"zimbraFeatureAdvancedSearchEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("CHANGE_PASSWORD_ENABLED",{
+name:"zimbraFeatureChangePasswordEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("DISPLAY_NAME",{
+name:"displayName",type:ZmSetting.T_COS}
+);
+this.registerSetting("FLAGGING_ENABLED",{
+name:"zimbraFeatureFlaggingEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("FOLDER_TREE_OPEN",{
+name:"zimbraPrefFolderTreeOpen",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true,isImplicit:true}
+);
+this.registerSetting("GAL_AUTOCOMPLETE_ENABLED",{
+name:"zimbraFeatureGalAutoCompleteEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("GAL_ENABLED",{
+name:"zimbraFeatureGalEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("GROUP_CALENDAR_ENABLED",{
+name:"zimbraFeatureGroupCalendarEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("HTML_COMPOSE_ENABLED",{
+name:"zimbraFeatureHtmlComposeEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("IDLE_SESSION_TIMEOUT",{
+name:"zimbraMailIdleSessionTimeout",type:ZmSetting.T_COS,dataType:ZmSetting.D_LDAP_TIME,defaultValue:0}
+);
+this.registerSetting("IMAP_ACCOUNTS_ENABLED",{
+name:"zimbraFeatureImapDataSourceEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("INSTANT_NOTIFY",{
+name:"zimbraFeatureInstantNotify",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("LOCALE_CHANGE_ENABLED",{
+name:"zimbraFeatureLocaleChangeEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("LOCALES",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_LIST}
+);
+this.registerSetting("LOGIN_URL",{
+name:"zimbraWebClientLoginURL",type:ZmSetting.T_COS}
+);
+this.registerSetting("LOGOUT_URL",{
+name:"zimbraWebClientLogoutURL",type:ZmSetting.T_COS}
+);
+this.registerSetting("MIN_POLLING_INTERVAL",{
+name:"zimbraMailMinPollingInterval",type:ZmSetting.T_COS,dataType:ZmSetting.D_LDAP_TIME,defaultValue:120}
+);
+this.registerSetting("MOBILE_SYNC_ENABLED",{
+name:"zimbraFeatureMobileSyncEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("MOBILE_POLICY_ENABLED",{
+name:"zimbraFeatureMobilePolicyEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("POP_ACCOUNTS_ENABLED",{
+name:"zimbraFeaturePop3DataSourceEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("PORTAL_NAME",{
+name:"zimbraPortalName",type:ZmSetting.T_COS,defaultValue:"example"}
+);
+this.registerSetting("PWD_MAX_LENGTH",{
+name:"zimbraPasswordMaxLength",type:ZmSetting.T_COS,dataType:ZmSetting.D_INT,defaultValue:64}
+);
+this.registerSetting("PWD_MIN_LENGTH",{
+name:"zimbraPasswordMinLength",type:ZmSetting.T_COS,dataType:ZmSetting.D_INT,defaultValue:6}
+);
+this.registerSetting("QUOTA",{
+name:"zimbraMailQuota",type:ZmSetting.T_COS,dataType:ZmSetting.D_INT,defaultValue:0}
+);
+this.registerSetting("SAVED_SEARCHES_ENABLED",{
+name:"zimbraFeatureSavedSearchesEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("SEARCH_TREE_OPEN",{
+name:"zimbraPrefSearchTreeOpen",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true,isImplicit:true}
+);
+this.registerSetting("SHARING_ENABLED",{
+name:"zimbraFeatureSharingEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("SHORTCUT_ALIASES_ENABLED",{
+name:"zimbraFeatureShortcutAliasesEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("SHOW_OFFLINE_LINK",{
+name:"zimbraWebClientShowOfflineLink",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("SIGNATURES_ENABLED",{
+name:"zimbraFeatureSignaturesEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("SKIN_CHANGE_ENABLED",{
+name:"zimbraFeatureSkinChangeEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("TAG_TREE_OPEN",{
+name:"zimbraPrefTagTreeOpen",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true,isImplicit:true}
+);
+this.registerSetting("TAGGING_ENABLED",{
+name:"zimbraFeatureTaggingEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("VIEW_ATTACHMENT_AS_HTML",{
+name:"zimbraFeatureViewInHtmlEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("LICENSE_STATUS",{
+type:ZmSetting.T_COS,defaultValue:ZmSetting.LICENSE_GOOD}
+);
+this.registerSetting("QUOTA_USED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_INT}
+);
+this.registerSetting("TOKEN_LIFETIME",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_INT}
+);
+this.registerSetting("USERID",{
+name:"zimbraId",type:ZmSetting.T_COS}
+);
+this.registerSetting("USERNAME",{
+type:ZmSetting.T_COS}
+);
+this.registerSetting("CN",{
+name:"cn",type:ZmSetting.T_COS}
+);
+this.registerSetting("LAST_ACCESS",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_INT}
+);
+this.registerSetting("PREVIOUS_SESSION",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_INT}
+);
+this.registerSetting("RECENT_MESSAGES",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_INT}
+);
+this.registerSetting("REST_URL",{
+name:"rest",type:ZmSetting.T_COS}
+);
+this.registerSetting("IS_ADMIN",{
+name:"zimbraIsAdminAccount",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("IS_DELEGATED_ADMIN",{
+name:"zimbraIsDelegatedAdminAccount",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("ADMIN_REFERENCE",{
+name:"zimbraWebClientAdminReference",type:ZmSetting.T_COS,dataType:ZmSetting.D_STRING}
+);
+this.registerSetting("ATTACHMENT_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("ATT_VIEW_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("EVAL_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("FEED_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("HELP_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("HISTORY_SUPPORT_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("MIXED_VIEW_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("NOTES_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("PRINT_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("SEARCH_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("SHORTCUT_LIST_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("OFFLINE_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:appCtxt.isOffline}
+);
+this.registerSetting("SPELL_CHECK_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:!AjxEnv.isSafari||AjxEnv.isSafari3up||AjxEnv.isChrome}
+);
+this.registerSetting("ACCOUNTS",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_HASH}
+);
+this.registerSetting("ACCOUNT_TREE_OPEN",{
+name:"zimbraPrefAccountTreeOpen",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false,isImplicit:true}
+);
+this.registerSetting("CHILD_ACCTS_VISIBLE",{
+name:"zimbraPrefChildVisibleAccount",type:ZmSetting.T_PREF,dataType:ZmSetting.D_LIST}
+);
+this.registerSetting("CLIENT_TYPE",{
+name:"zimbraPrefClientType",type:ZmSetting.T_PREF,defaultValue:ZmSetting.CLIENT_ADVANCED}
+);
+this.registerSetting("COMPOSE_AS_FORMAT",{
+name:"zimbraPrefComposeFormat",type:ZmSetting.T_PREF,defaultValue:ZmSetting.COMPOSE_TEXT}
+);
+this.registerSetting("COMPOSE_INIT_FONT_COLOR",{
+name:"zimbraPrefHtmlEditorDefaultFontColor",type:ZmSetting.T_PREF,defaultValue:ZmSetting.COMPOSE_FONT_COLOR}
+);
+this.registerSetting("COMPOSE_INIT_FONT_FAMILY",{
+name:"zimbraPrefHtmlEditorDefaultFontFamily",type:ZmSetting.T_PREF,defaultValue:ZmSetting.COMPOSE_FONT_FAM}
+);
+this.registerSetting("COMPOSE_INIT_FONT_SIZE",{
+name:"zimbraPrefHtmlEditorDefaultFontSize",type:ZmSetting.T_PREF,defaultValue:ZmSetting.COMPOSE_FONT_SIZE}
+);
+this.registerSetting("DEFAULT_TIMEZONE",{
+name:"zimbraPrefTimeZoneId",type:ZmSetting.T_PREF,dataType:ZmSetting.D_STRING,defaultValue:AjxTimezone.getServerId(AjxTimezone.DEFAULT),isGlobal:true}
+);
+this.registerSetting("FILTERS",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_HASH}
+);
+this.registerSetting("IDENTITIES",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_HASH}
+);
+this.registerSetting("INITIALLY_SEARCH_GAL",{
+name:"zimbraPrefGalSearchEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("LIST_VIEW_COLUMNS",{
+name:"zimbraPrefListViewColumns",type:ZmSetting.T_PREF,dataType:ZmSetting.D_HASH,isImplicit:true}
+);
+this.registerSetting("LOCALE_NAME",{
+name:"zimbraPrefLocale",type:ZmSetting.T_PREF,defaultValue:"en_US",isGlobal:true}
+);
+this.registerSetting("SHOW_SELECTION_CHECKBOX",{
+name:"zimbraPrefShowSelectionCheckbox",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true,isGlobal:true}
+);
+this.registerSetting("PAGE_SIZE",{
+type:ZmSetting.T_CONFIG,dataType:ZmSetting.D_INT,defaultValue:25}
+);
+this.registerSetting("PASSWORD",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_NONE}
+);
+this.registerSetting("POLLING_INTERVAL",{
+name:"zimbraPrefMailPollingInterval",type:ZmSetting.T_PREF,dataType:ZmSetting.D_LDAP_TIME,defaultValue:300}
+);
+this.registerSetting("POLLING_INTERVAL_ENABLED",{
+name:"zimbraFeatureMailPollingIntervalPreferenceEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("SEARCH_INCLUDES_SPAM",{
+name:"zimbraPrefIncludeSpamInSearch",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false,isGlobal:true}
+);
+this.registerSetting("SEARCH_INCLUDES_TRASH",{
+name:"zimbraPrefIncludeTrashInSearch",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false,isGlobal:true}
+);
+this.registerSetting("SHORTCUTS",{
+name:"zimbraPrefShortcuts",type:ZmSetting.T_PREF}
+);
+this.registerSetting("SHOW_SEARCH_STRING",{
+name:"zimbraPrefShowSearchString",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false,isGlobal:true}
+);
+this.registerSetting("SIGNATURES",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_HASH}
+);
+this.registerSetting("SIGNATURES_MAX",{
+name:"zimbraSignatureMaxNumEntries",type:ZmSetting.T_COS,dataType:ZmSetting.D_INT,defaultValue:20}
+);
+this.registerSetting("SIGNATURES_MIN",{
+name:"zimbraSignatureMinNumEntries",type:ZmSetting.T_COS,dataType:ZmSetting.D_INT,defaultValue:1}
+);
+this.registerSetting("SKIN_NAME",{
+name:"zimbraPrefSkin",type:ZmSetting.T_PREF,defaultValue:"skin",isGlobal:true}
+);
+this.registerSetting("SORTING_PREF",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_HASH}
+);
+this.registerSetting("USE_KEYBOARD_SHORTCUTS",{
+name:"zimbraPrefUseKeyboardShortcuts",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("VIEW_AS_HTML",{
+name:"zimbraPrefMessageViewHtmlPreferred",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false,isGlobal:true}
+);
+this.registerSetting("VOICE_ACCOUNTS",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_HASH}
+);
+this.registerSetting("WARN_ON_EXIT",{
+name:"zimbraPrefWarnOnExit",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this._registerOfflineSettings();
+this._registerZimletsSettings();
+this.registerSetting("ZIMLET_TREE_OPEN",{
+name:"zimbraPrefZimletTreeOpen",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false,isImplicit:true}
+)
+};
+ZmSettings.prototype._registerZimletsSettings=function(){
+this.registerSetting("CHECKED_ZIMLETS",{
+name:"zimbraPrefZimlets",type:ZmSetting.T_PREF,dataType:ZmSetting.D_LIST,isGlobal:true}
+)
+};
+ZmSettings.prototype._registerOfflineSettings=function(){
+if(!appCtxt.isOffline){
+return
+}
+this.registerSetting("OFFLINE_ACCOUNT_FLAVOR",{
+name:"offlineAccountFlavor",type:ZmSetting.T_PREF,dataType:ZmSetting.D_STRING}
+);
+this.registerSetting("OFFLINE_COMPOSE_ENABLED",{
+type:ZmSetting.T_CONFIG,dataType:ZmSetting.D_BOOLEAN,defaultValue:false,isGlobal:true}
+);
+this.registerSetting("OFFLINE_DEBUG_TRACE",{
+type:ZmSetting.T_CONFIG,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+this.registerSetting("OFFLINE_IS_MAILTO_HANDLER",{
+name:"zimbraPrefMailtoHandlerEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false,isGlobal:true}
+);
+this.registerSetting("OFFLINE_REMOTE_SERVER_URI",{
+name:"offlineRemoteServerUri",type:ZmSetting.T_PREF,dataType:ZmSetting.D_STRING}
+);
+this.registerSetting("OFFLINE_REPORT_EMAIL",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_STRING,defaultValue:"zdesktop-report@zimbra.com",isGlobal:true}
+);
+this.registerSetting("OFFLINE_SHOW_GLOBAL_INBOX",{
+name:"offlineShowGlobalInbox",type:ZmSetting.T_METADATA,dataType:ZmSetting.D_BOOLEAN,defaultValue:true,section:ZmSetting.M_OFFLINE,isGlobal:true}
+);
+this.registerSetting("OFFLINE_SMTP_ENABLED",{
+name:"zimbraDataSourceSmtpEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+this.registerSetting("OFFLINE_SUPPORTS_MAILTO",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false,isGlobal:true}
+);
+this.registerSetting("OFFLINE_SUPPORTS_DOCK_UPDATE",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false,isGlobal:true}
+);
+this.registerSetting("OFFLINE_WEBAPP_URI",{
+name:"offlineWebappUri",type:ZmSetting.T_PREF,dataType:ZmSetting.D_STRING}
+);
+this.registerSetting("HELP_URI",{
+type:ZmSetting.T_CONFIG,defaultValue:"http://www.zimbra.com/desktop/"}
+)
+};
+ZmSettings.prototype._changeListener=function(e){
+if(e.type!=ZmEvent.S_SETTING){
+return
+}
+var o=e.source.id;
+if(o==ZmSetting.QUOTA_USED){
+appCtxt.getAppController().setUserInfo()
+}else{
+if(o==ZmSetting.POLLING_INTERVAL){
+appCtxt.getAppController().setPollInterval()
+}else{
+if(o==ZmSetting.SKIN_NAME){
+var a=appCtxt.getYesNoMsgDialog();
+a.reset();
+var t=e.source.getValue();
+a.registerCallback(DwtDialog.YES_BUTTON,this._newSkinYesCallback,this,[t,a]);
+a.setMessage(ZmMsg.skinChangeRestart,DwtMessageDialog.WARNING_STYLE);
+a.popup()
+}else{
+if(o==ZmSetting.LOCALE_NAME){
+var a=appCtxt.getYesNoMsgDialog();
+a.reset();
+var t=e.source.getValue();
+a.registerCallback(DwtDialog.YES_BUTTON,this._refreshBrowserCallback,this,[a]);
+a.setMessage(ZmMsg.localeChangeRestart,DwtMessageDialog.WARNING_STYLE);
+a.popup()
+}else{
+if(o==ZmSetting.CHILD_ACCTS_VISIBLE){
+var a=appCtxt.getYesNoMsgDialog();
+a.reset();
+a.registerCallback(DwtDialog.YES_BUTTON,this._refreshBrowserCallback,this,[a]);
+a.setMessage(ZmMsg.accountChangeRestart,DwtMessageDialog.WARNING_STYLE);
+a.popup()
+}}}}}};
+ZmSettings.prototype._newSkinYesCallback=function(a,t){
+t.popdown();
+window.onbeforeunload=null;
+var e=AjxUtil.formatUrl({
+qsArgs:{
+skin:a}}
+);
+ZmZimbraMail.sendRedirect(e)
+};
+ZmSettings.prototype._refreshBrowserCallback=function(t){
+t.popdown();
+window.onbeforeunload=null;
+var e=AjxUtil.formatUrl({}
+);
+window.location.replace(e)
+}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmMetaData")){
+ZmMetaData=function(){};
+ZmMetaData.prototype.constructor=ZmMetaData;
+ZmMetaData.NAMESPACE="zwc";
+ZmMetaData.prototype.toString=function(){
+return"ZmMetaData"
+};
+ZmMetaData.prototype.set=function(r,l,h,e,c,o){
+var s=AjxSoapDoc.create("SetMailboxMetadataRequest","urn:zimbraMail");
+var d=s.set("meta");
+d.setAttribute("section",[ZmMetaData.NAMESPACE,r].join(":"));
+var n=s.set("a",h,d);
+n.setAttribute("n",l);
+if(e){
+e.addNewRequestParams(s,c,o)
+}else{
+var t={
+soapDoc:s,asyncMode:true,callback:c,errorCallback:o,accountName:(appCtxt.multiAccounts?appCtxt.accountList.mainAccount:null)};
+appCtxt.getAppController().sendRequest(t)
+}};
+ZmMetaData.prototype.get=function(l,e,c,o){
+if(!(l instanceof Array)){
+l=[l]
+}
+var s=appCtxt.multiAccounts?appCtxt.accountList.mainAccount:null;
+var t=e||(new ZmBatchCommand(null,s));
+for(var a=0;
+a<l.length;
+a++){
+var r=l[a];
+var n=AjxSoapDoc.create("GetMailboxMetadataRequest","urn:zimbraMail");
+var h=n.set("meta");
+h.setAttribute("section",[ZmMetaData.NAMESPACE,r].join(":"));
+t.addNewRequestParams(n)
+}
+if(!e){
+t.run(c,o)
+}}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmKeyMap")){
+ZmKeyMap=function(){
+ZmKeyMap._setPreconditions();
+DwtKeyMap.call(this);
+this._load(this._map,ZmKeys,ZmKeyMap.MAP_NAME);
+if(appCtxt.get(ZmSetting.DEV)){
+this._map.Global["Alt+Shift+D,0"]=ZmKeyMap.DBG_NONE;
+this._map.Global["Alt+Shift+D,1"]=ZmKeyMap.DBG_1;
+this._map.Global["Alt+Shift+D,2"]=ZmKeyMap.DBG_2;
+this._map.Global["Alt+Shift+D,3"]=ZmKeyMap.DBG_3;
+this._map.Global["Alt+Shift+D,T"]=ZmKeyMap.DBG_TIMING
+}};
+ZmKeyMap.prototype=new DwtKeyMap(true);
+ZmKeyMap.prototype.constructor=ZmKeyMap;
+ZmKeyMap.MAP_NAME={};
+ZmKeyMap.MAP_NAME.briefcase="ZmBriefcaseController";
+ZmKeyMap.MAP_NAME.calendar="ZmCalViewController";
+ZmKeyMap.MAP_NAME.call="ZmCallListController";
+ZmKeyMap.MAP_NAME.compose="ZmComposeController";
+ZmKeyMap.MAP_NAME.contacts="ZmContactListController";
+ZmKeyMap.MAP_NAME.conversation="ZmConvController";
+ZmKeyMap.MAP_NAME.conversationList="ZmConvListController";
+ZmKeyMap.MAP_NAME.editAppointment="ZmApptComposeController";
+ZmKeyMap.MAP_NAME.editContact="ZmContactController";
+ZmKeyMap.MAP_NAME.editPage="ZmPageEditController";
+ZmKeyMap.MAP_NAME.editTask="ZmTaskController";
+ZmKeyMap.MAP_NAME.global="Global";
+ZmKeyMap.MAP_NAME.mail="ZmMailListController";
+ZmKeyMap.MAP_NAME.message="ZmMsgController";
+ZmKeyMap.MAP_NAME.mixed="ZmMixedController";
+ZmKeyMap.MAP_NAME.notebook="ZmNotebookPageController";
+ZmKeyMap.MAP_NAME.options="ZmPrefController";
+ZmKeyMap.MAP_NAME.tasks="ZmTaskListController";
+ZmKeyMap.MAP_NAME.voicemail="ZmVoicemailListController";
+ZmKeyMap.MAP_NAME_R={};
+(function(){
+for(var e in ZmKeyMap.MAP_NAME){
+ZmKeyMap.MAP_NAME_R[ZmKeyMap.MAP_NAME[e]]=e
+}}
+)();
+ZmKeyMap.ADDRESS_PICKER="AddressPicker";
+ZmKeyMap.ASSISTANT="Assistant";
+ZmKeyMap.ATTACHMENT="Attachment";
+ZmKeyMap.CAL_DAY_VIEW="DayView";
+ZmKeyMap.CAL_LIST_VIEW="CalListView";
+ZmKeyMap.CAL_MONTH_VIEW="MonthView";
+ZmKeyMap.CAL_SCHEDULE_VIEW="ScheduleView";
+ZmKeyMap.CAL_WEEK_VIEW="WeekView";
+ZmKeyMap.CAL_WORK_WEEK_VIEW="WorkWeekView";
+ZmKeyMap.CALL_MANAGER="CallManager";
+ZmKeyMap.CANCEL="Cancel";
+ZmKeyMap.COLLAPSE_ALL="CollapseAll";
+ZmKeyMap.DBG_NONE="DebugNone";
+ZmKeyMap.DBG_1="DebugLevel1";
+ZmKeyMap.DBG_2="DebugLevel2";
+ZmKeyMap.DBG_3="DebugLevel3";
+ZmKeyMap.DBG_TIMING="ToggleDebugTiming";
+ZmKeyMap.DEL="Delete";
+ZmKeyMap.DOWNLOAD="Download";
+ZmKeyMap.EDIT="Edit";
+ZmKeyMap.EXPAND="Expand";
+ZmKeyMap.EXPAND_ALL="ExpandAll";
+ZmKeyMap.FIRST_UNREAD="FirstUnread";
+ZmKeyMap.FIRST_UNREAD_MSG="FirstUnreadMsg";
+ZmKeyMap.FLAG="Flag";
+ZmKeyMap.FOCUS_CONTENT_PANE="FocusContentPane";
+ZmKeyMap.FOCUS_SEARCH_BOX="FocusSearchBox";
+ZmKeyMap.FOCUS_TOOLBAR="FocusToolbar";
+ZmKeyMap.FORWARD="Forward";
+ZmKeyMap.GET_MAIL="GetMail";
+ZmKeyMap.GOTO_BRIEFCASE="GoToBriefcase";
+ZmKeyMap.GOTO_CALENDAR="GoToCalendar";
+ZmKeyMap.GOTO_CONTACTS="GoToContacts";
+ZmKeyMap.GOTO_DRAFTS="GoToDrafts";
+ZmKeyMap.GOTO_JUNK="GoToJunk";
+ZmKeyMap.GOTO_INBOX="GoToInbox";
+ZmKeyMap.GOTO_MAIL="GoToMail";
+ZmKeyMap.GOTO_NOTEBOOK="GoToNotebook";
+ZmKeyMap.GOTO_OPTIONS="GoToOptions";
+ZmKeyMap.GOTO_SENT="GoToSent";
+ZmKeyMap.GOTO_TASKS="GoToTasks";
+ZmKeyMap.GOTO_TRASH="GoToTrash";
+ZmKeyMap.GOTO_VOICE="GoToVoice";
+ZmKeyMap.HTML_FORMAT="HtmlFormat";
+ZmKeyMap.LAST_UNREAD="LastUnread";
+ZmKeyMap.LAST_UNREAD_MSG="LastUnreadMsg";
+ZmKeyMap.LOGOFF="LogOff";
+ZmKeyMap.MARK_COMPLETE="MarkComplete";
+ZmKeyMap.MARK_HEARD="MarkHeard";
+ZmKeyMap.MARK_READ="MarkRead";
+ZmKeyMap.MARK_UNCOMPLETE="MarkUncomplete";
+ZmKeyMap.MARK_UNHEARD="MarkUnheard";
+ZmKeyMap.MARK_UNREAD="MarkUnread";
+ZmKeyMap.MOVE="Move";
+ZmKeyMap.MOVE_TO_INBOX="MoveToInbox";
+ZmKeyMap.MOVE_TO_JUNK="MoveToJunk";
+ZmKeyMap.MOVE_TO_TRASH="MoveToTrash";
+ZmKeyMap.NEW="New";
+ZmKeyMap.NEW_APPT="NewAppointment";
+ZmKeyMap.NEW_BRIEFCASEITEM="NewBriefcase";
+ZmKeyMap.NEW_CALENDAR="NewCalendar";
+ZmKeyMap.NEW_CHAT="NewChat";
+ZmKeyMap.NEW_CONTACT="NewContact";
+ZmKeyMap.NEW_DOC="NewDocument";
+ZmKeyMap.NEW_FILE="NewFile";
+ZmKeyMap.NEW_FOLDER="NewFolder";
+ZmKeyMap.NEW_MESSAGE="NewMessage";
+ZmKeyMap.NEW_MESSAGE_WIN="NewMessageWindow";
+ZmKeyMap.NEW_NOTEBOOK="NewNotebook";
+ZmKeyMap.NEW_PAGE="NewPage";
+ZmKeyMap.NEW_PRESENTATION="NewPresentation";
+ZmKeyMap.NEW_ROSTER_ITEM="NewRosterItem";
+ZmKeyMap.NEW_SPREADSHEET="NewSpreadsheet";
+ZmKeyMap.NEW_TAG="NewTag";
+ZmKeyMap.NEW_TASK="NewTask";
+ZmKeyMap.NEW_WINDOW="NewWindow";
+ZmKeyMap.NEXT_CONV="NextConversation";
+ZmKeyMap.NEXT_PAGE="NextPage";
+ZmKeyMap.NEXT_UNREAD="NextUnread";
+ZmKeyMap.NEXT_UNREAD_MSG="NextUnreadMsg";
+ZmKeyMap.PLAY="Play";
+ZmKeyMap.PRESENCE_MENU="PresenceMenu";
+ZmKeyMap.PREV_CONV="PreviousConversation";
+ZmKeyMap.PREV_PAGE="PreviousPage";
+ZmKeyMap.PREV_UNREAD="PreviousUnread";
+ZmKeyMap.PREV_UNREAD_MSG="PreviousUnreadMsg";
+ZmKeyMap.PRINT="Print";
+ZmKeyMap.PRINT_ALL="PrintAll";
+ZmKeyMap.QUICK_ADD="QuickAdd";
+ZmKeyMap.READING_PANE_BOTTOM="ReadingPaneAtBottom";
+ZmKeyMap.READING_PANE_OFF="ReadingPaneOff";
+ZmKeyMap.READING_PANE_RIGHT="ReadingPaneOnRight";
+ZmKeyMap.REFRESH="Refresh";
+ZmKeyMap.REPLY="Reply";
+ZmKeyMap.REPLY_ALL="ReplyAll";
+ZmKeyMap.SAVE="Save";
+ZmKeyMap.SAVED_SEARCH="SavedSearch";
+ZmKeyMap.SELECT_ALL="SelectAll";
+ZmKeyMap.SEND="Send";
+ZmKeyMap.SHORTCUTS="Shortcuts";
+ZmKeyMap.SHOW_FRAGMENT="ShowFragment";
+ZmKeyMap.SPAM="Spam";
+ZmKeyMap.SPELLCHECK="Spellcheck";
+ZmKeyMap.TAG="Tag";
+ZmKeyMap.TODAY="Today";
+ZmKeyMap.UNTAG="Untag";
+ZmKeyMap.VIEW_BY_CONV="ViewByConversation";
+ZmKeyMap.VIEW_BY_MSG="ViewByMessage";
+ZmKeyMap.VISIT="Visit";
+ZmKeyMap.VISIT_TAG="VisitTag";
+ZmKeyMap.ENTITY={};
+ZmKeyMap.ENTITY[DwtKeyMap.ARROW_LEFT]="&larr;";
+ZmKeyMap.ENTITY[DwtKeyMap.ARROW_RIGHT]="&rarr;";
+ZmKeyMap.ENTITY[DwtKeyMap.ARROW_UP]="&uarr;";
+ZmKeyMap.ENTITY[DwtKeyMap.ARROW_DOWN]="&darr;";
+ZmKeyMap.ENTITY['"']="&quot;";
+ZmKeyMap.ENTITY["&"]="&amp;";
+ZmKeyMap.ENTITY["<"]="&lt;";
+ZmKeyMap.ENTITY[">"]="&gt;";
+ZmKeyMap.ENTITY[DwtKeyMap.COMMA]=",";
+ZmKeyMap.ENTITY[DwtKeyMap.SEMICOLON]=";";
+ZmKeyMap.ENTITY[DwtKeyMap.BACKSLASH]="\\";
+ZmKeyMap.MAP_PRECONDITION={};
+ZmKeyMap.ACTION_PRECONDITION={};
+ZmKeyMap._setPreconditions=function(){
+ZmKeyMap.MAP_PRECONDITION.ZmComposeController=ZmSetting.MAIL_ENABLED;
+ZmKeyMap.MAP_PRECONDITION.ZmMailListController=ZmSetting.MAIL_ENABLED;
+ZmKeyMap.MAP_PRECONDITION.ZmConvListController=ZmSetting.MAIL_ENABLED;
+ZmKeyMap.MAP_PRECONDITION.ZmConvController=ZmSetting.MAIL_ENABLED;
+ZmKeyMap.MAP_PRECONDITION.ZmMsgController=ZmSetting.MAIL_ENABLED;
+ZmKeyMap.MAP_PRECONDITION.ZmContactListController=ZmSetting.CONTACTS_ENABLED;
+ZmKeyMap.MAP_PRECONDITION.ZmContactController=ZmSetting.CONTACTS_ENABLED;
+ZmKeyMap.MAP_PRECONDITION.ZmCalViewController=ZmSetting.CALENDAR_ENABLED;
+ZmKeyMap.MAP_PRECONDITION.ZmApptComposeController=ZmSetting.CALENDAR_ENABLED;
+ZmKeyMap.MAP_PRECONDITION.ZmMixedController=ZmSetting.MIXED_VIEW_ENABLED;
+ZmKeyMap.MAP_PRECONDITION.ZmPrefController=ZmSetting.OPTIONS_ENABLED;
+ZmKeyMap.MAP_PRECONDITION.ZmNotebookPageController=ZmSetting.NOTEBOOK_ENABLED;
+ZmKeyMap.MAP_PRECONDITION.ZmBriefcaseController=ZmSetting.BRIEFCASE_ENABLED;
+ZmKeyMap.MAP_PRECONDITION.ZmTaskListController=ZmSetting.TASKS_ENABLED;
+ZmKeyMap.MAP_PRECONDITION.ZmTaskController=ZmSetting.TASKS_ENABLED;
+ZmKeyMap.MAP_PRECONDITION.ZmVoicemailListController=ZmSetting.VOICE_ENABLED;
+ZmKeyMap.MAP_PRECONDITION.ZmCallListController=ZmSetting.VOICE_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global={};
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.FOCUS_SEARCH_BOX]=ZmSetting.SEARCH_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.GOTO_BRIEFCASE]=ZmSetting.BRIEFCASE_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.GOTO_CALENDAR]=ZmSetting.CALENDAR_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.GOTO_CONTACTS]=ZmSetting.CONTACTS_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.GOTO_MAIL]=ZmSetting.MAIL_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.GOTO_NOTEBOOK]=ZmSetting.NOTEBOOK_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.GOTO_OPTIONS]=ZmSetting.OPTIONS_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.GOTO_TASKS]=ZmSetting.TASKS_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.GOTO_VOICE]=ZmSetting.VOICE_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.NEW_APPT]=ZmSetting.CALENDAR_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.NEW_BRIEFCASEITEM]=ZmSetting.BRIEFCASE_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.NEW_CALENDAR]=ZmSetting.CALENDAR_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.NEW_CHAT]=ZmSetting.IM_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.NEW_CONTACT]=ZmSetting.CONTACTS_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.NEW_FILE]=ZmSetting.BRIEFCASE_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.NEW_DOC]=ZmSetting.DOCS_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.NEW_FOLDER]=ZmSetting.MAIL_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.NEW_MESSAGE]=ZmSetting.MAIL_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.NEW_MESSAGE_WIN]=ZmSetting.MAIL_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.NEW_NOTEBOOK]=ZmSetting.NOTEBOOK_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.NEW_PAGE]=ZmSetting.NOTEBOOK_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.NEW_ROSTER_ITEM]=ZmSetting.IM_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.NEW_TAG]=ZmSetting.TAGGING_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.NEW_TASK]=ZmSetting.TASKS_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.PRESENCE_MENU]=ZmSetting.IM_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.SAVED_SEARCH]=ZmSetting.SAVED_SEARCHES_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.TAG]=ZmSetting.TAGGING_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.Global[ZmKeyMap.UNTAG]=ZmSetting.TAGGING_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.ZmComposeController={};
+ZmKeyMap.ACTION_PRECONDITION.ZmComposeController[ZmKeyMap.ADDRESS_PICKER]=ZmSetting.CONTACTS_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.ZmComposeController[ZmKeyMap.HTML_FORMAT]=ZmSetting.HTML_COMPOSE_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.ZmComposeController[ZmKeyMap.NEW_WINDOW]=ZmSetting.NEW_WINDOW_COMPOSE;
+ZmKeyMap.ACTION_PRECONDITION.ZmComposeController[ZmKeyMap.SAVE]=ZmSetting.SAVE_DRAFT_ENABLED;
+ZmKeyMap.ACTION_PRECONDITION.ZmApptComposeController={};
+ZmKeyMap.ACTION_PRECONDITION.ZmApptComposeController[ZmKeyMap.HTML_FORMAT]=ZmSetting.HTML_COMPOSE_ENABLED
+};
+ZmKeyMap.prototype._checkMap=function(a){
+var t;
+var e=ZmKeyMap.MAP_PRECONDITION[a];
+if(!e){
+t=true
+}else{
+if(typeof e=="string"||typeof e=="number"){
+t=appCtxt.get(e)
+}else{
+if(typeof e=="function"){
+t=e()
+}}}
+this._checkedMap[a]=t;
+return t
+};
+ZmKeyMap.prototype._checkAction=function(t,a){
+if((this._checkedMap[t]===false)||(!this._checkedMap[t]&&!this._checkMap(t))){
+return false
+}
+var e=ZmKeyMap.ACTION_PRECONDITION[t];
+if(!e){
+return true
+}
+var o=e[a];
+if(!o){
+return true
+}
+if(typeof o=="string"||typeof o=="number"){
+return appCtxt.get(o)
+}else{
+if(typeof o=="function"){
+return o()
+}}
+return true
+}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmTimezone")){
+ZmTimezone=function(){};
+ZmTimezone.getDefault=function(){
+var t=DwtShell.getShell(window);
+var e=appCtxt.get(ZmSetting.DEFAULT_TIMEZONE);
+return(e)?AjxTimezone.getClientId(e):AjxTimezone.DEFAULT
+};
+ZmTimezone.getDefaultRule=function(){
+return AjxTimezone.getRule(ZmTimezone.getDefault())
+};
+ZmTimezone.set=function(n,t,e,o){
+var a=AjxTimezone.getRule(t);
+if(!a){
+return
+}
+if(a.autoDetected||!o){
+if(n instanceof AjxSoapDoc){
+ZmTimezone._setSoap(n,t,e,a)
+}else{
+ZmTimezone._setJson(n,t,a)
+}}};
+ZmTimezone._setSoap=function(f,r,d,u){
+var s=f.set("tz",null,d);
+var t=AjxTimezone.getServerId(r);
+s.setAttribute("id",t);
+if(u.autoDetected){
+s.setAttribute("stdoff",u.standard.offset);
+if(u.daylight){
+s.setAttribute("dayoff",u.daylight.offset);
+var m=["standard","daylight"];
+var e=["mon","mday","week","wkday","hour","min","sec"];
+for(var l=0;
+l<m.length;
+l++){
+var o=m[l];
+var c=u[o];
+var a=f.set(o,null,s);
+for(var h=0;
+h<e.length;
+h++){
+var n=e[h];
+if(n in c){
+a.setAttribute(n,c[n])
+}}}}}};
+ZmTimezone._setJson=function(h,s,d){
+var t=AjxTimezone.getServerId(s);
+var n=h.tz={
+id:t};
+if(d.autoDetected){
+n.stdoff=d.standard.offset;
+if(d.daylight){
+n.dayoff=d.daylight.offset;
+var u=["standard","daylight"];
+var e=["mon","mday","week","wkday","hour","min","sec"];
+for(var l=0;
+l<u.length;
+l++){
+var a=u[l];
+var c=d[a];
+n[a]={};
+for(var r=0;
+r<e.length;
+r++){
+var o=e[r];
+if(o in c){
+n[a][o]=c[o]
+}}}}}}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmItem")){
+ZmItem=function(a,n,o,e){
+if(arguments.length==0){
+return
+}
+ZmModel.call(this,a);
+this.type=a;
+this.id=n;
+this.list=o;
+this.tags=[];
+this.tagHash={};
+this.folderId=0;
+var t=(appCtxt.multiAccounts)?ZmOrganizer.parseId(n):null;
+this.account=t&&t.account;
+if(n&&!e){
+appCtxt.cacheSet(n,this)
+}};
+ZmItem.prototype=new ZmModel;
+ZmItem.prototype.constructor=ZmItem;
+ZmItem.APP={};
+ZmItem.MSG_KEY={};
+ZmItem.PLURAL_MSG_KEY={};
+ZmItem.ICON={};
+ZmItem.RESULTS_LIST={};
+ZmItem.F_ACCOUNT=ZmId.FLD_ACCOUNT;
+ZmItem.F_ATTACHMENT=ZmId.FLD_ATTACHMENT;
+ZmItem.F_CAPACITY=ZmId.FLD_CAPACITY;
+ZmItem.F_COMPANY=ZmId.FLD_COMPANY;
+ZmItem.F_DATE=ZmId.FLD_DATE;
+ZmItem.F_EMAIL=ZmId.FLD_EMAIL;
+ZmItem.F_EXPAND=ZmId.FLD_EXPAND;
+ZmItem.F_FILE_TYPE=ZmId.FLD_FILE_TYPE;
+ZmItem.F_FLAG=ZmId.FLD_FLAG;
+ZmItem.F_FOLDER=ZmId.FLD_FOLDER;
+ZmItem.F_FRAGMENT=ZmId.FLD_FRAGMENT;
+ZmItem.F_FROM=ZmId.FLD_FROM;
+ZmItem.F_HOME_PHONE=ZmId.FLD_HOME_PHONE;
+ZmItem.F_ID=ZmId.FLD_ID;
+ZmItem.F_INDEX=ZmId.FLD_INDEX;
+ZmItem.F_ITEM_ROW=ZmId.FLD_ITEM_ROW;
+ZmItem.F_ITEM_ROW_3PANE=ZmId.FLD_ITEM_ROW_3PANE;
+ZmItem.F_LOCATION=ZmId.FLD_LOCATION;
+ZmItem.F_NAME=ZmId.FLD_NAME;
+ZmItem.F_NOTES=ZmId.FLD_NOTES;
+ZmItem.F_PARTICIPANT=ZmId.FLD_PARTICIPANT;
+ZmItem.F_PCOMPLETE=ZmId.FLD_PCOMPLETE;
+ZmItem.F_PRIORITY=ZmId.FLD_PRIORITY;
+ZmItem.F_RECURRENCE=ZmId.FLD_RECURRENCE;
+ZmItem.F_SELECTION=ZmId.FLD_SELECTION;
+ZmItem.F_SELECTION_CELL=ZmId.FLD_SELECTION_CELL;
+ZmItem.F_SIZE=ZmId.FLD_SIZE;
+ZmItem.F_SORTED_BY=ZmId.FLD_SORTED_BY;
+ZmItem.F_STATUS=ZmId.FLD_STATUS;
+ZmItem.F_SUBJECT=ZmId.FLD_SUBJECT;
+ZmItem.F_TAG=ZmId.FLD_TAG;
+ZmItem.F_TAG_CELL=ZmId.FLD_TAG_CELL;
+ZmItem.F_TYPE=ZmId.FLD_TYPE;
+ZmItem.F_WORK_PHONE=ZmId.FLD_WORK_PHONE;
+ZmItem.SOAP_CMD={};
+ZmItem.TAGS_FIELD=1;
+ZmItem.FLAG_ATTACH="a";
+ZmItem.FLAG_FLAGGED="f";
+ZmItem.FLAG_FORWARDED="w";
+ZmItem.FLAG_ISDRAFT="d";
+ZmItem.FLAG_ISSENT="s";
+ZmItem.FLAG_READ_RECEIPT_SENT="n";
+ZmItem.FLAG_REPLIED="r";
+ZmItem.FLAG_UNREAD="u";
+ZmItem.FLAG_LOW_PRIORITY="?";
+ZmItem.FLAG_HIGH_PRIORITY="!";
+ZmItem.ALL_FLAGS=[ZmItem.FLAG_FLAGGED,ZmItem.FLAG_ATTACH,ZmItem.FLAG_UNREAD,ZmItem.FLAG_REPLIED,ZmItem.FLAG_FORWARDED,ZmItem.FLAG_ISSENT,ZmItem.FLAG_READ_RECEIPT_SENT,ZmItem.FLAG_ISDRAFT,ZmItem.FLAG_HIGH_PRIORITY,ZmItem.FLAG_LOW_PRIORITY];
+ZmItem.FLAG_PROP={};
+ZmItem.FLAG_PROP[ZmItem.FLAG_ATTACH]="hasAttach";
+ZmItem.FLAG_PROP[ZmItem.FLAG_FLAGGED]="isFlagged";
+ZmItem.FLAG_PROP[ZmItem.FLAG_FORWARDED]="isForwarded";
+ZmItem.FLAG_PROP[ZmItem.FLAG_ISDRAFT]="isDraft";
+ZmItem.FLAG_PROP[ZmItem.FLAG_ISSENT]="isSent";
+ZmItem.FLAG_PROP[ZmItem.FLAG_READ_RECEIPT_SENT]="readReceiptSent";
+ZmItem.FLAG_PROP[ZmItem.FLAG_REPLIED]="isReplied";
+ZmItem.FLAG_PROP[ZmItem.FLAG_UNREAD]="isUnread";
+ZmItem.FLAG_PROP[ZmItem.FLAG_LOW_PRIORITY]="isLowPriority";
+ZmItem.FLAG_PROP[ZmItem.FLAG_HIGH_PRIORITY]="isHighPriority";
+ZmItem.DND_ACTION_MOVE=1<<0;
+ZmItem.DND_ACTION_COPY=1<<1;
+ZmItem.DND_ACTION_BOTH=ZmItem.DND_ACTION_MOVE|ZmItem.DND_ACTION_COPY;
+ZmItem.NOTES_SEPARATOR="*~*~*~*~*~*~*~*~*~*";
+ZmItem.registerItem=function(e,t){
+if(t.app){
+ZmItem.APP[e]=t.app
+}
+if(t.nameKey){
+ZmItem.MSG_KEY[e]=t.nameKey
+}
+if(t.pluralNameKey){
+ZmItem.PLURAL_MSG_KEY[e]=t.pluralNameKey
+}
+if(t.icon){
+ZmItem.ICON[e]=t.icon
+}
+if(t.soapCmd){
+ZmItem.SOAP_CMD[e]=t.soapCmd
+}
+if(t.itemClass){
+ZmList.ITEM_CLASS[e]=t.itemClass
+}
+if(t.node){
+ZmList.NODE[e]=t.node
+}
+if(t.organizer){
+ZmOrganizer.ITEM_ORGANIZER[e]=t.organizer
+}
+if(t.searchType){
+ZmSearch.TYPE[e]=t.searchType
+}
+if(t.resultsList){
+ZmItem.RESULTS_LIST[e]=t.resultsList
+}
+if(t.node){
+ZmList.ITEM_TYPE[t.node]=e
+}
+if(t.dropTargets){
+if(!ZmApp.DROP_TARGETS[t.app]){
+ZmApp.DROP_TARGETS[t.app]={}
+}
+ZmApp.DROP_TARGETS[t.app][e]=t.dropTargets
+}};
+ZmItem.getItemId=function(t){
+if(!t){
+return t
+}
+if(!ZmItem.SHORT_ID_RE){
+var e=DwtShell.getShell(window);
+ZmItem.SHORT_ID_RE=new RegExp(appCtxt.get(ZmSetting.USERID)+":","gi")
+}
+return t.replace(ZmItem.SHORT_ID_RE,"")
+};
+ZmItem.prototype.create=function(e){};
+ZmItem.prototype.modify=function(e){};
+ZmItem.prototype.getById=function(e){
+if(e==this.id){
+return this
+}};
+ZmItem.prototype.clear=function(){
+this._evtMgr.removeAll(ZmEvent.L_MODIFY);
+if(this.tags.length){
+for(var e=0;
+e<this.tags.length;
+e++){
+this.tags[e]=null
+}
+this.tags=[]
+}
+for(var e in this.tagHash){
+this.tagHash[e]=null
+}
+this.tagHash={}
+};
+ZmItem.prototype.cache=function(){
+if(this.id){
+appCtxt.cacheSet(this.id,this);
+return true
+}
+return false
+};
+ZmItem.prototype.hasTag=function(e){
+return(this.tagHash[e]==true)
+};
+ZmItem.prototype.getFolderId=function(){
+return this.folderId
+};
+ZmItem.prototype.getUrl=function(){
+return this.getRestUrl()
+};
+ZmItem.prototype.getRestUrl=function(){
+if(this.restUrl){
+return this.restUrl
+}
+var a=ZmOrganizer.ITEM_ORGANIZER[this.type];
+var e=appCtxt.getById(this.folderId);
+var t=e?([e.getRestUrl(),"/",AjxStringUtil.urlComponentEncode(this.name)].join("")):null;
+return t
+};
+ZmItem.prototype.getTagImageInfo=function(){
+var t;
+if(!this.tags.length||this.isShared()){
+t="Blank_16"
+}else{
+if(this.tags.length==1){
+var a=(this.account&&!this.account.isMain)?([this.account.id,this.tags[0]].join(":")):(ZmOrganizer.getSystemId(this.tags[0]));
+var e=appCtxt.getById(a);
+t=e?ZmTag.COLOR_ICON[e.color]:"Blank_16"
+}else{
+t="TagStack"
+}}
+return t
+};
+ZmItem.prototype.getDefaultDndAction=function(e){
+return(this.isReadOnly()||e)?ZmItem.DND_ACTION_COPY:ZmItem.DND_ACTION_MOVE
+};
+ZmItem.prototype.isReadOnly=function(){
+return false
+};
+ZmItem.prototype.isShared=function(){
+if(this._isShared==null){
+if(this.id==-1){
+this._isShared=false
+}else{
+var t=appCtxt.getActiveAccount();
+var e=String(this.id);
+this._isShared=((e.indexOf(":")!=-1)&&(e.indexOf(t.id)!=0))
+}}
+return this._isShared
+};
+ZmItem.prototype.notifyDelete=function(){
+this.deleteLocal();
+if(this.list){
+this.list.deleteLocal([this])
+}
+this._notify(ZmEvent.E_DELETE)
+};
+ZmItem.prototype.notifyModify=function(r){
+if(r.t!=null){
+this._parseTags(r.t);
+this._notify(ZmEvent.E_TAGS)
+}
+if(r.f!=null){
+var a=this._getFlags();
+var s={};
+for(var n=0;
+n<a.length;
+n++){
+s[a[n]]=this[ZmItem.FLAG_PROP[a[n]]]
+}
+this._parseFlags(r.f);
+var t=[];
+for(var n=0;
+n<a.length;
+n++){
+var e=this[ZmItem.FLAG_PROP[a[n]]];
+if(s[a[n]]!=e){
+t.push(a[n])
+}}
+if(t.length){
+this._notify(ZmEvent.E_FLAGS,{
+flags:t}
+)
+}}
+if(r.l!=null&&r.l!=this.folderId){
+var o={
+oldFolderId:this.folderId};
+this.moveLocal(r.l);
+if(this.list){
+this.list.moveLocal([this],r.l)
+}
+this._notify(ZmEvent.E_MOVE,o)
+}};
+ZmItem.prototype.flagLocal=function(t,e){
+this[ZmItem.FLAG_PROP[t]]=e
+};
+ZmItem.prototype.setFlag=function(a,t){
+this.flagLocal(a,t);
+var e=this.flags||"";
+if(t&&e.indexOf(a)==-1){
+e=e+a
+}else{
+if(!t&&e.indexOf(a)!=-1){
+e=e.replace(a,"")
+}}
+this.flags=e;
+return e
+};
+ZmItem.prototype.tagLocal=function(a,o){
+var t=false;
+if(o){
+if(!this.tagHash[a]){
+t=true;
+this.tags.push(a);
+this.tagHash[a]=true
+}}else{
+for(var e=0;
+e<this.tags.length;
+e++){
+if(this.tags[e]==a){
+this.tags.splice(e,1);
+delete this.tagHash[a];
+t=true;
+break
+}}}
+return t
+};
+ZmItem.prototype.removeAllTagsLocal=function(){
+this.tags=[];
+for(var e in this.tagHash){
+delete this.tagHash[e]
+}};
+ZmItem.prototype.deleteLocal=function(){};
+ZmItem.prototype.move=function(e,a,t){
+return ZmItem.move(this.id,e,a,t)
+};
+ZmItem.move=function(n,e,s,t){
+var a={
+ItemActionRequest:{
+_jsns:"urn:zimbraMail",action:{
+id:n instanceof Array?n.join():n,op:"move",l:e}}};
+var o={
+jsonObj:a,asyncMode:Boolean(s),callback:s,errorCallback:t};
+return appCtxt.getAppController().sendRequest(o)
+};
+ZmItem.prototype.moveLocal=function(e){
+this.folderId=e
+};
+ZmItem.prototype._parseTags=function(o){
+this.tags=[];
+this.tagHash={};
+if(o&&o.length){
+var e=o.split(",");
+for(var t=0;
+t<e.length;
+t++){
+var a=Number(e[t]);
+if(a>=ZmOrganizer.FIRST_USER_ID[ZmOrganizer.TAG]){
+this.tagLocal(a,true)
+}}}};
+ZmItem.prototype._parseFlags=function(o){
+this.flags=o;
+for(var a=0;
+a<ZmItem.ALL_FLAGS.length;
+a++){
+var t=ZmItem.ALL_FLAGS[a];
+var e=(o&&(o.indexOf(t)!=-1))?true:false;
+this.flagLocal(t,e)
+}};
+ZmItem.prototype._notify=function(t,e){
+ZmModel.prototype._notify.call(this,t,e);
+if(this.list){
+if(e){
+e.items=[this]
+}else{
+e={
+items:[this]}
+}
+this.list._evt.item=this;
+this.list._notify(t,e)
+}};
+ZmItem.prototype._getFlags=function(){
+return[ZmItem.FLAG_FLAGGED,ZmItem.FLAG_ATTACH]
+}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmOrganizer")){
+ZmOrganizer=function(t){
+if(arguments.length==0){
+return
+}
+this.type=t.type;
+var a=this.id=t.id;
+this.nId=ZmOrganizer.normalizeId(a);
+this.name=ZmFolder.MSG_KEY[this.nId]?ZmMsg[ZmFolder.MSG_KEY[this.nId]]:t.name;
+this._systemName=this.nId<256&&t.name;
+this.parent=t.parent;
+this.tree=t.tree;
+this.numUnread=t.numUnread||0;
+this.numTotal=t.numTotal||0;
+this.sizeTotal=t.sizeTotal||0;
+this.url=t.url;
+this.owner=t.owner;
+this.link=t.link||(Boolean(t.zid))||(this.parent&&this.parent.link);
+this.isMountpoint=t.link;
+this.zid=t.zid;
+this.rid=t.rid;
+this.restUrl=t.restUrl;
+this.account=t.account;
+this.perm=t.perm;
+this.noSuchFolder=false;
+this._isAdmin=this._isReadOnly=this._hasPrivateAccess=null;
+var e=(this.parent&&!t.color)?this.parent.color:t.color;
+this.color=e||ZmOrganizer.ORG_COLOR[a]||ZmOrganizer.ORG_COLOR[this.nId]||ZmOrganizer.DEFAULT_COLOR[this.type]||ZmOrganizer.C_NONE;
+this.rgb=t.rgb||(this.color==ZmOrganizer.C_NONE&&this.parent&&this.parent.rgb);
+if(t.rgb=="#000000"){
+delete this.rgb
+}
+if(appCtxt.isOffline&&!this.account&&this.id==this.nId){
+this.account=appCtxt.accountList.mainAccount
+}
+this.disallowSubFolder=appCtxt.isOffline&&this.account&&this.account.type==ZmAccount.TYPE_POP;
+if(a&&t.tree){
+appCtxt.cacheSet(a,this);
+if(this.link){
+appCtxt.cacheSet([this.zid,this.rid].join(":"),this)
+}}
+this.children=new AjxVector()
+};
+ZmOrganizer.TAG=ZmEvent.S_TAG;
+ZmOrganizer.SEARCH=ZmEvent.S_SEARCH;
+ZmOrganizer.MOUNTPOINT=ZmEvent.S_MOUNTPOINT;
+ZmOrganizer.ZIMLET=ZmEvent.S_ZIMLET;
+ZmOrganizer.ID_ROOT=1;
+ZmOrganizer.ID_INBOX=2;
+ZmOrganizer.ID_TRASH=3;
+ZmOrganizer.ID_SPAM=4;
+ZmOrganizer.ID_ADDRBOOK=7;
+ZmOrganizer.ID_CALENDAR=10;
+ZmOrganizer.ID_NOTEBOOK=12;
+ZmOrganizer.ID_AUTO_ADDED=13;
+ZmOrganizer.ID_CHATS=14;
+ZmOrganizer.ID_TASKS=15;
+ZmOrganizer.ID_BRIEFCASE=16;
+ZmOrganizer.ID_GLOBAL_INBOX=249;
+ZmOrganizer.ID_NOTIFICATION_MP=250;
+ZmOrganizer.ID_SYNC_FAILURES=252;
+ZmOrganizer.ID_OUTBOX=254;
+ZmOrganizer.ID_ZIMLET=-1000;
+ZmOrganizer.ID_ROSTER_LIST=-11;
+ZmOrganizer.ID_ROSTER_TREE_ITEM=-13;
+ZmOrganizer.ID_MY_CARD=-15;
+ZmOrganizer.ID_ATTACHMENTS=-17;
+ZmOrganizer.F_NAME="name";
+ZmOrganizer.F_UNREAD="unread";
+ZmOrganizer.F_TOTAL="total";
+ZmOrganizer.F_SIZE="size";
+ZmOrganizer.F_COLOR="color";
+ZmOrganizer.F_RGB="rgb";
+ZmOrganizer.F_QUERY="query";
+ZmOrganizer.F_SHARES="shares";
+ZmOrganizer.F_FLAGS="flags";
+ZmOrganizer.F_REST_URL="rest";
+ZmOrganizer.F_PERMS="perms";
+ZmOrganizer.F_RNAME="rname";
+ZmOrganizer.FLAG_CHECKED="#";
+ZmOrganizer.FLAG_DISALLOW_SUBFOLDER="o";
+ZmOrganizer.FLAG_EXCLUDE_FREE_BUSY="b";
+ZmOrganizer.FLAG_IMAP_SUBSCRIBED="*";
+ZmOrganizer.FLAG_OFFLINE_GLOBAL="g";
+ZmOrganizer.FLAG_OFFLINE_SYNCABLE="y";
+ZmOrganizer.FLAG_OFFLINE_SYNCING="~";
+ZmOrganizer.ALL_FLAGS=[ZmOrganizer.FLAG_CHECKED,ZmOrganizer.FLAG_IMAP_SUBSCRIBED,ZmOrganizer.FLAG_EXCLUDE_FREE_BUSY,ZmOrganizer.FLAG_DISALLOW_SUBFOLDER,ZmOrganizer.FLAG_OFFLINE_GLOBAL,ZmOrganizer.FLAG_OFFLINE_SYNCABLE,ZmOrganizer.FLAG_OFFLINE_SYNCING];
+ZmOrganizer.FLAG_PROP={};
+ZmOrganizer.FLAG_PROP[ZmOrganizer.FLAG_CHECKED]="isChecked";
+ZmOrganizer.FLAG_PROP[ZmOrganizer.FLAG_IMAP_SUBSCRIBED]="imapSubscribed";
+ZmOrganizer.FLAG_PROP[ZmOrganizer.FLAG_EXCLUDE_FREE_BUSY]="excludeFreeBusy";
+ZmOrganizer.FLAG_PROP[ZmOrganizer.FLAG_DISALLOW_SUBFOLDER]="disallowSubFolder";
+ZmOrganizer.FLAG_PROP[ZmOrganizer.FLAG_OFFLINE_GLOBAL]="isOfflineGlobalSearch";
+ZmOrganizer.FLAG_PROP[ZmOrganizer.FLAG_OFFLINE_SYNCABLE]="isOfflineSyncable";
+ZmOrganizer.FLAG_PROP[ZmOrganizer.FLAG_OFFLINE_SYNCING]="isOfflineSyncing";
+ZmOrganizer.VALID_NAME_CHARS='[^\\x00-\\x1F\\x7F:\\/\\"]';
+ZmOrganizer.VALID_PATH_CHARS='[^\\x00-\\x1F\\x7F:\\"]';
+ZmOrganizer.VALID_NAME_RE=new RegExp("^"+ZmOrganizer.VALID_NAME_CHARS+"+$");
+ZmOrganizer.MAX_NAME_LENGTH=128;
+ZmOrganizer.MAX_DISPLAY_NAME_LENGTH=30;
+ZmOrganizer.C_NONE=0;
+ZmOrganizer.C_BLUE=1;
+ZmOrganizer.C_CYAN=2;
+ZmOrganizer.C_GREEN=3;
+ZmOrganizer.C_PURPLE=4;
+ZmOrganizer.C_RED=5;
+ZmOrganizer.C_YELLOW=6;
+ZmOrganizer.C_PINK=7;
+ZmOrganizer.C_GRAY=8;
+ZmOrganizer.C_ORANGE=9;
+ZmOrganizer.MAX_COLOR=ZmOrganizer.C_ORANGE;
+ZmOrganizer.ORG_DEFAULT_COLOR=ZmOrganizer.C_ORANGE;
+ZmOrganizer.COLOR_VALUES=[null,"#9EB6F5","#A4E6E6","#97C8B1","#BA86E5","#FC9696","#FFF6B3","#FE9BD3","#D3D3D3","#FDBC55"];
+ZmOrganizer.COLOR_TEXT={};
+ZmOrganizer.COLOR_TEXT[ZmOrganizer.C_NONE]=ZmMsg.none;
+ZmOrganizer.COLOR_TEXT[ZmOrganizer.C_ORANGE]=ZmMsg.orange;
+ZmOrganizer.COLOR_TEXT[ZmOrganizer.C_BLUE]=ZmMsg.blue;
+ZmOrganizer.COLOR_TEXT[ZmOrganizer.C_CYAN]=ZmMsg.cyan;
+ZmOrganizer.COLOR_TEXT[ZmOrganizer.C_GREEN]=ZmMsg.green;
+ZmOrganizer.COLOR_TEXT[ZmOrganizer.C_PURPLE]=ZmMsg.purple;
+ZmOrganizer.COLOR_TEXT[ZmOrganizer.C_RED]=ZmMsg.red;
+ZmOrganizer.COLOR_TEXT[ZmOrganizer.C_YELLOW]=ZmMsg.yellow;
+ZmOrganizer.COLOR_TEXT[ZmOrganizer.C_PINK]=ZmMsg.pink;
+ZmOrganizer.COLOR_TEXT[ZmOrganizer.C_GRAY]=ZmMsg.gray;
+ZmOrganizer.COLORS=[];
+ZmOrganizer.COLOR_CHOICES=[];
+(function(){
+for(var t=0;
+t<=ZmOrganizer.MAX_COLOR;
+t++){
+var e=ZmOrganizer.COLOR_TEXT[t];
+ZmOrganizer.COLORS.push(e);
+ZmOrganizer.COLOR_CHOICES.push({
+value:t,label:e}
+)
+}}
+)();
+ZmOrganizer.MSG_KEY={};
+ZmOrganizer.ROOT_MSG_KEY={};
+ZmOrganizer.ITEM_ORGANIZER={};
+ZmOrganizer.DEFAULT_FOLDER={};
+ZmOrganizer.SOAP_CMD={};
+ZmOrganizer.FIRST_USER_ID={};
+ZmOrganizer.PRECONDITION={};
+ZmOrganizer.HAS_COLOR={};
+ZmOrganizer.DEFAULT_COLOR={};
+ZmOrganizer.ORG_COLOR={};
+ZmOrganizer.APP={};
+ZmOrganizer.ORG_CLASS={};
+ZmOrganizer.ORG_PACKAGE={};
+ZmOrganizer.CREATE_FUNC={};
+ZmOrganizer.LABEL={};
+ZmOrganizer.ITEMS_KEY={};
+ZmOrganizer.TREE_TYPE={};
+ZmOrganizer.VIEWS={};
+ZmOrganizer.VIEW_HASH={};
+ZmOrganizer.TYPE={};
+ZmOrganizer.FOLDER_KEY={};
+ZmOrganizer.MOUNT_KEY={};
+ZmOrganizer.DEFERRABLE={};
+ZmOrganizer.PATH_IN_NAME={};
+ZmOrganizer.OPEN_SETTING={};
+ZmOrganizer.NEW_OP={};
+ZmOrganizer.DISPLAY_ORDER={};
+ZmOrganizer.HIDE_EMPTY={};
+ZmOrganizer.APP2ORGANIZER={};
+ZmOrganizer.PERM_READ="r";
+ZmOrganizer.PERM_WRITE="w";
+ZmOrganizer.PERM_INSERT="i";
+ZmOrganizer.PERM_DELETE="d";
+ZmOrganizer.PERM_ADMIN="a";
+ZmOrganizer.PERM_WORKFLOW="x";
+ZmOrganizer.PERM_PRIVATE="p";
+ZmOrganizer.registerOrg=function(a,e){
+if(e.nameKey){
+ZmOrganizer.MSG_KEY[a]=e.nameKey
+}
+if(e.app){
+ZmOrganizer.APP[a]=e.app;
+if(!ZmOrganizer.APP2ORGANIZER[e.app]){
+ZmOrganizer.APP2ORGANIZER[e.app]=[]
+}
+ZmOrganizer.APP2ORGANIZER[e.app].push(a)
+}
+if(e.defaultFolder){
+ZmOrganizer.DEFAULT_FOLDER[a]=e.defaultFolder
+}
+if(e.precondition){
+ZmOrganizer.PRECONDITION[a]=e.precondition
+}
+if(e.soapCmd){
+ZmOrganizer.SOAP_CMD[a]=e.soapCmd
+}
+if(e.firstUserId){
+ZmOrganizer.FIRST_USER_ID[a]=e.firstUserId
+}
+if(e.orgClass){
+ZmOrganizer.ORG_CLASS[a]=e.orgClass
+}
+if(e.orgPackage){
+ZmOrganizer.ORG_PACKAGE[a]=e.orgPackage
+}
+if(e.labelKey){
+ZmOrganizer.LABEL[a]=e.labelKey
+}
+if(e.itemsKey){
+ZmOrganizer.ITEMS_KEY[a]=e.itemsKey
+}
+if(e.hasColor){
+ZmOrganizer.HAS_COLOR[a]=e.hasColor
+}
+if(e.views){
+ZmOrganizer.VIEWS[a]=e.views
+}
+if(e.folderKey){
+ZmOrganizer.FOLDER_KEY[a]=e.folderKey
+}
+if(e.mountKey){
+ZmOrganizer.MOUNT_KEY[a]=e.mountKey
+}
+if(e.deferrable){
+ZmOrganizer.DEFERRABLE[a]=e.deferrable
+}
+if(e.pathInName){
+ZmOrganizer.PATH_IN_NAME[a]=e.pathInName
+}
+if(e.openSetting){
+ZmOrganizer.OPEN_SETTING[a]=e.openSetting
+}
+if(e.newOp){
+ZmOrganizer.NEW_OP[a]=e.newOp
+}
+if(e.displayOrder){
+ZmOrganizer.DISPLAY_ORDER[a]=e.displayOrder
+}
+if(e.hideEmpty){
+ZmOrganizer.HIDE_EMPTY[a]=e.hideEmpty
+}
+if(!appCtxt.isChildWindow||e.childWindow){
+if(e.compareFunc){
+ZmTreeView.COMPARE_FUNC[a]=e.compareFunc
+}
+if(e.treeController){
+ZmOverviewController.CONTROLLER[a]=e.treeController
+}}
+ZmOrganizer.TREE_TYPE[a]=e.treeType||a;
+ZmOrganizer.CREATE_FUNC[a]=e.createFunc||"ZmOrganizer.create";
+if(e.views){
+ZmOrganizer.VIEW_HASH[a]=AjxUtil.arrayAsHash(ZmOrganizer.VIEWS[a])
+}
+if(e.hasColor){
+ZmOrganizer.DEFAULT_COLOR[a]=(e.defaultColor!=null)?e.defaultColor:ZmOrganizer.ORG_DEFAULT_COLOR
+}
+if(e.orgColor){
+for(var t in e.orgColor){
+ZmOrganizer.ORG_COLOR[t]=e.orgColor[t]
+}}
+if(e.dropTargets){
+if(!ZmApp.DROP_TARGETS[e.app]){
+ZmApp.DROP_TARGETS[e.app]={}
+}
+ZmApp.DROP_TARGETS[e.app][a]=e.dropTargets
+}};
+ZmOrganizer.sortCompare=function(t,e){};
+ZmOrganizer.create=function(s){
+var r={
+CreateFolderRequest:{
+_jsns:"urn:zimbraMail"}};
+var o=r.CreateFolderRequest.folder={};
+var e=s.errorCallback||new AjxCallback(null,ZmOrganizer._handleErrorCreate,s);
+var a=s.type;
+s.view=s.view||ZmOrganizer.VIEWS[a]?ZmOrganizer.VIEWS[a][0]:null;
+for(var t in s){
+if(t=="type"||t=="errorCallback"||t=="account"){
+continue
+}
+var n=s[t];
+if(t=="color"){
+if(!n||(n==ZmOrganizer.DEFAULT_COLOR[a])){
+n=null
+}}
+if(n){
+o[t]=n
+}}
+return appCtxt.getAppController().sendRequest({
+jsonObj:r,asyncMode:true,accountName:(s.account&&s.account.name),errorCallback:e}
+)
+};
+ZmOrganizer._handleErrorCreate=function(o,e){
+if(!o.url&&!o.name){
+return false
+}
+var a;
+if(o.name&&(e.code==ZmCsfeException.MAIL_ALREADY_EXISTS)){
+a=AjxMessageFormat.format(ZmMsg.errorAlreadyExists,[o.name])
+}else{
+if(o.url){
+var t=(e.code==ZmCsfeException.SVC_RESOURCE_UNREACHABLE)?ZmMsg.feedUnreachable:ZmMsg.feedInvalid;
+a=AjxMessageFormat.format(t,o.url)
+}}
+if(a){
+ZmOrganizer._showErrorMsg(a);
+return true
+}
+return false
+};
+ZmOrganizer._showErrorMsg=function(t){
+var e=appCtxt.getMsgDialog();
+e.reset();
+e.setMessage(t,DwtMessageDialog.CRITICAL_STYLE);
+e.popup()
+};
+ZmOrganizer.getFolder=function(s,n,e){
+var o={
+GetFolderRequest:{
+_jsns:"urn:zimbraMail"}};
+var t=o.GetFolderRequest;
+t.folder={
+l:s};
+var a=new AjxCallback(null,ZmOrganizer._handleResponseGetFolder,[n]);
+if(e){
+e.addRequestParams(o,a)
+}else{
+appCtxt.getRequestMgr().sendRequest({
+jsonObj:o,asyncMode:true,callback:a}
+)
+}};
+ZmOrganizer._handleResponseGetFolder=function(s,e){
+var n=e.getResponse().GetFolderResponse;
+var t=(n&&n.folder&&n.folder[0])||(n&&n.link&&n.link[0]);
+var o;
+if(t){
+o=appCtxt.getById(t.id);
+if(o){
+o.clearShares();
+o._setSharesFromJs(t)
+}else{
+var a=appCtxt.getById(t.l);
+o=ZmFolderTree.createFromJs(a,t,appCtxt.getFolderTree(),"folder")
+}}
+if(s){
+s.run(o)
+}};
+ZmOrganizer.prototype.getFolder=function(t,e){
+ZmOrganizer.getFolder(this.id,t,e)
+};
+ZmOrganizer.getViewName=function(e){
+return ZmOrganizer.VIEWS[e][0]
+};
+ZmOrganizer.checkName=function(e){
+if(e.length==0){
+return ZmMsg.nameEmpty
+}
+if(e.length>ZmOrganizer.MAX_NAME_LENGTH){
+return AjxMessageFormat.format(ZmMsg.nameTooLong,ZmOrganizer.MAX_NAME_LENGTH)
+}
+if(!ZmOrganizer.VALID_NAME_RE.test(e)){
+return AjxMessageFormat.format(ZmMsg.errorInvalidName,AjxStringUtil.htmlEncode(e))
+}
+return null
+};
+ZmOrganizer.checkUrl=function(e){
+if(!e.match(/^[a-zA-Z]+:\/\/.*$/i)){
+return ZmMsg.errorUrlMissing
+}
+return null
+};
+ZmOrganizer.checkSortArgs=function(e,t){
+if(!e&&!t){
+return 0
+}
+if(e&&!t){
+return 1
+}
+if(!e&&t){
+return -1
+}
+return null
+};
+ZmOrganizer.checkColor=function(e){
+return((e!=null)&&(e>=0&&e<=ZmOrganizer.MAX_COLOR))?e:ZmOrganizer.ORG_DEFAULT_COLOR
+};
+ZmOrganizer.getSystemId=function(a,t,e){
+t=t||appCtxt.getActiveAccount();
+if((t&&!t.isMain)||e){
+return((typeof(a)=="string")&&(a.indexOf(":")!=-1)||!a)?a:([t.id,a].join(":"))
+}
+return a
+};
+ZmOrganizer.normalizeId=function(o,a){
+if(typeof(o)!="string"){
+return o
+}
+var e=o.indexOf(":");
+var t=(e==-1)?o:o.substr(e+1);
+return(a&&(t>=ZmOrganizer.FIRST_USER_ID[a]))?o:t
+};
+ZmOrganizer.parseId=function(a,t){
+t=t||{};
+if(a==null){
+return t
+}
+var e=(typeof a=="string")?a.indexOf(":"):-1;
+if(e==-1){
+t.account=appCtxt.accountList.mainAccount;
+t.id=a
+}else{
+t.account=appCtxt.accountList.getAccount(a.substring(0,e));
+t.id=a.substr(e+1)
+}
+return t
+};
+ZmOrganizer.prototype.toString=function(){
+return"ZmOrganizer"
+};
+ZmOrganizer.prototype.getName=function(n,t,o,e){
+if(this.nId==ZmFolder.ID_ROOT){
+return(ZmOrganizer.LABEL[this.type])?ZmMsg[ZmOrganizer.LABEL[this.type]]:""
+}
+var a=(e&&this._systemName)?this._systemName:this.name||"";
+if(ZmOrganizer.PATH_IN_NAME[this.type]&&this.path){
+a=[this.path,a].join("/")
+}
+a=(t&&a.length>t)?a.substring(0,t-3)+"...":a;
+return this._markupName(a,n,o)
+};
+ZmOrganizer.prototype.getPath=function(a,r,t,s,e){
+var o=this.parent;
+var n=this.getName(r,t,s,e);
+while(o&&((o.nId!=ZmOrganizer.ID_ROOT)||a)){
+n=o.getName(r,t,s,e)+ZmFolder.SEP+n;
+o=o.parent
+}
+return n
+};
+ZmOrganizer.prototype.getToolTip=function(a){
+if(!this._tooltip||a){
+var e=this._getItemsText();
+var o=this.numTotal;
+if(appCtxt.isOffline&&this.account.isMain&&(this.nId==ZmFolder.ID_DRAFTS||this.nId==ZmFolder.ID_OUTBOX)){
+o=appCtxt.accountList.getItemCount(this.nId)
+}
+var t={
+itemText:e,numTotal:o,sizeTotal:this.sizeTotal};
+this._tooltip=AjxTemplate.expand("share.App#FolderTooltip",t)
+}
+return this._tooltip
+};
+ZmOrganizer.prototype.getSearchPath=function(){
+return(this.nId!=ZmOrganizer.ID_ROOT)?this.getPath(null,null,null,true,true):"/"
+};
+ZmOrganizer.prototype.getUrl=function(){
+return this.getRestUrl()
+};
+ZmOrganizer.prototype.getSyncUrl=function(){
+return url
+};
+ZmOrganizer.prototype.getRemoteId=function(){
+if(!this._remoteId){
+this._remoteId=(this.isRemote()&&this.zid&&this.rid)?(this.zid+":"+this.rid):this.id
+}
+return this._remoteId
+};
+ZmOrganizer.prototype.getRestUrl=function(){
+var o=appCtxt.get(ZmSetting.REST_URL);
+if(o){
+return([o,"/",AjxStringUtil.urlEncode(this.getSearchPath())].join(""))
+}
+if(this.restUrl){
+return this.restUrl
+}
+var s=document.location;
+var t=this.owner||appCtxt.get(ZmSetting.USERNAME);
+var n=s.host;
+var e=t.match(/^(.*)@(.*)$/);
+t=(e&&e[1])||t;
+n=(e&&e[2])||n;
+if(s.port&&s.port!=80){
+n=n+":"+s.port
+}
+var a=[s.protocol,"//",n,"/service/user/",t,"/",AjxStringUtil.urlEncode(this.getSearchPath())].join("");
+return a
+};
+ZmOrganizer.prototype.getAccount=function(){
+if(appCtxt.multiAccounts){
+if(!this.account){
+this.account=ZmOrganizer.parseId(this.id).account
+}
+return this.account
+}
+return(this.account||appCtxt.accountList.mainAccount)
+};
+ZmOrganizer.prototype.getShares=function(){
+return this.shares
+};
+ZmOrganizer.prototype.addShare=function(a){
+this.shares=this.shares||[];
+this.shares.push(a);
+var o=appCtxt.getActiveAccount();
+var e=o&&o.id;
+var t=a.grantee&&a.grantee.id;
+if(t&&(t==e)){
+this._mainShare=a
+}};
+ZmOrganizer.prototype.clearShares=function(){
+if(this.shares&&this.shares.length){
+for(var e=0;
+e<this.shares.length;
+e++){
+this.shares[e]=null
+}}
+this.shares=null;
+this._mainShare=null
+};
+ZmOrganizer.prototype.getMainShare=function(){
+return this._mainShare||(this.shares&&this.shares.length&&this.shares[0])
+};
+ZmOrganizer.prototype.supportsSharing=function(){
+return true
+};
+ZmOrganizer.prototype.supportsPublicAccess=function(){
+return true
+};
+ZmOrganizer.prototype.supportsPrivatePermission=function(){
+return false
+};
+ZmOrganizer.prototype.getIcon=function(){};
+ZmOrganizer.prototype.getIconWithColor=function(){
+var t=this.getIcon()||"";
+var e=this.rgb||this.color;
+return e?[t,e].join(",color="):t
+};
+ZmOrganizer.prototype.rename=function(a,n,t,e){
+if(a==this.name){
+return
+}
+var o={
+action:"rename",attrs:{
+name:a}
+,callback:n,errorCallback:t,batchCmd:e};
+this._organizerAction(o)
+};
+ZmOrganizer.prototype.setColor=function(t,a,e){
+var t=ZmOrganizer.checkColor(t);
+if(this.color==t){
+return
+}
+this._organizerAction({
+action:"color",attrs:{
+color:t}
+,callback:a,errorCallback:e}
+)
+};
+ZmOrganizer.prototype.setRGB=function(t,a,e){
+if(this.rgb==t){
+return
+}
+this._organizerAction({
+action:"color",attrs:{
+rgb:t}
+,callback:a,errorCallback:e}
+)
+};
+ZmOrganizer.prototype.update=function(e){
+this._organizerAction({
+action:"update",attrs:e}
+)
+};
+ZmOrganizer.prototype.move=function(t){
+var e=(t.nId>0)?t.id:ZmOrganizer.getSystemId(ZmOrganizer.ID_ROOT);
+if((e==this.id||e==this.parent.id)||(this.type==ZmOrganizer.FOLDER&&(ZmOrganizer.normalizeId(e,this.type)==ZmFolder.ID_SPAM))||(t.isChildOf(this))){
+return
+}
+if(e==ZmOrganizer.ID_TRASH){
+this._organizerAction({
+action:"trash"}
+)
+}else{
+this._organizerAction({
+action:"move",attrs:{
+l:e}}
+)
+}};
+ZmOrganizer.prototype._delete=function(){
+var e=((this.type==ZmOrganizer.FOLDER||this.type==ZmOrganizer.ADDRBOOK)&&(this.nId==ZmFolder.ID_SPAM||this.nId==ZmFolder.ID_TRASH));
+if(this.isSystem()&&!e){
+return
+}
+var t=e?"empty":"delete";
+this._organizerAction({
+action:t}
+)
+};
+ZmOrganizer.prototype._empty=function(t){
+t=t||false;
+var e=((this.type==ZmOrganizer.FOLDER||this.type==ZmOrganizer.ADDRBOOK)&&(this.nId==ZmFolder.ID_SPAM||this.nId==ZmFolder.ID_TRASH||this.nId==ZmFolder.ID_CHATS||this.nId==ZmOrganizer.ID_SYNC_FAILURES));
+if(this.isSystem()&&!e){
+return
+}
+var a={
+action:"empty"};
+a.attrs=(this.nId==ZmFolder.ID_TRASH)?{
+recursive:true}
+:{
+recursive:t};
+if(this.isRemote()){
+a.id=this.getRemoteId()
+}
+this._organizerAction(a)
+};
+ZmOrganizer.prototype.markAllRead=function(){
+var e=this.isRemote()?this.getRemoteId():null;
+this._organizerAction({
+action:"read",id:e,attrs:{
+l:this.id}}
+)
+};
+ZmOrganizer.prototype.sync=function(){
+this._organizerAction({
+action:"sync"}
+)
+};
+ZmOrganizer.prototype.notifyDelete=function(){
+var t=appCtxt.getOverviewController().getTreeController(this.type);
+var o=t.getTreeView(appCtxt.getCurrentApp().getOverviewId());
+var n=o&&o.getSelected();
+if(n){
+if(!(n instanceof Array)){
+n=[n]
+}
+for(var r in n){
+var e=n[r];
+if(e&&(e==this||e.isChildOf(this))){
+var a=this.parent.id;
+if(this.parent.nId==ZmOrganizer.ID_ROOT){
+a=ZmOrganizer.getSystemId(ZmOrganizer.DEFAULT_FOLDER[this.type])
+}
+var s=false;
+o.setSelected(a,s)
+}}}
+this.deleteLocal();
+this._notify(ZmEvent.E_DELETE)
+};
+ZmOrganizer.prototype.notifyCreate=function(){};
+ZmOrganizer.prototype.notifyModify=function(obj,details){
+var doNotify=false;
+var details=details||{};
+var fields={};
+if(obj.name!=null&&(this.name!=obj.name||this.id!=obj.id)){
+if(obj.id==this.id){
+details.oldName=this.name;
+this.name=obj.name;
+fields[ZmOrganizer.F_NAME]=true;
+this.parent.children.sort(eval(ZmTreeView.COMPARE_FUNC[this.type]))
+}else{
+details.newName=obj.name;
+fields[ZmOrganizer.F_RNAME]=true
+}
+doNotify=true
+}
+if(obj.u!=null&&this.numUnread!=obj.u){
+this.numUnread=obj.u;
+fields[ZmOrganizer.F_UNREAD]=true;
+doNotify=true
+}
+if(obj.n!=null&&this.numTotal!=obj.n){
+this.numTotal=obj.n;
+fields[ZmOrganizer.F_TOTAL]=true;
+doNotify=true
+}
+if(obj.s!=null&&this.sizeTotal!=obj.s){
+this.sizeTotal=obj.s;
+fields[ZmOrganizer.F_SIZE]=true;
+doNotify=true
+}
+if((obj.rgb!=null||obj.color!=null)&&!obj._isRemote){
+var color=ZmOrganizer.checkColor(obj.color);
+if(this.color!=color){
+this.color=color;
+fields[ZmOrganizer.F_COLOR]=true
+}
+if(obj.rgb!=this.rgb){
+this.rgb=obj.rgb;
+fields[ZmOrganizer.F_RBG]=true;
+fields[ZmOrganizer.F_COLOR]=true
+}
+doNotify=true
+}
+if(obj.f!=null&&!obj._isRemote){
+var oflags=this._setFlags().split("").sort().join("");
+var nflags=obj.f.split("").sort().join("");
+if(oflags!=nflags){
+this._parseFlags(obj.f);
+fields[ZmOrganizer.F_FLAGS]=true;
+doNotify=true
+}}
+if(obj.rest!=null&&this.restUrl!=obj.rest&&!obj._isRemote){
+this.restUrl=obj.rest;
+fields[ZmOrganizer.F_REST_URL]=true;
+doNotify=true
+}
+if(obj.acl){
+this.clearShares();
+if(obj.acl.grant&&obj.acl.grant.length){
+AjxDispatcher.require("Share");
+for(var i=0;
+i<obj.acl.grant.length;
+i++){
+share=ZmShare.createFromJs(this,obj.acl.grant[i]);
+this.addShare(share)
+}}
+fields[ZmOrganizer.F_SHARES]=true;
+doNotify=true
+}
+if(obj.perm&&obj._isRemote){
+fields[ZmOrganizer.F_PERMS]=true;
+doNotify=true;
+this._isAdmin=this._isReadOnly=this._hasPrivateAccess=null
+}
+if(doNotify){
+details.fields=fields;
+this._notify(ZmEvent.E_MODIFY,details)
+}
+if(this.parent&&obj.l!=null&&obj.l!=this.parent.id){
+var newParent=this._getNewParent(obj.l);
+if(newParent){
+this.reparent(newParent);
+this._notify(ZmEvent.E_MOVE);
+this.tree=newParent.tree
+}}};
+ZmOrganizer.prototype.deleteLocal=function(){
+this.parent.children.remove(this);
+var e=this.children.getArray();
+var o=this.children.size();
+for(var t=0;
+t<o;
+t++){
+var n=e[t];
+if(n){
+n.deleteLocal()
+}}
+this.children.removeAll()
+};
+ZmOrganizer.prototype.hasChild=function(e){
+return(this.getChild(e)!=null)
+};
+ZmOrganizer.prototype.getChild=function(t){
+t=t.toLowerCase();
+var e=this.children.getArray();
+var n=this.children.size();
+for(var o=0;
+o<n;
+o++){
+if(e[o].name&&(e[o].name.toLowerCase()==t)){
+return e[o]
+}}
+return null
+};
+ZmOrganizer.prototype.getChildByPath=function(n){
+var e=this;
+if(n.match(/^\//)){
+while(e.nId!=ZmOrganizer.ID_ROOT){
+e=e.parent
+}
+n=n.substr(1)
+}
+if(n.length==0){
+return e
+}
+var o=n.split("/");
+var a=0;
+while(a<o.length){
+var t=o[a++];
+var s=e.getChild(t);
+if(s==null){
+return null
+}
+e=s
+}
+return e
+};
+ZmOrganizer.prototype.reparent=function(e){
+if(this.parent){
+this.parent.children.remove(this)
+}
+if(e){
+e.children.add(this)
+}
+this.parent=e
+};
+ZmOrganizer.prototype.getById=function(r){
+if(this.link&&r&&typeof(r)=="string"){
+var n=r.split(":");
+if(this.zid==n[0]&&this.rid==n[1]){
+return this
+}}
+if(this.id==r||this.nId==r){
+return this
+}
+var e;
+var t=this.children.getArray();
+var s=this.children.size();
+for(var o=0;
+o<s;
+o++){
+if(e=t[o].getById(r)){
+return e
+}}
+return null
+};
+ZmOrganizer.prototype.getByName=function(t,e){
+return this._getByName(t.toLowerCase(),e)
+};
+ZmOrganizer.prototype.getByType=function(e){
+var t=[];
+this._getByType(e,t);
+return t
+};
+ZmOrganizer.prototype._getByType=function(o,n){
+if(this.type==o){
+n.push(this)
+}
+var e=this.children.getArray();
+for(var t=0;
+t<e.length;
+t++){
+if(e[t]){
+e[t]._getByType(o,n)
+}}};
+ZmOrganizer.prototype.getByPath=function(t,e){
+return this._getByPath(t.toLowerCase(),e)
+};
+ZmOrganizer.prototype._getByPath=function(s,o){
+if(this.nId==ZmFolder.ID_TAGS){
+return null
+}
+if(s==this.getPath(false,false,null,true,o).toLowerCase()){
+return this
+}
+var t=this.children.getArray();
+for(var n=0;
+n<t.length;
+n++){
+var e=t[n]._getByPath(s,o);
+if(e){
+return e
+}}
+return null
+};
+ZmOrganizer.prototype.size=function(){
+return this.children.size()
+};
+ZmOrganizer.prototype.isChildOf=function(e){
+var t=this.parent;
+while(t){
+if(t==e){
+return true
+}
+t=t.parent
+}
+return false
+};
+ZmOrganizer.prototype._getNewParent=function(e){
+return appCtxt.getById(e)
+};
+ZmOrganizer.prototype.isUnder=function(t){
+if(this.nId==t||(this.isRemote()&&this.rid==t)){
+return true
+}
+var e=this.parent;
+while(e&&e.nId!=ZmOrganizer.ID_ROOT){
+if(e.nId==t){
+return true
+}
+e=e.parent
+}
+return false
+};
+ZmOrganizer.prototype.isInTrash=function(){
+return this.isUnder(ZmOrganizer.ID_TRASH)
+};
+ZmOrganizer.prototype.isPermAllowed=function(t){
+if(this.perm){
+var e=this.perm.replace(/-./g,"");
+return(e.indexOf(t)!=-1)
+}
+return false
+};
+ZmOrganizer.prototype.isReadOnly=function(){
+if(this._isReadOnly==null){
+var e=this.getMainShare();
+this._isReadOnly=(e!=null)?(this.isRemote()&&!e.isWrite()):(this.isRemote()&&this.isPermAllowed(ZmOrganizer.PERM_READ)&&!this.isPermAllowed(ZmOrganizer.PERM_WRITE))
+}
+return this._isReadOnly
+};
+ZmOrganizer.prototype.isAdmin=function(){
+if(this._isAdmin==null){
+var e=this.getMainShare();
+this._isAdmin=(e!=null)?(this.isRemote()&&e.isAdmin()):(this.isRemote()&&this.isPermAllowed(ZmOrganizer.PERM_ADMIN))
+}
+return this._isAdmin
+};
+ZmOrganizer.prototype.hasPrivateAccess=function(){
+if(this._hasPrivateAccess==null){
+var e=this.getMainShare();
+this._hasPrivateAccess=(e!=null)?(this.isRemote()&&e.hasPrivateAccess()):(this.isRemote()&&this.isPermAllowed(ZmOrganizer.PERM_PRIVATE))
+}
+return this._hasPrivateAccess
+};
+ZmOrganizer.prototype.isRemote=function(){
+if(this._isRemote==null){
+if(this.zid!=null){
+this._isRemote=true
+}else{
+if(appCtxt.multiAccounts){
+var t=this.account;
+var e=ZmOrganizer.parseId(this.id);
+if(!t){
+if(e.account&&e.account.isMain){
+this._isRemote=false;
+return this._isRemote
+}else{
+t=appCtxt.getActiveAccount()
+}}
+this._isRemote=(e.account&&(e.account!=t))
+}else{
+var a=String(this.id);
+this._isRemote=((a.indexOf(":")!=-1)&&(a.indexOf(appCtxt.getActiveAccount().id)!=0))
+}}}
+return this._isRemote
+};
+ZmOrganizer.prototype.isSystem=function(){
+return(this.nId<ZmOrganizer.FIRST_USER_ID[this.type])
+};
+ZmOrganizer.prototype.isFeed=function(){
+return Boolean(this.url)
+};
+ZmOrganizer.prototype.isDataSource=function(t,a){
+var e=this.getDataSources(t,a);
+return(e&&e.length>0)
+};
+ZmOrganizer.prototype.getDataSources=function(t,a){
+if(!appCtxt.get(ZmSetting.MAIL_ENABLED)){
+return null
+}
+var e=appCtxt.getDataSourceCollection();
+var o=e.getByFolderId(this.nId,t);
+if(o.length==0){
+return(a&&this.parent)?this.parent.getDataSources(t,a):null
+}
+return o
+};
+ZmOrganizer.prototype.getOwner=function(){
+return(this.owner||appCtxt.get(ZmSetting.USERNAME))
+};
+ZmOrganizer.getSortIndex=function(n,e){
+if(!(n&&n.parent&&e)){
+return null
+}
+var a=n.parent.children.getArray();
+for(var t=0;
+t<a.length;
+t++){
+var o=e(n,a[t]);
+if(o==-1){
+return t
+}}
+return t
+};
+ZmOrganizer.prototype._organizerAction=function(s){
+var n=ZmOrganizer.SOAP_CMD[this.type];
+var o=AjxSoapDoc.create(n+"Request","urn:zimbraMail");
+var a=o.set("action");
+a.setAttribute("op",s.action);
+a.setAttribute("id",s.id||this.id);
+for(var e in s.attrs){
+if(AjxEnv.isIE){
+s.attrs[e]+=""
+}
+a.setAttribute(e,s.attrs[e])
+}
+var r=new AjxCallback(this,this._handleResponseOrganizerAction,s);
+if(s.batchCmd){
+s.batchCmd.addRequestParams(o,r,s.errorCallback)
+}else{
+var t;
+if(appCtxt.multiAccounts){
+t=(this.account)?this.account.name:appCtxt.accountList.mainAccount.name
+}
+appCtxt.getAppController().sendRequest({
+soapDoc:o,asyncMode:true,accountName:t,callback:r,errorCallback:s.errorCallback}
+)
+}};
+ZmOrganizer.prototype._handleResponseOrganizerAction=function(t,e){
+if(t.callback){
+t.callback.run(e)
+}};
+ZmOrganizer.prototype._getByName=function(n,t){
+if(this.name&&n==this.name.toLowerCase()){
+return this
+}
+var e;
+var o=this.children.getArray();
+var r=this.children.size();
+for(var s=0;
+s<r;
+s++){
+if(e=o[s]._getByName(n,t)){
+if(t&&e.isDataSource(ZmAccount.TYPE_IMAP,true)){
+continue
+}
+return e
+}}
+return null
+};
+ZmOrganizer.prototype._parseFlags=function(a){
+for(var t=0;
+t<ZmOrganizer.ALL_FLAGS.length;
+t++){
+var e=ZmOrganizer.ALL_FLAGS[t];
+this[ZmOrganizer.FLAG_PROP[e]]=(Boolean(a&&(a.indexOf(e)!=-1)))
+}};
+ZmOrganizer.prototype._setFlags=function(){
+var t="";
+for(var a=0;
+a<ZmOrganizer.ALL_FLAGS.length;
+a++){
+var e=ZmOrganizer.ALL_FLAGS[a];
+var o=ZmOrganizer.FLAG_PROP[e];
+if(this[o]){
+t=t+e
+}}
+return t
+};
+ZmOrganizer.prototype.addChangeListener=function(e){
+this.tree.addChangeListener(e)
+};
+ZmOrganizer.prototype.removeChangeListener=function(e){
+this.tree.removeChangeListener(e)
+};
+ZmOrganizer.prototype._setSharesFromJs=function(a){
+if(a.acl&&a.acl.grant&&a.acl.grant.length>0){
+AjxDispatcher.require("Share");
+for(var t=0;
+t<a.acl.grant.length;
+t++){
+var e=a.acl.grant[t];
+this.addShare(ZmShare.createFromJs(this,e))
+}}};
+ZmOrganizer.prototype._notify=function(t,e){
+if(e){
+e.organizers=[this]
+}else{
+e={
+organizers:[this]}
+}
+this.tree._evt.type=this.type;
+this.tree._notify(t,e)
+};
+ZmOrganizer.prototype._markupName=function(e,a,t){
+if(!t){
+e=AjxStringUtil.htmlEncode(e,true)
+}
+if(a&&this.numUnread>0){
+e=AjxMessageFormat.format(ZmMsg.folderUnread,[e,this.numUnread]);
+if(!t){
+e=["<span style='font-weight:bold'>",e,"</span>"].join("")
+}}
+if(this.noSuchFolder&&!t){
+e=["<del>",e,"</del>"].join("")
+}
+return e
+};
+ZmOrganizer.prototype._getItemsText=function(){
+var e=ZmMsg[ZmOrganizer.ITEMS_KEY[this.type]];
+if(!e||(this.nId==ZmFolder.ID_TRASH)){
+e=ZmMsg.items
+}
+return e
+}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmFolder")){
+ZmFolder=function(e){
+if(arguments.length==0){
+return
+}
+e.type=e.type||ZmOrganizer.FOLDER;
+ZmOrganizer.call(this,e)
+};
+ZmFolder.prototype=new ZmOrganizer;
+ZmFolder.prototype.constructor=ZmFolder;
+ZmOrganizer.ORG_CLASS[ZmId.ORG_FOLDER]="ZmFolder";
+ZmFolder.SEP="/";
+ZmFolder.ID_LOAD_FOLDERS=-3;
+ZmFolder.ID_OTHER=-2;
+ZmFolder.ID_SEP=-1;
+ZmFolder.ID_ROOT=ZmOrganizer.ID_ROOT;
+ZmFolder.ID_INBOX=ZmOrganizer.ID_INBOX;
+ZmFolder.ID_TRASH=ZmOrganizer.ID_TRASH;
+ZmFolder.ID_SPAM=ZmOrganizer.ID_SPAM;
+ZmFolder.ID_SENT=5;
+ZmFolder.ID_DRAFTS=6;
+ZmFolder.ID_CONTACTS=ZmOrganizer.ID_ADDRBOOK;
+ZmFolder.ID_AUTO_ADDED=ZmOrganizer.ID_AUTO_ADDED;
+ZmFolder.ID_TAGS=8;
+ZmFolder.ID_TASKS=ZmOrganizer.ID_TASKS;
+ZmFolder.ID_SYNC_FAILURES=ZmOrganizer.ID_SYNC_FAILURES;
+ZmFolder.ID_OUTBOX=ZmOrganizer.ID_OUTBOX;
+ZmFolder.ID_CHATS=ZmOrganizer.ID_CHATS;
+ZmFolder.ID_ATTACHMENTS=ZmOrganizer.ID_ATTACHMENTS;
+ZmFolder.MSG_KEY={};
+ZmFolder.MSG_KEY[ZmFolder.ID_INBOX]="inbox";
+ZmFolder.MSG_KEY[ZmFolder.ID_TRASH]="trash";
+ZmFolder.MSG_KEY[ZmFolder.ID_SPAM]="junk";
+ZmFolder.MSG_KEY[ZmFolder.ID_SENT]="sent";
+ZmFolder.MSG_KEY[ZmFolder.ID_DRAFTS]="drafts";
+ZmFolder.MSG_KEY[ZmFolder.ID_CONTACTS]="contacts";
+ZmFolder.MSG_KEY[ZmFolder.ID_AUTO_ADDED]="emailedContacts";
+ZmFolder.MSG_KEY[ZmFolder.ID_TASKS]="tasks";
+ZmFolder.MSG_KEY[ZmFolder.ID_TAGS]="tags";
+ZmFolder.MSG_KEY[ZmOrganizer.ID_CALENDAR]="calendar";
+ZmFolder.MSG_KEY[ZmOrganizer.ID_NOTEBOOK]="notebook";
+ZmFolder.MSG_KEY[ZmOrganizer.ID_BRIEFCASE]="briefcase";
+ZmFolder.MSG_KEY[ZmOrganizer.ID_CHATS]="chats";
+ZmFolder.MSG_KEY[ZmOrganizer.ID_GLOBAL_INBOX]="globalInbox";
+
+ZmFolder.MSG_KEY[ZmFolder.ID_OUTBOX]="outbox";
+ZmFolder.MSG_KEY[ZmFolder.ID_SYNC_FAILURES]="errorReports";
+ZmFolder.MSG_KEY[ZmFolder.ID_ATTACHMENTS]="attachments";
+ZmFolder.ICON={};
+ZmFolder.ICON[ZmFolder.ID_INBOX]="Inbox";
+ZmFolder.ICON[ZmFolder.ID_TRASH]="Trash";
+ZmFolder.ICON[ZmFolder.ID_SPAM]="SpamFolder";
+ZmFolder.ICON[ZmFolder.ID_SENT]="SentFolder";
+ZmFolder.ICON[ZmFolder.ID_SYNC_FAILURES]="SendReceive";
+ZmFolder.ICON[ZmFolder.ID_OUTBOX]="Outbox";
+ZmFolder.ICON[ZmFolder.ID_DRAFTS]="DraftFolder";
+ZmFolder.ICON[ZmFolder.ID_CHATS]="ChatFolder";
+ZmFolder.ICON[ZmFolder.ID_LOAD_FOLDERS]="Plus";
+ZmFolder.ICON[ZmFolder.ID_ATTACHMENTS]="Attachment";
+ZmFolder.QUERY_NAME={};
+ZmFolder.QUERY_NAME[ZmFolder.ID_INBOX]="inbox";
+ZmFolder.QUERY_NAME[ZmFolder.ID_TRASH]="trash";
+ZmFolder.QUERY_NAME[ZmFolder.ID_SPAM]="junk";
+ZmFolder.QUERY_NAME[ZmFolder.ID_SENT]="sent";
+ZmFolder.QUERY_NAME[ZmFolder.ID_OUTBOX]="outbox";
+ZmFolder.QUERY_NAME[ZmFolder.ID_DRAFTS]="drafts";
+ZmFolder.QUERY_NAME[ZmFolder.ID_CONTACTS]="contacts";
+ZmFolder.QUERY_NAME[ZmFolder.ID_TASKS]="tasks";
+ZmFolder.QUERY_NAME[ZmFolder.ID_AUTO_ADDED]="Emailed Contacts";
+ZmFolder.QUERY_NAME[ZmOrganizer.ID_NOTEBOOK]="notebook";
+ZmFolder.QUERY_NAME[ZmOrganizer.ID_BRIEFCASE]="briefcase";
+ZmFolder.QUERY_NAME[ZmFolder.ID_CHATS]="chats";
+ZmFolder.QUERY_NAME[ZmFolder.ID_SYNC_FAILURES]="Error Reports";
+ZmFolder.QUERY_ID={};
+for(var id in ZmFolder.QUERY_NAME){
+ZmFolder.QUERY_ID[ZmFolder.QUERY_NAME[id]]=id
+}
+ZmFolder.SORT_ORDER={};
+ZmFolder.SORT_ORDER[ZmFolder.ID_INBOX]=1;
+ZmFolder.SORT_ORDER[ZmFolder.ID_CHATS]=2;
+ZmFolder.SORT_ORDER[ZmFolder.ID_SENT]=3;
+ZmFolder.SORT_ORDER[ZmFolder.ID_DRAFTS]=4;
+ZmFolder.SORT_ORDER[ZmFolder.ID_SPAM]=5;
+ZmFolder.SORT_ORDER[ZmFolder.ID_OUTBOX]=6;
+ZmFolder.SORT_ORDER[ZmFolder.ID_TRASH]=7;
+ZmFolder.SORT_ORDER[ZmFolder.ID_SYNC_FAILURES]=8;
+ZmFolder.SORT_ORDER[ZmFolder.ID_SEP]=9;
+ZmFolder.SORT_ORDER[ZmFolder.ID_ATTACHMENTS]=99;
+ZmFolder.TCON_CODE={};
+ZmFolder.TCON_CODE[ZmFolder.ID_TRASH]="t";
+ZmFolder.TCON_CODE[ZmFolder.ID_SYNC_FAILURES]="o";
+ZmFolder.TCON_CODE[ZmFolder.ID_SPAM]="j";
+ZmFolder.TCON_CODE[ZmFolder.ID_SENT]="s";
+ZmFolder.TCON_CODE[ZmFolder.ID_OTHER]="o";
+ZmFolder.HIDE_ID={};
+ZmFolder.HIDE_ID[ZmOrganizer.ID_CHATS]=true;
+ZmFolder.HIDE_ID[ZmOrganizer.ID_NOTIFICATION_MP]=true;
+ZmFolder.HIDE_NAME={};
+ZmFolder.SYNC_ISSUES="Sync Issues";
+ZmFolder.QUERY_ID={};
+(function(){
+for(var e in ZmFolder.QUERY_NAME){
+ZmFolder.QUERY_ID[ZmFolder.QUERY_NAME[e]]=e
+}}
+)();
+ZmFolder.sortCompare=function(a,t){
+var e=ZmOrganizer.checkSortArgs(a,t);
+if(e!=null){
+return e
+}
+if(appCtxt.isOffline){
+if(a.isDataSource(ZmAccount.TYPE_POP)){
+if(a.id==ZmFolder.ID_INBOX){
+return -1
+}
+if(t.isDataSource(ZmAccount.TYPE_POP)){
+if(a.name.toLowerCase()>t.name.toLowerCase()){
+return 1
+}
+if(a.name.toLowerCase()<t.name.toLowerCase()){
+return -1
+}
+return 0
+}
+return -1
+}else{
+if(t.isDataSource(ZmAccount.TYPE_POP)){
+return 1
+}}}
+if(ZmFolder.SORT_ORDER[a.nId]&&ZmFolder.SORT_ORDER[t.nId]){
+return(ZmFolder.SORT_ORDER[a.nId]-ZmFolder.SORT_ORDER[t.nId])
+}
+if(!ZmFolder.SORT_ORDER[a.nId]&&ZmFolder.SORT_ORDER[t.nId]){
+return 1
+}
+if(ZmFolder.SORT_ORDER[a.nId]&&!ZmFolder.SORT_ORDER[t.nId]){
+return -1
+}
+if(a.name.toLowerCase()>t.name.toLowerCase()){
+return 1
+}
+if(a.name.toLowerCase()<t.name.toLowerCase()){
+return -1
+}
+return 0
+};
+ZmFolder.sortComparePath=function(n,o){
+var a=n&&n.getPath(false,false,null,true,true);
+var t=o&&o.getPath(false,false,null,true,true);
+var e=ZmOrganizer.checkSortArgs(a,t);
+if(e!=null){
+return e
+}
+if(ZmFolder.SORT_ORDER[n.nId]&&ZmFolder.SORT_ORDER[o.nId]){
+return(ZmFolder.SORT_ORDER[n.nId]-ZmFolder.SORT_ORDER[o.nId])
+}
+if(!ZmFolder.SORT_ORDER[n.nId]&&ZmFolder.SORT_ORDER[o.nId]){
+return 1
+}
+if(ZmFolder.SORT_ORDER[n.nId]&&!ZmFolder.SORT_ORDER[o.nId]){
+return -1
+}
+if(a.toLowerCase()>t.toLowerCase()){
+return 1
+}
+if(a.toLowerCase()<t.toLowerCase()){
+return -1
+}
+return 0
+};
+ZmFolder.checkName=function(a,o){
+var t=ZmOrganizer.checkName(a);
+if(t){
+return t
+}
+o=o||appCtxt.getFolderTree().root;
+if(o&&(o.id==ZmFolder.ID_ROOT)){
+var e=a.toLowerCase();
+for(var s in ZmFolder.MSG_KEY){
+var n=ZmMsg[ZmFolder.MSG_KEY[s]];
+if(n&&(e==n.toLowerCase())){
+return ZmMsg.folderNameReserved
+}}
+if(e==ZmFolder.SYNC_ISSUES.toLowerCase()){
+return ZmMsg.folderNameReserved
+}}
+return null
+};
+ZmFolder.getIdForName=function(a){
+var e=a.toLowerCase();
+for(var t in ZmFolder.MSG_KEY){
+if(ZmFolder.MSG_KEY[t]==e){
+return t
+}}
+return null
+};
+ZmFolder.prototype.toString=function(){
+return"ZmFolder"
+};
+ZmFolder.prototype.move=function(a){
+var t=this.name;
+var e=this.name;
+while(a.hasChild(e)){
+e=e+"_"
+}
+if(t!=e){
+this.rename(e)
+}
+ZmOrganizer.prototype.move.call(this,a)
+};
+ZmFolder.prototype.toggleSyncOffline=function(s,e){
+if(!this.isOfflineSyncable){
+return
+}
+var n=this.isOfflineSyncing?"!syncon":"syncon";
+var a=AjxSoapDoc.create("FolderActionRequest","urn:zimbraMail");
+var t=a.set("action");
+t.setAttribute("op",n);
+t.setAttribute("id",this.id);
+var o={
+soapDoc:a,asyncMode:true,callback:s,errorCallback:e};
+appCtxt.getAppController().sendRequest(o)
+};
+ZmFolder.prototype.hasFeeds=function(){
+if(this.type!=ZmOrganizer.FOLDER){
+return false
+}
+var e=this.children.getArray();
+var o=this.children.size();
+for(var t=0;
+t<o;
+t++){
+if(e[t].isFeed()){
+return true
+}
+if(e[t].children&&e[t].children.size()>0){
+return(e[t].hasFeeds&&e[t].hasFeeds())
+}}
+return false
+};
+ZmFolder.prototype.hasSearch=function(n){
+if(this.type==ZmOrganizer.SEARCH){
+return true
+}
+var e=this.children.getArray();
+var o=this.children.size();
+for(var t=0;
+t<o;
+t++){
+if(e[t].hasSearch()){
+return true
+}}
+return false
+};
+ZmFolder.prototype.supportsPublicAccess=function(){
+return false
+};
+ZmFolder.prototype.notifyCreate=function(h,t,o){
+var e=ZmOrganizer.normalizeId(h.id);
+if(e<ZmOrganizer.FIRST_USER_ID[this.type]){
+return
+}
+var r=ZmOrganizer.parseId(h.id).account;
+var n=t?"search":"folder";
+var s=ZmFolderTree.createFromJs(this,h,this.tree,n,null,r);
+var a=ZmOrganizer.getSortIndex(s,ZmFolder.sortCompare);
+this.children.add(s,a);
+if(!o){
+s._notify(ZmEvent.E_CREATE)
+}};
+ZmFolder.prototype.notifyModify=function(obj){
+var details={};
+var fields={};
+var doNotify=false;
+if(obj.name!=null&&this.name!=obj.name&&obj.id==this.id){
+details.oldPath=this.getPath();
+this.name=obj.name;
+fields[ZmOrganizer.F_NAME]=true;
+this.parent.children.sort(eval(ZmTreeView.COMPARE_FUNC[this.type]));
+doNotify=true;
+obj.name=null
+}
+if(doNotify){
+details.fields=fields;
+this._notify(ZmEvent.E_MODIFY,details)
+}
+if(obj.l!=null&&(!this.parent||(obj.l!=this.parent.id))){
+var newParent=this._getNewParent(obj.l);
+if(newParent){
+details.oldPath=this.getPath();
+this.reparent(newParent);
+this._notify(ZmEvent.E_MOVE,details);
+obj.l=null
+}}
+ZmOrganizer.prototype.notifyModify.apply(this,[obj])
+};
+ZmFolder.prototype.createQuery=function(t){
+if(!this.isRemote()&&this.isSystem()){
+var o=ZmFolder.QUERY_NAME[this.nId];
+return t?o:('in:"'+(o||this.name)+'"')
+}
+var n=this.name;
+var a=this.parent;
+while(a&&(a.nId!=ZmFolder.ID_ROOT)&&a.name.length){
+var e=a.isSystem()?ZmFolder.QUERY_NAME[a.nId]:a.name;
+n=e+"/"+n;
+a=a.parent
+}
+n='"'+n+'"';
+return t?n:("in:"+n)
+};
+ZmFolder.prototype.getName=function(s,t,n,e){
+if(this.nId==ZmFolder.ID_DRAFTS||this.nId==ZmFolder.ID_OUTBOX){
+var o=(appCtxt.isOffline&&this.account.isMain)?appCtxt.accountList.getItemCount(this.nId):this.numTotal;
+var a=(e&&this._systemName)?this._systemName:this.name;
+if(s&&o>0){
+a=[a," (",o,")"].join("");
+if(!n){
+a=["<span style='font-weight:bold'>",a,"</span>"].join("")
+}}
+return a
+}else{
+return ZmOrganizer.prototype.getName.apply(this,arguments)
+}};
+ZmFolder.prototype.getIcon=function(){
+if(this.nId==ZmOrganizer.ID_ROOT){
+return null
+}
+if(ZmFolder.ICON[this.nId]){
+return ZmFolder.ICON[this.nId]
+}
+if(this.isFeed()){
+return"RSS"
+}
+if(this.isRemote()){
+return"SharedMailFolder"
+}
+if(this.isDataSource(ZmAccount.TYPE_POP)){
+return"POPAccount"
+}
+if(this.parent&&this.parent.isDataSource(ZmAccount.TYPE_IMAP)){
+var e=ZmFolder.getIdForName(this.name);
+if(e){
+return ZmFolder.ICON[e]||"Folder"
+}}
+return"Folder"
+};
+ZmFolder.prototype.mayContain=function(s,h){
+if(!s){
+return true
+}
+if(this.isFeed()){
+return false
+}
+if(this.isSyncIssuesFolder()){
+return false
+}
+var r=h||this.type;
+var o=false;
+if(s instanceof ZmFolder){
+o=(s.parent==this||this.isChildOf(s)||this.nId==ZmFolder.ID_DRAFTS||this.nId==ZmFolder.ID_SPAM||(!this.isInTrash()&&this.hasChild(s.name))||(s.type==ZmOrganizer.FOLDER&&r==ZmOrganizer.SEARCH)||(s.type==ZmOrganizer.SEARCH&&r==ZmOrganizer.FOLDER&&this.nId==ZmOrganizer.ID_ROOT)||(s.id==this.id)||(s.disallowSubFolder)||(s.account!=this.account)||(s.isRemote()&&!this._remoteMoveOk(s)))
+}else{
+var n=(s instanceof Array)?s:[s];
+var l=n[0];
+if(this.nId==ZmOrganizer.ID_ROOT||this.nId==ZmOrganizer.ID_OUTBOX||this.nId==ZmOrganizer.ID_SYNC_FAILURES){
+o=true
+}else{
+if(r==ZmOrganizer.SEARCH){
+o=true
+}else{
+if((l.type==ZmItem.CONTACT)&&l.isGal){
+o=true
+}else{
+if((l.type==ZmItem.CONV)&&l.list&&l.list.search&&(l.list.search.folderId==this.id)){
+o=true
+}else{
+for(var t=0;
+t<n.length;
+t++){
+if(n[t].type==ZmItem.CONTACT){
+if(this.nId!=ZmFolder.ID_TRASH){
+o=true;
+break
+}else{
+if(n[t].isMyCard){
+o=true;
+break
+}}}else{
+if(n[t].isDraft&&(this.nId!=ZmFolder.ID_TRASH&&this.nId!=ZmFolder.ID_DRAFTS)){
+o=true;
+break
+}else{
+if(this.nId==ZmFolder.ID_DRAFTS&&!n[t].isDraft){
+o=true;
+break
+}}}}
+if(appCtxt.isOffline&&!o){
+if(l.account!=this.account&&this.account.type==ZmAccount.TYPE_MSE){
+o=true
+}else{
+var a=appCtxt.getCurrentSearch();
+var e=a&&appCtxt.getById(a.folderId);
+if(e&&e.nId==ZmOrganizer.ID_SYNC_FAILURES){
+o=true
+}}}
+if(!o){
+if(l.folderId){
+o=true;
+for(var t=0;
+t<n.length;
+t++){
+if(n[t].folderId!=this.id){
+o=false;
+break
+}}}}}}}}
+if(!o&&this.link){
+o=this.isReadOnly()
+}}
+return !o
+};
+ZmFolder.prototype.isSyncIssuesFolder=function(){
+return(this.name==ZmFolder.SYNC_ISSUES)
+};
+ZmFolder.prototype.isHardDelete=function(){
+return(this.isInTrash()||this.isInSpam()||(appCtxt.isOffline&&this.isUnder(ZmOrganizer.ID_SYNC_FAILURES)))
+};
+ZmFolder.prototype.isInSpam=function(){
+return this.isUnder(ZmFolder.ID_SPAM)
+};
+ZmFolder.prototype._remoteMoveOk=function(t){
+if(!this.link||!t.link||this.zid!=t.zid){
+return false
+}
+if(this.id.split(":")[0]!=t.id.split(":")[0]){
+return false
+}
+var e=this.shares&&this.shares[0];
+if(!(e&&e.isInsert())){
+return false
+}
+e=t.shares&&t.shares[0];
+return(e&&e.isDelete())
+}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmSearchFolder")){
+ZmSearchFolder=function(t){
+t.type=ZmOrganizer.SEARCH;
+ZmFolder.call(this,t);
+if(t.query){
+var e={
+query:t.query,types:t.types,sortBy:t.sortBy,searchId:t.id,accountName:(t.account&&t.account.name)};
+this.search=new ZmSearch(e)
+}};
+ZmSearchFolder.ID_ROOT=ZmOrganizer.ID_ROOT;
+ZmSearchFolder.create=function(h){
+var r=AjxSoapDoc.create("CreateSearchFolderRequest","urn:zimbraMail");
+var s=r.set("search");
+s.setAttribute("name",h.name);
+s.setAttribute("query",h.search.query);
+if(h.search.types){
+var t=h.search.types.getArray();
+if(t.length){
+var e=[];
+for(var n=0;
+n<t.length;
+n++){
+e.push(ZmSearch.TYPE[t[n]])
+}
+s.setAttribute("types",e.join(","))
+}}
+if(h.search.sortBy){
+s.setAttribute("sortBy",h.search.sortBy)
+}
+var o;
+if(h.isGlobal){
+s.setAttribute("f","g");
+o=appCtxt.accountList.mainAccount.name
+}
+s.setAttribute("l",h.parent.id);
+appCtxt.getAppController().sendRequest({
+soapDoc:r,asyncMode:true,accountName:o,errorCallback:(new AjxCallback(null,ZmOrganizer._handleErrorCreate,h))}
+)
+};
+ZmSearchFolder.prototype=new ZmFolder;
+ZmSearchFolder.prototype.constructor=ZmSearchFolder;
+ZmSearchFolder.prototype.toString=function(){
+return"ZmSearchFolder"
+};
+ZmSearchFolder.prototype.getIcon=function(){
+return(this.nId==ZmOrganizer.ID_ROOT)?null:(this.isOfflineGlobalSearch?"GlobalSearchFolder":"SearchFolder")
+};
+ZmSearchFolder.prototype.getToolTip=function(){};
+ZmSearchFolder.prototype._getNewParent=function(t){
+var e=appCtxt.getById(t);
+if(e){
+return e
+}
+return appCtxt.getById(t)
+}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmSearch")){
+ZmSearch=function(t){
+if(t){
+for(var e in t){
+this[e]=t[e]
+}
+this.galType=this.galType||ZmSearch.GAL_ACCOUNT;
+this.join=this.join||ZmSearch.JOIN_AND;
+if(this.query){
+this._parseQuery()
+}}
+this.isGalSearch=false;
+this.isCalResSearch=false;
+if(ZmSearch._mailEnabled==null){
+ZmSearch._mailEnabled=appCtxt.get(ZmSetting.MAIL_ENABLED);
+if(ZmSearch._mailEnabled){
+AjxDispatcher.require("MailCore")
+}}};
+ZmSearch.TYPE={};
+ZmSearch.TYPE_ANY="any";
+ZmSearch.GAL_ACCOUNT="account";
+ZmSearch.GAL_RESOURCE="resource";
+ZmSearch.GAL_ALL="";
+ZmSearch.JOIN_AND=1;
+ZmSearch.JOIN_OR=2;
+ZmSearch.TYPE_MAP={};
+ZmSearch.DEFAULT_LIMIT=DwtListView.DEFAULT_LIMIT;
+ZmSearch.DATE_DESC="dateDesc";
+ZmSearch.DATE_ASC="dateAsc";
+ZmSearch.SUBJ_DESC="subjDesc";
+ZmSearch.SUBJ_ASC="subjAsc";
+ZmSearch.NAME_DESC="nameDesc";
+ZmSearch.NAME_ASC="nameAsc";
+ZmSearch.SIZE_DESC="sizeDesc";
+ZmSearch.SIZE_ASC="sizeAsc";
+ZmSearch.SCORE_DESC="scoreDesc";
+ZmSearch.DURATION_DESC="durDesc";
+ZmSearch.DURATION_ASC="durAsc";
+ZmSearch.STATUS_DESC="taskStatusDesc";
+ZmSearch.STATUS_ASC="taskStatusAsc";
+ZmSearch.PCOMPLETE_DESC="taskPercCompletedDesc";
+ZmSearch.PCOMPLETE_ASC="taskPercCompletedAsc";
+ZmSearch.DUE_DATE_DESC="taskDueDesc";
+ZmSearch.DUE_DATE_ASC="taskDueAsc";
+ZmSearch.UNREAD_QUERY_RE=new RegExp("\\bis:\\s*(un)?read\\b","i");
+ZmSearch.IS_ANYWHERE_QUERY_RE=new RegExp("\\bis:\\s*anywhere\\b","i");
+ZmSearch.prototype.toString=function(){
+return"ZmSearch"
+};
+ZmSearch.prototype.execute=function(e){
+if(e.batchCmd||this.soapInfo){
+this._executeSoap(e)
+}else{
+this._executeJson(e)
+}};
+ZmSearch.prototype._executeSoap=function(s){
+this.isGalSearch=(this.contactSource&&(this.contactSource==ZmId.SEARCH_GAL));
+this.isCalResSearch=(this.conds!=null);
+if(!this.query&&!this.isCalResSearch){
+return
+}
+var p;
+if(!this.response){
+if(this.isGalSearch){
+p=AjxSoapDoc.create("SearchGalRequest","urn:zimbraAccount");
+var e=p.getMethod();
+if(this.galType){
+e.setAttribute("type",this.galType)
+}
+p.set("name",this.query)
+}else{
+if(this.isAutocompleteSearch){
+p=AjxSoapDoc.create("AutoCompleteRequest","urn:zimbraMail");
+var e=p.getMethod();
+if(this.limit){
+e.setAttribute("limit",this.limit)
+}
+p.set("name",this.query)
+}else{
+if(this.isGalAutocompleteSearch){
+p=AjxSoapDoc.create("AutoCompleteGalRequest","urn:zimbraAccount");
+var e=p.getMethod();
+e.setAttribute("limit",this._getLimit());
+if(this.galType){
+e.setAttribute("type",this.galType)
+}
+p.set("name",this.query)
+}else{
+if(this.isCalResSearch){
+p=AjxSoapDoc.create("SearchCalendarResourcesRequest","urn:zimbraAccount");
+var e=p.getMethod();
+if(this.attrs){
+e.setAttribute("attrs",this.attrs.join(","))
+}
+var l=p.set("searchFilter");
+if(this.conds&&this.conds.length){
+var h=p.set("conds",null,l);
+if(this.join==ZmSearch.JOIN_OR){
+h.setAttribute("or",1)
+}
+for(var r=0;
+r<this.conds.length;
+r++){
+var u=this.conds[r];
+var t=p.set("cond",null,h);
+t.setAttribute("attr",u.attr);
+t.setAttribute("op",u.op);
+t.setAttribute("value",u.value)
+}}}else{
+if(this.soapInfo){
+p=AjxSoapDoc.create(this.soapInfo.method,this.soapInfo.namespace);
+for(var f in this.soapInfo.additional){
+var n=p.set(f);
+var g=this.soapInfo.additional[f];
+for(var c in g){
+n.setAttribute(c,g[c])
+}}}else{
+p=AjxSoapDoc.create("SearchRequest","urn:zimbraMail")
+}
+var e=this._getStandardMethod(p);
+if(this.types){
+var m=this.types.getArray();
+if(m.length){
+var d=[];
+for(var r=0;
+r<m.length;
+r++){
+d.push(ZmSearch.TYPE[m[r]])
+}
+e.setAttribute("types",d.join(","));
+var o=appCtxt.getById(this.folderId);
+if(o&&(o.isUnder(ZmFolder.ID_SENT)||o.isUnder(ZmFolder.ID_DRAFTS)||o.isUnder(ZmFolder.ID_OUTBOX))){
+e.setAttribute("recip","1")
+}
+if(this.fetch){
+e.setAttribute("fetch",(this.fetch=="all")?"all":"1");
+if(this.getHtml){
+e.setAttribute("html","1")
+}}
+if(this.markRead){
+e.setAttribute("read","1")
+}}}}}}}}
+var y=new AjxCallback(this,this._handleResponseExecute,[s.callback]);
+if(s.batchCmd){
+s.batchCmd.addRequestParams(p,y)
+}else{
+return appCtxt.getAppController().sendRequest({
+soapDoc:p,asyncMode:true,callback:y,errorCallback:s.errorCallback,timeout:s.timeout,noBusyOverlay:s.noBusyOverlay,response:this.response}
+)
+}};
+ZmSearch.prototype._executeJson=function(y){
+this.isGalSearch=(this.contactSource&&(this.contactSource==ZmId.SEARCH_GAL));
+this.isCalResSearch=(this.conds!=null);
+if(!this.query&&!this.queryHint&&!this.isCalResSearch){
+return
+}
+var w,s,v;
+if(!this.response){
+if(this.isGalSearch){
+w={
+SearchGalRequest:{
+_jsns:"urn:zimbraAccount"}};
+s=w.SearchGalRequest;
+if(this.galType){
+s.type=this.galType
+}
+s.name=this.query;
+s.offset=this.offset=(this.offset||0);
+s.limit=this._getLimit();
+if(this.lastId){
+s.cursor={
+id:this.lastId,sortVal:(this.lastSortVal||"")}
+}
+if(this.sortBy){
+s.sortBy=this.sortBy
+}}else{
+if(this.isAutocompleteSearch){
+w={
+AutoCompleteRequest:{
+_jsns:"urn:zimbraMail"}};
+s=w.AutoCompleteRequest;
+if(this.limit){
+s.limit=this.limit
+}
+s.name={
+_content:this.query}
+}else{
+if(this.isGalAutocompleteSearch){
+w={
+AutoCompleteGalRequest:{
+_jsns:"urn:zimbraAccount"}};
+s=w.AutoCompleteGalRequest;
+s.limit=this._getLimit();
+s.name=this.query;
+if(this.galType){
+s.type=this.galType
+}}else{
+if(this.isCalResSearch){
+w={
+SearchCalendarResourcesRequest:{
+_jsns:"urn:zimbraAccount"}};
+s=w.SearchCalendarResourcesRequest;
+if(this.attrs){
+s.attrs=this.attrs.join(",")
+}
+if(this.conds&&this.conds.length){
+s.searchFilter={
+conds:{}};
+var t=s.searchFilter.conds;
+var l=t.cond=[];
+if(this.join==ZmSearch.JOIN_OR){
+t.or=1
+}
+for(var p=0;
+p<this.conds.length;
+p++){
+var g=this.conds[p];
+l.push({
+attr:g.attr,op:g.op,value:g.value}
+)
+}}}else{
+if(this.soapInfo){
+v=AjxSoapDoc.create(this.soapInfo.method,this.soapInfo.namespace);
+for(var e in this.soapInfo.additional){
+var f=v.set(e);
+var u=this.soapInfo.additional[e];
+for(var m in u){
+f.setAttribute(m,u[m])
+}}}else{
+w={
+SearchRequest:{
+_jsns:"urn:zimbraMail"}};
+s=w.SearchRequest
+}
+this._getStandardMethodJson(s);
+if(this.types){
+var b=this.types.getArray();
+if(b.length){
+var d=[];
+for(var p=0;
+p<b.length;
+p++){
+d.push(ZmSearch.TYPE[b[p]])
+}
+s.types=d.join(",");
+var h=appCtxt.getById(this.folderId);
+if(h&&(h.isUnder(ZmFolder.ID_SENT)||h.isUnder(ZmFolder.ID_DRAFTS)||h.isUnder(ZmFolder.ID_OUTBOX))){
+s.recip=1
+}
+if(this.fetch){
+s.fetch=(this.fetch=="all")?"all":1;
+if(this.getHtml){
+s.html=1
+}}
+if(this.markRead){
+s.read=1
+}
+if(this.headers){
+for(var o in this.headers){
+if(!s.header){
+s.header=[]
+}
+s.header.push({
+n:o}
+)
+}}
+if(b.length==1&&b[0]==ZmItem.TASK&&this.allowableTaskStatus){
+s.allowableTaskStatus=this.allowableTaskStatus
+}}}}}}}}
+var n=new AjxCallback(this,this._handleResponseExecute,[y.callback]);
+if(y.batchCmd){
+y.batchCmd.addRequestParams(v,n)
+}else{
+var r={
+jsonObj:w,soapDoc:v,asyncMode:true,callback:n,errorCallback:y.errorCallback,timeout:y.timeout,noBusyOverlay:y.noBusyOverlay,response:this.response,accountName:this.accountName};
+return appCtxt.getAppController().sendRequest(r)
+}};
+ZmSearch.prototype._handleResponseExecute=function(o,t){
+var a=t.getResponse();
+if(this.isGalSearch){
+a=a.SearchGalResponse
+}else{
+if(this.isCalResSearch){
+a=a.SearchCalendarResourcesResponse
+}else{
+if(this.isAutocompleteSearch){
+a=a.AutoCompleteResponse
+}else{
+if(this.isGalAutocompleteSearch){
+a=a.AutoCompleteGalResponse
+}else{
+if(this.soapInfo){
+a=a[this.soapInfo.response]
+}else{
+a=a.SearchResponse
+}}}}}
+var e=new ZmSearchResult(this);
+e.set(a);
+t.set(e);
+if(o){
+o.run(t)
+}};
+ZmSearch.prototype.getConv=function(a){
+if((!this.query&&!this.queryHint)||!a.cid){
+return
+}
+var n={
+SearchConvRequest:{
+_jsns:"urn:zimbraMail"}};
+var e=n.SearchConvRequest;
+this._getStandardMethodJson(e);
+e.cid=a.cid;
+if(a.fetchId){
+e.fetch=a.fetchId;
+if(a.markRead){
+e.read=1
+}
+if(this.getHtml){
+e.html=1
+}
+if(ZmMailMsg.requestHeaders){
+for(var o in ZmMailMsg.requestHeaders){
+if(!e.header){
+e.header=[]
+}
+e.header.push({
+n:o}
+)
+}}}
+if(!a.noTruncate){
+e.max=appCtxt.get(ZmSetting.MAX_MESSAGE_SIZE)
+}
+var t={
+jsonObj:n,asyncMode:true,callback:(new AjxCallback(this,this._handleResponseGetConv,a.callback)),accountName:this.accountName};
+appCtxt.getAppController().sendRequest(t)
+};
+ZmSearch.prototype._handleResponseGetConv=function(o,t){
+var a=t.getResponse().SearchConvResponse;
+var e=new ZmSearchResult(this);
+e.set(a,null,true);
+t.set(e);
+if(o){
+o.run(t)
+}};
+ZmSearch.prototype.getTitle=function(){
+var e;
+if(this.folderId){
+var a=ZmOrganizer.getSystemId(this.folderId);
+var t=appCtxt.getById(a);
+if(t){
+e=t.getName(true,ZmOrganizer.MAX_DISPLAY_NAME_LENGTH,true)
+}}else{
+if(this.tagId){
+e=appCtxt.getById(this.tagId).getName(true,ZmOrganizer.MAX_DISPLAY_NAME_LENGTH,true)
+}}
+return e?([ZmMsg.zimbraTitle,e].join(": ")):([ZmMsg.zimbraTitle,ZmMsg.searchResults].join(": "))
+};
+ZmSearch.prototype._getStandardMethod=function(t){
+var s=t.getMethod();
+if(this.sortBy){
+s.setAttribute("sortBy",this.sortBy)
+}
+if(ZmSearch._mailEnabled){
+var e;
+for(var n in ZmMailMsg.requestHeaders){
+e=t.set("header",null,null);
+e.setAttribute("n",n)
+}}
+ZmTimezone.set(t,AjxTimezone.DEFAULT,null);
+t.set("locale",appCtxt.get(ZmSetting.LOCALE_NAME),null);
+if(this.lastId!=null&&this.lastSortVal){
+var o=t.set("cursor");
+o.setAttribute("id",this.lastId);
+o.setAttribute("sortVal",this.lastSortVal);
+if(this.endSortVal){
+o.setAttribute("endSortVal",this.endSortVal)
+}}
+this.offset=this.offset||0;
+s.setAttribute("offset",this.offset);
+s.setAttribute("limit",this._getLimit());
+var a=(this.queryHint)?([this.query," (",this.queryHint,")"].join("")):this.query;
+t.set("query",a);
+if(this.field){
+s.setAttribute("field",this.field)
+}
+return s
+};
+ZmSearch.prototype._getStandardMethodJson=function(t){
+if(this.sortBy){
+t.sortBy=this.sortBy
+}
+if(ZmSearch._mailEnabled){
+var e=ZmMailMsg.requestHeaders;
+if(e&&e.length){
+t.header=[];
+for(var a in e){
+t.header.push({
+n:a}
+)
+}}}
+ZmTimezone.set(t,AjxTimezone.DEFAULT);
+t.locale={
+_content:AjxEnv.DEFAULT_LOCALE};
+if(this.lastId!=null&&this.lastSortVal){
+t.cursor={
+id:this.lastId,sortVal:this.lastSortVal};
+if(this.endSortVal){
+t.cursor.endSortVal=this.endSortVal
+}}
+t.offset=this.offset=this.offset||0;
+t.limit=this._getLimit();
+t.query=(this.queryHint)?([this.query," (",this.queryHint,")"].join("")):this.query;
+if(this.field){
+t.field=this.field
+}};
+ZmSearch.prototype._getLimit=function(){
+if(this.limit){
+return this.limit
+}
+var e;
+if(this.isGalAutocompleteSearch){
+e=appCtxt.get(ZmSetting.AUTOCOMPLETE_LIMIT)
+}else{
+var t=this.types&&this.types.get(0);
+var a=appCtxt.getApp(ZmItem.APP[t]);
+if(a&&a.getLimit){
+e=a.getLimit(this.offset)
+}else{
+e=appCtxt.get(ZmSetting.PAGE_SIZE)||ZmSearch.DEFAULT_LIMIT
+}}
+this.limit=e;
+return e
+};
+ZmSearch.IS_OP={
+"in":true,inid:true,is:true,tag:true};
+ZmSearch.COND={
+and:" && ",or:" || ",not:" !"};
+ZmSearch.EOW={
+" ":true,":":true,"(":true,")":true};
+ZmSearch.FLAG={};
+ZmSearch.FLAG.unread="item.isUnread";
+ZmSearch.FLAG.read="!item.isUnread";
+ZmSearch.FLAG.flagged="item.isFlagged";
+ZmSearch.FLAG.unflagged="!item.isFlagged";
+ZmSearch.FLAG.forwarded="item.isForwarded";
+ZmSearch.FLAG.unforwarded="!item.isForwarded";
+ZmSearch.FLAG.sent="item.isSent";
+ZmSearch.FLAG.replied="item.isReplied";
+ZmSearch.FLAG.unreplied="!item.isReplied";
+ZmSearch.prototype._parseQuery=function(){
+this.hasUnreadTerm=ZmSearch.UNREAD_QUERY_RE.test(this.query);
+this.isAnywhere=ZmSearch.IS_ANYWHERE_QUERY_RE.test(this.query);
+function l(t,x){
+while(x<t.length&&t.charAt(x)==" "){
+x++
+}
+return x
+}
+function n(T,O){
+var z=T.charAt(O);
+O++;
+var t=false,j,x="";
+while(O<T.length&&!t){
+j=T.charAt(O);
+if(j==z){
+t=true
+}else{
+x+=j;
+O++
+}}
+return t?{
+str:x,pos:O+1}
+:null
+}
+var a=this.query;
+var b=this.query.length;
+var m=[],d,c,w="",r=false,e=false;
+var s=l(a,0);
+while(s<b&&!r){
+d=a.charAt(s);
+e=ZmSearch.EOW[d];
+if(d==":"){
+if(ZmSearch.IS_OP[w]){
+c=w;
+w="";
+s=l(a,s+1);
+continue
+}else{
+r=true
+}}
+if(e){
+if(c&&w){
+m.push({
+isTerm:true,op:c,arg:w}
+);
+c=w=""
+}else{
+if(!c){
+if(ZmSearch.COND[w.toLowerCase()]){
+m.push(ZmSearch.COND[w.toLowerCase()]);
+w=""
+}else{
+if(w){
+r=true
+}}}}}
+if(d=="'"||d=='"'){
+var g=n(a,s);
+if(g){
+w=g.str;
+s=g.pos
+}else{
+r=true
+}}else{
+if(d=="("||d==")"){
+m.push(d);
+s=l(a,s+1)
+}else{
+if(d=="-"&&!w){
+m.push("not");
+s=l(a,s+1)
+}else{
+if(d!=" "){
+w+=d
+}
+s++
+}}}}
+if(r){
+return
+}
+if((s==a.length)&&c&&w){
+m.push({
+isTerm:true,op:c,arg:w}
+)
+}else{
+return
+}
+var h=0,f;
+var o=["return Boolean("];
+for(var y=0,b=m.length;
+y<b;
+y++){
+var u=m[y];
+if(u.isTerm){
+if(u.op=="in"||u.op=="inid"){
+f=(u.op=="in")?this._getFolderId(u.arg):u.arg;
+if(!f){
+return
+}
+o.push("((item.type == ZmItem.CONV) ? item.folders && item.folders['"+f+"'] : item.folderId == '"+f+"')")
+}else{
+if(u.op=="tag"){
+f=this._getTagId(u.arg);
+if(!f){
+return
+}
+o.push("item.hasTag('"+f+"')")
+}else{
+if(u.op=="is"){
+var k=ZmSearch.FLAG[u.arg];
+if(!k){
+return
+}
+o.push(k)
+}}}
+h++;
+var p=m[y+1];
+if(p&&(p.isTerm||p==ZmSearch.COND.not||p=="(")){
+o.push(ZmSearch.COND.and)
+}}else{
+o.push(u)
+}}
+o.push(")");
+try{
+this.matches=new Function("item",o.join(""))
+}
+catch(v){}
+if(h==1){
+var u=m[0];
+if(u.op=="in"||u.op=="inid"){
+this.folderId=f
+}else{
+if(u.op=="tag"){
+this.tagId=f
+}}}};
+ZmSearch.prototype._getFolderId=function(r){
+var e=ZmFolder.QUERY_ID[r];
+var t=this.accountName;
+if(!t){
+var s=appCtxt.getActiveAccount();
+t=s?s.name:appCtxt.accountList.mainAccount
+}
+if(!e){
+var n=t&&appCtxt.accountList.getAccountByName(t);
+var a=appCtxt.getFolderTree(n);
+var o=a?a.getByPath(r,true):null;
+if(o){
+e=o.id
+}}
+if(t){
+e=ZmOrganizer.getSystemId(e,appCtxt.accountList.getAccountByName(t))
+}
+return e
+};
+ZmSearch.prototype._getTagId=function(a){
+var t=appCtxt.getTagTree();
+if(t){
+var e=t.getByName(a.toLowerCase());
+if(e){
+return e.id
+}}};
+ZmSearch.prototype.hasFolderTerm=function(t){
+if(!t){
+return false
+}
+var e=new RegExp('\\s*in:\\s*"?('+AjxStringUtil.regExEscape(t)+')"?\\s*',"i");
+var a=new RegExp('(-|not)\\s*in:\\s*"?('+AjxStringUtil.regExEscape(t)+')"?\\s*',"i");
+return(e.test(this.query)&&!a.test(this.query))
+};
+ZmSearch.prototype.replaceFolderTerm=function(a,e){
+if(!(a&&e)){
+return
+}
+var t=new RegExp('(\\s*in:\\s*"?)('+AjxStringUtil.regExEscape(a)+')("?\\s*)',"gi");
+this.query=this.query.replace(t,"$1"+e+"$3")
+};
+ZmSearch.prototype.hasTagTerm=function(e){
+if(!e){
+return false
+}
+var t=new RegExp('\\s*tag:\\s*"?('+AjxStringUtil.regExEscape(e)+')"?\\s*',"i");
+var a=new RegExp('(-|not)\\s*tag:\\s*"?('+AjxStringUtil.regExEscape(e)+')"?\\s*',"i");
+return(t.test(this.query)&&!a.test(this.query))
+};
+ZmSearch.prototype.replaceTagTerm=function(t,e){
+if(!(t&&e)){
+return
+}
+var a=new RegExp('(\\s*tag:\\s*"?)('+AjxStringUtil.regExEscape(t)+')("?\\s*)',"gi");
+this.query=this.query.replace(a,"$1"+e+"$3")
+}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmSearchResult")){
+ZmSearchResult=function(e){
+if(!e){
+return
+}
+this._results={};
+this.search=e
+};
+ZmSearchResult.prototype.toString=function(){
+return"ZmSearchResult"
+};
+ZmSearchResult.prototype.dtor=function(){
+for(var e in this._results){
+if(this._results[e].clear){
+this._results[e].clear();
+this._results[e]=null
+}}
+this._results=null
+};
+ZmSearchResult.prototype.getResults=function(n){
+n=n||this.type;
+if(!this._results){
+return ZmItem.RESULTS_LIST[n](this.search)
+}
+if(n==ZmItem.MIXED){
+var s=new ZmMailList(ZmItem.MIXED,this.search);
+for(var n in this._results){
+var o=this._results[n];
+if(o&&o.size()){
+var e=o.getArray();
+for(var t=0;
+t<e.length;
+t++){
+s.add(e[t])
+}}}
+return s
+}else{
+return this._results[n]?this._results[n]:ZmItem.RESULTS_LIST[n](this.search)
+}};
+ZmSearchResult.prototype.getAttribute=function(e){
+return this._respEl?this._respEl[e]:null
+};
+ZmSearchResult.prototype.set=function(u){
+if(!this.search){
+return
+}
+this._respEl=u;
+if(this.search.isAutocompleteSearch){
+return
+}
+var m={};
+var l=0;
+var r,o;
+var f=this.search.isGalSearch;
+var h=new Date();
+var s=0;
+if(f||this.search.isCalResSearch){
+r=o=f?ZmItem.CONTACT:ZmItem.RESOURCE;
+var a=f?u.cn:u.calresource;
+if(a){
+if(!this._results[r]){
+this._results[r]=ZmItem.RESULTS_LIST[r](this.search)
+}
+for(var e=0;
+e<a.length;
+e++){
+this._results[r].addFromDom(a[e])
+}
+if(f){
+this._results[r].getArray().sort(ZmSearchResult._sortGalResults)
+}
+s=a.length
+}}else{
+var n=this.search.types.getArray();
+o=n[0];
+for(var t=0;
+t<n.length;
+t++){
+var c=n[t];
+var a=u[ZmList.NODE[c]];
+if(!a&&(c=="MSG")){
+a=u.chat
+}
+if(a&&a.length){
+s+=a.length;
+if(!this._results[c]){
+this._results[c]=ZmItem.RESULTS_LIST[c](this.search)
+}
+for(var e=0;
+e<a.length;
+e++){
+var p=a[e];
+p._type=c;
+this._results[c].addFromDom(p)
+}
+if(!m[c]){
+m[c]=true;
+l++;
+r=c
+}}}}
+if(!s){
+this._results[o]=ZmItem.RESULTS_LIST[o](this.search)
+}
+if((f||this.search.isGalAutocompleteSearch)&&this._results[ZmItem.CONTACT]){
+this._results[ZmItem.CONTACT].setIsGal(true)
+}
+if(this.search.isGalAutocompleteSearch){
+this.isTokenized=(this._respEl.tokenizeKey!=null)
+}
+var d=new Date();
+if(l<=1){
+this.type=r
+}else{
+if(l==2&&(m[ZmItem.PAGE]||m[ZmItem.DOCUMENT])){
+this.type=ZmItem.PAGE
+}else{
+this.type=appCtxt.get(ZmSetting.MIXED_VIEW_ENABLED)?ZmItem.MIXED:r
+}}
+return this.type
+};
+ZmSearchResult._sortGalResults=function(t,e){
+var o=t.getFileAs().toLowerCase();
+var n=e.getFileAs().toLowerCase();
+return o<n?-1:(o>n?1:0)
+}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmTag")){
+ZmTag=function(t){
+t.type=ZmOrganizer.TAG;
+var e=String(t.rgb).toUpperCase();
+if(t.color==9&&e!="#FF8000"){
+t.color=ZmTag.__OLD_COLORS[e]||ZmOrganizer.DEFAULT_COLOR[t.type]
+}
+ZmOrganizer.call(this,t)
+};
+ZmTag.prototype=new ZmOrganizer;
+ZmTag.prototype.constructor=ZmTag;
+ZmTag.prototype.toString=function(){
+return"ZmTag"
+};
+ZmTag.COLOR_ICON=new Object();
+ZmTag.COLOR_ICON[ZmOrganizer.C_ORANGE]="TagOrange";
+ZmTag.COLOR_ICON[ZmOrganizer.C_BLUE]="TagBlue";
+ZmTag.COLOR_ICON[ZmOrganizer.C_CYAN]="TagCyan";
+ZmTag.COLOR_ICON[ZmOrganizer.C_GREEN]="TagGreen";
+ZmTag.COLOR_ICON[ZmOrganizer.C_PURPLE]="TagPurple";
+ZmTag.COLOR_ICON[ZmOrganizer.C_RED]="TagRed";
+ZmTag.COLOR_ICON[ZmOrganizer.C_YELLOW]="TagYellow";
+ZmTag.ID_ROOT=ZmOrganizer.ID_ROOT;
+ZmTag.ID_UNREAD=32;
+ZmTag.ID_FLAGGED=33;
+ZmTag.ID_FROM_ME=34;
+ZmTag.ID_REPLIED=35;
+ZmTag.ID_FORWARDED=36;
+ZmTag.ID_ATTACHED=37;
+ZmTag.__OLD_COLORS={
+"#000000":0,"#0000FF":1,"#008284":2,"#008200":3,"#840084":4,"#FF0000":5,"#848200":6,"#FF0084":7,"#848284":8,"#FF8000":9};
+ZmTag.createFromJs=function(r,a,h,s,n){
+var e=ZmOrganizer.normalizeId(a.id);
+if(e<ZmOrganizer.FIRST_USER_ID[ZmOrganizer.TAG]){
+return
+}
+var t={
+id:a.id,name:a.name,color:ZmTag.checkColor(a.color),rgb:a.rgb,parent:r,tree:h,numUnread:a.u,account:n};
+var l=new ZmTag(t);
+var o=s?ZmOrganizer.getSortIndex(l,ZmTag.sortCompare):null;
+r.children.add(l,o);
+return l
+};
+ZmTag.sortCompare=function(a,t){
+var e=ZmOrganizer.checkSortArgs(a,t);
+if(e!=null){
+return e
+}
+if(a.name.toLowerCase()>t.name.toLowerCase()){
+return 1
+}
+if(a.name.toLowerCase()<t.name.toLowerCase()){
+return -1
+}
+return 0
+};
+ZmTag.checkName=function(e){
+var t=ZmOrganizer.checkName(e);
+if(t){
+return t
+}
+if(e.indexOf("\\")==0){
+return AjxMessageFormat.format(ZmMsg.errorInvalidName,AjxStringUtil.htmlEncode(e))
+}
+return null
+};
+ZmTag.checkColor=function(e){
+e=Number(e);
+return((e!=null)&&(e>=0&&e<=ZmOrganizer.MAX_COLOR))?e:ZmOrganizer.DEFAULT_COLOR[ZmOrganizer.TAG]
+};
+ZmTag.create=function(n){
+var a=AjxSoapDoc.create("CreateTagRequest","urn:zimbraMail");
+var o=a.set("tag");
+o.setAttribute("name",n.name);
+var t=ZmOrganizer.checkColor(n.color);
+if(t&&(t!=ZmOrganizer.DEFAULT_COLOR[ZmOrganizer.TAG])){
+o.setAttribute("color",t)
+}
+var e=new AjxCallback(null,ZmTag._handleErrorCreate,n);
+appCtxt.getAppController().sendRequest({
+soapDoc:a,asyncMode:true,errorCallback:e,accountName:n.accountName}
+)
+};
+ZmTag._handleErrorCreate=function(o,t){
+if(t.code==ZmCsfeException.MAIL_INVALID_NAME){
+var a=AjxMessageFormat.format(ZmMsg.errorInvalidName,AjxStringUtil.htmlEncode(o.name));
+var e=appCtxt.getMsgDialog();
+e.setMessage(a,DwtMessageDialog.CRITICAL_STYLE);
+e.popup();
+return true
+}
+return false
+};
+ZmTag.prototype.getIcon=function(){
+return(this.id==ZmOrganizer.ID_ROOT)?null:ZmTag.COLOR_ICON[this.color]
+};
+ZmTag.prototype.createQuery=function(){
+return['tag:"',this.name,'"'].join("")
+};
+ZmTag.prototype.getToolTip=function(){};
+ZmTag.prototype.notifyCreate=function(e){
+var t=ZmTag.createFromJs(this,e,this.tree,true);
+t._notify(ZmEvent.E_CREATE)
+};
+ZmTag.prototype.supportsSharing=function(){
+return false
+}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmTree")){
+ZmTree=function(e){
+if(arguments.length==0){
+return
+}
+ZmModel.call(this,e);
+this.type=e;
+this.root=null
+};
+ZmTree.prototype=new ZmModel;
+ZmTree.prototype.constructor=ZmTree;
+ZmTree.prototype.toString=function(){
+return"ZmTree"
+};
+ZmTree.prototype.asString=function(){
+return this.root?this._asString(this.root,""):""
+};
+ZmTree.prototype.getById=function(e){
+return this.root?this.root.getById(e):null
+};
+ZmTree.prototype.getByName=function(e){
+return this.root?this.root.getByName(e):null
+};
+ZmTree.prototype.getByType=function(e){
+return this.root?this.root.getByType(e):null
+};
+ZmTree.prototype.size=function(){
+return this.root?this.root.size():0
+};
+ZmTree.prototype.reset=function(){
+this.root=null
+};
+ZmTree.prototype.asList=function(e){
+var t=[];
+return this.root?this._addToList(this.root,t,e):t
+};
+ZmTree.prototype.getUnreadHash=function(e){
+if(!e){
+e={}
+}
+return this.root?this._getUnreadHash(this.root,e):e
+};
+ZmTree.prototype._addToList=function(e,r,t){
+var s=t&&t.includeRemote;
+var h=t&&t.remoteOnly;
+var n=e.isRemote();
+if((!n&&!h)||(n&&(h||s))){
+r.push(e)
+}
+var o=e.children.getArray();
+for(var a=0;
+a<o.length;
+a++){
+this._addToList(o[a],r,t)
+}
+return r
+};
+ZmTree.prototype._asString=function(e,o){
+if(e.id){
+o=o+e.id
+}
+var a=e.children.clone().getArray();
+if(a.length){
+a.sort(function(s,n){
+return s.id-n.id
+}
+);
+o=o+"[";
+for(var t=0;
+t<a.length;
+t++){
+if(a[t].id==ZmFolder.ID_TAGS){
+continue
+}
+if(t>0){
+o=o+","
+}
+o=this._asString(a[t],o)
+}
+o=o+"]"
+}
+return o
+};
+ZmTree.prototype._getUnreadHash=function(e,t){
+t[e.id]=e.numUnread;
+var o=e.children.getArray();
+for(var a=0;
+a<o.length;
+a++){
+this._getUnreadHash(o[a],t)
+}
+return t
+}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmTagTree")){
+ZmTagTree=function(e){
+ZmTree.call(this,ZmOrganizer.TAG);
+var t=(e)?([e.id,ZmTag.ID_ROOT].join(":")):ZmTag.ID_ROOT;
+this.root=new ZmTag({
+id:t,tree:this}
+)
+};
+ZmTagTree.prototype=new ZmTree;
+ZmTagTree.prototype.constructor=ZmTagTree;
+ZmTagTree.COLOR_LIST=[ZmOrganizer.C_CYAN,ZmOrganizer.C_BLUE,ZmOrganizer.C_PURPLE,ZmOrganizer.C_RED,ZmOrganizer.C_ORANGE,ZmOrganizer.C_YELLOW,ZmOrganizer.C_GREEN];
+ZmTagTree.prototype.toString=function(){
+return"ZmTagTree"
+};
+ZmTagTree.prototype.loadFromJs=function(a,o,n){
+if(!a||!a.tag||!a.tag.length){
+return
+}
+for(var t=0;
+t<a.tag.length;
+t++){
+ZmTag.createFromJs(this.root,a.tag[t],this,null,n)
+}
+var e=this.root.children.getArray();
+if(e.length){
+e.sort(ZmTag.sortCompare)
+}};
+ZmTagTree.prototype.getByIndex=function(e){
+var t=this.asList();
+if(t&&t.length&&(e<t.length)){
+return t[e]
+}};
+ZmTagTree.prototype.reset=function(){
+this.root=new ZmTag({
+id:ZmTag.ID_ROOT,tree:this}
+)
+}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmFolderTree")){
+ZmFolderTree=function(e){
+ZmTree.call(this,e)
+};
+ZmFolderTree.prototype=new ZmTree;
+ZmFolderTree.prototype.constructor=ZmFolderTree;
+ZmFolderTree.IS_PARSED={};
+ZmFolderTree.prototype.toString=function(){
+return"ZmFolderTree"
+};
+ZmFolderTree.prototype.loadFromJs=function(a,e,t){
+this.root=(e=="zimlet")?ZmZimlet.createFromJs(null,a,this):ZmFolderTree.createFromJs(null,a,this,e,null,t)
+};
+ZmFolderTree.createFromJs=function(m,r,y,c,g,h){
+if(!(r&&r.id)){
+return
+}
+var a;
+if(c=="search"){
+var l;
+if(r.types){
+var f=r.types.split(",");
+l=[];
+for(var s=0;
+s<f.length;
+s++){
+l.push(ZmSearch.TYPE_MAP[f[s]])
+}}
+var n={
+id:r.id,name:r.name,parent:m,tree:y,numUnread:r.u,query:r.query,types:l,sortBy:r.sortBy,account:h};
+a=new ZmSearchFolder(n);
+ZmFolderTree._fillInFolder(a,r,g);
+ZmFolderTree._traverse(a,r,y,(g||[]),c,h)
+}else{
+var u=r.view?(ZmOrganizer.TYPE[r.view]):(m?m.type:ZmOrganizer.FOLDER);
+if(!u){
+return
+}
+var p=(r.acl&&r.acl.grant&&r.acl.grant.length>0);
+if(appCtxt.inStartup&&ZmOrganizer.DEFERRABLE[u]&&!appCtxt.isOffline&&!p){
+var o=appCtxt.getApp(ZmOrganizer.APP[u]);
+var e={
+type:u,parent:m,obj:r,tree:y,path:g,elementType:c,account:h};
+o.addDeferredFolder(e)
+}else{
+var d=ZmOrganizer.ORG_PACKAGE[u];
+if(d){
+AjxDispatcher.require(d)
+}
+a=ZmFolderTree.createFolder(u,m,r,y,g,c,h);
+ZmFolderTree._traverse(a,r,y,(g||[]),c,h)
+}}
+return a
+};
+ZmFolderTree._traverse=function(e,n,m,u,l,h){
+var a=(e.nId==ZmOrganizer.ID_ROOT);
+if(n.folder&&n.folder.length){
+if(!a){
+u.push(n.name)
+}
+for(var s=0;
+s<n.folder.length;
+s++){
+var r=n.folder[s];
+var o=ZmFolderTree.createFromJs(e,r,m,(l||"folder"),u,h);
+if(e&&o){
+e.children.add(o)
+}}
+if(!a){
+u.pop()
+}}
+if(n.search&&n.search.length){
+if(!a){
+u.push(n.name)
+}
+for(var s=0;
+s<n.search.length;
+s++){
+var d=n.search[s];
+var t=ZmFolderTree.createFromJs(e,d,m,"search",u,h);
+if(t){
+e.children.add(t)
+}}
+if(!a){
+u.pop()
+}}
+if(n.link&&n.link.length){
+for(var s=0;
+s<n.link.length;
+s++){
+var c=n.link[s];
+var o=ZmFolderTree.createFromJs(e,c,m,"link",u,h);
+if(o){
+e.children.add(o)
+}}}};
+ZmFolderTree.createFolder=function(type,parent,obj,tree,path,elementType,account){
+var orgClass=eval(ZmOrganizer.ORG_CLASS[type]);
+if(!orgClass){
+return null
+}
+var params={
+id:obj.id,name:obj.name,parent:parent,tree:tree,color:obj.color,rgb:obj.rgb,owner:obj.owner,zid:obj.zid,rid:obj.rid,restUrl:obj.rest,url:obj.url,numUnread:obj.u,numTotal:obj.n,sizeTotal:obj.s,perm:obj.perm,link:elementType=="link",account:account};
+var folder=new orgClass(params);
+ZmFolderTree._fillInFolder(folder,obj,path);
+ZmFolderTree.IS_PARSED[type]=true;
+return folder
+};
+ZmFolderTree._fillInFolder=function(e,a,t){
+if(t&&t.length){
+e.path=t.join("/")
+}
+if(a.f&&e._parseFlags){
+e._parseFlags(a.f)
+}
+e._setSharesFromJs(a)
+};
+ZmFolderTree.prototype.getByType=function(e){
+return this.root?this.root.getByType(e):null
+};
+ZmFolderTree.prototype.getByPath=function(t,e){
+return this.root?this.root.getByPath(t,e):null
+};
+ZmFolderTree.prototype.handleNoSuchFolderError=function(e,r,l){
+var h=this.getByType(e);
+var a;
+var s=false;
+if(h){
+for(var n=0;
+n<h.length;
+n++){
+if((h[n].zid==r)&&(h[n].rid==l)){
+h[n].noSuchFolder=true;
+if(!a){
+var o=appCtxt.getAppController().getOverviewId();
+a=appCtxt.getOverviewController().getTreeView(o,e)
+}
+var t=a.getTreeItemById(h[n].id);
+t.setText(h[n].getName(true));
+this.handleDeleteNoSuchFolder(h[n]);
+s=true
+}}}
+return s
+};
+ZmFolderTree.prototype.handleDeleteNoSuchFolder=function(e){
+var t=appCtxt.getYesNoMsgDialog();
+t.reset();
+t.registerCallback(DwtDialog.YES_BUTTON,this._deleteOrganizerYesCallback,this,[e,t]);
+t.registerCallback(DwtDialog.NO_BUTTON,appCtxt.getAppController()._clearDialog,this,t);
+var a=AjxMessageFormat.format(ZmMsg.confirmDeleteMissingFolder,e.getName(false,0,true));
+t.setMessage(a,DwtMessageDialog.WARNING_STYLE);
+t.popup()
+};
+ZmFolderTree.prototype._deleteOrganizerYesCallback=function(e,t){
+e._delete();
+appCtxt.getAppController()._clearDialog(t)
+};
+ZmFolderTree.prototype.getPermissions=function(r){
+var n=r.folderIds||this._getItemsWithoutPerms(r.type);
+if(n.length>0){
+var o=AjxSoapDoc.create("BatchRequest","urn:zimbra");
+o.setMethodAttribute("onerror","continue");
+var s=o.getDoc();
+for(var a=0;
+a<n.length;
+a++){
+var t=o.set("GetFolderRequest",null,null,"urn:zimbraMail");
+var e=s.createElement("folder");
+e.setAttribute("l",n[a]);
+t.appendChild(e)
+}
+var h=new AjxCallback(this,this._handleResponseGetShares,[r.callback,r.skipNotify]);
+appCtxt.getRequestMgr().sendRequest({
+soapDoc:o,asyncMode:true,callback:h,noBusyOverlay:r.noBusyOverlay}
+
+)
+}else{
+if(r.callback){
+r.callback.run()
+}}};
+ZmFolderTree.prototype._getItemsWithoutPerms=function(n){
+var s=[];
+var o=n?[n]:[ZmOrganizer.FOLDER,ZmOrganizer.CALENDAR,ZmOrganizer.TASKS,ZmOrganizer.NOTEBOOK,ZmOrganizer.ADDRBOOK];
+for(var t=0;
+t<o.length;
+t++){
+var r=o[t];
+if(!ZmFolderTree.IS_PARSED[r]){
+continue
+}
+var e=this.getByType(r);
+for(var a=0;
+a<e.length;
+a++){
+if(e[a].link&&e[a].shares==null){
+s.push(e[a].id)
+}}}
+return s
+};
+ZmFolderTree.prototype._handleResponseGetShares=function(h,o,c){
+var l=c.getResponse().BatchResponse;
+this._handleErrorGetShares(l);
+var e=l.GetFolderResponse;
+if(e){
+for(var a=0;
+a<e.length;
+a++){
+var n=e[a].link?e[a].link[0]:null;
+if(n){
+var s=appCtxt.getById(n.id);
+if(s){
+s._setSharesFromJs(n)
+}
+if(n.folder&&n.folder.length>0){
+var r=appCtxt.getById(n.id);
+if(r){
+for(var t=0;
+t<n.folder.length;
+t++){
+if(appCtxt.getById(n.folder[t].id)){
+continue
+}
+r.notifyCreate(n.folder[t],false,o)
+}}}}}}
+if(h){
+h.run()
+}};
+ZmFolderTree.prototype._handleErrorGetShares=function(l){
+var n=l.Fault;
+if(n){
+var a=[];
+var t=[];
+for(var o=0,e=n.length;
+o<e;
+o++){
+var r=ZmCsfeCommand.faultToEx(n[o]);
+if(r.code==ZmCsfeException.MAIL_NO_SUCH_FOLDER){
+var h=r.data.itemId[0];
+var s=h.lastIndexOf(":");
+t.push(h.substring(0,s));
+a.push(h.substring(s+1,h.length))
+}}
+if(t.length){
+this._markNoSuchFolder(t,a)
+}}};
+ZmFolderTree.prototype._markNoSuchFolder=function(t,n){
+var s=appCtxt.getFolderTree();
+var e=s&&s.root?s.root.children.getArray():null;
+for(var o=0;
+o<e.length;
+o++){
+for(var a=0;
+a<n.length;
+a++){
+if((e[o].zid==t[a])&&(e[o].rid==n[a])){
+e[o].noSuchFolder=true
+}}}};
+ZmFolderTree.prototype._sortFolder=function(a){
+var t=a.children;
+if(t&&t.length){
+t.sort(ZmFolder.sortCompare);
+for(var e=0;
+e<t.length;
+e++){
+this._sortFolder(t[e])
+}}}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmList")){
+ZmList=function(t,e){
+if(arguments.length==0){
+return
+}
+ZmModel.call(this,t);
+this.type=t;
+this.search=e;
+this._vector=new AjxVector();
+this._hasMore=false;
+this._idHash=new Object();
+var a=appCtxt.getTagTree();
+if(a){
+this._tagChangeListener=new AjxListener(this,this._tagTreeChangeListener);
+a.addChangeListener(this._tagChangeListener)
+}};
+ZmList.prototype=new ZmModel;
+ZmList.prototype.constructor=ZmList;
+ZmList.ITEM_CLASS={};
+ZmList.NODE={};
+ZmList.ITEM_TYPE={};
+ZmList.CHUNK_SIZE=100;
+ZmList.prototype.toString=function(){
+return"ZmList"
+};
+ZmList.prototype.get=function(e){
+return this._vector.get(e)
+};
+ZmList.prototype.add=function(t,e){
+this._vector.add(t,e);
+if(t.id){
+this._idHash[t.id]=t
+}};
+ZmList.prototype.remove=function(e){
+this._vector.remove(e);
+if(e.id){
+delete this._idHash[e.id]
+}};
+ZmList.prototype.create=function(args){
+var item;
+var obj=eval(ZmList.ITEM_CLASS[this.type]);
+if(obj){
+item=new obj(this);
+item.create(args)
+}
+return item
+};
+ZmList.prototype.size=function(){
+return this._vector.size()
+};
+ZmList.prototype.indexOf=function(e){
+return this._vector.indexOf(e)
+};
+ZmList.prototype.hasMore=function(){
+return this._hasMore
+};
+ZmList.prototype.setHasMore=function(e){
+this._hasMore=e
+};
+ZmList.prototype.getArray=function(){
+return this._vector.getArray()
+};
+ZmList.prototype.getVector=function(){
+return this._vector
+};
+ZmList.prototype.getById=function(e){
+return this._idHash[e]
+};
+ZmList.prototype.clear=function(){
+var e=this.getArray();
+for(var t=0;
+t<e.length;
+t++){
+e[t].clear()
+}
+this._evtMgr.removeAll(ZmEvent.L_MODIFY);
+this._vector.removeAll();
+for(var o in this._idHash){
+this._idHash[o]=null
+}
+this._idHash=new Object()
+};
+ZmList.prototype.set=function(respNode){
+this.clear();
+var nodes=respNode.childNodes;
+var args={
+list:this};
+for(var i=0;
+i<nodes.length;
+i++){
+var node=nodes[i];
+if(node.nodeName==ZmList.NODE[this.type]){
+if(parseInt(node.getAttribute("l"))==ZmFolder.ID_TRASH&&(this.type!=ZmItem.CONTACT)){
+continue
+}
+var obj=eval(ZmList.ITEM_CLASS[this.type]);
+if(obj){
+this.add(obj.createFromDom(node,args))
+}}}};
+ZmList.prototype.addFromDom=function(node,args){
+if(!args){
+args={}
+}
+args.list=this;
+var obj=eval(ZmList.ITEM_CLASS[this.type]);
+if(obj){
+this.add(obj.createFromDom(node,args))
+}};
+ZmList.prototype.getSubList=function(o,a){
+var n=null;
+var t=(o+a>this.size())?this.size():o+a;
+var e=this.getArray();
+if(o<t){
+n=AjxVector.fromArray(e.slice(o,t))
+}
+return n
+};
+ZmList.prototype.cache=function(n,t){
+this.getVector().merge(n,t);
+var o=t.getArray();
+for(var e=0;
+e<o.length;
+e++){
+var a=o[e];
+a.list=this;
+if(a.id){
+this._idHash[a.id]=a
+}}};
+ZmList.prototype.flagItems=function(e){
+e=Dwt.getParams(arguments,["items","op","value","callback"]);
+if(this.type==ZmItem.MIXED&&!this._mixedType){
+return this._mixedAction("flagItems",e)
+}
+e.items=AjxUtil.toArray(e.items);
+if(e.action=="update"){
+e.attrs={
+f:e.value}
+}else{
+e.action=e.value?e.op:"!"+e.op
+}
+this._itemAction(e)
+};
+ZmList.prototype.tagItems=function(s){
+s=Dwt.getParams(arguments,["items","tagId","doTag"]);
+if(appCtxt.multiAccounts&&!appCtxt.getActiveAccount().isMain){
+s.tagId=ZmOrganizer.normalizeId(s.tagId)
+}
+if(this.type==ZmItem.MIXED&&!this._mixedType){
+return this._mixedAction("tagItems",s)
+}
+var t=AjxUtil.toArray(s.items);
+var e=[],r=s.doTag,o=s.tagId;
+for(var a=0;
+a<t.length;
+a++){
+var n=t[a];
+if((r&&(!n.hasTag(o)||n.type==ZmItem.CONV))||(!r&&n.hasTag(o))){
+e.push(n)
+}}
+s.items=e;
+s.attrs={
+tag:o};
+s.action=r?"tag":"!tag";
+this._itemAction(s)
+};
+ZmList.prototype.removeAllTags=function(n){
+n=(n&&n.items)?n:{
+items:n};
+if(this.type==ZmItem.MIXED&&!this._mixedType){
+this._mixedAction("removeAllTags",n);
+return
+}
+var t=AjxUtil.toArray(n.items);
+var e=[];
+for(var a=0;
+a<t.length;
+a++){
+var o=t[a];
+if(o.tags&&o.tags.length){
+e.push(o)
+}}
+n.items=e;
+n.action="update";
+n.attrs={
+t:""};
+this._itemAction(n)
+};
+ZmList.prototype.moveItems=function(a){
+a=Dwt.getParams(arguments,["items","folder","attrs","callback"]);
+if(this.type==ZmItem.MIXED&&!this._mixedType){
+return this._mixedAction("moveItems",a)
+}
+a.items=AjxUtil.toArray(a.items);
+a.attrs=a.attrs||{};
+a.attrs.l=a.folder.id;
+a.accountName=appCtxt.multiAccounts&&appCtxt.accountList.mainAccount.name;
+a.action="move";
+var e={};
+for(var t in a){
+e[t]=a[t]
+}
+a.callback=(this.type==ZmItem.MIXED)?(new AjxCallback(this,this._handleResponseMoveItems,e)):a.callback;
+this._itemAction(a)
+};
+ZmList.prototype._handleResponseMoveItems=function(a,e){
+var o=e.getResponse();
+if(o&&o.length){
+this.moveLocal(o,a.folder.id);
+for(var t=0;
+t<o.length;
+t++){
+o[t].moveLocal(a.folder.id)
+}
+ZmModel.notifyEach(o,ZmEvent.E_MOVE)
+}
+if(a.callback){
+a.callback.run(e)
+}};
+ZmList.prototype.copyItems=function(e){
+e=Dwt.getParams(arguments,["items","folder","attrs"]);
+e.items=AjxUtil.toArray(e.items);
+e.attrs=e.attrs||{};
+e.attrs.l=e.folder.id;
+e.accountName=appCtxt.multiAccounts&&appCtxt.accountList.mainAccount.name;
+e.action="copy";
+e.callback=new AjxCallback(this,this._handleResponseCopyItems,e);
+this._itemAction(e)
+};
+ZmList.prototype._handleResponseCopyItems=function(o,e){
+var a=e.getResponse();
+if(a.length>0){
+var t=AjxMessageFormat.format(ZmMsg.itemCopied,a.length);
+appCtxt.getAppController().setStatusMsg(t)
+}};
+ZmList.prototype.deleteItems=function(h){
+h=Dwt.getParams(arguments,["items","hardDelete","attrs","childWin"]);
+if(this.type==ZmItem.MIXED&&!this._mixedType){
+return this._mixedAction("deleteItems",h)
+}
+var o=h.items=AjxUtil.toArray(h.items);
+var e=[];
+var a=[];
+for(var n=0;
+n<o.length;
+n++){
+var r=o[n];
+var t=r.getFolderId();
+var s=appCtxt.getById(t);
+if(h.hardDelete||(s&&s.isHardDelete())){
+a.push(r)
+}else{
+e.push(r)
+}}
+h.callback=h.childWin&&new AjxCallback(this._handleDeleteNewWindowResponse,h.childWin);
+if(e.length){
+h.items=e;
+var t=appCtxt.multiAccounts?ZmOrganizer.getSystemId(ZmFolder.ID_TRASH):ZmFolder.ID_TRASH;
+h.folder=appCtxt.getById(t);
+this.moveItems(h)
+}
+if(a.length){
+h.items=a;
+h.action="delete";
+this._itemAction(h)
+}};
+ZmList.prototype._handleDeleteNewWindowResponse=function(t,e){
+if(t){
+t.close()
+}};
+ZmList.prototype.modifyItem=function(t,e,a){
+t.modify(e,a)
+};
+ZmList.prototype.notifyCreate=function(node){
+var obj=eval(ZmList.ITEM_CLASS[this.type]);
+if(obj){
+var item=obj.createFromDom(node,{
+list:this}
+);
+this.add(item,this._sortIndex(item));
+this.createLocal(item);
+this._notify(ZmEvent.E_CREATE,{
+items:[item]}
+)
+}};
+ZmList.prototype.modifyLocal=function(e,t){};
+ZmList.prototype.createLocal=function(e){};
+ZmList.prototype.flagLocal=function(t,e,a){};
+ZmList.prototype.tagLocal=function(t,e,a){};
+ZmList.prototype.removeAllTagsLocal=function(e){};
+ZmList.prototype.deleteLocal=function(e){
+for(var t=0;
+t<e.length;
+t++){
+this.remove(e[t])
+}};
+ZmList.prototype.moveLocal=function(t,e){
+for(var a=0;
+a<t.length;
+a++){
+this.remove(t[a])
+}};
+ZmList.prototype._itemAction=function(s,a){
+var p=this._getIds(s.items);
+var o=p.hash;
+var h=p.list;
+if(!(h&&h.length)){
+if(s.callback){
+s.callback.run(new ZmCsfeResult([]))
+}
+if(s.finalCallback){
+s.finalCallback.run(s)
+}
+return
+}
+var d;
+if(this.type==ZmItem.MIXED){
+d=this._mixedType
+}else{
+if(s.items.length==1){
+d=s.items[0].type
+}else{
+d=this.type
+}}
+if(!d){
+return
+}
+var t=ZmItem.SOAP_CMD[d]+"Request";
+var e=a?a._useJson:true;
+var r,n;
+if(e){
+r={};
+var f=this._getActionNamespace();
+r[t]={
+_jsns:f};
+var n=r[t].action={};
+n.op=s.action;
+for(var l in s.attrs){
+n[l]=s.attrs[l]
+}}else{
+r=AjxSoapDoc.create(t,this._getActionNamespace());
+n=r.set("action");
+n.setAttribute("op",s.action);
+for(var l in s.attrs){
+n.setAttribute(l,s.attrs[l])
+}}
+var m=s.callback&&(new AjxCallback(this,this._handleResponseItemAction,[s.callback]));
+var u={
+ids:h,idHash:o,accountName:s.accountName,request:r,action:n,type:d,callback:m,finalCallback:s.finalCallback,errorCallback:s.errorCallback,batchCmd:a,numItems:s.count||0};
+var c=ZmList.progressDialog;
+if(h.length>ZmList.CHUNK_SIZE){
+if(!c){
+c=ZmList.progressDialog=appCtxt.getCancelMsgDialog();
+c.registerCallback(DwtDialog.CANCEL_BUTTON,new AjxCallback(this,this._cancelAction,[u]))
+}}else{
+if(c){
+c.unregisterCallback(DwtDialog.CANCEL_BUTTON);
+ZmList.progressDialog=null
+}}
+this._doAction(u)
+};
+ZmList.prototype._handleResponseItemAction=function(a,t,e){
+if(a){
+e.set(t);
+a.run(e)
+}};
+ZmList.prototype._doAction=function(o){
+var a=o.ids.splice(0,ZmList.CHUNK_SIZE);
+var t=a.join(",");
+var s=true;
+if(o.action.setAttribute){
+o.action.setAttribute("id",t);
+s=false
+}else{
+o.action.id=t
+}
+var n=new AjxCallback(this,this._handleResponseDoAction,[o]);
+if(o.batchCmd){
+o.batchCmd.addRequestParams(o.request,n,o.errorCallback)
+}else{
+var e={
+asyncMode:true,callback:n,accountName:o.accountName};
+if(s){
+e.jsonObj=o.request
+}else{
+e.soapDoc=o.request
+}
+o.reqId=appCtxt.getAppController().sendRequest(e)
+}};
+ZmList.prototype._handleResponseDoAction=function(t,d){
+var r=ZmList.progressDialog;
+var o=d.getResponse();
+var a=o[ZmItem.SOAP_CMD[t.type]+"Response"];
+if(a&&a.action){
+var e=a.action.id.split(",");
+if(e){
+var h=[];
+for(var n=0;
+n<e.length;
+n++){
+var c=t.idHash[e[n]];
+if(c){
+h.push(c)
+}}
+t.numItems+=h.length;
+if(t.callback){
+t.callback.run(h,d)
+}
+if(r){
+var s=ZmItem.PLURAL_MSG_KEY[t.type]||"items";
+var l=AjxMessageFormat.format(ZmMsg.itemsProcessed,[t.numItems,ZmMsg[s]]);
+r.setContent(l.toLowerCase());
+if(!r.isPoppedUp()){
+r.popup()
+}}}}
+if(t.ids.length&&!t.cancelled){
+AjxTimedAction.scheduleAction(new AjxTimedAction(this,this._doAction,[t]),100)
+}else{
+t.reqId=null;
+if(t.finalCallback){
+t.finalCallback.run(t)
+}else{
+if(r){
+r.popdown();
+ZmList.progressDialog=null
+}}}};
+ZmList.prototype._cancelAction=function(e){
+e.cancelled=true;
+if(e.reqId){
+appCtxt.getRequestMgr().cancelRequest(e.reqId)
+}
+if(e.finalCallback){
+e.finalCallback.run(e)
+}};
+ZmList.prototype._mixedAction=function(r,s){
+var e=this._getTypedItems(s.items);
+var n=AjxUtil.hashCopy(s);
+for(var o in e){
+this._mixedType=o;
+if(o==ZmItem.CONTACT){
+var t=e[o];
+for(var a=0;
+a<t.length;
+a++){
+n.items=[t[a]];
+t[a].list[r](s)
+}}else{
+n.items=e[o];
+ZmMailList.prototype[r].call(this,s)
+}
+this._mixedType=null
+}};
+ZmList.prototype._getTypedItems=function(t){
+var e={};
+for(var a=0;
+a<t.length;
+a++){
+var o=t[a].type;
+if(!e[o]){
+e[o]=[]
+}
+e[o].push(t[a])
+}
+return e
+};
+ZmList.prototype._getIds=function(n){
+var o={};
+if(n instanceof ZmItem){
+n=[n]
+}
+var t=[];
+if((n&&n.length)){
+for(var e=0;
+e<n.length;
+e++){
+var a=n[e];
+var s=a.id;
+if(s){
+t.push(s);
+o[s]=a
+}}}
+return{
+hash:o,list:t}
+};
+ZmList.prototype._sortIndex=function(e){
+return 0
+};
+ZmList.prototype._redoSearch=function(e){
+var t=appCtxt.getSearchController();
+t.redoSearch(e._currentSearch)
+};
+ZmList.prototype._getActionNamespace=function(){
+return"urn:zimbraMail"
+};
+ZmList.prototype._folderTreeChangeListener=function(s){
+if(s.type!=ZmEvent.S_FOLDER){
+return
+}
+var n=s.getDetail("organizers")[0];
+var o=s.getDetail("fields");
+var a=appCtxt.getCurrentController();
+var t=(appCtxt.getCurrentList()==this);
+if(s.event==ZmEvent.E_DELETE&&(s.source instanceof ZmFolder)&&s.source.id==ZmFolder.ID_TRASH){
+var e=a.getCurrentView();
+if(e){
+e.offset=0
+}
+a._resetNavToolBarButtons(view)
+}else{
+if(t&&a&&a._currentSearch&&(s.event==ZmEvent.E_MOVE||(s.event==ZmEvent.E_MODIFY)&&o&&o[ZmOrganizer.F_NAME])){
+var r=s.getDetail("oldPath");
+if(a._currentSearch.hasFolderTerm(r)){
+a._currentSearch.replaceFolderTerm(r,n.getPath());
+appCtxt.getSearchController().setSearchField(a._currentSearch.query)
+}}}};
+ZmList.prototype._tagTreeChangeListener=function(r){
+if(r.type!=ZmEvent.S_TAG){
+return
+}
+var u=r.getDetail("organizers")[0];
+var n=r.getDetail("fields");
+var c=appCtxt.getCurrentController();
+if(!c||(appCtxt.getCurrentList()!=this)){
+return
+}
+if((r.event==ZmEvent.E_MODIFY)&&n&&n[ZmOrganizer.F_NAME]){
+var t=r.getDetail("oldName");
+if(c._currentSearch&&c._currentSearch.hasTagTerm(t)){
+c._currentSearch.replaceTagTerm(t,u.getName());
+appCtxt.getSearchController().setSearchField(c._currentSearch.query)
+}}else{
+if(r.event==ZmEvent.E_DELETE){
+var h=this.getArray();
+var e=this._evtMgr.isListenerRegistered(ZmEvent.L_MODIFY);
+for(var o=0;
+o<h.length;
+o++){
+var d=this.getById(h[o].id);
+if(d&&d.hasTag(u.id)){
+d.tagLocal(u.id,false);
+if(e){
+this._notify(ZmEvent.E_TAGS,{
+items:[d]}
+)
+}}}
+if(c._currentSearch&&c._currentSearch.hasTagTerm(u.getName())){
+var l=appCtxt.getCurrentViewId();
+c.enablePagination(false,l);
+var s=c.getCurrentView();
+if(s&&s.sortingEnabled){
+s.sortingEnabled=false
+}
+if(l==ZmId.VIEW_CONVLIST){
+c._currentSearch.query="is:read is:unread"
+}
+c._currentSearch.tagId=null;
+appCtxt.getSearchController().setSearchField("")
+}}}}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmAccountList")){
+ZmAccountList=function(){
+this._accounts={};
+this._count=0;
+this.visibleAccounts=[];
+this.mainAccount=null;
+this.activeAccount=null;
+this.defaultAccount=null;
+this._evtMgr=new AjxEventMgr()
+};
+ZmAccountList.prototype.constructor=ZmAccountList;
+ZmAccountList.DEFAULT_ID="main";
+ZmAccountList.prototype.toString=function(){
+return"ZmAccountList"
+};
+ZmAccountList.prototype.size=function(e){
+return(e)?this.visibleAccounts.length:this._count
+};
+ZmAccountList.prototype.add=function(e){
+this._accounts[e.id]=e;
+this._count++;
+if(e.visible||e.id==ZmAccountList.DEFAULT_ID){
+this.visibleAccounts.push(e)
+}
+if(e.id==ZmAccountList.DEFAULT_ID){
+this.mainAccount=e
+}};
+ZmAccountList.prototype.getAccounts=function(){
+return this._accounts
+};
+ZmAccountList.prototype.getAccount=function(e){
+return e?this._accounts[e]:this.mainAccount
+};
+ZmAccountList.prototype.getAccountByName=function(e){
+for(var t in this._accounts){
+if(this._accounts[t].name==e){
+return this._accounts[t]
+}}
+return null
+};
+ZmAccountList.prototype.getAccountByEmail=function(e){
+for(var t in this._accounts){
+if(this._accounts[t].getEmail()==e){
+return this._accounts[t]
+}}
+return null
+};
+ZmAccountList.prototype.getItemCount=function(e){
+var t=0;
+for(var a=0;
+a<this.visibleAccounts.length;
+a++){
+var s=this.visibleAccounts[a];
+if(s.isMain){
+continue
+}
+var n=ZmOrganizer.getSystemId(e,s);
+var o=appCtxt.getById(n);
+if(o){
+t+=o.numTotal
+}}
+return t
+};
+ZmAccountList.prototype.generateQuery=function(e,s){
+var l=s&&s.get(0);
+var h=[];
+var r=this.visibleAccounts;
+var a=e||ZmOrganizer.ID_ROOT;
+var o=e?"inid":"underid";
+for(var n=0;
+n<r.length;
+n++){
+var c=r[n];
+if((l&&!c.isAppEnabled(ZmItem.APP[l]))||c.isMain){
+continue
+}
+var t=[o,':"',ZmOrganizer.getSystemId(a,c,true),'"'];
+h.push(t.join(""))
+}
+return(h.join(" OR "))
+};
+ZmAccountList.prototype.loadAccounts=function(t){
+var e=(new Array()).concat(this.visibleAccounts);
+this._loadAccount(e,t)
+};
+ZmAccountList.prototype._loadAccount=function(t,n){
+var o=t.shift();
+if(o){
+var a=new AjxCallback(this,this._loadAccount,[t,n]);
+o.load(a)
+}else{
+ZmOrganizer.HIDE_EMPTY[ZmOrganizer.TAG]=true;
+ZmOrganizer.HIDE_EMPTY[ZmOrganizer.SEARCH]=true;
+for(var e=0;
+e<this.visibleAccounts.length;
+e++){
+if(appCtxt.get(ZmSetting.OFFLINE_SMTP_ENABLED,null,this.visibleAccounts[e])){
+appCtxt.set(ZmSetting.OFFLINE_COMPOSE_ENABLED,true,null,null,true);
+break
+}}
+if(n){
+n.run()
+}}};
+ZmAccountList.prototype.setActiveAccount=function(t,e){
+this.activeAccount=t;
+this._evt=this._evt||new ZmEvent();
+this._evt.account=t;
+if(!e){
+this._evtMgr.notifyListeners("ACCOUNT",this._evt)
+}};
+ZmAccountList.prototype.addActiveAcountListener=function(t,e){
+return this._evtMgr.addListener("ACCOUNT",t,e)
+};
+ZmAccountList.prototype.syncAll=function(t){
+var e=(new Array()).concat(this.visibleAccounts);
+this._sendSync(e,t)
+};
+ZmAccountList.prototype._sendSync=function(e,a){
+var t=e.shift();
+if(t){
+if(!t.isMain){
+t.sync()
+}
+AjxTimedAction.scheduleAction(new AjxTimedAction(this,this._sendSync,[e,a]),500)
+}else{
+if(a){
+a.run()
+}}};
+ZmAccountList.prototype.createAccounts=function(t,n){
+var o=appCtxt.accountList.mainAccount;
+o.id=n.id;
+o.name=n.name;
+o.isMain=true;
+o.isZimbraAccount=true;
+o.loaded=true;
+o.visible=true;
+o.settings=t;
+o.type=ZmAccount.TYPE_ZIMBRA;
+this._accounts[o.id]=o;
+delete this._accounts[ZmAccountList.DEFAULT_ID];
+this.setActiveAccount(o);
+if(appCtxt.isOffline){
+o.displayName=ZmMsg.localFolders
+}
+var a=n.childAccounts&&n.childAccounts.childAccount;
+if(a){
+for(var e=0;
+e<a.length;
+e++){
+this.add(ZmZimbraAccount.createFromDom(a[e]))
+}
+appCtxt.multiAccounts=this.size()>1;
+appCtxt.isFamilyMbox=appCtxt.multiAccounts&&!appCtxt.isOffline;
+this.defaultAccount=appCtxt.isFamilyMbox?this.mainAccount:this.visibleAccounts[1]
+}};
+ZmAccountList.prototype.resetTrees=function(){
+for(var t=0;
+t<this.visibleAccounts.length;
+t++){
+for(var a in trees){
+var e=trees[a];
+if(e&&e.reset){
+e.reset()
+}}}};
+ZmAccountList.prototype.saveImplicitPrefs=function(){
+for(var t=0;
+t<this.visibleAccounts.length;
+t++){
+var e=this.visibleAccounts[t].trees;
+this.visibleAccounts[t].saveImplicitPrefs()
+}}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmAccount")){
+ZmAccount=function(t,a,e){
+if(arguments.length==0){
+return
+}
+this.id=a;
+this.name=e;
+this.type=t||ZmAccount.TYPE_ZIMBRA
+};
+ZmAccount.TYPE_AOL="AOL";
+ZmAccount.TYPE_GMAIL="Gmail";
+ZmAccount.TYPE_IMAP="Imap";
+ZmAccount.TYPE_LIVE="Live";
+ZmAccount.TYPE_MSE="MSE";
+ZmAccount.TYPE_PERSONA="PERSONA";
+ZmAccount.TYPE_POP="Pop";
+ZmAccount.TYPE_YMP="YMP";
+ZmAccount.TYPE_ZIMBRA="Zimbra";
+ZmAccount.getTypeName=function(e){
+switch(e){
+case ZmAccount.TYPE_AOL:return ZmMsg.aol;
+case ZmAccount.TYPE_GMAIL:return ZmMsg.gmail;
+case ZmAccount.TYPE_IMAP:return ZmMsg.accountTypeImap;
+case ZmAccount.TYPE_LIVE:return ZmMsg.msLive;
+case ZmAccount.TYPE_MSE:return ZmMsg.msExchange;
+case ZmAccount.TYPE_PERSONA:return ZmMsg.accountTypePersona;
+case ZmAccount.TYPE_POP:return ZmMsg.accountTypePop;
+case ZmAccount.TYPE_YMP:return ZmMsg.yahooMail;
+case ZmAccount.TYPE_ZIMBRA:return ZmMsg.zimbraTitle
+}
+return ZmMsg.unknown
+};
+ZmAccount.prototype.toString=function(){
+return"ZmAccount"
+};
+ZmAccount.prototype.setName=function(e){
+this.name=e
+};
+ZmAccount.prototype.getName=function(){
+return this.name
+};
+ZmAccount.prototype.setEmail=function(e){
+throw this.toString()+"#setEmail"
+};
+ZmAccount.prototype.getEmail=function(){
+throw this.toString()+"#getEmail"
+};
+ZmAccount.prototype.getIdentity=function(){
+throw this.toString()+"#getIdentity"
+}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmZimbraAccount")){
+ZmZimbraAccount=function(a,e,t){
+ZmAccount.call(this,null,a,e);
+this.visible=(t!==false);
+this.settings=null;
+this.trees={};
+this.loaded=false;
+this.acl=new ZmAccessControlList()
+};
+ZmZimbraAccount.prototype=new ZmAccount;
+ZmZimbraAccount.prototype.constructor=ZmZimbraAccount;
+ZmZimbraAccount.prototype.toString=function(){
+return"ZmZimbraAccount"
+};
+ZmZimbraAccount.STATUS_UNKNOWN="unknown";
+ZmZimbraAccount.STATUS_OFFLINE="offline";
+ZmZimbraAccount.STATUS_ONLINE="online";
+ZmZimbraAccount.STATUS_RUNNING="running";
+ZmZimbraAccount.STATUS_AUTHFAIL="authfail";
+ZmZimbraAccount.STATUS_ERROR="error";
+ZmZimbraAccount.prototype.setName=function(t){
+var e=this.getIdentity();
+if(!e){
+return
+}
+e.name=t
+};
+ZmZimbraAccount.prototype.getName=function(){
+var e=this.getIdentity();
+var t=(!e)?this.settings.get(ZmSetting.DISPLAY_NAME):e.name;
+if(!t){
+t=this.getDisplayName()
+}
+return e.isDefault&&t==ZmIdentity.DEFAULT_NAME?ZmMsg.accountDefault:t
+};
+ZmZimbraAccount.prototype.setEmail=function(e){};
+ZmZimbraAccount.prototype.getEmail=function(){
+return this.name
+};
+ZmZimbraAccount.prototype.getDisplayName=function(){
+if(!this.displayName){
+var e=this.isMain?this.settings.get(ZmSetting.DISPLAY_NAME):this._displayName;
+this.displayName=(this._accountName||e||this.name)
+}
+return this.displayName
+};
+ZmZimbraAccount.prototype.getIdentity=function(){
+if(!appCtxt.isFamilyMbox||this.isMain){
+return appCtxt.getIdentityCollection(this).defaultIdentity
+}
+if(!this.dummyIdentity){
+this.dummyIdentity=new ZmIdentity(this.name)
+}
+return this.dummyIdentity
+};
+ZmZimbraAccount.prototype.getToolTip=function(){
+if(this.status||this.lastSync){
+var e=(this.lastSync&&this.lastSync!=0)?(new Date(parseInt(this.lastSync))):null;
+var t={
+lastSync:(e?(AjxDateUtil.computeWordyDateStr(new Date(),e)):null),isInitialSync:this.isOfflineInitialSync(),status:this.getStatusMessage()};
+return AjxTemplate.expand("share.App#ZimbraAccountTooltip",t)
+}
+return""
+};
+ZmZimbraAccount.prototype.getDefaultColor=function(){
+if(this.isMain){
+return ZmOrganizer.C_GRAY
+}
+switch(this.type){
+case ZmAccount.TYPE_GMAIL:return ZmOrganizer.C_RED;
+case ZmAccount.TYPE_MSE:return ZmOrganizer.C_GREEN;
+case ZmAccount.TYPE_YMP:return ZmOrganizer.C_PURPLE
+}
+return null
+};
+ZmZimbraAccount.prototype.isOfflineInitialSync=function(){
+return(appCtxt.isOffline&&(!this.lastSync||(this.lastSync&&this.lastSync==0)))
+};
+ZmZimbraAccount.prototype.updateState=function(a){
+if(this.isMain){
+return
+}
+var s=false;
+if(this.lastSync!=a.lastsync){
+this.lastSync=a.lastsync;
+if(this.visible){
+s=true
+}}
+var e=false;
+if(this.status!=a.status){
+this.status=a.status;
+if(this.visible){
+e=true
+}}
+var t=appCtxt.getOverviewController()._overviewContainer;
+for(var n in t){
+var r=t[n];
+if(e||s){
+r.updateAccountInfo(this,e,s)
+}}
+this.code=a.code;
+if(a.error){
+var o=a.error[0];
+this.errorDetail=o.exception[0]._content;
+this.errorMessage=o.message
+}};
+ZmZimbraAccount.prototype.getStatusIcon=function(){
+switch(this.status){
+case ZmZimbraAccount.STATUS_OFFLINE:return"ImAway";
+case ZmZimbraAccount.STATUS_AUTHFAIL:return"ImDnd";
+case ZmZimbraAccount.STATUS_ERROR:return"Critical"
+}
+return null
+};
+ZmZimbraAccount.prototype.getIcon=function(){
+return(this.isMain&&appCtxt.isOffline)?"LocalFolders":this.icon
+};
+ZmZimbraAccount.prototype.getZdMsg=function(e){
+var t=((ZdMsg["client."+e])||(ZdMsg["exception."+e]));
+if(!t&&e){
+t=ZdMsg["exception.offline.UNEXPECTED"]
+}
+return t
+};
+ZmZimbraAccount.prototype.getStatusMessage=function(){
+switch(this.status){
+case ZmZimbraAccount.STATUS_OFFLINE:return ZmMsg.imStatusOffline;
+case ZmZimbraAccount.STATUS_ONLINE:return ZmMsg.imStatusOnline;
+case ZmZimbraAccount.STATUS_RUNNING:return ZmMsg.running;
+case ZmZimbraAccount.STATUS_AUTHFAIL:return this.code?this.getZdMsg(this.code):AjxMessageFormat.format(ZmMsg.authFailure,this.getEmail());
+case ZmZimbraAccount.STATUS_ERROR:return this.code?this.getZdMsg(this.code):ZmMsg.error
+}
+return""
+};
+ZmZimbraAccount.prototype.showErrorMessage=function(){
+if(this.status!=ZmZimbraAccount.STATUS_ERROR){
+return
+}
+var a=appCtxt.getErrorDialog();
+var o=this.getZdMsg(this.code);
+if(o==""){
+o=this.getStatusMessage()
+}
+a.setMessage(o);
+var t=[];
+var e=0;
+if(this.errorMessage){
+t[e++]="<p><b>";
+t[e++]=ZdMsg.DebugMsg;
+t[e++]="</b>: ";
+t[e++]=this.errorMessage;
+t[e++]="</p>"
+}
+if(this.errorDetail){
+t[e++]="<p><b>";
+t[e++]=ZdMsg.DebugStack;
+t[e++]="</b>:</p><p><pre>";
+t[e++]=this.errorDetail;
+t[e++]="</pre></p>"
+}
+t[e++]="<p><b>";
+t[e++]=ZdMsg.DebugActionNote;
+t[e++]="</b></p>";
+a.setDetailString(t.join(""));
+a.popup(null,true)
+};
+ZmZimbraAccount.createFromDom=function(e){
+var t=new ZmZimbraAccount();
+t._loadFromDom(e);
+return t
+};
+ZmZimbraAccount.prototype.load=function(u){
+if(!this.loaded){
+this.settings=new ZmSettings();
+var r=appCtxt.accountList.mainAccount;
+for(var o=0;
+o<ZmApp.APPS.length;
+o++){
+var h=ZmApp.APPS[o];
+var f=ZmApp.SETTING[h];
+if(f&&appCtxt.get(f,null,r)){
+var t=appCtxt.getApp(h);
+if(t){
+t._registerSettings(this.settings)
+}}}
+var a=new ZmBatchCommand(null,this.name);
+var n=new AjxCallback(this,this._handleLoadSettings);
+this.settings.loadUserSettings(n,null,this.name,null,null,a);
+var e=AjxSoapDoc.create("GetTagRequest","urn:zimbraMail");
+var d=new AjxCallback(this,this._handleLoadTags);
+a.addNewRequestParams(e,d);
+var c=AjxSoapDoc.create("GetFolderRequest","urn:zimbraMail");
+c.getMethod().setAttribute("visible","1");
+var l=new AjxCallback(this,this._handleLoadFolders);
+a.addNewRequestParams(c,l);
+var m=new AjxCallback(this,this._handleLoadUserInfo,u);
+var s=new AjxCallback(this,this._handleErrorLoad);
+a.run(m,s)
+}else{
+if(u){
+u.run()
+}}};
+ZmZimbraAccount.prototype.unload=function(){
+if(!appCtxt.inStartup){
+this.settings.loadShortcuts(true)
+}};
+ZmZimbraAccount.prototype.sync=function(a){
+var e=AjxSoapDoc.create("SyncRequest","urn:zimbraOffline");
+if(appCtxt.get(ZmSetting.OFFLINE_DEBUG_TRACE)){
+var t=e.getMethod();
+t.setAttribute("debug",1)
+}
+appCtxt.getAppController().sendRequest({
+soapDoc:e,asyncMode:true,noBusyOverlay:true,callback:a,accountName:this.name}
+)
+};
+ZmZimbraAccount.prototype.save=function(a,t,e){
+return(this.getIdentity().save(a,t,e))
+};
+ZmZimbraAccount.prototype.saveImplicitPrefs=function(){
+ZmCsfeCommand._curAuthToken=ZmCsfeCommand.getAuthToken();
+var t=[];
+for(var a in ZmSetting.CHANGED_IMPLICIT){
+var e=this.settings?this.settings.getSetting(a):null;
+if(e&&(e.getValue(null,true)!=e.origValue)){
+t.push(e)
+}}
+if(t&&t.length){
+this.settings.save(t,null,null,this.name)
+}};
+ZmZimbraAccount.prototype.isAppEnabled=function(e){
+switch(e){
+case ZmApp.BRIEFCASE:return appCtxt.get(ZmSetting.BRIEFCASE_ENABLED,null,this);
+case ZmApp.CALENDAR:return appCtxt.get(ZmSetting.CALENDAR_ENABLED,null,this);
+case ZmApp.CONTACTS:return appCtxt.get(ZmSetting.CONTACTS_ENABLED,null,this);
+case ZmApp.IM:return appCtxt.get(ZmSetting.IM_ENABLED,null,this);
+case ZmApp.MAIL:return appCtxt.get(ZmSetting.MAIL_ENABLED,null,this);
+case ZmApp.NOTEBOOK:return appCtxt.get(ZmSetting.NOTEBOOK_ENABLED,null,this);
+case ZmApp.PREFERENCES:return appCtxt.get(ZmSetting.OPTIONS_ENABLED,null,this);
+case ZmApp.TASKS:return appCtxt.get(ZmSetting.TASKS_ENABLED,null,this)
+}};
+ZmZimbraAccount.prototype._handleLoadSettings=function(e){
+this.type=appCtxt.get(ZmSetting.OFFLINE_ACCOUNT_FLAVOR,null,this);
+this.isZimbraAccount=this.type==ZmAccount.TYPE_ZIMBRA;
+switch(this.type){
+case ZmAccount.TYPE_AOL:this.icon="AccountAOL";
+break;
+case ZmAccount.TYPE_GMAIL:this.icon="AccountGmail";
+break;
+case ZmAccount.TYPE_IMAP:this.icon="AccountIMAP";
+break;
+case ZmAccount.TYPE_LIVE:this.icon="AccountMSN";
+break;
+case ZmAccount.TYPE_MSE:this.icon="AccountExchange";
+break;
+case ZmAccount.TYPE_POP:this.icon="AccountPOP";
+break;
+case ZmAccount.TYPE_YMP:this.icon="AccountYahoo";
+break;
+case ZmAccount.TYPE_ZIMBRA:this.icon="AccountZimbra";
+break
+}
+var t=e.getResponse().GetInfoResponse;
+appCtxt.getIdentityCollection(this).initialize(t.identities);
+appCtxt.getDataSourceCollection(this).initialize(t.dataSources);
+appCtxt.getSignatureCollection(this).initialize(t.signatures);
+if(!this.isZimbraAccount){
+appCtxt.set(ZmSetting.MAIL_READ_RECEIPT_ENABLED,false)
+}};
+ZmZimbraAccount.prototype._handleLoadFolders=function(e){
+var a=e.getResponse().GetFolderResponse;
+var t=a?a.folder[0]:null;
+if(t){
+appCtxt.getRequestMgr()._loadTree(ZmOrganizer.FOLDER,null,a.folder[0],"folder",this)
+}};
+ZmZimbraAccount.prototype._handleLoadTags=function(e){
+var t=e.getResponse().GetTagResponse;
+appCtxt.getRequestMgr()._loadTree(ZmOrganizer.TAG,null,t,null,this)
+};
+ZmZimbraAccount.prototype._handleLoadUserInfo=function(t){
+this.loaded=true;
+var e=appCtxt.getFolderTree(this);
+if(e){
+e.getPermissions({
+noBusyOverlay:true}
+)
+}
+if(t){
+t.run()
+}};
+ZmZimbraAccount.prototype._handleErrorLoad=function(e){};
+ZmZimbraAccount.prototype._loadFromDom=function(e){
+this.id=e.id;
+this.name=e.name;
+this.visible=e.visible;
+var t=e.attrs&&e.attrs._attrs;
+this._displayName=t?t.displayName:this.email;
+this._accountName=t&&t.zimbraPrefLabel
+}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmInvite")){
+ZmInvite=function(){
+ZmModel.call(this)
+};
+ZmInvite.prototype=new ZmModel;
+ZmInvite.prototype.constructor=ZmInvite;
+ZmInvite.prototype.toString=function(){
+return"ZmInvite: name="+this.name+" id="+this.id
+};
+ZmInvite._sendFun=null;
+ZmInvite.createFromDom=function(n){
+var t=new ZmInvite();
+t.components=n[0].comp;
+t.replies=n[0].replies;
+if(t.components==null){
+t.components=[{}
+];
+t.components.empty=true
+}
+var e=n[0];
+if(e.tz){
+for(var o=0;
+o<e.tz.length;
+o++){
+var h=e.tz[o];
+var s=AjxTimezone.getRule(h.id);
+if(!s){
+var r={
+standard:h.standard?AjxUtil.createProxy(h.standard[0]):{}
+,daylight:h.daylight?AjxUtil.createProxy(h.daylight[0]):null};
+r.standard.offset=h.stdoff;
+delete r.standard._object_;
+if(h.daylight){
+r.daylight.offset=h.dayoff;
+delete r.daylight._object_
+}
+s=AjxTimezone.getRule(h.id,r);
+if(s){
+var a=AjxUtil.createProxy(s);
+a.aliasId=s.clientId;
+a.clientId=h.id;
+a.serverId=h.id;
+AjxTimezone.addRule(a)
+}}
+if(!s){
+s={
+clientId:h.id,serverId:h.id,autoDetected:true};
+if(h.daylight){
+s.standard=AjxUtil.createProxy(h.standard[0]);
+s.standard.offset=h.stdoff;
+s.standard.trans=AjxTimezone.createTransitionDate(s.standard);
+s.daylight=AjxUtil.createProxy(h.daylight[0]);
+s.daylight.offset=h.dayoff;
+s.daylight.trans=AjxTimezone.createTransitionDate(s.daylight)
+}else{
+s.standard={
+offset:h.stdoff}
+}
+AjxTimezone.addRule(s)
+}}}
+t.type=e&&e.type?e.type:"appt";
+return t
+};
+ZmInvite.prototype.setMessageId=function(e){
+this.msgId=e
+};
+ZmInvite.prototype.getMessageId=function(){
+return this.msgId
+};
+ZmInvite.prototype.getComponent=function(e){
+return this.components[e]
+};
+ZmInvite.prototype.getComponents=function(){
+return this.components
+};
+ZmInvite.prototype.getComponentByUid=function(t){
+for(var e=0;
+e<components.length;
+++e){
+if(components.uid==t){
+break
+}}};
+ZmInvite.prototype.hasMultipleComponents=function(){
+return(this.components.length>1)
+};
+ZmInvite.prototype.hasOtherAttendees=function(e){
+var t=e||0;
+return this.components[t].at&&this.components[t].at.length>0
+};
+ZmInvite.prototype.getEventName=function(e){
+var t=e||0;
+return this.components[t]?this.components[t].name:null
+};
+ZmInvite.prototype.getAlarm=function(e){
+var t=e||0;
+return this.components[t]?this.components[t].alarm:null
+};
+ZmInvite.prototype.getInviteMethod=function(e){
+var t=e||0;
+return this.components[t]?this.components[t].method:null
+};
+ZmInvite.prototype.getOrganizerEmail=function(e){
+var t=e||0;
+return(this.components[t]&&this.components[t].or&&this.components[t].or.url)?(this.components[t].or.url.replace("MAILTO:","")):null
+};
+ZmInvite.prototype.getOrganizerName=function(e){
+var t=e||0;
+return(this.components[t]&&this.components[t].or)?(this.components[t].or.d||this.components[t].or.url):null
+};
+ZmInvite.prototype.getSentBy=function(e){
+var t=e||0;
+return(this.components[t]&&this.components[t].or)?this.components[t].or.sentBy:null
+};
+ZmInvite.prototype.isOrganizer=function(e){
+var t=e||0;
+return this.components[t]?(!!this.components[t].isOrg):false
+};
+ZmInvite.prototype.shouldRsvp=function(e){
+var t=e||0;
+return this.components[t]?this.components[t].rsvp:null
+};
+ZmInvite.prototype.getRecurrenceRules=function(e){
+var t=e||0;
+return this.components[t].recur
+};
+ZmInvite.prototype.getAttendees=function(a){
+var n=a||0;
+var e=this.components[n].at;
+var o=[];
+if(!(e&&e.length)){
+return o
+}
+for(var t=0;
+t<e.length;
+t++){
+if(!e[t].cutype||(e[t].cutype==ZmCalendarApp.CUTYPE_INDIVIDUAL)){
+o.push(e[t])
+}}
+return o
+};
+ZmInvite.prototype.getReplies=function(e){
+var t=e||0;
+return(this.replies&&this.replies[t])?this.replies[t].reply:null
+};
+ZmInvite.prototype.getResources=function(a){
+var n=a||0;
+var e=this.components[n].at;
+var o=[];
+if(!(e&&e.length)){
+return o
+}
+for(var t=0;
+t<e.length;
+t++){
+if(e[t].cutype==ZmCalendarApp.CUTYPE_RESOURCE){
+o.push(e[t])
+}}
+return o
+};
+ZmInvite.prototype.getExceptId=function(e){
+var t=e||0;
+return(this.components[t]&&this.components[t].exceptId)?this.components[t].exceptId[0]:null
+};
+ZmInvite.prototype.getStatus=function(e){
+var t=e||0;
+return this.components[t].status
+};
+ZmInvite.prototype.isEmpty=function(){
+return Boolean(this.components.empty)
+};
+ZmInvite.prototype.isException=function(e){
+var t=e||0;
+return this.components[t]?this.components[t].ex:false
+};
+ZmInvite.prototype.isRecurring=function(e){
+var t=e||0;
+return this.components[t]?this.components[t].recur:false
+};
+ZmInvite.prototype.isAllDayEvent=function(e){
+var t=e||0;
+return this.components[t]?this.components[t].allDay=="1":false
+};
+ZmInvite.prototype.isMultiDay=function(t){
+var o=t||0;
+var a=this.getServerStartDate(o);
+var e=this.getServerEndDate(o);
+return(a.getDate()!=e.getDate())||(a.getMonth()!=e.getMonth())||(a.getFullYear()!=e.getFullYear())
+};
+ZmInvite.prototype.getComponentDescriptionHtml=function(e){
+var o=e||0;
+if(this.components[o]==null){
+return
+}
+var a=this.components[o].descHtml;
+var t=a&&a[0]._content||null;
+return t
+};
+ZmInvite.prototype.getComponentDescription=function(e){
+var o=e||0;
+if(this.components[o]==null){
+return
+}
+var a=this.components[o].desc;
+var t=a&&a[0]._content||null;
+return t
+};
+ZmInvite.prototype.getServerEndTime=function(l){
+var u=l||0;
+if(this.components[u]==null){
+return
+}
+if(this._serverEndTime==null){
+if(this.components[u].e!=null){
+this._serverEndTime=this.components[u].e[0].d
+}else{
+if(this.components[u].s){
+var a=this.components[u].dur;
+var f=a&&a[0].d||0;
+var e=a&&a[0].w||0;
+var n=a&&a[0].h||0;
+var s=a&&a[0].m||0;
+var g=a&&a[0].s||0;
+var p=parseInt(g)+(parseInt(s)*60)+(parseInt(n)*3600)+(parseInt(f)*24*3600)+(parseInt(e)*7*24*3600);
+var o=this.components[u].s[0].d;
+var r=parseInt(o.substr(0,4),10);
+var m=parseInt(o.substr(4,2),10);
+var f=parseInt(o.substr(6,2),10);
+var c=new Date(r,m-1,f);
+if(o.charAt(8)=="T"){
+n=parseInt(o.substr(9,2),10);
+s=parseInt(o.substr(11,2),10);
+g=parseInt(o.substr(13,2),10);
+c.setHours(n,s,g,0)
+}
+var h=new Date(c.getTime()+(p*1000));
+m=AjxDateUtil._pad(c.getMonth()+1);
+f=AjxDateUtil._pad(c.getDate());
+n=AjxDateUtil._pad(c.getHours());
+s=AjxDateUtil._pad(c.getMinutes());
+g=AjxDateUtil._pad(c.getSeconds());
+r=c.getFullYear();
+this._serverEndTime=[r,m,f,"T",n,s,g].join("")
+}}}
+return this._serverEndTime
+};
+ZmInvite.prototype.getServerEndDate=function(e){
+var t=e||0;
+if(this._serverEndDate==null){
+this._serverEndDate=AjxDateUtil.parseServerDateTime(this.getServerEndTime(t))
+}
+return this._serverEndDate
+};
+ZmInvite.prototype.getServerStartTime=function(e){
+var t=e||0;
+return this.components[t]&&this.components[t].s?this.components[t].s[0].d:null
+};
+ZmInvite.prototype.getServerStartDate=function(e){
+var t=e||0;
+if(this._serverStartDate==null){
+this._serverStartDate=AjxDateUtil.parseServerDateTime(this.getServerStartTime(t))
+}
+return this._serverStartDate
+};
+ZmInvite.prototype.getServerStartTimeTz=function(e){
+var a=e||0;
+if(this.components[a]==null){
+return
+}
+if(this._serverStartTimeZone==null){
+var t=this.getServerStartTime();
+this._serverStartTimeZone=t&&t.charAt(t.length-1)=="Z"?AjxTimezone.GMT_NO_DST:(this.components[a].s?this.components[a].s[0].tz:null)
+}
+return this._serverStartTimeZone
+};
+ZmInvite.prototype.getServerEndTimeTz=function(t){
+var a=t||0;
+if(this.components[a]==null){
+return
+}
+if(this._serverEndTimeZone==null){
+var e=this.getServerEndTime();
+this._serverEndTimeZone=e&&startTime.charAt(e.length-1)=="Z"?AjxTimezone.GMT_NO_DST:this.components[a].e[0].tz
+}
+return this._serverEndTimeZone
+};
+ZmInvite.prototype.getDurationText=function(d,p,e,r){
+var m=this.components[d];
+if(this.isAllDayEvent(d)){
+if(p){
+return""
+}
+var u=this.getServerStartDate(d);
+if(this.isMultiDay(d)){
+var h=this.getServerEndDate(d);
+var s=AjxDateFormat.getDateInstance();
+var c=s.format(u);
+var t=s.format(h);
+if(!ZmInvite._daysFormatter){
+ZmInvite._daysFormatter=new AjxMessageFormat(ZmMsg.durationDays)
+}
+return ZmInvite._daysFormatter.format([c,t])
+}else{
+var s=AjxDateFormat.getDateInstance(AjxDateFormat.FULL);
+return s.format(u)
+}}else{
+var s=AjxDateFormat.getDateInstance(AjxDateFormat.FULL);
+var n=AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT);
+var u=this.getServerStartDate(d);
+var f=[s.format(u),r?" ":"<br>"];
+if(e){
+f.push(n.format(u))
+}else{
+var h=this.getServerEndDate(d);
+var o=n.format(u);
+var l=n.format(h);
+if(!ZmInvite._hoursFormatter){
+ZmInvite._hoursFormatter=new AjxMessageFormat(ZmMsg.durationHours)
+}
+f.push(ZmInvite._hoursFormatter.format([o,l]))
+}
+return f.join("")
+}};
+ZmInvite.prototype.getName=function(e){
+var t=e||0;
+return this.components[t]?this.components[t].name:null
+};
+ZmInvite.prototype.getFreeBusy=function(e){
+var t=e||0;
+return this.components[t]?this.components[t].fb:null
+};
+ZmInvite.prototype.getPrivacy=function(e){
+var t=e||0;
+return this.components[t]?this.components[t]["class"]:null
+};
+ZmInvite.prototype.getXProp=function(e){
+var t=e||0;
+return this.components[t]?this.components[t]["xprop"]:null
+};
+ZmInvite.prototype.getLocation=function(e){
+var t=e||0;
+return this.components[t]?this.components[t].loc:null
+};
+ZmInvite.prototype.getToolTip=function(){
+if(this._toolTip){
+return this._toolTip
+}
+var o=0;
+var a=[];
+var t=0;
+a[t++]="<table cellpadding=0 cellspacing=0 border=0 >";
+a[t++]="<tr valign='center'><td colspan=2 align='left'>";
+a[t++]="<div style='border-bottom: 1px solid black;'>";
+a[t++]="<table cellpadding=0 cellspacing=0 border=0 width=100%>";
+a[t++]="<tr valign='center'><td><b>";
+a[t++]="<div style='white-space:nowrap'><table border=0 cellpadding=0 cellspacing=0 style='display:inline'><tr>";
+if(this.hasOtherAttendees(o)){
+a[t++]="<td>";
+a[t++]=AjxImg.getImageHtml("ApptMeeting");
+a[t++]="</td>"
+}
+if(this.isException(o)){
+a[t++]="<td>";
+a[t++]=AjxImg.getImageHtml("ApptException");
+a[t++]="</td>"
+}else{
+if(this.isRecurring(o)){
+a[t++]="<td>";
+a[t++]=AjxImg.getImageHtml("ApptRecur");
+a[t++]="</td>"
+}}
+a[t++]="</tr></table>&nbsp;";
+a[t++]=AjxStringUtil.htmlEncode(this.getName(o));
+a[t++]="&nbsp;</div></b></td><td align='right'>";
+a[t++]=AjxImg.getImageHtml("Appointment");
+a[t++]="</td></table></div></td></tr>";
+var e=this.getDurationText(o,false,false);
+t=this._addEntryRow(ZmMsg.when,e,a,t,false,null,true);
+if(this.isRecurring(o)){
+if(!this._recurBlurb){
+AjxDispatcher.require("CalendarCore");
+var n=new ZmRecurrence();
+n.parse(this.getRecurrenceRules(o));
+this._recurBlurb=n.getBlurb()
+}
+t=this._addEntryRow(ZmMsg.repeats,this._recurBlurb,a,t,true,null,true)
+}
+t=this._addEntryRow(ZmMsg.location,this.getLocation(o),a,t,false);
+a[t++]="</table>";
+this._toolTip=a.join("");
+return this._toolTip
+};
+ZmInvite.prototype.getSummary=function(e){
+var r=0;
+var l=this.getOrganizerName(r);
+var d=this.getDurationText(r,false,false,true);
+var h=this.getLocation(r);
+if(this.isRecurring(r)){
+if(!this._recurBlurb){
+AjxDispatcher.require("CalendarCore");
+var s=new ZmRecurrence();
+s.setRecurrenceRules(this.getRecurrenceRules(r),this.getServerStartDate(r));
+this._recurBlurb=s.getBlurb()
+}}
+var n=this._recurBlurb;
+var t=[];
+var o=0;
+if(!this._summaryHtmlLineFormatter){
+this._summaryHtmlLineFormatter=new AjxMessageFormat("<tr><th align='left'>{0}</th><td>{1} {2}</td></tr>");
+this._summaryTextLineFormatter=new AjxMessageFormat("{0} {1} {2}")
+}
+var c=e?this._summaryHtmlLineFormatter:this._summaryTextLineFormatter;
+var a=[];
+if(e){
+t[o++]="<p>\n<table border='0'>\n"
+}
+if(l){
+a=[ZmMsg.organizerLabel,l,""];
+t[o++]=c.format(a);
+t[o++]="\n"
+}
+if(d){
+a=[ZmMsg.whenLabel,d,""];
+t[o++]=c.format(a);
+t[o++]="\n"
+}
+if(h){
+a=[ZmMsg.locationLabel,h,""];
+t[o++]=c.format(a);
+t[o++]="\n"
+}
+if(n){
+a=[ZmMsg.repeatLabel,n,""];
+t[o++]=c.format(a);
+t[o++]="\n"
+}
+if(e){
+t[o++]="</table>\n"
+}
+t[o++]=e?"<div>":"\n\n";
+t[o++]=ZmItem.NOTES_SEPARATOR;
+t[o++]=e?"</div><br>":"\n\n";
+return t.join("")
+};
+ZmInvite.prototype._addEntryRow=function(r,s,t,e,n,o,a){
+if(s!=null&&s!=""){
+t[e++]="<tr valign='top'><td align='right' style='padding-right: 5px;'><b><div style='white-space:nowrap'>";
+t[e++]=AjxMessageFormat.format(ZmMsg.makeLabel,AjxStringUtil.htmlEncode(r));
+t[e++]="</div></b></td><td align='left'><div style='white-space:";
+t[e++]=n?"wrap;":"nowrap;";
+if(o){
+t[e++]="width:";
+t[e++]=o;
+t[e++]="px;"
+}
+t[e++]="'>";
+t[e++]=a?s:AjxStringUtil.htmlEncode(s);
+t[e++]="</div></td></tr>"
+}
+return e
+};
+ZmInvite.prototype.hasAcceptableComponents=function(){
+for(var e in this.components){
+if(this.getStatus(e)!=ZmCalendarApp.STATUS_CANC){
+return true
+}}
+return false
+};
+ZmInvite.prototype.hasInviteReplyMethod=function(t){
+var e=this.getInviteMethod(t);
+var a=(e==ZmCalendarApp.METHOD_REQUEST||e==ZmCalendarApp.METHOD_PUBLISH);
+return((e==null)||a)
+}
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmImAddress")){
+ZmImAddress={
+IM_SERVICES:[{
+label:ZmMsg.zimbraTitle,value:"local"}
+,{
+label:ZmMsg.yahoo,value:"yahoo"}
+,{
+label:ZmMsg.msn,value:"msn"}
+,{
+label:ZmMsg.aol,value:"aol"}
+,{
+label:ZmMsg.other,value:"other"}
+],REGEXP:[],parse:function(t){
+var e=ZmImAddress.REGEXP.exec(t);
+if(e){
+return{
+service:e[1],screenName:e[2]}
+}}
+,make:function(e,t){
+var a=e+"://"+t;
+if(ZmImAddress.parse(a)){
+return a
+}
+return""
+}
+,display:function(r){
+var n=ZmImAddress.parse(r);
+if(n){
+var e=ZmImAddress.IM_SERVICES,t=0,o;
+while(o=e[t++]){
+if(o.value==n.service){
+break
+}}
+if(o){
+return n.screenName+" ("+o.label+")"
+}}
+return r
+}};
+if(/^SmartZone/.test(ZmMsg.zimbraTitle)){
+ZmImAddress.IM_SERVICES.splice(0,1)
+}
+for(var i=0;
+i<ZmImAddress.IM_SERVICES.length;
+++i){
+ZmImAddress.REGEXP.push(ZmImAddress.IM_SERVICES[i].value)
+}
+ZmImAddress.REGEXP=new RegExp("^("+ZmImAddress.REGEXP.join("|")+")://([^\\s]+)$","i")
+}
+if(AjxPackage.define("zimbraMail.share.model.ZmAccessControlList")){
+ZmAccessControlList=function(e){
+this._aces={}
+};
+ZmAccessControlList.prototype.toString=function(){
+return"ZmAccessControlList"
+};
+ZmAccessControlList.prototype.load=function(a){
+var t={
+GetPermissionRequest:{
+_jsns:"urn:zimbraMail"}};
+var e=new AjxCallback(this,this._handleResponseLoad,[a]);
+appCtxt.getAppController().sendRequest({
+jsonObj:t,asyncMode:true,callback:e}
+)
+};
+ZmAccessControlList.prototype._handleResponseLoad=function(n,e){
+var t=e.getResponse();
+var o=t.GetPermissionResponse.ace;
+if(o&&o.length){
+for(var a=0;
+a<o.length;
+a++){
+this.add(ZmAccessControlEntry.createFromDom(o[a]))
+}}
+if(n){
+n.run()
+}};
+ZmAccessControlList.prototype.getACLByRight=function(e){
+return this._aces[e]
+};
+ZmAccessControlList.prototype.getGranteeType=function(u){
+var t=this._aces[u];
+var a=ZmSetting.ACL_PUBLIC;
+var m={};
+if(t&&t.length){
+for(var r=0;
+r<t.length;
+r++){
+var n=t[r];
+var c=(n.granteeType==ZmSetting.ACL_USER||n.granteeType==ZmSetting.ACL_GROUP)?ZmSetting.ACL_USER:n.granteeType;
+m[c]=n.negative?-1:1
+}}
+var d=(m[ZmSetting.ACL_PUBLIC]==1);
+var o=(m[ZmSetting.ACL_PUBLIC]==-1);
+var h=(m[ZmSetting.ACL_AUTH]==1);
+var s=(m[ZmSetting.ACL_AUTH]==-1);
+var l=(m[ZmSetting.ACL_USER]==1);
+var e=(o||s)&&(m[ZmSetting.ACL_USER]==null);
+if(d){
+return ZmSetting.ACL_PUBLIC
+}
+if(h){
+return ZmSetting.ACL_AUTH
+}
+if(o){
+if(h){
+return ZmSetting.ACL_AUTH
+}}
+if(l){
+return ZmSetting.ACL_USER
+}
+if(e){
+return ZmSetting.ACL_NONE
+}
+return a
+};
+ZmAccessControlList.prototype.getACLByGranteeType=function(o,e){
+var a=this._aces[o];
+var s=[];
+if(a&&a.length){
+for(var t=0;
+t<a.length;
+t++){
+var n=a[t];
+if(n.granteeType==e){
+s.push(n)
+}}}
+s.sort();
+return s
+};
+ZmAccessControlList.prototype.getGrantees=function(a){
+var t=this._aces[a];
+var n=[];
+if(t&&t.length){
+for(var e=0;
+e<t.length;
+e++){
+var o=t[e];
+if(o.granteeType==ZmSetting.ACL_USER||o.granteeType==ZmSetting.ACL_GROUP){
+n.push(o.grantee)
+}}}
+n.sort();
+return n
+};
+ZmAccessControlList.prototype.getGranteesInfo=function(a){
+var t=this._aces[a];
+var n=[];
+if(t&&t.length){
+for(var e=0;
+e<t.length;
+e++){
+var o=t[e];
+if(o.granteeType==ZmSetting.ACL_USER||o.granteeType==ZmSetting.ACL_GROUP){
+n.push({
+grantee:o.grantee,zid:o.zid}
+)
+}}}
+n.sort(ZmAccessControlList.sortByGrantee);
+return n
+};
+ZmAccessControlList.prototype.grant=function(t,a,e){
+this._setPerms(t,false,a,e)
+};
+ZmAccessControlList.prototype.revoke=function(t,a,e){
+this._setPerms(t,true,a,e)
+};
+ZmAccessControlList.prototype._setPerms=function(e,l,h,a){
+var o=l?"RevokePermissionRequest":"GrantPermissionRequest";
+var s=AjxSoapDoc.create(o,"urn:zimbraMail");
+for(var n=0;
+n<e.length;
+n++){
+var t=e[n];
+var r=s.set("ace");
+r.setAttribute("right",t.right);
+r.setAttribute("gt",t.granteeType);
+if(t.grantee){
+r.setAttribute("d",t.grantee)
+}
+if(t.zid){
+r.setAttribute("zid",t.zid)
+}
+if(t.negative){
+r.setAttribute("deny",1)
+}}
+var c=new AjxCallback(this,this._handleResponseSetPerms,[l,h]);
+if(a){
+a.addNewRequestParams(s,c)
+}else{
+appCtxt.getAppController().sendRequest({
+soapDoc:s,asyncMode:true,callback:c}
+)
+}};
+ZmAccessControlList.prototype._handleResponseSetPerms=function(h,r,l){
+var n=l.getResponse();
+var o=h?n.RevokePermissionResponse:n.GrantPermissionResponse;
+var e=o&&o.ace;
+var t=[];
+if(e&&e.length){
+for(var s=0;
+s<e.length;
+s++){
+var a=ZmAccessControlEntry.createFromDom(e[s]);
+t.push(a);
+if(h){
+this.remove(a)
+}else{
+this.update(a)
+}}}
+if(r){
+r.run(t)
+}};
+ZmAccessControlList.prototype.add=function(t){
+if(!t){
+return
+}
+var e=t.right;
+if(!this._aces[e]){
+this._aces[e]=[]
+}
+this._aces[e].push(t)
+};
+ZmAccessControlList.prototype.remove=function(a){
+if(!a){
+return
+}
+var o=this._aces[a.right];
+var t=[];
+if(o&&o.length){
+for(var e=0;
+e<o.length;
+e++){
+if(o[e].grantee!=a.grantee){
+t.push(o[e])
+}}}
+this._aces[a.right]=t
+};
+ZmAccessControlList.prototype.update=function(t,n){
+if(!t||!t.right){
+return
+}
+var o=false;
+if(!this._aces[t.right]){
+this._aces[t.right]=[]
+}
+var a=this._aces[t.right];
+if(a.length){
+for(var e=0;
+e<a.length;
+e++){
+if((a[e].grantee==t.grantee)&&(a[e].granteeType==t.granteeType)){
+this._aces[t.right][e]=t;
+o=true
+}}}
+if(!o){
+this._aces[t.right].push(t)
+}};
+ZmAccessControlList.prototype.cleanup=function(){
+this._aces={}
+};
+ZmAccessControlList.sortByGrantee=function(o,e){
+var n=o.grantee;
+var t=e.grantee;
+if(n.toLowerCase()>t.toLowerCase()){
+return 1
+}
+if(n.toLowerCase()<t.toLowerCase()){
+return -1
+}
+return 0
+};
+ZmAccessControlEntry=function(e){
+this.grantee=e.grantee;
+this.zid=e.zid;
+this.granteeType=e.granteeType;
+this.right=e.right;
+this.negative=e.negative
+};
+ZmAccessControlEntry.prototype.toString=function(){
+return"ZmAccessControlEntry"
+};
+ZmAccessControlEntry.createFromDom=function(e){
+var t={};
+t.grantee=e.d;
+t.granteeType=e.gt;
+t.zid=e.zid;
+t.right=e.right;
+t.negative=(e.deny=="1");
+return new ZmAccessControlEntry(t)
+}
+}
+if(AjxPackage.define("zimbraMail.core.ZmApp")){
+ZmApp=function(a,t,e){
+if(arguments.length==0){
+return
+}
+this._name=a;
+this._appViewMgr=appCtxt.getAppViewMgr();
+this._container=t;
+this._parentController=e;
+this._active=false;
+this.currentSearch=null;
+this._deferredFolders=[];
+this._deferredFolderHash={};
+this._deferredNotifications=[];
+ZmApp.DROP_TARGETS[a]={};
+this._defineAPI();
+if(!e){
+this._registerSettings()
+}
+this._registerOperations();
+this._registerItems();
+this._registerOrganizers();
+if(!e){
+this._setupSearchToolbar()
+}
+this._registerApp();
+if(!appCtxt.isChildWindow){
+this._opc=appCtxt.getOverviewController()
+}};
+ZmApp.CLASS={};
+ZmApp.SETTING={};
+ZmApp.UPSELL_SETTING={};
+ZmApp.LOAD_SORT={};
+ZmApp.BUTTON_ID={};
+ZmApp.MAIN_PKG={};
+ZmApp.NAME={};
+ZmApp.ICON={};
+ZmApp.TEXT_PRECEDENCE={};
+ZmApp.IMAGE_PRECEDENCE={};
+ZmApp.QS_ARG={};
+ZmApp.QS_ARG_R={};
+ZmApp.CHOOSER_TOOLTIP={};
+ZmApp.VIEW_TOOLTIP={};
+ZmApp.DEFAULT_SEARCH={};
+ZmApp.ORGANIZER={};
+ZmApp.OVERVIEW_TREES={};
+ZmApp.HIDE_ZIMLETS={};
+ZmApp.SEARCH_TYPES={};
+ZmApp.SEARCH_TYPES_R={};
+ZmApp.GOTO_ACTION_CODE={};
+ZmApp.GOTO_ACTION_CODE_R={};
+ZmApp.NEW_ACTION_CODE={};
+ZmApp.ACTION_CODES={};
+ZmApp.ACTION_CODES_R={};
+ZmApp.OPS={};
+ZmApp.OPS_R={};
+ZmApp.QS_VIEWS={};
+ZmApp.TRASH_VIEW_OP={};
+ZmApp.UPSELL_URL={};
+ZmApp.DROP_TARGETS={};
+ZmApp.ASSISTANTS={};
+ZmApp.CHOOSER_SORT={};
+ZmApp.DEFAULT_SORT={};
+ZmApp.ENABLED_APPS={};
+ZmApp.APPS=[];
+ZmApp.DEFAULT_APPS=[];
+ZmApp.OVERVIEW_ID="main";
+ZmApp.initialize=function(){
+if(appCtxt.get(ZmSetting.USE_KEYBOARD_SHORTCUTS)){
+ZmApp.ACTION_CODES[ZmKeyMap.NEW_FOLDER]=ZmOperation.NEW_FOLDER;
+ZmApp.ACTION_CODES[ZmKeyMap.NEW_TAG]=ZmOperation.NEW_TAG
+}};
+ZmApp.registerApp=function(n,o){
+if(o.mainPkg){
+ZmApp.MAIN_PKG[n]=o.mainPkg
+}
+if(o.nameKey){
+ZmApp.NAME[n]=o.nameKey
+}
+if(o.icon){
+ZmApp.ICON[n]=o.icon
+}
+if(o.textPrecedence){
+ZmApp.TEXT_PRECEDENCE[n]=o.textPrecedence
+}
+if(o.imagePrecedence){
+ZmApp.IMAGE_PRECEDENCE[n]=o.imagePrecedence
+}
+if(o.chooserTooltipKey){
+ZmApp.CHOOSER_TOOLTIP[n]=o.chooserTooltipKey
+}
+if(o.viewTooltipKey){
+ZmApp.VIEW_TOOLTIP[n]=o.viewTooltipKey
+}
+if(o.defaultSearch){
+ZmApp.DEFAULT_SEARCH[n]=o.defaultSearch
+}
+if(o.organizer){
+ZmApp.ORGANIZER[n]=o.organizer
+}
+if(o.overviewTrees){
+ZmApp.OVERVIEW_TREES[n]=o.overviewTrees
+}
+if(o.hideZimlets){
+ZmApp.HIDE_ZIMLETS[n]=o.hideZimlets
+}
+if(o.assistants){
+ZmApp.ASSISTANTS[n]=o.assistants
+}
+if(o.searchTypes){
+ZmApp.SEARCH_TYPES[n]=o.searchTypes
+}
+if(o.gotoActionCode){
+ZmApp.GOTO_ACTION_CODE[n]=o.gotoActionCode
+}
+if(o.newActionCode){
+ZmApp.NEW_ACTION_CODE[n]=o.newActionCode
+}
+if(o.qsViews){
+ZmApp.QS_VIEWS[n]=o.qsViews
+}
+if(o.chooserSort){
+ZmApp.CHOOSER_SORT[n]=o.chooserSort
+}
+if(o.defaultSort){
+ZmApp.DEFAULT_SORT[n]=o.defaultSort
+}
+if(o.trashViewOp){
+ZmApp.TRASH_VIEW_OP[n]=o.trashViewOp
+}
+if(o.upsellUrl){
+ZmApp.UPSELL_URL[n]=o.upsellUrl
+}
+if(o.searchTypes){
+ZmApp.SEARCH_TYPES_R[n]={};
+for(var t=0;
+t<o.searchTypes.length;
+t++){
+ZmApp.SEARCH_TYPES_R[n][o.searchTypes[t]]=true
+}}
+if(o.gotoActionCode){
+ZmApp.GOTO_ACTION_CODE_R[o.gotoActionCode]=n
+}
+if(o.actionCodes){
+for(var a in o.actionCodes){
+if(!a){
+continue
+}
+ZmApp.ACTION_CODES_R[a]=n;
+ZmApp.ACTION_CODES[a]=o.actionCodes[a]
+}}
+var e=appCtxt.get(ZmApp.SETTING[n]);
+if(o.newItemOps&&e){
+for(var s in o.newItemOps){
+if(!s){
+continue
+}
+ZmApp.OPS_R[s]=n;
+ZmOperation.NEW_ITEM_OPS.push(s);
+ZmOperation.NEW_ITEM_KEY[s]=o.newItemOps[s]
+}}
+if(o.newOrgOps&&e){
+for(var s in o.newOrgOps){
+if(!s){
+continue
+}
+ZmApp.OPS_R[s]=n;
+ZmOperation.NEW_ORG_OPS.push(s);
+ZmOperation.NEW_ORG_KEY[s]=o.newOrgOps[s]
+}}
+if(o.qsViews){
+for(var t=0;
+t<o.qsViews.length;
+t++){
+ZmApp.QS_VIEWS[o.qsViews[t]]=n
+}}};
+ZmApp.prototype.toString=function(){
+return"ZmApp"
+};
+ZmApp.prototype._defineAPI=function(){};
+ZmApp.prototype._registerSettings=function(){};
+ZmApp.prototype._registerOperations=function(){};
+ZmApp.prototype._registerItems=function(){};
+ZmApp.prototype._registerOrganizers=function(){};
+ZmApp.prototype._setupSearchToolbar=function(){};
+ZmApp.prototype._registerApp=function(){};
+ZmApp.prototype._registerPrefs=function(){};
+ZmApp.prototype.startup=function(e){};
+ZmApp.prototype.preNotify=function(e){};
+ZmApp.prototype.deleteNotify=function(e){};
+ZmApp.prototype.createNotify=function(e){};
+ZmApp.prototype.modifyNotify=function(e){};
+ZmApp.prototype.postNotify=function(e){};
+ZmApp.prototype.refresh=function(e){};
+ZmApp.prototype.handleOp=function(t,e){};
+ZmApp.prototype.getName=function(){
+return this._name
+};
+ZmApp.prototype.getDisplayName=function(){
+return ZmMsg[ZmApp.NAME[this._name]]
+};
+ZmApp.prototype.getInitialSearchType=function(){
+return null
+};
+ZmApp.prototype.getLimit=function(e){
+return appCtxt.get(ZmSetting.PAGE_SIZE)
+};
+ZmApp.prototype.setAppView=function(e){
+this._appViewMgr.setAppView(this._name,e)
+};
+ZmApp.prototype.createView=function(e){
+e.appName=this._name;
+return this._appViewMgr.createView(e)
+};
+ZmApp.prototype.pushView=function(e,t){
+return this._appViewMgr.pushView(e,t)
+};
+ZmApp.prototype.popView=function(e){
+return this._appViewMgr.popView(e)
+};
+ZmApp.prototype.setView=function(e,t){
+return this._appViewMgr.setView(e,t)
+};
+ZmApp.prototype.stageView=function(e){
+return this._appViewMgr.setView(e)
+};
+ZmApp.prototype.addDeferredFolder=function(e){
+var t=e.obj&&e.obj.id;
+if(t&&!this._deferredFolderHash[t]){
+this._deferredFolders.push(e);
+this._deferredFolderHash[t]=true;
+appCtxt.cacheSetDeferred(t,this._name)
+}};
+ZmApp.prototype.getRemoteFolderIds=function(r){
+var s=[];
+if(this._opc){
+var o=ZmApp.ORGANIZER[this.getName()];
+if(this._deferredFolders.length){
+this._createDeferredFolders(o)
+}
+var e=appCtxt.getFolderTree(r);
+var a=e?e.getByType(o):[];
+for(var t=0;
+t<a.length;
+t++){
+var n=a[t];
+if(n.isRemote()){
+s.push(n.id)
+}}}
+return s
+};
+ZmApp.prototype.getOverviewPanelContent=function(){
+if(!this._overviewPanelContent){
+var t=this._getOverviewParams();
+t.overviewId=this.getOverviewId();
+var e=this._overviewPanelContent=this._opc.createOverview(t);
+e.set(this._getOverviewTrees())
+}
+return this._overviewPanelContent
+};
+ZmApp.prototype.getOverviewContainer=function(){
+if(!this._overviewContainer){
+var e={
+appName:this._name,containerId:([ZmApp.OVERVIEW_ID,this._name].join("_")),posStyle:Dwt.ABSOLUTE_STYLE};
+var t=this._getOverviewParams();
+t.overviewTrees=this._getOverviewTrees();
+this._overviewContainer=this._opc.createOverviewContainer(e,t)
+}
+return this._overviewContainer
+};
+ZmApp.prototype.setOverviewPanelContent=function(a){
+if(a){
+this._overviewPanelContent=null;
+this._overviewContainer=null
+}
+var e=appCtxt.getAppViewMgr();
+if(!e.isFullScreen()){
+var t=(appCtxt.multiAccounts||this.getName()==ZmApp.VOICE)?this.getOverviewContainer():this.getOverviewPanelContent();
+e.setComponent(ZmAppViewMgr.C_TREE,t)
+}};
+ZmApp.prototype.getOverview=function(){
+return this._opc&&this._opc.getOverview(this.getOverviewId())
+};
+ZmApp.prototype.resetOverview=function(t){
+var u=t?this._opc.getOverview(t):this.getOverview();
+if(u){
+var s=[];
+var d=u.getTreeViews(),l=d.length;
+for(var n=0;
+n<l;
+n++){
+var h=d[n];
+var e=u.getTreeView(h);
+var c=e.getTreeItemList();
+var o=c.length;
+for(var a=0;
+a<o;
+a++){
+var r=c[a];
+if(r._expanded){
+s.push(r._htmlElId)
+}}}
+u.clear();
+u.set(this._getOverviewTrees());
+l=s.length;
+for(var n=0;
+n<l;
+n++){
+var r=DwtControl.fromElementId(s[n]);
+if(r&&!r._expanded){
+r.setExpanded(true)
+}}}};
+ZmApp.prototype.getOverviewId=function(e){
+return appCtxt.getOverviewId([ZmApp.OVERVIEW_ID,this._name],e)
+};
+ZmApp.prototype._getOverviewParams=function(){
+var e=[];
+for(var a in ZmOverviewController.CONTROLLER){
+e.push(a)
+}
+var t=function(n,o){
+return(ZmOrganizer.DISPLAY_ORDER[n]||9999)-(ZmOrganizer.DISPLAY_ORDER[o]||9999)
+};
+e.sort(t);
+return{
+posStyle:Dwt.ABSOLUTE_STYLE,selectionSupported:true,actionSupported:true,dndSupported:true,showUnread:true,showNewButtons:true,isAppOverview:true,treeIds:e,appName:this._name,account:appCtxt.getActiveAccount(),scroll:Dwt.SCROLL_Y}
+};
+ZmApp.prototype._getOverviewTrees=function(){
+var o=ZmApp.OVERVIEW_TREES[this._name]||[];
+var t=[];
+for(var e=0,a=o.length;
+e<a;
+e++){
+if((o[e]==ZmOrganizer.FOLDER&&!appCtxt.get(ZmSetting.MAIL_ENABLED))){
+continue
+}
+t.push(o[e])
+}
+if(!appCtxt.multiAccounts&&window[ZmOverviewController.CONTROLLER[ZmOrganizer.ZIMLET]]&&!ZmApp.HIDE_ZIMLETS[this._name]){
+t.push(ZmOrganizer.ZIMLET)
+}
+return t
+};
+ZmApp.prototype._setMiniCalForActiveAccount=function(e){
+var t=appCtxt.get(ZmSetting.CAL_ALWAYS_SHOW_MINI_CAL);
+AjxDispatcher.run("ShowMiniCalendar",t);
+if(t&&e){
+var a=AjxDispatcher.run("GetCalController");
+a._checkedCalendars=null;
+a._checkedCalendarIds=null;
+a.getMiniCalCache().clearCache();
+a.fetchMiniCalendarAppts(ZmCalViewController.MAINT_MINICAL)
+}};
+ZmApp.prototype._addSettingsChangeListeners=function(){
+if(!this._settingListener){
+this._settingListener=new AjxListener(this,this._settingChangeListener)
+}
+var e=appCtxt.getSettings();
+setting=e.getSetting(ZmSetting.CAL_ALWAYS_SHOW_MINI_CAL);
+if(setting){
+setting.addChangeListener(this._settingListener)
+}
+setting=e.getSetting(ZmSetting.CAL_FIRST_DAY_OF_WEEK);
+if(setting){
+setting.addChangeListener(this._settingListener)
+}};
+ZmApp.prototype._settingChangeListener=function(n){
+if(n.type!=ZmEvent.S_SETTING){
+return
+}
+var o=n.source;
+if(o.id==ZmSetting.CAL_ALWAYS_SHOW_MINI_CAL){
+if(o.getValue()){
+AjxDispatcher.run("ShowMiniCalendar",true)
+}else{
+if(!this._active){
+AjxDispatcher.run("ShowMiniCalendar",false)
+}}}else{
+if(o.id==ZmSetting.CAL_FIRST_DAY_OF_WEEK){
+var e=AjxDispatcher.run("GetCalController");
+var s=e.getMiniCalendar();
+var t=o.getValue();
+s.setFirstDayOfWeek(t);
+var a=s.getDate();
+e.setDate(a,0,true)
+}}};
+ZmApp.prototype.getSearchParams=function(e){
+return(e||{}
+)
+};
+ZmApp.prototype._postLoadCore=function(){
+if(!appCtxt.isChildWindow){
+this._setupDropTargets()
+}};
+ZmApp.prototype._postLoad=function(e){
+if(e){
+this._createDeferredFolders(e)
+}
+this._handleDeferredNotifications()
+};
+ZmApp.prototype._setupDropTargets=function(){
+var a=ZmApp.DROP_TARGETS[this._name];
+for(var s in a){
+var t=a[s];
+for(var o=0;
+o<t.length;
+o++){
+var r=t[o];
+var e=appCtxt.getOverviewController().getTreeController(r,true);
+var n=ZmList.ITEM_CLASS[s]||ZmOrganizer.ORG_CLASS[s];
+if(e){
+e._dropTgt.addTransferType(n)
+}else{
+if(!ZmTreeController.DROP_SOURCES[r]){
+ZmTreeController.DROP_SOURCES[r]=[]
+}
+ZmTreeController.DROP_SOURCES[r].push(n)
+}}}};
+ZmApp.prototype.createDeferred=function(){
+var a=ZmOrganizer.APP2ORGANIZER[this._name]||[];
+for(var t=0;
+t<a.length;
+t++){
+var o=a[t];
+var e=ZmOrganizer.ORG_PACKAGE[o];
+AjxDispatcher.require(e);
+this._createDeferredFolders(o)
+}};
+ZmApp.prototype._createDeferredFolders=function(t){
+for(var e=0;
+e<this._deferredFolders.length;
+e++){
+var o=this._deferredFolders[e];
+var a=ZmFolderTree.createFolder(o.type,o.parent,o.obj,o.tree,o.path,o.elementType);
+o.parent.children.add(a);
+a.parent=o.parent;
+ZmFolderTree._traverse(a,o.obj,o.tree,o.path||[])
+}
+this._clearDeferredFolders()
+};
+ZmApp.prototype._clearDeferredFolders=function(){
+this._deferredFolders=[];
+this._deferredFolderHash={}
+};
+ZmApp.prototype._deferNotifications=function(t,a){
+var e=ZmApp.MAIN_PKG[this._name];
+if(e&&!AjxDispatcher.loaded(e)){
+this._deferredNotifications.push({
+type:t,data:a}
+);
+return true
+}else{
+this._noDefer=true;
+return false
+}};
+ZmApp.prototype._handleDeferredNotifications=function(){
+var t=this._deferredNotifications;
+for(var a=0;
+a<t.length;
+a++){
+var e=t[a];
+if(e.type=="delete"){
+this.deleteNotify(e.data,true)
+}else{
+if(e.type=="create"){
+this.createNotify(e.data,true)
+}else{
+if(e.type=="modify"){
+this.modifyNotify(e.data,true)
+}}}}};
+ZmApp.prototype._inNewWindow=function(t){
+var e=appCtxt.get(ZmSetting.NEW_WINDOW_COMPOSE);
+return !t?e:((!e&&t&&t.shiftKey)||(e&&t&&!t.shiftKey))
+};
+ZmApp.prototype._handleCreateFolder=function(e,a){
+var t=appCtxt.getById(e.l);
+if(t&&(ZmOrganizer.VIEWS[a][e.view])){
+t.notifyCreate(e);
+e._handled=true
+}};
+ZmApp.prototype._handleCreateLink=function(t,o){
+var a=appCtxt.getById(t.l);
+var e=t.view||"message";
+if(a&&a.supportsSharing()&&(ZmOrganizer.VIEW_HASH[o][e])){
+a.notifyCreate(t);
+t._handled=true
+}};
+ZmApp.prototype.launch=function(e,t){
+this.createDeferred();
+if(t){
+t.run()
+}};
+ZmApp.prototype.activate=function(e){
+this._active=e;
+if(e){
+this.setOverviewPanelContent();
+this.stopAlert()
+}};
+ZmApp.prototype.isActive=function(){
+return this._active
+};
+ZmApp.prototype.reset=function(e){};
+ZmApp.prototype.startAlert=function(){
+AjxDispatcher.require("Alert");
+this._alert=this._alert||new ZmAppAlert(this);
+this._alert.start()
+};
+ZmApp.prototype.stopAlert=function(){
+if(this._alert){
+this._alert.stop()
+}};
+ZmApp.prototype._notifyRendered=function(){
+if(!this._hasRendered){
+appCtxt.getAppController().appRendered(this._name);
+this._hasRendered=true
+}}
+}
+if(AjxPackage.define("zimbraMail.share.view.ZmPopupMenu")){
+ZmPopupMenu=function(a,t,o,e){
+if(arguments.length==0){
+return
+}
+params=Dwt.getParams(arguments,ZmPopupMenu.PARAMS);
+params.className=params.className?params.className:"ActionMenu";
+params.style=params.style||DwtMenu.POPUP_STYLE;
+DwtMenu.call(this,params);
+e=e||appCtxt.getCurrentController();
+if(e){
+this._controller=e;
+this._keyMap=ZmKeyMap.MAP_NAME_R[this._controller.getKeyMapName()]
+}
+this._menuItems={}
+};
+ZmPopupMenu.PARAMS=["parent","className","id","controller"];
+ZmPopupMenu.prototype=new DwtMenu;
+ZmPopupMenu.prototype.constructor=ZmPopupMenu;
+ZmPopupMenu.prototype.toString=function(){
+return"ZmPopupMenu"
+};
+ZmPopupMenu.prototype.addSelectionListener=function(o,a,e){
+var t=this._menuItems[o];
+if(t){
+t.addSelectionListener(a,e)
+}};
+ZmPopupMenu.prototype.removeSelectionListener=function(a,t){
+var e=this._menuItems[a];
+if(e){
+e.removeSelectionListener(t)
+}};
+ZmPopupMenu.prototype.popup=function(t,e,o,a){
+t=t?t:0;
+e=(e!=null)?e:Dwt.DEFAULT;
+o=(o!=null)?o:Dwt.DEFAULT;
+DwtMenu.prototype.popup.call(this,t,e,o,a)
+};
+ZmPopupMenu.prototype.enable=function(a,e){
+a=(a instanceof Array)?a:[a];
+for(var t=0;
+t<a.length;
+t++){
+if(this._menuItems[a[t]]){
+this._menuItems[a[t]].setEnabled(e)
+}}};
+ZmPopupMenu.prototype.enableAll=function(e){
+for(var t in this._menuItems){
+this._menuItems[t].setEnabled(e)
+}};
+ZmPopupMenu.prototype.createMenuItem=function(a,t){
+var e=this._menuItems[a]=new DwtMenuItem({
+parent:this,style:t.style,radioGroupId:t.radioGroupId,id:t.id,index:t.index}
+);
+if(t.image){
+e.setImage(t.image)
+}
+if(t.text){
+e.setText(t.text)
+}
+if(t.shortcut){
+e.setShortcut(appCtxt.getShortcutHint(this._keyMap,t.shortcut))
+}
+e.setEnabled(t.enabled!==false);
+return e
+};
+ZmPopupMenu.prototype.getMenuItem=function(e){
+return this._menuItems[e]
+};
+ZmPopupMenu.prototype.createSeparator=function(){
+new DwtMenuItem({
+parent:this,style:DwtMenuItem.SEPARATOR_STYLE}
+)
+}
+}
+if(AjxPackage.define("zimbraMail.share.view.ZmActionMenu")){
+ZmActionMenu=function(t){
+var a=t.context?ZmId.getMenuId(t.context,t.menuType):null;
+ZmPopupMenu.call(this,t.parent,null,a,t.controller);
+var e=t.menuItems;
+if(!e){
+e=[ZmOperation.TAG_MENU,ZmOperation.PRINT,ZmOperation.DELETE]
+}else{
+if(e==ZmOperation.NONE){
+e=null
+}}
+this.opList=ZmOperation.filterOperations(e);
+this._context=t.context;
+this._menuType=t.menuType;
+this._menuItems=ZmOperation.createOperations(this,this.opList,t.overrides)
+};
+ZmActionMenu.prototype=new ZmPopupMenu;
+ZmActionMenu.prototype.constructor=ZmActionMenu;
+ZmActionMenu.prototype.toString=function(){
+return"ZmActionMenu"
+};
+ZmActionMenu.prototype.createOp=function(a,t){
+t.id=this._context?ZmId.getMenuItemId(this._context,a,this._menuType):null;
+var e=this.createMenuItem(a,t);
+e.setData(ZmOperation.KEY_ID,a);
+return e
+};
+ZmActionMenu.prototype.addOp=function(e){
+ZmOperation.addOperation(this,e,this._menuItems)
+};
+ZmActionMenu.prototype.removeOp=function(e){
+ZmOperation.removeOperation(this,e,this._menuItems)
+};
+ZmActionMenu.prototype.getOp=function(e){
+return this.getMenuItem(e)
+};
+ZmActionMenu.prototype.getTagMenu=function(){
+var e=this.getMenuItem(ZmOperation.TAG_MENU);
+if(e){
+return e.getMenu()
+}};
+ZmActionMenu.prototype._menuItemId=function(e){
+return e.getData(ZmOperation.KEY_ID)
+}
+}
+if(AjxPackage.define("zimbraMail.share.view.ZmToolBar")){
+ZmToolBar=function(t){
+if(arguments.length==0){
+return
+}
+t.posStyle=t.posStyle||DwtControl.ABSOLUTE_STYLE;
+DwtToolBar.call(this,t);
+var e=t.controller||appCtxt.getCurrentController();
+if(e){
+this._controller=e;
+this._keyMap=ZmKeyMap.MAP_NAME_R[this._controller.getKeyMapName()]
+}
+this._refElementId=t.refElementId;
+this._buttons={}
+};
+ZmToolBar.prototype=new DwtToolBar;
+ZmToolBar.prototype.constructor=ZmToolBar;
+ZmToolBar.prototype.toString=function(){
+return"ZmToolBar"
+};
+ZmToolBar.prototype.addSelectionListener=function(t,a){
+var e=this._buttons[t];
+if(e){
+e.addSelectionListener(a)
+}};
+ZmToolBar.prototype.removeSelectionListener=function(t,a){
+var e=this._buttons[t];
+if(e){
+e.removeSelectionListener(a)
+}};
+ZmToolBar.prototype.getButton=function(e){
+return this._buttons[e]
+};
+ZmToolBar.prototype.setData=function(t,e,a){
+this._buttons[t].setData(e,a)
+};
+ZmToolBar.prototype.enable=function(a,e){
+a=(a instanceof Array)?a:[a];
+for(var t=0;
+t<a.length;
+t++){
+if(this._buttons[a[t]]){
+this._buttons[a[t]].setEnabled(e)
+}}};
+ZmToolBar.prototype.enableAll=function(e){
+for(var t in this._buttons){
+this._buttons[t].setEnabled(e)
+}};
+ZmToolBar.prototype.createButton=function(a,t){
+var e=this._buttons[a]=this._createButton(t);
+if(t.image){
+e.setImage(t.image)
+}
+if(t.text){
+e.setText(t.text)
+}
+if(t.tooltip){
+e.setToolTipContent(ZmOperation.getToolTip(a,this._keyMap)||t.tooltip)
+}
+e.setEnabled(t.enabled!==false);
+e.setData("_buttonId",a);
+if(t.menu){
+e.setMenu(t.menu,false,null,t.menuAbove)
+}
+return e
+};
+ZmToolBar.prototype.SEPARATOR_TEMPLATE="share.Widgets#ZmToolBarSeparator";
+ZmToolBar.prototype._createButton=function(o,t){
+var a=o.ctor||DwtToolBarButton;
+var e=new a({
+parent:this,style:o.style,className:t,index:o.index,id:o.id,template:o.template}
+);
+e.textPrecedence=o.textPrecedence;
+e.imagePrecedence=o.imagePrecedence;
+return e
+};
+ZmToolBar.prototype._buttonId=function(e){
+return e.getData("_buttonId")
+};
+ZmToolBar.prototype._createPrecedenceList=function(){
+this._precedenceList=[];
+for(var o in this._buttons){
+if(ZmOperation.isSep(o)){
+continue
+}
+var e=this._buttons[o];
+var a=e.textPrecedence;
+if(a){
+this._precedenceList.push({
+id:o,type:"text",precedence:a}
+)
+}
+var t=e.imagePrecedence;
+if(t){
+this._precedenceList.push({
+id:o,type:"image",precedence:t}
+)
+}}
+this._precedenceList.sort(function(s,n){
+return(s.precedence>n.precedence)?1:(s.precedence<n.precedence)?-1:0
+}
+)
+};
+ZmToolBar.prototype.adjustSize=function(){
+if(!this._refElementId||!this._inited){
+return
+}
+var o=this.getHtmlElement();
+if(!this._refElement){
+this._refElement=document.getElementById(this._refElementId)
+}
+if(!o||!this._refElement){
+return
+}
+var a=this._refElement.offsetWidth;
+var t=o.firstChild?o.firstChild.offsetWidth:a;
+for(var s=0;
+s<this._precedenceList.length;
+s++){
+var e=this._precedenceList[s];
+var l=this._buttons[e.id];
+if(!l){
+continue
+}
+if(e.type=="text"&&l._toggleText){
+l.setText(l._toggleText);
+l._toggleText=null
+}else{
+if(e.type=="image"&&l._toggleimage){
+l.setImage(l._toggleimage);
+l._toggleimage=null
+}}}
+t=o.firstChild?o.firstChild.offsetWidth:a;
+if(a>0&&t>a){
+for(var s=0;
+s<this._precedenceList.length;
+s++){
+var e=this._precedenceList[s];
+var l=this._buttons[e.id];
+if(!l||!l.getVisible()){
+continue
+}
+var c=l.getText();
+var n=l.getImage();
+var r=Boolean(c||l._toggleText);
+var h=Boolean(n||l._toggleimage);
+if(r&&h&&(t>a)){
+if(e.type=="text"){
+l._toggleText=c;
+l.setText("")
+}else{
+if(e.type=="image"){
+l._toggleimage=n;
+l.setImage("")
+}}}
+t=o.firstChild?o.firstChild.offsetWidth:a
+}}};
+ZmToolBar.prototype.setSize=function(t,e){
+var a=this.getSize();
+if(t!=a.x||e!=a.y){
+DwtToolBar.prototype.setSize.apply(this,arguments);
+this.adjustSize()
+}};
+ZmToolBar.prototype._addItem=function(a,t,e){
+DwtToolBar.prototype._addItem.apply(this,arguments);
+this.adjustSize()
+};
+ZmToolBar.prototype._removeItem=function(a,t,e){
+DwtToolBar.prototype._removeItem.apply(this,arguments);
+this.adjustSize()
+}
+}
+if(AjxPackage.define("zimbraMail.share.view.ZmButtonToolBar")){
+ZmButtonToolBar=function(t){
+if(arguments.length==0){
+return
+}
+t.className=t.className||"ZToolbar";
+t.id=t.context?ZmId.getToolbarId(t.context,t.toolbarType):null;
+ZmToolBar.call(this,t);
+this._context=t.context;
+this._toolbarType=t.toolbarType;
+this._buttonStyle=t.buttonClassName;
+var e=t.buttons;
+if(!e){
+e=[ZmOperation.NEW_MENU,ZmOperation.TAG_MENU,ZmOperation.PRINT,ZmOperation.DELETE]
+}else{
+if(e==ZmOperation.NONE){
+e=null
+}}
+this.opList=ZmOperation.filterOperations(e);
+this._buttons=ZmOperation.createOperations(this,this.opList,t.overrides);
+this._createPrecedenceList();
+this._inited=true
+};
+ZmButtonToolBar.prototype=new ZmToolBar;
+ZmButtonToolBar.prototype.constructor=ZmButtonToolBar;
+ZmButtonToolBar.prototype.toString=function(){
+return"ZmButtonToolBar"
+};
+ZmButtonToolBar.prototype.createOp=function(o,a){
+a.className=this._buttonStyle;
+var e;
+if(o==ZmOperation.TEXT){
+var o;
+if(this._context){
+var t=this._toolbarType?[this._context,this._toolbarType].join("_"):this._context;
+o=[ZmId.WIDGET,AjxStringUtil.toMixed(t,"_",true),AjxStringUtil.toMixed(o,"_")].join("")
+}
+a.textClassName=a.textClassName||"ZWidgetTitle";
+e=new DwtText({
+parent:this,className:a.textClassName,id:o}
+)
+}else{
+a.id=this._context?ZmId.getButtonId(this._context,o,this._toolbarType):null;
+a.textPrecedence=ZmOperation.getProp(o,"textPrecedence");
+a.iconPrecedence=ZmOperation.getProp(o,"iconPrecedence");
+e=this.createButton(o,a)
+}
+e.setData(ZmOperation.KEY_ID,o);
+return e
+};
+ZmButtonToolBar.prototype.addOp=function(t,e){
+ZmOperation.addOperation(this,t,this._buttons,e);
+AjxUtil.arrayAdd(this.opList,t,e)
+};
+ZmButtonToolBar.prototype.removeOp=function(e){
+ZmOperation.removeOperation(this,e,this._buttons);
+AjxUtil.arrayRemove(this.opList,e)
+};
+ZmButtonToolBar.prototype.getOp=function(e){
+return this.getButton(e)
+};
+ZmButtonToolBar.prototype.getTagMenu=function(){
+var e=this.getButton(ZmOperation.TAG_MENU);
+if(e){
+return e.getMenu()
+}};
+ZmButtonToolBar.prototype._buttonId=function(e){
+return e.getData(ZmOperation.KEY_ID)
+}
+}
+if(AjxPackage.define("zimbraMail.share.view.ZmNavToolBar")){
+ZmNavToolBar=function(t){
+t.className=t.className||"ZmNavToolBar";
+var e=(t.hasText!==false);
+t.buttons=this._getButtons(e);
+t.toolbarType=ZmId.TB_NAV;
+t.posStyle=t.posStyle||DwtControl.STATIC_STYLE;
+ZmButtonToolBar.call(this,t);
+if(e){
+this._textButton=this.getButton(ZmOperation.TEXT)
+}};
+ZmNavToolBar.prototype=new ZmButtonToolBar;
+ZmNavToolBar.prototype.constructor=ZmNavToolBar;
+ZmNavToolBar.prototype.toString=function(){
+return"ZmNavToolBar"
+};
+ZmNavToolBar.prototype.enable=function(o,e){
+ZmButtonToolBar.prototype.enable.call(this,o,e);
+if(!e){
+if(!(o instanceof Array)){
+o=[o]
+}
+for(var a=0;
+a<o.length;
+a++){
+var t=this.getButton(o[a]);
+if(t){
+t.setToolTipContent(null)
+}}}};
+ZmNavToolBar.prototype.setToolTip=function(t,a){
+var e=this.getButton(t);
+if(e){
+e.setToolTipContent(a)
+}};
+ZmNavToolBar.prototype.setText=function(e){
+if(!this._textButton){
+return
+}
+this._textButton.setText(e)
+};
+ZmNavToolBar.prototype._getButtons=function(e){
+var t=[];
+t.push(ZmOperation.PAGE_BACK);
+if(e){
+t.push(ZmOperation.TEXT)
+}
+t.push(ZmOperation.PAGE_FORWARD);
+return t
+};
+ZmNavToolBar.prototype.createOp=function(t,e){
+e.textClassName="ZWidgetTitle ZmNavToolBarTitle";
+return ZmButtonToolBar.prototype.createOp.apply(this,arguments)
+}
+}
+if(AjxPackage.define("zimbraMail.share.view.ZmSearchToolBar")){
+ZmSearchToolBar=function(e,a){
+DwtComposite.call(this,{
+parent:e,className:"ZmSearchToolbar",id:a}
+);
+var t={
+msgKey:"searchAll",tooltipKey:"searchForAny",icon:"Globe",setting:ZmSetting.MIXED_VIEW_ENABLED,index:0,id:ZmId.getMenuItemId(ZmId.SEARCH,ZmId.SEARCH_ANY)};
+ZmSearchToolBar.addMenuItem(ZmId.SEARCH_ANY,t);
+t={
+msgKey:"searchShared",tooltipKey:"searchShared",icon:"Group",setting:ZmSetting.SHARING_ENABLED,id:ZmId.getMenuItemId(ZmId.SEARCH,ZmId.SEARCH_SHARED)};
+ZmSearchToolBar.addMenuItem(ZmId.SEARCH_SHARED,t);
+if(appCtxt.multiAccounts){
+t={
+msgKey:"searchAllAccounts",icon:"Globe",id:ZmId.getMenuItemId(ZmId.SEARCH,ZmId.SEARCH_ALL_ACCOUNTS)};
+ZmSearchToolBar.addMenuItem(ZmId.SEARCH_ALL_ACCOUNTS,t)
+}
+this._createHtml()
+};
+ZmSearchToolBar.prototype=new DwtComposite;
+ZmSearchToolBar.prototype.constructor=ZmSearchToolBar;
+ZmSearchToolBar.SEARCH_MENU_BUTTON=1;
+ZmSearchToolBar.SEARCH_BUTTON=2;
+ZmSearchToolBar.SAVE_BUTTON=3;
+ZmSearchToolBar.BROWSE_BUTTON=4;
+ZmSearchToolBar.MENUITEM_ID="_menuItemId";
+ZmSearchToolBar.SETTING={};
+ZmSearchToolBar.MENU_ITEMS=[];
+ZmSearchToolBar.MSG_KEY={};
+ZmSearchToolBar.TT_MSG_KEY={};
+ZmSearchToolBar.ICON={};
+ZmSearchToolBar.SHARE_ICON={};
+ZmSearchToolBar.ID={};
+ZmSearchToolBar.addMenuItem=function(t,e){
+if(e.msgKey){
+ZmSearchToolBar.MSG_KEY[t]=e.msgKey
+}
+if(e.tooltipKey){
+ZmSearchToolBar.TT_MSG_KEY[t]=e.tooltipKey
+}
+if(e.icon){
+ZmSearchToolBar.ICON[t]=e.icon
+}
+if(e.shareIcon){
+ZmSearchToolBar.SHARE_ICON[t]=e.shareIcon
+}
+if(e.setting){
+ZmSearchToolBar.SETTING[t]=e.setting
+}
+if(e.id){
+ZmSearchToolBar.ID[t]=e.id
+}
+if(e.index==null||e.index<0||e.index>=ZmSearchToolBar.MENU_ITEMS.length){
+ZmSearchToolBar.MENU_ITEMS.push(t)
+}else{
+ZmSearchToolBar.MENU_ITEMS.splice(e.index,0,t)
+}};
+ZmSearchToolBar.prototype.toString=function(){
+return"ZmSearchToolBar"
+};
+ZmSearchToolBar.prototype.removeMenuItem=function(a){
+var e=0;
+while(e<ZmSearchToolBar.MENU_ITEMS.length){
+if(ZmSearchToolBar.MENU_ITEMS[e]==a){
+break
+}
+e++
+}
+if(e<ZmSearchToolBar.MENU_ITEMS.length){
+var t=this._searchMenuButton.getMenu();
+t.removeChild(t.getItemById("_menuItemId",a));
+ZmSearchToolBar.MENU_ITEMS.splice(e,1);
+ZmSearchToolBar.MSG_KEY[a]="";
+ZmSearchToolBar.TT_MSG_KEY[a]="";
+ZmSearchToolBar.ICON[a]="";
+ZmSearchToolBar.SHARE_ICON[a]="";
+ZmSearchToolBar.SETTING[a]="";
+ZmSearchToolBar.ID[a]=""
+}
+this.dedupSeparators(t)
+};
+ZmSearchToolBar.prototype.dedupSeparators=function(o){
+if(o==null){
+o=this._searchMenuButton.getMenu()
+}
+var e=o.getItems();
+var a=false;
+var t=[];
+for(mi in e){
+if(!e[mi].__text){
+if(a==true||a==null){
+t.push(e[mi])
+}else{
+a=true
+}}else{
+a=false
+}}
+for(mi in t){
+o.removeChild(t[mi])
+}
+if(!e[e.length-1].__text){
+o.removeChild(e[e.length-1])
+}};
+ZmSearchToolBar.prototype.getSearchField=function(){
+return this._searchField.getInputElement()
+};
+ZmSearchToolBar.prototype.registerCallback=function(e,t){
+this._callback=new AjxCallback(t,e)
+};
+ZmSearchToolBar.prototype.addSelectionListener=function(t,a){
+var e;
+switch(t){
+case ZmSearchToolBar.SEARCH_MENU_BUTTON:e=this._searchMenuButton;
+break;
+case ZmSearchToolBar.SEARCH_BUTTON:e=this._searchButton;
+break;
+case ZmSearchToolBar.SAVE_BUTTON:e=this._saveButton;
+break;
+case ZmSearchToolBar.BROWSE_BUTTON:e=this._browseButton;
+break
+}
+if(e){
+e.addSelectionListener(a)
+}};
+ZmSearchToolBar.prototype.getButton=function(e){
+switch(e){
+case ZmSearchToolBar.SEARCH_MENU_BUTTON:return this._searchMenuButton;
+case ZmSearchToolBar.SEARCH_BUTTON:return this._searchButton;
+case ZmSearchToolBar.SAVE_BUTTON:return this._saveButton;
+case ZmSearchToolBar.BROWSE_BUTTON:return this._browseButton
+}
+return null
+};
+ZmSearchToolBar.prototype.focus=function(){
+if(this._searchField){
+this._searchField.focus()
+}};
+ZmSearchToolBar.prototype.blur=function(){
+if(this._searchField){
+this._searchField.blur()
+}};
+ZmSearchToolBar.prototype.setEnabled=function(e){
+if(this._searchField){
+this._searchField.setEnabled(e)
+}
+if(this._searchMenuButton){
+this._searchMenuButton.setEnabled(e)
+}
+if(this._searchButton){
+this._searchButton.setEnabled(e)
+}
+if(this._saveButton){
+this._saveButton.setEnabled(e)
+}
+if(this._browseButton){
+this._browseButton.setEnabled(e)
+}
+if(this._customSearchBtn){
+this._customSearchBtn.setEnabled(e)
+}};
+ZmSearchToolBar.prototype.setSearchFieldValue=function(e){
+if(this._searchField&&e!=this.getSearchFieldValue()){
+this._searchField.setValue(e)
+}};
+ZmSearchToolBar.prototype.getSearchFieldValue=function(){
+return this._searchField?this._searchField.getValue():null
+};
+ZmSearchToolBar.prototype.createCustomSearchBtn=function(s,r,a,e){
+if(!this._customSearchListener){
+this._customSearchListener=new AjxListener(this,this._customSearchBtnListener)
+}
+var l=document.getElementById(this._htmlElId+"_customSearchButton");
+if(l){
+if(!this._customSearchBtn){
+this._customSearchBtn=this._addButton({
+tdId:"_customSearchButton",buttonId:ZmId.getButtonId(ZmId.SEARCH,ZmId.SEARCH_CUSTOM),lbl:r,icon:s}
+);
+this._customSearchBtn.setData("CustomSearchItem",[s,r,a]);
+this._customSearchBtn.addSelectionListener(this._customSearchListener);
+var c=document.getElementById(this._htmlElId+"_customSearchButtonSep");
+if(c){
+Dwt.setVisible(c,true)
+}}else{
+var t=this._customSearchBtn.getMenu();
+var h;
+var o={
+parent:t,enabled:true,style:DwtMenuItem.RADIO_STYLE,radioGroupId:0,id:e};
+if(!t){
+var n=this._customSearchBtn.getData("CustomSearchItem");
+t=new DwtMenu({
+parent:this._customSearchBtn,className:"ActionMenu",id:ZmId.getMenuId(ZmId.SEARCH,ZmId.SEARCH_CUSTOM)}
+);
+this._customSearchBtn.setMenu(t,false,DwtMenuItem.RADIO_STYLE);
+o.imageInfo=n[0];
+o.text=n[1];
+h=DwtMenuItem.create(o);
+h.setData("CustomSearchItem",n);
+h.setData(ZmSearchToolBar.MENUITEM_ID,ZmId.SEARCH_CUSTOM);
+h.setChecked(true,true);
+h.addSelectionListener(this._customSearchListener)
+}
+o.imageInfo=s;
+o.text=r;
+h=DwtMenuItem.create(o);
+h.setData("CustomSearchItem",[s,r,a]);
+h.addSelectionListener(this._customSearchListener)
+}}else{
+if(this._searchMenuCreated){
+var t=this._searchMenuButton.getMenu();
+this._createCustomSearchMenuItem(t,s,r,a,e)
+}else{
+if(!this._customSearchMenuItems){
+this._customSearchMenuItems=[]
+}
+this._customSearchMenuItems.push({
+icon:s,text:r,listener:a,id:e}
+)
+}}};
+ZmSearchToolBar.prototype._createCustomSearchMenuItem=function(s,t,n,a,r){
+var e=s.getItem(0);
+var o={
+parent:s,imageInfo:t,text:n,enabled:true,style:DwtMenuItem.RADIO_STYLE,radioGroupId:0,index:0,id:r};
+e=DwtMenuItem.create(o);
+e.setData("CustomSearchItem",[t,n,a]);
+e.setData(ZmSearchToolBar.MENUITEM_ID,ZmId.SEARCH_CUSTOM);
+e.addSelectionListener(this._customSearchListener);
+if(!(e&&e.getData("CustomSearchItem"))){
+e=new DwtMenuItem({
+parent:s,style:DwtMenuItem.SEPARATOR_STYLE,index:1}
+)
+}};
+ZmSearchToolBar.prototype._customSearchBtnListener=function(a){
+var t=a.item;
+if(!t){
+return
+}
+var o=t.getData("CustomSearchItem");
+if(this._customSearchBtn){
+if(t instanceof DwtMenuItem){
+if(a.detail!=DwtMenuItem.CHECKED){
+return
+}
+this._customSearchBtn.setToolTipContent(o[1]);
+this._customSearchBtn.setData("CustomSearchItem",o)
+}
+o[2].run(a)
+}else{
+this._searchMenuButton.setToolTipContent(o[1]);
+var n=t.parent;
+var e=n?n.getItemById(ZmSearchToolBar.MENUITEM_ID,ZmId.SEARCH_SHARED):null;
+if(e){
+e.setChecked(false,true);
+e.setEnabled(false)
+}
+this._searchMenuButton.setImage(o[0]);
+this._searchMenuButton.setText(o[1])
+}};
+ZmSearchToolBar.prototype._createHtml=function(){
+this.getHtmlElement().innerHTML=AjxTemplate.expand("share.Widgets#ZmSearchToolBar",{
+id:this._htmlElId}
+);
+var n=this._htmlElId+"_inputField";
+var t=document.getElementById(n);
+if(t){
+this._searchField=new DwtInputField({
+parent:this,hint:ZmMsg.searchInput,inputId:ZmId.SEARCH_INPUT}
+);
+var o=this._searchField.getInputElement();
+o.className="search_input";
+this._searchField.reparentHtmlElement(n)
+}
+var r=this._htmlElId+"_searchMenuButton";
+var a=document.getElementById(r);
+if(a){
+var e=appCtxt.get(ZmSetting.MAIL_ENABLED);
+this._searchMenuButton=this._addButton({
+tdId:"_searchMenuButton",buttonId:ZmId.getButtonId(ZmId.SEARCH,ZmId.SEARCH_MENU),lbl:e?ZmMsg.searchMail:ZmMsg.searchAll,icon:e?"Message":"Globe"}
+);
+var s=new AjxCallback(this,this._createSearchMenu);
+this._searchMenuButton.setMenu(s,false,DwtMenuItem.RADIO_STYLE);
+this._searchMenuButton.reparentHtmlElement(r)
+}
+this._searchButton=this._addButton({
+tdId:"_searchButton",buttonId:ZmId.getButtonId(ZmId.SEARCH,ZmId.SEARCH_SEARCH),lbl:ZmMsg.search,icon:"Search",tooltip:ZmMsg.searchTooltip}
+);
+this._saveButton=this._addButton({
+setting:ZmSetting.SAVED_SEARCHES_ENABLED,tdId:"_saveButton",buttonId:ZmId.getButtonId(ZmId.SEARCH,ZmId.SEARCH_SAVE),lbl:ZmMsg.save,icon:"Save",type:"toolbar",tooltip:ZmMsg.saveSearchTooltip}
+);
+this._browseButton=this._addButton({
+setting:ZmSetting.BROWSE_ENABLED,tdId:"_advancedButton",buttonId:ZmId.getButtonId(ZmId.SEARCH,ZmId.SEARCH_ADVANCED),style:(DwtLabel.IMAGE_LEFT|DwtLabel.ALIGN_CENTER|DwtButton.TOGGLE_STYLE),lbl:ZmMsg.searchBuilder,icon:"SearchBuilder",type:"toolbar",tooltip:ZmMsg.openSearchBuilder}
+)
+};
+ZmSearchToolBar.prototype._createSearchMenu=function(){
+var s=new DwtMenu({
+parent:this._searchMenuButton,className:"ActionMenu",id:ZmId.getMenuId(ZmId.SEARCH)}
+);
+var e;
+if(this._customSearchMenuItems){
+for(var a=0;
+a<this._customSearchMenuItems.length;
+a++){
+var t=this._customSearchMenuItems[a];
+this._createCustomSearchMenuItem(s,t.icon,t.text,t.listener)
+}}
+var n={
+parent:s,enabled:true,radioGroupId:0};
+for(var a=0;
+a<ZmSearchToolBar.MENU_ITEMS.length;
+a++){
+var r=ZmSearchToolBar.MENU_ITEMS[a];
+if(r==ZmId.SEARCH_SHARED){
+if(ZmSearchToolBar.MENU_ITEMS.length<=1){
+continue
+}
+e=new DwtMenuItem({
+parent:s,style:DwtMenuItem.SEPARATOR_STYLE}
+)
+}
+var o=ZmSearchToolBar.SETTING[r];
+if(o&&!appCtxt.get(o)){
+continue
+}
+n.style=(r==ZmId.SEARCH_SHARED||r==ZmId.SEARCH_ALL_ACCOUNTS)?DwtMenuItem.CHECK_STYLE:DwtMenuItem.RADIO_STYLE;
+n.imageInfo=ZmSearchToolBar.ICON[r];
+n.text=ZmMsg[ZmSearchToolBar.MSG_KEY[r]];
+n.id=ZmSearchToolBar.ID[r];
+e=DwtMenuItem.create(n);
+e.setData(ZmSearchToolBar.MENUITEM_ID,r);
+if(r==ZmId.SEARCH_ANY){
+if(ZmSearchToolBar.MENU_ITEMS.length<=1){
+continue
+}
+e=new DwtMenuItem({
+parent:s,style:DwtMenuItem.SEPARATOR_STYLE}
+)
+}}
+appCtxt.getSearchController()._addMenuListeners(s);
+this._searchMenuCreated=true;
+return s
+};
+ZmSearchToolBar.prototype._addButton=function(n){
+if(n.setting&&!appCtxt.get(n.setting)){
+return
+}
+var a;
+var t=this._htmlElId+(n.tdId||n.buttonId);
+var e=document.getElementById(t);
+if(e){
+var s={
+parent:this,style:n.style,id:n.buttonId};
+a=(n.type&&n.type=="toolbar")?(new DwtToolBarButton(s)):(new DwtButton(s));
+var o=Dwt.getAttr(e,"hint");
+this._setButtonStyle(a,o,n.lbl,n.icon);
+if(n.tooltip){
+a.setToolTipContent(n.tooltip)
+}
+a.reparentHtmlElement(t)
+}
+return a
+};
+ZmSearchToolBar.prototype._setButtonStyle=function(e,o,a,t){
+if(o=="text"){
+e.setText(a)
+}else{
+if(o=="icon"){
+e.setImage(t)
+}else{
+e.setText(a);
+e.setImage(t)
+}}};
+ZmSearchToolBar.prototype._handleEnterKeyPress=function(e){
+var a=this._searchMenuButton.getMenu();
+var t=a.getSelectedItem().getData("CustomSearchItem");
+if(t){
+t[2].run(e)
+}else{
+var o=this.getSearchFieldValue();
+appCtxt.notifyZimlets("onKeyPressSearchField",[o]);
+this._callback.run(o)
+}
+return false
+};
+ZmSearchToolBar.prototype.initAutocomplete=function(t){
+var e={
+dataClass:new ZmSearchAutocomplete(),matchValue:"matchText",delims:[" "],separator:" ",enterCallback:new AjxCallback(this,this._handleEnterKeyPress)};
+this._acList=new ZmAutocompleteListView(e);
+this._acList.handle(this.getSearchField())
+}
+}
+if(AjxPackage.define("zimbraMail.share.view.ZmTreeView")){
+ZmTreeView=function(e){
+if(arguments.length==0){
+return
+}
+DwtTree.call(this,{
+parent:e.parent,parentElement:e.parentElement,style:e.treeStyle,isCheckedByDefault:e.isCheckedByDefault,className:(e.className||"OverviewTree"),posStyle:e.posStyle,id:e.id}
+);
+this._headerClass=e.headerClass?e.headerClass:"overviewHeader";
+this.overviewId=e.overviewId;
+this.type=e.type;
+this.allowedTypes=e.allowedTypes;
+this.allowedSubTypes=e.allowedSubTypes;
+this._overview=appCtxt.getOverviewController().getOverview(this.overviewId);
+this._dragSrc=e.dragSrc;
+this._dropTgt=e.dropTgt;
+this._dataTree=null;
+this._treeItemHash={}
+};
+ZmTreeView.KEY_TYPE="_type_";
+ZmTreeView.KEY_ID="_treeId_";
+ZmTreeView.COMPARE_FUNC={};
+ZmTreeView.ADD_SEP={};
+ZmTreeView.ADD_SEP[ZmFolder.ID_TRASH]=true;
+ZmTreeView.MAX_ITEMS=50;
+ZmTreeView.getSortIndex=function(s,t,e){
+if(!e){
+return null
+}
+var n=s.getItemCount();
+var o=s.getItems();
+for(var a=0;
+a<o.length;
+a++){
+if(o[a]._isSeparator){
+continue
+}
+var h=o[a].getData(Dwt.KEY_OBJECT);
+if(!h){
+continue
+}
+var r=e(t,h);
+if(r==-1){
+return a
+}}
+return a
+};
+ZmTreeView.prototype=new DwtTree;
+ZmTreeView.prototype.constructor=ZmTreeView;
+ZmTreeView.prototype.toString=function(){
+return"ZmTreeView"
+};
+ZmTreeView.prototype.set=function(s){
+this._showUnread=s.showUnread;
+this._dataTree=s.dataTree;
+this.clear();
+var t=this._dataTree.root;
+var n=(appCtxt.multiAccounts&&(this.type==ZmOrganizer.SEARCH||this.type==ZmOrganizer.TAG));
+var e=this._getHeaderTreeItemImage();
+var o=this._headerItem=new DwtHeaderTreeItem({
+parent:this,className:n?"DwtTreeItem":this._headerClass,imageInfo:e,id:ZmId.getTreeItemId(this.overviewId,null,this.type),button:n?null:s.newButton,dndScrollCallback:this._overview._dndScrollCallback,dndScrollId:this.overviewId,selectable:appCtxt.multiAccounts}
+);
+o._isHeader=true;
+var a=ZmMsg[ZmOrganizer.LABEL[this.type]];
+if(a){
+o.setText(a)
+}
+o.setData(Dwt.KEY_ID,t.id);
+o.setData(Dwt.KEY_OBJECT,t);
+o.setData(ZmTreeView.KEY_ID,this.overviewId);
+o.setData(ZmTreeView.KEY_TYPE,this.type);
+if(this._dropTgt){
+o.setDropTarget(this._dropTgt)
+}
+this._treeItemHash[t.id]=o;
+s.treeNode=o;
+s.organizer=t;
+this._render(s);
+o.setExpanded(!s.collapsed,null,true);
+if(!appCtxt.multiAccounts){
+this.addSeparator()
+}
+if(appCtxt.getSkinHint("noOverviewHeaders")||this._hideHeaderTreeItem()){
+o.setVisible(false,true)
+}};
+ZmTreeView.prototype.getTreeItemById=function(e){
+return this._treeItemHash[e]
+};
+ZmTreeView.prototype.getHeaderItem=function(){
+return this._headerItem
+};
+ZmTreeView.prototype.getSelected=function(){
+if(this.isCheckedStyle){
+var e=[];
+var t=this.getHeaderItem();
+this._getCheckedItems(t,e);
+return e
+}else{
+return(this.getSelectionCount()!=1)?null:this.getSelection()[0].getData(Dwt.KEY_OBJECT)
+}};
+ZmTreeView.prototype.setSelected=function(e,t,o){
+var a=ZmOrganizer.getSystemId((e instanceof ZmOrganizer)?e.id:e);
+if(!a||!this._treeItemHash[a]){
+return
+}
+this.setSelection(this._treeItemHash[a],t,false,o)
+};
+ZmTreeView.prototype._render=function(params){
+var org=params.organizer;
+var children=org.children.getArray();
+if(org.isDataSource(ZmAccount.TYPE_IMAP)){
+children.sort(ZmImapAccount.sortCompare)
+}else{
+if(ZmTreeView.COMPARE_FUNC[this.type]){
+if(appCtxt.isOffline&&this.type==ZmOrganizer.SEARCH){
+var local=[];
+var global=[];
+for(var j=0;
+j<children.length;
+j++){
+var child=children[j];
+if(child&&child.type==ZmOrganizer.SEARCH){
+if(child.isOfflineGlobalSearch){
+global.push(child)
+}else{
+local.push(child)
+}}}
+local.sort(eval(ZmTreeView.COMPARE_FUNC[this.type]));
+global.sort(eval(ZmTreeView.COMPARE_FUNC[this.type]));
+children=(new Array()).concat(local,global)
+}else{
+children.sort(eval(ZmTreeView.COMPARE_FUNC[this.type]))
+}}}
+var addSep=true;
+var numItems=0;
+var len=children.length;
+for(var i=params.startPos||0;
+i<len;
+i++){
+var child=children[i];
+if(!child||(params.omit&&params.omit[child.nId])){
+continue
+}
+if(!(params.include&&params.include[child.nId])){
+var allowed=((org.nId==ZmOrganizer.ID_ROOT)&&this.allowedTypes[child.type])||((org.nId!=ZmOrganizer.ID_ROOT)&&this.allowedSubTypes[child.type]);
+if(!allowed){
+if(params.omitParents){
+continue
+}
+var proxy=AjxUtil.createProxy(params);
+proxy.treeNode=null;
+proxy.organizer=child;
+this._render(proxy);
+continue
+}
+if(this._allowedTypes&&!this._allowedTypes[child.type]){
+if(params.omitParents){
+continue
+}
+var proxy=AjxUtil.createProxy(params);
+proxy.treeNode=null;
+proxy.organizer=child;
+this._render(proxy);
+continue
+}}
+if((child.numTotal==0&&(child.nId==ZmFolder.ID_SYNC_FAILURES))||(appCtxt.isOffline&&child.nId==ZmOrganizer.ID_GLOBAL_INBOX)){
+continue
+}
+if(numItems>=ZmTreeView.MAX_ITEMS){
+if(params.startPos){
+params.startPos=i;
+params.len=(params.startPos+ZmTreeView.MAX_ITEMS>=len)?len:0;
+this._showRemainingFolders(params);
+return
+}else{
+if(numItems>=ZmTreeView.MAX_ITEMS*2){
+var orgs=ZmMsg[ZmOrganizer.LABEL[this.type]].toLowerCase();
+child=new ZmFolder({
+id:ZmFolder.ID_LOAD_FOLDERS,name:AjxMessageFormat.format(ZmMsg.showRemainingFolders,orgs)}
+);
+child._tooltip=AjxMessageFormat.format(ZmMsg.showRemainingFoldersTooltip,[(children.length-i),orgs]);
+var ti=this._addNew(params.treeNode,child);
+ti.enableSelection(true);
+if(this.isCheckedStyle){
+ti.showCheckBox(false)
+}
+params.startPos=i;
+child._showFoldersCallback=new AjxCallback(this,this._showRemainingFolders,[params]);
+return
+}}}
+if((org.nId==ZmOrganizer.ID_ROOT)&&child.link&&addSep){
+params.treeNode.addSeparator();
+addSep=false
+}
+this._addNew(params.treeNode,child,null,params.noTooltips,params.omit);
+numItems++
+}};
+ZmTreeView.prototype._addNew=function(r,u,h,c,a){
+var t;
+var e=(u.type==ZmOrganizer.FOLDER)&&appCtxt.getDataSourceCollection();
+var d=e&&e.getByFolderId(u.nId);
+var o=(d&&d.length>0)?d[0]:null;
+if(o&&o.type==ZmAccount.TYPE_IMAP){
+t=new DwtTreeItem({
+parent:this,text:u.getName(),className:this._headerClass}
+);
+t.enableSelection(false)
+}else{
+if(!r){
+var l=[];
+var s=u.parent;
+while((r=this.getTreeItemById(s.id))==null){
+l.push(s);
+s=s.parent
+}
+while(s=l.pop()){
+r=this.getTreeItemById(s.parent.id);
+r=new DwtTreeItem({
+parent:r,text:s.getName(),imageInfo:s.getIconWithColor(),forceNotifySelection:true,dndScrollCallback:this._overview._dndScrollCallback,dndScrollId:this.overviewId,id:ZmId.getTreeItemId(this.overviewId,s.id)}
+);
+r.setData(Dwt.KEY_ID,s.id);
+r.setData(Dwt.KEY_OBJECT,s);
+r.setData(ZmTreeView.KEY_ID,this.overviewId);
+r.setData(ZmTreeView.KEY_TYPE,s.type);
+this._treeItemHash[s.id]=r
+}}
+var n={
+parent:r,index:h,text:u.getName(this._showUnread),dndScrollCallback:this._overview._dndScrollCallback,dndScrollId:this.overviewId,imageInfo:u.getIconWithColor(),id:ZmId.getTreeItemId(this.overviewId,u.id)};
+t=new DwtTreeItem(n)
+}
+if(appCtxt.multiAccounts&&(u.type==ZmOrganizer.SEARCH||u.type==ZmOrganizer.TAG)){
+t.addClassName("DwtTreeItemChildDiv")
+}
+t.setDndText(u.getName());
+t.setData(Dwt.KEY_ID,u.id);
+t.setData(Dwt.KEY_OBJECT,u);
+t.setData(ZmTreeView.KEY_ID,this.overviewId);
+t.setData(ZmTreeView.KEY_TYPE,u.type);
+if(!c){
+var m=u.getToolTip();
+if(m){
+t.setToolTipContent(m)
+}}
+if(this._dragSrc){
+t.setDragSource(this._dragSrc)
+}
+if(this._dropTgt){
+t.setDropTarget(this._dropTgt)
+}
+this._treeItemHash[u.id]=t;
+if(ZmTreeView.ADD_SEP[u.nId]){
+r.addSeparator()
+}
+if(u.children&&u.children.size()){
+this._render({
+treeNode:t,organizer:u,omit:a}
+)
+}
+if(o&&o.type==ZmAccount.TYPE_IMAP){
+t.setExpanded(!appCtxt.get(ZmSetting.COLLAPSE_IMAP_TREES))
+}
+return t
+};
+ZmTreeView.prototype.getNextData=function(t){
+var r=this.getTreeItemById(t);
+if(!r||!r.parent){
+return null
+}
+while(r&&r.parent){
+var o=r.parent;
+if(!(o instanceof DwtTreeItem)){
+return null
+}
+var e=o.getItems();
+var l=null;
+if(e&&e.length>1){
+for(var n=0;
+n<e.length;
+n++){
+var s=e[n];
+if(s==r){
+var h=this.findNext(r,e,n);
+if(h){
+return h
+}
+var a=this.findPrev(r,e,n);
+if(a){
+return a
+}}}}
+r=r.parent
+}
+return null
+};
+ZmTreeView.prototype.findNext=function(n,o,t){
+for(var e=t+1;
+e<o.length;
+e++){
+var a=o[e];
+if(a&&a.getData){
+return a.getData(Dwt.KEY_OBJECT)
+}}
+return null
+};
+ZmTreeView.prototype.findPrev=function(n,o,t){
+for(var e=t-1;
+e>=0;
+e--){
+var a=o[e];
+if(a&&a.getData){
+return a.getData(Dwt.KEY_OBJECT)
+}}
+return null
+};
+ZmTreeView.prototype._showRemainingFolders=function(t){
+var e=this.getTreeItemById(ZmFolder.ID_LOAD_FOLDERS);
+if(e){
+e.dispose()
+}
+AjxTimedAction.scheduleAction(new AjxTimedAction(this,function(){
+this._render(t);
+if(t.len){
+var a=ZmMsg[ZmOrganizer.LABEL[this.type]].toLowerCase();
+appCtxt.setStatusMsg(AjxMessageFormat.format(ZmMsg.foldersShown,[t.len,a]));
+t.len=0
+}}
+),100)
+};
+ZmTreeView.prototype._getNextTreeItem=function(t){
+var e=DwtTree.prototype._getNextTreeItem.apply(this,arguments);
+return e||this._overview._getNextTreeItem(t,this)
+};
+ZmTreeView.prototype._hideHeaderTreeItem=function(){
+return(appCtxt.multiAccounts&&(this.type==ZmOrganizer.FOLDER||this.type==ZmOrganizer.ADDRBOOK||this.type==ZmOrganizer.CALENDAR||this.type==ZmOrganizer.TASKS||this.type==ZmOrganizer.NOTEBOOK||this.type==ZmOrganizer.BRIEFCASE||this.type==ZmOrganizer.PREF_PAGE||this.type==ZmOrganizer.ZIMLET))
+};
+ZmTreeView.prototype._getHeaderTreeItemImage=function(){
+if(appCtxt.multiAccounts){
+if(this.type==ZmOrganizer.SEARCH){
+return"SearchFolder"
+}
+if(this.type==ZmOrganizer.TAG){
+return"TagStack"
+}}
+return null
+};
+ZmTreeView.prototype._getCheckedItems=function(o,a){
+if(o&&(o instanceof DwtTreeItem)){
+if(o.getChecked()){
+a.push(o.getData(Dwt.KEY_OBJECT))
+}
+var e=o.getItems();
+for(var t=0;
+t<e.length;
+t++){
+this._getCheckedItems(e[t],a)
+}}}
+}
+if(AjxPackage.define("zimbraMail.share.view.ZmTagMenu")){
+ZmTagMenu=function(t,e){
+ZmPopupMenu.call(this,t,null,t.getHTMLElId()+"|MENU",e);
+t.setMenu(this);
+this._addHash={};
+this._removeHash={};
+this._evtMgr=new AjxEventMgr();
+this._desiredState=true;
+this._items=null;
+this._dirty=true;
+if(t instanceof DwtMenuItem){
+t.setHoverDelay(ZmTagMenu._HOVER_TIME)
+}};
+ZmTagMenu.prototype=new ZmPopupMenu;
+ZmTagMenu.prototype.constructor=ZmTagMenu;
+ZmTagMenu.KEY_TAG_EVENT="_tagEvent_";
+ZmTagMenu.KEY_TAG_ADDED="_tagAdded_";
+ZmTagMenu.MENU_ITEM_ADD_ID="tag_add";
+ZmTagMenu.MENU_ITEM_REM_ID="tag_remove";
+ZmTagMenu._HOVER_TIME=200;
+ZmTagMenu.prototype.toString=function(){
+return"ZmTagMenu"
+};
+ZmTagMenu.prototype.addSelectionListener=function(e){
+this._evtMgr.addListener(DwtEvent.SELECTION,e)
+};
+ZmTagMenu.prototype.removeSelectionListener=function(e){
+this._evtMgr.removeListener(DwtEvent.SELECTION,e)
+};
+ZmTagMenu.prototype.setEnabled=function(e){
+this._desiredState=e;
+if(e&&!this._tagList){
+return
+}
+this.parent.setEnabled(e)
+};
+ZmTagMenu.prototype.set=function(e,t){
+this._tagList=t;
+this._items=e;
+this._dirty=true;
+this.parent.setEnabled(true);
+if(this.parent instanceof DwtMenuItem){
+this.parent.setHoverDelay(ZmTagMenu._HOVER_TIME)
+}};
+ZmTagMenu.prototype._doPopup=function(t,n,a){
+if(this._dirty){
+this.removeChildren();
+if(this._tagList){
+var o=this._tagList.root;
+var e=this._getAddRemove(this._items,o);
+this._render(o,e)
+}
+this._dirty=false;
+if(this.parent instanceof DwtMenuItem){
+this.parent.setHoverDelay(0)
+}}
+ZmPopupMenu.prototype._doPopup.call(this,t,n,a)
+};
+ZmTagMenu.prototype._getAddRemove=function(s,h){
+var r={};
+for(var n=0;
+n<s.length;
+n++){
+var d=s[n];
+if(!d){
+continue
+}
+if(d.tags&&d.tags.length){
+for(var t=0;
+t<d.tags.length;
+t++){
+var e=d.tags[t];
+r[e]=r[e]?r[e]+1:1
+}}}
+var c={};
+var o={};
+var l=h.children.getArray();
+for(var n=0;
+n<l.length;
+n++){
+var e=l[n].nId;
+if(!r[e]||(r[e]<s.length)){
+c[e]=true
+}}
+for(var e in r){
+o[e]=true
+}
+return{
+add:c,remove:o}
+};
+ZmTagMenu.prototype._render=function(h,l){
+var r=h.size();
+var d=h.children.getArray();
+var s=[];
+for(var o=0;
+o<r;
+o++){
+var m=d[o];
+var t=m.nId;
+if(l.add[t]){
+this._addNewTag(this,m,true,null,this._addHash)
+}
+if(l.remove[t]){
+s.push(t)
+}}
+if(this._tagList.size()){
+new DwtMenuItem({
+parent:this,style:DwtMenuItem.SEPARATOR_STYLE}
+)
+}
+var c=this._menuItems[ZmTagMenu.MENU_ITEM_ADD_ID]=new DwtMenuItem({
+parent:this,id:this._htmlElId+"|NEWTAG"}
+);
+c.setText(AjxStringUtil.htmlEncode(ZmMsg.newTag));
+c.setImage("NewTag");
+c.setShortcut(appCtxt.getShortcutHint(this._keyMap,ZmKeyMap.NEW_TAG));
+c.setData(ZmTagMenu.KEY_TAG_EVENT,ZmEvent.E_CREATE);
+c.addSelectionListener(new AjxListener(this,this._menuItemSelectionListener),0);
+var u=this._menuItems[ZmTagMenu.MENU_ITEM_REM_ID]=new DwtMenuItem({
+parent:this,id:this._htmlElId+"|REMOVETAG"}
+);
+u.setEnabled(false);
+u.setText(AjxStringUtil.htmlEncode(ZmMsg.removeTag));
+u.setImage("DeleteTag");
+if(s.length>0){
+u.setEnabled(true);
+var e=null;
+if(s.length>1){
+for(o=0;
+o<s.length;
+o++){
+if(!e){
+e=new DwtMenu({
+parent:u,className:this._className}
+);
+u.setMenu(e)
+}
+var m=h.getById(s[o]);
+this._addNewTag(e,m,false,null,this._removeHash)
+}}else{
+if(s.length==1){
+var m=h.getById(s[0]);
+u.setData(ZmTagMenu.KEY_TAG_EVENT,ZmEvent.E_TAGS);
+u.setData(ZmTagMenu.KEY_TAG_ADDED,false);
+u.setData(Dwt.KEY_OBJECT,m);
+u.addSelectionListener(new AjxListener(this,this._menuItemSelectionListener),0)
+}}
+if(s.length>1){
+new DwtMenuItem({
+parent:e,style:DwtMenuItem.SEPARATOR_STYLE}
+);
+var n=new DwtMenuItem({
+parent:e}
+);
+n.setText(ZmMsg.allTags);
+n.setImage("TagStack");
+n.setShortcut(appCtxt.getShortcutHint(this._keyMap,ZmKeyMap.UNTAG));
+n.setData(ZmTagMenu.KEY_TAG_EVENT,ZmEvent.E_REMOVE_ALL);
+n.setData(Dwt.KEY_OBJECT,s);
+n.addSelectionListener(new AjxListener(this,this._menuItemSelectionListener),0)
+}}};
+ZmTagMenu.tagNameLength=20;
+ZmTagMenu.prototype._addNewTag=function(r,o,n,t,s){
+var e=new DwtMenuItem({
+parent:r,index:t}
+);
+var a=AjxStringUtil.clipByLength(o.getName(false),ZmTagMenu.tagNameLength);
+e.setText(a);
+e.setImage(ZmTag.COLOR_ICON[o.color]);
+e.setData(ZmTagMenu.KEY_TAG_EVENT,ZmEvent.E_TAGS);
+e.setData(ZmTagMenu.KEY_TAG_ADDED,n);
+e.setData(Dwt.KEY_OBJECT,o);
+e.addSelectionListener(new AjxListener(this,this._menuItemSelectionListener),0);
+e.setShortcut(appCtxt.getShortcutHint(null,ZmKeyMap.TAG));
+s[o.id]=e
+};
+ZmTagMenu.prototype._menuItemSelectionListener=function(e){
+if(e.item.getData(ZmTagMenu.KEY_TAG_EVENT)){
+this._evtMgr.notifyListeners(DwtEvent.SELECTION,e.item)
+}}
+}
+if(AjxPackage.define("zimbraMail.share.view.ZmListView")){
+ZmListView=function(o){
+if(arguments.length==0){
+return
+}
+o.id=o.id||ZmId.getViewId(o.view);
+DwtListView.call(this,o);
+this.view=o.view;
+this.type=o.type;
+this._controller=o.controller;
+this.setDropTarget(o.dropTgt);
+this._listChangeListener=new AjxListener(this,this._changeListener);
+this._tagListChangeListener=new AjxListener(this,this._tagChangeListener);
+var a=appCtxt.getTagTree();
+if(a){
+a.addChangeListener(this._tagListChangeListener)
+}
+var t=appCtxt.getFolderTree();
+if(t){
+t.addChangeListener(new AjxListener(this,this._folderChangeListener))
+}
+this._handleEventType={};
+this._handleEventType[this.type]=true;
+this._disallowSelection={};
+this._disallowSelection[ZmItem.F_FLAG]=true;
+this._selectAllEnabled=false;
+if(o.dropTgt){
+var e={
+container:this._parentEl,threshold:15,amount:5,interval:10,id:o.id};
+this._dndScrollCallback=new AjxCallback(null,DwtControl._dndScrollCallback,[e]);
+this._dndScrollId=o.id
+}
+this._isPageless=o.pageless;
+if(this._isPageless){
+Dwt.setHandler(this._parentEl,DwtEvent.ONSCROLL,ZmListView.handleScroll)
+}};
+ZmListView.prototype=new DwtListView;
+ZmListView.prototype.constructor=ZmListView;
+ZmListView.prototype.toString=function(){
+return"ZmListView"
+};
+ZmListView.KEY_ID="_keyId";
+ZmListView.COL_WIDTH_ICON=19;
+ZmListView.COL_WIDTH_NARROW_ICON=11;
+ZmListView.FIELD_CLASS={};
+ZmListView.FIELD_CLASS[ZmItem.F_TYPE]="Icon";
+ZmListView.FIELD_CLASS[ZmItem.F_FLAG]="Flag";
+ZmListView.FIELD_CLASS[ZmItem.F_TAG]="Tag";
+ZmListView.FIELD_CLASS[ZmItem.F_ATTACHMENT]="Attach";
+ZmListView.ITEM_FLAG_CLICKED=DwtListView._LAST_REASON+1;
+ZmListView.DEFAULT_REPLENISH_THRESHOLD=0;
+ZmListView.COL_JOIN="|";
+ZmListView.prototype._getHeaderList=function(){};
+ZmListView.prototype.getController=function(){
+return this._controller
+};
+ZmListView.prototype.set=function(o,a){
+this.setSelectionHdrCbox(false);
+if(appCtxt.multiAccounts){
+var n=appCtxt.getTagTree();
+if(n){
+n.addChangeListener(this._tagListChangeListener)
+}}
+if(this._isPageless){
+if(this._itemsToAdd){
+this.addItems(this._itemsToAdd);
+this._itemsToAdd=null
+}else{
+var t=o;
+if(o instanceof ZmList){
+o.addChangeListener(this._listChangeListener);
+t=o.getSubList(0,o.size())
+}
+DwtListView.prototype.set.call(this,t,a)
+}
+this._setRowHeight(o)
+}else{
+var e;
+if(o instanceof ZmList){
+o.addChangeListener(this._listChangeListener);
+e=o.getSubList(this.offset,this.getLimit())
+}else{
+e=o
+}
+DwtListView.prototype.set.call(this,e,a)
+}
+this._rendered=true
+};
+ZmListView.prototype._setRowHeight=function(){
+if(!this._rowHeight){
+var e=this._parentEl.firstChild;
+this._rowHeight=e&&Dwt.getSize(e).y
+}};
+ZmListView.prototype.reset=function(){
+this._rendered=false
+};
+ZmListView.prototype.setUI=function(e){
+DwtListView.prototype.setUI.call(this,e);
+this._resetColWidth()
+};
+ZmListView.prototype.getLimit=function(t){
+if(this._isPageless){
+var e=appCtxt.get(ZmSetting.PAGE_SIZE);
+return t?e:2*e
+}else{
+return appCtxt.get(ZmSetting.PAGE_SIZE)
+}};
+ZmListView.prototype.getPagelessThreshold=function(){
+return Math.ceil(this.getLimit()/5)
+};
+ZmListView.prototype.getReplenishThreshold=function(){
+return ZmListView.DEFAULT_REPLENISH_THRESHOLD
+};
+ZmListView.prototype._changeListener=function(s){
+var n=this._getItemFromEvent(s);
+if(!n||s.handled||!this._handleEventType[n.type]&&(this.type!=ZmItem.MIXED)){
+return
+}
+if(s.event==ZmEvent.E_TAGS||s.event==ZmEvent.E_REMOVE_ALL){
+this._setImage(n,ZmItem.F_TAG,n.getTagImageInfo())
+}
+if(s.event==ZmEvent.E_FLAGS){
+var a=s.getDetail("flags");
+for(var o=0;
+o<a.length;
+o++){
+var t=a[o];
+var e=n[ZmItem.FLAG_PROP[t]];
+if(t==ZmItem.FLAG_FLAGGED){
+this._setImage(n,ZmItem.F_FLAG,e?"FlagRed":null)
+}else{
+if(t==ZmItem.FLAG_ATTACH){
+this._setImage(n,ZmItem.F_ATTACHMENT,e?"Attachment":null)
+}}}}
+if(s.event==ZmEvent.E_DELETE||s.event==ZmEvent.E_MOVE){
+this.removeItem(n,true);
+if(s.event!=ZmEvent.E_MOVE||!this._controller._list.isCanonical){
+this._controller._list.remove(n)
+}
+if(!this.allSelected){
+if(!this._isPageless){
+this._controller._app._checkReplenishListView=this
+}else{
+this._handleResponseCheckReplenish()
+}}
+this._controller._resetToolbarOperations()
+}};
+ZmListView.prototype._getItemFromEvent=function(a){
+var t=a.item;
+if(!t){
+var e=a.getDetail("items");
+t=(e&&e.length)?e[0]:null
+}
+return t
+};
+ZmListView.prototype._checkReplenish=function(){
+var e=new AjxCallback(this,this._handleResponseCheckReplenish);
+this._controller._checkReplenish(e)
+};
+ZmListView.prototype._handleResponseCheckReplenish=function(){
+if(this.size()==0){
+this._controller._handleEmptyList(this)
+}else{
+this._controller._resetNavToolBarButtons(this._controller._getViewType())
+}
+this._setNextSelection()
+};
+ZmListView.prototype._folderChangeListener=function(o){
+if(appCtxt.getCurrentController()!=this._controller){
+return
+}
+if(this._controller._app._checkReplenishListView==this){
+return
+}
+var a=o.getDetail("organizers");
+var t=(a&&a.length)?a[0]:o.source;
+var n=t.id;
+var e=o.getDetail("fields");
+if(o.event==ZmEvent.E_MODIFY){
+if(!e){
+return
+}
+if(e[ZmOrganizer.F_TOTAL]){
+this._controller._resetNavToolBarButtons(this._controller._getViewType())
+}}};
+ZmListView.prototype._tagChangeListener=function(r){
+if(r.type!=ZmEvent.S_TAG){
+return
+}
+var t=r.getDetail("fields");
+if(r.event==ZmEvent.E_MODIFY&&(t&&t[ZmOrganizer.F_COLOR])){
+var n=this._getChildren();
+var e=r.getDetail("organizers")[0];
+for(var o=0;
+o<n.length;
+o++){
+var s=this.getItemFromElement(n[o]);
+if(s&&s.tags&&(s.tags.length==1)&&(s.tags[0]==e.id)){
+this._setImage(s,ZmItem.F_TAG,s.getTagImageInfo())
+}}}else{
+if(r.event==ZmEvent.E_DELETE){
+var n=this._getChildren();
+var e=r.getDetail("organizers")[0];
+for(var o=0;
+o<n.length;
+o++){
+var s=this.getItemFromElement(n[o]);
+var a=ZmOrganizer.normalizeId(e.id);
+if(s&&s.tags&&s.hasTag(a)){
+s.tagLocal(a,false);
+this._setImage(s,ZmItem.F_TAG,s.getTagImageInfo())
+}}}}};
+ZmListView.prototype._getChildren=function(){
+return this._parentEl.childNodes
+};
+ZmListView.prototype._getRowId=function(e){
+return DwtId.getListViewItemId(DwtId.WIDGET_ITEM_FIELD,this._view,e?e.id:Dwt.getNextId(),ZmItem.F_ITEM_ROW)
+};
+ZmListView.prototype._getCellId=function(e,t){
+if(t==ZmItem.F_DATE){
+return this._getFieldId(e,t)
+}else{
+if(t==ZmItem.F_SELECTION){
+return this._getFieldId(e,ZmItem.F_SELECTION_CELL)
+}else{
+return DwtListView.prototype._getCellId.apply(this,arguments)
+}}};
+ZmListView.prototype._getCellClass=function(e,t,a){
+return ZmListView.FIELD_CLASS[t]
+};
+ZmListView.prototype._getCellContents=function(t,e,a,o,r,s){
+if(o==ZmItem.F_SELECTION){
+e=this._getImageHtml(t,e,"CheckboxUnchecked",this._getFieldId(a,o))
+}else{
+if(o==ZmItem.F_TYPE){
+e=this._getImageHtml(t,e,ZmItem.ICON[a.type],this._getFieldId(a,o))
+}else{
+if(o==ZmItem.F_FLAG){
+e=this._getImageHtml(t,e,this._getFlagIcon(a.isFlagged),this._getFieldId(a,o))
+}else{
+if(o==ZmItem.F_TAG){
+e=this._getImageHtml(t,e,a.getTagImageInfo(),this._getFieldId(a,o))
+}else{
+if(o==ZmItem.F_ATTACHMENT){
+e=this._getImageHtml(t,e,a.hasAttach?"Attachment":null,this._getFieldId(a,o))
+}else{
+if(o==ZmItem.F_DATE){
+t[e++]=AjxDateUtil.computeDateStr(s.now||new Date(),a.date)
+}else{
+if(o==ZmItem.F_PRIORITY){
+var n=null;
+if(a.isHighPriority){
+n="PriorityHigh_list"
+}else{
+if(a.isLowPriority){
+n="PriorityLow_list"
+}else{
+n="PriorityNormal_list"
+}}
+e=this._getImageHtml(t,e,n,this._getFieldId(a,o))
+}else{
+e=DwtListView.prototype._getCellContents.apply(this,arguments)
+}}}}}}}
+return e
+};
+ZmListView.prototype._getImageHtml=function(a,t,e,n){
+e=e||"Blank_16";
+var o=n?["id='",n,"'"].join(""):null;
+a[t++]=AjxImg.getImageHtml(e,null,o);
+return t
+};
+ZmListView.prototype._setImage=function(a,o,e){
+var t=this._getElement(a,o);
+if(t&&t.parentNode){
+e=e||"Blank_16";
+AjxImg.setImage(t.parentNode,e)
+}};
+ZmListView.prototype._getFragmentSpan=function(e){
+return["<span class='ZmConvListFragment' id='",this._getFieldId(e,ZmItem.F_FRAGMENT),"'>",this._getFragmentHtml(e),"</span>"].join("")
+};
+ZmListView.prototype._getFragmentHtml=function(e){
+return[" - ",AjxStringUtil.htmlEncode(e.fragment,true)].join("")
+};
+ZmListView.prototype._getFlagIcon=function(t,e){
+return(t||e)?"FlagRed":"Blank_16"
+};
+ZmListView.prototype._parseId=function(t){
+var e=t.split(DwtId.SEP);
+if(e&&e.length){
+return{
+view:e[1],item:e[2],field:e[3],participant:e[4]}
+}else{
+return null
+}};
+ZmListView.prototype._mouseOutAction=function(n,h){
+DwtListView.prototype._mouseOutAction.call(this,n,h);
+var r=n.target.id||h.id;
+if(!r){
+return true
+}
+var s=this._data[h.id];
+var t=s.type;
+if(t&&t==DwtListView.TYPE_LIST_ITEM){
+var e=this._parseId(r);
+if(e&&e.field){
+if(e.field==ZmItem.F_SELECTION){
+var o=this._getItemData(h,"origSelClassName");
+if(o){
+n.target.className=o
+}}else{
+if(e.field==ZmItem.F_FLAG){
+var a=this.getItemFromElement(h);
+if(!a.isFlagged){
+AjxImg.setImage(n.target,this._getFlagIcon(a.isFlagged,false),true)
+}}}}}
+return true
+};
+ZmListView.prototype._doubleClickAction=function(t,o){
+var a=t.target.id?t.target.id:o.id;
+if(!a){
+return true
+}
+var e=this._parseId(a);
+return(!(e&&(e.field==ZmItem.F_FLAG)))
+};
+ZmListView.prototype._itemClicked=function(n,r){
+if(appCtxt.get(ZmSetting.SHOW_SELECTION_CHECKBOX)&&r.button==DwtMouseEvent.LEFT){
+if(!r.shiftKey&&!r.ctrlKey){
+var a=(r.target.id&&r.target.id.indexOf("AjxImg")==-1)?r.target.id:n.id;
+var s=a?this._parseId(a):null;
+if(s&&(s.field==ZmItem.F_SELECTION)||(s.field==ZmItem.F_SELECTION_CELL)){
+if(this._selectedItems.size()==1){
+var o=this._selectedItems.get(0);
+var c=this.getItemFromElement(o);
+var h=c?this._getFieldId(c,ZmItem.F_SELECTION):null;
+var l=h?document.getElementById(h):null;
+if(l&&o==n){
+var e=this._getItemData(o,"origSelClassName");
+if(e=="ImgCheckboxChecked"){
+l.className="ImgCheckboxUnchecked";
+this._setItemData(o,"origSelClassName","ImgCheckboxUnchecked")
+}else{
+if(e=="ImgCheckboxUnchecked"){
+l.className="ImgCheckboxChecked";
+this._setItemData(o,"origSelClassName","ImgCheckboxChecked");
+return
+}}}else{
+if(l&&l.className=="ImgCheckboxUnchecked"){
+DwtListView.prototype.deselectAll.call(this)
+}}}
+var t=this._selectedItems.contains(n);
+this.setMultiSelection(n,t);
+return
+}}else{
+if(r.shiftKey){
+this._checkSelectedItems(false);
+DwtListView.prototype._itemClicked.call(this,n,r);
+this._checkSelectedItems(true);
+return
+}}}
+DwtListView.prototype._itemClicked.call(this,n,r)
+};
+ZmListView.prototype._columnClicked=function(t,e){
+DwtListView.prototype._columnClicked.call(this,t,e);
+this._checkSelectionColumnClicked(t,e)
+};
+ZmListView.prototype._checkSelectionColumnClicked=function(r,n){
+if(!appCtxt.get(ZmSetting.SHOW_SELECTION_CHECKBOX)){
+return
+}
+var s=this.getList();
+var a=s?s.size():null;
+if(a>0){
+var e=this._data[r.id].index;
+var o=this._headerList[e];
+if(o&&(o._field==ZmItem.F_SELECTION)){
+var t=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_ICON,this._view,o._field);
+var h=document.getElementById(t);
+if(h){
+this.allSelected=false;
+if(h.className=="ImgCheckboxChecked"){
+this.deselectAll();
+h.className="ImgCheckboxUnchecked"
+}else{
+h.className="ImgCheckboxChecked";
+this.selectAll(n.shiftKey)
+}}}
+this._controller._resetToolbarOperations()
+}};
+ZmListView.prototype.handleKeyAction=function(e,t){
+var a=DwtListView.prototype.handleKeyAction.call(this,e,t);
+if(e==DwtKeyMap.SELECT_ALL){
+this._controller._resetToolbarOperations()
+}
+return a
+};
+ZmListView.prototype.setMultiSelection=function(e,a,t){
+if(t&&t.ctrlKey&&this._selectedItems.size()==1){
+this._checkSelectedItems(true)
+}
+DwtListView.prototype.setMultiSelection.call(this,e,a);
+this.setSelectionCbox(e,a);
+this.setSelectionHdrCbox(this.getSelection().length==this.getList().size());
+this._controller._resetToolbarOperations()
+};
+ZmListView.prototype.setSelectionCbox=function(n,o){
+if(!n){
+return
+}
+var t=n.tagName?this.getItemFromElement(n):n;
+var e=t?this._getFieldId(t,ZmItem.F_SELECTION):null;
+var a=e?document.getElementById(e):null;
+if(a){
+a.className=o?"ImgCheckboxUnchecked":"ImgCheckboxChecked";
+this._setItemData(n,"origSelClassName",a.className)
+}};
+ZmListView.prototype.setSelectionHdrCbox=function(t){
+var a=this._headerHash?this._headerHash[ZmItem.F_SELECTION]:null;
+var e=a?DwtId.getListViewHdrId(DwtId.WIDGET_HDR_ICON,this._view,a._field):null;
+var o=e?document.getElementById(e):null;
+if(o){
+o.className=t?"ImgCheckboxChecked":"ImgCheckboxUnchecked"
+}};
+ZmListView.prototype.setSelectedItems=function(e){
+DwtListView.prototype.setSelectedItems.call(this,e);
+if(appCtxt.get(ZmSetting.SHOW_SELECTION_CHECKBOX)){
+this._checkSelectedItems(true)
+}};
+ZmListView.prototype.selectAll=function(e){
+DwtListView.prototype.selectAll.apply(this,arguments);
+if(this._selectAllEnabled){
+var a=this._controller._activeSearch;
+if(a&&a.getAttribute("more")){
+var t=AjxMessageFormat.format(ZmMsg.allPageSelected,this.getList().size());
+if(e){
+this.allSelected=true;
+t=ZmMsg.allSearchSelected
+}
+appCtxt.setStatusMsg(t)
+}}};
+ZmListView.prototype.deselectAll=function(){
+if(appCtxt.get(ZmSetting.SHOW_SELECTION_CHECKBOX)){
+this._checkSelectedItems(false);
+this.allSelected=false;
+var e=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_ICON,this._view,ZmItem.F_SELECTION);
+var t=document.getElementById(e);
+if(t){
+t.className="ImgCheckboxUnchecked"
+}}
+DwtListView.prototype.deselectAll.call(this)
+};
+ZmListView.prototype._checkSelectedItems=function(e){
+var a=this.getSelection();
+for(var t=0;
+t<a.length;
+t++){
+this.setSelectionCbox(a[t],!e)
+}
+this.setSelectionHdrCbox(a.length==this.getList().size())
+};
+ZmListView.prototype._setNoResultsHtml=function(){
+DwtListView.prototype._setNoResultsHtml.call(this);
+this.setSelectionHdrCbox(false)
+};
+ZmListView.prototype._getActionMenuForColHeader=function(o){
+if(!this._colHeaderActionMenu||o){
+this._colHeaderActionMenu=new ZmPopupMenu(this);
+var n=new AjxListener(this,this._colHeaderActionListener);
+for(var t=0;
+t<this._headerList.length;
+t++){
+var a=this._headerList[t];
+if(a._width){
+var e=this._colHeaderActionMenu.createMenuItem(a._id,{
+text:a._name,style:DwtMenuItem.CHECK_STYLE}
+);
+e.setData(ZmListView.KEY_ID,a._id);
+e.setChecked(a._visible,true);
+if(a._noRemove){
+e.setEnabled(false)
+}
+this._colHeaderActionMenu.addSelectionListener(a._id,n)
+}}}
+return this._colHeaderActionMenu
+};
+ZmListView.prototype._colHeaderActionListener=function(a){
+var o=a.item.getData(ZmListView.KEY_ID);
+for(var t=0;
+t<this._headerList.length;
+t++){
+var e=this._headerList[t];
+if(e._id==o){
+e._visible=!e._visible;
+break
+}}
+this._relayout()
+};
+ZmListView.prototype.getToolTipContent=function(h){
+var e=this.getTargetItemDiv(h);
+if(!e){
+return
+}
+var a=h.target.id||e.id;
+if(!a){
+return""
+}
+var n=this._data[e.id];
+var r=n.type;
+var d;
+if(r&&r==DwtListView.TYPE_HEADER_ITEM){
+var t=n.index;
+var l=this._headerList[t]._field;
+d=this._getHeaderToolTip(l,t)
+}else{
+var s=this._parseId(a);
+if(s&&s.field){
+var c=this.getItemFromElement(e);
+var o={
+field:s.field,item:c,ev:h,div:e,match:s};
+d=this._getToolTip(o)
+}}
+return d
+};
+ZmListView.prototype._getHeaderToolTip=function(o,t,e){
+var a=null;
+if(o==ZmItem.F_SELECTION){
+a=ZmMsg.selectionColumn
+}else{
+if(o==ZmItem.F_FLAG){
+a=ZmMsg.flag
+}else{
+if(o==ZmItem.F_PRIORITY){
+a=ZmMsg.priority
+}else{
+if(o==ZmItem.F_TAG){
+a=ZmMsg.tag
+}else{
+if(o==ZmItem.F_ATTACHMENT){
+a=ZmMsg.attachment
+}else{
+if(o==ZmItem.F_SUBJECT){
+a=(this._headerList[t]._sortable)?ZmMsg.sortBySubject:ZmMsg.subject
+}else{
+if(o==ZmItem.F_DATE){
+a=(this._headerList[t]._sortable)?(e&&e.sent)?ZmMsg.sortBySent:(e&&e.drafts)?ZmMsg.sortByLastSaved:ZmMsg.sortByReceived:ZmMsg.date
+}else{
+if(o==ZmItem.F_FROM){
+a=(this._headerList[t]._sortable)?(e&&(e.sent||e.drafts))?ZmMsg.sortByTo:ZmMsg.sortByFrom:(e&&(e.sent||e.drafts))?ZmMsg.to:ZmMsg.from
+}else{
+if(o==ZmItem.F_SIZE){
+a=(this._headerList[t]._sortable)?ZmMsg.sortBySize:ZmMsg.sizeToolTip
+}else{
+if(o==ZmItem.F_FOLDER){
+a=ZmMsg.folder
+}}}}}}}}}}
+return a
+};
+ZmListView.prototype._getToolTip=function(n){
+var t,o=n.field,a=n.ev.target,e=n.item;
+if(o==ZmItem.F_SELECTION){
+this._setItemData(n.div,"origSelClassName",a.className);
+if(a.className!="ImgCheckboxChecked"){
+a.className="ImgCheckboxChecked"
+}}else{
+if(o==ZmItem.F_FLAG){
+if(!e.isFlagged){
+AjxImg.setDisabledImage(a,this._getFlagIcon(e.isFlagged,true),true)
+}}else{
+if(o==ZmItem.F_PRIORITY){
+if(e.isHighPriority){
+t=ZmMsg.highPriorityTooltip
+}else{
+if(e.isLowPriority){
+t=ZmMsg.lowPriorityTooltip
+}}}else{
+if(o==ZmItem.F_TAG){
+t=this._getTagToolTip(e)
+}else{
+if(o==ZmItem.F_ATTACHMENT){}else{
+if(o==ZmItem.F_DATE){
+t=this._getDateToolTip(e,n.div)
+}}}}}}
+return t
+};
+ZmListView.prototype._getTagToolTip=function(r){
+if(!r){
+return
+}
+var s=r.tags.length;
+if(!s){
+return
+}
+var h=appCtxt.getTagTree();
+var a=r.tags;
+var n=[];
+var t=0;
+for(var o=0;
+o<s;
+o++){
+var e=h.getById(a[o]);
+if(!e){
+continue
+}
+n[t++]="<table><tr><td>";
+n[t++]=AjxImg.getImageHtml(ZmTag.COLOR_ICON[e.color]);
+n[t++]="</td><td valign='middle'>";
+n[t++]=AjxStringUtil.htmlEncode(e.name);
+n[t++]="</td></tr></table>"
+}
+return n.join("")
+};
+ZmListView.prototype._getAttachmentToolTip=function(e){
+var t=null;
+var o=e&&e.attachments?e.attachments:[];
+if(o.length==1){
+var a=ZmMimeTable.getInfo(o[0].ct);
+t=a?a.desc:null
+}else{
+if(o.length>1){
+t=AjxMessageFormat.format(ZmMsg.multipleAttachmentsTooltip,[o.length])
+}}
+return t
+};
+ZmListView.prototype._getDateToolTip=function(e,t){
+t._dateStr=t._dateStr||this._getDateToolTipText(e.date);
+return t._dateStr
+};
+ZmListView.prototype._getDateToolTipText=function(t,n){
+if(!t){
+return""
+}
+var e=[];
+var a=0;
+e[a++]=n;
+var o=AjxDateFormat.getDateTimeInstance(AjxDateFormat.FULL,AjxDateFormat.MEDIUM);
+e[a++]=o.format(new Date(t));
+var s=AjxDateUtil.computeDateDelta(t);
+if(s){
+e[a++]="<br><center><span style='white-space:nowrap'>(";
+e[a++]=s;
+e[a++]=")</span></center>"
+}
+return e.join("")
+};
+ZmListView.prototype._setListEvent=function(o,n,t){
+DwtListView.prototype._setListEvent.call(this,o,n,t);
+var s=(o.target.id&&o.target.id.indexOf("AjxImg")==-1)?o.target.id:t.id;
+if(!s){
+return false
+}
+var e=this._parseId(s);
+if(o.button==DwtMouseEvent.LEFT){
+this._selEv.field=e?e.field:null
+}else{
+if(o.button==DwtMouseEvent.RIGHT){
+this._actionEv.field=e?e.field:null;
+if(e&&e.field){
+if(e.field==ZmItem.F_PARTICIPANT){
+var a=this.getItemFromElement(t);
+this._actionEv.detail=a.participants?a.participants.get(e.participant):null
+}}}}
+return true
+};
+ZmListView.prototype._allowLeftSelection=function(o,n,t){
+if(!(n instanceof DwtMouseEvent)){
+return true
+}
+var r=(n.target.id&&n.target.id.indexOf("AjxImg")==-1)?n.target.id:o.id;
+var s=this._data[o.id];
+var a=s.type;
+if(r&&a&&a==DwtListView.TYPE_LIST_ITEM){
+var e=this._parseId(r);
+if(e&&e.field){
+return this._allowFieldSelection(e.item,e.field)
+}}
+return true
+};
+ZmListView.prototype._allowFieldSelection=function(t,e){
+return(!this._disallowSelection[e])
+};
+ZmListView.prototype._sortColumn=function(e,t){
+var a;
+switch(e._sortable){
+case ZmItem.F_FROM:a=t?ZmSearch.NAME_ASC:ZmSearch.NAME_DESC;
+break;
+case ZmItem.F_SUBJECT:a=t?ZmSearch.SUBJ_ASC:ZmSearch.SUBJ_DESC;
+break;
+case ZmItem.F_DATE:a=t?ZmSearch.DATE_ASC:ZmSearch.DATE_DESC;
+break;
+case ZmItem.F_SIZE:a=t?ZmSearch.SIZE_ASC:ZmSearch.SIZE_DESC;
+break;
+case ZmItem.F_SORTED_BY:a=t?ZmSearch.DATE_ASC:ZmSearch.DATE_DESC;
+break
+}
+if(a){
+this._sortByString=a;
+appCtxt.set(ZmSetting.SORTING_PREF,a,this.view)
+}};
+ZmListView.prototype._setNextSelection=function(){
+if(this.firstSelIndex<0){
+this.firstSelIndex=0
+}
+var e=this._list.get(this.firstSelIndex)||this._list.getLast();
+if(e){
+this.setSelection(e,false)
+}};
+ZmListView.prototype._relayout=function(){
+DwtListView.prototype._relayout.call(this);
+this._checkColumns()
+};
+ZmListView.prototype._checkColumns=function(){
+var o=this._headerList.length;
+var e=[];
+for(var t=0;
+t<o;
+t++){
+var n=this._headerList[t];
+if(n){
+e.push(n._field+(n._visible?"":"*"))
+}}
+var a=e.join(ZmListView.COL_JOIN);
+a=(a==this._defaultCols)?"":a;
+appCtxt.set(ZmSetting.LIST_VIEW_COLUMNS,a,this.view);
+this._getActionMenuForColHeader(true)
+};
+ZmListView.handleScroll=function(e){
+var t=DwtUiEvent.getTarget(e);
+var a=DwtControl.findControl(t);
+if(a){
+a._checkItemCount()
+}};
+ZmListView.prototype._checkItemCount=function(){
+if(!(this._controller._list&&this._controller._list.hasMore())||!this._list){
+return
+}
+if(!this._rendered||!this._rowHeight){
+return
+}
+var l=this._parentEl;
+var n=l.scrollHeight,o=l.scrollTop,t=this._rowHeight;
+var s=l.clientHeight||Dwt.getSize(l).y;
+var r=s+(this.getPagelessThreshold()*this._rowHeight);
+var e=n-o;
+if(e==s){
+e=(this._list.size()*t)-o;
+if(o==0){
+AjxTimedAction.scheduleAction(new AjxTimedAction(this,this._resetColWidth),100)
+}}
+var a=0;
+if(e<r){
+a=Math.max(Math.floor((r-e)/t),this.getLimit(1))
+}
+if(a){
+this._controller._paginate(this._view,true,null,a)
+}};
+ZmListView.prototype._sizeChildren=function(e){
+if(DwtListView.prototype._sizeChildren.apply(this,arguments)){
+this._checkItemCount()
+}}
+}
+if(AjxPackage.define("zimbraMail.share.view.ZmAppChooser")){
+ZmAppChooser=function(a){
+a.className=a.className||"ZmAppChooser";
+a.width=appCtxt.getSkinHint("appChooser","fullWidth")?"100%":null;
+ZmToolBar.call(this,a);
+Dwt.setLocation(this.getHtmlElement(),Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
+this.setScrollStyle(Dwt.CLIP);
+this._buttonListener=new AjxListener(this,this._handleButton);
+var t=a.buttons;
+for(var e=0;
+e<t.length;
+e++){
+var o=t[e];
+if(o==ZmAppChooser.SPACER){
+this.addSpacer(ZmAppChooser.SPACER_HEIGHT)
+}else{
+this._createButton(o)
+}}
+this._createPrecedenceList();
+this._inited=true
+};
+ZmAppChooser.prototype=new ZmToolBar;
+ZmAppChooser.prototype.constructor=ZmAppChooser;
+ZmAppChooser.prototype.toString=function(){
+return"ZmAppChooser"
+};
+ZmAppChooser.SPACER="spacer";
+ZmAppChooser.B_HELP="Help";
+ZmAppChooser.B_LOGOUT="Logout";
+ZmApp.CHOOSER_SORT[ZmAppChooser.SPACER]=160;
+ZmApp.CHOOSER_SORT[ZmAppChooser.B_HELP]=170;
+ZmApp.CHOOSER_SORT[ZmAppChooser.B_LOGOUT]=190;
+ZmApp.ICON[ZmAppChooser.B_HELP]="Help";
+ZmApp.ICON[ZmAppChooser.B_LOGOUT]="Logoff";
+ZmApp.CHOOSER_TOOLTIP[ZmAppChooser.B_HELP]="goToHelp";
+ZmApp.CHOOSER_TOOLTIP[ZmAppChooser.B_LOGOUT]="logOff";
+ZmAppChooser.SPACER_HEIGHT=10;
+ZmAppChooser.prototype.TEMPLATE="share.Widgets#ZmAppChooser";
+ZmAppChooser.prototype.ITEM_TEMPLATE="share.Widgets#ZmAppChooserItem";
+ZmAppChooser.prototype.SPACER_TEMPLATE="dwt.Widgets#ZmAppChooserSpacer";
+ZmAppChooser.prototype.addSelectionListener=function(e){
+this.addListener(DwtEvent.SELECTION,e)
+};
+ZmAppChooser.prototype.addButton=function(o,a){
+var t={
+parent:this,id:ZmId.getButtonId(ZmId.APP,o),text:a.text,image:a.image,index:a.index};
+var e=new ZmAppButton(t);
+e.setToolTipContent(a.tooltip);
+e.textPrecedence=a.textPrecedence;
+e.imagePrecedence=a.imagePrecedence;
+e.setData(Dwt.KEY_ID,o);
+e.addSelectionListener(this._buttonListener);
+this._buttons[o]=e;
+if(e.textPrecedence||e.imagePrecedence){
+this._createPrecedenceList()
+}
+this.adjustSize();
+return e
+};
+ZmAppChooser.prototype.removeButton=function(a){
+var t=this._buttons[a];
+if(t){
+var e=this.__getButtonIndex(a);
+t.dispose();
+this._buttons[a]=null;
+delete this._buttons[a];
+if(e!=null){
+this._removeItem(this._items[e])
+}}};
+ZmAppChooser.prototype.replaceButton=function(a,e,t){
+if(!this._buttons[a]){
+return
+}
+t.index=this.__getButtonIndex(a);
+this.removeButton(a);
+return this.addButton(e,t)
+};
+ZmAppChooser.prototype.getButton=function(e){
+return this._buttons[e]
+};
+ZmAppChooser.prototype.setSelected=function(a){
+var e=this._buttons[this._selectedId];
+if(this._selectedId&&e){
+this.__markPrevNext(this._selectedId,false);
+e.setSelected(false);
+e._noFocus=false
+}
+var t=this._buttons[a];
+if(t){
+t.setSelected(true);
+if(t._toggleText!=null&&t._toggleText!=""){
+if(e){
+e._toggleText=(e._toggleText!=null&&e._toggleText!="")?e._toggleText:e.getText();
+e.setText("")
+}
+t.setText(t._toggleText);
+t._toggleText=null
+}
+t._noFocus=true
+}
+this._selectedId=a
+};
+ZmAppChooser.prototype._createButton=function(e){
+this.addButton(e,{
+text:ZmMsg[ZmApp.NAME[e]],image:ZmApp.ICON[e],tooltip:ZmMsg[ZmApp.CHOOSER_TOOLTIP[e]],textPrecedence:ZmApp.TEXT_PRECEDENCE[e],imagePrecedence:ZmApp.IMAGE_PRECEDENCE[e]}
+)
+};
+ZmAppChooser.prototype._handleButton=function(e){
+this.notifyListeners(DwtEvent.SELECTION,e)
+}
+}
+if(AjxPackage.define("zimbraMail.share.view.ZmAppButton")){
+ZmAppButton=function(e){
+if(arguments.length==0){
+return
+}
+e.style=DwtLabel.IMAGE_LEFT;
+e.posStyle=DwtControl.RELATIVE_STYLE;
+DwtButton.call(this,e);
+this.setImage(e.image);
+this.setText(e.text)
+};
+ZmAppButton.prototype=new DwtButton;
+ZmAppButton.prototype.constructor=ZmAppButton;
+ZmAppButton.prototype.toString=function(){
+return"ZmAppButton"
+};
+ZmAppButton.prototype.TEMPLATE="share.Widgets#ZmAppChooserButton";
+ZmAppButton.prototype.setSelected=function(e){
+this.isSelected=e;
+this.setDisplayState(e?DwtControl.SELECTED:DwtControl.NORMAL)
+};
+ZmAppButton.prototype.setDisplayState=function(e){
+if(this.isSelected&&e!=DwtControl.SELECTED){
+e=[DwtControl.SELECTED,e].join(" ")
+}
+DwtButton.prototype.setDisplayState.call(this,e)
+};
+ZmAppButton.prototype.getKeyMapName=function(){
+return"ZmAppButton"
+};
+ZmAppButton.prototype.handleKeyAction=function(e,t){
+switch(e){
+case DwtKeyMap.SELECT:if(this.isListenerRegistered(DwtEvent.SELECTION)){
+var a=DwtShell.selectionEvent;
+a.item=this;
+this.notifyListeners(DwtEvent.SELECTION,a)
+}
+break;
+default:return false
+}
+return true
+};
+ZmAppButton.prototype._focus=function(){
+this.setDisplayState(DwtControl.HOVER)
+}
+}
+if(AjxPackage.define("zimbraMail.share.view.ZmStatusView")){
+ZmStatusView=function(a,t,e,o){
+DwtControl.call(this,{
+parent:a,className:(t||"ZmStatus"),posStyle:e,id:o}
+);
+this._toast=this._standardToast=new ZmToast(this,ZmId.TOAST);
+this._statusQueue=[]
+};
+ZmStatusView.prototype=new DwtControl;
+ZmStatusView.prototype.constructor=ZmStatusView;
+ZmStatusView.LEVEL_INFO=1;
+ZmStatusView.LEVEL_WARNING=2;
+ZmStatusView.LEVEL_CRITICAL=3;
+ZmStatusView.MSG_PARAMS=["msg","level","detail","transitions","toast"];
+ZmStatusView.prototype.toString=function(){
+return"ZmStatusView"
+};
+ZmStatusView.prototype.setStatusMsg=function(t){
+t=Dwt.getParams(arguments,ZmStatusView.MSG_PARAMS);
+if(typeof t=="string"){
+t={
+msg:t}
+}
+var e={
+msg:t.msg,level:t.level||ZmStatusView.LEVEL_INFO,detail:t.detail,date:new Date(),transitions:t.transitions,toast:t.toast||this._standardToast};
+this._statusQueue.push(e);
+if(!this._toast.isPoppedUp()){
+this._updateStatusMsg()
+}};
+ZmStatusView.prototype.nextStatus=function(){
+if(this._statusQueue.length>0){
+this._updateStatusMsg();
+return true
+}
+return false
+};
+ZmStatusView.getClass=function(e){
+switch(e.level){
+case ZmStatusView.LEVEL_CRITICAL:return"ZToastCrit";
+case ZmStatusView.LEVEL_WARNING:return"ZToastWarn";
+default:return"ZToastInfo"
+}};
+ZmStatusView.getImageHtml=function(e){
+switch(e.level){
+case ZmStatusView.LEVEL_CRITICAL:return"Critical";
+case ZmStatusView.LEVEL_WARNING:return"Warning";
+default:return"Success"
+}};
+ZmStatusView.prototype._updateStatusMsg=function(){
+var e=this._statusQueue.shift();
+if(!e){
+return
+}
+var a=ZmStatusView.getClass(e);
+var t=ZmStatusView.getImageHtml(e);
+this._toast=e.toast;
+this._toast.popup(a,e.msg,t,null,e.transitions)
+};
+ZmToast=function(e,t){
+if(arguments.length==0){
+return
+}
+DwtComposite.call(this,{
+parent:e.shell,className:"ZToast",posStyle:Dwt.ABSOLUTE_STYLE,id:t}
+);
+this._statusView=e;
+this._createHtml();
+this._funcs={};
+this._funcs.position=AjxCallback.simpleClosure(this.__position,this);
+this._funcs.show=AjxCallback.simpleClosure(this.__show,this);
+this._funcs.hide=AjxCallback.simpleClosure(this.__hide,this);
+this._funcs.pause=AjxCallback.simpleClosure(this.__pause,this);
+this._funcs.idle=AjxCallback.simpleClosure(this.__idle,this);
+this._funcs.fade=AjxCallback.simpleClosure(this.__fade,this);
+this._funcs["fade-in"]=this._funcs.fade;
+this._funcs["fade-out"]=this._funcs.fade;
+this._funcs.slide=AjxCallback.simpleClosure(this.__slide,this);
+this._funcs["slide-in"]=this._funcs.slide;
+this._funcs["slide-out"]=this._funcs.slide;
+this._funcs.next=AjxCallback.simpleClosure(this.transition,this)
+};
+ZmToast.prototype=new DwtComposite;
+ZmToast.prototype.constructor=ZmToast;
+ZmToast.prototype.toString=function(){
+return"ZmToast"
+};
+ZmToast.FADE={
+type:"fade"};
+ZmToast.FADE_IN={
+type:"fade-in"};
+ZmToast.FADE_OUT={
+type:"fade-out"};
+ZmToast.SLIDE={
+type:"slide"};
+ZmToast.SLIDE_IN={
+type:"slide-in"};
+ZmToast.SLIDE_OUT={
+type:"slide-out"};
+ZmToast.PAUSE={
+type:"pause"};
+ZmToast.IDLE={
+type:"idle"};
+ZmToast.SHOW={
+type:"show"};
+ZmToast.DEFAULT_TRANSITIONS=[ZmToast.SLIDE_IN,ZmToast.PAUSE,ZmToast.SLIDE_OUT];
+ZmToast.DEFAULT_STATE={};
+ZmToast.DEFAULT_STATE.position={
+location:"C"};
+ZmToast.DEFAULT_STATE.pause={
+duration:1200};
+ZmToast.DEFAULT_STATE.fade={
+duration:100,multiplier:1};
+ZmToast.DEFAULT_STATE["fade-in"]={
+start:0,end:99,step:10,duration:200,multiplier:1};
+ZmToast.DEFAULT_STATE["fade-out"]={
+start:99,end:0,step:-10,duration:200,multiplier:1};
+ZmToast.DEFAULT_STATE.slide={
+duration:100,multiplier:1};
+ZmToast.DEFAULT_STATE["slide-in"]={
+start:-40,end:0,step:1,duration:100,multiplier:1};
+ZmToast.DEFAULT_STATE["slide-out"]={
+start:0,end:-40,step:-1,duration:100,multiplier:1};
+ZmToast.LEVEL_RE=/\b(ZToastCrit|ZToastWarn|ZToastInfo)\b/g;
+ZmToast.prototype.TEMPLATE="share.Widgets#ZToast";
+ZmToast.prototype.dispose=function(){
+this._textEl=null;
+this._iconEl=null;
+this._detailEl=null;
+DwtComposite.prototype.dispose.call(this)
+};
+ZmToast.prototype.popup=function(h,r,a,s,n){
+this.__clear();
+this._poppedUp=true;
+var t=this.getHtmlElement();
+Dwt.delClass(t,ZmToast.LEVEL_RE,h||"ZToastInfo");
+if(this._textEl){
+this._textEl.innerHTML=r||""
+}
+if(this._iconEl){
+AjxImg.setImage(this._iconEl,a,false)
+}
+var e=appCtxt.getSkinHint("toast","location")||s;
+var o=n||appCtxt.getSkinHint("toast","transitions")||ZmToast.DEFAULT_TRANSITIONS;
+o=[].concat({
+type:"position",location:e}
+,o,{
+type:"hide"}
+);
+this._transitions=o;
+this.transition()
+};
+ZmToast.prototype.popdown=function(){
+this.__clear();
+Dwt.setLocation(this.getHtmlElement(),Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
+this._poppedUp=false
+};
+ZmToast.prototype.isPoppedUp=function(){
+return this._poppedUp
+};
+ZmToast.prototype.transition=function(){
+var a=this._transitions&&this._transitions.shift();
+if(!a){
+this._poppedUp=false;
+if(!this._statusView.nextStatus()){
+this.popdown()
+}
+return
+}
+var t=this._state=this._createState(a);
+var e=this.getHtmlElement();
+Dwt.setLocation(e,t.x,t.y);
+this._funcs[a.type||"next"]()
+};
+ZmToast.prototype._createHtml=function(e){
+var t={
+id:this._htmlElId};
+this._createHtmlFromTemplate(e||this.TEMPLATE,t);
+Dwt.setZIndex(this.getHtmlElement(),Dwt.Z_TOAST)
+};
+ZmToast.prototype._createHtmlFromTemplate=function(e,t){
+DwtComposite.prototype._createHtmlFromTemplate.call(this,e,t);
+this._textEl=document.getElementById(t.id+"_text");
+this._iconEl=document.getElementById(t.id+"_icon");
+this._detailEl=document.getElementById(t.id+"_detail")
+};
+ZmToast.prototype._createState=function(n){
+var a=AjxUtil.createProxy(n);
+var o=ZmToast.DEFAULT_STATE[a.type];
+for(var e in o){
+if(!a[e]){
+a[e]=o[e]
+}}
+var t=this.getHtmlElement();
+switch(a.type){
+case"fade-in":Dwt.setOpacity(t,0);
+Dwt.setLocation(t,null,0);
+a.value=a.start;
+break;
+case"fade-out":case"fade":Dwt.setLocation(t,null,0);
+a.value=a.start;
+break;
+case"slide-in":case"slide-out":case"slide":Dwt.setLocation(t,null,-36);
+Dwt.setOpacity(t,100);
+a.value=a.start;
+break
+}
+return a
+};
+ZmToast.prototype.__clear=function(){
+clearTimeout(this._actionId);
+clearInterval(this._actionId);
+this._actionId=-1
+};
+ZmToast.prototype.__position=function(){
+var a=this.getHtmlElement();
+var n=Dwt.getSize(this.shell.getHtmlElement());
+var o=Dwt.getSize(a);
+var e=(n.x-o.x)/2;
+var s=(n.y-o.y)/2;
+var t=this._state.location||"C";
+switch(t.toUpperCase()){
+case"N":s=0-o.y;
+break;
+case"S":s=n.y-o.y;
+break;
+case"E":e=n.x-o.x;
+break;
+case"W":e=0;
+break;
+case"NE":e=n.x-o.x;
+s=0;
+break;
+case"NW":e=0;
+s=0;
+break;
+case"SE":e=n.x-o.x;
+s=n.y-o.y;
+break;
+case"SW":e=0;
+s=n.y-o.y;
+break;
+case"C":default:break
+}
+Dwt.setLocation(a,e,s);
+this._funcs.next()
+};
+ZmToast.prototype.__show=function(){
+var e=this.getHtmlElement();
+Dwt.setVisible(e,true);
+Dwt.setVisibility(e,true);
+this._funcs.next()
+};
+ZmToast.prototype.__hide=function(){
+var e=this.getHtmlElement();
+Dwt.setLocation(e,Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
+this._funcs.next()
+};
+ZmToast.prototype.__pause=function(){
+setTimeout(this._funcs.next,this._state.duration)
+};
+ZmToast.prototype.__idle=function(){
+if(!this._idleTimer){
+this._idleTimer=new DwtIdleTimer(0,new AjxCallback(this,this.__idleCallback))
+}else{
+this._idleTimer.resurrect(0)
+}};
+ZmToast.prototype.__idleCallback=function(e){
+if(!e){
+this.transition();
+this._idleTimer.kill()
+}};
+ZmToast.prototype.__move=function(){
+this._funcs.next()
+};
+ZmToast.prototype.__fade=function(){
+var t=this._state.value;
+var o=this._state.step;
+if(AjxEnv.isIE){
+if(AjxEnv.isIE5_5up){
+try{
+var a=this.getHtmlElement();
+a.style.visibility=o>0?"hidden":"visible";
+var s=this._state.duration/1000;
+a.style.filter="progid:DXImageTransform.Microsoft.Fade(duration="+s+",overlap=1.0)";
+a.filters[0].Apply();
+a.style.visibility=o>0?"visible":"hidden";
+a.filters[0].Play()
+}
+catch(n){}}
+setTimeout(this._funcs.next,0);
+return
+}
+var r=o>0?t>=this._state.end:t<=this._state.end;
+if(r){
+t=this._state.end
+}
+var a=this.getHtmlElement();
+Dwt.setOpacity(a,t);
+if(r){
+this.__clear();
+setTimeout(this._funcs.next,0);
+return
+}
+if(this._actionId==-1){
+var s=this._state.duration;
+var h=s/Math.abs(o);
+this._actionId=setInterval(this._funcs.fade,h)
+}
+this._state.value+=o;
+this._state.step*=this._state.multiplier
+};
+ZmToast.prototype.__slide=function(){
+var o=this._state.value;
+var t=this._state.step;
+var n=t>0?o>=this._state.end:o<=this._state.end;
+if(n){
+o=this._state.end
+}
+var e=this.getHtmlElement();
+Dwt.setLocation(e,null,o);
+if(n){
+this.__clear();
+setTimeout(this._funcs.next,0);
+return
+}
+if(this._actionId==-1){
+var a=this._state.duration;
+var s=a/Math.abs(t);
+this._actionId=setInterval(this._funcs.slide,s)
+}
+this._state.value+=t;
+this._state.step*=this._state.multiplier
+}
+}
+if(AjxPackage.define("zimbraMail.share.view.ZmOverviewContainer")){
+ZmOverviewContainer=function(e){
+if(arguments.length==0){
+return
+}
+e.className=e.className||"ZmOverviewContainer";
+e.id=e.id||ZmId.getOverviewContainerId(e.containerId);
+DwtTree.call(this,e);
+this.setScrollStyle(e.scroll||Dwt.SCROLL);
+this.containerId=e.containerId;
+this._appName=e.appName;
+this._controller=e.controller;
+this._headerItems={};
+this._overview={};
+this.addSelectionListener(new AjxListener(this,this._treeViewListener));
+this.addTreeListener(new AjxListener(this,this._treeListener))
+};
+ZmOverviewContainer.prototype=new DwtTree;
+ZmOverviewContainer.prototype.constructor=ZmOverviewContainer;
+ZmOverviewContainer.prototype.toString=function(){
+return"ZmOverviewContainer"
+};
+ZmOverviewContainer.prototype.initialize=function(e){};
+ZmOverviewContainer.prototype.getOverview=function(e){
+return this._overview[e]
+};
+ZmOverviewContainer.prototype.getOverviews=function(){
+return this._overview
+};
+ZmOverviewContainer.prototype.getHeaderItem=function(){};
+ZmOverviewContainer.prototype.getSelected=function(){
+var t;
+for(var e in this._overview){
+t=this._overview[e].getSelected();
+if(t){
+return t
+}}};
+ZmOverviewContainer.prototype.deselectAll=function(e){
+DwtTree.prototype.deselectAll.call(this);
+this._deselectAllTreeViews(e)
+};
+ZmOverviewContainer.prototype.setOverviewTrees=function(e){
+for(var t in this._overview){
+this._overview[t].set(e)
+}};
+ZmOverviewContainer.prototype.resetOperations=function(t,e){};
+ZmOverviewContainer.prototype._treeViewListener=function(e){};
+ZmOverviewContainer.prototype._treeListener=function(e){};
+ZmOverviewContainer.prototype._initializeActionMenu=function(e){};
+ZmOverviewContainer.prototype._getActionMenu=function(){
+if(this._actionMenu instanceof AjxCallback){
+var e=this._actionMenu;
+this._actionMenu=e.run()
+}
+return this._actionMenu
+};
+ZmOverviewContainer.prototype._createActionMenu=function(t,e,a){};
+ZmOverviewContainer.prototype._actionMenuListener=function(e){};
+ZmOverviewContainer.prototype._deselectAllTreeViews=function(o){
+for(var a in this._overview){
+var n=this._overview[a];
+if(o&&o==n){
+continue
+}
+var t=n._treeHash;
+for(var e in t){
+if(t[e].getSelectionCount()>0){
+t[e].deselectAll();
+break
+}}}}
+}
+if(AjxPackage.define("zimbraMail.share.view.ZmAccountOverviewContainer")){
+ZmAccountOverviewContainer=function(e){
+if(arguments.length==0){
+return
+}
+ZmOverviewContainer.call(this,e)
+};
+ZmAccountOverviewContainer.prototype=new ZmOverviewContainer;
+ZmAccountOverviewContainer.prototype.constructor=ZmAccountOverviewContainer;
+ZmAccountOverviewContainer.prototype.toString=function(){
+return"ZmAccountOverviewContainer"
+};
+ZmAccountOverviewContainer.prototype.getHeaderItem=function(e){
+return e&&this._headerItems[e.id]
+};
+ZmAccountOverviewContainer.prototype.expandAccountOnly=function(t){
+if(!t){
+t=appCtxt.getActiveAccount()
+}
+for(var e in this._headerItems){
+this._headerItems[e].setExpanded((e==t.id),false,false)
+}};
+ZmAccountOverviewContainer.prototype.getSelected=function(){
+var t=ZmOverviewContainer.prototype.getSelected.call(this);
+if(!t){
+t=this.getSelection()[0];
+var a=t&&appCtxt.accountList.getAccount(t.getData(Dwt.KEY_ID));
+var e=a&&appCtxt.getFolderTree(a);
+return e&&e.root
+}
+return t
+};
+ZmAccountOverviewContainer.prototype.initialize=function(s){
+var h,d;
+var a=false;
+var o=appCtxt.accountList.visibleAccounts;
+for(var r=0;
+r<o.length;
+r++){
+d=o[r];
+if(appCtxt.isOffline&&d.isMain&&this._appName!=ZmApp.PREFERENCES){
+continue
+}
+this._addAccount(s,d,a);
+h=this.getHeaderItem(d);
+if(h){
+if(this._appName==ZmApp.PREFERENCES){
+h.setExpanded(true,false,true);
+h.enableSelection(false)
+}else{
+var e=appCtxt.get(ZmSetting.ACCOUNT_TREE_OPEN,null,d);
+h.setExpanded(e);
+if(!e){
+this._setAccountHeaderLabel(d,h)
+}}}
+this.updateAccountInfo(d,true,true);
+a=!a
+}
+if(appCtxt.isOffline&&this._appName!=ZmApp.PREFERENCES){
+var n=s.omit;
+if(!n){
+n={}
+}
+n[ZmFolder.ID_SPAM]=true;
+d=appCtxt.accountList.mainAccount;
+this._addAccount(s,d,a,"ZmOverviewLocalHeader");
+h=this.getHeaderItem(d);
+h.setExpanded(appCtxt.get(ZmSetting.ACCOUNT_TREE_OPEN,null,d))
+}
+var f=s.omit&&s.omit[ZmOrganizer.ID_ZIMLET];
+if(!f&&!appCtxt.inStartup){
+f=(appCtxt.getZimletMgr().getPanelZimlets().length==0)
+}
+if(!f&&window[ZmOverviewController.CONTROLLER[ZmOrganizer.ZIMLET]]){
+var l=ZmOrganizer.LABEL[ZmOrganizer.ZIMLET];
+var m=s.overviewId=appCtxt.getOverviewId([this.containerId,l],null);
+var u={
+label:ZmMsg[l],icon:"Resource",dataId:m,className:"ZmOverviewZimletHeader"};
+s.overviewTrees=[ZmOrganizer.ZIMLET];
+this._addSection(u,null,s);
+var h=this._headerItems[m];
+if(h){
+h.__isZimlet=true;
+h.setExpanded(appCtxt.get(ZmSetting.ZIMLET_TREE_OPEN,null,appCtxt.accountList.mainAccount))
+}}
+f=s.omit&&s.omit[ZmOrganizer.ID_GLOBAL_INBOX];
+if(appCtxt.isOffline&&!f&&this._appName==ZmApp.MAIL&&appCtxt.accountList.size(true)>2){
+var s={
+parent:this,text:(ZmMsg[ZmFolder.MSG_KEY[ZmOrganizer.ID_GLOBAL_INBOX]]),imageInfo:"GlobalInbox"};
+var t=new DwtTreeItem(s);
+t.setData(Dwt.KEY_ID,appCtxt.getById(ZmOrganizer.ID_GLOBAL_INBOX));
+t.setScrollStyle(Dwt.CLIP);
+t.addClassName("ZmOverviewGlobalInbox");
+t._initialize(0,true);
+t.setVisible(appCtxt.get(ZmSetting.OFFLINE_SHOW_GLOBAL_INBOX));
+this.setSelection(t,true);
+var c=appCtxt.accountList.mainAccount;
+var p=appCtxt.getSettings(c).getSetting(ZmSetting.OFFLINE_SHOW_GLOBAL_INBOX);
+p.addChangeListener(new AjxListener(this,this._settingChangeListener,t))
+}};
+ZmAccountOverviewContainer.prototype.updateAccountInfo=function(n,e,o){
+var t=appCtxt.getApp(this._appName)&&this.getHeaderItem(n);
+if(t){
+if(e){
+var a="";
+if(n.status!=ZmZimbraAccount.STATUS_ONLINE){
+a=(n.status==ZmZimbraAccount.STATUS_RUNNING)?("<img src='/img/animated/ImgSpinner.gif' width=16 height=16 border=0>"):(AjxImg.getImageHtml(n.getStatusIcon()))
+}
+if(t._extraCell){
+t._extraCell.innerHTML=a
+}}
+if(o){
+t.setToolTipContent(n.getToolTip())
+}}};
+ZmAccountOverviewContainer.prototype.resetOperations=function(t,e){
+t.enableAll(!(e instanceof ZmFolder));
+var a=appCtxt.accountList.getAccount(e);
+if(a){
+t.enable(ZmOperation.NEW_FOLDER,a.type!=ZmAccount.TYPE_POP);
+t.enable(ZmOperation.SYNC,!a.isMain)
+}};
+ZmAccountOverviewContainer.prototype.removeZimletSection=function(){
+var e=ZmOrganizer.LABEL[ZmOrganizer.ZIMLET];
+var t=appCtxt.getOverviewId([this.containerId,e],null);
+var a=this._headerItems[t];
+if(a){
+this.removeChild(a)
+}};
+ZmAccountOverviewContainer.prototype._addAccount=function(n,s,e,h){
+n.overviewId=appCtxt.getOverviewId(this.containerId,s);
+n.account=s;
+var o=appCtxt.getApp(this._appName);
+var t=(!o||(o&&appCtxt.get(ZmApp.SETTING[this._appName],null,s)));
+if(this._appName==ZmApp.PREFERENCES||t){
+var a=n.omitPerAcct?n.omitPerAcct[s.id]:n.omit;
+var r=(this._appName==ZmApp.PREFERENCES&&s.isMain)?ZmMsg.allAccounts:s.getDisplayName();
+var l={
+label:r,icon:s.getIcon(),dataId:s.id,className:h};
+this._addSection(l,a,n,e);
+this._initializeActionMenu(s)
+}};
+ZmAccountOverviewContainer.prototype._addSection=function(h,o,n,a){
+var s={
+parent:this,text:h.label,imageInfo:h.icon,selectable:n.selectable,className:h.className};
+var r=this._headerItems[h.dataId]=new DwtTreeItem(s);
+r.setData(Dwt.KEY_ID,h.dataId);
+r.setScrollStyle(Dwt.CLIP);
+r._initialize(null,true,true);
+r.addClassName(a?"ZmOverviewSectionHilite":"ZmOverviewSection");
+n.id=ZmId.getOverviewId(n.overviewId);
+n.parent=r;
+n.scroll=Dwt.CLIP;
+n.posStyle=Dwt.STATIC_STYLE;
+var t=this._controller._overview[n.overviewId]=this._overview[n.overviewId]=new ZmOverview(n,this._controller);
+r._addItem(t,null,true);
+var e=n.overviewTrees||n.treeIds;
+t.set(e,o)
+};
+ZmAccountOverviewContainer.prototype._treeViewListener=function(l){
+if(l.detail!=DwtTree.ITEM_ACTIONED&&l.detail!=DwtTree.ITEM_SELECTED&&l.detail!=DwtTree.ITEM_DBL_CLICKED){
+return
+}
+var c=this._actionedHeaderItem=l.item;
+var n=c&&c.getData(Dwt.KEY_ID);
+if(l.detail==DwtTree.ITEM_ACTIONED&&appCtxt.getApp(this._appName)){
+if(c.__isZimlet){
+return
+}
+var h=this._getActionMenu(l);
+if(h){
+this.resetOperations(h,n);
+h.popup(0,l.docX,l.docY)
+}}else{
+if((l.detail==DwtTree.ITEM_SELECTED)&&c){
+if(this._appName==ZmApp.CALENDAR||this._appName==ZmApp.PREFERENCES){
+return
+}
+this._deselectAllTreeViews();
+if(!ZmApp.NAME[this._appName]){
+return
+}
+if(n){
+var r=appCtxt.getSearchController();
+var a;
+if(n instanceof ZmFolder){
+var o=appCtxt.accountList.mainAccount;
+r.resetSearchAllAccounts();
+r.searchAllAccounts=true;
+a={
+queryHint:appCtxt.accountList.generateQuery(ZmOrganizer.ID_INBOX),folderId:null,getHtml:appCtxt.get(ZmSetting.VIEW_AS_HTML,null,o),searchFor:(ZmApp.DEFAULT_SEARCH[this._appName]),sortBy:ZmSearch.DATE_DESC,accountName:o.name,noUpdateOverview:true}
+}else{
+r.searchAllAccounts=false;
+var s=appCtxt.accountList.getAccount(n);
+appCtxt.accountList.setActiveAccount(s);
+var t=ZmOrganizer.DEFAULT_FOLDER[ZmApp.ORGANIZER[this._appName]];
+var e=appCtxt.getById(ZmOrganizer.getSystemId(t,s));
+a={
+query:e.createQuery(),getHtml:appCtxt.get(ZmSetting.VIEW_AS_HTML),searchFor:(ZmApp.DEFAULT_SEARCH[this._appName]),sortBy:((r.currentSearch&&e.nId==r.currentSearch.folderId)?null:ZmSearch.DATE_DESC),accountName:(s&&s.name),noUpdateOverview:true}
+}
+r.search(a)
+}}else{}}};
+ZmAccountOverviewContainer.prototype._treeListener=function(t){
+var o;
+var a=t.item;
+if(a){
+o=a.__isZimlet?appCtxt.accountList.mainAccount:appCtxt.accountList.getAccount(a.getData(Dwt.KEY_ID))
+}
+if(!o){
+return
+}
+if(appCtxt.getCurrentAppName()!=ZmApp.PREFERENCES&&(t.detail==DwtTree.ITEM_COLLAPSED||t.detail==DwtTree.ITEM_EXPANDED)){
+var e=t.detail==DwtTree.ITEM_EXPANDED;
+if(!appCtxt.inStartup){
+appCtxt.set(ZmSetting.ACCOUNT_TREE_OPEN,e,null,null,null,o)
+}
+if(!a.__isZimlet){
+if(e){
+a.setText(o.getDisplayName())
+}else{
+this._setAccountHeaderLabel(o,a)
+}}}};
+ZmAccountOverviewContainer.prototype._settingChangeListener=function(t,a){
+if(a.type!=ZmEvent.S_SETTING){
+return
+}
+var e=a.source;
+if(e.id==ZmSetting.OFFLINE_SHOW_GLOBAL_INBOX){
+t.setVisible(e.getValue())
+}};
+ZmAccountOverviewContainer.prototype.updateAccountHeaderLabel=function(t){
+var e=this.getHeaderItem(t);
+if(e&&!e.getExpanded()){
+this._setAccountHeaderLabel(t,e)
+}};
+ZmAccountOverviewContainer.prototype._setAccountHeaderLabel=function(n,o){
+var t=ZmOrganizer.getSystemId(ZmOrganizer.ID_INBOX,n,true);
+var a=appCtxt.getById(t);
+var e=(a&&a.numUnread>0)?(["<span style='font-weight:bold;'>",n.getDisplayName()," (",a.numUnread,")","</span>"].join("")):n.getDisplayName();
+o.setText(e)
+};
+ZmAccountOverviewContainer.prototype._initializeActionMenu=function(a){
+if(!this._actionMenu){
+var t=[ZmOperation.NEW_FOLDER,ZmOperation.SYNC];
+var e=[appCtxt.getShell(),t,a];
+this._actionMenu=new AjxCallback(this,this._createActionMenu,e)
+}};
+ZmAccountOverviewContainer.prototype._createActionMenu=function(o,a,r){
+if(!a){
+return
+}
+var s=new AjxListener(this,this._actionMenuListener);
+var n=new ZmActionMenu({
+parent:o,menuItems:a}
+);
+a=n.opList;
+for(var t=0;
+t<a.length;
+t++){
+var e=n.getItem(t);
+var h=a[t];
+if(h==ZmOperation.SYNC){
+e.setText(ZmMsg.sendReceive)
+}
+e.setData(Dwt.KEY_OBJECT,appCtxt.getFolderTree(r).root);
+n.addSelectionListener(h,s)
+}
+return n
+};
+ZmAccountOverviewContainer.prototype._actionMenuListener=function(a){
+var t=a.item.getData(ZmOperation.KEY_ID);
+if(t==ZmOperation.NEW_FOLDER){
+var n=ZmApp.ORGANIZER[this._appName];
+var e=this._controller.getTreeController(n,true);
+if(e){
+e._actionedOrganizer=null;
+var o=appCtxt.accountList.getAccount(this._actionedHeaderItem.getData(Dwt.KEY_ID));
+e._actionedOrganizer=appCtxt.getFolderTree(o).root;
+e._newListener(a,o)
+}}else{
+if(t==ZmOperation.SYNC){
+var o=appCtxt.accountList.getAccount(this._actionedHeaderItem.getData(Dwt.KEY_ID));
+if(o){
+o.sync()
+}}}}
+}
+if(AjxPackage.define("zimbraMail.share.view.ZmOverview")){
+ZmOverview=function(t,n){
+var h=t.overviewClass?t.overviewClass:"ZmOverview";
+t.id=t.id||ZmId.getOverviewId(t.overviewId);
+DwtComposite.call(this,{
+parent:t.parent,className:h,posStyle:t.posStyle,id:t.id}
+);
+this._controller=n;
+this.setScrollStyle(t.scroll||Dwt.SCROLL);
+this.overviewId=t.overviewId;
+this.account=t.account;
+this.selectionSupported=t.selectionSupported;
+this.actionSupported=t.actionSupported;
+this.dndSupported=t.dndSupported;
+this.headerClass=t.headerClass;
+this.showUnread=t.showUnread;
+this.showNewButtons=t.showNewButtons;
+this.treeStyle=t.treeStyle;
+this.isCheckedByDefault=t.isCheckedByDefault;
+this.noTooltips=t.noTooltips;
+this.isAppOverview=t.isAppOverview;
+this._treeIds=[];
+this._treeHash={};
+this._treeParents={};
+var l=document;
+var a=this.getHtmlElement();
+if(t.treeIds){
+for(var o=0,r=t.treeIds.length;
+o<r;
+o++){
+var e=l.createElement("DIV");
+var s=t.treeIds[o];
+this._treeParents[s]=e.id=[this.overviewId,s].join("-parent-");
+a.appendChild(e)
+}}
+if(this.dndSupported){
+var t={
+container:this.getHtmlElement(),threshold:15,amount:5,interval:10,id:this.overviewId};
+this._dndScrollCallback=new AjxCallback(null,DwtControl._dndScrollCallback,[t])
+}};
+ZmOverview.prototype=new DwtComposite;
+ZmOverview.prototype.constructor=ZmOverview;
+ZmOverview.prototype.toString=function(){
+return"ZmOverview"
+};
+ZmOverview.prototype.getTreeParent=function(e){
+return this._treeParents[e]
+};
+ZmOverview.prototype.set=function(e,a){
+if(e&&e.length){
+for(var t=0;
+t<e.length;
+t++){
+this.setTreeView(e[t],a)
+}}};
+ZmOverview.prototype.setTreeView=function(t,e){
+if(appCtxt.get(ZmOrganizer.PRECONDITION[t])===false){
+return
+}
+AjxDispatcher.require(ZmOrganizer.ORG_PACKAGE[t]);
+var a=this._controller.getTreeController(t);
+if(this._treeHash[t]){
+a.clearTreeView(this.overviewId)
+}else{
+this._treeIds.push(t)
+}
+var o={
+overviewId:this.overviewId,omit:e,showUnread:this.showUnread,account:this.account};
+this._treeHash[t]=a.show(o)
+};
+ZmOverview.prototype.getTreeView=function(e){
+return this._treeHash[e]
+};
+ZmOverview.prototype.getTreeViews=function(){
+return this._treeIds
+};
+ZmOverview.prototype.getTreeItemById=function(n,a){
+if(!n){
+return null
+}
+for(var t=0;
+t<this._treeIds.length;
+t++){
+var e=this._treeHash[this._treeIds[t]];
+if(e){
+var o=e.getTreeItemById&&e.getTreeItemById(n);
+if(o&&(!a||(this._treeIds[t]==a))){
+return o
+}}}
+return null
+};
+ZmOverview.prototype.getSelected=function(t){
+for(var a=0;
+a<this._treeIds.length;
+a++){
+var e=this._treeHash[this._treeIds[a]];
+if(e){
+var o=e.getSelected();
+if(o){
+return t?e.type:o
+}}}
+return null
+};
+ZmOverview.prototype.setSelected=function(o,a){
+var t,e;
+if(a){
+e=this._treeHash[a];
+t=e&&e.getTreeItemById(o)
+}else{
+for(var a in this._treeHash){
+e=this._treeHash[a];
+t=e&&e.getTreeItemById(o);
+if(t){
+break
+}}}
+if(t&&(this._selectedTreeItem!=t)){
+e.setSelected(o,true,true)
+}
+this.itemSelected(t)
+};
+ZmOverview.prototype.itemSelected=function(a){
+if(appCtxt.multiAccounts&&a){
+var t=this.overviewId.substring(0,this.overviewId.indexOf(":"));
+var e=this._controller.getOverviewContainer(t);
+if(e){
+e.deselectAll(this)
+}}
+if(this._selectedTreeItem&&(this._selectedTreeItem._tree!=(a&&a._tree))){
+this._selectedTreeItem._tree.deselectAll()
+}
+this._selectedTreeItem=a
+};
+ZmOverview.prototype.clear=function(){
+for(var e=0;
+e<this._treeIds.length;
+e++){
+var t=this._treeIds[e];
+if(this._treeHash[t]){
+var a=this._controller.getTreeController(t);
+a.clearTreeView(this.overviewId);
+delete this._treeHash[t]
+}}};
+ZmOverview.prototype._initialize=function(){};
+ZmOverview.prototype._focus=function(){
+var t=this._selectedTreeItem;
+if(!t){
+var e=this._treeHash[this._treeIds[0]];
+if(e){
+t=e._getNextTreeItem(true)
+}}
+if(t){
+t.focus()
+}};
+ZmOverview.prototype._blur=function(){
+var e=this._selectedTreeItem;
+if(e){
+e._blur()
+}};
+ZmOverview.prototype._getNextTreeItem=function(n,a){
+for(var o=0;
+o<this._treeIds.length;
+o++){
+if(this._treeHash[this._treeIds[o]]==a){
+break
+}}
+var t=null;
+var e=n?o+1:o-1;
+a=this._treeHash[this._treeIds[e]];
+while(a){
+t=DwtTree.prototype._getNextTreeItem.call(a,n);
+if(t){
+break
+}
+e=n?e+1:e-1;
+a=this._treeHash[this._treeIds[e]]
+}
+return t
+}
+}
+if(AjxPackage.define("zimbraMail.share.view.ZmUpsellView")){
+ZmUpsellView=function(e){
+DwtControl.call(this,e)
+};
+ZmUpsellView.prototype=new DwtControl;
+ZmUpsellView.prototype.constructor=ZmUpsellView;
+ZmUpsellView.prototype.toString=function(){
+return"ZmUpsellView"
+};
+ZmUpsellView.prototype.setBounds=function(t,h,o,e,s){
+var n=0;
+if(!s){
+n=this._getToolbarHeight()
+}
+DwtControl.prototype.setBounds.call(this,t,h-n,o,e+n);
+var r="iframe_"+this.getHTMLElId();
+var a=document.getElementById(r);
+if(a){
+a.width=o;
+a.height=e+n
+}};
+ZmUpsellView.prototype._getToolbarHeight=function(){
+var t=appCtxt.getAppViewMgr().getCurrentViewComponent(ZmAppViewMgr.C_TOOLBAR_TOP);
+var a=t.getSize();
+var e=a.y?a.y:t.getHtmlElement().clientHeight;
+return e
+}
+}
+if(AjxPackage.define("zimbraMail.share.controller.ZmController")){
+ZmController=function(e,t){
+if(arguments.length==0){
+return
+}
+this._container=e;
+this._app=t;
+this._shell=appCtxt.getShell();
+this._appViews={};
+this._currentView=null;
+this._authenticating=false
+};
+ZmController.prototype._setView=function(){};
+ZmController.prototype.toString=function(){
+return"ZmController"
+};
+ZmController.prototype.getApp=function(){
+return this._app
+};
+ZmController.prototype.popupErrorDialog=function(e,c,u,l){
+var s=appCtxt.getErrorDialog();
+var a="";
+if(typeof c=="string"){
+a=c
+}else{
+if(c instanceof Object){
+c.msg=c.msg||e;
+var h=["method","msg","code","detail","trace","request","fileName","lineNumber","message","name","stack"];
+var r=[],n=0;
+r[n++]="<table>";
+for(var o=0;
+o<h.length;
+o++){
+var t=h[o];
+var m=c[t];
+if(m){
+if(t=="request"){
+m=["<pre>",m,"</pre>"].join("");
+var d=document.getElementById(s._msgCellId);
+if(d){
+d.className="DwtMsgDialog-wide"
+}}
+r[n++]=["<tr><td valign='top'>",h[o],":</td><td valign='top'>",m,"</td></tr>"].join("")
+}}
+r[n++]="</table>";
+a=r.join("")
+}}
+s.registerCallback(DwtDialog.OK_BUTTON,this._errorDialogCallback,this);
+s.setMessage(e,a,DwtMessageDialog.CRITICAL_STYLE,ZmMsg.zimbraTitle);
+s.popup(null,l)
+};
+ZmController.prototype.setCurrentView=function(e){
+this._currentView=e
+};
+ZmController.prototype.getCurrentView=function(){
+return this._currentView
+};
+ZmController.prototype.getKeyMapName=function(){
+return"Global"
+};
+ZmController.prototype.handleKeyAction=function(l){
+var a=this.getTabView?this.getTabView():null;
+if(a&&a.handleKeyAction(l)){
+return true
+}
+var e=ZmApp.ACTION_CODES_R[l];
+if(e){
+var n=ZmApp.ACTION_CODES[l];
+if(n){
+appCtxt.getApp(e).handleOp(n);
+return true
+}}
+switch(l){
+case ZmKeyMap.NEW:e=appCtxt.getCurrentAppName();
+var r=ZmApp.NEW_ACTION_CODE[e];
+if(r){
+var n=ZmApp.ACTION_CODES[r];
+if(n){
+appCtxt.getApp(e).handleOp(n);
+return true
+}}
+break;
+case ZmKeyMap.NEW_FOLDER:case ZmKeyMap.NEW_TAG:var n=ZmApp.ACTION_CODES[l];
+if(n){
+this._newListener(null,n)
+}
+break;
+case ZmKeyMap.SAVED_SEARCH:var s=appCtxt.getFolderTree().getByType(ZmOrganizer.SEARCH);
+if(s&&s.length>0){
+var h=appCtxt.getChooseFolderDialog();
+var o={
+treeIds:[ZmOrganizer.SEARCH],overviewId:h.getOverviewId(ZmOrganizer.SEARCH),title:ZmMsg.selectSearch};
+ZmController.showDialog(h,new AjxCallback(null,ZmController._searchSelectionCallback,[h]),o)
+}
+break;
+case ZmKeyMap.VISIT:var h=appCtxt.getChooseFolderDialog();
+var t=ZmApp.ORGANIZER[this._app._name]||ZmOrganizer.FOLDER;
+var o={
+treeIds:[t],overviewId:h.getOverviewId(ZmOrganizer.APP[t]),appName:this._app._name,title:AjxMessageFormat.format(ZmMsg.goToFolder,ZmMsg[ZmOrganizer.MSG_KEY[t]])};
+ZmController.showDialog(h,new AjxCallback(null,ZmController._visitOrgCallback,[h,t]),o);
+break;
+case ZmKeyMap.VISIT_TAG:if(appCtxt.getTagTree().size()>0){
+var h=appCtxt.getPickTagDialog();
+ZmController.showDialog(h,new AjxCallback(null,ZmController._visitOrgCallback,[h,ZmOrganizer.TAG]))
+}
+break;
+default:return false
+}
+return true
+};
+ZmController._searchSelectionCallback=function(t,e){
+if(e){
+appCtxt.getSearchController().redoSearch(e.search)
+}
+t.popdown()
+};
+ZmController._visitOrgCallback=function(t,a,o){
+if(o){
+var e=appCtxt.getOverviewController().getTreeController(a);
+if(e&&e._itemClicked){
+e._itemClicked(o)
+}}
+t.popdown()
+};
+ZmController.prototype.mapSupported=function(e){
+return false
+};
+ZmController.prototype._newListener=function(e,t){
+switch(t){
+case ZmOperation.NEW_FOLDER:ZmController.showDialog(appCtxt.getNewFolderDialog(),this.getNewFolderCallback());
+break;
+case ZmOperation.NEW_TAG:if(!this._newTagCb){
+this._newTagCb=new AjxCallback(this,this._newTagCallback)
+}
+ZmController.showDialog(appCtxt.getNewTagDialog(),this._newTagCb);
+break
+}};
+ZmController.prototype._newFolderCallback=function(s,o,t,a){
+var n=appCtxt.getNewFolderDialog();
+n.popdown();
+var e=appCtxt.getOverviewController();
+e.getTreeController(ZmOrganizer.FOLDER)._doCreate(s,o,t,a)
+};
+ZmController.prototype._newTagCallback=function(t){
+appCtxt.getNewTagDialog().popdown();
+var e=appCtxt.getOverviewController();
+e.getTreeController(ZmOrganizer.TAG)._doCreate(t)
+};
+ZmController.prototype._createTabGroup=function(e){
+e=e?e:this.toString();
+this._tabGroup=new DwtTabGroup(e);
+return this._tabGroup
+};
+ZmController.prototype._setTabGroup=function(e){
+this._tabGroup=e
+};
+ZmController.prototype.getTabGroup=function(){
+return this._tabGroup
+};
+ZmController.prototype.getNewFolderCallback=function(){
+if(!this._newFolderCb){
+this._newFolderCb=new AjxCallback(this,this._newFolderCallback)
+}
+return this._newFolderCb
+};
+ZmController.prototype._saveFocus=function(){
+var t=appCtxt.getRootTabGroup().getFocusMember();
+var e=this.getTabGroup();
+this._savedFocusMember=(t&&e&&e.contains(t))?t:null;
+return this._savedFocusMember
+};
+ZmController.prototype._restoreFocus=function(n,r){
+var a=appCtxt.getRootTabGroup();
+var t=appCtxt.getCurrentApp();
+var s=t&&t.getOverviewId();
+var o=s&&appCtxt.getOverviewController().getOverview(s);
+if(a&&o&&(o!=ZmController._currentOverview)){
+a.replaceMember(ZmController._currentOverview,o,false,false,null,true);
+ZmController._currentOverview=o
+}
+var e=this.getTabGroup();
+n=n||this._savedFocusMember||this._getDefaultFocusItem()||a.getFocusMember();
+r=r||ZmController.noFocus;
+ZmController.noFocus=false;
+if(a&&e&&(e!=ZmController._currentAppViewTabGroup)){
+a.replaceMember(ZmController._currentAppViewTabGroup,e,false,false,n,r);
+ZmController._currentAppViewTabGroup=e
+}else{
+if(n&&!r){
+appCtxt.getKeyboardMgr().grabFocus(n)
+}}};
+ZmController.prototype._getDefaultFocusItem=function(){
+var e=this.getTabGroup();
+return e?e.getFirstMember(true):null
+};
+ZmController.prototype._preHideCallback=function(){
+this._saveFocus();
+return true
+};
+ZmController.prototype._postShowCallback=function(){
+this._restoreFocus();
+return true
+};
+ZmController.prototype._handleError=function(t,e){
+this._handleException(t,e)
+};
+ZmController.prototype._handleException=function(r,o){
+if(r.code==AjxSoapException.INVALID_PDU){
+r.code=ZmCsfeException.SVC_FAILURE;
+r.detail=["contact your administrator (",r.msg,")"].join("");
+r.msg="Service failure"
+}
+if(r.code==ZmCsfeException.SVC_AUTH_EXPIRED||r.code==ZmCsfeException.SVC_AUTH_REQUIRED||r.code==ZmCsfeException.NO_AUTH_TOKEN){
+ZmCsfeCommand.clearAuthToken();
+var c=false;
+var n=appCtxt.getLoginDialog();
+if(r.code==ZmCsfeException.SVC_AUTH_EXPIRED){
+n.setError(ZmMsg.sessionExpired);
+c=true
+}else{
+if(r.code==ZmCsfeException.SVC_AUTH_REQUIRED){
+ZmZimbraMail.logOff();
+return
+}else{
+n.setError(null)
+}}
+n.setReloginMode(c);
+this._handleLogin(c,o);
+return
+}
+if(r.code==ZmCsfeException.AUTH_TOKEN_CHANGED){
+var l=AjxSoapDoc.create("GetInfoRequest","urn:zimbraAccount");
+var e=l.getMethod();
+e.setAttribute("sections","mbox");
+var d=new AjxCallback(this,this._handleResponseGetInfo);
+var a={
+soapDoc:l,asyncMode:true,callback:d,skipAuthCheck:true};
+ZmCsfeCommand._oldSessionId=ZmCsfeCommand._sessionId;
+appCtxt.getAppController().sendRequest(a);
+return
+}
+if(r.code==ZmCsfeException.MAIL_NO_SUCH_MSG){
+var h=appCtxt.getCurrentViewId();
+if(h==ZmId.VIEW_CONVLIST||h==ZmId.VIEW_TRAD){
+appCtxt.getApp(ZmApp.MAIL).mailSearch();
+return
+}}
+if(r.method!="NoOpRequest"){
+var s;
+if(r.code==ZmCsfeException.MAIL_NO_SUCH_ITEM){
+s=r.data.itemId
+}else{
+if(r.code==ZmCsfeException.MAIL_SEND_FAILURE){
+s=r.code
+}}
+var t=r.getErrorMsg?r.getErrorMsg(s):r.msg?r.msg:r.message;
+this.popupErrorDialog(t,r,true,this._hideSendReportBtn(r))
+}};
+ZmController.prototype._handleLogin=function(t,e){
+var a=appCtxt.get(ZmSetting.LOGIN_URL);
+if(a){
+ZmZimbraMail.sendRedirect(a);
+return
+}
+var s=appCtxt.getUsername();
+if(!s||appCtxt.isOffline){
+ZmZimbraMail.logOff();
+return
+}
+this._authenticating=true;
+var n=appCtxt.getLoginDialog();
+n.registerCallback(this._loginCallback,this,[e]);
+n.setVisible(true,false);
+try{
+n.setFocus(s,t)
+}
+catch(o){}};
+ZmController.prototype._loginCallback=function(e,o,t,a){
+this._doAuth(e,o,t,a)
+};
+ZmController.prototype._doAuth=function(e,s,t,n){
+var a=new ZmAuthenticate();
+var o=new AjxCallback(this,this._handleResponseDoAuth,[e,n]);
+a.execute(s,t,o)
+};
+ZmController.prototype._handleResponseDoAuth=function(t,n,e){
+try{
+e.getResponse();
+this._authenticating=false;
+appCtxt.rememberMe=n;
+if(t){
+if(t.continueCallback){
+t.continueCallback.run()
+}else{
+t.resend=ZmCsfeCommand.REAUTH;
+appCtxt.getRequestMgr().sendRequest(t)
+}}else{
+ZmCsfeCommand.setSessionId(null);
+appCtxt.getAppController().startup({
+isRelogin:true}
+)
+}
+this._hideLoginDialog()
+}
+catch(o){
+var a=appCtxt.getLoginDialog();
+if(o.code==ZmCsfeException.ACCT_AUTH_FAILED||o.code==ZmCsfeException.SVC_INVALID_REQUEST){
+a.setError(ZmMsg.loginError)
+}else{
+if(o.code==ZmCsfeException.ACCT_MAINTENANCE_MODE){
+a.setError(ZmMsg.errorMaintenanceMode+" "+ZmMsg.errorContact)
+}else{
+this.popupErrorDialog(ZmMsg.errorGeneric,o)
+}}}};
+ZmController.prototype._hideLoginDialog=function(){
+var e=appCtxt.getLoginDialog();
+e.setVisible(false);
+e.setError(null);
+e.clearPassword()
+};
+ZmController.prototype._handleResponseGetInfo=function(e){
+var a=e.getResponse();
+var n=a.GetInfoResponse;
+if(appCtxt.isOffline){
+if(location.search.indexOf("offlineHack")!=-1){
+var s="old user: "+appCtxt.getUsername()+"\nold auth token: "+ZmCsfeCommand._curAuthToken+"\nold session ID: "+ZmCsfeCommand._oldSessionId+"\n\nnew user: "+n.name+"\nnew auth token: "+ZmCsfeCommand.getAuthToken()+"\nnew session ID: "+ZmCsfeCommand._sessionId+"\n";
+alert(s)
+}}else{
+if(n.name!=appCtxt.getUsername()){
+var o=appCtxt.getLoginDialog();
+o.registerCallback(this._loginCallback,this);
+o.setError(ZmMsg.authChanged);
+var t=false;
+o.setReloginMode(t);
+this._handleLogin(t)
+}else{}}};
+ZmController.prototype._hideSendReportBtn=function(e){
+return(e.code==ZmCsfeException.MAIL_TOO_MANY_TERMS||e.code==ZmCsfeException.MAIL_MAINTENANCE_MODE||e.code==ZmCsfeException.MAIL_MESSAGE_TOO_BIG||e.code==ZmCsfeException.NETWORK_ERROR||e.code==ZmCsfeException.EMPTY_RESPONSE||e.code==ZmCsfeException.BAD_JSON_RESPONSE||e.code==ZmCsfeException.TOO_MANY_TAGS||e.code==ZmCsfeException.OFFLINE_ONLINE_ONLY_OP)
+};
+ZmController.prototype._errorDialogCallback=function(){
+appCtxt.getErrorDialog().popdown()
+};
+ZmController.showDialog=function(e,o,a,t){
+e.reset(t);
+e.registerCallback(DwtDialog.OK_BUTTON,o);
+e.popup(a,t)
+};
+ZmController.prototype._clearDialog=function(e){
+e.popdown();
+this._pendingActionData=null
+};
+ZmController.prototype._menuPopdownActionListener=function(){};
+ZmController.prototype.setSessionId=function(e,t){
+this.sessionId=t;
+this.viewId=[e,this.sessionId].join("")
+};
+ZmController.prototype.isTransient=function(e,t){
+return false
+}
+}
+if(AjxPackage.define("zimbraMail.share.controller.ZmListController")){
+ZmListController=function(e,t){
+if(arguments.length==0){
+return
+}
+ZmController.call(this,e,t);
+this._toolbar={};
+this._navToolBar={};
+this._listView={};
+this._tabGroups={};
+this._list=null;
+this._actionMenu=null;
+this._actionEv=null;
+this._activeSearch=null;
+this._tagList=appCtxt.getTagTree();
+if(this._tagList){
+this._tagChangeLstnr=new AjxListener(this,this._tagChangeListener);
+this._tagList.addChangeListener(this._tagChangeLstnr)
+}
+this._listeners={};
+this._listeners[ZmOperation.NEW_MENU]=new AjxListener(this,this._newListener);
+this._listeners[ZmOperation.TAG_MENU]=new AjxListener(this,this._tagButtonListener);
+this._listeners[ZmOperation.TAG]=new AjxListener(this,this._tagListener);
+this._listeners[ZmOperation.PRINT]=new AjxListener(this,this._printListener);
+this._listeners[ZmOperation.DELETE]=new AjxListener(this,this._deleteListener);
+this._listeners[ZmOperation.CLOSE]=new AjxListener(this,this._backListener);
+this._listeners[ZmOperation.MOVE]=new AjxListener(this,this._moveListener);
+this._listeners[ZmOperation.SEARCH]=new AjxListener(this,this._participantSearchListener);
+this._listeners[ZmOperation.BROWSE]=new AjxListener(this,this._participantBrowseListener);
+this._listeners[ZmOperation.NEW_MESSAGE]=new AjxListener(this,this._participantComposeListener);
+if(window.ZmImApp){
+this._listeners[ZmOperation.IM]=ZmImApp.getImMenuItemListener()
+}
+this._listeners[ZmOperation.CONTACT]=new AjxListener(this,this._participantContactListener);
+this._listeners[ZmOperation.VIEW]=new AjxListener(this,this._viewMenuItemListener);
+this._menuPopdownListener=new AjxListener(this,this._menuPopdownActionListener);
+this._dropTgt=new DwtDropTarget("ZmTag");
+this._dropTgt.markAsMultiple();
+this._dropTgt.addDropListener(new AjxListener(this,this._dropListener));
+this._itemCountText={};
+this._continuation={
+count:0,totalItems:0}
+};
+ZmListController.prototype=new ZmController;
+ZmListController.prototype.constructor=ZmListController;
+ZmListController.CONTINUATION_SEARCH_ITEMS=500;
+ZmListController.prototype.toString=function(){
+return"ZmListController"
+};
+ZmListController.prototype.show=function(t,e){
+this._currentView=e||this._defaultView();
+this._activeSearch=t;
+if(t){
+this._currentSearch=t.search
+}
+this.currentPage=1;
+this.maxPage=1
+};
+ZmListController.prototype.getSearchString=function(){
+return this._currentSearch?this._currentSearch.query:""
+};
+ZmListController.prototype.getSearchStringHint=function(){
+return this._currentSearch?this._currentSearch.queryHint:""
+};
+ZmListController.prototype.getCurrentView=function(){
+return this._listView[this._currentView]
+};
+ZmListController.prototype.getCurrentToolbar=function(){
+return this._toolbar[this._currentView]
+};
+ZmListController.prototype.getList=function(){
+return this._list
+};
+ZmListController.prototype.setList=function(e){
+if(e!=this._list&&(e instanceof ZmList)){
+if(this._list){
+this._list.clear()
+}
+this._list=e
+}};
+ZmListController.prototype.setHasMore=function(e){
+if(e){
+this._list.setHasMore(e);
+this._resetNavToolBarButtons(this._currentView)
+}};
+ZmListController.prototype.handleKeyAction=function(s){
+var a=this._listView[this._currentView];
+switch(s){
+case DwtKeyMap.DBLCLICK:return a.handleKeyAction(s);
+case ZmKeyMap.DEL:var t=this._toolbar[this._currentView];
+var n=t&&(t.getButton(ZmOperation.DELETE)||t.getButton(ZmOperation.DELETE_MENU));
+if(n&&n.getEnabled()){
+this._doDelete(this._listView[this._currentView].getSelection())
+}
+break;
+case ZmKeyMap.FLAG:this._doFlag(a.getSelection());
+break;
+case ZmKeyMap.MOVE:this._moveListener.call(this);
+break;
+case ZmKeyMap.NEXT_PAGE:var e=this._navToolBar[this._currentView];
+var n=e?e.getButton(ZmOperation.PAGE_FORWARD):null;
+if(n&&n.getEnabled()){
+this._paginate(this._currentView,true)
+}
+break;
+case ZmKeyMap.PREV_PAGE:var e=this._navToolBar[this._currentView];
+var n=e?e.getButton(ZmOperation.PAGE_BACK):null;
+if(n&&n.getEnabled()){
+this._paginate(this._currentView,false)
+}
+break;
+case ZmKeyMap.PRINT:if(appCtxt.get(ZmSetting.PRINT_ENABLED)){
+this._printListener()
+}
+break;
+case ZmKeyMap.TAG:var o=a.getSelection();
+if(o&&o.length&&(appCtxt.getTagTree().size()>0)){
+var r=appCtxt.getPickTagDialog();
+ZmController.showDialog(r,new AjxCallback(this,this._tagSelectionCallback,[o,r]))
+}
+break;
+case ZmKeyMap.UNTAG:if(appCtxt.get(ZmSetting.TAGGING_ENABLED)){
+var o=a.getSelection();
+if(o&&o.length){
+this._doRemoveAllTags(o)
+}}
+break;
+default:return ZmController.prototype.handleKeyAction.call(this,s)
+}
+return true
+};
+ZmListController.prototype._createNewView=function(){};
+ZmListController.prototype._getViewType=function(){};
+ZmListController.prototype._defaultView=function(){
+return this._getViewType()
+};
+ZmListController.prototype._setViewContents=function(e){};
+ZmListController.prototype._getTagMenuMsg=function(e){};
+ZmListController.prototype._getMoveDialogTitle=function(e){};
+ZmListController.prototype._getToolBarOps=function(){};
+ZmListController.prototype._getActionMenuOps=function(){};
+ZmListController.prototype._setup=function(e){
+this._initialize(e);
+this._resetOperations(this._toolbar[e],0)
+};
+ZmListController.prototype._initialize=function(e){
+this._initializeToolBar(e);
+this._initializeListView(e);
+this._initializeTabGroup(e)
+};
+ZmListController.prototype._standardToolBarOps=function(){
+return[ZmOperation.NEW_MENU,ZmOperation.SEP,ZmOperation.DELETE,ZmOperation.MOVE,ZmOperation.PRINT]
+};
+ZmListController.prototype._standardActionMenuOps=function(){
+return[ZmOperation.TAG_MENU,ZmOperation.DELETE,ZmOperation.MOVE,ZmOperation.PRINT]
+};
+ZmListController.prototype._participantOps=function(){
+var e=[ZmOperation.SEARCH,ZmOperation.BROWSE];
+if(ZmSetting.MAIL_ENABLED){
+e.push(ZmOperation.NEW_MESSAGE)
+}
+if(ZmSetting.IM_ENABLED){
+e.push(ZmOperation.IM)
+}
+if(ZmSetting.CONTACTS_ENABLED){
+e.push(ZmOperation.CONTACT)
+}
+return e
+};
+ZmListController.prototype._initializeToolBar=function(t){
+if(this._toolbar[t]){
+return
+}
+var n=this._getToolBarOps();
+if(!n){
+return
+}
+var e=this._toolbar[t]=new ZmButtonToolBar({
+parent:this._container,buttons:n,context:t,controller:this,refElementId:ZmId.SKIN_APP_TOP_TOOLBAR}
+);
+var o;
+for(var a=0;
+a<e.opList.length;
+a++){
+o=e.opList[a];
+if(this._listeners[o]){
+e.addSelectionListener(o,this._listeners[o])
+}}
+o=e.getButton(ZmOperation.PRINT);
+if(o){
+o.setText(null)
+}
+o=e.getButton(ZmOperation.MOVE);
+if(o){
+o.setText(null)
+}
+o=e.getButton(ZmOperation.NEW_MENU);
+if(o){
+var s=new AjxListener(e,ZmListController._newDropDownListener);
+o.addDropDownSelectionListener(s);
+e._ZmListController_this=this;
+e._ZmListController_newDropDownListener=s
+}
+o=e.getButton(ZmOperation.TAG_MENU);
+if(o){
+o.noMenuBar=true;
+this._setupTagMenu(e)
+}
+appCtxt.notifyZimlets("initializeToolbar",[this._app,e,this,t],{
+waitUntilLoaded:true}
+)
+};
+ZmListController.prototype._initializeListView=function(e){
+if(this._listView[e]){
+return
+}
+this._listView[e]=this._createNewView(e);
+this._listView[e].addSelectionListener(new AjxListener(this,this._listSelectionListener));
+this._listView[e].addActionListener(new AjxListener(this,this._listActionListener))
+};
+ZmListController.prototype._initializeActionMenu=function(){
+if(this._actionMenu){
+return
+}
+var e=this._getActionMenuOps();
+if(!e){
+return
+}
+this._actionMenu=new ZmActionMenu({
+parent:this._shell,menuItems:e,context:this._getMenuContext(),controller:this}
+);
+this._addMenuListeners(this._actionMenu);
+if(appCtxt.get(ZmSetting.TAGGING_ENABLED)){
+this._setupTagMenu(this._actionMenu)
+}};
+ZmListController.prototype._addMenuListeners=function(o){
+var t=o.opList;
+for(var e=0;
+e<t.length;
+e++){
+var a=t[e];
+if(this._listeners[a]){
+o.addSelectionListener(a,this._listeners[a],0)
+}}
+o.addPopdownListener(this._menuPopdownListener)
+};
+ZmListController.prototype._initializeTabGroup=function(e){
+if(this._tabGroups[e]){
+return
+}
+this._tabGroups[e]=this._createTabGroup();
+this._tabGroups[e].newParent(appCtxt.getRootTabGroup());
+this._toolbar[e].noFocus=true;
+this._tabGroups[e].addMember(this._listView[e])
+};
+ZmListController.prototype._setView=function(a){
+var e=a.view;
+if(!this._appViews[e]){
+var t={};
+t[ZmAppViewMgr.CB_PRE_HIDE]=this._preHideCallback?new AjxCallback(this,this._preHideCallback):null;
+t[ZmAppViewMgr.CB_PRE_UNLOAD]=this._preUnloadCallback?new AjxCallback(this,this._preUnloadCallback):null;
+t[ZmAppViewMgr.CB_POST_HIDE]=this._postHideCallback?new AjxCallback(this,this._postHideCallback):null;
+t[ZmAppViewMgr.CB_PRE_SHOW]=this._preShowCallback?new AjxCallback(this,this._preShowCallback):null;
+t[ZmAppViewMgr.CB_POST_SHOW]=this._postShowCallback?new AjxCallback(this,this._postShowCallback):null;
+a.callbacks=t;
+a.viewId=e;
+this._app.createView(a);
+this._appViews[e]=1
+}
+if(!a.pushOnly){
+this._setViewContents(e)
+}
+if(a.stageView){
+this._app.stageView(e)
+}else{
+return(a.clear?this._app.setView(e):this._app.pushView(e))
+}};
+ZmListController.prototype._listSelectionListener=function(e){
+if(e.field==ZmItem.F_FLAG){
+this._doFlag([e.item])
+}else{
+var t=this._listView[this._currentView];
+if(appCtxt.get(ZmSetting.SHOW_SELECTION_CHECKBOX)){
+if(!e.ctrlKey){
+t.setSelectionHdrCbox(false)
+}}
+this._resetOperations(this._toolbar[this._currentView],t.getSelectionCount())
+}};
+ZmListController.prototype._listActionListener=function(e){
+this._actionEv=e;
+var t=this.getActionMenu();
+if(appCtxt.get(ZmSetting.TAGGING_ENABLED)){
+this._setTagMenu(t)
+}
+this._resetOperations(t,this._listView[this._currentView].getSelectionCount())
+};
+ZmListController.prototype._menuPopdownActionListener=function(){
+if(!this._pendingActionData){
+this._listView[this._currentView].handleActionPopdown()
+}};
+ZmListController.prototype._newListener=function(e,o,a){
+if(!e&&!o){
+return
+}
+o=o||e.item.getData(ZmOperation.KEY_ID);
+if(!o||o==ZmOperation.NEW_MENU){
+o=this._defaultNewId
+}
+var t=ZmApp.OPS_R[o];
+if(t){
+a=a||{};
+a.ev=e;
+appCtxt.getApp(t).handleOp(o,a)
+}else{
+ZmController.prototype._newListener.call(this,e,o)
+}};
+ZmListController.prototype._tagButtonListener=function(t){
+var e=this._toolbar[this._currentView];
+if(t.item.parent==e){
+this._setTagMenu(e)
+}};
+ZmListController.prototype._tagListener=function(t){
+if(appCtxt.getAppViewMgr().getCurrentViewId()==this._getViewType()){
+var n=t.getData(ZmTagMenu.KEY_TAG_EVENT);
+var o=t.getData(ZmTagMenu.KEY_TAG_ADDED);
+var e=this._listView[this._currentView].getSelection();
+if(n==ZmEvent.E_TAGS&&o){
+this._doTag(e,t.getData(Dwt.KEY_OBJECT),true)
+}else{
+if(n==ZmEvent.E_CREATE){
+this._pendingActionData=e;
+var a=appCtxt.getNewTagDialog();
+if(!this._newTagCb){
+this._newTagCb=new AjxCallback(this,this._newTagCallback)
+}
+ZmController.showDialog(a,this._newTagCb);
+a.registerCallback(DwtDialog.CANCEL_BUTTON,this._clearDialog,this,a)
+}else{
+if(n==ZmEvent.E_TAGS&&!o){
+this._doTag(e,t.getData(Dwt.KEY_OBJECT),false)
+}else{
+if(n==ZmEvent.E_REMOVE_ALL){
+this._doRemoveAllTags(e)
+}}}}}};
+ZmListController.prototype._tagSelectionCallback=function(t,a,e){
+if(e){
+this._doTag(t,e,true)
+}
+a.popdown()
+};
+ZmListController.prototype._printListener=function(o){
+var e=this._listView[this._currentView];
+var t=e.getSelection();
+var a=(t instanceof Array)?t[0]:t;
+window.open(a.getRestUrl(),"_blank")
+};
+ZmListController.prototype._backListener=function(e){
+this._app.popView()
+};
+ZmListController.prototype._deleteListener=function(e){
+this._doDelete(this._listView[this._currentView].getSelection())
+};
+ZmListController.prototype._moveListener=function(e,a){
+this._pendingActionData=a||(this._listView[this._currentView].getSelection());
+var t=appCtxt.getChooseFolderDialog();
+if(!this._moveCb){
+this._moveCb=new AjxCallback(this,this._moveCallback)
+}
+ZmController.showDialog(t,this._moveCb,this._getMoveParams(t));
+t.registerCallback(DwtDialog.CANCEL_BUTTON,this._clearDialog,this,t)
+};
+ZmListController.prototype._getMoveParams=function(e){
+var t=ZmApp.ORGANIZER[this._app._name]||ZmOrganizer.FOLDER;
+return{
+overviewId:e.getOverviewId(this._app._name),data:this._pendingActionData,treeIds:[t],title:this._getMoveDialogTitle(this._pendingActionData.length),description:ZmMsg.targetFolder,treeStyle:DwtTree.SINGLE_STYLE,appName:this._app._name}
+};
+ZmListController.prototype._viewMenuItemListener=function(e){
+if(e.detail==DwtMenuItem.CHECKED||e.detail==DwtMenuItem.UNCHECKED){
+this.switchView(e.item.getData(ZmOperation.MENUITEM_ID))
+}};
+ZmListController.prototype._navBarListener=function(e){
+if(appCtxt.getAppViewMgr().getCurrentViewId()!=this._getViewType()){
+return
+}
+var t=e.item.getData(ZmOperation.KEY_ID);
+if(t==ZmOperation.PAGE_BACK||t==ZmOperation.PAGE_FORWARD){
+this._paginate(this._currentView,(t==ZmOperation.PAGE_FORWARD))
+}};
+ZmListController.prototype._participantSearchListener=function(t){
+var e=this._actionEv.address.getAddress();
+appCtxt.getSearchController().fromSearch(e)
+};
+ZmListController.prototype._participantBrowseListener=function(t){
+var e=this._actionEv.address.getAddress();
+appCtxt.getSearchController().fromBrowse(e)
+};
+ZmListController.prototype._participantComposeListener=function(t){
+var e=this._actionEv.address.toString(AjxEmailAddress.SEPARATOR)+AjxEmailAddress.SEPARATOR;
+AjxDispatcher.run("Compose",{
+action:ZmOperation.NEW_MESSAGE,inNewWindow:this._app._inNewWindow(t),toOverride:e}
+)
+};
+ZmListController.prototype._participantContactListener=function(t){
+var e=new AjxCallback(this,this._handleLoadParticipantContactListener);
+AjxDispatcher.require(["ContactsCore","Contacts"],false,e,null,true)
+};
+ZmListController.prototype._handleLoadParticipantContactListener=function(){
+var a=AjxDispatcher.run("GetContactController");
+if(this._actionEv.contact){
+if(this._actionEv.contact.isLoaded){
+a.show(this._actionEv.contact)
+}else{
+var t=new AjxCallback(this,this._loadContactCallback);
+this._actionEv.contact.load(t)
+}}else{
+var e=this._createNewContact(this._actionEv);
+a.show(e,true)
+}};
+ZmListController.prototype._createNewContact=function(t){
+var e=new ZmContact(null);
+e.initFromEmail(t.address);
+return e
+};
+ZmListController.prototype._loadContactCallback=function(t,e){
+AjxDispatcher.run("GetContactController").show(e)
+};
+ZmListController.prototype._dragListener=function(e){
+if(e.action==DwtDragEvent.SET_DATA){
+e.srcData={
+data:e.srcControl.getDnDSelection(),controller:this}
+}};
+ZmListController.prototype._dropListener=function(n){
+var e=this._listView[this._currentView];
+var h=e.getTargetItemDiv(n.uiEvent);
+var o=e.getItemFromElement(h);
+var r=n.srcData.data;
+if(n.action==DwtDropEvent.DRAG_ENTER){
+n.doIt=(o&&(o instanceof ZmItem)&&!o.isShared()&&this._dropTgt.isValidTarget(r));
+e.dragSelect(h)
+}else{
+if(n.action==DwtDropEvent.DRAG_DROP){
+e.dragDeselect(h);
+var t=[o];
+var s=e.getSelection();
+if(s.length){
+var a=AjxVector.fromArray(s);
+if(a.contains(o)){
+t=s
+}}
+this._doTag(t,r,true)
+}else{
+if(n.action==DwtDropEvent.DRAG_LEAVE){
+e.dragDeselect(h)
+}else{
+if(n.action==DwtDropEvent.DRAG_OP_CHANGED){}}}}};
+ZmListController.prototype._tagChangeListener=function(t){
+if(appCtxt.getAppViewMgr().getCurrentViewId()==this._getViewType()){
+if(t.type==ZmEvent.S_TAG&&t.event==ZmEvent.E_CREATE&&this._pendingActionData){
+var e=t.getDetail("organizers")[0];
+this._doTag(this._pendingActionData,e,true);
+this._pendingActionData=null;
+this._menuPopdownActionListener()
+}}};
+ZmListController.prototype._moveCallback=function(e){
+this._doMove(this._pendingActionData,e);
+this._clearDialog(appCtxt.getChooseFolderDialog());
+this._pendingActionData=null
+};
+ZmListController.prototype._doFlag=function(a,t){
+a=AjxUtil.toArray(a);
+if(!a.length){
+return
+}
+if(t!==true&&t!==false){
+t=!a[0].isFlagged
+}
+var e=[];
+for(var o=0;
+o<a.length;
+o++){
+if(a[o].isFlagged!=t){
+e.push(a[o])
+}}
+var s={
+items:e,op:"flag",value:t};
+var n=this._setupContinuation(this._doFlag,[t],s);
+n.flagItems(s)
+};
+ZmListController.prototype._doTag=function(t,e,n){
+t=AjxUtil.toArray(t);
+if(!t.length){
+return
+}
+var o={
+items:t,tagId:e.id,doTag:n};
+var a=this._setupContinuation(this._doTag,[e,n],o);
+a.tagItems(o)
+};
+ZmListController.prototype._doRemoveAllTags=function(e){
+e=AjxUtil.toArray(e);
+if(!e.length){
+return
+}
+var a={
+items:e};
+var t=this._setupContinuation(this._doRemoveAllTags,null,a);
+t.removeAllTags(a)
+};
+ZmListController.prototype._doDelete=function(t,e,a){
+t=AjxUtil.toArray(t);
+if(!t.length){
+return
+}
+var s={
+items:t,hardDelete:e,attrs:a,childWin:appCtxt.isChildWindow&&window};
+var n=new AjxCallback(this,this._checkItemCount);
+var o=this._setupContinuation(this._doDelete,[e,a],s,n);
+o.deleteItems(s)
+};
+ZmListController.prototype._doMove=function(h,t,l,s){
+h=AjxUtil.toArray(h);
+if(!h.length){
+return
+}
+var a=[];
+var e=[];
+for(var n=0;
+n<h.length;
+n++){
+var c=h[n];
+if(!c.folderId||c.folderId!=t.id){
+if(!this._isItemMovable(c,s,t)){
+e.push(c)
+}else{
+a.push(c)
+}}}
+var o={
+folder:t,attrs:l};
+var d=new AjxCallback(this,this._checkItemCount);
+if(a.length){
+o.items=a;
+var r=this._setupContinuation(this._doMove,[t,l,s],o,d);
+r.moveItems(o)
+}
+if(e.length){
+o.items=e;
+var r=this._setupContinuation(this._doMove,[t,l,s],o,d);
+r.copyItems(o)
+}};
+ZmListController.prototype._isItemMovable=function(a,e,t){
+return(!e&&!a.isReadOnly()&&!t.isReadOnly())
+};
+ZmListController.prototype._doModify=function(t,e){
+var a=t.list||this._list;
+a.modifyItem(t,e)
+};
+ZmListController.prototype._doCreate=function(t,e){
+t.create(e)
+};
+ZmListController.prototype._propagateMenuListeners=function(n,h,s){
+if(!n){
+return
+}
+s=s||this._listeners[h];
+var o=n.getOp(h);
+if(o){
+var r=o.getMenu();
+var e=r.getItems();
+var a=r.getItemCount();
+for(var t=0;
+t<a;
+t++){
+e[t].addSelectionListener(s)
+}}};
+ZmListController.prototype._setupTagMenu=function(t){
+if(!t){
+return
+}
+var a=t.getTagMenu();
+if(a){
+a.addSelectionListener(this._listeners[ZmOperation.TAG])
+}
+if(t instanceof ZmButtonToolBar){
+var e=t.getOp(ZmOperation.TAG_MENU);
+if(e){
+e.addDropDownSelectionListener(this._listeners[ZmOperation.TAG_MENU])
+}}};
+ZmListController.prototype._setTagMenu=function(o){
+if(!o){
+return
+}
+var a=o.getOp(ZmOperation.TAG_MENU);
+if(a){
+var n=o.getTagMenu();
+var t=this._listView[this._currentView].getSelection();
+t=AjxUtil.toArray(t);
+n.set(t,appCtxt.getTagTree());
+if(o instanceof ZmActionMenu){
+a.setText(this._getTagMenuMsg(t.length))
+}else{
+n.parent.popup();
+if(appCtxt.isChildWindow){
+var e=n.getMenuItem(ZmTagMenu.MENU_ITEM_ADD_ID);
+if(e){
+e.setVisible(false)
+}}}}};
+ZmListController.prototype._setNewButtonProps=function(e,a,s,n,t){
+var o=this._toolbar[e].getButton(ZmOperation.NEW_MENU);
+if(o){
+o.setToolTipContent(a);
+o.setImage(s);
+this._defaultNewId=t
+}};
+ZmListController.prototype._setContactText=function(t){
+var e=t?ZmOperation.EDIT_CONTACT:ZmOperation.NEW_CONTACT;
+var a=t?null:ZmMsg.AB_ADD_CONTACT;
+ZmOperation.setOperation(this._toolbar[this._currentView],ZmOperation.CONTACT,e,ZmMsg.AB_ADD_CONTACT);
+ZmOperation.setOperation(this.getActionMenu(),ZmOperation.CONTACT,e,a)
+};
+ZmListController.prototype._resetOperations=function(a,t){
+if(!a){
+return
+}
+if(t==0){
+a.enableAll(false);
+a.enable(ZmOperation.NEW_MENU,true)
+}else{
+if(t==1){
+a.enableAll(true)
+}else{
+if(t>1){
+a.enableAll(false);
+a.enable([ZmOperation.NEW_MENU,ZmOperation.TAG_MENU,ZmOperation.DELETE,ZmOperation.MOVE,ZmOperation.FORWARD],true)
+}}}
+var e=(t>0)&&this._getSearchFolderId();
+var o=e&&appCtxt.getById(e);
+if(o&&o.isRemote()){
+a.enable(ZmOperation.TAG_MENU,false)
+}};
+ZmListController.prototype._resetToolbarOperations=function(){
+this._resetOperations(this._toolbar[this._currentView],this._listView[this._currentView].getSelectionCount())
+};
+ZmListController.prototype._getSearchFolderId=function(){
+return(this._activeSearch&&this._activeSearch.search)?this._activeSearch.search.folderId:null
+};
+ZmListController.prototype._cacheList=function(e,a){
+if(this._list){
+var t=e.getResults().getVector();
+a=a?a:parseInt(e.getAttribute("offset"));
+this._list.cache(a,t)
+}else{
+this._list=e.getResults(type)
+}};
+ZmListController.prototype._search=function(r,n,o,h,e,t,s){
+var a={
+query:this.getSearchString(),queryHint:this.getSearchStringHint(),types:((this._activeSearch&&this._activeSearch.search)?this._activeSearch.search.types:[]),sortBy:appCtxt.get(ZmSetting.SORTING_PREF,r),offset:n,limit:o,lastId:t,lastSortVal:s};
+this._getMoreSearchParams(a);
+var l=new ZmSearch(a);
+if(e){
+this._currentSearch=l
+}
+appCtxt.getSearchController().redoSearch(l,true,null,h)
+};
+ZmListController.prototype._paginate=function(c,r,s,o){
+var a=false;
+var t=this._listView[c];
+var n,d;
+if(t._isPageless){
+n=this._list.size();
+a=true
+}else{
+n=t.getNewOffset(r);
+a=(n+o>this._list.size());
+this.currentPage=this.currentPage+(r?1:-1);
+this.maxPage=Math.max(this.maxPage,this.currentPage)
+}
+o=o||t.getLimit(n);
+if(a&&this._list.hasMore()){
+t.offset=n;
+if(t._isPageless){
+d=o
+}else{
+var m=(n+o)-this._list.size();
+d=m<o&&m>0?m:o;
+if(d<o){
+n=((n+o)-d)+1
+}}
+if(this._searchPending){
+return false
+}
+var l=t.getList();
+var u=l&&l.getLast();
+var h=(u&&u.id)?u.sf:null;
+var e=h?u.id:null;
+this._setItemCountText(ZmMsg.loading);
+this._searchPending=true;
+var f=new AjxCallback(this,this._handleResponsePaginate,[c,false,s,n]);
+this._search(c,n,d,f,true,e,h);
+return false
+}else{
+if(!t._isPageless){
+t.offset=n;
+this._resetOperations(this._toolbar[c],0);
+this._resetNavToolBarButtons(c);
+this._setViewContents(c);
+this._resetSelection();
+return true
+}}};
+ZmListController.prototype._handleResponsePaginate=function(l,o,r,s,c,e){
+var h=c.getResponse();
+this._list.setHasMore(h.getAttribute("more"));
+this._cacheList(h,s);
+this._resetOperations(this._toolbar[l],0);
+var a=this._listView[this._currentView];
+var t=o?a.getSelection()[0]:null;
+var n=t?a.getItemIndex(t):-1;
+if(a._isPageless){
+a._itemsToAdd=h&&h.getResults().getArray()
+}
+this._setViewContents(l);
+this._resetNavToolBarButtons(l);
+if(!e&&!a._isPageless){
+this._resetSelection(n)
+}
+appCtxt.getAppController().focusContentPane();
+this._searchPending=false
+};
+ZmListController.prototype._getMoreSearchParams=function(e){};
+ZmListController.prototype._checkReplenish=function(n){
+var e=this._listView[this._currentView];
+var o=e.getList();
+var t=false;
+if(o){
+var a=e.getLimit()-e.size();
+if(a>e.getReplenishThreshold()){
+this._replenishList(this._currentView,a,n);
+t=true
+}}
+if(n&&!t){
+n.run()
+}};
+ZmListController.prototype._handleEmptyList=function(e){
+if(this.currentPage>1){
+this._paginate(this._currentView,false,0)
+}else{
+e.removeAll(true);
+e._setNoResultsHtml();
+this._resetNavToolBarButtons(this._currentView)
+}};
+ZmListController.prototype._replenishList=function(r,a,h){
+var t=this._listView[r].offset+this._listView[r].size();
+var l=this._list.size();
+if(t<l){
+var s=(s>l)?l:(t+a);
+var n=this._list.getVector().getArray();
+var o=n.slice(t,s);
+var e=AjxVector.fromArray(o);
+this._listView[r].replenish(e);
+if(h){
+h.run()
+}}else{
+this._getMoreToReplenish(r,a,h)
+}};
+ZmListController.prototype._resetSelection=function(t){
+var a=this._listView[this._currentView].getList();
+if(a){
+var e=t>=0?t:0;
+var o=a.get(e);
+this._listView[this._currentView].setSelection(o,false)
+}};
+ZmListController.prototype._getMoreToReplenish=function(t,n,h){
+if(this._list.hasMore()){
+var o=this._listView[t].getList();
+var a=o.getLast();
+var e=(a&&a.id)?a.sf:null;
+var s=e?a.id:null;
+var r=new AjxCallback(this,this._handleResponseGetMoreToReplenish,[t,h]);
+this._search(t,this._list.size(),n,r,false,s,e)
+}else{
+if(h){
+h.run()
+}}};
+ZmListController.prototype._handleResponseGetMoreToReplenish=function(a,s,t){
+var e=t.getResponse();
+var o=e.getAttribute("more");
+this._list.setHasMore(o);
+this._cacheList(e);
+var n=e.getResults().getVector();
+this._listView[a].replenish(n);
+this._toolbar[a].enable(ZmOperation.PAGE_FORWARD,o);
+if(s){
+s.run(t)
+}};
+ZmListController.prototype._initializeNavToolBar=function(t){
+var e=new ZmNavToolBar({
+parent:this._toolbar[t],context:t}
+);
+this._setNavToolBar(e,t)
+};
+ZmListController.prototype._setNavToolBar=function(t,e){
+this._navToolBar[e]=t;
+if(this._navToolBar[e]){
+var a=new AjxListener(this,this._navBarListener);
+this._navToolBar[e].addSelectionListener(ZmOperation.PAGE_BACK,a);
+this._navToolBar[e].addSelectionListener(ZmOperation.PAGE_FORWARD,a)
+}};
+ZmListController.prototype._resetNavToolBarButtons=function(e){
+var t=this._listView[e];
+if(t._isPageless){
+this._setItemCountText()
+}
+if(!this._navToolBar[e]){
+return
+}
+this._navToolBar[e].enable(ZmOperation.PAGE_BACK,t.offset>0);
+var a=false;
+if(this._list){
+a=this._list.hasMore();
+if(!a&&((t.offset+t.getLimit())<this._list.size())){
+a=true
+}}
+this._navToolBar[e].enable(ZmOperation.PAGE_FORWARD,a);
+this._navToolBar[e].setText(this._getNavText(e))
+};
+ZmListController.prototype.enablePagination=function(t,e){
+if(!this._navToolBar[e]){
+return
+}
+if(t){
+this._resetNavToolBarButtons(e)
+}else{
+this._navToolBar[e].enable([ZmOperation.PAGE_BACK,ZmOperation.PAGE_FORWARD],false)
+}};
+ZmListController.prototype._getNavText=function(e){
+var o=this._getNavStartEnd(e);
+if(!o){
+return""
+}
+var a=this._getNumTotal();
+var t=a?ZmMsg.navText2:ZmMsg.navText1;
+return AjxMessageFormat.format(t,[o.start,o.end,a])
+};
+ZmListController.prototype._getNavStartEnd=function(a){
+var n=this._listView[a];
+var t=n.getLimit();
+var o=this._list?this._list.size():0;
+var s,e;
+if(o>0){
+s=n.offset+1;
+e=Math.min(n.offset+t,o)
+}
+return(s&&e)?{
+start:s,end:e}
+:null
+};
+ZmListController.prototype._getNumTotal=function(){
+var e=this._getSearchFolderId();
+if(e&&(e!=ZmFolder.ID_TRASH)){
+var t=appCtxt.getById(e);
+if(t){
+return t.numTotal
+}}
+return null
+};
+ZmListController._newDropDownListener=function(o){
+var a=this;
+var e=a._ZmListController_this;
+e._propagateMenuListeners(a,ZmOperation.NEW_MENU);
+var t=a.getButton(ZmOperation.NEW_MENU);
+var n=a._ZmListController_newDropDownListener;
+t.removeDropDownSelectionListener(n);
+t.popup();
+delete a._ZmListController_this;
+delete a._ZmListController_newDropDownListener
+};
+ZmListController.prototype._getDefaultFocusItem=function(){
+return this._listView[this._currentView]
+};
+ZmListController.prototype.getActionMenu=function(){
+if(!this._actionMenu){
+this._initializeActionMenu();
+this._resetOperations(this._actionMenu,0)
+}
+return this._actionMenu
+};
+ZmListController.prototype._getMenuContext=function(){
+return this._app&&this._app._name
+};
+ZmListController.prototype._getItemCountText=function(){
+var h=this._listView[this._currentView];
+var s=h&&h._list;
+if(!s){
+return""
+}
+var a=h&&h.type;
+var t=s.size();
+var n=this._getNumTotal();
+var e=n||t;
+var o=!a?"items":(e==1)?ZmItem.MSG_KEY[a]:ZmItem.PLURAL_MSG_KEY[a];
+if(n){
+return AjxMessageFormat.format(ZmMsg.itemCount1,[t,n,ZmMsg[o]])
+}else{
+var r=s.size()+(this._list.hasMore()?"+":"");
+return AjxMessageFormat.format(ZmMsg.itemCount,[r,ZmMsg[o]])
+}};
+ZmListController.prototype._setItemCountText=function(t){
+t=t||this._getItemCountText();
+var e=this._itemCountText[this._currentView];
+if(e){
+e.setText(t)
+}};
+ZmListController.prototype._setupContinuation=function(o,a,r,s){
+var e=new AjxCallback(this,o,a);
+r.finalCallback=new AjxCallback(this,this._continueAction,{
+actionCallback:e,allDoneCallback:s}
+);
+r.count=this._continuation.count;
+var t=r.items;
+var n=(t&&(t instanceof Array)&&t.length&&t[0].list)||this._list;
+if(!this._continuation.lastItem){
+this._continuation.lastItem=n.getVector().getLast();
+this._continuation.totalItems=n.size()
+}
+return n
+};
+ZmListController.prototype._continueAction=function(o,t){
+var a=this._listView[this._currentView];
+var r=t&&t.cancelled;
+var p=this._continuation.result;
+var e=p?p.getAttribute("more"):this._list.hasMore();
+if(a.allSelected&&e&&!r){
+var h=this._currentSearch;
+var n=ZmListController.CONTINUATION_SEARCH_ITEMS;
+var u={
+query:this.getSearchString(),queryHint:this.getSearchStringHint(),types:h.types,sortBy:h.sortBy,limit:n};
+var l=p?p.getResults().getArray():this._list.getArray();
+var d=this._continuation.lastItem;
+if(!d){
+d=l&&l[l.length-1]
+}
+if(d){
+u.lastId=d.id;
+u.lastSortVal=d.sf
+}else{
+u.offset=n+(this._continuation.search?this._continuation.search.offset:0)
+}
+this._continuation.count=t.numItems;
+if(!this._continuation.totalItems){
+this._continuation.totalItems=l.length
+}
+this._continuation.search=new ZmSearch(u);
+var f=new AjxCallback(this,this._handleResponseContinueAction,[o.actionCallback]);
+appCtxt.getSearchController().redoSearch(this._continuation.search,true,null,f)
+}else{
+if(p){
+if(a.allSelected){
+var s=ZmItem.PLURAL_MSG_KEY[p.type]||"items";
+var m=AjxMessageFormat.format(ZmMsg.itemsProcessed,[this._continuation.totalItems,ZmMsg[s]]);
+appCtxt.setStatusMsg(m);
+a.deselectAll()
+}
+this._continuation={
+count:0,totalItems:0}
+}
+var c=ZmList.progressDialog;
+if(c){
+c.popdown();
+ZmList.progressDialog=null
+}
+if(o.allDoneCallback){
+o.allDoneCallback.run()
+}}};
+ZmListController.prototype._handleResponseContinueAction=function(t,e){
+this._continuation.result=e.getResponse();
+var a=this._continuation.result.getResults().getArray();
+if(a.length){
+this._continuation.lastItem=a[a.length-1];
+this._continuation.totalItems+=a.length;
+t.args=t.args||[];
+t.args.unshift(a);
+t.run()
+}};
+ZmListController.prototype._checkItemCount=function(){
+var e=this._listView[this._currentView];
+e._checkItemCount();
+e._handleResponseCheckReplenish()
+}
+}
+if(AjxPackage.define("zimbraMail.share.controller.ZmTreeController")){
+ZmTreeController=function(e){
+if(arguments.length==0){
+return
+}
+ZmController.call(this,null);
+this.type=e;
+this._opc=appCtxt.getOverviewController();
+this._listeners={};
+this._listeners[ZmOperation.DELETE]=new AjxListener(this,this._deleteListener);
+this._listeners[ZmOperation.MOVE]=new AjxListener(this,this._moveListener);
+this._listeners[ZmOperation.EXPAND_ALL]=new AjxListener(this,this._expandAllListener);
+this._listeners[ZmOperation.MARK_ALL_READ]=new AjxListener(this,this._markAllReadListener);
+this._listeners[ZmOperation.SYNC]=new AjxListener(this,this._syncListener);
+this._listeners[ZmOperation.SYNC_ALL]=new AjxListener(this,this._syncAllListener);
+this._listeners[ZmOperation.EDIT_PROPS]=new AjxListener(this,this._editPropsListener);
+this._listeners[ZmOperation.EMPTY_FOLDER]=new AjxListener(this,this._emptyListener);
+this._dragSrc=new DwtDragSource(Dwt.DND_DROP_MOVE);
+this._dragSrc.addDragListener(new AjxListener(this,this._dragListener));
+this._dropTgt=new DwtDropTarget(ZmTreeController.DROP_SOURCES[e]);
+this._dropTgt.addDropListener(new AjxListener(this,this._dropListener));
+this._treeView={};
+this._hideEmpty={};
+this._dataTree={}
+};
+ZmTreeController.prototype=new ZmController;
+ZmTreeController.prototype.constructor=ZmTreeController;
+ZmTreeController.COLOR_CLASS={};
+ZmTreeController.COLOR_CLASS[ZmOrganizer.C_ORANGE]="OrangeBg";
+ZmTreeController.COLOR_CLASS[ZmOrganizer.C_BLUE]="BlueBg";
+ZmTreeController.COLOR_CLASS[ZmOrganizer.C_CYAN]="CyanBg";
+ZmTreeController.COLOR_CLASS[ZmOrganizer.C_GREEN]="GreenBg";
+ZmTreeController.COLOR_CLASS[ZmOrganizer.C_PURPLE]="PurpleBg";
+ZmTreeController.COLOR_CLASS[ZmOrganizer.C_RED]="RedBg";
+ZmTreeController.COLOR_CLASS[ZmOrganizer.C_YELLOW]="YellowBg";
+ZmTreeController.COLOR_CLASS[ZmOrganizer.C_PINK]="PinkBg";
+ZmTreeController.COLOR_CLASS[ZmOrganizer.C_GRAY]="Gray";
+ZmTreeController.TREE_SELECTION_SHORTCUT_DELAY=750;
+ZmTreeController.DROP_SOURCES={};
+ZmTreeController.prototype.resetOperations=function(){};
+ZmTreeController.prototype._getHeaderActionMenuOps=function(){};
+ZmTreeController.prototype._getActionMenuOps=function(){};
+ZmTreeController.prototype._getNewDialog=function(){};
+ZmTreeController.prototype._getRenameDialog=function(){};
+ZmTreeController.prototype._itemClicked=function(){};
+ZmTreeController.prototype._itemDblClicked=function(){};
+ZmTreeController.prototype._dropListener=function(){};
+ZmTreeController.prototype._getMoveDialogTitle=function(){};
+ZmTreeController.prototype._resetOperation=function(t,r,n,a,e,o){
+var s=t&&t.getOp(r);
+if(!s){
+return
+}
+if(n){
+s.setText(n)
+}
+if(a){
+s.setImage(a)
+}
+if(e!=null){
+s.setEnabled(e)
+}
+if(o!=null){
+s.setVisible(o)
+}};
+ZmTreeController.prototype._resetButtonPerSetting=function(a,o,t){
+var e=a.getOp(o);
+if(e){
+if(t){
+e.setVisible(true);
+if(appCtxt.isOffline&&!appCtxt.getActiveAccount().isZimbraAccount){
+e.setEnabled(false)
+}}else{
+e.setVisible(false)
+}}};
+ZmTreeController.prototype.toString=function(){
+return"ZmTreeController"
+};
+ZmTreeController.prototype.show=function(s){
+var r=s.overviewId;
+this._hideEmpty[r]=s.hideEmpty;
+if(!this._treeView[r]||s.forceCreate){
+this._treeViewCreated=false;
+this._treeView[r]=null;
+this._treeView[r]=this.getTreeView(r,true)
+}
+var e=(appCtxt.multiAccounts&&this.type==ZmOrganizer.ZIMLET);
+var a=e?appCtxt.accountList.mainAccount:(this.type==ZmOrganizer.VOICE?r:s.account);
+var o=this.getDataTree(a);
+if(o){
+s.dataTree=o;
+var t=ZmOrganizer.OPEN_SETTING[this.type];
+s.collapsed=(!e&&(!(!t||(appCtxt.get(t,null,a)!==false))));
+var n=this._opc.getOverview(r);
+if(n.showNewButtons){
+this._setupNewOp(s)
+}
+this._treeView[r].set(s);
+this._checkTreeView(r)
+}
+if(!this._treeViewCreated){
+this._treeViewCreated=true;
+this._postSetup(r,s.account)
+}
+return this._treeView[r]
+};
+ZmTreeController.prototype.getTreeView=function(t,e){
+if(e&&!this._treeView[t]){
+this._treeView[t]=this._setup(t)
+}
+return this._treeView[t]
+};
+ZmTreeController.prototype.clearTreeView=function(e){
+if(this._treeView[e]){
+this._treeView[e].dispose();
+delete this._treeView[e]
+}};
+ZmTreeController.prototype.getDropTarget=function(){
+return this._dropTgt
+};
+ZmTreeController.prototype.getDataTree=function(e){
+e=e||appCtxt.getActiveAccount();
+var t=this._dataTree[e.id];
+if(!t){
+t=this._dataTree[e.id]=appCtxt.getTree(this.type,e);
+if(t){
+t.addChangeListener(this._getTreeChangeListener())
+}}
+return t
+};
+ZmTreeController.prototype._setupNewOp=function(o){
+var a=ZmOrganizer.NEW_OP[this.type];
+if(a){
+var t=ZmOperation.SETTING[a];
+if(!t||appCtxt.get(t)){
+var e=ZmOperation.getProp(a,"tooltipKey");
+o.newButton={
+image:ZmOperation.getProp(a,"image"),tooltip:e?ZmMsg[e]:null,callback:new AjxCallback(this,this._newListener)}
+}}};
+ZmTreeController.prototype._getTreeChangeListener=function(){
+if(!this._dataChangeListener){
+this._dataChangeListener=new AjxListener(this,this._treeChangeListener)
+}
+return this._dataChangeListener
+};
+ZmTreeController.prototype._setup=function(t){
+var e=this._initializeTreeView(t);
+if(this._opc.getOverview(t).actionSupported){
+this._initializeActionMenus()
+}
+return e
+};
+ZmTreeController.prototype._postSetup=function(r,s){
+var a=this.getTreeView(r);
+if(!a.isCheckedStyle&&!ZmOrganizer.HAS_COLOR[this.type]){
+return
+}
+var t=ZmOrganizer.getSystemId(ZmOrganizer.ID_ROOT,s);
+var e=a.getTreeItemById(t);
+if(!e){
+return
+}
+if(a.isCheckedStyle){
+e.showCheckBox(false)
+}
+var n=e.getItems();
+for(var o=0;
+o<n.length;
+o++){
+this._fixupTreeNode(n[o],null,a)
+}};
+ZmTreeController.prototype._fixupTreeNode=function(n,e,t){
+if(n._isSeparator){
+return
+}
+e=e||n.getData(Dwt.KEY_OBJECT);
+if(e){
+if(ZmOrganizer.HAS_COLOR[this.type]){
+this._setTreeItemColor(n,e)
+}
+if(t.isCheckedStyle){
+if(e.type==this.type&&t.isCheckedStyle){
+n.setChecked(e.isChecked,true)
+}else{
+n.showCheckBox(false);
+n.enableSelection(true)
+}}}
+var o=n.getItems();
+for(var a=0;
+a<o.length;
+a++){
+this._fixupTreeNode(o[a],null,t)
+}};
+ZmTreeController.prototype._setTreeItemColor=function(t,e){
+t.setImage(e.getIconWithColor())
+};
+ZmTreeController.prototype._getTreeItemColorClassName=function(a,e){
+if(!a||!e){
+return null
+}
+if(e.isInTrash()){
+return null
+}
+var t=e.color?e.color:ZmOrganizer.DEFAULT_COLOR[e.type];
+return(t&&(t!=ZmOrganizer.C_NONE))?ZmTreeController.COLOR_CLASS[t]:""
+};
+ZmTreeController.prototype._initializeTreeView=function(o){
+var a=this._opc.getOverview(o);
+var t={
+parent:a,parentElement:a.getTreeParent(this.type),overviewId:o,type:this.type,headerClass:a.headerClass,dragSrc:(a.dndSupported?this._dragSrc:null),dropTgt:(a.dndSupported?this._dropTgt:null),treeStyle:a.treeStyle,isCheckedByDefault:a.isCheckedByDefault,allowedTypes:this._getAllowedTypes(),allowedSubTypes:this._getAllowedSubTypes()};
+t.id=ZmId.getTreeId(o,t.type);
+var e=this._createTreeView(t);
+e.addSelectionListener(new AjxListener(this,this._treeViewListener));
+e.addTreeListener(new AjxListener(this,this._treeListener));
+return e
+};
+ZmTreeController.prototype._createTreeView=function(e){
+return new ZmTreeView(e)
+};
+ZmTreeController.prototype._initializeActionMenus=function(){
+var o=this;
+var a=this._createActionMenu;
+var t=this._getHeaderActionMenuOps();
+if(!this._headerActionMenu&&t){
+var e=[this._shell,t];
+this._headerActionMenu=new AjxCallback(o,a,e)
+}
+var t=this._getActionMenuOps();
+if(!this._actionMenu&&t){
+var e=[this._shell,t];
+this._actionMenu=new AjxCallback(o,a,e)
+}};
+ZmTreeController.prototype._getHeaderActionMenu=function(e){
+if(this._headerActionMenu instanceof AjxCallback){
+var t=this._headerActionMenu;
+this._headerActionMenu=t.run()
+}
+return this._headerActionMenu
+};
+ZmTreeController.prototype._getActionMenu=function(e){
+if(this._actionMenu instanceof AjxCallback){
+var t=this._actionMenu;
+this._actionMenu=t.run()
+}
+return this._actionMenu
+};
+ZmTreeController.prototype._createActionMenu=function(o,t){
+if(!t){
+return
+}
+var n=new ZmActionMenu({
+parent:o,menuItems:t}
+);
+t=n.opList;
+for(var e=0;
+e<t.length;
+e++){
+var a=t[e];
+if(this._listeners[a]){
+n.addSelectionListener(a,this._listeners[a])
+}}
+n.addPopdownListener(new AjxListener(this,this._menuPopdownActionListener));
+return n
+};
+ZmTreeController.prototype._getAllowedTypes=function(){
+var e={};
+e[this.type]=true;
+return e
+};
+ZmTreeController.prototype._getAllowedSubTypes=function(){
+var e={};
+e[this.type]=true;
+return e
+};
+ZmTreeController.prototype._doCreate=function(params){
+params.type=this.type;
+var funcName=ZmOrganizer.CREATE_FUNC[this.type];
+if(funcName){
+var func=eval(funcName);
+func(params)
+}};
+ZmTreeController.prototype._doDelete=function(e){
+e._delete()
+};
+ZmTreeController.prototype._doEmpty=function(t){
+var n=false;
+t._empty(n);
+var e=appCtxt.getCurrentController();
+if(e&&e._getSearchFolderId){
+var o=e._getSearchFolderId();
+if(o&&(o==t.id)){
+var a=e.getCurrentView();
+a._resetList();
+a._setNoResultsHtml()
+}}};
+ZmTreeController.prototype._doRename=function(e,t){
+e.rename(t)
+};
+ZmTreeController.prototype._doMove=function(e,t){
+e.move(t)
+};
+ZmTreeController.prototype._doMarkAllRead=function(e){
+e.markAllRead()
+};
+ZmTreeController.prototype._doSync=function(e){
+e.sync()
+};
+ZmTreeController.prototype._treeViewListener=function(r){
+if(r.detail!=DwtTree.ITEM_ACTIONED&&r.detail!=DwtTree.ITEM_SELECTED&&r.detail!=DwtTree.ITEM_DBL_CLICKED){
+return
+}
+var o=r.item;
+var n=o.getData(ZmTreeView.KEY_TYPE);
+if(!n){
+return
+}
+var l=o.getData(Dwt.KEY_OBJECT);
+if(l){
+this._actionedOrganizer=l;
+if(l.noSuchFolder){
+var t=appCtxt.getFolderTree();
+if(t){
+t.handleDeleteNoSuchFolder(l)
+}
+return
+}}
+var e=o.getData(Dwt.KEY_ID);
+var a=this._actionedOverviewId=o.getData(ZmTreeView.KEY_ID);
+var h=this._opc.getOverview(a);
+if(!h){
+return
+}
+if(r.detail==DwtTree.ITEM_ACTIONED){
+if(h.actionSupported){
+var s=(l.nId==ZmOrganizer.ID_ROOT||l.isDataSource(ZmAccount.TYPE_IMAP))?this._getHeaderActionMenu(r):this._getActionMenu(r);
+if(s){
+this.resetOperations(s,n,e);
+s.popup(0,r.docX,r.docY)
+}}}else{
+if((r.detail==DwtTree.ITEM_SELECTED)&&l){
+if(appCtxt.multiAccounts&&(l instanceof ZmOrganizer)){
+this._handleMultiAccountItemSelection(r,h,o,l)
+}else{
+this._handleItemSelection(r,h,o,l)
+}}else{
+if((r.detail==DwtTree.ITEM_DBL_CLICKED)&&l){
+this._itemDblClicked(l)
+}}}};
+ZmTreeController.prototype._handleItemSelection=function(t,s,n,e){
+s.itemSelected(n);
+if(t.kbNavEvent){
+DwtControl._scrollIntoView(n._itemDiv,s.getHtmlElement());
+ZmController.noFocus=true
+}
+if(s._treeSelectionShortcutDelayActionId){
+AjxTimedAction.cancelAction(s._treeSelectionShortcutDelayActionId)
+}
+if((s.selectionSupported||e._showFoldersCallback)&&!n._isHeader){
+if(t.kbNavEvent&&ZmTreeController.TREE_SELECTION_SHORTCUT_DELAY){
+var o=new AjxTimedAction(this,ZmTreeController.prototype._treeSelectionTimedAction,[e,s]);
+s._treeSelectionShortcutDelayActionId=AjxTimedAction.scheduleAction(o,ZmTreeController.TREE_SELECTION_SHORTCUT_DELAY)
+}else{
+if((appCtxt.multiAccounts&&(e instanceof ZmOrganizer))||(e.type==ZmOrganizer.VOICE)){
+appCtxt.getCurrentApp().getOverviewContainer().deselectAll(s);
+var a=e.account||appCtxt.accountList.mainAccount;
+appCtxt.accountList.setActiveAccount(a)
+}
+this._itemSelected(e)
+}}};
+ZmTreeController.prototype._itemSelected=function(e){
+if(e&&e._showFoldersCallback){
+e._showFoldersCallback.run()
+}else{
+this._itemClicked(e)
+}};
+ZmTreeController.prototype._handleMultiAccountItemSelection=function(t,o,a,e){
+this._handleItemSelection(t,o,a,e)
+};
+ZmTreeController.prototype._treeSelectionTimedAction=function(e,t){
+if(t._treeSelectionShortcutDelayActionId){
+AjxTimedAction.cancelAction(t._treeSelectionShortcutDelayActionId)
+}
+this._itemSelected(e)
+};
+ZmTreeController.prototype._treeListener=function(a){
+var o=a&&a.item;
+var s=o&&o._tree&&o._tree.overviewId;
+var n=appCtxt.getOverviewController().getOverview(s);
+if(!(a&&a.detail&&n&&n.isAppOverview&&o._isHeader)){
+return
+}
+var t=appCtxt.getSettings(n.account);
+var e=t.getSetting(ZmOrganizer.OPEN_SETTING[this.type]);
+if(e){
+e.setValue(a.detail==DwtTree.ITEM_EXPANDED)
+}};
+ZmTreeController.prototype._treeChangeListener=function(e){
+this._evHandled={};
+for(var t in this._treeView){
+this._changeListener(e,this._treeView[t],t)
+}};
+ZmTreeController.prototype._changeListener=function(ev,treeView,overviewId){
+if(this._evHandled[overviewId]){
+return
+}
+if(!treeView.allowedTypes[ev.type]&&!treeView.allowedSubTypes[ev.type]){
+return
+}
+var organizers=ev.getDetail("organizers");
+if(!organizers&&ev.source){
+organizers=[ev.source]
+}
+for(var i=0;
+i<organizers.length;
+i++){
+var organizer=organizers[i];
+if(appCtxt.isOffline&&(organizer.nId==ZmFolder.ID_DRAFTS||organizer.nId==ZmFolder.ID_OUTBOX)){
+organizer=appCtxt.getById(organizer.nId);
+overviewId=appCtxt.getApp(ZmApp.MAIL).getOverviewId(appCtxt.accountList.mainAccount);
+treeView=this._treeView[overviewId]
+}
+var node=treeView.getTreeItemById(organizer.id);
+if(!node&&(ev.event!=ZmEvent.E_CREATE)){
+continue
+}
+var fields=ev.getDetail("fields");
+if(ev.event==ZmEvent.E_FLAGS){
+var flag=ev.getDetail("flag");
+var state=ev.getDetail("state");
+if((flag==ZmItem.FLAG_UNREAD)&&!state){
+node.setText(organizer.getName(false));
+this._evHandled[overviewId]=true
+}}else{
+if(ev.event==ZmEvent.E_DELETE){
+if(organizer.nId==ZmFolder.ID_TRASH||organizer.nId==ZmFolder.ID_SPAM){
+node.setText(organizer.getName(false))
+}else{
+node.dispose()
+}
+this._checkTreeView(overviewId);
+this._evHandled[overviewId]=true
+}else{
+if(ev.event==ZmEvent.E_CREATE||ev.event==ZmEvent.E_MOVE){
+if(appCtxt.multiAccounts){
+var overview=this._opc.getOverview(overviewId);
+if(overview&&overview.account!=organizer.getAccount()){
+continue
+}}
+var parentNode=this._getParentNode(organizer,ev,overviewId);
+var idx=parentNode?ZmTreeView.getSortIndex(parentNode,organizer,eval(ZmTreeView.COMPARE_FUNC[organizer.type])):null;
+if(parentNode&&(ev.event==ZmEvent.E_CREATE)){
+var type=(organizer.parent.nId==ZmOrganizer.ID_ROOT)?ev.type:organizer.parent.type;
+if(type!=this.type){
+continue
+}
+node=this._addNew(treeView,parentNode,organizer,idx)
+}else{
+if(ev.event==ZmEvent.E_MOVE){
+node.dispose();
+if(parentNode){
+node=this._addNew(treeView,parentNode,organizer,idx)
+}}}
+if(parentNode){
+parentNode.setExpanded(true);
+this._fixupTreeNode(node,organizer,treeView)
+}
+this._checkTreeView(overviewId);
+this._evHandled[overviewId]=true
+}else{
+if(ev.event==ZmEvent.E_MODIFY){
+if(!fields){
+return
+}
+if(fields[ZmOrganizer.F_TOTAL]||fields[ZmOrganizer.F_SIZE]){
+node.setToolTipContent(organizer.getToolTip(true))
+}
+var parentNode=this._getParentNode(organizer,ev,overviewId);
+if(!parentNode){
+return
+}
+if(fields[ZmOrganizer.F_NAME]||fields[ZmOrganizer.F_UNREAD]||fields[ZmOrganizer.F_FLAGS]||fields[ZmOrganizer.F_COLOR]||((organizer.nId==ZmFolder.ID_DRAFTS||organizer.nId==ZmOrganizer.ID_OUTBOX)&&fields[ZmOrganizer.F_TOTAL])){
+this._updateOverview(parentNode,node,fields,organizer,treeView);
+this._evHandled[overviewId]=true
+}}}}}}};
+ZmTreeController.prototype._updateOverview=function(parentNode,node,fields,organizer,treeView){
+node.setText(organizer.getName(treeView._showUnread));
+if(fields&&fields[ZmOrganizer.F_NAME]){
+if(parentNode&&(parentNode.getNumChildren()>1)){
+node.dispose();
+var idx=ZmTreeView.getSortIndex(parentNode,organizer,eval(ZmTreeView.COMPARE_FUNC[organizer.type]));
+node=treeView._addNew(parentNode,organizer,idx)
+}else{
+node.setDndText(organizer.getName())
+}
+appCtxt.getAppViewMgr().updateTitle()
+}
+this._fixupTreeNode(node,organizer,treeView)
+};
+ZmTreeController.prototype._getParentNode=function(e,a,o){
+if(e.parent){
+var t=(e.parent.nId==ZmOrganizer.ID_ROOT)?a.type:null;
+return this._opc.getOverview(o).getTreeItemById(e.parent.id,t)
+}};
+ZmTreeController.prototype._addNew=function(o,a,t,e){
+return o._addNew(a,t,e)
+};
+ZmTreeController.prototype._newListener=function(a,o){
+this._pendingActionData=this._getActionedOrganizer(a);
+var t=this._getNewDialog();
+if(!this._newCb){
+this._newCb=new AjxCallback(this,this._newCallback)
+}
+if(this._pendingActionData&&!appCtxt.getById(this._pendingActionData.id)){
+this._pendingActionData=appCtxt.getFolderTree(o).root
+}
+if(!o&&appCtxt.multiAccounts){
+var e=this._opc.getOverview(this._actionedOverviewId);
+o=e&&e.account
+}
+ZmController.showDialog(t,this._newCb,this._pendingActionData,o);
+t.registerCallback(DwtDialog.CANCEL_BUTTON,this._clearDialog,this,t)
+};
+ZmTreeController.prototype._renameListener=function(e){
+this._pendingActionData=this._getActionedOrganizer(e);
+var t=this._getRenameDialog();
+if(!this._renameCb){
+this._renameCb=new AjxCallback(this,this._renameCallback)
+}
+ZmController.showDialog(t,this._renameCb,this._pendingActionData);
+t.registerCallback(DwtDialog.CANCEL_BUTTON,this._clearDialog,this,t)
+};
+ZmTreeController.prototype._deleteListener=function(e){
+this._doDelete(this._getActionedOrganizer(e))
+};
+ZmTreeController.prototype._emptyListener=function(e){
+this._doEmpty(this._getActionedOrganizer(e))
+};
+ZmTreeController.prototype._moveListener=function(e){
+this._pendingActionData=this._getActionedOrganizer(e);
+var t=appCtxt.getChooseFolderDialog();
+if(!this._moveCb){
+this._moveCb=new AjxCallback(this,this._moveCallback)
+}
+ZmController.showDialog(t,this._moveCb,this._getMoveParams(t));
+t.registerCallback(DwtDialog.CANCEL_BUTTON,this._clearDialog,this,t)
+};
+ZmTreeController.prototype._getMoveParams=function(t){
+var e={};
+e[ZmFolder.ID_SPAM]=true;
+return{
+data:this._pendingActionData,treeIds:[this.type],overviewId:t.getOverviewId(ZmOrganizer.APP[this.type]),omit:e,title:this._getMoveDialogTitle(),description:ZmMsg.targetFolder,appName:ZmOrganizer.APP[this.type]}
+};
+ZmTreeController.prototype._expandAllListener=function(o){
+var e=this._getActionedOrganizer(o);
+var t=this.getTreeView(this._actionedOverviewId);
+var a=t.getTreeItemById(e.id);
+a.setExpanded(true,true)
+};
+ZmTreeController.prototype._markAllReadListener=function(e){
+this._doMarkAllRead(this._getActionedOrganizer(e))
+};
+ZmTreeController.prototype._syncAllListener=function(o){
+var s=this._getActionedOrganizer(o);
+if(s.isFeed()){
+for(var r in this._treeView){
+var a=this.getTreeView(r);
+var t=ZmOrganizer.getSystemId(ZmOrganizer.ID_ROOT,appCtxt.getActiveAccount());
+var e=a.getTreeItemById(t);
+if(!e){
+return
+}
+var n=e.getItems();
+if(n&&n[i]&&(n[i].isFeed&&n[i].isFeed()||(n[i].hasFeeds&&n[i].hasFeeds()))){
+this._syncFeeds(n[i])
+}}}else{
+this._syncListener(o)
+}};
+ZmTreeController.prototype._syncListener=function(e){
+var t=this._getActionedOrganizer(e);
+this._syncFeeds(t)
+};
+ZmTreeController.prototype._syncFeeds=function(o){
+if(o.isFeed()){
+this._doSync(o)
+}else{
+if(o.hasFeeds()){
+var e=o.children.getArray();
+var n=o.children.size();
+for(var t=0;
+t<n;
+t++){
+if(e[t].isFeed()||(e[t].hasFeeds&&e[t].hasFeeds())){
+this._syncFeeds(e[t])
+}}}}};
+ZmTreeController.prototype._editPropsListener=function(t){
+var e=appCtxt.getFolderPropsDialog();
+e.popup(this._getActionedOrganizer(t))
+};
+ZmTreeController.prototype._dragListener=function(e){
+switch(e.action){
+case DwtDragEvent.SET_DATA:e.srcData={
+data:e.srcControl.getData(Dwt.KEY_OBJECT),controller:this};
+break
+}};
+ZmTreeController.prototype._menuPopdownActionListener=function(){
+if(this._pendingActionData){
+return
+}
+var e=this.getTreeView(this._actionedOverviewId);
+if(this._actionedOrganizer&&(e.getSelected()!=this._actionedOrganizer)){
+var t=e.getTreeItemById(this._actionedOrganizer.id);
+if(t){
+t._setActioned(false)
+}}};
+ZmTreeController.prototype._newCallback=function(e){
+this._doCreate(e);
+this._clearDialog(this._getNewDialog())
+};
+ZmTreeController.prototype._renameCallback=function(e,t){
+this._doRename(e,t);
+this._clearDialog(this._getRenameDialog())
+};
+ZmTreeController.prototype._moveCallback=function(e){
+this._doMove(this._pendingActionData,e);
+this._clearDialog(appCtxt.getChooseFolderDialog())
+};
+ZmTreeController.prototype._deleteShieldYesCallback=function(e){
+this._doDelete(e);
+this._clearDialog(this._deleteShield)
+};
+ZmTreeController.prototype._emptyShieldYesCallback=function(e){
+this._doEmpty(e);
+this._clearDialog(this._emptyShield)
+};
+ZmTreeController.prototype._getActionedOrganizer=function(e){
+if(this._actionedOrganizer){
+return this._actionedOrganizer
+}
+var a=e.item;
+while(a){
+var t=a.getData(Dwt.KEY_OBJECT);
+if(t instanceof ZmOrganizer){
+this._actionedOrganizer=t;
+return this._actionedOrganizer
+}
+a=a.parent
+}
+return null
+};
+ZmTreeController.prototype._checkTreeView=function(o){
+if(!o||!this._treeView[o]){
+return
+}
+var t=this._opc.getOverview(o).account;
+var a=this.getDataTree(t);
+var e=(ZmOrganizer.HIDE_EMPTY[this.type]&&a&&(a.size()==0));
+this._treeView[o].setVisible(!e)
+}
+}
+if(AjxPackage.define("zimbraMail.share.controller.ZmTagTreeController")){
+ZmTagTreeController=function(){
+ZmTreeController.call(this,ZmOrganizer.TAG);
+this._listeners[ZmOperation.NEW_TAG]=new AjxListener(this,this._newListener);
+this._listeners[ZmOperation.RENAME_TAG]=new AjxListener(this,this._renameListener);
+this._listeners[ZmOperation.TAG_COLOR_MENU]=new AjxListener(this,this._colorListener);
+this._listeners[ZmOperation.BROWSE]=new AjxListener(this,this._browseListener)
+};
+ZmTagTreeController.prototype=new ZmTreeController;
+ZmTagTreeController.prototype.constructor=ZmTagTreeController;
+ZmTagTreeController.prototype.toString=function(){
+return"ZmTagTreeController"
+};
+ZmTagTreeController.prototype._getActionMenu=function(){
+var o=ZmTreeController.prototype._getActionMenu.call(this);
+if(o&&!o._initialized){
+var t=o.getMenuItem(ZmOperation.TAG_COLOR_MENU);
+if(t){
+var e=t.getMenu().getItems();
+for(var a=0;
+a<e.length;
+a++){
+e[a].addSelectionListener(this._listeners[ZmOperation.TAG_COLOR_MENU])
+}}
+o._initialized=true
+}
+return o
+};
+ZmTagTreeController.prototype.resetOperations=function(a,t,o){
+var e=appCtxt.getById(o);
+a.enableAll(true);
+if(e.isSystem()){
+a.enable([ZmOperation.RENAME_TAG,ZmOperation.TAG_COLOR_MENU,ZmOperation.DELETE],false)
+}
+a.enable(ZmOperation.MARK_ALL_READ,(e&&(e.numUnread>0)))
+};
+ZmTagTreeController.prototype._getHeaderActionMenuOps=function(){
+return[ZmOperation.NEW_TAG,ZmOperation.BROWSE]
+};
+ZmTagTreeController.prototype._getActionMenuOps=function(){
+return[ZmOperation.NEW_TAG,ZmOperation.MARK_ALL_READ,ZmOperation.RENAME_TAG,ZmOperation.DELETE,ZmOperation.TAG_COLOR_MENU]
+};
+ZmTagTreeController.prototype._getNewDialog=function(){
+return appCtxt.getNewTagDialog()
+};
+ZmTagTreeController.prototype._getRenameDialog=function(){
+return appCtxt.getRenameTagDialog()
+};
+ZmTagTreeController.prototype._itemClicked=function(t){
+var e;
+switch(appCtxt.getCurrentAppName()){
+case ZmApp.CONTACTS:e=ZmItem.CONTACT;
+break;
+case ZmApp.NOTEBOOK:e=ZmItem.PAGE;
+break;
+case ZmApp.CALENDAR:e=ZmItem.APPT;
+break;
+case ZmApp.BRIEFCASE:e=ZmItem.BRIEFCASE;
+break;
+case ZmApp.TASKS:e=ZmItem.TASK;
+break;
+default:e=ZmId.SEARCH_MAIL;
+break
+}
+var a={
+query:t.createQuery(),searchFor:e,getHtml:appCtxt.get(ZmSetting.VIEW_AS_HTML),accountName:(t.account&&t.account.name)};
+appCtxt.getSearchController().search(a)
+};
+ZmTagTreeController.prototype._deleteListener=function(t){
+var e=this._pendingActionData=this._getActionedOrganizer(t);
+var a=this._deleteShield=appCtxt.getYesNoCancelMsgDialog();
+a.reset();
+a.registerCallback(DwtDialog.NO_BUTTON,this._clearDialog,this,this._deleteShield);
+a.registerCallback(DwtDialog.YES_BUTTON,this._deleteShieldYesCallback,this,e);
+var o=AjxMessageFormat.format(ZmMsg.askDeleteTag,e.getName(false,ZmOrganizer.MAX_DISPLAY_NAME_LENGTH));
+a.setMessage(o,DwtMessageDialog.WARNING_STYLE);
+a.popup()
+};
+ZmTagTreeController.prototype._colorListener=function(t){
+var e=this._getActionedOrganizer(t);
+if(e){
+e.setColor(t.item.getData(ZmOperation.MENUITEM_ID))
+}};
+ZmTagTreeController.prototype._browseListener=function(t){
+var e=this._getActionedOrganizer(t);
+if(e){
+AjxDispatcher.require("Browse");
+appCtxt.getSearchController().showBrowsePickers([ZmPicker.TAG])
+}};
+ZmTagTreeController.prototype._dropListener=function(n){
+var s=n.srcData.data;
+if(n.action==DwtDropEvent.DRAG_ENTER){
+var o=(s instanceof Array)?s[0]:s;
+var t=n.targetControl.getData(Dwt.KEY_OBJECT);
+if(t.id==ZmOrganizer.ID_ROOT){
+n.doIt=false
+}else{
+if(o instanceof ZmContact&&(o.isGal||o.isShared())){
+n.doIt=false
+}else{
+if(o&&(o instanceof ZmItem)&&o.isShared()){
+n.doIt=false
+}else{
+if(appCtxt.multiAccounts&&t.getAccount()!=o.account){
+n.doIt=false
+}else{
+n.doIt=this._dropTgt.isValidTarget(s)
+}}}}}else{
+if(n.action==DwtDropEvent.DRAG_DROP){
+var e=n.srcData.controller;
+var a=(s instanceof Array)?s:[s];
+e._doTag(a,n.targetControl.getData(Dwt.KEY_OBJECT),true)
+}}};
+ZmTagTreeController.prototype._changeListener=function(r,a,h){
+var t=r.getDetail("fields");
+var o=r.getDetail("organizers");
+for(var n=0;
+n<o.length;
+n++){
+var e=o[n];
+if(r.event==ZmEvent.E_MODIFY&&((t&&t[ZmOrganizer.F_COLOR]))){
+var s=a.getTreeItemById(e.id);
+if(s){
+s.setImage(ZmTag.COLOR_ICON[e.color])
+}}else{
+ZmTreeController.prototype._changeListener.call(this,r,a,h)
+}}};
+ZmTagTreeController.prototype._setTreeItemColor=function(t,e){}
+}
+if(AjxPackage.define("zimbraMail.share.controller.ZmFolderTreeController")){
+ZmFolderTreeController=function(t,e){
+if(arguments.length==0){
+return
+}
+ZmTreeController.call(this,(t||ZmOrganizer.FOLDER));
+this._listeners[ZmOperation.NEW_FOLDER]=new AjxListener(this,this._newListener);
+this._listeners[ZmOperation.RENAME_FOLDER]=new AjxListener(this,this._renameListener);
+this._listeners[ZmOperation.SHARE_FOLDER]=new AjxListener(this,this._shareAddrBookListener);
+this._listeners[ZmOperation.MOUNT_FOLDER]=new AjxListener(this,this._mountAddrBookListener);
+this._listeners[ZmOperation.EMPTY_FOLDER]=new AjxListener(this,this._emptyListener);
+this._listeners[ZmOperation.SYNC_OFFLINE_FOLDER]=new AjxListener(this,this._syncOfflineFolderListener);
+this._listeners[ZmOperation.BROWSE]=new AjxListener(this,this._browseListener)
+};
+ZmFolderTreeController.prototype=new ZmTreeController;
+ZmFolderTreeController.prototype.constructor=ZmFolderTreeController;
+ZmFolderTreeController.prototype.toString=function(){
+return"ZmFolderTreeController"
+};
+ZmFolderTreeController.prototype.show=function(n){
+var a=n.omit||{};
+for(var s in ZmFolder.HIDE_ID){
+a[s]=true
+}
+var o=this.type!=ZmOrganizer.VOICE&&this.getDataTree(n.account);
+if(o){
+for(var e in ZmFolder.HIDE_NAME){
+var t=o.getByName(e);
+if(t){
+a[t.id]=true
+}}
+if(appCtxt.isOffline&&n.account){
+if(!n.account.isMain){
+a[ZmFolder.ID_DRAFTS]=true;
+a[ZmFolder.ID_OUTBOX]=true
+}else{
+if(n.account.type==ZmAccount.TYPE_POP){
+a[ZmFolder.ID_SPAM]=true;
+a[ZmFolder.ID_SENT]=true;
+a[ZmFolder.ID_DRAFTS]=true;
+a[ZmFolder.ID_OUTBOX]=true
+}}}}
+n.omit=a;
+return ZmTreeController.prototype.show.call(this,n)
+};
+ZmFolderTreeController.prototype.resetOperations=function(p,m,a){
+var s=ZmMsg.emptyFolder;
+var o=appCtxt.getById(a);
+var r=((o.numTotal>0)||(o.children&&(o.children.size()>0)));
+var n=ZmOrganizer.normalizeId(a,this.type);
+if(n==ZmOrganizer.ID_ROOT||((!o.isSystem())&&!o.isSyncIssuesFolder())){
+var u=(!o.link||o.isAdmin());
+p.enableAll(true);
+p.enable(ZmOperation.SYNC,o.isFeed());
+p.enable(ZmOperation.SYNC_ALL,o.isFeed()||o.hasFeeds());
+p.enable([ZmOperation.SHARE_FOLDER,ZmOperation.MOUNT_FOLDER],u);
+p.enable(ZmOperation.EMPTY_FOLDER,(r||o.link));
+p.enable(ZmOperation.RENAME_FOLDER,!o.isDataSource());
+p.enable(ZmOperation.NEW_FOLDER,!o.disallowSubFolder);
+if(o.isRemote()&&o.isReadOnly()){
+p.enable([ZmOperation.NEW_FOLDER,ZmOperation.MARK_ALL_READ,ZmOperation.EMPTY_FOLDER],false)
+}}else{
+p.enableAll(false);
+if(!o.disallowSubFolder&&(n==ZmFolder.ID_INBOX||n==ZmFolder.ID_SENT||n==ZmFolder.ID_TRASH)){
+p.enable(ZmOperation.NEW_FOLDER,true)
+}
+if(n==ZmFolder.ID_SPAM||n==ZmFolder.ID_TRASH||n==ZmFolder.ID_CHATS){
+if(n==ZmFolder.ID_SPAM){
+s=ZmMsg.emptyJunk
+}else{
+if(n==ZmFolder.ID_TRASH){
+s=ZmMsg.emptyTrash
+}}
+p.enable(ZmOperation.EMPTY_FOLDER,r)
+}
+if(!o.link&&(n==ZmFolder.ID_INBOX||n==ZmFolder.ID_SENT)){
+p.enable([ZmOperation.SHARE_FOLDER,ZmOperation.MOUNT_FOLDER,ZmOperation.EDIT_PROPS],true)
+}
+if(appCtxt.isOffline&&n==ZmOrganizer.ID_SYNC_FAILURES&&r){
+p.enable(ZmOperation.EMPTY_FOLDER,true)
+}}
+p.enable(ZmOperation.EXPAND_ALL,(o.size()>0));
+if(n!=ZmOrganizer.ID_ROOT&&!o.isReadOnly()){
+p.enable(ZmOperation.MARK_ALL_READ,(o.numUnread>0||o.link))
+}
+var l=p.getOp(ZmOperation.EMPTY_FOLDER);
+if(l){
+l.setText(s)
+}
+var h=p.getOp(ZmOperation.SYNC);
+if(h){
+var d=p.getOp(ZmOperation.SYNC_ALL);
+var t=o.hasFeeds();
+if(o.isFeed()){
+h.setEnabled(true);
+h.setVisible(true);
+h.setText(ZmMsg.checkFeed);
+if(d){
+d.setEnabled(true);
+d.setVisible(true);
+d.setText(ZmMsg.checkAllFeed)
+}}else{
+if(t){
+if(d){
+d.setEnabled(true);
+d.setVisible(true);
+d.setText(ZmMsg.checkAllFeed)
+}}else{
+var f=appCtxt.get(ZmSetting.POP_ACCOUNTS_ENABLED)||appCtxt.get(ZmSetting.IMAP_ACCOUNTS_ENABLED);
+if(!appCtxt.isOffline&&f){
+var c=AjxDispatcher.run("GetDataSourceCollection");
+var e=c.getItemsFor(ZmOrganizer.normalizeId(o.id));
+if(e.length>0){
+h.setText(ZmMsg.checkExternalMail);
+h.setEnabled(true);
+h.setVisible(true)
+}else{
+h.setVisible(false)
+}}else{
+h.setVisible(false)
+}
+if(!t&&d){
+d.setVisible(false)
+}}}}
+h=p.getOp(ZmOperation.SYNC_OFFLINE_FOLDER);
+if(h){
+if(!o.isOfflineSyncable){
+h.setVisible(false)
+}else{
+h.setVisible(true);
+h.setEnabled(true);
+var g=(o.isOfflineSyncing)?ZmMsg.syncOfflineFolderOff:ZmMsg.syncOfflineFolderOn;
+h.setText(g)
+}}
+p.enable(ZmOperation.BROWSE,true);
+this._resetButtonPerSetting(p,ZmOperation.SHARE_FOLDER,appCtxt.get(ZmSetting.SHARING_ENABLED));
+this._resetButtonPerSetting(p,ZmOperation.MOUNT_FOLDER,appCtxt.get(ZmSetting.SHARING_ENABLED))
+};
+ZmFolderTreeController.prototype._getHeaderActionMenuOps=function(){
+return[ZmOperation.NEW_FOLDER,ZmOperation.MOUNT_FOLDER,ZmOperation.EXPAND_ALL,ZmOperation.SYNC,ZmOperation.BROWSE]
+};
+ZmFolderTreeController.prototype._getActionMenuOps=function(){
+return[ZmOperation.NEW_FOLDER,ZmOperation.MARK_ALL_READ,ZmOperation.DELETE,ZmOperation.RENAME_FOLDER,ZmOperation.MOVE,ZmOperation.SHARE_FOLDER,ZmOperation.EDIT_PROPS,ZmOperation.EXPAND_ALL,ZmOperation.SYNC,ZmOperation.SYNC_ALL,ZmOperation.EMPTY_FOLDER,ZmOperation.SYNC_OFFLINE_FOLDER]
+};
+ZmFolderTreeController.prototype._getAllowedSubTypes=function(){
+var e={};
+e[ZmOrganizer.FOLDER]=true;
+e[ZmOrganizer.SEARCH]=true;
+return e
+};
+ZmFolderTreeController.prototype._getNewDialog=function(){
+return appCtxt.getNewFolderDialog()
+};
+ZmFolderTreeController.prototype._getRenameDialog=function(){
+return appCtxt.getRenameFolderDialog()
+};
+ZmFolderTreeController.prototype._itemClicked=function(t){
+if(t.type==ZmOrganizer.SEARCH){
+var s=this._opc.getTreeController(ZmOrganizer.SEARCH);
+s._itemClicked(t)
+}else{
+if(t.id==ZmFolder.ID_ATTACHMENTS){
+var r=AjxDispatcher.run("GetAttachmentsController");
+r.show()
+}else{
+var e=ZmId.SEARCH_MAIL;
+if(t.isInTrash()){
+var o=appCtxt.getCurrentAppName();
+if(o==ZmApp.CONTACTS){
+e=ZmItem.CONTACT
+}}
+var h=appCtxt.getSearchController();
+var n={
+query:t.createQuery(),searchFor:e,getHtml:(t.nId==ZmFolder.ID_DRAFTS)||appCtxt.get(ZmSetting.VIEW_AS_HTML),types:((t.nId==ZmOrganizer.ID_SYNC_FAILURES)?[ZmItem.MSG]:null),sortBy:((h.currentSearch&&t.nId==h.currentSearch.folderId)?null:ZmSearch.DATE_DESC),accountName:(t.account&&t.account.name)};
+h.resetSearchAllAccounts();
+if(appCtxt.multiAccounts){
+if(t.link&&t.shares==null){
+var a=appCtxt.getFolderTree(t.account);
+if(a){
+var l=new AjxCallback(this,this._getPermissionsResponse,[n]);
+a.getPermissions({
+callback:l,folderIds:[t.id]}
+)
+}
+return
+}
+n.callback=(t.id==ZmFolder.ID_DRAFTS||t.id==ZmFolder.ID_OUTBOX)?(new AjxCallback(this,this._handleSearch,[h,n.query,t])):null
+}
+h.search(n)
+}}};
+ZmFolderTreeController.prototype._handleSearch=function(o,a,t){
+var e=this._opc.getOverview(appCtxt.getApp(ZmApp.MAIL).getOverviewId());
+e.setSelected(t.id)
+};
+ZmFolderTreeController.prototype._getPermissionsResponse=function(e){
+appCtxt.getSearchController().search(e)
+};
+ZmFolderTreeController.prototype._doSync=function(a){
+var t=AjxDispatcher.run("GetDataSourceCollection");
+var e=ZmOrganizer.normalizeId(a.id);
+var o=t.getItemsFor(e);
+if(o.length>0){
+t.importMailFor(e)
+}else{
+ZmTreeController.prototype._doSync.call(this,a)
+}};
+ZmFolderTreeController.prototype._syncFeeds=function(t){
+if(!appCtxt.isOffline&&t&&!t.isFeed()){
+var a=(appCtxt.get(ZmSetting.POP_ACCOUNTS_ENABLED)||appCtxt.get(ZmSetting.IMAP_ACCOUNTS_ENABLED))?t.getDataSources(null,true):null;
+if(a){
+var e=AjxDispatcher.run("GetDataSourceCollection");
+e.importMail(a);
+return
+}}
+ZmTreeController.prototype._syncFeeds.call(this,t)
+};
+ZmFolderTreeController.prototype._addNew=function(o,a,t,e){
+if(ZmFolder.HIDE_ID[t.id]){
+return false
+}
+return o._addNew(a,t,e)
+};
+ZmFolderTreeController.prototype._deleteListener=function(a){
+var e=this._getActionedOrganizer(a);
+var n=appCtxt.isOffline?this.getDataTree().getById(ZmFolder.ID_TRASH):null;
+if(n&&n.disallowSubFolder&&e.numTotal>0){
+var r=appCtxt.getMsgDialog();
+r.setMessage(ZmMsg.errorCannotDeleteFolder);
+r.popup();
+return
+}
+if(e.nId==ZmFolder.ID_SPAM||e.isInTrash()||(n&&n.disallowSubFolder)){
+this._pendingActionData=e;
+var o=this._deleteShield=appCtxt.getOkCancelMsgDialog();
+o.reset();
+o.registerCallback(DwtDialog.OK_BUTTON,this._deleteShieldYesCallback,this,e);
+o.registerCallback(DwtDialog.CANCEL_BUTTON,this._clearDialog,this,this._deleteShield);
+var t;
+if(e.type==ZmOrganizer.SEARCH){
+t=ZmMsg.confirmDeleteSavedSearch
+}else{
+if(e.disallowSubFolder||e.isMountpoint){
+t=ZmMsg.confirmDeleteFolder
+}else{
+if(e.nId==ZmFolder.ID_TRASH){
+t=ZmMsg.confirmEmptyTrashFolder
+}else{
+t=ZmMsg.confirmEmptyFolder
+}}}
+var s=AjxMessageFormat.format(t,e.getName());
+o.setMessage(s,DwtMessageDialog.WARNING_STYLE);
+o.popup()
+}else{
+this._doMove(e,appCtxt.getById(ZmFolder.ID_TRASH))
+}};
+ZmFolderTreeController.prototype._emptyListener=function(t){
+var e=this._pendingActionData=this._getActionedOrganizer(t);
+var a=this._emptyShield=appCtxt.getOkCancelMsgDialog();
+a.reset();
+a.registerCallback(DwtDialog.OK_BUTTON,this._emptyShieldYesCallback,this,e);
+a.registerCallback(DwtDialog.CANCEL_BUTTON,this._clearDialog,this,this._emptyShield);
+var n=(e.nId!=ZmFolder.ID_TRASH)?(AjxMessageFormat.format(ZmMsg.confirmEmptyFolder,e.getName())):ZmMsg.confirmEmptyTrashFolder;
+a.setMessage(n,DwtMessageDialog.WARNING_STYLE);
+var s=(e.nId==ZmFolder.ID_TRASH||e.nId==ZmFolder.ID_SPAM)?DwtDialog.OK_BUTTON:DwtDialog.CANCEL_BUTTON;
+a.associateEnterWithButton(s);
+a.popup(null,s);
+if(!(e.nId==ZmFolder.ID_SPAM||e.isInTrash())){
+var o=a.getButton(DwtDialog.CANCEL_BUTTON);
+o.focus()
+}};
+ZmFolderTreeController.prototype._syncOfflineFolderListener=function(t){
+var e=this._getActionedOrganizer(t);
+if(e){
+e.toggleSyncOffline()
+}};
+ZmFolderTreeController.prototype._browseListener=function(t){
+var e=this._getActionedOrganizer(t);
+if(e){
+AjxDispatcher.require("Browse");
+appCtxt.getSearchController().showBrowsePickers([ZmPicker.FOLDER])
+}};
+ZmFolderTreeController.prototype._dragListener=function(t){
+if(t.action==DwtDragEvent.DRAG_START){
+var e=t.srcControl.getData(Dwt.KEY_OBJECT);
+t.srcData={
+data:e,controller:this};
+if(!(e instanceof ZmFolder)||e.isSystem()||e.isSyncIssuesFolder()){
+t.operation=Dwt.DND_DROP_NONE
+}}};
+ZmFolderTreeController.prototype._dropListener=function(l){
+var n=l.targetControl.getData(Dwt.KEY_OBJECT);
+var t=l.srcData.data;
+var o=(l.shiftKey||l.uiEvent.shiftKey);
+if(l.action==DwtDropEvent.DRAG_ENTER){
+var h=l.targetControl.getData(ZmTreeView.KEY_TYPE);
+if(t instanceof ZmFolder){
+l.doIt=n.mayContain(t,h)&&!n.disallowSubFolder
+}else{
+if(t instanceof ZmTag){
+l.doIt=false
+}else{
+if(this._dropTgt.isValidTarget(t)){
+l.doIt=n.mayContain(t,h);
+var e;
+var u=(!(t instanceof Array))?[t]:t;
+for(var a=0;
+a<u.length;
+a++){
+if(u[a] instanceof ZmItem){
+e|=u[a].getDefaultDndAction(o)
+}}
+var c=document.getElementById(DwtId.DND_PLUS_ID);
+if(e&&c){
+var r=((e&ZmItem.DND_ACTION_COPY)!=0);
+Dwt.setVisibility(c,r)
+}}else{
+l.doIt=false
+}}}}else{
+if(l.action==DwtDropEvent.DRAG_DROP){
+if(t instanceof ZmFolder){
+this._doMove(t,n)
+}else{
+var d=l.srcData.controller;
+var s=(t instanceof Array)?t:[t];
+d._doMove(s,n,null,o)
+}}}};
+ZmFolderTreeController.prototype._shareAddrBookListener=function(e){
+this._pendingActionData=this._getActionedOrganizer(e);
+appCtxt.getSharePropsDialog().popup(ZmSharePropsDialog.NEW,this._pendingActionData)
+};
+ZmFolderTreeController.prototype._mountAddrBookListener=function(e){
+appCtxt.getMountFolderDialog().popup(ZmOrganizer.FOLDER)
+};
+ZmFolderTreeController.prototype._getMoveDialogTitle=function(){
+return AjxMessageFormat.format(ZmMsg.moveFolder,this._pendingActionData.name)
+}
+}
+if(AjxPackage.define("zimbraMail.share.controller.ZmSearchTreeController")){
+ZmSearchTreeController=function(){
+ZmFolderTreeController.call(this,ZmOrganizer.SEARCH);
+this._listeners[ZmOperation.RENAME_SEARCH]=new AjxListener(this,this._renameListener);
+this._listeners[ZmOperation.BROWSE]=new AjxListener(this,this._browseListener)
+};
+ZmSearchTreeController.prototype=new ZmFolderTreeController;
+ZmSearchTreeController.prototype.constructor=ZmSearchTreeController;
+ZmSearchTreeController.APP_JOIN_CHAR="-";
+ZmSearchTreeController.prototype.toString=function(){
+return"ZmSearchTreeController"
+};
+ZmSearchTreeController.prototype.show=function(a){
+var o=a.overviewId;
+if(!this._treeView[o]||a.forceCreate){
+this._treeView[o]=this._setup(o)
+}
+var t=this.getDataTree(a.account);
+if(t){
+a.dataTree=t;
+a.searchTypes={};
+a.omit=a.omit||{};
+a.omit[ZmFolder.ID_TRASH]=true;
+a.omitParents=true;
+var e=ZmOrganizer.OPEN_SETTING[this.type];
+a.collapsed=!(!e||(appCtxt.get(e,null,a.account)!==false));
+this._setupNewOp(a);
+this._treeView[o].set(a);
+this._checkTreeView(o)
+}
+return this._treeView[o]
+};
+ZmSearchTreeController.prototype.getTreeStyle=function(){
+return null
+};
+ZmSearchTreeController.prototype.resetOperations=function(a,t,o){
+a.enableAll(true);
+var e=appCtxt.getById(o);
+a.enable(ZmOperation.EXPAND_ALL,(e.size()>0))
+};
+ZmSearchTreeController.prototype._newListener=function(e){
+AjxDispatcher.require("Browse");
+appCtxt.getSearchController().showBrowseView()
+};
+ZmSearchTreeController.prototype._browseListener=function(t){
+var e=this._getActionedOrganizer(t);
+if(e){
+AjxDispatcher.require("Browse");
+appCtxt.getSearchController().showBrowsePickers([ZmPicker.SEARCH])
+}};
+ZmSearchTreeController.prototype._getHeaderActionMenuOps=function(){
+return[ZmOperation.EXPAND_ALL,ZmOperation.BROWSE]
+};
+ZmSearchTreeController.prototype._getActionMenuOps=function(){
+return[ZmOperation.DELETE,ZmOperation.RENAME_SEARCH,ZmOperation.MOVE,ZmOperation.EXPAND_ALL]
+};
+ZmSearchTreeController.prototype._getAllowedSubTypes=function(){
+return ZmTreeController.prototype._getAllowedSubTypes.call(this)
+};
+ZmSearchTreeController.prototype._getNewDialog=function(){
+return appCtxt.getNewSearchDialog()
+};
+ZmSearchTreeController.prototype._itemClicked=function(e){
+if(e._showFoldersCallback){
+e._showFoldersCallback.run();
+return
+}
+var t=appCtxt.getSearchController();
+t.searchAllAccounts=e.isOfflineGlobalSearch;
+t.redoSearch(e.search,false,{
+getHtml:appCtxt.get(ZmSetting.VIEW_AS_HTML)}
+)
+};
+ZmSearchTreeController.prototype._getMoveParams=function(t){
+var e=ZmTreeController.prototype._getMoveParams.apply(this,arguments);
+e.overviewId=t.getOverviewId(this.type);
+e.treeIds=[ZmOrganizer.FOLDER,ZmOrganizer.SEARCH];
+return e
+};
+ZmSearchTreeController.prototype._getMoveDialogTitle=function(){
+return AjxMessageFormat.format(ZmMsg.moveSearch,this._pendingActionData.name)
+};
+ZmSearchTreeController.prototype._checkTreeView=function(n){
+var t=this._treeView[n];
+if(!n||!t){
+return
+}
+var o=this._opc.getOverview(n).account;
+var e=(appCtxt.multiAccounts&&!o.isMain)?(ZmOrganizer.getSystemId(ZmOrganizer.ID_ROOT,o)):ZmOrganizer.ID_ROOT;
+var a=ZmOrganizer.HIDE_EMPTY[this.type]&&!t.getTreeItemById(e).getItemCount();
+this._treeView[n].setVisible(!a)
+}
+}
+if(AjxPackage.define("zimbraMail.share.controller.ZmOverviewController")){
+ZmOverviewController=function(e){
+ZmController.call(this,e);
+this._overviewContainer={};
+this._overview={};
+this._controller={};
+this._appOverviewId={}
+};
+ZmOverviewController.CONTROLLER={};
+ZmOverviewController.DEFAULT_FOLDER_ID=ZmFolder.ID_INBOX;
+ZmOverviewController.prototype=new ZmController;
+ZmOverviewController.prototype.constructor=ZmOverviewController;
+ZmOverviewController.prototype.toString=function(){
+return"ZmOverviewController"
+};
+ZmOverviewController.prototype.createOverviewContainer=function(t,a){
+t.parent=t.parent||this._shell;
+t.controller=this;
+t.id=ZmId.getOverviewContainerId(t.containerId);
+var e=this._overviewContainer[t.containerId]=new ZmAccountOverviewContainer(t);
+e.initialize(a);
+return e
+};
+ZmOverviewController.prototype.createOverview=function(t){
+t.parent=t.parent||this._shell;
+var e=this._overview[t.overviewId]=new ZmOverview(t,this);
+return e
+};
+ZmOverviewController.prototype.getOverviewContainer=function(e){
+var e=e||appCtxt.getCurrentAppName();
+return this._overviewContainer[e]
+};
+ZmOverviewController.prototype.getOverview=function(e){
+return this._overview[e]
+};
+ZmOverviewController.prototype.getTreeController=function(treeId,noCreate){
+if(!treeId){
+return null
+}
+if(!this._controller[treeId]&&!noCreate){
+var className=ZmOverviewController.CONTROLLER[treeId];
+if(className&&window[className]){
+var treeControllerCtor=eval(ZmOverviewController.CONTROLLER[treeId]);
+if(treeControllerCtor){
+this._controller[treeId]=new treeControllerCtor(treeId)
+}}}
+return this._controller[treeId]
+};
+ZmOverviewController.prototype.getTreeData=function(e){
+return e?appCtxt.getTree(e):null
+};
+ZmOverviewController.prototype.getTreeView=function(t,e){
+if(!t||!e){
+return null
+}
+return this.getOverview(t).getTreeView(e)
+}
+}
+if(AjxPackage.define("zimbraMail.share.controller.ZmSearchController")){
+ZmSearchController=function(e){
+ZmController.call(this,e);
+this._inited=false;
+this._searchFor=ZmId.SEARCH_MAIL;
+this._contactSource=ZmItem.CONTACT;
+this._results=null;
+if(appCtxt.get(ZmSetting.SEARCH_ENABLED)){
+this._setView()
+}};
+ZmSearchController.prototype=new ZmController;
+ZmSearchController.prototype.constructor=ZmSearchController;
+ZmSearchController.QUERY_ISREMOTE="is:remote OR is:local";
+ZmSearchController.prototype.toString=function(){
+return"ZmSearchController"
+};
+ZmSearchController.prototype.getSearchPanel=function(){
+return this._searchPanel
+};
+ZmSearchController.prototype.getSearchToolbar=function(){
+return this._searchToolBar
+};
+ZmSearchController.prototype.dateSearch=function(s,e){
+s=s||new Date();
+var o=AjxDateFormat.getDateInstance(AjxDateFormat.SHORT);
+var a=o.format(s);
+var t=appCtxt.getApp(ZmApp.MAIL).getGroupMailBy();
+var n="date:"+a;
+this.search({
+query:n,types:[t],searchFor:e}
+)
+};
+ZmSearchController.prototype.fromSearch=function(e){
+var t=appCtxt.getApp(ZmApp.MAIL).getGroupMailBy();
+var o=e instanceof Array?e.concat():[e];
+for(var a=0;
+a<o.length;
+a++){
+o[a]=["from:(",o[a],")"].join("")
+}
+this.search({
+query:o.join(" OR "),types:[t]}
+)
+};
+ZmSearchController.prototype.fromBrowse=function(t){
+var e=new AjxCallback(this,this._handleLoadFromBrowse,[t]);
+this.showBrowseView(true,e)
+};
+ZmSearchController.prototype.showBrowsePickers=function(a,e){
+e=(!e||e==null)?true:e;
+this.showBrowseView(true,null);
+if(a instanceof Array){
+this._browseViewController.removeAllPickers();
+if(e){
+this._browseViewController.addPicker(ZmPicker.BASIC)
+}
+for(var t=0;
+t<a.length;
+t++){
+this._browseViewController.addPicker(a[t])
+}}};
+ZmSearchController.prototype._handleLoadFromBrowse=function(a,e){
+this.setDefaultSearchType(ZmId.SEARCH_MAIL);
+e.removeAllPickers();
+this._browseViewController.removeAllPickers();
+var t=this._browseViewController.addPicker(ZmPicker.BASIC);
+t.setFrom(a);
+t.execute()
+};
+ZmSearchController.prototype.showBrowseView=function(t,o){
+if(!this._browseViewController){
+var e=new AjxCallback(this,this._handleLoadShowBrowseView,[o]);
+AjxDispatcher.require("Browse",false,e,null,false)
+}else{
+var a=this._browseViewController;
+a.setBrowseViewVisible(t||!a.getBrowseViewVisible());
+if(o){
+o.run(a.getBrowseView())
+}}};
+ZmSearchController.prototype._handleLoadShowBrowseView=function(t){
+var e=this._browseViewController=new ZmBrowseController(this._searchPanel);
+e.setBrowseViewVisible(true);
+if(t){
+t.run(e.getBrowseView())
+}};
+ZmSearchController.prototype.getBrowseView=function(){
+return(this._browseViewController&&this._browseViewController.getBrowseView())
+};
+ZmSearchController.prototype.setSearchField=function(e){
+if(appCtxt.get(ZmSetting.SHOW_SEARCH_STRING)&&this._searchToolBar){
+this._searchToolBar.setSearchFieldValue(e)
+}else{
+this._currentQuery=e
+}};
+ZmSearchController.prototype.getSearchFieldValue=function(){
+return this._searchToolBar?this._searchToolBar.getSearchFieldValue():""
+};
+ZmSearchController.prototype.setEnabled=function(e){
+if(this._searchToolBar){
+this._searchToolBar.setEnabled(e)
+}};
+ZmSearchController.prototype.setDefaultSearchType=function(e){
+if(this._searchToolBar&&!appCtxt.inStartup){
+var t=this._searchToolBar.getButton(ZmSearchToolBar.SEARCH_MENU_BUTTON).getMenu();
+t.checkItem(ZmSearchToolBar.MENUITEM_ID,e);
+this._searchMenuListener(null,e)
+}};
+ZmSearchController.prototype._setView=function(){
+this._searchPanel=new DwtComposite({
+parent:this._container,className:"SearchPanel",posStyle:Dwt.ABSOLUTE_STYLE}
+);
+this._searchToolBar=new ZmSearchToolBar(this._searchPanel,ZmId.SEARCH_TOOLBAR);
+this._createTabGroup().addMember(this._searchToolBar.getSearchField());
+this._searchToolBar.registerCallback(this._searchFieldCallback,this);
+this._searchToolBar.addSelectionListener(ZmSearchToolBar.SEARCH_BUTTON,new AjxListener(this,this._searchButtonListener));
+if(appCtxt.get(ZmSetting.BROWSE_ENABLED)){
+this._searchToolBar.addSelectionListener(ZmSearchToolBar.BROWSE_BUTTON,new AjxListener(this,this._browseButtonListener))
+}
+if(appCtxt.get(ZmSetting.SAVED_SEARCHES_ENABLED)){
+this._searchToolBar.addSelectionListener(ZmSearchToolBar.SAVE_BUTTON,new AjxListener(this,this._saveButtonListener))
+}};
+ZmSearchController.prototype._addMenuListeners=function(s){
+var a=new AjxListener(this,this._searchMenuListener);
+var t=s.getItems();
+for(var o=0;
+o<t.length;
+o++){
+var n=t[o];
+n.addSelectionListener(a);
+var e=n.getData(ZmSearchToolBar.MENUITEM_ID);
+if(e==ZmId.SEARCH_MAIL){
+n.setChecked(true,true)
+}}};
+ZmSearchController.prototype.search=function(e){
+if(e.searchFor!=ZmItem.APPT&&(!e.query&&!e.queryHint)){
+return
+}
+if(e.query&&(e.query.indexOf("$set:")==0||e.query.indexOf("$cmd:")==0)){
+appCtxt.getClientCmdHandler().execute((e.query.substr(5)),this);
+return
+}
+e.searchAllAccounts=this.searchAllAccounts;
+var t=new AjxCallback(this,this._handleResponseSearch,[e.callback]);
+this._doSearch(e,e.noRender,t,e.errorCallback)
+};
+ZmSearchController.prototype._handleResponseSearch=function(t,e){
+if(t){
+t.run(e)
+}};
+ZmSearchController.prototype.redoSearch=function(o,e,n,r,t){
+var s={};
+s.query=o.query;
+s.queryHint=o.queryHint;
+s.types=o.types;
+s.sortBy=o.sortBy;
+s.offset=o.offset;
+s.limit=o.limit;
+s.prevId=o.prevId;
+s.prevSortBy=o.prevSortBy;
+s.fetch=o.fetch;
+s.searchId=o.searchId;
+s.lastSortVal=o.lastSortVal;
+s.endSortVal=o.endSortVal;
+s.lastId=o.lastId;
+s.soapInfo=o.soapInfo;
+s.accountName=o.accountName;
+s.searchFor=this._searchFor;
+if(n){
+for(var a in n){
+s[a]=n[a]
+}}
+this._doSearch(s,e,r,t)
+};
+ZmSearchController.prototype.resetSearchAllAccounts=function(){
+var e=this.searchAllAccounts&&this._searchToolBar.getButton(ZmSearchToolBar.SEARCH_MENU_BUTTON);
+var n=e&&e.getMenu();
+var o=n&&n.getItemById(ZmSearchToolBar.MENUITEM_ID,ZmId.SEARCH_ALL_ACCOUNTS);
+if(o){
+o.setChecked(false,true);
+var a=n.getSelectedItem();
+var t=this._inclSharedItems?this._getSharedImage(a):a.getImage();
+e.setImage(t);
+this.searchAllAccounts=false
+}};
+ZmSearchController.prototype.resetSearchToolbar=function(){
+var e=this._searchToolBar.getButton(ZmSearchToolBar.SEARCH_MENU_BUTTON);
+var t=e?e.getMenu().getItemById(ZmSearchToolBar.MENUITEM_ID,ZmId.SEARCH_GAL):null;
+if(t){
+t.setVisible(appCtxt.getActiveAccount().isZimbraAccount)
+}};
+ZmSearchController.prototype.getTypes=function(o){
+var a=new AjxVector();
+var e=o.searchFor||this._searchFor;
+var t;
+if((e==ZmId.SEARCH_MAIL||e==ZmId.SEARCH_ANY)&&appCtxt.get(ZmSetting.MAIL_ENABLED)){
+t=appCtxt.getApp(ZmApp.MAIL).getGroupMailBy()
+}
+if(e==ZmId.SEARCH_MAIL){
+a.add(t)
+}else{
+if(e==ZmId.SEARCH_ANY){
+if(appCtxt.get(ZmSetting.MAIL_ENABLED)&&t){
+a.add(t)
+}
+if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)){
+a.add(ZmItem.CONTACT)
+}
+if(appCtxt.get(ZmSetting.CALENDAR_ENABLED)){
+a.add(ZmItem.APPT)
+}
+if(appCtxt.get(ZmSetting.TASKS_ENABLED)){
+a.add(ZmItem.TASK)
+}
+if(appCtxt.get(ZmSetting.NOTEBOOK_ENABLED)){
+a.add(ZmItem.PAGE)
+}
+if(appCtxt.get(ZmSetting.BRIEFCASE_ENABLED)){
+a.add(ZmItem.BRIEFCASE)
+}}else{
+a.add(e);
+if(e==ZmItem.PAGE){
+a.add(ZmItem.DOCUMENT)
+}}}
+return a
+};
+ZmSearchController.prototype.updateOverview=function(e){
+var t=e||appCtxt.getCurrentSearch();
+var h,a;
+if(t){
+if(t.folderId){
+h=this._getNormalizedId(t.folderId);
+var n=appCtxt.getFolderTree();
+var o=n&&n.getById(h);
+a=o?o.type:ZmOrganizer.FOLDER
+}else{
+if(t.tagId){
+h=this._getNormalizedId(t.tagId);
+a=ZmOrganizer.TAG
+}else{
+if(t.searchId){
+h=this._getNormalizedId(t.searchId);
+a=ZmOrganizer.SEARCH
+}}}
+var r=appCtxt.getCurrentApp();
+var s=r&&r.getOverview();
+if(s){
+s.setSelected(h,a)
+}}};
+ZmSearchController.prototype._getSuitableSortBy=function(t){
+var o;
+if(t.size()==1){
+var a=t.get(0);
+var e;
+switch(a){
+case ZmItem.CONV:e=ZmId.VIEW_CONVLIST;
+break;
+case ZmItem.MSG:e=ZmId.VIEW_TRAD;
+break;
+case ZmItem.CONTACT:e=ZmId.VIEW_CONTACT_SIMPLE;
+break;
+case ZmItem.APPT:e=ZmId.VIEW_CAL;
+break;
+case ZmItem.TASK:e=ZmId.VIEW_TASKLIST;
+break;
+case ZmId.SEARCH_GAL:e=ZmId.VIEW_CONTACT_SIMPLE;
+break
+}
+if(e){
+o=appCtxt.get(ZmSetting.SORTING_PREF,e)
+}}
+return o
+};
+ZmSearchController.prototype._doSearch=function(a,d,u,s){
+var e=this._searchFor=a.searchFor||this._searchFor;
+appCtxt.notifyZimlets("onSearch",[a.query]);
+if(this._searchToolBar){
+var c=(appCtxt.get(ZmSetting.SHOW_SEARCH_STRING)||a.userText)?a.query:null;
+this._searchToolBar.setSearchFieldValue(c||"");
+if(appCtxt.multiAccounts&&a.userText&&this.searchAllAccounts){
+appCtxt.getCurrentApp().getOverviewContainer().deselectAll()
+}}
+var r=a.types||this.getTypes(a);
+if(r instanceof Array){
+r=AjxVector.fromArray(r)
+}
+if(e==ZmId.SEARCH_MAIL){
+a=appCtxt.getApp(ZmApp.MAIL).getSearchParams(a)
+}
+if(e==ZmItem.TASK){
+var o=AjxDispatcher.run("GetTaskListController");
+a.allowableTaskStatus=(o)?o.getAllowableTaskStatus():null
+}
+var l=(e==ZmId.SEARCH_ANY);
+if(a.searchAllAccounts&&!a.queryHint){
+a.queryHint=appCtxt.accountList.generateQuery(null,r);
+a.accountName=appCtxt.accountList.mainAccount.name
+}else{
+if(this._inclSharedItems){
+a.queryHint=l?ZmSearchController.QUERY_ISREMOTE:ZmSearchController.generateQueryForShares(r.getArray())
+}}
+a.contactSource=(r.contains(ZmItem.CONTACT)||r.contains(ZmId.SEARCH_GAL))?this._contactSource:null;
+a.sortBy=a.sortBy||this._getSuitableSortBy(r);
+a.types=r;
+var f=new ZmSearch(a);
+var t=appCtxt.isOffline&&appCtxt.getById(f.folderId);
+if(t&&(t.nId==ZmFolder.ID_DRAFTS||t.nId==ZmFolder.ID_OUTBOX)){
+this.searchAllAccounts=true;
+f.accountName=appCtxt.accountList.mainAccount.name;
+f.query="";
+f.folderId=t.nId;
+f.queryHint=appCtxt.accountList.generateQuery(t.nId)
+}
+var h=[f,d,l,u,a.noUpdateOverview];
+var m=new AjxCallback(this,this._handleResponseDoSearch,h);
+if(!s){
+s=new AjxCallback(this,this._handleErrorDoSearch,[f,l])
+}
+if(e==ZmItem.APPT){
+var n=AjxDispatcher.run("GetCalController");
+if(n&&r.contains(ZmItem.APPT)){
+n.handleUserSearch(a,m)
+}else{
+f.execute({
+callback:m,errorCallback:s}
+)
+}}else{
+f.execute({
+callback:m,errorCallback:s}
+)
+}};
+ZmSearchController.prototype._handleResponseDoSearch=function(o,t,n,r,s,e){
+if(this._searchFor==ZmItem.APPT){
+this._results=new ZmSearchResult(o);
+return
+}
+var a=e.getResponse();
+this.currentSearch=o;
+if(!a.type){
+a.type=o.types.get(0)
+}
+if(!t){
+this._showResults(a,o,n,s)
+}
+if(r){
+r.run(e)
+}};
+ZmSearchController.prototype._showResults=function(o,l,h,e){
+if(this._results&&(this._results.type==o.type)&&this._results.dtor){
+this._results.dtor()
+}
+this._results=o;
+var t=(this._contactSource==ZmId.SEARCH_GAL);
+if(appCtxt.get(ZmSetting.SAVED_SEARCHES_ENABLED)){
+var r=this._searchToolBar&&this._searchToolBar.getButton(ZmSearchToolBar.SAVE_BUTTON);
+if(r){
+r.setEnabled(!t)
+}}
+var s=h?ZmItem.MIXED:o.type;
+var n=new AjxCallback(this,this._handleLoadShowResults,[o,l,e]);
+var a=appCtxt.getApp(ZmItem.APP[s]);
+a.currentSearch=l;
+a.currentQuery=l.query;
+a.showSearchResults(o,n,t,l.folderId)
+};
+ZmSearchController.prototype._handleLoadShowResults=function(t,e,a){
+appCtxt.setCurrentList(t.getResults(t.type));
+if(!a){
+this.updateOverview(e)
+}};
+ZmSearchController.prototype._handleErrorDoSearch=function(a,o,t){
+if(t.code==ZmCsfeException.MAIL_NO_SUCH_TAG||t.code==ZmCsfeException.MAIL_QUERY_PARSE_ERROR||t.code==ZmCsfeException.MAIL_TOO_MANY_TERMS||(t.code==ZmCsfeException.MAIL_NO_SUCH_FOLDER&&!(t.data.itemId&&t.data.itemId.length))){
+var n=t.getErrorMsg();
+appCtxt.setStatusMsg(n,ZmStatusView.LEVEL_WARNING);
+var e=new ZmSearchResult(a);
+e.type=a.types?a.types.get(0):null;
+this._showResults(e,a,o);
+return true
+}
+return false
+};
+ZmSearchController.generateQueryForShares=function(r,s){
+var d=window.parentAppCtxt||window.appCtxt;
+var h=[];
+for(var o=0;
+o<r.length;
+o++){
+var l=r[o];
+var a=d.getApp(ZmItem.APP[l]);
+if(a){
+var e=a.getRemoteFolderIds(s);
+for(var n=0;
+n<e.length;
+n++){
+var t=e[n];
+var c=AjxUtil.isNumeric(t)?t:['"',t,'"'].join("");
+h.push("inid:"+c)
+}}}
+if(h.length>0){
+h.push("is:local");
+return h.join(" OR ")
+}
+return null
+};
+ZmSearchController.prototype._searchFieldCallback=function(t){
+var e=appCtxt.get(ZmSetting.VIEW_AS_HTML);
+this.search({
+query:t,userText:true,getHtml:e}
+)
+};
+ZmSearchController.prototype._searchButtonListener=function(o){
+var a=this._searchToolBar.getButton(ZmSearchToolBar.SEARCH_MENU_BUTTON);
+var r=a&&a.getMenu();
+var t=r&&r.getSelectedItem();
+var n=t&&t.getData("CustomSearchItem");
+if(n){
+n[2].run(o)
+}else{
+var h=this._searchToolBar.getSearchFieldValue();
+var e=(h.length>0);
+if(h){
+this._currentQuery=null
+}else{
+h=this._currentQuery?this._currentQuery:""
+}
+appCtxt.notifyZimlets("onSearchButtonClick",[h]);
+var s=appCtxt.get(ZmSetting.VIEW_AS_HTML);
+this.search({
+query:h,userText:e,getHtml:s}
+)
+}};
+ZmSearchController.prototype._browseButtonListener=function(e){
+this.showBrowseView()
+};
+ZmSearchController.prototype._saveButtonListener=function(t){
+var e=appCtxt.getOverviewController().getTreeController(ZmOrganizer.SEARCH);
+if(!e._newCb){
+e._newCb=new AjxCallback(e,e._newCallback)
+}
+var a={
+search:this._results&&this._results.search,showOverview:(this._searchFor==ZmId.SEARCH_MAIL)};
+ZmController.showDialog(e._getNewDialog(),e._newCb,a)
+};
+ZmSearchController.prototype._searchMenuListener=function(r,e){
+var o=this._searchToolBar.getButton(ZmSearchToolBar.SEARCH_MENU_BUTTON);
+if(!o){
+return
+}
+var t=o.getMenu();
+var l=r?r.item:(t.getItemById(ZmSearchToolBar.MENUITEM_ID,e));
+if(!l||(!!(l._style&DwtMenuItem.SEPARATOR_STYLE))){
+return
+}
+e=l.getData(ZmSearchToolBar.MENUITEM_ID);
+var a=t.getSelectedItem();
+var u=t.getItemById(ZmSearchToolBar.MENUITEM_ID,ZmId.SEARCH_SHARED);
+if(e==ZmId.SEARCH_GAL){
+this._contactSource=ZmId.SEARCH_GAL;
+if(u){
+u.setChecked(false,true);
+u.setEnabled(false)
+}}else{
+if(u){
+if(e==ZmItem.APPT||e==ZmId.SEARCH_CUSTOM){
+u.setChecked(false,true);
+u.setEnabled(false)
+}else{
+u.setEnabled(true)
+}}
+this._contactSource=ZmItem.CONTACT
+}
+this._inclSharedItems=u&&u.getChecked();
+var n=t.getItemById(ZmSearchToolBar.MENUITEM_ID,ZmId.SEARCH_ALL_ACCOUNTS);
+if(n){
+if(e==ZmItem.APPT){
+this.resetSearchAllAccounts();
+n.setEnabled(false)
+}else{
+n.setEnabled(true);
+this.searchAllAccounts=n&&n.getChecked()
+}}
+if(e==ZmId.SEARCH_SHARED){
+var s=this.searchAllAccounts?n.getImage():a.getImage();
+if(this._inclSharedItems){
+var d=a&&a.getData(ZmSearchToolBar.MENUITEM_ID);
+s=d?((ZmSearchToolBar.SHARE_ICON[d])||l.getImage()):l.getImage()
+}
+o.setImage(s)
+}else{
+if(e==ZmId.SEARCH_ALL_ACCOUNTS){
+var s=(this.searchAllAccounts&&!this._inclSharedItems)?l.getImage():(this._inclSharedItems)?this._getSharedImage(a):a.getImage();
+o.setImage(s)
+}else{
+this._searchFor=e;
+var s=l.getImage();
+if(this._inclSharedItems){
+s=this._getSharedImage(a)
+}else{
+if(this.searchAllAccounts){
+s=n.getImage()
+}}
+o.setImage(s);
+o.setText(l.getText())
+}}
+var c=ZmMsg[ZmSearchToolBar.TT_MSG_KEY[e]];
+if(e==ZmId.SEARCH_MAIL){
+var h=appCtxt.getApp(ZmApp.MAIL).getGroupMailBy();
+c=ZmMsg[ZmSearchToolBar.TT_MSG_KEY[h]]
+}
+o.setToolTipContent(c)
+};
+ZmSearchController.prototype._getSharedImage=function(e){
+var t=e&&e.getData(ZmSearchToolBar.MENUITEM_ID);
+return(t&&ZmSearchToolBar.SHARE_ICON[t])?ZmSearchToolBar.SHARE_ICON[t]:ZmSearchToolBar.ICON[ZmId.SEARCH_SHARED]
+};
+ZmSearchController.prototype._getNormalizedId=function(a){
+var t=a;
+var e=appCtxt.getActiveAccount();
+if(!e.isMain&&a.indexOf(":")==-1){
+t=e.id+":"+a
+}
+return t
+}
+}
+if(AjxPackage.define("zimbraMail.im.model.ZmRoster")){
+ZmRoster=function(e){
+ZmModel.call(this,ZmEvent.S_ROSTER);
+this._gateways={
+byService:{}
+,byDomain:{}
+,array:[]};
+this._notificationBuffer=[];
+this._imApp=e
+};
+ZmRoster.prototype=new ZmModel;
+ZmRoster.prototype.constructor=ZmRoster;
+ZmRoster.F_PRESENCE="ZmRoster.presence";
+ZmRoster.NOTIFICATION_FOO_TIMEOUT=10000;
+ZmRoster.GATEWAY_EVENT="gateway list";
+ZmRoster.prototype.toString=function(){
+return"ZmRoster"
+};
+ZmRoster.prototype.getPrivacyList=function(){
+return this._privacyList=this._privacyList||new ZmImPrivacyList(this)
+};
+ZmRoster.prototype.getChatList=function(){
+if(!this._chatList){
+this._chatList=new ZmChatList(this)
+}
+return this._chatList
+};
+ZmRoster.prototype.getMyAddress=function(){
+return ZmImApp.INSTANCE.getService().getMyAddress()
+};
+ZmRoster.prototype.getRosterItem=function(a,e){
+if(!a){
+return null
+}
+a=a.toLowerCase();
+var t=this.getRosterItemList().getByAddr(a);
+if(t){
+return t
+}
+if(e){
+a=ZmImAddress.parse(a);
+t=a?this.getRosterItemList().getByAddr(a.screenName):null;
+if(t){
+return t
+}
+if(a){
+a=this.makeServerAddress(a.screenName,a.service);
+if(a){
+return this.getRosterItemList().getByAddr(a)
+}}}};
+ZmRoster.prototype.getRosterItemList=function(){
+if(!this._rosterItemList){
+this._rosterItemList=new ZmRosterItemList()
+}
+return this._rosterItemList
+};
+ZmRoster.prototype.getPresence=function(){
+if(!this._rosterPresence){
+this._rosterPresence=new ZmRosterPresence()
+}
+return this._rosterPresence
+};
+ZmRoster.prototype.notifyPresence=function(){
+var e={};
+e[ZmRoster.F_PRESENCE]=this.getPresence();
+this._notify(ZmEvent.E_MODIFY,{
+fields:e}
+)
+};
+ZmRoster.prototype.reload=function(t){
+this.getRosterItemList().removeAllItems();
+var a=new AjxCallback(this,this._handleResponseReload);
+var e={
+asyncMode:true,noBusyOverlay:t};
+ZmImApp.INSTANCE.getService().getRoster(a,e)
+};
+ZmRoster.prototype._handleResponseReload=function(r){
+if(!r){
+return
+}
+var s=this.getRosterItemList();
+if(r.items&&r.items.item){
+var t=r.items.item;
+if(t.length){
+var e=new Array(t.length);
+for(var a=0;
+a<t.length;
+a++){
+var n=t[a];
+if(n.subscription=="TO"||n.subscription=="BOTH"){
+var o=new ZmRosterPresence();
+o.setFromJS(n.presence);
+e[a]=new ZmRosterItem(n.addr,s,n.name,o,n.groups)
+}}
+s.addItems(e)
+}}
+if(r.presence){
+if(/XA|AWAY/.test(r.presence.show)){
+r.presence.show="ONLINE";
+this.setPresence("ONLINE")
+}
+this.getPresence().setFromJS(r.presence);
+this.notifyPresence()
+}
+ZmImApp.INSTANCE.getService().startIgnoreNotify()
+};
+ZmRoster.prototype.createRosterItem=function(a,t,e){
+ZmImApp.INSTANCE.getService().createRosterItem(a,t,e)
+};
+ZmRoster.prototype.setPresence=function(e,t,a,o){
+ZmImApp.INSTANCE.getService().setPresence(e,t,a,o);
+ZmImApp.INSTANCE.getService().startIgnoreNotify()
+};
+ZmRoster.prototype.pushNotification=function(e){
+if(!this._gateways){
+this._notificationBuffer.push(e)
+}else{
+this.handleNotification(e)
+}};
+ZmRoster.prototype.refresh=function(){
+this._requestGateways(new AjxCallback(this,this.reload))
+};
+ZmRoster.prototype.handleNotification=function(e){
+ZmImApp.INSTANCE.getService().handleNotification(e)
+};
+ZmRoster.prototype.getConferenceTree=function(){
+AjxDispatcher.require(["IMConference"]);
+if(!this._conferenceTree){
+this._conferenceTree=new ZmTree(ZmOrganizer.CONFERENCE_ITEM);
+this._conferenceTree.root=new ZmOrganizer({
+tree:this._conferenceTree}
+)
+}
+return this._conferenceTree
+};
+ZmRoster.prototype.getConferenceServices=function(o,a){
+var e=this.getConferenceTree();
+if(!e.root.children.size()||a){
+var t=new AjxCallback(this,this._handleResponceGetConferenceServices,[o]);
+ZmImApp.INSTANCE.getService().getConferenceServices(t)
+}else{
+o.run(e.root.children.getArray())
+}};
+ZmRoster.prototype._handleResponceGetConferenceServices=function(h,s){
+var t=this.getConferenceTree();
+var a=t.root;
+for(var n=0,r=s.length;
+n<r;
+n++){
+var o={
+id:s[n].addr,tree:t,name:s[n].name,parent:a};
+var e=new ZmConferenceService(o);
+a.children.add(e)
+}
+h.run(a.children.getArray())
+};
+ZmRoster.prototype.joinChatRequest=function(e,o){
+var t=AjxSoapDoc.create("IMJoinConferenceRoomRequest","urn:zimbraIM");
+var a=t.getMethod();
+a.setAttribute("thread",e);
+a.setAttribute("addr",o);
+appCtxt.getAppController().sendRequest({
+soapDoc:t,asyncMode:true}
+)
+};
+ZmRoster.prototype.sendSubscribeAuthorization=function(e,t,a){
+ZmImApp.INSTANCE.getService().sendSubscribeAuthorization(e,t,a)
+};
+ZmRoster.prototype.addGatewayListListener=function(e){
+this._evtMgr.addListener(ZmRoster.GATEWAY_EVENT,e)
+};
+ZmRoster.prototype.reconnectGateway=function(e){
+ZmImApp.INSTANCE.getService().reconnectGateway(e);
+ZmImApp.INSTANCE.getService().startIgnoreNotify()
+};
+ZmRoster.prototype.unregisterGateway=function(e,t){
+ZmImApp.INSTANCE.getService().unregisterGateway(e,t);
+ZmImApp.INSTANCE.getService().startIgnoreNotify()
+};
+ZmRoster.prototype.registerGateway=function(e,o,a,t){
+ZmImApp.INSTANCE.getService().registerGateway(e,o,a,t);
+ZmImApp.INSTANCE.getService().startIgnoreNotify();
+this.getGatewayByType(e).nick=o
+};
+ZmRoster.prototype._requestGateways=function(e){
+ZmImApp.INSTANCE.getService().getGateways(new AjxCallback(this,this._handleRequestGateways,[e]))
+};
+ZmRoster.prototype._handleRequestGateways=function(s,n){
+var a={};
+var e={};
+for(var t=0;
+t<n.length;
+++t){
+var o=n[t]=new ZmImGateway(n[t]);
+a[n[t].type.toLowerCase()]=o;
+e[n[t].domain.toLowerCase()]=o
+}
+this._gateways={
+byService:a,byDomain:e,array:n};
+for(var t=0;
+t<this._notificationBuffer.length;
+++t){
+this.handleNotification(this._notificationBuffer[t])
+}
+this._notificationBuffer=[];
+this._evtMgr.notifyListeners(ZmRoster.GATEWAY_EVENT,{
+roster:this}
+);
+if(s){
+s.run()
+}};
+ZmRoster.prototype.getGatewayByType=function(e){
+return this._gateways.byService[e.toLowerCase()]
+};
+ZmRoster.prototype.getGatewayByDomain=function(e){
+return this._gateways.byDomain[e.toLowerCase()]
+};
+ZmRoster.prototype.getGateways=function(){
+return this._gateways.array
+};
+ZmRoster.prototype.makeServerAddress=function(t,e){
+return ZmImApp.INSTANCE.getService().makeServerAddress(t,e)
+};
+ZmRoster.prototype.makeGenericAddress=function(e){
+e=this.breakDownAddress(e);
+if(e.type.toLowerCase()=="xmpp"){
+e.type="local"
+}
+return ZmImAddress.make(e.type,e.addr)
+};
+ZmRoster.prototype.breakDownAddress=function(o){
+var t=/@(.*)$/;
+var e=t.exec(o);
+if(e){
+var a=this.getGatewayByDomain(e[1]);
+if(a){
+return{
+type:a.type,addr:o.substr(0,e.index),gateway:a}
+}}
+return{
+type:"XMPP",addr:o}
+};
+ZmRoster.prototype.getGroups=function(){
+return AjxVector.fromArray(this.getRosterItemList().getGroupsArray())
+};
+ZmRoster.prototype.setIdle=function(e){
+if(ZmImApp.INSTANCE.getService().isLoggedIn()){
+ZmImApp.INSTANCE.getService().setIdle(e,this._idleTimer.timeout)
+}};
+ZmRoster.prototype.onServiceAddChatMessage=function(e){
+appCtxt.getApp(ZmApp.IM).prepareVisuals();
+var o=this.getRosterItem(e.from);
+if(o){
+o._notifyTyping(false)
+}
+var a=this.getChatList();
+var t=a.getChatByThread(e.thread);
+if(t==null){
+if(!e.fromMe){
+t=a.getChatByRosterAddr(e.from,true,true)
+}else{
+t=a.getChatByRosterAddr(e.to,false)
+}
+if(t){
+t.setThread(e.thread)
+}}
+if(t){
+if(!e.fromMe){
+if(appCtxt.get(ZmSetting.IM_PREF_FLASH_BROWSER)){
+AjxDispatcher.require("Alert");
+ZmBrowserAlert.getInstance().start(ZmMsg.newInstantMessage)
+}
+if(appCtxt.get(ZmSetting.IM_PREF_DESKTOP_ALERT)){
+AjxDispatcher.require("Alert");
+ZmDesktopAlert.getInstance().start(ZmMsg.newInstantMessage,e.getTextBody())
+}}
+t.addMessage(e)
+}};
+ZmRoster.prototype.onServiceAddBuddy=function(h,o,n,t,a){
+var r=this.getRosterItemList();
+var s=new ZmRosterItem(h,r,o,n,t);
+r.addItem(s);
+if(a){
+this._newRosterItemtoastFormatter=this._newRosterItemtoastFormatter||new AjxMessageFormat(ZmMsg.imNewRosterItemToast);
+var e=this._newRosterItemtoastFormatter.format([s.getDisplayName()]);
+ZmTaskbarController.INSTANCE.setMessage(e)
+}};
+ZmRoster.prototype.onServiceRemoveBuddy=function(n,t){
+var o=this.getRosterItemList();
+var a=o.getByAddr(n);
+if(a){
+var e=a.getDisplayName();
+o.removeItem(a);
+if(t){
+this._removeRosterItemToastFormatter=this._removeRosterItemToastFormatter||new AjxMessageFormat(ZmMsg.imRemoveRosterItemToast);
+ZmTaskbarController.INSTANCE.setMessage(this._removeRosterItemToastFormatter.format([e]))
+}}};
+ZmRoster.prototype.onServiceRequestBuddyAuth=function(t){
+var e=this.getRosterItem(t);
+ZmTaskbarController.INSTANCE.showSubscribeRequest(t,e)
+};
+ZmRoster.prototype.onServiceSetBuddyPresence=function(s,r,o){
+var n=s.getPresence().getShow();
+if(s.getPresence().setFromJS(r)){
+s._notifyPresence();
+if(n!=ZmRosterPresence.SHOW_UNKNOWN){
+this._presenceToastFormatter=this._presenceToastFormatter||new AjxMessageFormat(ZmMsg.imStatusToast);
+var t=this._presenceToastFormatter.format([s.getDisplayName(),AjxStringUtil.htmlEncode(s.getPresence().getShowText())]);
+var e=n==s.getPresence().getShow();
+if(o&&((!e&&appCtxt.get(ZmSetting.IM_PREF_NOTIFY_PRESENCE))||(e&&appCtxt.get(ZmSetting.IM_PREF_NOTIFY_STATUS)))){
+ZmTaskbarController.INSTANCE.setMessage(t);
+var a=this.getChatList().getChatByRosterAddr(r.from);
+if(a){
+a.addMessage(ZmChatMessage.system(t))
+}}}}};
+ZmRoster.prototype.onServiceLoggedIn=function(t){
+if(!this._idleTimer){
+this._idleTimer=new DwtIdleTimer(appCtxt.get(ZmSetting.IM_PREF_IDLE_TIMEOUT)*60*1000,new AjxCallback(this,this.setIdle));
+if(!appCtxt.get(ZmSetting.IM_PREF_REPORT_IDLE)){
+this._idleTimer.kill()
+}}
+this._notify(ZmEvent.E_LOAD,{
+loggedIn:true}
+);
+var a=new AjxCallback(this,this._loggedInGatewayCallback,[t]);
+var e={
+asyncMode:true,noBusyOverlay:true};
+ZmImApp.INSTANCE.getService().getGateways(a,e)
+};
+ZmRoster.prototype._loggedInGatewayCallback=function(e,t){
+this._handleRequestGateways(null,t);
+ZmImApp.INSTANCE.getService().initializePresence(e?e.presence:null);
+this.reload();
+if(e&&e.callback){
+e.callback.run(this)
+}};
+ZmRoster.prototype.onServiceLoggedOut=function(){
+if(this.getPresence().setFromJS({
+show:ZmRosterPresence.SHOW_OFFLINE}
+)){
+this.notifyPresence()
+}
+this.getRosterItemList().removeAllItems();
+this._notify(ZmEvent.E_LOAD,{
+loggedIn:false}
+)
+};
+ZmRosterTreeGroups=function(e){
+this._groups=e.getGroups()
+};
+ZmRosterTreeGroups.prototype.constructor=ZmRosterTreeGroups;
+ZmRosterTreeGroups.prototype.autocompleteMatch=function(r,h){
+r=r.toLowerCase();
+var e=[];
+var t=this._groups;
+var s=t.size();
+for(var o=0;
+o<s;
+o++){
+var n=t.get(o);
+if(n.toLowerCase().indexOf(r)==0){
+e.push({
+data:n,text:n}
+)
+}}
+h.run(e)
+};
+ZmRosterTreeGroups.prototype.isUniqueValue=function(e){
+return false
+};
+ZmRosterTreeGroups.prototype.getArray=function(){
+return this._groups
+}
+}
+if(AjxPackage.define("zimbraMail.im.view.ZmImOverview")){
+ZmImOverview=function(e,a){
+if(!a){
+a={}
+}
+var t={
+parent:e,parentElement:a.parentElement,className:"ZmImOverview",posStyle:a.posStyle||Dwt.ABSOLUTE_STYLE};
+DwtComposite.call(this,t);
+this._groupItems={};
+this._itemsById={};
+delete a.parentElement;
+this._options=a;
+this._sortBy=appCtxt.get("IM_PREF_BUDDY_SORT");
+this._actionMenuOps={
+root:[ZmOperation.NEW_ROSTER_ITEM,ZmOperation.NEW_ROSTER_GROUP,ZmOperation.SEP,ZmOperation.IM_TOGGLE_OFFLINE,ZmOperation.IM_TOGGLE_BLOCKED,ZmOperation.SEP,ZmOperation.IM_SORT_BY_PRESENCE,ZmOperation.IM_SORT_BY_NAME],buddy:[ZmOperation.IM_NEW_CHAT,ZmOperation.IM_BUDDY_ARCHIVE,ZmOperation.SEP,ZmOperation.EDIT_PROPS,ZmOperation.DELETE,ZmOperation.SEP,ZmOperation.IM_CREATE_CONTACT,ZmOperation.IM_ADD_TO_CONTACT,ZmOperation.IM_EDIT_CONTACT],assistant:[ZmOperation.IM_NEW_CHAT],group:[ZmOperation.NEW_ROSTER_ITEM,ZmOperation.IM_DELETE_GROUP]};
+this._actionMenuPopdownListener=new AjxListener(this,this._actionMenuPopdownListener);
+this._im_dragSrc=new DwtDragSource(Dwt.DND_DROP_MOVE);
+this._im_dragSrc.addDragListener(new AjxListener(this,this._dragListener));
+this.__filters=[];
+this.__filterOffline=appCtxt.get(ZmSetting.IM_PREF_HIDE_OFFLINE);
+if(this.__filterOffline){
+this.__filters.push(ZmImOverview.FILTER_OFFLINE_BUDDIES)
+}
+this.__filterBlocked=appCtxt.get(ZmSetting.IM_PREF_HIDE_BLOCKED);
+if(this.__filterBlocked){
+this.__filters.push(ZmImOverview.FILTER_BLOCKED_BUDDIES)
+}
+this._modelListeners=[];
+this._init()
+};
+ZmImOverview.prototype=new DwtComposite;
+ZmImOverview.prototype.constructor=ZmImOverview;
+ZmImOverview.prototype.toString=function(){
+return"ZmImOverview"
+};
+ZmImOverview.NO_MESSAGE=0;
+ZmImOverview.NOT_LOGGED_IN=1;
+ZmImOverview.LOADING=2;
+ZmImOverview.NO_BUDDIES=3;
+ZmImOverview.prototype.dispose=function(){
+for(var e in this._actionMenuOps){
+var n=this._actionMenuOps[e]._dwtControl;
+if(n){
+n.dispose()
+}}
+for(var t=0,a=this._modelListeners.length;
+t<a;
+t++){
+var o=this._modelListeners[t];
+o.modelObject.removeChangeListener(o.listener)
+}
+DwtComposite.prototype.dispose.call(this)
+};
+ZmImOverview.prototype.getTree=function(){
+return this._tree
+};
+ZmImOverview.prototype._dragListener=function(e){
+var t=e.srcControl.getData("ZmImOverview.data");
+switch(e.action){
+case DwtDragEvent.SET_DATA:if(t.buddy){
+e.srcData=t.buddy;
+e.srcData._drag_from_group=e.srcControl.parent.getData("ZmImOverview.data").group
+}
+break
+}};
+ZmImOverview.prototype._setCheck=function(e,t){
+e.setImage(t?"Check":null)
+};
+ZmImOverview.prototype._setCheckOp=function(a,o,t){
+var e=a.getMenuItem(o);
+if(e){
+this._setCheck(e,t)
+}};
+ZmImOverview.prototype._updateFilter=function(t,e){
+if(e){
+this.addFilter(t)
+}else{
+this.removeFilter(t)
+}};
+ZmImOverview.prototype._newGroupOkCallback=function(a){
+var t;
+if(!a.value){
+t=ZmMsg.nameEmpty
+}else{
+if(this._groupItems[a.value]){
+t=ZmMsg.imGroupExists
+}}
+if(t){
+var e=appCtxt.getMsgDialog();
+e.reset();
+e.setMessage(t,DwtMessageDialog.CRITICAL_STYLE);
+e.popup()
+}else{
+this._updateSpecialItems(ZmImOverview.NO_MESSAGE);
+this.getGroupItem(a.value).setExpanded(true);
+a.dialog.popdown()
+}};
+ZmImOverview.prototype._actionMenuListener=function(a,o){
+var e=o.item.getData(ZmOperation.KEY_ID);
+switch(e){
+case ZmOperation.IM_SORT_BY_PRESENCE:this.sort(ZmImApp.BUDDY_SORT_PRESENCE,true);
+break;
+case ZmOperation.IM_SORT_BY_NAME:this.sort(ZmImApp.BUDDY_SORT_NAME,true);
+break;
+case ZmOperation.IM_TOGGLE_OFFLINE:this.__filterOffline=!this.__filterOffline;
+appCtxt.getSettings().getSetting(ZmSetting.IM_PREF_HIDE_OFFLINE).setValue(this.__filterOffline);
+this._updateFilter(ZmImOverview.FILTER_OFFLINE_BUDDIES,this.__filterOffline);
+break;
+case ZmOperation.IM_TOGGLE_BLOCKED:this.__filterBlocked=!this.__filterBlocked;
+appCtxt.getSettings().getSetting(ZmSetting.IM_PREF_HIDE_BLOCKED).setValue(this.__filterBlocked);
+this._updateFilter(ZmImOverview.FILTER_BLOCKED_BUDDIES,this.__filterBlocked);
+break;
+case ZmOperation.NEW_ROSTER_GROUP:this._newGroupOkCallbackObj=this._newGroupOkCallbackObj||new AjxCallback(this,this._newGroupOkCallback);
+AjxDispatcher.require(["IM"]);
+var h={
+title:ZmMsg.imCreateNewGroup,label:ZmMsg.imGroupName,callback:this._newGroupOkCallbackObj};
+ZmPromptDialog.getInstance().popup(h);
+break;
+default:var r=appCtxt.getApp("IM").getImController();
+var s=r._listeners[e];
+if(s){
+var t={
+dwtObj:o.dwtObj};
+if(a&&this._actionedItem){
+var n=this._actionedItem.getData("ZmImOverview.data");
+t.type=n.type;
+t.buddy=n.buddy;
+t.group=n.group;
+t.actionedItem=this._actionedItem
+}
+s.handleEvent(t)
+}}};
+ZmImOverview.PRESENCE_SORT_INDEX={
+CHAT:1,ONLINE:2,AWAY:3,XA:4,DND:5,OFFLINE:6,UNKNOWN:7};
+ZmImOverview.CMP_SORT_BY_NAME=function(t,e){
+t=t.getData("ZmImOverview.data").buddy.getDisplayName();
+e=e.getData("ZmImOverview.data").buddy.getDisplayName();
+return t<e?-1:(t>e?1:0)
+};
+ZmImOverview.CMP_SORT_BY_PRESENCE=function(o,t){
+var e=ZmImOverview.PRESENCE_SORT_INDEX[o.getData("ZmImOverview.data").buddy.getPresence().getShow()]||100;
+var n=ZmImOverview.PRESENCE_SORT_INDEX[t.getData("ZmImOverview.data").buddy.getPresence().getShow()]||100;
+if(e==n){
+return ZmImOverview.CMP_SORT_BY_NAME(o,t)
+}
+return e-n
+};
+ZmImOverview.prototype.sort=function(t,e){
+if(t&&(t!=this._sortBy)){
+this._sortBy=t;
+appCtxt.getSettings().getSetting("IM_PREF_BUDDY_SORT").setValue(t)
+}
+if(e){
+if(this._sortActionId){
+AjxTimedAction.cancelAction(this._sortActionId)
+}
+this._doSort()
+}else{
+if(!this._sortActionId){
+this._doSortAction=this._doSortAction||new AjxTimedAction(this,this._doSort);
+this._sortActionId=AjxTimedAction.scheduleAction(this._doSortAction,1000)
+}}};
+ZmImOverview.prototype._doSort=function(){
+this._sortActionId=null;
+var e=this._rootItem;
+var t=e.getItems();
+var n=this._sortBy==ZmImApp.BUDDY_SORT_PRESENCE?ZmImOverview.CMP_SORT_BY_PRESENCE:ZmImOverview.CMP_SORT_BY_NAME;
+for(var a=0;
+a<t.length;
+++a){
+var o=t[a];
+o.sort(n)
+}};
+ZmImOverview.prototype.chatWithBuddy=function(e){
+ZmTaskbarController.INSTANCE.chatWithRosterItem(e);
+ZmImOverview._popdownDialog()
+};
+ZmImOverview.prototype._actionMenuPopdownListener=function(){
+if(this._actionedItem){
+this._actionedItem._setActioned(false)
+}};
+ZmImOverview.prototype._getActionMenu=function(o,c,d){
+var t=this._actionMenuOps[o];
+if(t){
+var e=t._dwtControl;
+if(!e){
+var l=this;
+while(l&&!(l instanceof DwtDialog)){
+l=l.parent
+}
+e=t._dwtControl=new ZmActionMenu({
+parent:this,menuItems:t}
+);
+var a=new AjxListener(this,this._actionMenuListener,[true]);
+for(var n=0;
+n<e.opList.length;
+++n){
+var u=e.opList[n];
+e.addSelectionListener(u,a)
+}
+e.addPopdownListener(this._actionMenuPopdownListener)
+}
+if(o=="buddy"){
+var h=c.getContact();
+e.getOp(ZmOperation.IM_ADD_TO_CONTACT).setVisible(!h);
+e.getOp(ZmOperation.IM_CREATE_CONTACT).setVisible(!h);
+e.getOp(ZmOperation.IM_EDIT_CONTACT).setVisible(!!h)
+}else{
+if(o=="root"){
+var r=ZmImApp.loggedIn();
+for(var n=0,s=e.opList.length;
+n<s;
+n++){
+var u=e.getMenuItem(e.opList[n]);
+if(u){
+u.setEnabled(r)
+}}
+if(r){
+this._setCheckOp(e,ZmOperation.IM_TOGGLE_OFFLINE,this.__filterOffline);
+this._setCheckOp(e,ZmOperation.IM_TOGGLE_BLOCKED,this.__filterBlocked);
+this._setCheckOp(e,ZmOperation.IM_SORT_BY_PRESENCE,this._sortBy==ZmImApp.BUDDY_SORT_PRESENCE);
+this._setCheckOp(e,ZmOperation.IM_SORT_BY_NAME,this._sortBy==ZmImApp.BUDDY_SORT_NAME)
+}}}
+return e
+}};
+ZmImOverview.prototype._treeMouseUpListener=function(a){
+if((a.button==DwtMouseEvent.RIGHT)){
+if(!this._treeViewActionMenu){
+var n=[ZmOperation.NEW_ROSTER_ITEM,ZmOperation.IM_NEW_CHAT];
+this._treeViewActionMenu=new ZmActionMenu({
+parent:this.shell,menuItems:n}
+);
+var o=new AjxListener(this,this._actionMenuListener,[false]);
+for(var e=0,t=n.length;
+e<t;
+e++){
+this._treeViewActionMenu.addSelectionListener(n[e],o)
+}}
+this._treeViewActionMenu.popup(0,a.docX,a.docY)
+}};
+ZmImOverview.prototype._treeSelectionListener=function(a){
+if(a.detail!=DwtTree.ITEM_ACTIONED&&a.detail!=DwtTree.ITEM_SELECTED&&a.detail!=DwtTree.ITEM_DBL_CLICKED){
+return
+}
+var o=a.item.getData("ZmImOverview.data");
+var t=o.type;
+var n=o.group;
+var e=o.buddy;
+if(a.detail==DwtTree.ITEM_ACTIONED){
+var s=this._getActionMenu(t,e,n);
+if(s){
+this._actionedItem=a.item;
+s.popup(0,a.docX,a.docY)
+}}else{
+if(a.detail==DwtTree.ITEM_SELECTED&&e){
+if(this._options.singleClick){
+DwtMenu.closeActiveMenu();
+this.chatWithBuddy(e)
+}else{
+ZmTaskbarController.INSTANCE.selectChatForRosterItem(e)
+}}else{
+if(a.detail==DwtTree.ITEM_DBL_CLICKED){
+if(!this._options.singleClick){
+if(e){
+this.chatWithBuddy(e)
+}else{
+if(n){
+a.item.setExpanded(!a.item.getExpanded())
+}}}}}}};
+ZmImOverview.prototype._init=function(){
+var a=this._groupDropTgt=new DwtDropTarget(["ZmRosterItem"]);
+a.addDropListener(new AjxListener(this,this._groupDropListener));
+var s={
+parent:this,className:this._options.overviewId?"OverviewTree":null};
+var t=this._tree=new DwtTree(s);
+t.getHtmlElement().style.width="100%";
+if(!this._options.overviewId){
+t.getHtmlElement().style.overflow="auto"
+}
+if(!this._options.inactiveTree){
+t.addSelectionListener(new AjxListener(this,this._treeSelectionListener))
+}
+t.addListener(DwtEvent.ONMOUSEUP,new AjxListener(this,this._treeMouseUpListener));
+this._rootItem=new DwtHeaderTreeItem({
+parent:t,overview:this,className:"overviewHeader",noNodeCell:this._options.noHeaderNodeCell}
+);
+this._rootItem.setData("ZmImOverview.data",{
+type:"root"}
+);
+this._rootItem.setText(ZmMsg.buddyList);
+this._rootItem.enableSelection(false);
+var r=this._roster=AjxDispatcher.run("GetRoster");
+if(!this._options.noAssistant){
+var o=r.getRosterItemList();
+var n=new ZmAssistantBuddy(o);
+this._createTreeItems("assistant",n)
+}
+this._listen(r,new AjxListener(this,this._rosterListener));
+this._listen(r.getRosterItemList(),new AjxListener(this,this._rosterItemListListener));
+var e=ZmImApp.loggedIn();
+if(e){
+o=r.getRosterItemList()
+}
+if(e&&o.size()){
+this._updateSpecialItems(ZmImOverview.NO_MESSAGE);
+o.getVector().foreach(this._createBuddy,this);
+this.sort()
+}else{
+this._updateSpecialItems(e?ZmImOverview.NO_BUDDIES:ZmImOverview.NOT_LOGGED_IN)
+}
+t.addSeparator();
+if(!this._options.overviewId){
+this.addControlListener(new AjxListener(this,this._controlListener))
+}
+if(this._options.expanded){
+this._rootItem.setExpanded(true)
+}else{
+t.addTreeListener(new AjxListener(this,this._treeListener))
+}};
+ZmImOverview.prototype._treeListener=function(e){
+if(!this._didInitialExpand&&(e.detail==DwtTree.ITEM_EXPANDED)&&e.items.length&&(e.items[0]==this._rootItem)){
+var t=this._groupItems[ZmMsg.buddies];
+if(t){
+t.setExpanded(true)
+}
+this._didInitialExpand=true
+}};
+ZmImOverview.prototype._controlListener=function(o){
+var t={
+x:o.oldWidth,y:o.oldHeight};
+var e={
+x:o.newWidth,y:o.newHeight};
+if(t.x!=e.x||t.y!=e.y){
+var a=e.y;
+if(AjxEnv.isIE){
+a-=2
+}
+this._tree.setSize(Dwt.DEFAULT,a)
+}};
+ZmImOverview._popdownDialog=function(){
+if(ZmImNewChatDlg._INSTANCE){
+ZmImNewChatDlg._INSTANCE.popdown()
+}};
+ZmImOverview.login=function(){
+ZmImApp.INSTANCE.login()
+};
+ZmImOverview.newBuddy=function(){
+ZmImApp.INSTANCE.prepareVisuals();
+ZmImOverview._popdownDialog();
+ZmImApp.INSTANCE.getImController()._newRosterItemListener()
+};
+ZmImOverview.prototype._updateSpecialItems=function(t){
+var e=this._rootItem.getExpanded();
+if(t==ZmImOverview.NO_MESSAGE){
+if(this._infoItem){
+this._infoItem.dispose();
+this._infoItem=null
+}
+if(ZmImOverview.FILTER_SEARCH&&!this._filterItem){
+this._filterItem=new ZmBuddyFilterItem({
+parent:this._rootItem,overview:this}
+);
+this._filterItem.setData("ZmImOverview.data",{
+type:"filter"}
+)
+}}else{
+if(!this._infoItem){
+this._rootItem.removeChildren();
+this._filterItem=null;
+this._groupItems={};
+this._infoItem=new ZmInfoTreeItem({
+parent:this._rootItem}
+);
+this._infoItem.setData("ZmImOverview.data",{
+type:"infoItem"}
+)
+}
+var a;
+switch(t){
+case ZmImOverview.NOT_LOGGED_IN:a=AjxMessageFormat.format(ZmMsg.imNotLoggedIn,"ZmImOverview.login()");
+break;
+case ZmImOverview.LOADING:a=ZmMsg.loading;
+break;
+case ZmImOverview.NO_BUDDIES:a=AjxMessageFormat.format(ZmMsg.imNoBuddies,"ZmImOverview.newBuddy()");
+break
+}
+this._infoItem.setText(a)
+}
+if(e){
+this._rootItem.setExpanded(true)
+}};
+ZmImOverview.prototype._listen=function(e,t){
+e.addChangeListener(t);
+this._modelListeners.push({
+modelObject:e,listener:t}
+)
+};
+ZmImOverview.prototype._rosterListener=function(e){
+if(e.event==ZmEvent.E_LOAD){
+this._updateSpecialItems(e.getDetails().loggedIn?ZmImOverview.LOADING:ZmImOverview.NOT_LOGGED_IN)
+}};
+ZmImOverview.prototype._rosterItemListListener=function(t){
+var e=t.getDetail("fields");
+if(t.event==ZmEvent.E_LOAD){
+if(!t.source.size()){
+this._updateSpecialItems(ZmImOverview.NO_BUDDIES)
+}}else{
+if(t.event==ZmEvent.E_CREATE){
+if(this._infoItem){
+this._updateSpecialItems(ZmImOverview.NO_MESSAGE)
+}
+var a=AjxVector.fromArray(t.getItems());
+a.foreach(this._createBuddy,this);
+if(a.size()){
+this.sort()
+}}else{
+if(t.event==ZmEvent.E_MODIFY){
+this._modifyBuddies(t.getItems(),e)
+}else{
+if(t.event==ZmEvent.E_REMOVE||t.event==ZmEvent.E_DELETE){
+var a=AjxVector.fromArray(t.getItems());
+a.foreach(this._removeBuddy,this)
+}}}}};
+ZmImOverview.prototype._groupDropListener=function(n){
+if(!n.srcData){
+return false
+}
+if(n.action==DwtDropEvent.DRAG_ENTER){
+n.doIt=this._groupDropTgt.isValidTarget(n.srcData)
+}else{
+if(n.action==DwtDropEvent.DRAG_DROP){
+var o=n.srcData;
+var t=o._drag_from_group;
+var s=n.targetControl.getData("ZmImOverview.data").group;
+var e=AjxVector.fromArray(o.getGroups());
+if(t!=s&&e.indexOf(s)==-1){
+e.remove(t);
+e.add(s);
+var a=o.getDisplayName();
+var r=o.getAddress();
+AjxDispatcher.run("GetRoster").createRosterItem(r,a,e.join(","))
+}}}};
+ZmImOverview.prototype._getBuddyIcon=function(e){
+var a=AjxDispatcher.run("GetRoster");
+var t=a.getPrivacyList();
+return t.isDenied(e.getAddress())?"BlockUser":e.getPresence().getIcon()
+};
+ZmImOverview.prototype._createBuddy=function(e){
+return this._createTreeItems("buddy",e)
+};
+ZmImOverview.prototype._createTreeItems=function(s,o){
+var e=o.getGroups();
+if(e.length==0){
+e=s=="buddy"?[ZmMsg.buddies]:[null]
+}
+var l=o.getDisplayName();
+var r=this._getBuddyIcon(o);
+var n=[];
+var d=this._rootItem.getExpanded();
+for(var t=0;
+t<e.length;
+++t){
+var c=this.getGroupItem(e[t]);
+var u=new DwtTreeItem({
+parent:c,index:this.getSortIndex(o,c),text:AjxStringUtil.htmlEncode(l),imageInfo:r,singleClickAction:this._options.singleClick}
+);
+u.addClassName("ZmImPresence-"+o.getPresence().getShow());
+u.setToolTipContent("-");
+u.getToolTipContent=AjxCallback.simpleClosure(o.getToolTip,o);
+u.setData("ZmImOverview.data",{
+type:s,buddy:o}
+);
+u.setDragSource(this._im_dragSrc);
+n.push(u);
+if(this._options.expanded||(d&&(e[t]==ZmMsg.buddies))){
+c.setExpanded(true)
+}
+var h=this._itemsById[o.getAddress()];
+if(!h){
+h=this._itemsById[o.getAddress()]=new AjxVector()
+}
+h.add(u)
+}
+this.applyFilters(n)
+};
+ZmImOverview.prototype._modifyBuddies=function(e,r){
+var o=false;
+var d=false;
+for(var n=0,h=e.length;
+n<h;
+n++){
+var l=e[n];
+var c=this._itemsById[l.getAddress()];
+if(c){
+var u=ZmRosterItem.F_GROUPS in r;
+if(u){
+this._removeBuddy(l);
+this._createTreeItems("buddy",l)
+}else{
+var t=ZmRosterItem.F_PRESENCE in r;
+var m=ZmRosterItem.F_UNREAD in r;
+var s=ZmRosterItem.F_NAME in r;
+var a=ZmRosterItem.F_TYPING in r;
+o=o||t;
+d=d||s;
+c.foreach(function(p){
+if(t){
+p.setImage(this._getBuddyIcon(l));
+p.setClassName(p.getClassName());
+p.addClassName("ZmImPresence-"+l.getPresence().getShow())
+}
+if(m||s){
+var f=l.getDisplayName();
+if(l.getUnread()){
+f+=" ("+l.getUnread()+")";
+f=f.bold()
+}
+p.setText(f)
+}
+if(a){
+p.condClassName(r[ZmRosterItem.F_TYPING],"ZmRosterItem-typing")
+}}
+,this);
+this.applyFilters(c.getArray())
+}}}
+if((o&&(this._sortBy==ZmImApp.BUDDY_SORT_PRESENCE))||(d)){
+this.sort()
+}};
+ZmImOverview.prototype._removeBuddy=function(t){
+var e=this._itemsById[t.getAddress()];
+e.foreach("dispose");
+this._itemsById[t.getAddress()]=null
+};
+ZmImOverview.prototype.getGroupItem=function(t){
+if(!t){
+return this._rootItem
+}
+var e=this._groupItems[t];
+if(!e){
+e=this._groupItems[t]=new DwtTreeItem({
+parent:this._rootItem,index:this.getSortIndex(t),text:AjxStringUtil.htmlEncode(t),imageInfo:"ImGroup"}
+);
+e.setToolTipContent("-");
+e.getToolTipContent=function(){
+var a=this.getData("ZmImOverview.data");
+return AjxMessageFormat.format(ZmMsg.imGroupItemTooltip,[a.group,this.getItemCount()])
+};
+e.setData("ZmImOverview.data",{
+type:"group",group:t}
+);
+e.setDropTarget(this._groupDropTgt)
+}
+return e
+};
+ZmImOverview.prototype.getSortIndex=function(c,h){
+var s="buddy";
+if(h==null){
+s="group";
+h=this._rootItem;
+c=c.toLowerCase()
+}
+var n=h.getItems();
+for(var t=0;
+t<n.length;
+++t){
+var d=n[t];
+var e=d.getData("ZmImOverview.data");
+if(e.type=="filter"||e.type=="infoItem"){
+continue
+}
+if(s=="buddy"){
+if(this._sortBy==ZmImApp.BUDDY_SORT_NAME){
+var o=e.buddy.getDisplayName();
+if(o&&o.toLowerCase()>c.getDisplayName()){
+break
+}}else{
+if(this._sortBy==ZmImApp.BUDDY_SORT_PRESENCE){
+var l=ZmImOverview.PRESENCE_SORT_INDEX[e.buddy.getPresence().getShow()]||100;
+var r=ZmImOverview.PRESENCE_SORT_INDEX[c.getPresence().getShow()]||100;
+if(l>r){
+break
+}}}}else{
+var o=e.group;
+if(o&&o.toLowerCase()>c){
+break
+}}}
+return t
+};
+ZmImOverview.prototype.addFilter=function(t){
+for(var e=this.__filters.length;
+--e>=0;
+){
+if(this.__filters[e]===t){
+this.__filters.splice(e,1)
+}}
+this.__filters.push(t);
+this.applyFilters()
+};
+ZmImOverview.prototype.removeFilter=function(t){
+if(!this.__filters.length){
+return
+}
+for(var e=this.__filters.length;
+--e>=0;
+){
+if(this.__filters[e]===t){
+this.__filters.splice(e,1)
+}}
+this.applyFilters(null,true)
+};
+ZmImOverview.prototype.applyFilters=function(s,o){
+var e=this.__filters;
+if(!e.length&&!o){
+return
+}
+this._firstFilterItem=null;
+var n=function(d){
+var p=false;
+for(var u=d.length;
+--u>=0;
+){
+var m=d[u];
+var y=true;
+for(var c=e.length;
+--c>=0;
+){
+var g=e[c];
+if(g.call(this,m)){
+y=false;
+break
+}}
+if(!this._firstFilterItem&&y){
+this._firstFilterItem=m
+}
+p=p||y;
+m.setVisible(y)
+}
+return p
+};
+if(s){
+n.call(this,s)
+}else{
+if(this._rootItem){
+var r=this._rootItem;
+var t=r.getItems();
+for(var a=t.length;
+--a>=0;
+){
+var h=t[a];
+var s=h.getItems();
+var l=n.call(this,s)||s.length==0;
+h.setVisible(l);
+if(l){
+h.setExpanded(true)
+}}}}};
+ZmImOverview.FILTER_OFFLINE_BUDDIES=function(a){
+var e=a.getData("ZmImOverview.data").buddy;
+var t=e.getPresence();
+return t.getShow()==ZmRosterPresence.SHOW_OFFLINE
+};
+ZmImOverview.FILTER_BLOCKED_BUDDIES=function(t){
+var e=t.getData("ZmImOverview.data").buddy;
+return AjxDispatcher.run("GetRoster").getPrivacyList().isDenied(e.getAddress())
+};
+ZmImOverview.FILTER_SEARCH={
+func:function(a){
+var t=this.__searchInputEl.value.toLowerCase();
+var e=a.getData("ZmImOverview.data").buddy;
+if(/^#/.test(t)){
+return e.getAddress().indexOf(t.substr(1))<0
+}else{
+return e.getDisplayName().toLowerCase().indexOf(t)<0
+}}
+,_doKeyPress:function(){
+var e=this.__searchInputEl.value;
+if(!/\S/.test(e)||e==ZmMsg.filter){
+this.removeFilter(ZmImOverview.FILTER_SEARCH.func)
+}else{
+this.addFilter(ZmImOverview.FILTER_SEARCH.func)
+}}
+,inputFocus:function(){
+Dwt.delClass(this.__searchInputEl,"DwtSimpleInput-hint","DwtSimpleInput-focused");
+if(this.__searchInputEl.value==ZmMsg.filter){
+this.__searchInputEl.value=""
+}else{
+try{
+this.__searchInputEl.select()
+}
+catch(e){}}}
+,inputBlur:function(){
+Dwt.delClass(this.__searchInputEl,"DwtSimpleInput-focused","DwtSimpleInput-hint");
+if(!/\S/.test(this.__searchInputEl.value)){
+this.__searchInputEl.value=ZmMsg.filter
+}}
+,inputKeyPress:function(t){
+if(!t){
+t=window.event
+}
+if(this.__searchInputTimeout){
+clearTimeout(this.__searchInputTimeout)
+}
+if(t.keyCode==27){
+this.__searchInputEl.value="";
+ZmImOverview.FILTER_SEARCH._doKeyPress.call(this);
+ZmImOverview.FILTER_SEARCH.inputBlur.call(this);
+this.__searchInputEl.blur()
+}
+if(t.keyCode==13){
+ZmImOverview.FILTER_SEARCH._doKeyPress.call(this);
+if(!/\S/.test(this.__searchInputEl.value)){
+return
+}
+if(this._firstFilterItem){
+var e=this._firstFilterItem.getData("ZmImOverview.data").buddy;
+this.chatWithBuddy(e);
+this.__searchInputEl.value="";
+ZmImOverview.FILTER_SEARCH.inputBlur.call(this);
+this.__searchInputEl.blur()
+}}
+this.__searchInputTimeout=setTimeout(AjxCallback.simpleClosure(ZmImOverview.FILTER_SEARCH._doKeyPress,this),500)
+}};
+ZmBuddyFilterItem=function(e){
+this.overview=e.overview;
+e.className="ZmBuddyFilterItem";
+DwtTreeItem.call(this,e)
+};
+ZmBuddyFilterItem.prototype=new DwtTreeItem;
+ZmBuddyFilterItem.prototype.constructor=ZmBuddyFilterItem;
+ZmBuddyFilterItem.prototype.toString=function(){
+return"ZmBuddyFilterItem"
+};
+ZmBuddyFilterItem.prototype._createHtmlFromTemplate=function(t,a){
+var o=this.getHtmlElement();
+o.className="ZmBuddyFilterItem";
+var e=o.ownerDocument.createElement("input");
+this.overview.__searchInputEl=e;
+e.autocomplete="off";
+e.className="DwtSimpleInput";
+o.appendChild(e);
+e.onkeydown=AjxCallback.simpleClosure(ZmImOverview.FILTER_SEARCH.inputKeyPress,this.overview);
+e.onfocus=AjxCallback.simpleClosure(ZmImOverview.FILTER_SEARCH.inputFocus,this.overview);
+e.onblur=AjxCallback.simpleClosure(ZmImOverview.FILTER_SEARCH.inputBlur,this.overview);
+e.onblur()
+};
+ZmInfoTreeItem=function(e){
+e.className="ZmInfoTreeItem";
+DwtTreeItem.call(this,e)
+};
+ZmInfoTreeItem.prototype=new DwtTreeItem;
+ZmInfoTreeItem.prototype.constructor=ZmInfoTreeItem;
+ZmInfoTreeItem.prototype.TEMPLATE="im.Chat#ZmInfoTreeItem";
+ZmInfoTreeItem.prototype.toString=function(){
+return"ZmInfoTreeItem"
+}
+}
+if(AjxPackage.define("zimbraMail.im.view.ZmTaskbar")){
+ZmTaskbar=function(e){
+ZmToolBar.call(this,e);
+ZmTaskbar.INSTANCE=this;
+this._setMouseEvents();
+this.shell.addControlListener(new AjxListener(this,this._shellControlListener))
+};
+ZmTaskbar.prototype=new ZmToolBar;
+ZmTaskbar.prototype.constructor=ZmTaskbar;
+ZmTaskbar.prototype.toString=function(){
+return"ZmTaskbar"
+};
+ZmTaskbar.prototype.zShow=function(e){
+this.setZIndex(e?Dwt.Z_VIEW+10:Dwt.Z_HIDDEN)
+};
+ZmTaskbar.prototype.expandItem=function(a,t,e){
+if(t&&this.expandedItem){
+this.expandedItem._expand(false)
+}
+a._expand(t,e);
+this.expandedItem=t?a:null
+};
+ZmTaskbar.prototype.toggleExpanded=function(e){
+this.expandItem(e,!e.expanded)
+};
+ZmTaskbar.prototype.conditionalExpand=function(e){
+if(!this.expandedItem){
+this.expandItem(e,true,true);
+return true
+}else{
+return false
+}};
+ZmTaskbar.prototype._shellControlListener=function(e){
+if((e.oldWidth!=e.newWidth)&&this.expandedItem){
+this.expandedItem.positionContent()
+}};
+ZmTaskbarItem=function(a){
+DwtComposite.call(this,a);
+this._createHtml();
+this._contentClassName=a.contentClassName;
+var e={
+style:DwtButton.TOGGLE_STYLE,parent:this,parentElement:this._buttonEl};
+var t=a.buttonConstructor||DwtToolBarButton;
+this.button=new t(e);
+this.button.addSelectionListener(a.selectionListener);
+if(a.op){
+this.button.setText(ZmMsg[ZmOperation.getProp(a.op,"textKey")]);
+this.button.setImage(ZmOperation.getProp(a.op,"image"));
+this.button.setToolTipContent(ZmMsg[ZmOperation.getProp(a.op,"tooltipKey")])
+}
+this._rightAlign=a.rightAlign;
+this._data=a.data
+};
+ZmTaskbarItem.prototype=new DwtComposite;
+ZmTaskbarItem.prototype.constructor=ZmTaskbarItem;
+ZmTaskbarItem.prototype.TEMPLATE="share.App#ZmTaskbarItem";
+ZmTaskbarItem.prototype.toString=function(){
+return"ZmTaskbarItem"
+};
+ZmTaskbarItem.prototype.getPopup=function(){
+if(!this._popup){
+AjxDispatcher.require(["IMCore","IM"]);
+var args={
+parent:this,parentElement:this._contentEl,taskbarItem:this,taskbar:this.parent,data:this._data};
+var ctor=window.eval(this._contentClassName);
+this._popup=new ctor(args)
+}
+return this._popup
+};
+ZmTaskbarItem.prototype._expand=function(a,t){
+this.expanded=a;
+Dwt.setVisible(this._contentEl,a);
+this.button.setSelected(a);
+var e=this.getPopup();
+if(a){
+this.showAlert(false);
+e.popup(t);
+this.positionContent()
+}else{
+e.popdown()
+}};
+ZmTaskbarItem.prototype.positionContent=function(){
+if(this._rightAlign){
+var e=Dwt.toWindow(this.button.getHtmlElement(),0,0).x;
+var a=this.button.getW();
+var t=this.parent.getBounds();
+var o=1;
+this._contentEl.style.right=t.x+t.width-e-a-o
+}};
+ZmTaskbarItem.prototype._createHtml=function(){
+var e={
+id:this._htmlElId};
+this._createHtmlFromTemplate(this.TEMPLATE,e);
+this._contentEl=document.getElementById(e.id+"_content");
+this._buttonEl=document.getElementById(e.id+"_button")
+}
+}
+if(AjxPackage.define("zimbraMail.im.controller.ZmTaskbarController")){
+ZmTaskbarController=function(s){
+ZmController.call(this,null);
+ZmTaskbarController.INSTANCE=this;
+var n=Dwt.byId(ZmId.SKIN_TASKBAR);
+if(!n){
+return
+}
+this._chatData={};
+this._chatMru=[];
+var o={
+parent:appCtxt.getShell(),id:ZmId.TASKBAR,className:"ZmTaskbar",posStyle:Dwt.ABSOLUTE_STYLE};
+this._toolbar=s[ZmAppViewMgr.C_TASKBAR]=new ZmTaskbar(o);
+this._toolbar.addListener(DwtEvent.ONMOUSEDOWN,new AjxListener(this,this._toolbarMouseDownListener));
+var h={
+contentClassName:"ZmPresencePopup",op:ZmId.OP_IM_PRESENCE_MENU};
+this._presenceItem=this._createItem(h);
+this._toolbar.addSeparator();
+this._newBuddySelectionListenerObj=new AjxListener(this,this._newBuddySelectionListener);
+var a={
+contentClassName:"ZmNewBuddyPopup",selectionListener:this._newBuddySelectionListenerObj,op:ZmId.OP_NEW_ROSTER_ITEM};
+this._newBuddyItem=this._createItem(a);
+this._newBuddyItem.button.setText("");
+var t={
+contentClassName:"ZmBuddyListPopup",op:ZmId.OP_IM_BUDDY_LIST};
+this._createItem(t);
+this._toolbar.addFiller(null);
+this._chatButtonIndex=this._toolbar.getNumChildren()+1;
+this._messageButton=new DwtToolBarButton({
+parent:this._toolbar}
+);
+this._messageButton.setText(ZmMsg.betaIM);
+this._messageButton.setEnabled(false);
+var e=appCtxt.getSkinHint("presence","height")||24;
+Dwt.setSize(n,Dwt.DEFAULT,e);
+var r=ZmImApp.INSTANCE.getRoster();
+this._updatePresenceButton(ZmImApp.loggedIn()?r.getPresence():null);
+r.addChangeListener(new AjxListener(this,this._rosterChangeListener));
+r.addGatewayListListener(new AjxListener(this,this._gatewayListListener));
+ZmImApp.INSTANCE.getRoster().getChatList().addChangeListener(new AjxListener(this,this._chatListListener));
+ZmImApp.INSTANCE.getRoster().getRosterItemList().addChangeListener(new AjxListener(this,this._rosterListChangeListener))
+};
+ZmTaskbarController.prototype=new ZmController;
+ZmTaskbarController.prototype.constructor=ZmTaskbarController;
+ZmTaskbarController.prototype.toString=function(){
+return"ZmTaskbarController"
+};
+ZmTaskbarController.prototype.setMessage=function(e){
+this._messageButton.setText(e);
+if(this._resetMessageActionId){
+AjxTimedAction.cancelAction(this._resetMessageActionId);
+this._resetMessageActionId=0
+}
+this._resetMessageAction=this._resetMessageAction||new AjxTimedAction(this,this._resetMessage);
+this._resetMessageActionId=AjxTimedAction.scheduleAction(this._resetMessageAction,3000)
+};
+ZmTaskbarController.prototype._resetMessage=function(e){
+this._messageButton.setText(ZmMsg.betaIM);
+this._resetMessageActionId=0
+};
+ZmTaskbarController.prototype.createChatItem=function(e,a){
+this._addChatToMru(e);
+var n=this._toolbar.addSeparator(null,this._chatButtonIndex++);
+var t={
+index:this._chatButtonIndex++,contentClassName:"ZmChatPopup",selectionListener:new AjxListener(this,this._chatSelectionListener,[e]),data:{
+chat:e,statusListener:new AjxListener(this,this._chatStatusListener,[e]),closeListener:new AjxListener(this,this._closeChatListener,[e]),minimizeListener:new AjxListener(this,this._minimizeChatListener,[e])}};
+var o=this._createItem(t);
+o.button.setToolTipContent(new AjxCallback(this,this._getChatToolTip,[e]));
+o.button.addListener(DwtEvent.ONMOUSEDOWN,new AjxListener(this,this._chatMouseDownListener,[e]));
+this._chatData[e.id]={
+chat:e,item:o,separator:n};
+var s="Close";
+o.button.setHoverImage(s);
+this._closeClass=this._closeClass||AjxImg.getClassForImage(s);
+this._toolbar.expandItem(o,true,a);
+this._chatData[e.id].chatWidget=o.getPopup().chatWidget;
+this._chatChangeListenerListenerObj=this._chatChangeListenerListenerObj||new AjxListener(this,this._chatChangeListenerListener);
+e.addChangeListener(this._chatChangeListenerListenerObj);
+return o
+};
+ZmTaskbarController.prototype.endChat=function(e){
+e.sendClose();
+ZmImApp.INSTANCE.getRoster().getChatList().removeChat(e)
+};
+ZmTaskbarController.prototype.selectChat=function(e,a){
+var t=this._chatData[e.id];
+if(t){
+this._expandChatItem(t.item,e,true);
+if(a){
+t.chatWidget.setEditorContent(AjxStringUtil.trim(a))
+}}};
+ZmTaskbarController.prototype.selectChatForRosterItem=function(t){
+var o=ZmImApp.INSTANCE.getRoster().getChatList().getChatsByRosterAddr(t.getAddress());
+var e=null;
+for(var a in o){
+if(o[a].getRosterSize()==1){
+e=o[a];
+break
+}}
+if(e==null&&o.length>0){
+e=o[0]
+}
+if(e!=null){
+this.selectChat(e)
+}};
+ZmTaskbarController.prototype.chatWithContacts=function(t,e,o){
+var a=t.map("getBuddy").sub(AjxCallback.isNull);
+if(a.size()>0){
+this.chatWithRosterItem(a.get(0),o)
+}};
+ZmTaskbarController.prototype.chatWithRosterItem=function(t,a){
+var e=ZmImApp.INSTANCE.getRoster().getChatList().getChatByRosterItem(t,true);
+this.selectChat(e,a)
+};
+ZmTaskbarController.prototype.getChatWidgetForChat=function(e){
+var t=this._chatData[e.id];
+return t?t.chatWidget:null
+};
+ZmTaskbarController.prototype.showSubscribeRequest=function(s,t){
+this._subscribeData=this._subscribeData||{};
+if(this._subscribeData[s]){
+return
+}
+var n=this._toolbar.addSeparator(null,this._chatButtonIndex+1);
+var e={
+index:this._chatButtonIndex+1,op:ZmId.OP_IM_INVITE,rightAlign:true,contentClassName:"ZmSubscribePopup",data:{
+addr:s,buddy:t}};
+var a=this._createItem(e);
+this._subscribeData[s]={
+item:a,separator:n};
+this._subscribeRequestTooltip=this._subscribeRequestTooltip||new AjxMessageFormat(ZmMsg.imInvitationFrom);
+var o=this._subscribeRequestTooltip.format(t?t.getDisplayName():s);
+a.button.setToolTipContent(o);
+if(!this._toolbar.conditionalExpand(a)){
+a.showAlert(true)
+}
+a.addDisposeListener(new AjxListener(this,this._subscribeDisposeListener,[s]))
+};
+ZmTaskbarController.prototype.showNewBuddyPopup=function(){
+this._toolbar.expandItem(this._newBuddyItem,true);
+return this._newBuddyItem.getPopup()
+};
+ZmTaskbarController.prototype.showGatewayPopup=function(t){
+if(this._gatewayData){
+var e=this._gatewayData[t];
+if(e){
+this._toolbar.expandItem(e.item,true)
+}}};
+ZmTaskbarController.prototype._subscribeDisposeListener=function(t){
+var e=this._subscribeData[t];
+this._toolbar.removeSeparator(e.separator);
+delete this._subscribeData[t]
+};
+ZmTaskbarController.prototype._addChatToMru=function(e){
+if(this._chatMru.length>=4){
+for(var o=this._chatMru.length,a=o-1;
+a>=0;
+a--){
+var t=this._chatMru[a];
+var n=this._chatData[t.id].item;
+if(!n.expanded&&!n.isAlertShown()){
+this.endChat(t);
+break
+}}}
+this._chatMru.unshift(e)
+};
+ZmTaskbarController.prototype._updateChatMru=function(e){
+if(this._chatMru.length&&(this._chatMru[0]!=e)){
+this._removeChatFromMru(e);
+this._chatMru.unshift(e)
+}};
+ZmTaskbarController.prototype._removeChatFromMru=function(e){
+for(var t=0,a=this._chatMru.length;
+t<a;
+t++){
+if(this._chatMru[t]==e){
+this._chatMru.splice(t,1);
+return
+}}};
+ZmTaskbarController.prototype._chatMouseDownListener=function(e,a){
+if(a.button!=DwtMouseEvent.RIGHT){
+return
+}
+this._actionedChat=e;
+if(!this._chatActionMenu){
+var t={
+parent:appCtxt.getShell(),controller:this,context:ZmId.TASKBAR,menuType:"Chat",menuItems:[ZmId.OP_IM_CLOSE_CHAT,ZmId.OP_IM_CLOSE_ALL_CHATS,ZmId.OP_IM_CLOSE_OTHER_CHATS]};
+this._chatActionMenu=new ZmActionMenu(t);
+this._chatActionMenu.getOp(ZmId.OP_IM_CLOSE_CHAT).addSelectionListener(new AjxListener(this,this._closeChatMenuListener));
+this._chatActionMenu.getOp(ZmId.OP_IM_CLOSE_ALL_CHATS).addSelectionListener(new AjxListener(this,this._closeAllChatsListener));
+this._chatActionMenu.getOp(ZmId.OP_IM_CLOSE_OTHER_CHATS).addSelectionListener(new AjxListener(this,this._closeOtherChatsListener))
+}
+this._chatActionMenu.popup(0,a.docX,a.docY)
+};
+ZmTaskbarController.prototype._closeChatMenuListener=function(){
+this.endChat(this._actionedChat);
+this._actionedChat=null
+};
+ZmTaskbarController.prototype._closeAllChatsListener=function(){
+var e=[];
+for(var o in this._chatData){
+e.push(this._chatData[o].chat)
+}
+for(var t=0,a=e.length;
+t<a;
+t++){
+this.endChat(e[t])
+}
+this._actionedChat=null
+};
+ZmTaskbarController.prototype._closeOtherChatsListener=function(){
+var o=[];
+for(var n in this._chatData){
+var e=this._chatData[n].chat;
+if(e!=this._actionedChat){
+o.push(e)
+}}
+for(var t=0,a=o.length;
+t<a;
+t++){
+this.endChat(o[t])
+}
+this._actionedChat=null
+};
+ZmTaskbarController.prototype._newBuddyListener=function(){
+ZmImApp.INSTANCE.prepareVisuals();
+ZmImApp.INSTANCE.getImController()._newRosterItemListener()
+};
+ZmTaskbarController.prototype._toolbarMouseDownListener=function(e){
+if(e.button==DwtMouseEvent.LEFT&&this._toolbar.expandedItem){
+this._toolbar.expandItem(this._toolbar.expandedItem,false)
+}};
+ZmTaskbarController.prototype._rosterListChangeListener=function(s){
+if(s.event==ZmEvent.E_MODIFY){
+var t=s.getDetail("fields");
+var o=s.getItems();
+for(var e=0;
+e<o.length;
+e++){
+var h=o[e];
+if(h instanceof ZmRosterItem){
+var a;
+a=a||ZmImApp.INSTANCE.getRoster().getChatList();
+var d=a.getChatsByRosterAddr(h.getAddress());
+for(var n in d){
+var l=d[n];
+var r=this.getChatWidgetForChat(d[n]);
+if(r){
+r._rosterItemChangeListener(h,t)
+}}}}}};
+ZmTaskbarController.prototype._chatListListener=function(a){
+if(a.event==ZmEvent.E_CREATE){
+var e=a.getDetails().items[0];
+var o=this._chatData[e.id];
+var t;
+if(o){
+this._toolbar.conditionalExpand(o.item)
+}else{
+t=this.createChatItem(e,a.getDetails().background)
+}}else{
+if(a.event==ZmEvent.E_DELETE){
+var e=a._details.items[0];
+this._deleteChatItem(e)
+}}};
+ZmTaskbarController.prototype._deleteChatItem=function(e){
+this._removeChatFromMru(e);
+e.removeChangeListener(this._chatChangeListenerListenerObj);
+var t=this._chatData[e.id];
+if(t){
+this._toolbar.removeSeparator(t.separator);
+t.item.dispose();
+this._chatButtonIndex-=1;
+delete this._chatData[e.id]
+}};
+ZmTaskbarController.prototype._getChatToolTip=function(e,a){
+var t=e.getRosterItem().getToolTip();
+a.run(t)
+};
+ZmTaskbarController.prototype._expandChatItem=function(t,e,a){
+this._updateChatMru(e);
+this._toolbar.expandItem(t,a);
+var o=this._chatData[e.id].chatWidget;
+o._onMinimize(!a);
+if(a){
+o.focus()
+}};
+ZmTaskbarController.prototype._chatSelectionListener=function(e,a){
+if(e&&a.target&&(a.target.className==this._closeClass)){
+this.endChat(e)
+}else{
+var t=a.dwtObj.parent;
+this._expandChatItem(t,e,!t.expanded)
+}};
+ZmTaskbarController.prototype._selectionListener=function(e){
+this._toolbar.toggleExpanded(e.dwtObj.parent)
+};
+ZmTaskbarController.prototype._newBuddySelectionListener=function(e){
+if(ZmImApp.loggedIn()){
+this._toolbar.toggleExpanded(this._newBuddyItem)
+}else{
+ZmImApp.INSTANCE.login({
+callback:this._newBuddySelectionListenerObj}
+)
+}};
+ZmTaskbarController.prototype._chatChangeListenerListener=function(o){
+var e=o.source;
+var t=this._chatData[e.id];
+if(t&&!t.item.expanded){
+var a=o.getDetail("fields")[ZmChat.F_MESSAGE];
+if(a&&!a.fromMe&&!a.isSystem){
+t.item.showAlert(true);
+this._updateChatMru(e)
+}}};
+ZmTaskbarController.prototype._closeChatListener=function(e){
+this.endChat(e)
+};
+ZmTaskbarController.prototype._minimizeChatListener=function(e){
+var t=this._chatData[e.id].item;
+this._expandChatItem(t,e,false);
+t.button.setDisplayState(DwtControl.SELECTED);
+AjxTimedAction.scheduleAction(new AjxTimedAction(this,this._minimzeTimedAction,t),250)
+};
+ZmTaskbarController.prototype._minimzeTimedAction=function(e){
+e.button.setDisplayState(DwtControl.NORMAL)
+};
+ZmTaskbarController.prototype._chatStatusListener=function(t,e){
+var a=this._chatData[t.id].item;
+a.button.setImage(e.statusImage);
+var o=e.title?AjxStringUtil.clipByLength(e.title,15):"";
+a.button.setText(o)
+};
+ZmTaskbarController.prototype._createItem=function(e){
+e.parent=this._toolbar;
+e.selectionListener=e.selectionListener||new AjxListener(this,this._selectionListener);
+return new ZmTaskbarItem(e)
+};
+ZmTaskbarController.prototype._rosterChangeListener=function(a){
+if(a.event==ZmEvent.E_MODIFY){
+var e=a.getDetail("fields");
+if(ZmRoster.F_PRESENCE in e){
+var t=ZmImApp.INSTANCE.getRoster().getPresence();
+this._updatePresenceButton(t)
+}}};
+ZmTaskbarController.prototype._updatePresenceButton=function(a){
+var t=this._presenceItem.button;
+t.setImage(a?a.getIcon():"Offline");
+var e=a?AjxStringUtil.htmlEncode(a.getShowText()):ZmMsg.imStatusOffline;
+var o=ZmImApp.INSTANCE.getServiceController().getMyPresenceTooltip(e);
+t.setToolTipContent(o)
+};
+ZmTaskbarController.prototype._gatewayListListener=function(s){
+if(!ZmImApp.INSTANCE.getServiceController().capabilities[ZmImServiceController.ACCOUNTS]){
+return
+}
+this._gatewayData=this._gatewayData||{};
+var h=s.roster.getGateways();
+for(var a=1,n=h.length;
+a<n;
+a++){
+var r=h[a];
+if(!this._gatewayData[r.type]){
+for(var e in this._gatewayData){
+this._toolbar.addSeparator();
+break
+}
+var t={
+buttonConstructor:ZmStatusImageButton,contentClassName:"ZmGatewayPopup",data:r,rightAlign:true};
+var o=this._createItem(t);
+o.button.setImage("WebSearch");
+this._gatewayData[r.type]={
+item:o};
+r.addListener(ZmImGateway.EVENT_SET_STATE,new AjxListener(this,this._gatewayEventListener,[r]))
+}
+this._updateGatewayButton(r)
+}};
+ZmTaskbarController.prototype._gatewayEventListener=function(e){
+this._updateGatewayButton(e)
+};
+ZmTaskbarController.prototype._updateGatewayButton=function(o){
+var a=this._presenceItem.button.getImage();
+var e;
+if(o.isOnline()){
+e=this._gatewayOnlineFormat=this._gatewayOnlineFormat||new AjxMessageFormat(ZmMsg.imStatusGatewayOnline)
+}else{
+e=this._gatewayOfflineFormat=this._gatewayOfflineFormat||new AjxMessageFormat(ZmMsg.imStatusGatewayOffline);
+a="Offline"
+}
+var n=e.format([ZmMsg["imGateway_"+o.type],o.nick]);
+var t=this._gatewayData[o.type].item.button;
+t.setToolTipContent(n);
+t.setStatusImage(a)
+};
+ZmStatusImageButton=function(e){
+e.className="ZmStatusImageButton";
+DwtButton.call(this,e)
+};
+ZmStatusImageButton.prototype=new DwtButton;
+ZmStatusImageButton.prototype.constructor=ZmStatusImageButton;
+ZmStatusImageButton.prototype.TEMPLATE="share.App#ZmStatusImageButton";
+ZmStatusImageButton.prototype.toString=function(){
+return"ZmStatusImageButton"
+};
+ZmStatusImageButton.prototype.dispose=function(){
+this._statusIconEl=null;
+DwtMenuItem.prototype.dispose.call(this)
+};
+ZmStatusImageButton.prototype.setStatusImage=function(e){
+if(this._statusIconEl){
+AjxImg.setImage(this._statusIconEl,e)
+}};
+ZmStatusImageButton.prototype._createHtmlFromTemplate=function(e,t){
+DwtButton.prototype._createHtmlFromTemplate.call(this,e,t);
+this._statusIconEl=document.getElementById(t.id+"_status_icon")
+}
+}
+if(AjxPackage.define("zimbraMail.core.ZmAppViewMgr")){
+ZmAppViewMgr=function(o,t,e,a){
+ZmAppViewMgr._setContainerIds();
+this._shell=o;
+this._controller=t;
+this._isNewWindow=e;
+this._hasSkin=a;
+this._shellSz=this._shell.getSize();
+this._controlListener=new AjxListener(this,this._shellControlListener);
+this._shell.addControlListener(this._controlListener);
+this._sashSupported=(window.skin&&typeof window.skin.setTreeWidth=="function");
+if(appCtxt.get(ZmSetting.HISTORY_SUPPORT_ENABLED)&&!AjxEnv.isSafari&&!e&&!AjxEnv.isPrism){
+this._historyMgr=appCtxt.getHistoryMgr();
+this._historyMgr.addListener(new AjxListener(this,this._historyChangeListener))
+}
+this._hashView={};
+this._nextHashIndex=0;
+this._curHashIndex=0;
+this._noHistory=false;
+this._ignoreHistoryChange=false;
+this._lastView=null;
+this._currentView=null;
+this._views={};
+this._hidden=[];
+this._appView={};
+this._callbacks={};
+this._viewApp={};
+this._isAppView={};
+this._isTransient={};
+this._toRemove=[];
+this._isTabView={};
+this._tabParams={};
+this._viewByTabId={};
+this._components={};
+this._containers={};
+this._contBounds={};
+this._pushCallback=new AjxCallback(this,this.pushView);
+this._popCallback=new AjxCallback(this,this.popView);
+this._createLoadingView()
+};
+ZmAppViewMgr.C_BANNER="banner";
+ZmAppViewMgr.C_USER_INFO="userInfo";
+ZmAppViewMgr.C_QUOTA_INFO="quota";
+ZmAppViewMgr.C_SEARCH="search";
+ZmAppViewMgr.C_SEARCH_BUILDER="searchBuilder";
+ZmAppViewMgr.C_SEARCH_BUILDER_TOOLBAR="searchBuilderToolbar";
+ZmAppViewMgr.C_APP_CHOOSER="appChooser";
+ZmAppViewMgr.C_TREE="tree";
+ZmAppViewMgr.C_TREE_FOOTER="treeFooter";
+ZmAppViewMgr.C_TOOLBAR_TOP="topToolbar";
+ZmAppViewMgr.C_TOOLBAR_BOTTOM="bottomToolbar";
+ZmAppViewMgr.C_APP_CONTENT="main";
+ZmAppViewMgr.C_APP_CONTENT_FULL="fullScreen";
+ZmAppViewMgr.C_STATUS="status";
+ZmAppViewMgr.C_SASH="sash";
+ZmAppViewMgr.C_TASKBAR="taskbar";
+ZmAppViewMgr.C_FOOTER="footer";
+ZmAppViewMgr.C_AD="adsrvc";
+ZmAppViewMgr.ALL_COMPONENTS=[ZmAppViewMgr.C_BANNER,ZmAppViewMgr.C_USER_INFO,ZmAppViewMgr.C_QUOTA_INFO,ZmAppViewMgr.C_SEARCH,ZmAppViewMgr.C_SEARCH_BUILDER,ZmAppViewMgr.C_SEARCH_BUILDER_TOOLBAR,ZmAppViewMgr.C_APP_CHOOSER,ZmAppViewMgr.C_TREE,ZmAppViewMgr.C_TREE_FOOTER,ZmAppViewMgr.C_TOOLBAR_TOP,ZmAppViewMgr.C_TOOLBAR_BOTTOM,ZmAppViewMgr.C_APP_CONTENT,ZmAppViewMgr.C_APP_CONTENT_FULL,ZmAppViewMgr.C_STATUS,ZmAppViewMgr.C_SASH,ZmAppViewMgr.C_TASKBAR,ZmAppViewMgr.C_FOOTER,ZmAppViewMgr.C_AD];
+ZmAppViewMgr.APP_COMPONENTS=[ZmAppViewMgr.C_TREE,ZmAppViewMgr.C_TREE_FOOTER,ZmAppViewMgr.C_STATUS,ZmAppViewMgr.C_SASH];
+ZmAppViewMgr.CONT_ID_KEY={};
+ZmAppViewMgr.CB_PRE_HIDE=1;
+ZmAppViewMgr.CB_POST_HIDE=2;
+ZmAppViewMgr.CB_PRE_SHOW=3;
+ZmAppViewMgr.CB_POST_SHOW=4;
+ZmAppViewMgr.CB_PRE_UNLOAD=5;
+ZmAppViewMgr.PENDING_VIEW="ZmAppViewMgr.PENDING_VIEW";
+ZmAppViewMgr.BROWSER_BACK="BACK";
+ZmAppViewMgr.BROWSER_FORWARD="FORWARD";
+ZmAppViewMgr.TAB_BUTTON_MAX_TEXT=15;
+ZmAppViewMgr._setContainerIds=function(){
+ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_BANNER]=ZmId.SKIN_LOGO;
+ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_USER_INFO]=ZmId.SKIN_USER_INFO;
+ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_QUOTA_INFO]=ZmId.SKIN_QUOTA_INFO;
+ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_SEARCH]=ZmId.SKIN_SEARCH;
+ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_SEARCH_BUILDER]=ZmId.SKIN_SEARCH_BUILDER;
+ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_SEARCH_BUILDER_TOOLBAR]=ZmId.SKIN_SEARCH_BUILDER_TOOLBAR;
+ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_APP_CHOOSER]=ZmId.SKIN_APP_CHOOSER;
+ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_TREE]=ZmId.SKIN_TREE;
+ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_TREE_FOOTER]=ZmId.SKIN_TREE_FOOTER;
+ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_TOOLBAR_TOP]=ZmId.SKIN_APP_TOP_TOOLBAR;
+ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_TOOLBAR_BOTTOM]=ZmId.SKIN_APP_BOTTOM_TOOLBAR;
+ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_APP_CONTENT]=ZmId.SKIN_APP_MAIN;
+ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_APP_CONTENT_FULL]=ZmId.SKIN_APP_MAIN_FULL;
+ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_STATUS]=ZmId.SKIN_STATUS;
+ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_SASH]=ZmId.SKIN_SASH;
+ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_TASKBAR]=ZmId.SKIN_TASKBAR;
+ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_FOOTER]=ZmId.SKIN_FOOTER;
+ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_AD]=ZmId.SKIN_AD
+};
+ZmAppViewMgr.prototype.toString=function(){
+return"ZmAppViewMgr"
+};
+ZmAppViewMgr.prototype.isFullScreen=function(e){
+e=e||this._currentView;
+return Boolean(e&&this._views[e]&&this._views[e][ZmAppViewMgr.C_APP_CONTENT_FULL])
+};
+ZmAppViewMgr.prototype.addComponents=function(o,l,t){
+var r=[];
+for(var h in o){
+var n=o[h];
+this._components[h]=n;
+if(this._hasSkin){
+if(!this._containers[h]){
+var a=ZmAppViewMgr.CONT_ID_KEY[h];
+var s=document.getElementById(a);
+if(!s&&h==ZmAppViewMgr.C_APP_CONTENT_FULL){
+a=ZmAppViewMgr.CONT_ID_KEY[ZmAppViewMgr.C_APP_CONTENT];
+s=document.getElementById(a)
+}
+if(!s){
+continue
+}
+this._containers[h]=s;
+if(l){
+s.innerHTML="";
+var e=this._getContainerBounds(h);
+if(e){
+n.setBounds(e.x,e.y,e.width,e.height)
+}}}
+r.push(h)
+}
+if(!t){
+n.zShow(true)
+}
+if(h==ZmAppViewMgr.C_SASH){
+if(this._sashSupported){
+n.registerCallback(this._appTreeSashCallback,this)
+}
+n.setCursor("default")
+}}
+if(l){
+this._fitToContainer(r)
+}};
+ZmAppViewMgr.prototype.setComponent=function(o,t){
+var e=this._components[o];
+if(e){
+e.setLocation(Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE)
+}
+var a={};
+a[o]=t;
+this.addComponents(a,true)
+};
+ZmAppViewMgr.prototype.showSearchBuilder=function(t){
+skin.show("searchBuilder",t);
+this._components[ZmAppViewMgr.C_SEARCH_BUILDER_TOOLBAR].zShow(t);
+this._components[ZmAppViewMgr.C_SEARCH_BUILDER].zShow(t);
+var e=[ZmAppViewMgr.C_SEARCH_BUILDER,ZmAppViewMgr.C_SEARCH_BUILDER_TOOLBAR,ZmAppViewMgr.C_APP_CHOOSER,ZmAppViewMgr.C_TREE,ZmAppViewMgr.C_TREE_FOOTER,ZmAppViewMgr.C_TOOLBAR_TOP,ZmAppViewMgr.C_APP_CONTENT,ZmAppViewMgr.C_APP_CONTENT_FULL];
+this._fitToContainer(e);
+if(!t){
+this._components[ZmAppViewMgr.C_SEARCH_BUILDER].setLocation(Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE)
+}};
+ZmAppViewMgr.prototype.showTreeFooter=function(e){
+skin.show("treeFooter",e);
+this._components[ZmAppViewMgr.C_TREE_FOOTER].zShow(e&&!this.isFullScreen());
+this._fitToContainer([ZmAppViewMgr.C_TREE,ZmAppViewMgr.C_TREE_FOOTER])
+};
+ZmAppViewMgr.prototype.getCurrentViewId=function(){
+return this._currentView
+};
+ZmAppViewMgr.prototype.getCurrentViewComponent=function(e){
+return this._components[e]
+};
+ZmAppViewMgr.prototype.getLastViewId=function(){
+return this._lastView
+};
+ZmAppViewMgr.prototype.getCurrentView=function(){
+var e=this._views[this._currentView];
+return e?e[ZmAppViewMgr.C_APP_CONTENT]||e[ZmAppViewMgr.C_APP_CONTENT_FULL]:null
+};
+ZmAppViewMgr.prototype.getAppView=function(e){
+return this._appView[e]
+};
+ZmAppViewMgr.prototype.setAppView=function(t,e){
+this._appView[t]=e
+};
+ZmAppViewMgr.prototype.createView=function(t){
+var e=t.viewId;
+this._views[e]=t.elements;
+this._callbacks[e]=t.callbacks||{};
+this._viewApp[e]=t.appName;
+this._isAppView[e]=t.isAppView;
+this._isTransient[e]=t.isTransient;
+if(!this._isNewWindow&&t.tabParams){
+this._tabParams[e]=t.tabParams;
+this._isTabView[e]=Boolean(t.tabParams!=null);
+this._viewByTabId[t.tabParams.id]=e
+}};
+ZmAppViewMgr.prototype.pushView=function(c,t){
+c=this._viewByTabId[c]||c;
+var a=(c==ZmAppViewMgr.PENDING_VIEW);
+if(!a&&!this._views[c]){
+return false
+}
+if(a){
+c=this._pendingView
+}
+var e=this._getViewController(c);
+if(c==this._currentView){
+this._setViewVisible(c,true);
+if(e){
+e._restoreFocus()
+}
+return true
+}
+if(this._isTabView[c]){
+var l=this._tabParams[c];
+var r=l&&l.tabCallback&&l.tabCallback.run(this._currentView,c);
+if(l&&!r){
+var u=appCtxt.getAppChooser();
+var s=u.getButton(l.id);
+if(!s){
+s=u.addButton(l.id,l);
+s.setHoverImage("Close")
+}}}
+if(a){
+t=true
+}
+if(!this._hideView(this._currentView,t||this._isTabView[this._currentView])){
+this._pendingAction=this._pushCallback;
+this._pendingView=c;
+return false
+}
+this.addComponents(this._views[c]);
+var h=this._getViewController(this._currentView);
+var o=this._isTransient[this._currentView]||(h&&h.isTransient(this._currentView,c));
+if(this._currentView&&(this._currentView!=c)&&!o){
+this._hidden.push(this._currentView)
+}
+this._removeFromHidden(c);
+var d=this._lastView;
+this._lastView=this._currentView;
+this._currentView=c;
+if(!this._showView(c,t,(c!=this._currentView))){
+this._currentView=this._lastView;
+this._lastView=d;
+this._pendingAction=this._pushCallback;
+this._pendingView=c;
+return false
+}
+if(this._noHistory){
+this._noHistory=false
+}else{
+if(c!=ZmId.VIEW_LOADING){
+this._nextHashIndex++;
+this._curHashIndex=this._nextHashIndex;
+this._hashView[this._curHashIndex]=c;
+if(this._historyMgr){
+this._historyMgr.add(this._curHashIndex)
+}}}
+this._layout(this._currentView);
+if(e&&e.setCurrentView){
+e.setCurrentView(c)
+}
+if(this._isAppView[c]){
+this.setAppView(this._viewApp[c],c)
+}
+if(this._toRemove.length){
+for(var n=0;
+n<this._toRemove.length;
+n++){
+this._removeFromHidden(this._toRemove[n])
+}
+this._toRemove=[]
+}
+return true
+};
+ZmAppViewMgr.prototype.popView=function(t,e){
+if(!this._currentView){
+return false
+}
+var a=(t==ZmAppViewMgr.PENDING_VIEW);
+if(a){
+e=t;
+t=true
+}
+if(e&&!a&&(this.getCurrentViewId()!=e)){
+return false
+}
+if(!this._hidden.length&&!this._isNewWindow){
+if(location&&(location.search.match(/\bview=compose\b/))){
+this._controller.activateApp(ZmApp.MAIL)
+}
+return false
+}
+if(!this._hideView(this._currentView,t)){
+this._pendingAction=this._popCallback;
+this._pendingView=null;
+return false
+}
+this._deactivateView(this._views[this._currentView]);
+if(this._isTabView[this._currentView]){
+appCtxt.getAppChooser().removeButton(this._tabParams[this._currentView].id)
+}
+this._lastView=this._currentView;
+this._currentView=this._hidden.pop();
+if(!this._currentView&&this._isNewWindow){
+window.close();
+return false
+}
+if(!this._showView(this._currentView,this._popCallback,null,t,true)){
+return false
+}
+this._removeFromHidden(this._currentView);
+if(this._historyMgr){
+if(this._noHistory){
+this._noHistory=false
+}else{
+this._ignoreHistoryChange=true;
+history.back()
+}}
+this.addComponents(this._views[this._currentView]);
+this._layout(this._currentView);
+return true
+};
+ZmAppViewMgr.prototype.setView=function(t,n){
+var e=this.pushView(t,n);
+if(e){
+for(var o=0;
+o<this._hidden.length;
+o++){
+var a=this._views[this._hidden[o]];
+this._deactivateView(a)
+}
+this._hidden=[]
+}
+return e
+};
+ZmAppViewMgr.prototype.stageView=function(e){
+this._removeFromHidden(e);
+this._hidden.push(e)
+};
+ZmAppViewMgr.prototype.replaceView=function(n,e){
+n=n||this._currentView;
+var t=this._views[n];
+var o=this._views[e];
+this._hideView(n,true);
+for(var a in o){
+t[a]=o[a]
+}
+if(this._currentView==n){
+this._currentView=e;
+this._showView(e);
+this._layout(this._currentView)
+}};
+ZmAppViewMgr.prototype.isAppView=function(e){
+return this._isAppView[e]
+};
+ZmAppViewMgr.prototype.showPendingView=function(e){
+if(e&&this._pendingAction){
+this._pendingAction.run(ZmAppViewMgr.PENDING_VIEW)
+}
+if(!e){
+if(this._browserAction==ZmAppViewMgr.BROWSER_BACK){
+this._ignoreHistoryChange=true;
+history.forward()
+}else{
+if(this._browserAction==ZmAppViewMgr.BROWSER_FORWARD){
+this._ignoreHistoryChange=true;
+history.back()
+}}
+this._browserAction=null
+}
+this._pendingAction=this._pendingView=null
+};
+ZmAppViewMgr.prototype.fitAll=function(){
+this._fitToContainer(ZmAppViewMgr.ALL_COMPONENTS)
+};
+ZmAppViewMgr.prototype.getPendingViewId=function(){
+return this._pendingView
+};
+ZmAppViewMgr.prototype.reset=function(){
+this._shell.removeControlListener(this._controlListener);
+for(var t in this._views){
+var a=this._views[t];
+for(var e=0;
+e<a.length;
+e++){
+for(var o in a[e]){
+this._components[o].dispose();
+this._components[o]=null;
+this._containers[o]=null
+}}}};
+ZmAppViewMgr.prototype.updateTitle=function(){
+this._setTitle(this._currentView)
+};
+ZmAppViewMgr.prototype.setTabTitle=function(e,o){
+var a=this._tabParams[e];
+var t=!appCtxt.isChildWindow&&a&&appCtxt.getAppChooser().getButton(a.id);
+if(t){
+t.setText(o)
+}};
+ZmAppViewMgr.prototype.isOkToUnload=function(){
+var t=AjxUtil.getHashKeys(this._isTabView);
+if(!this._isTabView[this._currentView]){
+t.push(this._currentView)
+}
+for(var o=0;
+o<t.length;
+o++){
+var e=t[o];
+var n=this._callbacks[e]&&this._callbacks[e][ZmAppViewMgr.CB_PRE_UNLOAD];
+if(n){
+var a=n.run(e);
+if(!a){
+return false
+}}}
+return true
+};
+ZmAppViewMgr.prototype._createLoadingView=function(){
+var t=new DwtControl({
+parent:this._shell,className:"DwtListView",posStyle:Dwt.ABSOLUTE_STYLE,id:ZmId.LOADING_VIEW}
+);
+var e=t.getHtmlElement();
+e.innerHTML=AjxTemplate.expand("share.App#Loading",this._htmlElId);
+var a={};
+a[ZmAppViewMgr.C_APP_CONTENT]=t;
+this.createView({
+viewId:ZmId.VIEW_LOADING,elements:a}
+)
+};
+ZmAppViewMgr.prototype._fitToContainer=function(n,h){
+for(var t=0;
+t<n.length;
+t++){
+var r=n[t];
+if(!h&&AjxEnv.isIE&&(r==ZmAppViewMgr.C_TASKBAR)){
+if(!this._ieHackAction){
+this._ieHackAction=new AjxTimedAction(this,this._fitToContainer,[[ZmAppViewMgr.C_TASKBAR],true])
+}
+AjxTimedAction.scheduleAction(this._ieHackAction,1)
+}
+var d=this._containers[r];
+if(d){
+var s=this._components[r];
+if(s&&(s.getZIndex()!=Dwt.Z_HIDDEN)){
+var a=this._getComponentPosition(r);
+var l=(a==Dwt.STATIC_STYLE);
+var c=s.getHtmlElement();
+if(a){
+c.style.position=a
+}
+if(l){
+if(c.parentNode!=d){
+d.appendChild(c)
+}
+if(s.adjustSize){
+s.adjustSize()
+}}else{
+var o=Dwt.getBounds(d);
+var e=Dwt.getInsets(d);
+Dwt.insetBounds(o,e);
+this._contBounds[r]=o;
+s.setBounds(o.x,o.y,o.width,o.height)
+}}}}
+if(window.DBG&&DBG.getDebugLevel()>=AjxDebug.DBG2){
+this._debugShowMetrics(n)
+}};
+ZmAppViewMgr.prototype._getComponentPosition=function(e){
+return appCtxt.getSkinHint(e,"position")
+};
+ZmAppViewMgr.prototype._getContainerBounds=function(n){
+var e=this._getComponentPosition(n);
+if(e==Dwt.STATIC_STYLE){
+return null
+}
+var a=this._containers[n];
+if(a){
+var o=Dwt.getBounds(a);
+var t=Dwt.getInsets(a);
+Dwt.insetBounds(o,t);
+return o
+}
+return null
+};
+ZmAppViewMgr.prototype._layout=function(t){
+if(this._hasSkin){
+return
+}
+var a=this._components[ZmAppViewMgr.C_TOOLBAR_TOP];
+var n=a.getSize();
+var e=n.y?n.y:a.getHtmlElement().clientHeight;
+a.setBounds(0,0,this._shellSz.x,e);
+var o=this._components[ZmAppViewMgr.C_APP_CONTENT]||this._components[ZmAppViewMgr.C_APP_CONTENT_FULL];
+o.setBounds(0,e,this._shellSz.x,this._shellSz.y-e)
+};
+ZmAppViewMgr.prototype._hideView=function(e,a){
+if(!e){
+return true
+}
+var t=true;
+var o=this._callbacks[e]?this._callbacks[e][ZmAppViewMgr.CB_PRE_HIDE]:null;
+if(o){
+t=o.run(e,a)
+}
+if(t){
+this._setViewVisible(e,false);
+if(appCtxt.get(ZmSetting.USE_KEYBOARD_SHORTCUTS)){
+appCtxt.getKeyboardMgr().clearKeySeq()
+}
+o=this._callbacks[e]?this._callbacks[e][ZmAppViewMgr.CB_POST_HIDE]:null;
+if(o){
+o.run(e)
+}}
+return t
+};
+ZmAppViewMgr.prototype._showView=function(e,o,a){
+var t=true;
+var n=this._callbacks[e]?this._callbacks[e][ZmAppViewMgr.CB_PRE_SHOW]:null;
+if(n){
+t=n.run(e,a,o)
+}
+if(t){
+this._setViewVisible(e,true);
+n=this._callbacks[e]?this._callbacks[e][ZmAppViewMgr.CB_POST_SHOW]:null;
+if(n){
+n.run(e,a)
+}}
+appCtxt.notifyZimlets("onShowView",[e,a],{
+noChildWindow:true}
+);
+return t
+};
+ZmAppViewMgr.prototype._setViewVisible=function(d,u){
+var t=this._views[d];
+var n=this._lastView?this.isFullScreen(this._lastView):null;
+var a=this.isFullScreen(d);
+if(u){
+if(n!==a){
+if(this._hasSkin){
+skin.show("fullScreen",a)
+}
+for(var s=0;
+s<ZmAppViewMgr.APP_COMPONENTS.length;
+s++){
+var c=ZmAppViewMgr.APP_COMPONENTS[s];
+var r=this._components[c];
+if(!r){
+continue
+}
+r.zShow(!a);
+if(a){
+try{
+r.setLocation(Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE)
+}
+catch(l){}}}
+if(!a&&this._hasSkin){
+this._fitToContainer(ZmAppViewMgr.APP_COMPONENTS)
+}}
+var h=[];
+for(var c in t){
+h.push(c);
+t[c].zShow(true);
+this._components[c]=t[c]
+}
+if(this._hasSkin){
+this._fitToContainer(h)
+}
+this._setTitle(d);
+if(this._isTabView[d]){
+var o=this._tabParams[d].id;
+this._controller.setActiveTabId(o)
+}
+if(this._viewApp[d]){
+this._controller.setActiveApp(this._viewApp[d],d,this._isTabView[d])
+}}else{
+for(var c in t){
+t[c].setLocation(Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
+t[c].zShow(false)
+}}};
+ZmAppViewMgr.prototype._removeFromHidden=function(e){
+var a=[];
+for(var t=0;
+t<this._hidden.length;
+t++){
+if(this._hidden[t]!=e){
+a.push(this._hidden[t])
+}}
+this._hidden=a
+};
+ZmAppViewMgr.prototype._deactivateView=function(e){
+for(var a in e){
+var t=e[a];
+if(t.deactivate){
+t.deactivate()
+}}};
+ZmAppViewMgr.prototype._setTitle=function(e){
+var a=this._views[e];
+if(!a){
+return
+}
+var t=a[ZmAppViewMgr.C_APP_CONTENT]||a[ZmAppViewMgr.C_APP_CONTENT_FULL];
+if(t&&t.getTitle){
+var o=t.getTitle();
+Dwt.setTitle(o?o:ZmMsg.zimbraTitle)
+}};
+ZmAppViewMgr.prototype._shellControlListener=function(o){
+if(o.oldWidth!=o.newWidth||o.oldHeight!=o.newHeight){
+this._shellSz.x=o.newWidth;
+this._shellSz.y=o.newHeight;
+var a=o.newWidth-o.oldWidth;
+var r=o.newHeight-o.oldHeight;
+if(this._isNewWindow){
+var t=this._views[this._currentView][ZmAppViewMgr.C_TOOLBAR_TOP];
+if(t){
+t.setSize(o.newWidth,Dwt.DEFAULT)
+}
+var e=this._views[this._currentView];
+var s=e[ZmAppViewMgr.C_APP_CONTENT]||e[ZmAppViewMgr.C_APP_CONTENT_FULL];
+if(s){
+s.setSize(o.newWidth,o.newHeight-t.getH())
+}}else{
+if(r&&a){
+this.fitAll(true)
+}else{
+if(r){
+var n=[ZmAppViewMgr.C_APP_CHOOSER,ZmAppViewMgr.C_TREE,ZmAppViewMgr.C_TREE_FOOTER,ZmAppViewMgr.C_SASH,ZmAppViewMgr.C_APP_CONTENT,ZmAppViewMgr.C_APP_CONTENT_FULL,ZmAppViewMgr.C_STATUS,ZmAppViewMgr.C_TASKBAR,ZmAppViewMgr.C_AD,ZmAppViewMgr.C_FOOTER];
+this._fitToContainer(n,true)
+}else{
+if(a){
+var n=[ZmAppViewMgr.C_BANNER,ZmAppViewMgr.C_SEARCH,ZmAppViewMgr.C_USER_INFO,ZmAppViewMgr.C_QUOTA_INFO,ZmAppViewMgr.C_SEARCH_BUILDER,ZmAppViewMgr.C_SEARCH_BUILDER_TOOLBAR,ZmAppViewMgr.C_TOOLBAR_TOP,ZmAppViewMgr.C_APP_CONTENT,ZmAppViewMgr.C_APP_CONTENT_FULL,ZmAppViewMgr.C_TOOLBAR_BOTTOM,ZmAppViewMgr.C_TASKBAR,ZmAppViewMgr.C_AD,ZmAppViewMgr.C_FOOTER];
+this._fitToContainer(n,true)
+}}}}}};
+ZmAppViewMgr.prototype._debugShowMetrics=function(o){
+for(var t=0;
+t<o.length;
+t++){
+var n=o[t];
+var e=this._containers[n];
+if(e){
+var a=Dwt.getBounds(e)
+}}};
+ZmAppViewMgr.prototype._historyChangeListener=function(a){
+if(!(a&&a.data)){
+return
+}
+if(this._ignoreHistoryChange){
+this._ignoreHistoryChange=false;
+return
+}
+var o=DwtBaseDialog.getActiveDialog();
+if(o&&o.isPoppedUp()){
+o.popdown()
+}
+var t=parseInt(a.data);
+this._noHistory=true;
+var e=this._hashView[t];
+if(t==(this._curHashIndex-1)){
+this._browserAction=ZmAppViewMgr.BROWSER_BACK;
+this.popView()
+}else{
+if(t==(this._curHashIndex+1)){
+this._browserAction=ZmAppViewMgr.BROWSER_FORWARD;
+this.pushView(e)
+}else{
+this._browserAction=null;
+this.pushView(e)
+}}
+this._curHashIndex=t
+};
+ZmAppViewMgr.prototype._appTreeSashCallback=function(o){
+if(!window.skin){
+return
+}
+var e=skin.getTreeWidth();
+if(!e){
+return 0
+}
+if(!this.treeMinSize){
+this.treeMinSize=window.skin.hints.tree.minWidth||150;
+this.treeMaxSize=window.skin.hints.tree.maxWidth||300
+}
+if(e+o>this.treeMaxSize){
+o=Math.max(0,this.treeMaxSize-e)
+}
+if(e+o<this.treeMinSize){
+o=Math.min(0,this.treeMinSize-e)
+}
+var t=e+o;
+skin.setTreeWidth(t);
+var a=this;
+setTimeout(function(){
+a.fitAll(true)
+}
+,0);
+return o
+};
+ZmAppViewMgr.prototype._getViewController=function(e){
+var o;
+var t=this._views[e];
+if(t){
+var a=t[ZmAppViewMgr.C_APP_CONTENT]||t[ZmAppViewMgr.C_APP_CONTENT_FULL];
+o=a&&a.getController&&a.getController()
+}
+return o
+}
+}
+if(AjxPackage.define("zimbraMail.core.ZmRequestMgr")){
+ZmRequestMgr=function(e){
+this._controller=e;
+appCtxt.setRequestMgr(this);
+ZmCsfeCommand.setServerUri(appCtxt.get(ZmSetting.CSFE_SERVER_URI));
+var t=appCtxt.get(ZmSetting.CLIENT_VERSION);
+ZmCsfeCommand.clientVersion=(!t||t.indexOf("@")==0)?"dev build":t;
+this._shell=appCtxt.getShell();
+this._highestNotifySeen=0;
+this._cancelActionId={};
+this._pendingRequests={};
+this._useXml=appCtxt.get(ZmSetting.USE_XML);
+this._logRequest=appCtxt.get(ZmSetting.LOG_REQUEST);
+this._stdTimeout=appCtxt.get(ZmSetting.TIMEOUT);
+this._unreadListener=new AjxListener(this,this._unreadChangeListener)
+};
+ZmRequestMgr._SENT=1;
+ZmRequestMgr._RESPONSE=2;
+ZmRequestMgr._CANCEL=3;
+ZmRequestMgr.RETRY_MAX=2;
+ZmRequestMgr.RETRY_DELAY=5;
+ZmRequestMgr.RETRY_ON_EXCEPTION={};
+ZmRequestMgr.RETRY_ON_EXCEPTION[ZmCsfeException.EMPTY_RESPONSE]=true;
+ZmRequestMgr._nextReqId=1;
+ZmRequestMgr.prototype.toString=function(){
+return"ZmRequestMgr"
+};
+ZmRequestMgr.prototype.sendRequest=function(x){
+var t=x.response;
+if(t){
+if(x.reqId){
+x=this._pendingRequests[x.reqId]||x;
+x.response=t
+}
+x.asyncMode=true;
+return this._handleResponseSendRequest(x,new ZmCsfeResult(t))
+}
+var y=x.reqId=("Req_"+ZmRequestMgr._nextReqId++);
+var c=(x.timeout!=null)?x.timeout:this._stdTimeout;
+if(c){
+c=c*1000
+}
+var q=x.asyncMode?new AjxCallback(this,this._handleResponseSendRequest,[x]):null;
+if(x.sensitive){
+var v=document.location.protocol==ZmSetting.PROTO_HTTP;
+var s=appCtxt.get(ZmSetting.PROTOCOL_MODE)==ZmSetting.PROTO_MIXED;
+if(v&&s){
+x.noSession=true;
+var o=ZmCsfeCommand.getRequestStr(x);
+var d=document.location;
+var u=appCtxt.get(ZmSetting.HTTPS_PORT);
+if(u&&u!=ZmSetting.DEFAULT_HTTPS_PORT){
+u=":"+u
+}
+var h=document.createElement("IFRAME");
+h.style.display="none";
+h.id=Dwt.getNextId();
+document.body.appendChild(h);
+var p=Dwt.getIframeDoc(h);
+p.write("<form ","id=",h.id,"-form ","target=",h.id,"-iframe ","method=POST ","action='https://",d.hostname,u,appContextPath,"/public/secureRequest.jsp'",">","<input type=hidden name=reqId value='",y,"'>","<textarea name=data>",AjxStringUtil.htmlEncode(o),"</textarea>","</form>","<iframe name=",h.id,"-iframe></iframe>");
+p.close();
+x.iframeId=h.id;
+this._pendingRequests[y]=x;
+var a=p.getElementById(h.id+"-form");
+a.submit();
+return
+}}
+var n=new ZmCsfeCommand();
+var e=x.accountName;
+if(!e){
+var f=appCtxt.getActiveAccount();
+e=(f&&f.id!=ZmAccountList.DEFAULT_ID)?f.name:null
+}
+var l,m;
+if(x.restUri){
+l={
+restUri:x.restUri,asyncMode:x.asyncMode,callback:q}
+}else{
+l={
+jsonObj:x.jsonObj,soapDoc:x.soapDoc,accountName:e,useXml:this._useXml,changeToken:(e?null:this._changeToken),asyncMode:x.asyncMode,callback:q,logRequest:this._logRequest,highestNotifySeen:this._highestNotifySeen,skipAuthCheck:x.skipAuthCheck,resend:x.resend,noSession:x.noSession};
+m=x.methodName=ZmCsfeCommand.getMethodName(l.jsonObj||l.soapDoc)
+}
+appCtxt.currentRequestParams=x;
+var b=c?[y,x.errorCallback,x.noBusyOverlay]:null;
+if(!x.noBusyOverlay){
+var r=null;
+var g=false;
+if(c){
+r=new AjxCallback(this,this.cancelRequest,b);
+this._shell.setBusyDialogText(ZmMsg.askCancel);
+g=true
+}
+this._shell.setBusy(true,y,g,c,r)
+}else{
+if(c){
+var w=new AjxTimedAction(this,this.cancelRequest,b);
+this._cancelActionId[y]=AjxTimedAction.scheduleAction(w,c)
+}}
+this._pendingRequests[y]=n;
+try{
+var t=x.restUri?n.invokeRest(l):n.invoke(l);
+n.state=ZmRequestMgr._SENT
+}
+catch(k){
+this._handleResponseSendRequest(x,new ZmCsfeResult(k,true));
+return
+}
+return(x.asyncMode)?y:(this._handleResponseSendRequest(x,t))
+};
+ZmRequestMgr.prototype._handleResponseSendRequest=function(r,e){
+var s=(r.response!=null);
+if(!s){
+if(!this._pendingRequests[r.reqId]){
+return
+}
+if(this._pendingRequests[r.reqId].state==ZmRequestMgr._CANCEL){
+return
+}
+this._pendingRequests[r.reqId].state=ZmRequestMgr._RESPONSE;
+if(!r.noBusyOverlay){
+this._shell.setBusy(false,r.reqId)
+}else{
+if(r.timeout){
+AjxTimedAction.cancelAction(this._cancelActionId[r.reqId]);
+this._cancelActionId[r.reqId]=-1
+}}}
+var a;
+try{
+if(r.asyncMode&&!r.restUri){
+a=e.getResponse()
+}else{
+if(e._isException){
+throw e._data
+}else{
+a=e
+}}
+if(a.Header){
+this._handleHeader(a.Header)
+}}
+catch(o){
+if(r.errorCallback){
+var n=r.errorCallback.run(o);
+if(!n){
+this._handleException(o,r)
+}}else{
+this._handleException(o,r)
+}
+var h=e.getHeader();
+if(h){
+this._handleHeader(h);
+this._handleNotifications(h)
+}
+this._clearPendingRequest(r.reqId);
+return
+}
+if(r.asyncMode&&!r.restUri){
+e.set(a.Body)
+}
+if(!appCtxt.isOffline&&!s){
+this._controller._kickPolling(true)
+}
+var t=(DBG&&DBG.getDebugLevel()>0)?ZmCsfeCommand.getMethodName(r.jsonObj||r.soapDoc):"";
+if(r.asyncMode&&r.callback){
+r.callback.run(e)
+}
+this._handleNotifications(a.Header);
+this._clearPendingRequest(r.reqId);
+if(!r.asyncMode){
+return a.Body
+}};
+ZmRequestMgr.prototype.cancelRequest=function(o,e,t){
+if(!this._pendingRequests[o]){
+return
+}
+if(this._pendingRequests[o].state==ZmRequestMgr._RESPONSE){
+return
+}
+this._pendingRequests[o].state=ZmRequestMgr._CANCEL;
+if(!t){
+this._shell.setBusy(false,o)
+}
+this._pendingRequests[o].cancel();
+if(e){
+var a=new AjxException("Request canceled",AjxException.CANCELED,"ZmRequestMgr.prototype.cancelRequest");
+e.run(a)
+}
+this._clearPendingRequest(o)
+};
+ZmRequestMgr.prototype._clearPendingRequest=function(a){
+var t=this._pendingRequests[a];
+if(t){
+if(t.iframeId){
+var e=document.getElementById(t.iframeId);
+if(e){
+e.parentNode.removeChild(e)
+}}
+delete this._pendingRequests[a]
+}};
+ZmRequestMgr.prototype._handleHeader=function(o){
+if(!o){
+return
+}
+if(o&&o.context&&o.context.change){
+this._changeToken=o.context.change.token
+}
+if(o&&o.context&&o.context.refresh){
+this._highestNotifySeen=0;
+if(!appCtxt.isOffline||!appCtxt.multiAccounts){
+this._refreshHandler(o.context.refresh)
+}}
+if(o&&o.context.zdsync&&o.context.zdsync.account){
+var e=o.context.zdsync.account;
+for(var t=0;
+t<e.length;
+t++){
+var a=appCtxt.accountList.getAccount(e[t].id);
+if(a){
+a.updateState(e[t])
+}}}};
+ZmRequestMgr.prototype._handleException=function(e,a){
+var t=false;
+if(ZmRequestMgr.RETRY_ON_EXCEPTION[e.code]){
+a.retryCount=a.retryCount||0;
+if(a.retryCount<ZmRequestMgr.RETRY_MAX){
+a.resend=ZmCsfeCommand.RETRY;
+a.retryCount++;
+AjxTimedAction.scheduleAction(new AjxTimedAction(this,function(){
+this.sendRequest(a)
+}
+),ZmRequestMgr.RETRY_DELAY*1000);
+t=true
+}}
+if(!t){
+this._controller._handleException(e,a)
+}};
+ZmRequestMgr.prototype._handleNotifications=function(a){
+if(a&&a.context&&a.context.notify){
+for(i=0;
+i<a.context.notify.length;
+i++){
+var t=a.context.notify[i];
+var e=t.seq;
+if(t.seq>this._highestNotifySeen){
+this._highestNotifySeen=e;
+this._notifyHandler(t)
+}else{}}}};
+ZmRequestMgr.prototype._refreshHandler=function(t){
+this._controller.runAppFunction("_clearDeferredFolders");
+if(t.version){
+if(!this._canceledReload){
+var n=appCtxt.get(ZmSetting.SERVER_VERSION);
+if(n!=t.version){
+appCtxt.set(ZmSetting.SERVER_VERSION,t.version);
+if(n){
+var o=appCtxt.getYesNoMsgDialog();
+o.reset();
+o.registerCallback(DwtDialog.YES_BUTTON,this._reloadYesCallback,this,[o,n,t.version]);
+o.registerCallback(DwtDialog.NO_BUTTON,this._reloadNoCallback,this,[o,t]);
+var a=AjxMessageFormat.format(ZmMsg.versionChangeRestart,[n,t.version]);
+o.setMessage(a,DwtMessageDialog.WARNING_STYLE);
+o.popup();
+return
+}}}}
+var e={};
+this._loadTree(ZmOrganizer.TAG,e,t.tags);
+this._loadTree(ZmOrganizer.FOLDER,e,t.folder[0],"folder");
+this._controller.runAppFunction("refresh",false,t)
+};
+ZmRequestMgr.prototype._reloadYesCallback=function(t){
+t.popdown();
+window.onbeforeunload=null;
+var e=AjxUtil.formatUrl();
+ZmZimbraMail.sendRedirect(e)
+};
+ZmRequestMgr.prototype._reloadNoCallback=function(e,t){
+e.popdown();
+this._canceledReload=true;
+this._refreshHandler(t)
+};
+ZmRequestMgr.prototype._loadTree=function(a,t,s,r,n){
+var o=(a==ZmOrganizer.TAG);
+var e=appCtxt.getTree(a,n);
+if(e){
+e.reset()
+}else{
+e=o?new ZmTagTree(n):new ZmFolderTree()
+}
+appCtxt.setTree(a,e,n);
+e.addChangeListener(this._unreadListener);
+e.getUnreadHash(t);
+e.loadFromJs(s,r,n)
+};
+ZmRequestMgr.prototype._notifyHandler=function(e){
+this._controller.runAppFunction("preNotify",false,e);
+if(e.deleted&&e.deleted.id){
+this._handleDeletes(e.deleted)
+}
+if(e.created){
+this._handleCreates(e.created)
+}
+if(e.modified){
+this._handleModifies(e.modified)
+}
+this._controller.runAppFunction("postNotify",false,e)
+};
+ZmRequestMgr.prototype._handleDeletes=function(o){
+var t=o.id.split(",");
+this._controller.runAppFunction("deleteNotify",false,t);
+for(var e=0;
+e<t.length;
+e++){
+var n=t[e];
+if(!n){
+continue
+}
+var a=appCtxt.cacheGet(n);
+if(a){
+a.notifyDelete();
+appCtxt.cacheRemove(n);
+a=null
+}}};
+ZmRequestMgr.prototype._handleCreates=function(s){
+this._controller.runAppFunction("createNotify",false,s);
+for(var t in s){
+var r=s[t];
+for(var o=0;
+o<r.length;
+o++){
+var a=r[o];
+if(a._handled){
+continue
+}
+if(appCtxt.cacheGet(a.id)&&t!="tag"){
+continue
+}
+if(t=="tag"){
+var e=appCtxt.getTagTree();
+if(e){
+e.root.notifyCreate(a)
+}}else{
+if(t=="folder"||t=="search"||t=="link"){
+var h=a.l;
+var n=appCtxt.getById(h);
+if(n&&n.type!=ZmOrganizer.TAG){
+n.notifyCreate(a,(t=="search"))
+}}}}}};
+ZmRequestMgr.prototype._handleModifies=function(a){
+this._controller.runAppFunction("modifyNotify",false,a);
+for(var t in a){
+if(t=="mbx"){
+var l=a[t];
+for(var n=0;
+n<l.length;
+n++){
+var e=l[n];
+var h=e.acct;
+if(!h||(h&&h==appCtxt.getActiveAccount().id)){
+var d=appCtxt.getSettings().getSetting(ZmSetting.QUOTA_USED);
+d.notifyModify({
+_name:t,s:e.s}
+)
+}}
+continue
+}
+var s=a[t];
+for(var n=0;
+n<s.length;
+n++){
+var r=s[n];
+if(r._handled){
+continue
+}
+var c=appCtxt.cacheGet(r.id);
+if(!c&&t=="cn"&&AjxDispatcher.loaded("ContactsCore")){
+var o=appCtxt.getApp(ZmApp.CONTACTS);
+if(o.isContactListLoaded()){
+c=o.getContactList().getById(r.id)
+}}
+if(c){
+r._isRemote=(t=="folder"&&c.link);
+c.notifyModify(r)
+}}}};
+ZmRequestMgr._getObjList=function(a){
+var o=[];
+for(var e in a){
+var n=a[e];
+if(n instanceof Array){
+for(var t=0;
+t<n.length;
+t++){
+n[t]._name=e;
+o.push(n[t])
+}}else{
+n._name=e;
+o.push(n)
+}}
+return o
+};
+ZmRequestMgr.prototype._unreadChangeListener=function(n){
+if(n.event==ZmEvent.E_MODIFY){
+var t=n.getDetail("fields");
+if(t&&t[ZmOrganizer.F_UNREAD]){
+var a=n.getDetail("organizers");
+var e=a?a[0]:null;
+var r=e?(e.isSystem()?e.nId:e.id):null;
+var o=appCtxt.getCurrentSearch();
+if(o&&r&&(r==o.folderId||r==o.tagId)){
+Dwt.setTitle(o.getTitle())
+}
+var s=appCtxt.getApp(ZmApp.MAIL);
+if(s){
+s.setNewMailNotice(e)
+}}}}
+}
+if(AjxPackage.define("zimbraMail.core.ZmZimbraMail")){
+ZmZimbraMail=function(n){
+ZmController.call(this,null);
+this._userShell=n.userShell;
+this._requestMgr=new ZmRequestMgr(this);
+this._evt=new ZmAppEvent();
+this._evtMgr=new AjxEventMgr();
+for(var a in ZmZimbraMail._listeners){
+var o=ZmZimbraMail._listeners[a];
+if(o&&o.length){
+for(var e=0;
+e<o.length;
+e++){
+this._evtMgr.addListener(a,o[e])
+}}}
+ZmZimbraMail.addListener=AjxCallback.simpleClosure(this.addListener,this);
+ZmZimbraMail.addAppListener=AjxCallback.simpleClosure(this.addAppListener,this);
+window._zimbraMail=this;
+if(appCtxt.get(ZmSetting.HISTORY_SUPPORT_ENABLED)&&!AjxEnv.isSafari){
+window.historyMgr=appCtxt.getHistoryMgr()
+}
+this._settings=appCtxt.getSettings();
+var t=appCtxt.get(ZmSetting.BRANCH);
+if(window.DBG&&!DBG.isDisabled()){}
+appCtxt.setAppController(this);
+this._shell=appCtxt.getShell();
+this._apps={};
+this._upsellView={};
+this._activeApp=null;
+this._sessionTimer=new AjxTimedAction(null,ZmZimbraMail.logOff);
+this._sessionTimerId=-1;
+this._pollActionId=null;
+this._pollRequest=null;
+this._pollInstantNotifications=false;
+this.statusView=null;
+AjxDispatcher.setPackageLoadFunction("Zimlet",new AjxCallback(this,this._postLoadZimlet));
+AjxDispatcher.setPreLoadFunction(new AjxCallback(this,function(){
+this._appViewMgr.pushView(ZmId.VIEW_LOADING)
+}
+));
+AjxDispatcher.setPostLoadFunction(new AjxCallback(this,function(){
+this._appViewMgr._toRemove.push(ZmId.VIEW_LOADING)
+}
+));
+for(var e in ZmApp.QS_ARG){
+ZmApp.QS_ARG_R[ZmApp.QS_ARG[e]]=e
+}
+this.startup(n)
+};
+ZmZimbraMail.prototype=new ZmController;
+ZmZimbraMail.prototype.constructor=ZmZimbraMail;
+ZmMsg.BETA_documents=[ZmMsg.documents,ZmMsg.beta].join(" ");
+ZmApp.MAIN="ZmZimbraMail";
+ZmApp.DROP_TARGETS[ZmApp.MAIN]={};
+ZmZimbraMail._listeners={};
+ZmZimbraMail.prototype.toString=function(){
+return"ZmZimbraMail"
+};
+ZmZimbraMail.run=function(h){
+if(!window.DBG){
+ZmZimbraMail._createDummyDBG()
+}
+if(h.noSplashScreen){
+ZmZimbraMail.killSplash()
+}
+window.appCtxt=new ZmAppCtxt();
+appCtxt.rememberMe=false;
+if(h.offlineMode){
+appCtxt.isOffline=true
+}
+var r=new ZmSettings();
+appCtxt.setSettings(r);
+if(h.offlineMode){
+var e=AjxCookie.getCookie(document,ZmSetting.APPS_COOKIE);
+if(e){
+for(var s in ZmSetting.APP_LETTER){
+var n=ZmSetting.APP_LETTER[s];
+if(e.indexOf(n)!=-1){
+r.getSetting(s).setValue(true)
+}}}}
+if(h.settings){
+for(var t in h.settings){
+var a=r.getSettingByName(t);
+if(a){
+r.getSetting(a).setValue(h.settings[t])
+}}}
+ZmOperation.initialize();
+if(appCtxt.isOffline){
+appCtxt.set(ZmSetting.POLLING_INTERVAL,60,null,null,true)
+}
+if(h.devMode=="1"){
+appCtxt.set(ZmSetting.DEV,true);
+appCtxt.set(ZmSetting.POLLING_INTERVAL,0)
+}
+if(h.protocolMode){
+var l=(h.protocolMode.indexOf(":")==-1)?h.protocolMode+":":h.protocolMode;
+appCtxt.set(ZmSetting.PROTOCOL_MODE,l)
+}
+if(h.httpPort){
+appCtxt.set(ZmSetting.HTTP_PORT,h.httpPort)
+}
+if(h.httpsPort){
+appCtxt.set(ZmSetting.HTTPS_PORT,h.httpsPort)
+}
+if(/dogfood/.test(location.hostname)||(h.devMode=="1")){
+AjxUtil.enableLogType("rpc",true)
+}
+var o=h.userShell=window.document.getElementById(ZmId.SKIN_SHELL);
+if(!o){
+alert("Could not get user shell - skin file did not load properly")
+}
+var c=new DwtShell({
+userShell:o,docBodyScrollable:false,id:ZmId.SHELL}
+);
+appCtxt.setShell(c);
+new ZmZimbraMail(h)
+};
+ZmZimbraMail.unload=function(){
+if(!ZmZimbraMail._endSessionDone){
+ZmZimbraMail._endSession()
+}
+if(ZmZimbraMail._isLogOff){
+ZmZimbraMail._isLogOff=false;
+if(window._zimbraMail){
+window._zimbraMail.setSessionTimer(false)
+}
+ZmCsfeCommand.clearAuthToken()
+}
+var t=window._zimbraMail?window._zimbraMail._childWinList:null;
+if(t){
+for(var e=0;
+e<t.size();
+e++){
+var a=t.get(e);
+a.win.onbeforeunload=null;
+a.win.parentController=null;
+a.win.close()
+}}
+window._zimbraMail=window.onload=window.onunload=window.onresize=window.document.onkeypress=null
+};
+ZmZimbraMail.hashSortCompare=function(s,o,e){
+var n=o?Number(s[o]):0;
+var t=e?Number(s[e]):0;
+if(n>t){
+return 1
+}
+if(n<t){
+return -1
+}
+return 0
+};
+ZmZimbraMail.killSplash=function(){
+var e=Dwt.byId("skin_container_splash_screen");
+if(e){
+Dwt.hide(e)
+}};
+ZmZimbraMail.prototype.startup=function(a){
+if(appCtxt.isOffline){
+this.sendClientEventNotify(true)
+}
+appCtxt.inStartup=true;
+if(typeof(skin)=="undefined"){}
+if(!this._appViewMgr){
+this._appViewMgr=new ZmAppViewMgr(this._shell,this,false,true)
+}
+skin.show("skin",true);
+if(!this._components){
+this._components={};
+this._components[ZmAppViewMgr.C_SASH]=new DwtSash({
+parent:this._shell,style:DwtSash.HORIZONTAL_STYLE,className:"console_inset_app_l",threshold:20,id:ZmId.MAIN_SASH}
+);
+this._components[ZmAppViewMgr.C_BANNER]=this._createBanner();
+if(!appCtxt.multiAccounts){
+this._components[ZmAppViewMgr.C_USER_INFO]=this._userNameField=this._createUserInfo("BannerTextUser",ZmAppViewMgr.C_USER_INFO,ZmId.USER_NAME);
+this._components[ZmAppViewMgr.C_QUOTA_INFO]=this._usedQuotaField=this._createUserInfo("BannerTextQuota",ZmAppViewMgr.C_QUOTA_INFO,ZmId.USER_QUOTA)
+}
+this._components[ZmAppViewMgr.C_STATUS]=this.statusView=new ZmStatusView(this._shell,"ZmStatus",Dwt.ABSOLUTE_STYLE,ZmId.STATUS_VIEW)
+}
+this._createEnabledApps();
+this._registerOrganizers();
+for(var n in ZmSearch.TYPE){
+ZmSearch.TYPE_MAP[ZmSearch.TYPE[n]]=n
+}
+for(var n in ZmOrganizer.VIEWS){
+var s=ZmOrganizer.VIEWS[n];
+for(var o=0;
+o<s.length;
+o++){
+ZmOrganizer.TYPE[s[o]]=n
+}}
+if(a.batchInfoResponse){
+var c=a.batchInfoResponse.Body.BatchResponse;
+if(c.GetInfoResponse){
+var e=a.getInfoResponse={};
+e.Body={};
+e.Body.GetInfoResponse=c.GetInfoResponse[0];
+e.Header=a.batchInfoResponse.Header;
+if(e.Header&&e.Header.context&&e.Header.context.session){
+ZmCsfeCommand.setSessionId(e.Header.context.session)
+}}
+if(c.SearchResponse){
+var t=a.searchResponse={};
+t.Body={};
+t.Body.SearchResponse=c.SearchResponse[0]
+}}
+this._getStartApp(a);
+this._postRenderCallbacks=[];
+this._postRenderLast=0;
+if(a.startApp==ZmApp.MAIL){
+this._doingPostRenderStartup=true;
+var h=new AjxCallback(this,function(){
+AjxDispatcher.require("Startup2");
+if(appCtxt.get(ZmSetting.CALENDAR_ENABLED)){
+this.handleCalendarComponents()
+}
+appCtxt.getSearchController().getSearchToolbar().initAutocomplete()
+}
+);
+this.addPostRenderCallback(h,0,0,true)
+}
+var l=new AjxCallback(this,this._handleResponseGetMetaData,a);
+var r=[ZmSetting.M_IMPLICIT];
+if(appCtxt.isOffline){
+r.push(ZmSetting.M_OFFLINE)
+}
+appCtxt.getMetaData().get(r,null,l)
+};
+ZmZimbraMail.prototype._handleResponseGetMetaData=function(s,e){
+var n=e.getResponse().BatchResponse.GetMailboxMetadataResponse;
+var t={};
+for(var a=0;
+a<n.length;
+a++){
+var o=n[a].meta[0];
+t[o.section]=o._attrs
+}
+var r=new AjxCallback(this,this._handleResponseLoadUserSettings,s);
+this._errorCallback=new AjxCallback(this,this._handleErrorStartup,s);
+this._settings.loadUserSettings(r,this._errorCallback,null,s.getInfoResponse,t)
+};
+ZmZimbraMail.prototype.showMiniCalendar=function(){
+var e=appCtxt.getCalManager();
+e.getMiniCalendar();
+appCtxt.getAppViewMgr().showTreeFooter(true);
+e.highlightMiniCal()
+};
+ZmZimbraMail.prototype.showReminder=function(){
+var t=appCtxt.getCalManager();
+var e=t.getReminderController();
+e.refresh()
+};
+ZmZimbraMail.prototype.handleOfflineMailTo=function(t,n){
+if(!appCtxt.get(ZmSetting.OFFLINE_IS_MAILTO_HANDLER)){
+return false
+}
+var o=this.getApp(ZmApp.MAIL);
+var e=(t.indexOf("mailto"));
+if(e>=0){
+var a="to="+decodeURIComponent(t.substring(e+7));
+a=a.replace(/\?/g,"&");
+o._showComposeView(n,a);
+return true
+}
+return false
+};
+ZmZimbraMail.prototype._handleErrorStartup=function(t,e){
+ZmZimbraMail.killSplash();
+appCtxt.inStartup=false;
+return false
+};
+ZmZimbraMail.prototype._handleResponseLoadUserSettings=function(t,e){
+if(appCtxt.multiAccounts){
+var a=new AjxCallback(this,this._handleResponseStartup,[t,e]);
+appCtxt.accountList.loadAccounts(a)
+}else{
+this._handleResponseStartup(t,e)
+}};
+ZmZimbraMail.prototype._handleResponseStartup=function(o,e){
+if(o&&o.settingOverrides){
+this._needOverviewLayout=true;
+for(var r in o.settingOverrides){
+var a=this._settings.getSetting(r);
+if(a){
+a.setValue(o.settingOverrides[r])
+}}}
+if(!appCtxt.isOffline){
+this.setPollInterval(true)
+}else{
+try{
+if(AjxEnv.isMac&&window.platform&&window.platform.isRegisteredProtocolHandler("mailto")){
+this.registerMailtoHandler()
+}}
+catch(t){}}
+window.onbeforeunload=ZmZimbraMail._confirmExitMethod;
+if(!this._components[ZmAppViewMgr.C_APP_CHOOSER]){
+this._components[ZmAppViewMgr.C_APP_CHOOSER]=this._appChooser=this._createAppChooser()
+}
+ZmApp.initialize();
+if(appCtxt.get(ZmSetting.DEFAULT_TIMEZONE)){
+AjxTimezone.DEFAULT_RULE=AjxTimezone._guessMachineTimezone(appCtxt.get(ZmSetting.DEFAULT_TIMEZONE));
+AjxTimezone.DEFAULT=AjxTimezone.getClientId(AjxTimezone.DEFAULT_RULE.serverId)
+}
+this._evtMgr.notifyListeners(ZmAppEvent.PRE_STARTUP,this._evt);
+o.result=e;
+var s=new AjxCallback(this,this._handleResponseStartup1,o);
+if(this._doingPostRenderStartup){
+this.addAppListener(o.startApp,ZmAppEvent.POST_RENDER,new AjxListener(this,this._postRenderStartup));
+this._searchResponse=o.searchResponse
+}else{
+AjxDispatcher.require("Startup2")
+}
+var n=new AjxCallback(this,function(){
+this.runAppFunction("startup",false,o.result)
+}
+);
+this.addPostRenderCallback(n,2,100,true);
+n=new AjxCallback(this,function(){
+this._setupTabGroups();
+this.focusContentPane()
+}
+);
+this.addPostRenderCallback(n,3,100);
+n=new AjxCallback(this,function(){
+AjxDispatcher.enableLoadFunctions(true);
+appCtxt.inStartup=false;
+this._evtMgr.notifyListeners(ZmAppEvent.POST_STARTUP,this._evt);
+if(appCtxt.isOffline){
+appCtxt.getSearchController().resetSearchToolbar()
+}
+var h=appCtxt.multiAccounts?"GetContactsForAllAccounts":"GetContacts";
+AjxDispatcher.run(h)
+}
+);
+this.addPostRenderCallback(n,5,100);
+this.activateApp(o.startApp,false,s,this._errorCallback,o);
+if(appCtxt.get(ZmSetting.CALENDAR_ENABLED)&&!this._doingPostRenderStartup&&(o.startApp!=ZmApp.CALENDAR)){
+this.handleCalendarComponents()
+}};
+ZmZimbraMail.prototype.handleCalendarComponents=function(){
+if(appCtxt.get(ZmSetting.CAL_ALWAYS_SHOW_MINI_CAL)){
+var a=new AjxTimedAction(this,this.showMiniCalendar);
+var e=appCtxt.isOffline?0:ZmCalendarApp.MINICAL_DELAY;
+AjxTimedAction.scheduleAction(a,e)
+}
+if(appCtxt.get(ZmSetting.CAL_REMINDER_WARNING_TIME)!=0){
+var t=new AjxTimedAction(this,this.showReminder);
+var e=appCtxt.isOffline?0:ZmCalendarApp.REMINDER_START_DELAY;
+AjxTimedAction.scheduleAction(t,e)
+}};
+ZmZimbraMail.prototype._handleResponseStartup1=function(a){
+this._setExternalLinks();
+this.setUserInfo();
+if(appCtxt.get(ZmSetting.SEARCH_ENABLED)){
+this._components[ZmAppViewMgr.C_SEARCH]=appCtxt.getSearchController().getSearchPanel()
+}
+this.getKeyMapMgr();
+this.setSessionTimer(true);
+ZmZimbraMail.killSplash();
+this.runAppFunction("addComponents",false,this._components);
+var e=this._appViewMgr._components;
+this._appViewMgr.addComponents(this._components,true);
+if(e){
+this._appViewMgr.addComponents(e,true)
+}
+if(appCtxt.get(ZmSetting.LICENSE_STATUS)!=ZmSetting.LICENSE_GOOD){
+AjxDispatcher.require("Startup2");
+var t=appCtxt.getMsgDialog();
+t.reset();
+t.setMessage(ZmMsg.licenseExpired,DwtMessageDialog.WARNING_STYLE);
+t.popup()
+}
+if(!this._doingPostRenderStartup){
+this._postRenderStartup()
+}};
+ZmZimbraMail.prototype._postRenderStartup=function(e){
+this._postRenderCallbacks.sort(function(o,t){
+return o.order-t.order
+}
+);
+this._runNextPostRenderCallback()
+};
+ZmZimbraMail.prototype._runNextPostRenderCallback=function(){
+if(this._postRenderCallbacks&&this._postRenderCallbacks.length){
+var e=this._postRenderCallbacks.shift();
+if(!e){
+return
+}
+AjxTimedAction.scheduleAction(new AjxTimedAction(this,function(){
+e.callback.run();
+this._runNextPostRenderCallback()
+}
+),e.delay)
+}else{
+if(appCtxt.isOffline){
+this.sendClientEventNotify(false)
+}
+if(appCtxt.multiAccounts){
+this._resetUserInfo()
+}}};
+ZmZimbraMail.prototype.addPostRenderCallback=function(o,e,t,a){
+if(!this._doingPostRenderStartup&&a){
+o.run()
+}else{
+e=e||this._postRenderLast++;
+this._postRenderCallbacks.push({
+callback:o,order:e,delay:t||0}
+)
+}};
+ZmZimbraMail.prototype._getStartApp=function(r){
+var t;
+if(r&&r.app){
+t=ZmApp.QS_ARG_R[r.app.toLowerCase()];
+var n=ZmApp.SETTING[t];
+if(n&&!appCtxt.get(n)){
+t=null
+}}
+if(!t){
+for(var s in ZmApp.DEFAULT_SORT){
+ZmApp.DEFAULT_APPS.push(s)
+}
+ZmApp.DEFAULT_APPS.sort(function(l,h){
+return ZmZimbraMail.hashSortCompare(ZmApp.DEFAULT_SORT,l,h)
+}
+);
+var e=null;
+for(var o=0;
+o<ZmApp.DEFAULT_APPS.length;
+o++){
+var s=ZmApp.DEFAULT_APPS[o];
+var n=ZmApp.SETTING[s];
+if(!n||appCtxt.get(n)){
+e=s;
+break
+}}
+t=(r&&r.isRelogin&&this._activeApp)?this._activeApp:e
+}
+var a=AjxStringUtil.parseQueryString();
+if(a&&a.view&&!a.app){
+t=ZmApp.QS_VIEWS[a.view]
+}
+r.startApp=t;
+r.qsParams=a
+};
+ZmZimbraMail.prototype.restart=function(e){
+this.reset();
+this.startup({
+settingOverrides:e}
+)
+};
+ZmZimbraMail.prototype.reset=function(){
+ZmCsfeCommand.setSessionId(null);
+this._highestNotifySeen=0;
+appCtxt.accountList.resetTrees();
+if(!appCtxt.rememberMe()){
+appCtxt.getLoginDialog().clearAll()
+}
+for(var e in this._apps){
+this._apps[e]=null
+}
+this._activeApp=null;
+this._appViewMgr.reset()
+};
+ZmZimbraMail.prototype.cancelRequest=function(a,e,t){
+this._requestMgr.cancelRequest(a,e,t)
+};
+ZmZimbraMail.prototype.sendRequest=function(e){
+return this._requestMgr.sendRequest(e)
+};
+ZmZimbraMail.prototype.runAppFunction=function(r,s){
+var t=[];
+for(var a=2;
+a<arguments.length;
+a++){
+t.push(arguments[a])
+}
+for(var a=0;
+a<ZmApp.APPS.length;
+a++){
+var e=ZmApp.APPS[a];
+var o=ZmApp.SETTING[e];
+if(!o||appCtxt.get(o)||s){
+var h=appCtxt.getApp(e);
+var n=h&&h[r];
+if(n&&(typeof(n)=="function")){
+n.apply(h,t)
+}}}};
+ZmZimbraMail.prototype._createEnabledApps=function(o){
+for(var n in ZmApp.CLASS){
+if(!o||o[n]){
+ZmApp.APPS.push(n)
+}}
+ZmApp.APPS.sort(function(r,s){
+return ZmZimbraMail.hashSortCompare(ZmApp.LOAD_SORT,r,s)
+}
+);
+for(var t=0;
+t<ZmApp.APPS.length;
+t++){
+var n=ZmApp.APPS[t];
+var e=ZmApp.SETTING[n]&&appCtxt.get(ZmApp.SETTING[n]);
+var a=ZmApp.UPSELL_SETTING[n]&&appCtxt.get(ZmApp.UPSELL_SETTING[n]);
+if(e||a){
+ZmApp.ENABLED_APPS[n]=true;
+this._createApp(n);
+this._apps[n].isUpsell=(!e&&a)
+}}};
+ZmZimbraMail.addListener=function(e,t){
+if(!ZmZimbraMail._listeners[e]){
+ZmZimbraMail._listeners[e]=[]
+}
+ZmZimbraMail._listeners[e].push(t)
+};
+ZmZimbraMail.addAppListener=function(e,t,a){
+t=[e,t].join("_");
+ZmZimbraMail.addListener(t,a)
+};
+ZmZimbraMail.prototype.addListener=function(e,t){
+return this._evtMgr.addListener(e,t)
+};
+ZmZimbraMail.prototype.removeListener=function(e,t){
+return this._evtMgr.removeListener(e,t)
+};
+ZmZimbraMail.prototype.addAppListener=function(a,e,t){
+e=[a,e].join("_");
+return this.addListener(e,t)
+};
+ZmZimbraMail.prototype.removeAppListener=function(a,e,t){
+e=[a,e].join("_");
+return this.removeListener(e,t)
+};
+ZmZimbraMail.prototype.sendNoOp=function(){
+var t=AjxSoapDoc.create("NoOpRequest","urn:zimbraMail");
+var e=appCtxt.isOffline&&appCtxt.accountList.mainAccount.name;
+this.sendRequest({
+soapDoc:t,asyncMode:true,noBusyOverlay:true,accountName:e}
+)
+};
+ZmZimbraMail.prototype.sendClientEventNotify=function(e){
+var t={
+jsonObj:{
+ClientEventNotifyRequest:{
+_jsns:"urn:zimbraOffline",e:e?"ui_load_begin":"ui_load_end"}}
+,callback:(new AjxCallback(this,this.setInstantNotify,true)),asyncMode:true,noBusyOverlay:true};
+this.sendRequest(t)
+};
+ZmZimbraMail.prototype.setInstantNotify=function(e){
+if(e){
+this._pollInstantNotifications=true;
+this._pollInterval=appCtxt.get(ZmSetting.INSTANT_NOTIFY_INTERVAL);
+if(this._pollActionId){
+AjxTimedAction.cancelAction(this._pollActionId);
+this._pollActionId=null
+}
+this._kickPolling(true)
+}else{
+this._pollInstantNotifications=false;
+this._cancelInstantNotify();
+this.setPollInterval(true)
+}};
+ZmZimbraMail.prototype.getInstantNotify=function(){
+return this._pollInstantNotifications
+};
+ZmZimbraMail.prototype.registerMailtoHandler=function(){
+if(appCtxt.get(ZmSetting.OFFLINE_SUPPORTS_MAILTO)&&appCtxt.get(ZmSetting.OFFLINE_IS_MAILTO_HANDLER)){
+try{
+if(AjxEnv.isMac||!window.platform.isRegisteredProtocolHandler("mailto")){
+var a=AjxCallback.simpleClosure(this.handleOfflineMailTo,this);
+var e=appCtxt.get(ZmSetting.OFFLINE_WEBAPP_URI,null,appCtxt.accountList.mainAccount);
+window.platform.registerProtocolHandler("mailto",e+"&mailto=%s",a)
+}}
+catch(t){}}};
+ZmZimbraMail.prototype.setPollInterval=function(e){
+if(!this._pollInstantNotifications){
+this._pollInterval=appCtxt.get(ZmSetting.POLLING_INTERVAL)*1000;
+if(this._pollInterval){
+if(e){
+this._kickPolling(true)
+}}else{
+if(this._pollActionId){
+AjxTimedAction.cancelAction(this._pollActionId);
+this._pollActionId=null
+}}
+return true
+}else{
+this._pollInterval=appCtxt.get(ZmSetting.INSTANT_NOTIFY_INTERVAL);
+return false
+}};
+ZmZimbraMail.prototype._cancelInstantNotify=function(){
+if(this._pollRequest){
+this._requestMgr.cancelRequest(this._pollRequest);
+this._pollRequest=null
+}
+if(this._pollActionId){
+AjxTimedAction.cancelAction(this._pollActionId);
+this._pollActionId=null
+}};
+ZmZimbraMail.prototype._kickPolling=function(a){
+DBG.println(AjxDebug.DBG2,["ZmZimbraMail._kickPolling ",this._pollInterval,", ",this._pollActionId,", ",this._pollRequest?"request_pending":"no_request_pending"].join(""));
+if(this._pollActionId){
+AjxTimedAction.cancelAction(this._pollActionId);
+this._pollActionId=null
+}
+if(a&&this._pollInstantNotifications){
+var e=appCtxt.get(ZmSetting.INSTANT_NOTIFY_INTERVAL);
+if(this._pollInterval>e){
+this._pollInterval=e
+}}
+if(this._pollInterval&&!this._pollRequest){
+try{
+this._pollActionId=AjxTimedAction.scheduleAction(new AjxTimedAction(this,this._execPoll),this._pollInterval)
+}
+catch(t){
+this._pollActionId=null
+}}};
+ZmZimbraMail.prototype._execPoll=function(){
+this._cancelInstantNotify();
+var t=AjxSoapDoc.create("NoOpRequest","urn:zimbraMail");
+try{
+if(this._pollInstantNotifications){
+var o=t.getMethod();
+o.setAttribute("wait",1);
+o.setAttribute("limitToOneBlocked",1)
+}
+var a={
+soapDoc:t,asyncMode:true,callback:new AjxCallback(this,this._handleResponseDoPoll),errorCallback:new AjxCallback(this,this._handleErrorDoPoll),noBusyOverlay:true,timeout:appCtxt.get(ZmSetting.INSTANT_NOTIFY_TIMEOUT),accountName:appCtxt.isOffline&&appCtxt.accountList.mainAccount.name};
+this._pollRequest=this.sendRequest(a)
+}
+catch(e){
+this._handleErrorDoPoll(e)
+}};
+ZmZimbraMail.prototype._handleErrorDoPoll=function(t){
+if(this._pollRequest){
+if(this._pollActionId){
+AjxTimedAction.cancelAction(this._pollActionId);
+this._pollActionId=null
+}
+this._requestMgr.cancelRequest(this._pollRequest);
+this._pollRequest=null
+}
+if(this._pollInstantNotifications){
+this._pollInterval*=2;
+if(this._pollInterval>(1000*60*2)){
+this._pollInterval=1000*60*2
+}}
+var e=(t.code==ZmCsfeException.SVC_AUTH_EXPIRED||t.code==ZmCsfeException.SVC_AUTH_REQUIRED||t.code==ZmCsfeException.NO_AUTH_TOKEN);
+if(!e){
+this._kickPolling(false)
+}
+return !e
+};
+ZmZimbraMail.prototype._handleResponseDoPoll=function(e){
+this._pollRequest=null;
+var t=e.getResponse().NoOpResponse;
+if(t.waitDisallowed){
+this.setInstantNotify(false)
+}else{
+this._kickPolling(true)
+}};
+ZmZimbraMail.prototype.getKeyMapMgr=function(){
+var e=appCtxt.getKeyboardMgr();
+if(!e.__keyMapMgr){
+this._initKeyboardHandling()
+}
+return e.__keyMapMgr
+};
+ZmZimbraMail.prototype._initKeyboardHandling=function(){
+var e=appCtxt.getKeyboardMgr();
+if(e.__keyMapMgr){
+return
+}
+if(appCtxt.get(ZmSetting.USE_KEYBOARD_SHORTCUTS)){
+e.enable(true);
+e.registerKeyMap(new ZmKeyMap());
+e.pushDefaultHandler(this)
+}else{
+e.enable(false)
+}};
+ZmZimbraMail.prototype._setupTabGroups=function(){
+var t=appCtxt.getRootTabGroup();
+if(appCtxt.get(ZmSetting.SEARCH_ENABLED)){
+t.addMember(appCtxt.getSearchController().getTabGroup())
+}
+this._components[ZmAppViewMgr.C_APP_CHOOSER].noFocus=true;
+var e=appCtxt.getCurrentApp();
+var o=e&&e.getOverviewId();
+var a=o&&appCtxt.getOverviewController().getOverview(o);
+if(a){
+t.addMember(a);
+ZmController._currentOverview=a
+}
+appCtxt.getKeyboardMgr().setTabGroup(t)
+};
+ZmZimbraMail.prototype._registerOrganizers=function(){
+ZmOrganizer.registerOrg(ZmOrganizer.FOLDER,{
+app:ZmApp.MAIL,nameKey:"folder",defaultFolder:ZmOrganizer.ID_INBOX,soapCmd:"FolderAction",firstUserId:256,orgClass:"ZmFolder",orgPackage:"MailCore",treeController:"ZmMailFolderTreeController",labelKey:"folders",itemsKey:"messages",hasColor:true,defaultColor:ZmOrganizer.C_NONE,treeType:ZmOrganizer.FOLDER,dropTargets:[ZmOrganizer.FOLDER],views:["message","conversation"],folderKey:"mailFolder",mountKey:"mountFolder",createFunc:"ZmOrganizer.create",compareFunc:"ZmFolder.sortCompare",newOp:ZmOperation.NEW_FOLDER,displayOrder:100,openSetting:ZmSetting.FOLDER_TREE_OPEN}
+);
+ZmOrganizer.registerOrg(ZmOrganizer.SEARCH,{
+app:ZmApp.MAIN,nameKey:"savedSearch",precondition:ZmSetting.SAVED_SEARCHES_ENABLED,soapCmd:"FolderAction",firstUserId:256,orgClass:"ZmSearchFolder",treeController:"ZmSearchTreeController",labelKey:"searches",treeType:ZmOrganizer.FOLDER,dropTargets:[ZmOrganizer.FOLDER,ZmOrganizer.SEARCH],createFunc:"ZmSearchFolder.create",compareFunc:"ZmFolder.sortCompare",openSetting:ZmSetting.SEARCH_TREE_OPEN,displayOrder:300}
+);
+ZmOrganizer.registerOrg(ZmOrganizer.TAG,{
+app:ZmApp.MAIN,nameKey:"tag",precondition:ZmSetting.TAGGING_ENABLED,soapCmd:"TagAction",firstUserId:64,orgClass:"ZmTag",treeController:"ZmTagTreeController",hasColor:true,defaultColor:ZmOrganizer.C_ORANGE,labelKey:"tags",treeType:ZmOrganizer.TAG,createFunc:"ZmTag.create",compareFunc:"ZmTag.sortCompare",newOp:ZmOperation.NEW_TAG,openSetting:ZmSetting.TAG_TREE_OPEN,displayOrder:400}
+);
+ZmOrganizer.registerOrg(ZmOrganizer.ZIMLET,{
+orgClass:"ZmZimlet",treeController:"ZmZimletTreeController",labelKey:"zimlets",compareFunc:"ZmZimlet.sortCompare",openSetting:ZmSetting.ZIMLET_TREE_OPEN,hideEmpty:true}
+);
+this._name=ZmApp.MAIN;
+ZmApp.prototype._setupDropTargets.call(this)
+};
+ZmZimbraMail.prototype.getApp=function(e){
+if(!ZmApp.ENABLED_APPS[e]){
+return null
+}
+if(!this._apps[e]){
+this._createApp(e)
+}
+return this._apps[e]
+};
+ZmZimbraMail.prototype.getAppViewMgr=function(){
+return this._appViewMgr
+};
+ZmZimbraMail.prototype.getActiveApp=function(){
+return this._activeApp
+};
+ZmZimbraMail.prototype.getPreviousApp=function(){
+return this._previousApp
+};
+ZmZimbraMail.prototype.activateApp=function(n,t,h,o,a){
+var s=this._appViewMgr.getAppView(n);
+if(s&&!t){
+if(this._appViewMgr.pushView(s)){
+this._appViewMgr.setAppView(n,s);
+if(!appCtxt.get(ZmApp.SETTING[n])&&appCtxt.get(ZmApp.UPSELL_SETTING[n])){
+var r=[ZmMsg.zimbraTitle,n].join(": ");
+Dwt.setTitle(r)
+}}
+if(h){
+h.run()
+}}else{
+if(!this._apps[n]){
+this._createApp(n)
+}
+if(!appCtxt.get(ZmApp.SETTING[n])&&appCtxt.get(ZmApp.UPSELL_SETTING[n])){
+this._createUpsellView(n)
+}else{
+var l=new AjxCallback(this,this._handleResponseActivateApp,[h,n]);
+var e=[n,ZmAppEvent.PRE_LAUNCH].join("_");
+this._evt.item=this._apps[n];
+this._evtMgr.notifyListeners(e,this._evt);
+a=a||{};
+a.searchResponse=this._searchResponse;
+this._apps[n].launch(a,l);
+delete this.searchResponse
+}}};
+ZmZimbraMail.prototype._handleResponseActivateApp=function(a,e){
+if(a){
+a.run()
+}
+if(ZmApp.DEFAULT_SEARCH[e]){
+appCtxt.getSearchController().setDefaultSearchType(ZmApp.DEFAULT_SEARCH[e])
+}
+var t=[e,ZmAppEvent.POST_LAUNCH].join("_");
+this._evt.item=this._apps[e];
+this._evtMgr.notifyListeners(t,this._evt)
+};
+ZmZimbraMail.prototype.setActiveApp=function(o,s,r){
+if(!r){
+this._components[ZmAppViewMgr.C_APP_CHOOSER].setSelected(o)
+}
+var t=!ZmApp.SETTING[o]||appCtxt.get(ZmApp.SETTING[o]);
+this._activeTabId=null;
+if(this._activeApp!=o){
+if(this._activeApp){
+var e=this._apps[this._activeApp];
+if(e){
+e.activate(false,s)
+}
+this._previousApp=this._activeApp
+}
+this._activeApp=o;
+if(t){
+var e=this._apps[this._activeApp];
+if(appCtxt.get(ZmSetting.SEARCH_ENABLED)){
+var n=e?e.getInitialSearchType():null;
+if(!n){
+n=ZmApp.DEFAULT_SEARCH[o]
+}
+if(n){
+appCtxt.getSearchController().setDefaultSearchType(n)
+}
+var a=appCtxt.getSearchController().getSearchToolbar();
+if(appCtxt.get(ZmSetting.SHOW_SEARCH_STRING)&&a){
+var h=e.currentSearch?e.currentSearch.query:e.currentQuery;
+a.setSearchFieldValue(h||"")
+}}
+if(e){
+if(appCtxt.inStartup&&this._doingPostRenderStartup){
+var l=new AjxCallback(this,function(){
+e.activate(true)
+}
+);
+this.addPostRenderCallback(l,1,100,true)
+}else{
+e.activate(true)
+}}}
+this._evt.item=this._apps[o];
+this._evtMgr.notifyListeners(ZmAppEvent.ACTIVATE,this._evt)
+}};
+ZmZimbraMail.prototype.getAppChooserButton=function(e){
+return this._components[ZmAppViewMgr.C_APP_CHOOSER].getButton(e)
+};
+ZmZimbraMail.prototype.appRendered=function(e){
+var t=[e,ZmAppEvent.POST_RENDER].join("_");
+this._evtMgr.notifyListeners(t,this._evt);
+if(window._facadeCleanup){
+window._facadeCleanup();
+window._facadeCleanup=null
+}};
+ZmZimbraMail.prototype.addApp=function(t){
+var e=t.getName();
+this._apps[e]=t;
+ZmApp.ENABLED_APPS[e]=true
+};
+ZmZimbraMail.prototype._createApp=function(appName){
+if(!appName||this._apps[appName]){
+return
+}
+var appClass=eval(ZmApp.CLASS[appName]);
+this.addApp(new appClass(this._shell))
+};
+ZmZimbraMail.prototype._setExternalLinks=function(){
+var e=document.getElementById("skin_container_links");
+if(e){
+var a;
+if(!appCtxt.isOffline&&(appCtxt.get(ZmSetting.IS_ADMIN)||appCtxt.get(ZmSetting.IS_DELEGATED_ADMIN))){
+a=appCtxt.get(ZmSetting.ADMIN_REFERENCE);
+if(!a){
+a=["https://",location.hostname,":7071"].join("")
+}}
+var t={
+showOfflineLink:(!appCtxt.isOffline&&appCtxt.get(ZmSetting.SHOW_OFFLINE_LINK)),helpIcon:(appCtxt.getSkinHint("helpButton","hideIcon")?null:"Help"),logoutIcon:(appCtxt.getSkinHint("logoutButton","hideIcon")?null:"Logoff"),logoutText:(appCtxt.isOffline?ZmMsg.setup:ZmMsg.logOff),adminUrl:a};
+e.innerHTML=AjxTemplate.expand("share.App#UserInfo",t)
+}};
+ZmZimbraMail.prototype.setUserInfo=function(){
+if(appCtxt.multiAccounts||appCtxt.isOffline){
+return
+}
+var e=appCtxt.get(ZmSetting.USERNAME);
+var s=(appCtxt.get(ZmSetting.DISPLAY_NAME))||e;
+if(s){
+this._userNameField.getHtmlElement().innerHTML=AjxStringUtil.clipByLength(s,24);
+if(AjxEnv.isLinux){
+this._userNameField.getHtmlElement().style.lineHeight="13px"
+}}
+var n=(appCtxt.get(ZmSetting.QUOTA_USED))||0;
+var o={
+id:this._usedQuotaField._htmlElId,login:e,username:s,quota:appCtxt.get(ZmSetting.QUOTA),usedQuota:n,size:(AjxUtil.formatSize(n,false,1))};
+var a;
+if(o.quota){
+a="UsedLimited";
+o.limit=AjxUtil.formatSize(o.quota,false,1);
+o.percent=Math.min(Math.round((o.usedQuota/o.quota)*100),100);
+o.desc=AjxMessageFormat.format(ZmMsg.quotaDescLimited,[o.percent+"%",o.limit])
+}else{
+o.desc=AjxMessageFormat.format(ZmMsg.quotaDescUnlimited,[o.size]);
+a="UsedUnlimited"
+}
+this._usedQuotaField.getHtmlElement().innerHTML=AjxTemplate.expand("share.Quota#"+a,o);
+var t=(s!=e||o.quota>0)?AjxTemplate.expand("share.Quota#Tooltip",o):null;
+this._components[ZmAppViewMgr.C_USER_INFO].setToolTipContent(t);
+this._components[ZmAppViewMgr.C_QUOTA_INFO].setToolTipContent(t)
+};
+ZmZimbraMail.prototype._resetUserInfo=function(){
+var a=document.getElementById("skin_container_username");
+if(a){
+Dwt.setDisplay(a,Dwt.DISPLAY_NONE)
+}
+var o=document.getElementById("skin_container_quota");
+if(o){
+Dwt.setDisplay(o,Dwt.DISPLAY_NONE)
+}
+var e=document.getElementById("skin_container_account");
+if(e){
+e.innerHTML=ZmMsg.accounts;
+Dwt.setDisplay(e,Dwt.DISPLAY_BLOCK)
+}
+var t=document.getElementById("skin_container_tree_top");
+if(t){
+t.className="OfflineTreeTop"
+}
+this._appViewMgr._fitToContainer([ZmAppViewMgr.C_TREE,ZmAppViewMgr.C_TREE_FOOTER])
+};
+ZmZimbraMail.logOff=function(){
+ZmZimbraMail._isLogOff=true;
+if(appCtxt.isOffline&&AjxEnv.isWindows&&appCtxt.get(ZmSetting.OFFLINE_SUPPORTS_DOCK_UPDATE)){
+window.platform.icon().imageSpec="resource://webapp/icons/default/launcher.ico";
+window.platform.icon().title=null
+}
+var e=AjxUtil.formatUrl({
+path:appContextPath,qsArgs:{
+loginOp:"logout"}}
+);
+ZmZimbraMail.sendRedirect(e)
+};
+ZmZimbraMail._onClickLogOff=function(){
+if(AjxEnv.isIE){
+var e=DwtUiEvent.getEvent();
+e.returnValue=false
+}
+ZmZimbraMail.logOff()
+};
+ZmZimbraMail.helpLinkCallback=function(){
+ZmZimbraMail.unloadHackCallback();
+var o=window.parentAppCtxt||window.appCtxt;
+var a;
+if(!o.isOffline){
+try{
+a=skin.hints.helpButton.url
+}
+catch(n){}
+a=a||o.get(ZmSetting.HELP_URI);
+var t=a.match(/\?/)?"&":"?";
+a=[a,t,"locid=",AjxEnv.DEFAULT_LOCALE].join("")
+}else{
+a=o.get(ZmSetting.HELP_URI).replace(/\/$/,"");
+a=[a,"help","en_US","Zimbra_Mail_Help.htm"].join("/")
+}
+window.open(a)
+};
+ZmZimbraMail.sendRedirect=function(t){
+if(AjxEnv.isIE){
+var e=new AjxTimedAction(null,ZmZimbraMail.redir,[t]);
+AjxTimedAction.scheduleAction(e,1)
+}else{
+ZmZimbraMail.redir(t)
+}};
+ZmZimbraMail.redir=function(e){
+window.location=e
+};
+ZmZimbraMail.prototype.setSessionTimer=function(t){
+var e=appCtxt.get(ZmSetting.IDLE_SESSION_TIMEOUT)*1000;
+if(e<=0){
+return
+}
+if(t){
+this._sessionTimerId=AjxTimedAction.scheduleAction(this._sessionTimer,e);
+DwtEventManager.addListener(DwtEvent.ONMOUSEUP,ZmZimbraMail._userEventHdlr);
+this._shell.setHandler(DwtEvent.ONMOUSEUP,ZmZimbraMail._userEventHdlr);
+if(AjxEnv.isIE){
+this._shell.setHandler(DwtEvent.ONMOUSEDOWN,ZmZimbraMail._userEventHdlr)
+}else{
+window.onkeydown=ZmZimbraMail._userEventHdlr
+}}else{
+AjxTimedAction.cancelAction(this._sessionTimerId);
+this._sessionTimerId=-1;
+DwtEventManager.removeListener(DwtEvent.ONMOUSEUP,ZmZimbraMail._userEventHdlr);
+this._shell.clearHandler(DwtEvent.ONMOUSEUP);
+if(AjxEnv.isIE){
+this._shell.clearHandler(DwtEvent.ONMOUSEDOWN)
+}else{
+window.onkeydown=null
+}}};
+ZmZimbraMail.prototype.addChildWindow=function(t){
+if(this._childWinList==null){
+this._childWinList=new AjxVector()
+}
+var e={
+win:t};
+this._childWinList.add(e);
+return e
+};
+ZmZimbraMail.prototype.getChildWindow=function(t){
+if(this._childWinList){
+for(var e=0;
+e<this._childWinList.size();
+e++){
+if(t==this._childWinList.get(e).win){
+return this._childWinList.get(e)
+}}}
+return null
+};
+ZmZimbraMail.prototype.removeChildWindow=function(t){
+if(this._childWinList){
+for(var e=0;
+e<this._childWinList.size();
+e++){
+if(t==this._childWinList.get(e).win){
+this._childWinList.removeAt(e);
+break
+}}}};
+ZmZimbraMail.prototype._handleException=function(r,t){
+var o=false;
+if(r.code==ZmCsfeException.MAIL_NO_SUCH_FOLDER){
+var e=[ZmOrganizer.CALENDAR,ZmOrganizer.NOTEBOOK,ZmOrganizer.ADDRBOOK];
+if(r.data.itemId&&r.data.itemId.length){
+var l=r.data.itemId[0];
+var n=l.lastIndexOf(":");
+var s=l.substring(0,n);
+var c=l.substring(n+1,l.length);
+var a=appCtxt.getFolderTree();
+for(var h=0;
+h<e.length;
+h++){
+o|=a.handleNoSuchFolderError(e[h],s,c,true)
+}}}
+if(!o){
+ZmController.prototype._handleException.apply(this,arguments)
+}};
+ZmZimbraMail._confirmExitMethod=function(){
+appCtxt.accountList.saveImplicitPrefs();
+if(!ZmZimbraMail._isOkToExit()){
+ZmZimbraMail._isLogOff=false;
+return ZmMsg.appExitWarning
+}
+ZmZimbraMail._endSession();
+ZmZimbraMail._endSessionDone=true
+};
+ZmZimbraMail._isOkToExit=function(){
+var t=window._zimbraMail;
+if(!t){
+return true
+}
+var e=t._appViewMgr.isOkToUnload();
+if(e&&t._pollRequest){
+t._requestMgr.cancelRequest(t._pollRequest)
+}
+return e
+};
+ZmZimbraMail.unloadHackCallback=function(){
+window.onbeforeunload=null;
+var e=function(){
+window.onbeforeunload=ZmZimbraMail._confirmExitMethod
+};
+AjxTimedAction.scheduleAction((new AjxTimedAction(null,e)),3000)
+};
+ZmZimbraMail._userEventHdlr=function(t){
+var e=window._zimbraMail;
+if(e){
+AjxTimedAction.cancelAction(e._sessionTimerId);
+var a=appCtxt.get(ZmSetting.IDLE_SESSION_TIMEOUT)*1000;
+e._sessionTimerId=AjxTimedAction.scheduleAction(e._sessionTimer,a)
+}};
+ZmZimbraMail.prototype._createBanner=function(){
+var e=new DwtComposite({
+parent:this._shell,posStyle:Dwt.ABSOLUTE_STYLE,id:ZmId.BANNER}
+);
+var a=appCtxt.getSkinHint("banner","url")||appCtxt.get(ZmSetting.LOGO_URI);
+var t={
+url:a};
+e.getHtmlElement().innerHTML=AjxTemplate.expand("share.App#Banner",t);
+return e
+};
+ZmZimbraMail.prototype._createUserInfo=function(n,h,r){
+var e=appCtxt.getSkinHint(h,"position");
+var o=e||Dwt.ABSOLUTE_STYLE;
+var s=new DwtComposite({
+parent:this._shell,className:n,posStyle:o,id:r}
+);
+if(AjxEnv.isIE){
+var a=document.getElementById("skin_td_tree");
+var t=a?Dwt.getSize(document.getElementById("skin_td_tree")).x:null;
+if(t){
+s.setSize(t)
+}}
+s._setMouseEventHdlrs();
+return s
+};
+ZmZimbraMail.prototype._createAppChooser=function(){
+var a=[];
+for(var s in ZmApp.CHOOSER_SORT){
+if(s==ZmAppChooser.SPACER||s==ZmAppChooser.B_HELP||s==ZmAppChooser.B_LOGOUT){
+continue
+}
+var t=ZmApp.SETTING[s];
+var n=ZmApp.UPSELL_SETTING[s];
+if((t&&appCtxt.get(t))||(n&&appCtxt.get(n))){
+a.push(s)
+}}
+a.sort(function(h,r){
+return ZmZimbraMail.hashSortCompare(ZmApp.CHOOSER_SORT,h,r)
+}
+);
+var o=new ZmAppChooser({
+parent:this._shell,buttons:a,id:ZmId.APP_CHOOSER,refElementId:ZmId.SKIN_APP_CHOOSER}
+);
+var e=new AjxListener(this,this._appButtonListener);
+o.addSelectionListener(e);
+return o
+};
+ZmZimbraMail.prototype._appButtonListener=function(t){
+try{
+var a=t.item.getData(Dwt.KEY_ID);
+if(a==ZmAppChooser.B_HELP){
+window.open(appCtxt.get(ZmSetting.HELP_URI))
+}else{
+if(a==ZmAppChooser.B_LOGOUT){
+ZmZimbraMail.logOff()
+}else{
+if(a&&ZmApp.ENABLED_APPS[a]&&(a!=this._activeTabId)){
+this.activateApp(a);
+if(appCtxt.zimletsPresent()){
+appCtxt.getZimletMgr().notifyZimlets("onSelectApp",a)
+}}else{
+if(a!=this._activeTabId){
+this._appViewMgr.pushView(a)
+}
+if(t.target&&(t.target.className=="ImgClose")){
+this._appViewMgr.popView()
+}}}}}
+catch(e){
+this._handleException(e)
+}};
+ZmZimbraMail.prototype.getAppChooser=function(){
+return this._appChooser
+};
+ZmZimbraMail.prototype.setActiveTabId=function(e){
+this._activeTabId=e;
+this._appChooser.setSelected(e)
+};
+ZmZimbraMail.prototype.setStatusMsg=function(e){
+e=Dwt.getParams(arguments,ZmStatusView.MSG_PARAMS);
+this.statusView.setStatusMsg(e)
+};
+ZmZimbraMail.prototype.getKeyMapName=function(){
+var e=appCtxt.getCurrentController();
+if(e&&e.getKeyMapName){
+return e.getKeyMapName()
+}
+return"Global"
+};
+ZmZimbraMail.prototype.handleKeyAction=function(o,x){
+DwtMenu.closeActiveMenu();
+var h=ZmApp.GOTO_ACTION_CODE_R[o];
+if(h){
+if(h==this.getActiveApp()){
+return false
+}
+this.activateApp(h);
+return true
+}
+if(x&&(x.keyCode==13||x.keyCode==3)&&!(x.altKey||x.ctrlKey||x.metaKey||x.shiftKey)&&x.target&&(x.target.id!=DwtKeyboardMgr.FOCUS_FIELD_ID)){
+return false
+}
+switch(o){
+case ZmKeyMap.DBG_NONE:appCtxt.setStatusMsg("Setting Debug Level To: "+AjxDebug.NONE);
+break;
+case ZmKeyMap.DBG_1:appCtxt.setStatusMsg("Setting Debug Level To: "+AjxDebug.DBG1);
+break;
+case ZmKeyMap.DBG_2:appCtxt.setStatusMsg("Setting Debug Level To: "+AjxDebug.DBG2);
+break;
+case ZmKeyMap.DBG_3:appCtxt.setStatusMsg("Setting Debug Level To: "+AjxDebug.DBG3);
+break;
+case ZmKeyMap.DBG_TIMING:var c=DBG._showTiming;
+var t=c?"off":"on";
+appCtxt.setStatusMsg("Turning Timing Info "+t);
+break;
+case ZmKeyMap.ASSISTANT:if(appCtxt.get(ZmSetting.ASSISTANT_ENABLED)){
+if(!this._assistantDialog){
+AjxDispatcher.require("Assistant");
+this._assistantDialog=new ZmAssistantDialog()
+}
+this._assistantDialog.popup()
+}
+break;
+case ZmKeyMap.LOGOFF:ZmZimbraMail.logOff();
+break;
+case ZmKeyMap.FOCUS_SEARCH_BOX:var e=appCtxt.getSearchController().getSearchToolbar();
+if(e){
+var s=e.getSearchField();
+appCtxt.getKeyboardMgr().grabFocus(s);
+if(ZmSearchAutocomplete){
+ZmSearchAutocomplete._ignoreNextKey=true
+}}
+break;
+case ZmKeyMap.FOCUS_CONTENT_PANE:this.focusContentPane();
+break;
+case ZmKeyMap.FOCUS_TOOLBAR:this.focusToolbar();
+break;
+case ZmKeyMap.SHORTCUTS:var m=appCtxt.getShortcutsPanel();
+var u=this.getKeyMapName();
+var a=appCtxt.getAppController().getKeyMapMgr();
+var p=a.getAncestors(u);
+var d=(p&&p.length>0);
+p.unshift(u);
+var b=[],y=[];
+if(d){
+if(p.length>1&&p[p.length-1]=="Global"){
+p.pop();
+y.push("global")
+}}
+for(var w=0;
+w<p.length;
+w++){
+b.push(ZmKeyMap.MAP_NAME_R[p[w]]||DwtKeyMap.MAP_NAME_R[p[w]])
+}
+var q={}
+,k={};
+q.type=ZmShortcutList.TYPE_APP;
+q.maps=b;
+var l=[q];
+if(y.length){
+k.type=ZmShortcutList.TYPE_APP;
+k.maps=y;
+l.push(k)
+}
+var v={};
+v.type=ZmShortcutList.TYPE_SYS;
+v.maps=[];
+var n=appCtxt.getCurrentController();
+var j=["list","editor","tabView"];
+for(var w=0;
+w<j.length;
+w++){
+if(n.mapSupported(j[w])){
+v.maps.push(j[w])
+}}
+v.maps.push("button","menu","tree","dialog","toolbarHorizontal");
+l.push(v);
+m.popup(l);
+break;
+case ZmKeyMap.CANCEL:var r=false;
+var g=(DwtMouseEventCapture.getId()=="DwtControl")?DwtMouseEventCapture.getCaptureObj():null;
+var f=g&&g.targetObj;
+if(f&&(f._dragging==DwtControl._DRAGGING)){
+g.release();
+f.__lastDestDwtObj=null;
+f._setDragProxyState(false);
+DwtControl.__badDrop(f,DwtShell.mouseEvent);
+r=true
+}
+if(r){
+break
+}
+default:var n=appCtxt.getCurrentController();
+return(n&&n.handleKeyAction)?n.handleKeyAction(o,x):false
+}
+return true
+};
+ZmZimbraMail.prototype.focusContentPane=function(){
+var e=appCtxt.getCurrentController();
+var t=e?e.getCurrentView():null;
+if(t){
+appCtxt.getKeyboardMgr().grabFocus(t)
+}};
+ZmZimbraMail.prototype.focusToolbar=function(){
+var e=appCtxt.getCurrentController();
+var t=e?e.getCurrentToolbar():null;
+if(t){
+appCtxt.getKeyboardMgr().grabFocus(t)
+}};
+ZmZimbraMail.prototype._createUpsellView=function(n){
+var a=this._upsellView[n]=new ZmUpsellView({
+parent:this._shell,posStyle:Dwt.ABSOLUTE_STYLE,className:"ZmUpsellView"}
+);
+var o=appCtxt.get(ZmApp.UPSELL_URL[n]);
+var t=a.getHtmlElement();
+var l=[];
+var h=0;
+l[h++]="<iframe id='iframe_"+a.getHTMLElId()+"' width='100%' height='100%' frameborder='0' src='";
+l[h++]=o;
+l[h++]="'>";
+t.innerHTML=l.join("");
+var e={};
+e[ZmAppViewMgr.C_APP_CONTENT_FULL]=a;
+var r=[n,"upsell"].join("_");
+this._appViewMgr.createView({
+viewId:r,appName:n,elements:e,isTransient:true}
+);
+this._appViewMgr.pushView(r);
+var s=[ZmMsg.zimbraTitle,n].join(": ");
+Dwt.setTitle(s)
+};
+ZmZimbraMail._createDummyDBG=function(){
+window.AjxDebug=function(){};
+window.AjxDebug.prototype.toString=function(){
+return"dummy DBG class"
+};
+window.AjxDebug.prototype.display=function(){};
+window.AjxDebug.prototype.dumpObj=function(){};
+window.AjxDebug.prototype.getDebugLevel=function(){};
+window.AjxDebug.prototype.isDisabled=function(){};
+window.AjxDebug.prototype.println=function(){};
+window.AjxDebug.prototype.printRaw=function(){};
+window.AjxDebug.prototype.printXML=function(){};
+window.AjxDebug.prototype.setDebugLevel=function(){};
+window.AjxDebug.prototype.setTitle=function(){};
+window.AjxDebug.prototype.showTiming=function(){};
+window.AjxDebug.prototype._getTimeStamp=function(){};
+window.AjxDebug.prototype.timePt=function(){};
+window.DBG=new window.AjxDebug()
+};
+ZmZimbraMail.prototype._postLoadZimlet=function(){
+appCtxt.setZimletsPresent(true)
+};
+ZmZimbraMail.globalButtonListener=function(n){
+if(!appCtxt.areZimletsLoaded()){
+return
+}
+var o=n.item;
+var h=(o&&o.getText)?(o.getText()||o._toggleText):null;
+if(!h){
+h=o.getData(ZmOperation.KEY_ID)||o.getData(Dwt.KEY_ID)
+}
+if(h){
+var a;
+if(o instanceof ZmAppButton){
+a="app"
+}else{
+if(o instanceof DwtMenuItem){
+a="menuitem"
+}else{
+if(o instanceof DwtButton){
+a="button"
+}else{
+if(o instanceof DwtTreeItem){
+if(!o.getSelected()){
+return
+}
+a="treeitem"
+}else{
+a=o.toString()
+}}}}
+var t=appCtxt.getAppViewMgr();
+var e=t.getCurrentViewId();
+var r=t.getLastViewId();
+var s=(AjxStringUtil.split(h," ")).join("");
+appCtxt.notifyZimlets("onAction",[a,s,e,r])
+}};
+ZmZimbraMail._endSession=function(){
+var e=new AjxCallback(null,function(){
+return true
+}
+);
+var t={
+jsonObj:{
+EndSessionRequest:{
+_jsns:"urn:zimbraAccount"}}
+,asyncMode:true,errorCallback:e};
+appCtxt.getAppController().sendRequest(t)
+};
+ZmOrganizer.ZIMLET="ZIMLET"
+}
+if(AjxPackage.define("zimbraMail.calendar.model.ZmCalBaseItem")){
+ZmCalBaseItem=function(t,a,o,e){
+if(arguments.length==0){
+return
+}
+ZmItem.call(this,t,o,a);
+this.id=o||-1;
+this.uid=-1;
+this.folderId=e||this._getDefaultFolderId();
+this.fragment="";
+this.name="";
+this.allDayEvent="0";
+this.startDate=null;
+this.endDate=null;
+this.timezone=AjxTimezone.getServerId(AjxTimezone.DEFAULT);
+this.alarm=false;
+this.alarmData=null;
+this.isException=false;
+this.recurring=false;
+this.priority=null;
+this.ptst=null;
+this.status=ZmCalendarApp.STATUS_CONF;
+this._reminderMinutes=0;
+this.otherAttendees=false
+};
+ZmCalBaseItem.prototype=new ZmItem;
+ZmCalBaseItem.prototype.constructor=ZmCalBaseItem;
+ZmCalBaseItem.prototype.toString=function(){
+return"ZmCalBaseItem"
+};
+ZmCalBaseItem.PERSON="PERSON";
+ZmCalBaseItem.LOCATION="LOCATION";
+ZmCalBaseItem.EQUIPMENT="EQUIPMENT";
+ZmCalBaseItem.FORWARD="FORWARD";
+ZmCalBaseItem.PSTATUS_ACCEPT="AC";
+ZmCalBaseItem.PSTATUS_DECLINED="DE";
+ZmCalBaseItem.PSTATUS_DEFERRED="DF";
+ZmCalBaseItem.PSTATUS_DELEGATED="DG";
+ZmCalBaseItem.PSTATUS_NEEDS_ACTION="NE";
+ZmCalBaseItem.PSTATUS_COMPLETED="CO";
+ZmCalBaseItem.PSTATUS_TENTATIVE="TE";
+ZmCalBaseItem.PSTATUS_WAITING="WA";
+ZmCalBaseItem.FBA_TO_PTST={
+B:ZmCalBaseItem.PSTATUS_ACCEPT,F:ZmCalBaseItem.PSTATUS_DECLINED,T:ZmCalBaseItem.PSTATUS_TENTATIVE};
+ZmCalBaseItem._pstatusString={
+NE:ZmMsg._new,TE:ZmMsg.tentative,AC:ZmMsg.accepted,DE:ZmMsg.declined,DG:ZmMsg.delegated};
+ZmCalBaseItem.compareByTimeAndDuration=function(t,e){
+if(t.getStartTime()>e.getStartTime()){
+return 1
+}
+if(t.getStartTime()<e.getStartTime()){
+return -1
+}
+if(t.getDuration()<e.getDuration()){
+return 1
+}
+if(t.getDuration()>e.getDuration()){
+return -1
+}
+return 0
+};
+ZmCalBaseItem.createFromDom=function(t,a,e){
+var o=new ZmCalBaseItem(ZmItem.APPT,a.list);
+o._loadFromDom(t,(e||{}
+));
+return o
+};
+ZmCalBaseItem.prototype.getName=function(){
+return this.name||""
+};
+ZmCalBaseItem.prototype.getEndTime=function(){
+return this.endDate.getTime()
+};
+ZmCalBaseItem.prototype.getStartTime=function(){
+return this.startDate.getTime()
+};
+ZmCalBaseItem.prototype.getDuration=function(){
+return this.getEndTime()-this.getStartTime()
+};
+ZmCalBaseItem.prototype.getLocation=function(){
+return this.location||""
+};
+ZmCalBaseItem.prototype.isAllDayEvent=function(){
+return this.allDayEvent=="1"
+};
+ZmCalBaseItem.prototype.getParticipantStatusStr=function(){
+return ZmCalBaseItem._pstatusString[this.ptst]
+};
+ZmCalBaseItem.prototype.getUniqueId=function(e){
+if(e){
+if(!this._startTimeUniqId){
+this._startTimeUniqId=this.id+"_"+this.getStartTime()
+}
+return this._startTimeUniqId
+}else{
+if(this._uniqId==null){
+this._uniqId=Dwt.getNextId()
+}
+return(this.id+"_"+this._uniqId)
+}};
+ZmCalBaseItem.prototype.isMultiDay=function(){
+var t=this.startDate;
+var e=this.endDate;
+if(e.getHours()==0&&e.getMinutes()==0&&e.getSeconds()==0){
+e=new Date(e.getTime()-2*AjxDateUtil.MSEC_PER_HOUR)
+}
+return(t.getDate()!=e.getDate())||(t.getMonth()!=e.getMonth())||(t.getFullYear()!=e.getFullYear())
+};
+ZmCalBaseItem.prototype.getDurationText=function(a,e){
+var o=this.isAllDayEvent();
+var s=this.isMultiDay();
+if(o){
+if(a){
+return""
+}
+var r=this.startDate;
+var t=new Date(this.endDate.getTime()-(s?2*AjxDateUtil.MSEC_PER_HOUR:0));
+var n=s?ZmMsg.apptTimeAllDayMulti:ZmMsg.apptTimeAllDay;
+return AjxMessageFormat.format(n,[r,t])
+}
+if(e){
+return ZmCalBaseItem._getTTHour(this.startDate)
+}
+var n=s?ZmMsg.apptTimeInstanceMulti:ZmMsg.apptTimeInstance;
+return AjxMessageFormat.format(n,[this.startDate,this.endDate,""])
+};
+ZmCalBaseItem.prototype.isAlarmInRange=function(){
+if(!this.alarmData){
+return false
+}
+var t=this.alarmData[0];
+if(!t){
+return false
+}
+this._nextAlarmTime=this.adjustMS(t.nextAlarm,this.tzo);
+this._alarmInstStart=this.adjustMS(t.alarmInstStart,this.tzo);
+var e=(new Date()).getTime();
+return(e>=this._nextAlarmTime)
+};
+ZmCalBaseItem.prototype.adjustMS=function(e,a){
+var t=this.isAllDayEvent()?(a+new Date(e).getTimezoneOffset()*60*1000):0;
+return parseInt(e,10)+t
+};
+ZmCalBaseItem.prototype.isAlarmInstance=function(){
+if(!this.alarmData){
+return false
+}
+var e=this.alarmData[0];
+this._alarmInstStart=this.adjustMS(e.alarmInstStart,this.tzo);
+return(this._alarmInstStart==this.startDate.getTime())
+};
+ZmCalBaseItem.prototype.hasAlarmData=function(){
+return(this.alarmData!=null)
+};
+ZmCalBaseItem.prototype._loadFromDom=function(a,e){
+this.uid=a.uid;
+this.folderId=a.l||this._getDefaultFolderId();
+this.invId=a.invId;
+this.id=this._getAttr(a,e,"id");
+this.name=this._getAttr(a,e,"name");
+this.fragment=this._getAttr(a,e,"fr");
+this.status=this._getAttr(a,e,"status");
+this.ptst=this._getAttr(a,e,"ptst");
+this.isException=this._getAttr(a,e,"ex");
+this.allDayEvent=(e.allDay||a.allDay)?"1":"0";
+this.organizer=a.or&&a.or.a;
+this.isOrg=this._getAttr(a,e,"isOrg");
+this.transparency=this._getAttr(a,e,"transp");
+if(e.allDay==false){
+this.allDayEvent="0"
+}
+this.alarm=this._getAttr(a,e,"alarm");
+this.alarmData=this._getAttr(a,e,"alarmData");
+this.priority=parseInt(this._getAttr(a,e,"priority"));
+this.recurring=e.recur!=null?e.recur:a.recur;
+this.fba=this._getAttr(a,e,"fba");
+var r=this._getAttr(a,e,"s");
+if(r){
+var h=this.tzo=e.tzo!=null?e.tzo:a.tzo;
+var s=this.isAllDayEvent()?(h+new Date(e.s).getTimezoneOffset()*60*1000):0;
+var n=parseInt(r,10)+s;
+this.startDate=new Date(n);
+this.uniqStartTime=this.startDate.getTime()
+}
+var o=this._getAttr(a,e,"dur");
+if(o){
+var t=n+(parseInt(o));
+this.endDate=new Date(t)
+}
+this.otherAttendees=this._getAttr(a,e,"otherAtt");
+this.location=this._getAttr(a,e,"loc")
+};
+ZmCalBaseItem.prototype._getDefaultFolderId=function(){
+return ZmOrganizer.ID_CALENDAR
+};
+ZmCalBaseItem.prototype._getAttr=function(e,a,t){
+return a[t]!=null?a[t]:e[t]
+};
+ZmCalBaseItem.prototype._addLocationToSoap=function(e){
+e.setAttribute("loc",this.getLocation())
+};
+ZmCalBaseItem._getTTHour=function(t){
+var e=AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT);
+return e.format(t)
+};
+ZmCalBaseItem.prototype.getReminderLocation=function(){
+return(this.alarmData[0].loc||"")
+};
+ZmCalBaseItem.prototype.getReminderName=function(){
+return(this.alarmData[0].name||"")
+};
+ZmCalBaseItem.prototype.isAlarmOld=function(){
+if(!this.alarmData){
+return false
+}
+var a=this.alarmData[0];
+this._nextAlarmTime=a.nextAlarm;
+this._alarmInstStart=a.alarmInstStart;
+var e=(new Date()).getTime();
+var t=(e-this._nextAlarmTime);
+if(t>2*AjxDateUtil.MSEC_PER_DAY){
+return true
+}
+return false
+}
+}
+if(AjxPackage.define("zimbraMail.prefs.ZmPreferencesApp")){
+ZmPreferencesApp=function(t,e){
+ZmApp.call(this,ZmApp.PREFERENCES,t,e);
+this._filterRules={}
+};
+ZmEvent.S_FILTER="FILTER";
+ZmEvent.S_PREF_ZIMLET="PREF_ZIMLET";
+ZmApp.PREFERENCES=ZmId.APP_PREFERENCES;
+ZmApp.CLASS[ZmApp.PREFERENCES]="ZmPreferencesApp";
+ZmApp.SETTING[ZmApp.PREFERENCES]=ZmSetting.OPTIONS_ENABLED;
+ZmApp.LOAD_SORT[ZmApp.PREFERENCES]=10;
+ZmApp.QS_ARG[ZmApp.PREFERENCES]="options";
+ZmOrganizer.PREF_PAGE="PREF_PAGE";
+ZmPreferencesApp.prototype=new ZmApp;
+ZmPreferencesApp.prototype.constructor=ZmPreferencesApp;
+ZmPreferencesApp.prototype.toString=function(){
+return"ZmPreferencesApp"
+};
+ZmPreferencesApp._registerAllPrefs=function(){
+AjxDispatcher.require("PreferencesCore");
+appCtxt.getAppController().runAppFunction("_registerPrefs")
+};
+ZmZimbraMail.addAppListener(ZmApp.PREFERENCES,ZmAppEvent.PRE_LAUNCH,new AjxListener(ZmPreferencesApp._registerAllPrefs));
+ZmPreferencesApp.prototype.launch=function(t,a){
+if(appCtxt.isOffline){
+appCtxt.accountList.setActiveAccount(appCtxt.accountList.mainAccount)
+}
+var e=new AjxCallback(this,this._handleLoadLaunch,[a]);
+AjxDispatcher.require(["PreferencesCore","Preferences"],true,e,null,true)
+};
+ZmPreferencesApp.prototype.getPrefController=function(){
+if(!this._prefController){
+AjxDispatcher.require(["PreferencesCore","Preferences"]);
+this._prefController=new ZmPrefController(this._container,this)
+}
+return this._prefController
+};
+ZmPreferencesApp.prototype.getFilterController=function(){
+if(!this._filterController){
+this._filterController=new ZmFilterController(this._container,this)
+}
+return this._filterController
+};
+ZmPreferencesApp.prototype.getFilterRules=function(){
+var t=window.parentAppCtxt||window.appCtxt;
+var e=t.getActiveAccount().name;
+if(!this._filterRules[e]){
+this._filterRules[e]=new ZmFilterRules()
+}
+return this._filterRules[e]
+};
+ZmPreferencesApp.prototype.modifyNotify=function(a,e){
+var t=this._getSharingView();
+if(t){
+t.notifyModify(a)
+}};
+ZmPreferencesApp.prototype.refresh=function(e){
+if(!appCtxt.inStartup){
+var t=this._getSharingView();
+if(t){
+t.refresh(e)
+}}};
+ZmPreferencesApp.prototype._defineAPI=function(){
+AjxDispatcher.registerMethod("GetFilterRules",["PreferencesCore","Preferences"],new AjxCallback(this,this.getFilterRules));
+AjxDispatcher.registerMethod("GetPrefController",["PreferencesCore","Preferences"],new AjxCallback(this,this.getPrefController));
+AjxDispatcher.registerMethod("GetFilterController",["PreferencesCore","Preferences"],new AjxCallback(this,this.getFilterController))
+};
+ZmPreferencesApp.prototype._registerOrganizers=function(){
+ZmOrganizer.registerOrg(ZmOrganizer.PREF_PAGE,{
+app:ZmApp.PREFERENCES,orgClass:"ZmPrefPage",orgPackage:"PreferencesCore",treeController:"ZmPrefPageTreeController",labelKey:"preferences",treeType:ZmOrganizer.PREF_PAGE,displayOrder:100}
+)
+};
+ZmPreferencesApp.prototype._registerOperations=function(){
+ZmOperation.registerOp(ZmId.OP_MOBILE_RESUME_SYNC,{
+textKey:"mobileResumeSync",image:"ImAvailable"}
+);
+ZmOperation.registerOp(ZmId.OP_MOBILE_SUSPEND_SYNC,{
+textKey:"mobileSuspendSync",image:"Offline"}
+);
+ZmOperation.registerOp(ZmId.OP_MOBILE_WIPE,{
+textKey:"mobileWipe",image:"MobileWipe"}
+,ZmSetting.MOBILE_POLICY_ENABLED);
+ZmOperation.registerOp(ZmId.OP_MOBILE_CANCEL_WIPE,{
+textKey:"mobileWipeCancel",image:"MobileWipeCancel"}
+,ZmSetting.MOBILE_POLICY_ENABLED)
+};
+ZmPreferencesApp.prototype._registerSettings=function(e){
+e=e||appCtxt.getSettings();
+e.registerSetting("IMPORT_FOLDER",{
+type:ZmSetting.T_PSEUDO,dataType:ZmSetting.D_NONE}
+);
+e.registerSetting("IMPORT_BUTTON",{
+type:ZmSetting.T_PSEUDO,dataType:ZmSetting.D_NONE}
+);
+e.registerSetting("EXPORT_FOLDER",{
+type:ZmSetting.T_PSEUDO,dataType:ZmSetting.D_NONE}
+);
+e.registerSetting("EXPORT_BUTTON",{
+type:ZmSetting.T_PSEUDO,dataType:ZmSetting.D_NONE}
+);
+e.registerSetting("PREF_SECTIONS",{
+type:ZmSetting.T_PSEUDO,dataType:ZmSetting.D_HASH,isGlobal:true}
+);
+e.registerSetting("SIGNATURE_MAX_LENGTH",{
+name:"zimbraMailSignatureMaxLength",type:ZmSetting.T_COS,dataType:ZmSetting.D_INT,defaultValue:1024}
+);
+e.registerSetting("DISCARD_IN_FILTER_ENABLED",{
+name:"zimbraFeatureDiscardInFiltersEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+)
+};
+ZmPreferencesApp.prototype._registerApp=function(){
+ZmApp.registerApp(ZmApp.PREFERENCES,{
+mainPkg:"Preferences",nameKey:"preferences",icon:"Preferences",textPrecedence:50,chooserTooltipKey:"goToOptions",button:appCtxt.isChildWindow?null:ZmAppChooser.B_OPTIONS,overviewTrees:[ZmOrganizer.PREF_PAGE],hideZimlets:true,gotoActionCode:ZmKeyMap.GOTO_OPTIONS,chooserSort:180}
+)
+};
+ZmPreferencesApp.prototype._registerPrefs=function(){
+var l={
+GENERAL:{
+title:ZmMsg.general,description:"[General settings]",templateId:"prefs.Pages#General",priority:0,prefs:[ZmSetting.LOCALE_NAME,ZmSetting.PASSWORD,ZmSetting.SEARCH_INCLUDES_SPAM,ZmSetting.SEARCH_INCLUDES_TRASH,ZmSetting.OFFLINE_SHOW_GLOBAL_INBOX,ZmSetting.SHOW_SEARCH_STRING,ZmSetting.SHOW_SELECTION_CHECKBOX,ZmSetting.SKIN_NAME,ZmSetting.CLIENT_TYPE,ZmSetting.DEFAULT_TIMEZONE,ZmSetting.OFFLINE_IS_MAILTO_HANDLER]}
+,COMPOSING:{
+parentId:"MAIL",title:ZmMsg.composing,icon:"Compose",templateId:"prefs.Pages#Composing",priority:20,precondition:[ZmSetting.MAIL_ENABLED],prefs:[ZmSetting.COMPOSE_AS_FORMAT,ZmSetting.COMPOSE_INIT_FONT_COLOR,ZmSetting.COMPOSE_INIT_FONT_FAMILY,ZmSetting.COMPOSE_INIT_FONT_SIZE,ZmSetting.FORWARD_INCLUDE_ORIG,ZmSetting.NEW_WINDOW_COMPOSE,ZmSetting.AUTO_SAVE_DRAFT_INTERVAL,ZmSetting.REPLY_INCLUDE_ORIG,ZmSetting.REPLY_PREFIX,ZmSetting.SAVE_TO_SENT,ZmSetting.COMPOSE_SAME_FORMAT,ZmSetting.MAIL_MANDATORY_SPELLCHECK]}
+,SHARING:{
+title:ZmMsg.sharing,icon:"SharedContact",templateId:"prefs.Pages#SharingPrefPage",priority:85,precondition:ZmSetting.SHARING_ENABLED,manageChanges:true,createView:function(m,f,u){
+AjxDispatcher.require("Share");
+return new ZmSharingPage(m,f,u)
+}}
+,MOBILE:{
+title:ZmMsg.mobileDevices,icon:"Mobile",templateId:"prefs.Pages#MobileDevices",priority:90,precondition:ZmSetting.MOBILE_SYNC_ENABLED,manageChanges:true,createView:function(m,f,u){
+return new ZmMobileDevicesPage(m,f,u)
+}}
+,IMPORT_EXPORT:{
+title:ZmMsg.importExport,icon:"SendReceive",templateId:"data.ImportExport#ImportExportPrefPage",priority:100,precondition:ZmSetting.IMPORT_EXPORT_ENABLED,prefs:[ZmSetting.IMPORT_FOLDER,ZmSetting.IMPORT_BUTTON,ZmSetting.EXPORT_FOLDER,ZmSetting.EXPORT_BUTTON],manageChanges:true,createView:function(m,f,u){
+AjxDispatcher.require("ImportExport");
+return new ZmImportExportPage(m,f,u)
+}}
+,SHORTCUTS:{
+title:ZmMsg.shortcuts,icon:"Shortcut",templateId:"prefs.Pages#Shortcuts",priority:120,precondition:ZmSetting.USE_KEYBOARD_SHORTCUTS,createView:function(m,f,u){
+return new ZmShortcutsPage(m,f,u)
+}}
+,PREF_ZIMLETS:{
+title:ZmMsg.zimlets,icon:"Zimlet",templateId:"prefs.Pages#Zimlets",manageDirty:true,priority:140,prefs:[ZmSetting.CHECKED_ZIMLETS],createView:function(m,f,u){
+return new ZmZimletsPage(m,f,u)
+}}};
+for(var a in l){
+ZmPref.registerPrefSection(a,l[a])
+}
+ZmPref.registerPref("CLIENT_TYPE",{
+displayName:ZmMsg.clientType,displayContainer:ZmPref.TYPE_RADIO_GROUP,orientation:ZmPref.ORIENT_VERTICAL,displayOptions:[ZmMsg.clientAdvanced,ZmMsg.clientStandard],options:[ZmSetting.CLIENT_ADVANCED,ZmSetting.CLIENT_STANDARD]}
+);
+ZmPref.registerPref("COMPOSE_AS_FORMAT",{
+displayName:ZmMsg.composeUsing,displayContainer:ZmPref.TYPE_RADIO_GROUP,orientation:ZmPref.ORIENT_VERTICAL,displayOptions:[ZmMsg.composeAsHTML,ZmMsg.composeAsText],options:[ZmSetting.COMPOSE_HTML,ZmSetting.COMPOSE_TEXT],precondition:ZmSetting.HTML_COMPOSE_ENABLED}
+);
+ZmPref.registerPref("COMPOSE_INIT_FONT_COLOR",{
+displayOptions:["rgb(0, 0, 0)"],displayContainer:ZmPref.TYPE_COLOR,precondition:[ZmSetting.HTML_COMPOSE_ENABLED,ZmSetting.NOTEBOOK_ENABLED]}
+);
+ZmPref.registerPref("COMPOSE_INIT_FONT_FAMILY",{
+displayName:ZmMsg.defaultFontSettings,displayContainer:ZmPref.TYPE_SELECT,displayOptions:["Arial","Times New Roman","Courier","Verdana"],options:["Arial","Times New Roman","Courier","Verdana"],precondition:[ZmSetting.HTML_COMPOSE_ENABLED,ZmSetting.NOTEBOOK_ENABLED]}
+);
+var s=[AjxMessageFormat.format(ZmMsg.pt,"8"),AjxMessageFormat.format(ZmMsg.pt,"10"),AjxMessageFormat.format(ZmMsg.pt,"12"),AjxMessageFormat.format(ZmMsg.pt,"14"),AjxMessageFormat.format(ZmMsg.pt,"18"),AjxMessageFormat.format(ZmMsg.pt,"24"),AjxMessageFormat.format(ZmMsg.pt,"36")];
+var h=["8pt","10pt","12pt","14pt","18pt","24pt","36pt"];
+ZmPref.registerPref("COMPOSE_INIT_FONT_SIZE",{
+displayName:null,displayContainer:ZmPref.TYPE_SELECT,displayOptions:s,options:h,precondition:[ZmSetting.HTML_COMPOSE_ENABLED,ZmSetting.NOTEBOOK_ENABLED]}
+);
+ZmPref.registerPref("COMPOSE_SAME_FORMAT",{
+displayName:ZmMsg.replyForwardInSameFormat,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("CHECKED_ZIMLETS",{
+displayName:ZmMsg.zimlets,displayContainer:ZmPref.TYPE_CUSTOM}
+);
+ZmPref.registerPref("FORWARD_INCLUDE_ORIG",{
+displayName:ZmMsg.forwardInclude,displayContainer:ZmPref.TYPE_SELECT,displayOptions:[ZmMsg.includeInBody,ZmMsg.includePrefix,ZmMsg.includePrefixFull,ZmMsg.includeOriginalAsAttach],options:[ZmSetting.INCLUDE,ZmSetting.INCLUDE_PREFIX,ZmSetting.INCLUDE_PREFIX_FULL,ZmSetting.INCLUDE_ATTACH]}
+);
+ZmPref.registerPref("DEFAULT_TIMEZONE",{
+displayName:ZmMsg.selectTimezone,displayContainer:ZmPref.TYPE_SELECT,displayParams:{
+cascade:false}
+,displayOptions:AjxTimezone.getZonePreferences(),options:AjxTimezone.getZonePreferencesOptions()}
+);
+ZmPref.registerPref("EXPORT_FOLDER",{
+displayContainer:ZmPref.TYPE_CUSTOM}
+);
+ZmPref.registerPref("EXPORT_BUTTON",{
+displayName:ZmMsg._export,displayContainer:ZmPref.TYPE_CUSTOM}
+);
+ZmPref.registerPref("IMPORT_FOLDER",{
+loadFunction:ZmPref.loadCsvFormats,displayContainer:ZmPref.TYPE_CUSTOM}
+);
+ZmPref.registerPref("IMPORT_BUTTON",{
+displayName:ZmMsg._import,displayContainer:ZmPref.TYPE_CUSTOM}
+);
+ZmPref.registerPref("LOCALE_NAME",{
+displayName:ZmMsg.selectLanguage,displayContainer:ZmPref.TYPE_LOCALES,precondition:ZmSetting.LOCALE_CHANGE_ENABLED}
+);
+var c=AjxMessageFormat.format(ZmMsg.messageReadTime,DwtId._makeId(ZmId.WIDGET_INPUT,ZmId.OP_MARK_READ));
+ZmPref.registerPref("MARK_MSG_READ",{
+displayName:ZmMsg.messageReadLabel,displayContainer:ZmPref.TYPE_RADIO_GROUP,displayFunction:ZmPref.markMsgReadDisplay,orientation:ZmPref.ORIENT_VERTICAL,displayOptions:[ZmMsg.messageReadNow,c,ZmMsg.messageReadNone],options:[ZmSetting.MARK_READ_NOW,ZmSetting.MARK_READ_TIME,ZmSetting.MARK_READ_NONE],valueFunction:ZmPref.markMsgReadValue}
+);
+ZmPref.registerPref("NEW_WINDOW_COMPOSE",{
+displayName:ZmMsg.composeInNewWin,displayContainer:ZmPref.TYPE_CHECKBOX,precondition:AjxCallback.simpleClosure(ZmPref.requireAllPreConditions,null,ZmSetting.MAIL_ENABLED,ZmSetting.DETACH_COMPOSE_ENABLED)}
+);
+ZmPref.registerPref("MAIL_MANDATORY_SPELLCHECK",{
+displayName:ZmMsg.mandatorySpellcheck,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("PASSWORD",{
+displayName:ZmMsg.changePassword,displayContainer:ZmPref.TYPE_PASSWORD,precondition:ZmSetting.CHANGE_PASSWORD_ENABLED}
+);
+ZmPref.registerPref("SHARING",{
+displayContainer:ZmPref.TYPE_CUSTOM}
+);
+if(appCtxt.isOffline){
+ZmPref.registerPref("OFFLINE_IS_MAILTO_HANDLER",{
+displayName:ZmMsg.offlineAllowMailTo,displayContainer:ZmPref.TYPE_CHECKBOX}
+)
+}
+var d=[525600];
+var o=ZmPref.pollingIntervalDisplay(appCtxt.get(ZmSetting.MIN_POLLING_INTERVAL));
+o=(o<1)?1:Math.round(o);
+var e=ZmPref.pollingIntervalDisplay(appCtxt.get(ZmSetting.POLLING_INTERVAL));
+e=Math.round(e);
+while(o<=10){
+d.push(o);
+o++
+}
+o=o-1;
+var r=d.length;
+while(r<10){
+o=o+5;
+d.push(o);
+r++
+}
+if(e>o){
+var t=e%5;
+t=(t==0)?e:((e/5+1)*5);
+d.push(t)
+}else{
+o=o+5;
+d.push(o)
+}
+var n=[ZmMsg.pollNever];
+while(n.length<=r){
+n.push(ZmMsg.pollEveryNMinutes)
+}
+ZmPref.registerPref("POLLING_INTERVAL",{
+displayName:ZmMsg.pollingInterval,displayContainer:ZmPref.TYPE_SELECT,displayOptions:n,options:d,approximateFunction:ZmPref.approximateInterval,displayFunction:ZmPref.pollingIntervalDisplay,valueFunction:ZmPref.pollingIntervalValue,validationFunction:ZmPref.validatePollingInterval}
+);
+ZmPref.registerPref("REPLY_INCLUDE_ORIG",{
+displayName:ZmMsg.replyInclude,displayContainer:ZmPref.TYPE_SELECT,displayOptions:[ZmMsg.dontInclude,ZmMsg.includeInBody,ZmMsg.includePrefix,ZmMsg.includePrefixFull,ZmMsg.includeOriginalAsAttach,ZmMsg.smartInclude],options:[ZmSetting.INCLUDE_NONE,ZmSetting.INCLUDE,ZmSetting.INCLUDE_PREFIX,ZmSetting.INCLUDE_PREFIX_FULL,ZmSetting.INCLUDE_ATTACH,ZmSetting.INCLUDE_SMART]}
+);
+ZmPref.registerPref("REPLY_PREFIX",{
+displayName:ZmMsg.prefix,displayContainer:ZmPref.TYPE_RADIO_GROUP,orientation:ZmPref.ORIENT_HORIZONTAL,displayOptions:[">","|"]}
+);
+ZmPref.registerPref("SAVE_TO_SENT",{
+displayName:ZmMsg.saveToSent,displayContainer:ZmPref.TYPE_RADIO_GROUP,orientation:ZmPref.ORIENT_VERTICAL,precondition:ZmSetting.MAIL_ENABLED,displayOptions:[ZmMsg.saveToSent,ZmMsg.saveToSentNOT],options:[true,false]}
+);
+ZmPref.registerPref("SEARCH_INCLUDES_SPAM",{
+displayName:ZmMsg.includeJunkFolder,displayContainer:ZmPref.TYPE_CHECKBOX,precondition:AjxCallback.simpleClosure(ZmPref.requireAllPreConditions,null,ZmSetting.MAIL_ENABLED,ZmSetting.SPAM_ENABLED)}
+);
+ZmPref.registerPref("SEARCH_INCLUDES_TRASH",{
+displayName:ZmMsg.includeTrashFolder,displayContainer:ZmPref.TYPE_CHECKBOX,precondition:[ZmSetting.MAIL_ENABLED,ZmSetting.CONTACTS_ENABLED]}
+);
+ZmPref.registerPref("SHOW_FRAGMENTS",{
+displayName:ZmMsg.showFragments,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("OFFLINE_SHOW_GLOBAL_INBOX",{
+displayName:ZmMsg.showGlobalInbox,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("SHOW_SEARCH_STRING",{
+displayName:ZmMsg.showSearchString,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("SHOW_SELECTION_CHECKBOX",{
+displayName:ZmMsg.showSelectionString,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("SKIN_NAME",{
+displayName:ZmMsg.selectSkin,displayContainer:ZmPref.TYPE_SELECT,displayOptions:[],options:[],loadFunction:ZmPref.loadSkins,precondition:ZmSetting.SKIN_CHANGE_ENABLED}
+);
+ZmPref.registerPref("VIEW_AS_HTML",{
+displayName:ZmMsg.displayMail,displayContainer:ZmPref.TYPE_RADIO_GROUP,orientation:ZmPref.ORIENT_VERTICAL,displayOptions:[ZmMsg.displayAsHTML,ZmMsg.displayAsText],options:[true,false]}
+)
+};
+ZmPreferencesApp.prototype._handleLoadLaunch=function(t){
+var e=new AjxCallback(this,this._handleResponseLaunch,[t]);
+appCtxt.getSettings().loadPreferenceData(e)
+};
+ZmPreferencesApp.prototype._handleResponseLaunch=function(e){
+AjxDispatcher.run("GetPrefController").show();
+if(e){
+e.run()
+}};
+ZmPreferencesApp.prototype._getSharingView=function(){
+if(!this._prefController){
+return null
+}
+var a=this.getPrefController();
+var t=a&&a.getPrefsView();
+var e=t&&t.getView("SHARING");
+return(e&&e.view)
+};
+ZmPreferencesApp.prototype._getOverviewParams=function(){
+var e=ZmApp.prototype._getOverviewParams.call(this);
+e.omit={};
+e.omit[ZmOrganizer.ID_ZIMLET]=true;
+return e
+}
+}
+if(AjxPackage.define("zimbraMail.portal.ZmPortalApp")){
+ZmPortalApp=function(t,e){
+ZmApp.call(this,ZmApp.PORTAL,t,e)
+};
+ZmPortalApp.prototype=new ZmApp;
+ZmPortalApp.prototype.constructor=ZmPortalApp;
+ZmPortalApp.prototype.toString=function(){
+return"ZmPortalApp"
+};
+ZmPortalApp.prototype._registerApp=function(){
+ZmApp.registerApp(ZmApp.PORTAL,{
+nameKey:"portal",icon:"Globe",chooserTooltipKey:"goToPortal",button:ZmAppChooser.B_PORTAL,chooserSort:1,defaultSort:1}
+)
+};
+ZmApp.PORTAL=ZmId.APP_PORTAL;
+ZmApp.CLASS[ZmApp.PORTAL]="ZmPortalApp";
+ZmApp.SETTING[ZmApp.PORTAL]=ZmSetting.PORTAL_ENABLED;
+ZmApp.LOAD_SORT[ZmApp.PORTAL]=1;
+ZmApp.QS_ARG[ZmApp.PORTAL]="home";
+ZmEvent.S_PORTLET="PORTLET";
+ZmItem.PORTLET=ZmEvent.S_PORTLET;
+ZmPortalApp.__PORTLET_ID=0;
+ZmPortalApp.prototype.refreshPortlets=function(){
+var t=this.getPortletMgr();
+var e=t.getPortlets();
+for(var a in e){
+e[a].refresh()
+}};
+ZmPortalApp.prototype.launch=function(t,a){
+var e=new AjxCallback(this,this._handleLoadLaunch,[t,a]);
+AjxDispatcher.require("Portal",true,e,null,true)
+};
+ZmPortalApp.prototype._handleLoadLaunch=function(t,a){
+var e=this.getPortalController();
+e.show();
+ZmApp.prototype.launch.call(this,t,a)
+};
+ZmPortalApp.prototype.activate=function(t){
+var e=this.getPortalController();
+e.setPaused(!t);
+ZmApp.prototype.activate.call(this,t)
+};
+ZmPortalApp.prototype.getManifest=function(n){
+if(!this._manifest){
+var a=appCtxt.get(ZmSetting.PORTAL_NAME);
+if(a){
+var t=new Date().getTime();
+var o={
+url:[window.appContextPath,"/portals/",a,"/manifest.xml?v=",t].join(""),callback:n?new AjxCallback(this,this._handleLoadManifest,[n]):null};
+var e=AjxLoader.load(o);
+if(!n){
+this._handleLoadManifest(n,e)
+}}}else{
+if(n){
+n.run(this._manifest)
+}}
+return this._manifest
+};
+ZmPortalApp.prototype._handleLoadManifest=function(callback,req){
+var e;
+if(req.status==200&&req.responseXML){
+try{
+var json=new AjxJsonSerializer(true).serialize(req.responseXML);
+eval("this._manifest = "+json);
+var portalDef=this._manifest.portal;
+var portletsDef=portalDef&&portalDef.portlets;
+if(portletsDef&&!(portletsDef.portlet instanceof Array)){
+portletsDef.portlet=[portletsDef.portlet]
+}
+portalDef.portlets=portletsDef.portlet;
+if(portalDef.portlets){
+for(var i=0;
+i<portalDef.portlets.length;
+i++){
+var portletDef=portalDef.portlets[i];
+var propertyDef=portletDef.property;
+if(propertyDef&&!(propertyDef instanceof Array)){
+propertyDef=[propertyDef]
+}
+portletDef.properties=propertyDef;
+delete portletDef.property
+}}}
+catch(e){}}else{
+e=""
+}
+if(!this._manifest){
+this._manifest={
+error:e}
+}
+if(callback){
+callback.run(this._manifest)
+}};
+ZmPortalApp.prototype.getPortalController=function(){
+AjxDispatcher.require("Portal");
+if(!this._portalController){
+this._portalController=new ZmPortalController(this._container,this)
+}
+return this._portalController
+};
+ZmPortalApp.prototype.getPortletMgr=function(){
+AjxDispatcher.require("Portal");
+if(!this._portletMgr){
+this._portletMgr=new ZmPortletMgr()
+}
+return this._portletMgr
+};
+ZmPortalApp.prototype._getOverviewTrees=function(){
+return this._getOverviewApp()._getOverviewTrees()
+};
+ZmPortalApp.prototype._getOverviewApp=function(){
+if(!this._overviewApp){
+var o=[];
+for(var t in ZmApp.CHOOSER_SORT){
+o.push({
+name:t,sort:ZmApp.CHOOSER_SORT[t]}
+)
+}
+o.sort(ZmPortalApp.__BY_SORT);
+var e=null;
+for(var a=0;
+a<o.length;
+a++){
+var n=o[a];
+if(n.name==this._name){
+continue
+}
+if(appCtxt.getApp(n.name).isUpsell){
+continue
+}
+e=n.name;
+break
+}
+this._overviewApp=appCtxt.getApp(e)
+}
+return this._overviewApp
+};
+ZmPortalApp.__BY_SORT=function(t,e){
+return t.sort-e.sort
+}
+}
+if(AjxPackage.define("zimbraMail.mail.ZmMailApp")){
+ZmMailApp=function(t,e){
+ZmApp.call(this,ZmApp.MAIL,t,e);
+this._sessionController={};
+this._sessionId={};
+this._curSessionId={};
+this._dataSourceCollection={};
+this._identityCollection={};
+this._signatureCollection={};
+this._groupBy={};
+this.numEntries=0;
+this._addSettingsChangeListeners()
+};
+ZmEvent.S_CONV=ZmId.ITEM_CONV;
+ZmEvent.S_MSG=ZmId.ITEM_MSG;
+ZmEvent.S_ATT=ZmId.ITEM_ATT;
+ZmEvent.S_FOLDER=ZmId.ORG_FOLDER;
+ZmEvent.S_DATA_SOURCE=ZmId.ITEM_DATA_SOURCE;
+ZmEvent.S_IDENTITY="IDENTITY";
+ZmEvent.S_SIGNATURE="SIGNATURE";
+ZmItem.CONV=ZmEvent.S_CONV;
+ZmItem.MSG=ZmEvent.S_MSG;
+ZmItem.ATT=ZmEvent.S_ATT;
+ZmItem.DATA_SOURCE=ZmEvent.S_DATA_SOURCE;
+ZmOrganizer.FOLDER=ZmEvent.S_FOLDER;
+ZmApp.MAIL=ZmId.APP_MAIL;
+ZmApp.CLASS[ZmApp.MAIL]="ZmMailApp";
+ZmApp.SETTING[ZmApp.MAIL]=ZmSetting.MAIL_ENABLED;
+ZmApp.UPSELL_SETTING[ZmApp.MAIL]=ZmSetting.MAIL_UPSELL_ENABLED;
+ZmApp.LOAD_SORT[ZmApp.MAIL]=20;
+ZmApp.QS_ARG[ZmApp.MAIL]="mail";
+ZmMailApp.DEFAULT_AUTO_SAVE_DRAFT_INTERVAL=30;
+ZmMailApp.DEFAULT_MAX_MESSAGE_SIZE=100000;
+ZmMailApp.POP_DOWNLOAD_SINCE_ALL=0;
+ZmMailApp.POP_DOWNLOAD_SINCE_NO_CHANGE=1;
+ZmMailApp.POP_DOWNLOAD_SINCE_FROM_NOW=2;
+ZmMailApp.SEND_RECEIPT_NEVER="never";
+ZmMailApp.SEND_RECEIPT_ALWAYS="always";
+ZmMailApp.SEND_RECEIPT_PROMPT="prompt";
+ZmMailApp.prototype=new ZmApp;
+ZmMailApp.prototype.constructor=ZmMailApp;
+ZmMailApp._setGroupByMaps=function(){
+ZmMailApp.GROUP_MAIL_BY_ITEM={};
+ZmMailApp.GROUP_MAIL_BY_ITEM[ZmSetting.GROUP_BY_CONV]=ZmItem.CONV;
+ZmMailApp.GROUP_MAIL_BY_ITEM[ZmSetting.GROUP_BY_MESSAGE]=ZmItem.MSG
+};
+ZmMailApp.prototype.toString=function(){
+return"ZmMailApp"
+};
+ZmMailApp.prototype._defineAPI=function(){
+AjxDispatcher.setPackageLoadFunction("MailCore",new AjxCallback(this,this._postLoadCore));
+AjxDispatcher.setPackageLoadFunction("Mail",new AjxCallback(this,this._postLoad));
+AjxDispatcher.registerMethod("Compose",["MailCore","Mail"],new AjxCallback(this,this.compose));
+AjxDispatcher.registerMethod("GetComposeController",["MailCore","Mail"],new AjxCallback(this,this.getComposeController));
+AjxDispatcher.registerMethod("GetConvController",["MailCore","Mail"],new AjxCallback(this,this.getConvController));
+AjxDispatcher.registerMethod("GetConvListController","MailCore",new AjxCallback(this,this.getConvListController));
+AjxDispatcher.registerMethod("GetMsgController",["MailCore","Mail"],new AjxCallback(this,this.getMsgController));
+AjxDispatcher.registerMethod("GetTradController","MailCore",new AjxCallback(this,this.getTradController));
+AjxDispatcher.registerMethod("GetMailListController","MailCore",new AjxCallback(this,this.getMailListController));
+AjxDispatcher.registerMethod("GetIdentityCollection","MailCore",new AjxCallback(this,this.getIdentityCollection));
+AjxDispatcher.registerMethod("GetSignatureCollection","MailCore",new AjxCallback(this,this.getSignatureCollection));
+AjxDispatcher.registerMethod("GetDataSourceCollection","MailCore",new AjxCallback(this,this.getDataSourceCollection));
+AjxDispatcher.registerMethod("GetAttachmentsController",["MailCore","Mail"],new AjxCallback(this,this.getAttachmentsController));
+AjxDispatcher.registerMethod("GetMailConfirmController",["MailCore","Mail"],new AjxCallback(this,this.getConfirmController))
+};
+ZmMailApp.prototype._registerSettings=function(e){
+var e=e||appCtxt.getSettings();
+e.registerSetting("ALLOW_ANY_FROM_ADDRESS",{
+name:"zimbraAllowAnyFromAddress",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("ALLOW_FROM_ADDRESSES",{
+name:"zimbraAllowFromAddress",type:ZmSetting.T_COS,dataType:ZmSetting.D_LIST}
+);
+e.registerSetting("AUTO_SAVE_DRAFT_INTERVAL",{
+name:"zimbraPrefAutoSaveDraftInterval",type:ZmSetting.T_PREF,dataType:ZmSetting.D_LDAP_TIME,defaultValue:ZmMailApp.DEFAULT_AUTO_SAVE_DRAFT_INTERVAL}
+);
+e.registerSetting("COMPOSE_SAME_FORMAT",{
+name:"zimbraPrefForwardReplyInOriginalFormat",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("CONVERSATIONS_ENABLED",{
+name:"zimbraFeatureConversationsEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("CONVERSATION_ORDER",{
+name:"zimbraPrefConversationOrder",type:ZmSetting.T_PREF,defaultValue:ZmSearch.DATE_DESC,isImplicit:true}
+);
+e.registerSetting("DEDUPE_MSG_TO_SELF",{
+name:"zimbraPrefDedupeMessagesSentToSelf",type:ZmSetting.T_PREF,defaultValue:ZmSetting.DEDUPE_NONE}
+);
+e.registerSetting("DEFAULT_DISPLAY_NAME",{
+type:ZmSetting.T_PSEUDO,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("DETACH_COMPOSE_ENABLED",{
+name:"zimbraFeatureComposeInNewWindowEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("DETACH_MAILVIEW_ENABLED",{
+name:"zimbraFeatureOpenMailInNewWindowEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("DISPLAY_EXTERNAL_IMAGES",{
+name:"zimbraPrefDisplayExternalImages",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("END_DATE_ENABLED",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("FILTERS_ENABLED",{
+name:"zimbraFeatureFiltersEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("FILTERS_MAIL_FORWARDING_ENABLED",{
+name:"zimbraFeatureMailForwardingInFiltersEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("FORWARD_INCLUDE_ORIG",{
+name:"zimbraPrefForwardIncludeOriginalText",type:ZmSetting.T_PREF,defaultValue:ZmSetting.INCLUDE}
+);
+e.registerSetting("FORWARD_MENU_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("GET_MAIL_ACTION",{
+name:"zimbraPrefGetMailAction",type:ZmSetting.T_PREF,defaultValue:ZmSetting.GETMAIL_ACTION_DEFAULT,isGlobal:true}
+);
+e.registerSetting("GROUP_MAIL_BY",{
+name:"zimbraPrefGroupMailBy",type:ZmSetting.T_PREF,defaultValue:ZmSetting.GROUP_BY_MESSAGE,isImplicit:true}
+);
+e.registerSetting("HTML_SIGNATURE_ENABLED",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("IDENTITIES_ENABLED",{
+name:"zimbraFeatureIdentitiesEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("INITIAL_SEARCH",{
+name:"zimbraPrefMailInitialSearch",type:ZmSetting.T_PREF,defaultValue:"in:inbox"}
+);
+e.registerSetting("INITIAL_SEARCH_ENABLED",{
+name:"zimbraFeatureInitialSearchPreferenceEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("MAIL_ALIASES",{
+name:"zimbraMailAlias",type:ZmSetting.T_COS,dataType:ZmSetting.D_LIST}
+);
+e.registerSetting("MAIL_ATTACH_VIEW_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("MAIL_BLACKLIST",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_LIST}
+);
+e.registerSetting("MAIL_BLACKLIST_MAX_NUM_ENTRIES",{
+name:"zimbraMailBlacklistMaxNumEntries",type:ZmSetting.T_COS,dataType:ZmSetting.D_INT,defaultValue:100}
+);
+e.registerSetting("MAIL_FOLDER_COLORS_ENABLED",{
+name:"zimbraPrefFolderColorEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("MAIL_FORWARDING_ADDRESS",{
+name:"zimbraPrefMailForwardingAddress",type:ZmSetting.T_PREF}
+);
+e.registerSetting("MAIL_FORWARDING_ENABLED",{
+name:"zimbraFeatureMailForwardingEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("MAIL_MANDATORY_SPELLCHECK",{
+name:"zimbraPrefMandatorySpellCheckEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("MAIL_FROM_ADDRESS",{
+name:"zimbraPrefFromAddress",type:ZmSetting.T_PREF,dataType:ZmSetting.D_LIST}
+);
+e.registerSetting("MAIL_LIFETIME_GLOBAL",{
+name:"zimbraMailMessageLifetime",type:ZmSetting.T_COS,defaultValue:"0"}
+);
+e.registerSetting("MAIL_LIFETIME_INBOX_READ",{
+name:"zimbraPrefInboxReadLifetime",type:ZmSetting.T_PREF,defaultValue:"0"}
+);
+e.registerSetting("MAIL_LIFETIME_INBOX_UNREAD",{
+name:"zimbraPrefInboxUnreadLifetime",type:ZmSetting.T_PREF,defaultValue:"0"}
+);
+e.registerSetting("MAIL_LIFETIME_JUNK",{
+name:"zimbraPrefJunkLifetime",type:ZmSetting.T_PREF,defaultValue:"0"}
+);
+e.registerSetting("MAIL_LIFETIME_JUNK_GLOBAL",{
+name:"zimbraMailSpamLifetime",type:ZmSetting.T_COS,defaultValue:"0"}
+);
+e.registerSetting("MAIL_LIFETIME_SENT",{
+name:"zimbraPrefSentLifetime",type:ZmSetting.T_PREF,defaultValue:"0"}
+);
+e.registerSetting("MAIL_LIFETIME_TRASH",{
+name:"zimbraPrefTrashLifetime",type:ZmSetting.T_PREF,defaultValue:"0"}
+);
+e.registerSetting("MAIL_LIFETIME_TRASH_GLOBAL",{
+name:"zimbraMailTrashLifetime",type:ZmSetting.T_COS,defaultValue:"0"}
+);
+e.registerSetting("MAIL_LOCAL_DELIVERY_DISABLED",{
+name:"zimbraPrefMailLocalDeliveryDisabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("MAIL_NOTIFY_SOUNDS",{
+name:"zimbraPrefMailSoundsEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false,isGlobal:true}
+);
+e.registerSetting("MAIL_NOTIFY_APP",{
+name:"zimbraPrefMailFlashIcon",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false,isGlobal:true}
+);
+e.registerSetting("MAIL_NOTIFY_BROWSER",{
+name:"zimbraPrefMailFlashTitle",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false,isGlobal:true}
+);
+e.registerSetting("MAIL_NOTIFY_TOASTER",{
+name:"zimbraPrefMailToasterEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false,isGlobal:true}
+);
+e.registerSetting("MAIL_PRIORITY_ENABLED",{
+name:"zimbraFeatureMailPriorityEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("MAIL_READ_RECEIPT_ENABLED",{
+name:"zimbraFeatureReadReceiptsEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("MAIL_SEND_READ_RECEIPTS",{
+name:"zimbraPrefMailSendReadReceipts",type:ZmSetting.T_PREF,dataType:ZmSetting.D_STRING,defaultValue:"never"}
+);
+e.registerSetting("MAIL_WHITELIST",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_LIST}
+);
+e.registerSetting("MAIL_WHITELIST_MAX_NUM_ENTRIES",{
+name:"zimbraMailWhitelistMaxNumEntries",type:ZmSetting.T_COS,dataType:ZmSetting.D_INT,defaultValue:100}
+);
+e.registerSetting("MARK_MSG_READ",{
+name:"zimbraPrefMarkMsgRead",type:ZmSetting.T_PREF,dataType:ZmSetting.D_INT,defaultValue:0}
+);
+e.registerSetting("MAX_MESSAGE_SIZE",{
+type:ZmSetting.T_PREF,defaultValue:ZmMailApp.DEFAULT_MAX_MESSAGE_SIZE}
+);
+e.registerSetting("NEW_WINDOW_COMPOSE",{
+name:"zimbraPrefComposeInNewWindow",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("NOTIF_ADDRESS",{
+name:"zimbraPrefNewMailNotificationAddress",type:ZmSetting.T_PREF}
+);
+e.registerSetting("NOTIF_ENABLED",{
+name:"zimbraPrefNewMailNotificationEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("NOTIF_FEATURE_ENABLED",{
+name:"zimbraFeatureNewMailNotificationEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("OPEN_MAIL_IN_NEW_WIN",{
+name:"zimbraPrefOpenMailInNewWindow",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false,isGlobal:true}
+);
+e.registerSetting("POP_ENABLED",{
+name:"zimbraPop3Enabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:!appCtxt.isOffline}
+);
+e.registerSetting("POP_DOWNLOAD_SINCE_VALUE",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_STRING,defaultValue:""}
+);
+e.registerSetting("POP_DOWNLOAD_SINCE",{
+name:"zimbraPrefPop3DownloadSince",type:ZmSetting.T_PREF,dataType:ZmSetting.D_STRING,defaultValue:""}
+);
+e.registerSetting("READING_PANE_LOCATION",{
+name:"zimbraPrefReadingPaneLocation",type:ZmSetting.T_PREF,dataType:ZmSetting.D_STRING,defaultValue:ZmSetting.RP_BOTTOM,isImplicit:true,isGlobal:true}
+);
+e.registerSetting("READING_PANE_LOCATION_CV",{
+name:"zimbraPrefConvReadingPaneLocation",type:ZmSetting.T_PREF,dataType:ZmSetting.D_STRING,defaultValue:ZmSetting.RP_BOTTOM,isImplicit:true}
+);
+e.registerSetting("REPLY_INCLUDE_ORIG",{
+name:"zimbraPrefReplyIncludeOriginalText",type:ZmSetting.T_PREF,defaultValue:ZmSetting.INCLUDE}
+);
+e.registerSetting("REPLY_MENU_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("REPLY_PREFIX",{
+name:"zimbraPrefForwardReplyPrefixChar",type:ZmSetting.T_PREF,defaultValue:">"}
+);
+e.registerSetting("REPLY_TO_ADDRESS",{
+name:"zimbraPrefReplyToAddress",type:ZmSetting.T_PREF,dataType:ZmSetting.D_LIST}
+);
+e.registerSetting("REPLY_TO_ENABLED",{
+name:"zimbraPrefReplyToEnabled",type:ZmSetting.T_PREF}
+);
+e.registerSetting("SAVE_DRAFT_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("SAVE_TO_SENT",{
+name:"zimbraPrefSaveToSent",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("SELECT_AFTER_DELETE",{
+name:"zimbraPrefMailSelectAfterDelete",type:ZmSetting.T_PREF,defaultValue:ZmSetting.DELETE_SELECT_NEXT}
+);
+e.registerSetting("SEND_ON_BEHALF_OF",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("SENT_FOLDER_NAME",{
+name:"zimbraPrefSentMailFolder",type:ZmSetting.T_PREF,defaultValue:"sent"}
+);
+e.registerSetting("SHOW_BCC",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("SHOW_FRAGMENTS",{
+name:"zimbraPrefShowFragments",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false,isGlobal:true}
+);
+e.registerSetting("SHOW_MAIL_CONFIRM",{
+name:"zimbraFeatureConfirmationPageEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("SIGNATURE",{
+name:"zimbraPrefMailSignature",type:ZmSetting.T_PREF}
+);
+e.registerSetting("SIGNATURE_ENABLED",{
+name:"zimbraPrefMailSignatureEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("SIGNATURE_STYLE",{
+name:"zimbraPrefMailSignatureStyle",type:ZmSetting.T_PREF,defaultValue:ZmSetting.SIG_OUTLOOK}
+);
+e.registerSetting("SPAM_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("START_DATE_ENABLED",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("USER_FOLDERS_ENABLED",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("VACATION_FROM",{
+name:"zimbraPrefOutOfOfficeFromDate",type:ZmSetting.T_PREF,defaultValue:""}
+);
+e.registerSetting("VACATION_MSG",{
+name:"zimbraPrefOutOfOfficeReply",type:ZmSetting.T_PREF,defaultValue:""}
+);
+e.registerSetting("VACATION_MSG_ENABLED",{
+name:"zimbraPrefOutOfOfficeReplyEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("VACATION_MSG_FEATURE_ENABLED",{
+name:"zimbraFeatureOutOfOfficeReplyEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("VACATION_UNTIL",{
+name:"zimbraPrefOutOfOfficeUntilDate",type:ZmSetting.T_PREF,defaultValue:""}
+);
+e.registerSetting("COLLAPSE_IMAP_TREES",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("SAVE_TO_IMAP_SENT",{
+type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+ZmMailApp._setGroupByMaps()
+};
+ZmMailApp.prototype._registerPrefs=function(){
+var t={
+MAIL:{
+title:ZmMsg.mail,icon:"MailApp",templateId:"prefs.Pages#Mail",priority:10,precondition:appCtxt.get(ZmSetting.MAIL_ENABLED),prefs:[ZmSetting.DEDUPE_MSG_TO_SELF,ZmSetting.DISPLAY_EXTERNAL_IMAGES,ZmSetting.GET_MAIL_ACTION,ZmSetting.INITIAL_SEARCH,ZmSetting.MAIL_BLACKLIST,ZmSetting.MAIL_FORWARDING_ADDRESS,ZmSetting.MAIL_LIFETIME_INBOX_READ,ZmSetting.MAIL_LIFETIME_INBOX_UNREAD,ZmSetting.MAIL_LIFETIME_JUNK,ZmSetting.MAIL_LIFETIME_SENT,ZmSetting.MAIL_LIFETIME_TRASH,ZmSetting.MAIL_LOCAL_DELIVERY_DISABLED,ZmSetting.MAIL_NOTIFY_SOUNDS,ZmSetting.MAIL_NOTIFY_APP,ZmSetting.MAIL_NOTIFY_BROWSER,ZmSetting.MAIL_NOTIFY_TOASTER,ZmSetting.MAIL_WHITELIST,ZmSetting.MAIL_SEND_READ_RECEIPTS,ZmSetting.MARK_MSG_READ,ZmSetting.NOTIF_ADDRESS,ZmSetting.NOTIF_ENABLED,ZmSetting.OPEN_MAIL_IN_NEW_WIN,ZmSetting.PAGE_SIZE,ZmSetting.POP_DOWNLOAD_SINCE_VALUE,ZmSetting.POP_DOWNLOAD_SINCE,ZmSetting.POLLING_INTERVAL,ZmSetting.SHOW_FRAGMENTS,ZmSetting.VACATION_MSG_ENABLED,ZmSetting.VACATION_MSG,ZmSetting.SELECT_AFTER_DELETE,ZmSetting.START_DATE_ENABLED,ZmSetting.END_DATE_ENABLED,ZmSetting.VACATION_FROM,ZmSetting.VACATION_UNTIL,ZmSetting.VIEW_AS_HTML],manageDirty:true,createView:function(o,n,a){
+AjxDispatcher.require("Alert");
+return new ZmMailPrefsPage(o,n,a)
+}}
+,ACCOUNTS:{
+parentId:"MAIL",icon:"POPAccount",title:(appCtxt.isOffline?ZmMsg.personas:ZmMsg.accounts),templateId:"prefs.Pages#Accounts",priority:60,precondition:appCtxt.get(ZmSetting.MAIL_ENABLED),prefs:[ZmSetting.ACCOUNTS],manageDirty:true,createView:function(o,n,a){
+return new ZmAccountsPage(o,n,a)
+}}
+,SIGNATURES:{
+parentId:"MAIL",icon:"AddSignature",title:ZmMsg.signatures,templateId:"prefs.Pages#Signatures",priority:30,precondition:(appCtxt.get(ZmSetting.MAIL_ENABLED)&&appCtxt.get(ZmSetting.SIGNATURES_ENABLED)),prefs:[ZmSetting.SIGNATURES,ZmSetting.SIGNATURE_STYLE,ZmSetting.SIGNATURE_ENABLED],manageDirty:true,createView:function(o,n,a){
+return new ZmSignaturesPage(o,n,a)
+}}
+,FILTERS:{
+parentId:"MAIL",icon:"MailRule",title:ZmMsg.filterRules,templateId:"prefs.Pages#MailFilters",priority:70,precondition:(appCtxt.get(ZmSetting.MAIL_ENABLED)&&appCtxt.get(ZmSetting.FILTERS_ENABLED)),prefs:[ZmSetting.FILTERS],manageChanges:true,createView:function(o,n,a){
+return a.getFilterRulesController().getFilterRulesView()
+}}};
+for(var e in t){
+ZmPref.registerPrefSection(e,t[e])
+}
+ZmPref.registerPref("ACCOUNTS",{
+displayContainer:ZmPref.TYPE_CUSTOM}
+);
+ZmPref.registerPref("AUTO_SAVE_DRAFT_INTERVAL",{
+displayName:ZmMsg.autoSaveDrafts,displayContainer:ZmPref.TYPE_CHECKBOX,options:[0,ZmMailApp.DEFAULT_AUTO_SAVE_DRAFT_INTERVAL]}
+);
+ZmPref.registerPref("DEDUPE_MSG_TO_SELF",{
+displayName:ZmMsg.removeDupesToSelf,displayContainer:ZmPref.TYPE_RADIO_GROUP,displayOptions:[ZmMsg.dedupeNone,ZmMsg.dedupeSecondCopy,ZmMsg.dedupeAll],options:[ZmSetting.DEDUPE_NONE,ZmSetting.DEDUPE_SECOND,ZmSetting.DEDUPE_ALL]}
+);
+ZmPref.registerPref("DISPLAY_EXTERNAL_IMAGES",{
+displayName:ZmMsg.showExternalImages,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("END_DATE_ENABLED",{
+displayName:ZmMsg.endOn,displayContainer:ZmPref.TYPE_CHECKBOX,precondition:ZmSetting.VACATION_MSG_FEATURE_ENABLED}
+);
+ZmPref.registerPref("GET_MAIL_ACTION",{
+displayContainer:ZmPref.TYPE_RADIO_GROUP,orientation:ZmPref.ORIENT_VERTICAL,displayOptions:[ZmMsg.checkMailPrefDefault,ZmMsg.checkMailPrefUpdate],options:[ZmSetting.GETMAIL_ACTION_DEFAULT,ZmSetting.GETMAIL_ACTION_UPDATE]}
+);
+ZmPref.registerPref("INITIAL_SEARCH",{
+displayName:ZmMsg.initialMailSearch,displayContainer:ZmPref.TYPE_INPUT,maxLength:ZmPref.MAX_LENGTH[ZmSetting.INITIAL_SEARCH],errorMessage:AjxMessageFormat.format(ZmMsg.invalidInitialSearch,ZmPref.MAX_LENGTH[ZmSetting.INITIAL_SEARCH]),precondition:ZmSetting.INITIAL_SEARCH_ENABLED}
+);
+ZmPref.registerPref("MAIL_BLACKLIST",{
+displayContainer:ZmPref.TYPE_CUSTOM}
+);
+ZmPref.registerPref("MAIL_FORWARDING_ADDRESS",{
+displayName:ZmMsg.mailForwardingAddress,displayContainer:ZmPref.TYPE_INPUT,validationFunction:ZmMailApp.validateForwardEmail,errorMessage:ZmMsg.invalidEmail,precondition:ZmSetting.MAIL_FORWARDING_ENABLED}
+);
+ZmPref.registerPref("MAIL_LIFETIME_INBOX_READ",{
+displayContainer:ZmPref.TYPE_RADIO_GROUP,orientation:ZmPref.ORIENT_HORIZONTAL,displayOptions:[ZmMsg.lifetimeDurationDays,ZmMsg.lifetimeDurationDays,ZmMsg.lifetimeDurationDays,ZmMsg.lifetimeDurationDays,ZmMsg.lifetimeDurationDays,ZmMsg.lifetimeDurationNever],options:[30,45,60,90,120,0],approximateFunction:ZmPref.approximateLifetimeInboxRead,displayFunction:ZmPref.durationDay2Int,valueFunction:ZmPref.int2DurationDay,validationFunction:ZmPref.validateLifetime}
+);
+ZmPref.registerPref("MAIL_LIFETIME_INBOX_UNREAD",{
+displayContainer:ZmPref.TYPE_RADIO_GROUP,orientation:ZmPref.ORIENT_HORIZONTAL,displayOptions:[ZmMsg.lifetimeDurationDays,ZmMsg.lifetimeDurationDays,ZmMsg.lifetimeDurationDays,ZmMsg.lifetimeDurationDays,ZmMsg.lifetimeDurationDays,ZmMsg.lifetimeDurationNever],options:[30,45,60,90,120,0],approximateFunction:ZmPref.approximateLifetimeInboxUnread,displayFunction:ZmPref.durationDay2Int,valueFunction:ZmPref.int2DurationDay,validationFunction:ZmPref.validateLifetime}
+);
+ZmPref.registerPref("MAIL_LIFETIME_JUNK",{
+displayContainer:ZmPref.TYPE_RADIO_GROUP,orientation:ZmPref.ORIENT_HORIZONTAL,displayOptions:ZmMsg.lifetimeDurationDays,options:[1,3,7,30],approximateFunction:ZmPref.approximateLifetimeJunk,displayFunction:ZmPref.durationDay2Int,valueFunction:ZmPref.int2DurationDay,validationFunction:ZmPref.validateLifetimeJunk}
+);
+ZmPref.registerPref("MAIL_LIFETIME_SENT",{
+displayContainer:ZmPref.TYPE_RADIO_GROUP,orientation:ZmPref.ORIENT_HORIZONTAL,displayOptions:[ZmMsg.lifetimeDurationDays,ZmMsg.lifetimeDurationDays,ZmMsg.lifetimeDurationDays,ZmMsg.lifetimeDurationDays,ZmMsg.lifetimeDurationDays,ZmMsg.lifetimeDurationNever],options:[30,45,60,90,120,0],approximateFunction:ZmPref.approximateLifetimeSent,displayFunction:ZmPref.durationDay2Int,valueFunction:ZmPref.int2DurationDay,validationFunction:ZmPref.validateLifetime}
+);
+ZmPref.registerPref("MAIL_LIFETIME_TRASH",{
+displayContainer:ZmPref.TYPE_RADIO_GROUP,orientation:ZmPref.ORIENT_HORIZONTAL,displayOptions:ZmMsg.lifetimeDurationDays,options:[1,3,7,30],approximateFunction:ZmPref.approximateLifetimeTrash,displayFunction:ZmPref.durationDay2Int,valueFunction:ZmPref.int2DurationDay,validationFunction:ZmPref.validateLifetimeTrash}
+);
+ZmPref.registerPref("MAIL_LOCAL_DELIVERY_DISABLED",{
+displayName:ZmMsg.mailDeliveryDisabled,displayContainer:ZmPref.TYPE_CHECKBOX,precondition:ZmSetting.MAIL_FORWARDING_ENABLED,validationFunction:ZmMailApp.validateMailLocalDeliveryDisabled,errorMessage:ZmMsg.errorMissingFwdAddr}
+);
+ZmPref.registerPref("MAIL_NOTIFY_SOUNDS",{
+displayName:ZmMsg.playSound,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("MAIL_NOTIFY_APP",{
+displayName:ZmMsg.flashMailAppTab,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("MAIL_NOTIFY_BROWSER",{
+displayName:ZmMsg.flashBrowser,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("MAIL_SEND_READ_RECEIPTS",{
+displayContainer:ZmPref.TYPE_RADIO_GROUP,displayOptions:[ZmMsg.readReceiptNever,ZmMsg.readReceiptAlways,ZmMsg.readReceiptAsk],options:[ZmMailApp.SEND_RECEIPT_NEVER,ZmMailApp.SEND_RECEIPT_ALWAYS,ZmMailApp.SEND_RECEIPT_PROMPT],precondition:ZmSetting.MAIL_READ_RECEIPT_ENABLED}
+);
+ZmPref.registerPref("MAIL_WHITELIST",{
+displayContainer:ZmPref.TYPE_CUSTOM}
+);
+ZmPref.registerPref("NOTIF_ADDRESS",{
+displayName:ZmMsg.mailNotifAddress,displayContainer:ZmPref.TYPE_INPUT,validationFunction:ZmPref.validateEmail,errorMessage:ZmMsg.invalidEmail,precondition:ZmSetting.NOTIF_FEATURE_ENABLED}
+);
+ZmPref.registerPref("NOTIF_ENABLED",{
+displayName:ZmMsg.mailNotifEnabled,displayContainer:ZmPref.TYPE_CHECKBOX,precondition:ZmSetting.NOTIF_FEATURE_ENABLED,validationFunction:ZmMailApp.validateSendNotification,errorMessage:ZmMsg.errorMissingNotifyAddr}
+);
+ZmPref.registerPref("OPEN_MAIL_IN_NEW_WIN",{
+displayName:ZmMsg.openMailNewWin,displayContainer:ZmPref.TYPE_CHECKBOX,precondition:ZmSetting.DETACH_MAILVIEW_ENABLED}
+);
+ZmPref.registerPref("POP_DOWNLOAD_SINCE_VALUE",{
+displayContainer:ZmPref.TYPE_STATIC,precondition:ZmSetting.POP_ENABLED}
+);
+ZmPref.registerPref("POP_DOWNLOAD_SINCE",{
+displayContainer:ZmPref.TYPE_RADIO_GROUP,displayOptions:[ZmMsg.externalAccessPopDownloadAll,"*** NOT SHOWN ***",ZmMsg.externalAccessPopDownloadFromNow],options:[ZmMailApp.POP_DOWNLOAD_SINCE_ALL,ZmMailApp.POP_DOWNLOAD_SINCE_NO_CHANGE,ZmMailApp.POP_DOWNLOAD_SINCE_FROM_NOW],displayFunction:ZmPref.downloadSinceDisplay,valueFunction:ZmPref.downloadSinceValue,precondition:ZmSetting.POP_ENABLED}
+);
+ZmPref.registerPref("REPLY_TO_ADDRESS",{
+displayName:ZmMsg.replyToAddress,displayContainer:ZmPref.TYPE_INPUT,validationFunction:ZmPref.validateEmail,errorMessage:ZmMsg.invalidEmail}
+);
+ZmPref.registerPref("SELECT_AFTER_DELETE",{
+displayName:ZmMsg.clientType,displayContainer:ZmPref.TYPE_RADIO_GROUP,orientation:ZmPref.ORIENT_VERTICAL,displayOptions:[ZmMsg.selectNext,ZmMsg.selectPrevious,ZmMsg.selectAdapt],options:[ZmSetting.DELETE_SELECT_NEXT,ZmSetting.DELETE_SELECT_PREV,ZmSetting.DELETE_SELECT_ADAPT]}
+);
+ZmPref.registerPref("SIGNATURE",{
+displayName:ZmMsg.signature,displayContainer:ZmPref.TYPE_TEXTAREA,maxLength:ZmPref.MAX_LENGTH[ZmSetting.SIGNATURE],errorMessage:AjxMessageFormat.format(ZmMsg.invalidSignature,ZmPref.MAX_LENGTH[ZmSetting.SIGNATURE])}
+);
+ZmPref.registerPref("SIGNATURE_ENABLED",{
+displayName:ZmMsg.signatureEnabled,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("SIGNATURE_STYLE",{
+displayName:ZmMsg.signatureStyle,displayContainer:ZmPref.TYPE_RADIO_GROUP,orientation:ZmPref.ORIENT_HORIZONTAL,displayOptions:[ZmMsg.aboveQuotedText,ZmMsg.atBottomOfMessage],options:[ZmSetting.SIG_OUTLOOK,ZmSetting.SIG_INTERNET]}
+);
+ZmPref.registerPref("SIGNATURES",{
+displayContainer:ZmPref.TYPE_CUSTOM}
+);
+ZmPref.registerPref("START_DATE_ENABLED",{
+displayContainer:ZmPref.TYPE_CHECKBOX,displayName:ZmMsg.startOn,precondition:ZmSetting.VACATION_MSG_FEATURE_ENABLED}
+);
+ZmPref.registerPref("VACATION_FROM",{
+displayName:ZmMsg.startDate,displayContainer:ZmPref.TYPE_INPUT,precondition:ZmSetting.VACATION_MSG_FEATURE_ENABLED,displayFunction:ZmPref.dateGMT2Local,valueFunction:ZmPref.dateLocal2GMT}
+);
+ZmPref.registerPref("VACATION_UNTIL",{
+displayName:ZmMsg.endDate,displayContainer:ZmPref.TYPE_INPUT,precondition:ZmSetting.VACATION_MSG_FEATURE_ENABLED,displayFunction:ZmPref.dateGMT2Local,valueFunction:ZmPref.dateLocal2GMT}
+);
+ZmPref.registerPref("VACATION_MSG",{
+displayName:ZmMsg.awayMessage,displayContainer:ZmPref.TYPE_TEXTAREA,maxLength:ZmPref.MAX_LENGTH[ZmSetting.AWAY_MESSAGE],errorMessage:AjxMessageFormat.format(ZmMsg.invalidAwayMessage,ZmPref.MAX_LENGTH[ZmSetting.AWAY_MESSAGE]),precondition:ZmSetting.VACATION_MSG_FEATURE_ENABLED,validationFunction:ZmMailApp.validateVacationMsg}
+);
+ZmPref.registerPref("VACATION_MSG_ENABLED",{
+displayName:ZmMsg.awayMessageEnabled,displayContainer:ZmPref.TYPE_CHECKBOX,precondition:ZmSetting.VACATION_MSG_FEATURE_ENABLED,validationFunction:ZmMailApp.validateVacationMsgEnabled,errorMessage:ZmMsg.missingAwayMessage}
+);
+ZmPref.registerPref("MAIL_NOTIFY_TOASTER",{
+displayFunc:function(){
+AjxDispatcher.require("Alert");
+return ZmDesktopAlert.getInstance().getDisplayText()
+}
+,displayContainer:ZmPref.TYPE_CHECKBOX}
+)
+};
+ZmMailApp.validateForwardEmail=function(t){
+if(!t||t==""){
+var o=ZmPref.getPrefSectionWithPref(ZmSetting.MAIL_FORWARDING_ADDRESS);
+if(!o){
+return false
+}
+var e=appCtxt.getApp(ZmApp.PREFERENCES).getPrefController().getPrefsView();
+var a=e.getView(o.id).getFormObject(ZmSetting.MAIL_LOCAL_DELIVERY_DISABLED);
+if(a&&a.isSelected()){
+a.setSelected(false)
+}}
+return ZmPref.validateEmail(t)
+};
+ZmMailApp.validateMailLocalDeliveryDisabled=function(a){
+if(!a){
+return true
+}
+var o=ZmPref.getPrefSectionWithPref(ZmSetting.MAIL_FORWARDING_ADDRESS);
+if(!o){
+return false
+}
+var e=appCtxt.getApp(ZmApp.PREFERENCES).getPrefController().getPrefsView();
+var t=e.getView(o.id).getFormObject(ZmSetting.MAIL_FORWARDING_ADDRESS);
+return(t!=null&&t.isValid())
+};
+ZmMailApp.validateSendNotification=function(a){
+if(!a){
+return true
+}
+var o=ZmPref.getPrefSectionWithPref(ZmSetting.NOTIF_ADDRESS);
+if(!o){
+return false
+}
+var e=appCtxt.getApp(ZmApp.PREFERENCES).getPrefController().getPrefsView();
+var t=e.getView(o.id).getFormObject(ZmSetting.NOTIF_ADDRESS);
+return(t!=null&&t.isValid())
+};
+ZmMailApp.validateVacationMsg=function(a){
+if(a&&(a.length>0)){
+return true
+}
+var o=ZmPref.getPrefSectionWithPref(ZmSetting.VACATION_MSG_ENABLED);
+if(!o){
+return false
+}
+var e=appCtxt.getApp(ZmApp.PREFERENCES).getPrefController().getPrefsView();
+var t=e.getView(o.id).getFormObject(ZmSetting.VACATION_MSG_ENABLED);
+return(t&&!t.isSelected())
+};
+ZmMailApp.validateVacationMsgEnabled=function(a){
+if(!a){
+return true
+}
+var n=ZmPref.getPrefSectionWithPref(ZmSetting.VACATION_MSG);
+if(!n){
+return false
+}
+var e=appCtxt.getApp(ZmApp.PREFERENCES).getPrefController().getPrefsView();
+var t=e.getView(n.id).getFormObject(ZmSetting.VACATION_MSG);
+if(!t){
+return false
+}
+var o=t.getValue();
+return(o&&(o.length>0))
+};
+ZmMailApp.prototype._registerOperations=function(){
+ZmOperation.registerOp(ZmId.OP_ADD_FILTER_RULE,{
+textKey:"newFilter",image:"Plus"}
+,ZmSetting.FILTERS_ENABLED);
+ZmOperation.registerOp(ZmId.OP_ADD_SIGNATURE,{
+textKey:"signature",image:"AddSignature",tooltipKey:"chooseSignature"}
+,ZmSetting.SIGNATURES_ENABLED);
+ZmOperation.registerOp(ZmId.OP_CHECK_MAIL,{
+textKey:"checkMail",tooltipKey:"checkMailPrefDefault",image:"Refresh",textPrecedence:90}
+);
+ZmOperation.registerOp(ZmId.OP_CHECK_MAIL_DEFAULT,{
+textKey:"checkMailDefault"}
+);
+ZmOperation.registerOp(ZmId.OP_CHECK_MAIL_UPDATE,{
+textKey:"checkMailUpdate"}
+);
+ZmOperation.registerOp(ZmId.OP_COMPOSE_OPTIONS,{
+textKey:"options",image:"Preferences"}
+);
+ZmOperation.registerOp(ZmId.OP_CREATE_APPT,{
+textKey:"createAppt",image:"NewAppointment"}
+,ZmSetting.CALENDAR_ENABLED);
+ZmOperation.registerOp(ZmId.OP_CREATE_TASK,{
+textKey:"createTask",image:"NewTask"}
+,ZmSetting.TASKS_ENABLED);
+ZmOperation.registerOp(ZmId.OP_DELETE_CONV,{
+textKey:"delConv",image:"DeleteConversation"}
+,ZmSetting.CONVERSATIONS_ENABLED);
+ZmOperation.registerOp(ZmId.OP_DELETE_MSG,{
+textKey:"delMsg",image:"DeleteMessage"}
+);
+ZmOperation.registerOp(ZmId.OP_DELETE_MENU,{
+tooltipKey:"deleteTooltip",image:"Delete"}
+);
+ZmOperation.registerOp(ZmId.OP_DETACH_COMPOSE,{
+tooltipKey:"detachTooltip",image:"OpenInNewWindow"}
+);
+ZmOperation.registerOp(ZmId.OP_DRAFT,null,ZmSetting.SAVE_DRAFT_ENABLED);
+ZmOperation.registerOp(ZmId.OP_EDIT_FILTER_RULE,{
+textKey:"filterEdit",image:"Edit"}
+,ZmSetting.FILTERS_ENABLED);
+ZmOperation.registerOp(ZmId.OP_FORWARD,{
+textKey:"forward",tooltipKey:"forwardTooltip",image:"Forward",shortcut:ZmKeyMap.FORWARD,textPrecedence:46}
+);
+ZmOperation.registerOp(ZmId.OP_FORWARD_ATT,{
+textKey:"forwardAtt",tooltipKey:"forwardAtt",image:"Forward"}
+);
+ZmOperation.registerOp(ZmId.OP_FORWARD_INLINE,{
+textKey:"forwardInline",tooltipKey:"forwardTooltip",image:"Forward"}
+);
+ZmOperation.registerOp(ZmId.OP_IM,{
+textKey:"newIM",image:"ImStartChat",tooltipKey:"imNewChat"}
+,ZmSetting.IM_ENABLED);
+ZmOperation.registerOp(ZmId.OP_INC_ATTACHMENT,{
+textKey:"includeMenuAttachment"}
+);
+ZmOperation.registerOp(ZmId.OP_INC_NONE,{
+textKey:"includeMenuNone"}
+);
+ZmOperation.registerOp(ZmId.OP_INC_NO_PREFIX,{
+textKey:"includeMenuNoPrefix"}
+);
+ZmOperation.registerOp(ZmId.OP_INC_PREFIX,{
+textKey:"includeMenuPrefix"}
+);
+ZmOperation.registerOp(ZmId.OP_INC_PREFIX_FULL,{
+textKey:"includeMenuPrefixFull"}
+);
+ZmOperation.registerOp(ZmId.OP_INC_SMART,{
+textKey:"includeMenuSmart"}
+);
+ZmOperation.registerOp(ZmId.OP_MARK_READ,{
+textKey:"markAsRead",image:"ReadMessage",shortcut:ZmKeyMap.MARK_READ}
+);
+ZmOperation.registerOp(ZmId.OP_MARK_UNREAD,{
+textKey:"markAsUnread",image:"UnreadMessage",shortcut:ZmKeyMap.MARK_UNREAD}
+);
+ZmOperation.registerOp(ZmId.OP_MOVE_DOWN_FILTER_RULE,{
+textKey:"filterMoveDown",image:"DownArrow"}
+,ZmSetting.FILTERS_ENABLED);
+ZmOperation.registerOp(ZmId.OP_MOVE_UP_FILTER_RULE,{
+textKey:"filterMoveUp",image:"UpArrow"}
+,ZmSetting.FILTERS_ENABLED);
+ZmOperation.registerOp(ZmId.OP_NEW_MESSAGE,{
+textKey:"newEmail",tooltipKey:"newMessageTooltip",image:"NewMessage",shortcut:ZmKeyMap.NEW_MESSAGE}
+);
+ZmOperation.registerOp(ZmId.OP_NEW_MESSAGE_WIN,{
+textKey:"newEmail",tooltipKey:"newMessageTooltip",image:"NewMessage",shortcut:ZmKeyMap.NEW_MESSAGE_WIN}
+);
+ZmOperation.registerOp(ZmId.OP_REMOVE_FILTER_RULE,{
+textKey:"filterRemove",image:"Delete"}
+,ZmSetting.FILTERS_ENABLED);
+ZmOperation.registerOp(ZmId.OP_REPLY,{
+textKey:"reply",tooltipKey:"replyTooltip",image:"Reply",shortcut:ZmKeyMap.REPLY,textPrecedence:50}
+);
+ZmOperation.registerOp(ZmId.OP_REPLY_ACCEPT,{
+textKey:"replyAccept",image:"Check"}
+);
+ZmOperation.registerOp(ZmId.OP_REPLY_ALL,{
+textKey:"replyAll",tooltipKey:"replyAllTooltip",image:"ReplyAll",shortcut:ZmKeyMap.REPLY_ALL,textPrecedence:48}
+);
+ZmOperation.registerOp(ZmId.OP_REPLY_CANCEL);
+ZmOperation.registerOp(ZmId.OP_REPLY_DECLINE,{
+textKey:"replyDecline",image:"Cancel"}
+);
+ZmOperation.registerOp(ZmId.OP_REPLY_MODIFY);
+ZmOperation.registerOp(ZmId.OP_REPLY_NEW_TIME,{
+textKey:"replyNewTime",image:"NewTime"}
+);
+ZmOperation.registerOp(ZmId.OP_REPLY_TENTATIVE,{
+textKey:"replyTentative",image:"QuestionMark"}
+);
+ZmOperation.registerOp(ZmId.OP_REQUEST_READ_RECEIPT,{
+textKey:"requestReadReceipt",image:"ReadMessage"}
+);
+ZmOperation.registerOp(ZmId.OP_RUN_FILTER_RULE,{
+textKey:"filterRun",image:"SwitchFormat"}
+,ZmSetting.FILTERS_ENABLED);
+ZmOperation.registerOp(ZmId.OP_SAVE_DRAFT,{
+textKey:"saveDraft",tooltipKey:"saveDraftTooltip",image:"DraftFolder",shortcut:ZmKeyMap.SAVE}
+,ZmSetting.SAVE_DRAFT_ENABLED);
+ZmOperation.registerOp(ZmId.OP_SHOW_BCC,{
+textKey:"showBcc"}
+);
+ZmOperation.registerOp(ZmId.OP_SHOW_ONLY_MAIL,{
+textKey:"showOnlyMail",image:"Conversation"}
+,ZmSetting.MIXED_VIEW_ENABLED);
+ZmOperation.registerOp(ZmId.OP_SHOW_ORIG,{
+textKey:"showOrig",image:"Message"}
+);
+ZmOperation.registerOp(ZmId.OP_SPAM,{
+textKey:"junk",tooltipKey:"junkTooltip",image:"JunkMail",shortcut:ZmKeyMap.SPAM,textPrecedence:70}
+,ZmSetting.SPAM_ENABLED);
+ZmOperation.registerOp(ZmId.OP_RESET,{
+textKey:"reset",image:"Refresh",tooltipKey:"refreshFilters"}
+)
+};
+ZmMailApp.prototype._registerItems=function(){
+ZmItem.registerItem(ZmItem.CONV,{
+app:ZmApp.MAIL,nameKey:"conversation",pluralNameKey:"conversations",icon:"Conversation",soapCmd:"ConvAction",itemClass:"ZmConv",node:"c",organizer:ZmOrganizer.FOLDER,dropTargets:[ZmOrganizer.FOLDER,ZmOrganizer.TAG,ZmOrganizer.ZIMLET],searchType:"conversation",resultsList:AjxCallback.simpleClosure(function(e){
+AjxDispatcher.require("MailCore");
+return new ZmMailList(ZmItem.CONV,e)
+}
+,this)}
+);
+ZmItem.registerItem(ZmItem.MSG,{
+app:ZmApp.MAIL,nameKey:"message",pluralNameKey:"messages",icon:"Message",soapCmd:"MsgAction",itemClass:"ZmMailMsg",node:"m",organizer:ZmOrganizer.FOLDER,dropTargets:[ZmOrganizer.FOLDER,ZmOrganizer.TAG,ZmOrganizer.ZIMLET],searchType:"message",resultsList:AjxCallback.simpleClosure(function(e){
+AjxDispatcher.require("MailCore");
+return new ZmMailList(ZmItem.MSG,e)
+}
+,this)}
+);
+ZmItem.registerItem(ZmItem.ATT,{
+app:ZmApp.MAIL,nameKey:"attachment",icon:"Attachment",itemClass:"ZmMimePart",node:"mp",resultsList:AjxCallback.simpleClosure(function(e){
+return new ZmMailList(ZmItem.ATT,e)
+}
+,this)}
+)
+};
+ZmMailApp.prototype._setupSearchToolbar=function(){
+if(appCtxt.get(ZmSetting.MAIL_ENABLED)){
+ZmSearchToolBar.addMenuItem(ZmId.SEARCH_MAIL,{
+msgKey:"searchMail",tooltipKey:"searchMail",icon:"Message",shareIcon:"SharedMailFolder",id:ZmId.getMenuItemId(ZmId.SEARCH,ZmId.SEARCH_MAIL)}
+)
+}};
+ZmMailApp.prototype._registerApp=function(){
+var t={};
+t[ZmOperation.NEW_MESSAGE]="message";
+var e={};
+e[ZmKeyMap.NEW_MESSAGE]=ZmOperation.NEW_MESSAGE;
+e[ZmKeyMap.NEW_MESSAGE_WIN]=ZmOperation.NEW_MESSAGE_WIN;
+ZmApp.registerApp(ZmApp.MAIL,{
+mainPkg:"MailCore",nameKey:"mail",icon:"MailApp",textPrecedence:70,chooserTooltipKey:"goToMail",viewTooltipKey:"displayMailToolTip",defaultSearch:appCtxt.isChildWindow?null:ZmId.SEARCH_MAIL,organizer:ZmOrganizer.FOLDER,overviewTrees:[ZmOrganizer.FOLDER,ZmOrganizer.SEARCH,ZmOrganizer.TAG],assistants:{
+ZmMailAssistant:"Mail"}
+,searchTypes:[ZmItem.MSG,ZmItem.CONV],newItemOps:t,actionCodes:e,gotoActionCode:ZmKeyMap.GOTO_MAIL,newActionCode:ZmKeyMap.NEW_MESSAGE,qsViews:["compose","msg"],trashViewOp:ZmOperation.SHOW_ONLY_MAIL,chooserSort:10,defaultSort:10,upsellUrl:ZmSetting.MAIL_UPSELL_URL}
+)
+};
+ZmMailApp.prototype.startup=function(e){};
+ZmMailApp.prototype.preNotify=function(u){
+if(!(u.deleted&&u.created&&u.modified)){
+return u
+}
+var n=false;
+var s=u.deleted.id.split(",");
+var p={};
+var h=[];
+for(var j=0;
+j<s.length;
+j++){
+var w=s[j];
+var g=ZmOrganizer.normalizeId(w);
+if(g<0){
+p[g]=true;
+n=true
+}else{
+h.push(w)
+}}
+if(!n){
+return u
+}
+var m=false;
+var t=ZmRequestMgr._getObjList(u.created);
+var f={};
+var l={};
+for(var j=0;
+j<t.length;
+j++){
+var c=t[j];
+var w=c.id;
+var O=c._name;
+if(O=="m"){
+f[w]=c
+}else{
+if(O=="c"&&(c.n>1)){
+l[w]=c;
+m=true
+}}}
+if(!m){
+return u
+}
+var x=false;
+var q={};
+var z=ZmRequestMgr._getObjList(u.modified);
+var d={};
+for(var j=0;
+j<z.length;
+j++){
+var T=z[j];
+var w=T.id;
+var g=ZmOrganizer.normalizeId(w);
+var O=T._name;
+if(O=="m"){
+var e=g*-1;
+if(p[e]&&l[T.cid]){
+x=true;
+d[w]=T;
+q[T.cid]=appCtxt.multiAccounts?ZmOrganizer.getSystemId(e):e;
+l[T.cid]._wasVirtConv=true;
+l[T.cid].m=[{
+id:w}
+];
+var o=appCtxt.getById(w);
+if(o){
+o.cid=T.cid
+}}}}
+if(!x){
+return u
+}
+if(h.length){
+u.deleted.id=h.join(",")
+}else{
+delete u.deleted
+}
+for(var w in f){
+var y=f[w];
+var b=l[y.cid];
+if(b&&b._wasVirtConv){
+y._convCreateNode=b
+}}
+var v=[];
+for(var r in q){
+var k=l[r];
+k.id=q[r];
+k._newId=r;
+v.push(k)
+}
+if(v.length){
+var a={};
+a.c=v;
+appCtxt.getRequestMgr()._handleModifies(a)
+}};
+ZmMailApp.prototype.createNotify=function(o,s){
+var e=o.m;
+if(!e&&!o.c&&!o.link){
+return
+}
+if(!s&&!this._noDefer&&this._deferNotifications("create",o)){
+return
+}
+if(o.link){
+var n=o.link;
+for(var a=0;
+a<n.length;
+a++){
+var t=n[a];
+if(appCtxt.cacheGet(t.id)){
+continue
+}
+this._handleCreateLink(t,ZmOrganizer.FOLDER)
+}}
+if(this._tradController&&(appCtxt.getCurrentController()==this._tradController)){
+this._checkList(o,this._tradController.getList(),this._tradController)
+}else{
+if(this._convListController){
+this._checkList(o,this._convListController.getList(),this._convListController)
+}
+if(this._convController){
+this._checkList(o,this._convController.getList(),this._convController)
+}}
+this._handleAlerts(o)
+};
+ZmMailApp.prototype._handleAlerts=function(h){
+var l=h.m||[];
+if(l.length==0){
+return
+}
+AjxDispatcher.require("Alert");
+var o=appCtxt.getActiveAccount();
+var a,f,p=false;
+var n=0;
+for(var s=0;
+s<l.length;
+s++){
+var u=l[s];
+var e=(u&&u.f&&(u.f.indexOf(ZmItem.FLAG_UNREAD)!=-1))?ZmOrganizer.parseId(u.l):null;
+if(e&&e.id==ZmOrganizer.ID_INBOX){
+var c=e.account;
+if(!c||(c&&c.isOfflineInitialSync())){
+continue
+}
+if(appCtxt.accountList.size(true)>1){
+ZmAccountAlert.get(c).start(this)
+}
+if(!a&&c==o&&appCtxt.get(ZmSetting.MAIL_NOTIFY_APP,null,c)){
+this.startAlert();
+a=true
+}
+if(!f&&appCtxt.get(ZmSetting.MAIL_NOTIFY_SOUNDS,null,c)){
+ZmSoundAlert.getInstance().start();
+f=true
+}
+if(!p&&appCtxt.get(ZmSetting.MAIL_NOTIFY_BROWSER,null,c)){
+ZmBrowserAlert.getInstance().start(ZmMsg.newMessage);
+p=true
+}
+if(appCtxt.get(ZmSetting.MAIL_NOTIFY_TOASTER,null,c)&&n<5){
+var t=appCtxt.getById(u.id)||ZmMailMsg.createFromDom(u,{}
+);
+var g=(t.subject)?([t.subject," - ",(t.fragment||"")].join("")):(t.fragment||"");
+var m=t.getAddress(AjxEmailAddress.FROM);
+var r=m.getName()||m.getAddress();
+var d=(appCtxt.accountList.size(true)>1)?AjxMessageFormat.format(ZmMsg.newMailWithAccount,[r,c.getDisplayName()]):AjxMessageFormat.format(ZmMsg.newMail,r);
+ZmDesktopAlert.getInstance().start(d,g);
+n++
+}}}};
+ZmMailApp.prototype._checkList=function(r,s,n){
+if(!(s&&s instanceof ZmMailList)){
+return
+}
+var o={};
+var h={};
+var t={};
+if(!(s.search&&s.search.matches)&&(n!=this._convController)){
+return
+}
+var c=s.search.sortBy;
+var e=this._checkType(r,ZmItem.CONV,o,s,c);
+var a=this._checkType(r,ZmItem.MSG,h,s,c,o);
+if(e.gotMail||a.gotMail){
+s.notifyCreate(o,h)
+}
+if(e.hasMore||a.hasMore){
+var n;
+var l=appCtxt.getAppViewMgr().getCurrentViewId();
+if(l==ZmId.VIEW_CONVLIST){
+n=this.getConvListController()
+}else{
+if(l==ZmId.VIEW_TRAD){
+n=this.getTradController()
+}}
+if(n){
+n.setHasMore(true)
+}}};
+ZmMailApp.prototype._checkType=function(creates,type,items,currList,sortBy,convs){
+var result={
+gotMail:false,hasMore:false};
+var nodeName=ZmList.NODE[type];
+var list=creates[nodeName];
+if(!(list&&list.length)){
+return result
+}
+var throttle=appCtxt.isOffline&&appCtxt.getActiveAccount().isOfflineInitialSync();
+if(throttle){
+if(!this._maxEntries){
+var mlv=this.getMailListController().getReferenceView().getMailListView();
+this._maxEntries=mlv&&mlv.calculateMaxEntries()
+}
+if(this.numEntries>this._maxEntries){
+result.hasMore=true;
+return result
+}}
+for(var i=0;
+i<list.length;
+i++){
+var create=list[i];
+if(create._handled){
+continue
+}
+create._handled=true;
+if(currList.getById(create.id)||create._wasVirtConv){
+continue
+}
+if(currList.type==ZmItem.MSG&&type==ZmItem.CONV){
+continue
+}
+if(appCtxt.isOffline){
+if((ZmList.ITEM_TYPE[nodeName]!=currList.type)&&(currList.type!=ZmItem.CONV)){
+continue
+}}
+if(throttle&&this.numEntries>this._maxEntries){
+result.hasMore=true;
+break
+}
+var itemClass=eval(ZmList.ITEM_CLASS[type]);
+var item=itemClass.createFromDom(create,{}
+,true);
+items[item.id]=item;
+result.gotMail=true
+}
+return result
+};
+ZmMailApp.prototype.postNotify=function(e){
+var t=this._checkReplenishListView;
+if(t&&!t._isPageless){
+t._checkReplenish();
+this._checkReplenishListView=null
+}};
+ZmMailApp.prototype.refresh=function(a){
+var h=appCtxt.getById(ZmFolder.ID_INBOX);
+if(h){
+this.setNewMailNotice(h)
+}
+if(!appCtxt.inStartup){
+this.resetOverview(this.getOverviewId());
+var n=appCtxt.currentRequestParams;
+if(appCtxt.getCurrentAppName()==this._name&&n.resend&&n.methodName=="NoOpRequest"){
+var e=appCtxt.getCurrentViewId();
+if(e==ZmId.VIEW_CONVLIST||e==ZmId.VIEW_TRAD){
+appCtxt.getSearchController().redoSearch(this.currentSearch)
+}}}
+if(appCtxt.get(ZmSetting.MAIL_ATTACH_VIEW_ENABLED)){
+var o=appCtxt.getFolderTree();
+if(!o.getById(ZmFolder.ID_ATTACHMENTS)){
+var t=appCtxt.getById(ZmOrganizer.ID_ROOT);
+var r={
+id:ZmFolder.ID_ATTACHMENTS,parent:t,tree:t.tree,type:ZmOrganizer.FOLDER,numTotal:1};
+var s=new ZmFolder(r);
+t.children.add(s);
+s._notify(ZmEvent.E_CREATE)
+}}};
+ZmMailApp.prototype.handleOp=function(n,o){
+var t=false;
+var a=true;
+switch(n){
+case ZmOperation.NEW_MESSAGE_WIN:t=true;
+a=false;
+case ZmOperation.NEW_MESSAGE:if(!t){
+t=this._inNewWindow(o&&o.ev);
+a=false
+}
+var e=new AjxCallback(this,this._handleLoadNewMessage,[t]);
+AjxDispatcher.require(["ContactsCore","Contacts"],false,e,null,a);
+break
+}};
+ZmMailApp.prototype._handleLoadNewMessage=function(e){
+AjxDispatcher.run("Compose",{
+action:ZmOperation.NEW_MESSAGE,inNewWindow:e}
+)
+};
+ZmMailApp.prototype.getOverviewPanelContent=function(){
+var t=!this._overviewPanelContent;
+var e=ZmApp.prototype.getOverviewPanelContent.apply(this,arguments);
+if(t){
+appCtxt.getSearchController().updateOverview()
+}
+return e
+};
+ZmMailApp.prototype.getOverviewContainer=function(){
+var t=!this._overviewContainer;
+var e=ZmApp.prototype.getOverviewContainer.apply(this,arguments);
+if(t){
+appCtxt.getSearchController().updateOverview()
+}
+return e
+};
+ZmMailApp.prototype.launch=function(n,r){
+this._groupBy[appCtxt.getActiveAccount().name]=appCtxt.get(ZmSetting.GROUP_MAIL_BY);
+var a;
+n=n||{};
+if(n.qsParams){
+var e=n.qsParams.view,s=n.qsParams.id;
+if(e=="compose"){
+this._showComposeView(r);
+return
+}else{
+if(s){
+e=e||"msg";
+if(e=="list"){
+a=["item:",s].join("");
+n.searchResponse=null;
+this._forceMsgView=true
+}else{
+if(e=="msg"){
+var o=new ZmMailMsg(s,null,true);
+var t={
+getHtml:appCtxt.get(ZmSetting.VIEW_AS_HTML),markRead:(appCtxt.get(ZmSetting.MARK_MSG_READ)==ZmSetting.MARK_READ_NOW),callback:new AjxCallback(this,this._handleResponseMsgLoad,[o,r]),errorCallback:new AjxCallback(this,this._handleErrorMsgLoad,r)};
+o.load(t);
+return
+}}}}}else{
+if(appCtxt.get(ZmSetting.OFFLINE_SUPPORTS_MAILTO)&&!appCtxt.multiAccounts){
+if(appCtxt.getAppController().handleOfflineMailTo(location.search,r)){
+return
+}}}
+this.mailSearch(a,r,n.searchResponse)
+};
+ZmMailApp.prototype._handleErrorLaunch=function(t,e){
+if(e.code==ZmCsfeException.MAIL_NO_SUCH_FOLDER||e.code==ZmCsfeException.MAIL_NO_SUCH_TAG||e.code==ZmCsfeException.MAIL_QUERY_PARSE_ERROR){
+var a={
+query:"in:inbox",callback:t.callback,errorCallback:null,types:t.types};
+appCtxt.getSearchController().search(a)
+}};
+ZmMailApp.prototype._handleErrorMsgLoad=function(t,e){
+this.mailSearch();
+if(t){
+t.run()
+}
+this._notifyRendered();
+return false
+};
+ZmMailApp.prototype._handleResponseMsgLoad=function(t,a){
+AjxDispatcher.require("Startup2");
+var e=AjxDispatcher.run("GetMsgController");
+if(e){
+e.show(t);
+if(a){
+a.run()
+}
+this._notifyRendered()
+}};
+ZmMailApp.prototype.mailSearch=function(r,l,a,h){
+var n=appCtxt.isOffline&&appCtxt.inStartup&&appCtxt.accountList.defaultAccount;
+if(n){
+appCtxt.accountList.setActiveAccount(n)
+}
+var s=appCtxt.getSearchController();
+var c,e;
+if(appCtxt.get(ZmSetting.OFFLINE_SHOW_GLOBAL_INBOX)&&appCtxt.accountList.size(true)>2){
+r=null;
+c=appCtxt.accountList.generateQuery(ZmOrganizer.ID_INBOX);
+e=true;
+s.searchAllAccounts=true
+}else{
+r=r||appCtxt.get(ZmSetting.INITIAL_SEARCH,null,n)
+}
+var o=new AjxVector();
+o.add(h||this.getGroupMailBy());
+var t={
+searchFor:ZmId.SEARCH_MAIL,query:r,queryHint:c,types:o,limit:this.getLimit(),getHtml:appCtxt.get(ZmSetting.VIEW_AS_HTML,null,n),noUpdateOverview:e,accountName:(n&&n.name),callback:l,response:a};
+t.errorCallback=new AjxCallback(this,this._handleErrorLaunch,t);
+s.search(t)
+};
+ZmMailApp.prototype._handleOfflineMailSearch=function(){
+if(appCtxt.get(ZmSetting.OFFLINE_SUPPORTS_MAILTO)){
+appCtxt.getAppController().handleOfflineMailTo(location.search)
+}};
+ZmMailApp.prototype.getSearchParams=function(e){
+e=e||{};
+if(!appCtxt.inStartup&&appCtxt.get(ZmSetting.READING_PANE_ENABLED)){
+e.fetch=true
+}
+AjxDispatcher.require("MailCore");
+e.headers=ZmMailMsg.requestHeaders;
+return e
+};
+ZmMailApp.prototype.showSearchResults=function(t,a){
+var e=new AjxCallback(this,this._handleLoadShowSearchResults,[t,a]);
+AjxDispatcher.require("MailCore",false,e,null,true)
+};
+ZmMailApp.prototype._handleLoadShowSearchResults=function(t,a){
+var e=(t.type==ZmItem.MSG)?this.getTradController():this.getConvListController();
+e.show(t);
+if(this._forceMsgView){
+e.selectFirstItem();
+this._forceMsgView=false
+}
+if(a){
+a.run()
+}
+this._notifyRendered()
+};
+ZmMailApp.prototype._parseComposeUrl=function(t){
+t=t||"";
+var o=t.match(/\bto=([^&]+)/);
+var r=o?decodeURIComponent(o[1]):null;
+o=t.match(/\bsubject=([^&]+)/);
+var n=o?(decodeURIComponent(o[1]).replace(/\+/g," ")):null;
+o=t.match(/\bcc=([^&]+)/);
+var s=o?decodeURIComponent(o[1]):null;
+o=t.match(/\bbcc=([^&]+)/);
+var a=o?decodeURIComponent(o[1]):null;
+o=t.match(/\bbody=([^&]+)/);
+var e=o?(decodeURIComponent(o[1]).replace(/\+/g," ")):null;
+return{
+to:r,subject:n,cc:s,bcc:a,body:e}
+};
+ZmMailApp.prototype._showComposeView=function(r,a){
+var o=a||location.search;
+AjxDispatcher.require("Startup2");
+var l=AjxDispatcher.run("GetComposeController");
+var e=this._parseComposeUrl(o);
+var s=e.to;
+if(s&&s.indexOf("mailto")==0){
+s=s.replace(/mailto:/,"");
+var n=s.split("?");
+e.to=n[0];
+if(n.length>1){
+n=n[1];
+var h=this._parseComposeUrl(n);
+e.to=e.to?(h.to?[e.to,","+h.to].join(""):e.to):h.to;
+e.subject=h.subject||e.subject;
+e.cc=h.cc||e.cc;
+e.bcc=h.bcc||e.bcc;
+e.body=h.body||e.body
+}}
+var t={
+action:ZmOperation.NEW_MESSAGE,toOverride:e.to,ccOverride:e.cc,bccOverride:e.bcc,subjOverride:e.subject,extraBodyText:e.body,callback:r};
+if(appCtxt.isOffline&&appCtxt.get(ZmSetting.OFFLINE_SUPPORTS_MAILTO)&&appCtxt.getCurrentViewId()==ZmId.VIEW_COMPOSE){
+l.resetComposeForMailto(t)
+}else{
+l.doAction(t)
+}
+this._notifyRendered()
+};
+ZmMailApp.prototype.getConvListController=function(){
+if(!this._convListController){
+this._convListController=new ZmConvListController(this._container,this)
+}
+return this._convListController
+};
+ZmMailApp.prototype.getConvController=function(){
+if(!this._convController){
+this._convController=new ZmConvController(this._container,this)
+}
+return this._convController
+};
+ZmMailApp.prototype.getTradController=function(){
+if(!this._tradController){
+this._tradController=new ZmTradController(this._container,this)
+}
+return this._tradController
+};
+ZmMailApp.prototype.getMsgController=function(e){
+return this.getSessionController(ZmId.VIEW_MSG,"ZmMsgController",e)
+};
+ZmMailApp.prototype.getComposeController=function(e){
+return this.getSessionController(ZmId.VIEW_COMPOSE,"ZmComposeController",e)
+};
+ZmMailApp.prototype.getCurrentSessionId=function(e){
+return this._curSessionId[e]
+};
+ZmMailApp.prototype.getSessionController=function(type,controllerClass,sessionId){
+if(!this._sessionController[type]){
+this._sessionController[type]={};
+this._sessionId[type]=1
+}
+if(sessionId&&this._sessionController[type][sessionId]){
+return this._sessionController[type][sessionId]
+}
+var controllers=this._sessionController[type];
+var controller;
+for(var id in controllers){
+if(controllers[id].inactive){
+controller=controllers[id];
+break
+}}
+sessionId=controller?controller.sessionId:this._sessionId[type]++;
+if(!controller){
+var ctlrClass=eval(controllerClass);
+controller=this._sessionController[type][sessionId]=new ctlrClass(this._container,this)
+}
+controller.setSessionId(type,sessionId);
+this._curSessionId[type]=sessionId;
+controller.inactive=false;
+return controller
+};
+ZmMailApp.prototype.getConfirmController=function(e){
+return this.getSessionController(ZmId.VIEW_MAIL_CONFIRM,"ZmMailConfirmController",e)
+};
+ZmMailApp.prototype.getMailListController=function(){
+var e=appCtxt.get(ZmSetting.GROUP_MAIL_BY);
+return(e==ZmSetting.GROUP_BY_CONV)?AjxDispatcher.run("GetConvListController"):AjxDispatcher.run("GetTradController")
+};
+ZmMailApp.prototype.getAttachmentsController=function(){
+if(!this._attachmentsController){
+this._attachmentsController=new ZmAttachmentsController(this._container,this)
+}
+return this._attachmentsController
+};
+ZmMailApp.prototype.compose=function(e){
+AjxDispatcher.run("GetComposeController").doAction(e)
+};
+ZmMailApp.prototype.setNewMailNotice=function(e){
+var s=appCtxt.getAppChooser();
+if(s){
+var r=s.getButton(ZmApp.MAIL);
+var o=(e.numUnread>0)?"EnvelopeOpen":"MailApp";
+r.setImage(o)
+}
+if(appCtxt.isOffline&&appCtxt.get(ZmSetting.OFFLINE_SUPPORTS_DOCK_UPDATE)){
+var t=0;
+var n=appCtxt.accountList.visibleAccounts;
+for(var a=0;
+a<n.length;
+a++){
+t+=(n[a].unread||0)
+}
+if(AjxEnv.isMac&&window.platform){
+window.platform.icon().badgeText=(t>0)?t:null
+}else{
+if(AjxEnv.isWindows){
+window.platform.icon().imageSpec=(t>0)?"resource://webapp/icons/default/newmail.png":"resource://webapp/icons/default/launcher.ico";
+window.platform.icon().title=(t>0)?AjxMessageFormat.format(ZmMsg.unreadCount,t):null
+}}}};
+ZmMailApp.prototype.getGroupMailBy=function(){
+var e=this._groupBy[appCtxt.getActiveAccount().name];
+var t=e||appCtxt.get(ZmSetting.GROUP_MAIL_BY);
+return t?ZmMailApp.GROUP_MAIL_BY_ITEM[t]:ZmItem.MSG
+};
+ZmMailApp.prototype.setGroupMailBy=function(e){
+this._groupBy[appCtxt.getActiveAccount().name]=e;
+appCtxt.set(ZmSetting.GROUP_MAIL_BY,e)
+};
+ZmMailApp.prototype.getLimit=function(t){
+var e=appCtxt.get(ZmSetting.PAGE_SIZE);
+return t?e:2*e
+};
+ZmMailApp.addReplyMenu=function(e){
+var t=[ZmOperation.REPLY,ZmOperation.REPLY_ALL];
+var a=new ZmActionMenu({
+parent:e,menuItems:t}
+);
+e.setMenu(a);
+return a
+};
+ZmMailApp.addForwardMenu=function(e){
+var t=[ZmOperation.FORWARD_INLINE,ZmOperation.FORWARD_ATT];
+var a=new ZmActionMenu({
+parent:e,menuItems:t}
+);
+e.setMenu(a);
+return a
+};
+ZmMailApp.prototype.getDataSourceCollection=function(t){
+var a=window.parentAppCtxt||window.appCtxt;
+var e=t?t.name:a.getActiveAccount().name;
+if(!this._dataSourceCollection[e]){
+this._dataSourceCollection[e]=new ZmDataSourceCollection();
+if(a.getActiveAccount().isMain){
+this._dataSourceCollection[e].initialize(a.getSettings().getInfoResponse.dataSources)
+}}
+return this._dataSourceCollection[e]
+};
+ZmMailApp.prototype.getIdentityCollection=function(a){
+if(appCtxt.isChildWindow){
+if(!this._identityCollection){
+this._identityCollection=new ZmIdentityCollection()
+}
+return this._identityCollection
+}
+var t=a?a.name:appCtxt.getActiveAccount().name;
+if(!this._identityCollection[t]){
+var e=this._identityCollection[t]=new ZmIdentityCollection();
+e.initialize(appCtxt.getSettings(a).getInfoResponse.identities)
+}
+return this._identityCollection[t]
+};
+ZmMailApp.prototype.getSignatureCollection=function(t){
+var a=window.parentAppCtxt||window.appCtxt;
+var e=t?t.name:a.getActiveAccount().name;
+if(!this._signatureCollection[e]){
+var o=this._signatureCollection[e]=new ZmSignatureCollection();
+o.initialize(a.getSettings(t).getInfoResponse.signatures)
+}
+return this._signatureCollection[e]
+};
+ZmMailApp.prototype._addSettingsChangeListeners=function(){
+ZmApp.prototype._addSettingsChangeListeners.call(this);
+if(!this._settingsListener){
+this._settingsListener=new AjxListener(this,this._settingsChangeListener)
+}
+var e=appCtxt.getSettings();
+e.getSetting(ZmSetting.VIEW_AS_HTML).addChangeListener(this._settingListener);
+e.addChangeListener(this._settingsListener)
+};
+ZmMailApp.prototype._settingChangeListener=function(a){
+ZmApp.prototype._settingChangeListener.call(this,a);
+if(a.type!=ZmEvent.S_SETTING){
+return
+}
+var t=a.source;
+var n=this.getMailListController();
+if(n&&t.id==ZmSetting.VIEW_AS_HTML){
+var e=n._doublePaneView;
+var o=e?e.getMsg():null;
+if(o){
+e.reset();
+e.setMsg(o)
+}}};
+ZmMailApp.prototype._settingsChangeListener=function(n){
+if(n.type!=ZmEvent.S_SETTINGS){
+return
+}
+var s=n.getDetail("settings");
+if(!(s&&s.length)){
+return
+}
+var h=this.getMailListController();
+if(!h){
+return
+}
+var e=h._currentView;
+var r,o;
+for(var t=0;
+t<s.length;
+t++){
+var a=s[t];
+if(a.id==ZmSetting.SHOW_FRAGMENTS){
+if(e!=ZmId.VIEW_MSG){
+r=o||e
+}}}
+r=o||r;
+if(r){
+h.switchView(r,true)
+}}
+}
+if(AjxPackage.define("zimbraMail.calendar.ZmCalendarApp")){
+ZmCalendarApp=function(e){
+ZmApp.call(this,ZmApp.CALENDAR,e);
+if(!appCtxt.isOffline){
+this._addSettingsChangeListeners()
+}
+this._resByName={};
+this._resByEmail={}
+};
+ZmEvent.S_APPT=ZmId.ITEM_APPOINTMENT;
+ZmEvent.S_RESOURCE=ZmId.ITEM_RESOURCE;
+ZmItem.APPT=ZmEvent.S_APPT;
+ZmItem.RESOURCE=ZmEvent.S_RESOURCE;
+ZmOrganizer.CALENDAR=ZmId.ORG_CALENDAR;
+ZmApp.CALENDAR=ZmId.APP_CALENDAR;
+ZmApp.CLASS[ZmApp.CALENDAR]="ZmCalendarApp";
+ZmApp.SETTING[ZmApp.CALENDAR]=ZmSetting.CALENDAR_ENABLED;
+ZmApp.UPSELL_SETTING[ZmApp.CALENDAR]=ZmSetting.CALENDAR_UPSELL_ENABLED;
+ZmApp.LOAD_SORT[ZmApp.CALENDAR]=40;
+ZmApp.QS_ARG[ZmApp.CALENDAR]="calendar";
+ZmCalendarApp.REMINDER_START_DELAY=10000;
+ZmCalendarApp.MINICAL_DELAY=5000;
+ZmCalendarApp.VIEW_FOR_SETTING={};
+ZmCalendarApp.VIEW_FOR_SETTING[ZmSetting.CAL_DAY]=ZmId.VIEW_CAL_DAY;
+ZmCalendarApp.VIEW_FOR_SETTING[ZmSetting.CAL_WEEK]=ZmId.VIEW_CAL_WEEK;
+ZmCalendarApp.VIEW_FOR_SETTING[ZmSetting.CAL_WORK_WEEK]=ZmId.VIEW_CAL_WORK_WEEK;
+ZmCalendarApp.VIEW_FOR_SETTING[ZmSetting.CAL_MONTH]=ZmId.VIEW_CAL_MONTH;
+ZmCalendarApp.VIEW_FOR_SETTING[ZmSetting.CAL_SCHEDULE]=ZmId.VIEW_CAL_SCHEDULE;
+ZmCalendarApp.VIEW_FOR_SETTING[ZmSetting.CAL_LIST]=ZmId.VIEW_CAL_LIST;
+ZmCalendarApp.COLORS=[];
+ZmCalendarApp.COLORS[ZmOrganizer.C_ORANGE]="Orange";
+ZmCalendarApp.COLORS[ZmOrganizer.C_BLUE]="Blue";
+ZmCalendarApp.COLORS[ZmOrganizer.C_CYAN]="Cyan";
+ZmCalendarApp.COLORS[ZmOrganizer.C_GREEN]="Green";
+ZmCalendarApp.COLORS[ZmOrganizer.C_PURPLE]="Purple";
+ZmCalendarApp.COLORS[ZmOrganizer.C_RED]="Red";
+ZmCalendarApp.COLORS[ZmOrganizer.C_YELLOW]="Yellow";
+ZmCalendarApp.COLORS[ZmOrganizer.C_PINK]="Pink";
+ZmCalendarApp.COLORS[ZmOrganizer.C_GRAY]="Gray";
+ZmCalendarApp.CUTYPE_INDIVIDUAL="IND";
+ZmCalendarApp.CUTYPE_GROUP="GRO";
+ZmCalendarApp.CUTYPE_RESOURCE="RES";
+ZmCalendarApp.CUTYPE_ROOM="ROO";
+ZmCalendarApp.CUTYPE_UNKNOWN="UNK";
+ZmCalendarApp.STATUS_CANC="CANC";
+ZmCalendarApp.STATUS_COMP="COMP";
+ZmCalendarApp.STATUS_CONF="CONF";
+ZmCalendarApp.STATUS_DEFR="DEFERRED";
+ZmCalendarApp.STATUS_INPR="INPR";
+ZmCalendarApp.STATUS_NEED="NEED";
+ZmCalendarApp.STATUS_TENT="TENT";
+ZmCalendarApp.STATUS_WAIT="WAITING";
+ZmCalendarApp.METHOD_CANCEL="CANCEL";
+ZmCalendarApp.METHOD_PUBLISH="PUBLISH";
+ZmCalendarApp.METHOD_REPLY="REPLY";
+ZmCalendarApp.METHOD_REQUEST="REQUEST";
+ZmCalendarApp.prototype=new ZmApp;
+ZmCalendarApp.prototype.constructor=ZmCalendarApp;
+ZmCalendarApp.prototype.toString=function(){
+return"ZmCalendarApp"
+};
+ZmCalendarApp.prototype._defineAPI=function(){
+AjxDispatcher.setPackageLoadFunction("CalendarCore",new AjxCallback(this,this._postLoadCore));
+AjxDispatcher.setPackageLoadFunction("Calendar",new AjxCallback(this,this._postLoad,ZmOrganizer.CALENDAR));
+AjxDispatcher.registerMethod("GetCalController","CalendarCore",new AjxCallback(this,this.getCalController));
+AjxDispatcher.registerMethod("GetReminderController","CalendarCore",new AjxCallback(this,this.getReminderController));
+AjxDispatcher.registerMethod("ShowMiniCalendar","CalendarCore",new AjxCallback(this,this.showMiniCalendar));
+AjxDispatcher.registerMethod("GetApptComposeController",["CalendarCore","Calendar","CalendarAppt"],new AjxCallback(this,this.getApptComposeController))
+};
+ZmCalendarApp.prototype._registerSettings=function(e){
+var e=e||appCtxt.getSettings();
+e.registerSetting("CAL_ALWAYS_SHOW_MINI_CAL",{
+name:"zimbraPrefCalendarAlwaysShowMiniCal",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("CAL_APPT_VISIBILITY",{
+name:"zimbraPrefCalendarApptVisibility",type:ZmSetting.T_PREF,dataType:ZmSetting.D_STRING,defaultValue:"public"}
+);
+e.registerSetting("CAL_EXPORT",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_NONE}
+);
+e.registerSetting("CAL_FIRST_DAY_OF_WEEK",{
+name:"zimbraPrefCalendarFirstDayOfWeek",type:ZmSetting.T_PREF,dataType:ZmSetting.D_INT,defaultValue:0}
+);
+e.registerSetting("CAL_FREE_BUSY_ACL",{
+type:ZmSetting.T_PREF,defaultValue:ZmSetting.ACL_ALL}
+);
+e.registerSetting("CAL_FREE_BUSY_ACL_USERS",{
+type:ZmSetting.T_PREF}
+);
+e.registerSetting("CAL_IMPORT",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_NONE}
+);
+e.registerSetting("CAL_INVITE_ACL",{
+type:ZmSetting.T_PREF,defaultValue:ZmSetting.ACL_ALL}
+);
+e.registerSetting("CAL_INVITE_ACL_USERS",{
+type:ZmSetting.T_PREF}
+);
+e.registerSetting("CAL_REMINDER_NOTIFY_SOUNDS",{
+name:"zimbraPrefCalendarReminderSoundsEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("CAL_REMINDER_NOTIFY_BROWSER",{
+name:"zimbraPrefCalendarReminderFlashTitle",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("CAL_REMINDER_NOTIFY_TOASTER",{
+name:"zimbraPrefCalendarToasterEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("CAL_REMINDER_WARNING_TIME",{
+name:"zimbraPrefCalendarApptReminderWarningTime",type:ZmSetting.T_PREF,dataType:ZmSetting.D_INT,defaultValue:0}
+);
+e.registerSetting("CAL_SHOW_TIMEZONE",{
+name:"zimbraPrefUseTimeZoneListInCalendar",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("CAL_USE_QUICK_ADD",{
+name:"zimbraPrefCalendarUseQuickAdd",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("CALENDAR_INITIAL_VIEW",{
+name:"zimbraPrefCalendarInitialView",type:ZmSetting.T_PREF,defaultValue:ZmSetting.CAL_DAY}
+);
+e.registerSetting("DELETE_INVITE_ON_REPLY",{
+name:"zimbraPrefDeleteInviteOnReply",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("ENABLE_APPL_ICAL_DELEGATION",{
+name:"zimbraPrefAppleIcalDelegationEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("CAL_AUTO_ADD_INVITES",{
+name:"zimbraPrefCalendarAutoAddInvites",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("CAL_SEND_INV_DENIED_REPLY",{
+name:"zimbraPrefCalendarSendInviteDeniedAutoReply",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("CAL_INV_FORWARDING_ADDRESS",{
+name:"zimbraPrefCalendarForwardInvitesTo",type:ZmSetting.T_PREF}
+);
+e.registerSetting("CAL_SHOW_PAST_DUE_REMINDERS",{
+name:"zimbraPrefCalendarShowPastDueReminders",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("CAL_SHOW_CALENDAR_WEEK",{
+name:"zimbraPrefShowCalendarWeek",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+)
+};
+ZmCalendarApp.prototype._registerPrefs=function(){
+var t={
+CALENDAR:{
+title:ZmMsg.calendar,icon:"CalendarApp",templateId:"prefs.Pages#Calendar",priority:80,precondition:ZmSetting.CALENDAR_ENABLED,prefs:[ZmSetting.CAL_ALWAYS_SHOW_MINI_CAL,ZmSetting.CAL_AUTO_ADD_INVITES,ZmSetting.CAL_SEND_INV_DENIED_REPLY,ZmSetting.CAL_APPT_VISIBILITY,ZmSetting.CAL_EXPORT,ZmSetting.CAL_FIRST_DAY_OF_WEEK,ZmSetting.CAL_IMPORT,ZmSetting.CAL_REMINDER_WARNING_TIME,ZmSetting.CAL_REMINDER_NOTIFY_SOUNDS,ZmSetting.CAL_REMINDER_NOTIFY_BROWSER,ZmSetting.CAL_SHOW_TIMEZONE,ZmSetting.CAL_USE_QUICK_ADD,ZmSetting.CALENDAR_INITIAL_VIEW,ZmSetting.DELETE_INVITE_ON_REPLY,ZmSetting.ENABLE_APPL_ICAL_DELEGATION,ZmSetting.CAL_FREE_BUSY_ACL,ZmSetting.CAL_FREE_BUSY_ACL_USERS,ZmSetting.CAL_INVITE_ACL,ZmSetting.CAL_INVITE_ACL_USERS,ZmSetting.CAL_REMINDER_NOTIFY_TOASTER,ZmSetting.CAL_INV_FORWARDING_ADDRESS,ZmSetting.CAL_SHOW_PAST_DUE_REMINDERS,ZmSetting.CAL_SHOW_CALENDAR_WEEK],manageDirty:true,createView:function(o,n,a){
+AjxDispatcher.require("Alert");
+return new ZmCalendarPrefsPage(o,n,a)
+}}};
+for(var e in t){
+ZmPref.registerPrefSection(e,t[e])
+}
+ZmPref.registerPref("CAL_ALWAYS_SHOW_MINI_CAL",{
+displayName:ZmMsg.alwaysShowMiniCal,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("CAL_AUTO_ADD_INVITES",{
+displayName:ZmMsg.autoAddInvites,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("CAL_SEND_INV_DENIED_REPLY",{
+displayName:ZmMsg.sendInvDeniedAutoReply,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("CAL_EXPORT",{
+displayName:ZmMsg.exportToICS,displayContainer:ZmPref.TYPE_EXPORT}
+);
+ZmPref.registerPref("CAL_FIRST_DAY_OF_WEEK",{
+displayName:ZmMsg.calendarFirstDayOfWeek,displayContainer:ZmPref.TYPE_SELECT,displayOptions:AjxDateUtil.WEEKDAY_LONG,options:[0,1,2,3,4,5,6]}
+);
+ZmPref.registerPref("CAL_FREE_BUSY_ACL",{
+displayContainer:ZmPref.TYPE_RADIO_GROUP,displayOptions:[ZmMsg.freeBusyAllowAll,ZmMsg.freeBusyAllowLocal,ZmMsg.freeBusyAllowNone,ZmMsg.freeBusyAllowSome],options:[ZmSetting.ACL_PUBLIC,ZmSetting.ACL_AUTH,ZmSetting.ACL_NONE,ZmSetting.ACL_USER]}
+);
+ZmPref.registerPref("CAL_FREE_BUSY_ACL_USERS",{
+displayContainer:ZmPref.TYPE_TEXTAREA}
+);
+ZmPref.registerPref("CAL_IMPORT",{
+displayName:ZmMsg.importFromICS,displayContainer:ZmPref.TYPE_IMPORT}
+);
+ZmPref.registerPref("CAL_INVITE_ACL",{
+displayContainer:ZmPref.TYPE_RADIO_GROUP,displayOptions:[ZmMsg.invitesAllowAll,ZmMsg.invitesAllowLocal,ZmMsg.invitesAllowNone,ZmMsg.invitesAllowSome],options:[ZmSetting.ACL_PUBLIC,ZmSetting.ACL_AUTH,ZmSetting.ACL_NONE,ZmSetting.ACL_USER]}
+);
+ZmPref.registerPref("CAL_INVITE_ACL_USERS",{
+displayContainer:ZmPref.TYPE_TEXTAREA}
+);
+ZmPref.registerPref("CAL_REMINDER_WARNING_TIME",{
+displayName:ZmMsg.numberOfMinutes,displayContainer:ZmPref.TYPE_SELECT,displayOptions:[ZmMsg.apptRemindNever,ZmMsg.apptRemindNMinutesBefore,ZmMsg.apptRemindNMinutesBefore,ZmMsg.apptRemindNMinutesBefore,ZmMsg.apptRemindNMinutesBefore,ZmMsg.apptRemindNMinutesBefore,ZmMsg.apptRemindNMinutesBefore,ZmMsg.apptRemindNMinutesBefore],options:[0,1,5,10,15,30,45,60]}
+);
+ZmPref.registerPref("CAL_SHOW_TIMEZONE",{
+displayName:ZmMsg.shouldShowTimezone,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("CAL_USE_QUICK_ADD",{
+displayName:ZmMsg.useQuickAdd,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("CALENDAR_INITIAL_VIEW",{
+displayName:ZmMsg.calendarInitialView,displayContainer:ZmPref.TYPE_SELECT,displayOptions:[ZmMsg.calViewDay,ZmMsg.calViewWorkWeek,ZmMsg.calViewWeek,ZmMsg.calViewMonth,ZmMsg.calViewList,ZmMsg.calViewSchedule],options:[ZmSetting.CAL_DAY,ZmSetting.CAL_WORK_WEEK,ZmSetting.CAL_WEEK,ZmSetting.CAL_MONTH,ZmSetting.CAL_LIST,ZmSetting.CAL_SCHEDULE]}
+);
+ZmPref.registerPref("CAL_REMINDER_NOTIFY_SOUNDS",{
+displayName:ZmMsg.playSound,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("CAL_REMINDER_NOTIFY_BROWSER",{
+displayName:ZmMsg.flashBrowser,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("DELETE_INVITE_ON_REPLY",{
+displayName:ZmMsg.deleteInviteOnReply,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("ENABLE_APPL_ICAL_DELEGATION",{
+displayName:ZmMsg.enableAppleICalDelegation,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("CAL_REMINDER_NOTIFY_TOASTER",{
+displayFunc:function(){
+AjxDispatcher.require("Alert");
+return ZmDesktopAlert.getInstance().getDisplayText()
+}
+,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("CAL_APPT_VISIBILITY",{
+displayName:ZmMsg.calendarInitialApptVisibility,displayContainer:ZmPref.TYPE_SELECT,displayOptions:[ZmMsg._public,ZmMsg._private],options:[ZmSetting.CAL_VISIBILITY_PUB,ZmSetting.CAL_VISIBILITY_PRIV]}
+);
+ZmPref.registerPref("CAL_INV_FORWARDING_ADDRESS",{
+displayName:ZmMsg.inviteForwardingAddress,displayContainer:ZmPref.TYPE_INPUT,validationFunction:ZmPref.validateEmail,errorMessage:ZmMsg.invalidEmail}
+);
+ZmPref.registerPref("CAL_SHOW_PAST_DUE_REMINDERS",{
+displayName:ZmMsg.apptPastDueReminderLabel,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("CAL_SHOW_CALENDAR_WEEK",{
+displayName:ZmMsg.showWeekNumber,displayContainer:ZmPref.TYPE_CHECKBOX}
+)
+};
+ZmCalendarApp.prototype._registerOperations=function(){
+ZmOperation.registerOp(ZmId.OP_CAL_LIST_VIEW,{
+textKey:"list",tooltipKey:"viewCalListTooltip",image:"CalListView",shortcut:ZmKeyMap.CAL_LIST_VIEW}
+);
+ZmOperation.registerOp(ZmId.OP_CAL_REFRESH,{
+textKey:"refresh",tooltipKey:"calRefreshTooltip",image:"Refresh",shortcut:ZmKeyMap.REFRESH}
+);
+ZmOperation.registerOp(ZmId.OP_CAL_VIEW_MENU,{
+textKey:"view",image:"Appointment"}
+,null,AjxCallback.simpleClosure(function(e){
+ZmOperation.addDeferredMenu(ZmCalendarApp.addCalViewMenu,e)
+}
+));
+ZmOperation.registerOp(ZmId.OP_DAY_VIEW,{
+textKey:"viewDay",tooltipKey:"viewDayTooltip",image:"DayView",shortcut:ZmKeyMap.CAL_DAY_VIEW}
+);
+ZmOperation.registerOp(ZmId.OP_EDIT_REPLY_ACCEPT,{
+textKey:"replyAccept",image:"Check"}
+);
+ZmOperation.registerOp(ZmId.OP_EDIT_REPLY_CANCEL);
+ZmOperation.registerOp(ZmId.OP_EDIT_REPLY_TENTATIVE,{
+textKey:"replyTentative",image:"QuestionMark"}
+);
+ZmOperation.registerOp(ZmId.OP_EDIT_REPLY_DECLINE,{
+textKey:"replyDecline",image:"Cancel"}
+);
+ZmOperation.registerOp(ZmId.OP_INVITE_REPLY_ACCEPT,{
+textKey:"editReply",image:"Check"}
+);
+ZmOperation.registerOp(ZmId.OP_INVITE_REPLY_DECLINE,{
+textKey:"editReply",image:"Cancel"}
+);
+ZmOperation.registerOp(ZmId.OP_INVITE_REPLY_MENU,{
+textKey:"editReply",image:"Reply"}
+,ZmSetting.MAIL_ENABLED,AjxCallback.simpleClosure(function(e){
+ZmOperation.addDeferredMenu(ZmCalendarApp.addInviteReplyMenu,e)
+}
+));
+ZmOperation.registerOp(ZmId.OP_INVITE_REPLY_TENTATIVE,{
+textKey:"editReply",image:"QuestionMark"}
+);
+ZmOperation.registerOp(ZmId.OP_MONTH_VIEW,{
+textKey:"viewMonth",tooltipKey:"viewMonthTooltip",image:"MonthView",shortcut:ZmKeyMap.CAL_MONTH_VIEW}
+);
+ZmOperation.registerOp(ZmId.OP_MOUNT_CALENDAR,{
+textKey:"mountCalendar",image:"GroupSchedule"}
+);
+ZmOperation.registerOp(ZmId.OP_NEW_ALLDAY_APPT,{
+textKey:"newAllDayAppt",tooltipKey:"newAllDayApptTooltip",image:"NewAppointment"}
+);
+ZmOperation.registerOp(ZmId.OP_NEW_APPT,{
+textKey:"newAppt",tooltipKey:"newApptTooltip",image:"NewAppointment",shortcut:ZmKeyMap.NEW_APPT}
+);
+ZmOperation.registerOp(ZmId.OP_NEW_CALENDAR,{
+textKey:"newCalendar",image:"NewAppointment",tooltipKey:"newCalendarTooltip",shortcut:ZmKeyMap.NEW_CALENDAR}
+);
+ZmOperation.registerOp(ZmId.OP_REPLY_ACCEPT,{
+textKey:"replyAccept",image:"Check"}
+);
+ZmOperation.registerOp(ZmId.OP_REPLY_ACCEPT_NOTIFY,{
+textKey:"notifyOrganizerLabel",image:"Check"}
+);
+ZmOperation.registerOp(ZmId.OP_REPLY_ACCEPT_IGNORE,{
+textKey:"dontNotifyOrganizerLabel",image:"Check"}
+);
+ZmOperation.registerOp(ZmId.OP_REPLY_CANCEL);
+ZmOperation.registerOp(ZmId.OP_REPLY_DECLINE,{
+textKey:"replyDecline",image:"Cancel"}
+);
+ZmOperation.registerOp(ZmId.OP_REPLY_DECLINE_NOTIFY,{
+textKey:"notifyOrganizerLabel",image:"Cancel"}
+);
+ZmOperation.registerOp(ZmId.OP_REPLY_DECLINE_IGNORE,{
+textKey:"dontNotifyOrganizerLabel",image:"Cancel"}
+);
+ZmOperation.registerOp(ZmId.OP_REPLY_MODIFY);
+ZmOperation.registerOp(ZmId.OP_REPLY_NEW_TIME,{
+textKey:"replyNewTime",image:"NewTime"}
+);
+ZmOperation.registerOp(ZmId.OP_REPLY_TENTATIVE,{
+textKey:"replyTentative",image:"QuestionMark"}
+);
+ZmOperation.registerOp(ZmId.OP_REPLY_TENTATIVE_NOTIFY,{
+textKey:"notifyOrganizerLabel",image:"QuestionMark"}
+);
+ZmOperation.registerOp(ZmId.OP_REPLY_TENTATIVE_IGNORE,{
+textKey:"dontNotifyOrganizerLabel",image:"QuestionMark"}
+);
+ZmOperation.registerOp(ZmId.OP_SCHEDULE_VIEW,{
+textKey:"viewSchedule",tooltipKey:"viewScheduleTooltip",image:"GroupSchedule",shortcut:ZmKeyMap.CAL_SCHEDULE_VIEW}
+);
+ZmOperation.registerOp(ZmId.OP_SEARCH_MAIL,{
+textKey:"searchMail",image:"SearchMail"}
+,ZmSetting.MAIL_ENABLED);
+ZmOperation.registerOp(ZmId.OP_SHARE_CALENDAR,{
+textKey:"shareCalendar",image:"CalendarFolder"}
+);
+ZmOperation.registerOp(ZmId.OP_TODAY,{
+textKey:"today",tooltipKey:"todayTooltip",image:"Date",shortcut:ZmKeyMap.TODAY}
+);
+ZmOperation.registerOp(ZmId.OP_VIEW_APPOINTMENT,{
+textKey:"viewAppointment",image:"Appointment"}
+);
+ZmOperation.registerOp(ZmId.OP_OPEN_APPT_INSTANCE,{
+textKey:"openApptInstance",image:"Appointment"}
+);
+ZmOperation.registerOp(ZmId.OP_OPEN_APPT_SERIES,{
+textKey:"openApptSeries",image:"Appointment"}
+);
+ZmOperation.registerOp(ZmId.OP_DELETE_APPT_INSTANCE,{
+textKey:"deleteApptInstance",image:"Delete"}
+);
+ZmOperation.registerOp(ZmId.OP_DELETE_APPT_SERIES,{
+textKey:"deleteApptSeries",image:"Delete"}
+);
+ZmOperation.registerOp(ZmId.OP_VIEW_APPT_INSTANCE,{
+textKey:"apptInstance",image:"Appointment"}
+);
+ZmOperation.registerOp(ZmId.OP_VIEW_APPT_SERIES,{
+textKey:"apptSeries",image:"Appointment"}
+);
+ZmOperation.registerOp(ZmId.OP_WEEK_VIEW,{
+textKey:"viewWeek",tooltipKey:"viewWeekTooltip",image:"WeekView",shortcut:ZmKeyMap.CAL_WEEK_VIEW}
+);
+ZmOperation.registerOp(ZmId.OP_WORK_WEEK_VIEW,{
+textKey:"viewWorkWeek",tooltipKey:"viewWorkWeekTooltip",image:"WorkWeekView",shortcut:ZmKeyMap.CAL_WORK_WEEK_VIEW}
+);
+ZmOperation.registerOp(ZmId.OP_FORWARD_APPT,{
+textKey:"forward",tooltipKey:"forward",image:"Forward"}
+);
+ZmOperation.registerOp(ZmId.OP_FORWARD_APPT_INSTANCE,{
+textKey:"forwardInstance",tooltipKey:"forwardInstance",image:"Forward"}
+);
+ZmOperation.registerOp(ZmId.OP_FORWARD_APPT_SERIES,{
+textKey:"forwardSeries",tooltipKey:"forwardSeries",image:"Forward"}
+)
+};
+ZmCalendarApp.prototype._registerItems=function(){
+ZmItem.registerItem(ZmItem.APPT,{
+app:ZmApp.CALENDAR,nameKey:"appointment",icon:"Appointment",soapCmd:"ItemAction",itemClass:"ZmAppt",node:"appt",organizer:ZmOrganizer.CALENDAR,dropTargets:[ZmOrganizer.TAG,ZmOrganizer.CALENDAR],searchType:"appointment",resultsList:AjxCallback.simpleClosure(function(e){
+AjxDispatcher.require("CalendarCore");
+return new ZmApptList(ZmItem.APPT,e)
+}
+,this)}
+);
+ZmItem.registerItem(ZmItem.RESOURCE,{
+app:ZmApp.CALENDAR,itemClass:"ZmResource",node:"calResource",resultsList:AjxCallback.simpleClosure(function(e){
+AjxDispatcher.require("CalendarCore");
+return new ZmResourceList(null,e)
+}
+,this)}
+)
+};
+ZmCalendarApp.prototype._registerOrganizers=function(){
+ZmOrganizer.registerOrg(ZmOrganizer.CALENDAR,{
+app:ZmApp.CALENDAR,nameKey:"calendar",defaultFolder:ZmOrganizer.ID_CALENDAR,soapCmd:"FolderAction",firstUserId:256,orgClass:"ZmCalendar",orgPackage:"CalendarCore",treeController:"ZmCalendarTreeController",labelKey:"calendars",itemsKey:"appointments",hasColor:true,treeType:ZmOrganizer.FOLDER,views:["appointment"],folderKey:"calendar",mountKey:"mountCalendar",createFunc:"ZmCalendar.create",compareFunc:"ZmCalendar.sortCompare",newOp:ZmOperation.NEW_CALENDAR,displayOrder:100,deferrable:true}
+)
+};
+ZmCalendarApp.prototype._setupSearchToolbar=function(){
+ZmSearchToolBar.addMenuItem(ZmItem.APPT,{
+msgKey:"appointments",tooltipKey:"searchAppts",icon:"Appointment",shareIcon:"SharedCalendarFolder",setting:ZmSetting.CALENDAR_ENABLED,id:ZmId.getMenuItemId(ZmId.SEARCH,ZmId.ITEM_APPOINTMENT)}
+)
+};
+ZmCalendarApp.prototype._registerApp=function(){
+var a={};
+a[ZmOperation.NEW_APPT]="appointment";
+var t={};
+t[ZmOperation.NEW_CALENDAR]="calendar";
+var e={};
+e[ZmKeyMap.NEW_APPT]=ZmOperation.NEW_APPT;
+e[ZmKeyMap.NEW_CALENDAR]=ZmOperation.NEW_CALENDAR;
+ZmApp.registerApp(ZmApp.CALENDAR,{
+mainPkg:"Calendar",nameKey:"calendar",icon:"CalendarApp",textPrecedence:60,chooserTooltipKey:"goToCalendar",viewTooltipKey:"displayCalendar",defaultSearch:ZmItem.APPT,organizer:ZmOrganizer.CALENDAR,overviewTrees:[ZmOrganizer.CALENDAR,ZmOrganizer.SEARCH,ZmOrganizer.TAG],assistants:{
+ZmAppointmentAssistant:["CalendarCore","Calendar","CalendarAppt"],ZmCalendarAssistant:["CalendarCore","Calendar","CalendarAppt"]}
+,newItemOps:a,newOrgOps:t,actionCodes:e,searchTypes:[ZmItem.APPT],gotoActionCode:ZmKeyMap.GOTO_CALENDAR,newActionCode:ZmKeyMap.NEW_APPT,chooserSort:30,defaultSort:20,upsellUrl:ZmSetting.CALENDAR_UPSELL_URL}
+)
+};
+ZmCalendarApp.prototype.startup=function(e){};
+ZmCalendarApp.prototype.refresh=function(e){
+if(!appCtxt.inStartup){
+AjxDispatcher.run("GetCalController").refreshHandler(e)
+}};
+ZmCalendarApp.prototype.deleteNotify=function(e,t){
+if(!t&&this._deferNotifications("delete",e)){
+return
+}
+AjxDispatcher.run("GetCalController").notifyDelete(e)
+};
+ZmCalendarApp.prototype.createNotify=function(o,s){
+if(!o.folder&&!o.appt&&!o.link){
+return
+}
+if(!s&&!this._noDefer&&this._deferNotifications("create",o)){
+return
+}
+for(var e in o){
+var n=o[e];
+for(var a=0;
+a<n.length;
+a++){
+var t=n[a];
+if(appCtxt.cacheGet(t.id)){
+continue
+}
+if(e=="folder"){
+this._handleCreateFolder(t,ZmOrganizer.CALENDAR)
+}else{
+if(e=="link"){
+this._handleCreateLink(t,ZmOrganizer.CALENDAR)
+}else{
+if(e=="appt"){
+AjxDispatcher.run("GetCalController").notifyCreate(t)
+}}}
+if((e=="folder"||e=="link")&&this._calController){
+this._calController._updateCheckedCalendars()
+}}}};
+ZmCalendarApp.prototype.modifyNotify=function(t,e){
+if(!e&&!this._noDefer&&this._deferNotifications("modify",t)){
+return
+}
+AjxDispatcher.run("GetCalController").notifyModify(t)
+};
+ZmCalendarApp.prototype.postNotify=function(e){
+if(this._calController!=null){
+this._calController.notifyComplete()
+}};
+ZmCalendarApp.prototype.handleOp=function(t){
+switch(t){
+case ZmOperation.NEW_APPT:var e=new AjxCallback(this,this._handleLoadNewAppt);
+AjxDispatcher.require(["CalendarCore","Calendar"],false,e,null,true);
+break;
+case ZmOperation.NEW_CALENDAR:var e=new AjxCallback(this,this._handleLoadNewCalendar);
+AjxDispatcher.require(["CalendarCore","Calendar"],false,e,null,true);
+break
+}};
+ZmCalendarApp.prototype._handleLoadNewAppt=function(){
+AjxDispatcher.run("GetCalController").newAppointment(null,null,null,null)
+};
+ZmCalendarApp.prototype._handleLoadNewCalendar=function(){
+appCtxt.getAppViewMgr().popView(true,ZmId.VIEW_LOADING);
+var e=appCtxt.getNewCalendarDialog();
+if(!this._newCalendarCb){
+this._newCalendarCb=new AjxCallback(this,this._newCalendarCallback)
+}
+ZmController.showDialog(e,this._newCalendarCb)
+};
+ZmCalendarApp.prototype.launch=function(t,a){
+var e=new AjxCallback(this,this._handleLoadLaunch,[t,a]);
+AjxDispatcher.require(["CalendarCore","Calendar"],true,e,null,true)
+};
+ZmCalendarApp.prototype._handleLoadLaunch=function(s,h){
+var r=AjxDispatcher.run("GetCalController");
+var t=r._defaultView();
+var n=null;
+s=s||{};
+if(s.qsParams){
+var o=s.qsParams.view;
+if(o){
+var e=ZmCalendarApp.VIEW_FOR_SETTING[o];
+if(e){
+t=e;
+var a=s.qsParams.date;
+if(a){
+a=AjxDateUtil.parseServerDateTime(a);
+if(a&&!isNaN(a)){
+n=new Date((a).setHours(0,0,0,0))
+}}}}}
+if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)){
+this.initResources()
+}
+r.show(t,n);
+if(h){
+h.run()
+}};
+ZmCalendarApp.prototype.showSearchResults=function(t,o,a,e){
+if(o){
+o.run()
+}};
+ZmCalendarApp.prototype.activate=function(t){
+ZmApp.prototype.activate.apply(this,arguments);
+if(appCtxt.get(ZmSetting.CALENDAR_ENABLED)){
+var e=t||appCtxt.get(ZmSetting.CAL_ALWAYS_SHOW_MINI_CAL);
+AjxDispatcher.run("ShowMiniCalendar",e)
+}};
+ZmCalendarApp.prototype.showMiniCalendar=function(e,t){
+var a=AjxDispatcher.run("GetCalController").getMiniCalendar(t);
+a.setSkipNotifyOnPage(e&&!this._active);
+if(!this._active){
+a.setSelectionMode(DwtCalendar.DAY)
+}
+appCtxt.getAppViewMgr().showTreeFooter(e)
+};
+ZmCalendarApp.prototype.getListController=function(){
+return this.getCalController()
+};
+ZmCalendarApp.prototype.getCalController=function(){
+if(!this._calController){
+AjxDispatcher.require("CalendarCore");
+this._calController=new ZmCalViewController(this._container,this)
+}
+return this._calController
+};
+ZmCalendarApp.prototype.getReminderController=function(){
+if(!this._reminderController){
+AjxDispatcher.require("CalendarCore");
+var e=appCtxt.getCalManager();
+this._reminderController=e.getReminderController();
+this._reminderController._calController=this.getCalController()
+}
+return this._reminderController
+};
+ZmCalendarApp.prototype.getApptComposeController=function(){
+if(!this._apptController){
+AjxDispatcher.require(["CalendarCore","Calendar","CalendarAppt"]);
+this._apptController=new ZmApptComposeController(this._container,this)
+}
+return this._apptController
+};
+ZmCalendarApp.prototype.initResources=function(){
+if(!this._locations){
+this._locations=new ZmResourceList(ZmCalBaseItem.LOCATION);
+this._locations.isCanonical=true
+}
+if(!this._equipment){
+this._equipment=new ZmResourceList(ZmCalBaseItem.EQUIPMENT);
+this._equipment.isCanonical=true
+}};
+ZmCalendarApp.prototype.loadResources=function(){
+this.initResources();
+if(appCtxt.get(ZmSetting.GAL_ENABLED)){
+var e=new ZmBatchCommand();
+if(!this._locations.isLoaded){
+e.add(new AjxCallback(this._locations,this._locations.load))
+}
+if(!this._equipment.isLoaded){
+e.add(new AjxCallback(this._equipment,this._equipment.load))
+}
+if(e._cmds.length){
+e.run()
+}}};
+ZmCalendarApp.prototype.getLocations=function(){
+this.initResources();
+return this._locations
+};
+ZmCalendarApp.prototype.getEquipment=function(){
+this.initResources();
+return this._equipment
+};
+ZmCalendarApp.prototype._setMiniCalForActiveAccount=function(){};
+ZmCalendarApp.prototype.getCheckedCalendarFolderIds=function(e){
+var n=[];
+if(AjxDispatcher.loaded("CalendarCore")){
+n=this.getCalController().getCheckedCalendarFolderIds(e)
+}else{
+this._folderNames={};
+for(var t=0;
+t<this._deferredFolders.length;
+t++){
+var o=this._deferredFolders[t];
+var a=(o&&o.obj&&o.obj.f)?o.obj.f:"";
+if(a&&(a.indexOf(ZmOrganizer.FLAG_CHECKED)!=-1)){
+if(e&&(o.obj.zid!=null)){
+continue
+}
+n.push(o.obj.id);
+this._folderNames[o.obj.id]=o.obj.name
+}}}
+return n
+};
+ZmCalendarApp.prototype.getCalendarName=function(e){
+return appCtxt.getById(e)?appCtxt.getById(e).name:this._folderNames[e]
+};
+ZmCalendarApp.createMiniCalButton=function(c,s,n,t){
+var h=new DwtButton({
+parent:c}
+);
+h.addDropDownSelectionListener(n);
+h.setData(Dwt.KEY_ID,s);
+if(AjxEnv.isIE){
+h.setSize("20")
+}
+var r=new DwtMenu({
+parent:h,style:DwtMenu.CALENDAR_PICKER_STYLE}
+);
+r.setSize("150");
+r._table.width="100%";
+h.setMenu(r,true);
+var e=new DwtCalendar({
+parent:r}
+);
+e.setData(Dwt.KEY_ID,s);
+e.setSkipNotifyOnPage(true);
+var o=appCtxt.get(ZmSetting.CAL_FIRST_DAY_OF_WEEK)||0;
+e.setFirstDayOfWeek(o);
+e.addSelectionListener(t);
+var l=appCtxt.getSettings().getSetting(ZmSetting.CAL_FIRST_DAY_OF_WEEK);
+if(l){
+var a=new AjxListener(null,ZmCalendarApp._settingChangeListener,e);
+l.addChangeListener(a)
+}
+h.reparentHtmlElement(s);
+delete s;
+return h
+};
+ZmCalendarApp.createReminderButton=function(c,r,u,n){
+var h=new DwtButton({
+parent:c}
+);
+h.addDropDownSelectionListener(u);
+h.setData(Dwt.KEY_ID,r);
+if(AjxEnv.isIE){
+h.setSize("20")
+}
+var l=new DwtMenu({
+parent:h,style:DwtMenu.DROPDOWN_STYLE}
+);
+l.setSize("150");
+l._table.width="100%";
+h.setMenu(l,true);
+var t=[ZmMsg.apptRemindNever,ZmMsg.apptRemindNMinutesBefore,ZmMsg.apptRemindNMinutesBefore,ZmMsg.apptRemindNMinutesBefore,ZmMsg.apptRemindNMinutesBefore,ZmMsg.apptRemindNMinutesBefore,ZmMsg.apptRemindNMinutesBefore,ZmMsg.apptRemindNMinutesBefore,ZmMsg.apptRemindNHoursBefore,ZmMsg.apptRemindNHoursBefore,ZmMsg.apptRemindNHoursBefore,ZmMsg.apptRemindNHoursBefore,ZmMsg.apptRemindNHoursBefore,ZmMsg.apptRemindNDaysBefore,ZmMsg.apptRemindNDaysBefore,ZmMsg.apptRemindNDaysBefore,ZmMsg.apptRemindNDaysBefore,ZmMsg.apptRemindNWeeksBefore,ZmMsg.apptRemindNWeeksBefore];
+var m=[0,1,5,10,15,30,45,60,120,180,240,300,1080,1440,2880,4320,5760,10080,20160];
+var o=[0,1,5,10,15,30,45,60,2,3,4,5,18,1,2,3,4,1,2];
+var s=appCtxt.get(ZmSetting.CAL_REMINDER_WARNING_TIME);
+for(var e=0;
+e<m.length;
+e++){
+var d=ZmCalendarApp.__formatLabel(t[e],o[e]);
+var a=new DwtMenuItem({
+parent:l,style:DwtMenuItem.NO_STYLE}
+);
+a.setText(d);
+a.setData("value",m[e]);
+if(n){
+a.addSelectionListener(n)
+}}
+h.reparentHtmlElement(r);
+delete r;
+return h
+};
+ZmCalendarApp.getReminderSummary=function(e){
+var o=((e%60)==0);
+var a=((e%(60*24))==0);
+var t=((e%(60*24*7))==0);
+if(e==0){
+return ZmMsg.apptRemindNever
+}else{
+if(t){
+return ZmCalendarApp.__formatLabel(ZmMsg.apptRemindNWeeksBefore,e/(60*24*7))
+}else{
+if(a){
+return ZmCalendarApp.__formatLabel(ZmMsg.apptRemindNDaysBefore,e/(60*24))
+}else{
+if(o){
+return ZmCalendarApp.__formatLabel(ZmMsg.apptRemindNHoursBefore,e/60)
+}else{
+return ZmCalendarApp.__formatLabel(ZmMsg.apptRemindNMinutesBefore,e)
+}}}}};
+ZmCalendarApp._settingChangeListener=function(a,t){
+if(t.type!=ZmEvent.S_SETTING){
+return
+}
+var e=t.source;
+if(e.id==ZmSetting.CAL_FIRST_DAY_OF_WEEK){
+a.setFirstDayOfWeek(e.getValue())
+}};
+ZmCalendarApp.prototype._newCalendarCallback=function(s,o,t,a,r){
+var n=appCtxt.getNewCalendarDialog();
+n.popdown();
+var e=appCtxt.getOverviewController();
+e.getTreeController(ZmOrganizer.CALENDAR)._doCreate(s,o,t,a,r)
+};
+ZmCalendarApp.addInviteReplyMenu=function(e){
+var t=[ZmOperation.EDIT_REPLY_ACCEPT,ZmOperation.EDIT_REPLY_TENTATIVE,ZmOperation.EDIT_REPLY_DECLINE];
+var a=new ZmActionMenu({
+parent:e,menuItems:t}
+);
+e.setMenu(a);
+return a
+};
+ZmCalendarApp.addCalViewMenu=function(e){
+var t=[ZmOperation.DAY_VIEW,ZmOperation.WORK_WEEK_VIEW,ZmOperation.WEEK_VIEW,ZmOperation.MONTH_VIEW,ZmOperation.CAL_LIST_VIEW,ZmOperation.SCHEDULE_VIEW];
+var a=new ZmActionMenu({
+parent:e,menuItems:t}
+);
+e.setMenu(a);
+return a
+};
+ZmCalendarApp.__formatLabel=function(t,e){
+t=t||"";
+return t.match(/\{/)?AjxMessageFormat.format(t,e):t
+};
+ZmCalendarApp.parseReminderString=function(c){
+var h={};
+h[ZmMsg.apptRemindNDaysBefore]=ZmCalItem.REMINDER_UNIT_DAYS;
+h[ZmMsg.apptRemindNMinutesBefore]=ZmCalItem.REMINDER_UNIT_MINUTES;
+h[ZmMsg.apptRemindNHoursBefore]=ZmCalItem.REMINDER_UNIT_HOURS;
+h[ZmMsg.apptRemindNWeeksBefore]=ZmCalItem.REMINDER_UNIT_WEEKS;
+c=AjxStringUtil.trim(c);
+var l=c;
+var s=l.replace(/\D/g,"");
+s=AjxStringUtil.trim(s);
+if(s==""){
+return{
+reminderValue:"",reminderUnits:ZmCalItem.REMINDER_NONE}
+}else{
+if(s.indexOf(" ")>=0){
+s=s.split(" ")[0]
+}}
+for(var r in h){
+var e=ZmCalendarApp.__formatLabel(r,s);
+if(e!=""&&e.toLowerCase()==c.toLowerCase()){
+return{
+reminderValue:s,reminderUnits:h[r]}
+}}
+var n=parseInt(s);
+var a={};
+a[ZmCalItem.REMINDER_UNIT_MINUTES]=AjxMsg.minute;
+a[ZmCalItem.REMINDER_UNIT_HOURS]=AjxMsg.hour;
+a[ZmCalItem.REMINDER_UNIT_DAYS]=AjxMsg.day;
+a[ZmCalItem.REMINDER_UNIT_WEEKS]=AjxMsg.week;
+var t=ZmCalItem.REMINDER_UNIT_HOURS;
+for(var o in a){
+if(l.indexOf(a[o])>=0){
+t=o;
+break
+}}
+return{
+reminderValue:n?n:0,reminderUnits:t}
+};
+ZmCalendarApp.convertReminderUnits=function(e,t){
+switch(t){
+case ZmCalItem.REMINDER_UNIT_MINUTES:return e;
+case ZmCalItem.REMINDER_UNIT_HOURS:return e*60;
+case ZmCalItem.REMINDER_UNIT_DAYS:return e*60*24;
+case ZmCalItem.REMINDER_UNIT_WEEKS:return e*60*24*7;
+default:return 0
+}};
+ZmCalendarApp.prototype.updateResourceCache=function(a){
+var t=a.getFullName();
+if(t){
+this._resByName[t.toLowerCase()]=a
+}
+var e=a.getEmail();
+if(e){
+this._resByEmail[e.toLowerCase()]=a
+}};
+ZmCalendarApp.prototype._addSettingsChangeListeners=function(){
+ZmApp.prototype._addSettingsChangeListeners.call(this);
+if(!this._settingsListener){
+this._settingsListener=new AjxListener(this,this._settingsChangeListener)
+}
+var e=appCtxt.getSettings();
+e.getSetting(ZmSetting.CAL_SHOW_CALENDAR_WEEK).addChangeListener(this._settingListener);
+e.addChangeListener(this._settingsListener)
+};
+ZmCalendarApp.prototype._settingsChangeListener=function(o){
+if(o.type!=ZmEvent.S_SETTINGS){
+return
+}
+var n=o.getDetail("settings");
+if(!(n&&n.length)){
+return
+}
+for(var t=0;
+t<n.length;
+t++){
+var a=n[t];
+if(a.id==ZmSetting.CAL_SHOW_CALENDAR_WEEK){
+var e=AjxDispatcher.run("GetCalController").recreateMiniCalendar();
+var s=appCtxt.getCalManager();
+s.highlightMiniCal()
+}}};
+ZmCalendarApp.prototype.showDayView=function(a){
+var t=AjxDispatcher.run("GetCalController");
+var e=t.getMiniCalendar();
+t.setDate(a,0,e.getForceRollOver());
+if(!t._viewVisible){
+t.show(ZmId.VIEW_CAL_DAY)
+}};
+ZmCalendarApp.prototype.getDateToolTip=function(e){
+var t=AjxDispatcher.run("GetCalController");
+return t.getDayToolTipText(e)
+}
+}
+if(AjxPackage.define("zimbraMail.tasks.ZmTasksApp")){
+ZmTasksApp=function(e){
+ZmApp.call(this,ZmApp.TASKS,e)
+};
+ZmEvent.S_TASK=ZmId.ITEM_TASK;
+ZmItem.TASK=ZmEvent.S_TASK;
+ZmOrganizer.TASKS=ZmEvent.S_TASK;
+ZmApp.TASKS=ZmId.APP_TASKS;
+ZmApp.CLASS[ZmApp.TASKS]="ZmTasksApp";
+ZmApp.SETTING[ZmApp.TASKS]=ZmSetting.TASKS_ENABLED;
+ZmApp.LOAD_SORT[ZmApp.TASKS]=45;
+ZmApp.QS_ARG[ZmApp.TASKS]="tasks";
+ZmTasksApp.prototype=new ZmApp;
+ZmTasksApp.prototype.constructor=ZmTasksApp;
+ZmTasksApp.prototype.toString=function(){
+return"ZmTasksApp"
+};
+ZmTasksApp.prototype._defineAPI=function(){
+AjxDispatcher.setPackageLoadFunction("TasksCore",new AjxCallback(this,this._postLoadCore));
+AjxDispatcher.setPackageLoadFunction("Tasks",new AjxCallback(this,this._postLoad,ZmOrganizer.TASKS));
+AjxDispatcher.registerMethod("GetTaskListController",["TasksCore","Tasks"],new AjxCallback(this,this.getTaskListController));
+AjxDispatcher.registerMethod("GetTaskController",["TasksCore","Tasks"],new AjxCallback(this,this.getTaskController))
+};
+ZmTasksApp.prototype._registerOperations=function(){
+ZmOperation.registerOp(ZmId.OP_MOUNT_TASK_FOLDER,{
+textKey:"mountTaskFolder",image:"TaskList"}
+);
+ZmOperation.registerOp(ZmId.OP_NEW_TASK,{
+textKey:"newTask",tooltipKey:"newTaskTooltip",image:"NewTask",shortcut:ZmKeyMap.NEW_TASK}
+);
+ZmOperation.registerOp(ZmId.OP_NEW_TASK_FOLDER,{
+textKey:"newTaskFolder",tooltipKey:"newTaskFolderTooltip",image:"NewTaskList"}
+);
+ZmOperation.registerOp(ZmId.OP_SHARE_TASKFOLDER,{
+textKey:"shareTaskFolder",image:"TaskList"}
+);
+ZmOperation.registerOp(ZmId.OP_PRINT_TASK,{
+textKey:"printTask",image:"Print",shortcut:ZmKeyMap.PRINT}
+,ZmSetting.PRINT_ENABLED);
+ZmOperation.registerOp(ZmId.OP_PRINT_TASKFOLDER,{
+textKey:"printTaskFolder",image:"Print"}
+,ZmSetting.PRINT_ENABLED)
+};
+ZmTasksApp.prototype._registerItems=function(){
+ZmItem.registerItem(ZmItem.TASK,{
+app:ZmApp.TASKS,nameKey:"task",pluralNameKey:"tasks",icon:"TaskList",soapCmd:"ItemAction",itemClass:"ZmTask",node:"task",organizer:ZmOrganizer.TASKS,dropTargets:[ZmOrganizer.TAG,ZmOrganizer.TASKS],searchType:"task",resultsList:AjxCallback.simpleClosure(function(e){
+AjxDispatcher.require("TasksCore");
+return new ZmTaskList(e)
+}
+,this)}
+)
+};
+ZmTasksApp.prototype._registerOrganizers=function(){
+ZmOrganizer.registerOrg(ZmOrganizer.TASKS,{
+app:ZmApp.TASKS,nameKey:"taskFolder",defaultFolder:ZmFolder.ID_TASKS,soapCmd:"FolderAction",firstUserId:256,orgClass:"ZmTaskFolder",orgPackage:"TasksCore",treeController:"ZmTaskTreeController",labelKey:"tasks",itemsKey:"tasks",folderKey:"tasksFolder",hasColor:true,defaultColor:ZmOrganizer.C_NONE,treeType:ZmOrganizer.FOLDER,views:["task"],createFunc:"ZmOrganizer.create",compareFunc:"ZmTaskFolder.sortCompare",deferrable:true,newOp:ZmOperation.NEW_TASK_FOLDER,displayOrder:100,pathInName:true}
+)
+};
+ZmTasksApp.prototype._setupSearchToolbar=function(){
+ZmSearchToolBar.addMenuItem(ZmItem.TASK,{
+msgKey:"tasks",tooltipKey:"searchTasks",icon:"TaskList",shareIcon:"SharedTaskList",setting:ZmSetting.TASKS_ENABLED,id:ZmId.getMenuItemId(ZmId.SEARCH,ZmId.ITEM_TASK)}
+)
+};
+ZmTasksApp.prototype._registerApp=function(){
+var a={};
+a[ZmOperation.NEW_TASK]="task";
+var t={};
+t[ZmOperation.NEW_TASK_FOLDER]="tasksFolder";
+var e={};
+e[ZmKeyMap.NEW_TASK]=ZmOperation.NEW_TASK;
+ZmApp.registerApp(ZmApp.TASKS,{
+mainPkg:"Tasks",nameKey:"tasks",icon:"TaskList",textPrecedence:20,chooserTooltipKey:"goToTasks",defaultSearch:ZmItem.TASK,organizer:ZmOrganizer.TASKS,overviewTrees:[ZmOrganizer.TASKS,ZmOrganizer.SEARCH,ZmOrganizer.TAG],assistants:{
+ZmTaskAssistant:["TasksCore","Tasks"]}
+,newItemOps:a,newOrgOps:t,actionCodes:e,searchTypes:[ZmItem.TASK],gotoActionCode:ZmKeyMap.GOTO_TASKS,newActionCode:ZmKeyMap.NEW_TASK,chooserSort:35,defaultSort:25}
+)
+};
+ZmTasksApp.prototype.postNotify=function(e){
+if(this._checkReplenishListView){
+this._checkReplenishListView._checkReplenish();
+this._checkReplenishListView=null
+}};
+ZmTasksApp.prototype.handleOp=function(a,t){
+switch(a){
+case ZmOperation.NEW_TASK:var e=new AjxCallback(this,this._handleLoadNewTask,[t]);
+AjxDispatcher.require(["TasksCore","Tasks"],false,e,null,true);
+break;
+case ZmOperation.NEW_TASK_FOLDER:var e=new AjxCallback(this,this._handleLoadNewTaskFolder);
+AjxDispatcher.require(["TasksCore","Tasks"],false,e,null,true);
+break
+}};
+ZmTasksApp.prototype._handleLoadNewTask=function(t){
+var e=t?t.folderId:null;
+AjxDispatcher.run("GetTaskController").show((new ZmTask(null,null,e)))
+};
+ZmTasksApp.prototype._handleLoadNewTaskFolder=function(){
+appCtxt.getAppViewMgr().popView(true,ZmId.VIEW_LOADING);
+var e=appCtxt.getNewTaskFolderDialog();
+if(!this._newTaskFolderCb){
+this._newTaskFolderCb=new AjxCallback(this,this._newTaskFolderCallback)
+}
+ZmController.showDialog(e,this._newTaskFolderCb)
+};
+ZmTasksApp.prototype.createNotify=function(n,r){
+if(!n.folder&&!n.task&&!n.link){
+return
+}
+if(!r&&this._deferNotifications("create",n)){
+return
+}
+for(var e in n){
+var s=n[e];
+if(!s){
+continue
+}
+for(var o=0;
+o<s.length;
+o++){
+var a=s[o];
+if(appCtxt.cacheGet(a.id)){
+continue
+}
+if(e=="folder"){
+this._handleCreateFolder(a,ZmOrganizer.TASKS)
+}else{
+if(e=="link"){
+this._handleCreateLink(a,ZmOrganizer.TASKS)
+}else{
+if(e=="task"){
+var t=this.getTaskListController().getList();
+if(t){
+t.notifyCreate(a)
+}}}}}}};
+ZmTasksApp.prototype.launch=function(t,a){
+var e=new AjxCallback(this,this._handleLoadLaunch,a);
+AjxDispatcher.require(["TasksCore","Tasks"],true,e,null,true)
+};
+ZmTasksApp.prototype._handleLoadLaunch=function(e){
+this.search();
+if(e){
+e.run()
+}};
+ZmTasksApp.prototype.showSearchResults=function(a,n,o,t){
+var e=new AjxCallback(this,this._handleLoadShowSearchResults,[a,n,t]);
+AjxDispatcher.require("Tasks",false,e,null,true)
+};
+ZmTasksApp.prototype._handleLoadShowSearchResults=function(t,a,e){
+this.getTaskListController().show(t,e);
+if(a){
+a.run()
+}};
+ZmTasksApp.prototype.getListController=function(){
+return this.getTaskListController()
+};
+ZmTasksApp.prototype.getTaskListController=function(){
+if(!this._taskListController){
+this._taskListController=new ZmTaskListController(this._container,this)
+}
+return this._taskListController
+};
+ZmTasksApp.prototype.getTaskController=function(){
+if(!this._taskController){
+this._taskController=new ZmTaskController(this._container,this)
+}
+return this._taskController
+};
+ZmTasksApp.prototype.newTaskFromMailItem=function(a,e){
+var t=a.subject||"";
+if(a instanceof ZmConv){
+a=a.getFirstHotMsg()
+}
+a.load({
+getHtml:false,callback:new AjxCallback(this,this._msgLoadedCallback,[a,e,t])}
+)
+};
+ZmTasksApp.prototype._msgLoadedCallback=function(n,e,o){
+var a=new ZmTask();
+a.setStartDate(AjxDateUtil.roundTimeMins(e,30));
+a.setFromMailMessage(n,o);
+this.getTaskController().show(a,ZmCalItem.MODE_NEW)
+};
+ZmTasksApp.prototype.search=function(t,e,a,n){
+var o={
+query:(t?t.createQuery():"in:tasks"),types:[ZmItem.TASK],limit:this.getLimit(),searchFor:ZmItem.TASK,callback:n,accountName:(t&&t.account&&t.account.name)};
+appCtxt.getSearchController().search(o)
+};
+ZmTasksApp.prototype._newTaskFolderCallback=function(n,a,t){
+var o=appCtxt.getNewTaskFolderDialog();
+o.popdown();
+var e=appCtxt.getOverviewController();
+e.getTreeController(ZmOrganizer.TASKS)._doCreate(n,a,t)
+}
+}
+if(AjxPackage.define("zimbraMail.abook.ZmContactsApp")){
+ZmContactsApp=function(t,e){
+ZmApp.call(this,ZmApp.CONTACTS,t,e);
+var a=appCtxt.getSettings();
+a.addChangeListener(new AjxListener(this,this._settingsChangeListener));
+this.contactsLoaded={};
+this._contactList={};
+this._initialized=false;
+this._byEmail={};
+this._byIM={};
+this._byPhone={}
+};
+ZmEvent.S_CONTACT=ZmId.ITEM_CONTACT;
+ZmEvent.S_GROUP=ZmId.ITEM_GROUP;
+ZmItem.CONTACT=ZmEvent.S_CONTACT;
+ZmItem.GROUP=ZmEvent.S_GROUP;
+ZmOrganizer.ADDRBOOK=ZmId.ORG_ADDRBOOK;
+ZmApp.CONTACTS=ZmId.APP_CONTACTS;
+ZmApp.CLASS[ZmApp.CONTACTS]="ZmContactsApp";
+ZmApp.SETTING[ZmApp.CONTACTS]=ZmSetting.CONTACTS_ENABLED;
+ZmApp.UPSELL_SETTING[ZmApp.CONTACTS]=ZmSetting.CONTACTS_UPSELL_ENABLED;
+ZmApp.LOAD_SORT[ZmApp.CONTACTS]=30;
+ZmApp.QS_ARG[ZmApp.CONTACTS]="contacts";
+ZmContactsApp.SEARCHFOR_CONTACTS=1;
+ZmContactsApp.SEARCHFOR_GAL=2;
+ZmContactsApp.SEARCHFOR_PAS=3;
+ZmContactsApp.SEARCHFOR_MAX=50;
+ZmContactsApp.prototype=new ZmApp;
+ZmContactsApp.prototype.constructor=ZmContactsApp;
+ZmContactsApp.prototype.toString=function(){
+return"ZmContactsApp"
+};
+ZmContactsApp.prototype._defineAPI=function(){
+AjxDispatcher.setPackageLoadFunction("ContactsCore",new AjxCallback(this,this._postLoadCore));
+AjxDispatcher.setPackageLoadFunction("Contacts",new AjxCallback(this,this._postLoad,ZmOrganizer.ADDRBOOK));
+AjxDispatcher.registerMethod("GetContacts","ContactsCore",new AjxCallback(this,this.getContactList));
+AjxDispatcher.registerMethod("GetContactsForAllAccounts","ContactsCore",new AjxCallback(this,this.getContactListForAllAccounts));
+AjxDispatcher.registerMethod("GetContactListController",["ContactsCore","Contacts"],new AjxCallback(this,this.getContactListController));
+AjxDispatcher.registerMethod("GetContactController",["ContactsCore","Contacts"],new AjxCallback(this,this.getContactController))
+};
+ZmContactsApp.prototype._registerSettings=function(e){
+var e=e||appCtxt.getSettings();
+e.registerSetting("AUTO_ADD_ADDRESS",{
+name:"zimbraPrefAutoAddAddressEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("AUTOCOMPLETE_LIMIT",{
+name:"zimbraContactAutoCompleteMaxResults",type:ZmSetting.T_COS,dataType:ZmSetting.D_INT,defaultValue:20}
+);
+e.registerSetting("AUTOCOMPLETE_SHARE",{
+name:"zimbraPrefShareContactsInAutoComplete",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("AUTOCOMPLETE_SHARED_ADDR_BOOKS",{
+name:"zimbraPrefSharedAddrBookAutoCompleteEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("CONTACTS_VIEW",{
+name:"zimbraPrefContactsInitialView",type:ZmSetting.T_PREF,defaultValue:ZmSetting.CV_LIST,isGlobal:true}
+);
+e.registerSetting("EXPORT",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_NONE}
+);
+e.registerSetting("GAL_AUTOCOMPLETE",{
+name:"zimbraPrefGalAutoCompleteEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("IMPORT",{
+type:ZmSetting.T_PREF,dataType:ZmSetting.D_NONE}
+);
+e.registerSetting("MAX_CONTACTS",{
+name:"zimbraContactMaxNumEntries",type:ZmSetting.T_COS,dataType:ZmSetting.D_INT,defaultValue:0}
+);
+e.registerSetting("NEW_ADDR_BOOK_ENABLED",{
+name:"zimbraFeatureNewAddrBookEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+)
+};
+ZmContactsApp.prototype._registerPrefs=function(){
+var t={
+CONTACTS:{
+title:ZmMsg.addressBook,icon:"ContactsApp",templateId:"prefs.Pages#Contacts",priority:50,precondition:ZmSetting.CONTACTS_ENABLED,prefs:[ZmSetting.AUTO_ADD_ADDRESS,ZmSetting.AUTOCOMPLETE_SHARE,ZmSetting.AUTOCOMPLETE_SHARED_ADDR_BOOKS,ZmSetting.CONTACTS_VIEW,ZmSetting.EXPORT,ZmSetting.GAL_AUTOCOMPLETE,ZmSetting.INITIALLY_SEARCH_GAL,ZmSetting.IMPORT]}};
+for(var e in t){
+ZmPref.registerPrefSection(e,t[e])
+}
+ZmPref.registerPref("AUTO_ADD_ADDRESS",{
+displayName:ZmMsg.autoAddContacts,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("AUTOCOMPLETE_SHARE",{
+displayName:ZmMsg.autocompleteShare,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("AUTOCOMPLETE_SHARED_ADDR_BOOKS",{
+displayName:ZmMsg.autocompleteSharedAddrBooks,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("CONTACTS_VIEW",{
+displayName:ZmMsg.viewContacts,displayContainer:ZmPref.TYPE_SELECT,displayOptions:[ZmMsg.detailedCards,ZmMsg.contactList],options:[ZmSetting.CV_CARDS,ZmSetting.CV_LIST]}
+);
+ZmPref.registerPref("EXPORT",{
+loadFunction:ZmPref.loadCsvFormats,displayContainer:ZmPref.TYPE_EXPORT}
+);
+ZmPref.registerPref("GAL_AUTOCOMPLETE",{
+displayName:ZmMsg.galAutocomplete,displayContainer:ZmPref.TYPE_CHECKBOX,precondition:function(){
+return appCtxt.get(ZmSetting.GAL_AUTOCOMPLETE_ENABLED)&&appCtxt.get(ZmSetting.GAL_ENABLED)
+}}
+);
+ZmPref.registerPref("IMPORT",{
+displayName:ZmMsg.importFromCSV,displayContainer:ZmPref.TYPE_IMPORT}
+);
+ZmPref.registerPref("INITIALLY_SEARCH_GAL",{
+displayName:ZmMsg.initiallySearchGal,displayContainer:ZmPref.TYPE_CHECKBOX,precondition:function(){
+return appCtxt.get(ZmSetting.GAL_ENABLED)&&appCtxt.getActiveAccount().isZimbraAccount
+}}
+)
+};
+ZmContactsApp.prototype._registerOperations=function(){
+ZmOperation.registerOp(ZmId.OP_CONTACT);
+ZmOperation.registerOp(ZmId.OP_EDIT_CONTACT,{
+textKey:"AB_EDIT_CONTACT",image:"Edit",shortcut:ZmKeyMap.EDIT}
+);
+ZmOperation.registerOp(ZmId.OP_MOUNT_ADDRBOOK,{
+textKey:"mountAddrBook",image:"ContactsFolder"}
+);
+ZmOperation.registerOp(ZmId.OP_NEW_ADDRBOOK,{
+textKey:"newAddrBook",tooltipKey:"newAddrBookTooltip",image:"NewContactsFolder"}
+,ZmSetting.NEW_ADDR_BOOK_ENABLED);
+ZmOperation.registerOp(ZmId.OP_NEW_CONTACT,{
+textKey:"newContact",tooltipKey:"newContactTooltip",image:"NewContact",shortcut:ZmKeyMap.NEW_CONTACT}
+,ZmSetting.CONTACTS_ENABLED);
+ZmOperation.registerOp(ZmId.OP_NEW_GROUP,{
+textKey:"newGroup",tooltipKey:"newGroupTooltip",image:"NewGroup"}
+,ZmSetting.CONTACTS_ENABLED);
+ZmOperation.registerOp(ZmId.OP_PRINT_CONTACT,{
+textKey:"printContact",image:"Print",shortcut:ZmKeyMap.PRINT}
+,ZmSetting.PRINT_ENABLED);
+ZmOperation.registerOp(ZmId.OP_PRINT_ADDRBOOK,{
+textKey:"printAddrBook",image:"Print"}
+,ZmSetting.PRINT_ENABLED);
+ZmOperation.registerOp(ZmId.OP_SHARE_ADDRBOOK,{
+textKey:"shareAddrBook",image:"SharedContactsFolder"}
+);
+ZmOperation.registerOp(ZmId.OP_SHOW_ONLY_CONTACTS,{
+textKey:"showOnlyContacts",image:"Contact"}
+,ZmSetting.MIXED_VIEW_ENABLED)
+};
+ZmContactsApp.prototype._registerItems=function(){
+ZmItem.registerItem(ZmItem.CONTACT,{
+app:ZmApp.CONTACTS,nameKey:"contact",pluralNameKey:"contacts",icon:"Contact",soapCmd:"ContactAction",itemClass:"ZmContact",node:"cn",organizer:ZmOrganizer.ADDRBOOK,dropTargets:[ZmOrganizer.TAG,ZmOrganizer.ZIMLET,ZmOrganizer.ADDRBOOK],searchType:"contact",resultsList:AjxCallback.simpleClosure(function(e){
+AjxDispatcher.require("ContactsCore");
+return new ZmContactList(e,e?e.isGalSearch||e.isGalAutocompleteSearch:null)
+}
+,this)}
+);
+ZmItem.registerItem(ZmItem.GROUP,{
+nameKey:"group",icon:"Group",soapCmd:"ContactAction"}
+)
+};
+ZmContactsApp.prototype._registerOrganizers=function(){
+var e={};
+ZmOrganizer.registerOrg(ZmOrganizer.ADDRBOOK,{
+app:ZmApp.CONTACTS,nameKey:"addressBook",defaultFolder:ZmOrganizer.ID_ADDRBOOK,soapCmd:"FolderAction",firstUserId:256,orgClass:"ZmAddrBook",orgPackage:"ContactsCore",treeController:"ZmAddrBookTreeController",labelKey:"addressBooks",itemsKey:"contacts",hasColor:true,defaultColor:ZmOrganizer.C_NONE,orgColor:e,treeType:ZmOrganizer.FOLDER,dropTargets:[ZmOrganizer.ADDRBOOK],views:["contact"],folderKey:"addressBook",mountKey:"mountAddrBook",createFunc:"ZmOrganizer.create",compareFunc:"ZmAddrBook.sortCompare",displayOrder:100,newOp:ZmOperation.NEW_ADDRBOOK,deferrable:true}
+)
+};
+ZmContactsApp.prototype._setupSearchToolbar=function(){
+ZmSearchToolBar.addMenuItem(ZmItem.CONTACT,{
+msgKey:"searchContacts",tooltipKey:"searchPersonalContacts",icon:"ContactsFolder",shareIcon:"SharedContactsFolder",id:ZmId.getMenuItemId(ZmId.SEARCH,ZmId.ITEM_CONTACT)}
+);
+ZmSearchToolBar.addMenuItem(ZmId.SEARCH_GAL,{
+msgKey:"searchGALContacts",tooltipKey:"searchGALContacts",icon:"GAL",setting:ZmSetting.GAL_ENABLED,id:ZmId.getMenuItemId(ZmId.SEARCH,ZmId.SEARCH_GAL)}
+)
+};
+ZmContactsApp.prototype._registerApp=function(){
+var a={};
+a[ZmOperation.NEW_CONTACT]="contact";
+a[ZmOperation.NEW_GROUP]="group";
+var t={};
+t[ZmOperation.NEW_ADDRBOOK]="addressBook";
+var e={};
+e[ZmKeyMap.NEW_CONTACT]=ZmOperation.NEW_CONTACT;
+ZmApp.registerApp(ZmApp.CONTACTS,{
+mainPkg:"Contacts",nameKey:"addressBook",icon:"ContactsApp",textPrecedence:40,chooserTooltipKey:"goToContacts",viewTooltipKey:"displayContacts",defaultSearch:ZmItem.CONTACT,organizer:ZmOrganizer.ADDRBOOK,overviewTrees:[ZmOrganizer.ADDRBOOK,ZmOrganizer.SEARCH,ZmOrganizer.TAG],assistants:{
+ZmContactAssistant:["ContactsCore","Contacts"]}
+,searchTypes:[ZmItem.CONTACT],newItemOps:a,newOrgOps:t,actionCodes:e,gotoActionCode:ZmKeyMap.GOTO_CONTACTS,newActionCode:ZmKeyMap.NEW_CONTACT,trashViewOp:ZmOperation.SHOW_ONLY_CONTACTS,chooserSort:20,defaultSort:40,upsellUrl:ZmSetting.CONTACTS_UPSELL_URL}
+)
+};
+ZmContactsApp.prototype.createNotify=function(s,h){
+if(!s.folder&&!s.cn&&!s.link){
+return
+}
+if(!h&&!this._noDefer&&this._deferNotifications("create",s)){
+return
+}
+for(var t in s){
+var r=s[t];
+if(r&&r.length){
+for(var o=0;
+o<r.length;
+o++){
+var a=r[o];
+if(appCtxt.cacheGet(a.id)){
+continue
+}
+if(t=="folder"){
+this._handleCreateFolder(a,ZmOrganizer.ADDRBOOK)
+}else{
+if(t=="link"){
+this._handleCreateLink(a,ZmOrganizer.ADDRBOOK)
+}else{
+if(t=="cn"){
+var n=AjxDispatcher.run("GetContactListController");
+var e=(n&&n.getFolderId())?n.getList():new ZmContactList(null);
+if(appCtxt.multiAccounts&&e.search&&e.search.folderId!=a.l){
+continue
+}
+e.notifyCreate(a);
+appCtxt.getAutocompleter().clearCache(ZmAutocomplete.AC_TYPE_CONTACT);
+a._handled=true
+}}}}}}};
+ZmContactsApp.prototype.postNotify=function(e){
+if(this._checkReplenishListView){
+this._checkReplenishListView._checkReplenish();
+this._checkReplenishListView=null
+}};
+ZmContactsApp.prototype.handleOp=function(a){
+switch(a){
+case ZmOperation.NEW_CONTACT:case ZmOperation.NEW_GROUP:var t=(a==ZmOperation.NEW_GROUP)?ZmItem.GROUP:null;
+var e=new AjxCallback(this,this._handleLoadNewItem,[t]);
+AjxDispatcher.require(["ContactsCore","Contacts"],false,e,null,true);
+break;
+case ZmOperation.NEW_ADDRBOOK:var e=new AjxCallback(this,this._handleLoadNewAddrBook);
+AjxDispatcher.require(["ContactsCore","Contacts"],false,e,null,true);
+break
+}};
+ZmContactsApp.prototype._handleLoadNewItem=function(t){
+var e=new ZmContact(null,null,t);
+AjxDispatcher.run("GetContactController").show(e)
+};
+ZmContactsApp.prototype._handleLoadNewAddrBook=function(){
+appCtxt.getAppViewMgr().popView(true,ZmId.VIEW_LOADING);
+var e=appCtxt.getNewAddrBookDialog();
+if(!this._newAddrBookCb){
+this._newAddrBookCb=new AjxCallback(this,this._newAddrBookCallback)
+}
+ZmController.showDialog(e,this._newAddrBookCb)
+};
+ZmContactsApp.prototype.activate=function(n){
+ZmApp.prototype.activate.apply(this,arguments);
+if(!this._myCardChecked){
+var t=appCtxt.getSkinHint("myCardSupport");
+if(t){
+var e=appCtxt.getById(ZmOrganizer.ID_ROOT);
+var s={
+id:ZmOrganizer.ID_MY_CARD,name:ZmMsg.myCard,parent:e,tree:e.tree,type:ZmOrganizer.ADDRBOOK,numTotal:1};
+var o=new ZmAddrBook(s);
+e.children.add(o);
+o._notify(ZmEvent.E_CREATE);
+var a=appCtxt.getOverviewController().getOverview(this.getOverviewId()).getTreeItemById(o.id,ZmOrganizer.ADDRBOOK);
+a.enableSelection(true)
+}
+this._myCardChecked=true
+}};
+ZmContactsApp.prototype.launch=function(e,t){
+this._contactsSearch("in:contacts",t)
+};
+ZmContactsApp.prototype._contactsSearch=function(e,o){
+var a={
+searchFor:ZmId.ITEM_CONTACT,query:e,limit:this.getLimit(),types:[ZmId.ITEM_CONTACT],callback:o};
+var t=appCtxt.getSearchController();
+t.searchAllAccounts=false;
+t.search(a)
+};
+ZmContactsApp.prototype.getLimit=function(t){
+var e=appCtxt.get(ZmSetting.PAGE_SIZE);
+return t?e:2*e
+};
+ZmContactsApp.prototype.getInitialSearchType=function(){
+var e=appCtxt.getCurrentList();
+return(e&&(e instanceof ZmContactList)&&e.isGal)?ZmId.SEARCH_GAL:null
+};
+ZmContactsApp.prototype.showSearchResults=function(o,n,a,t){
+var e=new AjxCallback(this,this._handleLoadShowSearchResults,[o,n,a,t]);
+AjxDispatcher.require("Contacts",false,e,null,true)
+};
+ZmContactsApp.prototype._handleLoadShowSearchResults=function(a,o,t,e){
+this.getContactListController().show(a,t,e);
+if(o){
+o.run()
+}};
+ZmContactsApp.prototype.setActive=function(t){
+if(t){
+var e=AjxDispatcher.run("GetContactListController");
+e.show()
+}};
+ZmContactsApp.prototype.isContactListLoaded=function(e){
+var t=(e||appCtxt.getActiveAccount().id);
+return(this._contactList[t]&&this._contactList[t].isLoaded)
+};
+ZmContactsApp.prototype.getContactByEmail=function(s,r){
+if(!s){
+return null
+}
+var n=s.toLowerCase();
+var o=this._byEmail[n];
+if(!o&&this._notFound(n)){
+this._removeAddrFromLookupGroup(n);
+if(r){
+r.run(null)
+}
+return null
+}
+if(o){
+this._removeAddrFromLookupGroup(n);
+o=this._realizeContact(o);
+o._lookupEmail=s;
+if(r){
+r.run(o)
+}
+return o
+}
+if(r){
+var l=null,a=false,e=[];
+if(this._addrLookupHash&&this._addrLookupHash[n]){
+if(this._addrLookupList){
+for(var t=0;
+t<this._addrLookupList.length;
+t++){
+e.push(this._addrLookupList[t])
+}
+l=this._getSearchForAddresses(this._addrLookupList);
+a=true;
+this._addrLookupList=null
+}
+this._addrLookupHash[n].push(r)
+}else{
+l=this._getSearchForAddresses([s])
+}
+if(l){
+var h=new AjxCallback(this,this._handleResponseSearch,[a?e:n,a,r]);
+l.execute({
+callback:h,noBusyOverlay:true}
+)
+}}};
+ZmContactsApp.prototype._handleResponseSearch=function(c,n,u,m){
+var e=m.getResponse();
+var s=e&&e.getResults(ZmItem.CONTACT);
+if(n){
+var l=s.getArray();
+for(var o=0;
+o<l.length;
+o++){
+this._updateLookupCache(l[o])
+}
+for(var o=0;
+o<c.length;
+o++){
+var d=c[o];
+if(!this._byEmail[d]){
+this._updateLookupCache(null,d)
+}
+var h=this._addrLookupHash[d];
+if(h&&h.length){
+for(var t=0;
+t<h.length;
+t++){
+h[t].run(this._byEmail[d])
+}}
+this._removeAddrFromLookupGroup(d)
+}}else{
+var r=s?s.get(0):null;
+this._updateLookupCache(r,c);
+this._byEmail[c]=r;
+u.run(r)
+}};
+ZmContactsApp.prototype.getContactsByEmails=function(t,h){
+var l=[],e=null,s=null;
+for(var a=0,n=t.length;
+a<n;
+a++){
+var r=t[a];
+var o=this.getContactByEmail(r.getAddress());
+if(o||o===null){
+l.push({
+address:r,contact:o}
+)
+}else{
+e=e||[];
+s=s||[];
+e.push(r);
+s.push(r.getAddress())
+}}
+if(!h){
+return l
+}
+if(!e){
+h.run(l);
+return l
+}
+var d=this._getSearchForAddresses(s);
+var c=new AjxCallback(this,this._handleResponseSearchByEmails,[e,l,h]);
+d.execute({
+callback:c}
+)
+};
+ZmContactsApp.prototype._handleResponseSearchByEmails=function(e,u,d,m){
+var t=m.getResponse();
+var h=t&&t.getResults(ZmItem.CONTACT);
+if(!h){
+d.run(u)
+}
+for(var s=0,n=h.size();
+s<n;
+s++){
+var o=h.get(s);
+for(var a=1;
+true;
+a++){
+var l=ZmContact.getAttributeName(ZmContact.F_email,a);
+var r=o.getAttr(l);
+if(!r){
+break
+}
+this._byEmail[r]=o
+}}
+for(var a=0,n=e.length;
+a<n;
+a++){
+var c=e[a];
+var o=this.getContactByEmail(c.getAddress());
+u.push({
+address:c,contact:o}
+)
+}
+d.run(u)
+};
+ZmContactsApp.prototype._getSearchForAddresses=function(a){
+var e;
+if(a.length==1){
+e=["to:",a[0]," not #type:group"]
+}else{
+e=["("];
+for(var t=0,o=a.length;
+t<o;
+t++){
+if(t>0){
+e.push(" OR ")
+}
+e.push("to:");
+e.push(a[t])
+}
+e.push(") not #type:group")
+}
+var n={
+query:e.join(""),limit:a.length*2,types:AjxVector.fromArray([ZmItem.CONTACT])};
+return new ZmSearch(n)
+};
+ZmContactsApp.prototype._notFound=function(e){
+return(e===null||Boolean(this._contactList[appCtxt.getActiveAccount().id]))
+};
+ZmContactsApp.prototype.setAddrLookupGroup=function(t){
+this._addrLookupList=[];
+this._addrLookupHash={};
+if(t&&t.length){
+for(var e=0;
+e<t.length;
+e++){
+if(t[e]){
+var a=t[e].address||t[e];
+a=(a&&AjxUtil.isString(a))?a.toLowerCase():null;
+if(a&&!this._addrLookupHash[a]){
+this._addrLookupList.push(a);
+this._addrLookupHash[a]=[]
+}}}}};
+ZmContactsApp.prototype._removeAddrFromLookupGroup=function(e){
+if(!(this._addrLookupList&&this._addrLookupList.length)){
+return
+}
+AjxUtil.arrayRemove(this._addrLookupList,e);
+delete this._addrLookupHash[e]
+};
+ZmContactsApp.prototype._updateLookupCache=function(t,n){
+if(n){
+this._byEmail[n]=t
+}
+if(t){
+for(var o=1;
+true;
+o++){
+var a=ZmContact.getAttributeName(ZmContact.F_email,o);
+var e=t.getAttr(a);
+if(!e){
+break
+}
+this._byEmail[e.toLowerCase()]=t
+}}};
+ZmContactsApp.prototype.getContactByIMAddress=function(t){
+if(!t){
+return null
+}
+var e=this._byIM[t.toLowerCase()];
+return this._realizeContact(e)
+};
+ZmContactsApp.prototype.getContactByPhone=function(e){
+if(!e){
+return null
+}
+var a=e.replace(/[^\d]/g,"");
+var t=this._phoneToContact[a];
+if(t){
+t.contact=this._realizeContact(t.contact)
+}
+return t
+};
+ZmContactsApp.prototype._realizeContact=function(e){
+var a=appCtxt.getActiveAccount().id;
+var t=this._contactList[a];
+return t?t._realizeContact(e):e
+};
+ZmContactsApp.prototype.updateCache=function(e,t){
+this._updateHash(e,t,ZmContact.EMAIL_FIELDS,this._byEmail);
+if(appCtxt.get(ZmSetting.VOICE_ENABLED)){
+this._updateHash(e,t,ZmContact.PHONE_FIELDS,this._byPhone,true,true)
+}
+if(appCtxt.get(ZmSetting.IM_ENABLED)){
+this._updateHash(e,t,ZmContact.IM_FIELDS,this._byIM)
+}};
+ZmContactsApp.prototype._updateHash=function(h,a,s,n,t,e){
+for(var r=0;
+r<s.length;
+r++){
+var d=s[r];
+for(var o=1;
+true;
+o++){
+var c=ZmContact.getAttributeName(d,o);
+var l=ZmContact.getAttr(h,c);
+if(!l){
+break
+}
+l=e?l.replace(/[^\d]/g,""):l.toLowerCase();
+if(a){
+n[l]=t?h:{
+contact:h,field:c}
+}else{
+delete n[l]
+}}}};
+ZmContactsApp.prototype.getContactListForAllAccounts=function(){
+var e=[];
+var a=appCtxt.accountList.visibleAccounts;
+for(var t=0;
+t<a.length;
+t++){
+if(appCtxt.get(ZmSetting.CONTACTS_ENABLED,null,a[t])){
+e.push(a[t])
+}}
+if(e.length>0){
+this._loadContactsForAccount(e)
+}};
+ZmContactsApp.prototype._loadContactsForAccount=function(e){
+var a=e.shift();
+if(a){
+var t=new AjxCallback(this,this._loadContactsForAccount,[e]);
+this.getContactList(t,null,a)
+}};
+ZmContactsApp.prototype.getContactList=function(r,e,n){
+var a=(n&&n.id)||appCtxt.getActiveAccount().id;
+if(!this._contactList[a]){
+try{
+if(this._parentController){
+this._contactList[a]=this._parentController.getApp(ZmApp.CONTACTS).getContactList()
+}else{
+this._contactList[a]=new ZmContactList(null);
+var s=new AjxCallback(this,this._handleResponseGetContactList,[r]);
+var t=(n&&n.getEmail());
+this._contactList[a].load(s,e,t)
+}
+return this._contactList[a]
+}
+catch(o){
+this._contactList[a]=null;
+throw o
+}}else{
+if(r&&r.run){
+r.run(this._contactList[a])
+}
+return this._contactList[a]
+}};
+ZmContactsApp.prototype._handleResponseGetContactList=function(t){
+var e=appCtxt.getActiveAccount().id;
+this.contactsLoaded[e]=true;
+if(t&&t.run){
+t.run(this._contactList[e])
+}};
+ZmContactsApp.prototype.getGalContactList=function(){
+if(!this._galContactList){
+try{
+this._galContactList=new ZmContactList(null,true);
+this._galContactList.load()
+}
+catch(e){
+this._galContactList=null;
+throw e
+}}
+return this._galContactList
+};
+ZmContactsApp.prototype.createFromVCard=function(a,t){
+var e=new ZmContact(null);
+e.createFromVCard(a,t)
+};
+ZmContactsApp.prototype.getMyCard=function(a){
+if(this._myCard){
+this._myCard=this._realizeContact(this._myCard);
+a.run(this._myCard)
+}else{
+var e=appCtxt.getSearchController();
+var t=new AjxCallback(this,this._handleResponseGetMyCard,[a]);
+e.search({
+query:"#cardOwner:isMyCard",types:[ZmItem.CONTACT],noRender:true,callback:t}
+)
+}};
+ZmContactsApp.prototype._handleResponseGetMyCard=function(o,e){
+var a=e.getResponse();
+var t=a&&a.getResults(ZmItem.CONTACT);
+this._myCard=t?t.get(0):null;
+o.run(this._myCard)
+};
+ZmContactsApp.prototype.getContactListController=function(){
+if(!this._contactListController){
+this._contactListController=new ZmContactListController(this._container,this)
+}
+return this._contactListController
+};
+ZmContactsApp.prototype.getContactController=function(){
+AjxDispatcher.require(["ContactsCore","Contacts"]);
+if(this._contactController==null){
+this._contactController=new ZmContactController(this._container,this)
+}
+return this._contactController
+};
+ZmContactsApp.prototype._newAddrBookCallback=function(n,a,t){
+var o=appCtxt.getNewAddrBookDialog();
+o.popdown();
+var e=appCtxt.getOverviewController();
+e.getTreeController(ZmOrganizer.ADDRBOOK)._doCreate(n,a,t)
+};
+ZmContactsApp.prototype._settingsChangeListener=function(n){
+if(n.type!=ZmEvent.S_SETTINGS){
+return
+}
+if(!this._initialized){
+return
+}
+var o=this.getContactListController();
+if(!o){
+return
+}
+var s=n.getDetail("settings");
+if(!(s&&s.length)){
+return
+}
+var e=o._getViewType();
+for(var t=0;
+t<s.length;
+t++){
+var a=s[t];
+if(a.id==ZmSetting.CONTACTS_VIEW){
+e=o._defaultView()
+}}
+o.switchView(e,force,this._initialized,true)
+}
+}
+if(AjxPackage.define("zimbraMail.im.ZmImApp")){
+ZmImApp=function(e){
+ZmApp.call(this,ZmApp.IM,e);
+delete ZmFolder.HIDE_ID[ZmOrganizer.ID_CHATS];
+this._active=false;
+ZmImApp.INSTANCE=this;
+this._roster=new ZmRoster(this)
+};
+ZmEvent.S_CHAT=ZmId.ITEM_CHAT;
+ZmEvent.S_ROSTER="ROSTER";
+ZmEvent.S_ROSTER_ITEM=ZmId.ITEM_ROSTER;
+ZmEvent.S_ROSTER_TREE_ITEM=ZmId.ORG_ROSTER_TREE_ITEM;
+ZmEvent.S_ROSTER_TREE_GROUP=ZmId.ORG_ROSTER_TREE_GROUP;
+ZmItem.CHAT=ZmEvent.S_CHAT;
+ZmItem.ROSTER_ITEM=ZmEvent.S_ROSTER_ITEM;
+ZmOrganizer.ROSTER_TREE_ITEM=ZmEvent.S_ROSTER_TREE_ITEM;
+ZmOrganizer.ROSTER_TREE_GROUP=ZmEvent.S_ROSTER_TREE_GROUP;
+ZmOrganizer.CONFERENCE_ITEM="CONFERENCE_ITEM";
+ZmItem.F_PRESENCE="PRESENCE";
+ZmItem.F_PRESENCE_CELL="PRESENCE_cell";
+ZmApp.IM=ZmId.APP_IM;
+ZmApp.CLASS[ZmApp.IM]="ZmImApp";
+ZmApp.SETTING[ZmApp.IM]=ZmSetting.IM_ENABLED;
+ZmApp.LOAD_SORT[ZmApp.IM]=47;
+ZmApp.QS_ARG[ZmApp.IM]="chat";
+ZmImApp.BUDDY_SORT_PRESENCE="presence";
+ZmImApp.BUDDY_SORT_NAME="name";
+ZmImApp.prototype=new ZmApp;
+ZmImApp.prototype.constructor=ZmImApp;
+ZmImApp.loggedIn=function(){
+return ZmImApp.INSTANCE&&ZmImApp.INSTANCE._serviceController&&ZmImApp.INSTANCE._serviceController.service.isLoggedIn()&&(appCtxt.get(ZmSetting.IM_PREF_AUTO_LOGIN)||ZmImApp.INSTANCE._roster)
+};
+ZmImApp.prototype.toString=function(){
+return"ZmImApp"
+};
+ZmImApp.prototype._defineAPI=function(){
+AjxDispatcher.registerMethod("GetRoster","IMCore",new AjxCallback(this,this.getRoster))
+};
+ZmImApp.prototype._registerOrganizers=function(){
+ZmOrganizer.registerOrg(ZmOrganizer.CONFERENCE_ITEM,{
+app:ZmApp.IM,nameKey:"imConference",defaultFolder:ZmOrganizer.ID_INBOX,orgPackage:"IM",treeController:"ZmConferenceTreeController",labelKey:"imConferences",itemsKey:"messages",hasColor:false,treeType:ZmOrganizer.CONFERENCE_ITEM,compareFunc:"ZmConferenceService.sortCompare",displayOrder:900}
+)
+};
+ZmImApp.prototype._registerOperations=function(){
+ZmOperation.registerOp(ZmId.OP_IM_NEW_CHAT,{
+textKey:"imNewChat",image:"ImFree2Chat",shortcut:ZmKeyMap.NEW_CHAT}
+);
+ZmOperation.registerOp(ZmId.OP_IM_PRESENCE_AWAY,{
+textKey:"imStatusAway",image:"ImAway"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_PRESENCE_CHAT,{
+textKey:"imStatusChat",image:"ImFree2Chat"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_PRESENCE_DND,{
+textKey:"imStatusDND",image:"ImDnd"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_PRESENCE_INVISIBLE,{
+textKey:"imStatusInvisible",image:"ImInvisible"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_PRESENCE_MENU,{
+textKey:"imPresence"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_PRESENCE_OFFLINE,{
+textKey:"imStatusOffline",image:"Offline"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_PRESENCE_ONLINE,{
+textKey:"imStatusOnline",image:"ImAvailable"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_PRESENCE_XA,{
+textKey:"imStatusExtAway",image:"ImExtendedAway"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_LOGOUT_YAHOO,{
+textKey:"imLogoutYahoo",image:"Logoff"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_PRESENCE_CUSTOM_MRU,{
+image:"ImAvailable"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_PRESENCE_MENU,{
+image:"ImAvailable"}
+);
+ZmOperation.registerOp(ZmId.OP_NEW_ROSTER_GROUP,{
+textKey:"imNewGroup",image:"ImGroup"}
+);
+ZmOperation.registerOp(ZmId.OP_NEW_ROSTER_ITEM,{
+textKey:"newRosterItem",image:"AddBuddy",tooltipKey:"imNewBuddyTooltip"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_CREATE_CONTACT,{
+textKey:"addToNewContact",image:"NewContact"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_ADD_TO_CONTACT,{
+textKey:"addToExistingContact",image:"Edit"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_EDIT_CONTACT,{
+textKey:"editContact",image:"Edit"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_TOGGLE_OFFLINE,{
+textKey:"imToggleOffline"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_TOGGLE_BLOCKED,{
+textKey:"imToggleBlocked"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_SORT_BY_PRESENCE,{
+textKey:"imSortListByPresence"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_SORT_BY_NAME,{
+textKey:"imSortListByName"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_PRESENCE_CUSTOM_MSG,{
+textKey:"imCustomStatusMsg",image:"ImAvailable"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_BLOCK_BUDDY,{
+textKey:"imBlock",image:"BlockUser"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_UNBLOCK_BUDDY,{
+textKey:"imUnblock",image:"AllowUser"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_HTML,{
+image:"TextFormat",tooltipKey:"changeEditorMode"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_DELETE_GROUP,{
+image:"Delete",textKey:"del"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_CLOSE_ALL_CHATS,{
+textKey:"imCloseAllChats"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_CLOSE_OTHER_CHATS,{
+textKey:"imCloseOtherChats"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_CLOSE_CHAT,{
+textKey:"imCloseChat"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_BUDDY_ARCHIVE,{
+textKey:"imBuddyArchive",image:"ChatFolder"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_BUDDY_LIST,{
+textKey:"buddyList",image:"ImGroup"}
+);
+ZmOperation.registerOp(ZmId.OP_IM_INVITE,{
+textKey:"imInvitation",image:"AllowUser"}
+)
+};
+ZmImApp.prototype._registerItems=function(){
+ZmItem.registerItem(ZmItem.CHAT,{
+app:ZmApp.IM,nameKey:"chat",icon:"ImStartChat",soapCmd:"ItemAction",itemClass:"ZmChat",node:"chat",organizer:ZmOrganizer.ROSTER,searchType:"chat"}
+)
+};
+ZmImApp.prototype._registerApp=function(){
+var t={};
+t[ZmOperation.IM_NEW_CHAT]="chat";
+var e={};
+e[ZmKeyMap.NEW_CHAT]=ZmOperation.IM_NEW_CHAT;
+e[ZmKeyMap.NEW_ROSTER_ITEM]=ZmOperation.NEW_ROSTER_ITEM;
+e[ZmKeyMap.PRESENCE_MENU]=ZmOperation.IM_PRESENCE_MENU;
+ZmApp.registerApp(ZmApp.IM,{
+mainPkg:"IM",defaultSort:50,newItemOps:t,actionCodes:e}
+)
+};
+ZmImApp.prototype._registerSettings=function(e){
+e=e||appCtxt.getSettings();
+e.registerSetting("IM_PREF_NOTIFY_SOUNDS",{
+name:"zimbraPrefIMSoundsEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("IM_PREF_FLASH_BROWSER",{
+name:"zimbraPrefIMFlashTitle",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("IM_PREF_DESKTOP_ALERT",{
+name:"zimbraPrefIMToasterEnabled",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("IM_PREF_INSTANT_NOTIFY",{
+name:"zimbraPrefIMInstantNotify",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("IM_PREF_AUTO_LOGIN",{
+name:"zimbraPrefIMAutoLogin",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false}
+);
+e.registerSetting("IM_PREF_NOTIFY_PRESENCE",{
+name:"zimbraPrefIMNotifyPresence",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("IM_PREF_NOTIFY_STATUS",{
+name:"zimbraPrefIMNotifyStatus",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("IM_PREF_LOGCHATS_ENABLED",{
+name:"zimbraPrefIMLogChats",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("IM_PREF_REPORT_IDLE",{
+name:"zimbraPrefIMReportIdle",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("IM_PREF_IDLE_TIMEOUT",{
+name:"zimbraPrefIMIdleTimeout",type:ZmSetting.T_PREF,dataType:ZmSetting.D_INT,defaultValue:10}
+);
+e.registerSetting("IM_PREF_IDLE_STATUS",{
+name:"zimbraPrefIMIdleStatus",type:ZmSetting.T_PREF,dataType:ZmSetting.D_STRING,defaultValue:"xa"}
+);
+e.registerSetting("IM_CUSTOM_STATUS_MRU",{
+name:"zimbraPrefIMCustomStatusMessage",type:ZmSetting.T_PREF,dataType:ZmSetting.D_LIST}
+);
+e.registerSetting("IM_PREF_BUDDY_SORT",{
+name:"zimbraPrefIMBuddyListSort",type:ZmSetting.T_PREF,dataType:ZmSetting.D_STRING,defaultValue:ZmImApp.BUDDY_SORT_NAME,isImplicit:true}
+);
+e.registerSetting("IM_PREF_HIDE_OFFLINE",{
+name:"zimbraPrefIMHideOfflineBuddies",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false,isImplicit:true}
+);
+e.registerSetting("IM_PREF_HIDE_BLOCKED",{
+name:"zimbraPrefIMHideBlockedBuddies",type:ZmSetting.T_PREF,dataType:ZmSetting.D_BOOLEAN,defaultValue:false,isImplicit:true}
+);
+e.registerSetting("IM_YAHOO_ID",{
+name:"zimbraPrefIMYahooId",type:ZmSetting.T_PREF,dataType:ZmSetting.D_STRING,defaultValue:""}
+);
+var t=new AjxListener(this,this._onSettingChange);
+e.getSetting(ZmSetting.IM_PREF_INSTANT_NOTIFY).addChangeListener(t);
+e.getSetting(ZmSetting.IM_PREF_REPORT_IDLE).addChangeListener(t);
+e.getSetting(ZmSetting.IM_PREF_IDLE_TIMEOUT).addChangeListener(t)
+};
+ZmImApp.prototype._registerPrefs=function(){
+var t={
+IM:{
+title:ZmMsg.im,icon:"ImStartChat",templateId:"prefs.Pages#IM",priority:90,precondition:ZmSetting.IM_ENABLED,prefs:[ZmSetting.IM_PREF_INSTANT_NOTIFY,ZmSetting.IM_PREF_AUTO_LOGIN,ZmSetting.IM_PREF_FLASH_BROWSER,ZmSetting.IM_PREF_DESKTOP_ALERT,ZmSetting.IM_PREF_NOTIFY_PRESENCE,ZmSetting.IM_PREF_NOTIFY_STATUS,ZmSetting.IM_PREF_LOGCHATS_ENABLED,ZmSetting.IM_PREF_REPORT_IDLE,ZmSetting.IM_PREF_IDLE_TIMEOUT,ZmSetting.IM_PREF_IDLE_STATUS,ZmSetting.IM_PREF_NOTIFY_SOUNDS]}};
+for(var e in t){
+ZmPref.registerPrefSection(e,t[e])
+}
+ZmPref.registerPref("IM_PREF_NOTIFY_SOUNDS",{
+displayName:ZmMsg.playSound,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("IM_PREF_INSTANT_NOTIFY",{
+displayName:ZmMsg.imPrefInstantNotify,displayContainer:ZmPref.TYPE_CHECKBOX,precondition:function(){
+return appCtxt.get(ZmSetting.INSTANT_NOTIFY)&&ZmImApp.INSTANCE.getServiceController().capabilities[ZmImServiceController.INSTANT_NOTIFY]
+}}
+);
+ZmPref.registerPref("IM_PREF_AUTO_LOGIN",{
+displayName:ZmMsg.imPrefAutoLogin,displayContainer:ZmPref.TYPE_CHECKBOX,precondition:function(){
+return ZmImApp.INSTANCE.getServiceController().capabilities[ZmImServiceController.AUTO_LOGIN_PREF]
+}}
+);
+ZmPref.registerPref("IM_PREF_FLASH_BROWSER",{
+displayName:ZmMsg.flashBrowser,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("IM_PREF_DESKTOP_ALERT",{
+displayName:ZmMsg.showPopupBrowserPlus,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("IM_PREF_NOTIFY_PRESENCE",{
+displayName:ZmMsg.imPrefNotifyPresence,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("IM_PREF_NOTIFY_STATUS",{
+displayName:ZmMsg.imPrefNotifyStatus,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("IM_PREF_LOGCHATS_ENABLED",{
+displayName:ZmMsg.imPrefLogChats,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("IM_PREF_REPORT_IDLE",{
+displayName:ZmMsg.imPrefReportIdle,displayContainer:ZmPref.TYPE_CHECKBOX}
+);
+ZmPref.registerPref("IM_PREF_IDLE_TIMEOUT",{
+displayName:ZmMsg.imPrefIdleTimeout,displayContainer:ZmPref.TYPE_SELECT,displayOptions:[ZmMsg.imPrefIdleTimeoutMinutes,ZmMsg.imPrefIdleTimeoutMinutes,ZmMsg.imPrefIdleTimeoutMinutes,ZmMsg.imPrefIdleTimeoutMinutes,ZmMsg.imPrefIdleTimeoutMinutes,ZmMsg.imPrefIdleTimeoutMinutes],options:[1,5,10,20,30,60],precondition:ZmSetting.IM_PREF_REPORT_IDLE}
+);
+ZmPref.registerPref("IM_PREF_IDLE_STATUS",{
+displayName:ZmMsg.imPrefIdleStatus,displayContainer:ZmPref.TYPE_SELECT,displayOptions:[ZmMsg.imStatusAway,ZmMsg.imStatusExtAway,ZmMsg.imStatusOffline],options:["away","xa","offline"],precondition:ZmSetting.IM_PREF_REPORT_IDLE}
+)
+};
+ZmImApp.prototype._onSettingChange=function(e){
+if(e.type!=ZmEvent.S_SETTING){
+return
+}
+var a=e.source.id;
+var t=appCtxt.get(a);
+if(a==ZmSetting.IM_PREF_INSTANT_NOTIFY&&appCtxt.get(ZmSetting.INSTANT_NOTIFY)){
+appCtxt.getAppController().setInstantNotify(t)
+}else{
+if(this._roster&&a==ZmSetting.IM_PREF_REPORT_IDLE){
+if(!t){
+this._roster._idleTimer.kill()
+}else{
+this._roster._idleTimer.resurrect(appCtxt.get(ZmSetting.IM_PREF_IDLE_TIMEOUT))
+}}else{
+if(this._roster&&a==ZmSetting.IM_PREF_IDLE_TIMEOUT){
+this._roster._idleTimer.timeout=parseInt(t)*60*1000
+}}}};
+ZmImApp.prototype.refresh=function(){
+delete this._lastSeq;
+if(this._serviceController&&this._serviceController.service.isLoggedIn()){
+this._roster.refresh()
+}};
+ZmImApp.prototype.handleOp=function(e){
+switch(e){
+case ZmOperation.IM_NEW_CHAT:this.prepareVisuals();
+this.getImController()._imNewChatListener();
+break;
+case ZmOperation.NEW_ROSTER_ITEM:this.prepareVisuals();
+this.getImController()._newRosterItemListener();
+break;
+case ZmOperation.IM_PRESENCE_MENU:if(this._presenceButton){
+this._presenceButton.popup()
+}
+break
+}};
+ZmImApp.prototype.postNotify=function(e){
+if(e.im){
+if(!this._lastSeq||(e.seq>this._lastSeq)){
+this._lastSeq=e.seq;
+AjxDispatcher.run("GetRoster").pushNotification(e.im)
+}}};
+ZmImApp.prototype.addComponents=function(e){
+this._taskbarController=new ZmTaskbarController(e)
+};
+ZmImApp.prototype.startup=function(){
+if(appCtxt.get(ZmSetting.IM_PREF_AUTO_LOGIN)){
+AjxTimedAction.scheduleAction(new AjxTimedAction(this,this._autoLogin),1000)
+}};
+ZmImApp.prototype.login=function(e){
+this.getServiceController().login(e)
+};
+ZmImApp.prototype._autoLogin=function(){
+var e=new AjxCallback(this,this._postLoadAutoLogin);
+AjxDispatcher.require(["IMCore"],true,e)
+};
+ZmImApp.prototype._postLoadAutoLogin=function(){
+this.login({
+auto:true}
+)
+};
+ZmImApp.prototype.getImController=function(){
+if(!this._imController){
+AjxDispatcher.require(["IMCore","IM"]);
+this._imController=new ZmImController()
+}
+return this._imController
+};
+ZmImApp.prototype.isActive=function(){
+return this._active
+};
+ZmImApp.prototype.getRoster=function(){
+return this._roster
+};
+ZmImApp.prototype.hasRoster=function(){
+return !!this._roster
+};
+ZmImApp.prototype.getServiceController=function(){
+if(!window.ZmImServiceController||!this._serviceController){
+AjxDispatcher.require(["IMCore"]);
+var e=this.getRoster();
+this._serviceController=new ZmZimbraImServiceController(e)
+}
+return this._serviceController
+};
+ZmImApp.prototype.getService=function(){
+return this.getServiceController().service
+};
+ZmImApp.prototype.getAutoCompleteGroups=function(){
+return new ZmRosterTreeGroups(this.getRoster())
+};
+ZmImApp.prototype.prepareVisuals=function(){
+AjxDispatcher.require(["IMCore","IM"])
+};
+ZmImApp._NEW_IM="NEW_IM";
+ZmImApp._NEW_BUDDY_FROM_IM_ADDRESS="NEW_BUDDY_FROM_IM_ADDRESS";
+ZmImApp._NEW_BUDDY="NEW_BUDDY";
+ZmImApp.updateImMenuItemByContact=function(s,e,t){
+var n=ZmImApp._updateImMenuItemByLogin(s);
+if(n){
+return
+}
+var o=e.getBuddy();
+if(o){
+ZmImApp._updateImMenuItemByBuddy(s,o);
+return
+}
+var r=e.getIMAddress();
+if(r){
+s.setText(ZmImApp._getNewBuddyText(e.getFullName()));
+s.setImage("NewContact");
+s._imData={
+op:ZmImApp._NEW_BUDDY_FROM_IM_ADDRESS,contact:e,imAddress:r};
+return
+}
+var a=t&&t.getName()?t.getName():e.getFullName();
+s.setText(ZmImApp._getNewBuddyText(a));
+s.setImage("NewContact");
+s._imData={
+op:ZmImApp._NEW_BUDDY,address:t,name:a}
+};
+ZmImApp.updateImMenuItemByAddress=function(n,e,a,h){
+var o=ZmImApp._updateImMenuItemByLogin(n);
+if(o){
+if(h){
+h.run()
+}
+return
+}
+var t=AjxDispatcher.run("GetRoster").getRosterItem(e.getAddress());
+if(t){
+ZmImApp._updateImMenuItemByBuddy(n,t);
+if(h){
+h.run()
+}
+return
+}
+var r=appCtxt.getApp(ZmApp.CONTACTS);
+if(r){
+if(h){
+var s=new AjxCallback(null,ZmImApp.handleResponseGetContact,[n,e,a,h]);
+r.getContactByEmail(e.getAddress(),s)
+}
+return true
+}else{
+ZmImApp.handleResponseGetContact(n,e,a)
+}};
+ZmImApp.handleResponseGetContact=function(o,t,a,n,e){
+if(e){
+ZmImApp.updateImMenuItemByContact(o,e,t)
+}else{
+if(a){
+o.setText(ZmImApp._getNewBuddyText(t.getName()||t.getAddress()));
+o.setImage("NewContact");
+o._imData={
+op:ZmImApp._NEW_BUDDY,address:t,name:t.getName()}
+}}
+if(n){
+n.run()
+}};
+ZmImApp.getImMenuItemListener=function(){
+ZmImApp._imMenuItemListenerObj=ZmImApp._imMenuItemListenerObj||new AjxListener(null,ZmImApp._imMenuItemListener);
+return ZmImApp._imMenuItemListenerObj
+};
+ZmImApp._updateImMenuItemByBuddy=function(t,e){
+ZmImApp._newChatFormat=ZmImApp._newChatFormat||new AjxMessageFormat(ZmMsg.imNewChatName);
+t.setText(ZmImApp._newChatFormat.format(e.getDisplayName()));
+t.setImage(e.getPresence().getIcon());
+t._imData={
+op:ZmImApp._NEW_IM,buddy:e}
+};
+ZmImApp._updateImMenuItemByLogin=function(e){
+if(!ZmImApp.loggedIn()){
+e.setText(ZmMsg.newIM);
+e.setImage("ImStartChat");
+e.setEnabled(false);
+e._imData=null;
+return true
+}
+e.setEnabled(true);
+return false
+};
+ZmImApp._getNewBuddyText=function(e){
+ZmImApp._newBuddyFormat=ZmImApp._newBuddyFormat||new AjxMessageFormat(ZmMsg.imNewBuddy);
+return ZmImApp._newBuddyFormat.format(e)
+};
+ZmImApp._imMenuItemListener=function(t){
+ZmImApp.INSTANCE.prepareVisuals();
+var e=t.dwtObj._imData;
+if(e){
+switch(e.op){
+case ZmImApp._NEW_IM:ZmTaskbarController.INSTANCE.chatWithRosterItem(e.buddy);
+break;
+case ZmImApp._NEW_BUDDY_FROM_IM_ADDRESS:var o=ZmImAddress.parse(e.imAddress);
+var a=o?{
+address:o.screenName,name:e.contact.getFullName(),service:o.service}
+:{};
+ZmImApp.INSTANCE.getImController()._newRosterItemListener(a);
+break;
+case ZmImApp._NEW_BUDDY:a={
+address:e.address?e.address.getAddress():null,name:e.name};
+ZmImApp.INSTANCE.getImController()._newRosterItemListener(a);
+break
+}}}
+}
+if(AjxPackage.define("zimbraMail.notebook.ZmNotebookApp")){
+ZmNotebookApp=function(t,e){
+ZmApp.call(this,ZmApp.NOTEBOOK,t,e)
+};
+ZmEvent.S_PAGE=ZmId.ITEM_PAGE;
+ZmEvent.S_DOCUMENT=ZmId.ITEM_DOCUMENT;
+ZmEvent.S_NOTEBOOK=ZmId.ORG_NOTEBOOK;
+ZmItem.PAGE=ZmEvent.S_PAGE;
+ZmItem.DOCUMENT=ZmEvent.S_DOCUMENT;
+ZmOrganizer.NOTEBOOK=ZmEvent.S_NOTEBOOK;
+ZmApp.NOTEBOOK=ZmId.APP_NOTEBOOK;
+ZmApp.CLASS[ZmApp.NOTEBOOK]="ZmNotebookApp";
+ZmApp.SETTING[ZmApp.NOTEBOOK]=ZmSetting.NOTEBOOK_ENABLED;
+ZmApp.LOAD_SORT[ZmApp.NOTEBOOK]=60;
+ZmApp.QS_ARG[ZmApp.NOTEBOOK]="documents";
+ZmNotebookApp.prototype=new ZmApp;
+ZmNotebookApp.prototype.constructor=ZmNotebookApp;
+ZmNotebookApp.prototype.toString=function(){
+return"ZmNotebookApp"
+};
+ZmNotebookApp.prototype._notebookCache;
+ZmNotebookApp.prototype._defineAPI=function(){
+AjxDispatcher.setPackageLoadFunction("NotebookCore",new AjxCallback(this,this._postLoadCore));
+AjxDispatcher.setPackageLoadFunction("Notebook",new AjxCallback(this,this._postLoad,ZmOrganizer.NOTEBOOK));
+AjxDispatcher.registerMethod("GetNotebookController",["NotebookCore","Notebook"],new AjxCallback(this,this.getNotebookController));
+AjxDispatcher.registerMethod("GetPageEditController",["NotebookCore","Notebook"],new AjxCallback(this,this.getPageEditController));
+AjxDispatcher.registerMethod("GetNotebookCache",["NotebookCore","Notebook"],new AjxCallback(this,this.getNotebookCache));
+AjxDispatcher.registerMethod("GetPageVersionController",["NotebookCore","Notebook"],new AjxCallback(this,this.getPageVersionController));
+AjxDispatcher.registerMethod("GetNotebookFileController",["NotebookCore","Notebook"],new AjxCallback(this,this.getFileController))
+};
+ZmNotebookApp.prototype._registerOperations=function(){
+ZmOperation.registerOp(ZmId.OP_EDIT_NOTEBOOK_CHROME,{
+textKey:"editNotebookChrome",image:"Edit"}
+);
+ZmOperation.registerOp(ZmId.OP_EDIT_NOTEBOOK_INDEX,{
+textKey:"editNotebookIndex",image:"Edit"}
+);
+ZmOperation.registerOp(ZmId.OP_EDIT_NOTEBOOK_HEADER,{
+textKey:"editNotebookHeader",image:"Edit"}
+);
+ZmOperation.registerOp(ZmId.OP_EDIT_NOTEBOOK_FOOTER,{
+textKey:"editNotebookFooter",image:"Edit"}
+);
+ZmOperation.registerOp(ZmId.OP_EDIT_NOTEBOOK_SIDE_BAR,{
+textKey:"editNotebookSideBar",image:"Edit"}
+);
+ZmOperation.registerOp(ZmId.OP_EDIT_NOTEBOOK_CHROME,{
+textKey:"editNotebookChrome",image:"Edit"}
+);
+ZmOperation.registerOp(ZmId.OP_FORMAT_HTML_SOURCE,{
+textKey:"formatHtmlSource"}
+,ZmSetting.HTML_COMPOSE_ENABLED);
+ZmOperation.registerOp(ZmId.OP_FORMAT_MEDIA_WIKI,{
+textKey:"formatMediaWiki"}
+,ZmSetting.HTML_COMPOSE_ENABLED);
+ZmOperation.registerOp(ZmId.OP_FORMAT_RICH_TEXT,{
+textKey:"formatRichText"}
+,ZmSetting.HTML_COMPOSE_ENABLED);
+ZmOperation.registerOp(ZmId.OP_FORMAT_TWIKI,{
+textKey:"formatTWiki"}
+,ZmSetting.HTML_COMPOSE_ENABLED);
+ZmOperation.registerOp(ZmId.OP_MOUNT_NOTEBOOK,{
+textKey:"mountNotebook",image:"Notebook"}
+,ZmSetting.SHARING_ENABLED);
+ZmOperation.registerOp(ZmId.OP_NEW_NOTEBOOK,{
+textKey:"newNotebook",image:"NewNotebook",tooltipKey:"newNotebookTooltip",shortcut:ZmKeyMap.NEW_NOTEBOOK}
+);
+ZmOperation.registerOp(ZmId.OP_NEW_PAGE,{
+textKey:"newPage",tooltipKey:"createNewPage",image:"NewPage"}
+);
+ZmOperation.registerOp(ZmId.OP_IMPORT_FILE,{
+textKey:"_import",tooltipKey:"importDocs"}
+);
+ZmOperation.registerOp(ZmId.OP_SEND_PAGE,{
+textKey:"send",tooltipKey:"sendPageTT",image:"Send"}
+,ZmSetting.MAIL_ENABLED);
+ZmOperation.registerOp(ZmId.OP_REFRESH,{
+textKey:"refresh",tooltipKey:"refreshTooltip",image:"Refresh"}
+);
+ZmOperation.registerOp(ZmId.OP_SHARE_NOTEBOOK,{
+textKey:"shareNotebook",image:"Notebook"}
+,ZmSetting.SHARING_ENABLED);
+ZmOperation.registerOp(ZmId.OP_REVERT_PAGE,{
+textKey:"revert",tooltipKey:"restorePage",image:"Edit"}
+);
+ZmOperation.registerOp(ZmId.OP_BROWSE_FOLDER,{
+textKey:"browse",image:"Browse"}
+)
+};
+ZmNotebookApp.prototype._registerItems=function(){
+ZmItem.registerItem(ZmItem.PAGE,{
+app:ZmApp.NOTEBOOK,nameKey:"page",icon:"Page",soapCmd:"ItemAction",itemClass:"ZmPage",node:"w",organizer:ZmOrganizer.NOTEBOOK,dropTargets:[ZmOrganizer.TAG],searchType:"wiki",resultsList:AjxCallback.simpleClosure(function(e){
+AjxDispatcher.require("NotebookCore");
+return new ZmPageList(e)
+}
+,this)}
+);
+ZmItem.registerItem(ZmItem.DOCUMENT,{
+app:ZmApp.NOTEBOOK,nameKey:"document",icon:"GenericDoc",soapCmd:"ItemAction",itemClass:"ZmDocument",node:"doc",organizer:ZmOrganizer.NOTEBOOK,dropTargets:[ZmOrganizer.TAG],searchType:"document",resultsList:AjxCallback.simpleClosure(function(e){
+AjxDispatcher.require("NotebookCore");
+return new ZmPageList(e,ZmItem.DOCUMENT)
+}
+,this)}
+)
+};
+ZmNotebookApp.prototype._registerOrganizers=function(){
+ZmOrganizer.registerOrg(ZmOrganizer.NOTEBOOK,{
+app:ZmApp.NOTEBOOK,nameKey:"notebook",defaultFolder:ZmOrganizer.ID_NOTEBOOK,soapCmd:"FolderAction",firstUserId:256,orgClass:"ZmNotebook",orgPackage:"NotebookCore",treeController:"ZmNotebookTreeController",labelKey:"notebooks",itemsKey:"documents",hasColor:true,defaultColor:ZmOrganizer.C_NONE,treeType:ZmOrganizer.FOLDER,views:["wiki"],folderKey:"notebook",mountKey:"mountNotebook",createFunc:"ZmOrganizer.create",compareFunc:"ZmNotebook.sortCompare",newOp:ZmOperation.NEW_NOTEBOOK,displayOrder:100,deferrable:true}
+)
+};
+ZmNotebookApp.prototype._setupSearchToolbar=function(){
+ZmSearchToolBar.addMenuItem(ZmItem.PAGE,{
+msgKey:"searchNotebooks",tooltipKey:"searchForPages",icon:"Notebook",shareIcon:"SharedNotebook",setting:ZmSetting.NOTEBOOK_ENABLED,id:ZmId.getMenuItemId(ZmId.SEARCH,ZmId.ITEM_PAGE)}
+)
+};
+ZmNotebookApp.prototype._registerApp=function(){
+var a={};
+a[ZmOperation.NEW_PAGE]="page";
+var t={};
+t[ZmOperation.NEW_NOTEBOOK]="notebook";
+var e={};
+e[ZmKeyMap.NEW_PAGE]=ZmOperation.NEW_PAGE;
+e[ZmKeyMap.NEW_NOTEBOOK]=ZmOperation.NEW_NOTEBOOK;
+ZmApp.registerApp(ZmApp.NOTEBOOK,{
+mainPkg:"Notebook",nameKey:"documents",icon:"NoteApp",textPrecedence:10,chooserTooltipKey:"goToDocuments",defaultSearch:ZmItem.PAGE,organizer:ZmOrganizer.NOTEBOOK,overviewTrees:[ZmOrganizer.NOTEBOOK,ZmOrganizer.TAG],searchTypes:[ZmItem.PAGE,ZmItem.DOCUMENT],newItemOps:a,newOrgOps:t,actionCodes:e,gotoActionCode:ZmKeyMap.GOTO_NOTEBOOK,newActionCode:ZmKeyMap.NEW_PAGE,chooserSort:50,defaultSort:30}
+)
+};
+ZmNotebookApp.prototype.deleteNotify=function(t,s){
+if(!s&&this._deferNotifications("delete",t)){
+return
+}
+var p=null;
+var f=t.join(",")+",";
+var y=false;
+var n=AjxDispatcher.run("GetNotebookController");
+var c=n.getPage();
+var a=appCtxt.getOverviewController();
+var h=a.getTreeController(ZmOrganizer.NOTEBOOK);
+var r=h.getTreeView(this.getOverviewId());
+if(!r){
+return
+}
+var e=this.getNotebookCache();
+for(var m=0;
+m<t.length;
+m++){
+var u=r.getNextData(t[m]);
+if(u&&f.indexOf(u.id+",")<0){
+p=u
+}
+if(c&&c.id==t[m]){
+y=true
+}}
+for(var m=0;
+m<t.length;
+m++){
+var g=e.getPageById(t[m]);
+if(g){
+e.removePage(g);
+g.notifyDelete()
+}
+var o=appCtxt.getById(t[m]);
+if(o&&(o instanceof ZmNotebook)){
+e.removeItem(o);
+o.notifyDelete()
+}
+appCtxt.cacheRemove(t[m])
+}
+if(y){
+var d={
+folderId:(p?p.id:c.folderId),name:ZmNotebook.PAGE_INDEX};
+n.gotoPage(d)
+}
+for(var m=0;
+m<t.length;
+m++){
+var l=r.getTreeItemById(t[m]);
+if(l){
+l.dispose()
+}
+t[m]=null
+}};
+ZmNotebookApp.prototype.createNotify=function(c,o){
+if(!c.folder&&!c.w&&!c.doc&&!c.link){
+return
+}
+if(!o&&!this._noDefer&&this._deferNotifications("create",c)){
+return
+}
+for(var t in c){
+var h=c[t];
+for(var s=0;
+s<h.length;
+s++){
+var r=h[s];
+if(appCtxt.cacheGet(r.id)){
+continue
+}
+if(t=="folder"){
+this._handleCreateFolder(r,ZmOrganizer.NOTEBOOK)
+}else{
+if(t=="link"){
+this._handleCreateLink(r,ZmOrganizer.NOTEBOOK)
+}else{
+if(t=="w"){
+var e=this.getNotebookCache();
+var l=new ZmPage();
+l.set(r);
+e.putPage(l);
+var a=AjxDispatcher.run("GetNotebookController");
+if(!a.isIframeEnabled()){
+var n=a.getPage();
+if(n&&n.name==ZmNotebook.PAGE_INDEX){
+a.gotoPage(n)
+}}}else{
+if(t=="doc"){
+var e=this.getNotebookCache();
+var d=new ZmDocument();
+d.set(r);
+e.putDocument(d)
+}}}}}}};
+ZmNotebookApp.prototype.modifyNotify=function(s,n){
+if(!s){
+return
+}
+if(!s.w&&!s.doc){
+return
+}
+if(!n&&!this._noDefer&&this._deferNotifications("modify",l)){
+return
+}
+for(var t in s){
+var l=s[t];
+for(var h=0;
+h<l.length;
+h++){
+var d=l[h];
+var o=d.id;
+if(!o){
+continue
+}
+if(t=="w"){
+var e=this.getNotebookCache();
+var c=e.getPageById(o);
+if(!c){
+c=new ZmPage();
+c.set(d);
+e.putPage(c)
+}else{
+c.notifyModify(d);
+c.set(d)
+}
+var a=AjxDispatcher.run("GetNotebookController");
+if(!a.isIframeEnabled()){
+var r=a.getPage();
+if(r&&r.folderId==c.folderId){
+if(r.name==ZmNotebook.PAGE_INDEX||r.name==c.name){
+a.gotoPage(r)
+}}}
+d._handled=true
+}else{
+if(t=="doc"){
+var e=this.getNotebookCache();
+var u=e.getDocumentById(o);
+if(!u){
+u=new ZmDocument();
+u.set(d);
+e.putDocument(u)
+}else{
+u.notifyModify(d);
+u.set(d)
+}
+d._handled=true
+}}}}};
+ZmNotebookApp.prototype.handleOp=function(t){
+switch(t){
+case ZmOperation.NEW_PAGE:var e=new AjxCallback(this,this._handleLoadNewPage);
+AjxDispatcher.require(["NotebookCore","Notebook"],false,e,null,true);
+break;
+case ZmOperation.NEW_NOTEBOOK:var e=new AjxCallback(this,this._handleLoadNewNotebook);
+AjxDispatcher.require(["NotebookCore","Notebook"],false,e,null,true);
+break
+}};
+ZmNotebookApp.prototype._handleLoadNewPage=function(){
+var e=appCtxt.getOverviewController();
+var n=e.getTreeController(ZmOrganizer.NOTEBOOK);
+var t=n.getTreeView(this.getOverviewId());
+var o=t?t.getSelected():null;
+var a=new ZmPage();
+a.folderId=o?o.id:ZmNotebookItem.DEFAULT_FOLDER;
+a.name=this.generateUniqueName(a.folderId);
+AjxDispatcher.run("GetPageEditController").show(a)
+};
+ZmNotebookApp.prototype._handleLoadNewNotebook=function(){
+appCtxt.getAppViewMgr().popView(true,ZmId.VIEW_LOADING);
+var e=appCtxt.getNewNotebookDialog();
+if(!this._newNotebookCb){
+this._newNotebookCb=new AjxCallback(this,this._newNotebookCallback)
+}
+ZmController.showDialog(e,this._newNotebookCb)
+};
+ZmNotebookApp.prototype.launch=function(t,a){
+var e=new AjxCallback(this,this._handleLoadLaunch,[a]);
+AjxDispatcher.require(["NotebookCore","Notebook"],true,e,null,true)
+};
+ZmNotebookApp.prototype._handleLoadLaunch=function(t){
+var e=this.getNotebookController();
+e.show(null,true);
+if(t){
+t.run()
+}};
+ZmNotebookApp.prototype.showSearchResults=function(t,a){
+var e=new AjxCallback(this,this._handleLoadShowSearchResults,[t,a]);
+AjxDispatcher.require(["NotebookCore","Notebook"],false,e,null,true)
+};
+ZmNotebookApp.prototype._handleLoadShowSearchResults=function(e,t){
+this.getFileController().show(e,true);
+if(t){
+t.run()
+}};
+ZmNotebookApp.prototype.setActive=function(e){};
+ZmNotebookApp.prototype.getNotebookController=function(){
+if(!this._notebookController){
+this._notebookController=new ZmNotebookPageController(this._container,this)
+}
+return this._notebookController
+};
+ZmNotebookApp.prototype.getPageEditController=function(){
+if(!this._pageController){
+this._pageController=new ZmPageEditController(this._container,this)
+}
+return this._pageController
+};
+ZmNotebookApp.prototype.getFileController=function(){
+if(!this._fileController){
+this._fileController=new ZmNotebookFileController(this._container,this)
+}
+return this._fileController
+};
+ZmNotebookApp.prototype.getNotebookCache=function(){
+if(!this._notebookCache){
+this._notebookCache=new ZmNotebookCache()
+}
+return this._notebookCache
+};
+ZmNotebookApp.prototype._newNotebookCallback=function(n,a,t){
+var o=appCtxt.getNewNotebookDialog();
+o.popdown();
+var e=appCtxt.getOverviewController();
+e.getTreeController(ZmOrganizer.NOTEBOOK)._doCreate(n,a,t)
+};
+ZmNotebookApp.prototype.generateUniqueName=function(a){
+var t=this.getNotebookCache().getPagesInFolder(a);
+var s=[];
+for(var n in t){
+s.push(t[n].name.toLowerCase())
+}
+s="/"+s.join("/")+"/";
+var e=ZmMsg.defaultPageName.toLowerCase();
+for(var o=1;
+o<100;
+o++){
+if(s.indexOf(["/",e,o,"/"].join(""))==-1){
+return(ZmMsg.defaultPageName+o)
+}}
+return ZmMsg.untitled
+};
+ZmNotebookApp.prototype.getPageVersionController=function(){
+if(!this._versionController){
+this._versionController=new ZmPageVersionController(this._container,this)
+}
+return this._versionController
+}
+}
+if(AjxPackage.define("zimbraMail.briefcase.ZmBriefcaseApp")){
+ZmBriefcaseApp=function(t,e){
+ZmApp.call(this,ZmApp.BRIEFCASE,t,e);
+this._notebookCache=null
+};
+ZmBriefcaseApp.prototype=new ZmApp;
+ZmBriefcaseApp.prototype.constructor=ZmBriefcaseApp;
+ZmEvent.S_PAGE=ZmId.ITEM_PAGE;
+ZmEvent.S_DOCUMENT=ZmId.ITEM_DOCUMENT;
+ZmEvent.S_BRIEFCASE=ZmId.ITEM_BRIEFCASE;
+ZmItem.PAGE=ZmEvent.S_PAGE;
+ZmItem.DOCUMENT=ZmEvent.S_DOCUMENT;
+ZmItem.BRIEFCASE=ZmEvent.S_BRIEFCASE;
+ZmOrganizer.BRIEFCASE=ZmId.ORG_BRIEFCASE;
+ZmApp.BRIEFCASE=ZmId.APP_BRIEFCASE;
+ZmApp.CLASS[ZmApp.BRIEFCASE]="ZmBriefcaseApp";
+ZmApp.SETTING[ZmApp.BRIEFCASE]=ZmSetting.BRIEFCASE_ENABLED;
+ZmApp.LOAD_SORT[ZmApp.BRIEFCASE]=65;
+ZmApp.QS_ARG[ZmApp.BRIEFCASE]="briefcase";
+ZmApp.BUTTON_ID[ZmApp.BRIEFCASE]=ZmId.BRIEFCASE_APP;
+ZmBriefcaseApp.prototype.toString=function(){
+return"ZmBriefcaseApp"
+};
+ZmBriefcaseApp.prototype._defineAPI=function(){
+AjxDispatcher.setPackageLoadFunction("BriefcaseCore",new AjxCallback(this,this._postLoadCore));
+AjxDispatcher.setPackageLoadFunction("Briefcase",new AjxCallback(this,this._postLoad,ZmOrganizer.BRIEFCASE));
+AjxDispatcher.registerMethod("GetBriefcaseController",["BriefcaseCore","Briefcase"],new AjxCallback(this,this.getBriefcaseController))
+};
+ZmBriefcaseApp.prototype._registerOperations=function(){
+ZmOperation.registerOp(ZmId.OP_NEW_BRIEFCASEITEM,{
+textKey:"newBriefcase",image:"NewFolder",tooltipKey:"newBriefcaseTooltip",shortcut:ZmKeyMap.NEW_BRIEFCASEITEM}
+);
+ZmOperation.registerOp(ZmId.OP_NEW_FILE,{
+textKey:"uploadNewFile",tooltipKey:"uploadNewFile",image:"NewPage"}
+);
+ZmOperation.registerOp(ZmId.OP_NEW_PRESENTATION,{
+textKey:"newPresentationBeta",tooltipKey:"newPresentation",image:"Presentation"}
+);
+ZmOperation.registerOp(ZmId.OP_NEW_SPREADSHEET,{
+textKey:"newSpreadSheetBeta",tooltipKey:"newSpreadSheet",image:"ZSpreadSheet"}
+);
+ZmOperation.registerOp(ZmId.OP_NEW_DOC,{
+textKey:"newDocument",tooltipKey:"newDocument",image:"Doc",shortcut:ZmKeyMap.NEW_DOC}
+);
+ZmOperation.registerOp(ZmId.OP_SHARE_BRIEFCASE,{
+textKey:"shareFolder",image:"SharedMailFolder"}
+,ZmSetting.SHARING_ENABLED);
+ZmOperation.registerOp(ZmId.OP_MOUNT_BRIEFCASE,{
+textKey:"mountBriefcase",image:"Notebook"}
+,ZmSetting.SHARING_ENABLED);
+ZmOperation.registerOp(ZmId.OP_OPEN_FILE,{
+textKey:"openFile",tooltipKey:"openFileTooltip",image:"NewPage"}
+);
+ZmOperation.registerOp(ZmId.OP_SAVE_FILE,{
+textKey:"saveFile",tooltipKey:"saveFileTooltip",image:"Save"}
+);
+ZmOperation.registerOp(ZmId.OP_VIEW_FILE_AS_HTML,{
+textKey:"viewAsHtml",tooltipKey:"viewAsHtml",image:"HtmlDoc"}
+);
+ZmOperation.registerOp(ZmId.OP_SEND_FILE,{
+textKey:"sendLink",tooltipKey:"sendLink",image:"Send"}
+);
+ZmOperation.registerOp(ZmId.OP_SEND_FILE_AS_ATT,{
+textKey:"sendAsAttachment",tooltipKey:"sendAsAttachment",image:"Attachment"}
+);
+ZmOperation.registerOp(ZmId.OP_SEND_FILE_MENU,{
+textKey:"send",image:"Send"}
+);
+ZmOperation.registerOp(ZmId.OP_CREATE_SLIDE_SHOW,{
+textKey:"createSlideShow",image:"Presentation"}
+)
+};
+ZmBriefcaseApp.prototype._registerSettings=function(e){
+e=e||appCtxt.getSettings();
+e.registerSetting("SPREADSHEET_ENABLED",{
+name:"zimbraFeatureBriefcaseSpreadsheetEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("SLIDES_ENABLED",{
+name:"zimbraFeatureBriefcaseSlidesEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+);
+e.registerSetting("DOCS_ENABLED",{
+name:"zimbraFeatureBriefcaseDocsEnabled",type:ZmSetting.T_COS,dataType:ZmSetting.D_BOOLEAN,defaultValue:true}
+)
+};
+ZmBriefcaseApp.prototype._registerItems=function(){
+ZmItem.registerItem(ZmItem.BRIEFCASE,{
+app:ZmApp.BRIEFCASE,nameKey:"document",icon:"GenericDoc",soapCmd:"ItemAction",itemClass:"ZmBriefcaseItem",node:"doc",organizer:ZmOrganizer.BRIEFCASE,dropTargets:[ZmOrganizer.TAG,ZmOrganizer.BRIEFCASE],searchType:"document",resultsList:AjxCallback.simpleClosure(function(e){
+AjxDispatcher.require("BriefcaseCore");
+return new ZmBriefcaseItemList(e,ZmItem.BRIEFCASE)
+}
+,this)}
+)
+};
+ZmBriefcaseApp.prototype._registerOrganizers=function(){
+ZmOrganizer.registerOrg(ZmOrganizer.BRIEFCASE,{
+app:ZmApp.BRIEFCASE,nameKey:"folders",defaultFolder:ZmOrganizer.ID_BRIEFCASE,soapCmd:"FolderAction",firstUserId:256,orgClass:"ZmBriefcase",orgPackage:"BriefcaseCore",treeController:"ZmBriefcaseTreeController",labelKey:"folders",itemsKey:"files",treeType:ZmOrganizer.FOLDER,views:["document"],folderKey:"briefcase",mountKey:"mountFolder",createFunc:"ZmOrganizer.create",compareFunc:"ZmBriefcase.sortCompare",deferrable:false,newOp:ZmOperation.NEW_BRIEFCASEITEM,displayOrder:100,hasColor:true,childWindow:true}
+)
+};
+ZmBriefcaseApp.prototype._setupSearchToolbar=function(){
+ZmSearchToolBar.addMenuItem(ZmItem.BRIEFCASE,{
+msgKey:"searchBriefcase",tooltipKey:"searchForFiles",icon:"Folder",shareIcon:"SharedBriefcase",setting:ZmSetting.BRIEFCASE_ENABLED,id:ZmId.getMenuItemId(ZmId.SEARCH,ZmId.ITEM_BRIEFCASE)}
+)
+};
+ZmBriefcaseApp.prototype._registerApp=function(){
+var a={};
+a[ZmOperation.NEW_FILE]="uploadNewFile";
+a[ZmOperation.NEW_DOC]="document";
+var t={};
+t[ZmOperation.NEW_BRIEFCASEITEM]="briefcase";
+var e={};
+e[ZmKeyMap.NEW_FILE]=ZmOperation.NEW_FILE;
+e[ZmKeyMap.NEW_BRIEFCASEITEM]=ZmOperation.NEW_BRIEFCASEITEM;
+e[ZmKeyMap.NEW_PRESENTATION]=ZmOperation.NEW_PRESENTATION;
+e[ZmKeyMap.NEW_SPREADSHEET]=ZmOperation.NEW_SPREADSHEET;
+e[ZmKeyMap.NEW_DOC]=ZmOperation.NEW_DOC;
+ZmApp.registerApp(ZmApp.BRIEFCASE,{
+mainPkg:"Briefcase",nameKey:"briefcase",icon:"Folder",textPrecedence:30,chooserTooltipKey:"gotoBriefcase",defaultSearch:ZmItem.BRIEFCASE,organizer:ZmOrganizer.BRIEFCASE,overviewTrees:[ZmOrganizer.BRIEFCASE,ZmOrganizer.TAG],searchTypes:[ZmItem.BRIEFCASE],newItemOps:a,newOrgOps:t,actionCodes:e,gotoActionCode:ZmKeyMap.GOTO_BRIEFCASE,newActionCode:ZmKeyMap.NEW_FILE,chooserSort:70,defaultSort:60}
+)
+};
+ZmBriefcaseApp.prototype.deleteNotify=function(t,o){
+if(!o&&this._deferNotifications("delete",t)){
+return
+}
+var n=AjxDispatcher.run("GetBriefcaseController");
+for(var e=0;
+e<t.length;
+e++){
+var a=n.getItemById(t[e]);
+if(a){
+a.notifyDelete();
+n.removeItem(a)
+}}};
+ZmBriefcaseApp.prototype.createNotify=function(n,r){
+if(!n.folder&&!n.doc&&!n.link){
+return
+}
+if(!r&&!this._noDefer&&this._deferNotifications("create",n)){
+return
+}
+var h=AjxDispatcher.run("GetBriefcaseController");
+var o=false;
+for(var e in n){
+var s=n[e];
+for(var a=0;
+a<s.length;
+a++){
+var t=s[a];
+if(appCtxt.cacheGet(t.id)){
+continue
+}
+
+if(e=="folder"){
+this._handleCreateFolder(t,ZmOrganizer.BRIEFCASE)
+}else{
+if(e=="link"){
+this._handleCreateLink(t,ZmOrganizer.BRIEFCASE)
+}else{
+if(e=="doc"){
+if(t.l==h._currentFolder){
+o=true
+}}}}}}
+if(o){
+h.reloadFolder()
+}};
+ZmBriefcaseApp.prototype.modifyNotify=function(n,o){
+if(!n.doc){
+return
+}
+if(!o&&!this._noDefer&&this._deferNotifications("modify",n)){
+return
+}
+var a=this.getBriefcaseController();
+var s=false;
+for(var e in n){
+var h=n[e];
+for(var r=0;
+r<h.length;
+r++){
+var l=h[r];
+var t=l.id;
+if(!t){
+continue
+}
+if(e=="doc"){
+var c=a.getItemById(t);
+if(c){
+c.notifyModify(l);
+c.set(l)
+}
+l._handled=true
+}else{
+if(e=="folder"){
+var d=a.getCurrentFolderId();
+if(appCtxt.getById(t)&&(appCtxt.getById(t).nId==d||t==d)){
+s=true;
+l._handled=true
+}}}}}
+if(s){
+a.reloadFolder()
+}};
+ZmBriefcaseApp.prototype.handleOp=function(a){
+switch(a){
+case ZmOperation.NEW_FILE:var e=new AjxCallback(this,this._handleNewItem);
+AjxDispatcher.require(["BriefcaseCore","Briefcase"],false,e,null,true);
+break;
+case ZmOperation.NEW_BRIEFCASEITEM:var e=new AjxCallback(this,this._handleLoadNewBriefcaseItem);
+AjxDispatcher.require(["BriefcaseCore","Briefcase"],false,e,null,true);
+break;
+case ZmOperation.NEW_PRESENTATION:var e=new AjxCallback(this,this.newDoc,[ZmMimeTable.APP_ZIMBRA_SLIDES]);
+AjxDispatcher.require(["BriefcaseCore","Briefcase"],true,e,null);
+break;
+case ZmOperation.NEW_SPREADSHEET:var t=new AjxCallback(this,this.newDoc,[ZmMimeTable.APP_ZIMBRA_SPREADSHEET]);
+AjxDispatcher.require(["BriefcaseCore","Briefcase"],true,t,null);
+break;
+case ZmOperation.NEW_DOC:var t=new AjxCallback(this,this.newDoc,[ZmMimeTable.APP_ZIMBRA_DOC]);
+AjxDispatcher.require(["BriefcaseCore","Briefcase"],true,t,null);
+break
+}};
+ZmBriefcaseApp.prototype._handleNewDoc=function(s){
+AjxDispatcher.require("IM");
+var e=ZmPromptDialog.getInstance();
+var o=new AjxCallback(this,this._newDocOkCallback,[s,e]);
+var n=ZmMsg.briefcaseCreateNewDocument;
+var t=ZmMsg.documentName;
+if(s==ZmOperation.NEW_PRESENTATION){
+n=ZmMsg.briefcaseCreateNewPresentation;
+t=ZmMsg.presentationName
+}
+var a={
+title:n,label:t,callback:o};
+e.popup(a)
+};
+ZmBriefcaseApp.prototype._newDocOkCallback=function(r,c,s){
+var p;
+if(!s.value){
+p=ZmMsg.nameEmpty
+}
+c.popdown();
+if(p){
+var l=appCtxt.getMsgDialog();
+l.reset();
+l.setMessage(p,DwtMessageDialog.CRITICAL_STYLE);
+l.popup()
+}else{
+AjxDispatcher.require("Startup1_1");
+var m=ZmMimeTable.APP_ZIMBRA_DOC;
+switch(r){
+case ZmOperation.NEW_PRESENTATION:m=ZmMimeTable.APP_ZIMBRA_SLIDES;
+break
+}
+var e=appCtxt.getOverviewController();
+var n=e.getTreeController(ZmOrganizer.BRIEFCASE);
+var t=ZmOrganizer.ID_BRIEFCASE;
+if(n){
+var o=n.getTreeView(this.getOverviewId());
+var u=o?o.getSelected():null;
+t=u?u.id:ZmOrganizer.ID_BRIEFCASE
+}
+var d=this.getEditURLForContentType(m)+"?name="+s.value+"&l="+t;
+var a="_newslide"+s.value;
+var f=["width=",(screen.width||640),",","height=",(screen.height||480),",","resizable,toolbar=no,menubar=no,fullscreen=yes,location=no,status=no","fullscreen=yes"].join("");
+var h=open(d,a,f)
+}};
+ZmBriefcaseApp.prototype.newDoc=function(c,t,h){
+var a=appCtxt.getOverviewController();
+var s=a.getTreeController(ZmOrganizer.BRIEFCASE);
+var o=ZmOrganizer.ID_BRIEFCASE;
+if(s){
+var r=s.getTreeView(this.getOverviewId());
+var l=r?r.getSelected():null;
+o=l?l.id:ZmOrganizer.ID_BRIEFCASE
+}
+var e=this.getEditURLForContentType(c)+"?"+(t?"name="+t+"&":"")+"l="+o;
+var n=h||t;
+window.open(e,n)
+};
+ZmBriefcaseApp.prototype.getEditURLForContentType=function(t){
+AjxDispatcher.require("Startup1_1");
+var e="Slides.jsp";
+switch(t){
+case ZmMimeTable.APP_ZIMBRA_SLIDES:e="Slides.jsp";
+break;
+case ZmMimeTable.APP_ZIMBRA_SPREADSHEET:e="SpreadsheetDoc.jsp";
+break;
+case ZmMimeTable.APP_ZIMBRA_DOC:e="Docs.jsp";
+break;
+default:return null
+}
+return(appContextPath+"/public/"+e)
+};
+ZmBriefcaseApp.prototype.isDoclet=function(e){
+var t=e.getContentType();
+switch(t){
+case ZmMimeTable.APP_ZIMBRA_SLIDES:return true;
+default:return false
+}};
+ZmBriefcaseApp.prototype._handleNewItem=function(){
+appCtxt.getAppViewMgr().popView(true,ZmId.VIEW_LOADING);
+var e=new AjxCallback(this,this._handleUploadNewItem);
+this.getBriefcaseController().__popupUploadDialog(e,ZmMsg.uploadFileToBriefcase)
+};
+ZmBriefcaseApp.prototype._handleUploadNewItem=function(t,e){
+var a=this.getBriefcaseController();
+a.refreshFolder()
+};
+ZmBriefcaseApp.prototype._handleLoadNewBriefcaseItem=function(){
+appCtxt.getAppViewMgr().popView(true,ZmId.VIEW_LOADING);
+if(!this._newNotebookCb){
+this._newNotebookCb=new AjxCallback(this,this._newBriefcaseCallback)
+}
+ZmController.showDialog(appCtxt.getNewBriefcaseDialog(),this._newNotebookCb)
+};
+ZmBriefcaseApp.prototype.launch=function(t,a){
+var e=new AjxCallback(this,this._handleLoadLaunch,[a]);
+AjxDispatcher.require(["BriefcaseCore","Briefcase"],true,e,null,true)
+};
+ZmBriefcaseApp.prototype._handleLoadLaunch=function(e){
+this.getBriefcaseController().show(null,true);
+if(e){
+e.run()
+}};
+ZmBriefcaseApp.prototype.showSearchResults=function(t,a){
+var e=new AjxCallback(this,this._handleLoadShowSearchResults,[t,a]);
+AjxDispatcher.require(["BriefcaseCore","Briefcase"],false,e,null,true)
+};
+ZmBriefcaseApp.prototype._handleLoadShowSearchResults=function(e,t){
+this.getBriefcaseController().showFolderContents(e.getResults(ZmItem.MIXED));
+if(t){
+t.run()
+}};
+ZmBriefcaseApp.prototype.setActive=function(e){};
+ZmBriefcaseApp.prototype._newBriefcaseCallback=function(o,a,t){
+appCtxt.getNewBriefcaseDialog().popdown();
+var e=appCtxt.getOverviewController();
+e.getTreeController(ZmOrganizer.BRIEFCASE)._doCreate(o,a,t)
+};
+ZmBriefcaseApp.prototype.getBriefcaseController=function(){
+if(!this._briefcaseController){
+this._briefcaseController=new ZmBriefcaseController(this._container,this)
+}
+return this._briefcaseController
+};
+ZmBriefcaseApp.prototype.createFromAttachment=function(o,a,t){
+var e=new AjxCallback(this,this._handleCreateFromAttachment,[o,a,t]);
+AjxDispatcher.require(["BriefcaseCore","Briefcase"],false,e)
+};
+ZmBriefcaseApp.prototype._handleCreateFromAttachment=function(o,a,t){
+if(this._deferredFolders.length!=0){
+this._createDeferredFolders(ZmApp.BRIEFCASE)
+}
+var n=this._copyToDialog=appCtxt.getChooseFolderDialog();
+var e=new AjxCallback(this,this._chooserCallback,[o,a,t]);
+ZmController.showDialog(n,e,this._getCopyParams(n,o,a))
+};
+ZmBriefcaseApp.prototype._getCopyParams=function(a,t,e){
+return{
+data:{
+msgId:t,partId:e}
+,treeIds:[ZmOrganizer.BRIEFCASE],overviewId:a.getOverviewId(this._name),title:ZmMsg.addToBriefcaseTitle,description:ZmMsg.targetFolder,appName:ZmApp.BRIEFCASE}
+};
+ZmBriefcaseApp.prototype._chooserCallback=function(o,a,e,t){
+var n=new AjxCallback(this,this.handleDuplicateCheck,[o,a,e,t.id]);
+this.getBriefcaseController().getItemsInFolder(t.id,n)
+};
+ZmBriefcaseApp.prototype.handleDuplicateCheck=function(a,h,e,t,l){
+var c=this.getBriefcaseController();
+if(c.isReadOnly(t)){
+ZmOrganizer._showErrorMsg(ZmMsg.errorPermission);
+return
+}
+if(c.isShared(t)){
+if(a.indexOf(":")<0){
+a=appCtxt.getActiveAccount().id+":"+a
+}}
+var s=false;
+if(l instanceof ZmList){
+l=l.getArray()
+}
+for(var n in l){
+var d=l[n];
+if(d.name==e){
+s=true;
+break
+}}
+if(!s){
+var r=new ZmBriefcaseItem();
+r.createFromAttachment(a,h,e,t)
+}else{
+var o=AjxMessageFormat.format(ZmMsg.errorFileAlreadyExists,e);
+ZmOrganizer._showErrorMsg(o)
+}};
+ZmBriefcaseApp.prototype.fixCrossDomainReference=function(t,a){
+var n=AjxStringUtil.parseURL(t);
+if(n.authority!=window.location.host){
+if((a&&t.indexOf(a)>=0)||!a){
+var o=n.protocol+"://"+n.authority;
+var e=window.location.protocol+"//"+window.location.host;
+t=t.replace(o,e)
+}}
+return t
+};
+ZmBriefcaseApp.prototype._createDeferredFolders=function(e){
+AjxPackage.require("BriefcaseCore");
+ZmApp.prototype._createDeferredFolders.call(this,e)
+}
+}
+if(AjxPackage.define("zimbraMail.voicemail.ZmVoiceApp")){
+ZmVoiceApp=function(t,e){
+this.phones=[];
+this._nameToPhone={};
+this.accordionItem=null;
+this.soapInfo={
+method:"SearchVoiceRequest",namespace:"urn:zimbraVoice",response:"SearchVoiceResponse",additional:null};
+this._storeprincipal=null;
+ZmApp.call(this,ZmApp.VOICE,t,e)
+};
+ZmEvent.S_VOICEMAIL=ZmId.APP_VOICE;
+ZmItem.VOICEMAIL=ZmId.ITEM_VOICEMAIL;
+ZmEvent.S_CALL=ZmId.ITEM_CALL;
+ZmItem.CALL=ZmEvent.S_CALL;
+ZmOrganizer.VOICE=ZmEvent.S_VOICEMAIL;
+ZmApp.VOICE="Voice";
+ZmApp.CLASS[ZmApp.VOICE]="ZmVoiceApp";
+ZmApp.SETTING[ZmApp.VOICE]=ZmSetting.VOICE_ENABLED;
+ZmApp.UPSELL_SETTING[ZmApp.VOICE]=ZmSetting.VOICE_UPSELL_ENABLED;
+ZmApp.LOAD_SORT[ZmApp.VOICE]=80;
+ZmApp.QS_ARG[ZmApp.VOICE]="voice";
+ZmVoiceApp.prototype=new ZmApp;
+ZmVoiceApp.prototype.constructor=ZmVoiceApp;
+ZmVoiceApp.prototype.toString=function(){
+return"ZmVoiceApp"
+};
+ZmVoiceApp.prototype._defineAPI=function(){
+AjxDispatcher.setPackageLoadFunction("Voicemail",new AjxCallback(this,this._postLoadCore));
+AjxDispatcher.registerMethod("GetVoiceController","Voicemail",new AjxCallback(this,this.getVoiceController));
+AjxDispatcher.registerMethod("GetCallListController","Voicemail",new AjxCallback(this,this.getCallListController))
+};
+ZmVoiceApp.prototype._registerItems=function(){
+ZmItem.registerItem(ZmItem.VOICEMAIL,{
+app:ZmApp.VOICE,nameKey:"voicemail",pluralNameKey:"voicemails",icon:"Voicemail",soapCmd:"VoiceMsgAction",itemClass:"ZmVoicemail",node:"vm",organizer:ZmOrganizer.VOICE,dropTargets:[ZmOrganizer.VOICE],searchType:"voicemail",resultsList:AjxCallback.simpleClosure(function(e){
+AjxDispatcher.require("Voicemail");
+return new ZmVoiceList(ZmItem.VOICEMAIL,e)
+}
+,this)}
+);
+ZmItem.registerItem(ZmItem.CALL,{
+app:ZmApp.VOICE,nameKey:"call",pluralNameKey:"calls",icon:"Voicemail",soapCmd:"VoiceMsgAction",itemClass:"ZmCall",node:"cl",organizer:ZmOrganizer.VOICE,searchType:"calllog",resultsList:AjxCallback.simpleClosure(function(e){
+AjxDispatcher.require("Voicemail");
+return new ZmVoiceList(ZmItem.CALL,e)
+}
+,this)}
+)
+};
+ZmVoiceApp.prototype._registerOperations=function(){
+ZmOperation.registerOp(ZmId.OP_CHECK_VOICEMAIL,{
+textKey:"checkVoicemail",tooltipKey:"checkVoicemailTooltip"}
+);
+ZmOperation.registerOp(ZmId.OP_CHECK_CALLS,{
+textKey:"checkCalls",tooltipKey:"checkCallsTooltip"}
+);
+ZmOperation.registerOp(ZmId.OP_CALL_MANAGER,{
+textKey:"callManager",tooltipKey:"callManagerTooltip",image:"CallManager",shortcut:ZmKeyMap.CALL_MANAGER}
+);
+ZmOperation.registerOp(ZmId.OP_MARK_HEARD,{
+textKey:"markAsHeard",image:"MarkAsHeard",shortcut:ZmKeyMap.MARK_HEARD}
+);
+ZmOperation.registerOp(ZmId.OP_MARK_UNHEARD,{
+textKey:"markAsUnheard",image:"MarkAsUnheard",shortcut:ZmKeyMap.MARK_UNHEARD}
+);
+ZmOperation.registerOp(ZmId.OP_VIEW_BY_DATE,{
+textKey:"viewByDate"}
+);
+ZmOperation.registerOp(ZmId.OP_REPLY_BY_EMAIL,{
+textKey:"replyByEmail",tooltipKey:"replyByEmailTooltip",image:"Reply"}
+);
+ZmOperation.registerOp(ZmId.OP_FORWARD_BY_EMAIL,{
+textKey:"forwardByEmail",tooltipKey:"forwardByEmailTooltip",image:"Forward"}
+);
+ZmOperation.registerOp(ZmId.OP_DOWNLOAD_VOICEMAIL,{
+textKey:"downloadVoicemail",tooltipKey:"downloadVoicemailTooltip",image:"Save"}
+)
+};
+ZmVoiceApp.prototype._registerOrganizers=function(){
+ZmOrganizer.registerOrg(ZmOrganizer.VOICE,{
+app:ZmApp.VOICE,nameKey:"voicemailFolder",defaultFolder:0,firstUserId:256,orgClass:"ZmVoiceFolder",orgPackage:"Voicemail",treeController:"ZmVoiceTreeController",labelKey:"voicemail",itemsKey:"messages",views:["voicemail"],createFunc:"ZmOrganizer.create",compareFunc:"ZmVoiceFolder.sortCompare",displayOrder:100,deferrable:false}
+)
+};
+ZmVoiceApp.prototype._registerApp=function(){
+ZmApp.registerApp(ZmApp.VOICE,{
+mainPkg:"Voicemail",nameKey:"voice",icon:"VoicemailApp",qsArg:"voicemail",chooserTooltipKey:"goToVoice",defaultSearch:ZmId.SEARCH_MAIL,overviewTrees:[ZmOrganizer.VOICE],searchTypes:[ZmItem.VOICEMAIL],gotoActionCode:ZmKeyMap.GOTO_VOICE,chooserSort:15,defaultSort:15,upsellUrl:ZmSetting.VOICE_UPSELL_URL}
+)
+};
+ZmVoiceApp.prototype._registerPrefs=function(){};
+ZmVoiceApp.prototype._registerSettings=function(e){
+e=e||appCtxt.getSettings();
+e.registerSetting("VOICE_PAGE_SIZE",{
+name:"zimbraPrefVoiceItemsPerPage",type:ZmSetting.T_PREF,dataType:ZmSetting.D_INT,defaultValue:25}
+);
+e.registerSetting("VOICE_PAGE_SIZE_MAX",{
+name:"zimbraMaxVoiceItemsPerPage",type:ZmSetting.T_COS,dataType:ZmSetting.D_INT,defaultValue:100}
+)
+};
+ZmVoiceApp.prototype.deleteNotify=function(e){
+this._handleDeletes(e)
+};
+ZmVoiceApp.prototype.createNotify=function(e){
+this._handleCreates(e)
+};
+ZmVoiceApp.prototype.modifyNotify=function(e){
+this._handleModifies(e)
+};
+ZmVoiceApp.prototype.getOverviewId=function(){
+var e=this.accordionItem?this.accordionItem.data.phone.name:"";
+return[this._name,e].join(":")
+};
+ZmVoiceApp.prototype.getOverviewContainer=function(){
+if(!this._overviewContainer){
+var e=[ZmApp.OVERVIEW_ID,this._name].join("_");
+var t={
+appName:this._name,containerId:e,posStyle:Dwt.ABSOLUTE_STYLE,parent:appCtxt.getShell(),controller:this._opc};
+t.id=ZmId.getOverviewContainerId(e);
+this._overviewContainer=this._opc._overviewContainer[e]=new ZmVoiceOverviewContainer(t)
+}
+return this._overviewContainer
+};
+ZmVoiceApp.prototype.getVoiceInfo=function(r,e,t){
+if(!this.phones.length){
+if(!this._gettingVoiceInfo){
+var a=AjxSoapDoc.create("GetVoiceInfoRequest","urn:zimbraVoice");
+var s=new AjxCallback(this,this._handleResponseVoiceInfo);
+var o=new AjxCallback(this,this._handleErrorResponseVoiceInfo);
+var n={
+soapDoc:a,asyncMode:true,noBusyOverlay:t,callback:s,errorCallback:o};
+appCtxt.getAppController().sendRequest(n);
+this._gettingVoiceInfo=true
+}
+if(r){
+this._voiceInfoCallbacks=this._voiceInfoCallbacks||[];
+this._voiceInfoCallbacks.push(r)
+}
+if(e){
+this._voiceInfoErrorCallbacks=this._voiceInfoErrorCallbacks||[];
+this._voiceInfoErrorCallbacks.push(e)
+}}else{
+if(r){
+r.run()
+}}};
+ZmVoiceApp.prototype._handleResponseVoiceInfo=function(e){
+var t=new AjxCallback(this,this._handleResponseVoiceInfo2,[e]);
+AjxPackage.require({
+name:"Voicemail",callback:t}
+)
+};
+ZmVoiceApp.prototype._handleResponseVoiceInfo2=function(t){
+var s=t._data.GetVoiceInfoResponse;
+this._storeprincipal=s.storeprincipal[0];
+this.soapInfo.additional={
+storeprincipal:this._storeprincipal};
+var a=s.phone;
+for(var o=0,n=a.length;
+o<n;
+o++){
+var r=a[o];
+var e=new ZmPhone();
+e._loadFromDom(r);
+this.phones.push(e);
+this._nameToPhone[e.name]=e;
+if(r.folder&&r.folder.length){
+e.folderTree=new ZmVoiceFolderTree();
+e.folderTree.loadFromJs(r.folder[0],e)
+}}
+if(this._voiceInfoCallbacks){
+for(o=0,n=this._voiceInfoCallbacks.length;
+o<n;
+o++){
+this._voiceInfoCallbacks[o].run(t)
+}}
+this._voiceInfoCallbacks=null;
+this._voiceInfoErrorCallbacks=null;
+this._gettingVoiceInfo=false
+};
+ZmVoiceApp.prototype._handleErrorResponseVoiceInfo=function(e){
+var a=false;
+if(this._voiceInfoErrorCallbacks){
+for(var t=0,o=this._voiceInfoErrorCallbacks.length;
+t<o;
+t++){
+a=this._voiceInfoErrorCallbacks[t].run(e)||a
+}}
+this._voiceInfoCallbacks=null;
+this._voiceInfoErrorCallbacks=null;
+this._gettingVoiceInfo=false;
+return a
+};
+ZmVoiceApp.prototype.refreshFolders=function(n,e){
+if(this.phones.length){
+var t=AjxSoapDoc.create("GetVoiceFolderRequest","urn:zimbraVoice");
+this.setStorePrincipal(t);
+var o=new AjxCallback(this,this._handleResponseUpdateFolders,[n]);
+var a={
+soapDoc:t,asyncMode:true,callback:o,errorCallback:e};
+appCtxt.getAppController().sendRequest(a)
+}else{
+if(n){
+n.run()
+}}};
+ZmVoiceApp.prototype._handleResponseUpdateFolders=function(r,t){
+var a=t._data.GetVoiceFolderResponse.phone;
+for(var o=0,n=a.length;
+o<n;
+o++){
+var s=a[o];
+var e=this._nameToPhone[s.name];
+if(e){
+this._updateFolders(e,s.folder[0].folder)
+}}
+if(r){
+r.run()
+}};
+ZmVoiceApp.prototype._updateFolders=function(t,r){
+var s=t.folderTree;
+for(var a=0,n=r.length;
+a<n;
+a++){
+var e=r[a];
+var o=s.getByName(e.name);
+if(o){
+o.notifyModify(e)
+}}};
+ZmVoiceApp.prototype.search=function(o,r,s){
+var e=(o.getSearchType()==ZmItem.VOICEMAIL)?ZmId.VIEW_VOICEMAIL:ZmId.VIEW_CALL_LIST;
+if((e==ZmId.VIEW_VOICEMAIL)&&!o.phone.hasVoiceMail){
+AjxDispatcher.run("GetVoiceController").show(null,o);
+if(r){
+r.run(null)
+}}else{
+if(!s){
+s=appCtxt.get(ZmSetting.SORTING_PREF,e)
+}
+var n={
+soapInfo:this.soapInfo,types:AjxVector.fromArray([o.getSearchType()]),sortBy:s,query:o.getSearchQuery(),limit:this.getLimit()};
+var t=new ZmSearch(n);
+var a=new AjxCallback(this,this._handleResponseSearch,[o,r]);
+t.execute({
+callback:a}
+)
+}};
+ZmVoiceApp.prototype._handleResponseSearch=function(e,c,t){
+var o=t._data;
+var s=o.getResults(e.getSearchType());
+s.folder=e;
+var r=(e.getSearchType()==ZmItem.VOICEMAIL)?AjxDispatcher.run("GetVoiceController"):AjxDispatcher.run("GetCallListController");
+r.show(o,e);
+if(!this._overviewContainer.initialized){
+var h=this._getOverviewParams();
+h.overviewTrees=this._getOverviewTrees();
+h.phones=this.phones;
+this._overviewContainer.initialize(h)
+}
+var a=o.getAttribute("vfi");
+if(a){
+e.notifyModify(a[0])
+}
+if(this._paramId){
+var n=r.getList();
+var d=n.getById(this._paramId);
+if(d){
+var l=r.getCurrentView();
+l.setSelection(d,true);
+l.setPlaying(d)
+}}
+if(c){
+c.run(o)
+}};
+ZmVoiceApp.prototype.markItemsHeard=function(t,a,n,e){
+var o=a?"read":"!read";
+this._performAction(t,o,null,n,e)
+};
+ZmVoiceApp.prototype._performAction=function(l,r,o,d,s){
+if(!l.length){
+if(d){
+d.run(l)
+}
+return
+}
+var e=[];
+for(var n=0,h=l.length;
+n<h;
+n++){
+e[n]=l[n].id
+}
+var c=AjxSoapDoc.create("VoiceMsgActionRequest","urn:zimbraVoice");
+this.setStorePrincipal(c);
+var t=c.set("action");
+t.setAttribute("op",r);
+t.setAttribute("id",e.join(","));
+t.setAttribute("phone",l[0].getPhone().name);
+for(var n in o){
+t.setAttribute(n,o[n])
+}
+var a={
+soapDoc:c,asyncMode:true,callback:d,errorCallback:s};
+appCtxt.getAppController().sendRequest(a)
+};
+ZmVoiceApp.prototype.launch=function(t,a){
+this._paramId=(t.qsParams?t.qsParams.id:null);
+var e=new AjxCallback(this,this._handleLoadLaunch,[a]);
+AjxDispatcher.require("Voicemail",true,e,null,true)
+};
+ZmVoiceApp.prototype._handleLoadLaunch=function(t){
+var e=new AjxCallback(this,this._handleResponseLoadLaunchGotInfo,t);
+this.getVoiceInfo(e)
+};
+ZmVoiceApp.prototype._handleResponseLoadLaunchGotInfo=function(a,e){
+var t=this.getStartFolder();
+if(t){
+this.search(t,a)
+}else{
+if(a){
+a.run()
+}}};
+ZmVoiceApp.prototype.getStartFolder=function(t){
+var o=0;
+if(t){
+for(var a=0;
+a<this.phones.length;
+a++){
+var e=this.phones[a];
+if(e.name==t){
+o=a
+}}}
+return this.phones[o].folderTree.getByName(ZmVoiceFolder.VOICEMAIL)
+};
+ZmVoiceApp.prototype.getVoiceController=function(){
+if(!this._voiceController){
+this._voiceController=new ZmVoicemailListController(this._container,this)
+}
+return this._voiceController
+};
+ZmVoiceApp.prototype.getCallListController=function(){
+if(!this._callListController){
+this._callListController=new ZmCallListController(this._container,this)
+}
+return this._callListController
+};
+ZmVoiceApp.prototype.setStorePrincipal=function(t){
+var a=t.set("storeprincipal");
+for(var e in this._storeprincipal){
+a.setAttribute(e,this._storeprincipal[e])
+}};
+ZmVoiceApp.prototype.redoSearch=function(){
+var t=appCtxt.getAppViewMgr().getAppView(ZmApp.VOICE);
+if(t){
+var e;
+if(t==ZmId.VIEW_VOICEMAIL){
+e=AjxDispatcher.run("GetVoiceController")
+}else{
+if(t==ZmId.VIEW_CALL_LIST){
+e=AjxDispatcher.run("GetCallListController")
+}}
+if(e){
+this.search(e.getFolder())
+}}};
+ZmVoiceApp.prototype._handleDeletes=function(e){};
+ZmVoiceApp.prototype._handleCreates=function(e){};
+ZmVoiceApp.prototype._handleModifies=function(e){};
+ZmVoiceApp.prototype._getOverviewTrees=function(){
+return[ZmOrganizer.VOICE]
+}
+}
+if(AjxPackage.define("zimbraMail.mixed.ZmMixedApp")){
+ZmMixedApp=function(e){
+ZmApp.call(this,ZmApp.MIXED,e)
+};
+ZmItem.MIXED="MIXED";
+ZmApp.MIXED=ZmId.APP_MIXED;
+ZmApp.CLASS[ZmApp.MIXED]="ZmMixedApp";
+ZmApp.SETTING[ZmApp.MIXED]=ZmSetting.MIXED_VIEW_ENABLED;
+ZmApp.LOAD_SORT[ZmApp.MIXED]=50;
+ZmMixedApp.prototype=new ZmApp;
+ZmMixedApp.prototype.constructor=ZmMixedApp;
+ZmMixedApp.prototype.toString=function(){
+return"ZmMixedApp"
+};
+ZmMixedApp.prototype._defineAPI=function(){
+AjxDispatcher.registerMethod("GetMixedController","Mixed",new AjxCallback(this,this.getMixedController))
+};
+ZmMixedApp.prototype._registerItems=function(){
+ZmItem.registerItem(ZmItem.MIXED,{
+app:ZmApp.MIXED}
+)
+};
+ZmMixedApp.prototype._registerApp=function(){
+ZmApp.registerApp(ZmApp.MIXED,{
+mainPkg:"Mixed",nameKey:"zimbraTitle",icon:"Globe",overviewTrees:[ZmOrganizer.FOLDER,ZmOrganizer.ADDRBOOK,ZmOrganizer.SEARCH,ZmOrganizer.TAG],searchTypes:[ZmItem.MSG,ZmItem.CONV]}
+)
+};
+ZmMixedApp.prototype.launch=function(){};
+ZmMixedApp.prototype._getOverviewTrees=function(){
+var a=ZmApp.OVERVIEW_TREES[this._name];
+var e=[];
+var n=appCtxt.getAppController().getPreviousApp();
+for(var t=0;
+t<a.length;
+t++){
+var o=a[t];
+if((n==ZmApp.CONTACTS&&o==ZmOrganizer.FOLDER)||(n==ZmApp.MAIL&&o==ZmOrganizer.ADDRBOOK)){
+continue
+}
+e.push(o)
+}
+return e
+};
+ZmMixedApp.prototype.showSearchResults=function(t,a){
+var e=new AjxCallback(this,this._handleLoadShowSearchResults,[t,a]);
+AjxDispatcher.require(["MailCore","Mail","Mixed"],false,e,null,true)
+};
+ZmMixedApp.prototype._handleLoadShowSearchResults=function(e,t){
+this.getMixedController().show(e);
+if(t){
+t.run()
+}};
+ZmMixedApp.prototype.getMixedController=function(){
+if(!this._mixedController){
+this._mixedController=new ZmMixedController(this._container,this)
+}
+return this._mixedController
+}
+}}
+if(AjxPackage.define("dwt.Widgets")){
+AjxTemplate.register("dwt.Widgets#DwtAlert",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td width=1%><div id='";
+e[a++]=n.id;
+e[a++]="_icon' style='margin-right:5px;'></div></td><td width=99%><table border=0 cellpadding=0 cellspacing=0><tr><td id='";
+e[a++]=n.id;
+e[a++]="_title' class='DwtAlertTitle'></td></tr><tr><td id='";
+e[a++]=n.id;
+e[a++]="_content' class='DwtAlertContent'></td></tr></table></td><td width=1%><div id='";
+e[a++]=n.id;
+e[a++]="_dismiss' style='margin-left:5px;'></div></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#DwtAlert"}
+,false);
+AjxTemplate.register("dwt.Widgets",AjxTemplate.getTemplate("dwt.Widgets#DwtAlert"),AjxTemplate.getParams("dwt.Widgets#DwtAlert"));
+AjxTemplate.register("dwt.Widgets#DwtCheckbox",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table cellpadding='2' cellspacing='0' border='0'><tr><td><label id='";
+e[a++]=n.id;
+e[a++]="_text_left' for='";
+e[a++]=n.id;
+e[a++]="_input' class='Text' style='text-align:right'></label></td><td><input id='";
+e[a++]=n.id;
+e[a++]="_input' name='";
+e[a++]=n.name;
+e[a++]="' value='";
+e[a++]=n.value;
+e[a++]="' type='checkbox' ";
+e[a++]=n.checked;
+e[a++]="></td><td><label id='";
+e[a++]=n.id;
+e[a++]="_text_right' for='";
+e[a++]=n.id;
+e[a++]="_input' class='Text' style='text-align:left'></label></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#DwtCheckbox"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtRadioButton",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table cellpadding='2' cellspacing='0' border='0'><tr><td><label id='";
+e[a++]=n.id;
+e[a++]="_text_left' for='";
+e[a++]=n.id;
+e[a++]="_input' class='Text' style='text-align:right'></label></td><td><input id='";
+e[a++]=n.id;
+e[a++]="_input' name='";
+e[a++]=n.name;
+e[a++]="' value='";
+e[a++]=n.value;
+e[a++]="' type='radio' ";
+e[a++]=n.checked;
+e[a++]="></td><td><label id='";
+e[a++]=n.id;
+e[a++]="_text_right' for='";
+e[a++]=n.id;
+e[a++]="_input' class='Text' style='text-align:left'></label></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#DwtRadioButton"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtBaseDialog",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div class='DwtDialog WindowOuterContainer'><table cellspacing=0 cellpadding=0><tr id='";
+e[a++]=n.dragId;
+e[a++]="'><td class='minWidth'>";
+e[a++]=n.icon;
+e[a++]="</td><td id='";
+e[a++]=n.id;
+e[a++]="_title' class='DwtDialogTitle'>";
+e[a++]=n.title;
+e[a++]="</td><td class='minWidth'><div class='";
+e[a++]=n.closeIcon2;
+e[a++]="'></div></td><td class='minWidth'><div class='";
+e[a++]=n.closeIcon1;
+e[a++]="'></div></td></tr><tr><td class='WindowInnerContainer' colspan='4'><div id='";
+e[a++]=n.id;
+e[a++]="_content' class='DwtDialogBody'></div>";
+if(n.controlsTemplateId){
+e[a++]=AjxTemplate.expand(n.controlsTemplateId,n)
+}
+e[a++]="</td></tr></table></div>";
+return o?e.length:e.join("")
+}
+,{
+width:"20",height:"32",id:"dwt.Widgets#DwtBaseDialog"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtDialogControls",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div class='horizSep'></div><div id='";
+e[a++]=n.id;
+e[a++]="_buttons' class='DwtDialogButtonBar'>";
+if(AjxEnv.isNav){
+e[a++]="<input type='button' id='";
+e[a++]=n.id;
+e[a++]="_focus' style='height:0px;width:0px;display:none;'>"
+}
+e[a++]="</div>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#DwtDialogControls"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtSemiModalDialog",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div class='DwtDialog LightWindowOuterContainer'><table cellspacing=0 cellpadding=0 style='cursor:move;'><tr id='";
+e[a++]=n.dragId;
+e[a++]="'><td class='minWidth'>";
+e[a++]=n.icon;
+e[a++]="</td><td id='";
+e[a++]=n.id;
+e[a++]="_title' class='DwtDialogTitle'>";
+e[a++]=n.title;
+e[a++]="</td><td class='minWidth'><div class='";
+e[a++]=n.closeIcon2;
+e[a++]="'></div></td><td class='minWidth'><div class='";
+e[a++]=n.closeIcon1;
+e[a++]="'></div></td></tr><tr><td class='LightWindowInnerContainer full_size' colspan='4'><div id='";
+e[a++]=n.id;
+e[a++]="_content' class='DwtDialogBody'></div><div class='horizSep'></div><div id='";
+e[a++]=n.id;
+e[a++]="_buttons' class='DwtDialogButtonBar'>";
+if(AjxEnv.isNav){
+e[a++]="<input type='button' id='";
+e[a++]=n.id;
+e[a++]="_focus' style='height:0px;width:0px;display:none;'>"
+}
+e[a++]="</div></td></tr></table></div>";
+return o?e.length:e.join("")
+}
+,{
+width:"20",height:"32",id:"dwt.Widgets#DwtSemiModalDialog"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtToolTip",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div id='";
+e[a++]=n.id;
+e[a++]="TopPointer' class='DwtToolTipTopPointer'><center><div class='DwtToolTipPointerRow' style='width:1px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:3px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:5px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:7px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:9px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:11px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:13px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:15px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:17px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:19px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:21px;'>&nbsp;</div></center></div><div id='";
+e[a++]=n.id;
+e[a++]="Contents' class='DwtToolTipBody'></div><div id='";
+e[a++]=n.id;
+e[a++]="BottomPointer' class='DwtToolTipBottomPointer'><center><div class='DwtToolTipPointerRow' style='width:21px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:19px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:17px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:15px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:13px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:11px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:9px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:7px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:5px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:3px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:1px;'>&nbsp;</div></center></div>";
+return o?e.length:e.join("")
+}
+,{
+width:"5",height:"5",id:"dwt.Widgets#DwtToolTip"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtVerticalSash",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div class='DwtVerticalSash'><center><div class='ImgVSash_thumb'></div></center></div>";
+return o?e.length:e.join("")
+}
+,{
+width:"0",height:"0",id:"dwt.Widgets#DwtVerticalSash"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtHorizontalSash",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div class='DwtHorizontalSash'><table cellspacing=0 cellpadding=0 height='100%'><tr><td height='100%' valign='middle'><div class='ImgHSash_thumb'></div></td></tr></table></div>";
+return o?e.length:e.join("")
+}
+,{
+width:"0",height:"0",id:"dwt.Widgets#DwtHorizontalSash"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtMissingSoundPlayer",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table class='DwtMissingSoundPlayer'><tr><td nowrap class='ImgCritical'>&nbsp;</td><td nowrap>";
+e[a++]=ZmMsg.missingPlugin;
+e[a++]="</td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#DwtMissingSoundPlayer"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtVerticalSlider",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div id='";
+e[a++]=n.id;
+e[a++]="_button' class='DwtThumb DwtSliderThumb'><div class='DwtSliderThumbBorder'><div class='ImgVerticalSliderThumb'></div></div></div>";
+return o?e.length:e.join("")
+}
+,{
+"class":"DwtSlider DwtVerticalSlider",id:"dwt.Widgets#DwtVerticalSlider"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtHorizontalSlider",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div id='";
+e[a++]=n.id;
+e[a++]="_button' class='DwtThumb DwtSliderThumb'><div class='DwtSliderThumbBorder'><div class='ImgHorizontalSliderThumb'></div></div></div>";
+return o?e.length:e.join("")
+}
+,{
+"class":"DwtSlider DwtHorizontalSlider",id:"dwt.Widgets#DwtHorizontalSlider"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZLabel",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table class='ZWidgetTable ZLabelBorder' cellspacing=0 cellpadding=0><tr><td id='";
+e[a++]=n.id;
+e[a++]="_left_icon' \tclass='ZLeftIcon ZWidgetIcon'></td><td id='";
+e[a++]=n.id;
+e[a++]="_title'\t\tclass='ZWidgetTitle'></td><td id='";
+e[a++]=n.id;
+e[a++]="_right_icon' \tclass='ZRightIcon ZWidgetIcon'></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#ZLabel"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZButton",function(a,r,s,t){
+var n=Boolean(t);
+s=(typeof s=="string"?{
+id:s}
+:s)||{};
+t=t||[];
+var o=t.length;
+var e=s.buttonClass||"Button";
+t[o++]="<table class='ZWidgetTable Z";
+t[o++]=e;
+t[o++]="Table Z";
+t[o++]=e;
+t[o++]="Border' cellspacing=0 cellpadding=0 style='table-layout:auto;'><tr><td id='";
+t[o++]=s.id;
+t[o++]="_left_icon' \tclass='ZLeftIcon ZWidgetIcon'></td><td id='";
+t[o++]=s.id;
+t[o++]="_title'\t\tclass='ZWidgetTitle'></td><td id='";
+t[o++]=s.id;
+t[o++]="_right_icon' \tclass='ZRightIcon ZWidgetIcon'></td><td id='";
+t[o++]=s.id;
+t[o++]="_dropdown' \tclass='ZDropDown'></td></tr></table>";
+return n?t.length:t.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#ZButton"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZToolbarButton",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+n.buttonClass=n.buttonClass||"ToolbarButton";
+e[a++]=AjxTemplate.expand("#ZButton",n);
+return o?e.length:e.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#ZToolbarButton"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZBorderlessButton",function(a,r,s,t){
+var n=Boolean(t);
+s=(typeof s=="string"?{
+id:s}
+:s)||{};
+
+t=t||[];
+var o=t.length;
+var e=s.buttonClass||"Button";
+t[o++]="<table class='ZWidgetTable Z";
+t[o++]=e;
+t[o++]="Table' cellspacing=0 cellpadding=0 style='table-layout:auto;'><tr><td id='";
+t[o++]=s.id;
+t[o++]="_left_icon' \tclass='ZLeftIcon ZWidgetIcon'></td><td id='";
+t[o++]=s.id;
+t[o++]="_title'\t\tclass='ZWidgetTitle'></td><td id='";
+t[o++]=s.id;
+t[o++]="_right_icon' \tclass='ZRightIcon ZWidgetIcon'></td><td id='";
+t[o++]=s.id;
+t[o++]="_dropdown' \tclass='ZDropDown'></td></tr></table>";
+return n?t.length:t.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#ZBorderlessButton"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZButtonColorDisplay",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div id='";
+e[a++]=n.id;
+e[a++]="_color' class='DwtButtonColorPicker-display' unselectable></div>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZButtonColorDisplay"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtComboBox",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table border=0 cellpadding=0 cellspacing=0><tr><td width=*><div id='";
+e[a++]=n.id;
+e[a++]="_input'></div></td><td><div id='";
+e[a++]=n.id;
+e[a++]="_button'></div></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+"class":"DwtComboBox",id:"dwt.Widgets#DwtComboBox"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtComboBoxButton",function(a,r,s,t){
+var n=Boolean(t);
+s=(typeof s=="string"?{
+id:s}
+:s)||{};
+t=t||[];
+var o=t.length;
+var e=s.buttonClass||"Button";
+t[o++]="<table class='Z";
+t[o++]=e;
+t[o++]="Border' cellspacing=0 cellpadding=0><tr><td id='";
+t[o++]=s.id;
+t[o++]="_dropdown' class='ZDropDown'></td></tr></table>";
+return n?t.length:t.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#DwtComboBoxButton"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZTabView",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div id='";
+e[a++]=n.id;
+e[a++]="_tabbar'></div><div id='";
+e[a++]=n.id;
+e[a++]="_page'></div>";
+return o?e.length:e.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#ZTabView"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZTabBar",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table border=0 cellpadding=0 cellspacing=0><tr valign='bottom' id='";
+e[a++]=n.id;
+e[a++]="_items'>";
+e[a++]=AjxTemplate.expand("#ZTabBarPrefix",n);
+e[a++]=AjxTemplate.expand("#ZTabBarSuffix",n);
+e[a++]="</tr></table>";
+return o?e.length:e.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#ZTabBar"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZTabBarFloat",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div id='";
+e[a++]=n.id;
+e[a++]="_items'>";
+e[a++]=AjxTemplate.expand("#ZTabBarPrefixFloat",n);
+e[a++]=AjxTemplate.expand("#ZTabBarSuffixFloat",n);
+e[a++]="</div>";
+return o?e.length:e.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#ZTabBarFloat"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZTabBarPrefixFloat",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div id='";
+e[a++]=n.id;
+e[a++]="_prefix' class='ZTabBarPrefix'>&nbsp;</div>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZTabBarPrefixFloat"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZTabBarSuffixFloat",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div id='";
+e[a++]=n.id;
+e[a++]="_suffix' class='ZTabBarSuffix'>&nbsp;</div>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZTabBarSuffixFloat"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZTabBarPrefix",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<td id='";
+e[a++]=n.id;
+e[a++]="_prefix' class='ZTabBarPrefix'>&nbsp;</td>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZTabBarPrefix"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZTabBarSuffix",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<td id='";
+e[a++]=n.id;
+e[a++]="_suffix' class='ZTabBarSuffix'>&nbsp;</td>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZTabBarSuffix"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZTab",function(a,r,s,t){
+var n=Boolean(t);
+s=(typeof s=="string"?{
+id:s}
+:s)||{};
+t=t||[];
+var o=t.length;
+var e=s.buttonClass||"Tab";
+t[o++]="<table id='";
+t[o++]=s.id;
+t[o++]="_select' class='Z";
+t[o++]=e;
+t[o++]="Table Z";
+t[o++]=e;
+t[o++]="Border ZWidgetTable ZWidgetBorder' cellspacing=0 cellpadding=0><tr><td id='";
+t[o++]=s.id;
+t[o++]="_left_icon' class='ZLeftIcon ZWidgetIcon'></td><td id='";
+t[o++]=s.id;
+t[o++]="_title' class='ZWidgetTitle'></td><td id='";
+t[o++]=s.id;
+t[o++]="_right_icon' class='ZRightIcon ZWidgetIcon'></td></tr></table>";
+return n?t.length:t.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#ZTab"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZTabFloat",function(a,r,s,t){
+var n=Boolean(t);
+s=(typeof s=="string"?{
+id:s}
+:s)||{};
+t=t||[];
+var o=t.length;
+var e=s.buttonClass||"Tab";
+t[o++]="<table id='";
+t[o++]=s.id;
+t[o++]="_select' class='Z";
+t[o++]=e;
+t[o++]="Table Z";
+t[o++]=e;
+t[o++]="Border ZWidgetBorder' cellspacing=0 cellpadding=0><tr><td id='";
+t[o++]=s.id;
+t[o++]="_left_icon' class='ZLeftIcon ZWidgetIcon'></td><td id='";
+t[o++]=s.id;
+t[o++]="_title' class='ZWidgetTitle'></td><td id='";
+t[o++]=s.id;
+t[o++]="_right_icon' class='ZRightIcon ZWidgetIcon'></td></tr></table>";
+return n?t.length:t.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#ZTabFloat"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZTabPage",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="";
+return o?e.length:e.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#ZTabPage"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZSelectAutoSizingContainer",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]='<table border=0 cellpadding=0 cellspacing=0><tr><td id="';
+e[a++]=n.id;
+e[a++]='_select_container">';
+e[a++]=AjxTemplate.expand(n.selectTemplateId,n.selectData);
+e[a++]='</td></tr><tr><td><table id="';
+e[a++]=n.id;
+e[a++]='_pseudoitems_container" border=0 cellpadding=0 cellspacing=0></table></td></tr></table>';
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZSelectAutoSizingContainer"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZSelect",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]=AjxTemplate.expand("#ZButton",n);
+return o?e.length:e.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#ZSelect"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZSelectMenu",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]=AjxTemplate.expand("#ZMenu",n);
+return o?e.length:e.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#ZSelectMenu"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZSelectMenuItem",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]=AjxTemplate.expand("#ZMenuItem",n);
+return o?e.length:e.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#ZSelectMenuItem"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZToolbar",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table class='ZToolbarTable' border=0 cellpadding=0 cellspacing=0><tr id='";
+e[a++]=n.id;
+e[a++]="_items'>";
+e[a++]=AjxTemplate.expand("#ZToolbarPrefix",n);
+e[a++]=AjxTemplate.expand("#ZToolbarSuffix",n);
+e[a++]="</tr></table>";
+return o?e.length:e.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#ZToolbar"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZToolbarPrefix",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+
+e=e||[];
+var a=e.length;
+e[a++]="";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZToolbarPrefix"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZToolbarSuffix",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZToolbarSuffix"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZToolbarItem",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table><tr><td id='";
+e[a++]=n.itemId;
+e[a++]="'></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZToolbarItem"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZToolbarSeparator",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table><tr><td id='";
+e[a++]=n.itemId;
+e[a++]="' class='ZToolbarSeparator'>&nbsp;</td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZToolbarSeparator"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZToolbarSpacer",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table><tr><td id='";
+e[a++]=n.itemId;
+e[a++]="' class='ZToolbarSpacer'>&nbsp;</td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZToolbarSpacer"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZToolbarFiller",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table><tr><td id='";
+e[a++]=n.itemId;
+e[a++]="' class='ZToolbarFiller' width='100%'>&nbsp;</td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZToolbarFiller"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZField",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<input id='";
+e[a++]=n.id;
+e[a++]="_field' class='ZFieldInput'>";
+return o?e.length:e.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#ZField"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZTreeItem",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div class='";
+e[a++]=n.divClassName;
+e[a++]="' id='";
+e[a++]=n.id;
+e[a++]="_div'><table id='";
+e[a++]=n.id;
+e[a++]="_table' border=0 cellpadding=0 cellspacing=0 width=100%><tr><td align=center nowrap id='";
+e[a++]=n.id;
+e[a++]="_nodeCell'></td>";
+if(n.isCheckedStyle){
+e[a++]="<td nowrap id='";
+e[a++]=n.id;
+e[a++]='_checkboxCell\' class="ZTreeItemCheckboxCell"><div class="ZTreeItemCheckbox" id=\'';
+e[a++]=n.id;
+e[a++]="_checkbox'><div class=\"ZTreeItemCheckboxImg\" id='";
+e[a++]=n.id;
+e[a++]="_checkboxImg'>";
+e[a++]=AjxImg.getImageHtml("MenuCheck");
+e[a++]="</div></div></td>"
+}
+e[a++]="<td nowrap class='imageCell' id='";
+e[a++]=n.id;
+e[a++]="_imageCell'></td><td width=100% nowrap class='";
+e[a++]=n.textClassName;
+e[a++]="' id='";
+e[a++]=n.id;
+e[a++]="_textCell'></td><td width=16 class='imageCell' id='";
+e[a++]=n.id;
+e[a++]="_extraCell'></td></tr></table></div>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZTreeItem"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZHeaderTreeItem",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div class='";
+e[a++]=n.divClassName;
+e[a++]="' id='";
+e[a++]=n.id;
+e[a++]="_div'><table id='";
+e[a++]=n.id;
+e[a++]="_table' border=0 cellpadding=0 cellspacing=0><tr>";
+if(!n.noNodeCell){
+e[a++]="<td align=center nowrap id='";
+e[a++]=n.id;
+e[a++]="_nodeCell'></td>"
+}
+e[a++]="<td nowrap class='imageCell' id='";
+e[a++]=n.id;
+e[a++]="_imageCell'></td><td nowrap class='";
+e[a++]=n.textClassName;
+e[a++]="' id='";
+e[a++]=n.id;
+e[a++]="_textCell' width=\"100%\"></td><td class='";
+e[a++]=n.textClassName;
+e[a++]=" FakeAnchor' style=\"padding-right:4px\"><div id='";
+e[a++]=n.id;
+e[a++]="_headerButton'/></td></tr></table></div>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZHeaderTreeItem"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZAccordion",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div id='";
+e[a++]=n.id;
+e[a++]="_div'><table class='ZAccordionTable ZWidget' border=0 cellspacing=0 cellpadding=0 id='";
+e[a++]=n.id;
+e[a++]="_accordion_table'></table></div>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZAccordion"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZAccordionItem",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div id='";
+e[a++]=n.id;
+e[a++]="_header_";
+e[a++]=n.itemNum;
+e[a++]="' class='ZAccordionHeader'><table class='ZAccordionHeaderBorder ZWidgetTable' cellspacing=0 cellpadding=0><tr><td><div class='";
+e[a++]=n.icon;
+e[a++]="' id='";
+e[a++]=n.id;
+e[a++]="_icon_";
+e[a++]=n.itemNum;
+e[a++]="'></div></td><td><div class='ZAccordionTitle' id='";
+e[a++]=n.id;
+e[a++]="_title_";
+e[a++]=n.itemNum;
+e[a++]="'>";
+e[a++]=n.title;
+e[a++]="</div></td><td><div class='ImgAccordionClosed' id='";
+e[a++]=n.id;
+e[a++]="_status_";
+e[a++]=n.itemNum;
+e[a++]="'></div></td></tr></table></div><div class='ZAccordionBody' id='";
+e[a++]=n.id;
+e[a++]="_body_";
+e[a++]=n.itemNum;
+e[a++]="'></div>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZAccordionItem"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtTabView",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table width='100%' border='0' cellspacing='0' cellpadding='0' backgroundColor='";
+e[a++]=n.bgcolor;
+e[a++]="'><tr align='left' valign='middle'><td id='";
+e[a++]=n.id;
+e[a++]="_tabs' class='DwtTabTable' nowrap align='left' valign='middle' width='100%'></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#DwtTabView"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtTabBar",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<!-- TODO -->";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#DwtTabBar"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtTabSpacer",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table width='100%' cellspacing='0' cellpadding='0'><tr></tr><tr></tr><tr><td><div class='ImgTabSpacer'></div></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#DwtTabSpacer"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZMenu",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div id='";
+e[a++]=n.id;
+e[a++]="_container' class='ZMenuBorder'></div>";
+return o?e.length:e.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#ZMenu"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZMenuItem",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table class='ZWidgetTable ZMenuItemTable ZMenuItemBorder' cellspacing=0 cellpadding=0><tr><td id='";
+e[a++]=n.id;
+e[a++]="_check' class='ZCheckIcon'><div></div></td><td id='";
+e[a++]=n.id;
+e[a++]="_left_icon' class='ZLeftIcon ZWidgetIcon'><div></div></td><td id='";
+e[a++]=n.id;
+e[a++]="_title' class='ZWidgetTitle'></td><td id='";
+e[a++]=n.id;
+e[a++]="_dropdown' class='ZDropDown'><div></div></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#ZMenuItem"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZMenuItemSeparator",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table class='ZWidgetTable ZMenuItemTable ZMenuItemBorder ZMenuItemSeparatorBorder' cellspacing=0 cellpadding=0><tr><td id='";
+e[a++]=n.id;
+e[a++]="_title' class='ZWidgetTitle'><div class='ZMenuItem-Separator'></div></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+"class":"ZWidget",id:"dwt.Widgets#ZMenuItemSeparator"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZMenuItemBlankCheck",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div class='ZMenuItem-BlankCheck'></div>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZMenuItemBlankCheck"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZMenuItemBlankIcon",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div class='ZMenuItem-BlankIcon'></div>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZMenuItemBlankIcon"}
+,false);
+AjxTemplate.register("dwt.Widgets#ZMenuItemBlankCascade",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div class='ZMenuItem-BlankCascade'></div>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#ZMenuItemBlankCascade"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtListView-NoResults",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table width='100%' cellspacing=0 cellpadding=1><tr><td class='NoResults' valign='top'><br><br>";
+e[a++]=n.message;
+e[a++]="\n";
+e[a++]="\t\t\t</td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#DwtListView-NoResults"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtPasswordField",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table cellpadding='0' cellspacing='0' border='0'><tr><td><div id='";
+e[a++]=n.id;
+e[a++]="_input'></div></td><td><div id='";
+e[a++]=n.id;
+e[a++]="_show_password'></div></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#DwtPasswordField"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtFormRows",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]='<table border=0 cellspacing=3 cellpadding=0><tbody id="';
+e[a++]=n.id;
+e[a++]='_rows" tabindex="100"></tbody></table>';
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#DwtFormRows"}
+,false);
+AjxTemplate.register("dwt.Widgets#DwtFormRow",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]='<table><tr id="';
+e[a++]=n.id;
+e[a++]='_row" class="DwtFormRow"><td><div id="';
+e[a++]=n.id;
+e[a++]='" tabindex="100"></div></td><td><div id="';
+e[a++]=n.id;
+e[a++]='_add" class="DwtFormRowAdd" tabindex="200"></div></td><td><div id="';
+e[a++]=n.id;
+e[a++]='_remove" class="DwtFormRowRemove" tabindex="300"></div></td></tr></table>';
+return o?e.length:e.join("")
+}
+,{
+id:"dwt.Widgets#DwtFormRow"}
+,false)
+}
+if(AjxPackage.define("share.App")){
+AjxTemplate.register("share.App#Loading",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table border=0 cellpadding=0 cellspacing=0 style='width:100%;height=100%'><tr><td align='center' valign='middle'><br><br><br>";
+e[a++]=ZmMsg.loading;
+e[a++]="<br><br><div class='Imgwait_64'></div><br><br><br></td></tr><tr><td style='height:100%'>&nbsp;</td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.App#Loading"}
+,false);
+AjxTemplate.register("share.App",AjxTemplate.getTemplate("share.App#Loading"),AjxTemplate.getParams("share.App#Loading"));
+AjxTemplate.register("share.App#Banner",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table border=0 cellpadding=0 cellspacing=0 style='width:100%;height:100%'><tr><td align='center' valign='middle'><a";
+if(n.url&&n.url!=""){
+e[a++]=" href='";
+e[a++]=n.url;
+e[a++]="' target='_blank'"
+}
+e[a++]="><div class='ImgAppBanner'></div></a></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.App#Banner"}
+,false);
+AjxTemplate.register("share.App#UserInfo",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table class='skin_table' cellpadding=0 cellspacing=0 border=0>";
+if(n.showOfflineLink){
+e[a++]='<tr><td id=\'skin_td_switch_offline\' colspan=3><a href="http://www.zimbra.com/products/desktop.html" target="_blank">';
+e[a++]=ZmMsg.switchToOfflineClientEx;
+e[a++]="</a></td></tr>"
+}
+e[a++]="<tr>";
+if(n.adminUrl){
+e[a++]='<td id="skin_container_adminlink"><table border=0 cellpadding=0 cellspacing=0><tr><td><a target="_blank" href="';
+e[a++]=n.adminUrl;
+e[a++]='">';
+e[a++]=AjxImg.getImageHtml("Status",null,"border=0");
+e[a++]='</a></td><td style=\'white-space:nowrap; font-weight:bold\'><a target="_blank" href="';
+e[a++]=n.adminUrl;
+e[a++]='">';
+e[a++]=ZmMsg.adminLinkLabel;
+e[a++]="</a></td></tr></table></td>"
+}
+e[a++]="<td id='skin_container_help'><table border=0 cellpadding=0 cellspacing=0><tr>";
+if(n.helpIcon){
+e[a++]="<td style='padding-right:3px;'><a href='javascript:;' onclick='ZmZimbraMail.helpLinkCallback();'>";
+e[a++]=AjxImg.getImageHtml(n.helpIcon,null,"border=0");
+e[a++]="</a></td>"
+}
+e[a++]="<td style='white-space:nowrap; font-weight:bold'><a href='javascript:;' onclick='ZmZimbraMail.helpLinkCallback();'>";
+e[a++]=ZmMsg.help;
+e[a++]="</a></td></tr></table></td><td id='skin_container_logoff'><table border=0 cellpadding=0 cellspacing=0><tr>";
+if(n.logoutIcon){
+e[a++]="<td style='padding-right:3px;'><a href='javascript:;' onclick='ZmZimbraMail._onClickLogOff();'>";
+e[a++]=AjxImg.getImageHtml(n.logoutIcon,null,"border=0");
+e[a++]="</a></td>"
+}
+e[a++]="<td style='white-space:nowrap; font-weight:bold'><a href='javascript:;' onclick='ZmZimbraMail._onClickLogOff();'>";
+e[a++]=n.logoutText;
+e[a++]="</a></td></tr></table></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.App#UserInfo"}
+,false);
+AjxTemplate.register("share.App#PrintView",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<html><head><title>";
+e[a++]=ZmMsg.zimbraLabel;
+e[a++]=" ";
+e[a++]=n.username;
+e[a++]="</title><link rel='stylesheet' href='";
+e[a++]=n.appContextPath;
+e[a++]="/css/msgview,zm,wiki.css?v=";
+e[a++]=n.cacheKillerVersion;
+e[a++]="' media='screen'></link>";
+if(n.onloadStr){
+e[a++]="<script language='javascript'>\n";
+e[a++]="\t\t\t\t\tfunction handleOnload() {\n";
+e[a++]="\t\t\t\t\t\t";
+e[a++]=n.onloadStr;
+e[a++]=";\n";
+e[a++]="\t\t\t\t\t}\n";
+e[a++]="\t\t\t\t<\/script></head><body onload='handleOnload();'>"
+}else{
+e[a++]="</head><body>"
+}
+e[a++]="<table border=0 width=100%><tr><td class='ZmPrintView-company'>";
+e[a++]=ZmMsg.zimbraTitle;
+e[a++]=" ";
+e[a++]=ZmMsg.splashScreenAppName;
+e[a++]="</td><td class='ZmPrintView-username' align=right>";
+e[a++]=n.username;
+e[a++]="</td></tr></table><hr><div style='padding:10px'>";
+e[a++]=n.content;
+e[a++]="</div></body></html>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.App#PrintView"}
+,false);
+AjxTemplate.register("share.App#FolderTooltip",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table cellpadding=0 cellspacing=0 border=0><tr><td valign='top' style='padding-right:20px'>";
+e[a++]=AjxMessageFormat.format(ZmMsg.makeLabel,n.itemText);
+e[a++]="</td><td valign='top'>";
+e[a++]=n.numTotal;
+e[a++]="</td></tr>";
+if(n.sizeTotal){
+e[a++]="<tr><td valign='top'>";
+e[a++]=ZmMsg.sizeLabel;
+e[a++]="</td><td valign='top'>";
+e[a++]=AjxUtil.formatSize(n.sizeTotal);
+e[a++]="</td></tr>"
+}
+e[a++]="</table>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.App#FolderTooltip"}
+,false);
+AjxTemplate.register("share.App#ZimbraAccountTooltip",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table border=0>";
+if(n.lastSync&&n.lastSync!=""){
+e[a++]="<tr><td class='nobreak' align=right>";
+e[a++]=ZmMsg.lastSync;
+e[a++]=":</td><td class='nobreak'>";
+e[a++]=n.lastSync;
+e[a++]="</td></tr>"
+}else{
+if(!n.isInitialSync){
+e[a++]="<tr><td class='nobreak' colspan=2>";
+e[a++]=ZmMsg.neverSynced;
+e[a++]="</td></tr>"
+}}
+if(n.status&&n.status!=""){
+e[a++]="<tr><td align=right valign=top>";
+e[a++]=ZmMsg.status;
+e[a++]=":</td><td>";
+e[a++]=n.status;
+e[a++]="</td></tr>"
+}
+e[a++]="</table>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.App#ZimbraAccountTooltip"}
+,false);
+AjxTemplate.register("share.App#presenceButton",function(a,r,s,t){
+var n=Boolean(t);
+s=(typeof s=="string"?{
+id:s}
+:s)||{};
+t=t||[];
+var o=t.length;
+var e=s.buttonClass||"ToolbarButton";
+t[o++]="<table class='ZWidgetTable Z";
+t[o++]=e;
+t[o++]="Table Z";
+t[o++]=e;
+t[o++]="Border' cellspacing=0 cellpadding=0 style='table-layout:auto;'><tr><td id='";
+t[o++]=s.id;
+t[o++]="_left_icon' \tclass='ZLeftIcon ZWidgetIcon'></td><td id='";
+t[o++]=s.id;
+t[o++]="_title'\t\tclass='ZWidgetTitle'></td></tr></table>";
+return n?t.length:t.join("")
+}
+,{
+"class":"ZWidget",id:"share.App#presenceButton"}
+,false);
+AjxTemplate.register("share.App#ZmTaskbarItem",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div id='";
+e[a++]=n.id;
+e[a++]="_button' class='ZmTaskbarButtonParent'></div><div id='";
+e[a++]=n.id;
+e[a++]="_content' class='ZmTaskbarContentParent' style='display:none;'></div>";
+return o?e.length:e.join("")
+}
+,{
+"class":"ZWidget",id:"share.App#ZmTaskbarItem"}
+,false);
+AjxTemplate.register("share.App#ZmStatusImageButton",function(a,r,s,t){
+var n=Boolean(t);
+s=(typeof s=="string"?{
+id:s}
+:s)||{};
+t=t||[];
+var o=t.length;
+var e=s.buttonClass||"ToolbarButton";
+t[o++]="<table class='ZWidgetTable Z";
+t[o++]=e;
+t[o++]="Table Z";
+t[o++]=e;
+t[o++]="Border' cellspacing=0 cellpadding=0 style='table-layout:auto;'><tr><td id='";
+t[o++]=s.id;
+t[o++]="_left_icon' \tclass='ZLeftIcon ZWidgetIcon'></td><td id='";
+t[o++]=s.id;
+t[o++]="_status_icon'\tclass='ZLeftIcon ZWidgetIcon'><div></div></td></tr></table>";
+return n?t.length:t.join("")
+}
+,{
+"class":"ZWidget",id:"share.App#ZmStatusImageButton"}
+,false)
+}
+if(AjxPackage.define("share.Dialogs")){
+AjxTemplate.register("share.Dialogs#TableProperties",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]='<table class="ZmHEDialog"><tr><td><fieldset class="ZmFieldset"><legend class="ZmLegend">';
+e[a++]=ZmMsg.description;
+e[a++]='</legend><table width="100%"><tr><td class="Label" style="width: auto">';
+e[a++]=ZmMsg.caption;
+e[a++]='</td><td width="100%" id="';
+e[a++]=n.id;
+e[a++]='_Caption"></td></tr><tr><td class="Label" style="width: auto">';
+e[a++]=ZmMsg.summary;
+e[a++]='</td><td width="100%" id="';
+e[a++]=n.id;
+e[a++]='_Summary"></td></tr></table></fieldset><fieldset class="ZmFieldset"><legend class="ZmLegend">';
+e[a++]=ZmMsg.layout;
+e[a++]='</legend><table cellspacing="0"><tr><td class="Label">';
+e[a++]=ZmMsg.tableWidth;
+e[a++]='</td><td colspan="4"><table cellpadding="0" cellspacing="0"><tr><td style="padding-right: 2px"><input id="';
+e[a++]=n.id;
+e[a++]='_WidthAuto" checked="checked" name="';
+e[a++]=n.id;
+e[a++]='_WidthAuto" type="radio" /></td><td style="padding-right: 2em" colspan="2"><label for="';
+e[a++]=n.id;
+e[a++]='_WidthAuto">';
+e[a++]=ZmMsg.auto;
+e[a++]='</label></td></tr><tr><td style="padding-right: 2px"><input id="';
+e[a++]=n.id;
+e[a++]='_WidthAuto1" name="';
+e[a++]=n.id;
+e[a++]='_WidthAuto" type="radio" /></td><td style="padding-right: 3px" id="';
+e[a++]=n.id;
+e[a++]='_Width"></td><td id="';
+e[a++]=n.id;
+e[a++]='_WidthUnit"></td></tr></table></td></tr></table><table cellspacing="0" id="';
+e[a++]=n.id;
+e[a++]='_AdvancedMode1" style="margin-top: 4px; display: none"><tr><td class="Label">';
+e[a++]=ZmMsg.tableAlignment;
+e[a++]='</td><td class="col2" id="';
+e[a++]=n.id;
+e[a++]='_Align"></td><td class="VSep-L">&nbsp;</td><td class="VSep-R">&nbsp;</td><td><table cellpadding="1" cellspacing="1"><tr><td><input type="checkbox" id="';
+e[a++]=n.id;
+e[a++]='_FixedLayout" /></td><td><label for="';
+e[a++]=n.id;
+e[a++]='_FixedLayout">';
+e[a++]=ZmMsg.fixedCellWidth;
+e[a++]='</label></td></tr></table></td></tr></table></fieldset><fieldset class="ZmFieldset"><legend class="ZmLegend">';
+e[a++]=ZmMsg.textStyle;
+e[a++]='</legend><table cellspacing="0"><tr><td class="Label">';
+e[a++]=ZmMsg.textAlign;
+e[a++]='</td><td class="col2" id="';
+e[a++]=n.id;
+e[a++]='_TextAlign"></td><td class="VSep-L">&nbsp;</td><td class="VSep-R">&nbsp;</td><td class="Label">';
+e[a++]=ZmMsg.fontColorLabel;
+e[a++]='</td><td id="';
+e[a++]=n.id;
+e[a++]='_ForegroundColor"></td></tr><tr><td class="Label">';
+e[a++]=ZmMsg.verticalAlign;
+e[a++]='</td><td id="';
+e[a++]=n.id;
+e[a++]='_TextVAlign"></td><td class="VSep-L">&nbsp;</td><td class="VSep-R">&nbsp;</td><td class="Label">';
+e[a++]=ZmMsg.fontBackgroundLabel;
+e[a++]='</td><td id="';
+e[a++]=n.id;
+e[a++]='_BackgroundColor"></td></tr></table></fieldset><fieldset class="ZmFieldset"><legend class="ZmLegend">';
+e[a++]=ZmMsg.borderStyle;
+e[a++]='</legend><table cellspacing="0"><tr><td class="Label">';
+e[a++]=ZmMsg.borderWidth;
+e[a++]='</td><td class="col2" id="';
+e[a++]=n.id;
+e[a++]='_BorderWidth"></td><td class="VSep-L">&nbsp;</td><td class="VSep-R">&nbsp;</td><td class="Label">';
+e[a++]=ZmMsg.borderColorLabel;
+e[a++]='</td><td><table cellspacing="0"><tr><td id="';
+e[a++]=n.id;
+e[a++]='_BorderColor"></td></tr></table></td></tr><tr><td class="Label">';
+e[a++]=ZmMsg.cellPadding;
+e[a++]='</td><td id="';
+e[a++]=n.id;
+e[a++]='_CellPadding"></td><td class="VSep-L">&nbsp;</td><td class="VSep-R">&nbsp;</td><td class="Label">';
+e[a++]=ZmMsg.borderStyleLabel;
+e[a++]='</td><td id="';
+e[a++]=n.id;
+e[a++]='_BorderStyle"></td></tr><tr id="';
+e[a++]=n.id;
+e[a++]='_AdvancedMode2" style="display: none"><td class="Label">';
+e[a++]=ZmMsg.cellSpacing;
+e[a++]='</td><td id="';
+e[a++]=n.id;
+e[a++]='_BorderSpacing"></td><td class="VSep-L">&nbsp;</td><td class="VSep-R">&nbsp;</td><td colspan="2" style="padding: 2px 0 2px 0"><table cellpadding="1" cellspacing="1" align="center"><tr><td><input type="checkbox" id="';
+e[a++]=n.id;
+e[a++]='_BorderCollapse" /></td><td><label for="';
+e[a++]=n.id;
+e[a++]='_BorderCollapse">';
+e[a++]=ZmMsg.collapsedBorders;
+e[a++]="</label></td></tr></table></td></tr></table></fieldset></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Dialogs#TableProperties"}
+,false);
+AjxTemplate.register("share.Dialogs",AjxTemplate.getTemplate("share.Dialogs#TableProperties"),AjxTemplate.getParams("share.Dialogs#TableProperties"));
+AjxTemplate.register("share.Dialogs#CellProperties",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]='<table class="ZmHEDialog"><tr><td><fieldset class="ZmFieldset"><legend class="ZmLegend">';
+e[a++]=ZmMsg.borderStyle;
+e[a++]='</legend><table width="100%"><tr><td style="width: 19em"><!-- If you\'re wondering why this has to be so complex, check out this bug:\n';
+e[a++]='\t\t\t\t\t\t\t\thttps://bugzilla.mozilla.org/show_bug.cgi?id=258255 --><div style="padding-left: 1em; padding-top: 1em">';
+e[a++]=ZmMsg.clickToDrawABorder;
+e[a++]='</div><div style="margin-top: 10px;"><table align="center"><tr><td>';
+e[a++]=ZmMsg.styleLabel;
+e[a++]="</td><td>";
+e[a++]=ZmMsg.colorLabel;
+e[a++]="</td><td>";
+e[a++]=ZmMsg.widthLabel;
+e[a++]='</td></tr><tr><td id="';
+e[a++]=n.id;
+e[a++]='_BorderStyle"></td><td><!-- embedded in a table so the widget doesn\'t enlarge --><table cellspacing="0" cellpadding="0"><tr><td id="';
+e[a++]=n.id;
+e[a++]='_BorderColor"></td></tr></table></td><td id="';
+e[a++]=n.id;
+e[a++]='_BorderWidth"></td></tr></table></div><table id="';
+e[a++]=n.id;
+e[a++]='_PreviewGridHolder" style="width: 100px; height: 100px;" cellspacing="0" cellpadding="0" align="center"><tr><td><table cellspacing="0" cellpadding="0" align="center"><tr><td><table id="';
+e[a++]=n.id;
+e[a++]='_PreviewGrid" style="border-collapse: collapse; background-color: #fff; border: 1px dashed #ccc;" cellspacing="0" cellpadding="0"><tr><td style="border: 1px dashed #ccc;"><div style="width: 30px; height: 30px;"></div></td><td style="border: 1px dashed #ccc;"><div style="width: 30px; height: 30px;"></div></td></tr><tr><td style="border: 1px dashed #ccc;"><div style="width: 30px; height: 30px;"></div></td><td style="border: 1px dashed #ccc;"><div style="width: 30px; height: 30px;"></div></td></tr></table></td></tr></table></td></tr></table></td><td class="VSep-L">&nbsp;</td><td class="VSep-R">&nbsp;</td><td valign="top"><div style="padding-left: 1em; padding-top: 1em; padding-bottom: 1em">';
+e[a++]=ZmMsg.orPickAStyleBelow;
+e[a++]='</div><table align="center" id="';
+e[a++]=n.id;
+e[a++]='_QuickBorders"><tr><td></td><td></td><td></td><td></td><td></td></tr></table></td></tr></table></fieldset><fieldset class="ZmFieldset"><legend class="ZmLegend">';
+e[a++]=ZmMsg.layout;
+e[a++]='</legend><table cellspacing="0"><tr><td class="Label"><table align="right" cellspacing="0" cellpadding="0"><tr><td style="padding-right: 3px"><input id="';
+e[a++]=n.id;
+e[a++]='_EnableWidth" type="checkbox" /></td><td><label for="';
+e[a++]=n.id;
+e[a++]='_EnableWidth">';
+e[a++]=ZmMsg.widthLabel;
+e[a++]='</label></td></tr></table></td><td class="col2" id="';
+e[a++]=n.id;
+e[a++]='_Width"></td><td class="VSep-L">&nbsp;</td><td class="VSep-R">&nbsp;</td><td class="Label"><table align="right" cellspacing="0" cellpadding="0"><tr><td style="padding-right: 3px"><input id="';
+e[a++]=n.id;
+e[a++]='_EnableHorizPadding" type="checkbox" /></td><td><label for="';
+e[a++]=n.id;
+e[a++]='_EnableHorizPadding">';
+e[a++]=ZmMsg.paddingHorizontal;
+e[a++]='</label></td></tr></table></td><td id="';
+e[a++]=n.id;
+e[a++]='_HorizPadding"></td></tr><tr><td class="Label"><table align="right" cellspacing="0" cellpadding="0"><tr><td style="padding-right: 3px"><input id="';
+e[a++]=n.id;
+e[a++]='_EnableHeight" type="checkbox" /></td><td><label for="';
+e[a++]=n.id;
+e[a++]='_EnableHeight">';
+e[a++]=ZmMsg.heightLabel;
+e[a++]='</label></td></tr></table></td><td class="col2" id="';
+e[a++]=n.id;
+e[a++]='_Height"></td><td class="VSep-L">&nbsp;</td><td class="VSep-R">&nbsp;</td><td class="Label"><table align="right" cellspacing="0" cellpadding="0"><tr><td style="padding-right: 3px"><input id="';
+e[a++]=n.id;
+e[a++]='_EnableVertPadding" type="checkbox" /></td><td><label for="';
+e[a++]=n.id;
+e[a++]='_EnableVertPadding">';
+e[a++]=ZmMsg.paddingVertical;
+e[a++]='</label></td></tr></table></td><td id="';
+e[a++]=n.id;
+e[a++]='_VertPadding"></td></tr></table></fieldset><fieldset class="ZmFieldset"><legend class="ZmLegend">';
+e[a++]=ZmMsg.textStyle;
+e[a++]='</legend><table cellspacing="0"><tr><td class="Label"><table align="right" cellspacing="0" cellpadding="0"><tr><td style="padding-right: 3px"><input id="';
+e[a++]=n.id;
+e[a++]='_EnableTextAlign" type="checkbox" /></td><td><label for="';
+e[a++]=n.id;
+e[a++]='_EnableTextAlign">';
+e[a++]=ZmMsg.textAlign;
+e[a++]='</label></td></tr></table></td><td class="col2" id="';
+e[a++]=n.id;
+e[a++]='_TextAlign"></td><td class="VSep-L">&nbsp;</td><td class="VSep-R">&nbsp;</td><td class="Label"><table align="right" cellspacing="0" cellpadding="0"><tr><td style="padding-right: 3px"><input id="';
+e[a++]=n.id;
+e[a++]='_EnableForegroundColor" type="checkbox" /></td><td><label for="';
+e[a++]=n.id;
+e[a++]='_EnableForegroundColor">';
+e[a++]=ZmMsg.fontColorLabel;
+e[a++]='</label></td></tr></table></td><td id="';
+e[a++]=n.id;
+e[a++]='_ForegroundColor"></td></tr><tr><td class="Label"><table align="right" cellspacing="0" cellpadding="0"><tr><td style="padding-right: 3px"><input id="';
+e[a++]=n.id;
+e[a++]='_EnableTextVAlign" type="checkbox" /></td><td><label for="';
+e[a++]=n.id;
+e[a++]='_EnableTextVAlign">';
+e[a++]=ZmMsg.verticalAlign;
+e[a++]='</label></td></tr></table></td><td class="col2" id="';
+e[a++]=n.id;
+e[a++]='_TextVAlign"></td><td class="VSep-L">&nbsp;</td><td class="VSep-R">&nbsp;</td><td class="Label"><table align="right" cellspacing="0" cellpadding="0"><tr><td style="padding-right: 3px"><input id="';
+e[a++]=n.id;
+e[a++]='_EnableBackgroundColor" type="checkbox" /></td><td><label for="';
+e[a++]=n.id;
+e[a++]='_EnableBackgroundColor">';
+e[a++]=ZmMsg.fontBackgroundLabel;
+e[a++]='</label></td></tr></table></td><td id="';
+e[a++]=n.id;
+e[a++]='_BackgroundColor"></td></tr></table></fieldset></td></tr></table>';
+return o?e.length:e.join("")
+}
+,{
+id:"share.Dialogs#CellProperties"}
+,false);
+AjxTemplate.register("share.Dialogs#EditorInsertLink",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]='<table class="ZmHEDialog"><tr><td><fieldset class="ZmFieldset"><legend class="ZmLegend">';
+e[a++]=ZmMsg.linkText;
+e[a++]="</legend>";
+e[a++]=ZmMsg.linkTextDesc;
+e[a++]='<br /><div id="';
+e[a++]=n.id;
+e[a++]='_linkTextCont"></div></fieldset><fieldset class="ZmFieldset"><legend class="ZmLegend">';
+e[a++]=ZmMsg.linkTarget;
+e[a++]="</legend>";
+e[a++]=ZmMsg.linkTargetDesc;
+e[a++]='<br /><table cellspacing="0" cellpadding="0"><tr><td id="';
+e[a++]=n.id;
+e[a++]='_linkTargetCont" style="padding-right: 5px"></td><td id="';
+e[a++]=n.id;
+e[a++]='_testBtnCont"></td></tr></table></fieldset></td></tr></table>';
+return o?e.length:e.join("")
+}
+,{
+id:"share.Dialogs#EditorInsertLink"}
+,false);
+AjxTemplate.register("share.Dialogs#NewSearch",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table cellpadding='0' cellspacing='0' border='0' ";
+e[a++]=AjxEnv.isWebKitBased?"width='320'>":">";
+e[a++]="<tr><td class='Label' colspan=2 style='padding: 0px 0px 5px 0px;'>";
+e[a++]=ZmMsg.searchName;
+e[a++]=" </td></tr><tr><td><input autocomplete=OFF type='text' class='Field' id='";
+e[a++]=n.id;
+e[a++]="_nameField' /></td></tr><tr><td>&nbsp;</td></tr><tr><td><div id='";
+e[a++]=n.id;
+e[a++]='_overviewDiv\'><div class="Label">';
+e[a++]=ZmMsg.newSearchParent;
+e[a++]="</div><div id='";
+e[a++]=n.id;
+e[a++]="_folderTreeCell'></div></div></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Dialogs#NewSearch"}
+,false);
+AjxTemplate.register("share.Dialogs#ZmMountFolderDialog",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table border=0 width=375><tr><td colspan=2>";
+e[a++]=ZmMsg.mountInstructions1;
+e[a++]="</td></tr><tr><td width=50 align=right>";
+e[a++]=ZmMsg.emailLabel;
+e[a++]="</td><td id='";
+e[a++]=n.id;
+e[a++]="_email'></td></tr><tr><td width=50 align=right>";
+e[a++]=ZmMsg.pathLabel;
+e[a++]="</td><td id='";
+e[a++]=n.id;
+e[a++]="_path'></td></tr><tr><td><br></td></tr><tr><td colspan=2>";
+e[a++]=ZmMsg.mountInstructions2;
+e[a++]="</td></tr><tr><td width=50 align=right>";
+e[a++]=ZmMsg.nameLabel;
+e[a++]="</td><td id='";
+e[a++]=n.id;
+e[a++]="_name'></td></tr><tr><td width=50 align=right>";
+e[a++]=ZmMsg.colorLabel;
+e[a++]="</td><td id='";
+e[a++]=n.id;
+e[a++]="_color'></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Dialogs#ZmMountFolderDialog"}
+,false);
+AjxTemplate.register("share.Dialogs#ZmPromptDialog",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table cellpadding=2 cellspacing=0 border=0><tr><td class='Label' id='";
+e[a++]=n.id;
+e[a++]="_label'/></tr><tr><td><input type=";
+e[a++]=n.type;
+e[a++]=" autocomplete=OFF class='Field' id='";
+e[a++]=n.id;
+e[a++]="_name' /></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Dialogs#ZmPromptDialog"}
+,false);
+AjxTemplate.register("share.Dialogs#ZmPromptDialog",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table cellpadding=2 cellspacing=0 border=0><tr><td class='Label'>";
+e[a++]=ZmMsg.tagName;
+e[a++]=":</td>";
+if(appCtxt.multiAccounts){
+e[a++]="<td class='Label'>";
+e[a++]=ZmMsg.colorLabel;
+e[a++]="</td><td class='Label'>";
+e[a++]=ZmMsg.accountLabel;
+e[a++]="</td>"
+}
+e[a++]="</tr><tr><td><input type=text autocomplete=OFF id='";
+e[a++]=n.id;
+e[a++]="_name' /></td><td id='";
+e[a++]=n.id;
+e[a++]="_tagColor' style=\"padding-right: 16px;\"></td><td id='";
+e[a++]=n.id;
+e[a++]="_account'></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Dialogs#ZmPromptDialog"}
+,false);
+AjxTemplate.register("share.Dialogs#ZmTimezonePicker",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table cellpadding=4 cellspacing=0 border=0><tr><td colspan='2' class='Label'>";
+e[a++]=ZmMsg.selectTimezoneInfo;
+e[a++]="</td></tr><tr><td width=50 align=right>";
+e[a++]=ZmMsg.selectTimezoneLabel;
+e[a++]="</td><td id='";
+e[a++]=n.id;
+e[a++]="_tzSelect'></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Dialogs#ZmTimezonePicker"}
+,false);
+AjxTemplate.register("share.Dialogs#ZmAttachDialog-MyComputerTab",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div style='overflow:auto'><form accept-charset='utf-8' method='POST' action='";
+e[a++]=n.uri;
+e[a++]="' id='";
+e[a++]=n.id;
+e[a++]="_uploadForm' enctype='multipart/form-data'><input type='hidden' name='_charset_' /><table id='";
+e[a++]=n.id;
+e[a++]="_attachmentTable' cellspacing=0 cellpadding=0 border=0 class='iframeTable'></table></form></div><div><table id='";
+e[a++]=n.id;
+e[a++]="_attachmentButtonTable'></table></div>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Dialogs#ZmAttachDialog-MyComputerTab"}
+,false);
+AjxTemplate.register("share.Dialogs#ZmAttachDialog-MyComputerTab-AddAttachment",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table cellspacing=2 cellpadding=0 border=0><tr><td><div class='attachText'>";
+e[a++]=ZmMsg.attach;
+e[a++]=":</div></td><td class='nobreak'><input id='";
+e[a++]=n.id;
+e[a++]="_input' type='file' name='";
+e[a++]=n.uploadName;
+e[a++]="' size=40>&nbsp;\n";
+e[a++]="\t\t\t\t<span id='";
+e[a++]=n.removeLinkId;
+e[a++]='\' onmouseover=\'this.style.cursor="pointer"\' onmouseout=\'this.style.cursor="default"\' class="ZmAttachDialog-removeLink">';
+e[a++]=ZmMsg.remove;
+e[a++]="</span></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Dialogs#ZmAttachDialog-MyComputerTab-AddAttachment"}
+,false);
+AjxTemplate.register("share.Dialogs#ZmNewOrgDialogRemote",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<tr><td colspan=2><table cellpadding=0 cellspacing=5 border=0><tr valign='center'><td class='Label'><input type='checkbox' id='";
+e[a++]=n.id;
+e[a++]="_remote' /></td><td>\n";
+e[a++]="\t\t\t\t\t\t";
+e[a++]=n.remoteLabel;
+e[a++]="\n";
+e[a++]="\t\t\t\t\t</td></tr></table></td></tr><tr style='display:none;' id='";
+e[a++]=n.id;
+e[a++]="_remoteURLrow' valign='center'><td class='Label'>";
+e[a++]=ZmMsg.urlLabel;
+e[a++]="</td><td><input autocomplete='off' type='text' class='Field' id='";
+e[a++]=n.id;
+e[a++]="_remoteURLfield' /></td></tr>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Dialogs#ZmNewOrgDialogRemote"}
+,false);
+AjxTemplate.register("share.Dialogs#ZmNewOrgDialogName",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<tr valign='center'><td class='Label'>";
+e[a++]=ZmMsg.nameLabel;
+e[a++]="</td><td><input autocomplete='off' type='text' class='Field' id='";
+e[a++]=n.id;
+e[a++]="_name' /></td></tr>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Dialogs#ZmNewOrgDialogName"}
+,false);
+AjxTemplate.register("share.Dialogs#ZmNewOrgDialogColor",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<tr><td class='Label'>";
+e[a++]=ZmMsg.colorLabel;
+e[a++]="</td><td id='";
+e[a++]=n.id;
+e[a++]="_colorSelect'></td></tr>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Dialogs#ZmNewOrgDialogColor"}
+,false);
+AjxTemplate.register("share.Dialogs#ZmNewOrgDialogFolder",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<tr><td class='Label' colspan=2>";
+e[a++]=ZmMsg.newFolderParent;
+e[a++]="</td></tr><tr><td colspan=2 id='";
+e[a++]=n.id;
+e[a++]="_folderTree'></td></tr>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Dialogs#ZmNewOrgDialogFolder"}
+,false);
+AjxTemplate.register("share.Dialogs#ZmNewCalDialogFreeBusy",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<tr><td colspan=2><table cellpadding=0 cellspacing=5 border=0><tr valign='center'><td class='Label'><input type='checkbox' id='";
+e[a++]=n.id;
+e[a++]="_excludeFbCheckbox' /></td><td>";
+e[a++]=ZmMsg.excludeFromFreeBusy;
+e[a++]="</td></tr></table></td></tr>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Dialogs#ZmNewCalDialogFreeBusy"}
+,false);
+AjxTemplate.register("share.Dialogs#ZmRenameDialog",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table cellpadding='0' cellspacing='0' border='0'><tr><td class='Label' colspan=2 style='padding: 0px 0px 5px 0px;'>";
+e[a++]=n.newLabel;
+e[a++]=": </td></tr><tr><td><input type='text' autocomplete='off' class='Field' id='";
+e[a++]=n.id;
+e[a++]="_name' /></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Dialogs#ZmRenameDialog"}
+,false)
+}
+if(AjxPackage.define("share.Quota")){
+AjxTemplate.register("share.Quota#UsedLimited",function(t,r,s,e){
+var n=Boolean(e);
+s=(typeof s=="string"?{
+id:s}
+:s)||{};
+e=e||[];
+var o=e.length;
+var a="quotaUsed";
+if(s.percent<85&&s.percent>65){
+a="quotaWarning"
+}else{
+if(s.percent>=85){
+a="quotaCritical"
+}}
+e[o++]="<table class='BannerBar' cellspacing=0 cellpadding=0><tr><td width='50%'><div></div></td><td><div class='quotabar'><div style='width:";
+e[o++]=s.percent;
+e[o++]="' class='";
+e[o++]=a;
+e[o++]="'></div></div></td><td width='50%'><div></div></td></tr></table>";
+return n?e.length:e.join("")
+}
+,{
+"class":"BannerBar",id:"share.Quota#UsedLimited"}
+,false);
+AjxTemplate.register("share.Quota",AjxTemplate.getTemplate("share.Quota#UsedLimited"),AjxTemplate.getParams("share.Quota#UsedLimited"));
+AjxTemplate.register("share.Quota#UsedUnlimited",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table cellspacing=0 cellpadding=0 width='100%'><tr><td class='BannerTextQuota'>";
+e[a++]=n.desc;
+e[a++]="</td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Quota#UsedUnlimited"}
+,false);
+AjxTemplate.register("share.Quota#Tooltip",function(t,r,s,e){
+var n=Boolean(e);
+s=(typeof s=="string"?{
+id:s}
+:s)||{};
+e=e||[];
+var o=e.length;
+e[o++]="<table>";
+if(s.username!=s.login){
+e[o++]="<tr><td><center>";
+e[o++]=s.login;
+e[o++]="</center></td></tr>"
+}
+if(s.quota){
+var a=AjxMessageFormat.format(ZmMsg.quotaDescLimited,[s.size,s.limit]);
+e[o++]="<tr><td><center>";
+e[o++]=ZmMsg.quota;
+e[o++]=": ";
+e[o++]=s.percent;
+e[o++]="% (";
+e[o++]=a;
+e[o++]=")</center></td></tr>"
+}
+e[o++]="</table>";
+return n?e.length:e.join("")
+}
+,{
+id:"share.Quota#Tooltip"}
+,false)
+}
+if(AjxPackage.define("share.Widgets")){
+AjxTemplate.register("share.Widgets#ZmToolBarSeparator",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table><tr><td id='";
+e[a++]=n.itemId;
+e[a++]="' valign='middle'><div class='vertSep'></div></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Widgets#ZmToolBarSeparator"}
+,false);
+AjxTemplate.register("share.Widgets",AjxTemplate.getTemplate("share.Widgets#ZmToolBarSeparator"),AjxTemplate.getParams("share.Widgets#ZmToolBarSeparator"));
+AjxTemplate.register("share.Widgets#ZmAppChooser",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table class='ZToolbarTable' border=0 cellpadding=0 cellspacing=0><tr valign='bottom' id='";
+e[a++]=n.id;
+e[a++]="_items'><td id='";
+e[a++]=n.id;
+e[a++]='_suffix\' valign=bottom><div class=\'ZAppTabSpacer\'></div></td><td width="100%" valign="middle" align="right" style="padding-right: 10px;" id="admin_link_container">\n';
+e[a++]=" &nbsp;\n";
+e[a++]=" </td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+"class":"ZWidget",id:"share.Widgets#ZmAppChooser"}
+,false);
+AjxTemplate.register("share.Widgets#ZmAppChooserItem",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]=AjxTemplate.expand("dwt.Widgets#ZToolbarItem",n);
+return o?e.length:e.join("")
+}
+,{
+id:"share.Widgets#ZmAppChooserItem"}
+,false);
+AjxTemplate.register("share.Widgets#ZmAppChooserButton",function(a,r,s,t){
+var n=Boolean(t);
+s=(typeof s=="string"?{
+id:s}
+:s)||{};
+t=t||[];
+var o=t.length;
+var e=s.buttonClass||"AppTab";
+t[o++]="<table class='ZWidgetTable Z";
+t[o++]=e;
+t[o++]="Table Z";
+t[o++]=e;
+t[o++]="Border' cellspacing=0 cellpadding=0 style='table-layout:auto;'><tr><td id='";
+t[o++]=s.id;
+t[o++]="_left_icon' \tclass='ZLeftIcon ZWidgetIcon'></td><td id='";
+t[o++]=s.id;
+t[o++]="_title'\t\tclass='ZWidgetTitle'></td><td id='";
+t[o++]=s.id;
+t[o++]="_right_icon' \tclass='ZRightIcon ZWidgetIcon'></td></tr></table>";
+return n?t.length:t.join("")
+}
+,{
+"class":"ZAppTab",id:"share.Widgets#ZmAppChooserButton"}
+,false);
+AjxTemplate.register("share.Widgets#ZmAppChooserButton",function(a,r,s,t){
+var n=Boolean(t);
+s=(typeof s=="string"?{
+id:s}
+:s)||{};
+t=t||[];
+var o=t.length;
+var e=s.buttonClass||"AppTab";
+t[o++]="<table class='ZWidgetTable Z";
+t[o++]=e;
+t[o++]="Table Z";
+t[o++]=e;
+t[o++]="Border' cellspacing=0 cellpadding=0 style='table-layout:auto;'><tr><td id='";
+t[o++]=s.id;
+t[o++]="_left_icon' \tclass='ZLeftIcon ZWidgetIcon'></td><td id='";
+t[o++]=s.id;
+t[o++]="_title'\t\tclass='ZWidgetTitle'></td><td id='";
+t[o++]=s.id;
+t[o++]="_right_icon' \tclass='ZRightIcon ZWidgetIcon'></td></tr></table>";
+return n?t.length:t.join("")
+}
+,{
+"class":"ZAppTab",id:"share.Widgets#ZmAppChooserButton"}
+,false);
+AjxTemplate.register("share.Widgets#ZmAppChooserSpacer",function(a,r,s,t){
+var n=Boolean(t);
+s=(typeof s=="string"?{
+id:s}
+:s)||{};
+t=t||[];
+var o=t.length;
+var e=s.buttonClass||"AppTab";
+t[o++]="<div class='Z";
+t[o++]=e;
+t[o++]="Spacer'></div>";
+return n?t.length:t.join("")
+}
+,{
+id:"share.Widgets#ZmAppChooserSpacer"}
+,false);
+AjxTemplate.register("share.Widgets#ZToast",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div class='ZToastBG'><div class='ZToastContent'><div id='";
+e[a++]=n.id;
+e[a++]="_icon' class='ZToastIcon'></div><div id='";
+e[a++]=n.id;
+e[a++]="_text' class='ZToastText'></div></div></div>";
+return o?e.length:e.join("")
+}
+,{
+"class":"ZToastInfo",id:"share.Widgets#ZToast"}
+,false);
+AjxTemplate.register("share.Widgets#ZmSearchToolBar",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<table border=0 cellpadding=0 cellspacing=0 width='100%' height='100%'><tr><td id='";
+e[a++]=n.id;
+e[a++]="_inputField' width='100%' class='ZmSearchToolbarCell'></td><td id='";
+e[a++]=n.id;
+e[a++]="_searchMenuButton' class='ZmSearchToolbarCell'></td><td id='";
+e[a++]=n.id;
+e[a++]="_searchButton' hint='text' class='ZmSearchToolbarCell'></td><!-- UNCOMMENT THIS IF YOU WANT CUSTOM SEARCH TO APPEAR AS A SEPARATE BUTTON ON SEARCH TOOLBAR\n";
+e[a++]="\t\t\t<td class='ZmSearchToolbarSeparatorCell'><div id='";
+e[a++]=n.id;
+e[a++]="_customSearchButtonSep' class='vertSep' style='display:none'></div></td><td id='";
+e[a++]=n.id;
+e[a++]="_customSearchButton' class='ZmSearchToolbarCell'></td>\n";
+e[a++]="\t\t\t--><td class='ZmSearchToolbarSeparatorCell'><div class='vertSep'></div></td><td id='";
+e[a++]=n.id;
+e[a++]="_saveButton' hint='text' class='ZmSearchToolbarCell'></td><td class='ZmSearchToolbarSeparatorCell'><div class='vertSep'></div></td><td id='";
+e[a++]=n.id;
+e[a++]="_advancedButton' hint='text' class='ZmSearchToolbarCell'></td></tr></table>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Widgets#ZmSearchToolBar"}
+,false);
+AjxTemplate.register("share.Widgets#ZmChooseFolderDialog",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div class='ChooserDialog'><span id='";
+e[a++]=n.id;
+e[a++]="_folderDescDivId' style='margin: 0; margin-bottom: 2px'></span><div>";
+e[a++]=ZmMsg.chooserDescription;
+e[a++]="</div><div id='";
+e[a++]=n.id;
+e[a++]="_inputDivId'></div><div class='overview' id='";
+e[a++]=n.id;
+e[a++]="_folderTreeDivId'></div></div>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Widgets#ZmChooseFolderDialog"}
+,false);
+AjxTemplate.register("share.Widgets#ZmPickTagDialog",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div class='ChooserDialog'><div style='width:300px'>";
+e[a++]=ZmMsg.chooserDescription;
+e[a++]="</div><div id='";
+e[a++]=n.id;
+e[a++]="_inputDivId'></div><div style='background-color:white; width:100%; overflow:auto' id='";
+e[a++]=n.id;
+e[a++]="_tagTreeDivId'></div></div>";
+return o?e.length:e.join("")
+}
+,{
+id:"share.Widgets#ZmPickTagDialog"}
+,false)
+}
+if(AjxPackage.define("zimbra.Widgets")){
+AjxTemplate.register("zimbra.Widgets#ZmErrorDialogControls",function(t,s,n,e){
+var o=Boolean(e);
+n=(typeof n=="string"?{
+id:n}
+:n)||{};
+e=e||[];
+var a=e.length;
+e[a++]="<div id='";
+e[a++]=n.id;
+e[a++]="_buttons' class='DwtDialogButtonBar'>";
+if(AjxEnv.isNav){
+e[a++]="<input type='button' id='";
+e[a++]=n.id;
+e[a++]="_focus' style='height:0px;width:0px;display:none;'>"
+}
+e[a++]="</div>";
+return o?e.length:e.join("")
+}
+,{
+width:"20",height:"32",id:"zimbra.Widgets#ZmErrorDialogControls"}
+,false);
+AjxTemplate.register("zimbra.Widgets",AjxTemplate.getTemplate("zimbra.Widgets#ZmErrorDialogControls"),AjxTemplate.getParams("zimbra.Widgets#ZmErrorDialogControls"))
+};
+
+
+
+
+function ZmSkin(A){this.hints=this.mergeObjects(ZmSkin.hints,A)
+}ZmSkin.hints={name:"sand",version:"2",skin:{containers:"skin_outer"},banner:{position:"static",url:""},userInfo:{position:"static"},search:{position:"static"},quota:{position:"static"},presence:{width:"40px",height:"24px"},appView:{position:"static"},searchBuilder:{containers:["skin_tr_search_builder"]},tree:{minWidth:parseInt("150px"),maxWidth:parseInt("300px"),containers:["skin_td_tree","skin_td_tree_app_sash"],resizeContainers:["skin_td_tree"]},topToolbar:{containers:"skin_tr_top_toolbar"},treeFooter:{containers:"skin_tr_tree_footer"},topAd:{containers:"skin_tr_top_ad"},sidebarAd:{containers:"skin_td_sidebar_ad"},bottomAd:{containers:"skin_tr_bottom_ad"},treeTopAd:{containers:"skin_tr_tree_top_ad"},treeBottomAd:{containers:"skin_tr_tree_bottom_ad"},helpButton:{style:"link",container:"quota",url:""},logoutButton:{style:"link",container:"quota"},appChooser:{position:"static",direction:"LR"},toast:{location:"N",transitions:[{type:"slide-in",step:1,duration:10},{type:"pause",duration:2500},{type:"slide-out",step:-1,duration:25}]},fullScreen:{containers:["!skin_td_tree","!skin_td_tree_app_sash"]},allAds:{containers:["skin_tr_top_ad","skin_td_sidebar_ad","skin_tr_bottom_ad","skin_tr_tree_top_ad","skin_tr_tree_bottom_ad"]}};
+window.BaseSkin=ZmSkin;
+ZmSkin.prototype={show:function(C,G){var F=this.hints[C]&&this.hints[C].containers;
+if(F){if(typeof F=="function"){F.apply(this,[G!=false]);
+skin._reflowApp();
+return
+}if(typeof F=="string"){F=[F]
+}for(var E=0;
+E<F.length;
+E++){var D=F[E];
+var B=D.replace(/^!/,"");
+var A=D!=B;
+this._showEl(B,A?!G:G)
+}skin._reflowApp()
+}},hide:function(A){this.show(A,false)
+},gotoApp:function(A,B){appCtxt.getAppController().activateApp(A,null,B)
+},gotoPrefs:function(A){if(appCtxt.getCurrentAppName()!=ZmApp.PREFERENCES){var B=new AjxCallback(this,this._gotoPrefPage,[A]);
+this.gotoApp(ZmApp.PREFERENCES,B)
+}else{this._gotoPrefPage(A)
+}},mergeObjects:function(A,D){if(A==null){A={}
+}for(var C=1;
+C<arguments.length;
+C++){var E=arguments[C];
+for(var B in E){var F=A[B];
+if(typeof F=="object"&&!(F instanceof Array)){this.mergeObjects(A[B],E[B]);
+continue
+}if(!A[B]){A[B]=E[B]
+}}}return A
+},getTreeWidth:function(){return Dwt.getSize(this._getEl(this.hints.tree.containers[0])).x
+},setTreeWidth:function(A){this._setContainerSizes("tree",A,null)
+},showTopAd:function(A){skin._showEl("skin_tr_top_ad",A);
+skin._reflowApp()
+
+},hideTopAd:function(){skin.showTopAd(false)
+},getTopAdContainer:function(){return skin._getEl("skin_container_top_ad")
+},showSidebarAd:function(A){var B="skin_td_sidebar_ad";
+if(A!=null){skin._setSize(B,A)
+}skin._showEl(B);
+skin._reflowApp()
+},hideSidebarAd:function(){var A="skin_td_sidebar_ad";
+skin._hideEl(A);
+skin._reflowApp()
+},getSidebarAdContainer:function(){return this._getEl("skin_container_sidebar_ad")
+},_getEl:function(A){return(typeof A=="string"?document.getElementById(A):A)
+},_showEl:function(E,D){var B=this._getEl(E);
+if(!B){return
+}var C;
+if(D==false){C="none"
+}else{var A=B.tagName;
+if(A=="TD"&&!document.all){C="table-cell"
+}else{if(A=="TR"&&!document.all){C="table-row"
+}else{C="block"
+}}}B.style.display=C
+},_hideEl:function(A){this._showEl(A,false)
+},_reparentEl:function(D,A){var C=this._getEl(A);
+var B=C&&this._getEl(D);
+if(B){C.appendChild(B)
+}},_setSize:function(D,C,A){var B=this._getEl(D);
+if(!B){return
+}if(C!=null){B.style.width=C
+}if(A!=null){B.style.height=A
+}},_setContainerSizes:function(E,C,A){var D=this.hints[E].resizeContainers||this.hints[E].containers;
+for(var B=0;
+B<D.length;
+B++){this._setSize(D[B],C,null)
+}},_reflowApp:function(){if(window._zimbraMail){window._zimbraMail.getAppViewMgr().fitAll()
+}},_gotoPrefPage:function(C){if(C==null){return
+}var D=appCtxt.getApp(ZmApp.PREFERENCES);
+var B=D.getPrefController();
+var A=B.getPrefsView();
+A.selectSection(C)
+}};
+window.skin=new ZmSkin();
+
+
+
+// compile locale specific templates
+for (var pkg in window.AjxTemplateMsg) {
+ var text = AjxTemplateMsg[pkg];
+ AjxTemplate.compile(pkg, true, true, text);
+}
+
+
+
+ var cacheKillerVersion = "091214175450";
+ function launch() {
+ // quit if this function has already been called
+ if (arguments.callee.done) {return;}
+
+ // flag this function so we don't do the same thing twice
+ arguments.callee.done = true;
+
+ // kill the timer
+ if (_timer) {
+ clearInterval(_timer);
+ _timer = null;
+ }
+
+ var prodMode = true;
+ var debugLevel = "";
+ if (!prodMode || debugLevel) {
+ AjxDispatcher.require("Debug");
+ DBG = new AjxDebug(AjxDebug.NONE, null, false);
+ // figure out the debug level
+ if (debugLevel == 't') {
+ DBG.showTiming(true);
+ } else {
+ DBG.setDebugLevel(debugLevel);
+ }
+ }
+
+ AjxHistoryMgr.BLANK_FILE = "/zimbra/public/blankHistory.html";
+ var noSplashScreen = "";
+ var protocolMode = "https";
+
+
+
+ var batchInfoResponse = {}; // Redacted
+
+
+
+
+
+ // NOTE: Domain info settings moved into launch function to
+ // prevent sloppy code from accessing extraneous window
+ // scoped variable.
+
+ var settings = {
+ "dummy":1,
+ "zimbraPrefMailItemsPerPage":"25",
+ "zimbraPrefAdvancedClientEnforceMinDisplay":"TRUE",
+ "zimbraPrefGroupMailBy":"conversation",
+ "zimbraPrefSkin":"sand",
+ "zimbraPrefClientType":"advanced"
+ ,
+ "zimbraFeatureNotebookEnabled":"TRUE",
+ "zimbraFeatureIMEnabled":"FALSE",
+ "zimbraFeatureBriefcasesEnabled":"TRUE",
+ "zimbraFeatureContactsUpsellEnabled":"FALSE",
+ "zimbraFeatureVoiceEnabled":"FALSE",
+ "zimbraFeatureMailUpsellEnabled":"FALSE",
+ "zimbraFeatureContactsEnabled":"TRUE",
+ "zimbraFeatureConversationsEnabled":"TRUE",
+ "zimbraFeaturePortalEnabled":"FALSE",
+ "zimbraFeatureVoiceUpsellEnabled":"FALSE",
+ "zimbraFeatureOptionsEnabled":"TRUE",
+ "zimbraFeatureMailEnabled":"TRUE",
+ "zimbraFeatureTasksEnabled":"TRUE",
+ "zimbraFeatureCalendarEnabled":"TRUE",
+ "zimbraFeatureCalendarUpsellEnabled":"FALSE"
+
+
+
+ };
+
+ var params = {
+ app:"",
+ settings:settings, batchInfoResponse:batchInfoResponse,
+ offlineMode:false, devMode:false,
+ protocolMode:protocolMode, httpPort:"80", httpsPort:"443",
+ noSplashScreen:noSplashScreen
+ };
+ ZmZimbraMail.run(params);
+ }
+
+ // START DOMContentLoaded
+ // Mozilla and Opera 9 expose the event we could use
+ if (document.addEventListener) {
+ document.addEventListener("DOMContentLoaded", launch, null);
+
+ // mainly for Opera 8.5, won't be fired if DOMContentLoaded fired already.
+ document.addEventListener("load", launch, null);
+ }
+
+ // for Internet Explorer. readyState will not be achieved on init call
+ if (AjxEnv.isIE && AjxEnv.isWindows) {
+ document.attachEvent("onreadystatechange", function(e) {
+ if (document.readyState == "complete") {
+ launch();
+ }
+ });
+ }
+
+ if (/(WebKit|khtml)/i.test(navigator.userAgent)) { // sniff
+ var _timer = setInterval(function() {
+ if (/loaded|complete/.test(document.readyState)) {
+ launch();
+ // call the onload handler
+ }
+ }, 10);
+ }
+ // END DOMContentLoaded
+
+ AjxCore.addOnloadListener(launch);
+ AjxCore.addOnunloadListener(ZmZimbraMail.unload);
+</script>
+ <script src="unicodecategories.js"></script>
+ <script src="Ast.js"></script>
+ <script src="Tokenizer.js"></script>
+ <script src="ZeParser.js"></script>
+ <!--<script src="Zeon.js"></script>-->
+
+ <script>
+ new function(){
+ var e = document.getElementById('dbg');
+ var p = e;
+ var scripts = ['legacy', 'ball-pool', 'dojo', 'effectgames', 'ext', 'ga', 'gmail', 'gravity', 'jquery', 'jsgb', 'mochikit', 'pipio', 'slides280', 'sunspider', 'tetris', 'twitch', 'twitter', 'v8', 'yui', 'zimbra'];
+ var scriptPointer = 0;
+ // write debug in a very straightforward manner
+ var debug = function(){
+ var f = document.createElement('div');
+ f.innerHTML = Array.prototype.slice.call(arguments).join(', ');
+ p.appendChild(f);
+ return f;
+ };
+ var totals = {
+ mskb: 0,
+ msktok: 0,
+ mskbtok: 0
+ };
+ var bench = function(name){
+ p = document.createElement('div');
+ e.appendChild(p);
+ p.style.cssFloat = 'left';
+ p.style.borderRight = '1px solid black';
+ p.style.borderBottom = '1px solid black';
+ p.style.padding = '0 5px 5px 5px';
+ debug('<b>'+name+'</b>...');
+ var n = 0;
+ var total = [];
+ var size = 0;
+ var tokens = 0;
+ var stats = { minEl: null, minVal: 0, maxEl: null, maxVal: 0};
+ var run = function(){ // give ui some breath to show message ;)
+ var start = +new Date;
+ var inp = document.getElementById(name).text;
+ if (!size) {
+ size = inp.length;
+ debug((size/1024).toFixed(0)+'k');
+ }
+ start = +new Date;
+ var tok = new Tokenizer(inp);
+
+ var stack = [];
+
+ // this does the tokenizing/parsing
+ var zp = new ZeParser(inp, tok, stack);
+ zp.ast = false; // will not work with zeon..
+ zp.parse();
+
+ if (!tokens) {
+ tokens = tok.tokenCount;
+ debug(tokens+' tokens');
+ debug(tok.tokenCountNoWhite+' black');
+ debug(((1 - (tok.tokenCountNoWhite/tokens))*100).toFixed(1)+'% white');
+ //debug('<b>parse</b> : <b>zeon</b>');
+ //debug('<b>parse</b> : <b>zeon</b>');
+ debug('<b>parse</b>');
+ }
+
+ var time = (+new Date) - start;
+
+ var analyzeStart = +new Date;
+
+ if (false && zp.ast) {
+ // this is the analyzing
+ var z = new Zeon(inp, {
+ 'enable jslint': true,
+ 'enable markers': true,
+ 'enable scope depth': true,
+ 'warn if scope depth exceeds': 1,
+ 'enable ruler': true,
+ 'enable type annotations': true,
+ 'minify variable names too': true,
+ 'enable caret popup': true,
+ // ==== jslint toggles ====
+ 'jslint | missing block good': true,
+ 'jslint | missing block bad': true,
+ 'jslint | weak comparison': true,
+ 'jslint | ++ / --': true
+ });
+ z.tree = stack;
+ z.startProcess();
+ }
+
+ var analyzeTime = (+new Date) - analyzeStart;
+
+ //var dom = debug(time+' : '+analyzeTime+' ms');
+ var dom = debug(time+' ms');
+
+ total.push(time);
+ if (!stats.minEl || time < stats.minVal) {
+ stats.minEl = dom;
+ stats.minVal = time;
+ }
+ if (!stats.maxEl || time > stats.maxVal) {
+ stats.maxEl = dom;
+ stats.maxVal = time;
+ }
+
+ if (++n < 10) setTimeout(run, 100);
+ else {
+ console.log(stats)
+ stats.minEl.style.color = 'green';
+ stats.maxEl.style.color = 'red';
+
+ // remove the best and worst result (2 in total)
+ var avg = total.sort(function(a,b){ return a-b; }).slice(1,-1).reduce(function(n, t){ return n+t; }, 0);
+ debug('<b>avg: '+(avg/8)+' ms</b>');
+ var mskb = (avg/8) / (size/1024);
+ totals.mskb += mskb;
+ debug(mskb.toFixed(2)+' ms / kb');
+ var msktok = (avg/8) / (tok.tokenCount/1000);
+ totals.msktok += msktok;
+ debug(msktok.toFixed(2)+' ms / k-tok');
+ var mskbtok = (avg/8) / (tok.tokenCountNoWhite/1000);
+ totals.mskbtok += mskbtok;
+ debug(mskbtok.toFixed(2)+' ms / k-b-tok');
+ if (scriptPointer < scripts.length-1) bench(scripts[++scriptPointer]); // next script
+ else {
+ p = document.createElement('div');
+ e.appendChild(p);
+ p.style.clear = 'both';
+ debug('Averages:');
+ debug('ms / kb:<br/><b>'+(totals.mskb / scripts.length).toFixed(2)+'</b>');
+ debug('ms / 1000 tokens:<br/>'+(totals.msktok / scripts.length).toFixed(2)+'</b>');
+ debug('ms / 1000 black tokens:<br/><b>'+(totals.mskbtok / scripts.length).toFixed(2)+'</b>');
+ }
+ }
+ };
+ setTimeout(run, 100);
+ };
+ bench(scripts[scriptPointer]);
+ };
+ </script>
+ </body>
+</html>